Commit graph

8 commits

Author SHA1 Message Date
blamouche
560735b898 Activity-aware tab dot + idle auto-close for automation sessions
The session tab status dot now reflects live CLI activity rather than just
whether the process is alive: green = a manual session's AI is working,
purple = an automation session's AI is working, gray = the CLI is idle
(finished its turn) or stopped. CliSession tracks activity continuously —
output flowing = working, quiet for ~5s = idle — and notifies the view via
onActivityChange to repaint the dot.

Add a new opt-in setting "Auto-close automation sessions when idle": closes
an automation tab once its CLI goes quiet after the prompt ran, even if the
process stays interactive (Claude/Codex). It complements the existing
on-exit close (renamed "...on exit"); both are kept. Idle-close is armed only
after the prompt is sent and driven by real CLI output, so boot and slow
first responses don't close the tab early.

Extract the pure tabDotClass helper to session-utils.ts with tests. Update
README. Bump to 0.2.11.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 17:40:03 +02:00
blamouche
073efef75c Run multiple runtimes in parallel via session tabs
Refactor the sidebar panel from a single-process view into a tabbed
multi-session view: each tab is an independent CliSession with its own
PTY process and xterm terminal. A New session / + control opens a session
from any configured runtime; multiple sessions of the same runtime are
allowed and labels are disambiguated. Stop/Restart/Clear and the @file/
@folder buttons act on the active tab; a single ResizeObserver refits only
the visible terminal and re-fits on tab activation.

Automations now spawn their own session tab for the declared runtime (or
the default when none is declared), await CLI readiness, then send the
prompt — replacing the old skip-if-not-running/runtime-mismatch logic.
Add settings autoCloseAutomationSessions and maxConcurrentSessions; the
Automations modal "Run now" button is always enabled.

Extract pure helpers to session-utils.ts (resolveRuntimeForAutomation,
runtimeMatches, nextSessionLabel, canOpenSession) with unit tests. Update
README and the generated example automation. Bump to 0.2.9 (manifest,
versions.json, package.json, prompt-hub version).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 10:12:26 +02:00
blamouche
9577a02278 Add Automations feature: scheduled prompts from a vault folder
A new "Automations" affordance reads markdown files from a configurable
vault folder, parses a frontmatter schedule (`interval` minutes or 5-field
`cron`) plus optional `enabled`/`runtime`/`appendNewline`/`name`, and fires
the file body into the running CLI on schedule or manually from a modal.
Each fire (or skip / error) is logged to a ring-buffer history capped at
200 entries; the modal exposes the entries with status, last/next run, a
per-row Run now button, and a History tab with Clear / Export-as-markdown.

The scheduler runs at the plugin level (`activeWindow.setInterval`, 30 s
tick) and stays alive whether the panel is open or not. The folder cache
live-updates on vault create/modify/delete/rename. Runs skip cleanly when
no CLI is running — the plugin never auto-starts a runtime.

Implementation: pure logic in automation.ts (28 vitest cases), wiring in
main.ts, AutomationsModal in automations-modal.ts. Adds `cron-parser`
(runtime) and `yaml` (dev).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 23:08:28 +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
d5e36349f1 Use vault-relative path for active file mention 2026-03-13 17:01:40 +01: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