Merge master into feat/action-cards-without-tool
This commit is contained in:
commit
5e8d723c43
822 files changed
+21650
-5355
No files matched your search
+8
-8
@@ -18,23 +18,23 @@
|
||||
en: 5f5daec51b20db77
|
||||
zh: e4d6f78fc1b4b835
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/combo-external-script-arrival-and-source-maps:
|
||||
en: 0a4240d88cca240a
|
||||
zh: 8f5f1527caf571cd
|
||||
en: 04b9f0138b5d2288
|
||||
zh: 2a749db57f6e7a10
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/the-loading-flow-end-to-end:
|
||||
en: 1f7db6ecfc0b0831
|
||||
zh: f6bf37dc921a7d40
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/live-graph-reconciliation:
|
||||
en: ab9577214d7b2f2b
|
||||
zh: fc8f10fd8c90b34b
|
||||
en: d7777566a2594654
|
||||
zh: 509cad4a363184ae
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/hot-reload-one-driver-plugin-self-watched-bundles:
|
||||
en: e6a0bee3d31cd2c6
|
||||
zh: 7f7384c5d1a74751
|
||||
en: d31506b6ccca554e
|
||||
zh: 91f4eb62927ebabe
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/package-ownership:
|
||||
en: 94ca0d09e6fd1e3a
|
||||
zh: d5949a2bdec795ba
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/consequences:
|
||||
en: 624efdd136029771
|
||||
zh: 7d60207147e631fe
|
||||
en: cfeb5dc97753e46f
|
||||
zh: 92da07a598f7cfb0
|
||||
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/alternatives-considered:
|
||||
en: b8f036f50cff7cd8
|
||||
zh: 6d623c4a1f4314b1
|
||||
@@ -46,7 +46,7 @@ A `require.async("./client.<name>.js")` call requests the exact revisioned `/plu
|
||||
|
||||
The shared tsdown preset emits a map for every plugin entry and chunk and rewrites first-party source paths into the browser-resolvable repository form `/packages/<group>/<package>/src/...`. The production Client pass consumes `lib/types`; the preset supplies each tsc map to Rolldown and fills `sourcesContent` from the original files, so the final map reaches TypeScript/TSX instead of stopping at emitted JavaScript. Other workspace sources inlined into a bundle likewise resolve to their `packages/` owner, while dependency paths remain unchanged. Combo generation strips each local debug directive, records its generated-line offset, resolves every authored source against the original per-plugin map URL, and emits an Indexed Source Map v3. An authored map supplies its section; otherwise an identity section embeds the generated bundle and uses the packer's `sourceURL` as its source name when present. The absolute combo map URL mirrors the script resource list by changing every `client.js` suffix to `client.js.map`, so `/plugins/??<package-a>/client.js,<package-b>/client.js&rev=<rev>` points to `/plugins/??<package-a>/client.js.map,<package-b>/client.js.map&rev=<rev>`. A chunk script likewise points to its own map URL. Source-map files are read and combined only when those map URLs receive `GET`; `HEAD` materializes neither script nor map bodies. The Vite shell also emits source maps, letting shell code and externally loaded plugins map stacks and performance profiles back to TypeScript/TSX.
|
||||
|
||||
The graph retains each row's revisioned one-resource combo URL for HMR and adds a revisioned descriptor for every startup combo request; several descriptors may carry the same scheduling phase. Initial publication and `rebuilt(id)` use the same hash of entry mtime, ctime, and size; artifact contents never enter the hash. Ctime distinguishes rewrites that preserve mtime and size. A Host restart over unchanged artifacts therefore retains every row revision, so the reconnecting SSE snapshot does not trigger browser plugin replacement. The shared preset stamps the entry after every package output is written; a chunk-only build therefore advances the owner revision without a Host-side sibling scan. Startup combo revisions derive from the ordered row revisions. Script bodies are assembled on their first `GET`; source-map files are read and combined separately on their first map `GET`. `HEAD` materializes neither body. Versioned scripts and maps use immutable caching, and unrelated graph recomposition retains already-materialized chunk responses at the same revision. The Host serves only exact generated URLs; stale revisions and unadvertised resource lists return 404 instead of aliasing different bytes. An external script's `error` event exposes neither response status nor body, so failure diagnostics name only the URL; the same-origin Host and build-stamped registration id form the identity boundary, while the post-`load` factory-presence check rejects an artifact that did not register the expected id.
|
||||
The graph retains each row's revisioned one-resource combo URL for HMR and adds a revisioned descriptor for every startup combo request; several descriptors may carry the same scheduling phase. Initial publication and `rebuilt(id)` use the same hash of entry mtime, ctime, and size; artifact contents never enter the hash. Ctime distinguishes rewrites that preserve mtime and size. A Host restart over unchanged artifacts therefore retains every row revision, so the reconnecting stream baseline does not trigger browser plugin replacement. The shared preset stamps the entry after every package output is written; a chunk-only build therefore advances the owner revision without a Host-side sibling scan. Startup combo revisions derive from the ordered row revisions. Script bodies are assembled on their first `GET`; source-map files are read and combined separately on their first map `GET`. `HEAD` materializes neither body. Versioned scripts and maps use immutable caching, and unrelated graph recomposition retains already-materialized chunk responses at the same revision. The Host serves only exact generated URLs; stale revisions and unadvertised resource lists return 404 instead of aliasing different bytes. An external script's `error` event exposes neither response status nor body, so failure diagnostics name only the URL; the same-origin Host and build-stamped registration id form the identity boundary, while the post-`load` factory-presence check rejects an artifact that did not register the expected id.
|
||||
|
||||
### The loading flow, end to end
|
||||
|
||||
@@ -76,13 +76,13 @@ Stylesheet metadata and renderer ownership follow the [module metadata decision]
|
||||
|
||||
The modules controller owns exactly the Loader entries created from the boot manifest. Full Host snapshots update its module descriptors and reconcile those entries; other Loader contributors retain ownership. New modules arrive through single-resource URLs because replaying a startup batch could register an existing factory twice. Removal uses Loader deletion, then drains the captured fiber before removing unused module records. Declared and observed transitive requests keep shared modules alive. Factory revision tracking is independent of entry activation because a download or materialization can finish without creating an entry. Graph updates invalidate stale factories and failed arrival targets without managed entries, notifying resource consumers before any consumer imports its dependencies; rebuilt frames also reconcile entries missing after import failures.
|
||||
|
||||
The Host SSE adapter forwards existing graph-change notifications and sends the current full graph on connection. The graph describes desired browser entries, not Host cleanup completion: Host lifecycle ordering belongs to its Loader, while each browser waits for its own removed fibers. Graph reconciliation and rebuilt code share one page-owned queue. Local generations prevent stale downloads from mounting; opaque revisions are compared only for equality. The settings inventory reports page-local errors and can retry the same graph without changing Host enablement. This preserves unrelated page state and avoids both an application restart and a second plugin executor. Electron's independent installation flow remains outside this mechanism.
|
||||
The Host `pluginEvents/follow` Remote stream forwards existing graph-change notifications and opens every generation with the current full graph; graph rows also carry each plugin's synced configuration ([browser plugin configuration sync](2026-11-15-client-config-sync.md)). The graph describes desired browser entries, not Host cleanup completion: Host lifecycle ordering belongs to its Loader, while each browser waits for its own removed fibers. Graph reconciliation and rebuilt code share one page-owned queue. Local generations prevent stale downloads from mounting; opaque revisions are compared only for equality. The settings inventory reports page-local errors and can retry the same graph without changing Host enablement. This preserves unrelated page state and avoids both an application restart and a second plugin executor. Electron's independent installation flow remains outside this mechanism.
|
||||
|
||||
### Hot reload: one driver plugin, self-watched bundles
|
||||
|
||||
Hot reload is a composition decision: the web bundle mounts the `client-hmr` row (a normal plugin package) unconditionally; its node half brings the bundle watch and the SSE channel, and the chain stays idle until a rebuild watcher rewrites client bundles. A composition that must not expose it disables the row.
|
||||
Hot reload is a composition decision: the web bundle mounts the `client-hmr` row (a normal plugin package) unconditionally; its node half brings the bundle watch and the authenticated plugin-events Remote stream, and the chain stays idle until a rebuild watcher rewrites client bundles. A composition that must not expose it disables the row.
|
||||
|
||||
How does a rebuilt bundle become a reload signal? The hmr node half observes it itself — no builder tells it. Before reading each startup snapshot, the module host captures the entry stat baseline and exposes it through `ctx.clientModules.artifactBaseline(id)`. One HMR-owned interval compares every current graph row with that baseline. An unchanged row starts watching without a content read or hash; a write after baseline capture is already a stat delta and only that row enters `rebuilt(id)`. This avoids redundant reads when installing the watcher and avoids `fs.watchFile`, whose asynchronous first baseline can silently absorb a construction-time rebuild. Watch membership follows `onGraphChanged`; vanished rows drop out, and an entry missing at poll time keeps its row dirty so reappearance retries publication even when mtime and size match the baseline. The shared tsdown preset stamps `client.js` after every sibling output has been written; on an entry mtime, ctime, or size delta, or a dirty row, `rebuilt(id)` derives the revision from those three metadata values. It reads the new bundle snapshot only if the revision changes. A chunk-only edit therefore changes the revision, and a partial write followed by the completion stamp supplies a later stat change that self-heals. When the `rev` changes, the node half broadcasts a `rebuilt` frame on `GET /plugins/events` — a system SSE channel that sends the full graph on connect and `rebuilt` frames on change, presentation-only wire that never enters the session log. Polling is deliberate because inotify does not fire on the weka network mount, the same reason the build-side watcher needs `--poll`; one entry stat per row and interval is sufficient, the interval is a validated config field (default 500ms), and disposal clears the one timer. Rebuilding artifacts is any process using the shared Client tsdown preset — `scripts/dev-web.ts` remains the watch-build entry point, discovering its package list through `dsh.client` while scanning `packages/*/*/package.json` at startup — and builder and host share no notification protocol.
|
||||
How does a rebuilt bundle become a reload signal? The hmr node half observes it itself — no builder tells it. Before reading each startup snapshot, the module host captures the entry stat baseline and exposes it through `ctx.clientModules.artifactBaseline(id)`. One HMR-owned interval compares every current graph row with that baseline. An unchanged row starts watching without a content read or hash; a write after baseline capture is already a stat delta and only that row enters `rebuilt(id)`. This avoids redundant reads when installing the watcher and avoids `fs.watchFile`, whose asynchronous first baseline can silently absorb a construction-time rebuild. Watch membership follows `onGraphChanged`; vanished rows drop out, and an entry missing at poll time keeps its row dirty so reappearance retries publication even when mtime and size match the baseline. The shared tsdown preset stamps `client.js` after every sibling output has been written; on an entry mtime, ctime, or size delta, or a dirty row, `rebuilt(id)` derives the revision from those three metadata values. It reads the new bundle snapshot only if the revision changes. A chunk-only edit therefore changes the revision, and a partial write followed by the completion stamp supplies a later stat change that self-heals. When the `rev` changes, the node half publishes a `rebuilt` frame on the authenticated `pluginEvents/follow` Remote stream, which opens every generation with the full graph and then sends `graph` and `rebuilt` increments; it is presentation-only wire that never enters the session log. Polling is deliberate because inotify does not fire on the weka network mount, the same reason the build-side watcher needs `--poll`; one entry stat per row and interval is sufficient, the interval is a validated config field (default 500ms), and disposal clears the one timer. Rebuilding artifacts is any process using the shared Client tsdown preset — `scripts/dev-web.ts` remains the watch-build entry point, discovering its package list through `dsh.client` while scanning `packages/*/*/package.json` at startup — and builder and host share no notification protocol.
|
||||
|
||||
On the browser side, the transport delegates code replacement to the same modules controller that owns graph reconciliation:
|
||||
|
||||
@@ -96,7 +96,7 @@ On the browser side, the transport delegates code replacement to the same module
|
||||
|
||||
Bootstrap replacement is rejected before invalidation or teardown: the module system retains its initial exports, so remounting its old code would reset consumers without applying the requested revision. The page reports the required reload and preserves the bootstrap fiber. Every non-bootstrap plugin shares the replacement semantics; an `immediately` row reloads exactly like a lazy one. Dependency cascade costs zero client code: a fiber's activation epoch strings its service providers' uids, so replacing a foundational provider such as connection re-loads every dependent through cordis itself — correct, if heavy.
|
||||
|
||||
Reload creates a fresh fiber and component state; it does not preserve React state inside the replaced plugin. Static assembly libraries and the shell require a rebuilt page; when the Host itself serves another release, the page holds plugin replacement and asks whether to reload ([Host release change prompt](../feature/2026-10-14-host-release-change-refresh-prompt.md)). Failed imports or activation remain diagnosable and retryable without rolling back unrelated plugins. Self-reload closes the old SSE channel and opens a new one; its full snapshot repairs missed graph changes. Boot, graph updates and rebuilt frames share the same queue, so a code replacement cannot overlap initial module arrival.
|
||||
Reload creates a fresh fiber and component state; it does not preserve React state inside the replaced plugin. Static assembly libraries and the shell require a rebuilt page; when the Host itself serves another release, the page holds plugin replacement and asks whether to reload ([Host release change prompt](../feature/2026-10-14-host-release-change-refresh-prompt.md)). Failed imports or activation remain diagnosable and retryable without rolling back unrelated plugins. Self-reload closes the old stream and opens a new one; its full snapshot repairs missed graph changes. Boot, graph updates and rebuilt frames share the same queue, so a code replacement cannot overlap initial module arrival.
|
||||
|
||||
## Package ownership
|
||||
|
||||
@@ -108,7 +108,7 @@ One governance implementation runs on both sides of the wire; the browser-specif
|
||||
|
||||
Costs accepted: the vendored Loader carries idle machinery in the browser (EntryTree persistence is a no-op, groups/isolation unused); every plugin edit in dev pays a bundle rebuild plus fiber remount; graph `inject` rows guide factory arrival but service availability remains the activation authority, so a mismatch appears at the boot audit; the static UI libraries keep direct value exports; every bundle gains a source-map artifact; and external-script failures provide only coarse URL diagnostics instead of the HTTP status available to an explicit fetch. The Host retains bundle snapshots and lazy response plans for the current graph and one prior startup generation. Script and map bodies are cached after their first `GET`, so memory grows with bundle snapshots and requested response bodies. Each materialized response stays fixed at its URL; a prior-generation map first requested after a rebuild reads the current map file.
|
||||
|
||||
Roster: it lives in the web bundle's config tree (`packages/bundle/web-app/cordis.patch.yml`); `mountWebPlugins` and the `CLIENT_PACKAGES` constant are gone, and recomposing a deployment means swapping the yml/overlay. The graph composer lives in the `dsh-client-modules` node half, while the parser-preloaded client face bootstraps the browser module table. The webserver remains a plain route-registration plugin; `/api/*` binding, browser authentication, RPC envelopes, and exact Fetch routes belong to the Connection node half, while Remote dispatch belongs to API Gateway and the dev bundle watch plus SSE channel belongs to the hmr node half.
|
||||
Roster: it lives in the web bundle's config tree (`packages/bundle/web-app/cordis.patch.yml`); `mountWebPlugins` and the `CLIENT_PACKAGES` constant are gone, and recomposing a deployment means swapping the yml/overlay. The graph composer lives in the `dsh-client-modules` node half, while the parser-preloaded client face bootstraps the browser module table. The webserver remains a plain route-registration plugin; `/api/*` binding, browser authentication, RPC envelopes, and exact Fetch routes belong to the Connection node half, while Remote dispatch belongs to API Gateway and the dev bundle watch plus the plugin-events Remote stream belongs to the hmr node half.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ Host 会快照每个已构建插件入口 bundle,并把每个调度阶段的
|
||||
|
||||
共享 tsdown 预设为每个插件入口与 chunk 产出 map,并把第一方源码路径重写成浏览器可识别的仓库形式 `/packages/<group>/<package>/src/...`。生产 Client 构建会消费 `lib/types`;预设把每份 tsc map 交给 Rolldown,并从原文件补齐 `sourcesContent`,使最终 map 回到 TypeScript/TSX,而不是停在编译后的 JavaScript。内联进 bundle 的其他 workspace 源码同样回到其 `packages/` 归属,依赖包路径保持原样。Combo 生成会移除每个局部调试指令、记录其生成行偏移、以原插件 map URL 解析每个自带 source,再产出 Indexed Source Map v3。插件有自带 map 时直接用于对应 section;没有时则生成 identity section,内嵌构建后 bundle,并在存在时把 packer 写入的 `sourceURL` 用作 source 名。绝对 combo map URL 会平行改写脚本资源列表中的每个 `client.js` 后缀,因此 `/plugins/??<package-a>/client.js,<package-b>/client.js&rev=<rev>` 指向 `/plugins/??<package-a>/client.js.map,<package-b>/client.js.map&rev=<rev>`。chunk 脚本同样指向自己的 map URL。只有在这些 map URL 收到 `GET` 后,source map 文件才会被读取和组合;`HEAD` 不会物化脚本或 map body。Vite 壳同样产出 sourcemap,使壳代码与经外部加载的插件都能从 stack 和性能 profile 回到 TypeScript/TSX。
|
||||
|
||||
图为 HMR 保留每个 row 带 revision 的单资源 combo URL,并为每个启动 combo 请求增加带 revision 的描述;多条描述可以使用同一调度阶段。首次发布与 `rebuilt(id)` 使用相同的入口 mtime、ctime 和大小哈希;产物内容不参与求哈希。ctime 用于区分保留 mtime 和大小的重写。Host 重启时若产物未变,每个 row 的 revision 都保持不变,因此重连后的 SSE 快照不会触发浏览器插件替换。共享预设会在每个包输出写完后标记入口;因此只重建 chunk 也会推进 owner revision,无需 Host 扫描 sibling。启动 combo revision 从有序 row revision 派生。脚本 body 在首次 `GET` 时组合;source map 文件在首次 map `GET` 时单独读取并组合。`HEAD` 不会物化任一 body。版本化脚本与 map 使用 immutable 缓存,无关图重组会保留相同 revision 下已经物化的 chunk 响应。Host 只提供精确生成的 URL;陈旧 revision 与未发布资源列表返回 404,不会别名到其他字节。外部脚本的 `error` 事件不给响应状态与正文,因此失败诊断只报告 URL;同源 Host 与构建期写入的 registration id 是身份边界,`load` 后的 factory 存在性检查负责拒绝未登记预期 id 的产物。
|
||||
图为 HMR 保留每个 row 带 revision 的单资源 combo URL,并为每个启动 combo 请求增加带 revision 的描述;多条描述可以使用同一调度阶段。首次发布与 `rebuilt(id)` 使用相同的入口 mtime、ctime 和大小哈希;产物内容不参与求哈希。ctime 用于区分保留 mtime 和大小的重写。Host 重启时若产物未变,每个 row 的 revision 都保持不变,因此重连后的流 baseline不会触发浏览器插件替换。共享预设会在每个包输出写完后标记入口;因此只重建 chunk 也会推进 owner revision,无需 Host 扫描 sibling。启动 combo revision 从有序 row revision 派生。脚本 body 在首次 `GET` 时组合;source map 文件在首次 map `GET` 时单独读取并组合。`HEAD` 不会物化任一 body。版本化脚本与 map 使用 immutable 缓存,无关图重组会保留相同 revision 下已经物化的 chunk 响应。Host 只提供精确生成的 URL;陈旧 revision 与未发布资源列表返回 404,不会别名到其他字节。外部脚本的 `error` 事件不给响应状态与正文,因此失败诊断只报告 URL;同源 Host 与构建期写入的 registration id 是身份边界,`load` 后的 factory 存在性检查负责拒绝未登记预期 id 的产物。
|
||||
|
||||
### 装载流程,端到端
|
||||
|
||||
@@ -76,13 +76,13 @@ Host 会快照每个已构建插件入口 bundle,并把每个调度阶段的
|
||||
|
||||
modules 控制器只持有从启动清单创建的 Loader 条目。Host 的完整快照更新模块描述并对账这些条目;其他 Loader 贡献方保留自身所有权。新增模块通过单资源 URL 到达,因为重放启动 batch 可能重复注册现有 factory。移除使用 Loader 删除语义,随后等待已捕获 fiber 清理完毕,再移除未使用的模块记录。已声明及已观察到的传递依赖使共享模块保持存活。Factory revision 的跟踪独立于条目激活,因为下载或物化完成后仍可能没有创建条目。图更新会在任何消费者导入依赖前,使未归属受管条目的陈旧 factory 和失败的到达目标失效,并通知资源消费者;重建帧也会对账因导入失败而缺失的条目。
|
||||
|
||||
Host SSE 适配器转发现有图变化通知,并在连接时发送当前完整图。图描述浏览器的目标条目,不代表 Host 清理完成:Host 生命周期顺序属于其 Loader,每个浏览器则等待自身被移除 fiber 的清理。图对账与代码重建共用一个页面队列。本地代际阻止过期下载挂载;不透明 revision 只比较相等。失败页面报告本地错误,并可重试同一张图而不改变 Host 启用状态。这保留了无关页面状态,也无需重启应用或引入第二套插件执行器。Electron 的独立安装流程不属于此机制。
|
||||
Host 的 `pluginEvents/follow` Remote 流转发现有图变化通知,每一代流先发送当前完整图;图行还携带各插件的同步配置([前端插件配置同步](2026-11-15-client-config-sync.zh.md))。图描述浏览器的目标条目,不代表 Host 清理完成:Host 生命周期顺序属于其 Loader,每个浏览器则等待自身被移除 fiber 的清理。图对账与代码重建共用一个页面队列。本地代际阻止过期下载挂载;不透明 revision 只比较相等。失败页面报告本地错误,并可重试同一张图而不改变 Host 启用状态。这保留了无关页面状态,也无需重启应用或引入第二套插件执行器。Electron 的独立安装流程不属于此机制。
|
||||
|
||||
### 热重载:一个驱动插件,自行监视的 bundle
|
||||
|
||||
热重载是一项组合决策:web 组合包无条件挂载 `client-hmr` 行(一个常规的插件包),其 node 半带来 bundle 监视与 SSE(Server-Sent Events)通道;没有重建 watcher 改写客户端 bundle 时链路保持空闲。不应暴露它的组合可以禁用该行。
|
||||
热重载是一项组合决策:web 组合包无条件挂载 `client-hmr` 行(一个常规的插件包),其 node 半带来 bundle 监视与经过鉴权的插件事件 Remote 流;没有重建 watcher 改写客户端 bundle 时链路保持空闲。不应暴露它的组合可以禁用该行。
|
||||
|
||||
重建好的 bundle 怎么变成重载信号?hmr 的 node 半自己观察——没有构建器来通知它。模块 host 在读取每份启动快照前捕获入口 stat 基线,并通过 `ctx.clientModules.artifactBaseline(id)` 暴露它。HMR 自持的单个定时器把当前图的每个 row 与这份基线比较:未变化的 row 直接开始监视,不读取内容也不求哈希;基线捕获后的写入已经形成 stat 差异,只有该 row 会进入 `rebuilt(id)`。这既避免安装 watcher 时重复读取,也避开 `fs.watchFile` 以异步首次 stat 建立基线、可能静默吸收构造期重建的问题。监视集合的成员随 `onGraphChanged` 更新;消失的 row 撤下监视,轮询时缺失的入口则让对应 row 保持标脏状态,文件重现时即使 mtime 和大小与基线相同也重试发布。共享 tsdown 预设会在每个 sibling 输出写完后标记 `client.js`;入口 mtime、ctime 或大小变化、或 row 处于标脏状态时,`rebuilt(id)` 从这三个元数据值派生 revision。只有 revision 变化时,它才读取新的 bundle 快照。只修改 chunk 因此也会更换 revision;部分写入之后的完成标记还会提供一次更晚的 stat 变化以完成自愈。`rev` 变化时,node 半在 `GET /plugins/events` 上广播 `rebuilt` 帧——这是一条系统级 SSE 通道,连接即发全量图,变更时发 `rebuilt` 帧,仅供呈现的 wire,永不进会话日志。轮询是刻意选择:inotify 在 weka 网络挂载上不触发,构建侧监视器需要 `--poll` 也是同一原因;每个 row 每个间隔只需一次入口 stat,轮询间隔是一个经校验的配置字段(默认 500ms),dispose(资源释放)会清掉那一个定时器。重建产物的进程必须使用共享 Client tsdown 预设;`scripts/dev-web.ts` 仍作为 watch 构建入口保留,其包清单在启动时扫描 `packages/*/*/package.json` 按 dsh.client 发现,构建器与 host 之间没有通知协议。
|
||||
重建好的 bundle 怎么变成重载信号?hmr 的 node 半自己观察——没有构建器来通知它。模块 host 在读取每份启动快照前捕获入口 stat 基线,并通过 `ctx.clientModules.artifactBaseline(id)` 暴露它。HMR 自持的单个定时器把当前图的每个 row 与这份基线比较:未变化的 row 直接开始监视,不读取内容也不求哈希;基线捕获后的写入已经形成 stat 差异,只有该 row 会进入 `rebuilt(id)`。这既避免安装 watcher 时重复读取,也避开 `fs.watchFile` 以异步首次 stat 建立基线、可能静默吸收构造期重建的问题。监视集合的成员随 `onGraphChanged` 更新;消失的 row 撤下监视,轮询时缺失的入口则让对应 row 保持标脏状态,文件重现时即使 mtime 和大小与基线相同也重试发布。共享 tsdown 预设会在每个 sibling 输出写完后标记 `client.js`;入口 mtime、ctime 或大小变化、或 row 处于标脏状态时,`rebuilt(id)` 从这三个元数据值派生 revision。只有 revision 变化时,它才读取新的 bundle 快照。只修改 chunk 因此也会更换 revision;部分写入之后的完成标记还会提供一次更晚的 stat 变化以完成自愈。`rev` 变化时,node 半在经过鉴权的 `pluginEvents/follow` Remote 流上发布 `rebuilt` 帧;该流每一代先发全量图,之后发送 `graph` 与 `rebuilt` 增量,是仅供呈现的 wire,永不进会话日志。轮询是刻意选择:inotify 在 weka 网络挂载上不触发,构建侧监视器需要 `--poll` 也是同一原因;每个 row 每个间隔只需一次入口 stat,轮询间隔是一个经校验的配置字段(默认 500ms),dispose(资源释放)会清掉那一个定时器。重建产物的进程必须使用共享 Client tsdown 预设;`scripts/dev-web.ts` 仍作为 watch 构建入口保留,其包清单在启动时扫描 `packages/*/*/package.json` 按 dsh.client 发现,构建器与 host 之间没有通知协议。
|
||||
|
||||
浏览器侧的传输把代码替换交给负责图对账的同一个 modules 控制器:
|
||||
|
||||
@@ -96,7 +96,7 @@ Host SSE 适配器转发现有图变化通知,并在连接时发送当前完
|
||||
|
||||
Bootstrap 替换会在失效或卸载前被拒绝:模块系统保留其初始导出,重新挂载旧代码会重置消费者,却无法应用请求的 revision。页面会报告需要刷新,并保留 bootstrap fiber。所有非 bootstrap 插件都共享同一套替换语义;`immediately` 行的重载与 lazy 行分毫不差。依赖级联不花一行 client 代码:fiber 的激活纪元串接着它各服务提供方的 uid,因此替换 connection 等基础 provider 的 fiber 时,每个依赖方都会经 cordis 本身重新装载——行为正确,但代价较高。
|
||||
|
||||
重载会创建新的 fiber 和组件状态,不保留被替换插件内部的 React 状态。静态组装库与应用壳需要重建后的页面;Host 本身换成另一个 release 时,页面会暂停插件替换并询问是否刷新([Host release 变化提示](../feature/2026-10-14-host-release-change-refresh-prompt.zh.md))。导入或激活失败仍可诊断和重试,不会回滚无关插件。自重载关闭旧 SSE 通道并打开新通道;其完整快照补齐遗漏的图变更。启动、图更新和重建帧共用同一队列,因此代码替换不会与初始模块到达重叠。
|
||||
重载会创建新的 fiber 和组件状态,不保留被替换插件内部的 React 状态。静态组装库与应用壳需要重建后的页面;Host 本身换成另一个 release 时,页面会暂停插件替换并询问是否刷新([Host release 变化提示](../feature/2026-10-14-host-release-change-refresh-prompt.zh.md))。导入或激活失败仍可诊断和重试,不会回滚无关插件。自重载关闭旧流并打开新流;其完整快照补齐遗漏的图变更。启动、图更新和重建帧共用同一队列,因此代码替换不会与初始模块到达重叠。
|
||||
|
||||
## 包归属
|
||||
|
||||
@@ -108,7 +108,7 @@ Wire 两侧运行同一份治理实现;浏览器特有层只包含一套模块
|
||||
|
||||
接受的代价:vendored Loader 在浏览器里背着闲置机件(EntryTree 持久化是 no-op,分组/隔离未用);开发期每次修改插件都要付一次 bundle 重建加 fiber 重挂;graph `inject` row 指导 factory 到达,但服务可用性仍是激活权威,因此不匹配会在启动审计时浮出;静态 UI 库保留直接实体导出;每个 bundle 多出一份 sourcemap 产物,外部 script 失败也只能给出粗粒度 URL 诊断,不能像显式 fetch 那样报告 HTTP 状态。Host 为当前图及上一代启动图保留 bundle 快照与惰性响应计划。脚本和 map body 在首次 `GET` 后缓存,因此内存随 bundle 快照和已请求的响应 body 增长。每份已物化响应在其 URL 下保持固定;若上一代 map 在重建后才首次被请求,则会读取当前 map 文件。
|
||||
|
||||
名册位于 web 组合包的配置树(`packages/bundle/web-app/cordis.patch.yml`);`mountWebPlugins` 与 `CLIENT_PACKAGES` 常量已消失,重组一次部署等于替换 yml/overlay。Graph 组合器位于 `dsh-client-modules` node 半,由 parser 预载的 Client face 则自举浏览器模块表。Webserver 继续作为朴素路由注册插件;`/api/*` 绑定、浏览器认证、RPC envelope 与精确 Fetch 路由属于 Connection node 半,Remote 分发属于 API Gateway,开发期 bundle 监视与 SSE 通道属于 HMR node 半。
|
||||
名册位于 web 组合包的配置树(`packages/bundle/web-app/cordis.patch.yml`);`mountWebPlugins` 与 `CLIENT_PACKAGES` 常量已消失,重组一次部署等于替换 yml/overlay。Graph 组合器位于 `dsh-client-modules` node 半,由 parser 预载的 Client face 则自举浏览器模块表。Webserver 继续作为朴素路由注册插件;`/api/*` 绑定、浏览器认证、RPC envelope 与精确 Fetch 路由属于 Connection node 半,Remote 分发属于 API Gateway,开发期 bundle 监视与插件事件 Remote 流属于 HMR node 半。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
|
||||
+4
-4
@@ -9,11 +9,11 @@
|
||||
en: 8d4d00e33af763b2
|
||||
zh: 61977c82d66ae9bf
|
||||
/agent-note-account-provider-and-active-request-cancellation/decision:
|
||||
en: d5eb12a1644c6226
|
||||
zh: 513d4f22ab74e039
|
||||
en: 6f5463ecf88c1435
|
||||
zh: 7c9e46f90c8ccffb
|
||||
/agent-note-account-provider-and-active-request-cancellation/alternatives-considered:
|
||||
en: a072026c1495a1ca
|
||||
zh: bf053cc04fb33914
|
||||
en: 7ed93136cf11074a
|
||||
zh: 1ee997e271e919ad
|
||||
/agent-note-account-provider-and-active-request-cancellation/consequences:
|
||||
en: 8fd00b6d69b380c0
|
||||
zh: 3830dc3a93d5de3c
|
||||
@@ -14,11 +14,11 @@ Selecting credentials from login state changes the billing identity of an existi
|
||||
|
||||
Account cancellation reads each running Agent’s latest `Session.requestContext()` instead of maintaining another provider field. This logged value remains through tools and retries and follows the next bound request. Idle Agents are excluded. During a new turn’s first preparation it can still name the previous turn’s account route, so sign-out can also interrupt an API-key turn that has not bound its new request yet. A missing account credential rejects a first request without a previous context before transport.
|
||||
|
||||
Successful local sign-out publishes an account event. The platform account provider installs the account module’s listener, which enumerates the Agent registry and cancels matching account routes through `Agent.cancel`, preserving inboxes. The account controller shares its predicate for sign-out confirmation. Each registered child is classified independently; existing parent-owned cancellation still applies to children whose lifetime is attached to a cancelled parent. The existing HTTP signal carries cancellation to transport.
|
||||
Successful local sign-out publishes an account event. The account route plugin installs a listener, which enumerates the Agent registry and cancels matching account routes through `Agent.cancel`, preserving inboxes. It registers the same predicate with the account service as the running-task report behind sign-out confirmation. Each registered child is classified independently; existing parent-owned cancellation still applies to children whose lifetime is attached to a cancelled parent. The existing HTTP signal carries cancellation to transport. Requests this listener cannot reach end through the withdrawal signal of their credential, which the [route credential decision](2026-11-10-llm-route-credential-seam.md) owns.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
A historical set of providers wrongly cancels a turn after it switches to an API-key route. Current settings misclassify an older in-flight request. A second provider field or module-global map duplicates information already recorded in request context. A login-level cancellation signal duplicates the existing Agent and HTTP cancellation chain.
|
||||
A historical set of providers wrongly cancels a turn after it switches to an API-key route. Current settings misclassify an older in-flight request. A second provider field or module-global map duplicates information already recorded in request context. A login-level cancellation signal in place of this chain duplicates the existing Agent and HTTP cancellation; the credential's withdrawal signal only supplements it.
|
||||
|
||||
## Consequences
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ Status: implemented
|
||||
|
||||
账号取消读取运行中 Agent 最近的 `Session.requestContext()`,不维护额外提供方字段。该已记录值在工具和重试阶段保留,随下一次绑定请求更新;空闲 Agent 不计入。新轮次首次准备期间,它仍可能指向上一轮的账号路由,因此退登也可能打断尚未绑定新请求的 API key 轮次。没有历史上下文的首请求若缺少账号凭据,会在传输前失败。
|
||||
|
||||
本地退登成功后发布账号事件。Platform 账号提供方安装账号模块的监听器,遍历 Agent 注册表,通过 `Agent.cancel` 取消匹配的账号路由并保留收件箱。账号控制器的退登确认复用同一判断函数。每个已注册子代理独立分类;生命周期绑定到已取消父代理的子代理仍受现有父级取消规则约束。现有 HTTP 信号将取消传递到传输层。
|
||||
本地退登成功后发布账号事件。账号路由插件安装监听器,遍历 Agent 注册表,通过 `Agent.cancel` 取消匹配的账号路由并保留收件箱。它把同一判断函数注册到账号服务,作为退登确认所依据的运行中任务报告。每个已注册子代理独立分类;生命周期绑定到已取消父代理的子代理仍受现有父级取消规则约束。现有 HTTP 信号将取消传递到传输层。该监听器到达不了的请求通过其凭据的撤回信号结束,这一信号由[路由凭据决策](2026-11-10-llm-route-credential-seam.zh.md)负责。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
历史提供方集合会在轮次切换到 API Key 路由后仍错误取消它。当前设置会误判更早的在途请求。额外的提供方字段或模块级全局映射重复保存请求上下文中已有的信息。登录级取消信号重复现有 Agent 与 HTTP 取消链路。
|
||||
历史提供方集合会在轮次切换到 API Key 路由后仍错误取消它。当前设置会误判更早的在途请求。额外的提供方字段或模块级全局映射重复保存请求上下文中已有的信息。用登录级取消信号取代这条链路,会重复现有的 Agent 与 HTTP 取消;凭据的撤回信号只是对它的补充。
|
||||
|
||||
## Consequences
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
en: e42db40b879fdbf4
|
||||
zh: 6017da9c4da17835
|
||||
/agent-note-node-ptc-execution-modes-and-in-memory-state/decision:
|
||||
en: 411054071757d5fe
|
||||
zh: e683ef7d80f33fc6
|
||||
en: 13a72b9728d25394
|
||||
zh: 1f44510fe93836dc
|
||||
/agent-note-node-ptc-execution-modes-and-in-memory-state/alternatives-considered:
|
||||
en: 396157a9fc293198
|
||||
zh: a061f05b4423e26f
|
||||
|
||||
@@ -18,7 +18,7 @@ One npm package and one plugin entry keep existing installation and loading path
|
||||
|
||||
The Session records submitted programs, nested tool calls and returned output. It does not serialize the REPL heap or rerun earlier programs after restart, resume or fork: replaying automation could repeat external side effects. A missing variable is a normal program error, and the model-visible instructions require recreating variables and reacquiring resources. No environment identifier or new durable Session event is required because the provider exposes no unlogged model input.
|
||||
|
||||
Protocol or output-limit failure, owner disposal and process exit discard the environment. The [interruption decision](2026-10-29-retained-ptc-interruption.md) owns timeout and cancellation recovery with retained state. Ordinary exceptions retain earlier mutations. A retained function uses the active evaluation's host bindings; asynchronous work from an earlier evaluation cannot acquire a later evaluation's tool authority or output sink.
|
||||
Protocol failure, owner disposal and process exit discard the environment. [Output truncation](2026-11-13-ptc-output-truncation.md) owns bounded output without state disposal. The [interruption decision](2026-10-29-retained-ptc-interruption.md) owns timeout and cancellation recovery with retained state. Ordinary exceptions retain earlier mutations. A retained function uses the active evaluation's host bindings; asynchronous work from an earlier evaluation cannot acquire a later evaluation's tool authority or output sink.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Status: implemented
|
||||
|
||||
Session 记录提交的程序、嵌套工具调用和返回输出。它不序列化 REPL 堆,也不在重启、恢复或派生后重新执行旧程序,因为重放自动化可能重复外部操作。缺失变量产生普通程序错误,模型指引要求重新创建变量并获取资源。提供方没有引入日志之外的模型输入,因此不需要环境标识或新的持久 Session 事件。
|
||||
|
||||
协议失败、输出超限、所有者销毁和进程退出都会丢弃环境。[中断决策](2026-10-29-retained-ptc-interruption.zh.md)负责保留状态的超时和取消恢复。普通异常保留此前发生的修改。保留的函数使用当前执行的宿主绑定;较早执行中的异步任务不能获取后续执行的工具权限或向其输出。
|
||||
协议失败、所有者销毁和进程退出都会丢弃环境。[输出截断](2026-11-13-ptc-output-truncation.zh.md)负责限制输出而不丢弃状态。[中断决策](2026-10-29-retained-ptc-interruption.zh.md)负责保留状态的超时和取消恢复。普通异常保留此前发生的修改。保留的函数使用当前执行的宿主绑定;较早执行中的异步任务不能获取后续执行的工具权限或向其输出。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
en: 32ba2b2b42e8deb5
|
||||
zh: 6a6532561f81b8e2
|
||||
/agent-note-offer-web-search-and-web-fetch-only-while-the-selected-provider-is-ready/decision:
|
||||
en: 08a54b37e157da29
|
||||
zh: 65f633055d9df242
|
||||
en: 023c6db0af5f9424
|
||||
zh: 7bdf40c49e381ee3
|
||||
/agent-note-offer-web-search-and-web-fetch-only-while-the-selected-provider-is-ready/alternatives-considered:
|
||||
en: 6da221f6b821ea44
|
||||
zh: b15774011abed7ed
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ English | [中文](2026-09-27-web-search-offered-by-provider-readiness.zh.md)
|
||||
Each role of the web capability seam owns one part of a per-step check:
|
||||
|
||||
- **Service Definition.** `WebSearchProvider` and `WebFetchProvider` have an optional `ready(llmProvider)` that answers whether an operation made for a model request on that chat route has a credential to send. It checks configuration only and makes no network calls. `ctx.web.searchReady(llmProvider?)` and `ctx.web.fetchReady(llmProvider?)` resolve the provider with the same rules as `search()` and `fetch()` and return its answer. A provider without `ready()` counts as ready, and a selection failure answers true because the operation reports that failure as a structured `WebError`.
|
||||
- **Service Provider.** Each DeepSeek provider checks its credentials in the order its operation resolves them. `dsh-web-search-deepseek` checks, on the `deepseek-account` route, whether `ctx.deepseekAccount.resolveToken()` returns a token for its Messages endpoint, and then its literal `apiKey` or its `apiKeyEnv` reference. The Search and Fetch API providers of `dsh-web-deepseek-api` resolve the same plan as the operation ([credential resolution](2026-10-29-web-provider-selection.md)): a capability with its own YAML fields checks only the key under its `*ApiKeyEnv`; otherwise, on the account route with the account model route mounted, a token for that route's `/v1/tools` base counts, and then the key of the `deepseek-official` route, or `DEEPSEEK_API_KEY` without that route. A key counts when `ctx.credentials.describe()` reports its reference configured (without that service, when the launching environment carries it); the [shared credential helpers](../../../../packages/llm/llm-deepseek/src/credential.ts) perform these presence checks. A failed account-token or credential-store read answers false, because the operation fails on that read instead of trying the next credential. The providers name no tool or prompt section.
|
||||
- **Service Provider.** Each DeepSeek provider checks its credentials in the order its operation resolves them. `dsh-web-search-deepseek` checks, on a route whose `ctx.llm.providerCredential()` publishes an account credential, whether that credential is configured for its Messages endpoint, and then its literal `apiKey` or its `apiKeyEnv` reference. The Search and Fetch API providers of `dsh-web-deepseek-api` resolve the same plan as the operation ([credential resolution](2026-10-29-web-provider-selection.md)): a capability with its own YAML fields checks only the key under its `*ApiKeyEnv`; otherwise, on the account route with the account model route mounted, that route's credential configured for its `/v1/tools` base counts, and then the key of the `deepseek-official` route, or `DEEPSEEK_API_KEY` without that route. A key counts when `ctx.credentials.describe()` reports its reference configured (without that service, when the launching environment carries it); the reference helpers of `dsh-credentials` and each route's own presence check perform these checks. A failed account-token or credential-store read answers false, because the operation fails on that read instead of trying the next credential. The providers name no tool or prompt section.
|
||||
- **Consumer.** `dsh-tool-web` registers `web_search` and `web_fetch` with [step activation conditions](../../../../packages/core/tools/README.md#conditional-tools) that ask `ctx.web.searchReady()` and `ctx.web.fetchReady()` about the route of the step's model selection. The agent loop resolves conditions before it assembles the step, so the declared tools, the `tool:web_search` and `tool:web_fetch` prompt sections, PTC program bindings, and dispatch all read the same admitted set.
|
||||
|
||||
The route decides only whether the account token is checked before the API key, which happens on the `deepseek-account` route; an API key counts on every route, so a conversation on another provider's model is offered the DeepSeek web tools whenever a DeepSeek key is configured. A Search or Fetch API capability with its own YAML fields ignores the route and is ready exactly when its own key is configured.
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ Status: implemented
|
||||
web 能力 seam 的每个角色各负责逐步骤检查的一部分:
|
||||
|
||||
- **Service Definition。** `WebSearchProvider` 与 `WebFetchProvider` 有一个可选的 `ready(llmProvider)`,回答为该对话路由上的模型请求发起的操作是否有可发送的凭据。它只检查配置,不发起网络调用。`ctx.web.searchReady(llmProvider?)` 与 `ctx.web.fetchReady(llmProvider?)` 按与 `search()`、`fetch()` 相同的规则解析提供方并返回其回答。没有 `ready()` 的提供方视为就绪;选择失败时回答 true,因为对应操作会把该失败报告为结构化 `WebError`。
|
||||
- **Service Provider。** 每个 DeepSeek 提供方都按其操作解析凭据的顺序检查凭据。`dsh-web-search-deepseek` 在 `deepseek-account` 路由上检查 `ctx.deepseekAccount.resolveToken()` 是否为其 Messages 端点返回 token,然后检查其字面 `apiKey` 或 `apiKeyEnv` 引用。`dsh-web-deepseek-api` 的 Search 与 Fetch API 提供方解析与操作相同的方案([凭据解析](2026-10-29-web-provider-selection.zh.md)):在 YAML 中设置了单独字段的能力只检查其 `*ApiKeyEnv` 下的密钥;否则,在账号路由上且账号模型路由已挂载时,该路由 `/v1/tools` 基础地址的 token 算数,然后是 `deepseek-official` 路由的密钥,没有该路由时为 `DEEPSEEK_API_KEY`。`ctx.credentials.describe()` 报告其引用已配置时(没有该服务时,启动环境中存在该变量),密钥即算存在;这些存在性检查由[共享凭据函数](../../../../packages/llm/llm-deepseek/src/credential.ts)执行。读取账号 token 或凭据存储失败时回答 false,因为操作会在该次读取上失败,而不会尝试下一种凭据。提供方不点名任何工具或提示词段落。
|
||||
- **Service Provider。** 每个 DeepSeek 提供方都按其操作解析凭据的顺序检查凭据。`dsh-web-search-deepseek` 在 `ctx.llm.providerCredential()` 发布账号凭据的路由上检查该凭据是否已为其 Messages 端点配置,然后检查其字面 `apiKey` 或 `apiKeyEnv` 引用。`dsh-web-deepseek-api` 的 Search 与 Fetch API 提供方解析与操作相同的方案([凭据解析](2026-10-29-web-provider-selection.zh.md)):在 YAML 中设置了单独字段的能力只检查其 `*ApiKeyEnv` 下的密钥;否则,在账号路由上且账号模型路由已挂载时,该路由为其 `/v1/tools` 基础地址配置的凭据算数,然后是 `deepseek-official` 路由的密钥,没有该路由时为 `DEEPSEEK_API_KEY`。`ctx.credentials.describe()` 报告其引用已配置时(没有该服务时,启动环境中存在该变量),密钥即算存在;这些存在性检查由 `dsh-credentials` 的引用函数和各路由自身的存在性检查执行。读取账号 token 或凭据存储失败时回答 false,因为操作会在该次读取上失败,而不会尝试下一种凭据。提供方不点名任何工具或提示词段落。
|
||||
- **Consumer。** `dsh-tool-web` 注册 `web_search` 与 `web_fetch` 时各带一个[步骤激活条件](../../../../packages/core/tools/README.zh.md#conditional-tools),以该步骤模型选择的路由询问 `ctx.web.searchReady()` 与 `ctx.web.fetchReady()`。agent loop 在组装该步骤之前解析各条件,因此声明的工具、`tool:web_search` 与 `tool:web_fetch` 提示词段落、PTC 程序绑定与派发都读取同一个准入集合。
|
||||
|
||||
路由只决定是否先检查账号 token 再检查 API 密钥,这发生在 `deepseek-account` 路由上;API 密钥在每条路由上都算数,因此只要配置了 DeepSeek 密钥,使用其他提供方模型的对话也会获得 DeepSeek Web 工具。在 YAML 中设置了单独字段的 Search 或 Fetch API 能力不看路由,恰在其自身密钥已配置时就绪。
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
en: 428699f74f19e998
|
||||
zh: 2e8fcdbc9616f70b
|
||||
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/decision/watching-and-client-plugin-delivery:
|
||||
en: f3e6ba098433a70a
|
||||
zh: 345b93f451d2768c
|
||||
en: 814c344e891f7f91
|
||||
zh: a024d5e30607968b
|
||||
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/alternatives-considered:
|
||||
en: 99ee505e82fa9c7c
|
||||
zh: 448bc0e160424cbf
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ The Worker's structural stubs throw errors carrying `ERR_FEATURE_UNAVAILABLE_ON_
|
||||
### Watching and Client plugin delivery
|
||||
|
||||
- Worker `fs.watch` and `fs.watchFile` listeners run in the async context where the watcher was created, as Node delivers watch events from the watch handle, not in the context of the code whose write produced the event. HMR's configuration watcher therefore runs outside the writer's HMR transaction, and a configuration write made inside a transaction does not make the follow-up reload fail as a nested transaction.
|
||||
- The browser half of `@deepseek-ai/dsh-client-hmr` reads `/plugins/events` through the page's `__DSH_TRANSPORT__.fetch` when a shell provides one (the Worker preview tunnel), otherwise through `EventSource`. The Client plugins of a bundle enabled in the Preview therefore mount without a page reload.
|
||||
- The browser half of `@deepseek-ai/dsh-client-hmr` follows the `pluginEvents/follow` Remote stream over the Remote carrier the page's Connection provides, including the Worker preview tunnel. The Client plugins of a bundle enabled in the Preview therefore mount without a page reload.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ Worker 的结构化 stub 抛出带 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 的错
|
||||
### 文件监听与 Client 插件下发
|
||||
|
||||
- Worker 的 `fs.watch` 和 `fs.watchFile` 监听器在创建 watcher 时的异步上下文里运行,与 Node 从 watch 句柄派发事件一致,而不是在写入方的上下文里运行。因此 HMR 的配置 watcher 在写入方的 HMR 事务之外运行,事务内的配置写入不会让随后的重载因嵌套事务而失败。
|
||||
- `@deepseek-ai/dsh-client-hmr` 的浏览器部分在 shell 提供 `__DSH_TRANSPORT__.fetch` 时(Worker preview 隧道)经它读取 `/plugins/events`,否则经 `EventSource` 读取。因此在 Preview 里启用 bundle 后,其 Client 插件无需刷新页面即可挂载。
|
||||
- `@deepseek-ai/dsh-client-hmr` 的浏览器部分经页面 Connection 提供的 Remote 载体(包括 Worker preview 隧道)跟随 `pluginEvents/follow` Remote 流。因此在 Preview 里启用 bundle 后,其 Client 插件无需刷新页面即可挂载。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
en: 9d68ffca5c8be681
|
||||
zh: 36bb661f98de0ebb
|
||||
/agent-note-web-provider-selection-independent-menus-over-registered-providers/decision/credential-resolution:
|
||||
en: 15f6fb26c8605260
|
||||
zh: 93467641a8ff0aad
|
||||
en: aa5522b172d2c580
|
||||
zh: 04561ffe78d69ff4
|
||||
/agent-note-web-provider-selection-independent-menus-over-registered-providers/decision/defaults-and-stored-selections:
|
||||
en: 5fcd3319fbceed1d
|
||||
zh: 20771646b9c36fa6
|
||||
|
||||
@@ -30,11 +30,11 @@ The Search and Fetch APIs read one `web-deepseek-api` namespace, and each resolv
|
||||
|
||||
Each of Search and Fetch has a billing setting, `web-deepseek-api.searchBilling` or `fetchBilling`, which the settings page edits as a **Billing** menu under the selected API. The default, `auto`, follows the DeepSeek credential of the conversation; `account` sends only the signed-in account's token and `api-key` only the API key, without falling back to the other. The conversation's route is the `provider` of the initiating Session's latest request context, which account sign-out also reads; `ready()` uses the route of the model request being prepared, so readiness and execution resolve the same plan.
|
||||
|
||||
The account token is the one `ctx.deepseekAccount` releases for the dispatch endpoint under the origin of the active `@deepseek-ai/dsh-llm-deepseek-account` Loader entry at the entry root that the model provider directory lists, with `/v1/tools`; without that entry, the origin of that route's default base URL is used. An HTTP 401 invalidates that token. With `auto` billing on the `deepseek-account` route, the operation sends the account token when that entry exists and a token is released. Every other `auto` operation, including one in an account conversation without a sign-in or a token, sends the key under the `apiKeyEnv` of the active `@deepseek-ai/dsh-llm-deepseek-api-key` entry for `deepseek-official`, resolved with that package's own resolver (including `DEEPSEEK_BASE_URL`), to the origin of that route's base URL with `/v1/tools`; without that entry, `DEEPSEEK_API_KEY` goes to `https://api.deepseek.com/v1/tools`. With `auto` billing on a route other than the two DeepSeek routes, or outside a Session, an operation without a configured key sends the account token instead, so a signed-in user without a key keeps web tools in conversations on other model providers; on the `deepseek-official` route it never sends the token, because that conversation bills the API key. Sending the API key in a signed-out account conversation keeps web tools available there. A user with only `DEEPSEEK_API_KEY`, including every headless, SDK, and ACP run, therefore searches and fetches by default, and a gateway or internal deployment set through the model provider's base URL serves web access at the same origin. A missing credential makes the capability not ready, and an operation fails with `WEB_PROVIDER_CREDENTIAL_MISSING` and guidance for its billing that names the account sign-in, the Models page and the reference, and the billing field. A mounted route entry whose settings its resolver rejects is not treated as absent: an operation that needs that route is not ready and fails with `WEB_PROVIDER_MISCONFIGURED` before reading the credential that depends on that route, without trying later sources or sending the request, so a broken gateway setting never redirects requests to the official endpoint.
|
||||
The account credential is the one `ctx.deepseekAccount` releases for the dispatch endpoint under the origin of the base URL the mounted `deepseek-account` route publishes through `ctx.llm.providerCredential()`, with `/v1/tools`; without that route, the origin `DEEPSEEK_BASE_URL` names is used. An HTTP 401 invalidates that credential. With `auto` billing on the `deepseek-account` route, the operation sends the account credential when that route is mounted and a credential is released. Every other `auto` operation, including one in an account conversation without a sign-in or a credential, sends the key the mounted `deepseek-official` route publishes, which the route resolves under its `apiKeyEnv` (its base URL includes `DEEPSEEK_BASE_URL`), to the origin of that route's base URL with `/v1/tools`; without that route, `DEEPSEEK_API_KEY` goes to `https://api.deepseek.com/v1/tools`. With `auto` billing on a route other than the two DeepSeek routes, or outside a Session, an operation without a configured key sends the account token instead, so a signed-in user without a key keeps web tools in conversations on other model providers; on the `deepseek-official` route it never sends the token, because that conversation bills the API key. Sending the API key in a signed-out account conversation keeps web tools available there. A user with only `DEEPSEEK_API_KEY`, including every headless, SDK, and ACP run, therefore searches and fetches by default, and a gateway or internal deployment set through the model provider's base URL serves web access at the same origin. A missing credential makes the capability not ready, and an operation fails with `WEB_PROVIDER_CREDENTIAL_MISSING` and guidance for its billing that names the account sign-in, the Models page and the reference, and the billing field. A mounted route whose configuration does not resolve is not treated as absent: an operation that needs that route is not ready and fails with `WEB_PROVIDER_MISCONFIGURED` before reading the credential that depends on that route, without trying later sources or sending the request, so a broken gateway setting never redirects requests to the official endpoint.
|
||||
|
||||
A capability whose YAML sets a non-empty `searchBaseURL` or `searchApiKeyEnv` (`fetchBaseURL` or `fetchApiKeyEnv` for Fetch) instead, whatever its billing, always sends the key under its `*ApiKeyEnv` (`DEEPSEEK_API_KEY` when unset) to its `*BaseURL` (the official base when unset) and never the account token, so an intranet or third-party endpoint receives only the key chosen for it. Each capability has its own fields because a deployment can serve search and fetch from different gateways. These fields are YAML-only, and an empty value counts as unset. Stored values of fields outside the schema, including `baseURL`, `apiKeyEnv`, and `apiKey`, load without schema errors and have no effect.
|
||||
|
||||
The [credential helpers](../../../../packages/llm/llm-deepseek/src/credential.ts) of `@deepseek-ai/dsh-llm-deepseek` read and validate API keys, check key presence, and release account tokens for the DeepSeek model routes, Messages search, and the Search and Fetch APIs, so every DeepSeek request reads the credential store the same way; the account model route, Messages search, and the Search and Fetch APIs also invalidate the token that an HTTP 401 rejects. Shipped profiles need no per-profile credential override, because the API-key path works wherever `DEEPSEEK_API_KEY` or the DeepSeek API-key route has a key.
|
||||
The DeepSeek model routes publish the credential they send through `ctx.llm.providerCredential()` ([route credentials](2026-11-10-llm-route-credential-seam.md)): the API-key route its key under `apiKeyEnv`, the account route the credential `ctx.deepseekAccount` releases for a destination. Messages search and the Search and Fetch APIs read those publications instead of provider configuration, and read `DEEPSEEK_API_KEY` and own keys through the reference helpers of `dsh-credentials`, so every DeepSeek request reads the credential store the same way; a credential whose grant offers invalidation is invalidated after an HTTP 401. Shipped profiles need no per-profile credential override, because the API-key path works wherever `DEEPSEEK_API_KEY` or the DeepSeek API-key route has a key.
|
||||
|
||||
### Defaults and stored selections
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ Search 与 Fetch API 读取同一个 `web-deepseek-api` namespace,并各自解
|
||||
|
||||
Search 与 Fetch 各有一个计费方式设置 `web-deepseek-api.searchBilling` 或 `fetchBilling`,设置页在选中的 API 下方以**计费方式**下拉框编辑它。默认值 `auto` 跟随会话的 DeepSeek 凭据;`account` 只发送已登录账号的令牌,`api-key` 只发送 API 密钥,都不回退到另一种凭据。会话的路由是发起会话最近一次请求上下文的 `provider`,账号退出登录读取的也是它;`ready()` 使用正在准备的模型请求的路由,因此就绪判断与执行解析出相同的方案。
|
||||
|
||||
账号令牌是 `ctx.deepseekAccount` 为模型提供方目录列出的入口根部活动 `@deepseek-ai/dsh-llm-deepseek-account` Loader 条目的 origin 加 `/v1/tools` 下的请求端点给出的令牌;没有该条目时使用该路由默认基础地址的 origin。HTTP 401 会作废该令牌。`auto` 计费在 `deepseek-account` 路由上,若存在该条目且取得令牌,操作发送账号令牌。其他所有 `auto` 操作,包括账号会话中没有登录或没有令牌的操作,都把 `deepseek-official` 的活动 `@deepseek-ai/dsh-llm-deepseek-api-key` 条目的 `apiKeyEnv` 下的密钥(用该包自己的解析函数解析,包括 `DEEPSEEK_BASE_URL`)发往该路由基础地址的 origin 加 `/v1/tools`;没有该条目时,把 `DEEPSEEK_API_KEY` 发往 `https://api.deepseek.com/v1/tools`。`auto` 计费在两个 DeepSeek 路由之外的路由上或会话之外,没有配置密钥的操作改为发送账号令牌,因此已登录但没有密钥的用户在其他模型提供方的会话中仍可使用网页工具;在 `deepseek-official` 路由上从不发送令牌,因为该会话按 API 密钥计费。未登录的账号会话发送 API 密钥,网页工具因此在其中仍然可用。因此只有 `DEEPSEEK_API_KEY` 的用户(包括所有 headless、SDK 与 ACP 运行)默认即可搜索和抓取,通过模型提供方基础地址设置的网关或内部部署也在同一 origin 上提供 Web 访问。缺少凭据时,该能力未就绪,操作以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败,指引信息按计费方式点名账号登录、模型页面与该引用,以及计费方式字段。已挂载、但其解析函数拒绝其设置的路由条目不视为不存在:需要该路由的操作未就绪,并在读取依赖该路由的凭据前以 `WEB_PROVIDER_MISCONFIGURED` 失败,不再尝试后续来源,也不发送请求,因此网关设置出错时请求不会被改发到官方端点。
|
||||
账号凭据是 `ctx.deepseekAccount` 为请求端点释放的凭据,端点位于已挂载的 `deepseek-account` 路由通过 `ctx.llm.providerCredential()` 发布的基础地址的 origin 加 `/v1/tools` 下;没有该路由时使用 `DEEPSEEK_BASE_URL` 所指的 origin。HTTP 401 会作废该凭据。`auto` 计费在 `deepseek-account` 路由上,若该路由已挂载且释放出凭据,操作发送账号凭据。其他所有 `auto` 操作,包括账号会话中没有登录或没有凭据的操作,都把已挂载的 `deepseek-official` 路由发布的密钥(由该路由按其 `apiKeyEnv` 解析,其基础地址包含 `DEEPSEEK_BASE_URL`)发往该路由基础地址的 origin 加 `/v1/tools`;没有该路由时,把 `DEEPSEEK_API_KEY` 发往 `https://api.deepseek.com/v1/tools`。`auto` 计费在两个 DeepSeek 路由之外的路由上或会话之外,没有配置密钥的操作改为发送账号令牌,因此已登录但没有密钥的用户在其他模型提供方的会话中仍可使用网页工具;在 `deepseek-official` 路由上从不发送令牌,因为该会话按 API 密钥计费。未登录的账号会话发送 API 密钥,网页工具因此在其中仍然可用。因此只有 `DEEPSEEK_API_KEY` 的用户(包括所有 headless、SDK 与 ACP 运行)默认即可搜索和抓取,通过模型提供方基础地址设置的网关或内部部署也在同一 origin 上提供 Web 访问。缺少凭据时,该能力未就绪,操作以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败,指引信息按计费方式点名账号登录、模型页面与该引用,以及计费方式字段。已挂载但配置无法解析的路由不视为不存在:需要该路由的操作未就绪,并在读取依赖该路由的凭据前以 `WEB_PROVIDER_MISCONFIGURED` 失败,不再尝试后续来源,也不发送请求,因此网关设置出错时请求不会被改发到官方端点。
|
||||
|
||||
在 YAML 中设置了非空 `searchBaseURL` 或 `searchApiKeyEnv`(Fetch 为 `fetchBaseURL` 或 `fetchApiKeyEnv`)的能力,则无论计费方式如何,始终把其 `*ApiKeyEnv`(未设置时为 `DEEPSEEK_API_KEY`)下的密钥发往其 `*BaseURL`(未设置时为官方基础地址),从不发送账号令牌,因此内网或第三方端点只收到为它选择的密钥。每个能力有自己的字段,因为一个部署可以由不同网关提供搜索和抓取。这些字段只能在 YAML 中设置,空值视为未设置。schema 之外字段的已保存值,包括 `baseURL`、`apiKeyEnv` 和 `apiKey`,可以加载而不产生 schema 错误,且不生效。
|
||||
|
||||
`@deepseek-ai/dsh-llm-deepseek` 的[凭据函数](../../../../packages/llm/llm-deepseek/src/credential.ts)为 DeepSeek 模型路由、Messages 搜索以及 Search 与 Fetch API 读取并校验 API 密钥、检查密钥是否存在、取得账号令牌,因此每个 DeepSeek 请求都以同一方式读取凭据库;账号模型路由、Messages 搜索以及 Search 与 Fetch API 还会作废被 HTTP 401 拒绝的令牌。内置配置不需要按 profile 覆盖凭据,因为只要 `DEEPSEEK_API_KEY` 或 DeepSeek API 密钥路由有密钥,API 密钥路径就能工作。
|
||||
DeepSeek 模型路由通过 `ctx.llm.providerCredential()` 发布自己发送的凭据([路由凭据](2026-11-10-llm-route-credential-seam.zh.md)):API 密钥路由发布其 `apiKeyEnv` 下的密钥,账号路由发布 `ctx.deepseekAccount` 为目标地址释放的凭据。Messages 搜索以及 Search 与 Fetch API 读取这些发布的凭据而不读取提供方配置,并通过 `dsh-credentials` 的引用函数读取 `DEEPSEEK_API_KEY` 和单独配置的密钥,因此每个 DeepSeek 请求都以同一方式读取凭据库;授权提供失效操作的凭据会在 HTTP 401 后被作废。内置配置不需要按 profile 覆盖凭据,因为只要 `DEEPSEEK_API_KEY` 或 DeepSeek API 密钥路由有密钥,API 密钥路径就能工作。
|
||||
|
||||
### 默认值与已保存的选择
|
||||
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@
|
||||
en: 0676f301d5aec364
|
||||
zh: 0ef43eba7bfe2f01
|
||||
/agent-note-authentication-provider-integration/testing:
|
||||
en: c783cb006f9962a4
|
||||
zh: 79bf36b25665e49c
|
||||
en: 378fd2b4f826a453
|
||||
zh: bf53037b7bdaa44e
|
||||
/agent-note-authentication-provider-integration/alternatives-considered:
|
||||
en: 868953274abd81e8
|
||||
zh: 1b2890de876a6db6
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ Desktop's parent owns a fresh private credential per Host process and delivers i
|
||||
| Provider registration | Only built-in BrowserAuth supplied network identity | Ordered independent verifiers select one live Peer; scope unload, verifier failure, and cancellation are covered by [authentication tests](../../../../packages/client/connection/tests/authentication.host.spec.ts) |
|
||||
| HTTP and upgrade integration | Consumers called Connection admission | Route auth supplies the Peer once; real [Provider transport tests](../../../../packages/api/gateway/tests/authentication-provider.host.spec.ts) exercise both carriers |
|
||||
| Server isolation | Route tables were per instance; index injection was root-wide | All five events use the WebServer subject; [server](../../../../packages/host/webserver/tests/event-isolation.host.spec.ts) and [application](../../../../packages/bundle/web-app/tests/event-isolation.host.spec.ts) tests cover ordinary and global listeners and a preserved external Host |
|
||||
| Browser OAuth return | The callback validated state and PKCE | The scoped pre-route callback retains validation and accepts real cross-site navigation; [account tests](../../../../packages/credentials/deepseek-account/tests/account.spec.ts) retain wrong-Host and SSH-forwarding coverage, and [Chromium](../../../../apps/web/tests/account-login.e2e.ts) asserts the actual Fetch Metadata header |
|
||||
| Browser OAuth return | The callback validated state and PKCE | The scoped pre-route callback retains validation and accepts real cross-site navigation; [account tests](../../../../packages/account/deepseek-account/tests/account.spec.ts) retain wrong-Host and SSH-forwarding coverage, and [Chromium](../../../../apps/web/tests/account-login.e2e.ts) asserts the actual Fetch Metadata header |
|
||||
| Startup output | WebApp printed/opened one Connection-produced login URL | [Startup tests](../../../../packages/bundle/web-app/tests/startup.host.spec.ts) cover ordered entries, first eligible opening, empty lists, readiness and SSH suppression |
|
||||
| Desktop runtime consumers | A tokenized ready URL was exchanged for a Cookie | [Runtime smoke tests](../../../../apps/desktop/tests/smoke-runtime.spec.ts) use the private Cookie on the HTTP probes; [built Remote tests](../../../../packages/api/remotes/tests/built-lib.e2e.ts) collect the current Provider's entry and pass the admitted Peer |
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ Desktop 父进程为每个 Host 进程持有新私有凭据,并在 ready 前
|
||||
| Provider 注册 | 只有内置 BrowserAuth 提供网络身份 | 有序独立验证器选择一个存活 Peer;[认证测试](../../../../packages/client/connection/tests/authentication.host.spec.ts)覆盖作用域卸载、验证故障和取消 |
|
||||
| HTTP 与 upgrade 接入 | 消费者调用 Connection 准入 | 路由 auth 一次提供 Peer;真实 [Provider 传输测试](../../../../packages/api/gateway/tests/authentication-provider.host.spec.ts)覆盖两种载体 |
|
||||
| 服务器隔离 | 路由表按实例持有,index 注入覆盖 root | 五个事件均使用 WebServer subject;[服务器](../../../../packages/host/webserver/tests/event-isolation.host.spec.ts)和[应用](../../../../packages/bundle/web-app/tests/event-isolation.host.spec.ts)测试覆盖普通/global 监听器及保留的外部 Host |
|
||||
| 浏览器 OAuth 返回 | 回调校验 state 与 PKCE | 有作用域的前置回调保留校验,并接受真实跨站导航;[账号测试](../../../../packages/credentials/deepseek-account/tests/account.spec.ts)保留错误 Host 和 SSH 转发覆盖,[Chromium](../../../../apps/web/tests/account-login.e2e.ts)断言实际 Fetch Metadata header |
|
||||
| 浏览器 OAuth 返回 | 回调校验 state 与 PKCE | 有作用域的前置回调保留校验,并接受真实跨站导航;[账号测试](../../../../packages/account/deepseek-account/tests/account.spec.ts)保留错误 Host 和 SSH 转发覆盖,[Chromium](../../../../apps/web/tests/account-login.e2e.ts)断言实际 Fetch Metadata header |
|
||||
| 启动输出 | WebApp 打印/打开一个 Connection 生成的登录 URL | [启动测试](../../../../packages/bundle/web-app/tests/startup.host.spec.ts)覆盖按序入口、首个可打开项、空列表、就绪和 SSH 抑制 |
|
||||
| Desktop runtime 消费者 | 以带 Token 的 ready URL 交换 Cookie | [Runtime smoke 测试](../../../../apps/desktop/tests/smoke-runtime.spec.ts)在 HTTP 探针中使用私有 Cookie;[产物 Remote 测试](../../../../packages/api/remotes/tests/built-lib.e2e.ts)收集当前 Provider 入口,并传递准入 Peer |
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Bilingual-pair consistency record for 2026-11-10-llm-route-credential-seam.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-10-llm-route-credential-seam.md
|
||||
/agent-note-route-credentials-deepseek-model-routes-publish-the-credential-consumers-reuse:
|
||||
en: d11883f28d5cdd99
|
||||
zh: 860795ae4d93c317
|
||||
/agent-note-route-credentials-deepseek-model-routes-publish-the-credential-consumers-reuse/problem:
|
||||
en: 9665e1879893fe76
|
||||
zh: 9da30ad0be6fc38d
|
||||
/agent-note-route-credentials-deepseek-model-routes-publish-the-credential-consumers-reuse/decision:
|
||||
en: aaa2d2c7202408d4
|
||||
zh: 134987da042fd07b
|
||||
/agent-note-route-credentials-deepseek-model-routes-publish-the-credential-consumers-reuse/alternatives-considered:
|
||||
en: d6b2de393add9887
|
||||
zh: b5351f9a49387bd6
|
||||
/agent-note-route-credentials-deepseek-model-routes-publish-the-credential-consumers-reuse/consequences:
|
||||
en: df942606f0d31fa5
|
||||
zh: cb1f21dd7f60ab7f
|
||||
@@ -0,0 +1,47 @@
|
||||
# Agent Note: Route credentials - DeepSeek model routes publish the credential consumers reuse
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-10-llm-route-credential-seam.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Several packages shared one DeepSeek credential without an owner. `@deepseek-ai/dsh-llm-deepseek`, the protocol transport, exported helpers that read `ctx.credentials`, the launch environment, and `ctx.deepseekAccount`, so the transport depended on both credential services although it only sends the headers a route gives it. The two route plugins resolved their credentials through those helpers and threw their own missing-credential failures from inside `resolveAuth`. The Search and Fetch API providers re-derived each route's base URL and key reference from the Loader entry of the route package with that package's own config resolver, and Messages search hard-coded the account route id, so both web packages depended on `llm-deepseek`, on both route plugins, and on the Loader. The account service, which sits below every consumer, owned Agent cancellation after sign-out and lived in the `credentials/` group beside the credential store it only uses. A change to how one route authenticates touched the transport, both web providers, and their tests.
|
||||
|
||||
## Decision
|
||||
|
||||
`@deepseek-ai/dsh-llm` owns the Service Definition. `LlmAdapter.providerCredential(provider)` publishes a `ProviderCredential`: the route's `kind` (merge-extensible, with `api-key` and `account` declared), its resolved `baseURL`, an optional credential `reference` for diagnostics, `configured(endpoint)` for presence checks that neither validate the credential nor contact the destination, and `resolve(endpoint, signal)` returning a `ProviderCredentialGrant` with the protocol `headers`, the bare `value` for destinations that render it differently, an optional `reject()` for HTTP 401, and an optional `revoked` signal that aborts when the owner withdraws the credential while requests carry it. `LlmRuntime.providerCredential(provider)` forwards to the owning adapter; an unregistered route answers `undefined`, and a route whose configuration does not resolve propagates the adapter's failure. The adapter reads one configuration generation per call, as it does per model request.
|
||||
|
||||
`@deepseek-ai/dsh-llm-deepseek` reads no credential. `DeepSeekAdapterOptions.resolveAuth(connection, endpoint)` returns the grant or `undefined`; `missingCredential(connection, provider)` names the failure of a request without one, `MISSING_CREDENTIAL` by default; `credential` declares the published kind, reference, and presence check. The transport runs each model request and its file operations under the grant's `revoked` signal and hands the resulting failure to the provider's failure callback, which names it. The listing cache scopes by endpoint and a hash of the credential headers.
|
||||
|
||||
The route plugins own credentials. `llm-deepseek-api-key` reads its key through `resolveCredentialRef` and `credentialRefConfigured`, new in `@deepseek-ai/dsh-credentials`, which treat a mounted credentials service as authoritative and read the launch environment only without one; it publishes kind `api-key` with the `apiKeyEnv` reference and releases the key only for destinations under the origin of its base URL. `llm-deepseek-account` reads `ctx.deepseekAccount.resolveRequestCredential(endpoint)`, maps HTTP 401 to `ACCOUNT_TOKEN_INVALID` and quota failures to `ACCOUNT_QUOTA`, fails without a credential as `ACCOUNT_SIGN_IN_REQUIRED`, publishes kind `account`, and owns the sign-out policy: it cancels its running Agents on `deepseek-account/signed-out` and registers a running-task report with the account service. A request in flight at sign-out ends with its grant's `revoked` signal and fails as `ACCOUNT_SIGN_IN_REQUIRED`, and its failure callback cancels the same Agents, so a request that outlives the plugin still ends its turn with the signed-out cause.
|
||||
|
||||
`@deepseek-ai/dsh-deepseek-account` releases request credentials. `resolveRequestCredential(url)` returns the `x-dsh-auth-token` header, the bare token, a `reject()` that removes the grant while it still matches and contains storage failures, and a `revoked` signal the service aborts at each sign-out after the `deepseek-account/signed-out` listeners have returned; `registerRunningTaskReport(report)` feeds `hasRunningAccountTasks()`. The service inspects no Agents and depends on neither `dsh-agent` nor `dsh-llm`. The package lives in the `packages/account/` group under its unchanged name.
|
||||
|
||||
The web providers consume publications. `web-deepseek-api` builds each operation's ordered sources from `ctx.llm.providerCredential('deepseek-official')` and `providerCredential('deepseek-account')`: a route source sends an `api-key` grant's value as a bearer token and any other kind's headers unchanged, and invalidates through the grant's `reject()`. Under each route id it accepts only the kind that route publishes, `api-key` as `deepseek-official` and `account` as `deepseek-account`, so billing by route id never sends the other kind. Without the API-key route it reads `DEEPSEEK_API_KEY` through the reference helpers; without the account route it asks the account service for the origin `DEEPSEEK_BASE_URL` names. `web-search-deepseek` uses the account credential of the initiating Session's route when that route publishes kind `account` and the search endpoint has the origin of the route's base URL, and the reference helpers otherwise; it does not request an account credential published for another origin. Both web consumers contain a failed `reject()`, so the HTTP rejection stays the reported error for every credential kind. Both run their request under the grant's `revoked` signal and report a request it ended as `WEB_PROVIDER_ERROR` with sign-in guidance, keeping `WEB_ABORTED` for the caller's cancellation. Neither web package depends on `llm-deepseek`, the route plugins, or the Loader, and `web-search-deepseek` no longer depends on the account service.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
**A `deepseek-auth` package holding the credential seam.** The seam needs a Service Definition only, no Cordis service, and that one Definition role belongs beside `LlmAdapter`; a package for an interface adds a dependency without an owner of behavior.
|
||||
|
||||
**A credential fingerprint in the published credential.** Consumers only send requests, so they need headers and a value; cache scoping by credential is the adapter's own concern, which the listing cache meets by hashing the headers it sends.
|
||||
|
||||
**A `credentials-env` provider instead of reference helpers.** A provider that reads the environment would change which composition is authoritative for every consumer; the helpers keep the launch-environment fallback local to the consumers that need it, so such a provider remains an independent option.
|
||||
|
||||
**The account service's inference origin for the web fallback without the account route.** Routing that fallback through `DEEPSEEK_BASE_URL` keeps the keyless billing snapshot and every documented deployment unchanged; the account service still refuses every origin but its own.
|
||||
|
||||
**Moving the account package into `identity/`.** That group defines anonymous, user-independent ids; a signed-in account is the opposite, so it gets a group of its own.
|
||||
|
||||
**Keeping the route plugin's sign-out listener until its tasks end.** Unloading the route then waits for a running turn: disabling the plugin blocks, and every other settings write queues behind that reload, for as long as the turn runs.
|
||||
|
||||
**Cancelling the route's tasks when the route unloads.** A configuration reload or a plugin update would stop turns that no sign-out touched.
|
||||
|
||||
**Returning the sign-out policy to the account service.** The service would again inspect Agents and know route ids, the dependencies this decision removes.
|
||||
|
||||
**Keeping the route's listener or report registered after its plugin unloads.** A registration that outlives the plugin that made it breaks the rule that registrations are effects of their owner, and leaves code of an unloaded plugin running in another scope for as long as the task runs.
|
||||
|
||||
## Consequences
|
||||
|
||||
Adding a credential kind, or a consumer of a route's credential, touches one route plugin or one consumer, not the transport. The transport, the web providers, and the account service lose their cross-dependencies, and `hasRunningAccountTasks()` depends on a registered report rather than on Agents the account service can see. Consumers that construct `DeepSeekRequestAuth` supply a `value`; the removed helpers and the route plugins' config exports are gone, and the [upgrade guide](../../../../docs/upgrade-guide/v0.2.2-rc.3/llm-route-credential/guide.md) lists the replacements. A route's configuration failure reaches web consumers through `providerCredential()` as a thrown error, which they report as `WEB_PROVIDER_MISCONFIGURED`.
|
||||
|
||||
A sign-out ends the in-flight model, Files, Search, and Fetch requests that carry the account token, including requests no Agent turn owns, such as a model request outside a turn or an account-billed web search; the account listing request keeps its own deadline. The signal supplements the Agent cancellation of the [account sign-out decision](2026-09-17-account-provider-signout.md), which rejected a login-level signal as a duplicate of that chain: the chain reaches a request only through a mounted listener and a running Agent turn. While the account route is disabled, a task it started that still runs is not reported to the sign-out confirmation, and a sign-out ends it only through a model request in flight. A credential released by an account service that has since been replaced is not withdrawn by the replacement's sign-out; the route plugin's listener still cancels Agent turns.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Agent Note: Route credentials - DeepSeek model routes publish the credential consumers reuse
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-10-llm-route-credential-seam.md) | 中文
|
||||
|
||||
## 问题
|
||||
|
||||
多个包共用同一份 DeepSeek 凭据,却没有所有者。协议传输层 `@deepseek-ai/dsh-llm-deepseek` 导出读取 `ctx.credentials`、启动环境和 `ctx.deepseekAccount` 的辅助函数,因此尽管传输层只发送路由交给它的请求头,它仍依赖两个凭据服务。两个路由插件通过这些函数解析凭据,并在 `resolveAuth` 内部抛出各自的凭据缺失错误。Search 与 Fetch API 提供方用路由包自己的配置解析函数,从路由包的 Loader 条目重新推导每条路由的基础地址和密钥引用,Messages 搜索则硬编码账号路由 id,因此两个 Web 包都依赖 `llm-deepseek`、两个路由插件和 Loader。位于所有消费方之下的账号服务拥有退登后的 Agent 取消逻辑,并和它仅仅使用的凭据库一起放在 `credentials/` 组。改变一条路由的鉴权方式要同时触及传输层、两个 Web 提供方及其测试。
|
||||
|
||||
## 决策
|
||||
|
||||
`@deepseek-ai/dsh-llm` 拥有 Service Definition。`LlmAdapter.providerCredential(provider)` 发布一个 `ProviderCredential`:路由的 `kind`(可合并扩展,已声明 `api-key` 与 `account`)、解析后的 `baseURL`、用于诊断的可选凭据 `reference`、不校验凭据、不联系目的地的存在性检查 `configured(endpoint)`,以及返回 `ProviderCredentialGrant` 的 `resolve(endpoint, signal)`;授权包含协议 `headers`、供以其他方式呈现凭据的目标使用的裸 `value`、可选的 HTTP 401 `reject()`,以及可选的 `revoked` 信号;所有者在请求仍携带凭据时撤回凭据,该信号即中止。`LlmRuntime.providerCredential(provider)` 转发给拥有该路由的适配器;未注册的路由回答 `undefined`,配置无法解析的路由则传播适配器的失败。适配器每次调用读取一代配置,与每次模型请求相同。
|
||||
|
||||
`@deepseek-ai/dsh-llm-deepseek` 不读取任何凭据。`DeepSeekAdapterOptions.resolveAuth(connection, endpoint)` 返回授权或 `undefined`;`missingCredential(connection, provider)` 命名没有凭据时请求的失败,默认为 `MISSING_CREDENTIAL`;`credential` 声明发布的种类、引用和存在性检查。传输层让每次模型请求及其文件操作受授权的 `revoked` 信号约束,并把由此产生的失败交给提供方的失败回调命名。列表缓存以端点和凭据请求头的哈希划分作用域。
|
||||
|
||||
路由插件拥有凭据。`llm-deepseek-api-key` 通过 `@deepseek-ai/dsh-credentials` 新增的 `resolveCredentialRef` 和 `credentialRefConfigured` 读取密钥,二者把已挂载的凭据服务视为权威,仅在没有该服务时读取启动环境;它发布种类 `api-key` 并附带 `apiKeyEnv` 引用,且只对其基础地址所在 origin 下的目的地释放密钥。`llm-deepseek-account` 读取 `ctx.deepseekAccount.resolveRequestCredential(endpoint)`,把 HTTP 401 映射为 `ACCOUNT_TOKEN_INVALID`、配额失败映射为 `ACCOUNT_QUOTA`,没有凭据时以 `ACCOUNT_SIGN_IN_REQUIRED` 失败,发布种类 `account`,并拥有退登策略:在 `deepseek-account/signed-out` 时取消其运行中的 Agent,并向账号服务注册运行中任务报告。退登时在途的请求随其授权的 `revoked` 信号结束,以 `ACCOUNT_SIGN_IN_REQUIRED` 失败;它的失败回调会取消同一批 Agent,因此比插件存活更久的请求仍会以退登原因结束其回合。
|
||||
|
||||
`@deepseek-ai/dsh-deepseek-account` 释放请求凭据。`resolveRequestCredential(url)` 返回 `x-dsh-auth-token` 请求头、裸 token、`reject()` 和 `revoked` 信号;`reject()` 仅在授权仍一致时删除它并隔离存储失败,`revoked` 由服务在每次退登时、`deepseek-account/signed-out` 的监听器返回之后中止。`registerRunningTaskReport(report)` 为 `hasRunningAccountTasks()` 提供答案。该服务不检查任何 Agent,也不依赖 `dsh-agent` 或 `dsh-llm`。包以不变的名字位于 `packages/account/` 组。
|
||||
|
||||
Web 提供方消费这些发布的凭据。`web-deepseek-api` 从 `ctx.llm.providerCredential('deepseek-official')` 和 `providerCredential('deepseek-account')` 构造每次操作的有序凭据来源:路由来源把 `api-key` 授权的值作为 Bearer 令牌发送,其他种类的请求头原样发送,并通过授权的 `reject()` 作废。每个路由 id 下只接受该路由发布的种类(`deepseek-official` 下为 `api-key`,`deepseek-account` 下为 `account`),因此按路由 id 计费不会发出另一种凭据。没有 API 密钥路由时,它通过引用函数读取 `DEEPSEEK_API_KEY`;没有账号路由时,它向账号服务索取发往 `DEEPSEEK_BASE_URL` 所指 origin 的凭据。`web-search-deepseek` 在发起会话的路由发布 `account` 种类且搜索端点与该路由的基础地址同源时使用其账号凭据,否则使用引用函数;为其他 origin 发布的账号凭据不会被索取。两个 Web 消费方都会隔离失败的 `reject()`,因此对任何凭据种类,报告的都是 HTTP 拒绝。二者都让请求受授权的 `revoked` 信号约束,把被它结束的请求报告为带登录指引的 `WEB_PROVIDER_ERROR`,`WEB_ABORTED` 仍只表示调用方取消。两个 Web 包都不再依赖 `llm-deepseek`、路由插件或 Loader,`web-search-deepseek` 也不再依赖账号服务。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
**用一个 `deepseek-auth` 包承载凭据 seam。** 该 seam 只需要 Service Definition,不需要 Cordis 服务,而这一个 Definition 角色应与 `LlmAdapter` 放在一起;为一个接口建包只会增加一个没有行为所有者的依赖。
|
||||
|
||||
**在发布的凭据中加入凭据指纹。** 消费方只负责发送请求,因此只需要请求头和值;按凭据划分缓存作用域是适配器自己的事,列表缓存通过哈希它发送的请求头即可满足。
|
||||
|
||||
**用 `credentials-env` 提供方代替引用函数。** 读取环境的提供方会改变每个消费方眼中哪个组合具有权威性;引用函数把启动环境后备保留在需要它的消费方本地,使这样的提供方仍是独立的选项。
|
||||
|
||||
**没有账号路由时的 Web 后备使用账号服务的推理 origin。** 让该后备经由 `DEEPSEEK_BASE_URL` 可保持无密钥计费快照和所有已记录部署不变;账号服务仍拒绝除自身 origin 以外的一切来源。
|
||||
|
||||
**把账号包并入 `identity/`。** 该组定义匿名、不识别用户的 id;已登录账号与之相反,因此单独成组。
|
||||
|
||||
**让路由插件的退登监听保留到其任务结束。** 这样卸载路由要等待运行中的回合:停用插件会被阻塞,其他设置写入也排在这次重载之后,直到回合结束。
|
||||
|
||||
**路由卸载时取消其任务。** 配置重载或插件更新会停掉与退登无关的回合。
|
||||
|
||||
**把退登策略放回账号服务。** 账号服务将重新检查 Agent 并认识路由 id,而这正是本决策去掉的依赖。
|
||||
|
||||
**插件卸载后仍保留路由的监听或报告注册。** 比注册它的插件存活更久的注册违反“注册是其所有者的 effect”这一规则,并让已卸载插件的代码在任务运行期间留在其他作用域里。
|
||||
|
||||
## 后果
|
||||
|
||||
新增凭据种类或路由凭据的消费方只触及一个路由插件或一个消费方,而不是传输层。传输层、Web 提供方和账号服务之间的交叉依赖消失,`hasRunningAccountTasks()` 依赖注册的报告而非账号服务可见的 Agent。构造 `DeepSeekRequestAuth` 的消费方需提供 `value`;被移除的辅助函数和路由插件的配置导出不复存在,[升级指南](../../../../docs/upgrade-guide/v0.2.2-rc.3/llm-route-credential/guide.zh.md)列出了替代方案。路由的配置失败通过 `providerCredential()` 以抛出错误的形式到达 Web 消费方,它们将其报告为 `WEB_PROVIDER_MISCONFIGURED`。
|
||||
|
||||
退登会结束携带账号 token 的在途模型、Files、Search 与 Fetch 请求,包括不属于任何 Agent 回合的请求,例如回合之外的模型请求或按账号计费的 Web 搜索;账号列表请求仍只受自身期限约束。该信号是对[账号退登决策](2026-09-17-account-provider-signout.zh.md)中 Agent 取消链路的补充;那份决策以重复该链路为由否决了登录级信号,而该链路只能经由已挂载的监听和运行中的 Agent 回合到达请求。账号路由被停用期间,它此前启动且仍在运行的任务不会报告给退登确认,退登也只能通过在途的模型请求结束它。已被替换的账号服务释放的凭据不会被替换后服务的退登撤回;路由插件的监听仍会取消 Agent 回合。
|
||||
@@ -0,0 +1,19 @@
|
||||
# Bilingual-pair consistency record for 2026-11-13-ptc-output-truncation.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-13-ptc-output-truncation.md
|
||||
/agent-note-ptc-output-truncation-without-execution-cancellation:
|
||||
en: 781fba10ab5fcd45
|
||||
zh: 88276a5a9cdf8c19
|
||||
/agent-note-ptc-output-truncation-without-execution-cancellation/problem:
|
||||
en: a6430b7910bebaa2
|
||||
zh: dff6c3553e22283e
|
||||
/agent-note-ptc-output-truncation-without-execution-cancellation/decision:
|
||||
en: b24a08b0037adab4
|
||||
zh: 92fb390a0e460ba5
|
||||
/agent-note-ptc-output-truncation-without-execution-cancellation/alternatives-considered:
|
||||
en: 717295afe374b2e5
|
||||
zh: cf4fd1365169f9e3
|
||||
/agent-note-ptc-output-truncation-without-execution-cancellation/consequences:
|
||||
en: 420e2556a878b48a
|
||||
zh: bff5f63189562d57
|
||||
@@ -0,0 +1,25 @@
|
||||
# Agent Note: PTC output truncation without execution cancellation
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-13-ptc-output-truncation.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Stopping a program because its logs exceed the output budget can interrupt a sequence of external actions. Earlier effects remain, but the caller cannot tell which later actions ran. Repeating the program to obtain less output can repeat those effects. A full log budget can also hide a subsequent exception by replacing its kind with an output-limit failure.
|
||||
|
||||
## Decision
|
||||
|
||||
Captured output has bounded retention. Exhaustion preserves an ordered prefix, discards subsequent output and sets `outputTruncated`; it does not cancel execution or discard retained variables. Existing deadlines, cancellation, heap limits and control-message limits still apply. Finalization prioritizes the required completion value or bounded failure diagnostic within the combined payload budget. Truncated diagnostics preserve their failure kind. Required completion values remain lossless and fail if they cannot fit.
|
||||
|
||||
This supersedes only captured-output termination and diagnostic reclassification in [typed tool returns](../feature/2026-07-20-ptc-typed-tool-returns.md), and overflow-driven state disposal in [retained PTC](2026-09-23-best-effort-persistent-ptc.md). Those records still own lossless values and retained-state lifetime; [explicit output](2026-11-09-explicit-ptc-output.md) still owns inspection and image projection.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
**Terminate on output exhaustion.** It limits output production earlier, but turns a presentation limit into interrupted external work without rollback.
|
||||
|
||||
**Return success with a truncated completion value.** It violates the caller's requirement for complete JSON data. Only captured output and diagnostic text may be shortened.
|
||||
|
||||
## Consequences
|
||||
|
||||
Successful truncated runs remain successful tool results. Callers inspect current state for missing information instead of replaying completed actions. Output suppression does not bound allocations in argument evaluation or native code; existing resource controls retain that responsibility. Tests cover subsequent actions, retained variables, initialization, ordered images, byte limits and later exceptions, deadlines and cancellation.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Agent Note: PTC 输出截断不取消执行
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-13-ptc-output-truncation.md) | 中文
|
||||
|
||||
## 问题
|
||||
|
||||
因日志超出输出预算而停止程序,可能打断一系列外部动作。此前的效果仍然保留,但调用方无法判断后续哪些动作已经执行。为了减少输出而重跑程序,可能重复这些效果。日志预算耗尽还可能使后续异常被替换成输出超限失败,掩盖真实类型。
|
||||
|
||||
## 决策
|
||||
|
||||
捕获输出采用有界保留。预算耗尽时保留有序前缀,丢弃后续输出并设置 `outputTruncated`,但不取消执行或丢弃保留变量。原有截止时间、取消、堆限制和控制消息限制继续生效。最终结算在组合负载预算内优先保留必需完成值或有界失败诊断。截断诊断保留原来的失败类型。必需完成值保持无损,无法容纳时仍然失败。
|
||||
|
||||
本决策只取代[类型化工具返回值](../feature/2026-07-20-ptc-typed-tool-returns.zh.md)中的捕获输出超限终止和诊断重新分类,以及[保留状态 PTC](2026-09-23-best-effort-persistent-ptc.zh.md)中的超限清空状态规则。这些记录仍负责无损值和保留状态生命周期;[显式输出](2026-11-09-explicit-ptc-output.zh.md)仍负责检查展示与图片投影。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
**输出耗尽时终止。** 能更早限制输出生产,但将展示限制变成没有回滚的外部工作中断。
|
||||
|
||||
**截断完成值后返回成功。** 违反调用方对完整 JSON 数据的要求。只有捕获输出和诊断文本可以缩短。
|
||||
|
||||
## 后果
|
||||
|
||||
成功但输出截断的执行仍是成功工具结果。调用方读取当前状态以获取遗漏信息,不重放已完成动作。输出抑制不限制参数求值或原生代码中的分配,这仍由现有资源控制负责。测试覆盖后续动作、保留变量、初始化、有序图片、字节上限以及后续异常、截止到期和取消。
|
||||
@@ -0,0 +1,46 @@
|
||||
# Bilingual-pair consistency record for 2026-11-15-client-config-sync.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-15-client-config-sync.md
|
||||
/agent-note-browser-plugin-configuration-sync:
|
||||
en: 92fb1b35ccd50f2b
|
||||
zh: 732f665dd12d0feb
|
||||
/agent-note-browser-plugin-configuration-sync/problem:
|
||||
en: bad5854f1a21feb2
|
||||
zh: df9f2c62aa7f1c8c
|
||||
/agent-note-browser-plugin-configuration-sync/decision:
|
||||
en: a15c7c13f167e5ac
|
||||
zh: a15c7c13f167e5ac
|
||||
/agent-note-browser-plugin-configuration-sync/decision/design-principles:
|
||||
en: 1678ec9cbc83e49e
|
||||
zh: 1548e5e08774de78
|
||||
/agent-note-browser-plugin-configuration-sync/decision/plugin-authoring:
|
||||
en: 201c029071cc3812
|
||||
zh: 03a7245772a95b54
|
||||
/agent-note-browser-plugin-configuration-sync/decision/ownership:
|
||||
en: cb3e66c7d61b706b
|
||||
zh: a255f85e9c411db9
|
||||
/agent-note-browser-plugin-configuration-sync/decision/ordering:
|
||||
en: 5de9319764101262
|
||||
zh: 4a5c5c417cf36d8e
|
||||
/agent-note-browser-plugin-configuration-sync/decision/push-order:
|
||||
en: 5714f023a439e068
|
||||
zh: 5d5ec5d5847fb2d4
|
||||
/agent-note-browser-plugin-configuration-sync/decision/delivery:
|
||||
en: 9b8e644702108ef6
|
||||
zh: 0d4f551c6007e989
|
||||
/agent-note-browser-plugin-configuration-sync/decision/push-channel:
|
||||
en: 5596a32a26042882
|
||||
zh: fbeae944656b39ac
|
||||
/agent-note-browser-plugin-configuration-sync/decision/scope-existing-uses-the-mechanism-can-absorb:
|
||||
en: 79b8c68583897e07
|
||||
zh: 15a0f33fa494ec9a
|
||||
/agent-note-browser-plugin-configuration-sync/verification:
|
||||
en: b7ab56a86ef63b85
|
||||
zh: b5fc8aae610659fc
|
||||
/agent-note-browser-plugin-configuration-sync/alternatives-considered:
|
||||
en: 15ae5cd610d7208c
|
||||
zh: 5f25271e318dbfe1
|
||||
/agent-note-browser-plugin-configuration-sync/consequences:
|
||||
en: f85e3339246a9f84
|
||||
zh: 11cbff9deeb78f88
|
||||
@@ -0,0 +1,215 @@
|
||||
# Agent Note: Browser plugin configuration sync
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-15-client-config-sync.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Host plugin configuration updates live: when only volatile fields change, the Loader commits the references in place and emits `loader/volatile-update` without remounting the plugin. The browser has no matching path:
|
||||
|
||||
| Symptom | Cause |
|
||||
|---|---|
|
||||
| A browser plugin's `apply(ctx, config)` always receives an empty config | The page Loader creates entries with `name` only ([entries.ts](../../../../packages/client/modules/src/client/entries.ts)), so the row's `config` in cordis.yml never reaches the browser |
|
||||
| Packages that need Host configuration each work around it | Some write a page global through `webserver/index-inject`, which takes effect only at page load; others read runtime values through the `configForms` settings mirror |
|
||||
| The plugin-graph push channel does not meet the rules | `/plugins/events` is an `auth: 'anonymous'` route; the browser has two readers, `EventSource` and `__DSH_TRANSPORT__.fetch`, the latter never reconnects; the frame sequence has no one-complete-snapshot-per-generation rule |
|
||||
|
||||
## Decision
|
||||
|
||||
### Design principles
|
||||
|
||||
| Principle | Content |
|
||||
|---|---|
|
||||
| One Config | A plugin has one configuration type, in the package's `src/types.ts`, shared by the Host and Client faces; the schema lives only on the Host face. The browser exports no `Config` and validates no configuration |
|
||||
| Volatile only | The browser receives only the fields the Host schema declares volatile |
|
||||
| Secrets removed | `role('secret')` positions inside volatile fields, including inside volatile objects, arrays, and dictionaries, are removed on the Host and never sent. The Host face of `client/modules` implements this itself, without depending on `@deepseek-ai/dsh-settings` |
|
||||
| Plugins support live updates | A synced configuration change never remounts a browser plugin; the plugin reads references at operation time, or hands them to components as observable sources |
|
||||
| Equal values do nothing | Every layer compares with deep equality; equal values push, write, and notify nothing, and a reconnect snapshot equal to the current values causes no refresh |
|
||||
| What is not synced | Host-only ordinary fields, secrets, and per-browser preferences stay out of this path; values the page HTML pre-injects to avoid a first-paint flash, such as the theme, stay as they are |
|
||||
|
||||
### Plugin authoring
|
||||
|
||||
```ts ignore-check
|
||||
// src/types.ts — shared by both faces; types only
|
||||
import type { Volatile } from '@deepseek-ai/cordis'
|
||||
|
||||
/** Plugin configuration shared by the Host and Client faces. */
|
||||
export interface Config {
|
||||
/** Host-only ordinary field; never synced. */
|
||||
cacheDir: string
|
||||
/** Synced to the browser. */
|
||||
interactiveByDefault: Volatile<boolean>
|
||||
/** Synced as one value. */
|
||||
office: Volatile<{ maxBytes: number }>
|
||||
/** Volatile but `role('secret')`: stripped on the Host; reads as undefined in the browser. */
|
||||
apiKey?: Volatile<string>
|
||||
}
|
||||
```
|
||||
|
||||
```ts ignore-check
|
||||
// src/index.ts — Host face; the only schema
|
||||
export const Config: z<Config> = z.object({
|
||||
cacheDir: z.string().default('.cache'),
|
||||
interactiveByDefault: z.boolean().default(false).volatile(),
|
||||
office: z.object({ maxBytes: z.natural().default(8 << 20) }).volatile(),
|
||||
apiKey: z.string().role('secret').volatile(),
|
||||
})
|
||||
```
|
||||
|
||||
```ts ignore-check
|
||||
// src/client/index.ts — Client face; no Config export
|
||||
import type { SyncedConfig } from '@deepseek-ai/dsh-client-config/types'
|
||||
import type { Config } from '../types.ts'
|
||||
|
||||
export function apply(ctx: Context, config: SyncedConfig<Config>): void {
|
||||
// Every synced field may read undefined; the plugin decides what an absent value means.
|
||||
const tooLarge = (bytes: number) => bytes > (config.office.get()?.maxBytes ?? Number.POSITIVE_INFINITY)
|
||||
ctx.slots.register({
|
||||
name: 'demo.body',
|
||||
inject: (): DemoBodyInjected => ({ hooks: { interactiveByDefault: config.interactiveByDefault }, tooLarge }),
|
||||
}, DemoBody)
|
||||
}
|
||||
```
|
||||
|
||||
```tsx ignore-check
|
||||
// src/client/DemoBody.tsx — the renderer binds the injected source as useInteractiveByDefault
|
||||
export function DemoBody({ useInteractiveByDefault, tooLarge }: InjectFace<DemoBodyInjected>) {
|
||||
const interactive = useInteractiveByDefault(value => value)
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Types exported by the types-only package `@deepseek-ai/dsh-client-config/types`, which plugins depend on instead of the bootstrap Client Modules package; Client Modules implements them:
|
||||
|
||||
```ts ignore-check
|
||||
/** One synced field: Host-aligned `get()`, and directly an observable source for an injected hook. */
|
||||
export interface SyncedConfigRef<T> extends Volatile<T>, ObservableSnapshot<VolatileSnapshot<T>> {}
|
||||
|
||||
/** The Volatile fields of the shared Config type. */
|
||||
export type SyncedConfig<C> = {
|
||||
readonly [K in keyof C as NonNullable<C[K]> extends Volatile<unknown> ? K : never]-?:
|
||||
NonNullable<C[K]> extends Volatile<infer V> ? SyncedConfigRef<V | undefined> : never
|
||||
}
|
||||
```
|
||||
|
||||
`get` and `getSnapshot` return the same frozen snapshot: `get` matches how the Host reads a volatile reference, and `getSnapshot` with `subscribe` satisfy `ObservableSnapshot`, so the reference itself goes into `hooks` without renderer adaptation. The interface has no write operation; the implementing class stays private to Client Modules.
|
||||
|
||||
Components follow the [client rules](../../../../packages/client/AGENTS.md): the plugin injects field-level sources in a slot inject's `hooks` compartment, and the component reads them only through the renderer-bound `use<Name>`, never touching the source.
|
||||
|
||||
### Ownership
|
||||
|
||||
Runtime ownership stays in `client/modules`; the only new package is the types-only `@deepseek-ai/dsh-client-config` (empty `apply` on both faces). `client/modules` already follows Loader entries, composes the plugin graph, and creates entries in the browser; synced configuration is an input of an entry, so it owns this too:
|
||||
|
||||
| Face | Responsibility |
|
||||
|---|---|
|
||||
| Host (inside the `clientModules` service) | Listens to `loader/volatile-update` on each graph row's own plugin `ctx`; recomputes after the plugin fiber becomes ACTIVE (`internal/status`) or after entry reconciliation; reads the schema's top-level volatile field values from `fiber.effectiveConfig`, removes `role('secret')` positions by the schema, and compares the row's values with the last ones by deep equality, writing them into the graph row's `config` and republishing the graph only when they differ. A change of synced values alone rebuilds no combo artifact |
|
||||
| Client (inside the entry controller) | Keeps the latest synced values of every package that has appeared in the graph; each plugin activation receives a new configuration object (an empty object while the row has no values), as each Host fiber activation resolves new references; on each graph it compares fields as JSON and writes the changes into the current activation's object |
|
||||
| Client (`ctx.config` service) | Read-only: `resolveConfigByPackage<C>(packageName)` returns the object a package's current activation received, for reading another plugin's configuration; the object changes when the plugin is replaced, and the result is `undefined` while no activation runs |
|
||||
|
||||
Client constraints:
|
||||
|
||||
| Constraint | Content |
|
||||
|---|---|
|
||||
| Lazy creation | A field reference is created on first access and cached |
|
||||
| Instance identity | One object per activation, living as long as that activation; code replacement and a re-added row each produce a new object holding the latest values |
|
||||
| No `entry.update` | Synced configuration never takes the Loader update path, so it never triggers a remount, and the browser emits no `loader/volatile-update`; changes notify only through the field references' `subscribe` |
|
||||
| Atomic publication | One graph update sets every changed field before notifying their subscribers, as the Host commits every reference before emitting its event |
|
||||
| No value validation | The authoritative Host schema has already validated the values; the browser checks only that a row's `config` is an object when it parses the graph |
|
||||
| Delivery | The entry controller registers a prepended `internal/config` listener on the page Loader that returns the synced object for managed entries that export no schema; the Loader's interpolation runs inside it and cannot copy the object. A Client face that exports its own `Config` schema keeps Cordis's ordinary configuration, and fails to activate if its row also carries synced values |
|
||||
|
||||
### Ordering
|
||||
|
||||
Host consistency comes from two facts: the schema and the code belong to one module, and activation resolves the raw configuration with that schema; code reloads and configuration reloads run serially through Host hot reload, and only an ACTIVE instance receives volatile changes in place. The Client aligns with the second:
|
||||
|
||||
| Situation | Host | Client |
|
||||
|---|---|---|
|
||||
| Configuration changes while the instance runs | Commits every reference in place, then notifies | Writes into the current activation's object in place, notifying after every field is written |
|
||||
| Configuration changes while a replacement is queued and teardown has not begun | The instance is still ACTIVE and updates in place | Same |
|
||||
| Configuration changes after teardown begins | A non-ACTIVE instance no longer updates in place; the new instance resolves the latest configuration | Teardown releases the old activation, whose object receives no further writes; the new activation starts with the latest values |
|
||||
| The row is removed | The instance is destroyed and receives no configuration | Removal releases the activation; nothing is written while the row is absent from the graph |
|
||||
| The Host-side plugin instance is not ACTIVE | Not applicable | Values follow the Host's configuration as the Host plugin's own effective Config does, including when activation fails; an instance that has not activated yet publishes the values its own schema resolves from its raw configuration |
|
||||
|
||||
A plugin instance that has not activated yet (a new install, an upgrade, a code reload) publishes the values its own schema resolves from its raw configuration, so the graph frame that announces new browser code already carries values of the matching Host schema. Only an incompatible schema change during development (a renamed or removed field) can briefly give old browser code values it does not expect, until the rebuilt bundle arrives.
|
||||
|
||||
### Push order
|
||||
|
||||
When a Host plugin updates its configuration and then pushes other data to the browser, the browser should receive the configuration first. The order is ensured only at the mechanism level, through the steps below; it is not guaranteed in practice. Each stream's source takes its own number of asynchronous steps between a Host event and the item reaching the Gateway write queue, so a stream with fewer steps can be written first even when no plugin adds a wait of its own. Plugins must not rely on this order:
|
||||
|
||||
| Step | Approach |
|
||||
|---|---|
|
||||
| Host enqueue | `clientModules` registers its `loader/volatile-update` listener on the plugin ctx with prepend, so it puts the new graph into every follower queue synchronously before the plugin's own listeners run |
|
||||
| pluginEvents stream | `follow` yields increments from its own generator, with no delegated generator adding a step |
|
||||
| Gateway write | Each connection has one write queue; each stream's items enter it when the source produces them and are written in queue order, without waiting for the previous write to complete; when the queued bytes exceed `streamOutboxBytes`, the whole connection pauses reading every source |
|
||||
| Browser handling | WebSocket messages are handled in arrival order, and configuration writes complete synchronously while a graph frame is handled |
|
||||
|
||||
### Delivery
|
||||
|
||||
First-render values travel in the `__DSH_BOOT__` graph rows; later values travel in the plugin-events stream's `baseline` and `graph` frames, with no separate configuration frame. `@deepseek-ai/dsh-client-modules/types` exports the plugin graph's wire types. Only the owner receives configured values; every other Peer, such as a LiveShare viewer, receives in the boot graph and in every plugin-events frame the values each plugin's schema resolves from an empty Config, so the Host schema remains the only source of defaults and the owner's configured values stay on the Host; a row whose schema rejects an empty Config carries no values there. Remote access policies decide only whether a Peer may follow the graph.
|
||||
|
||||
### Push channel
|
||||
|
||||
`/plugins/events` becomes the authenticated Typert Remote stream `pluginEvents/follow`, which the browser consumes with `RemoteSnapshotStream`:
|
||||
|
||||
| Frame | Content | Browser handling |
|
||||
|---|---|---|
|
||||
| `baseline` | The complete plugin graph, including each row's synced configuration | Entry reconciliation |
|
||||
| `graph` | The complete plugin graph after a structural or synced-configuration change | Entry reconciliation |
|
||||
| `rebuilt` | `{ id, rev }`, one package's code rebuild | Entry code replacement |
|
||||
|
||||
| Item | Content |
|
||||
|---|---|
|
||||
| Authentication | Ordinary Remote gateway authentication and authorization; the anonymous `/plugins/events` route is removed, and the browser face opens the stream while Remote access allows `pluginEvents/follow` |
|
||||
| Transport | Both the `EventSource` and the `__DSH_TRANSPORT__.fetch` readers are removed; shells such as liveshare and webworker connect through the Remote carrier Connection already provides |
|
||||
| Reconnection | `RemoteStream` owns it; every generation starts with `baseline`, and the new snapshot covers anything missed while disconnected |
|
||||
| Desktop | Shares the same Remote stream with Web |
|
||||
| Ownership | The `client/hmr` Host face owns the `pluginEvents` Remote service, in the same package as the bundle stat poll, and declares no `ctx` type merge; `client/modules` is a zero-dependency bootstrap package and takes no typert or gateway dependency |
|
||||
| Browser dependencies | The browser face `$mount`s its own generated `pluginEvents` namespace rather than through the `api-remotes` assembly, so `api-remotes` can be hot-replaced independently; the required dependencies are `modules`, `remote` (the gateway Client face, over Connection), and `remoteAccess` |
|
||||
|
||||
### Scope: existing uses the mechanism can absorb
|
||||
|
||||
This Note migrates no existing use; the [migration Note](../../proposed/architecture/2026-11-15-client-config-sync-migration.md) owns the inventory and order. The mechanism can absorb page globals that deliver Host configuration through `webserver/index-inject`, plugins that read runtime values through `configForms`, and `Config` schemas declared only on a Client face that nothing can configure.
|
||||
|
||||
## Verification
|
||||
|
||||
The following hold and are covered by tests:
|
||||
|
||||
- A browser plugin's `apply` `config` holds the Host's current volatile values on first render; after a volatile field in `cordis.patch.yml` changes, the browser reference updates and subscribed components re-render, with neither the browser nor the Host plugin fiber remounted.
|
||||
- `role('secret')` values in the positions the projection removes, the same as the settings redaction, appear neither in the first-render injection nor in any pushed frame; a non-owner Peer receives only schema defaults, never configured values.
|
||||
- Host-only ordinary fields never appear in the browser.
|
||||
- A configuration reload with unchanged values, and the reconnect baseline after a Host restart, emit no `loader/volatile-update` and notify no subscriber.
|
||||
- No anonymous `/plugins/events` route exists; an unauthenticated request cannot obtain the plugin graph or configuration; after reconnection the browser state matches the Host.
|
||||
- After code hot reload the new activation receives a new `SyncedConfig` object holding the current values, and the old activation receives no new values once its teardown begins.
|
||||
- On the Host, the new graph frame enters the pluginEvents follower queues before the plugin's own `loader/volatile-update` listeners run; the order on the wire is not required.
|
||||
- Tests: unit tests for both faces of `client/modules` (removal, comparison, lazy creation, reference stability, listener registration and removal); a real composition test that boots a profile through the Loader, changes a patch, and asserts browser-visible values; the `client-plugin-live` and `client-config-sync` Web end-to-end tests, including reconnection after a transport restart.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
| Rejected | Reason |
|
||||
|---|---|
|
||||
| A separate browser `ClientConfig` schema | Two schemas drift; the Host schema already carries volatile declarations and validation |
|
||||
| Sending the whole configuration with secrets removed | Leaks ordinary fields such as Host paths and URLs to the browser |
|
||||
| Applying changes to browser entries through `entry.update({ config })` | The browser has no schema, so the Loader cannot tell volatile fields and only remounts |
|
||||
| Changing the vendored Loader to add a global volatile event | Requires a logged vendor modification; listening on each entry's own `ctx` suffices |
|
||||
| Placing the channel in `client/modules` | The bootstrap package would depend on typert and the gateway |
|
||||
| Mounting `pluginEvents` through `api-remotes` | A failed `api-remotes` replacement would cut the plugin update channel |
|
||||
| Declaring "replacement requires a page reload" for Connection and the gateway | Adds a manifest field and a UI branch; a page reload after a failed replacement is accepted |
|
||||
| A unified `useConfig` framework hook in the renderer | Adds a framework-level hook; manual `hooks` injection already serves components |
|
||||
| Reusing the projection and removal functions of `@deepseek-ai/dsh-settings` | The settings architecture will be adjusted after this mechanism, so no dependency yet |
|
||||
| References that are only `ObservableSnapshot` | Inconsistent with the Host's `get()` on volatile references |
|
||||
| One page-lifetime configuration object per package | An old instance being torn down during replacement would still receive new configuration, unlike the Host |
|
||||
| Changing the vendored Loader to emit a commit event for Host enqueue order | A prepended listener already suffices, with no vendor change |
|
||||
| A separate push channel for configuration | Duplicates the plugin-graph channel's authentication, reconnection, and snapshot semantics |
|
||||
| A separate `client/config` runtime package with a publicly writable configuration service | Any plugin could rewrite another plugin's configuration, and entries would have to wait for that service by package name |
|
||||
| Plugins importing the types from `@deepseek-ai/dsh-client-modules/types` | Couples every configured plugin to the bootstrap module-system package and exposes the implementing class |
|
||||
| Emitting `loader/volatile-update` in the browser too | The field references' `subscribe` suffices; the event requires reaching into Cordis's filter mechanism |
|
||||
|
||||
## Consequences
|
||||
|
||||
| Risk | Description |
|
||||
|---|---|
|
||||
| The channel depends on Connection | Plugin-graph sync depends on Connection and the gateway Client face. Hot-replacing them restarts this plugin and reopens the stream, reconciled by the new generation's baseline; if their new code fails to import or activate, the page receives no plugin updates until it reloads (accepted) |
|
||||
| Listeners registered on other plugins' `ctx` | The Host face registers on tracked entries' `ctx`; `clientModules` must withdraw every listener when it unloads |
|
||||
| Self-built references | Client references implement `Volatile` structurally without Cosmokit's internal write protocol, so `isVolatile` does not recognize them |
|
||||
| Empty configuration objects | Browser plugins without synced fields also receive an empty read-only object as `config` |
|
||||
| Push order not guaranteed | The configuration-first order holds only when every stream takes the same asynchronous steps from a Host event to the Gateway write queue; streams written in other ways, with or without waits of their own, may be written first |
|
||||
| Every field may be absent | Each `SyncedConfig` field reads `V \| undefined`: secrets, unprojectable values, and Host values not yet matching the browser code are absent, so plugins handle the absent value at each read |
|
||||
@@ -0,0 +1,215 @@
|
||||
# Agent Note: 前端插件配置同步
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-15-client-config-sync.md) | 中文
|
||||
|
||||
## Problem
|
||||
|
||||
Host 上的插件配置可以实时更新:Loader 在只有 volatile 字段变化时原地提交引用并发出 `loader/volatile-update`,不重新挂载插件。浏览器侧没有对应链路:
|
||||
|
||||
| 现象 | 原因 |
|
||||
|---|---|
|
||||
| 前端插件的 `apply(ctx, config)` 总是拿到空配置 | 页面 Loader 创建条目时只传 `name`([entries.ts](../../../../packages/client/modules/src/client/entries.ts)),cordis.yml 中该行的 `config` 不会到达浏览器 |
|
||||
| 需要 Host 配置的包各自绕路 | 有的经 `webserver/index-inject` 写页面全局变量,只在页面加载时生效;有的借 `configForms` 设置镜像读取运行时值 |
|
||||
| 插件图推送通道不合规 | `/plugins/events` 是 `auth: 'anonymous'` 路由;浏览器有 `EventSource` 和 `__DSH_TRANSPORT__.fetch` 两套读取实现,后者断开后不重连;帧序列没有「每代一份完整快照」约束 |
|
||||
|
||||
## Decision
|
||||
|
||||
### 设计原则
|
||||
|
||||
| 原则 | 内容 |
|
||||
|---|---|
|
||||
| 一套 Config | 插件只有一份配置类型,放在包的 `src/types.ts` 并由 Host 与 Client 两面共用;schema 只在 Host 面。浏览器不导出 `Config`,也不做配置校验 |
|
||||
| 只同步 volatile | 浏览器只接收 Host schema 中声明为 volatile 的字段 |
|
||||
| 剔除密钥 | volatile 字段内的 `role('secret')` 字段(包括 volatile 对象、数组、字典内部)在 Host 上剔除,不下发。该逻辑在 `client/modules` Host 面独立实现,不依赖 `@deepseek-ai/dsh-settings` |
|
||||
| 插件自身支持热更新 | 同步配置的变化永远不重新挂载前端插件;插件在操作时读取引用,或把引用作为可订阅数据源交给组件 |
|
||||
| 相等即无事 | 每层都按 deep equal 比较,值相等时不推送、不写入、不通知;重连收到的完整快照与当前值相等时不产生任何刷新 |
|
||||
| 不同步的内容 | Host 专用普通字段、密钥、按浏览器区分的偏好不进入此链路;主题等在页面 HTML 预注入以避免首屏闪烁的值保持原状 |
|
||||
|
||||
### 插件写法
|
||||
|
||||
```ts ignore-check
|
||||
// src/types.ts — shared by both faces; types only
|
||||
import type { Volatile } from '@deepseek-ai/cordis'
|
||||
|
||||
/** Plugin configuration shared by the Host and Client faces. */
|
||||
export interface Config {
|
||||
/** Host-only ordinary field; never synced. */
|
||||
cacheDir: string
|
||||
/** Synced to the browser. */
|
||||
interactiveByDefault: Volatile<boolean>
|
||||
/** Synced as one value. */
|
||||
office: Volatile<{ maxBytes: number }>
|
||||
/** Volatile but `role('secret')`: stripped on the Host; reads as undefined in the browser. */
|
||||
apiKey?: Volatile<string>
|
||||
}
|
||||
```
|
||||
|
||||
```ts ignore-check
|
||||
// src/index.ts — Host face; the only schema
|
||||
export const Config: z<Config> = z.object({
|
||||
cacheDir: z.string().default('.cache'),
|
||||
interactiveByDefault: z.boolean().default(false).volatile(),
|
||||
office: z.object({ maxBytes: z.natural().default(8 << 20) }).volatile(),
|
||||
apiKey: z.string().role('secret').volatile(),
|
||||
})
|
||||
```
|
||||
|
||||
```ts ignore-check
|
||||
// src/client/index.ts — Client face; no Config export
|
||||
import type { SyncedConfig } from '@deepseek-ai/dsh-client-config/types'
|
||||
import type { Config } from '../types.ts'
|
||||
|
||||
export function apply(ctx: Context, config: SyncedConfig<Config>): void {
|
||||
// Every synced field may read undefined; the plugin decides what an absent value means.
|
||||
const tooLarge = (bytes: number) => bytes > (config.office.get()?.maxBytes ?? Number.POSITIVE_INFINITY)
|
||||
ctx.slots.register({
|
||||
name: 'demo.body',
|
||||
inject: (): DemoBodyInjected => ({ hooks: { interactiveByDefault: config.interactiveByDefault }, tooLarge }),
|
||||
}, DemoBody)
|
||||
}
|
||||
```
|
||||
|
||||
```tsx ignore-check
|
||||
// src/client/DemoBody.tsx — the renderer binds the injected source as useInteractiveByDefault
|
||||
export function DemoBody({ useInteractiveByDefault, tooLarge }: InjectFace<DemoBodyInjected>) {
|
||||
const interactive = useInteractiveByDefault(value => value)
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
只放类型的包 `@deepseek-ai/dsh-client-config/types` 导出的类型;插件依赖它而不依赖启动最早的 Client Modules 包,由 Client Modules 实现:
|
||||
|
||||
```ts ignore-check
|
||||
/** One synced field: Host-aligned `get()`, and directly an observable source for an injected hook. */
|
||||
export interface SyncedConfigRef<T> extends Volatile<T>, ObservableSnapshot<VolatileSnapshot<T>> {}
|
||||
|
||||
/** The Volatile fields of the shared Config type. */
|
||||
export type SyncedConfig<C> = {
|
||||
readonly [K in keyof C as NonNullable<C[K]> extends Volatile<unknown> ? K : never]-?:
|
||||
NonNullable<C[K]> extends Volatile<infer V> ? SyncedConfigRef<V | undefined> : never
|
||||
}
|
||||
```
|
||||
|
||||
`get` 与 `getSnapshot` 返回同一个冻结快照:`get` 与 Host 的 volatile 引用写法一致,`getSnapshot` 与 `subscribe` 满足 `ObservableSnapshot`,引用本身即可放进 `hooks`,renderer 不需要额外适配。接口没有写操作;实现类只在 Client Modules 内部。
|
||||
|
||||
组件取值遵循 [client 规则](../../../../packages/client/AGENTS.md):插件在 slot inject 的 `hooks` 中手动注入 key 级数据源,组件只通过 renderer 绑定的 `use<Name>` 读取,不接触数据源本身。
|
||||
|
||||
### 归属
|
||||
|
||||
运行时归属仍在 `client/modules`;唯一新增的包是只放类型的 `@deepseek-ai/dsh-client-config`(两个面的 `apply` 都为空)。`client/modules` 本来就跟踪 Loader 条目、组合插件图并在浏览器创建条目,同步配置是条目的输入,由它一并负责:
|
||||
|
||||
| 面 | 职责 |
|
||||
|---|---|
|
||||
| Host(`clientModules` 服务内部) | 在每个图行插件自身的 `ctx` 上监听 `loader/volatile-update`;插件 fiber 进入 ACTIVE(`internal/status`)或条目对账后重算;从 `fiber.effectiveConfig` 读取 schema 顶层 volatile 字段的值,按 schema 剔除 `role('secret')` 位置,得到该行同步值;与上次值 deep equal 比较,不等才写入图行 `config` 并重新发布图。只变化同步值时不重建 combo 产物 |
|
||||
| Client(条目控制器内部) | 为图中出现过的每个包保存最新同步值;插件每次激活都得到一个新的配置对象(行暂时没有值时是空对象),与 Host fiber 每次激活重新解析出新引用一致;收到图时按字段 JSON 比较,把变化写入当前激活的对象 |
|
||||
| Client(`ctx.config` 服务) | 只读:`resolveConfigByPackage<C>(packageName)` 返回某个包当前激活收到的对象,供读取其他插件的配置;插件被替换后对象随之改变,没有运行中的激活时返回 `undefined` |
|
||||
|
||||
Client 面的约束:
|
||||
|
||||
| 约束 | 内容 |
|
||||
|---|---|
|
||||
| 懒生成 | 字段引用在首次访问时创建并缓存 |
|
||||
| 实例身份 | 每次激活一个对象,与该激活同寿命;代码替换与行重新加入都产生新对象,持有最新值 |
|
||||
| 不调用 `entry.update` | 同步配置不经过 Loader 的更新路径,不会触发重挂载,浏览器不发 `loader/volatile-update`;变化只经字段引用的 `subscribe` 通知 |
|
||||
| 原子发布 | 一次图更新先设置所有变化字段,再通知它们的订阅者,与 Host 先提交全部引用再发事件一致 |
|
||||
| 不校验值 | 值已由 Host 权威 schema 校验;浏览器只在图解析时校验行 `config` 是对象 |
|
||||
| 交付方式 | 条目控制器在页面 Loader 上以 prepend 方式注册 `internal/config` 监听,为不导出 schema 的托管条目返回同步对象,Loader 插值在其内层运行,不会复制该对象。导出自身 `Config` schema 的前端面保持 Cordis 原有配置解析;这类前端面的行若同时带同步值,激活失败 |
|
||||
|
||||
### 时序
|
||||
|
||||
Host 的一致性来自两点:schema 与代码同属一个模块,激活时用该 schema 解析原始配置;代码重载与配置重载由 Host 热重载串行执行,只有 ACTIVE 的实例原地接收 volatile 变化。Client 对齐后一点:
|
||||
|
||||
| 情形 | Host | Client |
|
||||
|---|---|---|
|
||||
| 实例运行中,配置变化 | 原地提交全部引用后通知 | 原地写入当前激活的对象,全部写完后通知 |
|
||||
| 替换已排队、拆除尚未开始时配置变化 | 实例仍 ACTIVE,原地更新 | 同左 |
|
||||
| 拆除开始后配置变化 | 非 ACTIVE 实例不再原地更新,新实例解析最新配置 | 拆除开始时释放旧激活,旧对象不再写入;新激活以最新值开始 |
|
||||
| 行被移除 | 实例被销毁,不再收到配置 | 移除时释放激活;行不在图中期间不写入 |
|
||||
| Host 侧插件实例非 ACTIVE | 不适用 | 同步值与 Host 插件自身的 effective Config 一样跟随 Host 配置,激活失败时也是如此;尚未激活的实例发布其 schema 从原始配置解析出的值 |
|
||||
|
||||
尚未激活的插件实例(新安装、升级、代码热重载)发布用它自己的 schema 从原始配置解析出的值,因此宣布新前端代码的那一帧已带着对应 Host schema 的值。只有开发时不兼容地修改 schema(改名、删字段),才可能在重建的 bundle 到达前,让旧前端代码短暂收到它不认识的值。
|
||||
|
||||
### 推送顺序
|
||||
|
||||
Host 插件更新配置后再向浏览器推送其他数据时,浏览器应先收到配置。这一顺序只在机制上通过以下几处保证,实际上不保证:各流的源从 Host 事件到把数据项放入 gateway 写出队列所经过的异步步骤数各不相同,即使插件没有自行插入等待,步骤更少的流也可能先被写出。插件不得依赖这一顺序:
|
||||
|
||||
| 环节 | 做法 |
|
||||
|---|---|
|
||||
| Host 入队 | `clientModules` 在插件 ctx 上以 prepend 注册 `loader/volatile-update` 监听,在插件自己的监听之前同步把新图放入各 follower 队列 |
|
||||
| pluginEvents 流 | `follow` 在自身生成器内产出增量,不经过额外委托的生成器多走一步 |
|
||||
| gateway 写出 | 每条连接一个写出队列,各流的项在源产出时立即入队并按入队顺序写出,不再逐项等待上一次写入完成;排队字节超过 `streamOutboxBytes` 时整条连接暂停读取所有源 |
|
||||
| 浏览器处理 | 每条 WebSocket 消息按到达顺序处理,配置写入在图帧处理时同步完成 |
|
||||
|
||||
### 下发
|
||||
|
||||
首屏值随 `__DSH_BOOT__` 的图行下发;之后随插件事件流的 `baseline` 与 `graph` 帧下发,不另设配置帧。插件图的线类型由 `@deepseek-ai/dsh-client-modules/types` 导出。只有 owner 收到实际配置的值;其他所有 Peer(例如 LiveShare 查看端)在启动图和每个插件事件帧中收到各插件 schema 对空 Config 解析出的值,因此 Host schema 仍是默认值的唯一来源,owner 实际配置的值留在 Host;schema 拒绝空 Config 的行在这类页面上不带值。Remote access 策略只决定 Peer 能否跟随插件图。
|
||||
|
||||
### 推送通道
|
||||
|
||||
`/plugins/events` 改为常规鉴权的 Typert Remote 流 `pluginEvents/follow`,浏览器用 `RemoteSnapshotStream` 消费:
|
||||
|
||||
| 帧 | 内容 | 浏览器处理 |
|
||||
|---|---|---|
|
||||
| `baseline` | 完整插件图(含各行同步配置) | 条目对账 |
|
||||
| `graph` | 结构或同步配置变化后的完整插件图 | 条目对账 |
|
||||
| `rebuilt` | `{ id, rev }`,单包代码重建 | 条目代码替换 |
|
||||
|
||||
| 项 | 内容 |
|
||||
|---|---|
|
||||
| 鉴权 | 走 Remote 网关的常规认证与授权,删除匿名 `/plugins/events` 路由;浏览器面在 Remote access 允许 `pluginEvents/follow` 时开流 |
|
||||
| 传输 | 删除 `EventSource` 与 `__DSH_TRANSPORT__.fetch` 两套实现;liveshare、webworker 等外壳经 connection 已提供的 Remote 载体接入 |
|
||||
| 重连 | 由 `RemoteStream` 负责;每代先收 `baseline`,断线期间的遗漏由新快照补齐 |
|
||||
| 桌面端 | 与 Web 共用同一 Remote 流 |
|
||||
| 归属 | Remote 服务 `pluginEvents` 由 `client/hmr` Host 面持有,与 bundle stat 轮询同包,不声明 `ctx` 类型合并;`client/modules` 是零依赖的 bootstrap 包,不引入 typert 与 gateway 依赖 |
|
||||
| 浏览器依赖 | 浏览器面自行 `$mount` 本包生成的 `pluginEvents` 命名空间,不经 `api-remotes` 组装,因此 `api-remotes` 可以独立热替换;必需依赖为 `modules`、`remote`(gateway Client 面,其下为 connection)与 `remoteAccess` |
|
||||
|
||||
### 能力边界:可收编的现有用法
|
||||
|
||||
本 Note 不迁移现有用法;[迁移 Note](../../proposed/architecture/2026-11-15-client-config-sync-migration.zh.md) 负责盘点与顺序。本机制具备收编以下用法的能力:经 `webserver/index-inject` 下发 Host 配置的页面全局变量、以 `configForms` 读取运行时值的插件、只在前端声明而无法配置的 `Config`。
|
||||
|
||||
## Verification
|
||||
|
||||
以下行为成立并由测试覆盖:
|
||||
|
||||
- 前端插件 `apply` 的 `config` 参数首屏即为 Host 当前 volatile 值;修改 `cordis.patch.yml` 的 volatile 字段后,浏览器中引用值更新、订阅组件重新渲染,前端与 Host 插件 fiber 都不重挂载。
|
||||
- 投影剔除的 `role('secret')` 位置(与 settings 的剔除范围相同)不出现在首屏注入和任一推送帧中;非 owner 的 Peer 只收到 schema 默认值,收不到实际配置的值。
|
||||
- Host 专用普通字段不出现在浏览器。
|
||||
- 值不变的配置重载、Host 重启后的重连 baseline 都不产生 `loader/volatile-update`,也不通知订阅者。
|
||||
- `/plugins/events` 匿名路由不存在;未认证请求无法获取插件图或配置;断线重连后浏览器状态与 Host 一致。
|
||||
- 代码热重载后新激活拿到持有当前值的新 `SyncedConfig` 对象,旧激活在拆除开始后不再收到新值。
|
||||
- Host 上,新图帧在插件自己的 `loader/volatile-update` 监听执行之前进入 pluginEvents 各 follower 队列;不要求线上的先后顺序。
|
||||
- 测试:`client/modules` 两面单元测试(剔除、比较、懒生成、引用稳定、监听注册与卸载);真实组合测试经 Loader 启动 profile、修改 patch 并断言浏览器可见值;`client-plugin-live` 与 `client-config-sync` 两个 Web 端到端测试,包括传输重启后的重连。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
| Rejected | 理由 |
|
||||
|---|---|
|
||||
| 另立一份前端 `ClientConfig` schema | 两份 schema 会漂移;volatile 声明与校验已由 Host schema 承担 |
|
||||
| 整份配置去掉密钥后下发 | 会把 Host 路径、URL 等普通字段泄漏到浏览器 |
|
||||
| 前端条目经 `entry.update({ config })` 应用变化 | 前端无 schema,Loader 无法判断 volatile,只会重挂载 |
|
||||
| 修改 vendored Loader 增加全局 volatile 事件 | 需登记 vendor 本地修改;在条目自身 `ctx` 上监听即可满足 |
|
||||
| 通道放进 `client/modules` | bootstrap 包会因此依赖 typert 与 gateway |
|
||||
| 经 `api-remotes` 挂载 `pluginEvents` | `api-remotes` 的替换失败会切断插件更新通道 |
|
||||
| 为 connection 与 gateway 增加「替换需刷新页面」声明 | 新增 manifest 字段与界面分支;接受替换失败时刷新页面 |
|
||||
| renderer 提供统一的 `useConfig` 框架 hook | 新增框架级 hook;手动注入 `hooks` 已满足组件取值 |
|
||||
| 复用 `@deepseek-ai/dsh-settings` 的投影与剔除函数 | settings 架构尚待在本机制之后统一调整,先不建立依赖 |
|
||||
| 引用只保留 `ObservableSnapshot` | 与 Host volatile 引用的 `get()` 写法不一致 |
|
||||
| 每个包一个页面级配置对象 | 替换期间正在退出的旧实例仍会收到新配置,与 Host 不一致 |
|
||||
| 修改 vendored Loader 发出提交事件以保证 Host 入队顺序 | prepend 监听已能满足,不需要 vendor 改动 |
|
||||
| 另开一条配置专用推送通道 | 与插件图通道重复鉴权、重连与快照语义 |
|
||||
| 独立 `client/config` 运行时包提供公开写入的配置服务 | 任何插件都能改写别的插件的配置;条目还需按包名等待该服务 |
|
||||
| 插件从 `@deepseek-ai/dsh-client-modules/types` 导入类型 | 让每个使用配置的插件都依赖启动最早的模块系统包,并暴露实现类 |
|
||||
| 浏览器也发 `loader/volatile-update` | 字段引用的 `subscribe` 已足够,事件需要深入 Cordis 的过滤机制 |
|
||||
|
||||
## Consequences
|
||||
|
||||
| 风险 | 说明 |
|
||||
|---|---|
|
||||
| 通道依赖 connection | 插件图同步依赖 connection 与 gateway Client 面。热替换它们会连带重启本插件并重开流,由新一代 baseline 对账;若其新代码导入或激活失败,页面在刷新前收不到插件更新(已接受) |
|
||||
| 在他人 `ctx` 上注册监听 | Host 面在被跟踪条目的 `ctx` 上注册,`clientModules` 卸载时必须撤销全部监听 |
|
||||
| 自建引用 | Client 面引用是自建的 `Volatile` 结构实现,不使用 cosmokit 内部写入协议,`isVolatile` 不识别它们 |
|
||||
| 空配置对象 | 没有同步字段的前端插件也收到一个空的只读对象作为 `config` |
|
||||
| 推送顺序不保证 | 配置先到只在各流从 Host 事件到 gateway 写出队列经过相同异步步骤时成立;其他写法的流,无论是否自行等待,都可能先被写出 |
|
||||
| 每个字段都可能缺值 | `SyncedConfig` 的每个字段读到 `V \| undefined`:密钥、无法投影的值、尚未与浏览器代码对应的 Host 值都会缺失,插件需在每次读取时处理缺值 |
|
||||
@@ -18,8 +18,8 @@
|
||||
en: 8b10f08e67ca9323
|
||||
zh: e57adb520049f407
|
||||
/agent-note-typed-tool-returns-in-ptc-mode/decision/outer-result-and-output-ledger:
|
||||
en: e48ef4dbe1ac9a1e
|
||||
zh: b87b0c0a3f1c2a4e
|
||||
en: f6fb803d2dc061bb
|
||||
zh: 05432104d5876f99
|
||||
/agent-note-typed-tool-returns-in-ptc-mode/decision/typed-handles-and-lifetime:
|
||||
en: b2b9318c2812e3a4
|
||||
zh: 73cf34bfd487e2f1
|
||||
@@ -33,8 +33,8 @@
|
||||
en: 069a1e170c7d1dfb
|
||||
zh: 14ce5a56e602595c
|
||||
/agent-note-typed-tool-returns-in-ptc-mode/consequences:
|
||||
en: f5726b5e7a2fc73f
|
||||
zh: 0b9aa884db5d920f
|
||||
en: 16cb8d972867b62f
|
||||
zh: d253114975e96fe8
|
||||
/agent-note-typed-tool-returns-in-ptc-mode/known-limitations-and-deferred-work:
|
||||
en: 19828c2e5796df2d
|
||||
zh: 2ef63df81fca7a72
|
||||
@@ -59,9 +59,9 @@ Ordinary binding arguments and JSON resolutions are revalidated as lossless JSON
|
||||
|
||||
Runtime consumers that retain completions receive exact lossless JSON: `undefined` omits the completion and `null` is an explicit result. TypeScript `run_code` requests completion discard and returns captured logs plus optional sandbox facts as its canonical value; selected images enter its rendered content separately.
|
||||
|
||||
`NodePtcRuntime` replaces the former independent log and value caps with configurable `maxOutputBytes`, defaulting to `67_108_864` bytes. The worker charges captured logs by their exact JSON-string serialization and preflights the detached completion or program exception against the remaining combined budget before posting a terminal message. A giant thrown string or stack therefore crosses the worker port only as the fixed `output-limit` diagnostic. The host repeats the hostile-peer ledger for forged traffic and native pipe writes the worker cannot observe. Fixed `PtcRunResult` field names, braces, the bounded error-kind tag, and later presentation whitespace are deliberately outside this variable-payload ledger. Neither stage materializes an over-limit serialized completion. A result at or below the cap is exact. A completion that cannot survive lossless JSON snapshotting fails as `invalid-output`; a value, diagnostic, or combined outcome over the cap fails as `output-limit` rather than becoming inspected or truncated text.
|
||||
`NodePtcRuntime` uses the configurable `maxOutputBytes` combined payload budget, defaulting to `67_108_864` bytes. Required completion values remain lossless JSON: unsupported values fail with `invalid-output`, and values that cannot fit fail with `output-limit`. The [output-truncation decision](../architecture/2026-11-13-ptc-output-truncation.md) owns captured-output retention and diagnostic priority. Fixed `PtcRunResult` field names, braces, bounded metadata and later presentation whitespace remain outside this variable-payload ledger. The host validates untrusted process traffic and native pipe writes independently; neither side serializes oversized completions.
|
||||
|
||||
Logs stream eagerly so a terminated run can retain output already admitted. Native stdout and stderr writes that bypass the worker's patched stream slots use independent pipes, so terminal settlement continues bounded capture until worker termination completes before materializing the result. When the cap is crossed, the runtime returns an explicit bounded failure with the fitting captured prefix. That outer result then traverses the ordinary `run_code` rendering and spill policy, which may save the captured text and expose its configured head/tail preview. The spill layer cannot recover bytes the runtime rejected beyond the hard cap.
|
||||
Logs stream eagerly so a terminated run can retain output already admitted. Native stdout and stderr writes that bypass the worker's patched stream slots use independent pipes, so terminal settlement continues bounded capture until worker termination completes before materializing the result. When the cap is crossed, captured output is truncated to a fitting prefix and marked with `outputTruncated`, while execution continues. Finalization reserves the required completion or diagnostic budget before retaining output; only a required completion that cannot fit causes `output-limit`. That outer result then traverses the ordinary `run_code` rendering and spill policy, which may save the captured text and expose its configured head/tail preview. The spill layer cannot recover bytes the runtime rejected beyond the hard cap.
|
||||
|
||||
Compute time, wall time, worker heap, cancellation, and fresh-worker isolation remain independent limits. The outer ledger never charges intermediate bindings, so snapshotting, flat-wire encoding and decoding, structured-clone cost, and available process or worker memory are their practical bounds.
|
||||
|
||||
@@ -101,7 +101,7 @@ Keyless real-worker integration tests pin the two handle workflows that prose re
|
||||
|
||||
Code programs can compose tools through stable values instead of reverse-engineering Native prose. Native mode retains its existing text and UI presentation, while PTC mode receives output-schema types and exact runtime JSON. Tool authors must treat the canonical value as their programmatic API and put display-only formatting in the renderer.
|
||||
|
||||
The worker performs bounded-depth flat-wire transport and lossless validation but does not make intermediate values cheap or durable. Outer overflow is an explicit failed run, and error handling remains intentionally human-guided rather than a versioned code union.
|
||||
The worker performs bounded-depth flat-wire transport and lossless validation but does not make intermediate values cheap or durable. An oversized required completion is an explicit failed run, and error handling remains intentionally human-guided rather than a versioned code union.
|
||||
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ PTC mode 通过运行时请求中的 `{ name: "ToolCallError", memberNamePropert
|
||||
|
||||
保留完成值的运行时消费方接收精确无损 JSON:`undefined` 省略完成值,`null` 是显式结果。TypeScript `run_code` 请求丢弃完成值,将捕获日志和可选沙箱信息作为规范值返回;所选图片单独进入渲染内容。
|
||||
|
||||
`NodePtcRuntime` 以可配置的 `maxOutputBytes` 取代彼此独立的日志与值上限,默认值为 `67_108_864` 字节。worker 会将已捕获日志序列化为 JSON 字符串后的精确字节数计入账本,并在发送终态消息前,根据组合账本的剩余额度预检分离后的完成值或程序异常。因此,即使抛出的字符串或堆栈极大,通过 worker 端口的也只会是固定的 `output-limit` 诊断。宿主侧会针对伪造流量以及 worker 无法观察的原生管道写入,重复执行这套面向不可信对端的账本校验。固定的 `PtcRunResult` 字段名、花括号、有界的错误类型标签及后续展示空白有意不计入这份可变负载账本。这两个阶段都不会实际生成超出上限的完成值序列化结果。结果不超过上限时会保持精确。完成值无法通过无损 JSON 快照时,以 `invalid-output` 失败;值、诊断或包含日志的组合结果超过上限时,以 `output-limit` 失败,而不会变成检查格式化后或截断的文本。
|
||||
`NodePtcRuntime` 使用可配置的 `maxOutputBytes` 组合负载预算,默认值为 `67_108_864` 字节。必需完成值保持无损 JSON:不支持的值以 `invalid-output` 失败,无法容纳的值以 `output-limit` 失败。[输出截断决策](../architecture/2026-11-13-ptc-output-truncation.zh.md)负责捕获输出保留和诊断优先级。固定的 `PtcRunResult` 字段名、花括号、有界元数据和后续展示空白仍不计入可变负载账本。宿主独立校验不可信进程通信和原生管道写入;两端都不会序列化过大的完成值。
|
||||
|
||||
日志会在产生时立即流出,因此运行被终止时仍可保留已经纳入额度的输出。绕过 worker 中已改写流写入入口的原生 stdout 和 stderr 写入会经由彼此独立的管道传输,因此运行时在终态结算期间仍会继续在上限内捕获输出,直至 worker 完全终止,然后才组装结果。超过上限后,运行时会返回一个显式的有界失败,并携带可容纳的已捕获前缀。该外层结果随后通过普通的 `run_code` 渲染与 spill 策略;策略可以保存已捕获的文本,并暴露其配置指定的头尾预览。spill 层无法恢复运行时在硬上限之外拒绝的字节。
|
||||
日志会在产生时立即流出,因此运行被终止时仍可保留已经纳入额度的输出。绕过 worker 中已改写流写入入口的原生 stdout 和 stderr 写入会经由彼此独立的管道传输,因此运行时在终态结算期间仍会继续在上限内捕获输出,直至 worker 完全终止,然后才组装结果。超过上限后,捕获输出会截断为可容纳的前缀并标记 `outputTruncated`,执行继续。最终结算先为必需完成值或诊断预留预算,再保留输出;只有无法容纳的必需完成值才会导致 `output-limit`。该外层结果随后通过普通的 `run_code` 渲染与 spill 策略;策略可以保存已捕获的文本,并暴露其配置指定的头尾预览。spill 层无法恢复运行时在硬上限之外拒绝的字节。
|
||||
|
||||
计算时间、墙钟时间、worker 堆内存、取消和每次运行使用全新 worker 的隔离仍是互相独立的限制。外层账本从不计入中间绑定值,因此生成快照、扁平协议格式的编码与解码、结构化克隆开销,以及进程或 worker 的可用内存构成了这些值的实际边界。
|
||||
|
||||
@@ -101,7 +101,7 @@ PTC mode 通过运行时请求中的 `{ name: "ToolCallError", memberNamePropert
|
||||
|
||||
PTC mode 程序可以通过稳定值组合工具,无需逆向解析 Native 自然语言。Native mode 保留现有文本与 UI 展示,PTC mode 则获得输出 schema 类型和精确的运行时 JSON。工具作者必须把规范值视为程序化 API,并将仅用于展示的格式化放入渲染器。
|
||||
|
||||
worker 会以嵌套深度有界的扁平协议格式传输数据并执行无损校验,但不会降低中间值的开销,也不会使其具备持久性。外层输出溢出会显式导致运行失败,错误处理则有意由人类引导,而不是依赖带版本的错误代码联合。
|
||||
worker 会以嵌套深度有界的扁平协议格式传输数据并执行无损校验,但不会降低中间值的开销,也不会使其具备持久性。必需完成值超限会显式导致运行失败,错误处理则有意由人类引导,而不是依赖带版本的错误代码联合。
|
||||
|
||||
## 已知限制与暂缓事项
|
||||
|
||||
|
||||
+4
-4
@@ -18,8 +18,8 @@
|
||||
en: e7cae8876e688f92
|
||||
zh: 1d326330c34d128d
|
||||
/agent-note-prompt-to-reload-when-the-host-release-changes-instead-of-hot-replacing-across-releases/decision/wire:
|
||||
en: f15c4106f228f5f6
|
||||
zh: ab80cf4ce62ae84c
|
||||
en: 387deee727dfc538
|
||||
zh: 1cae30f007f842d0
|
||||
/agent-note-prompt-to-reload-when-the-host-release-changes-instead-of-hot-replacing-across-releases/decision/page-side:
|
||||
en: c0610c8f5a0882f3
|
||||
zh: d309cbc53183ec6e
|
||||
@@ -30,5 +30,5 @@
|
||||
en: abb9d7ab9ef1df15
|
||||
zh: 1704732daf5f2886
|
||||
/agent-note-prompt-to-reload-when-the-host-release-changes-instead-of-hot-replacing-across-releases/consequences:
|
||||
en: 815b41dc4f9ffcee
|
||||
zh: b57388264cc459c7
|
||||
en: a21bf34ac3983fbb
|
||||
zh: c6278ef441587a48
|
||||
@@ -60,7 +60,7 @@ BootManifest { ...; release?: WebBootRelease }
|
||||
```
|
||||
|
||||
- [ClientModuleRegistry](../../../../packages/client/modules/src/index.ts) computes the release once at construction and `compose()` writes it into every graph; `release` stays outside `graph.rev`. There is no new config field and the composition is unchanged.
|
||||
- `__DSH_BOOT__` and every SSE `graph` frame carry the field, so one graph frame carries both the Host release and its complete module graph; the client-hmr Host half is unchanged. A rebuilt frame comes from the same Host process as the graph frame before it on that SSE connection, so it inherits that frame's release.
|
||||
- `__DSH_BOOT__` and every plugin-events `baseline` and `graph` frame carry the field, so one graph frame carries both the Host release and its complete module graph; the client-hmr Host half is unchanged. A rebuilt frame comes from the same Host process as the graph frame before it on that stream generation, so it inherits that frame's release.
|
||||
- `parseBootManifest` accepts an absent `release`, rejects a non-string `version` or `commit`, and drops members outside the identity, so equality compares only those two fields. `readRelease` reads only the `release` member of a received graph, so a page compares releases before it validates anything else; a release it cannot read counts as absent. Older pages that do not know the field ignore it.
|
||||
|
||||
### Page side
|
||||
@@ -136,8 +136,7 @@ Order of operations:
|
||||
- While the Host serves another release, plugin updates, including enabling or disabling a plugin on the Host, reach the page only after a reload.
|
||||
- When a Host returns to the page's release, only modules whose revisions differ are replaced. Revisions come from artifact metadata, so a rebuild of identical code still replaces the rebuilt modules once, without a prompt.
|
||||
- A composition without the dialog registered still pauses updates from another release and logs the warning; the user sees no prompt.
|
||||
- The API connection and SSE are independent channels, so an old page can show a protocol error before the dialog appears.
|
||||
- If a restarting Host answers `/plugins/events` with a non-200 status before registering the route, the browser closes that SSE stream for good, and the page cannot detect a release change until it reloads.
|
||||
- After a terminal plugin-events stream failure the page cannot detect a release change until it reloads.
|
||||
- A source launch without dev-web has no commit, so development detection falls back to version changes.
|
||||
- Each tab prompts and remembers independently.
|
||||
- Unit tests pin the gate through `ClientEntries` (same-release replacement, another release applying nothing, the return to the boot release replacing only changed modules, dismissal, absent releases), the manifest parser, the Host-published release, the shared preset's Node-half defines, and the dialog's rendering and callbacks.
|
||||
+2
-3
@@ -60,7 +60,7 @@ BootManifest { ...; release?: WebBootRelease }
|
||||
```
|
||||
|
||||
- [ClientModuleRegistry](../../../../packages/client/modules/src/index.ts) 在构造时计算一次 release,由 `compose()` 写入每个 graph;`release` 不计入 `graph.rev`。不新增配置项,组合配置不变。
|
||||
- `__DSH_BOOT__` 和每个 SSE `graph` 帧都带这个字段,所以一个 graph 帧同时携带 Host 的 release 和完整模块图;client-hmr 的 Host 半侧不变。rebuilt 帧与同一条 SSE 连接上前一个 graph 帧来自同一个 Host 进程,因此沿用那一帧的 release。
|
||||
- `__DSH_BOOT__` 和插件事件流的每个 `baseline`、`graph` 帧都带这个字段,所以一个 graph 帧同时携带 Host 的 release 和完整模块图;client-hmr 的 Host 半侧不变。rebuilt 帧与同一代流上前一个 graph 帧来自同一个 Host 进程,因此沿用那一帧的 release。
|
||||
- `parseBootManifest` 允许 `release` 缺省,拒绝非字符串的 `version` 或 `commit`,并丢弃身份以外的成员,因此相等判断只看这两个字段。`readRelease` 只读取收到的 graph 的 `release` 成员,所以页面先比较 release,再校验其余内容;读不出的 release 视为缺省。不认识该字段的旧页面会忽略它。
|
||||
|
||||
### 页面侧
|
||||
@@ -136,8 +136,7 @@ class ClientEntries {
|
||||
- Host 提供其他 release 期间,插件更新(包括在 Host 上启用或停用插件)要等刷新后才会到达页面。
|
||||
- Host 回到页面的 release 时,只替换 revision 不同的模块。revision 取自产物元数据,所以即使重新构建出的代码完全相同,也会把重建过的模块替换一次,不弹框。
|
||||
- 组合里没有注册确认框时,仍会暂停来自其他 release 的更新并记录警告,用户看不到提示。
|
||||
- API 连接和 SSE 是两条独立通道,旧页面可能在确认框出现之前就已显示协议错误。
|
||||
- 重启中的 Host 若在注册路由前对 `/plugins/events` 返回非 200 状态,浏览器会永久关闭这条 SSE,页面在刷新前检测不到 release 变化。
|
||||
- 插件事件流以终止性错误结束后,页面在刷新前检测不到 release 变化。
|
||||
- 不经 dev-web 的源码启动没有 commit,开发期只能检测到版本号变化。
|
||||
- 每个标签页各自提示、各自记录。
|
||||
- 单元测试通过 `ClientEntries` 固定 gate 的行为(同一 release 的替换、其他 release 不应用任何内容、回到启动 release 只替换变化了的模块、撤回、缺失 release),并覆盖 manifest 解析、Host 发布的 release、共享预设给 Node 半侧的 define,以及确认框的渲染与回调。
|
||||
@@ -27,8 +27,8 @@
|
||||
en: 0dcc97d8105fab60
|
||||
zh: d80d40ae3a0c601d
|
||||
/agent-note-direct-deepseek-search-and-fetch-apis/alternatives-considered:
|
||||
en: 907e0b8424943d43
|
||||
zh: f45e583e7cb4eb63
|
||||
en: 021a4b08ad534b36
|
||||
zh: e98e1f65e50a568b
|
||||
/agent-note-direct-deepseek-search-and-fetch-apis/consequences:
|
||||
en: 7ec21c5b1124e5f8
|
||||
zh: af769dbdb4face9f
|
||||
|
||||
@@ -52,7 +52,7 @@ The independent `dsh-web-search-deepseek` provider sends Messages search request
|
||||
|
||||
**Keep the APIs inside the Messages provider behind a provider-local switch.** A switch inside the Messages provider cannot change fetch routing, so `web_fetch` would stay on HTTP unless the user also edited `web.fetchProvider`; it also ties the APIs' lifecycle to Messages search. Separate registrations let the web service's existing selection choose each provider, without coupling either API to the Messages provider.
|
||||
|
||||
**Share one transport between Messages search and the new APIs.** A shared web transport would couple different request formats and failure mappings. Credential values instead come from the shared [`llm-deepseek` credential helpers](../../../../packages/llm/llm-deepseek/src/credential.ts); Messages search and the Search/Fetch API transports remain independent.
|
||||
**Share one transport between Messages search and the new APIs.** A shared web transport would couple different request formats and failure mappings. Credential values instead come from the credentials the model routes publish through `ctx.llm.providerCredential()` and from the `dsh-credentials` reference helpers; Messages search and the Search/Fetch API transports remain independent.
|
||||
|
||||
**Split Search and Fetch into separate packages.** The guide serves both APIs from one base with one credential; separate packages would duplicate settings that address one deployment. Independent selection does not require separate packages, because each API registers its own provider id. Each operation lives in its own module, so either API can change without the other.
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ HTTP 提供方继续负责自身的 URL 校验和资源限制。选择 DeepSeek
|
||||
|
||||
**把两个 API 放在 Messages 提供方内部,由提供方自己的开关切换。** Messages 提供方内的开关无法改变抓取路由,因此除非用户另外修改 `web.fetchProvider`,`web_fetch` 仍会走 HTTP;它还会把两个 API 的生命周期绑在 Messages 搜索上。独立注册让 Web 服务通过现有的提供方选择机制选择各个提供方,不会把任一 API 与 Messages 提供方绑定。
|
||||
|
||||
**让 Messages 搜索与新 API 共用一套传输层。** 共享 Web 传输层会耦合不同的请求格式和失败映射。凭据值改为通过共享的 [`llm-deepseek` 凭据函数](../../../../packages/llm/llm-deepseek/src/credential.ts)获取;Messages 搜索与 Search/Fetch API 传输层保持独立。
|
||||
**让 Messages 搜索与新 API 共用一套传输层。** 共享 Web 传输层会耦合不同的请求格式和失败映射。凭据值改为来自模型路由通过 `ctx.llm.providerCredential()` 发布的凭据以及 `dsh-credentials` 的引用函数;Messages 搜索与 Search/Fetch API 传输层保持独立。
|
||||
|
||||
**把 Search 和 Fetch 拆成两个包。** 指南从同一基础地址、以同一份凭据提供两个 API;拆成两个包会让指向同一部署的设置重复出现。分别选择不需要拆包,因为每个 API 注册自己的提供方 id。每种操作位于独立模块,任一 API 都可以单独修改。
|
||||
|
||||
|
||||
+2
-2
@@ -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: c6b0d746185d0d3b
|
||||
zh: a228633ecdf42800
|
||||
en: 0532e871788d6ef7
|
||||
zh: 75131f43216bd05f
|
||||
/agent-note-keep-cleanup-dependencies-usable-until-consumers-finish/p0-findings/ssh-disables-cleanup-requests-before-dependent-process-cleanup-finishes:
|
||||
en: 85fb2b564bc40230
|
||||
zh: 97c3e794124f8044
|
||||
|
||||
+1
-1
@@ -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 (`DeepSeekAccount`)](../../../../packages/credentials/deepseek-account/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/account/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.
|
||||
|
||||
|
||||
+1
-1
@@ -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)。账号服务[不会中止正在提交的尝试,并等待其完成 (`DeepSeekAccount`)](../../../../packages/credentials/deepseek-account/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/account/deepseek-account/src/index.ts)。
|
||||
|
||||
**写入成功,却报告失败。** 暂停凭据写入,释放账号消费者,再完成写入并发出更新。观察器可以与账号的排空并发自动退订;随后 Authorization 即使存储成功也会以 `NOT_COMMITTED` 拒绝。应让操作拥有观察器直到结果确定,或直接确认成功的 `session.commit`,同时给旧式直接写入观察明确的生命周期。使用实际 Cordis 与 Authorization、配合延迟的内存凭据 provider 的实验,复现了 provider 写入成功后返回 `NOT_COMMITTED`;完整浏览器登录路径由源码追踪确认。
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Bilingual-pair consistency record for 2026-11-15-client-config-sync-migration.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/proposed/architecture/2026-11-15-client-config-sync-migration.md
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync:
|
||||
en: 5f71cf603f0c5013
|
||||
zh: 3976607b283e68dc
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/problem:
|
||||
en: 38add9dc3b90ad7e
|
||||
zh: 867e351401f537bc
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/proposal:
|
||||
en: 986dd8097aac4d3d
|
||||
zh: 986dd8097aac4d3d
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/proposal/inventory:
|
||||
en: 08dae763d773f24a
|
||||
zh: 15b4bd80b4973dff
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/proposal/migration-rules:
|
||||
en: 72202ccc050d7e35
|
||||
zh: a809ee548e005fcb
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/proposal/order:
|
||||
en: 8b8ded15f43056c0
|
||||
zh: 3ea6067ed0c3310c
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/proposal/open-questions:
|
||||
en: 103a6b7dca054eb4
|
||||
zh: 55b0881eca3e08ac
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/alternatives-considered:
|
||||
en: a00b894cbcff0c34
|
||||
zh: 7f2a83f36df109ec
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/acceptance-criteria:
|
||||
en: 15597a6f656e7268
|
||||
zh: f17a1cfcbef0fcbd
|
||||
/agent-note-migrate-existing-browser-configuration-reads-to-configuration-sync/risks:
|
||||
en: 8f5e523d526b2026
|
||||
zh: 34a61d7c19df8650
|
||||
@@ -0,0 +1,66 @@
|
||||
# Agent Note: Migrate existing browser configuration reads to configuration sync
|
||||
|
||||
Status: proposed
|
||||
|
||||
English | [中文](2026-11-15-client-config-sync-migration.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Before [browser plugin configuration sync](../../implemented/architecture/2026-11-15-client-config-sync.md), every package whose browser face needs Host configuration implemented its own read. These reads take effect only at page load, duplicate injection code, or use the settings editing channel as a runtime read channel. This Note inventories them and plans their migration; nothing runs before the architecture lands.
|
||||
|
||||
## Proposal
|
||||
|
||||
### Inventory
|
||||
|
||||
| Category | Use | Packages |
|
||||
|---|---|---|
|
||||
| A. Page globals carry Host configuration | `webserver/index-inject` writes `window.__DSH_*__`, read once when the browser loads | `shortcuts`, `ui-sidebar-documentpreview`, `ui-account-notifications`, `ui-settings-models` (onboarding), `ui-settings-account` (contact details), `connection` (recovery parameters) |
|
||||
| B. Runtime values read through `configForms` | The browser subscribes to accepted values of its own or another entry through the settings mirror | `ui-chat`, `ui-conversation`, `locale`, `ui-theme`, `ui-settings-account`, `ui-settings-general`, `ui-agent-preset`, experimental `timeline`, `client-ui-cot-translation`, `client-ui-forge`, `cua` |
|
||||
| C. `Config` declared only on the Client face | The browser exports a schema, but the entry never receives configuration | Done in the architecture PR: `ui-context-menu` `resolutionTimeoutMs` and `ui-conversation` `maxConcurrentFileUploads` are top-level volatile fields of their Host schemas, and the Client schemas are removed |
|
||||
| D. First-paint pre-injection | The page HTML pre-injects values to avoid a first-paint flash | `ui-theme` palette and font sizes |
|
||||
| E. Settings editing | Settings pages edit inherited values, overrides, revisions, and writability | every `ui-settings-*` card |
|
||||
|
||||
### Migration rules
|
||||
|
||||
| Category | Handling |
|
||||
|---|---|
|
||||
| A | Make the fields volatile and move the `Config` type to `src/types.ts`; the browser reads `SyncedConfig`; remove the matching `index-inject` row and global. Confirm per field that its meaning can become "changes at runtime"; `connection` needs its recovery parameters before Connection itself activates and is assessed separately |
|
||||
| B | Plugins reading their own entry read `SyncedConfig`; `configForms` keeps only writes and settings presentation. Reads of another entry's values (for example `ui-agent-preset` reading `ui-settings`) can use the read-only `ctx.config.resolveConfigByPackage(packageName)` |
|
||||
| C | Remove the browser schema and `Config` export, move the type to `src/types.ts`, and declare a volatile schema on the Host face |
|
||||
| D | Unchanged; the runtime part can be migrated separately |
|
||||
| E | Outside this migration; adjusting the settings package and `configForms` is discussed separately once the configuration sync architecture is stable |
|
||||
|
||||
### Order
|
||||
|
||||
1. The architecture Note is implemented and merged.
|
||||
2. Category C (no behavior dependency; exercises the mechanism).
|
||||
3. Category A, one package at a time.
|
||||
4. Category B, own reads first, then cross-plugin reads.
|
||||
5. A separate Note for the overall adjustment of settings and `configForms`.
|
||||
|
||||
### Open questions
|
||||
|
||||
- Which fields each package makes volatile.
|
||||
- Whether cross-plugin reads move to types inferred per package name through declaration merging.
|
||||
- The first-render timing of `connection` recovery parameters and bootstrap rows.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
| Rejected | Reason |
|
||||
|---|---|
|
||||
| Migrating in the architecture PR | Widens the review and mixes mechanism questions with per-package semantics |
|
||||
| Keeping page globals as a long-term parallel channel | Keeps two configuration sources and duplicated injection code |
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- Category A and C packages no longer export a browser `Config` schema or read Host configuration globals.
|
||||
- Category B plugins that read their own configuration no longer rely on `configForms` for runtime reads.
|
||||
- After migration, a Host change to the matching volatile field takes effect without a page reload.
|
||||
|
||||
## Risks
|
||||
|
||||
| Risk | Description |
|
||||
|---|---|
|
||||
| Changed meaning | Values that took effect only at load become runtime-changeable, and plugins must support live updates |
|
||||
| Pinned configuration | Making a field volatile brings it into the settings form's profile row, subject to the pinning rules in [profile-owned live configuration](../../implemented/architecture/2026-09-19-profile-owned-live-configuration.md) |
|
||||
| First-render timing | `connection` needs its recovery parameters before it activates, earlier than synced configuration can take part |
|
||||
@@ -0,0 +1,66 @@
|
||||
# Agent Note: 现有前端配置读取迁移到配置同步
|
||||
|
||||
Status: proposed
|
||||
|
||||
[English](2026-11-15-client-config-sync-migration.md) | 中文
|
||||
|
||||
## Problem
|
||||
|
||||
[前端插件配置同步](../../implemented/architecture/2026-11-15-client-config-sync.zh.md)落地前,浏览器需要 Host 配置的包各自实现了读取方式。这些方式只在页面加载时生效、复制注入代码,或把设置编辑通道当成运行时读取通道。本 Note 盘点这些用法并规划收编;架构落地前不执行。
|
||||
|
||||
## Proposal
|
||||
|
||||
### 盘点
|
||||
|
||||
| 类别 | 用法 | 包 |
|
||||
|---|---|---|
|
||||
| A. 页面全局变量下发 Host 配置 | `webserver/index-inject` 写 `window.__DSH_*__`,前端加载时读一次 | `shortcuts`、`ui-sidebar-documentpreview`、`ui-account-notifications`、`ui-settings-models`(引导)、`ui-settings-account`(联系方式)、`connection`(恢复参数) |
|
||||
| B. 以 `configForms` 读取运行时值 | 前端经设置镜像订阅自身或他人条目的已接受值 | `ui-chat`、`ui-conversation`、`locale`、`ui-theme`、`ui-settings-account`、`ui-settings-general`、`ui-agent-preset`、实验包 `timeline`、`client-ui-cot-translation`、`client-ui-forge`、`cua` |
|
||||
| C. 只在前端声明的 `Config` | 前端导出 schema,但条目从不收到配置 | 已在架构 PR 中完成:`ui-context-menu` 的 `resolutionTimeoutMs` 与 `ui-conversation` 的 `maxConcurrentFileUploads` 已改为 Host 顶层 volatile 字段,前端 schema 已删除 |
|
||||
| D. 首屏预注入 | 页面 HTML 预注入以避免首屏闪烁 | `ui-theme` 调色板与字号 |
|
||||
| E. 设置编辑 | 设置页编辑继承值、覆盖值、修订号、可写性 | 各 `ui-settings-*` 卡片 |
|
||||
|
||||
### 收编规则
|
||||
|
||||
| 类别 | 处理 |
|
||||
|---|---|
|
||||
| A | 字段改为 volatile,`Config` 类型移入 `src/types.ts`;前端改读 `SyncedConfig`;删除对应 `index-inject` 与全局变量。需逐字段确认语义可以变为「运行时可变」;`connection` 恢复参数在 connection 自身激活前就需要,须单独评估 |
|
||||
| B | 读取自身条目的插件改读 `SyncedConfig`;`configForms` 只保留写入与设置页呈现。读取他人条目的值(例如 `ui-agent-preset` 读 `ui-settings`)可改用只读的 `ctx.config.resolveConfigByPackage(packageName)` |
|
||||
| C | 前端删除 schema 与 `Config` 导出,类型移入 `src/types.ts`,Host 面声明 volatile schema |
|
||||
| D | 保持不变;运行时变化部分可另行收编 |
|
||||
| E | 不在本迁移范围;settings 包与 `configForms` 的调整在配置同步架构稳定后另行讨论 |
|
||||
|
||||
### 顺序
|
||||
|
||||
1. 架构 Note 实现完成并合入。
|
||||
2. 类别 C(无行为依赖,验证机制)。
|
||||
3. 类别 A,逐包进行。
|
||||
4. 类别 B,先自身读取、后跨插件读取。
|
||||
5. settings 与 `configForms` 的整体调整另起 Note。
|
||||
|
||||
### 未决
|
||||
|
||||
- 每个包选择哪些字段改为 volatile。
|
||||
- 跨插件读取是否升级为按包名声明合并推导类型。
|
||||
- `connection` 恢复参数与 bootstrap 行的首屏时序。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
| Rejected | 理由 |
|
||||
|---|---|
|
||||
| 与架构同一 PR 迁移 | 扩大评审面,机制问题与逐包语义问题混在一起 |
|
||||
| 保留页面全局变量作为长期并行通道 | 维持两套配置来源与重复注入代码 |
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- 类别 A、C 的包不再导出前端 `Config` schema 或读取 Host 配置全局变量。
|
||||
- 类别 B 中读取自身配置的插件不再依赖 `configForms` 做运行时读取。
|
||||
- 迁移后 Host 修改对应 volatile 字段无需刷新页面即生效。
|
||||
|
||||
## Risks
|
||||
|
||||
| 风险 | 说明 |
|
||||
|---|---|
|
||||
| 语义变化 | 原本只在加载时生效的值变为运行时可变,插件需支持热更新 |
|
||||
| 配置钉住 | 字段改为 volatile 会使设置表单把它纳入 profile 行,受[实时配置](../../implemented/architecture/2026-09-19-profile-owned-live-configuration.zh.md)中的钉住规则影响 |
|
||||
| 首屏时序 | `connection` 在自身激活前就需要恢复参数,早于同步配置能参与的时间点 |
|
||||
@@ -18,9 +18,9 @@ The [`weighted-approval` workflow](../workflows/weighted-approval.yml) publishes
|
||||
|
||||
The weighted approval workflow exposes two pull-request checks. The `weighted approval publisher` Actions job reports whether evaluation and status publication completed, while the `weighted approval` commit status carries the approval decision on the pull request head. Branch rules must require only the commit status with GitHub Actions as its expected source; a context-only requirement can accept a same-named status from another integration. The publisher marks the head pending before Python setup or lexer installation, so failed setup or an interrupted history fetch cannot leave a previous success in place. Setup and evaluation failures publish an error status. A completed evaluation returns `pending` below two approval points, while the pull request is a draft, or while a write-capable reviewer has an effective `CHANGES_REQUESTED` review; the blocker keeps the status pending even when counted approvals reach the threshold. It returns `success` only when the threshold is met, the pull request is ready, and no such blocker exists. If evaluation fails, the publisher writes an `error` status. The publisher also writes a `weighted approval decision` check run that reports the same decision as a conclusion — `action_required` while the policy is unmet, `success` when it holds, and `failure` on setup or evaluation failures — with the score or blocker in its title. Branch rules do not require that check run, so it never blocks a merge; it names the blocked state beside the status that gates the merge. The check run is published with a token minted from a dedicated approval App (`DSH_APPROVAL_APP_CLIENT_ID`, `DSH_APPROVAL_APP_PRIVATE_KEY`, `DSH_APPROVAL_APP_SLUG`, scope `checks: write`): GitHub attaches a check run created with the job token to the earliest Actions check suite on the head, and when that suite belongs to this `pull_request_target` workflow the merge box omits it, so the App identity makes the association stable. The App publishes only runs whose `app.slug` is the App; job-token runs from earlier evaluations stay untouched and can coexist on a head. When the token or slug is missing, the publisher falls back to the job token and updates job-token runs only, which keeps the label on the Checks page. The App token step runs with `continue-on-error`, so a missing App configuration fails only that step and leaves the job-token fallback; a failed check-run write is logged by the publisher and never changes the status.
|
||||
|
||||
Reviewers whose calculated base repository permission is `write` or `admin` count. The [approval policy](approval-policy.json) gives `@07akioni`, `@imccyu`, `@tianyicui`, `@tianyicui-bot`, `@turtle1999`, and `@turtle2099` two points each; every other write-capable reviewer gets one point. The pull-request author’s own review and reviewers without write permission do not count.
|
||||
Reviewers whose calculated base repository permission is `write` or `admin` count. The [approval policy](approval-policy.json) gives `@07akioni`, `@CreatixChu`, `@imccyu`, `@LegGasai`, `@tianyicui`, `@tianyicui-bot`, `@turtle1999`, and `@turtle2099` two points each; every other write-capable reviewer gets one point. The pull-request author’s own review and reviewers without write permission do not count.
|
||||
|
||||
The PR author contributes `min(100, mergedPRCount) × 11 / 1000` points: 0 merged PRs → 0 points, 50 → 0.55, and 100 or more → 1.1. The publisher counts only merged PRs in this repository using the author’s immutable account ID, excluding the current PR. It stops at 100 matches and rejects incomplete history responses. Counts refresh at the next subscribed evaluation event. Author credit is separate from reviewer approvals and cannot satisfy the two-point requirement alone; the author’s own review remains excluded. Human and bot authors, including Dependabot, use the same rule. Drafts, blocking reviews, and sufficient reviewer points skip history lookup; logs mark credit as not evaluated. Otherwise, logs show author credit and the capped count separately. Below the cap, counting may scan the repository’s entire merged history; a failed required lookup publishes an error.
|
||||
The PR author contributes `min(100, mergedPRCount) × 11 / 1000` points: 0 merged PRs → 0 points, 50 → 0.55, and 100 or more → 1.1. The publisher counts only merged PRs in this repository using the author’s immutable account ID, excluding the current PR. It stops at 100 matches and rejects incomplete history responses. Counts refresh at the next subscribed evaluation event. Author credit is separate from reviewer approvals and cannot satisfy the two-point requirement alone; the author’s own review remains excluded. Human and bot authors, including Dependabot, use the same rule, except that PRs authored by `@turtle2099` receive a fixed 0.2 points without a history lookup. Drafts, blocking reviews, and sufficient reviewer points skip history lookup; logs mark credit as not evaluated. Otherwise, logs show author credit and the capped count, or the fixed credit, separately. Below the cap, counting may scan the repository’s entire merged history; a failed required lookup publishes an error.
|
||||
|
||||
A one-point approval receives weight `min(2, 1 + 4 × ownedLines / totalLines)` from modified or deleted old production-code lines, attributed by `git blame` at the merge base of the live base branch and exact reviewed head. Ownership of 0%, 12.5%, and 25% gives 1, 1.5, and 2 points; higher ownership remains capped at 2. The success threshold remains 2 total points, without rounding the score. New lines do not enter the denominator, and an empty denominator gives no boost. Existing two-point weights remain unchanged. GitHub commit-author accounts identify reviewers across author emails; unlinked authors remain in the denominator without contributing to a reviewer. The publisher logs measured ownership. It skips attribution when reviewer points plus author credit already meet the threshold or a blocking review exists. Displayed scores use at most three decimal places; the decision uses unrounded scores with a tolerance of `1e-12` points for floating-point error. The curve endpoints come from the policy’s default and required points.
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
"defaultPoints": 1,
|
||||
"reviewerPoints": {
|
||||
"07akioni": 2,
|
||||
"CreatixChu": 2,
|
||||
"imccyu": 2,
|
||||
"LegGasai": 2,
|
||||
"tianyicui": 2,
|
||||
"tianyicui-bot": 2,
|
||||
"turtle1999": 2,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/** Author credit from merged pull requests in the same repository. */
|
||||
/** Author credit from merged pull requests in the same repository, or fixed points for listed logins. */
|
||||
const CAP_COUNT = 100
|
||||
/** Author points that replace merged-history credit, keyed by lowercase login. */
|
||||
export const FIXED_AUTHOR_POINTS = new Map([['turtle2099', 0.2]])
|
||||
|
||||
/**
|
||||
* Convert merged PR count to author points, capped at 1.1.
|
||||
|
||||
@@ -5,7 +5,7 @@ import process from 'node:process'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
import { productionOwnership, LOGIN } from './blame-ownership.mjs'
|
||||
import { authorCreditPoints, countMergedAuthorPulls } from './author-weight.mjs'
|
||||
import { FIXED_AUTHOR_POINTS, authorCreditPoints, countMergedAuthorPulls } from './author-weight.mjs'
|
||||
|
||||
const API_VERSION = '2026-03-10'
|
||||
const MAX_PULL_REQUEST_RECORDS = 3_000
|
||||
@@ -211,7 +211,7 @@ function timestamp(value, subject) {
|
||||
/**
|
||||
* Evaluate approval points from current reviews and repository permissions.
|
||||
* @param {{event: unknown, policySource: string, api: (path: string, options?: {method?: string, body?: unknown}) => Promise<unknown>, getOwnership?: typeof productionOwnership, getMergedCount?: typeof countMergedAuthorPulls}} options Runtime inputs.
|
||||
* @returns {Promise<{pull: {repository: string, number: number, headSha: string}, state: 'pending' | 'success', description: string, points: number, authorCredit: {mergedCount: number, points: number} | null, requiredPoints: number, approvals: Array<{login: string, points: number, delegatedTo?: string, ownership?: {ownedLines: number, totalLines: number}}>, delegations: Array<{login: string, delegatedTo: string, commentId: number, reviewIds: number[], approved: boolean}>, blockers: string[], ignoredReviewers: string[]}>} Approval decision and status payload fields; approval login owns the points, delegatedTo supplies its decision, delegations contains eligible active commands and their superseded decision review IDs, and null author credit means history was not evaluated.
|
||||
* @returns {Promise<{pull: {repository: string, number: number, headSha: string}, state: 'pending' | 'success', description: string, points: number, authorCredit: {mergedCount: number | null, points: number} | null, requiredPoints: number, approvals: Array<{login: string, points: number, delegatedTo?: string, ownership?: {ownedLines: number, totalLines: number}}>, delegations: Array<{login: string, delegatedTo: string, commentId: number, reviewIds: number[], approved: boolean}>, blockers: string[], ignoredReviewers: string[]}>} Approval decision and status payload fields; approval login owns the points, delegatedTo supplies its decision, delegations contains eligible active commands and their superseded decision review IDs, null author credit means credit was not evaluated, and null mergedCount means fixed author points.
|
||||
*/
|
||||
export async function evaluateApproval({ event, policySource, api, getOwnership = productionOwnership, getMergedCount = countMergedAuthorPulls }) {
|
||||
const pull = pullRequestFromEvent(event)
|
||||
@@ -264,8 +264,9 @@ export async function evaluateApproval({ event, policySource, api, getOwnership
|
||||
let authorCredit = null
|
||||
const reviewerPoints = approvals.reduce((sum, approval) => sum + approval.points, 0)
|
||||
if (blockers.length === 0 && reviewerPoints < policy.requiredPoints) {
|
||||
const mergedCount = await getMergedCount(pull, api)
|
||||
authorCredit = { mergedCount, points: authorCreditPoints(mergedCount) }
|
||||
const fixedPoints = FIXED_AUTHOR_POINTS.get(pull.author.toLowerCase())
|
||||
const mergedCount = fixedPoints === undefined ? await getMergedCount(pull, api) : null
|
||||
authorCredit = { mergedCount, points: fixedPoints ?? authorCreditPoints(mergedCount) }
|
||||
}
|
||||
const pointsBeforeOwnership = reviewerPoints + (authorCredit?.points ?? 0)
|
||||
if (blockers.length === 0 && pointsBeforeOwnership < policy.requiredPoints
|
||||
@@ -338,7 +339,7 @@ export async function runApprovalCheck({ event, policySource, api, checkApi = ap
|
||||
throw error
|
||||
}
|
||||
write(result.authorCredit
|
||||
? `Author credit: ${result.authorCredit.points} (${result.authorCredit.mergedCount} merged PRs).`
|
||||
? `Author credit: ${result.authorCredit.points} (${result.authorCredit.mergedCount === null ? `fixed for @${pull.author}` : `${result.authorCredit.mergedCount} merged PRs`}).`
|
||||
: `Author credit: not evaluated (${pull.draft ? 'draft' : result.blockers.length ? 'blocking review' : 'reviewer points suffice'}).`)
|
||||
write(`Approval score: ${result.points}/${result.requiredPoints}.`)
|
||||
writeList(write, 'Counted approvals', result.approvals.map(({ login, points, ownership, delegatedTo }) =>
|
||||
|
||||
@@ -45,7 +45,9 @@ test('loads the repository approval score policy', () => {
|
||||
assert.equal(policy.defaultPoints, 1)
|
||||
assert.deepEqual([...policy.reviewerPoints], [
|
||||
['07akioni', 2],
|
||||
['creatixchu', 2],
|
||||
['imccyu', 2],
|
||||
['leggasai', 2],
|
||||
['tianyicui', 2],
|
||||
['tianyicui-bot', 2],
|
||||
['turtle1999', 2],
|
||||
@@ -668,6 +670,21 @@ for (const [mergedCount, credit] of [[0, 0], [1, 0.011], [50, 0.55], [99, 1.089]
|
||||
})
|
||||
}
|
||||
|
||||
test('turtle2099 contributes fixed author points without a history lookup', async () => {
|
||||
const output = []
|
||||
const result = await runApprovalCheck({
|
||||
event: pullRequestEvent({ author: 'Turtle2099' }), policySource, runUrl: 'https://github.example/run/1',
|
||||
getMergedCount: async () => { throw new Error('fixed author credit must skip history') },
|
||||
getOwnership: async () => ({ totalLines: 10, reviewerLines: { writer: 2 } }),
|
||||
api: async path => path.includes('/reviews?') ? [review('writer', 'APPROVED')] : { permission: 'write' },
|
||||
write: line => output.push(line),
|
||||
})
|
||||
assert.deepEqual(result.authorCredit, { mergedCount: null, points: 0.2 })
|
||||
assert.equal(result.approvals[0].points, 1.8)
|
||||
assert.equal(result.state, 'success')
|
||||
assert.ok(output.includes('Author credit: 0.2 (fixed for @Turtle2099).'))
|
||||
})
|
||||
|
||||
test('combines author credit and reviewer ownership at the passing threshold', async () => {
|
||||
for (let mergedCount = 0; mergedCount <= 90; mergedCount++) {
|
||||
const result = await evaluateApproval({
|
||||
|
||||
@@ -58,6 +58,7 @@ packages/ @deepseek-ai/dsh-<pkg> workspaces at packages/<group>/<pkg>/
|
||||
identity/ anonymous identity
|
||||
settings/ user settings
|
||||
credentials/ credentials/authorization
|
||||
account/ DeepSeek
|
||||
acp/ automation-only ACP
|
||||
interaction/ human interaction
|
||||
boot/ application boot
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"@deepseek-ai/dsh-schedule": "workspace:*",
|
||||
"@deepseek-ai/dsh-sdk-app": "workspace:*",
|
||||
"@deepseek-ai/dsh-sdk-minimal": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-persistence-sqlite": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-projection": "workspace:*",
|
||||
"@deepseek-ai/dsh-session-reference": "workspace:*",
|
||||
"@deepseek-ai/dsh-skill": "workspace:*",
|
||||
|
||||
@@ -85,14 +85,18 @@ describe('dsh run with Agent Teams enabled', () => {
|
||||
expect(files).toHaveLength(4)
|
||||
const logs = await Promise.all(files.map(file => readFile(join(sessions, file), 'utf8')))
|
||||
const parsed = logs.map(records)
|
||||
const workflowTask = [
|
||||
{ type: 'text', text: 'Agent lead sent a message: ' },
|
||||
{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' },
|
||||
]
|
||||
const workflowChild = parsed.find(log => log.some(record => record.type === 'user/message'
|
||||
&& JSON.stringify((record.data as { content: unknown }).content) === JSON.stringify([{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' }])))
|
||||
&& JSON.stringify((record.data as { content: unknown }).content) === JSON.stringify(workflowTask)))
|
||||
expect(workflowChild).toBeDefined()
|
||||
const workflowDescriptor = workflowChild!.find(record => record.type === 'subagent/descriptor')?.data as Record<string, unknown>
|
||||
expect(workflowDescriptor).toMatchObject({ mode: 'continuable', provider: 'spawn' })
|
||||
expect(workflowChild!.filter(record => record.type === 'user/message'
|
||||
&& (record.data as { source: { kind: string } }).source.kind === 'user').map(record => record.data))
|
||||
.toEqual([expect.objectContaining({ content: [{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' }] })])
|
||||
&& (record.data as { source: { kind: string } }).source.kind === 'agent-message').map(record => record.data))
|
||||
.toEqual([expect.objectContaining({ content: workflowTask })])
|
||||
const root = parsed.find((log) => {
|
||||
const header = log[0]
|
||||
return header?.type === 'session' && typeof header.parentSession !== 'string'
|
||||
@@ -111,7 +115,8 @@ describe('dsh run with Agent Teams enabled', () => {
|
||||
expect(eventTypes).not.toContain('team/message/queued')
|
||||
expect(eventTypes).not.toContain('team/message/delivered')
|
||||
const peerMessages = parsed.flatMap(log => log.filter(record => record.type === 'user/message'
|
||||
&& (record.data as { source: { kind: string } }).source.kind === 'agent-message'))
|
||||
&& (record.data as { source: { kind: string } }).source.kind === 'agent-message'
|
||||
&& (record.data as { source: { senderSessionId: string } }).source.senderSessionId !== root![0]?.id))
|
||||
expect(peerMessages).toHaveLength(2)
|
||||
const taskEvents = root!.filter(record => record.type === 'team/task')
|
||||
expect(taskEvents.filter((record) => {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"boolean",
|
||||
"null"
|
||||
],
|
||||
"description": "Allows patch indexing and insertion into an entry-list config; does not select the plugin implementation."
|
||||
"description": "Allows patch indexing and insertion into an entry-list config, which a group: true entry requires; does not select the plugin implementation."
|
||||
},
|
||||
"disabled": {
|
||||
"anyOf": [
|
||||
@@ -249,6 +249,28 @@
|
||||
{
|
||||
"$ref": "#/$defs/entryMetadata"
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"group": {
|
||||
"const": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"group"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"config": {
|
||||
"$ref": "#/$defs/entryList"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"config"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{
|
||||
"name": "cua_run_code",
|
||||
"title": "Computer use program",
|
||||
"description": "Run a TypeScript program to observe and operate desktop applications. The global cua object is ready to use; retain application and window objects across calls. Only tools.cua is available inside the program. Call other session tools directly. Use inspect(...values) to display selected text and images. The program contains TypeScript REPL statements; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level declarations and await are supported; top-level return is not supported. Use inspect(...values) to display output. Do not use console. Use the raw form of a template literal only for short text whose backslashes must stay exactly as written, such as a regular expression; write other text, in particular file contents and commands, as ordinary strings. Write file contents as an array of quoted strings, one line each, joined with newlines; never as one template literal. The program runs in strict mode: assigning an undeclared name throws, so use globalThis for intentional globals; eval and new Function are unavailable. Variables, functions, and imported modules remain in memory for this Agent across calls. Each call runs one program in its own top-level scope. Its top-level let, const, var, class, and function declarations, and the names it received from earlier programs, are copied into the top-level scope of later programs: later programs receive copies of these variables, not references to them, so an object they hold is still shared. In one program, either use a copied name or declare it again; do not declare a name and also use its copied value. Assigning to a copied name, even one declared with const, changes only this program's copy, which later programs receive. Do not declare var inside blocks; a block-level var changes which value later programs copy. Functions and still-running code from earlier programs keep the values they captured, and assignments they make later are not copied; keep shared mutable state in objects. If a program fails before a declaration of an existing name finishes, later programs keep that name's earlier value. Use await import(...) for modules; require and module are unavailable. Relative import specifiers resolve from the working directory of this environment's first program, while process.cwd() and relative file paths follow each program's working directory. Direct filesystem access follows the environment's launch-time sandbox policy; process.env starts empty. Timeout and cancellation results say whether retained variables were preserved or cleared. Restart, sandbox changes, output overflow, or process failure clears them. Recreate missing variables and resources; conversation history does not restore state. Earlier mutations and tool effects are not rolled back. Approved sandbox escalations use a fresh environment and discard its variables afterward. Await tools and cleanup before the program ends; unfinished tools reject. After completion, timeout, or cancellation, new tool calls are rejected and captured output is discarded; background work may still change state. Await child-process completion before the program ends; raw output belongs to the active evaluation. Each program starts in the Session's current directory. Running programs keep their initial directory. A sandbox escalation approves this complete program for one execution only. Nested tools retain their own policies and approvals. Request wider access only after evidence of a denial. Earlier effects may already have completed: inspect them before explicitly retrying. Programs are never replayed automatically.",
|
||||
"description": "Run a TypeScript program to observe and operate desktop applications. The global cua object is ready to use; retain application and window objects across calls. Only tools.cua is available inside the program. Call other session tools directly. Use inspect(...values) to display selected text and images. The program contains TypeScript REPL statements; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level declarations and await are supported; top-level return is not supported. Use inspect(...values) to display output. Do not use console. Use the raw form of a template literal only for short text whose backslashes must stay exactly as written, such as a regular expression; write other text, in particular file contents and commands, as ordinary strings. Write file contents as an array of quoted strings, one line each, joined with newlines; never as one template literal. The program runs in strict mode: assigning an undeclared name throws, so use globalThis for intentional globals; eval and new Function are unavailable. Variables, functions, and imported modules remain in memory for this Agent across calls. Each call runs one program in its own top-level scope. Its top-level let, const, var, class, and function declarations, and the names it received from earlier programs, are copied into the top-level scope of later programs: later programs receive copies of these variables, not references to them, so an object they hold is still shared. In one program, either use a copied name or declare it again; do not declare a name and also use its copied value. Assigning to a copied name, even one declared with const, changes only this program's copy, which later programs receive. Do not declare var inside blocks; a block-level var changes which value later programs copy. Functions and still-running code from earlier programs keep the values they captured, and assignments they make later are not copied; keep shared mutable state in objects. If a program fails before a declaration of an existing name finishes, later programs keep that name's earlier value. Use await import(...) for modules; require and module are unavailable. Relative import specifiers resolve from the working directory of this environment's first program, while process.cwd() and relative file paths follow each program's working directory. Direct filesystem access follows the environment's launch-time sandbox policy; process.env starts empty. Timeout and cancellation results say whether retained variables were preserved or cleared. Restart, sandbox changes, or process failure clears them. Recreate missing variables and resources; conversation history does not restore state. Earlier mutations and tool effects are not rolled back. Approved sandbox escalations use a fresh environment and discard its variables afterward. Await tools and cleanup before the program ends; unfinished tools reject. After completion, timeout, or cancellation, new tool calls are rejected and captured output is discarded; background work may still change state. Await child-process completion before the program ends; raw output belongs to the active evaluation. Each program starts in the Session's current directory. Running programs keep their initial directory. A sandbox escalation approves this complete program for one execution only. Nested tools retain their own policies and approvals. Request wider access only after evidence of a denial. Earlier effects may already have completed: inspect them before explicitly retrying. Programs are never replayed automatically.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"request/context","seq":11,"time":0,"data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"session/title","seq":12,"time":0,"data":{"title":"say pong","messageSeqs":[8],"source":{"kind":"fallback"}}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"session/title-llm-request","seq":13,"time":0,"data":{"titleProvider":"session-title-first-prompt-llm","messageSeqs":[8],"route":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"system":"Create a concise title for an AI coding-assistant session from the supplied human messages.\nReturn only the title on one line, **in plain text of natural language**, with no quotes, prefix, explanation, Markdown, XML, or terminal control codes. No code is allowed.\nUse the language of the messages.\nAim for about 5 words in non-CJK languages or 10 CJK characters.\nIf the messages give little to name, still return a short best-effort title, such as Greeting, instead of explaining.","messages":[{"content":[{"type":"text","text":"Generate the session title from this JSON array of human messages:\n[{\"seq\":8,\"text\":\"say pong\"}]"}],"source":{"kind":"dsh-session-title-llm"},"role":"user","id":"{{sessionId}}"}],"maxTokens":4096,"reasoningEffort":"off"}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"assistant/attempt","seq":14,"time":0,"data":{"turn":1,"step":1,"stream":[{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"error","failure":{"message":"llm-deepseek: the API key resolved from DEEPSEEK_API_KEY contains characters no HTTP header can carry; set DEEPSEEK_API_KEY to the raw key alone (the web Models page writes it)","code":"INVALID_CREDENTIAL"}}}}]}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"assistant/attempt","seq":14,"time":0,"data":{"turn":1,"step":1,"stream":[{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"error","failure":{"message":"llm-deepseek-keyless: the API key resolved from DEEPSEEK_API_KEY contains characters no HTTP header can carry; set DEEPSEEK_API_KEY to the raw key alone (the web Models page writes it)","code":"INVALID_CREDENTIAL"}}}}]}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"step/end","seq":15,"time":0,"data":{"turn":1,"step":1}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/end","seq":16,"time":0,"data":{"turn":1,"reason":{"kind":"error","error":{"message":"llm-deepseek: the API key resolved from DEEPSEEK_API_KEY contains characters no HTTP header can carry; set DEEPSEEK_API_KEY to the raw key alone (the web Models page writes it)","code":"INVALID_CREDENTIAL"}}}}}
|
||||
{"type":"session_event","sessionId":"{{sessionId}}","event":{"type":"turn/end","seq":16,"time":0,"data":{"turn":1,"reason":{"kind":"error","error":{"message":"llm-deepseek-keyless: the API key resolved from DEEPSEEK_API_KEY contains characters no HTTP header can carry; set DEEPSEEK_API_KEY to the raw key alone (the web Models page writes it)","code":"INVALID_CREDENTIAL"}}}}}
|
||||
{"type":"result","sessionId":"{{sessionId}}","output":""}
|
||||
+4
-5
@@ -2,19 +2,18 @@
|
||||
{"type":"subagent/descriptor","data":{"version":3,"mode":"continuable","provider":"spawn","label":"Delegated write probe","agentProvider":"deepseek-official","agentModel":"deepseek-v4-flash","agentReasoningEffort":"low"}}
|
||||
{"type":"sandbox/mode","data":{"mode":"read-only","source":"delegation"}}
|
||||
{"type":"approval/policy","data":{"policy":"never","source":"delegation"}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"}]}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"}]}}
|
||||
{"type":"turn/start","data":{"turn":1}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
|
||||
{"type":"step/start","data":{"turn":1,"step":1}}
|
||||
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
|
||||
{"type":"session/title","data":{"title":"Use the write tool exactly","messageSeqs":[8],"source":{"kind":"fallback"}}}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"child-write","name":"write","arguments":"{\"file_path\": \"inherited.txt\", \"content\": \"escaped\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"child-write","name":"write","args":["{\"file_path\": \"inherited.txt\", \"content\": \"escaped\"}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"child-write","name":"write","arguments":"{\"file_path\": \"inherited.txt\", \"content\": \"escaped\"}"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
|
||||
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"child-write","name":"write","arguments":"{\"file_path\": \"inherited.txt\", \"content\": \"escaped\"}"}}
|
||||
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"child-write"},"toolCallId":"child-write","content":[{"type":"text","text":"Error: [sandbox: file access denied under read-only mode]\n[sandbox: escalation available — retry this exact operation once with sandbox_permissions (the narrowest wider mode that suffices) + justification; the approval prompt asks the user]"}],"isError":true,"id":"{{sessionId}}"},"error":{"name":"FsError","code":"FS_SANDBOX_DENIED"}},"sourceEventSeqs":[14],"surfaceOp":"append"}
|
||||
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"child-write"},"toolCallId":"child-write","content":[{"type":"text","text":"Error: [sandbox: file access denied under read-only mode]\n[sandbox: escalation available — retry this exact operation once with sandbox_permissions (the narrowest wider mode that suffices) + justification; the approval prompt asks the user]"}],"isError":true,"id":"{{sessionId}}"},"error":{"name":"FsError","code":"FS_SANDBOX_DENIED"}},"sourceEventSeqs":[13],"surfaceOp":"append"}
|
||||
{"type":"step/end","data":{"turn":1,"step":1}}
|
||||
{"type":"step/start","data":{"turn":1,"step":2}}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"CHILD_DENIED [sandbox: file access denied under read-only mode]"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":0,"index":0,"dt":[],"texts":["CHILD_DENIED [sandbox: file access denied under read-only mode]"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"CHILD_DENIED [sandbox: file access denied under read-only mode]"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
|
||||
|
||||
+3
-4
@@ -2,16 +2,15 @@
|
||||
{"type":"subagent/descriptor","data":{"version":3,"mode":"continuable","provider":"spawn","label":"Return child result","agentProvider":"deepseek-official","agentModel":"deepseek-v4-flash"}}
|
||||
{"type":"sandbox/mode","data":{"mode":"workspace-write","source":"delegation"}}
|
||||
{"type":"approval/policy","data":{"policy":"never","source":"delegation"}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"}]}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"}]}}
|
||||
{"type":"turn/start","data":{"turn":1}}
|
||||
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
|
||||
{"type":"step/start","data":{"turn":1,"step":1}}
|
||||
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Agent lead sent a message: "},{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"agent-message","form":"relay","senderSessionId":"{{sessionId}}"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Messages from other agents begin with \"Agent <name> sent a message:\". Other user messages come from the human user, who reads this conversation directly. You can still message other agents to coordinate, but answer the human user in your reply."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
|
||||
{"type":"session/title","data":{"title":"Reply with exactly CHILD_RESULT and","messageSeqs":[8],"source":{"kind":"fallback"}}}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"text","text":"CHILD_RESULT"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":0,"index":0,"dt":[],"texts":["CHILD_RESULT"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"CHILD_RESULT"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
|
||||
{"type":"step/end","data":{"turn":1,"step":1}}
|
||||
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
|
||||
@@ -18,7 +18,7 @@ function latestAssistantCalls(messages) {
|
||||
|
||||
function hasNewCoordinationInput(messages) {
|
||||
const toolIndex = messages.findLastIndex(message => message.role === 'tool')
|
||||
return messages.some((message, index) => index > toolIndex && message.role === 'user'
|
||||
return toolIndex >= 0 && messages.some((message, index) => index > toolIndex && message.role === 'user'
|
||||
&& ['agent-message', 'subagent-settled'].includes(message.source?.kind))
|
||||
}
|
||||
|
||||
@@ -191,13 +191,15 @@ function lead(messages) {
|
||||
class TeamFixtureAdapter extends LlmAdapter {
|
||||
async * stream(options) {
|
||||
const tools = options.tools.map(tool => tool.name)
|
||||
const initial = options.messages.findLast(message => message.role === 'user' && message.source.kind === 'user')
|
||||
const workflowChild = initial?.content[0]?.text === 'TEAM_WORKFLOW_CHILD'
|
||||
const initial = options.messages.find(message => message.role === 'user'
|
||||
&& ['user', 'agent-message'].includes(message.source.kind))
|
||||
const taskContent = initial?.source.kind === 'agent-message' ? initial.content.slice(1) : initial?.content
|
||||
const workflowChild = taskContent?.[0]?.text === 'TEAM_WORKFLOW_CHILD'
|
||||
const context = options.messages.findLast(message => message.source?.kind === 'runtime-context')
|
||||
const section = name => context?.source.sections?.find(candidate => candidate.name === name)?.text
|
||||
const role = section('subagent:identity')
|
||||
const parentId = role?.match(/You are a subagent delegated by agent "([^"]+)"/u)?.[1]
|
||||
const task = initial?.content.filter(block => block.type === 'text').map(block => block.text).join('\n')
|
||||
const task = taskContent?.filter(block => block.type === 'text').map(block => block.text).join('\n')
|
||||
if (!workflowChild && (!tools.includes('subagent') || !tools.includes('workflow') || !tools.includes('team_task_create'))) {
|
||||
throw new Error('Team profile is missing delegation, workflow, or task tools')
|
||||
}
|
||||
|
||||
@@ -1116,15 +1116,22 @@ describe('headless stream-json snapshots', () => {
|
||||
const parent = logs.find(log => typeof log.header.parentSession !== 'string')
|
||||
if (parent === undefined) throw new Error('Agent Teams snapshot did not persist its Lead')
|
||||
const rows = parseJsonl(parent.content)
|
||||
const workflowTask = [
|
||||
{ type: 'text', text: 'Agent lead sent a message: ' },
|
||||
{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' },
|
||||
]
|
||||
const workflowChild = logs.find(log => parseJsonl(log.content).some(row => row.type === 'user/message'
|
||||
&& JSON.stringify((row.data as JsonObject).content) === JSON.stringify([{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' }])))
|
||||
&& JSON.stringify((row.data as JsonObject).content) === JSON.stringify(workflowTask)))
|
||||
if (workflowChild === undefined) throw new Error('Team profile did not persist its workflow child')
|
||||
const workflowRows = parseJsonl(workflowChild.content)
|
||||
expect(workflowRows.find(row => row.type === 'subagent/descriptor')?.data)
|
||||
.toMatchObject({ mode: 'continuable', provider: 'spawn' })
|
||||
expect(workflowRows.filter(row => row.type === 'user/message'
|
||||
&& ((row.data as JsonObject).source as JsonObject).kind === 'user').map(row => row.data))
|
||||
.toEqual([expect.objectContaining({ content: [{ type: 'text', text: 'TEAM_WORKFLOW_CHILD' }] })])
|
||||
&& ((row.data as JsonObject).source as JsonObject).kind === 'agent-message').map(row => row.data))
|
||||
.toEqual([expect.objectContaining({
|
||||
content: workflowTask,
|
||||
source: { kind: 'agent-message', form: 'relay', senderSessionId: parent.header.id },
|
||||
})])
|
||||
const teammates = rows.filter(row => row.type === 'subagent/catalog')
|
||||
.flatMap(row => typeof (row.data as JsonObject).label === 'string' && ((row.data as JsonObject).label as string).startsWith('Own deterministic ') ? [(row.data as JsonObject).label as string] : [])
|
||||
const tasks = rows.filter(row => row.type === 'team/task')
|
||||
@@ -1160,6 +1167,7 @@ describe('headless stream-json snapshots', () => {
|
||||
const source = (row.data as JsonObject).source
|
||||
return typeof source === 'object' && source !== null && !Array.isArray(source)
|
||||
&& (source as JsonObject).kind === 'agent-message'
|
||||
&& (source as JsonObject).senderSessionId !== parent.header.id
|
||||
})
|
||||
const openTurnStart = implementerRows.findLastIndex((row, index) => (
|
||||
index < steeredMessageIndex && row.type === 'turn/start'
|
||||
@@ -1176,11 +1184,11 @@ describe('headless stream-json snapshots', () => {
|
||||
const identities = logs.flatMap((log) => {
|
||||
if (log === parent || log === workflowChild) return []
|
||||
const initial = parseJsonl(log.content).find(row => row.type === 'user/message'
|
||||
&& ((row.data as JsonObject).source as JsonObject).kind === 'user')
|
||||
&& ((row.data as JsonObject).source as JsonObject).kind === 'agent-message')
|
||||
if (initial === undefined) throw new Error('Teammate Session has no initial task')
|
||||
const content = (initial.data as JsonObject).content as JsonObject[]
|
||||
// The task block is followed by the standard return guidance naming the Lead.
|
||||
expect(content).toHaveLength(2)
|
||||
expect(content).toHaveLength(3)
|
||||
expect(content[0]).toEqual({ type: 'text', text: 'Agent lead sent a message: ' })
|
||||
const context = parseJsonl(log.content).find(row => row.type === 'user/message'
|
||||
&& ((row.data as JsonObject).source as JsonObject).kind === 'runtime-context')
|
||||
const source = (context?.data as JsonObject)?.source as JsonObject
|
||||
|
||||
@@ -1141,7 +1141,7 @@ describe('a user preset declared from the shipped cordis rows', () => {
|
||||
expect(listed.isError).toBe(false)
|
||||
const providers = (JSON.parse(resultText(listed)) as { providers: Array<{ id: string; platform: string }> }).providers
|
||||
expect(providers.filter(provider => provider.platform === 'host').map(provider => provider.id))
|
||||
.toEqual(['Service', 'Event', 'Config', 'Tool'])
|
||||
.toEqual(['Service', 'Event', 'Config', 'Runtime', 'Tool'])
|
||||
|
||||
// The `Tool` provider is the one built over the host context: it
|
||||
// answers with the shared registry's view of the REQUESTING agent,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"path": "../../packages/host/webserver"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/credentials/deepseek-account"
|
||||
"path": "../../packages/account/deepseek-account"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/boot/plugin-manager"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 127ea90553cb6af7
|
||||
zh: 7b1c5aec8558c684
|
||||
/deepseek-harness-desktop/application-overview:
|
||||
en: 8b2a35655a384403
|
||||
zh: 8cb7c8138cae59db
|
||||
en: 7414f87908fbffaf
|
||||
zh: 8ff4fc1d83879c25
|
||||
/deepseek-harness-desktop/terminal-command:
|
||||
en: 5f2d25a1d8472647
|
||||
zh: 2acb5c5d7d1917e2
|
||||
|
||||
@@ -51,7 +51,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/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/account/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.
|
||||
|
||||
|
||||
@@ -51,7 +51,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/README.zh.md#use-this-package)。更新策略额外上报架构、更新通道和内置运行时版本。 原生账号状态解析器接受 `no-response` 登录失败,并在供 UI 使用的安全投影中保留该错误码。
|
||||
Desktop Host 的 Platform API 请求与更新策略请求用相同的 Platform 客户端请求头标识已安装客户端:平台、客户端版本、语言、以秒为单位的时区偏移,以及有意保持为空的 bundle id。账号操作按调用逐次传入调用界面的身份;账号 provider 管理[仅 API 使用的请求头配置](../../packages/account/deepseek-account/README.zh.md#use-this-package)。更新策略额外上报架构、更新通道和内置运行时版本。 原生账号状态解析器接受 `no-response` 登录失败,并在供 UI 使用的安全投影中保留该错误码。
|
||||
|
||||
账号凭据被服务端判定失效后,未配置官方 API key 时返回 Welcome;有可用 API key 时保持工作区打开。主动退出登录遵循相同规则。Welcome 和工作区均显示本地化的登录失效提示。
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"path": "../../packages/client/ui-primitives"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/credentials/deepseek-account"
|
||||
"path": "../../packages/account/deepseek-account"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/client/product-analytics/tsconfig.client.json"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"path": "../../packages/util/home-paths"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/credentials/deepseek-account"
|
||||
"path": "../../packages/account/deepseek-account"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/api/gateway/tsconfig.host.json"
|
||||
|
||||
@@ -191,11 +191,6 @@ class ResizeObserverStub {
|
||||
unobserve(): void {}
|
||||
}
|
||||
|
||||
class EventSourceStub {
|
||||
addEventListener(): void {}
|
||||
close(): void {}
|
||||
}
|
||||
|
||||
const win = window as FixtureWindow
|
||||
let unmount: (() => Promise<void>) | undefined
|
||||
let mountedRemote: RemoteMock | undefined
|
||||
@@ -244,7 +239,6 @@ export function installAssembledBootEnv(): void {
|
||||
Object.defineProperty(navigator, 'language', { value: 'en-US', configurable: true })
|
||||
document.title = 'DeepSeek Harness'
|
||||
vi.stubGlobal('ResizeObserver', ResizeObserverStub)
|
||||
vi.stubGlobal('EventSource', EventSourceStub)
|
||||
vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) =>
|
||||
setTimeout(() => { callback(0) }, 0) as unknown as number)
|
||||
vi.stubGlobal('cancelAnimationFrame', (id: number) => { clearTimeout(id) })
|
||||
|
||||
@@ -271,7 +271,20 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
|
||||
const opened = await context.newPage()
|
||||
tripwires.push(watchConsole(opened))
|
||||
await opened.addInitScript(() => {
|
||||
Object.defineProperty(globalThis, 'dshDesktop', { value: { protocolVersion: 1 } })
|
||||
// The update carrier stays idle until a scenario publishes a status for the account row.
|
||||
let update: { phase: string; version?: string } = { phase: 'idle' }
|
||||
const updateListeners = new Set<(state: typeof update) => void>()
|
||||
Object.defineProperty(globalThis, '__bonusPublishUpdate', {
|
||||
value: (state: typeof update) => { update = state; for (const listener of updateListeners) listener(state) },
|
||||
})
|
||||
Object.defineProperty(globalThis, 'dshDesktop', { value: { protocolVersion: 1, updates: {
|
||||
status: () => Promise.resolve(update),
|
||||
open: () => Promise.resolve(),
|
||||
subscribe: (listener: (state: typeof update) => void) => {
|
||||
updateListeners.add(listener)
|
||||
return () => { updateListeners.delete(listener) }
|
||||
},
|
||||
} } })
|
||||
// The embedded Platform view is a native child window owned by the Desktop shell.
|
||||
// The double answers immediately and records the calls, so the scenario observes
|
||||
// which page was opened and that returning destroyed the view.
|
||||
@@ -667,6 +680,30 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
|
||||
})
|
||||
expect(transition).toBe('0.25s ease-out')
|
||||
observations.push(`stack.initial cards=3 acks=stack-first widths=260,252 inset=10 offset=-4 transition=${transition}`)
|
||||
// A Desktop update status shares the account row and leaves the card row at full width.
|
||||
const publishUpdate = (state: { phase: string; version?: string }) => stackPage.evaluate((value) => {
|
||||
(globalThis as typeof globalThis & { __bonusPublishUpdate: (next: typeof value) => void }).__bonusPublishUpdate(value)
|
||||
}, state)
|
||||
await publishUpdate({ phase: 'installing', version: '0.1.5' })
|
||||
const updateTag = stackPage.getByText('正在准备重启…', { exact: true })
|
||||
await updateTag.waitFor()
|
||||
const artifactDir = fileURLToPath(new URL('../../../.artifacts', import.meta.url))
|
||||
await mkdir(artifactDir, { recursive: true })
|
||||
await stackPage.screenshot({ path: join(artifactDir, 'bonus-notice-update-tag.png'), clip: { x: 0, y: 560, width: 420, height: 400 } })
|
||||
const taggedBox = await cards.first().boundingBox()
|
||||
const tagBox = await updateTag.boundingBox()
|
||||
const accountBox = await stackPage.getByRole('button', { name: '账号菜单', exact: true }).boundingBox()
|
||||
expect(taggedBox!.x).toBeCloseTo(10, 0)
|
||||
expect(taggedBox!.width).toBeCloseTo(260, 0)
|
||||
expect(taggedBox!.y + taggedBox!.height).toBeLessThanOrEqual(accountBox!.y)
|
||||
expect(tagBox!.y).toBeGreaterThanOrEqual(accountBox!.y)
|
||||
expect(tagBox!.y + tagBox!.height).toBeLessThanOrEqual(accountBox!.y + accountBox!.height)
|
||||
// The card floats over the session list: the list still reaches down to the card's bottom edge.
|
||||
const listBottom = await stackPage.locator('[class*="scrollRegion"]').first().evaluate(element => element.getBoundingClientRect().bottom)
|
||||
expect(listBottom).toBeGreaterThanOrEqual(taggedBox!.y + taggedBox!.height - 1)
|
||||
observations.push('stack.update-tag card=260 left-inset=10 card-above-account-row=true tag-in-account-row=true floats-over-list=true')
|
||||
await publishUpdate({ phase: 'idle' })
|
||||
await updateTag.waitFor({ state: 'detached' })
|
||||
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
|
||||
@@ -700,8 +737,6 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
|
||||
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') })
|
||||
await stackPage.emulateMedia({ colorScheme: 'dark' })
|
||||
await expect.poll(() => stackPage.locator('body').getAttribute('data-ds-dark-theme')).not.toBeNull()
|
||||
@@ -736,6 +771,16 @@ describe.skipIf(MODE === 'record')('web e2e: bonus notice', () => {
|
||||
await expect.poll(() => platform.acks.length).toBe(ackStart + 2)
|
||||
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')
|
||||
// In a short window the long card scrolls its copy instead of pushing the account row out of view.
|
||||
await stackPage.setViewportSize({ width: 1440, height: 390 })
|
||||
const shortAccount = await stackPage.getByRole('button', { name: '账号菜单', exact: true }).boundingBox()
|
||||
const shortCard = await second.boundingBox()
|
||||
const copyScrolls = await second.getByRole('status').evaluate(element => element.scrollHeight > element.clientHeight)
|
||||
expect(shortAccount!.y + shortAccount!.height).toBeLessThanOrEqual(390)
|
||||
expect(shortCard!.y + shortCard!.height).toBeLessThanOrEqual(shortAccount!.y)
|
||||
expect(copyScrolls).toBe(true)
|
||||
observations.push('stack.short-window account-row-visible=true card-above-account-row=true copy-scrolls=true')
|
||||
await stackPage.setViewportSize({ width: 1440, height: 960 })
|
||||
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(['a1111111-1111-4111-8111-111111111111', 'a2222222-2222-4222-8222-222222222222', 'a3333333-3333-4333-8333-333333333333'])
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/** Real profile, Remote, and page Loader: a browser plugin receives its Host face's volatile Config and follows live edits. */
|
||||
import { cp, mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { FiberState } from '@deepseek-ai/cordis'
|
||||
import { chromium } from 'playwright'
|
||||
import { expect, it, onTestFailed, onTestFinished } from 'vitest'
|
||||
import { launchWebScaffold, watchConsole } from './scaffold.ts'
|
||||
import { ZH_BROWSER_LOCALE, saveFailureShot } from './support.ts'
|
||||
|
||||
const FIXTURE = fileURLToPath(new URL('./fixtures/plugins/fixture-synced-config', import.meta.url))
|
||||
const SCHEMASTERY = fileURLToPath(new URL('../../../vendor/schemastery', import.meta.url))
|
||||
const PACKAGE = '@fixture/synced-config'
|
||||
const ROW = 'fixture-synced-config'
|
||||
|
||||
/** What the fixture's Client face records from its synced Config object. */
|
||||
interface Observation {
|
||||
keys: string[]
|
||||
greeting: string
|
||||
account: { label: string }
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the fixture's recorded observation.
|
||||
* @param text - JSON the fixture wrote to `data-synced-config`.
|
||||
* @returns the observation.
|
||||
*/
|
||||
function parseObservation(text: string): Observation {
|
||||
const value = JSON.parse(text) as Partial<Observation> | null
|
||||
if (value === null || !Array.isArray(value.keys) || typeof value.greeting !== 'string' || typeof value.account?.label !== 'string') {
|
||||
throw new Error(`fixture-synced-config recorded an unexpected observation: ${text}`)
|
||||
}
|
||||
return value as Observation
|
||||
}
|
||||
|
||||
it('renders volatile Config without secrets or ordinary fields and updates it in place from a profile edit', async () => {
|
||||
// An installed package carries its own dependencies: the copy links the Schemastery its Host face imports.
|
||||
const installed = await mkdtemp(join(tmpdir(), 'dsh-client-config-sync-'))
|
||||
onTestFinished(() => rm(installed, { recursive: true, force: true }))
|
||||
await cp(FIXTURE, installed, { recursive: true })
|
||||
await mkdir(join(installed, 'node_modules', '@deepseek-ai'), { recursive: true })
|
||||
await symlink(SCHEMASTERY, join(installed, 'node_modules', '@deepseek-ai', 'schemastery'), 'junction')
|
||||
const scaffold = await launchWebScaffold({ profile: { packages: [{ dir: installed, enabled: true }] } })
|
||||
onTestFinished(() => scaffold.close())
|
||||
const browser = await chromium.launch()
|
||||
onTestFinished(() => browser.close())
|
||||
const entry = [...scaffold.ctx.loader.entries()].find(candidate => candidate.options.id === ROW)
|
||||
expect(entry?.fiber?.state).toBe(FiberState.ACTIVE)
|
||||
const hostFiber = entry!.fiber!
|
||||
|
||||
// The first-render HTML carries the projection: volatile values only, the secret subfield removed.
|
||||
const html = await (await scaffold.hostFetch('/')).text()
|
||||
expect(html).toContain('hello-r0')
|
||||
expect(html).not.toContain('secret-token-r0')
|
||||
expect(html).not.toContain('host-only-cache-r0')
|
||||
|
||||
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
|
||||
const console = watchConsole(page)
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-config-sync'))
|
||||
let navigations = 0
|
||||
const dataset = async () => {
|
||||
const { applies, config } = await page.evaluate(() => ({
|
||||
applies: document.documentElement.dataset.syncedApplies,
|
||||
config: document.documentElement.dataset.syncedConfig,
|
||||
}))
|
||||
return { applies, config: config === undefined ? undefined : parseObservation(config) }
|
||||
}
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
page.on('framenavigated', () => { navigations++ })
|
||||
await expect.poll(async () => (await dataset()).applies, { timeout: 20_000 }).toBe('1')
|
||||
const bootRow = await page.evaluate((id) => {
|
||||
const boot = Reflect.get(window, '__DSH_BOOT__') as { entries: { id: string; config?: unknown }[] }
|
||||
return boot.entries.find(row => row.id === id)
|
||||
}, PACKAGE)
|
||||
expect(bootRow?.config).toEqual({ greeting: 'hello-r0', account: { label: 'primary' } })
|
||||
expect(await dataset()).toEqual({
|
||||
applies: '1',
|
||||
config: { keys: ['account', 'greeting'], greeting: 'hello-r0', account: { label: 'primary' } },
|
||||
})
|
||||
|
||||
// A profile edit that changes only volatile values reaches the running activation through its references.
|
||||
const patchFile = join(scaffold.harnessHome, 'profiles', 'scaffold', 'cordis.patch.yml')
|
||||
const previous = await readFile(patchFile, 'utf8').catch(() => '')
|
||||
expect(previous.includes(ROW)).toBe(false)
|
||||
await writeFile(patchFile, [
|
||||
`- id: ${ROW}`,
|
||||
' config:',
|
||||
' cacheDir: host-only-cache-r0',
|
||||
' greeting: hello-r1',
|
||||
' account:',
|
||||
' label: secondary',
|
||||
' token: secret-token-r1',
|
||||
'',
|
||||
].join('\n'))
|
||||
await expect.poll(async () => (await dataset()).config, { timeout: 30_000 }).toEqual({
|
||||
keys: ['account', 'greeting'], greeting: 'hello-r1', account: { label: 'secondary' },
|
||||
})
|
||||
expect(scaffold.ctx.clientModules.graph().entries.find(row => row.id === PACKAGE)?.config)
|
||||
.toEqual({ greeting: 'hello-r1', account: { label: 'secondary' } })
|
||||
expect((await dataset()).applies).toBe('1')
|
||||
expect(entry!.fiber).toBe(hostFiber)
|
||||
expect(hostFiber.state).toBe(FiberState.ACTIVE)
|
||||
expect(navigations).toBe(0)
|
||||
expect(console.pageErrors).toEqual([])
|
||||
}, 120_000)
|
||||
@@ -297,20 +297,12 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
|
||||
expect(await target.locator('style[data-plugin="@fixture/live-client"]').count()).toBe(1)
|
||||
}
|
||||
|
||||
const disconnected = other.waitForEvent('requestfailed', request => request.url().includes('/plugins/events'))
|
||||
await otherContext.setOffline(true)
|
||||
// Chromium offline emulation leaves established SSE sockets open. Cycling this
|
||||
// fixture's transport plugin closes them without replacing the Host or profile.
|
||||
// Restarting the Host transport ends every plugin-events stream; each page reopens it and reconciles from the
|
||||
// new baseline, so a later change still reaches both pages.
|
||||
const transport = [...scaffold.ctx.loader.entries()].find(entry => entry.options.name === '@deepseek-ai/dsh-client-hmr')!.fiber!
|
||||
const reconnected = page.waitForResponse(response => response.url().includes('/plugins/events') && response.status() === 200)
|
||||
await transport.restart()
|
||||
await disconnected
|
||||
await reconnected
|
||||
await toggle()
|
||||
await expect.poll(() => live(page).count()).toBe(0)
|
||||
expect(await live(other).count()).toBe(1)
|
||||
await otherContext.setOffline(false)
|
||||
await expect.poll(() => live(other).count(), { timeout: 20_000 }).toBe(0)
|
||||
for (const target of [page, other]) await expect.poll(() => live(target).count(), { timeout: 20_000 }).toBe(0)
|
||||
expect(await draft.inputValue()).toBe('unfinished-draft')
|
||||
expect(navigations).toBe(0)
|
||||
expect(scaffold.ctx.loader.ctx.fiber.uid).toBe(host)
|
||||
|
||||
@@ -142,8 +142,12 @@ it.skipIf(MODE === 'record')('reuses saved native Account Flash translations acr
|
||||
const account = scaffold.ctx.get('deepseekAccount')
|
||||
if (account === undefined) throw new Error('Shipped native Account service is absent')
|
||||
// Only credential acquisition is nondeterministic; the Loader-owned native route and wire remain real.
|
||||
const auth = vi.spyOn(account, 'resolveToken').mockImplementation(async (url: string) =>
|
||||
new URL(url).origin === origin ? 'paid-browser-fixture-token' : undefined)
|
||||
const credential = {
|
||||
headers: { 'x-dsh-auth-token': 'paid-browser-fixture-token' }, value: 'paid-browser-fixture-token',
|
||||
revoked: new AbortController().signal, reject: () => Promise.resolve(),
|
||||
}
|
||||
const auth = vi.spyOn(account, 'resolveRequestCredential').mockImplementation(async (url: string) =>
|
||||
new URL(url).origin === origin ? credential : undefined)
|
||||
resources.restoreAuth = () => { auth.mockRestore() }
|
||||
scaffold.ctx.emit('llm/adapters-updated')
|
||||
const owner = [...scaffold.ctx.loader.entries()].find(entry => entry.options.id === 'llm-deepseek-account')
|
||||
|
||||
@@ -36,11 +36,13 @@ en.get locale=en_US query=
|
||||
web.notice=赠金已到账 / 已赠送您 4.00 元 DSH 体验赠金。 acks=1
|
||||
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.update-tag card=260 left-inset=10 card-above-account-row=true tag-in-account-row=true floats-over-list=true
|
||||
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.short-window account-row-visible=true card-above-account-row=true copy-scrolls=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
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
- text: "1"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "变更请求状态:需要处理 Add the pull request panel":
|
||||
- img "变更请求状态:需要处理"
|
||||
- text: Add the pull request panel
|
||||
- text: "#7"
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
- text: "1"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "变更请求状态:需要处理 Add the pull request panel":
|
||||
- img "变更请求状态:需要处理"
|
||||
- text: Add the pull request panel
|
||||
- text: "#7"
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "变更请求状态:需要处理 Add the pull request panel":
|
||||
- img "变更请求状态:需要处理"
|
||||
- text: Add the pull request panel
|
||||
- text: "#7"
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
- list:
|
||||
- listitem:
|
||||
- button "Daily brief": Daily brief Recent changes in the workspace and what needs follow-up, with what to do first today. Weekdays at 9:00
|
||||
- listitem:
|
||||
- button "Weekly review": Weekly review Your work in the workspace this week, with loose ends and what to do first next week. Fridays at {{clock}}
|
||||
- listitem:
|
||||
- button "Issue scan": Issue scan Sort new issues into bugs, requests, and questions, and flag duplicates and ones that need a reply. Weekdays at {{clock}}
|
||||
- listitem:
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
- list:
|
||||
- listitem:
|
||||
- button "每日简报": 每日简报 汇总工作区最近的变化和待跟进的事,列出今天先做什么。 工作日 9:00
|
||||
- listitem:
|
||||
- button "每周回顾": 每周回顾 回顾自己这周在工作区做的事,列出没收尾的事和下周先做什么。 周五 {{clock}}
|
||||
- listitem:
|
||||
- button "Issue 扫描": Issue 扫描 把新开的 issue 分成 bug、需求、提问,标出重复的和需要回复的。 工作日 {{clock}}
|
||||
- listitem:
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/** Client face of the synced-configuration fixture: exports no Config and records what its synced Config object shows. */
|
||||
window.__ModuleLoader__.load({
|
||||
id: '@fixture/synced-config',
|
||||
factory() {
|
||||
return {
|
||||
apply(ctx, config) {
|
||||
const data = document.documentElement.dataset
|
||||
data.syncedApplies = String(Number(data.syncedApplies ?? 0) + 1)
|
||||
// References are read at operation time; `Object.keys` lists the fields the Host sent.
|
||||
const publish = () => {
|
||||
data.syncedConfig = JSON.stringify({
|
||||
keys: Object.keys(config).sort(),
|
||||
greeting: config.greeting.get(),
|
||||
account: config.account.get(),
|
||||
})
|
||||
}
|
||||
publish()
|
||||
let notifications = 0
|
||||
const notified = () => {
|
||||
notifications++
|
||||
data.syncedNotifications = String(notifications)
|
||||
publish()
|
||||
}
|
||||
ctx.effect(() => config.greeting.subscribe(notified))
|
||||
ctx.effect(() => config.account.subscribe(notified))
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
- insert:
|
||||
- id: fixture-synced-config
|
||||
name: '@fixture/synced-config'
|
||||
config:
|
||||
cacheDir: host-only-cache-r0
|
||||
greeting: hello-r0
|
||||
account:
|
||||
label: primary
|
||||
token: secret-token-r0
|
||||
@@ -0,0 +1,15 @@
|
||||
/** Host face of the synced-configuration fixture: the only Config schema, with an ordinary field and two volatile fields. */
|
||||
import z from '@deepseek-ai/schemastery'
|
||||
|
||||
/** Ordinary `cacheDir` stays on the Host; volatile `greeting` and `account` reach the browser without `account.token`. */
|
||||
export const Config = z.object({
|
||||
cacheDir: z.string().required(),
|
||||
greeting: z.string().required().volatile(),
|
||||
account: z.object({
|
||||
label: z.string().required(),
|
||||
token: z.string().role('secret').required(),
|
||||
}).volatile(),
|
||||
})
|
||||
|
||||
/** Nothing to mount on the Host. */
|
||||
export function apply() {}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@fixture/synced-config",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./client": "./client.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@deepseek-ai/schemastery": "*"
|
||||
},
|
||||
"dsh": {
|
||||
"bundle": {
|
||||
"patch": "./cordis.patch.yml"
|
||||
},
|
||||
"client": {
|
||||
"platform": "web"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -776,7 +776,7 @@ async function expectNumberedReference({ scaffold, page, project, tripwire }: Pa
|
||||
await page.getByRole('button', { name: TOGGLE_ATTENTION, exact: true }).waitFor({ timeout: 20_000 })
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
await change.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await change.locator('[data-forge-opens]').filter({ hasText: 'Add the pull request panel' }).waitFor({ timeout: 20_000 })
|
||||
await change.getByText('等待评审', { exact: true }).waitFor()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'reference.expected.md'),
|
||||
await captureStableAria(page, `[data-forge-change="${PULL}"]`, scaffold.workspaceCwd), MODE)
|
||||
@@ -839,8 +839,8 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
expect(await git(directory, 'rev-parse', 'HEAD')).toBe(baseCommit)
|
||||
const events = await readPersistedEvents(scaffold, sessionId)
|
||||
expect(worktreeRecords(events)).toEqual([
|
||||
{ action: 'request', from: 'main' },
|
||||
{ action: 'request', from: 'release' },
|
||||
{ action: 'request', from: 'refs/heads/main' },
|
||||
{ action: 'request', from: 'refs/heads/release' },
|
||||
{ created: { path: directory, branch, baseCommit, repositoryRoot: project } },
|
||||
])
|
||||
// The worktree existed before the turn, so the first model request carried its directory notice.
|
||||
@@ -884,7 +884,7 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
await page.getByRole('tooltip').filter({ hasText: `工作树(基于 release):${abbreviateHomePath(directory, homedir())}` }).waitFor()
|
||||
await page.mouse.move(0, 0)
|
||||
const change = panel.locator(`[data-forge-change="${PULL}"]`)
|
||||
const title = change.getByRole('link', { name: 'Add the pull request panel', exact: true })
|
||||
const title = change.locator('[data-forge-opens]').filter({ hasText: 'Add the pull request panel' })
|
||||
await title.waitFor({ timeout: 20_000 })
|
||||
// The only open change request starts expanded.
|
||||
await change.getByText('等待评审', { exact: true }).waitFor()
|
||||
@@ -954,6 +954,42 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it.skipIf(MODE === 'record')('creates the requested worktree for the first message, not for the notice an access mode change queues before it', async () => {
|
||||
const { scaffold, page, project, tripwire } = await requestReleaseWorktree('web-e2e-forge-panel-access-mode')
|
||||
await page.locator('button[aria-label^="访问模式"]').first().click()
|
||||
await page.getByRole('menuitem', { name: '完全权限', exact: true }).click()
|
||||
const confirmation = page.getByRole('dialog', { name: '确认启用完全权限?' })
|
||||
await confirmation.getByRole('checkbox', { name: '我已了解风险,并愿意继续' }).check()
|
||||
await confirmation.getByRole('button', { name: '启用完全权限' }).click()
|
||||
await page.locator('button[aria-label="访问模式,当前:完全权限"]').waitFor()
|
||||
// The switch queues its approval notice for the next step, which opens no turn. A hold would run as maintenance of
|
||||
// the Agent until the worktree exists, and the Session would then work in it.
|
||||
const noticed = () => scaffold.ctx.agents.list()
|
||||
.find(candidate => candidate.inbox.nextStep.some(message => message.source.kind === 'user-approval'))
|
||||
await expect.poll(() => noticed() !== undefined).toBe(true)
|
||||
const agent = noticed()
|
||||
if (agent === undefined) throw new Error('The access mode change must queue its notice')
|
||||
await agent.runMaintenance(() => Promise.resolve())
|
||||
expect(scaffold.ctx.workingDirectory.get(agent.session)).toBe(project)
|
||||
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
const sessionId = await settled
|
||||
await page.getByText('LIGHTHOUSE', { exact: true }).waitFor()
|
||||
expect(sessionId).toBe(agent.session.id)
|
||||
|
||||
// The prompt opens the first turn, and its hold creates the worktree.
|
||||
const events = await readPersistedEvents(scaffold, sessionId)
|
||||
const queued = (target: 'next-step' | 'next-turn', kind: string): number => events.findIndex(event => event.type === 'agent/inbox/spliced'
|
||||
&& event.data.target === target && event.data.inserted.some(message => message.source.kind === kind))
|
||||
const created = events.findIndex(event => pluginRecordOf(event)?.type === 'plugin:worktree/created')
|
||||
expect(queued('next-step', 'user-approval')).toBeGreaterThan(-1)
|
||||
expect(queued('next-turn', 'user')).toBeGreaterThan(queued('next-step', 'user-approval'))
|
||||
expect(created).toBeGreaterThan(queued('next-turn', 'user'))
|
||||
expect(created).toBeLessThan(events.findIndex(event => event.type === 'turn/start'))
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it.skipIf(MODE === 'record')('keeps the first message waiting when the worktree cannot be created, tries again, and sends it without the worktree', async () => {
|
||||
const { scaffold, page, project, tripwire } = await requestReleaseWorktree('web-e2e-forge-panel-failure')
|
||||
await git(project, 'branch', '--quiet', '-D', 'release')
|
||||
@@ -978,7 +1014,9 @@ it.skipIf(MODE === 'record')('keeps the first message waiting when the worktree
|
||||
if (session === undefined) throw new Error('The Session must stay loaded')
|
||||
expect(scaffold.ctx.workingDirectory.get(session)).toBe(project)
|
||||
const events = await readPersistedEvents(scaffold, sessionId)
|
||||
expect(worktreeRecords(events)).toEqual([{ action: 'request', from: 'main' }, { action: 'request', from: 'release' }, { action: 'cancel' }])
|
||||
expect(worktreeRecords(events)).toEqual([
|
||||
{ action: 'request', from: 'refs/heads/main' }, { action: 'request', from: 'refs/heads/release' }, { action: 'cancel' },
|
||||
])
|
||||
expect(events.filter(event => event.type === 'turn/start')).toHaveLength(1)
|
||||
expect(events.some(event => event.type === 'user/message' && event.data.source.kind === 'working-directory')).toBe(false)
|
||||
const checkout = (await showSessionPanel(page)).locator('[data-forge-checkout]')
|
||||
@@ -1002,7 +1040,7 @@ it.skipIf(MODE === 'record')('marks a draft change request ready for review and
|
||||
scaffold.ctx.forgeSession.track(session, DRAFT)
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${DRAFT}"]`)
|
||||
await change.getByRole('link', { name: 'Add the merge button', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await change.locator('[data-forge-opens]').filter({ hasText: 'Add the merge button' }).waitFor({ timeout: 20_000 })
|
||||
|
||||
// The only open change request starts expanded, so its Merge action shows once it is ready.
|
||||
await chooseCardAction(page, change, '#9', '标记为可评审')
|
||||
@@ -1135,7 +1173,7 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
await change.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await change.locator('[data-forge-opens]').filter({ hasText: 'Add the pull request panel' }).waitFor({ timeout: 20_000 })
|
||||
await card.getByRole('button', { name: '本地变更 · 4 个文件,新增 4 行,删除 1 行', exact: true }).waitFor()
|
||||
// The open change request of the checked-out branch replaces the offer to create one.
|
||||
await card.getByRole('button', { name: '本地变更操作', exact: true }).click()
|
||||
@@ -1148,7 +1186,8 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
await card.getByRole('button', { name: '本地变更 · 4 个文件,新增 4 行,删除 1 行', exact: true }).click()
|
||||
await local.getByText('暂存区与 HEAD 比较', { exact: true }).waitFor()
|
||||
await showSessionPanel(page)
|
||||
await change.getByRole('button', { name: '查看 #7 的变更:新增 128 行,删除 14 行', exact: true }).click()
|
||||
// A press on the card's line opens the changes, as its Changes row and its View changes item do.
|
||||
await change.locator('[data-forge-opens="changes"]').click()
|
||||
const view = page.locator('[data-forge-changes="change"]')
|
||||
const panelFile = view.locator('[data-forge-diff-file="src/panel.ts"]')
|
||||
const title = await view.getByText('Add the pull request panel', { exact: true }).boundingBox()
|
||||
@@ -1772,9 +1811,9 @@ it.skipIf(MODE === 'record')('aligns localized status rows by their glyphs in th
|
||||
width: document.documentElement.clientWidth,
|
||||
}
|
||||
})
|
||||
// The glyph starts 30px into the card, where the card's title starts.
|
||||
expect(geometry.iconInset).toBe(8)
|
||||
expect(geometry.rowInset).toBeGreaterThanOrEqual(6)
|
||||
expect(geometry.rowInset).toBeLessThanOrEqual(7)
|
||||
expect(geometry.rowInset).toBe(22)
|
||||
offsets.add(geometry.valueOffset)
|
||||
expect(geometry.gap).toBeGreaterThanOrEqual(8)
|
||||
expect(geometry.right).toBeLessThanOrEqual(geometry.width)
|
||||
@@ -2505,7 +2544,7 @@ it.skipIf(MODE === 'record')('summarizes checks, reviewers, and the merge state
|
||||
await showSessionPanel(page)
|
||||
const card = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
// The card chooses its default expansion once its first status arrives, which names the title.
|
||||
await card.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await card.locator('[data-forge-opens]').filter({ hasText: 'Add the pull request panel' }).waitFor({ timeout: 20_000 })
|
||||
if (await card.getAttribute('data-expanded') === null) await card.getByRole('button', { name: '展开 #7', exact: true }).click()
|
||||
const checks = card.locator('[data-forge-checks]')
|
||||
await expect.poll(() => checks.textContent(), { timeout: 20_000 }).toBe('检查3 项失败 · 1 项进行中')
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/** Typed `@` mentions render as file and folder chips only when the Session's filesystem has the path. */
|
||||
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { chromium, type Browser, type Page } from 'playwright'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
|
||||
import {
|
||||
captureStableAria, compareOrRefreshGolden, fixtureUserPrompts, launchWebScaffold, readPersistedEvents,
|
||||
watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot, writeComposerDraft } from './support.ts'
|
||||
|
||||
const DIR = fileURLToPath(new URL('../../../snapshots/web/mention-path-presence', import.meta.url))
|
||||
const FIXTURE = join(DIR, 'session.v4.jsonl')
|
||||
const MODE = webSnapshotMode()
|
||||
const PROMPT = '@ceshi @随便写点文字 @LICENSE @docs/ mail@host'
|
||||
|
||||
describe.skipIf(MODE === 'record')('web e2e: mention path presence', () => {
|
||||
let scaffold: WebScaffold
|
||||
let browser: Browser
|
||||
let page: Page
|
||||
let tripwire: ReturnType<typeof watchConsole>
|
||||
|
||||
beforeAll(async () => {
|
||||
scaffold = await launchWebScaffold({
|
||||
replayFixture: FIXTURE,
|
||||
compareReplaySession: true,
|
||||
paceMs: 10,
|
||||
extraOverlayPath: fileURLToPath(new URL('./pin-browse-picker.overlay.yml', import.meta.url)),
|
||||
})
|
||||
await mkdir(join(scaffold.workspaceCwd, 'workspace', 'docs'), { recursive: true })
|
||||
await writeFile(join(scaffold.workspaceCwd, 'workspace', 'LICENSE'), 'Reference fixture license.\n')
|
||||
browser = await chromium.launch()
|
||||
page = await newEnglishPage(browser)
|
||||
tripwire = watchConsole(page)
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await page.waitForSelector('[class*="frame"]')
|
||||
await connectFreshWorkspace(page, scaffold.workspaceCwd)
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
try {
|
||||
await browser?.close()
|
||||
} finally {
|
||||
await scaffold?.close()
|
||||
}
|
||||
})
|
||||
|
||||
it('decorates typed mentions of existing paths and keeps other @ text verbatim across reload', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'mention-path-presence'))
|
||||
const composer = page.locator('[data-composer-input][contenteditable="true"]').last()
|
||||
await writeComposerDraft(page, composer, PROMPT)
|
||||
// The trailing token is not a mention, so no completion is open to take the Enter.
|
||||
await page.getByRole('listbox', { name: 'Trigger suggestions' }).waitFor({ state: 'hidden' })
|
||||
expect(await composer.locator('[data-composer-chip]').count()).toBe(0)
|
||||
|
||||
const settled = scaffold.whenTurnSettled()
|
||||
await composer.press('Enter')
|
||||
const sessionId = await settled
|
||||
const persisted = (await readPersistedEvents(scaffold, sessionId))
|
||||
.find(event => event.type === 'user/message' && event.data.source.kind === 'user')
|
||||
expect(persisted).toMatchObject({ data: { content: [{ type: 'text', text: PROMPT }] } })
|
||||
expect(fixtureUserPrompts(await readFile(FIXTURE, 'utf8'))).toEqual([PROMPT])
|
||||
|
||||
for (const reload of [false, true]) {
|
||||
if (reload) await page.reload({ waitUntil: 'load' })
|
||||
const bubble = page.locator('[data-chat-flow-kind="user"]')
|
||||
await expect.poll(() => bubble.locator('[data-ref-chip]').allTextContents()).toEqual(['LICENSE', 'docs'])
|
||||
expect(await bubble.textContent()).toContain('@ceshi @随便写点文字 ')
|
||||
expect(await bubble.textContent()).toContain(' mail@host')
|
||||
await bubble.getByRole('button', { name: 'LICENSE', exact: true }).click()
|
||||
await page.getByText('Reference fixture license.', { exact: true }).waitFor()
|
||||
}
|
||||
await compareOrRefreshGolden(join(DIR, 'ui.expected.md'),
|
||||
await captureStableAria(page, '[class*="centerCol"]', scaffold.workspaceCwd), MODE)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
})
|
||||
})
|
||||
@@ -71,7 +71,7 @@ it.each([
|
||||
const recommendations = manager.getByRole('region', { name: copy.heading, exact: true })
|
||||
const recommendation = recommendations.getByRole('button', { name: copy.title, exact: true })
|
||||
await recommendation.waitFor()
|
||||
expect(await recommendations.getByRole('button').count()).toBe(7)
|
||||
expect(await recommendations.getByRole('button').count()).toBe(8)
|
||||
if (draft === '') {
|
||||
expect(await recommendationColumns(recommendations)).toBe(2)
|
||||
await compareOrRefreshGolden(
|
||||
|
||||
@@ -159,19 +159,21 @@ it.each([false, true])('keeps the same revision, Session and page across a serve
|
||||
})
|
||||
socket.on('framereceived', ({ payload }) => {
|
||||
if (typeof payload !== 'string') return
|
||||
const message = JSON.parse(payload) as { type?: string; streamId: string; value?: { type?: string }; error?: unknown }
|
||||
const message = JSON.parse(payload) as {
|
||||
type?: string
|
||||
streamId: string
|
||||
value?: { type?: string; graph?: typeof graphs[number] }
|
||||
error?: unknown
|
||||
}
|
||||
if (message.type === 'error') streamErrors.push(message.error)
|
||||
if (message.type === 'item' && message.value?.type === 'ready') readyFrames++
|
||||
if (message.type === 'item' && endpoints.get(message.streamId) === 'session/follow'
|
||||
&& message.value?.type === 'snapshot') sessionBaselines++
|
||||
if (message.type !== 'item') return
|
||||
const endpoint = endpoints.get(message.streamId)
|
||||
if (message.value?.type === 'ready') readyFrames++
|
||||
if (endpoint === 'session/follow' && message.value?.type === 'snapshot') sessionBaselines++
|
||||
// Every plugin-events stream generation opens with a baseline graph; later graph changes arrive as `graph`.
|
||||
if (endpoint === 'pluginEvents/follow' && message.value?.graph !== undefined) graphs.push(message.value.graph)
|
||||
})
|
||||
})
|
||||
const network = await page.context().newCDPSession(page)
|
||||
await network.send('Network.enable')
|
||||
network.on('Network.eventSourceMessageReceived', (event) => {
|
||||
const message = JSON.parse(event.data) as { type?: string; graph: typeof graphs[number] }
|
||||
if (message.type === 'graph') graphs.push(message.graph)
|
||||
})
|
||||
onTestFailed(async () => {
|
||||
await saveFailureShot(page, 'web-server-restart-' + scenarioId)
|
||||
await writeFile(join(REPO_ROOT, '.artifacts', 'server-restart-' + scenarioId + '.json'), JSON.stringify({ errors, streamErrors, graphs, server: server.logs() }, null, 2))
|
||||
|
||||
@@ -184,7 +184,11 @@ async function assertMaskFade(frame: Locator, from: number, to: number): Promise
|
||||
})
|
||||
}
|
||||
|
||||
/** Sample both width transitions on the same clock to detect detached sidebar controls. */
|
||||
/**
|
||||
* Sample both width transitions on the same clock to detect detached sidebar controls.
|
||||
* Returns only after this sample's transitions can no longer dispatch an end event, so
|
||||
* the caller's next posture change starts from a window that no pending event settles.
|
||||
*/
|
||||
async function assertFoldResize(toggle: Locator, from: number, to: number): Promise<void> {
|
||||
await expect.poll(() => toggle.evaluate((button, target) => {
|
||||
const frame = button.closest<HTMLElement>('[data-animating]')
|
||||
@@ -208,7 +212,14 @@ async function assertFoldResize(toggle: Locator, from: number, to: number): Prom
|
||||
const start = at(0)
|
||||
const middle = at(0.5)
|
||||
const end = at(1)
|
||||
for (const transition of transitions) transition.finish()
|
||||
// Cancel instead of finish: a finished transition queues its transitionend for a
|
||||
// later rendering update, and an end event arriving after the caller's next posture
|
||||
// change settles the new window, drops data-animating and cancels the transition the
|
||||
// next assertFoldResize looks for. A cancelled transition dispatches transitioncancel,
|
||||
// which AppFrame does not observe, so this sample leaves no end event pending. Both
|
||||
// values stay at the end state: cancelling drops the transition effect, and the
|
||||
// computed grid lands on the same target the finished transition would show.
|
||||
for (const transition of transitions) transition.cancel()
|
||||
frame.style.removeProperty('--ds-transition-duration-slow')
|
||||
return { endpoints: [start.width, end.width], start, middle }
|
||||
})
|
||||
@@ -216,6 +227,13 @@ async function assertFoldResize(toggle: Locator, from: number, to: number): Prom
|
||||
expect(sample.middle.width).toBeGreaterThan(Math.min(from, to))
|
||||
expect(sample.middle.width).toBeLessThan(Math.max(from, to))
|
||||
expect(sample.middle.gap).toBeCloseTo(sample.start.gap, 1)
|
||||
// AppFrame removes data-animating either from a transitionend or from its own 600 ms
|
||||
// fallback, which is the only remaining settle path once the transitions are cancelled.
|
||||
// Wait for that settle so the caller's next posture change starts from a clear window.
|
||||
await expect.poll(
|
||||
() => toggle.evaluate(button => button.closest('[data-animating]') === null),
|
||||
{ timeout: 5_000 },
|
||||
).toBe(true)
|
||||
}
|
||||
|
||||
it('overlays the conversation and closes after navigation without losing its sidebar content', async () => {
|
||||
|
||||
@@ -48,7 +48,7 @@ const LABEL = 'event-sourcing researcher'
|
||||
const CHILD_NAME = 'agent-1'
|
||||
const ONE_SHOT_LABEL = 'event-sourcing reviewer'
|
||||
const NESTED_LABEL = 'example editor'
|
||||
const CHILD_TITLE = 'Explain event sourcing in one'
|
||||
const CHILD_TITLE = 'Now give the same explanation'
|
||||
const PARENT_PROMPT = 'Ask a research subagent to explain event sourcing.'
|
||||
const INITIAL_PROMPT = 'Explain event sourcing in one sentence.'
|
||||
/** The grandchild's own first message; its arrival is what says its history finished loading. */
|
||||
@@ -693,7 +693,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
|
||||
const sidebarChat = page.locator('[data-sidebar-chat]')
|
||||
await sidebarChat.getByText(/^Explain event sourcing in one sentence\./).waitFor({ timeout: 15_000 })
|
||||
await sidebarChat.getByRole('button', { name: /^Task message received/ }).waitFor({ timeout: 15_000 })
|
||||
await compareOrRefreshGolden(
|
||||
SIDEBAR_CHAT_EXPECTED,
|
||||
await captureStableAria(page, '[data-sidebar-chat]', scaffold.workspaceCwd),
|
||||
@@ -715,7 +715,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-open'))
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
await expect.poll(
|
||||
() => page.getByText(/^Explain event sourcing in one sentence\./).count(),
|
||||
() => page.getByRole('button', { name: /^Task message received/ }).count(),
|
||||
{ timeout: 15_000 },
|
||||
).toBe(1)
|
||||
if (scaffold.ctx.agents.get(childId) !== undefined) {
|
||||
@@ -773,7 +773,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await expect.poll(() => requested, { timeout: 15_000 }).toBe(true)
|
||||
expect(await page.getByText('This subagent is read-only for now', { exact: true }).count()).toBe(0)
|
||||
expect(await page.getByRole('navigation', { name: 'Session hierarchy' }).count()).toBe(0)
|
||||
expect(await page.getByText(/^Explain event sourcing in one sentence\./).count()).toBe(0)
|
||||
expect(await page.getByRole('button', { name: /^Task message received/ }).count()).toBe(0)
|
||||
releaseCatalog()
|
||||
await page.getByRole('button', { name: `Switch subagent: ${LABEL}` }).waitFor({ timeout: 15_000 })
|
||||
const input = page.getByRole('textbox', { name: 'Message or run a task, / commands, @ files or sessions' })
|
||||
|
||||
@@ -21,8 +21,8 @@ it('places the inherited-history divider between the parent turn and the child p
|
||||
const paths = await Promise.all(['session.v4.jsonl', 'session.1.v4.jsonl']
|
||||
.map(file => selectedSessionFixture(join(DIR, file))))
|
||||
const childPrompt = parseSessionLog(await readFile(paths[1]!, 'utf8')).findLast(event =>
|
||||
event.type === 'user/message' && event.data.source.kind === 'user')
|
||||
if (childPrompt?.type !== 'user/message') throw new Error('child fixture has no user prompt')
|
||||
event.type === 'user/message' && event.data.source.kind === 'agent-message')
|
||||
if (childPrompt?.type !== 'user/message') throw new Error('child fixture has no delegated task')
|
||||
const scaffold = await launchWebScaffold({
|
||||
replayFixture: paths[0]!, replayChildFixtures: [paths[1]!], compareReplaySession: false,
|
||||
})
|
||||
@@ -43,7 +43,7 @@ it('places the inherited-history divider between the parent turn and the child p
|
||||
|
||||
const activation = await scaffold.ctx.subagents.startActivation({
|
||||
provider: 'fork', label: LABEL, delivery: 'caller',
|
||||
signal: new AbortController().signal, parent, prompt: [...childPrompt.data.content],
|
||||
signal: new AbortController().signal, parent, prompt: childPrompt.data.content.slice(1),
|
||||
})
|
||||
try {
|
||||
await activation.result
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/** Forked Web agents inherit the standard preset and refuse every reminder tool. */
|
||||
/** Recorded Web subagent composition, tool restrictions, and human-message attribution. */
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { expect, it } from 'vitest'
|
||||
import { createUserMessage } from '@deepseek-ai/dsh-llm'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
import type { SubagentPromptRequestId } from '@deepseek-ai/dsh-subagent'
|
||||
import { createUserMessage, type ContentBlock } from '@deepseek-ai/dsh-llm'
|
||||
import { parseSessionLog, prepareSessionSnapshotFixtureForComparison } from '@deepseek-ai/dsh-llm-replay'
|
||||
import type { Session } from '@deepseek-ai/dsh-session'
|
||||
import {
|
||||
@@ -27,7 +29,7 @@ const MODE = webSnapshotMode()
|
||||
it.skipIf(MODE === 'record')('replays inherited schedule tools and refusals in a seeded Web fork', async () => {
|
||||
const paths = await Promise.all(['session.v4.jsonl', 'session.1.v4.jsonl']
|
||||
.map(file => selectedSessionFixture(join(DIR, file))))
|
||||
let expected = await Promise.all(paths.map(path => readFile(path, 'utf8')))
|
||||
const expected = await Promise.all(paths.map(path => readFile(path, 'utf8')))
|
||||
const scaffold = await launchWebScaffold({
|
||||
replayFixture: paths[0]!, replayChildFixtures: [paths[1]!], compareReplaySession: false,
|
||||
})
|
||||
@@ -42,13 +44,12 @@ it.skipIf(MODE === 'record')('replays inherited schedule tools and refusals in a
|
||||
parent.followup(createUserMessage({ content: [{ type: 'text', text: prompt }], source: { kind: 'user' } }))
|
||||
await parent.whenIdle()
|
||||
|
||||
const childPrompt = parseSessionLog(expected[1]!).findLast(event => event.type === 'user/message'
|
||||
&& event.data.source.kind === 'user')
|
||||
if (childPrompt?.type !== 'user/message') throw new Error('child fixture has no user prompt')
|
||||
const childPrompt = fixtureChildInputs(expected[1]!)[0]
|
||||
if (childPrompt === undefined) throw new Error('child fixture has no delegated task')
|
||||
const activation = await scaffold.ctx.subagents.startActivation({
|
||||
provider: 'fork', label: 'Check child reminder refusal', delivery: 'caller',
|
||||
signal: new AbortController().signal,
|
||||
parent, prompt: [...childPrompt.data.content],
|
||||
parent, prompt: childPrompt,
|
||||
})
|
||||
try {
|
||||
await activation.result
|
||||
@@ -62,22 +63,6 @@ it.skipIf(MODE === 'record')('replays inherited schedule tools and refusals in a
|
||||
expect(child.inheritedEventCount).toBeGreaterThan(0)
|
||||
expect(child.requestHeader()).toEqual(parent.session.requestHeader())
|
||||
|
||||
for (const session of sessions) {
|
||||
expect(await readPersistedEvents(scaffold, session.id)).toEqual(session.snapshotEvents())
|
||||
}
|
||||
const raw = sessions.map(session => normalizeWebSessionVolatiles(rawSessionLog(session), scaffold.workspaceCwd))
|
||||
const context = { sessionIds: sessions.map(session => String(session.id)), cwd: scaffold.workspaceCwd }
|
||||
const schemas = parseToolSchemasSnapshot(await readFile(join(PIN, 'tool-schemas.expected.json'), 'utf8'))
|
||||
const promptPin = await readFile(join(PIN, 'system-prompt.expected.md'), 'utf8')
|
||||
for (const log of raw) {
|
||||
const headers = normalizedToolSchemas(log, context)
|
||||
expect(headers.length).toBeGreaterThan(0)
|
||||
for (const tools of headers) expect(tools).toEqual(schemas.initial)
|
||||
for (const prompt of normalizedSystemPrompts(log, context)) {
|
||||
expect(formatSystemPromptSnapshot(prompt.split(REPO_ROOT).join('{{sourceRoot}}')
|
||||
.split(scaffold.baseUrl).join('{{webUrl}}'))).toBe(promptPin)
|
||||
}
|
||||
}
|
||||
const results = child.snapshotEvents().slice(child.inheritedEventCount)
|
||||
.filter(event => event.type === 'tool/result')
|
||||
expect(results.map(event => event.data.message.content)).toEqual(Array.from({ length: 4 }, () => [
|
||||
@@ -85,21 +70,115 @@ it.skipIf(MODE === 'record')('replays inherited schedule tools and refusals in a
|
||||
]))
|
||||
expect((await scaffold.ctx.schedule.list({ active: true })).items).toEqual([])
|
||||
|
||||
if (MODE === 'refresh') {
|
||||
const replacements = refreshFixtureReplacements(raw.map((content, index) => ({
|
||||
id: sessions[index]!.id, createdAt: sessions[index]!.header.createdAt, content,
|
||||
})), expected)
|
||||
expected = redactSessionSnapshotIds(stabilizeFixtureMessageIds(raw.map((log, index) =>
|
||||
tokenizeSessionFixtureCwd(scrubSessionSnapshot(stabilizeRefreshLog(
|
||||
prepareSessionSnapshotFixtureForComparison(log), expected[index]!, replacements, context,
|
||||
))).split(scaffold.harnessHome).join('{{harnessHome}}')), expected))
|
||||
await Promise.all(expected.map((log, index) => writeFile(
|
||||
recordedSessionFixturePath(paths[index]!, sessions[index]!.header.version), log,
|
||||
)))
|
||||
}
|
||||
expect(normalizeSessionSnapshots(raw, context))
|
||||
.toEqual(normalizeSessionSnapshots(expected, fixtureContext(expected[0]!)))
|
||||
await assertSubagentSessions(scaffold, sessions, paths, expected)
|
||||
} finally {
|
||||
await scaffold.close()
|
||||
}
|
||||
})
|
||||
|
||||
const HUMAN_DIR = fileURLToPath(new URL('../../../snapshots/web/subagent-human-message', import.meta.url))
|
||||
|
||||
it.skipIf(MODE === 'record')('distinguishes the delegated task from a direct human message after a Web subagent cold resume', async () => {
|
||||
const paths = await Promise.all(['session.v4.jsonl', 'session.1.v4.jsonl']
|
||||
.map(file => selectedSessionFixture(join(HUMAN_DIR, file))))
|
||||
const expected = await Promise.all(paths.map(path => readFile(path, 'utf8')))
|
||||
const scaffold = await launchWebScaffold({
|
||||
replayFixture: paths[0]!, replayChildFixtures: [paths[1]!], compareReplaySession: false,
|
||||
})
|
||||
try {
|
||||
const { sessionId } = await scaffold.ctx.sessionController.create({ cwd: scaffold.workspaceCwd })
|
||||
const parent = scaffold.ctx.agents.get(sessionId)!
|
||||
parent.followup(createUserMessage({
|
||||
content: [{ type: 'text', text: fixtureUserPrompts(expected[0]!)[0]! }],
|
||||
source: { kind: 'user', rpcId: brandString<SubagentPromptRequestId>('root-question') },
|
||||
}))
|
||||
await parent.whenIdle()
|
||||
let child: Session | undefined
|
||||
scaffold.ctx.on('subagent/start', (info) => { child = scaffold.ctx.agents.get(info.id)!.session })
|
||||
const inputs = fixtureChildInputs(expected[1]!)
|
||||
const activation = await scaffold.ctx.subagents.startActivation({
|
||||
provider: 'fork', label: 'Identify direct human messages', delivery: 'caller',
|
||||
parent, prompt: inputs[0]!, signal: new AbortController().signal,
|
||||
})
|
||||
try {
|
||||
await activation.result
|
||||
} finally {
|
||||
await activation.dispose()
|
||||
}
|
||||
expect(scaffold.ctx.agents.get(activation.childId)).toBeUndefined()
|
||||
const settled = Promise.withResolvers<undefined>()
|
||||
scaffold.ctx.on('subagent/end', (info) => {
|
||||
if (info.id === activation.childId) settled.resolve(undefined)
|
||||
})
|
||||
const content = inputs[1]!.map((block) => {
|
||||
if (block.type !== 'text') throw new Error('human fixture input must be text')
|
||||
return block
|
||||
})
|
||||
const receipt = await scaffold.ctx.subagents.prompt({
|
||||
childSessionId: activation.childId,
|
||||
requestId: brandString<SubagentPromptRequestId>('human-question'), delivery: 'steer', content,
|
||||
}, new AbortController().signal)
|
||||
await settled.promise
|
||||
await parent.whenIdle()
|
||||
await scaffold.ctx.sessions.flush(parent.session)
|
||||
if (child === undefined) throw new Error('subagent start did not expose its Session')
|
||||
const received = child.deriveMessages().find(message => message.id === receipt.messageId)
|
||||
expect(received).toMatchObject({
|
||||
source: { kind: 'user', rpcId: 'human-question' },
|
||||
content,
|
||||
})
|
||||
await assertSubagentSessions(scaffold, [parent.session, child], paths, expected)
|
||||
} finally {
|
||||
await scaffold.close()
|
||||
}
|
||||
})
|
||||
|
||||
/** Compare durable parent/child logs and the shared Web request-header pins. */
|
||||
async function assertSubagentSessions(
|
||||
scaffold: Awaited<ReturnType<typeof launchWebScaffold>>,
|
||||
sessions: Session[],
|
||||
paths: string[],
|
||||
expected: string[],
|
||||
): Promise<void> {
|
||||
for (const session of sessions) {
|
||||
expect(await readPersistedEvents(scaffold, session.id)).toEqual(session.snapshotEvents())
|
||||
}
|
||||
const raw = sessions.map(session => normalizeWebSessionVolatiles(rawSessionLog(session), scaffold.workspaceCwd))
|
||||
const context = { sessionIds: sessions.map(session => String(session.id)), cwd: scaffold.workspaceCwd }
|
||||
const schemas = parseToolSchemasSnapshot(await readFile(join(PIN, 'tool-schemas.expected.json'), 'utf8'))
|
||||
const promptPin = await readFile(join(PIN, 'system-prompt.expected.md'), 'utf8')
|
||||
for (const log of raw) {
|
||||
const headers = normalizedToolSchemas(log, context)
|
||||
expect(headers.length).toBeGreaterThan(0)
|
||||
for (const tools of headers) expect(tools).toEqual(schemas.initial)
|
||||
for (const prompt of normalizedSystemPrompts(log, context)) {
|
||||
expect(formatSystemPromptSnapshot(prompt.split(REPO_ROOT).join('{{sourceRoot}}')
|
||||
.split(scaffold.baseUrl).join('{{webUrl}}'))).toBe(promptPin)
|
||||
}
|
||||
}
|
||||
if (MODE === 'refresh') {
|
||||
const replacements = refreshFixtureReplacements(raw.map((content, index) => ({
|
||||
id: sessions[index]!.id, createdAt: sessions[index]!.header.createdAt, content,
|
||||
})), expected)
|
||||
expected = redactSessionSnapshotIds(stabilizeFixtureMessageIds(raw.map((log, index) =>
|
||||
tokenizeSessionFixtureCwd(scrubSessionSnapshot(stabilizeRefreshLog(
|
||||
prepareSessionSnapshotFixtureForComparison(log), expected[index]!, replacements, context,
|
||||
))).split(scaffold.harnessHome).join('{{harnessHome}}')), expected))
|
||||
await Promise.all(expected.map((log, index) => writeFile(
|
||||
recordedSessionFixturePath(paths[index]!, sessions[index]!.header.version), log,
|
||||
)))
|
||||
}
|
||||
expect(normalizeSessionSnapshots(raw, context))
|
||||
.toEqual(normalizeSessionSnapshots(expected, fixtureContext(expected[0]!)))
|
||||
}
|
||||
|
||||
/** Read the child's admitted inputs, removing the parent prefix when recreating its initial task. */
|
||||
function fixtureChildInputs(log: string): ContentBlock[][] {
|
||||
const events = parseSessionLog(log)
|
||||
const start = events.findLastIndex(event => event.type === 'subagent/descriptor')
|
||||
return events.slice(start + 1).flatMap(event => event.type === 'agent/inbox/spliced'
|
||||
? event.data.inserted.map(message => message.source.kind === 'agent-message'
|
||||
? message.content.slice(1)
|
||||
: [...message.content])
|
||||
: [])
|
||||
}
|
||||
@@ -212,7 +212,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
|
||||
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter')
|
||||
const input = page.locator('[data-composer-input]').first()
|
||||
await input.waitFor({ timeout: 15_000 })
|
||||
await page.getByText(/^Explain event sourcing in one sentence\./)
|
||||
await page.getByRole('button', { name: /^Task message received/ })
|
||||
.waitFor({ timeout: 15_000 })
|
||||
expect(await input.isDisabled()).toBe(false)
|
||||
const stop = page.getByRole('button', { name: 'Stop generating' })
|
||||
@@ -363,9 +363,18 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
|
||||
&& event.data.source.kind === 'user'
|
||||
? event.data.content.flatMap(block => block.type === 'text' ? [block.text] : [])
|
||||
: [])
|
||||
expect(userTexts[0]).toBe(INITIAL)
|
||||
expect(userTexts[1]).toMatch(/^Your final answer is delivered automatically if your parent is still online\./)
|
||||
expect(userTexts.slice(2)).toEqual([REARM, REARM_WAKE, EDITED_FOLLOWUP, WAKING])
|
||||
expect(userTexts).toEqual([REARM, REARM_WAKE, EDITED_FOLLOWUP, WAKING])
|
||||
const delegatedTask = events.find(event => event.type === 'user/message'
|
||||
&& event.data.source.kind === 'agent-message')
|
||||
const taskContent = delegatedTask?.type === 'user/message' ? delegatedTask.data.content : undefined
|
||||
expect(taskContent).toHaveLength(3)
|
||||
expect(taskContent?.slice(0, 2)).toEqual([
|
||||
{ type: 'text', text: 'Agent lead sent a message: ' },
|
||||
{ type: 'text', text: INITIAL },
|
||||
])
|
||||
const guidance = taskContent?.[2]
|
||||
expect(guidance?.type === 'text' && guidance.text)
|
||||
.toMatch(/^Your final answer is delivered automatically if your parent is still online\./)
|
||||
const imageMessage = events.find(event => event.type === 'user/message'
|
||||
&& event.data.content.some(block => block.type === 'image'))
|
||||
expect(imageMessage?.type === 'user/message' && imageMessage.data.content.map(block => block.type)).toEqual(['image'])
|
||||
|
||||
@@ -183,9 +183,18 @@ describe.skipIf(MODE === 'record')('web e2e: subagents/interruptByUser over the
|
||||
&& event.data.source.kind === 'user'
|
||||
? event.data.content.flatMap(block => block.type === 'text' ? [block.text] : [])
|
||||
: [])
|
||||
expect(userTexts[0]).toBe(INITIAL)
|
||||
expect(userTexts[1]).toMatch(/^Your final answer is delivered automatically if your parent is still online\./)
|
||||
expect(userTexts.slice(2)).toEqual([FOLLOWUP, WAKING])
|
||||
expect(userTexts).toEqual([FOLLOWUP, WAKING])
|
||||
const delegatedTask = events.find(event => event.type === 'user/message'
|
||||
&& event.data.source.kind === 'agent-message')
|
||||
const taskContent = delegatedTask?.type === 'user/message' ? delegatedTask.data.content : undefined
|
||||
expect(taskContent).toHaveLength(3)
|
||||
expect(taskContent?.slice(0, 2)).toEqual([
|
||||
{ type: 'text', text: 'Agent lead sent a message: ' },
|
||||
{ type: 'text', text: INITIAL },
|
||||
])
|
||||
const guidance = taskContent?.[2]
|
||||
expect(guidance?.type === 'text' && guidance.text)
|
||||
.toMatch(/^Your final answer is delivered automatically if your parent is still online\./)
|
||||
const turnEndKinds = events
|
||||
.filter(event => event.type === 'turn/end')
|
||||
.map(event => (event).data.reason.kind)
|
||||
|
||||
@@ -173,7 +173,8 @@ describe.skipIf(MODE === 'record')('web e2e: durable workflow run in Chat', () =
|
||||
await page.setViewportSize({ width: 1280, height: 800 })
|
||||
|
||||
await member.click()
|
||||
await page.getByText(CHILD_PROMPT, { exact: true }).waitFor({ timeout: 15_000 })
|
||||
await page.getByRole('button', { name: /^Task message received/ }).click()
|
||||
await page.getByText(`Agent lead sent a message: ${CHILD_PROMPT}`, { exact: true }).waitFor({ timeout: 15_000 })
|
||||
|
||||
const sessions = page.getByRole('tree', { name: 'Sessions' })
|
||||
await sessions.getByRole('treeitem', { name: /Use the workflow tool exactly/ }).click()
|
||||
@@ -221,7 +222,8 @@ describe.skipIf(MODE === 'record')('web e2e: durable workflow run in Chat', () =
|
||||
|
||||
const catalog = (await showSessionPanel(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
await catalog.getByRole('treeitem', { name: /snapshot-flow child 1/ }).press('Enter')
|
||||
await page.getByText(CHILD_PROMPT, { exact: true }).waitFor({ timeout: 15_000 })
|
||||
await page.getByRole('button', { name: /^Task message received/ }).click()
|
||||
await page.getByText(`Agent lead sent a message: ${CHILD_PROMPT}`, { exact: true }).waitFor({ timeout: 15_000 })
|
||||
expect(await page.locator('[data-composer-input][contenteditable="true"]').count()).toBe(1)
|
||||
}, 60_000)
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
"tests/plugin-install-github.e2e.ts",
|
||||
"tests/plugin-install-silent-failure.e2e.ts",
|
||||
"tests/client-plugin-live.e2e.ts",
|
||||
"tests/client-config-sync.e2e.ts",
|
||||
"tests/icon-skin.e2e.ts",
|
||||
"tests/draft-initialization.e2e.ts",
|
||||
"tests/settings-chrome.e2e.ts",
|
||||
@@ -201,6 +202,7 @@
|
||||
"tests/markdown-file-links.e2e.ts",
|
||||
"tests/user-text-secret-mask.e2e.ts",
|
||||
"tests/reference-composer.e2e.ts",
|
||||
"tests/mention-path-presence.e2e.ts",
|
||||
"tests/markdown-wide-table.e2e.ts",
|
||||
"tests/thinking-markdown.e2e.ts",
|
||||
"tests/math-rendering.e2e.ts",
|
||||
|
||||
@@ -259,6 +259,8 @@ export default defineConfig({
|
||||
// internal slot the shell boot fills with the client module loader).
|
||||
'process.versions.node': '"0.0.0"',
|
||||
'process.execArgv': '[]',
|
||||
// vendored loader tree.ts: import() converts drive-letter names only on win32.
|
||||
'process.platform': '"browser"',
|
||||
// vendored loader index.ts: envData falls to its default branch.
|
||||
'process.env.CORDIS_SHARED': 'undefined',
|
||||
},
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
en: 41d772192075e133
|
||||
zh: 5ef3da69b4de1d8a
|
||||
/capability-seams-and-core-services:
|
||||
en: 6d0415ce4a9166a4
|
||||
zh: 2b1143652af73b76
|
||||
en: 9a698ae22b619a5d
|
||||
zh: bd82134864167e76
|
||||
@@ -94,6 +94,8 @@ flowchart LR
|
||||
pkg_llm_replay["llm-replay"]
|
||||
pkg_agent_loop["agent-loop"]
|
||||
pkg_compaction_basic["compaction-basic"]
|
||||
pkg_web_deepseek_api["web-deepseek-api"]
|
||||
pkg_web_search_deepseek["web-search-deepseek"]
|
||||
pkg_session_log_deepseek["session-log-deepseek"]
|
||||
svc_sessionLogDeepSeek["ctx.sessionLogDeepSeek<br/>Session-log upload policy"]
|
||||
pkg_deepseek_llm_api_extensions["deepseek-llm-api-extensions"]
|
||||
@@ -151,8 +153,10 @@ flowchart LR
|
||||
pkg_credentials["credentials"]
|
||||
svc_credentials["ctx.credentials<br/>Credential seam"]
|
||||
pkg_credentials_local["credentials-local"]
|
||||
pkg_llm_deepseek_api_key["llm-deepseek-api-key"]
|
||||
pkg_deepseek_account["deepseek-account"]
|
||||
svc_deepseekAccount["ctx.deepseekAccount<br/>DeepSeek account"]
|
||||
pkg_llm_deepseek_account["llm-deepseek-account"]
|
||||
pkg_authorization["authorization"]
|
||||
svc_authorization["ctx.authorization<br/>Authorization flow registry"]
|
||||
pkg_client_product_analytics["client-product-analytics"]
|
||||
@@ -292,8 +296,6 @@ flowchart LR
|
||||
pkg_tool_jobs["tool-jobs"]
|
||||
pkg_web["web"]
|
||||
svc_web["ctx.web<br/>Web access provider registry"]
|
||||
pkg_web_search_deepseek["web-search-deepseek"]
|
||||
pkg_web_deepseek_api["web-deepseek-api"]
|
||||
pkg_web_fetch_http["web-fetch-http"]
|
||||
pkg_spill["spill"]
|
||||
svc_spillStore["ctx.spillStore<br/>Spill storage seam"]
|
||||
@@ -310,6 +312,8 @@ flowchart LR
|
||||
pkg_web_app["web-app"]
|
||||
svc_webApp["ctx.webApp<br/>Served Web GUI"]
|
||||
pkg_harness_dev_context["harness-dev-context"]
|
||||
pkg_client_config["client-config"]
|
||||
svc_config["ctx.config<br/>Browser synced configuration lookup"]
|
||||
svc_clientModules["ctx.clientModules<br/>Client plugin graph host"]
|
||||
pkg_workflow["workflow"]
|
||||
svc_workflowEngine["ctx.workflowEngine<br/>Workflow script engine"]
|
||||
@@ -350,10 +354,12 @@ flowchart LR
|
||||
pkg_bash_local --> svc_shell
|
||||
pkg_bash_sandbox --> svc_shell
|
||||
pkg_browser_use --> svc_browserUse
|
||||
pkg_client_config --> svc_config
|
||||
pkg_client_connection --> svc_connection
|
||||
pkg_client_connection --> svc_connection_authentication
|
||||
pkg_client_file_upload --> svc_fileUploads
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_modules --> svc_config
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_connector_account --> svc_connectorAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
@@ -530,11 +536,14 @@ flowchart LR
|
||||
svc_connection_authentication --> pkg_client_connection
|
||||
svc_cordisInspect --> pkg_tool_cordis
|
||||
svc_credentials --> pkg_api_settings_controller
|
||||
svc_credentials --> pkg_llm_deepseek
|
||||
svc_credentials --> pkg_llm_deepseek_api_key
|
||||
svc_credentials --> pkg_llm_pi_ai
|
||||
svc_credentials --> pkg_web_deepseek_api
|
||||
svc_credentials --> pkg_web_search_deepseek
|
||||
svc_cuaAccess --> pkg_cua
|
||||
svc_cuaPrograms --> pkg_cua_mcp
|
||||
svc_deepseekAccount --> pkg_llm_deepseek
|
||||
svc_deepseekAccount --> pkg_llm_deepseek_account
|
||||
svc_deepseekAccount --> pkg_web_deepseek_api
|
||||
svc_deepseekLlmApiExtensions --> pkg_llm_deepseek
|
||||
svc_directoryPicker --> pkg_api_workspace_controller
|
||||
svc_dynamicCordisRunner --> pkg_tool_cordis
|
||||
@@ -553,6 +562,8 @@ flowchart LR
|
||||
svc_jobs --> pkg_tool_terminal
|
||||
svc_llm --> pkg_agent_loop
|
||||
svc_llm --> pkg_compaction_basic
|
||||
svc_llm --> pkg_web_deepseek_api
|
||||
svc_llm --> pkg_web_search_deepseek
|
||||
svc_lsp --> pkg_tool_lsp
|
||||
svc_mcpResources --> pkg_mcp_resources
|
||||
svc_officeKit --> pkg_client_ui_sidebar_documentpreview
|
||||
@@ -697,7 +708,7 @@ flowchart LR
|
||||
| `ctx.officeKit` | `core` | [`office-kit`](../packages/document/office-kit) | - | [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview), [`tool-office`](../packages/document/tool-office) | - | Authorized Office bytes are rendered as PDFs or images, converted, or recalculated on the Host using the declared native target engine, or Node WASM when no native target is declared. |
|
||||
| `ctx.attachments` | `seam` | [`attachment`](../packages/attachment/attachment) | [`attachment-local`](../packages/attachment/attachment-local) | [`api-session-controller`](../packages/api/session-controller), [`tool-fs`](../packages/fs/tool-fs), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-deepseek`](../packages/llm/llm-deepseek) | - | The host commits accepted images before session events; provider adapters resolve authorized durable references into provider-native content. |
|
||||
| `ctx.fileUploads` | `core` | [`client-file-upload`](../packages/client/file-upload) | - | [`api-session-controller`](../packages/api/session-controller) | - | Owns streaming intake, durable storage, and staged receipt lifetime; the Session controller binds receipts to accepted submissions. |
|
||||
| `ctx.llm` | `seam` | [`llm`](../packages/llm/llm) | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-replay`](../packages/test-support/llm-replay) | [`agent-loop`](../packages/core/agent-loop), [`compaction-basic`](../packages/compaction/compaction-basic) | - | Adapters register provider implementations; the loop and compaction call the provider-neutral stream service. |
|
||||
| `ctx.llm` | `seam` | [`llm`](../packages/llm/llm) | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-replay`](../packages/test-support/llm-replay) | [`agent-loop`](../packages/core/agent-loop), [`compaction-basic`](../packages/compaction/compaction-basic), [`web-deepseek-api`](../packages/web/web-deepseek-api), [`web-search-deepseek`](../packages/web/web-search-deepseek) | - | Adapters register provider implementations; the loop and compaction call the provider-neutral stream service, and the DeepSeek web providers read the credential a route publishes. |
|
||||
| `ctx.sessionLogDeepSeek` | `core` | [`session-log-deepseek`](../packages/session/session-log-deepseek) | - | - | - | Plugins register caller-owned exclusions before the canonical Session-log request contribution is prepared; unmatched requests use normal upload eligibility. |
|
||||
| `ctx.deepseekLlmApiExtensions` | `seam` | [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | [`session-log-deepseek`](../packages/session/session-log-deepseek), [`plugin-package-inventory-deepseek`](../packages/llm/plugin-package-inventory-deepseek) | [`llm-deepseek`](../packages/llm/llm-deepseek) | - | Plugins prepare independent top-level fields; the official adapter merges them and commits their delivery state after HTTP acceptance. |
|
||||
| `ctx.tokenMeter` | `core` | [`token-meter`](../packages/llm/token-meter) | - | [`compaction-basic`](../packages/compaction/compaction-basic) | - | Owns isolated per-session replay folds; pressure consumers share immutable revisioned measurements. |
|
||||
@@ -723,8 +734,8 @@ flowchart LR
|
||||
| `ctx.configEditor` | `core` | [`config-editor`](../packages/boot/config-editor) | - | [`settings`](../packages/settings/settings), [`agent-default-model`](../packages/core/agent-default-model) | - | Persists profile config patches under the application file lock and HMR queue, then reconciles Loader entries. |
|
||||
| `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` | `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.credentials` | `seam` | [`credentials`](../packages/credentials/credentials) | [`credentials-local`](../packages/credentials/credentials-local) | [`api-settings-controller`](../packages/api/settings-controller), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`web-deepseek-api`](../packages/web/web-deepseek-api), [`web-search-deepseek`](../packages/web/web-search-deepseek) | - | 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` | `service` | [`deepseek-account`](../packages/account/deepseek-account) | - | [`llm-deepseek-account`](../packages/llm/llm-deepseek-account), [`web-deepseek-api`](../packages/web/web-deepseek-api) | - | The Host owns browser authorization and local credentials and releases per-request credentials to the account model route and the web providers; 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. |
|
||||
@@ -777,6 +788,7 @@ flowchart LR
|
||||
| `ctx.directoryPicker` | `seam` | [`host-directory-picker`](../packages/host/directory-picker) | [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse) | [`api-workspace-controller`](../packages/api/workspace-controller) | - | Discriminated interaction capability: the native backend opens one OS chooser on the host display, the browse backend serves listing/creation primitives for the in-app browser; dual-face backends fill ui-workspace directory-flow slots from their browser halves (no wire advertisement). |
|
||||
| `ctx.webServer` | `core` | [`host-webserver`](../packages/host/webserver) | - | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`client-hmr`](../packages/client/hmr) | - | Plain node:http carrier: named-route registry, index transform taps, and the static dist fallback; web-transport plugins register their own routes. |
|
||||
| `ctx.webApp` | `core` | [`web-app`](../packages/bundle/web-app) | - | [`harness-dev-context`](../packages/context/harness-dev-context) | - | The web-runtime row advertises one URL for its Web GUI: the configured publicUrl, otherwise the listener origin; DSH_WEB_URL, the startup URL, and harness-dev-context read the same value. |
|
||||
| `ctx.config` | `service` | [`client-config`](../packages/client/config) | [`client-modules`](../packages/client/modules) | - | - | Types-only declaration; the client-modules plugin face provides the read-only lookup of each package's current synced Config. |
|
||||
| `ctx.clientModules` | `core` | [`client-modules`](../packages/client/modules) | - | [`client-hmr`](../packages/client/hmr) | - | Composes the __DSH_BOOT__ entry graph from an incremental dsh.client scan, serves plugin bundles, and notifies rebuilt/graph-changed subscribers. |
|
||||
| `ctx.workflowEngine` | `seam` | [`workflow`](../packages/workflow/workflow) | [`workflow-ptc`](../packages/workflow/workflow-ptc) | [`tool-workflow`](../packages/workflow/tool-workflow), [`tool-ralph`](../packages/experimental/tool-ralph) | - | One engine per context, as in bash, with no named-provider registry; the general workflow and fixed Ralph consumers start runs whose agent() calls fan out through ctx.subagents. |
|
||||
| `ctx.webhookRuntime` | `core` | [`webhook`](../packages/experimental/webhook) | - | [`webhook-github`](../packages/experimental/webhook-github) | - | Provider adapters dispatch authenticated deliveries; trusted plugins register independent process-local rules, and the runtime turns non-null results into ordinary Workspace-backed Sessions without delivery or completion state. |
|
||||
|
||||
@@ -96,6 +96,8 @@ flowchart LR
|
||||
pkg_llm_replay["llm-replay"]
|
||||
pkg_agent_loop["agent-loop"]
|
||||
pkg_compaction_basic["compaction-basic"]
|
||||
pkg_web_deepseek_api["web-deepseek-api"]
|
||||
pkg_web_search_deepseek["web-search-deepseek"]
|
||||
pkg_session_log_deepseek["session-log-deepseek"]
|
||||
svc_sessionLogDeepSeek["ctx.sessionLogDeepSeek<br/>Session-log upload policy"]
|
||||
pkg_deepseek_llm_api_extensions["deepseek-llm-api-extensions"]
|
||||
@@ -153,8 +155,10 @@ flowchart LR
|
||||
pkg_credentials["credentials"]
|
||||
svc_credentials["ctx.credentials<br/>Credential seam"]
|
||||
pkg_credentials_local["credentials-local"]
|
||||
pkg_llm_deepseek_api_key["llm-deepseek-api-key"]
|
||||
pkg_deepseek_account["deepseek-account"]
|
||||
svc_deepseekAccount["ctx.deepseekAccount<br/>DeepSeek account"]
|
||||
pkg_llm_deepseek_account["llm-deepseek-account"]
|
||||
pkg_authorization["authorization"]
|
||||
svc_authorization["ctx.authorization<br/>Authorization flow registry"]
|
||||
pkg_client_product_analytics["client-product-analytics"]
|
||||
@@ -294,8 +298,6 @@ flowchart LR
|
||||
pkg_tool_jobs["tool-jobs"]
|
||||
pkg_web["web"]
|
||||
svc_web["ctx.web<br/>Web access provider registry"]
|
||||
pkg_web_search_deepseek["web-search-deepseek"]
|
||||
pkg_web_deepseek_api["web-deepseek-api"]
|
||||
pkg_web_fetch_http["web-fetch-http"]
|
||||
pkg_spill["spill"]
|
||||
svc_spillStore["ctx.spillStore<br/>Spill storage seam"]
|
||||
@@ -312,6 +314,8 @@ flowchart LR
|
||||
pkg_web_app["web-app"]
|
||||
svc_webApp["ctx.webApp<br/>Served Web GUI"]
|
||||
pkg_harness_dev_context["harness-dev-context"]
|
||||
pkg_client_config["client-config"]
|
||||
svc_config["ctx.config<br/>Browser synced configuration lookup"]
|
||||
svc_clientModules["ctx.clientModules<br/>Client plugin graph host"]
|
||||
pkg_workflow["workflow"]
|
||||
svc_workflowEngine["ctx.workflowEngine<br/>Workflow script engine"]
|
||||
@@ -352,10 +356,12 @@ flowchart LR
|
||||
pkg_bash_local --> svc_shell
|
||||
pkg_bash_sandbox --> svc_shell
|
||||
pkg_browser_use --> svc_browserUse
|
||||
pkg_client_config --> svc_config
|
||||
pkg_client_connection --> svc_connection
|
||||
pkg_client_connection --> svc_connection_authentication
|
||||
pkg_client_file_upload --> svc_fileUploads
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_modules --> svc_config
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_connector_account --> svc_connectorAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
@@ -532,11 +538,14 @@ flowchart LR
|
||||
svc_connection_authentication --> pkg_client_connection
|
||||
svc_cordisInspect --> pkg_tool_cordis
|
||||
svc_credentials --> pkg_api_settings_controller
|
||||
svc_credentials --> pkg_llm_deepseek
|
||||
svc_credentials --> pkg_llm_deepseek_api_key
|
||||
svc_credentials --> pkg_llm_pi_ai
|
||||
svc_credentials --> pkg_web_deepseek_api
|
||||
svc_credentials --> pkg_web_search_deepseek
|
||||
svc_cuaAccess --> pkg_cua
|
||||
svc_cuaPrograms --> pkg_cua_mcp
|
||||
svc_deepseekAccount --> pkg_llm_deepseek
|
||||
svc_deepseekAccount --> pkg_llm_deepseek_account
|
||||
svc_deepseekAccount --> pkg_web_deepseek_api
|
||||
svc_deepseekLlmApiExtensions --> pkg_llm_deepseek
|
||||
svc_directoryPicker --> pkg_api_workspace_controller
|
||||
svc_dynamicCordisRunner --> pkg_tool_cordis
|
||||
@@ -555,6 +564,8 @@ flowchart LR
|
||||
svc_jobs --> pkg_tool_terminal
|
||||
svc_llm --> pkg_agent_loop
|
||||
svc_llm --> pkg_compaction_basic
|
||||
svc_llm --> pkg_web_deepseek_api
|
||||
svc_llm --> pkg_web_search_deepseek
|
||||
svc_lsp --> pkg_tool_lsp
|
||||
svc_mcpResources --> pkg_mcp_resources
|
||||
svc_officeKit --> pkg_client_ui_sidebar_documentpreview
|
||||
@@ -699,7 +710,7 @@ flowchart LR
|
||||
| `ctx.officeKit` | `core` | [`office-kit`](../packages/document/office-kit) | - | [`client-ui-sidebar-documentpreview`](../packages/client/ui-sidebar-documentpreview), [`tool-office`](../packages/document/tool-office) | - | 已授权的 Office 字节在宿主上使用已声明的原生目标引擎渲染为 PDF 或图片、转换或重算;未声明原生目标时使用 Node WASM。 |
|
||||
| `ctx.attachments` | `seam` | [`attachment`](../packages/attachment/attachment) | [`attachment-local`](../packages/attachment/attachment-local) | [`api-session-controller`](../packages/api/session-controller), [`tool-fs`](../packages/fs/tool-fs), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-deepseek`](../packages/llm/llm-deepseek) | - | 宿主会在会话事件之前提交已接受的图片;提供方适配器将已授权的持久引用解析为提供方原生内容。 |
|
||||
| `ctx.fileUploads` | `core` | [`client-file-upload`](../packages/client/file-upload) | - | [`api-session-controller`](../packages/api/session-controller) | - | 负责流式接收、持久存储和暂存回执生命周期;Session Controller 将回执绑定到已接受的提交。 |
|
||||
| `ctx.llm` | `seam` | [`llm`](../packages/llm/llm) | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-replay`](../packages/test-support/llm-replay) | [`agent-loop`](../packages/core/agent-loop), [`compaction-basic`](../packages/compaction/compaction-basic) | - | 适配器注册提供方实现;agent loop(智能体循环)与压缩功能调用提供方无关的流服务。 |
|
||||
| `ctx.llm` | `seam` | [`llm`](../packages/llm/llm) | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`llm-replay`](../packages/test-support/llm-replay) | [`agent-loop`](../packages/core/agent-loop), [`compaction-basic`](../packages/compaction/compaction-basic), [`web-deepseek-api`](../packages/web/web-deepseek-api), [`web-search-deepseek`](../packages/web/web-search-deepseek) | - | 适配器注册提供方实现;agent loop(智能体循环)与压缩功能调用与提供方无关的流式服务,DeepSeek Web 提供方读取路由发布的凭据。 |
|
||||
| `ctx.sessionLogDeepSeek` | `core` | [`session-log-deepseek`](../packages/session/session-log-deepseek) | - | - | - | 插件在准备权威 Session 日志请求贡献前注册归调用方所有的排除条件;没有条件匹配的请求应用普通上传资格判断。 |
|
||||
| `ctx.deepseekLlmApiExtensions` | `seam` | [`deepseek-llm-api-extensions`](../packages/llm/deepseek-llm-api-extensions) | [`session-log-deepseek`](../packages/session/session-log-deepseek), [`plugin-package-inventory-deepseek`](../packages/llm/plugin-package-inventory-deepseek) | [`llm-deepseek`](../packages/llm/llm-deepseek) | - | 插件准备彼此独立的顶层字段;官方适配器会合并这些字段,并在 HTTP 接受后提交其交付状态。 |
|
||||
| `ctx.tokenMeter` | `core` | [`token-meter`](../packages/llm/token-meter) | - | [`compaction-basic`](../packages/compaction/compaction-basic) | - | 拥有按会话隔离的回放折叠区;压力消费方共享不可变且带修订版本的测量结果。 |
|
||||
@@ -725,8 +736,8 @@ flowchart LR
|
||||
| `ctx.configEditor` | `core` | [`config-editor`](../packages/boot/config-editor) | - | [`settings`](../packages/settings/settings), [`agent-default-model`](../packages/core/agent-default-model) | - | Persists profile config patches under the application file lock and HMR queue, then reconciles Loader entries. |
|
||||
| `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` | `service` | [`deepseek-account`](../packages/credentials/deepseek-account) | - | [`llm-deepseek`](../packages/llm/llm-deepseek) | - | Host 负责浏览器授权和本地凭证;UI 使用方只接收不含 token 的状态。 |
|
||||
| `ctx.credentials` | `seam` | [`credentials`](../packages/credentials/credentials) | [`credentials-local`](../packages/credentials/credentials-local) | [`api-settings-controller`](../packages/api/settings-controller), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`web-deepseek-api`](../packages/web/web-deepseek-api), [`web-search-deepseek`](../packages/web/web-search-deepseek) | - | 配置携带对机密信息的引用;提供方拥有实际值。消费方按操作解析,因此轮换后的凭据会在紧接着的下一次请求中生效;settings controller 提供不含实际值的视图和只写存储。 |
|
||||
| `ctx.deepseekAccount` | `service` | [`deepseek-account`](../packages/account/deepseek-account) | - | [`llm-deepseek-account`](../packages/llm/llm-deepseek-account), [`web-deepseek-api`](../packages/web/web-deepseek-api) | - | Host 负责浏览器授权和本地凭证,并向账号模型路由和 Web 提供方释放按请求的凭据;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 反馈适配器通过同一个注入服务创建独立上报通道。 |
|
||||
@@ -779,6 +790,7 @@ flowchart LR
|
||||
| `ctx.directoryPicker` | `seam` | [`host-directory-picker`](../packages/host/directory-picker) | [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse) | [`api-workspace-controller`](../packages/api/workspace-controller) | - | 带判别标记的交互能力:原生后端在 Host 显示设备上打开一个操作系统选择器,浏览后端为应用内浏览器提供列表与创建原语;双端后端通过其浏览器侧填充 ui-workspace 目录流程的 slot(不通过协议发布)。 |
|
||||
| `ctx.webServer` | `core` | [`host-webserver`](../packages/host/webserver) | - | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`client-hmr`](../packages/client/hmr) | - | 普通的 node:http 载体:具名路由注册表、索引转换 tap,以及静态 dist 回退;Web 传输插件注册自己的路由。 |
|
||||
| `ctx.webApp` | `core` | [`web-app`](../packages/bundle/web-app) | - | [`harness-dev-context`](../packages/context/harness-dev-context) | - | web-runtime 行为其 Web GUI 公告一个 URL:配置了 publicUrl 时用它,否则用监听器 origin;DSH_WEB_URL、启动 URL 与 harness-dev-context 读取同一个值。 |
|
||||
| `ctx.config` | `service` | [`client-config`](../packages/client/config) | [`client-modules`](../packages/client/modules) | - | - | 只有类型的声明;client-modules 插件面提供对各包当前同步 Config 的只读查询。 |
|
||||
| `ctx.clientModules` | `core` | [`client-modules`](../packages/client/modules) | - | [`client-hmr`](../packages/client/hmr) | - | 通过增量 `dsh.client` 扫描组合 __DSH_BOOT__ 入口图,提供插件组合包,并通知重建/图变更订阅方。 |
|
||||
| `ctx.workflowEngine` | `seam` | [`workflow`](../packages/workflow/workflow) | [`workflow-ptc`](../packages/workflow/workflow-ptc) | [`tool-workflow`](../packages/workflow/tool-workflow), [`tool-ralph`](../packages/experimental/tool-ralph) | - | 每个上下文使用一个引擎,与 bash 相同,且没有具名提供方注册表;通用工作流与固定 Ralph 消费方启动运行,其中的 agent() 调用通过 ctx.subagents 扇出。 |
|
||||
| `ctx.webhookRuntime` | `core` | [`webhook`](../packages/experimental/webhook) | - | [`webhook-github`](../packages/experimental/webhook-github) | - | 提供方适配器分派已认证交付;可信插件注册独立的进程本地规则,runtime 把非 null 结果转换为普通的 Workspace-backed Session,不保留交付或完成状态。 |
|
||||
|
||||
+36
-16
@@ -207,7 +207,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-api-gateway`
|
||||
|
||||
- `inject`: `typert` · `remoteAccess`
|
||||
- `source`: [`packages/api/gateway/src/index.ts:157`](../packages/api/gateway/src/index.ts)
|
||||
- `source`: [`packages/api/gateway/src/index.ts:158`](../packages/api/gateway/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Gateway transport configuration. */
|
||||
@@ -216,6 +216,11 @@ export interface Config {
|
||||
readonly websocketHeartbeatIntervalMs?: number
|
||||
/** Buffered uplink frame bytes one logical stream may hold before it fails with `gateway/uplink-overflow`. @default 262144 */
|
||||
readonly streamInboxBytes?: number
|
||||
/**
|
||||
* Encoded downlink bytes one WebSocket connection may have queued and unwritten before every logical stream on it
|
||||
* pauses reading its source. Items leave in the order their streams produced them. @default 1048576
|
||||
*/
|
||||
readonly streamOutboxBytes?: number
|
||||
/** Per-message compression for the Remote stream WebSocket; `'none'` disables the extension. @default 'deflate' */
|
||||
readonly websocketCompression?: 'none' | 'deflate'
|
||||
}
|
||||
@@ -524,8 +529,8 @@ export interface ConnectionRecoveryConfig {
|
||||
|
||||
## `@deepseek-ai/dsh-client-hmr`
|
||||
|
||||
- `inject`: `clientModules` · `webServer`
|
||||
- `source`: [`packages/client/hmr/src/index.ts:30`](../packages/client/hmr/src/index.ts)
|
||||
- `inject`: `clientModules`
|
||||
- `source`: [`packages/client/hmr/src/index.ts:26`](../packages/client/hmr/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config, validated by the same-named schemastery schema. */
|
||||
@@ -955,7 +960,7 @@ export interface Config extends CuaConfig {
|
||||
## `@deepseek-ai/dsh-deepseek-account`
|
||||
|
||||
- `inject`: `credentials` · `authorization`
|
||||
- `source`: [`packages/credentials/deepseek-account/src/index.ts:40`](../packages/credentials/deepseek-account/src/index.ts)
|
||||
- `source`: [`packages/account/deepseek-account/src/index.ts:39`](../packages/account/deepseek-account/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment-specific platform and request deadlines. */
|
||||
@@ -1112,7 +1117,7 @@ export interface StagehandModelConfig {
|
||||
## `@deepseek-ai/dsh-experimental-claude-code-mods`
|
||||
|
||||
- `inject`: `workingDirectory` · `agents`
|
||||
- `source`: [`packages/experimental/claude-code-mods/src/index.ts:54`](../packages/experimental/claude-code-mods/src/index.ts)
|
||||
- `source`: [`packages/experimental/claude-code-mods/src/index.ts:55`](../packages/experimental/claude-code-mods/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: the limits mod hooks run under. */
|
||||
@@ -1167,7 +1172,7 @@ export interface CotTranslationPreferences {
|
||||
## `@deepseek-ai/dsh-experimental-client-ui-forge`
|
||||
|
||||
- `inject`: `forge` · `forgeSession` · `sessionProjections` · `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `agents`
|
||||
- `source`: [`packages/experimental/client-ui-forge/src/types.ts:485`](../packages/experimental/client-ui-forge/src/types.ts)
|
||||
- `source`: [`packages/experimental/client-ui-forge/src/types.ts:530`](../packages/experimental/client-ui-forge/src/types.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Host settings of the forge panel Remote. */
|
||||
@@ -1712,7 +1717,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `agentDefaultModel` · `agents` · `sessions`
|
||||
- `refs`: [`ApprovalPolicy`](subsystems/approval.md)
|
||||
- `source`: [`packages/bundle/headless/src/index.ts:48`](../packages/bundle/headless/src/index.ts)
|
||||
- `source`: [`packages/bundle/headless/src/index.ts:49`](../packages/bundle/headless/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: the task and run options resolved from this app's injected provider service. */
|
||||
@@ -1760,7 +1765,7 @@ export interface HmrConfig extends ChokidarOptions {
|
||||
## `@deepseek-ai/dsh-hooks-claude-code`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:53`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:54`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the CC hook config lives + substitution roots. */
|
||||
@@ -1799,7 +1804,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-hooks-codex`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:52`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:53`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the Codex hooks.json lives + the model name for payloads. */
|
||||
@@ -2938,7 +2943,7 @@ export interface Config {
|
||||
timeoutMs?: number
|
||||
/** Maximum numeric elapsed budget accepted by resolve. */
|
||||
maxTimeoutMs?: number
|
||||
/** Combined serialized logs, completion and diagnostic byte cap. */
|
||||
/** Combined serialized output and completion or diagnostic cap; terminal data takes priority over captured output. */
|
||||
maxOutputBytes?: number
|
||||
/** V8 old-generation heap limit in MiB; native allocations are excluded. */
|
||||
maxOldGenerationSizeMb?: number
|
||||
@@ -3254,7 +3259,7 @@ export type SessionLogCompressionLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|
||||
|
||||
## `@deepseek-ai/dsh-session-persistence-jsonl`
|
||||
|
||||
- `source`: [`packages/session/session-persistence-jsonl/src/index.ts:95`](../packages/session/session-persistence-jsonl/src/index.ts)
|
||||
- `source`: [`packages/session/session-persistence-jsonl/src/index.ts:107`](../packages/session/session-persistence-jsonl/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config for the JSONL backend's root, physical encoding, and listing concurrency. */
|
||||
@@ -3282,6 +3287,20 @@ export type JsonlCompression = 'zstd' | 'none'
|
||||
```
|
||||
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-jsonl -->
|
||||
|
||||
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-sqlite -->
|
||||
<a id="deepseek-aidsh-session-persistence-sqlite"></a>
|
||||
|
||||
## `@deepseek-ai/dsh-session-persistence-sqlite`
|
||||
|
||||
- `refs`: [`JsonlConfigOptions`](#deepseek-aidsh-session-persistence-jsonl)
|
||||
- `source`: [`packages/session/session-persistence-sqlite/src/index.ts:11`](../packages/session/session-persistence-sqlite/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Storage root and JSONL settings used when importing legacy Sessions. */
|
||||
export type Config = JsonlConfigOptions
|
||||
```
|
||||
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-sqlite -->
|
||||
|
||||
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-session-projection-cache -->
|
||||
<a id="deepseek-aidsh-session-projection-cache"></a>
|
||||
|
||||
@@ -3431,7 +3450,7 @@ export enum SessionTelemetryMode {
|
||||
## `@deepseek-ai/dsh-session-title`
|
||||
|
||||
- `inject`: `sessions` · `sessionProjections` · `agents`
|
||||
- `source`: [`packages/session/session-title/src/index.ts:56`](../packages/session/session-title/src/index.ts)
|
||||
- `source`: [`packages/session/session-title/src/index.ts:57`](../packages/session/session-title/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required deterministic fallback and accepted-title limits. */
|
||||
@@ -3453,7 +3472,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `sessionTitle` · `llm` · `sessions`
|
||||
- `refs`: [`SessionTitleLlmConfig`](../packages/session/session-title-llm/src/index.ts)
|
||||
- `source`: [`packages/experimental/session-title-all-prompts-llm/src/index.ts:29`](../packages/experimental/session-title-all-prompts-llm/src/index.ts)
|
||||
- `source`: [`packages/experimental/session-title-all-prompts-llm/src/index.ts:30`](../packages/experimental/session-title-all-prompts-llm/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required execution controls plus this provider's title-length targets; no defaults. */
|
||||
@@ -3473,7 +3492,7 @@ export interface Config extends SessionTitleLlmConfig {
|
||||
|
||||
- `inject`: `sessionTitle` · `llm` · `sessions`
|
||||
- `refs`: [`SessionTitleLlmConfig`](../packages/session/session-title-llm/src/index.ts)
|
||||
- `source`: [`packages/session/session-title-first-prompt-llm/src/index.ts:29`](../packages/session/session-title-first-prompt-llm/src/index.ts)
|
||||
- `source`: [`packages/session/session-title-first-prompt-llm/src/index.ts:30`](../packages/session/session-title-first-prompt-llm/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required execution controls plus this provider's title-length targets; no defaults. */
|
||||
@@ -5009,7 +5028,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `web`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/web/web-deepseek-api/src/index.ts:64`](../packages/web/web-deepseek-api/src/index.ts)
|
||||
- `source`: [`packages/web/web-deepseek-api/src/index.ts:57`](../packages/web/web-deepseek-api/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/**
|
||||
@@ -5087,7 +5106,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `web`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/web/web-search-deepseek/src/index.ts:54`](../packages/web/web-search-deepseek/src/index.ts)
|
||||
- `source`: [`packages/web/web-search-deepseek/src/index.ts:53`](../packages/web/web-search-deepseek/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config (all optional — `apply` fills env-var and constant defaults). */
|
||||
@@ -5217,6 +5236,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@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) |
|
||||
| `@deepseek-ai/dsh-browser-use` | — | [`packages/browser-use/browser-use/src/index.ts`](../packages/browser-use/browser-use/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-config` | — | [`packages/client/config/src/index.ts`](../packages/client/config/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-file-upload` | `agents` · `attachments` · `commands` · `connection` | [`packages/client/file-upload/src/index.ts`](../packages/client/file-upload/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-locale` | — | [`packages/client/locale/src/index.ts`](../packages/client/locale/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-modules` | `loader` | [`packages/client/modules/src/index.ts`](../packages/client/modules/src/index.ts) |
|
||||
|
||||
+36
-16
@@ -209,7 +209,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-api-gateway`
|
||||
|
||||
- `inject`: `typert` · `remoteAccess`
|
||||
- `source`: [`packages/api/gateway/src/index.ts:157`](../packages/api/gateway/src/index.ts)
|
||||
- `source`: [`packages/api/gateway/src/index.ts:158`](../packages/api/gateway/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Gateway transport configuration. */
|
||||
@@ -218,6 +218,11 @@ export interface Config {
|
||||
readonly websocketHeartbeatIntervalMs?: number
|
||||
/** Buffered uplink frame bytes one logical stream may hold before it fails with `gateway/uplink-overflow`. @default 262144 */
|
||||
readonly streamInboxBytes?: number
|
||||
/**
|
||||
* Encoded downlink bytes one WebSocket connection may have queued and unwritten before every logical stream on it
|
||||
* pauses reading its source. Items leave in the order their streams produced them. @default 1048576
|
||||
*/
|
||||
readonly streamOutboxBytes?: number
|
||||
/** Per-message compression for the Remote stream WebSocket; `'none'` disables the extension. @default 'deflate' */
|
||||
readonly websocketCompression?: 'none' | 'deflate'
|
||||
}
|
||||
@@ -526,8 +531,8 @@ export interface ConnectionRecoveryConfig {
|
||||
|
||||
## `@deepseek-ai/dsh-client-hmr`
|
||||
|
||||
- `inject`: `clientModules` · `webServer`
|
||||
- `source`: [`packages/client/hmr/src/index.ts:30`](../packages/client/hmr/src/index.ts)
|
||||
- `inject`: `clientModules`
|
||||
- `source`: [`packages/client/hmr/src/index.ts:26`](../packages/client/hmr/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config, validated by the same-named schemastery schema. */
|
||||
@@ -957,7 +962,7 @@ export interface Config extends CuaConfig {
|
||||
## `@deepseek-ai/dsh-deepseek-account`
|
||||
|
||||
- `inject`: `credentials` · `authorization`
|
||||
- `source`: [`packages/credentials/deepseek-account/src/index.ts:40`](../packages/credentials/deepseek-account/src/index.ts)
|
||||
- `source`: [`packages/account/deepseek-account/src/index.ts:39`](../packages/account/deepseek-account/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment-specific platform and request deadlines. */
|
||||
@@ -1114,7 +1119,7 @@ export interface StagehandModelConfig {
|
||||
## `@deepseek-ai/dsh-experimental-claude-code-mods`
|
||||
|
||||
- `inject`: `workingDirectory` · `agents`
|
||||
- `source`: [`packages/experimental/claude-code-mods/src/index.ts:54`](../packages/experimental/claude-code-mods/src/index.ts)
|
||||
- `source`: [`packages/experimental/claude-code-mods/src/index.ts:55`](../packages/experimental/claude-code-mods/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: the limits mod hooks run under. */
|
||||
@@ -1169,7 +1174,7 @@ export interface CotTranslationPreferences {
|
||||
## `@deepseek-ai/dsh-experimental-client-ui-forge`
|
||||
|
||||
- `inject`: `forge` · `forgeSession` · `sessionProjections` · `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `agents`
|
||||
- `source`: [`packages/experimental/client-ui-forge/src/types.ts:485`](../packages/experimental/client-ui-forge/src/types.ts)
|
||||
- `source`: [`packages/experimental/client-ui-forge/src/types.ts:530`](../packages/experimental/client-ui-forge/src/types.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Host settings of the forge panel Remote. */
|
||||
@@ -1714,7 +1719,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `agentDefaultModel` · `agents` · `sessions`
|
||||
- `refs`: [`ApprovalPolicy`](subsystems/approval.zh.md)
|
||||
- `source`: [`packages/bundle/headless/src/index.ts:48`](../packages/bundle/headless/src/index.ts)
|
||||
- `source`: [`packages/bundle/headless/src/index.ts:49`](../packages/bundle/headless/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: the task and run options resolved from this app's injected provider service. */
|
||||
@@ -1762,7 +1767,7 @@ export interface HmrConfig extends ChokidarOptions {
|
||||
## `@deepseek-ai/dsh-hooks-claude-code`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:53`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-claude-code/src/index.ts:54`](../packages/experimental/hooks-claude-code/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the CC hook config lives + substitution roots. */
|
||||
@@ -1801,7 +1806,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-hooks-codex`
|
||||
|
||||
- `inject`: `shell` · `agents` · `workingDirectory`
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:52`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
- `source`: [`packages/experimental/hooks-codex/src/index.ts:53`](../packages/experimental/hooks-codex/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config: where the Codex hooks.json lives + the model name for payloads. */
|
||||
@@ -2940,7 +2945,7 @@ export interface Config {
|
||||
timeoutMs?: number
|
||||
/** Maximum numeric elapsed budget accepted by resolve. */
|
||||
maxTimeoutMs?: number
|
||||
/** Combined serialized logs, completion and diagnostic byte cap. */
|
||||
/** Combined serialized output and completion or diagnostic cap; terminal data takes priority over captured output. */
|
||||
maxOutputBytes?: number
|
||||
/** V8 old-generation heap limit in MiB; native allocations are excluded. */
|
||||
maxOldGenerationSizeMb?: number
|
||||
@@ -3256,7 +3261,7 @@ export type SessionLogCompressionLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|
||||
|
||||
## `@deepseek-ai/dsh-session-persistence-jsonl`
|
||||
|
||||
- `source`: [`packages/session/session-persistence-jsonl/src/index.ts:95`](../packages/session/session-persistence-jsonl/src/index.ts)
|
||||
- `source`: [`packages/session/session-persistence-jsonl/src/index.ts:107`](../packages/session/session-persistence-jsonl/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config for the JSONL backend's root, physical encoding, and listing concurrency. */
|
||||
@@ -3284,6 +3289,20 @@ export type JsonlCompression = 'zstd' | 'none'
|
||||
```
|
||||
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-jsonl -->
|
||||
|
||||
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-sqlite -->
|
||||
<a id="deepseek-aidsh-session-persistence-sqlite"></a>
|
||||
|
||||
## `@deepseek-ai/dsh-session-persistence-sqlite`
|
||||
|
||||
- `refs`: [`JsonlConfigOptions`](#deepseek-aidsh-session-persistence-jsonl)
|
||||
- `source`: [`packages/session/session-persistence-sqlite/src/index.ts:11`](../packages/session/session-persistence-sqlite/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Storage root and JSONL settings used when importing legacy Sessions. */
|
||||
export type Config = JsonlConfigOptions
|
||||
```
|
||||
<!-- END GENERATED config-catalog:@deepseek-ai/dsh-session-persistence-sqlite -->
|
||||
|
||||
<!-- BEGIN GENERATED config-catalog:@deepseek-ai/dsh-session-projection-cache -->
|
||||
<a id="deepseek-aidsh-session-projection-cache"></a>
|
||||
|
||||
@@ -3433,7 +3452,7 @@ export enum SessionTelemetryMode {
|
||||
## `@deepseek-ai/dsh-session-title`
|
||||
|
||||
- `inject`: `sessions` · `sessionProjections` · `agents`
|
||||
- `source`: [`packages/session/session-title/src/index.ts:56`](../packages/session/session-title/src/index.ts)
|
||||
- `source`: [`packages/session/session-title/src/index.ts:57`](../packages/session/session-title/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required deterministic fallback and accepted-title limits. */
|
||||
@@ -3455,7 +3474,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `sessionTitle` · `llm` · `sessions`
|
||||
- `refs`: [`SessionTitleLlmConfig`](../packages/session/session-title-llm/src/index.ts)
|
||||
- `source`: [`packages/experimental/session-title-all-prompts-llm/src/index.ts:29`](../packages/experimental/session-title-all-prompts-llm/src/index.ts)
|
||||
- `source`: [`packages/experimental/session-title-all-prompts-llm/src/index.ts:30`](../packages/experimental/session-title-all-prompts-llm/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required execution controls plus this provider's title-length targets; no defaults. */
|
||||
@@ -3475,7 +3494,7 @@ export interface Config extends SessionTitleLlmConfig {
|
||||
|
||||
- `inject`: `sessionTitle` · `llm` · `sessions`
|
||||
- `refs`: [`SessionTitleLlmConfig`](../packages/session/session-title-llm/src/index.ts)
|
||||
- `source`: [`packages/session/session-title-first-prompt-llm/src/index.ts:29`](../packages/session/session-title-first-prompt-llm/src/index.ts)
|
||||
- `source`: [`packages/session/session-title-first-prompt-llm/src/index.ts:30`](../packages/session/session-title-first-prompt-llm/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Required execution controls plus this provider's title-length targets; no defaults. */
|
||||
@@ -5011,7 +5030,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `web`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/web/web-deepseek-api/src/index.ts:64`](../packages/web/web-deepseek-api/src/index.ts)
|
||||
- `source`: [`packages/web/web-deepseek-api/src/index.ts:57`](../packages/web/web-deepseek-api/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/**
|
||||
@@ -5089,7 +5108,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `web`
|
||||
- `refs`: `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/web/web-search-deepseek/src/index.ts:54`](../packages/web/web-search-deepseek/src/index.ts)
|
||||
- `source`: [`packages/web/web-search-deepseek/src/index.ts:53`](../packages/web/web-search-deepseek/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Plugin config (all optional — `apply` fills env-var and constant defaults). */
|
||||
@@ -5219,6 +5238,7 @@ export interface Config {
|
||||
| `@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) |
|
||||
| `@deepseek-ai/dsh-browser-use` | — | [`packages/browser-use/browser-use/src/index.ts`](../packages/browser-use/browser-use/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-config` | — | [`packages/client/config/src/index.ts`](../packages/client/config/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-file-upload` | `agents` · `attachments` · `commands` · `connection` | [`packages/client/file-upload/src/index.ts`](../packages/client/file-upload/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-locale` | — | [`packages/client/locale/src/index.ts`](../packages/client/locale/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-modules` | `loader` | [`packages/client/modules/src/index.ts`](../packages/client/modules/src/index.ts) |
|
||||
|
||||
Loaded 100 of 822 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user