* feat(ui): inline compose directory picker and streamline AI session history UX
* fix(ai): exclude workspace members and hidden terminals from active-elsewhere jump targets
* fix(ai): clear non-AI magnification overlay when jumping to an active chat tab
* feat(sftp): insert file path or cd into paired terminal from SFTP context menu
* fix(sftp): guard terminal path insertion against unclosed quote contexts
* fix(sftp): reject trailing dollar fusion and after-cursor command text
* fix(terminal): detect standard root-directory shell prompts (user@host:/$) for SFTP path injection
* fix(sftp): reject arithmetic insertion contexts and continuation-prompt cd
* fix(terminal): ignore right-aligned prompt decorations in after-cursor readiness check
* fix(sftp): resolve remote shell dialect from prompt/OS and use portable Unix quoting
* fix(terminal): require unwritten xterm gap cells before ignoring right-prompt decorations
* feat(tabs): focus adjacent terminal tab on close instead of jumping to Vaults or SFTP
* test(tabs): reset activeTabStore before tearing down JSDOM globals
* feat(local-terminal): support optional startup command on local terminal hosts
* fix(local-terminal): validate saved local launch target before overlaying startup command
* feat(sftp): stream packed downloads and restore selected folders locally
* fix(sftp): address packed download lifecycle and cleanup review
* fix(sftp): preserve live packed state across window reload and fall back on POSIX special child names
* fix(sftp): guard active-packed snapshot replay race and fall back on selected root symlinks
* fix(sftp): fall back before nested-link containment check for selected root symlinks
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* feat(tabs): move a tab to its own window without reconnecting (#4201)
Adds "Move Tab to New Window" to the tab context menu. Instead of opening
a new connection like "Copy Tab to New Window", the tab is hidden from the
tab bar and an attach popup takes over the same live PTY, so bastion
sessions are not re-authenticated and no extra seat is used. Closing the
popup returns the tab (with its screen state) to the window it came from.
- popup lifecycle notifies the home window via terminal-popup:attach-closed
- new runtime poppedOut flag; popped-out tabs still persist for restore and
are not labelled as AI silent sessions in the tray
* fix(tabs): keep moved tabs alive when their source window closes
- A moved-tab popup registers as the lifetime heir of its session. If the
source window is destroyed, ownership passes to the popup instead of the
session being closed (worker and in-process paths). AI observe popups are
unchanged.
- If the source window is gone when the popup closes, skip the hand-back so
the popup's ownership closes the session.
- Only offer/allow Move Tab to New Window for connected sessions; attach
mode cannot connect or reconnect a backend.
* fix(tabs): expose Move Tab to New Window through TerminalHost
The handler was registered but not passed into the terminal domain bag,
so AppView received undefined and the menu item never rendered.
* fix(tabs): address move-to-window focus, crash ownership, live count, history, and AI context review findings
* fix(tabs): activate moved-tab lifetime heir only after output rebind succeeds
* fix(tabs): wait for popup attachment before hiding tab and exclude plugin sessions
* fix(tabs): confirm renderer reattach before resolving move and await output restore before unhiding tab
* fix(tabs): preserve detached output across popup crashes and avoid focusing main window from tray
* fix(tabs): deliver attach snapshots and output restore directly to peer session windows
* fix(tabs): schedule automatic output restore retries when popup recovery fails
* fix(tabs): handle reopen replay preservation, stale restore cancellation, startup workspace move, and shutdown log capture
* fix(tabs): reassert popped-out state after tray reopen
* test(terminal): provide log finalizer stubs in popup snapshot harness
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* feat(ai): add OpenCode Go provider with API-key auto-config
Add OpenCode Go as a first-class AI provider preset for Catty:
- Pre-fill the Console endpoint (https://opencode.ai/inference/go/openai/v1)
and a curated model list, with live discovery from /models.
- After the user pastes an API key and saves, select a sensible default
model and activate the provider when no other provider is active.
- Parse nested limit.context values from model list payloads (OpenCode Go
reports context windows this way).
- Point users at the Console API-key page from the provider form and make
the settings search find the entry with "opencode".
The existing x-opencode-session header already covers chat routing for
opencode.ai hosts.
* fix(ai): fix OpenCode Go protocol choices
OpenCode Go exposes exactly one wire protocol and request format, so the
provider form must not offer Anthropic/Google styles or a Responses toggle.
Hide both controls for fixed-protocol presets, force the saved config back
to OpenAI Chat Completions, and ignore stale overrides at request time.
* fix(ai): route OpenCode Go models to their native protocol
OpenCode Go's catalog is not uniformly Chat Completions: 20 models are
native chat, 5 are Responses, 6 are Anthropic Messages, and 1 is Google
GenerateContent. The Console gateway translates between them, but forcing
Chat Completions loses each model's native reasoning and tool handling.
Keep the protocol controls hidden, then pick the wire family from the
selected model:
- responses -> OpenAI Responses
- messages -> Anthropic Messages (/anthropic/v1 prefix)
- google -> Google GenerateContent (/google/v1beta prefix)
- default -> OpenAI Chat Completions
Model discovery stays on the OpenAI prefix, and a read-only Base URL makes
it clear that the endpoint paths are fixed by the provider.
* fix(ai): send OpenCode session and client headers
OpenCode Go needs `x-opencode-session` on every model call for routing and
prompt-cache affinity. Catty already forwards the chat session id; this also
covers plugin model invocations, which previously had no session header.
OpenCode also asks clients to identify themselves instead of presenting a
generic SDK user agent. Send `Netcatty-AI/1.0` for opencode.ai hosts while
keeping user-configured headers as the override.
* fix(ai): hide custom headers for fixed-protocol providers
OpenCode Go has one hosted endpoint and no proxy or self-signed setup to
configure, so the custom-header editor only adds noise. Hide it for
fixed-protocol presets and leave any previously stored headers untouched
instead of overwriting them with the hidden rows.
* fix(ai): use the official OpenCode mark for the provider icon
The previous asset was a monochrome silhouette that was left-aligned and
touched the badge edges, so it read as a generic terminal glyph. Replace it
with the official OpenCode mark (white frame, gray block, dark background)
and render it full-color instead of applying the monochrome invert filter.
* fix(ai): keep the OpenCode icon square at small sizes
The 16px composer badge used a 6px radius, so the full-color mark read as a
black circle. Give full-color icons size-aware corners (3/4/6px) and move
the asset to a new filename so a stale 300px SVG from an earlier build cannot
be reused.
* fix(ai): preserve disabled state when editing an existing OpenCode Go provider
* fix(ai): recognize Google SSE streaming requests in bridge fetch
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix: resolve dev CJS imports, ligatures empty-line crash, and streamline AI sidebar UX
* fix(ai): ignore nested control keydown events in session manager row
* feat(ai): global AI session manager with cross-scope rebind
Scope-agnostic view over every AI chat regardless of panel scope
(issue #4098 phases 4-5), hosted as a scoped/global toggle inside the
existing session history drawer.
- Global list: title, agent, resolved scope (workspace title / terminal
label / global / dangling), state badge (active / idle / dissociated),
message count, relative time; title-substring search, agent filter,
newest-first ordering and a render batch guard. Titles only, never
message bodies.
- Per-row actions: open/switch (exact-scope chats only; other-scope rows
offer rebind instead of faking activation), rebind to the current
panel (issue #4019 path) or to any open workspace/terminal via an
explicit target picker, confirm-gated per-record delete, and
single-chat export (exportSessionsBackup now takes an optional
session-id subset; import merges by id).
- App-wide open terminals are threaded to every AI panel so the manager
resolves scopes and rebind targets across tabs.
- Deletion safety: no scopeKey is passed, stale pointers of any panel
are repaired by the #4125 validation effect; deleting the last chat
cannot resurrect on reboot (intentionally-deleted ids + migration
marker). No cleanup/eviction semantics are touched (#4015 R2).
* fix(ai): stop active turns before scope rebind
Rebinding a chat while a turn streams into it corrupts streaming state
(the stream targets the old scope while the active map/panel pointer move
underneath it). Both rebind paths — the global session manager and the
/rebind <n> panel command — now await stopStreamingForSession first,
chosen over rejecting the rebind because it cleanly awaits termination
(stopAgentTurn + waitForActiveTurn) and preserves the user's rebind
intent. stopStreamingForSession moves above the /rebind handler to avoid
a TDZ reference; the guard lives in AIChatSidePanelHelpers so both call
sites share it. Also passes the panel scope host ids to the manager for
the 'This panel' rebind target.
* fix(ai): derive session manager rebind targets from all live terminals
The global AI session manager built its app-wide terminal list from
contextsByTabId, which only covers tabs whose AI panel context is
mounted - a live terminal without one was missing as a rebind target.
useTerminalAiContexts now also exposes buildAllTerminalAiInfos over the
full terminal session store (same buildAITerminalSessionInfo per
session, so infos merge seamlessly where a context exists) and threads
it to AIChatPanelsHost as appTerminalSessions.
* fix(ai): preserve host ids on panel rebind and reset stale agent filters
- 'This panel' rebind now carries the viewing panel's scope host ids
(currentScopeHostIds) onto the rewritten scope, so the destination
host association is not orphaned; explicit picker targets already
forwarded their hostIds.
- The agent filter no longer survives its agent: when the filtered
agent's last chat is deleted the filter resets to 'all' instead of
leaving a permanently empty list with a blank select; the select's
built-in 'all' option stays the manual clear affordance.
* fix(ai): clear source workspace views when rebinding a chat
* fix(ai): demote implicit source views when rebinding restored chats
* fix(ai): stabilize appTerminalInfos identity and polish global session manager UI
- Retain appTerminalInfos array identity across structurally equal terminal updates so unrelated tab state churn does not re-render every mounted AIChatSidePanel.
- Replace native <select> elements in GlobalAIChatSessionManager with the shared Radix Select component for consistent dark/light theme rendering.
- Wrap the disabled cross-scope open button in a <span> inside TooltipTrigger (and add type="button" to row action buttons) so hover tooltips fire reliably.
* fix(ai): carry member host IDs on explicit workspace rebind targets
* fix(ai): remove redundant title beside history drawer scope switcher
* fix(ai): guard optional appTerminalSessions in AIChatPanelsHost
* fix(ai): clear persisted source workspace anchors when rebinding chats
* fix(ai): exclude non-exact workspace matches from implicit auto-resume
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(i18n): complete zh-TW strings and unify Taiwan terminology
- Translate the 19 settings.plugins.sources.* keys that were still in
Simplified Chinese, and add the 9 missing ai.providers.headers.* keys.
- Add the two zh-CN keys the dialog already looked up (createWorkspace.title,
field.selectHosts) so those labels no longer fall back to English.
- Keep {{name}} / {{name:default}} literal in snippets.field.variablesHelp;
the previous text translated the metavariable names.
- Unify zh-TW terms in the shipped UI: 外掛, 市集, 行程, 指令碼, 金鑰,
佔位符, 檔案系統, 網路, 資料, 使用者, 預設.
- Tighten localeParityLocales: zh-CN and zh-TW are at full parity, so move
them out of LOCALES_PENDING_PARITY and check interpolation placeholders for
every translated locale, not just es.
* fix(i18n): finish zh-TW plugin wording and :default placeholders
Review follow-up on the terminology pass:
- Replace the remaining mainland terms on the plugin settings screen:
導入→匯入, 卸載→解除安裝, 存儲→儲存, 遠程→遠端, 加載→載入. 網路設備 is
correct Taiwan usage and stays.
- Widen the interpolation token regex so {{name:default}} is compared too;
the previous \w+ form silently ignored the colon and could not catch a
translated metavariable. Add a direct assertion for that form.
* test(ci): pin Vite contract probe to numeric loopback
---------
Co-authored-by: 陈大猫 <16399091+binaricat@users.noreply.github.com>