@open-mercato/cezar 0.9.1 → 0.9.2-pr773.1068

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 (358) 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 +1640 -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 +1347 -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 +472 -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/run-index.d.ts +19 -0
  151. package/dist/runs/run-index.js +43 -0
  152. package/dist/runs/run-index.js.map +1 -0
  153. package/dist/runs/store.d.ts +169 -343
  154. package/dist/runs/store.js +223 -34
  155. package/dist/runs/store.js.map +1 -1
  156. package/dist/runs/ui-event-sink.d.ts +1 -1
  157. package/dist/server/app-type.d.ts +21 -0
  158. package/dist/server/app-type.js +2 -0
  159. package/dist/server/app-type.js.map +1 -0
  160. package/dist/server/capabilities.d.ts +6 -5
  161. package/dist/server/capabilities.js +11 -0
  162. package/dist/server/capabilities.js.map +1 -1
  163. package/dist/server/forge/github.d.ts +58 -151
  164. package/dist/server/forge/github.js +530 -6
  165. package/dist/server/forge/github.js.map +1 -1
  166. package/dist/server/forge/index.d.ts +10 -3
  167. package/dist/server/forge/index.js +14 -1
  168. package/dist/server/forge/index.js.map +1 -1
  169. package/dist/server/forge/types.d.ts +86 -1
  170. package/dist/server/git-changes.d.ts +8 -8
  171. package/dist/server/git-changes.js +14 -17
  172. package/dist/server/git-changes.js.map +1 -1
  173. package/dist/server/git.d.ts +2 -0
  174. package/dist/server/git.js +9 -0
  175. package/dist/server/git.js.map +1 -1
  176. package/dist/server/github.d.ts +3 -3
  177. package/dist/server/github.js +1 -1
  178. package/dist/server/github.js.map +1 -1
  179. package/dist/server/open-in-terminal.d.ts +8 -1
  180. package/dist/server/open-in-terminal.js +16 -8
  181. package/dist/server/open-in-terminal.js.map +1 -1
  182. package/dist/server/pr.d.ts +2 -2
  183. package/dist/server/project-context.d.ts +20 -3
  184. package/dist/server/project-context.js +30 -1
  185. package/dist/server/project-context.js.map +1 -1
  186. package/dist/server/provider-action-gate.d.ts +8 -0
  187. package/dist/server/provider-action-gate.js +54 -0
  188. package/dist/server/provider-action-gate.js.map +1 -0
  189. package/dist/server/provider-auth-runtime.d.ts +21 -0
  190. package/dist/server/provider-auth-runtime.js +66 -0
  191. package/dist/server/provider-auth-runtime.js.map +1 -0
  192. package/dist/server/server.d.ts +12078 -47
  193. package/dist/server/server.js +2700 -910
  194. package/dist/server/server.js.map +1 -1
  195. package/dist/server/validators.d.ts +97 -0
  196. package/dist/server/validators.js +86 -0
  197. package/dist/server/validators.js.map +1 -0
  198. package/dist/server/ws.d.ts +2 -2
  199. package/dist/server/ws.js +2 -2
  200. package/dist/server/ws.js.map +1 -1
  201. package/dist/server-install/engine.d.ts +1 -1
  202. package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
  203. package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
  204. package/dist/server-install/platforms/ubuntu-vps.js +83 -1
  205. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  206. package/dist/server-install/state.d.ts +1 -1
  207. package/dist/server-install/steps.d.ts +2 -2
  208. package/dist/server-install/strategies.d.ts +1 -1
  209. package/dist/server-install/types.d.ts +38 -424
  210. package/dist/server-install/ui.d.ts +1 -1
  211. package/dist/skills-banner.d.ts +7 -6
  212. package/dist/skills-banner.js +7 -6
  213. package/dist/skills-banner.js.map +1 -1
  214. package/dist/skills-remote.d.ts +2 -2
  215. package/dist/skills-update.d.ts +88 -0
  216. package/dist/skills-update.js +392 -0
  217. package/dist/skills-update.js.map +1 -0
  218. package/dist/skills.d.ts +2 -0
  219. package/dist/skills.js +7 -2
  220. package/dist/skills.js.map +1 -1
  221. package/dist/todos.d.ts +2 -28
  222. package/dist/todos.js +1 -1
  223. package/dist/ui-state.d.ts +16 -2
  224. package/dist/ui-state.js +14 -1
  225. package/dist/ui-state.js.map +1 -1
  226. package/dist/workflows/load.d.ts +1 -1
  227. package/dist/workflows/run.d.ts +238 -12
  228. package/dist/workflows/run.js +1103 -115
  229. package/dist/workflows/run.js.map +1 -1
  230. package/dist/workflows/types.d.ts +59 -224
  231. package/dist/workflows/types.js +14 -0
  232. package/dist/workflows/types.js.map +1 -1
  233. package/dist/workspace/agent-accounts.d.ts +149 -0
  234. package/dist/workspace/agent-accounts.js +303 -0
  235. package/dist/workspace/agent-accounts.js.map +1 -0
  236. package/dist/workspace/agent-profiles.d.ts +78 -0
  237. package/dist/workspace/agent-profiles.js +115 -0
  238. package/dist/workspace/agent-profiles.js.map +1 -0
  239. package/dist/workspace/config.d.ts +82 -206
  240. package/dist/workspace/config.js +183 -14
  241. package/dist/workspace/config.js.map +1 -1
  242. package/dist/workspace/migrations.d.ts +1 -1
  243. package/dist/workspace/migrations.js +19 -4
  244. package/dist/workspace/migrations.js.map +1 -1
  245. package/dist/workspace/projects.d.ts +8 -2
  246. package/dist/workspace/projects.js +9 -3
  247. package/dist/workspace/projects.js.map +1 -1
  248. package/dist/workspace/semaphore.d.ts +45 -0
  249. package/dist/workspace/semaphore.js +45 -1
  250. package/dist/workspace/semaphore.js.map +1 -1
  251. package/dist/workspace/ui-state.d.ts +13 -3
  252. package/dist/workspace/ui-state.js +15 -5
  253. package/dist/workspace/ui-state.js.map +1 -1
  254. package/package.json +17 -39
  255. package/scripts/inline-contract.mjs +112 -0
  256. package/scripts/mock-claude.mjs +59 -1
  257. package/scripts/sync-readme.mjs +20 -0
  258. package/web/dist/assets/alert-dialog-DgGXiX0-.js +1 -0
  259. package/web/dist/assets/arrow-down-CVWn39DB.js +1 -0
  260. package/web/dist/assets/arrow-left-CytehkvJ.js +1 -0
  261. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  262. package/web/dist/assets/centered-state-BWu9EZeH.js +43 -0
  263. package/web/dist/assets/chevron-right-Bn2cprQo.js +1 -0
  264. package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
  265. package/web/dist/assets/circle-check-C9dg0Lwg.js +1 -0
  266. package/web/dist/assets/circle-x-HJMlr00g.js +1 -0
  267. package/web/dist/assets/collapsible-CW__roLv.js +1 -0
  268. package/web/dist/assets/commit-list-D-ZJT7xL.js +1 -0
  269. package/web/dist/assets/compare-variants-B_P9w6Pa.js +1 -0
  270. package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
  271. package/web/dist/assets/diff-CutJnvjv.js +3 -0
  272. package/web/dist/assets/diff-stat-DFXP90Vc.js +1 -0
  273. package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-BWuBSVFT.js} +4 -4
  274. package/web/dist/assets/dropdown-menu-D2A2pGjJ.js +1 -0
  275. package/web/dist/assets/editable-title-C6a64Vwp.js +1 -0
  276. package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-vx7lL0mm.js} +1 -1
  277. package/web/dist/assets/{file-D4GBh1ao.js → file-DAIQGWQp.js} +1 -1
  278. package/web/dist/assets/folder-BvhNOUoH.js +1 -0
  279. package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-CymF90c4.js} +1 -1
  280. package/web/dist/assets/git-toolbar-Db-_fahh.js +1 -0
  281. package/web/dist/assets/github-C3d-_ewX.js +1 -0
  282. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  283. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  284. package/web/dist/assets/image-preview-DsqvjJhH.js +1 -0
  285. package/web/dist/assets/index-cLI08SdE.css +2 -0
  286. package/web/dist/assets/index-e2WSiiVD.js +6 -0
  287. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  288. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  289. package/web/dist/assets/markdown-v5x5LE3s.js +2 -0
  290. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  291. package/web/dist/assets/new-task-form-DAqGlabw.js +1 -0
  292. package/web/dist/assets/pill-AwEgoqpU.js +1 -0
  293. package/web/dist/assets/project-router-CLFUa8om.js +1 -0
  294. package/web/dist/assets/prompt-templates-DhV3gn9A.js +15 -0
  295. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  296. package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-D3EzHdHY.js} +1 -1
  297. package/web/dist/assets/repo-git-BidLXJPd.js +1 -0
  298. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  299. package/web/dist/assets/run-diff-D7nsnTW9.js +3 -0
  300. package/web/dist/assets/run-header-CTsQn0Xg.js +1 -0
  301. package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-B5IWjGTy.js} +1 -1
  302. package/web/dist/assets/skill-empty-hint-Cc3J-Vw9.js +1 -0
  303. package/web/dist/assets/skills-BiWfHmCR.js +1 -0
  304. package/web/dist/assets/skills-eu1MYWhp.js +1 -0
  305. package/web/dist/assets/sparkles-CfUE1-C7.js +1 -0
  306. package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-D2wOSwur.js} +1 -1
  307. package/web/dist/assets/tab-link-gfQ-aL-o.js +1 -0
  308. package/web/dist/assets/task-changes-5CfU8f_H.js +1 -0
  309. package/web/dist/assets/task-commits-Dav8UN6F.js +1 -0
  310. package/web/dist/assets/task-files-BxmqQ-gr.js +2 -0
  311. package/web/dist/assets/task-thread-DPZQ_MH3.js +9 -0
  312. package/web/dist/assets/textarea-DsfeVQQ3.js +1 -0
  313. package/web/dist/assets/thread-loading-u9UysgWm.js +1 -0
  314. package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-DgRtM_8B.js} +1 -1
  315. package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-rNmHpkue.js} +1 -1
  316. package/web/dist/assets/{upload-CDdyPPo_.js → upload-3tpzQ7VY.js} +1 -1
  317. package/web/dist/assets/use-desktop-D5epLJpa.js +1 -0
  318. package/web/dist/assets/use-submit-shortcut-CNJod3_0.js +1 -0
  319. package/web/dist/assets/utils-CNU1Tppw.js +64 -0
  320. package/web/dist/assets/workflows-DK43e7Ep.js +11 -0
  321. package/web/dist/assets/zoomable-image-DJH8H5T5.js +1 -0
  322. package/web/dist/index.html +33 -13
  323. package/scripts/dev.mjs +0 -74
  324. package/scripts/release-snapshot.mjs +0 -130
  325. package/scripts/release.mjs +0 -119
  326. package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
  327. package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
  328. package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
  329. package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
  330. package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
  331. package/web/dist/assets/dist-B6XQOhgM.js +0 -1
  332. package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
  333. package/web/dist/assets/github-DTTSG0ht.js +0 -1
  334. package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
  335. package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
  336. package/web/dist/assets/index-Cijmlz7q.js +0 -30
  337. package/web/dist/assets/index-DzroxqBG.css +0 -2
  338. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  339. package/web/dist/assets/lib-uHpeUPzK.js +0 -1
  340. package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
  341. package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
  342. package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
  343. package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
  344. package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
  345. package/web/dist/assets/run-header-Cg5incil.js +0 -1
  346. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  347. package/web/dist/assets/skills-PpP2owbM.js +0 -1
  348. package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
  349. package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
  350. package/web/dist/assets/task-commits-COkLaUri.js +0 -1
  351. package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
  352. package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
  353. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  354. package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
  355. package/web/dist/assets/utils-B8s5qIcK.js +0 -1
  356. package/web/dist/assets/workflows-BFk8C0co.js +0 -11
  357. package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
  358. /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
@@ -13,46 +13,41 @@ export type StepStatus = 'pending' | 'running' | 'waiting' | 'review' | 'done' |
13
13
  declare const stepStateSchema: z.ZodObject<{
14
14
  id: z.ZodString;
15
15
  name: z.ZodString;
16
- kind: z.ZodEnum<["agent", "check"]>;
17
- status: z.ZodEnum<["pending", "running", "waiting", "review", "done", "failed", "cancelled", "skipped"]>;
16
+ kind: z.ZodEnum<{
17
+ agent: "agent";
18
+ check: "check";
19
+ }>;
20
+ status: z.ZodEnum<{
21
+ cancelled: "cancelled";
22
+ done: "done";
23
+ failed: "failed";
24
+ pending: "pending";
25
+ review: "review";
26
+ running: "running";
27
+ skipped: "skipped";
28
+ waiting: "waiting";
29
+ }>;
18
30
  iterations: z.ZodNumber;
19
31
  tokensUsed: z.ZodNumber;
32
+ inputTokens: z.ZodOptional<z.ZodNumber>;
33
+ outputTokens: z.ZodOptional<z.ZodNumber>;
34
+ usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
35
+ usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
36
+ usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
37
+ usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
38
+ usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
20
39
  startedAt: z.ZodOptional<z.ZodString>;
21
40
  finishedAt: z.ZodOptional<z.ZodString>;
22
41
  error: z.ZodOptional<z.ZodString>;
23
- /** Latest backend-owned session id, used for same-backend Continue. */
24
42
  sessionId: z.ZodOptional<z.ZodString>;
25
- /** Backend that owns `sessionId`. Optional so pre-affinity runs.json files still parse. */
26
- backend: z.ZodOptional<z.ZodEnum<["claude", "codex", "opencode"]>>;
27
- /** Dollar cost reported by the claude CLI for this step's turns. */
43
+ backend: z.ZodOptional<z.ZodEnum<{
44
+ claude: "claude";
45
+ codex: "codex";
46
+ opencode: "opencode";
47
+ }>>;
48
+ profileId: z.ZodOptional<z.ZodString>;
28
49
  costUsd: z.ZodOptional<z.ZodNumber>;
29
- }, "strip", z.ZodTypeAny, {
30
- id: string;
31
- name: string;
32
- kind: "agent" | "check";
33
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
34
- iterations: number;
35
- tokensUsed: number;
36
- startedAt?: string | undefined;
37
- finishedAt?: string | undefined;
38
- error?: string | undefined;
39
- sessionId?: string | undefined;
40
- backend?: "claude" | "codex" | "opencode" | undefined;
41
- costUsd?: number | undefined;
42
- }, {
43
- id: string;
44
- name: string;
45
- kind: "agent" | "check";
46
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
47
- iterations: number;
48
- tokensUsed: number;
49
- startedAt?: string | undefined;
50
- finishedAt?: string | undefined;
51
- error?: string | undefined;
52
- sessionId?: string | undefined;
53
- backend?: "claude" | "codex" | "opencode" | undefined;
54
- costUsd?: number | undefined;
55
- }>;
50
+ }, z.core.$strip>;
56
51
  /** One prompt message stacked onto a run while it waits for a free agent slot
57
52
  * (#472). Folded into `{{task}}` at dequeue by `hydrateQueuedInput`; never
58
53
  * delivered as its own turn — a follow-up turn would reach only the first step
@@ -60,365 +55,169 @@ declare const stepStateSchema: z.ZodObject<{
60
55
  declare const queuedMessageSchema: z.ZodObject<{
61
56
  id: z.ZodString;
62
57
  text: z.ZodString;
63
- /** `/api/runs/:id/images/…` URLs — the base64 never enters `runs.json`. */
64
- images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
58
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
59
  createdAt: z.ZodString;
66
- }, "strip", z.ZodTypeAny, {
67
- id: string;
68
- text: string;
69
- images?: string[] | undefined;
70
- createdAt: string;
71
- }, {
72
- id: string;
73
- text: string;
74
- images?: string[] | undefined;
75
- createdAt: string;
76
- }>;
77
- declare const runRecordSchema: z.ZodObject<{
60
+ }, z.core.$strip>;
61
+ /** Exported for `./run-index.ts`, the read-only reader of the same file. Nothing else should
62
+ * parse `runs.json` — see `reconcileLoadedRun` for why a second parser is a correctness risk. */
63
+ export declare const runRecordSchema: z.ZodObject<{
78
64
  id: z.ZodString;
79
65
  title: z.ZodString;
80
- /** Display title (#389): the auto-derived summary of the first agent turn,
81
- * or the user's inline edit (`PATCH /api/runs/:id` sets it together with
82
- * `title` so edits always win). The UI shows `titleSummary ?? title`. */
83
66
  titleSummary: z.ZodOptional<z.ZodString>;
84
- /** `git diff --shortstat` of the worktree vs its base, refreshed on every
85
- * turn-end (#389) — what the quick list / table shows without a git call. */
86
67
  diffStat: z.ZodOptional<z.ZodObject<{
87
68
  adds: z.ZodNumber;
88
69
  dels: z.ZodNumber;
89
70
  files: z.ZodNumber;
90
- }, "strip", z.ZodTypeAny, {
91
- adds: number;
92
- dels: number;
93
- files: number;
94
- }, {
95
- adds: number;
96
- dels: number;
97
- files: number;
98
- }>>;
71
+ repointed: z.ZodOptional<z.ZodBoolean>;
72
+ }, z.core.$strip>>;
99
73
  workflow: z.ZodString;
100
74
  task: z.ZodString;
101
- /** Prompt messages stacked onto this run while it was queued (#472). Optional:
102
- * `undefined` on every pre-#472 record reads as an empty stack. Like `task`,
103
- * `text` is the user's own prompt and is replayed into `{{task}}`, so it is
104
- * deliberately NOT in `redactPatch`'s field list — scrubbing it would corrupt
105
- * the run the same way scrubbing `task` would. */
106
75
  queuedMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
76
  id: z.ZodString;
108
77
  text: z.ZodString;
109
- /** `/api/runs/:id/images/…` URLs — the base64 never enters `runs.json`. */
110
- images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
78
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
79
  createdAt: z.ZodString;
112
- }, "strip", z.ZodTypeAny, {
113
- id: string;
114
- text: string;
115
- images?: string[] | undefined;
116
- createdAt: string;
117
- }, {
118
- id: string;
119
- text: string;
120
- images?: string[] | undefined;
121
- createdAt: string;
122
- }>, "many">>;
123
- /** URLs of images attached to the initial task prompt, for the thread's first bubble
124
- * (#image-display) — persisted like agent screenshots, served from `/images/`. */
125
- taskImages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
+ }, z.core.$strip>>>;
81
+ taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
82
  model: z.ZodOptional<z.ZodString>;
127
- /** Canonical provider/model identity (#405) — the normalised `provider/model`
128
- * (e.g. `anthropic/claude-opus-4-8`) the run actually used, resolved from the
129
- * free-text `model` against the chosen runner. Additive and optional: pre-#405
130
- * records carry only `model`, and it stays the human/hand-edit surface; this
131
- * is the parseable identity cost attribution and reproducible replay key off. */
132
83
  modelIdentity: z.ZodOptional<z.ZodString>;
133
- /** Agent backend this run used — drives "open in CLI" resume command. */
134
- runner: z.ZodOptional<z.ZodEnum<["claude", "codex", "opencode"]>>;
135
- /** Echo of the extra system prompt this run actually used (R2): the
136
- * `POST /api/runs` override, or the `config.json` default it fell back to.
137
- * Deliberately NOT the full composed prompt — skill bodies and the handoff
138
- * contract are derivable from the persisted workflow and would bloat the
139
- * index. Resolved at execute time (a queued run picks up config edits). */
84
+ runner: z.ZodOptional<z.ZodEnum<{
85
+ claude: "claude";
86
+ codex: "codex";
87
+ opencode: "opencode";
88
+ }>>;
89
+ agentProfile: z.ZodOptional<z.ZodString>;
140
90
  systemPrompt: z.ZodOptional<z.ZodString>;
141
- /** Per-task follow-up inbox contract (spec 007, #444). Missing on old runs
142
- * means enabled — the historical behavior. */
143
91
  generateFollowups: z.ZodOptional<z.ZodBoolean>;
144
- /** Autonomous mode (#489): the run was started with the "autonomous" checkbox,
145
- * so it never parks at `waiting` (auto-nudge) and — once persisted here —
146
- * never parks at the terminal `review` gate either (`settleSuccess` + the
147
- * group-pick winner-park read it). Additive-safe: absent = falsy = not
148
- * autonomous. Set at creation from `WorkflowInput.autonomous`. */
149
92
  autonomous: z.ZodOptional<z.ZodBoolean>;
150
- status: z.ZodEnum<["queued", "running", "waiting", "review", "done", "failed", "cancelled"]>;
151
- /** Sub-state of `running` (spec 2026-07-18-subagent-monitoring-status, #490):
152
- * `monitoring` while the agent is still working on its own downstream work.
153
- * Optional/absent on old runs; cleared when the run resumes or ends. */
154
- activity: z.ZodOptional<z.ZodEnum<["monitoring"]>>;
93
+ automation: z.ZodOptional<z.ZodObject<{
94
+ automationId: z.ZodString;
95
+ automationRevision: z.ZodNumber;
96
+ receiptId: z.ZodString;
97
+ event: z.ZodString;
98
+ githubUrl: z.ZodString;
99
+ }, z.core.$strip>>;
100
+ status: z.ZodEnum<{
101
+ cancelled: "cancelled";
102
+ done: "done";
103
+ failed: "failed";
104
+ queued: "queued";
105
+ review: "review";
106
+ running: "running";
107
+ waiting: "waiting";
108
+ }>;
109
+ activity: z.ZodOptional<z.ZodEnum<{
110
+ monitoring: "monitoring";
111
+ }>>;
112
+ monitoringWakeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
113
+ monitoringWakeCapReached: z.ZodOptional<z.ZodBoolean>;
114
+ autoResumeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
115
+ autoResumeAttempts: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
155
116
  createdAt: z.ZodString;
156
117
  startedAt: z.ZodOptional<z.ZodString>;
157
118
  finishedAt: z.ZodOptional<z.ZodString>;
158
119
  tokensUsed: z.ZodNumber;
120
+ inputTokens: z.ZodOptional<z.ZodNumber>;
121
+ outputTokens: z.ZodOptional<z.ZodNumber>;
159
122
  costUsd: z.ZodOptional<z.ZodNumber>;
160
- /** First GitHub PR URL spotted in the transcript (the janitor trick). */
161
123
  pullRequestUrl: z.ZodOptional<z.ZodString>;
162
- /** The PR this task is ABOUT (#407, spec 2026-07-16-pr-autodiscovery):
163
- * auto-discovered from conversation references for tasks that work on an
164
- * existing PR (review/continue/merge). Display-only tier — `pullRequestUrl`
165
- * (the PR this task CREATED) always wins, and action gates ignore this. */
166
124
  referencedPullRequestUrl: z.ZodOptional<z.ZodString>;
167
- /** The PR/issue number this task is ABOUT (spec 2026-07-17-task-auto-naming):
168
- * regex-extracted from the task prompt, upgradable by the namer's
169
- * cross-checked output. Display tier — never gates actions. */
170
125
  prNumber: z.ZodOptional<z.ZodNumber>;
171
126
  issueNumber: z.ZodOptional<z.ZodNumber>;
172
- /** Provenance for an `issueNumber` seeded by referenced-issue discovery.
173
- * Persisted so ambiguity can revoke only the janitor's own value, including
174
- * after a restart. Any prompt, namer, or marker write clears this flag. */
175
127
  referencedIssueNumberSeeded: z.ZodOptional<z.ZodBoolean>;
176
- /** Who owns the display title: `user` (PATCH rename — never auto-overwritten),
177
- * `marker` (agent-declared via `CEZ:TITLE`, spec 2026-07-18-task-ref-markers —
178
- * beats the namer, silences live refresh) or `auto` (namer-owned — a later
179
- * namer result may replace it). Missing on old runs = legacy behavior (auto
180
- * fills only an unset titleSummary). Precedence: user > marker > auto. */
181
- titleOrigin: z.ZodOptional<z.ZodEnum<["user", "auto", "marker"]>>;
182
- /** References the agent itself declared via `CEZ:PR=` / `CEZ:ISSUE=` markers
183
- * (spec 2026-07-18-task-ref-markers). Presence of a kind makes it
184
- * authoritative: the namer may no longer write that kind, and a declared PR
185
- * owns the referenced tier's resolution. */
128
+ titleOrigin: z.ZodOptional<z.ZodEnum<{
129
+ auto: "auto";
130
+ marker: "marker";
131
+ user: "user";
132
+ }>>;
186
133
  markerRefs: z.ZodOptional<z.ZodObject<{
187
134
  pr: z.ZodOptional<z.ZodNumber>;
188
135
  issue: z.ZodOptional<z.ZodNumber>;
189
- }, "strip", z.ZodTypeAny, {
190
- pr?: number | undefined;
191
- issue?: number | undefined;
192
- }, {
193
- pr?: number | undefined;
194
- issue?: number | undefined;
195
- }>>;
196
- /** Distinct PR URLs spotted so far — the referenced tier's working set,
197
- * persisted so a resumed run keeps disambiguating against the full history
198
- * instead of re-adopting the next URL as "the only one". Capped. */
199
- referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
200
- /** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery):
201
- * auto-discovered from `github.com/…/issues/N` links in the conversation,
202
- * mirroring the referenced-PR tier. Display-only; never gates actions. */
136
+ }, z.core.$strip>>;
137
+ referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
138
  referencedIssueUrl: z.ZodOptional<z.ZodString>;
204
- /** Distinct issue URLs spotted so far — the referenced-issue working set,
205
- * persisted like `referencedPrCandidates`. Capped. */
206
- referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
207
- /** Task worktree (spec 006) — absent when the run executed in the repo root. */
139
+ referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ worktree: z.ZodOptional<z.ZodLiteral<false>>;
208
141
  worktreePath: z.ZodOptional<z.ZodString>;
209
- /** The task's own branch (`cez/<id8>`), created off `baseBranch`. */
210
142
  branch: z.ZodOptional<z.ZodString>;
211
- /** Branch (or commit, when HEAD was detached) the worktree was forked from. */
212
143
  baseBranch: z.ZodOptional<z.ZodString>;
213
- /** Set when count-based retention (#483) reclaimed this run's worktree
214
- * *directory* (the `cez/<id8>` branch is kept). Presence means "materialized
215
- * dir gone, recoverable via `git worktree add`"; it excludes the run from the
216
- * retention budget until the dir is re-materialized (resume clears it). */
217
144
  worktreeReclaimedAt: z.ZodOptional<z.ZodString>;
218
- /** Parallel variants (spec 010): tasks sharing a groupId are one group. */
219
145
  groupId: z.ZodOptional<z.ZodString>;
220
- /** Variant letter within the group — 'A' | 'B' | 'C' (kept as a string). */
221
146
  variant: z.ZodOptional<z.ZodString>;
222
- /** Peak resident memory (bytes) / process count observed across the run's
223
- * agent process trees (#348) — written when a session's telemetry ends.
224
- * Optional: old runs.json files and `ps`-less platforms have neither. */
225
147
  peakRssBytes: z.ZodOptional<z.ZodNumber>;
226
148
  peakProcCount: z.ZodOptional<z.ZodNumber>;
227
149
  archived: z.ZodDefault<z.ZodBoolean>;
228
150
  archivedAt: z.ZodOptional<z.ZodString>;
151
+ seenAt: z.ZodOptional<z.ZodString>;
229
152
  currentStepId: z.ZodOptional<z.ZodString>;
230
153
  error: z.ZodOptional<z.ZodString>;
231
154
  steps: z.ZodArray<z.ZodObject<{
232
155
  id: z.ZodString;
233
156
  name: z.ZodString;
234
- kind: z.ZodEnum<["agent", "check"]>;
235
- status: z.ZodEnum<["pending", "running", "waiting", "review", "done", "failed", "cancelled", "skipped"]>;
157
+ kind: z.ZodEnum<{
158
+ agent: "agent";
159
+ check: "check";
160
+ }>;
161
+ status: z.ZodEnum<{
162
+ cancelled: "cancelled";
163
+ done: "done";
164
+ failed: "failed";
165
+ pending: "pending";
166
+ review: "review";
167
+ running: "running";
168
+ skipped: "skipped";
169
+ waiting: "waiting";
170
+ }>;
236
171
  iterations: z.ZodNumber;
237
172
  tokensUsed: z.ZodNumber;
173
+ inputTokens: z.ZodOptional<z.ZodNumber>;
174
+ outputTokens: z.ZodOptional<z.ZodNumber>;
175
+ usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
176
+ usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
177
+ usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
178
+ usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
179
+ usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
238
180
  startedAt: z.ZodOptional<z.ZodString>;
239
181
  finishedAt: z.ZodOptional<z.ZodString>;
240
182
  error: z.ZodOptional<z.ZodString>;
241
- /** Latest backend-owned session id, used for same-backend Continue. */
242
183
  sessionId: z.ZodOptional<z.ZodString>;
243
- /** Backend that owns `sessionId`. Optional so pre-affinity runs.json files still parse. */
244
- backend: z.ZodOptional<z.ZodEnum<["claude", "codex", "opencode"]>>;
245
- /** Dollar cost reported by the claude CLI for this step's turns. */
184
+ backend: z.ZodOptional<z.ZodEnum<{
185
+ claude: "claude";
186
+ codex: "codex";
187
+ opencode: "opencode";
188
+ }>>;
189
+ profileId: z.ZodOptional<z.ZodString>;
246
190
  costUsd: z.ZodOptional<z.ZodNumber>;
247
- }, "strip", z.ZodTypeAny, {
248
- id: string;
249
- name: string;
250
- kind: "agent" | "check";
251
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
252
- iterations: number;
253
- tokensUsed: number;
254
- startedAt?: string | undefined;
255
- finishedAt?: string | undefined;
256
- error?: string | undefined;
257
- sessionId?: string | undefined;
258
- backend?: "claude" | "codex" | "opencode" | undefined;
259
- costUsd?: number | undefined;
260
- }, {
261
- id: string;
262
- name: string;
263
- kind: "agent" | "check";
264
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
265
- iterations: number;
266
- tokensUsed: number;
267
- startedAt?: string | undefined;
268
- finishedAt?: string | undefined;
269
- error?: string | undefined;
270
- sessionId?: string | undefined;
271
- backend?: "claude" | "codex" | "opencode" | undefined;
272
- costUsd?: number | undefined;
273
- }>, "many">;
274
- /** Full workflow definition, persisted so a `queued` run can be re-enqueued
275
- * after a restart (#367) — including ad-hoc "(planned)" chains that exist
276
- * nowhere else. Kept loose here to avoid an upward import; the run manager
277
- * validates the shape before reviving it. */
278
- workflowDef: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
279
- }, "strip", z.ZodTypeAny, {
280
- id: string;
281
- title: string;
282
- titleSummary?: string | undefined;
283
- diffStat?: {
284
- adds: number;
285
- dels: number;
286
- files: number;
287
- } | undefined;
288
- workflow: string;
289
- task: string;
290
- queuedMessages?: {
291
- id: string;
292
- text: string;
293
- images?: string[] | undefined;
294
- createdAt: string;
295
- }[] | undefined;
296
- taskImages?: string[] | undefined;
297
- model?: string | undefined;
298
- modelIdentity?: string | undefined;
299
- runner?: "claude" | "codex" | "opencode" | undefined;
300
- systemPrompt?: string | undefined;
301
- generateFollowups?: boolean | undefined;
302
- autonomous?: boolean | undefined;
303
- status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
304
- activity?: "monitoring" | undefined;
305
- createdAt: string;
306
- startedAt?: string | undefined;
307
- finishedAt?: string | undefined;
308
- tokensUsed: number;
309
- costUsd?: number | undefined;
310
- pullRequestUrl?: string | undefined;
311
- referencedPullRequestUrl?: string | undefined;
312
- prNumber?: number | undefined;
313
- issueNumber?: number | undefined;
314
- referencedIssueNumberSeeded?: boolean | undefined;
315
- titleOrigin?: "auto" | "marker" | "user" | undefined;
316
- markerRefs?: {
317
- pr?: number | undefined;
318
- issue?: number | undefined;
319
- } | undefined;
320
- referencedPrCandidates?: string[] | undefined;
321
- referencedIssueUrl?: string | undefined;
322
- referencedIssueCandidates?: string[] | undefined;
323
- worktreePath?: string | undefined;
324
- branch?: string | undefined;
325
- baseBranch?: string | undefined;
326
- worktreeReclaimedAt?: string | undefined;
327
- groupId?: string | undefined;
328
- variant?: string | undefined;
329
- peakRssBytes?: number | undefined;
330
- peakProcCount?: number | undefined;
331
- archived: boolean;
332
- archivedAt?: string | undefined;
333
- currentStepId?: string | undefined;
334
- error?: string | undefined;
335
- steps: {
336
- id: string;
337
- name: string;
338
- kind: "agent" | "check";
339
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
340
- iterations: number;
341
- tokensUsed: number;
342
- startedAt?: string | undefined;
343
- finishedAt?: string | undefined;
344
- error?: string | undefined;
345
- sessionId?: string | undefined;
346
- backend?: "claude" | "codex" | "opencode" | undefined;
347
- costUsd?: number | undefined;
348
- }[];
349
- workflowDef?: Record<string, unknown> | undefined;
350
- }, {
351
- id: string;
352
- title: string;
353
- titleSummary?: string | undefined;
354
- diffStat?: {
355
- adds: number;
356
- dels: number;
357
- files: number;
358
- } | undefined;
359
- workflow: string;
360
- task: string;
361
- queuedMessages?: {
362
- id: string;
363
- text: string;
364
- images?: string[] | undefined;
365
- createdAt: string;
366
- }[] | undefined;
367
- taskImages?: string[] | undefined;
368
- model?: string | undefined;
369
- modelIdentity?: string | undefined;
370
- runner?: "claude" | "codex" | "opencode" | undefined;
371
- systemPrompt?: string | undefined;
372
- generateFollowups?: boolean | undefined;
373
- autonomous?: boolean | undefined;
374
- status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
375
- activity?: "monitoring" | undefined;
376
- createdAt: string;
377
- startedAt?: string | undefined;
378
- finishedAt?: string | undefined;
379
- tokensUsed: number;
380
- costUsd?: number | undefined;
381
- pullRequestUrl?: string | undefined;
382
- referencedPullRequestUrl?: string | undefined;
383
- prNumber?: number | undefined;
384
- issueNumber?: number | undefined;
385
- referencedIssueNumberSeeded?: boolean | undefined;
386
- titleOrigin?: "auto" | "marker" | "user" | undefined;
387
- markerRefs?: {
388
- pr?: number | undefined;
389
- issue?: number | undefined;
390
- } | undefined;
391
- referencedPrCandidates?: string[] | undefined;
392
- referencedIssueUrl?: string | undefined;
393
- referencedIssueCandidates?: string[] | undefined;
394
- worktreePath?: string | undefined;
395
- branch?: string | undefined;
396
- baseBranch?: string | undefined;
397
- worktreeReclaimedAt?: string | undefined;
398
- groupId?: string | undefined;
399
- variant?: string | undefined;
400
- peakRssBytes?: number | undefined;
401
- peakProcCount?: number | undefined;
402
- archived?: boolean | undefined;
403
- archivedAt?: string | undefined;
404
- currentStepId?: string | undefined;
405
- error?: string | undefined;
406
- steps: {
407
- id: string;
408
- name: string;
409
- kind: "agent" | "check";
410
- status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
411
- iterations: number;
412
- tokensUsed: number;
413
- startedAt?: string | undefined;
414
- finishedAt?: string | undefined;
415
- error?: string | undefined;
416
- sessionId?: string | undefined;
417
- backend?: "claude" | "codex" | "opencode" | undefined;
418
- costUsd?: number | undefined;
419
- }[];
420
- workflowDef?: Record<string, unknown> | undefined;
421
- }>;
191
+ }, z.core.$strip>>;
192
+ workflowDef: z.ZodCatch<z.ZodOptional<z.ZodObject<{
193
+ name: z.ZodString;
194
+ description: z.ZodOptional<z.ZodString>;
195
+ steps: z.ZodArray<z.ZodObject<{
196
+ id: z.ZodString;
197
+ name: z.ZodOptional<z.ZodString>;
198
+ prompt: z.ZodOptional<z.ZodString>;
199
+ skill: z.ZodOptional<z.ZodString>;
200
+ model: z.ZodOptional<z.ZodString>;
201
+ runner: z.ZodOptional<z.ZodEnum<{
202
+ claude: "claude";
203
+ codex: "codex";
204
+ opencode: "opencode";
205
+ }>>;
206
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
207
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
208
+ command: z.ZodOptional<z.ZodString>;
209
+ onFail: z.ZodOptional<z.ZodObject<{
210
+ retry: z.ZodString;
211
+ max: z.ZodDefault<z.ZodNumber>;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>>;
214
+ source: z.ZodEnum<{
215
+ "built-in": "built-in";
216
+ file: "file";
217
+ }>;
218
+ path: z.ZodOptional<z.ZodString>;
219
+ }, z.core.$strip>>>;
220
+ }, z.core.$strip>;
422
221
  export type StepState = z.infer<typeof stepStateSchema>;
423
222
  export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
424
223
  export type RunRecord = z.infer<typeof runRecordSchema>;
@@ -430,6 +229,22 @@ export interface RunEvent {
430
229
  type: string;
431
230
  [key: string]: unknown;
432
231
  }
232
+ /**
233
+ * Reconcile one record just read off disk with the fact that whichever process wrote it is gone.
234
+ *
235
+ * Mutates and returns `run`. Extracted from `RunStore.open` so the read-only index reader
236
+ * (`./run-index.ts`) answers the SAME question about a `running` row on disk. Two parsers that
237
+ * disagree here is a visible bug, not an internal one: the cockpit would show a task as running
238
+ * in the ⌘K index and failed the moment you opened it.
239
+ *
240
+ * `keepLive` (#367): leave `queued`/`running`/`waiting` untouched so the caller can recover them
241
+ * (RunManager.recover re-queues queued runs, resumes interrupted ones). Without it — one-shot CLI
242
+ * paths that never recover, and the index reader, which has no manager at all — live-looking runs
243
+ * are marked failed so no ghost stays behind.
244
+ */
245
+ export declare function reconcileLoadedRun(run: RunRecord, opts?: {
246
+ keepLive?: boolean;
247
+ }): RunRecord;
433
248
  /**
434
249
  * File-backed run store: `runs.json` index (atomic tmp+rename writes, the
435
250
  * pattern from @cezar/core's IssueStore) plus one append-only NDJSON event
@@ -441,12 +256,7 @@ export declare class RunStore extends EventEmitter {
441
256
  private runs;
442
257
  private saveTimer;
443
258
  private constructor();
444
- /**
445
- * `keepLive` (#367): leave `queued`/`running`/`waiting` statuses untouched
446
- * so the caller can recover them (RunManager.recover re-queues queued runs,
447
- * resumes interrupted ones). Without it — one-shot CLI paths that never
448
- * recover — live-looking runs are marked failed so no ghost stays behind.
449
- */
259
+ /** See `reconcileLoadedRun` for what `keepLive` (#367) decides about live-looking rows. */
450
260
  static open(dataDir: string, opts?: {
451
261
  keepLive?: boolean;
452
262
  }): RunStore;
@@ -458,8 +268,11 @@ export declare class RunStore extends EventEmitter {
458
268
  task: string;
459
269
  model?: string;
460
270
  runner?: 'claude' | 'codex' | 'opencode';
271
+ /** Composer's per-task agent account (spec 2026-07-29-agent-profiles). */
272
+ agentProfile?: string;
461
273
  generateFollowups?: boolean;
462
274
  autonomous?: boolean;
275
+ worktree?: false;
463
276
  groupId?: string;
464
277
  variant?: string;
465
278
  steps: Array<Pick<StepState, 'id' | 'name' | 'kind'>>;
@@ -494,6 +307,19 @@ export declare class RunStore extends EventEmitter {
494
307
  setArchived(id: string, archived: boolean): RunRecord | undefined;
495
308
  /** Bulk-archive every finished run; returns how many were archived. */
496
309
  archiveFinished(): number;
310
+ /** Mark one run as read (#unread-done-items): stamp the read receipt now. Mirrors
311
+ * `setArchived` — sets the field then persists + broadcasts via `touch`, so the
312
+ * updated record rides the existing `run` SSE with no new event. Idempotent by
313
+ * design: opening an already-read thread just re-stamps a later `seenAt`. */
314
+ setRead(id: string): RunRecord | undefined;
315
+ /** Bulk mark-read: stamp every currently-unread finished run; returns the count.
316
+ * "Unread" here is the same rule the cockpit paints (`isUnread` in read-state.ts),
317
+ * clause for clause: a `done` or `failed` run that finished and has not been seen
318
+ * since. Cancelled runs are never unread — you stopped them yourself — and archived
319
+ * ones never are either, since archiving is a stronger "done with this" than reading;
320
+ * both are skipped, as are runs already read. Keeping the two rules identical is what
321
+ * makes the returned count the number the cockpit's unread badge was showing. */
322
+ markAllRead(): number;
497
323
  appendEvent(runId: string, event: {
498
324
  type: string;
499
325
  stepId?: string;