@qodeca/xezar 0.10.1

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 (481) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +810 -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 +71 -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 +597 -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 +1953 -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 +1527 -0
  74. package/dist/contract/skills.d.ts +234 -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 +115 -0
  90. package/dist/core/ask.js +256 -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 +65 -0
  96. package/dist/core/claude-cli-runner.js +479 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-model-catalog.d.ts +24 -0
  99. package/dist/core/claude-model-catalog.js +208 -0
  100. package/dist/core/claude-model-catalog.js.map +1 -0
  101. package/dist/core/claude-ui-mapper.d.ts +79 -0
  102. package/dist/core/claude-ui-mapper.js +597 -0
  103. package/dist/core/claude-ui-mapper.js.map +1 -0
  104. package/dist/core/codex-app-server-runner.d.ts +41 -0
  105. package/dist/core/codex-app-server-runner.js +584 -0
  106. package/dist/core/codex-app-server-runner.js.map +1 -0
  107. package/dist/core/codex-app-server-transport.d.ts +35 -0
  108. package/dist/core/codex-app-server-transport.js +150 -0
  109. package/dist/core/codex-app-server-transport.js.map +1 -0
  110. package/dist/core/codex-model-catalog.d.ts +10 -0
  111. package/dist/core/codex-model-catalog.js +110 -0
  112. package/dist/core/codex-model-catalog.js.map +1 -0
  113. package/dist/core/codex-ui-mapper.d.ts +109 -0
  114. package/dist/core/codex-ui-mapper.js +764 -0
  115. package/dist/core/codex-ui-mapper.js.map +1 -0
  116. package/dist/core/model-identity.d.ts +125 -0
  117. package/dist/core/model-identity.js +132 -0
  118. package/dist/core/model-identity.js.map +1 -0
  119. package/dist/core/model-presets.d.ts +21 -0
  120. package/dist/core/model-presets.js +91 -0
  121. package/dist/core/model-presets.js.map +1 -0
  122. package/dist/core/ndjson.d.ts +6 -0
  123. package/dist/core/ndjson.js +23 -0
  124. package/dist/core/ndjson.js.map +1 -0
  125. package/dist/core/opencode-model-catalog.d.ts +32 -0
  126. package/dist/core/opencode-model-catalog.js +153 -0
  127. package/dist/core/opencode-model-catalog.js.map +1 -0
  128. package/dist/core/opencode-server-runner.d.ts +32 -0
  129. package/dist/core/opencode-server-runner.js +535 -0
  130. package/dist/core/opencode-server-runner.js.map +1 -0
  131. package/dist/core/opencode-ui-mapper.d.ts +111 -0
  132. package/dist/core/opencode-ui-mapper.js +668 -0
  133. package/dist/core/opencode-ui-mapper.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +349 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +34 -0
  138. package/dist/core/pi-ui-mapper.js +270 -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 +28 -0
  153. package/dist/core/runner-model-catalog.js +62 -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 +332 -0
  165. package/dist/core/ui-events.js +22 -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 +684 -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 +78 -0
  204. package/dist/release/manifests.js +57 -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 +33 -0
  210. package/dist/release/stable.js +50 -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/arm-repo-handle.d.ts +17 -0
  216. package/dist/runs/arm-repo-handle.js +24 -0
  217. package/dist/runs/arm-repo-handle.js.map +1 -0
  218. package/dist/runs/auto-name.d.ts +75 -0
  219. package/dist/runs/auto-name.js +179 -0
  220. package/dist/runs/auto-name.js.map +1 -0
  221. package/dist/runs/event-history.d.ts +50 -0
  222. package/dist/runs/event-history.js +613 -0
  223. package/dist/runs/event-history.js.map +1 -0
  224. package/dist/runs/retention.d.ts +60 -0
  225. package/dist/runs/retention.js +86 -0
  226. package/dist/runs/retention.js.map +1 -0
  227. package/dist/runs/review-gate.d.ts +18 -0
  228. package/dist/runs/review-gate.js +21 -0
  229. package/dist/runs/review-gate.js.map +1 -0
  230. package/dist/runs/run-index.d.ts +19 -0
  231. package/dist/runs/run-index.js +43 -0
  232. package/dist/runs/run-index.js.map +1 -0
  233. package/dist/runs/store.d.ts +490 -0
  234. package/dist/runs/store.js +1283 -0
  235. package/dist/runs/store.js.map +1 -0
  236. package/dist/runs/task-markers.d.ts +28 -0
  237. package/dist/runs/task-markers.js +74 -0
  238. package/dist/runs/task-markers.js.map +1 -0
  239. package/dist/runs/task-refs.d.ts +25 -0
  240. package/dist/runs/task-refs.js +74 -0
  241. package/dist/runs/task-refs.js.map +1 -0
  242. package/dist/runs/ui-event-sink.d.ts +80 -0
  243. package/dist/runs/ui-event-sink.js +209 -0
  244. package/dist/runs/ui-event-sink.js.map +1 -0
  245. package/dist/server/app-type.d.ts +21 -0
  246. package/dist/server/app-type.js +2 -0
  247. package/dist/server/app-type.js.map +1 -0
  248. package/dist/server/capabilities.d.ts +70 -0
  249. package/dist/server/capabilities.js +152 -0
  250. package/dist/server/capabilities.js.map +1 -0
  251. package/dist/server/checkout.d.ts +128 -0
  252. package/dist/server/checkout.js +296 -0
  253. package/dist/server/checkout.js.map +1 -0
  254. package/dist/server/forge/github.d.ts +535 -0
  255. package/dist/server/forge/github.js +2544 -0
  256. package/dist/server/forge/github.js.map +1 -0
  257. package/dist/server/forge/index.d.ts +40 -0
  258. package/dist/server/forge/index.js +72 -0
  259. package/dist/server/forge/index.js.map +1 -0
  260. package/dist/server/forge/types.d.ts +267 -0
  261. package/dist/server/forge/types.js +2 -0
  262. package/dist/server/forge/types.js.map +1 -0
  263. package/dist/server/fs-browse.d.ts +105 -0
  264. package/dist/server/fs-browse.js +182 -0
  265. package/dist/server/fs-browse.js.map +1 -0
  266. package/dist/server/git-changes.d.ts +213 -0
  267. package/dist/server/git-changes.js +555 -0
  268. package/dist/server/git-changes.js.map +1 -0
  269. package/dist/server/git.d.ts +28 -0
  270. package/dist/server/git.js +112 -0
  271. package/dist/server/git.js.map +1 -0
  272. package/dist/server/github.d.ts +9 -0
  273. package/dist/server/github.js +8 -0
  274. package/dist/server/github.js.map +1 -0
  275. package/dist/server/launch-key.d.ts +7 -0
  276. package/dist/server/launch-key.js +33 -0
  277. package/dist/server/launch-key.js.map +1 -0
  278. package/dist/server/open-in-app.d.ts +66 -0
  279. package/dist/server/open-in-app.js +211 -0
  280. package/dist/server/open-in-app.js.map +1 -0
  281. package/dist/server/open-in-terminal.d.ts +70 -0
  282. package/dist/server/open-in-terminal.js +179 -0
  283. package/dist/server/open-in-terminal.js.map +1 -0
  284. package/dist/server/pr.d.ts +7 -0
  285. package/dist/server/pr.js +7 -0
  286. package/dist/server/pr.js.map +1 -0
  287. package/dist/server/project-context.d.ts +120 -0
  288. package/dist/server/project-context.js +192 -0
  289. package/dist/server/project-context.js.map +1 -0
  290. package/dist/server/provider-action-gate.d.ts +8 -0
  291. package/dist/server/provider-action-gate.js +56 -0
  292. package/dist/server/provider-action-gate.js.map +1 -0
  293. package/dist/server/provider-auth-runtime.d.ts +21 -0
  294. package/dist/server/provider-auth-runtime.js +66 -0
  295. package/dist/server/provider-auth-runtime.js.map +1 -0
  296. package/dist/server/server.d.ts +13578 -0
  297. package/dist/server/server.js +5284 -0
  298. package/dist/server/server.js.map +1 -0
  299. package/dist/server/static-ui.d.ts +49 -0
  300. package/dist/server/static-ui.js +92 -0
  301. package/dist/server/static-ui.js.map +1 -0
  302. package/dist/server/validators.d.ts +97 -0
  303. package/dist/server/validators.js +86 -0
  304. package/dist/server/validators.js.map +1 -0
  305. package/dist/server/ws.d.ts +83 -0
  306. package/dist/server/ws.js +216 -0
  307. package/dist/server/ws.js.map +1 -0
  308. package/dist/server/wsl.d.ts +25 -0
  309. package/dist/server/wsl.js +92 -0
  310. package/dist/server/wsl.js.map +1 -0
  311. package/dist/server-install/engine.d.ts +50 -0
  312. package/dist/server-install/engine.js +324 -0
  313. package/dist/server-install/engine.js.map +1 -0
  314. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  315. package/dist/server-install/platforms/macosx-ngrok.js +348 -0
  316. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  317. package/dist/server-install/platforms/ubuntu-vps.d.ts +63 -0
  318. package/dist/server-install/platforms/ubuntu-vps.js +997 -0
  319. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  320. package/dist/server-install/state.d.ts +52 -0
  321. package/dist/server-install/state.js +182 -0
  322. package/dist/server-install/state.js.map +1 -0
  323. package/dist/server-install/steps.d.ts +109 -0
  324. package/dist/server-install/steps.js +334 -0
  325. package/dist/server-install/steps.js.map +1 -0
  326. package/dist/server-install/strategies.d.ts +4 -0
  327. package/dist/server-install/strategies.js +20 -0
  328. package/dist/server-install/strategies.js.map +1 -0
  329. package/dist/server-install/types.d.ts +287 -0
  330. package/dist/server-install/types.js +121 -0
  331. package/dist/server-install/types.js.map +1 -0
  332. package/dist/server-install/ui.d.ts +42 -0
  333. package/dist/server-install/ui.js +130 -0
  334. package/dist/server-install/ui.js.map +1 -0
  335. package/dist/skills-banner.d.ts +22 -0
  336. package/dist/skills-banner.js +41 -0
  337. package/dist/skills-banner.js.map +1 -0
  338. package/dist/skills-remote.d.ts +84 -0
  339. package/dist/skills-remote.js +468 -0
  340. package/dist/skills-remote.js.map +1 -0
  341. package/dist/skills-update.d.ts +88 -0
  342. package/dist/skills-update.js +392 -0
  343. package/dist/skills-update.js.map +1 -0
  344. package/dist/skills.d.ts +82 -0
  345. package/dist/skills.js +251 -0
  346. package/dist/skills.js.map +1 -0
  347. package/dist/todos.d.ts +48 -0
  348. package/dist/todos.js +201 -0
  349. package/dist/todos.js.map +1 -0
  350. package/dist/ui-state.d.ts +26 -0
  351. package/dist/ui-state.js +38 -0
  352. package/dist/ui-state.js.map +1 -0
  353. package/dist/update-check.d.ts +12 -0
  354. package/dist/update-check.js +41 -0
  355. package/dist/update-check.js.map +1 -0
  356. package/dist/workflows/load.d.ts +15 -0
  357. package/dist/workflows/load.js +56 -0
  358. package/dist/workflows/load.js.map +1 -0
  359. package/dist/workflows/run.d.ts +803 -0
  360. package/dist/workflows/run.js +3483 -0
  361. package/dist/workflows/run.js.map +1 -0
  362. package/dist/workflows/types.d.ts +145 -0
  363. package/dist/workflows/types.js +194 -0
  364. package/dist/workflows/types.js.map +1 -0
  365. package/dist/workspace/agent-accounts.d.ts +153 -0
  366. package/dist/workspace/agent-accounts.js +304 -0
  367. package/dist/workspace/agent-accounts.js.map +1 -0
  368. package/dist/workspace/agent-profiles.d.ts +78 -0
  369. package/dist/workspace/agent-profiles.js +115 -0
  370. package/dist/workspace/agent-profiles.js.map +1 -0
  371. package/dist/workspace/config.d.ts +169 -0
  372. package/dist/workspace/config.js +379 -0
  373. package/dist/workspace/config.js.map +1 -0
  374. package/dist/workspace/migrations.d.ts +45 -0
  375. package/dist/workspace/migrations.js +147 -0
  376. package/dist/workspace/migrations.js.map +1 -0
  377. package/dist/workspace/projects-cli.d.ts +25 -0
  378. package/dist/workspace/projects-cli.js +172 -0
  379. package/dist/workspace/projects-cli.js.map +1 -0
  380. package/dist/workspace/projects.d.ts +109 -0
  381. package/dist/workspace/projects.js +250 -0
  382. package/dist/workspace/projects.js.map +1 -0
  383. package/dist/workspace/semaphore.d.ts +179 -0
  384. package/dist/workspace/semaphore.js +195 -0
  385. package/dist/workspace/semaphore.js.map +1 -0
  386. package/dist/workspace/ui-state.d.ts +34 -0
  387. package/dist/workspace/ui-state.js +53 -0
  388. package/dist/workspace/ui-state.js.map +1 -0
  389. package/package.json +85 -0
  390. package/scripts/check-pack.mjs +46 -0
  391. package/scripts/inline-contract.mjs +112 -0
  392. package/scripts/install-as-command.mjs +120 -0
  393. package/scripts/mock-claude.mjs +524 -0
  394. package/scripts/mock-pi-rpc.mjs +83 -0
  395. package/scripts/sync-readme.mjs +20 -0
  396. package/scripts/test-process-usage.mjs +47 -0
  397. package/web/dist/assets/alert-dialog-CGskMvgc.js +1 -0
  398. package/web/dist/assets/arrow-down-G8adPhbu.js +1 -0
  399. package/web/dist/assets/arrow-left-BJsIW6A0.js +1 -0
  400. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  401. package/web/dist/assets/centered-state-B_V_Ai2h.js +43 -0
  402. package/web/dist/assets/chevron-right-CFzn-von.js +1 -0
  403. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  404. package/web/dist/assets/collapsible-B_8uYwHb.js +1 -0
  405. package/web/dist/assets/commit-list-C4Dv6vUL.js +1 -0
  406. package/web/dist/assets/compare-variants-SR2zZfZq.js +1 -0
  407. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  408. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  409. package/web/dist/assets/diff-CbozNUJq.js +3 -0
  410. package/web/dist/assets/diff-stat-btAmKFJr.js +1 -0
  411. package/web/dist/assets/diff-view-BpFTcG3R.js +6 -0
  412. package/web/dist/assets/diff-woXpYk--.js +1 -0
  413. package/web/dist/assets/dropdown-menu-Z80KMInL.js +1 -0
  414. package/web/dist/assets/editable-title-wS5NWwob.js +1 -0
  415. package/web/dist/assets/ellipsis-vertical-Bmi2u2TG.js +1 -0
  416. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  417. package/web/dist/assets/file-DKoYWRsv.js +1 -0
  418. package/web/dist/assets/folder-u01HScRT.js +1 -0
  419. package/web/dist/assets/git-toolbar-DZlZjTGz.js +1 -0
  420. package/web/dist/assets/github-CFURo9kf.js +1 -0
  421. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  422. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  423. package/web/dist/assets/highlighter-C8DK1_sG.js +3 -0
  424. package/web/dist/assets/html-BY76lXLH.js +1 -0
  425. package/web/dist/assets/image-preview-BR3iIIhf.js +1 -0
  426. package/web/dist/assets/index-BcI5hug3.css +2 -0
  427. package/web/dist/assets/index-DlC81_GI.js +7 -0
  428. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  429. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  430. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  431. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  432. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  433. package/web/dist/assets/json-qhed-kSA.js +1 -0
  434. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  435. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  436. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  437. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  438. package/web/dist/assets/markdown-5FuCZDA4.js +2 -0
  439. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  440. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  441. package/web/dist/assets/new-task-form-BydHBbef.js +1 -0
  442. package/web/dist/assets/pill-vNzaaYxj.js +1 -0
  443. package/web/dist/assets/project-router-BbCzrHKs.js +1 -0
  444. package/web/dist/assets/prompt-templates-B7Fs2b1S.js +15 -0
  445. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  446. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  447. package/web/dist/assets/refresh-cw-DGliez3E.js +1 -0
  448. package/web/dist/assets/repo-git-CJFDMauC.js +1 -0
  449. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  450. package/web/dist/assets/run-diff-Bq9vkSNK.js +3 -0
  451. package/web/dist/assets/run-header-Cd8mSKBG.js +1 -0
  452. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  453. package/web/dist/assets/search-x-69n_672Y.js +1 -0
  454. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  455. package/web/dist/assets/skill-empty-hint-DTu0LzaJ.js +1 -0
  456. package/web/dist/assets/skills-Cs-auniL.js +1 -0
  457. package/web/dist/assets/skills-D4P-Hgey.js +1 -0
  458. package/web/dist/assets/sparkles-B8agSxBZ.js +1 -0
  459. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  460. package/web/dist/assets/square-terminal-Cf4Og6ct.js +1 -0
  461. package/web/dist/assets/tab-link-Cp2-CJS8.js +1 -0
  462. package/web/dist/assets/task-changes-DYgNXOyY.js +1 -0
  463. package/web/dist/assets/task-commits-BRpZSz1G.js +1 -0
  464. package/web/dist/assets/task-files-pKOwSyLh.js +2 -0
  465. package/web/dist/assets/task-thread-Bfyqqy-t.js +9 -0
  466. package/web/dist/assets/textarea--cpYshee.js +1 -0
  467. package/web/dist/assets/thread-loading-GyH2Atwo.js +1 -0
  468. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  469. package/web/dist/assets/trash-2--ZtrzUx3.js +1 -0
  470. package/web/dist/assets/triangle-alert-D5tJwRD2.js +1 -0
  471. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  472. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  473. package/web/dist/assets/upload-SnwVxKOA.js +1 -0
  474. package/web/dist/assets/use-desktop-C31lOFUD.js +1 -0
  475. package/web/dist/assets/use-submit-shortcut-JY8M_MPL.js +1 -0
  476. package/web/dist/assets/utils-Bb8ohcr3.js +64 -0
  477. package/web/dist/assets/workflows-BmOehP-A.js +11 -0
  478. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  479. package/web/dist/assets/zoomable-image-0G3IBXWC.js +1 -0
  480. package/web/dist/index.html +80 -0
  481. package/web/dist/xezar.svg +14 -0
@@ -0,0 +1,803 @@
1
+ import type { RunnerId } from '../core/agent-runner.ts';
2
+ import type { ContentBlock } from '../core/agent-runner.ts';
3
+ import { type Skill } from '../skills.ts';
4
+ import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.ts';
5
+ import { WorkspaceSemaphore, type AccountHolds } from '../workspace/semaphore.ts';
6
+ import { type WorkflowDef } from './types.ts';
7
+ /** An interactive session that hears nothing from the user closes itself. */
8
+ export declare const IDLE_TIMEOUT_MS: number;
9
+ /**
10
+ * Preserve boundaries between complete assistant text blocks while a turn is
11
+ * accumulated for marker parsing. The runners join these same v1 blocks with
12
+ * newlines in `AgentRunResult`; matching that contract here prevents a
13
+ * trailing `XEZ:TITLE=` block from absorbing later commentary (#623).
14
+ */
15
+ export declare function appendTurnText(current: string, next: string): string;
16
+ /** Periodic "xezar autosave" commit in the task worktree (spec 006). */
17
+ export declare const AUTOSAVE_INTERVAL_MS = 90000;
18
+ /** The periodic autosave timer is opt-in (#471): off, a task branch carries only the
19
+ * agent's own commits plus the turn-end/pre-PR flushes — no mid-run "xezar autosave"
20
+ * noise interleaving PR history. The flushes (`autosaveCommit` at turn end and before
21
+ * a draft PR) are NOT gated: the branch must still end holding the finished state. */
22
+ export declare function periodicAutosaveEnabled(env?: NodeJS.ProcessEnv): boolean;
23
+ /**
24
+ * Explicitly opt out of the repository-root lease for runs that execute in the
25
+ * current checkout. This covers explicit worktree opt-out, non-Git degradation,
26
+ * and continuations whose worktree cannot be restored (spec 006 hardening, #438).
27
+ * This is intentionally unsafe: concurrent agents may overwrite each other's
28
+ * files or Git state. Isolated worktree runs are unaffected.
29
+ */
30
+ export declare function repositoryRootLockDisabled(env?: NodeJS.ProcessEnv): boolean;
31
+ /**
32
+ * Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
33
+ *
34
+ * The wait is the provider's own reset instant plus this grace: resuming AT the boundary races the
35
+ * provider's clock (and its rounding), and one failed resume costs the whole window over again.
36
+ * Thirty seconds is cheap next to five hours and long enough to be past any sane skew.
37
+ */
38
+ export declare const AUTO_RESUME_GRACE_MS = 30000;
39
+ /**
40
+ * Consecutive automatic resumes allowed without a human turn. A resume can only fire after a real
41
+ * reset instant, so this is not a throttle — it is the backstop for the pathological case (a
42
+ * provider that answers "limit reached, retry now" in a loop), and it is deliberately generous
43
+ * enough to sit through a couple of days of five-hour windows.
44
+ */
45
+ export declare const MAX_AUTO_RESUMES = 12;
46
+ /**
47
+ * How long a missed deadline stays worth acting on. The promise is "we pick this up when the
48
+ * window reopens" — kept across a restart or an overnight close, which is the case the feature
49
+ * exists for. A day later it is no longer that promise: the user has moved on, and a task
50
+ * springing back to life is a surprise rather than a service. Such a deadline is retired with a
51
+ * note instead of fired, so the only tasks a sweep can revive are ones someone is still waiting on.
52
+ */
53
+ export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
54
+ /**
55
+ * How often the queue checks that it is not wedged.
56
+ *
57
+ * A hold is the only thing in the engine that can make an idle queue CORRECT, so it is also the
58
+ * only thing that can make a wedged one look correct. This tick is the way out: cheap (a few
59
+ * in-memory checks), unref'd, and it only ever acts when idling has no justification left.
60
+ */
61
+ export declare const QUEUE_WATCHDOG_MS = 60000;
62
+ /**
63
+ * Which agent ACCOUNT a run's work runs on — the thing a provider usage limit actually closes
64
+ * (spec 2026-08-03-auto-resume-after-usage-limit).
65
+ *
66
+ * Backend plus agent account, because those are the two axes a limit is scoped to: a Claude
67
+ * limit must never stall a Codex task, and a second Claude login is a second budget. A record
68
+ * that names no runner has not started yet and will take the configured default, which is what
69
+ * `fallbackRunner` carries; a run that HAS started always carries its resolved runner (execute
70
+ * persists it), and only started runs can be holding.
71
+ */
72
+ export declare function runAccountKey(run: Pick<RunRecord, 'runner' | 'agentProfile'>, fallbackRunner: RunnerId): string;
73
+ export interface StartRunInput {
74
+ task: string;
75
+ model?: string;
76
+ /** Agent backend chosen for this task (GUI). Unset = the config default. */
77
+ runner?: RunnerId;
78
+ /** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
79
+ * on `runner`. Unset = the project's own selection. Persisted on the record so the choice
80
+ * survives into resume and Continue, and so the thread can say which account did the work. */
81
+ agentProfile?: string;
82
+ /** Attachments pasted into the new-task form — persisted when the run is created and
83
+ * delivered once, with the first agent step's opening message. Images ride along as blocks the
84
+ * model can view; a file (#950) only ever reaches the agent as the path it was written to. */
85
+ images?: PastedContent[];
86
+ /** Per-run system-prompt override (`POST /api/runs`, programmatic callers).
87
+ * Replaces the `config.json` default for this run — see
88
+ * `resolveExtraSystemPrompt` for the precedence contract. */
89
+ systemPrompt?: string;
90
+ /** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
91
+ * working tree instead of an isolated worktree. Undefined/`true` keeps the
92
+ * default per-task worktree. Ignored for variants (they always isolate). */
93
+ worktree?: boolean;
94
+ /** Autonomous mode (#autonomous): the run never parks at `waiting` for the
95
+ * user — turn-ends auto-continue until the agent signals done or the safety
96
+ * cap is hit. No "needs you" is ever raised. */
97
+ autonomous?: boolean;
98
+ /** Follow-up inbox generation (spec 007, #444). Omitted means enabled for
99
+ * compatibility; the handoff journal runs either way. */
100
+ generateFollowups?: boolean;
101
+ /** Attachments from the queued prompt stack (#472), re-encoded from disk by
102
+ * `hydrateQueuedInput` at dequeue. Kept separate from `images` because those
103
+ * are persisted into `taskImages` by `startRun()` — folding
104
+ * the stack's (already-persisted) files in there would write duplicate files
105
+ * and make the task bubble render the stack's images as its own. In-memory
106
+ * only: rebuilt from the record on every hydration, never persisted. */
107
+ stackedImages?: ContentBlock[];
108
+ }
109
+ /**
110
+ * The effective "extra" system prompt for a run (spec §protocol v2, R2 2.3):
111
+ * the per-run override (`POST /api/runs` `systemPrompt`) REPLACES the
112
+ * `config.json` default — they are the same knob at two scopes, so the more
113
+ * specific one wins outright; they never concatenate. Whichever wins is
114
+ * ADDITIVE to the skill body and the handoff contract, which always ride
115
+ * along (see `composeSystemPrompt`). Blank strings count as unset.
116
+ */
117
+ export declare function resolveExtraSystemPrompt(override: string | undefined, configDefault: string | undefined): string | undefined;
118
+ /**
119
+ * Joins the parts of one agent step's system prompt in fixed order — skill
120
+ * body (most task-specific), then the run's extra prompt (user guidance, can
121
+ * amend the skill), then the handoff contract (always last, never optional in
122
+ * practice). Blank parts drop out; survivors join with the same `\n\n---\n\n`
123
+ * divider the skill+handoff composition has always used.
124
+ */
125
+ export declare function composeSystemPrompt(...parts: Array<string | undefined>): string;
126
+ /**
127
+ * The directories a spawned agent may reach outside its worktree: the run-state
128
+ * folder that holds its handoff file, plus its own temp directory when this run
129
+ * got one (#785). Handing an agent a `TMPDIR` its file tools are not allowed to
130
+ * write would trade one silent failure for another, so the two travel together;
131
+ * under `XEZ_AGENT_TMPDIR=0` there is no per-run directory and the list is
132
+ * exactly what it always was.
133
+ */
134
+ export declare function agentDirectories(runsDir: string, env: Record<string, string>): string[];
135
+ /**
136
+ * Materialized pasted attachment: the on-disk name/serving-URL pair the
137
+ * transcript already used, plus the absolute path that lets the agent
138
+ * operate on the file itself — save it, `cp` it, attach it to a GitHub
139
+ * issue/PR (#357). `path` is only ever an absolute path under
140
+ * `.ai/xezar/runs/<runId>-images/` (see `RunManager.persistAttachment`).
141
+ */
142
+ /** Inverse of `attachmentExtension` (#472) — a persisted attachment is re-encoded from disk at
143
+ * dequeue and needs its media type back. Only ever asked about IMAGE names (a file reaches the
144
+ * agent as a path, never as a block), so an unknown extension still answers `image/png`: that is
145
+ * the pre-existing fallback for the `.img` an SVG or a BMP paste lands as. */
146
+ export declare function mediaTypeFor(name: string): string;
147
+ /** Highest `<prefix>-<n>.<ext>` suffix already present in a run's image dir (#472).
148
+ * `screenshot-*` and `pasted-*` share one numbering space, so this scans both and
149
+ * returns 0 for a missing/empty directory. */
150
+ export declare function highestImageSeq(dir: string): number;
151
+ export interface PersistedAttachment {
152
+ name: string;
153
+ url: string;
154
+ path: string;
155
+ }
156
+ /**
157
+ * A user attachment that is NOT an image (#950) — a PDF, a `.txt`, a `.md`.
158
+ *
159
+ * Deliberately not a `ContentBlock` variant: `ContentBlock` is the runner protocol
160
+ * (`AGENT_PROTOCOL.md`), and a file has nothing a model can look at. The RunManager
161
+ * converts these into files on disk plus a path in the prompt before anything is
162
+ * handed to a session, so a `file` block can never reach a backend.
163
+ */
164
+ export interface FileBlock {
165
+ type: 'file';
166
+ mediaType: string;
167
+ data: string;
168
+ }
169
+ /** What the routes hand the engine: image/text blocks the session will see, plus file blocks it
170
+ * will never see. Every RunManager entry point accepts this wider type. */
171
+ export type PastedContent = ContentBlock | FileBlock;
172
+ /** One wire attachment (`{mediaType, data}`) as the engine wants it: an image the model can view,
173
+ * or a file it will only ever be given the path of. The single mapping the four attachment-
174
+ * carrying routes share, so none of them can invent a different one. */
175
+ export declare function toPastedContent(attachment: {
176
+ mediaType: string;
177
+ data: string;
178
+ }): PastedContent;
179
+ /** The image blocks of a mixed list — what may be delivered to a session. */
180
+ export declare function contentBlocksOf(content: readonly PastedContent[]): ContentBlock[];
181
+ /**
182
+ * Plain-text note listing the absolute paths of pasted attachments, appended
183
+ * to the message that carries them (#357). The base64 image blocks stay in
184
+ * the message for the model to *view*; this note is what lets it *use* the
185
+ * files as files — and the only usable reference on backends (codex,
186
+ * opencode) whose `textOf()` drops image blocks before reaching the model.
187
+ */
188
+ export declare function pastedAttachmentsText(attachments: PersistedAttachment[]): string;
189
+ /** Same note as `pastedAttachmentsText`, wrapped as a trailing `ContentBlock`
190
+ * ready to append to a message's content array. */
191
+ export declare function pastedAttachmentsNote(attachments: PersistedAttachment[]): ContentBlock;
192
+ /** Variant letters + the fixed diversification hints (spec 010). A runs the
193
+ * task verbatim; B/C get one constant sentence each — zero configuration. */
194
+ export declare const VARIANT_LETTERS: readonly ['A', 'B', 'C'];
195
+ /**
196
+ * The mini workflow engine: executes a `WorkflowDef` against a repo, one step
197
+ * at a time, persisting every event to the RunStore (which the SSE endpoints
198
+ * relay live to the GUI). No GitHub choreography — agent steps and shell
199
+ * checks with bounded retry loops, plus live sessions: the last agent step
200
+ * stays open for follow-ups (`waiting`) until "finish", idle timeout, or
201
+ * cancel. Runs queue behind the workspace-wide `maxParallel` slots (the shared
202
+ * `WorkspaceSemaphore`, spec 2026-07-20 step 2.5) and each run executes in its
203
+ * own git worktree on a `xez/<id8>` branch (spec 006), autosave-committed at
204
+ * turn end and before a draft PR — plus every 90 s when opted in via
205
+ * XEZ_AUTOSAVE=1 (#471). Each autosave records its trigger in the commit
206
+ * subject, so the always-on flushes are not mistaken for the opt-in timer.
207
+ * The user's working tree is never touched.
208
+ */
209
+ export declare class RunManager {
210
+ private readonly store;
211
+ private readonly repoRoot;
212
+ private readonly active;
213
+ private readonly queue;
214
+ private readonly starting;
215
+ private readonly waiting;
216
+ /** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
217
+ private readonly monitoring;
218
+ private readonly pendingJobs;
219
+ /** Interrupted agent turns recovered after a process restart. Unlike an
220
+ * explicit user Continue, these are bulk scheduler work and must re-enter
221
+ * through `pump()` so both workspace and per-project caps are honored. */
222
+ private readonly pendingContinuations;
223
+ /** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
224
+ * the manager rather than the `ActiveRun` so a *queued* run — which has no
225
+ * `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
226
+ private readonly queuedImageSeq;
227
+ /** Messages that landed in the dequeue → session-open gap (#472), flushed as
228
+ * ordinary follow-up turns the moment the session opens. In-memory only. */
229
+ private readonly deferredMessages;
230
+ /** Armed usage-limit resumes, keyed by run id (spec
231
+ * 2026-08-03-auto-resume-after-usage-limit). The DEADLINE itself lives on the record
232
+ * (`autoResumeAt`) — this map holds only the process-local timer, so a restart rebuilds it
233
+ * from the record rather than losing the wait. Runs here are `failed` and therefore NOT in
234
+ * `active`, which is why the timer cannot live on an `ActiveRun` like the monitoring one. */
235
+ private readonly autoResumeTimers;
236
+ private pumping;
237
+ /** A pump that arrived while one was in flight — replayed by `pump()`'s own
238
+ * loop so a slot freed mid-sweep is never a lost wakeup. */
239
+ private pumpAgain;
240
+ /**
241
+ * Runs normally isolate in worktrees and may execute in parallel. When that
242
+ * isolation is unavailable (or explicitly disabled), access to `repoRoot` is
243
+ * serialized by default so two agents cannot edit/revert the same files
244
+ * (#438). `XEZ_DISABLE_REPO_LOCK=1` deliberately bypasses this safety lease.
245
+ */
246
+ private repoRootTail;
247
+ /** `.ai/xezar` — where the per-task handoff files and todos.json live. */
248
+ private readonly dataDir;
249
+ /** Runs currently being paused by the memory guard — dedupes the ~2 s samples so one breach
250
+ * triggers one pause, not a burst. Cleared in dropActive when the run leaves the registry. */
251
+ private readonly memoryPausing;
252
+ /** Unsubscribe handle for the constructor's `onUsage` subscription — released
253
+ * by dispose() so a torn-down manager stops receiving sampler ticks. */
254
+ private readonly offUsage;
255
+ /** The stalled-queue watchdog (see `rescueStalledQueue`). */
256
+ private readonly queueWatchdog;
257
+ /** Set by the watchdog for exactly one sweep: ignore the usage-limit hold and make progress. */
258
+ private forceNextPump;
259
+ /** Runs the watchdog started despite the hold. The spawn-time gate (`requeueWhileHeld`) would
260
+ * otherwise hand them straight back and the rescue would undo itself in a millisecond. */
261
+ private readonly forceStarted;
262
+ /** The workspace-wide parallel-cap semaphore + cached resource config
263
+ * (spec 2026-07-20, step 2.5). Boot constructs ONE and every manager shares
264
+ * it; the private fallback keeps single-manager callers and tests working. */
265
+ private readonly semaphore;
266
+ /** Unregister handle for this manager's semaphore membership — released by
267
+ * dispose() so a torn-down project stops counting against the cap. */
268
+ private readonly offSemaphore;
269
+ constructor(store: RunStore, repoRoot: string, options?: {
270
+ semaphore?: WorkspaceSemaphore;
271
+ });
272
+ /**
273
+ * Release everything this manager owns without touching run records
274
+ * (multi-project workspace, spec 2026-07-20: a removed project's context is
275
+ * torn down while the process lives on). Unsubscribes the shared usage
276
+ * sampler — before dispose() existed that subscription lived for the whole
277
+ * process — clears every per-run idle/autosave timer, releases any held
278
+ * repo-root locks, and empties the queued state so nothing fires later.
279
+ * Live sessions are NOT ended here: run lifecycle stays the caller's policy;
280
+ * dispose only guarantees the manager makes no further moves on its own.
281
+ */
282
+ dispose(): void;
283
+ /**
284
+ * Pause any active run whose whole process tree exceeds the WORKSPACE
285
+ * `resources.memoryLimitMb`, freeing its slot so the queue advances
286
+ * (#memory-guard). "Pause" closes the session — freeing the tree's
287
+ * memory — and leaves the run resumable via Continue; a loud warning explains why. No-op when
288
+ * no limit is set or the sampler has no data (e.g. `ps`/PowerShell unavailable).
289
+ */
290
+ private enforceMemoryLimit;
291
+ /** Env the spawned claude gets so the agent can find its handoff file and
292
+ * the global inbox (spec 007; the inbox only when the run opted in).
293
+ *
294
+ * `XEZ_TODOS_FILE` is set to `''` rather than omitted when follow-ups are
295
+ * off: runners spawn with `{ ...process.env, ...spec.env }`, so omitting the
296
+ * key would let a value inherited from *this* process through — a nested
297
+ * xezar (an agent running `xez serve`/`xez run`/the test suite) would then
298
+ * write follow-ups into the parent's inbox despite the opt-out. Empty is the
299
+ * established "absent" spelling — consumers guard with `if (todosFile)`.
300
+ *
301
+ * `TMPDIR`/`TEMP`/`TMP` (#785) point at this run's own scratch directory
302
+ * instead of the machine-wide one every agent used to share. Created and
303
+ * write-probed here, on the last common path before a spawn, so an unusable
304
+ * temp directory throws `AgentTempDirError` at the caller rather than
305
+ * turning into empty command output inside a running agent. */
306
+ private agentEnv;
307
+ /**
308
+ * `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
309
+ * 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
310
+ *
311
+ * Resolved per step, not per run, because a workflow can mix backends: an override naming a
312
+ * Claude account says nothing about which Codex account a codex step should use. Resolution
313
+ * order, most specific first:
314
+ *
315
+ * 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
316
+ * account that created the session, whatever the project has since been switched to;
317
+ * 2. the run's composer override, but only for steps on the run's own runner;
318
+ * 3. the project's stored selection, and failing that the discovered default.
319
+ *
320
+ * Read fresh every time. `~/.xezar/config.json` is shared by every xezar process on this
321
+ * machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
322
+ * spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
323
+ * exactly the behaviour that predates profiles.
324
+ */
325
+ private agentEnvForStep;
326
+ startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
327
+ groupId: string;
328
+ variant: string;
329
+ }): RunRecord;
330
+ /**
331
+ * Parallel variants (spec 010): N runs of the same workflow on the same
332
+ * task, sharing a groupId. Variant A gets the task verbatim; B and C get a
333
+ * fixed one-line approach hint appended to the *task input* (not the step
334
+ * template), so diversification works with any workflow. The normal queue
335
+ * applies — with maxParallel=2 a third variant simply waits.
336
+ */
337
+ startVariants(workflow: WorkflowDef, input: StartRunInput, count: number): RunRecord[];
338
+ /**
339
+ * Slots this manager holds against the workspace-wide cap. `waiting` runs
340
+ * don't hold a slot (#347): an idle claude process costs memory but no
341
+ * tokens, queued work progressing matters more, and the idle timeout already
342
+ * bounds how long a session can sit open. Because the exemption lives HERE —
343
+ * in the count, not in any acquire path — a message into a `waiting` run
344
+ * (sendMessage) resumes it immediately even when that momentarily exceeds
345
+ * `maxParallel`, including when other projects saturate the cap.
346
+ */
347
+ private busySlots;
348
+ /** Epoch ms of this manager's oldest queued run (the semaphore's fairness
349
+ * key when a freed slot is broadcast), or null when nothing is queued.
350
+ * `queue` is FIFO — `startRun` pushes and `recover()` re-queues by
351
+ * `createdAt` — so the head is the oldest. */
352
+ private oldestQueuedAt;
353
+ /**
354
+ * A slot this manager held just came free. Pump the whole WORKSPACE, not
355
+ * just this manager: `maxParallel` is counted across every project, so the
356
+ * run that should take the slot is the workspace's oldest queued one — which
357
+ * usually sits in another project's queue. Pumping only `this` is what left
358
+ * a queued run in project B stuck at `queued` while project A's runs came
359
+ * and went. `release()` pumps this manager too, so it replaces the local
360
+ * `pump()` at every slot-freeing transition.
361
+ */
362
+ private releaseSlot;
363
+ /**
364
+ * Start queued runs while parallel slots are free. A run starts only under
365
+ * BOTH ceilings: the WORKSPACE `resources.maxParallel` (default 2, counted
366
+ * across every manager — spec 2026-07-20, step 2.5) AND this project's own
367
+ * per-project `maxParallel` when the registry sets one (spec 2026-07-22,
368
+ * inherits the workspace cap when unset). Legacy per-repo `maxParallel` keys
369
+ * are ignored. A non-git directory degrades to 1 sequential run in the repo
370
+ * root (spec 006 degradation rule), which is always the tighter bound.
371
+ */
372
+ private pump;
373
+ /**
374
+ * Make one `queued` RECORD executable again — the engine half a queued run needs but does not
375
+ * persist (`pendingJobs` / `pendingContinuations` are process-local, the record is not).
376
+ *
377
+ * Two callers, one path: boot recovery re-adopts everything the previous process was holding,
378
+ * and the queue watchdog re-adopts anything the running process has somehow lost. A queued
379
+ * record with no work item behind it is invisible to `pump()` and would sit there for good,
380
+ * which is the worst failure this engine has — the task is neither running nor failed, just
381
+ * silently never going to happen.
382
+ *
383
+ * A continuation is reconstructed first: its executable details are gone, but the pending
384
+ * `continue-N` step and the session before it are durable, which is enough. Otherwise the
385
+ * workflow is revived from the record. A run that can be neither is failed loudly rather than
386
+ * left in the queue as a ghost.
387
+ */
388
+ private reviveQueuedRun;
389
+ /**
390
+ * Startup recovery (#367) — re-adopt runs that were live when the previous
391
+ * xezar process exited (requires the store opened with `keepLive`):
392
+ * - `queued` → back into the queue (FIFO by createdAt), from the persisted
393
+ * workflowDef (or the catalog by name for older records);
394
+ * - `waiting` → the turn was over and the ball was in the user's court —
395
+ * settle exactly like a closed session (review/done, Continue still works);
396
+ * - `running` → mark interrupted, then immediately resume the last agent
397
+ * session via the Continue path, pointing the agent at its handoff file.
398
+ * Call once, before the server starts taking requests.
399
+ */
400
+ recover(): Promise<void>;
401
+ /** The persisted definition when it looks sane, else the catalog by name. */
402
+ private reviveWorkflow;
403
+ /** Remove a run from the live registries — keeps `waiting ⊆ active`. */
404
+ private dropActive;
405
+ /**
406
+ * A run just failed: if the provider said "usage limit, back at T", promise to resume it at
407
+ * `T + AUTO_RESUME_GRACE_MS` instead of leaving the task dead until someone notices.
408
+ *
409
+ * Every refusal below is silent-but-honest — the run stays `failed` with its Continue button,
410
+ * which is exactly the pre-feature behavior — except the safety cap, which says so on the
411
+ * transcript, because a run that stops resuming itself needs to explain why.
412
+ */
413
+ private scheduleAutoResumeIfLimited;
414
+ /** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. */
415
+ private armAutoResume;
416
+ /**
417
+ * The window has reopened. Re-check the record synchronously — hours may have passed, and the
418
+ * user may have continued, deleted or cancelled the run in them — then hand the resume to the
419
+ * ordinary queued-continuation path so it obeys both concurrency caps like any other work.
420
+ */
421
+ private fireAutoResume;
422
+ /**
423
+ * Make the armed timers agree with the records and the current setting. Runs on every `pump()`
424
+ * — which is where a settings change lands (a config PUT refreshes the shared semaphore, which
425
+ * pumps every manager) — and once from `recover()`.
426
+ *
427
+ * It is a RECONCILE rather than a one-shot restore because the deadline is durable state and
428
+ * the timer is not: a restart, a rebuilt project context, a manager disposed mid-wait, or a
429
+ * refusal all leave a record promising a resume that no timer is holding. Rebuilding from the
430
+ * record covers every one of those at once — the alternative is a hint counting down to a time
431
+ * that has already passed, which is exactly the failure this method exists to make impossible.
432
+ *
433
+ * Cheap: an in-memory scan, and arming is skipped for every run already held.
434
+ */
435
+ private reconcileAutoResumes;
436
+ /**
437
+ * Hand a run that has not spawned anything back to the queue, when the account it would run on
438
+ * went into a usage-limit hold (spec 2026-08-03-auto-resume-after-usage-limit).
439
+ *
440
+ * The dequeue-time gate in `pump()` cannot be the only one: a run can sit between dequeue and
441
+ * spawn for a long time — an in-place run waiting for the exclusive repo-root lease is the
442
+ * measured case — and the account can close in that gap. This is the last honest moment to
443
+ * refuse, because everything after it costs a real agent turn.
444
+ *
445
+ * "Untouched" is the contract: the run has created no session and no worktree, so it goes back
446
+ * as plain `queued` with its `startedAt` cleared, and `pump()` will pick it up when the window
447
+ * reopens. Returns true when the caller must abandon the run.
448
+ */
449
+ private requeueWhileHeld;
450
+ /**
451
+ * The failsafe: a queue must never be able to wedge.
452
+ *
453
+ * Everything else in this file makes an idle queue CORRECT under some condition — a slot cap, a
454
+ * repo-root lease, and now a usage-limit hold. That is also what makes a wedged queue look
455
+ * correct, and the hold has already produced one in the field: two resumes fired together, each
456
+ * holding the account the other was waiting on, and the whole workspace stopped with every task
457
+ * `queued`. That specific bug is fixed and tested, but "the queue stopped and nothing will ever
458
+ * restart it" is too expensive a failure mode to leave resting on any single fix being right.
459
+ *
460
+ * The test is deliberately about JUSTIFICATION rather than about any particular bug: idling is
461
+ * legitimate while work is running (here or in another project), or while a real appointment is
462
+ * still ahead — a scheduled resume that will fire and pump on its own. Anything else is a
463
+ * queue with work in it, nothing running anywhere, and no event coming to wake it. That gets one
464
+ * forced sweep, which starts work under the ordinary caps and lets the account's real state
465
+ * re-assert itself: if the window truly is shut, that task meets the limit and re-establishes an
466
+ * honest hold, with a real deadline behind it this time.
467
+ *
468
+ * Public so a test can drive the wedge directly instead of waiting out the interval.
469
+ */
470
+ rescueStalledQueue(now?: number): Promise<void>;
471
+ /**
472
+ * The accounts this project is currently holding: one key per run parked on a usage-limit
473
+ * resume that has not come due yet (spec 2026-08-03-auto-resume-after-usage-limit).
474
+ *
475
+ * Published to the shared semaphore so the hold spans PROJECTS — one Claude account can be
476
+ * driving tasks in three repos, and a limit closes it for all of them. Derived from the
477
+ * records on every ask rather than tracked as state: a deadline that passes, a resume that
478
+ * fires, a cancel, an archive and a delete all lift the hold with no bookkeeping.
479
+ *
480
+ * Deliberately excludes a deadline that has already passed — that run is about to resume, and
481
+ * holding the queue for it would only stall the very work the window reopened for.
482
+ */
483
+ accountHolds(now?: number): AccountHolds;
484
+ /**
485
+ * The PER-TASK off switch (`DELETE /api/v1/runs/:id/auto-resume`, and the archive route):
486
+ * stop resuming THIS task, without touching the workspace setting or any other task.
487
+ *
488
+ * Idempotent — a run with nothing pending answers the same way, because "this task will not
489
+ * resume itself" is equally true either way. Returns false only when the run does not exist,
490
+ * which is the route's 404.
491
+ */
492
+ cancelAutoResume(runId: string): boolean;
493
+ /** Retire a pending resume — timer, deadline and counter. The counter goes too because every
494
+ * caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
495
+ private clearAutoResume;
496
+ /** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
497
+ * `xez/<id8>` branch kept. Best-effort; a failure never affects run
498
+ * lifecycle. `review`/live runs are excluded by the selector. */
499
+ private enforceRetention;
500
+ /** Last live-refresh namer inputs per run — unchanged inputs skip the call. */
501
+ private lastNamerKey;
502
+ /**
503
+ * Acquire the one-at-a-time lease for runs executing in `repoRoot`.
504
+ *
505
+ * A lease waiter is idle, so it parks in `waiting` and gives its
506
+ * `maxParallel` slot back (the #347 rule): isolated worktrees keep using
507
+ * every configured slot while root runs line up. The store status stays
508
+ * `running` — only the queue's busy count changes, so the GUI never shows a
509
+ * lease-blocked run as awaiting user input.
510
+ *
511
+ * The lease is held for the run's whole lifetime, including the idle
512
+ * `waiting` parks between agent turns. A parked session is still live and
513
+ * writes to the working tree the moment it resumes, so handing the tree to
514
+ * another run there would reintroduce the concurrent-edit bug (#438) this
515
+ * lease exists to prevent.
516
+ *
517
+ * Returns false when the run was cancelled while waiting: the lease was
518
+ * never granted and the caller must not touch the working tree.
519
+ */
520
+ private acquireRepoRoot;
521
+ cancel(runId: string): boolean;
522
+ isActive(runId: string): boolean;
523
+ /**
524
+ * Fold a queued run's persisted prompt — `run.task` plus everything stacked
525
+ * onto it (#472) — into the job input that is about to execute.
526
+ *
527
+ * Called from `pump()` immediately before `execute()`, which makes the RECORD
528
+ * the single source of truth for a queued run's prompt. Before this, the
529
+ * executing copy lived in `pendingJobs` (memory) while the record held a
530
+ * second one, so an edit that PATCHed the record silently did nothing until a
531
+ * restart. `recover()` rebuilds through the same helper, so both paths agree.
532
+ *
533
+ * **Read-only, and that is load-bearing.** It composes into the in-memory
534
+ * `input` and never writes the folded string back to `RunRecord.task`; the
535
+ * task and its stack stay separate on disk for the life of the run. Writing
536
+ * back would re-append the whole stack on every recovery and compound without
537
+ * bound — asserted directly by a test.
538
+ */
539
+ private hydrateQueuedInput;
540
+ /** Apply edits and messages made while a restart continuation waits for
541
+ * capacity. The durable record remains the source of truth, just as it is for
542
+ * an ordinary queued workflow (#472), so a second restart reconstructs and
543
+ * hydrates the same amendments instead of dropping them. */
544
+ private hydrateQueuedContinuation;
545
+ /**
546
+ * Re-read persisted attachments at dequeue/restart (#472): an image comes back as a viewable
547
+ * block AND a path, a file (#950) as a path only. The branch is on the NAME's extension, never
548
+ * on which list the URL came from — images and files share one list, and re-encoding a `.pdf`
549
+ * into a base64 image block is a message no backend can accept.
550
+ *
551
+ * A file is still `stat`-checked here rather than trusted: an attachment the user deleted must
552
+ * drop out of the paths handed to the agent, exactly as a missing image does.
553
+ */
554
+ private readPersistedAttachments;
555
+ /**
556
+ * Still waiting for a slot? Checked against the engine's own queue rather than
557
+ * the record's `status` (#472): the record is written by `execute()` a tick
558
+ * after `pump()` dequeues, so a status read can see `queued` for a run that has
559
+ * already started. The pending maps are deleted synchronously at dequeue, so
560
+ * they are the authoritative answer for "can this prompt still be amended".
561
+ */
562
+ private isQueued;
563
+ /** Split a pasted message into the persisted shape a stacked message holds. */
564
+ private toQueuedMessage;
565
+ /**
566
+ * Append a prompt message onto a still-queued run (#472). Returns the stored
567
+ * entry, or null when the run has already started — the caller then falls
568
+ * through to `deferMessage`.
569
+ */
570
+ enqueueMessage(runId: string, content: PastedContent[]): QueuedMessage | null;
571
+ /** Edit a stacked message in place. Omitted fields retain their current value. */
572
+ editQueuedMessage(runId: string, msgId: string, edit: {
573
+ text?: string;
574
+ images?: PastedContent[];
575
+ }): QueuedMessage | null;
576
+ /** Remove a stacked message and its now-orphaned attachments. */
577
+ removeQueuedMessage(runId: string, msgId: string): boolean;
578
+ /**
579
+ * Delete image files no longer referenced by anything (#472). Best effort — a
580
+ * leftover file is harmless and goes with the run. Never touches a URL still
581
+ * referenced by another stacked entry or by the initial prompt's `taskImages`.
582
+ */
583
+ private dropOrphanImages;
584
+ /**
585
+ * Edit the initial prompt of a still-queued run (#472). Re-derives the
586
+ * heuristic title and the PR/issue chips, but never re-runs the LLM namer —
587
+ * it already fired at creation and a second model call per edit is unjustified.
588
+ */
589
+ editTask(runId: string, task: string): boolean;
590
+ /**
591
+ * Buffer a message that arrived in the gap between dequeue and session-open
592
+ * (#472). `pump()` has already folded the stack and `execute()` is spawning the
593
+ * backend, so there is nothing left to amend and no session to deliver into —
594
+ * without this rung the message would 409, a genuinely dropped message in the
595
+ * feature built to stop dropping them. Flushed as an ordinary follow-up turn
596
+ * the instant the session opens; dropped if the run never starts, which the
597
+ * existing error path already surfaces.
598
+ *
599
+ * The buffer lives on the manager rather than the `ActiveRun` because the
600
+ * `ActiveRun` does not exist yet for part of this window.
601
+ */
602
+ deferMessage(runId: string, content: PastedContent[]): boolean;
603
+ /** Deliver anything `deferMessage` buffered, once the session is live. */
604
+ private flushDeferred;
605
+ /**
606
+ * Deliver a user message into the run's live claude session (mid-turn or
607
+ * while `waiting`). Returns false when there is no open session — the GUI
608
+ * then offers "Continue" instead.
609
+ */
610
+ sendMessage(runId: string, content: PastedContent[]): boolean;
611
+ /** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
612
+ * bookkeeping without masquerading as user-authored transcript messages. */
613
+ private deliverMessage;
614
+ /** Close the open session gracefully — the run then completes as `done`
615
+ * (or rests at `review` when the worktree holds changes, spec 009).
616
+ * On a run already resting at `review` (no session — the engine loop is
617
+ * over), "Finish" is the third review exit: accept the changes without a
618
+ * PR and flip straight to `done`. */
619
+ finish(runId: string): boolean;
620
+ /**
621
+ * "Continue" (spec 003): reopen a finished run's claude session in-process
622
+ * (`claude --resume <sessionId>`) as a new synthetic step. The session then
623
+ * behaves exactly like an interactive step: `waiting` after each turn,
624
+ * messages via sendMessage, closed by finish/idle/cancel.
625
+ */
626
+ continueRun(runId: string, opts?: {
627
+ text?: string;
628
+ images?: PastedContent[];
629
+ runner?: RunnerId;
630
+ model?: string;
631
+ /** Agent account for the reopened session (spec 2026-07-29-agent-profiles). Omitted = the
632
+ * account the run is already on. */
633
+ agentProfile?: string;
634
+ },
635
+ /** Restart recovery may discover several interrupted tasks at once. Those
636
+ * continuations are queued; an explicit user Continue remains immediate. */
637
+ deferForCapacity?: boolean): {
638
+ ok: boolean;
639
+ error?: string;
640
+ };
641
+ private runContinuation;
642
+ private execute;
643
+ /** Returns an error message, or null on success. */
644
+ private runAgentStep;
645
+ /**
646
+ * Protocol-v2 sink for one agent session (R2 step 2.1): the runner's
647
+ * `onUiEvent` stream flows through here. Persisted snapshots ride the same
648
+ * NDJSON file as v1 (the store stamps `seq`/`ts`, `appendEvent` fans them
649
+ * out live too); coalesced `item.delta` flushes go out live-only via
650
+ * `emitEphemeral` — raw deltas never hit disk (spec §performance
651
+ * guardrails). One sink per session: cumulative usage dedup and the
652
+ * item-shape cache are session-scoped, like the mapper state feeding them.
653
+ */
654
+ private makeUiSink;
655
+ /** Native backend asks arrive before turn-end. Persist and park immediately
656
+ * so the cockpit shows attention and the run releases its workspace slot. */
657
+ private handleRunnerUiEvent;
658
+ /** Persist the invocation checkpoint before launching a runner. A throw or
659
+ * process exit before `turn.started` therefore leaves a durable mismatch. */
660
+ private beginUsageInvocation;
661
+ /** Fold backend-neutral completed-turn usage into the current step exactly
662
+ * once. Invocation/turn counters are written before the event reaches the
663
+ * NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
664
+ private recordUsageUiEvent;
665
+ /** Usage completeness is a crash boundary, unlike high-frequency token
666
+ * snapshots: the checkpoint must reach `runs.json` before the runner starts
667
+ * or the matching UI event is persisted and forwarded. */
668
+ private persistUsageCheckpoint;
669
+ /**
670
+ * Turn-end bookkeeping (#389), shared by `runAgentStep` and
671
+ * `runContinuation` — called (fire-and-forget) from every `turn-end` event:
672
+ *
673
+ * - `titleSummary`: derived from the turn's text, set ONCE — only while the
674
+ * record has none. A user's inline edit also lands in `titleSummary`
675
+ * (see `PATCH /api/runs/:id`), so an edit is never overwritten either.
676
+ * - `diffStat`: cheap `git diff --shortstat` vs the base, refreshed every
677
+ * turn. Async and best-effort — a git failure becomes at most a `note`
678
+ * event, NEVER a run failure. `updateRun` fans the record out over SSE,
679
+ * so the list views pick both up with no extra wiring.
680
+ *
681
+ * Not `private` so the integration tests can drive a turn-end directly —
682
+ * a real agent session is the only other way to reach this path.
683
+ */
684
+ /**
685
+ * The namer's apply path (task auto-naming spec). Fire-and-forget: called
686
+ * without await from `startRun` (creation) and `recordTurnEnd` (live
687
+ * refresh). A user-owned title (`titleOrigin: 'user'`) is never overwritten;
688
+ * namer-owned titles may be replaced by fresher namer results.
689
+ */
690
+ private autoNameRun;
691
+ recordTurnEnd(runId: string, turnText: string): Promise<void>;
692
+ /**
693
+ * In-band declarations from the finished turn (spec
694
+ * 2026-07-18-task-ref-markers): the main thread's own `XEZ:PR=` /
695
+ * `XEZ:ISSUE=` / `XEZ:TITLE=` lines, parsed from the accumulated turn text
696
+ * like `XEZ:DONE` — never from tool output. Declared numbers overwrite the
697
+ * regex/namer display tier (the store re-resolves the referenced-PR chip);
698
+ * a declared title takes `titleOrigin: 'marker'`, which beats the namer but
699
+ * never a user rename, and silences the live refresh below.
700
+ */
701
+ private applyTurnMarkers;
702
+ /**
703
+ * Live title refresh (task auto-naming spec, step 3): re-run the namer with
704
+ * the turn's context. Skips: toggle off (`liveTitleUpdates` config over
705
+ * `XEZ_TITLE_UPDATES` env, default ON), user-owned title, marker-owned title
706
+ * (the agent declares via `XEZ:TITLE` — the token-saving fast path), dry-run
707
+ * mocks (canned answers add nothing), empty turn text, unchanged namer inputs.
708
+ */
709
+ private maybeRefreshTitle;
710
+ /**
711
+ * End-of-session telemetry (#348): stop sampling the run's process tree and
712
+ * fold the session's peaks into the run record. `max` with existing values —
713
+ * a run can hold several sessions (multiple agent steps, Continue) and the
714
+ * record keeps the highest water mark across all of them.
715
+ */
716
+ private recordUsagePeaks;
717
+ /**
718
+ * Diff-first review gate (spec 009), shared by `execute` and
719
+ * `runContinuation`: a *successful* run whose worktree holds changes rests
720
+ * at `review` instead of `done` — the user inspects the diff first, then
721
+ * sends feedback back, opens a draft PR, or just finishes. Failed/cancelled
722
+ * runs never enter review; no worktree or an empty diff means plain `done`.
723
+ *
724
+ * The gate is opt-in (#489): the review park happens only when it is enabled
725
+ * (`reviewGateEnabled` — config toggle over the `XEZ_REVIEW_GATE` env, default
726
+ * OFF) AND the run is not autonomous. Autonomous runs — and runs with the gate
727
+ * off — settle straight to `done`, leaving the diff in the worktree untouched.
728
+ */
729
+ private settleSuccess;
730
+ /**
731
+ * Persist every attachment a user message carries — images and files alike (#950) — into the
732
+ * run's own attachment folder, in the order they were attached. The returned paths are what the
733
+ * agent is told about; the caller decides which of them also ride along as viewable blocks.
734
+ */
735
+ private persistPastedAttachments;
736
+ /**
737
+ * Agent screenshot (an image block inside a tool result) or a user attachment —
738
+ * a pasted screenshot, or since #950 a PDF/TXT/MD file: the base64 data never
739
+ * enters the NDJSON event log — it lands as a file under
740
+ * `.ai/xezar/runs/<id>-images/` and the transcript event carries only the name +
741
+ * serving URL. `namePrefix` distinguishes the two origins on disk
742
+ * (`screenshot-<n>.<ext>` for agent tool screenshots, `pasted-<n>.<ext>` for user
743
+ * attachments, #357) and the absolute `path` lets the agent operate on the file
744
+ * directly (save/attach/upload) — for a non-image attachment that path is the ONLY
745
+ * way it ever reaches the agent.
746
+ * Best effort: on failure the attachment is dropped, the transcript still
747
+ * shows the tool result's `[screenshot]` placeholder (or the image count).
748
+ */
749
+ private persistAttachment;
750
+ private armIdleTimer;
751
+ private clearIdleTimer;
752
+ private reconcileMonitoringWakeTimers;
753
+ private armMonitoringWakeTimer;
754
+ private clearMonitoringWakeTimer;
755
+ /** Autosave-commit the worktree every 90 s while the run lives (spec 006).
756
+ * Opt-in via XEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
757
+ private armAutosave;
758
+ private clearAutosaveTimer;
759
+ private runCheckStep;
760
+ private finishStep;
761
+ }
762
+ /**
763
+ * Immediate title shown while a run is queued. The namer's `titleSummary`
764
+ * replaces it once the model answers; this is the honest, permanent fallback
765
+ * when no model is available (#432, spec 2026-07-17-task-auto-naming). When
766
+ * the task references a PR/issue, the number leads: `469: /om-auto-review-pr`.
767
+ */
768
+ export declare function makeRunTitle(task: string, workflow: WorkflowDef): string;
769
+ /**
770
+ * Skill identity is context, while the Markdown body remains instructions.
771
+ *
772
+ * For an on-disk skill we also hand the agent the ABSOLUTE directory of the
773
+ * installed copy. A run executes in an isolated worktree that has no local
774
+ * `.agents/skills` (gitignored, absent in a fresh checkout), so without this
775
+ * the agent cannot read the skill's companion files (`references/*.md`) — or,
776
+ * worse, reads a stale copy materialized from the team-repo cache. The path
777
+ * resolves against the MAIN project root (`discoverSkills(repoRoot)`), i.e. the
778
+ * current `npx skills`-installed copy, so a worktree agent and the main
779
+ * checkout read the exact same, up-to-date files. Team skills are omitted here:
780
+ * they are materialized into the worktree separately (see the call site).
781
+ */
782
+ export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
783
+ /**
784
+ * Expand a registry-backed slash skill in one prompt string before it reaches a
785
+ * backend. Claude otherwise intercepts an unknown leading slash command, and
786
+ * Codex/OpenCode have no native slash-skill lookup at all (#676).
787
+ *
788
+ * Only a match at character zero counts, and unknown commands pass through
789
+ * byte-for-byte — a backend's OWN slash commands must keep working. The caller
790
+ * persists the original user text before applying this delivery-only rewrite.
791
+ *
792
+ * Both delivery seams route through here: live-session messages via
793
+ * `expandRegistrySlashSkill`, and a continuation's opening prompt, which becomes
794
+ * the session's `userPrompt` and never passes through `deliverMessage` at all
795
+ * (#811).
796
+ */
797
+ export declare function expandRegistrySlashSkillText(text: string, skills: readonly Skill[]): string;
798
+ /**
799
+ * `expandRegistrySlashSkillText` over a live chat message: only the first text
800
+ * block is eligible, and an unchanged block returns the caller's array
801
+ * identity untouched.
802
+ */
803
+ export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];