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

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 (285) hide show
  1. package/CHANGELOG.md +41 -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 +6 -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/web-access/package.json +2 -2
  24. package/dist/builtin/workflows/CHANGELOG.md +13 -0
  25. package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
  26. package/dist/builtin/workflows/builtin/{chunk-7f381xnq.js → chunk-2hzrv5y8.js} +140 -21
  27. package/dist/builtin/workflows/builtin/{chunk-e83tc6nr.js → chunk-3tx8ry44.js} +3 -2
  28. package/dist/builtin/workflows/builtin/{chunk-00ywx588.js → chunk-5724b0cf.js} +1 -1
  29. package/dist/builtin/workflows/builtin/{chunk-ne6vh5ct.js → chunk-7n51c5gh.js} +1 -1
  30. package/dist/builtin/workflows/builtin/{chunk-x2nftpgj.js → chunk-9z3ztr2a.js} +1 -1
  31. package/dist/builtin/workflows/builtin/{chunk-zj5162bh.js → chunk-deq63d9p.js} +3 -3
  32. package/dist/builtin/workflows/builtin/{chunk-7h7s5xdj.js → chunk-dxjxtgmp.js} +1 -1
  33. package/dist/builtin/workflows/builtin/{chunk-tvcydq13.js → chunk-ffdrv23t.js} +1 -1
  34. package/dist/builtin/workflows/builtin/{chunk-pfm1kgqz.js → chunk-hmt5w62g.js} +12 -4
  35. package/dist/builtin/workflows/builtin/{chunk-tdqvdrg1.js → chunk-jngsbbpm.js} +3 -3
  36. package/dist/builtin/workflows/builtin/{chunk-55p5dxjk.js → chunk-njmf5ze7.js} +1 -1
  37. package/dist/builtin/workflows/builtin/{chunk-evfb0312.js → chunk-vn0wb31x.js} +1 -1
  38. package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
  39. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
  40. package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
  41. package/dist/builtin/workflows/builtin/goal.js +4 -4
  42. package/dist/builtin/workflows/builtin/index.js +12 -12
  43. package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
  44. package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
  45. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  46. package/dist/builtin/workflows/builtin/steering-context.js +1 -1
  47. package/dist/builtin/workflows/builtin/tournament.js +3 -3
  48. package/dist/builtin/workflows/package.json +2 -2
  49. package/dist/builtin/workflows/src/extension/index.bundle.mjs +199 -36
  50. package/dist/builtin/workflows/src/index.js +1418 -1271
  51. package/dist/cli/args.d.ts.map +1 -1
  52. package/dist/cli/args.js +15 -4
  53. package/dist/cli/args.js.map +1 -1
  54. package/dist/cli/file-processor.d.ts +1 -1
  55. package/dist/cli/file-processor.d.ts.map +1 -1
  56. package/dist/cli/file-processor.js.map +1 -1
  57. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  58. package/dist/core/agent-session-auto-compaction.js +40 -12
  59. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  60. package/dist/core/agent-session-bash.d.ts.map +1 -1
  61. package/dist/core/agent-session-bash.js +9 -8
  62. package/dist/core/agent-session-bash.js.map +1 -1
  63. package/dist/core/agent-session-boundaries.d.ts +68 -0
  64. package/dist/core/agent-session-boundaries.d.ts.map +1 -0
  65. package/dist/core/agent-session-boundaries.js +334 -0
  66. package/dist/core/agent-session-boundaries.js.map +1 -0
  67. package/dist/core/agent-session-compaction.js +1 -1
  68. package/dist/core/agent-session-compaction.js.map +1 -1
  69. package/dist/core/agent-session-events.d.ts.map +1 -1
  70. package/dist/core/agent-session-events.js +27 -13
  71. package/dist/core/agent-session-events.js.map +1 -1
  72. package/dist/core/agent-session-export.d.ts.map +1 -1
  73. package/dist/core/agent-session-export.js +16 -20
  74. package/dist/core/agent-session-export.js.map +1 -1
  75. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  76. package/dist/core/agent-session-message-queue.js +3 -2
  77. package/dist/core/agent-session-message-queue.js.map +1 -1
  78. package/dist/core/agent-session-methods.d.ts +30 -4
  79. package/dist/core/agent-session-methods.d.ts.map +1 -1
  80. package/dist/core/agent-session-methods.js.map +1 -1
  81. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  82. package/dist/core/agent-session-persistent-custom-messages.js +2 -1
  83. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  84. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  85. package/dist/core/agent-session-prompt.js +93 -25
  86. package/dist/core/agent-session-prompt.js.map +1 -1
  87. package/dist/core/agent-session-retry.d.ts.map +1 -1
  88. package/dist/core/agent-session-retry.js +4 -9
  89. package/dist/core/agent-session-retry.js.map +1 -1
  90. package/dist/core/agent-session-runtime.js +1 -1
  91. package/dist/core/agent-session-runtime.js.map +1 -1
  92. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  93. package/dist/core/agent-session-tool-hooks.js +15 -5
  94. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  95. package/dist/core/agent-session-tree.d.ts.map +1 -1
  96. package/dist/core/agent-session-tree.js +2 -3
  97. package/dist/core/agent-session-tree.js.map +1 -1
  98. package/dist/core/agent-session-types.d.ts +6 -0
  99. package/dist/core/agent-session-types.d.ts.map +1 -1
  100. package/dist/core/agent-session-types.js.map +1 -1
  101. package/dist/core/agent-session.d.ts +15 -2
  102. package/dist/core/agent-session.d.ts.map +1 -1
  103. package/dist/core/agent-session.js +17 -1
  104. package/dist/core/agent-session.js.map +1 -1
  105. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  106. package/dist/core/compaction/branch-summarization.js +1 -0
  107. package/dist/core/compaction/branch-summarization.js.map +1 -1
  108. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  109. package/dist/core/compaction/compaction-boundary.js +11 -6
  110. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  111. package/dist/core/compaction/compaction.d.ts +3 -1
  112. package/dist/core/compaction/compaction.d.ts.map +1 -1
  113. package/dist/core/compaction/compaction.js +37 -0
  114. package/dist/core/compaction/compaction.js.map +1 -1
  115. package/dist/core/crash-log.d.ts +6 -0
  116. package/dist/core/crash-log.d.ts.map +1 -0
  117. package/dist/core/crash-log.js +69 -0
  118. package/dist/core/crash-log.js.map +1 -0
  119. package/dist/core/execution-model-router.d.ts +1 -0
  120. package/dist/core/execution-model-router.d.ts.map +1 -1
  121. package/dist/core/execution-model-router.js +15 -12
  122. package/dist/core/execution-model-router.js.map +1 -1
  123. package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
  124. package/dist/core/export-html/template.js +6 -1
  125. package/dist/core/extensions/agent-events.d.ts +69 -3
  126. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  127. package/dist/core/extensions/agent-events.js.map +1 -1
  128. package/dist/core/extensions/api-types.d.ts +5 -3
  129. package/dist/core/extensions/api-types.d.ts.map +1 -1
  130. package/dist/core/extensions/api-types.js.map +1 -1
  131. package/dist/core/extensions/event-results.d.ts +3 -0
  132. package/dist/core/extensions/event-results.d.ts.map +1 -1
  133. package/dist/core/extensions/event-results.js.map +1 -1
  134. package/dist/core/extensions/event-types.d.ts +2 -2
  135. package/dist/core/extensions/event-types.d.ts.map +1 -1
  136. package/dist/core/extensions/event-types.js.map +1 -1
  137. package/dist/core/extensions/index.d.ts +1 -1
  138. package/dist/core/extensions/index.d.ts.map +1 -1
  139. package/dist/core/extensions/index.js.map +1 -1
  140. package/dist/core/extensions/provider-types.d.ts +2 -0
  141. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  142. package/dist/core/extensions/provider-types.js.map +1 -1
  143. package/dist/core/extensions/runner-events.d.ts +16 -2
  144. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  145. package/dist/core/extensions/runner-events.js +98 -5
  146. package/dist/core/extensions/runner-events.js.map +1 -1
  147. package/dist/core/extensions/runner.d.ts +3 -2
  148. package/dist/core/extensions/runner.d.ts.map +1 -1
  149. package/dist/core/extensions/runner.js +4 -1
  150. package/dist/core/extensions/runner.js.map +1 -1
  151. package/dist/core/index.d.ts +1 -1
  152. package/dist/core/index.d.ts.map +1 -1
  153. package/dist/core/index.js.map +1 -1
  154. package/dist/core/messages.d.ts +10 -0
  155. package/dist/core/messages.d.ts.map +1 -1
  156. package/dist/core/messages.js +57 -0
  157. package/dist/core/messages.js.map +1 -1
  158. package/dist/core/model-config.d.ts +52 -0
  159. package/dist/core/model-config.d.ts.map +1 -1
  160. package/dist/core/model-config.js +16 -0
  161. package/dist/core/model-config.js.map +1 -1
  162. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  163. package/dist/core/model-resolver-defaults.js +2 -1
  164. package/dist/core/model-resolver-defaults.js.map +1 -1
  165. package/dist/core/prompt-templates-async.d.ts +2 -2
  166. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  167. package/dist/core/prompt-templates-async.js +57 -29
  168. package/dist/core/prompt-templates-async.js.map +1 -1
  169. package/dist/core/prompt-templates.d.ts +6 -1
  170. package/dist/core/prompt-templates.d.ts.map +1 -1
  171. package/dist/core/prompt-templates.js +61 -35
  172. package/dist/core/prompt-templates.js.map +1 -1
  173. package/dist/core/provider-composer-internal.d.ts +1 -0
  174. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  175. package/dist/core/provider-composer-internal.js +19 -0
  176. package/dist/core/provider-composer-internal.js.map +1 -1
  177. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  178. package/dist/core/resource-loader-assets.js +6 -6
  179. package/dist/core/resource-loader-assets.js.map +1 -1
  180. package/dist/core/sdk.js +3 -2
  181. package/dist/core/sdk.js.map +1 -1
  182. package/dist/core/session-manager-core.d.ts +10 -3
  183. package/dist/core/session-manager-core.d.ts.map +1 -1
  184. package/dist/core/session-manager-core.js +65 -7
  185. package/dist/core/session-manager-core.js.map +1 -1
  186. package/dist/core/session-manager-entries.d.ts +4 -1
  187. package/dist/core/session-manager-entries.d.ts.map +1 -1
  188. package/dist/core/session-manager-entries.js +8 -0
  189. package/dist/core/session-manager-entries.js.map +1 -1
  190. package/dist/core/session-manager-history.d.ts +16 -1
  191. package/dist/core/session-manager-history.d.ts.map +1 -1
  192. package/dist/core/session-manager-history.js +105 -42
  193. package/dist/core/session-manager-history.js.map +1 -1
  194. package/dist/core/session-manager-types.d.ts +30 -3
  195. package/dist/core/session-manager-types.d.ts.map +1 -1
  196. package/dist/core/session-manager-types.js.map +1 -1
  197. package/dist/core/session-manager.d.ts +2 -2
  198. package/dist/core/session-manager.d.ts.map +1 -1
  199. package/dist/core/session-manager.js +1 -1
  200. package/dist/core/session-manager.js.map +1 -1
  201. package/dist/core/structured-output/index.d.ts +0 -1
  202. package/dist/core/structured-output/index.d.ts.map +1 -1
  203. package/dist/core/structured-output/index.js +3 -15
  204. package/dist/core/structured-output/index.js.map +1 -1
  205. package/dist/core/structured-output/jev-client.d.ts +4 -8
  206. package/dist/core/structured-output/jev-client.d.ts.map +1 -1
  207. package/dist/core/structured-output/jev-client.js +36 -32
  208. package/dist/core/structured-output/jev-client.js.map +1 -1
  209. package/dist/core/structured-output/jev.d.ts.map +1 -1
  210. package/dist/core/structured-output/jev.js +4 -12
  211. package/dist/core/structured-output/jev.js.map +1 -1
  212. package/dist/core/structured-output/types.d.ts +0 -2
  213. package/dist/core/structured-output/types.d.ts.map +1 -1
  214. package/dist/core/structured-output/types.js.map +1 -1
  215. package/dist/core/system-prompt.js +1 -1
  216. package/dist/core/system-prompt.js.map +1 -1
  217. package/dist/core/tools/read.d.ts +4 -0
  218. package/dist/core/tools/read.d.ts.map +1 -1
  219. package/dist/core/tools/read.js +5 -1
  220. package/dist/core/tools/read.js.map +1 -1
  221. package/dist/index-extensions.d.ts +1 -1
  222. package/dist/index-extensions.d.ts.map +1 -1
  223. package/dist/index-extensions.js.map +1 -1
  224. package/dist/index.d.ts +2 -2
  225. package/dist/index.d.ts.map +1 -1
  226. package/dist/index.js +2 -2
  227. package/dist/index.js.map +1 -1
  228. package/dist/main-app-mode.d.ts +1 -1
  229. package/dist/main-app-mode.d.ts.map +1 -1
  230. package/dist/main-app-mode.js +3 -2
  231. package/dist/main-app-mode.js.map +1 -1
  232. package/dist/main.d.ts.map +1 -1
  233. package/dist/main.js +1 -1
  234. package/dist/main.js.map +1 -1
  235. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  236. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  237. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  238. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  239. package/dist/modes/interactive/components/tree-selector-model.js +1 -0
  240. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  241. package/dist/modes/interactive/interactive-agent-events.js +17 -1
  242. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  243. package/dist/modes/interactive/interactive-mode-helpers.d.ts +1 -0
  244. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  245. package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
  246. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  247. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  248. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  249. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  250. package/dist/modes/interactive/interactive-process-lifecycle.js +13 -1
  251. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  252. package/dist/modes/interactive/interactive-session-runtime.js +5 -1
  253. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  254. package/dist/utils/mime.js +1 -1
  255. package/dist/utils/mime.js.map +1 -1
  256. package/dist/utils/tool-result-images.d.ts +3 -1
  257. package/dist/utils/tool-result-images.d.ts.map +1 -1
  258. package/dist/utils/tool-result-images.js +4 -1
  259. package/dist/utils/tool-result-images.js.map +1 -1
  260. package/docs/compaction.md +5 -1
  261. package/docs/computer-use.md +105 -56
  262. package/docs/extensions/events.md +75 -7
  263. package/docs/extensions.md +6 -2
  264. package/docs/getting-started/first-session.md +1 -0
  265. package/docs/intercom/operations.md +13 -1
  266. package/docs/intercom.md +1 -1
  267. package/docs/models/evals.md +68 -82
  268. package/docs/models/reference.md +30 -2
  269. package/docs/packages.md +2 -0
  270. package/docs/prompt-templates.md +1 -0
  271. package/docs/providers.md +8 -2
  272. package/docs/sdk/reference.md +1 -2
  273. package/docs/sdk/structured-decisions.md +10 -9
  274. package/docs/sdk.md +13 -2
  275. package/docs/session-format.md +17 -2
  276. package/docs/settings.md +1 -1
  277. package/docs/skills.md +3 -1
  278. package/docs/subagents/reference.md +4 -4
  279. package/docs/subagents.md +1 -1
  280. package/docs/workflows/api-reference.md +2 -0
  281. package/docs/workflows/authoring.md +191 -0
  282. package/docs/workflows/operations.md +9 -3
  283. package/docs/workflows/verification.md +21 -8
  284. package/npm-shrinkwrap.json +69 -69
  285. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.20-alpha.5",
3
+ "version": "0.9.20-alpha.6",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@bastani/atomic": "*",
89
- "@earendil-works/pi-tui": "^0.86.1"
89
+ "@earendil-works/pi-tui": "^0.87.0"
90
90
  },
91
91
  "peerDependenciesMeta": {
92
92
  "@bastani/atomic": {
@@ -30278,6 +30278,22 @@ var init_dbos_admission_pool = __esm(() => {
30278
30278
  ]);
30279
30279
  });
30280
30280
 
30281
+ // dist/builtin/workflows/src/durable/dbos-default-postgres-url.ts
30282
+ function defaultPostgresUrl(database, host = process.env.PGHOST || "localhost", port = process.env.PGPORT || "5432") {
30283
+ const url = new URL("postgresql://localhost");
30284
+ url.pathname = `/${database}`;
30285
+ if (host.startsWith("/") || host.includes(":"))
30286
+ url.searchParams.set("host", host);
30287
+ else
30288
+ url.hostname = host;
30289
+ url.port = port;
30290
+ url.username = encodeURIComponent(process.env.PGUSER || "postgres");
30291
+ url.password = encodeURIComponent(process.env.PGPASSWORD || "dbos");
30292
+ url.searchParams.set("connect_timeout", process.env.PGCONNECT_TIMEOUT || "10");
30293
+ url.searchParams.set("sslmode", process.env.PGSSLMODE || (host === "localhost" ? "disable" : "allow"));
30294
+ return url.toString();
30295
+ }
30296
+
30281
30297
  // dist/builtin/workflows/src/durable/dbos-managed-health.ts
30282
30298
  function resolvedPostgresHealth(url) {
30283
30299
  const ownerKey = Symbol.for("atomic-workflows/local-postgres-owner@1");
@@ -30451,19 +30467,7 @@ var init_dbos_recoverable_pool = __esm(() => {
30451
30467
  // dist/builtin/workflows/src/durable/dbos-admission-config.ts
30452
30468
  function defaultDatabaseUrl(name) {
30453
30469
  const database = name.toLowerCase().replaceAll("-", "_").replaceAll(" ", "_").replace(/^\d/, "_$&");
30454
- const url = new URL("postgresql://localhost");
30455
- url.pathname = `/${database}_dbos_sys`;
30456
- const host = process.env.PGHOST || "localhost";
30457
- if (host.startsWith("/") || host.includes(":"))
30458
- url.searchParams.set("host", host);
30459
- else
30460
- url.hostname = host;
30461
- url.port = process.env.PGPORT || "5432";
30462
- url.username = encodeURIComponent(process.env.PGUSER || "postgres");
30463
- url.password = encodeURIComponent(process.env.PGPASSWORD || "dbos");
30464
- url.searchParams.set("connect_timeout", process.env.PGCONNECT_TIMEOUT || "10");
30465
- url.searchParams.set("sslmode", process.env.PGSSLMODE || (host === "localhost" ? "disable" : "allow"));
30466
- return url.toString();
30470
+ return defaultPostgresUrl(`${database}_dbos_sys`);
30467
30471
  }
30468
30472
  function configureAdmissionDatabase(sdk, config) {
30469
30473
  const systemDatabaseUrl = config.systemDatabaseUrl ?? defaultDatabaseUrl(config.name);
@@ -32386,9 +32390,108 @@ function shutdownResolvedLocalDbos() {
32386
32390
  function shouldProvisionLocalDbos(error) {
32387
32391
  if (process.env.DBOS_SYSTEM_DATABASE_URL?.trim())
32388
32392
  return false;
32393
+ if (isTransientStartupError(readStartupFailure(error)))
32394
+ return true;
32389
32395
  const message = error instanceof Error ? `${error.message}
32390
32396
  ${error.cause ?? ""}` : String(error);
32391
- return /ECONNREFUSED|server not reachable|connect failed|connection refused|unable to connect to system database/i.test(message);
32397
+ return /server not reachable|connect failed|connection refused|unable to connect to system database/i.test(message);
32398
+ }
32399
+ function postgresReadinessPort(value2) {
32400
+ const port = Number(value2);
32401
+ const validFormat = typeof value2 !== "string" || /^\d+$/.test(value2);
32402
+ const validPort = Number.isInteger(port) && port >= 1 && port <= 65535;
32403
+ if (!validFormat || !validPort)
32404
+ throw new Error("PostgreSQL readiness port (PGPORT) must be an integer between 1 and 65535.");
32405
+ return port;
32406
+ }
32407
+ function dockerFallbackEndpoint() {
32408
+ return {
32409
+ host: process.env.PGHOST || "localhost",
32410
+ port: postgresReadinessPort(process.env.PGPORT || "5432"),
32411
+ user: process.env.PGUSER || "postgres",
32412
+ password: process.env.PGPASSWORD || "dbos"
32413
+ };
32414
+ }
32415
+ async function waitForPostgresProtocolReadiness(options) {
32416
+ postgresReadinessPort(options.port);
32417
+ const attempts = options.attempts ?? DOCKER_READY_ATTEMPTS;
32418
+ const delayMs = options.delayMs ?? DOCKER_READY_DELAY_MS;
32419
+ const wait = options.wait ?? delay;
32420
+ const isReady = options.isReady ?? dockerPostgresQueryReady;
32421
+ const deadline = performance.now() + attempts * delayMs;
32422
+ for (let attempt = 0;attempt < attempts && performance.now() < deadline; attempt += 1) {
32423
+ try {
32424
+ if (await isReady(options.host, options.port))
32425
+ return;
32426
+ } catch (error) {
32427
+ if (!isTransientStartupError(readStartupFailure(error)))
32428
+ throw error;
32429
+ }
32430
+ if (attempt + 1 < attempts && performance.now() < deadline)
32431
+ await wait(delayMs);
32432
+ }
32433
+ throw new Error(`The DBOS Postgres container started but did not become ready within ${attempts * delayMs / 1000} seconds.`);
32434
+ }
32435
+ function readStartupFailure(value2) {
32436
+ if (!(value2 instanceof Error))
32437
+ return { message: String(value2) };
32438
+ const cause = value2.cause;
32439
+ return {
32440
+ message: value2.message,
32441
+ code: "code" in value2 && typeof value2.code === "string" ? value2.code : undefined,
32442
+ cause: cause === undefined ? undefined : cause instanceof Error ? cause : String(cause),
32443
+ source: value2
32444
+ };
32445
+ }
32446
+ function isTransientStartupError(error) {
32447
+ const seen = new Set;
32448
+ let current = error;
32449
+ while (current !== undefined) {
32450
+ const { code, message, source, cause } = current;
32451
+ if (typeof code === "string" && TRANSIENT_STARTUP_CODES.has(code))
32452
+ return true;
32453
+ if (typeof code === "string" && /^[0-9A-Z]{5}$/.test(code))
32454
+ return false;
32455
+ 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))
32456
+ return true;
32457
+ if (source === undefined || seen.has(source))
32458
+ return false;
32459
+ seen.add(source);
32460
+ current = cause === undefined ? undefined : readStartupFailure(cause);
32461
+ }
32462
+ return false;
32463
+ }
32464
+ async function dockerPostgresQueryReady(host, port) {
32465
+ const client = new Client({
32466
+ connectionString: defaultPostgresUrl("postgres", host, String(port)),
32467
+ connectionTimeoutMillis: DOCKER_READY_QUERY_TIMEOUT_MS,
32468
+ query_timeout: DOCKER_READY_QUERY_TIMEOUT_MS,
32469
+ statement_timeout: DOCKER_READY_QUERY_TIMEOUT_MS
32470
+ });
32471
+ client.on("error", () => {});
32472
+ let timer;
32473
+ try {
32474
+ await Promise.race([
32475
+ (async () => {
32476
+ await client.connect();
32477
+ await client.query("SELECT 1");
32478
+ })(),
32479
+ new Promise((_, reject) => {
32480
+ timer = setTimeout(() => reject(new Error("timeout expired")), DOCKER_READY_QUERY_TIMEOUT_MS);
32481
+ })
32482
+ ]);
32483
+ return true;
32484
+ } catch (error) {
32485
+ if (isTransientStartupError(readStartupFailure(error)))
32486
+ return false;
32487
+ throw error;
32488
+ } finally {
32489
+ if (timer !== undefined)
32490
+ clearTimeout(timer);
32491
+ client.end().catch(() => {
32492
+ return;
32493
+ });
32494
+ }
32392
32495
  }
32393
32496
  async function resolve2() {
32394
32497
  const explicit = process.env.DBOS_SYSTEM_DATABASE_URL?.trim();
@@ -32415,6 +32518,7 @@ async function resolve2() {
32415
32518
  }
32416
32519
  }
32417
32520
  async function ensureDockerDbosPostgres() {
32521
+ const endpoint = dockerFallbackEndpoint();
32418
32522
  const docker = await runLocalCommand("docker", ["version", "--format", "{{.Server.Version}}"]).catch(() => {
32419
32523
  return;
32420
32524
  });
@@ -32437,18 +32541,13 @@ async function ensureDockerDbosPostgres() {
32437
32541
  "-e",
32438
32542
  "PGDATA=/var/lib/postgresql/data",
32439
32543
  "-p",
32440
- "127.0.0.1:5432:5432",
32544
+ `127.0.0.1:${endpoint.port}:5432`,
32441
32545
  "-v",
32442
32546
  "dbos-db-data:/var/lib/postgresql/data",
32443
32547
  DOCKER_IMAGE
32444
32548
  ]);
32445
32549
  }
32446
- for (let attempt = 0;attempt < DOCKER_READY_ATTEMPTS; attempt += 1) {
32447
- if (await tcpReachable("127.0.0.1", 5432))
32448
- return;
32449
- await delay(DOCKER_READY_DELAY_MS);
32450
- }
32451
- throw new Error("The DBOS Postgres container started but did not become ready within 30 seconds.");
32550
+ await waitForPostgresProtocolReadiness({ host: endpoint.host, port: endpoint.port });
32452
32551
  }
32453
32552
  async function requireDockerSuccess(action, args) {
32454
32553
  const result = await runLocalCommand("docker", args);
@@ -32456,10 +32555,20 @@ async function requireDockerSuccess(action, args) {
32456
32555
  return;
32457
32556
  throw new Error(`Could not ${action}: ${commandFailureDetail(result)}`);
32458
32557
  }
32459
- var DOCKER_CONTAINER = "dbos-db", DOCKER_IMAGE = "pgvector/pgvector:pg16", DOCKER_READY_ATTEMPTS = 60, DOCKER_READY_DELAY_MS = 500, resolution, resolvedProvider, embeddedProvider, dockerProvider, shutdownEmbeddedProvider, embeddedShutdown, ownerKey, ownerBag3, owner;
32558
+ var DOCKER_CONTAINER = "dbos-db", DOCKER_IMAGE = "pgvector/pgvector:pg16", DOCKER_READY_ATTEMPTS = 60, DOCKER_READY_DELAY_MS = 500, DOCKER_READY_QUERY_TIMEOUT_MS = 1000, TRANSIENT_STARTUP_CODES, resolution, resolvedProvider, embeddedProvider, dockerProvider, shutdownEmbeddedProvider, embeddedShutdown, ownerKey, ownerBag3, owner;
32460
32559
  var init_dbos_local_postgres = __esm(() => {
32560
+ init_esm();
32461
32561
  init_dbos_embedded_postgres();
32462
32562
  init_local_command();
32563
+ TRANSIENT_STARTUP_CODES = new Set([
32564
+ "ECONNREFUSED",
32565
+ "ECONNRESET",
32566
+ "ETIMEDOUT",
32567
+ "EPIPE",
32568
+ "57P01",
32569
+ "57P02",
32570
+ "57P03"
32571
+ ]);
32463
32572
  embeddedProvider = ensureEmbeddedDbosPostgres;
32464
32573
  dockerProvider = ensureDockerDbosPostgres;
32465
32574
  shutdownEmbeddedProvider = shutdownEmbeddedDbosPostgres;
@@ -40236,7 +40345,7 @@ to your top-level package.json.
40236
40345
  };
40237
40346
  }, "./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/helpers/environment.js"(e, t) {
40238
40347
  Object.defineProperty(t, "__esModule", { value: true }), t.getEnv = function(e = "development") {
40239
- return process.env.BABEL_ENV || "development";
40348
+ return process.env.BABEL_ENV || process.env.NODE_ENV || e;
40240
40349
  };
40241
40350
  }, "./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/index.js"(e, t, r) {
40242
40351
  function _gensync() {
@@ -88785,15 +88894,27 @@ async function launchDbosOnce() {
88785
88894
  await durability.launch();
88786
88895
  slot.state = "ready";
88787
88896
  } catch (error) {
88897
+ try {
88898
+ await durability.shutdown();
88899
+ } catch (shutdownError) {
88900
+ slot.failure = await durabilityFailure("launch cleanup", combinedShutdownFailure([error, shutdownError]));
88901
+ slot.state = "failed";
88902
+ throw slot.failure;
88903
+ }
88788
88904
  if (shouldProvisionLocalDbos(error)) {
88789
88905
  try {
88790
- await durability.shutdown();
88791
88906
  await provisionLocalDbos();
88792
88907
  await durability.launch();
88793
88908
  slot.state = "ready";
88794
88909
  return;
88795
88910
  } catch (provisionError) {
88796
- slot.failure = await durabilityFailure("local Postgres startup", provisionError);
88911
+ let failure = provisionError;
88912
+ try {
88913
+ await durability.shutdown();
88914
+ } catch (shutdownError) {
88915
+ failure = combinedShutdownFailure([provisionError, shutdownError]);
88916
+ }
88917
+ slot.failure = await durabilityFailure("local Postgres startup", failure);
88797
88918
  }
88798
88919
  } else {
88799
88920
  slot.failure = await durabilityFailure("launch", error);
@@ -88913,6 +89034,11 @@ async function degradeToNonDurableBackend(error) {
88913
89034
  const kind = await classifyDbosDurabilityFailure(error);
88914
89035
  const restore = kind === "duplicate_registration" ? `Restore durability by resolving the duplicate DBOS operation registration: ${detail}` : `Restore durability by fixing Postgres provisioning: ${detail}`;
88915
89036
  const warning = "atomic-workflows: durable backend unavailable — continuing NON-DURABLY with an in-memory backend. " + "Workflow runs will execute, but their state will not survive this process and `/workflow resume` " + `after exit will not work. ${restore}`;
89037
+ try {
89038
+ await shutdownDbos();
89039
+ } catch (cleanupError) {
89040
+ throw new DbosDurabilityError(`Workflow backend cleanup failed; refusing to start another backend while executor shutdown is unconfirmed. ` + `Restart Atomic after correcting the shutdown failure. Initialization: ${detail}. ` + `Cleanup: ${readDbosFailureDetail(cleanupError)}`, { cause: cleanupError });
89041
+ }
88916
89042
  const owner = getDurableBackendProcessOwner();
88917
89043
  const backend = new InMemoryDurableBackend;
88918
89044
  owner.initializedBackend = backend;
@@ -93571,9 +93697,9 @@ var WORKER_PREFLIGHT_CONTRACT = [
93571
93697
  `);
93572
93698
  var E2E_VERIFICATION_GUIDANCE = [
93573
93699
  "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.",
93574
- '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.',
93700
+ '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.',
93575
93701
  "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.",
93576
- "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.",
93702
+ "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.",
93577
93703
  "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.",
93578
93704
  "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."
93579
93705
  ].join(`
@@ -93587,6 +93713,7 @@ var CODE_QUALITY_VERIFICATION_GUIDANCE = [
93587
93713
  `);
93588
93714
  var MEDIA_PUBLICATION_GUIDANCE = [
93589
93715
  "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.",
93716
+ "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.",
93590
93717
  "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.",
93591
93718
  "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.",
93592
93719
  "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."
@@ -96875,7 +97002,7 @@ function prepareArtifactDir(cwd = process.cwd()) {
96875
97002
  join16(tmpArtifactBase(), runId),
96876
97003
  join16(tmpdir2(), "open-claude-design", runId)
96877
97004
  ];
96878
- const candidates = [join16(cwd, "specs", "design", runId), ...tmpCandidates];
97005
+ const candidates = process.env.NODE_ENV === "test" ? tmpCandidates : [join16(cwd, "specs", "design", runId), ...tmpCandidates];
96879
97006
  for (const candidate of candidates) {
96880
97007
  try {
96881
97008
  mkdirSync3(candidate, { recursive: true });
@@ -96934,7 +97061,15 @@ function ensureAgentBrowser() {
96934
97061
  summary: "agent-browser already on PATH; skipped install."
96935
97062
  };
96936
97063
  }
96937
- if (false) {}
97064
+ if (process.env.NODE_ENV === "test") {
97065
+ return {
97066
+ available: false,
97067
+ alreadyPresent: false,
97068
+ installed: false,
97069
+ summary: "agent-browser not found; skipped global install under the test environment.",
97070
+ error: "global install skipped during tests"
97071
+ };
97072
+ }
96938
97073
  try {
96939
97074
  const install = spawnSync("npm", ["install", "-g", "agent-browser"], {
96940
97075
  stdio: "ignore",
@@ -97601,7 +97736,7 @@ async function runOpenClaudeDesignWorkflow(ctx) {
97601
97736
  spec_path: specPath,
97602
97737
  spec_file_url: specFileUrl
97603
97738
  };
97604
- if (shouldEarlyExitForBrowser(agentBrowser.available, "development") && typeof designContext.exit === "function") {
97739
+ if (shouldEarlyExitForBrowser(agentBrowser.available, process.env.NODE_ENV) && typeof designContext.exit === "function") {
97605
97740
  designContext.exit({
97606
97741
  reason: `open-claude-design needs the agent-browser skill's browser for interactive design review, which is unavailable (${agentBrowser.error ?? agentBrowser.summary}). No design was generated. Install it (\`npm install -g agent-browser\` + \`agent-browser install\`) and re-run.`,
97607
97742
  outputs: partialArtifactOutputs
@@ -109069,6 +109204,22 @@ function latestTerminalAssistantFailureSince(messages, startIndex) {
109069
109204
  }
109070
109205
  return;
109071
109206
  }
109207
+ function hasAssistantMessageSince(messages, startIndex) {
109208
+ for (let index = messages.length - 1;index >= Math.max(startIndex, 0); index -= 1) {
109209
+ if (messages[index]?.role === "assistant")
109210
+ return true;
109211
+ }
109212
+ return false;
109213
+ }
109214
+ var EMPTY_COMPLETION_FAILURE_MESSAGE = "Model turn ended without an assistant message after the prompt (empty completion)";
109215
+
109216
+ class WorkflowPromptEmptyCompletionFailure extends Error {
109217
+ code = "provider_error";
109218
+ constructor() {
109219
+ super(EMPTY_COMPLETION_FAILURE_MESSAGE);
109220
+ this.name = "WorkflowPromptEmptyCompletionFailure";
109221
+ }
109222
+ }
109072
109223
 
109073
109224
  class WorkflowPromptModelFailure extends Error {
109074
109225
  cause;
@@ -110481,9 +110632,9 @@ class StageSessionController {
110481
110632
  if (continuationSession !== undefined) {
110482
110633
  const outcome = await this.continueWithPauseResume(continuationSession);
110483
110634
  if (outcome.kind === "continued") {
110484
- return {
110485
- terminalScanStartIndex: terminalScanStartIndex ?? this.lastPromptStartIndex ?? messagesBeforeAttempt.length
110486
- };
110635
+ const continuedScanStartIndex = terminalScanStartIndex ?? this.lastPromptStartIndex ?? messagesBeforeAttempt.length;
110636
+ this.throwIfEmptyCompletion(activeSession, continuedScanStartIndex);
110637
+ return { terminalScanStartIndex: continuedScanStartIndex };
110487
110638
  }
110488
110639
  this.dropRetainedPrompt(activeSession, retainedPrompt);
110489
110640
  retainedPrompt = undefined;
@@ -111007,6 +111158,7 @@ class StageSessionController {
111007
111158
  continue;
111008
111159
  }
111009
111160
  this.throwUnresolvedContextOverflowIfPresent();
111161
+ this.throwIfEmptyCompletion(activeSession, promptStartIndex);
111010
111162
  return { terminalScanStartIndex: promptStartIndex };
111011
111163
  } catch (err) {
111012
111164
  const pendingPauseAfterThrow = this.pauseControl.currentResume();
@@ -111159,6 +111311,17 @@ class StageSessionController {
111159
111311
  if (message !== undefined)
111160
111312
  throw unresolvedContextOverflowFailure(message);
111161
111313
  }
111314
+ throwIfEmptyCompletion(activeSession, promptStartIndex) {
111315
+ if (this.structuredOutputCapture === undefined || this.structuredOutputCapture.called)
111316
+ return;
111317
+ if (this.disposed || hasAssistantMessageSince(activeSession.messages, promptStartIndex))
111318
+ return;
111319
+ if (this.opts.signal?.aborted)
111320
+ throw this.workflowAbortReason();
111321
+ if (this.startupWait.signal.aborted)
111322
+ throw this.abortReason ?? new DOMException("stage aborted", "AbortError");
111323
+ throw new WorkflowPromptEmptyCompletionFailure;
111324
+ }
111162
111325
  }
111163
111326
 
111164
111327
  // dist/builtin/workflows/src/runs/foreground/stage-runner-output.ts
@@ -116748,7 +116911,7 @@ async function reloadWorkflowStageResources(resourceLoader, options) {
116748
116911
  // dist/builtin/workflows/src/extension/wiring.ts
116749
116912
  var LATE_STAGE_MESSAGE_EVENT2 = "atomic:workflow-stage-late-message";
116750
116913
  function isTestContext() {
116751
- return process.env.NODE_TEST_CONTEXT !== undefined || false;
116914
+ return process.env.NODE_TEST_CONTEXT !== undefined || process.env.NODE_ENV === "test";
116752
116915
  }
116753
116916
  function attachSettingsManager(error, settingsManager) {
116754
116917
  if (error !== null && (typeof error === "object" || typeof error === "function")) {
@@ -121439,9 +121602,9 @@ var DEFAULT_PROMPT_GUIDANCE = [
121439
121602
  - For transcripts, avoid whole-file reads. Get \`sessionFile\`/\`transcriptPath\` from \`stages\` or \`stage\`, preserve the exact path and platform separators, search with \`rg\`/\`grep\`, and read small relevant ranges; use explicit \`tail\` or \`limit\` only for a bounded preview.`,
121440
121603
  `**Workflow authoring and handoffs**:
121441
121604
  - When a user asks to create or edit a workflow, clarify only unresolved requirements that materially affect its purpose, inputs, stages, handoffs, validation, success criteria, or starter pattern. Read the workflow docs/examples, implement the TypeScript definition with normal coding tools, reload it, and run representative test inputs before presenting it. Use the create-spec skill when it adds value; it is not mandatory when context is already sufficient.
121442
- - Author domain-appropriate verification and truthful evidence into worker, reviewer and final handoff prompts: agent-browser for browsers; prefer herdr for terminal automation/testing on macOS, Linux and Windows, install it if missing when permitted, and fall back to tmux/native Windows psmux when installation or use is not possible. Preserve the herdr skill's explicit-request and HERDR_ENV=1 requirements. Use PyAutoGUI for desktop CUA and suitable native tooling for accessible simulator/emulator windows, with dedicated sessions, permissions and safe input cleanup. Exercise actual scenarios, not browser recordings presented as terminal/iOS proof. See docs/workflows/verification.md for source-backed commands and safety.
121605
+ - Author domain-appropriate verification and truthful evidence into worker, reviewer and final handoff prompts: agent-browser for what its skill covers (websites and web apps in Chrome/Chromium, Electron desktop apps, Slack, cloud browsers) and Cua Driver for anything else or whenever agent-browser hits a limitation; prefer herdr for terminal automation/testing on macOS, Linux and Windows, install it if missing when permitted, and fall back to tmux/native Windows psmux when installation or use is not possible. Preserve the herdr skill's explicit-request and HERDR_ENV=1 requirements. For desktop, simulator and emulator CUA use Cua Driver with one rule for the face: when a model chooses the next action (any workflow stage acting outside \`ctx.tool\`), use the cua-driver skill and one-shot \`cua-driver call <tool>\` commands; when workflow TypeScript code owns the sequence and the postcondition, use the @trycua/cua-driver TypeScript SDK inside \`ctx.tool(name, args, fn, { timeoutMs })\`, forward \`signal\`, and run the readiness preflight as its own \`ctx.tool\` that calls \`ctx.exit({ status: "blocked", reason })\` on a missing permission; a blocked author exit is terminal and not resumable, so after the user grants the permission start a new run, whose fresh preflight checks again. Acquire the driver with \`CuaDriver.connect()\` when \`cua-driver status\` reports a running daemon and fall back to \`CuaDriver.create()\` only when no daemon is reachable; on macOS the in-process fallback attributes Accessibility/Screen Recording grants to the node host rather than CuaDriver.app. Every path sets CUA_DRIVER_RS_TELEMETRY_ENABLED=false in the environment before the first driver call; the SDK path requires node (preferred) or bun on the host, so install one in a single bounded attempt when both are missing and report a refused or failed install as the limitation. Use dedicated sessions and permissions, and stop before destructive actions. Exercise actual scenarios, not browser recordings presented as terminal/iOS proof. See docs/workflows/verification.md, docs/workflows/authoring.md and docs/computer-use.md for source-backed commands and safety.
121443
121606
  - Choose verification tools from observed installed/cached capabilities. Install missing tools/plugins when online permissions permit; known offline/restricted environments need no prohibited download attempt, otherwise use a bounded setup check. Continue available authoritative repository checks and report what could not run. During authorized coding, initialize missing qlty config or hand-author .qlty/qlty.toml from bundled references; preserve existing/read-only config, select useful low-noise checks and baseline metrics, and distinguish prepared configuration from executed checks. Optional qlty installation is not a universal blocker.
121444
- - For authorized media publication, detect the provider, inspect/redact commit-and-scenario evidence, and on supported GitHub use gh >=2.99.0 native repeatable --attach on issue/pr create/edit/comment after checking installed help. Read back hosted links before claiming success; unsupported hosts/versions/providers retain truthful local/manual fallback. Do not upload secrets or use unrelated hosts.
121607
+ - For authorized media publication, detect the provider, inspect/redact commit-and-scenario evidence, and on supported GitHub use gh >=2.99.0 native repeatable --attach on issue/pr create/edit/comment after checking installed help. When a final stage creates the PR, attach the image and video evidence the run produced (cua-driver \`screenshot_out_file\` before/after PNGs, agent-browser screenshots and \`record\` recordings) to the PR body with \`gh pr create --body-file <body.md> --attach <file>\`, each referenced next to the scenario it proves. Read back hosted links before claiming success; unsupported hosts/versions/providers retain truthful local/manual fallback. Do not upload secrets or use unrelated hosts.
121445
121608
  - After creating and reloading a newly authored custom workflow, close the loop by stating the folder containing the workflow file just written, for example \`.atomic/workflows/\`, in this shape: \`Custom workflow created. You can inspect its code at: <workflow-folder-path>\`. Do this only for newly created custom workflows, never builtin or pre-existing workflows.
121446
121609
  - Keep a small, readable workflow in one entry file and write it for human maintainers. Keep the graph and control flow visible in the top-level workflow entry file, use stage names that state each stage's responsibility, and make its inputs, outputs, evidence, and success contract explicit. A developer reading the entry file from top to bottom should be able to identify the graph, branches, gates, artifacts, and stop conditions. Avoid both monolithic prompt blobs and gratuitous fragmentation. Do not split short one-use prompts, create one file per stage, add wrapper-only modules, hide the graph across files, or use line counts alone as a module boundary.
121447
121610
  - When a meaningful source boundary improves clarity, reuse, ownership, or testability, keep the graph and control flow in the top-level workflow entry file and extract cohesive concerns such as long or reused prompt builders, shared TypeBox schemas and workflow-specific types, model-policy constants shared by several stages, deterministic helpers with their own testable behavior, or reusable child workflow definitions into a subdirectory below the top-level discovery directory — either one owned by a single workflow or a shared support directory. Project and user discovery scans only top-level \`.ts\`/\`.js\`/\`.mjs\`/\`.cjs\` files in the workflow directory, so those support modules are not scanned as extra top-level workflow candidates; use \`.js\` import extensions from TypeScript source.