@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
@@ -23,234 +23,101 @@ export declare const PROJECT_ID_RE: RegExp;
23
23
  * degrade per-key so one bad value never evicts the project.
24
24
  */
25
25
  declare const workspaceProjectSchema: z.ZodObject<{
26
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
27
26
  id: z.ZodString;
28
- /** Absolute, realpath-normalized repo root (normalization is the writer's
29
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
30
- root: z.ZodEffects<z.ZodString, string, string>;
31
- /** Display name (basename by default). `''` = caller derives a fallback. */
27
+ root: z.ZodString;
32
28
  name: z.ZodCatch<z.ZodString>;
33
29
  addedAt: z.ZodCatch<z.ZodString>;
34
30
  lastOpenedAt: z.ZodCatch<z.ZodString>;
35
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
36
- /** Per-project cap on concurrently running tasks. Absent = inherit the
37
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
38
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
39
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
31
+ source: z.ZodCatch<z.ZodEnum<{
32
+ checkout: "checkout";
33
+ local: "local";
34
+ }>>;
40
35
  maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
41
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
42
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
43
- id: z.ZodString;
44
- /** Absolute, realpath-normalized repo root (normalization is the writer's
45
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
46
- root: z.ZodEffects<z.ZodString, string, string>;
47
- /** Display name (basename by default). `''` = caller derives a fallback. */
48
- name: z.ZodCatch<z.ZodString>;
49
- addedAt: z.ZodCatch<z.ZodString>;
50
- lastOpenedAt: z.ZodCatch<z.ZodString>;
51
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
52
- /** Per-project cap on concurrently running tasks. Absent = inherit the
53
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
54
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
55
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
56
- maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
57
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
58
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
59
- id: z.ZodString;
60
- /** Absolute, realpath-normalized repo root (normalization is the writer's
61
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
62
- root: z.ZodEffects<z.ZodString, string, string>;
63
- /** Display name (basename by default). `''` = caller derives a fallback. */
64
- name: z.ZodCatch<z.ZodString>;
65
- addedAt: z.ZodCatch<z.ZodString>;
66
- lastOpenedAt: z.ZodCatch<z.ZodString>;
67
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
68
- /** Per-project cap on concurrently running tasks. Absent = inherit the
69
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
70
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
71
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
72
- maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
73
- }, z.ZodTypeAny, "passthrough">>;
36
+ }, z.core.$loose>;
74
37
  export type WorkspaceProject = z.infer<typeof workspaceProjectSchema>;
75
38
  declare const workspaceConfigSchema: z.ZodObject<{
76
- /** Migration cursor (src/workspace/migrations.ts). Absent/bad → 0, which
77
- * means "run every migration" — each one is idempotent, so that is safe. */
78
- schemaVersion: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
79
- /** Root exposed by the Add project folder browser. Environment supplies
80
- * the zero-config default; an explicit workspace value wins thereafter. */
81
- browseRoot: z.ZodCatch<z.ZodDefault<z.ZodString>>;
82
- /** Checkout root for GUI-cloned projects. Stored as written (a literal
83
- * `~` is expanded by the checkout flow, not here); validated writable
84
- * when *changed*, never at load. */
85
- projectsDir: z.ZodCatch<z.ZodDefault<z.ZodString>>;
86
- resources: z.ZodCatch<z.ZodDefault<z.ZodObject<{
87
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
88
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
89
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
90
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
91
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
92
- /** Default worktree retention for projects that don't override it. */
93
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
94
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
95
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
96
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
97
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
98
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
99
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
100
- /** Default worktree retention for projects that don't override it. */
101
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
102
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
103
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
104
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
105
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
106
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
107
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
108
- /** Default worktree retention for projects that don't override it. */
109
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
110
- }, z.ZodTypeAny, "passthrough">>>>;
111
- /** Per-entry salvage: a corrupt entry is dropped, the rest of the registry
112
- * survives (a whole-array `.catch([])` would evict every project over one
113
- * bad row). */
114
- projects: z.ZodEffects<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>>, z.objectOutputType<{
115
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
116
- id: z.ZodString;
117
- /** Absolute, realpath-normalized repo root (normalization is the writer's
118
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
119
- root: z.ZodEffects<z.ZodString, string, string>;
120
- /** Display name (basename by default). `''` = caller derives a fallback. */
121
- name: z.ZodCatch<z.ZodString>;
122
- addedAt: z.ZodCatch<z.ZodString>;
123
- lastOpenedAt: z.ZodCatch<z.ZodString>;
124
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
125
- /** Per-project cap on concurrently running tasks. Absent = inherit the
126
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
127
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
128
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
129
- maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
130
- }, z.ZodTypeAny, "passthrough">[], unknown>;
131
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
132
- /** Migration cursor (src/workspace/migrations.ts). Absent/bad → 0, which
133
- * means "run every migration" — each one is idempotent, so that is safe. */
134
39
  schemaVersion: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
135
- /** Root exposed by the Add project folder browser. Environment supplies
136
- * the zero-config default; an explicit workspace value wins thereafter. */
137
40
  browseRoot: z.ZodCatch<z.ZodDefault<z.ZodString>>;
138
- /** Checkout root for GUI-cloned projects. Stored as written (a literal
139
- * `~` is expanded by the checkout flow, not here); validated writable
140
- * when *changed*, never at load. */
141
41
  projectsDir: z.ZodCatch<z.ZodDefault<z.ZodString>>;
142
- resources: z.ZodCatch<z.ZodDefault<z.ZodObject<{
143
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
42
+ skillsAutoUpdate: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
43
+ modelsLocked: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
44
+ resources: z.ZodCatch<z.ZodPrefault<z.ZodObject<{
144
45
  maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
145
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
146
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
46
+ maxMonitoringSessions: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
47
+ monitoringWakeIntervalMinutes: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
48
+ autoResumeOnUsageLimit: z.ZodCatch<z.ZodDefault<z.ZodBoolean>>;
147
49
  memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
148
- /** Default worktree retention for projects that don't override it. */
149
50
  worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
150
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
151
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
152
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
153
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
154
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
155
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
156
- /** Default worktree retention for projects that don't override it. */
157
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
158
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
159
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
160
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
161
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
162
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
163
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
164
- /** Default worktree retention for projects that don't override it. */
165
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
166
- }, z.ZodTypeAny, "passthrough">>>>;
167
- /** Per-entry salvage: a corrupt entry is dropped, the rest of the registry
168
- * survives (a whole-array `.catch([])` would evict every project over one
169
- * bad row). */
170
- projects: z.ZodEffects<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>>, z.objectOutputType<{
171
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
172
- id: z.ZodString;
173
- /** Absolute, realpath-normalized repo root (normalization is the writer's
174
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
175
- root: z.ZodEffects<z.ZodString, string, string>;
176
- /** Display name (basename by default). `''` = caller derives a fallback. */
177
- name: z.ZodCatch<z.ZodString>;
178
- addedAt: z.ZodCatch<z.ZodString>;
179
- lastOpenedAt: z.ZodCatch<z.ZodString>;
180
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
181
- /** Per-project cap on concurrently running tasks. Absent = inherit the
182
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
183
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
184
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
185
- maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
186
- }, z.ZodTypeAny, "passthrough">[], unknown>;
187
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
188
- /** Migration cursor (src/workspace/migrations.ts). Absent/bad → 0, which
189
- * means "run every migration" — each one is idempotent, so that is safe. */
190
- schemaVersion: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
191
- /** Root exposed by the Add project folder browser. Environment supplies
192
- * the zero-config default; an explicit workspace value wins thereafter. */
193
- browseRoot: z.ZodCatch<z.ZodDefault<z.ZodString>>;
194
- /** Checkout root for GUI-cloned projects. Stored as written (a literal
195
- * `~` is expanded by the checkout flow, not here); validated writable
196
- * when *changed*, never at load. */
197
- projectsDir: z.ZodCatch<z.ZodDefault<z.ZodString>>;
198
- resources: z.ZodCatch<z.ZodDefault<z.ZodObject<{
199
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
200
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
201
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
202
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
203
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
204
- /** Default worktree retention for projects that don't override it. */
205
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
206
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
207
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
208
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
209
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
210
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
211
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
212
- /** Default worktree retention for projects that don't override it. */
213
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
214
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
215
- /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
216
- maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
217
- /** Per-task memory ceiling in MiB; null = no limit (matches the file's
218
- * literal `"memoryLimitMb": null` in the spec's Data Model). */
219
- memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
220
- /** Default worktree retention for projects that don't override it. */
221
- worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
222
- }, z.ZodTypeAny, "passthrough">>>>;
223
- /** Per-entry salvage: a corrupt entry is dropped, the rest of the registry
224
- * survives (a whole-array `.catch([])` would evict every project over one
225
- * bad row). */
226
- projects: z.ZodEffects<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>>, z.objectOutputType<{
227
- /** Unique slug — URL segment, sidebar key, worktree namespace. */
228
- id: z.ZodString;
229
- /** Absolute, realpath-normalized repo root (normalization is the writer's
230
- * job — `registerProject` in step 1.3; the schema only demands absolute). */
231
- root: z.ZodEffects<z.ZodString, string, string>;
232
- /** Display name (basename by default). `''` = caller derives a fallback. */
233
- name: z.ZodCatch<z.ZodString>;
234
- addedAt: z.ZodCatch<z.ZodString>;
235
- lastOpenedAt: z.ZodCatch<z.ZodString>;
236
- source: z.ZodCatch<z.ZodEnum<["local", "checkout"]>>;
237
- /** Per-project cap on concurrently running tasks. Absent = inherit the
238
- * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
239
- * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
240
- * default, and `.passthrough()` preserves the key across cezar round-trips. */
241
- maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
242
- }, z.ZodTypeAny, "passthrough">[], unknown>;
243
- }, z.ZodTypeAny, "passthrough">>;
51
+ }, z.core.$loose>>>;
52
+ composerDefaults: z.ZodCatch<z.ZodDefault<z.ZodObject<{
53
+ autonomous: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
54
+ worktree: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
55
+ }, z.core.$loose>>>;
56
+ disabledProviders: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<("claude" | "codex" | "opencode")[], unknown[]>>;
57
+ agentDefaults: z.ZodCatch<z.ZodDefault<z.ZodObject<{
58
+ runner: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
59
+ claude: "claude";
60
+ codex: "codex";
61
+ opencode: "opencode";
62
+ }>>>;
63
+ models: z.ZodCatch<z.ZodOptional<z.ZodObject<{
64
+ claude: z.ZodCatch<z.ZodOptional<z.ZodString>>;
65
+ codex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
66
+ opencode: z.ZodCatch<z.ZodOptional<z.ZodString>>;
67
+ }, z.core.$loose>>>;
68
+ }, z.core.$loose>>>;
69
+ projects: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<{
70
+ [x: string]: unknown;
71
+ id: string;
72
+ root: string;
73
+ name: string;
74
+ addedAt: string;
75
+ lastOpenedAt: string;
76
+ source: "checkout" | "local";
77
+ maxParallel?: number | undefined;
78
+ }[], unknown[]>>;
79
+ }, z.core.$loose>;
244
80
  export type WorkspaceConfig = z.infer<typeof workspaceConfigSchema>;
81
+ /** Resolve the auto-update preference without mutating or materializing it. */
82
+ export declare function effectiveSkillsAutoUpdate(config: Pick<WorkspaceConfig, 'skillsAutoUpdate'>, env?: NodeJS.ProcessEnv): boolean;
83
+ export declare function effectiveComposerDefault(stored: boolean | undefined, envValue: string | undefined, fallback: boolean): boolean;
245
84
  /** The in-memory default — what a missing/corrupt file behaves like. */
246
85
  export declare function defaultWorkspaceConfig(): WorkspaceConfig;
86
+ /**
87
+ * The last-known-good copy of a NON-EMPTY registry, written beside the config
88
+ * by every successful merge-write. The registry is cheap to rebuild in theory
89
+ * ("open the project again"), but in practice it is a hand-curated list, and a
90
+ * single bad write — a crash between `writeFileSync` and `rename`, a full
91
+ * disk, a stray process — costs the user every entry. One extra file, no
92
+ * configuration, and `loadWorkspaceConfig` falls back to it.
93
+ *
94
+ * Removing `~/.cezar` still resets cezar completely; removing only
95
+ * `config.json` no longer does, because this snapshot restores it.
96
+ *
97
+ * A cezar older than this change does not refresh the snapshot, so on a machine
98
+ * that alternates between versions it can lag behind the registry — which only
99
+ * shows if the config file is also lost, and the worst case is a project the
100
+ * user unregistered reappearing. Cheap next to losing the whole list.
101
+ */
102
+ export declare function workspaceConfigBackupPath(path?: string): string;
247
103
  /**
248
104
  * Read `~/.cezar/config.json` on demand — never cached, never throws. A
249
105
  * missing file is the zero-config default (silent); an unreadable or
250
106
  * malformed one degrades to the same default with a one-line warning and is
251
107
  * left on disk untouched (the next successful merge-write replaces it).
108
+ *
109
+ * Before degrading, a missing, empty, or corrupt file is restored from the
110
+ * `config.json.bak` snapshot when that still holds projects. The restore is
111
+ * read-only: the recovered registry is handed back in memory and lands on disk
112
+ * again through the next merge-write, so a read never writes. A file that
113
+ * parses and simply has no projects is NOT restored — that is a user who
114
+ * removed their last project, not a lost registry.
115
+ *
116
+ * `path` defaults to the current `workspaceConfigPath()`, but a caller that
117
+ * will also WRITE passes the path it resolved itself — see
118
+ * `mergeWriteWorkspaceConfig` for why resolving it twice is a data-loss bug.
252
119
  */
253
- export declare function loadWorkspaceConfig(): Promise<WorkspaceConfig>;
120
+ export declare function loadWorkspaceConfig(path?: string): Promise<WorkspaceConfig>;
254
121
  /**
255
122
  * The tmp path an atomic write stages through — UNIQUE PER WRITE, never a
256
123
  * fixed `${path}.tmp`. `~/.cezar/` is shared by every cezar process on the
@@ -276,6 +143,15 @@ export declare function atomicWriteJsonSync(path: string, value: unknown): void;
276
143
  * boot). The mutator may mutate its argument in place or return a replacement.
277
144
  * Returns the config that was written. Throws on write failure (e.g. a
278
145
  * read-only home) — degrading is the caller's policy, per house rules.
146
+ *
147
+ * The path is resolved ONCE, before the `await`, and the same value feeds the
148
+ * read and the write. Resolving it twice used to lose the whole registry:
149
+ * `workspaceConfigPath()` re-reads `CEZ_HOME` on every call, so if the variable
150
+ * changed while the read was in flight — a test's `afterEach` dropping its pin
151
+ * after a timeout is the way this happens in practice — the read came from one
152
+ * home and the write landed in another, replacing that file's registry with a
153
+ * config it never held. One resolution keeps a merge-write inside exactly one
154
+ * file, whatever the environment does mid-flight.
279
155
  */
280
156
  export declare function mergeWriteWorkspaceConfig(mutator: (config: WorkspaceConfig) => WorkspaceConfig | void): Promise<WorkspaceConfig>;
281
157
  export {};
@@ -3,7 +3,8 @@ import { chmodSync, mkdirSync, renameSync, writeFileSync } from 'node:fs';
3
3
  import { readFile } from 'node:fs/promises';
4
4
  import { dirname } from 'node:path';
5
5
  import { z } from 'zod';
6
- import { workspaceConfigPath } from '../paths.js';
6
+ import { PROVIDER_IDS } from '../core/provider-auth.js';
7
+ import { assertCezarHomeWriteIsSandboxed, workspaceConfigPath } from '../paths.js';
7
8
  /**
8
9
  * `~/.cezar/config.json` — the per-user workspace config + project registry
9
10
  * (spec 2026-07-20-multi-project-workspace). House rules from the spec's Data
@@ -50,6 +51,18 @@ const resourcesSchema = z
50
51
  .object({
51
52
  /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
52
53
  maxParallel: z.number().int().min(1).max(16).default(2).catch(2),
54
+ /** Extra durable `CEZ:MONITORING` sessions exempt from the active-task cap. */
55
+ maxMonitoringSessions: z.number().int().min(0).max(16).default(2).catch(2),
56
+ /** Optional cadence for re-checking monitored work; null parks at zero model cost. */
57
+ monitoringWakeIntervalMinutes: z.number().int().min(1).max(60).nullable().default(null).catch(null),
58
+ /**
59
+ * Resume a task the provider's usage limit stopped, once that limit resets
60
+ * (spec 2026-08-03-auto-resume-after-usage-limit). ON by default, which is the one
61
+ * cost-bearing automation in this file that is: it spends nothing while it waits, and it
62
+ * finishes the work the user already asked for rather than starting any of its own. Switching
63
+ * it off leaves the run `failed` with its Continue button, exactly as before the feature.
64
+ */
65
+ autoResumeOnUsageLimit: z.boolean().default(true).catch(true),
53
66
  /** Per-task memory ceiling in MiB; null = no limit (matches the file's
54
67
  * literal `"memoryLimitMb": null` in the spec's Data Model). */
55
68
  memoryLimitMb: z.number().int().min(0).max(1_048_576).nullable().default(null).catch(null),
@@ -57,10 +70,55 @@ const resourcesSchema = z
57
70
  worktreeRetentionDefault: z.number().int().min(0).max(1000).default(10).catch(10),
58
71
  })
59
72
  .passthrough();
73
+ const composerDefaultsSchema = z
74
+ .object({
75
+ autonomous: z.boolean().optional().catch(undefined),
76
+ worktree: z.boolean().optional().catch(undefined),
77
+ })
78
+ .passthrough();
79
+ /**
80
+ * What a repo that has said nothing runs (spec 2026-07-29-agent-profiles).
81
+ *
82
+ * The point is not to configure every checkout: a repo's own `.ai/cezar/config.json` still wins
83
+ * key by key, and this is only consulted where that file is SILENT. Which is why every key here is
84
+ * optional with no default — an absent `runner` has to stay distinguishable from one someone chose,
85
+ * or "fall back to the machine default" collapses into "always claude".
86
+ *
87
+ * Personal and per-machine, like everything else in this file. The repo config is the team's; this
88
+ * is yours.
89
+ */
90
+ const agentDefaultsSchema = z
91
+ .object({
92
+ runner: z.enum(PROVIDER_IDS).optional().catch(undefined),
93
+ models: z
94
+ .object({
95
+ claude: z.string().trim().min(1).max(200).optional().catch(undefined),
96
+ codex: z.string().trim().min(1).max(200).optional().catch(undefined),
97
+ opencode: z.string().trim().min(1).max(200).optional().catch(undefined),
98
+ })
99
+ .passthrough()
100
+ .optional()
101
+ .catch(undefined),
102
+ })
103
+ .passthrough();
60
104
  const workspacePathSchema = (envName, fallback) => {
61
105
  const defaultValue = () => process.env[envName]?.trim() || fallback;
62
106
  return z.string().min(1).max(4096).default(defaultValue).catch(defaultValue);
63
107
  };
108
+ const providerIdSet = new Set(PROVIDER_IDS);
109
+ const disabledProvidersSchema = z
110
+ .array(z.unknown())
111
+ .default(() => [])
112
+ .catch(() => [])
113
+ .transform((values) => {
114
+ const seen = new Set();
115
+ for (const value of values) {
116
+ if (typeof value !== 'string' || !providerIdSet.has(value))
117
+ continue;
118
+ seen.add(value);
119
+ }
120
+ return PROVIDER_IDS.filter((provider) => seen.has(provider));
121
+ });
64
122
  const workspaceConfigSchema = z
65
123
  .object({
66
124
  /** Migration cursor (src/workspace/migrations.ts). Absent/bad → 0, which
@@ -73,9 +131,21 @@ const workspaceConfigSchema = z
73
131
  * `~` is expanded by the checkout flow, not here); validated writable
74
132
  * when *changed*, never at load. */
75
133
  projectsDir: workspacePathSchema('CEZ_PROJECTS_DIR', '~/cezar/projects'),
134
+ /** Optional auto-update override. Absence inherits the environment/default
135
+ * and must stay absent on unrelated merge-writes. */
136
+ skillsAutoUpdate: z.boolean().optional().catch(undefined),
137
+ /** Global opt-in model policy. The native coding-agent model becomes
138
+ * authoritative while runner choice remains available. */
139
+ modelsLocked: z.boolean().optional().catch(undefined),
76
140
  // Function-form default/catch: mutators (step 1.3's registerProject) edit
77
141
  // these objects in place, so parses must never share one reference.
78
- resources: resourcesSchema.default(() => ({})).catch(() => resourcesSchema.parse({})),
142
+ resources: resourcesSchema.prefault(() => ({})).catch(() => resourcesSchema.parse({})),
143
+ /** Optional New Task policy. Missing keys inherit exact 0/1 environment seeds. */
144
+ composerDefaults: composerDefaultsSchema.default(() => ({})).catch(() => ({})),
145
+ /** Host-wide provider preferences; absent means every provider is enabled. */
146
+ disabledProviders: disabledProvidersSchema,
147
+ /** Machine-wide agent/model defaults for repos that set none of their own. */
148
+ agentDefaults: agentDefaultsSchema.default(() => ({})).catch(() => ({})),
79
149
  /** Per-entry salvage: a corrupt entry is dropped, the rest of the registry
80
150
  * survives (a whole-array `.catch([])` would evict every project over one
81
151
  * bad row). */
@@ -89,33 +159,108 @@ const workspaceConfigSchema = z
89
159
  })),
90
160
  })
91
161
  .passthrough();
162
+ /** Resolve the auto-update preference without mutating or materializing it. */
163
+ export function effectiveSkillsAutoUpdate(config, env = process.env) {
164
+ if (config.skillsAutoUpdate !== undefined)
165
+ return config.skillsAutoUpdate;
166
+ if (env.CEZ_SKILLS_AUTO_UPDATE === '0')
167
+ return false;
168
+ if (env.CEZ_SKILLS_AUTO_UPDATE === '1')
169
+ return true;
170
+ return true;
171
+ }
172
+ export function effectiveComposerDefault(stored, envValue, fallback) {
173
+ if (stored !== undefined)
174
+ return stored;
175
+ if (envValue === '0')
176
+ return false;
177
+ if (envValue === '1')
178
+ return true;
179
+ return fallback;
180
+ }
92
181
  /** The in-memory default — what a missing/corrupt file behaves like. */
93
182
  export function defaultWorkspaceConfig() {
94
183
  return workspaceConfigSchema.parse({});
95
184
  }
185
+ /**
186
+ * The last-known-good copy of a NON-EMPTY registry, written beside the config
187
+ * by every successful merge-write. The registry is cheap to rebuild in theory
188
+ * ("open the project again"), but in practice it is a hand-curated list, and a
189
+ * single bad write — a crash between `writeFileSync` and `rename`, a full
190
+ * disk, a stray process — costs the user every entry. One extra file, no
191
+ * configuration, and `loadWorkspaceConfig` falls back to it.
192
+ *
193
+ * Removing `~/.cezar` still resets cezar completely; removing only
194
+ * `config.json` no longer does, because this snapshot restores it.
195
+ *
196
+ * A cezar older than this change does not refresh the snapshot, so on a machine
197
+ * that alternates between versions it can lag behind the registry — which only
198
+ * shows if the config file is also lost, and the worst case is a project the
199
+ * user unregistered reappearing. Cheap next to losing the whole list.
200
+ */
201
+ export function workspaceConfigBackupPath(path = workspaceConfigPath()) {
202
+ return `${path}.bak`;
203
+ }
204
+ function parseWorkspaceConfig(raw) {
205
+ try {
206
+ const parsed = workspaceConfigSchema.safeParse(JSON.parse(raw));
207
+ return parsed.success ? parsed.data : null;
208
+ }
209
+ catch {
210
+ return null;
211
+ }
212
+ }
213
+ /** The snapshot is only worth restoring while it still holds projects — an
214
+ * empty one carries no information the defaults do not already have. */
215
+ async function loadWorkspaceConfigBackup(path) {
216
+ let raw;
217
+ try {
218
+ raw = await readFile(workspaceConfigBackupPath(path), 'utf8');
219
+ }
220
+ catch {
221
+ return null;
222
+ }
223
+ const parsed = parseWorkspaceConfig(raw);
224
+ return parsed && parsed.projects.length > 0 ? parsed : null;
225
+ }
96
226
  /**
97
227
  * Read `~/.cezar/config.json` on demand — never cached, never throws. A
98
228
  * missing file is the zero-config default (silent); an unreadable or
99
229
  * malformed one degrades to the same default with a one-line warning and is
100
230
  * left on disk untouched (the next successful merge-write replaces it).
231
+ *
232
+ * Before degrading, a missing, empty, or corrupt file is restored from the
233
+ * `config.json.bak` snapshot when that still holds projects. The restore is
234
+ * read-only: the recovered registry is handed back in memory and lands on disk
235
+ * again through the next merge-write, so a read never writes. A file that
236
+ * parses and simply has no projects is NOT restored — that is a user who
237
+ * removed their last project, not a lost registry.
238
+ *
239
+ * `path` defaults to the current `workspaceConfigPath()`, but a caller that
240
+ * will also WRITE passes the path it resolved itself — see
241
+ * `mergeWriteWorkspaceConfig` for why resolving it twice is a data-loss bug.
101
242
  */
102
- export async function loadWorkspaceConfig() {
103
- const path = workspaceConfigPath();
104
- let raw;
243
+ export async function loadWorkspaceConfig(path = workspaceConfigPath()) {
244
+ let raw = null;
105
245
  try {
106
246
  raw = await readFile(path, 'utf8');
107
247
  }
108
248
  catch {
109
- return defaultWorkspaceConfig();
249
+ // missing/unreadable — the backup below is the next chance
110
250
  }
111
- try {
112
- const parsed = workspaceConfigSchema.safeParse(JSON.parse(raw));
113
- if (parsed.success)
114
- return parsed.data;
251
+ if (raw !== null && raw.trim() !== '') {
252
+ const parsed = parseWorkspaceConfig(raw);
253
+ if (parsed)
254
+ return parsed;
115
255
  }
116
- catch {
117
- // malformed JSON — fall through to the warning + defaults
256
+ const restored = await loadWorkspaceConfigBackup(path);
257
+ if (restored) {
258
+ const cause = raw === null ? 'is missing' : 'is empty or corrupt';
259
+ console.warn(`[cez] workspace config ${path} ${cause} — restored ${restored.projects.length} project(s) from ${workspaceConfigBackupPath(path)}`);
260
+ return restored;
118
261
  }
262
+ if (raw === null)
263
+ return defaultWorkspaceConfig();
119
264
  console.warn(`[cez] workspace config ${path} is corrupt — using defaults (registry rebuilds)`);
120
265
  return defaultWorkspaceConfig();
121
266
  }
@@ -137,6 +282,7 @@ export function atomicTmpPath(path) {
137
282
  * shared by the workspace config and ui-state writers. Throws on write
138
283
  * failure (e.g. a read-only home) — degrading is the caller's policy. */
139
284
  export function atomicWriteJsonSync(path, value) {
285
+ assertCezarHomeWriteIsSandboxed(path);
140
286
  mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
141
287
  const tmp = atomicTmpPath(path);
142
288
  writeFileSync(tmp, `${JSON.stringify(value, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
@@ -157,11 +303,34 @@ export function atomicWriteJsonSync(path, value) {
157
303
  * boot). The mutator may mutate its argument in place or return a replacement.
158
304
  * Returns the config that was written. Throws on write failure (e.g. a
159
305
  * read-only home) — degrading is the caller's policy, per house rules.
306
+ *
307
+ * The path is resolved ONCE, before the `await`, and the same value feeds the
308
+ * read and the write. Resolving it twice used to lose the whole registry:
309
+ * `workspaceConfigPath()` re-reads `CEZ_HOME` on every call, so if the variable
310
+ * changed while the read was in flight — a test's `afterEach` dropping its pin
311
+ * after a timeout is the way this happens in practice — the read came from one
312
+ * home and the write landed in another, replacing that file's registry with a
313
+ * config it never held. One resolution keeps a merge-write inside exactly one
314
+ * file, whatever the environment does mid-flight.
160
315
  */
161
316
  export async function mergeWriteWorkspaceConfig(mutator) {
162
- const current = await loadWorkspaceConfig();
317
+ const path = workspaceConfigPath();
318
+ const current = await loadWorkspaceConfig(path);
163
319
  const next = mutator(current) ?? current;
164
- atomicWriteJsonSync(workspaceConfigPath(), next);
320
+ atomicWriteJsonSync(path, next);
321
+ // Refresh the snapshot after EVERY successful write, including an emptied
322
+ // registry (#731). Skipping the empty case left a stale non-empty backup:
323
+ // removing the last project, then losing config.json, resurrected the project
324
+ // the user had deliberately unregistered. An empty snapshot is not restored on
325
+ // load (see loadWorkspaceConfigBackup), so recovery now settles on the empty
326
+ // registry the user intended rather than the old projects.
327
+ try {
328
+ atomicWriteJsonSync(workspaceConfigBackupPath(path), next);
329
+ }
330
+ catch {
331
+ // Best-effort: the registry itself is already safely on disk, and a
332
+ // failed snapshot must never turn a successful write into an error.
333
+ }
165
334
  return next;
166
335
  }
167
336
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/workspace/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAEzD;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,kEAAkE;IAClE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;IACnC;kFAC8E;IAC9E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC3F,4EAA4E;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC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AAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,0EAA0E;IAC1E,0EAA0E;IAC1E,8EAA8E;IAC9E,+EAA+E;IAC/E,6EAA6E;IAC7E,2DAA2D;IAC3D,IAAI,CAAC;QACH,mBAAmB,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,oEAAoE;QACpE,oEAAoE;IACtE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,4 +1,4 @@
1
- export { mergeWriteWorkspaceUiState } from './ui-state.js';
1
+ export { mergeWriteWorkspaceUiState } from './ui-state.ts';
2
2
  /**
3
3
  * Workspace config migrations (spec 2026-07-20-multi-project-workspace,
4
4
  * "Migrations"). Deliberately tiny and **config-files-only** — run state