@dipoleml/dcode-cli 1.0.0 → 1.2.0

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 (447) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +1081 -12
  2. package/dist/dcode.cjs +59155 -45279
  3. package/dist/packages/browser-use-plugin/README.md +12 -12
  4. package/dist/packages/browser-use-plugin/docs/api.json +1 -1
  5. package/dist/packages/browser-use-plugin/docs/overview.md +5 -4
  6. package/dist/packages/browser-use-plugin/docs/workflow.md +1 -1
  7. package/dist/packages/browser-use-plugin/scripts/build.mjs +1 -0
  8. package/dist/packages/browser-use-plugin/skills/control-browser/SKILL.md +10 -7
  9. package/dist/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +760 -687
  10. package/dist/packages/bundled-skills/skills/dynamic-workflows/examples.md +310 -1
  11. package/dist/packages/bundled-skills/skills/dynamic-workflows/patterns.md +336 -4
  12. package/dist/packages/node-repl-host/.dcode-plugin/plugin.json +1 -1
  13. package/dist/packages/node-repl-host/dist/mcp/server.js +9 -14
  14. package/dist/packages/node-repl-host/scripts/build.mjs +1 -0
  15. package/dist/provider/dcode-builtin.json +6544 -183
  16. package/node_modules/@dcode/contracts/dist/compact/index.d.ts +7 -7
  17. package/node_modules/@dcode/contracts/dist/config/index.d.ts +1 -1
  18. package/node_modules/@dcode/contracts/dist/events/event-reducer.js +1 -0
  19. package/node_modules/@dcode/contracts/dist/events/in-memory-session-event-store.js +3 -2
  20. package/node_modules/@dcode/contracts/dist/events/session-event-retention.d.ts +8 -0
  21. package/node_modules/@dcode/contracts/dist/events/session-event-retention.js +18 -0
  22. package/node_modules/@dcode/contracts/dist/events/session.events.d.ts +94 -16
  23. package/node_modules/@dcode/contracts/dist/events/session.events.js +10 -0
  24. package/node_modules/@dcode/contracts/dist/hooks/index.d.ts +134 -134
  25. package/node_modules/@dcode/contracts/dist/hooks/workspace-hook-trust.d.ts +14 -14
  26. package/node_modules/@dcode/contracts/dist/index.d.ts +2 -0
  27. package/node_modules/@dcode/contracts/dist/index.js +2 -0
  28. package/node_modules/@dcode/contracts/dist/interfaces/browser-control.port.d.ts +22 -0
  29. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.d.ts +92 -0
  30. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-hole.port.js +9 -0
  31. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.d.ts +4 -4
  32. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-retune.port.js +7 -3
  33. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run-workspace.port.js +8 -3
  34. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.d.ts +119 -18
  35. package/node_modules/@dcode/contracts/dist/interfaces/dynamic-workflow-run.port.js +13 -0
  36. package/node_modules/@dcode/contracts/dist/interfaces/index.d.ts +1 -0
  37. package/node_modules/@dcode/contracts/dist/interfaces/index.js +1 -0
  38. package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.d.ts +161 -1
  39. package/node_modules/@dcode/contracts/dist/interfaces/mcp.port.js +17 -0
  40. package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.d.ts +15 -15
  41. package/node_modules/@dcode/contracts/dist/interfaces/permission-full-access.js +1 -1
  42. package/node_modules/@dcode/contracts/dist/interfaces/permission.port.d.ts +15 -1
  43. package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.d.ts +19 -0
  44. package/node_modules/@dcode/contracts/dist/interfaces/provider-endpoint-routing.port.js +1 -0
  45. package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.d.ts +4 -2
  46. package/node_modules/@dcode/contracts/dist/interfaces/session-store.port.js +5 -0
  47. package/node_modules/@dcode/contracts/dist/interfaces/session.port.d.ts +92 -3
  48. package/node_modules/@dcode/contracts/dist/interfaces/session.port.js +4 -1
  49. package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.d.ts +25 -0
  50. package/node_modules/@dcode/contracts/dist/interfaces/topic-resource.port.js +1 -0
  51. package/node_modules/@dcode/contracts/dist/model/index.d.ts +15 -1
  52. package/node_modules/@dcode/contracts/dist/model/index.js +5 -0
  53. package/node_modules/@dcode/contracts/dist/model/invocation-context.d.ts +6 -1
  54. package/node_modules/@dcode/contracts/dist/plugins/index.d.ts +23 -0
  55. package/node_modules/@dcode/contracts/dist/plugins/index.js +2 -1
  56. package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.d.ts +2 -0
  57. package/node_modules/@dcode/contracts/dist/telemetry/agent-execution.js +2 -0
  58. package/node_modules/@dcode/contracts/dist/telemetry/index.d.ts +5 -1
  59. package/node_modules/@dcode/contracts/dist/telemetry/index.js +12 -0
  60. package/node_modules/@dcode/contracts/dist/tools/agent.d.ts +12 -12
  61. package/node_modules/@dcode/contracts/dist/tools/amend-workflow.d.ts +39 -15
  62. package/node_modules/@dcode/contracts/dist/tools/amend-workflow.js +12 -6
  63. package/node_modules/@dcode/contracts/dist/tools/automation.d.ts +32 -32
  64. package/node_modules/@dcode/contracts/dist/tools/automation.js +1 -1
  65. package/node_modules/@dcode/contracts/dist/tools/bash.d.ts +16 -16
  66. package/node_modules/@dcode/contracts/dist/tools/bash.js +1 -1
  67. package/node_modules/@dcode/contracts/dist/tools/create-workflow.d.ts +365 -66
  68. package/node_modules/@dcode/contracts/dist/tools/create-workflow.js +92 -11
  69. package/node_modules/@dcode/contracts/dist/tools/edit.d.ts +16 -16
  70. package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.d.ts +6 -6
  71. package/node_modules/@dcode/contracts/dist/tools/eval-workflow-snippet.js +5 -1
  72. package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.d.ts +729 -0
  73. package/node_modules/@dcode/contracts/dist/tools/fill-workflow-hole.js +102 -0
  74. package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.d.ts +136 -28
  75. package/node_modules/@dcode/contracts/dist/tools/get-workflow-run.js +36 -0
  76. package/node_modules/@dcode/contracts/dist/tools/grep.d.ts +4 -4
  77. package/node_modules/@dcode/contracts/dist/tools/grep.js +4 -0
  78. package/node_modules/@dcode/contracts/dist/tools/index.d.ts +2 -0
  79. package/node_modules/@dcode/contracts/dist/tools/index.js +4 -0
  80. package/node_modules/@dcode/contracts/dist/tools/list-saved-workflows.d.ts +8 -8
  81. package/node_modules/@dcode/contracts/dist/tools/list-workflow-runs.d.ts +8 -8
  82. package/node_modules/@dcode/contracts/dist/tools/node-repl.d.ts +2 -2
  83. package/node_modules/@dcode/contracts/dist/tools/off-peak.d.ts +3 -3
  84. package/node_modules/@dcode/contracts/dist/tools/off-peak.js +2 -2
  85. package/node_modules/@dcode/contracts/dist/tools/performance.d.ts +22 -22
  86. package/node_modules/@dcode/contracts/dist/tools/plan-mode.d.ts +12 -12
  87. package/node_modules/@dcode/contracts/dist/tools/plan-mode.js +6 -4
  88. package/node_modules/@dcode/contracts/dist/tools/read-session-context.d.ts +86 -13
  89. package/node_modules/@dcode/contracts/dist/tools/read-session-context.js +37 -6
  90. package/node_modules/@dcode/contracts/dist/tools/read.d.ts +38 -38
  91. package/node_modules/@dcode/contracts/dist/tools/save-workflow.d.ts +21 -10
  92. package/node_modules/@dcode/contracts/dist/tools/save-workflow.js +22 -2
  93. package/node_modules/@dcode/contracts/dist/tools/saved-workflow.d.ts +4 -4
  94. package/node_modules/@dcode/contracts/dist/tools/send-message.d.ts +2 -2
  95. package/node_modules/@dcode/contracts/dist/tools/skill.js +1 -0
  96. package/node_modules/@dcode/contracts/dist/tools/task-output.d.ts +6 -6
  97. package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.d.ts +1228 -259
  98. package/node_modules/@dcode/contracts/dist/tools/tool-result-metadata.js +41 -0
  99. package/node_modules/@dcode/contracts/dist/tools/webfetch.d.ts +2 -2
  100. package/node_modules/@dcode/contracts/dist/tools/workflow-observation-display.d.ts +20 -20
  101. package/node_modules/@dcode/contracts/dist/tools/workflow-settings.d.ts +55 -0
  102. package/node_modules/@dcode/contracts/dist/tools/workflow-settings.js +86 -0
  103. package/node_modules/@dcode/contracts/dist/tools/workflow.d.ts +8 -8
  104. package/node_modules/@dcode/contracts/dist/tools/write.d.ts +18 -18
  105. package/node_modules/@dcode/contracts/dist/workflow/index.d.ts +98 -98
  106. package/node_modules/@dcode/contracts/dist/workflow/script.d.ts +12 -12
  107. package/node_modules/@dcode/i18n/dist/index.js +2 -2
  108. package/node_modules/@dcode/i18n/dist/locale.d.ts +1 -1
  109. package/node_modules/@dcode/i18n/dist/locale.js +4 -4
  110. package/node_modules/@dcode/i18n/dist/locales/en-US.js +5 -5
  111. package/node_modules/@dcode/i18n/dist/locales/fr-CA.d.ts +3 -0
  112. package/node_modules/@dcode/i18n/dist/locales/fr-CA.js +354 -0
  113. package/node_modules/@dcode/model-option-map/package.json +1 -1
  114. package/node_modules/@dcode/shared/dist/api-key-usage-scene.d.ts +7 -0
  115. package/node_modules/@dcode/shared/dist/api-key-usage-scene.js +6 -0
  116. package/node_modules/@dcode/shared/dist/attachment-source.d.ts +8 -0
  117. package/node_modules/@dcode/shared/dist/attachment-source.js +4 -0
  118. package/node_modules/@dcode/shared/dist/background-bash-output.d.ts +4 -4
  119. package/node_modules/@dcode/shared/dist/bots.d.ts +759 -11
  120. package/node_modules/@dcode/shared/dist/bots.js +236 -2
  121. package/node_modules/@dcode/shared/dist/browser-use/command-metadata.d.ts +2 -2
  122. package/node_modules/@dcode/shared/dist/browser-use/commands.d.ts +4 -3
  123. package/node_modules/@dcode/shared/dist/browser-use/commands.js +3 -1
  124. package/node_modules/@dcode/shared/dist/browser-use/nodeReplBroker.d.ts +5 -4
  125. package/node_modules/@dcode/shared/dist/browser-use/result.d.ts +6 -6
  126. package/node_modules/@dcode/shared/dist/channel-mention.d.ts +173 -0
  127. package/node_modules/@dcode/shared/dist/channel-mention.js +120 -0
  128. package/node_modules/@dcode/shared/dist/channels.d.ts +128 -1
  129. package/node_modules/@dcode/shared/dist/channels.js +66 -0
  130. package/node_modules/@dcode/shared/dist/clientConfig.d.ts +1 -0
  131. package/node_modules/@dcode/shared/dist/clientConfig.js +18 -2
  132. package/node_modules/@dcode/shared/dist/cloudContent.d.ts +160 -0
  133. package/node_modules/@dcode/shared/dist/cloudContent.js +116 -0
  134. package/node_modules/@dcode/shared/dist/coding-plan-subscription.d.ts +59 -0
  135. package/node_modules/@dcode/shared/dist/conversation-message-projection-policy.js +2 -0
  136. package/node_modules/@dcode/shared/dist/conversation-share.d.ts +378 -74
  137. package/node_modules/@dcode/shared/dist/conversation-share.js +8 -6
  138. package/node_modules/@dcode/shared/dist/conversationSelection.d.ts +23 -0
  139. package/node_modules/@dcode/shared/dist/conversationSelection.js +30 -0
  140. package/node_modules/@dcode/shared/dist/database-startup.d.ts +5 -5
  141. package/node_modules/@dcode/shared/dist/dcode-agent-model-state.js +14 -6
  142. package/node_modules/@dcode/shared/dist/dcode-agent-policy.d.ts +16 -1
  143. package/node_modules/@dcode/shared/dist/dcode-agent-policy.js +17 -1
  144. package/node_modules/@dcode/shared/dist/dcode-agent-runtime.js +1 -1
  145. package/node_modules/@dcode/shared/dist/dcode-protocol/index.d.ts +3215 -1800
  146. package/node_modules/@dcode/shared/dist/dcode-protocol/index.js +555 -24
  147. package/node_modules/@dcode/shared/dist/dcode-protocol/trace.d.ts +9 -0
  148. package/node_modules/@dcode/shared/dist/dcode-protocol/trace.js +10 -0
  149. package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.d.ts +30 -20
  150. package/node_modules/@dcode/shared/dist/dcode-protocol-legacy-types.js +3 -1
  151. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/apply.js +12 -3
  152. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.d.ts +5 -0
  153. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/attachment-ref.js +3 -0
  154. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.d.ts +3 -1
  155. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/coalesce.js +3 -1
  156. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.d.ts +388 -57
  157. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/command.js +67 -45
  158. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/controller.d.ts +208 -103
  159. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.d.ts +20 -0
  160. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-session-config.js +15 -0
  161. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.d.ts +34 -0
  162. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/create-workflow-display.js +45 -1
  163. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.d.ts +1453 -278
  164. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/delta.js +45 -2
  165. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.d.ts +1 -0
  166. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/index.js +1 -0
  167. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.d.ts +173 -6
  168. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/input-intent.js +29 -0
  169. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.d.ts +731 -125
  170. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/rows.js +23 -11
  171. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.d.ts +30 -11
  172. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index-workflow-activity.js +35 -3
  173. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/sessions-index.d.ts +40 -25
  174. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.d.ts +1444 -216
  175. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/snapshot.js +3 -0
  176. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.d.ts +1 -0
  177. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/submission.js +1 -1
  178. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/telemetry.d.ts +62 -58
  179. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.d.ts +185 -50
  180. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/toolDisplay.js +31 -3
  181. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.d.ts +7728 -1585
  182. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/transport.js +18 -5
  183. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-assembler.js +2 -1
  184. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-fault.js +4 -1
  185. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/wire-reassembly.js +5 -3
  186. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.d.ts +29 -1
  187. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-artifacts.js +64 -4
  188. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.d.ts +13 -0
  189. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-command-rejections.js +23 -0
  190. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-observation-display.d.ts +14 -14
  191. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.d.ts +52 -8
  192. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-row-meta.js +22 -3
  193. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.d.ts +4 -4
  194. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-run-settings-command.js +2 -2
  195. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.d.ts +21 -0
  196. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-session.js +44 -0
  197. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.d.ts +1 -1
  198. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-actor-status.js +3 -2
  199. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-caps.js +5 -4
  200. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.d.ts +26 -19
  201. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-concurrency.js +40 -32
  202. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.d.ts +4 -3
  203. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-delta.js +4 -3
  204. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.d.ts +12 -2
  205. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-entries.js +44 -6
  206. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.d.ts +2 -2
  207. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-eviction.js +17 -10
  208. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.d.ts +33 -0
  209. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-holes.js +202 -0
  210. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.d.ts +1 -1
  211. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-legacy.js +1 -1
  212. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-phases.js +10 -1
  213. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.d.ts +1 -1
  214. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-reducer.js +29 -22
  215. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-started.js +5 -2
  216. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-tables.js +2 -1
  217. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs-unlisted.js +6 -3
  218. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.d.ts +125 -40
  219. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-runs.js +101 -26
  220. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workflow-workspace.d.ts +4 -4
  221. package/node_modules/@dcode/shared/dist/dcode-protocol-v4/workspace-hook-review.d.ts +1 -1
  222. package/node_modules/@dcode/shared/dist/dcode-session-content-profile.d.ts +5 -0
  223. package/node_modules/@dcode/shared/dist/dcode-session-content-profile.js +49 -0
  224. package/node_modules/@dcode/shared/dist/dcode-slash-command-help.js +4 -4
  225. package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.d.ts +6 -1
  226. package/node_modules/@dcode/shared/dist/dcode-task-mode-schema.js +13 -1
  227. package/node_modules/@dcode/shared/dist/dcode-task-types-core.d.ts +12 -2
  228. package/node_modules/@dcode/shared/dist/dcode-task-types.d.ts +23 -0
  229. package/node_modules/@dcode/shared/dist/dcodeEndpoint.d.ts +22 -1
  230. package/node_modules/@dcode/shared/dist/dcodeEndpoint.js +102 -17
  231. package/node_modules/@dcode/shared/dist/desktopMenu.js +48 -48
  232. package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.d.ts +35 -6
  233. package/node_modules/@dcode/shared/dist/dynamic-workflow-feature.js +45 -6
  234. package/node_modules/@dcode/shared/dist/env.d.ts +5 -4
  235. package/node_modules/@dcode/shared/dist/env.js +9 -9
  236. package/node_modules/@dcode/shared/dist/errors.d.ts +24 -0
  237. package/node_modules/@dcode/shared/dist/errors.js +54 -0
  238. package/node_modules/@dcode/shared/dist/execution-state.d.ts +4 -2
  239. package/node_modules/@dcode/shared/dist/execution-state.js +1 -1
  240. package/node_modules/@dcode/shared/dist/feedback.d.ts +1 -1
  241. package/node_modules/@dcode/shared/dist/gen-ui/contract.d.ts +140 -0
  242. package/node_modules/@dcode/shared/dist/gen-ui/contract.example.d.ts +5 -0
  243. package/node_modules/@dcode/shared/dist/gen-ui/contract.example.js +36 -0
  244. package/node_modules/@dcode/shared/dist/gen-ui/contract.js +196 -0
  245. package/node_modules/@dcode/shared/dist/gen-ui/contract.test.d.ts +2 -0
  246. package/node_modules/@dcode/shared/dist/gen-ui/contract.test.js +75 -0
  247. package/node_modules/@dcode/shared/dist/gen-ui/index.d.ts +2 -0
  248. package/node_modules/@dcode/shared/dist/gen-ui/index.js +2 -0
  249. package/node_modules/@dcode/shared/dist/gen-ui/module.d.ts +7 -0
  250. package/node_modules/@dcode/shared/dist/gen-ui/module.js +7 -0
  251. package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.d.ts +202 -0
  252. package/node_modules/@dcode/shared/dist/gen-ui/tweakProtocol.js +126 -0
  253. package/node_modules/@dcode/shared/dist/helpAppConfig.d.ts +1 -1
  254. package/node_modules/@dcode/shared/dist/helpAppConfig.js +2 -2
  255. package/node_modules/@dcode/shared/dist/highspeed.d.ts +181 -0
  256. package/node_modules/@dcode/shared/dist/highspeed.js +112 -0
  257. package/node_modules/@dcode/shared/dist/index.d.ts +27 -5
  258. package/node_modules/@dcode/shared/dist/index.js +24 -2
  259. package/node_modules/@dcode/shared/dist/localTtft.d.ts +27 -27
  260. package/node_modules/@dcode/shared/dist/marketingTouch.d.ts +930 -0
  261. package/node_modules/@dcode/shared/dist/marketingTouch.js +170 -0
  262. package/node_modules/@dcode/shared/dist/mcp-apps/appTools.d.ts +83 -0
  263. package/node_modules/@dcode/shared/dist/mcp-apps/appTools.js +124 -0
  264. package/node_modules/@dcode/shared/dist/mcp-apps/content.d.ts +4 -0
  265. package/node_modules/@dcode/shared/dist/mcp-apps/content.js +8 -0
  266. package/node_modules/@dcode/shared/dist/mcp-apps/contract.d.ts +241 -0
  267. package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.d.ts +31 -0
  268. package/node_modules/@dcode/shared/dist/mcp-apps/contract.example.js +42 -0
  269. package/node_modules/@dcode/shared/dist/mcp-apps/contract.js +101 -0
  270. package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.d.ts +2 -0
  271. package/node_modules/@dcode/shared/dist/mcp-apps/contract.test.js +64 -0
  272. package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.d.ts +47 -0
  273. package/node_modules/@dcode/shared/dist/mcp-apps/hostContract.js +8 -0
  274. package/node_modules/@dcode/shared/dist/mcp-apps/index.d.ts +9 -0
  275. package/node_modules/@dcode/shared/dist/mcp-apps/index.js +9 -0
  276. package/node_modules/@dcode/shared/dist/mcp-apps/instance.d.ts +10 -0
  277. package/node_modules/@dcode/shared/dist/mcp-apps/instance.js +11 -0
  278. package/node_modules/@dcode/shared/dist/mcp-apps/module.d.ts +12 -0
  279. package/node_modules/@dcode/shared/dist/mcp-apps/module.js +12 -0
  280. package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.d.ts +8 -0
  281. package/node_modules/@dcode/shared/dist/mcp-apps/resourceMime.js +73 -0
  282. package/node_modules/@dcode/shared/dist/mcp-apps/sampling.d.ts +101 -0
  283. package/node_modules/@dcode/shared/dist/mcp-apps/sampling.js +107 -0
  284. package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.d.ts +2 -0
  285. package/node_modules/@dcode/shared/dist/mcp-apps/sampling.test.js +55 -0
  286. package/node_modules/@dcode/shared/dist/mcp-apps/schemas.d.ts +78 -0
  287. package/node_modules/@dcode/shared/dist/mcp-apps/schemas.js +65 -0
  288. package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.d.ts +39 -0
  289. package/node_modules/@dcode/shared/dist/mcp-apps/toolMeta.js +199 -0
  290. package/node_modules/@dcode/shared/dist/mcp.d.ts +6 -2
  291. package/node_modules/@dcode/shared/dist/memory.d.ts +9 -0
  292. package/node_modules/@dcode/shared/dist/memory.js +2 -0
  293. package/node_modules/@dcode/shared/dist/model-execution.d.ts +31 -0
  294. package/node_modules/@dcode/shared/dist/model-execution.js +38 -0
  295. package/node_modules/@dcode/shared/dist/networkCapture.d.ts +49 -0
  296. package/node_modules/@dcode/shared/dist/networkCapture.js +41 -0
  297. package/node_modules/@dcode/shared/dist/node/genUiPaths.d.ts +6 -0
  298. package/node_modules/@dcode/shared/dist/node/genUiPaths.js +16 -0
  299. package/node_modules/@dcode/shared/dist/node/genUiPaths.test.d.ts +2 -0
  300. package/node_modules/@dcode/shared/dist/node/genUiPaths.test.js +30 -0
  301. package/node_modules/@dcode/shared/dist/node/networkCapture.d.ts +8 -0
  302. package/node_modules/@dcode/shared/dist/node/networkCapture.js +96 -0
  303. package/node_modules/@dcode/shared/dist/node/officialPluginCache.d.ts +1 -2
  304. package/node_modules/@dcode/shared/dist/node/subagentMarkdownMigration.d.ts +1 -2
  305. package/node_modules/@dcode/shared/dist/node.d.ts +2 -0
  306. package/node_modules/@dcode/shared/dist/node.js +2 -0
  307. package/node_modules/@dcode/shared/dist/output-style.d.ts +17 -0
  308. package/node_modules/@dcode/shared/dist/output-style.js +2 -0
  309. package/node_modules/@dcode/shared/dist/platform.d.ts +149 -1
  310. package/node_modules/@dcode/shared/dist/platform.js +2 -0
  311. package/node_modules/@dcode/shared/dist/platformUpdate.d.ts +61 -0
  312. package/node_modules/@dcode/shared/dist/platformUpdate.js +2 -0
  313. package/node_modules/@dcode/shared/dist/plugin-marketplaces.d.ts +5 -0
  314. package/node_modules/@dcode/shared/dist/plugin-marketplaces.js +20 -14
  315. package/node_modules/@dcode/shared/dist/project-access-token-client.d.ts +42 -0
  316. package/node_modules/@dcode/shared/dist/project-access-token-client.js +260 -0
  317. package/node_modules/@dcode/shared/dist/project-access-token-response.d.ts +4 -0
  318. package/node_modules/@dcode/shared/dist/project-access-token-response.js +9 -0
  319. package/node_modules/@dcode/shared/dist/project-access-token.d.ts +45 -0
  320. package/node_modules/@dcode/shared/dist/project-access-token.js +164 -0
  321. package/node_modules/@dcode/shared/dist/protocol.d.ts +46 -4
  322. package/node_modules/@dcode/shared/dist/protocol.js +1 -1
  323. package/node_modules/@dcode/shared/dist/provider-provisioning.d.ts +26 -2
  324. package/node_modules/@dcode/shared/dist/provider-provisioning.js +19 -3
  325. package/node_modules/@dcode/shared/dist/providers.d.ts +1 -2
  326. package/node_modules/@dcode/shared/dist/providers.js +1 -1
  327. package/node_modules/@dcode/shared/dist/remote-workspace-identity.d.ts +6 -1
  328. package/node_modules/@dcode/shared/dist/remote-workspace-identity.js +35 -1
  329. package/node_modules/@dcode/shared/dist/remoteAppConfig.js +1 -1
  330. package/node_modules/@dcode/shared/dist/remoteEnvironmentKey.js +19 -0
  331. package/node_modules/@dcode/shared/dist/remoteTarget.d.ts +14 -1
  332. package/node_modules/@dcode/shared/dist/remoteTarget.js +4 -0
  333. package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.d.ts +27 -0
  334. package/node_modules/@dcode/shared/dist/remoteUsageTelemetry.js +43 -0
  335. package/node_modules/@dcode/shared/dist/rendererActionTrace.d.ts +35 -35
  336. package/node_modules/@dcode/shared/dist/request-security-edition/index.d.ts +3 -0
  337. package/node_modules/@dcode/shared/dist/request-security-edition/index.js +3 -0
  338. package/node_modules/@dcode/shared/dist/request-security-edition/policy.d.ts +3 -0
  339. package/node_modules/@dcode/shared/dist/request-security-edition/policy.js +5 -0
  340. package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.d.ts +19 -0
  341. package/node_modules/@dcode/shared/dist/request-security-edition/verification-policy.js +29 -0
  342. package/node_modules/@dcode/shared/dist/rewardsBridge.d.ts +8 -0
  343. package/node_modules/@dcode/shared/dist/rewardsBridge.js +80 -0
  344. package/node_modules/@dcode/shared/dist/rewardsEmbedded.d.ts +37 -0
  345. package/node_modules/@dcode/shared/dist/rewardsEmbedded.js +50 -0
  346. package/node_modules/@dcode/shared/dist/sessionCreateTelemetry.d.ts +3 -3
  347. package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.d.ts +10 -0
  348. package/node_modules/@dcode/shared/dist/subagent-profile-frontmatter.js +212 -0
  349. package/node_modules/@dcode/shared/dist/subagent-profile-parser.d.ts +10 -0
  350. package/node_modules/@dcode/shared/dist/subagent-profile-parser.js +200 -0
  351. package/node_modules/@dcode/shared/dist/subagent-profile.d.ts +82 -0
  352. package/node_modules/@dcode/shared/dist/subagent-profile.js +28 -0
  353. package/node_modules/@dcode/shared/dist/subagent-runtime-config.d.ts +135 -0
  354. package/node_modules/@dcode/shared/dist/subagent-runtime-config.js +39 -0
  355. package/node_modules/@dcode/shared/dist/subagents-types.d.ts +1 -1
  356. package/node_modules/@dcode/shared/dist/task-realtime-core.d.ts +57 -24
  357. package/node_modules/@dcode/shared/dist/task-realtime-core.js +8 -2
  358. package/node_modules/@dcode/shared/dist/test-ids-workflow.d.ts +4 -0
  359. package/node_modules/@dcode/shared/dist/test-ids-workflow.js +5 -0
  360. package/node_modules/@dcode/shared/dist/test-ids.d.ts +25 -0
  361. package/node_modules/@dcode/shared/dist/test-ids.js +25 -0
  362. package/node_modules/@dcode/shared/dist/tool-identity.d.ts +1 -1
  363. package/node_modules/@dcode/shared/dist/tool-identity.js +4 -0
  364. package/node_modules/@dcode/shared/dist/tool-plan-adapter.js +14 -1
  365. package/node_modules/@dcode/shared/dist/usage-stats.d.ts +13 -0
  366. package/node_modules/@dcode/shared/dist/validation.d.ts +1542 -166
  367. package/node_modules/@dcode/shared/dist/validation.js +423 -14
  368. package/node_modules/@dcode/shared/dist/validationAppSettings.d.ts +70 -14
  369. package/node_modules/@dcode/shared/dist/validationAppSettings.js +74 -12
  370. package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.d.ts +8 -0
  371. package/node_modules/@dcode/shared/dist/web-remote-control-heartbeat.js +40 -0
  372. package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.d.ts +183 -0
  373. package/node_modules/@dcode/shared/dist/web-remote-control-rpc-transport.js +562 -0
  374. package/node_modules/@dcode/shared/dist/web-remote-control.d.ts +645 -0
  375. package/node_modules/@dcode/shared/dist/web-remote-control.js +174 -0
  376. package/node_modules/@dcode/shared/package.json +5 -2
  377. package/node_modules/@dcode/tui/dist/app-approval-panel.js +3 -2
  378. package/node_modules/@dcode/tui/dist/app-approval.d.ts +3 -1
  379. package/node_modules/@dcode/tui/dist/app-approval.js +9 -5
  380. package/node_modules/@dcode/tui/dist/app-compact-timeline.d.ts +3 -0
  381. package/node_modules/@dcode/tui/dist/app-compact-timeline.js +5 -2
  382. package/node_modules/@dcode/tui/dist/app-empty-transcript.d.ts +1 -0
  383. package/node_modules/@dcode/tui/dist/app-empty-transcript.js +1 -1
  384. package/node_modules/@dcode/tui/dist/app-file-mentions.d.ts +2 -0
  385. package/node_modules/@dcode/tui/dist/app-file-mentions.js +2 -2
  386. package/node_modules/@dcode/tui/dist/app-input-pane.d.ts +38 -0
  387. package/node_modules/@dcode/tui/dist/app-input-pane.js +19 -19
  388. package/node_modules/@dcode/tui/dist/app-input-status.d.ts +17 -0
  389. package/node_modules/@dcode/tui/dist/app-input-status.js +4 -4
  390. package/node_modules/@dcode/tui/dist/app-input.d.ts +1 -0
  391. package/node_modules/@dcode/tui/dist/app-input.js +1 -1
  392. package/node_modules/@dcode/tui/dist/app-markdown-theme.d.ts +2 -1
  393. package/node_modules/@dcode/tui/dist/app-markdown-theme.js +1 -1
  394. package/node_modules/@dcode/tui/dist/app-markdown.d.ts +1 -0
  395. package/node_modules/@dcode/tui/dist/app-markdown.js +1 -1
  396. package/node_modules/@dcode/tui/dist/app-mode-command.d.ts +3 -0
  397. package/node_modules/@dcode/tui/dist/app-mode-command.js +4 -4
  398. package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.d.ts +5 -0
  399. package/node_modules/@dcode/tui/dist/app-mode-suggestion-panel.js +1 -1
  400. package/node_modules/@dcode/tui/dist/app-mode.d.ts +1 -1
  401. package/node_modules/@dcode/tui/dist/app-mode.js +1 -1
  402. package/node_modules/@dcode/tui/dist/app-model-ref.d.ts +1 -0
  403. package/node_modules/@dcode/tui/dist/app-model-ref.js +1 -1
  404. package/node_modules/@dcode/tui/dist/app-motion.d.ts +13 -0
  405. package/node_modules/@dcode/tui/dist/app-motion.js +17 -7
  406. package/node_modules/@dcode/tui/dist/app-session-event-handler.d.ts +33 -0
  407. package/node_modules/@dcode/tui/dist/app-session-event-handler.js +4 -4
  408. package/node_modules/@dcode/tui/dist/app-shiki-diff-view.d.ts +18 -1
  409. package/node_modules/@dcode/tui/dist/app-shiki-diff-view.js +3 -3
  410. package/node_modules/@dcode/tui/dist/app-shiki-highlighter.d.ts +3 -0
  411. package/node_modules/@dcode/tui/dist/app-shiki-highlighter.js +7 -2
  412. package/node_modules/@dcode/tui/dist/app-sidebar-layout.d.ts +10 -0
  413. package/node_modules/@dcode/tui/dist/app-sidebar-layout.js +4 -4
  414. package/node_modules/@dcode/tui/dist/app-submit.d.ts +1 -0
  415. package/node_modules/@dcode/tui/dist/app-submit.js +1 -1
  416. package/node_modules/@dcode/tui/dist/app-thought-components.d.ts +7 -0
  417. package/node_modules/@dcode/tui/dist/app-thought-components.js +2 -2
  418. package/node_modules/@dcode/tui/dist/app-tool-transcript.d.ts +1 -0
  419. package/node_modules/@dcode/tui/dist/app-tool-transcript.js +3 -0
  420. package/node_modules/@dcode/tui/dist/app-view.d.ts +27 -0
  421. package/node_modules/@dcode/tui/dist/app-view.js +1 -1
  422. package/node_modules/@dcode/tui/dist/app-workflow-card.js +1 -1
  423. package/node_modules/@dcode/tui/dist/app-workflow-seed.d.ts +18 -1
  424. package/node_modules/@dcode/tui/dist/app-workflow-seed.js +4 -4
  425. package/node_modules/@dcode/tui/dist/index.js +5117 -2578
  426. package/node_modules/@dcode/tui/dist/tui.d.ts +3 -0
  427. package/node_modules/@dcode/tui/dist/tui.js +1 -1
  428. package/node_modules/@dcode/tui/dist/types.d.ts +1 -1
  429. package/node_modules/oniguruma-parser/LICENSE +1 -1
  430. package/node_modules/oniguruma-parser/README.md +15 -61
  431. package/node_modules/oniguruma-parser/dist/oniguruma-parser.min.js +4 -4
  432. package/node_modules/oniguruma-parser/dist/parser/parse.js +1 -1
  433. package/node_modules/oniguruma-parser/dist/traverser/traverse.js +1 -1
  434. package/node_modules/oniguruma-parser/package.json +5 -5
  435. package/node_modules/oniguruma-to-es/dist/cjs/generate.d.ts +1 -1
  436. package/node_modules/oniguruma-to-es/dist/cjs/index.js +121 -120
  437. package/node_modules/oniguruma-to-es/dist/cjs/subclass.d.ts +2 -2
  438. package/node_modules/oniguruma-to-es/dist/cjs/transform.d.ts +3 -5
  439. package/node_modules/oniguruma-to-es/dist/cjs/unicode.d.ts +1 -1
  440. package/node_modules/oniguruma-to-es/dist/esm/generate.d.ts +1 -1
  441. package/node_modules/oniguruma-to-es/dist/esm/index.js +1 -3
  442. package/node_modules/oniguruma-to-es/dist/esm/subclass.d.ts +2 -2
  443. package/node_modules/oniguruma-to-es/dist/esm/transform.d.ts +3 -5
  444. package/node_modules/oniguruma-to-es/dist/esm/unicode.d.ts +1 -1
  445. package/node_modules/oniguruma-to-es/dist/index.min.js +6 -6
  446. package/node_modules/oniguruma-to-es/package.json +5 -5
  447. package/package.json +5 -5
@@ -464,13 +464,22 @@ export const v4ConversationFileChangesResultSchema = z
464
464
  // (`appendEvent` 单调分配),在 workflowRuns[].lastEventSequence 抬升时重取。
465
465
  // 刻意**不是** v4 command:command 的 ACK 结果是 commandResultSchema 那个封闭的「变更结果」
466
466
  // 判别联合,把一页只读事件塞进去等于把读放进写的词汇表,还要白背 baseRevision/幂等那套机制。
467
+ /**
468
+ * 事件日志一页的两道界,网关按它们取数(apps/dcode-cli/packages/dynamic-workflow/docs/execution-engine.md
469
+ * 「Reading the journal」)。字节按存储里的序列化字节计、取协议单帧上限的四分之一:条数单独
470
+ * 管不住字节,500 条带着大 report item 的事件足以顶到单帧上限。
471
+ */
472
+ export const WORKFLOW_RUN_EVENTS_PAGE_LIMITS = {
473
+ maxEvents: 500,
474
+ maxBytes: PROTOCOL_V4_LIMITS.logicalFrameAssemblyMaxBytes / 4,
475
+ };
467
476
  export const v4ConversationWorkflowRunEventsParamsSchema = z
468
477
  .object({
469
478
  sessionId: z.string().min(1),
470
479
  runId: z.string().min(1),
471
480
  /** 只取 sequence 严格大于该值的事件;缺省从头取。 */
472
481
  afterSequence: z.number().int().nonnegative().optional(),
473
- limit: z.number().int().positive().max(500).optional(),
482
+ limit: z.number().int().positive().max(WORKFLOW_RUN_EVENTS_PAGE_LIMITS.maxEvents).optional(),
474
483
  })
475
484
  .strict();
476
485
  export const v4ConversationWorkflowRunEventsResultSchema = z
@@ -485,7 +494,7 @@ export const v4ConversationWorkflowRunEventsResultSchema = z
485
494
  truncated: z.boolean().optional(),
486
495
  })
487
496
  .strict()),
488
- /** 本页取满 limit 且后面仍有事件。 */
497
+ /** 本页之后仍有事件(页可能因条数或字节上界提前收尾)。 */
489
498
  hasMore: z.boolean(),
490
499
  })
491
500
  .strict();
@@ -811,20 +820,24 @@ export const v4AttachmentReadResultSchema = z
811
820
  .string()
812
821
  .refine((value) => value.startsWith("image/") ||
813
822
  value.startsWith("video/") ||
814
- value.split(";", 1)[0]?.trim().toLowerCase() === "application/pdf", "attachment preview only supports image/video/pdf media types"),
823
+ value.split(";", 1)[0]?.trim().toLowerCase() === "application/pdf" ||
824
+ value.split(";", 1)[0]?.trim().toLowerCase() === "text/plain", "attachment preview only supports image/video/pdf/plain text types"),
815
825
  totalBytes: z.number().int().nonnegative().max(PROTOCOL_V4_LIMITS.attachmentPreviewMaxBytes),
816
826
  nextOffset: z.number().int().positive().nullable(),
817
827
  })
818
828
  .strict()
819
829
  .superRefine((value, context) => {
820
- if (value.mediaType.startsWith("image/") &&
830
+ if (
831
+ // 根因:运行时已支持材料文本,响应 schema 仍只接受媒体,导致跨进程预览失败。
832
+ (value.mediaType.startsWith("image/") ||
833
+ value.mediaType.split(";", 1)[0]?.trim().toLowerCase() === "text/plain") &&
821
834
  value.totalBytes > PROTOCOL_V4_LIMITS.attachmentMaxBytes) {
822
835
  context.addIssue({
823
836
  code: "too_big",
824
837
  maximum: PROTOCOL_V4_LIMITS.attachmentMaxBytes,
825
838
  origin: "number",
826
839
  inclusive: true,
827
- message: "image preview exceeds total byte limit",
840
+ message: "image/text preview exceeds total byte limit",
828
841
  path: ["totalBytes"],
829
842
  });
830
843
  }
@@ -101,7 +101,8 @@ export class TopicWireFrameAssembler {
101
101
  accept(wire, now = Date.now()) {
102
102
  const events = this.expire(now);
103
103
  const key = routeKey(wire.topic, wire.subscriptionId);
104
- if (!Number.isSafeInteger(wire.logicalFrameOrdinal) || wire.logicalFrameOrdinal < 1) {
104
+ if (!Number.isSafeInteger(wire.logicalFrameOrdinal) ||
105
+ wire.logicalFrameOrdinal < 1) {
105
106
  events.push(this.fault(wire, "proto.frameAssemblyMetadataMismatch"));
106
107
  return events;
107
108
  }
@@ -1,11 +1,14 @@
1
1
  // V4 physical assembly fault 的分类:**内容确定性失败** vs 瞬态失败。
2
+ // spec:docs/v4-refactor/04-sync-and-recovery.md 封闭规则 11、
3
+ // docs/v4-refactor/05-transport-and-backpressure.md「客户端规则」。
2
4
  //
3
5
  // 恢复阶梯默认把 fault 当瞬态处理:先 same-sub resync(服务端可能回 resume),再断档则升级
4
6
  // forceSnapshot,仍不成则 fail closed。这套升级对丢片、超时、校验和不符是对的——重投一次很可能
5
7
  // 就好了。对 **schema 拒收** 却是错的:字节已经过了 length/checksum/UTF-8/JSON 四道关,被拒说明
6
8
  // 本端读不懂对端发来的**内容**,而 resume 档只会把同一批 delta 再投一遍,必然同样被拒。
7
9
  //
8
- // 工具卡载荷出现不兼容字段时,重投相同内容无法恢复;应尝试快照后明确报告内容不兼容。
10
+ // 2026-09-21(sess_4142de31)的事故就是这条:一个工具卡载荷多带两个键,恢复阶梯在同一份内容上
11
+ // 烧掉三帧后 fail closed,用户手动「重新连接」两次、每次再烧三帧,会话再也打不开。
9
12
  //
10
13
  // 本模块只回答「这个 reason code 是不是确定性内容失败」,不决定怎么处置——处置在两个 store 里
11
14
  // (conversationProjectionStore / sessionsIndexStore)。
@@ -11,7 +11,8 @@ function frameMatchesEnvelope(frame, wire) {
11
11
  if (typeof frame !== "object" || frame === null)
12
12
  return false;
13
13
  const record = frame;
14
- return record.topic === wire.topic && record.subscriptionId === wire.subscriptionId;
14
+ return (record.topic === wire.topic &&
15
+ record.subscriptionId === wire.subscriptionId);
15
16
  }
16
17
  export function reassembleTopicWireFrames(wires, frameSchema, options = {}) {
17
18
  if (wires.length === 0) {
@@ -43,8 +44,9 @@ export function reassembleTopicWireFrames(wires, frameSchema, options = {}) {
43
44
  ? { kind: "complete", frame: parsed.data, deliveryKind: first.deliveryKind }
44
45
  : { kind: "rejected", reasonCode: WIRE_FAULT_INVALID_PAYLOAD };
45
46
  }
46
- if (first.fragmentCount > PROTOCOL_V4_LIMITS.logicalFrameAssemblyMaxFragments) {
47
- // fragmentCount 曾只受 logicalBytes 约束,恶意元数据可在
47
+ if (first.fragmentCount >
48
+ PROTOCOL_V4_LIMITS.logicalFrameAssemblyMaxFragments) {
49
+ // 修复原因:fragmentCount 曾只受 logicalBytes 约束,恶意元数据可在
48
50
  // 缺片路径制造千万级 missingIndexes,先用协议硬上限阻断无界分配。
49
51
  return {
50
52
  kind: "rejected",
@@ -28,7 +28,33 @@ export declare const WORKFLOW_ARTIFACT_LIMITS: {
28
28
  readonly maxItemsPerPage: 500;
29
29
  /** 一页的缺省条数(调用方不传 limit 时网关用它)。 */
30
30
  readonly defaultItemsPerPage: 200;
31
+ /**
32
+ * `workflowRunArtifactData` 一页的字节上界(按存储里的序列化字节计),由网关传给存储层。
33
+ * 取协议单帧上限(16 MiB)的四分之一:条数上界单独管不住字节——500 条 × 32 KiB 就顶到了
34
+ * 单帧上限,于是一页可能根本发不出去。一页至少带一条,所以单条的上限(`REPORT_CAPS`)
35
+ * 必须远小于单帧上限。
36
+ */
37
+ readonly maxPageBytes: number;
38
+ /** `workflowRunArtifactData` 一次最多点名几个字段路径(一张看板的 spec 用不到这么多)。 */
39
+ readonly maxFieldsPerRequest: 32;
40
+ /** 一个字段路径的最大长度。 */
41
+ readonly maxFieldPathLength: 256;
42
+ /**
43
+ * 一个字段值的序列化字节上界。超过的值回成一段截短的字符串(前 1,000 个字符加「…」):
44
+ * 图表只用数值,表格与看板的格子本来就只显示短文本。
45
+ */
46
+ readonly maxFieldValueBytes: 4096;
31
47
  };
48
+ /**
49
+ * 按点路径从一条 report item 里取值:"timing.after"、"rounds.0.ms"(docs/execution-engine.md
50
+ * 「Reading the journal」)。
51
+ *
52
+ * 这是**协议上的契约**,不只是渲染器的工具函数:看板取数时 CLI 在 SQLite 里按同一套规则把
53
+ * 字段取出来(adapters 的 dwf-journal-fields.ts),渲染器拿到的值必须与它自己从整条 item 里
54
+ * 取出来的逐字相同。规则:按 `.` 切段;当前值是数组时,段按 `Number(段)` 当下标(非负整数且
55
+ * 在界内才算);是对象时按键取;走不通(null、标量、越界、缺键)得 `undefined`。
56
+ */
57
+ export declare function readWorkflowArtifactField(item: unknown, path: string): unknown;
32
58
  /**
33
59
  * 一个产物版本的**元数据**(journal `dwf_node.result_json` 上 `ArtifactVersionRecord` 的
34
60
  * zod 镜像)。字节不在这里——`uri` 指向 tool-artifact store,取字节走
@@ -100,7 +126,7 @@ export type WorkflowRunArtifact = z.infer<typeof workflowRunArtifactSchema>;
100
126
  * `workflowRunArtifactRead` 取字节)按需拉——权威始终在 journal。
101
127
  *
102
128
  * `itemCount` 在这里的职责是**刷新信号**:看板 hook 见它变化就带 `afterSequence` 增量取数。
103
- * 把标签 report 的原值放进快照会让 256 条 × 32KB 的最坏情形把状态帧撑到 2MB。
129
+ * 把标签 report 的原值放进这个高频状态键,一个 run 的条目有多少字节,每一帧就要搬多少字节。
104
130
  */
105
131
  export declare const workflowRunArtifactSummarySchema: z.ZodObject<{
106
132
  id: z.ZodString;
@@ -165,6 +191,7 @@ export declare const v4ConversationWorkflowRunArtifactDataParamsSchema: z.ZodObj
165
191
  artifactId: z.ZodString;
166
192
  afterSequence: z.ZodOptional<z.ZodNumber>;
167
193
  limit: z.ZodOptional<z.ZodNumber>;
194
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
168
195
  }, z.core.$strict>;
169
196
  export type V4ConversationWorkflowRunArtifactDataParams = z.infer<typeof v4ConversationWorkflowRunArtifactDataParamsSchema>;
170
197
  export declare const v4ConversationWorkflowRunArtifactDataResultSchema: z.ZodObject<{
@@ -173,6 +200,7 @@ export declare const v4ConversationWorkflowRunArtifactDataResultSchema: z.ZodObj
173
200
  siteId: z.ZodString;
174
201
  ordinal: z.ZodNumber;
175
202
  item: z.ZodUnknown;
203
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
176
204
  }, z.core.$strict>>;
177
205
  hasMore: z.ZodBoolean;
178
206
  }, z.core.$strict>;
@@ -44,7 +44,50 @@ export const WORKFLOW_ARTIFACT_LIMITS = {
44
44
  maxItemsPerPage: 500,
45
45
  /** 一页的缺省条数(调用方不传 limit 时网关用它)。 */
46
46
  defaultItemsPerPage: 200,
47
+ /**
48
+ * `workflowRunArtifactData` 一页的字节上界(按存储里的序列化字节计),由网关传给存储层。
49
+ * 取协议单帧上限(16 MiB)的四分之一:条数上界单独管不住字节——500 条 × 32 KiB 就顶到了
50
+ * 单帧上限,于是一页可能根本发不出去。一页至少带一条,所以单条的上限(`REPORT_CAPS`)
51
+ * 必须远小于单帧上限。
52
+ */
53
+ maxPageBytes: PROTOCOL_V4_LIMITS.logicalFrameAssemblyMaxBytes / 4,
54
+ /** `workflowRunArtifactData` 一次最多点名几个字段路径(一张看板的 spec 用不到这么多)。 */
55
+ maxFieldsPerRequest: 32,
56
+ /** 一个字段路径的最大长度。 */
57
+ maxFieldPathLength: 256,
58
+ /**
59
+ * 一个字段值的序列化字节上界。超过的值回成一段截短的字符串(前 1,000 个字符加「…」):
60
+ * 图表只用数值,表格与看板的格子本来就只显示短文本。
61
+ */
62
+ maxFieldValueBytes: 4096,
47
63
  };
64
+ /**
65
+ * 按点路径从一条 report item 里取值:"timing.after"、"rounds.0.ms"(docs/execution-engine.md
66
+ * 「Reading the journal」)。
67
+ *
68
+ * 这是**协议上的契约**,不只是渲染器的工具函数:看板取数时 CLI 在 SQLite 里按同一套规则把
69
+ * 字段取出来(adapters 的 dwf-journal-fields.ts),渲染器拿到的值必须与它自己从整条 item 里
70
+ * 取出来的逐字相同。规则:按 `.` 切段;当前值是数组时,段按 `Number(段)` 当下标(非负整数且
71
+ * 在界内才算);是对象时按键取;走不通(null、标量、越界、缺键)得 `undefined`。
72
+ */
73
+ export function readWorkflowArtifactField(item, path) {
74
+ let cursor = item;
75
+ for (const segment of path.split(".")) {
76
+ if (cursor === null || cursor === undefined)
77
+ return undefined;
78
+ if (Array.isArray(cursor)) {
79
+ const index = Number(segment);
80
+ if (!Number.isInteger(index) || index < 0 || index >= cursor.length)
81
+ return undefined;
82
+ cursor = cursor[index];
83
+ continue;
84
+ }
85
+ if (typeof cursor !== "object")
86
+ return undefined;
87
+ cursor = cursor[segment];
88
+ }
89
+ return cursor;
90
+ }
48
91
  /**
49
92
  * 一个产物版本的**元数据**(journal `dwf_node.result_json` 上 `ArtifactVersionRecord` 的
50
93
  * zod 镜像)。字节不在这里——`uri` 指向 tool-artifact store,取字节走
@@ -110,7 +153,7 @@ export const workflowRunArtifactSchema = z
110
153
  * `workflowRunArtifactRead` 取字节)按需拉——权威始终在 journal。
111
154
  *
112
155
  * `itemCount` 在这里的职责是**刷新信号**:看板 hook 见它变化就带 `afterSequence` 增量取数。
113
- * 把标签 report 的原值放进快照会让 256 条 × 32KB 的最坏情形把状态帧撑到 2MB。
156
+ * 把标签 report 的原值放进这个高频状态键,一个 run 的条目有多少字节,每一帧就要搬多少字节。
114
157
  */
115
158
  export const workflowRunArtifactSummarySchema = z
116
159
  .object({
@@ -154,6 +197,18 @@ export const v4ConversationWorkflowRunArtifactDataParamsSchema = z
154
197
  afterSequence: z.number().int().nonnegative().optional(),
155
198
  /** 缺省 200、钳 [1, 500]——两者都在网关侧执行(存储层不得自造页大小,也不得再钳)。 */
156
199
  limit: z.number().int().positive().max(WORKFLOW_ARTIFACT_LIMITS.maxItemsPerPage).optional(),
200
+ /**
201
+ * 只取这些字段路径({@link readWorkflowArtifactField} 的规则),而不是整条 item:看板只读
202
+ * spec 里点名的字段,一条 1 MiB 的 item 不该为了一个数被整条搬进渲染器。给了它,结果每条
203
+ * 带 `fields` 而不带 `item`。缺省 = 整条 item(老渲染器的形状)。
204
+ *
205
+ * 偏斜:老 CLI 的 strict schema 不认这个键、整条请求被拒;渲染器据此退回不带它重试。
206
+ */
207
+ fields: z
208
+ .array(z.string().min(1).max(WORKFLOW_ARTIFACT_LIMITS.maxFieldPathLength))
209
+ .min(1)
210
+ .max(WORKFLOW_ARTIFACT_LIMITS.maxFieldsPerRequest)
211
+ .optional(),
157
212
  })
158
213
  .strict();
159
214
  export const v4ConversationWorkflowRunArtifactDataResultSchema = z
@@ -168,13 +223,18 @@ export const v4ConversationWorkflowRunArtifactDataResultSchema = z
168
223
  /**
169
224
  * 条目原值,**不做预览序列化**:看板的纯函数要按字段路径取数
170
225
  * (`ChartSpec.x.field` 形如 "timing.after"),拿到一段 pretty JSON 文本就没法取了。
171
- * 单条在线上已由 `REPORT_CAPS.maxItemSerializedBytes`(32KB)与事件载荷有界化
172
- * 双重保证,这里不再叠一层界。
226
+ * 单条由写入侧的 `REPORT_CAPS.maxItemSerializedBytes` 有界,一页由
227
+ * `WORKFLOW_ARTIFACT_LIMITS.maxPageBytes` 有界。请求带 `fields` 时缺席。
173
228
  */
174
229
  item: z.unknown(),
230
+ /**
231
+ * 请求带 `fields` 时:路径 → 值。走不通的路径不在表里(= `undefined`);超过
232
+ * `maxFieldValueBytes` 的值是一段截短的字符串。
233
+ */
234
+ fields: z.record(z.string(), z.unknown()).optional(),
175
235
  })
176
236
  .strict()),
177
- /** 本页取满 limit 且后面仍有条目(网关多取一条判定)。 */
237
+ /** 本页之后仍有条目(页可能因条数或字节上界提前收尾;由存储层判定)。 */
178
238
  hasMore: z.boolean(),
179
239
  })
180
240
  .strict();
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ export declare const savedWorkflowStartRejectionReasonSchema: z.ZodEnum<{
3
+ not_found: "not_found";
4
+ invalid_name: "invalid_name";
5
+ compile_failed: "compile_failed";
6
+ start_failed: "start_failed";
7
+ invalid_args: "invalid_args";
8
+ session_busy: "session_busy";
9
+ }>;
10
+ export type SavedWorkflowStartRejectionReason = z.infer<typeof savedWorkflowStartRejectionReasonSchema>;
11
+ export declare const SAVED_WORKFLOW_START_REJECTED_FAULT_PREFIX: "fault.command.savedWorkflowStartRejected.";
12
+ export declare const WORKFLOW_RUN_RESUME_REJECTED_FAULT_PREFIX: "fault.command.workflowRunResumeRejected.";
13
+ //# sourceMappingURL=workflow-command-rejections.d.ts.map
@@ -0,0 +1,23 @@
1
+ // 动态工作流命令的拒绝词表与 fault 前缀:从 command.ts 拆出(该文件在 max-lines 上限),
2
+ // 由 command.ts 再导出,既有导入路径不变。
3
+ import { z } from "zod";
4
+ // startSavedWorkflow 拒绝词表(docs/dynamic-workflow/launch.md「On the agent」):
5
+ // bootstrap handler 铸造 fault code,ui launcher 反查 i18n 文案,两侧共享此枚举避免漂移。
6
+ // invalid_name / not_found:解析阶段;invalid_args:实参校验;compile_failed:analyzeScript 诊断;
7
+ // session_busy:会话有活动 turn;start_failed:port.submit 之前的其它启动失败。
8
+ export const savedWorkflowStartRejectionReasonSchema = z.enum([
9
+ "invalid_name",
10
+ "not_found",
11
+ "invalid_args",
12
+ "compile_failed",
13
+ "session_busy",
14
+ "start_failed",
15
+ ]);
16
+ // 完整 fault code = 前缀 + reason(如 fault.command.savedWorkflowStartRejected.not_found)。
17
+ // 与 workflowRunResumeRejected 命名空间同族;导出常量供 bootstrap 拼接、ui 前缀匹配。
18
+ export const SAVED_WORKFLOW_START_REJECTED_FAULT_PREFIX = "fault.command.savedWorkflowStartRejected.";
19
+ // resumeWorkflowRun 的拒绝:前缀 + 端口 reason(not_found / not_resumable / superseded /
20
+ // already_running / script_missing / script_mismatch / compile_failed);`ack.message` 携带
21
+ // compile_failed 的有界诊断(docs/dynamic-workflow/presentation.md「The run pane」)。
22
+ export const WORKFLOW_RUN_RESUME_REJECTED_FAULT_PREFIX = "fault.command.workflowRunResumeRejected.";
23
+ //# sourceMappingURL=workflow-command-rejections.js.map
@@ -7,17 +7,17 @@ export declare const toolCallGetWorkflowRunDisplaySchema: z.ZodObject<{
7
7
  runId: z.ZodString;
8
8
  label: z.ZodString;
9
9
  status: z.ZodEnum<{
10
- pending: "pending";
11
10
  running: "running";
12
11
  completed: "completed";
13
- stopped: "stopped";
12
+ pending: "pending";
14
13
  errored: "errored";
14
+ stopped: "stopped";
15
15
  }>;
16
16
  stopReason: z.ZodOptional<z.ZodEnum<{
17
- interrupted: "interrupted";
18
- user: "user";
19
- model: "model";
20
17
  provider: "provider";
18
+ model: "model";
19
+ user: "user";
20
+ interrupted: "interrupted";
21
21
  superseded: "superseded";
22
22
  }>>;
23
23
  possiblyInterrupted: z.ZodOptional<z.ZodBoolean>;
@@ -50,11 +50,11 @@ export declare const toolCallGetWorkflowRunDisplaySchema: z.ZodObject<{
50
50
  name: z.ZodOptional<z.ZodString>;
51
51
  state: z.ZodEnum<{
52
52
  failed: "failed";
53
- done: "done";
54
- unfinished: "unfinished";
55
53
  idle: "idle";
56
- executing: "executing";
57
54
  waiting: "waiting";
55
+ executing: "executing";
56
+ done: "done";
57
+ unfinished: "unfinished";
58
58
  parked: "parked";
59
59
  }>;
60
60
  phaseName: z.ZodOptional<z.ZodString>;
@@ -117,21 +117,21 @@ export declare const toolCallListWorkflowRunsDisplaySchema: z.ZodObject<{
117
117
  runId: z.ZodString;
118
118
  label: z.ZodString;
119
119
  labelSource: z.ZodEnum<{
120
- script: "script";
121
120
  name: "name";
121
+ script: "script";
122
122
  }>;
123
123
  status: z.ZodEnum<{
124
- pending: "pending";
125
124
  running: "running";
126
125
  completed: "completed";
127
- stopped: "stopped";
126
+ pending: "pending";
128
127
  errored: "errored";
128
+ stopped: "stopped";
129
129
  }>;
130
130
  stopReason: z.ZodOptional<z.ZodEnum<{
131
- interrupted: "interrupted";
132
- user: "user";
133
- model: "model";
134
131
  provider: "provider";
132
+ model: "model";
133
+ user: "user";
134
+ interrupted: "interrupted";
135
135
  superseded: "superseded";
136
136
  }>>;
137
137
  ownedByThisSession: z.ZodBoolean;
@@ -3,14 +3,14 @@ export declare const workflowNotificationMetaSchema: z.ZodDiscriminatedUnion<[z.
3
3
  kind: z.ZodLiteral<"terminal">;
4
4
  status: z.ZodEnum<{
5
5
  completed: "completed";
6
- stopped: "stopped";
7
6
  errored: "errored";
7
+ stopped: "stopped";
8
8
  }>;
9
9
  stopReason: z.ZodOptional<z.ZodEnum<{
10
- interrupted: "interrupted";
11
- user: "user";
12
- model: "model";
13
10
  provider: "provider";
11
+ model: "model";
12
+ user: "user";
13
+ interrupted: "interrupted";
14
14
  superseded: "superseded";
15
15
  }>>;
16
16
  summary: z.ZodString;
@@ -51,6 +51,18 @@ export declare const workflowNotificationMetaSchema: z.ZodDiscriminatedUnion<[z.
51
51
  question: z.ZodString;
52
52
  context: z.ZodOptional<z.ZodString>;
53
53
  askedAt: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strip>, z.ZodObject<{
55
+ kind: z.ZodLiteral<"hole">;
56
+ siteId: z.ZodString;
57
+ ordinal: z.ZodNumber;
58
+ name: z.ZodString;
59
+ type: z.ZodString;
60
+ prompt: z.ZodOptional<z.ZodString>;
61
+ draftPath: z.ZodOptional<z.ZodString>;
62
+ line: z.ZodOptional<z.ZodNumber>;
63
+ before: z.ZodOptional<z.ZodString>;
64
+ after: z.ZodOptional<z.ZodString>;
65
+ reachedAt: z.ZodOptional<z.ZodNumber>;
54
66
  }, z.core.$strip>, z.ZodObject<{
55
67
  kind: z.ZodLiteral<"stall">;
56
68
  sinceMs: z.ZodNumber;
@@ -70,14 +82,14 @@ export declare const backgroundResultOriginMetaSchema: z.ZodObject<{
70
82
  kind: z.ZodLiteral<"terminal">;
71
83
  status: z.ZodEnum<{
72
84
  completed: "completed";
73
- stopped: "stopped";
74
85
  errored: "errored";
86
+ stopped: "stopped";
75
87
  }>;
76
88
  stopReason: z.ZodOptional<z.ZodEnum<{
77
- interrupted: "interrupted";
78
- user: "user";
79
- model: "model";
80
89
  provider: "provider";
90
+ model: "model";
91
+ user: "user";
92
+ interrupted: "interrupted";
81
93
  superseded: "superseded";
82
94
  }>>;
83
95
  summary: z.ZodString;
@@ -118,6 +130,18 @@ export declare const backgroundResultOriginMetaSchema: z.ZodObject<{
118
130
  question: z.ZodString;
119
131
  context: z.ZodOptional<z.ZodString>;
120
132
  askedAt: z.ZodOptional<z.ZodNumber>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ kind: z.ZodLiteral<"hole">;
135
+ siteId: z.ZodString;
136
+ ordinal: z.ZodNumber;
137
+ name: z.ZodString;
138
+ type: z.ZodString;
139
+ prompt: z.ZodOptional<z.ZodString>;
140
+ draftPath: z.ZodOptional<z.ZodString>;
141
+ line: z.ZodOptional<z.ZodNumber>;
142
+ before: z.ZodOptional<z.ZodString>;
143
+ after: z.ZodOptional<z.ZodString>;
144
+ reachedAt: z.ZodOptional<z.ZodNumber>;
121
145
  }, z.core.$strip>, z.ZodObject<{
122
146
  kind: z.ZodLiteral<"stall">;
123
147
  sinceMs: z.ZodNumber;
@@ -166,6 +190,7 @@ export declare const workflowLaunchMetaSchema: z.ZodObject<{
166
190
  kind: z.ZodEnum<{
167
191
  ask: "ask";
168
192
  "world-read": "world-read";
193
+ hole: "hole";
169
194
  }>;
170
195
  label: z.ZodString;
171
196
  labelPattern: z.ZodOptional<z.ZodObject<{
@@ -182,6 +207,7 @@ export declare const workflowLaunchMetaSchema: z.ZodObject<{
182
207
  stack: "stack";
183
208
  serial: "serial";
184
209
  }>>;
210
+ fill: z.ZodOptional<z.ZodString>;
185
211
  }, z.core.$strict>>;
186
212
  lanes: z.ZodArray<z.ZodObject<{
187
213
  id: z.ZodString;
@@ -216,17 +242,35 @@ export declare const workflowLaunchMetaSchema: z.ZodObject<{
216
242
  line: z.ZodOptional<z.ZodNumber>;
217
243
  column: z.ZodOptional<z.ZodNumber>;
218
244
  alongside: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ fill: z.ZodOptional<z.ZodString>;
219
246
  }, z.core.$strict>>>;
220
247
  phaseEdges: z.ZodOptional<z.ZodArray<z.ZodObject<{
221
248
  from: z.ZodString;
222
249
  to: z.ZodString;
223
250
  back: z.ZodOptional<z.ZodLiteral<true>>;
224
251
  }, z.core.$strict>>>;
252
+ phaseStreams: z.ZodOptional<z.ZodArray<z.ZodObject<{
253
+ from: z.ZodString;
254
+ to: z.ZodString;
255
+ }, z.core.$strict>>>;
256
+ holes: z.ZodOptional<z.ZodArray<z.ZodObject<{
257
+ siteId: z.ZodString;
258
+ name: z.ZodString;
259
+ type: z.ZodString;
260
+ phase: z.ZodOptional<z.ZodString>;
261
+ tail: z.ZodOptional<z.ZodBoolean>;
262
+ }, z.core.$strict>>>;
225
263
  exits: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
264
  sink: z.ZodOptional<z.ZodArray<z.ZodString>>;
227
265
  truncated: z.ZodOptional<z.ZodBoolean>;
228
266
  }, z.core.$strict>>;
229
267
  truncated: z.ZodOptional<z.ZodBoolean>;
268
+ fill: z.ZodOptional<z.ZodObject<{
269
+ siteId: z.ZodString;
270
+ name: z.ZodString;
271
+ draftPath: z.ZodOptional<z.ZodString>;
272
+ line: z.ZodOptional<z.ZodNumber>;
273
+ }, z.core.$strict>>;
230
274
  }, z.core.$strict>>>;
231
275
  script: z.ZodOptional<z.ZodString>;
232
276
  amend: z.ZodOptional<z.ZodObject<{
@@ -60,6 +60,23 @@ export const workflowNotificationMetaSchema = z.discriminatedUnion("kind", [
60
60
  context: z.string().max(4000).optional(),
61
61
  askedAt: z.number().optional(),
62
62
  }),
63
+ // 留白(docs/dynamic-workflow/transcript-and-notifications.md「The payload」的 `hole` 种类):run 走到一个
64
+ // 开着的 `hole<T>()`,那条分支停驻、主代理欠一段代码。`type` 是作者写的类型原文(`Plan`);`before` /
65
+ // `after` 是留白两侧的阶段名;`draftPath` / `line` 指向草稿文件里留白所在的那一行。prompt 与升级问题
66
+ // 同一条 4000 上界,发射侧先截。与契约同名(apps/dcode-cli contracts 侧手工镜像)。
67
+ z.object({
68
+ kind: z.literal("hole"),
69
+ siteId: z.string().min(1).max(64),
70
+ ordinal: z.number().int().nonnegative(),
71
+ name: z.string().min(1).max(128),
72
+ type: z.string().min(1).max(128),
73
+ prompt: z.string().max(4000).optional(),
74
+ draftPath: z.string().max(1024).optional(),
75
+ line: z.number().int().positive().optional(),
76
+ before: z.string().max(128).optional(),
77
+ after: z.string().max(128).optional(),
78
+ reachedAt: z.number().optional(),
79
+ }),
63
80
  // run 级停滞:每个 stall 段一条,不是终态。
64
81
  z.object({
65
82
  kind: z.literal("stall"),
@@ -93,12 +110,14 @@ const workflowSubagentModelTextSchema = z
93
110
  // 设置轮:用户在 run 卡 / 详情页的「配置」里
94
111
  // 改了设置,agent 以同一份脚本修订出新 run,并用一条与直接启动同形的 controlOnly 轮记下这件事。
95
112
  // 这一块说**改了什么**:只有改动过的设置在场;每一项的 from / to 缺一端即那一端是默认
96
- // (模型 = 会话模型,上限 = 本机上限)。`ceiling` 是本机上限,供「13 → 4」这种读法。
113
+ // (模型 = 会话模型,上限 = 默认并发)。`ceiling` 是默认并发 D(键名早于「默认并发」,为兼容旧端保留),
114
+ // 供「默认 13 → 4」这种读法。
97
115
  export const workflowSettingsAmendMetaSchema = z.object({
98
- // 修订自哪个 run。**缺席 = 就地生效**:只改并发上限、run
116
+ // 修订自哪个 run。**缺席 = 就地生效**(docs/dynamic-workflow/concurrency.md):只改并发上限、run
99
117
  // 又在飞时,那次「配置」不停这次 run、也不另起一次,于是没有前驱可指——`runId` 指的就是被调整的
100
118
  // 那一个。渲染端据此只出那一行、不再出卡(同一条 run 画两张卡会读成两次运行)。
101
- // 此字段为可选;生产者和消费者需使用一致的 schema 才能解析就地调整的设置记录。
119
+ // 记录在案的偏斜(与下方 scope / path 同一档):旧桌面上它是必填,就地生效的设置轮在那里 parse
120
+ // 失败、整行被丢——丢的是一行记录,run 卡与运行本身不受影响。
102
121
  predecessorRunId: z.string().min(1).max(128).optional(),
103
122
  subagentModel: z
104
123
  .object({
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  /**
3
- * 命令载荷。两项设置守工具的同一条三态规则:省略 = 沿用,`null` = 回到默认(会话模型 / 本机上限),
3
+ * 命令载荷。两项设置守工具的同一条三态规则:省略 = 沿用,`null` = 回到默认(会话模型 / 默认并发),
4
4
  * 值 = 设定。GUI 只发用户改过的那几项。刻意不携 baseRevision:与 cancelBackgroundWork /
5
5
  * resumeWorkflowRun 同类(workflowRuns 面免 revision)。
6
6
  */
@@ -26,12 +26,12 @@ export declare const amendWorkflowRunSettingsResultSchema: z.ZodObject<{
26
26
  * 是命令自己的检查,missing_boundaries 是端口预检,start_failed 是端口缺席或抛错。
27
27
  */
28
28
  export declare const workflowRunSettingsRejectionReasonSchema: z.ZodEnum<{
29
- unchanged: "unchanged";
30
29
  not_found: "not_found";
31
- not_configurable: "not_configurable";
30
+ unchanged: "unchanged";
32
31
  script_missing: "script_missing";
33
- model_unavailable: "model_unavailable";
34
32
  compile_failed: "compile_failed";
33
+ not_configurable: "not_configurable";
34
+ model_unavailable: "model_unavailable";
35
35
  missing_boundaries: "missing_boundaries";
36
36
  start_failed: "start_failed";
37
37
  }>;
@@ -6,7 +6,7 @@
6
6
  import { z } from "zod";
7
7
  import { WORKFLOW_RUNS_LIMITS } from "./workflow-runs.js";
8
8
  /**
9
- * 命令载荷。两项设置守工具的同一条三态规则:省略 = 沿用,`null` = 回到默认(会话模型 / 本机上限),
9
+ * 命令载荷。两项设置守工具的同一条三态规则:省略 = 沿用,`null` = 回到默认(会话模型 / 默认并发),
10
10
  * 值 = 设定。GUI 只发用户改过的那几项。刻意不携 baseRevision:与 cancelBackgroundWork /
11
11
  * resumeWorkflowRun 同类(workflowRuns 面免 revision)。
12
12
  */
@@ -20,7 +20,7 @@ export const amendWorkflowRunSettingsPayloadSchema = z.object({
20
20
  .max(WORKFLOW_RUNS_LIMITS.maxSubagentModelLength)
21
21
  .nullable()
22
22
  .optional(),
23
- /** 同时运行的子代理上限;`null` = 解除本 run 自己的界(回到本机上限)。agent 侧钳到 `[1, 天花板]`。 */
23
+ /** 同时运行的子代理上限;`null` = 解除本 run 自己的界(回到默认并发)。没有上限:高于默认也行。 */
24
24
  maxConcurrency: z.number().int().min(1).nullable().optional(),
25
25
  });
26
26
  /**
@@ -0,0 +1,21 @@
1
+ import type { WorkflowRunActor } from "./workflow-runs.js";
2
+ interface ActorRef {
3
+ siteId: string;
4
+ ordinal: number;
5
+ }
6
+ /**
7
+ * 一条节点事件之后,它点名的子代理的 actor 表(没变即原引用)。
8
+ *
9
+ * 只有两种 ask 事件说「这个子代理的转录在哪条会话里」:
10
+ * - **缓存命中的结算**:载荷带 `sourceSessionId` 即答案读自前驱的那条会话(导入命中,或修订
11
+ * run resume 时对一条导入行的重放);不带即答案在本 run 里产生过,信封上的 `actorSessionId`
12
+ * (本 run 的会话)就是它;
13
+ * - **派发**:子代理开始 live 跑,本 run 的会话此刻已经建好——导入过前缀的已经播了种。
14
+ *
15
+ * 最后一条说了算。同一个子代理的 ask 按序结算,而导入分歧是单调的:导入命中在前、指向前驱的
16
+ * 会话;从第一次 live 派发起,本 run 的会话持有全部,抄进来的前缀也在里面。其余事件、没有
17
+ * actor ref 的事件(world-read)、两个 id 都读不出的老载荷、以及不在表上的子代理:一律不动。
18
+ */
19
+ export declare function actorsWithTranscriptSession(actors: WorkflowRunActor[], eventType: string, payload: Record<string, unknown>, actorRef: ActorRef | null, envelopeSessionId: string | undefined): WorkflowRunActor[];
20
+ export {};
21
+ //# sourceMappingURL=workflow-runs-actor-session.d.ts.map