feat(web): add interactive sidebar terminals

This commit is contained in:
Yichen Jiang committed 2026-09-09 16:40:58 +08:00
1 parent 6d99a8a53a
commit e15a9b1bec
132 files changed
+5985 -101

No files matched your search

+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/capability-seams.md
capability-seams.md: 9cc7a6fc50b81e9f82d58600c84d1ff6494634c9
capability-seams.zh.md: e898bdf3c2c728a1bae427bbb737eb5269a1c500
capability-seams.md: 826b8b546242b6581846b52a3a5919c333610d42
capability-seams.zh.md: 106f4b75180322820604a2f254f34dc8aa57abdf
+4
View File
@@ -46,6 +46,8 @@ flowchart LR
svc_settingsController["ctx.settingsController<br/>Host settings-surface Remote controller"]
pkg_api_workspace_files["api-workspace-files"]
svc_workspaceFiles["ctx.workspaceFiles<br/>Host workspace file Remote service"]
pkg_api_terminal_controller["api-terminal-controller"]
svc_terminalController["ctx.terminalController<br/>Session interactive terminal Remote controller"]
pkg_api_workspace_controller["api-workspace-controller"]
svc_workspaceController["ctx.workspaceController<br/>Host Workspace Remote controller"]
svc_directoryPickerController["ctx.directoryPickerController<br/>Host directory-picking Remote controller"]
@@ -234,6 +236,7 @@ flowchart LR
pkg_api_session_controller --> svc_sessionSkillCatalog
pkg_api_settings_controller --> svc_credentialsController
pkg_api_settings_controller --> svc_settingsController
pkg_api_terminal_controller --> svc_terminalController
pkg_api_workspace_controller --> svc_directoryPickerController
pkg_api_workspace_controller --> svc_workspaceController
pkg_api_workspace_files --> svc_workspaceFiles
@@ -487,6 +490,7 @@ flowchart LR
| `ctx.credentialsController` | `core` | [`api-settings-controller`](../packages/api/settings-controller) | - | - | - | Projects the credential-reference seam onto the generated Remote namespace: batch fan-out, view projection, and refusal mapping live here, not on the seam Definition. |
| `ctx.settingsController` | `core` | [`api-settings-controller`](../packages/api/settings-controller) | - | - | - | Projects the user-settings seam onto the generated Remote namespace: the read is always redacted and every refusal is classified here, not on the seam Definition. |
| `ctx.workspaceFiles` | `core` | [`api-workspace-files`](../packages/api/workspace-files) | - | - | - | Serves stat, paged text, byte windows, directory listings, and the change feed for files inside a Session's workspace root, confined by lstat, containment, and a stat re-check. |
| `ctx.terminalController` | `core` | [`api-terminal-controller`](../packages/api/terminal-controller) | - | - | - | Owns user terminal processes, default shell resolution and bounded screen recovery through the subprocess provider and typed Remote transport. |
| `ctx.workspaceController` | `core` | [`api-workspace-controller`](../packages/api/workspace-controller) | - | - | - | Owns Workspace commands and reconnect-safe Workspace state delivery through the generated Remote namespace. |
| `ctx.directoryPickerController` | `core` | [`api-workspace-controller`](../packages/api/workspace-controller) | - | - | - | Carries the picking seam onto the wire: capability gating, cancellation, and the seam-coded failures a browser directory flow discriminates on. |
| `ctx.invariants` | `core` | [`invariants`](../packages/runtime-diagnostics/invariants) | - | [`session`](../packages/core/session), [`agent`](../packages/core/agent), [`scope`](../packages/core/scope), [`agent-loop`](../packages/core/agent-loop) | - | Companion subpaths register owner-local checks; the service owns selection, uniqueness, child fibers, and package-attributed failures. |
+4
View File
@@ -48,6 +48,8 @@ flowchart LR
svc_settingsController["ctx.settingsController<br/>Host settings-surface Remote controller"]
pkg_api_workspace_files["api-workspace-files"]
svc_workspaceFiles["ctx.workspaceFiles<br/>Host workspace file Remote service"]
pkg_api_terminal_controller["api-terminal-controller"]
svc_terminalController["ctx.terminalController<br/>Session interactive terminal Remote controller"]
pkg_api_workspace_controller["api-workspace-controller"]
svc_workspaceController["ctx.workspaceController<br/>Host Workspace Remote controller"]
svc_directoryPickerController["ctx.directoryPickerController<br/>Host directory-picking Remote controller"]
@@ -236,6 +238,7 @@ flowchart LR
pkg_api_session_controller --> svc_sessionSkillCatalog
pkg_api_settings_controller --> svc_credentialsController
pkg_api_settings_controller --> svc_settingsController
pkg_api_terminal_controller --> svc_terminalController
pkg_api_workspace_controller --> svc_directoryPickerController
pkg_api_workspace_controller --> svc_workspaceController
pkg_api_workspace_files --> svc_workspaceFiles
@@ -489,6 +492,7 @@ flowchart LR
| `ctx.credentialsController` | `core` | [`api-settings-controller`](../packages/api/settings-controller) | - | - | - | 把凭据引用 seam 投影到生成的 Remote namespace:批量扇出、视图投影与拒绝映射都在这里,而不在 seam Definition 上。 |
| `ctx.settingsController` | `core` | [`api-settings-controller`](../packages/api/settings-controller) | - | - | - | 把用户设置 seam 投影到生成的 Remote namespace:读取一律脱敏,所有拒绝在这里分类,而不在 seam Definition 上。 |
| `ctx.workspaceFiles` | `core` | [`api-workspace-files`](../packages/api/workspace-files) | - | - | - | 为会话工作区根内的文件提供 stat、分页文本、字节窗口、目录列举与变更流,经 lstat、包含关系与 stat 重检限定。 |
| `ctx.terminalController` | `core` | [`api-terminal-controller`](../packages/api/terminal-controller) | - | - | - | 通过子进程提供方与类型化 Remote 传输管理用户终端进程、解析默认 shell,并恢复有界终端屏幕。 |
| `ctx.workspaceController` | `core` | [`api-workspace-controller`](../packages/api/workspace-controller) | - | - | - | 通过生成的 Remote namespace 负责 Workspace 命令和可在重连后收敛的 Workspace 状态投递。 |
| `ctx.directoryPickerController` | `core` | [`api-workspace-controller`](../packages/api/workspace-controller) | - | - | - | 把选目录 seam 送上线:能力门禁、取消传播,以及浏览器目录流程用于分支判断的 seam 错误码。 |
| `ctx.invariants` | `core` | [`invariants`](../packages/runtime-diagnostics/invariants) | - | [`session`](../packages/core/session), [`agent`](../packages/core/agent), [`scope`](../packages/core/scope), [`agent-loop`](../packages/core/agent-loop) | - | 配套子路径注册所属包本地的检查;该服务负责选择、唯一性、子 fiber,以及标明所属包的失败。 |
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/config-catalog.md
config-catalog.md: 4e92bbfcf4bcf190b9b17436eefc3255dda9132a
config-catalog.zh.md: df4b107f28040962f38802a77f8b91c47ad2931d
config-catalog.md: bba3732438bc323b034625185962c5bce2382f3c
config-catalog.zh.md: 8c6168c46035e703a7c54e121dd20514e2ddf009
+39 -1
View File
@@ -229,6 +229,43 @@ export interface Config {
Source: [`packages/api/settings-controller/src/index.ts:36`](../packages/api/settings-controller/src/index.ts)
<a id="deepseek-aidsh-api-terminal-controller"></a>
## `@deepseek-ai/dsh-api-terminal-controller`
Requires: `subprocess` · `sandboxPolicy` · `sessionProjections` · `typert`
```ts config-catalog
/** Deployment limits and an optional shell profile. */
export interface Config {
/** Explicit shell profile; omission uses the execution environment's default shell. */
readonly shell?: {
/** Executable path or PATH name, verified by the subprocess provider. */
path: string
/** User-visible profile name. */
name: string
/** Arguments passed to the interactive shell. */
args: string[]
} | undefined
/** Maximum retained terminals and pending allocations per Session. */
readonly maxTerminals: number
/** Maximum terminal width in columns. */
readonly maxCols: number
/** Maximum terminal height in rows. */
readonly maxRows: number
/** Screen history rows retained for reconnecting clients. */
readonly scrollback: number
/** Maximum queued UTF-8 frame bytes per output follower before disconnection. */
readonly maxBufferedBytes: number
/** Maximum UTF-8 bytes in one input request. */
readonly maxInputBytes: number
/** Provider process-termination grace period in milliseconds. */
readonly disposeGraceMs: number
}
```
Source: [`packages/api/terminal-controller/src/index.ts:28`](../packages/api/terminal-controller/src/index.ts)
<a id="deepseek-aidsh-api-workspace-files"></a>
## `@deepseek-ai/dsh-api-workspace-files`
@@ -2575,7 +2612,7 @@ export interface Config {
}
```
Source: [`packages/e2b/subprocess-e2b/src/index.ts:26`](../packages/e2b/subprocess-e2b/src/index.ts)
Source: [`packages/e2b/subprocess-e2b/src/index.ts:28`](../packages/e2b/subprocess-e2b/src/index.ts)
<a id="deepseek-aidsh-system-prompt"></a>
@@ -3484,6 +3521,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
- `@deepseek-ai/dsh-client-ui-sidebar-documentpreview` ([`packages/client/ui-sidebar-documentpreview/src/index.ts`](../packages/client/ui-sidebar-documentpreview/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-files` ([`packages/client/ui-sidebar-files/src/index.ts`](../packages/client/ui-sidebar-files/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-right` ([`packages/client/ui-sidebar-right/src/index.ts`](../packages/client/ui-sidebar-right/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-terminal` ([`packages/client/ui-sidebar-terminal/src/index.ts`](../packages/client/ui-sidebar-terminal/src/index.ts))
- `@deepseek-ai/dsh-client-ui-skill` ([`packages/client/ui-skill/src/index.ts`](../packages/client/ui-skill/src/index.ts))
- `@deepseek-ai/dsh-client-ui-subagent` ([`packages/client/ui-subagent/src/index.ts`](../packages/client/ui-subagent/src/index.ts))
- `@deepseek-ai/dsh-client-ui-theme` ([`packages/client/ui-theme/src/index.ts`](../packages/client/ui-theme/src/index.ts))
+38
View File
@@ -231,6 +231,43 @@ export interface Config {
来源:[`packages/api/settings-controller/src/index.ts:36`](../packages/api/settings-controller/src/index.ts)
<a id="deepseek-aidsh-api-terminal-controller"></a>
## `@deepseek-ai/dsh-api-terminal-controller`
Requires: `subprocess` · `sandboxPolicy` · `sessionProjections` · `typert`
```ts config-catalog
/** Deployment limits and an optional shell profile. */
export interface Config {
/** Explicit shell profile; omission uses the execution environment's default shell. */
readonly shell?: {
/** Executable path or PATH name, verified by the subprocess provider. */
path: string
/** User-visible profile name. */
name: string
/** Arguments passed to the interactive shell. */
args: string[]
} | undefined
/** Maximum retained terminals and pending allocations per Session. */
readonly maxTerminals: number
/** Maximum terminal width in columns. */
readonly maxCols: number
/** Maximum terminal height in rows. */
readonly maxRows: number
/** Screen history rows retained for reconnecting clients. */
readonly scrollback: number
/** Maximum queued UTF-8 frame bytes per output follower before disconnection. */
readonly maxBufferedBytes: number
/** Maximum UTF-8 bytes in one input request. */
readonly maxInputBytes: number
/** Provider process-termination grace period in milliseconds. */
readonly disposeGraceMs: number
}
```
来源: [`packages/api/terminal-controller/src/index.ts:28`](../packages/api/terminal-controller/src/index.ts)
<a id="deepseek-aidsh-api-workspace-files"></a>
## `@deepseek-ai/dsh-api-workspace-files`
@@ -3486,6 +3523,7 @@ export interface Config {
- `@deepseek-ai/dsh-client-ui-sidebar-documentpreview`([`packages/client/ui-sidebar-documentpreview/src/index.ts`](../packages/client/ui-sidebar-documentpreview/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-files`([`packages/client/ui-sidebar-files/src/index.ts`](../packages/client/ui-sidebar-files/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-right`([`packages/client/ui-sidebar-right/src/index.ts`](../packages/client/ui-sidebar-right/src/index.ts))
- `@deepseek-ai/dsh-client-ui-sidebar-terminal`([`packages/client/ui-sidebar-terminal/src/index.ts`](../packages/client/ui-sidebar-terminal/src/index.ts))
- `@deepseek-ai/dsh-client-ui-skill`([`packages/client/ui-skill/src/index.ts`](../packages/client/ui-skill/src/index.ts))
- `@deepseek-ai/dsh-client-ui-subagent`([`packages/client/ui-subagent/src/index.ts`](../packages/client/ui-subagent/src/index.ts))
- `@deepseek-ai/dsh-client-ui-theme`([`packages/client/ui-theme/src/index.ts`](../packages/client/ui-theme/src/index.ts))
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/event-producer-consumer.md
event-producer-consumer.md: 2239c9786f9e18b6a8e9514bfd53da7f87cfb8a4
event-producer-consumer.zh.md: e43d48e2ee163843752bcda9fe3578839e05252b
event-producer-consumer.md: 3114d32853689ea267a923490a1a667a0a54b1f0
event-producer-consumer.zh.md: 42915ab51d194d4827bf047135d39a9f3198a353
+1 -1
View File
@@ -80,7 +80,7 @@ This matrix shows which packages dispatch each harness-owned event and which pac
| Event string | Dispatchers | Listeners |
| --- | --- | --- |
| `internal/dispatch` | - | `agent-team`, [`commands`](../packages/interaction/commands), [`compaction`](../packages/compaction/compaction), [`fs`](../packages/fs/fs), [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm-retry`](../packages/llm/llm-retry), [`permission-presets`](../packages/interaction/permission-presets), [`plan-mode`](../packages/plan/plan-mode), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-log-deepseek`](../packages/session/session-log-deepseek), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`terminal-bash`](../packages/terminal/terminal-bash), [`time-context`](../packages/context/time-context), [`tool-todo`](../packages/todo/tool-todo), [`tool-workflow`](../packages/workflow/tool-workflow), [`tools`](../packages/core/tools), [`user-approval`](../packages/interaction/user-approval), [`webhook`](../packages/webhook/webhook), [`workflow`](../packages/workflow/workflow) |
| `internal/dispatch` | - | `agent-team`, [`commands`](../packages/interaction/commands), [`compaction`](../packages/compaction/compaction), [`fs`](../packages/fs/fs), [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm-retry`](../packages/llm/llm-retry), [`permission-presets`](../packages/interaction/permission-presets), [`plan-mode`](../packages/plan/plan-mode), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-log-deepseek`](../packages/session/session-log-deepseek), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`terminal-bash`](../packages/terminal/terminal-bash), `terminal-controller`, [`time-context`](../packages/context/time-context), [`tool-todo`](../packages/todo/tool-todo), [`tool-workflow`](../packages/workflow/tool-workflow), [`tools`](../packages/core/tools), [`user-approval`](../packages/interaction/user-approval), [`webhook`](../packages/webhook/webhook), [`workflow`](../packages/workflow/workflow) |
| `internal/plugin` | - | `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), `modules` |
| `internal/service` | - | [`agent-presets`](../packages/preset/agent-presets), `gateway` |
| `internal/status` | - | [`agent`](../packages/core/agent), `inspector` |
+1 -1
View File
@@ -82,7 +82,7 @@
| Event string | Dispatchers | Listeners |
| --- | --- | --- |
| `internal/dispatch` | - | `agent-team`, [`commands`](../packages/interaction/commands), [`compaction`](../packages/compaction/compaction), [`fs`](../packages/fs/fs), [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm-retry`](../packages/llm/llm-retry), [`permission-presets`](../packages/interaction/permission-presets), [`plan-mode`](../packages/plan/plan-mode), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-log-deepseek`](../packages/session/session-log-deepseek), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`terminal-bash`](../packages/terminal/terminal-bash), [`time-context`](../packages/context/time-context), [`tool-todo`](../packages/todo/tool-todo), [`tool-workflow`](../packages/workflow/tool-workflow), [`tools`](../packages/core/tools), [`user-approval`](../packages/interaction/user-approval), [`webhook`](../packages/webhook/webhook), [`workflow`](../packages/workflow/workflow) |
| `internal/dispatch` | - | `agent-team`, [`commands`](../packages/interaction/commands), [`compaction`](../packages/compaction/compaction), [`fs`](../packages/fs/fs), [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm-retry`](../packages/llm/llm-retry), [`permission-presets`](../packages/interaction/permission-presets), [`plan-mode`](../packages/plan/plan-mode), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`schedule`](../packages/schedule/schedule), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-log-deepseek`](../packages/session/session-log-deepseek), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`terminal-bash`](../packages/terminal/terminal-bash), `terminal-controller`, [`time-context`](../packages/context/time-context), [`tool-todo`](../packages/todo/tool-todo), [`tool-workflow`](../packages/workflow/tool-workflow), [`tools`](../packages/core/tools), [`user-approval`](../packages/interaction/user-approval), [`webhook`](../packages/webhook/webhook), [`workflow`](../packages/workflow/workflow) |
| `internal/plugin` | - | `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), `modules` |
| `internal/service` | - | [`agent-presets`](../packages/preset/agent-presets), `gateway` |
| `internal/status` | - | [`agent`](../packages/core/agent), `inspector` |
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/module-graph.md
module-graph.md: cbaa8cb04a7ec2406b1f6e7f2c1dbf0a8dff0527
module-graph.zh.md: 148b2730fccc1740d1c2f24d766f2aa7213093cf
module-graph.md: 4e0db7406fa7b18bfef88e4a4828578aebcca327
module-graph.zh.md: 590a3cb3de2fbd85a52bc8fabe5921905f148186
+4
View File
@@ -115,6 +115,7 @@ flowchart TD
pkg_api_remotes["api-remotes"]
pkg_api_session_controller["api-session-controller"]
pkg_api_settings_controller["api-settings-controller"]
pkg_api_terminal_controller["api-terminal-controller"]
pkg_api_workspace_controller["api-workspace-controller"]
pkg_api_workspace_files["api-workspace-files"]
end
@@ -176,6 +177,7 @@ flowchart TD
pkg_client_ui_sidebar_documentpreview["client-ui-sidebar-documentpreview"]
pkg_client_ui_sidebar_files["client-ui-sidebar-files"]
pkg_client_ui_sidebar_right["client-ui-sidebar-right"]
pkg_client_ui_sidebar_terminal["client-ui-sidebar-terminal"]
pkg_client_ui_skill["client-ui-skill"]
pkg_client_ui_slots["client-ui-slots"]
pkg_client_ui_subagent["client-ui-subagent"]
@@ -1198,6 +1200,7 @@ flowchart TD
| [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | `llm` | — |
| [`llm`](../packages/llm/llm) | `llm` | — |
| [`api-gateway`](../packages/api/gateway) | `api` | — |
| [`api-terminal-controller`](../packages/api/terminal-controller) | `api` | — |
| [`api-workspace-files`](../packages/api/workspace-files) | `api` | — |
| [`cmdline`](../packages/boot/cmdline) | `boot` | — |
| [`acp-app`](../packages/bundle/acp-app) | `bundle` | — |
@@ -1244,6 +1247,7 @@ flowchart TD
| [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview) | `client` | — |
| [`client-ui-sidebar-files`](../packages/client/ui-sidebar-files) | `client` | — |
| [`client-ui-sidebar-right`](../packages/client/ui-sidebar-right) | `client` | — |
| [`client-ui-sidebar-terminal`](../packages/client/ui-sidebar-terminal) | `client` | — |
| [`client-ui-skill`](../packages/client/ui-skill) | `client` | — |
| [`client-ui-slots`](../packages/client/ui-slots) | `client` | — |
| [`client-ui-subagent`](../packages/client/ui-subagent) | `client` | — |
+4
View File
@@ -117,6 +117,7 @@ flowchart TD
pkg_api_remotes["api-remotes"]
pkg_api_session_controller["api-session-controller"]
pkg_api_settings_controller["api-settings-controller"]
pkg_api_terminal_controller["api-terminal-controller"]
pkg_api_workspace_controller["api-workspace-controller"]
pkg_api_workspace_files["api-workspace-files"]
end
@@ -178,6 +179,7 @@ flowchart TD
pkg_client_ui_sidebar_documentpreview["client-ui-sidebar-documentpreview"]
pkg_client_ui_sidebar_files["client-ui-sidebar-files"]
pkg_client_ui_sidebar_right["client-ui-sidebar-right"]
pkg_client_ui_sidebar_terminal["client-ui-sidebar-terminal"]
pkg_client_ui_skill["client-ui-skill"]
pkg_client_ui_slots["client-ui-slots"]
pkg_client_ui_subagent["client-ui-subagent"]
@@ -1200,6 +1202,7 @@ flowchart TD
| [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | `llm` | — |
| [`llm`](../packages/llm/llm) | `llm` | — |
| [`api-gateway`](../packages/api/gateway) | `api` | — |
| [`api-terminal-controller`](../packages/api/terminal-controller) | `api` | — |
| [`api-workspace-files`](../packages/api/workspace-files) | `api` | — |
| [`cmdline`](../packages/boot/cmdline) | `boot` | — |
| [`acp-app`](../packages/bundle/acp-app) | `bundle` | — |
@@ -1246,6 +1249,7 @@ flowchart TD
| [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview) | `client` | — |
| [`client-ui-sidebar-files`](../packages/client/ui-sidebar-files) | `client` | — |
| [`client-ui-sidebar-right`](../packages/client/ui-sidebar-right) | `client` | — |
| [`client-ui-sidebar-terminal`](../packages/client/ui-sidebar-terminal) | `client` | — |
| [`client-ui-skill`](../packages/client/ui-skill) | `client` | — |
| [`client-ui-slots`](../packages/client/ui-slots) | `client` | — |
| [`client-ui-subagent`](../packages/client/ui-subagent) | `client` | — |
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/subprocess.md
subprocess.md: 782623760e70648a108ac51252b610e27bffbe45
subprocess.zh.md: 7b8e590a843899b5f00a309a913e1dcb152c5c1b
subprocess.md: 71040fb28b8cf919f72f8c727a7d0c7add30dada
subprocess.zh.md: dda7356108305ac7e2f3182608b248ce6fa781de
+10 -1
View File
@@ -240,7 +240,9 @@ interface SubprocessOutcome {
`spawnTerminal(spec)` is the non-pipe process primitive. The provider allocates the controlling terminal and owns UTF-8 text transport, foreground-process-group inspection and signalling, and one awaited TERM-to-KILL operation that reaches quiescence for every session member the provider can still observe; providers document substrate-specific observability limits. The PTY backend remains responsible for prompt detection, readiness inference, scrollback, sandbox policy, and persistent-session ownership; ordinary `spawn()` cannot reconstruct controlling-terminal semantics.
The terminal spec fully specifies argv, cwd, environment overrides, dimensions, cleanup grace, and optional allocation cancellation. Its handle exposes `pid`, ordered output, `done`, `write`, `inspectForeground`, `signalForeground`, and awaited `terminate`; the exact public shapes are generated into the [`ctx.subprocess` service catalog](#ctxsubprocess--subprocessruntime-abstract-seam).
The terminal spec fully specifies argv, cwd, environment overrides, terminal type, dimensions, cleanup grace, and optional allocation cancellation. Its handle exposes `pid`, ordered output, `done`, `write`, `resize`, `inspectForeground`, `signalForeground`, and awaited `terminate`; [`SubprocessTerminalSpawnSpec` and `SubprocessTerminalHandle`](../../packages/subprocess/subprocess/src/types.ts) define these fields and operations. `resize(cols, rows)` updates the live PTY dimensions and rejects after process exit.
`terminalEnvironment(signal?)` returns `SubprocessTerminalEnvironment`: the execution environment platform (`posix` or `windows`) and optional `defaultShell`. These facts come from the provider rather than the Web server or browser. `resolveExecutable` verifies shell candidates; `SubprocessExecutableNotFoundError` identifies a missing executable, while provider and transport failures remain errors.
## Service behavior
@@ -300,6 +302,13 @@ Implementations must honor these semantics:
*/
abstract resolveExecutable( command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal, ): Promise<string>
/**
* Inspect shell-selection facts in the provider's execution environment.
* @param signal - cancellation of remote environment inspection.
* @returns platform and preferred shell; executable lookup and allocation remain separate operations.
*/
abstract terminalEnvironment(signal?: AbortSignal): Promise<SubprocessTerminalEnvironment>
/**
* Start one managed child process from a fully-specified spec; this seam
* applies no defaults.
+10 -1
View File
@@ -240,7 +240,9 @@ interface SubprocessOutcome {
`spawnTerminal(spec)` 是非管道进程原语。提供方分配控制终端,并负责 UTF-8 文本传输、前台进程组检查与信号发送,以及一项须等待的 TERM→KILL 操作;该操作会使提供方仍可观察到的每个会话成员完全停稳,提供方则会记录执行基底特有的可观察性限制。PTY 后端仍负责提示符检测、就绪推断、scrollback、沙箱策略和持久会话所有权;普通 `spawn()` 无法重建控制终端语义。
终端 spec 完全指定 argv、cwd、环境覆盖、尺寸、清理宽限期与可选的分配取消。其句柄公开 `pid`、有序输出、`done`、`write`、`inspectForeground`、`signalForeground` 和须等待的 `terminate`;确切的公共形状生成到 [`ctx.subprocess` 服务目录](#ctxsubprocess--subprocessruntime-abstract-seam)中。
终端 spec 完全指定 argv、cwd、环境覆盖、终端类型、尺寸、清理宽限期与可选的分配取消。其句柄公开 `pid`、有序输出、`done`、`write`、`resize`、`inspectForeground`、`signalForeground` 和须等待的 `terminate`;[`SubprocessTerminalSpawnSpec` 与 `SubprocessTerminalHandle`](../../packages/subprocess/subprocess/src/types.ts) 定义这些字段和操作。`resize(cols, rows)` 更新正在运行的 PTY 尺寸,进程退出后拒绝调用。
`terminalEnvironment(signal?)` 返回 `SubprocessTerminalEnvironment`:执行环境平台(`posix` 或 `windows`)与可选的 `defaultShell`。这些事实来自提供方,而非 Web 服务器或浏览器。`resolveExecutable` 验证候选 shell;`SubprocessExecutableNotFoundError` 表示可执行文件不存在,提供方与传输故障仍作为错误报告。
## 服务行为
@@ -300,6 +302,13 @@ Implementations must honor these semantics:
*/
abstract resolveExecutable( command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal, ): Promise<string>
/**
* Inspect shell-selection facts in the provider's execution environment.
* @param signal - cancellation of remote environment inspection.
* @returns platform and preferred shell; executable lookup and allocation remain separate operations.
*/
abstract terminalEnvironment(signal?: AbortSignal): Promise<SubprocessTerminalEnvironment>
/**
* Start one managed child process from a fully-specified spec; this seam
* applies no defaults.
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/workspace.md
workspace.md: a7c4b8843f0a0b2d2fb251157f7928a40df1e405
workspace.zh.md: 3474cbf147848b04a4ec51147983a343bcc1e91d
workspace.md: f37af82d7f8cec018d24a22534bc0b7342425d34
workspace.zh.md: 02dd976abde63992b65f09ea4852cedf0d0b4b36
+83
View File
@@ -183,6 +183,89 @@ Host service backing the generated `ctx.remote.directoryPicker` namespace. The s
Source: [`packages/api/workspace-controller/src/directory-picker.ts`](../../packages/api/workspace-controller/src/directory-picker.ts)
<a id="ctxterminalcontroller--terminalcontroller"></a>
### `ctx.terminalController` — `TerminalController`
Typed Remote control of transient Session-owned terminal processes.
```ts cordis-catalog
/**
* Read the Session working directory and terminal limits without resolving a shell.
* @param agent - Session owner supplied by the Gateway.
* @param signal - request cancellation.
* @returns the Session workspace directory and terminal limits.
*/
@Remote environment(agent: Agent, signal: AbortSignal): TerminalEnvironment
/**
* List running and exited terminals available for reattachment.
* @param agent - Session owner supplied by the Gateway.
* @returns terminals retained for this Host lifetime.
*/
@Remote list(agent: Agent): WebTerminalInfo[]
/**
* Allocate an interactive shell once for a caller-generated identity.
* @param agent - Session owner supplied by the Gateway.
* @param request - initial dimensions and idempotency identity.
* @param signal - allocation cancellation; committed terminals survive disconnection.
* @returns the existing or newly committed terminal.
*/
@Remote async create(agent: Agent, request: TerminalCreateRequest, signal: AbortSignal): Promise<WebTerminalInfo>
/**
* Attach to a terminal without binding its process lifetime to the transport.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - new exclusive input attachment.
* @param signal - physical stream cancellation.
* @returns screen recovery followed by output and metadata changes.
*/
@Remote({ mode: 'stream' }) follow(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, signal: AbortSignal): AsyncIterable<TerminalFrame>
/**
* Deliver raw input, including Tab completion and control characters.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - current writable attachment.
* @param data - input bytes represented as UTF-8 text.
* @returns after provider input acceptance.
*/
@Remote async write(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, data: string): Promise<void>
/**
* Update the dimensions of the PTY and recovery screen.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - current writable attachment.
* @param cols - column count.
* @param rows - row count.
* @returns after the resize completes.
*/
@Remote async resize(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, cols: number, rows: number): Promise<void>
/**
* Rename a terminal without changing its shell.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param title - nonempty display title, at most 120 characters.
*/
@Remote rename(agent: Agent, id: WebTerminalId, title: string): void
/**
* Close an identity to future creation and kill its process range; repeated closes succeed.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @returns after provider cleanup succeeds. A failure retains the terminal for retry.
*/
@Remote async close(agent: Agent, id: WebTerminalId): Promise<void>
```
Types: [Agent](core.md)
Source: [`packages/api/terminal-controller/src/index.ts`](../../packages/api/terminal-controller/src/index.ts)
<a id="ctxworkspacecontroller--workspacecontroller"></a>
### `ctx.workspaceController` — `WorkspaceController`
+83
View File
@@ -183,6 +183,89 @@ Host service backing the generated `ctx.remote.directoryPicker` namespace. The s
Source: [`packages/api/workspace-controller/src/directory-picker.ts`](../../packages/api/workspace-controller/src/directory-picker.ts)
<a id="ctxterminalcontroller--terminalcontroller"></a>
### `ctx.terminalController` — `TerminalController`
Typed Remote control of transient Session-owned terminal processes.
```ts cordis-catalog
/**
* Read the Session working directory and terminal limits without resolving a shell.
* @param agent - Session owner supplied by the Gateway.
* @param signal - request cancellation.
* @returns the Session workspace directory and terminal limits.
*/
@Remote environment(agent: Agent, signal: AbortSignal): TerminalEnvironment
/**
* List running and exited terminals available for reattachment.
* @param agent - Session owner supplied by the Gateway.
* @returns terminals retained for this Host lifetime.
*/
@Remote list(agent: Agent): WebTerminalInfo[]
/**
* Allocate an interactive shell once for a caller-generated identity.
* @param agent - Session owner supplied by the Gateway.
* @param request - initial dimensions and idempotency identity.
* @param signal - allocation cancellation; committed terminals survive disconnection.
* @returns the existing or newly committed terminal.
*/
@Remote async create(agent: Agent, request: TerminalCreateRequest, signal: AbortSignal): Promise<WebTerminalInfo>
/**
* Attach to a terminal without binding its process lifetime to the transport.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - new exclusive input attachment.
* @param signal - physical stream cancellation.
* @returns screen recovery followed by output and metadata changes.
*/
@Remote({ mode: 'stream' }) follow(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, signal: AbortSignal): AsyncIterable<TerminalFrame>
/**
* Deliver raw input, including Tab completion and control characters.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - current writable attachment.
* @param data - input bytes represented as UTF-8 text.
* @returns after provider input acceptance.
*/
@Remote async write(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, data: string): Promise<void>
/**
* Update the dimensions of the PTY and recovery screen.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param attachmentId - current writable attachment.
* @param cols - column count.
* @param rows - row count.
* @returns after the resize completes.
*/
@Remote async resize(agent: Agent, id: WebTerminalId, attachmentId: TerminalAttachmentId, cols: number, rows: number): Promise<void>
/**
* Rename a terminal without changing its shell.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @param title - nonempty display title, at most 120 characters.
*/
@Remote rename(agent: Agent, id: WebTerminalId, title: string): void
/**
* Close an identity to future creation and kill its process range; repeated closes succeed.
* @param agent - Session owner supplied by the Gateway.
* @param id - terminal identity.
* @returns after provider cleanup succeeds. A failure retains the terminal for retry.
*/
@Remote async close(agent: Agent, id: WebTerminalId): Promise<void>
```
Types: [Agent](core.zh.md)
Source: [`packages/api/terminal-controller/src/index.ts`](../../packages/api/terminal-controller/src/index.ts)
<a id="ctxworkspacecontroller--workspacecontroller"></a>
### `ctx.workspaceController` — `WorkspaceController`