Merge branch 'feat/mcp-oauth' into feat/mcp-tool-loading

This commit is contained in:
gengruilin committed 2026-11-08 22:05:57 +08:00
commit 1dbb64d456
811 files changed
+18401 -23577

No files matched your search

@@ -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: c787fba8731ac147
zh: 21b5968ae6f8cd59
en: 86c5566581c1d3d6
zh: 3cb71fbb97bdb291
/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 denial, wrapper failure, 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 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.
### Pre-aborted entry short-circuits after materialization
@@ -32,7 +32,7 @@ Status: implemented
`ABORTED_BEFORE_DISPATCH` 携带 `{ name: 'AbortError' }` 和模型可见文本 `Error: tool call aborted before dispatch`。凡取消阻止工具主体调用时都使用该结果,包括进入时已中止、前置策略或审批期间取消、包装层信号已中止、包装层在委托前返回的成功结果被调用方取消抢先,以及轮次取消后 agent loop(智能体循环)跳过的同批调用。
`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。拒绝、包装层失败、工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。
`ABORTED` 携带模型可见文本 `Error: tool call aborted`,并且只在工具主体已经调用后使用,包括工具主体完成后环绕包装层或后置策略监听器等待期间发生的取消。已开始的工具主体抛出 signal 的 reason,或不具备 `HarnessError` 身份、name 为 `AbortError` 的 `Error` 时,结果保留该 message,并携带 `{ name: 'AbortError', code: 'ABORTED' }`。拒绝、包装层失败、其他工具失败或后置策略失败比通用取消更具体。timeout-policy 自身拥有的超时仍为 `TOOL_TIMEOUT`,成功结果被取消替换前延后附加的上下文仍会保留。
### 进入时已中止会在物化后短路
@@ -9,8 +9,8 @@
en: a22ddcfb339e503d
zh: a1f4fadb46fce1e7
/agent-note-native-cua-objects-independent-of-evaluator-ownership/decision:
en: 2780d1b0f5ce9ea8
zh: ff986f8c1c90300f
en: 176a9c2f6040f2a1
zh: 2617ec13d25de998
/agent-note-native-cua-objects-independent-of-evaluator-ownership/alternatives-considered:
en: 3d0bc77e3c432cb9
zh: 50a20eda1811f16c
@@ -16,13 +16,13 @@ The experimental CUA package owns a native-app subset of the Codex-style object
The facade accepts an operation dispatcher. Its tool adapter resolves the current tool binding for each operation, preserving normal authorization, logging and image admission. The execution host owns variable persistence and completion serialization. CUA defines no persistence directive, worker or run_code replacement.
Native process ownership follows the [shared helper decision](2026-10-09-cua-shared-native-helper.md), with isolated Agent connections. App handles bind process identity and kernel start time; replacing the process or helper never revives old handles. AX snapshots are scoped to an app and optional window, so independent window observations remain usable. Coordinate actions select an owned window; the Host maps [screenshot coordinates](2026-10-13-cua-hover-routes-and-coordinates.md) to native window-local points. Keyboard input remains app-scoped because macOS delivers it to the app's current focus.
Native process ownership follows the [shared helper decision](2026-10-09-cua-shared-native-helper.md), with isolated Agent connections. App handles bind process identity and kernel start time; replacing the process or helper never revives old handles. The native helper retains per-app and per-window snapshots. The [object API](2026-11-05-cua-scoped-surfaces-and-input.md) keeps the latest successful observation per application handle. Coordinate actions select an owned window; the Host maps [screenshot coordinates](2026-10-13-cua-hover-routes-and-coordinates.md) to native window-local points. Providers declare keyboard scopes in `keyboard`. macOS supports keyboard input at the application's current focus.
The operation schema owns shared data declarations. Host-only limits and launch continuations remain separate from model parameters, and generated native field/enum tables preserve independent native admission without hand-maintained copies. Native code continues to own system calls, permissions and cancellation. AX formatting consumes immutable observations; the walker retains sole ownership of indices and AX references.
Clipboard paste is distinct from Unicode key input: Return and Tab key events can trigger actions instead of inserting clipboard content. Pasteboard access runs on the AppKit main actor and retains promised data until a reader requests it. AX command completion alone does not establish that the application has fetched the data. Restoration checks ownership before replacing contents; the caller still verifies the application result. After successful command dispatch, `pasteReadTimeoutMs` bounds waiting for a data request, with a default of 1000 ms. Expiry returns `PASTE_NOT_CONSUMED`, closes the data provider against late delivery, and restores the clipboard only while still owned. The failure reports no read within that interval; it does not prove the application will never process its queued Paste command. A delayed command may read restored clipboard contents, so callers inspect the target and never retry automatically. Foreground-dependent consumption was observed in the installed ChatGPT/Codex application (`com.openai.codex`); other applications need their own validation. Guidance presents this as an example and applies recovery instructions to any `PASTE_NOT_CONSUMED` result.
CUA registers its own Harness tool and returns operation values directly. Screenshot capture requires a resolved image-capable model and the shared attachment service. The tool admits each screenshot once and renders its durable image reference; the object API, combined observation and image sink retain the same `CuaScreenshot` containing encoded `bytes`, `mimeType`, `pixelWidth`, `pixelHeight` and `windowId` from the validated screenshot result. The bridge preserves this metadata without another upload or image emission. Callers use the reported format and dimensions when saving or declaring images.
CUA registers its own Harness tool and returns operation values directly. Screenshot capture requires a resolved image-capable model and the shared attachment service. The tool admits each screenshot once and renders its durable image reference; the window object and image sink retain the same `CuaScreenshot` containing encoded `bytes`, `mimeType`, `pixelWidth`, `pixelHeight` and `windowId` from the validated screenshot result. The bridge preserves this metadata without another upload or image emission. Callers use the reported format and dimensions when saving or declaring images.
## Alternatives considered
@@ -16,13 +16,13 @@ Computer-use 程序需要一致的应用和窗口操作。将这些操作与 CUA
对象接口接收操作分派器。工具适配模块每次操作都获取当前工具绑定,保留标准授权、日志和图片接入。执行宿主负责变量持久化和最终表达式值的序列化。CUA 不定义持久化指令、执行 worker 或 run_code 替代实现。
原生进程归属遵循[共享 helper 决策](2026-10-09-cua-shared-native-helper.zh.md),Agent 连接保持隔离。应用句柄绑定进程身份及内核启动时间,替换进程或辅助进程不会使旧句柄重新有效。AX 快照按应用和可选窗口保存,不同窗口的观察可以分别使用。坐标操作选择属于该应用的窗口;Host 按[截图坐标规则](2026-10-13-cua-hover-routes-and-coordinates.zh.md)换算为原生窗口内 point。键盘输入保持应用范围,因为 macOS 将其送往应用的当前焦点。
原生进程归属遵循[共享 helper 决策](2026-10-09-cua-shared-native-helper.zh.md),Agent 连接保持隔离。应用句柄绑定进程身份及内核启动时间,替换进程或辅助进程不会使旧句柄重新有效。原生 helper 按应用和可选窗口保存快照。[对象 API](2026-11-05-cua-scoped-surfaces-and-input.zh.md) 为每个应用句柄保留最近一次成功读取的快照。坐标操作选择属于该应用的窗口;Host 按[截图坐标规则](2026-10-13-cua-hover-routes-and-coordinates.zh.md)换算为原生窗口内 point。提供方通过 `keyboard` 声明可用范围。macOS 仅支持向应用当前焦点发送键盘输入。
操作 schema 负责共享数据声明。Host 专属限制和启动续接与模型参数分开,生成的原生字段、枚举表保留独立原生校验,同时避免手工维护副本。系统调用、权限和取消仍由原生代码负责。AX 格式化只消费不可变观察数据,遍历器独自负责索引与 AX 引用。
剪贴板粘贴与 Unicode 按键输入分别实现,因为 Return 和 Tab 按键可能触发动作,而不是插入剪贴板内容。剪贴板访问使用 AppKit 主线程,保留延迟提供的数据直到读取方请求。AX 命令完成本身不能证明应用已取得数据。恢复前检查剪贴板归属;调用方仍需验证应用中的结果。 命令成功分派后,`pasteReadTimeoutMs` 限制等待数据请求的时间,默认 1000 毫秒。到期返回 `PASTE_NOT_CONSUMED`,关闭数据提供方以阻止迟到的数据交付,并仅在仍持有剪贴板时恢复原内容。该失败只说明这段时间内没有读取,不证明应用以后不会处理已排队的 Paste 命令。迟到的命令可能读取恢复后的剪贴板内容,因此调用方必须检查目标,不能自动重试。已安装的 ChatGPT/Codex 应用(`com.openai.codex`)已观察到依赖前台才能读取的行为,其他应用需要分别验证。指引将其写为例子,并对任何 `PASTE_NOT_CONSUMED` 结果提供恢复步骤。
CUA 注册自己的 Harness 工具,直接返回操作结果。截图要求解析到支持图片输入的模型,并提供共享附件服务。工具只接入一次截图,再渲染持久图片引用;对象 API、组合观察和图片输出回调保留同一个 `CuaScreenshot`,其中的编码 `bytes`、`mimeType`、`pixelWidth`、`pixelHeight` 和 `windowId` 来自已校验的截图结果。桥接保留这些元数据,不再次上传或输出图片。调用方落盘或声明图片时使用返回的格式和尺寸。
CUA 注册自己的 Harness 工具,直接返回操作结果。截图要求解析到支持图片输入的模型,并提供共享附件服务。工具只接入一次截图,再渲染持久图片引用;窗口对象和图片输出回调保留同一个 `CuaScreenshot`,其中的编码 `bytes`、`mimeType`、`pixelWidth`、`pixelHeight` 和 `windowId` 来自已校验的截图结果。桥接保留这些元数据,不再次上传或输出图片。调用方落盘或声明图片时使用返回的格式和尺寸。
## 考虑过的替代方案
@@ -9,8 +9,8 @@
en: cdc04139c8d69415
zh: a3fe3e78ada08d95
/agent-note-continuous-cua-hover-without-cross-call-ownership/decision:
en: a25e8c472c084852
zh: 12250574113e110a
en: d1ea8fdc05927896
zh: d3039bbb82bc949c
/agent-note-continuous-cua-hover-without-cross-call-ownership/alternatives-considered:
en: 18d917ee2e909b93
zh: 5b5ad0530f138cda
@@ -10,7 +10,7 @@ Hover interactions span movement, delayed content, observation and input inside
## Decision
App and Window expose `hover` for an observed AX element or an explicit coordinate target. It never presses a mouse button; disabled controls can use system-pointer movement. Completion, AX reads and screenshots do not restore a previous pointer position. Successive calls can visit intermediate points before entering a popup. Clicks deliver button events at their target without an off-window priming click. The [input-routing decision](2026-10-13-cua-hover-routes-and-coordinates.md) selects AX alternate UI before falling back to system movement with foreground and mouse-hit checks. It never activates or raises the app implicitly. Other input or window changes can race that check.
An explicit Window exposes `mouseMove` for coordinates or an observed element ID. The result reports `hoverRoute` and `systemPointerMoved`. It never presses a mouse button; disabled controls can use system-pointer movement. Completion, AX reads and screenshots do not restore a previous pointer position. Successive calls can visit intermediate points before entering a popup. Clicks deliver button events at their target without an off-window priming click. The [input-routing decision](2026-10-13-cua-hover-routes-and-coordinates.md) selects AX alternate UI before falling back to system movement with foreground and mouse-hit checks. It never activates or raises the app implicitly. Other input or window changes can race that check.
The [shared helper](2026-10-09-cua-shared-native-helper.md) serializes complete individual operations. It grants no application ownership across calls. Earlier arrival, a retained app object and Session lifetime do not establish task priority. Waiting for the model does not reserve the application. Explicit task coordination determines any required execution order.
@@ -10,7 +10,7 @@ Status: implemented
## 决策
App 和 Window 提供 `hover`,接受已观察的 AX 元素或显式坐标目标。悬停不按下鼠标按钮,禁用控件可使用系统鼠标移动路径。调用结束、AX 读取和截图不恢复先前的鼠标位置。进入浮层前可连续调用并经过中间位置。点击只在目标位置发送按键事件,不先在窗口外点击。 [输入路径决定](2026-10-13-cua-hover-routes-and-coordinates.zh.md)优先选择 AX 替代界面,再回退到经过前台和鼠标命中检查的系统移动,不隐式激活或抬起应用。其他输入或窗口变化仍可能与检查交错。
显式窗口提供 `mouseMove`,接受窗口坐标或已观察元素的字符串 ID,结果用 `hoverRoute` 和 `systemPointerMoved` 报告执行路径。悬停不按下鼠标按钮,禁用控件可使用系统鼠标移动路径。调用结束、AX 读取和截图不恢复先前的鼠标位置。进入浮层前可连续调用并经过中间位置。点击只在目标位置发送按键事件,不先在窗口外点击。 [输入路径决定](2026-10-13-cua-hover-routes-and-coordinates.zh.md)优先选择 AX 替代界面,再回退到经过前台和鼠标命中检查的系统移动,不隐式激活或抬起应用。其他输入或窗口变化仍可能与检查交错。
[共享 helper](2026-10-09-cua-shared-native-helper.zh.md)串行执行完整的单次操作,不分配跨调用的应用所有权。先发起请求、持有 app 对象和 Session 寿命均不代表任务优先级。等待模型期间不占用应用。需要确定执行顺序时,由明确的任务协调决定。
@@ -9,8 +9,8 @@
en: f96bf1ebc0719fb0
zh: e9a1144f0e76572d
/agent-note-background-hover-and-screenshot-coordinates/decision:
en: 0f45528ea6c5988c
zh: 9bde9df417ddb1ce
en: 6ac0b77bea25fcf7
zh: e50fec9049926fdc
/agent-note-background-hover-and-screenshot-coordinates/alternatives-considered:
en: 5fc4beaf79761c50
zh: 4948333b0020be28
@@ -12,7 +12,7 @@ Hover-only controls can sometimes be revealed without moving the user's pointer.
Native hover first uses a same-window element or ancestor advertising both `AXShowAlternateUI` and `AXShowDefaultUI`. Entering its revealed descendants preserves the parent UI; leaving restores it. An unavailable route falls back to the real system pointer. An AX action failure propagates because received effects may be uncertain. The result records the route and whether the system pointer moved. System movement requires the selected foreground app and AppKit's mouse hit test, which excludes input-transparent overlays. No route grants [cross-call ownership](2026-10-13-cua-continuous-hover.md).
Model-facing coordinate input defaults to pixels in the returned screenshot. `relative: true` accepts integer thousandths from 0 to 999 for click, hover, scroll and drag; it does not apply to AX indices. The Host owns the mapping to native window points. An application-wide observation refreshes its inventory; a scoped observation preserves other windows' image mappings. Window resizing invalidates the old image, while movement preserves local coordinates. Relative endpoints remain inside the window and do not depend on screenshot resolution.
Model-facing coordinate input defaults to pixels in the returned screenshot. `relative: true` accepts integer thousandths from 0 to 999 for `click`, `mouseMove`, `scroll` and `drag`; it does not apply to opaque element IDs. The Host owns the mapping to native window points. An application-wide observation refreshes its inventory; a scoped observation preserves other windows' image mappings. Window resizing invalidates the old image, while movement preserves local coordinates. Relative endpoints remain inside the window and do not depend on screenshot resolution.
`LlmAdapter.imageRequestTarget` exposes the same dimensions and byte target used by image serialization. DeepSeek and pi-ai share their existing projection functions with this method. Other adapters preserve normalized images unless they declare resizing. Screenshot bytes returned to programs match the request image; its durable source is admitted and stored once. The native PNG metadata is checked against decoded source dimensions before any input mapping is published.
@@ -12,7 +12,7 @@ Status: implemented
原生悬停优先寻找同一窗口内同时声明 `AXShowAlternateUI` 和 `AXShowDefaultUI` 的元素或祖先。进入其展开区域的子控件时保持父控件展开,离开后恢复。没有可用路径时回退到真实系统鼠标。AX 动作失败直接返回,因为已产生的效果可能不确定。结果记录实际路径及是否移动系统鼠标。系统移动要求所选应用处于前台,并使用 AppKit 的鼠标命中查询排除不接收输入的覆盖窗口。所有路径都遵守[跨调用不分配所有权](2026-10-13-cua-continuous-hover.zh.md)的决定。
面向模型的坐标默认使用返回截图中的像素。click、hover、scroll 和 drag 传入 `relative: true` 时接受 0~999 的千分比整数,不适用于 AX 索引。Host 负责换算原生窗口 point。应用级观察刷新窗口清单,单窗口观察保留其他窗口的图片映射。窗口尺寸变化使旧图片失效,移动窗口保留局部坐标。相对坐标的端点保持在窗口内,不随截图分辨率改变。
面向模型的坐标默认使用返回截图中的像素。`click`、`mouseMove`、`scroll` 和 `drag` 传入 `relative: true` 时接受 0~999 的千分比整数,仅用于坐标目标。Host 负责换算原生窗口 point。应用级观察刷新窗口清单,单窗口观察保留其他窗口的图片映射。窗口尺寸变化使旧图片失效,移动窗口保留局部坐标。相对坐标的端点保持在窗口内,不随截图分辨率改变。
`LlmAdapter.imageRequestTarget` 提供与图片序列化相同的尺寸和字节目标。DeepSeek 和 pi-ai 在该方法中复用已有投影函数。其他适配器除非声明缩放,否则保留归一化图片。返回程序的截图字节与模型请求图片一致,持久原图只接入并保存一次。发布输入映射前,原生 PNG 元数据必须与解码后的原图尺寸一致。
@@ -1,19 +0,0 @@
# Bilingual-pair consistency record for 2026-11-02-mcp-account-host-registry.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/architecture/2026-11-02-mcp-account-host-registry.md
/agent-note-host-registry-for-mcp-connector-accounts:
en: 6410b73bca8ec67f
zh: 458ad8ac28bb6f65
/agent-note-host-registry-for-mcp-connector-accounts/problem:
en: 6ddb656d7fed5c6b
zh: 1215584848f5214c
/agent-note-host-registry-for-mcp-connector-accounts/decision:
en: 2652049b45deb426
zh: 1e870763b05fffa2
/agent-note-host-registry-for-mcp-connector-accounts/alternatives-considered:
en: b6fe7cc1b6c30770
zh: 3c524be7ad8d0195
/agent-note-host-registry-for-mcp-connector-accounts/consequences:
en: deb811e5c448772b
zh: ba746cfafa0ff1de
@@ -1,31 +0,0 @@
# Agent Note: Host registry for MCP connector accounts
Status: implemented
English | [中文](2026-11-02-mcp-account-host-registry.zh.md)
## Problem
Connector plugins such as Linear, Notion, and Tencent Docs register an OAuth MCP server with the MCP manager on the Host and show its account on the Plugins page: a section with status and actions, a title tag, activation guidance, a sign-out confirmation, and notices. The manager already owns the authorization attempt, the grant, and the server status, and every connector needs the same surfaces. Registering each account in the browser makes each connector ship a browser half with a 41-key dictionary, 26 of whose strings are identical across connectors, and a registration that restates the server name its Host half already registered.
## Decision
The Host service `ctx.mcpAccounts` in [`@deepseek-ai/dsh-client-ui-mcp-account`](../../../../packages/client/ui-mcp-account/README.md) holds the accounts. A connector's Host row registers its server name, its bundle package, and the copy that names its service as `LocalizedText`. It registers inside `ctx.inject(['mcpAccounts'], …)`, so a profile without the registry, such as headless, loads the connector without the page. The Web app composition loads the registry.
The registry serves every account with the manager's view of its server through one `mcpAccounts` Remote; authorization, cancellation, sign-out, and restart stay on the manager's Remote, which already takes the server name. One browser half renders the surfaces of every account and keeps the state that belongs to one browser: it opens an authorization page only in the browser that started the attempt, reports notices only there, and ignores clicks while its own action is pending. The 26 shared strings live in the kit dictionary.
## Alternatives considered
**Browser registration.** Each connector's browser half registers with a browser `ctx.mcpAccounts` under its own dictionary namespace and follows the manager stream itself. That needs one browser package per connector, which only restates what its Host half registered, and one manager stream per account in each browser.
**Connector copy from a shared template.** One dictionary with the service name as a placeholder would remove the 15 connector-specific strings, but those strings differ in more than the name, such as what signing out removes, and Chinese spacing around a Latin name depends on its position. Each connector supplies them as `LocalizedText` instead.
**Actions through the registry.** The registry could route `startAuthorization` and the other actions by package. The manager's Remote already takes the server name, so routing would add a second action surface without a new check.
**A base shared with CLI accounts.** The CLI account registry also registers Host accounts for the Plugins page, but MCP accounts follow the manager's fixed authorization states while CLI accounts present each vendor's own states. A shared base would couple the two registries without removing code from either.
## Consequences
A connector ships no browser code for its account; its Host row registers the account and the kit renders it. Each browser opens one stream for all accounts, which follows one manager stream on the Host. A connector whose Host row fails to load shows no account section, while the Plugins page still lists the bundle with its load failure.
Host specs pin registration, the refusal of a second account per package or server, the merge with the manager's stream, its failure and end, and unload. Client specs pin authorization page opening in the starting browser, notices, the pending-action guard, and each account's slot registrations and their removal.
@@ -1,31 +0,0 @@
# Agent Note: MCP 连接器账号的 Host 注册表
Status: implemented
[English](2026-11-02-mcp-account-host-registry.md) | 中文
## 问题
Linear、Notion、腾讯文档等连接器插件在 Host 上向 MCP 管理器注册 OAuth MCP 服务器,并在插件页面显示其账号:带状态和操作的区块、标题标签、开启后的引导、退出登录确认和提示。管理器已经持有授权尝试、grant 和服务器状态,而每个连接器都需要同样的界面。在浏览器中注册账号,会让每个连接器都提供一个浏览器一侧:其中一份 41 个 key 的字典有 26 条文案在各连接器间完全相同,另有一次注册重复其 Host 一侧已注册的服务器名。
## 决定
[`@deepseek-ai/dsh-client-ui-mcp-account`](../../../../packages/client/ui-mcp-account/README.zh.md) 中的 Host 服务 `ctx.mcpAccounts` 保存账号。连接器的 Host 行注册其服务器名、bundle 包名,以及以 `LocalizedText` 表示的、指明其服务的文案。注册放在 `ctx.inject(['mcpAccounts'], …)` 中,因此没有注册表的 profile(如 headless)加载连接器时不带页面。Web 应用组合加载注册表。
注册表通过一个 `mcpAccounts` Remote 提供所有账号,并附上管理器对其服务器的视图;授权、取消、退出登录和重启仍走管理器的 Remote,它本来就接受服务器名。一个浏览器一侧渲染所有账号的界面,并保存属于单个浏览器的状态:只在发起尝试的浏览器中打开授权页面,只在那里报告提示,并在自身操作未完成时忽略点击。26 条共用文案放在套件字典中。
## 考虑过的替代方案
**浏览器注册。** 每个连接器的浏览器一侧以自己的字典命名空间向浏览器中的 `ctx.mcpAccounts` 注册,并自行跟随管理器流。这需要每个连接器一个浏览器包,而它只是重复其 Host 一侧已注册的内容,并且每个浏览器中每个账号各开一条管理器流。
**用共享模板生成连接器文案。** 用一份以服务名为占位符的字典可以去掉 15 条连接器专属文案,但这些文案不只服务名不同,例如退出登录会删除什么;而且中文里拉丁文名称两侧的空格取决于其位置。因此由各连接器以 `LocalizedText` 提供这些文案。
**通过注册表执行操作。** 注册表可以按包路由 `startAuthorization` 等操作。管理器的 Remote 本来就接受服务器名,路由只会多出第二个操作入口,而不增加任何检查。
**与 CLI 账号共用基座。** CLI 账号注册表同样为插件页面注册 Host 账号,但 MCP 账号遵循管理器固定的授权状态,而 CLI 账号呈现各厂商自己的状态。共用基座会把两个注册表耦合起来,却不能从任一方删去代码。
## 影响
连接器不为账号提供任何浏览器代码;其 Host 行注册账号,由套件渲染。每个浏览器为所有账号打开一条流,它在 Host 上跟随一条管理器流。Host 行加载失败的连接器不显示账号区块,而插件页面仍列出该 bundle 及其加载失败。
Host 测试固定注册、同一包或服务器的第二个账号被拒绝、与管理器流的合并及其失败和结束,以及卸载。客户端测试固定只在发起尝试的浏览器中打开授权页面、提示、未完成操作保护,以及每个账号的插槽注册及其移除。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-05-cua-scoped-surfaces-and-input.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/architecture/2026-11-05-cua-scoped-surfaces-and-input.md
/agent-note-cua-scoped-surfaces-and-separated-input-capabilities:
en: a0a2e9d0651e212f
zh: b7a2ab4092c2595b
/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/problem:
en: f72db0b79aa02fb5
zh: b91c1f177dc93ab4
/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/decision:
en: ec115e11f96ffe60
zh: c1fe9eb2866196d0
/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/alternatives-considered:
en: 32c970ae153e0f6c
zh: 8431be0a10ffed15
/agent-note-cua-scoped-surfaces-and-separated-input-capabilities/consequences:
en: 5c6ec60b77f1bff0
zh: e1ae568ef3501b7b
@@ -0,0 +1,39 @@
# Agent Note: CUA scoped surfaces and separated input capabilities
Status: implemented
English | [中文](2026-11-05-cua-scoped-surfaces-and-input.zh.md)
## Problem
Application and window objects share accessibility operations, but only an explicit window can capture or deliver pointer input. Duplicating shared methods on both factories creates two implementations to keep aligned. Moving application-only capability checks into the shared base makes window behavior depend on an application-level decision. Keyboard input has the same problem at a smaller scale: a chord string combines a key and its modifiers, and a complete-keystroke method cannot express a modifier held across calls or a standalone key-up.
## Decision
`CuaSurface` declares operations shared by application and window objects; `CuaApp` and `CuaWindow` extend it with their own operations. One base factory builds the surface, and the derived factories inject scope parameters plus `requireAccessibility` and `requireKeyboard` checks. The shared base never branches on a capability that exists only for applications.
Provider startup capabilities are static. Platform, supported methods, application-level accessibility, keyboard scopes, browser support, and coordinate space are fixed when the provider is installed. The native `getCapabilities` RPC reports runtime permissions and session lock only; `installCua` merges the two layers for the model-visible result. The neutral RPC is a common operation representation, not a capability inventory; provider guidance names the actions its platform supports.
Keyboard input keeps keys and modifiers separate: `pressKey(key, modifiers?)` presses and releases one key while holding the listed modifiers, and its keyboard modifier list is a plain string array defined by the provider. `sendKeyEvent(key, direction)` sends exactly one key-down or key-up without an implicit counterpart. A caller can therefore hold a modifier or split a gesture; neither method packs a chord string, and the shared schema does not enumerate platform key names.
Within one API instance, the object facade keeps one current accessibility snapshot per application handle, shared by every application and window object for that handle, including repeated selections of the same application. `getWindow` reads its initial tree silently; `getApp` does the same when the provider reports application-level accessibility. A later `getAccessibilityTree` read invalidates the previous snapshot before dispatch. The facade automatically attaches the latest snapshot ID to element operations; callers use element IDs from the latest tree and do not assume an older ID still identifies the same control. Element IDs are opaque provider strings. Only an explicit `CuaWindow` captures screenshots or sends pointer input. The native helper retains its own application and optional-window snapshots behind that facade; the native layer and the facade snapshot remain separate. The external runtime continues to own variable persistence and completion serialization; the facade adds no evaluator. The [native object decision](2026-09-17-experimental-cua-object-api.md) owns evaluator independence, and the [shared helper decision](2026-10-09-cua-shared-native-helper.md) owns connection lifetime.
## Alternatives considered
**Duplicate application and window methods** would give each factory its own implementation of the same accessibility operations. Every shared change would then need matching edits, and the two surfaces could accept different arguments or results. One `CuaSurface` implementation keeps that behavior single.
**An application-specific branch in the shared base** would let window objects inherit decisions and capability checks that apply only to applications. Scope factories that inject their own requirements keep the shared operations independent of which scope uses them.
**A packed chord string** requires parsing key names, separators, and plus escaping together, and it pushes platform alias normalization into the shared layer. Keystroke and direction are separate semantics: `pressKey` describes one complete keystroke, while `sendKeyEvent` describes one explicit direction. Separate key and modifier values keep those semantics without a parser.
**Platform keyboard key enumerations in the shared schema** would couple the portable operation schema to one provider's key names and require a schema change for each platform. Provider-defined strings let the provider interpret its own names while the shared schema stays neutral.
**Static capabilities reported by native** would duplicate provider configuration in the native helper and make the helper responsible for knowledge that is fixed before it starts. The helper reports runtime state; the provider owns its startup capabilities.
## Consequences
Element IDs belong to the application's current accessibility snapshot. Reading one window replaces the facade’s current snapshot for that application, so callers observe again and confirm the IDs they use. The new read does not guarantee that an old string is rejected or that an ID changes; callers must not assume an older ID still identifies the same control. Pointer input and screenshots require an explicit window object; callers enumerate windows first.
Keyboard behavior follows the provider's supported scopes. A caller that uses `sendKeyEvent` owns the down/up pairing, because the API never sends the opposite event. Keyboard modifier names are provider-defined, so the same string may have different support across providers.
Provider guidance owns the list of supported actions. Adding a method to the shared schema does not claim that every provider implements it, and the merged `getCapabilities` result remains the runtime source for permissions and session lock.
@@ -0,0 +1,39 @@
# Agent Note: CUA 作用域表面与分离的输入能力
Status: implemented
[English](2026-11-05-cua-scoped-surfaces-and-input.md) | 中文
## 问题
应用对象和窗口对象共享辅助功能操作,但只有显式窗口能截图或发送指针输入。若在两个工厂上分别复制共享方法,就会出现两套需要同步的实现。把只适用于应用的能力检查放进共享基类,会让窗口行为依赖应用级判断。键盘输入也有同样的问题:组合键字符串把按键与修饰键混在一起,完整击键方法无法表达跨调用保持修饰键或单独抬起按键。
## 决策
`CuaSurface` 声明应用对象与窗口对象共享的操作;`CuaApp` 与 `CuaWindow` 通过扩展它增加各自的操作。一个基类工厂负责构建表面,派生工厂注入作用域参数以及 `requireAccessibility`、`requireKeyboard` 检查。共享基类从不为只属于应用的能力分支。
Provider 的启动能力是静态的。平台、支持的方法、应用级辅助功能、键盘作用域、浏览器支持和坐标空间在安装 provider 时固定。原生 `getCapabilities` RPC 只报告运行时权限和会话锁定状态;`installCua` 为模型可见结果合并两层。中立的 RPC 是通用操作表示,不是能力清单;provider 指导文本说明其平台支持的动作。
键盘输入把按键与修饰键分开:`pressKey(key, modifiers?)` 在按住所列修饰键时按下并释放一个键,其键盘修饰键列表是 provider 定义的普通字符串数组。`sendKeyEvent(key, direction)` 只发送一次按下或抬起,不隐式发送相反事件。因此调用方可以保持修饰键或拆分手势;两个方法都不接受组合键字符串,共享 schema 也不枚举平台按键名。
在单个 API 实例内,对象门面按应用句柄保存一份当前辅助功能快照,该句柄的所有应用对象和窗口对象共享这份快照,包括对同一应用的重复选择。`getWindow` 静默执行首次树读取;当 provider 报告应用级辅助功能时,`getApp` 也静默读取。之后的 `getAccessibilityTree` 读取会在分派前使上一份快照失效。门面会为元素操作自动附加最新快照 ID;调用方应使用最新树中的元素 ID,不应假定旧 ID 仍指向同一控件。元素 ID 是 provider 定义的不透明字符串。只有显式 `CuaWindow` 可以截图或发送指针输入。原生 helper 在该门面之后保留自己的应用快照和可选窗口快照;原生层与门面快照相互独立。外部运行时继续负责变量持久化和最终表达式序列化;门面不加入 evaluator。[原生对象决定](2026-09-17-experimental-cua-object-api.zh.md)负责 evaluator 独立性,[共享 helper 决定](2026-10-09-cua-shared-native-helper.zh.md)负责连接生命期。
## 考虑过的替代方案
**在应用和窗口上重复方法**会让每个工厂各自实现同一套辅助功能操作。每次共享改动都需要成对修改,两个表面还可能接受不同的参数或结果。单一 `CuaSurface` 实现让这份行为只有一处。
**在共享基类中加入应用专属分支**会让窗口对象继承只适用于应用的决定和能力检查。由各作用域工厂注入自己的要求,可以让共享操作不依赖使用它的作用域。
**打包的组合键字符串**需要一起解析按键名、分隔符和加号转义,并把平台别名归一化推入共享层。击键与方向是两种语义:`pressKey` 描述一次完整击键,`sendKeyEvent` 描述一个显式方向。分开的按键和修饰键值让这些语义无需解析器。
**在共享 schema 中枚举平台键盘按键**会把可移植的操作 schema 绑定到某个 provider 的按键名,并让每个平台都修改 schema。由 provider 定义字符串,平台可以解释自己的名称,共享 schema 保持中立。
**由原生报告静态能力**会在原生 helper 中重复 provider 配置,并让 helper 负责它在启动前就固定的知识。helper 报告运行时状态;启动能力由 provider 负责。
## 影响
元素 ID 属于应用当前的辅助功能快照。读取一个窗口会替换门面对该应用的当前快照,因此调用方需要重新观察并确认要使用的 ID。新的读取不保证拒绝旧字符串,也不保证 ID 会改变;调用方不得假定旧 ID 仍指向同一控件。指针输入和截图都要求显式的窗口对象;调用方先枚举窗口。
键盘行为遵循 provider 支持的作用域。使用 `sendKeyEvent` 的调用方负责按下与抬起的配对,因为 API 从不发送相反事件。键盘修饰键名称由 provider 定义,同一字符串在不同 provider 上可能支持不同。
Provider 指导文本负责支持动作的清单。把方法加入共享 schema 并不表示每个 provider 都已实现它;合并后的 `getCapabilities` 结果仍是权限和会话锁定状态的运行时来源。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-05-harness-error-dependency-free-base.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/architecture/2026-11-05-harness-error-dependency-free-base.md
/agent-note-keep-the-harnesserror-base-in-a-dependency-free-package:
en: 6ff178be521c3318
zh: 18a9a8cc261fe975
/agent-note-keep-the-harnesserror-base-in-a-dependency-free-package/problem:
en: 29880462facde90c
zh: d07805b2000c85b1
/agent-note-keep-the-harnesserror-base-in-a-dependency-free-package/decision:
en: caec42054c040d37
zh: d726f0da57dc1e68
/agent-note-keep-the-harnesserror-base-in-a-dependency-free-package/alternatives-considered:
en: 8245e473d4e90250
zh: fe7883dfe13070a9
/agent-note-keep-the-harnesserror-base-in-a-dependency-free-package/consequences:
en: 9a577f5c3bb9fa15
zh: 4c18ec885768b9d3
@@ -0,0 +1,31 @@
# Agent Note: Keep the HarnessError base in a dependency-free package
Status: implemented
English | [中文](2026-11-05-harness-error-dependency-free-base.zh.md)
## Problem
The tool registry records a failed result's `error.name` and `error.code` only when the thrown value is `instanceof HarnessError`, so every expected failure must extend the one shared class; copying its `code` field is not enough. The [archived structured-error-taxonomy note](../../archived/architecture/2026-06-11-structured-error-taxonomy.md) placed the base in `dsh-llm` because `dsh-llm` was then a leaf that every package already imported, so the base added no dependency edge.
`dsh-llm` stopped being a leaf. `ImageBlock` references `ImageAttachmentRef` from `dsh-attachment`, and `dsh-llm` depends on `dsh-typert-protocol`. A class in either lower package cannot extend a base defined in `dsh-llm` without a TypeScript project-reference cycle, so `AttachmentError` and `RemoteError` re-implement the `code` field on plain `Error`, and tool failures that carry them persist without structured identity.
## Decision
`HarnessError` lives in `@deepseek-ai/dsh-error` (`packages/util/error`), a package with no dependencies that contains only the base class. `dsh-llm` depends on it and re-exports the same class from its entry, so existing `import { HarnessError } from '@deepseek-ai/dsh-llm'` statements keep working and both import paths name one constructor, which keeps `instanceof` checks consistent. LLM-specific failure codes and helpers such as `isHarnessError` stay in `dsh-llm`.
New code imports `HarnessError` from `dsh-error` when the importing package does not otherwise need `dsh-llm`, so a package that needs only the base takes no dependency on the LLM runtime. Packages below `dsh-llm`, such as `dsh-attachment`, can extend the base without a cycle.
## Alternatives considered
**Keep the base in `dsh-llm`.** Lower packages would keep re-implementing the field shape, and the registry would keep dropping their codes; recognizing those shapes structurally in the registry would make it trust any object with a string `code`, including Node errno values.
**Recognize specific classes in the registry.** Matching `RemoteError` or `AttachmentError` by marker would add a dependency from `dsh-tools` to each package and repeat for every new low-level error class.
**Move the base to an existing utility package.** `dsh-util-values` and `dsh-brand` have unrelated roles; a dedicated package names the role and keeps the base free of their dependencies and change history.
**Drop the `dsh-llm` re-export.** Every existing import would have to change in one step without a behavior benefit.
## Consequences
Any package can extend `HarnessError`, including packages that `dsh-llm` depends on, and the base no longer changes with the LLM runtime. The cost is one more published package and one more dependency edge for `dsh-llm`. Two import paths exist for one class; both are supported, and the error-handling rules name `dsh-error` as the home.
@@ -0,0 +1,31 @@
# Agent Note: 把 HarnessError 基类放在无依赖的包中
Status: implemented
[English](2026-11-05-harness-error-dependency-free-base.md) | 中文
## 问题
工具注册表只有在抛出值 `instanceof HarnessError` 时,才会在失败结果上记录 `error.name` 与 `error.code`,因此每种预期失败都必须继承这一个共享类;只复制它的 `code` 字段不够。[已归档的结构化错误分类决策](../../archived/architecture/2026-06-11-structured-error-taxonomy.md)把基类放在 `dsh-llm` 中,因为当时 `dsh-llm` 是所有包都已导入的叶子包,放在那里不会增加依赖边。
`dsh-llm` 后来不再是叶子包。`ImageBlock` 引用了 `dsh-attachment` 的 `ImageAttachmentRef`,`dsh-llm` 还依赖 `dsh-typert-protocol`。这两个更底层的包中的类无法继承定义在 `dsh-llm` 里的基类,否则 TypeScript 项目引用会成环,因此 `AttachmentError` 与 `RemoteError` 只能在普通 `Error` 上重复实现 `code` 字段,携带它们的工具失败在持久化时没有结构化身份。
## 决策
`HarnessError` 位于 `@deepseek-ai/dsh-error`(`packages/util/error`)。这个包没有任何依赖,只包含该基类。`dsh-llm` 依赖它,并从自身入口重新导出同一个类,因此现有的 `import { HarnessError } from '@deepseek-ai/dsh-llm'` 继续可用,两种导入路径指向同一个构造函数,`instanceof` 判断保持一致。LLM 专属的失败码以及 `isHarnessError` 等辅助函数仍留在 `dsh-llm`。
当导入方本身不需要 `dsh-llm` 时,新代码从 `dsh-error` 导入 `HarnessError`,这样只需要基类的包不必依赖 LLM 运行时。`dsh-attachment` 等位于 `dsh-llm` 之下的包可以继承该基类而不形成依赖环。
## 考虑过的替代方案
**把基类留在 `dsh-llm`。** 底层包会继续重复实现字段结构,注册表也会继续丢弃它们的 code;如果让注册表按结构识别这类对象,它就会信任任何带字符串 `code` 的对象,包括 Node errno 值。
**在注册表中识别特定类。** 按标记匹配 `RemoteError` 或 `AttachmentError` 会让 `dsh-tools` 依赖每个这样的包,而且每出现一个新的底层错误类都要重复一次。
**把基类移到现有的工具包。** `dsh-util-values` 与 `dsh-brand` 的职责与此无关;独立的包能准确命名职责,也让基类不受它们的依赖与变更历史影响。
**去掉 `dsh-llm` 的重新导出。** 所有现有导入都得一次性修改,却不带来任何行为收益。
## 后果
任何包都可以继承 `HarnessError`,包括 `dsh-llm` 所依赖的包,基类也不再随 LLM 运行时一起变更。代价是多发布一个包,`dsh-llm` 多一条依赖边。同一个类有两种导入路径,两者都受支持,错误处理规则把 `dsh-error` 作为它的归属位置。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-06-connector-account-registry.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/architecture/2026-11-06-connector-account-registry.md
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts:
en: 3950421fb526f6b7
zh: 47c5f6cc4b735058
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/problem:
en: 2a7b59cd509a0b9a
zh: 38130ce17829342d
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/decision:
en: d96b43106a1ba837
zh: 97bc8f9436ec07d0
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/alternatives-considered:
en: ee0aa3f9ea40ef15
zh: fded69a6dcc8ca87
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/consequences:
en: 5228f32becfbdec3
zh: 013f1073e70d46f7
@@ -0,0 +1,42 @@
# Agent Note: One Host registry and one browser half for connector accounts
Status: implemented
English | [中文](2026-11-06-connector-account-registry.zh.md)
## Problem
Connector plugins show an account section on the Plugins page. CLI app plugins keep the account in their vendor CLI; MCP connectors keep an OAuth grant through the MCP manager. Both kinds need the same surfaces: a bundle's section, title tag, and activation prompt, a confirmation before an action that changes the account outside DSH, and a notice in the browser that started the operation. A client plugin cannot share runtime code with another feature plugin ([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) rule 3), so one browser half per connector kind duplicates the same code and lets the copies drift. When the browser decides an account's state or relays an identifier from one Remote to another, the Host can no longer run the flow without the browser.
## Decision
[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.md) provides one Host registry, `ctx.connectorAccounts`, one `connectorAccounts` Remote, and one browser half for every connector kind.
| Part | Contract |
|---|---|
| Registration | `register({ key, packageName?, source, operations, copy, present })` returns the disposer that withdraws the account |
| Key | Unique among registered accounts and independent of the package, so an account that no bundle owns, such as a server configured in Settings, registers too |
| Package | Decides which bundle page carries the section and tag; a package carries at most one account |
| Source | The registrant's account: `snapshot`, `observe`, `refresh`, `start`, and `cancel` |
| Display | `present(view)` on the Host gives the phase, status text, title tag, buttons and their commands, confirmations, failure, and the operation the activation prompt starts |
| Remote | `watch`, plus `start(key, operation)` and `cancel(key, id)`, which route by key to the account's source |
The Host decides everything except opening the authorization page. The browser never learns how an account connects: it receives only the display, the operation in progress with its authorization page, and the latest result with its success text. The browser half keeps only what belongs to one browser: the operations it started, so their authorization pages open and their success is reported only there; the latest notice; and whether its stream is delivering. Buttons call `start` and `cancel` on the Remote themselves, and each surface keeps its own pending state.
The page registers one title tag entry and one notice entry. It also registers a section and an activation prompt for each account that names a package, because those two slots are keyed by package.
## Alternatives considered
**Two registries behind one browser half.** Rejected: the browser would follow both Remotes and choose which one each button calls, which relays between Host services again, and the two Host registries would hold the same code.
**One browser half per connector kind.** Rejected: client plugins cannot import each other's values, so the shared surfaces would be written twice and diverge.
**Share the browser half through `PLATFORM_MODULES` or a browser-side service.** Rejected: the module table is reserved for shell-seeded and static infrastructure libraries, and a browser-side service would keep the registrations in the browser, which only repeat what the Host knows.
**Let the browser derive an account's phase and actions from the registrant's raw state.** Rejected: the rules for which actions apply would live where the Host cannot test or run them, and the browser would need the registrant's own Remote.
## Consequences
The registry and browser half exist once. A new connector kind writes a source and `present` on the Host and needs no browser code. The account rules live beside the services that own them, and the Host can run every operation without a browser.
Registrants map their account states onto five phases (checking, connecting, connected, disconnected, unavailable); a state outside them shows through its status text and detail. The Web and Desktop compositions load the registry whether or not a connector plugin is installed. An authorization page that opens after the start call answers can be blocked by the browser; the section's open button shows it again.
@@ -0,0 +1,42 @@
# Agent Note:连接器账号使用一个 Host 注册表和一个浏览器一半
Status: implemented
[English](2026-11-06-connector-account-registry.md) | 中文
## 问题
连接器插件会在插件页显示账号区块。CLI 应用插件的账号保存在厂商 CLI 中;MCP 连接器通过 MCP 管理器保存 OAuth 授权。两类插件需要同样的界面:插件包的区块、标题旁标签和开启引导,在会改变 DSH 之外账号状态的操作前确认,以及只在发起操作的浏览器中显示的提示。客户端插件不能与其他功能插件共享运行时代码([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) 第 3 条),因此每类连接器各有一个浏览器一半,就会把同样的代码写两遍,副本还会逐渐不一致。如果由浏览器决定账号状态,或在两个 Remote 之间转发标识,Host 就无法在没有浏览器的情况下完成流程。
## 决定
[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.zh.md) 为所有连接器类型提供一个 Host 注册表 `ctx.connectorAccounts`、一个 `connectorAccounts` Remote 和一个浏览器一半。
| 部分 | 约定 |
|---|---|
| 注册 | `register({ key, packageName?, source, operations, copy, present })` 返回撤下账号的销毁函数 |
| 键 | 在已注册账号中唯一,且与包无关,因此没有插件包承载的账号(如在 Settings 中配置的服务器)也能注册 |
| 包 | 决定由哪个插件包页面承载区块和标签;一个包最多承载一个账号 |
| 来源 | 注册方的账号:`snapshot`、`observe`、`refresh`、`start` 和 `cancel` |
| 展示 | Host 上的 `present(view)` 给出阶段、状态文字、标题旁标签、按钮及其命令、确认、失败信息,以及开启引导启动的操作 |
| Remote | `watch`,以及按键路由到账号来源的 `start(key, operation)` 和 `cancel(key, id)` |
除了打开授权页,其余都由 Host 决定。浏览器不知道账号如何连接:它只收到展示内容、进行中的操作及其授权页,以及带成功文本的最新结果。浏览器一半只保存属于本浏览器的东西:它发起的操作(授权页只在这里打开,成功只在这里报告)、最新提示,以及它的流是否在推送。按钮自己调用 Remote 的 `start` 和 `cancel`,每个界面自己保存未完成状态。
页面只注册一个标题旁标签条目和一个提示条目;对每个带包名的账号,再注册一个区块和一个开启引导,因为这两个插槽以包为键。
## 考虑过的替代方案
**一个浏览器一半背后有两个注册表。** 否决:浏览器要同时跟随两个 Remote,并为每个按钮选择调用哪一个,这又是在 Host 服务之间转发;两个 Host 注册表的代码也会相同。
**每类连接器各有一个浏览器一半。** 否决:客户端插件不能导入彼此的值,共用界面就要写两遍,并逐渐不一致。
**通过 `PLATFORM_MODULES` 或浏览器端服务共享浏览器一半。** 否决:模块表只留给由 shell 预置的基础设施和静态库;浏览器端服务会把注册留在浏览器中,而这些注册只是重复 Host 已知的信息。
**由浏览器根据注册方的原始状态推算账号阶段和操作。** 否决:哪些操作可用的规则会放在 Host 无法测试和执行的地方,浏览器还需要注册方自己的 Remote。
## 后果
注册表和浏览器一半只有一份。新的连接器类型只需在 Host 上编写来源和 `present`,不需要浏览器代码。账号规则与拥有它们的服务在一起,Host 不依赖浏览器就能执行每个操作。
注册方需要把账号状态映射到五个阶段(检查中、连接中、已连接、未连接、不可用);超出这些阶段的状态通过状态文字和说明表达。无论是否安装了连接器插件,Web 与桌面端组合都会加载注册表。启动调用返回后才打开的授权页可能被浏览器拦截;区块中的打开按钮可以再次打开它。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-08-mcp-connector-accounts.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/architecture/2026-11-08-mcp-connector-accounts.md
/agent-note-mcp-connector-accounts-in-the-connector-account-registry:
en: de9535f7ca161ae3
zh: 50be52d2946e2058
/agent-note-mcp-connector-accounts-in-the-connector-account-registry/problem:
en: 3fcafe54fc134ff3
zh: bbef331a0d9eccd5
/agent-note-mcp-connector-accounts-in-the-connector-account-registry/decision:
en: 438e69f9a0d0dc87
zh: 990a9e96aafbd532
/agent-note-mcp-connector-accounts-in-the-connector-account-registry/alternatives-considered:
en: 0b7871c3d4aa7c52
zh: c26061baed87bee4
/agent-note-mcp-connector-accounts-in-the-connector-account-registry/consequences:
en: c90b9de7c3b4e662
zh: 7e126b5ac0f3e59e
@@ -0,0 +1,35 @@
# Agent Note: MCP connector accounts in the connector account registry
Status: implemented
English | [中文](2026-11-08-mcp-connector-accounts.zh.md)
## Problem
Connector plugins such as Linear, Notion, and Tencent Docs register an OAuth MCP server with the MCP manager on the Host and show its account on the Plugins page. The manager already owns the authorization attempt, the grant, and the server status, and every connector shares the same states, buttons, and 23 strings. The [connector account registry](2026-11-06-connector-account-registry.md) shows each account from a Host source and presenter, so MCP needs one adapter that turns the manager's view of a server into that source and presenter.
## Decision
[`@deepseek-ai/dsh-mcp-account`](../../../../packages/mcp/mcp-account/README.md) provides `ctx.mcpAccounts`. A connector's Host row registers its server name, its bundle package, and the copy that names its service; the service registers the account with `ctx.connectorAccounts` under the key `mcp:<server>`.
| Part | Choice |
|---|---|
| Source | Reads the manager's `list()` entry for the server and observes `mcp-manager/status`; `refresh` does nothing, because the manager publishes every change |
| Operation | A running authorization attempt is the operation and its identity is the operation's, so the browser that started it follows the manager's own attempt; a finished attempt is the result |
| Page operations | `connect` starts authorization; `sign-out` and `retry` sign out and restart through the manager and report their own result once they finish |
| Phases | Waiting for the browser and authorizing are connecting; a server that needs authorization again is disconnected, with the reason in its detail; a closed, waiting, disabled, or failed server is unavailable, with Retry only where a restart recovers it |
| Copy | The 23 strings every connector shares are Host dictionaries in eight languages; each connector supplies only the strings that name its service |
The manager's `startAuthorization`, `cancelAuthorization`, and `signOut` are Host methods without a Remote, so no browser names a server to authorize.
## Alternatives considered
**Keep the manager's authorization operations on its Remote.** Rejected: the page would pass a server name the Host already holds, and two paths would start the same attempt.
**Track an adapter-owned operation for each authorization.** Rejected: the manager already tracks the attempt's identity, phases, and authorization page, so a second tracker would restate it. The registry lets a source answer `start` once the manager has created the attempt.
**Key each connector's account by its package.** Rejected: the server name is unique among MCP accounts, so the key also refuses a second account for one server, and a server configured in Settings, which no bundle owns, uses the same form.
## Consequences
A connector ships no browser code and no page rules; the shared page renders its account. An account that needs reconnection shows as disconnected without a separate warning color, and its status and detail name the reason. Each browser follows the one registry stream, and the Host follows the manager through its status event.
@@ -0,0 +1,35 @@
# Agent Note:MCP 连接器账号接入连接器账号注册表
Status: implemented
[English](2026-11-08-mcp-connector-accounts.md) | 中文
## 问题
Linear、Notion、腾讯文档等连接器插件在 Host 上向 MCP 管理器注册 OAuth MCP 服务器,并在插件页显示其账号。管理器已经持有授权尝试、grant 和服务器状态,各连接器的状态、按钮和 23 条文案都相同。[连接器账号注册表](2026-11-06-connector-account-registry.zh.md)根据 Host 上的来源和展示函数显示每个账号,因此 MCP 需要一个适配,把管理器对服务器的视图转换为这样的来源和展示函数。
## 决定
[`@deepseek-ai/dsh-mcp-account`](../../../../packages/mcp/mcp-account/README.zh.md) 提供 `ctx.mcpAccounts`。连接器的 Host 行注册其服务器名、插件包以及点出服务名称的文案;该服务以 `mcp:<server>` 为键,把账号注册到 `ctx.connectorAccounts`。
| 部分 | 选择 |
|---|---|
| 来源 | 读取管理器 `list()` 中该服务器的条目,并观察 `mcp-manager/status`;`refresh` 什么也不做,因为管理器会发布每次变化 |
| 操作 | 进行中的授权尝试就是操作,其 id 就是操作的 id,因此发起它的浏览器跟随的是管理器自己的尝试;结束的尝试就是结果 |
| 页面操作 | `connect` 发起授权;`sign-out` 和 `retry` 通过管理器退出登录、重启服务器,结束后报告各自的结果 |
| 阶段 | 等待浏览器和授权中属于连接中;需要重新授权的服务器属于未连接,原因写在说明里;已关闭、等待凭据、已停用或失败的服务器属于不可用,只有重启能恢复时才提供“重试” |
| 文案 | 各连接器共用的 23 条文案是 Host 上 8 种语言的字典;每个连接器只提供点出其服务名称的文案 |
管理器的 `startAuthorization`、`cancelAuthorization` 和 `signOut` 是不带 Remote 的 Host 方法,因此浏览器不会指定要授权的服务器。
## 考虑过的替代方案
**管理器的授权操作继续走它的 Remote。** 否决:页面要传入 Host 已经知道的服务器名,而且会有两条路径发起同一次尝试。
**为每次授权维护适配自己的操作。** 否决:管理器已经记录尝试的 id、阶段和授权页,第二套记录只会重复它。注册表允许来源在管理器创建尝试后再回答 `start`。
**以插件包作为连接器账号的键。** 否决:服务器名在 MCP 账号中唯一,因此这个键也会拒绝同一服务器的第二个账号;没有插件包的、在 Settings 中配置的服务器也使用同样的键。
## 影响
连接器不提供任何浏览器代码和页面规则,由共用的页面渲染其账号。需要重新连接的账号显示为未连接,不再单独使用警示色,其状态和说明会点出原因。每个浏览器跟随同一条注册表流,Host 通过管理器的状态事件跟随管理器。
@@ -9,14 +9,14 @@
en: 7115cbaefaa11d2d
zh: 23aff8797a651a36
/agent-note-settings-driven-mcp-server-manager/decision:
en: 7b7afbd37320e89a
zh: 36a308b3143350d9
en: ac7cc4c046ca2377
zh: 697233f3b09759de
/agent-note-settings-driven-mcp-server-manager/alternatives-considered:
en: 26534ceaccf1f5b9
zh: 882e38f8b3f9787f
en: 1154a35a2f9af53f
zh: 92ad94d6306463bb
/agent-note-settings-driven-mcp-server-manager/testing:
en: cbfd30400093ade5
zh: 018ad32e25c6c7fc
/agent-note-settings-driven-mcp-server-manager/consequences:
en: 40419dfbc2f69ac3
zh: 853c978d285c3310
en: 078ddb6329aae177
zh: dc2b2f3c457feb53
@@ -20,9 +20,9 @@ Installed application plugins also bring their own servers. Each must add its se
**A flat entry schema, validated cross-field.** The entry is flat with a `transport` discriminant, and write-time validation enforces the per-transport requirements and rejections (missing `command`/`url`, cross-transport fields, malformed templates) at the write — a schema-valid-but-unserviceable entry is never stored, and refusals name the offending field where a union's shape error would not.
**Children are plugin instances, not library calls.** Each enabled entry is a `dsh-mcp-client` instance that the MCP client host mounts below its own fiber via `ctx.plugin()`. That reuses the tested activation/disposal semantics, makes `serverName` reservations collide correctly with statically composed instances (surfaced as a `failed`/`load` status with the actionable message), and lets the manager unmount every instance it mounted when it stops.
**Children are plugin instances, not library calls.** Each enabled entry is a `dsh-mcp-client` instance that the MCP client host mounts under the manager's fiber via `ctx.plugin()`. That reuses the tested activation/disposal semantics, makes `serverName` reservations collide correctly with statically composed instances (surfaced as a `failed`/`load` status with the actionable message), and lets manager disposal unwind every instance and its tools through ordinary fiber teardown.
**The MCP client host is the manager's only reach into mcp-client.** An mcp-client entry loaded with `host: true` provides `ctx.mcpClientHost`, and the manager injects it and imports only mcp-client types. The host validates an entry's client fields through each transport's own schema, so refusals still name the field; mounts instances below itself; probes; and creates authorization owners from its own context. Plugin entries export only what the Loader loads, and HMR reloads mcp-client as its own unit: replacing the host disposes the instances below it, and Cordis restarts the manager against the replacement, so the manager never keeps a replaced module's code or instances.
**The MCP client host is the manager's only reach into mcp-client.** The manager creates an `McpClientHost` at construction and imports only that class and mcp-client types. The host validates an entry's client fields through each transport's own schema, so refusals still name the field; mounts instances under the manager's fiber; probes; and creates authorization owners from the manager's context. A plugin entry exports what the Loader loads and its Service and error classes, so the host is a Service class rather than a set of functions.
**Whole-entry identity; `enabled` controls mounting.** A changed entry rebuilds the child instance; disabling or deleting it disposes the child. Reconciliation and `restart` serialize on one operation tail. Probes run independently, and configuration changes cancel affected probes before queued cleanup waits for them. The manager retains a failed cleanup record and refuses a replacement until the Host restarts, preventing overlapping server lifetimes.
@@ -50,9 +50,9 @@ Installed application plugins also bring their own servers. Each must add its se
**Poll status from the management surface.** Rejected: the Remote plane already forwards Host events; peers that shipped polling (Reasonix) or lacked a status event (OpenCode v1) treat it as a defect to fix.
**Export validation, probe, status, and authorization values from the mcp-client entry.** Rejected: plugin entries export only what the Loader loads. A manager that imports another plugin's values keeps the module it loaded first; when mcp-client also has its own Loader entry, a reload replaces only mcp-client, and HMR also replaces the instances the manager mounted through that plugin without the manager knowing, which leaves stale status and an instance the manager cannot stop.
**Export validation, probe, status, and authorization values from the mcp-client entry.** Rejected: plugin entries export what the Loader loads and their Service and error classes, not helper values.
**A Service Definition in mcp-client that the manager extends to inherit probe and authorization.** Rejected: the subclass extends the base it imported, so after a reload it still runs the replaced code, and instances it mounts through its own import are replaced behind it as above.
**Load the host as its own mcp-client entry with `host: true` that the manager injects.** Rejected: every composition that loads the manager would need a second row, and the client's configuration would carry a shape that connects no server. Its only gain, a manager that restarts when mcp-client reloads during development, does not justify either.
**Move the connection machinery into a separate service package.** Rejected: per-server mcp-client instances use the same machinery, so every composition that loads mcp-client would also have to load the new service.
@@ -68,5 +68,5 @@ mcp-client unit tests cover status transitions, independent startup and probe bu
- Liveness relies on transport closure and request failures; a Streamable HTTP server that stalls without closing is noticed when a request fails.
- A rebuilt server’s tools remain unavailable until the replacement completes its initial sync. Replacement waits for confirmed transport closure and successful local cleanup.
- The manager governs the global plane only; preset-scoped and static instances stay outside its list.
- A composition that loads the manager also loads an mcp-client entry with `host: true`; without it the manager stays pending. A reload of mcp-client restarts the manager, which remounts its servers.
- The manager keeps the mcp-client code it loaded until the manager itself reloads; a development reload of mcp-client alone does not restart it.
- `startupTimeoutMs` bounds startup attempts, while notification-driven re-sync requests still ride the SDK's request default — recorded as an mcp-client limitation.
@@ -20,9 +20,9 @@ Status: implemented
**扁平条目 schema,跨字段校验。** 条目是带 `transport` 判别字段的扁平结构,写入期校验在写入处强制逐传输要求与拒绝(缺 `command`/`url`、跨传输字段、模板写错)——schema 合法但不可执行的条目永远不会被存下,且拒绝会点名出错字段,union 的形状错误做不到。
**子实例是插件实例,不是库调用。** 每个启用条目都是 MCP 客户端宿主经 `ctx.plugin()` 挂在其自身 fiber 下的 `dsh-mcp-client` 实例。这复用了经过测试的激活/销毁语义,让 `serverName` 预留与静态组合实例正确冲突(以带可操作消息的 `failed`/`load` 状态浮出),并让管理器停止时卸载它挂载的每个实例。
**子实例是插件实例,不是库调用。** 每个启用条目都是 MCP 客户端宿主经 `ctx.plugin()` 挂在管理器 fiber 下的 `dsh-mcp-client` 实例。这复用了经过测试的激活/销毁语义,让 `serverName` 预留与静态组合实例正确冲突(以带可操作消息的 `failed`/`load` 状态浮出),并让管理器销毁时经普通 fiber 收卷撤下每个实例及其工具。
**MCP 客户端宿主是管理器接触 mcp-client 的唯一途径。** 以 `host: true` 加载的 mcp-client 条目提供 `ctx.mcpClientHost`,管理器注入它,并且只从 mcp-client 导入类型。宿主用各传输自己的 schema 校验条目的客户端字段,因此拒绝时仍点名字段;它把实例挂在自己之下、执行探测,并用自身 context 创建授权所有者。插件入口只导出 Loader 加载的内容,而 HMR 把 mcp-client 作为独立单元重载:替换宿主会销毁它之下的实例,Cordis 让管理器在替换后的宿主上重启,因此管理器不会保留被替换模块的代码或实例。
**MCP 客户端宿主是管理器接触 mcp-client 的唯一途径。** 管理器在构造时创建 `McpClientHost`,并且只从 mcp-client 导入这个类和类型。宿主用各传输自己的 schema 校验条目的客户端字段,因此拒绝时仍点名字段;它把实例挂在管理器的 fiber 下、执行探测,并用管理器的 context 创建授权所有者。插件入口只导出 Loader 加载的内容及其 Service 与错误类,因此宿主是一个 Service 类,而不是一组函数。
**整条目决定实例;`enabled` 控制挂载。** 条目变化会重建子实例,停用或删除条目会销毁子实例。对账与 `restart` 在同一操作队列中串行执行。探测独立运行,配置变更先取消受影响的探测,再由队列中的清理操作等待它们结束。管理器保留清理失败记录,并在 Host 重启前拒绝替换,防止服务器生命周期重叠。
@@ -50,9 +50,9 @@ Status: implemented
**让管理界面轮询状态。** 否决:Remote 面已转发宿主事件;发货了轮询的同类产品(Reasonix)或缺状态事件的(OpenCode v1)都把它当作待修缺陷。
**从 mcp-client 入口导出校验、探测、状态与授权的值。** 否决:插件入口只导出 Loader 加载的内容。导入其他插件值的管理器会一直持有它最初加载的模块;当 mcp-client 另有自己的 Loader 条目时,重载只替换 mcp-client,HMR 还会在管理器不知情时替换它经该插件挂载的实例,留下过期状态和一个管理器停不掉的实例。
**从 mcp-client 入口导出校验、探测、状态与授权的值。** 否决:插件入口只导出 Loader 加载的内容及其 Service 与错误类,不导出辅助值。
**在 mcp-client 中定义供管理器继承探测与授权的 Service Definition。** 否决:子类继承的是它导入的基类,重载后仍运行被替换的代码,而它经自身导入挂载的实例也会如上在它不知情时被替换。
**把宿主作为以 `host: true` 加载、由管理器注入的独立 mcp-client 条目。** 否决:每个加载管理器的组合都得多一行,客户端配置也要多出一种不连接任何服务器的形态。它唯一的好处是开发期 mcp-client 重载时管理器随之重启,不足以抵消这两点。
**把连接机制移到单独的服务包。** 否决:每台服务器的 mcp-client 实例使用同一套机制,因此所有加载 mcp-client 的组合都得额外加载这个新服务。
@@ -68,5 +68,5 @@ mcp-client 单测覆盖状态迁移、独立的启动与探测预算、模板绑
- 存活判断依赖传输关闭与请求失败;停滞但不关闭的 Streamable HTTP 服务器要等到请求失败时才会被发现。
- 被重建服务器的工具在替换连接完成首次同步前不可用。替换会等待传输确认关闭且本地清理成功。
- 管理器只治理全局面;preset 作用域与静态实例不在其列表内。
- 加载管理器的组合同时加载一个 `host: true` 的 mcp-client 条目;缺少它时管理器保持等待。mcp-client 重载会重启管理器,管理器随之重新挂载其服务器。
- 管理器沿用它加载的 mcp-client 代码,直到管理器自身重载;开发期只重载 mcp-client 不会重启管理器。
- `startupTimeoutMs` 只为启动尝试设界,通知驱动的重同步请求仍走 SDK 请求默认值——已记录为 mcp-client 的限制。
@@ -21,8 +21,8 @@
en: 8a9578bbc700c0bf
zh: 8ee46e5ef1cf3972
/agent-note-keep-cleanup-dependencies-usable-until-consumers-finish/p0-findings/authorization-loses-required-observation-or-an-accepted-credential-write:
en: 33312dc2b9813ef9
zh: ba2fb5fac770e698
en: c6b0d746185d0d3b
zh: a228633ecdf42800
/agent-note-keep-cleanup-dependencies-usable-until-consumers-finish/p0-findings/ssh-disables-cleanup-requests-before-dependent-process-cleanup-finishes:
en: 85fb2b564bc40230
zh: 97c3e794124f8044
@@ -36,7 +36,7 @@ A focused in-memory experiment using the actual Cordis and storage-domain implem
### Authorization loses required observation or an accepted credential write
**Owners and evidence.** Authorization's [commit observer (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts) is a caller-owned `ctx.on` effect. Its [commit operation (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts) awaits credential storage, while [success requires the observed update (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts). The account service [leaves committing attempts un-aborted and awaits their completion (`PlatformAccount`)](../../../../packages/credentials/deepseek-account-platform/src/index.ts).
**Owners and evidence.** Authorization's [commit observer (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts) is a caller-owned `ctx.on` effect. Its [commit operation (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts) awaits credential storage, while [success requires the observed update (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts). The account service [leaves committing attempts un-aborted and awaits their completion (`DeepSeekAccount`)](../../../../packages/credentials/deepseek-account/src/index.ts).
**Successful write, false failure.** Pause a credential write, dispose the account consumer, then complete the write and emit its update. The observer can auto-unsubscribe alongside the account's drain; Authorization then rejects with `NOT_COMMITTED` despite successful storage. Keep observation owned by the operation until its result settles, or acknowledge successful `session.commit` directly while giving legacy direct-write observation an explicit lifetime. A focused experiment using actual Cordis and Authorization with a deferred in-memory credential provider reproduced `NOT_COMMITTED` after the provider write succeeded; the complete browser sign-in path is source-traced.
@@ -36,7 +36,7 @@ Status: proposed
### Authorization 丢失必需的提交观察或已接受的凭据写入
**所有者与证据。** Authorization 的[提交观察器 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)是调用方拥有的 `ctx.on` effect。[提交操作 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)等待凭据存储,而[成功要求观察到更新 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)。账号服务[不会中止正在提交的尝试,并等待其完成 (`PlatformAccount`)](../../../../packages/credentials/deepseek-account-platform/src/index.ts)。
**所有者与证据。** Authorization 的[提交观察器 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)是调用方拥有的 `ctx.on` effect。[提交操作 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)等待凭据存储,而[成功要求观察到更新 (`AuthorizationService.attempt`)](../../../../packages/credentials/authorization/src/index.ts)。账号服务[不会中止正在提交的尝试,并等待其完成 (`DeepSeekAccount`)](../../../../packages/credentials/deepseek-account/src/index.ts)。
**写入成功,却报告失败。** 暂停凭据写入,释放账号消费者,再完成写入并发出更新。观察器可以与账号的排空并发自动退订;随后 Authorization 即使存储成功也会以 `NOT_COMMITTED` 拒绝。应让操作拥有观察器直到结果确定,或直接确认成功的 `session.commit`,同时给旧式直接写入观察明确的生命周期。使用实际 Cordis 与 Authorization、配合延迟的内存凭据 provider 的实验,复现了 provider 写入成功后返回 `NOT_COMMITTED`;完整浏览器登录路径由源码追踪确认。
+5 -5
View File
@@ -11,20 +11,20 @@ Define failures, their owners, and what remains safe after failure.
Expected failures need declared types, stable discriminants, and handling-relevant details. Reuse package error conventions, preserve causes, and separate machine identity from display text. Never route handling by parsing messages. Unexpected defects such as `assertNever` may remain plain `Error`; containment must never turn them into success.
An error class that carries a machine code extends `HarnessError` from `dsh-llm`, directly or through its package's error class, never bare `Error`. Prefer one error class per owning package or domain over a class per failure; a separate class is justified when callers catch it by type or it carries its own structured fields, such as `ToolArgsError.violations`. `name` is the class name, except for cancellation (below), and `code` values are stable `UPPER_SNAKE_CASE` strings, usually prefixed by the domain and declared as a union or constants beside the class. A code names the failure class its consumers act on, not the call site; add a code rather than reuse one whose meaning differs. The [error class and code guide](references/error-codes.md) defines class choice, naming, the standard conditions, declaration, foreign-error conversion, and compatibility.
An error class that carries a machine code extends `HarnessError` from `dsh-error` (also re-exported by `dsh-llm`), directly or through its package's error class, never bare `Error`. Prefer one error class per owning package or domain over a class per failure; a separate class is justified when callers catch it by type or it carries its own structured fields, such as `ToolArgsError.violations`. `name` is the class name, except for cancellation (below), and `code` values are stable `UPPER_SNAKE_CASE` strings, usually prefixed by the domain and declared as a union or constants beside the class. A code names the failure class its consumers act on, not the call site; add a code rather than reuse one whose meaning differs. The [error class and code guide](references/error-codes.md) defines class choice, naming, the standard conditions, declaration, foreign-error conversion, and compatibility.
Convert foreign failures where the dependency is owned. Node errno, SDK, protocol, native, worker, and cross-realm errors become the owning package's error with the original as `cause`; a foreign numeric or vendor code belongs in the message, not in `code`. Preserve structure across layers: never re-wrap a `HarnessError` in a plain `Error`, store only its message for a later rethrow, or drop its `name` and `code` while redacting text. A process or worker boundary transports `name` and `code` and reconstructs the error.
## 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` with `info`, the registry's own cancellation result (`AbortError` with `ABORTED` or `ABORTED_BEFORE_DISPATCH`), or a `tools/execute` wrapper result such as the timeout policy's `TOOL_TIMEOUT`. Any other thrown value, a guard denial, an approval rejection, and a post-execute block 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 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 the owning package's error with its own code.
- Caller cancellation throws a `HarnessError` whose `name` is `AbortError` and whose code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), matching the registry's cancellation result; never a bare `AbortError` or `signal.reason`.
- Missing composition or caller context, such as an absent Agent, service, or open turn, throws `ToolContextUnavailableError` (`TOOL_CONTEXT_UNAVAILABLE`) from `dsh-tools`.
- Caller cancellation either propagates the signal's reason or an `Error` named `AbortError`, which the registry classifies as `AbortError` with the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), or throws a `HarnessError` with that `name` and code. Never replace it with a different plain `Error`; a failure distinct from the cancellation, such as a cleanup failure, keeps its own class and code.
- Dependency failures follow the conversion rule above; filesystem errno maps to `FsError` codes such as `FS_NOT_FOUND`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR`.
A policy that denies a call in `tools/pre-execute` supplies `info` with its own `name` and `code`. The registry's built-in approval rejections and guard denials currently carry only a reason, so they remain unroutable until the registry gives them codes. A failure the model must not treat as success is an `isError` result; a successful domain outcome in a non-ideal state, such as a non-zero exit or no matches, stays a success value, and a success-shaped failure value is allowed only when the output schema documents it. Tests assert `error.info.name` and `error.info.code` for each expected failure path, not only the message.
A policy that denies a call in `tools/pre-execute`, through `tools.guard()`, or by a post-execute block supplies `info` with its own `name` and `code`. A failure the model must not treat as success is an `isError` result; a successful domain outcome in a non-ideal state, such as a non-zero exit or no matches, stays a success value, and a success-shaped failure value is allowed only when the output schema documents it. Tests assert `error.info.name` and `error.info.code` for each expected failure path, not only the message.
Existing `name` and `code` values persist in Session logs and feed analytics. Renaming or reclassifying one is an externally perceptible change that needs an [upgrade guide](../dsh-create-upgrade-guide/SKILL.md).
@@ -17,7 +17,7 @@ Use this guide when adding or reviewing an error class, an error code, or a fail
## Choose the class
1. Reuse the owning domain's existing class when the failure belongs to that domain: `FsError` for filesystem targets, `SearchError` for `glob`/`grep`, `LspError`, `WebError`, `SubagentError`, `TeamError`, `GoalError`, `WorkflowError`, `UserQuestionError`, `SessionQueryError`, the `Sandbox*Error` classes, and `CodeRunFailedError`.
2. Use `ToolArgsError` (`INVALID_ARGS`) for argument constraints the parameter schema cannot express, such as an empty string, a range, or a cross-field rule.
2. Use `ToolArgsError` (`INVALID_ARGS`) for argument constraints the parameter schema cannot express, such as an empty string, a range, or a cross-field rule, and `ToolContextUnavailableError` (`TOOL_CONTEXT_UNAVAILABLE`) for a tool call that lacks a required Agent, service, or open turn.
3. Declare a new class only for a new owning domain. Prefer one class with a code union over one class per failure; a separate subclass is justified when consumers must catch it by type or it carries its own structured fields, such as `ToolArgsError.violations`, and it then extends the domain class when one exists so the domain still matches with `instanceof`.
4. Never declare a coded class that extends bare `Error`. An existing one is migrated by changing its base class and keeping every `name` and `code`.
@@ -26,7 +26,7 @@ Use this guide when adding or reviewing an error class, an error code, or a fail
- `name` is the PascalCase class name ending in `Error`, such as `JobError` or `SandboxEscalationError`.
- Assign `this.name` a string literal in the constructor. `HarnessError` defaults `name` to `new.target.name`, but a bundler may rename a colliding class binding, and a renamed class would change persisted data.
- Do not reuse another domain's class name, and do not encode a code in the name.
- Cancellation is the one exception: a tool throws a `HarnessError` whose `name` is `AbortError` and whose code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`), so tool-thrown and registry-generated cancellations share one `name` and `code`.
- Cancellation is the one exception: its `name` is `AbortError` and its code is the `dsh-tools` `TOOL_ABORTED` constant (`ABORTED`). The registry applies both to a signal reason or an `Error` named `AbortError` that a tool throws after cancellation, whichever operation inside the tool aborted; a tool that throws its own cancellation error uses a `HarnessError` with the same `name` and code.
## Format the code
+2 -2
View File
@@ -54,7 +54,7 @@ flowchart LR
cfg --> plugin_dsh_base_settings
plugin_dsh_base_authorization["authorization<br/>@deepseek-ai/dsh-authorization"]
cfg --> plugin_dsh_base_authorization
plugin_dsh_base_deepseek_account["deepseek-account<br/>@deepseek-ai/dsh-deepseek-account-platform"]
plugin_dsh_base_deepseek_account["deepseek-account<br/>@deepseek-ai/dsh-deepseek-account"]
cfg --> plugin_dsh_base_deepseek_account
plugin_dsh_base_credentials["credentials<br/>@deepseek-ai/dsh-credentials-local"]
cfg --> plugin_dsh_base_credentials
@@ -233,7 +233,7 @@ flowchart LR
| `config-editor` | `@deepseek-ai/dsh-config-editor` |
| `settings` | `@deepseek-ai/dsh-settings` |
| `authorization` | `@deepseek-ai/dsh-authorization` |
| `deepseek-account` | `@deepseek-ai/dsh-deepseek-account-platform` |
| `deepseek-account` | `@deepseek-ai/dsh-deepseek-account` |
| `credentials` | `@deepseek-ai/dsh-credentials-local` |
| `llm-pi-ai` | `@deepseek-ai/dsh-llm-pi-ai` |
| `session-persistence-jsonl` | `@deepseek-ai/dsh-session-persistence-jsonl` |
+2 -4
View File
@@ -12,7 +12,7 @@ const installAnchor = fileURLToPath(new URL('../package.json', import.meta.url))
const resourcePackage = '@deepseek-ai/dsh-mcp-resources'
describe('shipped MCP resource composition', () => {
it.each(Object.keys(PROFILE_TEMPLATES))('%s carries one shared resource consumer and no MCP server instance', (name) => {
it.each(Object.keys(PROFILE_TEMPLATES))('%s carries one shared resource consumer without a server', (name) => {
const home = mkdtempSync(join(tmpdir(), 'dsh-profile-mcp-'))
try {
const profile = loadProfile('dsh', name, installAnchor, home)
@@ -25,9 +25,7 @@ describe('shipped MCP resource composition', () => {
expect(rows.filter(row => row.name === resourcePackage)).toEqual([
{ id: 'mcp-resources', name: resourcePackage },
])
expect(rows.filter(row => row.name === '@deepseek-ai/dsh-mcp-client')).toEqual(name === 'web'
? [{ id: 'mcp-client-host', name: '@deepseek-ai/dsh-mcp-client', config: { host: true } }]
: [])
expect(rows.filter(row => row.name === '@deepseek-ai/dsh-mcp-client')).toEqual([])
expect(warnings).toEqual([])
const owners = profile.layers.filter((layer) => {
+176 -4
View File
@@ -599,9 +599,7 @@ describe('the shipped Web composition', () => {
expect(codePointLength(text) - codePointLength(path) + 256, file).toBeLessThan(8192)
}
// The persona is `standard`'s, pinned verbatim so the two declarations
// cannot drift apart: tool descriptions and the skill catalog carry
// every creation-mode instruction.
// Creator adds its DSH customization intent to the shared coding persona.
const standard = await ctx.agents.create({
sessionId: SessionId('preset-cordis-standard-persona'),
setup: agentCtx => ctx.agentPresets.mount(agentCtx, 'standard').then(() => undefined),
@@ -611,7 +609,30 @@ describe('the shipped Web composition', () => {
.filter(section => section.name.startsWith('deployment:persona-'))
const cordisPersona = await persona(handle.agent)
expect(cordisPersona.map(section => section.name)).toEqual(['deployment:persona-prefix', 'deployment:persona-suffix'])
expect(cordisPersona).toEqual(await persona(standard.agent))
const standardPersona = await persona(standard.agent)
const standardPrefix = standardPersona.find(section => section.name === 'deployment:persona-prefix')
expect(standardPrefix?.text).toMatch(/^You are a coding agent powered by the .+ model\.$/u)
expect(cordisPersona).toEqual(standardPersona.map(section => section.name === 'deployment:persona-prefix'
? { ...section, text: `${section.text} You help the user customize DeepSeek Harness itself.` }
: section))
const definition = composeEntries([webPatches('Creator persona')])
.find(row => row.id === 'preset-cordis')!.config as import('@deepseek-ai/dsh-agent-preset-registry').PresetDefinition
const unregister = await ctx.agentPresets.register({
...definition, id: 'cordis-coding-only',
plugins: definition.plugins.map(row => row.id === 'persona'
? { ...row, config: { prefix: standardPrefix!.text } }
: row),
})
try {
const codingOnly = await ctx.agents.create({
sessionId: SessionId('preset-cordis-coding-only'),
setup: agentCtx => ctx.agentPresets.mount(agentCtx, 'cordis-coding-only').then(() => undefined),
})
try {
expect(ctx.tools.schemas(handle.agent).toSorted((left, right) => left.name.localeCompare(right.name)))
.toEqual(ctx.tools.schemas(codingOnly.agent).toSorted((left, right) => left.name.localeCompare(right.name)))
} finally { await codingOnly.dispose() }
} finally { await unregister() }
} finally {
await standard.dispose()
}
@@ -865,6 +886,157 @@ describe.each(['web', 'desktop'] as const)('%s native subagent bundles', (surfac
}, 120_000)
})
describe('the standard preset documentation skill', () => {
it.for([false, true])('loads the packaged skill without adding tools (badge skill: %s)', async (withBadge: boolean) => {
const root = await mkdtemp(join(tmpdir(), 'dsh-standard-doc-'))
vi.stubEnv('DSH_HOME', join(root, 'home'))
vi.stubEnv('DSH_AGENTS_HOME', join(root, 'agents-home'))
vi.stubEnv('DSH_BUNDLED_SKILL_DIR', join(root, 'bundled-skills'))
let docCtx: Context | undefined
try {
const standard = composeEntries([webPatches('standard documentation')])
.find(row => row.id === 'preset-standard')!.config as import('@deepseek-ai/dsh-agent-preset-registry').PresetDefinition
docCtx = await bootWeb(root, [
{ id: 'skill-badge', disabled: !withBadge },
{ insert: [{
id: 'preset-standard-without-doc', name: '@deepseek-ai/dsh-agent-preset',
config: {
...standard, id: 'standard-without-doc',
plugins: standard.plugins.map(row => row.id === 'skill-filesystem'
? { ...row, config: { customSkillDirs: [] } }
: row),
},
}] },
])
const testCtx = docCtx
const adapter = new MinimalCompactionAdapter()
testCtx.llm.registerAdapter(['standard-doc-test'], adapter)
const baseline = await testCtx.agents.create({
sessionId: SessionId('standard-doc-baseline'), meta: { cwd: root },
agentOptions: { provider: 'standard-doc-test', model: 'standard-doc-test' },
setup: agentCtx => testCtx.agentPresets.mount(agentCtx, 'standard-without-doc').then(() => undefined),
})
const standardAgent = await testCtx.agents.create({
sessionId: SessionId('standard-doc-current'), meta: { cwd: root },
agentOptions: { provider: 'standard-doc-test', model: 'standard-doc-test' },
setup: agentCtx => testCtx.agentPresets.mount(agentCtx, 'standard').then(() => undefined),
})
const baselineSkills = await testCtx.skills.list({ cwd: root, scope: baseline.agent })
const skills = await testCtx.skills.list({ cwd: root, scope: standardAgent.agent })
expect(skills.map(skill => skill.name).sort())
.toEqual([...baselineSkills.map(skill => skill.name), 'dsh-doc'].sort())
const definition = await testCtx.skills.get('dsh-doc', { cwd: root, scope: standardAgent.agent })
expect(definition?.path).toBe(await realpath(join(REPO_ROOT, 'packages/preset/agent-preset/skills/dsh-doc/SKILL.md')))
if (definition === undefined) throw new Error('standard has no packaged dsh-doc skill')
const creator = await testCtx.agents.create({
sessionId: SessionId('standard-doc-creator'), meta: { cwd: root },
setup: agentCtx => testCtx.agentPresets.mount(agentCtx, 'cordis').then(() => undefined),
})
expect((await testCtx.skills.get('dsh-doc', { cwd: root, scope: creator.agent }))?.path).toBe(definition.path)
const schemas = testCtx.tools.schemas(standardAgent.agent)
expect(schemas).toEqual(testCtx.tools.schemas(baseline.agent))
expect(schemas.map(tool => tool.name)).not.toContain('cordis_inspect_list')
expect(schemas.map(tool => tool.name)).not.toContain('cordis_inspect_query')
for (const handle of [baseline, standardAgent]) {
handle.agent.followup(createUserMessage({ content: [{ type: 'text', text: 'Reply ready.' }], source: { kind: 'user' } }))
await handle.agent.whenIdle()
}
const baselineCatalogs = baseline.agent.session.snapshotEvents().flatMap(event =>
event.type === 'user/message' && event.data.source.kind === 'skill-catalog' ? [event.data] : [])
const catalogs = standardAgent.agent.session.snapshotEvents().flatMap(event =>
event.type === 'user/message' && event.data.source.kind === 'skill-catalog' ? [event.data] : [])
expect(baselineCatalogs).toHaveLength(baselineSkills.length > 0 ? 1 : 0)
expect(catalogs).toHaveLength(1)
expect(catalogs[0]?.source).toMatchObject({
entries: skills.map(skill => ({ name: skill.name, description: skill.description })),
})
const requests = adapter.requests.filter(request => request.purpose === undefined)
expect(requests).toHaveLength(2)
expect(requests[0]?.tools).toEqual(requests[1]?.tools)
const catalogSize = (messages: typeof catalogs) => {
const text = messages.flatMap(message => message.content.flatMap(block => block.type === 'text' ? [block.text] : [])).join('')
return {
utf8Bytes: Buffer.byteLength(text, 'utf8'), codePoints: Array.from(text).length,
heuristicTokens: messages.reduce((total, message) => total + testCtx.tokenMeter.estimateMessage(message), 0),
}
}
const beforeCatalog = catalogSize(baselineCatalogs)
const afterCatalog = catalogSize(catalogs)
expect({
utf8Bytes: afterCatalog.utf8Bytes - beforeCatalog.utf8Bytes,
codePoints: afterCatalog.codePoints - beforeCatalog.codePoints,
heuristicTokens: afterCatalog.heuristicTokens - beforeCatalog.heuristicTokens,
}).toEqual({ utf8Bytes: 500, codePoints: 500, heuristicTokens: 125 })
const requestTexts = requests.flatMap(request => request.messages.flatMap(message =>
message.content.flatMap(block => block.type === 'text' ? [block.text] : [])))
expect(requestTexts.some(text => text.includes(definition.content))).toBe(false)
expect(standardAgent.agent.session.snapshotEvents().filter(event => event.type === 'tool/call')).toEqual([])
const profileManifest = join(root, 'profiles/spec/package.json')
const before = await readFile(profileManifest, 'utf8')
const loaded = await executeToolFixture(testCtx, {
agent: standardAgent.agent, callId: ToolCallId('standard-doc-load'),
name: 'skill', arguments: { name: 'dsh-doc' }, signal: new AbortController().signal,
})
expect(loaded.isError).toBe(false)
expect(loaded.content.some(block => block.type === 'text' && block.text.includes(definition.content))).toBe(true)
expect(testCtx.tools.schemas(standardAgent.agent)).toEqual(schemas)
expect(await readFile(profileManifest, 'utf8')).toBe(before)
} finally {
try { await docCtx?.fiber.dispose() } finally {
vi.unstubAllEnvs()
await rm(root, { recursive: true, force: true })
}
}
})
it('prefers project dsh-doc overrides while packaged guidance wins over user skills', async () => {
const root = await mkdtemp(join(tmpdir(), 'dsh-standard-doc-priority-'))
const home = join(root, 'home')
const agentsHome = join(root, 'agents-home')
const workspace = join(root, 'workspace')
const projectAgents = join(root, 'project-agents')
const projectDsh = join(root, 'project-dsh')
vi.stubEnv('DSH_HOME', home)
vi.stubEnv('DSH_AGENTS_HOME', agentsHome)
vi.stubEnv('DSH_BUNDLED_SKILL_DIR', join(root, 'bundled-skills'))
let priorityCtx: Context | undefined
try {
await mkdir(workspace)
for (const project of [projectAgents, projectDsh]) await mkdir(join(project, '.git'), { recursive: true })
for (const [directory, description] of [
[join(home, 'skills'), 'User DSH skill'],
[join(agentsHome, 'skills'), 'User agents skill'],
[join(projectAgents, '.agents/skills'), 'Project agents skill'],
[join(projectDsh, '.agents/skills'), 'Lower priority project skill'],
[join(projectDsh, '.dsh/skills'), 'Project DSH skill'],
] as const) {
const skill = join(directory, 'dsh-doc')
await mkdir(skill, { recursive: true })
await writeFile(join(skill, 'SKILL.md'), `---\nname: dsh-doc\ndescription: ${description}\n---\n\n${description}\n`)
}
priorityCtx = await bootWeb(root)
const testCtx = priorityCtx
const handle = await testCtx.agents.create({
sessionId: SessionId('standard-doc-priority'), meta: { cwd: workspace },
setup: agentCtx => testCtx.agentPresets.mount(agentCtx, 'standard').then(() => undefined),
})
for (const [cwd, path] of [
[workspace, join(REPO_ROOT, 'packages/preset/agent-preset/skills/dsh-doc/SKILL.md')],
[projectAgents, join(projectAgents, '.agents/skills/dsh-doc/SKILL.md')],
[projectDsh, join(projectDsh, '.dsh/skills/dsh-doc/SKILL.md')],
] as const) {
const skills = await testCtx.skills.list({ cwd, scope: handle.agent })
expect(skills.filter(skill => skill.name === 'dsh-doc')).toHaveLength(1)
expect((await testCtx.skills.get('dsh-doc', { cwd, scope: handle.agent }))?.path).toBe(await realpath(path))
}
} finally {
try { await priorityCtx?.fiber.dispose() } finally {
vi.unstubAllEnvs()
await rm(root, { recursive: true, force: true })
}
}
})
})
describe('a user preset declared from the shipped cordis rows', () => {
/** The JSON text a `cordis_inspect_*` result renders. */
function resultText(result: { content: ReadonlyArray<{ type: string; text?: string }> }): string {
@@ -1,5 +1,5 @@
import { Context } from '@deepseek-ai/cordis'
import { DeepSeekAccount, type AccountView, type PlatformSession } from '@deepseek-ai/dsh-deepseek-account'
import { Context, Service } from '@deepseek-ai/cordis'
import type { DeepSeekAccount, AccountView, AccountUpdate, PlatformSession } from '@deepseek-ai/dsh-deepseek-account'
import { expect, it } from 'vitest'
import { installPlatformSessionPublisher } from '../src/platform-session.ts'
@@ -8,31 +8,21 @@ const state: AccountView = {
links: { usageUrl: 'https://platform.example/usage', topUpUrl: 'https://platform.example/top_up' },
}
class Account extends DeepSeekAccount {
getDeviceIdentity = async () => ({ osVersion: 'test-os' })
class Account extends Service implements Pick<DeepSeekAccount, 'getPlatformSession' | 'watch'> {
constructor(ctx: Context) { super(ctx, 'deepseekAccount') }
fail = false
identityChangesRequested = false
ended = Promise.withResolvers<undefined>()
reading = Promise.withResolvers<undefined>()
finished = Promise.withResolvers<undefined>()
read: () => Promise<PlatformSession | null> = async () => ({ origin: 'https://platform.example', userId: null, token: 'test' })
override async getState() { return state }
override async getProfile() { return null }
override async getBalance() { return null }
override async getUnnotifiedBonuses() { return null }
override async ackBonusNotified() { return false }
override async startSignIn() { return state }
override async cancelSignIn() { return state }
override async signOut() { return state }
override async rejectToken() {}
override async resolveToken() { return undefined }
override async getPlatformSession() { this.reading.resolve(undefined); return this.read() }
override async *watch(signal: AbortSignal, includeIdentityChanges = false) {
async getPlatformSession() { this.reading.resolve(undefined); return this.read() }
async *watch(signal: AbortSignal, includeIdentityChanges = false): AsyncIterable<AccountUpdate> {
this.identityChangesRequested = includeIdentityChanges
const abort = () => { this.ended.resolve(undefined) }
signal.addEventListener('abort', abort, { once: true })
try {
yield state
yield { type: 'snapshot', state }
await this.ended.promise
if (this.fail) throw new Error('fixture subscription failure')
} finally {
+4 -4
View File
@@ -15,8 +15,8 @@
en: 127ea90553cb6af7
zh: 7b1c5aec8558c684
/deepseek-harness-desktop/application-overview:
en: 1f59637852e162b4
zh: b1530a1af195cb92
en: 37d36f8d57214336
zh: ceb50c0fa866eb24
/deepseek-harness-desktop/terminal-command:
en: 5f2d25a1d8472647
zh: 2acb5c5d7d1917e2
@@ -57,8 +57,8 @@
en: f1302ed4a3ab58bb
zh: cb53b9b349815028
/deepseek-harness-desktop/updates:
en: 67bf0a18faa7aa76
zh: 782e14ce62bb939f
en: 8b0b9efeb83727ef
zh: 5ee95de48ceab392
/deepseek-harness-desktop/updates/local-desktop-settings:
en: dbe57394894b7368
zh: a3bb788c2ce631a4
+3 -3
View File
@@ -49,7 +49,7 @@ Desktop ships one pnpm distribution at `resources/runtime/primary-runtime/depend
Embedded Platform documents use a persistent WebContentsView partition keyed by a hash of the Platform origin and stable account ID. localStorage preferences, including dismissed notices, survive view closure and application restart; different accounts and origins use separate storage. The Host supplies the account ID from its latest successful profile read; while no ID is known, the document opens in a disposable partition that keeps no preference across opens. Opening a persistent partition clears cookies, filesystem, IndexedDB, Cache Storage, the HTTP and shader caches, service workers, and HTTP authentication before the document loads; a disposable partition clears all of its storage. Closing a view destroys the document, removes its request interceptors, and schedules the same cleanup, so authentication left by an unclean exit is cleared before the next document loads. The next open and application shutdown await that cleanup, and an update install waits for it before the installer takes over the exit. A failed cleanup rejects that open and blocks the same account until a later cleanup succeeds; other accounts keep opening. Sign-out destroys the document but retains account-scoped preferences for the next sign-in. A document already open in a disposable partition stays mounted when the account ID arrives for the same credential; the next open uses the account-scoped partition. The [storage decision](../../.agents/notes/implemented/architecture/2026-09-22-platform-browser-storage.md) describes the retention policy. Host sends account credentials through private Node IPC; account RPC and the Harness renderer receive no token. Before page scripts execute, the Platform preload performs one synchronous IPC to read the prepared main-process credential. It exposes displayMode, synchronous getAuthToken() and getLocale() getters, and onLocaleChange(listener), which returns an unsubscribe function. Both getters read preload memory without further IPC. The bootstrap includes the resolved Desktop language (`zh_CN` or `en_US`); Settings language changes update the preload cache and notify the open Platform document without reloading. Platform applies this language before its first render and does not persist it as a browser preference. The main-process handler performs only sender validation and an in-memory read; it never waits for Host, disk, or network. Trusted-page initialization failures retain embedded mode and make the getter throw, preventing browser-credential fallback. Only the owned Platform main frame on the configured issuer origin can initialize. Sign-out, credential replacement, Host shutdown, and view closure destroy the document. Cross-origin document navigation is blocked. HTTPS links requesting a new window open in the system browser without the embedded session or token; other schemes and URL credentials are rejected. Native views occupy the viewport below the Account feature’s return bar.
Desktop Host Platform API requests and update-policy requests identify the installed client with the same Platform client headers: platform, client version, locale, timezone offset in seconds, and a bundle id that is intentionally empty. Account operations take the calling UI's identity per call; the account provider owns [API-only header configuration](../../packages/credentials/deepseek-account-platform/README.md#use-this-package). Update policy additionally reports architecture, update channel, and bundled runtime version. The native account-state decoder accepts `no-response` sign-in failures and preserves the error code in the UI-safe projection.
Desktop Host Platform API requests and update-policy requests identify the installed client with the same Platform client headers: platform, client version, locale, timezone offset in seconds, and a bundle id that is intentionally empty. Account operations take the calling UI's identity per call; the account provider owns [API-only header configuration](../../packages/credentials/deepseek-account/README.md#use-this-package). Update policy additionally reports architecture, update channel, and bundled runtime version. The native account-state decoder accepts `no-response` sign-in failures and preserves the error code in the UI-safe projection.
A server-expired account credential returns to Welcome when no official API key is configured; an available API key keeps the workspace open. Explicit sign-out follows the same rule. Both Welcome and the workspace display the localized expiry notice.
@@ -278,11 +278,11 @@ Ordinary update dialogs use an isolated shell-origin WebContentsView inside the
Ordinary update dialogs, the Windows first-close notice, and mandatory-update documents share the UI design tokens bundled with the shell. Before displaying a card, each document resolves Electron's application theme through `prefers-color-scheme` and updates its dark-theme attribute when the palette changes. Welcome and update documents use the same initialization script. Explicit light/dark preferences and system appearance share this path; the isolated document keeps its background transparent, and dark mode adds a 1 CSS px token-based inset outline without changing the card size; light mode has no outline.
Packaged applications check fixed Nightly asynchronously at startup. Ordinary polling uses a ten-minute base interval with independently sampled ±20% jitter. Each check failure doubles the base delay up to one hour; success resets it. The randomized delay is bounded by that cap and starts after all joined callers settle. Foreground and system-resume checks respect the same monotonic deadline; the localized Check for Updates menu item, including in the Windows caption's Application menu, runs immediately and joins an in-flight check. A newly received mandatory policy also requests an immediate feed check. Automatic checks never open dialogs or download packages. Manual checks display checking, failure, or no-update feedback with the installed version. Ordinary update dialogs fade in and out in place; consecutive prompts replace the card content and reset its scroll position while retaining the dark translucent backdrop without blurring the parent page.
Packaged applications check fixed Nightly asynchronously at startup. Ordinary polling uses a ten-minute base interval with independently sampled ±20% jitter. Each check failure doubles the base delay up to one hour; success resets it. The randomized delay is bounded by that cap and starts after all joined callers settle. Foreground and system-resume checks respect the same monotonic deadline; the localized Check for Updates menu item, including in the Windows caption's Application menu, runs immediately and joins an in-flight check. A newly received mandatory policy also requests an immediate feed check. Automatic checks never open dialogs or download packages. Manual checks display checking, failure, or no-update feedback with the installed version. During downloading or verification, **Check for Updates…** shows the state at the time the dialog opens; it does not refresh as the operation advances. Downloading explains that the app remains usable; verification has no download-completion instruction. Closing the status dialog leaves the update running. If any ordinary shell prompt is already open, the action focuses it without replacing its pending decision; close it before requesting update status. Failure to create the status surface uses a native dialog with the same status text and controls; presentation failures are logged without changing the update operation. Ordinary update dialogs fade in and out in place; consecutive prompts replace the card content and reset its scroll position while retaining the dark translucent backdrop without blurring the parent page.
`DSH_DESKTOP_UPDATE_CHECK_INTERVAL_MS` configures the ordinary base interval, and `DSH_DESKTOP_UPDATE_CHECK_MAX_BACKOFF_MS` configures the cap; both accept integer milliseconds from 1000 through 2147483647, with the cap at least the interval. An omitted cap defaults to the larger of one hour and the interval. `DSH_DESKTOP_UPDATE_CHECK_JITTER` sets the fractional jitter from 0 through 1, defaulting to `0.2`; the final delay is at least one second and never exceeds the cap. These settings do not change mandatory-policy polling or authorize download retries.
The lower-left account row displays localized availability, a spinner with download percentage, verification, readiness, or a persistent red retry action with an accessible tooltip. This Web-embedded copy follows the active in-application language; native dialogs use the Desktop shell locale. The collapsed sidebar shows a dot on its top expand button. Connection status takes priority. Selecting an available release starts downloading immediately. Successful preparation automatically opens a shell-owned restart confirmation; closing it retains readiness without reopening the dialog. Selecting the ready entry opens confirmation again. Running agents, queued input, and running or stopping jobs trigger an interruption warning in that confirmation. API requests alone do not trigger the warning. After approval, the Host locks new requests, drains admitted requests, and rechecks tasks, including work created by an admitted write. A drain that exceeds the control-request deadline refuses installation and unlocks admission. Unknown task status, newly started work without interruption approval, or unsuccessful graceful teardown prevents installation. The Host exits as soon as it acknowledges completed teardown, so handles left open by plugins do not count against the graceful deadline. Ordinary quit asks about interruptible work as described under Closing the window and quitting, then hides the product window before stopping the Host, ignores new focus requests during teardown, and never installs an update. The next launch reconciles the version-bound runtime through the existing startup and recovery path.
The lower-left account row displays localized availability, a spinner with download percentage, verification, readiness, or a persistent red retry action with an accessible tooltip. This Web-embedded copy follows the active in-application language; native dialogs use the Desktop shell locale. The collapsed sidebar shows a dot on its top expand button. Connection status takes priority. Selecting an available release starts downloading immediately. Selecting its download percentage opens the same status dialog as Check for Updates, explaining that downloading runs in the background and the app remains usable. Successful preparation automatically opens a shell-owned restart confirmation; closing it retains readiness without reopening the dialog. Selecting the ready entry opens confirmation again. Running agents, queued input, and running or stopping jobs trigger an interruption warning in that confirmation. API requests alone do not trigger the warning. After approval, the Host locks new requests, drains admitted requests, and rechecks tasks, including work created by an admitted write. A drain that exceeds the control-request deadline refuses installation and unlocks admission. Unknown task status, newly started work without interruption approval, or unsuccessful graceful teardown prevents installation. The Host exits as soon as it acknowledges completed teardown, so handles left open by plugins do not count against the graceful deadline. Ordinary quit asks about interruptible work as described under Closing the window and quitting, then hides the product window before stopping the Host, ignores new focus requests during teardown, and never installs an update. The next launch reconciles the version-bound runtime through the existing startup and recovery path.
If task teardown fails after confirmed Host exit, installation is refused and the shell restores the current-version Host before allowing another restart confirmation. Installer launch failure after a clean Host stop uses the same recovery. After the replacement Host authenticates, the shell reloads the existing application URL so the Web page obtains its current port, cookie, and boot injections; page-load failure opens native fatal recovery. An unconfirmed process exit never permits a replacement Host. The downloaded target remains available for retry. A known mandatory policy remains blocking throughout recovery; unsuccessful Host restoration opens the native fatal-recovery dialog.
+3 -3
View File
@@ -49,7 +49,7 @@ Desktop 在 `resources/runtime/primary-runtime/dependencies/pnpm` 中携带一
Platform 内嵌文档使用持久化 WebContentsView 分区,分区名由 Platform 来源和稳定账号 ID 的哈希决定。localStorage 中的页面偏好(包括已关闭的通知)在关闭视图和重启应用后保留;不同账号和来源使用独立存储。账号 ID 来自 Host 最近一次成功的资料读取;尚无该 ID 时,文档在一次性分区中打开,该分区不跨次保留偏好。打开持久分区会先清理 Cookie、文件系统、IndexedDB、Cache Storage、HTTP 与着色器缓存、Service Worker 及 HTTP 认证状态;一次性分区则清理其全部存储。关闭视图会销毁文档、移除请求拦截器并安排相同的清理,因此异常退出遗留的认证会在下一个文档加载前被清除。下次打开和应用退出都会等待该清理完成,更新安装也会在安装器接管退出前等待。清理失败会使该次打开失败,并在后续清理成功前阻止同一账号打开;其他账号不受影响。退出登录会销毁文档,但保留账号偏好供下次登录使用。同一凭证下账号 ID 迟到时,已以一次性分区打开的文档保持挂载;下次打开使用账号分区。[存储决策](../../.agents/notes/implemented/architecture/2026-09-22-platform-browser-storage.zh.md)说明保留策略。Host 通过私有 Node IPC 发送账号凭证;账号 RPC 和 Harness 渲染进程不接收 token。Platform preload 在页面脚本执行前通过一次同步 IPC 读取主进程中已准备的凭证。它暴露 displayMode、同步的 getAuthToken() 和 getLocale() getter,以及返回取消订阅函数的 onLocaleChange(listener)。两个 getter 都只读取 preload 内存,不再调用 IPC。bootstrap 包含 Desktop 已解析的语言(`zh_CN` 或 `en_US`);Settings 语言变更会更新 preload 缓存并通知已打开的 Platform 文档,无需重载。Platform 在首屏渲染前应用该语言,且不将其持久化为浏览器偏好。主进程处理器仅校验调用来源并读取内存,不等待 Host、磁盘或网络。可信页面初始化失败时保留内嵌模式,由 getter 抛错,避免回退到浏览器凭证。只有受控 Platform 页面中、位于所配置签发来源的主 frame 能完成初始化。退登、凭证替换、Host 关闭及视图关闭都会销毁文档。跨来源文档导航被阻止。请求新窗口的 HTTPS 链接在系统浏览器中打开,不携带内嵌会话或 token;其他协议及带 URL 凭证的链接被拒绝。原生视图占据 Account 功能返回栏下方的视口。
Desktop Host 的 Platform API 请求与更新策略请求用相同的 Platform 客户端请求头标识已安装客户端:平台、客户端版本、语言、以秒为单位的时区偏移,以及有意保持为空的 bundle id。账号操作按调用逐次传入调用界面的身份;账号 provider 管理[仅 API 使用的请求头配置](../../packages/credentials/deepseek-account-platform/README.zh.md#use-this-package)。更新策略额外上报架构、更新通道和内置运行时版本。 原生账号状态解析器接受 `no-response` 登录失败,并在供 UI 使用的安全投影中保留该错误码。
Desktop Host 的 Platform API 请求与更新策略请求用相同的 Platform 客户端请求头标识已安装客户端:平台、客户端版本、语言、以秒为单位的时区偏移,以及有意保持为空的 bundle id。账号操作按调用逐次传入调用界面的身份;账号 provider 管理[仅 API 使用的请求头配置](../../packages/credentials/deepseek-account/README.zh.md#use-this-package)。更新策略额外上报架构、更新通道和内置运行时版本。 原生账号状态解析器接受 `no-response` 登录失败,并在供 UI 使用的安全投影中保留该错误码。
账号凭据被服务端判定失效后,未配置官方 API key 时返回 Welcome;有可用 API key 时保持工作区打开。主动退出登录遵循相同规则。Welcome 和工作区均显示本地化的登录失效提示。
@@ -278,11 +278,11 @@ macOS 在安装准备阶段等待产品主窗口退出全屏,再显示重启
普通更新弹窗、Windows 首次关闭提示和强更文档共用随壳打包的 UI design token。各文档在显示卡片前通过 `prefers-color-scheme` 解析 Electron 的应用主题,配色变化时同步暗色主题属性。欢迎页与更新文档复用同一初始化脚本。明确选择浅色/暗色及跟随系统共用此路径,隔离文档保持透明背景,仅暗色模式以基于 token 的 1 CSS px 内描边区分卡片,不改变尺寸;浅色模式不描边。
打包应用在启动后异步检查固定 Nightly。常规轮询以十分钟为基础间隔,每次独立采样 ±20% 的随机抖动。每次检查失败将基础延迟翻倍,上限为一小时;成功后重置。随机延迟不超过该上限,并从全部复用调用结算后开始计时。本地化的“检查更新…”菜单项(Windows 可从顶栏的“应用”菜单进入)立即执行,并复用正在进行的检查。回到前台和系统恢复时遵守相同的单调时钟截止时间。新收到的强更策略也会立即请求检查更新清单。自动检查从不弹窗或下载安装包。手动检查显示正在检查、失败或包含已安装版本号的无更新反馈。常规更新弹窗原位渐入渐出;连续弹窗替换卡片内容并重置其滚动位置,保留黑色半透明蒙层,不模糊父页面。
打包应用在启动后异步检查固定 Nightly。常规轮询以十分钟为基础间隔,每次独立采样 ±20% 的随机抖动。每次检查失败将基础延迟翻倍,上限为一小时;成功后重置。随机延迟不超过该上限,并从全部复用调用结算后开始计时。本地化的“检查更新…”菜单项(Windows 可从顶栏的“应用”菜单进入)立即执行,并复用正在进行的检查。回到前台和系统恢复时遵守相同的单调时钟截止时间。新收到的强更策略也会立即请求检查更新清单。自动检查从不弹窗或下载安装包。手动检查显示正在检查、失败或包含已安装版本号的无更新反馈。下载或校验期间,“**检查更新…**”显示打开提示时的状态,不随操作进展刷新。下载提示说明可以继续使用应用;校验提示不再包含下载完成的说明。关闭状态提示不影响更新。若已有普通壳弹窗,点击会聚焦该弹窗,保留其待确认操作;关闭后可再次查看更新状态。状态界面创建失败时,使用相同状态文案和按钮的原生弹窗兜底;展示失败仅记日志,不改变更新操作。常规更新弹窗原位渐入渐出;连续弹窗替换卡片内容并重置其滚动位置,保留黑色半透明蒙层,不模糊父页面。
`DSH_DESKTOP_UPDATE_CHECK_INTERVAL_MS` 配置常规基础间隔,`DSH_DESKTOP_UPDATE_CHECK_MAX_BACKOFF_MS` 配置上限;两者均接受 1000 至 2147483647 的整数毫秒数,且上限不能小于间隔。省略上限时取一小时与间隔中的较大值。`DSH_DESKTOP_UPDATE_CHECK_JITTER` 配置 0 至 1 的抖动比例,默认 `0.2`;最终延迟至少一秒,且不超过上限。这些配置不改变强更策略轮询,也不授权下载重试。
左下角账户行显示本地化的更新可用状态、加载图标与下载百分比、验证、就绪状态,或带可访问提示的持久红色重试操作。嵌入 Web 界面的文案跟随应用内当前语言;原生弹窗使用 Desktop 壳语言。侧栏收起时,顶部展开按钮显示圆点。连接状态优先展示。选择可用版本即开始下载。准备成功后自动打开壳拥有的重启确认;关闭后保留就绪状态,不重复弹窗。选择就绪入口可再次打开确认。运行中的 agent、排队输入,以及运行中或停止中的后台任务都会在该确认中触发中断警告。仅有 API 请求不会触发警告。用户批准后,Host 锁定新请求,等待已接收的请求结束,再检查任务,包括已接收写操作创建的工作。等待超过控制请求截止时间时,拒绝安装并解除准入锁。任务状态未知、未获中断授权的新任务,或未成功完成正常收尾,都会阻止安装。Host 确认收尾完成后立即退出,插件遗留的打开句柄不会占用正常收尾期限。常规退出先按"关闭窗口与退出"一节所述询问可中断的工作,再在停止 Host 前隐藏产品窗口,在收尾期间忽略新的聚焦请求,且从不安装更新。下次启动通过已有的启动与恢复流程校准版本绑定的运行时。
左下角账户行显示本地化的更新可用状态、加载图标与下载百分比、验证、就绪状态,或带可访问提示的持久红色重试操作。嵌入 Web 界面的文案跟随应用内当前语言;原生弹窗使用 Desktop 壳语言。侧栏收起时,顶部展开按钮显示圆点。连接状态优先展示。选择可用版本即开始下载。点击下载百分比会打开与“检查更新”相同的状态提示,说明更新正在后台下载,可以继续使用应用。准备成功后自动打开壳拥有的重启确认;关闭后保留就绪状态,不重复弹窗。选择就绪入口可再次打开确认。运行中的 agent、排队输入,以及运行中或停止中的后台任务都会在该确认中触发中断警告。仅有 API 请求不会触发警告。用户批准后,Host 锁定新请求,等待已接收的请求结束,再检查任务,包括已接收写操作创建的工作。等待超过控制请求截止时间时,拒绝安装并解除准入锁。任务状态未知、未获中断授权的新任务,或未成功完成正常收尾,都会阻止安装。Host 确认收尾完成后立即退出,插件遗留的打开句柄不会占用正常收尾期限。常规退出先按"关闭窗口与退出"一节所述询问可中断的工作,再在停止 Host 前隐藏产品窗口,在收尾期间忽略新的聚焦请求,且从不安装更新。下次启动通过已有的启动与恢复流程校准版本绑定的运行时。
若任务收尾失败但已确认 Host 退出,安装会被拒绝,壳会在允许再次确认重启前恢复当前版本的 Host。Host 正常停止后的安装器启动失败使用同一恢复路径。替代 Host 启动并完成认证后,壳重新加载原有应用地址,让 Web 页面获取当前端口、Cookie 和启动注入数据;页面加载失败时打开原生致命故障恢复弹窗。未确认进程退出时,绝不允许启动替代 Host。已下载目标保留以供重试。已知强更策略在恢复过程中继续阻塞;Host 恢复失败打开原生致命故障恢复弹窗。
+17 -6
View File
@@ -12,6 +12,19 @@ import { DesktopHostProcess } from '../src/host-process.ts'
import { createPluginProfile } from '../src/project-manager.ts'
import type { DesktopRuntimeDescriptor } from '../src/runtime-tree.ts'
const OFFICE_SKILLS = ['office', 'office-docx', 'office-pptx', 'office-xlsx']
/**
* Require each bundled Office skill to be listed and loaded with a nonempty body.
* @param results - Host probe results; `bytes` is the loaded body length, 0 when unlisted or not loaded.
* @throws Error listing every result when a bundled Office skill is missing or empty.
*/
export function assertOfficeSkillsLoadable(results: ReadonlyArray<{ readonly name: string; readonly bytes: number }>): void {
if (!OFFICE_SKILLS.every(name => results.some(skill => skill.name === name && skill.bytes > 0))) {
throw new Error(`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(results)}`)
}
}
/**
* Check CLI package operations, Host startup, its frontend, external plugins, packaged Office skill loading,
* and real Office rendering, conversion, and recalculation.
@@ -104,11 +117,11 @@ export function apply(ctx) {
ctx.effect(() => ctx.webServer.register({ kind: 'exact', path: '/desktop-smoke-skills',
async handler(_request, response) {
try {
const names = ['office', 'office-docx', 'office-pptx', 'office-xlsx']
const names = ${JSON.stringify(OFFICE_SKILLS)}
const listed = new Set((await ctx.skills.list()).map(skill => skill.name))
const loaded = await Promise.all(names.map(async name => {
const skill = listed.has(name) ? await ctx.skills.get(name) : undefined
return { name, path: skill?.path ?? null, bytes: skill?.content.length ?? 0 }
return { name, bytes: skill?.content.length ?? 0 }
}))
response.end(JSON.stringify(loaded))
} catch (error) {
@@ -190,10 +203,8 @@ export function apply(ctx) {
}
const skills = await fetch(new URL('/desktop-smoke-skills', ready.url), { headers: { cookie }, signal: AbortSignal.timeout(120_000) })
if (!skills.ok) throw new Error(`desktop runtime: Office skill loading failed: ${await skills.text()}`)
const loadedSkills = await skills.json() as Array<{ name: string; path: string | null; bytes: number }>
if (loadedSkills.some(skill => skill.path === null || skill.bytes === 0)) {
throw new Error(`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(loadedSkills)}`)
}
const loadedSkills = await skills.json() as { name: string; bytes: number }[]
assertOfficeSkillsLoadable(loadedSkills)
console.log('desktop runtime: packaged Office skills listed and loaded')
for (const { extension } of inputs) {
const converted = await fetch(new URL(`/desktop-smoke-office/${extension}`, ready.url), {
+8 -1
View File
@@ -117,7 +117,14 @@ export function desktopAccountBackend(origin: string, invoke: AccountInvoke, coo
}
if (frame.streamId === expiryStreamId && frame.type === 'item' && frame.value === 'session-expired') { expired(); return }
if (frame.streamId !== streamId) throw new Error('desktop account: unexpected stream')
if (frame.type === 'item') listener(accountView(frame.value))
if (frame.type === 'item') {
const update = frame.value
if (typeof update !== 'object' || update === null || !('type' in update)
|| (update.type !== 'snapshot' && update.type !== 'credentials-changed') || !('state' in update)) {
throw new Error('desktop account: invalid stream update')
}
listener(accountView(update.state))
}
else socket?.close()
} catch { socket?.close() }
})
+16
View File
@@ -138,6 +138,8 @@ export const en = {
updateClose: 'Close',
updateAcknowledge: 'OK',
updateLater: 'Update later',
updateDownloadInProgress: 'Downloading update',
updateDownloadDetail: 'The update is downloading in the background. You can continue using the app.',
updateDownloading: 'Downloading {percent}%…',
updateVerifying: 'Verifying update files…',
updateInstalling: 'Preparing to restart…',
@@ -331,6 +333,8 @@ export const zh = {
updateClose: '关闭',
updateAcknowledge: '确定',
updateLater: '稍后更新',
updateDownloadInProgress: '正在下载更新',
updateDownloadDetail: '更新正在后台下载,你可以继续使用应用。',
updateDownloading: '正在下载 {percent}%…',
updateVerifying: '正在校验更新文件…',
updateInstalling: '正在准备重启…',
@@ -522,6 +526,8 @@ export const ja = {
updateClose: '閉じる',
updateAcknowledge: 'OK',
updateLater: '後でアップデート',
updateDownloadInProgress: 'アップデートをダウンロード中',
updateDownloadDetail: 'アップデートをバックグラウンドでダウンロードしています。アプリは引き続き使用できます。',
updateDownloading: 'ダウンロード中 {percent}%…',
updateVerifying: 'アップデートファイルを検証中…',
updateInstalling: '再起動の準備中…',
@@ -713,6 +719,8 @@ export const es = {
updateClose: 'Cerrar',
updateAcknowledge: 'OK',
updateLater: 'Actualizar más tarde',
updateDownloadInProgress: 'Descargando actualización',
updateDownloadDetail: 'La actualización se está descargando en segundo plano. Puede seguir usando la aplicación.',
updateDownloading: 'Descargando {percent}%…',
updateVerifying: 'Verificando archivos de actualización...',
updateInstalling: 'Preparándose para reiniciar…',
@@ -904,6 +912,8 @@ export const fr = {
updateClose: 'Fermer',
updateAcknowledge: 'OK',
updateLater: 'Mettre à jour plus tard',
updateDownloadInProgress: 'Téléchargement de la mise à jour',
updateDownloadDetail: 'La mise à jour se télécharge en arrière-plan. Vous pouvez continuer à utiliser l’application.',
updateDownloading: 'Téléchargement de {percent}%…',
updateVerifying: 'Vérification des fichiers de mise à jour…',
updateInstalling: 'Préparation du redémarrage…',
@@ -1095,6 +1105,8 @@ export const de = {
updateClose: 'Schließen',
updateAcknowledge: 'OK',
updateLater: 'Später aktualisieren',
updateDownloadInProgress: 'Update wird heruntergeladen',
updateDownloadDetail: 'Das Update wird im Hintergrund heruntergeladen. Sie können die App weiter verwenden.',
updateDownloading: '{percent}% wird heruntergeladen…',
updateVerifying: 'Aktualisierungsdateien werden überprüft…',
updateInstalling: 'Neustart wird vorbereitet…',
@@ -1286,6 +1298,8 @@ export const ru = {
updateClose: 'Закрыть',
updateAcknowledge: 'OK',
updateLater: 'Обновить позже',
updateDownloadInProgress: 'Загрузка обновления',
updateDownloadDetail: 'Обновление загружается в фоновом режиме. Вы можете продолжать пользоваться приложением.',
updateDownloading: 'Загрузка {percent}%…',
updateVerifying: 'Проверка файлов обновлений…',
updateInstalling: 'Подготовка к перезапуску…',
@@ -1477,6 +1491,8 @@ export const pt = {
updateClose: 'Fechar',
updateAcknowledge: 'OK',
updateLater: 'Atualizar mais tarde',
updateDownloadInProgress: 'Baixando atualização',
updateDownloadDetail: 'A atualização está sendo baixada em segundo plano. Você pode continuar usando o aplicativo.',
updateDownloading: 'Baixando {percent}%…',
updateVerifying: 'Verificando arquivos de atualização…',
updateInstalling: 'Preparando para reiniciar…',
+15
View File
@@ -1012,6 +1012,21 @@ async function main(): Promise<void> {
if (authenticationOperation !== undefined) {
policyAuth?.focus(); updateDialog.focus()
}
if (!isMandatory() && (updates.state.phase === 'downloading' || updates.state.phase === 'verifying')) {
if (updateDialog.isOpen) {
updateDialog.focus()
return Promise.resolve()
}
const options = { type: 'info' as const, title: locale.messages.updateCheckTitle,
message: updates.state.phase === 'downloading' ? locale.messages.updateDownloadInProgress : locale.messages.updateVerifying,
detail: updates.state.phase === 'downloading' ? locale.messages.updateDownloadDetail : '', buttons: [locale.messages.updateClose], cancelId: 0,
}
return ordinaryMessageBox(options).then(() => {}).catch(async (error: unknown) => {
console.error(error)
try { await dialog.showMessageBox(options) }
catch (nativeError) { console.error(nativeError) }
})
}
let failedOperation: 'check' | 'download' | 'install' = 'check'
promptOperation ??= Promise.resolve().then(async () => {
if (manual) updateJournal?.action('check-requested')
+2 -1
View File
@@ -1,7 +1,8 @@
/** Mandatory-update policy, independent of local business traffic and updater artifacts. */
import { valid } from 'semver'
import { platformClientHeaders, type AccountClientMetadata } from '@deepseek-ai/dsh-deepseek-account'
import type { AccountClientMetadata } from '@deepseek-ai/dsh-deepseek-account'
import { platformClientHeaders } from '@deepseek-ai/dsh-deepseek-account/client-metadata'
/** Installed release identity; no field is supplied by a renderer. */
export interface DesktopPolicyIdentity {
+2 -1
View File
@@ -2,7 +2,8 @@
import type { EventEmitter } from 'node:events'
import { createHash, randomUUID } from 'node:crypto'
import { WebContentsView, session, shell, type Session, type View, type WebFrameMain } from 'electron'
import { mergePlatformCookies, platformClientHeaders, type PlatformSession } from '@deepseek-ai/dsh-deepseek-account'
import type { PlatformSession } from '@deepseek-ai/dsh-deepseek-account'
import { mergePlatformCookies, platformClientHeaders } from '@deepseek-ai/dsh-deepseek-account/client-metadata'
import { desktopClientMetadata } from './client-metadata.ts'
import { PLATFORM_IPC, type PlatformLocale } from './platform-ipc.ts'
+11 -3
View File
@@ -45,7 +45,12 @@ it('does not replay an expiry reason from an account snapshot', () => {
expect(accountView({ ...state, signOutReason: 'expired' })).toEqual(state)
})
it('receives live expiry separately from account snapshots', async () => {
it.each([
['snapshot', 'invalid'],
['credentials-changed', 'invalid'],
['snapshot', ['snapshot']],
['credentials-changed', ['credentials-changed']],
] as const)('receives %s state updates separately from live expiry and rejects type %j', async (type, invalidType) => {
const server = new WebSocketServer({ host: '127.0.0.1', port: 0 })
await once(server, 'listening')
onTestFinished(async () => {
@@ -61,8 +66,9 @@ it('receives live expiry separately from account snapshots', async () => {
links: { usageUrl: 'https://platform.deepseek.com/usage', topUpUrl: 'https://platform.deepseek.com/top_up' } }
const received = Promise.withResolvers<undefined>()
const backend = desktopAccountBackend(`http://127.0.0.1:${address.port}`, () => Promise.resolve(snapshot), 'dsh-auth-fixture=signed')
const failed = vi.fn()
const stop = backend.watch(
(value) => { expect(value).toEqual(snapshot); received.resolve(undefined) }, vi.fn(), expired, onAnalyticsEnabledChanged,
(value) => { expect(value).toEqual(snapshot); received.resolve(undefined) }, failed, expired, onAnalyticsEnabledChanged,
)
onTestFinished(stop)
const [, upgrade] = await connected as [unknown, IncomingMessage]
@@ -78,7 +84,7 @@ it('receives live expiry separately from account snapshots', async () => {
if (streams.size === 3) opened.resolve(undefined)
})
await opened.promise
socket.send(JSON.stringify({ type: 'item', streamId: streams.get('account/watch'), value: snapshot }))
socket.send(JSON.stringify({ type: 'item', streamId: streams.get('account/watch'), value: { type, state: snapshot } }))
await received.promise
socket.send(JSON.stringify({ type: 'item', streamId: streams.get('productAnalytics/watchPolicy'), value: true }))
await vi.waitFor(() => { expect(onAnalyticsEnabledChanged).toHaveBeenLastCalledWith(true) })
@@ -91,5 +97,7 @@ it('receives live expiry separately from account snapshots', async () => {
expect(expired).not.toHaveBeenCalled()
socket.send(JSON.stringify({ type: 'item', streamId: streams.get('account/watchExpiry'), value: 'session-expired' }))
await vi.waitFor(() => { expect(expired).toHaveBeenCalledOnce() })
socket.send(JSON.stringify({ type: 'item', streamId: streams.get('account/watch'), value: { type: invalidType, state: snapshot } }))
await vi.waitFor(() => { expect(failed).toHaveBeenCalledOnce() })
stop()
})
+71 -1
View File
@@ -2259,7 +2259,23 @@ describe('desktop main startup', () => {
const action = invoke(DESKTOP_IPC.updatesOpen, 'app')
await started.promise
const repeated = invoke(DESKTOP_IPC.updatesOpen, 'app')
expect(harness.dialog.showMessageBox).not.toHaveBeenCalled()
await repeated
expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({
message: en.updateDownloadInProgress, detail: en.updateDownloadDetail,
}))
harness.dialog.showMessageBox.mockClear()
const checks = harness.updateCheck.mock.calls.length
const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void
check()
await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({
message: en.updateDownloadInProgress, detail: en.updateDownloadDetail, buttons: [en.updateClose],
})) })
expect(harness.updateCheck).toHaveBeenCalledTimes(checks)
harness.shellDialog.isOpen = true
check()
expect(harness.shellDialog.focus).toHaveBeenCalled()
expect(harness.dialog.showMessageBox).toHaveBeenCalledOnce()
harness.shellDialog.isOpen = false
expect(harness.updateDownload).toHaveBeenCalledExactlyOnceWith('1.0.1-nightly.1', 0)
expect(harness.updateInstall).not.toHaveBeenCalled()
downloading.resolve({ phase: 'ready', version: '1.0.1-nightly.1' })
@@ -2269,6 +2285,60 @@ describe('desktop main startup', () => {
expect(harness.updateInstall).toHaveBeenCalledOnce()
})
it.each(['downloading', 'verifying'] as const)('explains %s when checking from the menu without another update operation', async (phase) => {
await readyForUpdate()
harness.updateState = { phase, version: '1.0.1-nightly.1', percent: 21 }
const checks = harness.updateCheck.mock.calls.length
const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void
check()
await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({
message: phase === 'downloading' ? en.updateDownloadInProgress : en.updateVerifying,
detail: phase === 'downloading' ? en.updateDownloadDetail : '', buttons: [en.updateClose], cancelId: 0,
})) })
expect(harness.updateCheck).toHaveBeenCalledTimes(checks)
expect(harness.updateDownload).not.toHaveBeenCalled()
expect(harness.updateInstall).not.toHaveBeenCalled()
expect(harness.updateState.phase).toBe(phase)
check()
await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledTimes(2) })
expect(harness.updateCheck).toHaveBeenCalledTimes(checks)
expect(harness.updateDownload).not.toHaveBeenCalled()
expect(harness.updateInstall).not.toHaveBeenCalled()
expect(harness.updateState.phase).toBe(phase)
})
it.each(['downloading', 'verifying'] as const)('falls back to native %s status without changing the message or restarting the update', async (phase) => {
await readyForUpdate()
harness.updateState = { phase, version: '1.0.1-nightly.1', percent: 21 }
const checks = harness.updateCheck.mock.calls.length
harness.dialog.showMessageBox.mockRejectedValueOnce(new Error('overlay unavailable'))
await invoke(DESKTOP_IPC.updatesOpen, 'app')
expect(harness.dialog.showMessageBox).toHaveBeenCalledTimes(2)
const first: unknown = harness.dialog.showMessageBox.mock.calls[0]!.at(-1)
expect(first).toEqual(expect.objectContaining(harness.dialog.showMessageBox.mock.calls[1]!.at(-1)))
expect(first).toEqual(expect.objectContaining({
type: 'info', message: phase === 'downloading' ? en.updateDownloadInProgress : en.updateVerifying,
detail: phase === 'downloading' ? en.updateDownloadDetail : '', buttons: [en.updateClose],
}))
expect(console.error).toHaveBeenCalledWith(expect.objectContaining({ message: 'overlay unavailable' }))
expect(harness.dialog.showErrorBox).not.toHaveBeenCalled()
expect(harness.updateCheck).toHaveBeenCalledTimes(checks)
expect(harness.updateDownload).not.toHaveBeenCalled()
expect(harness.updateInstall).not.toHaveBeenCalled()
expect(harness.updateState.phase).toBe(phase)
})
it('logs native status fallback failure without rejecting the user action', async () => {
await readyForUpdate()
harness.updateState = { phase: 'downloading', version: '1.0.1-nightly.1', percent: 21 }
harness.dialog.showMessageBox.mockRejectedValueOnce(new Error('overlay unavailable'))
.mockRejectedValueOnce(new Error('native unavailable'))
await expect(invoke(DESKTOP_IPC.updatesOpen, 'app')).resolves.toBeUndefined()
expect(console.error).toHaveBeenCalledWith(expect.objectContaining({ message: 'native unavailable' }))
expect(harness.dialog.showErrorBox).not.toHaveBeenCalled()
expect(harness.updateState.phase).toBe('downloading')
})
it('does not lock or stop tasks when restart confirmation is dismissed', async () => {
const host = await readyForUpdate()
harness.dialog.showMessageBox.mockResolvedValueOnce({ response: 1 })
+15 -2
View File
@@ -4,6 +4,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { assertOfficeSkillsLoadable } from '../scripts/smoke-runtime.ts'
import { DesktopHostProcess } from '../src/host-process.ts'
import { builtHost, prepareDesktopHome } from './harness.ts'
@@ -24,9 +25,14 @@ export function apply(ctx) {
ctx.effect(() => ctx.webServer.register({ kind: 'exact', path: '/${SKILL_PROBE}', async handler(_request, response) {
try {
const names = (await ctx.skills.list()).map(skill => skill.name).filter(name => name.startsWith('office'))
const listed = new Set(names)
const loaded = await Promise.all(${JSON.stringify(OFFICE_SKILLS)}.map(async name => {
const skill = listed.has(name) ? await ctx.skills.get(name) : undefined
return { name, bytes: skill?.content.length ?? 0 }
}))
const content = {}
for (const name of ['office', 'office-docx']) content[name] = (await ctx.skills.get(name))?.content ?? null
response.end(JSON.stringify({ names, content, officeKit: ctx.get('officeKit') !== undefined, tools: ctx.tools.schemas().map(tool => tool.name).filter(name => name.startsWith('office_')) }))
response.end(JSON.stringify({ names, content, loaded, officeKit: ctx.get('officeKit') !== undefined, tools: ctx.tools.schemas().map(tool => tool.name).filter(name => name.startsWith('office_')) }))
} catch (error) {
response.statusCode = 500
response.end(String(error?.stack ?? error))
@@ -70,7 +76,14 @@ describe.skipIf(!existsSync(builtHost))('built Desktop Host Office resources', (
const probe = await fetch(new URL(`/${SKILL_PROBE}`, url), { headers: { cookie } })
const body = await probe.text()
expect(probe.status, body).toBe(200)
const skills = JSON.parse(body) as { names: string[]; content: Record<string, string | null>; officeKit: boolean; tools: string[] }
const skills = JSON.parse(body) as {
names: string[]
content: Record<string, string | null>
loaded: { name: string; bytes: number }[]
officeKit: boolean
tools: string[]
}
assertOfficeSkillsLoadable(skills.loaded)
expect(skills.officeKit).toBe(true)
// Agent presets, not the Host root, mount the Office tools.
expect(skills.tools).toEqual([])
+35
View File
@@ -0,0 +1,35 @@
/** Behavioral checks for packaged Office skill probe results. */
import { describe, expect, it } from 'vitest'
import { assertOfficeSkillsLoadable } from '../scripts/smoke-runtime.ts'
const loadedSkills = [
{ name: 'office', bytes: 772 },
{ name: 'office-docx', bytes: 4543 },
{ name: 'office-pptx', bytes: 5167 },
{ name: 'office-xlsx', bytes: 5611 },
]
describe('assertOfficeSkillsLoadable', () => {
it('accepts all four Office skills with nonempty bodies and no path', () => {
expect(() => { assertOfficeSkillsLoadable(loadedSkills) }).not.toThrow()
})
it('rejects an unlisted or empty Office skill and reports every result', () => {
const results = loadedSkills.map(skill => skill.name === 'office-docx' ? { ...skill, bytes: 0 } : skill)
expect(() => { assertOfficeSkillsLoadable(results) }).toThrow(
`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(results)}`,
)
})
it('rejects results missing a bundled Office skill', () => {
const results = loadedSkills.filter(skill => skill.name !== 'office-xlsx')
expect(() => { assertOfficeSkillsLoadable(results) }).toThrow(
`desktop runtime: packaged Office skills are not loadable: ${JSON.stringify(results)}`,
)
})
it('ignores empty results for skills outside the bundled Office set', () => {
expect(() => { assertOfficeSkillsLoadable([...loadedSkills, { name: 'other', bytes: 0 }]) }).not.toThrow()
})
})
+1 -1
View File
@@ -83,7 +83,7 @@ describe.skipIf(!existsSync(builtHost))('built Desktop welcome flow', () => {
const nodeBin = join(root, 'runtime/primary-runtime/dependencies/node/bin')
mkdirSync(nodeBin, { recursive: true })
cpSync(process.execPath, join(nodeBin, process.platform === 'win32' ? 'node.exe' : 'node'))
writeFileSync(join(paths.profile, 'cordis.patch.yml'), `- id: webserver\n config:\n host: 127.0.0.1\n port: 0\n- id: deepseek-account\n config:\n${process.platform === 'linux' ? ' desktopPlatform: darwin\n' : ''} platformOrigin: ${platform.origin}\n allowLoopbackHttp: true\n requestHeaders:\n Cookie: test_gate=synthetic\n`)
writeFileSync(join(paths.profile, 'cordis.patch.yml'), `- id: webserver\n config:\n host: 127.0.0.1\n port: 0\n- id: deepseek-account\n config:\n${process.platform === 'linux' ? ' desktopPlatform: darwin\n' : ''} platformOrigin: ${platform.origin}\n harnessOrigin: ${platform.origin}\n allowLoopbackHttp: true\n requestHeaders:\n Cookie: test_gate=synthetic\n`)
let backend: DesktopWelcomeBackend
let hostOrigin = ''
const restart = async (): Promise<void> => {
+13 -3
View File
@@ -25,6 +25,7 @@ async function mockPlatform() {
let state: string | undefined
let redirectUri: string | undefined
let avatarRequests = 0
let notificationLists = 0
const server: Server = createServer((req, res) => {
const url = new URL(req.url ?? '/', 'http://127.0.0.1')
const reply = (payload: unknown): void => {
@@ -83,7 +84,10 @@ async function mockPlatform() {
reply({ normal_wallets: [{ currency: 'CNY', balance: '1.00' }], bonus_wallets: [] })
return
}
if (url.pathname === '/api/v0/users/get_unnotified_bonuses') { reply([]); return }
if (url.pathname === '/api/v0/users/notifications/list') {
notificationLists++
reply({ next_poll_after: 600, notifications: [] }); return
}
res.writeHead(404).end()
})
await new Promise<void>((resolve) => { server.listen(0, '127.0.0.1', resolve) })
@@ -91,7 +95,7 @@ async function mockPlatform() {
if (address === null || typeof address === 'string') throw new Error('account login: missing mock listener')
const origin = `http://127.0.0.1:${String(address.port)}`
return {
origin, inits, pages, avatarRequests: () => avatarRequests,
origin, inits, pages, avatarRequests: () => avatarRequests, notificationLists: () => notificationLists,
close: () => new Promise<void>((resolve) => { server.close(() => { resolve() }); server.closeAllConnections() }),
}
}
@@ -144,7 +148,9 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
await menu.locator('[data-avatar-status="failed"]').waitFor()
expect(await menu.locator('img').count()).toBe(0)
const states: string[] = []
let expectedLists = 1
const capture = async (stage: string): Promise<void> => {
await expect.poll(platform.notificationLists).toBe(expectedLists)
const sidebar = menu.locator('[data-avatar-status]')
const account = page.getByRole('region', { name: 'Account', exact: true })
const mounted = await account.count() > 0
@@ -152,10 +158,11 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
? await account.locator('[data-avatar-status]').getAttribute('data-avatar-status') : 'unmounted'
states.push(`${stage}: sidebar=${await sidebar.getAttribute('data-avatar-status')}, settings=${settingsStatus}, `
+ `sidebarImages=${await menu.locator('img').count()}, settingsImages=${mounted ? await account.locator('img').count() : 0}, `
+ `requests=${platform.avatarRequests()}`)
+ `requests=${platform.avatarRequests()}, notificationLists=${platform.notificationLists()}`)
}
await capture('Initial load')
await menu.click()
expectedLists++
await page.getByRole('menuitem', { name: 'Settings', exact: true }).click()
const settings = page.getByRole('dialog', { name: 'Settings', exact: true })
const account = settings.getByRole('region', { name: 'Account', exact: true })
@@ -167,6 +174,7 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
await settings.getByRole('button', { name: 'Close', exact: true }).click()
await settings.waitFor({ state: 'detached' })
await menu.click()
expectedLists++
await page.getByRole('menuitem', { name: 'Settings', exact: true }).click()
await expect.poll(() => menu.locator('img').count()).toBe(1)
await expect.poll(() => account.locator('img').count()).toBe(1)
@@ -179,6 +187,7 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
await settings.getByRole('button', { name: 'Close', exact: true }).click()
await settings.waitFor({ state: 'detached' })
await menu.click()
expectedLists++
await page.getByRole('menuitem', { name: 'Settings', exact: true }).click()
await account.waitFor()
expect(await menu.locator('img').count()).toBe(1)
@@ -194,6 +203,7 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
await settings.getByRole('button', { name: 'Close', exact: true }).click()
await settings.waitFor({ state: 'detached' })
await menu.click()
expectedLists++
await page.getByRole('menuitem', { name: 'Settings', exact: true }).click()
await expect.poll(() => menu.locator('img').count()).toBe(1)
await expect.poll(() => account.locator('img').count()).toBe(1)
+269 -62
View File
@@ -22,10 +22,10 @@ const MODE = webSnapshotMode()
const TOKEN = 'dsh_bonus_notice_test'
const ACCOUNT_ID = 'bonus-user'
const ORDER_FIRST = 'bonus-notice-first'
const ORDER_LATER = '33333333-3333-4333-8333-333333333333'
const ORDER_FIRST = 'notice-first'
const ORDER_LATER = 'notice-later'
const ORDER_EN = '44444444-4444-4444-8444-444444444444'
const ORDER_RETRY = '55555555-5555-4555-8555-555555555555'
const ORDER_FAILED_EVENT = '55555555-5555-4555-8555-555555555555'
const ORDER_REPEAT = '66666666-6666-4666-8666-666666666666'
const ORDER_TOPUP = '77777777-7777-4777-8777-777777777777'
const ORDER_WEB = '99999999-9999-4999-8999-999999999999'
@@ -65,9 +65,14 @@ interface AckRecord {
async function mockPlatform() {
const unnotified: Granted[] = []
const gets: GetRecord[] = []
const contentReads: { id: string | null; locale: string | undefined }[] = []
const contents = new Map<string, Granted>()
/** Reads already answered; a request the client is still awaiting is not evidence of a delivered response. */
const served: GetRecord[] = []
const acks: AckRecord[] = []
const dismissals: AckRecord[] = []
const clicks: AckRecord[] = []
let includeUnsupportedNotification = false
/** Wallet reads, one per balance refresh the settings panel performs. */
const summaries: GetRecord[] = []
let normalBalance = '12.34'
@@ -78,20 +83,31 @@ async function mockPlatform() {
let keepUnnotified = false
/** Refuse the wallet read, which is how a Platform outage or an unparsable payload reaches the client. */
let failSummary = false
let holdProfile = false
const pendingProfiles: (() => void)[] = []
const releaseProfiles = (): void => { holdProfile = false; for (const reply of pendingProfiles.splice(0)) reply() }
/** Reply held back while the test controls when a read can answer. */
let heldReply: (() => void) | undefined
const grant = (orderId: string, amount: string, extraCopy = ''): void => {
unnotified.unshift({
const value = {
orderId, amount,
zh_CN: `已赠送您 ${amount} 元 DSH 体验赠金。${extraCopy}`,
en_US: `You received a CNY ${amount} DSH trial credit.${extraCopy}`,
})
}
unnotified.unshift(value)
contents.set(orderId, value)
}
/** @param value - granted bonus. @param locale - request language. @returns its wire fields. */
const wire = (value: Granted, locale: string | undefined): unknown => ({
order_id: value.orderId, expires_at: value.orderId === ORDER_FIRST ? null : expiresAt(),
...(value.orderId === ORDER_FIRST ? { title: '平台通知' } : {}),
msg: locale === 'en_US' ? value.en_US : value.zh_CN,
id: value.orderId, created_at: '2026-10-21T08:00:00Z',
display_until: value.orderId === ORDER_FIRST ? null : expiresAt(),
title: value.orderId === ORDER_FIRST ? (locale === 'en_US' ? 'Platform notice' : '平台通知')
: locale === 'en_US' ? 'Bonus credited' : '赠金已到账',
body: locale === 'en_US' ? value.en_US : value.zh_CN,
actions: value.orderId === 'b1111111-1111-4111-8111-111111111111' ? [
{ label: locale === 'en_US' ? 'View balance' : '查看余额', style: 'primary', target: { type: 'app_route', name: 'account' } },
{ label: locale === 'en_US' ? 'Got it' : '知道了', style: 'secondary', target: { type: 'dismiss' } },
] : [],
})
const server: Server = createServer((req, res) => {
const url = new URL(req.url ?? '/', 'http://127.0.0.1')
@@ -103,10 +119,14 @@ async function mockPlatform() {
}
if (req.headers['x-dsh-auth-token'] !== TOKEN) { res.writeHead(401).end(); return }
if (url.pathname === '/auth-api/v0/users/current') {
// `email` is required by the provider's profile schema even when the account has none.
reply({ code: 0, data: { biz_code: 0, biz_data: {
id: ACCOUNT_ID, email: '', id_profile: { name: 'Bonus User', picture: null },
} } })
const answer = (): void => {
// `email` is required by the provider's profile schema even when the account has none.
reply({ code: 0, data: { biz_code: 0, biz_data: {
id: ACCOUNT_ID, email: '', id_profile: { name: 'Bonus User', picture: null },
} } })
}
if (holdProfile) pendingProfiles.push(answer)
else answer()
return
}
if (url.pathname === '/api/v0/users/get_user_summary') {
@@ -118,28 +138,48 @@ async function mockPlatform() {
} } })
return
}
if (url.pathname === '/api/v0/users/get_unnotified_bonuses') {
if (url.pathname === '/api/v0/users/notifications/list') {
const record = { locale, query: url.search }
gets.push(record)
const payload = { code: 0, data: { biz_code: 0, biz_data: unnotified.map(value => wire(value, locale)) } }
const payload = { code: 0, data: { biz_code: 0, biz_data: {
next_poll_after: 3600, notifications: [
...includeUnsupportedNotification ? [{
id: 'unsupported-action', created_at: '2026-10-21T00:00:00Z', display_until: null,
title: 'Unsupported action', body: 'Not supported by this client',
actions: [{ label: 'Open', style: 'primary', target: { type: 'future' } }],
}] : [],
...unnotified.map(value => wire(value, locale)),
],
} } }
const answer = (): void => { served.push(record); reply(payload) }
if (heldReply === undefined) { answer(); return }
heldReply = answer
return
}
if (url.pathname === '/api/v0/users/ack_bonus_notified' && req.method === 'POST') {
if (url.pathname === '/api/v0/users/notifications/content') {
const id = url.searchParams.get('id')
contentReads.push({ id, locale })
const value = id === null ? undefined : contents.get(id)
if (value === undefined) { res.writeHead(404).end(); return }
reply({ code: 0, data: { biz_code: 0, biz_data: wire(value, locale) } })
return
}
if (url.pathname === '/api/v0/users/notifications/events' && req.method === 'POST') {
let body = ''
req.setEncoding('utf8')
req.on('data', (chunk: string) => { body += chunk })
req.on('end', () => {
const payload: unknown = JSON.parse(body)
const orderId = typeof payload === 'object' && payload !== null && 'order_id' in payload
&& typeof payload.order_id === 'string' ? payload.order_id : null
acks.push({ method: req.method ?? '', path: url.pathname, locale, orderId, body,
const orderId = typeof payload === 'object' && payload !== null && 'notification_id' in payload
&& typeof payload.notification_id === 'string' ? payload.notification_id : null
const event = typeof payload === 'object' && payload !== null && 'type' in payload ? payload.type : null
if (event !== 'displayed' && event !== 'cta_clicked' && event !== 'dismissed') { res.writeHead(400).end(); return }
const records = event === 'displayed' ? acks : event === 'cta_clicked' ? clicks : dismissals
records.push({ method: req.method ?? '', path: url.pathname, locale, orderId, body,
query: url.search, contentType: req.headers['content-type'], at: performance.now() })
if (ackFailure !== undefined && ackFailure.orderId === orderId && ackFailure.remaining > 0) {
if (event === 'displayed' && ackFailure !== undefined && ackFailure.orderId === orderId && ackFailure.remaining > 0) {
ackFailure.remaining--
// A transient gateway failure: the client retries it after its backoff.
// The event is lost; a later notification read can offer this order again.
res.writeHead(502, { 'content-type': 'text/plain' }).end('Internal Server Error')
return
}
@@ -147,8 +187,8 @@ async function mockPlatform() {
reply({ code: 0, msg: '', data: { biz_code: 1, biz_msg: 'BONUS_ORDER_NOT_FOUND', biz_data: null } }); return
}
const index = unnotified.findIndex(value => value.orderId === orderId)
if (index >= 0 && !keepUnnotified) unnotified.splice(index, 1)
reply({ code: 0, msg: '', data: { biz_code: 0, biz_msg: '', biz_data: null } })
if (index >= 0 && !keepUnnotified && event !== 'cta_clicked') unnotified.splice(index, 1)
reply({ code: 0, msg: '', data: { biz_code: 0, biz_msg: '', biz_data: { acked: true } } })
})
return
}
@@ -160,7 +200,11 @@ async function mockPlatform() {
if (address === null || typeof address === 'string') throw new Error('bonus notice: missing mock listener')
return {
origin: `http://127.0.0.1:${String(address.port)}`,
grant, gets, served, acks, summaries,
grant, gets, served, acks, clicks, dismissals, summaries, contentReads,
setUnsupportedNotification: (value: boolean): void => { includeUnsupportedNotification = value },
holdProfiles: (): void => { holdProfile = true },
pendingProfileResponses: (): number => pendingProfiles.length,
releaseProfiles,
/** @param value - recharge balance the settings page reads next. */
setNormalBalance: (value: string): void => { normalBalance = value },
/** @param value - bonus balance the settings page reads next. */
@@ -176,7 +220,7 @@ async function mockPlatform() {
/** Hold the next unnotified-bonus read so the test can observe the in-flight state. */
holdNextGet: (): void => { heldReply = () => undefined },
releaseGet: (): void => { const held = heldReply; heldReply = undefined; held?.() },
close: () => new Promise<void>((resolve) => { server.close(() => { resolve() }); server.closeAllConnections() }),
close: () => new Promise<void>((resolve) => { releaseProfiles(); server.close(() => { resolve() }); server.closeAllConnections() }),
}
}
@@ -286,6 +330,8 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
// A read the renderer never received cannot become a displayed notice: while the
// response is held there is no card and no acknowledgement.
platform.holdNextGet()
platform.holdProfiles()
platform.setUnsupportedNotification(true)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await expect.poll(() => platform.gets.length, { timeout: 30_000 }).toBe(1)
observations.push(`startup.held cards=${String(await noticeCards(page).count())} acks=${String(platform.acks.length)}`)
@@ -296,21 +342,34 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
// Startup signs in and reads the notice; the card shows it and only then is it acknowledged.
observations.push(`startup.notice=${await shownNotice(page, zhFirst)}`)
observations.push(`startup.ack orders=${await acked(platform, 1)}`)
expect(await noticeCards(page).count()).toBe(1)
expect(platform.acks.some(record => record.orderId === 'unsupported-action')).toBe(false)
observations.push('startup.unsupported-action skipped=true valid-card=true displayed=false')
platform.setUnsupportedNotification(false)
await expect.poll(platform.pendingProfileResponses).toBeGreaterThan(0)
observations.push('startup.profile-pending notice=true displayed=1')
platform.releaseProfiles()
const get = platform.gets[0]!
const ack = platform.acks[0]!
observations.push(`startup.get locale=${String(get.locale)} query=${get.query}`)
observations.push(`startup.ack method=${ack.method} path=${ack.path} locale=${String(ack.locale)} order_id=${String(ack.orderId)} body=${JSON.stringify(ack.body)}`)
observations.push(`startup.ack method=${ack.method} path=${ack.path} locale=${String(ack.locale)} notification_id=${String(ack.orderId)} body=${JSON.stringify(ack.body)}`)
expect(get.locale).toBe('zh_CN')
expect(get.query).toBe('')
expect(ack).toMatchObject({
method: 'POST', path: '/api/v0/users/ack_bonus_notified', locale: 'zh_CN', orderId: ORDER_FIRST,
body: JSON.stringify({ order_id: ORDER_FIRST }), query: '', contentType: 'application/json',
method: 'POST', path: '/api/v0/users/notifications/events', locale: 'zh_CN', orderId: ORDER_FIRST,
body: JSON.stringify({ notification_id: ORDER_FIRST, type: 'displayed' }), query: '', contentType: 'application/json',
})
// Closing the card only hides it; the acknowledgement already sent is not repeated.
// Explicit close reports dismissal without repeating the display event.
await noticeCards(page).getByRole('button', { name: '关闭', exact: true }).click()
expect(await noticeCards(page).count()).toBe(0)
expect(platform.acks).toHaveLength(1)
await expect.poll(() => platform.dismissals.length).toBe(1)
expect(platform.dismissals[0]).toMatchObject({
method: 'POST', path: '/api/v0/users/notifications/events', orderId: ORDER_FIRST,
body: JSON.stringify({ notification_id: ORDER_FIRST, type: 'dismissed' }),
})
observations.push('startup.close event=dismissed displayed=1 dismissed=1')
// A new grant and balance arrive before settings opens; one panel entry refreshes both once.
platform.grant(ORDER_LATER, '8.00')
@@ -463,32 +522,27 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
await noticeCards(page).getByRole('button', { name: '关闭', exact: true }).click()
expect(await noticeCards(page).count()).toBe(0)
// A transient acknowledgement failure keeps the card and retries the same order after
// the backoff; the pending retry is page state, not browser storage.
const zhRetry = '已赠送您 6.00 元 DSH 体验赠金。'
platform.grant(ORDER_RETRY, '6.00')
platform.failNextAcks(ORDER_RETRY, 1)
// A failed event leaves the card intact and is not retried in the background.
const zhFailedEvent = '已赠送您 6.00 元 DSH 体验赠金。'
platform.grant(ORDER_FAILED_EVENT, '6.00')
platform.failNextAcks(ORDER_FAILED_EVENT, 1)
await openSettings(page, 'zh')
const retryDialog = page.getByRole('dialog', { name: '设置', exact: true })
await retryDialog.waitFor()
observations.push(`retry.notice=${await shownNotice(page, zhRetry)}`)
const retryAttempts = (): AckRecord[] => platform.acks.filter(item => item.orderId === ORDER_RETRY)
await expect.poll(() => retryAttempts().length, { timeout: 30_000 }).toBe(1)
// The failed attempt does not withdraw the card the user is reading.
expect(await noticeCards(page).count()).toBe(1)
await expect.poll(() => retryAttempts().length, { timeout: 30_000 }).toBe(2)
const attempts = retryAttempts()
// The first retry follows the configured first delay rather than arriving immediately.
// Only the lower bound is asserted: load can widen the observed gap, never shorten it
// below the timer's own 1s first step.
const retryGapMs = attempts[1]!.at - attempts[0]!.at
const retryBodyKept = attempts.every(item => item.body === JSON.stringify({ order_id: ORDER_RETRY })
const failedEventDialog = page.getByRole('dialog', { name: '设置', exact: true })
await failedEventDialog.waitFor()
observations.push(`event-failed.notice=${await shownNotice(page, zhFailedEvent)}`)
const failedAttempts = (): AckRecord[] => platform.acks.filter(item => item.orderId === ORDER_FAILED_EVENT)
await expect.poll(() => failedAttempts().length, { timeout: 30_000 }).toBe(1)
await page.clock.install()
await page.clock.fastForward(60_000)
const attempts = failedAttempts()
const eventBodyKept = attempts.every(item => item.body === JSON.stringify({ notification_id: ORDER_FAILED_EVENT, type: 'displayed' })
&& item.query === '' && item.contentType === 'application/json')
observations.push(`retry.attempts=${String(attempts.length)} backoff=${String(retryGapMs >= 900)} body-kept=${String(retryBodyKept)} cards=${String(await noticeCards(page).count())}`)
expect(retryGapMs).toBeGreaterThanOrEqual(900)
expect(retryBodyKept).toBe(true)
observations.push(`event-failed.attempts=${String(attempts.length)} body-kept=${String(eventBodyKept)} cards=${String(await noticeCards(page).count())}`)
expect(attempts).toHaveLength(1)
expect(eventBodyKept).toBe(true)
expect(await noticeCards(page).count()).toBe(1)
await page.keyboard.press('Escape')
await retryDialog.waitFor({ state: 'detached', timeout: 30_000 })
await failedEventDialog.waitFor({ state: 'detached', timeout: 30_000 })
await noticeCards(page).getByRole('button', { name: '关闭', exact: true }).click()
// Display follows each response: the double keeps serving an acknowledged order, which
@@ -580,31 +634,72 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
observations.push(`web.notice=${webNotice} acks=1`)
await webPage.close()
platform.clearUnnotified()
platform.grant('stack-third', '23.00')
platform.grant('stack-second', '22.00', '\nMore details'.repeat(8))
platform.grant('stack-first', '21.00')
platform.grant('a3333333-3333-4333-8333-333333333333', '23.00')
platform.grant('a2222222-2222-4222-8222-222222222222', '22.00', '\nMore details'.repeat(8))
platform.grant('a1111111-1111-4111-8111-111111111111', '21.00')
const ackStart = platform.acks.length
const stackPage = await openDesktopPage('zh-CN')
await stackPage.setViewportSize({ width: 900, height: 960 })
await stackPage.emulateMedia({ colorScheme: 'light' })
await stackPage.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
const cards = noticeCards(stackPage)
await expect.poll(() => cards.count()).toBe(3)
expect(await cards.first().isVisible()).toBe(false)
expect(platform.acks.length).toBe(ackStart)
observations.push('stack.hidden cards=3 acks=0')
await stackPage.setViewportSize({ width: 1440, height: 960 })
await expect.poll(() => cards.first().isVisible()).toBe(true)
await expect.poll(() => platform.acks.length).toBe(ackStart + 1)
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['stack-first'])
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['a1111111-1111-4111-8111-111111111111'])
expect(await stackPage.getByRole('status').count()).toBe(1)
const second = cards.filter({ hasText: '22.00' })
const secondNode = await second.elementHandle()
const frontBox = await cards.first().boundingBox()
const backBox = await second.boundingBox()
expect(frontBox!.width).toBeCloseTo(280, 0)
expect(backBox!.width).toBeCloseTo(272, 0)
expect(frontBox!.x).toBeCloseTo(10, 0)
expect(frontBox!.width).toBeCloseTo(260, 0)
expect(frontBox!.x + frontBox!.width).toBeCloseTo(270, 0)
expect(backBox!.width).toBeCloseTo(252, 0)
expect(backBox!.y).toBeCloseTo(frontBox!.y - 4, 0)
const transition = await second.evaluate((element) => {
const style = getComputedStyle(element)
return `${style.transitionDuration} ${style.transitionTimingFunction}`
})
expect(transition).toBe('0.25s ease-out')
observations.push(`stack.initial cards=3 acks=stack-first widths=280,272 offset=-4 transition=${transition}`)
observations.push(`stack.initial cards=3 acks=stack-first widths=260,252 inset=10 offset=-4 transition=${transition}`)
for (const [delta, width, edge] of [[80, 280, 360], [-80, 260, 280]] as const) {
const handle = await stackPage.locator('[data-side="sidebar"]').boundingBox()
const x = handle!.x + handle!.width / 2
const y = handle!.y + handle!.height / 2
await stackPage.mouse.move(x, y)
await stackPage.mouse.down()
await stackPage.mouse.move(x + delta, y, { steps: 5 })
await stackPage.mouse.up()
await expect.poll(async () => Math.round((await cards.first().boundingBox())!.width)).toBe(width)
const movedHandle = await stackPage.locator('[data-side="sidebar"]').boundingBox()
expect(movedHandle!.x + movedHandle!.width / 2).toBeCloseTo(edge, 0)
const resized = await cards.first().boundingBox()
expect(resized!.x).toBeCloseTo(10, 0)
expect(resized!.x + resized!.width).toBeCloseTo(10 + width, 0)
observations.push(`stack.resized sidebar=${edge} card=${width} left-inset=10`)
}
const beforeCollapseAcks = platform.acks.length
const beforeCollapseDismissals = platform.dismissals.length
await stackPage.setViewportSize({ width: 900, height: 960 })
await stackPage.locator('[data-sidebar-collapsed]:not([data-sidebar-drawer])').waitFor()
await expect.poll(() => cards.first().isVisible()).toBe(false)
expect(await cards.count()).toBe(3)
expect(platform.dismissals.length).toBe(beforeCollapseDismissals)
observations.push('stack.rail cards=3 visible=false dismissed=0')
await stackPage.setViewportSize({ width: 1440, height: 960 })
await stackPage.locator('[data-sidebar-collapsed]').waitFor({ state: 'detached' })
await expect.poll(() => cards.first().isVisible()).toBe(true)
expect(await cards.count()).toBe(3)
expect(await second.evaluate((element, previous) => element === previous, secondNode)).toBe(true)
expect(await cardText(cards.first())).toContain('21.00')
expect(platform.acks.length).toBe(beforeCollapseAcks)
expect(platform.dismissals.length).toBe(beforeCollapseDismissals)
observations.push('stack.expanded cards=3 duplicate-acks=0 dismissed=0')
const artifactDir = fileURLToPath(new URL('../../../.artifacts', import.meta.url))
await mkdir(artifactDir, { recursive: true })
await stackPage.screenshot({ path: join(artifactDir, 'bonus-notice-stack-light.png') })
@@ -635,20 +730,132 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
expect(promotion.middle.y).toBeLessThan(promotion.start.y)
expect(promotion.middle.y).toBeGreaterThan(promotion.end.y)
await expect.poll(() => cards.count()).toBe(2)
await expect.poll(async () => Math.round((await second.boundingBox())!.width)).toBe(280)
await expect.poll(async () => Math.round((await second.boundingBox())!.width)).toBe(260)
expect(await second.evaluate((element, previous) => element === previous, secondNode)).toBe(true)
expect(await second.getAttribute('data-front')).toBe('true')
await expect.poll(() => platform.acks.length).toBe(ackStart + 2)
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['stack-first', 'stack-second'])
observations.push('stack.promoted cards=2 acks=stack-first,stack-second width=280 same-node=true')
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['a1111111-1111-4111-8111-111111111111', 'a2222222-2222-4222-8222-222222222222'])
observations.push('stack.promoted cards=2 acks=stack-first,stack-second width=260 same-node=true')
await second.getByRole('button', { name: '关闭', exact: true }).click()
await expect.poll(() => platform.acks.length).toBe(ackStart + 3)
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['stack-first', 'stack-second', 'stack-third'])
expect(platform.acks.slice(ackStart).map(ack => ack.orderId)).toEqual(['a1111111-1111-4111-8111-111111111111', 'a2222222-2222-4222-8222-222222222222', 'a3333333-3333-4333-8333-333333333333'])
await cards.filter({ hasText: '23.00' }).getByRole('button', { name: '关闭', exact: true }).click()
await expect.poll(() => cards.count()).toBe(0)
await expect.poll(() => platform.dismissals.filter(record => record.orderId?.startsWith('a')).length).toBe(3)
const stackDismissals = platform.dismissals.filter(record => record.orderId?.startsWith('a'))
expect(stackDismissals.map(record => record.body)).toEqual(stackDismissals.map(record =>
JSON.stringify({ notification_id: record.orderId, type: 'dismissed' })))
observations.push('stack.dismissed cards=0 acks=stack-first,stack-second,stack-third')
await stackPage.close()
platform.grant('b1111111-1111-4111-8111-111111111111', '31.00')
const refreshAckStart = platform.acks.length
const refreshPage = await openDesktopPage('zh-CN')
await refreshPage.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
const refreshCards = noticeCards(refreshPage)
await shownNotice(refreshPage, '已赠送您 31.00 元 DSH 体验赠金。')
await expect.poll(() => platform.acks.length).toBe(refreshAckStart + 1)
const firstNode = await refreshCards.first().elementHandle()
platform.grant('b3333333-3333-4333-8333-333333333333', '33.00')
platform.grant('b2222222-2222-4222-8222-222222222222', '32.00')
await openSettings(refreshPage, 'zh')
await expect.poll(() => refreshCards.count()).toBe(3)
expect(await cardText(refreshCards.first())).toContain('31.00')
expect(await refreshCards.first().evaluate((element, previous) => element === previous, firstNode)).toBe(true)
expect(platform.acks.slice(refreshAckStart).map(ack => ack.orderId)).toEqual(['b1111111-1111-4111-8111-111111111111'])
observations.push('refresh.retained cards=3 acks=refresh-first same-node=true')
const localeReads = platform.gets.length
const localeContents = platform.contentReads.length
await refreshPage.getByRole('dialog', { name: '设置', exact: true }).getByRole('button', { name: '通用设置', exact: true }).click()
await refreshPage.getByRole('button', { name: '中文', exact: true }).click()
await refreshPage.getByRole('menuitem', { name: 'English', exact: true }).click()
await refreshPage.getByRole('dialog', { name: 'Settings', exact: true }).waitFor()
await expect.poll(() => cardText(refreshCards.first())).toContain('You received a CNY 31.00')
expect(await refreshCards.first().evaluate((element, previous) => element === previous, firstNode)).toBe(true)
expect(platform.gets.length).toBe(localeReads)
expect(platform.acks.length).toBe(refreshAckStart + 1)
expect(platform.contentReads.slice(localeContents).map(read => read.locale)).toEqual(['en_US', 'en_US', 'en_US'])
expect(await refreshCards.first().getByRole('button', { name: 'View balance', exact: true }).count()).toBe(1)
observations.push('refresh.localized locale=en_US content-reads=3 list-reads=0 acks=1 same-node=true')
await refreshPage.keyboard.press('Escape')
await refreshPage.getByRole('dialog', { name: 'Settings', exact: true }).waitFor({ state: 'detached' })
const clicksBeforeAction = platform.clicks.length
const dismissalsBeforeClick = platform.dismissals.length
await refreshCards.first().getByRole('button', { name: 'View balance', exact: true }).click()
await expect.poll(() => platform.clicks.length).toBe(clicksBeforeAction + 1)
expect(platform.clicks.at(-1)?.body).toBe(JSON.stringify({ notification_id: 'b1111111-1111-4111-8111-111111111111', type: 'cta_clicked' }))
expect(platform.dismissals.length).toBe(dismissalsBeforeClick)
expect(await refreshCards.count()).toBe(3)
const accountSettings = refreshPage.getByRole('dialog', { name: 'Settings', exact: true })
await accountSettings.waitFor()
expect(await accountSettings.getByRole('button', { name: 'Account', exact: true }).getAttribute('aria-current')).toBe('true')
observations.push('refresh.business-action event=cta_clicked cards=3 account-open=true')
await refreshPage.keyboard.press('Escape')
await accountSettings.waitFor({ state: 'detached' })
await refreshPage.setViewportSize({ width: 390, height: 844 })
await refreshPage.locator('[data-sidebar-drawer][data-sidebar-collapsed]').waitFor()
await expect.poll(() => refreshCards.first().isVisible()).toBe(false)
expect(await refreshCards.count()).toBe(3)
await refreshPage.locator('[data-shell-leading]').getByRole('button', { name: 'Open sidebar', exact: true }).click()
const drawer = refreshPage.locator('[data-sidebar-drawer]:not([data-sidebar-collapsed])')
await drawer.waitFor()
expect(await refreshCards.first().evaluate(element => element.closest('[role="dialog"]')?.getAttribute('aria-label'))).toBe('Navigation')
await expect.poll(() => drawer.locator('[data-sidebar-mask]').evaluate(element => getComputedStyle(element).opacity)).toBe('1')
await expect.poll(() => refreshCards.first().getByRole('button', { name: 'Got it', exact: true }).evaluate((element) => {
const rect = element.getBoundingClientRect()
return element.contains(document.elementFromPoint(rect.x + rect.width / 2, rect.y + rect.height / 2))
})).toBe(true)
observations.push('refresh.drawer width=390 notice-above-sidebar=true')
const cardBounds = await refreshCards.first().boundingBox()
const drawerBounds = await drawer.getByRole('dialog', { name: 'Navigation', exact: true }).boundingBox()
const actionBounds = await refreshCards.first().getByRole('button', { name: 'View balance', exact: true }).boundingBox()
expect(cardBounds!.x - drawerBounds!.x).toBeCloseTo(10, 0)
expect(drawerBounds!.width - cardBounds!.width).toBeCloseTo(20, 0)
expect(cardBounds!.x).toBeGreaterThanOrEqual(0)
expect(cardBounds!.x + cardBounds!.width).toBeLessThanOrEqual(390)
expect(actionBounds!.x + actionBounds!.width).toBeLessThanOrEqual(cardBounds!.x + cardBounds!.width)
const dismissalsBeforeAction = platform.dismissals.length
await refreshCards.first().getByRole('button', { name: 'Got it', exact: true }).click()
expect(await drawer.count()).toBe(1)
await expect.poll(() => platform.dismissals.length).toBe(dismissalsBeforeAction + 1)
expect(platform.dismissals.at(-1)?.orderId).toBe('b1111111-1111-4111-8111-111111111111')
expect(platform.clicks.length).toBe(clicksBeforeAction + 1)
observations.push('refresh.action event=dismissed got-it=true')
await expect.poll(() => platform.acks.length).toBe(refreshAckStart + 2)
expect(await cardText(refreshCards.first())).toContain('32.00')
observations.push('refresh.promoted cards=2 acks=refresh-first,refresh-second')
await refreshCards.first().getByRole('button', { name: 'Close', exact: true }).click()
await expect.poll(() => platform.acks.length).toBe(refreshAckStart + 3)
expect(platform.acks.slice(refreshAckStart).map(ack => ack.orderId)).toEqual(['b1111111-1111-4111-8111-111111111111', 'b2222222-2222-4222-8222-222222222222', 'b3333333-3333-4333-8333-333333333333'])
await refreshCards.first().getByRole('button', { name: 'Close', exact: true }).click()
await expect.poll(() => refreshCards.count()).toBe(0)
observations.push('refresh.dismissed cards=0 acks=refresh-first,refresh-second,refresh-third')
await refreshPage.close()
const pollFirst = 'c1111111-1111-4111-8111-111111111111'
const pollSecond = 'c2222222-2222-4222-8222-222222222222'
platform.grant(pollFirst, '41.00')
const pollPage = await openDesktopPage('en-US')
await pollPage.clock.install()
await pollPage.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await shownNotice(pollPage, 'You received a CNY 41.00 DSH trial credit.')
await expect.poll(() => platform.acks.at(-1)?.orderId).toBe(pollFirst)
const pollCards = noticeCards(pollPage)
const retainedNode = await pollCards.first().elementHandle()
const pollReads = platform.gets.length
const pollAcks = platform.acks.length
platform.grant(pollSecond, '42.00')
await pollPage.clock.fastForward(3_600_000)
await expect.poll(() => pollCards.count()).toBe(2)
expect(platform.gets.length).toBe(pollReads + 1)
expect(platform.acks.length).toBe(pollAcks)
expect(await pollCards.first().evaluate((element, previous) => element === previous, retainedNode)).toBe(true)
await openSettings(pollPage, 'en')
await expect.poll(() => platform.gets.length).toBe(pollReads + 2)
expect(await pollCards.count()).toBe(2)
observations.push('poll.arrival cards=2 list-reads=1 duplicate-acks=0 same-node=true settings-immediate-read=true')
await pollPage.close()
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'notice-flow.expected.md'), observations.join('\n'), MODE)
for (const tripwire of tripwires) {
expect(tripwire.warnings).toEqual([])
@@ -0,0 +1,169 @@
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { fileURLToPath } from 'node:url'
import { join } from 'node:path'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import { prepareSessionSnapshotFixtureForComparison } from '@deepseek-ai/dsh-llm-replay'
import type { SessionId } from '@deepseek-ai/dsh-session'
import type {} from '@deepseek-ai/dsh-agent'
import type {} from '@deepseek-ai/dsh-subagent'
import { launchWebScaffold, selectedSessionFixture, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { connectFreshWorkspace, newEnglishPage, openSettings, saveFailureShot } from './support.ts'
const BASE_FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
const LABEL = 'event-sourcing researcher'
const PNG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='
/** Duplicate the base turn so the child owns its own replayed history. */
function childFixture(source: string, fixtureId: string): string {
const [header, ...eventLines] = source.trimEnd().split('\n')
if (header === undefined) throw new Error('base replay fixture has no header')
const value = JSON.parse(header) as Record<string, unknown>
value.id = fixtureId
return [JSON.stringify(value), ...eventLines, ''].join('\n')
}
async function waitForAgentToSettle(scaffold: WebScaffold, id: SessionId): Promise<void> {
const deadline = Date.now() + 30_000
while (scaffold.ctx.agents.get(id) !== undefined) {
if (Date.now() >= deadline) throw new Error(`subagent ${id} did not settle`)
await new Promise<void>(resolve => setTimeout(resolve, 10))
}
}
/** Put one PNG on the system clipboard, confirm the clipboard holds it, then paste it with the platform shortcut. */
async function pasteImage(page: Page): Promise<void> {
const types = await page.evaluate(async (base64) => {
const bytes = Uint8Array.from(atob(base64), char => char.charCodeAt(0))
await navigator.clipboard.write([new ClipboardItem({ 'image/png': new Blob([bytes], { type: 'image/png' }) })])
return (await navigator.clipboard.read()).flatMap(item => item.types)
}, PNG_BASE64)
expect(types).toContain('image/png')
await page.keyboard.press('ControlOrMeta+V')
}
/** Leave every control, as after clicking a transcript's empty space. */
async function blurAll(page: Page): Promise<void> {
await page.evaluate(() => { (document.activeElement as HTMLElement | null)?.blur() })
expect(await page.evaluate(() => document.activeElement === document.body)).toBe(true)
}
/** Editors of the main Conversation composer and the Sidebar chat composer. */
const MAIN_INPUT = '[data-composer-input][contenteditable="true"]:not([data-sidebar-chat] *)'
const SIDEBAR_INPUT = '[data-sidebar-chat] [data-composer-input][contenteditable="true"]'
/** Image thumbnails currently in each composer's draft rail. */
async function railImages(page: Page): Promise<{ main: number; sidebar: number }> {
return page.evaluate(() => {
const count = (root: Element | null): number =>
root?.querySelectorAll('[data-composer-card] img').length ?? 0
const sidebar = document.querySelector('[data-sidebar-chat]')
const main = [...document.querySelectorAll('[data-conversation-content]')]
.find(element => sidebar === null || !sidebar.contains(element)) ?? null
return { main: count(main), sidebar: count(sidebar) }
})
}
describe('web e2e: composer paste routing', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let sidecarRoot: string
beforeAll(async () => {
if (webSnapshotMode() === 'record') throw new Error('composer paste routing is a keyless assembled scenario')
const selectedBaseFixture = await selectedSessionFixture(BASE_FIXTURE)
const baseFixture = prepareSessionSnapshotFixtureForComparison(await readFile(selectedBaseFixture, 'utf8'))
sidecarRoot = await mkdtemp(join(tmpdir(), 'dsh-web-paste-'))
const childFixturePath = join(sidecarRoot, 'child.jsonl')
await writeFile(childFixturePath, childFixture(baseFixture, 'recorded-subagent'))
scaffold = await launchWebScaffold({
replayFixture: selectedBaseFixture,
compareReplaySession: false,
replayChildFixtures: [childFixturePath],
paceMs: 25,
})
browser = await chromium.launch()
page = await newEnglishPage(browser)
await page.context().grantPermissions(['clipboard-read', 'clipboard-write'])
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
await connectFreshWorkspace(page, scaffold.workspaceCwd)
const parent = scaffold.ctx.agents.list().filter(agent => agent.session.header.origin !== 'subagent')[0]
if (parent === undefined) throw new Error('fresh workspace did not publish its parent Agent')
const parentSettled = scaffold.whenTurnSettled()
const parentInput = page.locator('[data-composer-input][contenteditable="true"]').first()
await parentInput.fill('Ask a research subagent to explain event sourcing.')
await parentInput.press('Enter')
expect(await parentSettled).toBe(parent.id)
const started = await scaffold.ctx.subagents.startActivation({
delivery: 'parent', provider: 'spawn', label: LABEL, signal: new AbortController().signal,
prompt: [{ type: 'text', text: 'Explain event sourcing in one sentence.' }],
parent,
})
await waitForAgentToSettle(scaffold, started.childId)
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
await page.getByRole('treeitem', { name: new RegExp(LABEL) })
.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
await page.locator('[data-sidebar-chat] [data-composer-card]').waitFor({ timeout: 15_000 })
})
afterAll(async () => {
await browser?.close()
await scaffold?.close()
if (sidecarRoot !== undefined) await rm(sidecarRoot, { recursive: true, force: true })
})
it('pastes into the focused editor once and an unfocused paste into the last focused composer', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-composer-paste'))
const before = await railImages(page)
await page.locator(SIDEBAR_INPUT).click()
await pasteImage(page)
await expect.poll(() => railImages(page)).toEqual({ main: before.main, sidebar: before.sidebar + 1 })
await blurAll(page)
await pasteImage(page)
await expect.poll(() => railImages(page)).toEqual({ main: before.main, sidebar: before.sidebar + 2 })
await page.locator(MAIN_INPUT).click()
await blurAll(page)
await pasteImage(page)
await expect.poll(() => railImages(page)).toEqual({ main: before.main + 1, sidebar: before.sidebar + 2 })
})
it('ignores an unfocused paste while Settings is open', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-composer-paste-modal'))
await page.locator(MAIN_INPUT).click()
await blurAll(page)
const before = await railImages(page)
await openSettings(page, 'en')
const settings = page.getByRole('dialog', { name: 'Settings' })
await settings.waitFor()
await pasteImage(page)
await page.keyboard.press('Escape')
await settings.waitFor({ state: 'detached' })
await blurAll(page)
// Exactly one image after a paste that would succeed: the paste behind Settings added none.
await pasteImage(page)
await expect.poll(() => railImages(page)).toEqual({ main: before.main + 1, sidebar: before.sidebar })
})
it('sends an unfocused paste to the main composer once the focused Sidebar collapses', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-composer-paste-collapsed'))
await page.locator(SIDEBAR_INPUT).click()
const before = await railImages(page)
await page.getByRole('button', { name: 'Collapse right sidebar', exact: true }).click()
await page.getByRole('button', { name: 'Open right sidebar', exact: true }).waitFor()
// The collapsed Sidebar keeps the chat mounted inside an inert dock section.
expect(await page.locator('[data-sidebar-chat] [data-composer-card]')
.evaluate(card => card.closest('[inert]') !== null)).toBe(true)
await blurAll(page)
try {
await pasteImage(page)
await expect.poll(() => railImages(page)).toEqual({ main: before.main + 1, sidebar: before.sidebar })
} finally {
await page.getByRole('button', { name: 'Open right sidebar', exact: true }).click()
await page.locator(SIDEBAR_INPUT).waitFor()
}
})
})
+55
View File
@@ -0,0 +1,55 @@
/** Creator mode adds its DSH customization intent to the actual model prompt. */
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { chromium } from 'playwright'
import { expect, it } from 'vitest'
import type {} from '@deepseek-ai/dsh-token-meter'
import { fixtureUserPrompts, launchWebScaffold } from './scaffold.ts'
import { connectFreshWorkspace, newEnglishPage } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/creator-persona/session.v4.jsonl', import.meta.url))
const CUSTOMIZATION_INTENT = 'You help the user customize DeepSeek Harness itself.'
it('sends the Creator customization intent without taking actions for an ordinary request', async () => {
const scaffold = await launchWebScaffold({
replayFixture: FIXTURE, compareReplaySession: true, paceMs: 10,
agentPresets: { default: 'cordis' },
})
try {
const browser = await chromium.launch()
try {
const page = await newEnglishPage(browser)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
await connectFreshWorkspace(page, scaffold.workspaceCwd)
const prompts = fixtureUserPrompts(await readFile(FIXTURE, 'utf8'))
expect(prompts).toHaveLength(1)
const settled = scaffold.whenTurnSettled()
const composer = page.locator('[data-composer-input][contenteditable="true"]').last()
await composer.fill(prompts[0]!)
await composer.press('Enter')
const sessionId = await settled
const agent = scaffold.ctx.agents.get(sessionId)
if (agent === undefined) throw new Error('Creator persona session is missing')
expect(agent.session.header.agentPreset).toBe('cordis')
const system = agent.session.deriveMessages().find(message => message.role === 'system')
if (system === undefined) throw new Error('Creator request has no system prompt')
const prompt = system.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('')
expect(prompt).toMatch(/^You are a coding agent powered by the .+ model\. You help the user customize DeepSeek Harness itself\.$/mu)
expect(prompt.split(CUSTOMIZATION_INTENT)).toHaveLength(2)
const sharedPrompt = prompt.replace(` ${CUSTOMIZATION_INTENT}`, '')
console.info('Creator persona context increment', {
utf8Bytes: Buffer.byteLength(prompt) - Buffer.byteLength(sharedPrompt),
codePoints: Array.from(prompt).length - Array.from(sharedPrompt).length,
heuristicTokens: scaffold.ctx.tokenMeter.estimateMessage(system)
- scaffold.ctx.tokenMeter.estimateMessage({ ...system, content: [{ type: 'text', text: sharedPrompt }] }),
})
expect(agent.session.snapshotEvents().filter(event => event.type === 'tool/call')).toEqual([])
await page.getByText('READY', { exact: true }).waitFor()
} finally {
await browser.close()
}
} finally {
await scaffold.close()
}
})
+4 -4
View File
@@ -31,7 +31,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
const state = join(root, 'permissions.json'), audit = join(root, 'helper-events.jsonl')
const launchApplication = { name: 'DSH Computer Use.app', path: '/Applications/DSH Computer Use.app',
icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAADElEQVQImWNgZGIGAAAOAAeCcsnOAAAAAElFTkSuQmCC' }
await writeFile(state, JSON.stringify({ accessibility: false, screenRecording: false, launchApplication }))
await writeFile(state, JSON.stringify({ platform: 'darwin' as const, accessibility: false, screenRecording: false, launchApplication }))
await writeFile(join(root, 'observe-helper'), '')
const fixturePatch = join(root, 'native-fixture.yml')
// Keep the external helper override above bundle order changes when CUA is re-enabled.
@@ -201,7 +201,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
await accessibility.getByRole('button', { name: 'Request permission', exact: true }).click()
await expect.poll(() => panel.getAttribute('aria-busy')).toBe('false')
expect(await accessibility.getByRole('button', { name: 'Request permission', exact: true }).count()).toBe(1)
await writeFile(state, JSON.stringify({ accessibility: true, screenRecording: false, launchApplication }))
await writeFile(state, JSON.stringify({ platform: 'darwin' as const, accessibility: true, screenRecording: false, launchApplication }))
// Returning from System Settings refreshes the page's native permission observation.
await page.evaluate(() => { window.dispatchEvent(new Event('focus')) })
await accessibility.getByText('Allowed', { exact: true }).waitFor()
@@ -297,7 +297,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
await trace.evaluate((value) => { value.stop() })
await trace.dispose()
}
await writeFile(state, JSON.stringify({ accessibility: 'unavailable', screenRecording: false }))
await writeFile(state, JSON.stringify({ platform: 'darwin', accessibility: 'unavailable', screenRecording: false }))
await page.evaluate(() => { window.dispatchEvent(new Event('focus')) })
const diagnostic = panel.getByRole('alert')
await diagnostic.waitFor()
@@ -325,7 +325,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
}
await expect.poll(() => rowToggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false')
await expect.poll(() => rowToggle.isEnabled(), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe(true)
await writeFile(state, JSON.stringify({ accessibility: false, screenRecording: false, launchApplication }))
await writeFile(state, JSON.stringify({ platform: 'darwin', accessibility: false, screenRecording: false, launchApplication }))
await rowToggle.click()
await expect.poll(() => rowToggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('true')
await expect.poll(() => panel.getAttribute('aria-busy'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false')
@@ -1,9 +1,14 @@
/** Web DeepSeek configuration, credential reuse, and saved model selection. */
/** Web provider credentials, environment fallback, and DeepSeek model selection. */
import { readFile } from 'node:fs/promises'
import { once } from 'node:events'
import { createServer } from 'node:http'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { chromium, webkit, type Browser, type Page } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import { BlockAssembler, createUserMessage, type StreamChunk } from '@deepseek-ai/dsh-llm'
import { credentialRef } from '@deepseek-ai/dsh-credentials'
import { createLaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment'
import {
captureStableAria, compareOrRefreshGolden, launchWebScaffold,
watchConsole, webSnapshotMode, type WebScaffold,
@@ -12,6 +17,157 @@ import { openSettings, connectFreshWorkspaceZh, saveFailureShot, ZH_BROWSER_LOCA
const EXPECTED = fileURLToPath(new URL('./expected/deepseek-messages-settings/', import.meta.url))
it.skipIf(webSnapshotMode() === 'record').each(['deepseek-official', 'google', 'openai', 'acme-gateway'])(
'clears the saved %s key and sends the next request with environment authentication', async (provider) => {
const messages = provider === 'deepseek-official'
const google = provider === 'google'
const ref = credentialRef(messages ? 'DEEPSEEK_API_KEY' : `${provider.toUpperCase().replaceAll('-', '_')}_API_KEY`)
const envRef = google ? 'GEMINI_API_KEY' : ref
const calls: { path: string; key: string | undefined }[] = []
const server = createServer((request, response) => {
request.on('end', () => {
const key = request.headers[messages ? 'x-api-key' : google ? 'x-goog-api-key' : 'authorization']
calls.push({ path: request.url ?? '', key: typeof key === 'string' ? key : undefined })
const events = messages ? [
{ type: 'message_start', message: { id: 'clear', type: 'message', role: 'assistant', model: 'clear-model', content: [], usage: { input_tokens: 1, output_tokens: 0 } } },
{ type: 'content_block_start', index: 0, content_block: { type: 'text', text: '' } },
{ type: 'content_block_delta', index: 0, delta: { type: 'text_delta', text: 'connection-ok' } },
{ type: 'content_block_stop', index: 0 },
{ type: 'message_delta', delta: { stop_reason: 'end_turn', stop_sequence: null }, usage: { output_tokens: 1 } },
{ type: 'message_stop' },
] : google ? [{ candidates: [{ content: { role: 'model', parts: [{ text: 'connection-ok' }] }, finishReason: 'STOP' }] }]
: [{ id: 'clear', object: 'chat.completion.chunk', choices: [{ index: 0, delta: { content: 'connection-ok' }, finish_reason: null }] },
{ id: 'clear', object: 'chat.completion.chunk', choices: [{ index: 0, delta: {}, finish_reason: 'stop' }] }]
response.writeHead(200, { 'content-type': 'text/event-stream' })
response.end(events.map(event => `data: ${JSON.stringify(event)}\n\n`).join(''))
})
request.resume()
})
server.listen(0, '127.0.0.1')
await once(server, 'listening')
let scaffold: WebScaffold | undefined
let browser: Browser | undefined
try {
const address = server.address()
if (address === null || typeof address === 'string') throw new Error('Missing credential test listener')
const baseURL = `http://127.0.0.1:${String(address.port)}/configured`
scaffold = await launchWebScaffold({
deepSeekMissingCredential: true,
openInAppEnvironment: createLaunchEnvironmentSnapshot([{ source: 'process', values: { [envRef]: 'fixture-environment-key' } }]),
})
const profile = { apiKeyEnv: ref, baseURL, models: [{ id: 'clear-model' }],
...messages || google ? {} : { api: 'openai-completions' } }
await scaffold.ctx.settings.mutate(messages ? 'llm-deepseek' : 'llm-pi-ai', [{
op: 'set', path: messages ? [] : ['providers', provider], value: profile,
}])
await scaffold.ctx.credentials.set(ref, 'fixture-saved-key')
const runtime = scaffold.ctx
const generate = async (): Promise<void> => {
const assembler = new BlockAssembler()
const chunks: StreamChunk[] = []
for await (const chunk of runtime.llm.stream({ provider, model: 'clear-model',
messages: [createUserMessage({ content: [{ type: 'text', text: 'Reply connection-ok' }], source: { kind: 'user' } })] })) {
chunks.push(chunk)
assembler.push(chunk)
}
expect(assembler.message({ provider, model: 'clear-model' }).content, JSON.stringify(chunks))
.toContainEqual({ type: 'text', text: 'connection-ok' })
}
await generate()
browser = await chromium.launch()
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
await page.goto(scaffold.authenticatedUrl)
await openSettings(page, 'zh')
const dialog = page.getByRole('dialog', { name: '设置' })
await dialog.getByRole('button', { name: '模型', exact: true }).click()
const edit = dialog.getByRole('button', { name: `编辑 ${messages ? 'DeepSeek (deepseek-official)' : provider}`, exact: true })
await edit.click()
const key = dialog.getByLabel('API 密钥', { exact: true })
await key.press('Delete')
expect(await key.getAttribute('placeholder')).toBe(`留空使用环境认证(${envRef})`)
await dialog.getByText(`保存以清除已保存的 API key。之后使用环境认证(${envRef})。`, { exact: true }).waitFor()
expect((await runtime.credentials.resolve(ref))?.source).toBe('file')
if (messages) await compareOrRefreshGolden(join(EXPECTED, 'clear-key.expected.md'),
await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd), webSnapshotMode())
await dialog.getByRole('button', { name: '取消', exact: true }).click()
expect((await runtime.credentials.resolve(ref))?.source).toBe('file')
await edit.click()
await key.press('Delete')
await dialog.getByRole('button', { name: '保存', exact: true }).click()
await expect.poll(() => key.count()).toBe(0)
await generate()
expect(calls).toHaveLength(2)
expect(calls[0]?.key).toBe(messages || google ? 'fixture-saved-key' : 'Bearer fixture-saved-key')
expect(calls[1]).toEqual({ path: calls[0]?.path,
key: messages || google ? 'fixture-environment-key' : 'Bearer fixture-environment-key' })
expect(calls[1]?.path).toContain('/configured/')
expect(await readFile(join(scaffold.harnessHome, '.credentials.yaml'), 'utf8')).not.toContain('fixture-saved-key')
await edit.click()
await dialog.getByText(`已检测到环境变量(${envRef})`, { exact: true }).waitFor()
await dialog.getByText('自定义设置', { exact: true }).click()
expect(await dialog.getByLabel('API 地址', { exact: true }).inputValue()).toBe(baseURL)
expect(await dialog.getByRole('button', { name: '清除已保存密钥', exact: true }).count()).toBe(0)
} finally {
try { await browser?.close() } finally {
try { await scaffold?.close() } finally {
await new Promise<void>((resolve, reject) => server.close((error) => {
if (error === undefined) resolve()
else reject(error)
}))
}
}
}
},
)
it.each([{ name: 'Chromium', engine: chromium }, { name: 'WebKit', engine: webkit }])(
'protects saved keys and reveals only unsaved replacements in $name', async ({ engine }) => {
const scaffold = await launchWebScaffold({ deepSeekMissingCredential: true })
let browser: Browser | undefined
try {
await scaffold.ctx.credentials.set(credentialRef('DEEPSEEK_API_KEY'), 'fixture-protected-old-key')
browser = await engine.launch()
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
await page.goto(scaffold.authenticatedUrl)
await openSettings(page, 'zh')
const dialog = page.getByRole('dialog', { name: '设置' })
await dialog.getByRole('button', { name: '模型', exact: true }).click()
const edit = dialog.getByRole('button', { name: '编辑 DeepSeek (deepseek-official)', exact: true })
await edit.click()
const key = dialog.getByLabel('API 密钥', { exact: true })
expect(await key.getAttribute('placeholder')).toBe(`fixture-prote${'•'.repeat(8)}-key`)
expect(await key.inputValue()).toBe('')
expect(await dialog.getByRole('button', { name: '显示密钥' }).count()).toBe(0)
expect(await page.locator('body').innerHTML()).not.toContain('fixture-protected-old-key')
await key.press('Backspace')
await dialog.getByText('保存以清除已保存的 API key。之后使用环境认证(DEEPSEEK_API_KEY)。', { exact: true }).waitFor()
expect(await key.getAttribute('placeholder')).toBe('留空使用环境认证(DEEPSEEK_API_KEY)')
await dialog.getByRole('button', { name: '取消', exact: true }).click()
await edit.click()
expect(await key.getAttribute('placeholder')).toBe(`fixture-prote${'•'.repeat(8)}-key`)
await key.fill('fixture-new-key')
await dialog.getByText('保存以替换已保存的 API key。', { exact: true }).waitFor()
await dialog.getByRole('button', { name: '显示密钥', exact: true }).click()
expect(await key.getAttribute('type')).toBe('text')
expect(await key.inputValue()).toBe('fixture-new-key')
await key.press('ControlOrMeta+A')
await key.press('ControlOrMeta+X')
await expect.poll(() => key.inputValue()).toBe('')
await key.fill('fixture-new-key')
await dialog.getByRole('button', { name: '保存', exact: true }).click()
await expect.poll(() => key.count()).toBe(0)
await edit.click()
expect(await key.getAttribute('placeholder')).toBe('•'.repeat('fixture-new-key'.length))
expect(await key.inputValue()).toBe('')
expect(await key.getAttribute('type')).toBe('password')
expect(await dialog.getByRole('button', { name: '显示密钥' }).count()).toBe(0)
expect(await page.locator('body').innerHTML()).not.toContain('fixture-new-key')
} finally {
try { await browser?.close() } finally { await scaffold.close() }
}
},
)
it.each([{ name: 'Chromium', engine: chromium }, { name: 'WebKit', engine: webkit }])(
'keeps a foreign model drag from editing another provider input in $name', async ({ engine }) => {
const scaffold = await launchWebScaffold({ deepSeekMissingCredential: true })
@@ -90,6 +246,10 @@ describe.skipIf(webSnapshotMode() === 'record')('web e2e: DeepSeek Messages sett
expect(await dialog.getByText('DeepSeek', { exact: true }).count()).toBe(1)
await dialog.getByText('DeepSeek', { exact: true }).locator('xpath=ancestor::li').getByRole('button', { name: '编辑' }).click()
const messages = dialog
const key = messages.getByLabel('API 密钥', { exact: true })
expect(await key.inputValue()).toBe('')
expect(await key.getAttribute('placeholder')).toBe(`sk-messa${'•'.repeat(10)}ding`)
await messages.getByText('使用已保存的 API key。', { exact: true }).waitFor()
await messages.getByText('自定义设置', { exact: true }).click()
expect(await messages.getByLabel('API 地址', { exact: true }).getAttribute('placeholder'))
.toBe('https://api.deepseek.com/anthropic(默认使用环境 DEEPSEEK_BASE_URL)')
@@ -114,6 +274,17 @@ describe.skipIf(webSnapshotMode() === 'record')('web e2e: DeepSeek Messages sett
expect(credentials).toContain('DEEPSEEK_API_KEY: sk-e2e-messages')
expect(credentials).not.toContain('DEEPSEEK_MESSAGES_API_KEY')
expect(await page.locator('body').innerText()).not.toContain('sk-e2e-')
await dialog.getByRole('button', { name: '编辑 DeepSeek (deepseek-official)', exact: true }).click()
expect(await key.inputValue()).toBe('')
await messages.getByText('使用已保存的 API key。', { exact: true }).waitFor()
expect(await key.getAttribute('type')).toBe('password')
await key.fill('sk-cancelled-replacement')
await messages.getByText('保存以替换已保存的 API key。', { exact: true }).waitFor()
expect(await messages.getByText('使用已保存的 API key。', { exact: true }).count()).toBe(0)
await key.fill('')
await messages.getByText('保存以清除已保存的 API key。之后使用环境认证(DEEPSEEK_API_KEY)。', { exact: true }).waitFor()
await messages.getByRole('button', { name: '取消', exact: true }).click()
expect(await readFile(join(scaffold.harnessHome, '.credentials.yaml'), 'utf8')).toBe(credentials)
await page.keyboard.press('Escape')
await connectFreshWorkspaceZh(page, scaffold.workspaceCwd, 'messages-settings-e2e')
await page.getByRole('button', { name: /^选择模型/ }).click()
+9 -9
View File
@@ -51,21 +51,21 @@ describe.skipIf(MODE === 'record')('web e2e: App-only desktop onboarding', () =>
screenshots = undefined
root = await mkdtemp(join(tmpdir(), 'dsh-desktop-onboarding-'))
server = createServer((request, response) => {
if (request.url === '/api/v0/users/get_unnotified_bonuses') {
if (request.url === '/api/v0/users/notifications/list') {
bonusReads++
response.setHeader('content-type', 'application/json')
response.end(JSON.stringify({ code: 0, data: { biz_code: 0, biz_data: bonusOffered ? [{
order_id: '88888888-8888-4888-8888-888888888888', campaign: 'dsh_login_bonus',
amount: '5.00', currency: 'CNY', granted_at: new Date().toISOString(),
expires_at: new Date(Date.now() + 86_400_000).toISOString(), msg: '已赠送您 5.00 元 DSH 体验赠金。',
}] : [] } }))
response.end(JSON.stringify({ code: 0, data: { biz_code: 0, biz_data: { next_poll_after: 600, notifications: bonusOffered ? [{
id: '88888888-8888-4888-8888-888888888888', type: 'account.bonus_granted',
created_at: new Date().toISOString(), title: '赠金已到账', actions: [],
display_until: new Date(Date.now() + 86_400_000).toISOString(), body: '已赠送您 5.00 元 DSH 体验赠金。',
}] : [] } } }))
return
}
if (request.url === '/api/v0/users/ack_bonus_notified') {
if (request.url === '/api/v0/users/notifications/events') {
bonusAcks++
bonusOffered = false
response.setHeader('content-type', 'application/json')
response.end(JSON.stringify({ code: 0, data: { biz_code: 0, biz_data: null } }))
response.end(JSON.stringify({ code: 0, data: { biz_code: 0, biz_data: { acked: true } } }))
return
}
if (request.url !== '/auth-api/v0/users/current' && request.url !== '/api/v0/users/get_user_summary') {
@@ -85,7 +85,7 @@ describe.skipIf(MODE === 'record')('web e2e: App-only desktop onboarding', () =>
if (address === null || typeof address === 'string') throw new Error('fixture server address unavailable')
origin = `http://127.0.0.1:${address.port}`
const overlay = join(root, 'account.patch.yml')
await writeFile(overlay, `- id: deepseek-account\n config:\n platformOrigin: ${origin}\n allowLoopbackHttp: true\n`)
await writeFile(overlay, `- id: deepseek-account\n config:\n platformOrigin: ${origin}\n harnessOrigin: ${origin}\n allowLoopbackHttp: true\n`)
scaffold = await launchWebScaffold({ deepSeekMissingCredential: true, extraOverlayPath: overlay })
await scaffold.ctx.credentials.modifyRecord(credentialKey('deepseek-account-platform', 'default'), async () => ({
kind: 'grant', payload: { version: 1, issuer: origin, token: 'onboarding-fixture-token' },
+7 -8
View File
@@ -74,11 +74,10 @@ describe('web e2e: Desktop update workspace chrome', () => {
await publish(progress)
const downloading = page.getByRole('button', { name: '58%', exact: true })
await downloading.waitFor()
expect(await downloading.getAttribute('aria-disabled')).toBe('true')
expect(await downloading.getAttribute('aria-disabled')).toBe('false')
expect(await downloading.locator('svg').count()).toBe(1)
// Force dispatch past Playwright's aria-disabled guard to verify the product's click guard.
await downloading.click({ force: true })
expect(await opens()).toBe(1)
await downloading.click()
await expect.poll(opens).toBe(2)
await page.screenshot({ path: join(evidence, 'downloading.png') })
const collapse = locale === 'zh-CN' ? '收起侧边栏' : 'Collapse sidebar'
@@ -118,21 +117,21 @@ describe('web e2e: Desktop update workspace chrome', () => {
await expect.poll(() => tooltip.evaluateAll(elements => elements.map(element => getComputedStyle(element).opacity))).toEqual(['1'])
await page.screenshot({ path: join(evidence, 'retry.png') })
await retry.click()
await expect.poll(opens).toBe(2)
await expect.poll(opens).toBe(3)
await publish(presentDesktopUpdate({ phase: 'ready', version }))
const ready = page.getByRole('button', { name: readyLabel, exact: true })
await ready.waitFor()
expect(await ready.getAttribute('aria-disabled')).toBe('false')
expect(await opens()).toBe(2)
expect(await opens()).toBe(3)
await page.screenshot({ path: join(evidence, 'ready.png') })
await ready.click()
await expect.poll(opens).toBe(3)
await expect.poll(opens).toBe(4)
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
expect(await page.evaluate(() => (window as FixtureWindow).updateFixture.listeners.size)).toBe(1)
await writeFile(join(evidence, 'result.json'), JSON.stringify({ locale, geometry, updateBackground, failedBackground,
passed: true, explicitActions: 3, carrier: 'substituted', host: 'real Web composition',
passed: true, explicitActions: 4, carrier: 'substituted', host: 'real Web composition',
electron: false, installerExecuted: false }, null, 2) + '\n')
console.log(`Desktop workspace chrome evidence: ${evidence}`)
} catch (error) {
@@ -1,6 +1,6 @@
Initial load: sidebar=failed, settings=unmounted, sidebarImages=0, settingsImages=0, requests=1
First Settings entry: sidebar=failed, settings=failed, sidebarImages=0, settingsImages=0, requests=2
Second Settings entry: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3
Third Settings entry: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3
Rendered image failure: sidebar=failed, settings=failed, sidebarImages=0, settingsImages=0, requests=3
Settings entry after rendered failure: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3
Initial load: sidebar=failed, settings=unmounted, sidebarImages=0, settingsImages=0, requests=1, notificationLists=1
First Settings entry: sidebar=failed, settings=failed, sidebarImages=0, settingsImages=0, requests=2, notificationLists=2
Second Settings entry: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3, notificationLists=3
Third Settings entry: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3, notificationLists=4
Rendered image failure: sidebar=failed, settings=failed, sidebarImages=0, settingsImages=0, requests=3, notificationLists=4
Settings entry after rendered failure: sidebar=ready, settings=ready, sidebarImages=1, settingsImages=1, requests=3, notificationLists=5
@@ -1,11 +1,14 @@
startup.held cards=0 acks=0
startup.notice=平台通知 / 已赠送您 5.00 元 DSH 体验赠金。
startup.ack orders=bonus-notice-first
startup.ack orders=notice-first
startup.unsupported-action skipped=true valid-card=true displayed=false
startup.profile-pending notice=true displayed=1
startup.get locale=zh_CN query=
startup.ack method=POST path=/api/v0/users/ack_bonus_notified locale=zh_CN order_id=bonus-notice-first body="{\"order_id\":\"bonus-notice-first\"}"
startup.ack method=POST path=/api/v0/users/notifications/events locale=zh_CN notification_id=notice-first body="{\"notification_id\":\"notice-first\",\"type\":\"displayed\"}"
startup.close event=dismissed displayed=1 dismissed=1
open.held cards=0 acks=1 gets=1
open.shown notice=赠金已到账 / 已赠送您 8.00 元 DSH 体验赠金。
open.shown ack orders=bonus-notice-first,33333333-3333-4333-8333-333333333333
open.shown ack orders=notice-first,notice-later
open.shown painted-under-settings=true cards=1 acks=2
open.get locale=zh_CN query= served=true gets=1
open.balance bonus-row=true amount=true dated=false
@@ -21,8 +24,8 @@ topup.returned bridge=open:top-up,close cards=0
topup.notice=赠金已到账 / 已赠送您 11.00 元 DSH 体验赠金。
topup.refresh gets=2 summaries=2 acks=1 recharge=true bonus=true
topup.closed cards=1 acks=1
retry.notice=赠金已到账 / 已赠送您 6.00 元 DSH 体验赠金。
retry.attempts=2 backoff=true body-kept=true cards=1
event-failed.notice=赠金已到账 / 已赠送您 6.00 元 DSH 体验赠金。
event-failed.attempts=1 body-kept=true cards=1
repeat.first=赠金已到账 / 已赠送您 7.00 元 DSH 体验赠金。
repeat.reload=赠金已到账 / 已赠送您 7.00 元 DSH 体验赠金。
repeat.shown added-storage-keys=0 reload-added=0 acks=2 cards=1
@@ -31,6 +34,19 @@ failed.reached usages=2 gets=1 summaries=1
en.notice=Bonus credited / You received a CNY 9.00 DSH trial credit.
en.get locale=en_US query=
web.notice=赠金已到账 / 已赠送您 4.00 元 DSH 体验赠金。 acks=1
stack.initial cards=3 acks=stack-first widths=280,272 offset=-4 transition=0.25s ease-out
stack.promoted cards=2 acks=stack-first,stack-second width=280 same-node=true
stack.hidden cards=3 acks=0
stack.initial cards=3 acks=stack-first widths=260,252 inset=10 offset=-4 transition=0.25s ease-out
stack.resized sidebar=360 card=280 left-inset=10
stack.resized sidebar=280 card=260 left-inset=10
stack.rail cards=3 visible=false dismissed=0
stack.expanded cards=3 duplicate-acks=0 dismissed=0
stack.promoted cards=2 acks=stack-first,stack-second width=260 same-node=true
stack.dismissed cards=0 acks=stack-first,stack-second,stack-third
refresh.retained cards=3 acks=refresh-first same-node=true
refresh.localized locale=en_US content-reads=3 list-reads=0 acks=1 same-node=true
refresh.business-action event=cta_clicked cards=3 account-open=true
refresh.drawer width=390 notice-above-sidebar=true
refresh.action event=dismissed got-it=true
refresh.promoted cards=2 acks=refresh-first,refresh-second
refresh.dismissed cards=0 acks=refresh-first,refresh-second,refresh-third
poll.arrival cards=2 list-reads=1 duplicate-acks=0 same-node=true settings-immediate-read=true
@@ -17,7 +17,8 @@
- text: DeepSeek deepseek-official API 密钥
- button "认证说明": "?"
- textbox "API 密钥":
- /placeholder: 留空使用已保存凭据
- /placeholder: sk-messa••••••••••ding
- paragraph: 使用已保存的 API key。
- group:
- text: 自定义设置 API 地址
- textbox "API 地址":
@@ -0,0 +1,25 @@
- dialog "设置":
- text: 设置
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
- heading "模型" [level=2]
- paragraph: 填入各提供商的 API 密钥即可使用其模型。
- list:
- listitem:
- text: DeepSeek
- img "API 密钥已配置"
- button "编辑 DeepSeek (deepseek-official)": 编辑
- text: DeepSeek deepseek-official API 密钥
- button "认证说明": "?"
- textbox "API 密钥":
- /placeholder: 留空使用环境认证(DEEPSEEK_API_KEY)
- paragraph: 保存以清除已保存的 API key。之后使用环境认证(DEEPSEEK_API_KEY)。
- group: 自定义设置
- button "取消"
- button "保存"
- button "添加模型提供商"
@@ -1,6 +1,6 @@
- textbox "发消息或创建任务, / 调用指令, @ 文件或对话":
- paragraph:
- button "移除引用"
- text: "## User Comment 2 File: src/extra.ts Side: R Lines: 1 Source: Local (branch) Base: origin/main Diff hunk: ```diff @@ -0,0 +1,1 @@ +export const extra = 1 ``` Comment: 请检查这项修改"
- text: src/extra.ts R1 请检查这项修改
- button "移除引用"
- text: "## User Comment 1 File: src/app.ts Side: R Lines: 1 Source: Local (branch) Base: origin/main Diff hunk: ```diff @@ -0,0 +1,1 @@ +export const app = 1 ``` Comment: 请解释这行代码"
- text: src/app.ts R1 请解释这行代码
@@ -36,6 +36,7 @@
- option "OpenAI Chat Completions" [selected]
- option "OpenAI Responses"
- option "Anthropic Messages"
- option "Gemini API"
- group "重试策略":
- text: 重试策略
- combobox "重试策略":
@@ -36,6 +36,7 @@
- option "OpenAI Chat Completions"
- option "OpenAI Responses"
- option "Anthropic Messages" [selected]
- option "Gemini API"
- group "重试策略":
- text: 重试策略
- combobox "重试策略":
@@ -36,6 +36,7 @@
- option "OpenAI Chat Completions"
- option "OpenAI Responses"
- option "Anthropic Messages" [selected]
- option "Gemini API"
- group "重试策略":
- text: 重试策略
- combobox "重试策略":
@@ -36,6 +36,7 @@
- option "OpenAI Chat Completions"
- option "OpenAI Responses"
- option "Anthropic Messages" [selected]
- option "Gemini API"
- group "重试策略":
- text: 重试策略
- combobox "重试策略":
@@ -17,7 +17,8 @@
- text: DeepSeek deepseek-official API 密钥
- button "认证说明": "?"
- textbox "API 密钥":
- /placeholder: 留空使用已保存凭据
- /placeholder: dsh_onboa•••••••••••••••••••••••••••••••test
- paragraph: 使用已保存的 API key。
- group:
- text: 自定义设置 API 地址
- textbox "API 地址":
@@ -17,7 +17,8 @@
- text: DeepSeek deepseek-official API 密钥
- button "认证说明": "?"
- textbox "API 密钥":
- /placeholder: 留空使用已保存凭据
- /placeholder: dsh_onboa•••••••••••••••••••••••••••••••test
- paragraph: 使用已保存的 API key。
- group:
- text: 自定义设置 API 地址
- textbox "API 地址":
@@ -3,7 +3,7 @@
- status
- switch "启用 @fixture/missing-bundle" [checked]
- heading "@fixture/missing-bundle" [level=3]
- text: 异常 未安装
- text: 未运行 未安装
- paragraph:
- code: "@fixture/missing-bundle"
- status: "原因: dsh: cannot resolve profile bundle \"@fixture/missing-bundle\" from the dsh installation or {{home}}/profiles/scaffold; run 'dsh plugin --profile scaffold install' if its dependency is not installed"
@@ -9,9 +9,9 @@
- 'row "CONTEXT, <system-reminder> The following information describes your current session: Current working directory: \"{{cwd}}/workspace\". Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}/workspace\". Some platform te…"':
- cell "CONTEXT"
- 'cell "<system-reminder> The following information describes your current session: Current working directory: \"{{cwd}}/workspace\". Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}/workspace\". Some platform te…"'
- 'row "CONTEXT, <system-reminder> A skill is a reusable set of task-specific instructions. The following skills are available in this session: <available_skills> office: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step. office-docx: Create, read, edit, and validate Word documents (.docx). office-pptx: Create, read, edit, and validate PowerPoint presentations (.pptx). office-xlsx: Read, cr…"':
- 'row "CONTEXT, <system-reminder> A skill is a reusable set of task-specific instructions. The following skills are available in this session: <available_skills> dsh-doc: Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skil…"':
- cell "CONTEXT"
- 'cell "<system-reminder> A skill is a reusable set of task-specific instructions. The following skills are available in this session: <available_skills> office: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step. office-docx: Create, read, edit, and validate Word documents (.docx). office-pptx: Create, read, edit, and validate PowerPoint presentations (.pptx). office-xlsx: Read, cr…"'
- 'cell "<system-reminder> A skill is a reusable set of task-specific instructions. The following skills are available in this session: <available_skills> dsh-doc: Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skil…"'
- 'row "CONTEXT, Time sampled while preparing turn 1, step 1: 2026-01-15T{{clock}}+{{clock}}[Asia/Shanghai] Browser time zone for this request: Asia/Shanghai. Interpret otherwise-unqualified dates and times in this zone. Elapsed since the preceding model-visible message: unavailable."':
- cell "CONTEXT"
- 'cell "Time sampled while preparing turn 1, step 1: 2026-01-15T{{clock}}+{{clock}}[Asia/Shanghai] Browser time zone for this request: Asia/Shanghai. Interpret otherwise-unqualified dates and times in this zone. Elapsed since the preceding model-visible message: unavailable."'
@@ -4,6 +4,7 @@
- id: deepseek-account
config:
platformOrigin: "{{origin}}"
harnessOrigin: "{{origin}}"
allowLoopbackHttp: true
# The scenario signs in from the account menu after initial setup.
- id: ui-settings-account
+6 -2
View File
@@ -1,13 +1,17 @@
# The bonus notice scenario points the shipped account provider at a loopback
# Platform double. The scaffold substitutes {{origin}} after the listener binds,
# so no port is ever committed here. No notice timing is overridden: every read
# comes from the product's own startup and settings-refresh paths.
# so no port is ever committed here. A long query interval isolates other notice
# interactions; the polling scenario advances the browser clock explicitly.
- id: deepseek-account
config:
platformOrigin: "{{origin}}"
harnessOrigin: "{{origin}}"
allowLoopbackHttp: true
# This scenario exercises the account launcher after initial setup.
- id: ui-settings-account
config:
step: done
completion: completed
- id: ui-account-notifications
config:
notificationPollIntervalMs: 7200000
+108 -2
View File
@@ -892,10 +892,13 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
await view.getByRole('button', { name: /^(将文件树移到右侧|隐藏文件树|在左侧显示文件树)$/ }).click()
expect(await resizeTree.getAttribute('aria-valuenow')).toBe(rightWidth)
for (const side of ['old', 'new'] as const) {
const firstLine = await panelFile.locator(`[data-review-code][data-${side}-line="2"]`).boundingBox()
const firstCode = panelFile.locator(`[data-review-code][data-${side}-line="2"]`)
const firstLine = await firstCode.boundingBox()
const lastLine = await panelFile.locator(`[data-review-code][data-${side}-line="4"]`).boundingBox()
if (firstLine === null || lastLine === null) throw new Error('Review text must be visible')
await page.mouse.move(firstLine.x + 7, firstLine.y + firstLine.height / 2)
// Press on the first character, past the lane where the hovered row shows its comment plus.
const textStart = await firstCode.evaluate(element => Number.parseFloat(getComputedStyle(element).paddingLeft))
await page.mouse.move(firstLine.x + textStart + 1, firstLine.y + firstLine.height / 2)
await page.mouse.down()
await page.mouse.move(lastLine.x + 120, lastLine.y + lastLine.height / 2, { steps: 5 })
await page.mouse.up()
@@ -1170,6 +1173,109 @@ it.skipIf(MODE === 'record')('uses horizontal arrows to navigate files while pre
expect(tripwire.warnings).toEqual([])
})
it.skipIf(MODE === 'record')('opens a comment from the hover plus in one press without covering the line number or the code', async () => {
const { scaffold, page, project, tripwire } = await launchPanel('web-e2e-forge-hover-plus')
// notes.txt changes into context, a deletion followed by context, and an addition, so unified rows show both numbers.
await writeFile(join(project, 'notes.txt'), ['keep 1', 'keep 2', 'drop 3', 'keep 4', 'keep 5', 'keep 6'].map(line => `${line}\n`).join(''))
await git(project, 'add', 'notes.txt')
await git(project, 'commit', '--quiet', '-m', 'notes')
await git(project, 'update-ref', 'refs/remotes/origin/main', 'HEAD')
await git(project, 'symbolic-ref', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/main')
await writeFile(join(project, 'README.md'), `changed\n${Array.from({ length: 8 }, (_, line) => `line ${line + 2}\n`).join('')}`)
await writeFile(join(project, 'notes.txt'), ['keep 1', 'keep 2', 'keep 4', 'keep 5', 'added', 'keep 6'].map(line => `${line}\n`).join(''))
const { settled } = await sendPrompt(page, scaffold)
await settled
await page.locator('[data-forge-header]').click()
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
await page.locator('[data-forge-local]').getByRole('button', { name: /查看本会话的变更/ }).click()
const view = page.locator('[data-forge-changes="local"]')
const file = view.locator('[data-forge-diff-file="README.md"]')
const number = (name: string) => file.getByRole('button', { name: `选择第 ${name} 行`, exact: true })
const plus = (name: string) => file.locator(`[data-review-add="${name}"]`)
const code = (line: number) => file.locator(`[data-review-code][data-new-line="${line}"]`)
const draggable = async (from: string, to: string) => {
const start = await plus(from).boundingBox(), end = await number(to).boundingBox()
if (start === null || end === null) throw new Error('The plus and the line number must be rendered')
const x = start.x + start.width / 2
return { start: { x, y: start.y + start.height / 2 }, end: { x, y: end.y + end.height / 2 } }
}
await number('R3').waitFor()
// The plus appears only on the hovered side of the hovered row, for the code as for the line number.
expect(await plus('R3').isVisible()).toBe(false)
await code(3).hover()
expect(await plus('R3').isVisible()).toBe(true)
expect(await plus('R4').isVisible()).toBe(false)
expect(await plus('L1').isVisible()).toBe(false)
await number('L1').hover()
expect(await plus('L1').isVisible()).toBe(true)
expect(await plus('R3').isVisible()).toBe(false)
// Playwright refuses a click on a covered point, so these prove the hovered number and first character stay reachable.
await number('R3').hover()
await number('R3').click()
expect(await number('R3').getAttribute('aria-pressed')).toBe('true')
const first = await code(5).boundingBox()
const textStart = await code(5).evaluate(element => Number.parseFloat(getComputedStyle(element).paddingLeft))
if (first === null) throw new Error('Review text must be visible')
await page.mouse.move(first.x + textStart + 1, first.y + first.height / 2)
await page.mouse.down()
await page.mouse.move(first.x + textStart + 30, first.y + first.height / 2, { steps: 3 })
await page.mouse.up()
expect(await page.evaluate(() => document.getSelection()?.toString())).toMatch(/^li/)
await page.evaluate(() => { document.getSelection()?.removeAllRanges() })
// One press selects, a drag extends within the side, and the release opens the editor.
await code(6).hover()
const { start, end } = await draggable('R6', 'R8')
await page.mouse.move(start.x, start.y)
await page.mouse.down()
await page.mouse.move(end.x, end.y, { steps: 5 })
expect(await number('R8').getAttribute('aria-pressed')).toBe('true')
expect(await file.getByRole('textbox').count()).toBe(0)
await page.mouse.up()
await file.getByRole('region', { name: '评论 R6–8', exact: true }).waitFor()
expect(await plus('R6').count()).toBe(0)
await file.getByRole('button', { name: '取消', exact: true }).click()
await file.getByRole('textbox').waitFor({ state: 'detached' })
// The single-column layout keeps the same gesture on the line's own side.
await view.getByRole('button', { name: '左右对比', exact: true }).click()
await file.locator('[data-diff-line]').first().waitFor()
await code(4).hover()
expect(await plus('R4').isVisible()).toBe(true)
await number('R4').click()
expect(await number('R4').getAttribute('aria-pressed')).toBe('true')
// With both numbers shown, a deleted line's plus sits where a context line's does: in the sign column.
const notes = view.locator('[data-forge-diff-file="notes.txt"]')
const notesPlus = (name: string) => notes.locator(`[data-review-add="${name}"]`)
const notesCode = (side: 'old' | 'new', line: number) => notes.locator(`[data-review-code][data-${side}-line="${line}"]`)
await notesCode('new', 3).hover()
const contextPlus = await notesPlus('R3').boundingBox()
await notesCode('old', 3).hover()
const deletedPlus = await notesPlus('L3').boundingBox()
const nextRow = await notesCode('old', 4).boundingBox()
if (contextPlus === null || deletedPlus === null || nextRow === null) throw new Error('The pluses and the next row must be rendered')
expect(deletedPlus.x).toBe(contextPlus.x)
// A drag from the deleted line's plus extends through the context row below it on the old side.
const x = deletedPlus.x + deletedPlus.width / 2
await page.mouse.move(x, deletedPlus.y + deletedPlus.height / 2)
await page.mouse.down()
await page.mouse.move(x, nextRow.y + nextRow.height / 2, { steps: 5 })
await page.mouse.up()
await notes.getByRole('region', { name: '评论 L3–4', exact: true }).waitFor()
await notes.getByRole('button', { name: '取消', exact: true }).click()
await notes.getByRole('textbox').waitFor({ state: 'detached' })
// The labeled plus of a left context line stays reachable; Playwright refuses a covered target.
await notes.getByRole('button', { name: '选择第 L2 行', exact: true }).click()
expect((await notes.getByRole('button', { name: '添加评论', exact: true }).boundingBox())?.x).toBe(contextPlus.x)
await notes.getByRole('button', { name: '添加评论', exact: true }).click()
await notes.getByRole('region', { name: '评论 L2', exact: true }).waitFor()
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
})
it.skipIf(MODE === 'record')('keeps tall branch and changed-file menus aligned with their triggers', async () => {
const { scaffold, page, project, tripwire } = await launchPanel('web-e2e-forge-tall-menus')
await Promise.all(Array.from({ length: 45 }, (_, index) =>
+2 -2
View File
@@ -221,7 +221,7 @@ describe('web e2e: Models settings page configures a dormant provider', () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-models-customized'))
const dialog = page.getByRole('dialog', { name: '设置' })
await dialog.getByRole('button', { name: '编辑 minimax-cn' }).click()
await dialog.getByPlaceholder('留空使用已保存凭据', { exact: true }).waitFor({ timeout: 10_000 })
await dialog.getByPlaceholder('•'.repeat('sk-e2e-minimax'.length), { exact: true }).waitFor({ timeout: 10_000 })
expect(await dialog.textContent()).not.toContain('API 密钥来源:')
expect(await dialog.textContent()).not.toMatch(/oauth/i)
await dialog.getByText('自定义设置').click()
@@ -298,7 +298,7 @@ describe('web e2e: Models settings page configures a dormant provider', () => {
// The custom-API mode is the second segment of the one add card; its
// purpose line replaces the catalog one.
await dialog.getByRole('tab', { name: '自定义模型 API' }).click()
await dialog.getByText('连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。').waitFor({ timeout: 10_000 })
await dialog.getByText('连接中转站、自部署服务或其他兼容 OpenAI / Anthropic / Gemini 协议的接口,需填写 API 地址、协议和模型。').waitFor({ timeout: 10_000 })
// The third-party panel stays mounted, hidden, beside this one, so the
// form is addressed through its own panel.
const custom = dialog.getByRole('tabpanel', { name: '自定义模型 API' })
@@ -33,6 +33,7 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
let page: Page
let tripwire: ReturnType<typeof watchConsole>
const browserConsole: string[] = []
const secret = `dsh_onboarding_${randomBytes(12).toString('hex')}_test`
beforeAll(async () => {
scaffold = await launchWebScaffold({ deepSeekMissingCredential: true, welcomeNoticePending: true })
@@ -86,7 +87,6 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
const initial = await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd)
await compareOrRefreshGolden(MISSING_EXPECTED, initial, MODE)
const secret = `dsh_onboarding_${randomBytes(12).toString('hex')}`
await keyInput.fill(secret)
await credentialStep.getByRole('button', { name: '保存并继续' }).click()
await credentialStep.waitFor({ state: 'detached', timeout: 15_000 })
@@ -115,7 +115,7 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
await expect.poll(
() => configuredInput.getAttribute('placeholder'),
{ timeout: 10_000 },
).toBe('留空使用已保存凭据')
).toBe(`dsh_onboa${'•'.repeat(31)}test`)
const secondReloadWarnings = tripwire.warnings.length
await page.reload({ waitUntil: 'load' })
@@ -257,7 +257,7 @@ describe.skipIf(MODE === 'record')('web e2e: first-run DeepSeek credential setup
await expect.poll(
() => settings.getByLabel('API 密钥', { exact: true }).getAttribute('placeholder'),
{ timeout: 10_000 },
).toBe('留空使用已保存凭据')
).toBe(`dsh_onboa${'•'.repeat(31)}test`)
const modelEditor = await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd)
await compareOrRefreshGolden(MODELS_EXPECTED, modelEditor, MODE)
await settings.getByRole('button', { name: '保存', exact: true }).click()
+1 -1
View File
@@ -149,7 +149,7 @@ it('shares settings card materials and control sizes in both palettes', async ()
bonusWallets: [{ currency: 'CNY', balance: '12.00' }],
}),
vi.spyOn(account, 'watch').mockImplementation(async function* (signal) {
yield state
yield { type: 'snapshot', state }
if (signal.aborted) return
await new Promise<void>((resolve) => { signal.addEventListener('abort', () => { resolve() }, { once: true }) })
}),
+1 -1
View File
@@ -823,7 +823,7 @@ it('routes one browser-authored Auto request through the same model and asks the
event.type === 'tool/result'
&& event.data.message.toolCallId === AUTO_CALL_ID
))
expect(result?.data.error).toBeUndefined()
expect(result?.data.error).toEqual({ name: 'ApprovalError', code: 'APPROVAL_REJECTED' })
const durableModelResult = JSON.stringify(result?.data.message)
expect(durableModelResult).toContain('the user rejected tool \\"bash\\"')
expect(durableModelResult).not.toContain('direct user authorized inspection only')
+1 -1
View File
@@ -519,7 +519,7 @@ describe('web e2e: sidebar search alignment and row action targets', () => {
}),
vi.spyOn(account, 'getBalance').mockResolvedValue({ status: 'ready', value: [], bonusWallets: [] }),
vi.spyOn(account, 'watch').mockImplementation(async function* (signal) {
yield state
yield { type: 'snapshot', state }
if (signal.aborted) return
await new Promise<void>((resolve) => { signal.addEventListener('abort', () => { resolve() }, { once: true }) })
}),
+51
View File
@@ -0,0 +1,51 @@
/** Standard mode offers the installed documentation skill without loading it for an unrelated task. */
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { dirname } from 'node:path'
import { chromium } from 'playwright'
import { expect, it } from 'vitest'
import { assertFixtureInventory, fixtureUserPrompts, launchWebScaffold } from './scaffold.ts'
import { connectFreshWorkspace, newEnglishPage } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/standard-dsh-doc/session.v4.jsonl', import.meta.url))
it('lists dsh-doc once without loading instructions or calling tools for an ordinary task', async () => {
const scaffold = await launchWebScaffold({ replayFixture: FIXTURE, compareReplaySession: true, paceMs: 10 })
try {
const browser = await chromium.launch()
try {
const page = await newEnglishPage(browser)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
await connectFreshWorkspace(page, scaffold.workspaceCwd)
const prompts = fixtureUserPrompts(await readFile(FIXTURE, 'utf8'))
expect(prompts).toHaveLength(1)
const settled = scaffold.whenTurnSettled()
const composer = page.locator('[data-composer-input][contenteditable="true"]').last()
await composer.fill(prompts[0]!)
await composer.press('Enter')
const sessionId = await settled
const agent = scaffold.ctx.agents.get(sessionId)
if (agent === undefined) throw new Error('standard documentation session is missing')
const events = agent.session.snapshotEvents()
expect(events.filter(event => event.type === 'tool/call')).toEqual([])
const catalogs = events.flatMap(event => event.type === 'user/message'
&& event.data.source.kind === 'skill-catalog' ? [event.data] : [])
expect(catalogs).toHaveLength(1)
const skills = await scaffold.ctx.skills.list({ cwd: agent.session.header.cwd, scope: agent })
expect(skills.filter(skill => skill.name === 'dsh-doc')).toHaveLength(1)
expect(catalogs[0]?.source).toMatchObject({ entries: skills.map(skill => ({ name: skill.name })) })
expect(events.filter(event => event.type === 'user/message'
&& event.data.source.kind === 'skill-invocation')).toEqual([])
const names = scaffold.ctx.tools.schemas(agent).map(tool => tool.name)
expect(names).not.toContain('cordis_inspect_list')
expect(names).not.toContain('cordis_inspect_query')
await page.getByText('READY', { exact: true }).waitFor()
await assertFixtureInventory(dirname(FIXTURE), ['session.v4.jsonl'])
} finally {
await browser.close()
}
} finally {
await scaffold.close()
}
})
+3
View File
@@ -210,6 +210,8 @@
"tests/queue-image.e2e.ts",
"tests/skill-invocation-policy.e2e.ts",
"tests/skill-user-invoke.e2e.ts",
"tests/standard-dsh-doc.e2e.ts",
"tests/creator-persona.e2e.ts",
"tests/skill-menu-plugin-change.e2e.ts",
"tests/permission-policy-context.e2e.ts",
"tests/access-confirmation.e2e.ts",
@@ -230,6 +232,7 @@
"tests/goal-bar.e2e.ts",
"tests/goal-command-presentation.e2e.ts",
"tests/subagent-conversation.e2e.ts",
"tests/composer-paste-routing.e2e.ts",
"tests/subagent-interrupt.e2e.ts",
"tests/subagent-interrupt-ui.e2e.ts",
"tests/sidebar-subagent-activity.e2e.ts",
+2 -2
View File
@@ -6,5 +6,5 @@
en: 41d772192075e133
zh: 5ef3da69b4de1d8a
/capability-seams-and-core-services:
en: 6355651b822ad47c
zh: dadfa336d8881ad7
en: 484321127d29936b
zh: 136af4ad9c3472ea
+9 -9
View File
@@ -28,6 +28,8 @@ flowchart LR
pkg_plugin_manager["plugin-manager"]
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
pkg_client_ui_connector_account["client-ui-connector-account"]
svc_connectorAccounts["ctx.connectorAccounts<br/>Connector accounts on the Plugins page"]
pkg_plugin_market["plugin-market"]
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
pkg_client_ui_plugin_market["client-ui-plugin-market"]
@@ -142,8 +144,6 @@ flowchart LR
pkg_credentials_local["credentials-local"]
pkg_deepseek_account["deepseek-account"]
svc_deepseekAccount["ctx.deepseekAccount<br/>DeepSeek account"]
pkg_deepseek_account_platform["deepseek-account-platform"]
pkg_api_account_controller["api-account-controller"]
pkg_authorization["authorization"]
svc_authorization["ctx.authorization<br/>Authorization flow registry"]
pkg_client_product_analytics["client-product-analytics"]
@@ -214,7 +214,7 @@ flowchart LR
pkg_mcp_manager["mcp-manager"]
svc_mcpManager["ctx.mcpManager<br/>Settings-driven MCP server fleet"]
svc_mcpClientHost["ctx.mcpClientHost<br/>MCP client host for a server manager"]
pkg_client_ui_mcp_account["client-ui-mcp-account"]
pkg_mcp_account["mcp-account"]
svc_mcpAccounts["ctx.mcpAccounts<br/>MCP connector accounts on the Plugins page"]
pkg_schedule["schedule"]
svc_schedule["ctx.schedule<br/>Host scheduled messages"]
@@ -349,7 +349,7 @@ flowchart LR
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_product_analytics --> svc_productAnalytics
pkg_client_ui_mcp_account --> svc_mcpAccounts
pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
pkg_command_feedback --> svc_sessionFeedback
pkg_commands --> svc_commands
@@ -364,7 +364,6 @@ flowchart LR
pkg_credentials_local --> svc_credentials
pkg_cua --> svc_cuaAccess
pkg_deepseek_account --> svc_deepseekAccount
pkg_deepseek_account_platform --> svc_deepseekAccount
pkg_deepseek_llm_api_extensions --> svc_deepseekLlmApiExtensions
pkg_experimental_api_speech_to_text --> svc_speechController
pkg_experimental_browser_use_chrome_devtools_mcp --> svc_browserUse
@@ -407,6 +406,7 @@ flowchart LR
pkg_llm_replay --> svc_llm
pkg_lsp --> svc_lsp
pkg_lsp_stdio --> svc_lsp
pkg_mcp_account --> svc_mcpAccounts
pkg_mcp_client --> svc_mcpClientHost
pkg_mcp_client --> svc_mcpResources
pkg_mcp_manager --> svc_mcpManager
@@ -523,7 +523,6 @@ flowchart LR
svc_credentials --> pkg_llm_deepseek
svc_credentials --> pkg_llm_pi_ai
svc_cuaAccess --> pkg_cua
svc_deepseekAccount --> pkg_api_account_controller
svc_deepseekAccount --> pkg_llm_deepseek
svc_deepseekLlmApiExtensions --> pkg_llm_deepseek
svc_directoryPicker --> pkg_api_workspace_controller
@@ -669,6 +668,7 @@ flowchart LR
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | Owns module and exact configuration watchers; application mutations share its queue and automatic reloads await the application file lock. |
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | Races public registry responses on the Host; the Client owns the initial registry recommendation. |
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | Shares profile package operations with the CLI and reports persisted and running state to Web and agent callers. |
| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | Holds the accounts CLI app plugins and MCP connectors register and serves their Host-computed displays to the Plugins page through one Remote; authorization pages and notices stay in the browser that started the operation. |
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | Fetches and validates the index sources the user configures; installation goes through the plugin manager. |
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | The dsh launcher supplies data-only profile locations and composition inputs; reload scheduling belongs to dsh-hmr. |
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | Owns browser authentication and shared HTTP request dispatch; API adapters register endpoints and streams. |
@@ -710,7 +710,7 @@ flowchart LR
| `ctx.settings` | `core` | [`settings`](../packages/settings/settings) | - | [`api-settings-controller`](../packages/api/settings-controller) | - | Forms project volatile Config fields from active profile entries and delegate validated edits to config-editor. Plugins consume their own Config references. |
| `ctx.subagentModelSelection` | `core` | [`tool-subagent`](../packages/subagent/tool-subagent) | - | [`tool-subagent`](../packages/subagent/tool-subagent) | - | Owns the default-off settings namespace that Agent-scoped delegation tools sample when composing a new top-level Session. |
| `ctx.credentials` | `seam` | [`credentials`](../packages/credentials/credentials) | [`credentials-local`](../packages/credentials/credentials-local) | [`api-settings-controller`](../packages/api/settings-controller), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai) | - | Configuration carries references to secrets; providers own the values. Consumers resolve per operation, so a rotated credential reaches the very next request; the settings controller exposes value-free views and write-only storage. |
| `ctx.deepseekAccount` | `seam` | [`deepseek-account`](../packages/credentials/deepseek-account) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) | [`api-account-controller`](../packages/api/account-controller), [`llm-deepseek`](../packages/llm/llm-deepseek) | - | The Host owns browser authorization and local credentials; UI consumers receive state without tokens. |
| `ctx.deepseekAccount` | `service` | [`deepseek-account`](../packages/credentials/deepseek-account) | - | [`llm-deepseek`](../packages/llm/llm-deepseek) | - | The Host owns browser authorization and local credentials; UI consumers receive state without tokens. |
| `ctx.authorization` | `seam` | [`authorization`](../packages/credentials/authorization) | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai) | - | Flows are registered by the plugin that knows how to obtain one credential and keyed by the record they write; the seam owns the conversation and the one-attempt-per-key lifecycle, never the protocol. |
| `ctx.productAnalytics` | `service` | [`client-product-analytics`](../packages/client/product-analytics) | - | - | - | Accepts selected Desktop events, enriches available login identity, and observes live compaction under the live Host collection policy. |
| `ctx.otel` | `service` | [`otel`](../packages/telemetry/otel) | - | [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel), [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | - | Product analytics and Session feedback adapters create independent reporting channels through one injected service. |
@@ -738,8 +738,8 @@ flowchart LR
| `ctx.agentDefaultModel` | `core` | [`agent-default-model`](../packages/core/agent-default-model) | - | [`api-session-controller`](../packages/api/session-controller), [`headless`](../packages/bundle/headless) | - | Reads the default ModelSelection from volatile Config and saves selections through the profile editor. |
| `ctx.agentLoop` | `bundle` | [`agent-loop`](../packages/core/agent-loop) | - | [`base`](../packages/bundle/base), [`sdk-minimal`](../packages/bundle/sdk-minimal) | - | The one concrete loop plugin; extension packages depend on dsh-agent events and services, not on this package. |
| `ctx.mcpManager` | `core` | [`mcp-manager`](../packages/mcp/mcp-manager) | - | - | - | Reconciles mcp-client instances against its volatile servers configuration, aggregates their connection statuses, and serves restart and probe to management surfaces. |
| `ctx.mcpClientHost` | `service` | [`mcp-client`](../packages/mcp/mcp-client) | - | [`mcp-manager`](../packages/mcp/mcp-manager) | - | An mcp-client entry loaded with host: true validates, mounts, probes, and authorizes servers for the manager, which reaches no other mcp-client value; its servers run below it, so a reload of the MCP client restarts the manager. |
| `ctx.mcpAccounts` | `service` | [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | - | - | - | Holds the accounts MCP connector plugins register and serves them, with the manager's view of each server, to the Plugins page through one Remote; authorization runs through the manager. |
| `ctx.mcpClientHost` | `service` | [`mcp-client`](../packages/mcp/mcp-client) | - | [`mcp-manager`](../packages/mcp/mcp-manager) | - | The manager creates it to validate, mount, probe, and authorize servers, and reaches no other mcp-client value; its servers run below the manager. |
| `ctx.mcpAccounts` | `service` | [`mcp-account`](../packages/mcp/mcp-account) | - | - | - | Shows the OAuth server account each MCP connector plugin registers through the connector account registry; the page's operations run through the manager. |
| `ctx.schedule` | `core` | [`schedule`](../packages/schedule/schedule) | - | - | - | Stores tasks independently of Session activation and queues due messages in each task's target Session. |
| `ctx.goals` | `core` | [`goal`](../packages/goal/goal) | - | - | - | Folds revisioned objective state from the session log and keeps live continuation activation process-local. |
| `ctx.ssh` | `core` | [`ssh`](../packages/ssh/ssh) | - | [`fs-ssh`](../packages/ssh/fs-ssh), [`subprocess-ssh`](../packages/ssh/subprocess-ssh), [`sandbox-ssh`](../packages/ssh/sandbox-ssh) | - | Owns one authenticated OpenSSH connection, installed helper identity, independent program streams and disconnect cleanup for the paired remote providers. |
+9 -9
View File
@@ -30,6 +30,8 @@ flowchart LR
pkg_plugin_manager["plugin-manager"]
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
pkg_ui_settings_plugin_inventory["ui-settings-plugin-inventory"]
pkg_client_ui_connector_account["client-ui-connector-account"]
svc_connectorAccounts["ctx.connectorAccounts<br/>Connector accounts on the Plugins page"]
pkg_plugin_market["plugin-market"]
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
pkg_client_ui_plugin_market["client-ui-plugin-market"]
@@ -144,8 +146,6 @@ flowchart LR
pkg_credentials_local["credentials-local"]
pkg_deepseek_account["deepseek-account"]
svc_deepseekAccount["ctx.deepseekAccount<br/>DeepSeek account"]
pkg_deepseek_account_platform["deepseek-account-platform"]
pkg_api_account_controller["api-account-controller"]
pkg_authorization["authorization"]
svc_authorization["ctx.authorization<br/>Authorization flow registry"]
pkg_client_product_analytics["client-product-analytics"]
@@ -216,7 +216,7 @@ flowchart LR
pkg_mcp_manager["mcp-manager"]
svc_mcpManager["ctx.mcpManager<br/>Settings-driven MCP server fleet"]
svc_mcpClientHost["ctx.mcpClientHost<br/>MCP client host for a server manager"]
pkg_client_ui_mcp_account["client-ui-mcp-account"]
pkg_mcp_account["mcp-account"]
svc_mcpAccounts["ctx.mcpAccounts<br/>MCP connector accounts on the Plugins page"]
pkg_schedule["schedule"]
svc_schedule["ctx.schedule<br/>Host scheduled messages"]
@@ -351,7 +351,7 @@ flowchart LR
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_product_analytics --> svc_productAnalytics
pkg_client_ui_mcp_account --> svc_mcpAccounts
pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
pkg_command_feedback --> svc_sessionFeedback
pkg_commands --> svc_commands
@@ -366,7 +366,6 @@ flowchart LR
pkg_credentials_local --> svc_credentials
pkg_cua --> svc_cuaAccess
pkg_deepseek_account --> svc_deepseekAccount
pkg_deepseek_account_platform --> svc_deepseekAccount
pkg_deepseek_llm_api_extensions --> svc_deepseekLlmApiExtensions
pkg_experimental_api_speech_to_text --> svc_speechController
pkg_experimental_browser_use_chrome_devtools_mcp --> svc_browserUse
@@ -409,6 +408,7 @@ flowchart LR
pkg_llm_replay --> svc_llm
pkg_lsp --> svc_lsp
pkg_lsp_stdio --> svc_lsp
pkg_mcp_account --> svc_mcpAccounts
pkg_mcp_client --> svc_mcpClientHost
pkg_mcp_client --> svc_mcpResources
pkg_mcp_manager --> svc_mcpManager
@@ -525,7 +525,6 @@ flowchart LR
svc_credentials --> pkg_llm_deepseek
svc_credentials --> pkg_llm_pi_ai
svc_cuaAccess --> pkg_cua
svc_deepseekAccount --> pkg_api_account_controller
svc_deepseekAccount --> pkg_llm_deepseek
svc_deepseekLlmApiExtensions --> pkg_llm_deepseek
svc_directoryPicker --> pkg_api_workspace_controller
@@ -671,6 +670,7 @@ flowchart LR
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | 负责模块和精确配置监听;应用修改共用其队列,自动重载等待应用文件锁。 |
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | 在 Host 上并发比较公共安装源响应;初始安装源推荐由 Client 负责。 |
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager), `ui-settings-plugin-inventory` | - | 与 CLI 共享 profile 包操作,并向 Web 和 Agent 调用方分别报告持久状态与运行状态。 |
| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | 保存 CLI 应用插件和 MCP 连接器注册的账号,并通过一个 Remote 把 Host 算好的展示内容提供给插件页;授权页和提示只出现在发起操作的浏览器中。 |
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | 获取并校验用户配置的索引源;安装通过插件管理器完成。 |
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | dsh launcher 提供纯数据形式的 profile 位置与组合输入;重载调度由 dsh-hmr 负责。 |
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | 负责浏览器认证与共享 HTTP 请求分发;API 适配器注册端点和流。 |
@@ -712,7 +712,7 @@ flowchart LR
| `ctx.settings` | `core` | [`settings`](../packages/settings/settings) | - | [`api-settings-controller`](../packages/api/settings-controller) | - | Forms project volatile Config fields from active profile entries and delegate validated edits to config-editor. Plugins consume their own Config references. |
| `ctx.subagentModelSelection` | `core` | [`tool-subagent`](../packages/subagent/tool-subagent) | - | [`tool-subagent`](../packages/subagent/tool-subagent) | - | 拥有默认关闭的设置命名空间;Agent 作用域的委派工具会在组合新顶层 Session 时读取它。 |
| `ctx.credentials` | `seam` | [`credentials`](../packages/credentials/credentials) | [`credentials-local`](../packages/credentials/credentials-local) | [`api-settings-controller`](../packages/api/settings-controller), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai) | - | 配置携带对机密信息的引用;提供方拥有实际值。消费方按操作解析,因此轮换后的凭据会在紧接着的下一次请求中生效;settings controller 提供不含实际值的视图和只写存储。 |
| `ctx.deepseekAccount` | `seam` | [`deepseek-account`](../packages/credentials/deepseek-account) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) | [`api-account-controller`](../packages/api/account-controller), [`llm-deepseek`](../packages/llm/llm-deepseek) | - | Host 负责浏览器授权和本地凭证;UI 使用方只接收不含 token 的状态。 |
| `ctx.deepseekAccount` | `service` | [`deepseek-account`](../packages/credentials/deepseek-account) | - | [`llm-deepseek`](../packages/llm/llm-deepseek) | - | Host 负责浏览器授权和本地凭证;UI 使用方只接收不含 token 的状态。 |
| `ctx.authorization` | `seam` | [`authorization`](../packages/credentials/authorization) | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai) | - | flow 由知道如何取得某份凭据的插件注册,并以其写入的记录为键;seam 拥有这段对话与"每个键同时只跑一次尝试"的生命周期,而非协议本身。 |
| `ctx.productAnalytics` | `service` | [`client-product-analytics`](../packages/client/product-analytics) | - | - | - | 根据 Host 动态采集策略接收指定桌面事件、补充可用登录身份并监听实时压缩。 |
| `ctx.otel` | `service` | [`otel`](../packages/telemetry/otel) | - | [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel), [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | - | 产品埋点和 Session 反馈适配器通过同一个注入服务创建独立上报通道。 |
@@ -740,8 +740,8 @@ flowchart LR
| `ctx.agentDefaultModel` | `core` | [`agent-default-model`](../packages/core/agent-default-model) | - | [`api-session-controller`](../packages/api/session-controller), [`headless`](../packages/bundle/headless) | - | Reads the default ModelSelection from volatile Config and saves selections through the profile editor. |
| `ctx.agentLoop` | `bundle` | [`agent-loop`](../packages/core/agent-loop) | - | [`base`](../packages/bundle/base), [`sdk-minimal`](../packages/bundle/sdk-minimal) | - | 唯一的具体循环插件;扩展包依赖 dsh-agent 的事件和服务,而不依赖此包。 |
| `ctx.mcpManager` | `core` | [`mcp-manager`](../packages/mcp/mcp-manager) | - | - | - | 依据自身 volatile servers 配置对账 mcp-client 实例,聚合它们的连接状态,并向管理界面提供 restart 与 probe。 |
| `ctx.mcpClientHost` | `service` | [`mcp-client`](../packages/mcp/mcp-client) | - | [`mcp-manager`](../packages/mcp/mcp-manager) | - | 以 `host: true` 加载的 mcp-client 条目为管理器校验、挂载、探测和授权服务器,管理器只经由它使用 mcp-client;服务器运行在宿主之下,因此 MCP 客户端重载时管理器随之重启。 |
| `ctx.mcpAccounts` | `service` | [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | - | - | - | 保存 MCP 连接器插件注册的账号,并通过一个 Remote 把账号连同管理器对各服务器的视图提供给插件页;授权经由管理器完成。 |
| `ctx.mcpClientHost` | `service` | [`mcp-client`](../packages/mcp/mcp-client) | - | [`mcp-manager`](../packages/mcp/mcp-manager) | - | 管理器创建它来校验、挂载、探测和授权服务器,此外不使用 mcp-client 的任何值;其服务器运行在管理器之下。 |
| `ctx.mcpAccounts` | `service` | [`mcp-account`](../packages/mcp/mcp-account) | - | - | - | 在插件页通过连接器账号注册表显示每个 MCP 连接器插件注册的 OAuth 服务器账号;页面的操作经由管理器执行。 |
| `ctx.schedule` | `core` | [`schedule`](../packages/schedule/schedule) | - | - | - | 独立于 Session 的加载状态存储任务,并将到期消息排入每个任务的目标 Session。 |
| `ctx.goals` | `core` | [`goal`](../packages/goal/goal) | - | - | - | 从会话日志折叠带修订版本的目标状态,并将实时延续激活保留在进程本地。 |
| `ctx.ssh` | `core` | [`ssh`](../packages/ssh/ssh) | - | [`fs-ssh`](../packages/ssh/fs-ssh), [`subprocess-ssh`](../packages/ssh/subprocess-ssh), [`sandbox-ssh`](../packages/ssh/sandbox-ssh) | - | 负责一条经过认证的 OpenSSH 连接、已安装辅助程序身份、独立程序流,以及配套远端提供方的断连清理。 |
+36 -29
View File
@@ -578,6 +578,22 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-client-shortcuts -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-client-ui-account-notifications -->
<a id="deepseek-aidsh-client-ui-account-notifications"></a>
## `@deepseek-ai/dsh-client-ui-account-notifications`
- `source`: [`packages/client/ui-account-notifications/src/config.ts:5`](../packages/client/ui-account-notifications/src/config.ts)
```ts config-catalog
/** Initial polling interval before the server supplies its next delay. */
export interface Config {
/** Initial query delay in milliseconds, replaced by each successful server response. */
notificationPollIntervalMs: number
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-client-ui-account-notifications -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-client-ui-plugin-manager -->
<a id="deepseek-aidsh-client-ui-plugin-manager"></a>
@@ -625,16 +641,12 @@ export interface Config extends ContactConfig {
developerTools: Volatile<boolean>
}
/** Questionnaire destination and bonus notice timings shared by Host and Client. */
/** Questionnaire destination shared by Host and Client. */
export interface ContactConfig {
/** HTTPS questionnaire URL; override for a test form. */
contactFormUrl: string
/** Questionnaire source option; empty until Harness is supported by the form. */
contactSource: string
/** First delay before retrying a failed bonus acknowledgement. */
bonusAckRetryDelayMs: number
/** Ceiling for the acknowledgement retry backoff. */
bonusAckRetryMaxDelayMs: number
}
/** Persisted steps; a native top-up page leaves the durable step at credit. */
@@ -858,19 +870,21 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-credentials-local -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account-platform -->
<a id="deepseek-aidsh-deepseek-account-platform"></a>
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account -->
<a id="deepseek-aidsh-deepseek-account"></a>
## `@deepseek-ai/dsh-deepseek-account-platform`
## `@deepseek-ai/dsh-deepseek-account`
- `inject`: `credentials` · `authorization`
- `source`: [`packages/credentials/deepseek-account-platform/src/index.ts:23`](../packages/credentials/deepseek-account-platform/src/index.ts)
- `source`: [`packages/credentials/deepseek-account/src/index.ts:40`](../packages/credentials/deepseek-account/src/index.ts)
```ts config-catalog
/** Deployment-specific platform and request deadlines. */
export interface Config {
/** Platform origin serving auth-api and browser pages. */
platformOrigin?: string
/** Harness API origin for account notifications. */
harnessOrigin?: string
/** Native desktop identity for Host API and embedded Platform requests; null identifies the client as web. */
desktopPlatform?: 'darwin' | 'win32' | null
/** Optional frontend deployment selector for embedded Usage and Top-up pages. */
@@ -881,9 +895,11 @@ export interface Config {
allowLoopbackHttp?: boolean
/** Map authorization and completion pages to platformOrigin for private development proxies. */
rewriteBrowserOrigin?: boolean
/** Host-only headers sent exclusively to platformOrigin; account authorization cannot be overridden. */
/** Host-only headers for Platform and notification APIs; account authorization cannot be overridden. */
requestHeaders?: Record<string, string>
/** Overrides for profile, balance and embedded Platform requests; Cookie pairs merge by name. Logout retains requestHeaders. */
/** Overrides for profile, balance, notification and embedded Platform requests;
* Cookie pairs merge by name. Logout retains requestHeaders.
*/
accountRequestHeaders?: Record<string, string>
/** Deadline for each platform HTTP request. */
requestTimeoutMs?: number
@@ -897,7 +913,7 @@ export interface Config {
attemptTimeoutMs?: number
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account-platform -->
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-experimental-api-speech-to-text -->
<a id="deepseek-aidsh-experimental-api-speech-to-text"></a>
@@ -1112,7 +1128,7 @@ export interface Config {
- `inject`: `computerUse` · `tools` · `systemPrompt` · `subprocess` · `agents`
- `refs`: [`CuaConfig`](../packages/experimental/cua/src/index.ts)
- `source`: [`packages/experimental/cua-macos/src/index.ts:18`](../packages/experimental/cua-macos/src/index.ts)
- `source`: [`packages/experimental/cua-macos/src/index.ts:32`](../packages/experimental/cua-macos/src/index.ts)
```ts config-catalog
/** Native preparation, source-build signing, operation bounds, and profile-local application grants. */
@@ -2384,20 +2400,11 @@ export interface LspLocalServerConfig {
## `@deepseek-ai/dsh-mcp-client`
- `inject`: `tools`
- `source`: [`packages/mcp/mcp-client/src/index.ts:144`](../packages/mcp/mcp-client/src/index.ts)
- `source`: [`packages/mcp/mcp-client/src/index.ts:134`](../packages/mcp/mcp-client/src/index.ts)
```ts config-catalog
/** Configuration of one mcp-client instance: a server, or the host. */
export type Config = ServerConfig | HostConfig
/** Configuration for one stdio or Streamable HTTP MCP server. */
export type ServerConfig = StdioConfig | StreamableHttpConfig
/** Config of an instance that provides `ctx.mcpClientHost` instead of connecting a server. */
export interface HostConfig {
/** Provide the MCP client host. */
host: true
}
export type Config = StdioConfig | StreamableHttpConfig
/** Config for connecting to an MCP server via a spawned child process over stdio. */
export interface StdioConfig {
@@ -2506,9 +2513,9 @@ export interface McpOAuthConfig {
## `@deepseek-ai/dsh-mcp-manager`
- `inject`: `mcpClientHost`
- `inject`: `tools`
- `refs`: [`McpOAuthConfigInput`](../packages/mcp/mcp-client/src/index.ts) · [`ReconnectConfig`](../packages/mcp/mcp-client/src/index.ts) · `Volatile` (`@deepseek-ai/cordis`)
- `source`: [`packages/mcp/mcp-manager/src/index.ts:75`](../packages/mcp/mcp-manager/src/index.ts)
- `source`: [`packages/mcp/mcp-manager/src/index.ts:77`](../packages/mcp/mcp-manager/src/index.ts)
```ts config-catalog
/** Manager configuration with live server entries. */
@@ -5027,7 +5034,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| --- | --- | --- |
| `@deepseek-ai/dsh-acp-app` | `cmdlineArgs` | [`packages/bundle/acp-app/src/index.ts`](../packages/bundle/acp-app/src/index.ts) |
| `@deepseek-ai/dsh-agent` | `sessionProjections` | [`packages/core/agent/src/index.ts`](../packages/core/agent/src/index.ts) |
| `@deepseek-ai/dsh-api-account-controller` | `deepseekAccount` · `agents` | [`packages/api/account-controller/src/index.ts`](../packages/api/account-controller/src/index.ts) |
| `@deepseek-ai/dsh-api-remote-access` | — | [`packages/api/remote-access/src/index.ts`](../packages/api/remote-access/src/index.ts) |
| `@deepseek-ai/dsh-api-remotes` | `typertGateway` | [`packages/api/remotes/src/index.ts`](../packages/api/remotes/src/index.ts) |
| `@deepseek-ai/dsh-authorization` | `credentials` | [`packages/credentials/authorization/src/index.ts`](../packages/credentials/authorization/src/index.ts) |
@@ -5044,6 +5050,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) |
@@ -5058,7 +5065,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-client-ui-input-trigger` | — | [`packages/client/ui-input-trigger/src/index.ts`](../packages/client/ui-input-trigger/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-jobs` | — | [`packages/client/ui-jobs/src/index.ts`](../packages/client/ui-jobs/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-layout` | — | [`packages/client/ui-layout/src/index.ts`](../packages/client/ui-layout/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpManager` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-message-feedback` | — | [`packages/client/ui-message-feedback/src/index.ts`](../packages/client/ui-message-feedback/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-model-selection` | — | [`packages/client/ui-model-selection/src/index.ts`](../packages/client/ui-model-selection/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-open-in-app` | — | [`packages/client/ui-open-in-app/src/index.ts`](../packages/client/ui-open-in-app/src/index.ts) |
@@ -5120,6 +5126,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-host-plugin-inventory` | `loader` | [`packages/host/plugin-inventory/src/index.ts`](../packages/host/plugin-inventory/src/index.ts) |
| `@deepseek-ai/dsh-llm` | — | [`packages/llm/llm/src/index.ts`](../packages/llm/llm/src/index.ts) |
| `@deepseek-ai/dsh-lsp` | — | [`packages/lsp/lsp/src/index.ts`](../packages/lsp/lsp/src/index.ts) |
| `@deepseek-ai/dsh-mcp-account` | `mcpManager` · `connectorAccounts` | [`packages/mcp/mcp-account/src/index.ts`](../packages/mcp/mcp-account/src/index.ts) |
| `@deepseek-ai/dsh-mcp-resources` | `tools` | [`packages/mcp/mcp-resources/src/index.ts`](../packages/mcp/mcp-resources/src/index.ts) |
| `@deepseek-ai/dsh-message-quotes` | — | [`packages/session/message-quotes/src/index.ts`](../packages/session/message-quotes/src/index.ts) |
| `@deepseek-ai/dsh-otel` | — | [`packages/telemetry/otel/src/index.ts`](../packages/telemetry/otel/src/index.ts) |
@@ -5157,7 +5164,6 @@ Abstract service classes — a deployment loads a concrete implementation packag
| `@deepseek-ai/dsh-attachment` | `AttachmentStore` | — | [`packages/attachment/attachment/src/index.ts`](../packages/attachment/attachment/src/index.ts) |
| `@deepseek-ai/dsh-compaction` | `CompactionEngine` | — | [`packages/compaction/compaction/src/index.ts`](../packages/compaction/compaction/src/index.ts) |
| `@deepseek-ai/dsh-credentials` | `CredentialProvider` | — | [`packages/credentials/credentials/src/index.ts`](../packages/credentials/credentials/src/index.ts) |
| `@deepseek-ai/dsh-deepseek-account` | `DeepSeekAccount` | — | [`packages/credentials/deepseek-account/src/index.ts`](../packages/credentials/deepseek-account/src/index.ts) |
| `@deepseek-ai/dsh-file-reference` | `FileReferenceService` | — | [`packages/context/file-reference/src/index.ts`](../packages/context/file-reference/src/index.ts) |
| `@deepseek-ai/dsh-fs` | `FileSystem` | — | [`packages/fs/fs/src/index.ts`](../packages/fs/fs/src/index.ts) |
| `@deepseek-ai/dsh-host-directory-picker` | `DirectoryPicker` | — | [`packages/host/directory-picker/src/index.ts`](../packages/host/directory-picker/src/index.ts) |
@@ -5195,6 +5201,7 @@ Imported as libraries by other packages; a `cordis.yml` cannot load them.
| `@deepseek-ai/dsh-cmdline` | — | [`packages/boot/cmdline/src/index.ts`](../packages/boot/cmdline/src/index.ts) |
| `@deepseek-ai/dsh-cua-bundle` | — | [`packages/experimental/cua-bundle/src/index.ts`](../packages/experimental/cua-bundle/src/index.ts) |
| `@deepseek-ai/dsh-deque` | — | [`packages/util/deque/src/index.ts`](../packages/util/deque/src/index.ts) |
| `@deepseek-ai/dsh-error` | — | [`packages/util/error/src/index.ts`](../packages/util/error/src/index.ts) |
| `@deepseek-ai/dsh-experimental-badge-skill-bundle` | — | [`packages/experimental/badge-skill-bundle/src/index.ts`](../packages/experimental/badge-skill-bundle/src/index.ts) |
| `@deepseek-ai/dsh-experimental-browser-use-runtime` | — | [`packages/experimental/browser-use-runtime/src/index.ts`](../packages/experimental/browser-use-runtime/src/index.ts) |
| `@deepseek-ai/dsh-experimental-cot-translation-bundle` | — | [`packages/experimental/cot-translation-bundle/src/index.ts`](../packages/experimental/cot-translation-bundle/src/index.ts) |
+36 -29
View File
@@ -580,6 +580,22 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-client-shortcuts -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-client-ui-account-notifications -->
<a id="deepseek-aidsh-client-ui-account-notifications"></a>
## `@deepseek-ai/dsh-client-ui-account-notifications`
- `source`: [`packages/client/ui-account-notifications/src/config.ts:5`](../packages/client/ui-account-notifications/src/config.ts)
```ts config-catalog
/** Initial polling interval before the server supplies its next delay. */
export interface Config {
/** Initial query delay in milliseconds, replaced by each successful server response. */
notificationPollIntervalMs: number
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-client-ui-account-notifications -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-client-ui-plugin-manager -->
<a id="deepseek-aidsh-client-ui-plugin-manager"></a>
@@ -627,16 +643,12 @@ export interface Config extends ContactConfig {
developerTools: Volatile<boolean>
}
/** Questionnaire destination and bonus notice timings shared by Host and Client. */
/** Questionnaire destination shared by Host and Client. */
export interface ContactConfig {
/** HTTPS questionnaire URL; override for a test form. */
contactFormUrl: string
/** Questionnaire source option; empty until Harness is supported by the form. */
contactSource: string
/** First delay before retrying a failed bonus acknowledgement. */
bonusAckRetryDelayMs: number
/** Ceiling for the acknowledgement retry backoff. */
bonusAckRetryMaxDelayMs: number
}
/** Persisted steps; a native top-up page leaves the durable step at credit. */
@@ -860,19 +872,21 @@ export interface Config {
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-credentials-local -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account-platform -->
<a id="deepseek-aidsh-deepseek-account-platform"></a>
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account -->
<a id="deepseek-aidsh-deepseek-account"></a>
## `@deepseek-ai/dsh-deepseek-account-platform`
## `@deepseek-ai/dsh-deepseek-account`
- `inject`: `credentials` · `authorization`
- `source`: [`packages/credentials/deepseek-account-platform/src/index.ts:23`](../packages/credentials/deepseek-account-platform/src/index.ts)
- `source`: [`packages/credentials/deepseek-account/src/index.ts:40`](../packages/credentials/deepseek-account/src/index.ts)
```ts config-catalog
/** Deployment-specific platform and request deadlines. */
export interface Config {
/** Platform origin serving auth-api and browser pages. */
platformOrigin?: string
/** Harness API origin for account notifications. */
harnessOrigin?: string
/** Native desktop identity for Host API and embedded Platform requests; null identifies the client as web. */
desktopPlatform?: 'darwin' | 'win32' | null
/** Optional frontend deployment selector for embedded Usage and Top-up pages. */
@@ -883,9 +897,11 @@ export interface Config {
allowLoopbackHttp?: boolean
/** Map authorization and completion pages to platformOrigin for private development proxies. */
rewriteBrowserOrigin?: boolean
/** Host-only headers sent exclusively to platformOrigin; account authorization cannot be overridden. */
/** Host-only headers for Platform and notification APIs; account authorization cannot be overridden. */
requestHeaders?: Record<string, string>
/** Overrides for profile, balance and embedded Platform requests; Cookie pairs merge by name. Logout retains requestHeaders. */
/** Overrides for profile, balance, notification and embedded Platform requests;
* Cookie pairs merge by name. Logout retains requestHeaders.
*/
accountRequestHeaders?: Record<string, string>
/** Deadline for each platform HTTP request. */
requestTimeoutMs?: number
@@ -899,7 +915,7 @@ export interface Config {
attemptTimeoutMs?: number
}
```
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account-platform -->
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-deepseek-account -->
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-experimental-api-speech-to-text -->
<a id="deepseek-aidsh-experimental-api-speech-to-text"></a>
@@ -1114,7 +1130,7 @@ export interface Config {
- `inject`: `computerUse` · `tools` · `systemPrompt` · `subprocess` · `agents`
- `refs`: [`CuaConfig`](../packages/experimental/cua/src/index.ts)
- `source`: [`packages/experimental/cua-macos/src/index.ts:18`](../packages/experimental/cua-macos/src/index.ts)
- `source`: [`packages/experimental/cua-macos/src/index.ts:32`](../packages/experimental/cua-macos/src/index.ts)
```ts config-catalog
/** Native preparation, source-build signing, operation bounds, and profile-local application grants. */
@@ -2386,20 +2402,11 @@ export interface LspLocalServerConfig {
## `@deepseek-ai/dsh-mcp-client`
- `inject`: `tools`
- `source`: [`packages/mcp/mcp-client/src/index.ts:144`](../packages/mcp/mcp-client/src/index.ts)
- `source`: [`packages/mcp/mcp-client/src/index.ts:134`](../packages/mcp/mcp-client/src/index.ts)
```ts config-catalog
/** Configuration of one mcp-client instance: a server, or the host. */
export type Config = ServerConfig | HostConfig
/** Configuration for one stdio or Streamable HTTP MCP server. */
export type ServerConfig = StdioConfig | StreamableHttpConfig
/** Config of an instance that provides `ctx.mcpClientHost` instead of connecting a server. */
export interface HostConfig {
/** Provide the MCP client host. */
host: true
}
export type Config = StdioConfig | StreamableHttpConfig
/** Config for connecting to an MCP server via a spawned child process over stdio. */
export interface StdioConfig {
@@ -2508,9 +2515,9 @@ export interface McpOAuthConfig {
## `@deepseek-ai/dsh-mcp-manager`
- `inject`: `mcpClientHost`
- `inject`: `tools`
- `refs`: [`McpOAuthConfigInput`](../packages/mcp/mcp-client/src/index.ts) · [`ReconnectConfig`](../packages/mcp/mcp-client/src/index.ts) · `Volatile` (`@deepseek-ai/cordis`)
- `source`: [`packages/mcp/mcp-manager/src/index.ts:75`](../packages/mcp/mcp-manager/src/index.ts)
- `source`: [`packages/mcp/mcp-manager/src/index.ts:77`](../packages/mcp/mcp-manager/src/index.ts)
```ts config-catalog
/** Manager configuration with live server entries. */
@@ -5029,7 +5036,6 @@ export interface Config {
| --- | --- | --- |
| `@deepseek-ai/dsh-acp-app` | `cmdlineArgs` | [`packages/bundle/acp-app/src/index.ts`](../packages/bundle/acp-app/src/index.ts) |
| `@deepseek-ai/dsh-agent` | `sessionProjections` | [`packages/core/agent/src/index.ts`](../packages/core/agent/src/index.ts) |
| `@deepseek-ai/dsh-api-account-controller` | `deepseekAccount` · `agents` | [`packages/api/account-controller/src/index.ts`](../packages/api/account-controller/src/index.ts) |
| `@deepseek-ai/dsh-api-remote-access` | — | [`packages/api/remote-access/src/index.ts`](../packages/api/remote-access/src/index.ts) |
| `@deepseek-ai/dsh-api-remotes` | `typertGateway` | [`packages/api/remotes/src/index.ts`](../packages/api/remotes/src/index.ts) |
| `@deepseek-ai/dsh-authorization` | `credentials` | [`packages/credentials/authorization/src/index.ts`](../packages/credentials/authorization/src/index.ts) |
@@ -5046,6 +5052,7 @@ export interface Config {
| `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) |
@@ -5060,7 +5067,6 @@ export interface Config {
| `@deepseek-ai/dsh-client-ui-input-trigger` | — | [`packages/client/ui-input-trigger/src/index.ts`](../packages/client/ui-input-trigger/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-jobs` | — | [`packages/client/ui-jobs/src/index.ts`](../packages/client/ui-jobs/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-layout` | — | [`packages/client/ui-layout/src/index.ts`](../packages/client/ui-layout/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-mcp-account` | `mcpManager` | [`packages/client/ui-mcp-account/src/index.ts`](../packages/client/ui-mcp-account/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-message-feedback` | — | [`packages/client/ui-message-feedback/src/index.ts`](../packages/client/ui-message-feedback/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-model-selection` | — | [`packages/client/ui-model-selection/src/index.ts`](../packages/client/ui-model-selection/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-open-in-app` | — | [`packages/client/ui-open-in-app/src/index.ts`](../packages/client/ui-open-in-app/src/index.ts) |
@@ -5122,6 +5128,7 @@ export interface Config {
| `@deepseek-ai/dsh-host-plugin-inventory` | `loader` | [`packages/host/plugin-inventory/src/index.ts`](../packages/host/plugin-inventory/src/index.ts) |
| `@deepseek-ai/dsh-llm` | — | [`packages/llm/llm/src/index.ts`](../packages/llm/llm/src/index.ts) |
| `@deepseek-ai/dsh-lsp` | — | [`packages/lsp/lsp/src/index.ts`](../packages/lsp/lsp/src/index.ts) |
| `@deepseek-ai/dsh-mcp-account` | `mcpManager` · `connectorAccounts` | [`packages/mcp/mcp-account/src/index.ts`](../packages/mcp/mcp-account/src/index.ts) |
| `@deepseek-ai/dsh-mcp-resources` | `tools` | [`packages/mcp/mcp-resources/src/index.ts`](../packages/mcp/mcp-resources/src/index.ts) |
| `@deepseek-ai/dsh-message-quotes` | — | [`packages/session/message-quotes/src/index.ts`](../packages/session/message-quotes/src/index.ts) |
| `@deepseek-ai/dsh-otel` | — | [`packages/telemetry/otel/src/index.ts`](../packages/telemetry/otel/src/index.ts) |
@@ -5159,7 +5166,6 @@ export interface Config {
| `@deepseek-ai/dsh-attachment` | `AttachmentStore` | — | [`packages/attachment/attachment/src/index.ts`](../packages/attachment/attachment/src/index.ts) |
| `@deepseek-ai/dsh-compaction` | `CompactionEngine` | — | [`packages/compaction/compaction/src/index.ts`](../packages/compaction/compaction/src/index.ts) |
| `@deepseek-ai/dsh-credentials` | `CredentialProvider` | — | [`packages/credentials/credentials/src/index.ts`](../packages/credentials/credentials/src/index.ts) |
| `@deepseek-ai/dsh-deepseek-account` | `DeepSeekAccount` | — | [`packages/credentials/deepseek-account/src/index.ts`](../packages/credentials/deepseek-account/src/index.ts) |
| `@deepseek-ai/dsh-file-reference` | `FileReferenceService` | — | [`packages/context/file-reference/src/index.ts`](../packages/context/file-reference/src/index.ts) |
| `@deepseek-ai/dsh-fs` | `FileSystem` | — | [`packages/fs/fs/src/index.ts`](../packages/fs/fs/src/index.ts) |
| `@deepseek-ai/dsh-host-directory-picker` | `DirectoryPicker` | — | [`packages/host/directory-picker/src/index.ts`](../packages/host/directory-picker/src/index.ts) |
@@ -5197,6 +5203,7 @@ export interface Config {
| `@deepseek-ai/dsh-cmdline` | — | [`packages/boot/cmdline/src/index.ts`](../packages/boot/cmdline/src/index.ts) |
| `@deepseek-ai/dsh-cua-bundle` | — | [`packages/experimental/cua-bundle/src/index.ts`](../packages/experimental/cua-bundle/src/index.ts) |
| `@deepseek-ai/dsh-deque` | — | [`packages/util/deque/src/index.ts`](../packages/util/deque/src/index.ts) |
| `@deepseek-ai/dsh-error` | — | [`packages/util/error/src/index.ts`](../packages/util/error/src/index.ts) |
| `@deepseek-ai/dsh-experimental-badge-skill-bundle` | — | [`packages/experimental/badge-skill-bundle/src/index.ts`](../packages/experimental/badge-skill-bundle/src/index.ts) |
| `@deepseek-ai/dsh-experimental-browser-use-runtime` | — | [`packages/experimental/browser-use-runtime/src/index.ts`](../packages/experimental/browser-use-runtime/src/index.ts) |
| `@deepseek-ai/dsh-experimental-cot-translation-bundle` | — | [`packages/experimental/cot-translation-bundle/src/index.ts`](../packages/experimental/cot-translation-bundle/src/index.ts) |
+2 -2
View File
@@ -9,8 +9,8 @@
en: 2cc80a2a79e23005
zh: 87e43383055890ce
/tool-authoring-reference/rules-of-the-execute-contract:
en: f12260d67c4c4d4d
zh: 3955d44622432fd9
en: b81b03778cfdecde
zh: 83f0b7863a5217c6
/tool-authoring-reference/long-running-work:
en: 5f6b0c15cb91e21b
zh: 633a2192df186ac3
+1 -1
View File
@@ -45,7 +45,7 @@ Registration is effect-based: disposing the plugin fiber unregisters the tool. S
- **Execution identity is protected.** The registry materializes `arguments` as detached lossless JSON in one recursive pass, freezes that value before policy starts, and assigns an opaque `exec.token`; `callId`, `name`, `arguments`, `agent`, `token`, the required caller-owned `signal`, and an optional enclosing-transport `parent` token stay immutable through dispatch. `parent` is identity-only and exposes no live outer execution. Treat `args` as readonly input. Only an around-dispatch wrapper receives a mutable view, and it may replace and restore the required `exec.signal` to impose a deadline but cannot remove it.
- **Declare and return one canonical JSON value.** `output.schema` uses `ValueSchemaSpec` and may have an object, array, scalar, or null root. `execute` returns only the inferred value; the registry snapshots it as lossless JSON, validates it, freezes it, and passes it to `output.render(args, value)`. Do not return content blocks from the body or make callers parse prose for ids and fields.
- **Throwing or returning an invalid value means `isError`.** The registry catches throws and contains schema, renderer, metadata-projector, and lossless-JSON failures before observers run. Throw a `HarnessError` subclass with a stable `code` for every expected failure; a thrown `HarnessError` is the only tool-body outcome that keeps `error.name` and `error.code` on the result, and the [error-handling rules](../../.agents/skills/dsh-error-handling/SKILL.md#tool-failures) define the classes and codes. Represent a successful domain outcome in the canonical value even when its Native renderer explains a non-ideal state, such as a non-zero process exit.
- **Honor `exec.signal`.** Cancel in-flight work when it fires and throw a `HarnessError` named `AbortError` whose code is the `TOOL_ABORTED` constant (`ABORTED`), matching the registry's own cancellation result.
- **Honor `exec.signal`.** Cancel in-flight work when it fires and let the signal's reason or a dependency's error named `AbortError` propagate; the registry records it as `AbortError` with the `TOOL_ABORTED` constant (`ABORTED`). Do not replace it with a different plain `Error`.
- **Project durable card data with `presentationMeta` (optional).** `output.presentationMeta(args, value)` derives replayable JSON from the same canonical value. The core persists it on `tool/result` and hands it to `presentResult`, so a card that needs result-time facts—such as `write`/`edit` applied hunks—survives replay without persisting the canonical value. The projector is skipped for nested Code dispatches because they have no cards.
- **Use `exec.agent` for async notifications.** `agent.inject({ content, source: { kind: 'my-plugin' } })` appends durable context the NEXT model request sees — it is not a wake-up (an idle agent stays idle). Declare that `kind` through [`MessageSourceMap`](../subsystems/llm-streaming.md#content-blocks-and-messages) in your plugin: session format V4 rejects the retired `{ kind: 'plugin', plugin: '<name>' }` wrapper at message admission. Guard against disposed agents (try/catch).
+1 -1
View File
@@ -45,7 +45,7 @@ export function apply(ctx: Context) {
- **执行身份受保护。** 注册表在一次递归遍历中将 `arguments` 物化为分离的无损 JSON,在策略开始前冻结该值,并分配一个不透明的 `exec.token`;`callId`、`name`、`arguments`、`agent`、`token`、必填且由调用方持有的 `signal`,以及可选的外层传输 `parent` token 在整个分发过程中保持不可变。`parent` 仅用于身份标识,不暴露活跃的外层执行。请将 `args` 视为只读输入。只有 around-dispatch 包装器会收到可变视图;它可以替换并恢复必填的 `exec.signal` 以施加截止时间,但不能移除该信号。
- **声明并返回一个规范 JSON 值。** `output.schema` 使用 `ValueSchemaSpec`,根可以是对象、数组、标量或 null。`execute` 只返回推导出的值;注册表将其快照为无损 JSON,完成校验和冻结后,再传给 `output.render(args, value)`。工具主体不要返回内容块,也不要迫使调用方从自然语言中解析 id 和字段。
- **抛出异常或返回无效值意味着 `isError`。** 注册表会捕获异常,并在观察者运行前收敛 schema、渲染器、元数据投影器和无损 JSON 失败。每种预期失败都应抛出带稳定 `code` 的 `HarnessError` 子类;在工具主体的各种产出中,只有抛出的 `HarnessError` 会让结果保留 `error.name` 和 `error.code`,具体的错误类和 code 由[错误处理规则](../../.agents/skills/dsh-error-handling/SKILL.md#tool-failures)规定。成功的领域结果即使表示不理想的状态,也应写入规范值;其 Native 渲染器可以解释该状态,例如进程以非零状态退出。
- **遵守 `exec.signal`。** 信号触发时取消进行中的工作,并抛出 `name` 为 `AbortError`、code 为 `TOOL_ABORTED` 常量(值为 `ABORTED`)的 `HarnessError`,与注册表自己生成的取消结果一致。
- **遵守 `exec.signal`。** 信号触发时取消进行中的工作,让 signal 的 reason 或依赖抛出的、name 为 `AbortError` 的错误直接传播;注册表会把它记录为 `AbortError` 与 `TOOL_ABORTED` 常量(值为 `ABORTED`)。不要把它替换成另一个普通 `Error`。
- **使用 `presentationMeta` 投影持久化的卡片数据(可选)。** `output.presentationMeta(args, value)` 从同一个规范值派生可回放的 JSON。核心将其持久化在 `tool/result` 上并传给 `presentResult`,因此需要结果期事实的卡片——例如 `write`/`edit` 的已应用 hunk——无需持久化规范值也能在回放中重现。嵌套 Code 分发没有卡片,因此会跳过该投影器。
- **使用 `exec.agent` 发送异步通知。** `agent.inject({ content, source: { kind: 'my-plugin' } })` 追加持久化上下文,下一次模型请求会看到它——这不是唤醒(空闲的 agent(智能体)保持空闲)。在插件里通过 [`MessageSourceMap`](../subsystems/llm-streaming.zh.md#content-blocks-and-messages) 声明该 `kind`:session format V4 在消息准入处拒绝退役的 `{ kind: 'plugin', plugin: '<name>' }` 包装。请防范已 dispose 的 agent(try/catch)。
@@ -12,5 +12,5 @@
en: 86422ee69c63f339
zh: 4a5e8d6f5d9a6ae3
/remote-and-api-rules/packages-api-carries-generic-orchestration-only:
en: 12a964b9c04fccf9
zh: cf804f8044535727
en: b9991b7ffcbf9029
zh: bb7ef15064e922be
+1 -1
View File
@@ -84,7 +84,7 @@ The hand-written copy drifts from the generated type without failing a build, th
The packages under `packages/api` — the controllers, `gateway`, and `remotes` — carry transport, call shape, Session lifecycle, and other generic orchestration. A business branch never aggregates there: a decision that depends on concrete business state, handling bound to one feature, or a per-feature filter belongs in its own package or module and reaches this layer as projected data or through a registration surface. The criterion is where the logic belongs, not where the file sits, so a branch that only makes sense for one feature is a defect even when the file holding it is generic.
- Judged by: where the branch reads its condition. An `if` or `switch` over feature state, a per-feature filter, or a helper named for one feature inside `packages/api` is the defect; the same decision taken in the owning package and consumed here as projected data or a registered entry is not. The package census shows the impact: `packages/api` holds nine packages — `account-controller`, `gateway`, `job-controller`, `remotes`, `session-controller`, `settings-controller`, `terminal-controller`, `workspace-controller`, `workspace-files` — and `session-controller` is the largest at 34 `src` files (terminal-controller 12, gateway 11, workspace-controller 10, workspace-files 8, job-controller 8, remotes 4, settings-controller 3, account-controller 2).
- Judged by: where the branch reads its condition. An `if` or `switch` over feature state, a per-feature filter, or a helper named for one feature inside `packages/api` is the defect; the same decision taken in the owning package and consumed here as projected data or a registered entry is not. The package census shows the impact: `packages/api` holds eight packages — `gateway`, `job-controller`, `remotes`, `session-controller`, `settings-controller`, `terminal-controller`, `workspace-controller`, `workspace-files` — and `session-controller` is the largest at 34 `src` files (terminal-controller 12, gateway 11, workspace-controller 10, workspace-files 8, job-controller 8, remotes 4, settings-controller 3).
- Not covered: generic Session lifecycle, transport, and storage abstraction stay — `gateway` dispatch, `remotes` selection, and shared session-list and catalog reads are infrastructure, not business logic. [Business ownership](../api-gateway.md#business-ownership) states the same split from the Gateway side.
- Exception: none by default. Adding a business branch here needs an independent-package review, and that review answers why the logic cannot live in the package that owns the feature.
- Fix: move the decision into the owning package, publish its result as projected data or register it on a registry this layer already injects, and leave only the orchestration that reads it.
+1 -1
View File
@@ -84,7 +84,7 @@ type SessionRemote = { list(): ...; rename(id: string): ... } // hand-written
`packages/api` 下的包——各 controller、`gateway`、`remotes`——承载传输、调用形态、Session 生命周期等通用编排。业务分支绝不在其中聚合:依赖具体业务状态的判断、与单个功能绑定的处理、逐功能的过滤,都归独立包或模块,并作为投影数据或经注册面接入本层。判据是逻辑的归属,而不是文件的位置,所以只对一个功能成立的业务分支即使放在通用文件里也是缺陷。
- 判定:分支的条件从哪里读取。在 `packages/api` 内对功能状态做 `if` 或 `switch`、写逐功能的过滤、或以某个功能命名的辅助方法,即为缺陷;同样的判断由归属包做出、在本层作为投影数据或注册条目消费,则不是。包普查是影响面的证据:`packages/api` 共 9 个包——`account-controller`、`gateway`、`job-controller`、`remotes`、`session-controller`、`settings-controller`、`terminal-controller`、`workspace-controller`、`workspace-files`——其中 `session-controller` 以 34 个 `src` 文件为最多(terminal-controller 12、gateway 11、workspace-controller 10、workspace-files 8、job-controller 8、remotes 4、settings-controller 3、account-controller 2)。
- 判定:分支的条件从哪里读取。在 `packages/api` 内对功能状态做 `if` 或 `switch`、写逐功能的过滤、或以某个功能命名的辅助方法,即为缺陷;同样的判断由归属包做出、在本层作为投影数据或注册条目消费,则不是。包普查是影响面的证据:`packages/api` 共 8 个包——`gateway`、`job-controller`、`remotes`、`session-controller`、`settings-controller`、`terminal-controller`、`workspace-controller`、`workspace-files`——其中 `session-controller` 以 34 个 `src` 文件为最多(terminal-controller 12、gateway 11、workspace-controller 10、workspace-files 8、job-controller 8、remotes 4、settings-controller 3)。
- 不覆盖:通用 Session 生命周期、传输与存储抽象留下——`gateway` 的分发、`remotes` 的选择、共享的会话列表与目录读取属于基础设施,不是业务逻辑。[业务所有权](../api-gateway.zh.md#business-ownership)从 Gateway 一侧给出同一个划分。
- 例外:默认无例外。在此新增业务分支须走独立包评审,评审要回答这些逻辑为什么不能住在拥有该功能的包里。
- 修法:把判断移进归属包,将其结果作为投影数据发布、或注册到本层本就注入的注册表上,这里只留下读取它的编排。
+11 -11
View File
@@ -40,11 +40,11 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `cordis/inspect-query-resolved` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:401`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `cordis/request-run` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:371`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `cordis/request-run-resolved` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:377`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `credentials/record-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:99`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`authorization`](../packages/credentials/authorization), [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform), [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `credentials/reference-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:87`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:97`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` |
| `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:93`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | `account-controller`, `remotes` |
| `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:12`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) |
| `credentials/record-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:100`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`authorization`](../packages/credentials/authorization), [`deepseek-account`](../packages/credentials/deepseek-account), [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `credentials/reference-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:88`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:110`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` |
| `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:106`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account), `remotes` |
| `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:29`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) |
| `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` |
| `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) |
| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:27`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `forge-session` |
@@ -60,13 +60,13 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `llm/adapters-updated` | `emit` | [`packages/llm/llm/src/types.ts:24`](../packages/llm/llm/src/types.ts) | [`llm`](../packages/llm/llm) (`events.dispatch`) | [`acp`](../packages/acp/acp), `remotes` |
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:76`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title) |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | [`mcp-account`](../packages/mcp/mcp-account) |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:452`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:458`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:465`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:444`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - |
| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:472`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:447`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - |
| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:475`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-market/changed` | `emit` | [`packages/boot/plugin-market/src/types.ts:174`](../packages/boot/plugin-market/src/types.ts) | [`plugin-market`](../packages/boot/plugin-market) (`emit`) | `remotes` |
| `schedule/changed` | `emit` | [`packages/schedule/schedule/src/types.ts:634`](../packages/schedule/schedule/src/types.ts) | [`schedule`](../packages/schedule/schedule) (`emit`) | `remotes` |
| `schedule/resolve-agent` | `waterfall` | [`packages/schedule/schedule/src/index.ts:71`](../packages/schedule/schedule/src/index.ts) | [`schedule`](../packages/schedule/schedule) (`waterfall`) | `server` |
+11 -11
View File
@@ -42,11 +42,11 @@
| `cordis/inspect-query-resolved` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:401`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `cordis/request-run` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:371`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `cordis/request-run-resolved` | `emit` | [`packages/extensions/cordis-host-runner/src/types.ts:377`](../packages/extensions/cordis-host-runner/src/types.ts) | [`cordis-host-runner`](../packages/extensions/cordis-host-runner) (`emit`) | `remotes` |
| `credentials/record-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:99`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`authorization`](../packages/credentials/authorization), [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform), [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `credentials/reference-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:87`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:97`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` |
| `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:93`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | `account-controller`, `remotes` |
| `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:12`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) |
| `credentials/record-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:100`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`authorization`](../packages/credentials/authorization), [`deepseek-account`](../packages/credentials/deepseek-account), [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `credentials/reference-updated` | `emit` | [`packages/credentials/credentials/src/types.ts:88`](../packages/credentials/credentials/src/types.ts) | [`credentials`](../packages/credentials/credentials) (`events.dispatch`) | [`mcp-client`](../packages/mcp/mcp-client), `remotes` |
| `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:110`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` |
| `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:106`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account), `remotes` |
| `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:29`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) |
| `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` |
| `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) |
| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:27`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `forge-session` |
@@ -62,13 +62,13 @@
| `llm/adapters-updated` | `emit` | [`packages/llm/llm/src/types.ts:24`](../packages/llm/llm/src/types.ts) | [`llm`](../packages/llm/llm) (`events.dispatch`) | [`acp`](../packages/acp/acp), `remotes` |
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:76`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title) |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | [`mcp-account`](../packages/mcp/mcp-account) |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:452`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:458`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:465`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:444`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - |
| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:472`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:447`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - |
| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:475`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-market/changed` | `emit` | [`packages/boot/plugin-market/src/types.ts:174`](../packages/boot/plugin-market/src/types.ts) | [`plugin-market`](../packages/boot/plugin-market) (`emit`) | `remotes` |
| `schedule/changed` | `emit` | [`packages/schedule/schedule/src/types.ts:634`](../packages/schedule/schedule/src/types.ts) | [`schedule`](../packages/schedule/schedule) (`emit`) | `remotes` |
| `schedule/resolve-agent` | `waterfall` | [`packages/schedule/schedule/src/index.ts:71`](../packages/schedule/schedule/src/index.ts) | [`schedule`](../packages/schedule/schedule) (`waterfall`) | `server` |
+51 -49
View File
@@ -12,6 +12,7 @@ flowchart TD
pkg_brand["brand"]
pkg_chunked_list["chunked-list"]
pkg_deque["deque"]
pkg_error["error"]
pkg_home_paths["home-paths"]
pkg_http_proxy["http-proxy"]
pkg_launch_environment["launch-environment"]
@@ -114,7 +115,6 @@ flowchart TD
pkg_acp["acp"]
end
subgraph group_api["packages/api"]
pkg_api_account_controller["api-account-controller"]
pkg_api_gateway["api-gateway"]
pkg_api_job_controller["api-job-controller"]
pkg_api_remote_access["api-remote-access"]
@@ -158,6 +158,7 @@ flowchart TD
pkg_client_resources["client-resources"]
pkg_client_shortcuts["client-shortcuts"]
pkg_client_store["client-store"]
pkg_client_ui_account_notifications["client-ui-account-notifications"]
pkg_client_ui_agent_preset["client-ui-agent-preset"]
pkg_client_ui_agent_team["client-ui-agent-team"]
pkg_client_ui_approval["client-ui-approval"]
@@ -165,6 +166,7 @@ flowchart TD
pkg_client_ui_brand_official["client-ui-brand-official"]
pkg_client_ui_chat["client-ui-chat"]
pkg_client_ui_commands["client-ui-commands"]
pkg_client_ui_connector_account["client-ui-connector-account"]
pkg_client_ui_context_menu["client-ui-context-menu"]
pkg_client_ui_conversation["client-ui-conversation"]
pkg_client_ui_deliverables["client-ui-deliverables"]
@@ -178,7 +180,6 @@ flowchart TD
pkg_client_ui_input_trigger["client-ui-input-trigger"]
pkg_client_ui_jobs["client-ui-jobs"]
pkg_client_ui_layout["client-ui-layout"]
pkg_client_ui_mcp_account["client-ui-mcp-account"]
pkg_client_ui_message_feedback["client-ui-message-feedback"]
pkg_client_ui_model_selection["client-ui-model-selection"]
pkg_client_ui_open_in_app["client-ui-open-in-app"]
@@ -245,7 +246,6 @@ flowchart TD
pkg_credentials["credentials"]
pkg_credentials_local["credentials-local"]
pkg_deepseek_account["deepseek-account"]
pkg_deepseek_account_platform["deepseek-account-platform"]
end
subgraph group_deliverables["packages/deliverables"]
pkg_deliverable_file_references["deliverable-file-references"]
@@ -366,6 +366,7 @@ flowchart TD
pkg_tool_lsp["tool-lsp"]
end
subgraph group_mcp["packages/mcp"]
pkg_mcp_account["mcp-account"]
pkg_mcp_client["mcp-client"]
pkg_mcp_manager["mcp-manager"]
pkg_mcp_resources["mcp-resources"]
@@ -486,12 +487,8 @@ flowchart TD
subgraph group_workspace["packages/workspace"]
pkg_workspace["workspace"]
end
pkg_llm --> pkg_error
pkg_session --> pkg_scope
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
pkg_web --> pkg_llm
pkg_api_remotes --> pkg_scope
pkg_attachment --> pkg_brand
pkg_app_boot --> pkg_home_paths
@@ -499,8 +496,6 @@ flowchart TD
pkg_browser_use --> pkg_brand
pkg_client_connection --> pkg_scope
pkg_computer_use --> pkg_brand
pkg_authorization --> pkg_credentials
pkg_authorization --> pkg_llm
pkg_credentials_local --> pkg_atomic_write
pkg_credentials_local --> pkg_credentials
pkg_credentials_local --> pkg_home_paths
@@ -508,17 +503,17 @@ flowchart TD
pkg_experimental_liveshare --> pkg_scope
pkg_anonymous_user_id --> pkg_brand
pkg_anonymous_user_id --> pkg_home_paths
pkg_lsp --> pkg_brand
pkg_lsp --> pkg_llm
pkg_storage_domain --> pkg_storage
pkg_storage_json --> pkg_storage
pkg_storage_sqlite --> pkg_storage
pkg_subprocess --> pkg_http_proxy
pkg_remote_mock --> pkg_typert_protocol
pkg_typert_loader --> pkg_typert_registry
pkg_skill_office --> pkg_skill
pkg_web_fetch_http --> pkg_timeout
pkg_web_fetch_http --> pkg_web
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
pkg_web --> pkg_llm
pkg_spill --> pkg_brand
pkg_spill --> pkg_llm
pkg_spill --> pkg_session
@@ -527,17 +522,14 @@ flowchart TD
pkg_attachment_local --> pkg_home_paths
pkg_hmr --> pkg_app_boot
pkg_hmr --> pkg_cmdline
pkg_deliverable_file_references --> pkg_system_prompt
pkg_authorization --> pkg_credentials
pkg_authorization --> pkg_llm
pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use
pkg_experimental_forge_github --> pkg_experimental_forge
pkg_experimental_forge_github --> pkg_subprocess
pkg_experimental_webworker_runtime --> pkg_client_connection
pkg_experimental_webworker_runtime --> pkg_client_modules
pkg_experimental_webworker_runtime --> pkg_host_webserver
pkg_plugin_recommendations --> pkg_llm
pkg_plugin_recommendations --> pkg_skill
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_directory_picker_auto --> pkg_client_connection
pkg_host_directory_picker_auto --> pkg_client_ui_directory_picker_browse
pkg_host_directory_picker_auto --> pkg_client_ui_directory_picker_native
@@ -546,11 +538,10 @@ flowchart TD
pkg_host_directory_picker_auto --> pkg_host_webserver
pkg_host_frontend_static --> pkg_client_connection
pkg_host_frontend_static --> pkg_host_webserver
pkg_persona --> pkg_system_prompt
pkg_lsp --> pkg_brand
pkg_lsp --> pkg_llm
pkg_sandbox --> pkg_llm
pkg_sandbox --> pkg_session
pkg_sandbox_windows_acl --> pkg_skill
pkg_sandbox_windows_acl --> pkg_subprocess
pkg_session_format_catalog --> pkg_session
pkg_session_log_deepseek --> pkg_deepseek_llm_api_extensions
pkg_session_log_deepseek --> pkg_session
@@ -568,11 +559,15 @@ flowchart TD
pkg_fs --> pkg_brand
pkg_fs --> pkg_llm
pkg_fs --> pkg_sandbox
pkg_skill_office --> pkg_skill
pkg_web_fetch_http --> pkg_timeout
pkg_web_fetch_http --> pkg_web
pkg_spill_local --> pkg_spill
pkg_session_log_export --> pkg_session
pkg_session_log_export --> pkg_session_persistence
pkg_config_editor --> pkg_app_boot
pkg_config_editor --> pkg_hmr
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_speech_to_text --> pkg_settings
pkg_experimental_translator --> pkg_credentials
pkg_experimental_translator --> pkg_launch_environment
@@ -581,11 +576,18 @@ flowchart TD
pkg_experimental_translator --> pkg_session_persistence
pkg_experimental_translator --> pkg_timeout
pkg_experimental_translator --> pkg_util_values
pkg_plugin_recommendations --> pkg_llm
pkg_plugin_recommendations --> pkg_skill
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_product_telemetry_otel --> pkg_otel
pkg_persona --> pkg_system_prompt
pkg_ptc_runtime --> pkg_sandbox
pkg_sandbox_local --> pkg_llm
pkg_sandbox_local --> pkg_sandbox
pkg_sandbox_local --> pkg_session
pkg_sandbox_windows_acl --> pkg_skill
pkg_sandbox_windows_acl --> pkg_subprocess
pkg_session_persistence_jsonl --> pkg_session
pkg_session_persistence_jsonl --> pkg_session_persistence
pkg_session_projection_cache --> pkg_session
@@ -693,8 +695,12 @@ flowchart TD
pkg_tmux_context --> pkg_session_projection
pkg_tmux_context --> pkg_shell
pkg_deepseek_account --> pkg_agent
pkg_deepseek_account --> pkg_authorization
pkg_deepseek_account --> pkg_brand
pkg_deepseek_account --> pkg_credentials
pkg_deepseek_account --> pkg_host_webserver
pkg_deepseek_account --> pkg_llm
pkg_deepseek_account --> pkg_typert_protocol
pkg_deepseek_account --> pkg_util_values
pkg_commands --> pkg_agent
pkg_commands --> pkg_attachment
@@ -718,6 +724,7 @@ flowchart TD
pkg_user_questions --> pkg_typert_protocol
pkg_jobs --> pkg_agent
pkg_jobs --> pkg_brand
pkg_jobs --> pkg_error
pkg_jobs --> pkg_session
pkg_jobs --> pkg_workspace
pkg_sandbox_policy --> pkg_agent
@@ -740,6 +747,7 @@ flowchart TD
pkg_working_directory --> pkg_system_prompt
pkg_terminal --> pkg_agent
pkg_terminal --> pkg_brand
pkg_terminal --> pkg_error
pkg_loader_smoke --> pkg_agent
pkg_loader_smoke --> pkg_http_proxy
pkg_loader_smoke --> pkg_llm
@@ -772,17 +780,10 @@ flowchart TD
pkg_web_search_deepseek --> pkg_llm_deepseek
pkg_web_search_deepseek --> pkg_session
pkg_web_search_deepseek --> pkg_web
pkg_api_account_controller --> pkg_agent
pkg_api_account_controller --> pkg_deepseek_account
pkg_api_account_controller --> pkg_typert_protocol
pkg_compaction --> pkg_brand
pkg_compaction --> pkg_commands
pkg_compaction --> pkg_llm
pkg_compaction --> pkg_session
pkg_deepseek_account_platform --> pkg_authorization
pkg_deepseek_account_platform --> pkg_credentials
pkg_deepseek_account_platform --> pkg_deepseek_account
pkg_deepseek_account_platform --> pkg_host_webserver
pkg_experimental_ptc_runtime_python --> pkg_ptc_runtime
pkg_experimental_ptc_runtime_python --> pkg_sandbox
pkg_experimental_ptc_runtime_python --> pkg_sandbox_policy
@@ -1546,6 +1547,7 @@ flowchart TD
| [`brand`](../packages/util/brand) | `util` | — |
| [`chunked-list`](../packages/util/chunked-list) | `util` | — |
| [`deque`](../packages/util/deque) | `util` | — |
| [`error`](../packages/util/error) | `util` | — |
| [`home-paths`](../packages/util/home-paths) | `util` | — |
| [`http-proxy`](../packages/util/http-proxy) | `util` | — |
| [`launch-environment`](../packages/util/launch-environment) | `util` | — |
@@ -1564,7 +1566,6 @@ flowchart TD
| [`util-values`](../packages/util/values) | `util` | — |
| [`util-workspace-path`](../packages/util/workspace-path) | `util` | — |
| [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | `llm` | — |
| [`llm`](../packages/llm/llm) | `llm` | — |
| [`scope`](../packages/core/scope) | `core` | — |
| [`fs-patch`](../packages/fs/fs-patch) | `fs` | — |
| [`api-gateway`](../packages/api/gateway) | `api` | — |
@@ -1584,6 +1585,7 @@ flowchart TD
| [`client-resources`](../packages/client/resources) | `client` | — |
| [`client-shortcuts`](../packages/client/shortcuts) | `client` | — |
| [`client-store`](../packages/client/store) | `client` | — |
| [`client-ui-account-notifications`](../packages/client/ui-account-notifications) | `client` | — |
| [`client-ui-agent-preset`](../packages/client/ui-agent-preset) | `client` | — |
| [`client-ui-agent-team`](../packages/client/ui-agent-team) | `client` | — |
| [`client-ui-approval`](../packages/client/ui-approval) | `client` | — |
@@ -1591,6 +1593,7 @@ flowchart TD
| [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — |
| [`client-ui-chat`](../packages/client/ui-chat) | `client` | — |
| [`client-ui-commands`](../packages/client/ui-commands) | `client` | — |
| [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — |
| [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — |
| [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — |
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
@@ -1604,7 +1607,6 @@ flowchart TD
| [`client-ui-input-trigger`](../packages/client/ui-input-trigger) | `client` | — |
| [`client-ui-jobs`](../packages/client/ui-jobs) | `client` | — |
| [`client-ui-layout`](../packages/client/ui-layout) | `client` | — |
| [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | `client` | — |
| [`client-ui-message-feedback`](../packages/client/ui-message-feedback) | `client` | — |
| [`client-ui-model-selection`](../packages/client/ui-model-selection) | `client` | — |
| [`client-ui-open-in-app`](../packages/client/ui-open-in-app) | `client` | — |
@@ -1678,6 +1680,7 @@ flowchart TD
| [`host-directory-picker-native`](../packages/host/directory-picker-native) | `host` | — |
| [`host-open-in-app`](../packages/host/open-in-app) | `host` | — |
| [`host-webserver`](../packages/host/webserver) | `host` | — |
| [`mcp-account`](../packages/mcp/mcp-account) | `mcp` | — |
| [`message-quotes`](../packages/session/message-quotes) | `session` | — |
| [`session-format`](../packages/session/session-format) | `session` | — |
| [`session-format-v0-to-v1`](../packages/session/session-format-v0-to-v1) | `session` | — |
@@ -1691,44 +1694,38 @@ flowchart TD
| [`typert-generator`](../packages/typert/generator) | `typert` | — |
| [`typert-protocol`](../packages/typert/protocol) | `typert` | — |
| [`typert-registry`](../packages/typert/registry) | `typert` | — |
| [`llm`](../packages/llm/llm) | `llm` | [`error`](../packages/util/error) |
| [`session`](../packages/core/session) | `core` | [`scope`](../packages/core/scope) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web`](../packages/web/web) | `web` | [`llm`](../packages/llm/llm) |
| [`api-remotes`](../packages/api/remotes) | `api` | [`scope`](../packages/core/scope) |
| [`attachment`](../packages/attachment/attachment) | `attachment` | [`brand`](../packages/util/brand) |
| [`app-boot`](../packages/boot/app-boot) | `boot` | [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
| [`browser-use`](../packages/browser-use/browser-use) | `browser-use` | [`brand`](../packages/util/brand) |
| [`client-connection`](../packages/client/connection) | `client` | [`scope`](../packages/core/scope) |
| [`computer-use`](../packages/computer-use/computer-use) | `computer-use` | [`brand`](../packages/util/brand) |
| [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) |
| [`credentials-local`](../packages/credentials/credentials-local) | `credentials` | [`atomic-write`](../packages/util/atomic-write), [`credentials`](../packages/credentials/credentials), [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
| [`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) |
| [`lsp`](../packages/lsp/lsp) | `lsp` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm) |
| [`storage-domain`](../packages/storage/storage-domain) | `storage` | [`storage`](../packages/storage/storage) |
| [`storage-json`](../packages/storage/storage-json) | `storage` | [`storage`](../packages/storage/storage) |
| [`storage-sqlite`](../packages/storage/storage-sqlite) | `storage` | [`storage`](../packages/storage/storage) |
| [`subprocess`](../packages/subprocess/subprocess) | `subprocess` | [`http-proxy`](../packages/util/http-proxy) |
| [`remote-mock`](../packages/test-support/remote-mock) | `test-support` | [`typert-protocol`](../packages/typert/protocol) |
| [`typert-loader`](../packages/typert/loader) | `typert` | [`typert-registry`](../packages/typert/registry) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web`](../packages/web/web) | `web` | [`llm`](../packages/llm/llm) |
| [`spill`](../packages/spill/spill) | `spill` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`api-terminal-controller`](../packages/api/terminal-controller) | `api` | [`subprocess`](../packages/subprocess/subprocess) |
| [`attachment-local`](../packages/attachment/attachment-local) | `attachment` | [`attachment`](../packages/attachment/attachment), [`home-paths`](../packages/util/home-paths) |
| [`hmr`](../packages/boot/hmr) | `boot` | [`app-boot`](../packages/boot/app-boot), [`cmdline`](../packages/boot/cmdline) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) |
| [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) |
| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`subprocess`](../packages/subprocess/subprocess) |
| [`experimental-webworker-runtime`](../packages/experimental/webworker-runtime) | `experimental` | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`host-webserver`](../packages/host/webserver) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-directory-picker-auto`](../packages/host/directory-picker-auto) | `host` | [`client-connection`](../packages/client/connection), [`client-ui-directory-picker-browse`](../packages/client/ui-directory-picker-browse), [`client-ui-directory-picker-native`](../packages/client/ui-directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse), [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-webserver`](../packages/host/webserver) |
| [`host-frontend-static`](../packages/host/frontend-static) | `host` | [`client-connection`](../packages/client/connection), [`host-webserver`](../packages/host/webserver) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`lsp`](../packages/lsp/lsp) | `lsp` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm) |
| [`sandbox`](../packages/sandbox/sandbox) | `sandbox` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
| [`session-format-catalog`](../packages/session/session-format-catalog) | `session` | [`session`](../packages/core/session) |
| [`session-log-deepseek`](../packages/session/session-log-deepseek) | `session` | [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions), [`session`](../packages/core/session) |
| [`session-persistence`](../packages/session/session-persistence) | `session` | [`brand`](../packages/util/brand), [`session`](../packages/core/session), [`timeout`](../packages/util/timeout) |
@@ -1738,14 +1735,21 @@ flowchart TD
| [`otel`](../packages/telemetry/otel) | `telemetry` | [`session`](../packages/core/session) |
| [`session-snapshot`](../packages/test-support/session-snapshot) | `test-support` | [`http-proxy`](../packages/util/http-proxy), [`session`](../packages/core/session) |
| [`fs`](../packages/fs/fs) | `fs` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`spill-local`](../packages/spill/spill-local) | `spill` | [`spill`](../packages/spill/spill) |
| [`session-log-export`](../packages/session-query/session-log-export) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`config-editor`](../packages/boot/config-editor) | `boot` | [`app-boot`](../packages/boot/app-boot), [`hmr`](../packages/boot/hmr) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-speech-to-text`](../packages/experimental/speech-to-text) | `experimental` | [`settings`](../packages/settings/settings) |
| [`experimental-translator`](../packages/experimental/translator) | `experimental` | [`credentials`](../packages/credentials/credentials), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel) | `host` | [`otel`](../packages/telemetry/otel) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime) | `ptc-runtime` | [`sandbox`](../packages/sandbox/sandbox) |
| [`sandbox-local`](../packages/sandbox/sandbox-local) | `sandbox` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
| [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl) | `session` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`session-projection-cache`](../packages/session/session-projection-cache) | `session` | [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`storage-domain`](../packages/storage/storage-domain) |
| [`session-stats`](../packages/session/session-stats) | `session` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
@@ -1774,16 +1778,16 @@ flowchart TD
| [`harness-dev-context`](../packages/context/harness-dev-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`time-context`](../packages/context/time-context) | `context` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`util-time`](../packages/util/time) |
| [`tmux-context`](../packages/context/tmux-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell) |
| [`deepseek-account`](../packages/credentials/deepseek-account) | `credentials` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`util-values`](../packages/util/values) |
| [`deepseek-account`](../packages/credentials/deepseek-account) | `credentials` | [`agent`](../packages/core/agent), [`authorization`](../packages/credentials/authorization), [`brand`](../packages/util/brand), [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`llm`](../packages/llm/llm), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
| [`commands`](../packages/interaction/commands) | `interaction` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`typert-protocol`](../packages/typert/protocol) |
| [`user-approval`](../packages/interaction/user-approval) | `interaction` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`user-questions`](../packages/interaction/user-questions) | `interaction` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`typert-protocol`](../packages/typert/protocol) |
| [`jobs`](../packages/jobs/jobs) | `jobs` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`session`](../packages/core/session), [`workspace`](../packages/workspace/workspace) |
| [`jobs`](../packages/jobs/jobs) | `jobs` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`error`](../packages/util/error), [`session`](../packages/core/session), [`workspace`](../packages/workspace/workspace) |
| [`sandbox-policy`](../packages/sandbox/sandbox-policy) | `sandbox` | [`agent`](../packages/core/agent), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`session-telemetry`](../packages/session/session-telemetry) | `session` | [`agent`](../packages/core/agent), [`session`](../packages/core/session) |
| [`session-title`](../packages/session/session-title) | `session` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
| [`working-directory`](../packages/session/working-directory) | `session` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`terminal`](../packages/terminal/terminal) | `terminal` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand) |
| [`terminal`](../packages/terminal/terminal) | `terminal` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`error`](../packages/util/error) |
| [`loader-smoke`](../packages/test-support/loader-smoke) | `test-support` | [`agent`](../packages/core/agent), [`http-proxy`](../packages/util/http-proxy), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`workflow`](../packages/workflow/workflow) | `workflow` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | `llm` | [`deepseek-account`](../packages/credentials/deepseek-account), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`llm-deepseek`](../packages/llm/llm-deepseek) |
@@ -1791,9 +1795,7 @@ flowchart TD
| [`command-goal`](../packages/goal/command-goal) | `goal` | [`commands`](../packages/interaction/commands), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm) |
| [`fs-sandbox`](../packages/fs/fs-sandbox) | `fs` | [`fs`](../packages/fs/fs), [`fs-local`](../packages/fs/fs-local), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy) |
| [`web-search-deepseek`](../packages/web/web-search-deepseek) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/credentials/deepseek-account), [`launch-environment`](../packages/util/launch-environment), [`llm-deepseek`](../packages/llm/llm-deepseek), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`api-account-controller`](../packages/api/account-controller) | `api` | [`agent`](../packages/core/agent), [`deepseek-account`](../packages/credentials/deepseek-account), [`typert-protocol`](../packages/typert/protocol) |
| [`compaction`](../packages/compaction/compaction) | `compaction` | [`brand`](../packages/util/brand), [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) | `credentials` | [`authorization`](../packages/credentials/authorization), [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/credentials/deepseek-account), [`host-webserver`](../packages/host/webserver) |
| [`experimental-ptc-runtime-python`](../packages/experimental/ptc-runtime-python) | `experimental` | [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`command-feedback`](../packages/feedback/command-feedback) | `feedback` | [`anonymous-user-id`](../packages/identity/anonymous-user-id), [`commands`](../packages/interaction/commands), [`session`](../packages/core/session), [`typert-protocol`](../packages/typert/protocol) |
| [`permission-presets`](../packages/interaction/permission-presets) | `interaction` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
+51 -49
View File
@@ -14,6 +14,7 @@ flowchart TD
pkg_brand["brand"]
pkg_chunked_list["chunked-list"]
pkg_deque["deque"]
pkg_error["error"]
pkg_home_paths["home-paths"]
pkg_http_proxy["http-proxy"]
pkg_launch_environment["launch-environment"]
@@ -116,7 +117,6 @@ flowchart TD
pkg_acp["acp"]
end
subgraph group_api["packages/api"]
pkg_api_account_controller["api-account-controller"]
pkg_api_gateway["api-gateway"]
pkg_api_job_controller["api-job-controller"]
pkg_api_remote_access["api-remote-access"]
@@ -160,6 +160,7 @@ flowchart TD
pkg_client_resources["client-resources"]
pkg_client_shortcuts["client-shortcuts"]
pkg_client_store["client-store"]
pkg_client_ui_account_notifications["client-ui-account-notifications"]
pkg_client_ui_agent_preset["client-ui-agent-preset"]
pkg_client_ui_agent_team["client-ui-agent-team"]
pkg_client_ui_approval["client-ui-approval"]
@@ -167,6 +168,7 @@ flowchart TD
pkg_client_ui_brand_official["client-ui-brand-official"]
pkg_client_ui_chat["client-ui-chat"]
pkg_client_ui_commands["client-ui-commands"]
pkg_client_ui_connector_account["client-ui-connector-account"]
pkg_client_ui_context_menu["client-ui-context-menu"]
pkg_client_ui_conversation["client-ui-conversation"]
pkg_client_ui_deliverables["client-ui-deliverables"]
@@ -180,7 +182,6 @@ flowchart TD
pkg_client_ui_input_trigger["client-ui-input-trigger"]
pkg_client_ui_jobs["client-ui-jobs"]
pkg_client_ui_layout["client-ui-layout"]
pkg_client_ui_mcp_account["client-ui-mcp-account"]
pkg_client_ui_message_feedback["client-ui-message-feedback"]
pkg_client_ui_model_selection["client-ui-model-selection"]
pkg_client_ui_open_in_app["client-ui-open-in-app"]
@@ -247,7 +248,6 @@ flowchart TD
pkg_credentials["credentials"]
pkg_credentials_local["credentials-local"]
pkg_deepseek_account["deepseek-account"]
pkg_deepseek_account_platform["deepseek-account-platform"]
end
subgraph group_deliverables["packages/deliverables"]
pkg_deliverable_file_references["deliverable-file-references"]
@@ -368,6 +368,7 @@ flowchart TD
pkg_tool_lsp["tool-lsp"]
end
subgraph group_mcp["packages/mcp"]
pkg_mcp_account["mcp-account"]
pkg_mcp_client["mcp-client"]
pkg_mcp_manager["mcp-manager"]
pkg_mcp_resources["mcp-resources"]
@@ -488,12 +489,8 @@ flowchart TD
subgraph group_workspace["packages/workspace"]
pkg_workspace["workspace"]
end
pkg_llm --> pkg_error
pkg_session --> pkg_scope
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
pkg_web --> pkg_llm
pkg_api_remotes --> pkg_scope
pkg_attachment --> pkg_brand
pkg_app_boot --> pkg_home_paths
@@ -501,8 +498,6 @@ flowchart TD
pkg_browser_use --> pkg_brand
pkg_client_connection --> pkg_scope
pkg_computer_use --> pkg_brand
pkg_authorization --> pkg_credentials
pkg_authorization --> pkg_llm
pkg_credentials_local --> pkg_atomic_write
pkg_credentials_local --> pkg_credentials
pkg_credentials_local --> pkg_home_paths
@@ -510,17 +505,17 @@ flowchart TD
pkg_experimental_liveshare --> pkg_scope
pkg_anonymous_user_id --> pkg_brand
pkg_anonymous_user_id --> pkg_home_paths
pkg_lsp --> pkg_brand
pkg_lsp --> pkg_llm
pkg_storage_domain --> pkg_storage
pkg_storage_json --> pkg_storage
pkg_storage_sqlite --> pkg_storage
pkg_subprocess --> pkg_http_proxy
pkg_remote_mock --> pkg_typert_protocol
pkg_typert_loader --> pkg_typert_registry
pkg_skill_office --> pkg_skill
pkg_web_fetch_http --> pkg_timeout
pkg_web_fetch_http --> pkg_web
pkg_system_prompt --> pkg_llm
pkg_system_prompt --> pkg_scope
pkg_skill --> pkg_llm
pkg_skill --> pkg_scope
pkg_web --> pkg_llm
pkg_spill --> pkg_brand
pkg_spill --> pkg_llm
pkg_spill --> pkg_session
@@ -529,17 +524,14 @@ flowchart TD
pkg_attachment_local --> pkg_home_paths
pkg_hmr --> pkg_app_boot
pkg_hmr --> pkg_cmdline
pkg_deliverable_file_references --> pkg_system_prompt
pkg_authorization --> pkg_credentials
pkg_authorization --> pkg_llm
pkg_experimental_computer_use_cua_driver_mcp --> pkg_computer_use
pkg_experimental_forge_github --> pkg_experimental_forge
pkg_experimental_forge_github --> pkg_subprocess
pkg_experimental_webworker_runtime --> pkg_client_connection
pkg_experimental_webworker_runtime --> pkg_client_modules
pkg_experimental_webworker_runtime --> pkg_host_webserver
pkg_plugin_recommendations --> pkg_llm
pkg_plugin_recommendations --> pkg_skill
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_directory_picker_auto --> pkg_client_connection
pkg_host_directory_picker_auto --> pkg_client_ui_directory_picker_browse
pkg_host_directory_picker_auto --> pkg_client_ui_directory_picker_native
@@ -548,11 +540,10 @@ flowchart TD
pkg_host_directory_picker_auto --> pkg_host_webserver
pkg_host_frontend_static --> pkg_client_connection
pkg_host_frontend_static --> pkg_host_webserver
pkg_persona --> pkg_system_prompt
pkg_lsp --> pkg_brand
pkg_lsp --> pkg_llm
pkg_sandbox --> pkg_llm
pkg_sandbox --> pkg_session
pkg_sandbox_windows_acl --> pkg_skill
pkg_sandbox_windows_acl --> pkg_subprocess
pkg_session_format_catalog --> pkg_session
pkg_session_log_deepseek --> pkg_deepseek_llm_api_extensions
pkg_session_log_deepseek --> pkg_session
@@ -570,11 +561,15 @@ flowchart TD
pkg_fs --> pkg_brand
pkg_fs --> pkg_llm
pkg_fs --> pkg_sandbox
pkg_skill_office --> pkg_skill
pkg_web_fetch_http --> pkg_timeout
pkg_web_fetch_http --> pkg_web
pkg_spill_local --> pkg_spill
pkg_session_log_export --> pkg_session
pkg_session_log_export --> pkg_session_persistence
pkg_config_editor --> pkg_app_boot
pkg_config_editor --> pkg_hmr
pkg_deliverable_file_references --> pkg_system_prompt
pkg_experimental_speech_to_text --> pkg_settings
pkg_experimental_translator --> pkg_credentials
pkg_experimental_translator --> pkg_launch_environment
@@ -583,11 +578,18 @@ flowchart TD
pkg_experimental_translator --> pkg_session_persistence
pkg_experimental_translator --> pkg_timeout
pkg_experimental_translator --> pkg_util_values
pkg_plugin_recommendations --> pkg_llm
pkg_plugin_recommendations --> pkg_skill
pkg_plugin_recommendations --> pkg_typert_protocol
pkg_skill_badge --> pkg_skill
pkg_host_product_telemetry_otel --> pkg_otel
pkg_persona --> pkg_system_prompt
pkg_ptc_runtime --> pkg_sandbox
pkg_sandbox_local --> pkg_llm
pkg_sandbox_local --> pkg_sandbox
pkg_sandbox_local --> pkg_session
pkg_sandbox_windows_acl --> pkg_skill
pkg_sandbox_windows_acl --> pkg_subprocess
pkg_session_persistence_jsonl --> pkg_session
pkg_session_persistence_jsonl --> pkg_session_persistence
pkg_session_projection_cache --> pkg_session
@@ -695,8 +697,12 @@ flowchart TD
pkg_tmux_context --> pkg_session_projection
pkg_tmux_context --> pkg_shell
pkg_deepseek_account --> pkg_agent
pkg_deepseek_account --> pkg_authorization
pkg_deepseek_account --> pkg_brand
pkg_deepseek_account --> pkg_credentials
pkg_deepseek_account --> pkg_host_webserver
pkg_deepseek_account --> pkg_llm
pkg_deepseek_account --> pkg_typert_protocol
pkg_deepseek_account --> pkg_util_values
pkg_commands --> pkg_agent
pkg_commands --> pkg_attachment
@@ -720,6 +726,7 @@ flowchart TD
pkg_user_questions --> pkg_typert_protocol
pkg_jobs --> pkg_agent
pkg_jobs --> pkg_brand
pkg_jobs --> pkg_error
pkg_jobs --> pkg_session
pkg_jobs --> pkg_workspace
pkg_sandbox_policy --> pkg_agent
@@ -742,6 +749,7 @@ flowchart TD
pkg_working_directory --> pkg_system_prompt
pkg_terminal --> pkg_agent
pkg_terminal --> pkg_brand
pkg_terminal --> pkg_error
pkg_loader_smoke --> pkg_agent
pkg_loader_smoke --> pkg_http_proxy
pkg_loader_smoke --> pkg_llm
@@ -774,17 +782,10 @@ flowchart TD
pkg_web_search_deepseek --> pkg_llm_deepseek
pkg_web_search_deepseek --> pkg_session
pkg_web_search_deepseek --> pkg_web
pkg_api_account_controller --> pkg_agent
pkg_api_account_controller --> pkg_deepseek_account
pkg_api_account_controller --> pkg_typert_protocol
pkg_compaction --> pkg_brand
pkg_compaction --> pkg_commands
pkg_compaction --> pkg_llm
pkg_compaction --> pkg_session
pkg_deepseek_account_platform --> pkg_authorization
pkg_deepseek_account_platform --> pkg_credentials
pkg_deepseek_account_platform --> pkg_deepseek_account
pkg_deepseek_account_platform --> pkg_host_webserver
pkg_experimental_ptc_runtime_python --> pkg_ptc_runtime
pkg_experimental_ptc_runtime_python --> pkg_sandbox
pkg_experimental_ptc_runtime_python --> pkg_sandbox_policy
@@ -1548,6 +1549,7 @@ flowchart TD
| [`brand`](../packages/util/brand) | `util` | — |
| [`chunked-list`](../packages/util/chunked-list) | `util` | — |
| [`deque`](../packages/util/deque) | `util` | — |
| [`error`](../packages/util/error) | `util` | — |
| [`home-paths`](../packages/util/home-paths) | `util` | — |
| [`http-proxy`](../packages/util/http-proxy) | `util` | — |
| [`launch-environment`](../packages/util/launch-environment) | `util` | — |
@@ -1566,7 +1568,6 @@ flowchart TD
| [`util-values`](../packages/util/values) | `util` | — |
| [`util-workspace-path`](../packages/util/workspace-path) | `util` | — |
| [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | `llm` | — |
| [`llm`](../packages/llm/llm) | `llm` | — |
| [`scope`](../packages/core/scope) | `core` | — |
| [`fs-patch`](../packages/fs/fs-patch) | `fs` | — |
| [`api-gateway`](../packages/api/gateway) | `api` | — |
@@ -1586,6 +1587,7 @@ flowchart TD
| [`client-resources`](../packages/client/resources) | `client` | — |
| [`client-shortcuts`](../packages/client/shortcuts) | `client` | — |
| [`client-store`](../packages/client/store) | `client` | — |
| [`client-ui-account-notifications`](../packages/client/ui-account-notifications) | `client` | — |
| [`client-ui-agent-preset`](../packages/client/ui-agent-preset) | `client` | — |
| [`client-ui-agent-team`](../packages/client/ui-agent-team) | `client` | — |
| [`client-ui-approval`](../packages/client/ui-approval) | `client` | — |
@@ -1593,6 +1595,7 @@ flowchart TD
| [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — |
| [`client-ui-chat`](../packages/client/ui-chat) | `client` | — |
| [`client-ui-commands`](../packages/client/ui-commands) | `client` | — |
| [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — |
| [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — |
| [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — |
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
@@ -1606,7 +1609,6 @@ flowchart TD
| [`client-ui-input-trigger`](../packages/client/ui-input-trigger) | `client` | — |
| [`client-ui-jobs`](../packages/client/ui-jobs) | `client` | — |
| [`client-ui-layout`](../packages/client/ui-layout) | `client` | — |
| [`client-ui-mcp-account`](../packages/client/ui-mcp-account) | `client` | — |
| [`client-ui-message-feedback`](../packages/client/ui-message-feedback) | `client` | — |
| [`client-ui-model-selection`](../packages/client/ui-model-selection) | `client` | — |
| [`client-ui-open-in-app`](../packages/client/ui-open-in-app) | `client` | — |
@@ -1680,6 +1682,7 @@ flowchart TD
| [`host-directory-picker-native`](../packages/host/directory-picker-native) | `host` | — |
| [`host-open-in-app`](../packages/host/open-in-app) | `host` | — |
| [`host-webserver`](../packages/host/webserver) | `host` | — |
| [`mcp-account`](../packages/mcp/mcp-account) | `mcp` | — |
| [`message-quotes`](../packages/session/message-quotes) | `session` | — |
| [`session-format`](../packages/session/session-format) | `session` | — |
| [`session-format-v0-to-v1`](../packages/session/session-format-v0-to-v1) | `session` | — |
@@ -1693,44 +1696,38 @@ flowchart TD
| [`typert-generator`](../packages/typert/generator) | `typert` | — |
| [`typert-protocol`](../packages/typert/protocol) | `typert` | — |
| [`typert-registry`](../packages/typert/registry) | `typert` | — |
| [`llm`](../packages/llm/llm) | `llm` | [`error`](../packages/util/error) |
| [`session`](../packages/core/session) | `core` | [`scope`](../packages/core/scope) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web`](../packages/web/web) | `web` | [`llm`](../packages/llm/llm) |
| [`api-remotes`](../packages/api/remotes) | `api` | [`scope`](../packages/core/scope) |
| [`attachment`](../packages/attachment/attachment) | `attachment` | [`brand`](../packages/util/brand) |
| [`app-boot`](../packages/boot/app-boot) | `boot` | [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
| [`browser-use`](../packages/browser-use/browser-use) | `browser-use` | [`brand`](../packages/util/brand) |
| [`client-connection`](../packages/client/connection) | `client` | [`scope`](../packages/core/scope) |
| [`computer-use`](../packages/computer-use/computer-use) | `computer-use` | [`brand`](../packages/util/brand) |
| [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) |
| [`credentials-local`](../packages/credentials/credentials-local) | `credentials` | [`atomic-write`](../packages/util/atomic-write), [`credentials`](../packages/credentials/credentials), [`home-paths`](../packages/util/home-paths), [`launch-environment`](../packages/util/launch-environment) |
| [`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) |
| [`lsp`](../packages/lsp/lsp) | `lsp` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm) |
| [`storage-domain`](../packages/storage/storage-domain) | `storage` | [`storage`](../packages/storage/storage) |
| [`storage-json`](../packages/storage/storage-json) | `storage` | [`storage`](../packages/storage/storage) |
| [`storage-sqlite`](../packages/storage/storage-sqlite) | `storage` | [`storage`](../packages/storage/storage) |
| [`subprocess`](../packages/subprocess/subprocess) | `subprocess` | [`http-proxy`](../packages/util/http-proxy) |
| [`remote-mock`](../packages/test-support/remote-mock) | `test-support` | [`typert-protocol`](../packages/typert/protocol) |
| [`typert-loader`](../packages/typert/loader) | `typert` | [`typert-registry`](../packages/typert/registry) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`system-prompt`](../packages/core/system-prompt) | `core` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`skill`](../packages/skill/skill) | `skill` | [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope) |
| [`web`](../packages/web/web) | `web` | [`llm`](../packages/llm/llm) |
| [`spill`](../packages/spill/spill) | `spill` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`api-terminal-controller`](../packages/api/terminal-controller) | `api` | [`subprocess`](../packages/subprocess/subprocess) |
| [`attachment-local`](../packages/attachment/attachment-local) | `attachment` | [`attachment`](../packages/attachment/attachment), [`home-paths`](../packages/util/home-paths) |
| [`hmr`](../packages/boot/hmr) | `boot` | [`app-boot`](../packages/boot/app-boot), [`cmdline`](../packages/boot/cmdline) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`authorization`](../packages/credentials/authorization) | `credentials` | [`credentials`](../packages/credentials/credentials), [`llm`](../packages/llm/llm) |
| [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp) | `experimental` | [`computer-use`](../packages/computer-use/computer-use) |
| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`subprocess`](../packages/subprocess/subprocess) |
| [`experimental-webworker-runtime`](../packages/experimental/webworker-runtime) | `experimental` | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`host-webserver`](../packages/host/webserver) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-directory-picker-auto`](../packages/host/directory-picker-auto) | `host` | [`client-connection`](../packages/client/connection), [`client-ui-directory-picker-browse`](../packages/client/ui-directory-picker-browse), [`client-ui-directory-picker-native`](../packages/client/ui-directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse), [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-webserver`](../packages/host/webserver) |
| [`host-frontend-static`](../packages/host/frontend-static) | `host` | [`client-connection`](../packages/client/connection), [`host-webserver`](../packages/host/webserver) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`lsp`](../packages/lsp/lsp) | `lsp` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm) |
| [`sandbox`](../packages/sandbox/sandbox) | `sandbox` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
| [`session-format-catalog`](../packages/session/session-format-catalog) | `session` | [`session`](../packages/core/session) |
| [`session-log-deepseek`](../packages/session/session-log-deepseek) | `session` | [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions), [`session`](../packages/core/session) |
| [`session-persistence`](../packages/session/session-persistence) | `session` | [`brand`](../packages/util/brand), [`session`](../packages/core/session), [`timeout`](../packages/util/timeout) |
@@ -1740,14 +1737,21 @@ flowchart TD
| [`otel`](../packages/telemetry/otel) | `telemetry` | [`session`](../packages/core/session) |
| [`session-snapshot`](../packages/test-support/session-snapshot) | `test-support` | [`http-proxy`](../packages/util/http-proxy), [`session`](../packages/core/session) |
| [`fs`](../packages/fs/fs) | `fs` | [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox) |
| [`skill-office`](../packages/skill/skill-office) | `skill` | [`skill`](../packages/skill/skill) |
| [`web-fetch-http`](../packages/web/web-fetch-http) | `web` | [`timeout`](../packages/util/timeout), [`web`](../packages/web/web) |
| [`spill-local`](../packages/spill/spill-local) | `spill` | [`spill`](../packages/spill/spill) |
| [`session-log-export`](../packages/session-query/session-log-export) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`config-editor`](../packages/boot/config-editor) | `boot` | [`app-boot`](../packages/boot/app-boot), [`hmr`](../packages/boot/hmr) |
| [`deliverable-file-references`](../packages/deliverables/deliverable-file-references) | `deliverables` | [`system-prompt`](../packages/core/system-prompt) |
| [`experimental-speech-to-text`](../packages/experimental/speech-to-text) | `experimental` | [`settings`](../packages/settings/settings) |
| [`experimental-translator`](../packages/experimental/translator) | `experimental` | [`credentials`](../packages/credentials/credentials), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`plugin-recommendations`](../packages/experimental/plugin-recommendations) | `experimental` | [`llm`](../packages/llm/llm), [`skill`](../packages/skill/skill), [`typert-protocol`](../packages/typert/protocol) |
| [`skill-badge`](../packages/experimental/skill-badge) | `experimental` | [`skill`](../packages/skill/skill) |
| [`host-product-telemetry-otel`](../packages/host/product-telemetry-otel) | `host` | [`otel`](../packages/telemetry/otel) |
| [`persona`](../packages/preset/persona) | `preset` | [`system-prompt`](../packages/core/system-prompt) |
| [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime) | `ptc-runtime` | [`sandbox`](../packages/sandbox/sandbox) |
| [`sandbox-local`](../packages/sandbox/sandbox-local) | `sandbox` | [`llm`](../packages/llm/llm), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session) |
| [`sandbox-windows-acl`](../packages/sandbox/sandbox-windows-acl) | `sandbox` | [`skill`](../packages/skill/skill), [`subprocess`](../packages/subprocess/subprocess) |
| [`session-persistence-jsonl`](../packages/session/session-persistence-jsonl) | `session` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence) |
| [`session-projection-cache`](../packages/session/session-projection-cache) | `session` | [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`storage-domain`](../packages/storage/storage-domain) |
| [`session-stats`](../packages/session/session-stats) | `session` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
@@ -1776,16 +1780,16 @@ flowchart TD
| [`harness-dev-context`](../packages/context/harness-dev-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`time-context`](../packages/context/time-context) | `context` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`util-time`](../packages/util/time) |
| [`tmux-context`](../packages/context/tmux-context) | `context` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell) |
| [`deepseek-account`](../packages/credentials/deepseek-account) | `credentials` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`util-values`](../packages/util/values) |
| [`deepseek-account`](../packages/credentials/deepseek-account) | `credentials` | [`agent`](../packages/core/agent), [`authorization`](../packages/credentials/authorization), [`brand`](../packages/util/brand), [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`llm`](../packages/llm/llm), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) |
| [`commands`](../packages/interaction/commands) | `interaction` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`typert-protocol`](../packages/typert/protocol) |
| [`user-approval`](../packages/interaction/user-approval) | `interaction` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`user-questions`](../packages/interaction/user-questions) | `interaction` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`typert-protocol`](../packages/typert/protocol) |
| [`jobs`](../packages/jobs/jobs) | `jobs` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`session`](../packages/core/session), [`workspace`](../packages/workspace/workspace) |
| [`jobs`](../packages/jobs/jobs) | `jobs` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`error`](../packages/util/error), [`session`](../packages/core/session), [`workspace`](../packages/workspace/workspace) |
| [`sandbox-policy`](../packages/sandbox/sandbox-policy) | `sandbox` | [`agent`](../packages/core/agent), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`session-telemetry`](../packages/session/session-telemetry) | `session` | [`agent`](../packages/core/agent), [`session`](../packages/core/session) |
| [`session-title`](../packages/session/session-title) | `session` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection) |
| [`working-directory`](../packages/session/working-directory) | `session` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`system-prompt`](../packages/core/system-prompt) |
| [`terminal`](../packages/terminal/terminal) | `terminal` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand) |
| [`terminal`](../packages/terminal/terminal) | `terminal` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`error`](../packages/util/error) |
| [`loader-smoke`](../packages/test-support/loader-smoke) | `test-support` | [`agent`](../packages/core/agent), [`http-proxy`](../packages/util/http-proxy), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`workflow`](../packages/workflow/workflow) | `workflow` | [`agent`](../packages/core/agent), [`brand`](../packages/util/brand), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | `llm` | [`deepseek-account`](../packages/credentials/deepseek-account), [`launch-environment`](../packages/util/launch-environment), [`llm`](../packages/llm/llm), [`llm-deepseek`](../packages/llm/llm-deepseek) |
@@ -1793,9 +1797,7 @@ flowchart TD
| [`command-goal`](../packages/goal/command-goal) | `goal` | [`commands`](../packages/interaction/commands), [`goal`](../packages/goal/goal), [`llm`](../packages/llm/llm) |
| [`fs-sandbox`](../packages/fs/fs-sandbox) | `fs` | [`fs`](../packages/fs/fs), [`fs-local`](../packages/fs/fs-local), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy) |
| [`web-search-deepseek`](../packages/web/web-search-deepseek) | `web` | [`agent`](../packages/core/agent), [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/credentials/deepseek-account), [`launch-environment`](../packages/util/launch-environment), [`llm-deepseek`](../packages/llm/llm-deepseek), [`session`](../packages/core/session), [`web`](../packages/web/web) |
| [`api-account-controller`](../packages/api/account-controller) | `api` | [`agent`](../packages/core/agent), [`deepseek-account`](../packages/credentials/deepseek-account), [`typert-protocol`](../packages/typert/protocol) |
| [`compaction`](../packages/compaction/compaction) | `compaction` | [`brand`](../packages/util/brand), [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session) |
| [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) | `credentials` | [`authorization`](../packages/credentials/authorization), [`credentials`](../packages/credentials/credentials), [`deepseek-account`](../packages/credentials/deepseek-account), [`host-webserver`](../packages/host/webserver) |
| [`experimental-ptc-runtime-python`](../packages/experimental/ptc-runtime-python) | `experimental` | [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`timeout`](../packages/util/timeout), [`util-values`](../packages/util/values) |
| [`command-feedback`](../packages/feedback/command-feedback) | `feedback` | [`anonymous-user-id`](../packages/identity/anonymous-user-id), [`commands`](../packages/interaction/commands), [`session`](../packages/core/session), [`typert-protocol`](../packages/typert/protocol) |
| [`permission-presets`](../packages/interaction/permission-presets) | `interaction` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`shell`](../packages/shell/shell), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
+2 -2
View File
@@ -1308,8 +1308,8 @@
en: 0080c345c319a4b5
zh: de1a8b3ed621ce21
/session-persistence-event-catalog/resolved-persistence-types/toolrestriction:
en: d70be5d46cb1ef7d
zh: d3d5a05d62e443fe
en: b2488366535b5fdc
zh: b64d50345521eb99
/session-persistence-event-catalog/resolved-persistence-types/toolresultmessage:
en: 2258683c3cfa4ce3
zh: 5663aa76c911761b
Loaded 100 of 811 files, more files were not shown because too many files have changed in this diff. Show more