@open-mercato/cezar 0.9.1 → 0.9.2-pr780.1061

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 (352) hide show
  1. package/README.md +29 -11
  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 +1593 -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 +1239 -0
  63. package/dist/contract/skills.d.ts +227 -0
  64. package/dist/contract/workflows.d.ts +212 -0
  65. package/dist/contract/workspace.d.ts +470 -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/git-diff-base.d.ts +60 -0
  119. package/dist/git-diff-base.js +54 -0
  120. package/dist/git-diff-base.js.map +1 -0
  121. package/dist/git-worktree.d.ts +37 -6
  122. package/dist/git-worktree.js +39 -9
  123. package/dist/git-worktree.js.map +1 -1
  124. package/dist/handoff.d.ts +2 -2
  125. package/dist/handoff.js +1 -1
  126. package/dist/index.js +65 -8
  127. package/dist/index.js.map +1 -1
  128. package/dist/paths.d.ts +69 -6
  129. package/dist/paths.js +86 -9
  130. package/dist/paths.js.map +1 -1
  131. package/dist/planner.d.ts +2 -2
  132. package/dist/planner.js +7 -1
  133. package/dist/planner.js.map +1 -1
  134. package/dist/release/manifests.d.ts +81 -0
  135. package/dist/release/manifests.js +74 -0
  136. package/dist/release/manifests.js.map +1 -0
  137. package/dist/release/snapshot.d.ts +9 -23
  138. package/dist/release/snapshot.js +9 -22
  139. package/dist/release/snapshot.js.map +1 -1
  140. package/dist/release/stable.d.ts +15 -29
  141. package/dist/release/stable.js +14 -27
  142. package/dist/release/stable.js.map +1 -1
  143. package/dist/runs/auto-name.d.ts +1 -1
  144. package/dist/runs/auto-name.js +6 -1
  145. package/dist/runs/auto-name.js.map +1 -1
  146. package/dist/runs/retention.d.ts +1 -1
  147. package/dist/runs/store.d.ts +147 -336
  148. package/dist/runs/store.js +148 -9
  149. package/dist/runs/store.js.map +1 -1
  150. package/dist/runs/ui-event-sink.d.ts +1 -1
  151. package/dist/server/app-type.d.ts +21 -0
  152. package/dist/server/app-type.js +2 -0
  153. package/dist/server/app-type.js.map +1 -0
  154. package/dist/server/capabilities.d.ts +6 -5
  155. package/dist/server/capabilities.js +11 -0
  156. package/dist/server/capabilities.js.map +1 -1
  157. package/dist/server/forge/github.d.ts +58 -151
  158. package/dist/server/forge/github.js +530 -6
  159. package/dist/server/forge/github.js.map +1 -1
  160. package/dist/server/forge/index.d.ts +10 -3
  161. package/dist/server/forge/index.js +14 -1
  162. package/dist/server/forge/index.js.map +1 -1
  163. package/dist/server/forge/types.d.ts +86 -1
  164. package/dist/server/git-changes.d.ts +8 -8
  165. package/dist/server/git-changes.js +14 -17
  166. package/dist/server/git-changes.js.map +1 -1
  167. package/dist/server/git.d.ts +2 -0
  168. package/dist/server/git.js +9 -0
  169. package/dist/server/git.js.map +1 -1
  170. package/dist/server/github.d.ts +3 -3
  171. package/dist/server/github.js +1 -1
  172. package/dist/server/github.js.map +1 -1
  173. package/dist/server/open-in-terminal.d.ts +8 -1
  174. package/dist/server/open-in-terminal.js +16 -8
  175. package/dist/server/open-in-terminal.js.map +1 -1
  176. package/dist/server/pr.d.ts +2 -2
  177. package/dist/server/project-context.d.ts +20 -3
  178. package/dist/server/project-context.js +30 -1
  179. package/dist/server/project-context.js.map +1 -1
  180. package/dist/server/provider-action-gate.d.ts +8 -0
  181. package/dist/server/provider-action-gate.js +54 -0
  182. package/dist/server/provider-action-gate.js.map +1 -0
  183. package/dist/server/provider-auth-runtime.d.ts +21 -0
  184. package/dist/server/provider-auth-runtime.js +66 -0
  185. package/dist/server/provider-auth-runtime.js.map +1 -0
  186. package/dist/server/server.d.ts +11958 -47
  187. package/dist/server/server.js +2612 -923
  188. package/dist/server/server.js.map +1 -1
  189. package/dist/server/validators.d.ts +97 -0
  190. package/dist/server/validators.js +86 -0
  191. package/dist/server/validators.js.map +1 -0
  192. package/dist/server/ws.d.ts +2 -2
  193. package/dist/server/ws.js +2 -2
  194. package/dist/server/ws.js.map +1 -1
  195. package/dist/server-install/engine.d.ts +1 -1
  196. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  197. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  198. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  199. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  200. package/dist/server-install/state.d.ts +1 -1
  201. package/dist/server-install/steps.d.ts +2 -2
  202. package/dist/server-install/strategies.d.ts +1 -1
  203. package/dist/server-install/types.d.ts +38 -424
  204. package/dist/server-install/ui.d.ts +1 -1
  205. package/dist/skills-banner.d.ts +7 -6
  206. package/dist/skills-banner.js +7 -6
  207. package/dist/skills-banner.js.map +1 -1
  208. package/dist/skills-remote.d.ts +2 -2
  209. package/dist/skills-update.d.ts +88 -0
  210. package/dist/skills-update.js +392 -0
  211. package/dist/skills-update.js.map +1 -0
  212. package/dist/skills.d.ts +2 -0
  213. package/dist/skills.js +7 -2
  214. package/dist/skills.js.map +1 -1
  215. package/dist/todos.d.ts +2 -28
  216. package/dist/todos.js +1 -1
  217. package/dist/ui-state.d.ts +16 -2
  218. package/dist/ui-state.js +14 -1
  219. package/dist/ui-state.js.map +1 -1
  220. package/dist/workflows/load.d.ts +1 -1
  221. package/dist/workflows/run.d.ts +76 -12
  222. package/dist/workflows/run.js +528 -71
  223. package/dist/workflows/run.js.map +1 -1
  224. package/dist/workflows/types.d.ts +59 -224
  225. package/dist/workflows/types.js +14 -0
  226. package/dist/workflows/types.js.map +1 -1
  227. package/dist/workspace/agent-accounts.d.ts +149 -0
  228. package/dist/workspace/agent-accounts.js +303 -0
  229. package/dist/workspace/agent-accounts.js.map +1 -0
  230. package/dist/workspace/agent-profiles.d.ts +78 -0
  231. package/dist/workspace/agent-profiles.js +115 -0
  232. package/dist/workspace/agent-profiles.js.map +1 -0
  233. package/dist/workspace/config.d.ts +81 -206
  234. package/dist/workspace/config.js +175 -14
  235. package/dist/workspace/config.js.map +1 -1
  236. package/dist/workspace/migrations.d.ts +1 -1
  237. package/dist/workspace/migrations.js +19 -4
  238. package/dist/workspace/migrations.js.map +1 -1
  239. package/dist/workspace/projects.d.ts +8 -2
  240. package/dist/workspace/projects.js +9 -3
  241. package/dist/workspace/projects.js.map +1 -1
  242. package/dist/workspace/semaphore.d.ts +6 -0
  243. package/dist/workspace/semaphore.js +14 -1
  244. package/dist/workspace/semaphore.js.map +1 -1
  245. package/dist/workspace/ui-state.d.ts +13 -3
  246. package/dist/workspace/ui-state.js +15 -5
  247. package/dist/workspace/ui-state.js.map +1 -1
  248. package/package.json +17 -39
  249. package/scripts/inline-contract.mjs +112 -0
  250. package/scripts/mock-claude.mjs +39 -1
  251. package/scripts/sync-readme.mjs +20 -0
  252. package/web/dist/assets/alert-dialog-CCX7vbLv.js +1 -0
  253. package/web/dist/assets/arrow-down-DXSvIdBy.js +1 -0
  254. package/web/dist/assets/arrow-left-CH1QDJ9J.js +1 -0
  255. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  256. package/web/dist/assets/centered-state-CXI997hI.js +43 -0
  257. package/web/dist/assets/chevron-right-Djmw1pir.js +1 -0
  258. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  259. package/web/dist/assets/circle-check-DJRWwnU0.js +1 -0
  260. package/web/dist/assets/circle-x-aJMtmDfr.js +1 -0
  261. package/web/dist/assets/collapsible-Btoo8CMa.js +1 -0
  262. package/web/dist/assets/commit-list-Cj3KHeTw.js +1 -0
  263. package/web/dist/assets/compare-variants-twOpd5eU.js +1 -0
  264. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  265. package/web/dist/assets/diff-DEY8e-KQ.js +3 -0
  266. package/web/dist/assets/diff-stat-Coewcn_A.js +1 -0
  267. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-DmqZuw0o.js} +4 -4
  268. package/web/dist/assets/dropdown-menu-C4IVZ4Cy.js +1 -0
  269. package/web/dist/assets/editable-title-B5Nz9Ifq.js +1 -0
  270. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-CFm090OY.js} +1 -1
  271. package/web/dist/assets/{file-D4GBh1ao.js → file-ChFcXCdF.js} +1 -1
  272. package/web/dist/assets/folder-JGQS95UK.js +1 -0
  273. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-5QyNQHb4.js} +1 -1
  274. package/web/dist/assets/git-toolbar-BSAiDPXd.js +1 -0
  275. package/web/dist/assets/github-DnS2irZI.js +1 -0
  276. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  277. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  278. package/web/dist/assets/image-preview-DmcNMtBK.js +1 -0
  279. package/web/dist/assets/index-B84F80Q8.css +2 -0
  280. package/web/dist/assets/index-BohAT06J.js +6 -0
  281. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  282. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  283. package/web/dist/assets/markdown-DFnhId9R.js +2 -0
  284. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  285. package/web/dist/assets/new-task-form-Dem8-EfF.js +1 -0
  286. package/web/dist/assets/pill-Bughljxv.js +1 -0
  287. package/web/dist/assets/project-router-DBpBMLHW.js +1 -0
  288. package/web/dist/assets/prompt-templates-Cj7wWXn2.js +15 -0
  289. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  290. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-BWZQNIR7.js} +1 -1
  291. package/web/dist/assets/repo-git-Dhm-EROZ.js +1 -0
  292. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  293. package/web/dist/assets/run-diff-CXcSp_gT.js +3 -0
  294. package/web/dist/assets/run-header-CRr16SfL.js +1 -0
  295. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-BIhOTY_E.js} +1 -1
  296. package/web/dist/assets/skill-empty-hint-BN_ePNxo.js +1 -0
  297. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  298. package/web/dist/assets/skills-Cxj8xuN8.js +1 -0
  299. package/web/dist/assets/sparkles-CZEWgaOW.js +1 -0
  300. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-B4KCKyUb.js} +1 -1
  301. package/web/dist/assets/tab-link-CYoA7evO.js +1 -0
  302. package/web/dist/assets/task-changes-BRkjXilr.js +1 -0
  303. package/web/dist/assets/task-commits-Bs8tVHdp.js +1 -0
  304. package/web/dist/assets/task-files-B83mmDc7.js +2 -0
  305. package/web/dist/assets/task-thread-B8SnpMda.js +9 -0
  306. package/web/dist/assets/textarea-GBSG043_.js +1 -0
  307. package/web/dist/assets/thread-loading-D-W1aDRr.js +1 -0
  308. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-DscaMdyt.js} +1 -1
  309. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-DG4Zrdw_.js} +1 -1
  310. package/web/dist/assets/{upload-CDdyPPo_.js → upload-V_HWlzmF.js} +1 -1
  311. package/web/dist/assets/use-desktop-BeTfs42t.js +1 -0
  312. package/web/dist/assets/use-submit-shortcut-ceAGZrbH.js +1 -0
  313. package/web/dist/assets/utils-Dh89nMsg.js +64 -0
  314. package/web/dist/assets/workflows-LuXn4DOU.js +11 -0
  315. package/web/dist/assets/zoomable-image-DBPkskS9.js +1 -0
  316. package/web/dist/index.html +33 -13
  317. package/scripts/dev.mjs +0 -74
  318. package/scripts/release-snapshot.mjs +0 -130
  319. package/scripts/release.mjs +0 -119
  320. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  321. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  322. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  323. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  324. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  325. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  326. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  327. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  328. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  329. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  330. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  331. package/web/dist/assets/index-DzroxqBG.css +0 -2
  332. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  333. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  334. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  335. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  336. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  337. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  338. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  339. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  340. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  341. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  342. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  343. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  344. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  345. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  346. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  347. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  348. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  349. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  350. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  351. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  352. /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
package/dist/todos.js CHANGED
@@ -121,7 +121,7 @@ export async function removeTodo(dataDir, id) {
121
121
  /** The task text "▶ Run" turns an entry into: the suggested prompt (or the summary when the
122
122
  * entry carries none), plus the suggested args as a trailing line. The single server-side
123
123
  * source for `POST /api/todos/:id/start`; the cockpit's prefill copy
124
- * (`web/app/src/routes/inbox.tsx`, #374) lives in another process and cannot import this, so
124
+ * (`packages/web/src/routes/inbox.tsx`, #374) lives in another process and cannot import this, so
125
125
  * the two are pinned to the shared cases in `test/fixtures/todo-task-text.json`. */
126
126
  export function todoTaskText(todo) {
127
127
  let task = (todo.suggestedPrompt ?? todo.summary).trim() || todo.summary;
@@ -1,3 +1,4 @@
1
+ import type { UiState } from './contract/index.js';
1
2
  /**
2
3
  * `.ai/cezar/ui-state.json` — small GUI preferences the cockpit persists (files, not a DB).
3
4
  * The server owns the schema and the writes (`PUT /api/ui-state` in `src/server/server.ts`);
@@ -8,5 +9,18 @@
8
9
  * `{}` — an absent preference, never a throw, never a blocked startup.
9
10
  */
10
11
  export declare function uiStatePath(repoRoot: string): string;
11
- /** Read `ui-state.json` on demand — never cached, never throws. */
12
- export declare function readUiState(repoRoot: string): Promise<Record<string, unknown>>;
12
+ /**
13
+ * Read `ui-state.json` on demand — never cached, never throws.
14
+ *
15
+ * Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
16
+ * value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
17
+ * per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
18
+ * `z.looseObject`, so the index signature (and with it the round-trip promise of
19
+ * BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
20
+ *
21
+ * The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
22
+ * through the schema, because a single malformed pref must not discard the whole bag (§3). What
23
+ * the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
24
+ * by `uiStateBody`) is what actually enforces it.
25
+ */
26
+ export declare function readUiState(repoRoot: string): Promise<UiState>;
package/dist/ui-state.js CHANGED
@@ -12,7 +12,20 @@ import { join } from 'node:path';
12
12
  export function uiStatePath(repoRoot) {
13
13
  return join(repoRoot, '.ai/cezar', 'ui-state.json');
14
14
  }
15
- /** Read `ui-state.json` on demand — never cached, never throws. */
15
+ /**
16
+ * Read `ui-state.json` on demand — never cached, never throws.
17
+ *
18
+ * Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
19
+ * value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
20
+ * per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
21
+ * `z.looseObject`, so the index signature (and with it the round-trip promise of
22
+ * BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
23
+ *
24
+ * The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
25
+ * through the schema, because a single malformed pref must not discard the whole bag (§3). What
26
+ * the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
27
+ * by `uiStateBody`) is what actually enforces it.
28
+ */
16
29
  export async function readUiState(repoRoot) {
17
30
  try {
18
31
  const parsed = JSON.parse(await readFile(uiStatePath(repoRoot), 'utf8'));
@@ -1 +1 @@
1
- {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type WorkflowDef } from './types.js';
1
+ import { type WorkflowDef } from './types.ts';
2
2
  export declare const WORKFLOWS_DIR = ".ai/cezar/workflows";
3
3
  export interface WorkflowLoadIssue {
4
4
  path: string;
@@ -1,9 +1,9 @@
1
- import type { RunnerId } from '../core/agent-runner.js';
2
- import type { ContentBlock } from '../core/agent-runner.js';
3
- import { type Skill } from '../skills.js';
4
- import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.js';
5
- import { WorkspaceSemaphore } from '../workspace/semaphore.js';
6
- import { type WorkflowDef } from './types.js';
1
+ import type { RunnerId } from '../core/agent-runner.ts';
2
+ import type { ContentBlock } from '../core/agent-runner.ts';
3
+ import { type Skill } from '../skills.ts';
4
+ import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.ts';
5
+ import { WorkspaceSemaphore } from '../workspace/semaphore.ts';
6
+ import { type WorkflowDef } from './types.ts';
7
7
  /** An interactive session that hears nothing from the user closes itself. */
8
8
  export declare const IDLE_TIMEOUT_MS: number;
9
9
  /**
@@ -25,6 +25,10 @@ export interface StartRunInput {
25
25
  model?: string;
26
26
  /** Agent backend chosen for this task (GUI). Unset = the config default. */
27
27
  runner?: RunnerId;
28
+ /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
29
+ * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
30
+ * survives into resume and Continue, and so the thread can say which account did the work. */
31
+ agentProfile?: string;
28
32
  /** Screenshots pasted into the new-task form — persisted when the run is
29
33
  * created and delivered once, with the first agent step's opening message. */
30
34
  images?: ContentBlock[];
@@ -33,9 +37,8 @@ export interface StartRunInput {
33
37
  * `resolveExtraSystemPrompt` for the precedence contract. */
34
38
  systemPrompt?: string;
35
39
  /** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
36
- * working tree instead of an isolated worktree — for read-only skills that
37
- * don't need a branch. Undefined/`true` keeps the default per-task worktree.
38
- * Ignored for variants (they always isolate). */
40
+ * working tree instead of an isolated worktree. Undefined/`true` keeps the
41
+ * default per-task worktree. Ignored for variants (they always isolate). */
39
42
  worktree?: boolean;
40
43
  /** Autonomous mode (#autonomous): the run never parks at `waiting` for the
41
44
  * user — turn-ends auto-continue until the agent signals done or the safety
@@ -123,7 +126,13 @@ export declare class RunManager {
123
126
  private readonly queue;
124
127
  private readonly starting;
125
128
  private readonly waiting;
129
+ /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
130
+ private readonly monitoring;
126
131
  private readonly pendingJobs;
132
+ /** Interrupted agent turns recovered after a process restart. Unlike an
133
+ * explicit user Continue, these are bulk scheduler work and must re-enter
134
+ * through `pump()` so both workspace and per-project caps are honored. */
135
+ private readonly pendingContinuations;
127
136
  /** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
128
137
  * the manager rather than the `ActiveRun` so a *queued* run — which has no
129
138
  * `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
@@ -188,6 +197,25 @@ export declare class RunManager {
188
197
  * write follow-ups into the parent's inbox despite the opt-out. Empty is the
189
198
  * established "absent" spelling — consumers guard with `if (todosFile)`. */
190
199
  private agentEnv;
200
+ /**
201
+ * `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
202
+ * 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
203
+ *
204
+ * Resolved per step, not per run, because a workflow can mix backends: an override naming a
205
+ * Claude account says nothing about which Codex account a codex step should use. Resolution
206
+ * order, most specific first:
207
+ *
208
+ * 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
209
+ * account that created the session, whatever the project has since been switched to;
210
+ * 2. the run's composer override, but only for steps on the run's own runner;
211
+ * 3. the project's stored selection, and failing that the discovered default.
212
+ *
213
+ * Read fresh every time. `~/.cezar/config.json` is shared by every cezar process on this
214
+ * machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
215
+ * spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
216
+ * exactly the behaviour that predates profiles.
217
+ */
218
+ private agentEnvForStep;
191
219
  startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
192
220
  groupId: string;
193
221
  variant: string;
@@ -295,12 +323,18 @@ export declare class RunManager {
295
323
  * bound — asserted directly by a test.
296
324
  */
297
325
  private hydrateQueuedInput;
326
+ /** Apply edits and messages made while a restart continuation waits for
327
+ * capacity. The durable record remains the source of truth, just as it is for
328
+ * an ordinary queued workflow (#472), so a second restart reconstructs and
329
+ * hydrates the same amendments instead of dropping them. */
330
+ private hydrateQueuedContinuation;
331
+ private readPersistedImages;
298
332
  /**
299
333
  * Still waiting for a slot? Checked against the engine's own queue rather than
300
334
  * the record's `status` (#472): the record is written by `execute()` a tick
301
335
  * after `pump()` dequeues, so a status read can see `queued` for a run that has
302
- * already started. `pendingJobs` is deleted synchronously at dequeue, so it is
303
- * the authoritative answer for "can this prompt still be amended".
336
+ * already started. The pending maps are deleted synchronously at dequeue, so
337
+ * they are the authoritative answer for "can this prompt still be amended".
304
338
  */
305
339
  private isQueued;
306
340
  /** Split `ContentBlock[]` into the persisted shape a stacked message holds. */
@@ -351,6 +385,9 @@ export declare class RunManager {
351
385
  * then offers "Continue" instead.
352
386
  */
353
387
  sendMessage(runId: string, content: ContentBlock[]): boolean;
388
+ /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
389
+ * bookkeeping without masquerading as user-authored transcript messages. */
390
+ private deliverMessage;
354
391
  /** Close the open session gracefully — the run then completes as `done`
355
392
  * (or rests at `review` when the worktree holds changes, spec 009).
356
393
  * On a run already resting at `review` (no session — the engine loop is
@@ -368,7 +405,10 @@ export declare class RunManager {
368
405
  images?: ContentBlock[];
369
406
  runner?: RunnerId;
370
407
  model?: string;
371
- }): {
408
+ },
409
+ /** Restart recovery may discover several interrupted tasks at once. Those
410
+ * continuations are queued; an explicit user Continue remains immediate. */
411
+ deferForCapacity?: boolean): {
372
412
  ok: boolean;
373
413
  error?: string;
374
414
  };
@@ -389,6 +429,17 @@ export declare class RunManager {
389
429
  /** Native backend asks arrive before turn-end. Persist and park immediately
390
430
  * so the cockpit shows attention and the run releases its workspace slot. */
391
431
  private handleRunnerUiEvent;
432
+ /** Persist the invocation checkpoint before launching a runner. A throw or
433
+ * process exit before `turn.started` therefore leaves a durable mismatch. */
434
+ private beginUsageInvocation;
435
+ /** Fold backend-neutral completed-turn usage into the current step exactly
436
+ * once. Invocation/turn counters are written before the event reaches the
437
+ * NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
438
+ private recordUsageUiEvent;
439
+ /** Usage completeness is a crash boundary, unlike high-frequency token
440
+ * snapshots: the checkpoint must reach `runs.json` before the runner starts
441
+ * or the matching UI event is persisted and forwarded. */
442
+ private persistUsageCheckpoint;
392
443
  /**
393
444
  * Turn-end bookkeeping (#389), shared by `runAgentStep` and
394
445
  * `runContinuation` — called (fire-and-forget) from every `turn-end` event:
@@ -464,6 +515,9 @@ export declare class RunManager {
464
515
  private persistImage;
465
516
  private armIdleTimer;
466
517
  private clearIdleTimer;
518
+ private reconcileMonitoringWakeTimers;
519
+ private armMonitoringWakeTimer;
520
+ private clearMonitoringWakeTimer;
467
521
  /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
468
522
  * Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
469
523
  private armAutosave;
@@ -492,3 +546,13 @@ export declare function makeRunTitle(task: string, workflow: WorkflowDef): strin
492
546
  * they are materialized into the worktree separately (see the call site).
493
547
  */
494
548
  export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
549
+ /**
550
+ * Expand a registry-backed slash skill in a live chat message before it reaches
551
+ * a backend. Claude otherwise intercepts an unknown leading slash command, and
552
+ * Codex/OpenCode have no native slash-skill lookup at all (#676).
553
+ *
554
+ * Only the first text block is eligible, only at character zero, and unknown
555
+ * commands pass through byte-for-byte. The caller persists the original user
556
+ * content before applying this delivery-only rewrite.
557
+ */
558
+ export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];