@wjarka/cezarion 0.10.0-pr30.54

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 (478) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +838 -0
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +72 -0
  7. package/dist/agent-config/catalog.js +223 -0
  8. package/dist/agent-config/catalog.js.map +1 -0
  9. package/dist/agent-config/files.d.ts +46 -0
  10. package/dist/agent-config/files.js +119 -0
  11. package/dist/agent-config/files.js.map +1 -0
  12. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  13. package/dist/agent-config/model-settings/claude.js +11 -0
  14. package/dist/agent-config/model-settings/claude.js.map +1 -0
  15. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  16. package/dist/agent-config/model-settings/codex.js +16 -0
  17. package/dist/agent-config/model-settings/codex.js.map +1 -0
  18. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  19. package/dist/agent-config/model-settings/opencode.js +8 -0
  20. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  21. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  22. package/dist/agent-config/model-settings/pi.js +18 -0
  23. package/dist/agent-config/model-settings/pi.js.map +1 -0
  24. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  25. package/dist/agent-config/model-settings/shared.js +93 -0
  26. package/dist/agent-config/model-settings/shared.js.map +1 -0
  27. package/dist/agent-config/model-settings/types.d.ts +9 -0
  28. package/dist/agent-config/model-settings/types.js +2 -0
  29. package/dist/agent-config/model-settings/types.js.map +1 -0
  30. package/dist/agent-config/models.d.ts +9 -0
  31. package/dist/agent-config/models.js +32 -0
  32. package/dist/agent-config/models.js.map +1 -0
  33. package/dist/agent-config/seed.d.ts +7 -0
  34. package/dist/agent-config/seed.js +90 -0
  35. package/dist/agent-config/seed.js.map +1 -0
  36. package/dist/agent-config/service.d.ts +44 -0
  37. package/dist/agent-config/service.js +71 -0
  38. package/dist/agent-config/service.js.map +1 -0
  39. package/dist/agent-config/validate.d.ts +21 -0
  40. package/dist/agent-config/validate.js +76 -0
  41. package/dist/agent-config/validate.js.map +1 -0
  42. package/dist/automations/coordinator.d.ts +26 -0
  43. package/dist/automations/coordinator.js +66 -0
  44. package/dist/automations/coordinator.js.map +1 -0
  45. package/dist/automations/github-poller.d.ts +74 -0
  46. package/dist/automations/github-poller.js +234 -0
  47. package/dist/automations/github-poller.js.map +1 -0
  48. package/dist/automations/scheduler.d.ts +42 -0
  49. package/dist/automations/scheduler.js +192 -0
  50. package/dist/automations/scheduler.js.map +1 -0
  51. package/dist/automations/store.d.ts +65 -0
  52. package/dist/automations/store.js +298 -0
  53. package/dist/automations/store.js.map +1 -0
  54. package/dist/automations/task-template.d.ts +18 -0
  55. package/dist/automations/task-template.js +95 -0
  56. package/dist/automations/task-template.js.map +1 -0
  57. package/dist/automations/types.d.ts +255 -0
  58. package/dist/automations/types.js +159 -0
  59. package/dist/automations/types.js.map +1 -0
  60. package/dist/config.d.ts +77 -0
  61. package/dist/config.js +242 -0
  62. package/dist/config.js.map +1 -0
  63. package/dist/contract/agent-config.d.ts +153 -0
  64. package/dist/contract/agent-profiles.d.ts +347 -0
  65. package/dist/contract/automations.d.ts +935 -0
  66. package/dist/contract/events.d.ts +104 -0
  67. package/dist/contract/github.d.ts +556 -0
  68. package/dist/contract/health.d.ts +102 -0
  69. package/dist/contract/index.d.ts +16 -0
  70. package/dist/contract/index.js +1895 -0
  71. package/dist/contract/projects.d.ts +210 -0
  72. package/dist/contract/repo.d.ts +234 -0
  73. package/dist/contract/runs.d.ts +1473 -0
  74. package/dist/contract/skills.d.ts +232 -0
  75. package/dist/contract/workflows.d.ts +218 -0
  76. package/dist/contract/workspace.d.ts +579 -0
  77. package/dist/core/agent-env.d.ts +31 -0
  78. package/dist/core/agent-env.js +371 -0
  79. package/dist/core/agent-env.js.map +1 -0
  80. package/dist/core/agent-model-policy.d.ts +10 -0
  81. package/dist/core/agent-model-policy.js +36 -0
  82. package/dist/core/agent-model-policy.js.map +1 -0
  83. package/dist/core/agent-profiles.d.ts +62 -0
  84. package/dist/core/agent-profiles.js +90 -0
  85. package/dist/core/agent-profiles.js.map +1 -0
  86. package/dist/core/agent-runner.d.ts +211 -0
  87. package/dist/core/agent-runner.js +68 -0
  88. package/dist/core/agent-runner.js.map +1 -0
  89. package/dist/core/ask.d.ts +105 -0
  90. package/dist/core/ask.js +187 -0
  91. package/dist/core/ask.js.map +1 -0
  92. package/dist/core/backend-detect.d.ts +16 -0
  93. package/dist/core/backend-detect.js +155 -0
  94. package/dist/core/backend-detect.js.map +1 -0
  95. package/dist/core/claude-cli-runner.d.ts +59 -0
  96. package/dist/core/claude-cli-runner.js +483 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-ui-mapper.d.ts +80 -0
  99. package/dist/core/claude-ui-mapper.js +598 -0
  100. package/dist/core/claude-ui-mapper.js.map +1 -0
  101. package/dist/core/codex-app-server-runner.d.ts +41 -0
  102. package/dist/core/codex-app-server-runner.js +584 -0
  103. package/dist/core/codex-app-server-runner.js.map +1 -0
  104. package/dist/core/codex-app-server-transport.d.ts +35 -0
  105. package/dist/core/codex-app-server-transport.js +150 -0
  106. package/dist/core/codex-app-server-transport.js.map +1 -0
  107. package/dist/core/codex-model-catalog.d.ts +10 -0
  108. package/dist/core/codex-model-catalog.js +110 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -0
  110. package/dist/core/codex-ui-mapper.d.ts +112 -0
  111. package/dist/core/codex-ui-mapper.js +766 -0
  112. package/dist/core/codex-ui-mapper.js.map +1 -0
  113. package/dist/core/model-identity.d.ts +125 -0
  114. package/dist/core/model-identity.js +132 -0
  115. package/dist/core/model-identity.js.map +1 -0
  116. package/dist/core/model-presets.d.ts +21 -0
  117. package/dist/core/model-presets.js +81 -0
  118. package/dist/core/model-presets.js.map +1 -0
  119. package/dist/core/ndjson.d.ts +6 -0
  120. package/dist/core/ndjson.js +23 -0
  121. package/dist/core/ndjson.js.map +1 -0
  122. package/dist/core/opencode-model-catalog.d.ts +32 -0
  123. package/dist/core/opencode-model-catalog.js +153 -0
  124. package/dist/core/opencode-model-catalog.js.map +1 -0
  125. package/dist/core/opencode-server-runner.d.ts +32 -0
  126. package/dist/core/opencode-server-runner.js +882 -0
  127. package/dist/core/opencode-server-runner.js.map +1 -0
  128. package/dist/core/opencode-ui-mapper.d.ts +137 -0
  129. package/dist/core/opencode-ui-mapper.js +800 -0
  130. package/dist/core/opencode-ui-mapper.js.map +1 -0
  131. package/dist/core/pi-model-catalog.d.ts +31 -0
  132. package/dist/core/pi-model-catalog.js +152 -0
  133. package/dist/core/pi-model-catalog.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +403 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +36 -0
  138. package/dist/core/pi-ui-mapper.js +304 -0
  139. package/dist/core/pi-ui-mapper.js.map +1 -0
  140. package/dist/core/process-usage.d.ts +66 -0
  141. package/dist/core/process-usage.js +193 -0
  142. package/dist/core/process-usage.js.map +1 -0
  143. package/dist/core/provider-auth.d.ts +154 -0
  144. package/dist/core/provider-auth.js +509 -0
  145. package/dist/core/provider-auth.js.map +1 -0
  146. package/dist/core/provider-availability.d.ts +3 -0
  147. package/dist/core/provider-availability.js +14 -0
  148. package/dist/core/provider-availability.js.map +1 -0
  149. package/dist/core/runner-factory.d.ts +8 -0
  150. package/dist/core/runner-factory.js +25 -0
  151. package/dist/core/runner-factory.js.map +1 -0
  152. package/dist/core/runner-model-catalog.d.ts +29 -0
  153. package/dist/core/runner-model-catalog.js +78 -0
  154. package/dist/core/runner-model-catalog.js.map +1 -0
  155. package/dist/core/secret-redaction.d.ts +37 -0
  156. package/dist/core/secret-redaction.js +115 -0
  157. package/dist/core/secret-redaction.js.map +1 -0
  158. package/dist/core/shell-env.d.ts +28 -0
  159. package/dist/core/shell-env.js +56 -0
  160. package/dist/core/shell-env.js.map +1 -0
  161. package/dist/core/tool-display.d.ts +31 -0
  162. package/dist/core/tool-display.js +179 -0
  163. package/dist/core/tool-display.js.map +1 -0
  164. package/dist/core/ui-events.d.ts +335 -0
  165. package/dist/core/ui-events.js +25 -0
  166. package/dist/core/ui-events.js.map +1 -0
  167. package/dist/core/usage-limit.d.ts +42 -0
  168. package/dist/core/usage-limit.js +209 -0
  169. package/dist/core/usage-limit.js.map +1 -0
  170. package/dist/core/usage.d.ts +11 -0
  171. package/dist/core/usage.js +15 -0
  172. package/dist/core/usage.js.map +1 -0
  173. package/dist/core/v1-text-coalescer.d.ts +36 -0
  174. package/dist/core/v1-text-coalescer.js +72 -0
  175. package/dist/core/v1-text-coalescer.js.map +1 -0
  176. package/dist/git-diff-base.d.ts +85 -0
  177. package/dist/git-diff-base.js +180 -0
  178. package/dist/git-diff-base.js.map +1 -0
  179. package/dist/git-refs.d.ts +11 -0
  180. package/dist/git-refs.js +14 -0
  181. package/dist/git-refs.js.map +1 -0
  182. package/dist/git-worktree.d.ts +161 -0
  183. package/dist/git-worktree.js +508 -0
  184. package/dist/git-worktree.js.map +1 -0
  185. package/dist/handoff.d.ts +62 -0
  186. package/dist/handoff.js +154 -0
  187. package/dist/handoff.js.map +1 -0
  188. package/dist/index.d.ts +2 -0
  189. package/dist/index.js +680 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/install-as-command.d.ts +40 -0
  192. package/dist/install-as-command.js +52 -0
  193. package/dist/install-as-command.js.map +1 -0
  194. package/dist/pack-check.d.ts +17 -0
  195. package/dist/pack-check.js +27 -0
  196. package/dist/pack-check.js.map +1 -0
  197. package/dist/paths.d.ts +140 -0
  198. package/dist/paths.js +192 -0
  199. package/dist/paths.js.map +1 -0
  200. package/dist/planner.d.ts +27 -0
  201. package/dist/planner.js +268 -0
  202. package/dist/planner.js.map +1 -0
  203. package/dist/release/manifests.d.ts +81 -0
  204. package/dist/release/manifests.js +74 -0
  205. package/dist/release/manifests.js.map +1 -0
  206. package/dist/release/snapshot.d.ts +67 -0
  207. package/dist/release/snapshot.js +97 -0
  208. package/dist/release/snapshot.js.map +1 -0
  209. package/dist/release/stable.d.ts +38 -0
  210. package/dist/release/stable.js +55 -0
  211. package/dist/release/stable.js.map +1 -0
  212. package/dist/runs/agent-tmpdir.d.ts +41 -0
  213. package/dist/runs/agent-tmpdir.js +183 -0
  214. package/dist/runs/agent-tmpdir.js.map +1 -0
  215. package/dist/runs/auto-name.d.ts +75 -0
  216. package/dist/runs/auto-name.js +179 -0
  217. package/dist/runs/auto-name.js.map +1 -0
  218. package/dist/runs/event-history.d.ts +50 -0
  219. package/dist/runs/event-history.js +613 -0
  220. package/dist/runs/event-history.js.map +1 -0
  221. package/dist/runs/retention.d.ts +60 -0
  222. package/dist/runs/retention.js +86 -0
  223. package/dist/runs/retention.js.map +1 -0
  224. package/dist/runs/review-gate.d.ts +18 -0
  225. package/dist/runs/review-gate.js +21 -0
  226. package/dist/runs/review-gate.js.map +1 -0
  227. package/dist/runs/run-index.d.ts +19 -0
  228. package/dist/runs/run-index.js +43 -0
  229. package/dist/runs/run-index.js.map +1 -0
  230. package/dist/runs/store.d.ts +446 -0
  231. package/dist/runs/store.js +1118 -0
  232. package/dist/runs/store.js.map +1 -0
  233. package/dist/runs/task-markers.d.ts +28 -0
  234. package/dist/runs/task-markers.js +74 -0
  235. package/dist/runs/task-markers.js.map +1 -0
  236. package/dist/runs/task-refs.d.ts +25 -0
  237. package/dist/runs/task-refs.js +74 -0
  238. package/dist/runs/task-refs.js.map +1 -0
  239. package/dist/runs/ui-event-sink.d.ts +81 -0
  240. package/dist/runs/ui-event-sink.js +210 -0
  241. package/dist/runs/ui-event-sink.js.map +1 -0
  242. package/dist/server/app-type.d.ts +21 -0
  243. package/dist/server/app-type.js +2 -0
  244. package/dist/server/app-type.js.map +1 -0
  245. package/dist/server/capabilities.d.ts +70 -0
  246. package/dist/server/capabilities.js +152 -0
  247. package/dist/server/capabilities.js.map +1 -0
  248. package/dist/server/checkout.d.ts +128 -0
  249. package/dist/server/checkout.js +296 -0
  250. package/dist/server/checkout.js.map +1 -0
  251. package/dist/server/forge/github.d.ts +513 -0
  252. package/dist/server/forge/github.js +2364 -0
  253. package/dist/server/forge/github.js.map +1 -0
  254. package/dist/server/forge/index.d.ts +40 -0
  255. package/dist/server/forge/index.js +72 -0
  256. package/dist/server/forge/index.js.map +1 -0
  257. package/dist/server/forge/types.d.ts +242 -0
  258. package/dist/server/forge/types.js +2 -0
  259. package/dist/server/forge/types.js.map +1 -0
  260. package/dist/server/fs-browse.d.ts +105 -0
  261. package/dist/server/fs-browse.js +182 -0
  262. package/dist/server/fs-browse.js.map +1 -0
  263. package/dist/server/git-changes.d.ts +213 -0
  264. package/dist/server/git-changes.js +555 -0
  265. package/dist/server/git-changes.js.map +1 -0
  266. package/dist/server/git.d.ts +28 -0
  267. package/dist/server/git.js +112 -0
  268. package/dist/server/git.js.map +1 -0
  269. package/dist/server/github.d.ts +9 -0
  270. package/dist/server/github.js +8 -0
  271. package/dist/server/github.js.map +1 -0
  272. package/dist/server/launch-key.d.ts +7 -0
  273. package/dist/server/launch-key.js +33 -0
  274. package/dist/server/launch-key.js.map +1 -0
  275. package/dist/server/open-in-app.d.ts +66 -0
  276. package/dist/server/open-in-app.js +211 -0
  277. package/dist/server/open-in-app.js.map +1 -0
  278. package/dist/server/open-in-terminal.d.ts +70 -0
  279. package/dist/server/open-in-terminal.js +179 -0
  280. package/dist/server/open-in-terminal.js.map +1 -0
  281. package/dist/server/pr.d.ts +7 -0
  282. package/dist/server/pr.js +7 -0
  283. package/dist/server/pr.js.map +1 -0
  284. package/dist/server/project-context.d.ts +120 -0
  285. package/dist/server/project-context.js +182 -0
  286. package/dist/server/project-context.js.map +1 -0
  287. package/dist/server/provider-action-gate.d.ts +8 -0
  288. package/dist/server/provider-action-gate.js +56 -0
  289. package/dist/server/provider-action-gate.js.map +1 -0
  290. package/dist/server/provider-auth-runtime.d.ts +21 -0
  291. package/dist/server/provider-auth-runtime.js +66 -0
  292. package/dist/server/provider-auth-runtime.js.map +1 -0
  293. package/dist/server/server.d.ts +13138 -0
  294. package/dist/server/server.js +5263 -0
  295. package/dist/server/server.js.map +1 -0
  296. package/dist/server/static-ui.d.ts +49 -0
  297. package/dist/server/static-ui.js +92 -0
  298. package/dist/server/static-ui.js.map +1 -0
  299. package/dist/server/validators.d.ts +97 -0
  300. package/dist/server/validators.js +86 -0
  301. package/dist/server/validators.js.map +1 -0
  302. package/dist/server/ws.d.ts +85 -0
  303. package/dist/server/ws.js +218 -0
  304. package/dist/server/ws.js.map +1 -0
  305. package/dist/server/wsl.d.ts +25 -0
  306. package/dist/server/wsl.js +92 -0
  307. package/dist/server/wsl.js.map +1 -0
  308. package/dist/server-install/engine.d.ts +50 -0
  309. package/dist/server-install/engine.js +324 -0
  310. package/dist/server-install/engine.js.map +1 -0
  311. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  312. package/dist/server-install/platforms/macosx-ngrok.js +345 -0
  313. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  314. package/dist/server-install/platforms/ubuntu-vps.d.ts +78 -0
  315. package/dist/server-install/platforms/ubuntu-vps.js +1016 -0
  316. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  317. package/dist/server-install/state.d.ts +52 -0
  318. package/dist/server-install/state.js +182 -0
  319. package/dist/server-install/state.js.map +1 -0
  320. package/dist/server-install/steps.d.ts +109 -0
  321. package/dist/server-install/steps.js +334 -0
  322. package/dist/server-install/steps.js.map +1 -0
  323. package/dist/server-install/strategies.d.ts +4 -0
  324. package/dist/server-install/strategies.js +20 -0
  325. package/dist/server-install/strategies.js.map +1 -0
  326. package/dist/server-install/types.d.ts +287 -0
  327. package/dist/server-install/types.js +121 -0
  328. package/dist/server-install/types.js.map +1 -0
  329. package/dist/server-install/ui.d.ts +42 -0
  330. package/dist/server-install/ui.js +130 -0
  331. package/dist/server-install/ui.js.map +1 -0
  332. package/dist/skills-banner.d.ts +22 -0
  333. package/dist/skills-banner.js +41 -0
  334. package/dist/skills-banner.js.map +1 -0
  335. package/dist/skills-remote.d.ts +84 -0
  336. package/dist/skills-remote.js +468 -0
  337. package/dist/skills-remote.js.map +1 -0
  338. package/dist/skills-update.d.ts +88 -0
  339. package/dist/skills-update.js +392 -0
  340. package/dist/skills-update.js.map +1 -0
  341. package/dist/skills.d.ts +82 -0
  342. package/dist/skills.js +251 -0
  343. package/dist/skills.js.map +1 -0
  344. package/dist/todos.d.ts +48 -0
  345. package/dist/todos.js +201 -0
  346. package/dist/todos.js.map +1 -0
  347. package/dist/ui-state.d.ts +26 -0
  348. package/dist/ui-state.js +38 -0
  349. package/dist/ui-state.js.map +1 -0
  350. package/dist/update-check.d.ts +12 -0
  351. package/dist/update-check.js +41 -0
  352. package/dist/update-check.js.map +1 -0
  353. package/dist/workflows/load.d.ts +15 -0
  354. package/dist/workflows/load.js +56 -0
  355. package/dist/workflows/load.js.map +1 -0
  356. package/dist/workflows/run.d.ts +758 -0
  357. package/dist/workflows/run.js +3389 -0
  358. package/dist/workflows/run.js.map +1 -0
  359. package/dist/workflows/types.d.ts +153 -0
  360. package/dist/workflows/types.js +212 -0
  361. package/dist/workflows/types.js.map +1 -0
  362. package/dist/workspace/agent-accounts.d.ts +153 -0
  363. package/dist/workspace/agent-accounts.js +304 -0
  364. package/dist/workspace/agent-accounts.js.map +1 -0
  365. package/dist/workspace/agent-profiles.d.ts +78 -0
  366. package/dist/workspace/agent-profiles.js +115 -0
  367. package/dist/workspace/agent-profiles.js.map +1 -0
  368. package/dist/workspace/config.d.ts +169 -0
  369. package/dist/workspace/config.js +379 -0
  370. package/dist/workspace/config.js.map +1 -0
  371. package/dist/workspace/migrations.d.ts +45 -0
  372. package/dist/workspace/migrations.js +147 -0
  373. package/dist/workspace/migrations.js.map +1 -0
  374. package/dist/workspace/projects-cli.d.ts +25 -0
  375. package/dist/workspace/projects-cli.js +172 -0
  376. package/dist/workspace/projects-cli.js.map +1 -0
  377. package/dist/workspace/projects.d.ts +109 -0
  378. package/dist/workspace/projects.js +250 -0
  379. package/dist/workspace/projects.js.map +1 -0
  380. package/dist/workspace/semaphore.d.ts +179 -0
  381. package/dist/workspace/semaphore.js +195 -0
  382. package/dist/workspace/semaphore.js.map +1 -0
  383. package/dist/workspace/ui-state.d.ts +34 -0
  384. package/dist/workspace/ui-state.js +53 -0
  385. package/dist/workspace/ui-state.js.map +1 -0
  386. package/package.json +70 -0
  387. package/scripts/check-pack.mjs +46 -0
  388. package/scripts/inline-contract.mjs +112 -0
  389. package/scripts/install-as-command.mjs +120 -0
  390. package/scripts/mock-claude.mjs +520 -0
  391. package/scripts/mock-pi-rpc.mjs +83 -0
  392. package/scripts/sync-readme.mjs +20 -0
  393. package/scripts/test-process-usage.mjs +47 -0
  394. package/web/dist/assets/alert-dialog-B4Ofsgv7.js +1 -0
  395. package/web/dist/assets/arrow-down-Dy8dup7j.js +1 -0
  396. package/web/dist/assets/arrow-left-BJaucbhn.js +1 -0
  397. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  398. package/web/dist/assets/centered-state-duPW0phQ.js +43 -0
  399. package/web/dist/assets/chevron-right-Be4A5TCS.js +1 -0
  400. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  401. package/web/dist/assets/collapsible-DdcNBdSk.js +1 -0
  402. package/web/dist/assets/commit-list-CgvN9vec.js +1 -0
  403. package/web/dist/assets/compare-variants-CQA2nd65.js +1 -0
  404. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  405. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  406. package/web/dist/assets/diff-B6Agp5Hl.js +3 -0
  407. package/web/dist/assets/diff-stat-BoXuGkgq.js +1 -0
  408. package/web/dist/assets/diff-view-CD8XI-fj.js +6 -0
  409. package/web/dist/assets/diff-woXpYk--.js +1 -0
  410. package/web/dist/assets/dropdown-menu-B3SYw-k5.js +1 -0
  411. package/web/dist/assets/editable-title-B-hjp5wl.js +1 -0
  412. package/web/dist/assets/ellipsis-vertical-BYwzw0xl.js +1 -0
  413. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  414. package/web/dist/assets/file-BRj5eISx.js +1 -0
  415. package/web/dist/assets/folder-z4oT5981.js +1 -0
  416. package/web/dist/assets/git-toolbar-owSEkYld.js +1 -0
  417. package/web/dist/assets/github-Bz2VgRX3.js +1 -0
  418. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  419. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  420. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  421. package/web/dist/assets/html-BY76lXLH.js +1 -0
  422. package/web/dist/assets/image-preview-h3WFluuy.js +1 -0
  423. package/web/dist/assets/index-BbcQNT92.css +2 -0
  424. package/web/dist/assets/index-EtQQQ6Kj.js +7 -0
  425. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  426. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  427. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  428. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  429. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  430. package/web/dist/assets/json-qhed-kSA.js +1 -0
  431. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  432. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  433. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  434. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  435. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  436. package/web/dist/assets/markdown-DqBKYPiB.js +2 -0
  437. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  438. package/web/dist/assets/new-task-form-BdJKRBJX.js +1 -0
  439. package/web/dist/assets/pill-BQfmfpYp.js +1 -0
  440. package/web/dist/assets/project-router-DxgFZY1l.js +1 -0
  441. package/web/dist/assets/prompt-templates-B6m16gq-.js +15 -0
  442. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  443. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  444. package/web/dist/assets/refresh-cw-mhSpxf2a.js +1 -0
  445. package/web/dist/assets/repo-git-CUNRxR3_.js +1 -0
  446. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  447. package/web/dist/assets/run-diff-DsmmDVfx.js +3 -0
  448. package/web/dist/assets/run-header-BkhrseLJ.js +1 -0
  449. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  450. package/web/dist/assets/search-x-BqDMB2g8.js +1 -0
  451. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  452. package/web/dist/assets/skill-empty-hint-BWEvTggc.js +1 -0
  453. package/web/dist/assets/skills-9oR_oHse.js +1 -0
  454. package/web/dist/assets/skills-DwIxnnWO.js +1 -0
  455. package/web/dist/assets/sparkles-DIoTQpyx.js +1 -0
  456. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  457. package/web/dist/assets/square-terminal-Cc7CuQxc.js +1 -0
  458. package/web/dist/assets/tab-link-D1fQgpmO.js +1 -0
  459. package/web/dist/assets/task-changes-BKeLlDpK.js +1 -0
  460. package/web/dist/assets/task-commits-gcEFZIa5.js +1 -0
  461. package/web/dist/assets/task-files-BGAqoXTW.js +2 -0
  462. package/web/dist/assets/task-thread-DT8aUYTS.js +9 -0
  463. package/web/dist/assets/textarea-BOVbfy5C.js +1 -0
  464. package/web/dist/assets/thread-loading-CypW73KD.js +1 -0
  465. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  466. package/web/dist/assets/trash-2-CJq6LHWn.js +1 -0
  467. package/web/dist/assets/triangle-alert-CjDFvU27.js +1 -0
  468. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  469. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  470. package/web/dist/assets/upload-CPDZlJeK.js +1 -0
  471. package/web/dist/assets/use-desktop-5JsLmi0a.js +1 -0
  472. package/web/dist/assets/use-submit-shortcut-CHVFevty.js +1 -0
  473. package/web/dist/assets/utils-DiO6zyJd.js +64 -0
  474. package/web/dist/assets/workflows-rQDFzWRt.js +11 -0
  475. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  476. package/web/dist/assets/zoomable-image-COWqb11v.js +1 -0
  477. package/web/dist/index.html +80 -0
  478. package/web/dist/open-mercato.svg +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-profiles.js","sourceRoot":"","sources":["../../src/workspace/agent-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,YAAY,GAGb,MAAM,qBAAqB,CAAC;AAwB7B;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAoB,EACpB,GAAG,GAAsB,OAAO,CAAC,GAAG;IAEpC,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7G,OAAO;QACL,EAAE,EAAE,wBAAwB;QAC5B,QAAQ;QACR,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,IAAI;QACf,IAAI;QACJ,SAAS,EAAE,IAA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Z,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,CAAS,EAAE,CAAS;IACvD,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,169 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `~/.cezar/config.json` — the per-user workspace config + project registry
4
+ * (spec 2026-07-20-multi-project-workspace). House rules from the spec's Data
5
+ * Model, applied verbatim:
6
+ *
7
+ * - every field optional/defaulted with `.catch`, so a bad value degrades
8
+ * per-key instead of discarding the file;
9
+ * - `.passthrough()` at every object level, so keys a *newer* cezar wrote
10
+ * survive a round-trip through an older one;
11
+ * - `.max()` bounds on strings (this file is parsed on every boot);
12
+ * - atomic tmp+rename writes with mode `0600` (dir `0700`);
13
+ * - a corrupt file degrades to in-memory defaults plus ONE warning line — the
14
+ * registry rebuilds as projects are opened, so losing it is an
15
+ * inconvenience, not data loss. The corrupt file is left in place until the
16
+ * next successful merge-write replaces it.
17
+ */
18
+ /** `id` slug rule — mirrors the spec: `^[a-z0-9][a-z0-9-]{0,63}$`. */
19
+ export declare const PROJECT_ID_RE: RegExp;
20
+ /**
21
+ * One registry entry. `id` + `root` are load-bearing (an entry without them is
22
+ * useless and gets dropped by the per-entry salvage below); the display fields
23
+ * degrade per-key so one bad value never evicts the project.
24
+ */
25
+ declare const workspaceProjectSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ root: z.ZodString;
28
+ name: z.ZodCatch<z.ZodString>;
29
+ addedAt: z.ZodCatch<z.ZodString>;
30
+ lastOpenedAt: z.ZodCatch<z.ZodString>;
31
+ source: z.ZodCatch<z.ZodEnum<{
32
+ checkout: "checkout";
33
+ local: "local";
34
+ }>>;
35
+ maxParallel: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
36
+ tags: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
37
+ }, z.core.$loose>;
38
+ export type WorkspaceProject = z.infer<typeof workspaceProjectSchema>;
39
+ /**
40
+ * Zero-config cadence, in minutes, for re-checking a run parked with
41
+ * `CEZ:MONITORING` (#810). The single source of truth for that default — the
42
+ * schema below and `WorkspaceSemaphore`'s fallback both read it, so an install
43
+ * with no `~/.cezar/config.json` and a semaphore built without boot wiring
44
+ * agree. `null` (explicit park) is a user choice and is never replaced by it.
45
+ */
46
+ export declare const DEFAULT_MONITORING_WAKE_MINUTES = 5;
47
+ declare const workspaceConfigSchema: z.ZodObject<{
48
+ schemaVersion: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
49
+ browseRoot: z.ZodCatch<z.ZodDefault<z.ZodString>>;
50
+ projectsDir: z.ZodCatch<z.ZodDefault<z.ZodString>>;
51
+ skillsAutoUpdate: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
52
+ modelsLocked: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
53
+ resources: z.ZodCatch<z.ZodPrefault<z.ZodObject<{
54
+ maxParallel: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
55
+ maxMonitoringSessions: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
56
+ monitoringWakeIntervalMinutes: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
57
+ autoResumeOnUsageLimit: z.ZodCatch<z.ZodDefault<z.ZodBoolean>>;
58
+ memoryLimitMb: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
59
+ worktreeRetentionDefault: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
60
+ }, z.core.$loose>>>;
61
+ composerDefaults: z.ZodCatch<z.ZodDefault<z.ZodObject<{
62
+ autonomous: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
63
+ worktree: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
64
+ }, z.core.$loose>>>;
65
+ disabledProviders: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<("claude" | "codex" | "opencode" | "pi")[], unknown[]>>;
66
+ agentDefaults: z.ZodCatch<z.ZodDefault<z.ZodObject<{
67
+ runner: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
68
+ claude: "claude";
69
+ codex: "codex";
70
+ opencode: "opencode";
71
+ pi: "pi";
72
+ }>>>;
73
+ models: z.ZodCatch<z.ZodOptional<z.ZodObject<{
74
+ claude: z.ZodCatch<z.ZodOptional<z.ZodString>>;
75
+ codex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
76
+ opencode: z.ZodCatch<z.ZodOptional<z.ZodString>>;
77
+ pi: z.ZodCatch<z.ZodOptional<z.ZodString>>;
78
+ }, z.core.$loose>>>;
79
+ }, z.core.$loose>>>;
80
+ projects: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<{
81
+ [x: string]: unknown;
82
+ id: string;
83
+ root: string;
84
+ name: string;
85
+ addedAt: string;
86
+ lastOpenedAt: string;
87
+ source: "checkout" | "local";
88
+ maxParallel?: number | undefined;
89
+ tags?: string[] | undefined;
90
+ }[], unknown[]>>;
91
+ }, z.core.$loose>;
92
+ export type WorkspaceConfig = z.infer<typeof workspaceConfigSchema>;
93
+ /** Resolve the auto-update preference without mutating or materializing it. */
94
+ export declare function effectiveSkillsAutoUpdate(config: Pick<WorkspaceConfig, 'skillsAutoUpdate'>, env?: NodeJS.ProcessEnv): boolean;
95
+ export declare function effectiveComposerDefault(stored: boolean | undefined, envValue: string | undefined, fallback: boolean): boolean;
96
+ /** The in-memory default — what a missing/corrupt file behaves like. */
97
+ export declare function defaultWorkspaceConfig(): WorkspaceConfig;
98
+ /**
99
+ * The last-known-good copy of a NON-EMPTY registry, written beside the config
100
+ * by every successful merge-write. The registry is cheap to rebuild in theory
101
+ * ("open the project again"), but in practice it is a hand-curated list, and a
102
+ * single bad write — a crash between `writeFileSync` and `rename`, a full
103
+ * disk, a stray process — costs the user every entry. One extra file, no
104
+ * configuration, and `loadWorkspaceConfig` falls back to it.
105
+ *
106
+ * Removing `~/.cezar` still resets cezar completely; removing only
107
+ * `config.json` no longer does, because this snapshot restores it.
108
+ *
109
+ * A cezar older than this change does not refresh the snapshot, so on a machine
110
+ * that alternates between versions it can lag behind the registry — which only
111
+ * shows if the config file is also lost, and the worst case is a project the
112
+ * user unregistered reappearing. Cheap next to losing the whole list.
113
+ */
114
+ export declare function workspaceConfigBackupPath(path?: string): string;
115
+ /**
116
+ * Read `~/.cezar/config.json` on demand — never cached, never throws. A
117
+ * missing file is the zero-config default (silent); an unreadable or
118
+ * malformed one degrades to the same default with a one-line warning and is
119
+ * left on disk untouched (the next successful merge-write replaces it).
120
+ *
121
+ * Before degrading, a missing, empty, or corrupt file is restored from the
122
+ * `config.json.bak` snapshot when that still holds projects. The restore is
123
+ * read-only: the recovered registry is handed back in memory and lands on disk
124
+ * again through the next merge-write, so a read never writes. A file that
125
+ * parses and simply has no projects is NOT restored — that is a user who
126
+ * removed their last project, not a lost registry.
127
+ *
128
+ * `path` defaults to the current `workspaceConfigPath()`, but a caller that
129
+ * will also WRITE passes the path it resolved itself — see
130
+ * `mergeWriteWorkspaceConfig` for why resolving it twice is a data-loss bug.
131
+ */
132
+ export declare function loadWorkspaceConfig(path?: string): Promise<WorkspaceConfig>;
133
+ /**
134
+ * The tmp path an atomic write stages through — UNIQUE PER WRITE, never a
135
+ * fixed `${path}.tmp`. `~/.cezar/` is shared by every cezar process on the
136
+ * machine (a `serve` per repo, `cezar run`s, a settings PUT), and two writers
137
+ * staging through the same tmp name interleave: writer B's `O_TRUNC` open can
138
+ * empty the file between writer A's write and rename, so A renames a
139
+ * truncated/half-written file into place — and B's own rename then throws
140
+ * `ENOENT` on the name A consumed. The pid + random suffix gives every writer
141
+ * its own staging file, so the only cross-process contention left is the
142
+ * rename itself, which is atomic.
143
+ */
144
+ export declare function atomicTmpPath(path: string): string;
145
+ /** Atomic JSON write (`0600`, dir `0700`) via a per-writer tmp + rename —
146
+ * shared by the workspace config and ui-state writers. Throws on write
147
+ * failure (e.g. a read-only home) — degrading is the caller's policy. */
148
+ export declare function atomicWriteJsonSync(path: string, value: unknown): void;
149
+ /**
150
+ * Read-modify-write merge: re-read the file, apply `mutator`, atomic-rename
151
+ * write (`0600`, dir `0700`). Because every writer re-reads immediately before
152
+ * writing, two processes registering different projects converge instead of
153
+ * dropping each other's entries (last-writer-wins only within the tiny
154
+ * read→rename window — acceptable for a registry that self-heals on next
155
+ * boot). The mutator may mutate its argument in place or return a replacement.
156
+ * Returns the config that was written. Throws on write failure (e.g. a
157
+ * read-only home) — degrading is the caller's policy, per house rules.
158
+ *
159
+ * The path is resolved ONCE, before the `await`, and the same value feeds the
160
+ * read and the write. Resolving it twice used to lose the whole registry:
161
+ * `workspaceConfigPath()` re-reads `CEZ_HOME` on every call, so if the variable
162
+ * changed while the read was in flight — a test's `afterEach` dropping its pin
163
+ * after a timeout is the way this happens in practice — the read came from one
164
+ * home and the write landed in another, replacing that file's registry with a
165
+ * config it never held. One resolution keeps a merge-write inside exactly one
166
+ * file, whatever the environment does mid-flight.
167
+ */
168
+ export declare function mergeWriteWorkspaceConfig(mutator: (config: WorkspaceConfig) => WorkspaceConfig | void): Promise<WorkspaceConfig>;
169
+ export {};
@@ -0,0 +1,379 @@
1
+ import { randomBytes } from 'node:crypto';
2
+ import { chmodSync, mkdirSync, renameSync, writeFileSync } from 'node:fs';
3
+ import { readFile } from 'node:fs/promises';
4
+ import { dirname } from 'node:path';
5
+ import { z } from 'zod';
6
+ // Contract VALUES, like `workspaceUiStateSchema` in workspace/migrations.ts: the tag bounds this
7
+ // file must not `.catch` away are the same constants the PATCH route validates against, so they
8
+ // are imported rather than repeated.
9
+ import { PROJECT_TAGS_MAX, PROJECT_TAG_MAX_LENGTH } from '../contract/index.js';
10
+ import { PROVIDER_IDS } from '../core/provider-auth.js';
11
+ import { assertCezarHomeWriteIsSandboxed, workspaceConfigPath } from '../paths.js';
12
+ /**
13
+ * `~/.cezar/config.json` — the per-user workspace config + project registry
14
+ * (spec 2026-07-20-multi-project-workspace). House rules from the spec's Data
15
+ * Model, applied verbatim:
16
+ *
17
+ * - every field optional/defaulted with `.catch`, so a bad value degrades
18
+ * per-key instead of discarding the file;
19
+ * - `.passthrough()` at every object level, so keys a *newer* cezar wrote
20
+ * survive a round-trip through an older one;
21
+ * - `.max()` bounds on strings (this file is parsed on every boot);
22
+ * - atomic tmp+rename writes with mode `0600` (dir `0700`);
23
+ * - a corrupt file degrades to in-memory defaults plus ONE warning line — the
24
+ * registry rebuilds as projects are opened, so losing it is an
25
+ * inconvenience, not data loss. The corrupt file is left in place until the
26
+ * next successful merge-write replaces it.
27
+ */
28
+ /** `id` slug rule — mirrors the spec: `^[a-z0-9][a-z0-9-]{0,63}$`. */
29
+ export const PROJECT_ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
30
+ /**
31
+ * One registry entry. `id` + `root` are load-bearing (an entry without them is
32
+ * useless and gets dropped by the per-entry salvage below); the display fields
33
+ * degrade per-key so one bad value never evicts the project.
34
+ */
35
+ const workspaceProjectSchema = z
36
+ .object({
37
+ /** Unique slug — URL segment, sidebar key, worktree namespace. */
38
+ id: z.string().regex(PROJECT_ID_RE),
39
+ /** Absolute, realpath-normalized repo root (normalization is the writer's
40
+ * job — `registerProject` in step 1.3; the schema only demands absolute). */
41
+ root: z.string().min(1).max(4096).refine((p) => p.startsWith('/'), 'root must be absolute'),
42
+ /** Display name (basename by default). `''` = caller derives a fallback. */
43
+ name: z.string().max(200).catch(''),
44
+ addedAt: z.string().max(64).catch(''),
45
+ lastOpenedAt: z.string().max(64).catch(''),
46
+ source: z.enum(['local', 'checkout']).catch('local'),
47
+ /** Per-project cap on concurrently running tasks. Absent = inherit the
48
+ * workspace `resources.maxParallel`. Bounded like the workspace cap; a bad
49
+ * value degrades to "inherit" (`.catch(undefined)`) rather than a hard
50
+ * default, and `.passthrough()` preserves the key across cezar round-trips. */
51
+ maxParallel: z.number().int().min(1).max(16).optional().catch(undefined),
52
+ /** Free-form labels grouping connected repositories (`storefront`, `infra`), used by the
53
+ * global Tasks page to filter and group across projects. Absent = untagged; the writers
54
+ * (`PATCH /api/projects/:id`, `cezar projects tag`) delete the key rather than storing `[]`,
55
+ * so an untagged project costs nothing in the file. Bounds mirror the PATCH schema exactly,
56
+ * so a value that route accepts can never be degraded away by the next load's `.catch`. */
57
+ tags: z
58
+ .array(z.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH))
59
+ .max(PROJECT_TAGS_MAX)
60
+ .optional()
61
+ .catch(undefined),
62
+ })
63
+ .passthrough();
64
+ /**
65
+ * Zero-config cadence, in minutes, for re-checking a run parked with
66
+ * `CEZ:MONITORING` (#810). The single source of truth for that default — the
67
+ * schema below and `WorkspaceSemaphore`'s fallback both read it, so an install
68
+ * with no `~/.cezar/config.json` and a semaphore built without boot wiring
69
+ * agree. `null` (explicit park) is a user choice and is never replaced by it.
70
+ */
71
+ export const DEFAULT_MONITORING_WAKE_MINUTES = 5;
72
+ const resourcesSchema = z
73
+ .object({
74
+ /** Workspace-wide parallel-task cap (moved from per-repo config.json). */
75
+ maxParallel: z.number().int().min(1).max(16).default(2).catch(2),
76
+ /** Extra durable `CEZ:MONITORING` sessions exempt from the active-task cap. */
77
+ maxMonitoringSessions: z.number().int().min(0).max(16).default(2).catch(2),
78
+ /**
79
+ * Cadence for re-checking monitored work; `null` parks at zero model cost until a
80
+ * user (or an external integration) resumes the session.
81
+ *
82
+ * Default-ON at 5 minutes (#810). It shipped as `null` and that made monitoring a
83
+ * dead end: #661 removed the 15-minute idle timer that used to bound a parked
84
+ * monitor, so with no wake timer a `CEZ:MONITORING` run has NO timer at all — and
85
+ * cezar has no other resume path (no process-exit callback, no CI webhook, no
86
+ * sub-agent-completion event). Tasks sat in `monitoring` for hours until a human
87
+ * typed something. Same reasoning as `autoResumeOnUsageLimit` below: it spends
88
+ * nothing while the downstream work is genuinely pending and it finishes the work
89
+ * the user already asked for. `MAX_AUTO_CONTINUES` still caps a forgotten loop, and
90
+ * an explicit `null` (Settings → Resources → "Park until resumed") is preserved.
91
+ */
92
+ monitoringWakeIntervalMinutes: z
93
+ .number()
94
+ .int()
95
+ .min(1)
96
+ .max(60)
97
+ .nullable()
98
+ .default(DEFAULT_MONITORING_WAKE_MINUTES)
99
+ .catch(DEFAULT_MONITORING_WAKE_MINUTES),
100
+ /**
101
+ * Resume a task the provider's usage limit stopped, once that limit resets
102
+ * (spec 2026-08-03-auto-resume-after-usage-limit). ON by default, which is the one
103
+ * cost-bearing automation in this file that is: it spends nothing while it waits, and it
104
+ * finishes the work the user already asked for rather than starting any of its own. Switching
105
+ * it off leaves the run `failed` with its Continue button, exactly as before the feature.
106
+ */
107
+ autoResumeOnUsageLimit: z.boolean().default(true).catch(true),
108
+ /** Per-task memory ceiling in MiB; null = no limit (matches the file's
109
+ * literal `"memoryLimitMb": null` in the spec's Data Model). */
110
+ memoryLimitMb: z.number().int().min(0).max(1_048_576).nullable().default(null).catch(null),
111
+ /** Default worktree retention for projects that don't override it. */
112
+ worktreeRetentionDefault: z.number().int().min(0).max(1000).default(10).catch(10),
113
+ })
114
+ .passthrough();
115
+ const composerDefaultsSchema = z
116
+ .object({
117
+ autonomous: z.boolean().optional().catch(undefined),
118
+ worktree: z.boolean().optional().catch(undefined),
119
+ })
120
+ .passthrough();
121
+ /**
122
+ * What a repo that has said nothing runs (spec 2026-07-29-agent-profiles).
123
+ *
124
+ * The point is not to configure every checkout: a repo's own `.ai/cezar/config.json` still wins
125
+ * key by key, and this is only consulted where that file is SILENT. Which is why every key here is
126
+ * optional with no default — an absent `runner` has to stay distinguishable from one someone chose,
127
+ * or "fall back to the machine default" collapses into "always claude".
128
+ *
129
+ * Personal and per-machine, like everything else in this file. The repo config is the team's; this
130
+ * is yours.
131
+ */
132
+ const agentDefaultsSchema = z
133
+ .object({
134
+ runner: z.enum(PROVIDER_IDS).optional().catch(undefined),
135
+ models: z
136
+ .object({
137
+ claude: z.string().trim().min(1).max(200).optional().catch(undefined),
138
+ codex: z.string().trim().min(1).max(200).optional().catch(undefined),
139
+ opencode: z.string().trim().min(1).max(200).optional().catch(undefined),
140
+ pi: z.string().trim().min(1).max(200).optional().catch(undefined),
141
+ })
142
+ .passthrough()
143
+ .optional()
144
+ .catch(undefined),
145
+ })
146
+ .passthrough();
147
+ const workspacePathSchema = (envName, fallback) => {
148
+ const defaultValue = () => process.env[envName]?.trim() || fallback;
149
+ return z.string().min(1).max(4096).default(defaultValue).catch(defaultValue);
150
+ };
151
+ const providerIdSet = new Set(PROVIDER_IDS);
152
+ const disabledProvidersSchema = z
153
+ .array(z.unknown())
154
+ .default(() => [])
155
+ .catch(() => [])
156
+ .transform((values) => {
157
+ const seen = new Set();
158
+ for (const value of values) {
159
+ if (typeof value !== 'string' || !providerIdSet.has(value))
160
+ continue;
161
+ seen.add(value);
162
+ }
163
+ return PROVIDER_IDS.filter((provider) => seen.has(provider));
164
+ });
165
+ const workspaceConfigSchema = z
166
+ .object({
167
+ /** Migration cursor (src/workspace/migrations.ts). Absent/bad → 0, which
168
+ * means "run every migration" — each one is idempotent, so that is safe. */
169
+ schemaVersion: z.number().int().min(0).default(0).catch(0),
170
+ /** Root exposed by the Add project folder browser. Environment supplies
171
+ * the zero-config default; an explicit workspace value wins thereafter. */
172
+ browseRoot: workspacePathSchema('CEZ_BROWSE_ROOT', '~/'),
173
+ /** Checkout root for GUI-cloned projects. Stored as written (a literal
174
+ * `~` is expanded by the checkout flow, not here); validated writable
175
+ * when *changed*, never at load. */
176
+ projectsDir: workspacePathSchema('CEZ_PROJECTS_DIR', '~/cezar/projects'),
177
+ /** Optional auto-update override. Absence inherits the environment/default
178
+ * and must stay absent on unrelated merge-writes. */
179
+ skillsAutoUpdate: z.boolean().optional().catch(undefined),
180
+ /** Global opt-in model policy. The native coding-agent model becomes
181
+ * authoritative while runner choice remains available. */
182
+ modelsLocked: z.boolean().optional().catch(undefined),
183
+ // Function-form default/catch: mutators (step 1.3's registerProject) edit
184
+ // these objects in place, so parses must never share one reference.
185
+ resources: resourcesSchema.prefault(() => ({})).catch(() => resourcesSchema.parse({})),
186
+ /** Optional New Task policy. Missing keys inherit exact 0/1 environment seeds. */
187
+ composerDefaults: composerDefaultsSchema.default(() => ({})).catch(() => ({})),
188
+ /** Host-wide provider preferences; absent means every provider is enabled. */
189
+ disabledProviders: disabledProvidersSchema,
190
+ /** Machine-wide agent/model defaults for repos that set none of their own. */
191
+ agentDefaults: agentDefaultsSchema.default(() => ({})).catch(() => ({})),
192
+ /** Per-entry salvage: a corrupt entry is dropped, the rest of the registry
193
+ * survives (a whole-array `.catch([])` would evict every project over one
194
+ * bad row). */
195
+ projects: z
196
+ .array(z.unknown())
197
+ .default(() => [])
198
+ .catch(() => [])
199
+ .transform((entries) => entries.flatMap((entry) => {
200
+ const parsed = workspaceProjectSchema.safeParse(entry);
201
+ return parsed.success ? [parsed.data] : [];
202
+ })),
203
+ })
204
+ .passthrough();
205
+ /** Resolve the auto-update preference without mutating or materializing it. */
206
+ export function effectiveSkillsAutoUpdate(config, env = process.env) {
207
+ if (config.skillsAutoUpdate !== undefined)
208
+ return config.skillsAutoUpdate;
209
+ if (env.CEZ_SKILLS_AUTO_UPDATE === '0')
210
+ return false;
211
+ if (env.CEZ_SKILLS_AUTO_UPDATE === '1')
212
+ return true;
213
+ return true;
214
+ }
215
+ export function effectiveComposerDefault(stored, envValue, fallback) {
216
+ if (stored !== undefined)
217
+ return stored;
218
+ if (envValue === '0')
219
+ return false;
220
+ if (envValue === '1')
221
+ return true;
222
+ return fallback;
223
+ }
224
+ /** The in-memory default — what a missing/corrupt file behaves like. */
225
+ export function defaultWorkspaceConfig() {
226
+ return workspaceConfigSchema.parse({});
227
+ }
228
+ /**
229
+ * The last-known-good copy of a NON-EMPTY registry, written beside the config
230
+ * by every successful merge-write. The registry is cheap to rebuild in theory
231
+ * ("open the project again"), but in practice it is a hand-curated list, and a
232
+ * single bad write — a crash between `writeFileSync` and `rename`, a full
233
+ * disk, a stray process — costs the user every entry. One extra file, no
234
+ * configuration, and `loadWorkspaceConfig` falls back to it.
235
+ *
236
+ * Removing `~/.cezar` still resets cezar completely; removing only
237
+ * `config.json` no longer does, because this snapshot restores it.
238
+ *
239
+ * A cezar older than this change does not refresh the snapshot, so on a machine
240
+ * that alternates between versions it can lag behind the registry — which only
241
+ * shows if the config file is also lost, and the worst case is a project the
242
+ * user unregistered reappearing. Cheap next to losing the whole list.
243
+ */
244
+ export function workspaceConfigBackupPath(path = workspaceConfigPath()) {
245
+ return `${path}.bak`;
246
+ }
247
+ function parseWorkspaceConfig(raw) {
248
+ try {
249
+ const parsed = workspaceConfigSchema.safeParse(JSON.parse(raw));
250
+ return parsed.success ? parsed.data : null;
251
+ }
252
+ catch {
253
+ return null;
254
+ }
255
+ }
256
+ /** The snapshot is only worth restoring while it still holds projects — an
257
+ * empty one carries no information the defaults do not already have. */
258
+ async function loadWorkspaceConfigBackup(path) {
259
+ let raw;
260
+ try {
261
+ raw = await readFile(workspaceConfigBackupPath(path), 'utf8');
262
+ }
263
+ catch {
264
+ return null;
265
+ }
266
+ const parsed = parseWorkspaceConfig(raw);
267
+ return parsed && parsed.projects.length > 0 ? parsed : null;
268
+ }
269
+ /**
270
+ * Read `~/.cezar/config.json` on demand — never cached, never throws. A
271
+ * missing file is the zero-config default (silent); an unreadable or
272
+ * malformed one degrades to the same default with a one-line warning and is
273
+ * left on disk untouched (the next successful merge-write replaces it).
274
+ *
275
+ * Before degrading, a missing, empty, or corrupt file is restored from the
276
+ * `config.json.bak` snapshot when that still holds projects. The restore is
277
+ * read-only: the recovered registry is handed back in memory and lands on disk
278
+ * again through the next merge-write, so a read never writes. A file that
279
+ * parses and simply has no projects is NOT restored — that is a user who
280
+ * removed their last project, not a lost registry.
281
+ *
282
+ * `path` defaults to the current `workspaceConfigPath()`, but a caller that
283
+ * will also WRITE passes the path it resolved itself — see
284
+ * `mergeWriteWorkspaceConfig` for why resolving it twice is a data-loss bug.
285
+ */
286
+ export async function loadWorkspaceConfig(path = workspaceConfigPath()) {
287
+ let raw = null;
288
+ try {
289
+ raw = await readFile(path, 'utf8');
290
+ }
291
+ catch {
292
+ // missing/unreadable — the backup below is the next chance
293
+ }
294
+ if (raw !== null && raw.trim() !== '') {
295
+ const parsed = parseWorkspaceConfig(raw);
296
+ if (parsed)
297
+ return parsed;
298
+ }
299
+ const restored = await loadWorkspaceConfigBackup(path);
300
+ if (restored) {
301
+ const cause = raw === null ? 'is missing' : 'is empty or corrupt';
302
+ console.warn(`[cez] workspace config ${path} ${cause} — restored ${restored.projects.length} project(s) from ${workspaceConfigBackupPath(path)}`);
303
+ return restored;
304
+ }
305
+ if (raw === null)
306
+ return defaultWorkspaceConfig();
307
+ console.warn(`[cez] workspace config ${path} is corrupt — using defaults (registry rebuilds)`);
308
+ return defaultWorkspaceConfig();
309
+ }
310
+ /**
311
+ * The tmp path an atomic write stages through — UNIQUE PER WRITE, never a
312
+ * fixed `${path}.tmp`. `~/.cezar/` is shared by every cezar process on the
313
+ * machine (a `serve` per repo, `cezar run`s, a settings PUT), and two writers
314
+ * staging through the same tmp name interleave: writer B's `O_TRUNC` open can
315
+ * empty the file between writer A's write and rename, so A renames a
316
+ * truncated/half-written file into place — and B's own rename then throws
317
+ * `ENOENT` on the name A consumed. The pid + random suffix gives every writer
318
+ * its own staging file, so the only cross-process contention left is the
319
+ * rename itself, which is atomic.
320
+ */
321
+ export function atomicTmpPath(path) {
322
+ return `${path}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
323
+ }
324
+ /** Atomic JSON write (`0600`, dir `0700`) via a per-writer tmp + rename —
325
+ * shared by the workspace config and ui-state writers. Throws on write
326
+ * failure (e.g. a read-only home) — degrading is the caller's policy. */
327
+ export function atomicWriteJsonSync(path, value) {
328
+ assertCezarHomeWriteIsSandboxed(path);
329
+ mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
330
+ const tmp = atomicTmpPath(path);
331
+ writeFileSync(tmp, `${JSON.stringify(value, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
332
+ renameSync(tmp, path);
333
+ try {
334
+ chmodSync(path, 0o600); // best-effort — ignored on some filesystems
335
+ }
336
+ catch {
337
+ // non-fatal
338
+ }
339
+ }
340
+ /**
341
+ * Read-modify-write merge: re-read the file, apply `mutator`, atomic-rename
342
+ * write (`0600`, dir `0700`). Because every writer re-reads immediately before
343
+ * writing, two processes registering different projects converge instead of
344
+ * dropping each other's entries (last-writer-wins only within the tiny
345
+ * read→rename window — acceptable for a registry that self-heals on next
346
+ * boot). The mutator may mutate its argument in place or return a replacement.
347
+ * Returns the config that was written. Throws on write failure (e.g. a
348
+ * read-only home) — degrading is the caller's policy, per house rules.
349
+ *
350
+ * The path is resolved ONCE, before the `await`, and the same value feeds the
351
+ * read and the write. Resolving it twice used to lose the whole registry:
352
+ * `workspaceConfigPath()` re-reads `CEZ_HOME` on every call, so if the variable
353
+ * changed while the read was in flight — a test's `afterEach` dropping its pin
354
+ * after a timeout is the way this happens in practice — the read came from one
355
+ * home and the write landed in another, replacing that file's registry with a
356
+ * config it never held. One resolution keeps a merge-write inside exactly one
357
+ * file, whatever the environment does mid-flight.
358
+ */
359
+ export async function mergeWriteWorkspaceConfig(mutator) {
360
+ const path = workspaceConfigPath();
361
+ const current = await loadWorkspaceConfig(path);
362
+ const next = mutator(current) ?? current;
363
+ atomicWriteJsonSync(path, next);
364
+ // Refresh the snapshot after EVERY successful write, including an emptied
365
+ // registry (#731). Skipping the empty case left a stale non-empty backup:
366
+ // removing the last project, then losing config.json, resurrected the project
367
+ // the user had deliberately unregistered. An empty snapshot is not restored on
368
+ // load (see loadWorkspaceConfigBackup), so recovery now settles on the empty
369
+ // registry the user intended rather than the old projects.
370
+ try {
371
+ atomicWriteJsonSync(workspaceConfigBackupPath(path), next);
372
+ }
373
+ catch {
374
+ // Best-effort: the registry itself is already safely on disk, and a
375
+ // failed snapshot must never turn a successful write into an error.
376
+ }
377
+ return next;
378
+ }
379
+ //# sourceMappingURL=config.js.map
@@ -0,0 +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,iGAAiG;AACjG,gGAAgG;AAChG,qCAAqC;AACrC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,YAAY,EAAmB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEnF;;;;;;;;;;;;;;;GAeG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAEzD;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,CAAC;KAC7B,MAA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AI,CAAC;QACH,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,4CAA4C;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAA4D;IAE5D,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;IACnC,MAAM,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"}
@@ -0,0 +1,45 @@
1
+ export { mergeWriteWorkspaceUiState } from './ui-state.ts';
2
+ /**
3
+ * Workspace config migrations (spec 2026-07-20-multi-project-workspace,
4
+ * "Migrations"). Deliberately tiny and **config-files-only** — run state
5
+ * (`runs.json`, NDJSON) keeps the existing additive-zod convention and never
6
+ * migrates. Rules, verbatim from the spec:
7
+ *
8
+ * - **idempotent** — every migration is safe to re-run after a crash mid-way;
9
+ * - **additive** — never deletes or rewrites the user's per-repo files;
10
+ * - **non-blocking** — a failing migration logs ONE warning and boot proceeds
11
+ * degraded with in-memory defaults; it is never a boot failure (the
12
+ * zero-config law "a read-only home degrades to a smaller cockpit" holds);
13
+ * - **concurrency-safe** — every write takes the same read-modify-write +
14
+ * atomic-rename path as all workspace writes (`mergeWriteWorkspaceConfig`),
15
+ * and two processes racing the same idempotent step converge.
16
+ */
17
+ export interface WorkspaceMigration {
18
+ /** `schemaVersion` this migration produces. */
19
+ to: number;
20
+ /** Stable id for the warning line, e.g. `'001-workspace-config'`. */
21
+ id: string;
22
+ /** The migration body — MUST be idempotent (see module docs). */
23
+ run(ctx: {
24
+ home: string;
25
+ bootRepoRoot: string | null;
26
+ }): Promise<void>;
27
+ }
28
+ /** All known migrations. Kept in ascending `to` order; `runMigrations` sorts
29
+ * defensively anyway. */
30
+ export declare const WORKSPACE_MIGRATIONS: readonly WorkspaceMigration[];
31
+ /**
32
+ * Run every pending workspace migration — called at boot before anything else
33
+ * touches `~/.cezar`. Reads `schemaVersion` (absent file or key → 0, which
34
+ * means "run everything" — safe because every migration is idempotent), runs
35
+ * each migration with `to > current` in ascending order, and persists the new
36
+ * `schemaVersion` after EACH one, so a crash resumes exactly where it left
37
+ * off. A failing migration logs ONE warning and stops the chain (later
38
+ * migrations may depend on earlier ones); boot proceeds degraded on in-memory
39
+ * defaults. Never throws.
40
+ *
41
+ * `migrations` is injectable for tests only; production callers pass nothing.
42
+ */
43
+ export declare function runMigrations(opts: {
44
+ bootRepoRoot: string | null;
45
+ }, migrations?: readonly WorkspaceMigration[]): Promise<void>;