@bastani/atomic 0.9.20-alpha.5 → 0.9.20-alpha.7

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 (374) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +37 -0
  3. package/dist/builtin/intercom/CHANGELOG.md +10 -0
  4. package/dist/builtin/intercom/broker/broker.ts +110 -39
  5. package/dist/builtin/intercom/broker/client.ts +8 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +61 -2
  7. package/dist/builtin/intercom/live-route-refusal.ts +69 -0
  8. package/dist/builtin/intercom/package.json +2 -2
  9. package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
  10. package/dist/builtin/intercom/skills/intercom/SKILL.md +11 -11
  11. package/dist/builtin/intercom/types.ts +3 -1
  12. package/dist/builtin/mcp/package.json +2 -2
  13. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  14. package/dist/builtin/subagents/package.json +3 -3
  15. package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
  16. package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
  17. package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
  18. package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
  19. package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
  20. package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
  21. package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
  22. package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
  23. package/dist/builtin/subagents/src/extension/index.bundle.mjs +18 -8
  24. package/dist/builtin/web-access/package.json +2 -2
  25. package/dist/builtin/workflows/CHANGELOG.md +34 -0
  26. package/dist/builtin/workflows/README.md +5 -19
  27. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  28. package/dist/builtin/workflows/builtin/{chunk-7f381xnq.js → chunk-2hzrv5y8.js} +140 -21
  29. package/dist/builtin/workflows/builtin/{chunk-e83tc6nr.js → chunk-3tx8ry44.js} +3 -2
  30. package/dist/builtin/workflows/builtin/{chunk-00ywx588.js → chunk-5724b0cf.js} +1 -1
  31. package/dist/builtin/workflows/builtin/{chunk-zj5162bh.js → chunk-7bzcersz.js} +33 -22
  32. package/dist/builtin/workflows/builtin/{chunk-ne6vh5ct.js → chunk-7n51c5gh.js} +1 -1
  33. package/dist/builtin/workflows/builtin/{chunk-x2nftpgj.js → chunk-9z3ztr2a.js} +1 -1
  34. package/dist/builtin/workflows/builtin/{chunk-7h7s5xdj.js → chunk-dxjxtgmp.js} +1 -1
  35. package/dist/builtin/workflows/builtin/{chunk-tvcydq13.js → chunk-ffdrv23t.js} +1 -1
  36. package/dist/builtin/workflows/builtin/{chunk-pfm1kgqz.js → chunk-hmt5w62g.js} +12 -4
  37. package/dist/builtin/workflows/builtin/{chunk-tdqvdrg1.js → chunk-jngsbbpm.js} +3 -3
  38. package/dist/builtin/workflows/builtin/{chunk-55p5dxjk.js → chunk-njmf5ze7.js} +1 -1
  39. package/dist/builtin/workflows/builtin/{chunk-evfb0312.js → chunk-vn0wb31x.js} +1 -1
  40. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  41. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  42. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  43. package/dist/builtin/workflows/builtin/goal.js +4 -4
  44. package/dist/builtin/workflows/builtin/index.js +12 -12
  45. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  46. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  47. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  48. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  49. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  50. package/dist/builtin/workflows/package.json +2 -2
  51. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +10 -9
  52. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +4 -4
  53. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +96 -23
  54. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +75 -27
  55. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +72 -26
  56. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +58 -22
  57. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +118 -0
  58. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +70 -29
  59. package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +1 -1
  60. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +95 -32
  61. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +79 -30
  62. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +139 -0
  63. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -4
  64. package/dist/builtin/workflows/src/extension/index.bundle.mjs +446 -639
  65. package/dist/builtin/workflows/src/index.js +1434 -1277
  66. package/dist/cli/args.d.ts.map +1 -1
  67. package/dist/cli/args.js +15 -4
  68. package/dist/cli/args.js.map +1 -1
  69. package/dist/cli/file-processor.d.ts +1 -1
  70. package/dist/cli/file-processor.d.ts.map +1 -1
  71. package/dist/cli/file-processor.js.map +1 -1
  72. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  73. package/dist/core/agent-session-auto-compaction.js +40 -12
  74. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  75. package/dist/core/agent-session-bash.d.ts.map +1 -1
  76. package/dist/core/agent-session-bash.js +9 -8
  77. package/dist/core/agent-session-bash.js.map +1 -1
  78. package/dist/core/agent-session-boundaries.d.ts +68 -0
  79. package/dist/core/agent-session-boundaries.d.ts.map +1 -0
  80. package/dist/core/agent-session-boundaries.js +334 -0
  81. package/dist/core/agent-session-boundaries.js.map +1 -0
  82. package/dist/core/agent-session-compaction.js +1 -1
  83. package/dist/core/agent-session-compaction.js.map +1 -1
  84. package/dist/core/agent-session-events.d.ts.map +1 -1
  85. package/dist/core/agent-session-events.js +27 -13
  86. package/dist/core/agent-session-events.js.map +1 -1
  87. package/dist/core/agent-session-export.d.ts.map +1 -1
  88. package/dist/core/agent-session-export.js +16 -20
  89. package/dist/core/agent-session-export.js.map +1 -1
  90. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  91. package/dist/core/agent-session-message-queue.js +6 -3
  92. package/dist/core/agent-session-message-queue.js.map +1 -1
  93. package/dist/core/agent-session-methods.d.ts +33 -4
  94. package/dist/core/agent-session-methods.d.ts.map +1 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  97. package/dist/core/agent-session-persistent-custom-messages.js +2 -1
  98. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  99. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  100. package/dist/core/agent-session-prompt.js +93 -25
  101. package/dist/core/agent-session-prompt.js.map +1 -1
  102. package/dist/core/agent-session-retry.d.ts.map +1 -1
  103. package/dist/core/agent-session-retry.js +4 -9
  104. package/dist/core/agent-session-retry.js.map +1 -1
  105. package/dist/core/agent-session-runtime.d.ts +4 -0
  106. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  107. package/dist/core/agent-session-runtime.js +7 -1
  108. package/dist/core/agent-session-runtime.js.map +1 -1
  109. package/dist/core/agent-session-tasks.d.ts +9 -0
  110. package/dist/core/agent-session-tasks.d.ts.map +1 -1
  111. package/dist/core/agent-session-tasks.js +68 -16
  112. package/dist/core/agent-session-tasks.js.map +1 -1
  113. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  114. package/dist/core/agent-session-tool-hooks.js +15 -5
  115. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  116. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  117. package/dist/core/agent-session-tool-registry.js +9 -21
  118. package/dist/core/agent-session-tool-registry.js.map +1 -1
  119. package/dist/core/agent-session-tree.d.ts.map +1 -1
  120. package/dist/core/agent-session-tree.js +2 -3
  121. package/dist/core/agent-session-tree.js.map +1 -1
  122. package/dist/core/agent-session-types.d.ts +8 -0
  123. package/dist/core/agent-session-types.d.ts.map +1 -1
  124. package/dist/core/agent-session-types.js.map +1 -1
  125. package/dist/core/agent-session.d.ts +18 -2
  126. package/dist/core/agent-session.d.ts.map +1 -1
  127. package/dist/core/agent-session.js +22 -3
  128. package/dist/core/agent-session.js.map +1 -1
  129. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  130. package/dist/core/compaction/branch-summarization.js +1 -0
  131. package/dist/core/compaction/branch-summarization.js.map +1 -1
  132. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  133. package/dist/core/compaction/compaction-boundary.js +11 -6
  134. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  135. package/dist/core/compaction/compaction.d.ts +3 -1
  136. package/dist/core/compaction/compaction.d.ts.map +1 -1
  137. package/dist/core/compaction/compaction.js +37 -0
  138. package/dist/core/compaction/compaction.js.map +1 -1
  139. package/dist/core/crash-log.d.ts +6 -0
  140. package/dist/core/crash-log.d.ts.map +1 -0
  141. package/dist/core/crash-log.js +69 -0
  142. package/dist/core/crash-log.js.map +1 -0
  143. package/dist/core/execution-model-router.d.ts +15 -0
  144. package/dist/core/execution-model-router.d.ts.map +1 -1
  145. package/dist/core/execution-model-router.js +82 -33
  146. package/dist/core/execution-model-router.js.map +1 -1
  147. package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
  148. package/dist/core/export-html/template.js +6 -1
  149. package/dist/core/extensions/agent-events.d.ts +69 -3
  150. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  151. package/dist/core/extensions/agent-events.js.map +1 -1
  152. package/dist/core/extensions/api-types.d.ts +5 -3
  153. package/dist/core/extensions/api-types.d.ts.map +1 -1
  154. package/dist/core/extensions/api-types.js.map +1 -1
  155. package/dist/core/extensions/event-results.d.ts +3 -0
  156. package/dist/core/extensions/event-results.d.ts.map +1 -1
  157. package/dist/core/extensions/event-results.js.map +1 -1
  158. package/dist/core/extensions/event-types.d.ts +2 -2
  159. package/dist/core/extensions/event-types.d.ts.map +1 -1
  160. package/dist/core/extensions/event-types.js.map +1 -1
  161. package/dist/core/extensions/index.d.ts +1 -1
  162. package/dist/core/extensions/index.d.ts.map +1 -1
  163. package/dist/core/extensions/index.js.map +1 -1
  164. package/dist/core/extensions/provider-types.d.ts +2 -0
  165. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  166. package/dist/core/extensions/provider-types.js.map +1 -1
  167. package/dist/core/extensions/runner-events.d.ts +16 -2
  168. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  169. package/dist/core/extensions/runner-events.js +98 -5
  170. package/dist/core/extensions/runner-events.js.map +1 -1
  171. package/dist/core/extensions/runner.d.ts +3 -2
  172. package/dist/core/extensions/runner.d.ts.map +1 -1
  173. package/dist/core/extensions/runner.js +4 -1
  174. package/dist/core/extensions/runner.js.map +1 -1
  175. package/dist/core/fast-model-variants.d.ts +16 -0
  176. package/dist/core/fast-model-variants.d.ts.map +1 -1
  177. package/dist/core/fast-model-variants.js +27 -0
  178. package/dist/core/fast-model-variants.js.map +1 -1
  179. package/dist/core/index.d.ts +1 -1
  180. package/dist/core/index.d.ts.map +1 -1
  181. package/dist/core/index.js.map +1 -1
  182. package/dist/core/messages.d.ts +10 -0
  183. package/dist/core/messages.d.ts.map +1 -1
  184. package/dist/core/messages.js +57 -0
  185. package/dist/core/messages.js.map +1 -1
  186. package/dist/core/model-config.d.ts +52 -0
  187. package/dist/core/model-config.d.ts.map +1 -1
  188. package/dist/core/model-config.js +16 -0
  189. package/dist/core/model-config.js.map +1 -1
  190. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  191. package/dist/core/model-resolver-defaults.js +2 -1
  192. package/dist/core/model-resolver-defaults.js.map +1 -1
  193. package/dist/core/model-runtime.d.ts +13 -1
  194. package/dist/core/model-runtime.d.ts.map +1 -1
  195. package/dist/core/model-runtime.js +16 -1
  196. package/dist/core/model-runtime.js.map +1 -1
  197. package/dist/core/prompt-templates-async.d.ts +2 -2
  198. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  199. package/dist/core/prompt-templates-async.js +57 -29
  200. package/dist/core/prompt-templates-async.js.map +1 -1
  201. package/dist/core/prompt-templates.d.ts +6 -1
  202. package/dist/core/prompt-templates.d.ts.map +1 -1
  203. package/dist/core/prompt-templates.js +61 -35
  204. package/dist/core/prompt-templates.js.map +1 -1
  205. package/dist/core/provider-composer-internal.d.ts +1 -0
  206. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  207. package/dist/core/provider-composer-internal.js +19 -0
  208. package/dist/core/provider-composer-internal.js.map +1 -1
  209. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  210. package/dist/core/resource-loader-assets.js +6 -6
  211. package/dist/core/resource-loader-assets.js.map +1 -1
  212. package/dist/core/sdk-types.d.ts +5 -0
  213. package/dist/core/sdk-types.d.ts.map +1 -1
  214. package/dist/core/sdk-types.js.map +1 -1
  215. package/dist/core/sdk.d.ts.map +1 -1
  216. package/dist/core/sdk.js +7 -2
  217. package/dist/core/sdk.js.map +1 -1
  218. package/dist/core/session-manager-core.d.ts +10 -3
  219. package/dist/core/session-manager-core.d.ts.map +1 -1
  220. package/dist/core/session-manager-core.js +65 -7
  221. package/dist/core/session-manager-core.js.map +1 -1
  222. package/dist/core/session-manager-entries.d.ts +4 -1
  223. package/dist/core/session-manager-entries.d.ts.map +1 -1
  224. package/dist/core/session-manager-entries.js +8 -0
  225. package/dist/core/session-manager-entries.js.map +1 -1
  226. package/dist/core/session-manager-history.d.ts +16 -1
  227. package/dist/core/session-manager-history.d.ts.map +1 -1
  228. package/dist/core/session-manager-history.js +105 -42
  229. package/dist/core/session-manager-history.js.map +1 -1
  230. package/dist/core/session-manager-types.d.ts +30 -3
  231. package/dist/core/session-manager-types.d.ts.map +1 -1
  232. package/dist/core/session-manager-types.js.map +1 -1
  233. package/dist/core/session-manager.d.ts +2 -2
  234. package/dist/core/session-manager.d.ts.map +1 -1
  235. package/dist/core/session-manager.js +1 -1
  236. package/dist/core/session-manager.js.map +1 -1
  237. package/dist/core/settings-types.js.map +1 -1
  238. package/dist/core/structured-output/index.d.ts +1 -1
  239. package/dist/core/structured-output/index.d.ts.map +1 -1
  240. package/dist/core/structured-output/index.js +37 -41
  241. package/dist/core/structured-output/index.js.map +1 -1
  242. package/dist/core/structured-output/jev-client.d.ts +13 -8
  243. package/dist/core/structured-output/jev-client.d.ts.map +1 -1
  244. package/dist/core/structured-output/jev-client.js +90 -32
  245. package/dist/core/structured-output/jev-client.js.map +1 -1
  246. package/dist/core/structured-output/jev.d.ts.map +1 -1
  247. package/dist/core/structured-output/jev.js +38 -64
  248. package/dist/core/structured-output/jev.js.map +1 -1
  249. package/dist/core/structured-output/resolver.d.ts +32 -24
  250. package/dist/core/structured-output/resolver.d.ts.map +1 -1
  251. package/dist/core/structured-output/resolver.js +57 -9
  252. package/dist/core/structured-output/resolver.js.map +1 -1
  253. package/dist/core/structured-output/types.d.ts +8 -6
  254. package/dist/core/structured-output/types.d.ts.map +1 -1
  255. package/dist/core/structured-output/types.js.map +1 -1
  256. package/dist/core/system-prompt.js +1 -1
  257. package/dist/core/system-prompt.js.map +1 -1
  258. package/dist/core/tasks/child-command-owner.d.ts +34 -0
  259. package/dist/core/tasks/child-command-owner.d.ts.map +1 -0
  260. package/dist/core/tasks/child-command-owner.js +70 -0
  261. package/dist/core/tasks/child-command-owner.js.map +1 -0
  262. package/dist/core/tools/bash-pty-native.d.ts +5 -1
  263. package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
  264. package/dist/core/tools/bash-pty-native.js +15 -7
  265. package/dist/core/tools/bash-pty-native.js.map +1 -1
  266. package/dist/core/tools/kill.d.ts +2 -2
  267. package/dist/core/tools/kill.d.ts.map +1 -1
  268. package/dist/core/tools/kill.js +3 -4
  269. package/dist/core/tools/kill.js.map +1 -1
  270. package/dist/core/tools/read.d.ts +4 -0
  271. package/dist/core/tools/read.d.ts.map +1 -1
  272. package/dist/core/tools/read.js +5 -1
  273. package/dist/core/tools/read.js.map +1 -1
  274. package/dist/index-extensions.d.ts +1 -1
  275. package/dist/index-extensions.d.ts.map +1 -1
  276. package/dist/index-extensions.js.map +1 -1
  277. package/dist/index.d.ts +4 -4
  278. package/dist/index.d.ts.map +1 -1
  279. package/dist/index.js +4 -4
  280. package/dist/index.js.map +1 -1
  281. package/dist/main-app-mode.d.ts +1 -1
  282. package/dist/main-app-mode.d.ts.map +1 -1
  283. package/dist/main-app-mode.js +3 -2
  284. package/dist/main-app-mode.js.map +1 -1
  285. package/dist/main.d.ts.map +1 -1
  286. package/dist/main.js +1 -1
  287. package/dist/main.js.map +1 -1
  288. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  289. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  290. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  291. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  292. package/dist/modes/interactive/components/tree-selector-model.js +1 -0
  293. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  294. package/dist/modes/interactive/interactive-agent-events.js +17 -1
  295. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  296. package/dist/modes/interactive/interactive-auth-login.js +2 -4
  297. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  298. package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
  299. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  300. package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
  301. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  302. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  303. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  304. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  305. package/dist/modes/interactive/interactive-process-lifecycle.js +13 -1
  306. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  307. package/dist/modes/interactive/interactive-session-runtime.js +5 -1
  308. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  309. package/dist/modes/interactive-engine/isolated-auth.d.ts +16 -0
  310. package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
  311. package/dist/modes/interactive-engine/isolated-auth.js +27 -0
  312. package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
  313. package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -0
  314. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  315. package/dist/modes/interactive-engine/isolated-runtime.js +4 -1
  316. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  317. package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
  318. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  319. package/dist/modes/rpc/rpc-client-api.js +7 -2
  320. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  321. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  322. package/dist/modes/rpc/rpc-command-handler.js +3 -1
  323. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  324. package/dist/modes/rpc/rpc-provider-auth.d.ts +2 -1
  325. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
  326. package/dist/modes/rpc/rpc-provider-auth.js +2 -2
  327. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
  328. package/dist/modes/rpc/rpc-types.d.ts +2 -0
  329. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  330. package/dist/modes/rpc/rpc-types.js.map +1 -1
  331. package/dist/utils/mime.js +1 -1
  332. package/dist/utils/mime.js.map +1 -1
  333. package/dist/utils/tool-result-images.d.ts +3 -1
  334. package/dist/utils/tool-result-images.d.ts.map +1 -1
  335. package/dist/utils/tool-result-images.js +4 -1
  336. package/dist/utils/tool-result-images.js.map +1 -1
  337. package/docs/background-tasks.md +11 -2
  338. package/docs/compaction.md +5 -1
  339. package/docs/computer-use.md +105 -56
  340. package/docs/environment-variables.md +1 -1
  341. package/docs/extensions/events.md +75 -7
  342. package/docs/extensions.md +6 -2
  343. package/docs/getting-started/first-session.md +3 -2
  344. package/docs/intercom/operations.md +13 -1
  345. package/docs/intercom.md +1 -1
  346. package/docs/llama-cpp.md +2 -2
  347. package/docs/models/evals.md +108 -118
  348. package/docs/models/reference.md +31 -3
  349. package/docs/packages.md +2 -0
  350. package/docs/prompt-templates.md +1 -0
  351. package/docs/providers.md +19 -6
  352. package/docs/reference/cli.md +2 -2
  353. package/docs/rpc/examples.md +2 -0
  354. package/docs/sdk/reference.md +2 -3
  355. package/docs/sdk/structured-decisions.md +25 -18
  356. package/docs/sdk.md +13 -2
  357. package/docs/session-format.md +17 -2
  358. package/docs/settings.md +8 -8
  359. package/docs/skills.md +8 -2
  360. package/docs/subagents/reference.md +4 -4
  361. package/docs/subagents.md +2 -2
  362. package/docs/workflows/api-reference.md +7 -34
  363. package/docs/workflows/authoring.md +191 -0
  364. package/docs/workflows/builtins.md +1 -1
  365. package/docs/workflows/operations.md +18 -78
  366. package/docs/workflows/reliable-design.md +14 -29
  367. package/docs/workflows/verification.md +21 -8
  368. package/docs/workflows.md +8 -7
  369. package/examples/rpc-client.ts +38 -0
  370. package/examples/rpc-extension-ui.ts +19 -5
  371. package/examples/sdk/README.md +1 -1
  372. package/npm-shrinkwrap.json +69 -69
  373. package/package.json +8 -8
  374. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +0 -58
@@ -12575,6 +12575,7 @@ function currentModelFullId(model) {
12575
12575
 
12576
12576
  // dist/builtin/subagents/src/runs/shared/model-router.ts
12577
12577
  import {
12578
+ AutoRoutingInferenceError,
12578
12579
  parseModelConstraints as parseModelConstraints2,
12579
12580
  routeExecutionModel
12580
12581
  } from "@bastani/atomic";
@@ -12582,13 +12583,22 @@ async function routeSubagentModel(input) {
12582
12583
  const { ctx, agent } = input;
12583
12584
  const constraints = structuredClone([parseModelConstraints2(agent.modelConstraints), parseModelConstraints2(input.modelConstraints)].filter((c) => c !== undefined));
12584
12585
  const effortOverride = agent.source === "builtin" && agent.thinking !== "" ? agent.thinking : undefined;
12585
- const route = await routeExecutionModel({
12586
- ctx,
12587
- task: input.task?.trim() ? input.task : agent.systemPrompt,
12588
- agent: { name: agent.name, description: agent.description },
12589
- constraints: effortOverride === undefined ? constraints : [...constraints, { allowedEfforts: [effortOverride] }],
12590
- signal: input.signal
12591
- });
12586
+ let route;
12587
+ try {
12588
+ route = await routeExecutionModel({
12589
+ ctx,
12590
+ task: input.task?.trim() ? input.task : agent.systemPrompt,
12591
+ agent: { name: agent.name, description: agent.description },
12592
+ constraints: effortOverride === undefined ? constraints : [...constraints, { allowedEfforts: [effortOverride] }],
12593
+ signal: input.signal
12594
+ });
12595
+ } catch (error) {
12596
+ input.signal?.throwIfAborted();
12597
+ if (!(error instanceof AutoRoutingInferenceError) || error.currentModelRoute === undefined)
12598
+ throw error;
12599
+ route = error.currentModelRoute;
12600
+ console.warn(`Subagent auto routing failed; running "${agent.name}" on the current chat model ${route.modelOverride}.`);
12601
+ }
12592
12602
  const fallbackRoute = effortOverride === undefined ? route : await routeExecutionModel({
12593
12603
  ctx,
12594
12604
  task: input.task?.trim() ? input.task : agent.systemPrompt,
@@ -17326,7 +17336,7 @@ function parseSubagentNotifyContent(content) {
17326
17336
  // dist/builtin/subagents/src/extension/prompt-guidance.ts
17327
17337
  var DEFAULT_PROMPT_GUIDANCE = [
17328
17338
  `**Subagent orchestration**: Use subagents for focused specialist work inside workflows or as bounded delegation when a workflow would be unnecessary overhead.
17329
- - When workflow is available, call workflow route with the actual request, relevant message text/document excerpts, and explicit constraints in state, not file paths in place of content. Pass the user's own words; the router judges whether a workflow fits and whether the user asked for inline or workflow execution, so do not pass your own routing preference. If it returns none, continue inline. Otherwise use its input contract to prepare inputs, then call workflow run with the registered workflow ID. Ask only for genuinely missing information.
17339
+ - When the workflow tool is available, decide yourself whether a workflow fits. Prefer one for well-defined work that benefits from durable stages, review loops, recovery or approval gates, and let its stages delegate specialists; work inline for discussion, unclear goals, simple bounded work, or when the user asks to work inline or quickly. Launch with workflow run using the registered workflow name and inputs matching its contract.
17330
17340
  - Honor the user's task-scoped execution preferences without hidden/nested workflows or pressure to reapprove. Preserve appropriate testing, review and evidence inline, and unrelated safety and authorization constraints.
17331
17341
  - On a switch from an active workflow to inline, notify the controlling session to safely hold/stop the affected run, reconcile completed work and in-flight side effects, then continue inline without duplicate execution. Do not claim completed work was undone.
17332
17342
  - Use a single subagent for a focused specialty or parallel tasks for independent work. Keep substantial-overlap tasks together rather than duplicating investigation across agents.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.20-alpha.5",
3
+ "version": "0.9.20-alpha.7",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@bastani/atomic": "*",
34
- "@earendil-works/pi-tui": "^0.86.1"
34
+ "@earendil-works/pi-tui": "^0.87.1"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@bastani/atomic": {
@@ -6,6 +6,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.20-alpha.7] - 2026-09-22
10
+
11
+ ### Breaking Changes
12
+
13
+ - Removed the `workflow` tool's `route` action and its router classifier. The agent now decides itself whether a workflow fits and launches with `workflow({ action: "run", workflow: "<name>", inputs, budget? })`. The `workflowId` reservation, `state` parameter, `routerDecision`, `estimatedDuration` labels, and `needs_input`/`not_launched`/`reserved` statuses are gone; `run` validates inputs and fails without launching when they are invalid. Runs launched through the model tool still belong to the launching session.
14
+
15
+ ### Changed
16
+
17
+ - Generalized the prompt-engineering GPT-6 guide (`references/gpt_6.md`, formerly `gpt_6_astra.md`) to cover GPT-6 Sol and Luna, and replaced its paraphrased snippets with OpenAI's official GPT-6 prompt templates for follow-through, approval timing, skill-instruction priority, writing style, delegation, and verification.
18
+ - Focused every prompt-engineering model guide on prompts: removed API request settings such as beta headers, output-token limits, sampling parameters, tool-choice values, API paths, and pricing, while keeping prompt-ordering and caching guidance.
19
+ - Added source-attributed Claude Opus 5.5 guidance to the prompt-engineering skill, covering effort calibration, always-on thinking, progress visibility, bounded unattended completion, and API migration checks.
20
+ - Reworked all nine prompt-engineering model guides around observed behaviors, practical prompt adjustments, adaptable examples, and caveats, with API details kept secondary.
21
+ - `/new`, `/fork`, and `/resume` now quit running workflows instead of leaving them detached from the session that launched them, where their next stage would later fail. When workflows are running, Atomic first asks "Quit N running workflows and …?" and explains that each stops at its last checkpoint and can be resumed with `/workflow resume`; declining cancels the command and the runs keep going. Without an interactive UI the switch proceeds and the runs are quit the same way. `/reload` still keeps runs executing ([#3203](https://github.com/bastani-inc/atomic/issues/3203)).
22
+
23
+ ### Fixed
24
+
25
+ - A workflow run that stays in flight across a preserving host `/reload` can now create stages after the reload. Stage session creation and the stage model catalog resolve the newest live extension generation instead of the retired launch `pi` and command ctx, so the next stage no longer fails with `This extension ctx is stale after session replacement or reload` and no longer falls back to `workflows: model catalog unavailable` ([#3201](https://github.com/bastani-inc/atomic/issues/3201)).
26
+ - A Goal run with `create_pr=true` could never be resumed after its `pull-request` stage failed with a recoverable error. Every resume failed with `insufficient_state: replay topology mismatch for stage "pull-request"` yet still reported `resumable: true`. On resume, Goal reloads its persisted ledger, which already recorded the approving review round as `complete`, so the turn loop was skipped and `pull-request` ran without its reviewer parents. Goal now replays the turns recorded in a reloaded ledger from their durable checkpoints, so the resume re-executes only the failed stage ([#3207](https://github.com/bastani-inc/atomic/issues/3207)).
27
+ - Resuming a Goal run no longer duplicates its ledger history. A replayed turn (one the reloaded ledger already recorded) appended another reducer decision, lifecycle events, a convergence record and reverification entries for the same turn, so the ledger and the final PR report showed repeated history after a resume. Replayed turns are now read-only for the ledger; only live turns append and persist new outcomes ([#3207](https://github.com/bastani-inc/atomic/issues/3207)).
28
+ - A workflow stage with `model: "auto"` no longer fails when routing inference fails completely (Jev and the chat structured-output fallback both). The stage now runs on the current chat model with a recorded warning, on fresh runs and resumes alike, when that model is available and satisfies every routing constraint; validation, eligibility, credential-screening failures and cancellation still fail the stage ([#3206](https://github.com/bastani-inc/atomic/issues/3206)).
29
+
30
+ ## [0.9.20-alpha.6] - 2026-09-22
31
+
32
+ ### Changed
33
+
34
+ - Goal and Ralph end-to-end verification guidance and the workflow-authoring guidance now direct desktop, simulator, and emulator verification to Cua Driver: builtin stages load the bundled `cua-driver` skill and drive the exact window with `cua-driver call <tool>` under `CUA_DRIVER_RS_TELEMETRY_ENABLED=false`, save `get_window_state` JSON and `screenshot_out_file` images as evidence, and report a missing permission, session, or refused install as `blocked`/`needs_human` with exact remediation; custom workflows run code-owned scenarios with the `@trycua/cua-driver` SDK inside `ctx.tool` with `timeoutMs` and `signal`, after a preflight `ctx.tool` that exits `blocked` on missing permissions. The OpenAI CUA sample-app reference was removed ([#3181](https://github.com/bastani-inc/atomic/issues/3181)).
35
+
36
+ ### Fixed
37
+
38
+ - Docker fallback Postgres is no longer treated as ready when the published port accepts TCP during `initdb`. Atomic waits for a PostgreSQL query using the endpoint, credentials and TLS settings DBOS will use, retries transient startup resets and refusals (including a connection that terminates while the container is still starting), and shuts down a failed DBOS executor before continuing with the in-memory backend. Invalid readiness ports now fail before connecting rather than leaving a delayed process-crashing error.
39
+ - Failed DBOS executor cleanup no longer permits a second launch or an in-memory fallback with unconfirmed executor ownership; startup reports the initialization and cleanup errors instead.
40
+ - New Docker fallback containers now publish on the configured `PGPORT`, matching the readiness probe and DBOS connection instead of always binding host port 5432.
41
+ - A schema-backed workflow stage whose prompt resolves without any assistant message is no longer recorded as a successful model attempt and pushed into `structured_output` correction prompts. The empty completion is now classified as a transient provider failure at the execution layer: it is retried on the same model using the configured `settings.retry` budget, then advances to the next configured fallback, and its attempt record carries `Model turn ended without an assistant message after the prompt (empty completion)` instead of the structured-output contract error. Genuine cancellation during such a turn stops both the retries and the fallback chain, and corrective prompts remain reserved for turns that actually answered without calling the tool ([#3164](https://github.com/bastani-inc/atomic/issues/3164)).
42
+
9
43
  ## [0.9.20-alpha.5] - 2026-09-20
10
44
 
11
45
  ### Breaking Changes
@@ -5,7 +5,7 @@
5
5
  An open-source Atomic workflow extension: install it, author workflows in TypeScript, run them from chat.
6
6
  </p>
7
7
 
8
- Call `workflow route` with the actual request, relevant message text/document excerpts, and explicit constraints in `state`, not file paths in place of content. If it returns `none`, continue inline. Otherwise use its input contract to prepare inputs, then call `workflow run` with the registered workflow ID. Ask only for genuinely missing information.
8
+ The agent decides whether a workflow fits. Well-defined, authorized work that benefits from durable stages, checkpoints, dependencies, recovery, review loops or approval gates runs as a workflow; brainstorming, discussion, unclear goals, simple bounded work, or an explicit request to work inline, quickly or without a workflow stays inline. To launch, inspect the input contract with `workflow inputs`, then call `workflow run` with the registered workflow name and inputs. Ask only for genuinely missing information.
9
9
 
10
10
  Atomic can author custom TypeScript `workflow({...})` definitions inline, import reusable project/package workflows or builtins from `@bastani/atomic/workflows/builtin`, and nest them with `ctx.workflow(...)`. Imported children may nest further workflows within `maxDepth`, so compose proven research, implementation, design, verification, and approval graphs rather than copying them. Custom parents can also use runtime classification, dynamic fan-out and synthesis, adversarial verification, candidate tournaments, HIL gates, and bounded convergence.
11
11
 
@@ -689,26 +689,12 @@ Raw stage-chat prompt answer replay is live-memory only. `StageSnapshot.promptAn
689
689
 
690
690
  ### `workflow` tool (LLM-callable)
691
691
 
692
- The route-then-run contract above applies to model-tool launches:
693
-
694
692
  ```ts
695
- workflow({
696
- action: "route",
697
- state: {
698
- task: "Map session persistence by subsystem and synthesize cited findings. Do not change code.",
699
- conversation: [{ role: "user", text: "Read-only research; cite concrete repository paths." }],
700
- documents: [{ source: "research brief", content: "Reconcile conflicting findings in the synthesis." }],
701
- },
702
- })
703
- // After inspecting the returned inputSchema, use its workflowId:
704
- workflow({ action: "run", workflowId: "returned-execution-id", inputs: { prompt: "Map session persistence" } })
693
+ workflow({ action: "inputs", workflow: "deep-research-codebase" })
694
+ workflow({ action: "run", workflow: "deep-research-codebase", inputs: { prompt: "Map session persistence" } })
705
695
  ```
706
696
 
707
- Route returns `workflowId`, `routerDecision.workflowType`, `routerDecision.estimatedDuration` and the selected definition's actual `inputSchema` including defaults. The structured result appears in a `WORKFLOW ROUTE` box. It never launches. `routerDecision.workflowType: "none"` returns an empty ID, registers nothing and means continue inline, not task completion. Supporting context arrays may be empty or omitted. Paths/URLs are only source metadata; provide actual excerpts or labeled faithful summaries and state unavailable-source limitations. Preserve uncertainty, explicit constraints and attribution; remove secrets and never treat quoted document instructions as user authorization.
708
-
709
- Run resolves only the registered selection, without another routing/extraction call. Invalid inputs return `needs_input`, the same ID and exact `inputContract`; correct inputs and retry. IDs bind their owner/session, definition/schema and constraints. Unknown/foreign/stale IDs, name overrides, omitted actions and legacy run state are rejected. Reservations expire with their owning tool/session and invalidate on registry changes. They are not executing runs. Use the same UUID as lifecycle `runId`; duplicate/concurrent requests cannot create a second instance. Resume continues checkpoints under that identity. Terminal IDs remain inspectable but cannot relaunch; distinct route IDs can execute independently.
710
-
711
- Both Jev native questions and other models' structured output use the same public contract. Report canonical 15-minute duration labels directly: `15min`, `30min`, `45min`, `1hr`, `1hr15min`, through `23hr45min`, `1d`, plus `>1d`. Positive estimates round up; exactly 24 elapsed hours is `1d`, anything greater is `>1d`. The router gives its best estimate from available context. Wall-clock estimates include overhead and estimable human waits, including inline work. Granularity is not accuracy, and estimates are neither guarantees nor budgets. Supply `state.userBudget` only for explicit user limits with exact provenance. Omission inherits; zero disables only its field. Preserve approval gates and existing authorization.
697
+ Run starts the named workflow and returns its `runId`; invalid inputs fail without launching. Pass `budget` only for limits the user stated; omission inherits and zero disables only its field.
712
698
 
713
699
  User `/workflow` commands launch directly and authored `ctx.workflow(...)` remains internal composition. Discovery (`list`, `get`, `inputs`, `models`), inspection (`status`, `stages`, `stage`, `transcript`), controls (`answer`, `pause`, `resume`, `quit`) and `reload` remain available. See [operations](../coding-agent/docs/workflows/operations.md) for parameters and lifecycle details.
714
700
 
@@ -765,7 +751,7 @@ export default workflow({
765
751
  });
766
752
  ```
767
753
 
768
- The `workflow` tool accepts routing (`route` with `state`), registered execution (`run` with `workflowId` and `inputs`), discovery, inspection, pending-prompt answers, run control, and reload. Author stage graphs with `ctx.task`, `ctx.chain`, and `ctx.parallel` inside workflow definitions.
754
+ The `workflow` tool accepts direct workflow execution (`run` with workflow name and `inputs`), discovery, inspection, pending-prompt answers, run control, and reload. Author stage graphs with `ctx.task`, `ctx.chain`, and `ctx.parallel` inside workflow definitions.
769
755
 
770
756
  For large handoffs, prefer artifact paths over prompt injection: write stage output to `output`, set `outputMode: "file-only"` when the parent only needs the path, pass paths with `reads`, and instruct downstream agents explicitly with wording like `Read the file at <path>...`. Reserve `previous`/`{previous}` for compact summaries; avoid passing full session histories, all prior stage outputs, or every review round directly into the next model prompt. In review loops, save JSON review artifacts and pass only the latest review-round artifact, with a ledger or index file linking older rounds when needed.
771
757
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  adversarial_verification_default
3
- } from "./chunk-7h7s5xdj.js";
3
+ } from "./chunk-dxjxtgmp.js";
4
4
  import"./chunk-2377r57g.js";
5
5
  import"./chunk-n1910xc4.js";
6
- import"./chunk-00ywx588.js";
7
- import"./chunk-e83tc6nr.js";
6
+ import"./chunk-5724b0cf.js";
7
+ import"./chunk-3tx8ry44.js";
8
8
  export {
9
9
  adversarial_verification_default as default
10
10
  };
@@ -5125,6 +5125,36 @@ function getDbosProcessOwner() {
5125
5125
  // dist/builtin/workflows/src/durable/dbos-sdk-handle.ts
5126
5126
  var ATOMIC_EXECUTOR_ID = `atomic-${process.pid.toString(36)}-${crypto.randomUUID().slice(0, 8)}`;
5127
5127
 
5128
+ // ../../node_modules/pg/esm/index.mjs
5129
+ var import_lib = __toESM(require_lib2(), 1);
5130
+ var Client = import_lib.default.Client;
5131
+ var Pool = import_lib.default.Pool;
5132
+ var Connection = import_lib.default.Connection;
5133
+ var types = import_lib.default.types;
5134
+ var Query = import_lib.default.Query;
5135
+ var DatabaseError = import_lib.default.DatabaseError;
5136
+ var escapeIdentifier = import_lib.default.escapeIdentifier;
5137
+ var escapeLiteral = import_lib.default.escapeLiteral;
5138
+ var Result = import_lib.default.Result;
5139
+ var TypeOverrides = import_lib.default.TypeOverrides;
5140
+ var defaults = import_lib.default.defaults;
5141
+
5142
+ // dist/builtin/workflows/src/durable/dbos-default-postgres-url.ts
5143
+ function defaultPostgresUrl(database, host = process.env.PGHOST || "localhost", port = process.env.PGPORT || "5432") {
5144
+ const url = new URL("postgresql://localhost");
5145
+ url.pathname = `/${database}`;
5146
+ if (host.startsWith("/") || host.includes(":"))
5147
+ url.searchParams.set("host", host);
5148
+ else
5149
+ url.hostname = host;
5150
+ url.port = port;
5151
+ url.username = encodeURIComponent(process.env.PGUSER || "postgres");
5152
+ url.password = encodeURIComponent(process.env.PGPASSWORD || "dbos");
5153
+ url.searchParams.set("connect_timeout", process.env.PGCONNECT_TIMEOUT || "10");
5154
+ url.searchParams.set("sslmode", process.env.PGSSLMODE || (host === "localhost" ? "disable" : "allow"));
5155
+ return url.toString();
5156
+ }
5157
+
5128
5158
  // dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts
5129
5159
  import {
5130
5160
  chmodSync,
@@ -5844,20 +5874,6 @@ import { createServer } from "node:net";
5844
5874
  import { endianness } from "node:os";
5845
5875
  import { join as join3 } from "node:path";
5846
5876
 
5847
- // ../../node_modules/pg/esm/index.mjs
5848
- var import_lib = __toESM(require_lib2(), 1);
5849
- var Client = import_lib.default.Client;
5850
- var Pool = import_lib.default.Pool;
5851
- var Connection = import_lib.default.Connection;
5852
- var types = import_lib.default.types;
5853
- var Query = import_lib.default.Query;
5854
- var DatabaseError = import_lib.default.DatabaseError;
5855
- var escapeIdentifier = import_lib.default.escapeIdentifier;
5856
- var escapeLiteral = import_lib.default.escapeLiteral;
5857
- var Result = import_lib.default.Result;
5858
- var TypeOverrides = import_lib.default.TypeOverrides;
5859
- var defaults = import_lib.default.defaults;
5860
-
5861
5877
  // dist/builtin/workflows/src/durable/dbos-postgres-ownership.ts
5862
5878
  import { randomUUID } from "node:crypto";
5863
5879
  import {
@@ -6953,6 +6969,16 @@ var DOCKER_CONTAINER = "dbos-db";
6953
6969
  var DOCKER_IMAGE = "pgvector/pgvector:pg16";
6954
6970
  var DOCKER_READY_ATTEMPTS = 60;
6955
6971
  var DOCKER_READY_DELAY_MS = 500;
6972
+ var DOCKER_READY_QUERY_TIMEOUT_MS = 1000;
6973
+ var TRANSIENT_STARTUP_CODES = new Set([
6974
+ "ECONNREFUSED",
6975
+ "ECONNRESET",
6976
+ "ETIMEDOUT",
6977
+ "EPIPE",
6978
+ "57P01",
6979
+ "57P02",
6980
+ "57P03"
6981
+ ]);
6956
6982
  var resolution;
6957
6983
  var resolvedProvider;
6958
6984
  var embeddedProvider = ensureEmbeddedDbosPostgres;
@@ -7042,6 +7068,103 @@ function shutdownResolvedLocalDbos() {
7042
7068
  });
7043
7069
  return embeddedShutdown;
7044
7070
  }
7071
+ function postgresReadinessPort(value) {
7072
+ const port = Number(value);
7073
+ const validFormat = typeof value !== "string" || /^\d+$/.test(value);
7074
+ const validPort = Number.isInteger(port) && port >= 1 && port <= 65535;
7075
+ if (!validFormat || !validPort)
7076
+ throw new Error("PostgreSQL readiness port (PGPORT) must be an integer between 1 and 65535.");
7077
+ return port;
7078
+ }
7079
+ function dockerFallbackEndpoint() {
7080
+ return {
7081
+ host: process.env.PGHOST || "localhost",
7082
+ port: postgresReadinessPort(process.env.PGPORT || "5432"),
7083
+ user: process.env.PGUSER || "postgres",
7084
+ password: process.env.PGPASSWORD || "dbos"
7085
+ };
7086
+ }
7087
+ async function waitForPostgresProtocolReadiness(options) {
7088
+ postgresReadinessPort(options.port);
7089
+ const attempts = options.attempts ?? DOCKER_READY_ATTEMPTS;
7090
+ const delayMs = options.delayMs ?? DOCKER_READY_DELAY_MS;
7091
+ const wait = options.wait ?? delay;
7092
+ const isReady = options.isReady ?? dockerPostgresQueryReady;
7093
+ const deadline = performance.now() + attempts * delayMs;
7094
+ for (let attempt = 0;attempt < attempts && performance.now() < deadline; attempt += 1) {
7095
+ try {
7096
+ if (await isReady(options.host, options.port))
7097
+ return;
7098
+ } catch (error) {
7099
+ if (!isTransientStartupError(readStartupFailure(error)))
7100
+ throw error;
7101
+ }
7102
+ if (attempt + 1 < attempts && performance.now() < deadline)
7103
+ await wait(delayMs);
7104
+ }
7105
+ throw new Error(`The DBOS Postgres container started but did not become ready within ${attempts * delayMs / 1000} seconds.`);
7106
+ }
7107
+ function readStartupFailure(value) {
7108
+ if (!(value instanceof Error))
7109
+ return { message: String(value) };
7110
+ const cause = value.cause;
7111
+ return {
7112
+ message: value.message,
7113
+ code: "code" in value && typeof value.code === "string" ? value.code : undefined,
7114
+ cause: cause === undefined ? undefined : cause instanceof Error ? cause : String(cause),
7115
+ source: value
7116
+ };
7117
+ }
7118
+ function isTransientStartupError(error) {
7119
+ const seen = new Set;
7120
+ let current = error;
7121
+ while (current !== undefined) {
7122
+ const { code, message, source, cause } = current;
7123
+ if (typeof code === "string" && TRANSIENT_STARTUP_CODES.has(code))
7124
+ return true;
7125
+ if (typeof code === "string" && /^[0-9A-Z]{5}$/.test(code))
7126
+ return false;
7127
+ if (/\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE)\b|^connection (?:refused|terminated(?: unexpectedly| due to connection timeout)?)(?:\s|$)|^connect(?:ion)? (?:timeout|timed out)(?:\s|$)|^timeout (?:expired|exceeded when trying to connect)$/i.test(message))
7128
+ return true;
7129
+ if (source === undefined || seen.has(source))
7130
+ return false;
7131
+ seen.add(source);
7132
+ current = cause === undefined ? undefined : readStartupFailure(cause);
7133
+ }
7134
+ return false;
7135
+ }
7136
+ async function dockerPostgresQueryReady(host, port) {
7137
+ const client = new Client({
7138
+ connectionString: defaultPostgresUrl("postgres", host, String(port)),
7139
+ connectionTimeoutMillis: DOCKER_READY_QUERY_TIMEOUT_MS,
7140
+ query_timeout: DOCKER_READY_QUERY_TIMEOUT_MS,
7141
+ statement_timeout: DOCKER_READY_QUERY_TIMEOUT_MS
7142
+ });
7143
+ client.on("error", () => {});
7144
+ let timer;
7145
+ try {
7146
+ await Promise.race([
7147
+ (async () => {
7148
+ await client.connect();
7149
+ await client.query("SELECT 1");
7150
+ })(),
7151
+ new Promise((_, reject) => {
7152
+ timer = setTimeout(() => reject(new Error("timeout expired")), DOCKER_READY_QUERY_TIMEOUT_MS);
7153
+ })
7154
+ ]);
7155
+ return true;
7156
+ } catch (error) {
7157
+ if (isTransientStartupError(readStartupFailure(error)))
7158
+ return false;
7159
+ throw error;
7160
+ } finally {
7161
+ if (timer !== undefined)
7162
+ clearTimeout(timer);
7163
+ client.end().catch(() => {
7164
+ return;
7165
+ });
7166
+ }
7167
+ }
7045
7168
  async function resolve() {
7046
7169
  const explicit = process.env.DBOS_SYSTEM_DATABASE_URL?.trim();
7047
7170
  if (explicit)
@@ -7067,6 +7190,7 @@ async function resolve() {
7067
7190
  }
7068
7191
  }
7069
7192
  async function ensureDockerDbosPostgres() {
7193
+ const endpoint = dockerFallbackEndpoint();
7070
7194
  const docker = await runLocalCommand("docker", ["version", "--format", "{{.Server.Version}}"]).catch(() => {
7071
7195
  return;
7072
7196
  });
@@ -7089,18 +7213,13 @@ async function ensureDockerDbosPostgres() {
7089
7213
  "-e",
7090
7214
  "PGDATA=/var/lib/postgresql/data",
7091
7215
  "-p",
7092
- "127.0.0.1:5432:5432",
7216
+ `127.0.0.1:${endpoint.port}:5432`,
7093
7217
  "-v",
7094
7218
  "dbos-db-data:/var/lib/postgresql/data",
7095
7219
  DOCKER_IMAGE
7096
7220
  ]);
7097
7221
  }
7098
- for (let attempt = 0;attempt < DOCKER_READY_ATTEMPTS; attempt += 1) {
7099
- if (await tcpReachable("127.0.0.1", 5432))
7100
- return;
7101
- await delay(DOCKER_READY_DELAY_MS);
7102
- }
7103
- throw new Error("The DBOS Postgres container started but did not become ready within 30 seconds.");
7222
+ await waitForPostgresProtocolReadiness({ host: endpoint.host, port: endpoint.port });
7104
7223
  }
7105
7224
  async function requireDockerSuccess(action, args) {
7106
7225
  const result = await runLocalCommand("docker", args);
@@ -63,9 +63,9 @@ var WORKER_PREFLIGHT_CONTRACT = [
63
63
  `);
64
64
  var E2E_VERIFICATION_GUIDANCE = [
65
65
  "Verify correctness end-to-end whenever practical for user-visible behavior; an executable scenario is stronger proof than code inspection, unit tests, or stage summaries alone.",
66
- 'For web or frontend flows, including frontend changes whose correctness depends on backend/API behavior, use the agent-browser skill or delegate with `skill: "agent-browser"`; capture snapshot, screenshot, DOM, or network evidence suited to the objective.',
66
+ 'For web or frontend flows, including frontend changes whose correctness depends on backend/API behavior, use the agent-browser skill or delegate with `skill: "agent-browser"`; capture snapshot, screenshot, DOM, or network evidence suited to the objective. Prefer agent-browser for what its skill covers (websites and web apps in Chrome/Chromium, Electron desktop apps, Slack, cloud browsers); use Cua Driver for anything else, including iOS simulators, Android emulators, OS dialogs, and non-Chromium browsers, and whenever agent-browser hits a limitation.',
67
67
  "For TUI/terminal automation/testing, prefer the herdr skill on macOS, Linux and Windows. Install Herdr if missing when network access and permissions permit; fall back to the tmux skill or native Windows psmux if installation or use is not possible. Preserve the pinned herdr skill's explicit-request and HERDR_ENV=1 requirements; never control a focused session from outside Herdr. Check installed help: psmux uses tmux-style commands, while herdr has its own CLI, not interchangeable flags. Exercise the actual interactive flow and retain pane/text or terminal recording evidence.",
68
- "For desktop and accessible simulator/emulator windows, use suitable PyAutoGUI or native platform tooling for a real visible app scenario and screenshots/video. Consult https://github.com/openai/openai-cua-sample-app#first-run and its Python README for setup and interruption guidance; the sample is optional and needs model/API access. Use a dedicated desktop/session, controlled fixtures and required screen-recording/accessibility permissions, inspect screenshots for other windows, and release held keys/buttons on interruption. Do not automate an arbitrary physical iPhone without an accessible simulator/emulator/mirroring or native automation setup, or label browser recordings as terminal/iOS proof.",
68
+ "For desktop and accessible simulator/emulator windows, use Cua Driver: when a model chooses the next action, as in this stage, use the `cua-driver` CLI; when workflow TypeScript code owns the sequence and the postcondition, the @trycua/cua-driver TypeScript SDK inside `ctx.tool` is the face instead. Here, load the cua-driver skill and drive the exact window with one-shot `cua-driver call <tool>` commands, following the skill's snapshot -> act -> fresh snapshot -> verify loop. Before the first action, ensure the executable (`cua-driver --version`; if missing, one bounded attempt with upstream's one-line installer, reporting its side effects; never `cua-driver skills install`), telemetry off (run every command with CUA_DRIVER_RS_TELEMETRY_ENABLED=false, and `cua-driver telemetry disable` once after an executable install), and readiness (`cua-driver status`, `cua-driver doctor`, `cua-driver call list_apps`; on macOS also `cua-driver permissions status`, starting a stopped daemon with `open -n -g -a CuaDriver --args serve`) with bounded attempts per docs/computer-use.md. Save each `get_window_state` JSON result and `screenshot_out_file` image to the artifacts directory as evidence. Report a missing macOS Accessibility or Screen Recording grant, a non-interactive Windows session, no graphical Linux session, or a refused/failed install as the stage's blocked/needs_human finding with the exact fix (for macOS: `cua-driver permissions grant`, then toggle CuaDriver on under System Settings -> Privacy & Security -> Accessibility and Screen & System Audio Recording, then relaunch the daemon; for an install: the exact installer command), and re-run the readiness check on resume. Use a dedicated desktop/session and controlled fixtures, inspect snapshots for other windows, and stop before destructive actions. Do not automate an arbitrary physical iPhone without an accessible simulator/emulator/mirroring or native automation setup, or label browser recordings as terminal/iOS proof.",
69
69
  "Choose tools from observed environment capabilities. Prefer installed/cached tools; install missing tools, runtimes or plugins when online access and permissions permit. Known offline/restricted installation is sufficient evidence not to attempt prohibited downloads; otherwise check capabilities or make one bounded setup attempt. Do not loop on blocked downloads, require production credentials, or take unsafe actions.",
70
70
  "When execution or installation is unavailable, continue available authoritative repository checks and retain useful local evidence. Report the constraint or attempted command with observed output, what could not run, and the narrower validation performed. For non-UI tasks, use relevant executable checks rather than manufacturing a UI scenario. An unavailable optional mechanism is not itself failed implementation or permission to relax required project checks."
71
71
  ].join(`
@@ -79,6 +79,7 @@ var CODE_QUALITY_VERIFICATION_GUIDANCE = [
79
79
  `);
80
80
  var MEDIA_PUBLICATION_GUIDANCE = [
81
81
  "Detect the repository provider and authorized PR/MR/issue/comment target before publishing media. Inspect and redact screenshots/video for secrets, personal information and unrelated windows; tie evidence to the verified commit and scenario. Local evidence collection does not authorize uploads.",
82
+ "When creating the PR/MR, gather the image and video evidence the verification stages produced and attach it to the PR body when the provider supports uploads: cua-driver `screenshot_out_file` before/after PNGs from `get_window_state`, agent-browser `screenshot` PNGs and `record` recordings, and any QA proof video. Reference each file in the body next to the scenario it proves (a before/after pair per verified postcondition, one recording per interaction) and keep the window-state JSON as a local artifact the body cites by name. On supported GitHub, pass them at creation: gh pr create --body-file <body.md> --attach 'before.png#State before the action' --attach 'after.png#State after the action' --attach flow.webm; use gh pr edit/comment --attach for evidence produced later.",
82
83
  "On GitHub, check gh --version and the chosen command's --help. GitHub CLI >=2.99.0 supports repeatable --attach on gh issue create/edit/comment and gh pr create/edit/comment. Use native attachments when supported, for example gh pr comment <number> --repo <owner/repo> --body-file <body.md> --attach <proof.mp4>. Attach each file once. Body-local path references are rewritten to hosted URLs; otherwise attachments append in flag order. Image path#alt text is supported; video alt text is not. A standalone ![](<local-video-path>) paragraph becomes an embedded player.",
83
84
  "Check current GitHub limits: PNG/JPEG/GIF/WebP/SVG images and MP4/MOV/WebM videos; images/GIFs up to 10 MB, video 10 MB on Free or 100 MB paid. Native attachment upload requires repository write access and supported OAuth/classic PAT auth; GitHub Enterprise Server is unsupported in this release. See https://docs.github.com/en/github-cli/github-cli/attaching-files-with-github-cli.",
84
85
  "Read back the returned PR/issue/comment and confirm usable GitHub-hosted links before claiming attachment success. Unsupported CLI versions, hosts, providers, auth or sizes require a truthful fallback: retain the local artifact and explain authorized manual attachment or supported provider options. Never claim file:// links are uploaded evidence, expose secrets, or upload automatically to unrelated third-party hosts."
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withSteeringPropagationContext2
3
- } from "./chunk-e83tc6nr.js";
3
+ } from "./chunk-3tx8ry44.js";
4
4
 
5
5
  // dist/builtin/workflows/src/authoring/workflow.ts
6
6
  import { basename } from "node:path";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-00ywx588.js";
4
+ } from "./chunk-5724b0cf.js";
5
5
  import {
6
6
  keepContext,
7
7
  REVIEWER_CALIBRATION_RULES,
@@ -24,7 +24,7 @@ import {
24
24
  EVIDENCE_CLOSURE_POLICY,
25
25
  WORKTREE_DISCIPLINE_CONTRACT,
26
26
  REVIEW_CODE_DELTA_CONTRACT
27
- } from "./chunk-e83tc6nr.js";
27
+ } from "./chunk-3tx8ry44.js";
28
28
  import {
29
29
  workflowArtifactDirectoryPath,
30
30
  ensureWorkflowArtifactDirectory,
@@ -36,7 +36,7 @@ import {
36
36
  reviewerFailureText,
37
37
  summarizeReviewConvergence,
38
38
  reverify_consolidated_batch
39
- } from "./chunk-7f381xnq.js";
39
+ } from "./chunk-2hzrv5y8.js";
40
40
  import {
41
41
  VERIFICATION_SCALE
42
42
  } from "./chunk-n1910xc4.js";
@@ -810,9 +810,13 @@ async function runGoalWorkflow(ctx, options) {
810
810
  let latestReviewReportPath;
811
811
  let terminalRemainingWork;
812
812
  let previousOrchestratorSessionFile;
813
- for (let turn = 1;turn <= maxTurns && ledger.status === "active"; turn += 1) {
814
- appendLifecycleEvent(ledger, "work_turn_started", "Orchestrator started.", turn);
815
- await writeGoalLedger(ledgerPath, ledger);
813
+ const recordedTurns = ledger.turns;
814
+ for (let turn = 1;turn <= maxTurns && (ledger.status === "active" || turn <= recordedTurns); turn += 1) {
815
+ const replayingRecordedTurn = turn <= recordedTurns;
816
+ if (!replayingRecordedTurn) {
817
+ appendLifecycleEvent(ledger, "work_turn_started", "Orchestrator started.", turn);
818
+ await writeGoalLedger(ledgerPath, ledger);
819
+ }
816
820
  const orchestratorReceiptPath = join3(artifactDir, "orchestrator-receipt.md");
817
821
  const orchestratorForkOptions = forkContinuationOptions(previousOrchestratorSessionFile);
818
822
  const orchestratorPrompt = orchestratorForkOptions.forkFromSessionFile === undefined ? renderGoalOrchestratorPrompt({
@@ -841,7 +845,7 @@ async function runGoalWorkflow(ctx, options) {
841
845
  latestReviews = [];
842
846
  latestReviewArtifactPaths = [];
843
847
  latestReviewReportPath = undefined;
844
- ledger.turns = turn;
848
+ ledger.turns = Math.max(ledger.turns, turn);
845
849
  ledger.status = "needs_human";
846
850
  ledger.decisions.push({
847
851
  turn,
@@ -861,18 +865,20 @@ async function runGoalWorkflow(ctx, options) {
861
865
  break;
862
866
  }
863
867
  previousOrchestratorSessionFile = orchestrator.sessionFile;
864
- ledger.turns = turn;
865
- const receiptAlreadyRecorded = ledger.receipts.some((receipt) => receipt.turn === turn && receipt.artifact_path === orchestratorReceiptPath);
866
- if (!receiptAlreadyRecorded) {
867
- ledger.receipts.push({
868
- turn,
869
- stage: orchestrator.name ?? orchestrator.stageName,
870
- artifact_path: orchestratorReceiptPath,
871
- summary: `Orchestrator receipt artifact: ${orchestratorReceiptPath}`
872
- });
873
- appendLifecycleEvent(ledger, "receipt_recorded", "Orchestrator receipt recorded.", turn);
868
+ if (!replayingRecordedTurn) {
869
+ ledger.turns = turn;
870
+ const receiptAlreadyRecorded = ledger.receipts.some((receipt) => receipt.turn === turn && receipt.artifact_path === orchestratorReceiptPath);
871
+ if (!receiptAlreadyRecorded) {
872
+ ledger.receipts.push({
873
+ turn,
874
+ stage: orchestrator.name ?? orchestrator.stageName,
875
+ artifact_path: orchestratorReceiptPath,
876
+ summary: `Orchestrator receipt artifact: ${orchestratorReceiptPath}`
877
+ });
878
+ appendLifecycleEvent(ledger, "receipt_recorded", "Orchestrator receipt recorded.", turn);
879
+ }
880
+ await writeGoalLedger(ledgerPath, ledger);
874
881
  }
875
- await writeGoalLedger(ledgerPath, ledger);
876
882
  const reviewerStep = (name, reviewerRole, focus) => ({
877
883
  name,
878
884
  task: renderReviewerPrompt({
@@ -957,14 +963,14 @@ async function runGoalWorkflow(ctx, options) {
957
963
  }
958
964
  });
959
965
  latestReviewReportPath = await writeReviewRoundArtifact(artifactDir, latestReviews, reverified.batch, reverified.audits);
960
- if (reverified.audits.length > 0) {
966
+ if (!replayingRecordedTurn && reverified.audits.length > 0) {
961
967
  ledger.reverification ??= [];
962
968
  ledger.reverification.push(...reverified.audits);
963
969
  }
964
970
  const findings = latestReviews.flatMap((review) => review.findings);
965
971
  const traceability = latestReviews.flatMap((review) => review.requirements_traceability);
966
972
  ledger.convergence ??= [];
967
- if (!reviewerBatchFailed && roundProducedDecisions) {
973
+ if (!replayingRecordedTurn && !reviewerBatchFailed && roundProducedDecisions) {
968
974
  ledger.convergence.push(record_convergence({
969
975
  unresolvedBlockingCount: reverified.batch.filter((entry) => entry.blocking).length,
970
976
  meanFindingConfidence: findings.length === 0 ? null : findings.reduce((total, finding) => total + finding.confidence_score, 0) / findings.length,
@@ -974,9 +980,12 @@ async function runGoalWorkflow(ctx, options) {
974
980
  }));
975
981
  }
976
982
  const newReviews = latestReviews.filter((review) => !ledger.reviews.some((recorded) => recorded.turn === review.turn && recorded.reviewer === review.reviewer));
977
- ledger.reviews.push(...newReviews);
983
+ if (!replayingRecordedTurn)
984
+ ledger.reviews.push(...newReviews);
978
985
  latestReviewArtifactPaths = [latestReviewReportPath, ...latestReviews.map((review) => review.artifact_path)];
979
- appendLifecycleEvent(ledger, "reviews_recorded", `Recorded ${latestReviews.length} reviewer decisions.`, turn);
986
+ if (!replayingRecordedTurn) {
987
+ appendLifecycleEvent(ledger, "reviews_recorded", `Recorded ${latestReviews.length} reviewer decisions.`, turn);
988
+ }
980
989
  if (reviewerBatchFailed) {
981
990
  terminalRemainingWork = collectRemainingWork(latestReviews);
982
991
  const reason = `Reviewer execution failed before quorum could be established. Remaining work: ${terminalRemainingWork}`;
@@ -993,6 +1002,8 @@ async function runGoalWorkflow(ctx, options) {
993
1002
  await writeGoalLedger(ledgerPath, ledger);
994
1003
  break;
995
1004
  }
1005
+ if (replayingRecordedTurn)
1006
+ continue;
996
1007
  const reducerOutcome = reduceGoalDecision(ledger, latestReviews, {
997
1008
  turn,
998
1009
  maxTurns,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-00ywx588.js";
4
+ } from "./chunk-5724b0cf.js";
5
5
  import {
6
6
  stableArtifactRoot
7
7
  } from "./chunk-rc5ec5xx.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-00ywx588.js";
4
+ } from "./chunk-5724b0cf.js";
5
5
  import {
6
6
  parse_rubric,
7
7
  normalize_criteria,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-00ywx588.js";
4
+ } from "./chunk-5724b0cf.js";
5
5
  import {
6
6
  parse_rubric,
7
7
  normalize_criteria,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-00ywx588.js";
4
+ } from "./chunk-5724b0cf.js";
5
5
  import {
6
6
  stableArtifactRoot
7
7
  } from "./chunk-rc5ec5xx.js";