@wjarka/cezarion 0.16.0 → 0.17.0

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 (907) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +594 -207
  3. package/dist/agent-config/account-identity.d.ts +3 -19
  4. package/dist/agent-config/account-identity.js +8 -5
  5. package/dist/agent-config/account-identity.js.map +1 -1
  6. package/dist/agent-config/catalog.d.ts +3 -14
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/files.d.ts +2 -6
  9. package/dist/agent-config/files.js +2 -6
  10. package/dist/agent-config/files.js.map +1 -1
  11. package/dist/agent-config/model-settings/types.d.ts +1 -1
  12. package/dist/agent-config/seed.d.ts +11 -3
  13. package/dist/agent-config/seed.js +52 -48
  14. package/dist/agent-config/seed.js.map +1 -1
  15. package/dist/agent-config/service.js +3 -2
  16. package/dist/agent-config/service.js.map +1 -1
  17. package/dist/agent-config/validate.d.ts +1 -4
  18. package/dist/agent-config/validate.js.map +1 -1
  19. package/dist/application-update/helper.d.ts +2 -2
  20. package/dist/application-update/helper.js +7 -12
  21. package/dist/application-update/helper.js.map +1 -1
  22. package/dist/application-update/launcher.d.ts +4 -0
  23. package/dist/application-update/launcher.js +18 -12
  24. package/dist/application-update/launcher.js.map +1 -1
  25. package/dist/application-update/service.d.ts +3 -3
  26. package/dist/application-update/service.js +1 -1
  27. package/dist/application-update/service.js.map +1 -1
  28. package/dist/archive-on-merge-setting.d.ts +15 -0
  29. package/dist/archive-on-merge-setting.js +14 -0
  30. package/dist/archive-on-merge-setting.js.map +1 -0
  31. package/dist/artifacts/cli.d.ts +8 -0
  32. package/dist/artifacts/cli.js +21 -2
  33. package/dist/artifacts/cli.js.map +1 -1
  34. package/dist/artifacts/resolve.js +2 -1
  35. package/dist/artifacts/resolve.js.map +1 -1
  36. package/dist/artifacts/store.js.map +1 -1
  37. package/dist/automations/automation-cli.d.ts +59 -0
  38. package/dist/automations/automation-cli.js +509 -0
  39. package/dist/automations/automation-cli.js.map +1 -0
  40. package/dist/automations/builtin-skill.d.ts +7 -0
  41. package/dist/automations/builtin-skill.js +14 -0
  42. package/dist/automations/builtin-skill.js.map +1 -0
  43. package/dist/automations/github-baseline.d.ts +3 -0
  44. package/dist/automations/github-baseline.js +17 -0
  45. package/dist/automations/github-baseline.js.map +1 -0
  46. package/dist/automations/github-poller.d.ts +23 -4
  47. package/dist/automations/github-poller.js +157 -88
  48. package/dist/automations/github-poller.js.map +1 -1
  49. package/dist/automations/prompts.d.ts +12 -0
  50. package/dist/automations/prompts.js +160 -0
  51. package/dist/automations/prompts.js.map +1 -0
  52. package/dist/automations/schedule-runner.d.ts +43 -24
  53. package/dist/automations/schedule-runner.js +207 -20
  54. package/dist/automations/schedule-runner.js.map +1 -1
  55. package/dist/automations/scheduler.d.ts +10 -2
  56. package/dist/automations/scheduler.js +200 -54
  57. package/dist/automations/scheduler.js.map +1 -1
  58. package/dist/automations/service.d.ts +777 -0
  59. package/dist/automations/service.js +444 -0
  60. package/dist/automations/service.js.map +1 -0
  61. package/dist/automations/store.d.ts +17 -7
  62. package/dist/automations/store.js +88 -17
  63. package/dist/automations/store.js.map +1 -1
  64. package/dist/automations/task-template.d.ts +7 -2
  65. package/dist/automations/task-template.js +93 -44
  66. package/dist/automations/task-template.js.map +1 -1
  67. package/dist/automations/tool-adapter.d.ts +6 -0
  68. package/dist/automations/tool-adapter.js +108 -0
  69. package/dist/automations/tool-adapter.js.map +1 -0
  70. package/dist/automations/types.d.ts +1 -405
  71. package/dist/automations/types.js +1 -218
  72. package/dist/automations/types.js.map +1 -1
  73. package/dist/autosave-cleanup.d.ts +26 -0
  74. package/dist/autosave-cleanup.js +87 -0
  75. package/dist/autosave-cleanup.js.map +1 -0
  76. package/dist/autosave-git.d.ts +3 -0
  77. package/dist/autosave-git.js +67 -35
  78. package/dist/autosave-git.js.map +1 -1
  79. package/dist/autosave-group.d.ts +8 -0
  80. package/dist/autosave-group.js +61 -0
  81. package/dist/autosave-group.js.map +1 -0
  82. package/dist/autosave-holders.d.ts +31 -4
  83. package/dist/autosave-holders.js +92 -7
  84. package/dist/autosave-holders.js.map +1 -1
  85. package/dist/autosave-windows.d.ts +14 -0
  86. package/dist/autosave-windows.js +36 -2
  87. package/dist/autosave-windows.js.map +1 -1
  88. package/dist/ci-wait/client.d.ts +20 -3
  89. package/dist/ci-wait/client.js +40 -44
  90. package/dist/ci-wait/client.js.map +1 -1
  91. package/dist/ci-wait/controller.d.ts +622 -36
  92. package/dist/ci-wait/controller.js +152 -20
  93. package/dist/ci-wait/controller.js.map +1 -1
  94. package/dist/ci-wait/errors.d.ts +19 -0
  95. package/dist/ci-wait/errors.js +180 -2
  96. package/dist/ci-wait/errors.js.map +1 -1
  97. package/dist/ci-wait/github.d.ts +25 -1
  98. package/dist/ci-wait/github.js +76 -9
  99. package/dist/ci-wait/github.js.map +1 -1
  100. package/dist/ci-wait/mcp.d.ts +0 -1
  101. package/dist/ci-wait/mcp.js +0 -2
  102. package/dist/ci-wait/mcp.js.map +1 -1
  103. package/dist/ci-wait/supervisor.d.ts +7 -0
  104. package/dist/ci-wait/supervisor.js +113 -17
  105. package/dist/ci-wait/supervisor.js.map +1 -1
  106. package/dist/ci-wait/tools.d.ts +536 -16
  107. package/dist/ci-wait/tools.js +165 -20
  108. package/dist/ci-wait/tools.js.map +1 -1
  109. package/dist/config.d.ts +3 -17
  110. package/dist/config.js +4 -60
  111. package/dist/config.js.map +1 -1
  112. package/dist/contract/active-provider.d.ts +12 -0
  113. package/dist/contract/agent-profiles.d.ts +2 -10
  114. package/dist/contract/ask-schema.d.ts +22 -4
  115. package/dist/contract/ask.d.ts +6 -4
  116. package/dist/contract/attachments.d.ts +35 -0
  117. package/dist/contract/attention.d.ts +46 -37
  118. package/dist/contract/automation-requests.d.ts +308 -0
  119. package/dist/contract/automation-schedule.d.ts +40 -11
  120. package/dist/contract/automation-storage.d.ts +512 -0
  121. package/dist/contract/automations.d.ts +421 -40
  122. package/dist/contract/ci-wait.d.ts +41 -4
  123. package/dist/contract/config-requests.d.ts +36 -0
  124. package/dist/contract/conversations.d.ts +24 -10
  125. package/dist/contract/defined.d.ts +8 -0
  126. package/dist/contract/delegation.d.ts +312 -8
  127. package/dist/contract/events.d.ts +24 -3
  128. package/dist/contract/github-requests.d.ts +26 -0
  129. package/dist/contract/github.d.ts +60 -27
  130. package/dist/contract/handoff.d.ts +43 -0
  131. package/dist/contract/health.d.ts +2 -2
  132. package/dist/contract/image-path.d.ts +6 -0
  133. package/dist/contract/index.d.ts +31 -0
  134. package/dist/contract/index.js +3756 -1525
  135. package/dist/contract/live-coordination.d.ts +158 -0
  136. package/dist/contract/live-limits.d.ts +8 -0
  137. package/dist/contract/live.d.ts +123 -0
  138. package/dist/contract/pending-ask.d.ts +58 -0
  139. package/dist/contract/permissions.d.ts +54 -0
  140. package/dist/contract/preview.d.ts +33 -0
  141. package/dist/contract/project-limits.d.ts +33 -0
  142. package/dist/contract/projects.d.ts +486 -20
  143. package/dist/contract/provider-requests.d.ts +77 -0
  144. package/dist/contract/query-requests.d.ts +52 -0
  145. package/dist/contract/repo-requests.d.ts +12 -0
  146. package/dist/contract/run-labels.d.ts +8 -0
  147. package/dist/contract/run-limits.d.ts +8 -0
  148. package/dist/contract/run-predicates.d.ts +32 -0
  149. package/dist/contract/run-requests.d.ts +33 -0
  150. package/dist/contract/run-search.d.ts +193 -0
  151. package/dist/contract/runs.d.ts +2232 -1894
  152. package/dist/contract/scheduled-tasks.d.ts +187 -0
  153. package/dist/contract/skills.d.ts +22 -772
  154. package/dist/contract/team-skill-ref.d.ts +10 -0
  155. package/dist/{core → contract}/tool-display.d.ts +4 -10
  156. package/dist/contract/ui-state-requests.d.ts +60 -0
  157. package/dist/contract/version.d.ts +3 -0
  158. package/dist/contract/voice.d.ts +213 -0
  159. package/dist/contract/waits.d.ts +1204 -0
  160. package/dist/contract/workflow-file.d.ts +37 -0
  161. package/dist/contract/workflow-requests.d.ts +7 -0
  162. package/dist/contract/workflows.d.ts +1 -2
  163. package/dist/contract/workspace.d.ts +34 -82
  164. package/dist/contract/zoned-time.d.ts +2 -11
  165. package/dist/core/agent-env.d.ts +4 -16
  166. package/dist/core/agent-env.js +14 -16
  167. package/dist/core/agent-env.js.map +1 -1
  168. package/dist/core/agent-profiles.d.ts +28 -40
  169. package/dist/core/agent-profiles.js +56 -51
  170. package/dist/core/agent-profiles.js.map +1 -1
  171. package/dist/core/agent-runner.d.ts +88 -44
  172. package/dist/core/agent-runner.js +17 -18
  173. package/dist/core/agent-runner.js.map +1 -1
  174. package/dist/core/ask.d.ts +3 -0
  175. package/dist/core/ask.js +12 -0
  176. package/dist/core/ask.js.map +1 -1
  177. package/dist/core/backend-detect.js +16 -2
  178. package/dist/core/backend-detect.js.map +1 -1
  179. package/dist/core/claude-cli-runner.d.ts +23 -4
  180. package/dist/core/claude-cli-runner.js +280 -76
  181. package/dist/core/claude-cli-runner.js.map +1 -1
  182. package/dist/core/claude-model-catalog.d.ts +2 -10
  183. package/dist/core/claude-model-catalog.js +2 -10
  184. package/dist/core/claude-model-catalog.js.map +1 -1
  185. package/dist/core/claude-ui-mapper.d.ts +2 -2
  186. package/dist/core/claude-ui-mapper.js +94 -2
  187. package/dist/core/claude-ui-mapper.js.map +1 -1
  188. package/dist/core/codex-app-server-runner.d.ts +3 -4
  189. package/dist/core/codex-app-server-runner.js +146 -51
  190. package/dist/core/codex-app-server-runner.js.map +1 -1
  191. package/dist/core/codex-app-server-transport.d.ts +4 -3
  192. package/dist/core/codex-app-server-transport.js +11 -7
  193. package/dist/core/codex-app-server-transport.js.map +1 -1
  194. package/dist/core/codex-approvals.d.ts +12 -0
  195. package/dist/core/codex-approvals.js +161 -0
  196. package/dist/core/codex-approvals.js.map +1 -0
  197. package/dist/core/codex-permissions.d.ts +1 -1
  198. package/dist/core/codex-ui-mapper.js +45 -1
  199. package/dist/core/codex-ui-mapper.js.map +1 -1
  200. package/dist/core/cursor-acp-runner.d.ts +1 -1
  201. package/dist/core/cursor-acp-runner.js +39 -15
  202. package/dist/core/cursor-acp-runner.js.map +1 -1
  203. package/dist/core/cursor-cli-flags.d.ts +19 -0
  204. package/dist/core/cursor-cli-flags.js +47 -0
  205. package/dist/core/cursor-cli-flags.js.map +1 -0
  206. package/dist/core/cursor-model-catalog.d.ts +22 -0
  207. package/dist/core/cursor-model-catalog.js +53 -24
  208. package/dist/core/cursor-model-catalog.js.map +1 -1
  209. package/dist/core/cursor-print-capabilities.d.ts +16 -0
  210. package/dist/core/cursor-print-capabilities.js +141 -0
  211. package/dist/core/cursor-print-capabilities.js.map +1 -0
  212. package/dist/core/cursor-print-process.d.ts +31 -0
  213. package/dist/core/cursor-print-process.js +117 -0
  214. package/dist/core/cursor-print-process.js.map +1 -0
  215. package/dist/core/cursor-print-runner.d.ts +31 -0
  216. package/dist/core/cursor-print-runner.js +555 -0
  217. package/dist/core/cursor-print-runner.js.map +1 -0
  218. package/dist/core/cursor-print-tool-catalog.d.ts +10 -0
  219. package/dist/core/cursor-print-tool-catalog.js +91 -0
  220. package/dist/core/cursor-print-tool-catalog.js.map +1 -0
  221. package/dist/core/cursor-print-ui-mapper.d.ts +47 -0
  222. package/dist/core/cursor-print-ui-mapper.js +553 -0
  223. package/dist/core/cursor-print-ui-mapper.js.map +1 -0
  224. package/dist/core/cursor-runner.d.ts +24 -0
  225. package/dist/core/cursor-runner.js +149 -0
  226. package/dist/core/cursor-runner.js.map +1 -0
  227. package/dist/core/cursor-ui-mapper.js +5 -2
  228. package/dist/core/cursor-ui-mapper.js.map +1 -1
  229. package/dist/core/defined.d.ts +1 -0
  230. package/dist/core/defined.js +2 -0
  231. package/dist/core/defined.js.map +1 -0
  232. package/dist/core/hook-items.d.ts +14 -0
  233. package/dist/core/hook-items.js +13 -0
  234. package/dist/core/hook-items.js.map +1 -0
  235. package/dist/core/host-model-catalog.d.ts +2 -9
  236. package/dist/core/host-model-catalog.js +2 -9
  237. package/dist/core/host-model-catalog.js.map +1 -1
  238. package/dist/core/managed-session.js +15 -3
  239. package/dist/core/managed-session.js.map +1 -1
  240. package/dist/core/model-identity.d.ts +4 -21
  241. package/dist/core/model-identity.js.map +1 -1
  242. package/dist/core/model-presets.d.ts +2 -13
  243. package/dist/core/model-presets.js +2 -13
  244. package/dist/core/model-presets.js.map +1 -1
  245. package/dist/core/omp-model-catalog.js.map +1 -1
  246. package/dist/core/omp-runner.d.ts +6 -7
  247. package/dist/core/omp-runner.js +92 -33
  248. package/dist/core/omp-runner.js.map +1 -1
  249. package/dist/core/omp-ui-mapper.js +1 -1
  250. package/dist/core/omp-ui-mapper.js.map +1 -1
  251. package/dist/core/opencode-model-catalog.js.map +1 -1
  252. package/dist/core/opencode-permissions.d.ts +52 -0
  253. package/dist/core/opencode-permissions.js +101 -0
  254. package/dist/core/opencode-permissions.js.map +1 -0
  255. package/dist/core/opencode-server-runner.d.ts +10 -9
  256. package/dist/core/opencode-server-runner.js +286 -28
  257. package/dist/core/opencode-server-runner.js.map +1 -1
  258. package/dist/core/opencode-session-error.d.ts +15 -7
  259. package/dist/core/opencode-session-error.js +25 -9
  260. package/dist/core/opencode-session-error.js.map +1 -1
  261. package/dist/core/opencode-ui-mapper.js +2 -2
  262. package/dist/core/opencode-ui-mapper.js.map +1 -1
  263. package/dist/core/pi-model-catalog.js.map +1 -1
  264. package/dist/core/pi-runner.d.ts +12 -4
  265. package/dist/core/pi-runner.js +171 -63
  266. package/dist/core/pi-runner.js.map +1 -1
  267. package/dist/core/pi-ui-mapper.js +1 -1
  268. package/dist/core/pi-ui-mapper.js.map +1 -1
  269. package/dist/core/process-usage.d.ts +5 -0
  270. package/dist/core/process-usage.js +24 -4
  271. package/dist/core/process-usage.js.map +1 -1
  272. package/dist/core/provider-auth.d.ts +16 -107
  273. package/dist/core/provider-auth.js +16 -132
  274. package/dist/core/provider-auth.js.map +1 -1
  275. package/dist/core/runner-factory.d.ts +4 -1
  276. package/dist/core/runner-factory.js +3 -3
  277. package/dist/core/runner-factory.js.map +1 -1
  278. package/dist/core/runner-runtime.d.ts +22 -0
  279. package/dist/core/runner-runtime.js +66 -5
  280. package/dist/core/runner-runtime.js.map +1 -1
  281. package/dist/core/runner-tool-grants.d.ts +21 -0
  282. package/dist/core/runner-tool-grants.js +64 -0
  283. package/dist/core/runner-tool-grants.js.map +1 -0
  284. package/dist/core/secret-redaction.d.ts +3 -20
  285. package/dist/core/secret-redaction.js +3 -20
  286. package/dist/core/secret-redaction.js.map +1 -1
  287. package/dist/core/session-process.d.ts +22 -2
  288. package/dist/core/session-process.js +170 -12
  289. package/dist/core/session-process.js.map +1 -1
  290. package/dist/core/shell-env.d.ts +2 -15
  291. package/dist/core/shell-env.js +2 -15
  292. package/dist/core/shell-env.js.map +1 -1
  293. package/dist/core/ui-events.d.ts +60 -47
  294. package/dist/core/ui-events.js +0 -23
  295. package/dist/core/ui-events.js.map +1 -1
  296. package/dist/core/usage-limit.js.map +1 -1
  297. package/dist/data-gitignore.js +3 -1
  298. package/dist/data-gitignore.js.map +1 -1
  299. package/dist/delegation/capacity.d.ts +4 -8
  300. package/dist/delegation/capacity.js +4 -8
  301. package/dist/delegation/capacity.js.map +1 -1
  302. package/dist/delegation/cli.js +123 -21
  303. package/dist/delegation/cli.js.map +1 -1
  304. package/dist/delegation/context.d.ts +19 -3
  305. package/dist/delegation/context.js +217 -22
  306. package/dist/delegation/context.js.map +1 -1
  307. package/dist/delegation/conversations.d.ts +4 -3
  308. package/dist/delegation/conversations.js +7 -5
  309. package/dist/delegation/conversations.js.map +1 -1
  310. package/dist/delegation/destroy-observation.d.ts +1 -1
  311. package/dist/delegation/destroy-observation.js.map +1 -1
  312. package/dist/delegation/effort.js.map +1 -1
  313. package/dist/delegation/execution-identity.d.ts +1 -1
  314. package/dist/delegation/execution-identity.js +41 -7
  315. package/dist/delegation/execution-identity.js.map +1 -1
  316. package/dist/delegation/idle-test-app.d.ts +4 -0
  317. package/dist/delegation/idle-test-app.js +174 -0
  318. package/dist/delegation/idle-test-app.js.map +1 -0
  319. package/dist/delegation/input.js.map +1 -1
  320. package/dist/delegation/park-notice.d.ts +42 -0
  321. package/dist/delegation/park-notice.js +71 -0
  322. package/dist/delegation/park-notice.js.map +1 -0
  323. package/dist/delegation/policy.d.ts +2 -0
  324. package/dist/delegation/policy.js +9 -1
  325. package/dist/delegation/policy.js.map +1 -1
  326. package/dist/delegation/process-liveness.d.ts +10 -15
  327. package/dist/delegation/process-liveness.js +11 -35
  328. package/dist/delegation/process-liveness.js.map +1 -1
  329. package/dist/delegation/provision.js +21 -19
  330. package/dist/delegation/provision.js.map +1 -1
  331. package/dist/delegation/questions.d.ts +3 -1
  332. package/dist/delegation/questions.js +10 -5
  333. package/dist/delegation/questions.js.map +1 -1
  334. package/dist/delegation/readiness.d.ts +2 -2
  335. package/dist/delegation/results.d.ts +4 -1
  336. package/dist/delegation/results.js +49 -18
  337. package/dist/delegation/results.js.map +1 -1
  338. package/dist/delegation/retry-backoff.d.ts +8 -0
  339. package/dist/delegation/retry-backoff.js +8 -0
  340. package/dist/delegation/retry-backoff.js.map +1 -1
  341. package/dist/delegation/routes.d.ts +114 -30
  342. package/dist/delegation/routes.js +4 -1
  343. package/dist/delegation/routes.js.map +1 -1
  344. package/dist/delegation/scratch-cleanup.d.ts +4 -5
  345. package/dist/delegation/scratch-cleanup.js +10 -8
  346. package/dist/delegation/scratch-cleanup.js.map +1 -1
  347. package/dist/delegation/service.d.ts +12 -4
  348. package/dist/delegation/service.js +76 -28
  349. package/dist/delegation/service.js.map +1 -1
  350. package/dist/delegation/transport.d.ts +154 -70
  351. package/dist/delegation/wait.d.ts +11 -0
  352. package/dist/delegation/wait.js +24 -0
  353. package/dist/delegation/wait.js.map +1 -1
  354. package/dist/delegation/windows-test-app.d.ts +5 -0
  355. package/dist/delegation/windows-test-app.js +63 -0
  356. package/dist/delegation/windows-test-app.js.map +1 -0
  357. package/dist/delegation/windows-workspace-identity.d.ts +3 -0
  358. package/dist/delegation/windows-workspace-identity.js +22 -0
  359. package/dist/delegation/windows-workspace-identity.js.map +1 -0
  360. package/dist/delegation/workspace.d.ts +5 -10
  361. package/dist/delegation/workspace.js +136 -75
  362. package/dist/delegation/workspace.js.map +1 -1
  363. package/dist/detached-process.d.ts +103 -0
  364. package/dist/detached-process.js +301 -0
  365. package/dist/detached-process.js.map +1 -0
  366. package/dist/discovery/catalog.d.ts +2 -1
  367. package/dist/discovery/catalog.js.map +1 -1
  368. package/dist/discovery/cli.js +3 -1
  369. package/dist/discovery/cli.js.map +1 -1
  370. package/dist/git-diff-base.d.ts +6 -61
  371. package/dist/git-diff-base.js +6 -70
  372. package/dist/git-diff-base.js.map +1 -1
  373. package/dist/git-index-copy.d.ts +4 -0
  374. package/dist/git-index-copy.js +10 -0
  375. package/dist/git-index-copy.js.map +1 -0
  376. package/dist/git-worktree-lock.d.ts +2 -4
  377. package/dist/git-worktree-lock.js +2 -4
  378. package/dist/git-worktree-lock.js.map +1 -1
  379. package/dist/git-worktree-release.d.ts +2 -2
  380. package/dist/git-worktree-release.js.map +1 -1
  381. package/dist/git-worktree.d.ts +47 -76
  382. package/dist/git-worktree.js +240 -94
  383. package/dist/git-worktree.js.map +1 -1
  384. package/dist/handoff.d.ts +51 -41
  385. package/dist/handoff.js +130 -78
  386. package/dist/handoff.js.map +1 -1
  387. package/dist/index.js +60 -39
  388. package/dist/index.js.map +1 -1
  389. package/dist/merge-observations.d.ts +13 -0
  390. package/dist/merge-observations.js +55 -0
  391. package/dist/merge-observations.js.map +1 -0
  392. package/dist/open-url.js +4 -14
  393. package/dist/open-url.js.map +1 -1
  394. package/dist/paths.d.ts +10 -13
  395. package/dist/paths.js +36 -17
  396. package/dist/paths.js.map +1 -1
  397. package/dist/planner.d.ts +2 -1
  398. package/dist/planner.js +9 -6
  399. package/dist/planner.js.map +1 -1
  400. package/dist/preview/agent-address.d.ts +34 -0
  401. package/dist/preview/agent-address.js +51 -0
  402. package/dist/preview/agent-address.js.map +1 -0
  403. package/dist/preview/agent-marker.d.ts +17 -0
  404. package/dist/preview/agent-marker.js +71 -0
  405. package/dist/preview/agent-marker.js.map +1 -0
  406. package/dist/preview/cdp-proxy.d.ts +54 -0
  407. package/dist/preview/cdp-proxy.js +151 -0
  408. package/dist/preview/cdp-proxy.js.map +1 -0
  409. package/dist/preview/cdp.d.ts +39 -3
  410. package/dist/preview/cdp.js +155 -57
  411. package/dist/preview/cdp.js.map +1 -1
  412. package/dist/preview/chromium.d.ts +18 -6
  413. package/dist/preview/chromium.js +112 -25
  414. package/dist/preview/chromium.js.map +1 -1
  415. package/dist/preview/dev-server.d.ts +1 -1
  416. package/dist/preview/dev-server.js +20 -44
  417. package/dist/preview/dev-server.js.map +1 -1
  418. package/dist/preview/host.d.ts +70 -3
  419. package/dist/preview/host.js +314 -28
  420. package/dist/preview/host.js.map +1 -1
  421. package/dist/preview/registration.d.ts +10 -5
  422. package/dist/preview/registration.js +2 -0
  423. package/dist/preview/registration.js.map +1 -1
  424. package/dist/preview/session.d.ts +2 -0
  425. package/dist/preview/session.js +10 -0
  426. package/dist/preview/session.js.map +1 -1
  427. package/dist/process-wait/exit-file.d.ts +29 -0
  428. package/dist/process-wait/exit-file.js +67 -0
  429. package/dist/process-wait/exit-file.js.map +1 -0
  430. package/dist/process-wait/supervisor.d.ts +30 -0
  431. package/dist/process-wait/supervisor.js +71 -0
  432. package/dist/process-wait/supervisor.js.map +1 -0
  433. package/dist/release/snapshot.d.ts +6 -6
  434. package/dist/runs/agent-tmpdir.d.ts +51 -36
  435. package/dist/runs/agent-tmpdir.js +389 -132
  436. package/dist/runs/agent-tmpdir.js.map +1 -1
  437. package/dist/runs/auto-name.d.ts +6 -6
  438. package/dist/runs/auto-name.js +1 -1
  439. package/dist/runs/auto-name.js.map +1 -1
  440. package/dist/runs/client-request.d.ts +3 -3
  441. package/dist/runs/client-request.js +3 -3
  442. package/dist/runs/client-request.js.map +1 -1
  443. package/dist/runs/delegation-state.d.ts +11 -2
  444. package/dist/runs/delegation-state.js.map +1 -1
  445. package/dist/runs/event-history-agent-context.d.ts +14 -0
  446. package/dist/runs/event-history-agent-context.js +105 -0
  447. package/dist/runs/event-history-agent-context.js.map +1 -0
  448. package/dist/runs/event-history-context.d.ts +15 -0
  449. package/dist/runs/event-history-context.js +109 -0
  450. package/dist/runs/event-history-context.js.map +1 -0
  451. package/dist/runs/event-history.d.ts +4 -1
  452. package/dist/runs/event-history.js +29 -130
  453. package/dist/runs/event-history.js.map +1 -1
  454. package/dist/runs/history-stream.d.ts +2 -0
  455. package/dist/runs/history-stream.js +62 -0
  456. package/dist/runs/history-stream.js.map +1 -0
  457. package/dist/runs/legacy-index.d.ts +6 -19
  458. package/dist/runs/legacy-index.js +6 -19
  459. package/dist/runs/legacy-index.js.map +1 -1
  460. package/dist/runs/live-item-snapshots.d.ts +13 -0
  461. package/dist/runs/live-item-snapshots.js +79 -0
  462. package/dist/runs/live-item-snapshots.js.map +1 -0
  463. package/dist/runs/loaded-run-healing.d.ts +3 -0
  464. package/dist/runs/loaded-run-healing.js +17 -0
  465. package/dist/runs/loaded-run-healing.js.map +1 -0
  466. package/dist/runs/outcome-commit.d.ts +98 -0
  467. package/dist/runs/outcome-commit.js +132 -0
  468. package/dist/runs/outcome-commit.js.map +1 -0
  469. package/dist/runs/pull-requests.d.ts +14 -0
  470. package/dist/runs/pull-requests.js +96 -0
  471. package/dist/runs/pull-requests.js.map +1 -0
  472. package/dist/runs/raw-record.d.ts +3 -15
  473. package/dist/runs/raw-record.js +3 -15
  474. package/dist/runs/raw-record.js.map +1 -1
  475. package/dist/runs/retention.d.ts +2 -2
  476. package/dist/runs/retention.js +7 -0
  477. package/dist/runs/retention.js.map +1 -1
  478. package/dist/runs/review-gate.d.ts +1 -1
  479. package/dist/runs/review-gate.js.map +1 -1
  480. package/dist/runs/run-claims.d.ts +2 -9
  481. package/dist/runs/run-claims.js.map +1 -1
  482. package/dist/runs/run-database.d.ts +29 -34
  483. package/dist/runs/run-database.js +124 -46
  484. package/dist/runs/run-database.js.map +1 -1
  485. package/dist/runs/run-index.d.ts +6 -25
  486. package/dist/runs/run-index.js +25 -38
  487. package/dist/runs/run-index.js.map +1 -1
  488. package/dist/runs/run-row.d.ts +5 -34
  489. package/dist/runs/run-row.js +13 -38
  490. package/dist/runs/run-row.js.map +1 -1
  491. package/dist/runs/store.d.ts +1597 -744
  492. package/dist/runs/store.js +1231 -739
  493. package/dist/runs/store.js.map +1 -1
  494. package/dist/runs/task-markers.d.ts +1 -0
  495. package/dist/runs/task-markers.js +5 -1
  496. package/dist/runs/task-markers.js.map +1 -1
  497. package/dist/runs/task-refs.d.ts +3 -3
  498. package/dist/runs/transcript-facts-fold.d.ts +64 -0
  499. package/dist/runs/transcript-facts-fold.js +109 -0
  500. package/dist/runs/transcript-facts-fold.js.map +1 -0
  501. package/dist/runs/transcript-facts-load.d.ts +11 -0
  502. package/dist/runs/transcript-facts-load.js +66 -0
  503. package/dist/runs/transcript-facts-load.js.map +1 -0
  504. package/dist/runs/transcript-facts-queue.d.ts +30 -0
  505. package/dist/runs/transcript-facts-queue.js +227 -0
  506. package/dist/runs/transcript-facts-queue.js.map +1 -0
  507. package/dist/runs/transcript-facts-worker.d.ts +15 -0
  508. package/dist/runs/transcript-facts-worker.js +26 -0
  509. package/dist/runs/transcript-facts-worker.js.map +1 -0
  510. package/dist/runs/transcript-facts.d.ts +13 -51
  511. package/dist/runs/transcript-facts.js +86 -202
  512. package/dist/runs/transcript-facts.js.map +1 -1
  513. package/dist/runs/ui-event-sink.d.ts +5 -30
  514. package/dist/runs/ui-event-sink.js +8 -30
  515. package/dist/runs/ui-event-sink.js.map +1 -1
  516. package/dist/runs/webhook.d.ts +104 -38
  517. package/dist/runs/webhook.js +180 -77
  518. package/dist/runs/webhook.js.map +1 -1
  519. package/dist/server/app-type.d.ts +2 -17
  520. package/dist/server/archive-on-merge.d.ts +35 -0
  521. package/dist/server/archive-on-merge.js +202 -0
  522. package/dist/server/archive-on-merge.js.map +1 -0
  523. package/dist/server/capabilities.d.ts +3 -15
  524. package/dist/server/capabilities.js +6 -19
  525. package/dist/server/capabilities.js.map +1 -1
  526. package/dist/server/checkout-progress.d.ts +10 -0
  527. package/dist/server/checkout-progress.js +27 -0
  528. package/dist/server/checkout-progress.js.map +1 -0
  529. package/dist/server/checkout.d.ts +10 -19
  530. package/dist/server/checkout.js +15 -45
  531. package/dist/server/checkout.js.map +1 -1
  532. package/dist/server/cockpit-ownership.d.ts +2 -0
  533. package/dist/server/cockpit-ownership.js +9 -0
  534. package/dist/server/cockpit-ownership.js.map +1 -1
  535. package/dist/server/cold-repo-handles.d.ts +2 -7
  536. package/dist/server/cold-repo-handles.js +2 -7
  537. package/dist/server/cold-repo-handles.js.map +1 -1
  538. package/dist/server/completion-actions.d.ts +30 -0
  539. package/dist/server/completion-actions.js +204 -0
  540. package/dist/server/completion-actions.js.map +1 -0
  541. package/dist/server/create-project.d.ts +71 -0
  542. package/dist/server/create-project.js +448 -0
  543. package/dist/server/create-project.js.map +1 -0
  544. package/dist/server/forge/github-filters.d.ts +7 -1
  545. package/dist/server/forge/github-filters.js +66 -51
  546. package/dist/server/forge/github-filters.js.map +1 -1
  547. package/dist/server/forge/github-merge-requirements.d.ts +18 -0
  548. package/dist/server/forge/github-merge-requirements.js +137 -0
  549. package/dist/server/forge/github-merge-requirements.js.map +1 -0
  550. package/dist/server/forge/github.d.ts +98 -111
  551. package/dist/server/forge/github.js +625 -306
  552. package/dist/server/forge/github.js.map +1 -1
  553. package/dist/server/forge/types.d.ts +25 -22
  554. package/dist/server/fs-browse.d.ts +3 -28
  555. package/dist/server/fs-browse.js.map +1 -1
  556. package/dist/server/git-changes.d.ts +5 -15
  557. package/dist/server/git-changes.js +3 -50
  558. package/dist/server/git-changes.js.map +1 -1
  559. package/dist/server/git.d.ts +3 -1
  560. package/dist/server/git.js +12 -0
  561. package/dist/server/git.js.map +1 -1
  562. package/dist/server/github.d.ts +1 -1
  563. package/dist/server/github.js +1 -1
  564. package/dist/server/github.js.map +1 -1
  565. package/dist/server/launch-key.d.ts +2 -4
  566. package/dist/server/launch-key.js +2 -4
  567. package/dist/server/launch-key.js.map +1 -1
  568. package/dist/server/live-routes.d.ts +68 -0
  569. package/dist/server/live-routes.js +147 -0
  570. package/dist/server/live-routes.js.map +1 -0
  571. package/dist/server/open-in-app.d.ts +4 -13
  572. package/dist/server/open-in-app.js +5 -41
  573. package/dist/server/open-in-app.js.map +1 -1
  574. package/dist/server/open-in-targets.d.ts +42 -0
  575. package/dist/server/open-in-targets.js +110 -0
  576. package/dist/server/open-in-targets.js.map +1 -0
  577. package/dist/server/open-in-terminal.d.ts +3 -0
  578. package/dist/server/open-in-terminal.js +6 -26
  579. package/dist/server/open-in-terminal.js.map +1 -1
  580. package/dist/server/preview-cdp-socket.d.ts +21 -0
  581. package/dist/server/preview-cdp-socket.js +112 -0
  582. package/dist/server/preview-cdp-socket.js.map +1 -0
  583. package/dist/server/preview-socket.d.ts +11 -11
  584. package/dist/server/preview-socket.js +22 -22
  585. package/dist/server/preview-socket.js.map +1 -1
  586. package/dist/server/preview-sockets.d.ts +14 -0
  587. package/dist/server/preview-sockets.js +18 -0
  588. package/dist/server/preview-sockets.js.map +1 -0
  589. package/dist/server/project-context.d.ts +54 -18
  590. package/dist/server/project-context.js +178 -5
  591. package/dist/server/project-context.js.map +1 -1
  592. package/dist/server/provider-action-gate.d.ts +0 -2
  593. package/dist/server/provider-action-gate.js +0 -21
  594. package/dist/server/provider-action-gate.js.map +1 -1
  595. package/dist/server/provider-auth-runtime.d.ts +3 -18
  596. package/dist/server/provider-auth-runtime.js +3 -18
  597. package/dist/server/provider-auth-runtime.js.map +1 -1
  598. package/dist/server/repo-branches.d.ts +3 -9
  599. package/dist/server/repo-branches.js +6 -22
  600. package/dist/server/repo-branches.js.map +1 -1
  601. package/dist/server/run-event-feed.d.ts +20 -0
  602. package/dist/server/run-event-feed.js +190 -0
  603. package/dist/server/run-event-feed.js.map +1 -0
  604. package/dist/server/server-deps.d.ts +37 -0
  605. package/dist/server/server-deps.js +114 -0
  606. package/dist/server/server-deps.js.map +1 -0
  607. package/dist/server/server.d.ts +14082 -11998
  608. package/dist/server/server.js +785 -1647
  609. package/dist/server/server.js.map +1 -1
  610. package/dist/server/start-run-options.d.ts +82 -0
  611. package/dist/server/start-run-options.js +111 -0
  612. package/dist/server/start-run-options.js.map +1 -0
  613. package/dist/server/validators.d.ts +3 -29
  614. package/dist/server/validators.js +1 -2
  615. package/dist/server/validators.js.map +1 -1
  616. package/dist/server/ws.d.ts +3 -23
  617. package/dist/server/ws.js +3 -23
  618. package/dist/server/ws.js.map +1 -1
  619. package/dist/server-install/engine.d.ts +6 -9
  620. package/dist/server-install/engine.js +2 -9
  621. package/dist/server-install/engine.js.map +1 -1
  622. package/dist/server-install/platforms/ubuntu-vps.d.ts +1 -1
  623. package/dist/server-install/state.d.ts +2 -4
  624. package/dist/server-install/state.js +2 -4
  625. package/dist/server-install/state.js.map +1 -1
  626. package/dist/server-install/steps.d.ts +2 -5
  627. package/dist/server-install/steps.js +3 -6
  628. package/dist/server-install/steps.js.map +1 -1
  629. package/dist/server-install/types.d.ts +3 -6
  630. package/dist/server-install/types.js +2 -5
  631. package/dist/server-install/types.js.map +1 -1
  632. package/dist/server-install/ui.d.ts +2 -8
  633. package/dist/server-install/ui.js +3 -3
  634. package/dist/server-install/ui.js.map +1 -1
  635. package/dist/session-context.d.ts +64 -0
  636. package/dist/session-context.js +264 -0
  637. package/dist/session-context.js.map +1 -0
  638. package/dist/skills-provision.d.ts +62 -0
  639. package/dist/skills-provision.js +325 -0
  640. package/dist/skills-provision.js.map +1 -0
  641. package/dist/skills-remote.d.ts +29 -27
  642. package/dist/skills-remote.js +236 -100
  643. package/dist/skills-remote.js.map +1 -1
  644. package/dist/skills.d.ts +25 -36
  645. package/dist/skills.js +43 -54
  646. package/dist/skills.js.map +1 -1
  647. package/dist/subcommands.d.ts +11 -0
  648. package/dist/subcommands.js +24 -0
  649. package/dist/subcommands.js.map +1 -0
  650. package/dist/task-cli/cli.js +78 -25
  651. package/dist/task-cli/cli.js.map +1 -1
  652. package/dist/task-cli/discovery.d.ts +4 -2
  653. package/dist/task-cli/discovery.js +14 -13
  654. package/dist/task-cli/discovery.js.map +1 -1
  655. package/dist/task-cli/hint.d.ts +20 -0
  656. package/dist/task-cli/hint.js +14 -0
  657. package/dist/task-cli/hint.js.map +1 -0
  658. package/dist/task-cli/http.d.ts +1 -0
  659. package/dist/task-cli/http.js +3 -1
  660. package/dist/task-cli/http.js.map +1 -1
  661. package/dist/task-cli/projections.d.ts +14 -11
  662. package/dist/task-cli/projections.js +15 -11
  663. package/dist/task-cli/projections.js.map +1 -1
  664. package/dist/task-cli/watch.d.ts +18 -10
  665. package/dist/task-cli/watch.js +128 -20
  666. package/dist/task-cli/watch.js.map +1 -1
  667. package/dist/ui-state.d.ts +17 -3
  668. package/dist/ui-state.js +56 -9
  669. package/dist/ui-state.js.map +1 -1
  670. package/dist/update-check.d.ts +0 -10
  671. package/dist/update-check.js +1 -16
  672. package/dist/update-check.js.map +1 -1
  673. package/dist/voice/decide.d.ts +32 -0
  674. package/dist/voice/decide.js +297 -0
  675. package/dist/voice/decide.js.map +1 -0
  676. package/dist/voice/decision-log.d.ts +52 -0
  677. package/dist/voice/decision-log.js +107 -0
  678. package/dist/voice/decision-log.js.map +1 -0
  679. package/dist/voice/engine.d.ts +119 -0
  680. package/dist/voice/engine.js +60 -0
  681. package/dist/voice/engine.js.map +1 -0
  682. package/dist/voice/fake-engine.d.ts +10 -0
  683. package/dist/voice/fake-engine.js +192 -0
  684. package/dist/voice/fake-engine.js.map +1 -0
  685. package/dist/voice/jev-engine.d.ts +17 -0
  686. package/dist/voice/jev-engine.js +110 -0
  687. package/dist/voice/jev-engine.js.map +1 -0
  688. package/dist/voice/pending-ask.d.ts +17 -0
  689. package/dist/voice/pending-ask.js +50 -0
  690. package/dist/voice/pending-ask.js.map +1 -0
  691. package/dist/voice/routes.d.ts +115 -0
  692. package/dist/voice/routes.js +91 -0
  693. package/dist/voice/routes.js.map +1 -0
  694. package/dist/voice/sentence.d.ts +21 -0
  695. package/dist/voice/sentence.js +61 -0
  696. package/dist/voice/sentence.js.map +1 -0
  697. package/dist/voice/thresholds.d.ts +28 -0
  698. package/dist/voice/thresholds.js +29 -0
  699. package/dist/voice/thresholds.js.map +1 -0
  700. package/dist/webhooks/cli.d.ts +18 -0
  701. package/dist/webhooks/cli.js +145 -0
  702. package/dist/webhooks/cli.js.map +1 -0
  703. package/dist/webhooks/prompt.d.ts +5 -0
  704. package/dist/webhooks/prompt.js +26 -0
  705. package/dist/webhooks/prompt.js.map +1 -0
  706. package/dist/workflows/active-run.d.ts +167 -0
  707. package/dist/workflows/active-run.js +21 -0
  708. package/dist/workflows/active-run.js.map +1 -0
  709. package/dist/workflows/continuation-admission.d.ts +913 -0
  710. package/dist/workflows/continuation-admission.js +265 -0
  711. package/dist/workflows/continuation-admission.js.map +1 -0
  712. package/dist/workflows/execution-account.d.ts +13 -0
  713. package/dist/workflows/execution-account.js +18 -0
  714. package/dist/workflows/execution-account.js.map +1 -0
  715. package/dist/workflows/input-acknowledgement.d.ts +152 -0
  716. package/dist/workflows/input-acknowledgement.js +38 -0
  717. package/dist/workflows/input-acknowledgement.js.map +1 -0
  718. package/dist/workflows/line-order.d.ts +5 -0
  719. package/dist/workflows/line-order.js +25 -0
  720. package/dist/workflows/line-order.js.map +1 -0
  721. package/dist/workflows/outcome-batches.d.ts +20 -0
  722. package/dist/workflows/outcome-batches.js +25 -0
  723. package/dist/workflows/outcome-batches.js.map +1 -0
  724. package/dist/workflows/question-routing.d.ts +8 -0
  725. package/dist/workflows/question-routing.js +18 -0
  726. package/dist/workflows/question-routing.js.map +1 -0
  727. package/dist/workflows/run-scheduling.d.ts +35 -0
  728. package/dist/workflows/run-scheduling.js +61 -0
  729. package/dist/workflows/run-scheduling.js.map +1 -0
  730. package/dist/workflows/run-states.d.ts +190 -0
  731. package/dist/workflows/run-states.js +295 -0
  732. package/dist/workflows/run-states.js.map +1 -0
  733. package/dist/workflows/run.d.ts +1296 -278
  734. package/dist/workflows/run.js +5730 -3265
  735. package/dist/workflows/run.js.map +1 -1
  736. package/dist/workflows/turn-end.d.ts +116 -0
  737. package/dist/workflows/turn-end.js +68 -0
  738. package/dist/workflows/turn-end.js.map +1 -0
  739. package/dist/workflows/types.d.ts +35 -130
  740. package/dist/workflows/types.js +47 -100
  741. package/dist/workflows/types.js.map +1 -1
  742. package/dist/workflows/waits.d.ts +74 -0
  743. package/dist/workflows/waits.js +197 -0
  744. package/dist/workflows/waits.js.map +1 -0
  745. package/dist/workspace/agent-accounts.d.ts +5 -38
  746. package/dist/workspace/agent-accounts.js +14 -40
  747. package/dist/workspace/agent-accounts.js.map +1 -1
  748. package/dist/workspace/agent-profiles.d.ts +40 -16
  749. package/dist/workspace/agent-profiles.js +77 -17
  750. package/dist/workspace/agent-profiles.js.map +1 -1
  751. package/dist/workspace/config.d.ts +48 -49
  752. package/dist/workspace/config.js +68 -72
  753. package/dist/workspace/config.js.map +1 -1
  754. package/dist/workspace/migrations.d.ts +3 -13
  755. package/dist/workspace/migrations.js.map +1 -1
  756. package/dist/workspace/projects-cli.d.ts +1 -1
  757. package/dist/workspace/projects-cli.js.map +1 -1
  758. package/dist/workspace/projects.d.ts +15 -18
  759. package/dist/workspace/projects.js +20 -16
  760. package/dist/workspace/projects.js.map +1 -1
  761. package/dist/workspace/semaphore.d.ts +11 -45
  762. package/dist/workspace/semaphore.js +6 -18
  763. package/dist/workspace/semaphore.js.map +1 -1
  764. package/dist/workspace/ui-state.d.ts +6 -4
  765. package/dist/workspace/ui-state.js +6 -4
  766. package/dist/workspace/ui-state.js.map +1 -1
  767. package/dist/workspace/webhooks.d.ts +40 -0
  768. package/dist/workspace/webhooks.js +146 -0
  769. package/dist/workspace/webhooks.js.map +1 -0
  770. package/dist/worktree-manifest.d.ts +165 -0
  771. package/dist/worktree-manifest.js +530 -0
  772. package/dist/worktree-manifest.js.map +1 -0
  773. package/dist/worktree-setup.js.map +1 -1
  774. package/package.json +6 -5
  775. package/scripts/benchmark-run-store-fixture.ts +7 -3
  776. package/scripts/check-pack.mjs +3 -1
  777. package/scripts/inline-contract.mjs +80 -27
  778. package/scripts/install-as-command.mjs +3 -1
  779. package/scripts/measure-transcript-facts-health.mjs +87 -0
  780. package/scripts/measure-transcript-facts-lag.mjs +68 -0
  781. package/scripts/mock-ci-tool.mjs +49 -6
  782. package/scripts/mock-claude-model-refusal.mjs +42 -0
  783. package/scripts/mock-claude.mjs +833 -591
  784. package/scripts/mock-codex-app-server.mjs +785 -418
  785. package/scripts/mock-cursor-acp.mjs +296 -125
  786. package/scripts/mock-cursor-print.mjs +256 -0
  787. package/scripts/mock-deferred-turn-start.mjs +16 -0
  788. package/scripts/mock-delivery-control.d.mts +23 -0
  789. package/scripts/mock-delivery-control.mjs +80 -0
  790. package/scripts/mock-env-record.mjs +11 -0
  791. package/scripts/mock-failure-control.d.mts +13 -0
  792. package/scripts/mock-failure-control.mjs +68 -0
  793. package/scripts/mock-multi-pr.mjs +7 -0
  794. package/scripts/mock-nudge.mjs +45 -0
  795. package/scripts/mock-omp-rpc.mjs +429 -255
  796. package/scripts/mock-opencode-serve.mjs +972 -557
  797. package/scripts/mock-pi-rpc.mjs +558 -331
  798. package/scripts/mock-runner-crash.mjs +18 -2
  799. package/scripts/mock-session-context.d.mts +5 -0
  800. package/scripts/mock-session-context.mjs +56 -0
  801. package/scripts/mock-silent-tail.mjs +10 -3
  802. package/scripts/pi-default-tools.mjs +22 -0
  803. package/scripts/pi-project-skills.mjs +59 -0
  804. package/scripts/probe-cursor-print.mjs +627 -0
  805. package/scripts/transcript-facts-fixture.mjs +53 -0
  806. package/scripts/voice-replay.ts +50 -0
  807. package/scripts/windows-workspace-identity.cs +208 -0
  808. package/scripts/windows-workspace-identity.ps1 +10 -0
  809. package/web/dist/assets/alert-dialog-DfctKUMw.js +1 -0
  810. package/web/dist/assets/button-CeupvoKG.js +41 -0
  811. package/web/dist/assets/centered-state-hDsyXrnH.js +1 -0
  812. package/web/dist/assets/cez-idle-D3aj_9lp.js +1 -0
  813. package/web/dist/assets/diff-BnIXZK3i2.js +3 -0
  814. package/web/dist/assets/diff-controls-GewpW9aF.js +1 -0
  815. package/web/dist/assets/diff-view-Byo7gpvW.js +11 -0
  816. package/web/dist/assets/dropdown-menu-COj_J5wd.js +6 -0
  817. package/web/dist/assets/eye-B8okNWXU.js +1 -0
  818. package/web/dist/assets/git-toolbar-DY0z0n4S.js +1 -0
  819. package/web/dist/assets/github-DwU6ALRK.js +1 -0
  820. package/web/dist/assets/{image-preview-FOEfqpZP.js → image-preview-C_t9q45f.js} +1 -1
  821. package/web/dist/assets/index-BOfE8pyD.js +34 -0
  822. package/web/dist/assets/index-D9HpsmdW.css +1 -0
  823. package/web/dist/assets/live-protocol-Uce2NwEX.js +64 -0
  824. package/web/dist/assets/live-worker-BizfZSoh.ts +33 -0
  825. package/web/dist/assets/markdown-BBDDg-4t.js +1 -0
  826. package/web/dist/assets/nav-row-styles-AoIhhIwf.js +1 -0
  827. package/web/dist/assets/popover-D56fhiXj.js +1 -0
  828. package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +3 -0
  829. package/web/dist/assets/reference-chip-gQNk-4jc.js +1 -0
  830. package/web/dist/assets/repo-git-B5ECDUuv.js +1 -0
  831. package/web/dist/assets/{repo-git-CoKp-g9K.css → repo-git-DVXNOJDT.css} +1 -1
  832. package/web/dist/assets/run-header-C0Y1NvEM.js +2 -0
  833. package/web/dist/assets/run-header-CC7VUTg9.css +1 -0
  834. package/web/dist/assets/skills-DUeTkZ9z.js +1 -0
  835. package/web/dist/assets/status-dot-1PR0i69P.js +1 -0
  836. package/web/dist/assets/tab-link-DmWk4l5O.js +1 -0
  837. package/web/dist/assets/task-changes-DKZXuW89.js +1 -0
  838. package/web/dist/assets/task-commits-BZ6KxWdF.js +1 -0
  839. package/web/dist/assets/task-files-DlF7Apcn.js +2 -0
  840. package/web/dist/assets/task-github-item-CVPo3geZ.js +1 -0
  841. package/web/dist/assets/task-thread-DtQ6uGfQ.css +1 -0
  842. package/web/dist/assets/task-thread-mm4-ECyo.js +9 -0
  843. package/web/dist/assets/thread-state-CIw2BlhT.js +4 -0
  844. package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +1 -0
  845. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +1 -0
  846. package/web/dist/assets/workflows-D8vYD-ql.js +7 -0
  847. package/web/dist/assets/zoomable-image-CxQSsfcn.js +1 -0
  848. package/web/dist/index.html +13 -17
  849. package/web/dist/live-worker.js +4 -0
  850. package/dist/core/tool-display.js +0 -179
  851. package/dist/core/tool-display.js.map +0 -1
  852. package/dist/runs/human-ask-summary.d.ts +0 -9
  853. package/dist/runs/human-ask-summary.js +0 -39
  854. package/dist/runs/human-ask-summary.js.map +0 -1
  855. package/dist/runs/run-search.d.ts +0 -29
  856. package/dist/runs/run-search.js +0 -63
  857. package/dist/runs/run-search.js.map +0 -1
  858. package/dist/skills-banner.d.ts +0 -22
  859. package/dist/skills-banner.js +0 -41
  860. package/dist/skills-banner.js.map +0 -1
  861. package/dist/skills-update.d.ts +0 -88
  862. package/dist/skills-update.js +0 -392
  863. package/dist/skills-update.js.map +0 -1
  864. package/dist/todos.d.ts +0 -48
  865. package/dist/todos.js +0 -201
  866. package/dist/todos.js.map +0 -1
  867. package/web/dist/assets/agent-accounts-CFOBMVHc.js +0 -1
  868. package/web/dist/assets/alert-dialog-BrpNUwMt.js +0 -1
  869. package/web/dist/assets/button-C_rd7CPp.js +0 -43
  870. package/web/dist/assets/compare-variants-D6WXhvXA.js +0 -1
  871. package/web/dist/assets/diff-DrEARXTV.js +0 -3
  872. package/web/dist/assets/diff-controls-B1-j7nFg.js +0 -1
  873. package/web/dist/assets/diff-view-DvGLjdTk.js +0 -6
  874. package/web/dist/assets/dropdown-menu-BegOZFrj.js +0 -1
  875. package/web/dist/assets/format-DpNe3S0A.js +0 -1
  876. package/web/dist/assets/git-toolbar-Cw4ljmhB.js +0 -1
  877. package/web/dist/assets/github-CfV5sqL0.js +0 -1
  878. package/web/dist/assets/index-DgWWlOLy.js +0 -13
  879. package/web/dist/assets/index-fBFnuvxu.css +0 -1
  880. package/web/dist/assets/nav-row-styles-vp2JbhuJ.js +0 -1
  881. package/web/dist/assets/popover-BohP6WTx.js +0 -1
  882. package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +0 -3
  883. package/web/dist/assets/preview-state-vuMviq6q.js +0 -1
  884. package/web/dist/assets/prompt-templates-Cubdut_C.js +0 -15
  885. package/web/dist/assets/repo-git-Cf4t5PD0.js +0 -1
  886. package/web/dist/assets/run-diff-BpkUW37Z.js +0 -3
  887. package/web/dist/assets/run-header-68WHf9wV.js +0 -1
  888. package/web/dist/assets/run-header-8GObNx6F.css +0 -1
  889. package/web/dist/assets/search-x-I9Q8pgUa.js +0 -1
  890. package/web/dist/assets/skills-DFBiAuJG.js +0 -1
  891. package/web/dist/assets/skills-DiVIgKeU.js +0 -1
  892. package/web/dist/assets/square-terminal-B6RYYieR.js +0 -1
  893. package/web/dist/assets/status-dot-CqTJHSP9.js +0 -1
  894. package/web/dist/assets/tab-link-B07Hu4QX.js +0 -1
  895. package/web/dist/assets/task-changes--lQF6EYf.js +0 -1
  896. package/web/dist/assets/task-commits-Cx0qy4DN.js +0 -1
  897. package/web/dist/assets/task-files-D50s-gKW.js +0 -2
  898. package/web/dist/assets/task-github-item-DaqmSwYT.js +0 -1
  899. package/web/dist/assets/task-thread-BPQ64lui.js +0 -7
  900. package/web/dist/assets/task-thread-zNE2Q9E-.css +0 -1
  901. package/web/dist/assets/textarea-D20O4Pw0.js +0 -1
  902. package/web/dist/assets/thread-state-DWcFMrvb.js +0 -4
  903. package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +0 -1
  904. package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +0 -1
  905. package/web/dist/assets/utils-JsL3ZsJf.js +0 -64
  906. package/web/dist/assets/workflows-jwG7uxqi.js +0 -11
  907. package/web/dist/assets/zoomable-image-BJJ64KGc.js +0 -1
@@ -1,23 +1,18 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { type WorkerExecution } from './worker-execution.ts';
3
3
  import { z } from 'zod';
4
- import type { ArchiveFinishedScope, ArchivedRunsResponse, CiWait, ConversationState, AgentInput, InboxClaim, DelegationState, RunSummary, WorkerCollectedResult, WorkerDestroyRetry } from '../contract/index.js';
4
+ import { queuedMessageSchema } from '../contract/index.js';
5
+ import type { ArchiveFinishedScope, ArchivedRunsResponse, ArchivePullRequestIdentity, CiWait, PrWaitEntry, ConversationState, AgentInput, InboxClaim, DelegationState, MergedPullRequest, RunSummary, Wait, WorkerCollectedResult, WorkerDestroyRetry, WorkerWait, WorkerWaitEntry } from '../contract/index.js';
6
+ import { type AutomationNames } from '../contract/index.js';
5
7
  import { type TranscriptFacts } from './transcript-facts.ts';
6
8
  import { type WorkerExecutionIdentity } from '../delegation/execution-identity.ts';
7
9
  import { type CwdSource, type WorkerProcessRecord } from '../delegation/process-liveness.ts';
8
10
  import { workflowDefSchema } from '../workflows/types.ts';
11
+ import { type OutcomeDependencies, type RunOutcome } from './outcome-commit.ts';
12
+ import { type RunnerId } from '../core/agent-runner.ts';
9
13
  import { type RawExtras } from './raw-record.ts';
10
14
  import { RunStoreOpenError } from './store-open-error.ts';
11
- import type { RunnerId } from '../core/agent-runner.ts';
12
15
  export type RunStatus = 'queued' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled';
13
- /**
14
- * A sub-state of `running` (spec 2026-07-18-subagent-monitoring-status, #490):
15
- * the agent ended its turn still working on its own downstream work (a sub-agent
16
- * or a monitored command) and declared it with the `CEZ:MONITORING` marker — so
17
- * the cockpit shows a non-attention "monitoring" label instead of "needs you".
18
- * Only ever set while `status === 'running'`; cleared on resume/terminal.
19
- */
20
- export type RunActivity = 'monitoring';
21
16
  export type StepStatus = 'pending' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled' | 'skipped';
22
17
  declare const stepStateSchema: z.ZodObject<{
23
18
  id: z.ZodString;
@@ -50,6 +45,13 @@ declare const stepStateSchema: z.ZodObject<{
50
45
  finishedAt: z.ZodOptional<z.ZodString>;
51
46
  error: z.ZodOptional<z.ZodString>;
52
47
  sessionId: z.ZodOptional<z.ZodString>;
48
+ sessionTransport: z.ZodOptional<z.ZodEnum<{
49
+ "cursor-acp": "cursor-acp";
50
+ "cursor-print": "cursor-print";
51
+ }>>;
52
+ profileId: z.ZodOptional<z.ZodString>;
53
+ costUsd: z.ZodOptional<z.ZodNumber>;
54
+ synthetic: z.ZodOptional<z.ZodLiteral<"continuation">>;
53
55
  backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
54
56
  claude: "claude";
55
57
  "claude-cli": "claude-cli";
@@ -59,19 +61,6 @@ declare const stepStateSchema: z.ZodObject<{
59
61
  opencode: "opencode";
60
62
  pi: "pi";
61
63
  }>, z.ZodTransform<"claude" | "codex" | "cursor" | "omp" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "cursor" | "omp" | "opencode" | "pi">>>;
62
- profileId: z.ZodOptional<z.ZodString>;
63
- costUsd: z.ZodOptional<z.ZodNumber>;
64
- synthetic: z.ZodOptional<z.ZodLiteral<"continuation">>;
65
- }, z.core.$strip>;
66
- /** One prompt message stacked onto a run while it waits for a free agent slot
67
- * (#472). Folded into `{{task}}` at dequeue by `hydrateQueuedInput`; never
68
- * delivered as its own turn — a follow-up turn would reach only the first step
69
- * of a chain and would race the opening turn. */
70
- declare const queuedMessageSchema: z.ZodObject<{
71
- id: z.ZodString;
72
- text: z.ZodString;
73
- images: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
- createdAt: z.ZodString;
75
64
  }, z.core.$strip>;
76
65
  /** Exported for `./run-index.ts`, the read-only reader of the same records. Nothing else should
77
66
  * parse a stored run — see `reconcileLoadedRun` for why a second parser is a correctness risk. */
@@ -103,133 +92,837 @@ export declare const runRecordSchema: z.ZodObject<{
103
92
  lifecycle: "lifecycle";
104
93
  }>>;
105
94
  agentInputId: z.ZodOptional<z.ZodUUID>;
95
+ resumeContext: z.ZodOptional<z.ZodObject<{
96
+ failure: z.ZodOptional<z.ZodObject<{
97
+ stepId: z.ZodOptional<z.ZodString>;
98
+ error: z.ZodString;
99
+ }, z.core.$strip>>;
100
+ restarted: z.ZodOptional<z.ZodLiteral<true>>;
101
+ }, z.core.$strip>>;
106
102
  }, z.core.$strip>>;
103
+ workflowResumeStepId: z.ZodOptional<z.ZodString>;
107
104
  invalidAsk: z.ZodOptional<z.ZodBoolean>;
108
- delegation: z.ZodCatch<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
109
- role: z.ZodLiteral<"root">;
105
+ agentInputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
110
106
  conversation: z.ZodOptional<z.ZodObject<{
111
- messages: z.ZodArray<z.ZodObject<{
112
- senderRunId: z.ZodUUID;
113
- recipientRunId: z.ZodUUID;
114
- kind: z.ZodEnum<{
115
- "follow-up": "follow-up";
116
- progress: "progress";
117
- reply: "reply";
118
- request: "request";
119
- }>;
120
- requestId: z.ZodOptional<z.ZodUUID>;
121
- id: z.ZodUUID;
122
- text: z.ZodString;
123
- createdAt: z.ZodISODateTime;
124
- deadline: z.ZodOptional<z.ZodISODateTime>;
125
- requestHash: z.ZodString;
126
- state: z.ZodEnum<{
127
- accepted: "accepted";
128
- "continuation-required": "continuation-required";
129
- destroyed: "destroyed";
130
- late: "late";
131
- }>;
132
- resumed: z.ZodOptional<z.ZodLiteral<true>>;
133
- instruction: z.ZodOptional<z.ZodString>;
134
- question: z.ZodOptional<z.ZodObject<{
135
- questions: z.ZodArray<z.ZodObject<{
136
- id: z.ZodOptional<z.ZodString>;
137
- header: z.ZodString;
138
- question: z.ZodString;
139
- options: z.ZodArray<z.ZodObject<{
140
- label: z.ZodString;
141
- description: z.ZodOptional<z.ZodString>;
142
- }, z.core.$strict>>;
143
- multiSelect: z.ZodOptional<z.ZodBoolean>;
144
- }, z.core.$strict>>;
145
- }, z.core.$strict>>;
146
- }, z.core.$strict>>;
147
- outcomes: z.ZodArray<z.ZodObject<{
148
- requestId: z.ZodUUID;
149
- status: z.ZodEnum<{
150
- cancelled: "cancelled";
151
- "completed-without-reply": "completed-without-reply";
152
- destroyed: "destroyed";
153
- failed: "failed";
154
- "human-fallback": "human-fallback";
155
- replied: "replied";
156
- "sender-closed": "sender-closed";
157
- "timed-out": "timed-out";
158
- }>;
159
- observedAt: z.ZodISODateTime;
160
- replyId: z.ZodOptional<z.ZodUUID>;
161
- }, z.core.$strict>>;
107
+ senderRunId: z.ZodUUID;
108
+ recipientRunId: z.ZodUUID;
109
+ kind: z.ZodEnum<{
110
+ "follow-up": "follow-up";
111
+ progress: "progress";
112
+ reply: "reply";
113
+ request: "request";
114
+ }>;
115
+ requestId: z.ZodOptional<z.ZodUUID>;
162
116
  }, z.core.$strict>>;
163
- permissions: z.ZodArray<z.ZodEnum<{
164
- destroy: "destroy";
165
- diff: "diff";
166
- inspect: "inspect";
167
- spawn: "spawn";
168
- steer: "steer";
169
- stop: "stop";
170
- wait: "wait";
171
- }>>;
172
- receipts: z.ZodArray<z.ZodObject<{
173
- requestId: z.ZodUUID;
174
- workerId: z.ZodUUID;
175
- requestHash: z.ZodString;
176
- deletion: z.ZodOptional<z.ZodObject<{
177
- phase: z.ZodEnum<{
178
- complete: "complete";
179
- pending: "pending";
180
- }>;
181
- revision: z.ZodNumber;
182
- resourceId: z.ZodUUID;
183
- generation: z.ZodUUID;
184
- }, z.core.$strict>>;
117
+ id: z.ZodUUID;
118
+ source: z.ZodEnum<{
119
+ agent: "agent";
120
+ lifecycle: "lifecycle";
121
+ }>;
122
+ parentRunId: z.ZodUUID;
123
+ text: z.ZodString;
124
+ createdAt: z.ZodISODateTime;
125
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
126
+ consumedAt: z.ZodOptional<z.ZodISODateTime>;
127
+ awaitingRead: z.ZodOptional<z.ZodLiteral<true>>;
128
+ inboxClaim: z.ZodOptional<z.ZodObject<{
129
+ receiptId: z.ZodUUID;
130
+ generation: z.ZodUUID;
131
+ expiresAt: z.ZodISODateTime;
132
+ acknowledgedAt: z.ZodOptional<z.ZodISODateTime>;
133
+ memberIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
185
134
  }, z.core.$strict>>;
186
- wait: z.ZodOptional<z.ZodObject<{
187
- id: z.ZodUUID;
188
- workerIds: z.ZodArray<z.ZodUUID>;
189
- requestIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
190
- requestOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
- requestId: z.ZodUUID;
192
- status: z.ZodEnum<{
193
- cancelled: "cancelled";
194
- "completed-without-reply": "completed-without-reply";
195
- destroyed: "destroyed";
196
- failed: "failed";
197
- "human-fallback": "human-fallback";
198
- replied: "replied";
199
- "sender-closed": "sender-closed";
200
- "timed-out": "timed-out";
201
- }>;
202
- observedAt: z.ZodISODateTime;
203
- replyId: z.ZodOptional<z.ZodUUID>;
204
- }, z.core.$strict>>>;
205
- deadline: z.ZodISODateTime;
206
- mode: z.ZodOptional<z.ZodEnum<{
207
- all: "all";
208
- any: "any";
209
- one: "one";
135
+ purpose: z.ZodOptional<z.ZodLiteral<"completion-refusal">>;
136
+ }, z.core.$strict>>>;
137
+ waits: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
138
+ prUrl: z.ZodString;
139
+ repository: z.ZodString;
140
+ prNumber: z.ZodNumber;
141
+ headSha: z.ZodString;
142
+ id: z.ZodUUID;
143
+ source: z.ZodEnum<{
144
+ agent: "agent";
145
+ cezar: "cezar";
146
+ }>;
147
+ via: z.ZodEnum<{
148
+ "ask-line": "ask-line";
149
+ budget: "budget";
150
+ "cez-worker-wait": "cez-worker-wait";
151
+ cezar_ask: "cezar_ask";
152
+ cezar_wait: "cezar_wait";
153
+ cezar_wait_for_ci: "cezar_wait_for_ci";
154
+ completion: "completion";
155
+ "monitoring-line": "monitoring-line";
156
+ "native-ask": "native-ask";
157
+ "no-wait": "no-wait";
158
+ "schedule-wakeup": "schedule-wakeup";
159
+ }>;
160
+ registeredAt: z.ZodISODateTime;
161
+ phase: z.ZodEnum<{
162
+ cancelled: "cancelled";
163
+ delivered: "delivered";
164
+ open: "open";
165
+ resolved: "resolved";
166
+ }>;
167
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
168
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
169
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
170
+ turnId: z.ZodString;
171
+ kind: z.ZodLiteral<"pr">;
172
+ deadline: z.ZodISODateTime;
173
+ generation: z.ZodString;
174
+ timeoutSeconds: z.ZodNumber;
175
+ until: z.ZodEnum<{
176
+ checks: "checks";
177
+ merge: "merge";
178
+ }>;
179
+ wakeOnConflict: z.ZodBoolean;
180
+ result: z.ZodOptional<z.ZodObject<{
181
+ outcome: z.ZodEnum<{
182
+ cancelled: "cancelled";
183
+ closed: "closed";
184
+ conflicting: "conflicting";
185
+ deadline: "deadline";
186
+ error: "error";
187
+ failed: "failed";
188
+ head_changed: "head_changed";
189
+ merged: "merged";
190
+ no_checks: "no_checks";
191
+ passed: "passed";
192
+ skipped: "skipped";
193
+ }>;
194
+ headSha: z.ZodString;
195
+ observedHeadSha: z.ZodOptional<z.ZodString>;
196
+ mergeable: z.ZodOptional<z.ZodEnum<{
197
+ CONFLICTING: "CONFLICTING";
198
+ MERGEABLE: "MERGEABLE";
199
+ UNKNOWN: "UNKNOWN";
210
200
  }>>;
211
- revisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
212
- workerId: z.ZodUUID;
213
- revision: z.ZodNumber;
201
+ mergeStateStatus: z.ZodOptional<z.ZodString>;
202
+ mergedAt: z.ZodOptional<z.ZodISODateTime>;
203
+ mergeCommitSha: z.ZodOptional<z.ZodString>;
204
+ observedAt: z.ZodISODateTime;
205
+ checks: z.ZodArray<z.ZodObject<{
206
+ name: z.ZodString;
207
+ state: z.ZodString;
208
+ link: z.ZodString;
209
+ }, z.core.$strict>>;
210
+ totalChecks: z.ZodNumber;
211
+ truncated: z.ZodBoolean;
212
+ diagnostic: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strict>>;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ id: z.ZodUUID;
216
+ source: z.ZodEnum<{
217
+ agent: "agent";
218
+ cezar: "cezar";
219
+ }>;
220
+ via: z.ZodEnum<{
221
+ "ask-line": "ask-line";
222
+ budget: "budget";
223
+ "cez-worker-wait": "cez-worker-wait";
224
+ cezar_ask: "cezar_ask";
225
+ cezar_wait: "cezar_wait";
226
+ cezar_wait_for_ci: "cezar_wait_for_ci";
227
+ completion: "completion";
228
+ "monitoring-line": "monitoring-line";
229
+ "native-ask": "native-ask";
230
+ "no-wait": "no-wait";
231
+ "schedule-wakeup": "schedule-wakeup";
232
+ }>;
233
+ registeredAt: z.ZodISODateTime;
234
+ phase: z.ZodEnum<{
235
+ cancelled: "cancelled";
236
+ delivered: "delivered";
237
+ open: "open";
238
+ resolved: "resolved";
239
+ }>;
240
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
241
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
242
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
243
+ turnId: z.ZodString;
244
+ kind: z.ZodLiteral<"timer">;
245
+ deadline: z.ZodISODateTime;
246
+ seconds: z.ZodNumber;
247
+ note: z.ZodOptional<z.ZodString>;
248
+ }, z.core.$strict>, z.ZodObject<{
249
+ id: z.ZodUUID;
250
+ source: z.ZodEnum<{
251
+ agent: "agent";
252
+ cezar: "cezar";
253
+ }>;
254
+ via: z.ZodEnum<{
255
+ "ask-line": "ask-line";
256
+ budget: "budget";
257
+ "cez-worker-wait": "cez-worker-wait";
258
+ cezar_ask: "cezar_ask";
259
+ cezar_wait: "cezar_wait";
260
+ cezar_wait_for_ci: "cezar_wait_for_ci";
261
+ completion: "completion";
262
+ "monitoring-line": "monitoring-line";
263
+ "native-ask": "native-ask";
264
+ "no-wait": "no-wait";
265
+ "schedule-wakeup": "schedule-wakeup";
266
+ }>;
267
+ registeredAt: z.ZodISODateTime;
268
+ phase: z.ZodEnum<{
269
+ cancelled: "cancelled";
270
+ delivered: "delivered";
271
+ open: "open";
272
+ resolved: "resolved";
273
+ }>;
274
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
275
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
276
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
277
+ turnId: z.ZodString;
278
+ kind: z.ZodLiteral<"human">;
279
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
280
+ id: z.ZodOptional<z.ZodString>;
281
+ header: z.ZodString;
282
+ question: z.ZodString;
283
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
284
+ label: z.ZodString;
285
+ description: z.ZodOptional<z.ZodString>;
214
286
  }, z.core.$strict>>>;
215
- reason: z.ZodOptional<z.ZodEnum<{
287
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
288
+ }, z.core.$strict>>>;
289
+ context: z.ZodOptional<z.ZodString>;
290
+ askSeq: z.ZodOptional<z.ZodNumber>;
291
+ }, z.core.$strict>, z.ZodObject<{
292
+ id: z.ZodUUID;
293
+ source: z.ZodEnum<{
294
+ agent: "agent";
295
+ cezar: "cezar";
296
+ }>;
297
+ via: z.ZodEnum<{
298
+ "ask-line": "ask-line";
299
+ budget: "budget";
300
+ "cez-worker-wait": "cez-worker-wait";
301
+ cezar_ask: "cezar_ask";
302
+ cezar_wait: "cezar_wait";
303
+ cezar_wait_for_ci: "cezar_wait_for_ci";
304
+ completion: "completion";
305
+ "monitoring-line": "monitoring-line";
306
+ "native-ask": "native-ask";
307
+ "no-wait": "no-wait";
308
+ "schedule-wakeup": "schedule-wakeup";
309
+ }>;
310
+ registeredAt: z.ZodISODateTime;
311
+ phase: z.ZodEnum<{
312
+ cancelled: "cancelled";
313
+ delivered: "delivered";
314
+ open: "open";
315
+ resolved: "resolved";
316
+ }>;
317
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
318
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
319
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
320
+ turnId: z.ZodString;
321
+ kind: z.ZodLiteral<"worker">;
322
+ deadline: z.ZodOptional<z.ZodISODateTime>;
323
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
324
+ mode: z.ZodOptional<z.ZodEnum<{
325
+ all: "all";
326
+ any: "any";
327
+ one: "one";
328
+ }>>;
329
+ workerIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
330
+ revisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
331
+ workerId: z.ZodUUID;
332
+ revision: z.ZodNumber;
333
+ }, z.core.$strict>>>;
334
+ outcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
335
+ workerId: z.ZodUUID;
336
+ status: z.ZodEnum<{
216
337
  cancelled: "cancelled";
217
- message: "message";
338
+ done: "done";
339
+ failed: "failed";
340
+ review: "review";
341
+ }>;
342
+ observedAt: z.ZodISODateTime;
343
+ summary: z.ZodOptional<z.ZodString>;
344
+ revision: z.ZodOptional<z.ZodNumber>;
345
+ }, z.core.$strict>>>;
346
+ requestIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
347
+ requestOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
348
+ requestId: z.ZodUUID;
349
+ status: z.ZodEnum<{
350
+ cancelled: "cancelled";
351
+ "completed-without-reply": "completed-without-reply";
352
+ destroyed: "destroyed";
353
+ failed: "failed";
354
+ "human-fallback": "human-fallback";
355
+ replied: "replied";
356
+ "replied-late": "replied-late";
357
+ "sender-closed": "sender-closed";
358
+ "timed-out": "timed-out";
359
+ }>;
360
+ observedAt: z.ZodISODateTime;
361
+ replyId: z.ZodOptional<z.ZodUUID>;
362
+ }, z.core.$strict>>>;
363
+ result: z.ZodOptional<z.ZodObject<{
364
+ reason: z.ZodEnum<{
218
365
  outcome: "outcome";
219
366
  timeout: "timeout";
220
- }>>;
221
- phase: z.ZodEnum<{
222
- parked: "parked";
223
- registered: "registered";
224
- "wake-pending": "wake-pending";
225
367
  }>;
226
- outcomes: z.ZodArray<z.ZodObject<{
227
- workerId: z.ZodUUID;
228
- status: z.ZodEnum<{
229
- cancelled: "cancelled";
230
- done: "done";
231
- failed: "failed";
232
- review: "review";
368
+ }, z.core.$strict>>;
369
+ wakeInputId: z.ZodOptional<z.ZodUUID>;
370
+ }, z.core.$strict>, z.ZodObject<{
371
+ id: z.ZodUUID;
372
+ source: z.ZodEnum<{
373
+ agent: "agent";
374
+ cezar: "cezar";
375
+ }>;
376
+ via: z.ZodEnum<{
377
+ "ask-line": "ask-line";
378
+ budget: "budget";
379
+ "cez-worker-wait": "cez-worker-wait";
380
+ cezar_ask: "cezar_ask";
381
+ cezar_wait: "cezar_wait";
382
+ cezar_wait_for_ci: "cezar_wait_for_ci";
383
+ completion: "completion";
384
+ "monitoring-line": "monitoring-line";
385
+ "native-ask": "native-ask";
386
+ "no-wait": "no-wait";
387
+ "schedule-wakeup": "schedule-wakeup";
388
+ }>;
389
+ registeredAt: z.ZodISODateTime;
390
+ phase: z.ZodEnum<{
391
+ cancelled: "cancelled";
392
+ delivered: "delivered";
393
+ open: "open";
394
+ resolved: "resolved";
395
+ }>;
396
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
397
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
398
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
399
+ turnId: z.ZodString;
400
+ kind: z.ZodLiteral<"process">;
401
+ deadline: z.ZodISODateTime;
402
+ timeoutSeconds: z.ZodNumber;
403
+ pid: z.ZodNumber;
404
+ startToken: z.ZodOptional<z.ZodString>;
405
+ exitFile: z.ZodOptional<z.ZodString>;
406
+ note: z.ZodOptional<z.ZodString>;
407
+ result: z.ZodOptional<z.ZodObject<{
408
+ outcome: z.ZodEnum<{
409
+ deadline: "deadline";
410
+ error: "error";
411
+ exit_file: "exit_file";
412
+ exited: "exited";
413
+ }>;
414
+ observedAt: z.ZodISODateTime;
415
+ exitCode: z.ZodOptional<z.ZodNumber>;
416
+ exitFileNote: z.ZodOptional<z.ZodLiteral<"not-an-exit-code">>;
417
+ diagnostic: z.ZodOptional<z.ZodString>;
418
+ }, z.core.$strict>>;
419
+ }, z.core.$strict>], "kind">>>;
420
+ lastWaits: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
421
+ prUrl: z.ZodString;
422
+ repository: z.ZodString;
423
+ prNumber: z.ZodNumber;
424
+ headSha: z.ZodString;
425
+ id: z.ZodUUID;
426
+ source: z.ZodEnum<{
427
+ agent: "agent";
428
+ cezar: "cezar";
429
+ }>;
430
+ via: z.ZodEnum<{
431
+ "ask-line": "ask-line";
432
+ budget: "budget";
433
+ "cez-worker-wait": "cez-worker-wait";
434
+ cezar_ask: "cezar_ask";
435
+ cezar_wait: "cezar_wait";
436
+ cezar_wait_for_ci: "cezar_wait_for_ci";
437
+ completion: "completion";
438
+ "monitoring-line": "monitoring-line";
439
+ "native-ask": "native-ask";
440
+ "no-wait": "no-wait";
441
+ "schedule-wakeup": "schedule-wakeup";
442
+ }>;
443
+ registeredAt: z.ZodISODateTime;
444
+ phase: z.ZodEnum<{
445
+ cancelled: "cancelled";
446
+ delivered: "delivered";
447
+ open: "open";
448
+ resolved: "resolved";
449
+ }>;
450
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
451
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
452
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
453
+ turnId: z.ZodString;
454
+ kind: z.ZodLiteral<"pr">;
455
+ deadline: z.ZodISODateTime;
456
+ generation: z.ZodString;
457
+ timeoutSeconds: z.ZodNumber;
458
+ until: z.ZodEnum<{
459
+ checks: "checks";
460
+ merge: "merge";
461
+ }>;
462
+ wakeOnConflict: z.ZodBoolean;
463
+ result: z.ZodOptional<z.ZodObject<{
464
+ outcome: z.ZodEnum<{
465
+ cancelled: "cancelled";
466
+ closed: "closed";
467
+ conflicting: "conflicting";
468
+ deadline: "deadline";
469
+ error: "error";
470
+ failed: "failed";
471
+ head_changed: "head_changed";
472
+ merged: "merged";
473
+ no_checks: "no_checks";
474
+ passed: "passed";
475
+ skipped: "skipped";
476
+ }>;
477
+ headSha: z.ZodString;
478
+ observedHeadSha: z.ZodOptional<z.ZodString>;
479
+ mergeable: z.ZodOptional<z.ZodEnum<{
480
+ CONFLICTING: "CONFLICTING";
481
+ MERGEABLE: "MERGEABLE";
482
+ UNKNOWN: "UNKNOWN";
483
+ }>>;
484
+ mergeStateStatus: z.ZodOptional<z.ZodString>;
485
+ mergedAt: z.ZodOptional<z.ZodISODateTime>;
486
+ mergeCommitSha: z.ZodOptional<z.ZodString>;
487
+ observedAt: z.ZodISODateTime;
488
+ checks: z.ZodArray<z.ZodObject<{
489
+ name: z.ZodString;
490
+ state: z.ZodString;
491
+ link: z.ZodString;
492
+ }, z.core.$strict>>;
493
+ totalChecks: z.ZodNumber;
494
+ truncated: z.ZodBoolean;
495
+ diagnostic: z.ZodOptional<z.ZodString>;
496
+ }, z.core.$strict>>;
497
+ }, z.core.$strict>, z.ZodObject<{
498
+ id: z.ZodUUID;
499
+ source: z.ZodEnum<{
500
+ agent: "agent";
501
+ cezar: "cezar";
502
+ }>;
503
+ via: z.ZodEnum<{
504
+ "ask-line": "ask-line";
505
+ budget: "budget";
506
+ "cez-worker-wait": "cez-worker-wait";
507
+ cezar_ask: "cezar_ask";
508
+ cezar_wait: "cezar_wait";
509
+ cezar_wait_for_ci: "cezar_wait_for_ci";
510
+ completion: "completion";
511
+ "monitoring-line": "monitoring-line";
512
+ "native-ask": "native-ask";
513
+ "no-wait": "no-wait";
514
+ "schedule-wakeup": "schedule-wakeup";
515
+ }>;
516
+ registeredAt: z.ZodISODateTime;
517
+ phase: z.ZodEnum<{
518
+ cancelled: "cancelled";
519
+ delivered: "delivered";
520
+ open: "open";
521
+ resolved: "resolved";
522
+ }>;
523
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
524
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
525
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
526
+ turnId: z.ZodString;
527
+ kind: z.ZodLiteral<"timer">;
528
+ deadline: z.ZodISODateTime;
529
+ seconds: z.ZodNumber;
530
+ note: z.ZodOptional<z.ZodString>;
531
+ }, z.core.$strict>, z.ZodObject<{
532
+ id: z.ZodUUID;
533
+ source: z.ZodEnum<{
534
+ agent: "agent";
535
+ cezar: "cezar";
536
+ }>;
537
+ via: z.ZodEnum<{
538
+ "ask-line": "ask-line";
539
+ budget: "budget";
540
+ "cez-worker-wait": "cez-worker-wait";
541
+ cezar_ask: "cezar_ask";
542
+ cezar_wait: "cezar_wait";
543
+ cezar_wait_for_ci: "cezar_wait_for_ci";
544
+ completion: "completion";
545
+ "monitoring-line": "monitoring-line";
546
+ "native-ask": "native-ask";
547
+ "no-wait": "no-wait";
548
+ "schedule-wakeup": "schedule-wakeup";
549
+ }>;
550
+ registeredAt: z.ZodISODateTime;
551
+ phase: z.ZodEnum<{
552
+ cancelled: "cancelled";
553
+ delivered: "delivered";
554
+ open: "open";
555
+ resolved: "resolved";
556
+ }>;
557
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
558
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
559
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
560
+ turnId: z.ZodString;
561
+ kind: z.ZodLiteral<"human">;
562
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
563
+ id: z.ZodOptional<z.ZodString>;
564
+ header: z.ZodString;
565
+ question: z.ZodString;
566
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
567
+ label: z.ZodString;
568
+ description: z.ZodOptional<z.ZodString>;
569
+ }, z.core.$strict>>>;
570
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
571
+ }, z.core.$strict>>>;
572
+ context: z.ZodOptional<z.ZodString>;
573
+ askSeq: z.ZodOptional<z.ZodNumber>;
574
+ }, z.core.$strict>, z.ZodObject<{
575
+ id: z.ZodUUID;
576
+ source: z.ZodEnum<{
577
+ agent: "agent";
578
+ cezar: "cezar";
579
+ }>;
580
+ via: z.ZodEnum<{
581
+ "ask-line": "ask-line";
582
+ budget: "budget";
583
+ "cez-worker-wait": "cez-worker-wait";
584
+ cezar_ask: "cezar_ask";
585
+ cezar_wait: "cezar_wait";
586
+ cezar_wait_for_ci: "cezar_wait_for_ci";
587
+ completion: "completion";
588
+ "monitoring-line": "monitoring-line";
589
+ "native-ask": "native-ask";
590
+ "no-wait": "no-wait";
591
+ "schedule-wakeup": "schedule-wakeup";
592
+ }>;
593
+ registeredAt: z.ZodISODateTime;
594
+ phase: z.ZodEnum<{
595
+ cancelled: "cancelled";
596
+ delivered: "delivered";
597
+ open: "open";
598
+ resolved: "resolved";
599
+ }>;
600
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
601
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
602
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
603
+ turnId: z.ZodString;
604
+ kind: z.ZodLiteral<"worker">;
605
+ deadline: z.ZodOptional<z.ZodISODateTime>;
606
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
607
+ mode: z.ZodOptional<z.ZodEnum<{
608
+ all: "all";
609
+ any: "any";
610
+ one: "one";
611
+ }>>;
612
+ workerIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
613
+ revisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
614
+ workerId: z.ZodUUID;
615
+ revision: z.ZodNumber;
616
+ }, z.core.$strict>>>;
617
+ outcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
618
+ workerId: z.ZodUUID;
619
+ status: z.ZodEnum<{
620
+ cancelled: "cancelled";
621
+ done: "done";
622
+ failed: "failed";
623
+ review: "review";
624
+ }>;
625
+ observedAt: z.ZodISODateTime;
626
+ summary: z.ZodOptional<z.ZodString>;
627
+ revision: z.ZodOptional<z.ZodNumber>;
628
+ }, z.core.$strict>>>;
629
+ requestIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
630
+ requestOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
631
+ requestId: z.ZodUUID;
632
+ status: z.ZodEnum<{
633
+ cancelled: "cancelled";
634
+ "completed-without-reply": "completed-without-reply";
635
+ destroyed: "destroyed";
636
+ failed: "failed";
637
+ "human-fallback": "human-fallback";
638
+ replied: "replied";
639
+ "replied-late": "replied-late";
640
+ "sender-closed": "sender-closed";
641
+ "timed-out": "timed-out";
642
+ }>;
643
+ observedAt: z.ZodISODateTime;
644
+ replyId: z.ZodOptional<z.ZodUUID>;
645
+ }, z.core.$strict>>>;
646
+ result: z.ZodOptional<z.ZodObject<{
647
+ reason: z.ZodEnum<{
648
+ outcome: "outcome";
649
+ timeout: "timeout";
650
+ }>;
651
+ }, z.core.$strict>>;
652
+ wakeInputId: z.ZodOptional<z.ZodUUID>;
653
+ }, z.core.$strict>, z.ZodObject<{
654
+ id: z.ZodUUID;
655
+ source: z.ZodEnum<{
656
+ agent: "agent";
657
+ cezar: "cezar";
658
+ }>;
659
+ via: z.ZodEnum<{
660
+ "ask-line": "ask-line";
661
+ budget: "budget";
662
+ "cez-worker-wait": "cez-worker-wait";
663
+ cezar_ask: "cezar_ask";
664
+ cezar_wait: "cezar_wait";
665
+ cezar_wait_for_ci: "cezar_wait_for_ci";
666
+ completion: "completion";
667
+ "monitoring-line": "monitoring-line";
668
+ "native-ask": "native-ask";
669
+ "no-wait": "no-wait";
670
+ "schedule-wakeup": "schedule-wakeup";
671
+ }>;
672
+ registeredAt: z.ZodISODateTime;
673
+ phase: z.ZodEnum<{
674
+ cancelled: "cancelled";
675
+ delivered: "delivered";
676
+ open: "open";
677
+ resolved: "resolved";
678
+ }>;
679
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
680
+ deliveredAt: z.ZodOptional<z.ZodISODateTime>;
681
+ cancelledAt: z.ZodOptional<z.ZodISODateTime>;
682
+ turnId: z.ZodString;
683
+ kind: z.ZodLiteral<"process">;
684
+ deadline: z.ZodISODateTime;
685
+ timeoutSeconds: z.ZodNumber;
686
+ pid: z.ZodNumber;
687
+ startToken: z.ZodOptional<z.ZodString>;
688
+ exitFile: z.ZodOptional<z.ZodString>;
689
+ note: z.ZodOptional<z.ZodString>;
690
+ result: z.ZodOptional<z.ZodObject<{
691
+ outcome: z.ZodEnum<{
692
+ deadline: "deadline";
693
+ error: "error";
694
+ exit_file: "exit_file";
695
+ exited: "exited";
696
+ }>;
697
+ observedAt: z.ZodISODateTime;
698
+ exitCode: z.ZodOptional<z.ZodNumber>;
699
+ exitFileNote: z.ZodOptional<z.ZodLiteral<"not-an-exit-code">>;
700
+ diagnostic: z.ZodOptional<z.ZodString>;
701
+ }, z.core.$strict>>;
702
+ }, z.core.$strict>], "kind">>>;
703
+ previewServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
704
+ port: z.ZodNumber;
705
+ command: z.ZodString;
706
+ cwd: z.ZodOptional<z.ZodString>;
707
+ label: z.ZodString;
708
+ path: z.ZodOptional<z.ZodString>;
709
+ registeredAt: z.ZodISODateTime;
710
+ answeredAtRegistration: z.ZodBoolean;
711
+ }, z.core.$strip>>>;
712
+ taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
713
+ model: z.ZodOptional<z.ZodString>;
714
+ effort: z.ZodOptional<z.ZodString>;
715
+ modelIdentity: z.ZodOptional<z.ZodString>;
716
+ agentProfile: z.ZodOptional<z.ZodString>;
717
+ systemPrompt: z.ZodOptional<z.ZodString>;
718
+ generateFollowups: z.ZodOptional<z.ZodBoolean>;
719
+ autonomous: z.ZodOptional<z.ZodBoolean>;
720
+ archiveWhenDone: z.ZodOptional<z.ZodBoolean>;
721
+ autoMergePr: z.ZodOptional<z.ZodBoolean>;
722
+ completionAction: z.ZodOptional<z.ZodObject<{
723
+ id: z.ZodString;
724
+ phase: z.ZodEnum<{
725
+ blocked: "blocked";
726
+ complete: "complete";
727
+ pending: "pending";
728
+ }>;
729
+ message: z.ZodOptional<z.ZodString>;
730
+ }, z.core.$strip>>;
731
+ archiveBlocker: z.ZodOptional<z.ZodObject<{
732
+ message: z.ZodString;
733
+ runId: z.ZodOptional<z.ZodString>;
734
+ pullRequestUrl: z.ZodOptional<z.ZodString>;
735
+ }, z.core.$strip>>;
736
+ status: z.ZodEnum<{
737
+ cancelled: "cancelled";
738
+ done: "done";
739
+ failed: "failed";
740
+ queued: "queued";
741
+ review: "review";
742
+ running: "running";
743
+ waiting: "waiting";
744
+ }>;
745
+ createdAt: z.ZodString;
746
+ startedAt: z.ZodOptional<z.ZodString>;
747
+ finishedAt: z.ZodOptional<z.ZodString>;
748
+ tokensUsed: z.ZodNumber;
749
+ inputTokens: z.ZodOptional<z.ZodNumber>;
750
+ outputTokens: z.ZodOptional<z.ZodNumber>;
751
+ costUsd: z.ZodOptional<z.ZodNumber>;
752
+ pullRequestUrl: z.ZodOptional<z.ZodString>;
753
+ referencedPullRequestUrl: z.ZodOptional<z.ZodString>;
754
+ prNumber: z.ZodOptional<z.ZodNumber>;
755
+ issueNumber: z.ZodOptional<z.ZodNumber>;
756
+ referencedIssueNumberSeeded: z.ZodOptional<z.ZodBoolean>;
757
+ titleOrigin: z.ZodOptional<z.ZodEnum<{
758
+ auto: "auto";
759
+ marker: "marker";
760
+ user: "user";
761
+ }>>;
762
+ markerRefs: z.ZodOptional<z.ZodObject<{
763
+ pr: z.ZodOptional<z.ZodNumber>;
764
+ issue: z.ZodOptional<z.ZodNumber>;
765
+ }, z.core.$strip>>;
766
+ referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
767
+ referencedIssueUrl: z.ZodOptional<z.ZodString>;
768
+ referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
769
+ worktree: z.ZodOptional<z.ZodLiteral<false>>;
770
+ worktreePath: z.ZodOptional<z.ZodString>;
771
+ branch: z.ZodOptional<z.ZodString>;
772
+ baseBranch: z.ZodOptional<z.ZodString>;
773
+ worktreeReclaimedAt: z.ZodOptional<z.ZodString>;
774
+ groupId: z.ZodOptional<z.ZodString>;
775
+ variant: z.ZodOptional<z.ZodString>;
776
+ clientRequestId: z.ZodOptional<z.ZodString>;
777
+ clientRequestHash: z.ZodOptional<z.ZodString>;
778
+ peakRssBytes: z.ZodOptional<z.ZodNumber>;
779
+ peakProcCount: z.ZodOptional<z.ZodNumber>;
780
+ archivedAt: z.ZodOptional<z.ZodString>;
781
+ autoArchive: z.ZodOptional<z.ZodObject<{
782
+ reason: z.ZodLiteral<"pull-requests-merged">;
783
+ archivedAt: z.ZodString;
784
+ fingerprint: z.ZodString;
785
+ pullRequests: z.ZodArray<z.ZodObject<{
786
+ owner: z.ZodString;
787
+ repo: z.ZodString;
788
+ number: z.ZodNumber;
789
+ mergedAt: z.ZodString;
790
+ }, z.core.$strip>>;
791
+ }, z.core.$strip>>;
792
+ manualUnarchivedAt: z.ZodOptional<z.ZodString>;
793
+ pinned: z.ZodOptional<z.ZodBoolean>;
794
+ pinnedAt: z.ZodOptional<z.ZodString>;
795
+ seenAt: z.ZodOptional<z.ZodString>;
796
+ currentStepId: z.ZodOptional<z.ZodString>;
797
+ error: z.ZodOptional<z.ZodString>;
798
+ delegation: z.ZodCatch<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
799
+ role: z.ZodLiteral<"root">;
800
+ conversation: z.ZodOptional<z.ZodObject<{
801
+ messages: z.ZodArray<z.ZodObject<{
802
+ senderRunId: z.ZodUUID;
803
+ recipientRunId: z.ZodUUID;
804
+ kind: z.ZodEnum<{
805
+ "follow-up": "follow-up";
806
+ progress: "progress";
807
+ reply: "reply";
808
+ request: "request";
809
+ }>;
810
+ requestId: z.ZodOptional<z.ZodUUID>;
811
+ id: z.ZodUUID;
812
+ text: z.ZodString;
813
+ createdAt: z.ZodISODateTime;
814
+ deadline: z.ZodOptional<z.ZodISODateTime>;
815
+ requestHash: z.ZodString;
816
+ state: z.ZodEnum<{
817
+ accepted: "accepted";
818
+ "continuation-required": "continuation-required";
819
+ destroyed: "destroyed";
820
+ late: "late";
821
+ }>;
822
+ resumed: z.ZodOptional<z.ZodLiteral<true>>;
823
+ instruction: z.ZodOptional<z.ZodString>;
824
+ question: z.ZodOptional<z.ZodObject<{
825
+ context: z.ZodOptional<z.ZodString>;
826
+ questions: z.ZodArray<z.ZodObject<{
827
+ id: z.ZodOptional<z.ZodString>;
828
+ header: z.ZodString;
829
+ question: z.ZodString;
830
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
831
+ label: z.ZodString;
832
+ description: z.ZodOptional<z.ZodString>;
833
+ }, z.core.$strict>>>;
834
+ multiSelect: z.ZodOptional<z.ZodBoolean>;
835
+ }, z.core.$strict>>;
836
+ }, z.core.$strict>>;
837
+ }, z.core.$strict>>;
838
+ outcomes: z.ZodArray<z.ZodObject<{
839
+ requestId: z.ZodUUID;
840
+ status: z.ZodEnum<{
841
+ cancelled: "cancelled";
842
+ "completed-without-reply": "completed-without-reply";
843
+ destroyed: "destroyed";
844
+ failed: "failed";
845
+ "human-fallback": "human-fallback";
846
+ replied: "replied";
847
+ "replied-late": "replied-late";
848
+ "sender-closed": "sender-closed";
849
+ "timed-out": "timed-out";
850
+ }>;
851
+ observedAt: z.ZodISODateTime;
852
+ replyId: z.ZodOptional<z.ZodUUID>;
853
+ }, z.core.$strict>>;
854
+ }, z.core.$strict>>;
855
+ permissions: z.ZodArray<z.ZodEnum<{
856
+ destroy: "destroy";
857
+ diff: "diff";
858
+ inspect: "inspect";
859
+ spawn: "spawn";
860
+ steer: "steer";
861
+ stop: "stop";
862
+ wait: "wait";
863
+ }>>;
864
+ receipts: z.ZodArray<z.ZodObject<{
865
+ requestId: z.ZodUUID;
866
+ workerId: z.ZodUUID;
867
+ requestHash: z.ZodString;
868
+ deletion: z.ZodOptional<z.ZodObject<{
869
+ phase: z.ZodEnum<{
870
+ complete: "complete";
871
+ pending: "pending";
872
+ }>;
873
+ revision: z.ZodNumber;
874
+ resourceId: z.ZodUUID;
875
+ generation: z.ZodUUID;
876
+ }, z.core.$strict>>;
877
+ }, z.core.$strict>>;
878
+ wait: z.ZodOptional<z.ZodObject<{
879
+ id: z.ZodUUID;
880
+ workerIds: z.ZodArray<z.ZodUUID>;
881
+ requestIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
882
+ requestOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
883
+ requestId: z.ZodUUID;
884
+ status: z.ZodEnum<{
885
+ cancelled: "cancelled";
886
+ "completed-without-reply": "completed-without-reply";
887
+ destroyed: "destroyed";
888
+ failed: "failed";
889
+ "human-fallback": "human-fallback";
890
+ replied: "replied";
891
+ "replied-late": "replied-late";
892
+ "sender-closed": "sender-closed";
893
+ "timed-out": "timed-out";
894
+ }>;
895
+ observedAt: z.ZodISODateTime;
896
+ replyId: z.ZodOptional<z.ZodUUID>;
897
+ }, z.core.$strict>>>;
898
+ deadline: z.ZodISODateTime;
899
+ mode: z.ZodOptional<z.ZodEnum<{
900
+ all: "all";
901
+ any: "any";
902
+ one: "one";
903
+ }>>;
904
+ revisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
905
+ workerId: z.ZodUUID;
906
+ revision: z.ZodNumber;
907
+ }, z.core.$strict>>>;
908
+ reason: z.ZodOptional<z.ZodEnum<{
909
+ cancelled: "cancelled";
910
+ message: "message";
911
+ outcome: "outcome";
912
+ timeout: "timeout";
913
+ }>>;
914
+ phase: z.ZodEnum<{
915
+ parked: "parked";
916
+ registered: "registered";
917
+ "wake-pending": "wake-pending";
918
+ }>;
919
+ outcomes: z.ZodArray<z.ZodObject<{
920
+ workerId: z.ZodUUID;
921
+ status: z.ZodEnum<{
922
+ cancelled: "cancelled";
923
+ done: "done";
924
+ failed: "failed";
925
+ review: "review";
233
926
  }>;
234
927
  observedAt: z.ZodISODateTime;
235
928
  summary: z.ZodOptional<z.ZodString>;
@@ -250,6 +943,7 @@ export declare const runRecordSchema: z.ZodObject<{
250
943
  failed: "failed";
251
944
  "human-fallback": "human-fallback";
252
945
  replied: "replied";
946
+ "replied-late": "replied-late";
253
947
  "sender-closed": "sender-closed";
254
948
  "timed-out": "timed-out";
255
949
  }>;
@@ -339,6 +1033,7 @@ export declare const runRecordSchema: z.ZodObject<{
339
1033
  failed: "failed";
340
1034
  "human-fallback": "human-fallback";
341
1035
  replied: "replied";
1036
+ "replied-late": "replied-late";
342
1037
  "sender-closed": "sender-closed";
343
1038
  "timed-out": "timed-out";
344
1039
  }>;
@@ -393,6 +1088,7 @@ export declare const runRecordSchema: z.ZodObject<{
393
1088
  failed: "failed";
394
1089
  "human-fallback": "human-fallback";
395
1090
  replied: "replied";
1091
+ "replied-late": "replied-late";
396
1092
  "sender-closed": "sender-closed";
397
1093
  "timed-out": "timed-out";
398
1094
  }>;
@@ -477,6 +1173,9 @@ export declare const runRecordSchema: z.ZodObject<{
477
1173
  }, z.core.$strict>, z.ZodObject<{
478
1174
  kind: z.ZodLiteral<"parent-attachment">;
479
1175
  id: z.ZodString;
1176
+ }, z.core.$strict>, z.ZodObject<{
1177
+ kind: z.ZodLiteral<"parent-file">;
1178
+ path: z.ZodString;
480
1179
  }, z.core.$strict>], "kind">;
481
1180
  path: z.ZodString;
482
1181
  sha256: z.ZodString;
@@ -488,139 +1187,9 @@ export declare const runRecordSchema: z.ZodObject<{
488
1187
  }, z.core.$strict>, z.ZodObject<{
489
1188
  role: z.ZodLiteral<"invalid">;
490
1189
  }, z.core.$strict>], "role">>>;
491
- agentInputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
492
- conversation: z.ZodOptional<z.ZodObject<{
493
- senderRunId: z.ZodUUID;
494
- recipientRunId: z.ZodUUID;
495
- kind: z.ZodEnum<{
496
- "follow-up": "follow-up";
497
- progress: "progress";
498
- reply: "reply";
499
- request: "request";
500
- }>;
501
- requestId: z.ZodOptional<z.ZodUUID>;
502
- }, z.core.$strict>>;
503
- id: z.ZodUUID;
504
- source: z.ZodEnum<{
505
- agent: "agent";
506
- lifecycle: "lifecycle";
507
- }>;
508
- parentRunId: z.ZodUUID;
509
- text: z.ZodString;
510
- createdAt: z.ZodISODateTime;
511
- deliveredAt: z.ZodOptional<z.ZodISODateTime>;
512
- consumedAt: z.ZodOptional<z.ZodISODateTime>;
513
- awaitingRead: z.ZodOptional<z.ZodLiteral<true>>;
514
- inboxClaim: z.ZodOptional<z.ZodObject<{
515
- receiptId: z.ZodUUID;
516
- generation: z.ZodUUID;
517
- expiresAt: z.ZodISODateTime;
518
- acknowledgedAt: z.ZodOptional<z.ZodISODateTime>;
519
- memberIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
520
- }, z.core.$strict>>;
521
- }, z.core.$strict>>>;
522
- ciWait: z.ZodOptional<z.ZodObject<{
523
- prUrl: z.ZodString;
524
- repository: z.ZodString;
525
- prNumber: z.ZodNumber;
526
- headSha: z.ZodString;
527
- id: z.ZodUUID;
528
- generation: z.ZodString;
529
- turnId: z.ZodString;
530
- timeoutSeconds: z.ZodNumber;
531
- registeredAt: z.ZodISODateTime;
532
- deadline: z.ZodISODateTime;
533
- phase: z.ZodEnum<{
534
- delivered: "delivered";
535
- parked: "parked";
536
- registered: "registered";
537
- "wake-pending": "wake-pending";
538
- withdrawn: "withdrawn";
539
- }>;
540
- result: z.ZodOptional<z.ZodObject<{
541
- outcome: z.ZodEnum<{
542
- cancelled: "cancelled";
543
- deadline: "deadline";
544
- error: "error";
545
- failed: "failed";
546
- head_changed: "head_changed";
547
- no_checks: "no_checks";
548
- passed: "passed";
549
- skipped: "skipped";
550
- }>;
551
- headSha: z.ZodString;
552
- observedHeadSha: z.ZodOptional<z.ZodString>;
553
- observedAt: z.ZodISODateTime;
554
- checks: z.ZodArray<z.ZodObject<{
555
- name: z.ZodString;
556
- state: z.ZodString;
557
- link: z.ZodString;
558
- }, z.core.$strict>>;
559
- totalChecks: z.ZodNumber;
560
- truncated: z.ZodBoolean;
561
- diagnostic: z.ZodOptional<z.ZodString>;
562
- }, z.core.$strict>>;
563
- wakeId: z.ZodOptional<z.ZodString>;
564
- deliveredAt: z.ZodOptional<z.ZodISODateTime>;
565
- }, z.core.$strict>>;
566
- lastCiWait: z.ZodOptional<z.ZodObject<{
567
- prUrl: z.ZodString;
568
- repository: z.ZodString;
569
- prNumber: z.ZodNumber;
570
- headSha: z.ZodString;
571
- id: z.ZodUUID;
572
- generation: z.ZodString;
573
- turnId: z.ZodString;
574
- timeoutSeconds: z.ZodNumber;
575
- registeredAt: z.ZodISODateTime;
576
- deadline: z.ZodISODateTime;
577
- phase: z.ZodEnum<{
578
- delivered: "delivered";
579
- parked: "parked";
580
- registered: "registered";
581
- "wake-pending": "wake-pending";
582
- withdrawn: "withdrawn";
583
- }>;
584
- result: z.ZodOptional<z.ZodObject<{
585
- outcome: z.ZodEnum<{
586
- cancelled: "cancelled";
587
- deadline: "deadline";
588
- error: "error";
589
- failed: "failed";
590
- head_changed: "head_changed";
591
- no_checks: "no_checks";
592
- passed: "passed";
593
- skipped: "skipped";
594
- }>;
595
- headSha: z.ZodString;
596
- observedHeadSha: z.ZodOptional<z.ZodString>;
597
- observedAt: z.ZodISODateTime;
598
- checks: z.ZodArray<z.ZodObject<{
599
- name: z.ZodString;
600
- state: z.ZodString;
601
- link: z.ZodString;
602
- }, z.core.$strict>>;
603
- totalChecks: z.ZodNumber;
604
- truncated: z.ZodBoolean;
605
- diagnostic: z.ZodOptional<z.ZodString>;
606
- }, z.core.$strict>>;
607
- wakeId: z.ZodOptional<z.ZodString>;
608
- deliveredAt: z.ZodOptional<z.ZodISODateTime>;
609
- }, z.core.$strict>>;
610
- lastCiWaitError: z.ZodOptional<z.ZodString>;
611
- previewServers: z.ZodOptional<z.ZodArray<z.ZodObject<{
612
- port: z.ZodNumber;
613
- command: z.ZodString;
614
- cwd: z.ZodOptional<z.ZodString>;
615
- label: z.ZodString;
616
- path: z.ZodOptional<z.ZodString>;
617
- registeredAt: z.ZodISODateTime;
618
- answeredAtRegistration: z.ZodBoolean;
619
- }, z.core.$strip>>>;
620
- taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
621
- model: z.ZodOptional<z.ZodString>;
622
- effort: z.ZodOptional<z.ZodString>;
623
- modelIdentity: z.ZodOptional<z.ZodString>;
1190
+ lastWaitsError: z.ZodCatch<z.ZodOptional<z.ZodString>>;
1191
+ automaticWakes: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
1192
+ waitDeliveryFailures: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
624
1193
  runner: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
625
1194
  claude: "claude";
626
1195
  "claude-cli": "claude-cli";
@@ -630,85 +1199,29 @@ export declare const runRecordSchema: z.ZodObject<{
630
1199
  opencode: "opencode";
631
1200
  pi: "pi";
632
1201
  }>, z.ZodTransform<"claude" | "codex" | "cursor" | "omp" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "cursor" | "omp" | "opencode" | "pi">>>;
633
- agentProfile: z.ZodOptional<z.ZodString>;
634
- systemPrompt: z.ZodOptional<z.ZodString>;
635
- generateFollowups: z.ZodOptional<z.ZodBoolean>;
636
- autonomous: z.ZodOptional<z.ZodBoolean>;
637
1202
  notify: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
638
1203
  webhook: z.ZodCatch<z.ZodOptional<z.ZodObject<{
639
1204
  lastDeliveredAt: z.ZodOptional<z.ZodString>;
640
1205
  lastError: z.ZodOptional<z.ZodString>;
1206
+ lastErrorWebhookId: z.ZodOptional<z.ZodString>;
641
1207
  }, z.core.$strip>>>;
642
- automation: z.ZodOptional<z.ZodObject<{
643
- automationId: z.ZodString;
644
- automationRevision: z.ZodNumber;
645
- receiptId: z.ZodString;
646
- event: z.ZodString;
647
- githubUrl: z.ZodString;
648
- }, z.core.$strip>>;
649
- automationTrigger: z.ZodOptional<z.ZodObject<{
650
- automationId: z.ZodString;
651
- automationRevision: z.ZodNumber;
652
- receiptId: z.ZodString;
653
- trigger: z.ZodEnum<{
654
- "catch-up": "catch-up";
655
- manual: "manual";
656
- schedule: "schedule";
657
- }>;
658
- occurrenceAt: z.ZodString;
659
- }, z.core.$strip>>;
660
1208
  destroyRetry: z.ZodCatch<z.ZodOptional<z.ZodObject<{
661
1209
  attempts: z.ZodNumber;
662
1210
  nextAt: z.ZodISODateTime;
663
1211
  needsAttention: z.ZodOptional<z.ZodLiteral<true>>;
664
1212
  }, z.core.$strict>>>;
665
- status: z.ZodEnum<{
666
- cancelled: "cancelled";
667
- done: "done";
668
- failed: "failed";
669
- queued: "queued";
670
- review: "review";
671
- running: "running";
672
- waiting: "waiting";
673
- }>;
674
1213
  stopping: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
675
- activity: z.ZodOptional<z.ZodEnum<{
676
- monitoring: "monitoring";
677
- }>>;
678
- hasPendingHumanAsk: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
679
- monitoringWakeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
680
- monitoringWakeCapReached: z.ZodOptional<z.ZodBoolean>;
1214
+ hasPendingPermission: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
681
1215
  autoResumeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
682
1216
  autoResumeAttempts: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
683
- createdAt: z.ZodString;
684
- startedAt: z.ZodOptional<z.ZodString>;
685
- finishedAt: z.ZodOptional<z.ZodString>;
686
- tokensUsed: z.ZodNumber;
687
- inputTokens: z.ZodOptional<z.ZodNumber>;
688
- outputTokens: z.ZodOptional<z.ZodNumber>;
689
- costUsd: z.ZodOptional<z.ZodNumber>;
690
- pullRequestUrl: z.ZodOptional<z.ZodString>;
691
- referencedPullRequestUrl: z.ZodOptional<z.ZodString>;
692
- prNumber: z.ZodOptional<z.ZodNumber>;
693
- issueNumber: z.ZodOptional<z.ZodNumber>;
694
- referencedIssueNumberSeeded: z.ZodOptional<z.ZodBoolean>;
695
- titleOrigin: z.ZodOptional<z.ZodEnum<{
696
- auto: "auto";
697
- marker: "marker";
698
- user: "user";
699
- }>>;
700
- markerRefs: z.ZodOptional<z.ZodObject<{
701
- pr: z.ZodOptional<z.ZodNumber>;
702
- issue: z.ZodOptional<z.ZodNumber>;
703
- }, z.core.$strip>>;
704
- referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
705
- referencedIssueUrl: z.ZodOptional<z.ZodString>;
706
- referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
707
- worktree: z.ZodOptional<z.ZodLiteral<false>>;
708
- worktreePath: z.ZodOptional<z.ZodString>;
709
- branch: z.ZodOptional<z.ZodString>;
710
- baseBranch: z.ZodOptional<z.ZodString>;
711
- worktreeReclaimedAt: z.ZodOptional<z.ZodString>;
1217
+ pullRequests: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodObject<{
1218
+ number: z.ZodNumber;
1219
+ url: z.ZodOptional<z.ZodString>;
1220
+ source: z.ZodEnum<{
1221
+ created: "created";
1222
+ declared: "declared";
1223
+ }>;
1224
+ }, z.core.$strip>>>>;
712
1225
  worktreeSetup: z.ZodCatch<z.ZodOptional<z.ZodObject<{
713
1226
  status: z.ZodEnum<{
714
1227
  done: "done";
@@ -720,19 +1233,41 @@ export declare const runRecordSchema: z.ZodObject<{
720
1233
  durationMs: z.ZodOptional<z.ZodNumber>;
721
1234
  error: z.ZodOptional<z.ZodString>;
722
1235
  }, z.core.$strip>>>;
723
- groupId: z.ZodOptional<z.ZodString>;
724
- variant: z.ZodOptional<z.ZodString>;
725
- clientRequestId: z.ZodOptional<z.ZodString>;
726
- clientRequestHash: z.ZodOptional<z.ZodString>;
727
- peakRssBytes: z.ZodOptional<z.ZodNumber>;
728
- peakProcCount: z.ZodOptional<z.ZodNumber>;
729
1236
  archived: z.ZodDefault<z.ZodBoolean>;
730
- archivedAt: z.ZodOptional<z.ZodString>;
731
- pinned: z.ZodOptional<z.ZodBoolean>;
732
- pinnedAt: z.ZodOptional<z.ZodString>;
733
- seenAt: z.ZodOptional<z.ZodString>;
734
- currentStepId: z.ZodOptional<z.ZodString>;
735
- error: z.ZodOptional<z.ZodString>;
1237
+ workflowDef: z.ZodCatch<z.ZodOptional<z.ZodObject<{
1238
+ name: z.ZodString;
1239
+ description: z.ZodOptional<z.ZodString>;
1240
+ steps: z.ZodArray<z.ZodObject<{
1241
+ id: z.ZodString;
1242
+ name: z.ZodOptional<z.ZodString>;
1243
+ prompt: z.ZodOptional<z.ZodString>;
1244
+ skill: z.ZodOptional<z.ZodString>;
1245
+ model: z.ZodOptional<z.ZodString>;
1246
+ effort: z.ZodOptional<z.ZodString>;
1247
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1248
+ runner: z.ZodOptional<z.ZodEnum<{
1249
+ claude: "claude";
1250
+ codex: "codex";
1251
+ cursor: "cursor";
1252
+ omp: "omp";
1253
+ opencode: "opencode";
1254
+ pi: "pi";
1255
+ }>>;
1256
+ agentProfile: z.ZodOptional<z.ZodString>;
1257
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1258
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1259
+ command: z.ZodOptional<z.ZodString>;
1260
+ onFail: z.ZodOptional<z.ZodObject<{
1261
+ retry: z.ZodString;
1262
+ max: z.ZodDefault<z.ZodNumber>;
1263
+ }, z.core.$strip>>;
1264
+ }, z.core.$strip>>;
1265
+ source: z.ZodEnum<{
1266
+ "built-in": "built-in";
1267
+ file: "file";
1268
+ }>;
1269
+ path: z.ZodOptional<z.ZodString>;
1270
+ }, z.core.$strip>>>;
736
1271
  steps: z.ZodArray<z.ZodObject<{
737
1272
  id: z.ZodString;
738
1273
  name: z.ZodString;
@@ -764,6 +1299,13 @@ export declare const runRecordSchema: z.ZodObject<{
764
1299
  finishedAt: z.ZodOptional<z.ZodString>;
765
1300
  error: z.ZodOptional<z.ZodString>;
766
1301
  sessionId: z.ZodOptional<z.ZodString>;
1302
+ sessionTransport: z.ZodOptional<z.ZodEnum<{
1303
+ "cursor-acp": "cursor-acp";
1304
+ "cursor-print": "cursor-print";
1305
+ }>>;
1306
+ profileId: z.ZodOptional<z.ZodString>;
1307
+ costUsd: z.ZodOptional<z.ZodNumber>;
1308
+ synthetic: z.ZodOptional<z.ZodLiteral<"continuation">>;
767
1309
  backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
768
1310
  claude: "claude";
769
1311
  "claude-cli": "claude-cli";
@@ -773,46 +1315,64 @@ export declare const runRecordSchema: z.ZodObject<{
773
1315
  opencode: "opencode";
774
1316
  pi: "pi";
775
1317
  }>, z.ZodTransform<"claude" | "codex" | "cursor" | "omp" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "cursor" | "omp" | "opencode" | "pi">>>;
776
- profileId: z.ZodOptional<z.ZodString>;
777
- costUsd: z.ZodOptional<z.ZodNumber>;
778
- synthetic: z.ZodOptional<z.ZodLiteral<"continuation">>;
779
1318
  }, z.core.$strip>>;
780
- workflowDef: z.ZodCatch<z.ZodOptional<z.ZodObject<{
781
- name: z.ZodString;
782
- description: z.ZodOptional<z.ZodString>;
783
- steps: z.ZodArray<z.ZodObject<{
784
- id: z.ZodString;
785
- name: z.ZodOptional<z.ZodString>;
786
- prompt: z.ZodOptional<z.ZodString>;
787
- skill: z.ZodOptional<z.ZodString>;
788
- model: z.ZodOptional<z.ZodString>;
789
- effort: z.ZodOptional<z.ZodString>;
790
- timeoutMs: z.ZodOptional<z.ZodNumber>;
791
- runner: z.ZodOptional<z.ZodEnum<{
792
- claude: "claude";
793
- codex: "codex";
794
- cursor: "cursor";
795
- omp: "omp";
796
- opencode: "opencode";
797
- pi: "pi";
798
- }>>;
799
- agentProfile: z.ZodOptional<z.ZodString>;
800
- allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
801
- bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
802
- command: z.ZodOptional<z.ZodString>;
803
- onFail: z.ZodOptional<z.ZodObject<{
804
- retry: z.ZodString;
805
- max: z.ZodDefault<z.ZodNumber>;
1319
+ automation: z.ZodOptional<z.ZodObject<{
1320
+ automationId: z.ZodString;
1321
+ receiptId: z.ZodString;
1322
+ event: z.ZodString;
1323
+ automationRevision: z.ZodNumber;
1324
+ githubUrl: z.ZodString;
1325
+ }, z.core.$strip>>;
1326
+ automationTrigger: z.ZodOptional<z.ZodObject<{
1327
+ automationId: z.ZodString;
1328
+ receiptId: z.ZodString;
1329
+ trigger: z.ZodEnum<{
1330
+ "catch-up": "catch-up";
1331
+ manual: "manual";
1332
+ schedule: "schedule";
1333
+ }>;
1334
+ occurrenceAt: z.ZodString;
1335
+ automationRevision: z.ZodNumber;
1336
+ }, z.core.$strip>>;
1337
+ handoffRecords: z.ZodCatch<z.ZodOptional<z.ZodObject<{
1338
+ autosave: z.ZodArray<z.ZodObject<{
1339
+ at: z.ZodString;
1340
+ note: z.ZodString;
1341
+ periodic: z.ZodOptional<z.ZodObject<{
1342
+ branch: z.ZodNullable<z.ZodString>;
1343
+ count: z.ZodNumber;
1344
+ first: z.ZodNullable<z.ZodString>;
1345
+ latest: z.ZodNullable<z.ZodString>;
806
1346
  }, z.core.$strip>>;
807
1347
  }, z.core.$strip>>;
808
- source: z.ZodEnum<{
809
- "built-in": "built-in";
810
- file: "file";
811
- }>;
812
- path: z.ZodOptional<z.ZodString>;
813
1348
  }, z.core.$strip>>>;
814
1349
  }, z.core.$strip>;
815
- /** Salvage CI state identically for live stores and the read-only workspace index. */
1350
+ /** A legacy `CiWait` as a wait entry. Its wake input's id was the wait's own (`wakeId`, which
1351
+ * `run.ts` set to the wait id), so the entry keeps that id and delivery still finds the input. */
1352
+ export declare function ciWaitEntry(wait: CiWait): PrWaitEntry;
1353
+ /**
1354
+ * A legacy agent `delegation.wait` as a worker wait entry (store schema 6, hearsay-tools/cezarion#1235),
1355
+ * judged from the wait alone: what became of its wake input is `upgradeLegacyWaits`' to apply.
1356
+ * `registered`/`parked` → open; `wake-pending` → resolved with its `outcome`/`timeout` reason, or
1357
+ * cancelled. Undefined for the `message` stand-in, which was never an agent's wait: a message no
1358
+ * longer resolves a wait, and its input still wakes the run on its own.
1359
+ *
1360
+ * Deterministic, never read from the clock: a row is upgraded on every read until open rewrites
1361
+ * it, and two reads must agree. A `WorkerWait` kept no registration time, so `timeoutSeconds` is
1362
+ * the 600 default, `registeredAt` is 600 s before the original deadline (kept as it was), and the
1363
+ * settled stamps come from the wait itself: `resolvedAt` is the latest observation it holds, else
1364
+ * its deadline, and `cancelledAt` is its deadline. `now` is only the fallback for a deadline that
1365
+ * does not read, which the wait schema never admits.
1366
+ */
1367
+ export declare function workerWaitEntry(wait: WorkerWait, now: string): WorkerWaitEntry | undefined;
1368
+ /** Whether a record is a root still parked on its workers: an open or resolved worker wait in the
1369
+ * list. Such a root has its pending human question re-read from the transcript before a manager
1370
+ * parks it. Every stored `delegation.wait`, the completion gate's included, is read into the list
1371
+ * on open (store schema 7, hearsay-tools/cezarion#1301), so the list is the only place to look. */
1372
+ export declare function holdsWorkerWait(run: Pick<RunRecord, 'delegation' | 'waits'>): boolean;
1373
+ export declare function upgradeLegacyWaits(row: Record<string, unknown>): void;
1374
+ /** Read legacy wait fields into the wait list and salvage per entry, identically for live stores
1375
+ * and the read-only workspace index. */
816
1376
  export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
817
1377
  id: string;
818
1378
  title: string;
@@ -838,8 +1398,393 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
838
1398
  createdAt: string;
839
1399
  origin?: "human" | "lifecycle" | undefined;
840
1400
  agentInputId?: string | undefined;
1401
+ resumeContext?: {
1402
+ failure?: {
1403
+ stepId?: string | undefined;
1404
+ error: string;
1405
+ } | undefined;
1406
+ restarted?: true | undefined;
1407
+ } | undefined;
1408
+ } | undefined;
1409
+ workflowResumeStepId?: string | undefined;
1410
+ invalidAsk?: boolean | undefined;
1411
+ agentInputs?: {
1412
+ conversation?: {
1413
+ senderRunId: string;
1414
+ recipientRunId: string;
1415
+ kind: "follow-up" | "progress" | "reply" | "request";
1416
+ requestId?: string | undefined;
1417
+ } | undefined;
1418
+ id: string;
1419
+ source: "agent" | "lifecycle";
1420
+ parentRunId: string;
1421
+ text: string;
1422
+ createdAt: string;
1423
+ deliveredAt?: string | undefined;
1424
+ consumedAt?: string | undefined;
1425
+ awaitingRead?: true | undefined;
1426
+ inboxClaim?: {
1427
+ receiptId: string;
1428
+ generation: string;
1429
+ expiresAt: string;
1430
+ acknowledgedAt?: string | undefined;
1431
+ memberIds?: string[] | undefined;
1432
+ } | undefined;
1433
+ purpose?: "completion-refusal" | undefined;
1434
+ }[] | undefined;
1435
+ waits?: ({
1436
+ prUrl: string;
1437
+ repository: string;
1438
+ prNumber: number;
1439
+ headSha: string;
1440
+ id: string;
1441
+ source: "agent" | "cezar";
1442
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1443
+ registeredAt: string;
1444
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1445
+ resolvedAt?: string | undefined;
1446
+ deliveredAt?: string | undefined;
1447
+ cancelledAt?: string | undefined;
1448
+ turnId: string;
1449
+ kind: "pr";
1450
+ deadline: string;
1451
+ generation: string;
1452
+ timeoutSeconds: number;
1453
+ until: "checks" | "merge";
1454
+ wakeOnConflict: boolean;
1455
+ result?: {
1456
+ outcome: "cancelled" | "closed" | "conflicting" | "deadline" | "error" | "failed" | "head_changed" | "merged" | "no_checks" | "passed" | "skipped";
1457
+ headSha: string;
1458
+ observedHeadSha?: string | undefined;
1459
+ mergeable?: "CONFLICTING" | "MERGEABLE" | "UNKNOWN" | undefined;
1460
+ mergeStateStatus?: string | undefined;
1461
+ mergedAt?: string | undefined;
1462
+ mergeCommitSha?: string | undefined;
1463
+ observedAt: string;
1464
+ checks: {
1465
+ name: string;
1466
+ state: string;
1467
+ link: string;
1468
+ }[];
1469
+ totalChecks: number;
1470
+ truncated: boolean;
1471
+ diagnostic?: string | undefined;
1472
+ } | undefined;
1473
+ } | {
1474
+ id: string;
1475
+ source: "agent" | "cezar";
1476
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1477
+ registeredAt: string;
1478
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1479
+ resolvedAt?: string | undefined;
1480
+ deliveredAt?: string | undefined;
1481
+ cancelledAt?: string | undefined;
1482
+ turnId: string;
1483
+ kind: "timer";
1484
+ deadline: string;
1485
+ seconds: number;
1486
+ note?: string | undefined;
1487
+ } | {
1488
+ id: string;
1489
+ source: "agent" | "cezar";
1490
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1491
+ registeredAt: string;
1492
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1493
+ resolvedAt?: string | undefined;
1494
+ deliveredAt?: string | undefined;
1495
+ cancelledAt?: string | undefined;
1496
+ turnId: string;
1497
+ kind: "human";
1498
+ questions?: {
1499
+ id?: string | undefined;
1500
+ header: string;
1501
+ question: string;
1502
+ options?: {
1503
+ label: string;
1504
+ description?: string | undefined;
1505
+ }[] | undefined;
1506
+ multiSelect?: boolean | undefined;
1507
+ }[] | undefined;
1508
+ context?: string | undefined;
1509
+ askSeq?: number | undefined;
1510
+ } | {
1511
+ id: string;
1512
+ source: "agent" | "cezar";
1513
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1514
+ registeredAt: string;
1515
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1516
+ resolvedAt?: string | undefined;
1517
+ deliveredAt?: string | undefined;
1518
+ cancelledAt?: string | undefined;
1519
+ turnId: string;
1520
+ kind: "worker";
1521
+ deadline?: string | undefined;
1522
+ timeoutSeconds?: number | undefined;
1523
+ mode?: "all" | "any" | "one" | undefined;
1524
+ workerIds?: string[] | undefined;
1525
+ revisions?: {
1526
+ workerId: string;
1527
+ revision: number;
1528
+ }[] | undefined;
1529
+ outcomes?: {
1530
+ workerId: string;
1531
+ status: "cancelled" | "done" | "failed" | "review";
1532
+ observedAt: string;
1533
+ summary?: string | undefined;
1534
+ revision?: number | undefined;
1535
+ }[] | undefined;
1536
+ requestIds?: string[] | undefined;
1537
+ requestOutcomes?: {
1538
+ requestId: string;
1539
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
1540
+ observedAt: string;
1541
+ replyId?: string | undefined;
1542
+ }[] | undefined;
1543
+ result?: {
1544
+ reason: "outcome" | "timeout";
1545
+ } | undefined;
1546
+ wakeInputId?: string | undefined;
1547
+ } | {
1548
+ id: string;
1549
+ source: "agent" | "cezar";
1550
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1551
+ registeredAt: string;
1552
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1553
+ resolvedAt?: string | undefined;
1554
+ deliveredAt?: string | undefined;
1555
+ cancelledAt?: string | undefined;
1556
+ turnId: string;
1557
+ kind: "process";
1558
+ deadline: string;
1559
+ timeoutSeconds: number;
1560
+ pid: number;
1561
+ startToken?: string | undefined;
1562
+ exitFile?: string | undefined;
1563
+ note?: string | undefined;
1564
+ result?: {
1565
+ outcome: "deadline" | "error" | "exit_file" | "exited";
1566
+ observedAt: string;
1567
+ exitCode?: number | undefined;
1568
+ exitFileNote?: "not-an-exit-code" | undefined;
1569
+ diagnostic?: string | undefined;
1570
+ } | undefined;
1571
+ })[] | undefined;
1572
+ lastWaits?: ({
1573
+ prUrl: string;
1574
+ repository: string;
1575
+ prNumber: number;
1576
+ headSha: string;
1577
+ id: string;
1578
+ source: "agent" | "cezar";
1579
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1580
+ registeredAt: string;
1581
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1582
+ resolvedAt?: string | undefined;
1583
+ deliveredAt?: string | undefined;
1584
+ cancelledAt?: string | undefined;
1585
+ turnId: string;
1586
+ kind: "pr";
1587
+ deadline: string;
1588
+ generation: string;
1589
+ timeoutSeconds: number;
1590
+ until: "checks" | "merge";
1591
+ wakeOnConflict: boolean;
1592
+ result?: {
1593
+ outcome: "cancelled" | "closed" | "conflicting" | "deadline" | "error" | "failed" | "head_changed" | "merged" | "no_checks" | "passed" | "skipped";
1594
+ headSha: string;
1595
+ observedHeadSha?: string | undefined;
1596
+ mergeable?: "CONFLICTING" | "MERGEABLE" | "UNKNOWN" | undefined;
1597
+ mergeStateStatus?: string | undefined;
1598
+ mergedAt?: string | undefined;
1599
+ mergeCommitSha?: string | undefined;
1600
+ observedAt: string;
1601
+ checks: {
1602
+ name: string;
1603
+ state: string;
1604
+ link: string;
1605
+ }[];
1606
+ totalChecks: number;
1607
+ truncated: boolean;
1608
+ diagnostic?: string | undefined;
1609
+ } | undefined;
1610
+ } | {
1611
+ id: string;
1612
+ source: "agent" | "cezar";
1613
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1614
+ registeredAt: string;
1615
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1616
+ resolvedAt?: string | undefined;
1617
+ deliveredAt?: string | undefined;
1618
+ cancelledAt?: string | undefined;
1619
+ turnId: string;
1620
+ kind: "timer";
1621
+ deadline: string;
1622
+ seconds: number;
1623
+ note?: string | undefined;
1624
+ } | {
1625
+ id: string;
1626
+ source: "agent" | "cezar";
1627
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1628
+ registeredAt: string;
1629
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1630
+ resolvedAt?: string | undefined;
1631
+ deliveredAt?: string | undefined;
1632
+ cancelledAt?: string | undefined;
1633
+ turnId: string;
1634
+ kind: "human";
1635
+ questions?: {
1636
+ id?: string | undefined;
1637
+ header: string;
1638
+ question: string;
1639
+ options?: {
1640
+ label: string;
1641
+ description?: string | undefined;
1642
+ }[] | undefined;
1643
+ multiSelect?: boolean | undefined;
1644
+ }[] | undefined;
1645
+ context?: string | undefined;
1646
+ askSeq?: number | undefined;
1647
+ } | {
1648
+ id: string;
1649
+ source: "agent" | "cezar";
1650
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1651
+ registeredAt: string;
1652
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1653
+ resolvedAt?: string | undefined;
1654
+ deliveredAt?: string | undefined;
1655
+ cancelledAt?: string | undefined;
1656
+ turnId: string;
1657
+ kind: "worker";
1658
+ deadline?: string | undefined;
1659
+ timeoutSeconds?: number | undefined;
1660
+ mode?: "all" | "any" | "one" | undefined;
1661
+ workerIds?: string[] | undefined;
1662
+ revisions?: {
1663
+ workerId: string;
1664
+ revision: number;
1665
+ }[] | undefined;
1666
+ outcomes?: {
1667
+ workerId: string;
1668
+ status: "cancelled" | "done" | "failed" | "review";
1669
+ observedAt: string;
1670
+ summary?: string | undefined;
1671
+ revision?: number | undefined;
1672
+ }[] | undefined;
1673
+ requestIds?: string[] | undefined;
1674
+ requestOutcomes?: {
1675
+ requestId: string;
1676
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
1677
+ observedAt: string;
1678
+ replyId?: string | undefined;
1679
+ }[] | undefined;
1680
+ result?: {
1681
+ reason: "outcome" | "timeout";
1682
+ } | undefined;
1683
+ wakeInputId?: string | undefined;
1684
+ } | {
1685
+ id: string;
1686
+ source: "agent" | "cezar";
1687
+ via: "ask-line" | "budget" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "no-wait" | "schedule-wakeup";
1688
+ registeredAt: string;
1689
+ phase: "cancelled" | "delivered" | "open" | "resolved";
1690
+ resolvedAt?: string | undefined;
1691
+ deliveredAt?: string | undefined;
1692
+ cancelledAt?: string | undefined;
1693
+ turnId: string;
1694
+ kind: "process";
1695
+ deadline: string;
1696
+ timeoutSeconds: number;
1697
+ pid: number;
1698
+ startToken?: string | undefined;
1699
+ exitFile?: string | undefined;
1700
+ note?: string | undefined;
1701
+ result?: {
1702
+ outcome: "deadline" | "error" | "exit_file" | "exited";
1703
+ observedAt: string;
1704
+ exitCode?: number | undefined;
1705
+ exitFileNote?: "not-an-exit-code" | undefined;
1706
+ diagnostic?: string | undefined;
1707
+ } | undefined;
1708
+ })[] | undefined;
1709
+ previewServers?: {
1710
+ port: number;
1711
+ command: string;
1712
+ cwd?: string | undefined;
1713
+ label: string;
1714
+ path?: string | undefined;
1715
+ registeredAt: string;
1716
+ answeredAtRegistration: boolean;
1717
+ }[] | undefined;
1718
+ taskImages?: string[] | undefined;
1719
+ model?: string | undefined;
1720
+ effort?: string | undefined;
1721
+ modelIdentity?: string | undefined;
1722
+ agentProfile?: string | undefined;
1723
+ systemPrompt?: string | undefined;
1724
+ generateFollowups?: boolean | undefined;
1725
+ autonomous?: boolean | undefined;
1726
+ archiveWhenDone?: boolean | undefined;
1727
+ autoMergePr?: boolean | undefined;
1728
+ completionAction?: {
1729
+ id: string;
1730
+ phase: "blocked" | "complete" | "pending";
1731
+ message?: string | undefined;
1732
+ } | undefined;
1733
+ archiveBlocker?: {
1734
+ message: string;
1735
+ runId?: string | undefined;
1736
+ pullRequestUrl?: string | undefined;
1737
+ } | undefined;
1738
+ status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
1739
+ createdAt: string;
1740
+ startedAt?: string | undefined;
1741
+ finishedAt?: string | undefined;
1742
+ tokensUsed: number;
1743
+ inputTokens?: number | undefined;
1744
+ outputTokens?: number | undefined;
1745
+ costUsd?: number | undefined;
1746
+ pullRequestUrl?: string | undefined;
1747
+ referencedPullRequestUrl?: string | undefined;
1748
+ prNumber?: number | undefined;
1749
+ issueNumber?: number | undefined;
1750
+ referencedIssueNumberSeeded?: boolean | undefined;
1751
+ titleOrigin?: "auto" | "marker" | "user" | undefined;
1752
+ markerRefs?: {
1753
+ pr?: number | undefined;
1754
+ issue?: number | undefined;
1755
+ } | undefined;
1756
+ referencedPrCandidates?: string[] | undefined;
1757
+ referencedIssueUrl?: string | undefined;
1758
+ referencedIssueCandidates?: string[] | undefined;
1759
+ worktree?: false | undefined;
1760
+ worktreePath?: string | undefined;
1761
+ branch?: string | undefined;
1762
+ baseBranch?: string | undefined;
1763
+ worktreeReclaimedAt?: string | undefined;
1764
+ groupId?: string | undefined;
1765
+ variant?: string | undefined;
1766
+ clientRequestId?: string | undefined;
1767
+ clientRequestHash?: string | undefined;
1768
+ peakRssBytes?: number | undefined;
1769
+ peakProcCount?: number | undefined;
1770
+ archivedAt?: string | undefined;
1771
+ autoArchive?: {
1772
+ reason: "pull-requests-merged";
1773
+ archivedAt: string;
1774
+ fingerprint: string;
1775
+ pullRequests: {
1776
+ owner: string;
1777
+ repo: string;
1778
+ number: number;
1779
+ mergedAt: string;
1780
+ }[];
841
1781
  } | undefined;
842
- invalidAsk?: boolean | undefined;
1782
+ manualUnarchivedAt?: string | undefined;
1783
+ pinned?: boolean | undefined;
1784
+ pinnedAt?: string | undefined;
1785
+ seenAt?: string | undefined;
1786
+ currentStepId?: string | undefined;
1787
+ error?: string | undefined;
843
1788
  delegation?: {
844
1789
  role: "root";
845
1790
  conversation?: {
@@ -857,21 +1802,22 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
857
1802
  resumed?: true | undefined;
858
1803
  instruction?: string | undefined;
859
1804
  question?: {
1805
+ context?: string | undefined;
860
1806
  questions: {
861
1807
  id?: string | undefined;
862
1808
  header: string;
863
1809
  question: string;
864
- options: {
1810
+ options?: {
865
1811
  label: string;
866
1812
  description?: string | undefined;
867
- }[];
1813
+ }[] | undefined;
868
1814
  multiSelect?: boolean | undefined;
869
1815
  }[];
870
1816
  } | undefined;
871
1817
  }[];
872
1818
  outcomes: {
873
1819
  requestId: string;
874
- status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
1820
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
875
1821
  observedAt: string;
876
1822
  replyId?: string | undefined;
877
1823
  }[];
@@ -894,7 +1840,7 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
894
1840
  requestIds?: string[] | undefined;
895
1841
  requestOutcomes?: {
896
1842
  requestId: string;
897
- status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
1843
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
898
1844
  observedAt: string;
899
1845
  replyId?: string | undefined;
900
1846
  }[] | undefined;
@@ -921,7 +1867,7 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
921
1867
  requestIds?: string[] | undefined;
922
1868
  requestOutcomes?: {
923
1869
  requestId: string;
924
- status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
1870
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
925
1871
  observedAt: string;
926
1872
  replyId?: string | undefined;
927
1873
  }[] | undefined;
@@ -968,7 +1914,7 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
968
1914
  requestIds?: string[] | undefined;
969
1915
  requestOutcomes?: {
970
1916
  requestId: string;
971
- status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
1917
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
972
1918
  observedAt: string;
973
1919
  replyId?: string | undefined;
974
1920
  }[] | undefined;
@@ -995,7 +1941,7 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
995
1941
  requestIds?: string[] | undefined;
996
1942
  requestOutcomes?: {
997
1943
  requestId: string;
998
- status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "sender-closed" | "timed-out";
1944
+ status: "cancelled" | "completed-without-reply" | "destroyed" | "failed" | "human-fallback" | "replied" | "replied-late" | "sender-closed" | "timed-out";
999
1945
  observedAt: string;
1000
1946
  replyId?: string | undefined;
1001
1947
  }[] | undefined;
@@ -1036,6 +1982,9 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
1036
1982
  text?: string | undefined;
1037
1983
  inputs: {
1038
1984
  source: {
1985
+ kind: "parent-file";
1986
+ path: string;
1987
+ } | {
1039
1988
  kind: "baseline-file";
1040
1989
  path: string;
1041
1990
  } | {
@@ -1052,163 +2001,30 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
1052
2001
  } | {
1053
2002
  role: "invalid";
1054
2003
  } | undefined;
1055
- agentInputs?: {
1056
- conversation?: {
1057
- senderRunId: string;
1058
- recipientRunId: string;
1059
- kind: "follow-up" | "progress" | "reply" | "request";
1060
- requestId?: string | undefined;
1061
- } | undefined;
1062
- id: string;
1063
- source: "agent" | "lifecycle";
1064
- parentRunId: string;
1065
- text: string;
1066
- createdAt: string;
1067
- deliveredAt?: string | undefined;
1068
- consumedAt?: string | undefined;
1069
- awaitingRead?: true | undefined;
1070
- inboxClaim?: {
1071
- receiptId: string;
1072
- generation: string;
1073
- expiresAt: string;
1074
- acknowledgedAt?: string | undefined;
1075
- memberIds?: string[] | undefined;
1076
- } | undefined;
1077
- }[] | undefined;
1078
- ciWait?: {
1079
- prUrl: string;
1080
- repository: string;
1081
- prNumber: number;
1082
- headSha: string;
1083
- id: string;
1084
- generation: string;
1085
- turnId: string;
1086
- timeoutSeconds: number;
1087
- registeredAt: string;
1088
- deadline: string;
1089
- phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
1090
- result?: {
1091
- outcome: "cancelled" | "deadline" | "error" | "failed" | "head_changed" | "no_checks" | "passed" | "skipped";
1092
- headSha: string;
1093
- observedHeadSha?: string | undefined;
1094
- observedAt: string;
1095
- checks: {
1096
- name: string;
1097
- state: string;
1098
- link: string;
1099
- }[];
1100
- totalChecks: number;
1101
- truncated: boolean;
1102
- diagnostic?: string | undefined;
1103
- } | undefined;
1104
- wakeId?: string | undefined;
1105
- deliveredAt?: string | undefined;
1106
- } | undefined;
1107
- lastCiWait?: {
1108
- prUrl: string;
1109
- repository: string;
1110
- prNumber: number;
1111
- headSha: string;
1112
- id: string;
1113
- generation: string;
1114
- turnId: string;
1115
- timeoutSeconds: number;
1116
- registeredAt: string;
1117
- deadline: string;
1118
- phase: "delivered" | "parked" | "registered" | "wake-pending" | "withdrawn";
1119
- result?: {
1120
- outcome: "cancelled" | "deadline" | "error" | "failed" | "head_changed" | "no_checks" | "passed" | "skipped";
1121
- headSha: string;
1122
- observedHeadSha?: string | undefined;
1123
- observedAt: string;
1124
- checks: {
1125
- name: string;
1126
- state: string;
1127
- link: string;
1128
- }[];
1129
- totalChecks: number;
1130
- truncated: boolean;
1131
- diagnostic?: string | undefined;
1132
- } | undefined;
1133
- wakeId?: string | undefined;
1134
- deliveredAt?: string | undefined;
1135
- } | undefined;
1136
- lastCiWaitError?: string | undefined;
1137
- previewServers?: {
1138
- port: number;
1139
- command: string;
1140
- cwd?: string | undefined;
1141
- label: string;
1142
- path?: string | undefined;
1143
- registeredAt: string;
1144
- answeredAtRegistration: boolean;
1145
- }[] | undefined;
1146
- taskImages?: string[] | undefined;
1147
- model?: string | undefined;
1148
- effort?: string | undefined;
1149
- modelIdentity?: string | undefined;
2004
+ lastWaitsError?: string | undefined;
2005
+ automaticWakes?: number | undefined;
2006
+ waitDeliveryFailures?: number | undefined;
1150
2007
  runner?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
1151
- agentProfile?: string | undefined;
1152
- systemPrompt?: string | undefined;
1153
- generateFollowups?: boolean | undefined;
1154
- autonomous?: boolean | undefined;
1155
2008
  notify?: boolean | undefined;
1156
2009
  webhook?: {
1157
2010
  lastDeliveredAt?: string | undefined;
1158
2011
  lastError?: string | undefined;
1159
- } | undefined;
1160
- automation?: {
1161
- automationId: string;
1162
- automationRevision: number;
1163
- receiptId: string;
1164
- event: string;
1165
- githubUrl: string;
1166
- } | undefined;
1167
- automationTrigger?: {
1168
- automationId: string;
1169
- automationRevision: number;
1170
- receiptId: string;
1171
- trigger: "catch-up" | "manual" | "schedule";
1172
- occurrenceAt: string;
2012
+ lastErrorWebhookId?: string | undefined;
1173
2013
  } | undefined;
1174
2014
  destroyRetry?: {
1175
2015
  attempts: number;
1176
2016
  nextAt: string;
1177
2017
  needsAttention?: true | undefined;
1178
2018
  } | undefined;
1179
- status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
1180
2019
  stopping?: boolean | undefined;
1181
- activity?: "monitoring" | undefined;
1182
- hasPendingHumanAsk?: boolean | undefined;
1183
- monitoringWakeAt?: string | undefined;
1184
- monitoringWakeCapReached?: boolean | undefined;
2020
+ hasPendingPermission?: boolean | undefined;
1185
2021
  autoResumeAt?: string | undefined;
1186
2022
  autoResumeAttempts?: number | undefined;
1187
- createdAt: string;
1188
- startedAt?: string | undefined;
1189
- finishedAt?: string | undefined;
1190
- tokensUsed: number;
1191
- inputTokens?: number | undefined;
1192
- outputTokens?: number | undefined;
1193
- costUsd?: number | undefined;
1194
- pullRequestUrl?: string | undefined;
1195
- referencedPullRequestUrl?: string | undefined;
1196
- prNumber?: number | undefined;
1197
- issueNumber?: number | undefined;
1198
- referencedIssueNumberSeeded?: boolean | undefined;
1199
- titleOrigin?: "auto" | "marker" | "user" | undefined;
1200
- markerRefs?: {
1201
- pr?: number | undefined;
1202
- issue?: number | undefined;
1203
- } | undefined;
1204
- referencedPrCandidates?: string[] | undefined;
1205
- referencedIssueUrl?: string | undefined;
1206
- referencedIssueCandidates?: string[] | undefined;
1207
- worktree?: false | undefined;
1208
- worktreePath?: string | undefined;
1209
- branch?: string | undefined;
1210
- baseBranch?: string | undefined;
1211
- worktreeReclaimedAt?: string | undefined;
2023
+ pullRequests?: {
2024
+ number: number;
2025
+ url?: string | undefined;
2026
+ source: "created" | "declared";
2027
+ }[] | undefined;
1212
2028
  worktreeSetup?: {
1213
2029
  status: "done" | "failed" | "running";
1214
2030
  startedAt: string;
@@ -1216,19 +2032,31 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
1216
2032
  durationMs?: number | undefined;
1217
2033
  error?: string | undefined;
1218
2034
  } | undefined;
1219
- groupId?: string | undefined;
1220
- variant?: string | undefined;
1221
- clientRequestId?: string | undefined;
1222
- clientRequestHash?: string | undefined;
1223
- peakRssBytes?: number | undefined;
1224
- peakProcCount?: number | undefined;
1225
2035
  archived: boolean;
1226
- archivedAt?: string | undefined;
1227
- pinned?: boolean | undefined;
1228
- pinnedAt?: string | undefined;
1229
- seenAt?: string | undefined;
1230
- currentStepId?: string | undefined;
1231
- error?: string | undefined;
2036
+ workflowDef?: {
2037
+ name: string;
2038
+ description?: string | undefined;
2039
+ steps: {
2040
+ id: string;
2041
+ name?: string | undefined;
2042
+ prompt?: string | undefined;
2043
+ skill?: string | undefined;
2044
+ model?: string | undefined;
2045
+ effort?: string | undefined;
2046
+ timeoutMs?: number | undefined;
2047
+ runner?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
2048
+ agentProfile?: string | undefined;
2049
+ allowedTools?: string[] | undefined;
2050
+ bashAllowlist?: string[] | undefined;
2051
+ command?: string | undefined;
2052
+ onFail?: {
2053
+ retry: string;
2054
+ max: number;
2055
+ } | undefined;
2056
+ }[];
2057
+ source: "built-in" | "file";
2058
+ path?: string | undefined;
2059
+ } | undefined;
1232
2060
  steps: {
1233
2061
  id: string;
1234
2062
  name: string;
@@ -1248,34 +2076,37 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
1248
2076
  finishedAt?: string | undefined;
1249
2077
  error?: string | undefined;
1250
2078
  sessionId?: string | undefined;
1251
- backend?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
2079
+ sessionTransport?: "cursor-acp" | "cursor-print" | undefined;
1252
2080
  profileId?: string | undefined;
1253
2081
  costUsd?: number | undefined;
1254
2082
  synthetic?: "continuation" | undefined;
2083
+ backend?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
1255
2084
  }[];
1256
- workflowDef?: {
1257
- name: string;
1258
- description?: string | undefined;
1259
- steps: {
1260
- id: string;
1261
- name?: string | undefined;
1262
- prompt?: string | undefined;
1263
- skill?: string | undefined;
1264
- model?: string | undefined;
1265
- effort?: string | undefined;
1266
- timeoutMs?: number | undefined;
1267
- runner?: "claude" | "codex" | "cursor" | "omp" | "opencode" | "pi" | undefined;
1268
- agentProfile?: string | undefined;
1269
- allowedTools?: string[] | undefined;
1270
- bashAllowlist?: string[] | undefined;
1271
- command?: string | undefined;
1272
- onFail?: {
1273
- retry: string;
1274
- max: number;
2085
+ automation?: {
2086
+ automationId: string;
2087
+ receiptId: string;
2088
+ event: string;
2089
+ automationRevision: number;
2090
+ githubUrl: string;
2091
+ } | undefined;
2092
+ automationTrigger?: {
2093
+ automationId: string;
2094
+ receiptId: string;
2095
+ trigger: "catch-up" | "manual" | "schedule";
2096
+ occurrenceAt: string;
2097
+ automationRevision: number;
2098
+ } | undefined;
2099
+ handoffRecords?: {
2100
+ autosave: {
2101
+ at: string;
2102
+ note: string;
2103
+ periodic?: {
2104
+ branch: string | null;
2105
+ count: number;
2106
+ first: string | null;
2107
+ latest: string | null;
1275
2108
  } | undefined;
1276
2109
  }[];
1277
- source: "built-in" | "file";
1278
- path?: string | undefined;
1279
2110
  } | undefined;
1280
2111
  }[]>;
1281
2112
  /** One stored record and what its JSON holds beyond the runtime schema (raw-record.ts), which
@@ -1283,6 +2114,8 @@ export declare function parseRunRecords(raw: unknown): z.ZodSafeParseResult<{
1283
2114
  export interface DecodedRun {
1284
2115
  run: RunRecord;
1285
2116
  extras: RawExtras | undefined;
2117
+ /** The stored JSON still had schema-3 wait fields (`upgradeLegacyWaits`): open rewrites it. */
2118
+ upgraded?: true;
1286
2119
  }
1287
2120
  /** One database row's `data` back into a record and its extras. Undefined when it does not parse:
1288
2121
  * one unreadable row costs that row only. */
@@ -1294,13 +2127,7 @@ export type StepState = z.infer<typeof stepStateSchema>;
1294
2127
  export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
1295
2128
  export type RunRecord = z.infer<typeof runRecordSchema>;
1296
2129
  /** One persisted event line; `type` mirrors AgentEvent plus engine lifecycle. */
1297
- export interface RunEvent {
1298
- seq: number;
1299
- ts: string;
1300
- stepId?: string;
1301
- type: string;
1302
- [key: string]: unknown;
1303
- }
2130
+ export type RunEvent = import('../contract/index.js').RunEvent;
1304
2131
  /** How many archived root runs the run lists carry per project (#864): `GET /run-summaries?archived=recent`
1305
2132
  * and `GET /workspace/runs-index`. Unarchived runs are never cut; older archived runs page in
1306
2133
  * through `GET /run-summaries/archived` and the workspace search. */
@@ -1328,16 +2155,11 @@ export declare function reconcileLoadedRun(run: RunRecord, opts?: {
1328
2155
  keepLive?: boolean;
1329
2156
  }): RunRecord;
1330
2157
  /**
1331
- * Settle a live run whose owning process died, when a control adopts it (#779, plan step 3), so
1332
- * that adopting never starts agent work: only Continue may, with the user's own input. A run that
1333
- * never started is cancelled before it began, which Continue restarts as it would after a Stop (the
1334
- * same "untouched" test as `isUntouchedCancelledRun`); any other live run is interrupted, exactly as
1335
- * an open that does not recover settles it, and Continue resumes its last session. With `stop`
1336
- * (the control is Stop, and this is its run) a live run is cancelled instead, as an accepted Stop
1337
- * always reads. Mutates `run`.
2158
+ * Settle an adopted dead owner’s live run without starting work. Untouched runs cancel; started
2159
+ * runs become interrupted. Stop explicitly cancels its target. Mutates run.
1338
2160
  */
1339
2161
  export declare function settleOrphanedRun(run: RunRecord, opts?: {
1340
- stop?: boolean;
2162
+ stop?: boolean | undefined;
1341
2163
  }): RunRecord;
1342
2164
  /**
1343
2165
  * Drop this run's referenced PR/issue if the project's handle proves it foreign and the prompt
@@ -1395,8 +2217,9 @@ export declare class RunWriteRefusedError extends Error {
1395
2217
  }
1396
2218
  /** Newest first, runs created in the same millisecond in insertion order: the order `runs.db`
1397
2219
  * lists in, and the order every list had while it was a stable sort of the in-memory map. */
1398
- /** Why a `run` event fired, when a delegation checkpoint caused it (in-process only). */
1399
- export type CommitSource = 'delegation-checkpoint' | 'delegation-destroy-progress';
2220
+ /** Why a `run` event fired, when a delegation checkpoint caused it or nothing durable changed
2221
+ * (`republish`) (in-process only). */
2222
+ export type CommitSource = 'delegation-checkpoint' | 'delegation-destroy-progress' | 'live-release';
1400
2223
  /**
1401
2224
  * A stored summary, or undefined when the row holds none (a row seeded without one, or text that
1402
2225
  * is not a summary): the caller then projects the record instead. The column is written only by
@@ -1406,43 +2229,10 @@ export type CommitSource = 'delegation-checkpoint' | 'delegation-destroy-progres
1406
2229
  * projects' databases, still validates in full.
1407
2230
  */
1408
2231
  export declare function parseStoredSummary(text: string): RunSummary | undefined;
1409
- /** The bulk-archive sweep's one predicate (#780): finished, not archived, not scheduled (a
1410
- * `failed` run waiting out a usage limit), not an owned worker (those leave with their parent),
1411
- * then filtered by pin state. Mirrored clause for clause by `isSweepable` in the cockpit's
1412
- * `lib/tasks-table.ts`. */
1413
- export declare function isSweepable(run: Pick<RunRecord, 'archived' | 'status' | 'autoResumeAt' | 'pinned'> & {
1414
- delegation?: {
1415
- role: string;
1416
- };
1417
- }, scope?: ArchiveFinishedScope): boolean;
1418
2232
  /**
1419
- * File-backed run store: one row per run in `runs.db` (#779, `./run-database.ts`) plus one
1420
- * append-only NDJSON event file per run. Also the in-process event bus the SSE endpoints
1421
- * subscribe to: emits `('run', RunRecord)` and `('event', { runId, event: RunEvent })`.
1422
- *
1423
- * Only the held set lives in memory (#779, Amendment 2): live runs, the runs a RunManager pins,
1424
- * their delegation families, and runs whose latest write has not settled yet (see `isHeld`).
1425
- * `getRun` answers a held run with the held object, so `commitIndex` still installs into the
1426
- * record a caller holds; any other run is read from `runs.db` as a fresh copy every time (frozen
1427
- * under vitest, so an in-place write throws instead of being lost). Writes to a finished run go
1428
- * through the methods here, which load it, change it and persist the row like any other.
1429
- *
1430
- * Two write paths, both through `writeIndex`:
1431
- * - optimistic: a method changes the held record, marks it dirty and schedules the debounced
1432
- * save, which writes the dirty rows and deletions only;
1433
- * - durable (`commitIndex`): one transaction with the changed rows AND everything a debounced
1434
- * save still owes. Only once it commits do the records change in memory, and only then do
1435
- * subscribers hear about it.
1436
- *
1437
- * Several processes may open one project (`serve` and a headless `cez run`), so a store writes
1438
- * only the delegation families it claims in `run_claims` (#779, plan step 3; `run-claims.ts`).
1439
- * Everything it holds is claimed: open claims the live rows nobody alive owns and leaves the rest
1440
- * alone, and a write to a run not in memory claims its family first, or refuses it while another
1441
- * live process owns it. Claims are released once a family leaves memory, and all of them on
1442
- * `close()`; a crashed owner's are taken over only once it is proven dead. Every write is fenced
1443
- * in its transaction: if a row is not as this store last saw it, or its claim is gone, nothing is
1444
- * written, the evidence goes to `run_conflicts` and this store stops writing that row
1445
- * (`handleConflicts`).
2233
+ * Run rows in runs.db plus append-only NDJSON events and an in-process event bus. Hold live,
2234
+ * pinned, related and unsettled records only. Optimistic writes debounce; durable commits
2235
+ * publish after persistence. Family claims fence every write.
1446
2236
  */
1447
2237
  export declare class RunStore extends EventEmitter {
1448
2238
  private readonly dataDir;
@@ -1498,6 +2288,18 @@ export declare class RunStore extends EventEmitter {
1498
2288
  private readonly compressor;
1499
2289
  /** Transcript facts the delegation paths ask about, so they never re-read a transcript (#880). */
1500
2290
  private readonly facts;
2291
+ private readonly liveItems;
2292
+ /** Capture both sources on the same synchronous sequence boundary before history IO. */
2293
+ liveReadSnapshot(runId: string): {
2294
+ events: {
2295
+ [x: string]: unknown;
2296
+ seq: number;
2297
+ ts: string;
2298
+ stepId?: string | undefined;
2299
+ type: string;
2300
+ }[];
2301
+ throughSeq: number;
2302
+ };
1501
2303
  private constructor();
1502
2304
  /**
1503
2305
  * Open the project's run store. See `reconcileLoadedRun` for what `keepLive` (#367) decides
@@ -1517,8 +2319,9 @@ export declare class RunStore extends EventEmitter {
1517
2319
  * one busy timeout.
1518
2320
  */
1519
2321
  static open(dataDir: string, opts?: {
1520
- keepLive?: boolean;
2322
+ keepLive?: boolean | undefined;
1521
2323
  retryBusy?: boolean;
2324
+ maintenance?: boolean;
1522
2325
  }): RunStore;
1523
2326
  private static openOnce;
1524
2327
  /**
@@ -1546,7 +2349,9 @@ export declare class RunStore extends EventEmitter {
1546
2349
  private loadHeldRows;
1547
2350
  /** Normalize a record just read from `row` (see `reconcileLoadedRun`) and hold it. Marks the row
1548
2351
  * dirty only when normalization changed it, so the next save persists exactly the runs open()
1549
- * rewrote. The caller has claimed the row's family. */
2352
+ * rewrote. A row read up from schema-3 wait fields counts as changed: its rewrite drops them
2353
+ * and recomputes its summary and live column (`upgradeLegacyWaits`). The caller has claimed
2354
+ * the row's family. */
1550
2355
  private adoptLoadedRun;
1551
2356
  /**
1552
2357
  * Hold one delegation family: its root and the root's direct workers, read through the
@@ -1584,12 +2389,9 @@ export declare class RunStore extends EventEmitter {
1584
2389
  /** Why a control on this run must be refused here, or undefined when this store may change it. */
1585
2390
  writeRefusal(id: string): string | undefined;
1586
2391
  /**
1587
- * Take over the delegation family of an `orphaned` run for a control: claim it from its dead
1588
- * owner (or from nobody), then load it and settle its live rows (`settleOrphanedRun`) — never
1589
- * keep them for recovery to resume, since only Continue may start agent work. With `stop` the
1590
- * control is Stop: `id` itself is settled as cancelled rather than interrupted. Returns the
1591
- * family's root id, or undefined when a live owner holds it after all or it is gone. The caller
1592
- * runs recovery for that family next (`RunManager.adoptOrphanedRun`), which then repairs it.
2392
+ * Claim an orphaned family and settle its live rows before a control acts. Stop cancels its
2393
+ * target. Return the root id, or undefined for a live owner or missing run; adoption never
2394
+ * resumes work.
1593
2395
  */
1594
2396
  adoptFamily(id: string, opts?: {
1595
2397
  stop?: boolean;
@@ -1654,23 +2456,15 @@ export declare class RunStore extends EventEmitter {
1654
2456
  * loaded. Pins are per holder, so releasing one never releases another. Returns the held record.
1655
2457
  */
1656
2458
  pin(id: string, holder: RunPinHolder): RunRecord | undefined;
2459
+ /** Publish a run's current record again without a write: something read beside the record
2460
+ * changed, such as the run leaving the manager's live registries, which a detail's finish
2461
+ * verdict reads (hearsay-tools/cezarion#1301). */
2462
+ republish(id: string): void;
1657
2463
  /** Release `holder`'s pin. The run leaves memory at the next sweep once nothing else holds it. */
1658
2464
  unpin(id: string, holder: RunPinHolder): void;
1659
2465
  /**
1660
- * Tell the store which repository this project IS (#945), so the referenced tier stops adopting
1661
- * another repo's PR/issue as the task's subject. See `isRepoScopedRef` for the rule.
1662
- *
1663
- * A setter rather than an `open()` option because `open()` is synchronous and the handle costs a
1664
- * `gh` spawn: callers arm this in the background so boot never waits on the network. `null` is a
1665
- * first-class answer meaning "cannot be known" (no `gh`, no remote, a non-git root) and leaves
1666
- * the store in exactly its pre-#945 behavior.
1667
- *
1668
- * Arming also HEALS records already poisoned by the un-scoped rule, on the `reconcileLoadedRun`
1669
- * precedent: the evidence is all still on the record (`referenced*Candidates`), only the
1670
- * conclusion drawn from it was wrong, so re-deciding beats asking for a migration. It rewrites
1671
- * values, never the format, and is one-directional by construction — see `rescopeRun`. Held
1672
- * runs are re-checked in memory; of the rest, only rows whose stored summary references another
1673
- * repository are decoded, and the healed ones are written, so their summaries heal too.
2466
+ * Set discovered repository identity without blocking boot. Recompute conclusions from retained
2467
+ * evidence, including cold records; null retains unknown-handle behavior.
1674
2468
  */
1675
2469
  setRepoHandle(handle: RepoHandle | null): void;
1676
2470
  /** Whether the stored summary still names a reference the scoped record no longer has. */
@@ -1678,7 +2472,7 @@ export declare class RunStore extends EventEmitter {
1678
2472
  /**
1679
2473
  * The live set, newest first: runs whose record is live (`isLiveRecord`) or that a RunManager
1680
2474
  * pins. Finished runs are not here — read one by id (`getRun`), by an indexed query
1681
- * (`listWorkersOf`, `findRunByClientRequestId`, `listGroupRuns`, `listRunsWithWorktree`,
2475
+ * (`listWorkersOf`, `findRunByClientRequestId`, `listRunsWithWorktree`,
1682
2476
  * `listBranchOwners`), or as list rows (`listRunSummaries`).
1683
2477
  */
1684
2478
  listRuns(): RunRecord[];
@@ -1708,7 +2502,7 @@ export declare class RunStore extends EventEmitter {
1708
2502
  * which decodes nothing; reading it is what finds out (`isUnreadable`).
1709
2503
  */
1710
2504
  listRunSummaries(options?: {
1711
- archivedWindow?: number;
2505
+ archivedWindow?: number | undefined;
1712
2506
  roots?: boolean;
1713
2507
  }): {
1714
2508
  runs: RunSummary[];
@@ -1718,7 +2512,9 @@ export declare class RunStore extends EventEmitter {
1718
2512
  * One page of archived ROOT runs, newest first (#864): `GET /run-summaries/archived`, the
1719
2513
  * archived runs past the window. Held runs list by their record, as in `listRunSummaries`.
1720
2514
  * `before` is the previous page's `nextCursor`; with `q`, only runs `matchesRunQuery` keeps, and
1721
- * `total` counts those. A cursor this store did not write answers `{ error }`.
2515
+ * `total` counts those. `automationNames` lets `q` match a task by its automation's name, as the
2516
+ * list's origin line shows it (hearsay-tools/cezarion#1616). A cursor this store did not write
2517
+ * answers `{ error }`.
1722
2518
  *
1723
2519
  * Ranking reads every archived root's key (id, created_at, seq: no record, no summary), so the
1724
2520
  * page and `total` agree with the held overlay; only the page's own rows are read in full.
@@ -1727,11 +2523,27 @@ export declare class RunStore extends EventEmitter {
1727
2523
  before?: string;
1728
2524
  limit: number;
1729
2525
  q?: string;
2526
+ automationNames?: AutomationNames;
1730
2527
  }): ArchivedRunsResponse | {
1731
2528
  error: string;
1732
2529
  };
2530
+ /** The archived roots in `runs.db`, each by its key: every one without `q` (no record, no
2531
+ * summary read), and with `q` the searched rows `matchesRunSearch` keeps, which carry the summary
2532
+ * the search read. A deleted, held or unreadable run's row is left out; a held run joins in
2533
+ * `overlayHeldArchived`. */
2534
+ private rankArchivedRows;
2535
+ /** Lay the held archived roots over `ranked`, each by its record: it replaces its stored row
2536
+ * (already left out of `ranked`), and with `q` it must match. A held worker never lists. */
2537
+ private overlayHeldArchived;
2538
+ /** The page of `ordered` after the cursor `after`: its summaries, the cursor of the next page,
2539
+ * and `total`, the count of all of `ordered`. */
2540
+ private archivedPage;
2541
+ /** The page's summaries: a ranked key's own, else its stored one, read for the rows that have
2542
+ * none in a single query. A row whose stored summary does not fit the contract is projected from
2543
+ * its record; a row that cannot be read at all is left out. */
2544
+ private hydrateArchivedPage;
1733
2545
  /**
1734
- * The ROOT runs, archived or not, that match `query` (`matchesRunQuery`), newest first: at most
2546
+ * The ROOT runs, archived or not, that match `query` (`matchesRunSearch`), newest first: at most
1735
2547
  * `limit`, and whether more matched. The owned half of the workspace search (#864); held runs
1736
2548
  * match by their record.
1737
2549
  */
@@ -1770,6 +2582,12 @@ export declare class RunStore extends EventEmitter {
1770
2582
  /** The id of every run whose delegation is quarantined (`invalid`), held or stored: its stored
1771
2583
  * summary says so, so nothing is decoded (scratch cleanup). */
1772
2584
  listQuarantinedRunIds(): string[];
2585
+ /** All retained tasks this automation started, including variants, finished and archived runs.
2586
+ * Logs and receipts may compact independently. Read only matching keys in SQLite and overlay
2587
+ * held records so a debounced provenance update or deletion is reflected immediately. */
2588
+ countAutomationRuns(automationId: string): number;
2589
+ /** First non-archived task referencing a project issue, including secondary references. */
2590
+ findNonArchivedRunByIssue(repo: string, number: number): string | undefined;
1773
2591
  /**
1774
2592
  * The runs automation receipts launched, by receipt id (`automation.receiptId` or
1775
2593
  * `automationTrigger.receiptId`). Memory answers first; a receipt it does not know costs one
@@ -1783,8 +2601,6 @@ export declare class RunStore extends EventEmitter {
1783
2601
  listConversationRootIds(): string[];
1784
2602
  /** The id of every run, held or stored, without decoding any (orphan-worktree sweeps). */
1785
2603
  listRunIds(): string[];
1786
- /** The members of one parallel-variant group (spec 010), in no particular order. */
1787
- listGroupRuns(groupId: string): RunRecord[];
1788
2604
  /** Runs with a materialized worktree directory (`worktreePath`, not reclaimed), most recently
1789
2605
  * finished first, then newest first: worktree retention and the worktrees panel. */
1790
2606
  listRunsWithWorktree(): RunRecord[];
@@ -1803,25 +2619,30 @@ export declare class RunStore extends EventEmitter {
1803
2619
  findRunByClientRequestId(clientRequestId: string): RunRecord | undefined;
1804
2620
  createRun(input: {
1805
2621
  title: string;
1806
- systemPrompt?: string;
2622
+ systemPrompt?: string | undefined;
1807
2623
  workflowDef?: z.infer<typeof workflowDefSchema>;
1808
2624
  workflow: string;
1809
2625
  task: string;
1810
- model?: string;
2626
+ model?: string | undefined;
1811
2627
  /** Reasoning-effort pin (#45). Absent = harness default. */
1812
- effort?: string;
1813
- runner?: RunnerId;
2628
+ effort?: string | undefined;
2629
+ runner?: RunnerId | undefined;
1814
2630
  /** Composer's per-task agent account (spec 2026-07-29-agent-profiles). */
1815
- agentProfile?: string;
1816
- generateFollowups?: boolean;
1817
- autonomous?: boolean;
2631
+ agentProfile?: string | undefined;
2632
+ autonomous?: boolean | undefined;
2633
+ archiveWhenDone?: boolean | undefined;
2634
+ autoMergePr?: boolean | undefined;
1818
2635
  /** Task webhook opt-in (#589), set at creation so the first transition is already covered. */
1819
- notify?: boolean;
1820
- worktree?: false;
2636
+ notify?: boolean | undefined;
2637
+ worktree?: false | undefined;
1821
2638
  groupId?: string;
1822
2639
  variant?: string;
1823
- clientRequestId?: string;
1824
- clientRequestHash?: string;
2640
+ clientRequestId?: string | undefined;
2641
+ clientRequestHash?: string | undefined;
2642
+ /** Automation provenance, committed with the row that creates the run (hearsay-tools/cezarion#1465):
2643
+ * a crash before a later write must still let reconciliation find the receipt's task. */
2644
+ automation?: RunRecord['automation'];
2645
+ automationTrigger?: RunRecord['automationTrigger'];
1825
2646
  steps: Array<Pick<StepState, 'id' | 'name' | 'kind'>>;
1826
2647
  }): RunRecord;
1827
2648
  /** Build without publishing: owned creation must commit its receipt and run together. */
@@ -1831,35 +2652,59 @@ export declare class RunStore extends EventEmitter {
1831
2652
  recipientRunId: string;
1832
2653
  input: AgentInput;
1833
2654
  }): void;
1834
- /** Observable atomic input checkpoint: a failed write publishes nothing. */
1835
- /** Accepted input the harness will never read returns to the queue (#505): only its
1836
- * delivery and consumption receipts are cleared; order and identity are kept. */
1837
- requeueUnconsumedAgentInputs(id: string, ids: readonly string[]): void;
1838
- /** Model consumption observed by the current session (#505). Never un-sets deliveredAt. */
1839
- commitAgentInputsConsumed(id: string, ids: readonly string[], at: string): void;
1840
- /** Delivered, but the harness never confirmed reading it (#505): stop awaiting a read. */
1841
- commitAgentInputsUnconfirmed(id: string, ids: readonly string[]): void;
1842
2655
  /** Crash recovery (#505): input a harness accepted but was never seen reading goes
1843
2656
  * back to the queue. Returns the requeued IDs. */
1844
2657
  requeueAwaitingReadInputs(id: string): string[];
1845
- commitAgentInputs(id: string, inputs: readonly AgentInput[], openingContinuationInputId?: string): void;
2658
+ /** Delivered, but the harness never confirmed reading it (#505): stop awaiting a read. */
2659
+ commitAgentInputsUnconfirmed(id: string, ids: readonly string[]): void;
2660
+ /** Observable atomic input checkpoint for the queue itself: enqueue, retire, reorder. Delivery
2661
+ * and reads are outcomes (`commitOutcome`). */
2662
+ commitAgentInputs(id: string, inputs: readonly AgentInput[]): void;
1846
2663
  /** Reserve only unread conversation inputs in one durable index replacement. */
1847
2664
  claimInboxInputs(runId: string, ids: readonly string[], claim: InboxClaim): void;
1848
2665
  /** A receipt owns every matching input or none; exact ACK retries preserve the first timestamp. */
1849
2666
  ackInboxInputs(runId: string, receiptId: string, generation: string, at: string): 'acknowledged' | 'already-acknowledged';
1850
2667
  releaseInboxInputs(runId: string, receiptId: string, generation: string): 'released';
1851
2668
  clearExpiredInboxClaims(runId: string, now: string): void;
1852
- /** CI intent and its wake entry share one atomic index replacement. */
2669
+ /**
2670
+ * A wait and its wake input share one atomic index replacement (spec 2026-10-17-unified-waits).
2671
+ * Upserts `wait` by id into `waits` and clears `lastWaitsError`; `input` is appended once (an
2672
+ * input whose id is already queued stays as it is). Only an open or resolved wait is committed
2673
+ * here: settling is an outcome (`commitOutcome`). A new open wait
2674
+ * past `WAIT_LIMIT` open ones is refused, so the list stays bounded whatever the caller checked.
2675
+ */
2676
+ commitWait(id: string, wait: Wait, input?: AgentInput): void;
2677
+ /** A park that gives up its slot (hearsay-tools/cezarion#1235): the run and its step read
2678
+ * `waiting`, committed at once instead of on the debounced save, so a refused write throws with
2679
+ * nothing changed and the caller keeps the slot. */
2680
+ commitParked(id: string, stepId?: string): void;
2681
+ /** A usage-limit appointment withdrawn, committed at once instead of on the debounced save
2682
+ * (hearsay-tools/cezarion#1236): a crash right after the withdrawal must not find it on disk,
2683
+ * or recovery re-arms work the user cancelled. A run held for its resume settles `failed`. */
2684
+ commitAutoResumeWithdrawal(id: string): void;
2685
+ /** Legacy CI checkpoint over `commitWait`, kept until its callers move (unified waits, Task 4). */
1853
2686
  commitCiWait(id: string, wait: CiWait, input?: AgentInput): void;
1854
- /** Retire the wait and precisely its pending wake, optionally accepting human input. */
1855
- commitCiWaitWithdrawal(id: string, acceptedHumanMessage?: QueuedMessage): void;
1856
- /** Provider acceptance and receipt retirement have one delivery checkpoint. */
1857
- commitCiWaitDelivery(id: string, inputId: string): void;
1858
- /** Retain the settled receipt and retire exactly one wait together with any human message that superseded it. */
1859
- commitWorkerWaitWithdrawal(id: string, waitId: string, acceptedHumanMessage?: QueuedMessage): void;
1860
- /** Successful deferred human delivery consumes only its persisted queue ID.
1861
- * A crash before this checkpoint may replay that same message on recovery. */
1862
- commitQueuedMessageDelivery(id: string, messageId: string): void;
2687
+ /** A human message beside a run's waits (hearsay-tools/cezarion#1235): accepted durably, and
2688
+ * every wait stays. A lifecycle opening becomes
2689
+ * the human's and keeps its wake text, so the message opens the continuation (and answers a
2690
+ * pending question) and the owed results still reach the agent. */
2691
+ commitHumanMessageBesideWaits(id: string, acceptedHumanMessage: QueuedMessage): void;
2692
+ /**
2693
+ * The one write of a run outcome (hearsay-tools/cezarion#1805): an input or wait delivered, a wake
2694
+ * charged, a wait settled, a question answered, staged by `applyOutcomes` with what it depends on
2695
+ * (`deps`) and committed in one transaction, with every pending row. A crash keeps all of it or
2696
+ * none. Nothing changes: nothing is written. Needs no live session: it reads the stored record.
2697
+ *
2698
+ * A refused write throws with nothing changed. `bestEffort` is for a cleanup path, which must
2699
+ * never stop on it: it warns and applies the change in memory for the debounced save to retry.
2700
+ * A conversation request outcome is the other sanctioned write: `commitConversation`.
2701
+ */
2702
+ commitOutcome(id: string, outcomes: RunOutcome | readonly RunOutcome[], deps?: OutcomeDependencies, opts?: {
2703
+ bestEffort?: boolean;
2704
+ }): {
2705
+ committed: boolean;
2706
+ answered: string[];
2707
+ };
1863
2708
  /** An acknowledged inactive-root Finish must survive the async diff and restart. */
1864
2709
  commitRootFinishIntent(id: string): void;
1865
2710
  /** Cancellation supersedes pending Finish in one durable checkpoint. Also
@@ -1901,16 +2746,25 @@ export declare class RunStore extends EventEmitter {
1901
2746
  */
1902
2747
  createOwnedRun(input: Parameters<RunStore['createRun']>[0], parentId: string, requestId: string, worker: DelegationState, requestHash: string, executionIdentity?: WorkerExecutionIdentity): RunRecord;
1903
2748
  /**
1904
- * The durable write: `staged` holds the records this operation replaces (`null` deletes one),
1905
- * in the order subscribers hear about them. The transaction is the durability boundary;
1906
- * flush() is deliberately best-effort.
1907
- *
1908
- * One transaction carries the staged rows and every row a debounced save still owes, so the
1909
- * database never holds a commit without the optimistic writes made before it. If it fails,
1910
- * nothing changed anywhere: the held records, the database, the pending dirty rows and the
1911
- * subscribers all see the store as it was.
2749
+ * Durably replace or delete staged rows together with pending dirty rows. Persist before
2750
+ * changing held objects or notifying subscribers. On failure retain all pending state; flush()
2751
+ * remains best-effort.
1912
2752
  */
1913
2753
  private commitIndex;
2754
+ /** Completion and its intent/archive share the same committed rows, including root Finish. */
2755
+ private prepareCompletionActions;
2756
+ private completionArchiveBlocker;
2757
+ /** One archive write for manual actions, merge observations, completion, and sweeps.
2758
+ * Archiving files history away; it never stops a process or removes a worktree. */
2759
+ private stageArchive;
2760
+ /** A bounded persisted queue also covers projects without a live RunManager. */
2761
+ listCompletionCandidates(afterSeq?: number, limit?: number): Array<{
2762
+ id: string;
2763
+ seq: number;
2764
+ }>;
2765
+ canCompleteAction(id: string, token: string): boolean;
2766
+ claimCompletionAction(id: string, token: string): boolean;
2767
+ completeAction(id: string, token: string, phase: 'blocked' | 'complete', message?: string): boolean;
1914
2768
  /**
1915
2769
  * Refuse (throwing, with nothing changed) a commit that stages a quarantined run, or a run whose
1916
2770
  * family this store does not claim and cannot take: another process owns it, or a dead process
@@ -1951,6 +2805,21 @@ export declare class RunStore extends EventEmitter {
1951
2805
  /** Append a step to an existing run (used by "Continue" — spec 003). */
1952
2806
  addStep(runId: string, step: Pick<StepState, 'id' | 'name' | 'kind' | 'synthetic'>): void;
1953
2807
  updateStep(runId: string, stepId: string, patch: Partial<Omit<StepState, 'id'>>): void;
2808
+ listArchiveOnMergeCandidates(afterSeq?: number, limit?: number): Array<{
2809
+ id: string;
2810
+ seq: number;
2811
+ }>;
2812
+ /** Use unnormalized persisted evidence: cold reads must not turn interrupted work into safety. */
2813
+ private archiveFamily;
2814
+ /** Blockers are feedback, never archive authority or cleanup permission. */
2815
+ setArchiveBlocker(id: string, blocker: RunRecord['archiveBlocker']): void;
2816
+ archiveMergeBlocker(snapshot: ArchiveOnMergeSnapshot, missing: ArchivePullRequestIdentity, repoBase?: string): void;
2817
+ hasArchiveOnMergeAssociations(id: string): boolean;
2818
+ prepareArchiveOnMerge(id: string): Promise<void>;
2819
+ archiveOnMergeSnapshot(id: string, repoBase?: string, isActive?: (id: string) => boolean): ArchiveOnMergeSnapshot | undefined;
2820
+ private archiveSnapshot;
2821
+ /** No await between final revalidation and the fenced, all-or-nothing cascade. */
2822
+ archiveAfterMerge(snapshot: ArchiveOnMergeSnapshot, observations: readonly MergedPullRequest[], repoBase?: string, isActive?: (id: string) => boolean): boolean;
1954
2823
  setArchived(id: string, archived: boolean): RunRecord | undefined;
1955
2824
  /** Parent + owned workers; returns how many records flipped `archived`. */
1956
2825
  private applyArchivedCascade;
@@ -1980,7 +2849,7 @@ export declare class RunStore extends EventEmitter {
1980
2849
  /** Bulk-archive finished runs (#780). `isSweepable` decides which; `archived` counts every
1981
2850
  * record that flipped (cascaded workers included), `ids` lists the top-level runs picked and
1982
2851
  * `pinnedIds` the subset that carried a pin before `clearPin` dropped it. */
1983
- archiveFinished(scope?: ArchiveFinishedScope): {
2852
+ archiveFinished(scope?: ArchiveFinishedScope, automation?: boolean): {
1984
2853
  archived: number;
1985
2854
  ids: string[];
1986
2855
  pinnedIds: string[];
@@ -2004,34 +2873,16 @@ export declare class RunStore extends EventEmitter {
2004
2873
  * the marker. WHETHER the action means anything for a given run is UI policy, and lives
2005
2874
  * in the cockpit's `runActionFlags` — the same split the rest of the store keeps. */
2006
2875
  setUnread(id: string): RunRecord | undefined;
2007
- /** Bulk mark-read: stamp every currently-unread finished run; returns the count.
2008
- * "Unread" here is the same rule the cockpit paints (`isUnread` in read-state.ts),
2009
- * clause for clause:
2010
- * - a `done` or `failed` run that finished and has not been seen since;
2011
- * - cancelled runs are never unread — you stopped them yourself;
2012
- * - archived ones never are either, since archiving is a stronger "done with this"
2013
- * than reading;
2014
- * - and a `failed` run with a pending `autoResumeAt` is not a done item AT ALL
2015
- * (`isScheduledResume`, spec 2026-08-03-auto-resume-after-usage-limit): it has an
2016
- * appointment to pick the work back up, so there is no outcome to have missed.
2017
- *
2018
- * Keeping the two rules identical is what makes the returned count the number the
2019
- * cockpit's unread badge was showing. The `autoResumeAt` clause is the one that drifted
2020
- * (#803): `isUnread` gained it with auto-resume and this sweep did not, so a task waiting
2021
- * out a usage limit was uncounted by the badge but stamped read by the sweep — and this
2022
- * comment asserted an invariant the code no longer held.
2023
- *
2024
- * This rule lives in two languages of the same repo, which is why it has now drifted
2025
- * once. The cockpit cannot import it (`packages/web` does not depend on the service, and
2026
- * should not), so a single definition would have to move to `packages/contract` — the one
2027
- * package both sides already import. Worth doing; deliberately not done here, because
2028
- * widening the contract package's remit from "shapes" to "behavior" is a design change
2029
- * that deserves its own review rather than riding along in a bug fix. Until then: EDIT
2030
- * BOTH, and the case-table tests on either side are what catch you if you don't. */
2031
- markAllRead(): number;
2876
+ /**
2877
+ * Stamp unread finished runs in bulk and return the count. Keep the rule aligned with cockpit
2878
+ * isUnread: done/failed, finished since seen, not archived; cancelled and usage-limit waiting
2879
+ * runs are excluded. `automation` narrows it to one origin, as in `archiveFinished`
2880
+ * (hearsay-tools/cezarion#1616); absent stamps both.
2881
+ */
2882
+ markAllRead(automation?: boolean): number;
2032
2883
  appendEvent(runId: string, event: {
2033
2884
  type: string;
2034
- stepId?: string;
2885
+ stepId?: string | undefined;
2035
2886
  [key: string]: unknown;
2036
2887
  }): RunEvent;
2037
2888
  /**
@@ -2052,7 +2903,7 @@ export declare class RunStore extends EventEmitter {
2052
2903
  /**
2053
2904
  * Apply agent-declared reference markers (spec 2026-07-18-task-ref-markers).
2054
2905
  * Marker values are authoritative for the display tier: they overwrite the
2055
- * regex/namer numbers, and a declared PR re-resolves the referenced URL
2906
+ * regex/namer numbers unless the prompt identifies the originating issue, and a declared PR re-resolves the referenced URL
2056
2907
  * against the candidate working set — including down to `undefined` when no
2057
2908
  * candidate matches (a wrong chip is worse than no chip). The created tier
2058
2909
  * (`pullRequestUrl`) is deliberately untouched.
@@ -2062,16 +2913,21 @@ export declare class RunStore extends EventEmitter {
2062
2913
  * re-declare after it opens a PR, and taking that literally cost the task the PR it was about.
2063
2914
  */
2064
2915
  applyMarkerRefs(runId: string, refs: {
2065
- pr?: number;
2066
- issue?: number;
2916
+ pr?: number | undefined;
2917
+ prs?: readonly number[] | undefined;
2918
+ issue?: number | undefined;
2067
2919
  }): RunRecord | undefined;
2920
+ /** Authoritative creation keeps the first scalar for publishing, plus every created identity. */
2921
+ recordCreatedPr(runId: string, url: string): RunRecord | undefined;
2922
+ private accumulatePullRequests;
2068
2923
  /**
2069
2924
  * Fan an event out to live subscribers WITHOUT writing it to the NDJSON
2070
2925
  * file — the channel for coalesced `item.delta` flushes (protocol-v2
2071
2926
  * performance guardrail: raw deltas never hit disk; replay = the persisted
2072
2927
  * snapshots). Stamped with `seq`/`ts` like persisted lines so the live
2073
- * wire keeps one ordering axis; the seq simply never appears in a replay
2074
- * (gaps are fine — dedup compares with `>`).
2928
+ * wire keeps one ordering axis. Finite polling coalesces active item content
2929
+ * into bounded in-memory snapshots on that clock; disk replay still has gaps
2930
+ * (dedup compares with `>`).
2075
2931
  */
2076
2932
  emitEphemeral(runId: string, event: {
2077
2933
  type: string;
@@ -2096,18 +2952,23 @@ export declare class RunStore extends EventEmitter {
2096
2952
  /** The run's indexed transcript facts (#880): a read-only view, never a transcript read once
2097
2953
  * the run's index is loaded. An unreadable transcript answers as empty, as readEvents does. */
2098
2954
  transcriptFacts(runId: string): Readonly<TranscriptFacts>;
2955
+ /** The run's transcript facts when they are known: undefined when the transcript exists but its
2956
+ * facts are not current or cannot be read, so a caller can tell "no ask" from "no evidence". */
2957
+ knownTranscriptFacts(runId: string): Readonly<TranscriptFacts> | undefined;
2099
2958
  hasProjection(runId: string, projectionId: string): boolean;
2100
2959
  private factsWarming;
2101
- /** After open, build the indexes the delegation reconcile will ask for first, off the request
2102
- * path: every member of every family with a conversation (#880). */
2960
+ /** Indexed family enumeration, including members not yet flushed to SQLite. */
2961
+ listFamilyRunIds(rootId: string): string[];
2962
+ private recoveryFactIds;
2963
+ /** Readiness owns no run snapshot across an await: refresh only the currently held owner. */
2964
+ prepareTranscriptFacts(runIds: Iterable<string>): Promise<void>;
2965
+ prepareRecoveryFacts(familyRootId?: string): Promise<void>;
2966
+ /** Register IDs only here; the index yields between cache reads and off-loop rebuilds. */
2103
2967
  private warmTranscriptFacts;
2104
2968
  /** Resolves when the open-time warm-up is done (tests). */
2105
2969
  factsWarmIdle(): Promise<void>;
2106
2970
  /** `readEvents` off the event loop (async read and async brotli), for collection paths. */
2107
2971
  readEventsAsync(runId: string): Promise<RunEvent[]>;
2108
- /** The owned store's `refreshHumanAskSummary`, from the index, on the same rules: no history
2109
- * (legacy runs) keeps the summary, an unreadable one requests attention. True when it changed. */
2110
- private syncHumanAskSummary;
2111
2972
  readEvents(runId: string): RunEvent[];
2112
2973
  /** Private process-generation evidence; never part of run JSON or SSE. */
2113
2974
  private identityPath;
@@ -2122,7 +2983,7 @@ export declare class RunStore extends EventEmitter {
2122
2983
  /** `workerResourcesSafe` with the refusal's live PIDs (empty when no PID explains it). */
2123
2984
  workerResourceHolders(id: string, generation: string, resourceId: string, opts?: {
2124
2985
  admittingQueued?: boolean;
2125
- cwds?: CwdSource;
2986
+ cwds?: CwdSource | undefined;
2126
2987
  }): 'safe' | number[];
2127
2988
  /** Upgrade a legacy completed checkpoint while terminal task ownership is still known.
2128
2989
  * No holder scan here: settlement and scheduling must never wait on cleanup proof. */
@@ -2206,23 +3067,9 @@ export declare class RunStore extends EventEmitter {
2206
3067
  * generations it took them, and each row at the revision it last saw (none for a new row). */
2207
3068
  private fence;
2208
3069
  /**
2209
- * A fenced write found rows that changed under this store (#779, plan step 3); the write itself
2210
- * has already failed with nothing changed, and its caller sees that error.
2211
- *
2212
- * A conflict is UNEXPECTED when this store owned the row's family when it last read or wrote it:
2213
- * a held or pending row, or one read inside a family it claimed. Another writer then broke the
2214
- * claim. For each such row the original (what this store last saw), local (what it meant to
2215
- * write, or that it meant to delete it) and current versions go to `run_conflicts` first. Only
2216
- * once that evidence is stored does the row leave the pending set, so no retry rewrites it; this
2217
- * store then refuses to write it again, and its held copy is replaced by the current row (or
2218
- * dropped when deleted) and announced. That refusal lasts as long as this store: the explicit
2219
- * recovery is a restart, which reads the row as it now stands, and the evidence row stays for a
2220
- * person to compare. Other pending rows stay pending and the next save writes them.
2221
- *
2222
- * If the evidence cannot be stored, nothing changes: the rows stay pending, and the next write
2223
- * meets the same conflict and tries again. A row read before its family was claimed may simply
2224
- * have been finished by its previous owner in between: a stale read, not a conflict, so only the
2225
- * write fails.
3070
+ * Handle a fenced-write conflict. Save unexpected conflict evidence before clearing pending
3071
+ * state or quarantining the row. If evidence persistence fails, retain pending writes. Other
3072
+ * rows remain writable; stale unclaimed reads only fail their write.
2226
3073
  */
2227
3074
  private handleConflicts;
2228
3075
  /** Write what is pending, then (unless closing) let every run whose write settled leave memory. */
@@ -2235,3 +3082,9 @@ export declare class RunStore extends EventEmitter {
2235
3082
  */
2236
3083
  close(): void;
2237
3084
  }
3085
+ export interface ArchiveOnMergeSnapshot {
3086
+ rootId: string;
3087
+ fingerprint: string;
3088
+ pullRequests: ArchivePullRequestIdentity[];
3089
+ token: string;
3090
+ }