@bastani/atomic 0.9.74-alpha.1 → 0.9.75

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 +162 -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 +21 -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 +80 -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../../src/core/resume/blueprint/steps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,cAAc,CAAC;AAE7D,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAIrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,aAAa,EAMlB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5F,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,QAAkB,CAAC;AAEzD,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CA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AU,GAC1B,aAAa,CAOf;AAED,2HAA2H;AAC3H,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,aAAa,CAUjG;AA+ED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC/B,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,OAAO,EAAE,WAAW,GAClB,OAAO,CAAC,aAAa,CAAC,CAyCxB"}
@@ -0,0 +1,155 @@
1
+ import { writeSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { getPowerShellConfig, getShellConfig } from "../../../utils/shell.js";
4
+ import { runAction } from "./actions.js";
5
+ import { bashPath, evaluateEnvrc, shellQuote } from "./envrc.js";
6
+ import { BlueprintError, BlueprintStepFailedError, BlueprintStepTimedOutError, } from "./errors.js";
7
+ import { logTail, openStepLog, runLoggedProcess, } from "./process.js";
8
+ /** How long one step may run before it is stopped: 3 hours, as in Devin. */
9
+ export const BLUEPRINT_STEP_TIMEOUT_MS = 3 * 60 * 60_000;
10
+ function stepLabel(step, section, index) {
11
+ return step.name ?? `${section} step ${index + 1}`;
12
+ }
13
+ function describeCommand(step) {
14
+ return step.kind === "run" ? step.run : `uses ${step.uses}`;
15
+ }
16
+ /** The bash script of a `run` step: the build's `$ENVRC` is sourced and the step's own variables win over it. */
17
+ function bashScript(step) {
18
+ const own = Object.entries(step.env).map(([name, value]) => `export ${name}=${shellQuote(value)}`);
19
+ return ["set -a", '[ -f "$ENVRC" ] && . "$ENVRC"', "set +a", ...own, "set -e", step.run, ""].join("\n");
20
+ }
21
+ /** Whether a `run` step goes to PowerShell: only on Windows, and only when its blueprint asks for it. */
22
+ export function runsInPowerShell(shell, platform) {
23
+ return shell === "powershell" && platform === "windows";
24
+ }
25
+ /** The PowerShell process of a `run` step. `evaluated` is the environment the build's `$ENVRC` gives the build's own. */
26
+ export function powerShellProcess(step, context, powerShell, evaluated) {
27
+ return {
28
+ command: powerShell.shell,
29
+ args: [...powerShell.args, `$ErrorActionPreference = 'Stop'; ${step.run}`],
30
+ cwd: context.cwd,
31
+ env: { ...evaluated, ...step.env, ENVRC: context.envrcPath },
32
+ };
33
+ }
34
+ /** The bash process of a `run` step: its script is the last argument, or on stdin for a bash that cannot take it there. */
35
+ export function bashProcess(step, context, bash) {
36
+ const script = bashScript(step);
37
+ const byStdin = bash.commandTransport === "stdin";
38
+ return {
39
+ command: bash.shell,
40
+ args: byStdin ? bash.args : [...bash.args, script],
41
+ cwd: context.cwd,
42
+ env: { ...context.environment, ...step.env, ENVRC: bashPath(context.envrcPath) },
43
+ ...(byStdin ? { stdin: script } : {}),
44
+ };
45
+ }
46
+ function append(log, text) {
47
+ writeSync(log.fd, text);
48
+ }
49
+ async function startStep(step, location, total, context, log) {
50
+ append(log, [
51
+ `# blueprint: ${context.blueprint}`,
52
+ `# scope: ${context.scope}`,
53
+ `# section: ${location.section}`,
54
+ `# step: ${location.step} (${location.index + 1}/${total})`,
55
+ `# cwd: ${context.cwd}`,
56
+ "# command:",
57
+ describeCommand(step),
58
+ "# --- output ---",
59
+ "",
60
+ ].join("\n"));
61
+ if (step.kind === "uses") {
62
+ const environment = { ...(await evaluateEnvrc(context.envrcPath, context.environment)), ...step.env };
63
+ return runAction({
64
+ step: { uses: step.uses, inputs: step.with },
65
+ location: { ...location },
66
+ cwd: context.cwd,
67
+ env: environment,
68
+ envrcPath: context.envrcPath,
69
+ cacheDir: context.actionsCacheDir,
70
+ log,
71
+ timeoutMs: context.timeoutMs,
72
+ signal: context.signal,
73
+ fetchAction: context.fetchAction,
74
+ });
75
+ }
76
+ const options = { timeoutMs: context.timeoutMs, signal: context.signal };
77
+ if (runsInPowerShell(context.shell, context.platform)) {
78
+ const evaluated = await evaluateEnvrc(context.envrcPath, context.environment);
79
+ return runLoggedProcess(powerShellProcess(step, context, getPowerShellConfig(), evaluated), log, options);
80
+ }
81
+ return runLoggedProcess(bashProcess(step, context, getShellConfig()), log, options);
82
+ }
83
+ function describeExit(exit, timeoutMs) {
84
+ if (exit.timedOut)
85
+ return `# timed out after ${timeoutMs} ms and was stopped`;
86
+ if (exit.spawnError)
87
+ return `# could not be started: ${exit.spawnError.message}`;
88
+ if (exit.signal !== null)
89
+ return `# stopped by signal ${exit.signal}`;
90
+ return `# exit status ${exit.exitStatus}`;
91
+ }
92
+ function failureOf(exit, location, logPath, timeoutMs) {
93
+ if (exit.timedOut) {
94
+ return new BlueprintStepTimedOutError({
95
+ ...location,
96
+ logPath,
97
+ timeoutMs,
98
+ elapsedMs: exit.elapsedMs,
99
+ phase: location.section,
100
+ });
101
+ }
102
+ if (exit.exitStatus === 0 && exit.signal === null && exit.spawnError === undefined)
103
+ return undefined;
104
+ return new BlueprintStepFailedError({ ...location, exitStatus: exit.exitStatus, signal: exit.signal, logPath }, exit.spawnError);
105
+ }
106
+ /**
107
+ * Runs the steps of one section in order, each with its own log file, and stops at the first that fails: the steps
108
+ * after it do not run. A step fails when it exits non-zero, is stopped by a signal, cannot be started, times out, or
109
+ * is a `uses` step that cannot run. Nothing a step does throws, apart from `context.signal` aborting, which rejects
110
+ * with its reason: cancelling is not a failure.
111
+ */
112
+ export async function runSection(section, steps, context) {
113
+ for (const [index, step] of steps.entries()) {
114
+ context.signal?.throwIfAborted();
115
+ const location = {
116
+ blueprint: context.blueprint,
117
+ scope: context.scope,
118
+ section,
119
+ index,
120
+ step: stepLabel(step, section, index),
121
+ };
122
+ const logPath = join(context.logDirectory, `${context.logPrefix}-${section}-${index + 1}.log`);
123
+ let log;
124
+ let error;
125
+ try {
126
+ log = await openStepLog(logPath);
127
+ const exit = await startStep(step, location, steps.length, context, log);
128
+ append(log, `\n${describeExit(exit, context.timeoutMs)}\n`);
129
+ error = failureOf(exit, location, logPath, context.timeoutMs);
130
+ }
131
+ catch (thrown) {
132
+ if (context.signal?.aborted)
133
+ throw thrown;
134
+ const cause = thrown instanceof Error ? thrown : new Error(String(thrown));
135
+ if (log !== undefined)
136
+ append(log, `\n# failed: ${cause.message}\n`);
137
+ error =
138
+ thrown instanceof BlueprintError
139
+ ? thrown
140
+ : new BlueprintStepFailedError({ ...location, exitStatus: null, signal: null, logPath: log === undefined ? null : logPath }, cause);
141
+ }
142
+ finally {
143
+ await log?.close();
144
+ }
145
+ if (error !== undefined) {
146
+ const written = log === undefined ? null : logPath;
147
+ return {
148
+ completed: index,
149
+ failure: { error, logPath: written, outputTail: written === null ? "" : await logTail(written) },
150
+ };
151
+ }
152
+ }
153
+ return { completed: steps.length };
154
+ }
155
+ //# sourceMappingURL=steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../../src/core/resume/blueprint/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAoB,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAsB,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACN,cAAc,EAGd,wBAAwB,EAExB,0BAA0B,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAEN,OAAO,EACP,WAAW,EAEX,gBAAgB,GAEhB,MAAM,cAAc,CAAC;AAGtB,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;AAsCzD,SAAS,SAAS,CAAC,IAAmB,EAAE,OAAyB,EAAE,KAAa;IAC/E,OAAO,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,SAAS,KAAK,GAAG,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,eAAe,CAAC,IAAmB;IAC3C,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAA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,CACL,CAAC;QACN,CAAC;gBAAS,CAAC;YACV,MAAM,GAAG,EAAE,KAAK,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YACnD,OAAO;gBACN,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;aAChG,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import { writeSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { getPowerShellConfig, getShellConfig, type ShellConfig } from \"../../../utils/shell.ts\";\nimport { type ActionFetcher, runAction } from \"./actions.ts\";\nimport { bashPath, evaluateEnvrc, shellQuote } from \"./envrc.ts\";\nimport {\n\tBlueprintError,\n\ttype BlueprintScope,\n\ttype BlueprintSection,\n\tBlueprintStepFailedError,\n\ttype BlueprintStepLocation,\n\tBlueprintStepTimedOutError,\n} from \"./errors.ts\";\nimport {\n\ttype LoggedProcess,\n\tlogTail,\n\topenStepLog,\n\ttype ProcessExit,\n\trunLoggedProcess,\n\ttype StepLog,\n} from \"./process.ts\";\nimport type { BlueprintPlatform, BlueprintShell, BlueprintStep, RunStep } from \"./types.ts\";\n\n/** How long one step may run before it is stopped: 3 hours, as in Devin. */\nexport const BLUEPRINT_STEP_TIMEOUT_MS = 3 * 60 * 60_000;\n\n/** What a run of steps needs besides the steps themselves. */\nexport interface StepContext {\n\treadonly blueprint: string;\n\treadonly scope: BlueprintScope;\n\t/** Home directory for the global blueprint; the repository root or workspace directory otherwise. */\n\treadonly cwd: string;\n\treadonly shell: BlueprintShell;\n\treadonly platform: BlueprintPlatform;\n\t/** The build's `$ENVRC` file. */\n\treadonly envrcPath: string;\n\treadonly logDirectory: string;\n\t/** Makes this layer's log file names unique within the host's logs. */\n\treadonly logPrefix: string;\n\treadonly timeoutMs: number;\n\treadonly environment: NodeJS.ProcessEnv;\n\treadonly actionsCacheDir: string;\n\treadonly fetchAction?: ActionFetcher;\n\treadonly signal?: AbortSignal;\n}\n\n/** The first step of a section that did not succeed. */\nexport interface StepFailure {\n\treadonly error: BlueprintError;\n\t/** Null when the step's log could not be created. */\n\treadonly logPath: string | null;\n\t/** The end of the step's output. */\n\treadonly outputTail: string;\n}\n\nexport interface SectionResult {\n\t/** How many steps ran to completion. */\n\treadonly completed: number;\n\t/** Set when a step failed; the steps after it did not run. */\n\treadonly failure?: StepFailure;\n}\n\nfunction stepLabel(step: BlueprintStep, section: BlueprintSection, index: number): string {\n\treturn step.name ?? `${section} step ${index + 1}`;\n}\n\nfunction describeCommand(step: BlueprintStep): string {\n\treturn step.kind === \"run\" ? step.run : `uses ${step.uses}`;\n}\n\n/** The bash script of a `run` step: the build's `$ENVRC` is sourced and the step's own variables win over it. */\nfunction bashScript(step: RunStep): string {\n\tconst own = Object.entries(step.env).map(([name, value]) => `export ${name}=${shellQuote(value)}`);\n\treturn [\"set -a\", '[ -f \"$ENVRC\" ] && . \"$ENVRC\"', \"set +a\", ...own, \"set -e\", step.run, \"\"].join(\"\\n\");\n}\n\n/** Whether a `run` step goes to PowerShell: only on Windows, and only when its blueprint asks for it. */\nexport function runsInPowerShell(shell: BlueprintShell, platform: BlueprintPlatform): boolean {\n\treturn shell === \"powershell\" && platform === \"windows\";\n}\n\n/** The PowerShell process of a `run` step. `evaluated` is the environment the build's `$ENVRC` gives the build's own. */\nexport function powerShellProcess(\n\tstep: RunStep,\n\tcontext: StepContext,\n\tpowerShell: ShellConfig,\n\tevaluated: NodeJS.ProcessEnv,\n): LoggedProcess {\n\treturn {\n\t\tcommand: powerShell.shell,\n\t\targs: [...powerShell.args, `$ErrorActionPreference = 'Stop'; ${step.run}`],\n\t\tcwd: context.cwd,\n\t\tenv: { ...evaluated, ...step.env, ENVRC: context.envrcPath },\n\t};\n}\n\n/** The bash process of a `run` step: its script is the last argument, or on stdin for a bash that cannot take it there. */\nexport function bashProcess(step: RunStep, context: StepContext, bash: ShellConfig): LoggedProcess {\n\tconst script = bashScript(step);\n\tconst byStdin = bash.commandTransport === \"stdin\";\n\treturn {\n\t\tcommand: bash.shell,\n\t\targs: byStdin ? bash.args : [...bash.args, script],\n\t\tcwd: context.cwd,\n\t\tenv: { ...context.environment, ...step.env, ENVRC: bashPath(context.envrcPath) },\n\t\t...(byStdin ? { stdin: script } : {}),\n\t};\n}\n\nfunction append(log: StepLog, text: string): void {\n\twriteSync(log.fd, text);\n}\n\nasync function startStep(\n\tstep: BlueprintStep,\n\tlocation: BlueprintStepLocation,\n\ttotal: number,\n\tcontext: StepContext,\n\tlog: StepLog,\n): Promise<ProcessExit> {\n\tappend(\n\t\tlog,\n\t\t[\n\t\t\t`# blueprint: ${context.blueprint}`,\n\t\t\t`# scope: ${context.scope}`,\n\t\t\t`# section: ${location.section}`,\n\t\t\t`# step: ${location.step} (${location.index + 1}/${total})`,\n\t\t\t`# cwd: ${context.cwd}`,\n\t\t\t\"# command:\",\n\t\t\tdescribeCommand(step),\n\t\t\t\"# --- output ---\",\n\t\t\t\"\",\n\t\t].join(\"\\n\"),\n\t);\n\tif (step.kind === \"uses\") {\n\t\tconst environment = { ...(await evaluateEnvrc(context.envrcPath, context.environment)), ...step.env };\n\t\treturn runAction({\n\t\t\tstep: { uses: step.uses, inputs: step.with },\n\t\t\tlocation: { ...location },\n\t\t\tcwd: context.cwd,\n\t\t\tenv: environment,\n\t\t\tenvrcPath: context.envrcPath,\n\t\t\tcacheDir: context.actionsCacheDir,\n\t\t\tlog,\n\t\t\ttimeoutMs: context.timeoutMs,\n\t\t\tsignal: context.signal,\n\t\t\tfetchAction: context.fetchAction,\n\t\t});\n\t}\n\tconst options = { timeoutMs: context.timeoutMs, signal: context.signal };\n\tif (runsInPowerShell(context.shell, context.platform)) {\n\t\tconst evaluated = await evaluateEnvrc(context.envrcPath, context.environment);\n\t\treturn runLoggedProcess(powerShellProcess(step, context, getPowerShellConfig(), evaluated), log, options);\n\t}\n\treturn runLoggedProcess(bashProcess(step, context, getShellConfig()), log, options);\n}\n\nfunction describeExit(exit: ProcessExit, timeoutMs: number): string {\n\tif (exit.timedOut) return `# timed out after ${timeoutMs} ms and was stopped`;\n\tif (exit.spawnError) return `# could not be started: ${exit.spawnError.message}`;\n\tif (exit.signal !== null) return `# stopped by signal ${exit.signal}`;\n\treturn `# exit status ${exit.exitStatus}`;\n}\n\nfunction failureOf(\n\texit: ProcessExit,\n\tlocation: BlueprintStepLocation,\n\tlogPath: string,\n\ttimeoutMs: number,\n): BlueprintError | undefined {\n\tif (exit.timedOut) {\n\t\treturn new BlueprintStepTimedOutError({\n\t\t\t...location,\n\t\t\tlogPath,\n\t\t\ttimeoutMs,\n\t\t\telapsedMs: exit.elapsedMs,\n\t\t\tphase: location.section,\n\t\t});\n\t}\n\tif (exit.exitStatus === 0 && exit.signal === null && exit.spawnError === undefined) return undefined;\n\treturn new BlueprintStepFailedError(\n\t\t{ ...location, exitStatus: exit.exitStatus, signal: exit.signal, logPath },\n\t\texit.spawnError,\n\t);\n}\n\n/**\n * Runs the steps of one section in order, each with its own log file, and stops at the first that fails: the steps\n * after it do not run. A step fails when it exits non-zero, is stopped by a signal, cannot be started, times out, or\n * is a `uses` step that cannot run. Nothing a step does throws, apart from `context.signal` aborting, which rejects\n * with its reason: cancelling is not a failure.\n */\nexport async function runSection(\n\tsection: BlueprintSection,\n\tsteps: readonly BlueprintStep[],\n\tcontext: StepContext,\n): Promise<SectionResult> {\n\tfor (const [index, step] of steps.entries()) {\n\t\tcontext.signal?.throwIfAborted();\n\t\tconst location: BlueprintStepLocation = {\n\t\t\tblueprint: context.blueprint,\n\t\t\tscope: context.scope,\n\t\t\tsection,\n\t\t\tindex,\n\t\t\tstep: stepLabel(step, section, index),\n\t\t};\n\t\tconst logPath = join(context.logDirectory, `${context.logPrefix}-${section}-${index + 1}.log`);\n\t\tlet log: Awaited<ReturnType<typeof openStepLog>> | undefined;\n\t\tlet error: BlueprintError | undefined;\n\t\ttry {\n\t\t\tlog = await openStepLog(logPath);\n\t\t\tconst exit = await startStep(step, location, steps.length, context, log);\n\t\t\tappend(log, `\\n${describeExit(exit, context.timeoutMs)}\\n`);\n\t\t\terror = failureOf(exit, location, logPath, context.timeoutMs);\n\t\t} catch (thrown) {\n\t\t\tif (context.signal?.aborted) throw thrown;\n\t\t\tconst cause = thrown instanceof Error ? thrown : new Error(String(thrown));\n\t\t\tif (log !== undefined) append(log, `\\n# failed: ${cause.message}\\n`);\n\t\t\terror =\n\t\t\t\tthrown instanceof BlueprintError\n\t\t\t\t\t? thrown\n\t\t\t\t\t: new BlueprintStepFailedError(\n\t\t\t\t\t\t\t{ ...location, exitStatus: null, signal: null, logPath: log === undefined ? null : logPath },\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t);\n\t\t} finally {\n\t\t\tawait log?.close();\n\t\t}\n\t\tif (error !== undefined) {\n\t\t\tconst written = log === undefined ? null : logPath;\n\t\t\treturn {\n\t\t\t\tcompleted: index,\n\t\t\t\tfailure: { error, logPath: written, outputTail: written === null ? \"\" : await logTail(written) },\n\t\t\t};\n\t\t}\n\t}\n\treturn { completed: steps.length };\n}\n"]}
@@ -0,0 +1,63 @@
1
+ import type { BlueprintScope } from "./errors.ts";
2
+ /** The machine a step runs on. `default` and `linux` are one platform; `macos` and `windows` are always explicit. */
3
+ export type BlueprintPlatform = "linux" | "macos" | "windows";
4
+ /** `default` and `bash` run `run` steps in bash; `powershell` does so in PowerShell on Windows only. */
5
+ export type BlueprintShell = "default" | "powershell";
6
+ export interface RunStep {
7
+ readonly kind: "run";
8
+ readonly name: string | undefined;
9
+ readonly run: string;
10
+ /** Applies to this step only. Every value is a string. */
11
+ readonly env: Readonly<Record<string, string>>;
12
+ }
13
+ export interface UsesStep {
14
+ readonly kind: "uses";
15
+ readonly name: string | undefined;
16
+ /** `github.com/<owner>/<repo>[/<subpath>]@<ref>`. */
17
+ readonly uses: string;
18
+ /** Every value is a string. */
19
+ readonly with: Readonly<Record<string, string>>;
20
+ readonly env: Readonly<Record<string, string>>;
21
+ }
22
+ export type BlueprintStep = RunStep | UsesStep;
23
+ /** A `knowledge` item: reference information for the agent, never executed. */
24
+ export interface KnowledgeItem {
25
+ readonly name: string;
26
+ readonly contents: string;
27
+ }
28
+ /** A workspace a root blueprint's `includes` names. */
29
+ export interface IncludedWorkspace {
30
+ /** The `includes` entry as written. */
31
+ readonly entry: string;
32
+ /** The workspace directory, relative to the repository root, with `/` separators and no trailing slash. */
33
+ readonly directory: string;
34
+ /** The workspace blueprint file, relative to the repository root. */
35
+ readonly file: string;
36
+ }
37
+ /** One YAML document of a blueprint file: the platforms it targets and its sections. */
38
+ export interface BlueprintDocument {
39
+ /** The platform labels of `runs-on`, lower-cased, with `default` resolved to `linux`. */
40
+ readonly platforms: readonly string[];
41
+ readonly shell: BlueprintShell;
42
+ readonly initialize: readonly BlueprintStep[];
43
+ /** Maintenance has `run` steps only. */
44
+ readonly maintenance: readonly RunStep[];
45
+ readonly knowledge: readonly KnowledgeItem[];
46
+ /** Global blueprint only. */
47
+ readonly postBuild: readonly BlueprintStep[];
48
+ /** Root repository blueprint only. */
49
+ readonly includes: readonly IncludedWorkspace[];
50
+ }
51
+ export interface BlueprintWarning {
52
+ readonly code: "clone-ignored";
53
+ readonly blueprint: string;
54
+ readonly message: string;
55
+ }
56
+ /** A validated blueprint file. */
57
+ export interface ParsedBlueprint {
58
+ readonly path: string;
59
+ readonly scope: BlueprintScope;
60
+ readonly documents: readonly BlueprintDocument[];
61
+ readonly warnings: readonly BlueprintWarning[];
62
+ }
63
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+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AAM,CAAC;IACvB,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IACjC,yFAAyF;IACzF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,wCAAwC;IACxC,QAAQ,CAAC,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED,kCAAkC;AAClC,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/resume/blueprint/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BlueprintScope } from \"./errors.ts\";\n\n/** The machine a step runs on. `default` and `linux` are one platform; `macos` and `windows` are always explicit. */\nexport type BlueprintPlatform = \"linux\" | \"macos\" | \"windows\";\n/** `default` and `bash` run `run` steps in bash; `powershell` does so in PowerShell on Windows only. */\nexport type BlueprintShell = \"default\" | \"powershell\";\n\nexport interface RunStep {\n\treadonly kind: \"run\";\n\treadonly name: string | undefined;\n\treadonly run: string;\n\t/** Applies to this step only. Every value is a string. */\n\treadonly env: Readonly<Record<string, string>>;\n}\n\nexport interface UsesStep {\n\treadonly kind: \"uses\";\n\treadonly name: string | undefined;\n\t/** `github.com/<owner>/<repo>[/<subpath>]@<ref>`. */\n\treadonly uses: string;\n\t/** Every value is a string. */\n\treadonly with: Readonly<Record<string, string>>;\n\treadonly env: Readonly<Record<string, string>>;\n}\n\nexport type BlueprintStep = RunStep | UsesStep;\n\n/** A `knowledge` item: reference information for the agent, never executed. */\nexport interface KnowledgeItem {\n\treadonly name: string;\n\treadonly contents: string;\n}\n\n/** A workspace a root blueprint's `includes` names. */\nexport interface IncludedWorkspace {\n\t/** The `includes` entry as written. */\n\treadonly entry: string;\n\t/** The workspace directory, relative to the repository root, with `/` separators and no trailing slash. */\n\treadonly directory: string;\n\t/** The workspace blueprint file, relative to the repository root. */\n\treadonly file: string;\n}\n\n/** One YAML document of a blueprint file: the platforms it targets and its sections. */\nexport interface BlueprintDocument {\n\t/** The platform labels of `runs-on`, lower-cased, with `default` resolved to `linux`. */\n\treadonly platforms: readonly string[];\n\treadonly shell: BlueprintShell;\n\treadonly initialize: readonly BlueprintStep[];\n\t/** Maintenance has `run` steps only. */\n\treadonly maintenance: readonly RunStep[];\n\treadonly knowledge: readonly KnowledgeItem[];\n\t/** Global blueprint only. */\n\treadonly postBuild: readonly BlueprintStep[];\n\t/** Root repository blueprint only. */\n\treadonly includes: readonly IncludedWorkspace[];\n}\n\nexport interface BlueprintWarning {\n\treadonly code: \"clone-ignored\";\n\treadonly blueprint: string;\n\treadonly message: string;\n}\n\n/** A validated blueprint file. */\nexport interface ParsedBlueprint {\n\treadonly path: string;\n\treadonly scope: BlueprintScope;\n\treadonly documents: readonly BlueprintDocument[];\n\treadonly warnings: readonly BlueprintWarning[];\n}\n"]}
@@ -14,23 +14,24 @@ export type ResumeNotFoundErrorCode = "not-found";
14
14
  */
15
15
  export type ResumeNotFoundReason = "local-storage-not-joined" | "shared-miss";
16
16
  export type ResumePreconditionErrorCode = "preconditions-unmet";
17
- export type ResumeSetupHookErrorCode = "setup-hook-failed" | "setup-hook-timed-out";
18
17
  export type ResumeCatalogUnavailableErrorCode = "catalog-unavailable";
19
18
  export type ResumeCatalogTimeoutErrorCode = "catalog-timeout";
20
- export type ResumeErrorCode = ResumeNotFoundErrorCode | ResumePreconditionErrorCode | ResumeSetupHookErrorCode | ResumeCatalogUnavailableErrorCode | ResumeCatalogTimeoutErrorCode;
21
- export type ResumeErrorName = "ResumeError" | "ResumeNotFoundError" | "ResumePreconditionError" | "ResumeSetupHookError" | "ResumeCatalogUnavailableError" | "ResumeCatalogTimeoutError";
19
+ export type ResumeErrorCode = ResumeNotFoundErrorCode | ResumePreconditionErrorCode | ResumeCatalogUnavailableErrorCode | ResumeCatalogTimeoutErrorCode;
20
+ export type ResumeErrorName = "ResumeError" | "ResumeNotFoundError" | "ResumePreconditionError" | "ResumeCatalogUnavailableError" | "ResumeCatalogTimeoutError";
22
21
  /** The entry point that ran the check, for messages and fields. */
23
22
  export type ResumeEntryPoint = "cli" | "switch-session" | "create-agent-session" | "workflow-resume" | "rehydrate";
24
23
  /**
25
- * One unmet precondition: `subject` names the adapter, variable, file or hook (never a secret value), `why` says
26
- * what this resume needs it for, and `fix` is the command or setting that supplies it.
24
+ * One unmet precondition: `subject` names the adapter, variable or file (never a secret value), `why` says what this
25
+ * resume needs it for, and `fix` is the command or setting that supplies it. `checkout` is the recorded checkout path a
26
+ * precondition of restoring that checkout belongs to; problems that apply to the whole resume omit it.
27
27
  */
28
- export type ResumePreconditionProblemCode = "adapter-not-installed" | "credential-missing" | "credential-unreadable" | "git-unavailable" | "setup-hook-missing";
28
+ export type ResumePreconditionProblemCode = "adapter-not-installed" | "credential-missing" | "credential-unreadable" | "git-unavailable";
29
29
  export interface ResumePreconditionProblem {
30
30
  readonly code: ResumePreconditionProblemCode;
31
31
  readonly subject: string;
32
32
  readonly why: string;
33
33
  readonly fix: string;
34
+ readonly checkout?: string;
34
35
  }
35
36
  /**
36
37
  * Base of every failure that stops a session or workflow run from resuming on this node. Branch on `code` or the
@@ -75,34 +76,6 @@ export declare class ResumePreconditionError extends ResumeError {
75
76
  readonly problems: readonly ResumePreconditionProblem[];
76
77
  constructor(fields: ResumePreconditionErrorFields, cause?: Error);
77
78
  }
78
- export interface ResumeSetupHookErrorFields {
79
- /** `.atomic/setup` or the configured command's setting name. */
80
- readonly hook: string;
81
- readonly worktree: string;
82
- /** The recorded environment fingerprint the hook was asked to materialize. */
83
- readonly envHash: string;
84
- readonly exitStatus: number | null;
85
- readonly signal: string | null;
86
- /** The hook's captured output. */
87
- readonly logPath: string;
88
- readonly timeoutMs: number;
89
- readonly elapsedMs: number;
90
- }
91
- /** The setup hook a restored worktree needs ran and did not succeed. Resuming again runs it again. */
92
- export declare class ResumeSetupHookError extends ResumeError {
93
- readonly name: "ResumeSetupHookError";
94
- readonly code: ResumeSetupHookErrorCode;
95
- readonly hook: string;
96
- readonly worktree: string;
97
- readonly envHash: string;
98
- readonly exitStatus: number | null;
99
- readonly signal: string | null;
100
- readonly logPath: string;
101
- readonly timeoutMs: number;
102
- readonly elapsedMs: number;
103
- readonly phase: "setup-hook";
104
- constructor(code: ResumeSetupHookErrorCode, fields: ResumeSetupHookErrorFields, cause?: Error);
105
- }
106
79
  export interface ResumeCatalogUnavailableErrorFields {
107
80
  readonly subject: ResumeSubject;
108
81
  /** The id or selector being looked up, or null for a picker or "most recent" lookup. */
@@ -153,7 +126,6 @@ export declare class ResumeCatalogTimeoutError extends ResumeError {
153
126
  export declare function isResumeError(value: unknown): value is ResumeError;
154
127
  export declare function isResumeNotFoundError(value: unknown): value is ResumeNotFoundError;
155
128
  export declare function isResumePreconditionError(value: unknown): value is ResumePreconditionError;
156
- export declare function isResumeSetupHookError(value: unknown): value is ResumeSetupHookError;
157
129
  export declare function isResumeCatalogUnavailableError(value: unknown): value is ResumeCatalogUnavailableError;
158
130
  export declare function isResumeCatalogTimeoutError(value: unknown): value is ResumeCatalogTimeoutError;
159
131
  /** Whether anything in `error`'s cause chain is a resume failure that can be retried as-is. */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/resume/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,oBAAoB,EAEzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,qBAAqB,EAAE,GAChC;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;CAAE,CAAC;AAElF,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,KAAK,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAClD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,aAAa,CAAC;AAC9E,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AAChE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AACpF,MAAM,MAAM,iCAAiC,GAAG,qBAAqB,CAAC;AACtE,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,CAAC;AAC9D,MAAM,MAAM,eAAe,GACxB,uBAAuB,GACvB,2BAA2B,GAC3B,wBAAwB,GACxB,iCAAiC,GACjC,6BAA6B,CAAC;AACjC,MAAM,MAAM,eAAe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AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,qBAAqB,CAW9E;AAcD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAqB5F"}
@@ -41,22 +41,7 @@ export class ResumePreconditionError extends ResumeError {
41
41
  constructor(fields, cause) {
42
42
  if (fields.problems.length === 0)
43
43
  throw new RangeError("ResumePreconditionError needs at least one problem");
44
- super("preconditions-unmet", `Cannot resume here: ${fields.problems.map((problem) => `${problem.subject} (${problem.code}): ${problem.why}`).join("; ")}`, fields.problems.map((problem) => problem.fix).join(" Then: "), { entryPoint: fields.entryPoint, problems: fields.problems.map((problem) => ({ ...problem })) }, cause);
45
- }
46
- }
47
- /** The setup hook a restored worktree needs ran and did not succeed. Resuming again runs it again. */
48
- export class ResumeSetupHookError extends ResumeError {
49
- name = "ResumeSetupHookError";
50
- phase = "setup-hook";
51
- constructor(code, fields, cause) {
52
- const outcome = code === "setup-hook-timed-out"
53
- ? `did not finish within ${fields.timeoutMs} ms`
54
- : fields.signal !== null
55
- ? `was stopped by ${fields.signal}`
56
- : fields.exitStatus === null
57
- ? "could not be started"
58
- : `exited with status ${fields.exitStatus}`;
59
- super(code, `The setup hook ${fields.hook} ${outcome} in ${fields.worktree}`, `Fix the hook (its output is in ${fields.logPath}), then resume again; the hook runs again.`, { ...fields }, cause);
44
+ super("preconditions-unmet", `Cannot resume here: ${fields.problems.map((problem) => `${problem.subject} (${problem.code}): ${problem.why}`).join("; ")}`, [...new Set(fields.problems.map((problem) => problem.fix))].join(" Then: "), { entryPoint: fields.entryPoint, problems: fields.problems.map((problem) => ({ ...problem })) }, cause);
60
45
  }
61
46
  }
62
47
  const LOOKED_UP = { session: "the session", run: "the workflow run" };
@@ -86,7 +71,6 @@ const CODES = {
86
71
  ResumeError: [],
87
72
  ResumeNotFoundError: ["not-found"],
88
73
  ResumePreconditionError: ["preconditions-unmet"],
89
- ResumeSetupHookError: ["setup-hook-failed", "setup-hook-timed-out"],
90
74
  ResumeCatalogUnavailableError: ["catalog-unavailable"],
91
75
  ResumeCatalogTimeoutError: ["catalog-timeout"],
92
76
  };
@@ -111,9 +95,6 @@ export function isResumeNotFoundError(value) {
111
95
  export function isResumePreconditionError(value) {
112
96
  return value instanceof ResumePreconditionError || structurallyIs(value, "ResumePreconditionError");
113
97
  }
114
- export function isResumeSetupHookError(value) {
115
- return value instanceof ResumeSetupHookError || structurallyIs(value, "ResumeSetupHookError");
116
- }
117
98
  export function isResumeCatalogUnavailableError(value) {
118
99
  return value instanceof ResumeCatalogUnavailableError || structurallyIs(value, "ResumeCatalogUnavailableError");
119
100
  }
@@ -146,7 +127,6 @@ const REHYDRATORS = {
146
127
  ResumePreconditionError: (fields, _code, cause) => new ResumePreconditionError(fields, cause),
147
128
  ResumeCatalogTimeoutError: (fields, _code, cause) => new ResumeCatalogTimeoutError(fields, cause),
148
129
  ResumeCatalogUnavailableError: (fields, _code, cause) => new ResumeCatalogUnavailableError(fields, cause),
149
- ResumeSetupHookError: (fields, code, cause) => new ResumeSetupHookError(code, fields, cause),
150
130
  };
151
131
  /**
152
132
  * The error {@link serializeResumeError} produced, rebuilt after it crossed a process boundary as the same class, with
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/resume/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AA0D9B;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACnB,IAAI,GAAoB,aAAa,CAAC;IAC/C,IAAI,CAAkB;IACtB,IAAI,CAAS;IACb,SAAS,GAAY,KAAK,CAAC;IAC3B,MAAM,CAAoB;IAEnC,YAAY,IAAqB,EAAE,OAAe,EAAE,IA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AAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;QACjE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;QACvE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC5C,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC5C,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE;QACtD,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;QACtE,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;KAChH,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { SESSION_STORAGE_JOIN } from \"../agent-rehydrate-errors.ts\";\nimport {\n\tfindInCauseChain,\n\trehydrateErrorCause,\n\ttype SerializedErrorCause,\n\tserializeErrorCause,\n} from \"../error-contract.ts\";\n\nexport type ResumeErrorFieldValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly ResumeErrorFieldValue[]\n\t| { readonly [key: string]: ResumeErrorFieldValue };\nexport type ResumeErrorFields = { readonly [key: string]: ResumeErrorFieldValue };\n\n/** What a resume looked up: an interactive session or a workflow run. */\nexport type ResumeSubject = \"session\" | \"run\";\n\nexport type ResumeNotFoundErrorCode = \"not-found\";\n/**\n * `local-storage-not-joined`: this node uses storage only it can read, so work recorded on other nodes is invisible.\n * `shared-miss`: the shared storage was read and holds no match.\n */\nexport type ResumeNotFoundReason = \"local-storage-not-joined\" | \"shared-miss\";\nexport type ResumePreconditionErrorCode = \"preconditions-unmet\";\nexport type ResumeSetupHookErrorCode = \"setup-hook-failed\" | \"setup-hook-timed-out\";\nexport type ResumeCatalogUnavailableErrorCode = \"catalog-unavailable\";\nexport type ResumeCatalogTimeoutErrorCode = \"catalog-timeout\";\nexport type ResumeErrorCode =\n\t| ResumeNotFoundErrorCode\n\t| ResumePreconditionErrorCode\n\t| ResumeSetupHookErrorCode\n\t| ResumeCatalogUnavailableErrorCode\n\t| ResumeCatalogTimeoutErrorCode;\nexport type ResumeErrorName =\n\t| \"ResumeError\"\n\t| \"ResumeNotFoundError\"\n\t| \"ResumePreconditionError\"\n\t| \"ResumeSetupHookError\"\n\t| \"ResumeCatalogUnavailableError\"\n\t| \"ResumeCatalogTimeoutError\";\n\n/** The entry point that ran the check, for messages and fields. */\nexport type ResumeEntryPoint = \"cli\" | \"switch-session\" | \"create-agent-session\" | \"workflow-resume\" | \"rehydrate\";\n\n/**\n * One unmet precondition: `subject` names the adapter, variable, file or hook (never a secret value), `why` says\n * what this resume needs it for, and `fix` is the command or setting that supplies it.\n */\nexport type ResumePreconditionProblemCode =\n\t| \"adapter-not-installed\"\n\t| \"credential-missing\"\n\t| \"credential-unreadable\"\n\t| \"git-unavailable\"\n\t| \"setup-hook-missing\";\nexport interface ResumePreconditionProblem {\n\treadonly code: ResumePreconditionProblemCode;\n\treadonly subject: string;\n\treadonly why: string;\n\treadonly fix: string;\n}\n\n/**\n * Base of every failure that stops a session or workflow run from resuming on this node. Branch on `code` or the\n * class, never on `message`. `fields` holds the same JSON-safe facts as the typed properties.\n */\nexport class ResumeError extends Error {\n\toverride readonly name: ResumeErrorName = \"ResumeError\";\n\treadonly code: ResumeErrorCode;\n\treadonly hint: string;\n\treadonly retryable: boolean = false;\n\treadonly fields: ResumeErrorFields;\n\n\tconstructor(code: ResumeErrorCode, summary: string, hint: string, fields: ResumeErrorFields, cause?: Error) {\n\t\tsuper(`${summary} (${code}). ${hint}`, cause === undefined ? undefined : { cause });\n\t\tthis.code = code;\n\t\tthis.hint = hint;\n\t\tthis.fields = Object.freeze({ ...fields });\n\t\tObject.assign(this, fields);\n\t}\n}\n\nexport interface ResumeNotFoundErrorFields {\n\t/** Run ids that match nothing are reported by the journal catalog's own `run-not-found` error. */\n\treadonly subject: \"session\";\n\t/** The session id or id prefix that was looked up. */\n\treadonly id: string;\n\treadonly reason: ResumeNotFoundReason;\n\t/** The storage adapter that was searched, and for local storage its file or directory. Never a URL or token. */\n\treadonly storage: string;\n}\n\n/** The session or run id matches nothing this node can read. */\nexport class ResumeNotFoundError extends ResumeError {\n\toverride readonly name = \"ResumeNotFoundError\" as const;\n\tdeclare readonly code: ResumeNotFoundErrorCode;\n\tdeclare readonly subject: \"session\";\n\tdeclare readonly id: string;\n\tdeclare readonly reason: ResumeNotFoundReason;\n\tdeclare readonly storage: string;\n\n\tconstructor(fields: ResumeNotFoundErrorFields, cause?: Error) {\n\t\tconst missing = `No session found matching '${fields.id}'`;\n\t\tconst [summary, hint] =\n\t\t\tfields.reason === \"local-storage-not-joined\"\n\t\t\t\t? [\n\t\t\t\t\t\t`${missing}: this node uses local-only storage (${fields.storage}) and is not joined to the shared storage where other nodes record their work`,\n\t\t\t\t\t\t`Join this node's sessions to the shared storage with ${SESSION_STORAGE_JOIN}, then resume again.`,\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t`${missing} in the shared storage (${fields.storage})`,\n\t\t\t\t\t\t\"Check the id, and that every node uses the same storage and prefix (`atomic storage status`).\",\n\t\t\t\t\t];\n\t\tsuper(\"not-found\", summary, hint, { ...fields }, cause);\n\t}\n}\n\nexport interface ResumePreconditionErrorFields {\n\treadonly entryPoint: ResumeEntryPoint;\n\treadonly problems: readonly ResumePreconditionProblem[];\n}\n\n/** Setup this resume depends on is missing. Every unmet precondition found in one pass is listed in `problems`. */\nexport class ResumePreconditionError extends ResumeError {\n\toverride readonly name = \"ResumePreconditionError\" as const;\n\tdeclare readonly code: ResumePreconditionErrorCode;\n\tdeclare readonly entryPoint: ResumeEntryPoint;\n\tdeclare readonly problems: readonly ResumePreconditionProblem[];\n\n\tconstructor(fields: ResumePreconditionErrorFields, cause?: Error) {\n\t\tif (fields.problems.length === 0) throw new RangeError(\"ResumePreconditionError needs at least one problem\");\n\t\tsuper(\n\t\t\t\"preconditions-unmet\",\n\t\t\t`Cannot resume here: ${fields.problems.map((problem) => `${problem.subject} (${problem.code}): ${problem.why}`).join(\"; \")}`,\n\t\t\tfields.problems.map((problem) => problem.fix).join(\" Then: \"),\n\t\t\t{ entryPoint: fields.entryPoint, problems: fields.problems.map((problem) => ({ ...problem })) },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nexport interface ResumeSetupHookErrorFields {\n\t/** `.atomic/setup` or the configured command's setting name. */\n\treadonly hook: string;\n\treadonly worktree: string;\n\t/** The recorded environment fingerprint the hook was asked to materialize. */\n\treadonly envHash: string;\n\treadonly exitStatus: number | null;\n\treadonly signal: string | null;\n\t/** The hook's captured output. */\n\treadonly logPath: string;\n\treadonly timeoutMs: number;\n\treadonly elapsedMs: number;\n}\n\n/** The setup hook a restored worktree needs ran and did not succeed. Resuming again runs it again. */\nexport class ResumeSetupHookError extends ResumeError {\n\toverride readonly name = \"ResumeSetupHookError\" as const;\n\tdeclare readonly code: ResumeSetupHookErrorCode;\n\tdeclare readonly hook: string;\n\tdeclare readonly worktree: string;\n\tdeclare readonly envHash: string;\n\tdeclare readonly exitStatus: number | null;\n\tdeclare readonly signal: string | null;\n\tdeclare readonly logPath: string;\n\tdeclare readonly timeoutMs: number;\n\tdeclare readonly elapsedMs: number;\n\treadonly phase = \"setup-hook\" as const;\n\n\tconstructor(code: ResumeSetupHookErrorCode, fields: ResumeSetupHookErrorFields, cause?: Error) {\n\t\tconst outcome =\n\t\t\tcode === \"setup-hook-timed-out\"\n\t\t\t\t? `did not finish within ${fields.timeoutMs} ms`\n\t\t\t\t: fields.signal !== null\n\t\t\t\t\t? `was stopped by ${fields.signal}`\n\t\t\t\t\t: fields.exitStatus === null\n\t\t\t\t\t\t? \"could not be started\"\n\t\t\t\t\t\t: `exited with status ${fields.exitStatus}`;\n\t\tsuper(\n\t\t\tcode,\n\t\t\t`The setup hook ${fields.hook} ${outcome} in ${fields.worktree}`,\n\t\t\t`Fix the hook (its output is in ${fields.logPath}), then resume again; the hook runs again.`,\n\t\t\t{ ...fields },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nconst LOOKED_UP: Readonly<Record<ResumeSubject, string>> = { session: \"the session\", run: \"the workflow run\" };\n\nexport interface ResumeCatalogUnavailableErrorFields {\n\treadonly subject: ResumeSubject;\n\t/** The id or selector being looked up, or null for a picker or \"most recent\" lookup. */\n\treadonly id: string | null;\n\t/** The storage adapter that could not be reached. Never a URL or token. */\n\treadonly storage: string;\n\treadonly phase: \"catalog-lookup\";\n}\n\n/**\n * The storage that records sessions or runs could not be reached while a resume looked one up. Nothing was changed,\n * so the resume can be retried as-is once the storage is reachable.\n */\nexport class ResumeCatalogUnavailableError extends ResumeError {\n\toverride readonly name = \"ResumeCatalogUnavailableError\" as const;\n\tdeclare readonly code: ResumeCatalogUnavailableErrorCode;\n\toverride readonly retryable = true;\n\tdeclare readonly subject: ResumeSubject;\n\tdeclare readonly id: string | null;\n\tdeclare readonly storage: string;\n\tdeclare readonly phase: \"catalog-lookup\";\n\n\tconstructor(fields: ResumeCatalogUnavailableErrorFields, cause?: Error) {\n\t\tsuper(\n\t\t\t\"catalog-unavailable\",\n\t\t\t`Cannot look up ${LOOKED_UP[fields.subject]}${fields.id === null ? \"\" : ` ${fields.id}`}: the storage (${fields.storage}) could not be reached`,\n\t\t\t\"Check that this node can reach the shared storage (`atomic storage status`), then resume again; nothing was changed.\",\n\t\t\t{ ...fields },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nexport interface ResumeCatalogTimeoutErrorFields {\n\treadonly subject: ResumeSubject;\n\treadonly id: string | null;\n\t/** The storage adapter that did not answer. Never a URL or token. */\n\treadonly storage: string;\n\treadonly phase: \"catalog-lookup\";\n\treadonly timeoutMs: number;\n\treadonly elapsedMs: number;\n}\n\n/**\n * The storage that records sessions or runs did not answer a resume's lookup within its deadline, as during a network\n * partition. Nothing was changed, so the resume can be retried as-is once the storage answers.\n */\nexport class ResumeCatalogTimeoutError extends ResumeError {\n\toverride readonly name = \"ResumeCatalogTimeoutError\" as const;\n\tdeclare readonly code: ResumeCatalogTimeoutErrorCode;\n\toverride readonly retryable = true;\n\tdeclare readonly subject: ResumeSubject;\n\tdeclare readonly id: string | null;\n\tdeclare readonly storage: string;\n\tdeclare readonly phase: \"catalog-lookup\";\n\tdeclare readonly timeoutMs: number;\n\tdeclare readonly elapsedMs: number;\n\n\tconstructor(fields: ResumeCatalogTimeoutErrorFields, cause?: Error) {\n\t\tsuper(\n\t\t\t\"catalog-timeout\",\n\t\t\t`Cannot look up ${LOOKED_UP[fields.subject]}${fields.id === null ? \"\" : ` ${fields.id}`}: the storage (${fields.storage}) did not answer within ${fields.timeoutMs} ms`,\n\t\t\t\"Check that this node can reach the shared storage (`atomic storage status`), then resume again; nothing was changed.\",\n\t\t\t{ ...fields },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nconst CODES: Record<ResumeErrorName, readonly ResumeErrorCode[]> = {\n\tResumeError: [],\n\tResumeNotFoundError: [\"not-found\"],\n\tResumePreconditionError: [\"preconditions-unmet\"],\n\tResumeSetupHookError: [\"setup-hook-failed\", \"setup-hook-timed-out\"],\n\tResumeCatalogUnavailableError: [\"catalog-unavailable\"],\n\tResumeCatalogTimeoutError: [\"catalog-timeout\"],\n};\nconst ALL_CODES = new Set(Object.values(CODES).flat());\n\nfunction structurallyIs(value: unknown, name: ResumeErrorName): boolean {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value as { readonly name?: unknown; readonly code?: unknown };\n\tif (name === \"ResumeError\") {\n\t\treturn (\n\t\t\ttypeof candidate.name === \"string\" &&\n\t\t\tcandidate.name in CODES &&\n\t\t\tALL_CODES.has(candidate.code as ResumeErrorCode)\n\t\t);\n\t}\n\treturn candidate.name === name && CODES[name].includes(candidate.code as ResumeErrorCode);\n}\n\nexport function isResumeError(value: unknown): value is ResumeError {\n\treturn value instanceof ResumeError || structurallyIs(value, \"ResumeError\");\n}\nexport function isResumeNotFoundError(value: unknown): value is ResumeNotFoundError {\n\treturn value instanceof ResumeNotFoundError || structurallyIs(value, \"ResumeNotFoundError\");\n}\nexport function isResumePreconditionError(value: unknown): value is ResumePreconditionError {\n\treturn value instanceof ResumePreconditionError || structurallyIs(value, \"ResumePreconditionError\");\n}\nexport function isResumeSetupHookError(value: unknown): value is ResumeSetupHookError {\n\treturn value instanceof ResumeSetupHookError || structurallyIs(value, \"ResumeSetupHookError\");\n}\n\nexport function isResumeCatalogUnavailableError(value: unknown): value is ResumeCatalogUnavailableError {\n\treturn value instanceof ResumeCatalogUnavailableError || structurallyIs(value, \"ResumeCatalogUnavailableError\");\n}\n\nexport function isResumeCatalogTimeoutError(value: unknown): value is ResumeCatalogTimeoutError {\n\treturn value instanceof ResumeCatalogTimeoutError || structurallyIs(value, \"ResumeCatalogTimeoutError\");\n}\n\n/** Whether anything in `error`'s cause chain is a resume failure that can be retried as-is. */\nexport function isRetryableResumeError(error: unknown): boolean {\n\treturn (\n\t\tfindResumeError(\n\t\t\terror,\n\t\t\t(value): value is ResumeError => isResumeCatalogUnavailableError(value) || isResumeCatalogTimeoutError(value),\n\t\t) !== undefined\n\t);\n}\n\n/** The first error in `error`'s cause chain, itself included, that `guard` accepts. */\nexport function findResumeError<T extends ResumeError>(\n\terror: unknown,\n\tguard: (value: unknown) => value is T = isResumeError as (value: unknown) => value is T,\n): T | undefined {\n\treturn findInCauseChain(error, guard);\n}\n\n/** A {@link ResumeError} as it crosses a worker, RPC or broker boundary. */\nexport interface SerializedResumeError {\n\treadonly name: string;\n\treadonly code: string;\n\treadonly message: string;\n\treadonly hint: string;\n\treadonly retryable: boolean;\n\treadonly fields: ResumeErrorFields;\n\treadonly cause?: SerializedErrorCause;\n}\n\n/** The JSON form of `error`, with its cause chain bounded and free of stack traces. */\nexport function serializeResumeError(error: ResumeError): SerializedResumeError {\n\tconst cause = serializeErrorCause(error.cause);\n\treturn {\n\t\tname: error.name,\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\thint: error.hint,\n\t\tretryable: error.retryable,\n\t\tfields: error.fields,\n\t\t...(cause === undefined ? {} : { cause }),\n\t};\n}\n\ntype Rehydrator = (fields: ResumeErrorFields, code: string, cause?: Error) => ResumeError;\nconst REHYDRATORS: Record<Exclude<ResumeErrorName, \"ResumeError\">, Rehydrator> = {\n\tResumeNotFoundError: (fields, _code, cause) =>\n\t\tnew ResumeNotFoundError(fields as unknown as ResumeNotFoundErrorFields, cause),\n\tResumePreconditionError: (fields, _code, cause) =>\n\t\tnew ResumePreconditionError(fields as unknown as ResumePreconditionErrorFields, cause),\n\tResumeCatalogTimeoutError: (fields, _code, cause) =>\n\t\tnew ResumeCatalogTimeoutError(fields as unknown as ResumeCatalogTimeoutErrorFields, cause),\n\tResumeCatalogUnavailableError: (fields, _code, cause) =>\n\t\tnew ResumeCatalogUnavailableError(fields as unknown as ResumeCatalogUnavailableErrorFields, cause),\n\tResumeSetupHookError: (fields, code, cause) =>\n\t\tnew ResumeSetupHookError(\n\t\t\tcode as ResumeSetupHookErrorCode,\n\t\t\tfields as unknown as ResumeSetupHookErrorFields,\n\t\t\tcause,\n\t\t),\n};\n\n/**\n * The error {@link serializeResumeError} produced, rebuilt after it crossed a process boundary as the same class, with\n * `cause` (or the serialized cause chain) as its cause. An unknown `name` or `code` rebuilds it as a\n * {@link ResumeError} that keeps the original `name`, `code`, `message`, `hint`, `retryable` and `fields`.\n */\nexport function rehydrateResumeError(form: SerializedResumeError, cause?: Error): ResumeError {\n\tconst rebuiltCause = cause ?? rehydrateErrorCause(form.cause);\n\tconst name = form.name as ResumeErrorName;\n\tif (\n\t\tname !== \"ResumeError\" &&\n\t\tObject.hasOwn(REHYDRATORS, name) &&\n\t\tCODES[name].includes(form.code as ResumeErrorCode)\n\t) {\n\t\treturn REHYDRATORS[name as Exclude<ResumeErrorName, \"ResumeError\">](form.fields, form.code, rebuiltCause);\n\t}\n\tconst error = Object.create(ResumeError.prototype) as ResumeError;\n\tObject.defineProperties(error, {\n\t\tname: { value: form.name, enumerable: false, configurable: true },\n\t\tmessage: { value: form.message, enumerable: false, configurable: true },\n\t\tcode: { value: form.code, enumerable: true },\n\t\thint: { value: form.hint, enumerable: true },\n\t\tretryable: { value: form.retryable, enumerable: true },\n\t\tfields: { value: Object.freeze({ ...form.fields }), enumerable: true },\n\t\t...(rebuiltCause === undefined ? {} : { cause: { value: rebuiltCause, enumerable: false, configurable: true } }),\n\t});\n\treturn error;\n}\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/resume/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EAEnB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAwD9B;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACnB,IAAI,GAAoB,aAAa,CAAC;IAC/C,IAAI,CAAkB;IACtB,IAAI,CAAS;IACb,SAAS,GAAY,KAAK,CAAC;IAC3B,MAAM,CAAoB;IAEnC,YAAY,IAAqB,EAAE,OAAe,EAAE,IAAY,EAAE,MAAyB,EAAE,KAAa;QACzG,KAAK,CAAC,GAAG,OAAO,KAAK,IAAI,MAAM,IAAI,EAAE,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;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I,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;QACjE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE;QACvE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC5C,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC5C,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE;QACtD,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;QACtE,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;KAChH,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { SESSION_STORAGE_JOIN } from \"../agent-rehydrate-errors.ts\";\nimport {\n\tfindInCauseChain,\n\trehydrateErrorCause,\n\ttype SerializedErrorCause,\n\tserializeErrorCause,\n} from \"../error-contract.ts\";\n\nexport type ResumeErrorFieldValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly ResumeErrorFieldValue[]\n\t| { readonly [key: string]: ResumeErrorFieldValue };\nexport type ResumeErrorFields = { readonly [key: string]: ResumeErrorFieldValue };\n\n/** What a resume looked up: an interactive session or a workflow run. */\nexport type ResumeSubject = \"session\" | \"run\";\n\nexport type ResumeNotFoundErrorCode = \"not-found\";\n/**\n * `local-storage-not-joined`: this node uses storage only it can read, so work recorded on other nodes is invisible.\n * `shared-miss`: the shared storage was read and holds no match.\n */\nexport type ResumeNotFoundReason = \"local-storage-not-joined\" | \"shared-miss\";\nexport type ResumePreconditionErrorCode = \"preconditions-unmet\";\nexport type ResumeCatalogUnavailableErrorCode = \"catalog-unavailable\";\nexport type ResumeCatalogTimeoutErrorCode = \"catalog-timeout\";\nexport type ResumeErrorCode =\n\t| ResumeNotFoundErrorCode\n\t| ResumePreconditionErrorCode\n\t| ResumeCatalogUnavailableErrorCode\n\t| ResumeCatalogTimeoutErrorCode;\nexport type ResumeErrorName =\n\t| \"ResumeError\"\n\t| \"ResumeNotFoundError\"\n\t| \"ResumePreconditionError\"\n\t| \"ResumeCatalogUnavailableError\"\n\t| \"ResumeCatalogTimeoutError\";\n\n/** The entry point that ran the check, for messages and fields. */\nexport type ResumeEntryPoint = \"cli\" | \"switch-session\" | \"create-agent-session\" | \"workflow-resume\" | \"rehydrate\";\n\n/**\n * One unmet precondition: `subject` names the adapter, variable or file (never a secret value), `why` says what this\n * resume needs it for, and `fix` is the command or setting that supplies it. `checkout` is the recorded checkout path a\n * precondition of restoring that checkout belongs to; problems that apply to the whole resume omit it.\n */\nexport type ResumePreconditionProblemCode =\n\t| \"adapter-not-installed\"\n\t| \"credential-missing\"\n\t| \"credential-unreadable\"\n\t| \"git-unavailable\";\nexport interface ResumePreconditionProblem {\n\treadonly code: ResumePreconditionProblemCode;\n\treadonly subject: string;\n\treadonly why: string;\n\treadonly fix: string;\n\treadonly checkout?: string;\n}\n\n/**\n * Base of every failure that stops a session or workflow run from resuming on this node. Branch on `code` or the\n * class, never on `message`. `fields` holds the same JSON-safe facts as the typed properties.\n */\nexport class ResumeError extends Error {\n\toverride readonly name: ResumeErrorName = \"ResumeError\";\n\treadonly code: ResumeErrorCode;\n\treadonly hint: string;\n\treadonly retryable: boolean = false;\n\treadonly fields: ResumeErrorFields;\n\n\tconstructor(code: ResumeErrorCode, summary: string, hint: string, fields: ResumeErrorFields, cause?: Error) {\n\t\tsuper(`${summary} (${code}). ${hint}`, cause === undefined ? undefined : { cause });\n\t\tthis.code = code;\n\t\tthis.hint = hint;\n\t\tthis.fields = Object.freeze({ ...fields });\n\t\tObject.assign(this, fields);\n\t}\n}\n\nexport interface ResumeNotFoundErrorFields {\n\t/** Run ids that match nothing are reported by the journal catalog's own `run-not-found` error. */\n\treadonly subject: \"session\";\n\t/** The session id or id prefix that was looked up. */\n\treadonly id: string;\n\treadonly reason: ResumeNotFoundReason;\n\t/** The storage adapter that was searched, and for local storage its file or directory. Never a URL or token. */\n\treadonly storage: string;\n}\n\n/** The session or run id matches nothing this node can read. */\nexport class ResumeNotFoundError extends ResumeError {\n\toverride readonly name = \"ResumeNotFoundError\" as const;\n\tdeclare readonly code: ResumeNotFoundErrorCode;\n\tdeclare readonly subject: \"session\";\n\tdeclare readonly id: string;\n\tdeclare readonly reason: ResumeNotFoundReason;\n\tdeclare readonly storage: string;\n\n\tconstructor(fields: ResumeNotFoundErrorFields, cause?: Error) {\n\t\tconst missing = `No session found matching '${fields.id}'`;\n\t\tconst [summary, hint] =\n\t\t\tfields.reason === \"local-storage-not-joined\"\n\t\t\t\t? [\n\t\t\t\t\t\t`${missing}: this node uses local-only storage (${fields.storage}) and is not joined to the shared storage where other nodes record their work`,\n\t\t\t\t\t\t`Join this node's sessions to the shared storage with ${SESSION_STORAGE_JOIN}, then resume again.`,\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t`${missing} in the shared storage (${fields.storage})`,\n\t\t\t\t\t\t\"Check the id, and that every node uses the same storage and prefix (`atomic storage status`).\",\n\t\t\t\t\t];\n\t\tsuper(\"not-found\", summary, hint, { ...fields }, cause);\n\t}\n}\n\nexport interface ResumePreconditionErrorFields {\n\treadonly entryPoint: ResumeEntryPoint;\n\treadonly problems: readonly ResumePreconditionProblem[];\n}\n\n/** Setup this resume depends on is missing. Every unmet precondition found in one pass is listed in `problems`. */\nexport class ResumePreconditionError extends ResumeError {\n\toverride readonly name = \"ResumePreconditionError\" as const;\n\tdeclare readonly code: ResumePreconditionErrorCode;\n\tdeclare readonly entryPoint: ResumeEntryPoint;\n\tdeclare readonly problems: readonly ResumePreconditionProblem[];\n\n\tconstructor(fields: ResumePreconditionErrorFields, cause?: Error) {\n\t\tif (fields.problems.length === 0) throw new RangeError(\"ResumePreconditionError needs at least one problem\");\n\t\tsuper(\n\t\t\t\"preconditions-unmet\",\n\t\t\t`Cannot resume here: ${fields.problems.map((problem) => `${problem.subject} (${problem.code}): ${problem.why}`).join(\"; \")}`,\n\t\t\t[...new Set(fields.problems.map((problem) => problem.fix))].join(\" Then: \"),\n\t\t\t{ entryPoint: fields.entryPoint, problems: fields.problems.map((problem) => ({ ...problem })) },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nconst LOOKED_UP: Readonly<Record<ResumeSubject, string>> = { session: \"the session\", run: \"the workflow run\" };\n\nexport interface ResumeCatalogUnavailableErrorFields {\n\treadonly subject: ResumeSubject;\n\t/** The id or selector being looked up, or null for a picker or \"most recent\" lookup. */\n\treadonly id: string | null;\n\t/** The storage adapter that could not be reached. Never a URL or token. */\n\treadonly storage: string;\n\treadonly phase: \"catalog-lookup\";\n}\n\n/**\n * The storage that records sessions or runs could not be reached while a resume looked one up. Nothing was changed,\n * so the resume can be retried as-is once the storage is reachable.\n */\nexport class ResumeCatalogUnavailableError extends ResumeError {\n\toverride readonly name = \"ResumeCatalogUnavailableError\" as const;\n\tdeclare readonly code: ResumeCatalogUnavailableErrorCode;\n\toverride readonly retryable = true;\n\tdeclare readonly subject: ResumeSubject;\n\tdeclare readonly id: string | null;\n\tdeclare readonly storage: string;\n\tdeclare readonly phase: \"catalog-lookup\";\n\n\tconstructor(fields: ResumeCatalogUnavailableErrorFields, cause?: Error) {\n\t\tsuper(\n\t\t\t\"catalog-unavailable\",\n\t\t\t`Cannot look up ${LOOKED_UP[fields.subject]}${fields.id === null ? \"\" : ` ${fields.id}`}: the storage (${fields.storage}) could not be reached`,\n\t\t\t\"Check that this node can reach the shared storage (`atomic storage status`), then resume again; nothing was changed.\",\n\t\t\t{ ...fields },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nexport interface ResumeCatalogTimeoutErrorFields {\n\treadonly subject: ResumeSubject;\n\treadonly id: string | null;\n\t/** The storage adapter that did not answer. Never a URL or token. */\n\treadonly storage: string;\n\treadonly phase: \"catalog-lookup\";\n\treadonly timeoutMs: number;\n\treadonly elapsedMs: number;\n}\n\n/**\n * The storage that records sessions or runs did not answer a resume's lookup within its deadline, as during a network\n * partition. Nothing was changed, so the resume can be retried as-is once the storage answers.\n */\nexport class ResumeCatalogTimeoutError extends ResumeError {\n\toverride readonly name = \"ResumeCatalogTimeoutError\" as const;\n\tdeclare readonly code: ResumeCatalogTimeoutErrorCode;\n\toverride readonly retryable = true;\n\tdeclare readonly subject: ResumeSubject;\n\tdeclare readonly id: string | null;\n\tdeclare readonly storage: string;\n\tdeclare readonly phase: \"catalog-lookup\";\n\tdeclare readonly timeoutMs: number;\n\tdeclare readonly elapsedMs: number;\n\n\tconstructor(fields: ResumeCatalogTimeoutErrorFields, cause?: Error) {\n\t\tsuper(\n\t\t\t\"catalog-timeout\",\n\t\t\t`Cannot look up ${LOOKED_UP[fields.subject]}${fields.id === null ? \"\" : ` ${fields.id}`}: the storage (${fields.storage}) did not answer within ${fields.timeoutMs} ms`,\n\t\t\t\"Check that this node can reach the shared storage (`atomic storage status`), then resume again; nothing was changed.\",\n\t\t\t{ ...fields },\n\t\t\tcause,\n\t\t);\n\t}\n}\n\nconst CODES: Record<ResumeErrorName, readonly ResumeErrorCode[]> = {\n\tResumeError: [],\n\tResumeNotFoundError: [\"not-found\"],\n\tResumePreconditionError: [\"preconditions-unmet\"],\n\tResumeCatalogUnavailableError: [\"catalog-unavailable\"],\n\tResumeCatalogTimeoutError: [\"catalog-timeout\"],\n};\nconst ALL_CODES = new Set(Object.values(CODES).flat());\n\nfunction structurallyIs(value: unknown, name: ResumeErrorName): boolean {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value as { readonly name?: unknown; readonly code?: unknown };\n\tif (name === \"ResumeError\") {\n\t\treturn (\n\t\t\ttypeof candidate.name === \"string\" &&\n\t\t\tcandidate.name in CODES &&\n\t\t\tALL_CODES.has(candidate.code as ResumeErrorCode)\n\t\t);\n\t}\n\treturn candidate.name === name && CODES[name].includes(candidate.code as ResumeErrorCode);\n}\n\nexport function isResumeError(value: unknown): value is ResumeError {\n\treturn value instanceof ResumeError || structurallyIs(value, \"ResumeError\");\n}\nexport function isResumeNotFoundError(value: unknown): value is ResumeNotFoundError {\n\treturn value instanceof ResumeNotFoundError || structurallyIs(value, \"ResumeNotFoundError\");\n}\nexport function isResumePreconditionError(value: unknown): value is ResumePreconditionError {\n\treturn value instanceof ResumePreconditionError || structurallyIs(value, \"ResumePreconditionError\");\n}\nexport function isResumeCatalogUnavailableError(value: unknown): value is ResumeCatalogUnavailableError {\n\treturn value instanceof ResumeCatalogUnavailableError || structurallyIs(value, \"ResumeCatalogUnavailableError\");\n}\n\nexport function isResumeCatalogTimeoutError(value: unknown): value is ResumeCatalogTimeoutError {\n\treturn value instanceof ResumeCatalogTimeoutError || structurallyIs(value, \"ResumeCatalogTimeoutError\");\n}\n\n/** Whether anything in `error`'s cause chain is a resume failure that can be retried as-is. */\nexport function isRetryableResumeError(error: unknown): boolean {\n\treturn (\n\t\tfindResumeError(\n\t\t\terror,\n\t\t\t(value): value is ResumeError => isResumeCatalogUnavailableError(value) || isResumeCatalogTimeoutError(value),\n\t\t) !== undefined\n\t);\n}\n\n/** The first error in `error`'s cause chain, itself included, that `guard` accepts. */\nexport function findResumeError<T extends ResumeError>(\n\terror: unknown,\n\tguard: (value: unknown) => value is T = isResumeError as (value: unknown) => value is T,\n): T | undefined {\n\treturn findInCauseChain(error, guard);\n}\n\n/** A {@link ResumeError} as it crosses a worker, RPC or broker boundary. */\nexport interface SerializedResumeError {\n\treadonly name: string;\n\treadonly code: string;\n\treadonly message: string;\n\treadonly hint: string;\n\treadonly retryable: boolean;\n\treadonly fields: ResumeErrorFields;\n\treadonly cause?: SerializedErrorCause;\n}\n\n/** The JSON form of `error`, with its cause chain bounded and free of stack traces. */\nexport function serializeResumeError(error: ResumeError): SerializedResumeError {\n\tconst cause = serializeErrorCause(error.cause);\n\treturn {\n\t\tname: error.name,\n\t\tcode: error.code,\n\t\tmessage: error.message,\n\t\thint: error.hint,\n\t\tretryable: error.retryable,\n\t\tfields: error.fields,\n\t\t...(cause === undefined ? {} : { cause }),\n\t};\n}\n\ntype Rehydrator = (fields: ResumeErrorFields, code: string, cause?: Error) => ResumeError;\nconst REHYDRATORS: Record<Exclude<ResumeErrorName, \"ResumeError\">, Rehydrator> = {\n\tResumeNotFoundError: (fields, _code, cause) =>\n\t\tnew ResumeNotFoundError(fields as unknown as ResumeNotFoundErrorFields, cause),\n\tResumePreconditionError: (fields, _code, cause) =>\n\t\tnew ResumePreconditionError(fields as unknown as ResumePreconditionErrorFields, cause),\n\tResumeCatalogTimeoutError: (fields, _code, cause) =>\n\t\tnew ResumeCatalogTimeoutError(fields as unknown as ResumeCatalogTimeoutErrorFields, cause),\n\tResumeCatalogUnavailableError: (fields, _code, cause) =>\n\t\tnew ResumeCatalogUnavailableError(fields as unknown as ResumeCatalogUnavailableErrorFields, cause),\n};\n\n/**\n * The error {@link serializeResumeError} produced, rebuilt after it crossed a process boundary as the same class, with\n * `cause` (or the serialized cause chain) as its cause. An unknown `name` or `code` rebuilds it as a\n * {@link ResumeError} that keeps the original `name`, `code`, `message`, `hint`, `retryable` and `fields`.\n */\nexport function rehydrateResumeError(form: SerializedResumeError, cause?: Error): ResumeError {\n\tconst rebuiltCause = cause ?? rehydrateErrorCause(form.cause);\n\tconst name = form.name as ResumeErrorName;\n\tif (\n\t\tname !== \"ResumeError\" &&\n\t\tObject.hasOwn(REHYDRATORS, name) &&\n\t\tCODES[name].includes(form.code as ResumeErrorCode)\n\t) {\n\t\treturn REHYDRATORS[name as Exclude<ResumeErrorName, \"ResumeError\">](form.fields, form.code, rebuiltCause);\n\t}\n\tconst error = Object.create(ResumeError.prototype) as ResumeError;\n\tObject.defineProperties(error, {\n\t\tname: { value: form.name, enumerable: false, configurable: true },\n\t\tmessage: { value: form.message, enumerable: false, configurable: true },\n\t\tcode: { value: form.code, enumerable: true },\n\t\thint: { value: form.hint, enumerable: true },\n\t\tretryable: { value: form.retryable, enumerable: true },\n\t\tfields: { value: Object.freeze({ ...form.fields }), enumerable: true },\n\t\t...(rebuiltCause === undefined ? {} : { cause: { value: rebuiltCause, enumerable: false, configurable: true } }),\n\t});\n\treturn error;\n}\n"]}
@@ -1,9 +1,17 @@
1
- export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isResumeSetupHookError, isRetryableResumeError, ResumeCatalogTimeoutError, type ResumeCatalogTimeoutErrorCode, type ResumeCatalogTimeoutErrorFields, ResumeCatalogUnavailableError, type ResumeCatalogUnavailableErrorCode, type ResumeCatalogUnavailableErrorFields, type ResumeEntryPoint, ResumeError, type ResumeErrorCode, type ResumeErrorFields, type ResumeErrorFieldValue, type ResumeErrorName, ResumeNotFoundError, type ResumeNotFoundErrorCode, type ResumeNotFoundErrorFields, type ResumeNotFoundReason, ResumePreconditionError, type ResumePreconditionErrorCode, type ResumePreconditionErrorFields, type ResumePreconditionProblem, type ResumePreconditionProblemCode, ResumeSetupHookError, type ResumeSetupHookErrorCode, type ResumeSetupHookErrorFields, type ResumeSubject, rehydrateResumeError, type SerializedResumeError, serializeResumeError, } from "./errors.ts";
1
+ export { ACTIONS_GITHUB_BASE_URL_ENV, type ActionFetcher, type ActionFetchRequest, parseActionReference, type RunActionOptions, runAction, } from "./blueprint/actions.ts";
2
+ export { BLUEPRINT_FULL_BUILD_MAX_AGE_MS, type BlueprintBuildConfig, type BlueprintBuildOutcome, type BlueprintBuildStatus, type BlueprintFailure, type BlueprintLayer, type BlueprintLayerState, type BlueprintRepository, describeBlueprints, needsRebuild, runBlueprintBuild, SETUP_COMMAND_ALIAS, } from "./blueprint/build.ts";
3
+ export { BLUEPRINT_CONTEXT_TYPE, renderBlueprintContext } from "./blueprint/context.ts";
4
+ export { BlueprintBuildFailedError, type BlueprintBuildFailedErrorCode, type BlueprintBuildFailedErrorFields, type BlueprintBuildPhase, BlueprintError, type BlueprintErrorCode, type BlueprintErrorFields, type BlueprintErrorFieldValue, type BlueprintErrorName, BlueprintInvalidError, type BlueprintInvalidErrorCode, type BlueprintInvalidErrorFields, type BlueprintInvalidReason, type BlueprintScope, type BlueprintSection, BlueprintStepFailedError, type BlueprintStepFailedErrorCode, type BlueprintStepFailedErrorFields, type BlueprintStepLocation, BlueprintStepTimedOutError, type BlueprintStepTimedOutErrorCode, type BlueprintStepTimedOutErrorFields, BlueprintUsesUnsupportedError, type BlueprintUsesUnsupportedErrorCode, type BlueprintUsesUnsupportedErrorFields, type BlueprintUsesUnsupportedReason, findBlueprintError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, rehydrateBlueprintError, type SerializedBlueprintError, serializeBlueprintError, } from "./blueprint/errors.ts";
5
+ export { type BlueprintNotice, blueprintNotices } from "./blueprint/notices.ts";
6
+ export { type BlueprintCheckout, blueprintRepository, inheritedRemotes, type RestoreLink, type ResumedBlueprints, recordBlueprintContext, recordRestoredWorktreeContext, type SetUpBlueprintsOptions, setUpResumedBlueprints, } from "./blueprint/resume.ts";
7
+ export { BLUEPRINT_RULES, hostPlatform, parseBlueprint, selectDocument } from "./blueprint/schema.ts";
8
+ export { BLUEPRINT_STEP_TIMEOUT_MS } from "./blueprint/steps.ts";
9
+ export type { BlueprintDocument, BlueprintPlatform, BlueprintShell, BlueprintStep, BlueprintWarning, IncludedWorkspace, KnowledgeItem, ParsedBlueprint, RunStep, UsesStep, } from "./blueprint/types.ts";
10
+ export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, ResumeCatalogTimeoutError, type ResumeCatalogTimeoutErrorCode, type ResumeCatalogTimeoutErrorFields, ResumeCatalogUnavailableError, type ResumeCatalogUnavailableErrorCode, type ResumeCatalogUnavailableErrorFields, type ResumeEntryPoint, ResumeError, type ResumeErrorCode, type ResumeErrorFields, type ResumeErrorFieldValue, type ResumeErrorName, ResumeNotFoundError, type ResumeNotFoundErrorCode, type ResumeNotFoundErrorFields, type ResumeNotFoundReason, ResumePreconditionError, type ResumePreconditionErrorCode, type ResumePreconditionErrorFields, type ResumePreconditionProblem, type ResumePreconditionProblemCode, type ResumeSubject, rehydrateResumeError, type SerializedResumeError, serializeResumeError, } from "./errors.ts";
2
11
  export { isResumeFailure, resumeFailureMessage } from "./failure.ts";
3
12
  export { RESUME_CATALOG_TIMEOUT_MS, type ResumeLookupTarget, resumeLookupError, resumeNotFoundError, withResumeLookupDeadline, } from "./not-found.ts";
4
13
  export { currentWorktreeRootMappings, mapPathForCwd, withWorktreeRootMappings } from "./path-mapping.ts";
5
14
  export { checkResumeStoragePreconditions, type ResumePreflightIo, type ResumeStorageTarget, storagePreconditionProblems, } from "./preflight.ts";
6
- export { type RunResumeSetupOptions, type RunWorktreeTarget, restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, } from "./run-setup.ts";
7
- export { continueSessionWhereItWorked, type DirtyCheckoutChoice, type DirtyCheckoutPrompt, type PreparedSessionResume, type PrepareSessionResumeOptions, prepareSessionResume, type ResumeNotice, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.ts";
8
- export { DEFAULT_RESUME_SETUP_TIMEOUT_MS, type EnsureResumeSetupOptions, ensureResumeSetup, RESUME_SETUP_COMMAND_SETTING, RESUME_SETUP_HOOK_FILE, type ResumeSetupConfig, type ResumeSetupLedgerEntry, type ResumeSetupOutcome, readResumeSetupLedger, } from "./setup-hook.ts";
15
+ export { type RunRestoreHistory, type RunResumeSetupOptions, type RunWorktreeTarget, restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, setUpResumedRunWorktrees, } from "./run-setup.ts";
16
+ export { continueSessionWhereItWorked, type DirtyCheckoutChoice, type DirtyCheckoutPrompt, type PreparedSessionResume, type PrepareSessionResumeOptions, prepareSessionResume, type ResumeNotice, resumeStoreDir, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.ts";
9
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACN,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EACN,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,KAAK,YAAY,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,+BAA+B,EAC/B,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,qBAAqB,GACrB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,SAAS,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC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N,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC"}
@@ -1,9 +1,16 @@
1
- export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isResumeSetupHookError, isRetryableResumeError, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeError, ResumeNotFoundError, ResumePreconditionError, ResumeSetupHookError, rehydrateResumeError, serializeResumeError, } from "./errors.js";
1
+ export { ACTIONS_GITHUB_BASE_URL_ENV, parseActionReference, runAction, } from "./blueprint/actions.js";
2
+ export { BLUEPRINT_FULL_BUILD_MAX_AGE_MS, describeBlueprints, needsRebuild, runBlueprintBuild, SETUP_COMMAND_ALIAS, } from "./blueprint/build.js";
3
+ export { BLUEPRINT_CONTEXT_TYPE, renderBlueprintContext } from "./blueprint/context.js";
4
+ export { BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, findBlueprintError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, rehydrateBlueprintError, serializeBlueprintError, } from "./blueprint/errors.js";
5
+ export { blueprintNotices } from "./blueprint/notices.js";
6
+ export { blueprintRepository, inheritedRemotes, recordBlueprintContext, recordRestoredWorktreeContext, setUpResumedBlueprints, } from "./blueprint/resume.js";
7
+ export { BLUEPRINT_RULES, hostPlatform, parseBlueprint, selectDocument } from "./blueprint/schema.js";
8
+ export { BLUEPRINT_STEP_TIMEOUT_MS } from "./blueprint/steps.js";
9
+ export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeError, ResumeNotFoundError, ResumePreconditionError, rehydrateResumeError, serializeResumeError, } from "./errors.js";
2
10
  export { isResumeFailure, resumeFailureMessage } from "./failure.js";
3
11
  export { RESUME_CATALOG_TIMEOUT_MS, resumeLookupError, resumeNotFoundError, withResumeLookupDeadline, } from "./not-found.js";
4
12
  export { currentWorktreeRootMappings, mapPathForCwd, withWorktreeRootMappings } from "./path-mapping.js";
5
13
  export { checkResumeStoragePreconditions, storagePreconditionProblems, } from "./preflight.js";
6
- export { restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, } from "./run-setup.js";
7
- export { continueSessionWhereItWorked, prepareSessionResume, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.js";
8
- export { DEFAULT_RESUME_SETUP_TIMEOUT_MS, ensureResumeSetup, RESUME_SETUP_COMMAND_SETTING, RESUME_SETUP_HOOK_FILE, readResumeSetupLedger, } from "./setup-hook.js";
14
+ export { restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, setUpResumedRunWorktrees, } from "./run-setup.js";
15
+ export { continueSessionWhereItWorked, prepareSessionResume, resumeStoreDir, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.js";
9
16
  //# sourceMappingURL=index.js.map