Commit Graph
35 Commits
Author SHA1 Message Date
Yichen Jiang 454a3f7a88 fix(terminal-controller): delete confined Agent shell history and stop pointing read-only shells at it
read-only confinement cannot write /tmp, so the per-terminal history path
did nothing there; read-only shells now get an empty HISTFILE, which also
keeps them from loading the person's history. workspace-write shells keep
their per-terminal history file, and the controller now deletes it
through the same execution environment after the shell ends, including a
failed allocation; a failed deletion is logged.
2026-11-04 15:48:30 +08:00
Yichen Jiang 9eb4144222 refactor(terminal-controller): publish AgentTerminal as an interface
The public AgentTerminal class took the internal BrowserTerminal as its
constructor parameter, so the Cordis API catalog listed BrowserTerminal
and all of its members. AgentTerminal is now a type-only interface and
the controller constructs a package-private AgentTerminalHandle; the
catalog no longer names BrowserTerminal. BrowserTerminal.onStateChange
becomes setStateListener, because a later call replaces the listener.
2026-11-04 15:41:10 +08:00
Yichen Jiang b105a29412 fix(ui-sidebar-terminal): close the tab of a terminal that ends under Agent control
The sidebar only opened tabs for Agent terminals that appeared in the
roster, so a terminal the Agent closed left a "Terminal closed." tab
behind. Each window now remembers which listed terminals the Agent
controls and closes the tabs bound to one that leaves the roster; a
terminal the person took over keeps its tab. The client terminal list
also adopts each whole roster instead of only merging it, so terminals
the Host no longer retains leave the cached list. ClientTerminals gains
boundTerminal to read a tab's terminal binding.
2026-11-04 15:38:52 +08:00
Yichen Jiang 6be8e43bcd fix(terminal-controller): reopen a failed roster stream for its remaining watchers
A roster stream that failed while watched used to drop its watchers, so
Agent terminals stopped opening tabs until the Session header remounted.
The stream now reopens in place on the next watch of that Session or when
the connection resets.
2026-11-04 14:23:31 +08:00
Yichen Jiang f1e90e5845 fix(terminal-controller): bound Agent terminals precisely and report closed screens uniformly
maxAgentTerminals now counts only running Agent-controlled terminals and
pending Agent allocations, each id once; exited terminals and failed
allocations awaiting cleanup still count toward maxTerminals. openForAgent
applies rename's 1-120 character title rule and trims the title.
readScreen reports a terminal closed while its read drains as
RemoteError terminal/unavailable, like a missing terminal.
2026-11-04 14:23:21 +08:00
Yichen Jiang c8cf0693ac docs(terminal-controller): state Agent terminal history and close ordering precisely
Only workspace-write can write the confined history file, so read-only
shells do not save history; unconfined shells keep the inherited HISTFILE
unless env sets one. AgentTerminal.close checks control once when called,
and a takeover during cleanup does not stop the close. The sidebar README
now says only a confined terminal's badge names its sandbox mode on hover.
2026-11-04 14:08:52 +08:00
Yichen Jiang 6b7a1712e3 feat(terminal-controller): mark logical lines and expose the Agent terminal process id 2026-10-20 15:06:50 +08:00
Yichen Jiang 8ade0f7c9b feat(terminal-controller): let callers add environment variables to Agent terminals 2026-10-20 15:04:09 +08:00
Yichen Jiang 336ee0d7fd feat(terminal-controller): read Agent terminal screens synchronously with an explicit drain 2026-10-20 15:02:36 +08:00
Yichen Jiang eaf6df53e2 docs(terminal-controller): document Agent terminals, roster watch and sidebar takeover 2026-10-20 14:51:32 +08:00
Yichen Jiang c1b8aaa194 feat(ui-sidebar-terminal): open agent terminals and mark user takeover 2026-10-20 14:51:32 +08:00
Yichen Jiang 53db16dbae feat(terminal-controller): Host API for agent terminals and roster watch 2026-10-20 14:51:32 +08:00
Yichen Jiang 8ae3b861f8 feat(terminal-controller): agent input, screen rendering and change revisions 2026-10-20 14:42:35 +08:00
Yichen Jiang 8376917743 feat(terminal-controller): record terminal origin, control and typed input 2026-10-20 14:42:35 +08:00
Yichen Jiang 0ae278b935 fix(web): share terminal discovery per session 2026-10-15 20:12:52 +08:00
Yichen Jiang 5538b790c6 fix(web): bound terminal uplink and preserve final output 2026-10-12 13:54:11 +08:00
Yichen Jiang c6f3639b5e docs(web): align terminal duplex documentation 2026-10-12 12:44:06 +08:00
Yichen Jiang 5379996fcb feat(web): carry terminal input over duplex streams 2026-10-12 11:18:43 +08:00
Tianyi Cui b446e2e290 fix(web): start sidebar terminals in the session directory 2026-10-06 01:27:55 +08:00
imccyu f37f19ab43 fix(subprocess): compare executable errors by name 2026-09-30 12:47:48 +08:00
Yichen Jiang 41021fc803 fix(web): list each shell once in the new-terminal menu
Shell discovery keyed entries by resolved path. On merged-/usr hosts the
login shell /bin/bash from $SHELL and the PATH hit /usr/bin/bash for the
`bash` candidate are one file with two spellings, so the menu showed
"bash" twice. Key discovered shells by executable name, compared without
letter case or `.exe`, and keep the earliest entry so the default shell
stays first.
2026-09-29 10:40:27 +08:00
Yichen Jiang ab695ef4cf feat(web): give user terminals system-user permissions 2026-09-16 13:52:23 +08:00
Yichen Jiang ad8a00c291 Merge remote-tracking branch 'origin/master' into worktree/sidebar-session-recovery
# Conflicts:
#	packages/subprocess/subprocess-local/src/index.ts
2026-09-15 12:15:20 +08:00
Yichen Jiang 281723bed8 fix(web): isolate terminal bindings and validate saved layouts 2026-09-15 12:07:01 +08:00
imccyu 232ab768a9 perf(runtime): defer optional native dependencies 2026-09-15 11:06:43 +08:00
Yichen Jiang b25c5ad82e feat(web): restore sidebar layouts and reclaim unattended terminals 2026-09-15 10:27:44 +08:00
Yichen Jiang 4012092d24 feat(web): launch terminals from provider guide menus 2026-09-14 19:22:22 +08:00
Yichen Jiang 1ddd7e08c3 fix(web): keep Windows PowerShell in terminal choices 2026-09-14 14:31:41 +08:00
Yichen Jiang 249c8d1565 feat(web): show common shells by default 2026-09-14 14:20:25 +08:00
Yichen Jiang 37e5d8c4aa fix(web): remember shell choices before terminal startup 2026-09-14 11:02:53 +08:00
Yichen Jiang 33d89aee77 feat(web): choose and remember terminal shells 2026-09-14 10:59:46 +08:00
Yichen Jiang d28625c6d5 fix(web): restore terminal snapshots across host and sidebar lifecycles 2026-09-09 19:52:55 +08:00
Yichen Jiang 0a525601a7 fix(web): harden sidebar terminal lifecycle and recovery 2026-09-09 18:17:47 +08:00
Yichen Jiang 00b16cb63a fix(web): align terminal preview, styles, and snapshots 2026-09-09 17:29:00 +08:00
Yichen Jiang e15a9b1bec feat(web): add interactive sidebar terminals 2026-09-09 16:40:58 +08:00