@wjarka/cezarion 0.10.0-pr30.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +838 -0
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +72 -0
  7. package/dist/agent-config/catalog.js +223 -0
  8. package/dist/agent-config/catalog.js.map +1 -0
  9. package/dist/agent-config/files.d.ts +46 -0
  10. package/dist/agent-config/files.js +119 -0
  11. package/dist/agent-config/files.js.map +1 -0
  12. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  13. package/dist/agent-config/model-settings/claude.js +11 -0
  14. package/dist/agent-config/model-settings/claude.js.map +1 -0
  15. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  16. package/dist/agent-config/model-settings/codex.js +16 -0
  17. package/dist/agent-config/model-settings/codex.js.map +1 -0
  18. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  19. package/dist/agent-config/model-settings/opencode.js +8 -0
  20. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  21. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  22. package/dist/agent-config/model-settings/pi.js +18 -0
  23. package/dist/agent-config/model-settings/pi.js.map +1 -0
  24. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  25. package/dist/agent-config/model-settings/shared.js +93 -0
  26. package/dist/agent-config/model-settings/shared.js.map +1 -0
  27. package/dist/agent-config/model-settings/types.d.ts +9 -0
  28. package/dist/agent-config/model-settings/types.js +2 -0
  29. package/dist/agent-config/model-settings/types.js.map +1 -0
  30. package/dist/agent-config/models.d.ts +9 -0
  31. package/dist/agent-config/models.js +32 -0
  32. package/dist/agent-config/models.js.map +1 -0
  33. package/dist/agent-config/seed.d.ts +7 -0
  34. package/dist/agent-config/seed.js +90 -0
  35. package/dist/agent-config/seed.js.map +1 -0
  36. package/dist/agent-config/service.d.ts +44 -0
  37. package/dist/agent-config/service.js +71 -0
  38. package/dist/agent-config/service.js.map +1 -0
  39. package/dist/agent-config/validate.d.ts +21 -0
  40. package/dist/agent-config/validate.js +76 -0
  41. package/dist/agent-config/validate.js.map +1 -0
  42. package/dist/automations/coordinator.d.ts +26 -0
  43. package/dist/automations/coordinator.js +66 -0
  44. package/dist/automations/coordinator.js.map +1 -0
  45. package/dist/automations/github-poller.d.ts +74 -0
  46. package/dist/automations/github-poller.js +234 -0
  47. package/dist/automations/github-poller.js.map +1 -0
  48. package/dist/automations/scheduler.d.ts +42 -0
  49. package/dist/automations/scheduler.js +192 -0
  50. package/dist/automations/scheduler.js.map +1 -0
  51. package/dist/automations/store.d.ts +65 -0
  52. package/dist/automations/store.js +298 -0
  53. package/dist/automations/store.js.map +1 -0
  54. package/dist/automations/task-template.d.ts +18 -0
  55. package/dist/automations/task-template.js +95 -0
  56. package/dist/automations/task-template.js.map +1 -0
  57. package/dist/automations/types.d.ts +255 -0
  58. package/dist/automations/types.js +159 -0
  59. package/dist/automations/types.js.map +1 -0
  60. package/dist/config.d.ts +77 -0
  61. package/dist/config.js +242 -0
  62. package/dist/config.js.map +1 -0
  63. package/dist/contract/agent-config.d.ts +153 -0
  64. package/dist/contract/agent-profiles.d.ts +347 -0
  65. package/dist/contract/automations.d.ts +935 -0
  66. package/dist/contract/events.d.ts +104 -0
  67. package/dist/contract/github.d.ts +556 -0
  68. package/dist/contract/health.d.ts +102 -0
  69. package/dist/contract/index.d.ts +16 -0
  70. package/dist/contract/index.js +1895 -0
  71. package/dist/contract/projects.d.ts +210 -0
  72. package/dist/contract/repo.d.ts +234 -0
  73. package/dist/contract/runs.d.ts +1473 -0
  74. package/dist/contract/skills.d.ts +232 -0
  75. package/dist/contract/workflows.d.ts +218 -0
  76. package/dist/contract/workspace.d.ts +579 -0
  77. package/dist/core/agent-env.d.ts +31 -0
  78. package/dist/core/agent-env.js +371 -0
  79. package/dist/core/agent-env.js.map +1 -0
  80. package/dist/core/agent-model-policy.d.ts +10 -0
  81. package/dist/core/agent-model-policy.js +36 -0
  82. package/dist/core/agent-model-policy.js.map +1 -0
  83. package/dist/core/agent-profiles.d.ts +62 -0
  84. package/dist/core/agent-profiles.js +90 -0
  85. package/dist/core/agent-profiles.js.map +1 -0
  86. package/dist/core/agent-runner.d.ts +211 -0
  87. package/dist/core/agent-runner.js +68 -0
  88. package/dist/core/agent-runner.js.map +1 -0
  89. package/dist/core/ask.d.ts +105 -0
  90. package/dist/core/ask.js +187 -0
  91. package/dist/core/ask.js.map +1 -0
  92. package/dist/core/backend-detect.d.ts +16 -0
  93. package/dist/core/backend-detect.js +155 -0
  94. package/dist/core/backend-detect.js.map +1 -0
  95. package/dist/core/claude-cli-runner.d.ts +59 -0
  96. package/dist/core/claude-cli-runner.js +483 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-ui-mapper.d.ts +80 -0
  99. package/dist/core/claude-ui-mapper.js +598 -0
  100. package/dist/core/claude-ui-mapper.js.map +1 -0
  101. package/dist/core/codex-app-server-runner.d.ts +41 -0
  102. package/dist/core/codex-app-server-runner.js +584 -0
  103. package/dist/core/codex-app-server-runner.js.map +1 -0
  104. package/dist/core/codex-app-server-transport.d.ts +35 -0
  105. package/dist/core/codex-app-server-transport.js +150 -0
  106. package/dist/core/codex-app-server-transport.js.map +1 -0
  107. package/dist/core/codex-model-catalog.d.ts +10 -0
  108. package/dist/core/codex-model-catalog.js +110 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -0
  110. package/dist/core/codex-ui-mapper.d.ts +112 -0
  111. package/dist/core/codex-ui-mapper.js +766 -0
  112. package/dist/core/codex-ui-mapper.js.map +1 -0
  113. package/dist/core/model-identity.d.ts +125 -0
  114. package/dist/core/model-identity.js +132 -0
  115. package/dist/core/model-identity.js.map +1 -0
  116. package/dist/core/model-presets.d.ts +21 -0
  117. package/dist/core/model-presets.js +81 -0
  118. package/dist/core/model-presets.js.map +1 -0
  119. package/dist/core/ndjson.d.ts +6 -0
  120. package/dist/core/ndjson.js +23 -0
  121. package/dist/core/ndjson.js.map +1 -0
  122. package/dist/core/opencode-model-catalog.d.ts +32 -0
  123. package/dist/core/opencode-model-catalog.js +153 -0
  124. package/dist/core/opencode-model-catalog.js.map +1 -0
  125. package/dist/core/opencode-server-runner.d.ts +32 -0
  126. package/dist/core/opencode-server-runner.js +882 -0
  127. package/dist/core/opencode-server-runner.js.map +1 -0
  128. package/dist/core/opencode-ui-mapper.d.ts +137 -0
  129. package/dist/core/opencode-ui-mapper.js +800 -0
  130. package/dist/core/opencode-ui-mapper.js.map +1 -0
  131. package/dist/core/pi-model-catalog.d.ts +31 -0
  132. package/dist/core/pi-model-catalog.js +152 -0
  133. package/dist/core/pi-model-catalog.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +403 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +36 -0
  138. package/dist/core/pi-ui-mapper.js +304 -0
  139. package/dist/core/pi-ui-mapper.js.map +1 -0
  140. package/dist/core/process-usage.d.ts +66 -0
  141. package/dist/core/process-usage.js +193 -0
  142. package/dist/core/process-usage.js.map +1 -0
  143. package/dist/core/provider-auth.d.ts +154 -0
  144. package/dist/core/provider-auth.js +509 -0
  145. package/dist/core/provider-auth.js.map +1 -0
  146. package/dist/core/provider-availability.d.ts +3 -0
  147. package/dist/core/provider-availability.js +14 -0
  148. package/dist/core/provider-availability.js.map +1 -0
  149. package/dist/core/runner-factory.d.ts +8 -0
  150. package/dist/core/runner-factory.js +25 -0
  151. package/dist/core/runner-factory.js.map +1 -0
  152. package/dist/core/runner-model-catalog.d.ts +29 -0
  153. package/dist/core/runner-model-catalog.js +78 -0
  154. package/dist/core/runner-model-catalog.js.map +1 -0
  155. package/dist/core/secret-redaction.d.ts +37 -0
  156. package/dist/core/secret-redaction.js +115 -0
  157. package/dist/core/secret-redaction.js.map +1 -0
  158. package/dist/core/shell-env.d.ts +28 -0
  159. package/dist/core/shell-env.js +56 -0
  160. package/dist/core/shell-env.js.map +1 -0
  161. package/dist/core/tool-display.d.ts +31 -0
  162. package/dist/core/tool-display.js +179 -0
  163. package/dist/core/tool-display.js.map +1 -0
  164. package/dist/core/ui-events.d.ts +335 -0
  165. package/dist/core/ui-events.js +25 -0
  166. package/dist/core/ui-events.js.map +1 -0
  167. package/dist/core/usage-limit.d.ts +42 -0
  168. package/dist/core/usage-limit.js +209 -0
  169. package/dist/core/usage-limit.js.map +1 -0
  170. package/dist/core/usage.d.ts +11 -0
  171. package/dist/core/usage.js +15 -0
  172. package/dist/core/usage.js.map +1 -0
  173. package/dist/core/v1-text-coalescer.d.ts +36 -0
  174. package/dist/core/v1-text-coalescer.js +72 -0
  175. package/dist/core/v1-text-coalescer.js.map +1 -0
  176. package/dist/git-diff-base.d.ts +85 -0
  177. package/dist/git-diff-base.js +180 -0
  178. package/dist/git-diff-base.js.map +1 -0
  179. package/dist/git-refs.d.ts +11 -0
  180. package/dist/git-refs.js +14 -0
  181. package/dist/git-refs.js.map +1 -0
  182. package/dist/git-worktree.d.ts +161 -0
  183. package/dist/git-worktree.js +508 -0
  184. package/dist/git-worktree.js.map +1 -0
  185. package/dist/handoff.d.ts +62 -0
  186. package/dist/handoff.js +154 -0
  187. package/dist/handoff.js.map +1 -0
  188. package/dist/index.d.ts +2 -0
  189. package/dist/index.js +680 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/install-as-command.d.ts +40 -0
  192. package/dist/install-as-command.js +52 -0
  193. package/dist/install-as-command.js.map +1 -0
  194. package/dist/pack-check.d.ts +17 -0
  195. package/dist/pack-check.js +27 -0
  196. package/dist/pack-check.js.map +1 -0
  197. package/dist/paths.d.ts +140 -0
  198. package/dist/paths.js +192 -0
  199. package/dist/paths.js.map +1 -0
  200. package/dist/planner.d.ts +27 -0
  201. package/dist/planner.js +268 -0
  202. package/dist/planner.js.map +1 -0
  203. package/dist/release/manifests.d.ts +81 -0
  204. package/dist/release/manifests.js +74 -0
  205. package/dist/release/manifests.js.map +1 -0
  206. package/dist/release/snapshot.d.ts +67 -0
  207. package/dist/release/snapshot.js +97 -0
  208. package/dist/release/snapshot.js.map +1 -0
  209. package/dist/release/stable.d.ts +38 -0
  210. package/dist/release/stable.js +55 -0
  211. package/dist/release/stable.js.map +1 -0
  212. package/dist/runs/agent-tmpdir.d.ts +41 -0
  213. package/dist/runs/agent-tmpdir.js +183 -0
  214. package/dist/runs/agent-tmpdir.js.map +1 -0
  215. package/dist/runs/auto-name.d.ts +75 -0
  216. package/dist/runs/auto-name.js +179 -0
  217. package/dist/runs/auto-name.js.map +1 -0
  218. package/dist/runs/event-history.d.ts +50 -0
  219. package/dist/runs/event-history.js +613 -0
  220. package/dist/runs/event-history.js.map +1 -0
  221. package/dist/runs/retention.d.ts +60 -0
  222. package/dist/runs/retention.js +86 -0
  223. package/dist/runs/retention.js.map +1 -0
  224. package/dist/runs/review-gate.d.ts +18 -0
  225. package/dist/runs/review-gate.js +21 -0
  226. package/dist/runs/review-gate.js.map +1 -0
  227. package/dist/runs/run-index.d.ts +19 -0
  228. package/dist/runs/run-index.js +43 -0
  229. package/dist/runs/run-index.js.map +1 -0
  230. package/dist/runs/store.d.ts +446 -0
  231. package/dist/runs/store.js +1118 -0
  232. package/dist/runs/store.js.map +1 -0
  233. package/dist/runs/task-markers.d.ts +28 -0
  234. package/dist/runs/task-markers.js +74 -0
  235. package/dist/runs/task-markers.js.map +1 -0
  236. package/dist/runs/task-refs.d.ts +25 -0
  237. package/dist/runs/task-refs.js +74 -0
  238. package/dist/runs/task-refs.js.map +1 -0
  239. package/dist/runs/ui-event-sink.d.ts +81 -0
  240. package/dist/runs/ui-event-sink.js +210 -0
  241. package/dist/runs/ui-event-sink.js.map +1 -0
  242. package/dist/server/app-type.d.ts +21 -0
  243. package/dist/server/app-type.js +2 -0
  244. package/dist/server/app-type.js.map +1 -0
  245. package/dist/server/capabilities.d.ts +70 -0
  246. package/dist/server/capabilities.js +152 -0
  247. package/dist/server/capabilities.js.map +1 -0
  248. package/dist/server/checkout.d.ts +128 -0
  249. package/dist/server/checkout.js +296 -0
  250. package/dist/server/checkout.js.map +1 -0
  251. package/dist/server/forge/github.d.ts +513 -0
  252. package/dist/server/forge/github.js +2364 -0
  253. package/dist/server/forge/github.js.map +1 -0
  254. package/dist/server/forge/index.d.ts +40 -0
  255. package/dist/server/forge/index.js +72 -0
  256. package/dist/server/forge/index.js.map +1 -0
  257. package/dist/server/forge/types.d.ts +242 -0
  258. package/dist/server/forge/types.js +2 -0
  259. package/dist/server/forge/types.js.map +1 -0
  260. package/dist/server/fs-browse.d.ts +105 -0
  261. package/dist/server/fs-browse.js +182 -0
  262. package/dist/server/fs-browse.js.map +1 -0
  263. package/dist/server/git-changes.d.ts +213 -0
  264. package/dist/server/git-changes.js +555 -0
  265. package/dist/server/git-changes.js.map +1 -0
  266. package/dist/server/git.d.ts +28 -0
  267. package/dist/server/git.js +112 -0
  268. package/dist/server/git.js.map +1 -0
  269. package/dist/server/github.d.ts +9 -0
  270. package/dist/server/github.js +8 -0
  271. package/dist/server/github.js.map +1 -0
  272. package/dist/server/launch-key.d.ts +7 -0
  273. package/dist/server/launch-key.js +33 -0
  274. package/dist/server/launch-key.js.map +1 -0
  275. package/dist/server/open-in-app.d.ts +66 -0
  276. package/dist/server/open-in-app.js +211 -0
  277. package/dist/server/open-in-app.js.map +1 -0
  278. package/dist/server/open-in-terminal.d.ts +70 -0
  279. package/dist/server/open-in-terminal.js +179 -0
  280. package/dist/server/open-in-terminal.js.map +1 -0
  281. package/dist/server/pr.d.ts +7 -0
  282. package/dist/server/pr.js +7 -0
  283. package/dist/server/pr.js.map +1 -0
  284. package/dist/server/project-context.d.ts +120 -0
  285. package/dist/server/project-context.js +182 -0
  286. package/dist/server/project-context.js.map +1 -0
  287. package/dist/server/provider-action-gate.d.ts +8 -0
  288. package/dist/server/provider-action-gate.js +56 -0
  289. package/dist/server/provider-action-gate.js.map +1 -0
  290. package/dist/server/provider-auth-runtime.d.ts +21 -0
  291. package/dist/server/provider-auth-runtime.js +66 -0
  292. package/dist/server/provider-auth-runtime.js.map +1 -0
  293. package/dist/server/server.d.ts +13138 -0
  294. package/dist/server/server.js +5263 -0
  295. package/dist/server/server.js.map +1 -0
  296. package/dist/server/static-ui.d.ts +49 -0
  297. package/dist/server/static-ui.js +92 -0
  298. package/dist/server/static-ui.js.map +1 -0
  299. package/dist/server/validators.d.ts +97 -0
  300. package/dist/server/validators.js +86 -0
  301. package/dist/server/validators.js.map +1 -0
  302. package/dist/server/ws.d.ts +85 -0
  303. package/dist/server/ws.js +218 -0
  304. package/dist/server/ws.js.map +1 -0
  305. package/dist/server/wsl.d.ts +25 -0
  306. package/dist/server/wsl.js +92 -0
  307. package/dist/server/wsl.js.map +1 -0
  308. package/dist/server-install/engine.d.ts +50 -0
  309. package/dist/server-install/engine.js +324 -0
  310. package/dist/server-install/engine.js.map +1 -0
  311. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  312. package/dist/server-install/platforms/macosx-ngrok.js +345 -0
  313. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  314. package/dist/server-install/platforms/ubuntu-vps.d.ts +78 -0
  315. package/dist/server-install/platforms/ubuntu-vps.js +1016 -0
  316. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  317. package/dist/server-install/state.d.ts +52 -0
  318. package/dist/server-install/state.js +182 -0
  319. package/dist/server-install/state.js.map +1 -0
  320. package/dist/server-install/steps.d.ts +109 -0
  321. package/dist/server-install/steps.js +334 -0
  322. package/dist/server-install/steps.js.map +1 -0
  323. package/dist/server-install/strategies.d.ts +4 -0
  324. package/dist/server-install/strategies.js +20 -0
  325. package/dist/server-install/strategies.js.map +1 -0
  326. package/dist/server-install/types.d.ts +287 -0
  327. package/dist/server-install/types.js +121 -0
  328. package/dist/server-install/types.js.map +1 -0
  329. package/dist/server-install/ui.d.ts +42 -0
  330. package/dist/server-install/ui.js +130 -0
  331. package/dist/server-install/ui.js.map +1 -0
  332. package/dist/skills-banner.d.ts +22 -0
  333. package/dist/skills-banner.js +41 -0
  334. package/dist/skills-banner.js.map +1 -0
  335. package/dist/skills-remote.d.ts +84 -0
  336. package/dist/skills-remote.js +468 -0
  337. package/dist/skills-remote.js.map +1 -0
  338. package/dist/skills-update.d.ts +88 -0
  339. package/dist/skills-update.js +392 -0
  340. package/dist/skills-update.js.map +1 -0
  341. package/dist/skills.d.ts +82 -0
  342. package/dist/skills.js +251 -0
  343. package/dist/skills.js.map +1 -0
  344. package/dist/todos.d.ts +48 -0
  345. package/dist/todos.js +201 -0
  346. package/dist/todos.js.map +1 -0
  347. package/dist/ui-state.d.ts +26 -0
  348. package/dist/ui-state.js +38 -0
  349. package/dist/ui-state.js.map +1 -0
  350. package/dist/update-check.d.ts +12 -0
  351. package/dist/update-check.js +41 -0
  352. package/dist/update-check.js.map +1 -0
  353. package/dist/workflows/load.d.ts +15 -0
  354. package/dist/workflows/load.js +56 -0
  355. package/dist/workflows/load.js.map +1 -0
  356. package/dist/workflows/run.d.ts +758 -0
  357. package/dist/workflows/run.js +3389 -0
  358. package/dist/workflows/run.js.map +1 -0
  359. package/dist/workflows/types.d.ts +153 -0
  360. package/dist/workflows/types.js +212 -0
  361. package/dist/workflows/types.js.map +1 -0
  362. package/dist/workspace/agent-accounts.d.ts +153 -0
  363. package/dist/workspace/agent-accounts.js +304 -0
  364. package/dist/workspace/agent-accounts.js.map +1 -0
  365. package/dist/workspace/agent-profiles.d.ts +78 -0
  366. package/dist/workspace/agent-profiles.js +115 -0
  367. package/dist/workspace/agent-profiles.js.map +1 -0
  368. package/dist/workspace/config.d.ts +169 -0
  369. package/dist/workspace/config.js +379 -0
  370. package/dist/workspace/config.js.map +1 -0
  371. package/dist/workspace/migrations.d.ts +45 -0
  372. package/dist/workspace/migrations.js +147 -0
  373. package/dist/workspace/migrations.js.map +1 -0
  374. package/dist/workspace/projects-cli.d.ts +25 -0
  375. package/dist/workspace/projects-cli.js +172 -0
  376. package/dist/workspace/projects-cli.js.map +1 -0
  377. package/dist/workspace/projects.d.ts +109 -0
  378. package/dist/workspace/projects.js +250 -0
  379. package/dist/workspace/projects.js.map +1 -0
  380. package/dist/workspace/semaphore.d.ts +179 -0
  381. package/dist/workspace/semaphore.js +195 -0
  382. package/dist/workspace/semaphore.js.map +1 -0
  383. package/dist/workspace/ui-state.d.ts +34 -0
  384. package/dist/workspace/ui-state.js +53 -0
  385. package/dist/workspace/ui-state.js.map +1 -0
  386. package/package.json +70 -0
  387. package/scripts/check-pack.mjs +46 -0
  388. package/scripts/inline-contract.mjs +112 -0
  389. package/scripts/install-as-command.mjs +120 -0
  390. package/scripts/mock-claude.mjs +520 -0
  391. package/scripts/mock-pi-rpc.mjs +83 -0
  392. package/scripts/sync-readme.mjs +20 -0
  393. package/scripts/test-process-usage.mjs +47 -0
  394. package/web/dist/assets/alert-dialog-B4Ofsgv7.js +1 -0
  395. package/web/dist/assets/arrow-down-Dy8dup7j.js +1 -0
  396. package/web/dist/assets/arrow-left-BJaucbhn.js +1 -0
  397. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  398. package/web/dist/assets/centered-state-duPW0phQ.js +43 -0
  399. package/web/dist/assets/chevron-right-Be4A5TCS.js +1 -0
  400. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  401. package/web/dist/assets/collapsible-DdcNBdSk.js +1 -0
  402. package/web/dist/assets/commit-list-CgvN9vec.js +1 -0
  403. package/web/dist/assets/compare-variants-CQA2nd65.js +1 -0
  404. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  405. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  406. package/web/dist/assets/diff-B6Agp5Hl.js +3 -0
  407. package/web/dist/assets/diff-stat-BoXuGkgq.js +1 -0
  408. package/web/dist/assets/diff-view-CD8XI-fj.js +6 -0
  409. package/web/dist/assets/diff-woXpYk--.js +1 -0
  410. package/web/dist/assets/dropdown-menu-B3SYw-k5.js +1 -0
  411. package/web/dist/assets/editable-title-B-hjp5wl.js +1 -0
  412. package/web/dist/assets/ellipsis-vertical-BYwzw0xl.js +1 -0
  413. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  414. package/web/dist/assets/file-BRj5eISx.js +1 -0
  415. package/web/dist/assets/folder-z4oT5981.js +1 -0
  416. package/web/dist/assets/git-toolbar-owSEkYld.js +1 -0
  417. package/web/dist/assets/github-Bz2VgRX3.js +1 -0
  418. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  419. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  420. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  421. package/web/dist/assets/html-BY76lXLH.js +1 -0
  422. package/web/dist/assets/image-preview-h3WFluuy.js +1 -0
  423. package/web/dist/assets/index-BbcQNT92.css +2 -0
  424. package/web/dist/assets/index-EtQQQ6Kj.js +7 -0
  425. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  426. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  427. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  428. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  429. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  430. package/web/dist/assets/json-qhed-kSA.js +1 -0
  431. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  432. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  433. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  434. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  435. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  436. package/web/dist/assets/markdown-DqBKYPiB.js +2 -0
  437. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  438. package/web/dist/assets/new-task-form-BdJKRBJX.js +1 -0
  439. package/web/dist/assets/pill-BQfmfpYp.js +1 -0
  440. package/web/dist/assets/project-router-DxgFZY1l.js +1 -0
  441. package/web/dist/assets/prompt-templates-B6m16gq-.js +15 -0
  442. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  443. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  444. package/web/dist/assets/refresh-cw-mhSpxf2a.js +1 -0
  445. package/web/dist/assets/repo-git-CUNRxR3_.js +1 -0
  446. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  447. package/web/dist/assets/run-diff-DsmmDVfx.js +3 -0
  448. package/web/dist/assets/run-header-BkhrseLJ.js +1 -0
  449. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  450. package/web/dist/assets/search-x-BqDMB2g8.js +1 -0
  451. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  452. package/web/dist/assets/skill-empty-hint-BWEvTggc.js +1 -0
  453. package/web/dist/assets/skills-9oR_oHse.js +1 -0
  454. package/web/dist/assets/skills-DwIxnnWO.js +1 -0
  455. package/web/dist/assets/sparkles-DIoTQpyx.js +1 -0
  456. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  457. package/web/dist/assets/square-terminal-Cc7CuQxc.js +1 -0
  458. package/web/dist/assets/tab-link-D1fQgpmO.js +1 -0
  459. package/web/dist/assets/task-changes-BKeLlDpK.js +1 -0
  460. package/web/dist/assets/task-commits-gcEFZIa5.js +1 -0
  461. package/web/dist/assets/task-files-BGAqoXTW.js +2 -0
  462. package/web/dist/assets/task-thread-DT8aUYTS.js +9 -0
  463. package/web/dist/assets/textarea-BOVbfy5C.js +1 -0
  464. package/web/dist/assets/thread-loading-CypW73KD.js +1 -0
  465. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  466. package/web/dist/assets/trash-2-CJq6LHWn.js +1 -0
  467. package/web/dist/assets/triangle-alert-CjDFvU27.js +1 -0
  468. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  469. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  470. package/web/dist/assets/upload-CPDZlJeK.js +1 -0
  471. package/web/dist/assets/use-desktop-5JsLmi0a.js +1 -0
  472. package/web/dist/assets/use-submit-shortcut-CHVFevty.js +1 -0
  473. package/web/dist/assets/utils-DiO6zyJd.js +64 -0
  474. package/web/dist/assets/workflows-rQDFzWRt.js +11 -0
  475. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  476. package/web/dist/assets/zoomable-image-COWqb11v.js +1 -0
  477. package/web/dist/index.html +80 -0
  478. package/web/dist/open-mercato.svg +11 -0
@@ -0,0 +1,446 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { z } from 'zod';
3
+ import type { RunnerId } from '../core/agent-runner.ts';
4
+ export type RunStatus = 'queued' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled';
5
+ /**
6
+ * A sub-state of `running` (spec 2026-07-18-subagent-monitoring-status, #490):
7
+ * the agent ended its turn still working on its own downstream work (a sub-agent
8
+ * or a monitored command) and declared it with the `CEZ:MONITORING` marker — so
9
+ * the cockpit shows a non-attention "monitoring" label instead of "needs you".
10
+ * Only ever set while `status === 'running'`; cleared on resume/terminal.
11
+ */
12
+ export type RunActivity = 'monitoring';
13
+ export type StepStatus = 'pending' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled' | 'skipped';
14
+ declare const stepStateSchema: z.ZodObject<{
15
+ id: z.ZodString;
16
+ name: z.ZodString;
17
+ kind: z.ZodEnum<{
18
+ agent: "agent";
19
+ check: "check";
20
+ }>;
21
+ status: z.ZodEnum<{
22
+ cancelled: "cancelled";
23
+ done: "done";
24
+ failed: "failed";
25
+ pending: "pending";
26
+ review: "review";
27
+ running: "running";
28
+ skipped: "skipped";
29
+ waiting: "waiting";
30
+ }>;
31
+ iterations: z.ZodNumber;
32
+ tokensUsed: z.ZodNumber;
33
+ inputTokens: z.ZodOptional<z.ZodNumber>;
34
+ outputTokens: z.ZodOptional<z.ZodNumber>;
35
+ usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
36
+ usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
37
+ usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
38
+ usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
39
+ usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
40
+ startedAt: z.ZodOptional<z.ZodString>;
41
+ finishedAt: z.ZodOptional<z.ZodString>;
42
+ error: z.ZodOptional<z.ZodString>;
43
+ sessionId: z.ZodOptional<z.ZodString>;
44
+ backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
45
+ claude: "claude";
46
+ "claude-cli": "claude-cli";
47
+ codex: "codex";
48
+ opencode: "opencode";
49
+ pi: "pi";
50
+ }>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
51
+ profileId: z.ZodOptional<z.ZodString>;
52
+ costUsd: z.ZodOptional<z.ZodNumber>;
53
+ }, z.core.$strip>;
54
+ /** One prompt message stacked onto a run while it waits for a free agent slot
55
+ * (#472). Folded into `{{task}}` at dequeue by `hydrateQueuedInput`; never
56
+ * delivered as its own turn — a follow-up turn would reach only the first step
57
+ * of a chain and would race the opening turn. */
58
+ declare const queuedMessageSchema: z.ZodObject<{
59
+ id: z.ZodString;
60
+ text: z.ZodString;
61
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ createdAt: z.ZodString;
63
+ }, z.core.$strip>;
64
+ /** Exported for `./run-index.ts`, the read-only reader of the same file. Nothing else should
65
+ * parse `runs.json` — see `reconcileLoadedRun` for why a second parser is a correctness risk. */
66
+ export declare const runRecordSchema: z.ZodObject<{
67
+ id: z.ZodString;
68
+ title: z.ZodString;
69
+ titleSummary: z.ZodOptional<z.ZodString>;
70
+ diffStat: z.ZodOptional<z.ZodObject<{
71
+ adds: z.ZodNumber;
72
+ dels: z.ZodNumber;
73
+ files: z.ZodNumber;
74
+ repointed: z.ZodOptional<z.ZodBoolean>;
75
+ }, z.core.$strip>>;
76
+ workflow: z.ZodString;
77
+ task: z.ZodString;
78
+ queuedMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
79
+ id: z.ZodString;
80
+ text: z.ZodString;
81
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ createdAt: z.ZodString;
83
+ }, z.core.$strip>>>;
84
+ taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ model: z.ZodOptional<z.ZodString>;
86
+ modelIdentity: z.ZodOptional<z.ZodString>;
87
+ runner: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
88
+ claude: "claude";
89
+ "claude-cli": "claude-cli";
90
+ codex: "codex";
91
+ opencode: "opencode";
92
+ pi: "pi";
93
+ }>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
94
+ agentProfile: z.ZodOptional<z.ZodString>;
95
+ systemPrompt: z.ZodOptional<z.ZodString>;
96
+ generateFollowups: z.ZodOptional<z.ZodBoolean>;
97
+ autonomous: z.ZodOptional<z.ZodBoolean>;
98
+ automation: z.ZodOptional<z.ZodObject<{
99
+ automationId: z.ZodString;
100
+ automationRevision: z.ZodNumber;
101
+ receiptId: z.ZodString;
102
+ event: z.ZodString;
103
+ githubUrl: z.ZodString;
104
+ }, z.core.$strip>>;
105
+ status: z.ZodEnum<{
106
+ cancelled: "cancelled";
107
+ done: "done";
108
+ failed: "failed";
109
+ queued: "queued";
110
+ review: "review";
111
+ running: "running";
112
+ waiting: "waiting";
113
+ }>;
114
+ activity: z.ZodOptional<z.ZodEnum<{
115
+ monitoring: "monitoring";
116
+ }>>;
117
+ monitoringWakeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
118
+ monitoringWakeCapReached: z.ZodOptional<z.ZodBoolean>;
119
+ autoResumeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
120
+ autoResumeAttempts: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
121
+ createdAt: z.ZodString;
122
+ startedAt: z.ZodOptional<z.ZodString>;
123
+ finishedAt: z.ZodOptional<z.ZodString>;
124
+ tokensUsed: z.ZodNumber;
125
+ inputTokens: z.ZodOptional<z.ZodNumber>;
126
+ outputTokens: z.ZodOptional<z.ZodNumber>;
127
+ costUsd: z.ZodOptional<z.ZodNumber>;
128
+ pullRequestUrl: z.ZodOptional<z.ZodString>;
129
+ referencedPullRequestUrl: z.ZodOptional<z.ZodString>;
130
+ prNumber: z.ZodOptional<z.ZodNumber>;
131
+ issueNumber: z.ZodOptional<z.ZodNumber>;
132
+ referencedIssueNumberSeeded: z.ZodOptional<z.ZodBoolean>;
133
+ titleOrigin: z.ZodOptional<z.ZodEnum<{
134
+ auto: "auto";
135
+ marker: "marker";
136
+ user: "user";
137
+ }>>;
138
+ markerRefs: z.ZodOptional<z.ZodObject<{
139
+ pr: z.ZodOptional<z.ZodNumber>;
140
+ issue: z.ZodOptional<z.ZodNumber>;
141
+ }, z.core.$strip>>;
142
+ referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
+ referencedIssueUrl: z.ZodOptional<z.ZodString>;
144
+ referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ worktree: z.ZodOptional<z.ZodLiteral<false>>;
146
+ worktreePath: z.ZodOptional<z.ZodString>;
147
+ branch: z.ZodOptional<z.ZodString>;
148
+ baseBranch: z.ZodOptional<z.ZodString>;
149
+ worktreeReclaimedAt: z.ZodOptional<z.ZodString>;
150
+ groupId: z.ZodOptional<z.ZodString>;
151
+ variant: z.ZodOptional<z.ZodString>;
152
+ peakRssBytes: z.ZodOptional<z.ZodNumber>;
153
+ peakProcCount: z.ZodOptional<z.ZodNumber>;
154
+ archived: z.ZodDefault<z.ZodBoolean>;
155
+ archivedAt: z.ZodOptional<z.ZodString>;
156
+ seenAt: z.ZodOptional<z.ZodString>;
157
+ currentStepId: z.ZodOptional<z.ZodString>;
158
+ error: z.ZodOptional<z.ZodString>;
159
+ steps: z.ZodArray<z.ZodObject<{
160
+ id: z.ZodString;
161
+ name: z.ZodString;
162
+ kind: z.ZodEnum<{
163
+ agent: "agent";
164
+ check: "check";
165
+ }>;
166
+ status: z.ZodEnum<{
167
+ cancelled: "cancelled";
168
+ done: "done";
169
+ failed: "failed";
170
+ pending: "pending";
171
+ review: "review";
172
+ running: "running";
173
+ skipped: "skipped";
174
+ waiting: "waiting";
175
+ }>;
176
+ iterations: z.ZodNumber;
177
+ tokensUsed: z.ZodNumber;
178
+ inputTokens: z.ZodOptional<z.ZodNumber>;
179
+ outputTokens: z.ZodOptional<z.ZodNumber>;
180
+ usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
181
+ usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
182
+ usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
183
+ usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
184
+ usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
185
+ startedAt: z.ZodOptional<z.ZodString>;
186
+ finishedAt: z.ZodOptional<z.ZodString>;
187
+ error: z.ZodOptional<z.ZodString>;
188
+ sessionId: z.ZodOptional<z.ZodString>;
189
+ backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
190
+ claude: "claude";
191
+ "claude-cli": "claude-cli";
192
+ codex: "codex";
193
+ opencode: "opencode";
194
+ pi: "pi";
195
+ }>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
196
+ profileId: z.ZodOptional<z.ZodString>;
197
+ costUsd: z.ZodOptional<z.ZodNumber>;
198
+ }, z.core.$strip>>;
199
+ workflowDef: z.ZodCatch<z.ZodOptional<z.ZodObject<{
200
+ name: z.ZodString;
201
+ description: z.ZodOptional<z.ZodString>;
202
+ steps: z.ZodArray<z.ZodObject<{
203
+ id: z.ZodString;
204
+ name: z.ZodOptional<z.ZodString>;
205
+ prompt: z.ZodOptional<z.ZodString>;
206
+ skill: z.ZodOptional<z.ZodString>;
207
+ model: z.ZodOptional<z.ZodString>;
208
+ runner: z.ZodOptional<z.ZodEnum<{
209
+ claude: "claude";
210
+ codex: "codex";
211
+ opencode: "opencode";
212
+ pi: "pi";
213
+ }>>;
214
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
216
+ command: z.ZodOptional<z.ZodString>;
217
+ onFail: z.ZodOptional<z.ZodObject<{
218
+ retry: z.ZodString;
219
+ max: z.ZodDefault<z.ZodNumber>;
220
+ }, z.core.$strip>>;
221
+ }, z.core.$strip>>;
222
+ source: z.ZodEnum<{
223
+ "built-in": "built-in";
224
+ file: "file";
225
+ }>;
226
+ path: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strip>>>;
228
+ }, z.core.$strip>;
229
+ export type StepState = z.infer<typeof stepStateSchema>;
230
+ export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
231
+ export type RunRecord = z.infer<typeof runRecordSchema>;
232
+ /** One persisted event line; `type` mirrors AgentEvent plus engine lifecycle. */
233
+ export interface RunEvent {
234
+ seq: number;
235
+ ts: string;
236
+ stepId?: string;
237
+ type: string;
238
+ [key: string]: unknown;
239
+ }
240
+ /**
241
+ * Reconcile one record just read off disk with the fact that whichever process wrote it is gone.
242
+ *
243
+ * Mutates and returns `run`. Extracted from `RunStore.open` so the read-only index reader
244
+ * (`./run-index.ts`) answers the SAME question about a `running` row on disk. Two parsers that
245
+ * disagree here is a visible bug, not an internal one: the cockpit would show a task as running
246
+ * in the ⌘K index and failed the moment you opened it.
247
+ *
248
+ * `keepLive` (#367): leave `queued`/`running`/`waiting` untouched so the caller can recover them
249
+ * (RunManager.recover re-queues queued runs, resumes interrupted ones). Without it — one-shot CLI
250
+ * paths that never recover, and the index reader, which has no manager at all — live-looking runs
251
+ * are marked failed so no ghost stays behind.
252
+ */
253
+ export declare function reconcileLoadedRun(run: RunRecord, opts?: {
254
+ keepLive?: boolean;
255
+ }): RunRecord;
256
+ /**
257
+ * File-backed run store: `runs.json` index (atomic tmp+rename writes, the
258
+ * pattern from @cezar/core's IssueStore) plus one append-only NDJSON event
259
+ * file per run. Also the in-process event bus the SSE endpoints subscribe to:
260
+ * emits `('run', RunRecord)` and `('event', { runId, event: RunEvent })`.
261
+ */
262
+ export declare class RunStore extends EventEmitter {
263
+ private readonly dataDir;
264
+ private runs;
265
+ private saveTimer;
266
+ private constructor();
267
+ /** See `reconcileLoadedRun` for what `keepLive` (#367) decides about live-looking rows. */
268
+ static open(dataDir: string, opts?: {
269
+ keepLive?: boolean;
270
+ }): RunStore;
271
+ listRuns(): RunRecord[];
272
+ getRun(id: string): RunRecord | undefined;
273
+ createRun(input: {
274
+ title: string;
275
+ workflow: string;
276
+ task: string;
277
+ model?: string;
278
+ runner?: RunnerId;
279
+ /** Composer's per-task agent account (spec 2026-07-29-agent-profiles). */
280
+ agentProfile?: string;
281
+ generateFollowups?: boolean;
282
+ autonomous?: boolean;
283
+ worktree?: false;
284
+ groupId?: string;
285
+ variant?: string;
286
+ steps: Array<Pick<StepState, 'id' | 'name' | 'kind'>>;
287
+ }): RunRecord;
288
+ updateRun(id: string, patch: Partial<Omit<RunRecord, 'id' | 'steps'>>): RunRecord | undefined;
289
+ /**
290
+ * Scrub the free-text fields of a record patch (#427 review). Redacting only
291
+ * events left a hole: `titleSummary` is derived from the RAW first agent turn
292
+ * and `error` from raw process output, so a token the agent echoed was
293
+ * `[REDACTED]` in the NDJSON yet verbatim in `runs.json` — the file the "no
294
+ * secrets in state files" rule names explicitly. These three are the only
295
+ * patch fields carrying agent/process text; the rest are ids, enums, counters
296
+ * and URLs, and running the scrubber over them would only risk mangling them.
297
+ *
298
+ * `StepState.error` is the step-level counterpart and is scrubbed the same
299
+ * way in `updateStep` — `run.ts` feeds the SAME `err.message` string to both
300
+ * calls, so redacting only the run-level copy left the token verbatim one
301
+ * field away (#456 review).
302
+ */
303
+ private redactPatch;
304
+ /**
305
+ * Step-level counterpart of `redactPatch` (#456 review). `error` is the only
306
+ * free-text `StepState` field — it is set from raw `err.message` /process
307
+ * output (`run.ts` `finishStep`), and `touch()` fans the whole record out
308
+ * over SSE, so an unscrubbed copy leaked to `runs.json` AND to the browser.
309
+ * The remaining fields are ids, enums, counters and timestamps.
310
+ */
311
+ private redactStepPatch;
312
+ /** Append a step to an existing run (used by "Continue" — spec 003). */
313
+ addStep(runId: string, step: Pick<StepState, 'id' | 'name' | 'kind'>): void;
314
+ updateStep(runId: string, stepId: string, patch: Partial<Omit<StepState, 'id'>>): void;
315
+ setArchived(id: string, archived: boolean): RunRecord | undefined;
316
+ /** Bulk-archive every finished run; returns how many were archived. */
317
+ archiveFinished(): number;
318
+ /** Mark one run as read (#unread-done-items): stamp the read receipt now. Mirrors
319
+ * `setArchived` — sets the field then persists + broadcasts via `touch`, so the
320
+ * updated record rides the existing `run` SSE with no new event. Idempotent by
321
+ * design: opening an already-read thread just re-stamps a later `seenAt`. */
322
+ setRead(id: string): RunRecord | undefined;
323
+ /** Mark one run as UNread (#775): drop the read receipt so the run rejoins the unread
324
+ * list. The inverse of `setRead` and, like it, `touch`es so the updated record rides the
325
+ * existing `run` SSE.
326
+ *
327
+ * Deleting the field rather than adding a "manually unread" flag is the whole point:
328
+ * absent `seenAt` is ALREADY what every reader treats as unread (`isUnread` in the
329
+ * cockpit's read-state.ts, and `markAllRead`'s clause-for-clause copy of it below), so
330
+ * clearing needs no new state and writes a shape any older cezar already parses.
331
+ *
332
+ * Deliberately unconditional: clearing a receipt is always a legal write, so this
333
+ * succeeds for an already-unread run (idempotent) and for statuses that can never wear
334
+ * the marker. WHETHER the action means anything for a given run is UI policy, and lives
335
+ * in the cockpit's `runActionFlags` — the same split the rest of the store keeps. */
336
+ setUnread(id: string): RunRecord | undefined;
337
+ /** Bulk mark-read: stamp every currently-unread finished run; returns the count.
338
+ * "Unread" here is the same rule the cockpit paints (`isUnread` in read-state.ts),
339
+ * clause for clause:
340
+ * - a `done` or `failed` run that finished and has not been seen since;
341
+ * - cancelled runs are never unread — you stopped them yourself;
342
+ * - archived ones never are either, since archiving is a stronger "done with this"
343
+ * than reading;
344
+ * - and a `failed` run with a pending `autoResumeAt` is not a done item AT ALL
345
+ * (`isScheduledResume`, spec 2026-08-03-auto-resume-after-usage-limit): it has an
346
+ * appointment to pick the work back up, so there is no outcome to have missed.
347
+ *
348
+ * Keeping the two rules identical is what makes the returned count the number the
349
+ * cockpit's unread badge was showing. The `autoResumeAt` clause is the one that drifted
350
+ * (#803): `isUnread` gained it with auto-resume and this sweep did not, so a task waiting
351
+ * out a usage limit was uncounted by the badge but stamped read by the sweep — and this
352
+ * comment asserted an invariant the code no longer held.
353
+ *
354
+ * This rule lives in two languages of the same repo, which is why it has now drifted
355
+ * once. The cockpit cannot import it (`packages/web` does not depend on the service, and
356
+ * should not), so a single definition would have to move to `packages/contract` — the one
357
+ * package both sides already import. Worth doing; deliberately not done here, because
358
+ * widening the contract package's remit from "shapes" to "behavior" is a design change
359
+ * that deserves its own review rather than riding along in a bug fix. Until then: EDIT
360
+ * BOTH, and the case-table tests on either side are what catch you if you don't. */
361
+ markAllRead(): number;
362
+ appendEvent(runId: string, event: {
363
+ type: string;
364
+ stepId?: string;
365
+ [key: string]: unknown;
366
+ }): RunEvent;
367
+ /**
368
+ * Fold every PR URL in `haystack` into the run's referenced-tier working
369
+ * set and re-resolve `referencedPullRequestUrl` (spec
370
+ * 2026-07-16-pr-autodiscovery). Mutates the record in place — the caller
371
+ * owns persistence/fan-out — and reports whether anything changed.
372
+ */
373
+ private trackReferencedPrs;
374
+ /**
375
+ * The issue-side mirror of `trackReferencedPrs` (spec
376
+ * 2026-07-21-report-ref-discovery): fold every issue URL in `haystack` into
377
+ * the working set and re-resolve `referencedIssueUrl`. An unambiguous
378
+ * resolution also seeds `issueNumber` when nothing owns that field yet —
379
+ * marker and namer both outrank this janitor and overwrite it freely.
380
+ */
381
+ private trackReferencedIssues;
382
+ /**
383
+ * Apply agent-declared reference markers (spec 2026-07-18-task-ref-markers).
384
+ * Marker values are authoritative for the display tier: they overwrite the
385
+ * regex/namer numbers, and a declared PR re-resolves the referenced URL
386
+ * against the candidate working set — including down to `undefined` when no
387
+ * candidate matches (a wrong chip is worse than no chip). The created tier
388
+ * (`pullRequestUrl`) is deliberately untouched.
389
+ *
390
+ * One declaration is NOT a statement about the referenced tier: the number of the PR this run
391
+ * itself created. See `referencedPrDeclaration` — the marker contract asks the agent to
392
+ * re-declare after it opens a PR, and taking that literally cost the task the PR it was about.
393
+ */
394
+ applyMarkerRefs(runId: string, refs: {
395
+ pr?: number;
396
+ issue?: number;
397
+ }): RunRecord | undefined;
398
+ /**
399
+ * Fan an event out to live subscribers WITHOUT writing it to the NDJSON
400
+ * file — the channel for coalesced `item.delta` flushes (protocol-v2
401
+ * performance guardrail: raw deltas never hit disk; replay = the persisted
402
+ * snapshots). Stamped with `seq`/`ts` like persisted lines so the live
403
+ * wire keeps one ordering axis; the seq simply never appears in a replay
404
+ * (gaps are fine — dedup compares with `>`).
405
+ */
406
+ emitEphemeral(runId: string, event: {
407
+ type: string;
408
+ stepId?: string;
409
+ [key: string]: unknown;
410
+ }): RunEvent;
411
+ /** Lazily-collected concrete secret values from the host env (#427). */
412
+ private secretValues;
413
+ /**
414
+ * Scrub known credential values / token shapes from an event before it is
415
+ * persisted or fanned out. On by default; `CEZ_REDACT_SECRETS=0` opts out.
416
+ */
417
+ private redact;
418
+ /** Best-effort scrub of one free-text string bound for `runs.json`. Honors
419
+ * the `CEZ_REDACT_SECRETS=0` opt-out itself so every caller inherits it. */
420
+ private redactText;
421
+ private hostSecrets;
422
+ readEvents(runId: string): RunEvent[];
423
+ deleteRun(id: string): boolean;
424
+ /** Write the index out now (used on shutdown). */
425
+ flush(): void;
426
+ private seqs;
427
+ private nextSeq;
428
+ /** After a restart the in-memory counter is empty while the run's NDJSON file
429
+ * keeps the history. Restarting from 1 would collide with the seqs a client
430
+ * already replayed — its `seq > maxSeq` dedup then silently drops every
431
+ * resumed event, even across a reload (the frozen-transcript symptom class
432
+ * of #424). One file read on the first post-restart append per run. */
433
+ private rehydrateSeq;
434
+ private eventsPath;
435
+ /** Same location `handoffPath()` in handoff.ts produces — inlined to keep
436
+ * the store free of upward imports. */
437
+ private handoffPath;
438
+ /** Agent screenshots persisted by the run manager (see persistImage). */
439
+ private imagesDir;
440
+ private touch;
441
+ private pruneOldRuns;
442
+ /** Debounced so token-usage updates don't rewrite the index per event. */
443
+ private scheduleSave;
444
+ private saveNow;
445
+ }
446
+ export {};