@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
@@ -0,0 +1,490 @@
1
+ import { z } from 'zod';
2
+ import { type Runner } from './health.ts';
3
+ /**
4
+ * The workspace + settings families: `~/.cezar/config.json`'s settings slice, both GUI-pref bags
5
+ * (per-repo and workspace), the per-repo agent knobs, provider auth status, the host model
6
+ * catalog, the skills-update state, and the "Open in…" targets.
7
+ *
8
+ * Node-free by construction (see README rule 1) — `zod` and the sibling contract modules only.
9
+ */
10
+ /**
11
+ * `GET/PUT /api/v1/workspace/config` — the settings slice of `~/.cezar/config.json` (step 2.7).
12
+ *
13
+ * Global knobs only: the registry itself is `GET /api/v1/projects`, and `schemaVersion` (a
14
+ * migration cursor, not a setting) is deliberately absent. `resources` is the workspace's
15
+ * host-protection budget — the ONLY effective `maxParallel`/`memoryLimitMb` since Phase 2;
16
+ * `worktreeRetentionDefault` seeds projects that set none.
17
+ *
18
+ * `composerDefaults` and every `resources` key are REQUIRED: `workspaceConfigBody`
19
+ * (src/server/server.ts:1888) materializes all of them from schema defaults on every answer,
20
+ * including the degraded path. The hand-written DTO declared `composerDefaults`,
21
+ * `resources.maxMonitoringSessions` and `resources.monitoringWakeIntervalMinutes` optional, which
22
+ * was wider than the server has ever been.
23
+ */
24
+ export declare const workspaceConfigResponseSchema: z.ZodObject<{
25
+ browseRoot: z.ZodString;
26
+ projectsDir: z.ZodString;
27
+ skillsAutoUpdate: z.ZodNullable<z.ZodBoolean>;
28
+ effectiveSkillsAutoUpdate: z.ZodBoolean;
29
+ composerDefaults: z.ZodObject<{
30
+ autonomous: z.ZodNullable<z.ZodBoolean>;
31
+ worktree: z.ZodNullable<z.ZodBoolean>;
32
+ inheritedAutonomous: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"source-dependent">]>;
33
+ inheritedWorktree: z.ZodBoolean;
34
+ }, z.core.$strip>;
35
+ resources: z.ZodObject<{
36
+ maxParallel: z.ZodNumber;
37
+ maxMonitoringSessions: z.ZodNumber;
38
+ monitoringWakeIntervalMinutes: z.ZodNullable<z.ZodNumber>;
39
+ autoResumeOnUsageLimit: z.ZodBoolean;
40
+ memoryLimitMb: z.ZodNullable<z.ZodNumber>;
41
+ worktreeRetentionDefault: z.ZodNumber;
42
+ }, z.core.$strip>;
43
+ agentDefaults: z.ZodObject<{
44
+ runner: z.ZodOptional<z.ZodEnum<{
45
+ claude: "claude";
46
+ codex: "codex";
47
+ opencode: "opencode";
48
+ }>>;
49
+ models: z.ZodOptional<z.ZodObject<{
50
+ claude: z.ZodOptional<z.ZodString>;
51
+ codex: z.ZodOptional<z.ZodString>;
52
+ opencode: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>;
56
+ export type WorkspaceConfigResponse = z.infer<typeof workspaceConfigResponseSchema>;
57
+ /**
58
+ * `PUT /api/v1/workspace/config` body — partial: absent keys stay untouched. A rejected workspace
59
+ * root (not writable) 400s with the reason and persists NOTHING, resources included, so callers
60
+ * may send both in one request only if they want that atomicity. Bounds mirror
61
+ * `src/workspace/config.ts` exactly, so a value this schema accepts can never be degraded away by
62
+ * the next load's `.catch`.
63
+ */
64
+ export declare const setWorkspaceConfigInputSchema: z.ZodObject<{
65
+ browseRoot: z.ZodOptional<z.ZodString>;
66
+ projectsDir: z.ZodOptional<z.ZodString>;
67
+ skillsAutoUpdate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
68
+ composerDefaults: z.ZodOptional<z.ZodObject<{
69
+ autonomous: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
70
+ worktree: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
71
+ }, z.core.$strip>>;
72
+ agentDefaults: z.ZodOptional<z.ZodObject<{
73
+ runner: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
74
+ claude: "claude";
75
+ codex: "codex";
76
+ opencode: "opencode";
77
+ }>>>;
78
+ models: z.ZodOptional<z.ZodObject<{
79
+ claude: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ codex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ opencode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>>;
84
+ resources: z.ZodOptional<z.ZodObject<{
85
+ maxParallel: z.ZodOptional<z.ZodNumber>;
86
+ maxMonitoringSessions: z.ZodOptional<z.ZodNumber>;
87
+ monitoringWakeIntervalMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
88
+ autoResumeOnUsageLimit: z.ZodOptional<z.ZodBoolean>;
89
+ memoryLimitMb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
90
+ worktreeRetentionDefault: z.ZodOptional<z.ZodNumber>;
91
+ }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ export type SetWorkspaceConfigInput = z.infer<typeof setWorkspaceConfigInputSchema>;
94
+ /**
95
+ * `GET/PUT /api/v1/ui-state` — the per-repo GUI prefs in `.ai/cezar/ui-state.json`.
96
+ *
97
+ * An OPEN bag on purpose (BACKWARD_COMPATIBILITY.md §3): unknown keys round-trip untouched, so a
98
+ * newer cockpit's prefs survive an older server and a future pref needs no server change. Hence
99
+ * `z.looseObject`, not a closed object — the keys below are the ones the server's schema *names*,
100
+ * never the ones it *permits*. The write side caps the TOP-LEVEL key count at 200 (#429); that cap
101
+ * is a request-body refinement in `src/server/server.ts` (`capUiStateKeys`, :756) and is not part
102
+ * of the response shape.
103
+ *
104
+ * `notifications` is deliberately NOT here: it moved to `WorkspaceUiState` at step 3.5 and the
105
+ * per-repo schema (src/server/server.ts:550) has not named it since. The hand-written DTO still
106
+ * listed it, which made it wider than the route.
107
+ */
108
+ export declare const uiStateSchema: z.ZodObject<{
109
+ lastTask: z.ZodOptional<z.ZodObject<{
110
+ source: z.ZodEnum<{
111
+ skill: "skill";
112
+ workflow: "workflow";
113
+ }>;
114
+ ref: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ recentSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
117
+ source: z.ZodEnum<{
118
+ skill: "skill";
119
+ workflow: "workflow";
120
+ }>;
121
+ ref: z.ZodString;
122
+ }, z.core.$strip>>>;
123
+ lastWorktree: z.ZodOptional<z.ZodBoolean>;
124
+ lastAutonomous: z.ZodOptional<z.ZodBoolean>;
125
+ lastGenerateFollowups: z.ZodOptional<z.ZodBoolean>;
126
+ skillUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
127
+ runsView: z.ZodOptional<z.ZodEnum<{
128
+ list: "list";
129
+ table: "table";
130
+ }>>;
131
+ githubView: z.ZodOptional<z.ZodEnum<{
132
+ issues: "issues";
133
+ prs: "prs";
134
+ }>>;
135
+ appearance: z.ZodOptional<z.ZodObject<{
136
+ accent: z.ZodOptional<z.ZodEnum<{
137
+ lime: "lime";
138
+ violet: "violet";
139
+ }>>;
140
+ density: z.ZodOptional<z.ZodEnum<{
141
+ comfortable: "comfortable";
142
+ compact: "compact";
143
+ ultra: "ultra";
144
+ }>>;
145
+ }, z.core.$strip>>;
146
+ promptTemplates: z.ZodOptional<z.ZodArray<z.ZodObject<{
147
+ id: z.ZodString;
148
+ label: z.ZodString;
149
+ text: z.ZodString;
150
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ }, z.core.$strip>>>;
152
+ dismissedSkillsBanner: z.ZodOptional<z.ZodBoolean>;
153
+ }, z.core.$loose>;
154
+ export type UiState = z.infer<typeof uiStateSchema>;
155
+ /**
156
+ * `GET/PUT /api/v1/workspace/ui-state` — cross-project GUI prefs in `~/.cezar/ui-state.json`
157
+ * (multi-project spec, step 2.7).
158
+ *
159
+ * The same open bag as its per-repo twin above, and open for the same reason. The PUT merges
160
+ * SHALLOWLY at the top level server-side, so a writer must send the whole `sidebar` object (or the
161
+ * whole `importedSkills` array), never a leaf.
162
+ */
163
+ export declare const workspaceLastLocationSchema: z.ZodObject<{
164
+ projectId: z.ZodString;
165
+ pathname: z.ZodString;
166
+ search: z.ZodOptional<z.ZodString>;
167
+ hash: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strict>;
169
+ export type WorkspaceLastLocation = z.infer<typeof workspaceLastLocationSchema>;
170
+ export declare const workspaceUiStateSchema: z.ZodObject<{
171
+ sidebar: z.ZodOptional<z.ZodObject<{
172
+ collapsed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
173
+ }, z.core.$loose>>;
174
+ dismissedProviderAuthFailures: z.ZodOptional<z.ZodObject<{
175
+ claude: z.ZodOptional<z.ZodString>;
176
+ codex: z.ZodOptional<z.ZodString>;
177
+ opencode: z.ZodOptional<z.ZodString>;
178
+ }, z.core.$strip>>;
179
+ appearance: z.ZodOptional<z.ZodObject<{
180
+ accent: z.ZodOptional<z.ZodEnum<{
181
+ lime: "lime";
182
+ violet: "violet";
183
+ }>>;
184
+ density: z.ZodOptional<z.ZodEnum<{
185
+ comfortable: "comfortable";
186
+ compact: "compact";
187
+ ultra: "ultra";
188
+ }>>;
189
+ }, z.core.$strip>>;
190
+ notifications: z.ZodOptional<z.ZodObject<{
191
+ enabled: z.ZodOptional<z.ZodBoolean>;
192
+ }, z.core.$loose>>;
193
+ lastLocation: z.ZodOptional<z.ZodObject<{
194
+ projectId: z.ZodString;
195
+ pathname: z.ZodString;
196
+ search: z.ZodOptional<z.ZodString>;
197
+ hash: z.ZodOptional<z.ZodString>;
198
+ }, z.core.$strict>>;
199
+ importedSkills: z.ZodOptional<z.ZodArray<z.ZodString>>;
200
+ }, z.core.$loose>;
201
+ export type WorkspaceUiState = z.infer<typeof workspaceUiStateSchema>;
202
+ /** Per-runner default model preset (Settings → Agents): the composer preselects this model id for
203
+ * the runner. Absent = auto (the runner decides). Keyed by runner name rather than derived from
204
+ * `runnerSchema` because the server's own `defaultModels` object (src/config.ts:92) is spelled
205
+ * the same way — one key per runner, each independently optional. */
206
+ export declare const runnerModelsSchema: z.ZodObject<{
207
+ claude: z.ZodOptional<z.ZodString>;
208
+ codex: z.ZodOptional<z.ZodString>;
209
+ opencode: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>;
211
+ export type RunnerModels = z.infer<typeof runnerModelsSchema>;
212
+ /** `GET /api/v1/config` — every Settings → Agents knob in one read. */
213
+ export declare const configResponseSchema: z.ZodObject<{
214
+ baseBranch: z.ZodNullable<z.ZodString>;
215
+ defaultRunner: z.ZodEnum<{
216
+ claude: "claude";
217
+ codex: "codex";
218
+ opencode: "opencode";
219
+ }>;
220
+ systemPrompt: z.ZodNullable<z.ZodString>;
221
+ defaultModels: z.ZodObject<{
222
+ claude: z.ZodOptional<z.ZodString>;
223
+ codex: z.ZodOptional<z.ZodString>;
224
+ opencode: z.ZodOptional<z.ZodString>;
225
+ }, z.core.$strip>;
226
+ modelsLocked: z.ZodBoolean;
227
+ maxParallel: z.ZodNumber;
228
+ memoryLimitMb: z.ZodNullable<z.ZodNumber>;
229
+ worktreeRetention: z.ZodNumber;
230
+ liveTitleUpdates: z.ZodNullable<z.ZodBoolean>;
231
+ reviewGate: z.ZodNullable<z.ZodBoolean>;
232
+ }, z.core.$strip>;
233
+ export type ConfigResponse = z.infer<typeof configResponseSchema>;
234
+ /** The `PUT /api/v1/config` answer: the same shape GET serves (`configAnswer` builds both). */
235
+ export declare const setConfigResponseSchema: z.ZodObject<{
236
+ baseBranch: z.ZodNullable<z.ZodString>;
237
+ defaultRunner: z.ZodEnum<{
238
+ claude: "claude";
239
+ codex: "codex";
240
+ opencode: "opencode";
241
+ }>;
242
+ systemPrompt: z.ZodNullable<z.ZodString>;
243
+ defaultModels: z.ZodObject<{
244
+ claude: z.ZodOptional<z.ZodString>;
245
+ codex: z.ZodOptional<z.ZodString>;
246
+ opencode: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strip>;
248
+ modelsLocked: z.ZodBoolean;
249
+ maxParallel: z.ZodNumber;
250
+ memoryLimitMb: z.ZodNullable<z.ZodNumber>;
251
+ worktreeRetention: z.ZodNumber;
252
+ liveTitleUpdates: z.ZodNullable<z.ZodBoolean>;
253
+ reviewGate: z.ZodNullable<z.ZodBoolean>;
254
+ }, z.core.$strip>;
255
+ export type SetConfigResponse = z.infer<typeof setConfigResponseSchema>;
256
+ /**
257
+ * `PUT /api/v1/config` body (Settings → Agents; the Repo tab's base-branch picker).
258
+ * `baseBranch: null` clears the setting back to "follow checked-out branch"; `systemPrompt` and
259
+ * per-runner `defaultModels` entries clear on `null` (or `''`) too. Merged into the raw
260
+ * config.json server-side — `defaultModels` merges per runner, so one write never clobbers
261
+ * another runner's preset.
262
+ */
263
+ export declare const setConfigInputSchema: z.ZodObject<{
264
+ baseBranch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ defaultRunner: z.ZodOptional<z.ZodEnum<{
266
+ claude: "claude";
267
+ codex: "codex";
268
+ opencode: "opencode";
269
+ }>>;
270
+ systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ defaultModels: z.ZodOptional<z.ZodObject<{
272
+ claude: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ codex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
+ opencode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
+ }, z.core.$strip>>;
276
+ maxParallel: z.ZodOptional<z.ZodNumber>;
277
+ memoryLimitMb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
278
+ worktreeRetention: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
279
+ liveTitleUpdates: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
280
+ reviewGate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
281
+ }, z.core.$strip>;
282
+ export type SetConfigInput = z.infer<typeof setConfigInputSchema>;
283
+ export declare const skillsUpdateStatusSchema: z.ZodEnum<{
284
+ available: "available";
285
+ checking: "checking";
286
+ current: "current";
287
+ error: "error";
288
+ idle: "idle";
289
+ unavailable: "unavailable";
290
+ updating: "updating";
291
+ }>;
292
+ export type SkillsUpdateStatus = z.infer<typeof skillsUpdateStatusSchema>;
293
+ export declare const skillsUpdateScopeStateSchema: z.ZodObject<{
294
+ scope: z.ZodEnum<{
295
+ global: "global";
296
+ project: "project";
297
+ }>;
298
+ status: z.ZodEnum<{
299
+ available: "available";
300
+ checking: "checking";
301
+ current: "current";
302
+ error: "error";
303
+ idle: "idle";
304
+ unavailable: "unavailable";
305
+ updating: "updating";
306
+ }>;
307
+ available: z.ZodBoolean;
308
+ skills: z.ZodArray<z.ZodString>;
309
+ checkedAt: z.ZodNullable<z.ZodString>;
310
+ updatedAt: z.ZodNullable<z.ZodString>;
311
+ reason: z.ZodOptional<z.ZodString>;
312
+ }, z.core.$strip>;
313
+ export type SkillsUpdateScopeState = z.infer<typeof skillsUpdateScopeStateSchema>;
314
+ /** `GET /api/v1/workspace/skills-update` (and the check/apply POSTs) — the merged project+global
315
+ * skills-update state. `autoUpdateEnabled`/`inherited` are re-stamped from the workspace config
316
+ * on the way out (`skillsUpdateResponse`, src/server/server.ts:1818). */
317
+ export declare const skillsUpdateStateSchema: z.ZodObject<{
318
+ status: z.ZodEnum<{
319
+ available: "available";
320
+ checking: "checking";
321
+ current: "current";
322
+ error: "error";
323
+ idle: "idle";
324
+ unavailable: "unavailable";
325
+ updating: "updating";
326
+ }>;
327
+ available: z.ZodBoolean;
328
+ autoUpdateEnabled: z.ZodBoolean;
329
+ inherited: z.ZodBoolean;
330
+ checkedAt: z.ZodNullable<z.ZodString>;
331
+ updatedAt: z.ZodNullable<z.ZodString>;
332
+ scopes: z.ZodArray<z.ZodObject<{
333
+ scope: z.ZodEnum<{
334
+ global: "global";
335
+ project: "project";
336
+ }>;
337
+ status: z.ZodEnum<{
338
+ available: "available";
339
+ checking: "checking";
340
+ current: "current";
341
+ error: "error";
342
+ idle: "idle";
343
+ unavailable: "unavailable";
344
+ updating: "updating";
345
+ }>;
346
+ available: z.ZodBoolean;
347
+ skills: z.ZodArray<z.ZodString>;
348
+ checkedAt: z.ZodNullable<z.ZodString>;
349
+ updatedAt: z.ZodNullable<z.ZodString>;
350
+ reason: z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strip>>;
352
+ needsUpgradeNotes: z.ZodBoolean;
353
+ }, z.core.$strip>;
354
+ export type SkillsUpdateState = z.infer<typeof skillsUpdateStateSchema>;
355
+ /** The agent backends are the providers — one alias, never a second enum. */
356
+ export declare const providerIdSchema: z.ZodEnum<{
357
+ claude: "claude";
358
+ codex: "codex";
359
+ opencode: "opencode";
360
+ }>;
361
+ export type ProviderId = Runner;
362
+ /** Coarse host authentication state. Credentials, account identity, and raw CLI output never
363
+ * cross this boundary. */
364
+ export declare const providerConnectionStateSchema: z.ZodEnum<{
365
+ connected: "connected";
366
+ disconnected: "disconnected";
367
+ "not-installed": "not-installed";
368
+ unknown: "unknown";
369
+ }>;
370
+ export type ProviderConnectionState = z.infer<typeof providerConnectionStateSchema>;
371
+ /**
372
+ * One provider row.
373
+ *
374
+ * `enabled` is OPTIONAL: `ProviderAuth.status()` (src/core/provider-auth.ts:12) builds rows
375
+ * without it and only `applyProviderEnablement` stamps it in, so the type the routes answer keeps
376
+ * the key optional. The hand-written DTO declared it required — narrower than the route.
377
+ */
378
+ export declare const providerStatusSchema: z.ZodObject<{
379
+ provider: z.ZodEnum<{
380
+ claude: "claude";
381
+ codex: "codex";
382
+ opencode: "opencode";
383
+ }>;
384
+ status: z.ZodEnum<{
385
+ connected: "connected";
386
+ disconnected: "disconnected";
387
+ "not-installed": "not-installed";
388
+ unknown: "unknown";
389
+ }>;
390
+ enabled: z.ZodOptional<z.ZodBoolean>;
391
+ hint: z.ZodOptional<z.ZodString>;
392
+ authFailureId: z.ZodOptional<z.ZodString>;
393
+ profileId: z.ZodOptional<z.ZodString>;
394
+ }, z.core.$strip>;
395
+ export type ProviderStatus = z.infer<typeof providerStatusSchema>;
396
+ /** `GET /api/v1/providers/status`, and the answer of the enabled/retry mutators. */
397
+ export declare const providerStatusResponseSchema: z.ZodObject<{
398
+ providers: z.ZodArray<z.ZodObject<{
399
+ provider: z.ZodEnum<{
400
+ claude: "claude";
401
+ codex: "codex";
402
+ opencode: "opencode";
403
+ }>;
404
+ status: z.ZodEnum<{
405
+ connected: "connected";
406
+ disconnected: "disconnected";
407
+ "not-installed": "not-installed";
408
+ unknown: "unknown";
409
+ }>;
410
+ enabled: z.ZodOptional<z.ZodBoolean>;
411
+ hint: z.ZodOptional<z.ZodString>;
412
+ authFailureId: z.ZodOptional<z.ZodString>;
413
+ profileId: z.ZodOptional<z.ZodString>;
414
+ }, z.core.$strip>>;
415
+ }, z.core.$strip>;
416
+ export type ProviderStatusResponse = z.infer<typeof providerStatusResponseSchema>;
417
+ /** `POST /api/v1/providers/connect` — either a terminal was handed the login command, or the
418
+ * provider turned out to be connected already. Every other outcome is a 409/500 carrying the
419
+ * same `command` for the clipboard fallback. */
420
+ export declare const providerConnectResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
421
+ opened: z.ZodLiteral<true>;
422
+ command: z.ZodString;
423
+ }, z.core.$strip>, z.ZodObject<{
424
+ opened: z.ZodLiteral<false>;
425
+ connected: z.ZodLiteral<true>;
426
+ command: z.ZodString;
427
+ }, z.core.$strip>], "opened">;
428
+ export type ProviderConnectResponse = z.infer<typeof providerConnectResponseSchema>;
429
+ export declare const runnerModelOptionSchema: z.ZodObject<{
430
+ id: z.ZodString;
431
+ label: z.ZodString;
432
+ description: z.ZodString;
433
+ }, z.core.$strip>;
434
+ export type RunnerModelOption = z.infer<typeof runnerModelOptionSchema>;
435
+ /** `GET /api/v1/models?runner=codex` — discovered models, plus how fresh the answer is. Never an
436
+ * error: an unavailable CLI degrades to `source: 'unavailable'` with a `reason`. */
437
+ export declare const runnerModelCatalogResponseSchema: z.ZodObject<{
438
+ runner: z.ZodEnum<{
439
+ claude: "claude";
440
+ codex: "codex";
441
+ opencode: "opencode";
442
+ }>;
443
+ models: z.ZodArray<z.ZodObject<{
444
+ id: z.ZodString;
445
+ label: z.ZodString;
446
+ description: z.ZodString;
447
+ }, z.core.$strip>>;
448
+ source: z.ZodEnum<{
449
+ cache: "cache";
450
+ live: "live";
451
+ unavailable: "unavailable";
452
+ }>;
453
+ stale: z.ZodBoolean;
454
+ reason: z.ZodOptional<z.ZodString>;
455
+ }, z.core.$strip>;
456
+ export type RunnerModelCatalogResponse = z.infer<typeof runnerModelCatalogResponseSchema>;
457
+ /** A local app a worktree can be opened in (#open-in): editor, file manager, or terminal. */
458
+ export declare const openTargetSchema: z.ZodObject<{
459
+ id: z.ZodString;
460
+ label: z.ZodString;
461
+ icon: z.ZodOptional<z.ZodString>;
462
+ }, z.core.$strip>;
463
+ export type OpenTarget = z.infer<typeof openTargetSchema>;
464
+ /** `GET /api/v1/open-targets` — the detected local apps; empty in hosted mode (CEZ_REMOTE). */
465
+ export declare const openTargetsResponseSchema: z.ZodObject<{
466
+ targets: z.ZodArray<z.ZodObject<{
467
+ id: z.ZodString;
468
+ label: z.ZodString;
469
+ icon: z.ZodOptional<z.ZodString>;
470
+ }, z.core.$strip>>;
471
+ }, z.core.$strip>;
472
+ export type OpenTargetsResponse = z.infer<typeof openTargetsResponseSchema>;
473
+ /**
474
+ * `POST /api/v1/open-in` — open THIS PROJECT'S root in a detected app (Settings → the project
475
+ * folder row). The path is never sent: it is the scoped project's own registered root, resolved
476
+ * server-side, so the route has no traversal surface at all. `target` is an
477
+ * `/api/v1/open-targets` id; unlike the run route there is no `default`/`cli:` handling, because
478
+ * a repo root is a directory and an agent CLI belongs in a task worktree.
479
+ */
480
+ export declare const openProjectInSchema: z.ZodObject<{
481
+ target: z.ZodString;
482
+ }, z.core.$strip>;
483
+ export type OpenProjectInRequest = z.infer<typeof openProjectInSchema>;
484
+ /** The 200 for the above — `opened` is a literal because every failure is a 409 with `{ error }`,
485
+ * so a `false` would be unreachable and would only invite a client to branch on it. */
486
+ export declare const openProjectInResponseSchema: z.ZodObject<{
487
+ opened: z.ZodLiteral<true>;
488
+ path: z.ZodString;
489
+ }, z.core.$strip>;
490
+ export type OpenProjectInResponse = z.infer<typeof openProjectInResponseSchema>;
@@ -15,7 +15,7 @@
15
15
  * - `CEZ_ENV_PASSTHROUGH=A,B,C` forwards those extra named vars;
16
16
  * - `CEZ_AGENT_ENV_FULL=1` restores the legacy full-`process.env` behavior.
17
17
  */
18
- import type { AgentBackend } from './agent-runner.js';
18
+ import type { AgentBackend } from './agent-runner.ts';
19
19
  export declare function looksSecret(name: string): boolean;
20
20
  export interface BuildChildEnvOptions {
21
21
  backend: AgentBackend;
@@ -0,0 +1,10 @@
1
+ /** The server-side switch that makes native agent settings authoritative. */
2
+ export declare const AGENT_MODELS_LOCKED_ENV = "CEZ_AGENT_MODELS_LOCKED";
3
+ /**
4
+ * Only the exact environment value `1` enables the process-wide lock. The
5
+ * global workspace config or one repository may additionally opt in with
6
+ * `"modelsLocked": true`; missing, unreadable, malformed, and false values
7
+ * preserve ordinary model selection unless another source enables the lock.
8
+ */
9
+ export declare function agentModelsLocked(repoRoot?: string, env?: NodeJS.ProcessEnv): boolean;
10
+ export declare const AGENT_MODELS_LOCKED_ERROR = "agent models are locked \u2014 configure the model in the native coding-agent settings";
@@ -0,0 +1,36 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { z } from 'zod';
4
+ import { workspaceConfigPath } from '../paths.js';
5
+ /** The server-side switch that makes native agent settings authoritative. */
6
+ export const AGENT_MODELS_LOCKED_ENV = 'CEZ_AGENT_MODELS_LOCKED';
7
+ const modelPolicyConfigSchema = z.object({
8
+ modelsLocked: z.boolean().optional(),
9
+ }).passthrough();
10
+ /**
11
+ * Only the exact environment value `1` enables the process-wide lock. The
12
+ * global workspace config or one repository may additionally opt in with
13
+ * `"modelsLocked": true`; missing, unreadable, malformed, and false values
14
+ * preserve ordinary model selection unless another source enables the lock.
15
+ */
16
+ export function agentModelsLocked(repoRoot, env = process.env) {
17
+ if (env[AGENT_MODELS_LOCKED_ENV] === '1')
18
+ return true;
19
+ const paths = [
20
+ workspaceConfigPath(env),
21
+ ...(repoRoot ? [join(repoRoot, '.ai', 'cezar', 'config.json')] : []),
22
+ ];
23
+ for (const path of paths) {
24
+ try {
25
+ const parsed = modelPolicyConfigSchema.safeParse(JSON.parse(readFileSync(path, 'utf8')));
26
+ if (parsed.success && parsed.data.modelsLocked === true)
27
+ return true;
28
+ }
29
+ catch {
30
+ // Each source is optional and independently degradable.
31
+ }
32
+ }
33
+ return false;
34
+ }
35
+ export const AGENT_MODELS_LOCKED_ERROR = 'agent models are locked — configure the model in the native coding-agent settings';
36
+ //# sourceMappingURL=agent-model-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-model-policy.js","sourceRoot":"","sources":["../../src/core/agent-model-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC,WAAW,EAAE,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAiB,EACjB,GAAG,GAAsB,OAAO,CAAC,GAAG;IAEpC,IAAI,GAAG,CAAC,uBAAuB,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACtD,MAAM,KAAK,GAAG;QACZ,mBAAmB,CAAC,GAAG,CAAC;QACxB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,uBAAuB,CAAC,SAAS,CAC9C,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CACvC,CAAC;YACF,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;QACvE,CAAC;QAAC,MAAM,CAAC;YACP,wDAAwD;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GACpC,mFAAmF,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { ProviderId } from './provider-auth.ts';
2
+ /**
3
+ * Agent profiles — a second (third, …) login of the SAME agent CLI.
4
+ *
5
+ * The binary never changes; only the environment does. `CLAUDE_CONFIG_DIR=~/.claude-klaudiusz claude`
6
+ * is the same Claude Code talking to a different account, because that one variable relocates the
7
+ * agent's ENTIRE per-user home: credentials, settings, projects and — the part that bites —
8
+ * `sessions/`, so a session id only means something inside the dir it was created in.
9
+ *
10
+ * This module is the single maintenance surface for that vendor knowledge, and it is deliberately
11
+ * the SIBLING of `src/agent-config/catalog.ts` rather than part of it: the catalog owns config
12
+ * *file* knowledge (paths, formats, verbatim precedence strings), this owns the *home-relocation*
13
+ * variable. Splitting them also keeps the layering honest — `agent-config/` may import `paths.ts`,
14
+ * while this is imported BY the runners, provider auth and the terminal handoff.
15
+ *
16
+ * Pure by construction: no filesystem, no `process.env`, nothing to stub. Resolution against the
17
+ * workspace config lives in `src/workspace/agent-profiles.ts`.
18
+ *
19
+ * Facts verified against the shipped CLIs on 2026-07-29.
20
+ */
21
+ /**
22
+ * Which env var relocates each agent's whole per-user home.
23
+ *
24
+ * `null` means the agent has no such variable and therefore cannot carry profiles:
25
+ *
26
+ * - **claude** → `CLAUDE_CONFIG_DIR`. Documented; moves credentials, settings, projects, sessions.
27
+ * - **codex** → `CODEX_HOME`. Documented; `auth.json` lives inside it, so identity moves too.
28
+ * - **opencode** → nothing usable. `OPENCODE_CONFIG_DIR`/`OPENCODE_CONFIG` move CONFIG ONLY;
29
+ * credentials live in `~/.local/share/opencode/opencode.db`, behind a separate `OPENCODE_DB`.
30
+ * A config-dir-only profile would swap settings while still billing the other account — the UI
31
+ * would say "Work" and the run would not be — so OpenCode is unsupported until it documents a
32
+ * single home variable. `XDG_CONFIG_HOME` is rejected regardless: it is machine-wide and would
33
+ * relocate every other XDG-aware tool the agent's own Bash calls touch.
34
+ */
35
+ export declare const PROFILE_ENV_VAR: Record<ProviderId, string | null>;
36
+ /** Providers that can carry more than one account — what the UI offers "Add account" for. */
37
+ export declare const PROFILE_CAPABLE_PROVIDERS: readonly ProviderId[];
38
+ export declare function supportsProfiles(provider: ProviderId): boolean;
39
+ /**
40
+ * The env a spawned agent needs to run under `configDir`, or `{}` for the default profile.
41
+ *
42
+ * `{}` is load-bearing, not a convenience: `buildChildEnv` applies `extraEnv` AFTER its allowlist
43
+ * and so bypasses it entirely, which makes this function the only thing standing between a
44
+ * profile and the child environment. Returning nothing for the zero-config case means the
45
+ * overwhelmingly common path adds literally no variable — the same environment cezar has always
46
+ * spawned. It also means this can never emit one provider's variable for another provider's
47
+ * process: the name comes from `PROFILE_ENV_VAR[provider]` and nowhere else.
48
+ */
49
+ export declare function profileEnv(provider: ProviderId, configDir: string | null | undefined): Record<string, string>;
50
+ /**
51
+ * Does `entries` look like a config dir this provider actually wrote?
52
+ *
53
+ * ADVISORY, never a gate. The honest first-run flow for a second account is *add the profile →
54
+ * Connect → the CLI creates the dir on login*, so refusing an unrecognized directory would break
55
+ * the very case the feature exists for. The answer drives a warning line in the UI, nothing more.
56
+ *
57
+ * Takes the directory listing rather than a path so it stays pure; the caller reads the dir.
58
+ */
59
+ export declare function looksLikeProfileDir(provider: ProviderId, entries: readonly string[]): boolean;