@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.10

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 (303) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +5 -5
  3. package/dist/builtin/intercom/CHANGELOG.md +54 -0
  4. package/dist/builtin/intercom/package.json +2 -2
  5. package/dist/builtin/mcp/CHANGELOG.md +54 -0
  6. package/dist/builtin/mcp/package.json +3 -3
  7. package/dist/builtin/subagents/CHANGELOG.md +55 -0
  8. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
  9. package/dist/builtin/subagents/agents/debugger.md +6 -6
  10. package/dist/builtin/subagents/package.json +4 -4
  11. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
  12. package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
  13. package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
  14. package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
  15. package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
  16. package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
  17. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +55 -12
  18. package/dist/builtin/subagents/src/runs/foreground/execution.ts +71 -12
  19. package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
  20. package/dist/builtin/subagents/src/runs/shared/final-drain.ts +34 -0
  21. package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +416 -7
  22. package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
  23. package/dist/builtin/web-access/CHANGELOG.md +54 -0
  24. package/dist/builtin/web-access/package.json +2 -2
  25. package/dist/builtin/workflows/CHANGELOG.md +66 -0
  26. package/dist/builtin/workflows/README.md +10 -8
  27. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -8
  28. package/dist/builtin/workflows/builtin/goal.ts +137 -109
  29. package/dist/builtin/workflows/builtin/index.d.ts +2 -0
  30. package/dist/builtin/workflows/builtin/open-claude-design.ts +228 -151
  31. package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
  32. package/dist/builtin/workflows/builtin/ralph.ts +452 -279
  33. package/dist/builtin/workflows/package.json +2 -2
  34. package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
  35. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +29 -10
  36. package/dist/builtin/workflows/src/extension/index.ts +10 -2
  37. package/dist/builtin/workflows/src/extension/runtime.ts +35 -3
  38. package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
  39. package/dist/builtin/workflows/src/runs/background/status.ts +52 -6
  40. package/dist/builtin/workflows/src/runs/foreground/executor.ts +453 -21
  41. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +77 -11
  42. package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +402 -8
  43. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
  44. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
  45. package/dist/builtin/workflows/src/shared/persistence-restore.ts +182 -6
  46. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +76 -6
  47. package/dist/builtin/workflows/src/shared/stage-prompt.ts +33 -2
  48. package/dist/builtin/workflows/src/shared/store-types.ts +31 -0
  49. package/dist/builtin/workflows/src/shared/store.ts +160 -18
  50. package/dist/builtin/workflows/src/shared/types.ts +3 -3
  51. package/dist/builtin/workflows/src/shared/workflow-failures.ts +758 -132
  52. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +39 -3
  53. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +74 -74
  54. package/dist/core/agent-session.d.ts +33 -6
  55. package/dist/core/agent-session.d.ts.map +1 -1
  56. package/dist/core/agent-session.js +157 -182
  57. package/dist/core/agent-session.js.map +1 -1
  58. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  59. package/dist/core/atomic-guide-command.js +11 -9
  60. package/dist/core/atomic-guide-command.js.map +1 -1
  61. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  62. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  63. package/dist/core/compaction/branch-summarization.js +6 -3
  64. package/dist/core/compaction/branch-summarization.js.map +1 -1
  65. package/dist/core/compaction/compaction.d.ts.map +1 -1
  66. package/dist/core/compaction/compaction.js +23 -10
  67. package/dist/core/compaction/compaction.js.map +1 -1
  68. package/dist/core/compaction/context-compaction.d.ts +175 -0
  69. package/dist/core/compaction/context-compaction.d.ts.map +1 -0
  70. package/dist/core/compaction/context-compaction.js +1636 -0
  71. package/dist/core/compaction/context-compaction.js.map +1 -0
  72. package/dist/core/compaction/index.d.ts +1 -0
  73. package/dist/core/compaction/index.d.ts.map +1 -1
  74. package/dist/core/compaction/index.js +1 -0
  75. package/dist/core/compaction/index.js.map +1 -1
  76. package/dist/core/extensions/types.d.ts +3 -2
  77. package/dist/core/extensions/types.d.ts.map +1 -1
  78. package/dist/core/extensions/types.js.map +1 -1
  79. package/dist/core/footer-data-provider.d.ts.map +1 -1
  80. package/dist/core/footer-data-provider.js +3 -0
  81. package/dist/core/footer-data-provider.js.map +1 -1
  82. package/dist/core/index.d.ts +1 -1
  83. package/dist/core/index.d.ts.map +1 -1
  84. package/dist/core/index.js.map +1 -1
  85. package/dist/core/package-manager.d.ts.map +1 -1
  86. package/dist/core/package-manager.js +14 -7
  87. package/dist/core/package-manager.js.map +1 -1
  88. package/dist/core/session-manager.d.ts +41 -1
  89. package/dist/core/session-manager.d.ts.map +1 -1
  90. package/dist/core/session-manager.js +146 -7
  91. package/dist/core/session-manager.js.map +1 -1
  92. package/dist/core/slash-commands.d.ts.map +1 -1
  93. package/dist/core/slash-commands.js +1 -1
  94. package/dist/core/slash-commands.js.map +1 -1
  95. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +5 -5
  96. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
  97. package/dist/core/tools/ask-user-question/tool/format-answer.js +5 -5
  98. package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
  99. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +16 -3
  100. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
  101. package/dist/core/tools/ask-user-question/tool/response-envelope.js +21 -3
  102. package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
  103. package/dist/index.d.ts +4 -3
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +3 -2
  106. package/dist/index.js.map +1 -1
  107. package/dist/modes/index.d.ts +1 -1
  108. package/dist/modes/index.d.ts.map +1 -1
  109. package/dist/modes/index.js.map +1 -1
  110. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  111. package/dist/modes/interactive/components/chat-session-host.js +17 -0
  112. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  113. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
  114. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
  115. package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
  116. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
  117. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  118. package/dist/modes/interactive/components/footer.js +4 -1
  119. package/dist/modes/interactive/components/footer.js.map +1 -1
  120. package/dist/modes/interactive/components/index.d.ts +1 -0
  121. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  122. package/dist/modes/interactive/components/index.js +1 -0
  123. package/dist/modes/interactive/components/index.js.map +1 -1
  124. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  125. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  126. package/dist/modes/interactive/interactive-mode.js +75 -10
  127. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  128. package/dist/modes/rpc/rpc-client.d.ts +13 -8
  129. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  130. package/dist/modes/rpc/rpc-client.js +8 -1
  131. package/dist/modes/rpc/rpc-client.js.map +1 -1
  132. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  133. package/dist/modes/rpc/rpc-mode.js +4 -0
  134. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  135. package/dist/modes/rpc/rpc-types.d.ts +14 -3
  136. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  137. package/dist/modes/rpc/rpc-types.js.map +1 -1
  138. package/dist/utils/git-env.d.ts +10 -0
  139. package/dist/utils/git-env.d.ts.map +1 -0
  140. package/dist/utils/git-env.js +33 -0
  141. package/dist/utils/git-env.js.map +1 -0
  142. package/docs/compaction.md +185 -50
  143. package/docs/custom-provider.md +11 -9
  144. package/docs/extensions.md +46 -42
  145. package/docs/index.md +13 -6
  146. package/docs/json.md +15 -12
  147. package/docs/packages.md +2 -0
  148. package/docs/providers.md +4 -1
  149. package/docs/quickstart.md +18 -11
  150. package/docs/rpc.md +38 -23
  151. package/docs/sdk.md +17 -8
  152. package/docs/session-format.md +26 -13
  153. package/docs/sessions.md +3 -3
  154. package/docs/settings.md +2 -2
  155. package/docs/skills.md +1 -15
  156. package/docs/termux.md +9 -10
  157. package/docs/themes.md +2 -2
  158. package/docs/tmux.md +3 -3
  159. package/docs/tui.md +19 -32
  160. package/docs/usage.md +2 -2
  161. package/docs/workflows.md +60 -16
  162. package/package.json +6 -12
  163. package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
  164. package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
  165. package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
  166. package/node_modules/@earendil-works/pi-tui/README.md +0 -779
  167. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
  168. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
  169. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
  170. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
  171. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
  172. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
  173. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
  174. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
  175. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
  176. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
  177. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
  178. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
  179. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
  180. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
  181. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
  182. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
  183. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
  184. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
  185. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
  186. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
  187. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
  188. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
  189. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
  190. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
  191. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
  192. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
  193. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
  194. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
  195. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
  196. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
  197. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
  198. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
  199. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
  200. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
  201. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
  202. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
  203. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
  204. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
  205. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
  206. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
  207. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
  208. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
  209. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
  210. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
  211. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
  212. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
  213. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
  214. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
  215. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
  216. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
  217. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
  218. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
  219. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
  220. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
  221. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
  222. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
  223. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
  224. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
  225. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
  226. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
  227. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
  228. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
  229. package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
  230. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
  231. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
  232. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
  233. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
  234. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
  235. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
  236. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
  237. package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
  238. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
  239. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
  240. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
  241. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
  242. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
  243. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
  244. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
  245. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
  246. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
  247. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
  248. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
  249. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
  250. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
  251. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
  252. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
  253. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
  254. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
  255. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
  256. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
  257. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
  258. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
  259. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
  260. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
  261. package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
  262. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
  263. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
  264. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
  265. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
  266. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
  267. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
  268. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
  269. package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
  270. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
  271. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
  272. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
  273. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
  274. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
  275. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  276. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  277. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  278. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  279. package/node_modules/@earendil-works/pi-tui/package.json +0 -47
  280. package/node_modules/get-east-asian-width/index.d.ts +0 -60
  281. package/node_modules/get-east-asian-width/index.js +0 -30
  282. package/node_modules/get-east-asian-width/license +0 -9
  283. package/node_modules/get-east-asian-width/lookup-data.js +0 -21
  284. package/node_modules/get-east-asian-width/lookup.js +0 -138
  285. package/node_modules/get-east-asian-width/package.json +0 -71
  286. package/node_modules/get-east-asian-width/readme.md +0 -65
  287. package/node_modules/get-east-asian-width/utilities.js +0 -24
  288. package/node_modules/marked/LICENSE.md +0 -44
  289. package/node_modules/marked/README.md +0 -106
  290. package/node_modules/marked/bin/main.js +0 -282
  291. package/node_modules/marked/bin/marked.js +0 -15
  292. package/node_modules/marked/lib/marked.cjs +0 -2211
  293. package/node_modules/marked/lib/marked.cjs.map +0 -7
  294. package/node_modules/marked/lib/marked.d.cts +0 -728
  295. package/node_modules/marked/lib/marked.d.ts +0 -728
  296. package/node_modules/marked/lib/marked.esm.js +0 -2189
  297. package/node_modules/marked/lib/marked.esm.js.map +0 -7
  298. package/node_modules/marked/lib/marked.umd.js +0 -2213
  299. package/node_modules/marked/lib/marked.umd.js.map +0 -7
  300. package/node_modules/marked/man/marked.1 +0 -111
  301. package/node_modules/marked/man/marked.1.md +0 -92
  302. package/node_modules/marked/marked.min.js +0 -69
  303. package/node_modules/marked/package.json +0 -111
@@ -16,6 +16,9 @@ import type {
16
16
  RunStatus,
17
17
  StageStatus,
18
18
  WorkflowFailureKind,
19
+ WorkflowFailureCode,
20
+ WorkflowFailureRecoverability,
21
+ WorkflowFailureDisposition,
19
22
  WorkflowNotice,
20
23
  WorkflowChildRunRef,
21
24
  } from "./store-types.js";
@@ -43,9 +46,55 @@ function cannotPause(status: StageStatus): boolean {
43
46
 
44
47
  export interface RunEndMetadata {
45
48
  readonly failureKind?: WorkflowFailureKind;
49
+ readonly failureCode?: WorkflowFailureCode;
50
+ readonly failureRecoverability?: WorkflowFailureRecoverability;
51
+ readonly failureDisposition?: WorkflowFailureDisposition;
46
52
  readonly failureMessage?: string;
47
53
  readonly failedStageId?: string;
48
54
  readonly resumable?: boolean;
55
+ readonly retryAfterMs?: number;
56
+ }
57
+
58
+ export interface RunBlockedMetadata extends RunEndMetadata {
59
+ readonly failureRecoverability: "recoverable";
60
+ readonly failedStageId: string;
61
+ readonly resumable: true;
62
+ readonly blockedAt?: number;
63
+ }
64
+
65
+ function clearRunFailureMetadata(run: RunSnapshot): void {
66
+ delete run.error;
67
+ delete run.failureKind;
68
+ delete run.failureCode;
69
+ delete run.failureRecoverability;
70
+ delete run.failureDisposition;
71
+ delete run.failureMessage;
72
+ delete run.failedStageId;
73
+ delete run.resumable;
74
+ delete run.retryAfterMs;
75
+ delete run.blockedAt;
76
+ }
77
+
78
+ function clearStaleBlockedRunMetadata(run: RunSnapshot, metadata: RunEndMetadata | undefined): void {
79
+ if (metadata?.failureKind === undefined) delete run.failureKind;
80
+ if (metadata?.failureCode === undefined) delete run.failureCode;
81
+ if (metadata?.failureRecoverability === undefined) delete run.failureRecoverability;
82
+ if (metadata?.failureDisposition === undefined) delete run.failureDisposition;
83
+ if (metadata?.failureMessage === undefined) delete run.failureMessage;
84
+ if (metadata?.failedStageId === undefined) delete run.failedStageId;
85
+ if (metadata?.resumable === undefined) delete run.resumable;
86
+ if (metadata?.retryAfterMs === undefined) delete run.retryAfterMs;
87
+ }
88
+
89
+ function applyRunEndMetadata(run: RunSnapshot, metadata: RunEndMetadata): void {
90
+ if (metadata.failureKind !== undefined) run.failureKind = metadata.failureKind;
91
+ if (metadata.failureCode !== undefined) run.failureCode = metadata.failureCode;
92
+ if (metadata.failureRecoverability !== undefined) run.failureRecoverability = metadata.failureRecoverability;
93
+ if (metadata.failureDisposition !== undefined) run.failureDisposition = metadata.failureDisposition;
94
+ if (metadata.retryAfterMs !== undefined) run.retryAfterMs = metadata.retryAfterMs;
95
+ if (metadata.failureMessage !== undefined) run.failureMessage = metadata.failureMessage;
96
+ if (metadata.failedStageId !== undefined) run.failedStageId = metadata.failedStageId;
97
+ if (metadata.resumable !== undefined) run.resumable = metadata.resumable;
49
98
  }
50
99
 
51
100
  export type StagePromptAnswerSource = "workflow_ui" | "workflow_tool";
@@ -95,6 +144,12 @@ export interface Store {
95
144
  error?: string,
96
145
  metadata?: RunEndMetadata,
97
146
  ): boolean;
147
+ /**
148
+ * Record an active, recoverable workflow failure without ending the run.
149
+ * The run remains resumable/running and carries failure metadata for status,
150
+ * persistence restore, and continuation decisions.
151
+ */
152
+ recordRunBlocked(runId: string, error: string, metadata: RunBlockedMetadata): boolean;
98
153
  /**
99
154
  * Remove a run from live workflow history/status. Any pending HIL prompt
100
155
  * waiter is rejected because the workflow will not resume through that path.
@@ -151,6 +206,16 @@ export interface Store {
151
206
  ): boolean;
152
207
  /** Wait for a stage/node-scoped HIL prompt to resolve. */
153
208
  awaitStagePendingPrompt(runId: string, stageId: string, promptId: string): Promise<unknown>;
209
+ /**
210
+ * Record a live-only draft for an active stage-local input/editor prompt.
211
+ * Draft text may contain secrets and must never be copied into snapshots,
212
+ * status output, logs, notifications, or persisted metadata.
213
+ */
214
+ recordStagePromptDraft(runId: string, stageId: string, promptId: string, text: string): boolean;
215
+ /** Return a live-only draft for an active stage-local input/editor prompt, if present. */
216
+ getStagePromptDraft(runId: string, stageId: string, promptId: string): string | undefined;
217
+ /** Clear a live-only draft for a stage-local prompt. */
218
+ clearStagePromptDraft(runId: string, stageId: string, promptId: string): boolean;
154
219
  /**
155
220
  * Return the live-only prompt answer record for a completed prompt stage, if
156
221
  * still available. The returned value may contain secrets and must never be
@@ -239,6 +304,7 @@ export function createStore(): Store {
239
304
  const _notices: WorkflowNotice[] = [];
240
305
  const _listeners: Set<(snap: StoreSnapshot) => void> = new Set();
241
306
  const _stagePromptAnswers = new Map<string, PromptAnswerRecord>();
307
+ const _stagePromptDrafts = new Map<string, string>();
242
308
  let _version = 0;
243
309
 
244
310
  /**
@@ -285,16 +351,36 @@ export function createStore(): Store {
285
351
  return JSON.stringify([runId, stageId]);
286
352
  }
287
353
 
288
- function rejectStagePrompt(stage: StageSnapshot, reason: string): void {
354
+ function stagePromptDraftKey(runId: string, stageId: string, promptId: string): string {
355
+ return JSON.stringify([runId, stageId, promptId]);
356
+ }
357
+
358
+ function stageHasActiveTextPrompt(
359
+ runId: string,
360
+ stageId: string,
361
+ promptId: string,
362
+ ): { prompt: PendingPrompt } | undefined {
363
+ const run = findRun(runId);
364
+ if (!run || TERMINAL_STATUSES.has(run.status)) return undefined;
365
+ const stage = findStage(run, stageId);
366
+ if (!stage || isTerminalStageStatus(stage.status)) return undefined;
367
+ const prompt = stage.pendingPrompt;
368
+ if (!prompt || prompt.id !== promptId) return undefined;
369
+ if (prompt.kind !== "input" && prompt.kind !== "editor") return undefined;
370
+ return { prompt };
371
+ }
372
+
373
+ function rejectStagePrompt(runId: string, stage: StageSnapshot, reason: string): void {
289
374
  const prompt = stage.pendingPrompt;
290
375
  if (!prompt) return;
291
376
  stage.pendingPrompt = undefined;
377
+ _stagePromptDrafts.delete(stagePromptDraftKey(runId, stage.id, prompt.id));
292
378
  rejectPrompt(prompt.id, reason);
293
379
  }
294
380
 
295
- function rejectAllStagePrompts(run: RunSnapshot, reason: string): void {
381
+ function rejectAllStagePrompts(runId: string, run: RunSnapshot, reason: string): void {
296
382
  for (const stage of run.stages) {
297
- rejectStagePrompt(stage, reason);
383
+ rejectStagePrompt(runId, stage, reason);
298
384
  }
299
385
  }
300
386
 
@@ -417,6 +503,10 @@ export function createStore(): Store {
417
503
  existing.result = stage.result;
418
504
  existing.error = stage.error;
419
505
  existing.failureKind = stage.failureKind;
506
+ existing.failureCode = stage.failureCode;
507
+ existing.failureRecoverability = stage.failureRecoverability;
508
+ existing.failureDisposition = stage.failureDisposition;
509
+ existing.retryAfterMs = stage.retryAfterMs;
420
510
  existing.failureMessage = stage.failureMessage;
421
511
  existing.skippedReason = stage.skippedReason;
422
512
  if (stage.replayKey !== undefined) existing.replayKey = stage.replayKey;
@@ -427,7 +517,7 @@ export function createStore(): Store {
427
517
  if (stage.workflowChild !== undefined) existing.workflowChild = structuredClone(stage.workflowChild);
428
518
  delete existing.awaitingInputSince;
429
519
  delete existing.inputRequest;
430
- rejectStagePrompt(existing, `atomic-workflows: stage ${stage.id} ended before prompt resolved`);
520
+ rejectStagePrompt(runId, existing, `atomic-workflows: stage ${stage.id} ended before prompt resolved`);
431
521
  _version++;
432
522
  notify();
433
523
  },
@@ -454,17 +544,26 @@ export function createStore(): Store {
454
544
  run.pausedAt = undefined;
455
545
  }
456
546
  run.durationMs = elapsedRunMs(run, run.endedAt);
457
- if (status === "completed" && result !== undefined) {
458
- run.result = result;
459
- }
460
- if ((status === "failed" || status === "killed") && error !== undefined) {
461
- run.error = error;
462
- }
463
- if (metadata !== undefined) {
464
- if (metadata.failureKind !== undefined) run.failureKind = metadata.failureKind;
465
- if (metadata.failureMessage !== undefined) run.failureMessage = metadata.failureMessage;
466
- if (metadata.failedStageId !== undefined) run.failedStageId = metadata.failedStageId;
467
- if (metadata.resumable !== undefined) run.resumable = metadata.resumable;
547
+ const wasBlocked = run.blockedAt !== undefined || run.failureDisposition === "active_blocked";
548
+ delete run.blockedAt;
549
+ if (status === "completed") {
550
+ if (result !== undefined) {
551
+ run.result = result;
552
+ }
553
+ clearRunFailureMetadata(run);
554
+ } else {
555
+ if (wasBlocked && error === undefined) delete run.error;
556
+ if ((status === "failed" || status === "killed") && error !== undefined) {
557
+ run.error = error;
558
+ }
559
+ if (wasBlocked) clearStaleBlockedRunMetadata(run, metadata);
560
+ if (metadata !== undefined) applyRunEndMetadata(run, metadata);
561
+ if (run.failureDisposition === "active_blocked") delete run.failureDisposition;
562
+ if (status === "killed") {
563
+ run.failureRecoverability = "non_recoverable";
564
+ run.failureDisposition = "terminal_killed";
565
+ run.resumable = false;
566
+ }
468
567
  }
469
568
  // Abandon any waiting HIL prompt — workflow body never resumed past
470
569
  // it, but the awaiter promise must reject so the executor's catch
@@ -474,7 +573,27 @@ export function createStore(): Store {
474
573
  run.pendingPrompt = undefined;
475
574
  rejectPrompt(pending.id, `atomic-workflows: run ${runId} ended before prompt resolved`);
476
575
  }
477
- rejectAllStagePrompts(run, `atomic-workflows: run ${runId} ended before prompt resolved`);
576
+ rejectAllStagePrompts(runId, run, `atomic-workflows: run ${runId} ended before prompt resolved`);
577
+ _version++;
578
+ notify();
579
+ return true;
580
+ },
581
+
582
+ recordRunBlocked(runId: string, error: string, metadata: RunBlockedMetadata): boolean {
583
+ const run = findRun(runId);
584
+ if (!run) return false;
585
+ if (TERMINAL_STATUSES.has(run.status)) return false;
586
+ run.status = "running";
587
+ run.error = error;
588
+ run.failureKind = metadata.failureKind;
589
+ run.failureCode = metadata.failureCode;
590
+ run.failureRecoverability = metadata.failureRecoverability;
591
+ run.failureDisposition = metadata.failureDisposition;
592
+ run.failureMessage = metadata.failureMessage;
593
+ run.failedStageId = metadata.failedStageId;
594
+ run.resumable = metadata.resumable;
595
+ run.blockedAt = metadata.blockedAt ?? Date.now();
596
+ if (metadata.retryAfterMs !== undefined) run.retryAfterMs = metadata.retryAfterMs;
478
597
  _version++;
479
598
  notify();
480
599
  return true;
@@ -488,7 +607,7 @@ export function createStore(): Store {
488
607
  if (pending) {
489
608
  rejectPrompt(pending.id, `atomic-workflows: run ${runId} was removed before prompt resolved`);
490
609
  }
491
- rejectAllStagePrompts(run, `atomic-workflows: run ${runId} was removed before prompt resolved`);
610
+ rejectAllStagePrompts(runId, run, `atomic-workflows: run ${runId} was removed before prompt resolved`);
492
611
  for (const stage of run.stages) {
493
612
  _stagePromptAnswers.delete(stagePromptAnswerKey(runId, stage.id));
494
613
  }
@@ -599,6 +718,7 @@ export function createStore(): Store {
599
718
  if (!stage) return false;
600
719
  const pending = stage.pendingPrompt;
601
720
  if (!pending || pending.id !== promptId) return false;
721
+ _stagePromptDrafts.delete(stagePromptDraftKey(runId, stageId, promptId));
602
722
  if (options.recordAnswer !== false) {
603
723
  _stagePromptAnswers.set(stagePromptAnswerKey(runId, stageId), {
604
724
  runId,
@@ -654,6 +774,21 @@ export function createStore(): Store {
654
774
  });
655
775
  },
656
776
 
777
+ recordStagePromptDraft(runId: string, stageId: string, promptId: string, text: string): boolean {
778
+ if (stageHasActiveTextPrompt(runId, stageId, promptId) === undefined) return false;
779
+ _stagePromptDrafts.set(stagePromptDraftKey(runId, stageId, promptId), text);
780
+ return true;
781
+ },
782
+
783
+ getStagePromptDraft(runId: string, stageId: string, promptId: string): string | undefined {
784
+ if (stageHasActiveTextPrompt(runId, stageId, promptId) === undefined) return undefined;
785
+ return _stagePromptDrafts.get(stagePromptDraftKey(runId, stageId, promptId));
786
+ },
787
+
788
+ clearStagePromptDraft(runId: string, stageId: string, promptId: string): boolean {
789
+ return _stagePromptDrafts.delete(stagePromptDraftKey(runId, stageId, promptId));
790
+ },
791
+
657
792
  getStagePromptAnswer(runId: string, stageId: string): PromptAnswerRecord | undefined {
658
793
  return _stagePromptAnswers.get(stagePromptAnswerKey(runId, stageId));
659
794
  },
@@ -896,7 +1031,13 @@ export function createStore(): Store {
896
1031
  },
897
1032
 
898
1033
  clear(): void {
899
- if (_runs.length === 0 && _notices.length === 0 && _resolvers.size === 0 && _stagePromptAnswers.size === 0) return;
1034
+ if (
1035
+ _runs.length === 0 &&
1036
+ _notices.length === 0 &&
1037
+ _resolvers.size === 0 &&
1038
+ _stagePromptAnswers.size === 0 &&
1039
+ _stagePromptDrafts.size === 0
1040
+ ) return;
900
1041
  _runs.length = 0;
901
1042
  _notices.length = 0;
902
1043
  // Reject any outstanding HIL waiters so background promises terminate
@@ -907,6 +1048,7 @@ export function createStore(): Store {
907
1048
  }
908
1049
  _resolvers.clear();
909
1050
  _stagePromptAnswers.clear();
1051
+ _stagePromptDrafts.clear();
910
1052
  _version++;
911
1053
  notify();
912
1054
  },
@@ -6,7 +6,7 @@
6
6
  import type {
7
7
  AgentSession,
8
8
  AgentSessionEvent,
9
- CompactionResult,
9
+ ContextCompactionResult,
10
10
  CreateAgentSessionOptions,
11
11
  ModelCycleResult,
12
12
  PromptOptions,
@@ -19,7 +19,7 @@ import type * as AuthoringContract from "./authoring-contract.js";
19
19
 
20
20
  export type { TSchema };
21
21
 
22
- export type { AgentSessionEvent, CompactionResult, ModelCycleResult, PromptOptions };
22
+ export type { AgentSessionEvent, ContextCompactionResult, ModelCycleResult, PromptOptions };
23
23
 
24
24
  export type WorkflowModelValue = NonNullable<CreateAgentSessionOptions["model"]> | string;
25
25
  export type WorkflowModelUsage = AuthoringContract.WorkflowModelUsage;
@@ -308,7 +308,7 @@ export interface StageContext {
308
308
  ): Promise<{ editorText?: string; cancelled: boolean }>;
309
309
 
310
310
  /** Compaction. */
311
- compact(customInstructions?: string): Promise<CompactionResult>;
311
+ compact(): Promise<ContextCompactionResult>;
312
312
  abortCompaction(): void;
313
313
 
314
314
  /** Abort current operation. */