@bastani/atomic 0.9.2 → 0.9.3-alpha.2

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 (606) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +2 -2
  3. package/dist/builtin/cursor/CHANGELOG.md +15 -0
  4. package/dist/builtin/cursor/README.md +2 -1
  5. package/dist/builtin/cursor/package.json +2 -2
  6. package/dist/builtin/cursor/src/cursor-models-raw.json +2 -9
  7. package/dist/builtin/cursor/src/model-mapper.ts +14 -3
  8. package/dist/builtin/cursor/src/proto/protobuf-codec-base64.ts +22 -0
  9. package/dist/builtin/cursor/src/proto/protobuf-codec-request.ts +53 -13
  10. package/dist/builtin/cursor/src/proto/protobuf-codec-wire.ts +24 -7
  11. package/dist/builtin/cursor/src/proto/protobuf-codec.ts +3 -2
  12. package/dist/builtin/cursor/src/stream.ts +5 -11
  13. package/dist/builtin/cursor/src/transport-types.ts +3 -0
  14. package/dist/builtin/cursor/src/transport.ts +1 -0
  15. package/dist/builtin/intercom/package.json +1 -1
  16. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  17. package/dist/builtin/mcp/direct-tools.ts +4 -2
  18. package/dist/builtin/mcp/package.json +1 -1
  19. package/dist/builtin/mcp/proxy-call.ts +3 -1
  20. package/dist/builtin/mcp/utils.ts +18 -7
  21. package/dist/builtin/subagents/CHANGELOG.md +20 -0
  22. package/dist/builtin/subagents/README.md +6 -6
  23. package/dist/builtin/subagents/agents/code-simplifier.md +7 -6
  24. package/dist/builtin/subagents/agents/codebase-analyzer.md +5 -4
  25. package/dist/builtin/subagents/agents/codebase-locator.md +3 -3
  26. package/dist/builtin/subagents/agents/codebase-online-researcher.md +10 -10
  27. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +4 -4
  28. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +3 -3
  29. package/dist/builtin/subagents/agents/codebase-research-locator.md +4 -4
  30. package/dist/builtin/subagents/agents/debugger.md +5 -5
  31. package/dist/builtin/subagents/agents/worker.md +56 -0
  32. package/dist/builtin/subagents/package.json +1 -1
  33. package/dist/builtin/subagents/skills/subagent/SKILL.md +11 -11
  34. package/dist/builtin/subagents/src/agents/agent-loaders.ts +3 -5
  35. package/dist/builtin/subagents/src/agents/agent-management-helpers.ts +3 -3
  36. package/dist/builtin/subagents/src/extension/fanout-child.ts +1 -0
  37. package/dist/builtin/subagents/src/extension/index.ts +6 -3
  38. package/dist/builtin/subagents/src/extension/schemas.ts +2 -7
  39. package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -3
  40. package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +1 -4
  41. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +15 -1
  42. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +35 -1
  43. package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -1
  44. package/dist/builtin/subagents/src/runs/shared/nested-render.ts +2 -2
  45. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +2 -1
  46. package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +4 -2
  47. package/dist/builtin/subagents/src/shared/types-async.ts +1 -0
  48. package/dist/builtin/subagents/src/shared/types-depth.ts +5 -5
  49. package/dist/builtin/subagents/src/shared/types-runtime.ts +2 -1
  50. package/dist/builtin/subagents/src/slash/prompt-template-bridge.ts +27 -5
  51. package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -2
  52. package/dist/builtin/subagents/src/tui/render-layout.ts +27 -4
  53. package/dist/builtin/subagents/src/tui/render-result-animation.ts +22 -31
  54. package/dist/builtin/subagents/src/tui/render-result-compact.ts +6 -6
  55. package/dist/builtin/subagents/src/tui/render-result.ts +20 -19
  56. package/dist/builtin/subagents/src/tui/render-status-progress.ts +3 -3
  57. package/dist/builtin/subagents/src/tui/render-widget.ts +46 -7
  58. package/dist/builtin/subagents/src/tui/render.ts +2 -2
  59. package/dist/builtin/web-access/package.json +1 -1
  60. package/dist/builtin/workflows/CHANGELOG.md +56 -0
  61. package/dist/builtin/workflows/README.md +3 -3
  62. package/dist/builtin/workflows/builtin/goal-artifacts.ts +11 -6
  63. package/dist/builtin/workflows/builtin/goal-ledger.ts +33 -1
  64. package/dist/builtin/workflows/builtin/goal-prompts.ts +23 -28
  65. package/dist/builtin/workflows/builtin/goal-reducer.ts +2 -2
  66. package/dist/builtin/workflows/builtin/goal-reports.ts +2 -5
  67. package/dist/builtin/workflows/builtin/goal-review.ts +1 -1
  68. package/dist/builtin/workflows/builtin/goal-runner.ts +10 -17
  69. package/dist/builtin/workflows/builtin/open-claude-design-feedback.ts +3 -3
  70. package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +1 -3
  71. package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +1 -1
  72. package/dist/builtin/workflows/builtin/ralph-core.ts +7 -17
  73. package/dist/builtin/workflows/builtin/ralph-runner.ts +11 -18
  74. package/dist/builtin/workflows/builtin/shared-prompts.ts +1 -1
  75. package/dist/builtin/workflows/package.json +1 -1
  76. package/dist/builtin/workflows/src/authoring.d.ts +1 -1
  77. package/dist/builtin/workflows/src/durable/backend.ts +343 -0
  78. package/dist/builtin/workflows/src/durable/child-primitive.ts +79 -0
  79. package/dist/builtin/workflows/src/durable/dbos-backend.ts +421 -0
  80. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +171 -0
  81. package/dist/builtin/workflows/src/durable/factory.ts +96 -0
  82. package/dist/builtin/workflows/src/durable/file-backend.ts +433 -0
  83. package/dist/builtin/workflows/src/durable/index.ts +73 -0
  84. package/dist/builtin/workflows/src/durable/resume-catalog.ts +217 -0
  85. package/dist/builtin/workflows/src/durable/resume-runtime.ts +299 -0
  86. package/dist/builtin/workflows/src/durable/scoped-backend.ts +171 -0
  87. package/dist/builtin/workflows/src/durable/stage-primitive.ts +284 -0
  88. package/dist/builtin/workflows/src/durable/tool-primitive.ts +180 -0
  89. package/dist/builtin/workflows/src/durable/types.ts +168 -0
  90. package/dist/builtin/workflows/src/durable/ui-primitive.ts +96 -0
  91. package/dist/builtin/workflows/src/engine/options.ts +3 -0
  92. package/dist/builtin/workflows/src/engine/primitives/parallel.ts +2 -2
  93. package/dist/builtin/workflows/src/engine/primitives/task.ts +4 -4
  94. package/dist/builtin/workflows/src/engine/primitives/ui.ts +22 -8
  95. package/dist/builtin/workflows/src/engine/primitives/workflow.ts +8 -0
  96. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +69 -0
  97. package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +31 -0
  98. package/dist/builtin/workflows/src/engine/run.ts +148 -6
  99. package/dist/builtin/workflows/src/engine/runtime.ts +8 -2
  100. package/dist/builtin/workflows/src/extension/config-loader.ts +35 -15
  101. package/dist/builtin/workflows/src/extension/discovery.ts +20 -8
  102. package/dist/builtin/workflows/src/extension/extension-factory.ts +6 -12
  103. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +5 -1
  104. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +4 -2
  105. package/dist/builtin/workflows/src/extension/runtime.ts +48 -9
  106. package/dist/builtin/workflows/src/extension/wiring.ts +1 -1
  107. package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +143 -4
  108. package/dist/builtin/workflows/src/runs/background/quit.ts +61 -0
  109. package/dist/builtin/workflows/src/runs/background/status.ts +1 -0
  110. package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +5 -5
  111. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +74 -33
  112. package/dist/builtin/workflows/src/runs/foreground/executor-stage-context.ts +20 -1
  113. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +8 -7
  114. package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +1 -0
  115. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +1 -1
  116. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +19 -2
  117. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +4 -0
  118. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +10 -10
  119. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +5 -1
  120. package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +25 -0
  121. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +3 -0
  122. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +16 -0
  123. package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +20 -0
  124. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +23 -1
  125. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +30 -1
  126. package/dist/builtin/workflows/src/shared/store-public-types.ts +6 -2
  127. package/dist/builtin/workflows/src/shared/store-run-methods.ts +12 -6
  128. package/dist/builtin/workflows/src/shared/types.ts +55 -0
  129. package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +11 -10
  130. package/dist/builtin/workflows/src/tui/graph-view-constants.ts +1 -1
  131. package/dist/builtin/workflows/src/tui/graph-view-graph-render.ts +41 -0
  132. package/dist/builtin/workflows/src/tui/graph-view-input.ts +82 -24
  133. package/dist/builtin/workflows/src/tui/graph-view-render.ts +7 -0
  134. package/dist/builtin/workflows/src/tui/graph-view-state.ts +22 -2
  135. package/dist/builtin/workflows/src/tui/graph-view-types.ts +4 -5
  136. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +9 -11
  137. package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +9 -3
  138. package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +11 -2
  139. package/dist/builtin/workflows/src/tui/stage-chat-view-live-events.ts +35 -0
  140. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +51 -17
  141. package/dist/builtin/workflows/src/tui/stage-chat-view-status.ts +36 -0
  142. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +5 -1
  143. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +3 -1
  144. package/dist/builtin/workflows/src/tui/status-list.ts +14 -2
  145. package/dist/builtin/workflows/src/tui/widget.ts +23 -8
  146. package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +5 -4
  147. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +8 -8
  148. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +151 -0
  149. package/dist/cli/args.d.ts.map +1 -1
  150. package/dist/cli/args.js +9 -9
  151. package/dist/cli/args.js.map +1 -1
  152. package/dist/config-self-update.d.ts.map +1 -1
  153. package/dist/config-self-update.js +3 -4
  154. package/dist/config-self-update.js.map +1 -1
  155. package/dist/config.d.ts.map +1 -1
  156. package/dist/config.js +4 -5
  157. package/dist/config.js.map +1 -1
  158. package/dist/core/agent-session-bash.d.ts +1 -0
  159. package/dist/core/agent-session-bash.d.ts.map +1 -1
  160. package/dist/core/agent-session-bash.js +1 -0
  161. package/dist/core/agent-session-bash.js.map +1 -1
  162. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  163. package/dist/core/agent-session-tool-registry.js +23 -0
  164. package/dist/core/agent-session-tool-registry.js.map +1 -1
  165. package/dist/core/bash-executor.d.ts +2 -0
  166. package/dist/core/bash-executor.d.ts.map +1 -1
  167. package/dist/core/bash-executor.js +1 -0
  168. package/dist/core/bash-executor.js.map +1 -1
  169. package/dist/core/compaction/compaction.d.ts +29 -0
  170. package/dist/core/compaction/compaction.d.ts.map +1 -1
  171. package/dist/core/compaction/compaction.js +36 -1
  172. package/dist/core/compaction/compaction.js.map +1 -1
  173. package/dist/core/compaction/context-compaction-metrics.d.ts +14 -2
  174. package/dist/core/compaction/context-compaction-metrics.d.ts.map +1 -1
  175. package/dist/core/compaction/context-compaction-metrics.js +50 -1
  176. package/dist/core/compaction/context-compaction-metrics.js.map +1 -1
  177. package/dist/core/compaction/context-compaction-prompt.d.ts.map +1 -1
  178. package/dist/core/compaction/context-compaction-prompt.js +2 -0
  179. package/dist/core/compaction/context-compaction-prompt.js.map +1 -1
  180. package/dist/core/compaction/context-compaction-runner.d.ts.map +1 -1
  181. package/dist/core/compaction/context-compaction-runner.js +1 -1
  182. package/dist/core/compaction/context-compaction-runner.js.map +1 -1
  183. package/dist/core/compaction/context-deletion-application.d.ts.map +1 -1
  184. package/dist/core/compaction/context-deletion-application.js +5 -5
  185. package/dist/core/compaction/context-deletion-application.js.map +1 -1
  186. package/dist/core/compaction/context-deletion-targets.d.ts +2 -0
  187. package/dist/core/compaction/context-deletion-targets.d.ts.map +1 -1
  188. package/dist/core/compaction/context-deletion-targets.js +23 -3
  189. package/dist/core/compaction/context-deletion-targets.js.map +1 -1
  190. package/dist/core/compaction/context-deletion-tool-definitions.d.ts +6 -0
  191. package/dist/core/compaction/context-deletion-tool-definitions.d.ts.map +1 -1
  192. package/dist/core/compaction/context-deletion-tool-definitions.js.map +1 -1
  193. package/dist/core/compaction/context-deletion-tools.d.ts.map +1 -1
  194. package/dist/core/compaction/context-deletion-tools.js +18 -10
  195. package/dist/core/compaction/context-deletion-tools.js.map +1 -1
  196. package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
  197. package/dist/core/compaction/context-transcript-analysis.js +2 -4
  198. package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
  199. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +1 -1
  200. package/dist/core/copilot-gemini-tool-arguments.js +2 -60
  201. package/dist/core/copilot-gemini-tool-arguments.js.map +1 -1
  202. package/dist/core/extensions/context-types.d.ts +2 -0
  203. package/dist/core/extensions/context-types.d.ts.map +1 -1
  204. package/dist/core/extensions/context-types.js.map +1 -1
  205. package/dist/core/extensions/index.d.ts +2 -2
  206. package/dist/core/extensions/index.d.ts.map +1 -1
  207. package/dist/core/extensions/index.js +1 -1
  208. package/dist/core/extensions/index.js.map +1 -1
  209. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  210. package/dist/core/extensions/loader-virtual-modules.js +57 -32
  211. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  212. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  213. package/dist/core/extensions/runner-context.js +11 -0
  214. package/dist/core/extensions/runner-context.js.map +1 -1
  215. package/dist/core/extensions/tool-events.d.ts +13 -13
  216. package/dist/core/extensions/tool-events.d.ts.map +1 -1
  217. package/dist/core/extensions/tool-events.js +3 -3
  218. package/dist/core/extensions/tool-events.js.map +1 -1
  219. package/dist/core/extensions/types.d.ts +1 -1
  220. package/dist/core/extensions/types.d.ts.map +1 -1
  221. package/dist/core/extensions/types.js +1 -1
  222. package/dist/core/extensions/types.js.map +1 -1
  223. package/dist/core/flattened-tool-arguments.d.ts +18 -0
  224. package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
  225. package/dist/core/flattened-tool-arguments.js +104 -0
  226. package/dist/core/flattened-tool-arguments.js.map +1 -1
  227. package/dist/core/messages.d.ts +1 -0
  228. package/dist/core/messages.d.ts.map +1 -1
  229. package/dist/core/messages.js +46 -1
  230. package/dist/core/messages.js.map +1 -1
  231. package/dist/core/sdk-exports.d.ts +1 -1
  232. package/dist/core/sdk-exports.d.ts.map +1 -1
  233. package/dist/core/sdk-exports.js +1 -1
  234. package/dist/core/sdk-exports.js.map +1 -1
  235. package/dist/core/sdk-types.d.ts +2 -2
  236. package/dist/core/sdk-types.d.ts.map +1 -1
  237. package/dist/core/sdk-types.js.map +1 -1
  238. package/dist/core/sdk.d.ts.map +1 -1
  239. package/dist/core/sdk.js +12 -0
  240. package/dist/core/sdk.js.map +1 -1
  241. package/dist/core/session-manager-core.d.ts +15 -7
  242. package/dist/core/session-manager-core.d.ts.map +1 -1
  243. package/dist/core/session-manager-core.js +20 -9
  244. package/dist/core/session-manager-core.js.map +1 -1
  245. package/dist/core/session-manager-entries.d.ts +2 -2
  246. package/dist/core/session-manager-entries.d.ts.map +1 -1
  247. package/dist/core/session-manager-entries.js +9 -3
  248. package/dist/core/session-manager-entries.js.map +1 -1
  249. package/dist/core/session-manager-history.d.ts.map +1 -1
  250. package/dist/core/session-manager-history.js +2 -1
  251. package/dist/core/session-manager-history.js.map +1 -1
  252. package/dist/core/session-manager-list.d.ts +3 -3
  253. package/dist/core/session-manager-list.d.ts.map +1 -1
  254. package/dist/core/session-manager-list.js +27 -8
  255. package/dist/core/session-manager-list.js.map +1 -1
  256. package/dist/core/session-manager-storage.d.ts +3 -1
  257. package/dist/core/session-manager-storage.d.ts.map +1 -1
  258. package/dist/core/session-manager-storage.js +55 -12
  259. package/dist/core/session-manager-storage.js.map +1 -1
  260. package/dist/core/session-manager-tool-dependencies.d.ts +10 -0
  261. package/dist/core/session-manager-tool-dependencies.d.ts.map +1 -0
  262. package/dist/core/session-manager-tool-dependencies.js +133 -0
  263. package/dist/core/session-manager-tool-dependencies.js.map +1 -0
  264. package/dist/core/session-manager-types.d.ts +22 -0
  265. package/dist/core/session-manager-types.d.ts.map +1 -1
  266. package/dist/core/session-manager-types.js.map +1 -1
  267. package/dist/core/session-manager.d.ts +2 -2
  268. package/dist/core/session-manager.d.ts.map +1 -1
  269. package/dist/core/session-manager.js +1 -1
  270. package/dist/core/session-manager.js.map +1 -1
  271. package/dist/core/settings-manager-basic-accessors.d.ts +4 -0
  272. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  273. package/dist/core/settings-manager-basic-accessors.js +18 -0
  274. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  275. package/dist/core/settings-manager-resource-accessors.d.ts +4 -0
  276. package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
  277. package/dist/core/settings-manager-resource-accessors.js +15 -0
  278. package/dist/core/settings-manager-resource-accessors.js.map +1 -1
  279. package/dist/core/settings-types.d.ts +11 -0
  280. package/dist/core/settings-types.d.ts.map +1 -1
  281. package/dist/core/settings-types.js.map +1 -1
  282. package/dist/core/system-prompt.d.ts +1 -1
  283. package/dist/core/system-prompt.d.ts.map +1 -1
  284. package/dist/core/system-prompt.js +3 -2
  285. package/dist/core/system-prompt.js.map +1 -1
  286. package/dist/core/tools/artifact-protocol.d.ts +11 -0
  287. package/dist/core/tools/artifact-protocol.d.ts.map +1 -0
  288. package/dist/core/tools/artifact-protocol.js +76 -0
  289. package/dist/core/tools/artifact-protocol.js.map +1 -0
  290. package/dist/core/tools/artifacts.d.ts +18 -0
  291. package/dist/core/tools/artifacts.d.ts.map +1 -0
  292. package/dist/core/tools/artifacts.js +90 -0
  293. package/dist/core/tools/artifacts.js.map +1 -0
  294. package/dist/core/tools/bash-async-jobs.d.ts +20 -0
  295. package/dist/core/tools/bash-async-jobs.d.ts.map +1 -0
  296. package/dist/core/tools/bash-async-jobs.js +59 -0
  297. package/dist/core/tools/bash-async-jobs.js.map +1 -0
  298. package/dist/core/tools/bash-async-output.d.ts +10 -0
  299. package/dist/core/tools/bash-async-output.d.ts.map +1 -0
  300. package/dist/core/tools/bash-async-output.js +80 -0
  301. package/dist/core/tools/bash-async-output.js.map +1 -0
  302. package/dist/core/tools/bash-interceptor.d.ts +10 -0
  303. package/dist/core/tools/bash-interceptor.d.ts.map +1 -0
  304. package/dist/core/tools/bash-interceptor.js +39 -0
  305. package/dist/core/tools/bash-interceptor.js.map +1 -0
  306. package/dist/core/tools/bash-leading-cd.d.ts +7 -0
  307. package/dist/core/tools/bash-leading-cd.d.ts.map +1 -0
  308. package/dist/core/tools/bash-leading-cd.js +59 -0
  309. package/dist/core/tools/bash-leading-cd.js.map +1 -0
  310. package/dist/core/tools/bash-pty-native.d.ts +14 -0
  311. package/dist/core/tools/bash-pty-native.d.ts.map +1 -0
  312. package/dist/core/tools/bash-pty-native.js +71 -0
  313. package/dist/core/tools/bash-pty-native.js.map +1 -0
  314. package/dist/core/tools/bash.d.ts +28 -17
  315. package/dist/core/tools/bash.d.ts.map +1 -1
  316. package/dist/core/tools/bash.js +152 -35
  317. package/dist/core/tools/bash.js.map +1 -1
  318. package/dist/core/tools/block-resolver.d.ts +16 -0
  319. package/dist/core/tools/block-resolver.d.ts.map +1 -0
  320. package/dist/core/tools/block-resolver.js +74 -0
  321. package/dist/core/tools/block-resolver.js.map +1 -0
  322. package/dist/core/tools/conflict-registry.d.ts +16 -0
  323. package/dist/core/tools/conflict-registry.d.ts.map +1 -0
  324. package/dist/core/tools/conflict-registry.js +44 -0
  325. package/dist/core/tools/conflict-registry.js.map +1 -0
  326. package/dist/core/tools/directory-tree.d.ts +13 -0
  327. package/dist/core/tools/directory-tree.d.ts.map +1 -0
  328. package/dist/core/tools/directory-tree.js +81 -0
  329. package/dist/core/tools/directory-tree.js.map +1 -0
  330. package/dist/core/tools/edit.d.ts +4 -29
  331. package/dist/core/tools/edit.d.ts.map +1 -1
  332. package/dist/core/tools/edit.js +136 -228
  333. package/dist/core/tools/edit.js.map +1 -1
  334. package/dist/core/tools/fetch-url.d.ts +74 -0
  335. package/dist/core/tools/fetch-url.d.ts.map +1 -0
  336. package/dist/core/tools/fetch-url.js +518 -0
  337. package/dist/core/tools/fetch-url.js.map +1 -0
  338. package/dist/core/tools/find.d.ts +27 -9
  339. package/dist/core/tools/find.d.ts.map +1 -1
  340. package/dist/core/tools/find.js +400 -176
  341. package/dist/core/tools/find.js.map +1 -1
  342. package/dist/core/tools/glob-path-utils.d.ts +8 -0
  343. package/dist/core/tools/glob-path-utils.d.ts.map +1 -0
  344. package/dist/core/tools/glob-path-utils.js +26 -0
  345. package/dist/core/tools/glob-path-utils.js.map +1 -0
  346. package/dist/core/tools/grep.d.ts +12 -0
  347. package/dist/core/tools/grep.d.ts.map +1 -1
  348. package/dist/core/tools/grep.js +141 -17
  349. package/dist/core/tools/grep.js.map +1 -1
  350. package/dist/core/tools/hashline-engine/apply.d.ts +11 -0
  351. package/dist/core/tools/hashline-engine/apply.d.ts.map +1 -0
  352. package/dist/core/tools/hashline-engine/apply.js +752 -0
  353. package/dist/core/tools/hashline-engine/apply.js.map +1 -0
  354. package/dist/core/tools/hashline-engine/block.d.ts +40 -0
  355. package/dist/core/tools/hashline-engine/block.d.ts.map +1 -0
  356. package/dist/core/tools/hashline-engine/block.js +117 -0
  357. package/dist/core/tools/hashline-engine/block.js.map +1 -0
  358. package/dist/core/tools/hashline-engine/diff-preview.d.ts +15 -0
  359. package/dist/core/tools/hashline-engine/diff-preview.d.ts.map +1 -0
  360. package/dist/core/tools/hashline-engine/diff-preview.js +98 -0
  361. package/dist/core/tools/hashline-engine/diff-preview.js.map +1 -0
  362. package/dist/core/tools/hashline-engine/format.d.ts +71 -0
  363. package/dist/core/tools/hashline-engine/format.d.ts.map +1 -0
  364. package/dist/core/tools/hashline-engine/format.js +178 -0
  365. package/dist/core/tools/hashline-engine/format.js.map +1 -0
  366. package/dist/core/tools/hashline-engine/fs.d.ts +81 -0
  367. package/dist/core/tools/hashline-engine/fs.d.ts.map +1 -0
  368. package/dist/core/tools/hashline-engine/fs.js +143 -0
  369. package/dist/core/tools/hashline-engine/fs.js.map +1 -0
  370. package/dist/core/tools/hashline-engine/index.d.ts +18 -0
  371. package/dist/core/tools/hashline-engine/index.d.ts.map +1 -0
  372. package/dist/core/tools/hashline-engine/index.js +20 -0
  373. package/dist/core/tools/hashline-engine/index.js.map +1 -0
  374. package/dist/core/tools/hashline-engine/input.d.ts +101 -0
  375. package/dist/core/tools/hashline-engine/input.d.ts.map +1 -0
  376. package/dist/core/tools/hashline-engine/input.js +398 -0
  377. package/dist/core/tools/hashline-engine/input.js.map +1 -0
  378. package/dist/core/tools/hashline-engine/messages.d.ts +99 -0
  379. package/dist/core/tools/hashline-engine/messages.d.ts.map +1 -0
  380. package/dist/core/tools/hashline-engine/messages.js +144 -0
  381. package/dist/core/tools/hashline-engine/messages.js.map +1 -0
  382. package/dist/core/tools/hashline-engine/mismatch.d.ts +45 -0
  383. package/dist/core/tools/hashline-engine/mismatch.d.ts.map +1 -0
  384. package/dist/core/tools/hashline-engine/mismatch.js +90 -0
  385. package/dist/core/tools/hashline-engine/mismatch.js.map +1 -0
  386. package/dist/core/tools/hashline-engine/normalize.d.ts +21 -0
  387. package/dist/core/tools/hashline-engine/normalize.d.ts.map +1 -0
  388. package/dist/core/tools/hashline-engine/normalize.js +33 -0
  389. package/dist/core/tools/hashline-engine/normalize.js.map +1 -0
  390. package/dist/core/tools/hashline-engine/parser.d.ts +24 -0
  391. package/dist/core/tools/hashline-engine/parser.d.ts.map +1 -0
  392. package/dist/core/tools/hashline-engine/parser.js +381 -0
  393. package/dist/core/tools/hashline-engine/parser.js.map +1 -0
  394. package/dist/core/tools/hashline-engine/patcher.d.ts +118 -0
  395. package/dist/core/tools/hashline-engine/patcher.d.ts.map +1 -0
  396. package/dist/core/tools/hashline-engine/patcher.js +341 -0
  397. package/dist/core/tools/hashline-engine/patcher.js.map +1 -0
  398. package/dist/core/tools/hashline-engine/prefixes.d.ts +43 -0
  399. package/dist/core/tools/hashline-engine/prefixes.d.ts.map +1 -0
  400. package/dist/core/tools/hashline-engine/prefixes.js +135 -0
  401. package/dist/core/tools/hashline-engine/prefixes.js.map +1 -0
  402. package/dist/core/tools/hashline-engine/recovery.d.ts +41 -0
  403. package/dist/core/tools/hashline-engine/recovery.d.ts.map +1 -0
  404. package/dist/core/tools/hashline-engine/recovery.js +168 -0
  405. package/dist/core/tools/hashline-engine/recovery.js.map +1 -0
  406. package/dist/core/tools/hashline-engine/snapshots.d.ts +65 -0
  407. package/dist/core/tools/hashline-engine/snapshots.d.ts.map +1 -0
  408. package/dist/core/tools/hashline-engine/snapshots.js +108 -0
  409. package/dist/core/tools/hashline-engine/snapshots.js.map +1 -0
  410. package/dist/core/tools/hashline-engine/stream.d.ts +3 -0
  411. package/dist/core/tools/hashline-engine/stream.d.ts.map +1 -0
  412. package/dist/core/tools/hashline-engine/stream.js +111 -0
  413. package/dist/core/tools/hashline-engine/stream.js.map +1 -0
  414. package/dist/core/tools/hashline-engine/tokenizer.d.ts +69 -0
  415. package/dist/core/tools/hashline-engine/tokenizer.d.ts.map +1 -0
  416. package/dist/core/tools/hashline-engine/tokenizer.js +430 -0
  417. package/dist/core/tools/hashline-engine/tokenizer.js.map +1 -0
  418. package/dist/core/tools/hashline-engine/types.d.ts +166 -0
  419. package/dist/core/tools/hashline-engine/types.d.ts.map +1 -0
  420. package/dist/core/tools/hashline-engine/types.js +9 -0
  421. package/dist/core/tools/hashline-engine/types.js.map +1 -0
  422. package/dist/core/tools/hashline.d.ts +29 -0
  423. package/dist/core/tools/hashline.d.ts.map +1 -0
  424. package/dist/core/tools/hashline.js +110 -0
  425. package/dist/core/tools/hashline.js.map +1 -0
  426. package/dist/core/tools/index.d.ts +6 -4
  427. package/dist/core/tools/index.d.ts.map +1 -1
  428. package/dist/core/tools/index.js +52 -35
  429. package/dist/core/tools/index.js.map +1 -1
  430. package/dist/core/tools/notebook.d.ts +38 -0
  431. package/dist/core/tools/notebook.d.ts.map +1 -0
  432. package/dist/core/tools/notebook.js +125 -0
  433. package/dist/core/tools/notebook.js.map +1 -0
  434. package/dist/core/tools/read-document-extract.d.ts +9 -0
  435. package/dist/core/tools/read-document-extract.d.ts.map +1 -0
  436. package/dist/core/tools/read-document-extract.js +212 -0
  437. package/dist/core/tools/read-document-extract.js.map +1 -0
  438. package/dist/core/tools/read-selectors.d.ts +24 -0
  439. package/dist/core/tools/read-selectors.d.ts.map +1 -0
  440. package/dist/core/tools/read-selectors.js +277 -0
  441. package/dist/core/tools/read-selectors.js.map +1 -0
  442. package/dist/core/tools/read-url.d.ts +37 -0
  443. package/dist/core/tools/read-url.d.ts.map +1 -0
  444. package/dist/core/tools/read-url.js +39 -0
  445. package/dist/core/tools/read-url.js.map +1 -0
  446. package/dist/core/tools/read.d.ts +11 -11
  447. package/dist/core/tools/read.d.ts.map +1 -1
  448. package/dist/core/tools/read.js +224 -94
  449. package/dist/core/tools/read.js.map +1 -1
  450. package/dist/core/tools/resource-selectors.d.ts +44 -0
  451. package/dist/core/tools/resource-selectors.d.ts.map +1 -0
  452. package/dist/core/tools/resource-selectors.js +808 -0
  453. package/dist/core/tools/resource-selectors.js.map +1 -0
  454. package/dist/core/tools/search-details.d.ts +26 -0
  455. package/dist/core/tools/search-details.d.ts.map +1 -0
  456. package/dist/core/tools/search-details.js +24 -0
  457. package/dist/core/tools/search-details.js.map +1 -0
  458. package/dist/core/tools/search-line-ranges.d.ts +11 -0
  459. package/dist/core/tools/search-line-ranges.d.ts.map +1 -0
  460. package/dist/core/tools/search-line-ranges.js +65 -0
  461. package/dist/core/tools/search-line-ranges.js.map +1 -0
  462. package/dist/core/tools/search-native.d.ts +97 -0
  463. package/dist/core/tools/search-native.d.ts.map +1 -0
  464. package/dist/core/tools/search-native.js +27 -0
  465. package/dist/core/tools/search-native.js.map +1 -0
  466. package/dist/core/tools/search.d.ts +24 -0
  467. package/dist/core/tools/search.d.ts.map +1 -0
  468. package/dist/core/tools/search.js +573 -0
  469. package/dist/core/tools/search.js.map +1 -0
  470. package/dist/core/tools/truncate.d.ts +4 -4
  471. package/dist/core/tools/truncate.d.ts.map +1 -1
  472. package/dist/core/tools/truncate.js +3 -3
  473. package/dist/core/tools/truncate.js.map +1 -1
  474. package/dist/core/tools/url-ip-guards.d.ts +4 -0
  475. package/dist/core/tools/url-ip-guards.d.ts.map +1 -0
  476. package/dist/core/tools/url-ip-guards.js +126 -0
  477. package/dist/core/tools/url-ip-guards.js.map +1 -0
  478. package/dist/core/tools/write.d.ts +12 -2
  479. package/dist/core/tools/write.d.ts.map +1 -1
  480. package/dist/core/tools/write.js +166 -14
  481. package/dist/core/tools/write.js.map +1 -1
  482. package/dist/core/trust-manager.d.ts.map +1 -1
  483. package/dist/core/trust-manager.js +2 -3
  484. package/dist/core/trust-manager.js.map +1 -1
  485. package/dist/index-extensions.d.ts +2 -2
  486. package/dist/index-extensions.d.ts.map +1 -1
  487. package/dist/index-extensions.js +1 -1
  488. package/dist/index-extensions.js.map +1 -1
  489. package/dist/index.d.ts +3 -3
  490. package/dist/index.d.ts.map +1 -1
  491. package/dist/index.js +3 -3
  492. package/dist/index.js.map +1 -1
  493. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +1 -0
  494. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  495. package/dist/modes/interactive/components/chat-session-host-runtime.js +12 -0
  496. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  497. package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts +4 -0
  498. package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts.map +1 -0
  499. package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.js +131 -0
  500. package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.js.map +1 -0
  501. package/dist/modes/interactive/components/chat-session-host.d.ts +2 -0
  502. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/chat-session-host.js +7 -1
  504. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  505. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  506. package/dist/modes/interactive/components/chat-transcript.js +15 -4
  507. package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
  508. package/dist/modes/interactive/components/custom-editor.d.ts +1 -0
  509. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  510. package/dist/modes/interactive/components/custom-editor.js +9 -2
  511. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  512. package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
  513. package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
  514. package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
  515. package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
  516. package/dist/modes/interactive/components/settings-selector-items.js +7 -0
  517. package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
  518. package/dist/modes/interactive/components/settings-selector-types.d.ts +2 -0
  519. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  521. package/dist/modes/interactive/components/tool-execution.d.ts +3 -0
  522. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/tool-execution.js +26 -0
  524. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  525. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/tree-selector-content.js +0 -5
  527. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  528. package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
  529. package/dist/modes/interactive/interactive-auth-login.js +1 -0
  530. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  531. package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
  532. package/dist/modes/interactive/interactive-autocomplete.js +80 -2
  533. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  534. package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
  535. package/dist/modes/interactive/interactive-hotkeys-debug.js +3 -0
  536. package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
  537. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  538. package/dist/modes/interactive/interactive-input-handling.js +51 -0
  539. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  540. package/dist/modes/interactive/interactive-mode-base.d.ts +5 -0
  541. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  542. package/dist/modes/interactive/interactive-mode-base.js +5 -0
  543. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  544. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  545. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  546. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  547. package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -0
  548. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  549. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  550. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  551. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  552. package/dist/modes/interactive/interactive-mode.js +1 -0
  553. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  554. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  555. package/dist/modes/interactive/interactive-model-routing.js +4 -1
  556. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  557. package/dist/modes/interactive/interactive-onboarding.d.ts +11 -0
  558. package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -0
  559. package/dist/modes/interactive/interactive-onboarding.js +220 -0
  560. package/dist/modes/interactive/interactive-onboarding.js.map +1 -0
  561. package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
  562. package/dist/modes/interactive/interactive-selectors.js +4 -0
  563. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  564. package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
  565. package/dist/modes/interactive/interactive-session-routing.js +6 -0
  566. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  567. package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
  568. package/dist/modes/interactive/interactive-slash-commands.js +9 -4
  569. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  570. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  571. package/dist/modes/interactive/interactive-startup.js +28 -0
  572. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  573. package/dist/utils/child-process.d.ts.map +1 -1
  574. package/dist/utils/child-process.js +21 -1
  575. package/dist/utils/child-process.js.map +1 -1
  576. package/dist/utils/markit.d.ts +8 -0
  577. package/dist/utils/markit.d.ts.map +1 -0
  578. package/dist/utils/markit.js +53 -0
  579. package/dist/utils/markit.js.map +1 -0
  580. package/dist/utils/paths.d.ts +2 -1
  581. package/dist/utils/paths.d.ts.map +1 -1
  582. package/dist/utils/paths.js +14 -1
  583. package/dist/utils/paths.js.map +1 -1
  584. package/docs/compaction.md +18 -1
  585. package/docs/containerization.md +1 -1
  586. package/docs/docs.json +1 -0
  587. package/docs/extensions.md +25 -36
  588. package/docs/models.md +1 -1
  589. package/docs/providers.md +2 -1
  590. package/docs/quickstart.md +11 -6
  591. package/docs/sdk.md +5 -5
  592. package/docs/session-format.md +6 -0
  593. package/docs/sessions.md +6 -0
  594. package/docs/settings.md +7 -0
  595. package/docs/subagents.md +3 -2
  596. package/docs/tools.md +49 -0
  597. package/docs/usage.md +3 -3
  598. package/docs/workflows.md +112 -8
  599. package/examples/extensions/subagent/README.md +5 -5
  600. package/examples/extensions/subagent/agents/planner.md +1 -1
  601. package/examples/extensions/subagent/agents/reviewer.md +1 -1
  602. package/examples/extensions/subagent/agents/scout.md +2 -2
  603. package/examples/extensions/subagent/display.ts +3 -3
  604. package/examples/sdk/05-tools.ts +3 -3
  605. package/examples/sdk/README.md +1 -1
  606. package/package.json +5 -3
@@ -0,0 +1,284 @@
1
+ /** Durable `ctx.stage` / `ctx.task` replay and checkpoint helpers. */
2
+
3
+ import type { StageContext, StageOptions, WorkflowTaskOptions, WorkflowTaskResult } from "../shared/types.js";
4
+ import type { StageSnapshot } from "../shared/store-types.js";
5
+ import type { WorkflowSerializableValue } from "../shared/types.js";
6
+ import type { DurableWorkflowBackend } from "./backend.js";
7
+ import type { ParallelFailFastScope } from "../runs/foreground/executor-types.js";
8
+ import { durableHash } from "./backend.js";
9
+ import { recordCheckpointDurably } from "./tool-primitive.js";
10
+ import type { DurableStageCheckpoint } from "./types.js";
11
+
12
+ export interface DurableStageDeps {
13
+ readonly workflowId: string;
14
+ readonly backend: DurableWorkflowBackend;
15
+ readonly nextCheckpointId: () => string;
16
+ readonly nextReplayKey: (stageName: string) => string;
17
+ readonly replayKeyForCompletedStage?: (stage: StageSnapshot) => string | undefined;
18
+ }
19
+
20
+ export async function recordStageCheckpoint(deps: DurableStageDeps, stage: StageSnapshot): Promise<boolean> {
21
+ if (stage.status !== "completed") return false;
22
+ const replayKey = deps.replayKeyForCompletedStage?.(stage) ?? stage.replayKey ?? deps.nextReplayKey(stage.name);
23
+ if (deps.backend.getStageOutput(deps.workflowId, replayKey) !== undefined) return false;
24
+ const checkpoint: DurableStageCheckpoint = {
25
+ kind: "stage",
26
+ workflowId: deps.workflowId,
27
+ checkpointId: stableCheckpointId("stage", replayKey),
28
+ name: stage.name,
29
+ replayKey,
30
+ output: stageOutput(stage),
31
+ completedAt: stage.endedAt ?? Date.now(),
32
+ };
33
+ await recordCheckpointDurably(deps.backend, checkpoint);
34
+ return true;
35
+ }
36
+
37
+ export async function recordStageSessionCheckpoint(deps: DurableStageDeps, stage: StageSnapshot): Promise<boolean> {
38
+ const replayKey = deps.replayKeyForCompletedStage?.(stage) ?? stage.replayKey ?? deps.nextReplayKey(stage.name);
39
+ if (stage.sessionFile === undefined) return false;
40
+ const current = deps.backend.getStageSession(deps.workflowId, replayKey);
41
+ if (current?.sessionFile === stage.sessionFile) return false;
42
+ const checkpoint: DurableStageCheckpoint = {
43
+ kind: "stage",
44
+ workflowId: deps.workflowId,
45
+ checkpointId: stageSessionCheckpointId(replayKey, stage),
46
+ name: stage.name,
47
+ replayKey,
48
+ ...(stage.sessionId !== undefined ? { sessionId: stage.sessionId } : {}),
49
+ sessionFile: stage.sessionFile,
50
+ completedAt: Date.now(),
51
+ };
52
+ await recordCheckpointDurably(deps.backend, checkpoint);
53
+ return true;
54
+ }
55
+
56
+ const MID_SESSION_RESUME_PROMPT = "Continue";
57
+
58
+ function withMidSessionResumePrompt<T extends StageContext>(stage: T, enabled: boolean): T {
59
+ if (!enabled) return stage;
60
+ // Do NOT spread `stage` (e.g. `{ ...stage, prompt }`). The live StageContext
61
+ // exposes lazy getters for `sessionId`/`sessionFile`/`messages`/`isStreaming`
62
+ // that throw until the underlying SDK session has been created, and a spread
63
+ // would eagerly read them before the first `prompt()` lands. Override
64
+ // `prompt` in place instead — `prompt` is a normal configurable own property.
65
+ const originalPrompt = stage.prompt.bind(stage);
66
+ Object.defineProperty(stage, "prompt", {
67
+ value: (_text: string, options?: Parameters<StageContext["prompt"]>[1]) =>
68
+ originalPrompt(MID_SESSION_RESUME_PROMPT, options as never),
69
+ writable: true,
70
+ configurable: true,
71
+ enumerable: true,
72
+ });
73
+ return stage;
74
+ }
75
+
76
+
77
+ export function createDurableStagePrimitive(input: {
78
+ readonly workflowId: string;
79
+ readonly backend: DurableWorkflowBackend;
80
+ readonly nextReplayKey: (stageName: string) => string;
81
+ readonly stage: (name: string, options: StageOptions | undefined, replayKey: string) => StageContext;
82
+ readonly recordCachedStage?: (name: string, replayKey: string, output: WorkflowSerializableValue) => void;
83
+ }): (name: string, options?: StageOptions) => StageContext {
84
+ return (name: string, options?: StageOptions): StageContext => {
85
+ const replayKey = input.nextReplayKey(name);
86
+ const cached = input.backend.getStageOutput(input.workflowId, replayKey);
87
+ if (cached !== undefined) {
88
+ input.recordCachedStage?.(name, replayKey, cached);
89
+ return createCachedStageContext(name, cached);
90
+ }
91
+ const session = input.backend.getStageSession(input.workflowId, replayKey);
92
+ const isMidSessionResume = session?.sessionFile !== undefined;
93
+ const liveOptions: StageOptions | undefined = {
94
+ ...(options ?? {}),
95
+ durableReplayKey: replayKey,
96
+ ...(isMidSessionResume ? { resumeFromSessionFile: session.sessionFile } : {}),
97
+ };
98
+ const live = withMidSessionResumePrompt(input.stage(name, liveOptions, replayKey), isMidSessionResume);
99
+ if (options?.schema === undefined) return live;
100
+ return wrapSchemaStageForDurability({
101
+ stage: live,
102
+ workflowId: input.workflowId,
103
+ backend: input.backend,
104
+ replayKey,
105
+ name,
106
+ });
107
+ };
108
+ }
109
+
110
+ export function createDurableTaskPrimitive(input: {
111
+ readonly workflowId: string;
112
+ readonly backend: DurableWorkflowBackend;
113
+ readonly nextReplayKey: (stageName: string) => string;
114
+ readonly task: (name: string, options: WorkflowTaskOptions, stageFailFastScope?: ParallelFailFastScope) => Promise<WorkflowTaskResult>;
115
+ readonly recordCachedTask?: (name: string, replayKey: string, output: WorkflowTaskResult) => void;
116
+ }): (name: string, options: WorkflowTaskOptions) => Promise<WorkflowTaskResult> {
117
+ return async (name: string, options: WorkflowTaskOptions, stageFailFastScope?: ParallelFailFastScope): Promise<WorkflowTaskResult> => {
118
+ const replayKey = input.nextReplayKey(`task:${name}`);
119
+ const cached = input.backend.getStageOutput(input.workflowId, replayKey);
120
+ if (cached !== undefined && isWorkflowTaskResult(cached)) {
121
+ input.recordCachedTask?.(name, replayKey, cached);
122
+ return cached;
123
+ }
124
+ const session = input.backend.getStageSession(input.workflowId, replayKey);
125
+ const taskOptions: WorkflowTaskOptions = {
126
+ ...options,
127
+ durableReplayKey: replayKey,
128
+ ...(session?.sessionFile !== undefined ? { resumeFromSessionFile: session.sessionFile } : {}),
129
+ };
130
+ const result = await input.task(name, taskOptions, stageFailFastScope);
131
+ await recordCheckpointDurably(input.backend, {
132
+ kind: "stage",
133
+ workflowId: input.workflowId,
134
+ checkpointId: stableCheckpointId("task", replayKey),
135
+ name,
136
+ replayKey,
137
+ output: result,
138
+ completedAt: Date.now(),
139
+ });
140
+ return result;
141
+ };
142
+ }
143
+
144
+ function wrapSchemaStageForDurability(input: {
145
+ readonly stage: StageContext;
146
+ readonly workflowId: string;
147
+ readonly backend: DurableWorkflowBackend;
148
+ readonly replayKey: string;
149
+ readonly name: string;
150
+ }): StageContext {
151
+ const stage = input.stage;
152
+ const wrapped = Object.create(stage) as StageContext;
153
+ Object.defineProperty(wrapped, "prompt", {
154
+ value: async (text: string, options?: Parameters<StageContext["prompt"]>[1]) => {
155
+ const result = await stage.prompt(text, options);
156
+ // Checkpoint both structured results AND empty string results so that
157
+ // a schema-backed stage returning "" is replayed as "" rather than
158
+ // being dropped (treated as no checkpoint).
159
+ // cross-ref: issue #1498 — empty string stage outputs must survive durable checkpointing.
160
+ if (typeof result !== "string" || result.length === 0) {
161
+ await recordCheckpointDurably(input.backend, {
162
+ kind: "stage",
163
+ workflowId: input.workflowId,
164
+ checkpointId: stableCheckpointId("stage", input.replayKey),
165
+ name: input.name,
166
+ replayKey: input.replayKey,
167
+ output: result as WorkflowSerializableValue,
168
+ completedAt: Date.now(),
169
+ });
170
+ }
171
+ return result;
172
+ },
173
+ });
174
+ return wrapped;
175
+ }
176
+
177
+ function createCachedStageContext(name: string, output: WorkflowSerializableValue): StageContext {
178
+ const text = typeof output === "string" ? output : JSON.stringify(output);
179
+ const unsupported = async (): Promise<never> => { throw new Error(`Stage "${name}" was replayed from a durable checkpoint; live session operations are unavailable.`); };
180
+ const cached = {
181
+ name,
182
+ async prompt() { return output as Awaited<ReturnType<StageContext["prompt"]>>; },
183
+ async complete() { return text; },
184
+ sendUserMessage: unsupported,
185
+ async steer() {},
186
+ async followUp() {},
187
+ subscribe() { return () => {}; },
188
+ sessionFile: undefined,
189
+ sessionId: `durable-replay:${name}`,
190
+ setModel: unsupported,
191
+ setThinkingLevel() {},
192
+ cycleModel: unsupported,
193
+ cycleThinkingLevel() { return undefined; },
194
+ agent: undefined,
195
+ model: undefined,
196
+ thinkingLevel: undefined,
197
+ messages: [],
198
+ isStreaming: false,
199
+ navigateTree: unsupported,
200
+ compact: unsupported,
201
+ abortCompaction() {},
202
+ abort: async () => {},
203
+ };
204
+ return cached as never as StageContext;
205
+ }
206
+
207
+ function stageOutput(stage: StageSnapshot): WorkflowSerializableValue {
208
+ // Preserve empty string ("") distinctly from undefined (no result).
209
+ // A stage that completed with empty assistant text must replay as empty,
210
+ // not be collapsed into a status object.
211
+ // cross-ref: issue #1498 — empty string stage outputs must survive durable checkpointing.
212
+ if (stage.result !== undefined) return stage.result;
213
+ return { status: stage.status, stageId: stage.id };
214
+ }
215
+
216
+ export function createStageReplayKeyGenerator(_workflowId: string): (stageName: string, stageId?: string) => string {
217
+ const counts = new Map<string, number>();
218
+ return (stageName: string, _stageId?: string): string => {
219
+ const next = (counts.get(stageName) ?? 0) + 1;
220
+ counts.set(stageName, next);
221
+ return `stage:${stageName}:${next}`;
222
+ };
223
+ }
224
+
225
+ export function stableCheckpointId(kind: string, replayKey: string): string {
226
+ return `${kind}:${replayKey}`;
227
+ }
228
+
229
+ function stageSessionCheckpointId(replayKey: string, stage: StageSnapshot): string {
230
+ return `${stableCheckpointId("stage-session", replayKey)}:${durableHash({
231
+ sessionId: stage.sessionId ?? "",
232
+ sessionFile: stage.sessionFile ?? "",
233
+ })}`;
234
+ }
235
+
236
+ export function cachedStageId(runId: string, replayKey: string): string {
237
+ return `durable-${durableHash({ runId, replayKey })}`;
238
+ }
239
+
240
+ export function recordCachedStageIntoStore(
241
+ store: import("../shared/store.js").Store,
242
+ runId: string,
243
+ name: string,
244
+ replayKey: string,
245
+ output: WorkflowSerializableValue,
246
+ completedStageReplayKeys: Map<string, string>,
247
+ parentIds?: readonly string[],
248
+ ): void {
249
+ const now = Date.now();
250
+ const stageId = cachedStageId(runId, replayKey);
251
+ const result = typeof output === "string" ? output : JSON.stringify(output);
252
+ const snapshot: StageSnapshot = {
253
+ id: stageId, name, status: "completed", parentIds: parentIds !== undefined ? Object.freeze([...parentIds]) : [], startedAt: now, endedAt: now, durationMs: 0, result,
254
+ replayKey, replayed: true, skippedReason: "durable checkpoint replay", toolEvents: [], attachable: false,
255
+ };
256
+ store.recordStageStart(runId, snapshot);
257
+ store.recordStageEnd(runId, snapshot);
258
+ completedStageReplayKeys.set(stageId, replayKey);
259
+ }
260
+
261
+ /**
262
+ * Record a cached durable stage into the store AND register it in the graph
263
+ * frontier tracker so parent/frontier lineage is preserved for subsequent stages.
264
+ * cross-ref: issue #1498 — replayed durable stages preserve graph lineage.
265
+ */
266
+ export function recordCachedStageWithTracker(
267
+ store: import("../shared/store.js").Store,
268
+ tracker: import("../engine/graph-inference.js").GraphFrontierTracker,
269
+ runId: string,
270
+ name: string,
271
+ replayKey: string,
272
+ output: WorkflowSerializableValue,
273
+ completedStageReplayKeys: Map<string, string>,
274
+ ): void {
275
+ const stageId = cachedStageId(runId, replayKey);
276
+ const parentIds = tracker.onSpawn(stageId, name);
277
+ recordCachedStageIntoStore(store, runId, name, replayKey, output, completedStageReplayKeys, parentIds);
278
+ tracker.onSettle(stageId);
279
+ }
280
+
281
+ function isWorkflowTaskResult(value: WorkflowSerializableValue): value is WorkflowTaskResult {
282
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
283
+ return typeof (value as Record<string, WorkflowSerializableValue>)["text"] === "string";
284
+ }
@@ -0,0 +1,180 @@
1
+ /**
2
+ * `ctx.tool` primitive — durable cached execution of arbitrary TypeScript code.
3
+ *
4
+ * Runs a user-supplied async function and caches the result durably via the
5
+ * {@link DurableWorkflowBackend}. On resume, if the tool already completed
6
+ * (matched by content hash of name + args), the cached result is returned
7
+ * without re-executing the function — ensuring completed side effects are not
8
+ * repeated.
9
+ *
10
+ * Only `ctx.*` blocks produce durable checkpoints. Anything outside `ctx.*`
11
+ * (including bare `await someFunction()`) is never saved, matching the issue's
12
+ * requirement: "checkpoints are effectively only `ctx.*` blocks."
13
+ *
14
+ * cross-ref: issue #1498 — "Introduce ctx.tool which allows you to run any
15
+ * typescript code and cache the result for DBOS."
16
+ */
17
+
18
+ import type { WorkflowSerializableValue } from "../shared/types.js";
19
+ import type { DurableWorkflowBackend } from "./backend.js";
20
+ import { durableHash } from "./backend.js";
21
+ import type { DurableCheckpoint, DurableToolCheckpoint } from "./types.js";
22
+
23
+ /**
24
+ * Options for `ctx.tool(name, args, fn)`.
25
+ */
26
+ export interface WorkflowToolOptions {
27
+ /**
28
+ * When true, the tool function is retried on failure with exponential
29
+ * backoff. Defaults to false (matching DBOS step default).
30
+ */
31
+ readonly retriesAllowed?: boolean;
32
+ /** Max retry attempts when retriesAllowed is true. Default 3. */
33
+ readonly maxAttempts?: number;
34
+ /** Initial retry interval in ms. Default 1000. */
35
+ readonly intervalMs?: number;
36
+ /** Backoff multiplier. Default 2. */
37
+ readonly backoffRate?: number;
38
+ }
39
+
40
+ /**
41
+ * The `ctx.tool` primitive type exposed on {@link WorkflowRunContext}.
42
+ *
43
+ * @param name Tool name (for display and checkpoint identity).
44
+ * @param args Tool arguments (JSON-serializable; included in the content hash).
45
+ * @param fn The async function to execute. Its return must be JSON-serializable.
46
+ * @param options Retry configuration.
47
+ */
48
+ export type WorkflowToolPrimitive = <T extends WorkflowSerializableValue>(
49
+ name: string,
50
+ args: Readonly<Record<string, WorkflowSerializableValue>>,
51
+ fn: () => Promise<T>,
52
+ options?: WorkflowToolOptions,
53
+ ) => Promise<T>;
54
+
55
+ export interface CreateToolPrimitiveInput {
56
+ readonly workflowId: string;
57
+ readonly backend: DurableWorkflowBackend;
58
+ /** Monotonic checkpoint id counter source. */
59
+ readonly nextCheckpointId: () => string;
60
+ /** Abort check; throws if the workflow has been cancelled. */
61
+ readonly throwIfCancelled: () => void;
62
+ /** Optional signal for aborting retry backoff sleeps. */
63
+ readonly signal?: AbortSignal;
64
+ }
65
+
66
+ /**
67
+ * Create the `ctx.tool` primitive wired to a durable backend.
68
+ */
69
+ export function createToolPrimitive(input: CreateToolPrimitiveInput): WorkflowToolPrimitive {
70
+ const ordinals = new Map<string, number>();
71
+ return async <T extends WorkflowSerializableValue>(
72
+ name: string,
73
+ args: Readonly<Record<string, WorkflowSerializableValue>>,
74
+ fn: () => Promise<T>,
75
+ options?: WorkflowToolOptions,
76
+ ): Promise<T> => {
77
+ input.throwIfCancelled();
78
+ const callKey = durableHash({ name, args });
79
+ const ordinal = (ordinals.get(callKey) ?? 0) + 1;
80
+ ordinals.set(callKey, ordinal);
81
+ const argsHash = durableHash({ name, args, ordinal });
82
+
83
+ // Check for cached result — completed side effects are not repeated.
84
+ const cached = input.backend.getToolOutput(input.workflowId, argsHash);
85
+ if (cached !== undefined) return cached as T;
86
+
87
+ // Execute (with optional retries).
88
+ const result = await executeWithRetries(fn, options, input.throwIfCancelled, input.signal);
89
+
90
+ // Re-check cancellation after the tool function resolves but BEFORE the
91
+ // side-effect result is durably checkpointed/returned. A side effect that
92
+ // completes concurrently with a cancellation must not be recorded as a
93
+ // durable checkpoint that a resume would silently replay.
94
+ // cross-ref: issue #1498.
95
+ input.throwIfCancelled();
96
+
97
+ // Record the checkpoint durably.
98
+ const checkpoint: DurableToolCheckpoint = {
99
+ kind: "tool",
100
+ workflowId: input.workflowId,
101
+ checkpointId: `tool:${argsHash}`,
102
+ name,
103
+ argsHash,
104
+ output: result,
105
+ completedAt: Date.now(),
106
+ };
107
+ await recordCheckpointDurably(input.backend, checkpoint);
108
+ return result;
109
+ };
110
+ }
111
+
112
+ export async function recordCheckpointDurably(backend: DurableWorkflowBackend, checkpoint: DurableCheckpoint): Promise<void> {
113
+ if (backend.recordCheckpointAsync !== undefined) {
114
+ await backend.recordCheckpointAsync(checkpoint);
115
+ return;
116
+ }
117
+ backend.recordCheckpoint(checkpoint);
118
+ await backend.flush?.();
119
+ }
120
+
121
+ async function executeWithRetries<T>(
122
+ fn: () => Promise<T>,
123
+ options: WorkflowToolOptions | undefined,
124
+ throwIfCancelled: () => void,
125
+ signal?: AbortSignal,
126
+ ): Promise<T> {
127
+ throwIfCancelled();
128
+ if (!options?.retriesAllowed) return fn();
129
+ const maxAttempts = options.maxAttempts ?? 3;
130
+ const intervalMs = options.intervalMs ?? 1000;
131
+ const backoffRate = options.backoffRate ?? 2;
132
+ let lastError: Error | undefined;
133
+ let delay = intervalMs;
134
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
135
+ throwIfCancelled();
136
+ try {
137
+ return await fn();
138
+ } catch (err) {
139
+ lastError = err instanceof Error ? err : new Error(String(err));
140
+ if (attempt < maxAttempts) {
141
+ await sleepOrAbort(delay, signal);
142
+ throwIfCancelled();
143
+ delay = Math.min(delay * backoffRate, 3600_000);
144
+ }
145
+ }
146
+ }
147
+ throw lastError ?? new Error("ctx.tool: retries exhausted");
148
+ }
149
+
150
+ export function sleepOrAbort(ms: number, signal?: AbortSignal): Promise<void> {
151
+ if (signal?.aborted) return Promise.reject(signal.reason instanceof Error ? signal.reason : new Error("atomic-workflows: workflow cancelled"));
152
+ return new Promise((resolve, reject) => {
153
+ let settled = false;
154
+ const cleanup = (): void => signal?.removeEventListener("abort", onAbort);
155
+ const finish = (): void => {
156
+ if (settled) return;
157
+ settled = true;
158
+ cleanup();
159
+ resolve();
160
+ };
161
+ const fail = (err: Error): void => {
162
+ if (settled) return;
163
+ settled = true;
164
+ clearTimeout(timer);
165
+ cleanup();
166
+ reject(err);
167
+ };
168
+ const timer = setTimeout(finish, ms);
169
+ const onAbort = (): void => fail(signal?.reason instanceof Error ? signal.reason : new Error("atomic-workflows: workflow cancelled"));
170
+ signal?.addEventListener("abort", onAbort, { once: true });
171
+ });
172
+ }
173
+
174
+ /**
175
+ * Create a monotonic checkpoint id generator for a workflow.
176
+ */
177
+ export function createCheckpointIdGenerator(): () => string {
178
+ let counter = 0;
179
+ return () => `cp-${++counter}`;
180
+ }
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Durable workflow state types for DBOS-backed cross-session resumability.
3
+ *
4
+ * These types describe the checkpoint records that the durable backend stores
5
+ * for each `ctx.*` operation (tool, ui, stage). Only `ctx.*` blocks produce
6
+ * durable checkpoints — anything outside `ctx.*` is never saved, matching the
7
+ * issue's "checkpoints are effectively only `ctx.*` blocks" requirement.
8
+ *
9
+ * cross-ref: issue #1498
10
+ */
11
+
12
+ import type { WorkflowSerializableValue } from "../shared/types.js";
13
+
14
+ // ---------------------------------------------------------------------------
15
+ // Top-level workflow identity
16
+ // ---------------------------------------------------------------------------
17
+
18
+ /**
19
+ * A resumable top-level workflow. The `workflowId` is the public resume handle
20
+ * (a run id); internal nested workflow ids are abstracted away from users.
21
+ */
22
+ export interface DurableWorkflowHandle {
23
+ /** Top-level workflow id used by `/workflow resume <id>`. */
24
+ readonly workflowId: string;
25
+ /** Workflow definition name. */
26
+ readonly name: string;
27
+ /** Workflow inputs (JSON-serializable). */
28
+ readonly inputs: Readonly<WorkflowSerializableObject>;
29
+ /** Creation timestamp (ms since epoch). */
30
+ readonly createdAt: number;
31
+ /** Last update timestamp (ms since epoch). */
32
+ readonly updatedAt: number;
33
+ /** Current durable status. */
34
+ readonly status: DurableWorkflowStatus;
35
+ /** Session file path that caches this workflow's durable metadata. */
36
+ readonly sessionFile?: string;
37
+ /** Number of completed durable checkpoints. */
38
+ readonly completedCheckpoints: number;
39
+ /** Number of pending (unanswered) UI prompts. */
40
+ readonly pendingPrompts: number;
41
+ /** Optional human-readable label. */
42
+ readonly label?: string;
43
+ /** Root workflow id. Omitted or equal to workflowId means top-level. */
44
+ readonly rootWorkflowId?: string;
45
+ /** Explicit resumability flag for failed/blocked runs. */
46
+ readonly resumable?: boolean;
47
+ }
48
+
49
+ export type DurableWorkflowStatus =
50
+ | "running"
51
+ | "paused"
52
+ | "completed"
53
+ | "failed"
54
+ | "cancelled"
55
+ | "blocked";
56
+
57
+ // ---------------------------------------------------------------------------
58
+ // Checkpoint records
59
+ // ---------------------------------------------------------------------------
60
+
61
+ /**
62
+ * Discriminated union of durable checkpoint records.
63
+ * Each `ctx.*` operation that should survive cross-session resume writes one
64
+ * of these. The backend keys checkpoints by (workflowId, kind, checkpointId).
65
+ */
66
+ export type DurableCheckpoint = DurableToolCheckpoint | DurableUiCheckpoint | DurableStageCheckpoint;
67
+
68
+ export type DurableCheckpointKind = "tool" | "ui" | "stage";
69
+
70
+ /** A `ctx.tool(...)` result cached durably. */
71
+ export interface DurableToolCheckpoint {
72
+ readonly kind: "tool";
73
+ readonly workflowId: string;
74
+ /** Unique checkpoint id within the workflow (monotonic). */
75
+ readonly checkpointId: string;
76
+ /** Tool name for display/debugging. */
77
+ readonly name: string;
78
+ /** Deterministic hash of the tool arguments for idempotency. */
79
+ readonly argsHash: string;
80
+ /** Cached tool output (JSON-serializable). */
81
+ readonly output: WorkflowSerializableValue;
82
+ readonly completedAt: number;
83
+ }
84
+
85
+ /** A `ctx.ui.*` user response cached durably. */
86
+ export interface DurableUiCheckpoint {
87
+ readonly kind: "ui";
88
+ readonly workflowId: string;
89
+ readonly checkpointId: string;
90
+ /** UI prompt kind (input/confirm/select/editor/custom). */
91
+ readonly promptKind: UiPromptKind;
92
+ /** Prompt message shown to the user. */
93
+ readonly message: string;
94
+ /** Deterministic hash of the prompt identity for replay matching. */
95
+ readonly promptHash: string;
96
+ /** User response (JSON-serializable). */
97
+ readonly response: WorkflowSerializableValue;
98
+ readonly completedAt: number;
99
+ }
100
+
101
+ /** A `ctx.stage(...)` / `ctx.task(...)` durable checkpoint or resumable session marker. */
102
+ export interface DurableStageCheckpoint {
103
+ readonly kind: "stage";
104
+ readonly workflowId: string;
105
+ readonly checkpointId: string;
106
+ /** Stage name for display. */
107
+ readonly name: string;
108
+ /** Stable replay key (matches existing continuation replay semantics). */
109
+ readonly replayKey: string;
110
+ /** Stage output text or structured result when the stage completed. */
111
+ readonly output?: WorkflowSerializableValue;
112
+ /** Resumable Atomic/Pi session metadata for in-progress LM stages. */
113
+ readonly sessionId?: string;
114
+ readonly sessionFile?: string;
115
+ readonly completedAt: number;
116
+ }
117
+
118
+ export type UiPromptKind = "input" | "confirm" | "select" | "editor" | "custom";
119
+
120
+ // ---------------------------------------------------------------------------
121
+ // Serializable helpers
122
+ // ---------------------------------------------------------------------------
123
+
124
+ export type WorkflowSerializableObject = Readonly<Record<string, WorkflowSerializableValue>>;
125
+
126
+ // ---------------------------------------------------------------------------
127
+ // Resume catalog entry (cached on session JSONL)
128
+ // ---------------------------------------------------------------------------
129
+
130
+ /**
131
+ * Durable workflow metadata cached as a `workflow.durable.checkpoint` session
132
+ * entry. This is the session-file cache described by the issue — it lets a new
133
+ * session discover resumable workflows without scanning the full DBOS system
134
+ * database. DBOS remains the checkpoint source of truth; this cache mirrors
135
+ * the minimal top-level metadata needed for `/workflow resume` discovery.
136
+ */
137
+ export interface DurableCheckpointEntry {
138
+ readonly type: "workflow.durable.checkpoint";
139
+ readonly workflowId: string;
140
+ readonly name: string;
141
+ readonly inputs: WorkflowSerializableObject;
142
+ readonly status: DurableWorkflowStatus;
143
+ readonly completedCheckpoints: number;
144
+ readonly pendingPrompts: number;
145
+ readonly label?: string;
146
+ readonly rootWorkflowId?: string;
147
+ readonly resumable?: boolean;
148
+ readonly ts: number;
149
+ }
150
+
151
+ /**
152
+ * Resume catalog entry for the cross-session `/workflow resume` selector.
153
+ * Built from durable checkpoint entries found across session files.
154
+ */
155
+ export interface ResumableWorkflowEntry {
156
+ readonly workflowId: string;
157
+ readonly name: string;
158
+ readonly inputs?: WorkflowSerializableObject;
159
+ readonly status: DurableWorkflowStatus;
160
+ readonly completedCheckpoints: number;
161
+ readonly pendingPrompts: number;
162
+ readonly sessionFile?: string;
163
+ readonly label?: string;
164
+ readonly rootWorkflowId?: string;
165
+ readonly resumable?: boolean;
166
+ readonly createdAt: number;
167
+ readonly updatedAt: number;
168
+ }