Merge remote-tracking branch 'origin/master' into feat/cua-windows/input-complete
This commit is contained in:
commit
71e1fd60b5
338 files changed
+6272
-1298
No files matched your search
+2
-2
@@ -15,8 +15,8 @@
|
||||
en: 0e1399cad4151f87
|
||||
zh: 960fa0ccbe0f8fea
|
||||
/agent-note-cooperative-tool-cancellation-at-the-registry-boundary/decision/cancellation-codes-record-whether-dispatch-occurred:
|
||||
en: 86c5566581c1d3d6
|
||||
zh: 3cb71fbb97bdb291
|
||||
en: 4d8436958c27f98e
|
||||
zh: cd4ed8238428a2c4
|
||||
/agent-note-cooperative-tool-cancellation-at-the-registry-boundary/decision/pre-aborted-entry-short-circuits-after-materialization:
|
||||
en: 53362db6a0c71698
|
||||
zh: 311de45ca26d3fdc
|
||||
|
||||
@@ -32,7 +32,7 @@ An around-dispatch wrapper may replace `exec.signal` for its delegated lifetime
|
||||
|
||||
`ABORTED_BEFORE_DISPATCH` carries `{ name: 'AbortError' }` and model text `Error: tool call aborted before dispatch`. It applies whenever cancellation prevents body invocation, including pre-aborted entry, cancellation during pre-policy or approval, an aborted wrapper signal, a wrapper success overtaken by caller cancellation before delegation, and agent-loop siblings skipped after turn cancellation.
|
||||
|
||||
`ABORTED` carries model text `Error: tool call aborted` and applies only after the body was invoked, including cancellation while an around wrapper or post-policy listener waits after body completion. A started body that throws the signal's reason or an `Error` named `AbortError` without `HarnessError` identity keeps that message and carries `{ name: 'AbortError', code: 'ABORTED' }`. A denial, wrapper failure, other tool failure, or post-policy failure remains more specific than generic cancellation. A timeout owned by timeout-policy remains `TOOL_TIMEOUT`, and contexts deferred before a successful outcome is replaced remain attached.
|
||||
`ABORTED` carries model text `Error: tool call aborted` and applies only after the body was invoked, including cancellation while an around wrapper or post-policy listener waits after body completion. A started body that throws the signal's reason or an `Error` named `AbortError` without `HarnessError` identity keeps that message and carries `{ name: 'AbortError', code: 'ABORTED' }`. A `tools/execute` wrapper that throws such a value after caller cancellation is classified the same way, with `ABORTED_BEFORE_DISPATCH` when the body never started. A denial, other wrapper failure, other tool failure, or post-policy failure remains more specific than generic cancellation. A timeout owned by timeout-policy remains `TOOL_TIMEOUT`, and contexts deferred before a successful outcome is replaced remain attached.
|
||||
|
||||
### Pre-aborted entry short-circuits after materialization
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ Status: implemented
|
||||
|
||||
`ABORTED_BEFORE_DISPATCH` 携带 `{ name: 'AbortError' }` 和模型可见文本 `Error: tool call aborted before dispatch`。凡取消阻止工具主体调用时都使用该结果,包括进入时已中止、前置策略或审批期间取消、包装层信号已中止、包装层在委托前返回的成功结果被调用方取消抢先,以及轮次取消后 agent loop(智能体循环)跳过的同批调用。
|
||||
|
||||
`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。已开始的工具主体抛出 signal 的 reason,或不具备 `HarnessError` 身份、name 为 `AbortError` 的 `Error` 时,结果保留该 message,并携带 `{ name: 'AbortError', code: 'ABORTED' }`。拒绝、包装层失败、其他工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。
|
||||
`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。已开始的工具主体抛出 signal 的 reason,或不具备 `HarnessError` 身份、name 为 `AbortError` 的 `Error` 时,结果保留该 message,并携带 `{ name: 'AbortError', code: 'ABORTED' }`。`tools/execute` 包装层在调用方取消后抛出这类值时按同样方式归类,工具主体尚未开始时为 `ABORTED_BEFORE_DISPATCH`。拒绝、其他包装层失败、其他工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。
|
||||
|
||||
### 进入时已中止会在物化后短路
|
||||
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
en: fb2c7bcde3b1672a
|
||||
zh: a05bd30be07e5413
|
||||
/agent-note-session-history-control-state-and-remote-event-transport/decision/general-remote-stream-model/remotestream:
|
||||
en: d55c2ce88400e448
|
||||
zh: 344d510ab946bb9f
|
||||
en: 867f3ac763f81d8d
|
||||
zh: a936269f2fc40f8d
|
||||
/agent-note-session-history-control-state-and-remote-event-transport/decision/general-remote-stream-model/remotesnapshotstream:
|
||||
en: f2c1d2b00d9554fd
|
||||
zh: c3e85cf344f7ef24
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ Domain Controllers use them through composition or thin adapters; Session and Wo
|
||||
|
||||
Each item carries a monotonic generation, that generation's `AbortSignal`, and `accept()`. A domain consumer calls `accept()` only after validating the opening cursor or baseline.
|
||||
|
||||
Only `RemoteStreamCarrierError` permits retry. When the Host remains available, one independent reopen is allowed; otherwise the stream waits for a new Connection generation. Business errors, protocol errors, and opening failures terminate immediately.
|
||||
Only a failure whose `code` is `gateway/carrier-lost` permits retry; `RemoteStreamCarrierError` carries that code, and a domain `ended` callback may return a plain `Error` with it. When the Host remains available, one independent reopen is allowed; otherwise the stream waits for a new Connection generation. Business errors, protocol errors, and opening failures terminate immediately.
|
||||
|
||||
`restart()` replaces only the current physical generation and preserves the logical stream. `dispose()` permanently ends the logical stream, pending retry, and iterator, then waits for quiescence.
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ RemoteStream<Item>
|
||||
|
||||
每个 item 携带单调 generation、该 generation 的 `AbortSignal` 与 `accept()`。领域 consumer 只有在验证 opening cursor 或 baseline 后才调用 `accept()`。
|
||||
|
||||
只有 `RemoteStreamCarrierError` 可触发重试。Host 仍可用时允许一次独立重开;否则等待新的 Connection generation。业务错误、协议错误和 opening 失败直接终止。
|
||||
只有 `code` 为 `gateway/carrier-lost` 的失败可触发重试;`RemoteStreamCarrierError` 带有该 code,领域的 `ended` 回调也可以返回带该 code 的普通 `Error`。Host 仍可用时允许一次独立重开;否则等待新的 Connection generation。业务错误、协议错误和 opening 失败直接终止。
|
||||
|
||||
`restart()` 只淘汰当前物理 generation,保留 logical stream;`dispose()` 永久结束 logical stream、pending retry 与 iterator,并等待 quiescence。
|
||||
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
en: b6f585ca87e1fc6f
|
||||
zh: 53fd58c3e93cf17c
|
||||
/agent-note-client-session-conversation-and-ui-ownership-layers/package-ownership:
|
||||
en: 89f75f7cc2fe0e6c
|
||||
zh: e50974fad3baf69c
|
||||
en: f3f1e545f7b15d9a
|
||||
zh: 80927e6b4e8ed5bc
|
||||
/agent-note-client-session-conversation-and-ui-ownership-layers/overall-data-flow:
|
||||
en: 002d9f406580684b
|
||||
zh: a86742c6c943ac85
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ Adding a target does not add a branch to the renderer or Session Controller. The
|
||||
| `api/session-controller/client` | Session objects, catalog, references, source counts, commands, projections, event windows, and Agent Contexts | Navigation, completion reminders, Conversation targets, React, Slots, Workspace |
|
||||
| `api/workspace-controller/client` | Workspace objects, ordering, archive state, commands, and snapshots | React, Session navigation policy, directory UI |
|
||||
| `client/ui-session` | Explicit Session scope, standard sources, `SessionProvider`, and effective pending interactions | Session transport, reference ownership, Conversation assembly, Approval/Question results, unified UI status |
|
||||
| `client/ui-session-status` | Unified UI status: running state, effective pending request, and completion reminders | Pending-interaction registration, Session transport, React |
|
||||
| `client/ui-session-status` | Unified UI status: running state, effective pending request, and completion reminders; Host reading records and their Client copy; main-view reading acknowledgement | Pending-interaction registration, Session transport, React |
|
||||
| `client/ui-workspace` | Workspace hook, browser UI, main-area reference, and cross-Controller navigation policy | Workspace transport, copies of Session data |
|
||||
| `client/ui-conversation` | Conversation core, registries, bindings, shell, input, composer, queue, and View navigation | Session transport, Chat/Trajectory snapshots |
|
||||
| `client/ui-chat` | Chat target, Node definitions, renderers, selection, details, and locale | Session lifecycle, generic View navigation, Trajectory, historical-image cache |
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ UI 层可以同时读取多个 Controller 做一次导航决定,但不得把
|
||||
| `api/session-controller/client` | 会话对象、目录、引用、来源计数、命令、投影、事件窗口与 Agent Context | 导航、完成提醒、Conversation target、React、Slot、Workspace |
|
||||
| `api/workspace-controller/client` | Workspace 对象、顺序、归档、命令和 snapshot | React、Session 导航策略、目录 UI |
|
||||
| `client/ui-session` | 显式会话作用域、标准数据源、`SessionProvider` 与有效待处理交互 | 会话传输、引用所有权、Conversation 组装、Approval/Question 结果、统一 UI 状态 |
|
||||
| `client/ui-session-status` | 统一 UI 状态:运行状态、有效待处理请求与完成提醒 | 待处理交互登记、会话传输、React |
|
||||
| `client/ui-session-status` | 统一 UI 状态:运行状态、有效待处理请求与完成提醒;宿主阅读记录及其前端副本;主视图阅读确认 | 待处理交互登记、会话传输、React |
|
||||
| `client/ui-workspace` | Workspace 钩子、浏览器 UI、主区域引用与跨控制器导航策略 | Workspace 传输、会话数据副本 |
|
||||
| `client/ui-conversation` | Conversation core、registry、binding、shell、input、composer、queue 和 View 导航 | Session transport、Chat/Trajectory snapshot |
|
||||
| `client/ui-chat` | Chat target、Node definitions、renderer、selection、details 和 locale | Session 生命周期、通用 View 导航、Trajectory、历史图片 cache |
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
en: e2de83d10542f93b
|
||||
zh: 3855b38fc8c48ea3
|
||||
/agent-note-client-session-references-reference-sources-and-ui-status/decision/unified-ui-session-status:
|
||||
en: 07ea04b9ca50dd8f
|
||||
zh: e025fcea4c9f0fb9
|
||||
en: 45038468e95179f9
|
||||
zh: ac8f2f098f5b2427
|
||||
/agent-note-client-session-references-reference-sources-and-ui-status/decision/explicit-providers-and-consumer-lifetimes:
|
||||
en: 04802baa0147fec1
|
||||
zh: b86037bf2e4bc936
|
||||
|
||||
@@ -96,22 +96,16 @@ Window-level consumers may inspect source markers. Session business operations s
|
||||
| --- | --- | --- |
|
||||
| `running` | `boolean` or `undefined` | Latest known Session running fact; absence of a baseline is not confirmed idle |
|
||||
| `pendingInteraction` | `SessionPendingInteraction` or `undefined` | Effective domain-owned request, or absence when no request is pending |
|
||||
| `completionUnread` | `boolean` | UI reminder for an observed stop that has not been acknowledged |
|
||||
| `completionUnread` | `boolean` | Host reading record carries a manual unread mark or an unacknowledged completed turn |
|
||||
| `completionFailed` | `boolean` | The Session is unread and its latest completed turn ended with an execution error |
|
||||
|
||||
Source counts remain authoritative in `SessionListState.byId[id].retainedBy`; UI status reads them for acknowledgement policy without owning another reference registry. Titles, Workspace associations, history, queues, and projection data remain with their existing owners.
|
||||
|
||||
Pending domains retain `SessionPendingInteractionMap`, request identities, precedence, publication disposers, and teardown delegation in `ui-session`, which publishes each Session's effective request read-only as `ctx.uiSession.pendingInteractions`. The unified status includes the same effective request object; it does not copy requests or create a second pending registry. Workspace status indicators and Conversation composer selection read `useSessionStatus` instead of separate `useSessionPendingInteraction` and `useCompletedSessionIds` hooks.
|
||||
|
||||
Completion tracking subscribes to the existing `api-session/status` events so a running-to-idle transition is not lost in batched catalog snapshots. Host-list rows (`ids`) establish initial and reconnect running baselines; synthetic catalog and retained rows preserve independently observed status. A pending empty catalog is not evidence that Sessions disappeared. The update rules are:
|
||||
Running tracking subscribes to the existing `api-session/status` events so a running-to-idle transition is not lost in batched catalog snapshots. Host-list rows (`ids`) establish initial and reconnect running baselines; synthetic catalog and retained rows preserve independently observed status. A pending empty catalog is not evidence that Sessions disappeared, and removing a Session clears its running baseline; pending-request teardown stays with the request's domain.
|
||||
|
||||
- An initial idle baseline does not create a completion reminder.
|
||||
- Observing running clears an earlier reminder and records the running baseline.
|
||||
- A known running-to-idle transition sets `completionUnread` only when the Session lacks main-view ownership.
|
||||
- Acquiring main-view ownership clears the reminder; retaining from an unrelated source does not.
|
||||
- Releasing main-view ownership does not manufacture a reminder for an earlier stop.
|
||||
- Removing a Session clears its completion reminder and running baseline; pending-request teardown stays with the request's domain.
|
||||
|
||||
The reminder denotes an observed stop, not successful task completion or completion of a particular queued message. Main-view ownership preserves selection-based acknowledgement even while a global panel temporarily hides the Conversation. The design has no `ui-session/view-presence` event, mounted-Provider index, or implicit acknowledgement from Provider mount.
|
||||
Completion reminders follow the Host reading records described in [Host-memory Session reading state](../feature/2026-10-23-session-reading-memory.md), which supersedes this note's earlier Client-local reminder rules: running changes and main-view ownership neither set nor clear a reminder, and the visible main view acknowledges a completed turn only after its body arrives. The reminder denotes a completed turn, not successful task completion or completion of a particular queued message. Main-view ownership preserves selection-based acknowledgement even while a global panel temporarily hides the Conversation. The design has no `ui-session/view-presence` event, mounted-Provider index, or implicit acknowledgement from Provider mount.
|
||||
|
||||
The Session Controller publishes running and reference-source facts but owns no completion-reminder set, `consumeCompletion` method, or pending-interaction presentation. Reference acquisition does not execute completion-reminder business logic.
|
||||
|
||||
|
||||
@@ -96,22 +96,16 @@ Controller 将来源计数与每个活跃代的引用共同管理。每个来源
|
||||
| --- | --- | --- |
|
||||
| `running` | `boolean` 或 `undefined` | 最新已知的 Session 运行事实;缺少基线不表示已确认 idle |
|
||||
| `pendingInteraction` | `SessionPendingInteraction` 或 `undefined` | 领域拥有的有效请求;没有待处理请求时缺失 |
|
||||
| `completionUnread` | `boolean` | 已观察到停止、但尚未确认的 UI 提醒 |
|
||||
| `completionUnread` | `boolean` | 宿主阅读记录带有手动未读标记或尚未确认的完成轮次 |
|
||||
| `completionFailed` | `boolean` | Session 未读,且最近完成的轮次以执行错误结束 |
|
||||
|
||||
来源计数以 `SessionListState.byId[id].retainedBy` 为准;UI 状态读取它以执行确认策略,不维护另一套引用注册表。标题、Workspace 关联、历史、队列和投影数据保留在各自的既有所有者中。
|
||||
|
||||
待处理领域在 `ui-session` 中保留 `SessionPendingInteractionMap`、请求身份、优先级、发布清理函数与卸载委托,`ui-session` 以只读的 `ctx.uiSession.pendingInteractions` 发布每个 Session 的有效请求。统一状态包含同一个有效请求对象,不复制请求,也不创建第二套待处理注册表。Workspace 状态指示器与 Conversation composer 选择读取 `useSessionStatus`,不再分别读取 `useSessionPendingInteraction` 和 `useCompletedSessionIds` 钩子。
|
||||
|
||||
完成跟踪订阅已有 `api-session/status` 事件,避免 running 到 idle 的变化在合批目录快照中丢失。Host 列表行(`ids`)建立初始与重连的 running 基线;目录合成行与 retained 行保留独立观察到的状态。pending 状态下的空目录不能证明 Session 已消失。更新规则如下:
|
||||
运行跟踪订阅已有 `api-session/status` 事件,避免 running 到 idle 的变化在合批目录快照中丢失。Host 列表行(`ids`)建立初始与重连的 running 基线;目录合成行与 retained 行保留独立观察到的状态。pending 状态下的空目录不能证明 Session 已消失;移除 Session 时清除其运行基线,待处理请求的清理仍属于请求领域。
|
||||
|
||||
- 初始 idle 基线不产生完成提醒。
|
||||
- 观察到 running 时清除旧提醒,并记录运行基线。
|
||||
- 从已知 running 变为 idle 时,仅在 Session 没有主视图持有的情况下设置 `completionUnread`。
|
||||
- 获得主视图持有时清除提醒;无关来源的 retain 不清除提醒。
|
||||
- 释放主视图持有不会为更早的一次停止补造提醒。
|
||||
- 移除 Session 时清除其完成提醒与运行基线;待处理请求的清理仍属于请求领域。
|
||||
|
||||
提醒表示观察到的一次停止,不代表任务成功,也不代表某条排队消息完成。即使全局面板暂时隐藏 Conversation,主视图所有权仍保持基于选择的确认语义。本设计不提供 `ui-session/view-presence` 事件、已挂载 Provider 索引或 Provider 挂载时的隐式确认。
|
||||
完成提醒跟随[宿主内存中的会话阅读状态](../feature/2026-10-23-session-reading-memory.zh.md)所述的宿主阅读记录,该记录取代本记录早先的前端本地提醒规则:运行变化和主视图持有都不会设置或清除提醒,可见的主视图只在正文到达后确认完成的轮次。提醒表示完成的一个轮次,不代表任务成功,也不代表某条排队消息完成。即使全局面板暂时隐藏 Conversation,主视图所有权仍保持基于选择的确认语义。本设计不提供 `ui-session/view-presence` 事件、已挂载 Provider 索引或 Provider 挂载时的隐式确认。
|
||||
|
||||
Session Controller 发布运行与引用来源事实,但不拥有完成提醒集合、`consumeCompletion` 方法或待处理交互展示。引用获取不执行完成提醒业务逻辑。
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Bilingual-pair consistency record for 2026-10-23-session-reading-memory.md (docs/i18n/README.md): per heading
|
||||
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-10-23-session-reading-memory.md
|
||||
/agent-note-host-memory-session-reading-state:
|
||||
en: d0d93ca91b0bfd16
|
||||
zh: 55f67f2074612e4d
|
||||
/agent-note-host-memory-session-reading-state/problem:
|
||||
en: 61f665a6dc1bc503
|
||||
zh: 3421cf192528179e
|
||||
/agent-note-host-memory-session-reading-state/decision:
|
||||
en: a15c7c13f167e5ac
|
||||
zh: 63bcc2ef60c2f344
|
||||
/agent-note-host-memory-session-reading-state/decision/package-structure:
|
||||
en: e22765435a1ab422
|
||||
zh: 7ac9fbcea4c15387
|
||||
/agent-note-host-memory-session-reading-state/decision/client-dependency-rules:
|
||||
en: e38746215940a163
|
||||
zh: a4e343dac7942aa2
|
||||
/agent-note-host-memory-session-reading-state/decision/host-records:
|
||||
en: ea1b8aa4ed60f04c
|
||||
zh: 9c979b7b40eacb3e
|
||||
/agent-note-host-memory-session-reading-state/decision/automatic-acknowledgement:
|
||||
en: 64f9e14597dbc3d4
|
||||
zh: e2d20a5105c9d950
|
||||
/agent-note-host-memory-session-reading-state/alternatives-considered:
|
||||
en: 755d2e5eb626b445
|
||||
zh: 898f83b86d2e2209
|
||||
/agent-note-host-memory-session-reading-state/consequences:
|
||||
en: 01f6beaeff1e6c7f
|
||||
zh: 1fdee75b2c4bf646
|
||||
@@ -0,0 +1,58 @@
|
||||
# Agent Note: Host-memory Session reading state
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-10-23-session-reading-memory.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Clients connected to the same Host need consistent reading reminders, including completions that end while every Client is offline. Automatic acknowledgements must not clear unseen completions or manual unread marks. Reading activity must not change model history. The reminders appear in the Client Session status table that [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.md) owns, so the reading records, their Client follower, and the table that consumes them need one owner whose Client face may follow a Host Remote stream.
|
||||
|
||||
## Decision
|
||||
|
||||
### Package structure
|
||||
|
||||
`@deepseek-ai/dsh-client-ui-session-status` owns the feature on both faces, following the Host-and-Client package precedent of ui-trajectory:
|
||||
|
||||
| Face | Service | Responsibility |
|
||||
|---|---|---|
|
||||
| Host (`.`) | `ctx.sessionStatus` (`SessionStatusService`) | Keeps one reading record per Session in an in-memory Map; the `sessionStatus` Remote namespace serves `mark` and `follow`; failures use `session-status/not-found` and `session-status/unavailable` |
|
||||
| Client (`./client`) | `ctx.uiSession.sessionStatus` (service name `uiSession.sessionStatus`) | Follows the Host reading stream, builds the status table with `completionUnread` and `completionFailed`, exposes `mark` and `readingReady`, and acknowledges main-view reading |
|
||||
|
||||
The Client copy of the reading records is a package-internal module: it exports no value or type and provides no Client service of its own, so consumers such as ui-workspace and ui-conversation depend only on `ctx.uiSession.sessionStatus` and the exported status types. The Web bundle's single `ui-session-status` row loads both faces, api/remotes mounts the package's `/remote` descriptor, and the Web client lists the package among its required boot entries. ui-session, pending-interaction registration, and `ctx.uiSession.pendingInteractions` stay unchanged.
|
||||
|
||||
### Client dependency rules
|
||||
|
||||
Following the Host stream needs the Gateway's `RemoteSnapshotStream` at runtime. `verify-client-packages` lets a `packages/client` feature package request rows under `packages/api/` through `dsh.client.external`, while still rejecting requests for another feature plugin's row; the Remote API group is infrastructure, not a feature plugin. The package requests only `@deepseek-ai/dsh-api-gateway/client`. The stream runs only while `ctx.remoteAccess` allows `sessionStatus/follow`; that endpoint is owner-only for LiveShare, so a viewer page opens no stream, keeps `readingReady` false, and reports no synchronization failure.
|
||||
|
||||
`RemoteStream` decides reconnection by the stable error code `gateway/carrier-lost` rather than by `instanceof RemoteStreamCarrierError`. The class carries that code, so existing callers keep their behavior, and the package's `ended` callback returns a plain `Error` with the code, typed by the exported `RemoteStreamCarrierFailure` type, without importing the class. The code is produced only inside the Client process: a `RemoteError` returned by the Host terminates the stream even when it carries the same code.
|
||||
|
||||
### Host records
|
||||
|
||||
The Host service owns one in-memory record per Session and derives the latest ended turn and its failure flag from `turn/end` events itself. Mutations update the Map synchronously. Read actions carry the Client-observed completed turn; the Host advances the read position monotonically and never beyond its known completion. Automatic acknowledgements leave manual unread unchanged; explicit marks replace it in Host processing order. Only the ordered baseline and whole-record change stream updates the Client, so mutation replies need no record or revision.
|
||||
|
||||
Cold Session marks read metadata without opening history. A Session without a record reads as read, so history neither needs a startup scan nor distinguishes a cold Session from a live zero-turn one. Shutdown closes followers and clears records. A pending metadata lookup rejects its mark after disposal rather than delaying teardown for an in-memory write.
|
||||
|
||||
### Automatic acknowledgement
|
||||
|
||||
Only a visible, focused main view acknowledges reading, after a rendering frame and evidence that the body reached the completed turn. Window focus advances only the natural read position. A main-view switch to a different Session, including the first selection after a page load, clears that Session's existing manual reminder once its body arrives; the check waits for a ready reading baseline. Window focus, a replaced binding for the same Session, and activity in the open Session do not clear it, so a mark made in the open Session stays until the view leaves and returns. Later automatic acknowledgements preserve manual marks, including those received while the body loads. Keeping the rule inside the acknowledgement plugin avoids a cross-package reading event and changes to the Conversation body. While the visible, focused main view retains an open Session, the status table does not show that Session's unacknowledged completion, so its row does not flash unread before the acknowledgement round trip; manual marks stay visible, and the reminder returns when the window loses focus or the view moves away first. Archived rows read as read and offer no reading mark.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- **ui-session reads reading state:** the base UI package would depend on a feature package, and every UI above it could not start without the reading plugin.
|
||||
- **A separate reading package with a Client service:** consumers would see a second reading API beside `ctx.uiSession.sessionStatus`, and the status table would depend on another package's service only to fold its records.
|
||||
- **An api-group reading package beside the client table:** splits one feature across two packages whose Host contract, Client follower, and table evolve together; the relaxed external rule lets the client package follow the stream itself.
|
||||
- **Reimplementing the snapshot protocol over `ctx.remote.$stream`:** duplicates Gateway-owned baseline and reconnection logic in a feature package.
|
||||
- **Importing `RemoteStreamCarrierError` into the client package:** a feature package would depend on a Gateway class identity for one retry decision; a stable code states the decision without class identity across separately bundled modules.
|
||||
- **Host face in the shared base bundle:** profiles without a Web Client would run a reading service no Client reads, and the Host face would load from a different bundle than its Client face.
|
||||
- **Frontend memory or local storage:** cannot provide one authority for browsers and Desktop clients, or collect completions while all frontends are offline.
|
||||
- **Persistent Host records:** preserve reminders across Host restarts but require a separate lifecycle design for Session checkpoints, domain ownership, backend shutdown, and failed writes. This implementation deliberately limits ownership to memory; persistence is a separate change.
|
||||
- **Reading events in the Session log:** mix viewer intent with model history and require loading cold histories for metadata-only actions.
|
||||
- **Revision-based conditional writes:** prevent delayed explicit actions from replacing newer manual intent, but require conflict responses, revision bookkeeping and unary-result reconciliation. Session reminders accept Host processing order instead. A read-position cursor still prevents unseen completions from being acknowledged.
|
||||
- **Message ID cursor:** identifies a message but does not order completed turns, including failures without a new assistant message. The existing completed-turn number directly represents this feature's unit of progress.
|
||||
|
||||
## Consequences
|
||||
|
||||
Browser refresh and temporary disconnect preserve reminders while this Host service runs. Host restart or plugin reload resets every reading record and treats existing history as read; a turn that failed before the restart leaves no outcome, so marking that Session unread shows the ordinary reminder. Profiles without the Web bundle run no reading service. There are no read-state files, storage-domain dependencies, checkpoint writes, or cross-process synchronization guarantees. Reminders remain for detached Sessions until the service stops; reclaiming records requires a Session deletion lifecycle.
|
||||
|
||||
Concurrent explicit actions have last-processed semantics; an entry acknowledgement can clear another manual mark that arrives before it is processed. Verification covers two followers, monotonic read positions and manual-mark preservation during automatic acknowledgements, a first completion after manual marks, access-driven rebaselines, shutdown with a pending metadata lookup, service reload, independence from Session flush, and the failure flag of a completing turn. Client tests cover the reading stream's baseline replacement and terminal failure, delayed body delivery, manual marks during loading, and manual-reminder clearing on main-view switches but not on window focus or a replaced binding. Gateway tests cover reconnection for a plain error carrying the carrier code and termination without it. Persistent restart recovery, crash consistency, storage-provider ordering, and cross-process writers require separate validation before persistence is enabled. The main-view retention signal does not distinguish every settings or auxiliary panel; that visibility refinement remains part of the notification work.
|
||||
@@ -0,0 +1,58 @@
|
||||
# Agent Note: 宿主内存中的会话阅读状态
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-10-23-session-reading-memory.md) | 中文
|
||||
|
||||
## 问题
|
||||
|
||||
连接同一宿主的前端需要一致的阅读提醒,包括所有前端都离线时结束的轮次。自动阅读确认不能清除尚未看到的完成提醒或手动未读标记。阅读行为不能改变模型历史。这些提醒显示在 [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.zh.md) 拥有的前端会话状态表中,因此阅读记录、它的前端订阅方和使用它的状态表需要同一个归属方,而且其前端面能够订阅宿主 Remote 流。
|
||||
|
||||
## 决策
|
||||
|
||||
### 包结构
|
||||
|
||||
`@deepseek-ai/dsh-client-ui-session-status` 在两个面上拥有该功能,沿用 ui-trajectory 同时提供宿主面和前端面的先例:
|
||||
|
||||
| 面 | 服务 | 职责 |
|
||||
|---|---|---|
|
||||
| 宿主(`.`) | `ctx.sessionStatus`(`SessionStatusService`) | 在内存 Map 中为每个会话保存一条阅读记录;Remote 命名空间 `sessionStatus` 提供 `mark` 和 `follow`;失败使用 `session-status/not-found` 和 `session-status/unavailable` |
|
||||
| 前端(`./client`) | `ctx.uiSession.sessionStatus`(服务名 `uiSession.sessionStatus`) | 订阅宿主阅读流,构建含 `completionUnread` 和 `completionFailed` 的状态表,提供 `mark` 和 `readingReady`,并确认主视图已读 |
|
||||
|
||||
前端的阅读记录副本是包内部模块:它不导出任何值或类型,也不提供自己的前端服务,因此 ui-workspace、ui-conversation 等使用方只依赖 `ctx.uiSession.sessionStatus` 和导出的状态类型。Web bundle 中唯一的 `ui-session-status` 行加载两个面,api/remotes 挂载本包的 `/remote` 描述,Web 前端把本包列为启动必需入口。ui-session、待交互登记和 `ctx.uiSession.pendingInteractions` 保持不变。
|
||||
|
||||
### 前端依赖规则
|
||||
|
||||
订阅宿主流在运行时需要 Gateway 的 `RemoteSnapshotStream`。`verify-client-packages` 允许 `packages/client` 下的功能包通过 `dsh.client.external` 请求 `packages/api/` 下的行,但仍拒绝请求另一个功能插件的行;Remote API 组是基础设施,不是功能插件。本包只请求 `@deepseek-ai/dsh-api-gateway/client`。只有 `ctx.remoteAccess` 允许 `sessionStatus/follow` 时才运行该流;该端点在 LiveShare 中仅限所有者,因此查看者页面不打开该流,`readingReady` 保持 false,也不报告同步失败。
|
||||
|
||||
`RemoteStream` 按稳定的 error code `gateway/carrier-lost` 判断是否重连,而不是按 `instanceof RemoteStreamCarrierError`。该 class 自带这个 code,现有调用方行为不变;本包的 `ended` 回调返回带该 code 的普通 `Error`,用导出的 `RemoteStreamCarrierFailure` 类型描述,而不导入该 class。该 code 只在前端进程内产生:宿主返回的 `RemoteError` 即使带有相同 code 也会终止流。
|
||||
|
||||
### 宿主记录
|
||||
|
||||
宿主服务在内存中为每个会话保存一条记录,自己从 `turn/end` 事件取得最近结束的轮次及其失败标记。修改同步更新 Map。已读请求携带前端已看到的完成轮次;宿主单调推进阅读位置,且不越过已知完成位置。自动确认保留手动未读,主动标记按宿主处理顺序替换它。前端只通过有序基线和整条记录的更新流取得状态,修改回复不需要记录或版本。
|
||||
|
||||
对冷会话的标记只读取元信息,不打开历史。没有记录的会话按已读处理,因此历史既不需要启动扫描,也不需要区分冷会话和零轮次的活跃会话。关闭时结束订阅并清空记录;尚在等待元信息的标记请求会在查询返回后被拒绝,不会为了内存写入延迟卸载。
|
||||
|
||||
### 自动确认
|
||||
|
||||
只有可见且聚焦的主视图会确认阅读,并等待一次渲染帧及正文已到达完成轮次的证据。窗口聚焦只推进自然已读位置。主视图切换到另一个会话(包括页面加载后的首次选中)时,会在正文到达后清除该会话已有的手动提醒;检查会等待阅读基线就绪。窗口聚焦、同一会话更换 binding 以及在已打开会话中的操作都不会清除它,因此在已打开会话中做的标记会保留到视图切走再切回。后续自动确认保留手动标记,包括正文加载期间收到的标记。把规则留在确认插件内部,可以避免跨包的阅读事件,也不需要修改 Conversation 正文。可见且聚焦的主视图持有某个已打开的会话时,状态表不显示该会话尚未确认的完成轮次,避免在确认往返完成前闪现未读;手动标记照常显示,窗口失焦或视图先行切走时提醒会重新出现。归档行按已读处理,不提供阅读标记。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
- **ui-session 读取阅读状态:** 基础 UI 包会依赖功能包,阅读插件缺席时其上的所有界面都无法启动。
|
||||
- **单独的阅读包并提供前端服务:** 使用方会在 `ctx.uiSession.sessionStatus` 之外看到第二套阅读 API,状态表也只为汇总记录而依赖另一个包的服务。
|
||||
- **在前端状态表旁另建 api 组阅读包:** 把一个功能拆到两个包中,而宿主接口、前端订阅方和状态表同步演进;放宽 external 规则后,前端包可以自己订阅该流。
|
||||
- **在 `ctx.remote.$stream` 之上重写快照协议:** 会在功能包中复制 Gateway 负责的基线与重连逻辑。
|
||||
- **在前端包中导入 `RemoteStreamCarrierError`:** 功能包会为一次重试判断依赖 Gateway 的 class 身份;稳定的 code 能表达这一判断,而不依赖跨独立打包模块的 class 身份。
|
||||
- **宿主面放在共享基础 bundle:** 没有 Web 前端的 profile 会运行无人读取的阅读服务,宿主面也会与前端面从不同的 bundle 加载。
|
||||
- **前端内存或本地存储:** 无法为浏览器和 Desktop 前端提供共同的权威状态,也无法收集所有前端离线期间的完成提醒。
|
||||
- **宿主持久化记录:** 能够让提醒跨宿主重启保留,但需要单独设计会话检查点、存储域归属、后端关闭及写入失败的生命周期。本实现将状态限制在内存,持久化另行实现。
|
||||
- **在会话日志中记录阅读事件:** 会把使用者意图混入模型历史,并使只需元信息的操作也要加载冷会话历史。
|
||||
- **按版本条件写入:** 可防止延迟的主动操作覆盖较新的手动意图,但需要冲突响应、版本维护和请求响应的状态合并。会话提醒接受宿主处理顺序,仍保留阅读位置以防误读新完成内容。
|
||||
- **消息 ID 游标:** 只能定位消息,不能直接排序已完成轮次,也不能覆盖未产生新助手消息的失败。已有完成轮次直接对应本功能的进度单位。
|
||||
|
||||
## 结果
|
||||
|
||||
宿主服务运行期间,刷新浏览器或临时断线会保留提醒。宿主重启或插件重载会重置全部阅读记录,并把已有历史视为已读;重启前失败的轮次不留下结果,因此把该会话标为未读时显示普通提醒。不含 Web bundle 的 profile 不运行阅读服务。没有阅读状态文件、存储域依赖、检查点写入或跨进程同步保证。会话从内存卸载后,其提醒保留到服务停止;回收记录需要会话删除生命周期。
|
||||
|
||||
并发主动操作以宿主最后处理的操作为准;进入视图的确认可能清除处理前到达的另一条手动标记。验证覆盖双订阅、单调阅读位置与自动确认保留手动标记、手动标记后的首次完成、访问权限变化后的新基线、元信息查询期间关闭、服务重载、不依赖会话刷盘,以及结束轮次的失败标记。前端测试覆盖阅读流的基线替换与终态失败、正文延迟、加载期间的手动标记,以及主视图切换时清除手动提醒、窗口聚焦或更换 binding 时不清除。Gateway 测试覆盖带 carrier code 的普通错误会重连、不带 code 时终止。启用持久化前,需单独验证重启恢复、崩溃一致性、存储提供方关闭顺序和跨进程写入。当前主视图保留信号不能区分所有设置或辅助面板;该可见性细化仍属于通知工作的范围。
|
||||
@@ -17,7 +17,7 @@ Convert foreign failures where the dependency is owned. Node errno, SDK, protoco
|
||||
|
||||
## Tool failures
|
||||
|
||||
The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny`, guard denial, or post-execute block with `info` (including the registry's approval denials, `ApprovalError` with `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`), the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`, also applied to a signal reason or an `Error` named `AbortError` that the body throws after cancellation), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, and a guard denial or block without `info`, persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass:
|
||||
The tool registry keeps `error.name` and `error.code` on `tool/result` when the producer supplies them: a `HarnessError` thrown by the tool body, a pre-execute `deny`, guard denial, or post-execute block with `info` (including the registry's approval denials, `ApprovalError` with `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`), the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`, also applied to a signal reason or an `Error` named `AbortError` that the body or a `tools/execute` wrapper throws after cancellation), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, and a guard denial or block without `info`, persist only text that retry policy, UI, and analytics cannot route on. Every expected failure reachable from a tool body therefore throws a `HarnessError`, normally the owning domain's subclass:
|
||||
|
||||
- Hand-checked argument constraints throw `ToolArgsError` (`INVALID_ARGS`) from `dsh-tools`.
|
||||
- Missing composition or caller context, such as an absent Agent, service, or open turn, throws `ToolContextUnavailableError` (`TOOL_CONTEXT_UNAVAILABLE`) from `dsh-tools`.
|
||||
|
||||
@@ -31,7 +31,7 @@ const RECEIPT_LOCALES = [
|
||||
},
|
||||
{
|
||||
language: 'Chinese', code: 'zh', browserLocale: 'zh-CN', connect: connectFreshWorkspaceZh,
|
||||
modelButton: /^选择模型/u, toggle: '启用智能体团队协作', title: '智能体团队协作',
|
||||
modelButton: /^选择模型/u, toggle: '开启智能体团队协作', title: '智能体团队协作',
|
||||
enabled: '已开启', disabled: '已停用',
|
||||
suggestions: '触发候选建议', commandLabel: '智能体团队协作',
|
||||
failure: '执行失败:Use /team on or /team off.',
|
||||
@@ -40,6 +40,19 @@ const RECEIPT_LOCALES = [
|
||||
|
||||
type ReceiptLocale = typeof RECEIPT_LOCALES[number]
|
||||
|
||||
async function openTeamSettings(page: Page, chinese = false): Promise<void> {
|
||||
const trigger = page.getByRole('button', { name: chinese ? /^选择模型/u : /^Select model/u })
|
||||
await trigger.click()
|
||||
await expect.poll(() => trigger.getAttribute('aria-expanded')).toBe('true')
|
||||
await page.getByRole('menuitem', { name: chinese ? /^智能体团队协作 /u : /^Agent teamwork /u }).click()
|
||||
}
|
||||
|
||||
async function closeModelMenu(page: Page): Promise<void> {
|
||||
const trigger = page.getByRole('button', { name: /^(Select model|选择模型)/u })
|
||||
if (await trigger.getAttribute('aria-expanded') === 'true') await trigger.click()
|
||||
await expect.poll(() => trigger.getAttribute('aria-expanded')).toBe('false')
|
||||
}
|
||||
|
||||
async function seedTeamConversation(page: Page, scaffold: WebScaffold): Promise<void> {
|
||||
const agent = scaffold.ctx.agents.list()[0]
|
||||
if (agent === undefined) throw new Error('connected Team workspace did not create an Agent')
|
||||
@@ -115,81 +128,144 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await scaffold?.close()
|
||||
})
|
||||
|
||||
it('explains agent teamwork on hover and focus without changing the Session selection', async () => {
|
||||
it('shows the explanation and switch only on the detail pane and returns to the summary', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-info'))
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
const info = page.getByRole('button', { name: 'About agent teamwork', exact: true })
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
const tooltip = page.getByRole('tooltip')
|
||||
await info.hover()
|
||||
await tooltip.waitFor({ state: 'visible' })
|
||||
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'info.expected.md'), await captureStableAria(page, '[role="tooltip"]', scaffold.workspaceCwd), MODE)
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
await page.getByRole('button', { name: /^Select model/u }).hover()
|
||||
await tooltip.waitFor({ state: 'hidden' })
|
||||
await page.keyboard.press('Shift')
|
||||
await info.focus()
|
||||
await tooltip.waitFor({ state: 'visible' })
|
||||
await page.keyboard.press('Escape')
|
||||
await tooltip.waitFor({ state: 'hidden' })
|
||||
expect(await toggle.isVisible()).toBe(true)
|
||||
await info.click()
|
||||
await tooltip.waitFor({ state: 'visible' })
|
||||
expect(await info.getAttribute('aria-describedby')).toBe(await tooltip.getAttribute('id'))
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
await page.keyboard.press('Escape')
|
||||
await tooltip.waitFor({ state: 'hidden' })
|
||||
await page.keyboard.press('Escape')
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
const trigger = page.getByRole('button', { name: /^Select model/u })
|
||||
await trigger.click()
|
||||
const menu = page.locator('[data-model-menu]')
|
||||
const summary = menu.getByRole('menuitem', { name: 'Agent teamwork Off', exact: true })
|
||||
await summary.waitFor()
|
||||
const stateColor = await summary.getByText('Off', { exact: true }).evaluate(element => getComputedStyle(element).color)
|
||||
const modelColor = await menu.getByRole('menuitem', { name: 'Model DeepSeek-V4-Flash', exact: true })
|
||||
.getByText('DeepSeek-V4-Flash', { exact: true }).evaluate(element => getComputedStyle(element).color)
|
||||
expect(stateColor).toBe(modelColor)
|
||||
const inspectArrow = (element: HTMLElement | SVGElement) => {
|
||||
const { left, right, width, height } = element.getBoundingClientRect()
|
||||
return { left, right, width, height, color: getComputedStyle(element).color, glyph: element.innerHTML }
|
||||
}
|
||||
const peerArrow = menu.getByRole('menuitem', { name: 'Model DeepSeek-V4-Flash', exact: true }).locator('svg').last()
|
||||
expect(await summary.locator('svg').evaluate(inspectArrow)).toEqual(await peerArrow.evaluate(inspectArrow))
|
||||
expect(await menu.getByRole('switch').count()).toBe(0)
|
||||
expect(await page.getByRole('button', { name: 'About agent teamwork', exact: true }).count()).toBe(0)
|
||||
const rootSnapshot = await captureStableAria(page, '[data-model-menu]', scaffold.workspaceCwd)
|
||||
const original = await menu.elementHandle()
|
||||
if (original === null) throw new Error('Model menu is missing')
|
||||
try {
|
||||
await summary.click()
|
||||
const toggle = menu.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.waitFor()
|
||||
expect(await original.evaluate(element => element.isConnected)).toBe(true)
|
||||
await menu.getByText('Coordinate work and progress across agents with a shared task board for better results on complex tasks, with correspondingly higher token costs.', { exact: true }).waitFor()
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
await page.mouse.move(0, 0)
|
||||
await toggle.press('ArrowDown')
|
||||
expect(await toggle.evaluate(element => ({
|
||||
rowBackground: getComputedStyle(element.parentElement!).backgroundColor,
|
||||
focusVisible: element.matches(':focus-visible'),
|
||||
outline: getComputedStyle(element).outlineStyle,
|
||||
descriptionGap: element.parentElement!.nextElementSibling!.getBoundingClientRect().top
|
||||
- element.parentElement!.getBoundingClientRect().bottom,
|
||||
}))).toEqual({ rowBackground: 'rgba(0, 0, 0, 0)', focusVisible: true, outline: 'solid', descriptionGap: 0 })
|
||||
const settingsSnapshot = await captureStableAria(page, '[data-model-menu]', scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'info.expected.md'),
|
||||
`## Root\n\n${rootSnapshot}\n\n## Team settings\n\n${settingsSnapshot}`, MODE)
|
||||
await page.keyboard.press('Escape')
|
||||
await expect.poll(() => summary.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(await menu.getByRole('switch').count()).toBe(0)
|
||||
await summary.press('Enter')
|
||||
await toggle.waitFor()
|
||||
await page.keyboard.press('Escape')
|
||||
await summary.waitFor()
|
||||
expect(await summary.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(scaffold.ctx.agentTeams.isEnabled(scaffold.ctx.agents.list()[0]!)).toBe(false)
|
||||
await page.keyboard.press('Escape')
|
||||
await menu.waitFor({ state: 'hidden' })
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
} finally {
|
||||
await closeModelMenu(page)
|
||||
await original.dispose()
|
||||
}
|
||||
})
|
||||
|
||||
it('toggles from the row label and empty space while keeping the information button independent', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-row'))
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
const info = page.getByRole('button', { name: 'About agent teamwork', exact: true })
|
||||
const label = page.getByText('Enable agent teamwork', { exact: true })
|
||||
const labelBounds = await label.boundingBox()
|
||||
if (labelBounds === null) throw new Error('Team label is not visible')
|
||||
const labelPoint = { x: labelBounds.x + labelBounds.width / 2, y: labelBounds.y + labelBounds.height / 2 }
|
||||
await page.mouse.move(labelPoint.x, labelPoint.y)
|
||||
expect(await toggle.evaluate((element) => {
|
||||
const row = element.parentElement!
|
||||
return getComputedStyle(row).backgroundColor !== 'rgba(0, 0, 0, 0)'
|
||||
})).toBe(true)
|
||||
await page.mouse.click(labelPoint.x, labelPoint.y)
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await info.click()
|
||||
await page.getByRole('tooltip').waitFor({ state: 'visible' })
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await page.keyboard.press('Escape')
|
||||
const gap = await toggle.evaluate((element) => {
|
||||
const control = element.getBoundingClientRect()
|
||||
const help = element.parentElement!.querySelector('button:not([role="switch"])')!.getBoundingClientRect()
|
||||
return { x: (help.right + control.left) / 2, y: control.top + control.height / 2 }
|
||||
})
|
||||
await page.mouse.click(gap.x, gap.y)
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
await page.keyboard.press('Escape')
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
it('aligns settings with the root menu and keeps explanatory text noninteractive in wide and narrow viewports', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-settings-page'))
|
||||
const viewport = page.viewportSize()!
|
||||
try {
|
||||
await openTeamSettings(page)
|
||||
const menu = page.locator('[data-model-menu]')
|
||||
const toggle = menu.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
const description = menu.getByText('Coordinate work and progress across agents with a shared task board for better results on complex tasks, with correspondingly higher token costs.', { exact: true })
|
||||
await description.click()
|
||||
expect(await menu.isVisible()).toBe(true)
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
for (const size of [viewport, { width: 390, height: 700 }]) {
|
||||
await page.setViewportSize(size)
|
||||
await page.keyboard.press('Escape')
|
||||
const summary = menu.getByRole('menuitem', { name: 'Agent teamwork Off', exact: true })
|
||||
await summary.waitFor()
|
||||
const rootBounds = await menu.evaluate((element) => {
|
||||
const { width, left, right } = element.getBoundingClientRect()
|
||||
return { width, left, right }
|
||||
})
|
||||
expect(rootBounds.width).toBe(240)
|
||||
await summary.click()
|
||||
await toggle.waitFor()
|
||||
await expect.poll(() => menu.evaluate((element) => {
|
||||
const { width, left, right } = element.getBoundingClientRect()
|
||||
return { width, left, right }
|
||||
})).toEqual(rootBounds)
|
||||
await expect.poll(() => menu.evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
return bounds.left >= 12 && bounds.right <= innerWidth - 12
|
||||
&& bounds.top >= 12 && bounds.bottom <= innerHeight - 12
|
||||
&& element.scrollWidth <= element.clientWidth
|
||||
})).toBe(true)
|
||||
expect(await description.evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
const style = getComputedStyle(element)
|
||||
return bounds.height > Number.parseFloat(style.lineHeight)
|
||||
&& element.scrollHeight <= element.clientHeight && style.textOverflow !== 'ellipsis'
|
||||
})).toBe(true)
|
||||
}
|
||||
const labelBounds = await menu.getByText('Enable agent teamwork', { exact: true }).boundingBox()
|
||||
if (labelBounds === null) throw new Error('Team label is not visible')
|
||||
await page.mouse.click(labelBounds.x + labelBounds.width / 2, labelBounds.y + labelBounds.height / 2)
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await expect.poll(() => toggle.isEnabled()).toBe(true)
|
||||
await toggle.press('Escape')
|
||||
await menu.getByRole('menuitem', { name: 'Agent teamwork On', exact: true }).click()
|
||||
const gap = await toggle.evaluate((element) => {
|
||||
const control = element.getBoundingClientRect()
|
||||
const label = element.parentElement!.querySelector('span')!.getBoundingClientRect()
|
||||
return { x: (label.right + control.left) / 2, y: control.top + control.height / 2 }
|
||||
})
|
||||
await page.mouse.click(gap.x, gap.y)
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
} finally {
|
||||
await closeModelMenu(page)
|
||||
await page.setViewportSize(viewport)
|
||||
}
|
||||
})
|
||||
|
||||
it('defaults off and saves a Session selection in the model menu', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-mode'))
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.waitFor()
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('false')
|
||||
await toggle.focus()
|
||||
await page.keyboard.press('ArrowUp')
|
||||
expect(await toggle.evaluate(element => element === document.activeElement)).toBe(false)
|
||||
await page.keyboard.press('ArrowDown')
|
||||
await page.keyboard.press('Shift+Tab')
|
||||
expect(await page.getByRole('button', { name: /^Select model/u }).evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(await toggle.count()).toBe(0)
|
||||
await openTeamSettings(page)
|
||||
expect(await toggle.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await page.keyboard.press('Space')
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
expect(scaffold.ctx.commands.list(agent).some(command => command.name === 'team')).toBe(false)
|
||||
@@ -199,10 +275,10 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await other.dispose()
|
||||
const beforeReload = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
acknowledgeReloadConnectionLoss(tripwire, beforeReload)
|
||||
}, 60_000)
|
||||
|
||||
@@ -211,11 +287,11 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
const input = page.locator('[data-composer-input]').first()
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
for (const enabled of [false, true]) {
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe(String(enabled))
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
await expect.poll(() => scaffold.ctx.agentTeams.isEnabled(agent)).toBe(enabled)
|
||||
await expect.poll(() => input.textContent()).toBe('')
|
||||
await page.getByRole('button', { name: 'Account menu', exact: true }).focus()
|
||||
@@ -435,22 +511,22 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
}, 60_000)
|
||||
|
||||
it('hides the board while disabled and restores its tasks when re-enabled', async () => {
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(1)
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
await page.locator('[data-subagent-action]').getByRole('button', { name: '1 subagent', exact: true }).click()
|
||||
await page.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
expect(await page.locator('[data-team-panel]').count()).toBe(0)
|
||||
expect(await page.locator('[data-subagent-panel]').evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
expect(await page.locator('[data-subagent-section-header]').count()).toBe(0)
|
||||
await page.keyboard.press('Escape')
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
await page.locator('[data-subagent-action]').getByRole('button', { name: /subagents?$/u }).click()
|
||||
await page.locator('[data-subagent-panel]').getByText('Agent task', { exact: true }).waitFor()
|
||||
await page.keyboard.press('Escape')
|
||||
@@ -785,14 +861,15 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
agent.session.append('request/header', { header: { config: selection }, reason: 'initial' })
|
||||
await scaffold.ctx.sessions.flush(agent.session)
|
||||
const openConfirmation = async (): Promise<void> => {
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
await page.getByRole('switch', { name: 'Enable agent teamwork', exact: true }).click()
|
||||
await page.getByRole('dialog', { name: 'Disable agent teamwork?', exact: true }).waitFor()
|
||||
}
|
||||
await openConfirmation()
|
||||
const dialog = page.getByRole('dialog', { name: 'Disable agent teamwork?', exact: true })
|
||||
await assertWarningDialogLayout(dialog)
|
||||
expect(await page.getByRole('menu', { name: 'Model and reasoning effort', exact: true }).count()).toBe(0)
|
||||
expect(await page.getByRole('group', { name: 'Agent teamwork', exact: true }).count()).toBe(0)
|
||||
expect(await page.getByRole('button', { name: /^Select model/u }).getAttribute('aria-expanded')).toBe('false')
|
||||
expect(await dialog.getByRole('checkbox').count()).toBe(0)
|
||||
expect(scaffold.ctx.agentTeams.isEnabled(agent)).toBe(true)
|
||||
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'disable-confirmation.expected.md'),
|
||||
@@ -811,11 +888,11 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await dialog.waitFor({ state: 'hidden' })
|
||||
await expect.poll(() => page.getByRole('button', { name: /^Select model/u }).evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await expect.poll(() => scaffold.ctx.agentTeams.isEnabled(agent)).toBe(false)
|
||||
await page.getByRole('button', { name: /^Select model/u }).click()
|
||||
await openTeamSettings(page)
|
||||
await page.getByRole('switch', { name: 'Enable agent teamwork', exact: true }).click()
|
||||
await expect.poll(() => scaffold.ctx.agentTeams.isEnabled(agent)).toBe(true)
|
||||
expect(await dialog.count()).toBe(0)
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
expect(agent.session.ownEvents().filter(event => event.type === 'command/run' || event.type === 'command/done')).toEqual([])
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
@@ -892,14 +969,14 @@ it.each(RECEIPT_LOCALES)('toggles teamwork in $language without command records
|
||||
await expect.poll(captureLayout).toEqual(recordedLayout)
|
||||
}
|
||||
for (const enabled of [true, false]) {
|
||||
await page.getByRole('button', { name: locale.modelButton }).click()
|
||||
await openTeamSettings(page, locale.code === 'zh')
|
||||
const toggle = page.getByRole('switch', { name: locale.toggle, exact: true })
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe(String(enabled))
|
||||
await expect.poll(() => scaffold.ctx.agentTeams.isEnabled(agent)).toBe(enabled)
|
||||
expect(scaffold.ctx.commands.list(agent).some(command => command.name === 'team')).toBe(false)
|
||||
expect(commandEvents()).toEqual([])
|
||||
await page.keyboard.press('Escape')
|
||||
await closeModelMenu(page)
|
||||
await assertChatUnchanged()
|
||||
}
|
||||
await scaffold.ctx.sessions.flush(agent.session)
|
||||
@@ -999,21 +1076,27 @@ it('uses the Chinese collaboration name in the switch and disable confirmation',
|
||||
await connectFreshWorkspaceZh(page, scaffold.workspaceCwd)
|
||||
const agent = scaffold.ctx.agents.list()[0]
|
||||
if (agent === undefined) throw new Error('Chinese Team fixture has no Agent')
|
||||
const trigger = page.getByRole('button', { name: /^选择模型/u })
|
||||
await trigger.click()
|
||||
await page.getByRole('menuitem', { name: '智能体团队协作 关闭', exact: true }).waitFor()
|
||||
await closeModelMenu(page)
|
||||
await scaffold.ctx.agentTeams.setEnabled(agent, true)
|
||||
const selection = agent.model.current()
|
||||
if (selection === undefined) throw new Error('Chinese Team fixture has no model')
|
||||
agent.session.append('request/header', { header: { config: selection }, reason: 'initial' })
|
||||
await scaffold.ctx.sessions.flush(agent.session)
|
||||
await page.getByRole('button', { name: /^选择模型/u }).click()
|
||||
const toggle = page.getByRole('switch', { name: '启用智能体团队协作', exact: true })
|
||||
await trigger.click()
|
||||
await page.getByRole('menuitem', { name: '智能体团队协作 开启', exact: true }).click()
|
||||
const toggle = page.getByRole('switch', { name: '开启智能体团队协作', exact: true })
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await page.getByRole('button', { name: '关于智能体团队协作', exact: true }).waitFor()
|
||||
await page.getByText('通过共享任务板协调多个智能体的分工与进度,复杂任务表现更佳,token 开销也相应更高。', { exact: true }).waitFor()
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
expect(await toggle.evaluate(element => element.parentElement!.scrollWidth <= element.parentElement!.clientWidth)).toBe(true)
|
||||
const menu = await captureStableAria(page, '[role="menu"]', scaffold.workspaceCwd)
|
||||
const menu = await captureStableAria(page, '[data-model-menu]', scaffold.workspaceCwd)
|
||||
await toggle.click()
|
||||
const dialog = page.getByRole('dialog', { name: '确认停用智能体团队协作?', exact: true })
|
||||
const dialog = page.getByRole('dialog', { name: '确认关闭智能体团队协作?', exact: true })
|
||||
await dialog.waitFor()
|
||||
await dialog.getByText('对话过程中停用智能体团队协作,将停止共享任务工具和团队协调指令。', { exact: true }).waitFor()
|
||||
await dialog.getByText('对话过程中关闭智能体团队协作,将停止共享任务工具和团队协调指令。', { exact: true }).waitFor()
|
||||
await assertWarningDialogLayout(dialog)
|
||||
const confirmation = await captureStableAria(page, '[aria-modal="true"]', scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'collaboration.zh.expected.md'),
|
||||
|
||||
@@ -196,7 +196,7 @@ it('keeps ordered legacy Session menu rows before Archive and removes them with
|
||||
await row.hover()
|
||||
await trigger.click()
|
||||
await menu.waitFor()
|
||||
const remainingNames = ['Pin session', 'Rename', 'Fork session', 'Copy Session ID', 'Archive session']
|
||||
const remainingNames = ['Pin session', 'Rename', 'Mark as unread', 'Fork session', 'Copy Session ID', 'Archive session']
|
||||
const remainingItems = menu.getByRole('menuitem')
|
||||
expect(await remainingItems.count()).toBe(remainingNames.length)
|
||||
for (const [index, name] of remainingNames.entries()) {
|
||||
|
||||
@@ -75,7 +75,9 @@ describe.each(['MacIntel', 'Win32', 'Linux x86_64'])('web context menus on %s',
|
||||
const menu = page.getByRole('menu')
|
||||
await menu.getByRole('menuitem', { name: /Copy.*[Ii][Dd]/ }).waitFor()
|
||||
const names = await menuLabels(menu)
|
||||
expect(names.slice(0, 4)).toEqual(['Pin session', 'Rename', 'Fork session', 'Copy Session ID'])
|
||||
expect(names.slice(0, 5)).toEqual([
|
||||
'Pin session', 'Rename', 'Mark as unread', 'Fork session', 'Copy Session ID',
|
||||
])
|
||||
expect(names).not.toContain('Open in')
|
||||
expect(names.at(-1)).toBe('Archive session')
|
||||
expect(await menu.getByRole('menuitem').evaluateAll(rows => rows.every(row => row.querySelector('svg[data-icon]')))).toBe(true)
|
||||
|
||||
@@ -142,7 +142,13 @@ describe('web e2e: the composer model switch is the default for later sessions',
|
||||
badge.textContent = ' — Provider identification badge with a long channel name'
|
||||
node.appendChild(badge)
|
||||
})
|
||||
await expect.poll(async () => (await surface.boundingBox())!.width).toBeGreaterThan(original!.width + 50)
|
||||
if (pane === 'root') {
|
||||
expect(original!.width).toBe(240)
|
||||
await expect.poll(async () => (await surface.boundingBox())!.width).toBe(240)
|
||||
await expect.poll(async () => (await surface.boundingBox())!.x).toBeCloseTo(original!.x)
|
||||
} else {
|
||||
await expect.poll(async () => (await surface.boundingBox())!.width).toBeGreaterThan(original!.width + 50)
|
||||
}
|
||||
await expect.poll(async () => {
|
||||
const box = (await surface.boundingBox())!
|
||||
return box.x >= 12 && box.x + box.width <= 378
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- menu:
|
||||
- menuitem "Pin session"
|
||||
- menuitem "Rename"
|
||||
- menuitem "Mark as unread"
|
||||
- menuitem "Fork session"
|
||||
- separator
|
||||
- menuitem "Copy Session ID"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Pin session
|
||||
Rename
|
||||
Mark as unread
|
||||
Fork session
|
||||
Copy Session ID
|
||||
Archive session
|
||||
@@ -1,6 +1,7 @@
|
||||
- menu:
|
||||
- menuitem "Pin session"
|
||||
- menuitem "Rename"
|
||||
- menuitem "Mark as unread"
|
||||
- menuitem "Fork session"
|
||||
- separator
|
||||
- menuitem "Copy Session ID"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
- treeitem "Unread Untitled {{age}}"
|
||||
@@ -0,0 +1,11 @@
|
||||
- menu:
|
||||
- menuitem "Pin session"
|
||||
- menuitem "Rename"
|
||||
- menuitem "Mark as read"
|
||||
- menuitem "Fork session"
|
||||
- separator
|
||||
- menuitem "Copy Session ID"
|
||||
- separator
|
||||
- menuitem "Archive session"
|
||||
Row state: done
|
||||
Title font weight: 400
|
||||
@@ -54,6 +54,9 @@
|
||||
- listitem:
|
||||
- button "Edit shortcut for Close current page or window"
|
||||
- text: Close current page or window ⌥ ⌘ W
|
||||
- listitem:
|
||||
- button "Edit shortcut for Toggle read/unread"
|
||||
- text: Toggle read/unread ⇧ ⌘ U
|
||||
- region "Message input":
|
||||
- heading "Message input" [level=3]
|
||||
- list:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- menu:
|
||||
- menuitem "Pin session"
|
||||
- menuitem "Rename"
|
||||
- menuitem "Mark as unread"
|
||||
- menuitem "Fork session"
|
||||
- separator
|
||||
- menuitem "Copy Session ID"
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
- listitem:
|
||||
- button "Edit shortcut for Close current page or window"
|
||||
- text: Close current page or window Ctrl + Alt + W
|
||||
- listitem:
|
||||
- button "Edit shortcut for Toggle read/unread"
|
||||
- text: Toggle read/unread Ctrl + Shift + U
|
||||
- region "Message input":
|
||||
- heading "Message input" [level=3]
|
||||
- list:
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
- listitem:
|
||||
- button "修改关闭当前页面/窗口快捷键"
|
||||
- text: 关闭当前页面/窗口 ⌥ ⌘ W
|
||||
- listitem:
|
||||
- button "修改切换已读/未读快捷键"
|
||||
- text: 切换已读/未读 ⇧ ⌘ U
|
||||
- region "消息输入":
|
||||
- heading "消息输入" [level=3]
|
||||
- list:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- tree "Sessions":
|
||||
- treeitem "workspace" [expanded]
|
||||
- treeitem "New Session" [selected]
|
||||
- treeitem "1 subagent running Delegate a background job. now"
|
||||
- treeitem "1 subagent running Unread Delegate a background job. now"
|
||||
@@ -195,8 +195,11 @@ describe.skipIf(MODE === 'record')('web e2e: GitHub ready-for-review', () => {
|
||||
|
||||
const workspaceRow = page.locator('[role="treeitem"]').first()
|
||||
if (await workspaceRow.getAttribute('aria-expanded') !== 'true') await workspaceRow.click()
|
||||
await page.bringToFront()
|
||||
await page.getByText(TITLE, { exact: true }).click()
|
||||
await page.getByText(REPLY, { exact: true }).waitFor({ state: 'visible', timeout: 30_000 })
|
||||
const reviewRow = page.locator('[role="treeitem"]').filter({ has: page.getByText(TITLE, { exact: true }) })
|
||||
await expect.poll(() => reviewRow.getByText('Unread', { exact: true }).count()).toBe(0)
|
||||
const tree = await captureStableAria(page, '[role="tree"][aria-label="Sessions"]', scaffold.workspaceCwd)
|
||||
const conversation = await captureStableAria(page, '[class*="centerCol"]', scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(EXPECTED, `${tree}\n\n---\n\n${conversation}`, MODE)
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('web e2e: plan review takeover round trip', () => {
|
||||
await expect.poll(() => page.getByText('DONE', { exact: true }).count(), { timeout: 15_000 }).toBeGreaterThanOrEqual(1)
|
||||
// Card gone; regular input restored.
|
||||
expect(await page.locator('[data-plan-review-key]').count()).toBe(0)
|
||||
expect(await selectedRow.locator('[data-state="warning"]').count()).toBe(0)
|
||||
await expect.poll(() => selectedRow.getByText('Plan awaiting review', { exact: true }).count()).toBe(0)
|
||||
await expect.poll(() => page.locator('[data-composer-input]').first().isEnabled(), { timeout: 10_000 }).toBe(true)
|
||||
// Completed plans join the final artifacts after the Turn's closing reply.
|
||||
await planCard.waitFor({ state: 'visible' })
|
||||
@@ -245,7 +245,7 @@ describe('web e2e: plan review takeover round trip', () => {
|
||||
})
|
||||
const outcome = asked.then(value => value, (error: unknown) => ({ error }))
|
||||
try {
|
||||
const row = page.locator('[role="treeitem"]').filter({ has: page.locator('[data-state="warning"]') }).first()
|
||||
const row = page.locator(`[data-row-key="session:${reviewedSession}"]`)
|
||||
await row.waitFor({ timeout: 10_000 })
|
||||
await row.click()
|
||||
const card = page.locator('[data-plan-review-key]')
|
||||
@@ -325,7 +325,7 @@ describe.skipIf(MODE === 'record')('web e2e: pending plan review across Sidebar
|
||||
})
|
||||
const outcome = asked.then(value => value, (error: unknown) => ({ error }))
|
||||
try {
|
||||
await row(session).locator('[data-state="warning"]').waitFor({ timeout: 10_000 })
|
||||
await row(session).getByText('Plan awaiting review', { exact: true }).waitFor({ timeout: 10_000 })
|
||||
await scenario()
|
||||
} finally {
|
||||
controller.abort()
|
||||
|
||||
@@ -1191,7 +1191,8 @@ describe('web e2e: plugin manager', () => {
|
||||
await teamPage.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await connectFreshWorkspaceZh(teamPage, scaffold.workspaceCwd)
|
||||
await teamPage.getByRole('button', { name: /^选择模型/u }).click()
|
||||
const mode = teamPage.getByRole('switch', { name: '启用智能体团队协作', exact: true })
|
||||
await teamPage.getByRole('menuitem', { name: '智能体团队协作 关闭', exact: true }).click()
|
||||
const mode = teamPage.getByRole('switch', { name: '开启智能体团队协作', exact: true })
|
||||
await mode.waitFor()
|
||||
expect(await mode.getAttribute('aria-checked')).toBe('false')
|
||||
await mode.click()
|
||||
|
||||
@@ -545,7 +545,7 @@ describe('web e2e: resident question composer round trip', () => {
|
||||
await expect.poll(() => page.getByText('DONE', { exact: true }).count(), { timeout: 15_000 }).toBeGreaterThanOrEqual(1)
|
||||
// Composer gone; regular input restored.
|
||||
expect(await page.locator('[data-question-key]').count()).toBe(0)
|
||||
expect(await selectedRow.locator('[data-state="warning"]').count()).toBe(0)
|
||||
await expect.poll(() => selectedRow.getByText('Waiting for answer', { exact: true }).count()).toBe(0)
|
||||
await expect.poll(() => page.locator('[data-composer-input]').first().isEnabled(), { timeout: 10_000 }).toBe(true)
|
||||
const reply = page.locator('[data-question-reply]')
|
||||
await reply.waitFor({ state: 'visible', timeout: 15_000 })
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/** Reading marks through the shipped Web profile, real Session history, and two Clients. */
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import type { Browser, Page } from 'playwright'
|
||||
import { chromium } from 'playwright'
|
||||
import { afterAll, beforeAll, expect, it, onTestFailed } from 'vitest'
|
||||
import {
|
||||
acknowledgeReloadConnectionLoss, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
|
||||
const SEED = fileURLToPath(new URL('../../../snapshots/web/seeded-history/session.v3.jsonl', import.meta.url))
|
||||
const EXPECTED = fileURLToPath(new URL('./expected/session-reading/unread-menu.expected.md', import.meta.url))
|
||||
const FAILED_EXPECTED = fileURLToPath(new URL('./expected/session-reading/failed-unread.expected.md', import.meta.url))
|
||||
let scaffold: WebScaffold
|
||||
let browser: Browser
|
||||
let first: Page
|
||||
let second: Page
|
||||
let sessionId: string
|
||||
let failedSessionId: string
|
||||
|
||||
beforeAll(async () => {
|
||||
scaffold = await launchWebScaffold({
|
||||
extraOverlayPath: fileURLToPath(new URL('./pin-browse-picker.overlay.yml', import.meta.url)),
|
||||
})
|
||||
const history = await readFile(SEED, 'utf8')
|
||||
sessionId = await seedSession(scaffold, history, 'session-reading-web')
|
||||
const failedHistory = `${history.trimEnd()}\n${JSON.stringify({ type: 'turn/start', data: { turn: 2 } })}\n${JSON.stringify({
|
||||
type: 'turn/end', data: { turn: 2, reason: { kind: 'error', error: { code: 'UNKNOWN', message: 'Request failed' } } },
|
||||
})}\n`
|
||||
failedSessionId = await seedSession(scaffold, failedHistory, 'session-reading-failed')
|
||||
browser = await chromium.launch()
|
||||
first = await newEnglishPage(browser)
|
||||
second = await newEnglishPage(browser)
|
||||
for (const [page, platform] of [[first, 'MacIntel'], [second, 'Win32']] as const) {
|
||||
await page.addInitScript((value) => { Object.defineProperty(navigator, 'platform', { value }) }, platform)
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
const group = page.getByText('Ungrouped', { exact: true }).locator('xpath=ancestor::*[@role="treeitem"][1]')
|
||||
await group.waitFor({ timeout: 30_000 })
|
||||
if (await group.getAttribute('aria-expanded') !== 'true') await group.click()
|
||||
await page.locator(`[data-row-key="session:${sessionId}"]`).waitFor({ timeout: 10_000 })
|
||||
}
|
||||
}, 120_000)
|
||||
|
||||
afterAll(async () => {
|
||||
await browser?.close()
|
||||
await scaffold?.close()
|
||||
})
|
||||
|
||||
async function mark(page: Page, name: 'Mark as read' | 'Mark as unread', id = sessionId): Promise<void> {
|
||||
await page.bringToFront()
|
||||
const row = page.locator(`[data-row-key="session:${id}"]`)
|
||||
await row.hover()
|
||||
await row.getByRole('button', { name: /^Session actions for / }).click()
|
||||
await page.getByRole('menuitem', { name, exact: true }).click()
|
||||
}
|
||||
|
||||
async function unread(page: Page): Promise<number> {
|
||||
return page.locator(`[data-row-key="session:${sessionId}"]`).getByText('Unread', { exact: true }).count()
|
||||
}
|
||||
|
||||
it('synchronizes manual marks, retains them across reload, and acknowledges only on a new view entry', async () => {
|
||||
onTestFailed(() => saveFailureShot(first, 'session-reading'))
|
||||
const left = watchConsole(first)
|
||||
const right = watchConsole(second)
|
||||
const row = first.locator(`[data-row-key="session:${sessionId}"]`)
|
||||
const title = row.locator(':scope > span').nth(1)
|
||||
const initialWeight = await title.evaluate(element => getComputedStyle(element).fontWeight)
|
||||
await mark(first, 'Mark as unread')
|
||||
await expect.poll(() => unread(first)).toBe(1)
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
expect(await row.locator('[data-state="done"]').count()).toBe(1)
|
||||
expect(await title.evaluate(element => getComputedStyle(element).fontWeight)).toBe(initialWeight)
|
||||
expect(await first.getByRole('alert').count()).toBe(0)
|
||||
|
||||
await row.hover()
|
||||
await row.getByRole('button', { name: /^Session actions for / }).click()
|
||||
expect(await first.getByRole('menuitem', { name: 'Mark as read', exact: true }).getAttribute('aria-keyshortcuts')).toBe('Shift+Meta+U')
|
||||
const menuSnapshot = await captureStableAria(first, '[role="menu"]', scaffold.workspaceCwd)
|
||||
const rowState = await row.locator('[data-state]').getAttribute('data-state')
|
||||
const titleWeight = await title.evaluate(element => getComputedStyle(element).fontWeight)
|
||||
await compareOrRefreshGolden(EXPECTED, `${menuSnapshot}\nRow state: ${rowState}\nTitle font weight: ${titleWeight}`, webSnapshotMode())
|
||||
await first.keyboard.press('Escape')
|
||||
|
||||
const warningStart = right.warnings.length
|
||||
await second.reload({ waitUntil: 'load' })
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
acknowledgeReloadConnectionLoss(right, warningStart)
|
||||
|
||||
await first.bringToFront()
|
||||
await row.click()
|
||||
await expect.poll(() => unread(first)).toBe(0)
|
||||
await expect.poll(() => unread(second)).toBe(0)
|
||||
await first.bringToFront()
|
||||
await first.keyboard.press('Meta+Shift+U')
|
||||
await expect.poll(() => unread(first)).toBe(1)
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
await first.keyboard.press('Meta+Shift+U')
|
||||
await expect.poll(() => unread(first)).toBe(0)
|
||||
await expect.poll(() => unread(second)).toBe(0)
|
||||
await second.bringToFront()
|
||||
await second.locator(`[data-row-key="session:${sessionId}"]`).click()
|
||||
await second.keyboard.press('Control+Shift+U')
|
||||
await expect.poll(() => unread(first)).toBe(1)
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
await second.keyboard.press('Control+Shift+U')
|
||||
await expect.poll(() => unread(first)).toBe(0)
|
||||
await expect.poll(() => unread(second)).toBe(0)
|
||||
expect(await first.getByRole('alert').count()).toBe(0)
|
||||
expect(await second.getByRole('alert').count()).toBe(0)
|
||||
await mark(first, 'Mark as unread')
|
||||
await expect.poll(() => unread(first)).toBe(1)
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
await mark(second, 'Mark as read')
|
||||
await expect.poll(() => unread(first)).toBe(0)
|
||||
await expect.poll(() => unread(second)).toBe(0)
|
||||
expect(left.pageErrors).toEqual([])
|
||||
expect(right.pageErrors).toEqual([])
|
||||
expect(left.warnings).toEqual([])
|
||||
expect(right.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it('shares a manual reminder on restored history without claiming its outcome', async () => {
|
||||
onTestFailed(() => saveFailureShot(first, 'session-reading-restored'))
|
||||
const row = (page: Page) => page.locator(`[data-row-key="session:${failedSessionId}"]`)
|
||||
const errors = (page: Page) => row(page).locator('[data-state="error"]').count()
|
||||
const done = (page: Page) => row(page).locator('[data-state="done"]').count()
|
||||
await first.bringToFront()
|
||||
await mark(first, 'Mark as unread', failedSessionId)
|
||||
await expect.poll(() => done(first)).toBe(1)
|
||||
await expect.poll(() => done(second)).toBe(1)
|
||||
expect(await errors(first)).toBe(0)
|
||||
expect(await row(first).getByText('Unread', { exact: true }).count()).toBe(1)
|
||||
await compareOrRefreshGolden(FAILED_EXPECTED, await captureStableAria(
|
||||
first, `[data-row-key="session:${failedSessionId}"]`, scaffold.workspaceCwd, { normalizeAge: true },
|
||||
), webSnapshotMode())
|
||||
const consoleState = watchConsole(second)
|
||||
const warningStart = consoleState.warnings.length
|
||||
await second.reload({ waitUntil: 'load' })
|
||||
await expect.poll(() => done(second)).toBe(1)
|
||||
acknowledgeReloadConnectionLoss(consoleState, warningStart)
|
||||
await mark(first, 'Mark as read', failedSessionId)
|
||||
await expect.poll(() => done(first)).toBe(0)
|
||||
await expect.poll(() => done(second)).toBe(0)
|
||||
await mark(first, 'Mark as unread', failedSessionId)
|
||||
await expect.poll(() => done(second)).toBe(1)
|
||||
expect(consoleState.pageErrors).toEqual([])
|
||||
expect(consoleState.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it('preserves manual unread on window focus and clears it after the main view leaves and returns', async () => {
|
||||
onTestFailed(() => saveFailureShot(first, 'session-reading-entry'))
|
||||
const row = first.locator(`[data-row-key="session:${sessionId}"]`)
|
||||
const content = (id: string) => first.locator(`[data-conversation-content][data-conversation-session="${id}"]`)
|
||||
await first.bringToFront()
|
||||
await row.click()
|
||||
await content(sessionId).waitFor()
|
||||
await mark(first, 'Mark as unread')
|
||||
await expect.poll(() => unread(first)).toBe(1)
|
||||
await expect.poll(() => unread(second)).toBe(1)
|
||||
|
||||
await second.bringToFront()
|
||||
await first.bringToFront()
|
||||
await expect.poll(() => first.evaluate(() => document.hasFocus())).toBe(true)
|
||||
await row.hover()
|
||||
await row.getByRole('button', { name: /^Session actions for / }).click()
|
||||
await first.getByRole('menuitem', { name: 'Mark as read', exact: true }).waitFor()
|
||||
expect(await unread(first)).toBe(1)
|
||||
expect(await unread(second)).toBe(1)
|
||||
await first.keyboard.press('Escape')
|
||||
|
||||
await first.locator(`[data-row-key="session:${failedSessionId}"]`).click()
|
||||
await content(failedSessionId).waitFor()
|
||||
expect(await unread(first)).toBe(1)
|
||||
await row.click()
|
||||
await expect.poll(() => unread(first)).toBe(0)
|
||||
await expect.poll(() => unread(second)).toBe(0)
|
||||
})
|
||||
@@ -136,7 +136,7 @@ describe('web e2e: sidebar subagent activity', () => {
|
||||
it('pins a running descendant on its visible idle owner row', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-sidebar-subagent-activity'))
|
||||
const sidebar = page.getByRole('tree', { name: 'Sessions' })
|
||||
const ownerRow = sidebar.getByRole('treeitem', { name: /1 subagent running Delegate a background job/ })
|
||||
const ownerRow = sidebar.getByRole('treeitem', { name: /1 subagent running.*Delegate a background job/ })
|
||||
await ownerRow.waitFor({ timeout: 10_000 })
|
||||
expect(parentHandle.agent.status).toBe('idle')
|
||||
await compareOrRefreshGolden(
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
## Menu
|
||||
|
||||
- menu "模型与推理等级":
|
||||
- menuitem "模型 DeepSeek-V4-Flash"
|
||||
- text: 启用智能体团队协作
|
||||
- button "关于智能体团队协作"
|
||||
- switch "启用智能体团队协作" [checked]
|
||||
- group "智能体团队协作":
|
||||
- text: 开启智能体团队协作
|
||||
- switch "开启智能体团队协作" [checked]
|
||||
- paragraph: 通过共享任务板协调多个智能体的分工与进度,复杂任务表现更佳,token 开销也相应更高。
|
||||
|
||||
## Confirmation
|
||||
|
||||
- dialog "确认停用智能体团队协作?":
|
||||
- heading "确认停用智能体团队协作?" [level=2]
|
||||
- dialog "确认关闭智能体团队协作?":
|
||||
- heading "确认关闭智能体团队协作?" [level=2]
|
||||
- button "关闭"
|
||||
- paragraph: 对话过程中停用智能体团队协作,将停止共享任务工具和团队协调指令。
|
||||
- paragraph: 停用后可能影响缓存复用、增加后续 token 用量与开销,并影响当前任务的协作效果。
|
||||
- paragraph: 对话过程中关闭智能体团队协作,将停止共享任务工具和团队协调指令。
|
||||
- paragraph: 关闭后可能影响缓存复用、增加后续 token 用量与开销,并影响当前任务的协作效果。
|
||||
- button "取消"
|
||||
- button "确认停用"
|
||||
- button "确认关闭"
|
||||
@@ -1 +1,12 @@
|
||||
- tooltip "Coordinate work and progress across agents with a shared task board for better results on complex tasks, with correspondingly higher token costs."
|
||||
## Root
|
||||
|
||||
- menu "Model and reasoning effort":
|
||||
- menuitem "Model DeepSeek-V4-Flash"
|
||||
- menuitem "Agent teamwork Off"
|
||||
|
||||
## Team settings
|
||||
|
||||
- group "Agent teamwork":
|
||||
- text: Enable agent teamwork
|
||||
- switch "Enable agent teamwork"
|
||||
- paragraph: Coordinate work and progress across agents with a shared task board for better results on complex tasks, with correspondingly higher token costs.
|
||||
@@ -32,6 +32,7 @@
|
||||
"tests/additional-locales.e2e.ts",
|
||||
"tests/rich-text-quotes.e2e.ts",
|
||||
"tests/hover-input.e2e.ts",
|
||||
"tests/session-reading.e2e.ts",
|
||||
"tests/collapse-timing.e2e.ts",
|
||||
"tests/notice-wake-tail.e2e.ts",
|
||||
"tests/fold-blank-matrix.e2e.ts",
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ When the gate goes red:
|
||||
2. **Condense** content that belongs here but can be shorter.
|
||||
3. **Raise** the ceiling only when the words need the space; justify the manifest diff in the PR. A too-low ceiling is a budget bug.
|
||||
|
||||
Ceilings are guardrails, not reduction targets. At or below target, retain at least 5% headroom; above target, freeze the ceiling until relocation or condensation brings the document under target. Lower a ceiling only when the document still has room. Targets: root `AGENTS.md` ≤ 2,080; `architecture.md` ≤ 2,400; subtree `AGENTS.md` ≤ 600, except `packages/AGENTS.md` ≤ 810 and this file ≤ 1,430; `packages/README.md` ≤ 994; plus `cordis-primer.md` 600, `testing.md` 1,300, `examples/AGENTS.md` 310. Review governs unbudgeted tiers.
|
||||
Ceilings are guardrails, not reduction targets. At or below target, retain at least 5% headroom; above target, freeze the ceiling until relocation or condensation brings the document under target. Lower a ceiling only when the document still has room. Targets: root `AGENTS.md` ≤ 2,080; `architecture.md` ≤ 2,400; subtree `AGENTS.md` ≤ 600, except `packages/AGENTS.md` ≤ 810 and this file ≤ 1,430; `packages/README.md` ≤ 1,100; plus `cordis-primer.md` 600, `testing.md` 1,300, `examples/AGENTS.md` 310. Review governs unbudgeted tiers.
|
||||
|
||||
## The slop checklist
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
en: 41d772192075e133
|
||||
zh: 5ef3da69b4de1d8a
|
||||
/capability-seams-and-core-services:
|
||||
en: 9f66fbb344cf1074
|
||||
zh: 7f985c73b1e6a34e
|
||||
en: 78778294644e7b42
|
||||
zh: 2985cca0ffc69256
|
||||
@@ -105,6 +105,8 @@ flowchart LR
|
||||
pkg_message_feedback["message-feedback"]
|
||||
pkg_experimental_api_speech_to_text["experimental-api-speech-to-text"]
|
||||
svc_speechController["ctx.speechController<br/>Experimental transcription Remote"]
|
||||
pkg_client_ui_session_status["client-ui-session-status"]
|
||||
svc_sessionStatus["ctx.sessionStatus<br/>Host Session reading records"]
|
||||
svc_sessionController["ctx.sessionController<br/>Host Session Remote controller"]
|
||||
svc_sessionFileReferences["ctx.sessionFileReferences<br/>Session-addressed file-reference Remote adapter"]
|
||||
svc_sessionSkillCatalog["ctx.sessionSkillCatalog<br/>Session-addressed skill Remote adapter"]
|
||||
@@ -346,6 +348,7 @@ flowchart LR
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_client_ui_session_status --> svc_sessionStatus
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
pkg_commands --> svc_commands
|
||||
pkg_compaction --> svc_compaction
|
||||
@@ -576,6 +579,7 @@ flowchart LR
|
||||
svc_sessionProjections --> pkg_tool_todo
|
||||
svc_sessionQuery --> pkg_session_reference
|
||||
svc_sessionQuery --> pkg_tool_session_query
|
||||
svc_sessionStatus --> pkg_client_ui_session_status
|
||||
svc_sessions --> pkg_agent
|
||||
svc_sessions --> pkg_agent_loop
|
||||
svc_sessions --> pkg_message_feedback
|
||||
@@ -684,6 +688,7 @@ flowchart LR
|
||||
| `ctx.toolResultPruner` | `core` | [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | - | [`compaction-basic`](../packages/compaction/compaction-basic) | - | Rewrites oversized current tool results through replayable single-node surface replacements before summary compaction. |
|
||||
| `ctx.sessions` | `core` | [`session`](../packages/core/session) | - | [`agent-loop`](../packages/core/agent-loop), [`agent`](../packages/core/agent), [`session-persistence`](../packages/session/session-persistence), [`session-query`](../packages/session-query/session-query), [`session-query-sqlite`](../packages/session-query/session-query-sqlite), [`subagent`](../packages/subagent/subagent), [`message-feedback`](../packages/feedback/message-feedback) | - | Owns append-only Session instances and emits the durable session event feed. |
|
||||
| `ctx.speechController` | `core` | [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | - | - | - | Validates bounded browser audio before provider dispatch. |
|
||||
| `ctx.sessionStatus` | `core` | [`client-ui-session-status`](../packages/client/ui-session-status) | - | [`client-ui-session-status`](../packages/client/ui-session-status) | - | Stores owner reading acknowledgements and manual unread marks outside Session history; its Client half follows committed changes over Remote, acknowledges loaded completions, and serves the Session status table. |
|
||||
| `ctx.sessionController` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | Owns Session commands, cold reads, durable-event following, live control state, model catalogs, workspace opening, and Agent activation policy. |
|
||||
| `ctx.sessionFileReferences` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | Delegates file-reference discovery through the Session Controller's established Agent lookup policy. |
|
||||
| `ctx.sessionSkillCatalog` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | Lists the Session composition's user-invocable skills without activating a cold Agent. |
|
||||
|
||||
@@ -107,6 +107,8 @@ flowchart LR
|
||||
pkg_message_feedback["message-feedback"]
|
||||
pkg_experimental_api_speech_to_text["experimental-api-speech-to-text"]
|
||||
svc_speechController["ctx.speechController<br/>Experimental transcription Remote"]
|
||||
pkg_client_ui_session_status["client-ui-session-status"]
|
||||
svc_sessionStatus["ctx.sessionStatus<br/>Host Session reading records"]
|
||||
svc_sessionController["ctx.sessionController<br/>Host Session Remote controller"]
|
||||
svc_sessionFileReferences["ctx.sessionFileReferences<br/>Session-addressed file-reference Remote adapter"]
|
||||
svc_sessionSkillCatalog["ctx.sessionSkillCatalog<br/>Session-addressed skill Remote adapter"]
|
||||
@@ -348,6 +350,7 @@ flowchart LR
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_client_ui_session_status --> svc_sessionStatus
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
pkg_commands --> svc_commands
|
||||
pkg_compaction --> svc_compaction
|
||||
@@ -578,6 +581,7 @@ flowchart LR
|
||||
svc_sessionProjections --> pkg_tool_todo
|
||||
svc_sessionQuery --> pkg_session_reference
|
||||
svc_sessionQuery --> pkg_tool_session_query
|
||||
svc_sessionStatus --> pkg_client_ui_session_status
|
||||
svc_sessions --> pkg_agent
|
||||
svc_sessions --> pkg_agent_loop
|
||||
svc_sessions --> pkg_message_feedback
|
||||
@@ -686,6 +690,7 @@ flowchart LR
|
||||
| `ctx.toolResultPruner` | `core` | [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | - | [`compaction-basic`](../packages/compaction/compaction-basic) | - | 在摘要压缩前,通过可回放的单节点表层替换来改写过大的当前工具结果。 |
|
||||
| `ctx.sessions` | `core` | [`session`](../packages/core/session) | - | [`agent-loop`](../packages/core/agent-loop), [`agent`](../packages/core/agent), [`session-persistence`](../packages/session/session-persistence), [`session-query`](../packages/session-query/session-query), [`session-query-sqlite`](../packages/session-query/session-query-sqlite), [`subagent`](../packages/subagent/subagent), [`message-feedback`](../packages/feedback/message-feedback) | - | 拥有仅追加的 Session 实例,并发出持久的会话事件流。 |
|
||||
| `ctx.speechController` | `core` | [`experimental-api-speech-to-text`](../packages/experimental/api-speech-to-text) | - | - | - | 在 Provider 调用前校验受限的浏览器音频。 |
|
||||
| `ctx.sessionStatus` | `core` | [`client-ui-session-status`](../packages/client/ui-session-status) | - | [`client-ui-session-status`](../packages/client/ui-session-status) | - | 在会话历史之外保存使用者的阅读确认和手动未读标记;其前端部分通过 Remote 订阅已保存的更新、确认已加载的完成内容,并提供会话状态表。 |
|
||||
| `ctx.sessionController` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | 负责 Session 命令、冷读取、持久事件跟随、实时控制状态、模型目录、workspace 打开与 Agent 激活策略。 |
|
||||
| `ctx.sessionFileReferences` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | 通过 Session Controller 的既有 Agent lookup 策略委托文件引用发现。 |
|
||||
| `ctx.sessionSkillCatalog` | `core` | [`api-session-controller`](../packages/api/session-controller) | - | - | - | 在不激活冷 Agent 的前提下列出 Session 组合中允许用户调用的 skill。 |
|
||||
|
||||
@@ -1068,7 +1068,7 @@ export type Config = BrowserMcpConfig
|
||||
|
||||
- `inject`: `browserUse` · `agents` · `tools` · `systemPrompt`
|
||||
- `refs`: `ModelConfig` (`@browserbasehq/stagehand`)
|
||||
- `source`: [`packages/experimental/browser-use-stagehand-native/src/index.ts:29`](../packages/experimental/browser-use-stagehand-native/src/index.ts)
|
||||
- `source`: [`packages/experimental/browser-use-stagehand-native/src/index.ts:32`](../packages/experimental/browser-use-stagehand-native/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Profile-owned browser connection and independent Stagehand model credentials. */
|
||||
@@ -1471,7 +1471,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-experimental-subagent-oar`
|
||||
|
||||
- `inject`: `subagents`
|
||||
- `source`: [`packages/experimental/subagent-oar/src/index.ts:25`](../packages/experimental/subagent-oar/src/index.ts)
|
||||
- `source`: [`packages/experimental/subagent-oar/src/index.ts:27`](../packages/experimental/subagent-oar/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Native runtime selection and deployment settings for one provider instance. */
|
||||
@@ -1559,7 +1559,7 @@ export type PaidTranslationProvider = 'deepseek-account' | 'deepseek-official'
|
||||
|
||||
- `inject`: `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `sessionProjections`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/experimental/worktree/src/index.ts:36`](../packages/experimental/worktree/src/index.ts)
|
||||
- `source`: [`packages/experimental/worktree/src/index.ts:39`](../packages/experimental/worktree/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Worktree location, generated names, executables, subprocess resource limits, and the archive cleanup switch. */
|
||||
@@ -1722,7 +1722,7 @@ export interface HmrConfig extends ChokidarOptions {
|
||||
## `@deepseek-ai/dsh-hooks-claude-code`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:50`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:53`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the CC hook config lives + substitution roots. */
|
||||
@@ -1761,7 +1761,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-hooks-codex`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:49`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:52`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the Codex hooks.json lives + the model name for payloads. */
|
||||
@@ -4458,7 +4458,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-tool-ralph`
|
||||
|
||||
- `inject`: `tools` · `workflowEngine` · `subagents` · `systemPrompt`
|
||||
- `source`: [`packages/experimental/tool-ralph/src/index.ts:21`](../packages/experimental/tool-ralph/src/index.ts)
|
||||
- `source`: [`packages/experimental/tool-ralph/src/index.ts:24`](../packages/experimental/tool-ralph/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment policy for the fixed Ralph workflow. */
|
||||
@@ -5089,7 +5089,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | — | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-general` | — | [`packages/client/ui-settings-general/src/index.ts`](../packages/client/ui-settings-general/src/index.ts) |
|
||||
|
||||
@@ -1070,7 +1070,7 @@ export type Config = BrowserMcpConfig
|
||||
|
||||
- `inject`: `browserUse` · `agents` · `tools` · `systemPrompt`
|
||||
- `refs`: `ModelConfig` (`@browserbasehq/stagehand`)
|
||||
- `source`: [`packages/experimental/browser-use-stagehand-native/src/index.ts:29`](../packages/experimental/browser-use-stagehand-native/src/index.ts)
|
||||
- `source`: [`packages/experimental/browser-use-stagehand-native/src/index.ts:32`](../packages/experimental/browser-use-stagehand-native/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Profile-owned browser connection and independent Stagehand model credentials. */
|
||||
@@ -1473,7 +1473,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-experimental-subagent-oar`
|
||||
|
||||
- `inject`: `subagents`
|
||||
- `source`: [`packages/experimental/subagent-oar/src/index.ts:25`](../packages/experimental/subagent-oar/src/index.ts)
|
||||
- `source`: [`packages/experimental/subagent-oar/src/index.ts:27`](../packages/experimental/subagent-oar/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Native runtime selection and deployment settings for one provider instance. */
|
||||
@@ -1561,7 +1561,7 @@ export type PaidTranslationProvider = 'deepseek-account' | 'deepseek-official'
|
||||
|
||||
- `inject`: `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `sessionProjections`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/experimental/worktree/src/index.ts:36`](../packages/experimental/worktree/src/index.ts)
|
||||
- `source`: [`packages/experimental/worktree/src/index.ts:39`](../packages/experimental/worktree/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Worktree location, generated names, executables, subprocess resource limits, and the archive cleanup switch. */
|
||||
@@ -1724,7 +1724,7 @@ export interface HmrConfig extends ChokidarOptions {
|
||||
## `@deepseek-ai/dsh-hooks-claude-code`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:50`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:53`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the CC hook config lives + substitution roots. */
|
||||
@@ -1763,7 +1763,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-hooks-codex`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:49`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:52`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the Codex hooks.json lives + the model name for payloads. */
|
||||
@@ -4460,7 +4460,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-tool-ralph`
|
||||
|
||||
- `inject`: `tools` · `workflowEngine` · `subagents` · `systemPrompt`
|
||||
- `source`: [`packages/experimental/tool-ralph/src/index.ts:21`](../packages/experimental/tool-ralph/src/index.ts)
|
||||
- `source`: [`packages/experimental/tool-ralph/src/index.ts:24`](../packages/experimental/tool-ralph/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment policy for the fixed Ralph workflow. */
|
||||
@@ -5091,7 +5091,7 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | — | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-general` | — | [`packages/client/ui-settings-general/src/index.ts`](../packages/client/ui-settings-general/src/index.ts) |
|
||||
|
||||
@@ -74,7 +74,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
|
||||
| `session-telemetry/record` | `waterfall` | [`packages/session/session-telemetry/src/index.ts:44`](../packages/session/session-telemetry/src/index.ts) | [`session-telemetry`](../packages/session/session-telemetry) (`waterfall`) | - |
|
||||
| `session/created` | `emit` | [`packages/core/session/src/index.ts:56`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | `server`, `session-controller`, [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry) |
|
||||
| `session/disposed` | `emit` | [`packages/core/session/src/index.ts:65`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`agent-loop`](../packages/core/agent-loop), `file-upload`, `forge-session`, [`office-kit`](../packages/document/office-kit), `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-title`](../packages/session/session-title), `ui-trajectory`, [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/event` | `emit` | [`packages/core/session/src/index.ts:79`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`acp`](../packages/acp/acp), [`agent-instructions`](../packages/context/agent-instructions), [`agent-loop`](../packages/core/agent-loop), [`agent-preset-registry`](../packages/preset/agent-preset-registry), `claude-code-mods`, `client-ui-forge`, [`compaction-basic`](../packages/compaction/compaction-basic), [`file-reference-local`](../packages/context/file-reference-local), `file-upload`, `forge-session`, [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`headless`](../packages/bundle/headless), [`loader-smoke`](../packages/test-support/loader-smoke), `product-analytics`, [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), `server`, `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-telemetry-otel`](../packages/session/session-telemetry-otel), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`token-meter`](../packages/llm/token-meter), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tool-jobs`](../packages/jobs/tool-jobs), [`tool-office`](../packages/document/tool-office), `ui-trajectory`, [`user-questions`](../packages/interaction/user-questions), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/event` | `emit` | [`packages/core/session/src/index.ts:79`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`acp`](../packages/acp/acp), [`agent-instructions`](../packages/context/agent-instructions), [`agent-loop`](../packages/core/agent-loop), [`agent-preset-registry`](../packages/preset/agent-preset-registry), `claude-code-mods`, `client-ui-forge`, [`compaction-basic`](../packages/compaction/compaction-basic), [`file-reference-local`](../packages/context/file-reference-local), `file-upload`, `forge-session`, [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`headless`](../packages/bundle/headless), [`loader-smoke`](../packages/test-support/loader-smoke), `product-analytics`, [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), `server`, `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-telemetry-otel`](../packages/session/session-telemetry-otel), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`token-meter`](../packages/llm/token-meter), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tool-jobs`](../packages/jobs/tool-jobs), [`tool-office`](../packages/document/tool-office), `ui-session-status`, `ui-trajectory`, [`user-questions`](../packages/interaction/user-questions), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/flush` | `parallel` | [`packages/core/session/src/index.ts:87`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-telemetry`](../packages/session/session-telemetry) |
|
||||
| `settings/document-updated` | `emit` | [`packages/settings/settings/src/types.ts:75`](../packages/settings/settings/src/types.ts) | [`settings`](../packages/settings/settings) (`emit`) | `remotes` |
|
||||
| `skills/change` | `emit` | [`packages/skill/skill/src/index.ts:299`](../packages/skill/skill/src/index.ts) | [`skill`](../packages/skill/skill) (`events.dispatch`) | - |
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
| `session-telemetry/record` | `waterfall` | [`packages/session/session-telemetry/src/index.ts:44`](../packages/session/session-telemetry/src/index.ts) | [`session-telemetry`](../packages/session/session-telemetry) (`waterfall`) | - |
|
||||
| `session/created` | `emit` | [`packages/core/session/src/index.ts:56`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | `server`, `session-controller`, [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry) |
|
||||
| `session/disposed` | `emit` | [`packages/core/session/src/index.ts:65`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`agent-loop`](../packages/core/agent-loop), `file-upload`, `forge-session`, [`office-kit`](../packages/document/office-kit), `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-title`](../packages/session/session-title), `ui-trajectory`, [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/event` | `emit` | [`packages/core/session/src/index.ts:79`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`acp`](../packages/acp/acp), [`agent-instructions`](../packages/context/agent-instructions), [`agent-loop`](../packages/core/agent-loop), [`agent-preset-registry`](../packages/preset/agent-preset-registry), `claude-code-mods`, `client-ui-forge`, [`compaction-basic`](../packages/compaction/compaction-basic), [`file-reference-local`](../packages/context/file-reference-local), `file-upload`, `forge-session`, [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`headless`](../packages/bundle/headless), [`loader-smoke`](../packages/test-support/loader-smoke), `product-analytics`, [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), `server`, `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-telemetry-otel`](../packages/session/session-telemetry-otel), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`token-meter`](../packages/llm/token-meter), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tool-jobs`](../packages/jobs/tool-jobs), [`tool-office`](../packages/document/tool-office), `ui-trajectory`, [`user-questions`](../packages/interaction/user-questions), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/event` | `emit` | [`packages/core/session/src/index.ts:79`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`acp`](../packages/acp/acp), [`agent-instructions`](../packages/context/agent-instructions), [`agent-loop`](../packages/core/agent-loop), [`agent-preset-registry`](../packages/preset/agent-preset-registry), `claude-code-mods`, `client-ui-forge`, [`compaction-basic`](../packages/compaction/compaction-basic), [`file-reference-local`](../packages/context/file-reference-local), `file-upload`, `forge-session`, [`goal`](../packages/goal/goal), [`goal-round-driver`](../packages/goal/goal-round-driver), [`headless`](../packages/bundle/headless), [`loader-smoke`](../packages/test-support/loader-smoke), `product-analytics`, [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), `server`, `session-controller`, [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-telemetry`](../packages/session/session-telemetry), [`session-telemetry-otel`](../packages/session/session-telemetry-otel), [`session-title`](../packages/session/session-title), [`subagent`](../packages/subagent/subagent), [`token-meter`](../packages/llm/token-meter), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tool-jobs`](../packages/jobs/tool-jobs), [`tool-office`](../packages/document/tool-office), `ui-session-status`, `ui-trajectory`, [`user-questions`](../packages/interaction/user-questions), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `session/flush` | `parallel` | [`packages/core/session/src/index.ts:87`](../packages/core/session/src/index.ts) | [`session`](../packages/core/session) (`events.dispatch`) | [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl), [`session-telemetry`](../packages/session/session-telemetry) |
|
||||
| `settings/document-updated` | `emit` | [`packages/settings/settings/src/types.ts:75`](../packages/settings/settings/src/types.ts) | [`settings`](../packages/settings/settings) (`emit`) | `remotes` |
|
||||
| `skills/change` | `emit` | [`packages/skill/skill/src/index.ts:299`](../packages/skill/skill/src/index.ts) | [`skill`](../packages/skill/skill) (`events.dispatch`) | - |
|
||||
|
||||
+21
-10
@@ -497,7 +497,6 @@ flowchart TD
|
||||
pkg_app_boot --> pkg_launch_environment
|
||||
pkg_client_connection --> pkg_scope
|
||||
pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use
|
||||
pkg_experimental_liveshare --> pkg_scope
|
||||
pkg_anonymous_user_id --> pkg_brand
|
||||
pkg_anonymous_user_id --> pkg_home_paths
|
||||
pkg_storage_domain --> pkg_storage
|
||||
@@ -971,11 +970,17 @@ flowchart TD
|
||||
pkg_experimental_browser_use_playwright_mcp --> pkg_working_directory
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_agent
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_browser_use
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_error
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_system_prompt
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_tools
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_computer_use
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_error
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_system_prompt
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_tools
|
||||
pkg_experimental_liveshare --> pkg_error
|
||||
pkg_experimental_liveshare --> pkg_fs
|
||||
pkg_experimental_liveshare --> pkg_scope
|
||||
pkg_experimental_liveshare --> pkg_tools
|
||||
pkg_hooks_codex --> pkg_agent
|
||||
pkg_hooks_codex --> pkg_hook_protocol
|
||||
pkg_hooks_codex --> pkg_llm
|
||||
@@ -1123,6 +1128,7 @@ flowchart TD
|
||||
pkg_cua --> pkg_ptc_runtime_node
|
||||
pkg_cua --> pkg_scope
|
||||
pkg_cua --> pkg_tool_executor_ptc
|
||||
pkg_cua --> pkg_tools
|
||||
pkg_cua --> pkg_user_questions
|
||||
pkg_experimental_auto_review --> pkg_agent
|
||||
pkg_experimental_auto_review --> pkg_agent_instructions
|
||||
@@ -1267,6 +1273,7 @@ flowchart TD
|
||||
pkg_compaction_tool_result_pruner --> pkg_token_meter
|
||||
pkg_experimental_browser_use_runtime --> pkg_agent
|
||||
pkg_experimental_browser_use_runtime --> pkg_browser_use
|
||||
pkg_experimental_browser_use_runtime --> pkg_error
|
||||
pkg_experimental_browser_use_runtime --> pkg_mcp_client
|
||||
pkg_experimental_browser_use_runtime --> pkg_scope
|
||||
pkg_experimental_browser_use_runtime --> pkg_system_prompt
|
||||
@@ -1274,6 +1281,7 @@ flowchart TD
|
||||
pkg_experimental_browser_use_runtime --> pkg_working_directory
|
||||
pkg_experimental_claude_code_mods --> pkg_agent
|
||||
pkg_experimental_claude_code_mods --> pkg_commands
|
||||
pkg_experimental_claude_code_mods --> pkg_error
|
||||
pkg_experimental_claude_code_mods --> pkg_fs
|
||||
pkg_experimental_claude_code_mods --> pkg_llm
|
||||
pkg_experimental_claude_code_mods --> pkg_scope
|
||||
@@ -1286,6 +1294,7 @@ flowchart TD
|
||||
pkg_experimental_claude_code_mods --> pkg_user_questions
|
||||
pkg_experimental_claude_code_mods --> pkg_working_directory
|
||||
pkg_experimental_worktree --> pkg_agent
|
||||
pkg_experimental_worktree --> pkg_error
|
||||
pkg_experimental_worktree --> pkg_fs
|
||||
pkg_experimental_worktree --> pkg_sandbox
|
||||
pkg_experimental_worktree --> pkg_sandbox_policy
|
||||
@@ -1431,6 +1440,7 @@ flowchart TD
|
||||
pkg_experimental_client_ui_forge --> pkg_fs
|
||||
pkg_experimental_client_ui_forge --> pkg_session
|
||||
pkg_experimental_client_ui_forge --> pkg_timeout
|
||||
pkg_experimental_subagent_oar --> pkg_error
|
||||
pkg_experimental_subagent_oar --> pkg_llm
|
||||
pkg_experimental_subagent_oar --> pkg_session
|
||||
pkg_experimental_subagent_oar --> pkg_subagent
|
||||
@@ -1447,6 +1457,7 @@ flowchart TD
|
||||
pkg_hooks_claude_code --> pkg_tools
|
||||
pkg_hooks_claude_code --> pkg_working_directory
|
||||
pkg_tool_ralph --> pkg_agent
|
||||
pkg_tool_ralph --> pkg_error
|
||||
pkg_tool_ralph --> pkg_llm
|
||||
pkg_tool_ralph --> pkg_subagent
|
||||
pkg_tool_ralph --> pkg_system_prompt
|
||||
@@ -1703,7 +1714,6 @@ flowchart TD
|
||||
| [`app-boot`](../packages/boot/app-boot) | `boot` | [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
|
||||
| [`client-connection`](../packages/client/connection) | `client` | [`scope`](../packages/core/scope) |
|
||||
| [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) |
|
||||
| [`experimental-liveshare`](../packages/experimental/liveshare) | `experimental` | [`scope`](../packages/core/scope) |
|
||||
| [`anonymous-user-id`](../packages/identity/anonymous-user-id) | `identity` | [`brand`](../packages/util/brand), [`home-paths`](../packages/util/home-paths) |
|
||||
| [`storage-domain`](../packages/storage/storage-domain) | `storage` | [`storage`](../packages/storage/storage) |
|
||||
| [`storage-json`](../packages/storage/storage-json) | `storage` | [`storage`](../packages/storage/storage) |
|
||||
@@ -1834,8 +1844,9 @@ flowchart TD
|
||||
| [`cua-windows`](../packages/experimental/cua-windows) | `experimental` | [`agent`](../packages/core/agent), [`computer-use`](../packages/computer-use/computer-use), [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | `experimental` | [`computer-use`](../packages/computer-use/computer-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | `experimental` | [`computer-use`](../packages/computer-use/computer-use), [`error`](../packages/util/error), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-liveshare`](../packages/experimental/liveshare) | `experimental` | [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`scope`](../packages/core/scope), [`tools`](../packages/core/tools) |
|
||||
| [`hooks-codex`](../packages/experimental/hooks-codex) | `experimental` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/experimental/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`session-title-all-prompts-llm`](../packages/experimental/session-title-all-prompts-llm) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`session-title-llm`](../packages/session/session-title-llm) |
|
||||
| [`terminal-panel`](../packages/experimental/terminal-panel) | `experimental` | [`api-terminal-controller`](../packages/api/terminal-controller), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`tools`](../packages/core/tools) |
|
||||
@@ -1864,7 +1875,7 @@ flowchart TD
|
||||
| [`session-query`](../packages/session-query/session-query) | `session-query` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-title`](../packages/session/session-title), [`tool-todo`](../packages/todo/tool-todo) |
|
||||
| [`api-settings-controller`](../packages/api/settings-controller) | `api` | [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`credentials`](../packages/credentials/credentials), [`native-command`](../packages/util/native-command), [`session`](../packages/core/session), [`settings`](../packages/settings/settings), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`web-app`](../packages/bundle/web-app) | `bundle` | [`shell-env`](../packages/shell/shell-env) |
|
||||
| [`cua`](../packages/experimental/cua) | `experimental` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), [`scope`](../packages/core/scope), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`cua`](../packages/experimental/cua) | `experimental` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), [`scope`](../packages/core/scope), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tools`](../packages/core/tools), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`experimental-auto-review`](../packages/experimental/auto-review) | `experimental` | [`agent`](../packages/core/agent), [`agent-instructions`](../packages/context/agent-instructions), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-forge-session`](../packages/experimental/forge-session) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`llm`](../packages/llm/llm), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell), [`shell-env`](../packages/shell/shell-env), [`tools`](../packages/core/tools) |
|
||||
| [`webhook`](../packages/experimental/webhook) | `experimental` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`workspace`](../packages/workspace/workspace) |
|
||||
@@ -1885,9 +1896,9 @@ flowchart TD
|
||||
| [`acp`](../packages/acp/acp) | `acp` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`mcp-client`](../packages/mcp/mcp-client), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`token-meter`](../packages/llm/token-meter), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`plugin-manager`](../packages/boot/plugin-manager) | `boot` | [`error`](../packages/util/error), [`hmr`](../packages/boot/hmr), [`host-plugin-inventory`](../packages/host/plugin-inventory), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) |
|
||||
| [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`tool-session-query`](../packages/experimental/tool-session-query) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools) |
|
||||
| [`webhook-github`](../packages/experimental/webhook-github) | `experimental` | [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`session`](../packages/core/session), [`webhook`](../packages/experimental/webhook) |
|
||||
| [`mcp-manager`](../packages/mcp/mcp-manager) | `mcp` | [`mcp-client`](../packages/mcp/mcp-client), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
|
||||
@@ -1906,11 +1917,11 @@ flowchart TD
|
||||
| [`session-reference`](../packages/context/session-reference) | `context` | [`agent`](../packages/core/agent), [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`output-retention`](../packages/util/output-retention), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`spill`](../packages/spill/spill), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`tool-office`](../packages/document/tool-office) | `document` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`office-kit`](../packages/document/office-kit), [`skill`](../packages/skill/skill), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-worktree`](../packages/experimental/worktree), [`fs`](../packages/fs/fs), [`session`](../packages/core/session), [`timeout`](../packages/util/timeout) |
|
||||
| [`experimental-subagent-oar`](../packages/experimental/subagent-oar) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
|
||||
| [`experimental-subagent-oar`](../packages/experimental/subagent-oar) | `experimental` | [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
|
||||
| [`experimental-tool-subagent-oar`](../packages/experimental/tool-subagent-oar) | `experimental` | [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-tool-worktree`](../packages/experimental/tool-worktree) | `experimental` | [`experimental-worktree`](../packages/experimental/worktree), [`tools`](../packages/core/tools) |
|
||||
| [`hooks-claude-code`](../packages/experimental/hooks-claude-code) | `experimental` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/experimental/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`tool-ralph`](../packages/experimental/tool-ralph) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow) |
|
||||
| [`tool-ralph`](../packages/experimental/tool-ralph) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow) |
|
||||
| [`sdk-protocol`](../packages/sdk/protocol) | `sdk` | [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`agent-team`](../packages/team/agent-team) | `team` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`workflow-ptc`](../packages/workflow/workflow-ptc) | `workflow` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow), [`working-directory`](../packages/session/working-directory) |
|
||||
|
||||
+21
-10
@@ -499,7 +499,6 @@ flowchart TD
|
||||
pkg_app_boot --> pkg_launch_environment
|
||||
pkg_client_connection --> pkg_scope
|
||||
pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use
|
||||
pkg_experimental_liveshare --> pkg_scope
|
||||
pkg_anonymous_user_id --> pkg_brand
|
||||
pkg_anonymous_user_id --> pkg_home_paths
|
||||
pkg_storage_domain --> pkg_storage
|
||||
@@ -973,11 +972,17 @@ flowchart TD
|
||||
pkg_experimental_browser_use_playwright_mcp --> pkg_working_directory
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_agent
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_browser_use
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_error
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_system_prompt
|
||||
pkg_experimental_browser_use_stagehand_native --> pkg_tools
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_computer_use
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_error
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_system_prompt
|
||||
pkg_experimental_computer_use_cua_driver_native --> pkg_tools
|
||||
pkg_experimental_liveshare --> pkg_error
|
||||
pkg_experimental_liveshare --> pkg_fs
|
||||
pkg_experimental_liveshare --> pkg_scope
|
||||
pkg_experimental_liveshare --> pkg_tools
|
||||
pkg_hooks_codex --> pkg_agent
|
||||
pkg_hooks_codex --> pkg_hook_protocol
|
||||
pkg_hooks_codex --> pkg_llm
|
||||
@@ -1125,6 +1130,7 @@ flowchart TD
|
||||
pkg_cua --> pkg_ptc_runtime_node
|
||||
pkg_cua --> pkg_scope
|
||||
pkg_cua --> pkg_tool_executor_ptc
|
||||
pkg_cua --> pkg_tools
|
||||
pkg_cua --> pkg_user_questions
|
||||
pkg_experimental_auto_review --> pkg_agent
|
||||
pkg_experimental_auto_review --> pkg_agent_instructions
|
||||
@@ -1269,6 +1275,7 @@ flowchart TD
|
||||
pkg_compaction_tool_result_pruner --> pkg_token_meter
|
||||
pkg_experimental_browser_use_runtime --> pkg_agent
|
||||
pkg_experimental_browser_use_runtime --> pkg_browser_use
|
||||
pkg_experimental_browser_use_runtime --> pkg_error
|
||||
pkg_experimental_browser_use_runtime --> pkg_mcp_client
|
||||
pkg_experimental_browser_use_runtime --> pkg_scope
|
||||
pkg_experimental_browser_use_runtime --> pkg_system_prompt
|
||||
@@ -1276,6 +1283,7 @@ flowchart TD
|
||||
pkg_experimental_browser_use_runtime --> pkg_working_directory
|
||||
pkg_experimental_claude_code_mods --> pkg_agent
|
||||
pkg_experimental_claude_code_mods --> pkg_commands
|
||||
pkg_experimental_claude_code_mods --> pkg_error
|
||||
pkg_experimental_claude_code_mods --> pkg_fs
|
||||
pkg_experimental_claude_code_mods --> pkg_llm
|
||||
pkg_experimental_claude_code_mods --> pkg_scope
|
||||
@@ -1288,6 +1296,7 @@ flowchart TD
|
||||
pkg_experimental_claude_code_mods --> pkg_user_questions
|
||||
pkg_experimental_claude_code_mods --> pkg_working_directory
|
||||
pkg_experimental_worktree --> pkg_agent
|
||||
pkg_experimental_worktree --> pkg_error
|
||||
pkg_experimental_worktree --> pkg_fs
|
||||
pkg_experimental_worktree --> pkg_sandbox
|
||||
pkg_experimental_worktree --> pkg_sandbox_policy
|
||||
@@ -1433,6 +1442,7 @@ flowchart TD
|
||||
pkg_experimental_client_ui_forge --> pkg_fs
|
||||
pkg_experimental_client_ui_forge --> pkg_session
|
||||
pkg_experimental_client_ui_forge --> pkg_timeout
|
||||
pkg_experimental_subagent_oar --> pkg_error
|
||||
pkg_experimental_subagent_oar --> pkg_llm
|
||||
pkg_experimental_subagent_oar --> pkg_session
|
||||
pkg_experimental_subagent_oar --> pkg_subagent
|
||||
@@ -1449,6 +1459,7 @@ flowchart TD
|
||||
pkg_hooks_claude_code --> pkg_tools
|
||||
pkg_hooks_claude_code --> pkg_working_directory
|
||||
pkg_tool_ralph --> pkg_agent
|
||||
pkg_tool_ralph --> pkg_error
|
||||
pkg_tool_ralph --> pkg_llm
|
||||
pkg_tool_ralph --> pkg_subagent
|
||||
pkg_tool_ralph --> pkg_system_prompt
|
||||
@@ -1705,7 +1716,6 @@ flowchart TD
|
||||
| [`app-boot`](../packages/boot/app-boot) | `boot` | [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
|
||||
| [`client-connection`](../packages/client/connection) | `client` | [`scope`](../packages/core/scope) |
|
||||
| [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) |
|
||||
| [`experimental-liveshare`](../packages/experimental/liveshare) | `experimental` | [`scope`](../packages/core/scope) |
|
||||
| [`anonymous-user-id`](../packages/identity/anonymous-user-id) | `identity` | [`brand`](../packages/util/brand), [`home-paths`](../packages/util/home-paths) |
|
||||
| [`storage-domain`](../packages/storage/storage-domain) | `storage` | [`storage`](../packages/storage/storage) |
|
||||
| [`storage-json`](../packages/storage/storage-json) | `storage` | [`storage`](../packages/storage/storage) |
|
||||
@@ -1836,8 +1846,9 @@ flowchart TD
|
||||
| [`cua-windows`](../packages/experimental/cua-windows) | `experimental` | [`agent`](../packages/core/agent), [`computer-use`](../packages/computer-use/computer-use), [`subprocess`](../packages/subprocess/subprocess), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | `experimental` | [`computer-use`](../packages/computer-use/computer-use), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | `experimental` | [`computer-use`](../packages/computer-use/computer-use), [`error`](../packages/util/error), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-liveshare`](../packages/experimental/liveshare) | `experimental` | [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`scope`](../packages/core/scope), [`tools`](../packages/core/tools) |
|
||||
| [`hooks-codex`](../packages/experimental/hooks-codex) | `experimental` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/experimental/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`session-title-all-prompts-llm`](../packages/experimental/session-title-all-prompts-llm) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`session-title-llm`](../packages/session/session-title-llm) |
|
||||
| [`terminal-panel`](../packages/experimental/terminal-panel) | `experimental` | [`api-terminal-controller`](../packages/api/terminal-controller), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`tools`](../packages/core/tools) |
|
||||
@@ -1866,7 +1877,7 @@ flowchart TD
|
||||
| [`session-query`](../packages/session-query/session-query) | `session-query` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-title`](../packages/session/session-title), [`tool-todo`](../packages/todo/tool-todo) |
|
||||
| [`api-settings-controller`](../packages/api/settings-controller) | `api` | [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`credentials`](../packages/credentials/credentials), [`native-command`](../packages/util/native-command), [`session`](../packages/core/session), [`settings`](../packages/settings/settings), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`web-app`](../packages/bundle/web-app) | `bundle` | [`shell-env`](../packages/shell/shell-env) |
|
||||
| [`cua`](../packages/experimental/cua) | `experimental` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), [`scope`](../packages/core/scope), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`cua`](../packages/experimental/cua) | `experimental` | [`attachment`](../packages/attachment/attachment), [`error`](../packages/util/error), [`ptc-runtime-node`](../packages/ptc-runtime/ptc-runtime-node), [`scope`](../packages/core/scope), [`tool-executor-ptc`](../packages/core/tool-executor-ptc), [`tools`](../packages/core/tools), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`experimental-auto-review`](../packages/experimental/auto-review) | `experimental` | [`agent`](../packages/core/agent), [`agent-instructions`](../packages/context/agent-instructions), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`session`](../packages/core/session), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-forge-session`](../packages/experimental/forge-session) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`llm`](../packages/llm/llm), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell), [`shell-env`](../packages/shell/shell-env), [`tools`](../packages/core/tools) |
|
||||
| [`webhook`](../packages/experimental/webhook) | `experimental` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`workspace`](../packages/workspace/workspace) |
|
||||
@@ -1887,9 +1898,9 @@ flowchart TD
|
||||
| [`acp`](../packages/acp/acp) | `acp` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`mcp-client`](../packages/mcp/mcp-client), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`token-meter`](../packages/llm/token-meter), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`plugin-manager`](../packages/boot/plugin-manager) | `boot` | [`error`](../packages/util/error), [`hmr`](../packages/boot/hmr), [`host-plugin-inventory`](../packages/host/plugin-inventory), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) |
|
||||
| [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`tool-session-query`](../packages/experimental/tool-session-query) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools) |
|
||||
| [`webhook-github`](../packages/experimental/webhook-github) | `experimental` | [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`session`](../packages/core/session), [`webhook`](../packages/experimental/webhook) |
|
||||
| [`mcp-manager`](../packages/mcp/mcp-manager) | `mcp` | [`mcp-client`](../packages/mcp/mcp-client), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
|
||||
@@ -1908,11 +1919,11 @@ flowchart TD
|
||||
| [`session-reference`](../packages/context/session-reference) | `context` | [`agent`](../packages/core/agent), [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`output-retention`](../packages/util/output-retention), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`spill`](../packages/spill/spill), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`tool-office`](../packages/document/tool-office) | `document` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`office-kit`](../packages/document/office-kit), [`skill`](../packages/skill/skill), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-worktree`](../packages/experimental/worktree), [`fs`](../packages/fs/fs), [`session`](../packages/core/session), [`timeout`](../packages/util/timeout) |
|
||||
| [`experimental-subagent-oar`](../packages/experimental/subagent-oar) | `experimental` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
|
||||
| [`experimental-subagent-oar`](../packages/experimental/subagent-oar) | `experimental` | [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`subprocess`](../packages/subprocess/subprocess) |
|
||||
| [`experimental-tool-subagent-oar`](../packages/experimental/tool-subagent-oar) | `experimental` | [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools) |
|
||||
| [`experimental-tool-worktree`](../packages/experimental/tool-worktree) | `experimental` | [`experimental-worktree`](../packages/experimental/worktree), [`tools`](../packages/core/tools) |
|
||||
| [`hooks-claude-code`](../packages/experimental/hooks-claude-code) | `experimental` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/experimental/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`tool-ralph`](../packages/experimental/tool-ralph) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow) |
|
||||
| [`tool-ralph`](../packages/experimental/tool-ralph) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`llm`](../packages/llm/llm), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow) |
|
||||
| [`sdk-protocol`](../packages/sdk/protocol) | `sdk` | [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`agent-team`](../packages/team/agent-team) | `team` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`workflow-ptc`](../packages/workflow/workflow-ptc) | `workflow` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow), [`working-directory`](../packages/session/working-directory) |
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
en: 6b1346e73ab6eab9
|
||||
zh: 888cfc08c6bc8522
|
||||
/liveshare/constraining-a-shared-session:
|
||||
en: 7607ed3f99df06cc
|
||||
zh: 290c9b8ed064da00
|
||||
en: 7fbb31bbc29817d6
|
||||
zh: 0a9542ab1d48a9e6
|
||||
/liveshare/viewer-states:
|
||||
en: b8bcb009e419fa25
|
||||
zh: 31c4662b52e99ea7
|
||||
@@ -38,7 +38,7 @@ Child tool guards recheck the share’s current mode, expiry, viewer admission,
|
||||
|
||||
Every share lets its viewer drive the *source* Session through the normal prompt path, and any share at either tier installs the bounded sandbox while it is active. `installSourceSessionAccess` registers a confined replacement for every view-surface tool the deployment ships in that Session's own scope, and bounded `edit` and `write` replacements whenever any share over the Session allows writing. The layer is mounted on the Session, but it confines only the turns a share viewer starts: `agent/pre-step` records, in Host memory, whether a turn's admitted input names a share viewer, and the guard and the replacements read that answer for every execution of that turn. A viewer-started turn runs those replacements and nothing else; a turn the owner starts keeps the Session's own tools, including `bash` and its unrestricted filesystem tools. The answer is decided when the turn is admitted and never written to the Session log; a restart recomputes it from the next admitted step. An owner's steering input inside a viewer's turn stays confined with it. Stopping every share over the Session disposes the layer, which restores the Session's own tools; narrowing the last write share to `view` re-installs the read-only layer.
|
||||
|
||||
The installation reports whether the source Session is actually confined. A deployment without the `read` tool, or a scope that refuses that replacement's registration, leaves the guard in place and reports the refusal; a tool whose own replacement failed stays refused while the rest of the surface runs, and the reader refuses the prompt with `source-write-unavailable`: no viewer-started turn of a shared Session is driven against the owner's own tools because a limit could not be installed.
|
||||
The installation reports whether the source Session is actually confined. A deployment without the `read` tool, or a scope that refuses that replacement's registration, leaves the guard in place and reports the refusal; a tool whose own replacement failed stays refused while the rest of the surface runs, and the reader refuses the prompt with `source-write-unavailable`: no viewer-started turn of a shared Session is driven against the owner's own tools because a limit could not be installed. A refusal records the same identity whether the guard or a confined tool decides: a path outside the grant is `FsError` `FS_SANDBOX_DENIED`, and other grant refusals are `LiveshareForkDeniedError` with a `FORK_*` code.
|
||||
|
||||
Each operation re-reads the Relay grants of the shares that keep the Session drivable, and each reading is synchronous with the tool call it authorizes, so input queued past the grant that admitted it cannot act on that stale admission. The layer is per Session: several shares over one Session share the one installation, a share that carries several source Sessions installs one layer per source, and a share that narrows or ends changes what the layer permits — its bounded write is refused once no active share may write, and the layer is released once no share is left. The Host does not attribute a running turn to the viewer that admitted it, so ending one share's grant stops the Session's running turn rather than singling out that viewer's work; the in-memory viewer-start marker only decides which tool surface that turn runs.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ fork 创建查看者拥有的新会话,源会话保持不变。Fork 授权检
|
||||
|
||||
每个分享都让它的 viewer 通过正常 prompt 路径驱动*源*会话,任一档位的分享在活跃期间都会安装有界沙箱。`installSourceSessionAccess` 在该会话自身作用域中为部署提供的每个读取与检索面工具注册受限替代,并在任一同会话分享允许写入时再注册有界 `edit` 与 `write` 替代。执行层挂在会话上,但只约束分享查看者发起的轮次:`agent/pre-step` 在 Host 内存中记录一个轮次的已准入输入是否带有 share-viewer principal,守卫与替代定义对该轮次的每次执行读取这一结论。查看者发起的轮次只能运行这些替代定义;所有者自己发起的轮次保留会话原生工具,包括 `bash` 与不受限的文件工具。该结论在轮次准入时确定,不写入会话日志;重启后从下一个准入步骤重新计算。所有者在查看者轮次中追加的输入仍留在该受限轮次内。该会话的所有分享停止后执行层被释放,会话恢复自己的工具;最后一个可写分享降为 `view` 时重装只读层。
|
||||
|
||||
安装结果报告源会话是否真正受到限制。没有 `read` 工具的部署或拒绝该替代注册的作用域会保留守卫并报告失败;某个工具自己的替代注册失败时,该工具保持拒绝,其余工具面照常运行。读取处理器以 `source-write-unavailable` 拒绝消息:限制未安装时,共享会话中查看者发起的轮次不会用所有者工具驱动。
|
||||
安装结果报告源会话是否真正受到限制。没有 `read` 工具的部署或拒绝该替代注册的作用域会保留守卫并报告失败;某个工具自己的替代注册失败时,该工具保持拒绝,其余工具面照常运行。读取处理器以 `source-write-unavailable` 拒绝消息:限制未安装时,共享会话中查看者发起的轮次不会用所有者工具驱动。无论由守卫还是受限工具判定,拒绝都记录同一标识:授权范围外的路径为 `FsError` `FS_SANDBOX_DENIED`,其他授权拒绝为 `LiveshareForkDeniedError` 及 `FORK_*` code。
|
||||
|
||||
每次操作都会重新读取维持该会话可驱动的分享的 Relay 授权,且读取与其授权的工具调用在同一同步步骤内完成,因此排队超过其准入授权的输入无法凭过期准入行动。执行层按会话安装:同一会话的多个分享共用一个安装,一条携带多个源会话的分享则为每个源会话各安装一层;分享收窄或结束时改变该层允许的操作——没有任何活跃分享可写时拒绝有界写入,会话不再有分享时释放执行层。Host 不把正在运行的轮次归属给准入它的查看者,因此结束某个分享的授权会停止该会话正在运行的轮次,而不是只挑出该查看者的工作;内存中的查看者轮次标记只决定该轮次运行哪套工具面。
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: 14522295539ea2fb
|
||||
zh: 572c462f2c6b70ad
|
||||
/tools/execution-extensible-waterfalls-plus-monotonic-policy:
|
||||
en: 0900eea6efe5a500
|
||||
zh: 13fa6eb7dbd8c9dd
|
||||
en: a6d9db4237438b2a
|
||||
zh: 1fe07dedc426c5eb
|
||||
/tools/the-enforced-raw-json-schema-subset:
|
||||
en: 28e354bfa2f9cebb
|
||||
zh: be1f75abccf8afdf
|
||||
|
||||
@@ -532,7 +532,7 @@ interface ToolErrorInfo {
|
||||
}
|
||||
```
|
||||
|
||||
The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); when a started body throws the signal's reason or an `Error` named `AbortError` after cancellation, the result keeps that message and carries `AbortError` with `ABORTED`; a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. An `ask` that approval does not grant becomes a denial with the name `ApprovalError`, which identifies the registry's denial and is not a thrown class, and `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`. A guard denial or post-execute block carries `info` only when it supplies one; any other thrown value produces an `error` without `info`.
|
||||
The result carries only the outcome. Call identity remains on the immutable `ToolExecution` that accompanies it through every hook and on the durable `tool/call` / `tool/result` session events, so wrappers cannot create a second, disagreeing identity. The canonical `value` is execution-local: the loop persists only `content`, `error`, and `meta`, while `tool/ptc-dispatch` stores the sub-call's rendered `content`, `isError`, optional structured `error`, and presentation `meta`. Replay reproduces presentation but cannot reconstruct canonical intermediate values. Optional `ToolErrorInfo.reason` retains raw user-facing detail without adding it to model-facing content. The registry sets `info` from a thrown `HarnessError` (its `name` and `code`), from a pre-execute `deny` that supplies it, and on its own cancellation results (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`); when a started body throws the signal's reason or an `Error` named `AbortError` after cancellation, the result keeps that message and carries `AbortError` with `ABORTED`, and a `tools/execute` wrapper that throws such a value after caller cancellation gets the same identity, with `ABORTED_BEFORE_DISPATCH` when the body never started; a `tools/execute` wrapper may also return a result with `info`, such as the timeout policy's `TOOL_TIMEOUT`. An `ask` that approval does not grant becomes a denial with the name `ApprovalError`, which identifies the registry's denial and is not a thrown class, and `APPROVAL_REJECTED`, `APPROVAL_CANCELLED`, or `APPROVAL_UNAVAILABLE`. A guard denial or post-execute block carries `info` only when it supplies one; any other thrown value produces an `error` without `info`.
|
||||
|
||||
On success the registry snapshots and validates the body value, freezes it, and invokes the pure renderer plus the optional presentation metadata projector for native and nested calls. It separately materializes the durable presentation fields immediately before `tools/result`; an invalid value, renderer/projector failure, or non-JSON presentation becomes a JSON-safe `isError`. The final live observer therefore sees the exact execution-local value beside fields safe for the later durable append.
|
||||
|
||||
|
||||
@@ -532,7 +532,7 @@ interface ToolErrorInfo {
|
||||
}
|
||||
```
|
||||
|
||||
结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);已开始的工具主体在取消后抛出 signal 的 reason 或 name 为 `AbortError` 的 `Error` 时,结果保留其 message,并带上 `AbortError` 与 `ABORTED`;`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。审批未授予的 `ask` 会变成 name 为 `ApprovalError` 的拒绝(该 name 标识注册表的拒绝,并不对应可抛出的类),code 为 `APPROVAL_REJECTED`、`APPROVAL_CANCELLED` 或 `APPROVAL_UNAVAILABLE`。guard 拒绝或 post-execute block 只有自带 `info` 时才会携带它;其他抛出值产生的 `error` 不含 `info`。
|
||||
结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。注册表会在以下情况设置 `info`:抛出的是 `HarnessError`(取其 `name` 和 `code`)、pre-execute 的 `deny` 自带 `info`,以及注册表自己生成的取消结果(`AbortError`,code 为 `ABORTED` 或 `ABORTED_BEFORE_DISPATCH`);已开始的工具主体在取消后抛出 signal 的 reason 或 name 为 `AbortError` 的 `Error` 时,结果保留其 message,并带上 `AbortError` 与 `ABORTED`,`tools/execute` 包装器在调用方取消后抛出这类值时也得到同样的标识,工具主体尚未开始时为 `ABORTED_BEFORE_DISPATCH`;`tools/execute` 包装器也可能返回带 `info` 的结果,例如超时策略的 `TOOL_TIMEOUT`。审批未授予的 `ask` 会变成 name 为 `ApprovalError` 的拒绝(该 name 标识注册表的拒绝,并不对应可抛出的类),code 为 `APPROVAL_REJECTED`、`APPROVAL_CANCELLED` 或 `APPROVAL_UNAVAILABLE`。guard 拒绝或 post-execute block 只有自带 `info` 时才会携带它;其他抛出值产生的 `error` 不含 `info`。
|
||||
|
||||
成功时,注册表会快照并校验函数体返回值,将其冻结,然后调用纯渲染器,并为原生与嵌套调用执行可选的展示元数据投影器。注册表会在 `tools/result` 之前另行物化持久展示字段;无效值、渲染器/投影器失败或非 JSON 展示都会转为 JSON 安全的 `isError`。因此,最终实时观察者能看到精确的执行期值,以及可安全用于后续持久追加的字段。
|
||||
|
||||
|
||||
@@ -24,14 +24,26 @@
|
||||
en: c063711f8247c240
|
||||
zh: 5e54758bbaf1670c
|
||||
/web-client-architecture/conversation-and-presentation:
|
||||
en: f37ba948a8838fb0
|
||||
zh: df19542d87860221
|
||||
en: 1283921eb19b9be3
|
||||
zh: bc42b48592d50f3a
|
||||
/web-client-architecture/data-paths:
|
||||
en: a254278432416473
|
||||
zh: 567c2d3c6a20b304
|
||||
/web-client-architecture/reconnection:
|
||||
en: 478f461e261b1ca5
|
||||
zh: 626791d04656faee
|
||||
/web-client-architecture/reading-reminders:
|
||||
en: 59427b3b5d8d633c
|
||||
zh: 864e0ea121534aa3
|
||||
/web-client-architecture/reading-reminders/sessionreadstate:
|
||||
en: 62e6bfae05af614a
|
||||
zh: cbd33ee7b57ac723
|
||||
/web-client-architecture/reading-reminders/sessionreadaction:
|
||||
en: 7ed7e42b233ee2c0
|
||||
zh: fd4e5b67f3358059
|
||||
/web-client-architecture/reading-reminders/sessionreadframe:
|
||||
en: 993e0b409439b15c
|
||||
zh: f7785bea2e8f5b00
|
||||
/web-client-architecture/package-boundaries:
|
||||
en: 3e64e8c28f0c4cb1
|
||||
zh: 47aa81c2ace5ba89
|
||||
en: 085622c76f4d5b06
|
||||
zh: 12ef92771b4d9a4a
|
||||
@@ -57,7 +57,7 @@ This pairing is not a second source of business truth. Host controllers decide d
|
||||
|
||||
Web and desktop share the [Coding Tools preference](../../packages/client/ui-settings/README.md#use-this-package). It controls diagnostic Views, [available preset choices](../../packages/client/ui-agent-preset/README.md), changed-file cards, and the builtin HTML preview policy without changing Session records.
|
||||
|
||||
`ui-session` installs the Session scope adapter and publishes `useSessions`, `useSessionRetainInfo`, `useSessionAccess`, `useSession`, `sessionId`, `useProjection`, and the Session-scope `useAccess` over the [remote-access](../../packages/api/remote-access/README.md) Client service. `SessionProvider` inherits an outer binding or binds an explicit `SessionReference`, so concurrent subtrees can target different Sessions. [`ui-session-status`](../../packages/client/ui-session-status/README.md) publishes `useSessionStatus` from the `ctx.uiSession.sessionStatus` table of running state, the effective pending interaction, and completion reminders. Domain adapters add further standard sources without putting React hooks on the model objects.
|
||||
`ui-session` installs the Session scope adapter and publishes `useSessions`, `useSessionRetainInfo`, `useSessionAccess`, `useSession`, `sessionId`, `useProjection`, and the Session-scope `useAccess` over the [remote-access](../../packages/api/remote-access/README.md) Client service. `SessionProvider` inherits an outer binding or binds an explicit `SessionReference`, so concurrent subtrees can target different Sessions. [`ui-session-status`](../../packages/client/ui-session-status/README.md) publishes `useSessionStatus` from the `ctx.uiSession.sessionStatus` table of running state, the effective pending interaction, and reading reminders that its Host face keeps for every Client of one Host. Domain adapters add further standard sources without putting React hooks on the model objects.
|
||||
|
||||
`ui-conversation` binds once to each `SessionBinding.eventSource`. Its event registry correlates durable Session events and Client-only `assistant/live-chunk` updates into stable business Contexts, and its view registry materializes target snapshots. Chat Assistant, Trajectory Assistant, and Turn Tail interpret both live chunks and the compact streams embedded in durable settlements, so reconnect and paged history reproduce the same Assistant state without durable token rows. `ui-chat` and `ui-trajectory` register separate Definitions and builders: they may interpret the same event family, but they do not import or share each other's final display model. The shell selects a registered view and passes its snapshot through standard hooks and Slots. [Conversation](conversation.md) defines Context identity, replay, Location data, target builders, and keyed renderers.
|
||||
|
||||
@@ -86,11 +86,29 @@ Recovery follows the data's semantics:
|
||||
|
||||
There is no monolithic Client `Runtime`, `HostFrame`, `events.mux`, `events.host`, or universal `resync()` API. The Connection exposes generation state, Gateway owns logical stream supervision, and each Client model defines replacement or resume semantics appropriate to its data.
|
||||
|
||||
## Reading reminders
|
||||
|
||||
[Session status](../../packages/client/ui-session-status/README.md) holds read acknowledgements and explicit unread marks in Host memory, outside the conversation log. Its Host Remote service sends complete reconnect baselines and committed changes; its Client plugin folds them into the `ctx.uiSession.sessionStatus` status table and acknowledges loaded completions in the visible, focused main view. Reading state does not change model history.
|
||||
|
||||
### SessionReadState
|
||||
|
||||
A whole reading record names its `sessionId`, latest `completedTurn`, whether that turn `failed` with an execution error this Host observed, acknowledged `readTurn`, and `manualUnread` flag. A Session is unread when the flag is set or its latest ended turn exceeds the acknowledged turn.
|
||||
|
||||
`mark(sessionId, action)` updates one Session in Host processing order. Only the ordered subscription updates Client records. The service records `turn/end` events itself, including whether that turn failed.
|
||||
|
||||
### SessionReadAction
|
||||
|
||||
An `unread` action sets the manual flag. A `read` action clears it and advances the read position through its `throughTurn`; an `acknowledge` action advances that position without changing the flag. Positions never move backwards or beyond the Host's latest completed turn. Mutation replies report success or failure without echoing a record.
|
||||
|
||||
### SessionReadFrame
|
||||
|
||||
A follow generation starts with `type: 'baseline'` and every accessible record in `items`. Each later `type: 'changed'` carries one complete committed `state`. Reconnection replaces the previous generation's records.
|
||||
|
||||
## Package boundaries
|
||||
|
||||
Feature plugin packages may share declarations through `import type`; they do not runtime-import or re-export another feature plugin's values. Cross-package behavior uses injected Cordis services, and cross-package UI uses Slots. Target-specific Conversation Definitions, projection helpers, and final view data stay with their target package even when Chat and Trajectory intentionally implement parallel logic.
|
||||
|
||||
Shared runtime values need a narrow static owner with no feature lifecycle, such as `client/store`, `ui-primitives`, or a browser-safe utility package. Transport and generated API assembly may import runtime contributions because assembling one protocol is their explicit responsibility. A feature package does not add `dsh.client.external` merely to bypass this rule.
|
||||
Shared runtime values need a narrow static owner with no feature lifecycle, such as `client/store`, `ui-primitives`, or a browser-safe utility package. Transport and generated API assembly may import runtime contributions because assembling one protocol is their explicit responsibility. A feature package may request the runtime values of a row under `packages/api/` through `dsh.client.external`, but never another feature plugin's row.
|
||||
|
||||
Use the four detailed references according to the extension being added:
|
||||
|
||||
@@ -98,3 +116,40 @@ Use the four detailed references according to the extension being added:
|
||||
- [API Gateway](../api-gateway.md) for Host methods, generated Remote contributions, streams, and forwarded events.
|
||||
- [Web Client Slots](slots.md) for components, hooks, stores, injection, and placement.
|
||||
- [Conversation](conversation.md) for durable event correlation, target snapshots, and Chat or Trajectory view contributions.
|
||||
|
||||
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
||||
|
||||
<a id="cordis-surface"></a>
|
||||
|
||||
## Cordis API
|
||||
|
||||
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
||||
|
||||
<a id="ctxsessionstatus--sessionstatusservice"></a>
|
||||
|
||||
### `ctx.sessionStatus` — `SessionStatusService`
|
||||
|
||||
Shared owner reading records; no reading operation changes model history.
|
||||
|
||||
```ts cordis-catalog
|
||||
/**
|
||||
* Update one Session; read positions advance only through Client-observed completions.
|
||||
* @param sessionId - Session identity.
|
||||
* @param action - Explicit reminder change or automatic read-position acknowledgement.
|
||||
* @throws RemoteError when closing, the Session is missing, or its metadata cannot be read.
|
||||
*/
|
||||
@Remote async mark(sessionId: SessionId, action: SessionReadAction): Promise<void>
|
||||
|
||||
/**
|
||||
* Follow accessible reading records; every connection starts with a complete baseline.
|
||||
* @param signal - generation cancellation.
|
||||
* @returns the baseline and whole-record changes, filtered by Session access.
|
||||
* @throws RemoteError when the service is closing.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *follow(signal: AbortSignal): AsyncIterable<SessionReadFrame>
|
||||
```
|
||||
|
||||
Types: [SessionId](core.md)
|
||||
|
||||
Source: [`packages/client/ui-session-status/src/index.ts`](../../packages/client/ui-session-status/src/index.ts)
|
||||
<!-- END GENERATED cordis-surface -->
|
||||
@@ -57,7 +57,7 @@ Connection 拥有请求 URL 解析、request correlation、`/api` carrier、trus
|
||||
|
||||
Web 和桌面端共享[代码工作工具偏好](../../packages/client/ui-settings/README.zh.md#use-this-package)。它控制诊断 View、[可用的预设选项](../../packages/client/ui-agent-preset/README.zh.md)、改动文件卡片和内置 HTML 预览策略,不改变 Session 记录。
|
||||
|
||||
`ui-session` 安装 Session scope adapter,并在 [remote-access](../../packages/api/remote-access/README.zh.md) Client 服务之上提供 `useSessions`、`useSessionRetainInfo`、`useSessionAccess`、`useSession`、`sessionId`、`useProjection` 和会话作用域的 `useAccess`。`SessionProvider` 可以继承外围 binding,也可以绑定显式 `SessionReference`,因此并存子树可以指向不同 Session。[`ui-session-status`](../../packages/client/ui-session-status/README.zh.md) 从 `ctx.uiSession.sessionStatus` 状态表提供 `useSessionStatus`,该表汇总运行状态、生效的待交互请求和完成提醒。领域 adapter 可以继续添加标准 source,但不会把 React hook 放进 model object。
|
||||
`ui-session` 安装 Session scope adapter,并在 [remote-access](../../packages/api/remote-access/README.zh.md) Client 服务之上提供 `useSessions`、`useSessionRetainInfo`、`useSessionAccess`、`useSession`、`sessionId`、`useProjection` 和会话作用域的 `useAccess`。`SessionProvider` 可以继承外围 binding,也可以绑定显式 `SessionReference`,因此并存子树可以指向不同 Session。[`ui-session-status`](../../packages/client/ui-session-status/README.zh.md) 从 `ctx.uiSession.sessionStatus` 状态表提供 `useSessionStatus`,该表汇总运行状态、生效的待交互请求,以及其宿主面为同一宿主各前端保存的阅读提醒。领域 adapter 可以继续添加标准 source,但不会把 React hook 放进 model object。
|
||||
|
||||
`ui-conversation` 对每个 `SessionBinding.eventSource` 只绑定一次。它的 event registry 把持久 Session event 与 Client-only `assistant/live-chunk` update 关联成稳定的业务 Context,view registry 则 materialize target snapshot。Chat Assistant、Trajectory Assistant 与 Turn Tail 同时解释 live chunk 和持久 settlement 中嵌入的紧凑 stream,因此重连与分页历史无需持久 token 行即可复现相同 Assistant 状态。`ui-chat` 与 `ui-trajectory` 分别注册自己的 Definition 和 builder:它们可以解释同一 event family,但不会导入或共享彼此的最终 display model。Shell 选择一个已注册 view,再通过标准 hook 与 Slot 交付其 snapshot。[Conversation](conversation.zh.md)定义 Context identity、replay、Location data、target builder 与 keyed renderer。
|
||||
|
||||
@@ -86,11 +86,29 @@ Web 和桌面端共享[代码工作工具偏好](../../packages/client/ui-settin
|
||||
|
||||
架构中没有统一的 Client `Runtime`、`HostFrame`、`events.mux`、`events.host` 或通用 `resync()` API。Connection 公开 generation state,Gateway 管理 logical stream,Client model 则按自身数据定义 replacement 或 resume 语义。
|
||||
|
||||
## 阅读提醒
|
||||
|
||||
[会话状态](../../packages/client/ui-session-status/README.zh.md)在宿主内存中保存使用者的阅读确认和手动未读标记。其宿主 Remote 服务发送重连快照和已保存的更新;其前端插件把这些记录汇入 `ctx.uiSession.sessionStatus` 状态表,并在可见且聚焦的主视图中确认已加载的完成内容。阅读状态不改变模型历史。
|
||||
|
||||
### SessionReadState
|
||||
|
||||
完整阅读记录包含 `sessionId`、最近结束的 `completedTurn`、该轮是否以本宿主观察到的执行错误结束的 `failed`、已确认的 `readTurn` 和 `manualUnread` 标记。设置了手动标记,或最近结束的轮次大于已确认轮次时,会话为未读。
|
||||
|
||||
`mark(sessionId, action)` 按宿主处理顺序更新会话。前端只通过有序订阅流更新记录。该服务自己记录 `turn/end` 事件,包括该轮是否失败。
|
||||
|
||||
### SessionReadAction
|
||||
|
||||
`unread` 操作设置手动标记。`read` 操作清除标记,并将阅读位置推进至它的 `throughTurn`;`acknowledge` 操作只推进位置,不改变标记。位置不会回退,也不越过宿主最近完成的轮次。修改回复仅表示成功或失败,不回传记录。
|
||||
|
||||
### SessionReadFrame
|
||||
|
||||
每次同步先发送 `type: 'baseline'`,在 `items` 中包含所有可访问的记录。后续每个 `type: 'changed'` 都携带一条已保存的完整 `state`。重连会替换上一代同步流的记录。
|
||||
|
||||
## 包边界
|
||||
|
||||
功能插件包可以通过 `import type` 共享声明;不得运行时导入或转发另一个功能插件的值。跨包行为使用注入的 Cordis service,跨包 UI 使用 Slots。特定 target 的 Conversation Definition、projection helper 与最终 view data 留在所属 target 包中,即使 Chat 和 Trajectory 有意实现平行逻辑。
|
||||
|
||||
共享运行时值需要一个职责收窄、没有功能生命周期的静态 owner,例如 `client/store`、`ui-primitives` 或浏览器安全的 util 包。Transport 与生成 API assembly 可以导入运行时 contribution,因为组装同一个 protocol 正是它们的显式职责。功能包不能只为绕过此规则而添加 `dsh.client.external`。
|
||||
共享运行时值需要一个职责收窄、没有功能生命周期的静态 owner,例如 `client/store`、`ui-primitives` 或浏览器安全的 util 包。Transport 与生成 API assembly 可以导入运行时 contribution,因为组装同一个 protocol 正是它们的显式职责。功能包可以通过 `dsh.client.external` 请求 `packages/api/` 下某一行的运行时值,但不能请求另一个功能插件的行。
|
||||
|
||||
根据所添加的扩展查阅四篇详细参考:
|
||||
|
||||
@@ -98,3 +116,40 @@ Web 和桌面端共享[代码工作工具偏好](../../packages/client/ui-settin
|
||||
- [API Gateway](../api-gateway.zh.md):Host method、生成的 Remote contribution、stream 与 forwarded event。
|
||||
- [Web Client Slots](slots.zh.md):component、hook、store、injection 与 placement。
|
||||
- [Conversation](conversation.zh.md):持久 event correlation、target snapshot,以及 Chat 或 Trajectory view contribution。
|
||||
|
||||
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
||||
|
||||
<a id="cordis-surface"></a>
|
||||
|
||||
## Cordis API
|
||||
|
||||
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
||||
|
||||
<a id="ctxsessionstatus--sessionstatusservice"></a>
|
||||
|
||||
### `ctx.sessionStatus` — `SessionStatusService`
|
||||
|
||||
Shared owner reading records; no reading operation changes model history.
|
||||
|
||||
```ts cordis-catalog
|
||||
/**
|
||||
* Update one Session; read positions advance only through Client-observed completions.
|
||||
* @param sessionId - Session identity.
|
||||
* @param action - Explicit reminder change or automatic read-position acknowledgement.
|
||||
* @throws RemoteError when closing, the Session is missing, or its metadata cannot be read.
|
||||
*/
|
||||
@Remote async mark(sessionId: SessionId, action: SessionReadAction): Promise<void>
|
||||
|
||||
/**
|
||||
* Follow accessible reading records; every connection starts with a complete baseline.
|
||||
* @param signal - generation cancellation.
|
||||
* @returns the baseline and whole-record changes, filtered by Session access.
|
||||
* @throws RemoteError when the service is closing.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *follow(signal: AbortSignal): AsyncIterable<SessionReadFrame>
|
||||
```
|
||||
|
||||
Types: [SessionId](core.zh.md)
|
||||
|
||||
Source: [`packages/client/ui-session-status/src/index.ts`](../../packages/client/ui-session-status/src/index.ts)
|
||||
<!-- END GENERATED cordis-surface -->
|
||||
@@ -6,8 +6,8 @@
|
||||
en: 3a3d69d2b12a78f9
|
||||
zh: a7a7d12487968bbc
|
||||
/git-worktrees/creation-and-retention:
|
||||
en: 53f643c5d30e00b2
|
||||
zh: ba9e52efc62c7656
|
||||
en: 4c28ae6baae4ef5f
|
||||
zh: 0c83d90ea3cd3c2e
|
||||
/git-worktrees/request-and-result:
|
||||
en: fbab866bf824d6e0
|
||||
zh: 73d2a1ee350e1434
|
||||
@@ -10,7 +10,7 @@ The calling Session's current directory selects the source repository. Creation
|
||||
|
||||
The default destination is `<current checkout root>/.agents/worktrees/<name>`. `repositoryRoot` is the top-level directory of the caller’s current checkout; a linked checkout therefore contains its own pool. The service writes a `.gitignore` containing `*` and a trailing newline only when its allocation creates the configured pool directory. Existing files and ignore rules are preserved. The calling Session’s existing sandbox policy must permit writes to the destination and shared Git administration directory. Successful Git setup precedes the working-directory change.
|
||||
|
||||
Leaving through `working_directory({ cd: path })` retains the checkout and branch. Cancellation or failure can also retain partial artifacts; the error identifies their location. The service aborts and drains pending operations on disposal. The [package README](../../packages/experimental/worktree/README.md) owns configuration and Git requirements.
|
||||
Leaving through `working_directory({ cd: path })` retains the checkout and branch. Cancellation or failure can also retain partial artifacts; the error identifies their location. Worktree failures throw `WorktreeError` with a `WORKTREE_*` code; a failure after allocation keeps the wrapped error's `name` and `code`, and caller cancellation stays an `AbortError`. The service aborts and drains pending operations on disposal. The [package README](../../packages/experimental/worktree/README.md) owns configuration and Git requirements.
|
||||
|
||||
## Request and result
|
||||
|
||||
@@ -124,6 +124,8 @@ Creates retained Git worktrees under the mounted filesystem and sandbox provider
|
||||
* @param signal - cancellation of lookup, creation, and working-directory publication.
|
||||
* @param onPhase - receives each stage before it begins; it must not throw.
|
||||
* @returns canonical checkout path, branch name, pinned commit, and source repository root.
|
||||
* @throws {WorktreeError} for an invalid request, an existing branch or path, or a failed, oversized, or timed-out
|
||||
* command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
||||
*/
|
||||
async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<CreatedWorktree>
|
||||
|
||||
@@ -140,6 +142,8 @@ async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortS
|
||||
* @param signal - cancellation of the restoration.
|
||||
* @param onPhase - receives each stage before it begins; it must not throw.
|
||||
* @returns the directory and whether the branch was created again.
|
||||
* @throws {WorktreeError} for an invalid request, an existing path, a locked registration, or a failed, oversized,
|
||||
* or timed-out command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
||||
*/
|
||||
async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<RestoredWorktree>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
默认目标为 `<current checkout root>/.agents/worktrees/<name>`。`repositoryRoot` 是调用方当前检出目录的顶层目录;因此,链接检出目录会在自身内部保存工作树父目录。仅当服务的分配操作创建了配置指定的父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`。已有文件与忽略规则保持不变。调用方 Session 的现有沙箱策略必须允许写入目标目录与共享 Git 管理目录。Git 初始化成功后才改变工作目录。
|
||||
|
||||
通过 `working_directory({ cd: path })` 离开时,会保留检出目录与分支。取消或失败也可能留下部分产物;错误会指出它们的位置。服务销毁时会中止待完成操作并等待它们结束。[包 README](../../packages/experimental/worktree/README.zh.md)拥有配置与 Git 要求。
|
||||
通过 `working_directory({ cd: path })` 离开时,会保留检出目录与分支。取消或失败也可能留下部分产物;错误会指出它们的位置。worktree 失败抛出带 `WORKTREE_*` code 的 `WorktreeError`;分配开始后的失败保留被包装错误的 `name` 与 `code`,调用方取消仍为 `AbortError`。服务销毁时会中止待完成操作并等待它们结束。[包 README](../../packages/experimental/worktree/README.zh.md)拥有配置与 Git 要求。
|
||||
|
||||
## 请求与结果
|
||||
|
||||
@@ -124,6 +124,8 @@ Creates retained Git worktrees under the mounted filesystem and sandbox provider
|
||||
* @param signal - cancellation of lookup, creation, and working-directory publication.
|
||||
* @param onPhase - receives each stage before it begins; it must not throw.
|
||||
* @returns canonical checkout path, branch name, pinned commit, and source repository root.
|
||||
* @throws {WorktreeError} for an invalid request, an existing branch or path, or a failed, oversized, or timed-out
|
||||
* command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
||||
*/
|
||||
async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<CreatedWorktree>
|
||||
|
||||
@@ -140,6 +142,8 @@ async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortS
|
||||
* @param signal - cancellation of the restoration.
|
||||
* @param onPhase - receives each stage before it begins; it must not throw.
|
||||
* @returns the directory and whether the branch was created again.
|
||||
* @throws {WorktreeError} for an invalid request, an existing path, a locked registration, or a failed, oversized,
|
||||
* or timed-out command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
||||
*/
|
||||
async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<RestoredWorktree>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
|
||||
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md
|
||||
/:
|
||||
en: 4d6f7a78d1415f20
|
||||
zh: a5a906f4f1266243
|
||||
/experimental-plugin-failures-carry-error-codes:
|
||||
en: 13f43192e549438f
|
||||
zh: ce8c5bf26aefbd4f
|
||||
/experimental-plugin-failures-carry-error-codes/change:
|
||||
en: d5878c5ce6fbfb76
|
||||
zh: 2f2d29a1f3a9d6f3
|
||||
/experimental-plugin-failures-carry-error-codes/migration:
|
||||
en: 6365d4f60118cf64
|
||||
zh: c2f1378dee8ea4b4
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "Experimental and hook plugin tool failures record error codes, NativeError, OarFailure, and StagehandDrainError become HarnessError subclasses, and browser cleanup rejects with BrowserSessionError."
|
||||
---
|
||||
|
||||
# Experimental plugin failures carry error codes
|
||||
|
||||
English | [中文](guide.zh.md)
|
||||
|
||||
## Change
|
||||
|
||||
Tool failures from the CUA, browser-use, Cua Driver, worktree, Ralph, terminal, OAR subagent, Liveshare, Claude Code and Codex hook, and claude-code-mods plugins now record `error: { name, code }` on `tool/result`; previously most of these results had no `error`. The [package READMEs](../../../../packages/experimental/README.md) list each class and code.
|
||||
|
||||
Code that handles these failures in-process sees these changes:
|
||||
|
||||
- `NativeError` from `@deepseek-ai/dsh-cua` and `OarFailure` from `@deepseek-ai/dsh-experimental-subagent-oar` now extend `HarnessError` from `@deepseek-ai/dsh-error`. `NativeError` keeps its name, codes, and `CODE: message` text. `OarFailure` drops its `stage` and `category` fields; the same summary stays in `message`, and `code` names the stage. Cancellation before an OAR run starts rejects with a `DOMException` named `AbortError` instead of an `OarFailure`.
|
||||
- `StagehandDrainError` from `@deepseek-ai/dsh-experimental-browser-use-stagehand-native` now extends `StagehandError` and has the code `STAGEHAND_CLEANUP_FAILED`.
|
||||
- `SessionResources.dispose()` from `@deepseek-ai/dsh-experimental-browser-use-runtime` rejects with `BrowserSessionError` (`BROWSER_CLEANUP_FAILED`) whose `cause` is the `AggregateError` it previously threw; `instanceof AggregateError` no longer matches.
|
||||
- Liveshare guard functions return `{ reason, info }` instead of a reason string.
|
||||
- Argument failures that now throw `ToolArgsError` show `invalid arguments: ` before the message the model sees, and a CUA screenshot request for a model without image input shows `MODEL_DOES_NOT_SUPPORT_IMAGES: ` before its message.
|
||||
|
||||
## Migration
|
||||
|
||||
1. If analytics or retry rules read `tool/result` `error`, add the new names and codes from the package READMEs. Earlier Session logs keep results without `error`.
|
||||
2. Replace `instanceof AggregateError` checks on `SessionResources.dispose()` rejections with `instanceof BrowserSessionError` and read the individual failures from `error.cause.errors`.
|
||||
3. Replace reads of `OarFailure.stage` or `category` with `error.code`.
|
||||
4. If code catches `HarnessError` before `NativeError`, `OarFailure`, or `StagehandDrainError`, move the specific check first where the handling differs.
|
||||
5. Confirm with `pnpm run typecheck` and your own failure-path tests.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "Experimental 与 hook 插件的工具失败带上错误 code,NativeError、OarFailure 与 StagehandDrainError 改为 HarnessError 子类,浏览器清理失败改为以 BrowserSessionError 拒绝。"
|
||||
---
|
||||
|
||||
# Experimental 插件的失败带上错误 code
|
||||
|
||||
[English](guide.md) | 中文
|
||||
|
||||
## 变更
|
||||
|
||||
CUA、browser-use、Cua Driver、worktree、Ralph、终端、OAR 子 agent、Liveshare、Claude Code 与 Codex hook,以及 claude-code-mods 插件的工具失败现在会在 `tool/result` 上记录 `error: { name, code }`;此前这些结果大多没有 `error`。各[包 README](../../../../packages/experimental/README.zh.md) 列出了每个类和 code。
|
||||
|
||||
在进程内处理这些失败的代码会看到以下变化:
|
||||
|
||||
- `@deepseek-ai/dsh-cua` 的 `NativeError` 与 `@deepseek-ai/dsh-experimental-subagent-oar` 的 `OarFailure` 现在继承 `@deepseek-ai/dsh-error` 的 `HarnessError`。`NativeError` 的 name、code 与 `CODE: message` 文本不变。`OarFailure` 去掉了 `stage` 与 `category` 字段;同样的摘要保留在 `message` 中,`code` 标明阶段。OAR 运行开始前的取消改为以 name 为 `AbortError` 的 `DOMException` 拒绝,不再是 `OarFailure`。
|
||||
- `@deepseek-ai/dsh-experimental-browser-use-stagehand-native` 的 `StagehandDrainError` 现在继承 `StagehandError`,code 为 `STAGEHAND_CLEANUP_FAILED`。
|
||||
- `@deepseek-ai/dsh-experimental-browser-use-runtime` 的 `SessionResources.dispose()` 改为以 `BrowserSessionError`(`BROWSER_CLEANUP_FAILED`)拒绝,其 `cause` 是此前直接抛出的 `AggregateError`;`instanceof AggregateError` 不再成立。
|
||||
- Liveshare 的 guard 函数改为返回 `{ reason, info }`,不再返回原因字符串。
|
||||
- 改为抛出 `ToolArgsError` 的参数失败,模型看到的 message 前多了 `invalid arguments: `;为不支持图片输入的模型请求 CUA 截图时,message 前多了 `MODEL_DOES_NOT_SUPPORT_IMAGES: `。
|
||||
|
||||
## 迁移
|
||||
|
||||
1. 如果分析或重试规则读取 `tool/result` 的 `error`,按包 README 补充新的 name 与 code。较早的 Session 日志中这些结果仍没有 `error`。
|
||||
2. 把对 `SessionResources.dispose()` 拒绝值的 `instanceof AggregateError` 检查改为 `instanceof BrowserSessionError`,并从 `error.cause.errors` 读取各个失败。
|
||||
3. 把读取 `OarFailure.stage` 或 `category` 的代码改为读取 `error.code`。
|
||||
4. 如果代码在 `NativeError`、`OarFailure` 或 `StagehandDrainError` 之前捕获 `HarnessError`,在处理方式不同的地方把具体类的检查移到前面。
|
||||
5. 用 `pnpm run typecheck` 和自己的失败路径测试确认迁移完成。
|
||||
@@ -3,14 +3,14 @@
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md
|
||||
/:
|
||||
en: 34a382f0eacc70b6
|
||||
zh: 251d8ba446d1b358
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status:
|
||||
en: 97c85d1b9ace1ddf
|
||||
zh: 0c4d30289336b324
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status/change:
|
||||
en: 62ea699966c0e9d5
|
||||
zh: 31afc236690b0cd5
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status/migration:
|
||||
en: 529f2def0221d26d
|
||||
zh: 6009726243e1c8a6
|
||||
en: 3ac349a835a29b14
|
||||
zh: 2c0d4c7e3cfb59ca
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status-and-completion-reminders-follow-host-reading-records:
|
||||
en: fb71a29f84e6d36d
|
||||
zh: 5f46ad954c473f7e
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status-and-completion-reminders-follow-host-reading-records/change:
|
||||
en: ec4737fe7f5e4839
|
||||
zh: e68a22fe18216760
|
||||
/session-status-moves-to-deepseek-ai-dsh-client-ui-session-status-and-completion-reminders-follow-host-reading-records/migration:
|
||||
en: 20d2b7a2809ffc2d
|
||||
zh: 9ca5578f94130755
|
||||
@@ -1,28 +1,31 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "SessionStatus, SessionStatusSnapshot, UseSessionStatus, and the useSessionStatus hook move from @deepseek-ai/dsh-client-ui-session/client to @deepseek-ai/dsh-client-ui-session-status/client, and ctx.uiSession.sessionStatus becomes the separate uiSession.sessionStatus service that readers inject."
|
||||
description: "Session status types and the useSessionStatus hook move to @deepseek-ai/dsh-client-ui-session-status/client, ctx.uiSession.sessionStatus becomes an injected service, and completion reminders follow Host reading records."
|
||||
---
|
||||
|
||||
# Session status moves to `@deepseek-ai/dsh-client-ui-session-status`
|
||||
# Session status moves to `@deepseek-ai/dsh-client-ui-session-status` and completion reminders follow Host reading records
|
||||
|
||||
English | [中文](guide.zh.md)
|
||||
|
||||
## Change
|
||||
|
||||
`@deepseek-ai/dsh-client-ui-session/client` no longer exports `SessionStatus`, `SessionStatusSnapshot`, or `UseSessionStatus`, and ui-session no longer declares or provides the `useSessionStatus` root hook. Both now belong to the Client plugin [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.md), which the Web bundle loads beside ui-session. The `SessionStatus` fields `running`, `pendingInteraction`, and `completionUnread` and their meaning are unchanged. A Client composition that loads ui-session without ui-session-status has no status table and no `useSessionStatus` hook.
|
||||
`@deepseek-ai/dsh-client-ui-session/client` no longer exports `SessionStatus`, `SessionStatusSnapshot`, or `UseSessionStatus`, and ui-session no longer declares or provides the `useSessionStatus` root hook. Both now belong to the Client plugin [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.md), one Web bundle row with a Host reading service and the Client table. A Client composition that loads ui-session without ui-session-status has no status table and no `useSessionStatus` hook.
|
||||
|
||||
`ctx.uiSession.sessionStatus` is now the separate `uiSession.sessionStatus` service. Reading it through `ctx.uiSession.sessionStatus.getSnapshot()` and `subscribe()` keeps its form, but a plugin that reads it without injecting `'uiSession.sessionStatus'` fails with `cannot get property "uiSession.sessionStatus" without inject`. A plugin whose components call `useSessionStatus` without that injection stays active when the status table unloads, and its components then fail with `useSessionStatus is not a function`. `ctx.uiSession` now has the type `UiSessionService`, which extends the unchanged `UiSession` class with members such as `sessionStatus`; a value annotated as `UiSession` does not show `sessionStatus`.
|
||||
`ctx.uiSession.sessionStatus` is now the separate `uiSession.sessionStatus` service. Reading it through `ctx.uiSession.sessionStatus.getSnapshot()` and `subscribe()` keeps its form, but a plugin that reads it without injecting `'uiSession.sessionStatus'` fails with `cannot get property "uiSession.sessionStatus" without inject`. Components of a plugin without that injection fail with `useSessionStatus is not a function` after the table unloads. `ctx.uiSession` now has the type `UiSessionService`, which extends the unchanged `UiSession` class with members such as `sessionStatus`; a value annotated as `UiSession` does not show `sessionStatus`.
|
||||
|
||||
Pending interactions stay in ui-session: `ctx.uiSession.registerPendingInteraction(precedence)`, `SessionPendingInteractionBase`, `SessionPendingInteractionMap`, `SessionPendingInteraction`, and `PendingInteractionPublisher` keep their names, behavior, and `@deepseek-ai/dsh-client-ui-session/client` export. Declarations that extend `SessionPendingInteractionMap` keep targeting that module. ui-session additionally exposes the read-only `ctx.uiSession.pendingInteractions` source.
|
||||
Pending interactions stay in ui-session: `ctx.uiSession.registerPendingInteraction(precedence)`, `SessionPendingInteractionBase`, `SessionPendingInteractionMap`, `SessionPendingInteraction`, and `PendingInteractionPublisher` keep their names, behavior, and `@deepseek-ai/dsh-client-ui-session/client` export. Extensions of `SessionPendingInteractionMap` keep targeting that module. ui-session additionally exposes the read-only `ctx.uiSession.pendingInteractions` source.
|
||||
|
||||
This affects Client plugins and tests that import the three status types, render components that read `useSessionStatus`, or read `ctx.uiSession.sessionStatus`.
|
||||
`completionUnread` follows Host-memory reading records shared by every Client and changes through Host completions, explicit marks, and visible main-view acknowledgement; only a main-view switch, including a reload, clears a manual mark. The open viewed Session hides its unacknowledged turn; earlier history reads as read. The required `completionFailed` field marks an unread Session whose latest turn failed. The new `mark(sessionId, unread)` rejects until `readingReady` reports the Host baseline.
|
||||
|
||||
This affects Client plugins and tests that import the three status types, construct `SessionStatus` values, render components that read `useSessionStatus`, or read `ctx.uiSession.sessionStatus`.
|
||||
|
||||
## Migration
|
||||
|
||||
1. Import `SessionStatus`, `SessionStatusSnapshot`, and `UseSessionStatus` from `@deepseek-ai/dsh-client-ui-session-status/client`. A package that only imports these types, for example in tests, declares `@deepseek-ai/dsh-client-ui-session-status` in `devDependencies` and its TypeScript project references.
|
||||
2. A package whose source components call `useSessionStatus` additionally lists the package in `dsh.client.inject`, adds `import type {} from '@deepseek-ai/dsh-client-ui-session-status/client'` when it imports none of the types, and adds `'uiSession.sessionStatus'` to the Cordis `inject` of the plugin that registers those components, so the plugin unloads and reloads with the status table.
|
||||
3. In each plugin that reads `ctx.uiSession.sessionStatus` in JavaScript, add `'uiSession.sessionStatus'` to `inject`. A plugin that only needs the effective pending request may read and subscribe to `ctx.uiSession.pendingInteractions` instead.
|
||||
2. A package whose components call `useSessionStatus` also lists the package in `dsh.client.inject`, adds `import type {} from '@deepseek-ai/dsh-client-ui-session-status/client'` when it imports none of the types, and adds `'uiSession.sessionStatus'` to the Cordis `inject` of the plugin that registers them.
|
||||
3. Each plugin that reads `ctx.uiSession.sessionStatus` adds `'uiSession.sessionStatus'` to `inject`; one that needs only the effective pending request may subscribe to `ctx.uiSession.pendingInteractions` instead.
|
||||
4. Where code passes `ctx.uiSession` through a parameter or field annotated as `UiSession` and then reads `sessionStatus`, annotate it as `UiSessionService` from `@deepseek-ai/dsh-client-ui-session/client`.
|
||||
5. Leave `registerPendingInteraction` calls and `declare module '@deepseek-ai/dsh-client-ui-session/client'` augmentations of `SessionPendingInteractionMap` unchanged.
|
||||
6. A custom Client composition that loads `@deepseek-ai/dsh-client-ui-session` also loads `@deepseek-ai/dsh-client-ui-session-status`, so `useSessionStatus` remains available.
|
||||
7. Confirm that the plugin type-checks and that a Session row still shows its running or waiting indicator.
|
||||
6. Add `completionFailed` to `SessionStatus` values in tests and fixtures, and script Host reading records to drive `completionUnread`.
|
||||
7. A custom composition that loads `@deepseek-ai/dsh-client-ui-session` also loads `@deepseek-ai/dsh-client-ui-session-status` as a plugin row, so its Host reading service and `useSessionStatus` are available.
|
||||
8. Confirm that the plugin type-checks, that a Session row still shows its running or waiting indicator, and that a Session finishing outside the main view shows an unread reminder.
|
||||
@@ -1,28 +1,31 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "SessionStatus、SessionStatusSnapshot、UseSessionStatus 和 useSessionStatus hook 从 @deepseek-ai/dsh-client-ui-session/client 移到 @deepseek-ai/dsh-client-ui-session-status/client,ctx.uiSession.sessionStatus 改为读取方需要注入的独立 uiSession.sessionStatus 服务。"
|
||||
description: "会话状态类型与 useSessionStatus hook 移到 @deepseek-ai/dsh-client-ui-session-status/client,ctx.uiSession.sessionStatus 改为需要注入的服务,完成提醒改为跟随宿主阅读记录。"
|
||||
---
|
||||
|
||||
# 会话状态移到 `@deepseek-ai/dsh-client-ui-session-status`
|
||||
# 会话状态移到 `@deepseek-ai/dsh-client-ui-session-status`,完成提醒改由宿主阅读记录提供
|
||||
|
||||
[English](guide.md) | 中文
|
||||
|
||||
## 变更
|
||||
|
||||
`@deepseek-ai/dsh-client-ui-session/client` 不再导出 `SessionStatus`、`SessionStatusSnapshot` 或 `UseSessionStatus`,ui-session 也不再声明或提供根 hook `useSessionStatus`。它们现在属于 Client 插件 [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.zh.md),Web bundle 会与 ui-session 一起加载它。`SessionStatus` 的字段 `running`、`pendingInteraction`、`completionUnread` 及其含义不变。只加载 ui-session、不加载 ui-session-status 的 Client 组合没有状态表,也没有 `useSessionStatus` hook。
|
||||
`@deepseek-ai/dsh-client-ui-session/client` 不再导出 `SessionStatus`、`SessionStatusSnapshot` 或 `UseSessionStatus`,ui-session 也不再声明或提供根 hook `useSessionStatus`。它们现在属于 Client 插件 [`@deepseek-ai/dsh-client-ui-session-status`](../../../../packages/client/ui-session-status/README.zh.md),即 Web bundle 中同时提供宿主阅读服务和前端状态表的一行。只加载 ui-session、不加载 ui-session-status 的 Client 组合没有状态表,也没有 `useSessionStatus` hook。
|
||||
|
||||
`ctx.uiSession.sessionStatus` 现在是独立的 `uiSession.sessionStatus` 服务。通过 `ctx.uiSession.sessionStatus.getSnapshot()` 和 `subscribe()` 读取的写法不变,但未注入 `'uiSession.sessionStatus'` 就读取它的插件会报错 `cannot get property "uiSession.sessionStatus" without inject`。组件调用 `useSessionStatus`、却未注入该服务的插件,在状态表卸载后仍保持激活,其组件随后报错 `useSessionStatus is not a function`。`ctx.uiSession` 的类型改为 `UiSessionService`,它在不变的 `UiSession` class 之上加入 `sessionStatus` 等成员;标注为 `UiSession` 的值看不到 `sessionStatus`。
|
||||
`ctx.uiSession.sessionStatus` 现在是独立的 `uiSession.sessionStatus` 服务。通过 `ctx.uiSession.sessionStatus.getSnapshot()` 和 `subscribe()` 读取的写法不变,但未注入 `'uiSession.sessionStatus'` 就读取它的插件会报错 `cannot get property "uiSession.sessionStatus" without inject`。未注入该服务的插件,其组件会在状态表卸载后报错 `useSessionStatus is not a function`。`ctx.uiSession` 的类型改为 `UiSessionService`,它在不变的 `UiSession` class 之上加入 `sessionStatus` 等成员;标注为 `UiSession` 的值看不到 `sessionStatus`。
|
||||
|
||||
待交互仍归 ui-session:`ctx.uiSession.registerPendingInteraction(precedence)`、`SessionPendingInteractionBase`、`SessionPendingInteractionMap`、`SessionPendingInteraction` 和 `PendingInteractionPublisher` 的名称、行为以及从 `@deepseek-ai/dsh-client-ui-session/client` 的导出都不变。扩展 `SessionPendingInteractionMap` 的声明继续指向该模块。ui-session 另外提供只读的 `ctx.uiSession.pendingInteractions` 数据源。
|
||||
|
||||
受影响的是导入这三个状态类型、渲染读取 `useSessionStatus` 的组件,或读取 `ctx.uiSession.sessionStatus` 的 Client 插件和测试。
|
||||
`completionUnread` 跟随宿主内存中、由所有前端共享的阅读记录,因宿主完成轮次、主动标记和可见主视图的确认而变化;只有主视图切换到该会话(包括刷新后恢复)会自动清除手动标记。正在查看且已打开的会话不显示尚未确认的轮次;宿主启动前已有的历史按已读处理。新增的必填字段 `completionFailed` 标记最近一轮失败的未读会话。新增的 `mark(sessionId, unread)` 在 `readingReady` 报告取得宿主基线之前会拒绝。
|
||||
|
||||
受影响的是导入这三个状态类型、构造 `SessionStatus` 值、渲染读取 `useSessionStatus` 的组件,或读取 `ctx.uiSession.sessionStatus` 的 Client 插件和测试。
|
||||
|
||||
## 迁移
|
||||
|
||||
1. 从 `@deepseek-ai/dsh-client-ui-session-status/client` 导入 `SessionStatus`、`SessionStatusSnapshot` 和 `UseSessionStatus`。只导入这些类型(例如只在测试中导入)的包,在 `devDependencies` 和 TypeScript 项目引用中声明 `@deepseek-ai/dsh-client-ui-session-status`。
|
||||
2. 源码组件调用 `useSessionStatus` 的包,另外在 `dsh.client.inject` 中列出该包;不导入任何上述类型时加入 `import type {} from '@deepseek-ai/dsh-client-ui-session-status/client'`;并在注册这些组件的插件的 Cordis `inject` 中加入 `'uiSession.sessionStatus'`,使该插件随状态表一起卸载和重新加载。
|
||||
3. 在每个在 JS 中读取 `ctx.uiSession.sessionStatus` 的插件中,把 `'uiSession.sessionStatus'` 加到 `inject`。只需要生效待交互请求的插件,可以改为读取并订阅 `ctx.uiSession.pendingInteractions`。
|
||||
2. 组件调用 `useSessionStatus` 的包,另外在 `dsh.client.inject` 中列出该包;不导入任何上述类型时加入 `import type {} from '@deepseek-ai/dsh-client-ui-session-status/client'`;并在注册这些组件的插件的 Cordis `inject` 中加入 `'uiSession.sessionStatus'`。
|
||||
3. 每个读取 `ctx.uiSession.sessionStatus` 的插件把 `'uiSession.sessionStatus'` 加入 `inject`;只需要生效待交互请求的插件,可以改为订阅 `ctx.uiSession.pendingInteractions`。
|
||||
4. 代码把 `ctx.uiSession` 传给标注为 `UiSession` 的参数或字段、之后又读取 `sessionStatus` 时,把标注改为 `@deepseek-ai/dsh-client-ui-session/client` 的 `UiSessionService`。
|
||||
5. `registerPendingInteraction` 调用和对 `SessionPendingInteractionMap` 的 `declare module '@deepseek-ai/dsh-client-ui-session/client'` 扩展保持不变。
|
||||
6. 加载 `@deepseek-ai/dsh-client-ui-session` 的自定义 Client 组合同时加载 `@deepseek-ai/dsh-client-ui-session-status`,使 `useSessionStatus` 继续可用。
|
||||
7. 确认插件通过类型检查,并且会话行仍显示运行或等待标记。
|
||||
6. 在测试和 fixture 的 `SessionStatus` 值中加入 `completionFailed`,并编排宿主阅读记录来驱动 `completionUnread`。
|
||||
7. 加载 `@deepseek-ai/dsh-client-ui-session` 的自定义组合同时以插件行加载 `@deepseek-ai/dsh-client-ui-session-status`,使其宿主阅读服务和 `useSessionStatus` 可用。
|
||||
8. 确认插件通过类型检查、会话行仍显示运行或等待标记,并且在主视图之外结束的会话显示未读提醒。
|
||||
@@ -18,8 +18,8 @@
|
||||
en: 6ee072ffebd2eb38
|
||||
zh: 6a8723d13f443d51
|
||||
/deepseek-ai-dsh-api-gateway/client-service-clientremote-ctx-key-remote:
|
||||
en: 0916113cdbe794fb
|
||||
zh: 14893c2cba95bfd6
|
||||
en: 610e48ec8d772f85
|
||||
zh: 627da164fc8297ba
|
||||
/deepseek-ai-dsh-api-gateway/model-experience:
|
||||
en: 6cb309d3378f035d
|
||||
zh: 998042a02ee32850
|
||||
|
||||
@@ -63,7 +63,7 @@ Every unary call resolves to `RemoteResult<T>` — `{ ok: true, value }` or `{ o
|
||||
|
||||
`ctx.remote.$host` reads the fixed Host facts as plain values: `home` (undefined until the first ready frame) and `isLoopback`. It is not a store — no subscription, no generation counter — so a consumer that must react to reconnection listens for `connection/reset` instead of polling it.
|
||||
|
||||
`ctx.remote.$stream()` returns a single-consumer `RemoteStream` spanning physical carrier generations. For answering Clients it permits one immediate retry after an isolated stream failure while the carrier remains available; after physical WebSocket loss it waits for Connection to reopen the carrier. If the Host generation is already unavailable, it waits for the next connected generation. Each item carries its physical generation. Passive Clients cannot use `$stream()`; they call generated raw stream methods and handle terminal carrier failure themselves. The domain consumer validates and accepts each generation's opening value; business and protocol failures remain terminal. Every terminal failure leaves this face as a `RemoteError`, including exhausted carrier retries and a generation that ends before its opening value, so a stream consumer discriminates the same way a unary caller does. `RemoteStreamCarrierError` names a retryable physical loss and reaches a domain only as the `carrierFailed` callback argument, never as a terminal outcome. `RemoteSnapshotStream` adds one opening snapshot followed by deltas. `RemoteJournalStream` adds follow-before-page opening, pagination, reconnect catch-up, and gap repair over domain-defined inclusive entry ranges; it removes complete duplicates and rejects gaps, inverted ranges, and partial overlaps. A domain may also carry cursorless notifications: they never advance or repair the durable cursor, and notifications received during gap repair publish only after the replacement page commits. If a newer generation supersedes that repair, held notifications from the superseded generation are discarded with its page. Disposing any stream cancels its requests and resolves after the active iterator is fully stopped.
|
||||
`ctx.remote.$stream()` returns a single-consumer `RemoteStream` spanning physical carrier generations. For answering Clients it permits one immediate retry after an isolated stream failure while the carrier remains available; after physical WebSocket loss it waits for Connection to reopen the carrier. If the Host generation is already unavailable, it waits for the next connected generation. Each item carries its physical generation. Passive Clients cannot use `$stream()`; they call generated raw stream methods and handle terminal carrier failure themselves. The domain consumer validates and accepts each generation's opening value; business and protocol failures remain terminal. Every terminal failure leaves this face as a `RemoteError`, including exhausted carrier retries and a generation that ends before its opening value, so a stream consumer discriminates the same way a unary caller does. A failure whose `code` is `gateway/carrier-lost` names a retryable physical loss: `RemoteStreamCarrierError` carries that code, the `RemoteStreamCarrierFailure` type describes it, `isRemoteStreamCarrierFailure(error)` applies the same retry test for a domain that classifies its own failures, and a domain `ended` callback may return a plain `Error` with it to request reconnection without importing the class. Retry follows the code, not the class; the code is produced only inside the Client process, so a `RemoteError` from the Host terminates the stream even when it carries that code; such a failure reaches a domain only as the `carrierFailed` callback argument, never as a terminal outcome. `RemoteSnapshotStream` adds one opening snapshot followed by deltas. `RemoteJournalStream` adds follow-before-page opening, pagination, reconnect catch-up, and gap repair over domain-defined inclusive entry ranges; it removes complete duplicates and rejects gaps, inverted ranges, and partial overlaps. A domain may also carry cursorless notifications: they never advance or repair the durable cursor, and notifications received during gap repair publish only after the replacement page commits. If a newer generation supersedes that repair, held notifications from the superseded generation are discarded with its page. Disposing any stream cancels its requests and resolves after the active iterator is fully stopped.
|
||||
|
||||
`ctx.remote.$on()` subscribes to one forwarded Host event. Its legal keys are exactly the Host assembly's forwarding selection, and the listener type is the owning package's own Cordis `Events` declaration, so no second signature can drift from it. Each subscription belongs to the calling fiber and disappears with it. The Client Remote service registers the `$events` pump as a Connection generation source only when `connection.interactions` is `answer`, whether any `$on` listener exists. With `none`, `$on()` is unavailable and the Client opens only the physical lifecycle socket; unary calls never wait for socket readiness. Browsers use Remote mux, while in-process compositions use `connection.rpc.open`; the opening `ready` item establishes a Connection generation and supplies its Host facts. Carrier failure, Remote stream failure, unexpected normal completion, a non-ready opening item, or a malformed event item ends that generation and lets Connection reopen it under continuous, capped jittered exponential backoff. Ordinary notifications run in registration order and isolate listener failures. Agent-scoped waterfalls let a listener return a result, call `next()`, or reject; Gateway returns that outcome through the existing HTTP unary carrier.
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ Host 组合可通过 `registerRemoteEvents()` 注册唯一的应用事件 source
|
||||
|
||||
`ctx.remote.$host` 以普通值读取固定的 Host 事实:`home`(首个 ready 帧之前为 undefined)与 `isLoopback`。它不是存储——没有订阅、没有代次计数——所以需要响应重连的消费方去监听 `connection/reset`,而不是轮询它。
|
||||
|
||||
`ctx.remote.$stream()` 返回跨越多个物理载体代次的单消费方 `RemoteStream`。对于回答型 Client,载体仍可用时的独立流故障允许一次立即重试;物理 WebSocket 丢失后等待 Connection 重开载体。如果 Host generation 已不可用,则等待下一代连接。每个流项都带有其物理代次。被动 Client 不使用 `$stream()`,而是调用生成的原始流方法,并自行处理终态载体故障。领域消费方校验并接受各代次的 opening value;业务与协议错误仍然终止流。一切终态失败离开本面时都是 `RemoteError`,包括重试耗尽和在 opening value 之前就结束的代次,因此流消费方与一元调用方用同一种方式判别。`RemoteStreamCarrierError` 命名的是可重试的物理丢失,它只作为 `carrierFailed` 回调参数到达领域,绝不作为终态结果。`RemoteSnapshotStream` 在此之上规定每代由一个初始快照和后续 delta 组成。`RemoteJournalStream` 基于领域提供的 entry 闭区间提供 follow-before-page、分页、重连追赶与缺口修复;它丢弃完整重复项,并拒绝缺口、倒置区间和部分重叠。领域还可以携带无 cursor 的通知:通知绝不推进或修复持久 cursor,在缺口修复期间收到的通知只会在 replacement page 提交后发布。若更新代次取代该修复,旧代次 held notification 会与其 page 一同丢弃。对任一种流执行 dispose(资源释放)时,系统会取消该流的请求,并在活动 iterator 完全停止后完成资源释放。
|
||||
`ctx.remote.$stream()` 返回跨越多个物理载体代次的单消费方 `RemoteStream`。对于回答型 Client,载体仍可用时的独立流故障允许一次立即重试;物理 WebSocket 丢失后等待 Connection 重开载体。如果 Host generation 已不可用,则等待下一代连接。每个流项都带有其物理代次。被动 Client 不使用 `$stream()`,而是调用生成的原始流方法,并自行处理终态载体故障。领域消费方校验并接受各代次的 opening value;业务与协议错误仍然终止流。一切终态失败离开本面时都是 `RemoteError`,包括重试耗尽和在 opening value 之前就结束的代次,因此流消费方与一元调用方用同一种方式判别。`code` 为 `gateway/carrier-lost` 的失败表示可重试的物理丢失:`RemoteStreamCarrierError` 带有该 code,`RemoteStreamCarrierFailure` 类型描述它,`isRemoteStreamCarrierFailure(error)` 供自行分类失败的领域复用同一重试判断,领域的 `ended` 回调也可以返回带该 code 的普通 `Error` 来请求重连,而无需导入该 class。是否重试只看 code,不看 class;该 code 只在前端进程内产生,因此宿主返回的 `RemoteError` 即使带有该 code 也会终止流;这类失败只作为 `carrierFailed` 回调参数到达领域,绝不作为终态结果。`RemoteSnapshotStream` 在此之上规定每代由一个初始快照和后续 delta 组成。`RemoteJournalStream` 基于领域提供的 entry 闭区间提供 follow-before-page、分页、重连追赶与缺口修复;它丢弃完整重复项,并拒绝缺口、倒置区间和部分重叠。领域还可以携带无 cursor 的通知:通知绝不推进或修复持久 cursor,在缺口修复期间收到的通知只会在 replacement page 提交后发布。若更新代次取代该修复,旧代次 held notification 会与其 page 一同丢弃。对任一种流执行 dispose(资源释放)时,系统会取消该流的请求,并在活动 iterator 完全停止后完成资源释放。
|
||||
|
||||
`ctx.remote.$on()` 订阅一条被转发的 Host 事件。它的合法键恰好等于 Host 装配声明的转发选择,listener 类型就是事件所属包自己的 Cordis `Events` 声明,因此不存在会与之漂移的第二份签名。每个订阅归属调用方 fiber,并随该 fiber 一起消失。Client Remote 服务仅在 `connection.interactions` 为 `answer` 时把 `$events` pump 注册为 Connection generation source,无论当前是否存在 `$on` listener。选择 `none` 时,`$on()` 不可用,Client 只打开物理生命周期连接;unary 调用不等待 socket 就绪。浏览器使用 Remote mux,进程内组合使用 `connection.rpc.open`;opening `ready` 项建立 Connection generation 并提供 Host 信息。物理 carrier 失败、Remote 流故障、意外正常结束、非 ready 首项或畸形事件项都会终止该 generation,由 Connection 按持续且间隔封顶的带抖动指数退避重开。普通通知按注册顺序运行并隔离 listener 失败;Agent-scoped waterfall(瀑布式事件)允许 listener 返回结果、调用 `next()` 或拒绝,Gateway 再通过现有 HTTP 一元载体回送该结果。
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ import {
|
||||
type RemoteStreamOptions,
|
||||
} from './remote-stream.ts'
|
||||
|
||||
export { RemoteStreamCarrierError } from './stream-client.ts'
|
||||
export { isRemoteStreamCarrierFailure, RemoteStreamCarrierError } from './stream-client.ts'
|
||||
export type { RemoteStreamCarrierFailure } from './stream-client.ts'
|
||||
export { RemoteJournalStream } from './journal-stream.ts'
|
||||
export type {
|
||||
RemoteJournalChange,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Cursor, page, and live-tail coordination over a reconnecting Remote stream. */
|
||||
|
||||
import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import { RemoteStreamCarrierError } from './stream-client.ts'
|
||||
import { RemoteStreamCarrierError, type RemoteStreamCarrierFailure } from './stream-client.ts'
|
||||
import type {
|
||||
RemoteStream,
|
||||
RemoteStreamItem,
|
||||
@@ -75,7 +75,7 @@ export interface RemoteJournalStreamOptions<Page, Entry, Cursor, Notification =
|
||||
/** Apply one complete journal-window change or cursorless notification. */
|
||||
readonly publish: (change: RemoteJournalChange<Page, Entry, Notification>) => void
|
||||
/** Observe a retryable carrier loss before reconnection. */
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierFailure) => void
|
||||
/** Publish a terminal stream, page, or protocol failure after opening. */
|
||||
readonly failed: (error: unknown) => void
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { RemoteError, remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'
|
||||
import { RemoteStreamCarrierError } from './stream-client.ts'
|
||||
import { isRemoteStreamCarrierFailure, type RemoteStreamCarrierFailure } from './stream-client.ts'
|
||||
|
||||
/** One item annotated with the physical Remote-stream generation that delivered it. */
|
||||
export interface RemoteStreamItem<Item> {
|
||||
@@ -22,10 +22,13 @@ export interface RemoteStreamOptions<Item> {
|
||||
readonly name: string
|
||||
/** Open one physical generation of the logical stream. */
|
||||
readonly open: (signal: AbortSignal) => AsyncIterable<Item>
|
||||
/** Classify a normal generation end after or before its opening item was accepted. */
|
||||
/**
|
||||
* Classify a normal generation end after or before its opening item was accepted; a returned error whose `code` is
|
||||
* `gateway/carrier-lost` reconnects, and any other error is terminal.
|
||||
*/
|
||||
readonly ended: (accepted: boolean) => Error
|
||||
/** Observe a retryable carrier loss before the supervisor waits or reopens. */
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierFailure) => void
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +132,7 @@ export class RemoteStream<Item> implements AsyncIterable<RemoteStreamItem<Item>>
|
||||
} catch (error) {
|
||||
if (isAborted(this.lifetime.signal)) return
|
||||
if (revision !== this.revision) continue
|
||||
if (!(error instanceof RemoteStreamCarrierError)) throw terminalStreamFailure(error)
|
||||
if (!isRemoteStreamCarrierFailure(error)) throw terminalStreamFailure(error)
|
||||
this.options.carrierFailed?.(error)
|
||||
if (revision !== this.revision) continue
|
||||
attempt++
|
||||
@@ -159,7 +162,7 @@ export class RemoteStream<Item> implements AsyncIterable<RemoteStreamItem<Item>>
|
||||
|
||||
async function waitForRemoteStreamRetry(
|
||||
connection: Pick<ConnectionHandle, 'generation'>,
|
||||
error: RemoteStreamCarrierError,
|
||||
error: RemoteStreamCarrierFailure,
|
||||
attempt: number,
|
||||
signal: AbortSignal,
|
||||
): Promise<void> {
|
||||
@@ -199,7 +202,7 @@ async function waitForRemoteStreamRetry(
|
||||
/**
|
||||
* Mark a terminal escape before it crosses the stream boundary: consumers
|
||||
* discriminate failures by code, so an unmarked throw reads as a local bug.
|
||||
* Marked failures pass through verbatim. The carrier class never escapes as a
|
||||
* Marked failures pass through verbatim. A carrier failure never escapes as a
|
||||
* terminal outcome — it stays the retry-internal signal fed to `carrierFailed`
|
||||
* and the `ended(true)` retry trigger.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Client owner for the Gateway multiplexed Remote stream socket. */
|
||||
import { RemoteError } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import { RemoteError, remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import type { ConnectionWebSocket } from '@deepseek-ai/dsh-client-connection/client'
|
||||
|
||||
import {
|
||||
@@ -11,8 +11,22 @@ import {
|
||||
import { Deque } from '@deepseek-ai/dsh-deque'
|
||||
import { randomUUID } from '@deepseek-ai/dsh-util-crypto'
|
||||
|
||||
/**
|
||||
* Retryable physical Remote stream carrier failure. {@link RemoteStream} reconnects on any error whose `code` is
|
||||
* `gateway/carrier-lost`, so a domain `ended` callback may return a plain `Error` carrying that code. The code is
|
||||
* produced only inside this Client process; a `RemoteError` returned by the Host never counts as a carrier loss.
|
||||
*/
|
||||
export interface RemoteStreamCarrierFailure extends Error {
|
||||
/** Stable carrier-loss code; class identity is not part of the retry decision. */
|
||||
readonly code: 'gateway/carrier-lost'
|
||||
}
|
||||
|
||||
const REMOTE_STREAM_CARRIER_CODE: RemoteStreamCarrierFailure['code'] = 'gateway/carrier-lost'
|
||||
|
||||
/** Physical Remote stream socket failure that may be retried by a domain transport. */
|
||||
export class RemoteStreamCarrierError extends Error {
|
||||
export class RemoteStreamCarrierError extends Error implements RemoteStreamCarrierFailure {
|
||||
readonly code: RemoteStreamCarrierFailure['code'] = REMOTE_STREAM_CARRIER_CODE
|
||||
|
||||
/**
|
||||
* @param message - physical carrier failure description.
|
||||
* @param options - optional causal error.
|
||||
@@ -23,6 +37,18 @@ export class RemoteStreamCarrierError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a failure is a retryable carrier loss, judged by its `code` rather than its class. {@link RemoteStream} uses
|
||||
* this test, and domains that classify their own failures, such as a disconnected view, reuse it.
|
||||
* @param error - thrown or returned failure.
|
||||
* @returns true for a locally produced `Error` whose `code` is `gateway/carrier-lost`; false for any `RemoteError`,
|
||||
* which reached this Client from the Host and terminates the stream even when it carries that code.
|
||||
*/
|
||||
export function isRemoteStreamCarrierFailure(error: unknown): error is RemoteStreamCarrierFailure {
|
||||
return error instanceof Error && remoteErrorOf(error) === undefined
|
||||
&& 'code' in error && error.code === REMOTE_STREAM_CARRIER_CODE
|
||||
}
|
||||
|
||||
interface SocketWaiter {
|
||||
readonly revision: number
|
||||
resolve(socket: ConnectionWebSocket): void
|
||||
@@ -59,7 +85,7 @@ export class RemoteStreamMuxClient {
|
||||
private readonly socketClosures = new Set<Promise<void>>()
|
||||
private running = false
|
||||
private disposed = false
|
||||
private failure: RemoteStreamCarrierError | undefined
|
||||
private failure: RemoteStreamCarrierFailure | undefined
|
||||
|
||||
/**
|
||||
* @param openSocket - selected authenticated carrier; omission uses the browser socket.
|
||||
@@ -367,7 +393,7 @@ export class RemoteStreamMuxClient {
|
||||
() => undefined,
|
||||
(error: unknown) => {
|
||||
if (!this.running) return
|
||||
const failure = error instanceof RemoteStreamCarrierError ? error
|
||||
const failure = isRemoteStreamCarrierFailure(error) ? error
|
||||
: new RemoteStreamCarrierError('api gateway: Remote stream WebSocket failed to open', { cause: error })
|
||||
if (this.revision === revision) this.failure = failure
|
||||
for (const waiter of [...this.waiters]) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import {
|
||||
RemoteStreamCarrierError,
|
||||
RemoteStream,
|
||||
type RemoteStreamCarrierFailure,
|
||||
} from '../src/client/index.ts'
|
||||
|
||||
const GENERATION = { id: 1, host: { home: '/home/fixture' } }
|
||||
@@ -118,6 +119,48 @@ describe('RemoteStream', () => {
|
||||
expect(carrierFailed).toHaveBeenNthCalledWith(2, repeated)
|
||||
})
|
||||
|
||||
it('reconnects on a plain Error carrying the carrier code and stops on one without it', async () => {
|
||||
const carrierLoss = Object.assign(new Error('domain stream ended'), { code: 'gateway/carrier-lost' as const })
|
||||
const carrierFailed = vi.fn<(error: RemoteStreamCarrierFailure) => void>()
|
||||
const reconnecting = new RemoteStream(hostSource(true).connection, {
|
||||
name: 'fixture stream',
|
||||
open: scripted([{ values: ['first'] }, { values: ['second'], hold: true }]),
|
||||
ended: accepted => accepted ? carrierLoss : new Error('generation ended before acceptance'),
|
||||
carrierFailed,
|
||||
})
|
||||
const iterator = reconnecting[Symbol.asyncIterator]()
|
||||
const first = await iterator.next()
|
||||
if (first.done) throw new Error('fixture generation ended early')
|
||||
first.value.accept()
|
||||
await expect(iterator.next()).resolves.toMatchObject({ done: false, value: { generation: 2, value: 'second' } })
|
||||
expect(carrierFailed).toHaveBeenCalledExactlyOnceWith(carrierLoss)
|
||||
await reconnecting.dispose()
|
||||
|
||||
const plain = new Error('domain stream ended')
|
||||
const terminal = new RemoteStream(hostSource(true).connection, {
|
||||
name: 'fixture stream',
|
||||
open: scripted([{ values: ['first'] }, { values: ['unreached'] }]),
|
||||
ended: () => plain,
|
||||
})
|
||||
const stopping = terminal[Symbol.asyncIterator]()
|
||||
const opened = await stopping.next()
|
||||
if (opened.done) throw new Error('fixture generation ended early')
|
||||
opened.value.accept()
|
||||
await expect(stopping.next()).rejects.toMatchObject({
|
||||
isDSHRemoteError: true, code: 'gateway/internal', message: 'domain stream ended', cause: plain,
|
||||
})
|
||||
expect(new RemoteStreamCarrierError('socket lost').code).toBe('gateway/carrier-lost')
|
||||
})
|
||||
|
||||
it('terminates on a Host RemoteError even when it carries the carrier code', async () => {
|
||||
const hostFailure = new RemoteError('gateway/carrier-lost' as never, 'host reused the carrier code', {} as never)
|
||||
const carrierFailed = vi.fn<(error: RemoteStreamCarrierFailure) => void>()
|
||||
const stream = supervisor(hostSource(true).connection, [{ terminal: hostFailure }, { values: ['unreached'] }], carrierFailed)
|
||||
|
||||
await expect(stream[Symbol.asyncIterator]().next()).rejects.toBe(hostFailure)
|
||||
expect(carrierFailed).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('folds a non-Error terminal escape into a marked gateway/internal failure', async () => {
|
||||
const stream = new RemoteStream(hostSource(true).connection, {
|
||||
name: 'fixture stream',
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
"@deepseek-ai/dsh-office-kit": "workspace:*",
|
||||
"@deepseek-ai/dsh-deepseek-account": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-product-analytics": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-session-status": "workspace:*",
|
||||
"@deepseek-ai/dsh-agent-team": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-trajectory": "workspace:*",
|
||||
"@deepseek-ai/dsh-web": "workspace:*"
|
||||
|
||||
@@ -27,6 +27,8 @@ import sessionFeedbackRemote from '@deepseek-ai/dsh-command-feedback/remote'
|
||||
import fileUploadsRemote from '@deepseek-ai/dsh-client-file-upload/remote'
|
||||
import sessionReferencesRemote from '@deepseek-ai/dsh-session-reference/remote'
|
||||
import subagentsRemote from '@deepseek-ai/dsh-subagent/remote'
|
||||
import sessionStatusRemote from '@deepseek-ai/dsh-client-ui-session-status/remote'
|
||||
export type {} from '@deepseek-ai/dsh-client-ui-session-status/remote'
|
||||
import sessionRemote from '@deepseek-ai/dsh-api-session-controller/remote'
|
||||
import jobRemote from '@deepseek-ai/dsh-api-job-controller/remote'
|
||||
import workspaceRemote from '@deepseek-ai/dsh-api-workspace-controller/remote'
|
||||
@@ -203,7 +205,8 @@ export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
||||
toolResultsRemote,
|
||||
messageFeedbackRemote, sessionFeedbackRemote,
|
||||
fileUploadsRemote, sessionReferencesRemote,
|
||||
permissionPresetsRemote, subagentsRemote, sessionRemote, jobRemote, workspaceRemote, workspaceFilesRemote, terminalRemote,
|
||||
permissionPresetsRemote, subagentsRemote, sessionRemote, sessionStatusRemote, jobRemote,
|
||||
workspaceRemote, workspaceFilesRemote, terminalRemote,
|
||||
officeKitRemote, userQuestionsRemote, webRemote,
|
||||
]) {
|
||||
disposers.push(await ctx.remote.$mount(contribution))
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
RemoteSnapshotStream,
|
||||
RemoteStreamCarrierError,
|
||||
type ClientRemote,
|
||||
type RemoteStreamCarrierFailure,
|
||||
type RemoteJournalChange,
|
||||
type RemoteJournalFrame,
|
||||
} from '@deepseek-ai/dsh-api-gateway/client'
|
||||
@@ -91,7 +92,7 @@ export interface SessionControlStreamOptions {
|
||||
/** Apply a complete baseline or one later update. */
|
||||
readonly accept: (frame: SessionControlFrame) => void
|
||||
/** Observe a retryable carrier loss before reconnection. */
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierFailure) => void
|
||||
/** Publish a terminal business or protocol failure. */
|
||||
readonly failed: (error: unknown) => void
|
||||
}
|
||||
@@ -101,7 +102,7 @@ export interface SessionEventStreamOptions {
|
||||
/** Apply one complete event-window change. */
|
||||
readonly publish: (change: SessionJournalChange) => void
|
||||
/** Observe a retryable carrier loss before reconnection. */
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierFailure) => void
|
||||
/** Publish a terminal stream, page, or protocol failure after opening. */
|
||||
readonly failed: (error: unknown) => void
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { preferredShell, rememberShell } from './shell-preference.ts'
|
||||
import type { TerminalInventory } from './inventory.ts'
|
||||
import { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store'
|
||||
import { Deque } from '@deepseek-ai/dsh-deque'
|
||||
import { RemoteStreamCarrierError, type ClientRemote, type RemoteStream } from '@deepseek-ai/dsh-api-gateway/client'
|
||||
import { isRemoteStreamCarrierFailure, type ClientRemote, type RemoteStream } from '@deepseek-ai/dsh-api-gateway/client'
|
||||
import { RemoteError, remoteErrorOf, type RemoteResult, type RemoteStreamHandle, type RemoteUplinkWindow } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import type {} from '@deepseek-ai/dsh-api-terminal-controller/remote'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
@@ -407,7 +407,7 @@ export class TerminalView {
|
||||
const failure = remoteErrorOf(error)
|
||||
const issue = failure?.code === 'terminal/view' ? failure.details.issue : failure?.code === 'terminal/limit-reached' ? 'terminalLimit' : failure?.code === 'terminal/unavailable' ? 'missingTerminal' : undefined
|
||||
if (!this.stopped() && issue === 'missingTerminal') this.inventory.remove(this.id)
|
||||
this.patch({ phase: error instanceof RemoteStreamCarrierError ? 'disconnected' : 'failed', writable: false, issue, error: error instanceof Error ? error.message : String(error) })
|
||||
this.patch({ phase: isRemoteStreamCarrierFailure(error) ? 'disconnected' : 'failed', writable: false, issue, error: error instanceof Error ? error.message : String(error) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,6 +287,15 @@ it('classifies a discovery carrier failure as disconnected and supports explicit
|
||||
expect(remote.create).toHaveBeenCalledOnce()
|
||||
})
|
||||
|
||||
it('classifies a Host RemoteError carrying the carrier code as failed, not disconnected', async () => {
|
||||
const { model, remote } = fixture()
|
||||
vi.mocked(remote.environment).mockRejectedValueOnce(
|
||||
new RemoteError('gateway/carrier-lost' as never, 'host reused the carrier code', {} as never),
|
||||
)
|
||||
await model.refresh()
|
||||
expect(model.state.getSnapshot()).toMatchObject({ phase: 'failed', error: 'host reused the carrier code' })
|
||||
})
|
||||
|
||||
it('retains state when disposal overtakes successful allocation or a failed discovery', async () => {
|
||||
for (const operation of ['creation', 'discovery'] as const) {
|
||||
const { model, remote } = fixture()
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
RemoteSnapshotStream,
|
||||
RemoteStreamCarrierError,
|
||||
type ClientRemote,
|
||||
type RemoteStreamCarrierFailure,
|
||||
} from '@deepseek-ai/dsh-api-gateway/client'
|
||||
import type { WorkspaceFollowFrame, WorkspaceFollowIncrement } from '../types.ts'
|
||||
import type { WorkspaceFollowSink } from './model.ts'
|
||||
@@ -64,7 +65,7 @@ export interface WorkspaceStateStreamOptions {
|
||||
/** Destinations for decoded Workspace state operations. */
|
||||
readonly accept: WorkspaceFollowSink
|
||||
/** Observe a retryable carrier loss before reconnection. */
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierError) => void
|
||||
readonly carrierFailed?: (error: RemoteStreamCarrierFailure) => void
|
||||
/** Publish a terminal business or protocol failure. */
|
||||
readonly failed: (error: unknown) => void
|
||||
}
|
||||
|
||||
@@ -276,7 +276,8 @@
|
||||
- id: ui-session
|
||||
name: '@deepseek-ai/dsh-client-ui-session'
|
||||
|
||||
# Session status table behind ctx.uiSession.sessionStatus and useSessionStatus.
|
||||
# Host reading records (ctx.sessionStatus) and the Session status table behind
|
||||
# ctx.uiSession.sessionStatus and useSessionStatus.
|
||||
- id: ui-session-status
|
||||
name: '@deepseek-ai/dsh-client-ui-session-status'
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ The `/client` entrypoint of a UI plugin package is its public browser API, not a
|
||||
|
||||
1. **A UI plugin exports no values beyond what cordis loading needs** — `apply` / `inject` (and `Config` where present), plus store factories consumed type-only by components (`ReturnType<typeof createXXXStore>`). Shared types (owner data, injected values, composed prop aliases) may also be exported. Implementation components, pure helpers, constants, and store handles stay internal. Adding any new value export requires user sign-off, not a matching consumer.
|
||||
2. **Same-package tests import internals directly** — relative `../src/client/xxx.ts` from package tests, or the `./src/*` subpath where a spec lives outside the package. Never widen the public API to make a test compile.
|
||||
3. **A feature plugin MUST NOT runtime-import or re-export another feature plugin's values, and MUST NOT declare `dsh.client.external` to obtain them.** Shared declarations use `import type`; behavior crosses packages through injected Cordis services, and UI crosses packages through slots. If neither fits, stop and escalate — do not add an export to unblock yourself. Shared runtime code belongs only in a narrow static owner such as `client/store`, `ui-primitives`, or a browser-safe utility package; transport and generated API assemblies keep their explicit infrastructure edges.
|
||||
3. **A feature plugin MUST NOT runtime-import or re-export another feature plugin's values, and MUST NOT declare `dsh.client.external` to obtain them.** Shared declarations use `import type`; behavior crosses packages through injected Cordis services, and UI crosses packages through slots. If neither fits, stop and escalate — do not add an export to unblock yourself. Shared runtime code belongs only in a narrow static owner such as `client/store`, `ui-primitives`, or a browser-safe utility package; a feature plugin may request a `packages/api/` row's runtime values through `dsh.client.external`, and transport and generated API assemblies keep their explicit infrastructure edges.
|
||||
|
||||
## ctx discipline (components never see ctx)
|
||||
|
||||
@@ -81,7 +81,7 @@ Client business code may statically read `process.env.DSH_CLIENT_*`; every refer
|
||||
A dynamic browser half either carries a module privately or requests the shared module-table identity. The client baseline is centralized in [`web/src/platform.ts`](web/src/platform.ts): `PLATFORM_MODULES` names shell-seeded React, Cordis, selected third-party libraries, and static Client libraries; `PRELOADED_CLIENT_EXTERNALS` is reserved for dynamic rows whose factories must arrive before shell boot and is empty when no such row exists.
|
||||
|
||||
1. **Baseline externals are implicit for every dynamic bundle.** Do not repeat entries from `PLATFORM_MODULES` in `dsh.client.external`; npm dependency declarations still follow the dependency rules above.
|
||||
2. **`dsh.client.external` is not a feature-plugin dependency mechanism.** Only infrastructure, transport, or generated assembly may add a package-specific non-baseline value request whose dynamic row must be materialized through the module table. Declare the exact import specifier; only a trailing `/client` aliases the package row.
|
||||
2. **`dsh.client.external` is not a feature-plugin dependency mechanism.** Infrastructure, transport, or generated assembly may add a package-specific non-baseline value request whose dynamic row must be materialized through the module table; a feature plugin may request only rows under `packages/api/`. Declare the exact import specifier; only a trailing `/client` aliases the package row.
|
||||
3. **Silence means a private copy.** Third-party implementation libraries outside the baseline may be bundled independently. A value reached only through `import type` is erased and creates no request.
|
||||
4. **A request has two possible suppliers.** A dynamic package supplies its own row; `PLATFORM_MODULES` supplies an exact static-table key. There is no `dsh.client.provide` alias protocol.
|
||||
5. **Validate both sides.** The dynamic build preset externalizes the baseline and rejects undeclared workspace value imports; [`verify-client-packages`](../../scripts/verify-client-packages.ts) rejects malformed or redundant requests, missing suppliers, and synchronous request cycles.
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 1eb35b015a6c423f
|
||||
zh: a8a3dceee2c9e943
|
||||
/client-web-gui-browser-half/packages:
|
||||
en: 292a25cf1a426b56
|
||||
zh: ca765789a28289f8
|
||||
en: 45c1d8a1e1f44425
|
||||
zh: 47a5199bca1e7836
|
||||
/client-web-gui-browser-half/related-documentation:
|
||||
en: d1d506e68fab7333
|
||||
zh: 1a90fe6f3f8f24a9
|
||||
|
||||
@@ -39,7 +39,7 @@ The kernel packages boot and serve the page; the UI feature packages present it.
|
||||
| [`ui-renderer/`](ui-renderer/README.md) | Binds slot data to React and mounts the assembled application | `ctx.uiRenderer` |
|
||||
| [`ui-slots/`](ui-slots/README.md) | Defines typed extension Slots and reusable Component Factories | — |
|
||||
| [`ui-session/`](ui-session/README.md) | Adapts Session Controller state into standard Slot sources and hooks | — |
|
||||
| [`ui-session-status/`](ui-session-status/README.md) | Combines running state, the effective pending interaction, and completion reminders into the Session status table behind `useSessionStatus` | `ctx.uiSession.sessionStatus` |
|
||||
| [`ui-session-status/`](ui-session-status/README.md) | Keeps reading reminders in Host memory and combines running state, the effective pending interaction, and shared reminders into the Session status table behind `useSessionStatus` | `ctx.sessionStatus` / `ctx.uiSession.sessionStatus` |
|
||||
| [`ui-theme/`](ui-theme/README.md) | Applies the selected color theme | — |
|
||||
| [`ui-primitives/`](ui-primitives/README.md) | Provides shared React controls, icons, and content renderers | — |
|
||||
| [`ui-attachment/`](ui-attachment/README.md) | Registers composer and message-image attachment presentation | — |
|
||||
|
||||
@@ -39,7 +39,7 @@ kind: "package-group"
|
||||
| [`ui-renderer/`](ui-renderer/README.zh.md) | 将 slot 数据绑定到 React,并挂载组装完成的应用 | `ctx.uiRenderer` |
|
||||
| [`ui-slots/`](ui-slots/README.zh.md) | 定义类型化扩展 Slots 与可复用 Component Factory | — |
|
||||
| [`ui-session/`](ui-session/README.zh.md) | 把会话控制器状态适配为标准 Slot source 与钩子 | — |
|
||||
| [`ui-session-status/`](ui-session-status/README.zh.md) | 把运行状态、生效的待交互请求和完成提醒汇总为会话状态表,并通过 `useSessionStatus` 提供 | `ctx.uiSession.sessionStatus` |
|
||||
| [`ui-session-status/`](ui-session-status/README.zh.md) | 在宿主内存中保存阅读提醒,并把运行状态、生效的待交互请求和共享提醒汇总为会话状态表,通过 `useSessionStatus` 提供 | `ctx.sessionStatus` / `ctx.uiSession.sessionStatus` |
|
||||
| [`ui-theme/`](ui-theme/README.zh.md) | 应用所选颜色主题 | — |
|
||||
| [`ui-primitives/`](ui-primitives/README.zh.md) | 提供共享 React 控件、图标与内容渲染器 | — |
|
||||
| [`ui-attachment/`](ui-attachment/README.zh.md) | 注册输入框与消息图片的附件呈现 | — |
|
||||
|
||||
@@ -95,7 +95,7 @@ it('fails closed on stream loss and accepts a fresh policy after reconnection',
|
||||
const b = await setup()
|
||||
b.options().open(new AbortController().signal)
|
||||
expect(b.options().ended(true).message).toContain('policy stream ended')
|
||||
b.options().carrierFailed?.(new Error('offline'))
|
||||
b.options().carrierFailed?.(Object.assign(new Error('offline'), { code: 'gateway/carrier-lost' as const }))
|
||||
expect(b.ctx.productAnalytics.enabled).toBe(false)
|
||||
await b.policy(true)
|
||||
await b.fail()
|
||||
|
||||
@@ -297,7 +297,9 @@ it('clears notifications and stops polling when the account carrier fails', asyn
|
||||
const open = c.ctx.remote.$stream.bind(c.ctx.remote)
|
||||
let fail: (() => void) | undefined
|
||||
vi.spyOn(c.ctx.remote, '$stream').mockImplementation((options) => {
|
||||
if (options.name === 'account') fail = () => { options.carrierFailed?.(new Error('connection lost')) }
|
||||
if (options.name === 'account') fail = () => {
|
||||
options.carrierFailed?.(Object.assign(new Error('connection lost'), { code: 'gateway/carrier-lost' as const }))
|
||||
}
|
||||
return open(options)
|
||||
})
|
||||
await c.reload(SELF)
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
en: d152484eb41ac6b4
|
||||
zh: 09388d293f9be9cb
|
||||
/deepseek-ai-dsh-client-ui-agent-team/use-this-package:
|
||||
en: d502ab38773eef34
|
||||
zh: e1f9c4edbc74c38f
|
||||
en: ffbcd39a17cd2fb1
|
||||
zh: db21ca6ca1cdf853
|
||||
/deepseek-ai-dsh-client-ui-agent-team/use-this-package/inspect-the-task-board:
|
||||
en: 2f606827b3ab14bc
|
||||
zh: 7f713d10268e7498
|
||||
/deepseek-ai-dsh-client-ui-agent-team/understand-the-implementation:
|
||||
en: 9b0b6a8505a9ebbf
|
||||
zh: beb5d89f80463b3e
|
||||
en: 24377b9e51d557de
|
||||
zh: 9205961784386745
|
||||
/deepseek-ai-dsh-client-ui-agent-team/further-exploration:
|
||||
en: 4d9214370681b02e
|
||||
zh: 4acb21b9ecf25e85
|
||||
|
||||
@@ -25,7 +25,7 @@ This package displays shared tasks below the Subagent tree in one header panel.
|
||||
<a id="use-this-package"></a>
|
||||
## Use this package
|
||||
|
||||
In the root conversation’s model and reasoning menu, turn on **Enable agent teamwork**. New Sessions default to off. While enabled, open the root conversation’s Subagent control to see members above shared tasks. Child conversations keep subagent navigation without a task board or Team switch, including before their subagent address is discovered. The entry is hidden when both the subagent catalog and shared tasks are empty; catalog and task-record errors remain accessible. Section headers appear only when Team mode is enabled, at least one nondeleted shared task exists, and the task footer is available. In that case, the noncollapsible Subagents section remains above shared tasks even when its catalog is empty. Otherwise, the menu shows only subagent navigation, without section headers, a shared-task module, empty-state copy, or a divider. Turning it off retains tasks and subagents. The entire Team row highlights on hover and toggles the selection when clicked, except for its independent information button. The switch calls `remote.agentTeams.setEnabled`, waits for the saved projection and reports failures through the menu host; the row cannot toggle while locked or saving. The adjacent information button explains shared-task coordination and additional token use on hover, keyboard focus, or click/tap without changing the selection. Escape or an outside press dismisses the explanation.
|
||||
In the root conversation’s model and reasoning menu, select **Agent teamwork** to open its settings pane, then turn on **Enable agent teamwork**. The root row shows the saved On/Off state without changing it. The settings pane shows the switch above the shared-task coordination, complex-task results, and token-cost explanation as ordinary text that describes the switch, without an information tooltip. Opening the pane focuses the enabled switch. New Sessions default to off. While enabled, open the root conversation’s Subagent control to see members above shared tasks. Child conversations keep subagent navigation without a task board or Team switch, including before their subagent address is discovered. The entry is hidden when both the subagent catalog and shared tasks are empty; catalog and task-record errors remain accessible. Section headers appear only when Team mode is enabled, at least one nondeleted shared task exists, and the task footer is available. In that case, the noncollapsible Subagents section remains above shared tasks even when its catalog is empty. Otherwise, the menu shows only subagent navigation, without section headers, a shared-task module, empty-state copy, or a divider. Turning it off retains tasks and subagents. The entire switch row highlights on hover and toggles the selection when clicked. The switch calls `remote.agentTeams.setEnabled`, waits for the saved projection and reports failures through the menu host; the row cannot toggle while locked or saving.
|
||||
|
||||
Turning off the menu switch requires confirmation after the Session records a model request; a model choice alone does not require it. The switch waits while request history is unavailable. The dialog explains the tool, coordination, and possible cache effects without deleting task records. Cancel, Escape, or closing the dialog leaves Team mode unchanged. Dismissing the dialog returns focus to the model selector. Confirmation targets the originating Session, waits for the save, and keeps failures visible for retry; it does not depend on the model menu remaining open. Team mode has no slash command; menu changes create no `command/run` or `command/done` records.
|
||||
|
||||
@@ -47,7 +47,7 @@ The noncollapsible Shared tasks header uses a Checklist icon and completed, in-p
|
||||
<details>
|
||||
<summary>Implementation internals — click to expand</summary>
|
||||
|
||||
The Client export registers its locale dictionaries and subagent-catalog and model-menu slots through Cordis effects; it mounts no Remote namespace. Disposing the plugin fiber removes its registrations.
|
||||
The Client export registers its locale dictionaries and subagent-catalog and model-menu slots through Cordis effects; it mounts no Remote namespace. The [model menu](../ui-model-selection/README.md#use-this-package) owns pane navigation and focus return; Team contributes the root summary through `conversation.input.model.options` and settings through `conversation.input.model.pane` with key `agent-team`. Disposing the plugin fiber removes its registrations.
|
||||
|
||||
The Subagent catalog owns the shared panel, scrolling, hover, keyboard, and dismissal interactions. This package contributes the task section only below the root conversation’s tree. The board reads the current Session’s mode and tasks through `useProjection('agentTeam')`. An available, enabled projection supplies the task section only when it contains nondeleted tasks; a projection failure can render independently without a task section. Task IDs, dependencies, readiness, write scopes, and write scope warnings remain in task data but are not displayed as detail fields; blocked pending tasks still use the warning glyph.
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ kind: "package-reference"
|
||||
<a id="use-this-package"></a>
|
||||
## 使用本包
|
||||
|
||||
在根会话的模型与推理等级菜单中打开**启用智能体团队协作**。新 Session 默认关闭。开启后,通过根会话的 Subagent 入口同时查看上方的成员树和下方的共享任务。子会话保留子智能体导航,不显示任务板或 Team 开关,包括尚未发现子代理地址时。子智能体目录和共享任务都为空时隐藏入口;目录或任务记录错误仍保留查看入口。仅当 Team 模式已开启、存在至少一个未删除的共享任务且任务 footer 可用时,才显示区域标题。此时即使目录为空,共享任务上方仍保留不可折叠的“子智能体”区域。其他情况下,菜单仅显示 subagent 导航,不显示区域标题、共享任务模块、空状态文案或分隔线。关闭后保留任务和子代理。团队设置整行在悬停时高亮,点击可切换状态,但独立的信息按钮除外。开关调用 `remote.agentTeams.setEnabled`,等待保存后的投影更新,失败由菜单宿主提示;锁定或保存中不能通过整行切换。旁边的信息按钮可通过悬停、键盘聚焦或点击/轻触查看共享任务协作与额外 token 消耗的说明,不改变开关状态。按 Escape 或点击外部可关闭说明。
|
||||
在根会话的模型与推理等级菜单中选择**智能体团队协作**,进入二级设置面板后打开**开启智能体团队协作**。一级行显示已保存的开启/关闭状态,不改变选择。设置面板将开关放在共享任务协调、复杂任务效果与 token 开销的说明上方;说明使用普通正文,并作为开关的描述,不使用信息 tooltip。打开设置面板时聚焦可用的开关。新 Session 默认关闭。开启后,通过根会话的 Subagent 入口同时查看上方的成员树和下方的共享任务。子会话保留子智能体导航,不显示任务板或 Team 开关,包括尚未发现子代理地址时。子智能体目录和共享任务都为空时隐藏入口;目录或任务记录错误仍保留查看入口。仅当 Team 模式已开启、存在至少一个未删除的共享任务且任务 footer 可用时,才显示区域标题。此时即使目录为空,共享任务上方仍保留不可折叠的“子智能体”区域。其他情况下,菜单仅显示 subagent 导航,不显示区域标题、共享任务模块、空状态文案或分隔线。关闭后保留任务和子代理。开关所在整行在悬停时高亮,点击可切换状态。开关调用 `remote.agentTeams.setEnabled`,等待保存后的投影更新,失败由菜单宿主提示;锁定或保存中不能通过整行切换。
|
||||
|
||||
会话记录过模型请求后,从菜单开关停用团队需要确认;仅选择模型不会触发确认。请求历史尚未加载时,开关暂不可操作。弹窗说明工具、协作与可能的缓存影响,不会删除任务记录。取消、按 Escape 或关闭弹窗都保持团队状态不变。弹窗关闭后,焦点回到模型选择按钮。确认操作绑定到最初的会话,等待保存完成,失败时保留错误供重试,不依赖模型菜单保持打开。Team 模式没有斜杠命令;菜单切换不会生成 `command/run` 或 `command/done` 记录。
|
||||
会话记录过模型请求后,从菜单开关关闭团队需要确认;仅选择模型不会触发确认。请求历史尚未加载时,开关暂不可操作。弹窗说明工具、协作与可能的缓存影响,不会删除任务记录。取消、按 Escape 或关闭弹窗都保持团队状态不变。弹窗关闭后,焦点回到模型选择按钮。确认操作绑定到最初的会话,等待保存完成,失败时保留错误供重试,不依赖模型菜单保持打开。Team 模式没有斜杠命令;菜单切换不会生成 `command/run` 或 `command/done` 记录。
|
||||
|
||||
Chat 隐藏历史 `/team on` 和 `/team off` 记录中尚未完成或执行成功的回执。失败回执仍显示 Users 图标、本地化的“智能体团队协作”标题,以及本地化的失败前缀和已记录原因的首个非空行,不翻译原因原文。展开回执可查看完整原始错误。参数无法识别或缺失时仍显示回执。
|
||||
|
||||
@@ -47,7 +47,7 @@ Chat 隐藏历史 `/team on` 和 `/team off` 记录中尚未完成或执行成
|
||||
<details>
|
||||
<summary>实现细节——点击展开</summary>
|
||||
|
||||
Client export 通过 Cordis effect 注册语言字典、子代理目录与模型菜单 slot;它不挂载 Remote namespace。销毁插件 fiber 会移除这些注册。
|
||||
Client export 通过 Cordis effect 注册语言字典、子代理目录与模型菜单 slot;它不挂载 Remote namespace。[模型菜单](../ui-model-selection/README.zh.md#use-this-package)负责面板导航和焦点返回;Team 通过 `conversation.input.model.options` 提供一级摘要,并通过 `conversation.input.model.pane` 的 `agent-team` 键提供设置内容。销毁插件 fiber 会移除这些注册。
|
||||
|
||||
Subagent 目录负责共享面板的滚动、悬停、键盘和关闭交互。本包仅在根会话的树下方提供任务区。任务板通过 `useProjection('agentTeam')` 读取当前 Session 的模式与任务;仅当投影可用、已开启且含有未删除的任务时才显示任务区;投影错误可独立显示,不需要任务区。任务 ID、依赖、准备状态、写入范围及其提示仍保留在任务数据中,但不作为详情字段显示;被依赖阻塞的 pending 任务仍使用 warning 图标。
|
||||
|
||||
|
||||
@@ -1,3 +1,71 @@
|
||||
.summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
padding: 0 8px;
|
||||
border: 0;
|
||||
border-radius: var(--dsw-radius-md);
|
||||
background: transparent;
|
||||
color: var(--dsw-alias-label-primary);
|
||||
font-family: inherit;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: start;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.summary:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.summary:focus-visible {
|
||||
outline: none;
|
||||
background: var(--dsw-alias-interactive-bg-hover);
|
||||
}
|
||||
|
||||
.summaryLabel {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.state,
|
||||
.chevron {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.state {
|
||||
color: var(--dsw-alias-label-tertiary);
|
||||
}
|
||||
|
||||
.chevron {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
color: var(--dsw-alias-menu-icon);
|
||||
}
|
||||
|
||||
.pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin: 0;
|
||||
padding: 4px 8px;
|
||||
color: var(--dsw-alias-label-secondary);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.row {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -13,25 +81,14 @@
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.infoButton {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
flex: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
color: var(--dsw-alias-label-caption);
|
||||
}
|
||||
|
||||
/* Extend the native switch hit target without nesting the information button. */
|
||||
/* The switch owns the whole row's pointer target. */
|
||||
.row .toggle {
|
||||
position: static;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.toggle::after {
|
||||
@@ -41,11 +98,8 @@
|
||||
border-radius: var(--dsw-radius-md);
|
||||
}
|
||||
|
||||
.row:has(.toggle:focus-visible) {
|
||||
background: var(--dsw-alias-interactive-bg-hover);
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.summary:not(:disabled):hover,
|
||||
.row:has(.toggle:not(:disabled)):hover {
|
||||
background: var(--dsw-alias-interactive-bg-hover);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Session-owned Agent Teams selection in the model and reasoning menu. */
|
||||
/** Session-owned Agent Teams summary and settings inside the model menu. */
|
||||
|
||||
import { useState } from 'react'
|
||||
import { Button, IconInfoOutlineRegular, Switch, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import { useId, useState } from 'react'
|
||||
import { IconChevronRightOutlineRegular, Switch } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-model-selection/client'
|
||||
import type {} from '@deepseek-ai/dsh-agent-team/client'
|
||||
@@ -9,37 +9,72 @@ import type {} from '@deepseek-ai/dsh-agent'
|
||||
import type { NS } from './locales.ts'
|
||||
import css from './TeamModeToggle.module.css'
|
||||
|
||||
/** Session selection callbacks supplied by the Client plugin. */
|
||||
export interface TeamModeToggleInjected {
|
||||
/** Session selection callbacks supplied to the Team settings pane. */
|
||||
export interface TeamModePaneInjected {
|
||||
/** Save the selection; null means success, otherwise the string describes the failure. */
|
||||
selectTeamMode: (enabled: boolean) => Promise<string | null>
|
||||
/** Open a Session-targeted confirmation outside this menu. */
|
||||
requestDisableConfirmation: () => void
|
||||
}
|
||||
|
||||
/** Full props of the model-menu Team switch. */
|
||||
export type TeamModeToggleProps = PropsRuntime<'conversation.input.model.options'>
|
||||
& PropsLocale<typeof NS> & TeamModeToggleInjected
|
||||
/** Full props of the model-menu Team summary. */
|
||||
export type TeamModeToggleProps = PropsRuntime<'conversation.input.model.options'> & PropsLocale<typeof NS>
|
||||
|
||||
/** Full props of the model-menu Team settings pane. */
|
||||
export type TeamModePaneProps = PropsRuntime<'conversation.input.model.pane'>
|
||||
& PropsLocale<typeof NS> & TeamModePaneInjected
|
||||
|
||||
/**
|
||||
* Render the saved selection without an optimistic update.
|
||||
* @param props - Session projection, menu state, localized copy, and selection callback.
|
||||
* @returns the Team switch when the capability projection is available.
|
||||
* Show the saved Team state and open its settings without changing the mode.
|
||||
* @param props - Session projection, pane navigation, and locale.
|
||||
* @returns the summary when Team mode is available on a root Session.
|
||||
*/
|
||||
export function TeamModeToggle(props: TeamModeToggleProps) {
|
||||
const addressedChild = props.useSession(snapshot => snapshot.subagent !== null)
|
||||
const listedChild = props.useSessions(state => state.byId[props.sessionId]?.origin === 'subagent')
|
||||
if (addressedChild || listedChild) return null
|
||||
return <RootTeamModeToggle {...props} />
|
||||
return <RootTeamModeSummary {...props} />
|
||||
}
|
||||
|
||||
function RootTeamModeSummary({ useProjection, locked, openPane, t }: TeamModeToggleProps) {
|
||||
const mode = useProjection('agentTeam')
|
||||
if (mode === undefined) return null
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
role="menuitem"
|
||||
className={css.summary}
|
||||
data-model-menu-pane="agent-team"
|
||||
disabled={locked}
|
||||
onClick={() => { openPane({ key: 'agent-team', title: t('command.title') }) }}
|
||||
>
|
||||
<span className={css.summaryLabel}>{t('command.title')}</span>
|
||||
<span className={css.state}>{t(mode.enabled ? 'mode.on' : 'mode.off')}</span>
|
||||
<IconChevronRightOutlineRegular className={css.chevron} aria-hidden="true" />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the explanation and persisted Team switch for a root Session.
|
||||
* @param props - Session projections, mode operations, menu dismissal, and locale.
|
||||
* @returns the Team settings content when its projection is available.
|
||||
*/
|
||||
export function TeamModePane(props: TeamModePaneProps) {
|
||||
const addressedChild = props.useSession(snapshot => snapshot.subagent !== null)
|
||||
const listedChild = props.useSessions(state => state.byId[props.sessionId]?.origin === 'subagent')
|
||||
if (addressedChild || listedChild) return null
|
||||
return <RootTeamModePane {...props} />
|
||||
}
|
||||
|
||||
/** Read and change the selection only for root Sessions. */
|
||||
function RootTeamModeToggle({
|
||||
function RootTeamModePane({
|
||||
useProjection, locked, dismiss, reportFailure, selectTeamMode, requestDisableConfirmation, t,
|
||||
}: TeamModeToggleProps) {
|
||||
}: TeamModePaneProps) {
|
||||
const mode = useProjection('agentTeam')
|
||||
const modelSelection = useProjection('modelSelection')
|
||||
const [pending, setPending] = useState(false)
|
||||
const descriptionId = useId()
|
||||
if (mode === undefined) return null
|
||||
const select = (enabled: boolean): void => {
|
||||
if (!enabled && modelSelection !== undefined && modelSelection.lastUsed !== null) {
|
||||
@@ -55,16 +90,12 @@ function RootTeamModeToggle({
|
||||
}).finally(() => { setPending(false) })
|
||||
}
|
||||
return (
|
||||
<div className={css.row}>
|
||||
<span className={css.label}>
|
||||
<span>{t('mode.label')}</span>
|
||||
<Tooltip label={t('mode.description')} side="top" delayMs={300} maxWidth={300} portal openOnClick>
|
||||
<Button variant="ghost" size="sm" className={css.infoButton} aria-label={t('mode.infoLabel')}>
|
||||
<IconInfoOutlineRegular size={11} aria-hidden="true" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</span>
|
||||
<Switch className={css.toggle} checked={mode.enabled} disabled={locked || pending || modelSelection === undefined} label={t('mode.label')} onChange={select} />
|
||||
<div className={css.pane}>
|
||||
<div className={css.row}>
|
||||
<span className={css.label}>{t('mode.label')}</span>
|
||||
<Switch className={css.toggle} checked={mode.enabled} disabled={locked || pending || modelSelection === undefined} label={t('mode.label')} onChange={select} autoFocus describedBy={descriptionId} />
|
||||
</div>
|
||||
<p id={descriptionId} className={css.description}>{t('mode.description')}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -14,15 +14,16 @@ export const zh = {
|
||||
'command.failed': '执行失败',
|
||||
'command.failedReason': '执行失败:{reason}',
|
||||
trigger: '任务板',
|
||||
'mode.label': '启用智能体团队协作',
|
||||
'mode.infoLabel': '关于智能体团队协作',
|
||||
'mode.label': '开启智能体团队协作',
|
||||
'mode.on': '开启',
|
||||
'mode.off': '关闭',
|
||||
'mode.description': '通过共享任务板协调多个智能体的分工与进度,复杂任务表现更佳,token 开销也相应更高。',
|
||||
'mode.failed': '无法确认智能体团队协作设置已保存,请重试:{message}',
|
||||
'disable.title': '确认停用智能体团队协作?',
|
||||
'disable.description': '对话过程中停用智能体团队协作,将停止共享任务工具和团队协调指令。',
|
||||
'disable.warning': '停用后可能影响缓存复用、增加后续 token 用量与开销,并影响当前任务的协作效果。',
|
||||
'disable.title': '确认关闭智能体团队协作?',
|
||||
'disable.description': '对话过程中关闭智能体团队协作,将停止共享任务工具和团队协调指令。',
|
||||
'disable.warning': '关闭后可能影响缓存复用、增加后续 token 用量与开销,并影响当前任务的协作效果。',
|
||||
'disable.cancel': '取消',
|
||||
'disable.confirm': '确认停用',
|
||||
'disable.confirm': '确认关闭',
|
||||
'disable.close': '关闭',
|
||||
loading: '正在加载任务板…',
|
||||
unavailable: '任务板暂不可用',
|
||||
@@ -52,7 +53,8 @@ export const en = {
|
||||
'command.failedReason': 'Failed: {reason}',
|
||||
trigger: 'Task board',
|
||||
'mode.label': 'Enable agent teamwork',
|
||||
'mode.infoLabel': 'About agent teamwork',
|
||||
'mode.on': 'On',
|
||||
'mode.off': 'Off',
|
||||
'mode.description': 'Coordinate work and progress across agents with a shared task board for better results on complex tasks, with correspondingly higher token costs.',
|
||||
'mode.failed': 'Could not confirm the agent teamwork setting was saved. Try again: {message}',
|
||||
'disable.title': 'Disable agent teamwork?',
|
||||
@@ -85,7 +87,8 @@ export const ja = {
|
||||
'command.failed': '実行失敗',
|
||||
'command.failedReason': '実行失敗: {reason}',
|
||||
'mode.label': 'エージェント連携を有効にする',
|
||||
'mode.infoLabel': 'エージェント連携について',
|
||||
'mode.on': 'オン',
|
||||
'mode.off': 'オフ',
|
||||
'mode.description': '共有タスクボードで複数のエージェントの分担と進捗を調整します。複雑なタスクでより良い結果が得られますが、その分トークンのコストも高くなります。',
|
||||
'mode.failed': 'エージェント連携の設定が保存されたことを確認できませんでした。再試行してください: {message}',
|
||||
'disable.title': 'エージェント連携を無効にしますか?',
|
||||
@@ -119,7 +122,8 @@ export const es = {
|
||||
'command.failed': 'Error',
|
||||
'command.failedReason': 'Error: {reason}',
|
||||
'mode.label': 'Activar colaboración entre agentes',
|
||||
'mode.infoLabel': 'Acerca de la colaboración entre agentes',
|
||||
'mode.on': 'Activada',
|
||||
'mode.off': 'Desactivada',
|
||||
'mode.description': 'Coordina el trabajo y el progreso de varios agentes mediante un tablero de tareas compartido, con mejores resultados en tareas complejas y un coste de tokens proporcionalmente mayor.',
|
||||
'mode.failed': 'No se pudo confirmar que se guardó la configuración de colaboración entre agentes. Inténtalo de nuevo: {message}',
|
||||
'disable.title': '¿Desactivar la colaboración entre agentes?',
|
||||
@@ -153,7 +157,8 @@ export const fr = {
|
||||
'command.failed': 'Échec',
|
||||
'command.failedReason': 'Échec : {reason}',
|
||||
'mode.label': 'Activer la collaboration entre agents',
|
||||
'mode.infoLabel': 'À propos de la collaboration entre agents',
|
||||
'mode.on': 'Activée',
|
||||
'mode.off': 'Désactivée',
|
||||
'mode.description': 'Coordonnez la répartition du travail et la progression de plusieurs agents via un tableau de tâches partagé, pour de meilleurs résultats sur les tâches complexes, avec un coût en tokens plus élevé en contrepartie.',
|
||||
'mode.failed': 'Impossible de confirmer l’enregistrement du réglage de collaboration entre agents. Réessayez : {message}',
|
||||
'disable.title': 'Désactiver la collaboration entre agents ?',
|
||||
@@ -187,7 +192,8 @@ export const de = {
|
||||
'command.failed': 'Fehlgeschlagen',
|
||||
'command.failedReason': 'Fehlgeschlagen: {reason}',
|
||||
'mode.label': 'Agentenzusammenarbeit aktivieren',
|
||||
'mode.infoLabel': 'Über Agentenzusammenarbeit',
|
||||
'mode.on': 'Ein',
|
||||
'mode.off': 'Aus',
|
||||
'mode.description': 'Koordiniert die Arbeitsteilung und den Fortschritt mehrerer Agenten über eine gemeinsame Aufgabenübersicht. Erzielt bessere Ergebnisse bei komplexen Aufgaben, bei entsprechend höheren Tokenkosten.',
|
||||
'mode.failed': 'Das Speichern der Einstellung zur Agentenzusammenarbeit konnte nicht bestätigt werden. Erneut versuchen: {message}',
|
||||
'disable.title': 'Agentenzusammenarbeit deaktivieren?',
|
||||
@@ -221,7 +227,8 @@ export const ru = {
|
||||
'command.failed': 'Ошибка',
|
||||
'command.failedReason': 'Ошибка: {reason}',
|
||||
'mode.label': 'Включить совместную работу агентов',
|
||||
'mode.infoLabel': 'О совместной работе агентов',
|
||||
'mode.on': 'Вкл.',
|
||||
'mode.off': 'Выкл.',
|
||||
'mode.description': 'Координируйте распределение работы и прогресс нескольких агентов с помощью общей доски задач: лучшие результаты в сложных задачах при соответственно более высоких затратах на токены.',
|
||||
'mode.failed': 'Не удалось подтвердить сохранение настройки совместной работы агентов. Повторите попытку: {message}',
|
||||
'disable.title': 'Отключить совместную работу агентов?',
|
||||
@@ -255,7 +262,8 @@ export const pt = {
|
||||
'command.failed': 'Falha',
|
||||
'command.failedReason': 'Falha: {reason}',
|
||||
'mode.label': 'Ativar colaboração entre agentes',
|
||||
'mode.infoLabel': 'Sobre a colaboração entre agentes',
|
||||
'mode.on': 'Ativada',
|
||||
'mode.off': 'Desativada',
|
||||
'mode.description': 'Coordene a divisão do trabalho e o progresso de vários agentes com um quadro de tarefas compartilhado, para melhores resultados em tarefas complexas, com custos de tokens proporcionalmente maiores.',
|
||||
'mode.failed': 'Não foi possível confirmar que a configuração de colaboração entre agentes foi salva. Tente novamente: {message}',
|
||||
'disable.title': 'Desativar a colaboração entre agentes?',
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {} from '@deepseek-ai/dsh-client-ui-model-selection/client'
|
||||
import { createSnapshotStore } from '@deepseek-ai/dsh-client-store'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
import { TeamDisableConfirmation, type TeamDisableConfirmationInjected, type TeamDisableRequest } from './TeamDisableConfirmation.tsx'
|
||||
import { TeamModeToggle, type TeamModeToggleInjected } from './TeamModeToggle.tsx'
|
||||
import { TeamModePane, TeamModeToggle, type TeamModePaneInjected } from './TeamModeToggle.tsx'
|
||||
import { TeamBoard } from './TeamBoard.tsx'
|
||||
import { TeamCommandRow } from './TeamCommandRow.tsx'
|
||||
import { en, ja, es, fr, de, ru, pt, NS, zh, type TeamKey } from './locales.ts'
|
||||
@@ -58,11 +58,14 @@ export function registerAgentTeamUi(ctx: ClientContext): void {
|
||||
name: 'conversation.input.model.options',
|
||||
id: 'agent-team',
|
||||
locale: NS,
|
||||
inject: (sessionId): TeamModeToggleInjected => ({
|
||||
}, TeamModeToggle))
|
||||
yield scope.slots.inject('conversation.input.model.pane', () => scope.slots.register({
|
||||
name: 'conversation.input.model.pane', key: 'agent-team', locale: NS,
|
||||
inject: (sessionId): TeamModePaneInjected => ({
|
||||
selectTeamMode: enabled => selectTeamMode(sessionId, enabled),
|
||||
requestDisableConfirmation: () => { disableRequest.set({ sessionId }) },
|
||||
}),
|
||||
}, TeamModeToggle))
|
||||
}, TeamModePane))
|
||||
})
|
||||
})
|
||||
ctx.slots.inject('conversation.session.header.actions.subagent.footer', () => ctx.slots.register({
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Context } from '@deepseek-ai/cordis'
|
||||
import { describe, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
||||
import { RemoteError, TestRemote } from '@deepseek-ai/dsh-client-test-runtime'
|
||||
import { TeamModeToggle, type TeamModeToggleInjected } from '../src/client/TeamModeToggle.tsx'
|
||||
import { TeamModePane, TeamModeToggle, type TeamModePaneInjected } from '../src/client/TeamModeToggle.tsx'
|
||||
import { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client'
|
||||
import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client'
|
||||
import { TeamBoard } from '../src/client/TeamBoard.tsx'
|
||||
@@ -63,21 +63,30 @@ describe('task-board browser plugin', () => {
|
||||
await b.fiber.dispose()
|
||||
})
|
||||
|
||||
it('registers the mode switch when Agent Teams arrives and reports each execution outcome', async () => {
|
||||
it('registers the summary and settings pane when Agent Teams arrives and reports each execution outcome', async () => {
|
||||
const b = await bench()
|
||||
b.ctx.slots.register({
|
||||
name: 'conversation.input.model',
|
||||
children: { 'conversation.input.model.options': { kind: 'list', scope: 'session' } },
|
||||
children: {
|
||||
'conversation.input.model.options': { kind: 'list', scope: 'session' },
|
||||
'conversation.input.model.pane': { kind: 'keyed', scope: 'session' },
|
||||
},
|
||||
} as never, () => null)
|
||||
const entry = () => b.ctx.slots.entries('conversation.input.model.options')
|
||||
.find(candidate => candidate.component === TeamModeToggle)
|
||||
const page = () => b.ctx.slots.entries('conversation.input.model.pane')
|
||||
.find(candidate => candidate.component === TeamModePane)
|
||||
expect(entry()).toBeUndefined()
|
||||
expect(page()).toBeUndefined()
|
||||
const setEnabled = vi.fn<Context['remote']['agentTeams']['setEnabled']>()
|
||||
new TestRemote(b.ctx, { agentTeams: { setEnabled } })
|
||||
await vi.waitFor(() => { expect(entry()).toBeDefined() })
|
||||
const injected = entry()!.inject as (sessionId: SessionId) => Record<string, unknown>
|
||||
await vi.waitFor(() => { expect(entry()).toBeDefined(); expect(page()).toBeDefined() })
|
||||
expect(entry()).toMatchObject({ options: { id: 'agent-team' }, locale: 'agent-team' })
|
||||
expect(entry()!.inject).toBeUndefined()
|
||||
expect(page()).toMatchObject({ options: { key: 'agent-team' }, locale: 'agent-team' })
|
||||
const injected = page()!.inject as (sessionId: SessionId) => Record<string, unknown>
|
||||
const value: object = injected(brandString<SessionId>('chosen-session'))
|
||||
const mode = value as TeamModeToggleInjected
|
||||
const mode = value as TeamModePaneInjected
|
||||
setEnabled.mockResolvedValueOnce({ ok: true, value: undefined })
|
||||
await expect(mode.selectTeamMode(true)).resolves.toBeNull()
|
||||
expect(setEnabled).toHaveBeenLastCalledWith('chosen-session', true)
|
||||
@@ -105,6 +114,7 @@ describe('task-board browser plugin', () => {
|
||||
mode.requestDisableConfirmation()
|
||||
await b.fiber.dispose()
|
||||
expect(entry()).toBeUndefined()
|
||||
expect(page()).toBeUndefined()
|
||||
expect(overlayEntry()).toBeUndefined()
|
||||
expect(request.getSnapshot()).toBeNull()
|
||||
})
|
||||
|
||||
@@ -49,8 +49,8 @@ it('renders nothing when no disable request exists', () => {
|
||||
it('shows the localized title, two paragraphs, and actions without a checkbox', () => {
|
||||
const input = props()
|
||||
render(<TeamDisableConfirmation {...input.props} />)
|
||||
const dialog = within(screen.getByRole('dialog', { name: '确认停用智能体团队协作?' }))
|
||||
expect(dialog.getByRole('heading', { name: '确认停用智能体团队协作?' })).toBeTruthy()
|
||||
const dialog = within(screen.getByRole('dialog', { name: '确认关闭智能体团队协作?' }))
|
||||
expect(dialog.getByRole('heading', { name: '确认关闭智能体团队协作?' })).toBeTruthy()
|
||||
expect(dialog.getByText(zh['disable.description'], { selector: 'p' })).toBeTruthy()
|
||||
expect(dialog.getByText(zh['disable.warning'], { selector: 'p' })).toBeTruthy()
|
||||
expect(dialog.getAllByRole('paragraph')).toHaveLength(2)
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { afterEach, expect, it, vi } from 'vitest'
|
||||
import { afterEach, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session'
|
||||
import { makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
|
||||
import { TeamModeToggle, type TeamModeToggleProps } from '../src/client/TeamModeToggle.tsx'
|
||||
import { TeamModePane, TeamModeToggle, type TeamModePaneProps, type TeamModeToggleProps } from '../src/client/TeamModeToggle.tsx'
|
||||
import { de, en, es, fr, ja, pt, ru, zh } from '../src/client/locales.ts'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
afterEach(cleanup)
|
||||
|
||||
function props(enabled: boolean | undefined, selectTeamMode = vi.fn(async () => null as string | null), child?: 'addressed' | 'listed', requestedModel: boolean | 'loading' = false): TeamModeToggleProps {
|
||||
type TestProps = TeamModePaneProps & TeamModeToggleProps
|
||||
|
||||
function props(enabled: boolean | undefined, selectTeamMode = vi.fn(async () => null as string | null), child?: 'addressed' | 'listed', requestedModel: boolean | 'loading' = false): TestProps {
|
||||
return {
|
||||
sessionId: brandString<SessionId>('root'),
|
||||
useSession: (select: (value: { subagent: object | null }) => unknown) => select({ subagent: child === 'addressed' ? {} : null }),
|
||||
@@ -21,69 +20,108 @@ function props(enabled: boolean | undefined, selectTeamMode = vi.fn(async () =>
|
||||
useProjection: (key: string) => key === 'modelSelection'
|
||||
? requestedModel === 'loading' ? undefined : { lastUsed: requestedModel ? { provider: 'mock', model: 'mock' } : null, next: { provider: 'mock', model: 'mock' } }
|
||||
: enabled === undefined ? undefined : { enabled, tasks: [] },
|
||||
locked: false, dismiss: vi.fn(), reportFailure: vi.fn(), selectTeamMode, requestDisableConfirmation: vi.fn(),
|
||||
locked: false, openPane: vi.fn(), dismiss: vi.fn(), reportFailure: vi.fn(),
|
||||
selectTeamMode, requestDisableConfirmation: vi.fn(),
|
||||
t: makeTranslate(zh),
|
||||
} as TeamModeToggleProps
|
||||
} as TestProps
|
||||
}
|
||||
|
||||
it('renders only available mode and waits for persisted state before displaying a new selection', async () => {
|
||||
let finish!: (result: string | null) => void
|
||||
const select = vi.fn(() => new Promise<string | null>((resolve) => { finish = resolve }))
|
||||
const view = render(<TeamModeToggle {...props(undefined, select)} />)
|
||||
it.each(Object.entries({ zh, en, ja, es, fr, de, ru, pt }).flatMap(([locale, dictionary]) =>
|
||||
[false, true].map(enabled => ({ locale, dictionary, enabled })),
|
||||
))('opens Team settings from the $locale summary without changing mode (enabled: $enabled)', ({ locale, dictionary, enabled }) => {
|
||||
const input = props(enabled)
|
||||
render(<TeamModeToggle {...input} t={makeTranslate(dictionary)} />)
|
||||
const summary = screen.getByRole('menuitem', { name: new RegExp(dictionary['command.title']) })
|
||||
expect(summary.textContent).toBe(dictionary['command.title'] + dictionary[enabled ? 'mode.on' : 'mode.off'])
|
||||
if (locale === 'zh') expect(summary.textContent).toBe(`智能体团队协作${enabled ? '开启' : '关闭'}`)
|
||||
expect(summary.getAttribute('data-model-menu-pane')).toBe('agent-team')
|
||||
expect(screen.queryByRole('switch')).toBeNull()
|
||||
view.rerender(<TeamModeToggle {...props(false, select)} />)
|
||||
const toggle = screen.getByRole('switch', { name: '启用智能体团队协作' })
|
||||
expect(screen.queryByRole('tooltip', { hidden: true })).toBeNull()
|
||||
expect(screen.queryByText(dictionary['mode.description'])).toBeNull()
|
||||
fireEvent.click(summary)
|
||||
expect(input.openPane).toHaveBeenCalledExactlyOnceWith({ key: 'agent-team', title: dictionary['command.title'] })
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
expect(input.requestDisableConfirmation).not.toHaveBeenCalled()
|
||||
expect(input.dismiss).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps summary state projection-owned and blocks navigation while locked', () => {
|
||||
const input = props(false)
|
||||
const view = render(<TeamModeToggle {...input} />)
|
||||
expect(screen.getByText('关闭')).toBeTruthy()
|
||||
const lockedInput = props(true)
|
||||
view.rerender(<TeamModeToggle {...lockedInput} locked />)
|
||||
expect(screen.getByText('开启')).toBeTruthy()
|
||||
const summary = screen.getByRole('menuitem')
|
||||
expect(summary.hasAttribute('disabled')).toBe(true)
|
||||
fireEvent.click(summary)
|
||||
expect(lockedInput.openPane).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('allows reading settings from the summary while model history loads', () => {
|
||||
const input = props(false, undefined, undefined, 'loading')
|
||||
render(<TeamModeToggle {...input} />)
|
||||
fireEvent.click(screen.getByRole('menuitem'))
|
||||
expect(input.openPane).toHaveBeenCalledOnce()
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it.each([false, true])('blocks repeated writes while waiting for persisted mode (enabled: %s)', async (enabled) => {
|
||||
const pending = Promise.withResolvers<string | null>()
|
||||
onTestFinished(async () => { await act(async () => { pending.resolve(null) }) })
|
||||
const select = vi.fn(() => pending.promise)
|
||||
const view = render(<TeamModePane {...props(enabled, select)} />)
|
||||
const toggle = screen.getByRole('switch', { name: '开启智能体团队协作' })
|
||||
toggle.focus()
|
||||
fireEvent.click(toggle)
|
||||
expect(select).toHaveBeenCalledWith(true)
|
||||
expect(toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(select).toHaveBeenCalledExactlyOnceWith(!enabled)
|
||||
expect(toggle.getAttribute('aria-checked')).toBe(String(enabled))
|
||||
expect(toggle.hasAttribute('disabled')).toBe(true)
|
||||
await act(async () => { finish(null) })
|
||||
view.rerender(<TeamModeToggle {...props(true, select)} />)
|
||||
expect(toggle.getAttribute('aria-checked')).toBe('true')
|
||||
fireEvent.click(toggle)
|
||||
fireEvent.click(toggle)
|
||||
expect(select).toHaveBeenCalledTimes(1)
|
||||
await act(async () => { pending.resolve(null) })
|
||||
expect(toggle.getAttribute('aria-checked')).toBe(String(enabled))
|
||||
expect(toggle.hasAttribute('disabled')).toBe(false)
|
||||
view.rerender(<TeamModePane {...props(!enabled, select)} />)
|
||||
expect(toggle.getAttribute('aria-checked')).toBe(String(!enabled))
|
||||
})
|
||||
|
||||
it.each(['returned', 'error', 'string'])('reports rejected mode writes through the menu host (%s)', async (failure) => {
|
||||
const p = props(false, vi.fn(async () => {
|
||||
const input = props(false, vi.fn(async () => {
|
||||
if (failure === 'error') throw new Error('offline')
|
||||
if (failure === 'string') throw 'offline'
|
||||
return 'offline'
|
||||
}))
|
||||
render(<TeamModeToggle {...p} />)
|
||||
await act(async () => { fireEvent.click(screen.getByRole('switch')) })
|
||||
expect(p.reportFailure).toHaveBeenCalledWith(expect.stringContaining('offline'))
|
||||
render(<TeamModePane {...input} />)
|
||||
const toggle = screen.getByRole('switch')
|
||||
toggle.focus()
|
||||
await act(async () => { fireEvent.click(toggle) })
|
||||
expect(input.reportFailure).toHaveBeenCalledWith(expect.stringContaining('offline'))
|
||||
expect(screen.getByRole('switch').getAttribute('aria-checked')).toBe('false')
|
||||
expect(screen.getByRole('switch').hasAttribute('disabled')).toBe(false)
|
||||
})
|
||||
|
||||
it.each(Object.entries({ zh, en, ja, es, fr, de, ru, pt }).flatMap(([locale, dictionary]) =>
|
||||
[false, true].map(locked => ({ locale, dictionary, locked })),
|
||||
))('opens the $locale explanation without changing Team mode (locked: $locked)', ({ dictionary, locked }) => {
|
||||
vi.stubGlobal('ResizeObserver', class {
|
||||
observe() {}
|
||||
unobserve() {}
|
||||
disconnect() {}
|
||||
})
|
||||
))('shows the full $locale explanation in the settings pane (locked: $locked)', ({ dictionary, locked }) => {
|
||||
const input = props(false)
|
||||
render(<TeamModeToggle {...input} locked={locked} t={makeTranslate(dictionary)} />)
|
||||
const info = screen.getByRole('button', { name: dictionary['mode.infoLabel'] })
|
||||
expect(info.hasAttribute('disabled')).toBe(false)
|
||||
fireEvent.click(info)
|
||||
const tooltip = screen.getByRole('tooltip', { hidden: true })
|
||||
expect(tooltip.textContent).toBe(dictionary['mode.description'])
|
||||
expect(info.getAttribute('aria-describedby')).toBe(tooltip.id)
|
||||
expect(document.body.contains(tooltip)).toBe(true)
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
expect(screen.getByRole('switch').getAttribute('aria-checked')).toBe('false')
|
||||
fireEvent.keyDown(info, { key: 'Escape' })
|
||||
expect(screen.queryByRole('tooltip', { hidden: true })).toBeNull()
|
||||
fireEvent.click(info)
|
||||
fireEvent.pointerDown(document.body)
|
||||
render(<TeamModePane {...input} locked={locked} t={makeTranslate(dictionary)} />)
|
||||
const description = screen.getByText(dictionary['mode.description'], { exact: true })
|
||||
expect(description.tagName).toBe('P')
|
||||
expect(screen.queryByRole('tooltip', { hidden: true })).toBeNull()
|
||||
expect(screen.queryByRole('button')).toBeNull()
|
||||
const toggle = screen.getByRole('switch', { name: dictionary['mode.label'], description: dictionary['mode.description'] })
|
||||
expect(document.activeElement === toggle).toBe(!locked)
|
||||
expect(toggle.compareDocumentPosition(description) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()
|
||||
expect(toggle.hasAttribute('disabled')).toBe(locked)
|
||||
expect(toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('requests confirmation before disabling after a recorded model request', () => {
|
||||
it('dismisses the menu before requesting disable confirmation after a recorded model request', () => {
|
||||
const input = props(true, undefined, undefined, true)
|
||||
render(<TeamModeToggle {...input} />)
|
||||
render(<TeamModePane {...input} />)
|
||||
fireEvent.click(screen.getByRole('switch'))
|
||||
expect(input.dismiss).toHaveBeenCalledOnce()
|
||||
expect(input.dismiss).toHaveBeenCalledBefore(vi.mocked(input.requestDisableConfirmation))
|
||||
@@ -94,39 +132,52 @@ it('requests confirmation before disabling after a recorded model request', () =
|
||||
|
||||
it.each([false, true])('enables directly regardless of model history (requested: %s)', async (requested) => {
|
||||
const input = props(false, undefined, undefined, requested)
|
||||
render(<TeamModeToggle {...input} />)
|
||||
render(<TeamModePane {...input} />)
|
||||
await act(async () => { fireEvent.click(screen.getByRole('switch')) })
|
||||
expect(input.selectTeamMode).toHaveBeenCalledWith(true)
|
||||
expect(input.requestDisableConfirmation).not.toHaveBeenCalled()
|
||||
expect(input.dismiss).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('disables directly when a model is selected but no request has been recorded', async () => {
|
||||
const input = props(true)
|
||||
render(<TeamModeToggle {...input} />)
|
||||
render(<TeamModePane {...input} />)
|
||||
await act(async () => { fireEvent.click(screen.getByRole('switch')) })
|
||||
expect(input.selectTeamMode).toHaveBeenCalledWith(false)
|
||||
expect(input.requestDisableConfirmation).not.toHaveBeenCalled()
|
||||
expect(input.dismiss).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('waits for model history before allowing the switch to change', () => {
|
||||
it('waits for model history before allowing the settings switch to change', () => {
|
||||
const input = props(true, undefined, undefined, 'loading')
|
||||
render(<TeamModeToggle {...input} />)
|
||||
render(<TeamModePane {...input} />)
|
||||
expect(screen.getByRole('switch').hasAttribute('disabled')).toBe(true)
|
||||
fireEvent.click(screen.getByRole('switch'))
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
expect(input.requestDisableConfirmation).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('disables selection while the Session is locked', () => {
|
||||
render(<TeamModeToggle {...props(false)} locked />)
|
||||
expect(screen.getByRole('switch').hasAttribute('disabled')).toBe(true)
|
||||
it.each([
|
||||
{ name: 'summary', Component: TeamModeToggle },
|
||||
{ name: 'settings pane', Component: TeamModePane },
|
||||
])('hides the $name until the Team projection is available', ({ Component }) => {
|
||||
const { container } = render(<Component {...props(undefined)} />)
|
||||
expect(container.textContent).toBe('')
|
||||
expect(screen.queryByRole('menuitem')).toBeNull()
|
||||
expect(screen.queryByRole('switch')).toBeNull()
|
||||
})
|
||||
|
||||
it.each(['addressed', 'listed'] as const)('hides the switch on a child Session (%s)', (source) => {
|
||||
const input = props(false, undefined, source)
|
||||
const useProjection = vi.fn((): never => { throw new Error('Child must not read Team mode') })
|
||||
render(<TeamModeToggle {...input} useProjection={useProjection} />)
|
||||
expect(screen.queryByRole('switch')).toBeNull()
|
||||
expect(useProjection).not.toHaveBeenCalled()
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
})
|
||||
it.each([
|
||||
{ name: 'summary', Component: TeamModeToggle },
|
||||
{ name: 'settings pane', Component: TeamModePane },
|
||||
].flatMap(entry => (['addressed', 'listed'] as const).map(child => ({ ...entry, child }))))(
|
||||
'hides the $name on a $child child Session', ({ Component, child }) => {
|
||||
const input = props(false, undefined, child)
|
||||
const useProjection = vi.fn((): never => { throw new Error('Child must not read Team mode') })
|
||||
const { container } = render(<Component {...input} useProjection={useProjection} />)
|
||||
expect(container.textContent).toBe('')
|
||||
expect(useProjection).not.toHaveBeenCalled()
|
||||
expect(input.selectTeamMode).not.toHaveBeenCalled()
|
||||
expect(input.openPane).not.toHaveBeenCalled()
|
||||
},
|
||||
)
|
||||
@@ -19,7 +19,7 @@
|
||||
"path": "../../api/session-controller/tsconfig.client.json"
|
||||
},
|
||||
{
|
||||
"path": "../ui-session-status"
|
||||
"path": "../ui-session-status/tsconfig.client.json"
|
||||
},
|
||||
{
|
||||
"path": "../../api/workspace-controller/tsconfig.client.json"
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
en: 7f20428c747ff052
|
||||
zh: 975e6de728e02fa0
|
||||
/deepseek-ai-dsh-client-ui-model-selection/use-this-package/selection-failures:
|
||||
en: 80fc237fa5c829f7
|
||||
zh: ecff5c8526f45996
|
||||
en: b4c2e8c1f7ab4de5
|
||||
zh: 5dd0e14aa5f9d334
|
||||
/deepseek-ai-dsh-client-ui-model-selection/understand-the-implementation:
|
||||
en: c1d14a925c92950f
|
||||
zh: f80f8169bc283c60
|
||||
|
||||
Loaded 100 of 338 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user