@bastani/atomic 0.9.74 → 0.9.75-alpha.1

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 (383) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  5. package/dist/builtin/subagents/package.json +3 -3
  6. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +8 -10
  7. package/dist/builtin/subagents/skills/agent-desktop/SKILL.md +9 -5
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +7 -1
  9. package/dist/builtin/web-access/package.json +2 -2
  10. package/dist/builtin/workflows/CHANGELOG.md +32 -0
  11. package/dist/builtin/workflows/README.md +5 -2
  12. package/dist/builtin/workflows/builtin/{chunk-m8eg152f.js → chunk-89we7r4p.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-a4fdm2cw.js → chunk-8yfssw01.js} +1 -1
  14. package/dist/builtin/workflows/builtin/{chunk-774myqzs.js → chunk-v8mb0005.js} +366 -45
  15. package/dist/builtin/workflows/builtin/{chunk-d5cxskkp.js → chunk-wh2p4qjg.js} +2 -2
  16. package/dist/builtin/workflows/builtin/goal.js +2 -2
  17. package/dist/builtin/workflows/builtin/index.d.ts +10 -0
  18. package/dist/builtin/workflows/builtin/index.js +4 -4
  19. package/dist/builtin/workflows/builtin/open-claude-design.d.ts +12 -0
  20. package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
  21. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  22. package/dist/builtin/workflows/package.json +2 -2
  23. package/dist/builtin/workflows/skills/impeccable/SKILL.md +4 -4
  24. package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
  25. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -2
  26. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +1 -1
  27. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +1 -1
  28. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +4 -4
  29. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
  30. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +3 -2
  31. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +3 -3
  32. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +1 -1
  33. package/dist/builtin/workflows/skills/impeccable/reference/document.md +3 -3
  34. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +19 -0
  35. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +15 -8
  36. package/dist/builtin/workflows/skills/impeccable/reference/init.md +2 -0
  37. package/dist/builtin/workflows/skills/impeccable/reference/live.md +8 -6
  38. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +4 -4
  39. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +0 -1
  40. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +1 -1
  41. package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -1
  42. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +2 -2
  43. package/dist/builtin/workflows/skills/impeccable/scripts/engine-checksums.txt +9 -0
  44. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +98 -44
  45. package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +101 -34
  46. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +6 -2
  47. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +4 -1
  48. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +444 -144
  49. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +3 -1
  50. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +2 -2
  51. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +13 -11
  52. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +10 -8
  53. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_2.md +143 -0
  54. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_haiku_5_5.md +11 -7
  55. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +3 -3
  56. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +6 -2
  57. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +7 -7
  58. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +2 -2
  59. package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5_5.md +3 -3
  60. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +2 -2
  61. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +2 -2
  62. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +6 -5
  63. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_sol.md +4 -4
  64. package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_1_terra.md +2 -2
  65. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -3
  66. package/dist/builtin/workflows/skills/skill-creator/scripts/aggregate_benchmark.py +0 -0
  67. package/dist/builtin/workflows/skills/skill-creator/scripts/generate_report.py +0 -0
  68. package/dist/builtin/workflows/skills/skill-creator/scripts/improve_description.py +0 -0
  69. package/dist/builtin/workflows/skills/skill-creator/scripts/package_skill.py +0 -0
  70. package/dist/builtin/workflows/skills/skill-creator/scripts/quick_validate.py +0 -0
  71. package/dist/builtin/workflows/skills/skill-creator/scripts/run_eval.py +0 -0
  72. package/dist/builtin/workflows/skills/skill-creator/scripts/run_loop.py +0 -0
  73. package/dist/builtin/workflows/skills/unslop/SKILL.md +15 -34
  74. package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +1 -0
  75. package/dist/builtin/workflows/src/durable/journal/values.d.ts +2 -0
  76. package/dist/builtin/workflows/src/extension/index.bundle.mjs +809 -410
  77. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +695 -305
  78. package/dist/builtin/workflows/src/index.js +685 -295
  79. package/dist/builtin/workflows/src/local-worker-entry.mjs +695 -305
  80. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -6
  81. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -2
  82. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +2 -0
  83. package/dist/bun/app-host-modules.d.ts +1 -1
  84. package/dist/bun/app-host-modules.d.ts.map +1 -1
  85. package/dist/bun/app-host-modules.js.map +1 -1
  86. package/dist/bun/internal-workflow-worker.d.ts +2 -0
  87. package/dist/bun/internal-workflow-worker.d.ts.map +1 -1
  88. package/dist/bun/internal-workflow-worker.js +2 -1
  89. package/dist/bun/internal-workflow-worker.js.map +1 -1
  90. package/dist/codemode-worker.js +2 -0
  91. package/dist/config.d.ts +8 -0
  92. package/dist/config.d.ts.map +1 -1
  93. package/dist/config.js +14 -0
  94. package/dist/config.js.map +1 -1
  95. package/dist/core/agent-session-bash.d.ts.map +1 -1
  96. package/dist/core/agent-session-bash.js +2 -1
  97. package/dist/core/agent-session-bash.js.map +1 -1
  98. package/dist/core/agent-session-blueprint-environment.d.ts +10 -0
  99. package/dist/core/agent-session-blueprint-environment.d.ts.map +1 -0
  100. package/dist/core/agent-session-blueprint-environment.js +28 -0
  101. package/dist/core/agent-session-blueprint-environment.js.map +1 -0
  102. package/dist/core/agent-session-events.d.ts.map +1 -1
  103. package/dist/core/agent-session-events.js +2 -0
  104. package/dist/core/agent-session-events.js.map +1 -1
  105. package/dist/core/agent-session-methods.d.ts +1 -0
  106. package/dist/core/agent-session-methods.d.ts.map +1 -1
  107. package/dist/core/agent-session-methods.js.map +1 -1
  108. package/dist/core/agent-session-retry.d.ts.map +1 -1
  109. package/dist/core/agent-session-retry.js +14 -4
  110. package/dist/core/agent-session-retry.js.map +1 -1
  111. package/dist/core/agent-session-runtime.d.ts +20 -0
  112. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  113. package/dist/core/agent-session-runtime.js +55 -6
  114. package/dist/core/agent-session-runtime.js.map +1 -1
  115. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  116. package/dist/core/agent-session-tool-registry.js +2 -1
  117. package/dist/core/agent-session-tool-registry.js.map +1 -1
  118. package/dist/core/agent-session.d.ts +2 -0
  119. package/dist/core/agent-session.d.ts.map +1 -1
  120. package/dist/core/agent-session.js +2 -0
  121. package/dist/core/agent-session.js.map +1 -1
  122. package/dist/core/async-scope.d.ts +13 -0
  123. package/dist/core/async-scope.d.ts.map +1 -0
  124. package/dist/core/async-scope.js +20 -0
  125. package/dist/core/async-scope.js.map +1 -0
  126. package/dist/core/cache-warmer.d.ts +3 -14
  127. package/dist/core/cache-warmer.d.ts.map +1 -1
  128. package/dist/core/cache-warmer.js +8 -60
  129. package/dist/core/cache-warmer.js.map +1 -1
  130. package/dist/core/extensions/extension-work.js +2 -2
  131. package/dist/core/extensions/extension-work.js.map +1 -1
  132. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
  133. package/dist/core/extensions/loader-host-modules.js +3 -1
  134. package/dist/core/extensions/loader-host-modules.js.map +1 -1
  135. package/dist/core/extensions/ui-types.d.ts +2 -1
  136. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  137. package/dist/core/extensions/ui-types.js.map +1 -1
  138. package/dist/core/extensions/workflow-events.d.ts +1 -1
  139. package/dist/core/extensions/workflow-events.d.ts.map +1 -1
  140. package/dist/core/extensions/workflow-events.js.map +1 -1
  141. package/dist/core/extensions/workflow-run-control.d.ts +4 -2
  142. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  143. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  144. package/dist/core/model-fallback-failures.d.ts +6 -0
  145. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  146. package/dist/core/model-fallback-failures.js +10 -1
  147. package/dist/core/model-fallback-failures.js.map +1 -1
  148. package/dist/core/preferred-providers.d.ts +19 -0
  149. package/dist/core/preferred-providers.d.ts.map +1 -0
  150. package/dist/core/preferred-providers.js +25 -0
  151. package/dist/core/preferred-providers.js.map +1 -0
  152. package/dist/core/provider-alias.d.ts.map +1 -1
  153. package/dist/core/provider-alias.js +4 -0
  154. package/dist/core/provider-alias.js.map +1 -1
  155. package/dist/core/provider-composer.d.ts.map +1 -1
  156. package/dist/core/provider-composer.js +1 -0
  157. package/dist/core/provider-composer.js.map +1 -1
  158. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  159. package/dist/core/remote-catalog-provider.js +3 -0
  160. package/dist/core/remote-catalog-provider.js.map +1 -1
  161. package/dist/core/resume/blueprint/action-expressions.d.ts +32 -0
  162. package/dist/core/resume/blueprint/action-expressions.d.ts.map +1 -0
  163. package/dist/core/resume/blueprint/action-expressions.js +389 -0
  164. package/dist/core/resume/blueprint/action-expressions.js.map +1 -0
  165. package/dist/core/resume/blueprint/actions.d.ts +90 -0
  166. package/dist/core/resume/blueprint/actions.d.ts.map +1 -0
  167. package/dist/core/resume/blueprint/actions.js +818 -0
  168. package/dist/core/resume/blueprint/actions.js.map +1 -0
  169. package/dist/core/resume/blueprint/build.d.ts +102 -0
  170. package/dist/core/resume/blueprint/build.d.ts.map +1 -0
  171. package/dist/core/resume/blueprint/build.js +535 -0
  172. package/dist/core/resume/blueprint/build.js.map +1 -0
  173. package/dist/core/resume/blueprint/context.d.ts +11 -0
  174. package/dist/core/resume/blueprint/context.d.ts.map +1 -0
  175. package/dist/core/resume/blueprint/context.js +106 -0
  176. package/dist/core/resume/blueprint/context.js.map +1 -0
  177. package/dist/core/resume/blueprint/envrc.d.ts +19 -0
  178. package/dist/core/resume/blueprint/envrc.d.ts.map +1 -0
  179. package/dist/core/resume/blueprint/envrc.js +77 -0
  180. package/dist/core/resume/blueprint/envrc.js.map +1 -0
  181. package/dist/core/resume/blueprint/errors.d.ts +179 -0
  182. package/dist/core/resume/blueprint/errors.d.ts.map +1 -0
  183. package/dist/core/resume/blueprint/errors.js +169 -0
  184. package/dist/core/resume/blueprint/errors.js.map +1 -0
  185. package/dist/core/resume/blueprint/ledger.d.ts +51 -0
  186. package/dist/core/resume/blueprint/ledger.d.ts.map +1 -0
  187. package/dist/core/resume/blueprint/ledger.js +119 -0
  188. package/dist/core/resume/blueprint/ledger.js.map +1 -0
  189. package/dist/core/resume/blueprint/notices.d.ts +14 -0
  190. package/dist/core/resume/blueprint/notices.d.ts.map +1 -0
  191. package/dist/core/resume/blueprint/notices.js +44 -0
  192. package/dist/core/resume/blueprint/notices.js.map +1 -0
  193. package/dist/core/resume/blueprint/process.d.ts +44 -0
  194. package/dist/core/resume/blueprint/process.d.ts.map +1 -0
  195. package/dist/core/resume/blueprint/process.js +142 -0
  196. package/dist/core/resume/blueprint/process.js.map +1 -0
  197. package/dist/core/resume/blueprint/resume.d.ts +73 -0
  198. package/dist/core/resume/blueprint/resume.d.ts.map +1 -0
  199. package/dist/core/resume/blueprint/resume.js +206 -0
  200. package/dist/core/resume/blueprint/resume.js.map +1 -0
  201. package/dist/core/resume/blueprint/schema.d.ts +26 -0
  202. package/dist/core/resume/blueprint/schema.d.ts.map +1 -0
  203. package/dist/core/resume/blueprint/schema.js +243 -0
  204. package/dist/core/resume/blueprint/schema.js.map +1 -0
  205. package/dist/core/resume/blueprint/steps.d.ts +54 -0
  206. package/dist/core/resume/blueprint/steps.d.ts.map +1 -0
  207. package/dist/core/resume/blueprint/steps.js +155 -0
  208. package/dist/core/resume/blueprint/steps.js.map +1 -0
  209. package/dist/core/resume/blueprint/types.d.ts +63 -0
  210. package/dist/core/resume/blueprint/types.d.ts.map +1 -0
  211. package/dist/core/resume/blueprint/types.js +2 -0
  212. package/dist/core/resume/blueprint/types.js.map +1 -0
  213. package/dist/core/resume/errors.d.ts +7 -35
  214. package/dist/core/resume/errors.d.ts.map +1 -1
  215. package/dist/core/resume/errors.js +1 -21
  216. package/dist/core/resume/errors.js.map +1 -1
  217. package/dist/core/resume/index.d.ts +12 -4
  218. package/dist/core/resume/index.d.ts.map +1 -1
  219. package/dist/core/resume/index.js +11 -4
  220. package/dist/core/resume/index.js.map +1 -1
  221. package/dist/core/resume/run-setup.d.ts +36 -15
  222. package/dist/core/resume/run-setup.d.ts.map +1 -1
  223. package/dist/core/resume/run-setup.js +70 -54
  224. package/dist/core/resume/run-setup.js.map +1 -1
  225. package/dist/core/resume/session-resume.d.ts +34 -20
  226. package/dist/core/resume/session-resume.d.ts.map +1 -1
  227. package/dist/core/resume/session-resume.js +244 -106
  228. package/dist/core/resume/session-resume.js.map +1 -1
  229. package/dist/core/retry-policy.d.ts +19 -1
  230. package/dist/core/retry-policy.d.ts.map +1 -1
  231. package/dist/core/retry-policy.js +26 -1
  232. package/dist/core/retry-policy.js.map +1 -1
  233. package/dist/core/sdk.js +1 -1
  234. package/dist/core/sdk.js.map +1 -1
  235. package/dist/core/session-cwd.d.ts +56 -1
  236. package/dist/core/session-cwd.d.ts.map +1 -1
  237. package/dist/core/session-cwd.js +94 -4
  238. package/dist/core/session-cwd.js.map +1 -1
  239. package/dist/core/session-manager-core.d.ts +1 -1
  240. package/dist/core/session-manager-core.d.ts.map +1 -1
  241. package/dist/core/session-manager-core.js +10 -5
  242. package/dist/core/session-manager-core.js.map +1 -1
  243. package/dist/core/session-worktree-snapshots.d.ts +11 -0
  244. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  245. package/dist/core/session-worktree-snapshots.js +10 -4
  246. package/dist/core/session-worktree-snapshots.js.map +1 -1
  247. package/dist/core/settings-defaults.d.ts +1 -1
  248. package/dist/core/settings-defaults.d.ts.map +1 -1
  249. package/dist/core/settings-defaults.js +1 -1
  250. package/dist/core/settings-defaults.js.map +1 -1
  251. package/dist/core/settings-manager-basic-accessors.d.ts +3 -2
  252. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  253. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  254. package/dist/core/settings-schema.d.ts.map +1 -1
  255. package/dist/core/settings-schema.js +2 -1
  256. package/dist/core/settings-schema.js.map +1 -1
  257. package/dist/core/slash-commands.d.ts.map +1 -1
  258. package/dist/core/slash-commands.js +4 -0
  259. package/dist/core/slash-commands.js.map +1 -1
  260. package/dist/core/storage/write-ahead-log.d.ts +2 -1
  261. package/dist/core/storage/write-ahead-log.d.ts.map +1 -1
  262. package/dist/core/storage/write-ahead-log.js +27 -6
  263. package/dist/core/storage/write-ahead-log.js.map +1 -1
  264. package/dist/core/system-prompt.d.ts.map +1 -1
  265. package/dist/core/system-prompt.js +10 -0
  266. package/dist/core/system-prompt.js.map +1 -1
  267. package/dist/core/tools/file-tool-errors.d.ts +1 -1
  268. package/dist/core/tools/file-tool-errors.js +1 -1
  269. package/dist/core/tools/file-tool-errors.js.map +1 -1
  270. package/dist/core/tools/find.d.ts.map +1 -1
  271. package/dist/core/tools/find.js +52 -26
  272. package/dist/core/tools/find.js.map +1 -1
  273. package/dist/core/tools/grep.d.ts +2 -0
  274. package/dist/core/tools/grep.d.ts.map +1 -1
  275. package/dist/core/tools/grep.js.map +1 -1
  276. package/dist/core/tools/powershell.d.ts.map +1 -1
  277. package/dist/core/tools/powershell.js +10 -2
  278. package/dist/core/tools/powershell.js.map +1 -1
  279. package/dist/core/tools/tool-concurrency.d.ts.map +1 -1
  280. package/dist/core/tools/tool-concurrency.js +2 -2
  281. package/dist/core/tools/tool-concurrency.js.map +1 -1
  282. package/dist/index.d.ts +3 -2
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +2 -1
  285. package/dist/index.js.map +1 -1
  286. package/dist/main-session.d.ts +12 -4
  287. package/dist/main-session.d.ts.map +1 -1
  288. package/dist/main-session.js +28 -4
  289. package/dist/main-session.js.map +1 -1
  290. package/dist/main.d.ts.map +1 -1
  291. package/dist/main.js +6 -8
  292. package/dist/main.js.map +1 -1
  293. package/dist/modes/interactive/components/chat-session-host.d.ts +5 -1
  294. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  295. package/dist/modes/interactive/components/chat-session-host.js +6 -1
  296. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  297. package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  298. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  299. package/dist/modes/interactive/components/oauth-selector.js +34 -13
  300. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  301. package/dist/modes/interactive/components/provider-brand.d.ts +16 -0
  302. package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
  303. package/dist/modes/interactive/components/provider-brand.js +67 -0
  304. package/dist/modes/interactive/components/provider-brand.js.map +1 -0
  305. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  306. package/dist/modes/interactive/interactive-auth-routing.js +8 -6
  307. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  308. package/dist/modes/interactive/interactive-extension-dialogs.js +4 -3
  309. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  310. package/dist/modes/interactive/interactive-extension-runtime.js +8 -3
  311. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  312. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  313. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  314. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  315. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  316. package/dist/modes/interactive/interactive-mode-surface.d.ts +12 -2
  317. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  318. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  319. package/dist/modes/interactive/interactive-session-routing.js +59 -21
  320. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  321. package/dist/modes/interactive/interactive-slash-commands.js +23 -12
  322. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  323. package/dist/modes/interactive/login-provider-options.d.ts.map +1 -1
  324. package/dist/modes/interactive/login-provider-options.js +2 -1
  325. package/dist/modes/interactive/login-provider-options.js.map +1 -1
  326. package/dist/modes/interactive-engine/isolated-runtime.d.ts +2 -0
  327. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  328. package/dist/modes/interactive-engine/isolated-runtime.js +8 -3
  329. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  330. package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
  331. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  332. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  333. package/dist/modes/rpc/rpc-client.d.ts +0 -1
  334. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  335. package/dist/modes/rpc/rpc-client.js +2 -18
  336. package/dist/modes/rpc/rpc-client.js.map +1 -1
  337. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  338. package/dist/modes/rpc/rpc-command-handler.js +8 -2
  339. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  340. package/dist/modes/rpc/rpc-error-decoding.d.ts +7 -0
  341. package/dist/modes/rpc/rpc-error-decoding.d.ts.map +1 -0
  342. package/dist/modes/rpc/rpc-error-decoding.js +25 -0
  343. package/dist/modes/rpc/rpc-error-decoding.js.map +1 -0
  344. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  345. package/dist/modes/rpc/rpc-responses.js +12 -0
  346. package/dist/modes/rpc/rpc-responses.js.map +1 -1
  347. package/dist/modes/rpc/rpc-types.d.ts +11 -0
  348. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  349. package/dist/modes/rpc/rpc-types.js.map +1 -1
  350. package/dist/package-manager-cli.d.ts.map +1 -1
  351. package/dist/package-manager-cli.js +12 -3
  352. package/dist/package-manager-cli.js.map +1 -1
  353. package/docs/background-tasks.md +1 -1
  354. package/docs/codemode.md +22 -0
  355. package/docs/extensions/api-reference.md +27 -1
  356. package/docs/extensions/authoring.md +1 -1
  357. package/docs/extensions/ui.md +1 -1
  358. package/docs/getting-started/first-session.md +1 -1
  359. package/docs/guides/resume-on-any-machine.md +72 -19
  360. package/docs/models/evals.md +85 -17
  361. package/docs/models/reference.md +1 -1
  362. package/docs/providers.md +38 -5
  363. package/docs/reference/cli.md +2 -0
  364. package/docs/rpc/protocol.md +11 -1
  365. package/docs/sdk/reference.md +36 -4
  366. package/docs/sdk.md +2 -2
  367. package/docs/sessions.md +11 -1
  368. package/docs/settings.md +7 -2
  369. package/docs/skills.md +3 -3
  370. package/docs/storage.md +1 -1
  371. package/docs/tools.md +3 -1
  372. package/docs/workflows/api-reference.md +14 -12
  373. package/docs/workflows/authoring.md +29 -1
  374. package/docs/workflows/builtins.md +9 -1
  375. package/docs/workflows/operations.md +8 -8
  376. package/docs/worktree-snapshots.md +3 -2
  377. package/npm-shrinkwrap.json +83 -67
  378. package/package.json +7 -7
  379. package/schemas/settings.schema.json +3 -2
  380. package/dist/core/resume/setup-hook.d.ts +0 -69
  381. package/dist/core/resume/setup-hook.d.ts.map +0 -1
  382. package/dist/core/resume/setup-hook.js +0 -261
  383. package/dist/core/resume/setup-hook.js.map +0 -1
@@ -4,14 +4,266 @@ import {
4
4
  } from "./chunk-rqbmeg5x.js";
5
5
 
6
6
  // dist/builtin/workflows/builtin/open-claude-design.ts
7
- import { Type as Type2 } from "typebox";
7
+ import { Type as Type3 } from "typebox";
8
+
9
+ // dist/builtin/workflows/builtin/open-claude-design-images.ts
10
+ import { existsSync } from "node:fs";
11
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
12
+ import { dirname, join } from "node:path";
13
+ import { AuthStorage } from "@bastani/atomic";
14
+ import { builtinModels } from "@bastani/pi-ai/providers/all";
15
+ import { Type } from "typebox";
16
+ var referenceImagesStatusSchema = Type.Object({
17
+ status: Type.Union([Type.Literal("skipped"), Type.Literal("generated"), Type.Literal("failed")]),
18
+ reason: Type.Optional(Type.String()),
19
+ model: Type.Optional(Type.String()),
20
+ paths: Type.Array(Type.String()),
21
+ retryable: Type.Optional(Type.Boolean())
22
+ }, {
23
+ additionalProperties: false,
24
+ description: "Outcome of the reference image step: status (skipped, generated, or failed), the reason, the model used, the image paths under <artifact_dir>/references/, and whether a failure is retryable."
25
+ });
26
+ var REFERENCE_IMAGES_DIRNAME = "references";
27
+ var REFERENCE_IMAGES_TOOL_TIMEOUT_MS = 15 * 60000;
28
+ var IMAGE_REQUEST_TIMEOUT_MS = 5 * 60000;
29
+ var IMAGE_REQUEST_MAX_RETRIES = 1;
30
+ var IMAGE_SIZE = "1536x1024";
31
+ var PRODUCT_EXCERPT_CHARS = 1000;
32
+ var DESIGN_EXCERPT_CHARS = 1500;
33
+ var REFERENCES_EXCERPT_CHARS = 1500;
34
+ var REFERENCE_IMAGE_DIRECTIONS = [
35
+ {
36
+ slug: "reference-led",
37
+ composition: "Reference-led. Stay closest to the curated references and the project's design system: lead with the composition the strongest reference uses and show the product concept it implies."
38
+ },
39
+ {
40
+ slug: "brand-forward",
41
+ composition: "Brand-forward. One dominant, memorable focal move at large scale carries the brand; generous space, and every other region holds still at real reading size."
42
+ },
43
+ {
44
+ slug: "information-dense",
45
+ composition: "Information-dense. Summary-led, with a compact structured grid and a tight hierarchy that shows more real content at real reading size."
46
+ }
47
+ ];
48
+ var SURFACE_BY_OUTPUT_TYPE = {
49
+ prototype: "desktop web app screen",
50
+ wireframe: "high-fidelity desktop screen",
51
+ page: "desktop web page",
52
+ component: "desktop screen showing the component in two or three representative contexts",
53
+ theme: "representative product screen showing the theme applied across navigation, type, color and components",
54
+ tokens: "style-guide screen showing the color, type and spacing tokens applied to real components"
55
+ };
56
+ var GPT_IMAGE_ID = /^(?:[^/]+\/)?gpt-image-(?<version>\d+(?:\.\d+)*)(?:-(?<variant>.+))?$/;
57
+ var PREFERRED_VARIANTS = ["flare", "sunburst"];
58
+ var LOWER_TIER_VARIANTS = new Set(["mini", "nano"]);
59
+ var PREFERRED_FALLBACK_PROVIDER = "openrouter";
60
+ function parseGptImageId(id) {
61
+ const groups = GPT_IMAGE_ID.exec(id)?.groups;
62
+ if (groups?.version === undefined)
63
+ return;
64
+ return { version: groups.version.split(".").map(Number), variant: groups.variant };
65
+ }
66
+ function compareVersions(left, right) {
67
+ const differences = Array.from({ length: Math.max(left.length, right.length) }, (_, index) => (left[index] ?? 0) - (right[index] ?? 0));
68
+ return differences.find((difference) => difference !== 0) ?? 0;
69
+ }
70
+ function variantRank(variant) {
71
+ if (variant === undefined)
72
+ return 0;
73
+ if (LOWER_TIER_VARIANTS.has(variant))
74
+ return -1;
75
+ const preferred = PREFERRED_VARIANTS.indexOf(variant);
76
+ return preferred === -1 ? 1 : PREFERRED_VARIANTS.length - preferred + 1;
77
+ }
78
+ function compareText(left, right) {
79
+ return left.localeCompare(right, "en");
80
+ }
81
+ function fallbackProviderRank(model) {
82
+ return model.provider === PREFERRED_FALLBACK_PROVIDER ? 0 : 1;
83
+ }
84
+ function compareImageModels(left, right) {
85
+ const leftGpt = parseGptImageId(left.id);
86
+ const rightGpt = parseGptImageId(right.id);
87
+ if (leftGpt !== undefined && rightGpt !== undefined) {
88
+ return compareVersions(rightGpt.version, leftGpt.version) || variantRank(rightGpt.variant) - variantRank(leftGpt.variant) || compareText(left.provider, right.provider) || compareText(left.id, right.id);
89
+ }
90
+ if (leftGpt !== undefined)
91
+ return -1;
92
+ if (rightGpt !== undefined)
93
+ return 1;
94
+ return fallbackProviderRank(left) - fallbackProviderRank(right) || compareText(left.provider, right.provider) || compareText(right.id, left.id);
95
+ }
96
+ function selectReferenceImageModel(available, override) {
97
+ const requested = override?.trim() ?? "";
98
+ if (requested.length > 0)
99
+ return available.find((model) => `${model.provider}/${model.id}` === requested);
100
+ return [...available].sort(compareImageModels)[0];
101
+ }
102
+ function excerpt(label, text, limit) {
103
+ const trimmed = text?.trim() ?? "";
104
+ if (trimmed.length === 0)
105
+ return;
106
+ return `${label}:
107
+ ${trimmed.slice(0, limit).trimEnd()}`;
108
+ }
109
+ function buildReferenceImagePrompt(context, direction) {
110
+ return [
111
+ `A finished ${SURFACE_BY_OUTPUT_TYPE[context.outputType]} for: ${context.brief.trim()}`,
112
+ "Render the surface edge to edge with crisp, readable text and real, brief-specific content. No browser window, device, desk or poster framing, and no lorem ipsum.",
113
+ `Direction: ${direction.composition}`,
114
+ excerpt("Curated references (inspiration to adapt into this product; do not copy their layout or content)", context.curatedReferences, REFERENCES_EXCERPT_CHARS),
115
+ excerpt("Design system (DESIGN.md)", context.designContext, DESIGN_EXCERPT_CHARS),
116
+ excerpt("Product context (PRODUCT.md)", context.productContext, PRODUCT_EXCERPT_CHARS),
117
+ "Keep the palette, typography and component character the context describes; the direction changes only composition and emphasis."
118
+ ].filter((section) => section !== undefined).join(`
119
+
120
+ `);
121
+ }
122
+ async function readOptionalText(path) {
123
+ try {
124
+ return await readFile(path, "utf8");
125
+ } catch (error) {
126
+ const code = error.code;
127
+ if (code === "ENOENT" || code === "ENOTDIR")
128
+ return;
129
+ throw error;
130
+ }
131
+ }
132
+ var IMAGE_EXTENSIONS = new Map([
133
+ ["image/png", "png"],
134
+ ["image/jpeg", "jpg"],
135
+ ["image/webp", "webp"]
136
+ ]);
137
+ function firstWritableImage(output) {
138
+ for (const block of output) {
139
+ if (block.type !== "image" || block.data.length === 0)
140
+ continue;
141
+ const extension = IMAGE_EXTENSIONS.get(block.mimeType);
142
+ if (extension !== undefined)
143
+ return { data: block.data, extension };
144
+ }
145
+ return;
146
+ }
147
+ async function renderDirection(input) {
148
+ const { provider, model, prompt, outputBase, signal } = input;
149
+ let result;
150
+ try {
151
+ result = await provider.generateImages(model, { input: [{ type: "text", text: prompt }] }, {
152
+ signal,
153
+ quality: "high",
154
+ size: IMAGE_SIZE,
155
+ n: 1,
156
+ timeoutMs: IMAGE_REQUEST_TIMEOUT_MS,
157
+ maxRetries: IMAGE_REQUEST_MAX_RETRIES
158
+ });
159
+ } catch {
160
+ signal.throwIfAborted();
161
+ return { failure: { reason: "unexpected-error" } };
162
+ }
163
+ signal.throwIfAborted();
164
+ if (result.stopReason !== "stop") {
165
+ return {
166
+ failure: {
167
+ reason: result.error?.code ?? "unclassified",
168
+ ...result.error === undefined ? {} : { retryable: result.error.retryable }
169
+ }
170
+ };
171
+ }
172
+ const image = firstWritableImage(result.output);
173
+ if (image === undefined)
174
+ return {};
175
+ const path = `${outputBase}.${image.extension}`;
176
+ try {
177
+ await mkdir(dirname(path), { recursive: true });
178
+ await writeFile(path, Buffer.from(image.data, "base64"));
179
+ } catch {
180
+ return { failure: { reason: "write-failed" } };
181
+ }
182
+ return { path };
183
+ }
184
+ async function loadPromptContext(request) {
185
+ const [productContext, designContext] = await Promise.all([
186
+ readOptionalText(join(request.workflowCwd, "PRODUCT.md")),
187
+ readOptionalText(join(request.workflowCwd, "DESIGN.md"))
188
+ ]);
189
+ return {
190
+ brief: request.brief,
191
+ outputType: request.outputType,
192
+ curatedReferences: request.curatedReferences,
193
+ productContext,
194
+ designContext
195
+ };
196
+ }
197
+ function directionOutputBase(artifactDir, index, direction) {
198
+ return join(artifactDir, REFERENCE_IMAGES_DIRNAME, `${String(index + 1).padStart(2, "0")}-${direction.slug}`);
199
+ }
200
+ async function renderReferenceImages(request, provider, model, signal) {
201
+ const promptContext = await loadPromptContext(request);
202
+ const outcomes = await Promise.all(REFERENCE_IMAGE_DIRECTIONS.map((direction, index) => renderDirection({
203
+ provider,
204
+ model,
205
+ prompt: buildReferenceImagePrompt(promptContext, direction),
206
+ outputBase: directionOutputBase(request.artifactDir, index, direction),
207
+ signal
208
+ })));
209
+ const modelId = `${model.provider}/${model.id}`;
210
+ const paths = outcomes.flatMap(({ path }) => path === undefined ? [] : [path]);
211
+ if (paths.length > 0)
212
+ return { status: "generated", model: modelId, paths };
213
+ const failure = outcomes.find((outcome) => outcome.failure !== undefined)?.failure;
214
+ return {
215
+ status: "failed",
216
+ reason: failure?.reason ?? "no-images-written",
217
+ model: modelId,
218
+ paths: [],
219
+ ...failure?.retryable === undefined ? {} : { retryable: failure.retryable }
220
+ };
221
+ }
222
+ function skipped(reason) {
223
+ return { status: "skipped", reason, paths: [] };
224
+ }
225
+ async function generateReferenceImages(request, createProvider, signal) {
226
+ try {
227
+ const provider = await createProvider();
228
+ const available = await provider.availableImageModels(signal);
229
+ if (available.length === 0)
230
+ return skipped("no-image-model");
231
+ const model = selectReferenceImageModel(available, request.imageModel);
232
+ if (model === undefined)
233
+ return skipped("image-model-unavailable");
234
+ return await renderReferenceImages(request, provider, model, signal);
235
+ } catch {
236
+ signal.throwIfAborted();
237
+ return { status: "failed", reason: "unexpected-error", paths: [] };
238
+ }
239
+ }
240
+ async function createBuiltinReferenceImageProvider(credentials = AuthStorage.create()) {
241
+ const models = builtinModels({ credentials });
242
+ return {
243
+ availableImageModels: (signal) => models.getAvailableOfType("image", undefined, { signal }),
244
+ generateImages: (model, context, options) => models.generateImages(model, context, options)
245
+ };
246
+ }
247
+ async function runReferenceImagesStep(tool, request, deps = {}) {
248
+ const createProvider = deps.createImageProvider ?? createBuiltinReferenceImageProvider;
249
+ const outcome = await tool("reference-images", {
250
+ brief: request.brief,
251
+ outputType: request.outputType,
252
+ artifactDir: request.artifactDir,
253
+ ...request.imageModel === undefined ? {} : { imageModel: request.imageModel }
254
+ }, ({ signal }) => generateReferenceImages(request, createProvider, signal), { timeoutMs: REFERENCE_IMAGES_TOOL_TIMEOUT_MS, failureMode: "return" });
255
+ return outcome.ok ? outcome.value : { status: "failed", reason: "tool-failed", paths: [] };
256
+ }
257
+ function existingReferenceImagePaths(status) {
258
+ return status.status === "generated" ? status.paths.filter((path) => existsSync(path)) : [];
259
+ }
8
260
 
9
261
  // dist/builtin/workflows/builtin/open-claude-design-utils.ts
10
262
  import { spawnSync } from "node:child_process";
11
263
  import { mkdirSync } from "node:fs";
12
264
  import { tmpdir, userInfo } from "node:os";
13
- import { join } from "node:path";
14
- import { Type } from "typebox";
265
+ import { dirname as dirname2, join as join2, relative, sep } from "node:path";
266
+ import { Type as Type2 } from "typebox";
15
267
  import { createChildProcessEnvironment } from "@bastani/atomic";
16
268
  var OUTPUT_TYPES = [
17
269
  "prototype",
@@ -38,10 +290,10 @@ function normalizeOutputType(value) {
38
290
  function shouldEarlyExitForBrowser(browserAvailable, nodeEnv) {
39
291
  return !browserAvailable && nodeEnv !== "test";
40
292
  }
41
- var discoveryDecisionSchema = Type.Object({
42
- brief: Type.String(),
43
- output_type: Type.Union([...OUTPUT_TYPES].map((value) => Type.Literal(value))),
44
- references: Type.Array(Type.String())
293
+ var discoveryDecisionSchema = Type2.Object({
294
+ brief: Type2.String(),
295
+ output_type: Type2.Union([...OUTPUT_TYPES].map((value) => Type2.Literal(value))),
296
+ references: Type2.Array(Type2.String())
45
297
  }, { additionalProperties: false });
46
298
  function discoveryDecisionFromResult(result, fallbackBrief) {
47
299
  const decision = result.structured;
@@ -53,6 +305,12 @@ function discoveryDecisionFromResult(result, fallbackBrief) {
53
305
  references
54
306
  };
55
307
  }
308
+ function referenceImageFileUrl(path) {
309
+ return `file://${path}`;
310
+ }
311
+ function referenceImageRelativeSrc(specPath, imagePath) {
312
+ return relative(dirname2(specPath), imagePath).split(sep).join("/");
313
+ }
56
314
  function joinResults(results) {
57
315
  return results.map((result) => `### ${result.name}
58
316
 
@@ -67,32 +325,32 @@ function tmpArtifactBase() {
67
325
  try {
68
326
  user = userInfo().username.replace(/[^A-Za-z0-9._-]/g, "_") || "default";
69
327
  } catch {}
70
- return join(tmpdir(), `open-claude-design-${user}`);
328
+ return join2(tmpdir(), `open-claude-design-${user}`);
71
329
  }
72
330
  function prepareArtifactDir(cwd = process.cwd()) {
73
331
  const runId = `${new Date().toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
74
332
  const tmpCandidates = [
75
- join(tmpArtifactBase(), runId),
76
- join(tmpdir(), "open-claude-design", runId)
333
+ join2(tmpArtifactBase(), runId),
334
+ join2(tmpdir(), "open-claude-design", runId)
77
335
  ];
78
- const candidates = process.env.NODE_ENV === "test" ? tmpCandidates : [join(cwd, "specs", "design", runId), ...tmpCandidates];
336
+ const candidates = process.env.NODE_ENV === "test" ? tmpCandidates : [join2(cwd, "specs", "design", runId), ...tmpCandidates];
79
337
  for (const candidate of candidates) {
80
338
  try {
81
339
  mkdirSync(candidate, { recursive: true });
82
340
  return {
83
341
  runId,
84
342
  artifactDir: candidate,
85
- previewPath: join(candidate, "preview.html"),
86
- specPath: join(candidate, "spec.html")
343
+ previewPath: join2(candidate, "preview.html"),
344
+ specPath: join2(candidate, "spec.html")
87
345
  };
88
346
  } catch {}
89
347
  }
90
- const fallback = join(tmpArtifactBase(), runId);
348
+ const fallback = join2(tmpArtifactBase(), runId);
91
349
  return {
92
350
  runId,
93
351
  artifactDir: fallback,
94
- previewPath: join(fallback, "preview.html"),
95
- specPath: join(fallback, "spec.html")
352
+ previewPath: join2(fallback, "preview.html"),
353
+ specPath: join2(fallback, "spec.html")
96
354
  };
97
355
  }
98
356
  var HTML_PREVIEW_RULES = [
@@ -382,9 +640,18 @@ ${input.event.raw}
382
640
  `);
383
641
  }
384
642
  function buildLiveSessionStartPrompt(input) {
643
+ const referenceImagePaths = input.referenceImagePaths ?? [];
385
644
  return [
386
645
  `<preview_path>${input.previewPath}</preview_path>`,
387
646
  `<preview_file_url>${input.previewFileUrl}</preview_file_url>`,
647
+ ...referenceImagePaths.length > 0 ? [
648
+ [
649
+ "<reference_images>",
650
+ ...referenceImagePaths.map((path) => `${path} (${referenceImageFileUrl(path)})`),
651
+ "</reference_images>"
652
+ ].join(`
653
+ `)
654
+ ] : [],
388
655
  `<browser_use_guidelines>${input.browserBootstrapRules}</browser_use_guidelines>`,
389
656
  "<role>You are an opinionated staff design engineer opening an impeccable `live` review session.</role>",
390
657
  [
@@ -399,6 +666,9 @@ function buildLiveSessionStartPrompt(input) {
399
666
  "2. Print the live `http://` review URL in plain text, plus the preview file URL as the manual fallback, so anyone attaching to this run can find the review.",
400
667
  "3. Directly under the URL, print how the user ends the review, in plain text: click exit in the Impeccable overlay, close the browser tab, or say `exit live`. State that the review waits indefinitely until they do, and that ending it exports the design as it then stands, with no further round.",
401
668
  "4. Do NOT start a poll loop. The workflow owns polling and will call you back for each event that needs you. Ending your turn does not end the review.",
669
+ ...referenceImagePaths.length > 0 ? [
670
+ "5. Under the review URL, also print each <reference_images> path and file URL in plain text, labelled as the AI-generated design directions the preview was built from, so the user can open them beside the preview. Leave the live review tab on the preview."
671
+ ] : [],
402
672
  "</instructions>"
403
673
  ].join(`
404
674
  `),
@@ -410,7 +680,7 @@ function buildLiveSessionStartPrompt(input) {
410
680
 
411
681
  // dist/builtin/workflows/builtin/open-claude-design-setup.ts
412
682
  import { mkdirSync as mkdirSync2, writeFileSync } from "node:fs";
413
- import { join as join2 } from "node:path";
683
+ import { join as join3 } from "node:path";
414
684
  var GROUNDED_REPORTING = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
415
685
  function renderDiscoveryContext(discovery) {
416
686
  return [
@@ -486,10 +756,10 @@ var NO_REFERENCES_BRIEF = "Reference discovery was skipped. Generate from the pr
486
756
  var DESIGN_CONTEXT_FILENAME = "design-context.md";
487
757
  var REFERENCES_BRIEF_FILENAME = "references.md";
488
758
  function designContextPath(artifactDir) {
489
- return join2(artifactDir, DESIGN_CONTEXT_FILENAME);
759
+ return join3(artifactDir, DESIGN_CONTEXT_FILENAME);
490
760
  }
491
761
  function referencesBriefPath(artifactDir) {
492
- return join2(artifactDir, REFERENCES_BRIEF_FILENAME);
762
+ return join3(artifactDir, REFERENCES_BRIEF_FILENAME);
493
763
  }
494
764
  function buildReferenceDiscoveryPrompt(args) {
495
765
  const siteList = REFERENCE_DESIGN_SITES.map((site, index) => `${index + 1}. ${site.name} — ${site.url}`).join(`
@@ -515,8 +785,8 @@ function buildReferenceDiscoveryPrompt(args) {
515
785
  [
516
786
  "Use the agent-browser skill to open each gallery; if `agent-browser` reports a missing browser executable, follow the bootstrap rules and retry once.",
517
787
  "From each gallery, choose 1-3 fitting designs and CLICK INTO each actual live or project-detail page; do not capture only the grid or thumbnail.",
518
- `Capture motion across the entire page: start \`agent-browser record start ${join2(args.artifactDir, "ref-<site>-<n>.webm")}\`, scroll smoothly in small increments with waits (using repeated \`agent-browser scroll down 600\` or \`agent-browser mouse wheel 600\`) so animations fire and lazy content loads, then run \`agent-browser record stop\`.`,
519
- `Also run \`agent-browser screenshot ${join2(args.artifactDir, "ref-<site>-<n>.png")} --full\`; this still is the minimum when video is unavailable.`,
788
+ `Capture motion across the entire page: start \`agent-browser record start ${join3(args.artifactDir, "ref-<site>-<n>.webm")}\`, scroll smoothly in small increments with waits (using repeated \`agent-browser scroll down 600\` or \`agent-browser mouse wheel 600\`) so animations fire and lazy content loads, then run \`agent-browser record stop\`.`,
789
+ `Also run \`agent-browser screenshot ${join3(args.artifactDir, "ref-<site>-<n>.png")} --full\`; this still is the minimum when video is unavailable.`,
520
790
  "Record the actual destination URL, title, and author. For each reference, cite observed layout, typography, color, spacing, and motion traits rather than inferred traits.",
521
791
  "Assess fit against DESIGN.md, PRODUCT.md, and the ds-* discovery evidence in the design-context file; prefer on-brand references and flag departures.",
522
792
  "Use ask_user_question to ask which reference direction they prefer, offering 2-4 strongest options plus `None of these fit`. If none fit, ask them to provide a reference image, screenshot, URL, or local file path and record the answer.",
@@ -560,11 +830,17 @@ var LIVE_REVIEW_GATE_OPTIONS = [
560
830
  "Skip remaining review rounds and export as-is"
561
831
  ];
562
832
  function buildLiveReviewGateMessage(args) {
833
+ const referenceImagePaths = args.referenceImagePaths ?? [];
563
834
  return [
564
835
  `Design review session ${args.round} is ready for your browser review.`,
565
836
  "",
566
837
  `Preview file: ${args.previewPath}`,
567
838
  `Preview URL: ${args.previewFileUrl}`,
839
+ ...referenceImagePaths.length > 0 ? [
840
+ "",
841
+ "Reference images (AI-generated design directions the preview was built from):",
842
+ ...referenceImagePaths.map((path) => `- ${path} (${referenceImageFileUrl(path)})`)
843
+ ] : [],
568
844
  "",
569
845
  `"${LIVE_REVIEW_GATE_OPTIONS[0]}" opens an interactive browser session; the session-start stage prints the live http:// review URL as soon as its server is up (attach with /workflow connect to see it, or open the preview URL above directly).`,
570
846
  "The session is unbounded: pick elements, accept variants, and steer for as long as you like, and everything you accept lands in the preview as you go.",
@@ -586,7 +862,7 @@ function forkContinuationOptions(sessionId) {
586
862
  return sessionId === undefined ? {} : { context: "fork", forkFromSessionId: sessionId };
587
863
  }
588
864
  async function refineOpenClaudeDesign(options) {
589
- const { designContext, prompt, outputType, previewPath, previewFileUrl, browserBootstrapRules, designContextFile, referencesFile, designModelConfig, workflowCwd } = options;
865
+ const { designContext, prompt, outputType, previewPath, previewFileUrl, browserBootstrapRules, designContextFile, referencesFile, referenceImagePaths, designModelConfig, workflowCwd } = options;
590
866
  const importContext = options.importContext ?? "";
591
867
  const generated = await designContext.task("generate-1", {
592
868
  prompt: buildInitialGeneratePrompt({
@@ -595,12 +871,14 @@ async function refineOpenClaudeDesign(options) {
595
871
  previewPath,
596
872
  designContextFile,
597
873
  referencesFile,
874
+ referenceImagePaths,
598
875
  importContext
599
876
  }),
600
- reads: [designContextFile, referencesFile],
877
+ reads: [designContextFile, referencesFile, ...referenceImagePaths],
878
+ ...referenceImagePaths.length > 0 ? { taskNeeds: { needsImages: true } } : {},
601
879
  ...designModelConfig
602
880
  });
603
- const gateChoice = await options.ui.select(buildLiveReviewGateMessage({ round: 1, previewPath, previewFileUrl }), LIVE_REVIEW_GATE_OPTIONS).catch((error) => {
881
+ const gateChoice = await options.ui.select(buildLiveReviewGateMessage({ round: 1, previewPath, previewFileUrl, referenceImagePaths }), LIVE_REVIEW_GATE_OPTIONS).catch((error) => {
604
882
  if (isUiUnavailableRejection(error))
605
883
  return LIVE_REVIEW_GATE_OPTIONS[0];
606
884
  throw error;
@@ -612,6 +890,7 @@ async function refineOpenClaudeDesign(options) {
612
890
  reviewStageName: "user-feedback-1",
613
891
  previewPath,
614
892
  previewFileUrl,
893
+ referenceImagePaths,
615
894
  browserBootstrapRules,
616
895
  designModelConfig,
617
896
  workflowCwd
@@ -620,10 +899,10 @@ async function refineOpenClaudeDesign(options) {
620
899
  return { latestDesign: generated.text };
621
900
  }
622
901
  async function runLiveReviewSession(options) {
623
- const { designContext, round, reviewStageName, previewPath, previewFileUrl, browserBootstrapRules, designModelConfig, workflowCwd } = options;
902
+ const { designContext, round, reviewStageName, previewPath, previewFileUrl, referenceImagePaths, browserBootstrapRules, designModelConfig, workflowCwd } = options;
624
903
  let sessionId;
625
904
  const start = await designContext.task(`${reviewStageName}-start`, {
626
- prompt: buildLiveSessionStartPrompt({ previewPath, previewFileUrl, browserBootstrapRules, round }),
905
+ prompt: buildLiveSessionStartPrompt({ previewPath, previewFileUrl, referenceImagePaths, browserBootstrapRules, round }),
627
906
  ...designModelConfig
628
907
  });
629
908
  sessionId = start.sessionId;
@@ -647,6 +926,7 @@ async function runLiveReviewSession(options) {
647
926
  }
648
927
  }
649
928
  function buildInitialGeneratePrompt(args) {
929
+ const hasReferenceImages = args.referenceImagePaths.length > 0;
650
930
  return taggedPrompt([
651
931
  ["design_brief", args.prompt],
652
932
  [
@@ -658,6 +938,7 @@ function buildInitialGeneratePrompt(args) {
658
938
  "reference_inspiration_file",
659
939
  `Read the file at ${args.referencesFile} for the curated reference inspiration to heavily emulate.`
660
940
  ],
941
+ ...hasReferenceImages ? [["reference_images", renderReferenceImagesForGeneration(args.referenceImagePaths)]] : [],
661
942
  ["reference_precedence", REFERENCE_PRECEDENCE],
662
943
  ["preview_artifact_path", args.previewPath],
663
944
  ["html_rules", HTML_PREVIEW_RULES],
@@ -673,6 +954,7 @@ function buildInitialGeneratePrompt(args) {
673
954
  `First read the design-context and reference-inspiration files named above; they are the design system and reference authority for every decision. If a file is missing, say so and proceed from the brief.`,
674
955
  `Create the HTML artifact exactly at ${args.previewPath}.`,
675
956
  "Follow <reference_precedence>; heavily reference the reference-inspiration file without copying wholesale or inventing traits.",
957
+ ...hasReferenceImages ? [REFERENCE_IMAGE_GENERATION_RULE] : [],
676
958
  `Build the requested output_type (${args.outputType}): render full realistic layouts for prototypes/pages, or the component in at least three representative contexts.`,
677
959
  "Include structure, states, accessibility, responsive behavior, and integration notes as HTML comments so the preview stays clean.",
678
960
  "Use project language rather than generic placeholders when conventions exist. Add no features or abstractions beyond this design brief."
@@ -695,9 +977,30 @@ function buildInitialGeneratePrompt(args) {
695
977
  ]
696
978
  ]);
697
979
  }
980
+ var REFERENCE_IMAGE_GENERATION_RULE = "Open every file listed in <reference_images> with the read tool before designing. They are illustrations of distinct visual directions for this brief. Choose the direction that best serves the brief and the references, say which one in your overview, and match its composition, palette, type character, density, and imagery stance in the HTML; borrow from the other directions only where they agree. Do not copy text from the images or invent content from them: <reference_precedence> still wins on any conflict. If an image cannot be read, say so and continue from the other context.";
981
+ var REFERENCE_IMAGE_EXPORT_RULE = 'Add a "Design References" section after the Live Preview that shows every file listed in <reference_images> as `<img src="..." alt="...">` using the relative src given for it, with a caption naming its direction and a note that these are AI-generated illustrations rather than specifications. This is the one exception to the self-contained rule: link the image files by relative path and never inline their data into the HTML.';
982
+ function renderReferenceImageList(paths) {
983
+ return paths.map((path) => `- ${path}`).join(`
984
+ `);
985
+ }
986
+ function renderReferenceImagesForGeneration(paths) {
987
+ return [
988
+ "AI-generated design reference images for this brief, one per visual direction (named by file). They were rendered from the brief, PRODUCT.md/DESIGN.md, and the curated references.",
989
+ renderReferenceImageList(paths)
990
+ ].join(`
991
+ `);
992
+ }
993
+ function renderReferenceImagesForExport(specPath, paths) {
994
+ return [
995
+ "AI-generated design reference images, one per visual direction (named by file), stored next to the spec. They are illustrations, not specifications.",
996
+ ...paths.map((path) => `- ${path} (src="${referenceImageRelativeSrc(specPath, path)}")`)
997
+ ].join(`
998
+ `);
999
+ }
698
1000
  async function exportOpenClaudeDesign(options) {
699
- const { designContext, prompt, outputType, previewPath, previewFileUrl, specPath, specFileUrl, browserBootstrapRules, designContextFile, referencesFile, designModelConfig } = options;
1001
+ const { designContext, prompt, outputType, previewPath, previewFileUrl, specPath, specFileUrl, browserBootstrapRules, designContextFile, referencesFile, referenceImagePaths, designModelConfig } = options;
700
1002
  const latestDesign = options.latestDesign;
1003
+ const hasReferenceImages = referenceImagePaths.length > 0;
701
1004
  const handoff = await designContext.task("exporter", {
702
1005
  reads: [designContextFile, referencesFile],
703
1006
  prompt: taggedPrompt([
@@ -711,6 +1014,7 @@ async function exportOpenClaudeDesign(options) {
711
1014
  ],
712
1015
  ["preview_artifact_path", previewPath],
713
1016
  ["spec_artifact_path", specPath],
1017
+ ...hasReferenceImages ? [["reference_images", renderReferenceImagesForExport(specPath, referenceImagePaths)]] : [],
714
1018
  ["final_design_summary", "{previous}"],
715
1019
  ["html_rules", HTML_PREVIEW_RULES],
716
1020
  ["anti_design_slop_rules", ANTI_SLOP_RULES],
@@ -725,7 +1029,8 @@ async function exportOpenClaudeDesign(options) {
725
1029
  "First read the design-context file named above, then read preview_artifact_path as the canonical final design, and use the Write tool to create one self-contained HTML5 file at spec_artifact_path.",
726
1030
  'In order, include: sticky header with title/status/run id; Executive Summary; Live Preview embedding the full preview via `<iframe srcdoc="...">` or a side-by-side rendered copy in `<article class="preview-frame">`; the six DESIGN.md sections (Overview, Colors, Typography, Elevation, Components, Do\'s and Don\'ts) rendered with swatches, tables, and code blocks; Implementation handoff (Recommended files + components, Implementation steps, Usage example, Accessibility & responsive checklist, Validation commands, Known limitations); and an appendix linking the raw preview path.',
727
1031
  "Use dense legible typography, generous whitespace, monospaced code, rendered hex/oklch swatches, and copy-to-clipboard hints in HTML comments.",
728
- `Show the absolute preview path (${previewPath}) and file URL (${previewFileUrl}) prominently. Preserve assumptions and limitations; introduce no requirement absent from the final design or DESIGN.md.`
1032
+ `Show the absolute preview path (${previewPath}) and file URL (${previewFileUrl}) prominently. Preserve assumptions and limitations; introduce no requirement absent from the final design or DESIGN.md.`,
1033
+ ...hasReferenceImages ? [REFERENCE_IMAGE_EXPORT_RULE] : []
729
1034
  ].join(`
730
1035
  `)
731
1036
  ],
@@ -789,7 +1094,7 @@ async function exportOpenClaudeDesign(options) {
789
1094
  // dist/builtin/workflows/builtin/open-claude-design-runner.ts
790
1095
  var GROUNDED_REPORTING3 = "Before reporting progress, audit each claim against a tool result from this session. Report only work you can point to evidence for; say so explicitly when something is unverified.";
791
1096
  var DELEGATION_RULE = "Delegate further only work genuinely independent and too large for a handful of tool calls; do not delegate self-verification, and prefer one subagent over several.";
792
- async function runOpenClaudeDesignWorkflow(ctx) {
1097
+ async function runOpenClaudeDesignWorkflow(ctx, deps = {}) {
793
1098
  const designContext = ctx;
794
1099
  const agentBrowser = ensureAgentBrowser();
795
1100
  const browserBootstrapRules = buildAgentBrowserBootstrapRules(agentBrowser);
@@ -978,6 +1283,15 @@ async function runOpenClaudeDesignWorkflow(ctx) {
978
1283
  "Full design-system and reference evidence: read the design-context file."
979
1284
  ].join(`
980
1285
  `) : "No user reference was provided; infer the design direction from the brief, project design context, research, and curated reference inspiration.";
1286
+ const referenceImages = await runReferenceImagesStep(designContext.tool, {
1287
+ brief: designBrief,
1288
+ outputType,
1289
+ artifactDir,
1290
+ workflowCwd,
1291
+ curatedReferences: referencesBriefRaw,
1292
+ imageModel: inputs.image_model
1293
+ }, deps);
1294
+ const referenceImagePaths = existingReferenceImagePaths(referenceImages);
981
1295
  const refinement = await refineOpenClaudeDesign({
982
1296
  designContext,
983
1297
  prompt: designBrief,
@@ -987,6 +1301,7 @@ async function runOpenClaudeDesignWorkflow(ctx) {
987
1301
  browserBootstrapRules,
988
1302
  designContextFile,
989
1303
  referencesFile,
1304
+ referenceImagePaths,
990
1305
  designModelConfig,
991
1306
  workflowCwd,
992
1307
  importContext,
@@ -1004,6 +1319,7 @@ async function runOpenClaudeDesignWorkflow(ctx) {
1004
1319
  browserBootstrapRules,
1005
1320
  designContextFile,
1006
1321
  referencesFile,
1322
+ referenceImagePaths,
1007
1323
  latestDesign,
1008
1324
  designModelConfig
1009
1325
  });
@@ -1020,7 +1336,8 @@ async function runOpenClaudeDesignWorkflow(ctx) {
1020
1336
  preview_file_url: previewFileUrl,
1021
1337
  spec_path: specPath,
1022
1338
  spec_file_url: specFileUrl,
1023
- agent_browser_status: agentBrowser.summary
1339
+ agent_browser_status: agentBrowser.summary,
1340
+ reference_images_status: referenceImages
1024
1341
  };
1025
1342
  }
1026
1343
 
@@ -1030,27 +1347,31 @@ var open_claude_design_default = workflow({
1030
1347
  description: "AI-powered design workflow: combined discovery/init → design-system/reference research → curated reference discovery → HTML generation → one live review session → rich HTML handoff. The discovery stage asks what to build, the output type, and which references to emulate, then runs impeccable init for PRODUCT.md/DESIGN.md (references take precedence over project context). The user reviews the generated HTML in one live session.",
1031
1348
  heartbeatIntervalMinutes: 0,
1032
1349
  inputs: {
1033
- prompt: Type2.String({
1350
+ prompt: Type3.String({
1034
1351
  description: "What to design (for example, a dashboard, page, component, or prototype). The discovery stage refines this into a confirmed brief and asks for the output type and references."
1035
1352
  }),
1036
- discover_references: Type2.Boolean({
1353
+ discover_references: Type3.Boolean({
1037
1354
  default: true,
1038
1355
  description: "Discover beautiful, current reference designs from notable design websites (Awwwards, recent.design, Dribbble, Monet, Motionsites) and feed them to generation. Set false to skip the network/browser reference pass."
1039
- })
1356
+ }),
1357
+ image_model: Type3.Optional(Type3.String({
1358
+ description: "Image model for design reference images, as provider/id (for example openai-images/gpt-image-2.6-flare). Defaults to the newest available GPT Image model, then other image providers such as OpenRouter. Reference images are skipped when no image model is available."
1359
+ }))
1040
1360
  },
1041
1361
  outputs: {
1042
- output_type: Type2.Optional(Type2.String({ description: "Kind of design artifact produced." })),
1043
- design_system: Type2.Optional(Type2.String({ description: "Design system source used for generation: the project-derived design system." })),
1044
- artifact: Type2.Optional(Type2.String({ description: "Latest final design summary from the final preview artifact." })),
1045
- handoff: Type2.Optional(Type2.String({ description: "Final rich HTML spec and implementation handoff summary." })),
1046
- import_context: Type2.Optional(Type2.String({ description: "Reference-import context used during generation." })),
1047
- run_id: Type2.Optional(Type2.String({ description: "Per-run design workflow artifact identifier." })),
1048
- artifact_dir: Type2.Optional(Type2.String({ description: "Directory containing preview and spec artifacts." })),
1049
- preview_path: Type2.Optional(Type2.String({ description: "Absolute path to the generated preview.html file." })),
1050
- preview_file_url: Type2.Optional(Type2.String({ description: "file:// URL for the generated preview.html file." })),
1051
- spec_path: Type2.Optional(Type2.String({ description: "Absolute path to the generated spec.html file." })),
1052
- spec_file_url: Type2.Optional(Type2.String({ description: "file:// URL for the generated spec.html file." })),
1053
- agent_browser_status: Type2.Optional(Type2.String({ description: "Outcome of the initial deterministic step that ensures the agent-browser skill's `agent-browser` command is installed." }))
1362
+ output_type: Type3.Optional(Type3.String({ description: "Kind of design artifact produced." })),
1363
+ design_system: Type3.Optional(Type3.String({ description: "Design system source used for generation: the project-derived design system." })),
1364
+ artifact: Type3.Optional(Type3.String({ description: "Latest final design summary from the final preview artifact." })),
1365
+ handoff: Type3.Optional(Type3.String({ description: "Final rich HTML spec and implementation handoff summary." })),
1366
+ import_context: Type3.Optional(Type3.String({ description: "Reference-import context used during generation." })),
1367
+ run_id: Type3.Optional(Type3.String({ description: "Per-run design workflow artifact identifier." })),
1368
+ artifact_dir: Type3.Optional(Type3.String({ description: "Directory containing preview and spec artifacts." })),
1369
+ preview_path: Type3.Optional(Type3.String({ description: "Absolute path to the generated preview.html file." })),
1370
+ preview_file_url: Type3.Optional(Type3.String({ description: "file:// URL for the generated preview.html file." })),
1371
+ spec_path: Type3.Optional(Type3.String({ description: "Absolute path to the generated spec.html file." })),
1372
+ spec_file_url: Type3.Optional(Type3.String({ description: "file:// URL for the generated spec.html file." })),
1373
+ agent_browser_status: Type3.Optional(Type3.String({ description: "Outcome of the initial deterministic step that ensures the agent-browser skill's `agent-browser` command is installed." })),
1374
+ reference_images_status: Type3.Optional(referenceImagesStatusSchema)
1054
1375
  },
1055
1376
  run: async (ctx) => await runOpenClaudeDesignWorkflow(withBuiltinContext(ctx))
1056
1377
  });
@@ -3034,7 +3034,7 @@ function createStageStoreMethods(context) {
3034
3034
  }
3035
3035
  if (stage.status === "running" && context.observation.liveRunIds.has(runId)) {
3036
3036
  context.observation.executingStageIds.add(workflowActivityNodeKey(runId, stage.id));
3037
- } else if (stage.status === "waiting") {
3037
+ } else if (stage.status === "suspended") {
3038
3038
  context.observation.executingStageIds.delete(workflowActivityNodeKey(runId, stage.id));
3039
3039
  }
3040
3040
  context.bumpAndNotify({ runId, stageId: stage.id });
@@ -3360,7 +3360,7 @@ function createStageStoreMethods(context) {
3360
3360
  const resumedTs = nextControlTimestamp(resumedAt, stage.pausedAt);
3361
3361
  if (context.observation.liveRunIds.has(runId) && stage.wait === undefined)
3362
3362
  context.observation.executingStageIds.add(workflowActivityNodeKey(runId, stageId));
3363
- stage.status = stage.wait === undefined ? "running" : "waiting";
3363
+ stage.status = stage.wait === undefined ? "running" : "suspended";
3364
3364
  if (stage.startedAt !== undefined) {
3365
3365
  stage.pausedDurationMs = accumulatePausedDurationMs(stage.pausedDurationMs, stage.pausedAt, resumedTs);
3366
3366
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  goal_default
3
- } from "./chunk-m8eg152f.js";
4
- import"./chunk-d5cxskkp.js";
3
+ } from "./chunk-89we7r4p.js";
4
+ import"./chunk-wh2p4qjg.js";
5
5
  import"./chunk-8kdrnrpa.js";
6
6
  import"./chunk-gp0s6m45.js";
7
7
  import"./chunk-n1910xc4.js";