Commit graph

1116 commits

Author SHA1 Message Date
RAIT-09
89e2d75c4e
Merge pull request #338 from RAIT-09/dev
0.11.0
2026-06-25 00:45:55 +09:00
RAIT-09
2a2c7e3a56 0.11.0 2026-06-25 00:42:41 +09:00
RAIT-09
57d0b57d4b
Merge pull request #337 from RAIT-09/RAIT-09/refactor/acp-client-builder
refactor(acp): migrate from deprecated ClientSideConnection to client() builder
2026-06-25 00:21:58 +09:00
RAIT-09
62bc70148f
Merge pull request #336 from RAIT-09/experimental/acp-sdk-0.28-migration
feat(acp): migrate to @agentclientprotocol/sdk 0.28.1
2026-06-25 00:15:22 +09:00
RAIT-09
fe1d766c1b refactor(acp): migrate from deprecated ClientSideConnection to client() builder
Replace the deprecated acp.ClientSideConnection with the acp.client()
builder: register client handlers by ACP method name and hold the
persistent connection returned by connect(). Agent RPCs now go through
connection.agent.request("<wire-method>", ...), and session/cancel
through connection.agent.notify(). This is behavior-preserving — the
deprecated constructor built exactly this builder (legacyClientApp)
internally.

Drops the three @typescript-eslint/no-deprecated suppressions and the
extNotification catch-all (#137): on SDK 0.28 unhandled notifications
are silently dropped rather than logged as methodNotFound, so the
anti-spam goal holds; only the debug-log of custom notifications is lost.

Teardown is intentionally left as connection = null (no close()) to
avoid rejecting in-flight requests with a codeless Error that would
surface a spurious error banner.
2026-06-25 00:01:39 +09:00
RAIT-09
f799ad1f2e feat(acp): migrate to @agentclientprotocol/sdk 0.28.1
Bump the ACP SDK from 0.14.1 to 0.28.1 (PROTOCOL_VERSION unchanged, so a
direct jump). Adapt the existing client to the SDK's breaking changes while
keeping existing features working; new 0.28 features (elicitation, NES,
providers, document lifecycle) are out of scope.

- Renames: unstable_listSessions->listSessions, unstable_resumeSession->
  resumeSession (both stabilized); KillTerminalCommand{Request,Response}->
  KillTerminal{Request,Response} (type-only).
- SessionConfigOption became a select|boolean union. The domain type now
  carries boolean as data (UI renders/sets only select for now); the
  converter and all consumers narrow on type === "select".
- The model API (unstable_setSessionModel, SessionModelState) was removed
  from the SDK; model is now a config option. Remove the legacy model path
  (setSessionModel, the model dropdown, SessionModel(State) domain types)
  but KEEP lastUsedModels + the config-option model restore/save that back
  model persistence. Mode keeps its legacy API (still in the SDK).
- zod is now a runtime (peer) dependency of the SDK for schema validation;
  add it to dependencies so it bundles into main.js.
- Restore @eslint/json devDep (legacy-peer-deps had pruned this optional
  peer that the lint config loads).

ClientSideConnection is deprecated in 0.28 (new: client() builder, scoped
connectWith) but kept for now with documented eslint-disables; migrating
the connection lifecycle is a separate follow-up.
2026-06-21 02:50:59 +09:00
RAIT-09
edb1cfc9f0 fix(ci): set legacy-peer-deps to fix npm ci ERESOLVE
vitest@4 declares an optional peer on @types/node>=20 while this project
pins @types/node@^16, so `npm ci` fails with ERESOLVE on npm 10 (node 22
in CI). Accept the resolution so release/CI/docs `npm ci` and local
`npm i` all succeed; the peer is optional and the vitest suite passes.
2026-06-20 14:11:37 +09:00
RAIT-09
4fd2d047c2 Update version to 0.11.0-preview.2 2026-06-20 14:03:12 +09:00
RAIT-09
ca860a3a28
Merge pull request #312 from RAIT-09/experimental/wsl-launch-env-overhaul
WSL: harden agent & terminal launch (--exec + login shell + argv) and forward env via WSLENV
2026-06-20 01:54:20 +09:00
RAIT-09
8628ac84a3 fix(wsl): forward resolved API key into WSL via WSLENV after secret migration
dev resolves built-in agents' API keys from secret storage into baseEnv
just before spawn (not into config.env). #312's WSLENV forwarding ran
before that and built its name list from config.env, so the resolved key
name was never listed and the key never crossed into WSL for built-in
agents in WSL mode.

Move the buildWslEnv call to after secret resolution and include
config.apiKey.envVarName in the forwarded name list. Custom agents
(no config.apiKey) are unchanged.
2026-06-20 01:49:02 +09:00
RAIT-09
f6e081500e Merge branch 'dev' into experimental/wsl-launch-env-overhaul 2026-06-20 01:37:22 +09:00
RAIT-09
dcbfd1b944
Merge pull request #333 from RAIT-09/RAIT-09/fix/preserve-scroll-on-tab-switch
fix(chat): preserve scroll position across chat tab switches (#321)
2026-06-19 18:16:47 +09:00
RAIT-09
e26aacf721 fix(chat): clear per-message size cache on message reset (#321)
The msgId->height cache added for scroll preservation was only ever
written, never cleared, so entries from old sessions lingered in this
long-lived view and grew slowly over many new-chat/restore/fork cycles.

Clear it in the existing empty-messages effect. All reset paths
(new chat, restore, fork, restart) funnel through clearMessages() ->
setMessages([]) first, so a single clear on length===0 covers them all.
Mirrors how useAgentMessages clears toolCallIndexRef on reset.
2026-06-19 18:10:37 +09:00
RAIT-09
4a1bfc27ee fix(chat): preserve scroll position across chat tab switches (#321)
Inactive chat tabs are hidden via display:none with the React tree kept
mounted, so the virtualizer persists. On re-show, items briefly re-measure
small while markdown re-lays-out; recording those shrinks collapsed
getTotalSize(), clamping scrollTop to 0 and losing the position.

Harden measureElement: key the size cache by message id, and during a
short settle window after a hide->show transition refuse to shrink the
cache (return max(measured, cached) without recording). Total size stays
stable, scrollTop is never clamped, and the position is preserved to the
pixel - no programmatic re-scroll, so no races with auto-scroll.
2026-06-19 17:15:10 +09:00
RAIT-09
f78b504bd0
Merge pull request #332 from RAIT-09/RAIT-09/feature/persist-all-config-options
feat(session): persist and restore all config options, not just model/mode
2026-06-19 15:46:27 +09:00
RAIT-09
f4e23f2c69 chore(security): reject __proto__/constructor keys in config-option persistence 2026-06-19 15:43:41 +09:00
RAIT-09
4a5c1736dd feat(session): persist and restore all config options, not just model/mode 2026-06-19 01:15:52 +09:00
RAIT-09
648d8ca137
Merge pull request #331 from RAIT-09/RAIT-09/fix/persist-trailing-message-chunks
fix(chat): persist trailing message chunks after a turn ends
2026-06-19 00:46:16 +09:00
RAIT-09
1fea00911a fix(chat): arm trailing save to real turns and flush it on close 2026-06-19 00:44:46 +09:00
RAIT-09
86bdf6435f fix(chat): persist trailing message chunks after a turn ends 2026-06-19 00:06:21 +09:00
RAIT-09
df19f210dc
Merge pull request #330 from RAIT-09/RAIT-09/fix/session-manager-focus-on-tab-switch
fix(session-manager): update focus highlight when switching chat tabs
2026-06-17 00:32:27 +09:00
RAIT-09
2e596fbbdd fix(session-manager): update focus highlight when switching chat tabs 2026-06-16 23:59:06 +09:00
RAIT-09
73db324891
Merge pull request #329 from RAIT-09/RAIT-09/fix/permission-banner-persists-after-cancel
fix(permission): clear stuck permission buttons after canceling a response
2026-06-16 23:49:20 +09:00
RAIT-09
95d5b5d4f9 refactor(permission): restrict cancel-time replay to terminal permission updates 2026-06-16 23:48:03 +09:00
RAIT-09
6b4e380237 fix(permission): clear stuck permission buttons after canceling a response 2026-06-16 23:36:06 +09:00
RAIT-09
7931316666
Merge pull request #328 from RAIT-09/RAIT-09/fix/display-math-overflow-scroll
fix(markdown): make wide display math horizontally scrollable
2026-06-16 23:20:41 +09:00
RAIT-09
c9ef53482a fix(markdown): make wide display math horizontally scrollable 2026-06-16 23:15:45 +09:00
RAIT-09
2a18566bfd
Merge pull request #327 from RAIT-09/RAIT-09/feature/session-manager-tooltip
feat(session-manager): show full title and agent name on hover
2026-06-16 22:59:54 +09:00
RAIT-09
220fba0b0c feat(session-manager): show full title and agent name on hover via aria-label 2026-06-16 22:48:22 +09:00
RAIT-09
9cbc0d6a42 Merge branch 'master' into dev 2026-06-13 16:58:20 +09:00
RAIT-09
a34ea74d9b
Merge pull request #319 from RAIT-09/experimental/auto-detect-path-fallback
fix: fall back to known install paths in auto-detect on macOS (reduced PATH)
2026-06-13 16:55:37 +09:00
RAIT-09
687845b9bc refactor(paths): dedupe the auto-detect fallback into a local thunk
The err and empty-response branches called the same
findInKnownPaths(...).then(resolve, () => resolve(null)) expression
verbatim; extract it into a small void thunk. Behavior is unchanged.
2026-06-13 16:52:40 +09:00
RAIT-09
b4b3501b0f fix(paths): harden macOS known-paths auto-detect fallback
- only return an executable regular file (match which's contract), fixing
  the case where a directory/non-exec entry could be written into settings
- run the fallback asynchronously (fs/promises) to honor resolveCommandPath's
  non-blocking contract
- guard against path separators in the command name
- always settle the promise even if the fallback rejects
- document the best-effort scope and the intentional WSL/Windows asymmetry

Builds on #317.
2026-06-13 16:33:26 +09:00
RAIT-09
a5f4e8303c
Merge pull request #317 from haydenfd/fix/auto-detect-command-path
fix: fall back to known install paths when shell lookup fails in auto…
2026-06-13 16:03:49 +09:00
Hayden D'Souza
f8f5149cac fix: fall back to known install paths when shell lookup fails in auto-detect, macOS specific (#302) 2026-06-06 16:50:13 -07:00
RAIT-09
8ca27c9b43 Merge branch 'master' into dev 2026-06-06 01:55:49 +09:00
RAIT-09
2feb42b76c chore(license): update copyright year to 2025-2026 and add NOTICE file 2026-06-06 01:55:16 +09:00
RAIT-09
1fbe289522 chore: regenerate package-lock.json 2026-06-05 23:45:27 +09:00
RAIT-09
4cb0fb7c6a Update version to 0.11.0-preview.1 2026-06-05 23:35:58 +09:00
RAIT-09
673ddf9469
Merge pull request #314 from RAIT-09/feature/permission-option-list
feat: redesign permission request options as a vertical icon list
2026-06-05 21:56:10 +09:00
RAIT-09
b109856450 chore(permission): align KIND_ICONS comment with one-line guideline 2026-06-05 21:53:23 +09:00
RAIT-09
90d5e3480f feat(permission): redesign options as vertical icon list
Replace the right-aligned wrapping button row with full-width rows
stacked vertically inside a bordered container, mirroring the diff
block styling within tool calls. Kind semantics move from solid
button backgrounds to a colored Lucide icon per row (check-check /
check / x / ban), gated by displaySettings.showEmojis like other
tool call icons. Long option names truncate with ellipsis and expose
the full text via the title attribute.

Layout is now stable regardless of option name length or view width,
and all !important declarations plus the unreachable selected/disabled
permission styles are removed.
2026-06-05 21:31:47 +09:00
RAIT-09
177408f0bc feat(permission): stop normalizing reject_always to reject_once
Pass the agent-provided option kind through as-is so the UI can
distinguish 'reject once' from 'reject always'. The name-based
inference remains as a fallback for non-conforming agents that
omit kind.
2026-06-05 21:31:47 +09:00
RAIT-09
5aa988091d fix(wsl): address Copilot review on #312 (cd fail-fast, buildWslEnv guard)
- Agent launcher: `cd "$1" 2>/dev/null;` -> `cd "$1" || exit 1;` so a failed
  cd doesn't silently run the agent in the wrong directory. Matches the
  terminal wrapper and pre-#304 launch (both use `cd ... && ...`).
- buildWslEnv: guard `existing` with `typeof baseEnv.WSLENV === "string"` so
  the helper truly never throws (its docstring's contract) even if WSLENV is
  set to a non-string via a type cast.
- Tests: add regression guards for both.

Not changed: the `/bin/sh -l -c` fallback for non-POSIX shells (Copilot
flagged it as possibly unsupported). It matches the shipped buildWslShellWrapper
and `wsl.exe /bin/sh -l -c 'echo OK'` works (dash supports -l); revisit across
all three builders together if a shell without `-l` support turns up.
2026-06-05 14:52:41 +09:00
RAIT-09
1281c1ddcc fix(wsl): source ~/.profile in the hybrid launchers (regression)
The argv/terminal launchers added in 850e2e1 and b91184f dropped the
explicit `. ~/.profile 2>/dev/null;` that buildWslShellWrapper has. bash -l
skips ~/.profile when ~/.bash_profile exists, and linuxbrew/nvm/mise install
their PATH there -- and bare command names (e.g. claude-agent-acp) resolve
via that PATH. Without it, affected WSL users would fail to spawn the agent
or run terminal commands.

Restore `. ~/.profile 2>/dev/null;` in buildWslArgvScript and
buildWslTerminalScript, matching buildWslShellWrapper and preserving the
intent of #177 (236843c / dd4f4ca / fce40a3). Add regression-guard tests
asserting the launchers source ~/.profile.
2026-06-05 14:01:39 +09:00
RAIT-09
b91184f012 fix(wsl): apply the launch hybrid to terminal commands too
Terminal commands (tool_call terminals) still used the nested
`sh -c "<buildWslShellWrapper(innerCommand)>"` construction, which carries
the same fragility that broke agent launch in some environments (e.g.
RHEL8) and double-escaped the command line.

Run terminal commands the same way as agents now:
  wsl.exe [--exec] /bin/sh -c '<launcher>' sh '<commandLine>'
The command line is delivered as a single positional and run under the
user's login shell ($SHELL -l -c "$1"). This keeps full shell parsing
(pipes, redirects, subshells, bash-isms under the user's shell, e.g. bash)
-- behaviorally identical to the previous `$SHELL -l -c <line>` -- while
skipping wsl's default-shell layer (--exec) and removing the doubly-escaped
nested string.

Also, in WSL mode omit the Windows-side spawn cwd for terminals: the
working directory is applied inside the launcher (cd '<wslCwd>'), and a
Linux path as the wsl.exe process cwd would make CreateProcess fail.

buildWslShellWrapper is retained (now used only by paths.ts for the WSL
`which` lookup).

Tests updated/added accordingly (43 cases).
2026-06-05 13:38:37 +09:00
RAIT-09
850e2e1557 fix(wsl): launch agents via --exec login-shell + argv, forward env via WSLENV
WSL agent launch previously wrapped the command in a nested
`sh -c "<baked string>"` construction. In some environments (e.g. RHEL8)
this fails before ACP connects (the process exits 1), and command
paths/args with spaces broke because the command was interpolated
unescaped.

Launch agents instead with:
  wsl.exe [--exec] /bin/sh -c '<constant launcher>' sh <pathDir> <cwd> <command> <args...>
This skips wsl's default-shell layer (--exec), runs under the user's
login shell so ~/.profile is sourced (environment preserved, unlike a
bare --exec), and passes command/args as argv (no quoting of user data).

Also forward configured env vars (API keys, custom agent env, tool env)
into WSL via WSLENV (buildWslEnv), so the plugin's API key field works in
WSL mode without requiring keys in ~/.profile. Defensive: skips empty
values and invalid names, merges existing WSLENV, never throws.

Add a vitest unit-test suite for the platform WSL helpers (39 cases,
incl. exact argv-ordering checks), with an obsidian stub alias and a
dedicated tsconfig for typed linting of tests.

Builds on #304 (direct WSL exec for absolute-path commands); this retains
the environment that a bare --exec would drop and also fixes paths/args
with spaces.

Terminal launch keeps the existing wrapper for now (env forwarding is
applied); a terminal-specific hybrid follows separately.
2026-06-05 13:16:28 +09:00
RAIT-09
ee01a76e96
Merge pull request #304 from mimoralea/patch-1
Use direct WSL exec for absolute-path agent commands
2026-06-02 12:40:49 +09:00
Miguel Morales
d7a6f1e252
Use direct WSL exec for absolute agent commands
In WSL mode, launch simple absolute-path agent commands with `wsl.exe --cd <cwd> --exec <command> ...args` instead of routing them through the nested shell wrapper.

This avoids fragile `sh -c` quoting behavior when launching agents from Windows into WSL, especially for executable+argv CLIs such as OpenCode, Codex, Claude Code, and similar tools.

The existing shell-wrapper path is preserved for commands that may need shell semantics, including relative commands, PATH injection via `additionalPath`, or commands containing shell metacharacters. This keeps compatibility with existing configurations that rely on shell expansion or login-shell behavior while allowing straightforward WSL executables to launch without unnecessary quoting layers.
2026-06-01 11:19:36 -06:00
RAIT-09
8346f72170 Merge branch 'master' into dev 2026-05-31 01:11:15 +09:00