Commit graph

5 commits

Author SHA1 Message Date
blamouche
89ab3ae679 Add eslint-plugin-obsidianmd and resolve every recommended-rule violation
Install the official Obsidian ESLint plugin (with eslint v9 and
@typescript-eslint/parser) and add an eslint.config.mjs flat config
that wires the recommended ruleset to TS files only, with a small
override turning off hardcoded-config-path for the tests directory
(those literal `.obsidian` strings are unit-test fixtures, not real
Obsidian configuration usage). Add an `npm run lint` script and call
it from the CI workflow before tests so guideline violations surface
on every push and PR.

Resolved every reported violation:

- UI text sentence case: button labels @Active file/@Active folder ->
  @active file/@active folder; "(no runtime configured)" placeholder
  capitalised; ribbon tooltip "Open Any AI CLI" -> "Open AI CLI panel";
  command-list placeholders, descriptions, and the runtimes-section
  empty state reworded to drop ambiguous mid-sentence acronyms (PTY,
  CLIs, Node) and quoted button names.
- commands/no-plugin-name-in-command-name: command palette name
  "Open Any AI CLI" -> "Open panel" (Obsidian shows the plugin name
  next to the command, repeating it is redundant).
- prefer-active-doc on globalThis: replace the inline crypto fallback
  in runtime-utils.ts with `import { randomUUID } from "node:crypto"`.
- no-unsupported-api on Workspace.revealLeaf: bump manifest.json
  minAppVersion to 1.7.2 (the version that introduced revealLeaf) and
  await the call. versions.json maps 0.1.38 -> 1.7.2 while older
  entries stay at 1.5.0 so existing downloads keep resolving.

Lint, build, tsc and the 27 vitest cases are all clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 14:20:53 +02:00
blamouche
1b86c7baa9 Add @Active folder button to insert parent folder mention
The new sidebar button sits next to @Active file on the secondary
toolbar row and inserts the parent folder of the currently active note
(vault-relative path with trailing slash) into the running CLI's stdin.
Files at the vault root fall back to inserting @./ so the action still
maps to the working directory the runtime was launched in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 07:50:35 +02:00
blamouche
eb05136a03 Replace fixed Claude/Codex switch with customizable runtime list
Settings now expose a list of CLI runtimes (each with a display name and
launch command) instead of two hardcoded entries. Users can add as many
runtimes as they want from the settings panel, remove unused ones (the
list always keeps at least one entry), and pick the default runtime
through a dropdown listing every configured entry.

The sidebar toolbar replaces the previous Claude/Codex toggle buttons
with a dropdown populated from the same configured list, so switching
runtime is a single action and reflects user-added entries.

A migration helper converts legacy `command`, `codexCommand`, and
`runtime` settings into the new `runtimes` + `selectedRuntimeId` shape
on first load, and the Codex-specific terminal workarounds (no-color
env, terminal reset) are now triggered by `isCodexLikeCommand` so they
keep working regardless of the entry id.

Adds vitest coverage for the migration and codex-like command helpers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 07:27:45 +02:00
blamouche
56ae974759 Add active file mention button for terminal input 2026-03-13 16:56:54 +01:00
blamouche
8f9574e0d0 Translate README to English and finalize plugin runtime/test setup 2026-03-05 09:27:44 +01:00