Merge remote-tracking branch 'origin/master' into feat/session-workspace-root
master moved the `workingDirectory` projection-key declaration to `src/types.ts`; this branch's `workspaceRoot` key follows it there. The three recorded scenarios master added (`session-list-tools`, `computer-use-cua-driver-mcp-ptc`, `sdk/subagent-dsh-sdk-empty-route`) drop the removed `working_directory` tool and the delegation `cwd` parameter from their sidecars.
This commit is contained in:
commit
23734da2b6
763 files changed
+23895
-10244
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: cb337f04d0fe41b5
|
||||
zh: d9dc249507c419b6
|
||||
en: 5d2dc730467e4bf3
|
||||
zh: 4aca28691504cd7b
|
||||
/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 服务作为插件页中默认禁用的一个条目发布。
|
||||
|
||||
评审与工作树控件服务于同一个代码修改流程。统一插件入口让用户可以一次启用这些能力,无需根据底层包的拆分判断应该开启哪张卡片。包与两套工作树服务仍保持独立,分别负责会话开始前和对话中创建工作树的流程。
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Bilingual-pair consistency record for 2026-11-05-session-panel.md (docs/i18n/README.md): per heading
|
||||
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-11-05-session-panel.md
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter:
|
||||
en: 1dc9957a0c9336e0
|
||||
zh: 88d41c8490c2710c
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/problem:
|
||||
en: c69d9843bc6f0b87
|
||||
zh: c31bb1b2b4d9b781
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision:
|
||||
en: c2ddf417ea56b626
|
||||
zh: 44c30091ade7e5bf
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/docking-follows-the-transcript-gutter:
|
||||
en: 8a97ac8ac0b40d0c
|
||||
zh: d42fe9c23b9dcd79
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/decision/sections-are-registrations-the-panel-draws-titles:
|
||||
en: 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
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/alternatives-considered:
|
||||
en: 6adaf7a36da05668
|
||||
zh: c0ace7297995d764
|
||||
/agent-note-session-panel-in-the-chat-view-s-end-gutter/consequences:
|
||||
en: 0b6e547a08c042bc
|
||||
zh: 154a69e3f54692cd
|
||||
@@ -0,0 +1,52 @@
|
||||
# Agent Note: Session panel in the Chat View's end gutter
|
||||
|
||||
Status: implemented
|
||||
|
||||
English | [中文](2026-11-05-session-panel.zh.md)
|
||||
|
||||
## Problem
|
||||
|
||||
Facts about the current Session — its project directory, the change requests it opened, and later its outputs — had no common home. Each owner added its own Session header button and, for anything larger than a menu, a right-sidebar tab: the forge change requests are one such tab. A sidebar tab takes width from the transcript while it shows, shows one tab at a time, and leaves the facts one click away from every message. The required surface is a summary the user can keep beside the conversation without covering it, that several plugins fill independently, that hides when there is no room, and that the user can show or hide from the Session header.
|
||||
|
||||
## Decision
|
||||
|
||||
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.md) adds a Session header toggle (`conversation.session.header.utilities`, order −10) and a floating panel that occupies `conversation.chat.aside`, a slot that [`ui-chat`](../../../../packages/client/ui-chat/README.md#scroll-ownership) renders in the Chat View beside the turn rail. The aside is a zero-height layer at the top of the Chat frame and, like the turn rail, is sticky inside the shared scrollport: the panel does not scroll with the transcript, inherits the scrollport's composer and viewport heights, and needs no seat in the Conversation shell. Views other than Chat show no panel.
|
||||
|
||||
### Docking follows the transcript gutter
|
||||
|
||||
The panel docks only while the gutter between the transcript column and the Chat frame's end edge can hold it (348px: 40px clear of the column and its width handle, a 300px minimum width, and an 8px margin). The gutter, not the viewport width, decides because the column width is adaptive and user-draggable and the right sidebar shares the frame: the same viewport can leave 75px or 600px. The Chat View owns the frame and the transcript column, so its aside layer publishes the gutter as the `--dsh-chat-aside-gutter` custom property, and the panel's stylesheet sizes the docked panel from it.
|
||||
|
||||
Script still needs the decision, because docked and overlay differ in behavior and not only in size: the toggle reports `aria-expanded` truthfully and knows whether a press flips docking or opens the overlay, the overlay closes on Escape and on outside presses and returns focus, and an open overlay closes once the panel can dock. A CSS-only container query cannot tell an element outside the Chat View, or a listener, any of that. The stylesheet therefore computes the decision as well: each mounted panel renders a zero-height dock probe that is 1px wide from the gutter that holds the panel's minimum width and 0 below it, derived from the same metrics as the docked width, and the plugin observes only that probe. It hears the decision flip; observing the frame and the transcript column would call back on every frame of a streamed reply, because the column's height changes with its content, and on every step of a window resize. A Session has room to dock while any of its probes does, and a Session without a probe shows no Chat View. The toggle and the panel decide the presentation with the same pure function. While no Chat View shows the Session, as in the trajectory View, the toggle is unavailable and its tooltip asks for the Chat view; `ui-conversation` keeps View selection inside its shell, so the toggle does not switch Views itself.
|
||||
|
||||
Docking follows one persisted preference shared by every Session and defaults to on. Without room, a press opens a transient overlay for that Session above the transcript; it never changes the preference, and it closes once its gutter can dock the panel or no Chat View shows the Session any longer, so it never reappears on its own. The panel state follows the reported gutter of the open overlay's Session. A panel withdraws its report when it unmounts or its Chat View moves to another Session, in a layout-effect cleanup kept apart from the gutter update, so a changed gutter never reads as an unmount. Hiding automatically and overlaying on request keeps the transcript uncovered without making the facts unreachable on laptop widths.
|
||||
|
||||
### Sections are registrations; the panel draws titles
|
||||
|
||||
Each section is one list registration with `id`, `order`, and a required `label`. The panel projects the live registrations into titles, draws each title, and renders the section body with `renderSlot(..., { only: id })`; a CSS `:has()` rule hides a section whose body rendered nothing, so a section opts out by rendering nothing and no effect reports visibility to the owner. Trailing title controls are a keyed slot addressed by the section `id`, and a section that several plugins share declares its own row slot, as the built-in Environment section does with `conversation.session.panel.environment.row`. Marks that must stay visible while the panel is hidden go in an indicator list over the toggle.
|
||||
|
||||
Rows from every contributor share one look through the panel's stylesheet instead of a shared component: each contributor writes its row's markup and marks the parts, and the panel lays them out, so icon, text, and trailing areas align across packages. A shared row component would receive each contributor's icon, text, and controls as React nodes in props, which the client rules forbid, and a feature package cannot share its own row component with another feature package.
|
||||
|
||||
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.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- **A seat in `conversation.content`.** Rejected: it made `ui-conversation` render the panel beside the width handles and outside the scrollport, have its width controls measure the gutter into a per-Session `ctx.uiConversation.layouts` source, and move the composer and viewport height variables from the scrollport to the content body so the seat could read them. The Conversation shell would carry geometry and variable placement for one feature, while chrome that must not scroll can sit sticky inside the scrollport as the turn rail does, and the Chat View already owns the column it would measure.
|
||||
- **A right-sidebar tab.** It already exists for change requests, but it narrows the transcript while shown, shows one tab at a time, and the [UI guidance](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding) reserves the sidebar for content opened on demand rather than a resident summary.
|
||||
- **The dock kit's floating window.** `FloatLayer` windows are draggable, resizable, and positioned in viewport coordinates; a summary anchored to the transcript gutter needs none of that and would have to fight the window's own placement rules.
|
||||
- **Viewport-width breakpoints.** The transcript width is adaptive and draggable and the right sidebar takes a variable track, so a viewport breakpoint either covers the transcript or hides the panel with room to spare.
|
||||
- **CSS-only hiding with a click-time read.** A container query on the gutter can hide the docked panel, and the toggle could read the computed result when pressed, as the background-job trigger does. The toggle would still render without knowing whether the panel shows, so `aria-expanded` and its tooltip would be wrong whenever the preference says dock but the gutter is too narrow.
|
||||
- **Squeezing the transcript to make room.** Docking on laptop widths by moving the transcript column aside changes the centered column, the composer, and both width handles; it remains a separate layout decision.
|
||||
- **A Session-scoped standard hook for the gutter.** Adding a hook to every Session-scoped Slot would make every component fixture in the client restate it; the docking decision has two readers, the panel and the toggle, and both read it from the plugin's own state.
|
||||
|
||||
## Consequences
|
||||
|
||||
- With the default transcript width, which stops at 880px, the body must be 1576px wide to dock, so laptop widths use the overlay; the panel never covers the transcript unless the user opens it.
|
||||
- Sections from independent plugins share one surface, ordering, and title style without depending on each other, and an occupied section id can be replaced by a higher-priority registration.
|
||||
- `ui-chat` gained one slot and one custom property on its layer and observes nothing for them. Each mounted panel adds one `ResizeObserver` on its dock probe, which calls back only when the docking decision flips. `ui-conversation` caps the default transcript width at 880px.
|
||||
- The panel shows only in Chat Views; elsewhere the toggle stays in the header, unavailable. Every Chat View occurrence renders the aside, so a Session shown in the main body and in an embedded Conversation at once shows its overlay in both.
|
||||
- The turn rail's position changed for every user; its behavior and hiding rule did not.
|
||||
- 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.
|
||||
@@ -0,0 +1,52 @@
|
||||
# Agent Note: 停靠在 Chat 视图末端留白的会话面板
|
||||
|
||||
Status: implemented
|
||||
|
||||
[English](2026-11-05-session-panel.md) | 中文
|
||||
|
||||
## Problem
|
||||
|
||||
与当前会话相关的信息(项目目录、它开出的变更请求,以及之后的产物)没有统一的位置。各自的拥有者分别加会话标题栏按钮,内容一多就再开一个右侧栏标签页,forge 的变更请求就是这样一个标签页。侧栏标签页显示时占用正文宽度,一次只显示一个,而且每条消息之外都要多点一次才能看到。需要的界面是:可以放在对话旁边常驻而不遮挡正文;多个插件各自填充;没有空间时自动隐藏;用户可以从会话标题栏显示或隐藏。
|
||||
|
||||
## Decision
|
||||
|
||||
[`dsh-client-ui-session-panel`](../../../../packages/client/ui-session-panel/README.zh.md) 新增一个会话标题栏开关(`conversation.session.header.utilities`,order −10)和一块悬浮面板,面板占用 `conversation.chat.aside`:这是 [`ui-chat`](../../../../packages/client/ui-chat/README.zh.md#scroll-ownership) 在 Chat 视图中、轮次轨道旁渲染的 slot。侧边层是 Chat 外框顶部的零高度图层,与轮次轨道一样在共享滚动容器内 sticky 定位:面板不随正文滚动,继承滚动容器的输入框区域与视口高度,也不需要 Conversation 外壳提供落位。Chat 以外的视图不显示面板。
|
||||
|
||||
### 停靠取决于正文留白
|
||||
|
||||
只有正文列到 Chat 外框末端边缘的留白放得下面板时才停靠(348px:与正文列及其宽度拖拽条保持 40px,最小宽度 300px,外加 8px 边距)。判断依据是留白而不是视口宽度,因为正文列宽度可自适应、可由用户拖拽,右侧栏也会占用框架宽度:同一个视口可能只剩 75px,也可能有 600px。Chat 视图持有外框和正文列,因此由它的侧边层把留白发布为自定义属性 `--dsh-chat-aside-gutter`,面板的样式表据此决定停靠宽度。
|
||||
|
||||
脚本仍然需要知道这个判断,因为停靠与浮层的差别不只在尺寸,还在行为:开关要如实报告 `aria-expanded`,也要知道按下后是切换停靠还是打开浮层;浮层在按 Esc 或在外部按下时关闭并归还焦点;面板可以停靠后,已打开的浮层要关闭。纯 CSS 的容器查询无法把这些告诉 Chat 视图之外的元素或事件监听器。因此样式表把判断也一并算出:每个已挂载的面板渲染一个零高度的停靠探针,它从放得下面板最小宽度的留白起宽 1px,更窄时宽度为 0,与停靠宽度出自同一组尺寸,插件只观察这个探针。这样插件只在判断翻转时收到通知;如果改为观察外框和正文列,流式回答的每一帧都会回调(正文列的高度随内容变化),窗口缩放的每一步也会回调。会话的任一探针有空间时该会话就可以停靠,没有探针的会话表示没有 Chat 视图在显示它。开关和面板用同一个纯函数决定呈现方式。没有 Chat 视图显示该会话时(例如在轨迹视图中),开关不可用,悬停提示请用户切到「对话」视图;`ui-conversation` 把视图选择留在其外壳内部,因此开关不自行切换视图。
|
||||
|
||||
停靠遵循所有会话共用的一个持久化偏好,默认开启。没有空间时,按下开关会为该会话在正文上方打开临时浮层;它从不改变偏好;该会话的留白可以停靠面板,或不再有 Chat 视图显示该会话时,浮层关闭,因此不会自己重新出现。面板状态跟随打开浮层的会话所上报的留白。面板卸载或其 Chat 视图换到另一个会话时撤回上报;撤回放在与留白更新分开的 layout effect 清理中,因此留白变化永远不会被当成卸载。自动隐藏加按需浮层,既保证正文不被遮挡,也让笔记本宽度下的信息依然可达。
|
||||
|
||||
### 分栏是注册项;面板绘制标题
|
||||
|
||||
每个分栏是一次 list 注册,带 `id`、`order` 和必填的 `label`。面板把实时注册投影成标题并逐个绘制,再用 `renderSlot(..., { only: id })` 渲染分栏正文;CSS `:has()` 规则隐藏正文没有渲染内容的分栏,因此分栏不渲染任何内容即可退出,不需要 effect 向拥有者上报可见性。标题尾部控件是以分栏 `id` 为键的 keyed slot;多个插件共用的分栏声明自己的行 slot,内置「环境」分栏就以 `conversation.session.panel.environment.row` 这样做。面板隐藏时也要可见的标记放进开关上的角标列表。
|
||||
|
||||
各贡献方的行通过面板的样式表共享同一外观,而不是共享组件:各贡献方自己写行的标记并标出各个部分,由面板统一排版,使不同包的图标、文字与尾部区域对齐。共享的行组件要把各贡献方的图标、文字和控件作为 React 节点从 props 传入,这是客户端规则禁止的;功能包之间也不能共享各自的行组件。
|
||||
|
||||
分栏的列表每个分组只显示五行,然后是一个收起控件;否则子智能体、共享任务或后台任务很多的会话会把后面的分栏挤出面板的高度。每个列表按顺序排列,使被收起的是最不需要看的行:运行中的在前,然后是最近的;共享任务没有时间信息,则未完成的排在已完成的前面。收起控件是面板唯一以 Component Factory 提供的行,即 `conversation.session.panel.fold`:它在每个分栏里都一样,只接收数据和一个回调,而收起状态和显示哪些行由各分栏自己决定。
|
||||
|
||||
### 轮次轨道位于起始边
|
||||
|
||||
轮次轨道连同刻度、焦点环和预览位于滚动容器的起始边,末端留白留给停靠面板;它的 900px 隐藏规则保证旁边有足够空间容纳起始侧的宽度拖拽条。
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- **落位在 `conversation.content`。** 已否决:这种做法让 `ui-conversation` 在宽度拖拽条旁、滚动容器之外渲染面板,由宽度控件把留白测量结果写入按会话划分的 `ctx.uiConversation.layouts` source,并把输入框区域与视口高度变量从滚动容器挪到正文容器上,使落位能读到它们。Conversation 外壳因此要为单个功能承担几何测量和变量位置;而不随滚动的界面元素可以像轮次轨道那样在滚动容器内 sticky 定位,要测量的正文列也本来就归 Chat 视图所有。
|
||||
- **右侧栏标签页。** 变更请求已有这种实现,但它显示时会压窄正文,一次只显示一个标签页,而且 [UI 指南](../../../skills/dsh-client-ui-ux/SKILL.md#reuse-before-adding)把侧栏留给按需打开的内容,而不是常驻摘要。
|
||||
- **dock kit 的悬浮窗。** `FloatLayer` 窗口可拖拽、可缩放、按视口坐标定位;锚定在正文留白的摘要用不上这些能力,还要对抗窗口自身的定位规则。
|
||||
- **按视口宽度断点。** 正文宽度自适应、可拖拽,右侧栏占用可变宽度,视口断点要么遮挡正文,要么在空间充足时也隐藏面板。
|
||||
- **纯 CSS 隐藏加点击时读取。** 对留白做容器查询可以隐藏停靠面板,开关在按下时读取计算结果,与后台任务按钮的做法相同。但开关渲染时仍不知道面板是否显示,偏好为停靠而留白不足时,`aria-expanded` 与提示文字都会出错。
|
||||
- **挤压正文腾出空间。** 在笔记本宽度下把正文列移开来停靠,会改变居中的正文列、composer 和两侧宽度拖拽条;这仍是另一项布局决策。
|
||||
- **会话作用域标准 hook。** 给每个会话作用域 Slot 增加一个留白 hook,会让客户端所有组件测试夹具都要补上它;停靠判断只有两个读取方,即面板和开关,两者都从插件自己的状态读取。
|
||||
|
||||
## Consequences
|
||||
|
||||
- 默认正文宽度最多 880px,此时对话区要 1576px 宽才能停靠,因此笔记本宽度使用浮层;除非用户主动打开,面板不会遮挡正文。
|
||||
- 独立插件的分栏共享同一界面、排序和标题样式,彼此不依赖;已占用的分栏 id 可以被更高优先级的注册替换。
|
||||
- `ui-chat` 多了一个 slot,侧边层多了一个自定义属性,但不为它们观察任何尺寸。每个已挂载的面板在停靠探针上多一个 `ResizeObserver`,只在停靠判断翻转时回调。`ui-conversation` 把默认正文宽度上限定为 880px。
|
||||
- 面板只出现在 Chat 视图中;其他视图下开关仍在标题栏中,但不可用。每个 Chat 视图实例都会渲染侧边层,因此同一会话同时显示在主正文区和嵌入的对话中时,两处都会显示浮层。
|
||||
- 轮次轨道的位置对所有用户都变了;行为和隐藏规则不变。
|
||||
- 变更请求、后台任务和子智能体成为分栏,取代变更请求侧边栏标签页、其起始页入口,以及标题栏中的后台任务和子智能体控件;标题栏仍为子会话保留子智能体面包屑切换器。分栏只在面板显示时挂载,因此需要在隐藏面板后保留的状态(例如已清空的任务行)放在按会话划分的 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 })
|
||||
@@ -143,9 +143,7 @@ function createProfileLifecycleFixture(): ProfileLifecycleFixture {
|
||||
writeFileSync(join(profileDir, 'cordis.patch.yml'), '[]\n')
|
||||
const linkTarget = join(profileDir, 'node_modules', 'dsh-lifecycle-bundle')
|
||||
mkdirSync(join(profileDir, 'node_modules'), { recursive: true })
|
||||
try {
|
||||
rmSync(linkTarget, { recursive: true, force: true })
|
||||
} catch { /* fresh dir */ }
|
||||
rmSync(linkTarget, { recursive: true, force: true })
|
||||
// Copy-free: a package.json redirecting via a relative main is enough for require.resolve.
|
||||
mkdirSync(linkTarget, { recursive: true })
|
||||
for (const file of ['package.json', 'cordis.patch.yml', 'plugin.mjs']) {
|
||||
|
||||
+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"}}}
|
||||
|
||||
@@ -142,14 +142,15 @@ export function Welcome({ api }: { api: WelcomeApi }) {
|
||||
if (cancelling || attemptRef.current === null) return
|
||||
setCancelling(true)
|
||||
const current = ++revision.current
|
||||
let state: AccountView | undefined
|
||||
try {
|
||||
const state = await api.cancelSignIn(attemptRef.current.id)
|
||||
if (mounted.current && revision.current === current) showAccount(state)
|
||||
} catch {
|
||||
state = await api.cancelSignIn(attemptRef.current.id)
|
||||
} catch (_cancelFailed) {
|
||||
// The current attempt remains visible so cancellation can be retried.
|
||||
} finally {
|
||||
if (mounted.current) setCancelling(false)
|
||||
}
|
||||
if (state !== undefined && mounted.current && revision.current === current) showAccount(state)
|
||||
}
|
||||
async function copyLink() {
|
||||
const current = attemptRef.current
|
||||
|
||||
@@ -15,17 +15,18 @@ if (process.isMainFrame && location.origin === allowedOrigin) {
|
||||
try { listener(value) } catch (error) { console.error('Platform locale listener failed', error) }
|
||||
}
|
||||
})
|
||||
let value: unknown
|
||||
try {
|
||||
const value: unknown = ipcRenderer.sendSync(PLATFORM_IPC.bootstrap)
|
||||
if (typeof value === 'object' && value !== null && 'token' in value && 'origin' in value
|
||||
&& typeof value.token === 'string' && value.token.length > 0 && value.origin === location.origin
|
||||
&& 'locale' in value && (value.locale === 'en_US' || value.locale === 'zh_CN')) {
|
||||
token = value.token
|
||||
locale = value.locale
|
||||
}
|
||||
} catch {
|
||||
value = ipcRenderer.sendSync(PLATFORM_IPC.bootstrap)
|
||||
} catch (_bootstrapFailed) {
|
||||
// Initialization failure retains embedded mode so Platform cannot use browser credentials.
|
||||
}
|
||||
if (typeof value === 'object' && value !== null && 'token' in value && 'origin' in value
|
||||
&& typeof value.token === 'string' && value.token.length > 0 && value.origin === location.origin
|
||||
&& 'locale' in value && (value.locale === 'en_US' || value.locale === 'zh_CN')) {
|
||||
token = value.token
|
||||
locale = value.locale
|
||||
}
|
||||
contextBridge.exposeInMainWorld('dsh', {
|
||||
protocolVersion: 1,
|
||||
displayMode: 'embedded',
|
||||
|
||||
@@ -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'])
|
||||
})
|
||||
|
||||
@@ -264,8 +264,8 @@ async function withScrollWorld(
|
||||
runFailure = error
|
||||
try {
|
||||
await saveFailureShot(world.page, options.failureShot)
|
||||
} catch {
|
||||
// Best-effort evidence must never prevent cleanup of the owned world.
|
||||
} catch (_failureShotFailed) {
|
||||
// A missing screenshot loses evidence only; cleanup of the owned world and the rethrown run failure still follow.
|
||||
}
|
||||
}
|
||||
let cleanupFailure: unknown
|
||||
@@ -1305,7 +1305,7 @@ describe('web e2e: long Chat scroll contract', () => {
|
||||
const top = viewport.top + element.clientTop
|
||||
return Math.max(
|
||||
Math.abs((railBox.top + railBox.bottom) / 2 - (top + composerBox.top) / 2),
|
||||
Math.abs(viewport.left + element.clientLeft + element.clientWidth - railBox.right - 12),
|
||||
Math.abs(railBox.left - viewport.left - element.clientLeft - 12),
|
||||
Math.abs(composerBox.top - buttonBox.bottom - 16),
|
||||
)
|
||||
}), { timeout: 10_000 }).toBeLessThanOrEqual(GEOMETRY_TOLERANCE)
|
||||
|
||||
@@ -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,5 +1,5 @@
|
||||
- navigation "Session hierarchy": Seeded turn
|
||||
- text: Minimal mode
|
||||
- button "1 subagent"
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Clickable links gallery
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Use only Cordis tools. First
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -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 "代码审查和变更 查看代码变更与本会话的变更请求"
|
||||
@@ -11,6 +11,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": workspace
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,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
|
||||
}
|
||||
```
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": CJK strong emphasis
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Markdown image policy
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Inline code links
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- tablist:
|
||||
- tab "Chat" [selected]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Math rendering
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -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,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Reference order target
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Delegate a background job.
|
||||
- button "1 subagent"
|
||||
- button "1 background job"
|
||||
- 'button "Session panel Subagents running: 1 Background jobs running: 1"'
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": {{workspace}}
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Use the ask_user_question tool to
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Use the ask_user_question tool to
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Use the ask_user_question tool to
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -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()
|
||||
|
||||
+140
-112
@@ -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()
|
||||
@@ -2022,9 +2050,11 @@ it.skipIf(MODE === 'record')('reviews a change request by layer, hides test file
|
||||
const lens = view.getByRole('radiogroup', { name: '分层透镜', exact: true })
|
||||
const tree = view.getByRole('navigation')
|
||||
await expect.poll(() => lens.getByRole('radio').allTextContents()).toEqual(['全部6', '接口1', '实现2', '测试3'])
|
||||
// The lens spans the file tree with the filter field's insets, and its divider continues the tree's border.
|
||||
// The lens spans the file tree with the filter field's insets, and its divider continues the tree's border. The radio group
|
||||
// sits in the element that measures it, inside the toolbar cell above the tree.
|
||||
const [lensBox, fieldBox, cellBox, treeBox] = await Promise.all([
|
||||
lens.boundingBox(), tree.locator('input').locator('xpath=..').boundingBox(), lens.locator('xpath=..').boundingBox(), tree.locator('xpath=..').boundingBox(),
|
||||
lens.boundingBox(), tree.locator('input').locator('xpath=..').boundingBox(), lens.locator('xpath=../..').boundingBox(),
|
||||
tree.locator('xpath=..').boundingBox(),
|
||||
])
|
||||
if (lensBox === null || fieldBox === null || cellBox === null || treeBox === null) throw new Error('Lens and tree must be visible')
|
||||
expect([lensBox.x, lensBox.x + lensBox.width]).toEqual([fieldBox.x, fieldBox.x + fieldBox.width])
|
||||
@@ -2098,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 })
|
||||
@@ -2180,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)
|
||||
|
||||
@@ -2315,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}"]`)
|
||||
@@ -2473,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 })
|
||||
@@ -2543,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.
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
/**
|
||||
* Session panel layout in the shipped Web composition. The panel's stylesheet
|
||||
* decides whether the Chat View's end gutter holds the docked panel and tells
|
||||
* the plugin through a 1px dock probe, and it lays out the rows that
|
||||
* contributors mark. jsdom cannot evaluate that stylesheet, so this measures
|
||||
* the probe, the panel, and the toggle around the docking boundary, and the
|
||||
* working folder row without and with a directory context menu.
|
||||
*/
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import type { Browser, Page } from 'playwright'
|
||||
import { chromium } from 'playwright'
|
||||
import { afterAll, beforeAll, describe, expect, it, onTestFailed, onTestFinished } from 'vitest'
|
||||
import { createLaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment'
|
||||
import type { SessionId } from '@deepseek-ai/dsh-session'
|
||||
import { brandString } from '@deepseek-ai/dsh-brand'
|
||||
import { launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold } from './scaffold.ts'
|
||||
import { newEnglishPage, saveFailureShot } from './support.ts'
|
||||
|
||||
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
|
||||
const MODE = webSnapshotMode()
|
||||
const SEED_ID = brandString<SessionId>('session-panel-layout-web-e2e')
|
||||
/** The default transcript width in a frame wide enough to dock. */
|
||||
const TRANSCRIPT = 880
|
||||
/** The gutter that holds the docked panel: 40px clear of the transcript, its 300px minimum width, and the 8px edge inset. */
|
||||
const DOCK_GUTTER = 348
|
||||
|
||||
/** What the layout says about docking: the gutter, the probe, the panel's presentation and insets, and the toggle. */
|
||||
function docking(page: Page) {
|
||||
return page.evaluate(() => {
|
||||
const layer = document.querySelector<HTMLElement>('[data-chat-aside]')
|
||||
const column = document.querySelector<HTMLElement>('[data-chat-flow]')
|
||||
const probe = document.querySelector<HTMLElement>('[data-session-panel-probe]')
|
||||
const toggle = document.querySelector<HTMLElement>('[data-session-panel-toggle]')
|
||||
if (layer === null || column === null || probe === null || toggle === null) {
|
||||
throw new Error('aside layer, transcript column, dock probe, or panel toggle is missing')
|
||||
}
|
||||
const frame = layer.getBoundingClientRect()
|
||||
const flow = column.getBoundingClientRect()
|
||||
const panel = document.querySelector<HTMLElement>('[data-session-panel]')
|
||||
const box = panel?.getBoundingClientRect()
|
||||
return {
|
||||
gutter: (frame.width - flow.width) / 2,
|
||||
probe: probe.getBoundingClientRect().width,
|
||||
presentation: panel?.dataset['sessionPanel'] ?? null,
|
||||
expanded: toggle.getAttribute('aria-expanded'),
|
||||
panel: box === undefined ? null : { width: box.width, clear: box.left - flow.right, edge: frame.right - box.right },
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** Open the seeded Session through the sidebar and wait for the panel's dock probe. */
|
||||
async function openSeed(page: Page): Promise<void> {
|
||||
const session = page.locator(`[data-row-key="session:${SEED_ID}"]`)
|
||||
await expect.poll(async () => {
|
||||
if (await session.isVisible()) return true
|
||||
const group = page.locator('[role="treeitem"][aria-expanded]').first()
|
||||
if (await group.count() > 0 && await group.getAttribute('aria-expanded') === 'false') await group.click()
|
||||
return session.isVisible()
|
||||
}, { timeout: 15_000 }).toBe(true)
|
||||
await session.click()
|
||||
await page.locator('[data-session-panel-probe]').waitFor({ state: 'attached', timeout: 30_000 })
|
||||
}
|
||||
|
||||
/** Wait until the panel shows this way (null: not at all) and its entrance has finished. */
|
||||
async function shows(page: Page, presentation: 'docked' | 'overlay' | null): Promise<void> {
|
||||
await expect.poll(async () => (await docking(page)).presentation, { timeout: 10_000 }).toBe(presentation)
|
||||
if (presentation === null) return
|
||||
await page.locator('[data-session-panel]').evaluate(async (element) => {
|
||||
await Promise.all(element.getAnimations().map(animation => animation.finished))
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* The working folder row as laid out: its line, how far the centers of its
|
||||
* icon and menu columns sit from its edges, the room after its text, and what
|
||||
* the pointer state shows. `menu` is null while the menu part renders nothing.
|
||||
*/
|
||||
function rowLayout(page: Page) {
|
||||
return page.locator('[data-session-panel] [data-session-panel-project]').evaluate((element) => {
|
||||
const box = element.getBoundingClientRect()
|
||||
const icon = element.querySelector('[data-row-part="icon"]')!.getBoundingClientRect()
|
||||
const content = element.querySelector('[data-row-part="content"]')!
|
||||
const menu = element.querySelector<HTMLElement>('[data-row-part="menu"]')!
|
||||
const column = menu.getBoundingClientRect()
|
||||
const button = menu.querySelector('button')?.getBoundingClientRect()
|
||||
return {
|
||||
height: box.height,
|
||||
iconCenter: icon.left + icon.width / 2 - box.left,
|
||||
iconSize: [icon.width, icon.height],
|
||||
clipped: getComputedStyle(content).textOverflow,
|
||||
afterText: box.right - content.getBoundingClientRect().right,
|
||||
menu: button === undefined
|
||||
? null
|
||||
: {
|
||||
center: box.right - (column.left + column.width / 2),
|
||||
target: [button.width, button.height],
|
||||
opacity: getComputedStyle(menu).opacity,
|
||||
},
|
||||
hovered: element.matches(':hover'),
|
||||
highlighted: getComputedStyle(element).backgroundColor !== 'rgba(0, 0, 0, 0)',
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
describe.skipIf(MODE === 'record')('web e2e: Session panel layout', () => {
|
||||
let scaffold: WebScaffold
|
||||
let browser: Browser
|
||||
let page: Page
|
||||
let tripwire: ReturnType<typeof watchConsole>
|
||||
/** Viewport width the application keeps outside the Chat frame. */
|
||||
let chrome = 0
|
||||
|
||||
/** Resize the window so the Chat View's end gutter is exactly `gutter`, and wait for the layout to follow. */
|
||||
async function setGutter(gutter: number): Promise<void> {
|
||||
await page.setViewportSize({ width: TRANSCRIPT + 2 * gutter + chrome, height: page.viewportSize()!.height })
|
||||
await expect.poll(async () => (await docking(page)).gutter, { timeout: 10_000 }).toBe(gutter)
|
||||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
scaffold = await launchWebScaffold()
|
||||
await seedSession(scaffold, await readFile(FIXTURE, 'utf8'), SEED_ID)
|
||||
browser = await chromium.launch()
|
||||
page = await newEnglishPage(browser)
|
||||
await page.emulateMedia({ reducedMotion: 'reduce' })
|
||||
tripwire = watchConsole(page)
|
||||
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
||||
}, 120_000)
|
||||
|
||||
/** Open the seeded Session and learn how much of the window lies outside the Chat frame. */
|
||||
async function openSession(): Promise<void> {
|
||||
if (chrome !== 0) return
|
||||
await openSeed(page)
|
||||
const frame = await page.locator('[data-chat-aside]').evaluate(element => element.getBoundingClientRect().width)
|
||||
chrome = page.viewportSize()!.width - frame
|
||||
}
|
||||
|
||||
afterAll(async () => {
|
||||
const failures: unknown[] = []
|
||||
try { await browser?.close() } catch (error) { failures.push(error) }
|
||||
try { await scaffold?.close() } catch (error) { failures.push(error) }
|
||||
if (failures.length > 0) throw new AggregateError(failures, 'Session panel layout teardown failed')
|
||||
})
|
||||
|
||||
it('docks exactly from the gutter that holds the panel at its minimum width', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-dock'))
|
||||
await openSession()
|
||||
expect(Number.isInteger(chrome)).toBe(true)
|
||||
|
||||
await setGutter(DOCK_GUTTER - 1)
|
||||
await shows(page, null)
|
||||
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 1, probe: 0, presentation: null, expanded: 'false', panel: null })
|
||||
|
||||
// Half a pixel short, the probe is half a pixel wide and the panel stays hidden.
|
||||
await setGutter(DOCK_GUTTER - 0.5)
|
||||
expect(await docking(page)).toEqual({ gutter: DOCK_GUTTER - 0.5, probe: 0.5, presentation: null, expanded: 'false', panel: null })
|
||||
|
||||
await setGutter(DOCK_GUTTER)
|
||||
await shows(page, 'docked')
|
||||
expect(await docking(page)).toEqual({
|
||||
gutter: DOCK_GUTTER, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 300, clear: 40, edge: 8 },
|
||||
})
|
||||
|
||||
// A wider gutter widens the panel to its maximum at the same edge inset; the probe stays 1px.
|
||||
await setGutter(DOCK_GUTTER + 100)
|
||||
expect(await docking(page)).toEqual({
|
||||
gutter: DOCK_GUTTER + 100, probe: 1, presentation: 'docked', expanded: 'true', panel: { width: 360, clear: 80, edge: 8 },
|
||||
})
|
||||
|
||||
await setGutter(DOCK_GUTTER - 1)
|
||||
await shows(page, null)
|
||||
expect((await docking(page)).expanded).toBe('false')
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('floats narrower than it docks, at the same edge inset, and docks once the gutter holds it', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-overlay'))
|
||||
await openSession()
|
||||
const toggle = page.locator('[data-session-panel-toggle]')
|
||||
await setGutter(260)
|
||||
await shows(page, null)
|
||||
await toggle.click()
|
||||
await shows(page, 'overlay')
|
||||
const overlay = await docking(page)
|
||||
expect(overlay).toMatchObject({ probe: 0, presentation: 'overlay', expanded: 'true', panel: { width: 280, edge: 8 } })
|
||||
// The overlay covers part of the transcript instead of keeping clear of it.
|
||||
expect(overlay.panel?.clear).toBeLessThan(0)
|
||||
|
||||
await page.keyboard.press('Escape')
|
||||
await shows(page, null)
|
||||
expect((await docking(page)).expanded).toBe('false')
|
||||
|
||||
// An open overlay gives way to the docked panel when the window widens enough.
|
||||
await toggle.click()
|
||||
await shows(page, 'overlay')
|
||||
await setGutter(DOCK_GUTTER)
|
||||
await shows(page, 'docked')
|
||||
expect(await docking(page)).toMatchObject({ probe: 1, expanded: 'true', panel: { width: 300, clear: 40, edge: 8 } })
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('lays the working folder row out by its marks, with no room or highlight for a menu that renders nothing', async () => {
|
||||
onTestFailed(() => saveFailureShot(page, 'web-e2e-session-panel-row'))
|
||||
await openSession()
|
||||
await setGutter(DOCK_GUTTER + 100)
|
||||
await shows(page, 'docked')
|
||||
const row = page.locator('[data-session-panel] [data-session-panel-project]')
|
||||
await row.waitFor()
|
||||
await page.mouse.move(5, 5)
|
||||
// This composition registers no directory menu entries, so the shared More button renders nothing:
|
||||
// the text runs to the row's 6px padding, and the row has nothing to highlight for.
|
||||
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 6, menu: null, highlighted: false }
|
||||
expect(await rowLayout(page)).toEqual({ ...resting, hovered: false })
|
||||
await row.hover()
|
||||
expect(await rowLayout(page)).toEqual({ ...resting, hovered: true })
|
||||
expect(tripwire.pageErrors).toEqual([])
|
||||
})
|
||||
|
||||
it('puts a rendered menu on the panel end column and shows it, with the row highlight, on hover', async () => {
|
||||
// The directory context menu comes from Open In; SSH facts keep it from probing this runner's native applications.
|
||||
const withMenu = await launchWebScaffold({ openInAppEnvironment: createLaunchEnvironmentSnapshot([
|
||||
{ source: 'process', values: { SSH_CONNECTION: '10.0.0.2 55000 10.0.0.9 22' } },
|
||||
]) })
|
||||
onTestFinished(() => withMenu.close())
|
||||
await seedSession(withMenu, await readFile(FIXTURE, 'utf8'), SEED_ID)
|
||||
const other = await newEnglishPage(browser)
|
||||
onTestFinished(() => other.close())
|
||||
onTestFailed(() => saveFailureShot(other, 'web-e2e-session-panel-row-menu'))
|
||||
await other.emulateMedia({ reducedMotion: 'reduce' })
|
||||
const errors = watchConsole(other)
|
||||
// Wide enough for the gutter to hold the docked panel.
|
||||
await other.setViewportSize({ width: 2200, height: 1000 })
|
||||
await other.goto(withMenu.authenticatedUrl, { waitUntil: 'load' })
|
||||
await openSeed(other)
|
||||
await shows(other, 'docked')
|
||||
const row = other.locator('[data-session-panel] [data-session-panel-project]')
|
||||
await row.locator('[data-row-part="menu"] button').waitFor({ state: 'attached' })
|
||||
await other.mouse.move(5, 5)
|
||||
// The 16px menu column and the 8px gap before it follow the text; the 24px target reaches past the column.
|
||||
const resting = { height: 28, iconCenter: 14, iconSize: [16, 16], clipped: 'ellipsis', afterText: 30 }
|
||||
expect(await rowLayout(other)).toEqual({
|
||||
...resting, menu: { center: 14, target: [24, 24], opacity: '0' }, hovered: false, highlighted: false,
|
||||
})
|
||||
await row.hover()
|
||||
await expect.poll(async () => (await rowLayout(other)).menu?.opacity).toBe('1')
|
||||
expect(await rowLayout(other)).toEqual({
|
||||
...resting, menu: { center: 14, target: [24, 24], opacity: '1' }, hovered: true, highlighted: true,
|
||||
})
|
||||
await other.mouse.move(5, 5)
|
||||
await expect.poll(async () => (await rowLayout(other)).highlighted).toBe(false)
|
||||
// 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([])
|
||||
})
|
||||
})
|
||||
@@ -496,6 +496,25 @@ describe('web e2e: shipped right Sidebar', () => {
|
||||
expect(await filesTab.locator('[data-dockkit-tab-close]').count()).toBe(1)
|
||||
const guideTab = column.locator('[data-dockkit-tab]').filter({ hasText: 'Start' })
|
||||
expect(await guideTab.locator('[data-dockkit-tab-close]').count()).toBe(1)
|
||||
// A pane shorter than the guide scrolls it from the compass to the last capsule.
|
||||
const viewport = page.viewportSize()
|
||||
if (viewport === null) throw new Error('expected a fixed viewport')
|
||||
const guide = column.locator('[data-sidebar-right-guide]')
|
||||
await page.setViewportSize({ width: viewport.width, height: 240 })
|
||||
try {
|
||||
await expect.poll(async () => await guide.evaluate(node => node.scrollHeight > node.clientHeight)).toBe(true)
|
||||
expect(await guide.evaluate(node => node.scrollTop)).toBe(0)
|
||||
const lastEntry = guide.locator('[data-sidebar-right-guide-entry]').last()
|
||||
await guide.evaluate((node) => { node.scrollTop = node.scrollHeight })
|
||||
expect(await guide.evaluate(node => node.scrollTop)).toBeGreaterThan(0)
|
||||
expect(await lastEntry.evaluate((node) => {
|
||||
const entry = node.getBoundingClientRect()
|
||||
const pane = node.closest('[data-sidebar-right-guide]')?.getBoundingClientRect()
|
||||
return pane !== undefined && entry.top >= pane.top && entry.bottom <= pane.bottom
|
||||
})).toBe(true)
|
||||
} finally {
|
||||
await page.setViewportSize(viewport)
|
||||
}
|
||||
// Back to the seeded shape the cases below start from.
|
||||
await guideTab.hover()
|
||||
await guideTab.locator('[data-dockkit-tab-close]').click()
|
||||
|
||||
@@ -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
|
||||
@@ -1,6 +1,7 @@
|
||||
- banner:
|
||||
- navigation "Session hierarchy": Stream one TypeScript fence for
|
||||
- text: Standard mode
|
||||
- button "Session panel"
|
||||
- button "More actions"
|
||||
- button "Open right sidebar"
|
||||
- tablist:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -419,8 +419,8 @@ export async function saveFailureShot(page: Page, name: string): Promise<void> {
|
||||
mkdirSync(dir, { recursive: true })
|
||||
try {
|
||||
await page.screenshot({ path: `${dir}/${name}.png`, fullPage: true })
|
||||
} catch {
|
||||
// Best-effort evidence: a dead page/browser at failure time must not mask the real assertion error.
|
||||
} catch (_screenshotFailed) {
|
||||
// Screenshot evidence is optional: a dead page/browser at failure time must not mask the real assertion error.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"exclude": [
|
||||
"tests/home-whale.e2e.ts",
|
||||
"tests/sidebar-drawer.e2e.ts",
|
||||
"tests/session-panel-layout.e2e.ts",
|
||||
"tests/creation-recommendations.e2e.ts",
|
||||
"tests/plugin-recommendations.e2e.ts",
|
||||
"tests/deepseek-chat-import.e2e.ts",
|
||||
@@ -100,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",
|
||||
@@ -183,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: ce2bc6834476afd8
|
||||
zh: d7567e6d90fa2fd7
|
||||
en: eeae719827ada68c
|
||||
zh: 4ea2caca8125f8c4
|
||||
@@ -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"]
|
||||
@@ -352,6 +354,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
|
||||
@@ -674,6 +677,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"]
|
||||
@@ -354,6 +356,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) | - | 负责模块和精确配置监听;应用修改共用其队列,自动重载等待应用文件锁。 |
|
||||
| `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 适配器注册端点和流。 |
|
||||
|
||||
+11
-8
@@ -262,7 +262,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-api-session-controller`
|
||||
|
||||
- `inject`: `agentDefaultModel` · `agents` · `attachments` · `fileUploads` · `fs` · `llm` · `remoteAccess` · `sessions` · `sessionProjections` · `sessionQuery` · `typert` · `typertGateway` · `workspaceRegistry`
|
||||
- `source`: [`packages/api/session-controller/src/index.ts:111`](../packages/api/session-controller/src/index.ts)
|
||||
- `source`: [`packages/api/session-controller/src/index.ts:83`](../packages/api/session-controller/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Session Controller deployment policy. */
|
||||
@@ -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
|
||||
@@ -2740,7 +2740,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `shell` · `approval` · `sessions` · `agents` · `sessionProjections`
|
||||
- `refs`: [`ApprovalPolicy`](subsystems/approval.md) · [`SandboxMode`](subsystems/sandbox.md) · `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/interaction/permission-presets/src/index.ts:154`](../packages/interaction/permission-presets/src/index.ts)
|
||||
- `source`: [`packages/interaction/permission-presets/src/index.ts:161`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** The {@link PermissionPresetService} config: preset table and composition default. */
|
||||
@@ -3327,7 +3327,7 @@ export interface Config {
|
||||
|
||||
## `@deepseek-ai/dsh-session-query-sqlite`
|
||||
|
||||
- `inject`: `sessions`
|
||||
- `inject`: `sessions` · `sessionProjections`
|
||||
- `refs`: [`SessionQueryConfig`](../packages/session-query/session-query/src/index.ts)
|
||||
- `source`: [`packages/session-query/session-query-sqlite/src/index.ts:92`](../packages/session-query/session-query-sqlite/src/index.ts)
|
||||
|
||||
@@ -3375,7 +3375,7 @@ export type JournalMode = 'wal' | 'delete' | 'truncate' | 'persist'
|
||||
|
||||
## `@deepseek-ai/dsh-session-reference`
|
||||
|
||||
- `inject`: `sessionQuery`
|
||||
- `inject`: `sessionQuery` · `sessions` · `sessionProjections`
|
||||
- `source`: [`packages/context/session-reference/src/config.ts:11`](../packages/context/session-reference/src/config.ts)
|
||||
|
||||
```ts config-catalog
|
||||
@@ -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. */
|
||||
@@ -5179,7 +5179,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-working-directory`
|
||||
|
||||
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:82`](../packages/session/working-directory/src/index.ts)
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:74`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment default for Sessions without an original project directory. */
|
||||
@@ -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) |
|
||||
@@ -5271,6 +5272,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-panel` | — | [`packages/client/ui-session-panel/src/index.ts`](../packages/client/ui-session-panel/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
@@ -5339,6 +5341,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
|
||||
| `@deepseek-ai/dsh-tool-cordis` | `tools` · `cordisInspect` | [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-executor-native` | `tools` | [`packages/core/tool-executor-native/src/index.ts`](../packages/core/tool-executor-native/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-schedule` | `tools` · `systemPrompt` | [`packages/schedule/tool-schedule/src/index.ts`](../packages/schedule/tool-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-session-list` | `tools` · `sessions` · `sessionQuery` · `workspaceRegistry` · `sessionProjections` | [`packages/session-query/tool-session-list/src/index.ts`](../packages/session-query/tool-session-list/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tools` | `systemPrompt` | [`packages/core/tools/src/index.ts`](../packages/core/tools/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-user-questions` | — | [`packages/interaction/user-questions/src/index.ts`](../packages/interaction/user-questions/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-webhook` | `agents` · `agentDefaultModel` · `agentPresets` · `permissionPresets` · `sessionTitle` · `workspaceRegistry` | [`packages/experimental/webhook/src/index.ts`](../packages/experimental/webhook/src/index.ts) |
|
||||
|
||||
@@ -264,7 +264,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-api-session-controller`
|
||||
|
||||
- `inject`: `agentDefaultModel` · `agents` · `attachments` · `fileUploads` · `fs` · `llm` · `remoteAccess` · `sessions` · `sessionProjections` · `sessionQuery` · `typert` · `typertGateway` · `workspaceRegistry`
|
||||
- `source`: [`packages/api/session-controller/src/index.ts:111`](../packages/api/session-controller/src/index.ts)
|
||||
- `source`: [`packages/api/session-controller/src/index.ts:83`](../packages/api/session-controller/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Session Controller deployment policy. */
|
||||
@@ -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
|
||||
@@ -2742,7 +2742,7 @@ export interface Config {
|
||||
|
||||
- `inject`: `shell` · `approval` · `sessions` · `agents` · `sessionProjections`
|
||||
- `refs`: [`ApprovalPolicy`](subsystems/approval.zh.md) · [`SandboxMode`](subsystems/sandbox.zh.md) · `Volatile` (`@deepseek-ai/cordis`)
|
||||
- `source`: [`packages/interaction/permission-presets/src/index.ts:154`](../packages/interaction/permission-presets/src/index.ts)
|
||||
- `source`: [`packages/interaction/permission-presets/src/index.ts:161`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** The {@link PermissionPresetService} config: preset table and composition default. */
|
||||
@@ -3329,7 +3329,7 @@ export interface Config {
|
||||
|
||||
## `@deepseek-ai/dsh-session-query-sqlite`
|
||||
|
||||
- `inject`: `sessions`
|
||||
- `inject`: `sessions` · `sessionProjections`
|
||||
- `refs`: [`SessionQueryConfig`](../packages/session-query/session-query/src/index.ts)
|
||||
- `source`: [`packages/session-query/session-query-sqlite/src/index.ts:92`](../packages/session-query/session-query-sqlite/src/index.ts)
|
||||
|
||||
@@ -3377,7 +3377,7 @@ export type JournalMode = 'wal' | 'delete' | 'truncate' | 'persist'
|
||||
|
||||
## `@deepseek-ai/dsh-session-reference`
|
||||
|
||||
- `inject`: `sessionQuery`
|
||||
- `inject`: `sessionQuery` · `sessions` · `sessionProjections`
|
||||
- `source`: [`packages/context/session-reference/src/config.ts:11`](../packages/context/session-reference/src/config.ts)
|
||||
|
||||
```ts config-catalog
|
||||
@@ -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. */
|
||||
@@ -5181,7 +5181,7 @@ export interface Config {
|
||||
## `@deepseek-ai/dsh-working-directory`
|
||||
|
||||
- `inject`: `fs` · `sessionProjections` · `systemPrompt`
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:82`](../packages/session/working-directory/src/index.ts)
|
||||
- `source`: [`packages/session/working-directory/src/index.ts:74`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
```ts config-catalog
|
||||
/** Deployment default for Sessions without an original project directory. */
|
||||
@@ -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) |
|
||||
@@ -5273,6 +5274,7 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-client-ui-schedule` | — | [`packages/client/ui-schedule/src/index.ts`](../packages/client/ui-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-secret-mask` | — | [`packages/client/ui-secret-mask/src/index.ts`](../packages/client/ui-secret-mask/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session` | — | [`packages/client/ui-session/src/index.ts`](../packages/client/ui-session/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-panel` | — | [`packages/client/ui-session-panel/src/index.ts`](../packages/client/ui-session-panel/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-session-status` | `remoteAccess` · `sessions` · `sessionPersistence` · `typert` | [`packages/client/ui-session-status/src/index.ts`](../packages/client/ui-session-status/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings` | — | [`packages/client/ui-settings/src/index.ts`](../packages/client/ui-settings/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-client-ui-settings-agent-loop` | — | [`packages/client/ui-settings-agent-loop/src/index.ts`](../packages/client/ui-settings-agent-loop/src/index.ts) |
|
||||
@@ -5341,6 +5343,7 @@ export interface Config {
|
||||
| `@deepseek-ai/dsh-tool-cordis` | `tools` · `cordisInspect` | [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-executor-native` | `tools` | [`packages/core/tool-executor-native/src/index.ts`](../packages/core/tool-executor-native/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-schedule` | `tools` · `systemPrompt` | [`packages/schedule/tool-schedule/src/index.ts`](../packages/schedule/tool-schedule/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tool-session-list` | `tools` · `sessions` · `sessionQuery` · `workspaceRegistry` · `sessionProjections` | [`packages/session-query/tool-session-list/src/index.ts`](../packages/session-query/tool-session-list/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-tools` | `systemPrompt` | [`packages/core/tools/src/index.ts`](../packages/core/tools/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-user-questions` | — | [`packages/interaction/user-questions/src/index.ts`](../packages/interaction/user-questions/src/index.ts) |
|
||||
| `@deepseek-ai/dsh-webhook` | `agents` · `agentDefaultModel` · `agentPresets` · `permissionPresets` · `sessionTitle` · `workspaceRegistry` | [`packages/experimental/webhook/src/index.ts`](../packages/experimental/webhook/src/index.ts) |
|
||||
|
||||
@@ -23,11 +23,11 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
|
||||
| `agent/request-error` | `waterfall` | [`packages/core/agent/src/runtime-types.ts:390`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`waterfall`) | [`compaction-basic`](../packages/compaction/compaction-basic), [`compaction-image-offload`](../packages/compaction/compaction-image-offload), [`llm-retry`](../packages/llm/llm-retry) |
|
||||
| `agent/status` | `emit` | [`packages/core/agent/src/runtime-types.ts:310`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`emit`) | [`acp`](../packages/acp/acp), [`compaction-basic`](../packages/compaction/compaction-basic), [`goal-round-driver`](../packages/goal/goal-round-driver), `server`, `session-controller`, [`timeline`](../packages/experimental/timeline) |
|
||||
| `agent/turn-stopping` | `serial` | [`packages/core/agent/src/runtime-types.ts:418`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`serial`) | [`hooks-claude-code`](../packages/experimental/hooks-claude-code), [`hooks-codex`](../packages/experimental/hooks-codex), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `api-session/activity` | `emit` | [`packages/api/session-controller/src/types.ts:705`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/added` | `emit` | [`packages/api/session-controller/src/types.ts:685`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/error` | `emit` | [`packages/api/session-controller/src/types.ts:712`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/removed` | `emit` | [`packages/api/session-controller/src/types.ts:691`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/status` | `emit` | [`packages/api/session-controller/src/types.ts:698`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/activity` | `emit` | [`packages/api/session-controller/src/types.ts:697`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/added` | `emit` | [`packages/api/session-controller/src/types.ts:677`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/error` | `emit` | [`packages/api/session-controller/src/types.ts:704`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/removed` | `emit` | [`packages/api/session-controller/src/types.ts:683`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/status` | `emit` | [`packages/api/session-controller/src/types.ts:690`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `app-boot/config-reload` | `emit` | [`packages/boot/app-boot/src/index.ts:56`](../packages/boot/app-boot/src/index.ts) | [`app-boot`](../packages/boot/app-boot) (`emit`) | [`settings`](../packages/settings/settings) |
|
||||
| `approval/request` | `waterfall` | [`packages/interaction/user-approval/src/types.ts:87`](../packages/interaction/user-approval/src/types.ts) | [`user-approval`](../packages/interaction/user-approval) (`waterfall`) | [`acp`](../packages/acp/acp), `remotes`, `server` |
|
||||
| `authorization/settled` | `emit` | [`packages/credentials/authorization/src/index.ts:57`](../packages/credentials/authorization/src/index.ts) | [`authorization`](../packages/credentials/authorization) (`events.dispatch`) | - |
|
||||
@@ -62,7 +62,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
|
||||
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
|
||||
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:76`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) |
|
||||
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:46`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
|
||||
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
|
||||
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
|
||||
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
@@ -104,7 +104,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
|
||||
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
|
||||
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
| `agent/request-error` | `waterfall` | [`packages/core/agent/src/runtime-types.ts:390`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`waterfall`) | [`compaction-basic`](../packages/compaction/compaction-basic), [`compaction-image-offload`](../packages/compaction/compaction-image-offload), [`llm-retry`](../packages/llm/llm-retry) |
|
||||
| `agent/status` | `emit` | [`packages/core/agent/src/runtime-types.ts:310`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`emit`) | [`acp`](../packages/acp/acp), [`compaction-basic`](../packages/compaction/compaction-basic), [`goal-round-driver`](../packages/goal/goal-round-driver), `server`, `session-controller`, [`timeline`](../packages/experimental/timeline) |
|
||||
| `agent/turn-stopping` | `serial` | [`packages/core/agent/src/runtime-types.ts:418`](../packages/core/agent/src/runtime-types.ts) | [`agent-loop`](../packages/core/agent-loop) (`serial`) | [`hooks-claude-code`](../packages/experimental/hooks-claude-code), [`hooks-codex`](../packages/experimental/hooks-codex), [`workspace-changes`](../packages/deliverables/workspace-changes) |
|
||||
| `api-session/activity` | `emit` | [`packages/api/session-controller/src/types.ts:705`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/added` | `emit` | [`packages/api/session-controller/src/types.ts:685`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/error` | `emit` | [`packages/api/session-controller/src/types.ts:712`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/removed` | `emit` | [`packages/api/session-controller/src/types.ts:691`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/status` | `emit` | [`packages/api/session-controller/src/types.ts:698`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/activity` | `emit` | [`packages/api/session-controller/src/types.ts:697`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/added` | `emit` | [`packages/api/session-controller/src/types.ts:677`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/error` | `emit` | [`packages/api/session-controller/src/types.ts:704`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/removed` | `emit` | [`packages/api/session-controller/src/types.ts:683`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `api-session/status` | `emit` | [`packages/api/session-controller/src/types.ts:690`](../packages/api/session-controller/src/types.ts) | `session-controller` (`emit`) | `remotes` |
|
||||
| `app-boot/config-reload` | `emit` | [`packages/boot/app-boot/src/index.ts:56`](../packages/boot/app-boot/src/index.ts) | [`app-boot`](../packages/boot/app-boot) (`emit`) | [`settings`](../packages/settings/settings) |
|
||||
| `approval/request` | `waterfall` | [`packages/interaction/user-approval/src/types.ts:87`](../packages/interaction/user-approval/src/types.ts) | [`user-approval`](../packages/interaction/user-approval) (`waterfall`) | [`acp`](../packages/acp/acp), `remotes`, `server` |
|
||||
| `authorization/settled` | `emit` | [`packages/credentials/authorization/src/index.ts:57`](../packages/credentials/authorization/src/index.ts) | [`authorization`](../packages/credentials/authorization) (`events.dispatch`) | - |
|
||||
@@ -64,7 +64,7 @@
|
||||
| `llm/models-updated` | `emit` | [`packages/llm/llm/src/types.ts:30`](../packages/llm/llm/src/types.ts) | [`llm-deepseek`](../packages/llm/llm-deepseek) (`emit`) | `remotes` |
|
||||
| `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:76`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) |
|
||||
| `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:46`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | - |
|
||||
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:48`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
|
||||
| `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` |
|
||||
| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:455`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:461`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` |
|
||||
@@ -106,7 +106,7 @@
|
||||
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
|
||||
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
|
||||
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:130`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:157`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
|
||||
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:148`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
|
||||
|
||||
+21
-7
@@ -112,6 +112,7 @@ flowchart TD
|
||||
pkg_session_log_export["session-log-export"]
|
||||
pkg_session_query["session-query"]
|
||||
pkg_session_query_sqlite["session-query-sqlite"]
|
||||
pkg_tool_session_list["tool-session-list"]
|
||||
end
|
||||
subgraph group_acp["packages/acp"]
|
||||
pkg_acp["acp"]
|
||||
@@ -170,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"]
|
||||
@@ -196,6 +198,7 @@ flowchart TD
|
||||
pkg_client_ui_schedule["client-ui-schedule"]
|
||||
pkg_client_ui_secret_mask["client-ui-secret-mask"]
|
||||
pkg_client_ui_session["client-ui-session"]
|
||||
pkg_client_ui_session_panel["client-ui-session-panel"]
|
||||
pkg_client_ui_session_status["client-ui-session-status"]
|
||||
pkg_client_ui_settings["client-ui-settings"]
|
||||
pkg_client_ui_settings_account["client-ui-settings-account"]
|
||||
@@ -1261,6 +1264,13 @@ flowchart TD
|
||||
pkg_session_query_sqlite --> pkg_session
|
||||
pkg_session_query_sqlite --> pkg_session_persistence
|
||||
pkg_session_query_sqlite --> pkg_session_query
|
||||
pkg_tool_session_list --> pkg_session
|
||||
pkg_tool_session_list --> pkg_session_projection
|
||||
pkg_tool_session_list --> pkg_session_projection_cache
|
||||
pkg_tool_session_list --> pkg_session_query
|
||||
pkg_tool_session_list --> pkg_session_title
|
||||
pkg_tool_session_list --> pkg_tools
|
||||
pkg_tool_session_list --> pkg_workspace
|
||||
pkg_acp --> pkg_agent
|
||||
pkg_acp --> pkg_attachment
|
||||
pkg_acp --> pkg_llm
|
||||
@@ -1371,12 +1381,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
|
||||
@@ -1504,6 +1508,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
|
||||
@@ -1630,6 +1641,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` | — |
|
||||
@@ -1656,6 +1668,7 @@ flowchart TD
|
||||
| [`client-ui-schedule`](../packages/client/ui-schedule) | `client` | — |
|
||||
| [`client-ui-secret-mask`](../packages/client/ui-secret-mask) | `client` | — |
|
||||
| [`client-ui-session`](../packages/client/ui-session) | `client` | — |
|
||||
| [`client-ui-session-panel`](../packages/client/ui-session-panel) | `client` | — |
|
||||
| [`client-ui-session-status`](../packages/client/ui-session-status) | `client` | — |
|
||||
| [`client-ui-settings`](../packages/client/ui-settings) | `client` | — |
|
||||
| [`client-ui-settings-account`](../packages/client/ui-settings-account) | `client` | — |
|
||||
@@ -1916,6 +1929,7 @@ flowchart TD
|
||||
| [`subagent`](../packages/subagent/subagent) | `subagent` | [`agent`](../packages/core/agent), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval), [`util-time`](../packages/util/time), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`spill-policy`](../packages/spill/spill-policy) | `spill` | [`attachment`](../packages/attachment/attachment), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`output-retention`](../packages/util/output-retention), [`session`](../packages/core/session), [`spill`](../packages/spill/spill), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools) |
|
||||
| [`session-query-sqlite`](../packages/session-query/session-query-sqlite) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-query`](../packages/session-query/session-query) |
|
||||
| [`tool-session-list`](../packages/session-query/tool-session-list) | `session-query` | [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`tools`](../packages/core/tools), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`acp`](../packages/acp/acp) | `acp` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`mcp-client`](../packages/mcp/mcp-client), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`token-meter`](../packages/llm/token-meter), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`plugin-manager`](../packages/boot/plugin-manager) | `boot` | [`error`](../packages/util/error), [`hmr`](../packages/boot/hmr), [`host-plugin-inventory`](../packages/host/plugin-inventory), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) |
|
||||
@@ -1934,7 +1948,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) |
|
||||
@@ -1950,6 +1963,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) |
|
||||
|
||||
+21
-7
@@ -114,6 +114,7 @@ flowchart TD
|
||||
pkg_session_log_export["session-log-export"]
|
||||
pkg_session_query["session-query"]
|
||||
pkg_session_query_sqlite["session-query-sqlite"]
|
||||
pkg_tool_session_list["tool-session-list"]
|
||||
end
|
||||
subgraph group_acp["packages/acp"]
|
||||
pkg_acp["acp"]
|
||||
@@ -172,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"]
|
||||
@@ -198,6 +200,7 @@ flowchart TD
|
||||
pkg_client_ui_schedule["client-ui-schedule"]
|
||||
pkg_client_ui_secret_mask["client-ui-secret-mask"]
|
||||
pkg_client_ui_session["client-ui-session"]
|
||||
pkg_client_ui_session_panel["client-ui-session-panel"]
|
||||
pkg_client_ui_session_status["client-ui-session-status"]
|
||||
pkg_client_ui_settings["client-ui-settings"]
|
||||
pkg_client_ui_settings_account["client-ui-settings-account"]
|
||||
@@ -1263,6 +1266,13 @@ flowchart TD
|
||||
pkg_session_query_sqlite --> pkg_session
|
||||
pkg_session_query_sqlite --> pkg_session_persistence
|
||||
pkg_session_query_sqlite --> pkg_session_query
|
||||
pkg_tool_session_list --> pkg_session
|
||||
pkg_tool_session_list --> pkg_session_projection
|
||||
pkg_tool_session_list --> pkg_session_projection_cache
|
||||
pkg_tool_session_list --> pkg_session_query
|
||||
pkg_tool_session_list --> pkg_session_title
|
||||
pkg_tool_session_list --> pkg_tools
|
||||
pkg_tool_session_list --> pkg_workspace
|
||||
pkg_acp --> pkg_agent
|
||||
pkg_acp --> pkg_attachment
|
||||
pkg_acp --> pkg_llm
|
||||
@@ -1373,12 +1383,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
|
||||
@@ -1506,6 +1510,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
|
||||
@@ -1632,6 +1643,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` | — |
|
||||
@@ -1658,6 +1670,7 @@ flowchart TD
|
||||
| [`client-ui-schedule`](../packages/client/ui-schedule) | `client` | — |
|
||||
| [`client-ui-secret-mask`](../packages/client/ui-secret-mask) | `client` | — |
|
||||
| [`client-ui-session`](../packages/client/ui-session) | `client` | — |
|
||||
| [`client-ui-session-panel`](../packages/client/ui-session-panel) | `client` | — |
|
||||
| [`client-ui-session-status`](../packages/client/ui-session-status) | `client` | — |
|
||||
| [`client-ui-settings`](../packages/client/ui-settings) | `client` | — |
|
||||
| [`client-ui-settings-account`](../packages/client/ui-settings-account) | `client` | — |
|
||||
@@ -1918,6 +1931,7 @@ flowchart TD
|
||||
| [`subagent`](../packages/subagent/subagent) | `subagent` | [`agent`](../packages/core/agent), [`agent-preset-registry`](../packages/preset/agent-preset-registry), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`permission-presets`](../packages/interaction/permission-presets), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-projection`](../packages/session/session-projection), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval), [`util-time`](../packages/util/time), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`spill-policy`](../packages/spill/spill-policy) | `spill` | [`attachment`](../packages/attachment/attachment), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`output-retention`](../packages/util/output-retention), [`session`](../packages/core/session), [`spill`](../packages/spill/spill), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools) |
|
||||
| [`session-query-sqlite`](../packages/session-query/session-query-sqlite) | `session-query` | [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`session-query`](../packages/session-query/session-query) |
|
||||
| [`tool-session-list`](../packages/session-query/tool-session-list) | `session-query` | [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`session-title`](../packages/session/session-title), [`tools`](../packages/core/tools), [`workspace`](../packages/workspace/workspace) |
|
||||
| [`acp`](../packages/acp/acp) | `acp` | [`agent`](../packages/core/agent), [`attachment`](../packages/attachment/attachment), [`llm`](../packages/llm/llm), [`mcp-client`](../packages/mcp/mcp-client), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`token-meter`](../packages/llm/token-meter), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`plugin-manager`](../packages/boot/plugin-manager) | `boot` | [`error`](../packages/util/error), [`hmr`](../packages/boot/hmr), [`host-plugin-inventory`](../packages/host/plugin-inventory), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`subprocess`](../packages/subprocess/subprocess), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-approval`](../packages/interaction/user-approval) |
|
||||
| [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) |
|
||||
@@ -1936,7 +1950,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) |
|
||||
@@ -1952,6 +1965,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) |
|
||||
|
||||
@@ -147,8 +147,8 @@
|
||||
en: 19917bc5438e60af
|
||||
zh: 19917bc5438e60af
|
||||
/session-persistence-event-catalog/events/permission/permission-preset-log-only:
|
||||
en: 5a38e50ed89e1a80
|
||||
zh: 5c4160ebfb3d661b
|
||||
en: bf9ce12daf742e7f
|
||||
zh: 78d8424f1493ca2c
|
||||
/session-persistence-event-catalog/events/plan:
|
||||
en: 4294f78d26ed985b
|
||||
zh: 4294f78d26ed985b
|
||||
@@ -300,8 +300,8 @@
|
||||
en: e8dd0cebbb930eb7
|
||||
zh: e8dd0cebbb930eb7
|
||||
/session-persistence-event-catalog/events/working-directory/working-directory-change-log-only:
|
||||
en: 850b421f9b0ae67b
|
||||
zh: b181fbff3e30ef11
|
||||
en: a7826f149a09b9b6
|
||||
zh: 16b54a5b469e7436
|
||||
/session-persistence-event-catalog/events/workspace:
|
||||
en: 63ee1a85e4b59ae3
|
||||
zh: 63ee1a85e4b59ae3
|
||||
@@ -312,8 +312,8 @@
|
||||
en: e15e7133290b732a
|
||||
zh: e15e7133290b732a
|
||||
/session-persistence-event-catalog/events/workspace-root/workspace-root-change-log-only:
|
||||
en: e0c732db6792855b
|
||||
zh: 702740fed27e2bb7
|
||||
en: 3f23638849143611
|
||||
zh: cdc5e0cbfc4655fd
|
||||
/session-persistence-event-catalog/resolved-persistence-types:
|
||||
en: 3493ecf0993e5397
|
||||
zh: ec95688f593a4ed4
|
||||
@@ -1113,8 +1113,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
|
||||
@@ -1380,8 +1380,8 @@
|
||||
en: 7660c41e4129b466
|
||||
zh: bcbb1b15cb872214
|
||||
/session-persistence-event-catalog/resolved-persistence-types/string:
|
||||
en: 0bd8cec4019a5ad5
|
||||
zh: c6cc79ce5aa844c4
|
||||
en: 0c7d65a7628869fb
|
||||
zh: be140c5bd89db538
|
||||
/session-persistence-event-catalog/resolved-persistence-types/string~2:
|
||||
en: 0089620bf4638263
|
||||
zh: 1922bef1713094bb
|
||||
@@ -1506,8 +1506,8 @@
|
||||
en: bef51e0442ebb903
|
||||
zh: 240ebeb160533d8c
|
||||
/session-persistence-event-catalog/resolved-persistence-types/cwd:
|
||||
en: 444dec7d03df540c
|
||||
zh: 886b7d695e755787
|
||||
en: b5e8f345d5f15813
|
||||
zh: 8115c4e99a4d37d6
|
||||
/session-persistence-event-catalog/resolved-persistence-types/decision-durationms-exitcode-handlerid:
|
||||
en: a99ac57bbec0370f
|
||||
zh: 9073329e324a66e0
|
||||
@@ -1773,8 +1773,8 @@
|
||||
en: f58bccca3df9c2ad
|
||||
zh: 5c92b6edeb7ce020
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-retry:
|
||||
en: c628d0575f81407a
|
||||
zh: d9a70ce1e05dcce8
|
||||
en: 898f27c058097895
|
||||
zh: bbbcf08ad8ba3a32
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-runtime-context:
|
||||
en: 68b5598e21cf8ba2
|
||||
zh: 95ef1685af64a5f4
|
||||
@@ -1914,8 +1914,8 @@
|
||||
en: 4e102391d685eff5
|
||||
zh: 9762243a13014f3d
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-user:
|
||||
en: 808d28208287e843
|
||||
zh: 18a8d63978c984a7
|
||||
en: 156e57c019aa1b28
|
||||
zh: a1629b267f7cc713
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-user-approval:
|
||||
en: a52d2dfbaf844127
|
||||
zh: 4c5306ca40f20873
|
||||
@@ -1944,8 +1944,8 @@
|
||||
en: c6e1e91281b3f9c2
|
||||
zh: 33225e83b0bd8cff
|
||||
/session-persistence-event-catalog/resolved-persistence-types/kind-working-directory:
|
||||
en: b28ca6b37f5a338d
|
||||
zh: 4c4f2f05721b8b62
|
||||
en: a36b909ecbd38156
|
||||
zh: b02edb123e72fbb1
|
||||
/session-persistence-event-catalog/resolved-persistence-types/max-tokens-messages-model-thinking:
|
||||
en: 3216b23c131d0070
|
||||
zh: 73ca171c6014f16e
|
||||
@@ -1968,8 +1968,8 @@
|
||||
en: 88fd92dff7aa505f
|
||||
zh: b400712b3ef749aa
|
||||
/session-persistence-event-catalog/resolved-persistence-types/preset:
|
||||
en: 9fbb222685c7310c
|
||||
zh: 26e3032eae149f0a
|
||||
en: 42a6a0b07a66ad45
|
||||
zh: eaecef11c5b3ac02
|
||||
/session-persistence-event-catalog/resolved-persistence-types/reason-turn:
|
||||
en: 44759ae067b63ef5
|
||||
zh: f2d101c41110eee6
|
||||
|
||||
+10
-10
@@ -719,7 +719,7 @@ Source: [`packages/core/agent/src/types.ts:121`](../packages/core/agent/src/type
|
||||
'permission/preset': { preset: string }
|
||||
```
|
||||
|
||||
Source: [`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
|
||||
Source: [`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
### `plan/*`
|
||||
|
||||
@@ -1335,7 +1335,7 @@ Source: [`packages/web/web-search-deepseek/src/provider.ts:89`](../packages/web/
|
||||
}
|
||||
```
|
||||
|
||||
Source: [`packages/session/working-directory/src/index.ts:60`](../packages/session/working-directory/src/index.ts)
|
||||
Source: [`packages/session/working-directory/src/index.ts:61`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
### `workspace/*`
|
||||
|
||||
@@ -1368,7 +1368,7 @@ Source: [`packages/deliverables/workspace-changes/src/types.ts:106`](../packages
|
||||
}
|
||||
```
|
||||
|
||||
Source: [`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
Source: [`packages/session/working-directory/src/index.ts:66`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
## Resolved persistence types
|
||||
|
||||
@@ -3925,7 +3925,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:
|
||||
|
||||
@@ -5696,7 +5696,7 @@ Array of `number`.
|
||||
|
||||
SHA-256: `4cd48f3e5108bd6ebedf7301c3638839b8b2b9db8dbd493974177fbdeb91a01b`
|
||||
|
||||
Sources: [`packages/api/session-controller/src/types.ts:391`](../packages/api/session-controller/src/types.ts) · [`packages/attachment/attachment/src/brand.ts:6`](../packages/attachment/attachment/src/brand.ts) · [`packages/compaction/compaction/src/brand.ts:4`](../packages/compaction/compaction/src/brand.ts) · [`packages/core/session/src/types.ts:21`](../packages/core/session/src/types.ts) · [`packages/experimental/webhook/src/brand.ts:12`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:6`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:9`](../packages/experimental/webhook/src/brand.ts) · [`packages/feedback/message-feedback/src/types.ts:14`](../packages/feedback/message-feedback/src/types.ts) · [`packages/goal/goal/src/types.ts:17`](../packages/goal/goal/src/types.ts) · [`packages/interaction/commands/src/brand.ts:22`](../packages/interaction/commands/src/brand.ts) · [`packages/interaction/user-approval/src/types.ts:17`](../packages/interaction/user-approval/src/types.ts) · [`packages/jobs/jobs/src/brand.ts:9`](../packages/jobs/jobs/src/brand.ts) · [`packages/llm/llm-retry/src/brand.ts:4`](../packages/llm/llm-retry/src/brand.ts) · [`packages/llm/llm/src/brand.ts:16`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:31`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:43`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:67`](../packages/llm/llm/src/brand.ts) · [`packages/schedule/schedule/src/types.ts:14`](../packages/schedule/schedule/src/types.ts) · [`packages/session/session-title/src/types.ts:17`](../packages/session/session-title/src/types.ts) · [`packages/team/agent-team/src/types.ts:20`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:32`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:8`](../packages/team/agent-team/src/types.ts) · [`packages/workflow/workflow/src/types.ts:14`](../packages/workflow/workflow/src/types.ts)
|
||||
Sources: [`packages/api/session-controller/src/types.ts:383`](../packages/api/session-controller/src/types.ts) · [`packages/attachment/attachment/src/brand.ts:6`](../packages/attachment/attachment/src/brand.ts) · [`packages/compaction/compaction/src/brand.ts:4`](../packages/compaction/compaction/src/brand.ts) · [`packages/core/session/src/types.ts:21`](../packages/core/session/src/types.ts) · [`packages/experimental/webhook/src/brand.ts:12`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:6`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:9`](../packages/experimental/webhook/src/brand.ts) · [`packages/feedback/message-feedback/src/types.ts:14`](../packages/feedback/message-feedback/src/types.ts) · [`packages/goal/goal/src/types.ts:17`](../packages/goal/goal/src/types.ts) · [`packages/interaction/commands/src/brand.ts:22`](../packages/interaction/commands/src/brand.ts) · [`packages/interaction/user-approval/src/types.ts:17`](../packages/interaction/user-approval/src/types.ts) · [`packages/jobs/jobs/src/brand.ts:9`](../packages/jobs/jobs/src/brand.ts) · [`packages/llm/llm-retry/src/brand.ts:4`](../packages/llm/llm-retry/src/brand.ts) · [`packages/llm/llm/src/brand.ts:16`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:31`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:43`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:67`](../packages/llm/llm/src/brand.ts) · [`packages/schedule/schedule/src/types.ts:14`](../packages/schedule/schedule/src/types.ts) · [`packages/session/session-title/src/types.ts:17`](../packages/session/session-title/src/types.ts) · [`packages/team/agent-team/src/types.ts:20`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:32`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:8`](../packages/team/agent-team/src/types.ts) · [`packages/workflow/workflow/src/types.ts:14`](../packages/workflow/workflow/src/types.ts)
|
||||
|
||||
`string`
|
||||
|
||||
@@ -6246,7 +6246,7 @@ Sources: [`packages/compaction/compaction/src/types.ts:24`](../packages/compacti
|
||||
|
||||
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
|
||||
|
||||
Sources: [`packages/session/working-directory/src/index.ts:60`](../packages/session/working-directory/src/index.ts) · [`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
Sources: [`packages/session/working-directory/src/index.ts:61`](../packages/session/working-directory/src/index.ts) · [`packages/session/working-directory/src/index.ts:66`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
@@ -7342,7 +7342,7 @@ SHA-256: `db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c`
|
||||
|
||||
SHA-256: `8f1062573ea9184129dfdec43df1e8136eb5808746fd809bf6b539f3fd11362e`
|
||||
|
||||
Sources: [`packages/api/session-controller/src/types.ts:402`](../packages/api/session-controller/src/types.ts)
|
||||
Sources: [`packages/api/session-controller/src/types.ts:394`](../packages/api/session-controller/src/types.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
@@ -7875,7 +7875,7 @@ Sources: [`packages/core/tools/src/index.ts:28`](../packages/core/tools/src/inde
|
||||
|
||||
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
|
||||
|
||||
Sources: [`packages/api/session-controller/src/types.ts:400`](../packages/api/session-controller/src/types.ts)
|
||||
Sources: [`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
@@ -8000,7 +8000,7 @@ Sources: [`packages/experimental/webhook/src/types.ts:75`](../packages/experimen
|
||||
|
||||
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
|
||||
|
||||
Sources: [`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
|
||||
Sources: [`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
@@ -8111,7 +8111,7 @@ Sources: [`packages/interaction/user-approval/src/index.ts:41`](../packages/inte
|
||||
|
||||
SHA-256: `8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad`
|
||||
|
||||
Sources: [`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
|
||||
Sources: [`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
| Property | Presence | Type |
|
||||
|---|---|---|
|
||||
|
||||
@@ -721,7 +721,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
||||
'permission/preset': { preset: string }
|
||||
```
|
||||
|
||||
来源:[`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
|
||||
来源:[`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
### `plan/*`
|
||||
|
||||
@@ -1337,7 +1337,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
||||
}
|
||||
```
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:60`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:61`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
### `workspace/*`
|
||||
|
||||
@@ -1370,7 +1370,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
||||
}
|
||||
```
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:66`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
## 已解析的持久化类型
|
||||
|
||||
@@ -3927,7 +3927,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)
|
||||
|
||||
以下类型之一:
|
||||
|
||||
@@ -5698,7 +5698,7 @@ SHA-256: `5d03ba38734809bcbd2a55221bd938b3b3fc34b49bb686c6113e9e4931e3aa78`
|
||||
|
||||
SHA-256: `4cd48f3e5108bd6ebedf7301c3638839b8b2b9db8dbd493974177fbdeb91a01b`
|
||||
|
||||
来源:[`packages/api/session-controller/src/types.ts:391`](../packages/api/session-controller/src/types.ts) · [`packages/attachment/attachment/src/brand.ts:6`](../packages/attachment/attachment/src/brand.ts) · [`packages/compaction/compaction/src/brand.ts:4`](../packages/compaction/compaction/src/brand.ts) · [`packages/core/session/src/types.ts:21`](../packages/core/session/src/types.ts) · [`packages/experimental/webhook/src/brand.ts:12`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:6`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:9`](../packages/experimental/webhook/src/brand.ts) · [`packages/feedback/message-feedback/src/types.ts:14`](../packages/feedback/message-feedback/src/types.ts) · [`packages/goal/goal/src/types.ts:17`](../packages/goal/goal/src/types.ts) · [`packages/interaction/commands/src/brand.ts:22`](../packages/interaction/commands/src/brand.ts) · [`packages/interaction/user-approval/src/types.ts:17`](../packages/interaction/user-approval/src/types.ts) · [`packages/jobs/jobs/src/brand.ts:9`](../packages/jobs/jobs/src/brand.ts) · [`packages/llm/llm-retry/src/brand.ts:4`](../packages/llm/llm-retry/src/brand.ts) · [`packages/llm/llm/src/brand.ts:16`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:31`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:43`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:67`](../packages/llm/llm/src/brand.ts) · [`packages/schedule/schedule/src/types.ts:14`](../packages/schedule/schedule/src/types.ts) · [`packages/session/session-title/src/types.ts:17`](../packages/session/session-title/src/types.ts) · [`packages/team/agent-team/src/types.ts:20`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:32`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:8`](../packages/team/agent-team/src/types.ts) · [`packages/workflow/workflow/src/types.ts:14`](../packages/workflow/workflow/src/types.ts)
|
||||
来源:[`packages/api/session-controller/src/types.ts:383`](../packages/api/session-controller/src/types.ts) · [`packages/attachment/attachment/src/brand.ts:6`](../packages/attachment/attachment/src/brand.ts) · [`packages/compaction/compaction/src/brand.ts:4`](../packages/compaction/compaction/src/brand.ts) · [`packages/core/session/src/types.ts:21`](../packages/core/session/src/types.ts) · [`packages/experimental/webhook/src/brand.ts:12`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:6`](../packages/experimental/webhook/src/brand.ts) · [`packages/experimental/webhook/src/brand.ts:9`](../packages/experimental/webhook/src/brand.ts) · [`packages/feedback/message-feedback/src/types.ts:14`](../packages/feedback/message-feedback/src/types.ts) · [`packages/goal/goal/src/types.ts:17`](../packages/goal/goal/src/types.ts) · [`packages/interaction/commands/src/brand.ts:22`](../packages/interaction/commands/src/brand.ts) · [`packages/interaction/user-approval/src/types.ts:17`](../packages/interaction/user-approval/src/types.ts) · [`packages/jobs/jobs/src/brand.ts:9`](../packages/jobs/jobs/src/brand.ts) · [`packages/llm/llm-retry/src/brand.ts:4`](../packages/llm/llm-retry/src/brand.ts) · [`packages/llm/llm/src/brand.ts:16`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:31`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:43`](../packages/llm/llm/src/brand.ts) · [`packages/llm/llm/src/brand.ts:67`](../packages/llm/llm/src/brand.ts) · [`packages/schedule/schedule/src/types.ts:14`](../packages/schedule/schedule/src/types.ts) · [`packages/session/session-title/src/types.ts:17`](../packages/session/session-title/src/types.ts) · [`packages/team/agent-team/src/types.ts:20`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:32`](../packages/team/agent-team/src/types.ts) · [`packages/team/agent-team/src/types.ts:8`](../packages/team/agent-team/src/types.ts) · [`packages/workflow/workflow/src/types.ts:14`](../packages/workflow/workflow/src/types.ts)
|
||||
|
||||
`string`
|
||||
|
||||
@@ -6248,7 +6248,7 @@ SHA-256: `3e4e7683b0192c9f0e6a75c59076108f017892cdb302a98032c2632fd79c356f`
|
||||
|
||||
SHA-256: `da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582`
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:60`](../packages/session/working-directory/src/index.ts) · [`packages/session/working-directory/src/index.ts:65`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:61`](../packages/session/working-directory/src/index.ts) · [`packages/session/working-directory/src/index.ts:66`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
@@ -7344,7 +7344,7 @@ SHA-256: `db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c`
|
||||
|
||||
SHA-256: `8f1062573ea9184129dfdec43df1e8136eb5808746fd809bf6b539f3fd11362e`
|
||||
|
||||
来源:[`packages/api/session-controller/src/types.ts:402`](../packages/api/session-controller/src/types.ts)
|
||||
来源:[`packages/api/session-controller/src/types.ts:394`](../packages/api/session-controller/src/types.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
@@ -7877,7 +7877,7 @@ SHA-256: `8fcb0b44a575e998665c053643d1ab04c82f39253ebd190ac0c975b78e40b543`
|
||||
|
||||
SHA-256: `a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302`
|
||||
|
||||
来源:[`packages/api/session-controller/src/types.ts:400`](../packages/api/session-controller/src/types.ts)
|
||||
来源:[`packages/api/session-controller/src/types.ts:392`](../packages/api/session-controller/src/types.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
@@ -8002,7 +8002,7 @@ SHA-256: `9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94`
|
||||
|
||||
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
|
||||
|
||||
来源:[`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
|
||||
来源:[`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
@@ -8113,7 +8113,7 @@ SHA-256: `11f70b595aa76897fc4e25a352bfa718c659f44b799e5aa14e84e5a38fe72912`
|
||||
|
||||
SHA-256: `8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad`
|
||||
|
||||
来源:[`packages/interaction/permission-presets/src/index.ts:54`](../packages/interaction/permission-presets/src/index.ts)
|
||||
来源:[`packages/interaction/permission-presets/src/index.ts:61`](../packages/interaction/permission-presets/src/index.ts)
|
||||
|
||||
| 属性 | 存在性 | 类型 |
|
||||
|---|---|---|
|
||||
|
||||
Generated
+7
-7
@@ -163,7 +163,7 @@
|
||||
{"digest":"2142e391b9ccb60d487afcf373ce74db98d952f69e8289eddb352a7e16e996c5","names":[],"sources":[]},
|
||||
{"digest":"2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0","names":["packages/team/agent-team/src/types.ts#TeamMessageSource"],"sources":["packages/team/agent-team/src/types.ts:121"]},
|
||||
{"digest":"21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d","names":[],"sources":[]},
|
||||
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:48"]},
|
||||
{"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:49"]},
|
||||
{"digest":"224aa11d4d5f88c450822d01b99e6ca5e3a9c7f26a5ede10bae33384a09ef4dc","names":[],"sources":[]},
|
||||
{"digest":"234142ee4f996f38cc9fa3b8b3e3de29b03c9aefe5ebf6c224eddd564505aa85","names":[],"sources":[]},
|
||||
{"digest":"237c004c73b6b288246816e0d7fde16e09c63a47aa3b1227383d7afe58666163","names":[],"sources":[]},
|
||||
@@ -265,7 +265,7 @@
|
||||
{"digest":"4b259f7f8f0a44ad5e90b70a73553ced1df27012d126921d397ff403b6c86731","names":["packages/llm/llm/src/message.ts#ToolResultMessage"],"sources":["packages/llm/llm/src/message.ts:172"]},
|
||||
{"digest":"4b7ddaf3710b88ff9b8df66304f5f97bf03688fd19730eedc2e9535203c820ea","names":[],"sources":[]},
|
||||
{"digest":"4bb451330ff699f36b45539ceb0eb2606ead72084e2c5bb637c36cc80e2252db","names":[],"sources":["packages/core/session/src/types.ts:202"]},
|
||||
{"digest":"4cd48f3e5108bd6ebedf7301c3638839b8b2b9db8dbd493974177fbdeb91a01b","names":["packages/api/session-controller/src/types.ts#SessionRequestId","packages/attachment/attachment/src/brand.ts#AttachmentId","packages/compaction/compaction/src/brand.ts#CompactionId","packages/core/session/src/types.ts#SessionId","packages/experimental/webhook/src/brand.ts#WebhookDeliveryId","packages/experimental/webhook/src/brand.ts#WebhookRuleId","packages/experimental/webhook/src/brand.ts#WebhookSourceId","packages/feedback/message-feedback/src/types.ts#MessageFeedbackVersion","packages/goal/goal/src/types.ts#GoalId","packages/interaction/commands/src/brand.ts#CommandId","packages/interaction/user-approval/src/types.ts#ApprovalRequestId","packages/jobs/jobs/src/brand.ts#JobId","packages/llm/llm-retry/src/brand.ts#RetryId","packages/llm/llm/src/brand.ts#MessageId","packages/llm/llm/src/brand.ts#ProviderRequestId","packages/llm/llm/src/brand.ts#ReasoningEffortId","packages/llm/llm/src/brand.ts#ToolCallId","packages/schedule/schedule/src/types.ts#ScheduleId","packages/session/session-title/src/types.ts#SessionTitleProviderId","packages/team/agent-team/src/types.ts#TeamId","packages/team/agent-team/src/types.ts#TeamMessageId","packages/team/agent-team/src/types.ts#TeamTaskId","packages/workflow/workflow/src/types.ts#WorkflowRunId"],"sources":["packages/api/session-controller/src/types.ts:391","packages/attachment/attachment/src/brand.ts:6","packages/compaction/compaction/src/brand.ts:4","packages/core/session/src/types.ts:21","packages/experimental/webhook/src/brand.ts:12","packages/experimental/webhook/src/brand.ts:6","packages/experimental/webhook/src/brand.ts:9","packages/feedback/message-feedback/src/types.ts:14","packages/goal/goal/src/types.ts:17","packages/interaction/commands/src/brand.ts:22","packages/interaction/user-approval/src/types.ts:17","packages/jobs/jobs/src/brand.ts:9","packages/llm/llm-retry/src/brand.ts:4","packages/llm/llm/src/brand.ts:16","packages/llm/llm/src/brand.ts:31","packages/llm/llm/src/brand.ts:43","packages/llm/llm/src/brand.ts:67","packages/schedule/schedule/src/types.ts:14","packages/session/session-title/src/types.ts:17","packages/team/agent-team/src/types.ts:20","packages/team/agent-team/src/types.ts:32","packages/team/agent-team/src/types.ts:8","packages/workflow/workflow/src/types.ts:14"]},
|
||||
{"digest":"4cd48f3e5108bd6ebedf7301c3638839b8b2b9db8dbd493974177fbdeb91a01b","names":["packages/api/session-controller/src/types.ts#SessionRequestId","packages/attachment/attachment/src/brand.ts#AttachmentId","packages/compaction/compaction/src/brand.ts#CompactionId","packages/core/session/src/types.ts#SessionId","packages/experimental/webhook/src/brand.ts#WebhookDeliveryId","packages/experimental/webhook/src/brand.ts#WebhookRuleId","packages/experimental/webhook/src/brand.ts#WebhookSourceId","packages/feedback/message-feedback/src/types.ts#MessageFeedbackVersion","packages/goal/goal/src/types.ts#GoalId","packages/interaction/commands/src/brand.ts#CommandId","packages/interaction/user-approval/src/types.ts#ApprovalRequestId","packages/jobs/jobs/src/brand.ts#JobId","packages/llm/llm-retry/src/brand.ts#RetryId","packages/llm/llm/src/brand.ts#MessageId","packages/llm/llm/src/brand.ts#ProviderRequestId","packages/llm/llm/src/brand.ts#ReasoningEffortId","packages/llm/llm/src/brand.ts#ToolCallId","packages/schedule/schedule/src/types.ts#ScheduleId","packages/session/session-title/src/types.ts#SessionTitleProviderId","packages/team/agent-team/src/types.ts#TeamId","packages/team/agent-team/src/types.ts#TeamMessageId","packages/team/agent-team/src/types.ts#TeamTaskId","packages/workflow/workflow/src/types.ts#WorkflowRunId"],"sources":["packages/api/session-controller/src/types.ts:383","packages/attachment/attachment/src/brand.ts:6","packages/compaction/compaction/src/brand.ts:4","packages/core/session/src/types.ts:21","packages/experimental/webhook/src/brand.ts:12","packages/experimental/webhook/src/brand.ts:6","packages/experimental/webhook/src/brand.ts:9","packages/feedback/message-feedback/src/types.ts:14","packages/goal/goal/src/types.ts:17","packages/interaction/commands/src/brand.ts:22","packages/interaction/user-approval/src/types.ts:17","packages/jobs/jobs/src/brand.ts:9","packages/llm/llm-retry/src/brand.ts:4","packages/llm/llm/src/brand.ts:16","packages/llm/llm/src/brand.ts:31","packages/llm/llm/src/brand.ts:43","packages/llm/llm/src/brand.ts:67","packages/schedule/schedule/src/types.ts:14","packages/session/session-title/src/types.ts:17","packages/team/agent-team/src/types.ts:20","packages/team/agent-team/src/types.ts:32","packages/team/agent-team/src/types.ts:8","packages/workflow/workflow/src/types.ts:14"]},
|
||||
{"digest":"4d60dddaa65d3da8d4cd014d85ce3d2c2875664dd0433e331d8e9d395289686b","names":["packages/experimental/liveshare/src/host/viewer-principal.ts#ShareViewerPrincipal"],"sources":["packages/experimental/liveshare/src/host/viewer-principal.ts:24"]},
|
||||
{"digest":"4e011753f8263f436efaabfbb3b4db53a98fc55342c5ded2daf7208b217be159","names":[],"sources":[]},
|
||||
{"digest":"4e44c9118152f6829634bfd508e47669ab0497caffa380c94b4be91f9390d35d","names":[],"sources":[]},
|
||||
@@ -364,7 +364,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":[]},
|
||||
@@ -419,7 +419,7 @@
|
||||
{"digest":"88a610b831be6d92612a464be5c7d0b88ec24d97bd299837bf74bf7672183c9a","names":[],"sources":["packages/llm/llm/src/types.ts:500"]},
|
||||
{"digest":"8a046b52331959aa3394680d6acbe09b8a5447c6b61375f263445bfcef19b7f1","names":[],"sources":[]},
|
||||
{"digest":"8a6e1ec9e8db346b0e02f027db73c07a94f067a26d40c1aef1abd09c47ce7ba0","names":[],"sources":[]},
|
||||
{"digest":"8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad","names":[],"sources":["packages/interaction/permission-presets/src/index.ts:54"]},
|
||||
{"digest":"8a9c990773f798eac10ca8878e6bcc531ee080bc589cac956730e462cc6a09ad","names":[],"sources":["packages/interaction/permission-presets/src/index.ts:61"]},
|
||||
{"digest":"8ad45ad053b4d89f8865c17cc9ff3b8748e86045f3f0fb816269a34af2619141","names":[],"sources":["packages/experimental/hook-protocol/src/types.ts:31"]},
|
||||
{"digest":"8af841fc9b265ade3441caf9fe40dd24db24226befba48150e6d0eeccc1389c3","names":[],"sources":[]},
|
||||
{"digest":"8bb8c3751a6ce64b61aba1ec7ae798c00a5803c4d868a0430873216c6569ed52","names":[],"sources":["packages/session/session-log-deepseek/src/types.ts:96"]},
|
||||
@@ -430,7 +430,7 @@
|
||||
{"digest":"8e611bf46821e5003a1605a73560a6f56388295149d449dfe2142d5ec335f29c","names":["packages/llm/llm/src/types.ts#ToolAdditionBlock"],"sources":["packages/llm/llm/src/types.ts:122"]},
|
||||
{"digest":"8e8155594e07812356b67d732196dda894b0f9c91a5969d51612cf490b0a016d","names":[],"sources":[]},
|
||||
{"digest":"8e8e91646a5cae3fc78f7532a0013ff2088ae47077642c2edd507a508209b8af","names":["packages/schedule/schedule/src/types.ts#OneShotScheduleDispatchChange"],"sources":["packages/schedule/schedule/src/types.ts:213"]},
|
||||
{"digest":"8f1062573ea9184129dfdec43df1e8136eb5808746fd809bf6b539f3fd11362e","names":[],"sources":["packages/api/session-controller/src/types.ts:402"]},
|
||||
{"digest":"8f1062573ea9184129dfdec43df1e8136eb5808746fd809bf6b539f3fd11362e","names":[],"sources":["packages/api/session-controller/src/types.ts:394"]},
|
||||
{"digest":"8f324cea3916c0517261e88167def8efb3a9994c1135e23d40ed9fd48f8c7bd4","names":[],"sources":[]},
|
||||
{"digest":"8f6d609794bf5afc01d7ccf3e03811d32f4b8047f58a2c9a98db0154c2ad7cb9","names":[],"sources":[]},
|
||||
{"digest":"8faed5b52ab2d2df40b94a926d0f0faa75280bddcc4b17b6bdd9c8bfed7c34b5","names":[],"sources":[]},
|
||||
@@ -484,7 +484,7 @@
|
||||
{"digest":"a3c6f1ea38e9a61d7a9706057ba65aabe02dfe6d9dd90d4736aa62325d874531","names":[],"sources":[]},
|
||||
{"digest":"a3edd1efd1fef21b72c55e213c8a8b24196b091abde2b89db52be0b2aaae3cfa","names":[],"sources":[]},
|
||||
{"digest":"a43327a1739c3fa477f32981071fef7d8ba6ae5f32a84fd70f547b2eee59e93e","names":[],"sources":[]},
|
||||
{"digest":"a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302","names":[],"sources":["packages/api/session-controller/src/types.ts:400"]},
|
||||
{"digest":"a4afec59b75aad5d13ef82d6931f35cc2d98918503916cf069355b77c5e42302","names":[],"sources":["packages/api/session-controller/src/types.ts:392"]},
|
||||
{"digest":"a6567ccb2e530606b775371eb4fa31468d72084339968e8b0440a516a23b39dc","names":[],"sources":[]},
|
||||
{"digest":"a6b41f5bede8094d7bf635be5d69b1bd7a25e006ca9cf9415bceb9322f1a7feb","names":["packages/experimental/hook-protocol/src/types.ts#HookDialect"],"sources":["packages/experimental/hook-protocol/src/types.ts:48"]},
|
||||
{"digest":"a6da9ad5d42ae83a6833a8288b076688e8e0801633ea36cbdd8a30a6d9f3160c","names":["packages/workflow/tool-workflow/src/types.ts#ToolWorkflowRunStartData"],"sources":["packages/workflow/tool-workflow/src/types.ts:14"]},
|
||||
@@ -611,7 +611,7 @@
|
||||
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
|
||||
{"digest":"d9c462b9f62fdd3efc76a44b9524dc8781f6b91cd9c7e584b17d971defafebab","names":["packages/llm/llm/src/message.ts#ToolMessageSource"],"sources":["packages/llm/llm/src/message.ts:28"]},
|
||||
{"digest":"d9edf1862e4471d6ad8a106a3f4160e0643874368707d50ecd8e27e5ee7a2567","names":[],"sources":[]},
|
||||
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:60","packages/session/working-directory/src/index.ts:65"]},
|
||||
{"digest":"da60ed58a8fa23d7aa4920ab5c1f4e3d28109cb0797ef9e5c8b125721b847582","names":[],"sources":["packages/session/working-directory/src/index.ts:61","packages/session/working-directory/src/index.ts:66"]},
|
||||
{"digest":"dacf3d5f3e4ff619c1320e64a48dec5e7ecd7870bece65fbd449a0e63adfa521","names":[],"sources":[]},
|
||||
{"digest":"db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c","names":[],"sources":[]},
|
||||
{"digest":"db6c5246911d47a7969f6b4cb47c7d0dbbde75c402710b22ace3672fa97bebe0","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
|
||||
|
||||
Loaded 100 of 763 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user