@zaalipro/dsh-workflows 0.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE.md +224 -0
- package/README.i18n.yaml +4 -0
- package/README.md +109 -0
- package/README.zh.md +109 -0
- package/cordis.patch.yml +10 -0
- package/docs/architecture.i18n.yaml +4 -0
- package/docs/architecture.md +177 -0
- package/docs/architecture.zh.md +177 -0
- package/docs/testing.i18n.yaml +4 -0
- package/docs/testing.md +125 -0
- package/docs/testing.zh.md +125 -0
- package/docs/user-guide.i18n.yaml +4 -0
- package/docs/user-guide.md +351 -0
- package/docs/user-guide.zh.md +351 -0
- package/lib/client-types/WorkflowMemberInspector.d.ts +28 -0
- package/lib/client-types/WorkflowMemberInspector.d.ts.map +1 -0
- package/lib/client-types/WorkflowMemberInspector.js +181 -0
- package/lib/client-types/WorkflowMemberInspector.js.map +1 -0
- package/lib/client-types/WorkflowRunPanel.d.ts +43 -0
- package/lib/client-types/WorkflowRunPanel.d.ts.map +1 -0
- package/lib/client-types/WorkflowRunPanel.js +130 -0
- package/lib/client-types/WorkflowRunPanel.js.map +1 -0
- package/lib/client-types/WorkflowsDashboard.d.ts +49 -0
- package/lib/client-types/WorkflowsDashboard.d.ts.map +1 -0
- package/lib/client-types/WorkflowsDashboard.js +942 -0
- package/lib/client-types/WorkflowsDashboard.js.map +1 -0
- package/lib/client-types/adapter.d.ts +60 -0
- package/lib/client-types/adapter.d.ts.map +1 -0
- package/lib/client-types/adapter.js +117 -0
- package/lib/client-types/adapter.js.map +1 -0
- package/lib/client-types/chat-renderer.d.ts +10 -0
- package/lib/client-types/chat-renderer.d.ts.map +1 -0
- package/lib/client-types/chat-renderer.js +11 -0
- package/lib/client-types/chat-renderer.js.map +1 -0
- package/lib/client-types/contract.d.ts +210 -0
- package/lib/client-types/contract.d.ts.map +1 -0
- package/lib/client-types/contract.js +37 -0
- package/lib/client-types/contract.js.map +1 -0
- package/lib/client-types/controller.d.ts +83 -0
- package/lib/client-types/controller.d.ts.map +1 -0
- package/lib/client-types/controller.js +705 -0
- package/lib/client-types/controller.js.map +1 -0
- package/lib/client-types/index.d.ts +19 -0
- package/lib/client-types/index.d.ts.map +1 -0
- package/lib/client-types/index.js +730 -0
- package/lib/client-types/index.js.map +1 -0
- package/lib/client-types/locales.d.ts +257 -0
- package/lib/client-types/locales.d.ts.map +1 -0
- package/lib/client-types/locales.js +270 -0
- package/lib/client-types/locales.js.map +1 -0
- package/lib/client-types/slot-components.d.ts +38 -0
- package/lib/client-types/slot-components.d.ts.map +1 -0
- package/lib/client-types/slot-components.js +22 -0
- package/lib/client-types/slot-components.js.map +1 -0
- package/lib/client-types/store.d.ts +69 -0
- package/lib/client-types/store.d.ts.map +1 -0
- package/lib/client-types/store.js +135 -0
- package/lib/client-types/store.js.map +1 -0
- package/lib/client-types/workflow-definition.d.ts +52 -0
- package/lib/client-types/workflow-definition.d.ts.map +1 -0
- package/lib/client-types/workflow-definition.js +135 -0
- package/lib/client-types/workflow-definition.js.map +1 -0
- package/lib/client.js +11064 -0
- package/lib/client.js.map +1 -0
- package/lib/compat-engine/index.js +1926 -0
- package/lib/compat-engine/index.js.map +1 -0
- package/lib/compat-engine/worker.cjs +1500 -0
- package/lib/compat-engine/worker.cjs.map +1 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +1709 -0
- package/lib/typert.remote-client.d.ts +57 -0
- package/lib/typert.remote-client.js +1662 -0
- package/lib/types/commands/aliases.d.ts +4 -0
- package/lib/types/commands/aliases.d.ts.map +1 -0
- package/lib/types/commands/aliases.js +25 -0
- package/lib/types/commands/aliases.js.map +1 -0
- package/lib/types/commands/index.d.ts +66 -0
- package/lib/types/commands/index.d.ts.map +1 -0
- package/lib/types/commands/index.js +550 -0
- package/lib/types/commands/index.js.map +1 -0
- package/lib/types/commands/parser.d.ts +17 -0
- package/lib/types/commands/parser.d.ts.map +1 -0
- package/lib/types/commands/parser.js +45 -0
- package/lib/types/commands/parser.js.map +1 -0
- package/lib/types/config.d.ts +71 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +109 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/index.d.ts +41 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +483 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/invariant.d.ts +21 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +85 -0
- package/lib/types/invariant.js.map +1 -0
- package/lib/types/registry/definition.d.ts +24 -0
- package/lib/types/registry/definition.d.ts.map +1 -0
- package/lib/types/registry/definition.js +189 -0
- package/lib/types/registry/definition.js.map +1 -0
- package/lib/types/registry/index.d.ts +100 -0
- package/lib/types/registry/index.d.ts.map +1 -0
- package/lib/types/registry/index.js +899 -0
- package/lib/types/registry/index.js.map +1 -0
- package/lib/types/registry/names.d.ts +19 -0
- package/lib/types/registry/names.d.ts.map +1 -0
- package/lib/types/registry/names.js +69 -0
- package/lib/types/registry/names.js.map +1 -0
- package/lib/types/registry/remote.d.ts +15 -0
- package/lib/types/registry/remote.d.ts.map +1 -0
- package/lib/types/registry/remote.js +128 -0
- package/lib/types/registry/remote.js.map +1 -0
- package/lib/types/registry/roots.d.ts +44 -0
- package/lib/types/registry/roots.d.ts.map +1 -0
- package/lib/types/registry/roots.js +118 -0
- package/lib/types/registry/roots.js.map +1 -0
- package/lib/types/registry/types.d.ts +62 -0
- package/lib/types/registry/types.d.ts.map +1 -0
- package/lib/types/registry/types.js +2 -0
- package/lib/types/registry/types.js.map +1 -0
- package/lib/types/registry/watchers.d.ts +70 -0
- package/lib/types/registry/watchers.d.ts.map +1 -0
- package/lib/types/registry/watchers.js +152 -0
- package/lib/types/registry/watchers.js.map +1 -0
- package/lib/types/remote-events.d.ts +42 -0
- package/lib/types/remote-events.d.ts.map +1 -0
- package/lib/types/remote-events.js +21 -0
- package/lib/types/remote-events.js.map +1 -0
- package/lib/types/run-recorder.d.ts +44 -0
- package/lib/types/run-recorder.d.ts.map +1 -0
- package/lib/types/run-recorder.js +356 -0
- package/lib/types/run-recorder.js.map +1 -0
- package/lib/types/supervisor/canned-validate.d.ts +25 -0
- package/lib/types/supervisor/canned-validate.d.ts.map +1 -0
- package/lib/types/supervisor/canned-validate.js +122 -0
- package/lib/types/supervisor/canned-validate.js.map +1 -0
- package/lib/types/supervisor/completion-notice.d.ts +49 -0
- package/lib/types/supervisor/completion-notice.d.ts.map +1 -0
- package/lib/types/supervisor/completion-notice.js +281 -0
- package/lib/types/supervisor/completion-notice.js.map +1 -0
- package/lib/types/supervisor/cursors.d.ts +68 -0
- package/lib/types/supervisor/cursors.d.ts.map +1 -0
- package/lib/types/supervisor/cursors.js +158 -0
- package/lib/types/supervisor/cursors.js.map +1 -0
- package/lib/types/supervisor/engine-compat.d.ts +48 -0
- package/lib/types/supervisor/engine-compat.d.ts.map +1 -0
- package/lib/types/supervisor/engine-compat.js +116 -0
- package/lib/types/supervisor/engine-compat.js.map +1 -0
- package/lib/types/supervisor/index.d.ts +183 -0
- package/lib/types/supervisor/index.d.ts.map +1 -0
- package/lib/types/supervisor/index.js +2040 -0
- package/lib/types/supervisor/index.js.map +1 -0
- package/lib/types/supervisor/parallel-compat.d.ts +36 -0
- package/lib/types/supervisor/parallel-compat.d.ts.map +1 -0
- package/lib/types/supervisor/parallel-compat.js +180 -0
- package/lib/types/supervisor/parallel-compat.js.map +1 -0
- package/lib/types/supervisor/remote.d.ts +25 -0
- package/lib/types/supervisor/remote.d.ts.map +1 -0
- package/lib/types/supervisor/remote.js +478 -0
- package/lib/types/supervisor/remote.js.map +1 -0
- package/lib/types/supervisor/storage/bounded-file.d.ts +41 -0
- package/lib/types/supervisor/storage/bounded-file.d.ts.map +1 -0
- package/lib/types/supervisor/storage/bounded-file.js +186 -0
- package/lib/types/supervisor/storage/bounded-file.js.map +1 -0
- package/lib/types/supervisor/storage/details-codec.d.ts +14 -0
- package/lib/types/supervisor/storage/details-codec.d.ts.map +1 -0
- package/lib/types/supervisor/storage/details-codec.js +359 -0
- package/lib/types/supervisor/storage/details-codec.js.map +1 -0
- package/lib/types/supervisor/storage/index.d.ts +26 -0
- package/lib/types/supervisor/storage/index.d.ts.map +1 -0
- package/lib/types/supervisor/storage/index.js +100 -0
- package/lib/types/supervisor/storage/index.js.map +1 -0
- package/lib/types/supervisor/storage/lease.d.ts +34 -0
- package/lib/types/supervisor/storage/lease.d.ts.map +1 -0
- package/lib/types/supervisor/storage/lease.js +289 -0
- package/lib/types/supervisor/storage/lease.js.map +1 -0
- package/lib/types/supervisor/storage/manifest-codec.d.ts +10 -0
- package/lib/types/supervisor/storage/manifest-codec.d.ts.map +1 -0
- package/lib/types/supervisor/storage/manifest-codec.js +335 -0
- package/lib/types/supervisor/storage/manifest-codec.js.map +1 -0
- package/lib/types/supervisor/storage/manifest-store.d.ts +99 -0
- package/lib/types/supervisor/storage/manifest-store.d.ts.map +1 -0
- package/lib/types/supervisor/storage/manifest-store.js +1606 -0
- package/lib/types/supervisor/storage/manifest-store.js.map +1 -0
- package/lib/types/supervisor/storage/manifest-types.d.ts +269 -0
- package/lib/types/supervisor/storage/manifest-types.d.ts.map +1 -0
- package/lib/types/supervisor/storage/manifest-types.js +2 -0
- package/lib/types/supervisor/storage/manifest-types.js.map +1 -0
- package/lib/types/supervisor/storage/private-root.d.ts +143 -0
- package/lib/types/supervisor/storage/private-root.d.ts.map +1 -0
- package/lib/types/supervisor/storage/private-root.js +860 -0
- package/lib/types/supervisor/storage/private-root.js.map +1 -0
- package/lib/types/supervisor/storage/recovery.d.ts +14 -0
- package/lib/types/supervisor/storage/recovery.d.ts.map +1 -0
- package/lib/types/supervisor/storage/recovery.js +126 -0
- package/lib/types/supervisor/storage/recovery.js.map +1 -0
- package/lib/types/supervisor/storage/run-files.d.ts +67 -0
- package/lib/types/supervisor/storage/run-files.d.ts.map +1 -0
- package/lib/types/supervisor/storage/run-files.js +346 -0
- package/lib/types/supervisor/storage/run-files.js.map +1 -0
- package/lib/types/supervisor/types.d.ts +295 -0
- package/lib/types/supervisor/types.d.ts.map +1 -0
- package/lib/types/supervisor/types.js +3 -0
- package/lib/types/supervisor/types.js.map +1 -0
- package/lib/types/supervisor/value-view.d.ts +19 -0
- package/lib/types/supervisor/value-view.d.ts.map +1 -0
- package/lib/types/supervisor/value-view.js +183 -0
- package/lib/types/supervisor/value-view.js.map +1 -0
- package/lib/types/tool/index.d.ts +86 -0
- package/lib/types/tool/index.d.ts.map +1 -0
- package/lib/types/tool/index.js +810 -0
- package/lib/types/tool/index.js.map +1 -0
- package/lib/types/tool/schema.d.ts +158 -0
- package/lib/types/tool/schema.d.ts.map +1 -0
- package/lib/types/tool/schema.js +137 -0
- package/lib/types/tool/schema.js.map +1 -0
- package/lib/types/types.d.ts +9 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/types.js +3 -0
- package/lib/types/types.js.map +1 -0
- package/lib/types/user-questions.d.ts +9 -0
- package/lib/types/user-questions.d.ts.map +1 -0
- package/lib/types/user-questions.js +91 -0
- package/lib/types/user-questions.js.map +1 -0
- package/package.json +273 -0
- package/skills/create-workflow/SKILL.md +166 -0
- package/vendor/workflow-engine/LICENSE +21 -0
- package/vendor/workflow-engine/README.md +1 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# 用户指南
|
|
2
|
+
|
|
3
|
+
[English](user-guide.md) | 中文
|
|
4
|
+
|
|
5
|
+
本教程带领 Web 或 headless 用户完成安装、一个保存的 JavaScript definition、一次 validation smoke、一次 background run、详细检查、control 与 recovery。**Saved definition** 是磁盘上的 authoring input;**live 或 retained run** 是 immutable admitted execution record。`/workflows` 列出已保存 definition(可 Start)以及 live 或 retained run。
|
|
6
|
+
|
|
7
|
+
## 1. 安装到兼容 Harness
|
|
8
|
+
|
|
9
|
+
使用官方 DeepSeek Harness `0.1.1-rc.2` 与 plugin `0.1.0-rc.3`。确保 service user 的 `PATH` 中有 `pnpm`;`0.1.0-rc.8` 与尚未验证的更高 Harness release 均不受支持。
|
|
10
|
+
|
|
11
|
+
安装 pinned release tag,或 durable absolute path 下的 exact tested tarball:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
dsh plugin --profile web add github:zaalipro/dsh-workflows#v0.1.0-rc.3
|
|
15
|
+
dsh plugin --profile headless add /absolute/path/zaalipro-dsh-workflows-0.1.0-rc.3.tgz
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
发布到 npm 后,`dsh plugin --profile <profile> add @zaalipro/dsh-workflows@0.1.0-rc.3` 与之等价。
|
|
19
|
+
|
|
20
|
+
重启 profile。Web 除 Host behavior 外还获得 dashboard 与 durable Chat renderer;headless 获得 registry、supervisor、command、question、recorder 与 model tool,但不加载 browser code。移除见 [package README](../README.zh.md#安装)。
|
|
21
|
+
|
|
22
|
+
## 2. 创建 project definition
|
|
23
|
+
|
|
24
|
+
在 cwd 属于目标 project 的 Session 中输入:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
/create-workflow review workspace changes, verify every finding, and write a report
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
命令准确回复:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
Opened the workflow authoring skill.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
该命令会 steer 同一条以 `/create-workflow` 开头的 user message。Packaged skill 是 user-invocable,因此兼容 Host 会确定性地把受信 instructions 注入下一次 model step,而不是依赖 model 从 catalog 中自行选择这个 skill。
|
|
37
|
+
|
|
38
|
+
Packaged skill 会询问 intent、input、fan-out、evidence、failure tolerance、final artifact、maximum agent、lowercase kebab name 以及 project 或 user scope。选择 **project** 会把 `review-changes.workflow.json` 保存到最近 Git root 的 `.dsh/workflows` directory。没有 Git root 时,Session cwd 就是 project root。选择 **user** 会保存到 `$DSH_HOME/workflows`。
|
|
39
|
+
|
|
40
|
+
Definition 使用 first-wins precedence:configured bundled root、project root、user root。更高 precedence 的同名 definition 可以让新保存的低 precedence file 继续 shadowed。File 必须扁平、regular、UTF-8、不超过默认配置的 1 MiB,并使用有效 lowercase kebab stem。
|
|
41
|
+
|
|
42
|
+
保存的 envelope 准确包含 `meta` 和 `script`;metadata 保持 JSON data,body 保持 plain JavaScript:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"meta": {
|
|
47
|
+
"name": "review-changes",
|
|
48
|
+
"description": "Review workspace changes and verify every finding",
|
|
49
|
+
"whenToUse": "Before requesting merge",
|
|
50
|
+
"phases": [
|
|
51
|
+
{ "title": "Review", "detail": "Collect bounded evidence" },
|
|
52
|
+
{ "title": "Verify", "detail": "Challenge every retained finding" },
|
|
53
|
+
{ "title": "Report", "detail": "Publish the final artifact" }
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"script": "phase(\"Review\");\n// JavaScript body omitted here; see the complete pattern below."
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`phase(title)` 与 `agent(..., { phase })` 中的 phase title 必须准确匹配 metadata title。Metadata 只声明 presentation;它绝不作为 host code 求值。
|
|
61
|
+
|
|
62
|
+
## 3. 理解 validation smoke
|
|
63
|
+
|
|
64
|
+
Authoring skill 会用 representative args 请求 model-facing workflow tool 验证并保存拟议 inline source。`save_scope` 默认为 `project`;要保存到 `$DSH_HOME/workflows` 则选择 `user`。User-scope save 不要求 Session cwd。
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"script": "<plain JavaScript workflow body>",
|
|
69
|
+
"meta": {
|
|
70
|
+
"name": "review-changes",
|
|
71
|
+
"description": "Review workspace changes and verify every finding"
|
|
72
|
+
},
|
|
73
|
+
"args": { "targets": ["src", "tests"] },
|
|
74
|
+
"validate_only": true,
|
|
75
|
+
"save_scope": "project"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
成功 result 的 status 是 `validated`,不会创建 child、run id、directory、display ordinal、dashboard row、completion notice 或 durable workflow event,并且会声明:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
Validated one args-selected path with canned agent results; other branches, live tools, and live schema responses were not covered.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Engine 先解析**完整** script,然后使用 canned schema-shaped agent output 与 in-memory scratch capability,只执行这些 args 选择的 path。Gate 会以 `would pause: <message>` 成功结束 smoke。应把它视为 syntax、hook-contract 和 one-path evidence,而不是所有 branch 或 real provider behavior 的证明。保存前修复任何 filename/line diagnostic 并重新 validation。
|
|
86
|
+
|
|
87
|
+
## 4. 启动 background run
|
|
88
|
+
|
|
89
|
+
Canonical command 接受一个保存名称和可选 JSON object:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
/workflow review-changes {"targets":["src","tests"]}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
它不等待 agent 就返回:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
Started workflow "review-changes" in the background. Open /workflows to watch it.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
没有普通 slash command 冲突时,保存的 definition 也拥有 named alias:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
/review-changes {"targets":["src","tests"]}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
如果普通命令拥有 `/review-changes`,该命令保留它,workflow 获得第一个可用的 repeated-prefix alias,例如 `/workflow-review-changes`;canonical `/workflow review-changes` 始终有效。第一个 run 是 `review-changes`,之后是 `review-changes-2`、`review-changes-3` 等。这些 display name 是 human command 与 title 使用的唯一 handle。
|
|
108
|
+
|
|
109
|
+
裸 `/workflow` 在 Web 中打开 definition picker,在 headless 中返回以下 usage:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
Launch or control a workflow.
|
|
113
|
+
|
|
114
|
+
Usage:
|
|
115
|
+
/workflow <name> [<json-args>]
|
|
116
|
+
/workflow pause <display-name>
|
|
117
|
+
/workflow resume <display-name>
|
|
118
|
+
/workflow stop <display-name>
|
|
119
|
+
/workflow save <display-name>
|
|
120
|
+
|
|
121
|
+
Examples:
|
|
122
|
+
/workflow review-changes {"target":"origin/main...HEAD"}
|
|
123
|
+
/workflow pause review-changes
|
|
124
|
+
/workflow resume review-changes
|
|
125
|
+
/workflow stop review-changes-2
|
|
126
|
+
/workflow save review-changes
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Argument 必须是一个 JSON object。Array 与 scalar 会在 launch 前失败;malformed trailing text 不会被修复或转发给 model。
|
|
130
|
+
|
|
131
|
+
## 5. 打开 run dashboard
|
|
132
|
+
|
|
133
|
+
在 Web 中提交严格的裸命令:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
/workflows
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
这个仅由浏览器处理的 slash action 会打开 label 为 `Workflows` 的 dialog;它既不执行 Host command,也不调用模型,并且不会创建 command Chat row。带 argument 或 attachment 的 `/workflows` 不会打开 overlay;它会在本地被拒绝,draft 与 attachment 均保持不变。Dashboard chrome 与 Chat label 跟随 host locale:本包注册 English 与 Chinese dictionary,English 为 fallback,关闭控件的可见文字与 accessible name 都是 `Close workflows`(中文 locale 下为 `关闭工作流`)。Inspector heading(`Pending`、`JSON outcome` 以及 criterion 11.4 的其余 heading)和 criterion 11.4/11.11 的精确 error string 保持英文。
|
|
140
|
+
|
|
141
|
+
Dashboard 先列出已保存 definition 并提供 Start,然后是 run navigator(display name、status、current phase、agent spent/total、running 与 settled member count、bounded terminal summary,以及 retained-run loaded/total disclosure)。Active run 按最早优先排序,history 按最新 settlement 排序。`Load more` 获取下一个 authorized bounded page;只有 terminal row 可按确定性 oldest-first retention evict,active row 与 display ordinal history 永不 evict。
|
|
142
|
+
|
|
143
|
+
宽度至少 1,200 px 时,navigator、execution detail 和 inspector 是三个独立 scroll pane。低于 1,200 px 时保留 navigation 与一个 detail pane。低于 768 px 时使用明确的 **Runs -> Execution -> Inspector** drill-down;同一流程在 320 px 下也不会产生 page horizontal overflow。
|
|
144
|
+
|
|
145
|
+
## 6. 检查 execution 与 member
|
|
146
|
+
|
|
147
|
+
选择一个 run,然后打开其 run disclosure 查看 declared/current phase、status、progress、control、log、terminal result 或 error、artifact 与 retention disclosure。打开 `Inspect · N members` 显示 member roster。Running 与 abnormal group 保持打开;completed clean phase 可以 collapse 且不丢失 detail。
|
|
148
|
+
|
|
149
|
+
Member lifecycle state 是 **queued/pending**、**running**、**completed**、**failed** 与 **cancelled**。普通 child failure 是 settled failed member,其 script-visible result 为 JSON `null`;infrastructure failure 则使 logical run 失败。选择 member 后加载一种明确 outcome presentation:
|
|
150
|
+
|
|
151
|
+
- `Pending`——member 尚无 settled outcome。
|
|
152
|
+
- `JSON outcome`——完整 retained JSON value,包括真正的 JSON `null`。
|
|
153
|
+
- `Text outcome`——完整 Markdown 或 plain text。
|
|
154
|
+
- `Value outcome`——除 `null` 外的 retained JSON primitive。
|
|
155
|
+
- `Truncated outcome`——deterministic preview 加 retained/total UTF-8 byte count。
|
|
156
|
+
- `No outcome produced`——member settle 时没有 output value。
|
|
157
|
+
- `Outcome evicted`——retention 明确移除了完整 detail,但保留该事实。
|
|
158
|
+
|
|
159
|
+
`Child transcript unavailable` 与 retained outcome 分离:direct one-shot child address 可能已消失,outcome 仍可检查。带 `Retry` 的 `Unable to load member outcome` 是 request failure;先前成功 page 与 detail 保持可见。Child navigation 在打开 transcript 前刷新 current direct-child catalog,并拒绝 stale 或 foreign address。
|
|
160
|
+
|
|
161
|
+
Log 按稳定 index order 加载。Result absence、JSON `null`、truncation、eviction 与 request failure 都呈现为不同事实。Scratch artifact 列出安全单 component name 与 size;打开后获取 bounded UTF-8 chunk,`Load more` 从已调整到完整 code-point boundary 的 byte cursor 继续。Changed、invalid UTF-8 或 unsafe artifact 会 inline failure,但不清除已加载 run detail。
|
|
162
|
+
|
|
163
|
+
## 7. 回应 gate
|
|
164
|
+
|
|
165
|
+
`await_user(kind, message)` 与 `pause(kind, message)` 都会 park run,并显示一个带 `Resume workflow` 的 `Workflow · <display-name>` question,但 replay semantic 不同:
|
|
166
|
+
|
|
167
|
+
- `await_user` acknowledgement 会继续同一 live engine attempt。Satisfied gate commit 后,之后的 journal replay 会跳过它。
|
|
168
|
+
- `pause` 是 uncommitted condition。Acknowledgement 会启动 replay,同一 condition 若仍成立就再次询问。
|
|
169
|
+
|
|
170
|
+
Dismiss、withdraw、abort 或回答 obsolete question 都会让 run 保持 parked。本包只 resume exact live Session/Agent/logical-run/execution/gate/generation tuple;late answer 不能 resume 新 attempt 或其他 run。
|
|
171
|
+
|
|
172
|
+
## 8. Pause、resume、stop 与 save
|
|
173
|
+
|
|
174
|
+
使用 dashboard button、受保护的 P/R/X/S shortcut,或 display-name command:
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
/workflow pause review-changes
|
|
178
|
+
/workflow resume review-changes
|
|
179
|
+
/workflow stop review-changes-2
|
|
180
|
+
/workflow save review-changes
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
成功 command reply 是准确文本:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
Paused workflow "review-changes". Open /workflows to resume or stop it.
|
|
187
|
+
Resumed workflow "review-changes". Open /workflows to watch it.
|
|
188
|
+
Stopped workflow "review-changes-2".
|
|
189
|
+
Saved workflow "review-changes" to <path>.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Pause 停止新 work,取消并排空 current attempt,只在保留 quiescent checkpoint 后发布 `paused`。Resume 使用 immutable admitted script 与 args,而不是后来对 `script.js` 的编辑;匹配的 committed hook replay 不增加 spend。Stop 取消 admitted child 与 scratch operation,配对其 ending,丢弃 replay authority,并在 cleanup 后发布 terminal `cancelled`。
|
|
193
|
+
|
|
194
|
+
Save 只适用于非 built-in、unnumbered、非 Interrupted 且拥有 safe live editable projection 的 run。Built-in 或 numbered handle 要求用新的唯一 `meta.name` 保存 edited copy;低 precedence saved file 可能继续 shadowed。Save 默认指向 project scope,也可使用明确支持的 user scope。
|
|
195
|
+
|
|
196
|
+
每个 dashboard control 都携带当前 visible revision,禁用 duplicate submission,并 merge authoritative returned row。如果另一个 update 先胜出,不产生 control side effect,dashboard 显示:
|
|
197
|
+
|
|
198
|
+
```text
|
|
199
|
+
workflow run changed; refresh it before applying a control
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
其他 non-domain control failure 显示 `Unable to update workflow. Retry.` 和有 label 的 `Retry`;abort 与 stale-selection failure 保持安静。
|
|
203
|
+
|
|
204
|
+
## 9. 处理 budget、completion 与 process exit
|
|
205
|
+
|
|
206
|
+
`budget()` 返回 `{ total, spent, reserved: 0, remaining }`。Default total 是 128,admitted run 可使用 1 到 1,024 的 absolute cap。Spend 在 same-process attempt 间累计;journal replay 与 schema-correction retry spend 为零。Declarative `parallel()` panel 会对所有 unreplayed job 做 atomic preflight,而 arbitrary thunk 会接纳每个 concrete `agent()` call,因为其 future count 不可预知。
|
|
207
|
+
|
|
208
|
+
Cap 停止 run 时,dashboard 显示 **Budget limited**,提供 Stop 但没有 human Resume。只能通过 model tool resume,并使用以下明确标注为 internal 的 reference shape:
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"resume_from_run_id": "<internal-run-id>",
|
|
213
|
+
"agent_budget": 256
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Absolute `agent_budget` 必须高于旧 total 且不超过 1,024。Human command、dashboard Resume 或 absent/equal/lower/excessive cap 会返回 `workflow "<display-name>" requires a higher agent_budget to resume`,不启动新 attempt。Internal run id 只属于该 model-tool exchange,绝不放入 screenshot、command text、title、notice 或 accessibility label。
|
|
218
|
+
|
|
219
|
+
符合条件的 terminal run 会尝试一次 bounded owner completion notice,优先使用 `scratch/report.md`,其次使用 inline result,并以 `Open /workflows to inspect the run.` 结尾。它是 at-most-once delivery:crash 可以遗漏 claimed notice,绝不能重复它。
|
|
220
|
+
|
|
221
|
+
Host process exit 后,startup recovery 把所有 retained active run 改为 **Interrupted**,把 running member 改为 cancelled,显示 `Process exited before workflow settlement.`,并且只提供 inspection。Journal、checkpoint、Agent、script/args authority、gate 或 child handle 都不跨进程;Interrupted run 不能 Resume 或 Save。检查是否已有 uncommitted external effect 发生后,再从 saved definition 启动新 run。
|
|
222
|
+
|
|
223
|
+
## 10. 编写 replay-safe JavaScript
|
|
224
|
+
|
|
225
|
+
Worker 提供 `args`、`agent`、thunk/declarative `parallel`、`pipeline`、`phase`、`log`、`complete`、`budget`、`pause`、`await_user`、`read_scratch_file` 和 `write_scratch_file`。`agent(prompt, opts)` 准确接受 `label`、`phase`、`schema`、`provider` 和 `model`。Stock worker 没有原生 `complete`,因此本包会注入该 hook。
|
|
226
|
+
|
|
227
|
+
Structured schema 支持 `type`、`properties`、`required`、`additionalProperties`、`items`、`minItems`、`maxItems`、`enum`、`const` 与 `oneOf`。`minItems` 和 `maxItems` 是包含端点的 array-length bound。每个 bound 都必须是非负 safe integer(负零、小数和非 number 均无效),只能出现在 `type: 'array'` 节点上,必须满足 `minItems <= maxItems`,并且不能与 `oneOf` 并列。Package 会在任何 child 启动前验证 authored schema,只从发送给 stock RC2 的副本中移除这两个 forward-compatible keyword,然后依据 authored bound 重新验证返回的 structured value。`fork_context` 等 unsupported option、unsupported schema、invalid call 与 infrastructure failure 都是 fatal;普通 child failure 或 schema-invalid child value 返回 `null`。
|
|
228
|
+
|
|
229
|
+
以下完整 body guard nullable output,使 verification fail-closed,确定性 sort/filter,显式限制 log preview,同步 phase title,并发布 report:
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
const rawTargets = Array.isArray(args.targets) ? args.targets : []
|
|
233
|
+
const targets = [...new Set(rawTargets)]
|
|
234
|
+
.filter(target => typeof target === 'string' && target.length > 0)
|
|
235
|
+
.sort((left, right) => left.localeCompare(right))
|
|
236
|
+
|
|
237
|
+
if (targets.length === 0) {
|
|
238
|
+
complete({ ok: false, reason: 'no valid targets', findings: [] })
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
phase('Review')
|
|
242
|
+
const reviews = await parallel(targets.map(target => ({
|
|
243
|
+
label: `review-${target}`,
|
|
244
|
+
phase: 'Review',
|
|
245
|
+
prompt: `Review ${target}. Inspect the workspace; return at most 20 evidence-backed findings.`,
|
|
246
|
+
schema: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
findings: {
|
|
250
|
+
type: 'array',
|
|
251
|
+
maxItems: 20,
|
|
252
|
+
items: {
|
|
253
|
+
type: 'object',
|
|
254
|
+
properties: {
|
|
255
|
+
path: { type: 'string' },
|
|
256
|
+
summary: { type: 'string' },
|
|
257
|
+
evidence: { type: 'string' },
|
|
258
|
+
},
|
|
259
|
+
required: ['path', 'summary', 'evidence'],
|
|
260
|
+
additionalProperties: false,
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
required: ['findings'],
|
|
265
|
+
additionalProperties: false,
|
|
266
|
+
},
|
|
267
|
+
})))
|
|
268
|
+
|
|
269
|
+
if (reviews.some(review => review === null)) {
|
|
270
|
+
complete({ ok: false, reason: 'a reviewer failed', findings: [] })
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const findings = reviews
|
|
274
|
+
.flatMap(review => review.findings)
|
|
275
|
+
.filter(finding => targets.some(target => finding.path === target || finding.path.startsWith(`${target}/`)))
|
|
276
|
+
.sort((left, right) => left.path.localeCompare(right.path) || left.summary.localeCompare(right.summary))
|
|
277
|
+
|
|
278
|
+
const preview = JSON.stringify(findings)
|
|
279
|
+
log(preview.length <= 2_000 ? preview : `${preview.slice(0, 2_000)}… [truncated]`)
|
|
280
|
+
|
|
281
|
+
phase('Verify')
|
|
282
|
+
const verification = await agent(
|
|
283
|
+
`Challenge every finding against the workspace. Reject unsupported claims.\n${JSON.stringify(findings)}`,
|
|
284
|
+
{
|
|
285
|
+
label: 'verifier',
|
|
286
|
+
phase: 'Verify',
|
|
287
|
+
schema: {
|
|
288
|
+
type: 'object',
|
|
289
|
+
properties: {
|
|
290
|
+
verified: { type: 'boolean' },
|
|
291
|
+
reason: { type: 'string' },
|
|
292
|
+
},
|
|
293
|
+
required: ['verified', 'reason'],
|
|
294
|
+
additionalProperties: false,
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
if (verification === null || verification.verified !== true) {
|
|
300
|
+
complete({ ok: false, reason: verification?.reason ?? 'verification failed', findings: [] })
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
phase('Report')
|
|
304
|
+
const report = [
|
|
305
|
+
'# Verified review',
|
|
306
|
+
'',
|
|
307
|
+
...findings.map(finding => `- **${finding.path}** — ${finding.summary}\n - Evidence: ${finding.evidence}`),
|
|
308
|
+
'',
|
|
309
|
+
].join('\n')
|
|
310
|
+
await write_scratch_file('report.md', report)
|
|
311
|
+
complete({ ok: true, findings, report: 'report.md' })
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
`complete(value)` 接受第一个 lossless JSON value,并使之后每个 hook ineffective,即使 script code catch 其 internal sentinel。`return value` 同样可以 settle run。Scratch name 是匹配 `^[A-Za-z0-9][A-Za-z0-9._-]*$` 的单 component;default 最多允许 4,096 次 operation、64 个 pending、64 个 file、每个 1 MiB、总计 8 MiB。每个 `phase`/`log` event 上限为 64 KiB UTF-8。
|
|
315
|
+
|
|
316
|
+
Replay-capable run 移除 `Date`、`Math.random`、`Atomics`、`SharedArrayBuffer`、`WeakRef` 与 `FinalizationRegistry`。Deterministic Math function 保留。每个 effectful agent prompt 都必须可安全重复,因为 result 未提交的 effect 可能再次运行。Script 不提供 `workflow()` hook:nested workflow 不受支持;应在一个 run 内通过 agent、`parallel` 与 `pipeline` 表达 orchestration。
|
|
317
|
+
|
|
318
|
+
## 11. Keyboard、mobile 与 accessibility
|
|
319
|
+
|
|
320
|
+
打开 `/workflows` 会把 focus 移入 conversation 上的 labelled modal card(不是 full-page takeover)。Card 周围的 chrome 会 dim 并 inert;点击该 chrome、Close 或 Escape 即可关闭。Tab 与 Shift+Tab 留在 card 内,逃逸 focus 会被收回,关闭时若 invoking composer 仍存在则恢复它。Status 除 color 外始终使用 text,progress 与 update 使用 semantic status/live region,member row 是带 visible `:focus-visible` treatment 的真实 control。
|
|
321
|
+
|
|
322
|
+
P/R/X/S 只有在 dialog 拥有 focus、没有 modifier 或 key repeat、target 不可编辑,并且 selected run 当前允许 action 时,才触发 Pause/Resume/Stop/Save。Hidden 或 unavailable action 永不触发。窄屏 control 两个维度都至少 44 px,长 label 与 result 会换行,reduced-motion preference 移除非必要 transition。
|
|
323
|
+
|
|
324
|
+
## 12. 故障排查
|
|
325
|
+
|
|
326
|
+
### Harness 不兼容
|
|
327
|
+
|
|
328
|
+
症状:activation 报告不受支持的 Host face 或 version。安装官方 `0.1.1-rc.2` 与 plugin `0.1.0-rc.3`;不要扩大 peer range,也不要假定更高 Harness version 已兼容。
|
|
329
|
+
|
|
330
|
+
### Storage 已被拥有
|
|
331
|
+
|
|
332
|
+
症状:`workflow storage root is already owned by another live process`。停止另一个协作 Harness process 后重试。绝不删除 `.workflow-storage.lock` 或按 age 接管;owner exit 时 kernel 会释放 advisory lease。`safe workflow storage is unavailable on <platform>` 表示必需 native lease 不受支持,不表示 unlocked fallback 安全。
|
|
333
|
+
|
|
334
|
+
### Registry disabled 或 definition 缺失
|
|
335
|
+
|
|
336
|
+
`workflow registry is disabled` 表示 listing inert,Save 被有意禁用。`no saved workflow named "<name>"` 表示当前 Session cwd 的 bundled/project/user view 中没有 winning definition。检查 flat filename、root、scope、watcher diagnostic 和 precedence;`/workflows` 无法回答 definition 问题,因为它列出 run。
|
|
337
|
+
|
|
338
|
+
### Definition 或 argument 格式错误
|
|
339
|
+
|
|
340
|
+
Definition 必须是有效 UTF-8 JSON,准确包含 `{ meta, script }`、已知 metadata/phase field、string script,而且 filename stem 等于 `meta.name`。Discovery 命名 offending path 并让整个 observation 失败。Command parse error 是准确文本:
|
|
341
|
+
|
|
342
|
+
```text
|
|
343
|
+
trailing args for "review-changes" must be one JSON object — {bad
|
|
344
|
+
trailing args for "review-changes" must be a JSON object (wrap arrays/scalars in a field)
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
修复 source;本包绝不猜测、求值 metadata 或静默省略 file。
|
|
348
|
+
|
|
349
|
+
### Run、control 或 transcript 不可用
|
|
350
|
+
|
|
351
|
+
`workflow "<display-name>" was not found in this Session` 有意不泄露 cross-Session data。`workflow "<display-name>" was interrupted by process exit and cannot resume` 要求新 launch。Stale control 使用上文 revision message。`Child transcript unavailable` 表示 current direct one-shot child catalog 不再授权 navigation;应检查 retained member outcome。Request-level error 保留 loaded detail,并提供 `Retry`。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { WorkflowRunMemberDetail, WorkflowRunMemberHead, WorkflowRunValueView } from './contract.js';
|
|
3
|
+
import { type DashboardLabels } from './locales.js';
|
|
4
|
+
export interface WorkflowMemberInspectorProps {
|
|
5
|
+
/** A member head is accepted for loading/empty states. */
|
|
6
|
+
readonly member?: WorkflowRunMemberHead;
|
|
7
|
+
/** Either the complete Remote value or a wrapper containing `outcome`. */
|
|
8
|
+
readonly detail?: WorkflowRunMemberDetail | {
|
|
9
|
+
readonly outcome?: WorkflowRunValueView;
|
|
10
|
+
readonly childSessionId?: string;
|
|
11
|
+
};
|
|
12
|
+
readonly outcome?: WorkflowRunValueView;
|
|
13
|
+
readonly loading?: boolean;
|
|
14
|
+
readonly error?: unknown;
|
|
15
|
+
readonly onRetry?: () => void;
|
|
16
|
+
readonly onClose?: () => void;
|
|
17
|
+
/** Optional child navigation callback. It must already perform catalog proof. */
|
|
18
|
+
readonly onOpenChild?: () => Promise<boolean> | boolean;
|
|
19
|
+
readonly labels?: DashboardLabels;
|
|
20
|
+
}
|
|
21
|
+
/** Bounded Markdown/plain-text renderer. Strings must not be JSON.stringified. */
|
|
22
|
+
export declare function MarkdownText({ text }: {
|
|
23
|
+
readonly text: string;
|
|
24
|
+
}): ReactElement;
|
|
25
|
+
/** Render one bounded member outcome without conflating null, absence, or eviction. */
|
|
26
|
+
export declare function WorkflowMemberInspector({ member, detail, outcome: explicitOutcome, loading, error, onRetry, onClose, onOpenChild, labels: labelOverrides, }: WorkflowMemberInspectorProps): ReactElement;
|
|
27
|
+
export default WorkflowMemberInspector;
|
|
28
|
+
//# sourceMappingURL=WorkflowMemberInspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowMemberInspector.d.ts","sourceRoot":"","sources":["../../src/client/WorkflowMemberInspector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACzG,OAAO,EAA8C,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAG/F,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IACvC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACzH,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAA;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAA;CAClC;AAoCD,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAuC9E;AAkGD,uFAAuF;AACvF,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,MAAM,EACN,OAAO,EAAE,eAAe,EACxB,OAAe,EACf,KAAK,EACL,OAAO,EACP,OAAO,EACP,WAAW,EACX,MAAM,EAAE,cAAc,GACvB,EAAE,4BAA4B,GAAG,YAAY,CAyD7C;AAED,eAAe,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { dashboardLabelsFromLocale, workflowLocales } from './locales.js';
|
|
4
|
+
import css from './WorkflowMemberInspector.module.css';
|
|
5
|
+
function json(value) {
|
|
6
|
+
try {
|
|
7
|
+
return JSON.stringify(value, null, 2);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return '[unavailable]';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function availableHeading(value) {
|
|
14
|
+
if (typeof value === 'string')
|
|
15
|
+
return 'Text outcome';
|
|
16
|
+
// JSON null is a value, not the absence of an outcome.
|
|
17
|
+
if (value === null || typeof value === 'object')
|
|
18
|
+
return 'JSON outcome';
|
|
19
|
+
return 'Value outcome';
|
|
20
|
+
}
|
|
21
|
+
function retainedBytes(text) {
|
|
22
|
+
return new TextEncoder().encode(text).byteLength;
|
|
23
|
+
}
|
|
24
|
+
function renderInline(text) {
|
|
25
|
+
const nodes = [];
|
|
26
|
+
const pattern = /(\*\*[^*]+?\*\*|`[^`]+?`|\*[^*]+?\*)/gu;
|
|
27
|
+
let last = 0;
|
|
28
|
+
let match;
|
|
29
|
+
let index = 0;
|
|
30
|
+
while ((match = pattern.exec(text)) !== null) {
|
|
31
|
+
if (match.index > last)
|
|
32
|
+
nodes.push(text.slice(last, match.index));
|
|
33
|
+
const token = match[0];
|
|
34
|
+
if (token.startsWith('**'))
|
|
35
|
+
nodes.push(_jsx("strong", { children: token.slice(2, -2) }, `b${index}`));
|
|
36
|
+
else if (token.startsWith('`'))
|
|
37
|
+
nodes.push(_jsx("code", { children: token.slice(1, -1) }, `c${index}`));
|
|
38
|
+
else
|
|
39
|
+
nodes.push(_jsx("em", { children: token.slice(1, -1) }, `i${index}`));
|
|
40
|
+
last = match.index + token.length;
|
|
41
|
+
index += 1;
|
|
42
|
+
}
|
|
43
|
+
if (last < text.length)
|
|
44
|
+
nodes.push(text.slice(last));
|
|
45
|
+
return nodes;
|
|
46
|
+
}
|
|
47
|
+
/** Bounded Markdown/plain-text renderer. Strings must not be JSON.stringified. */
|
|
48
|
+
export function MarkdownText({ text }) {
|
|
49
|
+
const lines = text.replace(/\r\n/gu, '\n').split('\n');
|
|
50
|
+
const blocks = [];
|
|
51
|
+
let paragraph = [];
|
|
52
|
+
let listItems = [];
|
|
53
|
+
const flushParagraph = () => {
|
|
54
|
+
if (paragraph.length === 0)
|
|
55
|
+
return;
|
|
56
|
+
blocks.push(_jsx("p", { children: renderInline(paragraph.join('\n')) }, `p${blocks.length}`));
|
|
57
|
+
paragraph = [];
|
|
58
|
+
};
|
|
59
|
+
const flushList = () => {
|
|
60
|
+
if (listItems.length === 0)
|
|
61
|
+
return;
|
|
62
|
+
blocks.push(_jsx("ul", { children: listItems }, `ul${blocks.length}`));
|
|
63
|
+
listItems = [];
|
|
64
|
+
};
|
|
65
|
+
for (const line of lines) {
|
|
66
|
+
if (line.startsWith('### ')) {
|
|
67
|
+
flushParagraph();
|
|
68
|
+
flushList();
|
|
69
|
+
blocks.push(_jsx("h6", { children: renderInline(line.slice(4)) }, `h${blocks.length}`));
|
|
70
|
+
}
|
|
71
|
+
else if (line.startsWith('## ')) {
|
|
72
|
+
flushParagraph();
|
|
73
|
+
flushList();
|
|
74
|
+
blocks.push(_jsx("h5", { children: renderInline(line.slice(3)) }, `h${blocks.length}`));
|
|
75
|
+
}
|
|
76
|
+
else if (line.startsWith('# ')) {
|
|
77
|
+
flushParagraph();
|
|
78
|
+
flushList();
|
|
79
|
+
blocks.push(_jsx("h4", { children: renderInline(line.slice(2)) }, `h${blocks.length}`));
|
|
80
|
+
}
|
|
81
|
+
else if (line.startsWith('- ') || line.startsWith('* ')) {
|
|
82
|
+
flushParagraph();
|
|
83
|
+
listItems.push(_jsx("li", { children: renderInline(line.slice(2)) }, `li${listItems.length}`));
|
|
84
|
+
}
|
|
85
|
+
else if (line === '') {
|
|
86
|
+
flushParagraph();
|
|
87
|
+
flushList();
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
flushList();
|
|
91
|
+
paragraph.push(line);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
flushParagraph();
|
|
95
|
+
flushList();
|
|
96
|
+
if (blocks.length === 0)
|
|
97
|
+
return _jsx("p", { className: css.markdown, children: text });
|
|
98
|
+
return _jsx("div", { className: css.markdown, children: blocks });
|
|
99
|
+
}
|
|
100
|
+
async function writeClipboard(text) {
|
|
101
|
+
try {
|
|
102
|
+
if (typeof navigator === 'undefined' || navigator.clipboard?.writeText === undefined)
|
|
103
|
+
return false;
|
|
104
|
+
await navigator.clipboard.writeText(text);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function CopyControl({ text, label, copiedLabel, failedLabel, }) {
|
|
112
|
+
const [state, setState] = useState('idle');
|
|
113
|
+
const onClick = () => {
|
|
114
|
+
void writeClipboard(text).then(ok => { setState(ok ? 'copied' : 'failed'); });
|
|
115
|
+
};
|
|
116
|
+
return (_jsxs("div", { className: css.copyRow, children: [_jsx("button", { type: "button", onClick: onClick, "aria-label": label, children: label }), state === 'copied' && _jsx("span", { role: "status", children: copiedLabel }), state === 'failed' && _jsx("span", { role: "status", children: failedLabel })] }));
|
|
117
|
+
}
|
|
118
|
+
function OutcomeBody({ outcome, labels, }) {
|
|
119
|
+
if (outcome.state === 'pending') {
|
|
120
|
+
return _jsxs(_Fragment, { children: [_jsx("h3", { children: "Pending" }), _jsx("p", { className: css.muted, children: "The member has not produced an outcome yet." })] });
|
|
121
|
+
}
|
|
122
|
+
if (outcome.state === 'not-produced') {
|
|
123
|
+
return _jsxs(_Fragment, { children: [_jsx("h3", { children: "No outcome produced" }), _jsx("p", { className: css.muted, children: "This member finished without a retained result." })] });
|
|
124
|
+
}
|
|
125
|
+
if (outcome.state === 'evicted') {
|
|
126
|
+
return _jsxs(_Fragment, { children: [_jsx("h3", { children: "Outcome evicted" }), _jsx("p", { className: css.muted, children: "The retained outcome was evicted to stay within storage limits." })] });
|
|
127
|
+
}
|
|
128
|
+
if (outcome.state !== 'available') {
|
|
129
|
+
return _jsxs(_Fragment, { children: [_jsx("h3", { children: "Pending" }), _jsx("p", { className: css.muted, children: "The member has not produced an outcome yet." })] });
|
|
130
|
+
}
|
|
131
|
+
if (outcome.content.kind === 'preview') {
|
|
132
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "Truncated outcome" }), _jsxs("p", { className: css.muted, children: [retainedBytes(outcome.content.text), " bytes retained of ", outcome.totalBytes, " bytes total."] }), _jsx("pre", { className: css.value, "aria-label": "Truncated outcome preview", children: outcome.content.text })] }));
|
|
133
|
+
}
|
|
134
|
+
const value = outcome.content.value;
|
|
135
|
+
const heading = availableHeading(value);
|
|
136
|
+
if (heading === 'Text outcome') {
|
|
137
|
+
const text = String(value);
|
|
138
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "Text outcome" }), _jsx(MarkdownText, { text: text }), _jsx(CopyControl, { text: text, label: labels.copy, copiedLabel: labels.copied, failedLabel: labels.copyFailed })] }));
|
|
139
|
+
}
|
|
140
|
+
if (heading === 'JSON outcome') {
|
|
141
|
+
const serialized = json(value);
|
|
142
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "JSON outcome" }), _jsx("pre", { className: css.value, "aria-label": "JSON outcome", children: serialized }), _jsx(CopyControl, { text: serialized, label: labels.copyJson, copiedLabel: labels.copied, failedLabel: labels.copyFailed })] }));
|
|
143
|
+
}
|
|
144
|
+
const serialized = json(value);
|
|
145
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "Value outcome" }), _jsx("pre", { className: css.value, "aria-label": "Value outcome", children: serialized }), _jsx(CopyControl, { text: serialized, label: labels.copy, copiedLabel: labels.copied, failedLabel: labels.copyFailed })] }));
|
|
146
|
+
}
|
|
147
|
+
/** Render one bounded member outcome without conflating null, absence, or eviction. */
|
|
148
|
+
export function WorkflowMemberInspector({ member, detail, outcome: explicitOutcome, loading = false, error, onRetry, onClose, onOpenChild, labels: labelOverrides, }) {
|
|
149
|
+
const labels = labelOverrides ?? dashboardLabelsFromLocale(workflowLocales.en);
|
|
150
|
+
const [childUnavailable, setChildUnavailable] = useState(false);
|
|
151
|
+
const outcome = explicitOutcome ?? detail?.outcome;
|
|
152
|
+
const childId = detail && 'childSessionId' in detail ? detail.childSessionId : undefined;
|
|
153
|
+
useEffect(() => { setChildUnavailable(false); }, [childId]);
|
|
154
|
+
const openChild = () => {
|
|
155
|
+
if (onOpenChild === undefined)
|
|
156
|
+
return;
|
|
157
|
+
void Promise.resolve(onOpenChild()).then(opened => {
|
|
158
|
+
if (!opened)
|
|
159
|
+
setChildUnavailable(true);
|
|
160
|
+
}, () => { setChildUnavailable(true); });
|
|
161
|
+
};
|
|
162
|
+
let body;
|
|
163
|
+
if (loading) {
|
|
164
|
+
body = _jsx("p", { role: "status", children: "Loading member outcome\u2026" });
|
|
165
|
+
}
|
|
166
|
+
else if (error !== undefined) {
|
|
167
|
+
body = (_jsxs("div", { className: css.error, role: "alert", children: [_jsx("p", { children: "Unable to load member outcome" }), onRetry !== undefined && _jsx("button", { type: "button", onClick: onRetry, children: "Retry" })] }));
|
|
168
|
+
}
|
|
169
|
+
else if (outcome === undefined) {
|
|
170
|
+
body = _jsxs(_Fragment, { children: [_jsx("h3", { children: "Pending" }), _jsx("p", { className: css.muted, children: "The member has not produced an outcome yet." })] });
|
|
171
|
+
}
|
|
172
|
+
else if (outcome.state === 'not-produced' && childId !== undefined && onOpenChild !== undefined) {
|
|
173
|
+
body = (_jsxs(_Fragment, { children: [_jsx("h3", { children: labels.childTranscript }), _jsx("p", { className: css.muted, children: labels.childTranscriptBody })] }));
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
body = _jsx(OutcomeBody, { outcome: outcome, labels: labels });
|
|
177
|
+
}
|
|
178
|
+
return (_jsxs("section", { className: css.root, "aria-label": "Workflow member inspector", children: [_jsxs("header", { className: css.header, children: [_jsxs("div", { children: [_jsx("p", { className: css.eyebrow, children: "Member outcome" }), _jsx("h2", { children: member?.label || 'Member' }), member?.phase !== undefined && _jsx("p", { className: css.muted, children: member.phase || labels.emptyPhase })] }), onClose !== undefined && _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close member inspector", children: "Close" })] }), _jsx("div", { className: css.body, children: body }), childId !== undefined && onOpenChild !== undefined && (_jsxs("div", { className: css.child, children: [_jsx("button", { type: "button", onClick: openChild, children: "Open child session" }), childUnavailable && _jsx("p", { role: "status", children: "Child transcript unavailable" })] }))] }));
|
|
179
|
+
}
|
|
180
|
+
export default WorkflowMemberInspector;
|
|
181
|
+
//# sourceMappingURL=WorkflowMemberInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowMemberInspector.js","sourceRoot":"","sources":["../../src/client/WorkflowMemberInspector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAqC,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA;AAC/F,OAAO,GAAG,MAAM,sCAAsC,CAAA;AAiBtD,SAAS,IAAI,CAAC,KA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OAAO,gBAAa,wBAAwB,sBAAe,IAC7G,EACT,cAAK,SAAS,EAAE,GAAG,CAAC,IAAI,YAAG,IAAI,GAAO,EACrC,OAAO,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,IAAI,CACrD,eAAK,SAAS,EAAE,GAAG,CAAC,KAAK,aACvB,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,SAAS,mCAA6B,EACpE,gBAAgB,IAAI,YAAG,IAAI,EAAC,QAAQ,6CAAiC,IAClE,CACP,IACO,CACX,CAAA;AACH,CAAC;AAED,eAAe,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ChatConversationViewNode } from '@deepseek-ai/dsh-client-runtime/client';
|
|
3
|
+
import type { WorkflowRunChatData, WorkflowRunStatus } from './workflow-definition.js';
|
|
4
|
+
export interface WorkflowRunPanelProps {
|
|
5
|
+
readonly node: ChatConversationViewNode & {
|
|
6
|
+
readonly kind: 'workflow-run';
|
|
7
|
+
readonly data: WorkflowRunChatData;
|
|
8
|
+
};
|
|
9
|
+
readonly sessionId: string;
|
|
10
|
+
readonly resolveAndOpenChild: (childId: string) => Promise<boolean>;
|
|
11
|
+
/** Optional synchronous catalog proof supplied by the owning Client plugin. */
|
|
12
|
+
readonly isChildAvailable?: (childId: string) => boolean;
|
|
13
|
+
readonly labels?: Partial<WorkflowRunPanelLabels>;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkflowRunPanelLabels {
|
|
16
|
+
readonly noMembers: string;
|
|
17
|
+
readonly unphased: string;
|
|
18
|
+
readonly emptyPhase: string;
|
|
19
|
+
readonly emptyMember: string;
|
|
20
|
+
readonly childUnavailable: string;
|
|
21
|
+
readonly childFailed: string;
|
|
22
|
+
readonly inspect: (count: number) => string;
|
|
23
|
+
readonly status: Readonly<Record<WorkflowRunStatus, string>>;
|
|
24
|
+
readonly statusCount: (status: WorkflowRunStatus, count: number) => string;
|
|
25
|
+
readonly openMember: (label: string) => string;
|
|
26
|
+
}
|
|
27
|
+
export type DisclosureMode = 'clean' | 'running' | 'abnormal';
|
|
28
|
+
export interface DisclosureFacts {
|
|
29
|
+
readonly mode: DisclosureMode;
|
|
30
|
+
readonly count: number;
|
|
31
|
+
}
|
|
32
|
+
export interface DisclosureChoice {
|
|
33
|
+
readonly open: boolean;
|
|
34
|
+
readonly mode: DisclosureMode;
|
|
35
|
+
readonly count: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function initialWorkflowDisclosure(facts: DisclosureFacts): DisclosureChoice;
|
|
38
|
+
/** Force abnormal/running open; auto-fold a clean completion once. */
|
|
39
|
+
export declare function advanceWorkflowDisclosure(current: DisclosureChoice, facts: DisclosureFacts): DisclosureChoice;
|
|
40
|
+
/** Render one durable workflow run without exposing logical run or child ids. */
|
|
41
|
+
export declare function WorkflowRunPanel({ node, resolveAndOpenChild, isChildAvailable, labels: labelOverrides, }: WorkflowRunPanelProps): ReactElement;
|
|
42
|
+
export default WorkflowRunPanel;
|
|
43
|
+
//# sourceMappingURL=WorkflowRunPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRunPanel.d.ts","sourceRoot":"","sources":["../../src/client/WorkflowRunPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACtF,OAAO,KAAK,EACV,mBAAmB,EAGnB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG;QACxC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;QAC7B,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;KACnC,CAAA;IACD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CA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