Merge remote-tracking branch 'origin/master' into refactor/llm-route-credential

# Conflicts:
#	scripts/empty-catch.baseline.json
This commit is contained in:
LegGasai committed 2026-11-16 14:36:05 +08:00
commit 8eda7cfb7c
602 files changed
+10567 -2280

No files matched your search

@@ -9,8 +9,8 @@
en: 44615a7a0939054e
zh: b8efa721321ba0d7
/agent-note-creator-mode-installs-persistent-plugin-bundles/decision:
en: 38ecabc170c418c7
zh: d380f53fa508328e
en: 013a2088d8f8c435
zh: 5491ff817716696b
/agent-note-creator-mode-installs-persistent-plugin-bundles/alternatives-considered:
en: af527d8aabdfd59c
zh: 34388da992d2ab56
@@ -14,7 +14,7 @@ Creator mode enables the existing `plugin_manager` tool. Agents author packages
The default Standard mode enables the same tool under the same profile condition and approval gate. Without it, Standard sessions did not install plugins directly and spent extra turns and tokens working around the missing tool; the change also moves Standard and Creator toward one capability set. A full-access Standard session can therefore install Host code without a separate prompt, as its shell already can. PTC and Minimal keep the tool disabled.
The model sees two read-only Cordis inspection tools. Generated-code define/run/stop/undefine and dynamic self-inspection tool APIs are absent. Existing runtime and Client consumers retain their services; historical session cards remain readable. This supersedes only the model-facing mutation workflow in the [self-referential toolset reference](../../../../packages/extensions/cordis-host-runner/README.md); its runtime ownership and sandbox rationale remain independently relevant. The [profile transaction decision](2026-09-14-current-profile-plugin-management.md) continues to govern locking, package installation, and partial failures.
Standard and Creator expose one read-only Cordis inspection tool, `cordis_inspect`. Omitting `query` discovers providers; supplying `query` reads one declared method. The shared entry keeps runtime discovery available in the default mode without duplicating tool descriptions. Generated-code define/run/stop/undefine and dynamic self-inspection tool APIs are absent. Existing runtime and Client consumers retain their services; historical session cards remain readable. This supersedes only the model-facing mutation workflow in the [self-referential toolset reference](../../../../packages/extensions/cordis-host-runner/README.md); its runtime ownership and sandbox rationale remain independently relevant. The [profile transaction decision](2026-09-14-current-profile-plugin-management.md) continues to govern locking, package installation, and partial failures.
Visual creation requests default to an installed Client plugin rendered in the current Web page unless the user names another destination. The development skill supplies a minimal package and effect-owned Client registration. Discovery ends when the required APIs are known; a working first version is installed before optional visual refinement. Verification uses the connected page where available. Browser authentication or operating-system setup is not a prerequisite for plugin installation, and a mock preview cannot establish an in-app result.
@@ -14,7 +14,7 @@ agent 需要安装能力并在同一段对话中使用。生成代码工具在
默认的标准模式以相同的 profile 条件和审批门槛启用同一工具。缺少该工具时,标准模式会话不会直接安装插件,而要额外花费轮次和 token 绕过;此改动也让标准模式和创造模式朝同一能力集收敛。因此,完整权限的标准模式会话无需单独审批即可安装 Host 代码,与其 shell 已有的能力一致。PTC 和 Minimal 仍禁用该工具。
模型可见两个只读 Cordis 检查工具,不再提供生成代码的 define/run/stop/undefine 和动态自省工具 API。现有运行时和 Client 消费者保留其服务;历史会话卡片仍然可读。这仅取代[自引用工具集参考](../../../../packages/extensions/cordis-host-runner/README.zh.md)中的模型侧变更流程;其运行时所有权和沙箱依据仍有独立价值。[profile 事务决策](2026-09-14-current-profile-plugin-management.zh.md)继续规定锁、包安装和部分失败行为。
标准模式和创造模式提供一个只读 Cordis 检查工具 `cordis_inspect`。省略 `query` 以发现 provider;提供 `query` 以读取一个已声明的方法。共用此入口使默认模式能够进行运行时发现,同时避免重复的工具描述。不再提供生成代码的 define/run/stop/undefine 和动态自省工具 API。现有运行时和 Client 消费者保留其服务;历史会话卡片仍然可读。这仅取代[自引用工具集参考](../../../../packages/extensions/cordis-host-runner/README.zh.md)中的模型侧变更流程;其运行时所有权和沙箱依据仍有独立价值。[profile 事务决策](2026-09-14-current-profile-plugin-management.zh.md)继续规定锁、包安装和部分失败行为。
除非用户指定其他目标,视觉创建请求默认通过已安装的 Client 插件显示在当前 Web 页面。开发 skill 提供最小包和由 effect 管理的 Client 注册示例。已知所需 API 后结束探查,在可选视觉优化之前先安装能工作的初版。有条件时使用已连接页面验证。浏览器认证或操作系统设置不是安装插件的前提,mock 预览不能证明应用内结果。
@@ -0,0 +1,28 @@
# Bilingual-pair consistency record for 2026-11-05-session-panel.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-11-05-session-panel.md
/agent-note-session-panel-in-the-chat-view-s-end-gutter:
en: 1dc9957a0c9336e0
zh: 88d41c8490c2710c
/agent-note-session-panel-in-the-chat-view-s-end-gutter/problem:
en: c69d9843bc6f0b87
zh: c31bb1b2b4d9b781
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision:
en: c2ddf417ea56b626
zh: 44c30091ade7e5bf
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/docking-follows-the-transcript-gutter:
en: 8a97ac8ac0b40d0c
zh: d42fe9c23b9dcd79
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/sections-are-registrations-the-panel-draws-titles:
en: d6f85e07351ad90e
zh: f883a99c8ca98522
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/the-turn-rail-sits-at-the-start-edge:
en: 08e720a4ea75d4d6
zh: 5e2e5b8452f67d36
/agent-note-session-panel-in-the-chat-view-s-end-gutter/alternatives-considered:
en: 6adaf7a36da05668
zh: c0ace7297995d764
/agent-note-session-panel-in-the-chat-view-s-end-gutter/consequences:
en: 6c2f625c9c36ebd0
zh: 0060e818dbf233ce
@@ -0,0 +1,49 @@
# Agent Note: Session panel in the Chat View's end gutter
Status: implemented
English | [中文](2026-11-05-session-panel.zh.md)
## Problem
Facts about the current Session — its project directory, the change requests it opened, and later its outputs — had no common home. Each owner added its own Session header button and, for anything larger than a menu, a right-sidebar tab: the forge change requests are one such tab. A sidebar tab takes width from the transcript while it shows, shows one tab at a time, and leaves the facts one click away from every message. The required surface is a summary the user can keep beside the conversation without covering it, that several plugins fill independently, that hides when there is no room, and that the user can show or hide from the Session header.
## Decision
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.md) adds a Session header toggle (`conversation.session.header.utilities`, order −10) and a floating panel that occupies `conversation.chat.aside`, a slot that [`ui-chat`](../../../../packages/client/ui-chat/README.md#scroll-ownership) renders in the Chat View beside the turn rail. The aside is a zero-height layer at the top of the Chat frame and, like the turn rail, is sticky inside the shared scrollport: the panel does not scroll with the transcript, inherits the scrollport's composer and viewport heights, and needs no seat in the Conversation shell. Views other than Chat show no panel.
### Docking follows the transcript gutter
The panel docks only while the gutter between the transcript column and the Chat frame's end edge can hold it (348px: 40px clear of the column and its width handle, a 300px minimum width, and an 8px margin). The gutter, not the viewport width, decides because the column width is adaptive and user-draggable and the right sidebar shares the frame: the same viewport can leave 75px or 600px. The Chat View owns the frame and the transcript column, so its aside layer publishes the gutter as the `--dsh-chat-aside-gutter` custom property, and the panel's stylesheet sizes the docked panel from it.
Script still needs the decision, because docked and overlay differ in behavior and not only in size: the toggle reports `aria-expanded` truthfully and knows whether a press flips docking or opens the overlay, the overlay closes on Escape and on outside presses and returns focus, and an open overlay closes once the panel can dock. A CSS-only container query cannot tell an element outside the Chat View, or a listener, any of that. The stylesheet therefore computes the decision as well: each mounted panel renders a zero-height dock probe that is 1px wide from the gutter that holds the panel's minimum width and 0 below it, derived from the same metrics as the docked width, and the plugin observes only that probe. It hears the decision flip; observing the frame and the transcript column would call back on every frame of a streamed reply, because the column's height changes with its content, and on every step of a window resize. A Session has room to dock while any of its probes does, and a Session without a probe shows no Chat View. The toggle and the panel decide the presentation with the same pure function. While no Chat View shows the Session, as in the trajectory View, the toggle is unavailable and its tooltip asks for the Chat view; `ui-conversation` keeps View selection inside its shell, so the toggle does not switch Views itself.
Docking follows one persisted preference shared by every Session and defaults to on. Without room, a press opens a transient overlay for that Session above the transcript; it never changes the preference, and it closes once its gutter can dock the panel or no Chat View shows the Session any longer, so it never reappears on its own. The panel state follows the reported gutter of the open overlay's Session. A panel withdraws its report when it unmounts or its Chat View moves to another Session, in a layout-effect cleanup kept apart from the gutter update, so a changed gutter never reads as an unmount. Hiding automatically and overlaying on request keeps the transcript uncovered without making the facts unreachable on laptop widths.
### Sections are registrations; the panel draws titles
Each section is one list registration with `id`, `order`, and a required `label`. The panel projects the live registrations into titles, draws each title, and renders the section body with `renderSlot(..., { only: id })`; a CSS `:has()` rule hides a section whose body rendered nothing, so a section opts out by rendering nothing and no effect reports visibility to the owner. Trailing title controls are a keyed slot addressed by the section `id`, and a section that several plugins share declares its own row slot, as the built-in Environment section does with `conversation.session.panel.environment.row`. Marks that must stay visible while the panel is hidden go in an indicator list over the toggle.
Rows from every contributor share one look through the panel's stylesheet instead of a shared component: each contributor writes its row's markup and marks the parts, and the panel lays them out, so icon, text, and trailing areas align across packages. A shared row component would receive each contributor's icon, text, and controls as React nodes in props, which the client rules forbid, and a feature package cannot share its own row component with another feature package.
### The turn rail sits at the start edge
The turn rail sits at the scrollport's start edge with its marks, focus ring, and preview mirrored, leaving the end gutter to the docked panel; its 900px hiding rule guarantees room beside the start-side width handle.
## Alternatives considered
- **A seat in `conversation.content`.** Rejected: it made `ui-conversation` render the panel beside the width handles and outside the scrollport, have its width controls measure the gutter into a per-Session `ctx.uiConversation.layouts` source, and move the composer and viewport height variables from the scrollport to the content body so the seat could read them. The Conversation shell would carry geometry and variable placement for one feature, while chrome that must not scroll can sit sticky inside the scrollport as the turn rail does, and the Chat View already owns the column it would measure.
- **A right-sidebar tab.** It already exists for change requests, but it narrows the transcript while shown, shows one tab at a time, and the [UI guidance](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding) reserves the sidebar for content opened on demand rather than a resident summary.
- **The dock kit's floating window.** `FloatLayer` windows are draggable, resizable, and positioned in viewport coordinates; a summary anchored to the transcript gutter needs none of that and would have to fight the window's own placement rules.
- **Viewport-width breakpoints.** The transcript width is adaptive and draggable and the right sidebar takes a variable track, so a viewport breakpoint either covers the transcript or hides the panel with room to spare.
- **CSS-only hiding with a click-time read.** A container query on the gutter can hide the docked panel, and the toggle could read the computed result when pressed, as the background-job trigger does. The toggle would still render without knowing whether the panel shows, so `aria-expanded` and its tooltip would be wrong whenever the preference says dock but the gutter is too narrow.
- **Squeezing the transcript to make room.** Docking on laptop widths by moving the transcript column aside changes the centered column, the composer, and both width handles; it remains a separate layout decision.
- **A Session-scoped standard hook for the gutter.** Adding a hook to every Session-scoped Slot would make every component fixture in the client restate it; the docking decision has two readers, the panel and the toggle, and both read it from the plugin's own state.
## Consequences
- With the default transcript width, which stops at 880px, the body must be 1576px wide to dock, so laptop widths use the overlay; the panel never covers the transcript unless the user opens it.
- Sections from independent plugins share one surface, ordering, and title style without depending on each other, and an occupied section id can be replaced by a higher-priority registration.
- `ui-chat` gained one slot and one custom property on its layer and observes nothing for them. Each mounted panel adds one `ResizeObserver` on its dock probe, which calls back only when the docking decision flips. `ui-conversation` caps the default transcript width at 880px.
- The panel shows only in Chat Views; elsewhere the toggle stays in the header, unavailable. Every Chat View occurrence renders the aside, so a Session shown in the main body and in an embedded Conversation at once shows its overlay in both.
- The turn rail's position changed for every user; its behavior and hiding rule did not.
@@ -0,0 +1,49 @@
# Agent Note: 停靠在 Chat 视图末端留白的会话面板
Status: implemented
[English](2026-11-05-session-panel.md) | 中文
## Problem
与当前会话相关的信息(项目目录、它开出的变更请求,以及之后的产物)没有统一的位置。各自的拥有者分别加会话标题栏按钮,内容一多就再开一个右侧栏标签页,forge 的变更请求就是这样一个标签页。侧栏标签页显示时占用正文宽度,一次只显示一个,而且每条消息之外都要多点一次才能看到。需要的界面是:可以放在对话旁边常驻而不遮挡正文;多个插件各自填充;没有空间时自动隐藏;用户可以从会话标题栏显示或隐藏。
## Decision
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.zh.md) 新增一个会话标题栏开关(`conversation.session.header.utilities`,order −10)和一块悬浮面板,面板占用 `conversation.chat.aside`:这是 [`ui-chat`](../../../../packages/client/ui-chat/README.zh.md#scroll-ownership) 在 Chat 视图中、轮次轨道旁渲染的 slot。侧边层是 Chat 外框顶部的零高度图层,与轮次轨道一样在共享滚动容器内 sticky 定位:面板不随正文滚动,继承滚动容器的输入框区域与视口高度,也不需要 Conversation 外壳提供落位。Chat 以外的视图不显示面板。
### 停靠取决于正文留白
只有正文列到 Chat 外框末端边缘的留白放得下面板时才停靠(348px:与正文列及其宽度拖拽条保持 40px,最小宽度 300px,外加 8px 边距)。判断依据是留白而不是视口宽度,因为正文列宽度可自适应、可由用户拖拽,右侧栏也会占用框架宽度:同一个视口可能只剩 75px,也可能有 600px。Chat 视图持有外框和正文列,因此由它的侧边层把留白发布为自定义属性 `--dsh-chat-aside-gutter`,面板的样式表据此决定停靠宽度。
脚本仍然需要知道这个判断,因为停靠与浮层的差别不只在尺寸,还在行为:开关要如实报告 `aria-expanded`,也要知道按下后是切换停靠还是打开浮层;浮层在按 Esc 或在外部按下时关闭并归还焦点;面板可以停靠后,已打开的浮层要关闭。纯 CSS 的容器查询无法把这些告诉 Chat 视图之外的元素或事件监听器。因此样式表把判断也一并算出:每个已挂载的面板渲染一个零高度的停靠探针,它从放得下面板最小宽度的留白起宽 1px,更窄时宽度为 0,与停靠宽度出自同一组尺寸,插件只观察这个探针。这样插件只在判断翻转时收到通知;如果改为观察外框和正文列,流式回答的每一帧都会回调(正文列的高度随内容变化),窗口缩放的每一步也会回调。会话的任一探针有空间时该会话就可以停靠,没有探针的会话表示没有 Chat 视图在显示它。开关和面板用同一个纯函数决定呈现方式。没有 Chat 视图显示该会话时(例如在轨迹视图中),开关不可用,悬停提示请用户切到「对话」视图;`ui-conversation` 把视图选择留在其外壳内部,因此开关不自行切换视图。
停靠遵循所有会话共用的一个持久化偏好,默认开启。没有空间时,按下开关会为该会话在正文上方打开临时浮层;它从不改变偏好;该会话的留白可以停靠面板,或不再有 Chat 视图显示该会话时,浮层关闭,因此不会自己重新出现。面板状态跟随打开浮层的会话所上报的留白。面板卸载或其 Chat 视图换到另一个会话时撤回上报;撤回放在与留白更新分开的 layout effect 清理中,因此留白变化永远不会被当成卸载。自动隐藏加按需浮层,既保证正文不被遮挡,也让笔记本宽度下的信息依然可达。
### 分栏是注册项;面板绘制标题
每个分栏是一次 list 注册,带 `id`、`order` 和必填的 `label`。面板把实时注册投影成标题并逐个绘制,再用 `renderSlot(..., { only: id })` 渲染分栏正文;CSS `:has()` 规则隐藏正文没有渲染内容的分栏,因此分栏不渲染任何内容即可退出,不需要 effect 向拥有者上报可见性。标题尾部控件是以分栏 `id` 为键的 keyed slot;多个插件共用的分栏声明自己的行 slot,内置「环境」分栏就以 `conversation.session.panel.environment.row` 这样做。面板隐藏时也要可见的标记放进开关上的角标列表。
各贡献方的行通过面板的样式表共享同一外观,而不是共享组件:各贡献方自己写行的标记并标出各个部分,由面板统一排版,使不同包的图标、文字与尾部区域对齐。共享的行组件要把各贡献方的图标、文字和控件作为 React 节点从 props 传入,这是客户端规则禁止的;功能包之间也不能共享各自的行组件。
### 轮次轨道位于起始边
轮次轨道连同刻度、焦点环和预览位于滚动容器的起始边,末端留白留给停靠面板;它的 900px 隐藏规则保证旁边有足够空间容纳起始侧的宽度拖拽条。
## Alternatives considered
- **落位在 `conversation.content`。** 已否决:这种做法让 `ui-conversation` 在宽度拖拽条旁、滚动容器之外渲染面板,由宽度控件把留白测量结果写入按会话划分的 `ctx.uiConversation.layouts` source,并把输入框区域与视口高度变量从滚动容器挪到正文容器上,使落位能读到它们。Conversation 外壳因此要为单个功能承担几何测量和变量位置;而不随滚动的界面元素可以像轮次轨道那样在滚动容器内 sticky 定位,要测量的正文列也本来就归 Chat 视图所有。
- **右侧栏标签页。** 变更请求已有这种实现,但它显示时会压窄正文,一次只显示一个标签页,而且 [UI 指南](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding)把侧栏留给按需打开的内容,而不是常驻摘要。
- **dock kit 的悬浮窗。** `FloatLayer` 窗口可拖拽、可缩放、按视口坐标定位;锚定在正文留白的摘要用不上这些能力,还要对抗窗口自身的定位规则。
- **按视口宽度断点。** 正文宽度自适应、可拖拽,右侧栏占用可变宽度,视口断点要么遮挡正文,要么在空间充足时也隐藏面板。
- **纯 CSS 隐藏加点击时读取。** 对留白做容器查询可以隐藏停靠面板,开关在按下时读取计算结果,与后台任务按钮的做法相同。但开关渲染时仍不知道面板是否显示,偏好为停靠而留白不足时,`aria-expanded` 与提示文字都会出错。
- **挤压正文腾出空间。** 在笔记本宽度下把正文列移开来停靠,会改变居中的正文列、composer 和两侧宽度拖拽条;这仍是另一项布局决策。
- **会话作用域标准 hook。** 给每个会话作用域 Slot 增加一个留白 hook,会让客户端所有组件测试夹具都要补上它;停靠判断只有两个读取方,即面板和开关,两者都从插件自己的状态读取。
## Consequences
- 默认正文宽度最多 880px,此时对话区要 1576px 宽才能停靠,因此笔记本宽度使用浮层;除非用户主动打开,面板不会遮挡正文。
- 独立插件的分栏共享同一界面、排序和标题样式,彼此不依赖;已占用的分栏 id 可以被更高优先级的注册替换。
- `ui-chat` 多了一个 slot,侧边层多了一个自定义属性,但不为它们观察任何尺寸。每个已挂载的面板在停靠探针上多一个 `ResizeObserver`,只在停靠判断翻转时回调。`ui-conversation` 把默认正文宽度上限定为 880px。
- 面板只出现在 Chat 视图中;其他视图下开关仍在标题栏中,但不可用。每个 Chat 视图实例都会渲染侧边层,因此同一会话同时显示在主正文区和嵌入的对话中时,两处都会显示浮层。
- 轮次轨道的位置对所有用户都变了;行为和隐藏规则不变。
+2 -2
View File
@@ -12,8 +12,8 @@
en: cc03e6b75206661b
zh: 99e41f4143198352
/deepseek-ai-dsh/profiles:
en: 523477a093beb0c2
zh: f88ea21e5fbea969
en: 85171337ac2fb2ff
zh: 705a4eef97d9b519
/deepseek-ai-dsh/optional-overlays:
en: 3a40ddc44e55f79c
zh: 8d3949132e1ef93c
+1 -1
View File
@@ -34,7 +34,7 @@ dsh --help # the launcher's own help
<a id="profiles"></a>
## Profiles
A profile directory holds a `package.json` (out-of-tree plugin dependencies plus the profile manifest `dsh.profile` with its ordered `bundles` list) and a `cordis.patch.yml` (the user's own patch layer). `dsh-hmr`, when enabled in YAML, watches the profile manifest and both profile and home patch files, then recomposes all layers through one serialized reload. Without HMR, changes apply on restart. Edits arriving during watcher registration use the same nonfatal reload reporting as later edits. [Plugin Manager](../../packages/boot/plugin-manager/README.md) shares package operations and the profile write lock with `dsh plugin`; package updates retain disabled bundle selections. CLI package commands inherit authentication variables and terminal descriptors, including interactive build approval; service calls retain their scrubbed environment and captured diagnostics.
A profile directory holds a `package.json` (out-of-tree plugin dependencies plus the profile manifest `dsh.profile` with its ordered `bundles` list) and a `cordis.patch.yml` (the user's own patch layer). `dsh-hmr`, when enabled in YAML, watches the profile manifest, the profile and home patch files, and every `--patch` overlay file, then recomposes all layers through one serialized reload. Without HMR, changes apply on restart, except that a Config Editor save applies the current contents of every patch and overlay file. Edits arriving during watcher registration use the same nonfatal reload reporting as later edits. [Plugin Manager](../../packages/boot/plugin-manager/README.md) shares package operations and the profile write lock with `dsh plugin`; package updates retain disabled bundle selections. CLI package commands inherit authentication variables and terminal descriptors, including interactive build approval; service calls retain their scrubbed environment and captured diagnostics.
Installation and profile startup enforce the declared `engines.dsh` range, or DSH peer ranges when it is absent, against the same runtime version shown by `dsh --version`. Incompatible plugins require an explicitly acknowledged exact-version exemption. The [plugin manager's compatibility reference](../../packages/boot/plugin-manager/README.md#version-compatibility-and-exemptions) documents `version-exemptions`, `allow-version`, `revoke-version`, persistence, and risks.
+1 -1
View File
@@ -34,7 +34,7 @@ dsh --help # the launcher's own help
<a id="profiles"></a>
## Profile
profile 目录包含一个 `package.json`,其中记录树外插件依赖,以及 profile manifest(元数据清单)`dsh.profile`、其中按顺序排列的 `bundles` 列表;还包含一个 `cordis.patch.yml`,其中保存用户自己的 patch 层。在 YAML 中启用的 `dsh-hmr` 监视 profile manifest、profile 与 home 级 patch 文件,再通过统一串行重载重新组合所有层。未启用 HMR 时,更改在重启后生效。监听器注册期间发生的编辑与后续编辑使用相同的非致命重载错误报告。[插件管理器](../../packages/boot/plugin-manager/README.zh.md) 与 `dsh plugin` 共享包操作和 profile 写锁;更新依赖会保留已停用的组合包选择。CLI 包操作继承认证环境和终端描述符,支持交互式构建批准;service 调用保留清理后的环境并捕获诊断。
profile 目录包含一个 `package.json`,其中记录树外插件依赖,以及 profile manifest(元数据清单)`dsh.profile`、其中按顺序排列的 `bundles` 列表;还包含一个 `cordis.patch.yml`,其中保存用户自己的 patch 层。在 YAML 中启用的 `dsh-hmr` 监视 profile manifest、profile 与 home 级 patch 文件以及每个 `--patch` overlay 文件,再通过统一串行重载重新组合所有层。未启用 HMR 时,更改在重启后生效;例外是 Config Editor 保存时会应用所有 patch 与 overlay 文件的当前内容。监听器注册期间发生的编辑与后续编辑使用相同的非致命重载错误报告。[插件管理器](../../packages/boot/plugin-manager/README.zh.md) 与 `dsh plugin` 共享包操作和 profile 写锁;更新依赖会保留已停用的组合包选择。CLI 包操作继承认证环境和终端描述符,支持交互式构建批准;service 调用保留清理后的环境并捕获诊断。
安装和 profile 启动会按声明的 `engines.dsh` 范围(未声明时按 DSH peer 范围),检查与 `dsh --version` 显示值相同的运行时版本。不兼容插件需要用户明确确认精确版本豁免。[插件管理器的兼容性参考](../../packages/boot/plugin-manager/README.zh.md#version-compatibility-and-exemptions)说明 `version-exemptions`、`allow-version`、`revoke-version`、持久化规则与风险。
+2 -2
View File
@@ -21,8 +21,8 @@
en: 8d2cfff9bab7327f
zh: 21515ab6e6798504
/dsh-cli-behavior-reference/web-profile:
en: 149c5571acd51baf
zh: 300e3c2425273a92
en: afc6ddcd63f24664
zh: ed11d2ad6d7a9852
/dsh-cli-behavior-reference/shared-deployment-behavior:
en: f02219118dcec531
zh: fe2977628d7340da
+1 -1
View File
@@ -128,7 +128,7 @@ The production Web runner needs built package and frontend artifacts (`pnpm run
Process shutdown gives the plugin tree up to five seconds to dispose. The first `SIGINT`/`SIGTERM` starts that graceful drain — `SIGTERM` is a supervisor's ordinary stop request and exits 0 on every surface, `SIGINT` reports 130; a second signal forces immediate exit. If one-shot normal completion is already stuck in disposal, the first `Ctrl+C` is the escalation and exits immediately instead of being swallowed.
The base-backed modes treat the invoking directory as the default workspace root, load applicable `AGENTS.md` or `CLAUDE.md` instructions with a 65,536-byte render budget for each instruction chain, and use an in-memory SQLite session content index. The standalone `sdk-minimal` profile uses the invoking directory as its sandbox-policy root and includes `read_image`, but omits text filesystem tools, instruction discovery, and SQLite. An enabled HMR plugin watches both `cordis.patch.yml` layers (profile and home) and reapplies valid edits transactionally; without HMR, the process applies them once. A one-shot surface exits through its bounded shutdown, which disposes any live watchers.
The base-backed modes treat the invoking directory as the default workspace root, load applicable `AGENTS.md` or `CLAUDE.md` instructions with a 65,536-byte render budget for each instruction chain, and use an in-memory SQLite session content index. The standalone `sdk-minimal` profile uses the invoking directory as its sandbox-policy root and includes `read_image`, but omits text filesystem tools, instruction discovery, and SQLite. An enabled HMR plugin watches both `cordis.patch.yml` layers (profile and home) and every `--patch` overlay file, and reapplies valid edits transactionally; without HMR, the process applies them once. A one-shot surface exits through its bounded shutdown, which disposes any live watchers.
New sessions in base-backed profiles default to the `workspace-write` permission preset. Bash and filesystem mutations are restricted to the session workspace and platform temporary roots; reads and network access are not confined, while process visibility depends on the selected sandbox backend — bwrap runs commands in a private PID namespace that hides host processes, and Landlock and Seatbelt leave host process visibility unchanged. `DSH_PERMISSION_MODE` changes the process fallback. Stored General-settings permissions affect later Web sessions, not an already-open one. The standalone `sdk-minimal` tree instead pins `danger-full-access` and mounts no approval or permission-settings service.
+1 -1
View File
@@ -128,7 +128,7 @@ dsh web --help
进程关闭时,插件树最多有 5 秒完成 dispose。首次收到 `SIGINT` 或 `SIGTERM` 时会开始优雅排空:`SIGTERM` 是监督进程发出的常规停止请求,在所有运行模式下都以 0 退出;`SIGINT` 则报告 130。第二次收到信号时会立即强制退出。如果一次性运行在正常结束时已经卡在 dispose 阶段,第一次按下 `Ctrl+C` 就会直接升级为强制退出,而不会被忽略。
基于 base 的模式都将运行命令时所在的目录作为默认 workspace 根目录,以每条指令链 65,536 字节的渲染预算加载适用的 `AGENTS.md` 或 `CLAUDE.md` 指令,并使用内存 SQLite 会话内容索引。独立的 `sdk-minimal` profile 把运行命令时所在的目录作为沙箱策略根目录并包含 `read_image`,但省略文本文件系统工具、指令发现与 SQLite。启用的 HMR 插件会监视 profile 与 home 两个 `cordis.patch.yml` 配置层的有效变更,并以事务方式重新应用;未启用 HMR 时只应用一次。一次性运行模式通过有界关闭流程退出,该流程会 dispose 所有实时监视器。
基于 base 的模式都将运行命令时所在的目录作为默认 workspace 根目录,以每条指令链 65,536 字节的渲染预算加载适用的 `AGENTS.md` 或 `CLAUDE.md` 指令,并使用内存 SQLite 会话内容索引。独立的 `sdk-minimal` profile 把运行命令时所在的目录作为沙箱策略根目录并包含 `read_image`,但省略文本文件系统工具、指令发现与 SQLite。启用的 HMR 插件会监视 profile 与 home 两个 `cordis.patch.yml` 配置层以及每个 `--patch` overlay 文件的有效变更,并以事务方式重新应用;未启用 HMR 时只应用一次。一次性运行模式通过有界关闭流程退出,该流程会 dispose 所有实时监视器。
基于 base 的 profile 中,新会话默认使用 `workspace-write` 权限预设。Bash 和文件系统修改仅限于会话 workspace 与平台临时根目录;读取和网络访问不受限制,进程可见性则取决于所选沙箱后端——bwrap 在私有 PID 命名空间中运行命令并隐藏宿主进程,Landlock 与 Seatbelt 保持宿主进程可见性不变。`DSH_PERMISSION_MODE` 更改进程后备值。General settings 中存储的权限影响后续 Web 会话,不改变已打开的会话。独立的 `sdk-minimal` 配置树则固定为 `danger-full-access`,且不挂载 approval 或权限 settings 服务。
+4 -7
View File
@@ -14,14 +14,12 @@ import { existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync }
import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { FiberState, type Context } from '@deepseek-ai/cordis'
import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include'
import {
boot,
readProfilePatches,
createRuntimeResolution,
initProfile,
installFailLoud,
loadOverlayPatches,
loadProfile,
reportSkippedBundles,
PluginPackages,
@@ -204,8 +202,8 @@ interface ComposedProfile {
profile: Profile
/** Immutable runtime resolution computed before any plugin imports. */
resolution: RuntimeResolution
/** Command-line overlay contents, frozen for this invocation. */
overlays: PatchOptions[]
/** Absolute command-line overlay files, in argv order. */
overlayPaths: string[]
}
/**
@@ -231,8 +229,7 @@ async function composeProfile(
if (resolvedProfile !== undefined) writeFileSync(join(profile.dir, PROFILE_ROOT_FILENAME), PROFILE_ROOT_CONFIG)
const resolutionOptions = { installAnchor: resolvedProfile?.installAnchor ?? INSTALL_ANCHOR, profile }
const resolution = await createRuntimeResolution(resolutionOptions)
const overlays = patchFiles.flatMap(file => loadOverlayPatches(NAME, resolve(file)))
return { profile, resolution, overlays }
return { profile, resolution, overlayPaths: patchFiles.map(file => resolve(file)) }
}
/** An application-owned profile and its independent installation fallback. */
@@ -331,7 +328,7 @@ export async function runProfile(options: RunProfileOptions): Promise<{ ctx: Con
installAnchor: options.resolvedProfile?.installAnchor ?? INSTALL_ANCHOR,
startedBundles: composed.profile.layers.map(layer => layer.packageName),
cwd: process.cwd(), home: resolveDshHome(),
overlays: composed.overlays, telemetryDisabledEnv: process.env.DSH_TELEMETRY_DISABLED,
overlayPaths: composed.overlayPaths, telemetryDisabledEnv: process.env.DSH_TELEMETRY_DISABLED,
}
const ctx = await boot(NAME, rootConfig, readProfilePatches(NAME, profileContext, composed.profile), async (hostCtx) => {
app.current = hostCtx
+1 -3
View File
@@ -143,9 +143,7 @@ function createProfileLifecycleFixture(): ProfileLifecycleFixture {
writeFileSync(join(profileDir, 'cordis.patch.yml'), '[]\n')
const linkTarget = join(profileDir, 'node_modules', 'dsh-lifecycle-bundle')
mkdirSync(join(profileDir, 'node_modules'), { recursive: true })
try {
rmSync(linkTarget, { recursive: true, force: true })
} catch { /* fresh dir */ }
rmSync(linkTarget, { recursive: true, force: true })
// Copy-free: a package.json redirecting via a relative main is enough for require.resolve.
mkdirSync(linkTarget, { recursive: true })
for (const file of ['package.json', 'cordis.patch.yml', 'plugin.mjs']) {
@@ -95,7 +95,7 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
const profile = app.loadProfileDirectory('bundle-test', directory, installAnchor)
const profileContext: ProfileContext = {
name: 'web', dir: directory, patchPath: profile.patchPath, installAnchor, cwd: workspace, home,
startedBundles: profile.layers.map(layer => layer.packageName), overlays: [], telemetryDisabledEnv: '1',
startedBundles: profile.layers.map(layer => layer.packageName), overlayPaths: [], telemetryDisabledEnv: '1',
}
const resolution = await app.createRuntimeResolution({ installAnchor, home, profile })
const listeners = new Set<() => void>()
@@ -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. 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, 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.",
"inputSchema": {
"type": "object",
"properties": {
@@ -1,5 +1,5 @@
import { executeModelToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
import { executeToolFixture, executeModelToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import { mkdtemp, mkdir, readFile, realpath, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it, onTestFinished, vi } from 'vitest'
@@ -152,6 +152,50 @@ async function backgroundPtcModeHarness(cwd: string): Promise<Context> {
}
describe('PTC mode typed values: keyless real-process contracts', () => {
it('returns formatted read content from inspect through the real outer run_code result', async () => {
workdir = await realpath(await mkdtemp(join(tmpdir(), 'dsh-ptc-inspect-read-')))
const path = join(workdir, 'a.txt')
await writeFile(path, 'alpha\nbeta\n')
ctx = await typedPtcModeHarness()
await ctx.plugin(ToolFs)
const formatted = `<path>${path}</path>\n<type>file</type>\n<content>\n1: alpha\n2: beta\n\n(End of file - total 2 lines)\n</content>`
const native = await executeToolFixture(ctx, {
callId: brandString<ToolCallId>('inspect-read-reference'), name: 'read',
arguments: { file_path: path }, signal: testToolSignal,
})
expect(native.isError).toBe(false)
expect(native.content).toEqual([{ type: 'text', text: formatted }])
const result = await runCode(ctx, `inspect(await tools.read({ file_path: ${JSON.stringify(path)} }));`)
expect(result.isError).toBe(false)
expect(result.content).toEqual([{ type: 'text', text: formatted + '\n' }])
expect(result.value).toEqual({
logs: [formatted + '\n'], sandbox: { mode: 'danger-full-access', denied: false },
})
})
it.each(['renderer', 'policy'])('keeps an empty %s output silent while preserving program data', async (source) => {
ctx = await typedPtcModeHarness()
ctx.tools.register(defineTool({
name: 'silent_result', description: 'Return data without display text.', parameters: {},
output: {
schema: { type: 'object', properties: { answer: { type: 'number', required: true } }, additionalProperties: false },
render: () => source === 'renderer' ? [] : [{ type: 'text', text: 'original rendering' }],
},
execute: async () => ({ answer: 42 }),
...source === 'policy' ? { finalizeContent: () => [] } : {},
}))
const result = await runCode(ctx, `
const value = await tools.silent_result({});
if (value.answer !== 42) throw new Error('program data changed');
inspect(value);
`)
expect(result.isError).toBe(false)
expect(result.content).toEqual([{ type: 'text', text: '(run_code completed with no output)' }])
expect(result.value).toEqual({ logs: [], sandbox: { mode: 'danger-full-access', denied: false } })
})
it('crosses a large intermediate value intact and exposes only typed tool failure fields', async () => {
ctx = await typedPtcModeHarness()
ctx.tools.register(defineTool({
@@ -305,15 +349,15 @@ describe('PTC mode typed values: keyless real-process contracts', () => {
} as Agent
const value = completion(await runCode(ctx, `
const listed = await tools.cordis_inspect_list({});
const listed = await tools.cordis_inspect({});
const provider = listed.providers.find(item => item.id === 'Tool');
const inspected = await tools.cordis_inspect_query({
const inspected = await tools.cordis_inspect({ query: {
platform: provider.platform, provider: provider.id, method: provider.methods[0].name,
});
} });
inspect(JSON.stringify({ provider: provider.id, names: inspected.data.tools.map(tool => tool.name) }));
`, testToolSignal, agent))
expect(value).toEqual({ provider: 'Tool', names: ['cordis_inspect_list', 'cordis_inspect_query'] })
expect(value).toEqual({ provider: 'Tool', names: ['cordis_inspect'] })
})
})
@@ -2,7 +2,7 @@
* Keyless comparison of actual SDK and Desktop/Web step-admitted tool sets.
* Keep intentional differences in tool-parity.ts; unused exceptions fail.
* Team mode is excluded while its known composition mismatch is tracked in #7172.
* SDK minimal, Creator-only tools, graphical context and optional runtime payloads
* SDK minimal, other presets, graphical context and optional runtime payloads
* are outside this fixed standard/PTC, top-level-session comparison.
*/
import { createServer } from 'node:http'
+6 -2
View File
@@ -9,8 +9,12 @@ interface Exception {
/** Intentional product differences; obsolete entries fail alongside undeclared differences. */
export const toolParityExceptions: Record<ToolMode, readonly Exception[]> = {
standard: [{ tool: 'list_subagent_models', side: 'desktop',
reason: 'Desktop enables subagent model discovery; SDK delegation inherits the caller model by default.' }],
standard: [
{ tool: 'list_subagent_models', side: 'desktop',
reason: 'Desktop enables subagent model discovery; SDK delegation inherits the caller model by default.' },
{ tool: 'cordis_inspect', side: 'desktop',
reason: 'Web exposes inspection of its Host and connected Client runtime; the SDK profile does not compose the Cordis inspection providers.' },
],
ptc: [
{ tool: 'list_subagent_models', side: 'desktop',
reason: 'Desktop enables subagent model discovery; SDK delegation inherits the caller model by default.' },
+5 -3
View File
@@ -2,7 +2,7 @@
import { lstatSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
import { createRequire } from 'node:module'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { join, relative } from 'node:path'
import { Context } from '@deepseek-ai/cordis'
import { createLaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment'
import {
@@ -139,7 +139,7 @@ describe('runProfile with an application-owned profile', () => {
try {
const { shutdown } = await runProfile({
environment, profile: 'desktop', resolvedProfile: runtime,
patchFiles: [overlay], args: ['--port', '0', '--no-open'],
patchFiles: [relative(process.cwd(), overlay)], args: ['--port', '0', '--no-open'],
})
expect(installProxyFromEnvironment).toHaveBeenCalledWith(environment, expect.any(Function))
const resolution = vi.mocked(createRuntimeResolution).mock.settledResults
@@ -165,7 +165,9 @@ describe('runProfile with an application-owned profile', () => {
])
expect(rows.find(row => row.id === 'target')?.config).toEqual({ overlay: true, priority: 'overlay' })
expect(rows.find(row => row.id === 'session-telemetry-otel')?.disabled).toBe(true)
expect(ctx.profileContext).toMatchObject({ dir: home, patchPath: profilePatch, installAnchor: runtime.installAnchor })
expect(ctx.profileContext).toMatchObject({
dir: home, patchPath: profilePatch, installAnchor: runtime.installAnchor, overlayPaths: [overlay],
})
await shutdown.shutdown(0)
expect(dispose).toHaveBeenCalledOnce()
expect(disposeProxy).toHaveBeenCalledOnce()
+25 -14
View File
@@ -221,7 +221,7 @@ async function bootWeb(
bootCtx.provide('profileContext', { name: surface, dir: profileDir, patchPath: profile.patchPath,
installAnchor: INSTALL_ANCHOR, home, cwd: home,
startedBundles: profileBundles ?? ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app'],
overlays: [], telemetryDisabledEnv: '1' })
overlayPaths: [], telemetryDisabledEnv: '1' })
await bootCtx.plugin(PluginPackages, { resolution })
bootCtx.provide('connection', {
fetch: { register: () => () => {} },
@@ -351,7 +351,7 @@ describe('the shipped Web composition', () => {
// excluded for the reason the TUI composition e2e excludes them — they
// depend on ripgrep being present on the machine.
expect(toolNames(ctx, handle.agent).filter(name => name !== 'glob' && name !== 'grep')).toEqual([
'ask_user_question', 'bash', 'create_goal', 'edit', 'exit_plan_mode',
'ask_user_question', 'bash', 'cordis_inspect', 'create_goal', 'edit', 'exit_plan_mode',
'get_goal', 'job_kill', 'job_list', 'job_output', 'list_agents', 'list_subagent_models', 'office_convert', 'office_recalculate', 'office_render', 'plugin_manager', 'present', 'read', 'read_image',
'schedule_create', 'schedule_edit', 'schedule_list', 'schedule_view',
'send_message', 'skill',
@@ -359,6 +359,18 @@ describe('the shipped Web composition', () => {
'workflow', 'working_directory', 'write',
])
expect(ctx.commands.find(handle.agent, 'goal')).toBeDefined()
for (const query of [undefined, { platform: 'host', provider: 'Config', method: 'listConfigs', input: { name: '@deepseek-ai/dsh-agent-loop' } }] as const) {
const inspected = await executeToolFixture(ctx, {
agent: handle.agent, callId: brandString<ToolCallId>(`standard-inspect-${query === undefined ? 'list' : 'query'}`), name: 'cordis_inspect',
arguments: query === undefined ? {} : { query }, signal: new AbortController().signal,
})
expect(inspected.isError).toBe(false)
const text = inspected.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('')
const value: unknown = JSON.parse(text)
const path = query === undefined ? 'providers' : 'data.entries'
const entry = query === undefined ? { platform: 'host', id: 'Config' } : { name: '@deepseek-ai/dsh-agent-loop' }
expect(value).toHaveProperty(path, expect.arrayContaining([expect.objectContaining(entry)]))
}
} finally {
await handle.dispose()
}
@@ -603,7 +615,7 @@ describe('the shipped Web composition', () => {
try {
const tools = toolNames(ctx, handle.agent)
expect(tools).toEqual(expect.arrayContaining([
'cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager',
'cordis_inspect', 'plugin_manager',
]))
for (const removed of ['cordis_define', 'cordis_run', 'cordis_stop', 'cordis_undefine', 'cordis_inspect_self']) {
expect(tools).not.toContain(removed)
@@ -985,8 +997,7 @@ describe('the standard preset documentation skill', () => {
expect((await testCtx.skills.get('dsh-doc', { cwd: root, scope: creator.agent }))?.path).toBe(definition.path)
const schemas = testCtx.tools.schemas(standardAgent.agent)
expect(schemas).toEqual(testCtx.tools.schemas(baseline.agent))
expect(schemas.map(tool => tool.name)).not.toContain('cordis_inspect_list')
expect(schemas.map(tool => tool.name)).not.toContain('cordis_inspect_query')
expect(schemas.map(tool => tool.name)).toContain('cordis_inspect')
for (const handle of [baseline, standardAgent]) {
handle.agent.followup(createUserMessage({ content: [{ type: 'text', text: 'Reply ready.' }], source: { kind: 'user' } }))
await handle.agent.whenIdle()
@@ -1116,13 +1127,13 @@ describe('a user preset declared from the shipped cordis rows', () => {
try {
for (const handle of [shipped, copied]) {
expect(toolNames(copyCtx, handle.agent)).toEqual(expect.arrayContaining([
'cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager',
'cordis_inspect', 'plugin_manager',
]))
}
const signal = new AbortController().signal
const listed = await executeToolFixture(copyCtx, {
callId: brandString<ToolCallId>('copied-preset-inspect-list'),
name: 'cordis_inspect_list',
name: 'cordis_inspect',
arguments: {},
signal,
agent: copied.agent,
@@ -1139,15 +1150,15 @@ describe('a user preset declared from the shipped cordis rows', () => {
onTestFinished(() => { spills.mockRestore() })
const queried = await executeToolFixture(copyCtx, {
callId: brandString<ToolCallId>('copied-preset-inspect-tools'),
name: 'cordis_inspect_query',
arguments: { platform: 'host', provider: 'Tool', method: 'listTools' },
name: 'cordis_inspect',
arguments: { query: { platform: 'host', provider: 'Tool', method: 'listTools' } },
signal,
agent: copied.agent,
})
expect(queried.isError).toBe(false)
// The tool catalog may exceed the inline budget; assert its complete stored text.
const queriedText = spills.mock.calls.at(-1)?.[0].content ?? resultText(queried)
for (const toolName of ['bash', 'cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager']) {
for (const toolName of ['bash', 'cordis_inspect', 'plugin_manager']) {
expect(queriedText).toContain(`"name": "${toolName}"`)
}
@@ -1158,8 +1169,8 @@ describe('a user preset declared from the shipped cordis rows', () => {
const listConfigs = async (input: Record<string, string | number>, callId: string): Promise<ConfigPage['data']> => {
const page = await executeToolFixture(copyCtx, {
callId: brandString<ToolCallId>(callId),
name: 'cordis_inspect_query',
arguments: { platform: 'host', provider: 'Config', method: 'listConfigs', input },
name: 'cordis_inspect',
arguments: { query: { platform: 'host', provider: 'Config', method: 'listConfigs', input } },
signal,
agent: copied.agent,
})
@@ -1177,8 +1188,8 @@ describe('a user preset declared from the shipped cordis rows', () => {
expect(firstPage.nextOffset).toBe(5)
const projected = await executeToolFixture(copyCtx, {
callId: brandString<ToolCallId>('copied-preset-inspect-config'),
name: 'cordis_inspect_query',
arguments: { platform: 'host', provider: 'Config', method: 'listConfigs', input: { entry: toolsRow!.id } },
name: 'cordis_inspect',
arguments: { query: { platform: 'host', provider: 'Config', method: 'listConfigs', input: { entry: toolsRow!.id } } },
signal,
agent: copied.agent,
})
+4 -3
View File
@@ -142,14 +142,15 @@ export function Welcome({ api }: { api: WelcomeApi }) {
if (cancelling || attemptRef.current === null) return
setCancelling(true)
const current = ++revision.current
let state: AccountView | undefined
try {
const state = await api.cancelSignIn(attemptRef.current.id)
if (mounted.current && revision.current === current) showAccount(state)
} catch {
state = await api.cancelSignIn(attemptRef.current.id)
} catch (_cancelFailed) {
// The current attempt remains visible so cancellation can be retried.
} finally {
if (mounted.current) setCancelling(false)
}
if (state !== undefined && mounted.current && revision.current === current) showAccount(state)
}
async function copyLink() {
const current = attemptRef.current
+9 -8
View File
@@ -15,17 +15,18 @@ if (process.isMainFrame && location.origin === allowedOrigin) {
try { listener(value) } catch (error) { console.error('Platform locale listener failed', error) }
}
})
let value: unknown
try {
const value: unknown = ipcRenderer.sendSync(PLATFORM_IPC.bootstrap)
if (typeof value === 'object' && value !== null && 'token' in value && 'origin' in value
&& typeof value.token === 'string' && value.token.length > 0 && value.origin === location.origin
&& 'locale' in value && (value.locale === 'en_US' || value.locale === 'zh_CN')) {
token = value.token
locale = value.locale
}
} catch {
value = ipcRenderer.sendSync(PLATFORM_IPC.bootstrap)
} catch (_bootstrapFailed) {
// Initialization failure retains embedded mode so Platform cannot use browser credentials.
}
if (typeof value === 'object' && value !== null && 'token' in value && 'origin' in value
&& typeof value.token === 'string' && value.token.length > 0 && value.origin === location.origin
&& 'locale' in value && (value.locale === 'en_US' || value.locale === 'zh_CN')) {
token = value.token
locale = value.locale
}
contextBridge.exposeInMainWorld('dsh', {
protocolVersion: 1,
displayMode: 'embedded',
@@ -43,6 +43,16 @@ describe('web e2e: preset roster guidance', () => {
it('reads mode details and examples without changing the new-task default', async () => {
onTestFailed(() => saveFailureShot(page, 'preset-roster-guide'))
const settings = page.getByRole('dialog', { name: '设置' })
for (const name of ['标准模式', '创造模式']) {
const sharedTrigger = settings.getByRole('button', { name: `模式说明: ${name}`, exact: true })
await sharedTrigger.click()
const sharedGuide = page.getByRole('dialog', { name, exact: true })
await sharedGuide.getByText(/只读运行时检查/).waitFor()
expect(await sharedGuide.innerText()).not.toContain('增加了运行时检查')
if (name === '创造模式') expect(await sharedGuide.innerText()).toContain('创造模式专注于定制 DSH')
await page.keyboard.press('Escape')
await sharedGuide.waitFor({ state: 'detached' })
}
const trigger = settings.getByRole('button', { name: '模式说明: PTC 模式', exact: true })
await trigger.click()
const guide = page.getByRole('dialog', { name: 'PTC 模式', exact: true })
+1 -1
View File
@@ -486,7 +486,7 @@ it.each([false, true])('starts Creator from Plugins with Coding Tools=%s without
expect(scaffold.ctx.sessionProjections.checkpoint(creator.session).agentPreset?.val).toBe('cordis')
expect(scaffold.ctx.agentPresets.composedPreset(creator.ctx)).toBe('cordis')
expect(scaffold.ctx.tools.schemas(creator).map(tool => tool.name))
.toEqual(expect.arrayContaining(['cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager']))
.toEqual(expect.arrayContaining(['cordis_inspect', 'plugin_manager']))
// The Session starts under Creator; a chip selection after the list updates records no switch.
expect(creator.session.snapshotEvents().filter(event => event.type === 'agent-preset/selected')).toEqual([])
expect(creator.session.snapshotEvents().some(event => event.type === 'user/message' || event.type === 'turn/start')).toBe(false)
+3 -3
View File
@@ -264,8 +264,8 @@ async function withScrollWorld(
runFailure = error
try {
await saveFailureShot(world.page, options.failureShot)
} catch {
// Best-effort evidence must never prevent cleanup of the owned world.
} catch (_failureShotFailed) {
// A missing screenshot loses evidence only; cleanup of the owned world and the rethrown run failure still follow.
}
}
let cleanupFailure: unknown
@@ -1305,7 +1305,7 @@ describe('web e2e: long Chat scroll contract', () => {
const top = viewport.top + element.clientTop
return Math.max(
Math.abs((railBox.top + railBox.bottom) / 2 - (top + composerBox.top) / 2),
Math.abs(viewport.left + element.clientLeft + element.clientWidth - railBox.right - 12),
Math.abs(railBox.left - viewport.left - element.clientLeft - 12),
Math.abs(composerBox.top - buttonBox.bottom - 16),
)
}), { timeout: 10_000 }).toBeLessThanOrEqual(GEOMETRY_TOLERANCE)
@@ -1,5 +1,6 @@
- navigation "Session hierarchy": Seeded turn
- text: Minimal mode
- button "1 subagent"
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Clickable links gallery
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Use only Cordis tools. First
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -11,6 +11,7 @@
- banner:
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -11,6 +11,7 @@
- banner:
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": workspace
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": CJK strong emphasis
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Markdown image policy
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Inline code links
- button "Session panel"
- button "More actions"
- tablist:
- tab "Chat" [selected]
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Math rendering
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Reference order target
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -0,0 +1,17 @@
- region "Recommended":
- heading "Recommended" [level=2]
- 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 "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:
- button "Plugin compatibility check": Plugin compatibility check When a new DSH version ships, check whether installed and self-made plugins need changes. Daily at {{clock}}
- listitem:
- button "Topic and paper tracking": Topic and paper tracking Search for news and new arXiv papers on chosen topics and list the key points. Daily at 9:00
- listitem:
- button "Branch and worktree cleanup": Branch and worktree cleanup List local branches and worktrees whose pull requests merged or closed, and delete them after confirmation. Fridays at {{clock}}
- listitem:
- button "Weather and travel": Weather and travel Weather for today and the next three days, with a note when an umbrella or warmer clothes are needed. Daily at 7:30
- listitem:
- button "Weekly workout plan": Weekly workout plan Plan next week's workouts around your goals and training days. Sundays at {{clock}}
@@ -0,0 +1,17 @@
- region "推荐":
- heading "推荐" [level=2]
- list:
- listitem:
- button "每日简报": 每日简报 汇总工作区最近的变化和待跟进的事,列出今天先做什么。 工作日 9:00
- listitem:
- button "Issue 扫描": Issue 扫描 把新开的 issue 分成 bug、需求、提问,标出重复的和需要回复的。 工作日 {{clock}}
- listitem:
- button "插件兼容检查": 插件兼容检查 DSH 出新版本时,检查已装的插件和自己做的插件要不要改。 每天 {{clock}}
- listitem:
- button "主题和论文追踪": 主题和论文追踪 搜索关注主题的新消息和 arXiv 新论文,各列几条要点。 每天 9:00
- listitem:
- button "分支和 worktree 清理": 分支和 worktree 清理 列出 PR 已合并或关闭的本地分支和 worktree,确认后再删。 周五 {{clock}}
- listitem:
- button "天气和出行": 天气和出行 今天和接下来三天的天气,要带伞或加衣时提一句。 每天 7:30
- listitem:
- button "一周运动计划": 一周运动计划 按目标和每周能练的日子排好下周的运动计划。 周日 {{clock}}
@@ -2,6 +2,7 @@
- navigation "Session hierarchy": Delegate a background job.
- button "1 subagent"
- button "1 background job"
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": {{workspace}}
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
+4 -2
View File
@@ -2022,9 +2022,11 @@ it.skipIf(MODE === 'record')('reviews a change request by layer, hides test file
const lens = view.getByRole('radiogroup', { name: '分层透镜', exact: true })
const tree = view.getByRole('navigation')
await expect.poll(() => lens.getByRole('radio').allTextContents()).toEqual(['全部6', '接口1', '实现2', '测试3'])
// The lens spans the file tree with the filter field's insets, and its divider continues the tree's border.
// The lens spans the file tree with the filter field's insets, and its divider continues the tree's border. The radio group
// sits in the element that measures it, inside the toolbar cell above the tree.
const [lensBox, fieldBox, cellBox, treeBox] = await Promise.all([
lens.boundingBox(), tree.locator('input').locator('xpath=..').boundingBox(), lens.locator('xpath=..').boundingBox(), tree.locator('xpath=..').boundingBox(),
lens.boundingBox(), tree.locator('input').locator('xpath=..').boundingBox(), lens.locator('xpath=../..').boundingBox(),
tree.locator('xpath=..').boundingBox(),
])
if (lensBox === null || fieldBox === null || cellBox === null || treeBox === null) throw new Error('Lens and tree must be visible')
expect([lensBox.x, lensBox.x + lensBox.width]).toEqual([fieldBox.x, fieldBox.x + fieldBox.width])
+10 -5
View File
@@ -450,10 +450,11 @@ export interface LaunchOptions {
harnessHome?: string
}
/** Dispose the booted tree and remove both owned temp roots, reporting every independent cleanup failure. */
async function cleanupScaffoldWorld(ctx: Context, workspaceCwd: string, persistenceRoot: string): Promise<unknown[]> {
/** Dispose the booted tree and remove the owned temp roots and overlay file, reporting every independent cleanup failure. */
async function cleanupScaffoldWorld(ctx: Context, workspaceCwd: string, persistenceRoot: string, overlayPath: string): Promise<unknown[]> {
const failures: unknown[] = []
await Promise.resolve(ctx.fiber.dispose()).catch((error: unknown) => failures.push(error))
await rm(overlayPath, { force: true }).catch((error: unknown) => failures.push(error))
await rm(workspaceCwd, { recursive: true, force: true }).catch((error: unknown) => failures.push(error))
await rm(persistenceRoot, { recursive: true, force: true }).catch((error: unknown) => failures.push(error))
return failures
@@ -526,6 +527,8 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
// paths at load, and an in-process boot must NEVER touch the developer's
// real ~/.dsh document or credential file.
const harnessHome = options.harnessHome ?? join(workspaceCwd, '.dsh-home')
// Scaffolds sharing a harness home each watch their own process overlay file.
const overlayPath = join(harnessHome, 'profiles', 'scaffold', `${basename(workspaceCwd)}.overlay.patch.yml`)
// Skill discovery is model-visible input, and its roots now resolve inside a
// PRESET — a subtree this lane's include patches cannot reach, because the
// roster mounts it directly per session rather than as a row of the booted
@@ -811,6 +814,8 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
bundles.push(SCAFFOLD_DEFAULTS_BUNDLE)
dependencies[SCAFFOLD_DEFAULTS_BUNDLE] = `file:${fixtureDir}`
initProfile(profileDir, bundles)
// Process-specific rows load like a `--patch` file, so profile reads see the launcher's overlay layer.
await writeFile(overlayPath, stringifyEntryYaml(processOverlays))
const manifest = readProfileManifest('dsh', profileDir)
manifest.dependencies = dependencies
await writeFile(join(profileDir, 'package.json'), JSON.stringify(manifest, null, 2) + '\n')
@@ -819,7 +824,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
...options.profile?.packageManager === undefined ? {} : { packageManager: options.profile.packageManager },
cwd: workspaceCwd, home: harnessHome,
startedBundles: loadProfileDirectory('dsh', profileDir, INSTALL_ANCHOR).layers.map(layer => layer.packageName),
overlays: processOverlays, telemetryDisabledEnv: undefined,
overlayPaths: [overlayPath], telemetryDisabledEnv: undefined,
}
// HMR gates file-driven reloads on application readiness, which the
// launcher commits after boot; this direct harness is ready at once.
@@ -975,7 +980,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
}
} catch (error) {
if (process.cwd() !== originalCwd) process.chdir(originalCwd)
const cleanupFailures = await cleanupScaffoldWorld(ctx, workspaceCwd, persistenceRoot)
const cleanupFailures = await cleanupScaffoldWorld(ctx, workspaceCwd, persistenceRoot, overlayPath)
if (publicProxy !== undefined) {
await publicProxy.close().catch((closeError: unknown) => cleanupFailures.push(closeError))
}
@@ -1051,7 +1056,7 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
}
try {
stopObservingSessions()
failures.push(...await cleanupScaffoldWorld(ctx, workspaceCwd, persistenceRoot))
failures.push(...await cleanupScaffoldWorld(ctx, workspaceCwd, persistenceRoot, overlayPath))
if (publicProxy !== undefined) {
try {
await publicProxy.close()
+3 -1
View File
@@ -845,12 +845,14 @@ describe.skipIf(MODE === 'record')('web e2e: active Schedule catalog', () => {
it('manages cross-Session tasks from the sidebar without activating their Sessions', async () => {
const otherSessionId = brandString<SessionId>('schedule-manager-other-session')
await seedSession(scaffold, await readFile(CATALOG_FIXTURE, 'utf8'), otherSessionId, 'standard')
const other = await scaffold.ctx.schedule.create({ prompt: 'Inspect the second workspace deployment', title: 'Second workspace deployment', timing: { kind: 'at', at: '2099-08-25T12:08:00.000Z' }, target: { kind: 'session', sessionId: otherSessionId } }, otherSessionId)
const other = await scaffold.ctx.schedule.create({ prompt: 'Inspect the second workspace deployment', title: 'Second workspace deployment', timing: { kind: 'at', at: '2099-08-25T12:08:00.000Z' }, target: { kind: 'session', sessionId: otherSessionId } }, CATALOG_SESSION_ID)
await page.getByRole('button', { name: 'Automation tasks', exact: true }).click()
const manager = page.getByTestId('task-manager-page')
await manager.getByRole('heading', { name: 'Automation tasks', exact: true }).waitFor()
const tasks = manager.getByRole('list', { name: 'Task catalog' })
await expect.poll(() => tasks.getByRole('listitem').count()).toBe(4)
const creatorMark = page.locator(`[data-row-key="session:${CATALOG_SESSION_ID}"] [data-session-schedule-mark]`)
await expect.poll(() => creatorMark.textContent()).toBe('3 automation tasks')
expect(scaffold.ctx.agents.get(CATALOG_SESSION_ID)).toBeUndefined()
expect(scaffold.ctx.agents.get(otherSessionId)).toBeUndefined()
+94 -3
View File
@@ -1,9 +1,10 @@
/** Schedule creation, prompt prefill, and editing through the shipped Web composition. */
import { chromium } from 'playwright'
import { fileURLToPath } from 'node:url'
import { chromium, type Locator } from 'playwright'
import { expect, it } from 'vitest'
import type { ScheduleTiming } from '@deepseek-ai/dsh-schedule/client'
import { launchWebScaffold, watchConsole } from './scaffold.ts'
import { writeComposerDraft } from './support.ts'
import { captureStableAria, compareOrRefreshGolden, launchWebScaffold, watchConsole, webSnapshotMode } from './scaffold.ts'
import { revealNavigationDrawer, writeComposerDraft } from './support.ts'
it.each([
{ locale: 'en', panel: 'Automation tasks', create: 'New', menu: 'Choose a creation method', chat: 'Create in a session',
@@ -48,6 +49,96 @@ it.each([
}
})
it.each([
{ locale: 'en', panel: 'Automation tasks', heading: 'Recommended', title: 'Daily brief',
prompt: 'Create an automation task named "Daily brief": every weekday at 9:00, review the last 24 hours of changes in the current workspace and list what needs my follow-up and what to do first today; when the workspace is a code repository, also cover new commits, pull requests awaiting my review, and failing CI.' },
{ locale: 'zh', panel: '自动化任务', heading: '推荐', title: '每日简报',
prompt: '创建一个名为「每日简报」的自动化任务:每个工作日 9:00 查看当前工作区过去 24 小时的变化,列出需要我跟进的事和今天先做的事;工作区是代码仓库时,也看新提交、待我评审的 PR 和失败的 CI。' },
])('prefills a recommended task request from the empty task page in $locale', async (copy) => {
const scaffold = await launchWebScaffold({ firstUse: true })
let browser: Awaited<ReturnType<typeof chromium.launch>> | undefined
try {
browser = await chromium.launch()
const page = await browser.newPage({ viewport: { width: 1440, height: 960 }, locale: copy.locale })
await page.addInitScript((locale) => { localStorage.setItem('dsh.locale', locale) }, copy.locale)
const tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
const input = page.locator('[data-composer-input][contenteditable="true"]').first()
for (const draft of ['', 'Existing unsent draft']) {
await writeComposerDraft(page, input, draft)
await page.getByRole('button', { name: copy.panel, exact: true }).click()
const manager = page.getByTestId('task-manager-page')
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)
if (draft === '') {
expect(await recommendationColumns(recommendations)).toBe(2)
await compareOrRefreshGolden(
fileURLToPath(new URL(`./expected/schedule-recommendations-${copy.locale}.expected.md`, import.meta.url)),
await captureStableAria(page, '[data-testid="schedule-recommendations"]', scaffold.workspaceCwd),
webSnapshotMode(),
)
}
await recommendation.click()
await manager.waitFor({ state: 'detached' })
await input.getByText(copy.prompt, { exact: true }).waitFor()
expect(await input.evaluate(element => [...element.children].map(paragraph => paragraph.textContent).join('\n')))
.toBe(draft === '' ? copy.prompt : `${draft}\n${copy.prompt}`)
const events = scaffold.ctx.agents.list().flatMap(agent => agent.session.snapshotEvents())
expect(events.filter(event => event.type === 'user/message' || event.type === 'turn/start')).toEqual([])
expect(await scaffold.ctx.schedule.catalog()).toEqual([])
}
expect(tripwire.pageErrors).toEqual([])
} finally {
try { await browser?.close() } finally { await scaffold.close() }
}
})
/** Number of grid tracks the recommendation list lays its tiles in. */
async function recommendationColumns(recommendations: Locator): Promise<number> {
return recommendations.getByRole('list').evaluate(list => getComputedStyle(list).gridTemplateColumns.split(' ').length)
}
it.each([
{ locale: 'en', panel: 'Automation tasks', title: 'Daily brief' },
{ locale: 'de', panel: 'Automatisierungsaufgaben', title: 'Tagesüberblick' },
] as const)('shows every recommendation title and description in full on phone and desktop widths in $locale', async (copy) => {
const scaffold = await launchWebScaffold({ firstUse: true })
let browser: Awaited<ReturnType<typeof chromium.launch>> | undefined
try {
browser = await chromium.launch()
// 680px puts the list just above the 600px column breakpoint, where each column is narrowest.
for (const { width, columns } of [{ width: 390, columns: 1 }, { width: 680, columns: 2 }, { width: 1440, columns: 2 }]) {
const phone = width < 600
const page = await browser.newPage({ viewport: { width, height: 900 }, isMobile: phone, hasTouch: phone, locale: copy.locale })
await page.addInitScript((locale) => { localStorage.setItem('dsh.locale', locale) }, copy.locale)
const tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await revealNavigationDrawer(page, copy.locale)
await page.getByRole('button', { name: copy.panel, exact: true }).click()
const recommendations = page.getByTestId('schedule-recommendations')
await recommendations.getByRole('button', { name: copy.title, exact: true }).waitFor()
await page.evaluate(() => document.fonts.ready)
expect(await recommendationColumns(recommendations)).toBe(columns)
// The title carries the button's name and the first description reference is the description; neither clips.
expect(await recommendations.getByRole('button').evaluateAll(buttons => buttons.flatMap((button) => {
const name = button.getAttribute('aria-label')!
const title = [...button.querySelectorAll('span')].find(span => span.textContent === name)!
const description = document.getElementById(button.getAttribute('aria-describedby')!.split(' ')[0]!)!
return [
...title.scrollWidth > title.clientWidth ? [`title: ${name}`] : [],
...description.scrollHeight > description.clientHeight ? [`description: ${name}`] : [],
]
}))).toEqual([])
expect(tripwire.pageErrors).toEqual([])
await page.close()
}
} finally {
try { await browser?.close() } finally { await scaffold.close() }
}
})
it('opens stored timing fields immediately without selecting another repeat option', async () => {
const scaffold = await launchWebScaffold({ firstUse: true })
let browser: Awaited<ReturnType<typeof chromium.launch>> | undefined
+253
View File
@@ -0,0 +1,253 @@
/**
* Session panel layout in the shipped Web composition. The panel's stylesheet
* decides whether the Chat View's end gutter holds the docked panel and tells
* the plugin through a 1px dock probe, and it lays out the rows that
* contributors mark. jsdom cannot evaluate that stylesheet, so this measures
* the probe, the panel, and the toggle around the docking boundary, and the
* working folder row without and with a directory context menu.
*/
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished } from 'vitest'
import { createLaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment'
import type { SessionId } from '@deepseek-ai/dsh-session'
import { brandString } from '@deepseek-ai/dsh-brand'
import { launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
const MODE = webSnapshotMode()
const SEED_ID = brandString<SessionId>('session-panel-layout-web-e2e')
/** The default transcript width in a frame wide enough to dock. */
const TRANSCRIPT = 880
/** The gutter that holds the docked panel: 40px clear of the transcript, its 300px minimum width, and the 8px edge inset. */
const DOCK_GUTTER = 348
/** What the layout says about docking: the gutter, the probe, the panel's presentation and insets, and the toggle. */
function docking(page: Page) {
return page.evaluate(() => {
const layer = document.querySelector<HTMLElement>('[data-chat-aside]')
const column = document.querySelector<HTMLElement>('[data-chat-flow]')
const probe = document.querySelector<HTMLElement>('[data-session-panel-probe]')
const toggle = document.querySelector<HTMLElement>('[data-session-panel-toggle]')
if (layer === null || column === null || probe === null || toggle === null) {
throw new Error('aside layer, transcript column, dock probe, or panel toggle is missing')
}
const frame = layer.getBoundingClientRect()
const flow = column.getBoundingClientRect()
const panel = document.querySelector<HTMLElement>('[data-session-panel]')
const box = panel?.getBoundingClientRect()
return {
gutter: (frame.width - flow.width) / 2,
probe: probe.getBoundingClientRect().width,
presentation: panel?.dataset['sessionPanel'] ?? null,
expanded: toggle.getAttribute('aria-expanded'),
panel: box === undefined ? null : { width: box.width, clear: box.left - flow.right, edge: frame.right - box.right },
}
})
}
/** Open the seeded Session through the sidebar and wait for the panel's dock probe. */
async function openSeed(page: Page): Promise<void> {
const session = page.locator(`[data-row-key="session:${SEED_ID}"]`)
await expect.poll(async () => {
if (await session.isVisible()) return true
const group = page.locator('[role="treeitem"][aria-expanded]').first()
if (await group.count() > 0 && await group.getAttribute('aria-expanded') === 'false') await group.click()
return session.isVisible()
}, { timeout: 15_000 }).toBe(true)
await session.click()
await page.locator('[data-session-panel-probe]').waitFor({ state: 'attached', timeout: 30_000 })
}
/** Wait until the panel shows this way (null: not at all) and its entrance has finished. */
async function shows(page: Page, presentation: 'docked' | 'overlay' | null): Promise<void> {
await expect.poll(async () => (await docking(page)).presentation, { timeout: 10_000 }).toBe(presentation)
if (presentation === null) return
await page.locator('[data-session-panel]').evaluate(async (element) => {
await Promise.all(element.getAnimations().map(animation => animation.finished))
})
}
/**
* The working folder row as laid out: its line, how far the centers of its
* icon and menu columns sit from its edges, the room after its text, and what
* the pointer state shows. `menu` is null while the menu part renders nothing.
*/
function rowLayout(page: Page) {
return page.locator('[data-session-panel] [data-session-panel-project]').evaluate((element) => {
const box = element.getBoundingClientRect()
const icon = element.querySelector('[data-row-part="icon"]')!.getBoundingClientRect()
const content = element.querySelector('[data-row-part="content"]')!
const menu = element.querySelector<HTMLElement>('[data-row-part="menu"]')!
const column = menu.getBoundingClientRect()
const button = menu.querySelector('button')?.getBoundingClientRect()
return {
height: box.height,
iconCenter: icon.left + icon.width / 2 - box.left,
iconSize: [icon.width, icon.height],
clipped: getComputedStyle(content).textOverflow,
afterText: box.right - content.getBoundingClientRect().right,
menu: button === undefined
? null
: {
center: box.right - (column.left + column.width / 2),
target: [button.width, button.height],
opacity: getComputedStyle(menu).opacity,
},
hovered: element.matches(':hover'),
highlighted: getComputedStyle(element).backgroundColor !== 'rgba(0, 0, 0, 0)',
}
})
}
describe.skipIf(MODE === 'record')('web e2e: Session panel layout', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let tripwire: ReturnType<typeof watchConsole>
/** Viewport width the application keeps outside the Chat frame. */
let chrome = 0
/** Resize the window so the Chat View's end gutter is exactly `gutter`, and wait for the layout to follow. */
async function setGutter(gutter: number): Promise<void> {
await page.setViewportSize({ width: TRANSCRIPT + 2 * gutter + chrome, height: page.viewportSize()!.height })
await expect.poll(async () => (await docking(page)).gutter, { timeout: 10_000 }).toBe(gutter)
}
beforeAll(async () => {
scaffold = await launchWebScaffold()
await seedSession(scaffold, await readFile(FIXTURE, 'utf8'), SEED_ID)
browser = await chromium.launch()
page = await newEnglishPage(browser)
await page.emulateMedia({ reducedMotion: 'reduce' })
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
}, 120_000)
/** Open the seeded Session and learn how much of the window lies outside the Chat frame. */
async function openSession(): Promise<void> {
if (chrome !== 0) return
await openSeed(page)
const frame = await page.locator('[data-chat-aside]').evaluate(element => element.getBoundingClientRect().width)
chrome = page.viewportSize()!.width - frame
}
afterAll(async () => {
const failures: unknown[] = []
try { await browser?.close() } catch (error) { failures.push(error) }
try { await scaffold?.close() } catch (error) { failures.push(error) }
if (failures.length > 0) throw new AggregateError(failures, 'Session panel layout teardown failed')
})
it('docks exactly from the gutter that holds the panel at its minimum width', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-dock'))
await openSession()
expect(Number.isInteger(chrome)).toBe(true)
await setGutter(DOCK_GUTTER - 1)
await shows(page, null)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 1, probe: 0, presentation: null, expanded: 'false', panel: null })
// Half a pixel short, the probe is half a pixel wide and the panel stays hidden.
await setGutter(DOCK_GUTTER - 0.5)
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 0.5, probe: 0.5, presentation: null, expanded: 'false', panel: null })
await setGutter(DOCK_GUTTER)
await shows(page, 'docked')
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 300, clear: 40, edge: 8 },
})
// A wider gutter widens the panel to its maximum at the same edge inset; the probe stays 1px.
await setGutter(DOCK_GUTTER + 100)
expect(await docking(page)).toEqual({
gutter: DOCK_GUTTER + 100, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 360, clear: 80, edge: 8 },
})
await setGutter(DOCK_GUTTER - 1)
await shows(page, null)
expect((await docking(page)).expanded).toBe('false')
expect(tripwire.pageErrors).toEqual([])
})
it('floats narrower than it docks, at the same edge inset, and docks once the gutter holds it', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-overlay'))
await openSession()
const toggle = page.locator('[data-session-panel-toggle]')
await setGutter(260)
await shows(page, null)
await toggle.click()
await shows(page, 'overlay')
const overlay = await docking(page)
expect(overlay).toMatchObject({ probe: 0, presentation: 'overlay', expanded: 'true', panel: { width: 280, edge: 8 } })
// The overlay covers part of the transcript instead of keeping clear of it.
expect(overlay.panel?.clear).toBeLessThan(0)
await page.keyboard.press('Escape')
await shows(page, null)
expect((await docking(page)).expanded).toBe('false')
// An open overlay gives way to the docked panel when the window widens enough.
await toggle.click()
await shows(page, 'overlay')
await setGutter(DOCK_GUTTER)
await shows(page, 'docked')
expect(await docking(page)).toMatchObject({ probe: 1, expanded: 'true', panel: { width: 300, clear: 40, edge: 8 } })
expect(tripwire.pageErrors).toEqual([])
})
it('lays the working folder row out by its marks, with no room or highlight for a menu that renders nothing', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-row'))
await openSession()
await setGutter(DOCK_GUTTER + 100)
await shows(page, 'docked')
const row = page.locator('[data-session-panel] [data-session-panel-project]')
await row.waitFor()
await page.mouse.move(5, 5)
// This composition registers no directory menu entries, so the shared More button renders nothing:
// the text runs to the row's 6px padding, and the row has nothing to highlight for.
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 6, menu: null, highlighted: false }
expect(await rowLayout(page)).toEqual({ ...resting, hovered: false })
await row.hover()
expect(await rowLayout(page)).toEqual({ ...resting, hovered: true })
expect(tripwire.pageErrors).toEqual([])
})
it('puts a rendered menu on the panel end column and shows it, with the row highlight, on hover', async () => {
// The directory context menu comes from Open In; SSH facts keep it from probing this runner's native applications.
const withMenu = await launchWebScaffold({ openInAppEnvironment: createLaunchEnvironmentSnapshot([
{ source: 'process', values: { SSH_CONNECTION: '10.0.0.2 55000 10.0.0.9 22' } },
]) })
onTestFinished(() => withMenu.close())
await seedSession(withMenu, await readFile(FIXTURE, 'utf8'), SEED_ID)
const other = await newEnglishPage(browser)
onTestFinished(() => other.close())
onTestFailed(() => saveFailureShot(other, 'web-e2e-session-panel-row-menu'))
await other.emulateMedia({ reducedMotion: 'reduce' })
const errors = watchConsole(other)
// Wide enough for the gutter to hold the docked panel.
await other.setViewportSize({ width: 2200, height: 1000 })
await other.goto(withMenu.authenticatedUrl, { waitUntil: 'load' })
await openSeed(other)
await shows(other, 'docked')
const row = other.locator('[data-session-panel] [data-session-panel-project]')
await row.locator('[data-row-part="menu"] button').waitFor({ state: 'attached' })
await other.mouse.move(5, 5)
// The 16px menu column and the 8px gap before it follow the text; the 24px target reaches past the column.
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 30 }
expect(await rowLayout(other)).toEqual({
...resting, menu: { center: 14, target: [24, 24], opacity: '0' }, hovered: false, highlighted: false,
})
await row.hover()
await expect.poll(async () => (await rowLayout(other)).menu?.opacity).toBe('1')
expect(await rowLayout(other)).toEqual({
...resting, menu: { center: 14, target: [24, 24], opacity: '1' }, hovered: true, highlighted: true,
})
await other.mouse.move(5, 5)
await expect.poll(async () => (await rowLayout(other)).highlighted).toBe(false)
expect(errors.pageErrors).toEqual([])
})
})
+4 -8
View File
@@ -464,18 +464,14 @@ function assertLeanChildRecord(agent: Agent): void {
}
/**
* The catalog the shipped Web composition puts in front of the model, minus the
* ripgrep-dependent pair below. The absences are deliberate, not incidental
* gaps: the `cordis_*` toolset executes model-written JavaScript that no
* sandbox row confines, `mcp_*` servers spawn outside `ctx.shell`, and `ralph`
* runs unsupervised rounds whose completion is a worker self-report.
* `web_fetch` is present because it adds no network reach beyond the
* mounted shell tools. The composition
* Agent Note owns the rationale and its sources.
* The shipped Standard catalog, minus the ripgrep-dependent pair below.
* Runtime inspection is read-only. Generated-code execution tools, external
* MCP servers, and ralph are not enabled in this preset.
*/
const EXPECTED_TOOLS = [
'ask_user_question',
'bash',
'cordis_inspect',
'create_goal',
'edit',
'exit_plan_mode',
+19
View File
@@ -496,6 +496,25 @@ describe('web e2e: shipped right Sidebar', () => {
expect(await filesTab.locator('[data-dockkit-tab-close]').count()).toBe(1)
const guideTab = column.locator('[data-dockkit-tab]').filter({ hasText: 'Start' })
expect(await guideTab.locator('[data-dockkit-tab-close]').count()).toBe(1)
// A pane shorter than the guide scrolls it from the compass to the last capsule.
const viewport = page.viewportSize()
if (viewport === null) throw new Error('expected a fixed viewport')
const guide = column.locator('[data-sidebar-right-guide]')
await page.setViewportSize({ width: viewport.width, height: 240 })
try {
await expect.poll(async () => await guide.evaluate(node => node.scrollHeight > node.clientHeight)).toBe(true)
expect(await guide.evaluate(node => node.scrollTop)).toBe(0)
const lastEntry = guide.locator('[data-sidebar-right-guide-entry]').last()
await guide.evaluate((node) => { node.scrollTop = node.scrollHeight })
expect(await guide.evaluate(node => node.scrollTop)).toBeGreaterThan(0)
expect(await lastEntry.evaluate((node) => {
const entry = node.getBoundingClientRect()
const pane = node.closest('[data-sidebar-right-guide]')?.getBoundingClientRect()
return pane !== undefined && entry.top >= pane.top && entry.bottom <= pane.bottom
})).toBe(true)
} finally {
await page.setViewportSize(viewport)
}
// Back to the seeded shape the cases below start from.
await guideTab.hover()
await guideTab.locator('[data-dockkit-tab-close]').click()
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Stream one TypeScript fence for
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
+1 -2
View File
@@ -38,8 +38,7 @@ it('lists dsh-doc once without loading instructions or calling tools for an ordi
expect(events.filter(event => event.type === 'user/message'
&& event.data.source.kind === 'skill-invocation')).toEqual([])
const names = scaffold.ctx.tools.schemas(agent).map(tool => tool.name)
expect(names).not.toContain('cordis_inspect_list')
expect(names).not.toContain('cordis_inspect_query')
expect(names).toContain('cordis_inspect')
await page.getByText('READY', { exact: true }).waitFor()
await assertFixtureInventory(dirname(FIXTURE), ['session.v4.jsonl'])
} finally {
+4 -4
View File
@@ -308,14 +308,14 @@ export function probeFreePort(): Promise<number> {
* @param page - browser page with the mounted sidebar.
* @param locale - current UI language.
*/
export async function revealNavigationDrawer(page: Page, locale: 'en' | 'zh' | 'ja'): Promise<void> {
export async function revealNavigationDrawer(page: Page, locale: 'en' | 'zh' | 'ja' | 'de'): Promise<void> {
const drawer = await page.evaluate(() => window.innerWidth < 768
&& !document.documentElement.hasAttribute('data-windows-titlebar'))
await page.waitForFunction(expected => Boolean(document.querySelector('[data-sidebar-drawer]')) === expected, drawer)
const closed = page.locator('[data-sidebar-drawer][data-sidebar-collapsed]')
if (await closed.count() === 0) return
await page.locator('[data-shell-leading]').getByRole('button', {
name: { en: 'Open sidebar', zh: '打开侧边栏', ja: 'サイドバーを開く' }[locale], exact: true,
name: { en: 'Open sidebar', zh: '打开侧边栏', ja: 'サイドバーを開く', de: 'Seitenleiste öffnen' }[locale], exact: true,
}).click()
await closed.waitFor({ state: 'detached' })
}
@@ -419,8 +419,8 @@ export async function saveFailureShot(page: Page, name: string): Promise<void> {
mkdirSync(dir, { recursive: true })
try {
await page.screenshot({ path: `${dir}/${name}.png`, fullPage: true })
} catch {
// Best-effort evidence: a dead page/browser at failure time must not mask the real assertion error.
} catch (_screenshotFailed) {
// Screenshot evidence is optional: a dead page/browser at failure time must not mask the real assertion error.
}
}
+1
View File
@@ -25,6 +25,7 @@
"exclude": [
"tests/home-whale.e2e.ts",
"tests/sidebar-drawer.e2e.ts",
"tests/session-panel-layout.e2e.ts",
"tests/creation-recommendations.e2e.ts",
"tests/plugin-recommendations.e2e.ts",
"tests/deepseek-chat-import.e2e.ts",
+4 -3
View File
@@ -262,7 +262,7 @@ export interface Config {
## `@deepseek-ai/dsh-api-session-controller`
- `inject`: `agentDefaultModel` · `agents` · `attachments` · `fileUploads` · `fs` · `llm` · `remoteAccess` · `sessions` · `sessionProjections` · `sessionQuery` · `typert` · `typertGateway` · `workspaceRegistry`
- `source`: [`packages/api/session-controller/src/index.ts:111`](../packages/api/session-controller/src/index.ts)
- `source`: [`packages/api/session-controller/src/index.ts:83`](../packages/api/session-controller/src/index.ts)
```ts config-catalog
/** Session Controller deployment policy. */
@@ -2740,7 +2740,7 @@ export interface Config {
- `inject`: `shell` · `approval` · `sessions` · `agents` · `sessionProjections`
- `refs`: [`ApprovalPolicy`](subsystems/approval.md) · [`SandboxMode`](subsystems/sandbox.md) · `Volatile` (`@deepseek-ai/cordis`)
- `source`: [`packages/interaction/permission-presets/src/index.ts:154`](../packages/interaction/permission-presets/src/index.ts)
- `source`: [`packages/interaction/permission-presets/src/index.ts:161`](../packages/interaction/permission-presets/src/index.ts)
```ts config-catalog
/** The {@link PermissionPresetService} config: preset table and composition default. */
@@ -5179,7 +5179,7 @@ export interface Config {
## `@deepseek-ai/dsh-working-directory`
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
- `source`: [`packages/session/working-directory/src/index.ts:70`](../packages/session/working-directory/src/index.ts)
- `source`: [`packages/session/working-directory/src/index.ts:64`](../packages/session/working-directory/src/index.ts)
```ts config-catalog
/** Deployment default for Sessions without an original project directory. */
@@ -5271,6 +5271,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session-panel` | — | [`packages/client/ui-session-panel/src/index.ts`](../packages/client/ui-session-panel/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
+4 -3
View File
@@ -264,7 +264,7 @@ export interface Config {
## `@deepseek-ai/dsh-api-session-controller`
- `inject`: `agentDefaultModel` · `agents` · `attachments` · `fileUploads` · `fs` · `llm` · `remoteAccess` · `sessions` · `sessionProjections` · `sessionQuery` · `typert` · `typertGateway` · `workspaceRegistry`
- `source`: [`packages/api/session-controller/src/index.ts:111`](../packages/api/session-controller/src/index.ts)
- `source`: [`packages/api/session-controller/src/index.ts:83`](../packages/api/session-controller/src/index.ts)
```ts config-catalog
/** Session Controller deployment policy. */
@@ -2742,7 +2742,7 @@ export interface Config {
- `inject`: `shell` · `approval` · `sessions` · `agents` · `sessionProjections`
- `refs`: [`ApprovalPolicy`](subsystems/approval.zh.md) · [`SandboxMode`](subsystems/sandbox.zh.md) · `Volatile` (`@deepseek-ai/cordis`)
- `source`: [`packages/interaction/permission-presets/src/index.ts:154`](../packages/interaction/permission-presets/src/index.ts)
- `source`: [`packages/interaction/permission-presets/src/index.ts:161`](../packages/interaction/permission-presets/src/index.ts)
```ts config-catalog
/** The {@link PermissionPresetService} config: preset table and composition default. */
@@ -5181,7 +5181,7 @@ export interface Config {
## `@deepseek-ai/dsh-working-directory`
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
- `source`: [`packages/session/working-directory/src/index.ts:70`](../packages/session/working-directory/src/index.ts)
- `source`: [`packages/session/working-directory/src/index.ts:64`](../packages/session/working-directory/src/index.ts)
```ts config-catalog
/** Deployment default for Sessions without an original project directory. */
@@ -5273,6 +5273,7 @@ export interface Config {
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session-panel` | — | [`packages/client/ui-session-panel/src/index.ts`](../packages/client/ui-session-panel/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
+2 -2
View File
@@ -62,7 +62,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:77`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:46`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
@@ -104,7 +104,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
+2 -2
View File
@@ -64,7 +64,7 @@
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:77`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) |
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:46`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
@@ -106,7 +106,7 @@
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
+2
View File
@@ -199,6 +199,7 @@ flowchart TD
pkg_client_ui_schedule["client-ui-schedule"]
pkg_client_ui_secret_mask["client-ui-secret-mask"]
pkg_client_ui_session["client-ui-session"]
pkg_client_ui_session_panel["client-ui-session-panel"]
pkg_client_ui_session_status["client-ui-session-status"]
pkg_client_ui_settings["client-ui-settings"]
pkg_client_ui_settings_account["client-ui-settings-account"]
@@ -1657,6 +1658,7 @@ flowchart TD
| [`client-ui-schedule`](../packages/client/ui-schedule) | `client` | — |
| [`client-ui-secret-mask`](../packages/client/ui-secret-mask) | `client` | — |
| [`client-ui-session`](../packages/client/ui-session) | `client` | — |
| [`client-ui-session-panel`](../packages/client/ui-session-panel) | `client` | — |
| [`client-ui-session-status`](../packages/client/ui-session-status) | `client` | — |
| [`client-ui-settings`](../packages/client/ui-settings) | `client` | — |
| [`client-ui-settings-account`](../packages/client/ui-settings-account) | `client` | — |
+2
View File
@@ -201,6 +201,7 @@ flowchart TD
pkg_client_ui_schedule["client-ui-schedule"]
pkg_client_ui_secret_mask["client-ui-secret-mask"]
pkg_client_ui_session["client-ui-session"]
pkg_client_ui_session_panel["client-ui-session-panel"]
pkg_client_ui_session_status["client-ui-session-status"]
pkg_client_ui_settings["client-ui-settings"]
pkg_client_ui_settings_account["client-ui-settings-account"]
@@ -1659,6 +1660,7 @@ flowchart TD
| [`client-ui-schedule`](../packages/client/ui-schedule) | `client` | — |
| [`client-ui-secret-mask`](../packages/client/ui-secret-mask) | `client` | — |
| [`client-ui-session`](../packages/client/ui-session) | `client` | — |
| [`client-ui-session-panel`](../packages/client/ui-session-panel) | `client` | — |
| [`client-ui-session-status`](../packages/client/ui-session-status) | `client` | — |
| [`client-ui-settings`](../packages/client/ui-settings) | `client` | — |
| [`client-ui-settings-account`](../packages/client/ui-settings-account) | `client` | — |
+10 -10
View File
@@ -147,8 +147,8 @@
en: 19917bc5438e60af
zh: 19917bc5438e60af
/session-persistence-event-catalog/events/permission/permission-preset-log-only:
en: 5a38e50ed89e1a80
zh: 5c4160ebfb3d661b
en: bf9ce12daf742e7f
zh: 78d8424f1493ca2c
/session-persistence-event-catalog/events/plan:
en: 4294f78d26ed985b
zh: 4294f78d26ed985b
@@ -300,8 +300,8 @@
en: e8dd0cebbb930eb7
zh: e8dd0cebbb930eb7
/session-persistence-event-catalog/events/working-directory/working-directory-change-log-only:
en: 27f0761cbdd6fe2f
zh: 33528f333498132d
en: bf12683fa0fe3dfa
zh: 79a678a53cee33b9
/session-persistence-event-catalog/events/workspace:
en: 63ee1a85e4b59ae3
zh: 63ee1a85e4b59ae3
@@ -1497,8 +1497,8 @@
en: bef51e0442ebb903
zh: 240ebeb160533d8c
/session-persistence-event-catalog/resolved-persistence-types/cwd:
en: 2809c921c6996791
zh: 80b15177561766d7
en: 166c1be5f6237f1b
zh: 5002d35a2ec5fb1e
/session-persistence-event-catalog/resolved-persistence-types/decision-durationms-exitcode-handlerid:
en: a99ac57bbec0370f
zh: 9073329e324a66e0
@@ -1935,8 +1935,8 @@
en: c6e1e91281b3f9c2
zh: 33225e83b0bd8cff
/session-persistence-event-catalog/resolved-persistence-types/kind-working-directory:
en: b28ca6b37f5a338d
zh: 4c4f2f05721b8b62
en: a36b909ecbd38156
zh: b02edb123e72fbb1
/session-persistence-event-catalog/resolved-persistence-types/max-tokens-messages-model-thinking:
en: efe43158304eaf7b
zh: 7a4b0d7f1a9f1c65
@@ -1959,8 +1959,8 @@
en: 88fd92dff7aa505f
zh: b400712b3ef749aa
/session-persistence-event-catalog/resolved-persistence-types/preset:
en: 9fbb222685c7310c
zh: 26e3032eae149f0a
en: 42a6a0b07a66ad45
zh: eaecef11c5b3ac02
/session-persistence-event-catalog/resolved-persistence-types/reason-turn:
en: b8d80b4b1e6441ad
zh: d5c52e1bfe560297
+5 -5
View File
@@ -718,7 +718,7 @@ Source: [`packages/core/agent/src/types.ts:121`](../packages/core/agent/src/type
'permission/preset': { preset: string }
```
Source: [`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
Source: [`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
### `plan/*`
@@ -1329,7 +1329,7 @@ Source: [`packages/web/web-search-deepseek/src/provider.ts:90`](../packages/web/
}
```
Source: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
Source: [`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
### `workspace/*`
@@ -6216,7 +6216,7 @@ Sources: [`packages/compaction/compaction/src/types.ts:24`](../packages/compacti
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
Sources: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
Sources: [`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
| Property | Presence | Type |
|---|---|---|
@@ -7970,7 +7970,7 @@ Sources: [`packages/experimental/webhook/src/types.ts:75`](../packages/experimen
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
Sources: [`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
Sources: [`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
| Property | Presence | Type |
|---|---|---|
@@ -8081,7 +8081,7 @@ Sources: [`packages/interaction/user-approval/src/index.ts:41`](../packages/inte
SHA-256: `8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad`
Sources: [`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
Sources: [`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
| Property | Presence | Type |
|---|---|---|
+5 -5
View File
@@ -720,7 +720,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
'permission/preset': { preset: string }
```
来源:[`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
来源:[`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
### `plan/*`
@@ -1331,7 +1331,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
}
```
来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
来源:[`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
### `workspace/*`
@@ -6218,7 +6218,7 @@ SHA-256: `3e4e7683b0192c9f0e6a75c59076108f017892cdb302a98032c2632fd79c356f`
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
来源:[`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -7972,7 +7972,7 @@ SHA-256: `9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94`
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
来源:[`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
来源:[`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -8083,7 +8083,7 @@ SHA-256: `11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912`
SHA-256: `8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad`
来源:[`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
来源:[`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
+3 -3
View File
@@ -161,7 +161,7 @@
{"digest":"2142e391b9ccb60d487afcf373ce74db98d952f69e8289eddb352a7e16e996c5","names":[],"sources":[]},
{"digest":"2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0","names":["packages/team/agent-team/src/types.ts#TeamMessageSource"],"sources":["packages/team/agent-team/src/types.ts:121"]},
{"digest":"21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d","names":[],"sources":[]},
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:48"]},
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:49"]},
{"digest":"224aa11d4d5f88c450822d01b99e6ca5e3a9c7f26a5ede10bae33384a09ef4dc","names":[],"sources":[]},
{"digest":"234142ee4f996f38cc9fa3b8b3e3de29b03c9aefe5ebf6c224eddd564505aa85","names":[],"sources":[]},
{"digest":"237c004c73b6b288246816e0d7fde16e09c63a47aa3b1227383d7afe58666163","names":[],"sources":[]},
@@ -416,7 +416,7 @@
{"digest":"88a610b831be6d92612a464be5c7d0b88ec24d97bd299837bf74bf7672183c9a","names":[],"sources":["packages/llm/llm/src/types.ts:588"]},
{"digest":"8a046b52331959aa3394680d6acbe09b8a5447c6b61375f263445bfcef19b7f1","names":[],"sources":[]},
{"digest":"8a6e1ec9e8db346b0e02f027db73c07a94f067a26d40c1aef1abd09c47ce7ba0","names":[],"sources":[]},
{"digest":"8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad","names":[],"sources":["packages/interaction/permission-presets/src/index.ts:54"]},
{"digest":"8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad","names":[],"sources":["packages/interaction/permission-presets/src/index.ts:61"]},
{"digest":"8ad45ad053b4d89f8865c17cc9ff3b8748e86045f3f0fb816269a34af2619141","names":[],"sources":["packages/experimental/hook-protocol/src/types.ts:31"]},
{"digest":"8af841fc9b265ade3441caf9fe40dd24db24226befba48150e6d0eeccc1389c3","names":[],"sources":[]},
{"digest":"8bb8c3751a6ce64b61aba1ec7ae798c00a5803c4d868a0430873216c6569ed52","names":[],"sources":["packages/session/session-log-deepseek/src/types.ts:96"]},
@@ -608,7 +608,7 @@
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
{"digest":"d9c462b9f62fdd3efc76a44b9524dc8781f6b91cd9c7e584b17d971defafebab","names":["packages/llm/llm/src/message.ts#ToolMessageSource"],"sources":["packages/llm/llm/src/message.ts:28"]},
{"digest":"d9edf1862e4471d6ad8a106a3f4160e0643874368707d50ecd8e27e5ee7a2567","names":[],"sources":[]},
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:55"]},
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:56"]},
{"digest":"dacf3d5f3e4ff619c1320e64a48dec5e7ecd7870bece65fbd449a0e63adfa521","names":[],"sources":[]},
{"digest":"db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c","names":[],"sources":[]},
{"digest":"db6c5246911d47a7969f6b4cb47c7d0dbbde75c402710b22ace3672fa97bebe0","names":[],"sources":[]},
+1 -1
View File
@@ -16,7 +16,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
### `ctx.cordisInspect` — `CordisInspectRegistryService`
Registry and cross-page router behind the two model-facing inspect tools.
Registry and cross-page router behind the model-facing inspection tool.
```ts cordis-catalog
/**
+1 -1
View File
@@ -16,7 +16,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
### `ctx.cordisInspect` — `CordisInspectRegistryService`
Registry and cross-page router behind the two model-facing inspect tools.
Registry and cross-page router behind the model-facing inspection tool.
```ts cordis-catalog
/**
+3
View File
@@ -404,6 +404,9 @@ Host service backing the generated `ctx.remote.job` namespace.
* Stream the jobs one session can see — its own plus every unowned job —
* as whole-set frames: one on open, then one after each coalesced burst of
* lifecycle commits. The stream has no natural end; the carrier closes it.
*
* The Gateway names this call's Session resource from `request.sessionId`
* through the session controller's resolver; no explicit reader is needed.
* @param request - the session whose visible set to mirror.
* @param signal - cancellation owned by the Remote stream carrier.
* @returns the roster frames.
+3
View File
@@ -404,6 +404,9 @@ Host service backing the generated `ctx.remote.job` namespace.
* Stream the jobs one session can see — its own plus every unowned job —
* as whole-set frames: one on open, then one after each coalesced burst of
* lifecycle commits. The stream has no natural end; the carrier closes it.
*
* The Gateway names this call's Session resource from `request.sessionId`
* through the session controller's resolver; no explicit reader is needed.
* @param request - the session whose visible set to mirror.
* @param signal - cancellation owned by the Remote stream carrier.
* @returns the roster frames.
+2 -2
View File
@@ -15,5 +15,5 @@
en: 43a7b661b747091f
zh: ee6b4f1ddb8cf6f2
/permission-presets/switching-and-the-permission-preset-event:
en: 71924a3f5f717704
zh: 0a7ecbbf8d801a32
en: 2f287db1b6649a86
zh: 99dac792fc340097
+21
View File
@@ -72,6 +72,8 @@ interface PresetOption {
`set(session, name)` resolves the preset (unknown names throw), runs Auto admission when applicable, appends a log-only `permission/preset` event unless `name` is already the effective preset, then writes each knob through its own setter — `setSandboxMode` from [dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) and `setApprovalPolicy` from [dsh-user-approval](../../packages/interaction/user-approval) — only when that knob's effective value changes. The selection event precedes the knob events in the same turn, and re-selecting the effective preset appends nothing.
The `permissionPresets/set` Remote (`setPreset`) is the write's Remote face: it switches one live Session through `set` and declares that Session as the `session` resource the Gateway decides, so access control runs before any preset is resolved.
`permission/preset` is durable, log-only user intent: it stays out of the model transcript (the knob events own the model-visible consequences through their consumers), and it exists so `current()` can preserve which preset the user chose when two presets share a bundle. The `permissions` projection folds that selection with both knob events and retains the `session/end-seed` boundary used to distinguish a restored empty seed from a fresh session; replay needs no catch-up state or raw-log rescan. A restored `auto` selection requires the live Auto registration before Agent publication. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md); the method signatures are in the generated [service catalog](#ctxpermissionpresets--permissionpresetservice).
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
@@ -95,6 +97,25 @@ Owns the deployment's configured permission presets, the fixed Auto integration
*/
@Remote('catalog') catalog(): PermissionCatalog
/**
* Switch one live Session to another preset, opened as a Remote call so a
* caller's Session access is decided before any preset is resolved or any
* knob is written. The call's `session` resource is the Session named by
* `request.sessionId`, per {@link PermissionPresetSetRequest}; the session
* controller's resolver names it.
*
* The switch appends `permission/preset` and the changed knob events to the
* Session log, so persisted-only Sessions are refused: they have no live log
* to append to.
* @param request - live target Session and the preset name to switch to.
* @returns the Session's current selection after the switch, read the way
* the client reads it: the recorded preset while its bundle still matches,
* otherwise the first preset whose bundle matches, otherwise `custom`.
* @throws {RemoteError} `gateway/bad-request` for an unknown preset name or a
* Session this process does not hold live; neither call writes.
*/
@Remote({ name: 'set' }) setPreset(request: PermissionPresetSetRequest): PermissionSelection
/**
* Publish the fixed current-session Auto preset for the calling
* integration's effect lifetime.
+21
View File
@@ -72,6 +72,8 @@ interface PresetOption {
`set(session, name)` 解析预设(未知名称抛出异常),在适用时运行 Auto 准入,在 `name` 尚不是生效预设时追加一条仅记日志的 `permission/preset` 事件,然后通过各旋钮自己的 setter([dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) 的 `setSandboxMode` 与 [dsh-user-approval](../../packages/interaction/user-approval) 的 `setApprovalPolicy`)写入,且仅当该 knob 的生效值发生变化时才写。同一轮次内,选择事件先于旋钮事件出现;重新选择当前生效的预设则什么都不追加。
`permissionPresets/set` Remote(`setPreset`)是这条写入路径的 Remote 面:它通过 `set` 切换一个 live Session,并把该 Session 声明为 Gateway 要判定的 `session` 资源,因此访问控制在解析任何预设之前就已执行。
`permission/preset` 是持久、仅记日志的用户意图:它不进入模型 transcript(文本记录),模型可见的后果由 knob 事件经各自消费方承担;它存在是为了在两个预设共享同一个旋钮组合时,让 `current()` 仍能保住用户选择的究竟是哪一个预设。`permissions` 投影把该选择与两个 knob 事件一同折叠,并保留用于区分空恢复 seed 与新会话的 `session/end-seed` 边界;回放不需要任何追赶状态或原始日志重扫。恢复的 `auto` 选择在 agent 发布前必须存在 live Auto 注册。完整事件声明见[持久化日志事件目录](../persistence-catalog.zh.md);方法签名见生成的[服务目录](#ctxpermissionpresets--permissionpresetservice)。
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
@@ -95,6 +97,25 @@ Owns the deployment's configured permission presets, the fixed Auto integration
*/
@Remote('catalog') catalog(): PermissionCatalog
/**
* Switch one live Session to another preset, opened as a Remote call so a
* caller's Session access is decided before any preset is resolved or any
* knob is written. The call's `session` resource is the Session named by
* `request.sessionId`, per {@link PermissionPresetSetRequest}; the session
* controller's resolver names it.
*
* The switch appends `permission/preset` and the changed knob events to the
* Session log, so persisted-only Sessions are refused: they have no live log
* to append to.
* @param request - live target Session and the preset name to switch to.
* @returns the Session's current selection after the switch, read the way
* the client reads it: the recorded preset while its bundle still matches,
* otherwise the first preset whose bundle matches, otherwise `custom`.
* @throws {RemoteError} `gateway/bad-request` for an unknown preset name or a
* Session this process does not hold live; neither call writes.
*/
@Remote({ name: 'set' }) setPreset(request: PermissionPresetSetRequest): PermissionSelection
/**
* Publish the fixed current-session Auto preset for the calling
* integration's effect lifetime.
+2 -2
View File
@@ -9,8 +9,8 @@
en: 94ba725bef6684b7
zh: f113745a4a07952a
/ptc-runtime/bindings-host-functions-as-program-globals:
en: 182147ddf388c600
zh: c0a7d77602c78bcd
en: a387577007373804
zh: a330173368db598d
/ptc-runtime/captured-output-and-the-failure-taxonomy:
en: ef553620e77bd638
zh: 40ff2f5ba3de5ed5
+29 -6
View File
@@ -115,7 +115,7 @@ type PtcProgramFormat = 'function-body' | 'repl' | 'script' | 'scoped-repl'
## Bindings: host functions as program globals
Each `PtcBindingNamespace` becomes a global object of async callables; PTC passes `tools`. Arguments and resolutions must be lossless JSON. Providers enforce their own transport caps; the seam sets no uniform binding-byte limit. An optional error-class descriptor creates program-visible typed rejections without naming a consumer inside the runtime. Binding names are own properties, so `__proto__` cannot traverse a prototype:
Each `PtcBindingNamespace` becomes a global object of async callables; PTC passes `tools`. Arguments and resolutions must be lossless JSON, with host-issued `PtcImage` and `PtcInspectableValue` descriptors adapted by the provider. Providers enforce their own transport caps; the seam sets no uniform binding-byte limit. An optional error-class descriptor creates program-visible typed rejections without naming a consumer inside the runtime. Binding names are own properties, so `__proto__` cannot traverse a prototype:
```ts type-equiv
/**
@@ -168,15 +168,38 @@ type PtcJsonValue = null | boolean | number | string | PtcJsonValue[] | { [key:
/**
* One host-side function exposed to the program as an async callable. The
* runtime bridges calls to it (possibly across a serialization boundary), so
* `args` must be lossless JSON; resolutions also support host-issued PtcImage values. A runtime rejects a
* lossy or non-cloneable value with a descriptive error rather than corrupting
* the run. No seam-level byte cap applies to a binding resolution. A rejection
* of this function surfaces inside the program as a rejection of the
* corresponding call.
* `args` must be lossless JSON; resolutions also support host-issued PtcImage and
* PtcInspectableValue values. An inspectable resolution delivers its JSON object
* or array to the program and uses its text only when that unchanged value is
* inspected directly. A runtime rejects a lossy or non-cloneable value with a
* descriptive error rather than corrupting the run. No seam-level byte cap
* applies to a binding resolution. A rejection of this function surfaces inside
* the program as a rejection of the corresponding call.
*/
type PtcBindingFunction = (args: unknown) => Promise<PtcJsonValue>
```
`PtcInspectableValue`, exported from `@deepseek-ai/dsh-ptc-runtime`, associates a lossless JSON object or array with host-authored text through `new PtcInspectableValue(value, text)`. The provider delivers the data itself to the program, without exposing the descriptor or adding program-visible properties. Direct `inspect` of the original result uses its text only while the data matches its initial snapshot; empty text emits nothing. Copies, field selections, modified results, and nested values use ordinary formatting. The Node process owns this association, which is neither serialized into Session logs nor transferred by copying a program value. See [`src/inspectable-value.ts`](../../packages/ptc-runtime/ptc-runtime/src/inspectable-value.ts).
The data may contain host-issued `PtcImage` descriptors. The provider preserves their program `Image` identities in the inspection snapshot. Direct inspection of the unchanged container displays its supplied text; inspecting an Image field displays that image.
```ts public-api
/** A binding result whose unchanged object or array displays the supplied text when inspected directly. */
declare class PtcInspectableValue {
readonly [key: string]: PtcJsonValue;
/** The JSON object or array delivered unchanged to the program. */
readonly value: PtcJsonValue[] | { [key: string]: PtcJsonValue };
/** Text shown by a direct inspection of the unchanged value; empty text emits nothing. */
readonly text: string;
/**
* Associate an object or array with its host-authored inspection text.
* @param value - Lossless JSON data retained for programmatic access.
* @param text - Text to display instead of generic object formatting.
*/
constructor(value: PtcJsonValue[] | { [key: string]: PtcJsonValue }, text: string);
}
```
## Captured output and the failure taxonomy
`output` contains text and image entries in emission order: `{ type: 'text', text }` or `{ type: 'image', attachment }`. Text entries retain emitted newline characters; concatenate adjacent text without separators. Each source channel preserves emission order; interleaving across independent channels is backend-dependent. Host bindings return `PtcImage` descriptors containing the attachment reference and a readable execution-world `path`; the program receives an `Image` with that path and the stored pixel dimensions. The Node provider caps serialized text, image descriptors, and completion or diagnostic payloads together; overflow is an explicit failure.
+29 -6
View File
@@ -115,7 +115,7 @@ type PtcProgramFormat = 'function-body' | 'repl' | 'script' | 'scoped-repl'
## 绑定:宿主函数作为程序全局变量
每个 `PtcBindingNamespace` 成为一个异步可调用函数的全局对象;PTC 传入 `tools`。参数与返回值必须是无损 JSON。提供方强制各自的传输上限;seam 不设统一的绑定字节上限。可选错误类描述符创建程序可见的类型化拒绝,无需在运行时内点名消费方。绑定名是自有属性,因此 `__proto__` 不能遍历原型:
每个 `PtcBindingNamespace` 成为一个异步可调用函数的全局对象;PTC 传入 `tools`。参数与返回值必须是无损 JSON,宿主签发的 `PtcImage` 和 `PtcInspectableValue` 描述符由提供方适配。提供方强制各自的传输上限;seam 不设统一的绑定字节上限。可选错误类描述符创建程序可见的类型化拒绝,无需在运行时内点名消费方。绑定名是自有属性,因此 `__proto__` 不能遍历原型:
```ts type-equiv
/**
@@ -168,15 +168,38 @@ type PtcJsonValue = null | boolean | number | string | PtcJsonValue[] | { [key:
/**
* One host-side function exposed to the program as an async callable. The
* runtime bridges calls to it (possibly across a serialization boundary), so
* `args` must be lossless JSON; resolutions also support host-issued PtcImage values. A runtime rejects a
* lossy or non-cloneable value with a descriptive error rather than corrupting
* the run. No seam-level byte cap applies to a binding resolution. A rejection
* of this function surfaces inside the program as a rejection of the
* corresponding call.
* `args` must be lossless JSON; resolutions also support host-issued PtcImage and
* PtcInspectableValue values. An inspectable resolution delivers its JSON object
* or array to the program and uses its text only when that unchanged value is
* inspected directly. A runtime rejects a lossy or non-cloneable value with a
* descriptive error rather than corrupting the run. No seam-level byte cap
* applies to a binding resolution. A rejection of this function surfaces inside
* the program as a rejection of the corresponding call.
*/
type PtcBindingFunction = (args: unknown) => Promise<PtcJsonValue>
```
`@deepseek-ai/dsh-ptc-runtime` 导出的 `PtcInspectableValue` 通过 `new PtcInspectableValue(value, text)`,为无损 JSON 对象或数组关联宿主提供的文本。提供方向程序交付数据本身,不暴露描述符,也不添加程序可见属性。只有直接 `inspect` 原结果,且其数据仍与初始快照一致时,才使用附带文本;空文本不产生输出。拷贝、字段选择、修改后的结果和嵌套值使用普通格式。该关联由 Node 进程拥有,不序列化到 Session 日志,复制程序值也不会传递该关联。参见 [`src/inspectable-value.ts`](../../packages/ptc-runtime/ptc-runtime/src/inspectable-value.ts)。
数据中可以包含宿主提供的 `PtcImage` 描述符。提供方在展示快照中保留对应程序 `Image` 的身份。直接展示未修改的容器时输出附带文本;展示 Image 字段时输出该图片。
```ts public-api
/** A binding result whose unchanged object or array displays the supplied text when inspected directly. */
declare class PtcInspectableValue {
readonly [key: string]: PtcJsonValue;
/** The JSON object or array delivered unchanged to the program. */
readonly value: PtcJsonValue[] | { [key: string]: PtcJsonValue };
/** Text shown by a direct inspection of the unchanged value; empty text emits nothing. */
readonly text: string;
/**
* Associate an object or array with its host-authored inspection text.
* @param value - Lossless JSON data retained for programmatic access.
* @param text - Text to display instead of generic object formatting.
*/
constructor(value: PtcJsonValue[] | { [key: string]: PtcJsonValue }, text: string);
}
```
## 捕获的输出与失败分类体系
`output` 按发出顺序保存文本和图片条目:文本使用 `{ type: 'text', text }`,图片使用 `{ type: 'image', attachment }`。文本条目保留实际输出的换行,相邻文本直接拼接,不额外插入分隔符。每个来源通道都保留发出顺序;独立通道之间的交错顺序由后端决定。宿主绑定返回 `PtcImage` 描述符,包含附件引用和可在执行环境读取的 `path`;程序收到带有该路径和存储像素尺寸的 `Image`。Node 提供方对序列化文本、图片描述符、完成值或诊断一起计量;超限会显式失败。
+7
View File
@@ -184,6 +184,13 @@ Exact-read consumer that prepares immutable cross-session message context.
*
* Discovery runs at keystroke rate, so titles and subagent labels only ever
* come from projection reads; sessions without either fall back to their id.
*
* The list names every Session the session index holds, whatever identity the
* caller acts for; it is not narrowed to Sessions that caller else can read.
* A share viewer therefore learns the id, title, and working-directory path of
* each Session on the owner Host, and {@link prepare} reads the snapshot of a
* cited Session without asking who cited it. That exposure is a recorded
* LiveShare limitation, not a grant: narrowing the list is deferred.
* @param agent - target agent; self is excluded and its cwd drives ranking.
* @param query - optional search text: label and display title match
* fuzzily, session id and working directory as substrings. Matches keep the
+7
View File
@@ -184,6 +184,13 @@ Exact-read consumer that prepares immutable cross-session message context.
*
* Discovery runs at keystroke rate, so titles and subagent labels only ever
* come from projection reads; sessions without either fall back to their id.
*
* The list names every Session the session index holds, whatever identity the
* caller acts for; it is not narrowed to Sessions that caller else can read.
* A share viewer therefore learns the id, title, and working-directory path of
* each Session on the owner Host, and {@link prepare} reads the snapshot of a
* cited Session without asking who cited it. That exposure is a recorded
* LiveShare limitation, not a grant: narrowing the list is deferred.
* @param agent - target agent; self is excluded and its cwd drives ranking.
* @param query - optional search text: label and display title match
* fuzzily, session id and working directory as substrings. Matches keep the
+2 -2
View File
@@ -3,8 +3,8 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/slots.md
/web-client-slots:
en: 15c49af3ed8b57ff
zh: e7f9189de6f4334c
en: c3e0c40beeda0651
zh: a94d81520205694c
/web-client-slots/declaration-and-lifecycle:
en: f2d2c0d3b8f14ec7
zh: 441ed13ff3f81d2a
+9
View File
@@ -16,6 +16,8 @@ The root-scoped lists `sidebar.panellist.actions`, `conversation.session.header.
[ui-settings](../../packages/client/ui-settings/README.md#filling-the-settings-slots) documents the settings page and navigation-icon extension points.
[ui-session-panel](../../packages/client/ui-session-panel/README.md#contribute-a-section) documents the Session panel's section, title-control, row, and toggle-indicator extension positions.
## Declaration and lifecycle
`SlotMap` is the compile-time registry. A package declaration-merges the key, cardinality, scope, owner props, keyed props, and optional slot-level inject face. The runtime declaration is the matching `children` entry on the component that owns the render location.
@@ -148,6 +150,8 @@ root [AppFrame]
│ ├─ conversation.session.header.lineage
│ ├─ conversation.session.header.actions
│ ├─ conversation.session.header.utilities
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ ├─ conversation.session.header.views.actions
│ └─ conversation.session.header.corner
└─ calls Factory: conversation.content
@@ -158,6 +162,11 @@ Factory: conversation.content [ConversationContent]
│ ├─ id=chat [ChatView]
│ │ ├─ conversation.chat.text-interaction [list]
│ │ ├─ conversation.chat.markdown.fence [hoc, keyed by fence language]
│ │ ├─ conversation.chat.aside [SessionPanel]
│ │ │ ├─ conversation.session.panel.section [list]
│ │ │ │ └─ id=environment [EnvironmentSection]
│ │ │ │ └─ conversation.session.panel.environment.row [list]
│ │ │ └─ conversation.session.panel.section.actions [keyed]
│ │ └─ conversation.chat.flow [ChatFlow]
│ │ └─ conversation.chat.node [ChatNodeSeat dispatch]
│ │ ├─ key=user [UserMessageNodeView]
+9
View File
@@ -16,6 +16,8 @@ root 作用域的 list `sidebar.panellist.actions`、`conversation.session.heade
[ui-settings](../../packages/client/ui-settings/README.zh.md#filling-the-settings-slots) 记录设置页面与导航图标扩展点。
[ui-session-panel](../../packages/client/ui-session-panel/README.zh.md#contribute-a-section) 记录会话面板的分栏、标题控件、行与开关角标扩展位置。
## 声明与生命周期
`SlotMap` 是编译期注册表。包通过声明合并写入 key、cardinality(基数)、scope、owner props、keyed props 与可选的 slot 级 inject face。运行时声明则是拥有该渲染位置的组件在 `children` 中给出的对应条目。
@@ -150,6 +152,8 @@ root [AppFrame]
│ ├─ conversation.session.header.lineage
│ ├─ conversation.session.header.actions
│ ├─ conversation.session.header.utilities
│ │ └─ id=session-panel [SessionPanelToggle]
│ │ └─ conversation.session.panel.indicator [list, inline]
│ ├─ conversation.session.header.views.actions
│ └─ conversation.session.header.corner
└─ calls Factory: conversation.content
@@ -160,6 +164,11 @@ Factory: conversation.content [ConversationContent]
│ ├─ id=chat [ChatView]
│ │ ├─ conversation.chat.text-interaction [list]
│ │ ├─ conversation.chat.markdown.fence [hoc, keyed by fence language]
│ │ ├─ conversation.chat.aside [SessionPanel]
│ │ │ ├─ conversation.session.panel.section [list]
│ │ │ │ └─ id=environment [EnvironmentSection]
│ │ │ │ └─ conversation.session.panel.environment.row [list]
│ │ │ └─ conversation.session.panel.section.actions [keyed]
│ │ └─ conversation.chat.flow [ChatFlow]
│ │ └─ conversation.chat.node [ChatNodeSeat dispatch]
│ │ ├─ key=user [UserMessageNodeView]
+20 -2
View File
@@ -240,11 +240,29 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
* Answer a continued question. The reply is steered into the agent as a
* user message whose source names the call; that message is also the
* record that closes the question in the projection.
*
* The only call this method can answer is one the projection lists as
* `continued` on this Session, and it steers a user message into the running
* turn, so it speaks for the person the Session runs for. A LiveShare reader
* reaches it through the Session read role, which is safe only while an
* approval question cannot become `continued`: the projection tracks only
* calls made under the timed `ask_user_question` schema, and a call becomes
* `continued` only by returning the pending result a timed wait produces (or,
* for PTC, a pending dispatch) or by resume repair recording
* `TOOL_OUTCOME_UNKNOWN` for a call the process never finished. Plan review
* (`plan-review`) and the CUA approvals (`approval`) reach `ctx.userQuestions.ask`
* without a `wait` and without a `timeout`, so their result is a settled
* answer, an abort, or a failure, never a pending result, and they stay out
* of the projection. A future approval surface must keep asking without
* `wait`/`timeout`, or it must gain its own owner-only gate; giving it a timed
* form makes an approval answerable by a share viewer.
* @param agent - Live root agent for the owning Session.
* @param callId - Continued question identity.
* @param answer - Complete structured answer batch, one item per question of the call.
* @returns Whether the question is still continued; an accepted reply stays
* queued until the agent admits its user message.
* @returns Whether the question is still continued (`false` when this Session
* lists no such continued call, or its composition carries no Session
* projections); an accepted reply stays queued until the agent admits its
* user message.
* @throws {UserQuestionError} `BAD_ANSWER` when the batch does not name each
* question of the call exactly once, or `REPLY_QUEUED` when a reply is
* already waiting for admission.
+20 -2
View File
@@ -240,11 +240,29 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
* Answer a continued question. The reply is steered into the agent as a
* user message whose source names the call; that message is also the
* record that closes the question in the projection.
*
* The only call this method can answer is one the projection lists as
* `continued` on this Session, and it steers a user message into the running
* turn, so it speaks for the person the Session runs for. A LiveShare reader
* reaches it through the Session read role, which is safe only while an
* approval question cannot become `continued`: the projection tracks only
* calls made under the timed `ask_user_question` schema, and a call becomes
* `continued` only by returning the pending result a timed wait produces (or,
* for PTC, a pending dispatch) or by resume repair recording
* `TOOL_OUTCOME_UNKNOWN` for a call the process never finished. Plan review
* (`plan-review`) and the CUA approvals (`approval`) reach `ctx.userQuestions.ask`
* without a `wait` and without a `timeout`, so their result is a settled
* answer, an abort, or a failure, never a pending result, and they stay out
* of the projection. A future approval surface must keep asking without
* `wait`/`timeout`, or it must gain its own owner-only gate; giving it a timed
* form makes an approval answerable by a share viewer.
* @param agent - Live root agent for the owning Session.
* @param callId - Continued question identity.
* @param answer - Complete structured answer batch, one item per question of the call.
* @returns Whether the question is still continued; an accepted reply stays
* queued until the agent admits its user message.
* @returns Whether the question is still continued (`false` when this Session
* lists no such continued call, or its composition carries no Session
* projections); an accepted reply stays queued until the agent admits its
* user message.
* @throws {UserQuestionError} `BAD_ANSWER` when the batch does not name each
* question of the call exactly once, or `REPLY_QUEUED` when a reply is
* already waiting for admission.
+7 -10
View File
@@ -9,8 +9,8 @@
en: 6cc2cd9ced70bb09
zh: 1c0e6cb4ba2ed637
/tool-schema-catalog/tool-package-map:
en: 4e5bb11e4664bb1c
zh: 4855556d38701373
en: 789c9c7932024257
zh: 6d0465e0463b321c
/tool-schema-catalog/deepseek-ai-dsh-plugin-manager:
en: e0143916bb634762
zh: e0143916bb634762
@@ -72,8 +72,8 @@
en: 8c8643ef46fd075f
zh: 8c8643ef46fd075f
/tool-schema-catalog/deepseek-ai-dsh-tool-executor-ptc/run-code:
en: cff92e5a2476af7e
zh: 8d56bc41053f0a85
en: 93d8526bbc4936d2
zh: 963af83582d289c5
/tool-schema-catalog/deepseek-ai-dsh-plan-mode:
en: b500b530845e26a9
zh: b500b530845e26a9
@@ -113,12 +113,9 @@
/tool-schema-catalog/deepseek-ai-dsh-tool-cordis:
en: 76c7c62f9029b6f5
zh: 76c7c62f9029b6f5
/tool-schema-catalog/deepseek-ai-dsh-tool-cordis/cordis-inspect-list:
en: 594e5b42047969cc
zh: 72189ca21345c210
/tool-schema-catalog/deepseek-ai-dsh-tool-cordis/cordis-inspect-query:
en: 42a647ba98527f9e
zh: c53ade6a47ea523f
/tool-schema-catalog/deepseek-ai-dsh-tool-cordis/cordis-inspect:
en: f804c4e7fccc1c45
zh: 7538d8201ef16ed9
/tool-schema-catalog/deepseek-ai-dsh-tool-bash-persistent:
en: bdd9e88c49029e05
zh: bdd9e88c49029e05
+34 -41
View File
@@ -27,7 +27,7 @@ This table connects model-visible tool names to the plugin package and service s
| `@deepseek-ai/dsh-tool-office` | `office_convert`, `office_recalculate`, `office_render` | `ctx.workingDirectory`, `ctx.tools`, `ctx.fs`, `ctx.agents`, `ctx.officeKit`, `ctx.attachments and ctx.llm for office_render` | `tool/call`, `tool/result with rendered image attachments`, `temporary converted files in the Office kit output store` | - | Declared to an Agent from the step after it successfully loads an Office skill, and kept while the previous request header declares an Office tool. Admitted calls fail with the Office service's unavailable error when LibreOffice Kit is not installed. |
| `@deepseek-ai/dsh-tool-present` | `present` | `ctx.workingDirectory`, `ctx.tools`, `ctx.fs`, `ctx.agents` | `tool/call`, `deliverables/presented after a successful final result`, `tool/result` | - | Deliveries belong to the calling Session; Web ui-deliverables supplies source-file opening and cards. |
| `@deepseek-ai/dsh-tool-pwsh` | `pwsh` | `ctx.workingDirectory`, `ctx.tools`, `ctx.shell`, `ctx.systemPrompt`, `ctx.shellEnv`, `ctx.jobs for run_in_background and the job-backed foreground path` | `tool/call`, `tool/result` | - | The pwsh tool is the PowerShell-dialect consumer of the bash executor seam for Windows compositions (a PowerShell executor such as `@deepseek-ai/dsh-pwsh-local` backs `ctx.shell`); it mirrors the bash tool call-for-call minus sandbox controls — `run_in_background` runs register with the generic `ctx.jobs` runtime and are collected/stopped through the `job_*` tools, and the managed `DSH_*` environment comes from `@deepseek-ai/dsh-shell-env`. Each call runs in a fresh process (no persistent PTY session), with native `C:\...` paths and `$env:NAME` variables. |
| `@deepseek-ai/dsh-tool-cordis` | `cordis_inspect_list`, `cordis_inspect_query` | `ctx.tools`, `ctx.cordisInspect` | `tool/call`, `tool/result` | - | Creator mode provides two read-only runtime inspection tools. The Cordis host runner supplies the inspection registry; Client queries require a connected page. Author persistent changes as bundles and install them with plugin_manager. |
| `@deepseek-ai/dsh-tool-cordis` | `cordis_inspect` | `ctx.tools`, `ctx.cordisInspect` | `tool/call`, `tool/result` | - | Standard and Creator modes provide one read-only runtime inspection tool. Omit query for the provider directory; pass query to inspect a declared method. The Cordis host runner supplies the inspection registry; Client queries require a connected page. Author persistent changes as bundles and install them with plugin_manager. |
| `@deepseek-ai/dsh-tool-bash-persistent` | `bash` | `ctx.workingDirectory`, `ctx.tools`, `ctx.terminals`, `an owning Agent at execution time` | `tool/call`, `PTY shell state`, `tool/result` | - | One owner-isolated persistent bash tool; deployment composition supplies the PTY backend and may override the model-facing environment description. |
| `@deepseek-ai/dsh-tool-pwsh-persistent` | `pwsh` | `ctx.workingDirectory`, `ctx.tools`, `ctx.terminals`, `an owning Agent at execution time` | `tool/call`, `PTY shell state`, `tool/result` | - | One owner-isolated persistent pwsh tool, the Windows counterpart of the persistent bash tool; deployment composition supplies a pwsh-dialect PTY backend and may override the model-facing environment description. |
| `@deepseek-ai/dsh-tool-str-replace-editor` | `str_replace_editor` | `ctx.tools`, `ctx.fs` | `tool/call`, `fs/observed after view presence/absence, edit absence, or successful mutation`, `tool/result` | - | Standalone view/create/unique literal replace/line insert tool over the filesystem seam; it composes with any shell or terminal API. |
@@ -623,7 +623,7 @@ ask_user_question keeps the original blocking behavior by default; set `mode: ti
### `run_code`
Execute a TypeScript program against the available tools. Takes two required arguments: `code`, the BODY of an async function (erasable syntax only; top-level `await` and `return` work), and `description`, a short summary of what the program does. Call tools as `await tools.name(args)` per the declarations in the system prompt. Show selected text and images with inspect(...values). The program is the body of an async TypeScript function; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level await and return are supported. Use inspect(...values) to display output. Do not use console. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy. 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.
Execute a TypeScript program against the available tools. Takes two required arguments: `code`, the BODY of an async function (erasable syntax only; top-level `await` and `return` work), and `description`, a short summary of what the program does. Call tools as `await tools.name(args)` per the declarations in the system prompt. Show selected text and images with inspect(...values). The program is the body of an async TypeScript function; only erasable syntax is accepted, with no enum or namespaces. Type annotations are advisory. Top-level await and return are 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. Each call runs in a fresh Node process. Node APIs are available through await import(...). Relative paths use the supplied working directory; process.env starts empty. Direct filesystem access follows this execution's sandbox policy. 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.
```json
{
@@ -945,58 +945,51 @@ The pwsh tool is the PowerShell-dialect consumer of the bash executor seam for W
## `@deepseek-ai/dsh-tool-cordis`
### `cordis_inspect_list`
### `cordis_inspect`
List every Cordis Inspect Provider currently known to the Host, including local Host Providers and the latest manifests synchronized from the Client. Each entry includes its platform, purpose, read-only methods, and input/output schemas. Call this Tool before writing or configuring a plugin, then select the provider and method for cordis_inspect_query from its result. Do not guess names or treat an Inspect method as a business Service that Plugin code can call.
```json
{
"type": "object",
"properties": {}
}
```
Source: [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts)
### `cordis_inspect_query`
Run a read-only query declared by an Inspect Provider. platform, provider, and method must come from cordis_inspect_list, and input must satisfy that method's schema. Use this Tool before writing plugin code to read exact Service methods, Event modes, plugin Config schemas, Tool schemas, theme tokens, or live Slot trees and props. Host queries run locally. A Client query waits for the first valid page response within the configured timeout; otherwise it reports a Client failure or asks you to reconnect and retry. This Tool cannot invoke business Service methods or modify the runtime.
Inspect runtime APIs before writing or configuring plugins. Omit query to discover providers, methods, and input schemas; then query an exact entry from that directory. Read-only: cannot invoke business Service methods or modify the runtime. Client queries require a connected page.
```json
{
"type": "object",
"properties": {
"platform": {
"type": "string",
"description": "Runtime platform that owns the Provider.",
"enum": [
"host",
"client"
"query": {
"type": "object",
"additionalProperties": false,
"properties": {
"platform": {
"type": "string",
"description": "Provider platform.",
"enum": [
"host",
"client"
]
},
"provider": {
"type": "string",
"description": "Provider ID from the directory."
},
"method": {
"type": "string",
"description": "Method name from the directory."
},
"input": {
"description": "Arguments matching the method's input schema."
}
},
"required": [
"platform",
"provider",
"method"
]
},
"provider": {
"type": "string",
"description": "Exact Provider ID returned by cordis_inspect_list."
},
"method": {
"type": "string",
"description": "Exact method name declared by the Provider manifest."
},
"input": {
"description": "Optional query input; it must satisfy the method input schema."
}
},
"required": [
"platform",
"provider",
"method"
]
}
}
```
Source: [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts)
Creator mode provides two read-only runtime inspection tools. The Cordis host runner supplies the inspection registry; Client queries require a connected page. Author persistent changes as bundles and install them with plugin_manager.
Standard and Creator modes provide one read-only runtime inspection tool. Omit query for the provider directory; pass query to inspect a declared method. The Cordis host runner supplies the inspection registry; Client queries require a connected page. Author persistent changes as bundles and install them with plugin_manager.
<a id="deepseek-aidsh-tool-bash-persistent"></a>
+34 -41
View File
@@ -31,7 +31,7 @@
| `@deepseek-ai/dsh-tool-office` | `office_convert`、`office_recalculate`、`office_render` | `ctx.workingDirectory`、`ctx.tools`、`ctx.fs`、`ctx.agents`、`ctx.officeKit`、`ctx.attachments and ctx.llm for office_render` | `tool/call`、`tool/result with rendered image attachments`、`temporary converted files in the Office kit output store` | - | Agent 成功加载 Office 技能后,从下一步起向其声明这些工具;上一次请求头已声明 Office 工具时继续保留。未安装 LibreOffice Kit 时,已声明工具的调用以 Office 服务的 unavailable 错误失败。 |
| `@deepseek-ai/dsh-tool-present` | `present` | `ctx.workingDirectory`、`ctx.tools`, `ctx.fs`, `ctx.agents` | `tool/call`, `deliverables/presented 在成功的最终结果之后`, `tool/result` | - | 交付归调用方 Session 所有;Web ui-deliverables 提供源文件打开与卡片。 |
| `@deepseek-ai/dsh-tool-pwsh` | `pwsh` | `ctx.workingDirectory`、`ctx.tools`、`ctx.shell`、`ctx.systemPrompt`、`ctx.shellEnv`、`ctx.jobs for run_in_background and the job-backed foreground path` | `tool/call`、`tool/result` | - | pwsh 工具是 Windows 组合中 bash 执行器 seam 的 PowerShell 方言消费方(由 `@deepseek-ai/dsh-pwsh-local` 等 PowerShell 执行器为 `ctx.shell` 提供后端);除沙箱接口外,它逐项对应 bash 工具调用。使用 `run_in_background` 的运行会注册到通用 `ctx.jobs` 运行时,并通过 `job_*` 工具收集/停止;托管的 `DSH_*` 环境来自 `@deepseek-ai/dsh-shell-env`。每次调用都在新进程中运行,不使用持久 PTY 会话。路径采用原生 `C:\...` 形式,变量采用 `$env:NAME`。 |
| `@deepseek-ai/dsh-tool-cordis` | `cordis_inspect_list`, `cordis_inspect_query` | `ctx.tools`, `ctx.cordisInspect` | `tool/call`, `tool/result` | - | 创造模式提供两个只读运行时检查工具。Cordis host runner 提供检查注册表;Client 查询需要已连接页面。持久化变更编写为组合包,再通过 plugin_manager 安装。 |
| `@deepseek-ai/dsh-tool-cordis` | `cordis_inspect` | `ctx.tools`, `ctx.cordisInspect` | `tool/call`, `tool/result` | - | 标准模式和创造模式提供一个只读运行时检查工具。省略 query 获取 provider 目录;传入 query 查询已声明的方法。Cordis host runner 提供检查注册表;Client 查询需要已连接页面。持久化变更编写为组合包,再通过 plugin_manager 安装。 |
| `@deepseek-ai/dsh-tool-bash-persistent` | `bash` | `ctx.workingDirectory`、`ctx.tools`、`ctx.terminals`、`an owning Agent at execution time` | `tool/call`、`PTY shell state`、`tool/result` | - | 一个按所有者隔离的持久 bash 工具;部署组合提供 PTY 后端,并可覆盖面向模型的环境描述。 |
| `@deepseek-ai/dsh-tool-pwsh-persistent` | `pwsh` | `ctx.workingDirectory`、`ctx.tools`、`ctx.terminals`、`an owning Agent at execution time` | `tool/call`、`PTY shell state`、`tool/result` | - | 一个按所有者隔离的持久 pwsh 工具,持久 bash 工具的 Windows 对应物;部署组合提供 pwsh 方言的 PTY 后端,并可覆盖面向模型的环境描述。 |
| `@deepseek-ai/dsh-tool-str-replace-editor` | `str_replace_editor` | `ctx.tools`、`ctx.fs` | `tool/call`、`fs/observed after view presence/absence, edit absence, or successful mutation`、`tool/result` | - | 基于文件系统 seam 的独立查看/创建/唯一字面量替换/按行插入工具;可与任何 shell 或终端接口组合。 |
@@ -627,7 +627,7 @@ ask_user_question 默认保持原有阻塞行为;设置 `mode: timed` 后才
### `run_code`
针对可用工具执行 TypeScript 程序。接受两个必填参数:`code`,异步函数的函数体(仅限可擦除语法,支持顶层 `await` 和 `return`);以及 `description`,简要说明程序做什么。请按系统提示词中的声明,以 `await tools.name(args)` 调用工具。使用 inspect(...values) 展示选定的文本和图片。程序是异步 TypeScript 函数的函数体,只接受可擦除语法,不支持 enum 或 namespace。类型标注只作提示。支持顶层 await 和 return。使用 inspect(...values) 展示输出。不要使用 console。每次调用在新的 Node 进程中运行,可通过 await import(...) 使用 Node API。相对路径以传入的工作目录为准;process.env 初始为空。直接文件系统访问遵循本次执行的沙箱策略。每个程序从 Session 的当前目录启动,运行中保留初始目录。沙箱提权只为本次完整程序执行授权。嵌套工具保留自身策略与审批。只有在获得拒绝证据后才请求更宽访问。先前效果可能已经发生,请在显式重试前检查。程序不会自动重放。
针对可用工具执行 TypeScript 程序。接受两个必填参数:`code`,异步函数的函数体(仅限可擦除语法,支持顶层 `await` 和 `return`);以及 `description`,简要说明程序做什么。请按系统提示词中的声明,以 `await tools.name(args)` 调用工具。使用 inspect(...values) 展示选定的文本和图片。程序是异步 TypeScript 函数的函数体,只接受可擦除语法,不支持 enum 或 namespace。类型标注只作提示。支持顶层 await 和 return。使用 inspect(...values) 展示输出。不要使用 console。模板字面量的 raw 形式只用于反斜杠必须原样保留的短文本,例如正则表达式;其他文本,尤其是文件内容和命令,用普通字符串书写。文件内容写成引号字符串数组,每行一个元素,用换行符拼接;不要写成一个模板字面量。每次调用在新的 Node 进程中运行,可通过 await import(...) 使用 Node API。相对路径以传入的工作目录为准;process.env 初始为空。直接文件系统访问遵循本次执行的沙箱策略。每个程序从 Session 的当前目录启动,运行中保留初始目录。沙箱提权只为本次完整程序执行授权。嵌套工具保留自身策略与审批。只有在获得拒绝证据后才请求更宽访问。先前效果可能已经发生,请在显式重试前检查。程序不会自动重放。
```json
{
@@ -949,58 +949,51 @@ pwsh 工具是 Windows 组合中 bash 执行器 seam 的 PowerShell 方言消费
## `@deepseek-ai/dsh-tool-cordis`
### `cordis_inspect_list`
### `cordis_inspect`
列出 Host 当前已知的所有 Cordis Inspect Provider,包括本地 Host Provider 和 Client 同步的最新清单。每项包含平台、用途、只读方法以及输入输出 schema。编写或配置插件前先调用本工具,再从结果选择 cordis_inspect_query 的 provider 和方法。不要猜测名称,也不要把 Inspect 方法当作插件代码可调用的业务 Service。
```json
{
"type": "object",
"properties": {}
}
```
来源: [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts)
### `cordis_inspect_query`
执行 Inspect Provider 声明的只读查询。platform、provider 和 method 必须来自 cordis_inspect_list,input 必须符合该方法的 schema。编写插件代码前,用本工具读取准确的 Service 方法、Event 模式、插件 Config schema、Tool schema、主题 token,或实时 Slot 树与 props。Host 查询在本地运行。Client 查询在配置的超时内等待页面首个有效响应;否则返回 Client 错误,或提示重新连接后重试。本工具不能调用业务 Service 方法或修改运行时。
编写或配置插件前查询运行时 API。省略 query 以发现 provider、方法和输入 schema,再查询该目录中的具体条目。只读:不能调用业务 Service 方法或修改运行时。Client 查询需要已连接的页面。
```json
{
"type": "object",
"properties": {
"platform": {
"type": "string",
"description": "Runtime platform that owns the Provider.",
"enum": [
"host",
"client"
"query": {
"type": "object",
"additionalProperties": false,
"properties": {
"platform": {
"type": "string",
"description": "Provider platform.",
"enum": [
"host",
"client"
]
},
"provider": {
"type": "string",
"description": "Provider ID from the directory."
},
"method": {
"type": "string",
"description": "Method name from the directory."
},
"input": {
"description": "Arguments matching the method's input schema."
}
},
"required": [
"platform",
"provider",
"method"
]
},
"provider": {
"type": "string",
"description": "Exact Provider ID returned by cordis_inspect_list."
},
"method": {
"type": "string",
"description": "Exact method name declared by the Provider manifest."
},
"input": {
"description": "Optional query input; it must satisfy the method input schema."
}
},
"required": [
"platform",
"provider",
"method"
]
}
}
```
来源: [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts)
创造模式提供两个只读运行时检查工具。Cordis host runner 提供检查注册表;Client 查询需要已连接页面。持久化变更编写为组合包,再通过 plugin_manager 安装。
标准模式和创造模式提供一个只读运行时检查工具。省略 query 获取 provider 目录;传入 query 查询已声明的方法。Cordis host runner 提供检查注册表;Client 查询需要已连接页面。持久化变更编写为组合包,再通过 plugin_manager 安装。
<a id="deepseek-aidsh-tool-bash-persistent"></a>
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.3/cordis-inspect-tool/guide.md
/:
en: 74fcdcd04d1f4a09
zh: 29f3fd6a4996f748
/use-one-cordis-inspection-tool:
en: da2e5b8ded13d6ad
zh: 67d4ae724c7561e2
/use-one-cordis-inspection-tool/change:
en: 4ba772b8a87ad4bd
zh: a50b3c0739a68b67
/use-one-cordis-inspection-tool/migration:
en: c10ebe52b24af1e2
zh: be4ba383eb213057
@@ -0,0 +1,18 @@
---
kind: upgrade-guide
description: "The cordis_inspect tool replaces cordis_inspect_list and cordis_inspect_query."
---
# Use one Cordis inspection tool
English | [中文](guide.zh.md)
## Change
`cordis_inspect` replaces `cordis_inspect_list` and `cordis_inspect_query`. Custom prompts, skills, and tool callers that name either old tool must use the new name and arguments. An omitted `query` returns the provider directory; a supplied `query` selects a provider method.
## Migration
1. Replace `cordis_inspect_list({})` calls with `cordis_inspect({})`.
2. Replace `cordis_inspect_query({ platform, provider, method, input })` calls with `cordis_inspect({ query: { platform, provider, method, input } })`. Keep `platform`, `provider`, and `method` inside `query`; `input` remains optional.
3. Confirm that `cordis_inspect({})` returns a provider directory. Select a provider and method from that directory, supply arguments matching its input schema under `query.input`, and confirm that the query returns the requested data. Client queries require a connected page.
@@ -0,0 +1,18 @@
---
kind: upgrade-guide
description: "cordis_inspect 工具替代 cordis_inspect_list 和 cordis_inspect_query。"
---
# 使用单个 Cordis 检查工具
[English](guide.md) | 中文
## 变更
`cordis_inspect` 替代 `cordis_inspect_list` 和 `cordis_inspect_query`。引用任一旧工具名称的自定义提示词、skill(技能)和工具调用方必须使用新名称及参数。省略 `query` 时返回 provider 目录;提供 `query` 时选择 provider 方法。
## 迁移
1. 将 `cordis_inspect_list({})` 调用替换为 `cordis_inspect({})`。
2. 将 `cordis_inspect_query({ platform, provider, method, input })` 调用替换为 `cordis_inspect({ query: { platform, provider, method, input } })`。将 `platform`、`provider` 和 `method` 放在 `query` 内;`input` 仍为可选参数。
3. 确认 `cordis_inspect({})` 返回 provider 目录。从该目录中选择 provider 和方法,在 `query.input` 下提供符合其输入 schema 的参数,并确认查询返回所请求的数据。Client 查询需要已连接的页面。
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.3/profile-context-overlay-paths/guide.md
/:
en: c4ef1e7d8d298290
zh: 31b78ba3894af10c
/read-command-line-overlays-from-their-files:
en: bfab1724009b36aa
zh: 103463ee47fbdafc
/read-command-line-overlays-from-their-files/change:
en: 8abc69fc8b12c36e
zh: 89856745d785a697
/read-command-line-overlays-from-their-files/migration:
en: 87ea30b7ee93ef13
zh: 898cfde6b53f8248
@@ -0,0 +1,18 @@
---
kind: upgrade-guide
description: "ProfileContext replaces parsed overlays with overlay file paths that every composition rereads."
---
# Read command-line overlays from their files
English | [中文](guide.zh.md)
## Change
`ProfileContext` from `@deepseek-ai/dsh-app-boot`, provided as `ctx.profileContext`, no longer has `overlays: readonly PatchOptions[]`. It now carries `overlayPaths: readonly string[]`: the absolute `--patch` file paths in argv order. `readProfilePatches()` reads those files on each call, so it returns current overlay contents and throws while an overlay file is missing or invalid. With `dsh-hmr` enabled, editing a `--patch` file recomposes the running profile. Plugins that read `profileContext.overlays` and launchers or tests that construct a `ProfileContext` are affected.
## Migration
1. Replace reads of `ctx.profileContext.overlays` with `ctx.profileContext.overlayPaths.flatMap(path => loadOverlayPatches(binName, path))`, which returns the same overlay layer. Call `readProfilePatches(binName, ctx.profileContext)` only when you need the full composition of bundle, profile, home, and overlay layers.
2. Where code constructs a `ProfileContext`, replace `overlays: [...]` with `overlayPaths: [...]`. Write any in-memory overlay rows to a patch file first and pass its absolute path.
3. Confirm the migration by running your type checker: no `overlays` property remains on `ProfileContext` values.
@@ -0,0 +1,18 @@
---
kind: upgrade-guide
description: "ProfileContext 以 overlay 文件路径取代已解析的 overlay,每次组合都会重新读取这些文件。"
---
# 从文件读取命令行 overlay
[English](guide.md) | 中文
## 变更
`@deepseek-ai/dsh-app-boot` 的 `ProfileContext`(以 `ctx.profileContext` 提供)不再包含 `overlays: readonly PatchOptions[]`,改为 `overlayPaths: readonly string[]`:按命令行顺序排列的 `--patch` 文件绝对路径。`readProfilePatches()` 每次调用都会读取这些文件,因此返回当前的 overlay 内容,并在 overlay 文件缺失或无效时抛出异常。启用 `dsh-hmr` 时,编辑 `--patch` 文件会重新组合运行中的 profile。读取 `profileContext.overlays` 的插件,以及构造 `ProfileContext` 的启动器或测试会受到影响。
## 迁移
1. 将对 `ctx.profileContext.overlays` 的读取替换为 `ctx.profileContext.overlayPaths.flatMap(path => loadOverlayPatches(binName, path))`,它返回相同的 overlay 层。只有需要 bundle、profile、home 与 overlay 各层的完整组合结果时,才调用 `readProfilePatches(binName, ctx.profileContext)`。
2. 在构造 `ProfileContext` 的代码中,将 `overlays: [...]` 替换为 `overlayPaths: [...]`。内存中的 overlay 行需先写入 patch 文件,再传入该文件的绝对路径。
3. 运行类型检查确认迁移完成:`ProfileContext` 值上不再存在 `overlays` 属性。
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.3/ptc-mcp-image-values/guide.md
/:
en: 4ef7bb2332b41c50
zh: 64dc0fee94ec109f
/admitted-mcp-image-blocks-become-ptc-image-values:
en: d6de4dbd1d9e5b97
zh: abfc0e17251123b4
/admitted-mcp-image-blocks-become-ptc-image-values/change:
en: 49c1de6568812254
zh: e33b028fb5369be3
/admitted-mcp-image-blocks-become-ptc-image-values/migration:
en: 7015ecfe11765993
zh: 677267091fa5458a
@@ -0,0 +1,30 @@
---
kind: upgrade-guide
description: "Admitted MCP image blocks carry an attachment reference and reach PTC programs as Image values instead of base64 JSON."
---
# Admitted MCP image blocks become PTC `Image` values
English | [中文](guide.zh.md)
## Change
An MCP tool result keeps its canonical `{ content, structuredContent? }` value. Each image block admitted to durable model context now also carries an `attachment` reference beside its original `type`, `mimeType`, and `data` fields. Refused images keep their original fields only.
In PTC mode, each value entry of the form `{ type: 'image', attachment }` whose attachment appears in the finalized tool result becomes an `Image`, the same value that `read_image` and CUA screenshots return. Previously, the program received the base64 image block, so `inspect(result)` printed the base64 data, and the complete result content, text and pictures, was attached automatically as additional model context. Now `inspect` shows the picture, and the result's text and pictures enter the conversation only when the program inspects them, as for native CUA screenshots. When the value does not reference every image of the final result, or the program cannot read an image file, the program receives the raw blocks and the complete result content is still attached automatically, as before. Image blocks that an output policy removed keep their `attachment` field but stay JSON.
This affects PTC programs that read `data` or `mimeType` from an admitted MCP image block or rely on the automatic attachment of its result text, and code that compares MCP tool values with the raw server result.
## Migration
1. In PTC programs, inspect the `Image` and any result text the model needs, or read the image file through `path`:
```js
const result = await tools.mcp__server__screenshot({});
const image = result.content.find(block => block instanceof Image);
inspect(image);
```
2. Where a program needs the bytes, read `image.path` instead of decoding `data`.
3. In code that compares MCP tool values with the server result, allow the added `attachment` field on admitted image blocks.
4. Run the example with a model route that accepts image input. Confirm that the `run_code` result contains the picture and no base64 text.
@@ -0,0 +1,30 @@
---
kind: upgrade-guide
description: "已接受的 MCP 图片块携带附件引用,并以 Image 值而非 base64 JSON 传给 PTC 程序。"
---
# 已接受的 MCP 图片块成为 PTC `Image` 值
[English](guide.md) | 中文
## 变更
MCP 工具结果保留其规范值 `{ content, structuredContent? }`。每个进入持久模型上下文的图片块现在除原有的 `type`、`mimeType` 和 `data` 字段外,还携带 `attachment` 引用。被拒绝的图片仅保留原有字段。
在 PTC 模式下,形如 `{ type: 'image', attachment }` 且其附件出现在最终工具结果中的每个值条目都会变为 `Image`,与 `read_image` 和 CUA 截图返回的值相同。此前,程序收到的是 base64 图片块,因此 `inspect(result)` 输出 base64 数据,包括文本与图片在内的完整结果内容则自动作为额外模型上下文附加。现在 `inspect` 展示图片,且结果的文本与图片仅在程序 inspect 时进入对话,与原生 CUA 截图相同。返回值未引用最终结果中的每张图片,或程序无法读取某个图片文件时,程序接收原始块,完整的结果内容仍与此前一样自动附加。被输出策略移除的图片块保留 `attachment` 字段,但仍为 JSON。
从已接受的 MCP 图片块读取 `data` 或 `mimeType`、或依赖其结果文本自动附加的 PTC 程序,以及将 MCP 工具值与服务器原始结果比较的代码会受到影响。
## 迁移
1. 在 PTC 程序中,inspect `Image` 以及模型需要的结果文本,或通过 `path` 读取图片文件:
```js
const result = await tools.mcp__server__screenshot({});
const image = result.content.find(block => block instanceof Image);
inspect(image);
```
2. 程序需要字节数据时,读取 `image.path`,不要解码 `data`。
3. 在将 MCP 工具值与服务器结果比较的代码中,允许已接受图片块上新增的 `attachment` 字段。
4. 使用接受图片输入的模型路由运行上面的示例。确认 `run_code` 结果包含图片且不含 base64 文本。
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.3/ptc-tool-result-inspection/guide.md
/:
en: 31e27f1eb83f9740
zh: 85c7c3637222f1d8
/ptc-tool-result-inspection-and-bootstrap-protocol-4:
en: 2509c4fe8d208eb8
zh: 5f5dfd41fd29cd55
/ptc-tool-result-inspection-and-bootstrap-protocol-4/change:
en: a374fea86e00efb1
zh: fa50515f25ef048e
/ptc-tool-result-inspection-and-bootstrap-protocol-4/migration:
en: bfb868b271b5113d
zh: 597c95d985891d43
@@ -0,0 +1,34 @@
---
kind: upgrade-guide
description: "Direct inspection of unchanged PTC object and array tool results uses tool-rendered text, and custom Node bootstraps require protocol 4."
---
# PTC tool-result inspection and bootstrap protocol 4
English | [中文](guide.zh.md)
## Change
PTC tools keep their declared JSON return values. With or without inspection metadata, field access, copying, and JSON serialization operate on the original data; the host-only descriptor is not exposed to the program. Previously, `inspect(result)` formatted an object or array with Node's generic object formatter. It now displays the tool's final rendered text when the original result is unchanged and its output contains only text. The text includes completed output-policy changes; inspection neither reruns the tool nor calls `output.render` again. Log-only replacements do not affect it.
Non-empty associated text occupies a separate output group. `inspect('result:', result, 'done')` emits the label and a newline, then the tool text, followed by `done` in another group. Ordinary values in one group remain space-separated.
Field selections, copies, modified results, and results nested inside another value still use generic formatting. Scalar results, Images, and mixed text/image outputs keep their behavior. This affects programs and checks that depend on the exact text produced by inspecting a complete tool result. Inspectable containers may retain Image fields: direct inspection shows the supplied text; inspect the image field separately to display it.
The Node bootstrap protocol changes from 3 to 4. `HostMethods.invoke` replies now use `{ value: flatWire, inspection?: string }`. Custom `launch.bootstrapPath` deployments must update their bootstrap; the bundled bootstrap updates with the host.
## Migration
1. Keep `inspect(result)` to display the tool's rendered text. To display an object's structure, inspect a copy or selected fields:
```js
const result = await tools.read({ file_path: "README.md" });
inspect(result);
inspect({ ...result });
inspect(result.lines);
```
2. For an array result, use `inspect([...result])` to display its elements with generic formatting. Update any expected output that relied on the previous full-result object formatting.
3. If you implement a third-party `PtcRuntime`, recognize `PtcInspectableValue` binding results from `@deepseek-ai/dsh-ptc-runtime`. Deliver `.value` as the program's object or array, and associate `.text` with that unchanged value for direct `inspect`. Do not expose the wrapper or add inspection metadata to program fields.
4. If you configure `launch.bootstrapPath`, deploy the matching `@deepseek-ai/dsh-ptc-runtime-node` bootstrap and its dependencies in that execution environment. Use the package's built `lib/process.js`, or `lib/persistent-process.js` for a REPL default. A custom protocol implementation must handle the new reply envelope as well as announce protocol 4; changing the version alone is insufficient.
5. Run the example above. Confirm that the first inspection shows the tool's rendered file text, while the other two show object and array data. For a custom provider, also confirm that field access and `JSON.stringify(result)` use the original data. For a custom bootstrap, confirm that a PTC program starts without a protocol-mismatch error.
@@ -0,0 +1,34 @@
---
kind: upgrade-guide
description: "直接展示未修改的 PTC 工具对象和数组结果时使用工具渲染文本,自定义 Node bootstrap 须升级到协议 4。"
---
# PTC 工具结果展示与 bootstrap 协议 4
[English](guide.md) | 中文
## 变更
PTC 工具保留声明的 JSON 返回值。无论是否附带展示元数据,字段访问、拷贝和 JSON 序列化都操作原有数据;只供宿主使用的描述符不会暴露给程序。此前,`inspect(result)` 使用 Node 的通用对象格式展示对象或数组。现在,原结果未被修改且其输出仅包含文本时,会展示工具最终渲染的文本。该文本包含已完成的输出策略修改;展示不会重新运行工具或再次调用 `output.render`。仅针对日志的替换不影响此文本。
非空的关联文本独占一个输出组。执行 `inspect('result:', result, 'done')` 时,先输出标签并换行,再输出工具文本,随后另起一组输出 `done`。同组普通值仍以空格分隔。
字段选择、拷贝、修改后的结果,以及嵌套在其他值中的结果,仍使用通用格式。标量结果、Image 和混合文本与图片的输出保持原有行为。依赖完整工具结果展示文本的程序和检查会受到影响。可展示的容器可以保留 Image 字段:直接展示容器时输出附带文本;单独展示图片字段时输出该图片。
Node bootstrap 协议从 3 升至 4。`HostMethods.invoke` 的回复现在使用 `{ value: flatWire, inspection?: string }`。自定义 `launch.bootstrapPath` 部署必须更新 bootstrap;内置 bootstrap 随宿主一同更新。
## 迁移
1. 保留 `inspect(result)` 可展示工具渲染的文本。如需展示对象结构,改为展示拷贝或选定字段:
```js
const result = await tools.read({ file_path: "README.md" });
inspect(result);
inspect({ ...result });
inspect(result.lines);
```
2. 对数组结果,使用 `inspect([...result])` 以通用格式展示元素。更新依赖此前完整结果对象格式的预期输出。
3. 如果实现了第三方 `PtcRuntime`,请识别绑定返回的 `@deepseek-ai/dsh-ptc-runtime` 包中的 `PtcInspectableValue`。将 `.value` 作为程序的对象或数组,并为该未修改的原值关联 `.text`,供直接 `inspect` 使用。不要暴露包装对象,也不要向程序字段添加展示元数据。
4. 如果配置了 `launch.bootstrapPath`,请在执行环境中部署匹配版本的 `@deepseek-ai/dsh-ptc-runtime-node` bootstrap 及其依赖。使用包内构建产物 `lib/process.js`,或默认采用 REPL 的 `lib/persistent-process.js`。自定义协议实现必须处理新的回复信封并声明协议 4;只改版本号并不足够。
5. 运行上面的示例。确认第一次展示工具渲染的文件文本,后两次分别展示对象和数组数据。对于自定义提供方,还须确认字段访问和 `JSON.stringify(result)` 使用原有数据。对于自定义 bootstrap,确认 PTC 程序启动时不再报告协议不匹配。
@@ -3,8 +3,8 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/user/develop/practice/dynamic-cordis.md
/configure-persistent-plugins-from-a-prompt:
en: d50e336357663f75
zh: 4364e91403387e2a
en: e61e42a805142826
zh: da51aa93305f2a3c
/configure-persistent-plugins-from-a-prompt/connect-an-mcp-server:
en: f9fefda94ba8a005
zh: f1a9a977a0732fc0
Loaded 100 of 602 files, more files were not shown because too many files have changed in this diff. Show more