dsh-plugin-dev-kb 1.8.0 → 1.8.1

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.
Files changed (229) hide show
  1. package/CHANGELOG.md +186 -178
  2. package/README.en.md +172 -172
  3. package/README.md +183 -183
  4. package/kb/INDEX.md +236 -234
  5. package/kb/README.md +88 -88
  6. package/kb/extra/AGENTS.md +77 -77
  7. package/kb/extra/deepseek-llm-api-wire-extensions.md +162 -162
  8. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +162 -162
  9. package/kb/extra/defensive-patterns/package-surface.md +233 -232
  10. package/kb/extra/defensive-patterns/package-surface.zh.md +233 -232
  11. package/kb/extra/defensive-patterns/remote-and-api.md +117 -117
  12. package/kb/extra/defensive-patterns/remote-and-api.zh.md +117 -117
  13. package/kb/extra/development.md +221 -221
  14. package/kb/extra/development.zh.md +228 -228
  15. package/kb/extra/event-producer-consumer.md +133 -123
  16. package/kb/extra/event-producer-consumer.zh.md +135 -125
  17. package/kb/extra/module-graph.md +1961 -1888
  18. package/kb/extra/module-graph.zh.md +1963 -1890
  19. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.md +60 -0
  20. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.zh.md +60 -0
  21. package/kb/extra/persistence-changes/README.md +92 -92
  22. package/kb/extra/persistence-changes/README.zh.md +92 -92
  23. package/kb/extra/persistence-changes/historical-formats/README.md +75 -75
  24. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -75
  25. package/kb/extra/persistence-changes/releases/README.md +103 -103
  26. package/kb/extra/persistence-changes/releases/README.zh.md +103 -103
  27. package/kb/extra/rescope.md +55 -55
  28. package/kb/extra/rescope.zh.md +55 -55
  29. package/kb/extra/subsystems/boot.md +631 -621
  30. package/kb/extra/subsystems/boot.zh.md +631 -621
  31. package/kb/extra/subsystems/computer-use.md +179 -137
  32. package/kb/extra/subsystems/computer-use.zh.md +179 -137
  33. package/kb/extra/subsystems/extensions.md +387 -384
  34. package/kb/extra/subsystems/extensions.zh.md +387 -384
  35. package/kb/extra/subsystems/feedback.md +418 -400
  36. package/kb/extra/subsystems/feedback.zh.md +418 -400
  37. package/kb/extra/subsystems/forge.md +2169 -1226
  38. package/kb/extra/subsystems/forge.zh.md +2171 -1226
  39. package/kb/extra/subsystems/liveshare.md +167 -158
  40. package/kb/extra/subsystems/liveshare.zh.md +167 -158
  41. package/kb/extra/subsystems/mcp.md +237 -234
  42. package/kb/extra/subsystems/mcp.zh.md +237 -234
  43. package/kb/extra/subsystems/office-kit.md +122 -0
  44. package/kb/extra/subsystems/office-kit.zh.md +122 -0
  45. package/kb/extra/subsystems/working-directory.md +95 -64
  46. package/kb/extra/subsystems/working-directory.zh.md +95 -64
  47. package/kb/extra/subsystems/worktrees.md +187 -127
  48. package/kb/extra/subsystems/worktrees.zh.md +187 -127
  49. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -21
  50. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -21
  51. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
  52. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
  53. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
  54. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
  55. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
  56. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
  57. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
  58. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
  59. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
  60. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
  61. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
  62. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
  63. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
  64. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
  65. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
  66. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
  67. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
  68. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
  69. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
  70. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
  71. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
  72. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
  73. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
  74. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
  75. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
  76. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
  77. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
  78. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
  79. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
  80. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
  81. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
  82. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
  83. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
  84. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
  85. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
  86. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
  87. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
  88. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
  89. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
  90. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
  91. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
  92. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
  93. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
  94. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
  95. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
  96. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
  97. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
  98. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
  99. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
  100. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
  101. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
  102. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
  103. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.md +18 -0
  104. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.zh.md +18 -0
  105. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
  106. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
  107. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
  108. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
  109. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.md +29 -0
  110. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.zh.md +29 -0
  111. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.md +25 -0
  112. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.zh.md +25 -0
  113. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.md +31 -0
  114. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.zh.md +31 -0
  115. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md +24 -0
  116. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md +24 -0
  117. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.md +24 -0
  118. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.zh.md +24 -0
  119. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.md +19 -0
  120. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.zh.md +19 -0
  121. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.md +15 -0
  122. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.zh.md +15 -0
  123. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md +28 -0
  124. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.zh.md +28 -0
  125. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.md +36 -0
  126. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.zh.md +36 -0
  127. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.md +22 -0
  128. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.zh.md +22 -0
  129. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md +31 -0
  130. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.zh.md +31 -0
  131. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.md +18 -0
  132. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.zh.md +18 -0
  133. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.md +30 -0
  134. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.zh.md +30 -0
  135. package/kb/extra/web-styling.md +57 -57
  136. package/kb/extra/web-styling.zh.md +57 -57
  137. package/kb/meta/search-index.json +4508 -3980
  138. package/kb/meta/source.json +18 -18
  139. package/kb/site/develop/practice/llm-adapter.md +192 -192
  140. package/kb/site/en/develop/practice/llm-adapter.md +192 -192
  141. package/kb/site/en/guide/desktop-uninstall-cleanup.md +63 -0
  142. package/kb/site/en/guide/plugin-market.md +153 -151
  143. package/kb/site/en/guide/providers.md +234 -234
  144. package/kb/site/en/guide/quickstart.md +35 -34
  145. package/kb/site/en/reference/capability-seams.md +789 -767
  146. package/kb/site/en/reference/config-catalog.md +5432 -5128
  147. package/kb/site/en/reference/cookbook/adding-a-package.md +175 -175
  148. package/kb/site/en/reference/cookbook/adding-a-tool.md +105 -104
  149. package/kb/site/en/reference/cookbook/extension-cookbook.md +178 -135
  150. package/kb/site/en/reference/cordis-api/context.md +373 -369
  151. package/kb/site/en/reference/cordis-api/fiber.md +457 -433
  152. package/kb/site/en/reference/cordis-api/inherited.md +44 -44
  153. package/kb/site/en/reference/cordis-api/service.md +118 -107
  154. package/kb/site/en/reference/experimental-persistence-catalog.md +36 -23
  155. package/kb/site/en/reference/index.md +174 -174
  156. package/kb/site/en/reference/persistence-catalog.md +9453 -9432
  157. package/kb/site/en/reference/subsystems/compaction.md +288 -288
  158. package/kb/site/en/reference/subsystems/core.md +1172 -1171
  159. package/kb/site/en/reference/subsystems/credentials.md +526 -497
  160. package/kb/site/en/reference/subsystems/filesystem.md +708 -708
  161. package/kb/site/en/reference/subsystems/index.md +82 -82
  162. package/kb/site/en/reference/subsystems/llm-streaming.md +1290 -1288
  163. package/kb/site/en/reference/subsystems/lsp.md +230 -206
  164. package/kb/site/en/reference/subsystems/persistence.md +451 -432
  165. package/kb/site/en/reference/subsystems/plan.md +91 -91
  166. package/kb/site/en/reference/subsystems/ptc-runtime.md +295 -261
  167. package/kb/site/en/reference/subsystems/sandbox.md +250 -232
  168. package/kb/site/en/reference/subsystems/session-query.md +525 -515
  169. package/kb/site/en/reference/subsystems/session-reference.md +231 -229
  170. package/kb/site/en/reference/subsystems/session.md +1478 -1431
  171. package/kb/site/en/reference/subsystems/sidebar-right.md +165 -165
  172. package/kb/site/en/reference/subsystems/skills.md +356 -356
  173. package/kb/site/en/reference/subsystems/slots.md +235 -231
  174. package/kb/site/en/reference/subsystems/terminal.md +188 -188
  175. package/kb/site/en/reference/subsystems/tools.md +902 -891
  176. package/kb/site/en/reference/subsystems/user-questions.md +330 -327
  177. package/kb/site/en/reference/subsystems/web-client.md +161 -104
  178. package/kb/site/en/reference/subsystems/web-server.md +434 -351
  179. package/kb/site/en/reference/subsystems/web.md +268 -268
  180. package/kb/site/en/reference/subsystems/workflow.md +287 -282
  181. package/kb/site/en/reference/subsystems/workspace.md +743 -651
  182. package/kb/site/en/reference/tool-catalog.md +2867 -2704
  183. package/kb/site/guide/desktop-uninstall-cleanup.md +63 -0
  184. package/kb/site/guide/plugin-market.md +153 -151
  185. package/kb/site/guide/providers.md +234 -234
  186. package/kb/site/guide/quickstart.md +35 -34
  187. package/kb/site/reference/capability-seams.md +789 -767
  188. package/kb/site/reference/config-catalog.md +5432 -5128
  189. package/kb/site/reference/cookbook/adding-a-package.md +175 -175
  190. package/kb/site/reference/cookbook/adding-a-tool.md +107 -106
  191. package/kb/site/reference/cookbook/extension-cookbook.md +182 -139
  192. package/kb/site/reference/cordis-api/context.md +373 -369
  193. package/kb/site/reference/cordis-api/fiber.md +459 -435
  194. package/kb/site/reference/cordis-api/inherited.md +44 -44
  195. package/kb/site/reference/cordis-api/service.md +118 -107
  196. package/kb/site/reference/experimental-persistence-catalog.md +36 -23
  197. package/kb/site/reference/index.md +178 -178
  198. package/kb/site/reference/persistence-catalog.md +9453 -9432
  199. package/kb/site/reference/subsystems/compaction.md +288 -288
  200. package/kb/site/reference/subsystems/core.md +1184 -1183
  201. package/kb/site/reference/subsystems/credentials.md +526 -497
  202. package/kb/site/reference/subsystems/filesystem.md +708 -708
  203. package/kb/site/reference/subsystems/index.md +82 -82
  204. package/kb/site/reference/subsystems/llm-streaming.md +1296 -1294
  205. package/kb/site/reference/subsystems/lsp.md +230 -206
  206. package/kb/site/reference/subsystems/persistence.md +451 -432
  207. package/kb/site/reference/subsystems/plan.md +91 -91
  208. package/kb/site/reference/subsystems/ptc-runtime.md +295 -261
  209. package/kb/site/reference/subsystems/sandbox.md +250 -232
  210. package/kb/site/reference/subsystems/session-query.md +525 -515
  211. package/kb/site/reference/subsystems/session-reference.md +231 -229
  212. package/kb/site/reference/subsystems/session.md +1482 -1435
  213. package/kb/site/reference/subsystems/sidebar-right.md +165 -165
  214. package/kb/site/reference/subsystems/skills.md +356 -356
  215. package/kb/site/reference/subsystems/slots.md +239 -235
  216. package/kb/site/reference/subsystems/terminal.md +188 -188
  217. package/kb/site/reference/subsystems/tools.md +902 -891
  218. package/kb/site/reference/subsystems/user-questions.md +330 -327
  219. package/kb/site/reference/subsystems/web-client.md +161 -104
  220. package/kb/site/reference/subsystems/web-server.md +434 -351
  221. package/kb/site/reference/subsystems/web.md +268 -268
  222. package/kb/site/reference/subsystems/workflow.md +287 -282
  223. package/kb/site/reference/subsystems/workspace.md +743 -651
  224. package/kb/site/reference/tool-catalog.md +2872 -2709
  225. package/lib/index.js +359 -359
  226. package/package.json +68 -68
  227. package/skills/dsh-plugin-dev-kb.md +71 -70
  228. package/kb/extra/subsystems/office-to-pdf.md +0 -87
  229. package/kb/extra/subsystems/office-to-pdf.zh.md +0 -87
@@ -1,282 +1,287 @@
1
- ---
2
- editSource: "docs/subsystems/workflow.md"
3
- rawMarkdownPath: "en/reference/subsystems/workflow.md"
4
- outline: [2,3]
5
- ---
6
-
7
- # Workflow
8
-
9
- The workflow seam lets an agent run a model-written orchestration SCRIPT that starts subagents. Like [subagent](./subagent.md) it is **one optional capability**, not part of the agent loop, so its types and operations live here rather than in [core.md](./core.md). Like bash, it permits ONE engine implementation per context to provide `ctx.workflowEngine`; there is no named-provider registry (a second engine replaces the first through plugin configuration rather than running beside it).
10
-
11
- Service Definition: [dsh-workflow](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/workflow) (`ctx.workflowEngine` and the vocabulary below). [dsh-workflow-ptc](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/workflow-ptc) executes the VM and helpers through the shared Node PTC process runtime under the calling Session's file policy. The consumers are [dsh-tool-workflow](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/tool-workflow) and the opt-in [dsh-tool-ralph](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/experimental/tool-ralph). [Workflow sandbox reuse](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-13-workflow-ptc-sandbox-reuse.md) owns execution choices; the [dynamic-workflows reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/README.md) owns script semantics.
12
-
13
- Sources: browser-safe vocabulary in [`packages/workflow/workflow/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/types.ts), Host request and live-run handles in [`runtime-types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/runtime-types.ts).
14
-
15
- ## The start request
16
-
17
- What a caller asks for when starting a run. The ordinary workflow tool builds this from the model's `{ script, meta, args }` call plus the calling agent; specialized consumers may also select one engine-wide `subagentProvider` and lower `maxTotalAgents` for the run, but the script cannot observe or replace either policy. `meta` and `args` are plain JSON DATA (the engine validates `meta` against its schema and rejects loud BEFORE anything runs — no script text is ever evaluated to obtain it). `parent` is REQUIRED — every child the script starts is attributed to it, and cwd, lineage, and depth pass through the [subagent seam](./subagent.md).
18
-
19
- ```ts type-equiv
20
- /**
21
- * What a caller asks for when starting a workflow run. `meta` and `args` are
22
- * plain JSON data by the seam contract. `parent` is required because every
23
- * `agent()` spawned by the script is attributed to that live Agent.
24
- */
25
- interface WorkflowStartRequest {
26
- /** The plain-JS script body (top-level await allowed; ends with `return <json-value>`). */
27
- script: string
28
- /** The workflow's identity block, as plain JSON data (shape-validated by the engine). */
29
- meta: WorkflowMeta
30
- /** Optional input exposed verbatim to the script as the `args` global. */
31
- args?: unknown
32
- /** Optional engine-wide child-provider override for this run. */
33
- subagentProvider?: string
34
- /** Optional per-run total-child ceiling. */
35
- maxTotalAgents?: number
36
- /** The agent on whose behalf the run executes (parent of every child). */
37
- parent: Agent
38
- /** Cancels the run when aborted. */
39
- signal?: AbortSignal
40
- }
41
- ```
42
-
43
- ## The workflow's identity: `WorkflowMeta`
44
-
45
- The identity block carried as data on the start request (the tool's `meta` parameter; the field vocabulary matches the Claude Code dynamic-workflows meta block). `phases` is progress vocabulary only: `phase()` calls match titles for observers; no execution structure is implied.
46
-
47
- ```ts type-equiv
48
- /**
49
- * The script's identity block, provided as plain JSON data alongside the
50
- * script body (the model-facing tool carries it as its `meta` parameter) and
51
- * validated by the engine before the body runs. `name`/`description` are
52
- * required; the rest is optional annotation. The field vocabulary matches the
53
- * Claude Code dynamic-workflows meta block.
54
- */
55
- interface WorkflowMeta {
56
- /** Short kebab-case workflow name (display + persistence key). */
57
- name: string
58
- /** One-line description of what the workflow does. */
59
- description: string
60
- /** Optional guidance on when this workflow applies (shown in listings). */
61
- whenToUse?: string
62
- /** Optional phase declarations matched by `phase()` calls. */
63
- phases?: WorkflowPhase[]
64
- }
65
- ```
66
-
67
- ## The terminal result: `WorkflowResult`
68
-
69
- The outcome of one run, resolved by `WorkflowRun.result`. `value` is the script's materialized return value — plain host-realm JSON data (`null` when the script returned nothing) — meaningful only for `completed`. `stopReason` is a CLOSED union (engine-owned; consumers may exhaust it): `completed` | `cancelled` | `error`. A non-`completed` reason carries the failure in `error`, and the consumer maps it to an `isError` tool result rather than reporting partial output as success.
70
-
71
- ```ts type-equiv
72
- /**
73
- * The outcome resolved by a live workflow run. `value` is
74
- * the script's materialized return value (plain host-realm JSON data; `null`
75
- * when the script returned `undefined`) — meaningful only for `completed`.
76
- * A non-`completed` reason carries the failure in `error`; the consumer maps
77
- * it to an `isError` tool result rather than reporting partial output.
78
- */
79
- interface WorkflowResult {
80
- /** The script's return value (host JSON data; `null` for no return). */
81
- value: unknown
82
- /** Why the run settled. */
83
- stopReason: WorkflowStopReason
84
- /** The failure message (present iff `stopReason` is not `completed`). */
85
- error?: string
86
- /**
87
- * How many `agent()` calls the run accepted over its whole lifetime. On a
88
- * graceful settlement this is the script-side count (calls still queued for
89
- * a concurrency slot included); on a termination path (cancellation or
90
- * process failure) it degrades to the host-observed count — calls queued
91
- * inside a terminated script are unknowable then.
92
- */
93
- agentsStarted: number
94
- }
95
- ```
96
-
97
- ## A live run: `WorkflowRun`
98
-
99
- The consumer awaits `result`, may `cancel` during execution, and must `dispose` on every path. `result` never rejects: script failure resolves with `stopReason: 'error'`, and cancellation with `'cancelled'`. The PTC engine has no overall elapsed deadline; it immediately aborts the managed process when cancelled. Disposal awaits process and child cleanup under their provider contracts, without an independent workflow cleanup deadline.
100
-
101
- ```ts type-equiv
102
- /**
103
- * Holder-owned live workflow. `result` never rejects; consumers may cancel
104
- * and must call idempotent `dispose()` to await script and child quiescence.
105
- */
106
- interface WorkflowRun {
107
- readonly id: WorkflowRunId
108
- /** The validated meta block available before the script body runs. */
109
- readonly meta: WorkflowMeta
110
- readonly result: Promise<WorkflowResult>
111
- /** Cancel the run and its children. */
112
- cancel(reason?: string): void
113
- /** Cancel if needed and await script and child cleanup. */
114
- dispose(): Promise<void>
115
- }
116
- ```
117
-
118
- ## Failure discipline: `WorkflowError.fatal`
119
-
120
- Hook misuse inside a script — bad arguments, unknown/deferred `agent()` options, a schema outside the [structured-output subset](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/README.md), a tripped cap, a seam start failure, cancellation — throws a `WorkflowError` with `fatal: true`. The `parallel()`/`pipeline()` combinators RE-THROW fatal errors instead of mapping the item to `null`: a typo'd option must kill the script loudly, never dissolve into something that reads as an ordinary child failure. The per-item `null` is reserved for child-run failures (a non-`completed` stop reason) and ordinary in-stage script errors.
121
-
122
- ## Events
123
-
124
- The `workflow/*` events (`workflow/start`, `workflow/phase`, `workflow/log`, `workflow/agent-start`, `workflow/agent-end`, `workflow/end` — see the [events catalog](#cordis-surface)) are **observe-only** emits carrying DATA SNAPSHOTS: every payload starts with `WorkflowRunInfo` (id + meta), never the live `WorkflowRun`, so a subscriber cannot gain `cancel`/`dispose`, and `workflow/end` deliberately omits the result value (a listener observing outcomes must not receive a mutable alias of the caller's result). Every emit is per-listener contained — a throwing subscriber is logged, never propagated, and cannot starve the listeners registered after it — and every listener receives its own payload clone, so mutating it corrupts neither the engine nor other listeners; the containment mirrors `subagent/start`/`subagent/end`.
125
-
126
- ## Durable Chat records
127
-
128
- The top-level `dsh-tool-workflow` consumer projects display facts into its calling parent Session without changing execution ownership. It writes `tool-workflow/run-start` after a run is accepted, pairs member start and end by `runId + seq`, and writes `tool-workflow/run-end` only after the result is known and disposal reaches quiescence. Nested transport calls write no record. The first append failure disables later writes for that run, so the log remains empty or a legal continuous prefix and the tool result is unchanged.
129
-
130
- The record protocol allows one start per run, positive unique member sequences, paired member endings, no run ending with open members, and no updates after the run ending. A missing member ending or run ending at the log tail is valid interruption evidence rather than corruption.
131
-
132
- `dsh-client-ui-workflow-run` folds the four events through the Conversation Node engine into one `workflow-run` Chat node anchored at the run-start sequence, after the original workflow tool node. Phase groups come only from actual member starts and preserve exact strings, including the distinction between an omitted phase and `''`. Closed Locations turn missing terminal facts into interrupted presentation. The [UI package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-workflow-run/README.md) owns disclosure, status, and same-parent local navigation behavior.
133
-
134
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
135
-
136
- <a id="cordis-surface"></a>
137
-
138
- ## Cordis API
139
-
140
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
141
-
142
- <a id="ctxworkflowengine--workflowengine-abstract-seam"></a>
143
-
144
- ### `ctx.workflowEngine` — `WorkflowEngine` (abstract seam)
145
-
146
- Workflow Service Definition contract. Invalid requests throw before publication; a live run is holder-owned, its result never rejects, and disposal waits for script and child cleanup. Lifecycle listener failures are contained, and `workflow/end` fires exactly once as the result settles.
147
-
148
- ```ts cordis-catalog
149
- /**
150
- * Parse and execute a workflow script.
151
- * @param request - the script, its `args`, the parent agent, and an
152
- * optional cancel signal.
153
- * @returns the live run; its `result` resolves when the script settles.
154
- */
155
- abstract start(request: WorkflowStartRequest): WorkflowRun
156
- ```
157
-
158
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
159
-
160
- <a id="workflow-events"></a>
161
-
162
- ### `workflow/*` events
163
-
164
- <a id="workflowagent-end--emit"></a>
165
-
166
- #### `workflow/agent-end` — emit
167
-
168
- One `agent()` call settled (clean result, child failure, or run cancellation). Paired with Events['workflow/agent-start'] by `agent.seq`, exactly once per started call on every stop path — on an engine termination path the end is engine-synthesized with outcome `'cancelled'`.
169
-
170
- ```ts cordis-catalog
171
- /**
172
- * One `agent()` call settled (clean result, child failure, or run
173
- * cancellation). Paired with {@link Events['workflow/agent-start']} by
174
- * `agent.seq`, exactly once per started call on every stop path — on an
175
- * engine termination path the end is
176
- * engine-synthesized with outcome `'cancelled'`.
177
- * @param info - the run's identity snapshot.
178
- * @param agent - the call identity plus its outcome.
179
- * @mode emit
180
- */
181
- 'workflow/agent-end'(info: WorkflowRunInfo, agent: WorkflowAgentEndInfo): void
182
- ```
183
-
184
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
185
-
186
- <a id="workflowagent-start--emit"></a>
187
-
188
- #### `workflow/agent-start` — emit
189
-
190
- One `agent()` call established a published child run. Paired with Events['workflow/agent-end'] by `agent.seq`. A call that never receives a published run from the provider emits neither event in this pair.
191
-
192
- ```ts cordis-catalog
193
- /**
194
- * One `agent()` call established a published child run. Paired with
195
- * {@link Events['workflow/agent-end']} by `agent.seq`. A call that never
196
- * receives a published run from the provider emits neither
197
- * event in this pair.
198
- * @param info - the run's identity snapshot.
199
- * @param agent - the call's sequence number, label, phase, and child id.
200
- * @mode emit
201
- */
202
- 'workflow/agent-start'(info: WorkflowRunInfo, agent: WorkflowAgentInfo): void
203
- ```
204
-
205
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
206
-
207
- <a id="workflowend--emit"></a>
208
-
209
- #### `workflow/end` — emit
210
-
211
- A workflow run settled (any stop reason). Fired when WorkflowRun.result resolves. Paired with Events['workflow/start'].
212
-
213
- ```ts cordis-catalog
214
- /**
215
- * A workflow run settled (any stop reason). Fired when
216
- * {@link WorkflowRun.result} resolves. Paired with
217
- * {@link Events['workflow/start']}.
218
- * @param info - the run's identity snapshot.
219
- * @param result - the outcome data (stop reason, error, agent count) —
220
- * deliberately WITHOUT the result value (see {@link WorkflowResultInfo}).
221
- * @mode emit
222
- */
223
- 'workflow/end'(info: WorkflowRunInfo, result: WorkflowResultInfo): void
224
- ```
225
-
226
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
227
-
228
- <a id="workflowlog--emit"></a>
229
-
230
- #### `workflow/log` — emit
231
-
232
- The script emitted a narration line (a `log(message)` call).
233
-
234
- ```ts cordis-catalog
235
- /**
236
- * The script emitted a narration line (a `log(message)` call).
237
- * @param info - the run's identity snapshot.
238
- * @param message - the logged message, verbatim.
239
- * @mode emit
240
- */
241
- 'workflow/log'(info: WorkflowRunInfo, message: string): void
242
- ```
243
-
244
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
245
-
246
- <a id="workflowphase--emit"></a>
247
-
248
- #### `workflow/phase` — emit
249
-
250
- The script entered a phase (a `phase(title)` call) — progress grouping for observers; no execution semantics.
251
-
252
- ```ts cordis-catalog
253
- /**
254
- * The script entered a phase (a `phase(title)` call) — progress grouping
255
- * for observers; no execution semantics.
256
- * @param info - the run's identity snapshot.
257
- * @param title - the phase title, verbatim.
258
- * @mode emit
259
- */
260
- 'workflow/phase'(info: WorkflowRunInfo, title: string): void
261
- ```
262
-
263
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
264
-
265
- <a id="workflowstart--emit"></a>
266
-
267
- #### `workflow/start` — emit
268
-
269
- A workflow run started — the script's meta block validated, the body about to execute. Paired with Events['workflow/end'].
270
-
271
- ```ts cordis-catalog
272
- /**
273
- * A workflow run started — the script's meta block validated, the body
274
- * about to execute. Paired with {@link Events['workflow/end']}.
275
- * @param info - the run's identity snapshot (id + meta).
276
- * @mode emit
277
- */
278
- 'workflow/start'(info: WorkflowRunInfo): void
279
- ```
280
-
281
- Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
282
- <!-- END GENERATED cordis-surface -->
1
+ ---
2
+ editSource: "docs/subsystems/workflow.md"
3
+ rawMarkdownPath: "en/reference/subsystems/workflow.md"
4
+ outline: [2,3]
5
+ ---
6
+
7
+ # Workflow
8
+
9
+ The workflow seam lets an agent run a model-written orchestration SCRIPT that starts subagents. Like [subagent](./subagent.md) it is **one optional capability**, not part of the agent loop, so its types and operations live here rather than in [core.md](./core.md). Like bash, it permits ONE engine implementation per context to provide `ctx.workflowEngine`; there is no named-provider registry (a second engine replaces the first through plugin configuration rather than running beside it).
10
+
11
+ Service Definition: [dsh-workflow](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/workflow) (`ctx.workflowEngine` and the vocabulary below). [dsh-workflow-ptc](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/workflow-ptc) executes the VM and helpers through the shared Node PTC process runtime under the calling Session's file policy. The consumers are [dsh-tool-workflow](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/workflow/tool-workflow) and the opt-in [dsh-tool-ralph](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/experimental/tool-ralph). [Workflow sandbox reuse](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-13-workflow-ptc-sandbox-reuse.md) owns execution choices; the [dynamic-workflows reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/README.md) owns script semantics.
12
+
13
+ Sources: browser-safe vocabulary in [`packages/workflow/workflow/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/types.ts), Host request and live-run handles in [`runtime-types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/runtime-types.ts).
14
+
15
+ ## The start request
16
+
17
+ What a caller asks for when starting a run. The ordinary workflow tool builds this from the model's `{ script, meta, args }` call plus the calling agent; specialized consumers may also select one engine-wide `subagentProvider` and lower `maxTotalAgents` for the run, but the script cannot observe or replace either policy. `meta` and `args` are plain JSON DATA (the engine validates `meta` against its schema and rejects loud BEFORE anything runs — no script text is ever evaluated to obtain it). `parent` is REQUIRED — every child the script starts is attributed to it, and cwd, lineage, and depth pass through the [subagent seam](./subagent.md).
18
+
19
+ ```ts type-equiv
20
+ /**
21
+ * What a caller asks for when starting a workflow run. `meta` and `args` are
22
+ * plain JSON data by the seam contract. `parent` is required because every
23
+ * `agent()` spawned by the script is attributed to that live Agent.
24
+ */
25
+ interface WorkflowStartRequest {
26
+ /** The plain-JS script body (top-level await allowed; ends with `return <json-value>`). */
27
+ script: string
28
+ /** The workflow's identity block, as plain JSON data (shape-validated by the engine). */
29
+ meta: WorkflowMeta
30
+ /** Optional input exposed verbatim to the script as the `args` global. */
31
+ args?: unknown
32
+ /** Optional engine-wide child-provider override for this run. */
33
+ subagentProvider?: string
34
+ /** Optional per-run total-child ceiling. */
35
+ maxTotalAgents?: number
36
+ /** The agent on whose behalf the run executes (parent of every child). */
37
+ parent: Agent
38
+ /** Cancels the run when aborted. */
39
+ signal?: AbortSignal
40
+ }
41
+ ```
42
+
43
+ ## The workflow's identity: `WorkflowMeta`
44
+
45
+ The identity block carried as data on the start request (the tool's `meta` parameter; the field vocabulary matches the Claude Code dynamic-workflows meta block). `phases` is progress vocabulary only: `phase()` calls match titles for observers; no execution structure is implied.
46
+
47
+ ```ts type-equiv
48
+ /**
49
+ * The script's identity block, provided as plain JSON data alongside the
50
+ * script body (the model-facing tool carries it as its `meta` parameter) and
51
+ * validated by the engine before the body runs. `name`/`description` are
52
+ * required; the rest is optional annotation. The field vocabulary matches the
53
+ * Claude Code dynamic-workflows meta block.
54
+ */
55
+ interface WorkflowMeta {
56
+ /** Short kebab-case workflow name (display + persistence key). */
57
+ name: string
58
+ /** One-line description of what the workflow does. */
59
+ description: string
60
+ /** Optional guidance on when this workflow applies (shown in listings). */
61
+ whenToUse?: string
62
+ /** Optional phase declarations matched by `phase()` calls. */
63
+ phases?: WorkflowPhase[]
64
+ }
65
+ ```
66
+
67
+ ## The terminal result: `WorkflowResult`
68
+
69
+ The outcome of one run, resolved by `WorkflowRun.result`. `value` is the script's materialized return value — plain host-realm JSON data (`null` when the script returned nothing) — meaningful only for `completed`. `stopReason` is a CLOSED union (engine-owned; consumers may exhaust it): `completed` | `cancelled` | `error`. A non-`completed` reason carries the failure in `error`, and the consumer maps it to an `isError` tool result rather than reporting partial output as success.
70
+
71
+ ```ts type-equiv
72
+ /**
73
+ * The outcome resolved by a live workflow run. `value` is
74
+ * the script's materialized return value (plain host-realm JSON data; `null`
75
+ * when the script returned `undefined`) — meaningful only for `completed`.
76
+ * A non-`completed` reason carries the failure in `error`; the consumer maps
77
+ * it to an `isError` tool result rather than reporting partial output.
78
+ */
79
+ interface WorkflowResult {
80
+ /** The script's return value (host JSON data; `null` for no return). */
81
+ value: unknown
82
+ /** Why the run settled. */
83
+ stopReason: WorkflowStopReason
84
+ /** The failure message (present iff `stopReason` is not `completed`). */
85
+ error?: string
86
+ /**
87
+ * The code of the fatal {@link WorkflowError} that ended an `error` run;
88
+ * absent when the script's own exception or the engine runtime ended it.
89
+ */
90
+ errorCode?: WorkflowErrorCode
91
+ /**
92
+ * How many `agent()` calls the run accepted over its whole lifetime. On a
93
+ * graceful settlement this is the script-side count (calls still queued for
94
+ * a concurrency slot included); on a termination path (cancellation or
95
+ * process failure) it degrades to the host-observed count — calls queued
96
+ * inside a terminated script are unknowable then.
97
+ */
98
+ agentsStarted: number
99
+ }
100
+ ```
101
+
102
+ ## A live run: `WorkflowRun`
103
+
104
+ The consumer awaits `result`, may `cancel` during execution, and must `dispose` on every path. `result` never rejects: script failure resolves with `stopReason: 'error'`, and cancellation with `'cancelled'`. The PTC engine has no overall elapsed deadline; it immediately aborts the managed process when cancelled. Disposal awaits process and child cleanup under their provider contracts, without an independent workflow cleanup deadline.
105
+
106
+ ```ts type-equiv
107
+ /**
108
+ * Holder-owned live workflow. `result` never rejects; consumers may cancel
109
+ * and must call idempotent `dispose()` to await script and child quiescence.
110
+ */
111
+ interface WorkflowRun {
112
+ readonly id: WorkflowRunId
113
+ /** The validated meta block available before the script body runs. */
114
+ readonly meta: WorkflowMeta
115
+ readonly result: Promise<WorkflowResult>
116
+ /** Cancel the run and its children. */
117
+ cancel(reason?: string): void
118
+ /** Cancel if needed and await script and child cleanup. */
119
+ dispose(): Promise<void>
120
+ }
121
+ ```
122
+
123
+ ## Failure discipline: `WorkflowError.fatal`
124
+
125
+ Hook misuse inside a script — bad arguments, unknown/deferred `agent()` options, a schema outside the [structured-output subset](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/tools/README.md), a tripped cap, a seam start failure, cancellation — throws a `WorkflowError` with `fatal: true`. The `parallel()`/`pipeline()` combinators RE-THROW fatal errors instead of mapping the item to `null`: a typo'd option must kill the script loudly, never dissolve into something that reads as an ordinary child failure. The per-item `null` is reserved for child-run failures (a non-`completed` stop reason) and ordinary in-stage script errors. When a fatal error ends a run, the engine reports its code as `WorkflowResult.errorCode`, and the `workflow` tool fails with that code, such as `AGENT_CAP`; a run that settled as `error` without one (the script's own exception or an engine runtime failure) fails with `RUN_FAILED`, and one that settled as `cancelled` with `CANCELLED`; when the calling step itself was aborted, the tool runtime's `AbortError` `ABORTED` result applies instead.
126
+
127
+ ## Events
128
+
129
+ The `workflow/*` events (`workflow/start`, `workflow/phase`, `workflow/log`, `workflow/agent-start`, `workflow/agent-end`, `workflow/end` — see the [events catalog](#cordis-surface)) are **observe-only** emits carrying DATA SNAPSHOTS: every payload starts with `WorkflowRunInfo` (id + meta), never the live `WorkflowRun`, so a subscriber cannot gain `cancel`/`dispose`, and `workflow/end` deliberately omits the result value (a listener observing outcomes must not receive a mutable alias of the caller's result). Every emit is per-listener contained — a throwing subscriber is logged, never propagated, and cannot starve the listeners registered after it — and every listener receives its own payload clone, so mutating it corrupts neither the engine nor other listeners; the containment mirrors `subagent/start`/`subagent/end`.
130
+
131
+ ## Durable Chat records
132
+
133
+ The top-level `dsh-tool-workflow` consumer projects display facts into its calling parent Session without changing execution ownership. It writes `tool-workflow/run-start` after a run is accepted, pairs member start and end by `runId + seq`, and writes `tool-workflow/run-end` only after the result is known and disposal reaches quiescence. Nested transport calls write no record. The first append failure disables later writes for that run, so the log remains empty or a legal continuous prefix and the tool result is unchanged.
134
+
135
+ The record protocol allows one start per run, positive unique member sequences, paired member endings, no run ending with open members, and no updates after the run ending. A missing member ending or run ending at the log tail is valid interruption evidence rather than corruption.
136
+
137
+ `dsh-client-ui-workflow-run` folds the four events through the Conversation Node engine into one `workflow-run` Chat node anchored at the run-start sequence, after the original workflow tool node. Phase groups come only from actual member starts and preserve exact strings, including the distinction between an omitted phase and `''`. Closed Locations turn missing terminal facts into interrupted presentation. The [UI package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-workflow-run/README.md) owns disclosure, status, and same-parent local navigation behavior.
138
+
139
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
140
+
141
+ <a id="cordis-surface"></a>
142
+
143
+ ## Cordis API
144
+
145
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
146
+
147
+ <a id="ctxworkflowengine--workflowengine-abstract-seam"></a>
148
+
149
+ ### `ctx.workflowEngine` — `WorkflowEngine` (abstract seam)
150
+
151
+ Workflow Service Definition contract. Invalid requests throw before publication; a live run is holder-owned, its result never rejects, and disposal waits for script and child cleanup. Lifecycle listener failures are contained, and `workflow/end` fires exactly once as the result settles.
152
+
153
+ ```ts cordis-catalog
154
+ /**
155
+ * Parse and execute a workflow script.
156
+ * @param request - the script, its `args`, the parent agent, and an
157
+ * optional cancel signal.
158
+ * @returns the live run; its `result` resolves when the script settles.
159
+ */
160
+ abstract start(request: WorkflowStartRequest): WorkflowRun
161
+ ```
162
+
163
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
164
+
165
+ <a id="workflow-events"></a>
166
+
167
+ ### `workflow/*` events
168
+
169
+ <a id="workflowagent-end--emit"></a>
170
+
171
+ #### `workflow/agent-end` — emit
172
+
173
+ One `agent()` call settled (clean result, child failure, or run cancellation). Paired with Events['workflow/agent-start'] by `agent.seq`, exactly once per started call on every stop path — on an engine termination path the end is engine-synthesized with outcome `'cancelled'`.
174
+
175
+ ```ts cordis-catalog
176
+ /**
177
+ * One `agent()` call settled (clean result, child failure, or run
178
+ * cancellation). Paired with {@link Events['workflow/agent-start']} by
179
+ * `agent.seq`, exactly once per started call on every stop path — on an
180
+ * engine termination path the end is
181
+ * engine-synthesized with outcome `'cancelled'`.
182
+ * @param info - the run's identity snapshot.
183
+ * @param agent - the call identity plus its outcome.
184
+ * @mode emit
185
+ */
186
+ 'workflow/agent-end'(info: WorkflowRunInfo, agent: WorkflowAgentEndInfo): void
187
+ ```
188
+
189
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
190
+
191
+ <a id="workflowagent-start--emit"></a>
192
+
193
+ #### `workflow/agent-start` — emit
194
+
195
+ One `agent()` call established a published child run. Paired with Events['workflow/agent-end'] by `agent.seq`. A call that never receives a published run from the provider emits neither event in this pair.
196
+
197
+ ```ts cordis-catalog
198
+ /**
199
+ * One `agent()` call established a published child run. Paired with
200
+ * {@link Events['workflow/agent-end']} by `agent.seq`. A call that never
201
+ * receives a published run from the provider emits neither
202
+ * event in this pair.
203
+ * @param info - the run's identity snapshot.
204
+ * @param agent - the call's sequence number, label, phase, and child id.
205
+ * @mode emit
206
+ */
207
+ 'workflow/agent-start'(info: WorkflowRunInfo, agent: WorkflowAgentInfo): void
208
+ ```
209
+
210
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
211
+
212
+ <a id="workflowend--emit"></a>
213
+
214
+ #### `workflow/end` — emit
215
+
216
+ A workflow run settled (any stop reason). Fired when WorkflowRun.result resolves. Paired with Events['workflow/start'].
217
+
218
+ ```ts cordis-catalog
219
+ /**
220
+ * A workflow run settled (any stop reason). Fired when
221
+ * {@link WorkflowRun.result} resolves. Paired with
222
+ * {@link Events['workflow/start']}.
223
+ * @param info - the run's identity snapshot.
224
+ * @param result - the outcome data (stop reason, error, agent count) —
225
+ * deliberately WITHOUT the result value (see {@link WorkflowResultInfo}).
226
+ * @mode emit
227
+ */
228
+ 'workflow/end'(info: WorkflowRunInfo, result: WorkflowResultInfo): void
229
+ ```
230
+
231
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
232
+
233
+ <a id="workflowlog--emit"></a>
234
+
235
+ #### `workflow/log` — emit
236
+
237
+ The script emitted a narration line (a `log(message)` call).
238
+
239
+ ```ts cordis-catalog
240
+ /**
241
+ * The script emitted a narration line (a `log(message)` call).
242
+ * @param info - the run's identity snapshot.
243
+ * @param message - the logged message, verbatim.
244
+ * @mode emit
245
+ */
246
+ 'workflow/log'(info: WorkflowRunInfo, message: string): void
247
+ ```
248
+
249
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
250
+
251
+ <a id="workflowphase--emit"></a>
252
+
253
+ #### `workflow/phase` — emit
254
+
255
+ The script entered a phase (a `phase(title)` call) — progress grouping for observers; no execution semantics.
256
+
257
+ ```ts cordis-catalog
258
+ /**
259
+ * The script entered a phase (a `phase(title)` call) — progress grouping
260
+ * for observers; no execution semantics.
261
+ * @param info - the run's identity snapshot.
262
+ * @param title - the phase title, verbatim.
263
+ * @mode emit
264
+ */
265
+ 'workflow/phase'(info: WorkflowRunInfo, title: string): void
266
+ ```
267
+
268
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
269
+
270
+ <a id="workflowstart--emit"></a>
271
+
272
+ #### `workflow/start` — emit
273
+
274
+ A workflow run started — the script's meta block validated, the body about to execute. Paired with Events['workflow/end'].
275
+
276
+ ```ts cordis-catalog
277
+ /**
278
+ * A workflow run started — the script's meta block validated, the body
279
+ * about to execute. Paired with {@link Events['workflow/end']}.
280
+ * @param info - the run's identity snapshot (id + meta).
281
+ * @mode emit
282
+ */
283
+ 'workflow/start'(info: WorkflowRunInfo): void
284
+ ```
285
+
286
+ Source: [`packages/workflow/workflow/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/workflow/workflow/src/index.ts)
287
+ <!-- END GENERATED cordis-surface -->