@hearsay-tools/squawk 0.0.0-stage → 0.17.0-dev.5682

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 (1976) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1846 -2
  3. package/dist/activity/demand.d.ts +21 -0
  4. package/dist/activity/demand.js +49 -0
  5. package/dist/activity/demand.js.map +1 -0
  6. package/dist/activity/publisher.d.ts +48 -0
  7. package/dist/activity/publisher.js +175 -0
  8. package/dist/activity/publisher.js.map +1 -0
  9. package/dist/activity/read-model.d.ts +50 -0
  10. package/dist/activity/read-model.js +143 -0
  11. package/dist/activity/read-model.js.map +1 -0
  12. package/dist/activity/requests.d.ts +27 -0
  13. package/dist/activity/requests.js +81 -0
  14. package/dist/activity/requests.js.map +1 -0
  15. package/dist/activity/text.d.ts +4 -0
  16. package/dist/activity/text.js +13 -0
  17. package/dist/activity/text.js.map +1 -0
  18. package/dist/activity/tool-activity.d.ts +87 -0
  19. package/dist/activity/tool-activity.js +250 -0
  20. package/dist/activity/tool-activity.js.map +1 -0
  21. package/dist/activity/wait.d.ts +19 -0
  22. package/dist/activity/wait.js +91 -0
  23. package/dist/activity/wait.js.map +1 -0
  24. package/dist/agent-config/account-identity.d.ts +28 -0
  25. package/dist/agent-config/account-identity.js +132 -0
  26. package/dist/agent-config/account-identity.js.map +1 -0
  27. package/dist/agent-config/catalog.d.ts +70 -0
  28. package/dist/agent-config/catalog.js +384 -0
  29. package/dist/agent-config/catalog.js.map +1 -0
  30. package/dist/agent-config/files.d.ts +42 -0
  31. package/dist/agent-config/files.js +115 -0
  32. package/dist/agent-config/files.js.map +1 -0
  33. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  34. package/dist/agent-config/model-settings/claude.js +11 -0
  35. package/dist/agent-config/model-settings/claude.js.map +1 -0
  36. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  37. package/dist/agent-config/model-settings/codex.js +16 -0
  38. package/dist/agent-config/model-settings/codex.js.map +1 -0
  39. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  40. package/dist/agent-config/model-settings/opencode.js +8 -0
  41. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  42. package/dist/agent-config/model-settings/pi.d.ts +2 -0
  43. package/dist/agent-config/model-settings/pi.js +38 -0
  44. package/dist/agent-config/model-settings/pi.js.map +1 -0
  45. package/dist/agent-config/model-settings/shared.d.ts +12 -0
  46. package/dist/agent-config/model-settings/shared.js +100 -0
  47. package/dist/agent-config/model-settings/shared.js.map +1 -0
  48. package/dist/agent-config/model-settings/types.d.ts +9 -0
  49. package/dist/agent-config/model-settings/types.js +2 -0
  50. package/dist/agent-config/model-settings/types.js.map +1 -0
  51. package/dist/agent-config/models.d.ts +9 -0
  52. package/dist/agent-config/models.js +40 -0
  53. package/dist/agent-config/models.js.map +1 -0
  54. package/dist/agent-config/seed.d.ts +15 -0
  55. package/dist/agent-config/seed.js +94 -0
  56. package/dist/agent-config/seed.js.map +1 -0
  57. package/dist/agent-config/service.d.ts +44 -0
  58. package/dist/agent-config/service.js +73 -0
  59. package/dist/agent-config/service.js.map +1 -0
  60. package/dist/agent-config/validate.d.ts +18 -0
  61. package/dist/agent-config/validate.js +82 -0
  62. package/dist/agent-config/validate.js.map +1 -0
  63. package/dist/application-update/bin-recovery.d.ts +5 -0
  64. package/dist/application-update/bin-recovery.js +96 -0
  65. package/dist/application-update/bin-recovery.js.map +1 -0
  66. package/dist/application-update/discovery.d.ts +23 -0
  67. package/dist/application-update/discovery.js +131 -0
  68. package/dist/application-update/discovery.js.map +1 -0
  69. package/dist/application-update/helper.d.ts +58 -0
  70. package/dist/application-update/helper.js +363 -0
  71. package/dist/application-update/helper.js.map +1 -0
  72. package/dist/application-update/launcher.d.ts +12 -0
  73. package/dist/application-update/launcher.js +61 -0
  74. package/dist/application-update/launcher.js.map +1 -0
  75. package/dist/application-update/lock.d.ts +4 -0
  76. package/dist/application-update/lock.js +70 -0
  77. package/dist/application-update/lock.js.map +1 -0
  78. package/dist/application-update/npm-process.d.ts +17 -0
  79. package/dist/application-update/npm-process.js +156 -0
  80. package/dist/application-update/npm-process.js.map +1 -0
  81. package/dist/application-update/runtime-layout.d.ts +20 -0
  82. package/dist/application-update/runtime-layout.js +91 -0
  83. package/dist/application-update/runtime-layout.js.map +1 -0
  84. package/dist/application-update/scoped-recovery.d.ts +32 -0
  85. package/dist/application-update/scoped-recovery.js +210 -0
  86. package/dist/application-update/scoped-recovery.js.map +1 -0
  87. package/dist/application-update/service.d.ts +86 -0
  88. package/dist/application-update/service.js +523 -0
  89. package/dist/application-update/service.js.map +1 -0
  90. package/dist/archive-on-merge-setting.d.ts +15 -0
  91. package/dist/archive-on-merge-setting.js +15 -0
  92. package/dist/archive-on-merge-setting.js.map +1 -0
  93. package/dist/artifacts/cli.d.ts +1 -0
  94. package/dist/artifacts/cli.js +54 -0
  95. package/dist/artifacts/cli.js.map +1 -0
  96. package/dist/artifacts/lifecycle.d.ts +4 -0
  97. package/dist/artifacts/lifecycle.js +42 -0
  98. package/dist/artifacts/lifecycle.js.map +1 -0
  99. package/dist/artifacts/reports-index.d.ts +46 -0
  100. package/dist/artifacts/reports-index.js +279 -0
  101. package/dist/artifacts/reports-index.js.map +1 -0
  102. package/dist/artifacts/reports-watch.d.ts +43 -0
  103. package/dist/artifacts/reports-watch.js +129 -0
  104. package/dist/artifacts/reports-watch.js.map +1 -0
  105. package/dist/artifacts/resolve.d.ts +18 -0
  106. package/dist/artifacts/resolve.js +129 -0
  107. package/dist/artifacts/resolve.js.map +1 -0
  108. package/dist/artifacts/store.d.ts +40 -0
  109. package/dist/artifacts/store.js +513 -0
  110. package/dist/artifacts/store.js.map +1 -0
  111. package/dist/automations/automation-cli.d.ts +61 -0
  112. package/dist/automations/automation-cli.js +519 -0
  113. package/dist/automations/automation-cli.js.map +1 -0
  114. package/dist/automations/builtin-skill.d.ts +7 -0
  115. package/dist/automations/builtin-skill.js +14 -0
  116. package/dist/automations/builtin-skill.js.map +1 -0
  117. package/dist/automations/coordinator.d.ts +53 -0
  118. package/dist/automations/coordinator.js +136 -0
  119. package/dist/automations/coordinator.js.map +1 -0
  120. package/dist/automations/github-baseline.d.ts +3 -0
  121. package/dist/automations/github-baseline.js +17 -0
  122. package/dist/automations/github-baseline.js.map +1 -0
  123. package/dist/automations/github-poller.d.ts +93 -0
  124. package/dist/automations/github-poller.js +303 -0
  125. package/dist/automations/github-poller.js.map +1 -0
  126. package/dist/automations/project-files.d.ts +6 -0
  127. package/dist/automations/project-files.js +43 -0
  128. package/dist/automations/project-files.js.map +1 -0
  129. package/dist/automations/prompts.d.ts +12 -0
  130. package/dist/automations/prompts.js +162 -0
  131. package/dist/automations/prompts.js.map +1 -0
  132. package/dist/automations/schedule-runner.d.ts +153 -0
  133. package/dist/automations/schedule-runner.js +529 -0
  134. package/dist/automations/schedule-runner.js.map +1 -0
  135. package/dist/automations/scheduler.d.ts +95 -0
  136. package/dist/automations/scheduler.js +462 -0
  137. package/dist/automations/scheduler.js.map +1 -0
  138. package/dist/automations/service.d.ts +793 -0
  139. package/dist/automations/service.js +444 -0
  140. package/dist/automations/service.js.map +1 -0
  141. package/dist/automations/store.d.ts +168 -0
  142. package/dist/automations/store.js +805 -0
  143. package/dist/automations/store.js.map +1 -0
  144. package/dist/automations/task-template.d.ts +59 -0
  145. package/dist/automations/task-template.js +285 -0
  146. package/dist/automations/task-template.js.map +1 -0
  147. package/dist/automations/tool-adapter.d.ts +6 -0
  148. package/dist/automations/tool-adapter.js +115 -0
  149. package/dist/automations/tool-adapter.js.map +1 -0
  150. package/dist/automations/types.d.ts +1 -0
  151. package/dist/automations/types.js +2 -0
  152. package/dist/automations/types.js.map +1 -0
  153. package/dist/autosave-cleanup.d.ts +26 -0
  154. package/dist/autosave-cleanup.js +87 -0
  155. package/dist/autosave-cleanup.js.map +1 -0
  156. package/dist/autosave-git.d.ts +23 -0
  157. package/dist/autosave-git.js +211 -0
  158. package/dist/autosave-git.js.map +1 -0
  159. package/dist/autosave-group.d.ts +8 -0
  160. package/dist/autosave-group.js +61 -0
  161. package/dist/autosave-group.js.map +1 -0
  162. package/dist/autosave-holders.d.ts +34 -0
  163. package/dist/autosave-holders.js +228 -0
  164. package/dist/autosave-holders.js.map +1 -0
  165. package/dist/autosave-windows.d.ts +25 -0
  166. package/dist/autosave-windows.js +170 -0
  167. package/dist/autosave-windows.js.map +1 -0
  168. package/dist/cez.d.ts +2 -0
  169. package/dist/cez.js +3 -0
  170. package/dist/cez.js.map +1 -0
  171. package/dist/cezarion.d.ts +2 -0
  172. package/dist/cezarion.js +3 -0
  173. package/dist/cezarion.js.map +1 -0
  174. package/dist/ci-wait/client.d.ts +28 -0
  175. package/dist/ci-wait/client.js +123 -0
  176. package/dist/ci-wait/client.js.map +1 -0
  177. package/dist/ci-wait/controller.d.ts +824 -0
  178. package/dist/ci-wait/controller.js +305 -0
  179. package/dist/ci-wait/controller.js.map +1 -0
  180. package/dist/ci-wait/errors.d.ts +35 -0
  181. package/dist/ci-wait/errors.js +273 -0
  182. package/dist/ci-wait/errors.js.map +1 -0
  183. package/dist/ci-wait/github.d.ts +105 -0
  184. package/dist/ci-wait/github.js +324 -0
  185. package/dist/ci-wait/github.js.map +1 -0
  186. package/dist/ci-wait/injection.d.ts +3 -0
  187. package/dist/ci-wait/injection.js +13 -0
  188. package/dist/ci-wait/injection.js.map +1 -0
  189. package/dist/ci-wait/mcp.d.ts +3 -0
  190. package/dist/ci-wait/mcp.js +30 -0
  191. package/dist/ci-wait/mcp.js.map +1 -0
  192. package/dist/ci-wait/merge-progress.d.ts +84 -0
  193. package/dist/ci-wait/merge-progress.js +50 -0
  194. package/dist/ci-wait/merge-progress.js.map +1 -0
  195. package/dist/ci-wait/progress.d.ts +56 -0
  196. package/dist/ci-wait/progress.js +100 -0
  197. package/dist/ci-wait/progress.js.map +1 -0
  198. package/dist/ci-wait/resources.d.ts +9 -0
  199. package/dist/ci-wait/resources.js +46 -0
  200. package/dist/ci-wait/resources.js.map +1 -0
  201. package/dist/ci-wait/supervisor.d.ts +47 -0
  202. package/dist/ci-wait/supervisor.js +334 -0
  203. package/dist/ci-wait/supervisor.js.map +1 -0
  204. package/dist/ci-wait/text.d.ts +2 -0
  205. package/dist/ci-wait/text.js +5 -0
  206. package/dist/ci-wait/text.js.map +1 -0
  207. package/dist/ci-wait/tools.d.ts +845 -0
  208. package/dist/ci-wait/tools.js +232 -0
  209. package/dist/ci-wait/tools.js.map +1 -0
  210. package/dist/cli-dispatch.d.ts +33 -0
  211. package/dist/cli-dispatch.js +239 -0
  212. package/dist/cli-dispatch.js.map +1 -0
  213. package/dist/config.d.ts +117 -0
  214. package/dist/config.js +343 -0
  215. package/dist/config.js.map +1 -0
  216. package/dist/contract/active-provider.d.ts +12 -0
  217. package/dist/contract/activity.d.ts +1478 -0
  218. package/dist/contract/agent-config.d.ts +160 -0
  219. package/dist/contract/agent-profiles.d.ts +369 -0
  220. package/dist/contract/application-update.d.ts +32 -0
  221. package/dist/contract/artifacts.d.ts +100 -0
  222. package/dist/contract/ask-schema.d.ts +50 -0
  223. package/dist/contract/ask.d.ts +11 -0
  224. package/dist/contract/attachments.d.ts +35 -0
  225. package/dist/contract/attention.d.ts +99 -0
  226. package/dist/contract/automation-requests.d.ts +314 -0
  227. package/dist/contract/automation-schedule.d.ts +89 -0
  228. package/dist/contract/automation-storage.d.ts +518 -0
  229. package/dist/contract/automations.d.ts +1560 -0
  230. package/dist/contract/ci-wait.d.ts +281 -0
  231. package/dist/contract/config-requests.d.ts +36 -0
  232. package/dist/contract/control-locations.d.ts +10 -0
  233. package/dist/contract/conversations.d.ts +415 -0
  234. package/dist/contract/defined.d.ts +8 -0
  235. package/dist/contract/delegation.d.ts +2168 -0
  236. package/dist/contract/discovery.d.ts +228 -0
  237. package/dist/contract/effort.d.ts +18 -0
  238. package/dist/contract/events.d.ts +324 -0
  239. package/dist/contract/github-requests.d.ts +26 -0
  240. package/dist/contract/github.d.ts +732 -0
  241. package/dist/contract/handoff.d.ts +43 -0
  242. package/dist/contract/health.d.ts +128 -0
  243. package/dist/contract/home-recovery.d.ts +71 -0
  244. package/dist/contract/image-path.d.ts +6 -0
  245. package/dist/contract/index.d.ts +68 -0
  246. package/dist/contract/index.js +6709 -0
  247. package/dist/contract/live-coordination.d.ts +164 -0
  248. package/dist/contract/live-limits.d.ts +8 -0
  249. package/dist/contract/live.d.ts +123 -0
  250. package/dist/contract/pending-ask.d.ts +58 -0
  251. package/dist/contract/per-runner-optional-strings.d.ts +10 -0
  252. package/dist/contract/permissions.d.ts +54 -0
  253. package/dist/contract/preview.d.ts +568 -0
  254. package/dist/contract/project-limits.d.ts +35 -0
  255. package/dist/contract/projects.d.ts +716 -0
  256. package/dist/contract/provider-requests.d.ts +77 -0
  257. package/dist/contract/query-requests.d.ts +52 -0
  258. package/dist/contract/repo-requests.d.ts +12 -0
  259. package/dist/contract/repo.d.ts +515 -0
  260. package/dist/contract/report-title.d.ts +3 -0
  261. package/dist/contract/reports.d.ts +101 -0
  262. package/dist/contract/run-labels.d.ts +8 -0
  263. package/dist/contract/run-limits.d.ts +8 -0
  264. package/dist/contract/run-predicates.d.ts +87 -0
  265. package/dist/contract/run-requests.d.ts +33 -0
  266. package/dist/contract/run-search.d.ts +193 -0
  267. package/dist/contract/runs.d.ts +7108 -0
  268. package/dist/contract/scheduled-tasks.d.ts +188 -0
  269. package/dist/contract/self-update.d.ts +255 -0
  270. package/dist/contract/skill-sources.d.ts +125 -0
  271. package/dist/contract/skills.d.ts +56 -0
  272. package/dist/contract/task-options.d.ts +18 -0
  273. package/dist/contract/team-skill-ref.d.ts +10 -0
  274. package/dist/contract/tool-display.d.ts +25 -0
  275. package/dist/contract/ui-state-requests.d.ts +60 -0
  276. package/dist/contract/version.d.ts +3 -0
  277. package/dist/contract/voice.d.ts +213 -0
  278. package/dist/contract/waits.d.ts +1996 -0
  279. package/dist/contract/workflow-file.d.ts +37 -0
  280. package/dist/contract/workflow-requests.d.ts +7 -0
  281. package/dist/contract/workflows.d.ts +250 -0
  282. package/dist/contract/workspace-events.d.ts +410 -0
  283. package/dist/contract/workspace.d.ts +631 -0
  284. package/dist/contract/zoned-time.d.ts +26 -0
  285. package/dist/core/agent-env.d.ts +34 -0
  286. package/dist/core/agent-env.js +411 -0
  287. package/dist/core/agent-env.js.map +1 -0
  288. package/dist/core/agent-model-policy.d.ts +11 -0
  289. package/dist/core/agent-model-policy.js +38 -0
  290. package/dist/core/agent-model-policy.js.map +1 -0
  291. package/dist/core/agent-profiles.d.ts +50 -0
  292. package/dist/core/agent-profiles.js +105 -0
  293. package/dist/core/agent-profiles.js.map +1 -0
  294. package/dist/core/agent-runner.d.ts +425 -0
  295. package/dist/core/agent-runner.js +98 -0
  296. package/dist/core/agent-runner.js.map +1 -0
  297. package/dist/core/ask.d.ts +26 -0
  298. package/dist/core/ask.js +35 -0
  299. package/dist/core/ask.js.map +1 -0
  300. package/dist/core/backend-detect.d.ts +18 -0
  301. package/dist/core/backend-detect.js +216 -0
  302. package/dist/core/backend-detect.js.map +1 -0
  303. package/dist/core/claude-cli-runner.d.ts +85 -0
  304. package/dist/core/claude-cli-runner.js +899 -0
  305. package/dist/core/claude-cli-runner.js.map +1 -0
  306. package/dist/core/claude-executable.d.ts +2 -0
  307. package/dist/core/claude-executable.js +15 -0
  308. package/dist/core/claude-executable.js.map +1 -0
  309. package/dist/core/claude-model-catalog.d.ts +16 -0
  310. package/dist/core/claude-model-catalog.js +198 -0
  311. package/dist/core/claude-model-catalog.js.map +1 -0
  312. package/dist/core/claude-stream.d.ts +38 -0
  313. package/dist/core/claude-stream.js +77 -0
  314. package/dist/core/claude-stream.js.map +1 -0
  315. package/dist/core/claude-ui-mapper.d.ts +88 -0
  316. package/dist/core/claude-ui-mapper.js +851 -0
  317. package/dist/core/claude-ui-mapper.js.map +1 -0
  318. package/dist/core/codex-app-server-runner.d.ts +76 -0
  319. package/dist/core/codex-app-server-runner.js +1271 -0
  320. package/dist/core/codex-app-server-runner.js.map +1 -0
  321. package/dist/core/codex-app-server-transport.d.ts +52 -0
  322. package/dist/core/codex-app-server-transport.js +200 -0
  323. package/dist/core/codex-app-server-transport.js.map +1 -0
  324. package/dist/core/codex-approvals.d.ts +12 -0
  325. package/dist/core/codex-approvals.js +180 -0
  326. package/dist/core/codex-approvals.js.map +1 -0
  327. package/dist/core/codex-hook-mapper.d.ts +15 -0
  328. package/dist/core/codex-hook-mapper.js +73 -0
  329. package/dist/core/codex-hook-mapper.js.map +1 -0
  330. package/dist/core/codex-model-catalog.d.ts +10 -0
  331. package/dist/core/codex-model-catalog.js +110 -0
  332. package/dist/core/codex-model-catalog.js.map +1 -0
  333. package/dist/core/codex-native-frames.d.ts +35 -0
  334. package/dist/core/codex-native-frames.js +80 -0
  335. package/dist/core/codex-native-frames.js.map +1 -0
  336. package/dist/core/codex-permissions.d.ts +6 -0
  337. package/dist/core/codex-permissions.js +27 -0
  338. package/dist/core/codex-permissions.js.map +1 -0
  339. package/dist/core/codex-stream-error.d.ts +2 -0
  340. package/dist/core/codex-stream-error.js +12 -0
  341. package/dist/core/codex-stream-error.js.map +1 -0
  342. package/dist/core/codex-turn-outcome.d.ts +10 -0
  343. package/dist/core/codex-turn-outcome.js +35 -0
  344. package/dist/core/codex-turn-outcome.js.map +1 -0
  345. package/dist/core/codex-ui-mapper-state.d.ts +84 -0
  346. package/dist/core/codex-ui-mapper-state.js +8 -0
  347. package/dist/core/codex-ui-mapper-state.js.map +1 -0
  348. package/dist/core/codex-ui-mapper.d.ts +44 -0
  349. package/dist/core/codex-ui-mapper.js +799 -0
  350. package/dist/core/codex-ui-mapper.js.map +1 -0
  351. package/dist/core/cursor-cli-flags.d.ts +19 -0
  352. package/dist/core/cursor-cli-flags.js +47 -0
  353. package/dist/core/cursor-cli-flags.js.map +1 -0
  354. package/dist/core/cursor-config-options.d.ts +18 -0
  355. package/dist/core/cursor-config-options.js +31 -0
  356. package/dist/core/cursor-config-options.js.map +1 -0
  357. package/dist/core/cursor-model-catalog.d.ts +50 -0
  358. package/dist/core/cursor-model-catalog.js +306 -0
  359. package/dist/core/cursor-model-catalog.js.map +1 -0
  360. package/dist/core/cursor-print-capabilities.d.ts +14 -0
  361. package/dist/core/cursor-print-capabilities.js +169 -0
  362. package/dist/core/cursor-print-capabilities.js.map +1 -0
  363. package/dist/core/cursor-print-process.d.ts +31 -0
  364. package/dist/core/cursor-print-process.js +117 -0
  365. package/dist/core/cursor-print-process.js.map +1 -0
  366. package/dist/core/cursor-print-runner.d.ts +43 -0
  367. package/dist/core/cursor-print-runner.js +574 -0
  368. package/dist/core/cursor-print-runner.js.map +1 -0
  369. package/dist/core/cursor-print-tool-catalog.d.ts +3 -0
  370. package/dist/core/cursor-print-tool-catalog.js +13 -0
  371. package/dist/core/cursor-print-tool-catalog.js.map +1 -0
  372. package/dist/core/cursor-print-ui-mapper.d.ts +47 -0
  373. package/dist/core/cursor-print-ui-mapper.js +574 -0
  374. package/dist/core/cursor-print-ui-mapper.js.map +1 -0
  375. package/dist/core/cursor-provider-error.d.ts +9 -0
  376. package/dist/core/cursor-provider-error.js +15 -0
  377. package/dist/core/cursor-provider-error.js.map +1 -0
  378. package/dist/core/cursor-runner.d.ts +46 -0
  379. package/dist/core/cursor-runner.js +144 -0
  380. package/dist/core/cursor-runner.js.map +1 -0
  381. package/dist/core/defined.d.ts +1 -0
  382. package/dist/core/defined.js +2 -0
  383. package/dist/core/defined.js.map +1 -0
  384. package/dist/core/disclaim-spawn.d.ts +11 -0
  385. package/dist/core/disclaim-spawn.js +60 -0
  386. package/dist/core/disclaim-spawn.js.map +1 -0
  387. package/dist/core/edit-write-key.d.ts +2 -0
  388. package/dist/core/edit-write-key.js +6 -0
  389. package/dist/core/edit-write-key.js.map +1 -0
  390. package/dist/core/hook-items.d.ts +14 -0
  391. package/dist/core/hook-items.js +13 -0
  392. package/dist/core/hook-items.js.map +1 -0
  393. package/dist/core/host-model-catalog.d.ts +7 -0
  394. package/dist/core/host-model-catalog.js +21 -0
  395. package/dist/core/host-model-catalog.js.map +1 -0
  396. package/dist/core/input-submissions.d.ts +14 -0
  397. package/dist/core/input-submissions.js +26 -0
  398. package/dist/core/input-submissions.js.map +1 -0
  399. package/dist/core/managed-session.d.ts +6 -0
  400. package/dist/core/managed-session.js +116 -0
  401. package/dist/core/managed-session.js.map +1 -0
  402. package/dist/core/model-discovery-options.d.ts +8 -0
  403. package/dist/core/model-discovery-options.js +2 -0
  404. package/dist/core/model-discovery-options.js.map +1 -0
  405. package/dist/core/model-identity.d.ts +108 -0
  406. package/dist/core/model-identity.js +137 -0
  407. package/dist/core/model-identity.js.map +1 -0
  408. package/dist/core/model-presets.d.ts +10 -0
  409. package/dist/core/model-presets.js +77 -0
  410. package/dist/core/model-presets.js.map +1 -0
  411. package/dist/core/model-probe-teardown.d.ts +4 -0
  412. package/dist/core/model-probe-teardown.js +20 -0
  413. package/dist/core/model-probe-teardown.js.map +1 -0
  414. package/dist/core/ndjson.d.ts +6 -0
  415. package/dist/core/ndjson.js +23 -0
  416. package/dist/core/ndjson.js.map +1 -0
  417. package/dist/core/omp-model-catalog.d.ts +39 -0
  418. package/dist/core/omp-model-catalog.js +183 -0
  419. package/dist/core/omp-model-catalog.js.map +1 -0
  420. package/dist/core/omp-runner.d.ts +86 -0
  421. package/dist/core/omp-runner.js +818 -0
  422. package/dist/core/omp-runner.js.map +1 -0
  423. package/dist/core/omp-subagent-rows.d.ts +21 -0
  424. package/dist/core/omp-subagent-rows.js +99 -0
  425. package/dist/core/omp-subagent-rows.js.map +1 -0
  426. package/dist/core/omp-ui-mapper.d.ts +112 -0
  427. package/dist/core/omp-ui-mapper.js +807 -0
  428. package/dist/core/omp-ui-mapper.js.map +1 -0
  429. package/dist/core/opencode-model-catalog.d.ts +27 -0
  430. package/dist/core/opencode-model-catalog.js +189 -0
  431. package/dist/core/opencode-model-catalog.js.map +1 -0
  432. package/dist/core/opencode-permissions.d.ts +52 -0
  433. package/dist/core/opencode-permissions.js +101 -0
  434. package/dist/core/opencode-permissions.js.map +1 -0
  435. package/dist/core/opencode-runtime-config.d.ts +9 -0
  436. package/dist/core/opencode-runtime-config.js +26 -0
  437. package/dist/core/opencode-runtime-config.js.map +1 -0
  438. package/dist/core/opencode-server-runner.d.ts +75 -0
  439. package/dist/core/opencode-server-runner.js +1690 -0
  440. package/dist/core/opencode-server-runner.js.map +1 -0
  441. package/dist/core/opencode-session-error.d.ts +19 -0
  442. package/dist/core/opencode-session-error.js +42 -0
  443. package/dist/core/opencode-session-error.js.map +1 -0
  444. package/dist/core/opencode-task-scope.d.ts +9 -0
  445. package/dist/core/opencode-task-scope.js +19 -0
  446. package/dist/core/opencode-task-scope.js.map +1 -0
  447. package/dist/core/opencode-ui-mapper-state.d.ts +82 -0
  448. package/dist/core/opencode-ui-mapper-state.js +7 -0
  449. package/dist/core/opencode-ui-mapper-state.js.map +1 -0
  450. package/dist/core/opencode-ui-mapper.d.ts +59 -0
  451. package/dist/core/opencode-ui-mapper.js +724 -0
  452. package/dist/core/opencode-ui-mapper.js.map +1 -0
  453. package/dist/core/opencode-usage.d.ts +32 -0
  454. package/dist/core/opencode-usage.js +105 -0
  455. package/dist/core/opencode-usage.js.map +1 -0
  456. package/dist/core/pi-model-catalog.d.ts +34 -0
  457. package/dist/core/pi-model-catalog.js +247 -0
  458. package/dist/core/pi-model-catalog.js.map +1 -0
  459. package/dist/core/pi-rpc-turn.d.ts +179 -0
  460. package/dist/core/pi-rpc-turn.js +370 -0
  461. package/dist/core/pi-rpc-turn.js.map +1 -0
  462. package/dist/core/pi-rpc-wire.d.ts +31 -0
  463. package/dist/core/pi-rpc-wire.js +88 -0
  464. package/dist/core/pi-rpc-wire.js.map +1 -0
  465. package/dist/core/pi-runner.d.ts +58 -0
  466. package/dist/core/pi-runner.js +587 -0
  467. package/dist/core/pi-runner.js.map +1 -0
  468. package/dist/core/pi-ui-mapper.d.ts +52 -0
  469. package/dist/core/pi-ui-mapper.js +408 -0
  470. package/dist/core/pi-ui-mapper.js.map +1 -0
  471. package/dist/core/process-usage.d.ts +74 -0
  472. package/dist/core/process-usage.js +219 -0
  473. package/dist/core/process-usage.js.map +1 -0
  474. package/dist/core/product-env.d.ts +21 -0
  475. package/dist/core/product-env.js +38 -0
  476. package/dist/core/product-env.js.map +1 -0
  477. package/dist/core/provider-auth.d.ts +168 -0
  478. package/dist/core/provider-auth.js +661 -0
  479. package/dist/core/provider-auth.js.map +1 -0
  480. package/dist/core/provider-availability.d.ts +3 -0
  481. package/dist/core/provider-availability.js +14 -0
  482. package/dist/core/provider-availability.js.map +1 -0
  483. package/dist/core/runner-factory.d.ts +11 -0
  484. package/dist/core/runner-factory.js +36 -0
  485. package/dist/core/runner-factory.js.map +1 -0
  486. package/dist/core/runner-facts.d.ts +135 -0
  487. package/dist/core/runner-facts.js +59 -0
  488. package/dist/core/runner-facts.js.map +1 -0
  489. package/dist/core/runner-model-catalog.d.ts +34 -0
  490. package/dist/core/runner-model-catalog.js +109 -0
  491. package/dist/core/runner-model-catalog.js.map +1 -0
  492. package/dist/core/runner-runtime.d.ts +40 -0
  493. package/dist/core/runner-runtime.js +88 -0
  494. package/dist/core/runner-runtime.js.map +1 -0
  495. package/dist/core/runner-stderr.d.ts +2 -0
  496. package/dist/core/runner-stderr.js +20 -0
  497. package/dist/core/runner-stderr.js.map +1 -0
  498. package/dist/core/runner-tool-grants.d.ts +19 -0
  499. package/dist/core/runner-tool-grants.js +54 -0
  500. package/dist/core/runner-tool-grants.js.map +1 -0
  501. package/dist/core/secret-redaction.d.ts +20 -0
  502. package/dist/core/secret-redaction.js +95 -0
  503. package/dist/core/secret-redaction.js.map +1 -0
  504. package/dist/core/session-process.d.ts +43 -0
  505. package/dist/core/session-process.js +363 -0
  506. package/dist/core/session-process.js.map +1 -0
  507. package/dist/core/shell-env.d.ts +17 -0
  508. package/dist/core/shell-env.js +51 -0
  509. package/dist/core/shell-env.js.map +1 -0
  510. package/dist/core/ui-events.d.ts +356 -0
  511. package/dist/core/ui-events.js +13 -0
  512. package/dist/core/ui-events.js.map +1 -0
  513. package/dist/core/usage-limit.d.ts +42 -0
  514. package/dist/core/usage-limit.js +152 -0
  515. package/dist/core/usage-limit.js.map +1 -0
  516. package/dist/core/usage.d.ts +11 -0
  517. package/dist/core/usage.js +15 -0
  518. package/dist/core/usage.js.map +1 -0
  519. package/dist/core/v1-text-coalescer.d.ts +36 -0
  520. package/dist/core/v1-text-coalescer.js +72 -0
  521. package/dist/core/v1-text-coalescer.js.map +1 -0
  522. package/dist/data-gitignore.d.ts +6 -0
  523. package/dist/data-gitignore.js +80 -0
  524. package/dist/data-gitignore.js.map +1 -0
  525. package/dist/delegation/capacity.d.ts +15 -0
  526. package/dist/delegation/capacity.js +30 -0
  527. package/dist/delegation/capacity.js.map +1 -0
  528. package/dist/delegation/cli.d.ts +5 -0
  529. package/dist/delegation/cli.js +572 -0
  530. package/dist/delegation/cli.js.map +1 -0
  531. package/dist/delegation/context.d.ts +40 -0
  532. package/dist/delegation/context.js +398 -0
  533. package/dist/delegation/context.js.map +1 -0
  534. package/dist/delegation/conversation-send.d.ts +64 -0
  535. package/dist/delegation/conversation-send.js +74 -0
  536. package/dist/delegation/conversation-send.js.map +1 -0
  537. package/dist/delegation/conversations.d.ts +2186 -0
  538. package/dist/delegation/conversations.js +285 -0
  539. package/dist/delegation/conversations.js.map +1 -0
  540. package/dist/delegation/credentials.d.ts +21 -0
  541. package/dist/delegation/credentials.js +66 -0
  542. package/dist/delegation/credentials.js.map +1 -0
  543. package/dist/delegation/destroy-observation.d.ts +42 -0
  544. package/dist/delegation/destroy-observation.js +115 -0
  545. package/dist/delegation/destroy-observation.js.map +1 -0
  546. package/dist/delegation/effort.d.ts +1 -0
  547. package/dist/delegation/effort.js +11 -0
  548. package/dist/delegation/effort.js.map +1 -0
  549. package/dist/delegation/execution-identity.d.ts +257 -0
  550. package/dist/delegation/execution-identity.js +253 -0
  551. package/dist/delegation/execution-identity.js.map +1 -0
  552. package/dist/delegation/execution-settings.d.ts +11 -0
  553. package/dist/delegation/execution-settings.js +65 -0
  554. package/dist/delegation/execution-settings.js.map +1 -0
  555. package/dist/delegation/idle-test-app.d.ts +4 -0
  556. package/dist/delegation/idle-test-app.js +186 -0
  557. package/dist/delegation/idle-test-app.js.map +1 -0
  558. package/dist/delegation/input.d.ts +12 -0
  559. package/dist/delegation/input.js +50 -0
  560. package/dist/delegation/input.js.map +1 -0
  561. package/dist/delegation/park-notice.d.ts +45 -0
  562. package/dist/delegation/park-notice.js +81 -0
  563. package/dist/delegation/park-notice.js.map +1 -0
  564. package/dist/delegation/policy.d.ts +27 -0
  565. package/dist/delegation/policy.js +110 -0
  566. package/dist/delegation/policy.js.map +1 -0
  567. package/dist/delegation/process-liveness.d.ts +98 -0
  568. package/dist/delegation/process-liveness.js +213 -0
  569. package/dist/delegation/process-liveness.js.map +1 -0
  570. package/dist/delegation/provision.d.ts +36 -0
  571. package/dist/delegation/provision.js +218 -0
  572. package/dist/delegation/provision.js.map +1 -0
  573. package/dist/delegation/questions.d.ts +24 -0
  574. package/dist/delegation/questions.js +56 -0
  575. package/dist/delegation/questions.js.map +1 -0
  576. package/dist/delegation/readiness.d.ts +13 -0
  577. package/dist/delegation/readiness.js +19 -0
  578. package/dist/delegation/readiness.js.map +1 -0
  579. package/dist/delegation/results.d.ts +13 -0
  580. package/dist/delegation/results.js +153 -0
  581. package/dist/delegation/results.js.map +1 -0
  582. package/dist/delegation/retry-backoff.d.ts +31 -0
  583. package/dist/delegation/retry-backoff.js +26 -0
  584. package/dist/delegation/retry-backoff.js.map +1 -0
  585. package/dist/delegation/routes.d.ts +1017 -0
  586. package/dist/delegation/routes.js +85 -0
  587. package/dist/delegation/routes.js.map +1 -0
  588. package/dist/delegation/scratch-cleanup.d.ts +33 -0
  589. package/dist/delegation/scratch-cleanup.js +155 -0
  590. package/dist/delegation/scratch-cleanup.js.map +1 -0
  591. package/dist/delegation/service.d.ts +264 -0
  592. package/dist/delegation/service.js +807 -0
  593. package/dist/delegation/service.js.map +1 -0
  594. package/dist/delegation/task-discovery.d.ts +6 -0
  595. package/dist/delegation/task-discovery.js +27 -0
  596. package/dist/delegation/task-discovery.js.map +1 -0
  597. package/dist/delegation/transport.d.ts +995 -0
  598. package/dist/delegation/transport.js +22 -0
  599. package/dist/delegation/transport.js.map +1 -0
  600. package/dist/delegation/wait.d.ts +7 -0
  601. package/dist/delegation/wait.js +44 -0
  602. package/dist/delegation/wait.js.map +1 -0
  603. package/dist/delegation/windows-test-app.d.ts +5 -0
  604. package/dist/delegation/windows-test-app.js +64 -0
  605. package/dist/delegation/windows-test-app.js.map +1 -0
  606. package/dist/delegation/windows-workspace-identity.d.ts +3 -0
  607. package/dist/delegation/windows-workspace-identity.js +23 -0
  608. package/dist/delegation/windows-workspace-identity.js.map +1 -0
  609. package/dist/delegation/worker-cleanup.d.ts +53 -0
  610. package/dist/delegation/worker-cleanup.js +330 -0
  611. package/dist/delegation/worker-cleanup.js.map +1 -0
  612. package/dist/delegation/workspace.d.ts +40 -0
  613. package/dist/delegation/workspace.js +592 -0
  614. package/dist/delegation/workspace.js.map +1 -0
  615. package/dist/detached-process.d.ts +134 -0
  616. package/dist/detached-process.js +460 -0
  617. package/dist/detached-process.js.map +1 -0
  618. package/dist/discovery/catalog.d.ts +16 -0
  619. package/dist/discovery/catalog.js +31 -0
  620. package/dist/discovery/catalog.js.map +1 -0
  621. package/dist/discovery/cli.d.ts +8 -0
  622. package/dist/discovery/cli.js +122 -0
  623. package/dist/discovery/cli.js.map +1 -0
  624. package/dist/git-command.d.ts +7 -0
  625. package/dist/git-command.js +8 -0
  626. package/dist/git-command.js.map +1 -0
  627. package/dist/git-diff-base.d.ts +41 -0
  628. package/dist/git-diff-base.js +116 -0
  629. package/dist/git-diff-base.js.map +1 -0
  630. package/dist/git-index-copy.d.ts +4 -0
  631. package/dist/git-index-copy.js +10 -0
  632. package/dist/git-index-copy.js.map +1 -0
  633. package/dist/git-private-index.d.ts +11 -0
  634. package/dist/git-private-index.js +51 -0
  635. package/dist/git-private-index.js.map +1 -0
  636. package/dist/git-refs.d.ts +11 -0
  637. package/dist/git-refs.js +14 -0
  638. package/dist/git-refs.js.map +1 -0
  639. package/dist/git-worktree-lock-helper.d.ts +7 -0
  640. package/dist/git-worktree-lock-helper.js +178 -0
  641. package/dist/git-worktree-lock-helper.js.map +1 -0
  642. package/dist/git-worktree-lock.d.ts +17 -0
  643. package/dist/git-worktree-lock.js +90 -0
  644. package/dist/git-worktree-lock.js.map +1 -0
  645. package/dist/git-worktree-release.d.ts +20 -0
  646. package/dist/git-worktree-release.js +27 -0
  647. package/dist/git-worktree-release.js.map +1 -0
  648. package/dist/git-worktree.d.ts +148 -0
  649. package/dist/git-worktree.js +858 -0
  650. package/dist/git-worktree.js.map +1 -0
  651. package/dist/handoff.d.ts +72 -0
  652. package/dist/handoff.js +213 -0
  653. package/dist/handoff.js.map +1 -0
  654. package/dist/headless-run.d.ts +48 -0
  655. package/dist/headless-run.js +158 -0
  656. package/dist/headless-run.js.map +1 -0
  657. package/dist/home/boundary.d.ts +5 -0
  658. package/dist/home/boundary.js +76 -0
  659. package/dist/home/boundary.js.map +1 -0
  660. package/dist/home/changes.d.ts +3 -0
  661. package/dist/home/changes.js +11 -0
  662. package/dist/home/changes.js.map +1 -0
  663. package/dist/home/command.d.ts +9 -0
  664. package/dist/home/command.js +37 -0
  665. package/dist/home/command.js.map +1 -0
  666. package/dist/home/deprecation.d.ts +9 -0
  667. package/dist/home/deprecation.js +17 -0
  668. package/dist/home/deprecation.js.map +1 -0
  669. package/dist/home/display.d.ts +4 -0
  670. package/dist/home/display.js +11 -0
  671. package/dist/home/display.js.map +1 -0
  672. package/dist/home/entry-authorization.d.ts +17 -0
  673. package/dist/home/entry-authorization.js +39 -0
  674. package/dist/home/entry-authorization.js.map +1 -0
  675. package/dist/home/entry.d.ts +16 -0
  676. package/dist/home/entry.js +96 -0
  677. package/dist/home/entry.js.map +1 -0
  678. package/dist/home/file-location.d.ts +14 -0
  679. package/dist/home/file-location.js +24 -0
  680. package/dist/home/file-location.js.map +1 -0
  681. package/dist/home/home.d.ts +42 -0
  682. package/dist/home/home.js +70 -0
  683. package/dist/home/home.js.map +1 -0
  684. package/dist/home/identity.d.ts +22 -0
  685. package/dist/home/identity.js +25 -0
  686. package/dist/home/identity.js.map +1 -0
  687. package/dist/home/install-marker.d.ts +27 -0
  688. package/dist/home/install-marker.js +78 -0
  689. package/dist/home/install-marker.js.map +1 -0
  690. package/dist/home/kind-roots.d.ts +10 -0
  691. package/dist/home/kind-roots.js +36 -0
  692. package/dist/home/kind-roots.js.map +1 -0
  693. package/dist/home/leases.d.ts +14 -0
  694. package/dist/home/leases.js +55 -0
  695. package/dist/home/leases.js.map +1 -0
  696. package/dist/home/legacy-account-paths.d.ts +4 -0
  697. package/dist/home/legacy-account-paths.js +41 -0
  698. package/dist/home/legacy-account-paths.js.map +1 -0
  699. package/dist/home/legacy-merge.d.ts +3 -0
  700. package/dist/home/legacy-merge.js +45 -0
  701. package/dist/home/legacy-merge.js.map +1 -0
  702. package/dist/home/legacy-recovery.d.ts +5 -0
  703. package/dist/home/legacy-recovery.js +154 -0
  704. package/dist/home/legacy-recovery.js.map +1 -0
  705. package/dist/home/legacy-source.d.ts +15 -0
  706. package/dist/home/legacy-source.js +57 -0
  707. package/dist/home/legacy-source.js.map +1 -0
  708. package/dist/home/migrate.d.ts +19 -0
  709. package/dist/home/migrate.js +322 -0
  710. package/dist/home/migrate.js.map +1 -0
  711. package/dist/home/migration-account-source.d.ts +2 -0
  712. package/dist/home/migration-account-source.js +17 -0
  713. package/dist/home/migration-account-source.js.map +1 -0
  714. package/dist/home/migration-accounts.d.ts +23 -0
  715. package/dist/home/migration-accounts.js +174 -0
  716. package/dist/home/migration-accounts.js.map +1 -0
  717. package/dist/home/migration-boot.d.ts +23 -0
  718. package/dist/home/migration-boot.js +84 -0
  719. package/dist/home/migration-boot.js.map +1 -0
  720. package/dist/home/migration-claim.d.ts +4 -0
  721. package/dist/home/migration-claim.js +69 -0
  722. package/dist/home/migration-claim.js.map +1 -0
  723. package/dist/home/migration-cli.d.ts +3 -0
  724. package/dist/home/migration-cli.js +64 -0
  725. package/dist/home/migration-cli.js.map +1 -0
  726. package/dist/home/migration-files.d.ts +14 -0
  727. package/dist/home/migration-files.js +192 -0
  728. package/dist/home/migration-files.js.map +1 -0
  729. package/dist/home/migration-guard.d.ts +2 -0
  730. package/dist/home/migration-guard.js +20 -0
  731. package/dist/home/migration-guard.js.map +1 -0
  732. package/dist/home/migration-plan.d.ts +20 -0
  733. package/dist/home/migration-plan.js +71 -0
  734. package/dist/home/migration-plan.js.map +1 -0
  735. package/dist/home/migration-record.d.ts +79 -0
  736. package/dist/home/migration-record.js +39 -0
  737. package/dist/home/migration-record.js.map +1 -0
  738. package/dist/home/private-files.d.ts +13 -0
  739. package/dist/home/private-files.js +113 -0
  740. package/dist/home/private-files.js.map +1 -0
  741. package/dist/home/process-identity.d.ts +2 -0
  742. package/dist/home/process-identity.js +8 -0
  743. package/dist/home/process-identity.js.map +1 -0
  744. package/dist/home/protected-roots.d.ts +25 -0
  745. package/dist/home/protected-roots.js +91 -0
  746. package/dist/home/protected-roots.js.map +1 -0
  747. package/dist/home/recovery-watch.d.ts +3 -0
  748. package/dist/home/recovery-watch.js +75 -0
  749. package/dist/home/recovery-watch.js.map +1 -0
  750. package/dist/home/recovery.d.ts +10 -0
  751. package/dist/home/recovery.js +94 -0
  752. package/dist/home/recovery.js.map +1 -0
  753. package/dist/home/registry-content.d.ts +2 -0
  754. package/dist/home/registry-content.js +17 -0
  755. package/dist/home/registry-content.js.map +1 -0
  756. package/dist/home/reset-detection.d.ts +5 -0
  757. package/dist/home/reset-detection.js +22 -0
  758. package/dist/home/reset-detection.js.map +1 -0
  759. package/dist/home/resolve.d.ts +10 -0
  760. package/dist/home/resolve.js +28 -0
  761. package/dist/home/resolve.js.map +1 -0
  762. package/dist/home/store.d.ts +48 -0
  763. package/dist/home/store.js +324 -0
  764. package/dist/home/store.js.map +1 -0
  765. package/dist/home/switch.d.ts +2 -0
  766. package/dist/home/switch.js +3 -0
  767. package/dist/home/switch.js.map +1 -0
  768. package/dist/home/version-log.d.ts +48 -0
  769. package/dist/home/version-log.js +216 -0
  770. package/dist/home/version-log.js.map +1 -0
  771. package/dist/home/write-lock.d.ts +6 -0
  772. package/dist/home/write-lock.js +96 -0
  773. package/dist/home/write-lock.js.map +1 -0
  774. package/dist/hsq.d.ts +2 -0
  775. package/dist/hsq.js +3 -0
  776. package/dist/hsq.js.map +1 -0
  777. package/dist/index.d.ts +2 -0
  778. package/dist/index.js +123 -0
  779. package/dist/index.js.map +1 -0
  780. package/dist/install-as-command.d.ts +32 -0
  781. package/dist/install-as-command.js +55 -0
  782. package/dist/install-as-command.js.map +1 -0
  783. package/dist/jobs/cli.d.ts +2 -0
  784. package/dist/jobs/cli.js +53 -0
  785. package/dist/jobs/cli.js.map +1 -0
  786. package/dist/jobs/command.d.ts +9 -0
  787. package/dist/jobs/command.js +19 -0
  788. package/dist/jobs/command.js.map +1 -0
  789. package/dist/jobs/job.d.ts +77 -0
  790. package/dist/jobs/job.js +252 -0
  791. package/dist/jobs/job.js.map +1 -0
  792. package/dist/merge-observations.d.ts +13 -0
  793. package/dist/merge-observations.js +55 -0
  794. package/dist/merge-observations.js.map +1 -0
  795. package/dist/merged-streams.d.ts +13 -0
  796. package/dist/merged-streams.js +33 -0
  797. package/dist/merged-streams.js.map +1 -0
  798. package/dist/open-url.d.ts +2 -0
  799. package/dist/open-url.js +10 -0
  800. package/dist/open-url.js.map +1 -0
  801. package/dist/pack-check.d.ts +17 -0
  802. package/dist/pack-check.js +27 -0
  803. package/dist/pack-check.js.map +1 -0
  804. package/dist/paths.d.ts +118 -0
  805. package/dist/paths.js +192 -0
  806. package/dist/paths.js.map +1 -0
  807. package/dist/planner.d.ts +30 -0
  808. package/dist/planner.js +270 -0
  809. package/dist/planner.js.map +1 -0
  810. package/dist/preview/agent-address.d.ts +34 -0
  811. package/dist/preview/agent-address.js +52 -0
  812. package/dist/preview/agent-address.js.map +1 -0
  813. package/dist/preview/agent-marker.d.ts +17 -0
  814. package/dist/preview/agent-marker.js +71 -0
  815. package/dist/preview/agent-marker.js.map +1 -0
  816. package/dist/preview/browser-launch.d.ts +28 -0
  817. package/dist/preview/browser-launch.js +64 -0
  818. package/dist/preview/browser-launch.js.map +1 -0
  819. package/dist/preview/cdp-proxy.d.ts +54 -0
  820. package/dist/preview/cdp-proxy.js +152 -0
  821. package/dist/preview/cdp-proxy.js.map +1 -0
  822. package/dist/preview/cdp.d.ts +49 -0
  823. package/dist/preview/cdp.js +167 -0
  824. package/dist/preview/cdp.js.map +1 -0
  825. package/dist/preview/chromium-launch-progress.d.ts +10 -0
  826. package/dist/preview/chromium-launch-progress.js +48 -0
  827. package/dist/preview/chromium-launch-progress.js.map +1 -0
  828. package/dist/preview/chromium.d.ts +91 -0
  829. package/dist/preview/chromium.js +500 -0
  830. package/dist/preview/chromium.js.map +1 -0
  831. package/dist/preview/density.d.ts +17 -0
  832. package/dist/preview/density.js +62 -0
  833. package/dist/preview/density.js.map +1 -0
  834. package/dist/preview/dev-server.d.ts +68 -0
  835. package/dist/preview/dev-server.js +318 -0
  836. package/dist/preview/dev-server.js.map +1 -0
  837. package/dist/preview/host.d.ts +215 -0
  838. package/dist/preview/host.js +954 -0
  839. package/dist/preview/host.js.map +1 -0
  840. package/dist/preview/registration.d.ts +68 -0
  841. package/dist/preview/registration.js +111 -0
  842. package/dist/preview/registration.js.map +1 -0
  843. package/dist/preview/run-tools.d.ts +9 -0
  844. package/dist/preview/run-tools.js +72 -0
  845. package/dist/preview/run-tools.js.map +1 -0
  846. package/dist/preview/session.d.ts +139 -0
  847. package/dist/preview/session.js +479 -0
  848. package/dist/preview/session.js.map +1 -0
  849. package/dist/preview/url.d.ts +6 -0
  850. package/dist/preview/url.js +17 -0
  851. package/dist/preview/url.js.map +1 -0
  852. package/dist/process-wait/exit-file.d.ts +29 -0
  853. package/dist/process-wait/exit-file.js +67 -0
  854. package/dist/process-wait/exit-file.js.map +1 -0
  855. package/dist/process-wait/supervisor.d.ts +30 -0
  856. package/dist/process-wait/supervisor.js +71 -0
  857. package/dist/process-wait/supervisor.js.map +1 -0
  858. package/dist/project-commands.d.ts +14 -0
  859. package/dist/project-commands.js +91 -0
  860. package/dist/project-commands.js.map +1 -0
  861. package/dist/project-migration/answer.d.ts +23 -0
  862. package/dist/project-migration/answer.js +37 -0
  863. package/dist/project-migration/answer.js.map +1 -0
  864. package/dist/project-migration/auto.d.ts +73 -0
  865. package/dist/project-migration/auto.js +161 -0
  866. package/dist/project-migration/auto.js.map +1 -0
  867. package/dist/project-migration/cli.d.ts +18 -0
  868. package/dist/project-migration/cli.js +57 -0
  869. package/dist/project-migration/cli.js.map +1 -0
  870. package/dist/project-migration/containment.d.ts +52 -0
  871. package/dist/project-migration/containment.js +200 -0
  872. package/dist/project-migration/containment.js.map +1 -0
  873. package/dist/project-migration/durable.d.ts +25 -0
  874. package/dist/project-migration/durable.js +69 -0
  875. package/dist/project-migration/durable.js.map +1 -0
  876. package/dist/project-migration/engine.d.ts +47 -0
  877. package/dist/project-migration/engine.js +103 -0
  878. package/dist/project-migration/engine.js.map +1 -0
  879. package/dist/project-migration/fresh.d.ts +4 -0
  880. package/dist/project-migration/fresh.js +25 -0
  881. package/dist/project-migration/fresh.js.map +1 -0
  882. package/dist/project-migration/journal.d.ts +139 -0
  883. package/dist/project-migration/journal.js +69 -0
  884. package/dist/project-migration/journal.js.map +1 -0
  885. package/dist/project-migration/live.d.ts +48 -0
  886. package/dist/project-migration/live.js +148 -0
  887. package/dist/project-migration/live.js.map +1 -0
  888. package/dist/project-migration/offline.d.ts +25 -0
  889. package/dist/project-migration/offline.js +54 -0
  890. package/dist/project-migration/offline.js.map +1 -0
  891. package/dist/project-migration/plan.d.ts +91 -0
  892. package/dist/project-migration/plan.js +466 -0
  893. package/dist/project-migration/plan.js.map +1 -0
  894. package/dist/project-migration/recovery.d.ts +28 -0
  895. package/dist/project-migration/recovery.js +78 -0
  896. package/dist/project-migration/recovery.js.map +1 -0
  897. package/dist/project-migration/steps.d.ts +18 -0
  898. package/dist/project-migration/steps.js +312 -0
  899. package/dist/project-migration/steps.js.map +1 -0
  900. package/dist/project-paths.d.ts +61 -0
  901. package/dist/project-paths.js +185 -0
  902. package/dist/project-paths.js.map +1 -0
  903. package/dist/release/compatibility.d.ts +12 -0
  904. package/dist/release/compatibility.js +62 -0
  905. package/dist/release/compatibility.js.map +1 -0
  906. package/dist/release/manifests.d.ts +112 -0
  907. package/dist/release/manifests.js +104 -0
  908. package/dist/release/manifests.js.map +1 -0
  909. package/dist/release/publication.d.ts +3 -0
  910. package/dist/release/publication.js +34 -0
  911. package/dist/release/publication.js.map +1 -0
  912. package/dist/release/snapshot.d.ts +67 -0
  913. package/dist/release/snapshot.js +97 -0
  914. package/dist/release/snapshot.js.map +1 -0
  915. package/dist/release/stable.d.ts +38 -0
  916. package/dist/release/stable.js +55 -0
  917. package/dist/release/stable.js.map +1 -0
  918. package/dist/remote-settings-cli.d.ts +24 -0
  919. package/dist/remote-settings-cli.js +156 -0
  920. package/dist/remote-settings-cli.js.map +1 -0
  921. package/dist/remote-settings.d.ts +41 -0
  922. package/dist/remote-settings.js +110 -0
  923. package/dist/remote-settings.js.map +1 -0
  924. package/dist/runs/agent-tmpdir-removal.d.ts +15 -0
  925. package/dist/runs/agent-tmpdir-removal.js +60 -0
  926. package/dist/runs/agent-tmpdir-removal.js.map +1 -0
  927. package/dist/runs/agent-tmpdir.d.ts +119 -0
  928. package/dist/runs/agent-tmpdir.js +855 -0
  929. package/dist/runs/agent-tmpdir.js.map +1 -0
  930. package/dist/runs/archive-family.d.ts +33 -0
  931. package/dist/runs/archive-family.js +90 -0
  932. package/dist/runs/archive-family.js.map +1 -0
  933. package/dist/runs/arm-repo-handle.d.ts +10 -0
  934. package/dist/runs/arm-repo-handle.js +45 -0
  935. package/dist/runs/arm-repo-handle.js.map +1 -0
  936. package/dist/runs/auto-name.d.ts +77 -0
  937. package/dist/runs/auto-name.js +179 -0
  938. package/dist/runs/auto-name.js.map +1 -0
  939. package/dist/runs/claim-families.d.ts +37 -0
  940. package/dist/runs/claim-families.js +101 -0
  941. package/dist/runs/claim-families.js.map +1 -0
  942. package/dist/runs/client-request.d.ts +11 -0
  943. package/dist/runs/client-request.js +26 -0
  944. package/dist/runs/client-request.js.map +1 -0
  945. package/dist/runs/cold-reads.d.ts +40 -0
  946. package/dist/runs/cold-reads.js +56 -0
  947. package/dist/runs/cold-reads.js.map +1 -0
  948. package/dist/runs/conversation-identity.d.ts +19 -0
  949. package/dist/runs/conversation-identity.js +31 -0
  950. package/dist/runs/conversation-identity.js.map +1 -0
  951. package/dist/runs/delegation-state.d.ts +409 -0
  952. package/dist/runs/delegation-state.js +22 -0
  953. package/dist/runs/delegation-state.js.map +1 -0
  954. package/dist/runs/event-history-agent-context.d.ts +15 -0
  955. package/dist/runs/event-history-agent-context.js +119 -0
  956. package/dist/runs/event-history-agent-context.js.map +1 -0
  957. package/dist/runs/event-history-context.d.ts +15 -0
  958. package/dist/runs/event-history-context.js +109 -0
  959. package/dist/runs/event-history-context.js.map +1 -0
  960. package/dist/runs/event-history.d.ts +53 -0
  961. package/dist/runs/event-history.js +563 -0
  962. package/dist/runs/event-history.js.map +1 -0
  963. package/dist/runs/exit-events.d.ts +27 -0
  964. package/dist/runs/exit-events.js +46 -0
  965. package/dist/runs/exit-events.js.map +1 -0
  966. package/dist/runs/history-compressor.d.ts +29 -0
  967. package/dist/runs/history-compressor.js +116 -0
  968. package/dist/runs/history-compressor.js.map +1 -0
  969. package/dist/runs/history-file.d.ts +36 -0
  970. package/dist/runs/history-file.js +464 -0
  971. package/dist/runs/history-file.js.map +1 -0
  972. package/dist/runs/history-stream.d.ts +2 -0
  973. package/dist/runs/history-stream.js +62 -0
  974. package/dist/runs/history-stream.js.map +1 -0
  975. package/dist/runs/legacy-index.d.ts +49 -0
  976. package/dist/runs/legacy-index.js +156 -0
  977. package/dist/runs/legacy-index.js.map +1 -0
  978. package/dist/runs/legacy-run-rows.d.ts +12 -0
  979. package/dist/runs/legacy-run-rows.js +33 -0
  980. package/dist/runs/legacy-run-rows.js.map +1 -0
  981. package/dist/runs/legacy-waits.d.ts +64 -0
  982. package/dist/runs/legacy-waits.js +335 -0
  983. package/dist/runs/legacy-waits.js.map +1 -0
  984. package/dist/runs/live-item-snapshots.d.ts +15 -0
  985. package/dist/runs/live-item-snapshots.js +95 -0
  986. package/dist/runs/live-item-snapshots.js.map +1 -0
  987. package/dist/runs/loaded-run-exits.d.ts +6 -0
  988. package/dist/runs/loaded-run-exits.js +32 -0
  989. package/dist/runs/loaded-run-exits.js.map +1 -0
  990. package/dist/runs/loaded-run-healing.d.ts +3 -0
  991. package/dist/runs/loaded-run-healing.js +17 -0
  992. package/dist/runs/loaded-run-healing.js.map +1 -0
  993. package/dist/runs/outcome-commit.d.ts +119 -0
  994. package/dist/runs/outcome-commit.js +155 -0
  995. package/dist/runs/outcome-commit.js.map +1 -0
  996. package/dist/runs/owned-run-create.d.ts +33 -0
  997. package/dist/runs/owned-run-create.js +98 -0
  998. package/dist/runs/owned-run-create.js.map +1 -0
  999. package/dist/runs/project-run-connection.d.ts +76 -0
  1000. package/dist/runs/project-run-connection.js +287 -0
  1001. package/dist/runs/project-run-connection.js.map +1 -0
  1002. package/dist/runs/project-run-sources.d.ts +21 -0
  1003. package/dist/runs/project-run-sources.js +86 -0
  1004. package/dist/runs/project-run-sources.js.map +1 -0
  1005. package/dist/runs/pull-requests.d.ts +14 -0
  1006. package/dist/runs/pull-requests.js +96 -0
  1007. package/dist/runs/pull-requests.js.map +1 -0
  1008. package/dist/runs/raw-record.d.ts +40 -0
  1009. package/dist/runs/raw-record.js +133 -0
  1010. package/dist/runs/raw-record.js.map +1 -0
  1011. package/dist/runs/record-write-rules.d.ts +129 -0
  1012. package/dist/runs/record-write-rules.js +326 -0
  1013. package/dist/runs/record-write-rules.js.map +1 -0
  1014. package/dist/runs/report-rows.d.ts +36 -0
  1015. package/dist/runs/report-rows.js +102 -0
  1016. package/dist/runs/report-rows.js.map +1 -0
  1017. package/dist/runs/retention.d.ts +91 -0
  1018. package/dist/runs/retention.js +193 -0
  1019. package/dist/runs/retention.js.map +1 -0
  1020. package/dist/runs/review-gate.d.ts +18 -0
  1021. package/dist/runs/review-gate.js +22 -0
  1022. package/dist/runs/review-gate.js.map +1 -0
  1023. package/dist/runs/run-claims.d.ts +30 -0
  1024. package/dist/runs/run-claims.js +52 -0
  1025. package/dist/runs/run-claims.js.map +1 -0
  1026. package/dist/runs/run-database-peer-page.d.ts +12 -0
  1027. package/dist/runs/run-database-peer-page.js +25 -0
  1028. package/dist/runs/run-database-peer-page.js.map +1 -0
  1029. package/dist/runs/run-database-row.d.ts +39 -0
  1030. package/dist/runs/run-database-row.js +83 -0
  1031. package/dist/runs/run-database-row.js.map +1 -0
  1032. package/dist/runs/run-database-version.d.ts +14 -0
  1033. package/dist/runs/run-database-version.js +19 -0
  1034. package/dist/runs/run-database-version.js.map +1 -0
  1035. package/dist/runs/run-database.d.ts +389 -0
  1036. package/dist/runs/run-database.js +957 -0
  1037. package/dist/runs/run-database.js.map +1 -0
  1038. package/dist/runs/run-exits.d.ts +4510 -0
  1039. package/dist/runs/run-exits.js +191 -0
  1040. package/dist/runs/run-exits.js.map +1 -0
  1041. package/dist/runs/run-index.d.ts +36 -0
  1042. package/dist/runs/run-index.js +262 -0
  1043. package/dist/runs/run-index.js.map +1 -0
  1044. package/dist/runs/run-references.d.ts +61 -0
  1045. package/dist/runs/run-references.js +421 -0
  1046. package/dist/runs/run-references.js.map +1 -0
  1047. package/dist/runs/run-row.d.ts +14 -0
  1048. package/dist/runs/run-row.js +56 -0
  1049. package/dist/runs/run-row.js.map +1 -0
  1050. package/dist/runs/run-summary-page.d.ts +36 -0
  1051. package/dist/runs/run-summary-page.js +46 -0
  1052. package/dist/runs/run-summary-page.js.map +1 -0
  1053. package/dist/runs/run-title.d.ts +8 -0
  1054. package/dist/runs/run-title.js +28 -0
  1055. package/dist/runs/run-title.js.map +1 -0
  1056. package/dist/runs/store-open-error.d.ts +24 -0
  1057. package/dist/runs/store-open-error.js +62 -0
  1058. package/dist/runs/store-open-error.js.map +1 -0
  1059. package/dist/runs/store.d.ts +3974 -0
  1060. package/dist/runs/store.js +3516 -0
  1061. package/dist/runs/store.js.map +1 -0
  1062. package/dist/runs/task-markers.d.ts +29 -0
  1063. package/dist/runs/task-markers.js +78 -0
  1064. package/dist/runs/task-markers.js.map +1 -0
  1065. package/dist/runs/task-refs.d.ts +39 -0
  1066. package/dist/runs/task-refs.js +107 -0
  1067. package/dist/runs/task-refs.js.map +1 -0
  1068. package/dist/runs/transcript-facts-fold.d.ts +64 -0
  1069. package/dist/runs/transcript-facts-fold.js +109 -0
  1070. package/dist/runs/transcript-facts-fold.js.map +1 -0
  1071. package/dist/runs/transcript-facts-load.d.ts +11 -0
  1072. package/dist/runs/transcript-facts-load.js +66 -0
  1073. package/dist/runs/transcript-facts-load.js.map +1 -0
  1074. package/dist/runs/transcript-facts-queue.d.ts +30 -0
  1075. package/dist/runs/transcript-facts-queue.js +227 -0
  1076. package/dist/runs/transcript-facts-queue.js.map +1 -0
  1077. package/dist/runs/transcript-facts-worker.d.ts +15 -0
  1078. package/dist/runs/transcript-facts-worker.js +26 -0
  1079. package/dist/runs/transcript-facts-worker.js.map +1 -0
  1080. package/dist/runs/transcript-facts.d.ts +40 -0
  1081. package/dist/runs/transcript-facts.js +193 -0
  1082. package/dist/runs/transcript-facts.js.map +1 -0
  1083. package/dist/runs/ui-event-sink.d.ts +59 -0
  1084. package/dist/runs/ui-event-sink.js +197 -0
  1085. package/dist/runs/ui-event-sink.js.map +1 -0
  1086. package/dist/runs/wait-capacity.d.ts +8 -0
  1087. package/dist/runs/wait-capacity.js +28 -0
  1088. package/dist/runs/wait-capacity.js.map +1 -0
  1089. package/dist/runs/wait-phases.d.ts +4 -0
  1090. package/dist/runs/wait-phases.js +11 -0
  1091. package/dist/runs/wait-phases.js.map +1 -0
  1092. package/dist/runs/wait-registration-write.d.ts +5 -0
  1093. package/dist/runs/wait-registration-write.js +35 -0
  1094. package/dist/runs/wait-registration-write.js.map +1 -0
  1095. package/dist/runs/webhook.d.ts +193 -0
  1096. package/dist/runs/webhook.js +362 -0
  1097. package/dist/runs/webhook.js.map +1 -0
  1098. package/dist/runs/worker-deletion-proof.d.ts +13 -0
  1099. package/dist/runs/worker-deletion-proof.js +13 -0
  1100. package/dist/runs/worker-deletion-proof.js.map +1 -0
  1101. package/dist/runs/worker-execution.d.ts +22 -0
  1102. package/dist/runs/worker-execution.js +30 -0
  1103. package/dist/runs/worker-execution.js.map +1 -0
  1104. package/dist/runs/worker-resource-holders.d.ts +17 -0
  1105. package/dist/runs/worker-resource-holders.js +34 -0
  1106. package/dist/runs/worker-resource-holders.js.map +1 -0
  1107. package/dist/runs/worker-result-commit.d.ts +26 -0
  1108. package/dist/runs/worker-result-commit.js +121 -0
  1109. package/dist/runs/worker-result-commit.js.map +1 -0
  1110. package/dist/self-update/checkouts.d.ts +46 -0
  1111. package/dist/self-update/checkouts.js +284 -0
  1112. package/dist/self-update/checkouts.js.map +1 -0
  1113. package/dist/self-update/cli.d.ts +19 -0
  1114. package/dist/self-update/cli.js +243 -0
  1115. package/dist/self-update/cli.js.map +1 -0
  1116. package/dist/self-update/installer.d.ts +24 -0
  1117. package/dist/self-update/installer.js +139 -0
  1118. package/dist/self-update/installer.js.map +1 -0
  1119. package/dist/self-update/launcher.d.ts +30 -0
  1120. package/dist/self-update/launcher.js +172 -0
  1121. package/dist/self-update/launcher.js.map +1 -0
  1122. package/dist/self-update/layout.d.ts +108 -0
  1123. package/dist/self-update/layout.js +276 -0
  1124. package/dist/self-update/layout.js.map +1 -0
  1125. package/dist/self-update/pulls.d.ts +30 -0
  1126. package/dist/self-update/pulls.js +128 -0
  1127. package/dist/self-update/pulls.js.map +1 -0
  1128. package/dist/self-update/registry.d.ts +37 -0
  1129. package/dist/self-update/registry.js +86 -0
  1130. package/dist/self-update/registry.js.map +1 -0
  1131. package/dist/self-update/restart.d.ts +25 -0
  1132. package/dist/self-update/restart.js +79 -0
  1133. package/dist/self-update/restart.js.map +1 -0
  1134. package/dist/self-update/semver.d.ts +19 -0
  1135. package/dist/self-update/semver.js +79 -0
  1136. package/dist/self-update/semver.js.map +1 -0
  1137. package/dist/self-update/service.d.ts +115 -0
  1138. package/dist/self-update/service.js +332 -0
  1139. package/dist/self-update/service.js.map +1 -0
  1140. package/dist/self-update/supervisor.d.ts +10 -0
  1141. package/dist/self-update/supervisor.js +52 -0
  1142. package/dist/self-update/supervisor.js.map +1 -0
  1143. package/dist/serve-boot.d.ts +60 -0
  1144. package/dist/serve-boot.js +142 -0
  1145. package/dist/serve-boot.js.map +1 -0
  1146. package/dist/serve-command.d.ts +71 -0
  1147. package/dist/serve-command.js +168 -0
  1148. package/dist/serve-command.js.map +1 -0
  1149. package/dist/serve-listener.d.ts +12 -0
  1150. package/dist/serve-listener.js +52 -0
  1151. package/dist/serve-listener.js.map +1 -0
  1152. package/dist/server/activity-project-topic.d.ts +44 -0
  1153. package/dist/server/activity-project-topic.js +137 -0
  1154. package/dist/server/activity-project-topic.js.map +1 -0
  1155. package/dist/server/activity-routes.d.ts +317 -0
  1156. package/dist/server/activity-routes.js +117 -0
  1157. package/dist/server/activity-routes.js.map +1 -0
  1158. package/dist/server/activity-sources.d.ts +26 -0
  1159. package/dist/server/activity-sources.js +45 -0
  1160. package/dist/server/activity-sources.js.map +1 -0
  1161. package/dist/server/activity-topic.d.ts +33 -0
  1162. package/dist/server/activity-topic.js +48 -0
  1163. package/dist/server/activity-topic.js.map +1 -0
  1164. package/dist/server/app-type.d.ts +6 -0
  1165. package/dist/server/app-type.js +2 -0
  1166. package/dist/server/app-type.js.map +1 -0
  1167. package/dist/server/archive-on-merge.d.ts +45 -0
  1168. package/dist/server/archive-on-merge.js +242 -0
  1169. package/dist/server/archive-on-merge.js.map +1 -0
  1170. package/dist/server/automation-log-retry.d.ts +27 -0
  1171. package/dist/server/automation-log-retry.js +88 -0
  1172. package/dist/server/automation-log-retry.js.map +1 -0
  1173. package/dist/server/capabilities.d.ts +69 -0
  1174. package/dist/server/capabilities.js +111 -0
  1175. package/dist/server/capabilities.js.map +1 -0
  1176. package/dist/server/checkout-progress.d.ts +10 -0
  1177. package/dist/server/checkout-progress.js +27 -0
  1178. package/dist/server/checkout-progress.js.map +1 -0
  1179. package/dist/server/checkout.d.ts +153 -0
  1180. package/dist/server/checkout.js +323 -0
  1181. package/dist/server/checkout.js.map +1 -0
  1182. package/dist/server/cockpit-ownership.d.ts +112 -0
  1183. package/dist/server/cockpit-ownership.js +420 -0
  1184. package/dist/server/cockpit-ownership.js.map +1 -0
  1185. package/dist/server/cold-repo-handles.d.ts +17 -0
  1186. package/dist/server/cold-repo-handles.js +82 -0
  1187. package/dist/server/cold-repo-handles.js.map +1 -0
  1188. package/dist/server/completion-actions.d.ts +37 -0
  1189. package/dist/server/completion-actions.js +261 -0
  1190. package/dist/server/completion-actions.js.map +1 -0
  1191. package/dist/server/config-merge.d.ts +11 -0
  1192. package/dist/server/config-merge.js +74 -0
  1193. package/dist/server/config-merge.js.map +1 -0
  1194. package/dist/server/create-project.d.ts +71 -0
  1195. package/dist/server/create-project.js +467 -0
  1196. package/dist/server/create-project.js.map +1 -0
  1197. package/dist/server/forge/draft-pr.d.ts +8 -0
  1198. package/dist/server/forge/draft-pr.js +123 -0
  1199. package/dist/server/forge/draft-pr.js.map +1 -0
  1200. package/dist/server/forge/github-filters.d.ts +22 -0
  1201. package/dist/server/forge/github-filters.js +128 -0
  1202. package/dist/server/forge/github-filters.js.map +1 -0
  1203. package/dist/server/forge/github-merge-requirements.d.ts +18 -0
  1204. package/dist/server/forge/github-merge-requirements.js +148 -0
  1205. package/dist/server/forge/github-merge-requirements.js.map +1 -0
  1206. package/dist/server/forge/github-merge-state.d.ts +27 -0
  1207. package/dist/server/forge/github-merge-state.js +248 -0
  1208. package/dist/server/forge/github-merge-state.js.map +1 -0
  1209. package/dist/server/forge/github-timeline.d.ts +117 -0
  1210. package/dist/server/forge/github-timeline.js +273 -0
  1211. package/dist/server/forge/github-timeline.js.map +1 -0
  1212. package/dist/server/forge/github.d.ts +393 -0
  1213. package/dist/server/forge/github.js +2881 -0
  1214. package/dist/server/forge/github.js.map +1 -0
  1215. package/dist/server/forge/index.d.ts +47 -0
  1216. package/dist/server/forge/index.js +81 -0
  1217. package/dist/server/forge/index.js.map +1 -0
  1218. package/dist/server/forge/repo-handle-discovery.d.ts +16 -0
  1219. package/dist/server/forge/repo-handle-discovery.js +2 -0
  1220. package/dist/server/forge/repo-handle-discovery.js.map +1 -0
  1221. package/dist/server/forge/types.d.ts +278 -0
  1222. package/dist/server/forge/types.js +2 -0
  1223. package/dist/server/forge/types.js.map +1 -0
  1224. package/dist/server/fs-browse.d.ts +82 -0
  1225. package/dist/server/fs-browse.js +217 -0
  1226. package/dist/server/fs-browse.js.map +1 -0
  1227. package/dist/server/git-changes.d.ts +205 -0
  1228. package/dist/server/git-changes.js +531 -0
  1229. package/dist/server/git-changes.js.map +1 -0
  1230. package/dist/server/git.d.ts +52 -0
  1231. package/dist/server/git.js +174 -0
  1232. package/dist/server/git.js.map +1 -0
  1233. package/dist/server/home-recovery-routes.d.ts +171 -0
  1234. package/dist/server/home-recovery-routes.js +56 -0
  1235. package/dist/server/home-recovery-routes.js.map +1 -0
  1236. package/dist/server/launch-key.d.ts +5 -0
  1237. package/dist/server/launch-key.js +35 -0
  1238. package/dist/server/launch-key.js.map +1 -0
  1239. package/dist/server/live-routes.d.ts +73 -0
  1240. package/dist/server/live-routes.js +161 -0
  1241. package/dist/server/live-routes.js.map +1 -0
  1242. package/dist/server/open-in-app.d.ts +57 -0
  1243. package/dist/server/open-in-app.js +178 -0
  1244. package/dist/server/open-in-app.js.map +1 -0
  1245. package/dist/server/open-in-targets.d.ts +53 -0
  1246. package/dist/server/open-in-targets.js +112 -0
  1247. package/dist/server/open-in-targets.js.map +1 -0
  1248. package/dist/server/open-in-terminal.d.ts +73 -0
  1249. package/dist/server/open-in-terminal.js +160 -0
  1250. package/dist/server/open-in-terminal.js.map +1 -0
  1251. package/dist/server/preview-cdp-socket.d.ts +21 -0
  1252. package/dist/server/preview-cdp-socket.js +112 -0
  1253. package/dist/server/preview-cdp-socket.js.map +1 -0
  1254. package/dist/server/preview-socket.d.ts +36 -0
  1255. package/dist/server/preview-socket.js +142 -0
  1256. package/dist/server/preview-socket.js.map +1 -0
  1257. package/dist/server/preview-sockets.d.ts +14 -0
  1258. package/dist/server/preview-sockets.js +18 -0
  1259. package/dist/server/preview-sockets.js.map +1 -0
  1260. package/dist/server/project-context.d.ts +218 -0
  1261. package/dist/server/project-context.js +525 -0
  1262. package/dist/server/project-context.js.map +1 -0
  1263. package/dist/server/project-run-files.d.ts +13 -0
  1264. package/dist/server/project-run-files.js +52 -0
  1265. package/dist/server/project-run-files.js.map +1 -0
  1266. package/dist/server/provider-action-gate.d.ts +5 -0
  1267. package/dist/server/provider-action-gate.js +28 -0
  1268. package/dist/server/provider-action-gate.js.map +1 -0
  1269. package/dist/server/provider-auth-runtime.d.ts +34 -0
  1270. package/dist/server/provider-auth-runtime.js +118 -0
  1271. package/dist/server/provider-auth-runtime.js.map +1 -0
  1272. package/dist/server/repo-branch-forge.d.ts +61 -0
  1273. package/dist/server/repo-branch-forge.js +158 -0
  1274. package/dist/server/repo-branch-forge.js.map +1 -0
  1275. package/dist/server/repo-branch-sweep.d.ts +21 -0
  1276. package/dist/server/repo-branch-sweep.js +64 -0
  1277. package/dist/server/repo-branch-sweep.js.map +1 -0
  1278. package/dist/server/repo-branches.d.ts +103 -0
  1279. package/dist/server/repo-branches.js +804 -0
  1280. package/dist/server/repo-branches.js.map +1 -0
  1281. package/dist/server/repo-pull.d.ts +18 -0
  1282. package/dist/server/repo-pull.js +97 -0
  1283. package/dist/server/repo-pull.js.map +1 -0
  1284. package/dist/server/reports-api.d.ts +90 -0
  1285. package/dist/server/reports-api.js +21 -0
  1286. package/dist/server/reports-api.js.map +1 -0
  1287. package/dist/server/reports-topic.d.ts +5 -0
  1288. package/dist/server/reports-topic.js +37 -0
  1289. package/dist/server/reports-topic.js.map +1 -0
  1290. package/dist/server/run-checkout.d.ts +56 -0
  1291. package/dist/server/run-checkout.js +141 -0
  1292. package/dist/server/run-checkout.js.map +1 -0
  1293. package/dist/server/run-event-feed.d.ts +20 -0
  1294. package/dist/server/run-event-feed.js +203 -0
  1295. package/dist/server/run-event-feed.js.map +1 -0
  1296. package/dist/server/self-update-routes.d.ts +308 -0
  1297. package/dist/server/self-update-routes.js +80 -0
  1298. package/dist/server/self-update-routes.js.map +1 -0
  1299. package/dist/server/server-deps.d.ts +40 -0
  1300. package/dist/server/server-deps.js +132 -0
  1301. package/dist/server/server-deps.js.map +1 -0
  1302. package/dist/server/server.d.ts +35332 -0
  1303. package/dist/server/server.js +5046 -0
  1304. package/dist/server/server.js.map +1 -0
  1305. package/dist/server/skill-sources.d.ts +264 -0
  1306. package/dist/server/skill-sources.js +130 -0
  1307. package/dist/server/skill-sources.js.map +1 -0
  1308. package/dist/server/start-run-options.d.ts +84 -0
  1309. package/dist/server/start-run-options.js +114 -0
  1310. package/dist/server/start-run-options.js.map +1 -0
  1311. package/dist/server/static-ui.d.ts +49 -0
  1312. package/dist/server/static-ui.js +99 -0
  1313. package/dist/server/static-ui.js.map +1 -0
  1314. package/dist/server/upgrade-router.d.ts +23 -0
  1315. package/dist/server/upgrade-router.js +53 -0
  1316. package/dist/server/upgrade-router.js.map +1 -0
  1317. package/dist/server/validators.d.ts +80 -0
  1318. package/dist/server/validators.js +85 -0
  1319. package/dist/server/validators.js.map +1 -0
  1320. package/dist/server/workflow-files.d.ts +9 -0
  1321. package/dist/server/workflow-files.js +27 -0
  1322. package/dist/server/workflow-files.js.map +1 -0
  1323. package/dist/server/workspace-config-patch.d.ts +11 -0
  1324. package/dist/server/workspace-config-patch.js +75 -0
  1325. package/dist/server/workspace-config-patch.js.map +1 -0
  1326. package/dist/server/workspace-live-routes.d.ts +222 -0
  1327. package/dist/server/workspace-live-routes.js +8 -0
  1328. package/dist/server/workspace-live-routes.js.map +1 -0
  1329. package/dist/server/workspace-projects.d.ts +51 -0
  1330. package/dist/server/workspace-projects.js +161 -0
  1331. package/dist/server/workspace-projects.js.map +1 -0
  1332. package/dist/server/workspace-run-feed.d.ts +66 -0
  1333. package/dist/server/workspace-run-feed.js +171 -0
  1334. package/dist/server/workspace-run-feed.js.map +1 -0
  1335. package/dist/server/ws.d.ts +80 -0
  1336. package/dist/server/ws.js +280 -0
  1337. package/dist/server/ws.js.map +1 -0
  1338. package/dist/server/wsl.d.ts +25 -0
  1339. package/dist/server/wsl.js +92 -0
  1340. package/dist/server/wsl.js.map +1 -0
  1341. package/dist/server-command.d.ts +53 -0
  1342. package/dist/server-command.js +180 -0
  1343. package/dist/server-command.js.map +1 -0
  1344. package/dist/server-install/engine.d.ts +51 -0
  1345. package/dist/server-install/engine.js +358 -0
  1346. package/dist/server-install/engine.js.map +1 -0
  1347. package/dist/server-install/group-migrate.d.ts +26 -0
  1348. package/dist/server-install/group-migrate.js +241 -0
  1349. package/dist/server-install/group-migrate.js.map +1 -0
  1350. package/dist/server-install/migrate-cli.d.ts +12 -0
  1351. package/dist/server-install/migrate-cli.js +44 -0
  1352. package/dist/server-install/migrate-cli.js.map +1 -0
  1353. package/dist/server-install/migrate-journal.d.ts +15 -0
  1354. package/dist/server-install/migrate-journal.js +48 -0
  1355. package/dist/server-install/migrate-journal.js.map +1 -0
  1356. package/dist/server-install/migration-report.d.ts +3 -0
  1357. package/dist/server-install/migration-report.js +21 -0
  1358. package/dist/server-install/migration-report.js.map +1 -0
  1359. package/dist/server-install/npx-cache.d.ts +34 -0
  1360. package/dist/server-install/npx-cache.js +142 -0
  1361. package/dist/server-install/npx-cache.js.map +1 -0
  1362. package/dist/server-install/platforms/macosx-launchd-files.d.ts +11 -0
  1363. package/dist/server-install/platforms/macosx-launchd-files.js +60 -0
  1364. package/dist/server-install/platforms/macosx-launchd-files.js.map +1 -0
  1365. package/dist/server-install/platforms/macosx-migration.d.ts +17 -0
  1366. package/dist/server-install/platforms/macosx-migration.js +239 -0
  1367. package/dist/server-install/platforms/macosx-migration.js.map +1 -0
  1368. package/dist/server-install/platforms/macosx-ngrok.d.ts +12 -0
  1369. package/dist/server-install/platforms/macosx-ngrok.js +490 -0
  1370. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  1371. package/dist/server-install/platforms/service-env.d.ts +4 -0
  1372. package/dist/server-install/platforms/service-env.js +17 -0
  1373. package/dist/server-install/platforms/service-env.js.map +1 -0
  1374. package/dist/server-install/platforms/ubuntu-vps-files.d.ts +18 -0
  1375. package/dist/server-install/platforms/ubuntu-vps-files.js +43 -0
  1376. package/dist/server-install/platforms/ubuntu-vps-files.js.map +1 -0
  1377. package/dist/server-install/platforms/ubuntu-vps-migration.d.ts +26 -0
  1378. package/dist/server-install/platforms/ubuntu-vps-migration.js +391 -0
  1379. package/dist/server-install/platforms/ubuntu-vps-migration.js.map +1 -0
  1380. package/dist/server-install/platforms/ubuntu-vps-names.d.ts +30 -0
  1381. package/dist/server-install/platforms/ubuntu-vps-names.js +50 -0
  1382. package/dist/server-install/platforms/ubuntu-vps-names.js.map +1 -0
  1383. package/dist/server-install/platforms/ubuntu-vps-redeploy.d.ts +42 -0
  1384. package/dist/server-install/platforms/ubuntu-vps-redeploy.js +127 -0
  1385. package/dist/server-install/platforms/ubuntu-vps-redeploy.js.map +1 -0
  1386. package/dist/server-install/platforms/ubuntu-vps.d.ts +57 -0
  1387. package/dist/server-install/platforms/ubuntu-vps.js +945 -0
  1388. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  1389. package/dist/server-install/state.d.ts +51 -0
  1390. package/dist/server-install/state.js +178 -0
  1391. package/dist/server-install/state.js.map +1 -0
  1392. package/dist/server-install/steps.d.ts +108 -0
  1393. package/dist/server-install/steps.js +348 -0
  1394. package/dist/server-install/steps.js.map +1 -0
  1395. package/dist/server-install/strategies.d.ts +6 -0
  1396. package/dist/server-install/strategies.js +24 -0
  1397. package/dist/server-install/strategies.js.map +1 -0
  1398. package/dist/server-install/types.d.ts +316 -0
  1399. package/dist/server-install/types.js +118 -0
  1400. package/dist/server-install/types.js.map +1 -0
  1401. package/dist/server-install/ui.d.ts +36 -0
  1402. package/dist/server-install/ui.js +131 -0
  1403. package/dist/server-install/ui.js.map +1 -0
  1404. package/dist/session-context.d.ts +66 -0
  1405. package/dist/session-context.js +266 -0
  1406. package/dist/session-context.js.map +1 -0
  1407. package/dist/skills-provision.d.ts +64 -0
  1408. package/dist/skills-provision.js +325 -0
  1409. package/dist/skills-provision.js.map +1 -0
  1410. package/dist/skills-remote.d.ts +144 -0
  1411. package/dist/skills-remote.js +847 -0
  1412. package/dist/skills-remote.js.map +1 -0
  1413. package/dist/skills.d.ts +81 -0
  1414. package/dist/skills.js +288 -0
  1415. package/dist/skills.js.map +1 -0
  1416. package/dist/subcommands.d.ts +12 -0
  1417. package/dist/subcommands.js +59 -0
  1418. package/dist/subcommands.js.map +1 -0
  1419. package/dist/task-cli/cli.d.ts +39 -0
  1420. package/dist/task-cli/cli.js +773 -0
  1421. package/dist/task-cli/cli.js.map +1 -0
  1422. package/dist/task-cli/discovery.d.ts +32 -0
  1423. package/dist/task-cli/discovery.js +133 -0
  1424. package/dist/task-cli/discovery.js.map +1 -0
  1425. package/dist/task-cli/hint.d.ts +20 -0
  1426. package/dist/task-cli/hint.js +15 -0
  1427. package/dist/task-cli/hint.js.map +1 -0
  1428. package/dist/task-cli/http.d.ts +42 -0
  1429. package/dist/task-cli/http.js +110 -0
  1430. package/dist/task-cli/http.js.map +1 -0
  1431. package/dist/task-cli/projections.d.ts +68 -0
  1432. package/dist/task-cli/projections.js +76 -0
  1433. package/dist/task-cli/projections.js.map +1 -0
  1434. package/dist/task-cli/watch.d.ts +119 -0
  1435. package/dist/task-cli/watch.js +494 -0
  1436. package/dist/task-cli/watch.js.map +1 -0
  1437. package/dist/ui-state.d.ts +41 -0
  1438. package/dist/ui-state.js +93 -0
  1439. package/dist/ui-state.js.map +1 -0
  1440. package/dist/update-check.d.ts +2 -0
  1441. package/dist/update-check.js +28 -0
  1442. package/dist/update-check.js.map +1 -0
  1443. package/dist/use-command-notice.d.ts +1 -0
  1444. package/dist/use-command-notice.js +6 -0
  1445. package/dist/use-command-notice.js.map +1 -0
  1446. package/dist/voice/decide.d.ts +35 -0
  1447. package/dist/voice/decide.js +329 -0
  1448. package/dist/voice/decide.js.map +1 -0
  1449. package/dist/voice/decision-log.d.ts +48 -0
  1450. package/dist/voice/decision-log.js +117 -0
  1451. package/dist/voice/decision-log.js.map +1 -0
  1452. package/dist/voice/engine.d.ts +119 -0
  1453. package/dist/voice/engine.js +61 -0
  1454. package/dist/voice/engine.js.map +1 -0
  1455. package/dist/voice/fake-engine.d.ts +10 -0
  1456. package/dist/voice/fake-engine.js +192 -0
  1457. package/dist/voice/fake-engine.js.map +1 -0
  1458. package/dist/voice/jev-engine.d.ts +17 -0
  1459. package/dist/voice/jev-engine.js +110 -0
  1460. package/dist/voice/jev-engine.js.map +1 -0
  1461. package/dist/voice/pending-ask.d.ts +17 -0
  1462. package/dist/voice/pending-ask.js +51 -0
  1463. package/dist/voice/pending-ask.js.map +1 -0
  1464. package/dist/voice/routes.d.ts +115 -0
  1465. package/dist/voice/routes.js +92 -0
  1466. package/dist/voice/routes.js.map +1 -0
  1467. package/dist/voice/sentence.d.ts +21 -0
  1468. package/dist/voice/sentence.js +61 -0
  1469. package/dist/voice/sentence.js.map +1 -0
  1470. package/dist/voice/thresholds.d.ts +28 -0
  1471. package/dist/voice/thresholds.js +29 -0
  1472. package/dist/voice/thresholds.js.map +1 -0
  1473. package/dist/webhooks/cli.d.ts +18 -0
  1474. package/dist/webhooks/cli.js +127 -0
  1475. package/dist/webhooks/cli.js.map +1 -0
  1476. package/dist/webhooks/prompt.d.ts +5 -0
  1477. package/dist/webhooks/prompt.js +26 -0
  1478. package/dist/webhooks/prompt.js.map +1 -0
  1479. package/dist/workflows/active-run.d.ts +46 -0
  1480. package/dist/workflows/active-run.js +46 -0
  1481. package/dist/workflows/active-run.js.map +1 -0
  1482. package/dist/workflows/attachment-path.d.ts +6 -0
  1483. package/dist/workflows/attachment-path.js +40 -0
  1484. package/dist/workflows/attachment-path.js.map +1 -0
  1485. package/dist/workflows/completion-policy.d.ts +98 -0
  1486. package/dist/workflows/completion-policy.js +77 -0
  1487. package/dist/workflows/completion-policy.js.map +1 -0
  1488. package/dist/workflows/continuation-admission.d.ts +1229 -0
  1489. package/dist/workflows/continuation-admission.js +277 -0
  1490. package/dist/workflows/continuation-admission.js.map +1 -0
  1491. package/dist/workflows/execution-account.d.ts +13 -0
  1492. package/dist/workflows/execution-account.js +18 -0
  1493. package/dist/workflows/execution-account.js.map +1 -0
  1494. package/dist/workflows/grouped-command.d.ts +31 -0
  1495. package/dist/workflows/grouped-command.js +147 -0
  1496. package/dist/workflows/grouped-command.js.map +1 -0
  1497. package/dist/workflows/input-acknowledgement.d.ts +233 -0
  1498. package/dist/workflows/input-acknowledgement.js +41 -0
  1499. package/dist/workflows/input-acknowledgement.js.map +1 -0
  1500. package/dist/workflows/line-order.d.ts +5 -0
  1501. package/dist/workflows/line-order.js +25 -0
  1502. package/dist/workflows/line-order.js.map +1 -0
  1503. package/dist/workflows/load.d.ts +19 -0
  1504. package/dist/workflows/load.js +74 -0
  1505. package/dist/workflows/load.js.map +1 -0
  1506. package/dist/workflows/outcome-batches.d.ts +32 -0
  1507. package/dist/workflows/outcome-batches.js +55 -0
  1508. package/dist/workflows/outcome-batches.js.map +1 -0
  1509. package/dist/workflows/pasted-content.d.ts +60 -0
  1510. package/dist/workflows/pasted-content.js +69 -0
  1511. package/dist/workflows/pasted-content.js.map +1 -0
  1512. package/dist/workflows/question-routing.d.ts +16 -0
  1513. package/dist/workflows/question-routing.js +28 -0
  1514. package/dist/workflows/question-routing.js.map +1 -0
  1515. package/dist/workflows/run/attachment-writer.d.ts +34 -0
  1516. package/dist/workflows/run/attachment-writer.js +98 -0
  1517. package/dist/workflows/run/attachment-writer.js.map +1 -0
  1518. package/dist/workflows/run/auto-resume.d.ts +91 -0
  1519. package/dist/workflows/run/auto-resume.js +247 -0
  1520. package/dist/workflows/run/auto-resume.js.map +1 -0
  1521. package/dist/workflows/run/cezar-tools.d.ts +45 -0
  1522. package/dist/workflows/run/cezar-tools.js +117 -0
  1523. package/dist/workflows/run/cezar-tools.js.map +1 -0
  1524. package/dist/workflows/run/completion-gate.d.ts +77 -0
  1525. package/dist/workflows/run/completion-gate.js +93 -0
  1526. package/dist/workflows/run/completion-gate.js.map +1 -0
  1527. package/dist/workflows/run/compose.d.ts +181 -0
  1528. package/dist/workflows/run/compose.js +413 -0
  1529. package/dist/workflows/run/compose.js.map +1 -0
  1530. package/dist/workflows/run/constants.d.ts +48 -0
  1531. package/dist/workflows/run/constants.js +49 -0
  1532. package/dist/workflows/run/constants.js.map +1 -0
  1533. package/dist/workflows/run/continuation-acceptance.d.ts +70 -0
  1534. package/dist/workflows/run/continuation-acceptance.js +188 -0
  1535. package/dist/workflows/run/continuation-acceptance.js.map +1 -0
  1536. package/dist/workflows/run/continuation-session.d.ts +130 -0
  1537. package/dist/workflows/run/continuation-session.js +597 -0
  1538. package/dist/workflows/run/continuation-session.js.map +1 -0
  1539. package/dist/workflows/run/drop-active.d.ts +4 -0
  1540. package/dist/workflows/run/drop-active.js +11 -0
  1541. package/dist/workflows/run/drop-active.js.map +1 -0
  1542. package/dist/workflows/run/family-reconciler.d.ts +78 -0
  1543. package/dist/workflows/run/family-reconciler.js +308 -0
  1544. package/dist/workflows/run/family-reconciler.js.map +1 -0
  1545. package/dist/workflows/run/human-waits.d.ts +85 -0
  1546. package/dist/workflows/run/human-waits.js +163 -0
  1547. package/dist/workflows/run/human-waits.js.map +1 -0
  1548. package/dist/workflows/run/inbox-claims.d.ts +38 -0
  1549. package/dist/workflows/run/inbox-claims.js +108 -0
  1550. package/dist/workflows/run/inbox-claims.js.map +1 -0
  1551. package/dist/workflows/run/input-batch.d.ts +15 -0
  1552. package/dist/workflows/run/input-batch.js +32 -0
  1553. package/dist/workflows/run/input-batch.js.map +1 -0
  1554. package/dist/workflows/run/input-delivery.d.ts +202 -0
  1555. package/dist/workflows/run/input-delivery.js +818 -0
  1556. package/dist/workflows/run/input-delivery.js.map +1 -0
  1557. package/dist/workflows/run/input-receipts.d.ts +65 -0
  1558. package/dist/workflows/run/input-receipts.js +221 -0
  1559. package/dist/workflows/run/input-receipts.js.map +1 -0
  1560. package/dist/workflows/run/input-timers.d.ts +10 -0
  1561. package/dist/workflows/run/input-timers.js +32 -0
  1562. package/dist/workflows/run/input-timers.js.map +1 -0
  1563. package/dist/workflows/run/launch-context.d.ts +62 -0
  1564. package/dist/workflows/run/launch-context.js +119 -0
  1565. package/dist/workflows/run/launch-context.js.map +1 -0
  1566. package/dist/workflows/run/launch-read-resolver.d.ts +510 -0
  1567. package/dist/workflows/run/launch-read-resolver.js +658 -0
  1568. package/dist/workflows/run/launch-read-resolver.js.map +1 -0
  1569. package/dist/workflows/run/launch-settings.d.ts +10 -0
  1570. package/dist/workflows/run/launch-settings.js +11 -0
  1571. package/dist/workflows/run/launch-settings.js.map +1 -0
  1572. package/dist/workflows/run/live-session-state.d.ts +49 -0
  1573. package/dist/workflows/run/live-session-state.js +83 -0
  1574. package/dist/workflows/run/live-session-state.js.map +1 -0
  1575. package/dist/workflows/run/maintenance-claims.d.ts +47 -0
  1576. package/dist/workflows/run/maintenance-claims.js +83 -0
  1577. package/dist/workflows/run/maintenance-claims.js.map +1 -0
  1578. package/dist/workflows/run/memory-guard.d.ts +25 -0
  1579. package/dist/workflows/run/memory-guard.js +64 -0
  1580. package/dist/workflows/run/memory-guard.js.map +1 -0
  1581. package/dist/workflows/run/opening.d.ts +30 -0
  1582. package/dist/workflows/run/opening.js +6 -0
  1583. package/dist/workflows/run/opening.js.map +1 -0
  1584. package/dist/workflows/run/pending-ask-facts.d.ts +10 -0
  1585. package/dist/workflows/run/pending-ask-facts.js +19 -0
  1586. package/dist/workflows/run/pending-ask-facts.js.map +1 -0
  1587. package/dist/workflows/run/prompts.d.ts +74 -0
  1588. package/dist/workflows/run/prompts.js +140 -0
  1589. package/dist/workflows/run/prompts.js.map +1 -0
  1590. package/dist/workflows/run/queued-input.d.ts +108 -0
  1591. package/dist/workflows/run/queued-input.js +249 -0
  1592. package/dist/workflows/run/queued-input.js.map +1 -0
  1593. package/dist/workflows/run/queued-revival.d.ts +44 -0
  1594. package/dist/workflows/run/queued-revival.js +124 -0
  1595. package/dist/workflows/run/queued-revival.js.map +1 -0
  1596. package/dist/workflows/run/readonly-collections.d.ts +24 -0
  1597. package/dist/workflows/run/readonly-collections.js +33 -0
  1598. package/dist/workflows/run/readonly-collections.js.map +1 -0
  1599. package/dist/workflows/run/repo-root-lease.d.ts +34 -0
  1600. package/dist/workflows/run/repo-root-lease.js +71 -0
  1601. package/dist/workflows/run/repo-root-lease.js.map +1 -0
  1602. package/dist/workflows/run/resolved-wait-input-batch.d.ts +7 -0
  1603. package/dist/workflows/run/resolved-wait-input-batch.js +23 -0
  1604. package/dist/workflows/run/resolved-wait-input-batch.js.map +1 -0
  1605. package/dist/workflows/run/run-cancel.d.ts +36 -0
  1606. package/dist/workflows/run/run-cancel.js +130 -0
  1607. package/dist/workflows/run/run-cancel.js.map +1 -0
  1608. package/dist/workflows/run/run-finish.d.ts +72 -0
  1609. package/dist/workflows/run/run-finish.js +256 -0
  1610. package/dist/workflows/run/run-finish.js.map +1 -0
  1611. package/dist/workflows/run/run-guards.d.ts +15 -0
  1612. package/dist/workflows/run/run-guards.js +39 -0
  1613. package/dist/workflows/run/run-guards.js.map +1 -0
  1614. package/dist/workflows/run/run-line.d.ts +187 -0
  1615. package/dist/workflows/run/run-line.js +438 -0
  1616. package/dist/workflows/run/run-line.js.map +1 -0
  1617. package/dist/workflows/run/run-recovery.d.ts +116 -0
  1618. package/dist/workflows/run/run-recovery.js +422 -0
  1619. package/dist/workflows/run/run-recovery.js.map +1 -0
  1620. package/dist/workflows/run/run-settlement.d.ts +177 -0
  1621. package/dist/workflows/run/run-settlement.js +504 -0
  1622. package/dist/workflows/run/run-settlement.js.map +1 -0
  1623. package/dist/workflows/run/run-skills.d.ts +114 -0
  1624. package/dist/workflows/run/run-skills.js +233 -0
  1625. package/dist/workflows/run/run-skills.js.map +1 -0
  1626. package/dist/workflows/run/run-start.d.ts +64 -0
  1627. package/dist/workflows/run/run-start.js +126 -0
  1628. package/dist/workflows/run/run-start.js.map +1 -0
  1629. package/dist/workflows/run/run-workspace.d.ts +25 -0
  1630. package/dist/workflows/run/run-workspace.js +66 -0
  1631. package/dist/workflows/run/run-workspace.js.map +1 -0
  1632. package/dist/workflows/run/session-events.d.ts +155 -0
  1633. package/dist/workflows/run/session-events.js +282 -0
  1634. package/dist/workflows/run/session-events.js.map +1 -0
  1635. package/dist/workflows/run/step-decisions.d.ts +37 -0
  1636. package/dist/workflows/run/step-decisions.js +43 -0
  1637. package/dist/workflows/run/step-decisions.js.map +1 -0
  1638. package/dist/workflows/run/step-loop.d.ts +143 -0
  1639. package/dist/workflows/run/step-loop.js +488 -0
  1640. package/dist/workflows/run/step-loop.js.map +1 -0
  1641. package/dist/workflows/run/step-session.d.ts +65 -0
  1642. package/dist/workflows/run/step-session.js +280 -0
  1643. package/dist/workflows/run/step-session.js.map +1 -0
  1644. package/dist/workflows/run/steps.d.ts +13 -0
  1645. package/dist/workflows/run/steps.js +14 -0
  1646. package/dist/workflows/run/steps.js.map +1 -0
  1647. package/dist/workflows/run/subagent-waits.d.ts +138 -0
  1648. package/dist/workflows/run/subagent-waits.js +305 -0
  1649. package/dist/workflows/run/subagent-waits.js.map +1 -0
  1650. package/dist/workflows/run/tracked-work.d.ts +12 -0
  1651. package/dist/workflows/run/tracked-work.js +29 -0
  1652. package/dist/workflows/run/tracked-work.js.map +1 -0
  1653. package/dist/workflows/run/turn-bookkeeping.d.ts +67 -0
  1654. package/dist/workflows/run/turn-bookkeeping.js +173 -0
  1655. package/dist/workflows/run/turn-bookkeeping.js.map +1 -0
  1656. package/dist/workflows/run/turn-boundary.d.ts +215 -0
  1657. package/dist/workflows/run/turn-boundary.js +329 -0
  1658. package/dist/workflows/run/turn-boundary.js.map +1 -0
  1659. package/dist/workflows/run/turn-markers.d.ts +62 -0
  1660. package/dist/workflows/run/turn-markers.js +86 -0
  1661. package/dist/workflows/run/turn-markers.js.map +1 -0
  1662. package/dist/workflows/run/turn-nudges.d.ts +104 -0
  1663. package/dist/workflows/run/turn-nudges.js +244 -0
  1664. package/dist/workflows/run/turn-nudges.js.map +1 -0
  1665. package/dist/workflows/run/turn-settler.d.ts +161 -0
  1666. package/dist/workflows/run/turn-settler.js +469 -0
  1667. package/dist/workflows/run/turn-settler.js.map +1 -0
  1668. package/dist/workflows/run/types.d.ts +293 -0
  1669. package/dist/workflows/run/types.js +2 -0
  1670. package/dist/workflows/run/types.js.map +1 -0
  1671. package/dist/workflows/run/usage-accounting.d.ts +49 -0
  1672. package/dist/workflows/run/usage-accounting.js +213 -0
  1673. package/dist/workflows/run/usage-accounting.js.map +1 -0
  1674. package/dist/workflows/run/wait-engine.d.ts +1210 -0
  1675. package/dist/workflows/run/wait-engine.js +456 -0
  1676. package/dist/workflows/run/wait-engine.js.map +1 -0
  1677. package/dist/workflows/run/wait-kinds.d.ts +336 -0
  1678. package/dist/workflows/run/wait-kinds.js +471 -0
  1679. package/dist/workflows/run/wait-kinds.js.map +1 -0
  1680. package/dist/workflows/run/wait-registration-tool.d.ts +3 -0
  1681. package/dist/workflows/run/wait-registration-tool.js +68 -0
  1682. package/dist/workflows/run/wait-registration-tool.js.map +1 -0
  1683. package/dist/workflows/run/wait-registration.d.ts +7 -0
  1684. package/dist/workflows/run/wait-registration.js +39 -0
  1685. package/dist/workflows/run/wait-registration.js.map +1 -0
  1686. package/dist/workflows/run/wait-registry.d.ts +120 -0
  1687. package/dist/workflows/run/wait-registry.js +365 -0
  1688. package/dist/workflows/run/wait-registry.js.map +1 -0
  1689. package/dist/workflows/run/wait-watches.d.ts +13 -0
  1690. package/dist/workflows/run/wait-watches.js +12 -0
  1691. package/dist/workflows/run/wait-watches.js.map +1 -0
  1692. package/dist/workflows/run/wake-admission.d.ts +150 -0
  1693. package/dist/workflows/run/wake-admission.js +397 -0
  1694. package/dist/workflows/run/wake-admission.js.map +1 -0
  1695. package/dist/workflows/run/wake-ledger.d.ts +61 -0
  1696. package/dist/workflows/run/wake-ledger.js +78 -0
  1697. package/dist/workflows/run/wake-ledger.js.map +1 -0
  1698. package/dist/workflows/run/wake-retries.d.ts +31 -0
  1699. package/dist/workflows/run/wake-retries.js +93 -0
  1700. package/dist/workflows/run/wake-retries.js.map +1 -0
  1701. package/dist/workflows/run/worker-executions.d.ts +54 -0
  1702. package/dist/workflows/run/worker-executions.js +149 -0
  1703. package/dist/workflows/run/worker-executions.js.map +1 -0
  1704. package/dist/workflows/run/worker-orphans.d.ts +91 -0
  1705. package/dist/workflows/run/worker-orphans.js +275 -0
  1706. package/dist/workflows/run/worker-orphans.js.map +1 -0
  1707. package/dist/workflows/run/worker-questions.d.ts +169 -0
  1708. package/dist/workflows/run/worker-questions.js +464 -0
  1709. package/dist/workflows/run/worker-questions.js.map +1 -0
  1710. package/dist/workflows/run/workflow-position.d.ts +7 -0
  1711. package/dist/workflows/run/workflow-position.js +9 -0
  1712. package/dist/workflows/run/workflow-position.js.map +1 -0
  1713. package/dist/workflows/run/worktree-autosave.d.ts +48 -0
  1714. package/dist/workflows/run/worktree-autosave.js +175 -0
  1715. package/dist/workflows/run/worktree-autosave.js.map +1 -0
  1716. package/dist/workflows/run-scheduling.d.ts +38 -0
  1717. package/dist/workflows/run-scheduling.js +76 -0
  1718. package/dist/workflows/run-scheduling.js.map +1 -0
  1719. package/dist/workflows/run-states.d.ts +73 -0
  1720. package/dist/workflows/run-states.js +233 -0
  1721. package/dist/workflows/run-states.js.map +1 -0
  1722. package/dist/workflows/run.d.ts +275 -0
  1723. package/dist/workflows/run.js +626 -0
  1724. package/dist/workflows/run.js.map +1 -0
  1725. package/dist/workflows/turn-end.d.ts +119 -0
  1726. package/dist/workflows/turn-end.js +74 -0
  1727. package/dist/workflows/turn-end.js.map +1 -0
  1728. package/dist/workflows/types.d.ts +83 -0
  1729. package/dist/workflows/types.js +192 -0
  1730. package/dist/workflows/types.js.map +1 -0
  1731. package/dist/workflows/wait-scope.d.ts +75 -0
  1732. package/dist/workflows/wait-scope.js +115 -0
  1733. package/dist/workflows/wait-scope.js.map +1 -0
  1734. package/dist/workflows/waits.d.ts +58 -0
  1735. package/dist/workflows/waits.js +89 -0
  1736. package/dist/workflows/waits.js.map +1 -0
  1737. package/dist/workspace/agent-accounts.d.ts +135 -0
  1738. package/dist/workspace/agent-accounts.js +353 -0
  1739. package/dist/workspace/agent-accounts.js.map +1 -0
  1740. package/dist/workspace/agent-profiles.d.ts +125 -0
  1741. package/dist/workspace/agent-profiles.js +190 -0
  1742. package/dist/workspace/agent-profiles.js.map +1 -0
  1743. package/dist/workspace/backup-cli.d.ts +9 -0
  1744. package/dist/workspace/backup-cli.js +147 -0
  1745. package/dist/workspace/backup-cli.js.map +1 -0
  1746. package/dist/workspace/backups.d.ts +36 -0
  1747. package/dist/workspace/backups.js +249 -0
  1748. package/dist/workspace/backups.js.map +1 -0
  1749. package/dist/workspace/config.d.ts +179 -0
  1750. package/dist/workspace/config.js +396 -0
  1751. package/dist/workspace/config.js.map +1 -0
  1752. package/dist/workspace/migrations.d.ts +37 -0
  1753. package/dist/workspace/migrations.js +149 -0
  1754. package/dist/workspace/migrations.js.map +1 -0
  1755. package/dist/workspace/projects-cli.d.ts +27 -0
  1756. package/dist/workspace/projects-cli.js +175 -0
  1757. package/dist/workspace/projects-cli.js.map +1 -0
  1758. package/dist/workspace/projects.d.ts +131 -0
  1759. package/dist/workspace/projects.js +274 -0
  1760. package/dist/workspace/projects.js.map +1 -0
  1761. package/dist/workspace/root-probe-cache.d.ts +10 -0
  1762. package/dist/workspace/root-probe-cache.js +43 -0
  1763. package/dist/workspace/root-probe-cache.js.map +1 -0
  1764. package/dist/workspace/semaphore.d.ts +147 -0
  1765. package/dist/workspace/semaphore.js +196 -0
  1766. package/dist/workspace/semaphore.js.map +1 -0
  1767. package/dist/workspace/ui-state.d.ts +17 -0
  1768. package/dist/workspace/ui-state.js +59 -0
  1769. package/dist/workspace/ui-state.js.map +1 -0
  1770. package/dist/workspace/webhooks.d.ts +40 -0
  1771. package/dist/workspace/webhooks.js +146 -0
  1772. package/dist/workspace/webhooks.js.map +1 -0
  1773. package/dist/worktree-manifest.d.ts +165 -0
  1774. package/dist/worktree-manifest.js +535 -0
  1775. package/dist/worktree-manifest.js.map +1 -0
  1776. package/dist/worktree-setup.d.ts +88 -0
  1777. package/dist/worktree-setup.js +170 -0
  1778. package/dist/worktree-setup.js.map +1 -0
  1779. package/package.json +80 -4
  1780. package/scripts/benchmark-family-reconcile.ts +119 -0
  1781. package/scripts/benchmark-home.ts +32 -0
  1782. package/scripts/benchmark-project-probes.mjs +158 -0
  1783. package/scripts/benchmark-run-store-fixture.ts +432 -0
  1784. package/scripts/benchmark-run-store.ts +767 -0
  1785. package/scripts/benchmark-stuck-destroys.ts +144 -0
  1786. package/scripts/benchmark-workspace-events.ts +339 -0
  1787. package/scripts/check-pack.mjs +48 -0
  1788. package/scripts/inline-contract.mjs +165 -0
  1789. package/scripts/install-as-command.mjs +125 -0
  1790. package/scripts/measure-transcript-facts-health.mjs +103 -0
  1791. package/scripts/measure-transcript-facts-lag.mjs +69 -0
  1792. package/scripts/mock-autonomous.mjs +13 -0
  1793. package/scripts/mock-ci-tool.mjs +159 -0
  1794. package/scripts/mock-claude-model-refusal.mjs +76 -0
  1795. package/scripts/mock-claude-subagents.mjs +54 -0
  1796. package/scripts/mock-claude.mjs +800 -0
  1797. package/scripts/mock-codex-app-server.mjs +767 -0
  1798. package/scripts/mock-codex-coalesce-steer.mjs +59 -0
  1799. package/scripts/mock-codex-reverse-steer.mjs +143 -0
  1800. package/scripts/mock-codex-subagents.mjs +52 -0
  1801. package/scripts/mock-controls.d.mts +11 -0
  1802. package/scripts/mock-controls.mjs +13 -0
  1803. package/scripts/mock-cursor-hang-stdin-late.mjs +35 -0
  1804. package/scripts/mock-cursor-hang-stdin.mjs +30 -0
  1805. package/scripts/mock-cursor-print.mjs +237 -0
  1806. package/scripts/mock-deferred-turn-start.mjs +16 -0
  1807. package/scripts/mock-delivery-control.d.mts +23 -0
  1808. package/scripts/mock-delivery-control.mjs +80 -0
  1809. package/scripts/mock-env-record.mjs +11 -0
  1810. package/scripts/mock-failure-control.d.mts +13 -0
  1811. package/scripts/mock-failure-control.mjs +68 -0
  1812. package/scripts/mock-lifecycle.mjs +51 -0
  1813. package/scripts/mock-multi-pr.mjs +10 -0
  1814. package/scripts/mock-nudge.mjs +43 -0
  1815. package/scripts/mock-omp-rpc.mjs +536 -0
  1816. package/scripts/mock-opencode-serve.mjs +1000 -0
  1817. package/scripts/mock-pi-rpc.mjs +421 -0
  1818. package/scripts/mock-publish.mjs +13 -0
  1819. package/scripts/mock-runner-crash.mjs +64 -0
  1820. package/scripts/mock-scenario.d.mts +71 -0
  1821. package/scripts/mock-scenario.mjs +295 -0
  1822. package/scripts/mock-session-context.d.mts +5 -0
  1823. package/scripts/mock-session-context.mjs +56 -0
  1824. package/scripts/mock-silent-tail.mjs +93 -0
  1825. package/scripts/mock-turn-messages.mjs +5 -0
  1826. package/scripts/mock-wire-evidence.config.mjs +12 -0
  1827. package/scripts/mock-wire-recorder.mjs +66 -0
  1828. package/scripts/mock-wire-tools.mjs +7 -0
  1829. package/scripts/omp-ci-wait.mjs +29 -0
  1830. package/scripts/opencode-task-scope.d.mts +18 -0
  1831. package/scripts/opencode-task-scope.mjs +59 -0
  1832. package/scripts/parity-rows.ts +160 -0
  1833. package/scripts/pi-ci-wait.mjs +17 -0
  1834. package/scripts/pi-default-tools.mjs +22 -0
  1835. package/scripts/pi-project-skills.mjs +59 -0
  1836. package/scripts/pi-retry-degraded-service.mjs +16 -0
  1837. package/scripts/probe-cursor-print.mjs +699 -0
  1838. package/scripts/probe-session-env.ts +8 -0
  1839. package/scripts/product-env.mjs +6 -0
  1840. package/scripts/product-identity.mjs +12 -0
  1841. package/scripts/record-mock-wires.mjs +16 -0
  1842. package/scripts/seed-archive-profile.ts +53 -0
  1843. package/scripts/sync-readme.mjs +20 -0
  1844. package/scripts/test-process-usage.mjs +47 -0
  1845. package/scripts/transcript-facts-fixture.mjs +53 -0
  1846. package/scripts/transcript-facts-timing.mjs +42 -0
  1847. package/scripts/voice-replay.ts +50 -0
  1848. package/scripts/windows-workspace-identity.cs +208 -0
  1849. package/scripts/windows-workspace-identity.ps1 +10 -0
  1850. package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
  1851. package/web/dist/assets/activity-motion-SGth5vR4.js +2 -0
  1852. package/web/dist/assets/activity-route-D8otXwOA.js +1 -0
  1853. package/web/dist/assets/agent-accounts-6EuZhy-N.js +18 -0
  1854. package/web/dist/assets/alert-dialog-vFjLgfK4.js +1 -0
  1855. package/web/dist/assets/app-window-CSHwDX9N.js +1 -0
  1856. package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
  1857. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  1858. package/web/dist/assets/button-BEK7XKhS.js +3 -0
  1859. package/web/dist/assets/centered-state-CPgI8cCO.js +1 -0
  1860. package/web/dist/assets/cez-idle-BT0U4GN_.js +1 -0
  1861. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  1862. package/web/dist/assets/commit-diff-panel-DzyWgn1Z.js +1 -0
  1863. package/web/dist/assets/control-locations-CexZsd3M.js +1 -0
  1864. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  1865. package/web/dist/assets/createLucideIcon-BHp8sXmF.js +1 -0
  1866. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  1867. package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
  1868. package/web/dist/assets/diff-DBDiZl58.js +3 -0
  1869. package/web/dist/assets/diff-controls-DXyB0aDl.js +1 -0
  1870. package/web/dist/assets/diff-view-DiKAwVMH.js +11 -0
  1871. package/web/dist/assets/diff-woXpYk--.js +1 -0
  1872. package/web/dist/assets/dropdown-menu-DYflHa4m.js +1 -0
  1873. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  1874. package/web/dist/assets/es2015-BO600Xfi.js +41 -0
  1875. package/web/dist/assets/eye-B8okNWXU.js +1 -0
  1876. package/web/dist/assets/file-preview-DTSRkmMo.js +2 -0
  1877. package/web/dist/assets/git-toolbar-U4s46kUd.js +1 -0
  1878. package/web/dist/assets/github-UaBp2yRF.js +1 -0
  1879. package/web/dist/assets/github-sidebar-model-czjLsgVJ.js +1 -0
  1880. package/web/dist/assets/global-activity-route-B2N2Nz0H.js +1 -0
  1881. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  1882. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  1883. package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
  1884. package/web/dist/assets/html-BY76lXLH.js +1 -0
  1885. package/web/dist/assets/image-preview-XPCPclpG.js +1 -0
  1886. package/web/dist/assets/index-B18AqW0Z.css +1 -0
  1887. package/web/dist/assets/index-xj-3O89_.js +14 -0
  1888. package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
  1889. package/web/dist/assets/info-DA1x_4bz.js +1 -0
  1890. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  1891. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  1892. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  1893. package/web/dist/assets/json-qhed-kSA.js +1 -0
  1894. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  1895. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  1896. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  1897. package/web/dist/assets/live-protocol-BDY7JJpT.js +64 -0
  1898. package/web/dist/assets/live-refetch-C-Ony2Yr.js +1 -0
  1899. package/web/dist/assets/live-worker-BWdeGzQX.ts +34 -0
  1900. package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
  1901. package/web/dist/assets/markdown-BBDDg-4t.js +1 -0
  1902. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  1903. package/web/dist/assets/markdown-UdZ_toya.js +6 -0
  1904. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  1905. package/web/dist/assets/mermaid.min-3O9YjB2l.js +1 -0
  1906. package/web/dist/assets/message-square-B-MD-8rD.js +1 -0
  1907. package/web/dist/assets/nav-row-styles-BE99gD3_.js +1 -0
  1908. package/web/dist/assets/popover-CpULuQSm.js +1 -0
  1909. package/web/dist/assets/poppins-devanagari-400-normal-CJDn6rn8.woff2 +0 -0
  1910. package/web/dist/assets/poppins-devanagari-400-normal-CqVvlrh5.woff +0 -0
  1911. package/web/dist/assets/poppins-devanagari-500-normal-BIdkeU1p.woff2 +0 -0
  1912. package/web/dist/assets/poppins-devanagari-500-normal-DMPDjHtT.woff +0 -0
  1913. package/web/dist/assets/poppins-devanagari-600-normal-ClASKHrr.woff +0 -0
  1914. package/web/dist/assets/poppins-devanagari-600-normal-STEjXBNN.woff2 +0 -0
  1915. package/web/dist/assets/poppins-latin-400-normal-BOb3E3N0.woff +0 -0
  1916. package/web/dist/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
  1917. package/web/dist/assets/poppins-latin-500-normal-C8OXljZJ.woff2 +0 -0
  1918. package/web/dist/assets/poppins-latin-500-normal-DGXqpDMm.woff +0 -0
  1919. package/web/dist/assets/poppins-latin-600-normal-BJdTmd5m.woff +0 -0
  1920. package/web/dist/assets/poppins-latin-600-normal-zEkxB9Mr.woff2 +0 -0
  1921. package/web/dist/assets/poppins-latin-ext-400-normal-DaBSavcJ.woff +0 -0
  1922. package/web/dist/assets/poppins-latin-ext-400-normal-by3JarPu.woff2 +0 -0
  1923. package/web/dist/assets/poppins-latin-ext-500-normal-CK-6C4Hw.woff2 +0 -0
  1924. package/web/dist/assets/poppins-latin-ext-500-normal-CgAe2rWW.woff +0 -0
  1925. package/web/dist/assets/poppins-latin-ext-600-normal-CAhIAdZj.woff2 +0 -0
  1926. package/web/dist/assets/poppins-latin-ext-600-normal-Df5ffKXP.woff +0 -0
  1927. package/web/dist/assets/preview-pane-connected-CgRK7GzB.js +3 -0
  1928. package/web/dist/assets/project-router-CimAoN1H.js +1 -0
  1929. package/web/dist/assets/project-scope-context-DMpvJqIm.js +4 -0
  1930. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  1931. package/web/dist/assets/queries-BIOp8jLx.js +1 -0
  1932. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  1933. package/web/dist/assets/repo-git-DVXNOJDT.css +1 -0
  1934. package/web/dist/assets/repo-git-XkyTfP9G.js +1 -0
  1935. package/web/dist/assets/report-reader-CZjYS5Aw.js +1 -0
  1936. package/web/dist/assets/report-title-D4Mbu2Er.js +1 -0
  1937. package/web/dist/assets/reports-B7QAzibP.css +1 -0
  1938. package/web/dist/assets/reports-D_2sFE1y.js +1 -0
  1939. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  1940. package/web/dist/assets/run-header-BwPDVPpg.js +2 -0
  1941. package/web/dist/assets/run-header-CC7VUTg9.css +1 -0
  1942. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  1943. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  1944. package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
  1945. package/web/dist/assets/skills-BkXe4p4q.js +1 -0
  1946. package/web/dist/assets/skills-DFBiAuJG.js +1 -0
  1947. package/web/dist/assets/skills-workflows-C21NystW.css +1 -0
  1948. package/web/dist/assets/sortable.esm-zp_qkYGV.js +5 -0
  1949. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  1950. package/web/dist/assets/tab-link-BIweqlIZ.js +1 -0
  1951. package/web/dist/assets/task-changes-USNHNm_T.js +1 -0
  1952. package/web/dist/assets/task-commits-kHqlOJe_.js +1 -0
  1953. package/web/dist/assets/task-files-wTWwLR39.js +1 -0
  1954. package/web/dist/assets/task-github-item-GzaQjkF1.js +1 -0
  1955. package/web/dist/assets/task-thread-BZX863UN.js +9 -0
  1956. package/web/dist/assets/task-thread-DtQ6uGfQ.css +1 -0
  1957. package/web/dist/assets/textarea-FAUkHz1K.js +1 -0
  1958. package/web/dist/assets/thread-state-CBzx2hmX.js +4 -0
  1959. package/web/dist/assets/toaster-pthKGWiE.js +1 -0
  1960. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  1961. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  1962. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  1963. package/web/dist/assets/use-hand-to-agent-state-Bav9eT3b.js +1 -0
  1964. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +1 -0
  1965. package/web/dist/assets/useInfiniteQuery-CQI4BO4C.js +1 -0
  1966. package/web/dist/assets/useQuery-Bkq-x4Id.js +1 -0
  1967. package/web/dist/assets/workflows-D871Gx--.js +7 -0
  1968. package/web/dist/assets/ws-DspW9wBH.js +1 -0
  1969. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  1970. package/web/dist/assets/zoomable-image-DNc6ORaF.js +1 -0
  1971. package/web/dist/cezarion-lockup-dark.svg +9 -0
  1972. package/web/dist/cezarion-lockup-light.svg +9 -0
  1973. package/web/dist/cezarion-mark-dark.svg +4 -0
  1974. package/web/dist/cezarion-mark-light.svg +4 -0
  1975. package/web/dist/index.html +90 -0
  1976. package/web/dist/live-worker.js +4 -0
@@ -0,0 +1,1690 @@
1
+ import { productEnv } from './product-env.js';
2
+ import { uiAskQuestions } from './ask.js';
3
+ import { opencodeSkillWarning } from './opencode-session-error.js';
4
+ import { summarizeRunnerStderr } from './runner-stderr.js';
5
+ import { finished } from 'node:stream/promises';
6
+ import { setTimeout as delay } from 'node:timers/promises';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { randomUUID } from 'node:crypto';
9
+ import { parseEffort } from '../contract/index.js';
10
+ import { request as httpRequest } from 'node:http';
11
+ import { isSignalTerminationExit, prependSystemPrompt, trackChildExit, } from './agent-runner.js';
12
+ import { RUNNER_FACTS } from './runner-facts.js';
13
+ import { InputSubmissions } from './input-submissions.js';
14
+ import { opencodeToolGrantFields } from './runner-tool-grants.js';
15
+ import { signalSession, spawnSessionLeader } from './session-process.js';
16
+ import { buildChildEnv } from './agent-env.js';
17
+ import { opencodeTaskScopeEnv } from './opencode-task-scope.js';
18
+ import { ciOpenCodeEnv } from '../ci-wait/injection.js';
19
+ import { parseAskRequest } from './ask.js';
20
+ import { boundOutputDrainAfterExit, AUTO_END_DELAY_MS, DEFAULT_RUN_TIMEOUT_MS } from './runner-runtime.js';
21
+ import { formatModelIdentity, parseModelIdentity } from './model-identity.js';
22
+ import { V1TextCoalescer } from './v1-text-coalescer.js';
23
+ import { isOpencodeDefaultAsk, opencodePermissionAskSchema, opencodePermissionBridge, opencodeUserPermissionRules, } from './opencode-permissions.js';
24
+ import { createOpencodeUiState, mapOpencodeEvent, opencodeSessionStarted, opencodeTurnStarted, } from './opencode-ui-mapper.js';
25
+ const SERVER_START_TIMEOUT_MS = 30_000;
26
+ /**
27
+ * Pause before the one retry of a server that exited before listening (#872).
28
+ * opencode 1.18.33, started within ~2 s of SIGTERM to the previous server on
29
+ * the same DB, printed `ServeError` and exited; the next start succeeded. The
30
+ * failing start can die well inside that window, so the pause alone spans it;
31
+ * it is only ever paid by a start that already failed.
32
+ */
33
+ export const SERVE_START_RETRY_DELAY_MS = 2_000;
34
+ /** The URL wait saw the process exit before it printed a URL. */
35
+ class ServeExitedBeforeListening extends Error {
36
+ constructor() {
37
+ super('opencode serve exited before it started listening');
38
+ }
39
+ }
40
+ /** Grace between the teardown SIGTERM and the SIGKILL that follows it. */
41
+ export const KILL_GRACE_MS = 4_000;
42
+ /**
43
+ * `AgentRunner` over `opencode serve` — a headless HTTP server (the same one
44
+ * the opencode TUI talks to) with an SSE event stream. One server per session,
45
+ * bound to the run's `cwd` (worktree), gives OpenCode the same multi-turn shape
46
+ * as the Claude runner: each `sendMessage` posts another prompt to the same
47
+ * session (history is kept server-side), and `session/abort` cancels.
48
+ * Continue and restart recovery GET /session/{id} and prompt that session; a 404
49
+ * falls back to one fresh session with the full system prompt.
50
+ *
51
+ * Auth = the host's opencode config/logins. OpenCode's own permission config
52
+ * governs tools: cezar answers OpenCode's built-in default asks once and routes
53
+ * asks the user configured to the cockpit (hearsay-tools/cezarion#1266); this
54
+ * adapter does not map `spec.toolGrant`. Governed delegation adds only a
55
+ * supported session-level task deny rule.
56
+ * `spec.model` is `provider/model`.
57
+ */
58
+ /**
59
+ * What `opencode serve` receives from each `AgentRunSpec` field (#284).
60
+ * OpenCode's own permission config governs tool access and this adapter maps no
61
+ * per-tool allowlist, so `toolGrant` is declared dropped rather than mapped (spec
62
+ * 2026-07-17-permission-modes). Resume GETs `/session/{id}` and prompts it; a 404 opens one
63
+ * fresh session. Held against the recorded HTTP requests by the harness parity matrix.
64
+ */
65
+ export const OPENCODE_SPEC_SUPPORT = {
66
+ cezarTools: { honored: true, via: 'merged OPENCODE_CONFIG_CONTENT local mcp entry' },
67
+ systemPrompt: { honored: true, via: 'prepended to the opening prompt_async text through prependSystemPrompt' },
68
+ userPrompt: { honored: true, via: 'prompt_async text part' },
69
+ images: { honored: false, reason: 'the adapter posts text parts only; image blocks are dropped' },
70
+ cwd: { honored: true, via: 'opencode serve spawn cwd; the session is bound to it' },
71
+ toolGrant: { honored: false, reason: 'OpenCode permission config governs tool access and bash; cezar answers its built-in default asks and routes configured asks to the cockpit, but maps no per-tool allowlist, so no command-prefix restriction either' },
72
+ restrictCrossSessionMessaging: { honored: true, via: 'the opencode-task-scope.mjs plugin appended to the OPENCODE_CONFIG_CONTENT plugin list; its tool.execute.before hook refuses a task call whose task_id names a session outside the caller\'s session tree, and keeps subagents (hearsay-tools/cezarion#2279)' },
73
+ additionalDirectories: { honored: false, reason: 'the server works from cwd; no extra-root mapping' },
74
+ env: { honored: true, via: 'merged over the child env through buildChildEnv' },
75
+ model: { honored: true, via: 'prompt_async model { providerID, modelID }, split from provider/model' },
76
+ effort: { honored: true, via: 'prompt_async variant, canonical level' },
77
+ timeoutMs: { honored: true, via: 'wall-clock kill switch on the child process' },
78
+ sessionId: { honored: true, via: 'GET /session/{id} when resume is set; a fresh POST /session mints its own id' },
79
+ resume: { honored: true, via: 'GET /session/{id} in place of POST /session; 404 falls back to a fresh session' },
80
+ resumeFallbackSystemPrompt: { honored: true, via: 'opening prependSystemPrompt of a fresh POST /session when GET /session/{id} returns 404 on resume' },
81
+ };
82
+ /** How long an idle session may sit on steered input before it counts as a lost wake. */
83
+ export const OPENCODE_LOST_WAKE_GRACE_MS = 2_000;
84
+ export class OpencodeServerRunner {
85
+ backend = 'opencode';
86
+ specSupport = OPENCODE_SPEC_SUPPORT;
87
+ systemPromptOnResume = RUNNER_FACTS.opencode.systemPromptOnResume;
88
+ facts = RUNNER_FACTS.opencode;
89
+ inputDelivery = RUNNER_FACTS.opencode.inputDelivery;
90
+ bin;
91
+ timeoutMs;
92
+ serverStartTimeoutMs;
93
+ lastSession = null;
94
+ constructor(opts = {}) {
95
+ this.bin = opts.bin ?? productEnv('OPENCODE_BIN') ?? (productEnv('DRY_RUN') === '1'
96
+ ? fileURLToPath(new URL('../../scripts/mock-opencode-serve.mjs', import.meta.url)) : 'opencode');
97
+ this.timeoutMs = opts.timeoutMs ?? DEFAULT_RUN_TIMEOUT_MS;
98
+ this.serverStartTimeoutMs = opts.serverStartTimeoutMs ?? SERVER_START_TIMEOUT_MS;
99
+ }
100
+ run(spec, onEvent) {
101
+ return this.startSession(spec, onEvent, { autoEndAfterFirstTurn: true }).result;
102
+ }
103
+ async interrupt() {
104
+ this.lastSession?.interrupt();
105
+ }
106
+ startSession(spec, onEvent, opts = {}) {
107
+ const session = new OpencodeSession(this.bin, this.timeoutMs, this.serverStartTimeoutMs, spec, onEvent, opts);
108
+ this.lastSession = session;
109
+ return session;
110
+ }
111
+ }
112
+ /** One live `opencode serve` process driving a single session. */
113
+ class OpencodeSession {
114
+ bin;
115
+ serverStartTimeoutMs;
116
+ spec;
117
+ onEvent;
118
+ opts;
119
+ result;
120
+ /** The live server process. A start retry replaces it (#872), so every
121
+ * liveness, pid, signal and stderr read goes through this field. */
122
+ serve;
123
+ /** The first start, once the retry spawned for it ALSO exited before
124
+ * listening on its own (#872) — the one case that names both attempts. */
125
+ failedStart;
126
+ /** The retry's own spawn threw synchronously (EAGAIN, EMFILE…), so no second
127
+ * process exists and the first start's exit alone would misname the failure. */
128
+ retrySpawnError;
129
+ /** Aborted by teardown; cancels a pending start retry. */
130
+ startRetry = new AbortController();
131
+ serverOpen = true;
132
+ exitFailure;
133
+ baseUrl;
134
+ sessionId;
135
+ ready;
136
+ sse = new AbortController();
137
+ toolCalls = [];
138
+ textChunks = [];
139
+ /** Per text-part cursor so only newly-appended text is buffered (deltas). */
140
+ textSeen = new Map();
141
+ /** Streamed part deltas buffered per part — v1 `text` is emitted once per
142
+ * finished part (claude parity: one event per complete block), never per
143
+ * delta, so the persisted transcript and the headless CLI get whole
144
+ * paragraphs. Streaming display rides protocol v2's `item.delta`. */
145
+ textCoalescer = new V1TextCoalescer((text) => {
146
+ this.textChunks.push(text);
147
+ this.emit({ type: 'text', text });
148
+ });
149
+ toolsSeen = new Set();
150
+ /** messageID → role. Parts carry no role; only assistant parts are surfaced
151
+ * (the user's own message also streams as parts over the same SSE feed). */
152
+ msgRole = new Map();
153
+ /** Accepted agent prompts, the user message carrying each, and prompts that
154
+ * opened their turn (read when that turn goes idle) (#505). */
155
+ submissions = new InputSubmissions();
156
+ userMessageSubmission = new Map();
157
+ turnOpeners = new Set();
158
+ refusedBeforeOpening = false;
159
+ turnErrored = false;
160
+ lostWakeTimer;
161
+ /** Steered input an idle left unanswered: the server may still start a follow-on run for it.
162
+ * Settles when that run starts, or when the lost-wake grace or a teardown ends the wait. */
163
+ followOn;
164
+ followOnResolve = () => { };
165
+ refusedForFollowOn = false;
166
+ tokensUsed = 0;
167
+ /** OpenCode reports a cumulative cost for each message, not the session. */
168
+ costByMessage = new Map();
169
+ /** A prompt was posted and its `session.idle` has not arrived yet. */
170
+ turnActive = false;
171
+ agentInputReady = false;
172
+ agentRequest;
173
+ /** Human prompts scheduled behind the active turn, through their HTTP ack. */
174
+ pendingPromptRequests = 0;
175
+ /** A provider error must not abort its own independently arriving receipt. */
176
+ agentAcknowledgement;
177
+ providerErrorPending;
178
+ /** `finishTurn` ran for the current turn — repeats and stray idles no-op. */
179
+ turnEnded = false;
180
+ /** Monotonic identity used to reject async work completed by an older turn. */
181
+ turnSerial = 0;
182
+ /** Settles when the open turn finishes; re-armed at each turn start. The
183
+ * gate `prompt` waits on so turns never overlap (see there). */
184
+ turnFinished = Promise.resolve();
185
+ turnFinishedResolve = () => { };
186
+ /** Protocol v2 emission — additive alongside v1 (`onEvent` keeps flowing
187
+ * byte-identical); the channel is `opts.onUiEvent` (RunManager wiring
188
+ * lands in R2 step 2.1). Both streams take their turn-end from the wire
189
+ * `session.idle` (v1 since #4 — see `finishTurn`). */
190
+ uiState = createOpencodeUiState();
191
+ /** Question tool parts are snapshots. Once capture starts for an identity,
192
+ * every later state snapshot for that same part/call is already handled. */
193
+ handledQuestionParts = new Set();
194
+ pendingQuestion;
195
+ questionCapture;
196
+ questionReply;
197
+ /** User text submitted while a question reply POST is unsettled. It is not
198
+ * another answer; deliver it as ordinary prompts only after reply success. */
199
+ queuedQuestionMessages = [];
200
+ /** Bumped by `discardQueuedMessages` so a `prompt()` waiter that captured
201
+ * the previous generation returns instead of posting after idle. */
202
+ queuedPromptGeneration = 0;
203
+ /** Human prompts of the current generation, held from `sendMessage` until they post (#486). */
204
+ humanPromptWaiters = 0;
205
+ /** Native ask id → its live state, entered on receipt (hearsay-tools/cezarion#1266). Any
206
+ * entry holds agent input and auto-end, like a pending question, until OpenCode settles it. */
207
+ pendingPermissions = new Map();
208
+ /** Native ask ids already taken. Outlives retirement, so a duplicated frame is handled once. */
209
+ handledPermissionIds = new Set();
210
+ /** Asks are classified one at a time, in arrival order, after the one config read. */
211
+ permissionQueue = Promise.resolve();
212
+ permissionRules;
213
+ answeredDefaultAsk = false;
214
+ autoEndTimer;
215
+ timedOut = false;
216
+ openingPromptFailed = false;
217
+ constructor(bin, timeoutMs, serverStartTimeoutMs, spec, onEvent, opts) {
218
+ this.bin = bin;
219
+ this.serverStartTimeoutMs = serverStartTimeoutMs;
220
+ this.spec = spec;
221
+ this.onEvent = onEvent;
222
+ this.opts = opts;
223
+ this.serve = this.spawnServe();
224
+ // The server prints its URL on stdout once listening.
225
+ const urlReady = this.startServer();
226
+ const limitMs = spec.timeoutMs ?? timeoutMs;
227
+ let deadline;
228
+ if (limitMs > 0) {
229
+ deadline = setTimeout(() => {
230
+ this.timedOut = true;
231
+ this.interrupt();
232
+ }, limitMs);
233
+ deadline.unref?.();
234
+ }
235
+ this.ready = (async () => {
236
+ this.baseUrl = await urlReady;
237
+ await this.bootstrap();
238
+ })();
239
+ this.result = this.finishSession(deadline, limitMs);
240
+ }
241
+ /** Wait out the child, then map its exit onto the v1 result. */
242
+ async finishSession(deadline, limitMs) {
243
+ try {
244
+ await this.ready;
245
+ // Live for the whole session; the SSE loop runs until end()/interrupt.
246
+ await this.serve.exited;
247
+ }
248
+ catch (err) {
249
+ if (!this.timedOut && !this.openingPromptFailed) {
250
+ this.exitFailure = `opencode: ${err instanceof Error ? err.message : String(err)}`;
251
+ }
252
+ }
253
+ finally {
254
+ if (deadline)
255
+ clearTimeout(deadline);
256
+ if (this.autoEndTimer)
257
+ clearTimeout(this.autoEndTimer);
258
+ this.sse.abort();
259
+ this.serverOpen = false;
260
+ this.clearLostWakeTimer();
261
+ this.agentRequest?.abort();
262
+ this.expirePermissions('session ended');
263
+ this.terminate();
264
+ }
265
+ const serve = this.serve;
266
+ await serve.exited;
267
+ await serve.outputDrained;
268
+ if (serve.spawnFailed) {
269
+ this.emit({ type: 'error', message: serve.spawnFailed.message });
270
+ throw serve.spawnFailed;
271
+ }
272
+ this.reportServeFailure(serve);
273
+ return this.resultFromCleanExit(limitMs);
274
+ }
275
+ reportServeFailure(serve) {
276
+ // SSE closure can precede the process exit event. Choose one authoritative
277
+ // error after settlement, before the synthetic turn-end, retaining the code.
278
+ const code = serve.child.exitCode;
279
+ const signal = serve.child.signalCode;
280
+ const crashed = (signal !== null && !serve.signalled)
281
+ || (code !== null && code !== 0 && !(serve.signalled && isSignalTerminationExit(code)));
282
+ if (this.timedOut || (!crashed && !this.exitFailure))
283
+ return;
284
+ const stderr = serve.stderrChunks.join('');
285
+ const detail = summarizeRunnerStderr(stderr);
286
+ if (this.retrySpawnError) {
287
+ if (stderr.trim())
288
+ this.emit({ type: 'note', message: `opencode serve stderr:\n${stderr}` });
289
+ this.emit({ type: 'error', message: `opencode serve exited before listening (${describeEarlyExit(serve)}) and its retry could not start: ${this.retrySpawnError.message}` });
290
+ }
291
+ else if (this.failedStart) {
292
+ // #872: the retry failed too — one error naming both attempts.
293
+ const attempts = [this.failedStart, serve];
294
+ const notes = attempts.map((attempt, i) => {
295
+ const text = attempt.stderrChunks.join('');
296
+ return text.trim() ? `opencode serve stderr (attempt ${i + 1}):\n${text}` : '';
297
+ }).filter(Boolean);
298
+ if (notes.length)
299
+ this.emit({ type: 'note', message: notes.join('\n') });
300
+ const described = attempts.map((attempt, i) => `attempt ${i + 1}: ${describeEarlyExit(attempt)}`);
301
+ this.emit({ type: 'error', message: `opencode serve exited before listening on both attempts — ${described.join('; ')}` });
302
+ }
303
+ else {
304
+ if (stderr.trim())
305
+ this.emit({ type: 'note', message: `opencode serve stderr:\n${stderr}` });
306
+ this.emit({ type: 'error', message: crashed ? `opencode serve exited with ${describeExit(serve)}${detail ? ` — ${detail}` : ''}` : this.exitFailure });
307
+ }
308
+ }
309
+ resultFromCleanExit(limitMs) {
310
+ // Timeout/interrupt can cut the SSE feed before its `session.idle` —
311
+ // close the turn (idempotent) so consumers still see the v1 boundary,
312
+ // and recover prose buffered mid-part.
313
+ this.finishTurn();
314
+ this.textCoalescer.flush();
315
+ // Chunks are whole blocks now (one per finished part), so newline-join
316
+ // like the other runners, not the old delta concatenation.
317
+ const base = {
318
+ text: this.textChunks.join('\n').trim(), toolCalls: this.toolCalls,
319
+ tokensUsed: this.tokensUsed, sessionId: this.sessionId ?? this.spec.sessionId,
320
+ };
321
+ if (this.timedOut) {
322
+ const mins = Math.round((limitMs / 60_000) * 10) / 10;
323
+ this.emit({ type: 'error', message: `opencode timed out after ${mins}m and was killed` });
324
+ }
325
+ this.emit({ type: 'done' });
326
+ return base;
327
+ }
328
+ get open() {
329
+ return this.serverOpen;
330
+ }
331
+ get pid() {
332
+ return this.serve.child.pid;
333
+ }
334
+ sendAgentMessage(content, inputIds = []) {
335
+ // #505: a busy session is steered with prompt_async; only a pending native question or
336
+ // permission ask, a queued human prompt or an in-flight agent POST refuses.
337
+ // Nothing may run ahead of the task: refuse until the opening prompt has started,
338
+ // then hint once so the refused input steers the opening turn.
339
+ if (this.serverOpen && this.turnSerial === 0) {
340
+ this.refusedBeforeOpening = true;
341
+ return false;
342
+ }
343
+ if (!this.serverOpen || !this.sessionId || this.pendingQuestion || this.questionReply || this.pendingPermissions.size > 0 ||
344
+ this.pendingPromptRequests > 0 || this.agentRequest)
345
+ return false;
346
+ // A prompt posted before a due follow-on run would have that run's idle close its turn, and
347
+ // its own run would then surface nothing (PR #1291 CI): it waits for that run, as for a turn.
348
+ if (this.followOn) {
349
+ this.refusedForFollowOn = true;
350
+ return false;
351
+ }
352
+ this.agentInputReady = false;
353
+ const request = new AbortController();
354
+ this.agentRequest = request;
355
+ const text = textOf(content);
356
+ const submissionId = randomUUID();
357
+ const steering = this.turnActive;
358
+ this.submissions.accept(submissionId, inputIds, text);
359
+ if (!steering && inputIds.length)
360
+ this.turnOpeners.add(submissionId);
361
+ const post = steering ? this.steerPrompt(text, request.signal) : this.prompt(text, 'agent', request.signal);
362
+ const acknowledgement = post.catch((err) => {
363
+ this.submissions.consume(submissionId);
364
+ this.turnOpeners.delete(submissionId);
365
+ throw err;
366
+ }).finally(() => {
367
+ if (this.agentRequest === request)
368
+ this.agentRequest = undefined;
369
+ if (this.serverOpen && !this.providerErrorPending && !this.turnActive && !this.pendingQuestion && !this.questionReply &&
370
+ this.pendingPermissions.size === 0) {
371
+ this.agentInputReady = true;
372
+ this.opts.onAgentInputReady?.();
373
+ this.scheduleAutoEnd();
374
+ }
375
+ });
376
+ this.agentAcknowledgement = acknowledgement;
377
+ return acknowledgement;
378
+ }
379
+ sendMessage(content) {
380
+ this.agentInputReady = false;
381
+ if (!this.serverOpen)
382
+ return false;
383
+ this.cancelAutoEnd();
384
+ const text = textOf(content);
385
+ if (!text)
386
+ return true;
387
+ if (this.questionReply) {
388
+ this.queuedQuestionMessages.push(text);
389
+ return true;
390
+ }
391
+ if (this.pendingQuestion) {
392
+ const pending = this.pendingQuestion;
393
+ const reply = this.replyQuestion(pending, text);
394
+ this.questionReply = reply;
395
+ const clearReply = () => {
396
+ if (this.questionReply === reply)
397
+ this.questionReply = undefined;
398
+ this.notifyAgentInputReady();
399
+ };
400
+ void reply.then(clearReply, clearReply);
401
+ return true;
402
+ }
403
+ // `prompt` already emitted the note and closed the turn before rethrowing,
404
+ // and a rejected `ready` already failed the session on the result path —
405
+ // there is nothing left to report here.
406
+ this.deliverPrompt(text);
407
+ return true;
408
+ }
409
+ discardQueuedMessages() {
410
+ this.queuedPromptGeneration += 1;
411
+ this.queuedQuestionMessages.length = 0;
412
+ this.humanPromptWaiters = 0; // #486: must read false immediately, not when waiters resume
413
+ }
414
+ holdsHumanInput() {
415
+ return this.humanPromptWaiters > 0 || this.queuedQuestionMessages.length > 0;
416
+ }
417
+ heldHumanInputCount() {
418
+ return this.humanPromptWaiters + this.queuedQuestionMessages.length;
419
+ }
420
+ deliverPrompt(text) {
421
+ this.pendingPromptRequests += 1;
422
+ // Held from admission, not from `ready`; a start that fails releases it (hearsay-tools/cezarion#2991).
423
+ const generation = this.queuedPromptGeneration;
424
+ this.humanPromptWaiters += 1;
425
+ let posting = false;
426
+ void this.ready.then(() => { posting = true; return this.prompt(text, 'human', undefined, generation); }).then(() => {
427
+ this.pendingPromptRequests -= 1;
428
+ this.notifyAgentInputReady();
429
+ }, () => {
430
+ if (!posting && generation === this.queuedPromptGeneration)
431
+ this.humanPromptWaiters = Math.max(0, this.humanPromptWaiters - 1);
432
+ this.pendingPromptRequests -= 1;
433
+ });
434
+ }
435
+ notifyAgentInputReady() {
436
+ if (this.serverOpen && this.turnEnded && !this.turnActive && !this.pendingQuestion &&
437
+ !this.questionReply && this.pendingPermissions.size === 0 && this.pendingPromptRequests === 0) {
438
+ this.agentInputReady = true;
439
+ this.opts.onAgentInputReady?.();
440
+ }
441
+ else if (this.serverOpen && this.turnActive && !this.pendingQuestion && !this.questionReply &&
442
+ this.pendingPermissions.size === 0 && this.pendingPromptRequests === 0 && !this.agentRequest) {
443
+ // A reply or prompt acknowledgement cleared the last barrier mid-turn: held agent
444
+ // input can steer the running turn now, not after it (#505 local review).
445
+ this.opts.onAgentInputReady?.();
446
+ }
447
+ }
448
+ cancelAutoEnd() {
449
+ if (!this.autoEndTimer)
450
+ return;
451
+ clearTimeout(this.autoEndTimer);
452
+ this.autoEndTimer = undefined;
453
+ }
454
+ scheduleAutoEnd() {
455
+ if (!this.opts.autoEndAfterFirstTurn || !this.serverOpen || this.autoEndTimer || this.agentRequest || this.pendingPermissions.size)
456
+ return;
457
+ this.autoEndTimer = setTimeout(() => {
458
+ this.autoEndTimer = undefined;
459
+ if (this.opts.shouldAutoEnd?.() !== false)
460
+ this.end();
461
+ }, AUTO_END_DELAY_MS);
462
+ this.autoEndTimer.unref?.();
463
+ }
464
+ end() {
465
+ if (!this.serverOpen)
466
+ return;
467
+ this.serverOpen = false;
468
+ this.clearLostWakeTimer();
469
+ this.agentRequest?.abort();
470
+ this.expirePermissions('session ended');
471
+ this.sse.abort();
472
+ this.terminate();
473
+ }
474
+ interrupt() {
475
+ this.serverOpen = false;
476
+ this.clearLostWakeTimer();
477
+ this.agentRequest?.abort();
478
+ this.expirePermissions('session ended');
479
+ if (this.baseUrl && this.sessionId) {
480
+ void this.http('POST', `/session/${this.sessionId}/abort`, undefined).catch(() => undefined);
481
+ }
482
+ this.sse.abort();
483
+ this.terminate();
484
+ }
485
+ /**
486
+ * The one place either signal is sent: SIGTERM now, SIGKILL once the grace
487
+ * window elapses.
488
+ *
489
+ * Both steps gate on `hasExited()`, never on `child.killed` — the latter
490
+ * flips the moment SIGTERM is *delivered*, so the old nested
491
+ * `exitCode == null && !killed` guard disarmed the escalation for exactly the
492
+ * server it was written for: one that installs its own SIGTERM handler stayed
493
+ * alive with `killed = true` and `exitCode === null`, outliving the whole
494
+ * window (#858, the same defect #844 fixed for the other two backends). Every
495
+ * caller here is followed by `await serve.exited`, so a server that survived
496
+ * SIGTERM did not just leak — it hung the session's result forever.
497
+ *
498
+ * One teardown per session: all three call sites can run for the same session
499
+ * (`interrupt()` on the deadline, then the result promise's `finally`), and
500
+ * once SIGTERM is out with SIGKILL armed there is nothing a second pass adds.
501
+ * The old `!child.killed` test deduplicated this as a side effect of being
502
+ * wrong; `signalled` keeps that property on purpose. It lives on the process,
503
+ * not the session: only the live one is ever signalled, and a start retry
504
+ * (#872) replaces it only after the first exited unsignalled.
505
+ *
506
+ * Teardown also cancels a pending start retry, so no second server spawns
507
+ * after `end()`, `interrupt()` or the deadline.
508
+ */
509
+ terminate() {
510
+ this.startRetry.abort();
511
+ const serve = this.serve;
512
+ if (serve.signalled || serve.hasExited())
513
+ return;
514
+ serve.signalled = true;
515
+ signalSession(serve.child, 'SIGTERM');
516
+ setTimeout(() => {
517
+ if (serve.hasExited())
518
+ return;
519
+ signalSession(serve.child, 'SIGKILL');
520
+ }, KILL_GRACE_MS).unref?.();
521
+ }
522
+ // ---- server lifecycle ---------------------------------------------------
523
+ /** Spawn one `opencode serve` on a random high port and wire its lifecycle.
524
+ * A synchronous spawn throw is wrapped; an async spawn error is latched on
525
+ * the process record. */
526
+ spawnServe() {
527
+ // Random high port; the actual bound URL is read back from stdout.
528
+ const port = 40000 + Math.floor(Math.random() * 20000);
529
+ let child;
530
+ try {
531
+ child = spawnSessionLeader(this.bin, ['serve', '--hostname', '127.0.0.1', '--port', String(port)], {
532
+ cwd: this.spec.cwd,
533
+ env: buildChildEnv({ backend: 'opencode', extraEnv: opencodeTaskScopeEnv(ciOpenCodeEnv(this.spec), this.spec.restrictCrossSessionMessaging) }),
534
+ });
535
+ }
536
+ catch (err) {
537
+ throw wrapSpawnError(err, this.bin);
538
+ }
539
+ const hasExited = trackChildExit(child);
540
+ boundOutputDrainAfterExit(child);
541
+ // `exit` settles process liveness, not its pipes. The shared post-exit drain
542
+ // bound prevents an inherited descendant pipe from retaining this session.
543
+ const outputDrained = Promise.all([child.stdout, child.stderr].map(stream => finished(stream, { cleanup: true }).catch(() => undefined)));
544
+ const exited = new Promise((resolve) => {
545
+ child.once('exit', () => resolve());
546
+ child.once('close', () => resolve());
547
+ });
548
+ const serve = {
549
+ child, hasExited, exited, outputDrained, port,
550
+ stderrChunks: [], spawnFailed: null, signalled: false,
551
+ };
552
+ child.on('error', (err) => {
553
+ serve.spawnFailed = wrapSpawnError(err, this.bin);
554
+ });
555
+ child.stderr.setEncoding('utf8');
556
+ child.stderr.on('data', (chunk) => serve.stderrChunks.push(chunk));
557
+ return serve;
558
+ }
559
+ /**
560
+ * Wait for the server URL, retrying once — after `SERVE_START_RETRY_DELAY_MS`,
561
+ * on a fresh port — when the process exited before it printed one (#872).
562
+ * Never retried: a spawn error (the process never ran), the no-URL timeout
563
+ * (it falls back to the requested port), and a session already torn down.
564
+ */
565
+ async startServer() {
566
+ try {
567
+ return await this.waitForServerUrl(this.serve);
568
+ }
569
+ catch (err) {
570
+ const first = this.serve;
571
+ if (!(err instanceof ServeExitedBeforeListening))
572
+ throw err;
573
+ // Settle the process first: an ENOENT `error` and late stderr both land
574
+ // around `exit`, and the retry decision and its note need them.
575
+ await first.exited;
576
+ await first.outputDrained;
577
+ if (first.spawnFailed || first.child.pid === undefined || !this.serverOpen || this.timedOut)
578
+ throw err;
579
+ const detail = summarizeRunnerStderr(first.stderrChunks.join(''));
580
+ this.emit({
581
+ type: 'note',
582
+ message: `opencode serve exited before listening (${describeExit(first)}); retrying once${detail ? ` — ${detail}` : ''}`,
583
+ });
584
+ try {
585
+ await delay(SERVE_START_RETRY_DELAY_MS, undefined, { signal: this.startRetry.signal });
586
+ }
587
+ catch {
588
+ // Torn down during the pause: report the first start's failure as before.
589
+ throw err;
590
+ }
591
+ if (this.startRetry.signal.aborted || !this.serverOpen || this.timedOut)
592
+ throw err;
593
+ let next;
594
+ try {
595
+ next = this.spawnServe();
596
+ }
597
+ catch (spawnErr) {
598
+ this.retrySpawnError = spawnErr instanceof Error ? spawnErr : new Error(String(spawnErr));
599
+ throw spawnErr;
600
+ }
601
+ this.serve = next;
602
+ if (next.child.pid !== undefined)
603
+ this.opts.onPidChange?.(next.child.pid);
604
+ try {
605
+ return await this.waitForServerUrl(next);
606
+ }
607
+ catch (retryErr) {
608
+ // Only an unprompted second early exit names both attempts; a retry
609
+ // torn down by the session reports through the ordinary paths.
610
+ if (retryErr instanceof ServeExitedBeforeListening && !next.signalled)
611
+ this.failedStart = first;
612
+ throw retryErr;
613
+ }
614
+ }
615
+ }
616
+ waitForServerUrl(serve) {
617
+ const { child } = serve;
618
+ return new Promise((resolve, reject) => {
619
+ let buffer = '';
620
+ const timer = setTimeout(() => {
621
+ cleanup();
622
+ // Nothing parsed — try the port we asked for.
623
+ resolve(`http://127.0.0.1:${serve.port}`);
624
+ }, this.serverStartTimeoutMs);
625
+ timer.unref?.();
626
+ const onData = (chunk) => {
627
+ buffer += chunk;
628
+ const m = /https?:\/\/[\d.]+:\d+/.exec(buffer);
629
+ if (m) {
630
+ cleanup();
631
+ resolve(m[0]);
632
+ }
633
+ };
634
+ const onExit = () => { cleanup(); reject(new ServeExitedBeforeListening()); };
635
+ // A failed spawn emits `error` and `close`, never `exit` (hearsay-tools/cezarion#895).
636
+ const onError = () => { if (child.pid === undefined)
637
+ onExit(); };
638
+ const cleanup = () => {
639
+ clearTimeout(timer);
640
+ child.stdout.off('data', onData);
641
+ child.off('exit', onExit);
642
+ child.off('error', onError);
643
+ };
644
+ child.stdout.setEncoding('utf8');
645
+ child.stdout.on('data', onData);
646
+ child.once('exit', onExit);
647
+ child.on('error', onError);
648
+ if (serve.spawnFailed)
649
+ onError();
650
+ });
651
+ }
652
+ /** 404 → `'missing'`. Any other non-OK status fails bootstrap (no fallback). */
653
+ async tryGetSession(id) {
654
+ if (!this.baseUrl)
655
+ throw new Error('opencode server not ready');
656
+ const res = await fetch(`${this.baseUrl}/session/${encodeURIComponent(id)}`, { method: 'GET' });
657
+ if (res.status === 404)
658
+ return 'missing';
659
+ if (!res.ok) {
660
+ const detail = await res.text().catch(() => '');
661
+ throw new Error(`GET /session/${id} → ${res.status} ${detail.slice(0, 200)}`);
662
+ }
663
+ const text = await res.text();
664
+ if (!text)
665
+ return { id };
666
+ try {
667
+ const parsed = JSON.parse(text);
668
+ return isRecord(parsed) ? parsed : { id };
669
+ }
670
+ catch {
671
+ return { id };
672
+ }
673
+ }
674
+ attachSession(id) {
675
+ this.sessionId = id;
676
+ this.emit({ type: 'session', sessionId: id });
677
+ this.emitUi((state) => opencodeSessionStarted(id, state));
678
+ }
679
+ async bootstrap() {
680
+ const requested = this.spec.resume ? this.spec.sessionId : undefined;
681
+ let resumed = false;
682
+ if (requested) {
683
+ const existing = await this.tryGetSession(requested);
684
+ if (existing === 'missing') {
685
+ this.emit({
686
+ type: 'note',
687
+ message: `OpenCode session ${requested} no longer exists; the continuation runs in a fresh session without the earlier conversation.`,
688
+ });
689
+ }
690
+ else {
691
+ // A `task` deny an older cezar added stays on the session: OpenCode appends permission
692
+ // rules and has no remove (hearsay-tools/cezarion#2279).
693
+ this.attachSession(stringField(existing, 'id') ?? requested);
694
+ resumed = true;
695
+ }
696
+ }
697
+ if (!resumed) {
698
+ const created = await this.http('POST', '/session', {
699
+ title: 'cezar task',
700
+ ...opencodeToolGrantFields(this.spec.toolGrant),
701
+ });
702
+ const sessionId = stringField(created, 'id');
703
+ if (!sessionId)
704
+ throw new Error('opencode did not return a session id');
705
+ this.attachSession(sessionId);
706
+ }
707
+ // The SSE subscription must be LIVE before the first prompt posts —
708
+ // events the server emits while the POST is in flight would otherwise be
709
+ // lost (a race this await closes; the bundled mock made it visible).
710
+ await this.consumeEvents();
711
+ // Lost-session fallback uses the full skill-inclusive prompt Continue
712
+ // stashed in resumeFallbackSystemPrompt; a true resume re-prepends only
713
+ // extra+handoff (the skill already lives in the thread).
714
+ const systemPrompt = !resumed && requested
715
+ ? (this.spec.resumeFallbackSystemPrompt ?? this.spec.systemPrompt)
716
+ : this.spec.systemPrompt;
717
+ const first = prependSystemPrompt(systemPrompt, this.spec.userPrompt);
718
+ await this.prompt(first, 'opening');
719
+ if (this.refusedBeforeOpening)
720
+ queueMicrotask(() => {
721
+ this.refusedBeforeOpening = false;
722
+ if (this.serverOpen && !this.pendingQuestion && !this.questionReply && this.pendingPermissions.size === 0 && !this.agentRequest) {
723
+ this.opts.onAgentInputReady?.();
724
+ }
725
+ });
726
+ }
727
+ async prompt(text, origin = 'human', signal, generation = this.queuedPromptGeneration) {
728
+ // One turn at a time. `prompt_async` acknowledges before the turn runs,
729
+ // so `ready` no longer serializes prompts the way the long-poll did — a
730
+ // follow-up posted mid-turn would share the turnActive/turnEnded pair
731
+ // with the running turn and let that turn's idle close this one. Waiters
732
+ // resume in FIFO order; a teardown (`finishTurn` runs on every exit
733
+ // path) releases them into the `serverOpen` check below.
734
+ while (this.turnActive || this.followOn)
735
+ await (this.turnActive ? this.turnFinished : this.followOn);
736
+ if (origin === 'human' && generation === this.queuedPromptGeneration)
737
+ this.humanPromptWaiters = Math.max(0, this.humanPromptWaiters - 1);
738
+ if (generation !== this.queuedPromptGeneration)
739
+ return;
740
+ // A queued prompt may have started waiting before the preceding idle armed
741
+ // auto-end. Cancel at actual delivery time, not only at sendMessage time.
742
+ this.cancelAutoEnd();
743
+ if (!this.sessionId || !this.serverOpen)
744
+ return;
745
+ this.openTurn();
746
+ // Turn boundary, v1 and v2 alike — the prompt POST is the turn start
747
+ // (§7.1); the end comes from the SSE `session.idle`, never from the HTTP
748
+ // response below. `POST /session/:id/message` long-polled the whole turn,
749
+ // and undici's default 300s headers timeout ended it as `prompt failed:
750
+ // fetch failed` (#4, upstream #897); `prompt_async` returns immediately.
751
+ this.emitUi(opencodeTurnStarted);
752
+ const body = this.promptBody(text);
753
+ try {
754
+ await this.http('POST', `/session/${this.sessionId}/prompt_async`, body, signal);
755
+ }
756
+ catch (err) {
757
+ this.reportPromptFailure(origin, err);
758
+ throw err;
759
+ }
760
+ }
761
+ reportPromptFailure(origin, err) {
762
+ // No turn started server-side, so no `session.idle` will ever close it —
763
+ // surface the failure and end the turn here instead of parking the run.
764
+ const message = err instanceof Error ? err.message : String(err);
765
+ if (origin === 'agent' && this.providerErrorPending) {
766
+ // Latch the initiating provider failure before rejection reaches the
767
+ // manager's ACK handler (including grace expiry and explicit abort).
768
+ this.providerErrorPending.reported = true;
769
+ if (this.serverOpen)
770
+ this.emit({ type: 'error', message: this.providerErrorPending.message });
771
+ }
772
+ else if (origin === 'agent') {
773
+ // Fatal BEFORE the synthetic boundary: the rejected submission stays
774
+ // queued and must not drain more input or settle DONE.
775
+ if (this.serverOpen) {
776
+ this.emit({ type: 'error', message: `opencode: agent input failed: ${message}` });
777
+ this.interrupt();
778
+ }
779
+ }
780
+ else if (origin === 'opening') {
781
+ this.emit({ type: 'note', message: `opencode: prompt failed: ${message}` });
782
+ // A dropped ACK can be the first sign of a process crash. Retain HTTP
783
+ // rejection details, but let settlement choose one error before turn-end.
784
+ this.openingPromptFailed = true;
785
+ this.exitFailure = `opencode: ${message}`;
786
+ this.interrupt();
787
+ }
788
+ else {
789
+ this.emit({ type: 'note', message: `opencode: prompt failed: ${message}` });
790
+ }
791
+ if (!this.providerErrorPending && origin !== 'opening')
792
+ this.finishTurn();
793
+ // Bootstrap still rejects; its result path reports the latched opening
794
+ // failure. Human follow-ups keep their nonfatal note and turn boundary.
795
+ }
796
+ promptBody(text) {
797
+ const body = { parts: [{ type: 'text', text }] };
798
+ // `spec.model` arrives already normalised to canonical `provider/model`
799
+ // (the run wiring's fail-loud gate). Split it with the shared parser — the
800
+ // one every runner uses — into opencode's `{ providerID, modelID }`.
801
+ const id = parseModelIdentity(this.spec.model);
802
+ if (id)
803
+ body.model = { providerID: id.provider, modelID: id.model };
804
+ const effort = parseEffort(this.spec.effort);
805
+ if (effort)
806
+ body.variant = effort;
807
+ return body;
808
+ }
809
+ /** Busy agent input: the running prompt loop rereads it between steps (1.18.32 probe).
810
+ * No new turn opens; the running turn's idle ends it (#505). */
811
+ async steerPrompt(text, signal) {
812
+ try {
813
+ await this.http('POST', `/session/${this.sessionId}/prompt_async`, this.promptBody(text), signal);
814
+ }
815
+ catch (err) {
816
+ if (this.serverOpen) {
817
+ this.emit({ type: 'error', message: `opencode: agent input failed: ${err instanceof Error ? err.message : String(err)}` });
818
+ this.interrupt();
819
+ }
820
+ throw err;
821
+ }
822
+ }
823
+ /** The single v1 turn-end: from the session's own `session.idle`, the
824
+ * prompt-POST failure path, or the teardown safety net — whichever comes
825
+ * first; the guards make every later call a no-op. */
826
+ /** Turn bookkeeping for a prompt POST, or for a server run that started on its own
827
+ * to answer steered input (#505). */
828
+ openTurn() {
829
+ this.clearLostWakeTimer();
830
+ this.turnActive = true;
831
+ this.agentInputReady = false;
832
+ this.turnEnded = false;
833
+ this.turnSerial += 1;
834
+ this.turnFinished = new Promise((resolve) => {
835
+ this.turnFinishedResolve = resolve;
836
+ });
837
+ }
838
+ clearLostWakeTimer() {
839
+ if (this.lostWakeTimer)
840
+ clearTimeout(this.lostWakeTimer);
841
+ this.lostWakeTimer = undefined;
842
+ this.settleFollowOn();
843
+ }
844
+ /** The follow-on wait is over. Input it refused is offered again unless a turn took over. */
845
+ settleFollowOn() {
846
+ if (!this.followOn)
847
+ return;
848
+ this.followOn = undefined;
849
+ this.followOnResolve();
850
+ if (!this.refusedForFollowOn)
851
+ return;
852
+ this.refusedForFollowOn = false;
853
+ if (this.turnActive)
854
+ return;
855
+ queueMicrotask(() => this.notifyAgentInputReady());
856
+ }
857
+ finishTurn() {
858
+ if (!this.turnActive || this.turnEnded)
859
+ return;
860
+ this.turnEnded = true;
861
+ this.turnActive = false;
862
+ this.questionCapture = undefined;
863
+ // SSE idle can beat the independent reply HTTP response. The active reply
864
+ // owns pending-question cleanup; without one, the pending ask is stale.
865
+ if (!this.questionReply)
866
+ this.pendingQuestion = undefined;
867
+ // OpenCode settles its own pending permission requests when the run stops.
868
+ this.expirePermissions('turn ended');
869
+ this.turnFinishedResolve();
870
+ // A part that never saw `time.end` (abort, server quirk) still surfaces
871
+ // its prose before the turn boundary (run.ts reads markers there).
872
+ this.textCoalescer.flush();
873
+ this.agentInputReady = true;
874
+ // A prompt that opened this turn was processed by it; steered input the turn never
875
+ // answered (no assistant message named it as parentID) is a lost wake (#505).
876
+ // A turn that failed may never have reached the model: its opener stays pending, so a
877
+ // closing session returns it to the queue (#505 review).
878
+ const opened = this.turnErrored ? [] : [...this.turnOpeners].flatMap(id => this.submissions.consume(id));
879
+ this.turnOpeners.clear();
880
+ this.turnErrored = false;
881
+ if (opened.length)
882
+ this.opts.onAgentInputConsumed?.(opened);
883
+ this.emit({ type: 'turn-end' });
884
+ // Steered input the server holds is read by a follow-on run, or stranded by the
885
+ // upstream lost wake (anomalyco/opencode#46842). Only a quiet grace window tells
886
+ // them apart; then report it so cezar submits it as a new prompt.
887
+ if (this.submissions.pending > 0) {
888
+ this.clearLostWakeTimer();
889
+ this.followOn = new Promise((resolve) => { this.followOnResolve = resolve; });
890
+ this.lostWakeTimer = setTimeout(() => {
891
+ this.lostWakeTimer = undefined;
892
+ if (!this.serverOpen || this.turnActive) {
893
+ this.settleFollowOn();
894
+ return;
895
+ }
896
+ const inputIds = this.submissions.takeUnconsumed();
897
+ this.userMessageSubmission.clear();
898
+ if (inputIds.length)
899
+ this.emit({ type: 'input-unconsumed', inputIds });
900
+ this.settleFollowOn();
901
+ }, OPENCODE_LOST_WAKE_GRACE_MS);
902
+ this.lostWakeTimer.unref?.();
903
+ }
904
+ if (!this.questionReply)
905
+ this.scheduleAutoEnd();
906
+ }
907
+ // ---- SSE stream ---------------------------------------------------------
908
+ /** Resolves once the SSE stream is CONNECTED (headers in) — the frames are
909
+ * then drained in the background. Callers await the connection so no
910
+ * event emitted after this resolves can be missed.
911
+ *
912
+ * Speaks node:http, not fetch: undici's default Agent cuts a response
913
+ * body idle for 300s, which would sever a quiet turn's bus mid-run (#4) —
914
+ * node's own client has no idle timeout. (`process.getBuiltinModule`
915
+ * cannot fix that: undici is bundled into node but not exposed as a
916
+ * built-in, so there is no no-timeout dispatcher to hand fetch without
917
+ * taking undici as a real dependency.)
918
+ *
919
+ * A connection that cannot be established throws, failing `bootstrap`:
920
+ * with `prompt_async` this stream is the only source of turn-ends, so a
921
+ * session that cannot hear it is dead on arrival, not degraded. */
922
+ async consumeEvents() {
923
+ if (!this.baseUrl)
924
+ return;
925
+ let res;
926
+ try {
927
+ res = await new Promise((resolve, reject) => {
928
+ const req = httpRequest(`${this.baseUrl}/event`, { headers: { accept: 'text/event-stream' }, signal: this.sse.signal }, resolve);
929
+ req.on('error', reject);
930
+ req.end();
931
+ });
932
+ }
933
+ catch (err) {
934
+ if (this.sse.signal.aborted)
935
+ return; // torn down during bootstrap — not a failure
936
+ const message = err instanceof Error ? err.message : String(err);
937
+ throw new Error(`event stream failed to connect: ${message}`);
938
+ }
939
+ // node:http hands over EVERY response, error statuses included — a proxy's
940
+ // 401 or a non-SSE 500 body is not an event bus, however well it parses.
941
+ const status = res.statusCode ?? 0;
942
+ if (status < 200 || status >= 300) {
943
+ res.resume(); // discard the body so the socket is released
944
+ throw new Error(`event stream failed to connect: HTTP ${status}`);
945
+ }
946
+ void this.readEvents(res);
947
+ }
948
+ async readEvents(res) {
949
+ // StringDecoder under the hood — multi-byte characters split across
950
+ // chunks arrive whole, like the TextDecoder streaming mode did.
951
+ res.setEncoding('utf8');
952
+ let buffer = '';
953
+ try {
954
+ for await (const chunk of res) {
955
+ this.opts.onActivity?.(); // Includes SSE heartbeat comments.
956
+ buffer += chunk;
957
+ let sep;
958
+ while ((sep = buffer.indexOf('\n\n')) >= 0) {
959
+ const frame = buffer.slice(0, sep);
960
+ buffer = buffer.slice(sep + 2);
961
+ await this.handleFrame(frame);
962
+ }
963
+ }
964
+ }
965
+ catch {
966
+ // aborted — normal on end()/interrupt
967
+ }
968
+ finally {
969
+ // `session.idle` rides this stream and nothing else — a feed that dies
970
+ // while the server is still up would otherwise park the current turn
971
+ // forever and leave every later prompt unanswerable. An `error`, not a
972
+ // note: the turn's remaining output is lost, so the step must record a
973
+ // failure (run.ts classifies from v1 `error` only), never pass as an
974
+ // empty success. Then close the turn (flushing what did arrive) and end
975
+ // the session; "Continue" GETs this session id on the next server.
976
+ if (this.serverOpen && !this.sse.signal.aborted) {
977
+ this.exitFailure = 'opencode: event stream closed unexpectedly';
978
+ this.end();
979
+ }
980
+ }
981
+ }
982
+ async handleFrame(frame) {
983
+ const dataLines = frame
984
+ .split('\n')
985
+ .filter((l) => l.startsWith('data:'))
986
+ .map((l) => l.slice(5).trim());
987
+ if (dataLines.length === 0)
988
+ return;
989
+ let evt;
990
+ try {
991
+ evt = JSON.parse(dataLines.join('\n'));
992
+ }
993
+ catch {
994
+ return;
995
+ }
996
+ this.emitUi((state) => mapOpencodeEvent(evt, state));
997
+ const sid = stringField(evt.properties ?? {}, 'sessionID');
998
+ if (evt.type === 'session.error' && !opencodeSkillWarning(evt.properties ?? {}) && (sid === undefined || sid === this.sessionId) && this.agentRequest) {
999
+ // HTTP and SSE are independent sockets: the error can overtake a positive
1000
+ // prompt ACK. Let that exact request settle before v1 makes RunManager
1001
+ // interrupt it. Keep later SSE idle frames behind the same barrier.
1002
+ // Reuse the teardown grace as a hard bound: a wedged ACK cannot keep a
1003
+ // failed turn alive indefinitely. Explicit end/interrupt still abort now.
1004
+ const failure = { message: this.sessionErrorMessage(evt.properties?.error), reported: false };
1005
+ this.providerErrorPending = failure;
1006
+ const request = this.agentRequest;
1007
+ const timer = setTimeout(() => request.abort(), KILL_GRACE_MS);
1008
+ try {
1009
+ await this.agentAcknowledgement?.catch(() => undefined);
1010
+ if (this.serverOpen && !failure.reported)
1011
+ this.handleEvent(evt);
1012
+ }
1013
+ finally {
1014
+ clearTimeout(timer);
1015
+ this.providerErrorPending = undefined;
1016
+ }
1017
+ }
1018
+ else {
1019
+ this.handleEvent(evt);
1020
+ }
1021
+ }
1022
+ /** #53 — a forwarded session error must never read like a missing
1023
+ * executable: a bare upstream `Not Found` used to surface as
1024
+ * `opencode: Not Found`, indistinguishable from the spawn failure whose
1025
+ * PATH/installation guidance lives in `wrapSpawnError`. Name the selected
1026
+ * provider/model — only the runner knows it — and keep any structured
1027
+ * upstream status or code, so a provider outage is recognizable as one. */
1028
+ sessionErrorMessage(error) {
1029
+ const id = parseModelIdentity(this.spec.model);
1030
+ const context = id ? `provider ${formatModelIdentity(id)}` : 'provider';
1031
+ const detail = sessionErrorDetail(error);
1032
+ const suffix = detail ? ` (${detail})` : '';
1033
+ return `opencode: ${context} request failed: ${sessionErrorText(error)}${suffix}`;
1034
+ }
1035
+ handleEvent(evt) {
1036
+ const type = evt.type ?? '';
1037
+ const props = evt.properties ?? {};
1038
+ if (type === 'message.updated' || type === 'message.created' || type === 'message.completed') {
1039
+ this.handleMessageEvent(props);
1040
+ }
1041
+ else if (type === 'message.part.updated' || type === 'message.part.created') {
1042
+ this.handlePart(props.part ?? props);
1043
+ }
1044
+ else if (type === 'permission.asked') {
1045
+ this.handlePermissionAsked(props);
1046
+ }
1047
+ else if (type === 'permission.replied') {
1048
+ this.handlePermissionReplied(props);
1049
+ }
1050
+ else if (type === 'session.idle') {
1051
+ // THE turn-end signal. The SSE bus is server-wide, so a child session's
1052
+ // (sub-agent's) idle must not close the main turn; an idle with no
1053
+ // sessionID is treated as ours, like the v2 mapper does.
1054
+ const sid = stringField(props, 'sessionID');
1055
+ if (sid === undefined || sid === this.sessionId)
1056
+ this.finishTurn();
1057
+ }
1058
+ else if (type === 'session.error') {
1059
+ this.handleSessionError(props);
1060
+ }
1061
+ }
1062
+ handleMessageEvent(props) {
1063
+ const info = props.info ?? props;
1064
+ const mid = stringField(info, 'id');
1065
+ const role = stringField(info, 'role');
1066
+ if (mid && role)
1067
+ this.msgRole.set(mid, role);
1068
+ // The model answers a steered user message: it has read it (#505).
1069
+ const parent = role === 'assistant' ? stringField(info, 'parentID') : undefined;
1070
+ const submission = parent ? this.userMessageSubmission.get(parent) : undefined;
1071
+ if (parent && submission) {
1072
+ this.userMessageSubmission.delete(parent);
1073
+ // After an idle, the server started a new run for steered input: a new turn.
1074
+ if (!this.turnActive && this.serverOpen) {
1075
+ this.openTurn();
1076
+ this.emitUi(opencodeTurnStarted);
1077
+ }
1078
+ const ids = this.submissions.consume(submission);
1079
+ if (ids.length)
1080
+ this.opts.onAgentInputConsumed?.(ids);
1081
+ }
1082
+ this.absorbUsage(info);
1083
+ }
1084
+ handlePermissionReplied(props) {
1085
+ // OpenCode settled the request, in any phase: our own reply, another client's, or its own.
1086
+ const nativeId = stringField(props, 'requestID');
1087
+ const pending = nativeId === undefined ? undefined : this.pendingPermissions.get(nativeId);
1088
+ // OpenCode publishes this before it answers the reply route, so a human reply in flight
1089
+ // that it echoes is that human's answer.
1090
+ if (!pending)
1091
+ return;
1092
+ const answered = pending.phase === 'answering' && pending.answer?.reply === stringField(props, 'reply');
1093
+ this.settlePermission(pending, answered ? { optionId: pending.answer.optionId } : { reason: 'resolved by OpenCode' });
1094
+ }
1095
+ handleSessionError(props) {
1096
+ const warning = opencodeSkillWarning(props);
1097
+ if (warning) {
1098
+ this.emit({ type: 'note', message: warning });
1099
+ return;
1100
+ }
1101
+ // The wire's failure signal, now that the prompt POST returns
1102
+ // before the turn runs: forward it to v1, whose `error` events are what
1103
+ // run.ts records failed steps from — dropped, the terminal idle would
1104
+ // file a provider/auth failure as a successful step. The idle that
1105
+ // follows still closes the turn.
1106
+ const sid = stringField(props, 'sessionID');
1107
+ if (sid === undefined || sid === this.sessionId) {
1108
+ this.turnErrored = true;
1109
+ this.emit({ type: 'error', message: this.sessionErrorMessage(props.error) });
1110
+ }
1111
+ }
1112
+ handlePart(part) {
1113
+ if (!this.partBelongsToUs(part))
1114
+ return;
1115
+ const messageID = stringField(part, 'messageID');
1116
+ const kind = stringField(part, 'type');
1117
+ const id = stringField(part, 'id') ?? messageID ?? '';
1118
+ if (kind === 'text') {
1119
+ const full = stringField(part, 'text') ?? '';
1120
+ const seen = this.textSeen.get(id) ?? 0;
1121
+ if (full.length > seen) {
1122
+ this.textSeen.set(id, full.length);
1123
+ this.textCoalescer.append(id, full.slice(seen));
1124
+ }
1125
+ // `time.end` marks the part finished (same signal the v2 mapper uses) —
1126
+ // emit the whole block once, preferring the snapshot's full text.
1127
+ const time = part.time;
1128
+ if (time && typeof time === 'object' && typeof time.end === 'number') {
1129
+ this.textCoalescer.complete(id, full);
1130
+ }
1131
+ }
1132
+ else if (kind === 'tool') {
1133
+ this.handleToolPart(part, id, messageID);
1134
+ }
1135
+ }
1136
+ partBelongsToUs(part) {
1137
+ // The SSE bus carries every session on the server — drop parts that
1138
+ // belong to another one (a sub-agent's stream is surfaced by v2 only).
1139
+ const partSession = stringField(part, 'sessionID');
1140
+ if (partSession !== undefined && this.sessionId !== undefined && partSession !== this.sessionId)
1141
+ return false;
1142
+ // Only surface parts of assistant messages — the user's own message streams
1143
+ // over the same feed. Role is known early (the message.updated event
1144
+ // precedes its parts); an unknown role means "not assistant yet" → skip.
1145
+ const messageID = stringField(part, 'messageID');
1146
+ if (messageID && this.msgRole.get(messageID) !== 'assistant') {
1147
+ // A user message carrying submitted agent text: remember which submission it is.
1148
+ if (this.msgRole.get(messageID) === 'user' && stringField(part, 'type') === 'text' && !this.userMessageSubmission.has(messageID)) {
1149
+ const submission = this.submissions.findByText(stringField(part, 'text') ?? '');
1150
+ if (submission && ![...this.userMessageSubmission.values()].includes(submission))
1151
+ this.userMessageSubmission.set(messageID, submission);
1152
+ }
1153
+ return false;
1154
+ }
1155
+ return true;
1156
+ }
1157
+ handleToolPart(part, id, messageID) {
1158
+ const state = part.state ?? {};
1159
+ const status = stringField(state, 'status');
1160
+ const name = stringField(part, 'tool') ?? stringField(part, 'name') ?? 'tool';
1161
+ this.maybeCaptureQuestion(part, state, status, name, messageID);
1162
+ const callId = id || `${name}-${this.toolsSeen.size}`;
1163
+ if (!this.toolsSeen.has(callId)) {
1164
+ this.toolsSeen.add(callId);
1165
+ this.toolCalls.push({ id: callId, name, input: state.input ?? state });
1166
+ this.emit({ type: 'tool-call', id: callId, tool: name, input: state.input ?? state });
1167
+ }
1168
+ if (status === 'completed' || status === 'error') {
1169
+ this.emit({ type: 'tool-result', toolCallId: callId, result: safeStringify(state.output ?? state.result ?? state), isError: status === 'error' });
1170
+ }
1171
+ }
1172
+ maybeCaptureQuestion(part, state, status, name, messageID) {
1173
+ const questionPartId = stringField(part, 'id') ?? stringField(part, 'callID') ?? messageID;
1174
+ const questionInput = state.input ?? state;
1175
+ const questionReady = name === 'question' && (toCezarQuestions(questionInput) !== null || status !== 'pending');
1176
+ if (!questionReady || !this.turnActive || this.pendingQuestion !== undefined || this.questionCapture !== undefined || this.questionReply !== undefined || (questionPartId !== undefined && this.handledQuestionParts.has(questionPartId)))
1177
+ return;
1178
+ if (questionPartId)
1179
+ this.handledQuestionParts.add(questionPartId);
1180
+ const capture = this.captureQuestion(questionInput);
1181
+ this.questionCapture = capture;
1182
+ const clearCapture = () => { if (this.questionCapture === capture)
1183
+ this.questionCapture = undefined; };
1184
+ void capture.then(clearCapture, clearCapture);
1185
+ }
1186
+ /** Pull cumulative tokens/cost out of an assistant message info object. */
1187
+ absorbUsage(info) {
1188
+ if (!info)
1189
+ return;
1190
+ const tokens = info.tokens;
1191
+ if (tokens) {
1192
+ const input = numField(tokens, 'input');
1193
+ const output = numField(tokens, 'output');
1194
+ const reasoning = numField(tokens, 'reasoning');
1195
+ const total = input + output + reasoning;
1196
+ if (total > this.tokensUsed) {
1197
+ this.tokensUsed = total;
1198
+ this.emit({ type: 'token-usage', tokensUsed: this.tokensUsed });
1199
+ }
1200
+ }
1201
+ const messageId = stringField(info, 'id');
1202
+ const cost = info.cost;
1203
+ if (messageId && info.role === 'assistant' &&
1204
+ (info.sessionID === undefined || info.sessionID === this.sessionId) &&
1205
+ typeof cost === 'number' && Number.isFinite(cost) && cost >= 0) {
1206
+ const previous = this.costByMessage.get(messageId);
1207
+ if (previous === undefined || cost > previous) {
1208
+ this.emit({ type: 'cost', usd: cost - (previous ?? 0) });
1209
+ this.costByMessage.set(messageId, cost);
1210
+ }
1211
+ }
1212
+ }
1213
+ async captureQuestion(input) {
1214
+ const questions = toCezarQuestions(input);
1215
+ const turnSerial = this.turnSerial;
1216
+ let requestId;
1217
+ for (let attempt = 0; attempt < 8; attempt += 1) {
1218
+ if (!this.turnActive || this.turnSerial !== turnSerial)
1219
+ return;
1220
+ requestId = await this.pendingQuestionId().catch(() => undefined);
1221
+ if (requestId)
1222
+ break;
1223
+ if (attempt < 7)
1224
+ await sleep(150);
1225
+ }
1226
+ if (!this.turnActive || this.turnSerial !== turnSerial)
1227
+ return;
1228
+ if (!questions) {
1229
+ if (!requestId) {
1230
+ this.emit({
1231
+ type: 'error',
1232
+ message: 'opencode: unsupported native question could not be rejected: no pending question id',
1233
+ });
1234
+ this.finishTurn();
1235
+ this.end();
1236
+ return;
1237
+ }
1238
+ try {
1239
+ await this.http('POST', `/question/${encodeURIComponent(requestId)}/reject`, undefined);
1240
+ this.emit({ type: 'note', message: 'opencode: unsupported native question rejected' });
1241
+ }
1242
+ catch (err) {
1243
+ const message = err instanceof Error ? err.message : String(err);
1244
+ this.emit({
1245
+ type: 'error',
1246
+ message: `opencode: unsupported native question rejection failed: ${message}`,
1247
+ });
1248
+ this.finishTurn();
1249
+ this.end();
1250
+ }
1251
+ return;
1252
+ }
1253
+ const pending = {
1254
+ requestId,
1255
+ askRequestId: requestId ?? `opencode-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
1256
+ questions,
1257
+ };
1258
+ this.pendingQuestion = pending;
1259
+ this.emitQuestion(pending);
1260
+ }
1261
+ emitQuestion(pending) {
1262
+ this.emitUi((state) => ({
1263
+ state,
1264
+ events: [
1265
+ {
1266
+ type: 'ask.requested',
1267
+ requestId: pending.askRequestId,
1268
+ questions: uiAskQuestions(pending.questions),
1269
+ },
1270
+ ],
1271
+ }));
1272
+ }
1273
+ async pendingQuestionId() {
1274
+ const value = await this.http('GET', '/question', undefined);
1275
+ if (!Array.isArray(value))
1276
+ return undefined;
1277
+ for (const entry of value) {
1278
+ if (!isRecord(entry) || stringField(entry, 'sessionID') !== this.sessionId)
1279
+ continue;
1280
+ const id = stringField(entry, 'id');
1281
+ if (id)
1282
+ return id;
1283
+ }
1284
+ return undefined;
1285
+ }
1286
+ async replyQuestion(pending, text) {
1287
+ try {
1288
+ const requestId = pending.requestId ?? (await this.pendingQuestionId());
1289
+ if (!requestId)
1290
+ throw new Error('no pending question id');
1291
+ pending.requestId = requestId;
1292
+ await this.http('POST', `/question/${encodeURIComponent(requestId)}/reply`, {
1293
+ answers: questionAnswers(pending.questions, text),
1294
+ });
1295
+ if (this.pendingQuestion === pending)
1296
+ this.pendingQuestion = undefined;
1297
+ const queued = this.queuedQuestionMessages.splice(0);
1298
+ for (const message of queued)
1299
+ this.deliverPrompt(message);
1300
+ if (queued.length === 0 && this.turnEnded)
1301
+ this.scheduleAutoEnd();
1302
+ }
1303
+ catch (err) {
1304
+ const message = err instanceof Error ? err.message : String(err);
1305
+ this.emit({ type: 'note', message: `opencode: question reply failed: ${message}` });
1306
+ if (this.pendingQuestion === pending)
1307
+ this.emitQuestion(pending);
1308
+ }
1309
+ }
1310
+ // ---- permissions (hearsay-tools/cezarion#1266) --------------------------
1311
+ /** Any session on this private server may ask, child sessions included. The ask holds agent
1312
+ * input and auto-end from receipt until OpenCode settles it, the turn ends or the session does. */
1313
+ handlePermissionAsked(props) {
1314
+ if (!this.serverOpen)
1315
+ return;
1316
+ const parsed = opencodePermissionAskSchema.safeParse(props);
1317
+ const nativeId = parsed.success ? parsed.data.id : typeof props.id === 'string' && props.id ? props.id : undefined;
1318
+ if (nativeId === undefined) {
1319
+ // OpenCode blocks the asking tool until a reply names this request: fail closed.
1320
+ this.emit({ type: 'error', message: 'opencode: unsupported permission request could not be rejected: no request id' });
1321
+ this.finishTurn();
1322
+ this.end();
1323
+ return;
1324
+ }
1325
+ if (this.handledPermissionIds.has(nativeId))
1326
+ return;
1327
+ this.handledPermissionIds.add(nativeId);
1328
+ // OpenCode asks only from inside a running session loop, so a main-session ask after the idle
1329
+ // means the server started a run: reopen the turn, as a steered follow-on run does. That run's
1330
+ // own idle closes it. A child session's ask leaves the main turn alone.
1331
+ if (!this.turnActive && this.sessionId !== undefined && stringField(props, 'sessionID') === this.sessionId) {
1332
+ this.openTurn();
1333
+ this.emitUi(opencodeTurnStarted);
1334
+ }
1335
+ const pending = parsed.success
1336
+ ? { nativeId, ask: parsed.data, phase: 'classifying' }
1337
+ : { nativeId, phase: 'rejecting' };
1338
+ this.pendingPermissions.set(nativeId, pending);
1339
+ this.agentInputReady = false;
1340
+ this.cancelAutoEnd();
1341
+ if (!parsed.success) {
1342
+ this.emit({ type: 'note', message: 'opencode: rejected an OpenCode permission request cezar could not read' });
1343
+ void this.rejectPermission(pending, 'cezar could not read this permission request');
1344
+ return;
1345
+ }
1346
+ this.permissionQueue = this.permissionQueue.then(() => this.answerPermission(pending)).catch(() => undefined);
1347
+ }
1348
+ /** Still the ask OpenCode is waiting on: not settled, expired or torn down since an await. */
1349
+ permissionLive(pending) {
1350
+ return this.serverOpen && this.pendingPermissions.get(pending.nativeId) === pending;
1351
+ }
1352
+ async answerPermission(pending) {
1353
+ const rules = await this.userPermissionRules();
1354
+ if (!this.permissionLive(pending))
1355
+ return;
1356
+ if (isOpencodeDefaultAsk(pending.ask, rules)) {
1357
+ pending.phase = 'auto-replying';
1358
+ try {
1359
+ // Never `always`: that can persist an approval beyond this run.
1360
+ await this.replyPermission(pending.nativeId, { reply: 'once' });
1361
+ }
1362
+ catch {
1363
+ // OpenCode is still waiting: a failed automatic reply asks the human instead.
1364
+ if (this.permissionLive(pending))
1365
+ this.bridgePermission(pending);
1366
+ return;
1367
+ }
1368
+ if (this.serverOpen && !this.answeredDefaultAsk) {
1369
+ this.answeredDefaultAsk = true;
1370
+ this.emit({
1371
+ type: 'note',
1372
+ message: "opencode: answered OpenCode's built-in permission asks (outside-worktree reads, .env reads, repeated-call guard) with allow-once; your own OpenCode permission rules still ask",
1373
+ });
1374
+ }
1375
+ this.settlePermission(pending);
1376
+ return;
1377
+ }
1378
+ this.bridgePermission(pending);
1379
+ }
1380
+ /** One lazy `GET /config` per session. An unreadable config is unknown provenance: every ask goes to the cockpit. */
1381
+ userPermissionRules() {
1382
+ this.permissionRules ??= this.readConfig().then(opencodeUserPermissionRules, () => undefined).then((rules) => {
1383
+ if (!rules)
1384
+ this.emit({ type: 'note', message: 'opencode: could not read the OpenCode config, so every permission prompt goes to the cockpit' });
1385
+ return rules;
1386
+ });
1387
+ return this.permissionRules;
1388
+ }
1389
+ /** Unlike `http`, an empty or unparsable body is a failure, never an empty config. */
1390
+ async readConfig() {
1391
+ if (!this.baseUrl)
1392
+ throw new Error('opencode server not ready');
1393
+ const res = await fetch(`${this.baseUrl}/config`, { method: 'GET' });
1394
+ if (!res.ok)
1395
+ throw new Error(`GET /config → ${res.status}`);
1396
+ return JSON.parse(await res.text());
1397
+ }
1398
+ bridgePermission(pending) {
1399
+ if (!this.opts.onUiEvent) {
1400
+ const message = 'no permission UI is attached to this cezar session';
1401
+ this.emit({ type: 'note', message: `opencode: rejected the OpenCode ${pending.ask.permission} permission prompt: ${message}` });
1402
+ void this.rejectPermission(pending, message);
1403
+ return;
1404
+ }
1405
+ if (!this.showPermissionCard(pending))
1406
+ void this.rejectPermission(pending, 'permission UI unavailable');
1407
+ }
1408
+ /** Emits a fresh cockpit card, with new ids, for the ask. False when the UI threw: that card is resolved again. */
1409
+ showPermissionCard(pending) {
1410
+ const bridge = opencodePermissionBridge(pending.ask);
1411
+ pending.bridge = bridge;
1412
+ pending.phase = 'card';
1413
+ pending.answer = undefined;
1414
+ try {
1415
+ this.opts.onUiEvent(bridge.event);
1416
+ return true;
1417
+ }
1418
+ catch {
1419
+ // A throwing consumer cannot leave OpenCode waiting on a card nobody sees.
1420
+ pending.bridge = undefined;
1421
+ this.emitPermissionResolved(bridge.event.requestId, { reason: 'permission UI unavailable' });
1422
+ return false;
1423
+ }
1424
+ }
1425
+ /** A reject OpenCode never receives leaves the asking tool blocked: fail closed. */
1426
+ async rejectPermission(pending, message) {
1427
+ pending.phase = 'rejecting';
1428
+ try {
1429
+ await this.replyPermission(pending.nativeId, { reply: 'reject', message });
1430
+ }
1431
+ catch (err) {
1432
+ if (!this.permissionLive(pending))
1433
+ return;
1434
+ this.emit({ type: 'error', message: `opencode: permission rejection failed: ${err instanceof Error ? err.message : String(err)}` });
1435
+ this.finishTurn();
1436
+ this.end();
1437
+ return;
1438
+ }
1439
+ this.settlePermission(pending);
1440
+ }
1441
+ /** The card and the input barrier stay until OpenCode accepts the reply; a failed reply shows a fresh card. */
1442
+ respondPermission(requestId, optionId) {
1443
+ if (!this.serverOpen)
1444
+ return false;
1445
+ const pending = [...this.pendingPermissions.values()].find((entry) => entry.bridge?.event.requestId === requestId);
1446
+ const reply = pending?.bridge?.replies.get(optionId);
1447
+ if (!pending || pending.phase !== 'card' || !reply)
1448
+ return false;
1449
+ const bridge = pending.bridge;
1450
+ pending.phase = 'answering';
1451
+ pending.answer = { optionId, reply };
1452
+ void this.replyPermission(pending.nativeId, { reply }).then(() => {
1453
+ if (this.permissionLive(pending) && pending.bridge === bridge)
1454
+ this.settlePermission(pending, { optionId });
1455
+ }, (err) => {
1456
+ if (!this.permissionLive(pending) || pending.bridge !== bridge)
1457
+ return;
1458
+ this.emit({ type: 'note', message: `opencode: permission reply failed: ${err instanceof Error ? err.message : String(err)}` });
1459
+ // The fresh card first, so the run's pending set never empties and it stays parked.
1460
+ const shown = this.showPermissionCard(pending);
1461
+ this.emitPermissionResolved(bridge.event.requestId, { reason: 'permission reply failed' });
1462
+ if (!shown)
1463
+ void this.rejectPermission(pending, 'permission UI unavailable');
1464
+ });
1465
+ return true;
1466
+ }
1467
+ async replyPermission(nativeId, body) {
1468
+ await this.http('POST', `/permission/${encodeURIComponent(nativeId)}/reply`, body);
1469
+ }
1470
+ /** OpenCode no longer waits on the ask: retire it, resolve its card, and release the barrier. */
1471
+ settlePermission(pending, resolution = {}) {
1472
+ if (this.pendingPermissions.get(pending.nativeId) !== pending)
1473
+ return;
1474
+ this.pendingPermissions.delete(pending.nativeId);
1475
+ if (pending.bridge)
1476
+ this.emitPermissionResolved(pending.bridge.event.requestId, resolution);
1477
+ if (this.pendingPermissions.size)
1478
+ return;
1479
+ this.notifyAgentInputReady();
1480
+ // A card that arrived after the turn ended cancelled its auto-end: re-arm it.
1481
+ if (this.turnEnded && !this.turnActive && !this.questionReply)
1482
+ this.scheduleAutoEnd();
1483
+ }
1484
+ /** Retires every ask without HTTP: OpenCode settles its own request on idle or abort. The
1485
+ * caller owns what follows (turn end or teardown), so the barrier release is not run here. */
1486
+ expirePermissions(reason) {
1487
+ for (const pending of [...this.pendingPermissions.values()]) {
1488
+ this.pendingPermissions.delete(pending.nativeId);
1489
+ if (pending.bridge)
1490
+ this.emitPermissionResolved(pending.bridge.event.requestId, { reason });
1491
+ }
1492
+ }
1493
+ emitPermissionResolved(requestId, resolution) {
1494
+ try {
1495
+ this.opts.onUiEvent?.({ type: 'permission.resolved', requestId, ...resolution });
1496
+ }
1497
+ catch { /* A failed consumer must not strand other pending requests. */ }
1498
+ }
1499
+ // ---- http ---------------------------------------------------------------
1500
+ async http(method, path, body, signal) {
1501
+ if (!this.baseUrl)
1502
+ throw new Error('opencode server not ready');
1503
+ // Plain fetch is fine here: every call is a short round-trip now that
1504
+ // prompts go through `prompt_async` — nothing long-polls anymore.
1505
+ const res = await fetch(`${this.baseUrl}${path}`, {
1506
+ method,
1507
+ ...(signal !== undefined ? { signal } : {}),
1508
+ headers: body !== undefined ? { 'content-type': 'application/json' } : {},
1509
+ ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
1510
+ });
1511
+ if (!res.ok) {
1512
+ const detail = await res.text().catch(() => '');
1513
+ throw new Error(`${method} ${path} → ${res.status} ${detail.slice(0, 200)}`);
1514
+ }
1515
+ const text = await res.text();
1516
+ if (!text)
1517
+ return {};
1518
+ try {
1519
+ return JSON.parse(text);
1520
+ }
1521
+ catch {
1522
+ return {};
1523
+ }
1524
+ }
1525
+ emit(event) {
1526
+ this.onEvent?.(event);
1527
+ }
1528
+ /** The mapper never throws, but a defect in it must still never disturb
1529
+ * the v1 stream — hence the belt-and-braces try. */
1530
+ emitUi(map) {
1531
+ try {
1532
+ const mapped = map(this.uiState);
1533
+ this.uiState = mapped.state;
1534
+ if (this.opts.onUiEvent) {
1535
+ for (const event of mapped.events)
1536
+ this.opts.onUiEvent(event);
1537
+ }
1538
+ }
1539
+ catch {
1540
+ // v2 mapping is best-effort; v1 consumers stay unaffected.
1541
+ }
1542
+ }
1543
+ }
1544
+ function textOf(content) {
1545
+ return content
1546
+ .filter((b) => b.type === 'text')
1547
+ .map((b) => b.text)
1548
+ .join('\n')
1549
+ .trim();
1550
+ }
1551
+ function toCezarQuestions(value) {
1552
+ if (!isRecord(value) || !Array.isArray(value.questions))
1553
+ return null;
1554
+ if (value.questions.length < 1 || value.questions.length > 4)
1555
+ return null;
1556
+ const questions = [];
1557
+ for (const rawQuestion of value.questions) {
1558
+ if (!isRecord(rawQuestion))
1559
+ return null;
1560
+ const header = clippedString(rawQuestion.header, 12);
1561
+ const question = clippedString(rawQuestion.question, 400);
1562
+ if (!header || !question || !Array.isArray(rawQuestion.options))
1563
+ return null;
1564
+ const options = [];
1565
+ for (const rawOption of rawQuestion.options) {
1566
+ if (options.length === 4)
1567
+ break;
1568
+ if (!isRecord(rawOption))
1569
+ continue;
1570
+ const label = clippedString(rawOption.label, 60);
1571
+ if (!label)
1572
+ continue;
1573
+ const description = clippedString(rawOption.description, 280);
1574
+ options.push({ label, ...(description ? { description } : {}) });
1575
+ }
1576
+ if (options.length < 2)
1577
+ return null;
1578
+ questions.push({
1579
+ header,
1580
+ question,
1581
+ options,
1582
+ ...(rawQuestion.multiple === true ? { multiSelect: true } : {}),
1583
+ });
1584
+ }
1585
+ return parseAskRequest({ questions })?.questions ?? null;
1586
+ }
1587
+ function questionAnswers(questions, text) {
1588
+ const answers = questions.map(() => []);
1589
+ const matched = new Set();
1590
+ for (const line of text.split('\n')) {
1591
+ const trimmed = line.trim();
1592
+ const index = questions.findIndex((question, questionIndex) => !matched.has(questionIndex) && trimmed.startsWith(`${question.header}:`));
1593
+ if (index < 0)
1594
+ continue;
1595
+ matched.add(index);
1596
+ answers[index] = trimmed
1597
+ .slice(questions[index].header.length + 1)
1598
+ .split(',')
1599
+ .map((answer) => answer.trim())
1600
+ .filter(Boolean);
1601
+ }
1602
+ if (matched.size === 0 && answers[0])
1603
+ answers[0] = [text.trim()];
1604
+ return answers;
1605
+ }
1606
+ function clippedString(value, max) {
1607
+ if (typeof value !== 'string')
1608
+ return undefined;
1609
+ const trimmed = value.trim();
1610
+ return trimmed ? trimmed.slice(0, max) : undefined;
1611
+ }
1612
+ function isRecord(value) {
1613
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
1614
+ }
1615
+ function sleep(ms) {
1616
+ return new Promise((resolve) => setTimeout(resolve, ms));
1617
+ }
1618
+ function stringField(obj, key) {
1619
+ const v = obj[key];
1620
+ return typeof v === 'string' ? v : undefined;
1621
+ }
1622
+ /** Same reading of the wire error shape as the v2 mapper's `errorText`
1623
+ * (`opencode-ui-mapper.ts`): a bare string, `{message}`, `{data:{message}}`
1624
+ * (the real server's `ProviderAuthError` shape), or `{name}` as a last resort. */
1625
+ function sessionErrorText(error) {
1626
+ if (typeof error === 'string')
1627
+ return error;
1628
+ if (typeof error !== 'object' || error === null)
1629
+ return 'session error';
1630
+ const rec = error;
1631
+ const data = typeof rec.data === 'object' && rec.data !== null ? rec.data : undefined;
1632
+ return (stringField(rec, 'message') ??
1633
+ (data && stringField(data, 'message')) ??
1634
+ stringField(rec, 'name') ??
1635
+ 'session error');
1636
+ }
1637
+ /** Structured upstream status or code, when the wire error carries one —
1638
+ * the AI SDK's `AI_APICallError` exposes a numeric `statusCode`, and some
1639
+ * providers nest a `code` inside `data`. Status wins over code; anything
1640
+ * else adds nothing (#53). */
1641
+ function sessionErrorDetail(error) {
1642
+ if (typeof error !== 'object' || error === null)
1643
+ return undefined;
1644
+ const rec = error;
1645
+ const data = isRecord(rec.data) ? rec.data : undefined;
1646
+ const status = numField(rec, 'statusCode') ||
1647
+ numField(rec, 'status') ||
1648
+ (data ? numField(data, 'statusCode') : 0) ||
1649
+ (data ? numField(data, 'status') : 0);
1650
+ if (status > 0)
1651
+ return `HTTP ${status}`;
1652
+ const rawCode = rec.code ?? (data ? data.code : undefined);
1653
+ if (typeof rawCode === 'string' && rawCode.trim())
1654
+ return `code ${rawCode.trim()}`;
1655
+ if (typeof rawCode === 'number')
1656
+ return `code ${rawCode}`;
1657
+ return undefined;
1658
+ }
1659
+ function numField(obj, key) {
1660
+ const v = obj[key];
1661
+ return typeof v === 'number' ? v : 0;
1662
+ }
1663
+ function safeStringify(value) {
1664
+ if (typeof value === 'string')
1665
+ return value;
1666
+ try {
1667
+ return JSON.stringify(value);
1668
+ }
1669
+ catch {
1670
+ return String(value);
1671
+ }
1672
+ }
1673
+ /** `code N` or `signal S` for a server process that exited. */
1674
+ function describeExit(serve) {
1675
+ const { exitCode, signalCode } = serve.child;
1676
+ return exitCode !== null ? `code ${exitCode}` : `signal ${signalCode}`;
1677
+ }
1678
+ /** `code N — <stderr summary>` for one start that exited before listening. */
1679
+ function describeEarlyExit(serve) {
1680
+ const detail = summarizeRunnerStderr(serve.stderrChunks.join(''));
1681
+ return `${describeExit(serve)}${detail ? ` — ${detail}` : ''}`;
1682
+ }
1683
+ function wrapSpawnError(err, bin) {
1684
+ const code = err?.code;
1685
+ if (code === 'ENOENT') {
1686
+ return new Error(`\`${bin}\` not found on PATH — install OpenCode (https://opencode.ai) and run \`opencode\` once to configure a provider`);
1687
+ }
1688
+ return err instanceof Error ? err : new Error(String(err));
1689
+ }
1690
+ //# sourceMappingURL=opencode-server-runner.js.map