@open-mercato/cezar 0.9.1 → 0.9.2-pr772.1071

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 (355) hide show
  1. package/README.md +36 -17
  2. package/dist/agent-config/account-identity.d.ts +44 -0
  3. package/dist/agent-config/account-identity.js +128 -0
  4. package/dist/agent-config/account-identity.js.map +1 -0
  5. package/dist/agent-config/catalog.d.ts +9 -1
  6. package/dist/agent-config/catalog.js +18 -0
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/files.d.ts +1 -1
  9. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  10. package/dist/agent-config/model-settings/claude.js +11 -0
  11. package/dist/agent-config/model-settings/claude.js.map +1 -0
  12. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  13. package/dist/agent-config/model-settings/codex.js +16 -0
  14. package/dist/agent-config/model-settings/codex.js.map +1 -0
  15. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  16. package/dist/agent-config/model-settings/opencode.js +8 -0
  17. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  18. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  19. package/dist/agent-config/model-settings/shared.js +93 -0
  20. package/dist/agent-config/model-settings/shared.js.map +1 -0
  21. package/dist/agent-config/model-settings/types.d.ts +9 -0
  22. package/dist/agent-config/model-settings/types.js +2 -0
  23. package/dist/agent-config/model-settings/types.js.map +1 -0
  24. package/dist/agent-config/models.d.ts +9 -0
  25. package/dist/agent-config/models.js +30 -0
  26. package/dist/agent-config/models.js.map +1 -0
  27. package/dist/agent-config/service.d.ts +1 -1
  28. package/dist/agent-config/service.js +4 -4
  29. package/dist/agent-config/service.js.map +1 -1
  30. package/dist/agent-config/validate.d.ts +1 -1
  31. package/dist/automations/coordinator.d.ts +26 -0
  32. package/dist/automations/coordinator.js +66 -0
  33. package/dist/automations/coordinator.js.map +1 -0
  34. package/dist/automations/github-poller.d.ts +74 -0
  35. package/dist/automations/github-poller.js +234 -0
  36. package/dist/automations/github-poller.js.map +1 -0
  37. package/dist/automations/scheduler.d.ts +42 -0
  38. package/dist/automations/scheduler.js +192 -0
  39. package/dist/automations/scheduler.js.map +1 -0
  40. package/dist/automations/store.d.ts +65 -0
  41. package/dist/automations/store.js +298 -0
  42. package/dist/automations/store.js.map +1 -0
  43. package/dist/automations/task-template.d.ts +18 -0
  44. package/dist/automations/task-template.js +95 -0
  45. package/dist/automations/task-template.js.map +1 -0
  46. package/dist/automations/types.d.ts +251 -0
  47. package/dist/automations/types.js +158 -0
  48. package/dist/automations/types.js.map +1 -0
  49. package/dist/config.d.ts +17 -112
  50. package/dist/config.js +45 -4
  51. package/dist/config.js.map +1 -1
  52. package/dist/contract/agent-config.d.ts +151 -0
  53. package/dist/contract/agent-profiles.d.ts +332 -0
  54. package/dist/contract/automations.d.ts +919 -0
  55. package/dist/contract/events.d.ts +45 -0
  56. package/dist/contract/github.d.ts +467 -0
  57. package/dist/contract/health.d.ts +96 -0
  58. package/dist/contract/index.d.ts +16 -0
  59. package/dist/contract/index.js +1614 -0
  60. package/dist/contract/projects.d.ts +185 -0
  61. package/dist/contract/repo.d.ts +234 -0
  62. package/dist/contract/runs.d.ts +1261 -0
  63. package/dist/contract/skills.d.ts +229 -0
  64. package/dist/contract/workflows.d.ts +212 -0
  65. package/dist/contract/workspace.d.ts +490 -0
  66. package/dist/core/agent-env.d.ts +1 -1
  67. package/dist/core/agent-model-policy.d.ts +10 -0
  68. package/dist/core/agent-model-policy.js +36 -0
  69. package/dist/core/agent-model-policy.js.map +1 -0
  70. package/dist/core/agent-profiles.d.ts +59 -0
  71. package/dist/core/agent-profiles.js +83 -0
  72. package/dist/core/agent-profiles.js.map +1 -0
  73. package/dist/core/agent-runner.d.ts +12 -1
  74. package/dist/core/agent-runner.js +13 -0
  75. package/dist/core/agent-runner.js.map +1 -1
  76. package/dist/core/ask.d.ts +45 -124
  77. package/dist/core/ask.js +103 -13
  78. package/dist/core/ask.js.map +1 -1
  79. package/dist/core/backend-detect.js +7 -2
  80. package/dist/core/backend-detect.js.map +1 -1
  81. package/dist/core/claude-cli-runner.d.ts +2 -2
  82. package/dist/core/claude-cli-runner.js +52 -9
  83. package/dist/core/claude-cli-runner.js.map +1 -1
  84. package/dist/core/claude-ui-mapper.d.ts +1 -1
  85. package/dist/core/codex-app-server-runner.d.ts +1 -1
  86. package/dist/core/codex-app-server-runner.js +60 -3
  87. package/dist/core/codex-app-server-runner.js.map +1 -1
  88. package/dist/core/codex-app-server-transport.d.ts +6 -1
  89. package/dist/core/codex-app-server-transport.js +12 -3
  90. package/dist/core/codex-app-server-transport.js.map +1 -1
  91. package/dist/core/codex-model-catalog.d.ts +1 -1
  92. package/dist/core/codex-ui-mapper.d.ts +5 -1
  93. package/dist/core/codex-ui-mapper.js +74 -17
  94. package/dist/core/codex-ui-mapper.js.map +1 -1
  95. package/dist/core/model-identity.d.ts +13 -6
  96. package/dist/core/model-identity.js +32 -17
  97. package/dist/core/model-identity.js.map +1 -1
  98. package/dist/core/model-presets.d.ts +2 -2
  99. package/dist/core/model-presets.js +1 -1
  100. package/dist/core/opencode-server-runner.d.ts +2 -2
  101. package/dist/core/opencode-ui-mapper.d.ts +4 -1
  102. package/dist/core/opencode-ui-mapper.js +45 -7
  103. package/dist/core/opencode-ui-mapper.js.map +1 -1
  104. package/dist/core/provider-auth.d.ts +154 -0
  105. package/dist/core/provider-auth.js +488 -0
  106. package/dist/core/provider-auth.js.map +1 -0
  107. package/dist/core/provider-availability.d.ts +3 -0
  108. package/dist/core/provider-availability.js +14 -0
  109. package/dist/core/provider-availability.js.map +1 -0
  110. package/dist/core/runner-factory.d.ts +1 -1
  111. package/dist/core/runner-model-catalog.d.ts +1 -1
  112. package/dist/core/shell-env.d.ts +28 -0
  113. package/dist/core/shell-env.js +56 -0
  114. package/dist/core/shell-env.js.map +1 -0
  115. package/dist/core/tool-display.d.ts +1 -1
  116. package/dist/core/ui-events.d.ts +1 -1
  117. package/dist/core/ui-events.js +1 -1
  118. package/dist/core/usage-limit.d.ts +42 -0
  119. package/dist/core/usage-limit.js +209 -0
  120. package/dist/core/usage-limit.js.map +1 -0
  121. package/dist/git-diff-base.d.ts +60 -0
  122. package/dist/git-diff-base.js +54 -0
  123. package/dist/git-diff-base.js.map +1 -0
  124. package/dist/git-worktree.d.ts +37 -6
  125. package/dist/git-worktree.js +39 -9
  126. package/dist/git-worktree.js.map +1 -1
  127. package/dist/handoff.d.ts +2 -2
  128. package/dist/handoff.js +1 -1
  129. package/dist/index.js +65 -8
  130. package/dist/index.js.map +1 -1
  131. package/dist/paths.d.ts +69 -6
  132. package/dist/paths.js +86 -9
  133. package/dist/paths.js.map +1 -1
  134. package/dist/planner.d.ts +2 -2
  135. package/dist/planner.js +7 -1
  136. package/dist/planner.js.map +1 -1
  137. package/dist/release/manifests.d.ts +81 -0
  138. package/dist/release/manifests.js +74 -0
  139. package/dist/release/manifests.js.map +1 -0
  140. package/dist/release/snapshot.d.ts +9 -23
  141. package/dist/release/snapshot.js +9 -22
  142. package/dist/release/snapshot.js.map +1 -1
  143. package/dist/release/stable.d.ts +15 -29
  144. package/dist/release/stable.js +14 -27
  145. package/dist/release/stable.js.map +1 -1
  146. package/dist/runs/auto-name.d.ts +1 -1
  147. package/dist/runs/auto-name.js +6 -1
  148. package/dist/runs/auto-name.js.map +1 -1
  149. package/dist/runs/retention.d.ts +1 -1
  150. package/dist/runs/store.d.ts +149 -336
  151. package/dist/runs/store.js +187 -9
  152. package/dist/runs/store.js.map +1 -1
  153. package/dist/runs/ui-event-sink.d.ts +1 -1
  154. package/dist/server/app-type.d.ts +21 -0
  155. package/dist/server/app-type.js +2 -0
  156. package/dist/server/app-type.js.map +1 -0
  157. package/dist/server/capabilities.d.ts +6 -5
  158. package/dist/server/capabilities.js +11 -0
  159. package/dist/server/capabilities.js.map +1 -1
  160. package/dist/server/forge/github.d.ts +58 -151
  161. package/dist/server/forge/github.js +530 -6
  162. package/dist/server/forge/github.js.map +1 -1
  163. package/dist/server/forge/index.d.ts +10 -3
  164. package/dist/server/forge/index.js +14 -1
  165. package/dist/server/forge/index.js.map +1 -1
  166. package/dist/server/forge/types.d.ts +86 -1
  167. package/dist/server/git-changes.d.ts +8 -8
  168. package/dist/server/git-changes.js +14 -17
  169. package/dist/server/git-changes.js.map +1 -1
  170. package/dist/server/git.d.ts +2 -0
  171. package/dist/server/git.js +9 -0
  172. package/dist/server/git.js.map +1 -1
  173. package/dist/server/github.d.ts +3 -3
  174. package/dist/server/github.js +1 -1
  175. package/dist/server/github.js.map +1 -1
  176. package/dist/server/open-in-terminal.d.ts +8 -1
  177. package/dist/server/open-in-terminal.js +16 -8
  178. package/dist/server/open-in-terminal.js.map +1 -1
  179. package/dist/server/pr.d.ts +2 -2
  180. package/dist/server/project-context.d.ts +20 -3
  181. package/dist/server/project-context.js +30 -1
  182. package/dist/server/project-context.js.map +1 -1
  183. package/dist/server/provider-action-gate.d.ts +8 -0
  184. package/dist/server/provider-action-gate.js +54 -0
  185. package/dist/server/provider-action-gate.js.map +1 -0
  186. package/dist/server/provider-auth-runtime.d.ts +21 -0
  187. package/dist/server/provider-auth-runtime.js +66 -0
  188. package/dist/server/provider-auth-runtime.js.map +1 -0
  189. package/dist/server/server.d.ts +12128 -47
  190. package/dist/server/server.js +2652 -917
  191. package/dist/server/server.js.map +1 -1
  192. package/dist/server/validators.d.ts +97 -0
  193. package/dist/server/validators.js +86 -0
  194. package/dist/server/validators.js.map +1 -0
  195. package/dist/server/ws.d.ts +2 -2
  196. package/dist/server/ws.js +2 -2
  197. package/dist/server/ws.js.map +1 -1
  198. package/dist/server-install/engine.d.ts +1 -1
  199. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  200. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  201. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  202. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  203. package/dist/server-install/state.d.ts +1 -1
  204. package/dist/server-install/steps.d.ts +2 -2
  205. package/dist/server-install/strategies.d.ts +1 -1
  206. package/dist/server-install/types.d.ts +38 -424
  207. package/dist/server-install/ui.d.ts +1 -1
  208. package/dist/skills-banner.d.ts +7 -6
  209. package/dist/skills-banner.js +7 -6
  210. package/dist/skills-banner.js.map +1 -1
  211. package/dist/skills-remote.d.ts +2 -2
  212. package/dist/skills-update.d.ts +88 -0
  213. package/dist/skills-update.js +392 -0
  214. package/dist/skills-update.js.map +1 -0
  215. package/dist/skills.d.ts +2 -0
  216. package/dist/skills.js +7 -2
  217. package/dist/skills.js.map +1 -1
  218. package/dist/todos.d.ts +2 -28
  219. package/dist/todos.js +1 -1
  220. package/dist/ui-state.d.ts +16 -2
  221. package/dist/ui-state.js +14 -1
  222. package/dist/ui-state.js.map +1 -1
  223. package/dist/workflows/load.d.ts +1 -1
  224. package/dist/workflows/run.d.ts +238 -12
  225. package/dist/workflows/run.js +1103 -115
  226. package/dist/workflows/run.js.map +1 -1
  227. package/dist/workflows/types.d.ts +59 -224
  228. package/dist/workflows/types.js +14 -0
  229. package/dist/workflows/types.js.map +1 -1
  230. package/dist/workspace/agent-accounts.d.ts +149 -0
  231. package/dist/workspace/agent-accounts.js +303 -0
  232. package/dist/workspace/agent-accounts.js.map +1 -0
  233. package/dist/workspace/agent-profiles.d.ts +78 -0
  234. package/dist/workspace/agent-profiles.js +115 -0
  235. package/dist/workspace/agent-profiles.js.map +1 -0
  236. package/dist/workspace/config.d.ts +82 -206
  237. package/dist/workspace/config.js +183 -14
  238. package/dist/workspace/config.js.map +1 -1
  239. package/dist/workspace/migrations.d.ts +1 -1
  240. package/dist/workspace/migrations.js +19 -4
  241. package/dist/workspace/migrations.js.map +1 -1
  242. package/dist/workspace/projects.d.ts +8 -2
  243. package/dist/workspace/projects.js +9 -3
  244. package/dist/workspace/projects.js.map +1 -1
  245. package/dist/workspace/semaphore.d.ts +45 -0
  246. package/dist/workspace/semaphore.js +45 -1
  247. package/dist/workspace/semaphore.js.map +1 -1
  248. package/dist/workspace/ui-state.d.ts +13 -3
  249. package/dist/workspace/ui-state.js +15 -5
  250. package/dist/workspace/ui-state.js.map +1 -1
  251. package/package.json +17 -39
  252. package/scripts/inline-contract.mjs +112 -0
  253. package/scripts/mock-claude.mjs +59 -1
  254. package/scripts/sync-readme.mjs +20 -0
  255. package/web/dist/assets/alert-dialog-LMDsWZ8t.js +1 -0
  256. package/web/dist/assets/arrow-down-CDJD8f8N.js +1 -0
  257. package/web/dist/assets/arrow-left-DUirK4gC.js +1 -0
  258. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  259. package/web/dist/assets/centered-state-CX0EhxaQ.js +43 -0
  260. package/web/dist/assets/chevron-right-B70aoBYh.js +1 -0
  261. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  262. package/web/dist/assets/circle-check-C6IhUojk.js +1 -0
  263. package/web/dist/assets/circle-x-hV9f6Ypp.js +1 -0
  264. package/web/dist/assets/collapsible-D2igywSh.js +1 -0
  265. package/web/dist/assets/commit-list-ocsM8XZs.js +1 -0
  266. package/web/dist/assets/compare-variants-CYdYsQBv.js +1 -0
  267. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  268. package/web/dist/assets/diff-3y-HnHEH.js +3 -0
  269. package/web/dist/assets/diff-stat-OeTa1MCD.js +1 -0
  270. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-D8VBKGxl.js} +4 -4
  271. package/web/dist/assets/dropdown-menu-B9UHiJFv.js +1 -0
  272. package/web/dist/assets/editable-title-C9aK-GCt.js +1 -0
  273. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-BVp0AyW4.js} +1 -1
  274. package/web/dist/assets/{file-D4GBh1ao.js → file-D1v6Cb9Q.js} +1 -1
  275. package/web/dist/assets/folder-HNaOtP70.js +1 -0
  276. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-C6KuSF45.js} +1 -1
  277. package/web/dist/assets/git-toolbar-DpRPWLaM.js +1 -0
  278. package/web/dist/assets/github-UumAmuAM.js +1 -0
  279. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  280. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  281. package/web/dist/assets/image-preview-M1y8lBCU.js +1 -0
  282. package/web/dist/assets/index-BNgqhk51.js +6 -0
  283. package/web/dist/assets/index-De7KdVHL.css +2 -0
  284. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  285. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  286. package/web/dist/assets/markdown-DfljSy6W.js +2 -0
  287. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  288. package/web/dist/assets/new-task-form-CkgsW8GC.js +1 -0
  289. package/web/dist/assets/pill-DWy7Dbv3.js +1 -0
  290. package/web/dist/assets/project-router-BJR_8pfk.js +1 -0
  291. package/web/dist/assets/prompt-templates-CKbMbly-.js +15 -0
  292. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  293. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-Bs4wU0JM.js} +1 -1
  294. package/web/dist/assets/repo-git-CBbpvexr.js +1 -0
  295. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  296. package/web/dist/assets/run-diff-CzrO-R7P.js +3 -0
  297. package/web/dist/assets/run-header-BQDPFKUM.js +1 -0
  298. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-sxnYXz0H.js} +1 -1
  299. package/web/dist/assets/skill-empty-hint-CMfCEn9L.js +1 -0
  300. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  301. package/web/dist/assets/skills-DrG0KcAJ.js +1 -0
  302. package/web/dist/assets/sparkles-CL1cbhb_.js +1 -0
  303. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-5JEPtGG-.js} +1 -1
  304. package/web/dist/assets/tab-link-DVT33Q2m.js +1 -0
  305. package/web/dist/assets/task-changes-BuuNjQ_C.js +1 -0
  306. package/web/dist/assets/task-commits-CVjZWXuP.js +1 -0
  307. package/web/dist/assets/task-files-f7USaQD1.js +2 -0
  308. package/web/dist/assets/task-thread-Cc7rMyer.js +9 -0
  309. package/web/dist/assets/textarea-BieGhkR-.js +1 -0
  310. package/web/dist/assets/thread-loading-CwfY_3r7.js +1 -0
  311. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-Cmbuh3Q9.js} +1 -1
  312. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-dswtPk4F.js} +1 -1
  313. package/web/dist/assets/{upload-CDdyPPo_.js → upload-BY1qMAxW.js} +1 -1
  314. package/web/dist/assets/use-desktop-DrxT9b31.js +1 -0
  315. package/web/dist/assets/use-submit-shortcut-CULpfw9y.js +1 -0
  316. package/web/dist/assets/utils-C5bzdO9U.js +64 -0
  317. package/web/dist/assets/workflows-D6GsX0A9.js +11 -0
  318. package/web/dist/assets/zoomable-image-CEjRqsuW.js +1 -0
  319. package/web/dist/index.html +33 -13
  320. package/scripts/dev.mjs +0 -74
  321. package/scripts/release-snapshot.mjs +0 -130
  322. package/scripts/release.mjs +0 -119
  323. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  324. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  325. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  326. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  327. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  328. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  329. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  330. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  331. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  332. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  333. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  334. package/web/dist/assets/index-DzroxqBG.css +0 -2
  335. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  336. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  337. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  338. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  339. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  340. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  341. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  342. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  343. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  344. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  345. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  346. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  347. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  348. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  349. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  350. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  351. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  352. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  353. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  354. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  355. /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
package/dist/handoff.d.ts CHANGED
@@ -56,7 +56,7 @@ export declare function followupsEnabled(env?: NodeJS.ProcessEnv): boolean;
56
56
  * inherited value from a parent cezar cannot shine through
57
57
  * (`RunManager.agentEnv`).
58
58
  */
59
- export declare const HANDOFF_ONLY_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 1\u20134 questions, each with 2\u20134 options and unique option labels. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.";
59
+ export declare const HANDOFF_ONLY_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 use only those keys (plus an optional non-empty \"id\" up to 64 characters), with 1\u20134 questions, 2\u20134 options per question, unique question text and option labels, header 1\u201312 characters, question 1\u2013400, option label 1\u201360, and description at most 280. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.";
60
60
  export declare const FOLLOWUP_INSTRUCTIONS = "## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
61
61
  /** Default-on combined contract retained for old callers and runs. */
62
- export declare const HANDOFF_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 1\u20134 questions, each with 2\u20134 options and unique option labels. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.\n\n## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
62
+ export declare const HANDOFF_INSTRUCTIONS = "## Handoff (cezar)\n\nCEZ_HANDOFF_FILE (env) is the absolute path to this task's rolling handoff file. Treat it like a HANDOFF.md:\n1. At the start of work, read it \u2014 \"Resume notes\" left by a previous session is your starting context.\n2. After every meaningful milestone (passing tests, a commit, a PR, a scope decision), append one terse timestamped line under \"## Progress log\", newest at the top.\n3. Before finishing or pausing, update \"## Resume notes\" with what's done, what's next and any blockers. Leave it empty only when the task is truly complete.\n\nTask completion marker: when the task's goal is fully achieved and you have no question for the user, end your final message with a line containing exactly CEZ:DONE \u2014 cez then closes the session and marks the task finished. If you are waiting on the user (a question, a decision, missing input), just end your message normally; the session stays open for their reply. Never emit CEZ:DONE while anything is unfinished or unverified.\n\nStill-working marker: if you end a turn while still working on your OWN downstream work \u2014 a sub-agent you dispatched, or a long-running command you're monitoring \u2014 and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as \"monitoring\" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.\n\nStructured question marker: when you are blocked on a decision that is genuinely the user's to make \u2014 one you cannot resolve from the request, the code, or sensible defaults \u2014 and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {\"questions\":[{\"header\":\"\u226412-char label\",\"question\":\"a clear question ending in ?\",\"multiSelect\":false,\"options\":[{\"label\":\"short choice\",\"description\":\"what it means / the trade-off\"}]}]} \u2014 use only those keys (plus an optional non-empty \"id\" up to 64 characters), with 1\u20134 questions, 2\u20134 options per question, unique question text and option labels, header 1\u201312 characters, question 1\u2013400, option label 1\u201360, and description at most 280. The user can always type a free-form reply, so never add an \"Other\" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.\n\nTask reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject \u2014 never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. \"implementing comment threads\"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.\n\n## Pasted attachments\nUser-pasted screenshots/files are saved as real files; their absolute paths are listed in the message that carries them. Use those paths when a task needs the file itself (saving, uploading, attaching to issues/PRs); the inline image is for viewing only.\n\n## Follow-ups (cezar)\n\nCEZ_TODOS_FILE (env) is the absolute path to the user's follow-up inbox \u2014 a JSON array. Only append an entry when a genuinely actionable follow-up remains: something concrete a human or the next agent still needs to decide or do (a review nit worth a dedicated pass, a manual step you cannot take yourself, a decision blocked on the user, a known next task). Do NOT append filler \u2014 a restated summary of what you just finished, a congratulatory note, or \"no further action needed\" is not a follow-up; when the task is simply done, skip this file entirely. When (and only when) a real follow-up exists, read the file (treat a missing file as []), append ONE object and write the whole array back:\n{ \"ts\": \"<ISO 8601>\", \"taskId\": \"<value of CEZ_TASK_ID>\", \"summary\": \"<one sentence: the concrete next action, not a status report>\", \"action\": \"<imperative user action, optional>\", \"prUrl\": \"<optional>\", \"suggestedSkill\": \"<optional skill name for the follow-up>\", \"suggestedArgs\": \"<optional>\", \"suggestedPrompt\": \"<optional freeform prompt for the follow-up task>\", \"runnable\": <true when an agent can execute this follow-up, false when it is a note> }\nSet \"runnable\": false for anything a human must do or merely read \u2014 manual QA, \"remember to\u2026\", informational notes \u2014 and leave out suggestedSkill/suggestedPrompt for those; the inbox then offers \"Acknowledge\" instead of \"Run\". Set \"runnable\": true only when suggestedSkill or suggestedPrompt says what to actually execute.\nNever modify or remove existing entries \u2014 append only.";
package/dist/handoff.js CHANGED
@@ -137,7 +137,7 @@ Task completion marker: when the task's goal is fully achieved and you have no q
137
137
 
138
138
  Still-working marker: if you end a turn while still working on your OWN downstream work — a sub-agent you dispatched, or a long-running command you're monitoring — and are NOT waiting on the user for anything, end your final message with a line containing exactly CEZ:MONITORING. cez then shows the task as "monitoring" (still working) instead of asking for your attention. Use CEZ:MONITORING only for that in-progress case; use CEZ:DONE when the goal is done; end plainly (no marker) only when you are genuinely waiting on the user. Never combine CEZ:MONITORING with CEZ:DONE.
139
139
 
140
- Structured question marker: when you are blocked on a decision that is genuinely the user's to make — one you cannot resolve from the request, the code, or sensible defaults — and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {"questions":[{"header":"≤12-char label","question":"a clear question ending in ?","multiSelect":false,"options":[{"label":"short choice","description":"what it means / the trade-off"}]}]} — 1–4 questions, each with 2–4 options and unique option labels. The user can always type a free-form reply, so never add an "Other" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.
140
+ Structured question marker: when you are blocked on a decision that is genuinely the user's to make — one you cannot resolve from the request, the code, or sensible defaults — and it comes down to a few concrete choices, end your turn with a single line CEZ:ASK <json> instead of asking in prose. cez renders it as clickable option chips in the cockpit so the user can answer in one tap. The <json> is ONE object on ONE line, the last thing in your message: {"questions":[{"header":"≤12-char label","question":"a clear question ending in ?","multiSelect":false,"options":[{"label":"short choice","description":"what it means / the trade-off"}]}]} — use only those keys (plus an optional non-empty "id" up to 64 characters), with 1–4 questions, 2–4 options per question, unique question text and option labels, header 1–12 characters, question 1–400, option label 1–60, and description at most 280. The user can always type a free-form reply, so never add an "Other" option. Prefer sensible defaults over asking; use CEZ:ASK only when the choice is truly the user's. Never combine CEZ:ASK with CEZ:DONE or CEZ:MONITORING.
141
141
 
142
142
  Task reference markers: as soon as you know which GitHub pull request or issue this task is ABOUT (it was named in the task, or you just opened it), declare it by emitting, on its own line in your message text: CEZ:PR=<number> and/or CEZ:ISSUE=<number>. Re-emit with the new number if the subject changes (e.g. you open a PR later in the task). Declare only the task's own subject — never a PR/issue you merely mention, list, or compare against. You may also emit CEZ:TITLE=<terse gerund phrase, max 40 chars, e.g. "implementing comment threads"> once the work has a clearer shape than its current title; cez uses these instead of guessing from the transcript. Put markers in plain message text, never inside a code fence.
143
143
 
package/dist/index.js CHANGED
@@ -6,16 +6,21 @@ import { mkdirSync, writeFileSync, existsSync, readFileSync } from 'node:fs';
6
6
  import { dirname, join, resolve } from 'node:path';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { detectEnvironment } from './core/backend-detect.js';
9
+ import { ProviderAuthService, providerAuthChecksDisabled, } from './core/provider-auth.js';
10
+ import { applyProviderEnablement } from './core/provider-availability.js';
9
11
  import { pruneOrphans } from './git-worktree.js';
10
12
  import { getRepoInfo } from './server/git.js';
11
- import { DEFAULT_WORKTREE_RETENTION, resolveWorktreeRetention } from './config.js';
13
+ import { DEFAULT_WORKTREE_RETENTION, loadConfig, resolveWorktreeRetention } from './config.js';
12
14
  import { reclaimWorktrees } from './runs/retention.js';
13
15
  import { RunStore } from './runs/store.js';
14
16
  import { RunManager } from './workflows/run.js';
15
17
  import { loadWorkflows } from './workflows/load.js';
16
- import { startServer } from './server/server.js';
18
+ import { startServer, WorkspaceEventBus } from './server/server.js';
19
+ import { ProviderRuntimeAuthObserver, recoverWithProviderRuntimeAuthObservation, } from './server/provider-auth-runtime.js';
20
+ import { providersRequiredByWorkflow, unavailableProviderMessage, } from './server/provider-action-gate.js';
17
21
  import { checkForUpdate } from './update-check.js';
18
22
  import { printSkillsBanner } from './skills-banner.js';
23
+ import { loadWorkspaceConfig } from './workspace/config.js';
19
24
  import { runMigrations } from './workspace/migrations.js';
20
25
  import { registerProject, shouldRegisterProject } from './workspace/projects.js';
21
26
  import { runProjectsCommand } from './workspace/projects-cli.js';
@@ -157,7 +162,7 @@ async function main() {
157
162
  *
158
163
  * Returns the boot project's registry id when registration happened —
159
164
  * `serveCommand` plumbs it into the server (`ServerDeps.bootProjectId`) so
160
- * `/api/projects` and `/api/health` can name the boot project without a
165
+ * `/api/projects` and `/api/v1/health` can name the boot project without a
161
166
  * lookup. Undefined when registration was suppressed or the workspace is
162
167
  * unavailable; the server then derives a fallback on its own.
163
168
  */
@@ -186,6 +191,11 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
186
191
  // the previous process exited are re-queued or resumed instead of failed.
187
192
  const store = openStore(repoRoot, { keepLive: true });
188
193
  const manager = new RunManager(store, repoRoot, { semaphore });
194
+ const providerAuth = new ProviderAuthService();
195
+ const workspaceEvents = new WorkspaceEventBus();
196
+ const providerRuntimeAuth = new ProviderRuntimeAuthObserver(providerAuth, (status) => {
197
+ workspaceEvents.emit('provider-status', status);
198
+ });
189
199
  const version = readOwnVersion();
190
200
  const checks = await detectEnvironment();
191
201
  const repo = await getRepoInfo(repoRoot);
@@ -207,11 +217,11 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
207
217
  const recovered = store
208
218
  .listRuns()
209
219
  .filter((r) => ['queued', 'waiting', 'running'].includes(r.status)).length;
210
- await manager.recover();
220
+ await recoverWithProviderRuntimeAuthObservation(store, () => manager.recover(), providerRuntimeAuth);
211
221
  if (recovered > 0)
212
222
  console.log(` recovered ${recovered} run(s) from the previous session`);
213
223
  // Update discovery (#368) — fire-and-forget; the banner prints whenever the
214
- // registry answers and /api/health picks it up for the GUI chip.
224
+ // registry answers and /api/v1/health picks it up for the GUI chip.
215
225
  const pkgName = readOwnName();
216
226
  const update = {};
217
227
  void checkForUpdate(pkgName, version).then((latest) => {
@@ -230,7 +240,19 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
230
240
  ` Only do this behind a reverse proxy that enforces authentication,\n` +
231
241
  ` and make sure this interface is not reachable from the internet.\n`);
232
242
  }
233
- startServer({ repoRoot, store, manager, version, update, bootProjectId, semaphore, bindHost }, port);
243
+ startServer({
244
+ repoRoot,
245
+ store,
246
+ manager,
247
+ version,
248
+ update,
249
+ bootProjectId,
250
+ semaphore,
251
+ bindHost,
252
+ providerAuth,
253
+ providerRuntimeAuth,
254
+ workspaceEvents,
255
+ }, port);
234
256
  const url = `http://localhost:${port}`;
235
257
  console.log(`\n cezar v${version} — ${repoRoot}`);
236
258
  console.log(` ${repo ? `branch ${repo.branch}` : 'not a git repository (tasks run in place, one at a time; repo view is empty)'}`);
@@ -253,7 +275,7 @@ async function serveCommand(repoRoot, preferredPort, openBrowser, bindHost) {
253
275
  // Open the browser only once the server actually answers, so the first
254
276
  // paint is the cockpit and never a connection error.
255
277
  if (openBrowser) {
256
- const healthy = await waitForHealth(`${url}/api/health`, 5_000);
278
+ const healthy = await waitForHealth(`${url}/api/v1/health`, 5_000);
257
279
  if (healthy)
258
280
  openUrl(url);
259
281
  }
@@ -307,7 +329,25 @@ async function runCommand(repoRoot, task, workflowName, model) {
307
329
  process.exitCode = 1;
308
330
  return;
309
331
  }
332
+ const providerAuth = new ProviderAuthService();
333
+ const requiredProviders = providersRequiredByWorkflow(workflow, (await loadConfig(repoRoot)).defaultRunner);
334
+ if (requiredProviders.length > 0 && !providerAuthChecksDisabled()) {
335
+ const [discovered, workspace] = await Promise.all([
336
+ providerAuth.status(),
337
+ loadWorkspaceConfig(),
338
+ ]);
339
+ const blocked = unavailableProviderMessage(requiredProviders, applyProviderEnablement(discovered, workspace.disabledProviders));
340
+ if (blocked) {
341
+ console.error(blocked);
342
+ process.exitCode = 1;
343
+ return;
344
+ }
345
+ }
310
346
  const store = openStore(repoRoot);
347
+ // Headless tasks still appear in the cockpit later, so persist the same
348
+ // task-local recovery event when a credential expires after the preflight.
349
+ const providerRuntimeAuth = new ProviderRuntimeAuthObserver(providerAuth, () => { });
350
+ providerRuntimeAuth.watch(store);
311
351
  // Headless runs enforce the same workspace-level cap/memory limit (step
312
352
  // 2.5) — one refreshed semaphore, even with just one manager in play.
313
353
  const semaphore = new WorkspaceSemaphore();
@@ -549,7 +589,24 @@ function openStore(repoRoot, opts) {
549
589
  /** Keep run data out of the user's repo history; workflows/skills stay committable. */
550
590
  function ensureDataGitignore(repoRoot) {
551
591
  const path = join(repoRoot, '.ai/cezar', '.gitignore');
552
- const wanted = ['runs.json', 'runs.json.tmp', 'runs/', 'worktrees/', 'todos.json', 'todos.json.tmp', 'launch-key'];
592
+ const wanted = [
593
+ 'runs.json',
594
+ 'runs.json.tmp',
595
+ 'runs/',
596
+ 'worktrees/',
597
+ 'todos.json',
598
+ 'todos.json.tmp',
599
+ 'launch-key',
600
+ 'automations.json',
601
+ 'automations.json.tmp',
602
+ 'automation-state.json',
603
+ 'automation-state.json.tmp',
604
+ 'automation-receipts.ndjson',
605
+ 'automation-receipts.ndjson.tmp',
606
+ 'automation-log.ndjson',
607
+ 'automation-log.ndjson.tmp',
608
+ 'automation-poll.lock',
609
+ ];
553
610
  try {
554
611
  mkdirSync(join(repoRoot, '.ai/cezar'), { recursive: true });
555
612
  const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,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,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/dist/paths.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AgentHomePaths } from './agent-config/catalog.js';
1
+ import type { AgentHomePaths } from './agent-config/catalog.ts';
2
2
  /**
3
3
  * Per-user cezar home. Literal `~/.cezar` on every platform (no XDG, no
4
4
  * `%LOCALAPPDATA%` branch) — one rule, and it matches how the existing cache
@@ -10,7 +10,22 @@ import type { AgentHomePaths } from './agent-config/catalog.js';
10
10
  * first writer owns the file, later specs import it. Do not duplicate this
11
11
  * homedir logic elsewhere.
12
12
  */
13
- export declare function cezarHomeDir(): string;
13
+ export declare function cezarHomeDir(env?: NodeJS.ProcessEnv): string;
14
+ /**
15
+ * The last line of defence for the developer's own `~/.cezar` while the suite
16
+ * runs. Every workspace test pins `CEZ_HOME` to a temp dir, but the pin lives
17
+ * in `process.env` — a single global for the whole worker. A test that ends
18
+ * before its write does (a timeout is enough) has its `afterEach` drop the pin
19
+ * while the write is still in flight, and the write then resolves the REAL
20
+ * home and replaces the developer's project registry with the fixture's.
21
+ *
22
+ * So writers into the cezar home ask here first: under vitest, a write whose
23
+ * destination is the real `~/.cezar` is always a leaked test, never intent —
24
+ * fail it loudly instead of rewriting a file the suite does not own. Outside
25
+ * vitest this is a no-op, and an explicitly pinned `CEZ_HOME` (the temp dir the
26
+ * test meant to use) never matches the real home, so honest tests are unaffected.
27
+ */
28
+ export declare function assertCezarHomeWriteIsSandboxed(path: string, env?: NodeJS.ProcessEnv): void;
14
29
  /**
15
30
  * The default server-install instance id. An install with no `--domain` (the
16
31
  * original single-cockpit-per-host flow) is this instance, and it keeps the
@@ -45,13 +60,28 @@ export declare function serverStatePath(instance?: string): string;
45
60
  * been booted in. Lives directly under `cezarHomeDir()`, so the `CEZ_HOME`
46
61
  * override applies (tests/containers never touch a real home dir).
47
62
  */
48
- export declare function workspaceConfigPath(): string;
63
+ export declare function workspaceConfigPath(env?: NodeJS.ProcessEnv): string;
49
64
  /**
50
65
  * Global GUI state — the workspace twin of the per-repo
51
66
  * `.ai/cezar/ui-state.json`. Cross-project UI prefs live here; per-project
52
67
  * state (pinned runs, templates) stays in each repo's file.
53
68
  */
54
69
  export declare function workspaceUiStatePath(): string;
70
+ /**
71
+ * Agent accounts — extra config dirs for a second login of the same agent CLI, plus which one
72
+ * each project uses (spec `2026-07-29-agent-profiles.md`).
73
+ *
74
+ * Its OWN file rather than a key in `config.json`, and that is the whole point: a cezar version
75
+ * that has never heard of accounts does not open this file, so it cannot drop them. Living in
76
+ * `config.json` made their survival depend on a `.passthrough()` in *another version's* source —
77
+ * a guarantee this repo cannot make on behalf of a build the user might switch to, and one that
78
+ * evaporates entirely the moment any version fails to parse that file and degrades to defaults
79
+ * (the next merge-write then rewrites it without them).
80
+ *
81
+ * The per-project selections live here too, beside the accounts they name, so deleting an account
82
+ * and scrubbing every reference to it stays ONE atomic write.
83
+ */
84
+ export declare function agentAccountsPath(): string;
55
85
  /**
56
86
  * Expand a leading `~` to the user's home. Lives here with the other homedir
57
87
  * logic (see the module note above — one place owns `homedir()`): the
@@ -70,8 +100,41 @@ export declare function expandTilde(path: string): string;
70
100
  export declare function serverLockPath(instance?: string): string;
71
101
  /**
72
102
  * Where each coding agent keeps its per-user config, honouring the env vars the
73
- * vendors document: `$CODEX_HOME` relocates Codex's home; `$XDG_CONFIG_HOME`
74
- * relocates OpenCode's config dir (falling back to `~/.config`). Claude's `~/.claude`
75
- * has no documented override. Read per call so tests and ops can set env live.
103
+ * vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
104
+ * `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
105
+ * dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
106
+ *
107
+ * These are the DEFAULT profile's dirs. A second login of the same CLI is an
108
+ * agent profile (`src/core/agent-profiles.ts`) and resolves through
109
+ * `agentHomePathsForProfiles` instead — what this function answers is what the
110
+ * host is configured for when nothing overrides it.
76
111
  */
77
112
  export declare function agentHomePaths(env?: NodeJS.ProcessEnv): AgentHomePaths;
113
+ /**
114
+ * Where Claude Code keeps `.claude.json` — its MCP/state file — for a given config dir. The
115
+ * location is NOT uniform: by default the file is a SIBLING of `~/.claude`, but under a
116
+ * `CLAUDE_CONFIG_DIR` override it moves INSIDE the overridden dir (verified against the shipped CLI
117
+ * 2026-07-29, and against a real second-account dir on disk). Reading it from `dirname(configDir)`
118
+ * unconditionally — as this repo did — lands on `~/.claude.json` for a `~/.claude-klaudiusz`
119
+ * profile, i.e. the wrong account's file.
120
+ *
121
+ * The condition below reads like two heuristics OR-ed together; it is one exact rule. The file sits
122
+ * inside precisely when the CLI will SEE `CLAUDE_CONFIG_DIR` for this dir, and cezar knows when
123
+ * that is:
124
+ *
125
+ * - a stored account is always spawned with it (`profileEnv`), and its dir is by construction not
126
+ * `~/.claude` — the route refuses a dir that is already the discovered account's;
127
+ * - the DISCOVERED account is spawned with nothing added, so it sees the variable only when the
128
+ * cezar process itself carries one — and it does reach the child, because `CLAUDE_` is in
129
+ * `BACKEND_ALLOW_PREFIXES`.
130
+ *
131
+ * One case is worth naming because it looks like a bug and is not. Start cezar with
132
+ * `CLAUDE_CONFIG_DIR=/opt/work` and add `~/.claude` as a NAMED account (legal — the discovered
133
+ * account is `/opt/work`, so `~/.claude` is not a duplicate). This answers `~/.claude/.claude.json`,
134
+ * not the sibling `~/.claude.json`, and "Show details" can therefore say "not signed in" for a
135
+ * folder a bare `claude` would treat as signed in. That is correct rather than unfortunate: cezar
136
+ * will run that account as `CLAUDE_CONFIG_DIR=~/.claude claude`, and under that invocation the
137
+ * state file the CLI reads and writes IS the one inside. Reporting the sibling would describe a
138
+ * login this account will never use.
139
+ */
140
+ export declare function claudeStateFilePath(claudeHome: string, env?: NodeJS.ProcessEnv): string;
package/dist/paths.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { homedir } from 'node:os';
2
- import { join } from 'node:path';
2
+ import { dirname, join, sep } from 'node:path';
3
3
  /**
4
4
  * Per-user cezar home. Literal `~/.cezar` on every platform (no XDG, no
5
5
  * `%LOCALAPPDATA%` branch) — one rule, and it matches how the existing cache
@@ -11,10 +11,33 @@ import { join } from 'node:path';
11
11
  * first writer owns the file, later specs import it. Do not duplicate this
12
12
  * homedir logic elsewhere.
13
13
  */
14
- export function cezarHomeDir() {
14
+ export function cezarHomeDir(env = process.env) {
15
15
  // `|| undefined` so an EMPTY CEZ_HOME (e.g. `CEZ_HOME= cezar …`) falls back
16
16
  // to the default instead of yielding relative paths in the cwd.
17
- return (process.env.CEZ_HOME || undefined) ?? join(homedir(), '.cezar');
17
+ return (env.CEZ_HOME || undefined) ?? join(homedir(), '.cezar');
18
+ }
19
+ /**
20
+ * The last line of defence for the developer's own `~/.cezar` while the suite
21
+ * runs. Every workspace test pins `CEZ_HOME` to a temp dir, but the pin lives
22
+ * in `process.env` — a single global for the whole worker. A test that ends
23
+ * before its write does (a timeout is enough) has its `afterEach` drop the pin
24
+ * while the write is still in flight, and the write then resolves the REAL
25
+ * home and replaces the developer's project registry with the fixture's.
26
+ *
27
+ * So writers into the cezar home ask here first: under vitest, a write whose
28
+ * destination is the real `~/.cezar` is always a leaked test, never intent —
29
+ * fail it loudly instead of rewriting a file the suite does not own. Outside
30
+ * vitest this is a no-op, and an explicitly pinned `CEZ_HOME` (the temp dir the
31
+ * test meant to use) never matches the real home, so honest tests are unaffected.
32
+ */
33
+ export function assertCezarHomeWriteIsSandboxed(path, env = process.env) {
34
+ if (!env.VITEST)
35
+ return;
36
+ const realHome = join(homedir(), '.cezar');
37
+ if (path !== realHome && !path.startsWith(realHome + sep))
38
+ return;
39
+ throw new Error(`[cez] refusing to write ${path} from a test run — CEZ_HOME is not pinned to a sandbox. ` +
40
+ 'Pin it (the vitest setup file does this by default) so the suite never touches the real cezar home.');
18
41
  }
19
42
  /**
20
43
  * The default server-install instance id. An install with no `--domain` (the
@@ -62,8 +85,8 @@ export function serverStatePath(instance = DEFAULT_SERVER_INSTANCE) {
62
85
  * been booted in. Lives directly under `cezarHomeDir()`, so the `CEZ_HOME`
63
86
  * override applies (tests/containers never touch a real home dir).
64
87
  */
65
- export function workspaceConfigPath() {
66
- return join(cezarHomeDir(), 'config.json');
88
+ export function workspaceConfigPath(env = process.env) {
89
+ return join(cezarHomeDir(env), 'config.json');
67
90
  }
68
91
  /**
69
92
  * Global GUI state — the workspace twin of the per-repo
@@ -73,6 +96,23 @@ export function workspaceConfigPath() {
73
96
  export function workspaceUiStatePath() {
74
97
  return join(cezarHomeDir(), 'ui-state.json');
75
98
  }
99
+ /**
100
+ * Agent accounts — extra config dirs for a second login of the same agent CLI, plus which one
101
+ * each project uses (spec `2026-07-29-agent-profiles.md`).
102
+ *
103
+ * Its OWN file rather than a key in `config.json`, and that is the whole point: a cezar version
104
+ * that has never heard of accounts does not open this file, so it cannot drop them. Living in
105
+ * `config.json` made their survival depend on a `.passthrough()` in *another version's* source —
106
+ * a guarantee this repo cannot make on behalf of a build the user might switch to, and one that
107
+ * evaporates entirely the moment any version fails to parse that file and degrades to defaults
108
+ * (the next merge-write then rewrites it without them).
109
+ *
110
+ * The per-project selections live here too, beside the accounts they name, so deleting an account
111
+ * and scrubbing every reference to it stays ONE atomic write.
112
+ */
113
+ export function agentAccountsPath() {
114
+ return join(cezarHomeDir(), 'agent-accounts.json');
115
+ }
76
116
  /**
77
117
  * Expand a leading `~` to the user's home. Lives here with the other homedir
78
118
  * logic (see the module note above — one place owns `homedir()`): the
@@ -99,17 +139,54 @@ export function serverLockPath(instance = DEFAULT_SERVER_INSTANCE) {
99
139
  }
100
140
  /**
101
141
  * Where each coding agent keeps its per-user config, honouring the env vars the
102
- * vendors document: `$CODEX_HOME` relocates Codex's home; `$XDG_CONFIG_HOME`
103
- * relocates OpenCode's config dir (falling back to `~/.config`). Claude's `~/.claude`
104
- * has no documented override. Read per call so tests and ops can set env live.
142
+ * vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
143
+ * `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
144
+ * dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
145
+ *
146
+ * These are the DEFAULT profile's dirs. A second login of the same CLI is an
147
+ * agent profile (`src/core/agent-profiles.ts`) and resolves through
148
+ * `agentHomePathsForProfiles` instead — what this function answers is what the
149
+ * host is configured for when nothing overrides it.
105
150
  */
106
151
  export function agentHomePaths(env = process.env) {
107
152
  const home = env.HOME || env.USERPROFILE || homedir();
108
153
  const xdgConfig = env.XDG_CONFIG_HOME?.trim() || join(home, '.config');
109
154
  return {
110
- claude: join(home, '.claude'),
155
+ claude: env.CLAUDE_CONFIG_DIR?.trim() || join(home, '.claude'),
111
156
  codex: env.CODEX_HOME?.trim() || join(home, '.codex'),
112
157
  opencodeConfig: join(xdgConfig, 'opencode'),
113
158
  };
114
159
  }
160
+ /**
161
+ * Where Claude Code keeps `.claude.json` — its MCP/state file — for a given config dir. The
162
+ * location is NOT uniform: by default the file is a SIBLING of `~/.claude`, but under a
163
+ * `CLAUDE_CONFIG_DIR` override it moves INSIDE the overridden dir (verified against the shipped CLI
164
+ * 2026-07-29, and against a real second-account dir on disk). Reading it from `dirname(configDir)`
165
+ * unconditionally — as this repo did — lands on `~/.claude.json` for a `~/.claude-klaudiusz`
166
+ * profile, i.e. the wrong account's file.
167
+ *
168
+ * The condition below reads like two heuristics OR-ed together; it is one exact rule. The file sits
169
+ * inside precisely when the CLI will SEE `CLAUDE_CONFIG_DIR` for this dir, and cezar knows when
170
+ * that is:
171
+ *
172
+ * - a stored account is always spawned with it (`profileEnv`), and its dir is by construction not
173
+ * `~/.claude` — the route refuses a dir that is already the discovered account's;
174
+ * - the DISCOVERED account is spawned with nothing added, so it sees the variable only when the
175
+ * cezar process itself carries one — and it does reach the child, because `CLAUDE_` is in
176
+ * `BACKEND_ALLOW_PREFIXES`.
177
+ *
178
+ * One case is worth naming because it looks like a bug and is not. Start cezar with
179
+ * `CLAUDE_CONFIG_DIR=/opt/work` and add `~/.claude` as a NAMED account (legal — the discovered
180
+ * account is `/opt/work`, so `~/.claude` is not a duplicate). This answers `~/.claude/.claude.json`,
181
+ * not the sibling `~/.claude.json`, and "Show details" can therefore say "not signed in" for a
182
+ * folder a bare `claude` would treat as signed in. That is correct rather than unfortunate: cezar
183
+ * will run that account as `CLAUDE_CONFIG_DIR=~/.claude claude`, and under that invocation the
184
+ * state file the CLI reads and writes IS the one inside. Reporting the sibling would describe a
185
+ * login this account will never use.
186
+ */
187
+ export function claudeStateFilePath(claudeHome, env = process.env) {
188
+ const seesOverride = (env.CLAUDE_CONFIG_DIR?.trim() || '') !== ''
189
+ || claudeHome !== join(env.HOME || env.USERPROFILE || homedir(), '.claude');
190
+ return seesOverride ? join(claudeHome, '.claude.json') : join(dirname(claudeHome), '.claude.json');
191
+ }
115
192
  //# sourceMappingURL=paths.js.map
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY;IAC1B,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,S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AAI,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;QAC9D,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;QACrD,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC1F,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE;WAC5D,UAAU,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9E,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;AACrG,CAAC"}
package/dist/planner.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type WorkflowStepDef } from './workflows/types.js';
2
+ import { type WorkflowStepDef } from './workflows/types.ts';
3
3
  export interface PlanResult {
4
4
  /** The proposed workflow title (kebab-case slug), when the planner named one. The auto chain
5
5
  * creator pre-fills the builder's name field with it. Absent on the degraded fallback. */
@@ -24,4 +24,4 @@ export declare function proposeWorkflowName(raw: string | undefined): string | u
24
24
  * then scan for balanced top-level `{...}` blocks and return the first that
25
25
  * validates. Null when nothing does — the caller decides how to recover.
26
26
  */
27
- export declare function parseStructured<T>(raw: string, schema: z.ZodType<T, z.ZodTypeDef, unknown>): T | null;
27
+ export declare function parseStructured<T>(raw: string, schema: z.ZodType<T, unknown>): T | null;
package/dist/planner.js CHANGED
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
  import { createRunner } from './core/runner-factory.js';
5
5
  import { loadConfig } from './config.js';
6
6
  import { discoverSkills } from './skills.js';
7
+ import { resolveProfileEnvForRoot } from './workspace/agent-profiles.js';
7
8
  import { workflowStepSchema } from './workflows/types.js';
8
9
  /**
9
10
  * Chain-from-prompt (spec 008): one cheap `claude` call turns the user's task
@@ -46,6 +47,10 @@ export async function planChain(repoRoot, task) {
46
47
  // OpenCode pick their own default model instead.
47
48
  const runner = createRunner(config.defaultRunner);
48
49
  const plannerModel = config.defaultRunner === 'claude' ? config.plannerModel : undefined;
50
+ // Plan under the SAME agent account this project's tasks run on (spec
51
+ // 2026-07-29-agent-profiles). Without this the planner would quietly bill the personal
52
+ // subscription for a project the user pointed at their work account.
53
+ const { env: profileEnv } = await resolveProfileEnvForRoot(repoRoot, config.defaultRunner);
49
54
  // One retry on an unparseable answer; a runner error goes straight to fallback.
50
55
  for (let attempt = 0; attempt < 2; attempt++) {
51
56
  let text;
@@ -55,6 +60,7 @@ export async function planChain(repoRoot, task) {
55
60
  userPrompt,
56
61
  cwd: repoRoot,
57
62
  allowedTools: [],
63
+ ...(Object.keys(profileEnv).length > 0 ? { env: profileEnv } : {}),
58
64
  model: plannerModel,
59
65
  timeoutMs: PLANNER_TIMEOUT_MS,
60
66
  });
@@ -106,7 +112,7 @@ function buildPlannerPrompt(task, skills, verifyCommands) {
106
112
  */
107
113
  async function detectVerifyCommands(repoRoot) {
108
114
  const out = [];
109
- const pkgSchema = z.object({ scripts: z.record(z.string()).default({}) });
115
+ const pkgSchema = z.object({ scripts: z.record(z.string(), z.string()).default({}) });
110
116
  try {
111
117
  const raw = JSON.parse(await readFile(join(repoRoot, 'package.json'), 'utf8'));
112
118
  const pkg = pkgSchema.safeParse(raw);