Merge master and refresh tool catalog pairing record
This commit is contained in:
commit
b8642db2bc
374 files changed
+13807
-8683
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
# Bilingual-pair consistency record for 2026-11-06-connector-account-registry.md (docs/i18n/README.md): per heading
|
||||
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-06-connector-account-registry.md
|
||||
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts:
|
||||
en: 3950421fb526f6b7
|
||||
zh: 47c5f6cc4b735058
|
||||
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/problem:
|
||||
en: 2a7b59cd509a0b9a
|
||||
zh: 38130ce17829342d
|
||||
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/decision:
|
||||
en: d96b43106a1ba837
|
||||
zh: 97bc8f9436ec07d0
|
||||
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/alternatives-considered:
|
||||
en: ee0aa3f9ea40ef15
|
||||
zh: fded69a6dcc8ca87
|
||||
/agent-note-one-host-registry-and-one-browser-half-for-connector-accounts/consequences:
|
||||
en: 5228f32becfbdec3
|
||||
zh: 013f1073e70d46f7
|
||||
@@ -0,0 +1,42 @@
|
||||
# Agent Note: One Host registry and one browser half for connector accounts
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-06-connector-account-registry.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Connector plugins show an account section on the Plugins page. CLI app plugins keep the account in their vendor CLI; MCP connectors keep an OAuth grant through the MCP manager. Both kinds need the same surfaces: a bundle's section, title tag, and activation prompt, a confirmation before an action that changes the account outside DSH, and a notice in the browser that started the operation. A client plugin cannot share runtime code with another feature plugin ([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) rule 3), so one browser half per connector kind duplicates the same code and lets the copies drift. When the browser decides an account's state or relays an identifier from one Remote to another, the Host can no longer run the flow without the browser.
|
||||
|
||||
## Decision
|
||||
|
||||
[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.md) provides one Host registry, `ctx.connectorAccounts`, one `connectorAccounts` Remote, and one browser half for every connector kind.
|
||||
|
||||
| Part | Contract |
|
||||
|---|---|
|
||||
| Registration | `register({ key, packageName?, source, operations, copy, present })` returns the disposer that withdraws the account |
|
||||
| Key | Unique among registered accounts and independent of the package, so an account that no bundle owns, such as a server configured in Settings, registers too |
|
||||
| Package | Decides which bundle page carries the section and tag; a package carries at most one account |
|
||||
| Source | The registrant's account: `snapshot`, `observe`, `refresh`, `start`, and `cancel` |
|
||||
| Display | `present(view)` on the Host gives the phase, status text, title tag, buttons and their commands, confirmations, failure, and the operation the activation prompt starts |
|
||||
| Remote | `watch`, plus `start(key, operation)` and `cancel(key, id)`, which route by key to the account's source |
|
||||
|
||||
The Host decides everything except opening the authorization page. The browser never learns how an account connects: it receives only the display, the operation in progress with its authorization page, and the latest result with its success text. The browser half keeps only what belongs to one browser: the operations it started, so their authorization pages open and their success is reported only there; the latest notice; and whether its stream is delivering. Buttons call `start` and `cancel` on the Remote themselves, and each surface keeps its own pending state.
|
||||
|
||||
The page registers one title tag entry and one notice entry. It also registers a section and an activation prompt for each account that names a package, because those two slots are keyed by package.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
**Two registries behind one browser half.** Rejected: the browser would follow both Remotes and choose which one each button calls, which relays between Host services again, and the two Host registries would hold the same code.
|
||||
|
||||
**One browser half per connector kind.** Rejected: client plugins cannot import each other's values, so the shared surfaces would be written twice and diverge.
|
||||
|
||||
**Share the browser half through `PLATFORM_MODULES` or a browser-side service.** Rejected: the module table is reserved for shell-seeded and static infrastructure libraries, and a browser-side service would keep the registrations in the browser, which only repeat what the Host knows.
|
||||
|
||||
**Let the browser derive an account's phase and actions from the registrant's raw state.** Rejected: the rules for which actions apply would live where the Host cannot test or run them, and the browser would need the registrant's own Remote.
|
||||
|
||||
## Consequences
|
||||
|
||||
The registry and browser half exist once. A new connector kind writes a source and `present` on the Host and needs no browser code. The account rules live beside the services that own them, and the Host can run every operation without a browser.
|
||||
|
||||
Registrants map their account states onto five phases (checking, connecting, connected, disconnected, unavailable); a state outside them shows through its status text and detail. The Web and Desktop compositions load the registry whether or not a connector plugin is installed. An authorization page that opens after the start call answers can be blocked by the browser; the section's open button shows it again.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Agent Note:连接器账号使用一个 Host 注册表和一个浏览器一半
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-06-connector-account-registry.md) | 中文
|
||||
|
||||
## 问题
|
||||
|
||||
连接器插件会在插件页显示账号区块。CLI 应用插件的账号保存在厂商 CLI 中;MCP 连接器通过 MCP 管理器保存 OAuth 授权。两类插件需要同样的界面:插件包的区块、标题旁标签和开启引导,在会改变 DSH 之外账号状态的操作前确认,以及只在发起操作的浏览器中显示的提示。客户端插件不能与其他功能插件共享运行时代码([packages/client/AGENTS.md](../../../../packages/client/AGENTS.md) 第 3 条),因此每类连接器各有一个浏览器一半,就会把同样的代码写两遍,副本还会逐渐不一致。如果由浏览器决定账号状态,或在两个 Remote 之间转发标识,Host 就无法在没有浏览器的情况下完成流程。
|
||||
|
||||
## 决定
|
||||
|
||||
[`@deepseek-ai/dsh-client-ui-connector-account`](../../../../packages/client/ui-connector-account/README.zh.md) 为所有连接器类型提供一个 Host 注册表 `ctx.connectorAccounts`、一个 `connectorAccounts` Remote 和一个浏览器一半。
|
||||
|
||||
| 部分 | 约定 |
|
||||
|---|---|
|
||||
| 注册 | `register({ key, packageName?, source, operations, copy, present })` 返回撤下账号的销毁函数 |
|
||||
| 键 | 在已注册账号中唯一,且与包无关,因此没有插件包承载的账号(如在 Settings 中配置的服务器)也能注册 |
|
||||
| 包 | 决定由哪个插件包页面承载区块和标签;一个包最多承载一个账号 |
|
||||
| 来源 | 注册方的账号:`snapshot`、`observe`、`refresh`、`start` 和 `cancel` |
|
||||
| 展示 | Host 上的 `present(view)` 给出阶段、状态文字、标题旁标签、按钮及其命令、确认、失败信息,以及开启引导启动的操作 |
|
||||
| Remote | `watch`,以及按键路由到账号来源的 `start(key, operation)` 和 `cancel(key, id)` |
|
||||
|
||||
除了打开授权页,其余都由 Host 决定。浏览器不知道账号如何连接:它只收到展示内容、进行中的操作及其授权页,以及带成功文本的最新结果。浏览器一半只保存属于本浏览器的东西:它发起的操作(授权页只在这里打开,成功只在这里报告)、最新提示,以及它的流是否在推送。按钮自己调用 Remote 的 `start` 和 `cancel`,每个界面自己保存未完成状态。
|
||||
|
||||
页面只注册一个标题旁标签条目和一个提示条目;对每个带包名的账号,再注册一个区块和一个开启引导,因为这两个插槽以包为键。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
**一个浏览器一半背后有两个注册表。** 否决:浏览器要同时跟随两个 Remote,并为每个按钮选择调用哪一个,这又是在 Host 服务之间转发;两个 Host 注册表的代码也会相同。
|
||||
|
||||
**每类连接器各有一个浏览器一半。** 否决:客户端插件不能导入彼此的值,共用界面就要写两遍,并逐渐不一致。
|
||||
|
||||
**通过 `PLATFORM_MODULES` 或浏览器端服务共享浏览器一半。** 否决:模块表只留给由 shell 预置的基础设施和静态库;浏览器端服务会把注册留在浏览器中,而这些注册只是重复 Host 已知的信息。
|
||||
|
||||
**由浏览器根据注册方的原始状态推算账号阶段和操作。** 否决:哪些操作可用的规则会放在 Host 无法测试和执行的地方,浏览器还需要注册方自己的 Remote。
|
||||
|
||||
## 后果
|
||||
|
||||
注册表和浏览器一半只有一份。新的连接器类型只需在 Host 上编写来源和 `present`,不需要浏览器代码。账号规则与拥有它们的服务在一起,Host 不依赖浏览器就能执行每个操作。
|
||||
|
||||
注册方需要把账号状态映射到五个阶段(检查中、连接中、已连接、未连接、不可用);超出这些阶段的状态通过状态文字和说明表达。无论是否安装了连接器插件,Web 与桌面端组合都会加载注册表。启动调用返回后才打开的授权页可能被浏览器拦截;区块中的打开按钮可以再次打开它。
|
||||
@@ -9,11 +9,11 @@
|
||||
en: c389c332bdadbbe4
|
||||
zh: 217520278ccf0932
|
||||
/agent-note-unambiguous-tool-argument-compatibility/decision:
|
||||
en: 71c04efcfd972b02
|
||||
zh: d1f842920b1b0e3f
|
||||
en: c6ac657b3875c95f
|
||||
zh: 7b0a4cca7baafd03
|
||||
/agent-note-unambiguous-tool-argument-compatibility/alternatives-considered:
|
||||
en: b2a96695819a978f
|
||||
zh: c6f84b244be0dddf
|
||||
/agent-note-unambiguous-tool-argument-compatibility/consequences:
|
||||
en: bd24ad737c617c90
|
||||
zh: dbb7fa67c41af828
|
||||
en: 7d21da549466232c
|
||||
zh: a373e135f79c5423
|
||||
@@ -10,7 +10,7 @@ Models can populate optional fields that do not affect the requested operation.
|
||||
|
||||
## Decision
|
||||
|
||||
`grep` treats an exact empty `include` as omitted. Whitespace-only, negated, and comma-separated filters remain invalid. `update_goal` uses replacement fields only for `edit` and a blocker reason only for `blocked`; other actions ignore those known fields. Declared types, consumed values, authority, and exact revisions remain validated. Ignored fields never reach another goal operation or change unrelated state, and call summaries select only values used by the action. `write` and `edit` allow absent or blank justification when no sandbox mode is requested or the effective mode is repeated; actual widening retains its reason and approval requirements, and filesystem observation and denial checks remain active.
|
||||
`grep` treats an exact empty `include` as omitted. Whitespace-only, negated, and comma-separated filters remain invalid. `update_goal` uses replacement fields only for `edit` and a blocker reason only for `blocked`; other actions ignore those known fields. Declared types, consumed values, authority, and exact revisions remain validated. Ignored fields never reach another goal operation or change unrelated state, and call summaries select only values used by the action. `write` and `edit` allow absent or blank justification when no sandbox mode is requested or the effective mode is repeated; actual widening retains its reason and approval requirements, and filesystem observation and denial checks remain active. `subagent` and `list_subagent_models` treat an exact empty `provider`, `model`, or `reasoning_effort` as omitted; an empty subagent `name` remains invalid because its error states the accepted format.
|
||||
|
||||
This partially supersedes the unused-field rejection in the [goal-tool decision](../feature/2026-07-19-model-facing-goal-tools.md). Its authority, lifecycle, scheduling, and persistence decisions remain active. The rules apply to every provider and stay inside the owning tool rather than weakening its underlying service.
|
||||
|
||||
@@ -22,4 +22,4 @@ This partially supersedes the unused-field rejection in the [goal-tool decision]
|
||||
|
||||
## Consequences
|
||||
|
||||
The tools accept these calls without extra mutations. Unit tests cover ignored fields for every goal action, consumed-field and authority failures, stale revisions, filter validation, and real search results. A headless recorded-session scenario verifies both file extensions are searched and completion preserves the original objective and round cap. These rules give up detecting conflicting intent expressed only in inactive goal fields; they do not weaken authorization or establish a generic coercion policy.
|
||||
The tools accept these calls without extra mutations. Unit tests cover ignored fields for every goal action, consumed-field and authority failures, stale revisions, filter validation, and real search results. A headless recorded-session scenario verifies both file extensions are searched and completion preserves the original objective and round cap. An SDK recorded-session scenario verifies that empty route fields start a subagent on its default route. These rules give up detecting conflicting intent expressed only in inactive goal fields; they do not weaken authorization or establish a generic coercion policy.
|
||||
@@ -10,7 +10,7 @@ Status: implemented
|
||||
|
||||
## 决策
|
||||
|
||||
`grep` 将值恰好为空字符串的 `include` 视为省略。仅含空白、否定形式和逗号分隔的过滤器仍然无效。`update_goal` 仅在 `edit` 时使用替换字段,仅在 `blocked` 时使用阻塞原因;其他 action 忽略这些已知字段。声明的类型、实际使用的值、权限和精确修订号仍会校验。被忽略的字段不会传入另一种目标操作,也不会改变无关状态;调用摘要仅选择当前 action 使用的值。未请求沙箱模式或重复当前生效模式时,`write` 和 `edit` 允许省略理由或提供空白理由;真正升权仍需理由和审批,文件系统观察与拒绝检查继续生效。
|
||||
`grep` 将值恰好为空字符串的 `include` 视为省略。仅含空白、否定形式和逗号分隔的过滤器仍然无效。`update_goal` 仅在 `edit` 时使用替换字段,仅在 `blocked` 时使用阻塞原因;其他 action 忽略这些已知字段。声明的类型、实际使用的值、权限和精确修订号仍会校验。被忽略的字段不会传入另一种目标操作,也不会改变无关状态;调用摘要仅选择当前 action 使用的值。未请求沙箱模式或重复当前生效模式时,`write` 和 `edit` 允许省略理由或提供空白理由;真正升权仍需理由和审批,文件系统观察与拒绝检查继续生效。`subagent` 和 `list_subagent_models` 将值恰好为空字符串的 `provider`、`model` 或 `reasoning_effort` 视为省略;空的 subagent `name` 仍然无效,因为其报错会说明可接受的格式。
|
||||
|
||||
本决策部分取代[目标工具决策](../feature/2026-07-19-model-facing-goal-tools.zh.md)中对无关字段的拒绝规则。其权限、生命周期、调度和持久化决策继续生效。这些规则适用于所有提供方,并保留在所属工具内,不削弱底层服务的校验。
|
||||
|
||||
@@ -22,4 +22,4 @@ Status: implemented
|
||||
|
||||
## 后果
|
||||
|
||||
工具接受这些调用,且不会产生额外变更。单元测试覆盖每种目标 action 对无关字段的忽略、有效字段与权限失败、陈旧修订号、过滤器校验以及真实搜索结果。headless 会话回放验证两种扩展名的文件都参与搜索,并且完成操作保留原始目标和轮数上限。这些规则放弃检测仅由非当前 action 的目标字段表达的冲突意图;它们不削弱授权,也不建立通用类型转换策略。
|
||||
工具接受这些调用,且不会产生额外变更。单元测试覆盖每种目标 action 对无关字段的忽略、有效字段与权限失败、陈旧修订号、过滤器校验以及真实搜索结果。headless 会话回放验证两种扩展名的文件都参与搜索,并且完成操作保留原始目标和轮数上限。SDK 会话回放验证空路由字段会让 subagent 按默认路由启动。这些规则放弃检测仅由非当前 action 的目标字段表达的冲突意图;它们不削弱授权,也不建立通用类型转换策略。
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
# Bilingual-pair consistency record for 2026-11-13-draft-attachments-across-session-switches.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/bug-fix/2026-11-13-draft-attachments-across-session-switches.md
|
||||
/agent-note-draft-attachments-across-session-switches:
|
||||
en: 2a1645c8c80d6dff
|
||||
zh: 59277c3754231479
|
||||
/agent-note-draft-attachments-across-session-switches/problem:
|
||||
en: 3f4030763e1f0105
|
||||
zh: c8a0bc5641d7bed4
|
||||
/agent-note-draft-attachments-across-session-switches/decision:
|
||||
en: 40697e88c2ed6ca8
|
||||
zh: eeb363374b25c3a2
|
||||
/agent-note-draft-attachments-across-session-switches/alternatives-considered:
|
||||
en: 2c43ad479f4a3577
|
||||
zh: 07743f45870eb0fe
|
||||
/agent-note-draft-attachments-across-session-switches/consequences:
|
||||
en: 6ac6defa552ea040
|
||||
zh: aa64a3c3e54dbebc
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Agent Note: Draft attachments across Session switches
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-13-draft-attachments-across-session-switches.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Switching to another Session and back emptied the composer's attachment rail while its text survived (issue #5070). The Session scope disposer released every attachment the retiring composer held and revoked image previews, and nothing could rebuild them.
|
||||
|
||||
## Decision
|
||||
|
||||
**The Conversation service keeps every draft attachment across a switch.** `ConversationController` records which Session owns each draft attachment. A message the Host accepts leaves that ownership at once, while the registry keeps its attachments until the echo settles them. A retiring composer releases its attachments only when its Session was removed or a message or command was already submitted, because the Client cannot tell whether a submitted command consumed them; an aborted slash-line adjudication keeps them. Otherwise they stay registered, an active upload keeps running, a failed upload keeps its in-place retry, and the Session's next composer re-adopts them in rail order. A Session removed while no composer is mounted releases its attachments through the hub's catalog watch. Picked and dropped files hold only a browser file handle; a pasted image keeps its bytes in memory until it is sent or removed or its Session is removed.
|
||||
|
||||
**A reload reports discarded attachments instead of restoring them.** On `pagehide`, the input hub marks each Session that still owns draft attachments in browser storage; a back-forward cache restore clears the marks. A composer mounted with a mark and no registered attachments shows the "add them again" notice.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
**Restoring attachments after a reload from durable browser references and a Host `restore` Remote.** It would bring uploaded files and images back after a page reload, but it needs a Host Remote with its Liveshare and catalog classifications, a persisted browser format, a send gate during restoration, and an image byte payload. Desktop, where most users work, gains little: its Host binds a new port on every launch, so its storage origin, and with it every saved reference, does not survive an application restart.
|
||||
|
||||
**Releasing settled attachments on a switch and restoring them from the Host on return.** It would save the memory of pasted images while a Session is not shown, but every return needs a Host round trip, fails on a weak network, and allocates the same bytes again.
|
||||
|
||||
## Consequences
|
||||
|
||||
Switching never touches the Host, so a weak network cannot lose a draft attachment there. A reload or crash still discards attachments; a crash writes no mark and so shows no notice.
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Agent Note:草稿附件跨会话切换
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-13-draft-attachments-across-session-switches.md) | 中文
|
||||
|
||||
## 问题
|
||||
|
||||
切到另一个会话再切回时,输入框的附件栏被清空,文字却还在(issue #5070)。会话 scope 销毁时会释放退役输入框持有的全部附件并回收图片预览,之后没有任何途径能重建它们。
|
||||
|
||||
## 决策
|
||||
|
||||
**Conversation 服务在切换期间保留全部草稿附件。** `ConversationController` 记录每个草稿附件属于哪个会话。Host 接受消息时,这些附件立即退出会话归属,注册表则保留它们直到回显结算。退役的输入框只在其会话已被删除、或消息与命令已经提交时释放附件,因为客户端无法判断已提交的命令是否用掉了附件;被中止的斜杠行裁决会保留附件。其他情况下附件继续登记,进行中的上传继续进行,失败的上传保留原位重试,会话下一次挂载的输入框按附件栏顺序接回它们。没有挂载输入框时被删除的会话,由 hub 的会话目录监听释放其附件。选择或拖入的文件只占一个浏览器文件句柄;粘贴的图片会把字节保留在内存中,直到发送、移除或其会话被删除。
|
||||
|
||||
**刷新时提示被丢弃的附件,而不恢复它们。** `pagehide` 时,输入 hub 在浏览器存储中为每个仍持有草稿附件的会话写一个标记;往返缓存恢复页面时清除这些标记。挂载时有标记且没有已登记附件的输入框,会显示「请重新添加」提示。
|
||||
|
||||
## 考虑过的替代方案
|
||||
|
||||
**刷新后通过浏览器 durable 引用与 Host `restore` Remote 恢复附件。** 它能在页面刷新后找回已上传的文件和图片,但需要新增一个 Host Remote 及其 Liveshare 与目录分类、一种浏览器持久化格式、恢复期间的发送拦截和图片字节载荷。主要用户所在的桌面端收益很小:桌面端 Host 每次启动都绑定新端口,存储 origin 连同所有已存引用都无法跨应用重启保留。
|
||||
|
||||
**切换时释放已结算附件,切回时由 Host 恢复。** 它能在会话不显示期间省下粘贴图片的内存,但每次切回都需要一次 Host 往返,弱网下会失败,并且之后还要再分配同样的字节。
|
||||
|
||||
## 影响
|
||||
|
||||
切换会话从不访问 Host,因此弱网不会让草稿附件在切换中丢失。刷新或崩溃仍会丢弃附件;崩溃时不会写标记,因此没有提示。
|
||||
@@ -9,8 +9,8 @@
|
||||
en: 344bcc7e9825bbc8
|
||||
zh: c1d0f4b54f5b3786
|
||||
/agent-note-change-request-panel-and-worktree-sessions/decision:
|
||||
en: 4695a1e4f8aa7a25
|
||||
zh: e17be0e36ea3eaa3
|
||||
en: a2da424833a8aa0a
|
||||
zh: 9ab23d2e5bde31de
|
||||
/agent-note-change-request-panel-and-worktree-sessions/deferred:
|
||||
en: 32ef8af85f4d2f66
|
||||
zh: b82b67f94346399e
|
||||
|
||||
@@ -10,7 +10,7 @@ English | [中文](2026-10-09-forge-panel.zh.md)
|
||||
|
||||
## Decision
|
||||
|
||||
[`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.md) is a two-face package. Its Host half, the `forgePanel` Remote, assembles everything the panel shows for one Session into one streamed state; the forge registry and the binding service keep only their domain operations. Its Client half is a right-sidebar tab, a Session header button that shows or hides it, a New Session option, a creation card above the composer, a toast, and the [Session list icons and hover card section](2026-10-20-forge-session-list.md). Every surface calls a bound item a change request, the forge registry's term, whatever its code host calls it. The [forge bundle](../../../../packages/experimental/forge-bundle/README.md) ships the panel, the forge registry, the GitHub provider, the bindings, the worktree model tool, and an isolated worktree service for the panel as one default-disabled Plugins page entry.
|
||||
[`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.md) is a two-face package. Its Host half, the `forgePanel` Remote, assembles everything the panel shows for one Session into one streamed state; the forge registry and the binding service keep only their domain operations. Its Client half is a Change requests section, checkout and local changes rows, and an attention mark in the [Session panel](2026-11-05-session-panel.md), a changes view, a New Session option, a creation card above the composer, a toast, and the [Session list icons and hover card section](2026-10-20-forge-session-list.md). Every surface calls a bound item a change request, the forge registry's term, whatever its code host calls it. The [forge bundle](../../../../packages/experimental/forge-bundle/README.md) ships the panel, the forge registry, the GitHub provider, the bindings, the worktree model tool, and an isolated worktree service for the panel as one default-disabled Plugins page entry.
|
||||
|
||||
Review and worktree controls serve one code-change workflow. One Plugins entry lets users enable that workflow without having to distinguish the underlying package split. Packages and the two worktree services remain independent so each owns its before-Session or in-conversation creation flow.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Status: implemented
|
||||
|
||||
## Decision
|
||||
|
||||
[`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.zh.md) 是一个双端包。宿主端的 `forgePanel` Remote 把面板为一个 Session 展示的全部内容组装成一条流式状态;forge 注册表与绑定服务只保留各自的领域操作。客户端包括一个右侧边栏标签页、一个显示或隐藏它的 Session 标题栏按钮、一个新会话选项、一张位于输入框上方的创建卡片、一个 toast,以及[会话列表中的图标与悬浮卡片部分](2026-10-20-forge-session-list.zh.md)。所有界面都把已绑定的条目称为变更请求(forge 注册表的术语),不随代码托管平台的叫法变化。[forge 套件](../../../../packages/experimental/forge-bundle/README.zh.md)把面板、forge 注册表、GitHub 提供方、绑定服务、工作树模型工具与面板使用的一个隔离 worktree 服务作为插件页中默认禁用的一个条目发布。
|
||||
[`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.zh.md) 是一个双端包。宿主端的 `forgePanel` Remote 把面板为一个 Session 展示的全部内容组装成一条流式状态;forge 注册表与绑定服务只保留各自的领域操作。客户端包括[会话面板](2026-11-05-session-panel.zh.md)中的“变更请求”分栏、检出行与本地变更行和提醒标记,以及一个变更视图、一个新会话选项、一张位于输入框上方的创建卡片、一个 toast,以及[会话列表中的图标与悬浮卡片部分](2026-10-20-forge-session-list.zh.md)。所有界面都把已绑定的条目称为变更请求(forge 注册表的术语),不随代码托管平台的叫法变化。[forge 套件](../../../../packages/experimental/forge-bundle/README.zh.md)把面板、forge 注册表、GitHub 提供方、绑定服务、工作树模型工具与面板使用的一个隔离 worktree 服务作为插件页中默认禁用的一个条目发布。
|
||||
|
||||
评审与工作树控件服务于同一个代码修改流程。统一插件入口让用户可以一次启用这些能力,无需根据底层包的拆分判断应该开启哪张卡片。包与两套工作树服务仍保持独立,分别负责会话开始前和对话中创建工作树的流程。
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
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
|
||||
en: 783b146c3396bebb
|
||||
zh: 0f71205fdb744961
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/the-turn-rail-sits-at-the-start-edge:
|
||||
en: 08e720a4ea75d4d6
|
||||
zh: 5e2e5b8452f67d36
|
||||
@@ -24,5 +24,5 @@
|
||||
en: 6adaf7a36da05668
|
||||
zh: c0ace7297995d764
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/consequences:
|
||||
en: 6c2f625c9c36ebd0
|
||||
zh: 0060e818dbf233ce
|
||||
en: 0b6e547a08c042bc
|
||||
zh: 154a69e3f54692cd
|
||||
@@ -26,6 +26,8 @@ Each section is one list registration with `id`, `order`, and a required `label`
|
||||
|
||||
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.
|
||||
|
||||
A section's list shows five rows of each group and then a fold control, because a Session with many subagents, shared tasks, or background jobs would otherwise push the later sections out of the panel's height. Each list orders its rows so that the ones it holds back are the least current: running rows first and then the most recent ones, or for shared tasks, which carry no times, the unfinished tasks before the completed ones. The fold control is the one row the panel does offer as a Component Factory, `conversation.session.panel.fold`: it is the same in every section and takes only data and a callback, while each section keeps its fold state and decides which rows show.
|
||||
|
||||
### 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.
|
||||
@@ -47,3 +49,4 @@ The turn rail sits at the scrollport's start edge with its marks, focus ring, an
|
||||
- `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.
|
||||
- Change requests, background jobs, and subagents became sections, replacing the change requests sidebar tab, its start-page entry, and the header controls of jobs and subagents; the header keeps the subagent breadcrumb switcher for child Sessions. A section mounts only while the panel shows, so state that must outlast hiding the panel, such as cleared job rows, lives in a per-Session slot store.
|
||||
@@ -26,6 +26,8 @@ Status: implemented
|
||||
|
||||
各贡献方的行通过面板的样式表共享同一外观,而不是共享组件:各贡献方自己写行的标记并标出各个部分,由面板统一排版,使不同包的图标、文字与尾部区域对齐。共享的行组件要把各贡献方的图标、文字和控件作为 React 节点从 props 传入,这是客户端规则禁止的;功能包之间也不能共享各自的行组件。
|
||||
|
||||
分栏的列表每个分组只显示五行,然后是一个收起控件;否则子智能体、共享任务或后台任务很多的会话会把后面的分栏挤出面板的高度。每个列表按顺序排列,使被收起的是最不需要看的行:运行中的在前,然后是最近的;共享任务没有时间信息,则未完成的排在已完成的前面。收起控件是面板唯一以 Component Factory 提供的行,即 `conversation.session.panel.fold`:它在每个分栏里都一样,只接收数据和一个回调,而收起状态和显示哪些行由各分栏自己决定。
|
||||
|
||||
### 轮次轨道位于起始边
|
||||
|
||||
轮次轨道连同刻度、焦点环和预览位于滚动容器的起始边,末端留白留给停靠面板;它的 900px 隐藏规则保证旁边有足够空间容纳起始侧的宽度拖拽条。
|
||||
@@ -47,3 +49,4 @@ Status: implemented
|
||||
- `ui-chat` 多了一个 slot,侧边层多了一个自定义属性,但不为它们观察任何尺寸。每个已挂载的面板在停靠探针上多一个 `ResizeObserver`,只在停靠判断翻转时回调。`ui-conversation` 把默认正文宽度上限定为 880px。
|
||||
- 面板只出现在 Chat 视图中;其他视图下开关仍在标题栏中,但不可用。每个 Chat 视图实例都会渲染侧边层,因此同一会话同时显示在主正文区和嵌入的对话中时,两处都会显示浮层。
|
||||
- 轮次轨道的位置对所有用户都变了;行为和隐藏规则不变。
|
||||
- 变更请求、后台任务和子智能体成为分栏,取代变更请求侧边栏标签页、其起始页入口,以及标题栏中的后台任务和子智能体控件;标题栏仍为子会话保留子智能体面包屑切换器。分栏只在面板显示时挂载,因此需要在隐藏面板后保留的状态(例如已清空的任务行)放在按会话划分的 slot store 中。
|
||||
@@ -1,29 +1,36 @@
|
||||
/**
|
||||
* Daily stale pull-request reminders for the `Stale pull requests` workflow.
|
||||
* Daily stale pull-request reminders and closing for the `Stale pull requests` workflow.
|
||||
*
|
||||
* A pull request's last activity is the latest of its creation, a commit, a force push, a reopen or ready-for-review
|
||||
* event, and a comment or review from a non-bot account. Other timeline events, such as mentions, labels and cross
|
||||
* references, do not count, so reminder comments never extend it. After 7 and 14 days without activity the workflow
|
||||
* comments once per stage and mentions the author. Activity starts a new cycle. Pull requests labelled `DO_NOT_CLOSE`
|
||||
* and pull requests opened by bots receive no reminders. The workflow never closes pull requests.
|
||||
* references, do not count, so reminder and closing comments never extend it. After 7 and 14 days without activity the
|
||||
* workflow comments once per stage and mentions the author. After 21 days without activity, and at least 7 days after
|
||||
* the 14-day reminder, it comments and closes the pull request; the reminder therefore always gives the author 7 days'
|
||||
* notice, including for pull requests that were already inactive when the workflow started. Activity, including
|
||||
* reopening, starts a new cycle. Pull requests labelled `DO_NOT_CLOSE` and pull requests opened by bots are neither
|
||||
* reminded nor closed.
|
||||
*
|
||||
* Each run reads the timeline of every open pull request that is neither exempt nor bot-authored, because `updated_at`
|
||||
* also changes on events that are not activity. Each run posts at most `MAX_COMMENTS_PER_RUN` reminders, least recently
|
||||
* also changes on events that are not activity. Each run posts at most `MAX_COMMENTS_PER_RUN` comments, least recently
|
||||
* updated pull requests first, so a backlog spreads over several days within GitHub's content-creation limits. A failed
|
||||
* pull request is reported and skipped.
|
||||
*/
|
||||
|
||||
/** Label that exempts a pull request from reminders. */
|
||||
/** Label that exempts a pull request from reminders and closing. */
|
||||
export const EXEMPT_LABEL = 'DO_NOT_CLOSE'
|
||||
|
||||
/** Days without activity after which each reminder is posted, in ascending order. */
|
||||
export const REMINDER_DAYS = [7, 14]
|
||||
|
||||
/** Days without activity after which a pull request is closed. */
|
||||
export const CLOSE_DAYS = 21
|
||||
|
||||
const DAY_MS = 24 * 60 * 60 * 1000
|
||||
// GitHub asks integrations to wait at least one second between content-creating requests.
|
||||
const COMMENT_INTERVAL_MS = 1000
|
||||
const MAX_COMMENTS_PER_RUN = 100
|
||||
const MARKER = /<!-- stale-pr-reminder:(\d+) -->/
|
||||
// Reminders posted before closing existed use `stale-pr-reminder` and announce no closing, so they are ignored.
|
||||
const MARKER = /<!-- stale-pr:(\d+) -->/
|
||||
// Review bots that use ordinary user accounts.
|
||||
const BOT_LOGINS = new Set(['ds-review-bot'])
|
||||
|
||||
@@ -55,39 +62,46 @@ function activityTimes(event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the reminder a pull request is due for.
|
||||
* Selects the reminder or closing a pull request is due for.
|
||||
* @param {object} options
|
||||
* @param {string} options.createdAt Pull-request creation time.
|
||||
* @param {object[]} options.timeline Complete issue timeline of the pull request.
|
||||
* @param {Date} options.now Evaluation time.
|
||||
* @returns {number | undefined} Due reminder stage in days, or `undefined` when none is due.
|
||||
* @returns {{ days: number, comment: boolean } | undefined} Due stage in days, `CLOSE_DAYS` for closing, and whether its
|
||||
* comment is still unposted; `undefined` when nothing is due. A closing whose comment was posted but whose close failed
|
||||
* is due again without a comment.
|
||||
*/
|
||||
export function dueReminder({ createdAt, timeline, now }) {
|
||||
export function dueStage({ createdAt, timeline, now }) {
|
||||
const times = [createdAt, ...timeline.flatMap(activityTimes)].map(time => Date.parse(time)).filter(Number.isFinite)
|
||||
const lastActivity = Math.max(...times)
|
||||
const due = REMINDER_DAYS.filter(days => now.getTime() - lastActivity >= days * DAY_MS).at(-1)
|
||||
if (due === undefined) return undefined
|
||||
const sent = timeline
|
||||
.filter(event => event.event === 'commented' && isBot(event.actor) && Date.parse(event.created_at) > lastActivity)
|
||||
.map(event => Number(MARKER.exec(event.body ?? '')?.[1]))
|
||||
return sent.some(days => days >= due) ? undefined : due
|
||||
.map(event => ({ days: Number(MARKER.exec(event.body ?? '')?.[1]), at: Date.parse(event.created_at) }))
|
||||
const finalReminder = REMINDER_DAYS.at(-1)
|
||||
const noticeMs = (CLOSE_DAYS - finalReminder) * DAY_MS
|
||||
if (now.getTime() - lastActivity >= CLOSE_DAYS * DAY_MS && sent.some(({ days, at }) => days === finalReminder && now.getTime() - at >= noticeMs)) {
|
||||
return { days: CLOSE_DAYS, comment: !sent.some(({ days }) => days === CLOSE_DAYS) }
|
||||
}
|
||||
const due = REMINDER_DAYS.filter(days => now.getTime() - lastActivity >= days * DAY_MS).at(-1)
|
||||
if (due === undefined || sent.some(({ days }) => days >= due)) return undefined
|
||||
return { days: due, comment: true }
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the reminder comment.
|
||||
* Builds the reminder or closing comment.
|
||||
* @param {string} author Pull-request author login.
|
||||
* @param {number} days Reminder stage in days.
|
||||
* @param {number} days Stage in days; `CLOSE_DAYS` builds the closing comment.
|
||||
* @returns {string} Comment body.
|
||||
*/
|
||||
export function reminderBody(author, days) {
|
||||
return [
|
||||
`<!-- stale-pr-reminder:${days} -->`,
|
||||
`@${author} This pull request has had no activity for ${days} days. Please update it, reply to keep it open, or close it if it is no longer needed. Add the \`${EXEMPT_LABEL}\` label, or ask a maintainer to add it, to stop these reminders.`,
|
||||
].join('\n')
|
||||
export function stageBody(author, days) {
|
||||
const text = days === CLOSE_DAYS
|
||||
? `@${author} This pull request has had no activity for ${days} days and is now closed. Reopen it, or ask a maintainer to reopen it, if you continue the work.`
|
||||
: `@${author} This pull request has had no activity for ${days} days. Please update it, reply to keep it open, or close it if it is no longer needed. Pull requests are closed after ${CLOSE_DAYS} days without activity and at least ${CLOSE_DAYS - REMINDER_DAYS.at(-1)} days after the ${REMINDER_DAYS.at(-1)}-day reminder. Add the \`${EXEMPT_LABEL}\` label, or ask a maintainer to add it, to stop reminders and closing.`
|
||||
return `<!-- stale-pr:${days} -->\n${text}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts every due reminder on open pull requests of the workflow repository.
|
||||
* Posts every due reminder and closes every due pull request among the open pull requests of the workflow repository.
|
||||
* @param {object} options
|
||||
* @param {object} options.github Authenticated Octokit client from `actions/github-script`.
|
||||
* @param {object} options.context Workflow context from `actions/github-script`.
|
||||
@@ -96,7 +110,7 @@ export function reminderBody(author, days) {
|
||||
* @param {(ms: number) => Promise<void>} [options.sleep] Delay between comments.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function remindStalePullRequests({ github, context, core, now = new Date(), sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) }) {
|
||||
export async function processStalePullRequests({ github, context, core, now = new Date(), sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) }) {
|
||||
const { owner, repo } = context.repo
|
||||
const pulls = await github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', sort: 'updated', direction: 'asc', per_page: 100 })
|
||||
let posted = 0
|
||||
@@ -107,12 +121,16 @@ export async function remindStalePullRequests({ github, context, core, now = new
|
||||
if (pull.labels.some(label => label.name === EXEMPT_LABEL)) continue
|
||||
try {
|
||||
const timeline = await github.paginate(github.rest.issues.listEventsForTimeline, { owner, repo, issue_number: pull.number, per_page: 100 })
|
||||
const days = dueReminder({ createdAt: pull.created_at, timeline, now })
|
||||
if (days === undefined) continue
|
||||
if (posted > 0) await sleep(COMMENT_INTERVAL_MS)
|
||||
await github.rest.issues.createComment({ owner, repo, issue_number: pull.number, body: reminderBody(pull.user.login, days) })
|
||||
posted++
|
||||
core.info(`#${pull.number}: posted the ${days}-day reminder`)
|
||||
const stage = dueStage({ createdAt: pull.created_at, timeline, now })
|
||||
if (stage === undefined) continue
|
||||
const { days } = stage
|
||||
if (stage.comment) {
|
||||
if (posted > 0) await sleep(COMMENT_INTERVAL_MS)
|
||||
await github.rest.issues.createComment({ owner, repo, issue_number: pull.number, body: stageBody(pull.user.login, days) })
|
||||
posted++
|
||||
}
|
||||
if (days === CLOSE_DAYS) await github.rest.pulls.update({ owner, repo, pull_number: pull.number, state: 'closed' })
|
||||
core.info(days === CLOSE_DAYS ? `#${pull.number}: closed after ${days} days without activity` : `#${pull.number}: posted the ${days}-day reminder`)
|
||||
} catch (error) {
|
||||
failed++
|
||||
core.warning(`#${pull.number}: ${error.message}`)
|
||||
|
||||
@@ -1,47 +1,67 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { dueReminder, reminderBody, remindStalePullRequests } from './remind.mjs'
|
||||
import { dueStage as dueAction, stageBody, processStalePullRequests } from './remind.mjs'
|
||||
|
||||
const now = new Date('2026-11-30T00:00:00Z')
|
||||
const daysAgo = days => new Date(now.getTime() - days * 24 * 60 * 60 * 1000).toISOString()
|
||||
const human = { login: 'author', type: 'User' }
|
||||
const bot = { login: 'github-actions[bot]', type: 'Bot' }
|
||||
const comment = (actor, days, body = 'ok') => ({ event: 'commented', actor, created_at: daysAgo(days), body })
|
||||
const reminder = (days, stage) => comment(bot, days, reminderBody('author', stage))
|
||||
const reminder = (days, stage) => comment(bot, days, stageBody('author', stage))
|
||||
const dueStage = options => dueAction(options)?.days
|
||||
|
||||
test('no reminder is due within 7 days of the last activity', () => {
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(6), timeline: [], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(30), timeline: [comment(human, 6)], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(6), timeline: [], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(30), timeline: [comment(human, 6)], now }), undefined)
|
||||
})
|
||||
|
||||
test('the latest due stage is posted once after the last activity', () => {
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(7), timeline: [], now }), 7)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(10), timeline: [reminder(3, 7)], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(14), timeline: [reminder(7, 7)], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [reminder(20, 14)], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(7), timeline: [], now }), 7)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(10), timeline: [reminder(3, 7)], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(14), timeline: [reminder(7, 7)], now }), 14)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [], now }), 14)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(17), timeline: [reminder(3, 14)], now }), undefined)
|
||||
})
|
||||
|
||||
test('a pull request closes after 21 days without activity and 7 days after the 14-day reminder', () => {
|
||||
assert.equal(dueStage({ createdAt: daysAgo(21), timeline: [reminder(14, 7), reminder(7, 14)], now }), 21)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [reminder(20, 14)], now }), 21)
|
||||
// A pull request that was already inactive gets the 14-day reminder first and 7 days' notice.
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [reminder(6, 14)], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [reminder(30, 7)], now }), 14)
|
||||
// A 14-day reminder from before the last activity gives no notice.
|
||||
assert.equal(dueStage({ createdAt: daysAgo(60), timeline: [reminder(40, 14), comment(human, 25)], now }), 14)
|
||||
// Reminders posted before closing existed announce no closing.
|
||||
const legacy = comment(bot, 10, '<!-- stale-pr-reminder:14 -->\n@author This pull request has had no activity for 14 days.')
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [legacy], now }), 14)
|
||||
})
|
||||
|
||||
test('a closing whose comment was posted retries the close without another comment', () => {
|
||||
assert.deepEqual(dueAction({ createdAt: daysAgo(30), timeline: [reminder(9, 14)], now }), { days: 21, comment: true })
|
||||
assert.deepEqual(dueAction({ createdAt: daysAgo(30), timeline: [reminder(9, 14), reminder(1, 21)], now }), { days: 21, comment: false })
|
||||
})
|
||||
|
||||
test('human activity restarts the cycle and bot activity does not', () => {
|
||||
const sentBefore = [reminder(30, 7), reminder(23, 14)]
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment(human, 8)], now }), 7)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'committed', committer: { date: daysAgo(3) } }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'reviewed', user: human, submitted_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'line-commented', comments: [{ user: human, created_at: daysAgo(3) }] }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'head_ref_force_pushed', actor: human, created_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ci[bot]', type: 'Bot' }, 1)], now }), undefined)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ds-review-bot', type: 'User' }, 1)], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, comment(human, 8)], now }), 7)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'committed', committer: { date: daysAgo(3) } }], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'reviewed', user: human, submitted_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'line-commented', comments: [{ user: human, created_at: daysAgo(3) }] }], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'head_ref_force_pushed', actor: human, created_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, { event: 'reopened', actor: human, created_at: daysAgo(3) }], now }), undefined)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ci[bot]', type: 'Bot' }, 1)], now }), 21)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(40), timeline: [...sentBefore, comment({ login: 'ds-review-bot', type: 'User' }, 1)], now }), 21)
|
||||
})
|
||||
|
||||
test('mentions, labels and cross references are not activity', () => {
|
||||
const at = (event, days) => ({ event, actor: human, created_at: daysAgo(days) })
|
||||
// GitHub records a `mentioned` event for the author right after each reminder.
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(14), timeline: [reminder(7, 7), at('mentioned', 7 - 1e-5), at('subscribed', 7 - 1e-5)], now }), 14)
|
||||
assert.equal(dueReminder({ createdAt: daysAgo(20), timeline: [at('labeled', 1), at('cross-referenced', 1), at('review_requested', 1)], now }), 14)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(14), timeline: [reminder(7, 7), at('mentioned', 7 - 1e-5), at('subscribed', 7 - 1e-5)], now }), 14)
|
||||
assert.equal(dueStage({ createdAt: daysAgo(20), timeline: [at('labeled', 1), at('cross-referenced', 1), at('review_requested', 1)], now }), 14)
|
||||
})
|
||||
|
||||
test('reminders mention the author and skip exempt and bot-authored pull requests', async () => {
|
||||
test('reminders and closing mention the author and skip exempt and bot-authored pull requests', async () => {
|
||||
const pull = (number, overrides = {}) => ({ number, user: human, labels: [], created_at: daysAgo(20), updated_at: daysAgo(20), ...overrides })
|
||||
const pulls = [
|
||||
pull(1),
|
||||
@@ -51,12 +71,21 @@ test('reminders mention the author and skip exempt and bot-authored pull request
|
||||
pull(4, { updated_at: daysAgo(1) }),
|
||||
pull(6),
|
||||
pull(5),
|
||||
pull(7, { created_at: daysAgo(30) }),
|
||||
pull(8, { created_at: daysAgo(30) }),
|
||||
]
|
||||
const comments = []
|
||||
const closed = []
|
||||
const timelines = []
|
||||
const github = {
|
||||
rest: {
|
||||
pulls: { list: 'pulls' },
|
||||
pulls: {
|
||||
list: 'pulls',
|
||||
update: async params => {
|
||||
if (params.pull_number === 8) throw new Error('close failed')
|
||||
closed.push(params)
|
||||
},
|
||||
},
|
||||
issues: {
|
||||
listEventsForTimeline: 'timeline',
|
||||
createComment: async params => {
|
||||
@@ -68,20 +97,23 @@ test('reminders mention the author and skip exempt and bot-authored pull request
|
||||
paginate: async (method, params) => {
|
||||
if (method === 'pulls') return pulls
|
||||
timelines.push(params.issue_number)
|
||||
return []
|
||||
return [7, 8].includes(params.issue_number) ? [reminder(9, 14)] : []
|
||||
},
|
||||
}
|
||||
const sleeps = []
|
||||
const warnings = []
|
||||
const failures = []
|
||||
const core = { info() {}, warning: message => warnings.push(message), setFailed: message => failures.push(message) }
|
||||
await remindStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core, now, sleep: async ms => sleeps.push(ms) })
|
||||
assert.deepEqual(timelines, [1, 4, 6, 5])
|
||||
assert.deepEqual(warnings, ['#6: locked'])
|
||||
await processStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core, now, sleep: async ms => sleeps.push(ms) })
|
||||
assert.deepEqual(timelines, [1, 4, 6, 5, 7, 8])
|
||||
// A failed close after its comment is retried on the next run without another comment.
|
||||
assert.deepEqual(warnings, ['#6: locked', '#8: close failed'])
|
||||
assert.equal(failures.length, 1)
|
||||
assert.deepEqual(comments.map(({ issue_number }) => issue_number), [1, 4, 5])
|
||||
assert.match(comments[0].body, /^<!-- stale-pr-reminder:14 -->\n@author This pull request has had no activity for 14 days\./)
|
||||
assert.deepEqual(sleeps, [1000, 1000, 1000])
|
||||
assert.deepEqual(comments.map(({ issue_number }) => issue_number), [1, 4, 5, 7, 8])
|
||||
assert.match(comments[0].body, /^<!-- stale-pr:14 -->\n@author This pull request has had no activity for 14 days\./)
|
||||
assert.match(comments[3].body, /^<!-- stale-pr:21 -->\n@author This pull request has had no activity for 21 days and is now closed\./)
|
||||
assert.deepEqual(closed, [{ owner: 'o', repo: 'r', pull_number: 7, state: 'closed' }])
|
||||
assert.deepEqual(sleeps, [1000, 1000, 1000, 1000, 1000])
|
||||
})
|
||||
|
||||
test('a run posts at most 100 reminders', async () => {
|
||||
@@ -91,6 +123,6 @@ test('a run posts at most 100 reminders', async () => {
|
||||
rest: { pulls: { list: 'pulls' }, issues: { listEventsForTimeline: 'timeline', createComment: async () => comments++ } },
|
||||
paginate: async method => method === 'pulls' ? pulls : [],
|
||||
}
|
||||
await remindStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core: { info() {} }, now, sleep: async () => {} })
|
||||
await processStalePullRequests({ github, context: { repo: { owner: 'o', repo: 'r' } }, core: { info() {} }, now, sleep: async () => {} })
|
||||
assert.equal(comments, 100)
|
||||
})
|
||||
@@ -1,4 +1,4 @@
|
||||
# Reminds authors of open pull requests after 7 and 14 days without activity; never closes them.
|
||||
# Reminds authors of open pull requests after 7 and 14 days without activity and closes them after 21 days.
|
||||
# Rules: .github/stale-pull-requests/remind.mjs.
|
||||
name: Stale pull requests
|
||||
|
||||
@@ -16,7 +16,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
remind:
|
||||
name: Remind stale pull requests
|
||||
name: Remind and close stale pull requests
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -27,9 +27,9 @@ jobs:
|
||||
with:
|
||||
sparse-checkout: .github/stale-pull-requests
|
||||
persist-credentials: false
|
||||
- name: Post due reminders
|
||||
- name: Post due reminders and close stale pull requests
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
|
||||
with:
|
||||
script: |
|
||||
const { remindStalePullRequests } = await import(`${process.env.GITHUB_WORKSPACE}/.github/stale-pull-requests/remind.mjs`)
|
||||
await remindStalePullRequests({ github, context, core })
|
||||
const { processStalePullRequests } = await import(`${process.env.GITHUB_WORKSPACE}/.github/stale-pull-requests/remind.mjs`)
|
||||
await processStalePullRequests({ github, context, core })
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
{"type":"step/start","data":{"turn":1,"step":1}}
|
||||
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
|
||||
{"type":"session/title","data":{"title":"Use the write tool exactly","messageSeqs":[8],"source":{"kind":"fallback"}}}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
{"type":"step/start","data":{"turn":1,"step":1}}
|
||||
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"Reply with exactly CHILD_RESULT and nothing else. Do not call send_message."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"user/message","data":{"content":[{"type":"text","text":"<system-reminder>\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names.\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nDelegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n</system-reminder>"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are a subagent delegated by agent \"lead\".\nYour name is \"agent-1\".\nThe root agent of your collaboration tree is \"lead\".\n\nTo message other agents, use send_message({ agent: \"<agent-name>\", message: \"...\" }).\nWhen you finish, use send_message to send a self-contained result to the agent that delegated you. Message any agent as soon as a finding changes what it should do next; sending a message does not end your turn.\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"tool:subagent_fork:depth","text":"Delegation depth for `subagent_fork`: current 1, maximum 1, remaining levels 0. Do not call `subagent_fork` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
|
||||
{"type":"session/title","data":{"title":"Reply with exactly CHILD_RESULT and","messageSeqs":[8],"source":{"kind":"fallback"}}}
|
||||
|
||||
@@ -428,9 +428,10 @@ describe('web e2e: agent-preset selection', () => {
|
||||
|
||||
await compareOrRefreshGolden(HEADER_EXPECTED, snapshot, MODE)
|
||||
expect(snapshot).toContain('Minimal mode')
|
||||
expect(snapshot).toContain('button "1 subagent"')
|
||||
expect(snapshot.indexOf('Minimal mode')).toBeLessThan(snapshot.indexOf('button "1 subagent"'))
|
||||
expect(snapshot.indexOf('button "1 subagent"')).toBeLessThan(snapshot.indexOf('button "More actions"'))
|
||||
// The Session's subagents live in the Session panel, whose toggle follows the preset label.
|
||||
expect(snapshot).not.toContain('button "1 subagent"')
|
||||
expect(snapshot.indexOf('Minimal mode')).toBeLessThan(snapshot.indexOf('button "Session panel"'))
|
||||
expect(snapshot.indexOf('button "Session panel"')).toBeLessThan(snapshot.indexOf('button "More actions"'))
|
||||
// Static chrome, not a control: the header can only report a composition
|
||||
// the host would refuse to change.
|
||||
expect(snapshot).not.toContain('button "Minimal mode"')
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// over the real Host projection frame flow.
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join } from 'node:path'
|
||||
import type { Browser, Page } from 'playwright'
|
||||
import { homedir } from 'node:os'
|
||||
import type { Browser, Locator, Page } from 'playwright'
|
||||
import { chromium } from 'playwright'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished, vi } from 'vitest'
|
||||
import type {} from '@deepseek-ai/dsh-agent-team'
|
||||
@@ -10,16 +11,22 @@ import type { SessionId } from '@deepseek-ai/dsh-session'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
import type { CommandId } from '@deepseek-ai/dsh-commands/types'
|
||||
import { createMessage, createUserMessage } from '@deepseek-ai/dsh-llm'
|
||||
import { abbreviateHomePath } from '@deepseek-ai/dsh-util-workspace-path'
|
||||
import {
|
||||
acknowledgeReloadConnectionLoss, assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { assertWarningDialogLayout, connectFreshWorkspace, connectFreshWorkspaceZh, newEnglishPage, saveFailureShot, writeComposerDraft } from './support.ts'
|
||||
import {
|
||||
assertWarningDialogLayout, connectFreshWorkspace, connectFreshWorkspaceZh, dismissSessionPanel, foldControlLayout, newEnglishPage,
|
||||
saveFailureShot, sessionPanelToggle, showSessionPanel, writeComposerDraft,
|
||||
} from './support.ts'
|
||||
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('./snapshots/agent-team-panel', import.meta.url))
|
||||
const PANEL_EXPECTED = join(SNAPSHOT_DIR, 'task.expected.md')
|
||||
const RESIZE_EXPECTED = join(SNAPSHOT_DIR, 'resize.expected.md')
|
||||
const MODE = webSnapshotMode()
|
||||
const SUBAGENTS_SECTION = '[data-session-panel-section="subagents"]'
|
||||
const SHARED_TASKS_SECTION = '[data-session-panel-section="shared-tasks"]'
|
||||
const RESEARCHER_DESCRIPTION = 'Researcher: investigate the construction and verify every bound before reporting the result. '.repeat(8).trim()
|
||||
const RECEIPT_LOCALES = [
|
||||
{
|
||||
@@ -40,6 +47,26 @@ const RECEIPT_LOCALES = [
|
||||
|
||||
type ReceiptLocale = typeof RECEIPT_LOCALES[number]
|
||||
|
||||
/**
|
||||
* Show the Session panel and return its Subagents section once the panel's
|
||||
* entrance animation has ended, so geometry reads see its resting position.
|
||||
* @param page - the page under test.
|
||||
* @returns the section, hidden while it has nothing to show.
|
||||
*/
|
||||
async function showSubagentsSection(page: Page): Promise<Locator> {
|
||||
return (await showSessionPanel(page)).locator(SUBAGENTS_SECTION)
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Session panel and return its Shared tasks section once the panel's
|
||||
* entrance animation has ended.
|
||||
* @param page - the page under test.
|
||||
* @returns the section, hidden while it has nothing to show.
|
||||
*/
|
||||
async function showSharedTasksSection(page: Page): Promise<Locator> {
|
||||
return (await showSessionPanel(page)).locator(SHARED_TASKS_SECTION)
|
||||
}
|
||||
|
||||
async function openTeamSettings(page: Page, chinese = false): Promise<void> {
|
||||
const trigger = page.getByRole('button', { name: chinese ? /^选择模型/u : /^Select model/u })
|
||||
await trigger.click()
|
||||
@@ -252,7 +279,11 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
|
||||
it('defaults off and saves a Session selection in the model menu', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-mode'))
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
const assertNoSubagentsSection = async (): Promise<void> => {
|
||||
expect(await (await showSubagentsSection(page)).locator('[data-subagents-section]').count()).toBe(0)
|
||||
await dismissSessionPanel(page)
|
||||
}
|
||||
await assertNoSubagentsSection()
|
||||
await openTeamSettings(page)
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.waitFor()
|
||||
@@ -266,7 +297,7 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await page.keyboard.press('Space')
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await closeModelMenu(page)
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
await assertNoSubagentsSection()
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
expect(scaffold.ctx.commands.list(agent).some(command => command.name === 'team')).toBe(false)
|
||||
expect(agent.session.ownEvents().filter(event => event.type === 'command/run' || event.type === 'command/done')).toEqual([])
|
||||
@@ -275,8 +306,8 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await other.dispose()
|
||||
const beforeReload = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await assertNoSubagentsSection()
|
||||
await openTeamSettings(page)
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
expect(await toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await closeModelMenu(page)
|
||||
acknowledgeReloadConnectionLoss(tripwire, beforeReload)
|
||||
@@ -310,37 +341,32 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('shows tasks without children or a divider and hides the entry after the last task is deleted', async () => {
|
||||
it('shows tasks in their own section without subagents and hides it after the last task is deleted', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-task-only'))
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(0)
|
||||
const section = await showSharedTasksSection(page)
|
||||
expect(await section.locator('[data-team-panel]').count()).toBe(0)
|
||||
expect(await section.isVisible()).toBe(false)
|
||||
const task = await scaffold.ctx.agentTeams.createTask(agent, {
|
||||
subject: 'Plan before delegation', description: 'Prepare shared work before creating subagents',
|
||||
})
|
||||
await page.getByRole('button', { name: '0 subagents', exact: true }).click()
|
||||
const board = page.locator('[data-team-panel]')
|
||||
const board = section.locator('[data-team-panel]')
|
||||
await board.getByText(task.subject, { exact: true }).waitFor()
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
expect(await panel.getByRole('treeitem').count()).toBe(0)
|
||||
await panel.getByText('No subagents', { exact: true }).waitFor()
|
||||
expect(await panel.locator('[data-subagent-section-header]').textContent()).toBe('Subagents')
|
||||
expect(await panel.locator('[data-subagent-section-header] button, h3 button').count()).toBe(0)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
expect(await page.locator(SUBAGENTS_SECTION).isVisible()).toBe(false)
|
||||
expect(await section.getByRole('heading', { level: 2 }).locator('..').textContent()).toBe('Shared tasks1 pending')
|
||||
expect(await section.locator('h2 button, h3 button').count()).toBe(0)
|
||||
expect(await board.locator('[data-team-task-details]').count()).toBe(0)
|
||||
expect(await board.getByRole('button', { expanded: false }).count()).toBe(1)
|
||||
expect(await board.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { border: style.borderTopWidth, margin: style.marginTop }
|
||||
})).toEqual({ border: '0px', margin: '0px' })
|
||||
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'task-only.expected.md'),
|
||||
await captureStableAria(page, '[data-subagent-panel]', scaffold.workspaceCwd), MODE)
|
||||
await captureStableAria(page, SHARED_TASKS_SECTION, scaffold.workspaceCwd), MODE)
|
||||
await scaffold.ctx.agentTeams.updateTask(agent, { taskId: task.id, expectedRevision: task.revision, action: 'delete' })
|
||||
await page.locator('[data-subagent-action]').waitFor({ state: 'hidden' })
|
||||
await page.locator('[data-subagent-panel]').waitFor({ state: 'hidden' })
|
||||
await board.waitFor({ state: 'detached' })
|
||||
await section.waitFor({ state: 'hidden' })
|
||||
await dismissSessionPanel(page)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('opens the member tree and live read-only tasks in one panel', async () => {
|
||||
it('opens the member tree and live read-only tasks in their own sections', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-agent-team-panel'))
|
||||
const projectionReads = vi.spyOn(scaffold.ctx.sessionController, 'projections')
|
||||
onTestFinished(() => { projectionReads.mockRestore() })
|
||||
@@ -350,32 +376,16 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
version: 2, childId: memberId, childCreatedAt: Date.now(), mode: 'external',
|
||||
label: RESEARCHER_DESCRIPTION,
|
||||
})
|
||||
const countAction = page.locator('[data-subagent-action]')
|
||||
await countAction.waitFor()
|
||||
await page.mouse.move(2, 2)
|
||||
expect(await countAction.evaluate((element) => {
|
||||
const header = element.closest('[data-slot="conversation.session.header.actions"]')!.parentElement!
|
||||
const preset = header.querySelector('[data-icon="dsw-icon-agent-preset-outline-regular"]')!
|
||||
const users = element.querySelector('[data-icon="dsw-icon-users-outline-regular"]')!
|
||||
return {
|
||||
display: getComputedStyle(header).display, gap: getComputedStyle(header).gap,
|
||||
presetOpacity: getComputedStyle(preset).opacity,
|
||||
presetParentOpacity: getComputedStyle(preset.parentElement!).opacity,
|
||||
sameColor: getComputedStyle(preset).color === getComputedStyle(users).color,
|
||||
}
|
||||
})).toEqual({ display: 'flex', gap: '10px', presetOpacity: '1', presetParentOpacity: '1', sameColor: true })
|
||||
const countTrigger = countAction.getByRole('button', { name: /subagents?$/u })
|
||||
await countTrigger.click()
|
||||
await countTrigger.click()
|
||||
await page.locator('[data-subagent-panel]').waitFor({ state: 'detached' })
|
||||
expect(await countTrigger.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await countTrigger.click()
|
||||
const action = page.locator('[data-subagent-panel]')
|
||||
const toggle = sessionPanelToggle(page)
|
||||
await toggle.click()
|
||||
await toggle.click()
|
||||
await page.locator('[data-session-panel]').waitFor({ state: 'detached' })
|
||||
expect(await toggle.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
const action = await showSubagentsSection(page)
|
||||
await action.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
expect(await action.locator('[data-team-panel], [data-subagent-section-header]').count()).toBe(0)
|
||||
expect(await action.getByText('No shared tasks yet. Create them through the conversation.').count()).toBe(0)
|
||||
expect(await action.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
expect(await action.locator('[data-subagent-section-header] button, h3 button').count()).toBe(0)
|
||||
expect(await page.locator('[data-team-panel]').count()).toBe(0)
|
||||
expect(await page.getByText('No shared tasks yet. Create them through the conversation.').count()).toBe(0)
|
||||
expect(await action.locator('h2 button, h3 button').count()).toBe(0)
|
||||
expect(await action.getByRole('heading', { name: 'Members', exact: true }).count()).toBe(0)
|
||||
expect(projectionReads).not.toHaveBeenCalled()
|
||||
|
||||
@@ -383,52 +393,32 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
expect(await action.getByRole('button', { name: /Refresh/u }).count()).toBe(0)
|
||||
|
||||
await action.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
expect(await page.locator('[data-subagent-panel]').count()).toBe(1)
|
||||
expect(await page.locator('[data-subagents-section]').count()).toBe(1)
|
||||
expect(await page.getByRole('button', { name: 'Task board', exact: true }).count()).toBe(0)
|
||||
const task = await scaffold.ctx.agentTeams.createTask(agent, {
|
||||
subject: 'Agent task', description: 'Created by the root agent', writeScopes: ['src/web'],
|
||||
})
|
||||
const row = action.locator(`[data-team-task="${task.id}"]`)
|
||||
const tasks = page.locator(SHARED_TASKS_SECTION)
|
||||
const row = tasks.locator(`[data-team-task="${task.id}"]`)
|
||||
await row.getByRole('button', { name: 'Pending Agent task', exact: true, expanded: false }).waitFor()
|
||||
expect(await action.locator('[data-subagent-section-header]').textContent()).toBe('Subagents1 external')
|
||||
expect(await action.locator('[data-subagent-section-header] button, h3 button').count()).toBe(0)
|
||||
expect(await action.locator('[data-team-panel]').evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { border: style.borderTopWidth, margin: style.marginTop }
|
||||
})).toEqual({ border: '0px', margin: '4px' })
|
||||
expect(await action.evaluate((element) => {
|
||||
const tree = element.querySelector('[role="tree"]')!
|
||||
const board = element.querySelector('[data-team-panel]')!
|
||||
return Boolean(tree.compareDocumentPosition(board) & Node.DOCUMENT_POSITION_FOLLOWING)
|
||||
})).toBe(true)
|
||||
const head = action.getByRole('heading', { level: 2 }).locator('..')
|
||||
expect(await head.textContent()).toBe('Subagents1 external')
|
||||
expect(await action.locator('h2 button, h3 button').count()).toBe(0)
|
||||
expect(await action.evaluate((element, selector) => Boolean(
|
||||
element.compareDocumentPosition(document.querySelector(selector)!) & Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
), SHARED_TASKS_SECTION)).toBe(true)
|
||||
expect(await row.evaluate(element => ({ tag: element.tagName, parent: element.parentElement?.tagName })))
|
||||
.toEqual({ tag: 'LI', parent: 'UL' })
|
||||
expect(await action.locator('[data-team-task-details], article').count()).toBe(0)
|
||||
expect(await action.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
await action.getByRole('heading', { name: 'Shared tasks 1 pending', exact: true }).waitFor()
|
||||
expect(await action.evaluate(element => getComputedStyle(element).padding)).toBe('6px')
|
||||
expect(await action.locator('[data-subagent-section-header]').evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { padding: style.padding, gap: style.gap }
|
||||
})).toEqual({ padding: '4px 7px 8px', gap: '7px' })
|
||||
expect(await action.locator('[data-team-panel]').getByRole('heading')
|
||||
.evaluate(element => getComputedStyle(element).columnGap)).toBe('7px')
|
||||
for (const [title, progress] of [
|
||||
[action.locator('[data-subagent-section-header]').getByRole('heading'), action.getByText('1 external', { exact: true })],
|
||||
[action.locator('[data-team-panel]').getByText('Shared tasks', { exact: true }), action.getByText('1 pending', { exact: true })],
|
||||
] as const) {
|
||||
expect(await progress.evaluate(element => getComputedStyle(element).marginInlineStart)).toBe('4px')
|
||||
const titleRight = await title.evaluate(element => element.getBoundingClientRect().right)
|
||||
const progressLeft = await progress.evaluate(element => element.getBoundingClientRect().left)
|
||||
expect(Math.abs(progressLeft - titleRight - 11)).toBeLessThanOrEqual(1)
|
||||
}
|
||||
expect(await tasks.locator('[data-team-task-details], article').count()).toBe(0)
|
||||
const tasksHead = tasks.getByRole('heading', { level: 2 }).locator('..')
|
||||
expect(await tasksHead.textContent()).toBe('Shared tasks1 pending')
|
||||
expect(await tasks.getByRole('heading', { level: 2 }).evaluate(element => getComputedStyle(element).font))
|
||||
.toBe(await action.getByRole('heading', { level: 2 }).evaluate(element => getComputedStyle(element).font))
|
||||
const member = action.getByRole('treeitem', { name: /Researcher/u })
|
||||
const memberTitle = member.getByText(RESEARCHER_DESCRIPTION, { exact: true })
|
||||
const taskTitle = row.getByText('Agent task', { exact: true })
|
||||
const titleLefts = await Promise.all([
|
||||
memberTitle,
|
||||
action.locator('[data-subagent-section-header]').getByRole('heading'),
|
||||
action.locator('[data-team-panel]').getByText('Shared tasks', { exact: true }),
|
||||
taskTitle,
|
||||
].map(locator => locator.evaluate(element => element.getBoundingClientRect().left)))
|
||||
expect(Math.max(...titleLefts) - Math.min(...titleLefts)).toBeLessThanOrEqual(1)
|
||||
@@ -438,8 +428,8 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
})))
|
||||
expect(primaryStyles.map(style => style.fontSize)).toEqual(['13px', '13px'])
|
||||
expect(primaryStyles[1]).toEqual(primaryStyles[0])
|
||||
expect(await member.getByText('team-panel-researcher', { exact: true })
|
||||
.evaluate(element => getComputedStyle(element).fontSize)).toBe('12px')
|
||||
// The member's name moves from the row to its hover card.
|
||||
expect(await member.getByText('team-panel-researcher', { exact: true }).count()).toBe(0)
|
||||
const memberHover = member.locator(':scope > div')
|
||||
for (const target of [member, memberHover]) {
|
||||
expect(await target.evaluate((element) => {
|
||||
@@ -447,27 +437,33 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
return [style.paddingTop, style.paddingBottom]
|
||||
})).toEqual(['4px', '4px'])
|
||||
}
|
||||
expect(await member.evaluate(element => getComputedStyle(element).minHeight)).toBe('40px')
|
||||
expect(await member.evaluate(element => getComputedStyle(element).minHeight)).toBe('28px')
|
||||
expect(await member.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { left: style.paddingLeft, right: style.paddingRight, gap: style.gap }
|
||||
})).toEqual({ left: '9px', right: '6px', gap: '7px' })
|
||||
})).toEqual({ left: '6px', right: '6px', gap: '8px' })
|
||||
expect(await memberHover.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { left: style.paddingLeft, right: style.paddingRight, gap: style.gap, margin: style.margin }
|
||||
})).toEqual({ left: '6px', right: '6px', gap: '7px', margin: '-4px -6px' })
|
||||
})).toEqual({ left: '6px', right: '6px', gap: '8px', margin: '-4px -6px' })
|
||||
const taskHover = row.getByRole('button')
|
||||
expect(await taskHover.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return [style.paddingTop, style.paddingBottom]
|
||||
})).toEqual(['7px', '7px'])
|
||||
expect(await taskHover.evaluate(element => element.getBoundingClientRect().height)).toBe(31)
|
||||
})).toEqual(['4px', '4px'])
|
||||
expect(await taskHover.evaluate(element => element.getBoundingClientRect().height)).toBe(28)
|
||||
expect(await taskHover.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { left: style.paddingLeft, right: style.paddingRight, gap: style.gap, margin: style.margin }
|
||||
})).toEqual({ left: '6px', right: '6px', gap: '7px', margin: '0px -6px' })
|
||||
expect(await taskHover.evaluate(element => element.getBoundingClientRect().width
|
||||
- element.parentElement!.getBoundingClientRect().width)).toBe(12)
|
||||
})).toEqual({ left: '6px', right: '6px', gap: '8px', margin: '0px' })
|
||||
// Status glyphs and trailing chevrons of both rows share their columns.
|
||||
const columns = await Promise.all([
|
||||
member.locator('[data-state]').first(), row.locator('[data-state]').first(),
|
||||
].map(locator => locator.evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
return bounds.left + bounds.width / 2
|
||||
})))
|
||||
expect(Math.abs(columns[0]! - columns[1]!)).toBeLessThanOrEqual(0.5)
|
||||
const hoverStyles = []
|
||||
for (const target of [memberHover, taskHover]) {
|
||||
await target.hover()
|
||||
@@ -488,26 +484,28 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
expect(await row.locator('[data-team-task-details]').evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { fontSize: style.fontSize, indent: style.paddingLeft }
|
||||
})).toEqual({ fontSize: '12px', indent: '21px' })
|
||||
})).toEqual({ fontSize: '12px', indent: '30px' })
|
||||
expect(await row.locator('[data-team-task-details] p, [data-team-task-owner]')
|
||||
.evaluateAll(elements => elements.every(element => getComputedStyle(element).fontSize === '12px'))).toBe(true)
|
||||
expect(await row.getByRole('button').getAttribute('aria-expanded')).toBe('true')
|
||||
expect(await action.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
await scaffold.ctx.agentTeams.updateTask(agent, {
|
||||
taskId: task.id, expectedRevision: task.revision, action: 'claim',
|
||||
})
|
||||
await row.getByRole('img', { name: 'In progress', exact: true }).waitFor()
|
||||
await row.locator('[data-team-task-owner]').filter({ hasText: 'Owner: lead' }).waitFor()
|
||||
await action.getByRole('heading', { name: 'Shared tasks 1 in progress', exact: true }).waitFor()
|
||||
expect(await action.getByRole('button', { name: /^(New task|Edit|Complete|Reopen|Delete)$/u }).count()).toBe(0)
|
||||
expect(await action.locator('input, select, textarea').count()).toBe(0)
|
||||
await tasks.getByText('1 in progress', { exact: true }).waitFor()
|
||||
expect(await tasks.getByRole('button', { name: /^(New task|Edit|Complete|Reopen|Delete)$/u }).count()).toBe(0)
|
||||
expect(await tasks.locator('input, select, textarea').count()).toBe(0)
|
||||
|
||||
const snapshot = await captureStableAria(page, '[data-subagent-panel]', scaffold.workspaceCwd)
|
||||
// The working directory row abbreviates the home directory, which holds the scratch workspace on CI.
|
||||
const snapshot = await captureStableAria(page, '[data-session-panel]', scaffold.workspaceCwd, {
|
||||
replacements: [[abbreviateHomePath(scaffold.workspaceCwd, homedir()), '{{cwd}}']],
|
||||
})
|
||||
await compareOrRefreshGolden(PANEL_EXPECTED, snapshot, MODE)
|
||||
expect(projectionReads).not.toHaveBeenCalled()
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
await page.keyboard.press('Escape')
|
||||
await dismissSessionPanel(page)
|
||||
}, 60_000)
|
||||
|
||||
it('hides the board while disabled and restores its tasks when re-enabled', async () => {
|
||||
@@ -515,94 +513,47 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
const toggle = page.getByRole('switch', { name: 'Enable agent teamwork', exact: true })
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('false')
|
||||
expect(await page.locator('[data-subagent-action]').count()).toBe(1)
|
||||
await closeModelMenu(page)
|
||||
await page.locator('[data-subagent-action]').getByRole('button', { name: '1 subagent', exact: true }).click()
|
||||
await page.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
const section = await showSubagentsSection(page)
|
||||
await section.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
expect(await page.locator('[data-subagents-section]').count()).toBe(1)
|
||||
expect(await page.locator('[data-team-panel]').count()).toBe(0)
|
||||
expect(await page.locator('[data-subagent-panel]').evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
expect(await page.locator('[data-subagent-section-header]').count()).toBe(0)
|
||||
await page.keyboard.press('Escape')
|
||||
await dismissSessionPanel(page)
|
||||
await openTeamSettings(page)
|
||||
await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-checked')).toBe('true')
|
||||
await closeModelMenu(page)
|
||||
await page.locator('[data-subagent-action]').getByRole('button', { name: /subagents?$/u }).click()
|
||||
await page.locator('[data-subagent-panel]').getByText('Agent task', { exact: true }).waitFor()
|
||||
await page.keyboard.press('Escape')
|
||||
await (await showSharedTasksSection(page)).getByText('Agent task', { exact: true }).waitFor()
|
||||
await dismissSessionPanel(page)
|
||||
})
|
||||
|
||||
it('keeps the narrow Users trigger focused and opens its catalog only on explicit activation', async () => {
|
||||
it('keeps the toggle focused in a narrow window and opens the catalog only on explicit activation', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-narrow-trigger'))
|
||||
const trigger = page.locator('[data-subagent-action]').getByRole('button', { name: '1 subagent', exact: true })
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
const count = trigger.locator('[data-subagent-count]')
|
||||
const trigger = sessionPanelToggle(page)
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
const viewport = page.viewportSize()!
|
||||
expect(await count.isVisible()).toBe(true)
|
||||
expect(await trigger.locator('[data-icon="dsw-icon-users-outline-regular"]').count()).toBe(1)
|
||||
expect(await trigger.locator('[data-icon="dsw-icon-users-outline-regular"]').evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
return { width: bounds.width, height: bounds.height }
|
||||
})).toEqual({ width: 14, height: 14 })
|
||||
expect(await trigger.locator('[data-icon="dsw-icon-chevron-down-outline-regular"]').count()).toBe(0)
|
||||
expect(await trigger.locator('svg').count()).toBe(1)
|
||||
await trigger.focus()
|
||||
const original = await trigger.elementHandle()
|
||||
if (original === null) throw new Error('Subagent trigger is missing')
|
||||
if (original === null) throw new Error('Session panel toggle is missing')
|
||||
try {
|
||||
await page.setViewportSize({ width: 390, height: 700 })
|
||||
await expect.poll(() => count.evaluate(element => getComputedStyle(element).display)).toBe('none')
|
||||
expect(await original.evaluate(element => element.isConnected && element === document.activeElement)).toBe(true)
|
||||
const expandSidebar = page.locator('[data-sidebar-right-expand]')
|
||||
const compactStyles = await Promise.all([trigger, expandSidebar].map(control => control.evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
const icon = element.querySelector('svg')!.getBoundingClientRect()
|
||||
const style = getComputedStyle(element)
|
||||
return { width: bounds.width, height: bounds.height, padding: style.padding, radius: style.borderRadius,
|
||||
color: style.color, iconWidth: icon.width, iconHeight: icon.height }
|
||||
})))
|
||||
expect(compactStyles[0]).toEqual(compactStyles[1])
|
||||
expect(compactStyles[0]).toMatchObject({ width: 28, height: 28, padding: '0px', iconWidth: 15, iconHeight: 15 })
|
||||
expect(await trigger.evaluate(element => getComputedStyle(element.closest('[data-slot="conversation.session.header.actions"]')!.parentElement!).gap)).toBe('8px')
|
||||
await expandSidebar.hover()
|
||||
const expandHover = await expandSidebar.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { background: style.backgroundColor, color: style.color }
|
||||
})
|
||||
await page.mouse.move(1, 1)
|
||||
await page.keyboard.press('Tab')
|
||||
const countTooltip = page.getByRole('tooltip', { name: '1 subagent', exact: true })
|
||||
await countTooltip.waitFor({ state: 'hidden' })
|
||||
await trigger.hover()
|
||||
expect(await trigger.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { background: style.backgroundColor, color: style.color }
|
||||
})).toEqual(expandHover)
|
||||
expect(expandHover.background).not.toBe('rgba(0, 0, 0, 0)')
|
||||
// Observe beyond the wide trigger's 150ms hover-open deadline.
|
||||
// Hover alone opens nothing, even past the 150ms delay of hover-opened subagent menus.
|
||||
await page.waitForTimeout(200)
|
||||
expect(await panel.count()).toBe(0)
|
||||
await countTooltip.waitFor({ state: 'visible' })
|
||||
expect(await panel.count()).toBe(0)
|
||||
await trigger.click()
|
||||
await panel.waitFor()
|
||||
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
|
||||
expect(await trigger.getAttribute('aria-expanded')).toBe('true')
|
||||
expect(await page.getByRole('tooltip', { name: '1 subagent', exact: true }).count()).toBe(0)
|
||||
await panel.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
const section = panel.locator(SUBAGENTS_SECTION)
|
||||
await section.getByRole('treeitem', { name: /Researcher/u }).waitFor()
|
||||
await panel.locator('[data-team-task]').getByRole('button', { expanded: false }).waitFor()
|
||||
await trigger.click()
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
expect(await trigger.getAttribute('aria-expanded')).toBe('false')
|
||||
await trigger.press('ArrowDown')
|
||||
await panel.waitFor()
|
||||
await page.mouse.move(1, 1)
|
||||
// Keyboard activation stays pinned beyond the 120ms pointer-leave grace.
|
||||
await page.waitForTimeout(180)
|
||||
expect(await panel.count()).toBe(1)
|
||||
await page.keyboard.press('Escape')
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
} finally {
|
||||
await page.keyboard.press('Escape')
|
||||
await page.setViewportSize(viewport)
|
||||
await original.dispose()
|
||||
}
|
||||
@@ -610,56 +561,77 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
|
||||
it('keeps the panel inside the viewport and closes on outside click or Escape', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-agent-team-panel-keyboard'))
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
const trigger = page.locator('[data-subagent-action]').getByRole('button', { name: /subagents?$/u })
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
const section = panel.locator(SUBAGENTS_SECTION)
|
||||
const tasksHeading = panel.locator(SHARED_TASKS_SECTION).getByRole('heading', { name: 'Shared tasks', exact: true })
|
||||
const trigger = sessionPanelToggle(page)
|
||||
const viewport = page.viewportSize()!
|
||||
await trigger.click()
|
||||
await panel.getByRole('heading', { name: /Shared tasks/u }).waitFor()
|
||||
try {
|
||||
for (const size of [{ width: 760, height: 540 }, { width: 600, height: 420 }, { width: 390, height: 700 }]) {
|
||||
await page.setViewportSize(size)
|
||||
await showSessionPanel(page)
|
||||
await tasksHeading.waitFor()
|
||||
await expect.poll(() => panel.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect()
|
||||
return element.parentElement === document.body
|
||||
&& rect.left >= 16 && rect.top >= 16
|
||||
&& rect.right <= window.innerWidth - 16 && rect.bottom <= window.innerHeight - 16
|
||||
return element.getAttribute('data-session-panel') === 'overlay'
|
||||
&& rect.left >= 0 && rect.top >= 0
|
||||
&& rect.right <= window.innerWidth && rect.bottom <= window.innerHeight
|
||||
&& [[rect.left + 12, rect.top + 12], [rect.right - 12, rect.bottom - 12]]
|
||||
.every(([x, y]) => element.contains(document.elementFromPoint(x!, y!)))
|
||||
})).toBe(true)
|
||||
}
|
||||
const row = panel.getByRole('treeitem', { name: /Researcher/u })
|
||||
const row = section.getByRole('treeitem', { name: /Researcher/u })
|
||||
const primary = row.getByText(RESEARCHER_DESCRIPTION, { exact: true })
|
||||
const secondary = row.getByText('team-panel-researcher', { exact: true })
|
||||
expect(await row.getByRole('button').count()).toBe(0)
|
||||
expect(await primary.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return {
|
||||
tag: element.tagName, clipped: element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight,
|
||||
whiteSpace: style.whiteSpace, overflowWrap: style.overflowWrap,
|
||||
}
|
||||
})).toEqual({ tag: 'SPAN', clipped: false, whiteSpace: 'normal', overflowWrap: 'anywhere' })
|
||||
const primaryBounds = await primary.boundingBox()
|
||||
const secondaryBounds = await secondary.boundingBox()
|
||||
expect(primaryBounds).not.toBeNull()
|
||||
expect(secondaryBounds).not.toBeNull()
|
||||
expect(primaryBounds!.y + primaryBounds!.height).toBeLessThanOrEqual(secondaryBounds!.y)
|
||||
// The row keeps one line at every width: the description clips, and the name shows in its hover card.
|
||||
expect(await primary.evaluate(element => ({ tag: element.tagName, whiteSpace: getComputedStyle(element).whiteSpace })))
|
||||
.toEqual({ tag: 'SPAN', whiteSpace: 'nowrap' })
|
||||
expect(await row.getByText('team-panel-researcher', { exact: true }).count()).toBe(0)
|
||||
expect(await panel.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true)
|
||||
await primary.hover()
|
||||
const card = page.locator('[data-session-panel-details]')
|
||||
await card.waitFor()
|
||||
expect(await card.evaluate(element => [...element.children].slice(0, 2).map(child => child.textContent)))
|
||||
.toEqual([RESEARCHER_DESCRIPTION, 'Owner: team-panel-researcher'])
|
||||
// The window has room for the card on neither side of the row, and this description fills a card too
|
||||
// tall to open under or over the row, so the card covers the row; it stays inside the viewport.
|
||||
expect(await card.evaluate((element) => {
|
||||
// The details sit inside the fixed card.
|
||||
let fixed = element
|
||||
while (getComputedStyle(fixed).position !== 'fixed') fixed = fixed.parentElement!
|
||||
const rect = fixed.getBoundingClientRect()
|
||||
return rect.left >= 0 && rect.top >= 0 && rect.right <= window.innerWidth && rect.bottom <= window.innerHeight
|
||||
})).toBe(true)
|
||||
await page.mouse.move(20, 400)
|
||||
await card.waitFor({ state: 'detached' })
|
||||
// A card that fits under its row opens there, from the row's start edge and inside the viewport's
|
||||
// margin, so the row stays clear.
|
||||
const task = panel.locator('[data-team-task]').getByRole('button')
|
||||
await task.hover()
|
||||
await card.waitFor()
|
||||
const anchor = await task.locator('xpath=..').boundingBox()
|
||||
if (anchor === null) throw new Error('the task row has no box')
|
||||
const placed = await card.evaluate((element) => {
|
||||
let fixed = element
|
||||
while (getComputedStyle(fixed).position !== 'fixed') fixed = fixed.parentElement!
|
||||
const bounds = fixed.getBoundingClientRect()
|
||||
return { left: bounds.left, top: bounds.top, right: bounds.right, viewport: window.innerWidth }
|
||||
})
|
||||
expect({ below: placed.top - (anchor.y + anchor.height), start: placed.left - anchor.x }).toEqual({ below: 8, start: 0 })
|
||||
expect(placed.right).toBeLessThanOrEqual(placed.viewport - 8)
|
||||
const beforeClick = page.url()
|
||||
await primary.click()
|
||||
expect(page.url()).toBe(beforeClick)
|
||||
expect(await page.getByRole('tooltip', { name: RESEARCHER_DESCRIPTION, exact: true }).count()).toBe(0)
|
||||
expect(await panel.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true)
|
||||
expect(await secondary.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true)
|
||||
await secondary.hover()
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
await panel.getByRole('heading', { name: /Shared tasks/u }).click()
|
||||
await tasksHeading.click()
|
||||
expect(await panel.count()).toBe(1)
|
||||
await page.mouse.click(2, 2)
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
await page.setViewportSize(viewport)
|
||||
await trigger.focus()
|
||||
await page.keyboard.press('Enter')
|
||||
await panel.getByRole('heading', { name: /Shared tasks/u }).waitFor()
|
||||
expect(await panel.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await tasksHeading.waitFor()
|
||||
await panel.locator('[data-team-task]').getByRole('button').focus()
|
||||
await page.keyboard.press('Escape')
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
expect(await trigger.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
@@ -676,24 +648,7 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps the hovered panel open when the pointer returns directly to its trigger', async () => {
|
||||
onTestFailed(async () => {
|
||||
await saveFailureShot(page, 'web-e2e-agent-team-hover')
|
||||
console.error('Agent Team hover diagnostics', JSON.stringify({ errors: tripwire.pageErrors, warnings: tripwire.warnings }))
|
||||
})
|
||||
const trigger = page.locator('[data-subagent-action]').getByRole('button', { name: /subagents?$/u })
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
await trigger.hover()
|
||||
await panel.waitFor()
|
||||
await panel.hover()
|
||||
await trigger.hover()
|
||||
// The assertion spans the 120ms dismissal grace while the pointer stays on the trigger.
|
||||
await page.waitForTimeout(180)
|
||||
expect(await panel.count()).toBe(1)
|
||||
await page.keyboard.press('Escape')
|
||||
})
|
||||
|
||||
it('keeps compact tasks ordered, opens one full detail at a time, and scrolls only the fixed-width menu', async () => {
|
||||
it('keeps compact tasks ordered, opens one full detail at a time, and scrolls only the Session panel', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-compact-details'))
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
const completed = await scaffold.ctx.agentTeams.createTask(agent, {
|
||||
@@ -714,64 +669,46 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
subject, description, blockedBy: [blocker.id], writeScopes: ['src/web/components'],
|
||||
})
|
||||
const viewport = page.viewportSize()!
|
||||
const trigger = page.locator('[data-subagent-action]').getByRole('button', { name: /subagents?$/u })
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
const board = panel.locator('[data-team-panel]')
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
const section = panel.locator(SHARED_TASKS_SECTION)
|
||||
const board = section.locator('[data-team-panel]')
|
||||
const row = board.locator(`[data-team-task="${task.id}"]`)
|
||||
const emptyRow = board.locator(`[data-team-task="${completed.id}"]`)
|
||||
onTestFinished(() => page.setViewportSize(viewport))
|
||||
// Constrain the menu so closed and expanded task rows both exercise its scrollbar.
|
||||
await page.setViewportSize({ width: viewport.width, height: 540 })
|
||||
await trigger.click()
|
||||
// Constrain the panel so closed and expanded task rows both exercise its scrollbar.
|
||||
await page.setViewportSize({ width: viewport.width, height: 500 })
|
||||
await showSharedTasksSection(page)
|
||||
await row.waitFor()
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
expect(await board.locator('[data-team-task-details], article').count()).toBe(0)
|
||||
expect(await board.getByRole('button', { expanded: false }).count()).toBe(4)
|
||||
expect(await board.locator('[data-team-task]').evaluateAll(elements => elements.map(element => element.getAttribute('data-status'))))
|
||||
.toEqual(['in_progress', 'completed', 'pending', 'pending'])
|
||||
const counts = board.getByText('1 completed\u2002·\u20021 in progress\u2002·\u20022 pending', { exact: true })
|
||||
.toEqual(['in_progress', 'pending', 'pending', 'completed'])
|
||||
const counts = section.getByText('1 completed\u2002·\u20021 in progress\u2002·\u20022 pending', { exact: true })
|
||||
await counts.waitFor()
|
||||
expect(await counts.textContent()).toBe('1 completed\u2002·\u20021 in progress\u2002·\u20022 pending')
|
||||
expect(await panel.locator('[data-subagent-section-header] button, h3 button').count()).toBe(0)
|
||||
expect(await panel.getByRole('button', { name: /^Show (more|less)$/u }).count()).toBe(0)
|
||||
expect(await section.locator('h2 button, h3 button').count()).toBe(0)
|
||||
expect(await section.getByRole('button', { name: /^Show (more|less)$/u }).count()).toBe(0)
|
||||
await row.getByRole('img', { name: 'Blocked by dependencies', exact: true }).waitFor()
|
||||
// The panel itself scrolls; its client box ends where its scrollbar track begins.
|
||||
const measureScroll = async () => panel.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
const bounds = element.getBoundingClientRect()
|
||||
const scroller = element.querySelector('[role="tree"]')!.parentElement!
|
||||
const scrollStyle = getComputedStyle(scroller)
|
||||
const scrollBounds = scroller.getBoundingClientRect()
|
||||
const taskBounds = element.querySelector('[data-team-task] button')!.getBoundingClientRect()
|
||||
const scrollbarWidth = Number.parseFloat(getComputedStyle(scroller, '::-webkit-scrollbar').width)
|
||||
const trackLeft = bounds.left + element.clientLeft + element.clientWidth
|
||||
return {
|
||||
innerWidth: bounds.width - Number.parseFloat(style.paddingLeft) - Number.parseFloat(style.paddingRight)
|
||||
- Number.parseFloat(style.borderLeftWidth) - Number.parseFloat(style.borderRightWidth),
|
||||
clientWidth: scroller.clientWidth, clientHeight: scroller.clientHeight, scrollHeight: scroller.scrollHeight,
|
||||
overflowing: scroller.scrollHeight > scroller.clientHeight,
|
||||
gutter: scrollStyle.scrollbarGutter, marginRight: scrollStyle.marginRight,
|
||||
trackMargin: scrollStyle.getPropertyValue('--dsh-scrollbar-track-margin').trim(),
|
||||
overflowing: element.scrollHeight > element.clientHeight,
|
||||
taskLeft: taskBounds.left, taskRight: taskBounds.right,
|
||||
trackLeft: scrollBounds.right - scrollbarWidth, trackRight: scrollBounds.right, panelRight: bounds.right,
|
||||
arrowsBeforeTrack: [...element.querySelectorAll('[data-team-task] button svg')]
|
||||
.every(arrow => arrow.getBoundingClientRect().right <= scrollBounds.right - scrollbarWidth),
|
||||
.every(arrow => arrow.getBoundingClientRect().right <= trackLeft),
|
||||
}
|
||||
})
|
||||
const closedScroll = await measureScroll()
|
||||
expect(closedScroll.overflowing, JSON.stringify(closedScroll)).toBe(true)
|
||||
expect(Math.abs(closedScroll.clientWidth - closedScroll.innerWidth), JSON.stringify(closedScroll)).toBeLessThanOrEqual(1)
|
||||
expect(closedScroll.gutter).toBe('stable')
|
||||
expect(closedScroll.marginRight).toBe('-5px')
|
||||
expect(closedScroll.trackMargin).toBe('6px')
|
||||
await row.getByRole('button').click()
|
||||
const expandedScroll = await measureScroll()
|
||||
expect(expandedScroll.overflowing).toBe(true)
|
||||
expect(expandedScroll.clientWidth).toBe(closedScroll.clientWidth)
|
||||
expect(expandedScroll.taskLeft).toBe(closedScroll.taskLeft)
|
||||
expect(expandedScroll.taskRight).toBe(closedScroll.taskRight)
|
||||
expect(expandedScroll.arrowsBeforeTrack).toBe(true)
|
||||
expect(expandedScroll.trackLeft).toBeGreaterThanOrEqual(expandedScroll.panelRight - 6)
|
||||
expect(expandedScroll.trackRight).toBeLessThanOrEqual(expandedScroll.panelRight - 1)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
const details = row.locator('[data-team-task-details]')
|
||||
expect(await details.locator('p:not([data-team-task-owner])').textContent()).toBe(description)
|
||||
expect(await details.locator('[data-team-task-owner]').textContent()).toBe('Owner: Unowned')
|
||||
@@ -786,35 +723,32 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await page.setViewportSize({ width: 390, height: 700 })
|
||||
await expect.poll(() => panel.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect()
|
||||
return rect.width === Math.min(360, innerWidth - 32) && rect.left >= 16 && rect.right <= innerWidth - 16
|
||||
&& rect.top >= 16 && rect.bottom <= innerHeight - 16
|
||||
return element.getAttribute('data-session-panel') === 'overlay'
|
||||
&& rect.left >= 0 && rect.right <= innerWidth && rect.top >= 0 && rect.bottom <= innerHeight
|
||||
&& element.scrollWidth <= element.clientWidth
|
||||
})).toBe(true)
|
||||
expect(await panel.locator('*').evaluateAll((elements) => {
|
||||
const scrollers = elements.filter(element =>
|
||||
expect(await panel.evaluate((panelElement) => {
|
||||
const scrollers = [panelElement, ...panelElement.querySelectorAll('*')].filter(element =>
|
||||
['auto', 'scroll'].includes(getComputedStyle(element).overflowY)
|
||||
&& element.scrollHeight > element.clientHeight)
|
||||
return scrollers.map(element => ({
|
||||
hasHeader: element.querySelector('[data-subagent-section-header]') !== null,
|
||||
panel: element === panelElement,
|
||||
hasTree: element.querySelector('[role="tree"]') !== null,
|
||||
hasBoard: element.querySelector('[data-team-panel]') !== null,
|
||||
fitsWidth: element.scrollWidth <= element.clientWidth,
|
||||
}))
|
||||
})).toEqual([{ hasHeader: true, hasTree: true, hasBoard: true, fitsWidth: true }])
|
||||
const narrowScroll = await measureScroll()
|
||||
expect(Math.abs(narrowScroll.clientWidth - narrowScroll.innerWidth), JSON.stringify(narrowScroll)).toBeLessThanOrEqual(1)
|
||||
expect(narrowScroll.arrowsBeforeTrack).toBe(true)
|
||||
const scroller = panel.getByRole('tree').locator('..')
|
||||
await scroller.hover({ position: { x: 20, y: 20 } })
|
||||
})).toEqual([{ panel: true, hasTree: true, hasBoard: true, fitsWidth: true }])
|
||||
expect((await measureScroll()).arrowsBeforeTrack).toBe(true)
|
||||
await panel.hover({ position: { x: 20, y: 20 } })
|
||||
await Promise.all([
|
||||
scroller.evaluate(element => new Promise<void>((resolve) => {
|
||||
panel.evaluate(element => new Promise<void>((resolve) => {
|
||||
element.addEventListener('scrollend', () => { resolve() }, { once: true })
|
||||
})),
|
||||
page.mouse.wheel(0, 180),
|
||||
])
|
||||
await expect.poll(() => scroller.evaluate(element => element.scrollTop)).toBeGreaterThan(0)
|
||||
await scroller.evaluate((element) => { element.scrollTo({ top: 0 }) })
|
||||
await expect.poll(() => scroller.evaluate(element => element.scrollTop)).toBe(0)
|
||||
await expect.poll(() => panel.evaluate(element => element.scrollTop)).toBeGreaterThan(0)
|
||||
await panel.evaluate((element) => { element.scrollTo({ top: 0 }) })
|
||||
await expect.poll(() => panel.evaluate(element => element.scrollTop)).toBe(0)
|
||||
expect(await row.getByText(subject, { exact: true }).evaluate(element =>
|
||||
element.scrollWidth <= element.clientWidth && getComputedStyle(element).whiteSpace === 'pre-wrap')).toBe(true)
|
||||
expect(await details.locator('p:not([data-team-task-owner])').evaluate(element => element.scrollHeight === element.clientHeight)).toBe(true)
|
||||
@@ -828,13 +762,17 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
expect(await details.locator('[data-team-task-owner], [data-team-task-owner] span')
|
||||
.evaluateAll(elements => elements.map(element => getComputedStyle(element).color)))
|
||||
.toEqual([detailColor, detailColor, detailColor])
|
||||
expect(await counts.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true)
|
||||
const titleBounds = await board.getByText('Shared tasks', { exact: true }).boundingBox()
|
||||
// Long progress clips on the title's line; the title itself keeps its full width.
|
||||
const title = section.getByRole('heading', { name: 'Shared tasks', exact: true })
|
||||
expect(await title.evaluate(element => element.scrollWidth <= element.clientWidth)).toBe(true)
|
||||
const titleBounds = await title.boundingBox()
|
||||
const countBounds = await counts.boundingBox()
|
||||
const sectionBounds = await section.boundingBox()
|
||||
expect(titleBounds).not.toBeNull()
|
||||
expect(countBounds).not.toBeNull()
|
||||
expect(countBounds!.y).toBeGreaterThanOrEqual(titleBounds!.y + titleBounds!.height)
|
||||
await compareOrRefreshGolden(RESIZE_EXPECTED, await captureStableAria(page, '[data-subagent-panel]', scaffold.workspaceCwd), MODE)
|
||||
expect(Math.abs((countBounds!.y + countBounds!.height / 2) - (titleBounds!.y + titleBounds!.height / 2))).toBeLessThanOrEqual(1)
|
||||
expect(countBounds!.x + countBounds!.width).toBeLessThanOrEqual(sectionBounds!.x + sectionBounds!.width)
|
||||
await compareOrRefreshGolden(RESIZE_EXPECTED, await captureStableAria(page, SHARED_TASKS_SECTION, scaffold.workspaceCwd), MODE)
|
||||
await emptyRow.getByRole('button').click()
|
||||
expect(await row.getAttribute('data-expanded')).toBe('false')
|
||||
expect(await row.locator('[data-team-task-details]').count()).toBe(0)
|
||||
@@ -846,13 +784,45 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
await emptyRow.getByRole('button').click()
|
||||
expect(await board.locator('[data-team-task-details]').count()).toBe(0)
|
||||
await page.setViewportSize(viewport)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
} finally {
|
||||
await page.keyboard.press('Escape')
|
||||
await page.setViewportSize(viewport)
|
||||
}
|
||||
})
|
||||
|
||||
it('holds back the tasks past five behind the fold control and keeps the choice while the panel is hidden', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-task-fold'))
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
const before = scaffold.ctx.agentTeams.listTasks(agent).filter(task => task.status !== 'deleted')
|
||||
// The tasks so far: one in progress, pending ones, and a completed one. Pending tasks bring the list to eight.
|
||||
for (let index = before.length; index < 8; index++) {
|
||||
await scaffold.ctx.agentTeams.createTask(agent, { subject: `Fold task ${String(index)}`, description: 'Fills the list.', writeScopes: [] })
|
||||
}
|
||||
const section = await showSharedTasksSection(page)
|
||||
const tasks = section.locator('[data-team-task]')
|
||||
const fold = section.locator('[data-session-panel-row="fold"]')
|
||||
const statuses = (): Promise<(string | null)[]> => tasks.evaluateAll(items => items.map(item => item.getAttribute('data-status')))
|
||||
// Five tasks show: the one in progress, then pending ones in source order. The completed task is held back.
|
||||
await expect.poll(statuses, { timeout: 15_000 }).toEqual(['in_progress', 'pending', 'pending', 'pending', 'pending'])
|
||||
expect(await fold.textContent()).toBe('Show 3 more')
|
||||
// The control follows the list, at the row height, with its chevron under the state marks and its text under the subjects.
|
||||
expect(await section.getByRole('list').locator('[data-session-panel-row="fold"]').count()).toBe(0)
|
||||
expect(await foldControlLayout(fold, tasks.first().getByRole('button'), '[class*="subject"]'))
|
||||
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
|
||||
await section.getByRole('button', { name: 'Show 3 more (shared tasks)', exact: true }).click()
|
||||
await expect.poll(statuses).toEqual(['in_progress', 'pending', 'pending', 'pending', 'pending', 'pending', 'pending', 'completed'])
|
||||
const less = section.getByRole('button', { name: 'Show less (shared tasks)', exact: true })
|
||||
expect([await less.textContent(), await less.getAttribute('aria-expanded')]).toEqual(['Show less', 'true'])
|
||||
// The choice is the Session's: it holds while the panel is hidden.
|
||||
await dismissSessionPanel(page)
|
||||
await showSharedTasksSection(page)
|
||||
await expect.poll(() => tasks.count()).toBe(8)
|
||||
await less.click()
|
||||
await expect.poll(() => tasks.count()).toBe(5)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
await dismissSessionPanel(page)
|
||||
})
|
||||
|
||||
it('confirms disabling after a recorded model request and keeps cancellation side-effect free', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-team-disable-confirmation'))
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
@@ -897,24 +867,21 @@ describe('web e2e: agent teamwork panel', () => {
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('removes both section headings and the board divider when the last shared task is deleted', async () => {
|
||||
it('hides the Shared tasks section when the last shared task is deleted', async () => {
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).click()
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
await panel.locator('[data-team-panel]').waitFor()
|
||||
const tasks = await showSharedTasksSection(page)
|
||||
await tasks.locator('[data-team-panel]').waitFor()
|
||||
for (const task of scaffold.ctx.agentTeams.listTasks(agent).toReversed()) {
|
||||
if (task.status === 'deleted') continue
|
||||
await scaffold.ctx.agentTeams.updateTask(agent, {
|
||||
taskId: task.id, expectedRevision: task.revision, action: 'delete',
|
||||
})
|
||||
}
|
||||
await panel.locator('[data-team-panel]').waitFor({ state: 'detached' })
|
||||
expect(await panel.locator('[data-subagent-section-header]').count()).toBe(0)
|
||||
expect(await panel.getByRole('heading').count()).toBe(0)
|
||||
expect(await panel.getByText('No shared tasks yet. Create them through the conversation.').count()).toBe(0)
|
||||
expect(await panel.getByRole('treeitem', { name: /Researcher/u }).count()).toBe(1)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
await page.keyboard.press('Escape')
|
||||
await tasks.locator('[data-team-panel]').waitFor({ state: 'detached' })
|
||||
await tasks.waitFor({ state: 'hidden' })
|
||||
expect(await page.getByText('No shared tasks yet. Create them through the conversation.').count()).toBe(0)
|
||||
expect(await page.locator(SUBAGENTS_SECTION).getByRole('treeitem', { name: /Researcher/u }).count()).toBe(1)
|
||||
await dismissSessionPanel(page)
|
||||
})
|
||||
|
||||
it.skipIf(MODE === 'record')('keeps the fixture inventory closed', async () => {
|
||||
@@ -1047,21 +1014,19 @@ it.each(RECEIPT_LOCALES)('renders historical Team failures in $language without
|
||||
})
|
||||
})
|
||||
|
||||
it('shows the Chinese empty subagent section above compact shared tasks', async () => {
|
||||
it('shows the Chinese Shared tasks section without subagents', async () => {
|
||||
await withTeamReceiptPage(RECEIPT_LOCALES[1], async (page, scaffold) => {
|
||||
const agent = scaffold.ctx.agents.list()[0]!
|
||||
await scaffold.ctx.agentTeams.setEnabled(agent, true)
|
||||
await scaffold.ctx.agentTeams.createTask(agent, {
|
||||
subject: '准备协作', description: '先准备共享任务,再创建子智能体。',
|
||||
})
|
||||
await page.getByRole('button', { name: '0 个子智能体', exact: true }).click()
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
await panel.getByText('暂无子智能体', { exact: true }).waitFor()
|
||||
expect(await panel.locator('[data-subagent-section-header]').textContent()).toBe('子智能体')
|
||||
expect(await panel.locator('[data-subagent-section-header] button, h3 button').count()).toBe(0)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
await panel.getByRole('heading', { name: '共享任务 1 待处理', exact: true }).waitFor()
|
||||
expect(await panel.locator('[data-team-task-details]').count()).toBe(0)
|
||||
const section = await showSharedTasksSection(page)
|
||||
await section.getByText('准备协作', { exact: true }).waitFor()
|
||||
expect(await section.getByRole('heading', { level: 2 }).locator('..').textContent()).toBe('共享任务1 待处理')
|
||||
expect(await section.locator('h2 button, h3 button').count()).toBe(0)
|
||||
expect(await section.locator('[data-team-task-details]').count()).toBe(0)
|
||||
expect(await page.locator(SUBAGENTS_SECTION).isVisible()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -10,9 +10,8 @@ const PANELS = [
|
||||
{ file: 'client/ui-schedule/src/client/TaskMenu.module.css', classes: 'list portal scrollable alignEnd', align: 'end' },
|
||||
{ file: 'client/ui-schedule/src/client/PickerPopover.module.css', classes: 'panel', align: 'start' },
|
||||
{ file: 'client/ui-schedule/src/client/ScheduleCatalogAction.module.css', classes: 'menu', align: 'start' },
|
||||
{ file: 'client/ui-subagent/src/client/SubagentHeaderLineage.module.css', classes: 'menu', align: 'start' },
|
||||
{ file: 'client/ui-subagent/src/client/SubagentCatalog.module.css', classes: 'menu', align: 'start' },
|
||||
{ file: 'client/ui-approval/src/client/ApprovalPanel.module.css', classes: 'warningPopover', align: 'end' },
|
||||
{ file: 'client/ui-jobs/src/client/JobListAction.module.css', classes: 'menu', align: 'start' },
|
||||
{ file: 'client/ui-conversation/src/client/skeleton/ContextMeter.module.css', classes: 'panel', align: 'start' },
|
||||
{ file: 'client/ui-chat/src/client/chat/stat-dialog.module.css', classes: 'panel', align: 'start' },
|
||||
{ file: 'client/ui-sidebar-documentpreview/src/client/office/FontNotice.module.css', classes: 'panel', align: 'start' },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
|
||||
// Session-header background jobs driven by a real `ctx.jobs` entry. No model
|
||||
// call is involved.
|
||||
// The Session panel's background-jobs section driven by a real `ctx.jobs`
|
||||
// entry. No model call is involved.
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join } from 'node:path'
|
||||
@@ -16,12 +16,13 @@ import {
|
||||
assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { foldControlLayout, newEnglishPage, saveFailureShot, sessionPanelToggle, showSessionPanel } from './support.ts'
|
||||
|
||||
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('../../../snapshots/web/background-job-list', import.meta.url))
|
||||
const RUNNING_EXPECTED = join(SNAPSHOT_DIR, 'running.expected.md')
|
||||
const SETTLED_EXPECTED = join(SNAPSHOT_DIR, 'settled.expected.md')
|
||||
const SECTION = '[data-session-panel-section="background-jobs"]'
|
||||
const MODE = webSnapshotMode()
|
||||
const SEED_ID = 'background-job-list-web-e2e'
|
||||
// A hold on a barrier file the test owns in the job's cwd: the process never
|
||||
@@ -82,12 +83,18 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
|
||||
await scaffold?.close()
|
||||
})
|
||||
|
||||
it('shows a running background job in the header without a refresh, then kills it from the two-press stop control', async () => {
|
||||
it('shows a running background job in the Session panel without a refresh, then kills it from the two-press stop control', async () => {
|
||||
let phase = 'running'
|
||||
onTestFailed(() => saveFailureShot(page, `web-e2e-background-job-${phase}`))
|
||||
// Polling for zero would pass at t=0 before delivery and prove nothing.
|
||||
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
expect(await trigger.count()).toBe(0)
|
||||
const toggle = sessionPanelToggle(page)
|
||||
const section = (await showSessionPanel(page)).locator(SECTION)
|
||||
const list = section.getByRole('list')
|
||||
// The mounted section keeps the roster stream open but renders no rows
|
||||
// yet, so the panel hides it with its title. A one-shot check: polling for
|
||||
// zero would pass at t=0 before delivery and prove nothing.
|
||||
expect(await section.count()).toBe(1)
|
||||
expect(await section.isVisible()).toBe(false)
|
||||
expect(await list.count()).toBe(0)
|
||||
|
||||
const started = await executeToolFixture(scaffold.ctx, {
|
||||
signal: new AbortController().signal,
|
||||
@@ -101,31 +108,26 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
|
||||
if (matched === null) throw new Error(`background bash reported no job id: ${reported}`)
|
||||
const jobId = brandString<JobId>(matched[0])
|
||||
|
||||
await trigger.waitFor({ timeout: 15_000 })
|
||||
expect(await trigger.locator('[data-state="ongoing"]').count()).toBe(1)
|
||||
expect(await trigger.locator('[data-icon="dsw-icon-chevron-down-outline-regular"]').count()).toBe(0)
|
||||
await trigger.hover()
|
||||
const list = page.getByRole('list', { name: 'Background jobs' })
|
||||
const row = list.getByRole('listitem').first()
|
||||
await row.waitFor({ timeout: 10_000 })
|
||||
await row.waitFor({ timeout: 15_000 })
|
||||
await expect.poll(() => row.textContent()).toContain(COMMAND)
|
||||
expect(await trigger.getAttribute('aria-expanded')).toBe('true')
|
||||
await row.hover()
|
||||
await row.getByRole('button', { name: /Show live output/ }).focus()
|
||||
await page.mouse.move(2, 2)
|
||||
// Focusing a menu control pins it beyond the 120ms hover-leave deadline.
|
||||
await page.waitForTimeout(180)
|
||||
expect(await list.count()).toBe(1)
|
||||
await trigger.click()
|
||||
expect(await section.getByRole('heading', { name: 'Background jobs', level: 2 }).isVisible()).toBe(true)
|
||||
expect(await row.locator('[data-state="ongoing"]').count()).toBe(1)
|
||||
expect(await page.locator('[data-jobs-running]').count()).toBe(0)
|
||||
// Hiding the panel unmounts the section, and a blue dot on the toggle reports the running job.
|
||||
await toggle.click()
|
||||
await list.waitFor({ state: 'detached' })
|
||||
await trigger.click()
|
||||
await list.waitFor()
|
||||
await page.mouse.move(2, 2)
|
||||
await page.waitForTimeout(180)
|
||||
expect(await list.count()).toBe(1)
|
||||
expect(await trigger.getAttribute('aria-label')).toBe('1 background job')
|
||||
const dot = page.locator('[data-jobs-running]')
|
||||
await dot.waitFor()
|
||||
await page.getByRole('button', { name: 'Session panel Background jobs running: 1', exact: true }).waitFor()
|
||||
expect(await dot.evaluate(element => getComputedStyle(element).width)).toBe('6px')
|
||||
// Showing it again lists the live job, and the dot goes away.
|
||||
await showSessionPanel(page)
|
||||
await row.waitFor({ timeout: 10_000 })
|
||||
expect(await toggle.getAttribute('aria-expanded')).toBe('true')
|
||||
await dot.waitFor({ state: 'detached' })
|
||||
|
||||
const running = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd, { runningJobs: 'keep' })
|
||||
const running = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(RUNNING_EXPECTED, running, MODE)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
@@ -133,151 +135,171 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
|
||||
phase = 'settled'
|
||||
// The whole human path: arm, confirm, job.kill, registry kill, jobs
|
||||
// frames flipping the row — no registry call from the test.
|
||||
const stop = page.locator('[data-kill-state]')
|
||||
const stop = section.locator('[data-kill-state]')
|
||||
await stop.waitFor({ timeout: 10_000 })
|
||||
await stop.click()
|
||||
await expect.poll(() => stop.getAttribute('data-kill-state')).toBe('armed')
|
||||
await stop.click()
|
||||
|
||||
expect(await trigger.getAttribute('aria-label')).toBe('1 background job')
|
||||
// The unclaimed report's reason lands in the settled row's detail.
|
||||
await expect.poll(
|
||||
() => page.getByRole('list', { name: 'Background jobs' }).textContent(),
|
||||
{ timeout: 15_000 },
|
||||
).toContain('cancelled by the user')
|
||||
// The unclaimed report's reason lands in the settled row's detail; presses
|
||||
// inside the overlay leave it open.
|
||||
await expect.poll(() => list.textContent(), { timeout: 15_000 }).toContain('cancelled by the user')
|
||||
expect(await toggle.getAttribute('aria-expanded')).toBe('true')
|
||||
expect(scaffold.ctx.jobs.get(jobId, agent.id).status).toBe('killed')
|
||||
|
||||
const settled = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd)
|
||||
const settled = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(SETTLED_EXPECTED, settled, MODE)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
}, 90_000)
|
||||
|
||||
it('keeps the open list above the expanded right sidebar and in the header Tab order', async () => {
|
||||
it('opens the section over the conversation beside the expanded right sidebar and closes it with Escape', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-right-sidebar'))
|
||||
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
if (await trigger.getAttribute('aria-expanded') === 'true') await trigger.click()
|
||||
const toggle = sessionPanelToggle(page)
|
||||
await page.getByRole('button', { name: 'Open right sidebar' }).click()
|
||||
const sidebar = page.locator('[data-rightbar-col]')
|
||||
// A toggle holds data-animating on the frame until its tracks settle.
|
||||
await expect.poll(() => sidebar.evaluate(column => column.parentElement?.hasAttribute('data-animating'))).toBe(false)
|
||||
await trigger.click()
|
||||
const list = page.getByRole('list', { name: 'Background jobs' })
|
||||
await list.waitFor({ timeout: 10_000 })
|
||||
// The list crosses into the sidebar column, so the hit test below covers it.
|
||||
const [menuBox, sidebarBox] = await Promise.all([list.boundingBox(), sidebar.boundingBox()])
|
||||
if (menuBox === null || sidebarBox === null) throw new Error('job list geometry is unavailable')
|
||||
expect(menuBox.x + menuBox.width).toBeGreaterThan(sidebarBox.x)
|
||||
// Every corner of the list hit-tests to the list itself; the inset clears its rounded corners.
|
||||
const covered = await list.evaluate((menu) => {
|
||||
const rect = menu.getBoundingClientRect()
|
||||
const panel = await showSessionPanel(page)
|
||||
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
|
||||
const section = panel.locator(SECTION)
|
||||
const settledToggle = section.getByRole('button', { name: 'Finished 1', exact: true })
|
||||
await settledToggle.waitFor({ timeout: 10_000 })
|
||||
// The overlay stays in the conversation body, clear of the sidebar column.
|
||||
const [panelBox, sidebarBox] = await Promise.all([panel.boundingBox(), sidebar.boundingBox()])
|
||||
if (panelBox === null || sidebarBox === null) throw new Error('Session panel geometry is unavailable')
|
||||
expect(panelBox.x + panelBox.width).toBeLessThanOrEqual(sidebarBox.x)
|
||||
// Every corner of the panel hit-tests to the panel itself; the inset clears its rounded corners.
|
||||
const covered = await panel.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect()
|
||||
const inset = 20
|
||||
const points: Array<[number, number]> = [
|
||||
[rect.left + inset, rect.top + inset], [rect.right - inset, rect.top + inset],
|
||||
[rect.left + inset, rect.bottom - inset], [rect.right - inset, rect.bottom - inset],
|
||||
]
|
||||
return points.filter(([x, y]) => !menu.contains(document.elementFromPoint(x, y)))
|
||||
return points.filter(([x, y]) => !element.contains(document.elementFromPoint(x, y)))
|
||||
})
|
||||
expect(covered).toEqual([])
|
||||
|
||||
// Keyboard order matches the in-place list: the trigger leads into the
|
||||
// list, and Tab off its last control reaches the control after the trigger.
|
||||
const after = await trigger.evaluate((node) => {
|
||||
const all = [...document.querySelectorAll<HTMLElement>('button, a[href], [tabindex]:not([tabindex="-1"])')]
|
||||
const outside = all.filter(el => el.closest('[aria-label="Background jobs"]') === null && el.tabIndex >= 0)
|
||||
return outside[outside.indexOf(node as HTMLElement) + 1]?.outerHTML.slice(0, 120)
|
||||
})
|
||||
expect(after).toMatch(/^<button/)
|
||||
await trigger.focus()
|
||||
await page.keyboard.press('Tab')
|
||||
expect(await list.evaluate(menu => menu.contains(document.activeElement))).toBe(true)
|
||||
const controls = await list.evaluate(menu => menu.querySelectorAll('button:not(:disabled)').length)
|
||||
for (let i = 1; i < controls; i += 1) await page.keyboard.press('Tab')
|
||||
await page.keyboard.press('Tab')
|
||||
expect(await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 120))).toBe(after)
|
||||
await trigger.focus()
|
||||
await page.keyboard.press('Tab')
|
||||
// Escape from a control in the section closes the overlay and returns focus to the toggle.
|
||||
await settledToggle.focus()
|
||||
await page.keyboard.press('Escape')
|
||||
await list.waitFor({ state: 'detached', timeout: 10_000 })
|
||||
expect(await trigger.evaluate(node => node === document.activeElement)).toBe(true)
|
||||
await panel.waitFor({ state: 'detached', timeout: 10_000 })
|
||||
expect(await toggle.getAttribute('aria-expanded')).toBe('false')
|
||||
expect(await toggle.evaluate(node => node === document.activeElement)).toBe(true)
|
||||
}, 60_000)
|
||||
|
||||
it('keeps the compact Layers trigger focused and opens jobs only on click or keyboard', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-compact-trigger'))
|
||||
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
const list = page.getByRole('list', { name: 'Background jobs' })
|
||||
const count = trigger.locator('[data-job-count]')
|
||||
it('fits the section into the narrow overlay and closes it on a press outside', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-narrow-overlay'))
|
||||
const toggle = sessionPanelToggle(page)
|
||||
const viewport = page.viewportSize()!
|
||||
await page.getByRole('button', { name: 'Collapse right sidebar', exact: true }).click()
|
||||
await expect.poll(() => page.locator('[data-rightbar-col]')
|
||||
.evaluate(column => column.parentElement?.hasAttribute('data-animating'))).toBe(false)
|
||||
await page.getByRole('button', { name: 'Open right sidebar', exact: true }).waitFor()
|
||||
await page.mouse.move(2, 2)
|
||||
expect(await count.isVisible()).toBe(true)
|
||||
expect(await trigger.locator('[data-icon="dsw-icon-layers-outline-regular"]').count()).toBe(1)
|
||||
expect(await trigger.locator('svg').count()).toBe(1)
|
||||
expect(await trigger.locator('svg').evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
return [bounds.width, bounds.height]
|
||||
})).toEqual([14, 14])
|
||||
await trigger.focus()
|
||||
const original = await trigger.elementHandle()
|
||||
if (original === null) throw new Error('Background jobs trigger is missing')
|
||||
await toggle.focus()
|
||||
const original = await toggle.elementHandle()
|
||||
if (original === null) throw new Error('Session panel toggle is missing')
|
||||
try {
|
||||
await page.setViewportSize({ width: 390, height: 700 })
|
||||
await expect.poll(() => count.evaluate(element => getComputedStyle(element).display)).toBe('none')
|
||||
expect(await original.evaluate(element => element.isConnected && element === document.activeElement)).toBe(true)
|
||||
const expandSidebar = page.locator('[data-sidebar-right-expand]')
|
||||
const compactStyles = await Promise.all([trigger, expandSidebar].map(control => control.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
const bounds = element.getBoundingClientRect()
|
||||
const icon = element.querySelector('svg')!.getBoundingClientRect()
|
||||
return { width: bounds.width, height: bounds.height, padding: style.padding, radius: style.borderRadius,
|
||||
color: style.color, iconWidth: icon.width, iconHeight: icon.height }
|
||||
})))
|
||||
expect(compactStyles[0]).toEqual(compactStyles[1])
|
||||
expect(compactStyles[0]).toMatchObject({ width: 28, height: 28, padding: '0px', iconWidth: 15, iconHeight: 15 })
|
||||
expect(await trigger.evaluate(element => getComputedStyle(element.closest('[data-slot="conversation.session.header.actions"]')!.parentElement!).gap)).toBe('8px')
|
||||
await expandSidebar.hover()
|
||||
const expandHover = await expandSidebar.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { background: style.backgroundColor, color: style.color }
|
||||
})
|
||||
await expect.poll(() => trigger.evaluate((element) => {
|
||||
const bounds = element.getBoundingClientRect()
|
||||
return element.contains(document.elementFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2))
|
||||
})).toBe(true)
|
||||
await trigger.hover()
|
||||
expect(await trigger.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
return { background: style.backgroundColor, color: style.color }
|
||||
})).toEqual(expandHover)
|
||||
expect(expandHover.background).not.toBe('rgba(0, 0, 0, 0)')
|
||||
// Compact hover stays closed beyond the wide trigger's 150ms open deadline.
|
||||
await page.waitForTimeout(200)
|
||||
expect(await list.count()).toBe(0)
|
||||
await trigger.click()
|
||||
await list.waitFor()
|
||||
const panel = await showSessionPanel(page)
|
||||
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
|
||||
const list = panel.locator(SECTION).getByRole('list')
|
||||
await list.getByRole('button', { name: 'Finished 1', exact: true }).waitFor()
|
||||
await trigger.click()
|
||||
await list.waitFor({ state: 'detached' })
|
||||
await trigger.press('ArrowDown')
|
||||
await list.waitFor()
|
||||
expect(await list.getByRole('button').first().evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await page.mouse.move(2, 2)
|
||||
// Keyboard activation remains pinned after leaving both trigger and menu.
|
||||
await page.waitForTimeout(180)
|
||||
expect(await list.count()).toBe(1)
|
||||
await page.mouse.click(2, 2)
|
||||
await list.waitFor({ state: 'detached' })
|
||||
expect(await trigger.getAttribute('aria-expanded')).toBe('false')
|
||||
// The long command truncates inside its row instead of widening the panel past the viewport.
|
||||
const fit = await panel.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect()
|
||||
const rows = [...element.querySelectorAll<HTMLElement>('[data-jobs-section] li')]
|
||||
return {
|
||||
inViewport: rect.left >= 0 && rect.right <= innerWidth,
|
||||
panelOverflow: element.scrollWidth > element.clientWidth,
|
||||
rowOverflow: rows.some(row => row.getBoundingClientRect().right > rect.right),
|
||||
}
|
||||
})
|
||||
expect(fit).toEqual({ inViewport: true, panelOverflow: false, rowOverflow: false })
|
||||
// The overlay's inline margin is transcript: a press there is outside the panel.
|
||||
const box = await panel.boundingBox()
|
||||
if (box === null) throw new Error('Session panel geometry is unavailable')
|
||||
expect(box.x).toBeGreaterThan(4)
|
||||
await page.mouse.click(box.x / 2, box.y + box.height / 2)
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
expect(await toggle.getAttribute('aria-expanded')).toBe('false')
|
||||
} finally {
|
||||
await page.keyboard.press('Escape')
|
||||
await page.setViewportSize(viewport)
|
||||
await original.dispose()
|
||||
}
|
||||
})
|
||||
|
||||
it('marks a job that finished with a nonzero exit code with the warning dot', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-nonzero-exit'))
|
||||
await executeToolFixture(scaffold.ctx, {
|
||||
signal: new AbortController().signal,
|
||||
callId: brandString<ToolCallId>('background-job-list-nonzero-e2e'),
|
||||
name: 'bash',
|
||||
arguments: { command: 'exit 3', description: 'Exit with a failure', run_in_background: true },
|
||||
agent: scaffold.ctx.agents.list()[0]!,
|
||||
})
|
||||
const panel = await showSessionPanel(page)
|
||||
const row = panel.locator(SECTION).getByRole('listitem').filter({ hasText: 'exit 3' })
|
||||
await row.getByText('bash · exit code: 3', { exact: true }).waitFor({ timeout: 15_000 })
|
||||
expect(await row.locator('[data-state]').getAttribute('data-state')).toBe('warning')
|
||||
})
|
||||
|
||||
it('holds back the rows past five in each group behind its fold control and keeps the choice while the panel is hidden', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-folds'))
|
||||
// Seven jobs on the suite's barrier file: they run until this case, or `afterAll`, releases it.
|
||||
for (let index = 0; index < 7; index++) {
|
||||
await executeToolFixture(scaffold.ctx, {
|
||||
signal: new AbortController().signal,
|
||||
callId: brandString<ToolCallId>(`background-job-list-fold-${String(index)}`),
|
||||
name: 'bash',
|
||||
arguments: { command: `: fold-${String(index)}; ${COMMAND}`, description: 'Hold a slot for the fold', run_in_background: true },
|
||||
agent,
|
||||
})
|
||||
}
|
||||
const section = (await showSessionPanel(page)).locator(SECTION)
|
||||
const rows = section.locator('[data-job-row]')
|
||||
const liveRows = section.locator('[data-job-row]:has([data-state="ongoing"])')
|
||||
const folds = section.locator('[data-session-panel-row="fold"]')
|
||||
const names = async (): Promise<(string | undefined)[]> => (await liveRows.allTextContents()).map(text => /fold-\d/.exec(text)?.[0])
|
||||
// The five jobs started last show, the most recent first, and the group's fold control follows them.
|
||||
await expect.poll(names, { timeout: 20_000 }).toEqual(['fold-6', 'fold-5', 'fold-4', 'fold-3', 'fold-2'])
|
||||
expect(await folds.allTextContents()).toEqual(['Show 2 more running'])
|
||||
expect(await section.locator('li:has([data-session-panel-row="fold"])').count()).toBe(1)
|
||||
// The control is one more row: the row height, its chevron under the state marks, its text under the commands.
|
||||
expect(await foldControlLayout(folds.first(), liveRows.first(), '[data-job-label]'))
|
||||
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
|
||||
const more = section.getByRole('button', { name: 'Show 2 more running (running background jobs)', exact: true })
|
||||
await more.click()
|
||||
await expect.poll(names).toEqual(['fold-6', 'fold-5', 'fold-4', 'fold-3', 'fold-2', 'fold-1', 'fold-0'])
|
||||
const less = section.getByRole('button', { name: 'Show less (running background jobs)', exact: true })
|
||||
expect([await less.textContent(), await less.getAttribute('aria-expanded')]).toEqual(['Show less', 'true'])
|
||||
// The same button stays under the pointer's focus across the change.
|
||||
expect(await less.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
// The choice is the Session's: hiding the panel unmounts the section, and showing it again lists every live row.
|
||||
await sessionPanelToggle(page).click()
|
||||
await section.getByRole('list').waitFor({ state: 'detached' })
|
||||
await showSessionPanel(page)
|
||||
await expect.poll(() => liveRows.count(), { timeout: 10_000 }).toBe(7)
|
||||
|
||||
// Released, the jobs settle. With nothing live the settled group opens, with its five latest rows and its own control.
|
||||
await writeFile(join(scaffold.workspaceCwd, RELEASE), '')
|
||||
await expect.poll(() => liveRows.count(), { timeout: 30_000 }).toBe(0)
|
||||
const header = section.getByRole('button', { name: /^Finished \d+$/ })
|
||||
await expect.poll(async () => Number(/\d+/.exec(await header.textContent() ?? '')?.[0]), { timeout: 15_000 }).toBeGreaterThanOrEqual(7)
|
||||
const settled = Number(/\d+/.exec(await header.textContent() ?? '')?.[0])
|
||||
expect(await header.getAttribute('aria-expanded')).toBe('true')
|
||||
await expect.poll(() => rows.count()).toBe(5)
|
||||
expect(await folds.allTextContents()).toEqual([`Show ${String(settled - 5)} more finished`])
|
||||
expect(await foldControlLayout(folds.first(), rows.first(), '[data-job-label]'))
|
||||
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
|
||||
await folds.first().getByRole('button').click()
|
||||
await expect.poll(() => rows.count()).toBe(settled)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
}, 120_000)
|
||||
|
||||
it('keeps its snapshot inventory closed', async () => {
|
||||
await assertFixtureInventory(SNAPSHOT_DIR, ['running.expected.md', 'settled.expected.md'])
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { SessionId } from '@deepseek-ai/dsh-session'
|
||||
import type {} from '@deepseek-ai/dsh-agent'
|
||||
import type {} from '@deepseek-ai/dsh-subagent'
|
||||
import { launchWebScaffold, selectedSessionFixture, webSnapshotMode, type WebScaffold } from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, openSettings, saveFailureShot } from './support.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, openSettings, saveFailureShot, showSessionPanel } from './support.ts'
|
||||
|
||||
const BASE_FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
|
||||
const LABEL = 'event-sourcing researcher'
|
||||
@@ -104,8 +104,7 @@ describe('web e2e: composer paste routing', () => {
|
||||
parent,
|
||||
})
|
||||
await waitForAgentToSettle(scaffold, started.childId)
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
|
||||
await page.locator('[data-sidebar-chat] [data-composer-card]').waitFor({ timeout: 15_000 })
|
||||
})
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
// Web e2e scenario: a composer draft's pasted image survives a sidebar session
|
||||
// switch. The reported defect spans the whole chain — sidebar row click, Session
|
||||
// scope retirement, the input shell's teardown, and the rail's rebuild — so only
|
||||
// the real composition can pin it. Units cover each link separately (hub/shell/
|
||||
// service specs); this covers the assembled path and the rail the user sees.
|
||||
//
|
||||
// Zero model calls: a seeded session is non-blank (so the sidebar can create a
|
||||
// second one instead of reusing it) and the scenario never submits.
|
||||
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 } from 'vitest'
|
||||
import {
|
||||
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
|
||||
const MODE = webSnapshotMode()
|
||||
const SEED_ID = 'draft-attachment-switch-a'
|
||||
const PEER_ID = 'draft-attachment-switch-b'
|
||||
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
|
||||
const PNG = fileURLToPath(new URL('../../../snapshots/session/read-image/workspace/red.png', import.meta.url))
|
||||
const DRAFT_TEXT = 'draft text that survives the switch'
|
||||
|
||||
/** The composer's pending-attachment rail, present only while it holds items. */
|
||||
const RAIL = '[role="group"][aria-label="Pending attachments"]'
|
||||
|
||||
/**
|
||||
* Paste one real PNG into the composer through a genuine clipboard event, the
|
||||
* same intake a user's screenshot paste performs.
|
||||
* @param page - page holding the composer.
|
||||
* @param bytes - PNG bytes.
|
||||
*/
|
||||
async function pasteImage(page: Page, bytes: Uint8Array): Promise<void> {
|
||||
await page.locator('[data-composer-input]').first().evaluate((surface, data) => {
|
||||
const transfer = new DataTransfer()
|
||||
transfer.items.add(new File([new Uint8Array(data)], 'draft.png', { type: 'image/png' }))
|
||||
surface.dispatchEvent(new ClipboardEvent('paste', {
|
||||
clipboardData: transfer, bubbles: true, cancelable: true,
|
||||
}))
|
||||
}, [...bytes])
|
||||
}
|
||||
|
||||
describe.skipIf(MODE === 'record')('web e2e: draft attachment across a session switch', () => {
|
||||
let scaffold: WebScaffold
|
||||
let browser: Browser
|
||||
let page: Page
|
||||
let tripwire: ReturnType<typeof watchConsole>
|
||||
|
||||
beforeAll(async () => {
|
||||
scaffold = await launchWebScaffold({})
|
||||
const log = await readFile(FIXTURE, 'utf8')
|
||||
await seedSession(scaffold, log, SEED_ID)
|
||||
await seedSession(scaffold, log, PEER_ID)
|
||||
browser = await chromium.launch()
|
||||
page = await newEnglishPage(browser)
|
||||
tripwire = watchConsole(page)
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
|
||||
// Expand the workspace group and open the seeded session.
|
||||
const groupRow = page.locator('[role="treeitem"]').first()
|
||||
await groupRow.waitFor({ timeout: 15_000 })
|
||||
await groupRow.click()
|
||||
const sessionRow = page.locator(`[data-row-key="session:${SEED_ID}"]`)
|
||||
await sessionRow.waitFor({ timeout: 15_000 })
|
||||
await sessionRow.click()
|
||||
await page.locator('[data-composer-input]').first().waitFor({ timeout: 15_000 })
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await browser?.close()
|
||||
await scaffold?.close()
|
||||
})
|
||||
|
||||
it('keeps the pasted image and the typed draft when the sidebar leaves and returns', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'draft-attachment-session-switch'))
|
||||
// (a) paste an image, then type text into the seeded session's composer.
|
||||
await pasteImage(page, await readFile(PNG))
|
||||
await expect.poll(() => page.locator(`${RAIL} img`).count(), { timeout: 15_000 }).toBe(1)
|
||||
await page.locator('[data-composer-input]').first().click()
|
||||
await page.keyboard.type(DRAFT_TEXT, { delay: 5 })
|
||||
await expect.poll(() => page.locator(RAIL).locator('img').count(), { timeout: 10_000 }).toBe(1)
|
||||
|
||||
// (b) leave through the sidebar: switching to another session retires this
|
||||
// one's Session scope.
|
||||
await page.locator(`[data-row-key="session:${PEER_ID}"]`).click()
|
||||
await expect.poll(() => page.locator(RAIL).count(), { timeout: 15_000 }).toBe(0)
|
||||
|
||||
// (c) return: the rebuilt composer must show the image AND the text.
|
||||
await page.locator(`[data-row-key="session:${SEED_ID}"]`).click()
|
||||
await expect.poll(() => page.locator(`${RAIL} img`).count(), { timeout: 15_000 }).toBe(1)
|
||||
await expect.poll(
|
||||
() => page.locator('[data-composer-input]').first().innerText(),
|
||||
{ timeout: 10_000 },
|
||||
).toContain(DRAFT_TEXT)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
})
|
||||
@@ -1,6 +1,5 @@
|
||||
- navigation "Session hierarchy": Seeded turn
|
||||
- text: Minimal mode
|
||||
- button "1 subagent"
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
@@ -1,4 +1,3 @@
|
||||
- button "本地变更"
|
||||
- text: HEAD → origin/main
|
||||
- button "查看本会话的变更:1 个文件,新增 1 行,删除 0 行": +1 −0 1 个文件
|
||||
- button "创建变更请求"
|
||||
- button "本地变更 · 1 个文件,新增 1 行,删除 0 行": 本地变更 · 1 个文件
|
||||
- text: +1 −0
|
||||
- button "本地变更操作"
|
||||
@@ -1,21 +1,22 @@
|
||||
- text: feat 项目目录
|
||||
- button "复制项目目录路径"
|
||||
- button "本地变更"
|
||||
- text: HEAD → origin/main
|
||||
- button "查看本会话的变更:4 个文件,新增 4 行,删除 1 行": +4 −1 4 个文件
|
||||
- heading "本会话的变更请求 · 1" [level=3]
|
||||
- button "刷新状态"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "在浏览器中打开"
|
||||
- button "复制变更请求链接"
|
||||
- 'button "从本会话移除 #7"'
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
- button "评审 等待评审"
|
||||
- text: 合并 无冲突
|
||||
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
|
||||
- complementary "会话面板":
|
||||
- region "环境":
|
||||
- heading "环境" [level=2]
|
||||
- text: workspace {{cwd}} feat 项目目录
|
||||
- button "本地变更 · 4 个文件,新增 4 行,删除 1 行": 本地变更 · 4 个文件
|
||||
- text: +4 −1
|
||||
- button "本地变更操作"
|
||||
- region "变更请求":
|
||||
- heading "变更请求" [level=2]
|
||||
- text: "1"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
- button "评审 等待评审"
|
||||
- text: 合并 无冲突
|
||||
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
|
||||
@@ -1,4 +1,3 @@
|
||||
- button "Local changes"
|
||||
- text: HEAD → origin/main
|
||||
- 'button "View the changes of this Session: 60 files, 60 lines added, 0 lines deleted"': +60 −0 60 files
|
||||
- button "Create change request"
|
||||
- button "Local changes · 60 files, 60 lines added, 0 lines deleted": Local changes · 60 files
|
||||
- text: +60 −0
|
||||
- button "Local changes actions"
|
||||
@@ -1,18 +1,19 @@
|
||||
- text: dsh-{{worktree}} 工作树 · 基于 release
|
||||
- button "复制工作树路径"
|
||||
- heading "本会话的变更请求 · 1" [level=3]
|
||||
- button "刷新状态"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "在浏览器中打开"
|
||||
- button "复制变更请求链接"
|
||||
- 'button "从本会话移除 #7"'
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
- button "评审 等待评审"
|
||||
- text: 合并 无冲突
|
||||
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
|
||||
- complementary "会话面板":
|
||||
- region "环境":
|
||||
- heading "环境" [level=2]
|
||||
- text: dsh-{{worktree}} {{cwd}}/workspace/.agents/worktrees dsh-{{worktree}} 工作树 · 基于 release
|
||||
- region "变更请求":
|
||||
- heading "变更请求" [level=2]
|
||||
- text: "1"
|
||||
- list:
|
||||
- listitem:
|
||||
- img "变更请求状态:需要处理"
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
- button "评审 等待评审"
|
||||
- text: 合并 无冲突
|
||||
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
|
||||
@@ -3,9 +3,7 @@
|
||||
- link "Add the pull request panel":
|
||||
- /url: https://github.com/octo/demo/pull/7
|
||||
- text: "#7 feat → main"
|
||||
- button "在浏览器中打开"
|
||||
- button "复制变更请求链接"
|
||||
- 'button "从本会话移除 #7"'
|
||||
- button "#7 的操作"
|
||||
- 'button "收起 #7" [expanded]'
|
||||
- button "检查 已加载 1 项检查,仍有更多"
|
||||
- button "评审 等待评审"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- button "代码审查和变更 查看代码变更与本会话的变更请求"
|
||||
@@ -1,35 +0,0 @@
|
||||
# Background jobs above the Browser dock
|
||||
|
||||
```json
|
||||
{
|
||||
"collapsed": {
|
||||
"dockMode": "push",
|
||||
"bodyMounted": true,
|
||||
"fixed": true,
|
||||
"anchored": true,
|
||||
"viewportBounded": true,
|
||||
"overlapsBrowser": true,
|
||||
"aboveBrowser": true
|
||||
},
|
||||
"expanded": {
|
||||
"dockMode": "push",
|
||||
"bodyMounted": true,
|
||||
"fixed": true,
|
||||
"anchored": true,
|
||||
"viewportBounded": true,
|
||||
"overlapsBrowser": true,
|
||||
"aboveBrowser": true
|
||||
},
|
||||
"resized": {
|
||||
"dockMode": "push",
|
||||
"bodyMounted": true,
|
||||
"fixed": true,
|
||||
"anchored": true,
|
||||
"viewportBounded": true,
|
||||
"overlapsBrowser": true,
|
||||
"aboveBrowser": true
|
||||
},
|
||||
"escapeRestoresFocus": true,
|
||||
"outsideDismisses": true
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Background jobs beside the Browser dock
|
||||
|
||||
```json
|
||||
{
|
||||
"collapsed": {
|
||||
"dockMode": "push",
|
||||
"presentation": "overlay",
|
||||
"insideBody": true,
|
||||
"clearOfBrowser": true,
|
||||
"clearOfComposer": true,
|
||||
"viewportBounded": true,
|
||||
"sectionShown": true,
|
||||
"onTop": true
|
||||
},
|
||||
"expanded": {
|
||||
"dockMode": "push",
|
||||
"presentation": "overlay",
|
||||
"insideBody": true,
|
||||
"clearOfBrowser": true,
|
||||
"clearOfComposer": true,
|
||||
"viewportBounded": true,
|
||||
"sectionShown": true,
|
||||
"onTop": true
|
||||
},
|
||||
"resized": {
|
||||
"dockMode": "push",
|
||||
"presentation": "overlay",
|
||||
"insideBody": true,
|
||||
"clearOfBrowser": true,
|
||||
"clearOfComposer": true,
|
||||
"viewportBounded": true,
|
||||
"sectionShown": true,
|
||||
"onTop": true
|
||||
},
|
||||
"escapeRestoresFocus": true,
|
||||
"outsideDismisses": true
|
||||
}
|
||||
```
|
||||
@@ -43,7 +43,7 @@
|
||||
- code: "@deepseek-ai/dsh-experimental-forge-session"
|
||||
- text: 已关闭
|
||||
- listitem:
|
||||
- text: 变更请求面板 在侧栏标签页中显示会话的变更请求,并让新会话可以在工作树中开始。
|
||||
- text: 变更请求面板 在会话面板中显示会话的变更请求,并让新会话可以在工作树中开始。
|
||||
- code: forge-panel
|
||||
- code: "@deepseek-ai/dsh-experimental-client-ui-forge"
|
||||
- text: 已关闭
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Delegate a background job.
|
||||
- button "1 subagent"
|
||||
- button "1 background job"
|
||||
- button "Session panel"
|
||||
- 'button "Session panel Subagents running: 1 Background jobs running: 1"'
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
- tree "Subagent sessions":
|
||||
- treeitem "historical researcher migration-catalog-child · continuable · not running" [level=1]:
|
||||
- text: historical researcher migration-catalog-child
|
||||
- text: historical researcher
|
||||
- button "Open historical researcher in sidebar"
|
||||
|
||||
# After opening the child
|
||||
|
||||
- tree "Subagent sessions":
|
||||
- treeitem "historical editor migration-catalog-grandchild · continuable · not running" [level=1]:
|
||||
- text: historical editor migration-catalog-grandchild
|
||||
- text: historical editor
|
||||
- button "Open historical editor in sidebar"
|
||||
@@ -25,7 +25,7 @@ import { sessionFixtureName } from '@deepseek-ai/dsh-session-snapshot'
|
||||
import { snapshotSubagentDescriptor } from '@deepseek-ai/dsh-subagent'
|
||||
import { createChatScrollFixture, type ChatScrollFixture } from './chat-scroll-fixture.ts'
|
||||
import { launchWebScaffold, parseSeedFixture, seedSession, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
|
||||
import { newEnglishPage, openSettings } from './support.ts'
|
||||
import { newEnglishPage, openSettings, showSessionPanel } from './support.ts'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -621,10 +621,8 @@ async function prepareWorld(browser: Browser, scenario: Case, scaffold: WebScaff
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
await openSessionBySearch(page, parentFixture.markers.user(1))
|
||||
await choosePreferences(page, scenario)
|
||||
const trigger = page.getByRole('button', { name: '1 subagent', exact: true })
|
||||
await trigger.waitFor({ timeout: 15_000 })
|
||||
await trigger.hover()
|
||||
const openAside = page.getByRole('treeitem', { name: new RegExp(CHILD_LABEL) })
|
||||
const panel = await showSessionPanel(page)
|
||||
const openAside = panel.getByRole('treeitem', { name: new RegExp(CHILD_LABEL) })
|
||||
.getByRole('button', { name: /^Open .+ in sidebar$/u })
|
||||
await expect.poll(() => openAside.count()).toBe(1)
|
||||
await openAside.click()
|
||||
|
||||
+136
-110
@@ -17,7 +17,9 @@ import {
|
||||
captureStableAria, compareOrRefreshGolden, fixtureUserPrompts, launchWebScaffold, readPersistedEvents, watchConsole,
|
||||
webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { connectFreshWorkspaceZh, saveFailureShot, writeComposerDraft, ZH_BROWSER_LOCALE } from './support.ts'
|
||||
import {
|
||||
connectFreshWorkspaceZh, hideSessionPanel, saveFailureShot, sessionPanelToggle, showSessionPanel, writeComposerDraft, ZH_BROWSER_LOCALE,
|
||||
} from './support.ts'
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -639,6 +641,48 @@ async function sendPrompt(page: Page, scaffold: WebScaffold): Promise<{ readonly
|
||||
return { prompt, settled }
|
||||
}
|
||||
|
||||
/**
|
||||
* Choose an item from the More menu of a change request card.
|
||||
* @param page - the page under test.
|
||||
* @param change - the card.
|
||||
* @param name - the card's name in the menu button, such as `#7`.
|
||||
* @param item - the item to choose.
|
||||
*/
|
||||
async function chooseCardAction(page: Page, change: Locator, name: string, item: string): Promise<void> {
|
||||
await change.getByRole('button', { name: `${name} 的操作`, exact: true }).click()
|
||||
await page.getByRole('menuitem', { name: item, exact: true }).click()
|
||||
}
|
||||
|
||||
/** Accessible name of the panel toggle while a change request needs attention. */
|
||||
const TOGGLE_ATTENTION = '会话面板 本会话的变更请求需要处理'
|
||||
|
||||
/**
|
||||
* A Session panel row as the panel's row rules lay it out: its height, how far
|
||||
* the centers of its icon and menu columns sit from its start and end edges
|
||||
* (null for a part that takes no room), and the part a press reaches at its
|
||||
* start edge and on its trailing part.
|
||||
*/
|
||||
function panelRowLayout(row: Locator) {
|
||||
return row.evaluate((element) => {
|
||||
const box = element.getBoundingClientRect()
|
||||
const rectOf = (part: string): DOMRect | null => {
|
||||
const rect = element.querySelector(`[data-row-part="${part}"]`)?.getBoundingClientRect()
|
||||
return rect === undefined || rect.width === 0 ? null : rect
|
||||
}
|
||||
const partAt = (x: number, y: number): string | null =>
|
||||
document.elementFromPoint(x, y)?.closest('[data-row-part]')?.getAttribute('data-row-part') ?? null
|
||||
const [icon, trailing, menu] = [rectOf('icon'), rectOf('trailing'), rectOf('menu')]
|
||||
return {
|
||||
marked: element.hasAttribute('data-session-panel-row'),
|
||||
height: box.height,
|
||||
iconCenter: icon === null ? null : icon.left + icon.width / 2 - box.left,
|
||||
menuCenter: menu === null ? null : box.right - (menu.left + menu.width / 2),
|
||||
startPress: partAt(box.left + 2, box.top + 2),
|
||||
trailingPress: trailing === null ? null : partAt(trailing.left + trailing.width / 2, trailing.top + trailing.height / 2),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function worktreeRecords(events: readonly SessionEvent[]): unknown[] {
|
||||
return events.flatMap((event) => {
|
||||
const record = pluginRecordOf(event)
|
||||
@@ -656,9 +700,15 @@ it.skipIf(MODE === 'record')('reads local Git with full access when the sandbox
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
const sessionId = await settled
|
||||
await page.getByText('LIGHTHOUSE', { exact: true }).waitFor()
|
||||
await page.locator('[data-forge-header]').click()
|
||||
const panel = page.locator('[data-forge-panel]')
|
||||
await panel.getByText('无法读取 Git 信息', { exact: true }).waitFor({ timeout: 20_000 })
|
||||
const panel = await showSessionPanel(page)
|
||||
const failed = panel.locator('[data-forge-checkout][data-failed]')
|
||||
await failed.getByText('无法读取 Git 信息', { exact: true }).waitFor({ timeout: 20_000 })
|
||||
// The failure's reason shows from the info button, also on a press as touch screens need; another press hides it.
|
||||
const reason = failed.getByRole('button', { name: '查看原因', exact: true })
|
||||
await reason.click()
|
||||
await expect.poll(async () => (await page.getByRole('tooltip').textContent())?.trim().length ?? 0).toBeGreaterThan(0)
|
||||
await reason.click()
|
||||
await expect.poll(() => page.getByRole('tooltip').count()).toBe(0)
|
||||
|
||||
const permission = page.locator('button[aria-label^="访问模式"]').first()
|
||||
await permission.click()
|
||||
@@ -666,16 +716,23 @@ it.skipIf(MODE === 'record')('reads local Git with full access when the sandbox
|
||||
const confirmation = page.getByRole('dialog', { name: '确认启用完全权限?' })
|
||||
await confirmation.getByRole('checkbox', { name: '我已了解风险,并愿意继续' }).check()
|
||||
await confirmation.getByRole('button', { name: '启用完全权限' }).click()
|
||||
await showSessionPanel(page)
|
||||
const local = page.locator('[data-forge-local]')
|
||||
await local.getByRole('button', { name: '查看本会话的变更:1 个文件,新增 1 行,删除 0 行', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await local.getByRole('button', { name: '本地变更 · 1 个文件,新增 1 行,删除 0 行', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'full-access.expected.md'), await captureStableAria(page, '[data-forge-local]', scaffold.workspaceCwd), MODE)
|
||||
await local.getByRole('button', { name: '查看本会话的变更:1 个文件,新增 1 行,删除 0 行', exact: true }).click()
|
||||
// The panel lays the row out by its marks: one 28px line with the icon and the More button on the panel columns.
|
||||
// The body is the row's button, so a press at the row's edge reaches it, while the diff size stays above it.
|
||||
expect(await panelRowLayout(local)).toEqual({ marked: true, height: 28, iconCenter: 14, menuCenter: 14, startPress: 'body', trailingPress: 'trailing' })
|
||||
// This composition registers no directory menu entries: the checkout row's menu takes no room, and its body is not a button.
|
||||
expect(await panelRowLayout(panel.locator('[data-forge-checkout]')))
|
||||
.toEqual({ marked: true, height: 28, iconCenter: 14, menuCenter: null, startPress: null, trailingPress: 'trailing' })
|
||||
await local.getByRole('button', { name: '本地变更 · 1 个文件,新增 1 行,删除 0 行', exact: true }).click()
|
||||
await page.locator('[data-forge-diff-file="README.md"]').getByText('changed', { exact: true }).waitFor()
|
||||
|
||||
await permission.click()
|
||||
await page.getByRole('menuitem', { name: '工作区内修改', exact: true }).click()
|
||||
if (!await panel.isVisible()) await page.locator('[data-forge-header]').click()
|
||||
await panel.getByText('无法读取 Git 信息', { exact: true }).waitFor({ timeout: 20_000 })
|
||||
await showSessionPanel(page)
|
||||
await failed.getByText('无法读取 Git 信息', { exact: true }).waitFor({ timeout: 20_000 })
|
||||
await expect.poll(async () => (await readPersistedEvents(scaffold, sessionId))
|
||||
.filter(event => event.type === 'sandbox/mode').map(event => event.data.mode).slice(-2))
|
||||
.toEqual(['danger-full-access', 'workspace-write'])
|
||||
@@ -691,8 +748,8 @@ it.skipIf(MODE === 'record')('reports incomplete filter configuration and retrie
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.getByText('LIGHTHOUSE', { exact: true }).waitFor()
|
||||
await page.locator('[data-forge-header]').click()
|
||||
const openChanges = page.locator('[data-forge-local]').getByRole('button', { name: '查看本会话的变更:1 个文件,新增 1 行,删除 0 行', exact: true })
|
||||
await showSessionPanel(page)
|
||||
const openChanges = page.locator('[data-forge-local]').getByRole('button', { name: '本地变更 · 1 个文件,新增 1 行,删除 0 行', exact: true })
|
||||
await openChanges.waitFor({ timeout: 20_000 })
|
||||
const key = `filter.${'long'.repeat(200)}.clean`
|
||||
await git(project, 'config', key, 'cat')
|
||||
@@ -716,9 +773,8 @@ it.skipIf(MODE === 'record')('reports incomplete filter configuration and retrie
|
||||
* @param sessionId - Session whose binding records are read.
|
||||
*/
|
||||
async function expectNumberedReference({ scaffold, page, project, tripwire }: PanelLaunch, sessionId: SessionId): Promise<void> {
|
||||
const header = page.locator('[data-forge-header]')
|
||||
await expect.poll(() => header.getAttribute('aria-label'), { timeout: 20_000 }).toBe('本会话的变更请求需要处理')
|
||||
await header.click()
|
||||
await page.getByRole('button', { name: TOGGLE_ATTENTION, exact: true }).waitFor({ timeout: 20_000 })
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
await change.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await change.getByText('等待评审', { exact: true }).waitFor()
|
||||
@@ -800,9 +856,8 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
|
||||
// A change request bound the way a `gh pr create` result binds one.
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
const header = page.locator('[data-forge-header]')
|
||||
await expect.poll(() => header.getAttribute('aria-label'), { timeout: 20_000 }).toBe('本会话的变更请求需要处理')
|
||||
expect(await header.getAttribute('aria-pressed')).toBe('false')
|
||||
await page.getByRole('button', { name: TOGGLE_ATTENTION, exact: true }).waitFor({ timeout: 20_000 })
|
||||
expect(await sessionPanelToggle(page).getAttribute('aria-expanded')).toBe('false')
|
||||
|
||||
// The Session row marks the worktree and its change request's state, and its hover card names both.
|
||||
const row = page.locator(`[data-row-key="session:${sessionId}"]`)
|
||||
@@ -820,9 +875,7 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
await captureStableAria(page, '[data-forge-session-hover]', scaffold.workspaceCwd, { replacements: [[branch, 'dsh-{{worktree}}']] }), MODE)
|
||||
await page.mouse.move(0, 0)
|
||||
await rowHover.waitFor({ state: 'detached' })
|
||||
await header.click()
|
||||
await expect.poll(() => header.getAttribute('aria-pressed')).toBe('true')
|
||||
const panel = page.locator('[data-forge-panel]')
|
||||
const panel = await showSessionPanel(page)
|
||||
const checkout = panel.locator('[data-forge-checkout]')
|
||||
const checkoutName = checkout.getByText(branch, { exact: true })
|
||||
await checkoutName.waitFor({ timeout: 20_000 })
|
||||
@@ -837,7 +890,9 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
await change.getByText('等待评审', { exact: true }).waitFor()
|
||||
// The random branch suffix can read as a duration, so the branch is replaced before the capture normalizes durations.
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'panel.expected.md'),
|
||||
await captureStableAria(page, '[data-forge-panel]', scaffold.workspaceCwd, { replacements: [[branch, 'dsh-{{worktree}}']] }), MODE)
|
||||
await captureStableAria(page, '[data-session-panel]', scaffold.workspaceCwd, {
|
||||
replacements: [[branch, 'dsh-{{worktree}}'], [abbreviateHomePath(scaffold.workspaceCwd, homedir()), '{{cwd}}']],
|
||||
}), MODE)
|
||||
const beforeChecks = (await readFile(join(root, 'calls.jsonl'), 'utf8')).trim().split('\n').map(line => JSON.parse(line) as string[])
|
||||
expect(beforeChecks.some(args => args.includes('id=rollup-7'))).toBe(false)
|
||||
const checksRow = change.getByRole('button', { name: /^检查/ })
|
||||
@@ -856,18 +911,18 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
const record = pluginRecordOf(event)
|
||||
return record?.type === 'plugin:forge-session/binding' ? [record.data] : []
|
||||
})
|
||||
await change.getByRole('button', { name: '从本会话移除 #7', exact: true }).click()
|
||||
await chooseCardAction(page, change, '#7', '从本会话移除')
|
||||
await change.waitFor({ state: 'detached' })
|
||||
await panel.getByText('本会话还没有变更请求', { exact: true }).waitFor()
|
||||
await panel.locator('[data-session-panel-section="change-requests"]').waitFor({ state: 'hidden' })
|
||||
await page.getByRole('alert').filter({ hasText: '已从本会话移除 #7' }).getByRole('button', { name: '撤销', exact: true }).click()
|
||||
await showSessionPanel(page)
|
||||
await title.waitFor({ timeout: 20_000 })
|
||||
await expect.poll(bindings).toEqual([{ action: 'track', url: PULL }, { action: 'dismiss', url: PULL }, { action: 'track', url: PULL }])
|
||||
|
||||
const calls = (await readFile(join(root, 'calls.jsonl'), 'utf8')).trim().split('\n').map(line => JSON.parse(line) as string[])
|
||||
expect(calls).toContainEqual(['auth', 'status', '--hostname', 'github.com'])
|
||||
expect(calls.some(args => args[0] === 'api' && args[1] === 'graphql' && args.includes('--hostname'))).toBe(true)
|
||||
await header.click()
|
||||
await expect.poll(() => header.getAttribute('aria-pressed')).toBe('false')
|
||||
await hideSessionPanel(page)
|
||||
|
||||
// Removing the worktree outside the Session holds the next message in the inbox until the worktree is restored.
|
||||
await git(project, 'worktree', 'remove', '--force', directory)
|
||||
@@ -880,6 +935,7 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
const missing = page.locator('[data-forge-missing]')
|
||||
await missing.getByText(`可以在原位置恢复分支 ${branch} 的工作树。删除前未提交的修改无法恢复`, { exact: true }).waitFor()
|
||||
await missing.getByText('恢复工作树或在项目目录继续后,消息会接着发送', { exact: true }).waitFor()
|
||||
await showSessionPanel(page)
|
||||
await expect.poll(() => checkout.getAttribute('data-missing')).toBe('')
|
||||
const turns = async (): Promise<number> => (await readPersistedEvents(scaffold, sessionId)).filter(event => event.type === 'turn/start').length
|
||||
expect(await turns()).toBe(1)
|
||||
@@ -888,6 +944,7 @@ it.skipIf(MODE === 'record')('starts a Session in a worktree before its first me
|
||||
await page.getByRole('alert').filter({ hasText: '工作树已恢复' }).waitFor()
|
||||
expect(await git(directory, 'rev-parse', '--abbrev-ref', 'HEAD')).toBe(branch)
|
||||
expect(await git(directory, 'rev-parse', 'HEAD')).toBe(baseCommit)
|
||||
await showSessionPanel(page)
|
||||
await expect.poll(() => checkout.getAttribute('data-missing')).toBeNull()
|
||||
// The waiting message goes on in the restored worktree.
|
||||
await page.getByText(FOLLOW_UP_REPLY, { exact: true }).waitFor({ timeout: 20_000 })
|
||||
@@ -924,8 +981,7 @@ it.skipIf(MODE === 'record')('keeps the first message waiting when the worktree
|
||||
expect(worktreeRecords(events)).toEqual([{ action: 'request', from: 'main' }, { action: 'request', from: 'release' }, { action: 'cancel' }])
|
||||
expect(events.filter(event => event.type === 'turn/start')).toHaveLength(1)
|
||||
expect(events.some(event => event.type === 'user/message' && event.data.source.kind === 'working-directory')).toBe(false)
|
||||
await page.locator('[data-forge-header]').click({ timeout: 20_000 })
|
||||
const checkout = page.locator('[data-forge-panel] [data-forge-checkout]')
|
||||
const checkout = (await showSessionPanel(page)).locator('[data-forge-checkout]')
|
||||
const checkoutName = checkout.getByText('main', { exact: true })
|
||||
await checkoutName.waitFor({ timeout: 20_000 })
|
||||
await checkout.getByText('项目目录', { exact: true }).waitFor()
|
||||
@@ -944,14 +1000,12 @@ it.skipIf(MODE === 'record')('marks a draft change request ready for review and
|
||||
if (session === undefined) throw new Error('The Session must stay loaded')
|
||||
|
||||
scaffold.ctx.forgeSession.track(session, DRAFT)
|
||||
const header = page.locator('[data-forge-header]')
|
||||
await expect.poll(() => header.getAttribute('aria-label'), { timeout: 20_000 }).toBe('本会话的变更请求')
|
||||
await header.click()
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${DRAFT}"]`)
|
||||
await change.getByRole('link', { name: 'Add the merge button', exact: true }).waitFor({ timeout: 20_000 })
|
||||
|
||||
// The only open change request starts expanded, so its action is in view.
|
||||
await change.getByRole('button', { name: '标记为可评审', exact: true }).click()
|
||||
// The only open change request starts expanded, so its Merge action shows once it is ready.
|
||||
await chooseCardAction(page, change, '#9', '标记为可评审')
|
||||
await page.getByRole('alert').filter({ hasText: '已将 #9 标记为可评审' }).waitFor()
|
||||
const merge = change.getByRole('button', { name: '合并', exact: true })
|
||||
await merge.waitFor({ timeout: 20_000 })
|
||||
@@ -1004,18 +1058,11 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
await page.getByText('LIGHTHOUSE', { exact: true }).waitFor()
|
||||
const session = scaffold.ctx.sessions.get(sessionId)
|
||||
if (session === undefined) throw new Error('The Session must stay loaded')
|
||||
const header = page.locator('[data-forge-header]')
|
||||
await page.getByRole('button', { name: '打开右侧边栏', exact: true }).click()
|
||||
const guide = page.locator('[data-sidebar-right-guide]')
|
||||
await guide.getByRole('button', { name: /^代码审查和变更/ }).waitFor()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'review-guide.expected.md'),
|
||||
await captureStableAria(page, '[data-sidebar-right-guide-entry="forge-panel"]', scaffold.workspaceCwd), MODE)
|
||||
await guide.getByRole('button', { name: /^代码审查和变更/ }).click()
|
||||
// The New Session screen inspected the checkout before these changes, which came from outside the Session.
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
// The New Session screen inspected the checkout before these changes, which came from outside the Session;
|
||||
// opening the panel inspects it again.
|
||||
await showSessionPanel(page)
|
||||
const card = page.locator('[data-forge-local]')
|
||||
await card.getByText('HEAD → origin/main', { exact: true }).waitFor({ timeout: 20_000 })
|
||||
await card.getByRole('button', { name: '查看本会话的变更:4 个文件,新增 4 行,删除 1 行', exact: true }).click()
|
||||
await card.getByRole('button', { name: '本地变更 · 4 个文件,新增 4 行,删除 1 行', exact: true }).click({ timeout: 20_000 })
|
||||
|
||||
const local = page.locator('[data-forge-changes="local"]')
|
||||
await local.getByRole('button', { name: '基准分支:origin/main', exact: true }).waitFor({ timeout: 20_000 })
|
||||
@@ -1086,18 +1133,21 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
|
||||
// A change request bound the way a `gh pr create` result binds one.
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await expect.poll(() => header.getAttribute('aria-pressed'), { timeout: 20_000 }).toBe('false')
|
||||
await header.click()
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
await change.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await card.getByRole('button', { name: '查看本会话的变更:4 个文件,新增 4 行,删除 1 行', exact: true }).waitFor()
|
||||
expect(await card.getByRole('button', { name: '创建变更请求', exact: true }).count()).toBe(0)
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'local-and-pr.expected.md'),
|
||||
await captureStableAria(page, '[data-forge-panel]', scaffold.workspaceCwd), MODE)
|
||||
await card.getByRole('button', { name: '查看本会话的变更:4 个文件,新增 4 行,删除 1 行', exact: true }).click()
|
||||
await card.getByRole('button', { name: '本地变更 · 4 个文件,新增 4 行,删除 1 行', exact: true }).waitFor()
|
||||
// The open change request of the checked-out branch replaces the offer to create one.
|
||||
await card.getByRole('button', { name: '本地变更操作', exact: true }).click()
|
||||
await page.getByRole('menuitem', { name: '查看变更', exact: true }).waitFor()
|
||||
expect(await page.getByRole('menuitem', { name: '创建变更请求', exact: true }).count()).toBe(0)
|
||||
await card.getByRole('button', { name: '本地变更操作', exact: true }).click()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'local-and-pr.expected.md'), await captureStableAria(page, '[data-session-panel]', scaffold.workspaceCwd, {
|
||||
replacements: [[abbreviateHomePath(scaffold.workspaceCwd, homedir()), '{{cwd}}']],
|
||||
}), MODE)
|
||||
await card.getByRole('button', { name: '本地变更 · 4 个文件,新增 4 行,删除 1 行', exact: true }).click()
|
||||
await local.getByText('暂存区与 HEAD 比较', { exact: true }).waitFor()
|
||||
await expect.poll(() => header.getAttribute('aria-pressed')).toBe('false')
|
||||
await header.click()
|
||||
await showSessionPanel(page)
|
||||
await change.getByRole('button', { name: '查看 #7 的变更:新增 128 行,删除 14 行', exact: true }).click()
|
||||
const view = page.locator('[data-forge-changes="change"]')
|
||||
const panelFile = view.locator('[data-forge-diff-file="src/panel.ts"]')
|
||||
@@ -1297,7 +1347,7 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
await page.setViewportSize({ width: 1680, height: 1000 })
|
||||
await page.locator('[data-dockkit-tab]').filter({ hasText: '#7 的变更' }).locator('[data-dockkit-tab-close]').click()
|
||||
await expect.poll(() => view.count()).toBe(0)
|
||||
if (await header.getAttribute('aria-pressed') !== 'true') await header.click()
|
||||
await showSessionPanel(page)
|
||||
await change.getByRole('button', { name: '查看 #7 的变更:新增 128 行,删除 14 行', exact: true }).click()
|
||||
await panelFile.getByRole('button', { name: '6 行未变更', exact: true }).waitFor()
|
||||
expect(await panelFile.locator('[data-forge-review-thread]').count()).toBe(0)
|
||||
@@ -1309,8 +1359,7 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
|
||||
// Pull request 9 changes 301 files, more than the pull request diff endpoint accepts; the compare read shows every file.
|
||||
scaffold.ctx.forgeSession.track(session, DRAFT)
|
||||
await expect.poll(() => header.getAttribute('aria-pressed'), { timeout: 20_000 }).toBe('false')
|
||||
await header.click()
|
||||
await showSessionPanel(page)
|
||||
const draft = page.locator(`[data-forge-change="${DRAFT}"]`)
|
||||
await draft.getByRole('button', { name: '展开 #9', exact: true }).click()
|
||||
await draft.getByRole('button', { name: '查看 #9 的变更:新增 30 行,删除 2 行', exact: true }).click({ timeout: 20_000 })
|
||||
@@ -1327,7 +1376,7 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an
|
||||
scaffold.ctx.forge.refresh({ repository: { forge: 'github', host: 'github.com', owner: 'octo', name: 'demo' }, number: 9 })
|
||||
await expect.poll(() => scaffold.ctx.forge.latest({ repository: { forge: 'github', host: 'github.com', owner: 'octo', name: 'demo' }, number: 9 }),
|
||||
{ timeout: 20_000 }).toMatchObject({ snapshot: { headSha: 'd'.repeat(40) } })
|
||||
if (await header.getAttribute('aria-pressed') !== 'true') await header.click()
|
||||
await showSessionPanel(page)
|
||||
const expand = draft.getByRole('button', { name: '展开 #9', exact: true })
|
||||
if (await expand.count() > 0) await expand.click()
|
||||
await draft.getByRole('button', { name: '查看 #9 的变更:新增 30 行,删除 2 行', exact: true }).click({ timeout: 20_000 })
|
||||
@@ -1368,8 +1417,11 @@ it.skipIf(MODE === 'record')('retains a wrapped code line and tree width across
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
// Keep the file tree and the Session sidebar visible together on every platform.
|
||||
await page.setViewportSize({ width: 2400, height: 700 })
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator(`[data-forge-change="${PULL}"]`).getByRole('button', { name: /查看 #7 的变更/ }).click()
|
||||
// A start page beside the changes tab is the other tab the switches below show.
|
||||
await page.getByRole('button', { name: '新标签页', exact: true }).first().click()
|
||||
await page.getByRole('tab').filter({ hasText: '#7 的变更' }).click()
|
||||
const view = page.locator('[data-forge-changes="change"]')
|
||||
const scroll = view.locator('[data-forge-changes-scroll]')
|
||||
const file = view.locator('[data-forge-diff-file="src/server.ts"]')
|
||||
@@ -1408,7 +1460,7 @@ it.skipIf(MODE === 'record')('retains a wrapped code line and tree width across
|
||||
expect(position.line).toBe('300')
|
||||
expect(position.offset).toBe(-7)
|
||||
for (const destination of ['tab', 'session', 'tab', 'session']) {
|
||||
if (destination === 'tab') await page.getByRole('tab').filter({ hasText: '变更请求' }).click()
|
||||
if (destination === 'tab') await page.getByRole('tab').filter({ hasText: '开始' }).click()
|
||||
else await page.getByRole('button', { name: '新建会话', exact: true }).last().click()
|
||||
await expect.poll(() => view.isVisible()).toBe(false)
|
||||
await layout()
|
||||
@@ -1436,9 +1488,8 @@ it.skipIf(MODE === 'record')('uses horizontal arrows to navigate files while pre
|
||||
}
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /查看本会话的变更:3 个文件/ }).click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /本地变更 · 3 个文件/ }).click()
|
||||
const view = page.locator('[data-forge-changes="local"]')
|
||||
const scroll = view.getByRole('region', { name: '全部 3 个文件', exact: true })
|
||||
await scroll.waitFor()
|
||||
@@ -1516,9 +1567,8 @@ it.skipIf(MODE === 'record')('opens a comment from the hover plus in one press w
|
||||
await writeFile(join(project, 'notes.txt'), ['keep 1', 'keep 2', 'keep 4', 'keep 5', 'added', 'keep 6'].map(line => `${line}\n`).join(''))
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /查看本会话的变更/ }).click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /^本地变更 · / }).click()
|
||||
const view = page.locator('[data-forge-changes="local"]')
|
||||
const file = view.locator('[data-forge-diff-file="README.md"]')
|
||||
const number = (name: string) => file.getByRole('button', { name: `选择第 ${name} 行`, exact: true })
|
||||
@@ -1637,10 +1687,8 @@ it.skipIf(MODE === 'record')('keeps tall branch and changed-file menus aligned w
|
||||
await git(project, 'commit', '--quiet', '-m', 'long file list')
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.locator('[data-forge-header]').click()
|
||||
const panel = page.locator('[data-forge-panel]')
|
||||
await panel.getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await panel.getByRole('button', { name: /^查看本会话的变更:60 个文件/ }).click()
|
||||
const panel = await showSessionPanel(page)
|
||||
await panel.getByRole('button', { name: /^本地变更 · 60 个文件/ }).click()
|
||||
const changes = page.locator('[data-forge-changes="local"]')
|
||||
const files = changes.getByRole('button', { name: '全部 60 个文件', exact: true })
|
||||
await files.click()
|
||||
@@ -1666,7 +1714,7 @@ it.skipIf(MODE === 'record')('keeps tall branch and changed-file menus aligned w
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
})
|
||||
|
||||
it.skipIf(MODE === 'record')('aligns localized status rows by their glyphs and keeps long file lists inside one vertical scroller', async () => {
|
||||
it.skipIf(MODE === 'record')('aligns localized status rows by their glyphs in the Session panel at every width', async () => {
|
||||
const { scaffold, page, project, tripwire } = await launchPanel('web-e2e-forge-layout')
|
||||
await page.locator('[data-forge-current-branch]').waitFor()
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'worktree-option.expected.md'),
|
||||
@@ -1684,29 +1732,8 @@ it.skipIf(MODE === 'record')('aligns localized status rows by their glyphs and k
|
||||
const session = scaffold.ctx.sessions.get(await settled)
|
||||
if (session === undefined) throw new Error('The Session must stay loaded')
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await page.locator('[data-forge-header]').click()
|
||||
const panel = page.locator('[data-forge-panel]')
|
||||
await panel.getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
const local = panel.locator('[data-forge-local]')
|
||||
await local.locator('button[aria-expanded]').click()
|
||||
await expect.poll(() => local.locator('li').count(), { timeout: 20_000 }).toBe(60)
|
||||
for (const width of [1280, 390]) {
|
||||
await page.setViewportSize({ width, height: 700 })
|
||||
const outerScrollers = await panel.evaluate((element) => {
|
||||
const scrollers: string[] = []
|
||||
for (let ancestor = element.parentElement; ancestor !== null; ancestor = ancestor.parentElement) {
|
||||
if (/auto|scroll/.test(getComputedStyle(ancestor).overflowY) && ancestor.scrollHeight > ancestor.clientHeight + 1) {
|
||||
scrollers.push(ancestor.className)
|
||||
}
|
||||
}
|
||||
return scrollers
|
||||
})
|
||||
expect(outerScrollers).toEqual([])
|
||||
expect(await panel.evaluate(element => element.scrollHeight > element.clientHeight)).toBe(true)
|
||||
await local.locator('li').last().scrollIntoViewIfNeeded()
|
||||
expect(await local.locator('li').last().isVisible()).toBe(true)
|
||||
}
|
||||
await local.locator('button[aria-expanded]').click()
|
||||
const panel = await showSessionPanel(page)
|
||||
await panel.locator('[data-forge-local]').getByRole('button', { name: /^本地变更 · 60 个文件/ }).waitFor({ timeout: 20_000 })
|
||||
const change = panel.locator(`[data-forge-change="${PULL}"]`)
|
||||
for (const [locale, labels] of [
|
||||
['zh', ['检查', '评审', '合并', '变更']],
|
||||
@@ -1721,6 +1748,8 @@ it.skipIf(MODE === 'record')('aligns localized status rows by their glyphs and k
|
||||
}
|
||||
for (const width of [1280, 390]) {
|
||||
await page.setViewportSize({ width, height: 700 })
|
||||
// A narrower window can hide the panel, which then opens over the conversation.
|
||||
await showSessionPanel(page)
|
||||
await expect.poll(() => change.evaluate(element => element.getBoundingClientRect().right)).toBeLessThanOrEqual(width)
|
||||
// Each row names its fact for assistive technology only; the row starts with its glyph.
|
||||
const rowOf = (label: string) => change.getByText(label, { exact: true }).locator('xpath=../..')
|
||||
@@ -1823,9 +1852,8 @@ it.skipIf(MODE === 'record').each(['darwin', 'win32'] as const)('closes diff men
|
||||
await writeFile(join(project, 'README.md'), 'review this change\n')
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
const sessionId = await settled
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /查看本会话的变更:1 个文件/ }).click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /本地变更 · 1 个文件/ }).click()
|
||||
const view = page.locator('[data-forge-changes="local"]')
|
||||
await view.locator('[data-forge-diff-file="README.md"]').waitFor()
|
||||
for (const name of ['分支', '全部 1 个文件', 'README.md 的更多操作']) {
|
||||
@@ -1894,7 +1922,7 @@ it.skipIf(MODE === 'record').each([120, 4000])('types a review comment beside %i
|
||||
const session = scaffold.ctx.sessions.get(sessionId)
|
||||
if (session === undefined) throw new Error('Session must stay loaded')
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await showSessionPanel(page)
|
||||
const change = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
await change.getByRole('button', { name: '查看 #7 的变更:新增 128 行,删除 14 行', exact: true }).click()
|
||||
const file = page.locator('[data-forge-diff-file="src/typing.ts"]')
|
||||
@@ -1943,7 +1971,7 @@ async function openReview(page: Page, scaffold: WebScaffold): Promise<{ readonly
|
||||
const session = scaffold.ctx.sessions.get(sessionId)
|
||||
if (session === undefined) throw new Error('Session must stay loaded')
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator(`[data-forge-change="${PULL}"]`).getByRole('button', { name: '查看 #7 的变更:新增 128 行,删除 14 行', exact: true }).click()
|
||||
await page.getByRole('button', { name: '全屏', exact: true }).click()
|
||||
const view = page.locator('[data-forge-changes="change"]')
|
||||
@@ -1968,7 +1996,7 @@ it.skipIf(MODE === 'record')('lets a plugin filter the changes by its lens, anno
|
||||
const session = scaffold.ctx.sessions.get(await settled)
|
||||
if (session === undefined) throw new Error('Session must stay loaded')
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await showSessionPanel(page)
|
||||
|
||||
// The card button the plugin adds opens the changes view with its lens chosen.
|
||||
await page.locator(`[data-forge-change="${PULL}"]`).getByRole('button', { name: '打开导出视图', exact: true }).click()
|
||||
@@ -2100,11 +2128,9 @@ it.skipIf(MODE === 'record')('keeps local viewed marks across reloads, clears a
|
||||
await writeFile(join(project, 'notes.md'), 'note\n')
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.getByRole('button', { name: '打开右侧边栏', exact: true }).click()
|
||||
await page.locator('[data-sidebar-right-guide]').getByRole('button', { name: /^代码审查和变更/ }).click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await showSessionPanel(page)
|
||||
const card = page.locator('[data-forge-local]')
|
||||
await card.getByRole('button', { name: /^查看本会话的变更:3 个文件/ }).click({ timeout: 20_000 })
|
||||
await card.getByRole('button', { name: /^本地变更 · 3 个文件/ }).click({ timeout: 20_000 })
|
||||
const local = page.locator('[data-forge-changes="local"]')
|
||||
const app = local.locator('[data-forge-diff-file="src/app.ts"]')
|
||||
await app.getByRole('checkbox', { name: '将 app.ts 标记为已审阅', exact: true }).check({ timeout: 20_000 })
|
||||
@@ -2182,7 +2208,10 @@ it.skipIf(MODE === 'record')('overlays the review threads of a change request an
|
||||
await view.locator('[data-forge-diff-file="docs/panel.md"] [data-forge-thread="whole-file"]').getByText('文件级讨论', { exact: true }).waitFor()
|
||||
const count = panel.getByRole('button', { name: 'panel.ts 有 3 条未解决的讨论,跳到下一条', exact: true })
|
||||
await count.waitFor()
|
||||
await view.getByRole('navigation').getByTitle('3 条未解决的讨论', { exact: true }).waitFor()
|
||||
// The tree names the count in a tooltip once the pointer rests on it.
|
||||
await view.getByRole('navigation').getByRole('button', { name: 'src/panel.ts', exact: true }).getByText('3', { exact: true }).hover()
|
||||
await page.getByRole('tooltip').getByText('3 条未解决的讨论', { exact: true }).waitFor()
|
||||
await page.mouse.move(1, 1)
|
||||
await compareOrRefreshGolden(join(EXPECTED, 'review-threads.expected.md'),
|
||||
await captureStableAria(page, '[data-forge-diff-file="src/panel.ts"]', scaffold.workspaceCwd), MODE)
|
||||
|
||||
@@ -2317,10 +2346,8 @@ it.skipIf(MODE === 'record')('keeps a narrow file header\'s viewed mark and menu
|
||||
await git(project, 'commit', '--quiet', '-am', 'Rename the module')
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.getByRole('button', { name: '打开右侧边栏', exact: true }).click()
|
||||
await page.locator('[data-sidebar-right-guide]').getByRole('button', { name: /^代码审查和变更/ }).click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /^查看本会话的变更/ }).click({ timeout: 20_000 })
|
||||
await showSessionPanel(page)
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /^本地变更 · / }).click({ timeout: 20_000 })
|
||||
const local = page.locator('[data-forge-changes="local"]')
|
||||
const name = 'renamed-review-module-with-an-even-longer-name.ts'
|
||||
const file = local.locator(`[data-forge-diff-file="${to}"]`)
|
||||
@@ -2475,7 +2502,7 @@ it.skipIf(MODE === 'record')('summarizes checks, reviewers, and the merge state
|
||||
const session = scaffold.ctx.sessions.get(await settled)
|
||||
if (session === undefined) throw new Error('Session must stay loaded')
|
||||
scaffold.ctx.forgeSession.track(session, PULL)
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await showSessionPanel(page)
|
||||
const card = page.locator(`[data-forge-change="${PULL}"]`)
|
||||
// The card chooses its default expansion once its first status arrives, which names the title.
|
||||
await card.getByRole('link', { name: 'Add the pull request panel', exact: true }).waitFor({ timeout: 20_000 })
|
||||
@@ -2545,9 +2572,8 @@ async function openLocalChanges(failureShot: string): Promise<PanelLaunch & { re
|
||||
await writeFile(join(project, 'notes.md'), 'note\n')
|
||||
const { settled } = await sendPrompt(page, scaffold)
|
||||
await settled
|
||||
await page.locator('[data-forge-header]').click()
|
||||
await page.locator('[data-forge-panel]').getByRole('button', { name: '刷新状态', exact: true }).click()
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /查看本会话的变更/ }).click()
|
||||
await showSessionPanel(page)
|
||||
await page.locator('[data-forge-local]').getByRole('button', { name: /^本地变更 · / }).click({ timeout: 20_000 })
|
||||
const view = page.locator('[data-forge-changes="local"]')
|
||||
await view.locator('[data-forge-diff-file="README.md"]').waitFor()
|
||||
await page.getByRole('button', { name: '全屏', exact: true }).click()
|
||||
|
||||
+54
-66
@@ -1,4 +1,4 @@
|
||||
/** Background-job menu geometry over the normal Browser dock in the shipped Web composition. */
|
||||
/** Session panel geometry with an expanded background job beside the normal Browser dock in the shipped Web composition. */
|
||||
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
|
||||
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
@@ -15,55 +15,50 @@ import {
|
||||
assertFixtureInventory, compareOrRefreshGolden, launchWebScaffold, seedSession,
|
||||
watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { newEnglishPage, saveFailureShot, sessionPanelToggle, showSessionPanel } from './support.ts'
|
||||
|
||||
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
|
||||
const EXPECTED_DIR = fileURLToPath(new URL('./expected/jobs-menu-layering', import.meta.url))
|
||||
const EXPECTED_DIR = fileURLToPath(new URL('./expected/jobs-panel-layering', import.meta.url))
|
||||
const MODE = webSnapshotMode()
|
||||
const SEED_ID = brandString<SessionId>('jobs-menu-layering-web-e2e')
|
||||
const SEED_ID = brandString<SessionId>('jobs-panel-layering-web-e2e')
|
||||
// The private scaffold cwd owns the barrier; the loop bounds an orphan's lifetime.
|
||||
const RELEASE = '.jobs-menu-layering.release'
|
||||
const COMMAND = `printf 'jobs-menu-%s\\n' output; for _ in $(seq 1 3000); do [ -e ${RELEASE} ] && break; sleep 0.2; done`
|
||||
const RELEASE = '.jobs-panel-layering.release'
|
||||
const COMMAND = `printf 'jobs-panel-%s\\n' output; for _ in $(seq 1 3000); do [ -e ${RELEASE} ] && break; sleep 0.2; done`
|
||||
|
||||
/** Measure actual overlap and hit testing; ARIA alone cannot expose clipping or stacking. */
|
||||
function placement(page: Page) {
|
||||
return page.evaluate(() => {
|
||||
const list = document.querySelector<HTMLElement>('ul[aria-label="Background jobs"]')
|
||||
const anchor = document.querySelector<HTMLElement>('button[aria-label="1 background job"]')
|
||||
const panel = document.querySelector<HTMLElement>('[data-session-panel]')
|
||||
const section = document.querySelector<HTMLElement>('[data-session-panel-section="background-jobs"]')
|
||||
const frame = document.querySelector<HTMLElement>('[data-sidebar-browser-frame]')
|
||||
const dock = document.querySelector<HTMLElement>('[data-sidebar-right-panel][data-sidebar-right-open]')
|
||||
if (list === null || anchor === null || frame === null || dock === null) {
|
||||
throw new Error('job menu, trigger, or Browser dock is missing')
|
||||
if (panel === null || section === null || frame === null || dock === null) {
|
||||
throw new Error('Session panel, jobs section, or Browser dock is missing')
|
||||
}
|
||||
const menu = list.closest<HTMLElement>('[data-menu-material]') ?? list
|
||||
const box = menu.getBoundingClientRect()
|
||||
const trigger = anchor.getBoundingClientRect()
|
||||
const body = panel.closest<HTMLElement>('[data-conversation-content]')
|
||||
const seat = body?.querySelector<HTMLElement>('[data-composer-seat]') ?? null
|
||||
if (body === null || seat === null) throw new Error('conversation body or composer seat is missing')
|
||||
const box = panel.getBoundingClientRect()
|
||||
const host = body.getBoundingClientRect()
|
||||
const browser = frame.getBoundingClientRect()
|
||||
const left = Math.max(box.left, browser.left)
|
||||
const right = Math.min(box.right, browser.right)
|
||||
const top = Math.max(box.top, browser.top)
|
||||
const bottom = Math.min(box.bottom, browser.bottom)
|
||||
const overlapsBrowser = right - left > 8 && bottom - top > 8
|
||||
const aboveBrowser = overlapsBrowser && [0.25, 0.5, 0.75].every(x =>
|
||||
[0.25, 0.5, 0.75].every(y => menu.contains(document.elementFromPoint(
|
||||
left + (right - left) * x, top + (bottom - top) * y,
|
||||
))))
|
||||
const verticalGap = Math.min(Math.abs(box.top - trigger.bottom - 5), Math.abs(trigger.top - box.bottom - 5))
|
||||
const horizontalAlignment = Math.min(Math.abs(box.left - trigger.left), Math.abs(box.right - trigger.right))
|
||||
const composer = seat.getBoundingClientRect()
|
||||
const sectionBox = section.getBoundingClientRect()
|
||||
return {
|
||||
dockMode: dock.dataset.sidebarRightPanel,
|
||||
bodyMounted: menu.parentElement === document.body,
|
||||
fixed: getComputedStyle(menu).position === 'fixed',
|
||||
anchored: verticalGap <= 1 && horizontalAlignment <= 1,
|
||||
viewportBounded: box.left >= 11 && box.top >= 11
|
||||
&& box.right <= innerWidth - 11 && box.bottom <= innerHeight - 11,
|
||||
overlapsBrowser,
|
||||
aboveBrowser,
|
||||
presentation: panel.dataset.sessionPanel,
|
||||
insideBody: box.left >= host.left && box.right <= host.right && box.top >= host.top,
|
||||
clearOfBrowser: box.right <= browser.left,
|
||||
clearOfComposer: box.bottom <= composer.top,
|
||||
viewportBounded: box.left >= 0 && box.top >= 0 && box.right <= innerWidth && box.bottom <= innerHeight,
|
||||
sectionShown: sectionBox.height > 0,
|
||||
onTop: [0.25, 0.5, 0.75].every(x => [0.25, 0.5, 0.75].every(y => panel.contains(document.elementFromPoint(
|
||||
box.left + box.width * x, box.top + box.height * y,
|
||||
)))),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
describe.skipIf(MODE === 'record')('web e2e: jobs panel layering', () => {
|
||||
let scaffold: WebScaffold
|
||||
let browser: Browser
|
||||
let page: Page
|
||||
@@ -80,7 +75,7 @@ describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
page = await newEnglishPage(browser)
|
||||
await page.emulateMedia({ reducedMotion: 'reduce' })
|
||||
await page.route('https://browser.test/**', async route => route.fulfill({
|
||||
contentType: 'text/html', body: '<h1>Jobs menu browser fixture</h1>',
|
||||
contentType: 'text/html', body: '<h1>Jobs panel browser fixture</h1>',
|
||||
}))
|
||||
tripwire = watchConsole(page)
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
@@ -94,18 +89,18 @@ describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
if (jobId !== undefined) {
|
||||
const settled = await scaffold.ctx.jobs.wait(jobId, 15_000, agent.id)
|
||||
if (settled.status === 'running' || settled.status === 'stopping') {
|
||||
throw new Error('jobs menu fixture did not settle after releasing its barrier')
|
||||
throw new Error('jobs panel fixture did not settle after releasing its barrier')
|
||||
}
|
||||
}
|
||||
} catch (error) { failures.push(error) }
|
||||
}
|
||||
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, 'jobs menu layering teardown failed')
|
||||
if (failures.length > 0) throw new AggregateError(failures, 'jobs panel layering teardown failed')
|
||||
})
|
||||
|
||||
it('keeps the list and live output above the Browser dock while anchored and dismissable', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-jobs-menu-layering'))
|
||||
it('keeps the section and its live output in the conversation body beside the Browser dock and dismissable', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-jobs-panel-layering'))
|
||||
const initialViewport = page.viewportSize()!
|
||||
const session = page.locator(`[data-row-key="session:${SEED_ID}"]`)
|
||||
await expect.poll(async () => {
|
||||
@@ -121,9 +116,9 @@ describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
agent = opened
|
||||
const started = await executeToolFixture(scaffold.ctx, {
|
||||
signal: new AbortController().signal,
|
||||
callId: brandString<ToolCallId>('jobs-menu-layering-e2e'),
|
||||
callId: brandString<ToolCallId>('jobs-panel-layering-e2e'),
|
||||
name: 'bash',
|
||||
arguments: { command: COMMAND, description: 'Emit output and hold the jobs menu fixture', run_in_background: true },
|
||||
arguments: { command: COMMAND, description: 'Emit output and hold the jobs panel fixture', run_in_background: true },
|
||||
agent,
|
||||
})
|
||||
const reported = started.content.map(block => block.type === 'text' ? block.text : '').join('')
|
||||
@@ -135,7 +130,7 @@ describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
await expect.poll(() => {
|
||||
const job = scaffold.ctx.jobs.get(startedJobId, agent.id)
|
||||
const output = scaffold.ctx.jobs.readAt(startedJobId, 0, agent.id).chunks.map(chunk => chunk.text).join('')
|
||||
return job.status !== 'running' || output.includes('jobs-menu-output')
|
||||
return job.status !== 'running' || output.includes('jobs-panel-output')
|
||||
}, { timeout: 15_000 }).toBe(true)
|
||||
const readyJob = scaffold.ctx.jobs.get(startedJobId, agent.id)
|
||||
const readyOutput = scaffold.ctx.jobs.readAt(startedJobId, 0, agent.id).chunks.map(chunk => chunk.text).join('')
|
||||
@@ -145,61 +140,54 @@ describe.skipIf(MODE === 'record')('web e2e: jobs menu layering', () => {
|
||||
const column = page.locator('[data-rightbar-col]')
|
||||
await column.locator('[data-sidebar-right-guide-entry="browser"]').click()
|
||||
const address = column.getByRole('textbox', { name: 'Enter an HTTP(S) address' })
|
||||
await address.fill('https://browser.test/jobs-menu')
|
||||
await address.fill('https://browser.test/jobs-panel')
|
||||
await address.press('Enter')
|
||||
await page.frameLocator('[data-sidebar-browser-frame]')
|
||||
.getByRole('heading', { name: 'Jobs menu browser fixture' }).waitFor()
|
||||
.getByRole('heading', { name: 'Jobs panel browser fixture' }).waitFor()
|
||||
|
||||
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
await trigger.waitFor({ timeout: 15_000 })
|
||||
await trigger.focus()
|
||||
const toggle = sessionPanelToggle(page)
|
||||
await toggle.focus()
|
||||
await page.keyboard.press('Enter')
|
||||
const list = page.getByRole('list', { name: 'Background jobs' })
|
||||
await list.waitFor()
|
||||
await page.keyboard.press('Tab')
|
||||
expect(await list.getByRole('button', { name: /Show live output/ })
|
||||
.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
await panel.waitFor()
|
||||
const list = panel.locator('[data-session-panel-section="background-jobs"]').getByRole('list')
|
||||
await list.getByRole('button', { name: /Show live output/ }).waitFor({ timeout: 15_000 })
|
||||
const expectedPlacement = {
|
||||
dockMode: 'push', bodyMounted: true, fixed: true, anchored: true,
|
||||
viewportBounded: true, overlapsBrowser: true, aboveBrowser: true,
|
||||
dockMode: 'push', presentation: 'overlay', insideBody: true, clearOfBrowser: true,
|
||||
clearOfComposer: true, viewportBounded: true, sectionShown: true, onTop: true,
|
||||
}
|
||||
await expect.poll(() => placement(page)).toEqual(expectedPlacement)
|
||||
const collapsed = await placement(page)
|
||||
|
||||
await list.getByRole('button', { name: /Show live output/ }).click()
|
||||
await list.getByText('jobs-menu-output', { exact: true }).waitFor({ timeout: 15_000 })
|
||||
await list.getByText('jobs-panel-output', { exact: true }).waitFor({ timeout: 15_000 })
|
||||
await expect.poll(() => placement(page)).toEqual(expectedPlacement)
|
||||
const expanded = await placement(page)
|
||||
|
||||
await page.setViewportSize({ width: 1280, height: 760 })
|
||||
await showSessionPanel(page)
|
||||
await expect.poll(() => placement(page)).toEqual(expectedPlacement)
|
||||
const resized = await placement(page)
|
||||
await list.getByRole('button', { name: /Hide live output/ }).focus()
|
||||
await page.keyboard.press('Escape')
|
||||
await list.waitFor({ state: 'detached' })
|
||||
const escapeRestoresFocus = await trigger.evaluate(node => node === document.activeElement)
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
const escapeRestoresFocus = await toggle.evaluate(node => node === document.activeElement)
|
||||
expect(escapeRestoresFocus).toBe(true)
|
||||
|
||||
await trigger.click()
|
||||
await list.waitFor()
|
||||
await showSessionPanel(page)
|
||||
await address.click()
|
||||
await list.waitFor({ state: 'detached' })
|
||||
const outsideDismisses = await trigger.getAttribute('aria-expanded') === 'false'
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
const outsideDismisses = await toggle.getAttribute('aria-expanded') === 'false'
|
||||
expect(outsideDismisses).toBe(true)
|
||||
expect(await address.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await page.setViewportSize(initialViewport)
|
||||
await trigger.hover()
|
||||
await list.waitFor()
|
||||
expect(await address.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await page.keyboard.press('Escape')
|
||||
await list.waitFor({ state: 'detached' })
|
||||
expect(await address.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(scaffold.ctx.jobs.get(jobId, agent.id).status).toBe('running')
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
|
||||
await mkdir(EXPECTED_DIR, { recursive: true })
|
||||
await compareOrRefreshGolden(join(EXPECTED_DIR, 'geometry.expected.md'), [
|
||||
'# Background jobs above the Browser dock', '',
|
||||
'# Background jobs beside the Browser dock', '',
|
||||
'```json',
|
||||
JSON.stringify({ collapsed, expanded, resized, escapeRestoresFocus, outsideDismisses }, null, 2),
|
||||
'```',
|
||||
@@ -1,8 +1,8 @@
|
||||
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
|
||||
// Session-header job list driven by a real background bash run: the job row
|
||||
// arrives over the job roster stream, expanding it opens the output
|
||||
// observation stream, and the panel shows the process's real output while it
|
||||
// is still running. No model call is involved.
|
||||
// The Session panel's background-jobs section driven by a real background
|
||||
// bash run: the job row arrives over the job roster stream, expanding it opens
|
||||
// the output observation stream, and the row shows the process's real output
|
||||
// while it is still running. No model call is involved.
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join } from 'node:path'
|
||||
@@ -18,12 +18,13 @@ import {
|
||||
assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { hideSessionPanel, newEnglishPage, saveFailureShot, showSessionPanel } from './support.ts'
|
||||
|
||||
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v2.jsonl', import.meta.url))
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('./snapshots/live-job-stream', import.meta.url))
|
||||
const STREAMING_EXPECTED = join(SNAPSHOT_DIR, 'streaming.expected.md')
|
||||
const SETTLED_EXPECTED = join(SNAPSHOT_DIR, 'settled.expected.md')
|
||||
const SECTION = '[data-session-panel-section="background-jobs"]'
|
||||
const MODE = webSnapshotMode()
|
||||
const SEED_ID = 'live-job-stream-web-e2e'
|
||||
// One fixed line of early output, then a hold on a barrier file the test owns
|
||||
@@ -83,11 +84,12 @@ describe.skipIf(MODE === 'record')('web e2e: live job stream', () => {
|
||||
await scaffold?.close()
|
||||
})
|
||||
|
||||
it('streams a running job\'s real output into the expanded panel, then settles it in place on kill', async () => {
|
||||
it('streams a running job\'s real output into the expanded row, then settles it in place on kill', async () => {
|
||||
let phase = 'streaming'
|
||||
onTestFailed(() => saveFailureShot(page, `web-e2e-live-job-${phase}`))
|
||||
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
expect(await trigger.count()).toBe(0)
|
||||
const list = page.locator(SECTION).getByRole('list')
|
||||
await showSessionPanel(page)
|
||||
expect(await list.count()).toBe(0)
|
||||
|
||||
const started = await executeToolFixture(scaffold.ctx, {
|
||||
signal: new AbortController().signal,
|
||||
@@ -109,43 +111,41 @@ describe.skipIf(MODE === 'record')('web e2e: live job stream', () => {
|
||||
const readyOutput = scaffold.ctx.jobs.readAt(jobId, 0, agent.id).chunks.map(chunk => chunk.text).join('')
|
||||
expect(readyJob.status, `${readyJob.detail ?? ''}\n${readyOutput}`).toBe('running')
|
||||
|
||||
// The job row reaches the header over the job roster stream.
|
||||
await trigger.waitFor({ timeout: 15_000 })
|
||||
await trigger.click()
|
||||
|
||||
// Expanding the row opens the output observation stream; the panel then renders
|
||||
// the command's real stdout while the process is still running.
|
||||
const expand = page.getByRole('button', { name: /Show live output/ })
|
||||
await expand.waitFor({ timeout: 10_000 })
|
||||
// The job row reaches the open section over the job roster stream.
|
||||
// Expanding the row opens the output observation stream; the row then
|
||||
// renders the command's real stdout while the process is still running.
|
||||
const expand = list.getByRole('button', { name: /Show live output/ })
|
||||
await expand.waitFor({ timeout: 15_000 })
|
||||
await expand.click()
|
||||
await page.getByText('streamed-marker-line').waitFor({ timeout: 15_000 })
|
||||
await list.getByText('streamed-marker-line').waitFor({ timeout: 15_000 })
|
||||
|
||||
const streaming = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd, { runningJobs: 'keep' })
|
||||
const streaming = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(STREAMING_EXPECTED, streaming, MODE)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
|
||||
await trigger.click()
|
||||
await page.getByRole('list', { name: 'Background jobs' }).waitFor({ state: 'detached' })
|
||||
// Hiding the panel unmounts the section, which closes the observation
|
||||
// stream; showing it again lists the row collapsed, and expanding it
|
||||
// reopens the stream from the retained output.
|
||||
await hideSessionPanel(page)
|
||||
await list.waitFor({ state: 'detached' })
|
||||
expect(await page.getByText('streamed-marker-line', { exact: true }).count()).toBe(0)
|
||||
await page.mouse.move(2, 2)
|
||||
await trigger.hover()
|
||||
await page.getByRole('list', { name: 'Background jobs' }).waitFor()
|
||||
await page.getByRole('button', { name: /Hide live output/ }).waitFor()
|
||||
await page.getByText('streamed-marker-line', { exact: true }).waitFor()
|
||||
await showSessionPanel(page)
|
||||
await list.getByRole('button', { name: /Show live output/ }).click()
|
||||
await list.getByRole('button', { name: /Hide live output/ }).waitFor()
|
||||
await list.getByText('streamed-marker-line', { exact: true }).waitFor({ timeout: 15_000 })
|
||||
expect(scaffold.ctx.jobs.get(jobId, agent.id).status).toBe('running')
|
||||
|
||||
phase = 'settled'
|
||||
expect(scaffold.ctx.jobs.kill(jobId, agent.id, 'web e2e cancellation')).toBe('requested')
|
||||
|
||||
// The unchanged count label is not a settlement signal; the output row owns that state.
|
||||
await page.getByRole('button', { name: 'Finished 1', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await expect.poll(() => page.getByRole('list', { name: 'Background jobs' }).textContent()).toContain('web e2e cancellation')
|
||||
expect(await trigger.getAttribute('aria-label')).toBe('1 background job')
|
||||
// The settled section line owns the settlement signal; the expanded row moves under it.
|
||||
await list.getByRole('button', { name: 'Finished 1', exact: true }).waitFor({ timeout: 20_000 })
|
||||
await expect.poll(() => list.textContent()).toContain('web e2e cancellation')
|
||||
expect(scaffold.ctx.jobs.get(jobId, agent.id).status).toBe('killed')
|
||||
await page.getByText('streamed-marker-line').waitFor({ timeout: 10_000 })
|
||||
await list.getByText('streamed-marker-line').waitFor({ timeout: 10_000 })
|
||||
|
||||
const settled = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd)
|
||||
const settled = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(SETTLED_EXPECTED, settled, MODE)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
expect(tripwire.warnings).toEqual([])
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
buildVfsExampleFiles,
|
||||
} from '../../../packages/experimental/webworker-runtime/tests/vfs-example-fixture.ts'
|
||||
import { captureStableAria, compareOrRefreshGolden, webSnapshotMode } from './scaffold.ts'
|
||||
import { expandOwningTurnProcess, newEnglishPage, REPO_ROOT, saveFailureShot } from './support.ts'
|
||||
import { expandOwningTurnProcess, hideSessionPanel, newEnglishPage, REPO_ROOT, saveFailureShot, showSessionPanel } from './support.ts'
|
||||
|
||||
const DIST_ROOT = fileURLToPath(new URL('../dist', import.meta.url))
|
||||
/** Optional bundles that compose a profile of their own; the Web plugin page hides them, the Host inventory still reports them. */
|
||||
@@ -547,13 +547,10 @@ async function bootPreview(site: Site, manifest: ImageManifest, browser: Browser
|
||||
await preview.getByRole('heading', { name: 'Preview Workspace', exact: true }).waitFor({ state: 'visible' })
|
||||
expect(await preview.locator('[data-dockkit-tab-title]').allTextContents()).toEqual(['PREVIEW.md'])
|
||||
|
||||
const subagents = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await subagents.waitFor({ timeout: 15_000 })
|
||||
await subagents.hover()
|
||||
const catalog = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const catalog = (await showSessionPanel(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
await catalog.getByRole('treeitem', { name: /Review preview architecture/ }).waitFor()
|
||||
await catalog.getByRole('treeitem', { name: /Continue preview verification/ }).waitFor()
|
||||
await catalog.press('Escape')
|
||||
await hideSessionPanel(page)
|
||||
|
||||
// Auto-prefetch may already have published the page, and a pointer click can
|
||||
// land on whatever moved under it; activate the control only while it still
|
||||
|
||||
@@ -1656,18 +1656,13 @@ function normalizeAria(snapshot: string, workspaceCwd: string, age: boolean): st
|
||||
/**
|
||||
* Capture the region's aria snapshot at a settled milestone: poll until two
|
||||
* consecutive normalized captures are equal — a single-shot capture races the
|
||||
* last React commits. A foreground shell command is a job while it runs, and
|
||||
* its removal reaches the browser one coalesced roster frame after the tool
|
||||
* result, so by default the capture first waits for the session header's
|
||||
* running-job control to leave; a scenario whose milestone is a running job
|
||||
* keeps it with `runningJobs: 'keep'`.
|
||||
* last React commits.
|
||||
* @param page - the page under test.
|
||||
* @param selector - the region locator selector.
|
||||
* @param workspaceCwd - normalization input.
|
||||
* @param options - `normalizeAge` collapses relative-time buckets to `{{age}}`
|
||||
* for a region whose rows are dated from live wall-clock state;
|
||||
* `replacements` tokenizes scenario-owned values before generic normalization;
|
||||
* `runningJobs` is `'settle'` (default: wait for no running-job control) or `'keep'`.
|
||||
* `replacements` tokenizes scenario-owned values before generic normalization.
|
||||
* @returns the stable normalized snapshot.
|
||||
*/
|
||||
export async function captureStableAria(
|
||||
@@ -1677,13 +1672,8 @@ export async function captureStableAria(
|
||||
options: {
|
||||
normalizeAge?: boolean
|
||||
replacements?: readonly (readonly [value: string, token: string])[]
|
||||
runningJobs?: 'settle' | 'keep'
|
||||
} = {},
|
||||
): Promise<string> {
|
||||
if ((options.runningJobs ?? 'settle') === 'settle') {
|
||||
await page.getByRole('button', { name: /background jobs? running/ })
|
||||
.waitFor({ state: 'detached', timeout: 10_000 })
|
||||
}
|
||||
const region = page.locator(selector).first()
|
||||
const age = options.normalizeAge === true
|
||||
const normalize = (snapshot: string): string => {
|
||||
|
||||
@@ -170,8 +170,7 @@ describe.skipIf(MODE === 'record')('web e2e: archiving a running Session stops i
|
||||
expect(scaffold.ctx.agents.get(sessionId)?.status).toBe('running')
|
||||
expect(await childAlive(cwd)).toBe(true)
|
||||
await expect.poll(() => sessionRow().count()).toBe(1)
|
||||
// The Bash command is a running job while the dialog is open, by design.
|
||||
const snapshot = await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd, { runningJobs: 'keep' })
|
||||
const snapshot = await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd)
|
||||
await compareOrRefreshGolden(DIALOG_EXPECTED, snapshot, MODE)
|
||||
|
||||
// Cancel keeps everything as it was.
|
||||
|
||||
@@ -248,6 +248,15 @@ describe.skipIf(MODE === 'record')('web e2e: Session panel layout', () => {
|
||||
})
|
||||
await other.mouse.move(5, 5)
|
||||
await expect.poll(async () => (await rowLayout(other)).highlighted).toBe(false)
|
||||
// The row's open menu keeps the row highlighted and the More button shown after the pointer leaves for the menu.
|
||||
await row.locator('[data-row-part="menu"] button').click()
|
||||
await other.getByRole('menu').waitFor()
|
||||
await other.mouse.move(5, 5)
|
||||
expect(await rowLayout(other)).toEqual({
|
||||
...resting, menu: { center: 14, target: [24, 24], opacity: '1' }, hovered: false, highlighted: true,
|
||||
})
|
||||
await other.keyboard.press('Escape')
|
||||
await expect.poll(async () => (await rowLayout(other)).highlighted).toBe(false)
|
||||
expect(errors.pageErrors).toEqual([])
|
||||
})
|
||||
})
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
webSnapshotMode,
|
||||
type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot, sessionPanelToggle, showSessionPanel } from './support.ts'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
|
||||
const SNAPSHOT_DIR = fileURLToPath(new URL('./expected/sidebar-subagent-activity', import.meta.url))
|
||||
@@ -146,9 +146,10 @@ describe('web e2e: sidebar subagent activity', () => {
|
||||
)
|
||||
expect(await ownerRow.locator('[data-state="ongoing"]').count()).toBe(1)
|
||||
await ownerRow.click()
|
||||
const runningTrigger = page.getByRole('button', { name: '1 subagent', exact: true })
|
||||
await runningTrigger.waitFor({ timeout: 10_000 })
|
||||
expect(await runningTrigger.locator('[data-state="ongoing"]').count()).toBe(1)
|
||||
const toggle = sessionPanelToggle(page)
|
||||
const subagents = (await showSessionPanel(page)).locator('[data-session-panel-section="subagents"]')
|
||||
await subagents.getByRole('treeitem').locator('[data-state="ongoing"]').waitFor({ timeout: 10_000 })
|
||||
expect(await subagents.getByText('1 in progress', { exact: true }).isVisible()).toBe(true)
|
||||
// This directly created owner has no tool preset; the fixture collects its own job.
|
||||
scaffold.ctx.effect(() => scaffold.ctx.jobs.attachController('compact header fixture'), 'compact header job controller')
|
||||
const completion = Promise.withResolvers<{ status: 'completed' }>()
|
||||
@@ -161,54 +162,34 @@ describe('web e2e: sidebar subagent activity', () => {
|
||||
},
|
||||
})
|
||||
const viewport = page.viewportSize()!
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
const assertRunningSections = async (): Promise<void> => {
|
||||
await showSessionPanel(page)
|
||||
for (const section of ['subagents', 'background-jobs']) {
|
||||
await panel.locator(`[data-session-panel-section="${section}"]`).locator('[data-state="ongoing"]').first()
|
||||
.waitFor({ timeout: 10_000 })
|
||||
}
|
||||
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
|
||||
await page.keyboard.press('Escape')
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
}
|
||||
try {
|
||||
const jobTrigger = page.getByRole('button', { name: '1 background job', exact: true })
|
||||
await jobTrigger.waitFor()
|
||||
expect(await jobTrigger.evaluate(element => document.getElementById(element.getAttribute('aria-describedby')!)?.textContent)).toBe('Running')
|
||||
const controls = [
|
||||
{ trigger: runningTrigger, icon: '[data-icon="dsw-icon-users-outline-regular"]', count: '[data-subagent-count]' },
|
||||
{ trigger: jobTrigger, icon: '[data-icon="dsw-icon-layers-outline-regular"]', count: '[data-job-count]' },
|
||||
]
|
||||
for (const { trigger, icon, count } of controls) {
|
||||
expect(await trigger.locator(count).isVisible()).toBe(true)
|
||||
expect(await trigger.locator('[data-state="ongoing"]').isVisible()).toBe(true)
|
||||
expect(await trigger.locator(icon).isVisible()).toBe(false)
|
||||
}
|
||||
await runningTrigger.focus()
|
||||
await assertRunningSections()
|
||||
await toggle.focus()
|
||||
await page.setViewportSize({ width: 390, height: 700 })
|
||||
for (const { trigger, icon, count } of controls) {
|
||||
await expect.poll(() => trigger.locator(count).isVisible()).toBe(false)
|
||||
expect(await trigger.locator(icon).isVisible()).toBe(true)
|
||||
expect(await trigger.locator('[data-state="ongoing"]').isVisible()).toBe(false)
|
||||
}
|
||||
expect(await runningTrigger.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
expect(await jobTrigger.evaluate(element => document.getElementById(element.getAttribute('aria-describedby')!)?.textContent)).toBe('Running')
|
||||
expect(await toggle.evaluate(element => element === document.activeElement)).toBe(true)
|
||||
await compareOrRefreshGolden(
|
||||
join(SNAPSHOT_DIR, 'compact-running.expected.md'),
|
||||
await captureStableAria(page, 'header:has([data-subagent-action])', scaffold.workspaceCwd),
|
||||
await captureStableAria(page, 'header:has([data-session-panel-toggle])', scaffold.workspaceCwd),
|
||||
MODE,
|
||||
)
|
||||
await saveFailureShot(page, 'web-e2e-compact-running-icons')
|
||||
await runningTrigger.click()
|
||||
const members = page.locator('[data-subagent-panel]')
|
||||
await members.waitFor()
|
||||
expect(await members.getByRole('treeitem').locator('[data-state="ongoing"]').isVisible()).toBe(true)
|
||||
await page.keyboard.press('Escape')
|
||||
await jobTrigger.click()
|
||||
const jobs = page.getByRole('list', { name: 'Background jobs', exact: true })
|
||||
await jobs.waitFor()
|
||||
expect(await jobs.locator('[data-state="ongoing"]').isVisible()).toBe(true)
|
||||
await page.keyboard.press('Escape')
|
||||
await saveFailureShot(page, 'web-e2e-compact-running-header')
|
||||
await assertRunningSections()
|
||||
await page.setViewportSize(viewport)
|
||||
for (const { trigger, icon, count } of controls) {
|
||||
await expect.poll(() => trigger.locator(count).isVisible()).toBe(true)
|
||||
expect(await trigger.locator('[data-state="ongoing"]').isVisible()).toBe(true)
|
||||
expect(await trigger.locator(icon).isVisible()).toBe(false)
|
||||
}
|
||||
await assertRunningSections()
|
||||
} finally {
|
||||
completion.resolve({ status: 'completed' })
|
||||
await scaffold.ctx.jobs.wait(jobId, 5_000, ownerId)
|
||||
await page.keyboard.press('Escape')
|
||||
await page.setViewportSize(viewport)
|
||||
}
|
||||
await assertFixtureInventory(SNAPSHOT_DIR, ['owner-running.expected.md', 'compact-running.expected.md'])
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Web e2e scenario: hovering a sidebar session row marquees a title wider than
|
||||
// its cell. The jsdom lane pins only the positions the handler writes; the
|
||||
// assembled browser is where the title really clips, really crawls toward its
|
||||
// own hovered extent (the trailing relative-time cell yields to the row menu
|
||||
// while the pointer rests on the row, so the hovered cell is wider than the
|
||||
// resting one), really fades its moved left edge, and really returns to its
|
||||
// start when the pointer leaves.
|
||||
// its cell. The jsdom lane pins only the distance and time the handler hands
|
||||
// the stylesheet; the assembled browser is where the title really clips,
|
||||
// really travels toward its own hovered extent (the trailing relative-time
|
||||
// cell yields to the row menu while the pointer rests on the row, so the
|
||||
// hovered cell is wider than the resting one) without a frame script, really
|
||||
// fades its cut edges, and really returns to its start when the pointer leaves.
|
||||
//
|
||||
// Zero model calls: seeding one renamed session and hovering its row touches no
|
||||
// provider.
|
||||
@@ -48,60 +48,79 @@ describe('web e2e: hovering a clipped session title marquees it to its far edge'
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-sidebar-title-hover-scroll'))
|
||||
const row = page.getByRole('treeitem').filter({ has: page.getByText(TITLE, { exact: true }) })
|
||||
await row.waitFor({ timeout: 20_000 })
|
||||
const title = row.getByText(TITLE, { exact: true })
|
||||
// The title text sits in the span that travels; its parent clips it.
|
||||
const travel = row.getByText(TITLE, { exact: true })
|
||||
const title = travel.locator('xpath=..')
|
||||
/** How far the text has travelled from its start, in CSS pixels. */
|
||||
const travelled = async (): Promise<number> => travel.evaluate((el) => {
|
||||
const transform = getComputedStyle(el).transform
|
||||
return transform === 'none' ? 0 : -new DOMMatrix(transform).m41
|
||||
})
|
||||
/** Top of the title's glyphs: the text keeps its line while its span becomes a box to travel. */
|
||||
const glyphTop = async (): Promise<number> => travel.evaluate((el) => {
|
||||
const glyphs = document.createRange()
|
||||
glyphs.selectNodeContents(el)
|
||||
return glyphs.getBoundingClientRect().top
|
||||
})
|
||||
/** The distance the hook measured for the hovered cell. */
|
||||
const range = async (): Promise<number> => title.evaluate(el => Number.parseFloat(el.style.getPropertyValue('--dsh-marquee-range')))
|
||||
|
||||
// At rest the row clips its title with an ellipsis and holds its start.
|
||||
expect(await title.evaluate(el => el.scrollWidth - el.clientWidth)).toBeGreaterThan(0)
|
||||
expect(await title.evaluate(el => getComputedStyle(el).textOverflow)).toBe('ellipsis')
|
||||
expect(await title.evaluate(el => el.scrollLeft)).toBe(0)
|
||||
expect(await travelled()).toBe(0)
|
||||
const restingTop = await glyphTop()
|
||||
|
||||
// The stylesheet moves the text, so the page runs no frame callback per frame while it travels.
|
||||
await page.evaluate(() => {
|
||||
const request = window.requestAnimationFrame.bind(window)
|
||||
Reflect.set(window, 'marqueeFrames', 0)
|
||||
window.requestAnimationFrame = (callback) => {
|
||||
Reflect.set(window, 'marqueeFrames', Number(Reflect.get(window, 'marqueeFrames')) + 1)
|
||||
return request(callback)
|
||||
}
|
||||
})
|
||||
await row.hover()
|
||||
// The marquee crawls instead of jumping: the title is caught mid-travel,
|
||||
// strictly between its start and its far edge, with both cut edges
|
||||
// publishing their fade-mask hooks.
|
||||
await expect.poll(
|
||||
async () => title.evaluate(el => el.scrollLeft > 0),
|
||||
{ timeout: 5_000 },
|
||||
).toBe(true)
|
||||
expect(await title.evaluate(el => el.scrollLeft < el.scrollWidth - el.clientWidth - 1)).toBe(true)
|
||||
expect(await title.evaluate(el => el.hasAttribute('data-scrolled'))).toBe(true)
|
||||
expect(await title.evaluate(el => el.hasAttribute('data-clipped'))).toBe(true)
|
||||
expect(await title.evaluate(el => getComputedStyle(el).maskImage)).toContain('linear-gradient')
|
||||
// The crawl still reaches the far edge of the hovered cell (the wider
|
||||
// The marquee travels instead of jumping: the title is caught mid-travel,
|
||||
// strictly between its start and its far edge, with both cut edges faded.
|
||||
await expect.poll(async () => await travelled() > 0, { timeout: 5_000 }).toBe(true)
|
||||
expect(await travelled()).toBeLessThan(await range() - 1)
|
||||
expect(await title.evaluate(el => el.hasAttribute('data-marquee'))).toBe(true)
|
||||
expect(await title.evaluate(el => getComputedStyle(el).maskImage)).toContain('calc(100% - 12px)')
|
||||
expect(Math.abs(await glyphTop() - restingTop)).toBeLessThan(0.5)
|
||||
// Constant 30px/s: one second of travel covers about 30px.
|
||||
const before = await travelled()
|
||||
const started = Date.now()
|
||||
await page.waitForTimeout(1_000)
|
||||
const speed = (await travelled() - before) / ((Date.now() - started) / 1_000)
|
||||
expect(speed).toBeGreaterThan(24)
|
||||
expect(speed).toBeLessThan(36)
|
||||
// The travel still reaches the far edge of the hovered cell (the wider
|
||||
// one — the relative-time label yields to the row menu) and rests there,
|
||||
// lifting the right fade so the final character reads at full strength.
|
||||
// The fade lifts on the frame that lands exactly on the far edge, one or
|
||||
// two frames after scrollLeft first rounds within a pixel of it.
|
||||
// lifting the end fade so the final character reads at full strength.
|
||||
await expect.poll(async () => await travelled() >= await range() - 1, { timeout: 20_000 }).toBe(true)
|
||||
await expect.poll(
|
||||
async () => title.evaluate(el => el.scrollLeft >= el.scrollWidth - el.clientWidth - 1),
|
||||
{ timeout: 20_000 },
|
||||
).toBe(true)
|
||||
await expect.poll(
|
||||
async () => title.evaluate(el => el.hasAttribute('data-clipped')),
|
||||
async () => title.evaluate(el => getComputedStyle(el).maskImage.includes('calc(100% - 12px)')),
|
||||
{ timeout: 5_000 },
|
||||
).toBe(false)
|
||||
expect(await title.evaluate(el => getComputedStyle(el).maskImage)).toContain('linear-gradient')
|
||||
// At its extent, the title must not paint the ellipsis over the
|
||||
// characters the marquee reached.
|
||||
expect(await title.evaluate(el => getComputedStyle(el).textOverflow)).toBe('clip')
|
||||
// A frame script would have run once per frame for the whole travel; other parts of the page may ask for a frame or two.
|
||||
expect(await page.evaluate(() => Number(Reflect.get(window, 'marqueeFrames')))).toBeLessThan(10)
|
||||
|
||||
// Leaving returns in one step: a crawl back would still be travelling
|
||||
// Leaving returns in one step: a travel back would still be under way
|
||||
// inside this window, and it would carry the resting ellipsis with it.
|
||||
await page.mouse.move(0, 0)
|
||||
await expect.poll(
|
||||
async () => title.evaluate(el => el.scrollLeft),
|
||||
{ timeout: 150, interval: 20 },
|
||||
).toBe(0)
|
||||
expect(await title.evaluate(el => el.hasAttribute('data-scrolled'))).toBe(false)
|
||||
await expect.poll(travelled, { timeout: 150, interval: 20 }).toBe(0)
|
||||
expect(await title.evaluate(el => el.hasAttribute('data-marquee'))).toBe(false)
|
||||
expect(await title.evaluate(el => getComputedStyle(el).textOverflow)).toBe('ellipsis')
|
||||
|
||||
// Reduced motion reaches the handler's matchMedia probe: the reveal jumps
|
||||
// to the far edge instead of crawling.
|
||||
// Reduced motion shows the far edge at once instead of travelling to it.
|
||||
await page.emulateMedia({ reducedMotion: 'reduce' })
|
||||
await row.hover()
|
||||
await expect.poll(
|
||||
async () => title.evaluate(el => el.scrollLeft >= el.scrollWidth - el.clientWidth - 1),
|
||||
{ timeout: 500, interval: 20 },
|
||||
).toBe(true)
|
||||
await expect.poll(async () => await travelled() >= await range() - 1, { timeout: 500, interval: 20 }).toBe(true)
|
||||
await page.mouse.move(0, 0)
|
||||
await page.emulateMedia({ reducedMotion: null })
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
- dialog "Subagent sessions":
|
||||
- heading "Subagents" [level=3]
|
||||
- text: 1 external
|
||||
- tree "Subagent sessions":
|
||||
- 'treeitem "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. team-panel-researcher · External task" [disabled] [level=1]': "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. team-panel-researcher"
|
||||
- region "Task board":
|
||||
- heading "Shared tasks 1 completed · 1 in progress · 2 pending" [level=3]
|
||||
- list:
|
||||
- listitem:
|
||||
- button "In progress Agent task":
|
||||
- img "In progress"
|
||||
- text: Agent task
|
||||
- listitem:
|
||||
- button "Completed Completed preparation":
|
||||
- img "Completed"
|
||||
- text: Completed preparation
|
||||
- listitem:
|
||||
- button "Pending Dependency task":
|
||||
- img "Pending"
|
||||
- text: Dependency task
|
||||
- listitem:
|
||||
- button "Blocked by dependencies Responsive task with a long title that remains fully readable when expanded at the minimum supported viewport" [expanded]:
|
||||
- img "Blocked by dependencies"
|
||||
- text: Responsive task with a long title that remains fully readable when expanded at the minimum supported viewport
|
||||
- paragraph: Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work.
|
||||
- paragraph: "Owner: Unowned"
|
||||
- region "Shared tasks":
|
||||
- heading "Shared tasks" [level=2]
|
||||
- text: 1 completed · 1 in progress · 2 pending
|
||||
- list:
|
||||
- listitem:
|
||||
- button "In progress Agent task":
|
||||
- img "In progress"
|
||||
- text: Agent task
|
||||
- listitem:
|
||||
- button "Pending Dependency task":
|
||||
- img "Pending"
|
||||
- text: Dependency task
|
||||
- listitem:
|
||||
- button "Blocked by dependencies Responsive task with a long title that remains fully readable when expanded at the minimum supported viewport" [expanded]:
|
||||
- img "Blocked by dependencies"
|
||||
- text: Responsive task with a long title that remains fully readable when expanded at the minimum supported viewport
|
||||
- paragraph: Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work. Check every dependency and write scope before you start work.
|
||||
- paragraph: "Owner: Unowned"
|
||||
- listitem:
|
||||
- button "Completed Completed preparation":
|
||||
- img "Completed"
|
||||
- text: Completed preparation
|
||||
@@ -1,11 +1,8 @@
|
||||
- dialog "Subagent sessions":
|
||||
- heading "Subagents" [level=3]
|
||||
- paragraph: No subagents
|
||||
- tree "Subagent sessions"
|
||||
- region "Task board":
|
||||
- heading "Shared tasks 1 pending" [level=3]
|
||||
- list:
|
||||
- listitem:
|
||||
- button "Pending Plan before delegation":
|
||||
- img "Pending"
|
||||
- text: Plan before delegation
|
||||
- region "Shared tasks":
|
||||
- heading "Shared tasks" [level=2]
|
||||
- text: 1 pending
|
||||
- list:
|
||||
- listitem:
|
||||
- button "Pending Plan before delegation":
|
||||
- img "Pending"
|
||||
- text: Plan before delegation
|
||||
@@ -1,10 +1,15 @@
|
||||
- dialog "Subagent sessions":
|
||||
- heading "Subagents" [level=3]
|
||||
- text: 1 external
|
||||
- tree "Subagent sessions":
|
||||
- 'treeitem "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. team-panel-researcher · External task" [disabled] [level=1]': "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. team-panel-researcher"
|
||||
- region "Task board":
|
||||
- heading "Shared tasks 1 in progress" [level=3]
|
||||
- complementary "Session panel":
|
||||
- region "Environment":
|
||||
- heading "Environment" [level=2]
|
||||
- text: workspace {{cwd}}
|
||||
- region "Subagents":
|
||||
- heading "Subagents" [level=2]
|
||||
- text: 1 external
|
||||
- tree "Subagent sessions":
|
||||
- 'treeitem "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. team-panel-researcher · External task" [disabled] [level=1]': "Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result. Researcher: investigate the construction and verify every bound before reporting the result."
|
||||
- region "Shared tasks":
|
||||
- heading "Shared tasks" [level=2]
|
||||
- text: 1 in progress
|
||||
- list:
|
||||
- listitem:
|
||||
- button "In progress Agent task" [expanded]:
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
- list "Background jobs":
|
||||
- listitem:
|
||||
- button "Finished 1" [expanded]
|
||||
- button "Clear"
|
||||
- listitem:
|
||||
- button "Hide live output of printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done" [expanded]: "bash printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done signal: SIGTERM; web e2e cancellation {{duration}}"
|
||||
- text: $ printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done
|
||||
- button "Copy"
|
||||
- text: streamed-marker-line
|
||||
- region "Background jobs":
|
||||
- heading "Background jobs" [level=2]
|
||||
- list:
|
||||
- listitem:
|
||||
- button "Finished 1" [expanded]
|
||||
- button "Clear"
|
||||
- listitem:
|
||||
- button "Hide live output of printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done" [expanded]: "printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done bash · signal: SIGTERM; web e2e cancellation {{duration}}"
|
||||
- text: $ printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done
|
||||
- button "Copy"
|
||||
- text: streamed-marker-line
|
||||
@@ -1,7 +1,9 @@
|
||||
- list "Background jobs":
|
||||
- listitem:
|
||||
- button "Hide live output of printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done" [expanded]: printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done bash {{duration}}
|
||||
- button "Stop task printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done"
|
||||
- text: $ printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done
|
||||
- button "Copy"
|
||||
- text: streamed-marker-line
|
||||
- region "Background jobs":
|
||||
- heading "Background jobs" [level=2]
|
||||
- list:
|
||||
- listitem:
|
||||
- button "Hide live output of printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done" [expanded]: printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done bash · running {{duration}}
|
||||
- button "Stop task printf 'streamed-%s\\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done"
|
||||
- text: $ printf 'streamed-%s\n' marker-line; for _ in $(seq 1 3000); do [ -e .live-job-stream.release ] && break; sleep 0.2; done
|
||||
- button "Copy"
|
||||
- text: streamed-marker-line
|
||||
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { zstdCompressSync } from 'node:zlib'
|
||||
import type { Browser, Page } from 'playwright'
|
||||
import type { Browser, Locator, Page, Response } from 'playwright'
|
||||
import { chromium } from 'playwright'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished, vi } from 'vitest'
|
||||
import { prepareSessionSnapshotFixtureForComparison } from '@deepseek-ai/dsh-llm-replay'
|
||||
@@ -20,7 +20,10 @@ import {
|
||||
launchWebScaffold, readPersistedEvents, realizeSeedFixture, seedSession, selectedSessionFixture, watchConsole,
|
||||
webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, pinBrowserClock, pinHostClock, saveFailureShot, writeComposerDraft } from './support.ts'
|
||||
import {
|
||||
connectFreshWorkspace, dismissSessionPanel, foldControlLayout, newEnglishPage, pinBrowserClock, pinHostClock, saveFailureShot,
|
||||
sessionPanelToggle, showSessionPanel, writeComposerDraft,
|
||||
} from './support.ts'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
|
||||
const BASE_FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
|
||||
@@ -39,6 +42,7 @@ const MIGRATING_CHILD_EXPECTED = fileURLToPath(new URL(
|
||||
'./expected/subagent-conversation/migration-required-child.expected.md', import.meta.url,
|
||||
))
|
||||
const MODE = webSnapshotMode()
|
||||
const SUBAGENTS_SECTION = '[data-session-panel-section="subagents"]'
|
||||
const LABEL = 'event-sourcing researcher'
|
||||
/** The live child's catalog name; it is the parent's first named child. */
|
||||
const CHILD_NAME = 'agent-1'
|
||||
@@ -80,6 +84,24 @@ function childFixture(source: string, fixtureId: string, withContinuation: boole
|
||||
return [childHeader, ...eventLines, ...continued, ''].join('\n')
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Session panel and return its Subagents section.
|
||||
* @param page - the page under test.
|
||||
* @returns the section.
|
||||
*/
|
||||
async function showSubagentsSection(page: Page): Promise<Locator> {
|
||||
return (await showSessionPanel(page)).locator(SUBAGENTS_SECTION)
|
||||
}
|
||||
|
||||
/** Whether a response answers the projection read of one Session. */
|
||||
function projectionReadOf(sessionId: SessionId): (response: Response) => boolean {
|
||||
return (response) => {
|
||||
if (!response.url().endsWith('/api/session/projections')) return false
|
||||
const body = response.request().postDataJSON() as { payload: { args: { request: { sessionId: SessionId } } } }
|
||||
return body.payload.args.request.sessionId === sessionId
|
||||
}
|
||||
}
|
||||
|
||||
async function waitForAgentToSettle(scaffold: WebScaffold, id: SessionId): Promise<void> {
|
||||
const deadline = Date.now() + 30_000
|
||||
while (scaffold.ctx.agents.get(id) !== undefined) {
|
||||
@@ -222,7 +244,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await oneShotHandle.close()
|
||||
scaffold.ctx.sessionProjectionCache.coldSnapshot(oneShotHeader, SessionLogOffset(0), oneShotEvents)
|
||||
await waitForCacheRow(scaffold, oneShotHeader)
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).waitFor({ timeout: 15_000 })
|
||||
const pushedSection = await showSubagentsSection(page)
|
||||
await pushedSection.getByRole('treeitem', { name: new RegExp(LABEL) }).waitFor({ timeout: 15_000 })
|
||||
const catalogReads = apiCalls.filter(path => path === '/api/session/projections').length
|
||||
parent.session.append('subagent/catalog', {
|
||||
version: 0,
|
||||
@@ -231,10 +254,12 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
mode: 'one-shot',
|
||||
label: ONE_SHOT_LABEL,
|
||||
})
|
||||
const pushedCount = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await pushedCount.waitFor({ timeout: 15_000 })
|
||||
await pushedSection.getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) }).waitFor({ timeout: 15_000 })
|
||||
await pushedSection.getByText('1 completed\u2002·\u20021 not running', { exact: true }).waitFor({ timeout: 15_000 })
|
||||
expect(apiCalls.filter(path => path === '/api/session/projections')).toHaveLength(catalogReads)
|
||||
await compareOrRefreshGolden(CATALOG_PUSH_EXPECTED, await pushedCount.ariaSnapshot(), MODE)
|
||||
await compareOrRefreshGolden(CATALOG_PUSH_EXPECTED,
|
||||
await pushedSection.getByRole('heading', { level: 2 }).locator('..').ariaSnapshot(), MODE)
|
||||
await dismissSessionPanel(page)
|
||||
grandchildId = brandString<sessionId>('recorded-grandchild')
|
||||
const authoredAt = Date.now()
|
||||
const grandchildHeader: SessionHeader = {
|
||||
@@ -343,13 +368,9 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
const warningStart = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
|
||||
const catalogButton = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await catalogButton.waitFor({ timeout: 15_000 })
|
||||
await catalogButton.hover()
|
||||
const catalogTree = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const catalogTree = (await showSubagentsSection(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
await catalogTree.getByRole('treeitem').nth(1).waitFor({ timeout: 15_000 })
|
||||
await catalogTree.press('Escape')
|
||||
await page.getByRole('button', { name: '2 subagents' }).waitFor({ timeout: 15_000 })
|
||||
await dismissSessionPanel(page)
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
}, 120_000)
|
||||
|
||||
@@ -366,58 +387,59 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
if (failures.length > 1) throw new AggregateError(failures, 'subagent Web teardown failed')
|
||||
})
|
||||
|
||||
it('retries a failed cold catalog and discovers descendants without reopening the menu', async () => {
|
||||
it('retries a failed cold catalog and discovers descendants through the breadcrumb switcher', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-unread-catalog'))
|
||||
const reads = apiCalls.filter(path => path === '/api/session/projections').length
|
||||
const observe = vi.spyOn(scaffold.ctx.sessionQuery, 'observeSession')
|
||||
// The Session panel reads nothing when it shows; the child's switcher is the explicit activation of the parent's level.
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
const trigger = hierarchy.getByRole('button', { name: `Switch subagent: ${LABEL}`, exact: true })
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
await trigger.waitFor()
|
||||
// A reload forgets every catalog read while the child conversation stays open.
|
||||
const warningStart = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await trigger.waitFor({ timeout: 30_000 })
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
const projections = vi.spyOn(scaffold.ctx.sessionController, 'projections')
|
||||
const menu = page.locator('[data-subagent-panel]')
|
||||
const tree = menu.getByRole('tree', { name: 'Subagent sessions' })
|
||||
try {
|
||||
const trigger = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
const childUrl = page.url()
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
const reads = apiCalls.filter(path => path === '/api/session/projections').length
|
||||
await trigger.hover()
|
||||
const tree = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const child = tree.getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
await child.waitFor()
|
||||
expect(await child.getAttribute('aria-expanded')).toBeNull()
|
||||
expect(await tree.getByRole('button', { name: /^(Expand|Collapse) /u }).count()).toBe(0)
|
||||
expect(await tree.getByText(/Loading subagents|unknown/u).count()).toBe(0)
|
||||
await tree.getByRole('treeitem', { name: new RegExp(LABEL) }).waitFor()
|
||||
// The open child's own conversation supplies its catalog; its sibling's stays unread until activation.
|
||||
expect(await tree.getByRole('button', { name: `Expand ${ONE_SHOT_LABEL} descendants`, exact: true }).count()).toBe(0)
|
||||
expect(apiCalls.filter(path => path === '/api/session/projections')).toHaveLength(reads)
|
||||
expect(observe).not.toHaveBeenCalled()
|
||||
const parentUrl = page.url()
|
||||
await page.route('**/api/session/projections', route => route.abort('failed'), { times: 1 })
|
||||
await trigger.click()
|
||||
const retry = tree.getByRole('button', { name: 'Retry', exact: true })
|
||||
await retry.waitFor()
|
||||
expect(await tree.getByRole('button', { name: /^(Expand|Collapse) /u }).count()).toBe(0)
|
||||
expect(apiCalls.filter(path => path === '/api/session/projections')).toHaveLength(reads + 1)
|
||||
expect(projections).not.toHaveBeenCalled()
|
||||
const siblingsRead = page.waitForResponse(projectionReadOf(oneShotId))
|
||||
await retry.click()
|
||||
await (await siblingsRead).finished()
|
||||
await retry.waitFor({ state: 'detached' })
|
||||
const expand = page.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true })
|
||||
const expand = tree.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true })
|
||||
await expand.waitFor()
|
||||
await expect.poll(() => projections.mock.calls.map(([request]) => request.sessionId)).toEqual([parentId, childId, oneShotId])
|
||||
expect(observe.mock.calls.some(([id]) => id === grandchildId)).toBe(false)
|
||||
const lastRead = page.waitForResponse('**/api/session/projections')
|
||||
expect(projections.mock.calls.map(([request]) => request.sessionId)).toEqual(expect.arrayContaining([parentId, oneShotId]))
|
||||
expect(projections.mock.calls.some(([request]) => request.sessionId === grandchildId)).toBe(false)
|
||||
const descendantsRead = page.waitForResponse(projectionReadOf(grandchildId))
|
||||
await expand.click()
|
||||
await (await lastRead).finished()
|
||||
await expect.poll(() => projections.mock.calls.map(([request]) => request.sessionId))
|
||||
.toEqual([parentId, childId, oneShotId, grandchildId])
|
||||
await (await descendantsRead).finished()
|
||||
const grandchild = tree.getByRole('treeitem', { name: new RegExp(NESTED_LABEL) })
|
||||
await grandchild.waitFor()
|
||||
expect(await grandchild.getAttribute('aria-expanded')).toBeNull()
|
||||
await compareOrRefreshGolden(
|
||||
TREE_EXPECTED,
|
||||
await captureStableAria(page, '[role="tree"][aria-label="Subagent sessions"]', scaffold.workspaceCwd), MODE,
|
||||
)
|
||||
expect(page.url()).toBe(parentUrl)
|
||||
expect(page.url()).toBe(childUrl)
|
||||
expect(scaffold.ctx.agents.get(childId)).toBeUndefined()
|
||||
expect(scaffold.ctx.agents.get(grandchildId)).toBeUndefined()
|
||||
await page.keyboard.press('Escape')
|
||||
await page.locator('[data-subagent-panel]').waitFor({ state: 'detached' })
|
||||
await menu.waitFor({ state: 'detached' })
|
||||
} finally {
|
||||
await page.unroute('**/api/session/projections')
|
||||
observe.mockRestore()
|
||||
projections.mockRestore()
|
||||
await hierarchy.getByRole('button').first().click()
|
||||
await trigger.waitFor({ state: 'detached' })
|
||||
}
|
||||
})
|
||||
|
||||
@@ -435,9 +457,11 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await writeComposerDraft(page, input, '')
|
||||
})
|
||||
|
||||
it('enters the member tree after pointer or keyboard activation of its trigger', async () => {
|
||||
it('enters the sibling tree after pointer or keyboard activation of the breadcrumb switcher', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-trigger-focus'))
|
||||
const trigger = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
const trigger = hierarchy.getByRole('button', { name: `Switch subagent: ${LABEL}`, exact: true })
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
try {
|
||||
for (const activation of ['click', 'Enter', 'Space']) {
|
||||
@@ -453,83 +477,86 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
}
|
||||
} finally {
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
await hierarchy.getByRole('button').first().click()
|
||||
await trigger.waitFor({ state: 'detached' })
|
||||
}
|
||||
})
|
||||
|
||||
it('shows complete descriptions and names without hover at desktop and touch widths', async () => {
|
||||
it('shows each subagent on one line and its name, state, and measures in a hover card', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-catalog-labels'))
|
||||
const originalViewport = page.viewportSize()!
|
||||
const originalUrl = page.url()
|
||||
try {
|
||||
for (const width of [originalViewport.width, 390]) {
|
||||
await page.setViewportSize({ ...originalViewport, width })
|
||||
const trigger = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await trigger.click()
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
const row = panel.getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
const primary = row.getByText(LABEL, { exact: true })
|
||||
const secondary = row.getByText(CHILD_NAME, { exact: true })
|
||||
const primaryBounds = await primary.boundingBox()
|
||||
const secondaryBounds = await secondary.boundingBox()
|
||||
expect(primaryBounds).not.toBeNull()
|
||||
expect(secondaryBounds).not.toBeNull()
|
||||
expect(primaryBounds!.y + primaryBounds!.height).toBeLessThanOrEqual(secondaryBounds!.y)
|
||||
for (const label of [primary, secondary]) {
|
||||
expect(await label.evaluate(element => element.scrollWidth <= element.clientWidth
|
||||
&& element.scrollHeight <= element.clientHeight)).toBe(true)
|
||||
}
|
||||
expect(await row.getAttribute('aria-label')).toContain(`${LABEL} ${CHILD_NAME} `)
|
||||
expect(await row.getByRole('button', { name: /description/u }).count()).toBe(0)
|
||||
await row.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true }).waitFor()
|
||||
expect(await row.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).count()).toBe(1)
|
||||
expect(page.url()).toBe(originalUrl)
|
||||
expect(await page.getByRole('tooltip').count()).toBe(0)
|
||||
expect(scaffold.ctx.agents.get(childId)).toBeUndefined()
|
||||
await page.keyboard.press('Escape')
|
||||
await panel.waitFor({ state: 'detached' })
|
||||
}
|
||||
const panel = await showSubagentsSection(page)
|
||||
const row = panel.getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
const primary = row.getByText(LABEL, { exact: true })
|
||||
// The row holds one 28px line; the name stays in its accessible name.
|
||||
expect(await row.evaluate(element => element.getBoundingClientRect().height)).toBe(28)
|
||||
expect(await primary.evaluate(element => getComputedStyle(element).whiteSpace)).toBe('nowrap')
|
||||
expect(await row.getByText(CHILD_NAME, { exact: true }).count()).toBe(0)
|
||||
expect(await row.getAttribute('aria-label')).toContain(`${LABEL} ${CHILD_NAME} `)
|
||||
expect(await row.getByRole('button', { name: /description/u }).count()).toBe(0)
|
||||
await row.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true }).waitFor()
|
||||
expect(await row.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).count()).toBe(1)
|
||||
await primary.hover()
|
||||
const card = page.locator('[data-session-panel-details]')
|
||||
await card.waitFor()
|
||||
expect(await card.evaluate(element => [...element.children].map(child => child.textContent).slice(0, 3)))
|
||||
.toEqual([LABEL, `Owner: ${CHILD_NAME}`, 'completed · continuable'])
|
||||
// The panel sits at the window's end, so the stylesheet opens the card on the row's start side:
|
||||
// 8px before the row, its top on the row's top, inside the viewport.
|
||||
const placement = await card.evaluate((element) => {
|
||||
// The details sit inside the fixed card, and the card's anchor wraps the row.
|
||||
let fixed = element
|
||||
while (getComputedStyle(fixed).position !== 'fixed') fixed = fixed.parentElement!
|
||||
const bounds = fixed.getBoundingClientRect()
|
||||
const row = document.querySelector('[data-subagents-section] [role="treeitem"]')!.parentElement!.getBoundingClientRect()
|
||||
return { inside: bounds.left >= 8, gap: row.left - bounds.right, top: bounds.top - row.top }
|
||||
})
|
||||
expect(placement).toEqual({ inside: true, gap: 8, top: 0 })
|
||||
expect(page.url()).toBe(originalUrl)
|
||||
expect(scaffold.ctx.agents.get(childId)).toBeUndefined()
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
await card.waitFor({ state: 'detached' })
|
||||
await dismissSessionPanel(page)
|
||||
} finally {
|
||||
await page.setViewportSize(originalViewport)
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
}
|
||||
})
|
||||
|
||||
it('expands locally available cold catalogs without requesting or activating either level', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'screenshots/non-migrating-session-reads/web-e2e-subagent-tree'))
|
||||
// From a fresh page, the child's switcher prepares the parent's level and the child's; back in the parent, the
|
||||
// panel expands both from the catalogs those reads left, requesting nothing more.
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
const trigger = hierarchy.getByRole('button', { name: `Switch subagent: ${LABEL}`, exact: true })
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
await trigger.waitFor()
|
||||
const warningStart = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
const trigger = page.getByRole('button', { name: '2 subagents', exact: true })
|
||||
await trigger.waitFor()
|
||||
await trigger.waitFor({ timeout: 30_000 })
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
const siblingsRead = page.waitForResponse((response) => {
|
||||
if (!response.url().endsWith('/api/session/projections')) return false
|
||||
const body = response.request().postDataJSON() as { payload: { args: { request: { sessionId: SessionId } } } }
|
||||
return body.payload.args.request.sessionId === oneShotId
|
||||
})
|
||||
const siblingsRead = page.waitForResponse(projectionReadOf(oneShotId))
|
||||
await trigger.click()
|
||||
await (await siblingsRead).finished()
|
||||
const expand = page.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true })
|
||||
const menu = page.locator('[data-subagent-panel]')
|
||||
const expand = menu.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true })
|
||||
await expand.waitFor()
|
||||
const descendantsRead = page.waitForResponse((response) => {
|
||||
if (!response.url().endsWith('/api/session/projections')) return false
|
||||
const body = response.request().postDataJSON() as { payload: { args: { request: { sessionId: SessionId } } } }
|
||||
return body.payload.args.request.sessionId === grandchildId
|
||||
})
|
||||
const descendantsRead = page.waitForResponse(projectionReadOf(grandchildId))
|
||||
await expand.click()
|
||||
await (await descendantsRead).finished()
|
||||
await page.keyboard.press('Escape')
|
||||
await page.locator('[data-subagent-panel]').waitFor({ state: 'detached' })
|
||||
const catalogReads = apiCalls.filter(path => path === '/api/session/projections').length
|
||||
await menu.waitFor({ state: 'detached' })
|
||||
await hierarchy.getByRole('button').first().click()
|
||||
await trigger.waitFor({ state: 'detached' })
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
await trigger.hover()
|
||||
const catalogTree = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const catalogTree = (await showSubagentsSection(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
await catalogTree.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true }).waitFor()
|
||||
const catalogReads = apiCalls.filter(path => path === '/api/session/projections').length
|
||||
expect(await catalogTree.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect()
|
||||
const hit = document.elementFromPoint(rect.left + 8, rect.top + 8)
|
||||
return hit !== null && element.contains(hit)
|
||||
})).toBe(true)
|
||||
const sectionHeader = page.locator('[data-subagent-section-header]')
|
||||
expect(await sectionHeader.count()).toBe(0)
|
||||
const oneShotDisclosure = page.getByRole('button', {
|
||||
name: `Expand ${ONE_SHOT_LABEL} descendants`,
|
||||
})
|
||||
@@ -592,7 +619,6 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
expect(await catalogTree.getByText('Loading subagents…', { exact: true }).count()).toBe(0)
|
||||
expect(await grandchildRow.getAttribute('aria-expanded')).toBeNull()
|
||||
expect(await grandchildRow.getByRole('button', { name: `Expand ${NESTED_LABEL} descendants` }).count()).toBe(0)
|
||||
expect(await sectionHeader.count()).toBe(0)
|
||||
await clickDisclosureGutter(26)
|
||||
await page.getByRole('treeitem', { name: new RegExp(NESTED_LABEL) }).waitFor({ state: 'detached' })
|
||||
expect(await childRow.getAttribute('aria-expanded')).toBe('false')
|
||||
@@ -605,7 +631,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
const dotBounds = dot.getBoundingClientRect()
|
||||
const slot = dot.parentElement!.getBoundingClientRect()
|
||||
const horizontal = getComputedStyle(row, '::before')
|
||||
const node = row.parentElement!
|
||||
// The row sits in its hover card's anchor wrapper inside the tree node.
|
||||
const node = row.closest('[role="group"] > *')!
|
||||
const spine = getComputedStyle(node, '::before')
|
||||
const stroke = Number.parseFloat(horizontal.borderTopWidth)
|
||||
const colorProbe = document.createElement('span')
|
||||
@@ -652,20 +679,19 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
)
|
||||
await compareOrRefreshGolden(TREE_EXPECTED, snapshot, MODE)
|
||||
expect(apiCalls.filter(path => path === '/api/session/projections')).toHaveLength(catalogReads)
|
||||
await page.getByRole('treeitem', { name: new RegExp(NESTED_LABEL) }).getByText(grandchildId, { exact: true }).click()
|
||||
await page.getByRole('treeitem', { name: new RegExp(NESTED_LABEL) }).getByText(NESTED_LABEL, { exact: true }).click()
|
||||
await page.getByText(NESTED_PROMPT).waitFor()
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
await hierarchy.getByRole('button', { name: `Switch subagent: ${LABEL}`, exact: true }).waitFor()
|
||||
expect(scaffold.ctx.agents.get(childId)).toBeUndefined()
|
||||
expect(scaffold.ctx.agents.get(grandchildId)).toBeUndefined()
|
||||
await hierarchy.getByRole('button').first().click()
|
||||
await page.getByRole('button', { name: '2 subagents', exact: true }).waitFor()
|
||||
await hierarchy.getByRole('button', { name: /^Switch subagent:/u }).waitFor({ state: 'detached' })
|
||||
})
|
||||
|
||||
it('opens child history in the right Sidebar and releases it when closed', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-sidebar-chat'))
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
|
||||
const sidebarChat = page.locator('[data-sidebar-chat]')
|
||||
await sidebarChat.getByText(/^Explain event sourcing in one sentence\./).waitFor({ timeout: 15_000 })
|
||||
await compareOrRefreshGolden(
|
||||
@@ -676,8 +702,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await page.locator('[data-sidebar-right-panel] [data-dockkit-tab-close]').click()
|
||||
await sidebarChat.waitFor({ state: 'detached' })
|
||||
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) }).getByRole('button', { name: `Open ${ONE_SHOT_LABEL} in sidebar`, exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) })
|
||||
.getByRole('button', { name: `Open ${ONE_SHOT_LABEL} in sidebar`, exact: true }).click()
|
||||
await page.locator('[data-sidebar-chat]').getByText(
|
||||
'One-shot tasks do not accept follow-ups; review the full execution record here.',
|
||||
).waitFor({ timeout: 15_000 })
|
||||
@@ -687,8 +713,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
|
||||
it('opens the completed child from persistence without activating it', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-open'))
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
await expect.poll(
|
||||
() => page.getByText(/^Explain event sourcing in one sentence\./).count(),
|
||||
{ timeout: 15_000 },
|
||||
@@ -714,8 +739,12 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
.toEqual([{ fontSize: '14px', lineHeight: '20px' }, { fontSize: '14px', lineHeight: '20px' }])
|
||||
expect(Math.abs(crumbGeometry[0]!.top - crumbGeometry[1]!.top), JSON.stringify(crumbGeometry)).toBeLessThanOrEqual(1)
|
||||
expect(Math.abs(crumbGeometry[0]!.bottom - crumbGeometry[1]!.bottom), JSON.stringify(crumbGeometry)).toBeLessThanOrEqual(1)
|
||||
expect(await hierarchy.getByRole('button', { name: '1 subagent', exact: true })
|
||||
.evaluate(element => getComputedStyle(element).fontSize)).toBe('12px')
|
||||
// The breadcrumb holds only the two titles; the child's own subagents are listed by its Session panel.
|
||||
expect(await hierarchy.getByRole('button').count()).toBe(2)
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(NESTED_LABEL) }).waitFor()
|
||||
await dismissSessionPanel(page)
|
||||
// Park the pointer off the toggle so its tooltip stays out of later captures.
|
||||
await page.locator('[data-composer-input]').first().hover()
|
||||
const sidebar = await captureStableAria(
|
||||
page,
|
||||
'[role="tree"][aria-label="Sessions"]',
|
||||
@@ -801,8 +830,7 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
|
||||
it('opens a persisted grandchild with input enabled while its creator is offline', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-grandchild'))
|
||||
await page.getByRole('button', { name: '1 subagent' }).hover()
|
||||
const tree = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const tree = (await showSubagentsSection(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
const nestedRow = tree.locator('[role="treeitem"]').filter({ hasText: NESTED_LABEL })
|
||||
await nestedRow.waitFor({ timeout: 15_000 })
|
||||
const nestedDisclosure = page.getByRole('button', {
|
||||
@@ -811,23 +839,23 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
expect(await nestedDisclosure.count()).toBe(0)
|
||||
const clickArea = nestedRow.locator(':scope > div')
|
||||
expect(await clickArea.count()).toBe(1)
|
||||
const [menuBox, clickAreaBox] = await Promise.all([
|
||||
page.locator('[data-subagent-panel]').boundingBox(),
|
||||
const [panelBox, clickAreaBox] = await Promise.all([
|
||||
page.locator('[data-session-panel]').boundingBox(),
|
||||
clickArea.boundingBox(),
|
||||
])
|
||||
expect(menuBox).not.toBeNull()
|
||||
expect(panelBox).not.toBeNull()
|
||||
expect(clickAreaBox).not.toBeNull()
|
||||
expect([
|
||||
Math.round(clickAreaBox!.x - menuBox!.x),
|
||||
Math.round(menuBox!.x + menuBox!.width - clickAreaBox!.x - clickAreaBox!.width),
|
||||
// Menu padding plus the branchless row's one-pixel leading inset.
|
||||
]).toEqual([7, 6])
|
||||
Math.round(clickAreaBox!.x - panelBox!.x),
|
||||
Math.round(panelBox!.x + panelBox!.width - clickAreaBox!.x - clickAreaBox!.width),
|
||||
// The panel's padding on both sides: the row spans the section body.
|
||||
]).toEqual([8, 8])
|
||||
await compareOrRefreshGolden(
|
||||
BRANCHLESS_EXPECTED,
|
||||
await captureStableAria(page, '[role="tree"][aria-label="Subagent sessions"]', scaffold.workspaceCwd),
|
||||
MODE,
|
||||
)
|
||||
await nestedRow.getByText(grandchildId, { exact: true }).click()
|
||||
await nestedRow.getByText(NESTED_LABEL, { exact: true }).click()
|
||||
await page.getByText(NESTED_PROMPT).waitFor()
|
||||
expect(await page.getByRole('textbox', { name: 'Message or run a task, / commands, @ files or sessions' }).isEnabled()).toBe(true)
|
||||
const hierarchy = page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
@@ -847,8 +875,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
const parentSession = page.getByRole('tree', { name: 'Sessions' })
|
||||
.getByRole('treeitem', { name: /Ask a research subagent to/ })
|
||||
await parentSession.click()
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) }).getByText(oneShotId, { exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) })
|
||||
.getByText(ONE_SHOT_LABEL, { exact: true }).click()
|
||||
await page.getByText('One-shot tasks do not accept follow-ups; review the full execution record here.').waitFor()
|
||||
expect(scaffold.ctx.agents.get(oneShotId)).toBeUndefined()
|
||||
})
|
||||
@@ -858,8 +886,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await page.getByRole('tree', { name: 'Sessions' })
|
||||
.getByRole('treeitem', { name: /Ask a research subagent to/ })
|
||||
.click()
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(CHILD_NAME, { exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByText(LABEL, { exact: true }).click()
|
||||
await page.getByRole('textbox', { name: 'Message or run a task, / commands, @ files or sessions' }).waitFor()
|
||||
const forkResponse = page.waitForResponse(response =>
|
||||
new URL(response.url()).pathname === '/api/session/fork')
|
||||
@@ -887,8 +915,8 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-post-fork-followup'))
|
||||
const sessions = page.getByRole('tree', { name: 'Sessions' })
|
||||
await sessions.getByRole('treeitem', { name: /Ask a research subagent to/ }).click()
|
||||
await page.getByRole('button', { name: '2 subagents' }).hover()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(CHILD_NAME, { exact: true }).click()
|
||||
await (await showSubagentsSection(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByText(LABEL, { exact: true }).click()
|
||||
await page.locator('[data-composer-input][contenteditable="true"]').first().waitFor()
|
||||
expect(scaffold.ctx.agents.get(childId)).toBeUndefined()
|
||||
|
||||
@@ -904,8 +932,9 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await expect.poll(() => scaffold.ctx.agents.get(forkId)).not.toBeUndefined()
|
||||
|
||||
await sessions.getByRole('treeitem', { name: /Ask a research subagent to/ }).click()
|
||||
await page.getByRole('button', { name: '2 subagents' }).press('ArrowDown')
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(CHILD_NAME, { exact: true }).click()
|
||||
await sessionPanelToggle(page).press('Enter')
|
||||
await page.locator(SUBAGENTS_SECTION).getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
.getByText(LABEL, { exact: true }).click()
|
||||
const input = page.locator('[data-composer-input][contenteditable="true"]').first()
|
||||
await input.waitFor()
|
||||
const promptResponse = page.waitForResponse(response =>
|
||||
@@ -941,25 +970,24 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
})
|
||||
await page.getByRole('tree', { name: 'Sessions' })
|
||||
.getByRole('treeitem', { name: /Ask a research subagent to/ }).click()
|
||||
await page.getByRole('button', { name: '2 subagents', exact: true }).click()
|
||||
await page.locator('[data-team-panel]').getByText('Root-only shared task', { exact: true }).waitFor()
|
||||
const rootHeader = page.locator('[data-subagent-section-header]')
|
||||
const rootSection = await showSubagentsSection(page)
|
||||
await page.locator('[data-session-panel-section="shared-tasks"] [data-team-panel]')
|
||||
.getByText('Root-only shared task', { exact: true }).waitFor()
|
||||
const rootHeader = rootSection.getByRole('heading', { level: 2 }).locator('..')
|
||||
expect(await rootHeader.textContent()).toBe('Subagents1 completed\u2002·\u20021 not running')
|
||||
expect(await rootHeader.getByRole('button').count()).toBe(0)
|
||||
expect(await rootHeader.locator('[data-icon="dsw-icon-users-outline-regular"]').count()).toBe(1)
|
||||
const progress = await rootHeader.textContent()
|
||||
await page.getByRole('button', { name: `Expand ${LABEL} descendants`, exact: true }).click()
|
||||
await page.getByRole('treeitem', { name: new RegExp(NESTED_LABEL) }).waitFor()
|
||||
expect(await rootHeader.textContent()).toBe(progress)
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(CHILD_NAME, { exact: true }).click()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).getByText(LABEL, { exact: true }).click()
|
||||
const switcher = page.getByRole('button', { name: `Switch subagent: ${LABEL}`, exact: true })
|
||||
await switcher.click()
|
||||
const panel = page.locator('[data-subagent-panel]')
|
||||
await panel.getByRole('treeitem', { name: new RegExp(ONE_SHOT_LABEL) }).waitFor()
|
||||
expect(await panel.locator('[data-team-panel]').count()).toBe(0)
|
||||
expect(await panel.evaluate(element => element.getBoundingClientRect().width)).toBe(360)
|
||||
const header = panel.locator('[data-subagent-section-header]')
|
||||
expect(await header.count()).toBe(0)
|
||||
expect(await panel.getByRole('heading').count()).toBe(0)
|
||||
expect(await switcher.textContent()).toBe(LABEL)
|
||||
const currentRow = panel.getByRole('treeitem', { name: new RegExp(LABEL) })
|
||||
const currentCheck = currentRow.locator('[data-subagent-current]')
|
||||
@@ -978,7 +1006,54 @@ describe('web e2e: persisted subagent conversation and human continuation', () =
|
||||
await page.keyboard.press('Escape')
|
||||
})
|
||||
|
||||
|
||||
it('holds back the subagents past five behind the fold control and keeps the choice while the panel is hidden', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-subagent-fold'))
|
||||
const parent = scaffold.ctx.agents.get(parentId)
|
||||
if (parent === undefined) throw new Error('fold fixture requires the live parent')
|
||||
await page.getByRole('tree', { name: 'Sessions' })
|
||||
.getByRole('treeitem', { name: /Ask a research subagent to/ }).click()
|
||||
// Six catalog-only members, each created after every row so far: the Client holds no summary for them,
|
||||
// so they sort by when the parent created them, the latest first.
|
||||
const createdAfter = Date.now() + 60_000
|
||||
for (let index = 0; index < 6; index++) {
|
||||
parent.session.append('subagent/catalog', {
|
||||
version: 0,
|
||||
childId: brandString<sessionId>(`fold-member-${String(index)}`),
|
||||
childCreatedAt: createdAfter + index,
|
||||
mode: 'one-shot',
|
||||
label: `fold member ${String(index)}`,
|
||||
})
|
||||
}
|
||||
const section = await showSubagentsSection(page)
|
||||
const rows = section.getByRole('treeitem')
|
||||
const fold = section.locator('[data-session-panel-row="fold"]')
|
||||
const labels = async (): Promise<string[]> => (await rows.evaluateAll(items => items.map(item => item.getAttribute('aria-label') ?? '')))
|
||||
.map(label => /^fold member \d/.exec(label)?.[0] ?? 'earlier')
|
||||
// Eight members: the five created last show, the latest first, and the fold control holds back three.
|
||||
await expect.poll(labels, { timeout: 15_000 })
|
||||
.toEqual(['fold member 5', 'fold member 4', 'fold member 3', 'fold member 2', 'fold member 1'])
|
||||
expect(await fold.textContent()).toBe('Show 3 more')
|
||||
// The title counts every member, shown or held back.
|
||||
expect(await section.getByRole('heading', { level: 2 }).locator('..').textContent()).toBe('Subagents1 completed\u2002·\u20027 not running')
|
||||
// The control follows the tree, at the row height, with its chevron under the state marks and its text under the names.
|
||||
expect(await section.getByRole('tree').locator('[data-session-panel-row="fold"]').count()).toBe(0)
|
||||
expect(await foldControlLayout(fold, rows.first(), '[class*="content"] > span'))
|
||||
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
|
||||
await section.getByRole('button', { name: 'Show 3 more (subagents)', exact: true }).click()
|
||||
await expect.poll(labels).toEqual([
|
||||
'fold member 5', 'fold member 4', 'fold member 3', 'fold member 2', 'fold member 1', 'fold member 0', 'earlier', 'earlier',
|
||||
])
|
||||
const less = section.getByRole('button', { name: 'Show less (subagents)', exact: true })
|
||||
expect([await less.textContent(), await less.getAttribute('aria-expanded')]).toEqual(['Show less', 'true'])
|
||||
// The choice is the Session's: it holds while the panel is hidden.
|
||||
await dismissSessionPanel(page)
|
||||
await showSubagentsSection(page)
|
||||
await expect.poll(() => rows.count()).toBe(8)
|
||||
await less.click()
|
||||
await expect.poll(() => rows.count()).toBe(5)
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
await dismissSessionPanel(page)
|
||||
})
|
||||
})
|
||||
|
||||
describe('web e2e: migration-required subagent catalog', () => {
|
||||
@@ -1071,8 +1146,8 @@ describe('web e2e: migration-required subagent catalog', () => {
|
||||
const workspaceRow = page.getByRole('tree', { name: 'Sessions' }).getByRole('treeitem').first()
|
||||
await workspaceRow.click()
|
||||
await page.locator(`[data-row-key="session:${parentId}"]`).click()
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
|
||||
const tree = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
await showSessionPanel(page)
|
||||
const tree = page.locator(SUBAGENTS_SECTION).getByRole('tree', { name: 'Subagent sessions' })
|
||||
const childRow = tree.getByRole('treeitem', { name: new RegExp(childLabel) })
|
||||
await childRow.waitFor()
|
||||
await expect.poll(() => childRow.getByRole('button', { name: `Expand ${childLabel} descendants`, exact: true }).count()).toBe(0)
|
||||
@@ -1090,9 +1165,9 @@ describe('web e2e: migration-required subagent catalog', () => {
|
||||
expect(observe.mock.calls.some(([id]) => id === childId || id === grandchildId)).toBe(false)
|
||||
expect(projections).not.toHaveBeenCalled()
|
||||
|
||||
await childRow.getByText(childId, { exact: true }).click()
|
||||
await childRow.getByText(childLabel, { exact: true }).click()
|
||||
await page.getByRole('button', { name: `Switch subagent: ${childLabel}`, exact: true }).waitFor()
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
|
||||
await showSessionPanel(page)
|
||||
const grandchildRow = tree.getByRole('treeitem', { name: new RegExp(grandchildLabel) })
|
||||
await grandchildRow.waitFor()
|
||||
expect(await grandchildRow.textContent()).not.toContain('Migration required')
|
||||
|
||||
@@ -11,7 +11,7 @@ import { expect, it, onTestFailed } from 'vitest'
|
||||
import { parseSessionLog } from '@deepseek-ai/dsh-llm-replay'
|
||||
import type {} from '@deepseek-ai/dsh-subagent'
|
||||
import { launchWebScaffold, selectedSessionFixture, watchConsole } from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot, showSessionPanel } from './support.ts'
|
||||
|
||||
const DIR = fileURLToPath(new URL('../../../snapshots/web/subagent-fork-schedule', import.meta.url))
|
||||
const LABEL = 'Check child reminder refusal'
|
||||
@@ -50,8 +50,8 @@ it('places the inherited-history divider between the parent turn and the child p
|
||||
} finally {
|
||||
await activation.dispose()
|
||||
}
|
||||
await page.getByRole('button', { name: '1 subagent' }).click()
|
||||
await page.getByRole('tree', { name: 'Subagent sessions' }).getByRole('treeitem', { name: new RegExp(LABEL) }).click()
|
||||
const subagents = (await showSessionPanel(page)).locator('[data-session-panel-section="subagents"]')
|
||||
await subagents.getByRole('tree', { name: 'Subagent sessions' }).getByRole('treeitem', { name: new RegExp(LABEL) }).click()
|
||||
const divider = page.getByRole('separator', { name: 'Inherited history above' })
|
||||
await divider.waitFor({ timeout: 15_000 })
|
||||
expect(await divider.count()).toBe(1)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// Replay-binding note: only the PRIMARY script can hang, and scripts bind by
|
||||
// first-call order, so the child issues the composition's first model call
|
||||
// (claiming the overridden primary) and the parent's one UI prompt — needed
|
||||
// so the non-blank parent renders its header catalog — binds to a derived
|
||||
// so the non-blank parent lists its subagents in the Session panel — binds to a derived
|
||||
// child fixture afterwards.
|
||||
import { existsSync } from 'node:fs'
|
||||
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
acknowledgeReloadConnectionLoss, assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
|
||||
launchWebScaffold, readPersistedEvents, watchConsole, webSnapshotMode, type WebScaffold,
|
||||
} from './scaffold.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot } from './support.ts'
|
||||
import { connectFreshWorkspace, newEnglishPage, saveFailureShot, showSessionPanel } from './support.ts'
|
||||
|
||||
const BASE_FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
|
||||
|
||||
@@ -171,7 +171,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
|
||||
const warningStart = tripwire.warnings.length
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
|
||||
await page.getByRole('button', { name: /1 subagent/ }).waitFor({ timeout: 15_000 })
|
||||
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).waitFor({ timeout: 15_000 })
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
expect(scaffold.ctx.agents.get(childId)?.status).toBe('running')
|
||||
}, 120_000)
|
||||
@@ -209,8 +209,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
|
||||
await page.reload({ waitUntil: 'load' })
|
||||
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
await page.getByRole('button', { name: /1 subagent/ }).click()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter')
|
||||
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter')
|
||||
const input = page.locator('[data-composer-input]').first()
|
||||
await input.waitFor({ timeout: 15_000 })
|
||||
await page.getByText(/^Explain event sourcing in one sentence\./)
|
||||
@@ -269,8 +268,7 @@ describe.skipIf(MODE === 'record')('web e2e: composer interrupt for a running co
|
||||
acknowledgeReloadConnectionLoss(tripwire, warningStart)
|
||||
await page.getByRole('navigation', { name: 'Session hierarchy' })
|
||||
.getByRole('button').first().click()
|
||||
await page.getByRole('button', { name: /1 subagent/ }).click()
|
||||
await page.getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter')
|
||||
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) }).press('Enter')
|
||||
// A live continuable child advertises the ordinary steer-all gesture, so
|
||||
// that placeholder is the composer's accessible name in this window. It
|
||||
// changes back as the queue drains, so later interactions address the
|
||||
|
||||
@@ -480,6 +480,96 @@ export async function openSettings(page: Page, locale: 'en' | 'zh' | 'ja'): Prom
|
||||
await page.getByRole('menuitem', { name: labels[locale][1], exact: true }).click()
|
||||
}
|
||||
|
||||
/** The Session panel toggle in the Session header. */
|
||||
export function sessionPanelToggle(page: Page): Locator {
|
||||
return page.locator('[data-session-panel-toggle]')
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Session panel unless it already shows, and wait for its entrance
|
||||
* animation so geometry reads see the final position. A panel over the
|
||||
* conversation closes on presses outside it and a narrower window can hide
|
||||
* it, so each step that reads the panel shows it first. While the layout
|
||||
* settles after a resize the gutter can briefly read wide enough to dock, so
|
||||
* the toggle is pressed again until the panel stays visible.
|
||||
* @param page - the page under test.
|
||||
* @returns the panel.
|
||||
*/
|
||||
export async function showSessionPanel(page: Page): Promise<Locator> {
|
||||
const toggle = sessionPanelToggle(page)
|
||||
const panel = page.locator('[data-session-panel]')
|
||||
await toggle.waitFor({ timeout: 20_000 })
|
||||
// A plain loop, not expect.poll, so suite setup can call it too.
|
||||
const deadline = Date.now() + 20_000
|
||||
while (true) {
|
||||
if (await toggle.getAttribute('aria-expanded') !== 'true') await toggle.click()
|
||||
if (await panel.isVisible()) break
|
||||
if (Date.now() >= deadline) throw new Error('the Session panel did not show')
|
||||
await page.waitForTimeout(250)
|
||||
}
|
||||
await panel.evaluate(async (element) => {
|
||||
await Promise.all(element.getAnimations().map(animation => animation.finished))
|
||||
})
|
||||
return panel
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the Session panel shown over the conversation with Escape.
|
||||
* @param page - the page under test.
|
||||
*/
|
||||
export async function dismissSessionPanel(page: Page): Promise<void> {
|
||||
await page.keyboard.press('Escape')
|
||||
await page.locator('[data-session-panel]').waitFor({ state: 'detached' })
|
||||
}
|
||||
|
||||
/**
|
||||
* Measure a Session panel fold control against a data row of its list: both
|
||||
* heights, how far the control's chevron sits from the row's state mark and
|
||||
* its text from the row's name, in px, and the control's type size and state.
|
||||
* @param control - the fold control row (`[data-session-panel-row="fold"]`).
|
||||
* @param row - a data row of the same list.
|
||||
* @param name - selector of the row's name element inside `row`.
|
||||
* @returns the measurements.
|
||||
*/
|
||||
export async function foldControlLayout(control: Locator, row: Locator, name: string): Promise<{
|
||||
heights: [number, number]
|
||||
chevronOffset: number
|
||||
textOffset: number
|
||||
fontSize: string
|
||||
expanded: string | null
|
||||
}> {
|
||||
const rowBox = await row.evaluate((element, selector) => {
|
||||
const mark = element.querySelector('[data-state]')!.getBoundingClientRect()
|
||||
return {
|
||||
height: element.getBoundingClientRect().height,
|
||||
markCenter: mark.left + mark.width / 2,
|
||||
nameLeft: element.querySelector(selector)!.getBoundingClientRect().left,
|
||||
}
|
||||
}, name)
|
||||
return control.evaluate((element, data) => {
|
||||
const chevron = element.querySelector('svg')!.getBoundingClientRect()
|
||||
const text = document.createRange()
|
||||
text.selectNodeContents(element.querySelector('[data-row-part="content"]')!)
|
||||
return {
|
||||
heights: [element.getBoundingClientRect().height, data.height] as [number, number],
|
||||
chevronOffset: chevron.left + chevron.width / 2 - data.markCenter,
|
||||
textOffset: text.getBoundingClientRect().left - data.nameLeft,
|
||||
fontSize: getComputedStyle(element).fontSize,
|
||||
expanded: element.querySelector('button')!.getAttribute('aria-expanded'),
|
||||
}
|
||||
}, rowBox)
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the Session panel unless it is already hidden.
|
||||
* @param page - the page under test.
|
||||
*/
|
||||
export async function hideSessionPanel(page: Page): Promise<void> {
|
||||
const toggle = sessionPanelToggle(page)
|
||||
if (await toggle.getAttribute('aria-expanded') === 'true') await toggle.click()
|
||||
await expect.poll(() => toggle.getAttribute('aria-expanded')).toBe('false')
|
||||
}
|
||||
|
||||
/**
|
||||
* The right Sidebar's fullscreen panel box: 1px wider than the viewport, so the
|
||||
* first column's divider sits past the window's left edge where the frame clips it.
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from './scaffold.ts'
|
||||
import {
|
||||
connectFreshWorkspace, expandOwningTurnProcess, expandTurnProcesses, newEnglishPage, REPO_ROOT, saveFailureShot,
|
||||
showSessionPanel,
|
||||
} from './support.ts'
|
||||
|
||||
const MODE = webSnapshotMode()
|
||||
@@ -218,8 +219,7 @@ describe.skipIf(MODE === 'record')('web e2e: durable workflow run in Chat', () =
|
||||
await page.getByText(CHILD_PROMPT, { exact: false }).waitFor()
|
||||
expect(await page.getByRole('button', { name: /^Open Reply with exactly the word/ }).count()).toBe(0)
|
||||
|
||||
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
|
||||
const catalog = page.getByRole('tree', { name: 'Subagent sessions' })
|
||||
const catalog = (await showSessionPanel(page)).getByRole('tree', { name: 'Subagent sessions' })
|
||||
await catalog.getByRole('treeitem', { name: /snapshot-flow child 1/ }).press('Enter')
|
||||
await page.getByText(CHILD_PROMPT, { exact: true }).waitFor({ timeout: 15_000 })
|
||||
expect(await page.locator('[data-composer-input][contenteditable="true"]').count()).toBe(1)
|
||||
|
||||
@@ -541,6 +541,15 @@ describe('web e2e: workspace management (create / rename / grouping / hover affo
|
||||
// crossing ground that belongs to neither. Hovering it must not dismiss
|
||||
// it — the hazard this scenario pins.
|
||||
const card = page.getByRole('button', { name: `Copy: ${rowTitle}` })
|
||||
// The stylesheet anchors the card: beside the row's end edge, its top on the row's top.
|
||||
const beside = async (): Promise<{ gap: number; top: number; bottomMargin: number }> => {
|
||||
const row = await sessionRow.boundingBox()
|
||||
const box = await card.boundingBox()
|
||||
if (row === null || box === null) throw new Error('the row or its hover card has no box')
|
||||
const height = await page.evaluate(() => window.innerHeight)
|
||||
return { gap: box.x - (row.x + row.width), top: box.y - row.y, bottomMargin: height - (box.y + box.height) }
|
||||
}
|
||||
expect(await beside()).toMatchObject({ gap: 8, top: 0 })
|
||||
await card.hover()
|
||||
await page.waitForTimeout(POINTER_HOLD_MS)
|
||||
expect(await page.getByText('Idle', { exact: true }).count()).toBeGreaterThanOrEqual(1)
|
||||
@@ -559,6 +568,23 @@ describe('web e2e: workspace management (create / rename / grouping / hover affo
|
||||
// Leaving anchor and card together closes it after the grace.
|
||||
await page.getByRole('button', { name: 'Account menu', exact: true }).hover()
|
||||
await expect.poll(() => card.count(), { timeout: 5_000 }).toBe(0)
|
||||
// In a window too short for the card below the row's top, the card keeps
|
||||
// its side and holds its bottom at the viewport's 8px margin.
|
||||
const viewport = page.viewportSize()
|
||||
const row = await sessionRow.boundingBox()
|
||||
if (viewport === null || row === null) throw new Error('no viewport or row box')
|
||||
await page.setViewportSize({ width: viewport.width, height: Math.ceil(row.y + row.height + 24) })
|
||||
try {
|
||||
await sessionRow.hover()
|
||||
await card.waitFor({ timeout: 5_000 })
|
||||
const held = await beside()
|
||||
expect(held).toMatchObject({ gap: 8, bottomMargin: 8 })
|
||||
expect(held.top).toBeLessThan(0)
|
||||
await page.mouse.move(viewport.width - 20, 4)
|
||||
await expect.poll(() => card.count(), { timeout: 5_000 }).toBe(0)
|
||||
} finally {
|
||||
await page.setViewportSize(viewport)
|
||||
}
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
}, 60_000)
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
"tests/excel-opc.e2e.ts",
|
||||
"tests/office-fixture.ts",
|
||||
"tests/sidebar-browser.e2e.ts",
|
||||
"tests/jobs-menu-layering.e2e.ts",
|
||||
"tests/jobs-panel-layering.e2e.ts",
|
||||
"tests/plugin-config.e2e.ts",
|
||||
"tests/input-plugin-extensions.e2e.ts",
|
||||
"tests/plugin-manager.e2e.ts",
|
||||
@@ -184,6 +184,7 @@
|
||||
"tests/present-after-closing-reply.e2e.ts",
|
||||
"tests/autolink-cjk-punctuation.e2e.ts",
|
||||
"tests/composer-draft-scroll.e2e.ts",
|
||||
"tests/draft-attachment-session-switch.e2e.ts",
|
||||
"tests/composer-focus.e2e.ts",
|
||||
"tests/composer-placeholder.e2e.ts",
|
||||
"tests/context-meter.e2e.ts",
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
en: 41d772192075e133
|
||||
zh: 5ef3da69b4de1d8a
|
||||
/capability-seams-and-core-services:
|
||||
en: 0ae3b368d7fcde08
|
||||
zh: 64c3cc22e17be96b
|
||||
en: 5b3db3a295148bda
|
||||
zh: 602328f72f9c1437
|
||||
@@ -29,6 +29,8 @@ flowchart LR
|
||||
svc_pluginRegistryProbe["ctx.pluginRegistryProbe<br/>Host registry response comparison"]
|
||||
pkg_plugin_manager["plugin-manager"]
|
||||
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
|
||||
pkg_client_ui_connector_account["client-ui-connector-account"]
|
||||
svc_connectorAccounts["ctx.connectorAccounts<br/>Connector accounts on the Plugins page"]
|
||||
pkg_plugin_market["plugin-market"]
|
||||
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
|
||||
pkg_client_ui_plugin_market["client-ui-plugin-market"]
|
||||
@@ -353,6 +355,7 @@ flowchart LR
|
||||
pkg_client_file_upload --> svc_fileUploads
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_connector_account --> svc_connectorAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_client_ui_session_status --> svc_sessionStatus
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
@@ -676,6 +679,7 @@ flowchart LR
|
||||
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | Owns module and exact configuration watchers; application mutations share its queue and automatic reloads await the application file lock. |
|
||||
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | Races public registry responses on the Host; the Client owns the initial registry recommendation. |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | Shares profile package operations with the CLI and reports persisted and running state to Web and agent callers. |
|
||||
| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | Holds the accounts CLI app plugins and MCP connectors register and serves their Host-computed displays to the Plugins page through one Remote; authorization pages and notices stay in the browser that started the operation. |
|
||||
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | Fetches and validates the index sources the user configures; installation goes through the plugin manager. |
|
||||
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | The dsh launcher supplies data-only profile locations and composition inputs; reload scheduling belongs to dsh-hmr. |
|
||||
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | Applies source policy and shared HTTP request dispatch; credential verification belongs to ConnectionAuthentication, and API adapters register endpoints and streams. |
|
||||
|
||||
@@ -31,6 +31,8 @@ flowchart LR
|
||||
svc_pluginRegistryProbe["ctx.pluginRegistryProbe<br/>Host registry response comparison"]
|
||||
pkg_plugin_manager["plugin-manager"]
|
||||
svc_pluginManager["ctx.pluginManager<br/>Current-profile plugin and bundle management"]
|
||||
pkg_client_ui_connector_account["client-ui-connector-account"]
|
||||
svc_connectorAccounts["ctx.connectorAccounts<br/>Connector accounts on the Plugins page"]
|
||||
pkg_plugin_market["plugin-market"]
|
||||
svc_pluginMarket["ctx.pluginMarket<br/>Plugin market index reader"]
|
||||
pkg_client_ui_plugin_market["client-ui-plugin-market"]
|
||||
@@ -355,6 +357,7 @@ flowchart LR
|
||||
pkg_client_file_upload --> svc_fileUploads
|
||||
pkg_client_modules --> svc_clientModules
|
||||
pkg_client_product_analytics --> svc_productAnalytics
|
||||
pkg_client_ui_connector_account --> svc_connectorAccounts
|
||||
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
|
||||
pkg_client_ui_session_status --> svc_sessionStatus
|
||||
pkg_command_feedback --> svc_sessionFeedback
|
||||
@@ -678,6 +681,7 @@ flowchart LR
|
||||
| `ctx.hmr` | `core` | [`hmr`](../packages/boot/hmr) | - | [`app-boot`](../packages/boot/app-boot) | - | 负责模块和精确配置监听;应用修改共用其队列,自动重载等待应用文件锁。 |
|
||||
| `ctx.pluginRegistryProbe` | `core` | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | [`client-ui-plugin-manager`](../packages/client/ui-plugin-manager) | - | 在 Host 上并发比较公共安装源响应;初始安装源推荐由 Client 负责。 |
|
||||
| `ctx.pluginManager` | `core` | [`plugin-manager`](../packages/boot/plugin-manager) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | 与 CLI 共享 profile 包操作,并向 Web 和 Agent 调用方分别报告持久状态与运行状态。 |
|
||||
| `ctx.connectorAccounts` | `service` | [`client-ui-connector-account`](../packages/client/ui-connector-account) | - | - | - | 保存 CLI 应用插件和 MCP 连接器注册的账号,并通过一个 Remote 把 Host 算好的展示内容提供给插件页;授权页和提示只出现在发起操作的浏览器中。 |
|
||||
| `ctx.pluginMarket` | `core` | [`plugin-market`](../packages/boot/plugin-market) | - | [`client-ui-plugin-market`](../packages/client/ui-plugin-market), [`plugin-market`](../packages/boot/plugin-market) | - | 获取并校验用户配置的索引源;安装通过插件管理器完成。 |
|
||||
| `ctx.profileContext` | `core` | [`app-boot`](../packages/boot/app-boot) | - | [`plugin-manager`](../packages/boot/plugin-manager) | - | dsh launcher 提供纯数据形式的 profile 位置与组合输入;重载调度由 dsh-hmr 负责。 |
|
||||
| `ctx.connection` | `core` | [`client-connection`](../packages/client/connection) | - | [`api-gateway`](../packages/api/gateway), [`host-frontend-static`](../packages/host/frontend-static) | - | 执行来源策略与共享 HTTP 请求分发;凭据验证归 ConnectionAuthentication,API 适配器注册端点和流。 |
|
||||
|
||||
@@ -1206,7 +1206,7 @@ export interface Config {
|
||||
worktreePrefix?: string
|
||||
/** Largest diff, file read to show unchanged lines, or list of base branch refs, in bytes. */
|
||||
maxDiffBytes?: number
|
||||
/** Most untracked files a local diff or the local changes card includes. */
|
||||
/** Most untracked files a local diff or the local changes row includes. */
|
||||
maxUntrackedFiles?: number
|
||||
/** Most UTF-8 bytes of change request diffs kept in memory for later reads at the same head commit and base branch. */
|
||||
maxCachedDiffBytes?: number
|
||||
@@ -4717,7 +4717,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `tools` · `subagents` · `systemPrompt` · `sessionProjections`
|
||||
- `refs`: [`AgentOptions`](subsystems/core.md)
|
||||
- `source`: [`packages/subagent/tool-subagent/src/index.ts:46`](../packages/subagent/tool-subagent/src/index.ts)
|
||||
- `source`: [`packages/subagent/tool-subagent/src/index.ts:47`](../packages/subagent/tool-subagent/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Config: which registered provider this tool delegates to, plus child defaults. */
|
||||
@@ -4774,7 +4774,7 @@ export interface PresetSelectionConfig {
|
||||
## `@deepseek-ai/dsh-tool-subagent-control`
|
||||
|
||||
- `inject`: `tools` · `subagents` · `agents` · `systemPrompt`
|
||||
- `source`: [`packages/subagent/tool-subagent-control/src/index.ts:24`](../packages/subagent/tool-subagent-control/src/index.ts)
|
||||
- `source`: [`packages/subagent/tool-subagent-control/src/index.ts:25`](../packages/subagent/tool-subagent-control/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Optional subagent control tools. */
|
||||
@@ -5245,6 +5245,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) |
|
||||
|
||||
@@ -1208,7 +1208,7 @@ export interface Config {
|
||||
worktreePrefix?: string
|
||||
/** Largest diff, file read to show unchanged lines, or list of base branch refs, in bytes. */
|
||||
maxDiffBytes?: number
|
||||
/** Most untracked files a local diff or the local changes card includes. */
|
||||
/** Most untracked files a local diff or the local changes row includes. */
|
||||
maxUntrackedFiles?: number
|
||||
/** Most UTF-8 bytes of change request diffs kept in memory for later reads at the same head commit and base branch. */
|
||||
maxCachedDiffBytes?: number
|
||||
@@ -4719,7 +4719,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `tools` · `subagents` · `systemPrompt` · `sessionProjections`
|
||||
- `refs`: [`AgentOptions`](subsystems/core.zh.md)
|
||||
- `source`: [`packages/subagent/tool-subagent/src/index.ts:46`](../packages/subagent/tool-subagent/src/index.ts)
|
||||
- `source`: [`packages/subagent/tool-subagent/src/index.ts:47`](../packages/subagent/tool-subagent/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Config: which registered provider this tool delegates to, plus child defaults. */
|
||||
@@ -4776,7 +4776,7 @@ export interface PresetSelectionConfig {
|
||||
## `@deepseek-ai/dsh-tool-subagent-control`
|
||||
|
||||
- `inject`: `tools` · `subagents` · `agents` · `systemPrompt`
|
||||
- `source`: [`packages/subagent/tool-subagent-control/src/index.ts:24`](../packages/subagent/tool-subagent-control/src/index.ts)
|
||||
- `source`: [`packages/subagent/tool-subagent-control/src/index.ts:25`](../packages/subagent/tool-subagent-control/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Optional subagent control tools. */
|
||||
@@ -5247,6 +5247,7 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-client-ui-brand-official` | — | [`packages/client/ui-brand-official/src/index.ts`](../packages/client/ui-brand-official/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-chat` | — | [`packages/client/ui-chat/src/index.ts`](../packages/client/ui-chat/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-commands` | — | [`packages/client/ui-commands/src/index.ts`](../packages/client/ui-commands/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-connector-account` | — | [`packages/client/ui-connector-account/src/index.ts`](../packages/client/ui-connector-account/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-context-menu` | — | [`packages/client/ui-context-menu/src/index.ts`](../packages/client/ui-context-menu/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-conversation` | — | [`packages/client/ui-conversation/src/index.ts`](../packages/client/ui-conversation/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-cordis` | — | [`packages/extensions/ui-cordis/src/index.ts`](../packages/extensions/ui-cordis/src/index.ts) |
|
||||
|
||||
+10
-7
@@ -171,6 +171,7 @@ flowchart TD
|
||||
pkg_client_ui_brand_official["client-ui-brand-official"]
|
||||
pkg_client_ui_chat["client-ui-chat"]
|
||||
pkg_client_ui_commands["client-ui-commands"]
|
||||
pkg_client_ui_connector_account["client-ui-connector-account"]
|
||||
pkg_client_ui_context_menu["client-ui-context-menu"]
|
||||
pkg_client_ui_conversation["client-ui-conversation"]
|
||||
pkg_client_ui_deliverables["client-ui-deliverables"]
|
||||
@@ -1383,12 +1384,6 @@ flowchart TD
|
||||
pkg_tool_subagent --> pkg_subagent
|
||||
pkg_tool_subagent --> pkg_system_prompt
|
||||
pkg_tool_subagent --> pkg_tools
|
||||
pkg_tool_subagent_control --> pkg_agent
|
||||
pkg_tool_subagent_control --> pkg_llm
|
||||
pkg_tool_subagent_control --> pkg_session
|
||||
pkg_tool_subagent_control --> pkg_subagent
|
||||
pkg_tool_subagent_control --> pkg_system_prompt
|
||||
pkg_tool_subagent_control --> pkg_tools
|
||||
pkg_api_session_controller --> pkg_agent
|
||||
pkg_api_session_controller --> pkg_agent_default_model
|
||||
pkg_api_session_controller --> pkg_agent_preset_registry
|
||||
@@ -1516,6 +1511,13 @@ flowchart TD
|
||||
pkg_workflow_ptc --> pkg_tools
|
||||
pkg_workflow_ptc --> pkg_workflow
|
||||
pkg_workflow_ptc --> pkg_working_directory
|
||||
pkg_tool_subagent_control --> pkg_agent
|
||||
pkg_tool_subagent_control --> pkg_agent_team
|
||||
pkg_tool_subagent_control --> pkg_llm
|
||||
pkg_tool_subagent_control --> pkg_session
|
||||
pkg_tool_subagent_control --> pkg_subagent
|
||||
pkg_tool_subagent_control --> pkg_system_prompt
|
||||
pkg_tool_subagent_control --> pkg_tools
|
||||
pkg_schedule --> pkg_agent
|
||||
pkg_schedule --> pkg_api_session_controller
|
||||
pkg_schedule --> pkg_llm
|
||||
@@ -1642,6 +1644,7 @@ flowchart TD
|
||||
| [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — |
|
||||
| [`client-ui-chat`](../packages/client/ui-chat) | `client` | — |
|
||||
| [`client-ui-commands`](../packages/client/ui-commands) | `client` | — |
|
||||
| [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — |
|
||||
| [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — |
|
||||
| [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — |
|
||||
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
|
||||
@@ -1949,7 +1952,6 @@ flowchart TD
|
||||
| [`subagent-fork-in-process`](../packages/subagent/subagent-fork-in-process) | `subagent` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent) |
|
||||
| [`subagent-spawn-in-process`](../packages/subagent/subagent-spawn-in-process) | `subagent` | [`subagent`](../packages/subagent/subagent) |
|
||||
| [`tool-subagent`](../packages/subagent/tool-subagent) | `subagent` | [`agent`](../packages/core/agent), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`tool-subagent-control`](../packages/subagent/tool-subagent-control) | `subagent` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`api-session-controller`](../packages/api/session-controller) | `api` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`api-gateway`](../packages/api/gateway), [`attachment`](../packages/attachment/attachment), [`client-connection`](../packages/client/connection), [`client-file-upload`](../packages/client/file-upload), [`commands`](../packages/interaction/commands), [`credentials`](../packages/credentials/credentials), [`file-reference`](../packages/context/file-reference), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`native-command`](../packages/util/native-command), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`settings`](../packages/settings/settings), [`skill`](../packages/skill/skill), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol), [`typert-registry`](../packages/typert/registry), [`util-time`](../packages/util/time), [`util-values`](../packages/util/values), [`util-workspace-path`](../packages/util/workspace-path), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`plugin-market`](../packages/boot/plugin-market) | `boot` | [`error`](../packages/util/error), [`plugin-manager`](../packages/boot/plugin-manager), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`headless`](../packages/bundle/headless) | `bundle` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval) |
|
||||
@@ -1965,6 +1967,7 @@ flowchart TD
|
||||
| [`sdk-protocol`](../packages/sdk/protocol) | `sdk` | [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`agent-team`](../packages/team/agent-team) | `team` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`workflow-ptc`](../packages/workflow/workflow-ptc) | `workflow` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`tool-subagent-control`](../packages/subagent/tool-subagent-control) | `subagent` | [`agent`](../packages/core/agent), [`agent-team`](../packages/team/agent-team), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`schedule`](../packages/schedule/schedule) | `schedule` | [`agent`](../packages/core/agent), [`api-session-controller`](../packages/api/session-controller), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`storage-domain`](../packages/storage/storage-domain), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-time`](../packages/util/time), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`sdk-client`](../packages/sdk/client) | `sdk` | [`llm`](../packages/llm/llm), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session) |
|
||||
| [`tool-agent-team`](../packages/team/tool-agent-team) | `team` | [`agent`](../packages/core/agent), [`agent-team`](../packages/team/agent-team), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
|
||||
+10
-7
@@ -173,6 +173,7 @@ flowchart TD
|
||||
pkg_client_ui_brand_official["client-ui-brand-official"]
|
||||
pkg_client_ui_chat["client-ui-chat"]
|
||||
pkg_client_ui_commands["client-ui-commands"]
|
||||
pkg_client_ui_connector_account["client-ui-connector-account"]
|
||||
pkg_client_ui_context_menu["client-ui-context-menu"]
|
||||
pkg_client_ui_conversation["client-ui-conversation"]
|
||||
pkg_client_ui_deliverables["client-ui-deliverables"]
|
||||
@@ -1385,12 +1386,6 @@ flowchart TD
|
||||
pkg_tool_subagent --> pkg_subagent
|
||||
pkg_tool_subagent --> pkg_system_prompt
|
||||
pkg_tool_subagent --> pkg_tools
|
||||
pkg_tool_subagent_control --> pkg_agent
|
||||
pkg_tool_subagent_control --> pkg_llm
|
||||
pkg_tool_subagent_control --> pkg_session
|
||||
pkg_tool_subagent_control --> pkg_subagent
|
||||
pkg_tool_subagent_control --> pkg_system_prompt
|
||||
pkg_tool_subagent_control --> pkg_tools
|
||||
pkg_api_session_controller --> pkg_agent
|
||||
pkg_api_session_controller --> pkg_agent_default_model
|
||||
pkg_api_session_controller --> pkg_agent_preset_registry
|
||||
@@ -1518,6 +1513,13 @@ flowchart TD
|
||||
pkg_workflow_ptc --> pkg_tools
|
||||
pkg_workflow_ptc --> pkg_workflow
|
||||
pkg_workflow_ptc --> pkg_working_directory
|
||||
pkg_tool_subagent_control --> pkg_agent
|
||||
pkg_tool_subagent_control --> pkg_agent_team
|
||||
pkg_tool_subagent_control --> pkg_llm
|
||||
pkg_tool_subagent_control --> pkg_session
|
||||
pkg_tool_subagent_control --> pkg_subagent
|
||||
pkg_tool_subagent_control --> pkg_system_prompt
|
||||
pkg_tool_subagent_control --> pkg_tools
|
||||
pkg_schedule --> pkg_agent
|
||||
pkg_schedule --> pkg_api_session_controller
|
||||
pkg_schedule --> pkg_llm
|
||||
@@ -1644,6 +1646,7 @@ flowchart TD
|
||||
| [`client-ui-brand-official`](../packages/client/ui-brand-official) | `client` | — |
|
||||
| [`client-ui-chat`](../packages/client/ui-chat) | `client` | — |
|
||||
| [`client-ui-commands`](../packages/client/ui-commands) | `client` | — |
|
||||
| [`client-ui-connector-account`](../packages/client/ui-connector-account) | `client` | — |
|
||||
| [`client-ui-context-menu`](../packages/client/ui-context-menu) | `client` | — |
|
||||
| [`client-ui-conversation`](../packages/client/ui-conversation) | `client` | — |
|
||||
| [`client-ui-deliverables`](../packages/client/ui-deliverables) | `client` | — |
|
||||
@@ -1951,7 +1954,6 @@ flowchart TD
|
||||
| [`subagent-fork-in-process`](../packages/subagent/subagent-fork-in-process) | `subagent` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent) |
|
||||
| [`subagent-spawn-in-process`](../packages/subagent/subagent-spawn-in-process) | `subagent` | [`subagent`](../packages/subagent/subagent) |
|
||||
| [`tool-subagent`](../packages/subagent/tool-subagent) | `subagent` | [`agent`](../packages/core/agent), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`tool-subagent-control`](../packages/subagent/tool-subagent-control) | `subagent` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`api-session-controller`](../packages/api/session-controller) | `api` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`api-gateway`](../packages/api/gateway), [`attachment`](../packages/attachment/attachment), [`client-connection`](../packages/client/connection), [`client-file-upload`](../packages/client/file-upload), [`commands`](../packages/interaction/commands), [`credentials`](../packages/credentials/credentials), [`file-reference`](../packages/context/file-reference), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`native-command`](../packages/util/native-command), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`settings`](../packages/settings/settings), [`skill`](../packages/skill/skill), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol), [`typert-registry`](../packages/typert/registry), [`util-time`](../packages/util/time), [`util-values`](../packages/util/values), [`util-workspace-path`](../packages/util/workspace-path), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`plugin-market`](../packages/boot/plugin-market) | `boot` | [`error`](../packages/util/error), [`plugin-manager`](../packages/boot/plugin-manager), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`headless`](../packages/bundle/headless) | `bundle` | [`agent`](../packages/core/agent), [`agent-default-model`](../packages/core/agent-default-model), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`subagent`](../packages/subagent/subagent), [`user-approval`](../packages/interaction/user-approval) |
|
||||
@@ -1967,6 +1969,7 @@ flowchart TD
|
||||
| [`sdk-protocol`](../packages/sdk/protocol) | `sdk` | [`commands`](../packages/interaction/commands), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`user-questions`](../packages/interaction/user-questions) |
|
||||
| [`agent-team`](../packages/team/agent-team) | `team` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`subagent`](../packages/subagent/subagent), [`typert-protocol`](../packages/typert/protocol) |
|
||||
| [`workflow-ptc`](../packages/workflow/workflow-ptc) | `workflow` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`ptc-runtime`](../packages/ptc-runtime/ptc-runtime), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`workflow`](../packages/workflow/workflow), [`working-directory`](../packages/session/working-directory) |
|
||||
| [`tool-subagent-control`](../packages/subagent/tool-subagent-control) | `subagent` | [`agent`](../packages/core/agent), [`agent-team`](../packages/team/agent-team), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
| [`schedule`](../packages/schedule/schedule) | `schedule` | [`agent`](../packages/core/agent), [`api-session-controller`](../packages/api/session-controller), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`storage-domain`](../packages/storage/storage-domain), [`subagent`](../packages/subagent/subagent), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-time`](../packages/util/time), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`sdk-client`](../packages/sdk/client) | `sdk` | [`llm`](../packages/llm/llm), [`sdk-protocol`](../packages/sdk/protocol), [`session`](../packages/core/session) |
|
||||
| [`tool-agent-team`](../packages/team/tool-agent-team) | `team` | [`agent`](../packages/core/agent), [`agent-team`](../packages/team/agent-team), [`session`](../packages/core/session), [`subagent`](../packages/subagent/subagent), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||
|
||||
@@ -1104,8 +1104,8 @@
|
||||
en: f604eebb973fe2cf
|
||||
zh: 0c0aba1e17ecf66e
|
||||
/session-persistence-event-catalog/resolved-persistence-types/jobsettlecause:
|
||||
en: 748a4269d86e007a
|
||||
zh: 4ce04c4451bdcfe8
|
||||
en: 3f193f1c8bbae065
|
||||
zh: b8c828959d28480d
|
||||
/session-persistence-event-catalog/resolved-persistence-types/jobsettleddata:
|
||||
en: fc8caf270a7581f7
|
||||
zh: b467e1d4191106eb
|
||||
|
||||
@@ -3895,7 +3895,7 @@ Sources: [`packages/jobs/jobs/src/types.ts:24`](../packages/jobs/jobs/src/types.
|
||||
|
||||
SHA-256: `750a2b129d67704df675c06823c20c80b65cbae89d5aaa914fd5a72e3df395b5`
|
||||
|
||||
Sources: [`packages/jobs/jobs/src/types.ts:247`](../packages/jobs/jobs/src/types.ts)
|
||||
Sources: [`packages/jobs/jobs/src/types.ts:253`](../packages/jobs/jobs/src/types.ts)
|
||||
|
||||
One of:
|
||||
|
||||
|
||||
@@ -3897,7 +3897,7 @@ SHA-256: `e3056e0dda3a379e895386e368c3ce42131460ea65e410e1d091cca98a347305`
|
||||
|
||||
SHA-256: `750a2b129d67704df675c06823c20c80b65cbae89d5aaa914fd5a72e3df395b5`
|
||||
|
||||
来源:[`packages/jobs/jobs/src/types.ts:247`](../packages/jobs/jobs/src/types.ts)
|
||||
来源:[`packages/jobs/jobs/src/types.ts:253`](../packages/jobs/jobs/src/types.ts)
|
||||
|
||||
以下类型之一:
|
||||
|
||||
|
||||
Generated
+1
-1
@@ -361,7 +361,7 @@
|
||||
{"digest":"71bb3254ec8f1e491ce63b762a7b5f18709de23aa4e8abcc8b886f4b6ce051dd","names":[],"sources":["packages/llm/llm/src/assistant-stream.ts:27"]},
|
||||
{"digest":"72ec79127a9c0d0241b1106a74cc2b24c81ce467170f1c3c93f7b71a9496d227","names":[],"sources":[]},
|
||||
{"digest":"7382c4fc95fe8c5db65ca4d9da572b115d0dbb818b7f32c22ab040318ffbb4bc","names":[],"sources":[]},
|
||||
{"digest":"750a2b129d67704df675c06823c20c80b65cbae89d5aaa914fd5a72e3df395b5","names":["packages/jobs/jobs/src/types.ts#JobSettleCause"],"sources":["packages/jobs/jobs/src/types.ts:247"]},
|
||||
{"digest":"750a2b129d67704df675c06823c20c80b65cbae89d5aaa914fd5a72e3df395b5","names":["packages/jobs/jobs/src/types.ts#JobSettleCause"],"sources":["packages/jobs/jobs/src/types.ts:253"]},
|
||||
{"digest":"7554565be416b0342053ee6a46256c9dab07c487349b4a5f10bab1edc151c619","names":[],"sources":[]},
|
||||
{"digest":"756b5e23a5cb2c7f486f366a828f7461c88902af21125bd6810881f4ccbff6cc","names":[],"sources":[]},
|
||||
{"digest":"7624ca28c61ca0eaa4f015140f3cea6e0c16cce2f2960fab5f531203d253903e","names":[],"sources":[]},
|
||||
|
||||
@@ -143,6 +143,50 @@ async edit( entry: Entry, change: (current: Record<string, unknown>, inherited:
|
||||
|
||||
Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
|
||||
|
||||
<a id="ctxconnectoraccounts--connectoraccounts"></a>
|
||||
|
||||
### `ctx.connectorAccounts` — `ConnectorAccounts`
|
||||
|
||||
Holds the registered accounts and serves them to the Plugins page.
|
||||
|
||||
```ts cordis-catalog
|
||||
/**
|
||||
* Show one account on the Plugins page for as long as the returned disposer has not run.
|
||||
* @param registration - the account key, its bundle package, the account source, the page operations, and the
|
||||
* presentation.
|
||||
* @returns an idempotent disposer that withdraws the account.
|
||||
* @throws when another account already uses the key or the package.
|
||||
*/
|
||||
register<View extends AnyConnectorAccountView>(registration: ConnectorAccountRegistration<View>): () => void
|
||||
|
||||
/**
|
||||
* Follow every registered account; each new subscriber starts a check of each account that runs no operation.
|
||||
* @param signal - the Client's observation lifetime; disposal also ends the stream.
|
||||
* @returns the current accounts, then each changed set, coalescing changes that arrive before the next read.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable<ConnectorAccountsView>
|
||||
|
||||
/**
|
||||
* Start one of the operations the account registered as page actions.
|
||||
* @param key - the account key.
|
||||
* @param operation - the operation kind.
|
||||
* @returns the operation identity once the account's source has started it.
|
||||
* @throws for an unknown account or operation, or whatever the account's source refuses, such as a second operation.
|
||||
*/
|
||||
@Remote async start(key: string, operation: string): Promise<ConnectorOperationId>
|
||||
|
||||
/**
|
||||
* Cancel one operation while its phase is cancellable, and wait for it to settle.
|
||||
* @param key - the account key.
|
||||
* @param id - the operation to cancel; a finished one or a phase that is not cancellable is ignored.
|
||||
* @returns after the operation settles, or at once when nothing is cancelled.
|
||||
* @throws for an unknown account.
|
||||
*/
|
||||
@Remote cancel(key: string, id: ConnectorOperationId): Promise<void>
|
||||
```
|
||||
|
||||
Source: [`packages/client/ui-connector-account/src/index.ts`](../../packages/client/ui-connector-account/src/index.ts)
|
||||
|
||||
<a id="ctxheadlessstartup--headlessstartupvalues"></a>
|
||||
|
||||
### `ctx.headlessStartup` — `HeadlessStartupValues`
|
||||
|
||||
@@ -143,6 +143,50 @@ async edit( entry: Entry, change: (current: Record<string, unknown>, inherited:
|
||||
|
||||
Source: [`packages/boot/config-editor/src/index.ts`](../../packages/boot/config-editor/src/index.ts)
|
||||
|
||||
<a id="ctxconnectoraccounts--connectoraccounts"></a>
|
||||
|
||||
### `ctx.connectorAccounts` — `ConnectorAccounts`
|
||||
|
||||
Holds the registered accounts and serves them to the Plugins page.
|
||||
|
||||
```ts cordis-catalog
|
||||
/**
|
||||
* Show one account on the Plugins page for as long as the returned disposer has not run.
|
||||
* @param registration - the account key, its bundle package, the account source, the page operations, and the
|
||||
* presentation.
|
||||
* @returns an idempotent disposer that withdraws the account.
|
||||
* @throws when another account already uses the key or the package.
|
||||
*/
|
||||
register<View extends AnyConnectorAccountView>(registration: ConnectorAccountRegistration<View>): () => void
|
||||
|
||||
/**
|
||||
* Follow every registered account; each new subscriber starts a check of each account that runs no operation.
|
||||
* @param signal - the Client's observation lifetime; disposal also ends the stream.
|
||||
* @returns the current accounts, then each changed set, coalescing changes that arrive before the next read.
|
||||
*/
|
||||
@Remote({ mode: 'stream' }) async *watch(signal: AbortSignal): AsyncIterable<ConnectorAccountsView>
|
||||
|
||||
/**
|
||||
* Start one of the operations the account registered as page actions.
|
||||
* @param key - the account key.
|
||||
* @param operation - the operation kind.
|
||||
* @returns the operation identity once the account's source has started it.
|
||||
* @throws for an unknown account or operation, or whatever the account's source refuses, such as a second operation.
|
||||
*/
|
||||
@Remote async start(key: string, operation: string): Promise<ConnectorOperationId>
|
||||
|
||||
/**
|
||||
* Cancel one operation while its phase is cancellable, and wait for it to settle.
|
||||
* @param key - the account key.
|
||||
* @param id - the operation to cancel; a finished one or a phase that is not cancellable is ignored.
|
||||
* @returns after the operation settles, or at once when nothing is cancelled.
|
||||
* @throws for an unknown account.
|
||||
*/
|
||||
@Remote cancel(key: string, id: ConnectorOperationId): Promise<void>
|
||||
```
|
||||
|
||||
Source: [`packages/client/ui-connector-account/src/index.ts`](../../packages/client/ui-connector-account/src/index.ts)
|
||||
|
||||
<a id="ctxheadlessstartup--headlessstartupvalues"></a>
|
||||
|
||||
### `ctx.headlessStartup` — `HeadlessStartupValues`
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
en: 74255d6005e1c9e8
|
||||
zh: 252d0d552f1e26a1
|
||||
/forges/panel:
|
||||
en: 7dcefe2825490257
|
||||
zh: 38cec4d1ae3b0d6e
|
||||
en: 0fc2e5a367d0a3ad
|
||||
zh: a1028e4ecf61b70c
|
||||
/forges/extension-api:
|
||||
en: f35345e482e84f4f
|
||||
zh: 2ecb7d9498decb31
|
||||
@@ -1121,7 +1121,7 @@ type ForgeChangeRequestStatesFrame =
|
||||
| { readonly type: 'changed'; readonly states: readonly ForgeChangeRequestListState[] }
|
||||
```
|
||||
|
||||
The changes view reads through the same Remote. `localDiff` reads one `ForgeLocalScope` of the Session's checkout, and `changeRequestDiff` reads a bound change request at the head of its latest status through the provider's `diff`, which returns a patch only for that head commit, or the `ForgeCommitRange` it names through the provider's `compare`; both return files that the Host parsed into `ForgeDiffFile` hunks, each with its review layer and change digest. `localCommits` and `changeRequestCommits` list the commits a range can name, the latter as null when the provider does not read commits. `localText` and `changeRequestText` read the new side of one file, which supplies the unchanged lines between hunks. Each inspection also sizes the `branch` scope as `ForgePanelState.local` for the panel's local changes card, always against the automatic fork point. A `branch` scope whose `base` names a ref compares with the merge base of HEAD and that branch instead; `diffBases` lists the branches the view offers, with the automatic fork point. When the head moved past the latest status, the provider returns `stale` and `ctx.forge.diff` polls the change request at once, once per head commit; `changeRequestDiff` rejects with `forgePanel/stale-head` and caches nothing, and the changes view keeps loading until a later status arrives, then reads again at that status's head. Review comments therefore always address the commit whose lines the view shows.
|
||||
The changes view reads through the same Remote. `localDiff` reads one `ForgeLocalScope` of the Session's checkout, and `changeRequestDiff` reads a bound change request at the head of its latest status through the provider's `diff`, which returns a patch only for that head commit, or the `ForgeCommitRange` it names through the provider's `compare`; both return files that the Host parsed into `ForgeDiffFile` hunks, each with its review layer and change digest. `localCommits` and `changeRequestCommits` list the commits a range can name, the latter as null when the provider does not read commits. `localText` and `changeRequestText` read the new side of one file, which supplies the unchanged lines between hunks. Each inspection also sizes the `branch` scope as `ForgePanelState.local` for the Session panel's local changes row, always against the automatic fork point. A `branch` scope whose `base` names a ref compares with the merge base of HEAD and that branch instead; `diffBases` lists the branches the view offers, with the automatic fork point. When the head moved past the latest status, the provider returns `stale` and `ctx.forge.diff` polls the change request at once, once per head commit; `changeRequestDiff` rejects with `forgePanel/stale-head` and caches nothing, and the changes view keeps loading until a later status arrives, then reads again at that status's head. Review comments therefore always address the commit whose lines the view shows.
|
||||
|
||||
`changeRequestReview(session, url, headSha, fresh)` reads the threads of a bound change request at the head of the diff the view shows and refuses another head with `forgePanel/stale-head`, `forgePanel/review-unsupported` for a provider without review reads, and `forgePanel/review-failed` otherwise. It keeps one read per change request in memory, keyed by head commit and the status's update time and bounded by `maxCachedReviewBytes`, and reads again once the kept read is `reviewRefreshMs` old or when `fresh` asks for it, as the first read after the reader refreshes the view does: on GitHub a new comment or reply changes a pull request's update time, but resolving a thread does not. The changes view asks again at every status it receives while visible, and overlays the threads on the files the [panel README](../../packages/experimental/client-ui-forge/README.md#use-this-package) describes.
|
||||
|
||||
@@ -1309,7 +1309,7 @@ interface ForgeChangedFile {
|
||||
```
|
||||
|
||||
```ts type-equiv
|
||||
/** Size of the `branch` scope, which the panel's local changes card shows. */
|
||||
/** Size of the `branch` scope, which the Session panel's local changes row shows. */
|
||||
interface ForgeLocalChanges {
|
||||
/** Ref or abbreviated commit the scope compares with. */
|
||||
readonly base: string
|
||||
|
||||
@@ -1123,7 +1123,7 @@ type ForgeChangeRequestStatesFrame =
|
||||
| { readonly type: 'changed'; readonly states: readonly ForgeChangeRequestListState[] }
|
||||
```
|
||||
|
||||
变更视图经同一个 Remote 读取。`localDiff` 读取 Session 检出的某个 `ForgeLocalScope`;`changeRequestDiff` 经提供方的 `diff` 读取已绑定变更请求在其最新状态 head 处的变更(提供方只返回描述该 head 提交的补丁),或经提供方的 `compare` 读取它指定的 `ForgeCommitRange`;两者返回的文件都已在宿主上解析为 `ForgeDiffFile` 的 hunk,并带有分层与改动摘要。`localCommits` 与 `changeRequestCommits` 列出范围可以指定的提交,提供方不读取提交时后者返回 null。`localText` 与 `changeRequestText` 读取一个文件的新版本,用来补出 hunk 之间未变更的行。每次检查还会把 `branch` 范围的规模统计为 `ForgePanelState.local`,供面板的变更卡片使用,始终以自动分叉点为准。`base` 指定了引用的 `branch` 范围改为与 HEAD 和该分支的合并基准比较;`diffBases` 列出视图可选的分支以及自动分叉点。head 已越过最新状态时,提供方返回 `stale`,`ctx.forge.diff` 立即重新轮询该变更请求(每个 head 提交一次);`changeRequestDiff` 以 `forgePanel/stale-head` 拒绝且不缓存任何内容,变更视图保持加载,直到更新的状态到达后按该状态的 head 重新读取。因此评审评论始终指向视图所显示行的那个提交。
|
||||
变更视图经同一个 Remote 读取。`localDiff` 读取 Session 检出的某个 `ForgeLocalScope`;`changeRequestDiff` 经提供方的 `diff` 读取已绑定变更请求在其最新状态 head 处的变更(提供方只返回描述该 head 提交的补丁),或经提供方的 `compare` 读取它指定的 `ForgeCommitRange`;两者返回的文件都已在宿主上解析为 `ForgeDiffFile` 的 hunk,并带有分层与改动摘要。`localCommits` 与 `changeRequestCommits` 列出范围可以指定的提交,提供方不读取提交时后者返回 null。`localText` 与 `changeRequestText` 读取一个文件的新版本,用来补出 hunk 之间未变更的行。每次检查还会把 `branch` 范围的规模统计为 `ForgePanelState.local`,供会话面板的本地变更行使用,始终以自动分叉点为准。`base` 指定了引用的 `branch` 范围改为与 HEAD 和该分支的合并基准比较;`diffBases` 列出视图可选的分支以及自动分叉点。head 已越过最新状态时,提供方返回 `stale`,`ctx.forge.diff` 立即重新轮询该变更请求(每个 head 提交一次);`changeRequestDiff` 以 `forgePanel/stale-head` 拒绝且不缓存任何内容,变更视图保持加载,直到更新的状态到达后按该状态的 head 重新读取。因此评审评论始终指向视图所显示行的那个提交。
|
||||
|
||||
`changeRequestReview(session, url, headSha, fresh)` 在视图所显示 diff 的 head 处读取已绑定变更请求的讨论;head 不同时以 `forgePanel/stale-head` 拒绝,提供方不支持读取讨论时返回 `forgePanel/review-unsupported`,其他失败返回 `forgePanel/review-failed`。每个变更请求在内存里保留一次读取结果,以 head 提交和状态的更新时间为键、受 `maxCachedReviewBytes` 约束,保留时间达到 `reviewRefreshMs` 后,或 `fresh` 要求时(读者刷新视图后的第一次读取就是这样)重新读取:在 GitHub 上,新评论和回复会改变 PR 的更新时间,解决讨论则不会。变更视图可见时,每收到一次状态就重新请求一次,并按[面板 README](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package) 所述把讨论叠加到文件上。
|
||||
|
||||
@@ -1311,7 +1311,7 @@ interface ForgeChangedFile {
|
||||
```
|
||||
|
||||
```ts type-equiv
|
||||
/** Size of the `branch` scope, which the panel's local changes card shows. */
|
||||
/** Size of the `branch` scope, which the Session panel's local changes row shows. */
|
||||
interface ForgeLocalChanges {
|
||||
/** Ref or abbreviated commit the scope compares with. */
|
||||
readonly base: string
|
||||
|
||||
@@ -181,6 +181,12 @@ interface JobOutcome {
|
||||
* reason, the registry appends that reason.
|
||||
*/
|
||||
detail?: string
|
||||
/**
|
||||
* Exit code of the process the job ran, for a producer that runs one. A
|
||||
* nonzero code on a `completed` job means the command reported failure while
|
||||
* the job itself finished.
|
||||
*/
|
||||
exitCode?: number
|
||||
/**
|
||||
* Return value for jobs whose result is a value rather than a stream (a
|
||||
* workflow's rendered result, a subagent's report). The output ring carries
|
||||
@@ -295,6 +301,8 @@ interface JobView {
|
||||
readonly progress?: string
|
||||
/** Terminal reason (`exit code: 3`); a recorded kill reason is merged in. */
|
||||
readonly detail?: string
|
||||
/** Exit code of the process the job ran, once settled, for a producer that reports one. */
|
||||
readonly exitCode?: number
|
||||
/** Epoch ms when the job was registered. */
|
||||
readonly startedAt: number
|
||||
/** Epoch ms when the job settled; absent while live. */
|
||||
|
||||
@@ -181,6 +181,12 @@ interface JobOutcome {
|
||||
* reason, the registry appends that reason.
|
||||
*/
|
||||
detail?: string
|
||||
/**
|
||||
* Exit code of the process the job ran, for a producer that runs one. A
|
||||
* nonzero code on a `completed` job means the command reported failure while
|
||||
* the job itself finished.
|
||||
*/
|
||||
exitCode?: number
|
||||
/**
|
||||
* Return value for jobs whose result is a value rather than a stream (a
|
||||
* workflow's rendered result, a subagent's report). The output ring carries
|
||||
@@ -295,6 +301,8 @@ interface JobView {
|
||||
readonly progress?: string
|
||||
/** Terminal reason (`exit code: 3`); a recorded kill reason is merged in. */
|
||||
readonly detail?: string
|
||||
/** Exit code of the process the job ran, once settled, for a producer that reports one. */
|
||||
readonly exitCode?: number
|
||||
/** Epoch ms when the job was registered. */
|
||||
readonly startedAt: number
|
||||
/** Epoch ms when the job settled; absent while live. */
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
en: 6cc2cd9ced70bb09
|
||||
zh: 1c0e6cb4ba2ed637
|
||||
/tool-schema-catalog/tool-package-map:
|
||||
en: ccbb2505b414def8
|
||||
zh: 507d418b688a193b
|
||||
en: 9a75613dfc69ce8b
|
||||
zh: 5f52b86658f1dff7
|
||||
/tool-schema-catalog/deepseek-ai-dsh-plugin-manager:
|
||||
en: e0143916bb634762
|
||||
zh: e0143916bb634762
|
||||
@@ -273,8 +273,8 @@
|
||||
en: 841abe0dd5913ea7
|
||||
zh: 841abe0dd5913ea7
|
||||
/tool-schema-catalog/deepseek-ai-dsh-tool-subagent/list-subagent-models:
|
||||
en: 0e21650bbe8c71c7
|
||||
zh: fe4033efb38d51a3
|
||||
en: 1fa8a23ffccd029f
|
||||
zh: 5d1b9d618976d580
|
||||
/tool-schema-catalog/deepseek-ai-dsh-tool-subagent/subagent:
|
||||
en: 9912eeda5bc40b43
|
||||
zh: 0cb70f9a0d923bee
|
||||
@@ -318,8 +318,8 @@
|
||||
en: 8001eda7e9ff6a25
|
||||
zh: 2414761029f21404
|
||||
/tool-schema-catalog/deepseek-ai-dsh-tool-agent-team/team-task-update:
|
||||
en: 9acd1c5b2fac9853
|
||||
zh: 3bd81e9cd1f1c28d
|
||||
en: 3c25013abbe19446
|
||||
zh: 9552eaab1a25adb2
|
||||
/tool-schema-catalog/deepseek-ai-dsh-tool-todo:
|
||||
en: dea62d26fb18ff68
|
||||
zh: dea62d26fb18ff68
|
||||
|
||||
@@ -46,7 +46,7 @@ This table connects model-visible tool names to the plugin package and service s
|
||||
| `@deepseek-ai/dsh-tool-subagent` | `list_subagent_models`, `subagent` | `ctx.tools`, `ctx.subagents`, `ctx.systemPrompt`, `ctx.sessionProjections`, `ctx.llm for model discovery and selected-route validation` | `tool/call`, `tool/result`, `child session events through the chosen provider` | `subagent`, `subagent_fork` | The load-time `toolName` selects the delegation name (default `subagent`); `modelSelection` adds optional route fields. `modelDiscovery` defaults off and registers shared discovery on one instance per scope. Web and Desktop presets enable spawn discovery and route fields and leave `subagent_fork` route fields disabled. The Host settings service records authorization for each new top-level Session; child Sessions inherit it. Without a recorded policy, discovery and explicit selection permit only the current parent route. Every delegation returns the child's name promptly; local children accept follow-ups, while external backends report their single execution automatically. |
|
||||
| `@deepseek-ai/dsh-tool-subagent-control` | `interrupt_agent`, `list_agents`, `send_message`, `wait_agent` | `ctx.tools`, `ctx.subagents`, `ctx.agents` | `tool/call`, `tool/result`, `child session events through ctx.subagents` | - | The shared control tools discover and contact agents in the subagent tree, interrupt owned descendants, and wait for input in the caller’s inbox. Provider-bound `tool-subagent` instances supply delegation tools. |
|
||||
| `@deepseek-ai/dsh-tool-jobs` | `job_kill`, `job_list`, `job_output` | `ctx.tools`, `ctx.jobs`, `ctx.systemPrompt` | `tool/call`, `tool/result`, `user/message via agent.inject() for background completion notices` | - | The kind-agnostic background-job controller: background bash commands and PTY sends are read, listed, and killed through the same three tools. Loading the plugin attaches the controller that arms producers' `ctx.jobs.start()`. |
|
||||
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | Four task-board tools share the subagent tree’s root Session. Enabling Team mode on the root Session adds task-board guidance alongside standard subagent delegation and control tools. Standard subagent controls provide required identity independently of Team mode. |
|
||||
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | Four task-board tools share the subagent tree’s root Session. Enabling Team mode on the root Session adds task-board guidance alongside standard subagent delegation and control tools. Standard subagent controls provide required identity independently of Team mode; their result report instruction appears only while Team mode is off. |
|
||||
| `@deepseek-ai/dsh-tool-todo` | `todo_write` | `ctx.tools`, `owning Agent session` | `tool/call`, `todo/write`, `tool/result` | - | todo_write is session-owned state; UIs render the latest todo/write event as a checklist. `allowParallelInProgress` is required with no default, so the catalog states its choice: `true`, whose description invites several `in_progress` items. A deployment choosing `false` receives the same tool with a description asking for exactly one active task. |
|
||||
| `@deepseek-ai/dsh-tool-working-directory` | `working_directory` | `ctx.tools`, `ctx.workingDirectory` | `tool/call`, `working-directory/change`, `user context for directory changes`, `tool/result` | - | Reads or changes the calling Session directory. Existing shells and processes retain their own directories; origin metadata and permission roots stay fixed. |
|
||||
| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout. |
|
||||
@@ -2258,7 +2258,7 @@ The subagent_oar tool selects among configured aliases for external providers. T
|
||||
|
||||
### `list_subagent_models`
|
||||
|
||||
Inspect the routes available for explicit subagent model selection. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts. Query when choosing an explicit child route or reasoning effort. Omit optional fields rather than sending empty strings.
|
||||
Inspect the routes available for explicit subagent model selection. No arguments: authorized providers. `provider`: that provider's authorized models. `provider` + `model`: that model and its reasoning efforts.
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -2266,7 +2266,7 @@ Inspect the routes available for explicit subagent model selection. No arguments
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "string",
|
||||
"description": "Registered LLM provider id."
|
||||
"description": "Provider id from the no-argument listing."
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
@@ -2646,7 +2646,7 @@ Compare-and-set a shared task action using the latest revision from team_task_ge
|
||||
|
||||
Source: [`packages/team/tool-agent-team/src/index.ts`](../packages/team/tool-agent-team/src/index.ts)
|
||||
|
||||
Four task-board tools share the subagent tree’s root Session. Enabling Team mode on the root Session adds task-board guidance alongside standard subagent delegation and control tools. Standard subagent controls provide required identity independently of Team mode.
|
||||
Four task-board tools share the subagent tree’s root Session. Enabling Team mode on the root Session adds task-board guidance alongside standard subagent delegation and control tools. Standard subagent controls provide required identity independently of Team mode; their result report instruction appears only while Team mode is off.
|
||||
|
||||
<a id="deepseek-aidsh-tool-todo"></a>
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
| `@deepseek-ai/dsh-tool-subagent` | `list_subagent_models`、`subagent` | `ctx.tools`、`ctx.subagents`、`ctx.systemPrompt`、`ctx.sessionProjections`、`用于模型发现和所选路由校验的 ctx.llm` | `tool/call`、`tool/result`、`child session events through the chosen provider` | `subagent`、`subagent_fork` | 加载时的 `toolName` 选择委派名称(默认为 `subagent`);`modelSelection` 增加可选路由字段。`modelDiscovery` 默认关闭,每个作用域由一个实例注册共享发现工具。Web 与 Desktop preset 启用 spawn 发现和路由字段,并为 `subagent_fork` 保持路由字段关闭。Host 设置服务为每个新顶层 Session 记录授权;子 Session 继承该授权。没有已记录策略时,发现和显式选择只允许当前父级路由。每次委派都会立即返回子代理的名称;本地子代理接受后续消息,外部后端自动汇报单次执行结果。 |
|
||||
| `@deepseek-ai/dsh-tool-subagent-control` | `interrupt_agent`、`list_agents`、`send_message`、`wait_agent` | `ctx.tools`、`ctx.subagents`、`ctx.agents` | `tool/call`、`tool/result`、`child session events through ctx.subagents` | - | 共享控制工具发现并联系 subagent 树中的 Agent,中断有权控制的后代,并等待调用者收件箱中的输入。绑定提供方的 `tool-subagent` 实例提供委派工具。 |
|
||||
| `@deepseek-ai/dsh-tool-jobs` | `job_kill`、`job_list`、`job_output` | `ctx.tools`、`ctx.jobs`、`ctx.systemPrompt` | `tool/call`、`tool/result`、`user/message via agent.inject() for background completion notices` | - | 与任务种类无关的后台任务控制器:后台 bash 命令与 PTY 发送 都通过相同的 3 个工具读取、列出和终止。加载该插件会挂接控制器,从而启用生产方的 `ctx.jobs.start()`。 |
|
||||
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | 四个任务板工具共享 subagent 树的根 Session。在根 Session 开启 Team 模式,会在标准 subagent 委派和控制工具之外增加任务板指导。标准 subagent 控制工具提供必需身份,不受 Team 模式影响。 |
|
||||
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | 四个任务板工具共享 subagent 树的根 Session。在根 Session 开启 Team 模式,会在标准 subagent 委派和控制工具之外增加任务板指导。标准 subagent 控制工具提供必需身份,不受 Team 模式影响;其结果汇报要求仅在 Team 模式关闭时出现。 |
|
||||
| `@deepseek-ai/dsh-tool-todo` | `todo_write` | `ctx.tools`、`owning Agent session` | `tool/call`、`todo/write`、`tool/result` | - | todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为检查清单。`allowParallelInProgress` 是没有默认值的必填项,因此本目录明确选择 `true`,对应描述允许同时存在多个 `in_progress` 项。选择 `false` 的部署会获得同一工具,但描述会要求只能有 1 个活动任务。 |
|
||||
| `@deepseek-ai/dsh-tool-working-directory` | `working_directory` | `ctx.tools`, `ctx.workingDirectory` | `tool/call`, `working-directory/change`, `user context for directory changes`, `tool/result` | - | 读取或改变调用方 Session 的目录。已有 shell 和进程保留自己的目录;原始元数据和权限根目录保持不变。 |
|
||||
| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | 在 Web 和 Desktop 上通过变更请求与工作树组合包启用;其他 profile 可以选择独立组合包。在现有写权限下从固定的本地提交创建新分支与检出目录,再改变 Session 工作目录。离开时保留分支与检出目录。 |
|
||||
@@ -2264,7 +2264,7 @@ subagent_oar 工具在为外部提供方配置的别名之间选择。本目录
|
||||
|
||||
### `list_subagent_models`
|
||||
|
||||
查询允许为 subagent 显式选择的路由。无参数:提供方;`provider`:允许的模型;`provider` + `model`:该模型及其推理强度。选择子级提供方和模型前先在此查询选项,再将返回的 id 用于委派。
|
||||
查询允许为 subagent 显式选择的路由。无参数:提供方;`provider`:允许的模型;`provider` + `model`:该模型及其推理强度。
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -2272,7 +2272,7 @@ subagent_oar 工具在为外部提供方配置的别名之间选择。本目录
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "string",
|
||||
"description": "Registered LLM provider id."
|
||||
"description": "Provider id from the no-argument listing."
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
@@ -2652,7 +2652,7 @@ subagent_oar 工具在为外部提供方配置的别名之间选择。本目录
|
||||
|
||||
来源:[`packages/team/tool-agent-team/src/index.ts`](../packages/team/tool-agent-team/src/index.ts)
|
||||
|
||||
四个任务板工具共享 subagent 树的根 Session。在根 Session 开启 Team 模式,会在标准子代理委派和控制工具之外增加任务板指导。标准子代理控制工具提供必需身份,不受 Team 模式影响。
|
||||
四个任务板工具共享 subagent 树的根 Session。在根 Session 开启 Team 模式,会在标准子代理委派和控制工具之外增加任务板指导。标准子代理控制工具提供必需身份,不受 Team 模式影响;其结果汇报要求仅在 Team 模式关闭时出现。
|
||||
|
||||
<a id="deepseek-aidsh-tool-todo"></a>
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: fb6d50f3139ad186
|
||||
zh: 668cb0c02bd22167
|
||||
/dsh-unified-corner-radius-standard/nested-geometry-and-hover:
|
||||
en: 7fe4eb7707e6a9f3
|
||||
zh: be7530a05c205e27
|
||||
en: 76037a56b0e1bf64
|
||||
zh: 890f512cc1db5263
|
||||
/dsh-unified-corner-radius-standard/settings-card-materials:
|
||||
en: 126066f9c638433c
|
||||
zh: a7416d255f838b92
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ Distinguish these three arrangements before changing a child radius:
|
||||
| Fill flush against an enclosing edge | The enclosure owns the visible corner; clip the fill or inherit the matching corner | A split-button card with two independent hover regions |
|
||||
| Separate card or form group inside another surface | Choose the child's semantic tier; do not subtract all parent padding mechanically | R16 editor within an R20 settings card |
|
||||
|
||||
Standard menus use outer R16, 4px padding, and R12 items, including command selection, task menus, and the exposed highlights in subagent and background-job menus. Tree disclosure gutters retain their indentation; controls inside a filled job row keep their own compact geometry. Compact menus use outer R12, 4px padding, and R8 items. Shared `SegmentedControl` uses outer R12, 4px inset, and R8 segments/indicator; `SegmentedTabs` uses outer R16, 4px inset, and R12 segments/indicator. Keep indicator offsets, width calculations, submenu alignment, and pointer bridges consistent when changing padding.
|
||||
Standard menus use outer R16, 4px padding, and R12 items, including command selection, task menus, and the exposed highlights in the subagent switcher menu. Tree disclosure gutters retain their indentation. Compact menus use outer R12, 4px padding, and R8 items. Shared `SegmentedControl` uses outer R12, 4px inset, and R8 segments/indicator; `SegmentedTabs` uses outer R16, 4px inset, and R12 segments/indicator. Keep indicator offsets, width calculations, submenu alignment, and pointer bridges consistent when changing padding.
|
||||
|
||||
The radius subtraction is also the nominal sizing rule for nested superellipses. Equal exponents do not make them exact offset curves, so their diagonal gap may differ from the side inset. Keep the shared superellipse menu and segmented-control treatments; use circular arcs when strict equal radial spacing is required.
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ H 表示以 CSS 像素计、包含边框的设计外部高度。R 表示浏览
|
||||
| 底色紧贴容器边缘 | 由外框决定可见圆角;裁切底色或继承相应圆角 | 两个独立 hover 区域组成的分体按钮卡片 |
|
||||
| 容器内独立的卡片或表单组 | 按子元素用途选择档位;不机械减去全部父级内边距 | R20 设置卡片内的 R16 编辑器 |
|
||||
|
||||
标准菜单使用外层 R16、4px 内边距、R12 菜单项,包含命令选择、任务菜单,以及子会话和后台任务菜单的外露高亮区域。树形展开操作保留缩进;带底色任务行内的控件保留各自的紧凑几何。紧凑菜单使用外层 R12、4px 内边距、R8 菜单项。公共 `SegmentedControl` 使用外层 R12、4px 内缩、R8 分段和指示器;`SegmentedTabs` 使用外层 R16、4px 内缩、R12 分段和指示器。修改内边距时,同步保持指示器偏移、宽度计算、子菜单对齐与指针桥接区域一致。
|
||||
标准菜单使用外层 R16、4px 内边距、R12 菜单项,包含命令选择、任务菜单,以及子会话切换菜单的外露高亮区域。树形展开操作保留缩进。紧凑菜单使用外层 R12、4px 内边距、R8 菜单项。公共 `SegmentedControl` 使用外层 R12、4px 内缩、R8 分段和指示器;`SegmentedTabs` 使用外层 R16、4px 内缩、R12 分段和指示器。修改内边距时,同步保持指示器偏移、宽度计算、子菜单对齐与指针桥接区域一致。
|
||||
|
||||
半径相减也用于嵌套超级椭圆的名义尺寸关系。相同指数不意味着两条曲线严格等距,因此对角线间隙可能不同于侧边内缩。菜单与分段控件保留公共的超级椭圆样式;要求径向严格等距时使用圆弧。
|
||||
|
||||
|
||||
@@ -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/session-panel-entries/guide.md
|
||||
/:
|
||||
en: 9036df7633bfa9a8
|
||||
zh: 6509cb0a0a1d1d01
|
||||
/session-header-entries-move-into-the-session-panel:
|
||||
en: 8ac9f4ef04cd1f1b
|
||||
zh: 63cd71f51f8acd3e
|
||||
/session-header-entries-move-into-the-session-panel/change:
|
||||
en: b967d3f7d4292d8a
|
||||
zh: 46371550a5458694
|
||||
/session-header-entries-move-into-the-session-panel/migration:
|
||||
en: e87313ba54c260b4
|
||||
zh: 3147a7648d44dad2
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "Background jobs, subagents, and forge change requests move from the Session header and right sidebar into the Session panel, which removes the subagent footer slot and retires the forge tab type."
|
||||
---
|
||||
|
||||
# Session header entries move into the Session panel
|
||||
|
||||
English | [中文](guide.zh.md)
|
||||
|
||||
## Change
|
||||
|
||||
The Web and Desktop Session header used to show a background-jobs button, a subagents button whose menu ended with the `conversation.session.header.actions.subagent.footer` slot, and, with the forge bundle, a change requests button that opened the `forge-panel` right-sidebar tab. These entries now live in the [Session panel](../../../../packages/client/ui-session-panel/README.md) that the header toggle opens:
|
||||
|
||||
- [`dsh-client-ui-jobs`](../../../../packages/client/ui-jobs/README.md) and [`dsh-client-ui-subagent`](../../../../packages/client/ui-subagent/README.md) register Background jobs and Subagents sections; the subagent footer slot is removed, and the shared task board that filled it is now its own Shared tasks section.
|
||||
- [`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.md) registers a Change requests section, checkout and local changes rows in the Environment section, and an attention mark on the toggle. It no longer registers the `forge-panel` tab type, its tab title, or a `conversation.session.header.utilities` entry; the changes view keeps its `forge-changes` tab type.
|
||||
- In the forge changes extension API, `ctx.forgeChanges.kinds` keeps only `changes`, because `panel` named the retired tab type; the `forge.change-request.card.actions` slot keeps its owner props and renders on each card of the Change requests section, before the card's actions menu.
|
||||
- Type exports follow the components: `JobsSection*` replaces `JobListAction*`/`JobListInjected`, `SubagentsSection*` replaces `SubagentCatalogAction*`, and the forge `ChangeRequestsSection*`, `ChangeRequestsActions*`, `CheckoutRow*`, `LocalChangesRow*`, and `AttentionIndicator*` types replace `ForgeTab*`, `HeaderButton*`, and `LocalChangesCardProps`.
|
||||
|
||||
Client plugins and runtime extensions that register into the old footer slot, open the `forge-panel` tab type, read `ctx.forgeChanges.kinds.panel`, or import the removed types are affected. A right sidebar restored with a `forge-panel` tab no longer shows that tab. Session data and configuration keys are unchanged.
|
||||
|
||||
## Migration
|
||||
|
||||
1. In Client plugins and runtime extensions, replace every `conversation.session.header.actions.subagent.footer` registration with a `conversation.session.panel.section` registration that has its own `id`, `order`, and `label`, and remove child declarations of the old slot.
|
||||
2. Replace calls such as `ctx.sidebarRight.openTab('forge-panel')` and reads of `ctx.forgeChanges.kinds.panel` by asking the user to open the Session panel; to place content beside the change requests, register a `conversation.session.panel.section` entry, as the [Session panel README](../../../../packages/client/ui-session-panel/README.md) describes.
|
||||
3. Update type imports to the names listed under Change.
|
||||
4. Confirm the migration by running `pnpm run typecheck`, then opening a Session in Web, clicking the Session panel toggle in the header, and finding the content in its own section.
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "后台任务、子智能体与 forge 变更请求从会话标题栏和右侧边栏移入会话面板,子智能体页脚 slot 随之移除,forge 标签页类型退役。"
|
||||
---
|
||||
|
||||
# 会话标题栏入口移入会话面板
|
||||
|
||||
[English](guide.md) | 中文
|
||||
|
||||
## 变更
|
||||
|
||||
Web 与 Desktop 的会话标题栏此前显示后台任务按钮、子智能体按钮(其菜单末尾是 `conversation.session.header.actions.subagent.footer` slot),以及启用 forge 套件时打开 `forge-panel` 右侧边栏标签页的变更请求按钮。这些入口现在位于由标题栏开关打开的[会话面板](../../../../packages/client/ui-session-panel/README.zh.md)中:
|
||||
|
||||
- [`dsh-client-ui-jobs`](../../../../packages/client/ui-jobs/README.zh.md) 与 [`dsh-client-ui-subagent`](../../../../packages/client/ui-subagent/README.zh.md) 注册“后台任务”与“子智能体”分栏;子智能体页脚 slot 已移除,原来填充它的共享任务板现在是独立的“共享任务”分栏。
|
||||
- [`dsh-experimental-client-ui-forge`](../../../../packages/experimental/client-ui-forge/README.zh.md) 注册“变更请求”分栏、“环境”分栏中的检出行与本地变更行,以及开关上的提醒标记。它不再注册 `forge-panel` 标签页类型及其标题,也不再注册 `conversation.session.header.utilities` 条目;变更视图仍使用 `forge-changes` 标签页类型。
|
||||
- forge 变更视图扩展 API 中,`ctx.forgeChanges.kinds` 只保留 `changes`,因为 `panel` 指的是已退役的标签页类型;`forge.change-request.card.actions` slot 的 owner props 不变,改为渲染在“变更请求”分栏每张卡片的操作菜单之前。
|
||||
- 类型导出随组件改名:`JobsSection*` 取代 `JobListAction*`/`JobListInjected`,`SubagentsSection*` 取代 `SubagentCatalogAction*`,forge 的 `ChangeRequestsSection*`、`ChangeRequestsActions*`、`CheckoutRow*`、`LocalChangesRow*` 与 `AttentionIndicator*` 类型取代 `ForgeTab*`、`HeaderButton*` 与 `LocalChangesCardProps`。
|
||||
|
||||
注册到旧页脚 slot、打开 `forge-panel` 标签页类型、读取 `ctx.forgeChanges.kinds.panel` 或导入已移除类型的 Client 插件与运行时扩展会受影响。恢复右侧边栏时,`forge-panel` 标签页不再显示。Session 数据与配置键不变。
|
||||
|
||||
## 迁移
|
||||
|
||||
1. 在 Client 插件与运行时扩展中,把对 `conversation.session.header.actions.subagent.footer` 的注册改为带自己的 `id`、`order` 和 `label` 的 `conversation.session.panel.section` 注册,并移除旧 slot 的子 slot 声明。
|
||||
2. 把 `ctx.sidebarRight.openTab('forge-panel')` 之类的调用与对 `ctx.forgeChanges.kinds.panel` 的读取改为提示用户打开会话面板;如需在变更请求旁放置内容,按[会话面板 README](../../../../packages/client/ui-session-panel/README.zh.md) 的说明注册 `conversation.session.panel.section` 条目。
|
||||
3. 按“变更”中列出的名称更新类型导入。
|
||||
4. 运行 `pnpm run typecheck`,然后在 Web 中打开一个 Session,点击标题栏中的会话面板开关,在其独立分栏中找到这些内容,即确认迁移完成。
|
||||
@@ -15,8 +15,8 @@
|
||||
en: a7a78c6d1aeebeb3
|
||||
zh: 4bb69f32d8b05ba3
|
||||
/deepseek-ai-dsh-api-remotes/use-this-package:
|
||||
en: 5e5770cc1cbf49db
|
||||
zh: b9ee3c309d0cd93c
|
||||
en: d8622091b217f050
|
||||
zh: c36cb87f10e7802a
|
||||
/deepseek-ai-dsh-api-remotes/forwarded-host-events:
|
||||
en: 1dea001229f8c06a
|
||||
zh: 3acb1fa1c5d24f8c
|
||||
|
||||
@@ -29,7 +29,7 @@ Two-sided BFF for Host Remote capabilities selected by this application. The Hos
|
||||
|
||||
[`@deepseek-ai/dsh-api-session-controller`](../session-controller/README.md) owns Agent and Session identity policy, including the Typert lookup resolvers used by other namespaces. This package selects and mounts that generated Session contribution without a direct runtime dependency on `@deepseek-ai/dsh-session`; activation policy stays with Session Controller.
|
||||
|
||||
The Client assembly mounts Office conversion, Commands, Agent Teams, credentials, settings, Goal, Schedule, dynamic Cordis, file and Session references, read-only Host plugin inventory, plugin-installation registry response comparison, message feedback, permission presets, Session Controller, subagents, web provider list, and Workspace Controller contributions. The `permissionPresets` namespace returns the complete process-level catalog used by current-session controls. Cordis effect ownership withdraws every contribution when this assembly unloads, while `@deepseek-ai/dsh-api-gateway/client` owns descriptor validation, traced namespace Services, direct and scoped methods, invocation, streams, and cancellation. The Client entry consumes the shared `TypertClientRemote` interface through Cordis and does not import the concrete Gateway. It re-exports the Gateway Client face's declaration merges type-only, so a consumer reaching the forwarded-event vocabulary through this facade gains no runtime edge to the Gateway implementation.
|
||||
The Client assembly mounts Office conversion, Commands, Agent Teams, credentials, settings, Goal, Schedule, dynamic Cordis, file and Session references, read-only Host plugin inventory, plugin-installation registry response comparison, connector accounts, message feedback, permission presets, Session Controller, subagents, web provider list, and Workspace Controller contributions. The `permissionPresets` namespace returns the complete process-level catalog used by current-session controls. Cordis effect ownership withdraws every contribution when this assembly unloads, while `@deepseek-ai/dsh-api-gateway/client` owns descriptor validation, traced namespace Services, direct and scoped methods, invocation, streams, and cancellation. The Client entry consumes the shared `TypertClientRemote` interface through Cordis and does not import the concrete Gateway. It re-exports the Gateway Client face's declaration merges type-only, so a consumer reaching the forwarded-event vocabulary through this facade gains no runtime edge to the Gateway implementation.
|
||||
|
||||
This facade is also the front door for the wire type vocabulary a Client package names. It re-exports, type-only, the Remote failure vocabulary (`RemoteResult`, `RemoteFailure`, `RemoteErrorCode`, `RemoteErrorDetailsMap`), the Host facts (`RemoteHostFacts`), and each selected domain's client-safe payload types, so a Client feature package imports one specifier instead of reaching into `dsh-typert-protocol`, the Gateway, or an owner's Host entry. Two kinds of package deliberately skip this door: the API-layer packages this assembly itself selects — importing it back would close a dependency cycle — and their tests, which take the failure vocabulary from `dsh-typert-protocol` directly. A UI package's tests instead take the `RemoteError` constructor from [`dsh-client-test-runtime`](../../test-support/client-runtime/README.md).
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ kind: "package-reference"
|
||||
|
||||
[`@deepseek-ai/dsh-api-session-controller`](../session-controller/README.zh.md) 拥有 agent(智能体)与会话身份策略,包括供其他 namespace 使用的 Typert lookup 解析器。本包选择并挂载生成的会话 contribution,无需直接依赖 `@deepseek-ai/dsh-session` 的运行时;激活策略由会话控制器负责。
|
||||
|
||||
Client 组合挂载 Office 转换、Commands、Agent Teams、凭据、settings、Goal、Schedule、动态 Cordis、文件与会话引用、只读 Host 插件清单、插件安装源响应比较、消息反馈、权限预设、会话控制器、subagents、Web 提供方列表和 Workspace 控制器 contribution。`permissionPresets` namespace 返回 current-session 控件使用的完整进程级目录。该组合卸载时,Cordis effect 的所有权机制会撤回所有贡献;`@deepseek-ai/dsh-api-gateway/client` 负责描述符校验、可追踪的 namespace 服务、直接与作用域方法、调用、流与取消。Client 入口通过 Cordis 消费共享的 `TypertClientRemote` 接口,不导入具体 Gateway;它只以 type-only 形式重新导出 Gateway Client face 的声明合并,因此消费端经由本外观取到转发事件词汇时,运行时不会多出一条通往 Gateway 实现的边。
|
||||
Client 组合挂载 Office 转换、Commands、Agent Teams、凭据、settings、Goal、Schedule、动态 Cordis、文件与会话引用、只读 Host 插件清单、插件安装源响应比较、连接器账号、消息反馈、权限预设、会话控制器、subagents、Web 提供方列表和 Workspace 控制器 contribution。`permissionPresets` namespace 返回 current-session 控件使用的完整进程级目录。该组合卸载时,Cordis effect 的所有权机制会撤回所有贡献;`@deepseek-ai/dsh-api-gateway/client` 负责描述符校验、可追踪的 namespace 服务、直接与作用域方法、调用、流与取消。Client 入口通过 Cordis 消费共享的 `TypertClientRemote` 接口,不导入具体 Gateway;它只以 type-only 形式重新导出 Gateway Client face 的声明合并,因此消费端经由本外观取到转发事件词汇时,运行时不会多出一条通往 Gateway 实现的边。
|
||||
|
||||
本 facade 同时是 Client 包指称 wire 类型词汇的正门。它以 type-only 方式转出 Remote 失败词汇(`RemoteResult`、`RemoteFailure`、`RemoteErrorCode`、`RemoteErrorDetailsMap`)、Host 事实(`RemoteHostFacts`),以及各已选领域对 Client 安全的载荷类型,因此 Client 功能包只 import 一个 specifier,不必伸手进 `dsh-typert-protocol`、Gateway 或某个拥有方的 Host 入口。有两类包刻意不走这道门:本装配自己选中的 API 层包——反向 import 会形成依赖环——以及它们的测试,后者直接从 `dsh-typert-protocol` 取失败词汇。UI 包的测试则从 [`dsh-client-test-runtime`](../../test-support/client-runtime/README.zh.md) 取 `RemoteError` 构造器。
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
"@deepseek-ai/dsh-plugin-manager": "workspace:*",
|
||||
"@deepseek-ai/dsh-mcp-manager": "workspace:*",
|
||||
"@deepseek-ai/dsh-plugin-market": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-connector-account": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-plugin-manager": "workspace:*",
|
||||
"@deepseek-ai/dsh-office-kit": "workspace:*",
|
||||
"@deepseek-ai/dsh-deepseek-account": "workspace:*",
|
||||
|
||||
@@ -19,6 +19,7 @@ import pluginManagerRemote from '@deepseek-ai/dsh-plugin-manager/remote'
|
||||
import mcpManagerRemote from '@deepseek-ai/dsh-mcp-manager/remote'
|
||||
import toolResultsRemote from '@deepseek-ai/dsh-client-ui-trajectory/remote'
|
||||
import pluginRegistryProbeRemote from '@deepseek-ai/dsh-client-ui-plugin-manager/remote'
|
||||
import connectorAccountsRemote from '@deepseek-ai/dsh-client-ui-connector-account/remote'
|
||||
import pluginMarketRemote from '@deepseek-ai/dsh-plugin-market/remote'
|
||||
import pluginInventoryRemote from '@deepseek-ai/dsh-host-plugin-inventory/remote'
|
||||
import messageFeedbackRemote from '@deepseek-ai/dsh-message-feedback/remote'
|
||||
@@ -50,6 +51,7 @@ export type { McpManagedServerStatus, McpManagedServerView } from '@deepseek-ai/
|
||||
export type {} from '@deepseek-ai/dsh-plugin-manager/remote'
|
||||
export type {} from '@deepseek-ai/dsh-mcp-manager/remote'
|
||||
export type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/remote'
|
||||
export type {} from '@deepseek-ai/dsh-client-ui-connector-account/remote'
|
||||
export type {} from '@deepseek-ai/dsh-client-ui-trajectory/remote'
|
||||
export type {} from '@deepseek-ai/dsh-plugin-market/remote'
|
||||
export type {
|
||||
@@ -202,6 +204,7 @@ export async function apply(ctx: Context): Promise<() => Promise<void>> {
|
||||
productAnalyticsRemote, agentPresetsRemote, commandsRemote, agentTeamsRemote, settingsControllerRemote, accountRemote,
|
||||
goalsRemote, llmRemote, dynamicRemote, scheduleRemote,
|
||||
pluginInventoryRemote, pluginManagerRemote, mcpManagerRemote, pluginMarketRemote, pluginRegistryProbeRemote,
|
||||
connectorAccountsRemote,
|
||||
toolResultsRemote,
|
||||
messageFeedbackRemote, sessionFeedbackRemote,
|
||||
fileUploadsRemote, sessionReferencesRemote,
|
||||
|
||||
@@ -348,6 +348,11 @@
|
||||
- id: ui-plugin-manager
|
||||
name: '@deepseek-ai/dsh-client-ui-plugin-manager'
|
||||
|
||||
# Connector account sections on the Plugins page; CLI app plugins and MCP
|
||||
# connectors register their accounts with `ctx.connectorAccounts`.
|
||||
- id: ui-connector-account
|
||||
name: '@deepseek-ai/dsh-client-ui-connector-account'
|
||||
|
||||
- id: ui-conversation
|
||||
name: '@deepseek-ai/dsh-client-ui-conversation'
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
"@deepseek-ai/dsh-client-ui-brand-official": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-chat": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-commands": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-connector-account": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-context-menu": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-conversation": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-cordis": "workspace:*",
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
en: 1eb35b015a6c423f
|
||||
zh: a8a3dceee2c9e943
|
||||
/client-web-gui-browser-half/packages:
|
||||
en: 77ed389434202e77
|
||||
zh: b82d32cf95253760
|
||||
en: d358ff0c7eb9d370
|
||||
zh: 4eed67d9e3a5aef0
|
||||
/client-web-gui-browser-half/related-documentation:
|
||||
en: d1d506e68fab7333
|
||||
zh: 1a90fe6f3f8f24a9
|
||||
|
||||
@@ -84,6 +84,7 @@ The kernel packages boot and serve the page; the UI feature packages present it.
|
||||
| [`ui-settings-subagent/`](ui-settings-subagent/README.md) | Provides the Subagent settings page on the Plugins page | — |
|
||||
| [`ui-settings-web-search/`](ui-settings-web-search/README.md) | Provides the web search and fetch settings page on the Plugins page | — |
|
||||
| [`ui-plugin-manager/`](ui-plugin-manager/README.md) | Contributes the sidebar Plugins panel: install, enable, disable, retry, and compose installed packages | — |
|
||||
| [`ui-connector-account/`](ui-connector-account/README.md) | Holds the accounts connector plugins register on the Host and shows each bundle's account section, tag, activation prompt, confirmations, and notices on the Plugins page | `ctx.connectorAccounts` |
|
||||
| [`ui-entry-customization/`](ui-entry-customization/README.md) | Adds region-local More menus that pin or unpin plugin launchers and start a plugin draft | — |
|
||||
| [`ui-plugin-market/`](ui-plugin-market/README.md) | Contributes the Discover tab to the Plugins page: browse market indexes and install their bundles | — |
|
||||
| [`ui-deliverables/`](ui-deliverables/README.md) | Produces the changed-files card with its comparison tabs, delivery cards, and clickable final-response file references | — |
|
||||
|
||||
@@ -84,6 +84,7 @@ kind: "package-group"
|
||||
| [`ui-settings-subagent/`](ui-settings-subagent/README.zh.md) | 在插件页提供子智能体设置页 | — |
|
||||
| [`ui-settings-web-search/`](ui-settings-web-search/README.zh.md) | 在插件页提供网页搜索与获取设置页 | — |
|
||||
| [`ui-plugin-manager/`](ui-plugin-manager/README.zh.md) | 贡献侧栏的“插件”面板:安装、启用、停用、重试与组合已安装的包 | — |
|
||||
| [`ui-connector-account/`](ui-connector-account/README.zh.md) | 保存连接器插件在 Host 上注册的账号,并在插件页显示每个插件包的账号区块、标签、开启引导、确认和提示 | `ctx.connectorAccounts` |
|
||||
| [`ui-entry-customization/`](ui-entry-customization/README.zh.md) | 添加分区域的“更多”菜单,固定或收起插件入口,并开始创建插件的草稿 | — |
|
||||
| [`ui-plugin-market/`](ui-plugin-market/README.zh.md) | 为“插件”页面贡献“发现”标签页:浏览市场索引并安装其中的组合包 | — |
|
||||
| [`ui-deliverables/`](ui-deliverables/README.zh.md) | 生成改动文件卡片及其对比 tab、交付文件卡片与可点击的最终响应文件引用 | — |
|
||||
|
||||
@@ -3,29 +3,29 @@
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write packages/client/ui-agent-team/README.md
|
||||
/:
|
||||
en: cecfe90c9079279f
|
||||
zh: 58062db454093088
|
||||
en: 7dc6eba0f4471f92
|
||||
zh: 9fdf11a94995a75d
|
||||
/deepseek-ai-dsh-client-ui-agent-team:
|
||||
en: 39c47e6e926425bf
|
||||
zh: 0fd155c454355e3a
|
||||
/deepseek-ai-dsh-client-ui-agent-team/summary:
|
||||
en: 88103cec4c91d755
|
||||
zh: 6536e4307a5ce122
|
||||
en: f856eb1b0b6645d1
|
||||
zh: 91fa3b344ec21e66
|
||||
/deepseek-ai-dsh-client-ui-agent-team/table-of-contents:
|
||||
en: d152484eb41ac6b4
|
||||
zh: 09388d293f9be9cb
|
||||
/deepseek-ai-dsh-client-ui-agent-team/use-this-package:
|
||||
en: ffbcd39a17cd2fb1
|
||||
zh: db21ca6ca1cdf853
|
||||
en: a6f265f152ef528f
|
||||
zh: ad414805a2bda4a5
|
||||
/deepseek-ai-dsh-client-ui-agent-team/use-this-package/inspect-the-task-board:
|
||||
en: 2f606827b3ab14bc
|
||||
zh: 7f713d10268e7498
|
||||
en: 49312c9357e23060
|
||||
zh: ce1a9b52667977e8
|
||||
/deepseek-ai-dsh-client-ui-agent-team/understand-the-implementation:
|
||||
en: 24377b9e51d557de
|
||||
zh: 9205961784386745
|
||||
en: 34ad591d4c206d69
|
||||
zh: 0f6796c19f4ebfb8
|
||||
/deepseek-ai-dsh-client-ui-agent-team/further-exploration:
|
||||
en: 4d9214370681b02e
|
||||
zh: 4acb21b9ecf25e85
|
||||
en: 5bc48efe19557367
|
||||
zh: c00e5e1a75d0afa8
|
||||
/deepseek-ai-dsh-client-ui-agent-team/model-experience:
|
||||
en: 47ebeba07d72759d
|
||||
zh: 8fe8133f6dd845a9
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: "Inspect the shared task board from the Web conversation header."
|
||||
description: "Inspect the shared task board in the Web Session panel's Shared tasks section."
|
||||
kind: "package-reference"
|
||||
---
|
||||
|
||||
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
||||
|
||||
## Summary
|
||||
|
||||
This package displays shared tasks below the Subagent tree in one header panel. Host projection frames keep task state current without a refresh control. Ordinary subagent navigation owns the member list and teammate conversations. The Web bundle loads this package; it adds no model-facing input.
|
||||
This package adds the Shared tasks section to the Session panel, between Subagents and Background jobs. Host projection frames keep task state current without a refresh control. Ordinary subagent navigation owns the member list and teammate conversations. The Web bundle loads this package; it adds no model-facing input.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -25,7 +25,7 @@ This package displays shared tasks below the Subagent tree in one header panel.
|
||||
<a id="use-this-package"></a>
|
||||
## Use this package
|
||||
|
||||
In the root conversation’s model and reasoning menu, select **Agent teamwork** to open its settings pane, then turn on **Enable agent teamwork**. The root row shows the saved On/Off state without changing it. The settings pane shows the switch above the shared-task coordination, complex-task results, and token-cost explanation as ordinary text that describes the switch, without an information tooltip. Opening the pane focuses the enabled switch. New Sessions default to off. While enabled, open the root conversation’s Subagent control to see members above shared tasks. Child conversations keep subagent navigation without a task board or Team switch, including before their subagent address is discovered. The entry is hidden when both the subagent catalog and shared tasks are empty; catalog and task-record errors remain accessible. Section headers appear only when Team mode is enabled, at least one nondeleted shared task exists, and the task footer is available. In that case, the noncollapsible Subagents section remains above shared tasks even when its catalog is empty. Otherwise, the menu shows only subagent navigation, without section headers, a shared-task module, empty-state copy, or a divider. Turning it off retains tasks and subagents. The entire switch row highlights on hover and toggles the selection when clicked. The switch calls `remote.agentTeams.setEnabled`, waits for the saved projection and reports failures through the menu host; the row cannot toggle while locked or saving.
|
||||
In the root conversation’s model and reasoning menu, select **Agent teamwork** to open its settings pane, then turn on **Enable agent teamwork**. The root row shows the saved On/Off state without changing it. The settings pane shows the switch above the shared-task coordination, complex-task results, and token-cost explanation as ordinary text that describes the switch, without an information tooltip. Opening the pane focuses the enabled switch. New Sessions default to off. While enabled, open the root conversation’s Session panel to see members in the Subagents section and tasks in the Shared tasks section below it. Child conversations keep subagent navigation without a Team switch, including before their subagent address is discovered. The board reads the current Session’s `agentTeam` projection, so it appears only in a Session whose own projection is enabled. The Shared tasks section lists the tasks in progress first, then the pending ones, each in source order, then the completed ones with the latest in source order first, since a task carries no completion time. It shows five tasks and then the Session panel's fold control, “Show {count} more”, which shows the rest and then reads “Show less”; the list folds only when that holds back two tasks or more, and the choice holds for the Session, also after the panel is hidden and shown again. The section is hidden while the Session has no shared tasks and no task-record error, independently of the Subagents section. Turning it off retains tasks and subagents. The entire switch row highlights on hover and toggles the selection when clicked. The switch calls `remote.agentTeams.setEnabled`, waits for the saved projection and reports failures through the menu host; the row cannot toggle while locked or saving.
|
||||
|
||||
Turning off the menu switch requires confirmation after the Session records a model request; a model choice alone does not require it. The switch waits while request history is unavailable. The dialog explains the tool, coordination, and possible cache effects without deleting task records. Cancel, Escape, or closing the dialog leaves Team mode unchanged. Dismissing the dialog returns focus to the model selector. Confirmation targets the originating Session, waits for the save, and keeps failures visible for retry; it does not depend on the model menu remaining open. Team mode has no slash command; menu changes create no `command/run` or `command/done` records.
|
||||
|
||||
@@ -37,7 +37,7 @@ The [Web bundle](../../bundle/web-app/README.md) loads this package by default.
|
||||
|
||||
Ready pending tasks use idle, blocked pending tasks use warning, in-progress tasks use ongoing, and completed tasks use done.
|
||||
|
||||
The noncollapsible Shared tasks header uses a Checklist icon and completed, in-progress, and pending counts, with zero counts omitted and wording and separators matching the input task list. Compact read-only rows show the subject, status, and a chevron, with 13px primary titles and hover geometry aligned to subagent rows; expanded details use 12px text. Task rows use 7px vertical padding, 6px horizontal padding, and 7px gaps to align their clickable content with subagent rows. All task details start closed; opening one closes the previous task. Details show only the full description when present, followed by a single-line owner label and owner name in the same color with a 4px gap. Long owner names are ellipsized and reveal their full text in a tooltip only when clipped. Task-text and owner tooltips appear after 500ms of hover. Owners display the task's saved `ownerName`, such as `lead` or `reviewer/checker`, independently of loaded subagent catalogs. A task without `ownerName` displays its `ownerId`; a task without either field displays the localized unowned label. The shared menu is 360px wide with 6px outer padding, constrained to fit the viewport. Shared tasks have a 4px top margin rather than a divider. Both section headers keep a 7px icon/title gap and an additional 4px before their counts. Only the menu scrolls; task lists and details have no nested scrolling. Agents mutate tasks through tools; the panel provides no mutation controls. A projection failure appears separately above any retained tasks and remains visible when no tasks exist.
|
||||
The panel draws the section title, and the title control (`conversation.session.panel.section.actions`, key `shared-tasks`) shows completed, in-progress, and pending counts, with zero counts omitted and wording and separators matching the input task list. Compact read-only rows show the subject, status, and a chevron on one 28px line, with 13px primary titles; expanded details use 12px text and start at the title's edge. Resting the pointer on a collapsed row for 500ms opens a hover card with the full subject, the owner, the description, and the status. Task rows follow the panel's columns, like subagent rows: the status glyph's center 14px from the row start, titles at 30px, and the chevron's center 14px from the row end. All task details start closed; opening one closes the previous task. Details show only the full description when present, followed by a single-line owner label and owner name in the same color with a 4px gap. Long owner names are ellipsized and reveal their full text in a tooltip only when clipped. Owner tooltips appear after 500ms of hover. Owners display the task's saved `ownerName`, such as `lead` or `reviewer/checker`, independently of loaded subagent catalogs. A task without `ownerName` displays its `ownerId`; a task without either field displays the localized unowned label. The Session panel scrolls the board; task lists and details have no nested scrolling. Agents mutate tasks through tools; the panel provides no mutation controls. A projection failure appears separately above any retained tasks and remains visible when no tasks exist.
|
||||
|
||||
-----
|
||||
|
||||
@@ -47,15 +47,15 @@ The noncollapsible Shared tasks header uses a Checklist icon and completed, in-p
|
||||
<details>
|
||||
<summary>Implementation internals — click to expand</summary>
|
||||
|
||||
The Client export registers its locale dictionaries and subagent-catalog and model-menu slots through Cordis effects; it mounts no Remote namespace. The [model menu](../ui-model-selection/README.md#use-this-package) owns pane navigation and focus return; Team contributes the root summary through `conversation.input.model.options` and settings through `conversation.input.model.pane` with key `agent-team`. Disposing the plugin fiber removes its registrations.
|
||||
The Client export registers its locale dictionaries, its Session panel section with the title control, and its model-menu slots through Cordis effects; it mounts no Remote namespace. The [model menu](../ui-model-selection/README.md#use-this-package) owns pane navigation and focus return; Team contributes the root summary through `conversation.input.model.options` and settings through `conversation.input.model.pane` with key `agent-team`. Disposing the plugin fiber removes its registrations.
|
||||
|
||||
The Subagent catalog owns the shared panel, scrolling, hover, keyboard, and dismissal interactions. This package contributes the task section only below the root conversation’s tree. The board reads the current Session’s mode and tasks through `useProjection('agentTeam')`. An available, enabled projection supplies the task section only when it contains nondeleted tasks; a projection failure can render independently without a task section. Task IDs, dependencies, readiness, write scopes, and write scope warnings remain in task data but are not displayed as detail fields; blocked pending tasks still use the warning glyph.
|
||||
The Session panel owns showing, scrolling, and dismissing the section, which registers as `shared-tasks` at `order: 250`. The board reads the current Session’s mode and tasks through `useProjection('agentTeam')`. An available, enabled projection supplies the task section only when it contains nondeleted tasks; a projection failure can render independently without a task section. Task IDs, dependencies, readiness, write scopes, and write scope warnings remain in task data but are not displayed as detail fields; blocked pending tasks still use the warning glyph.
|
||||
|
||||
The [Chat visibility policy](../ui-chat/src/client/contract/chat-visibility.ts) hides only historical commands named `team` whose trimmed recorded arguments are exactly `on` or `off` and whose outcome is pending or successful. The remaining receipts use a localized running summary or preserve raw successful output, with a localized completed fallback when that text is empty. Rendering neither reads the current Team projection nor parses English outcome text. Filtering and localization affect only Chat presentation: command records, logs, trajectory, and raw errors remain unchanged.
|
||||
|
||||
| File | Role |
|
||||
|---|---|
|
||||
| [`src/client/mount.ts`](src/client/mount.ts) | Locale, catalog-section, and model-menu registrations |
|
||||
| [`src/client/mount.ts`](src/client/mount.ts) | Locale, Session panel section, and model-menu registrations |
|
||||
| [`src/client/TeamBoard.tsx`](src/client/TeamBoard.tsx) | Projection-derived task section |
|
||||
| [`src/client/locales.ts`](src/client/locales.ts) | Panel and command copy in eight languages |
|
||||
| [`src/index.ts`](src/index.ts) | Inert Host entry |
|
||||
@@ -69,7 +69,7 @@ The [Chat visibility policy](../ui-chat/src/client/contract/chat-visibility.ts)
|
||||
|
||||
- [Web bundle](../../bundle/web-app/README.md) — mounts the Client plugin by default.
|
||||
- [Agent Teams service](../../team/agent-team/README.md) — authoritative task and projection behavior.
|
||||
- [Conversation UI](../ui-conversation/README.md) — the stable header slot and addressed-subagent navigation surface.
|
||||
- [Session panel](../ui-session-panel/README.md) — hosts the Shared tasks section and draws its title.
|
||||
|
||||
-----
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: "从 Web 对话标题栏查看共享任务板。"
|
||||
description: "在 Web 会话面板的「共享任务」分栏中查看共享任务板。"
|
||||
kind: "package-reference"
|
||||
---
|
||||
|
||||
@@ -9,7 +9,7 @@ kind: "package-reference"
|
||||
|
||||
## 概述
|
||||
|
||||
此包在同一个页头面板中,将共享任务显示在 Subagent 树下方。Host 投影帧持续更新任务状态,无需刷新控件。普通 subagent(子智能体)导航负责成员列表和队友对话。Web bundle 默认加载此包;它不添加模型可见输入。
|
||||
此包为会话面板添加「共享任务」分栏,位于「子智能体」与「后台任务」之间。Host 投影帧持续更新任务状态,无需刷新控件。普通 subagent(子智能体)导航负责成员列表和队友对话。Web bundle 默认加载此包;它不添加模型可见输入。
|
||||
|
||||
## 目录
|
||||
|
||||
@@ -25,7 +25,7 @@ kind: "package-reference"
|
||||
<a id="use-this-package"></a>
|
||||
## 使用本包
|
||||
|
||||
在根会话的模型与推理等级菜单中选择**智能体团队协作**,进入二级设置面板后打开**开启智能体团队协作**。一级行显示已保存的开启/关闭状态,不改变选择。设置面板将开关放在共享任务协调、复杂任务效果与 token 开销的说明上方;说明使用普通正文,并作为开关的描述,不使用信息 tooltip。打开设置面板时聚焦可用的开关。新 Session 默认关闭。开启后,通过根会话的 Subagent 入口同时查看上方的成员树和下方的共享任务。子会话保留子智能体导航,不显示任务板或 Team 开关,包括尚未发现子代理地址时。子智能体目录和共享任务都为空时隐藏入口;目录或任务记录错误仍保留查看入口。仅当 Team 模式已开启、存在至少一个未删除的共享任务且任务 footer 可用时,才显示区域标题。此时即使目录为空,共享任务上方仍保留不可折叠的“子智能体”区域。其他情况下,菜单仅显示 subagent 导航,不显示区域标题、共享任务模块、空状态文案或分隔线。关闭后保留任务和子代理。开关所在整行在悬停时高亮,点击可切换状态。开关调用 `remote.agentTeams.setEnabled`,等待保存后的投影更新,失败由菜单宿主提示;锁定或保存中不能通过整行切换。
|
||||
在根会话的模型与推理等级菜单中选择**智能体团队协作**,进入二级设置面板后打开**开启智能体团队协作**。一级行显示已保存的开启/关闭状态,不改变选择。设置面板将开关放在共享任务协调、复杂任务效果与 token 开销的说明上方;说明使用普通正文,并作为开关的描述,不使用信息 tooltip。打开设置面板时聚焦可用的开关。新 Session 默认关闭。开启后,打开根会话的会话面板,即可在「子智能体」分栏查看成员,并在其下方的「共享任务」分栏查看任务。子会话保留子智能体导航,不显示 Team 开关,包括尚未发现子代理地址时。任务板读取当前 Session 的 `agentTeam` 投影,因此只在自身投影已开启的 Session 中显示。「共享任务」分栏先列进行中的任务,再列待处理的任务,各按任务原顺序;最后是已完成的任务,原顺序靠后的在前,因为任务没有完成时间。它只显示五个任务,然后是会话面板的收起控件「显示其余 {count} 个」,点击后显示其余的任务并变为「收起」;只有能收起两个及以上任务时列表才收起,这个选择在 Session 内保持,隐藏后再次显示面板也不变。会话没有共享任务且没有任务记录错误时,隐藏「共享任务」分栏,与「子智能体」分栏互不影响。关闭后保留任务和子代理。开关所在整行在悬停时高亮,点击可切换状态。开关调用 `remote.agentTeams.setEnabled`,等待保存后的投影更新,失败由菜单宿主提示;锁定或保存中不能通过整行切换。
|
||||
|
||||
会话记录过模型请求后,从菜单开关关闭团队需要确认;仅选择模型不会触发确认。请求历史尚未加载时,开关暂不可操作。弹窗说明工具、协作与可能的缓存影响,不会删除任务记录。取消、按 Escape 或关闭弹窗都保持团队状态不变。弹窗关闭后,焦点回到模型选择按钮。确认操作绑定到最初的会话,等待保存完成,失败时保留错误供重试,不依赖模型菜单保持打开。Team 模式没有斜杠命令;菜单切换不会生成 `command/run` 或 `command/done` 记录。
|
||||
|
||||
@@ -37,7 +37,7 @@ Chat 隐藏历史 `/team on` 和 `/team off` 记录中尚未完成或执行成
|
||||
|
||||
可开始的 pending 任务使用 idle 灰点,被依赖阻塞的 pending 任务使用 warning 橙点,in-progress 任务使用 ongoing loading,completed 任务使用 done 绿点。
|
||||
|
||||
不可折叠的“共享任务”标题使用 Checklist 图标,并显示已完成、进行中和待处理数量;省略零值,文案和分隔符与输入区任务列表一致。紧凑只读行显示主题、状态和展开箭头,13px 主标题与悬停区域对齐子智能体行;展开详情使用 12px 文字。任务行使用 7px 垂直内边距、6px 水平内边距和 7px 间距,使可点击内容与 subagent 行对齐。所有任务详情初始关闭,打开一项会关闭上一项。详情仅显示完整描述(如有),下方以单行显示负责人标签和负责人名称,两者使用相同颜色,间距为 4px。过长的负责人名称以省略号截断,仅在被截断时通过工具提示显示完整内容。任务文字和负责人的工具提示在悬停 500ms 后显示。负责人显示任务保存的 `ownerName`,例如 `lead` 或 `reviewer/checker`,不依赖已加载的 subagent 目录。缺少 `ownerName` 时显示 `ownerId`;两个字段都没有时显示本地化的无负责人标签。共享菜单宽度为 360px,外层内边距为 6px,并受视口可用宽度约束。共享任务上方保留 4px 外边距,不显示分隔线。两个区域标题均保留 7px 图标与文字间距,并在统计数量前额外留出 4px。仅菜单本身滚动,任务列表与详情不单独滚动。Agent 通过工具修改任务;面板不提供修改控件。投影失败以独立警告显示在保留的任务上方,即使没有任务也保持可见。
|
||||
分栏标题由面板绘制,标题控件(`conversation.session.panel.section.actions`,键为 `shared-tasks`)显示已完成、进行中和待处理数量;省略零值,文案和分隔符与输入区任务列表一致。紧凑只读行在 28px 的一行中显示主题、状态和展开箭头,主标题 13px;展开详情使用 12px 文字,并从标题边缘开始。指针在收起的行上停留 500ms 后,悬停卡片显示完整主题、负责人、描述和状态。任务行与子智能体行一样遵循面板的列:状态图标中心距行起始 14px,标题从 30px 开始,箭头中心距行末端 14px。所有任务详情初始关闭,打开一项会关闭上一项。详情仅显示完整描述(如有),下方以单行显示负责人标签和负责人名称,两者使用相同颜色,间距为 4px。过长的负责人名称以省略号截断,仅在被截断时通过工具提示显示完整内容。负责人的工具提示在悬停 500ms 后显示。负责人显示任务保存的 `ownerName`,例如 `lead` 或 `reviewer/checker`,不依赖已加载的 subagent 目录。缺少 `ownerName` 时显示 `ownerId`;两个字段都没有时显示本地化的无负责人标签。会话面板负责任务板滚动,任务列表与详情不单独滚动。Agent 通过工具修改任务;面板不提供修改控件。投影失败以独立警告显示在保留的任务上方,即使没有任务也保持可见。
|
||||
|
||||
-----
|
||||
|
||||
@@ -47,15 +47,15 @@ Chat 隐藏历史 `/team on` 和 `/team off` 记录中尚未完成或执行成
|
||||
<details>
|
||||
<summary>实现细节——点击展开</summary>
|
||||
|
||||
Client export 通过 Cordis effect 注册语言字典、子代理目录与模型菜单 slot;它不挂载 Remote namespace。[模型菜单](../ui-model-selection/README.zh.md#use-this-package)负责面板导航和焦点返回;Team 通过 `conversation.input.model.options` 提供一级摘要,并通过 `conversation.input.model.pane` 的 `agent-team` 键提供设置内容。销毁插件 fiber 会移除这些注册。
|
||||
Client export 通过 Cordis effect 注册语言字典、带标题控件的会话面板分栏与模型菜单 slot;它不挂载 Remote namespace。[模型菜单](../ui-model-selection/README.zh.md#use-this-package)负责面板导航和焦点返回;Team 通过 `conversation.input.model.options` 提供一级摘要,并通过 `conversation.input.model.pane` 的 `agent-team` 键提供设置内容。销毁插件 fiber 会移除这些注册。
|
||||
|
||||
Subagent 目录负责共享面板的滚动、悬停、键盘和关闭交互。本包仅在根会话的树下方提供任务区。任务板通过 `useProjection('agentTeam')` 读取当前 Session 的模式与任务;仅当投影可用、已开启且含有未删除的任务时才显示任务区;投影错误可独立显示,不需要任务区。任务 ID、依赖、准备状态、写入范围及其提示仍保留在任务数据中,但不作为详情字段显示;被依赖阻塞的 pending 任务仍使用 warning 图标。
|
||||
会话面板负责分栏的显示、滚动和关闭;分栏注册为 `shared-tasks`,`order: 250`。任务板通过 `useProjection('agentTeam')` 读取当前 Session 的模式与任务;仅当投影可用、已开启且含有未删除的任务时才显示任务区;投影错误可独立显示,不需要任务区。任务 ID、依赖、准备状态、写入范围及其提示仍保留在任务数据中,但不作为详情字段显示;被依赖阻塞的 pending 任务仍使用 warning 图标。
|
||||
|
||||
[Chat 可见性策略](../ui-chat/src/client/contract/chat-visibility.ts) 仅隐藏名称为 `team`、已记录参数去除首尾空白后恰为 `on` 或 `off`,且尚未完成或执行成功的历史命令。其余回执在执行中显示本地化摘要,成功时保留原始结果文本,文本为空则使用本地化的完成提示。渲染既不读取当前 Team 投影,也不解析英文结果文案。过滤与本地化仅影响 Chat 展示:命令记录、日志、轨迹和原始错误均保持不变。
|
||||
|
||||
| 文件 | 职责 |
|
||||
|---|---|
|
||||
| [`src/client/mount.ts`](src/client/mount.ts) | 语言字典、目录任务区和模型菜单注册 |
|
||||
| [`src/client/mount.ts`](src/client/mount.ts) | 语言字典、会话面板分栏和模型菜单注册 |
|
||||
| [`src/client/TeamBoard.tsx`](src/client/TeamBoard.tsx) | 从投影派生的任务区 |
|
||||
| [`src/client/locales.ts`](src/client/locales.ts) | 八种语言的面板与命令文案 |
|
||||
| [`src/index.ts`](src/index.ts) | 不执行行为的 Host entry |
|
||||
@@ -69,7 +69,7 @@ Subagent 目录负责共享面板的滚动、悬停、键盘和关闭交互。
|
||||
|
||||
- [Web bundle](../../bundle/web-app/README.zh.md)——默认挂载本 Client plugin。
|
||||
- [Agent Teams 服务](../../team/agent-team/README.zh.md) — 任务和投影行为的权威来源。
|
||||
- [会话 UI](../ui-conversation/README.zh.md)——稳定 header slot 与 addressed-subagent 导航表层。
|
||||
- [会话面板](../ui-session-panel/README.zh.md)——承载「共享任务」分栏并绘制其标题。
|
||||
|
||||
-----
|
||||
|
||||
|
||||
Loaded 100 of 374 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user