@wjarka/cezarion 0.17.0-pr848.3486 → 0.18.0-dev.5793

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 (1392) hide show
  1. package/bin.js +2 -0
  2. package/cez.js +2 -0
  3. package/cezarion.js +2 -0
  4. package/dist/cez.js +2 -0
  5. package/dist/cezarion.js +2 -0
  6. package/dist/hsq.js +2 -0
  7. package/dist/index.js +1 -781
  8. package/dist/server/app-type.d.ts +1 -6
  9. package/dist/server/app-type.js +1 -2
  10. package/hsq.js +2 -0
  11. package/package.json +20 -59
  12. package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
  13. package/web/dist/assets/activity-motion-2nE59DAT.js +2 -0
  14. package/web/dist/assets/activity-route-R9lPc2jy.js +1 -0
  15. package/web/dist/assets/agent-accounts-f1cxwgfz.js +18 -0
  16. package/web/dist/assets/alert-dialog-Dj464rjk.js +1 -0
  17. package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
  18. package/web/dist/assets/button-CHUAMTHK.js +3 -0
  19. package/web/dist/assets/centered-state-DGyy0SuA.js +1 -0
  20. package/web/dist/assets/cez-idle-EVoUsgU3.js +1 -0
  21. package/web/dist/assets/commit-diff-panel-BJyNYmCY.js +1 -0
  22. package/web/dist/assets/control-locations-C9II3kPz.js +1 -0
  23. package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
  24. package/web/dist/assets/diff-D_9MtICR.js +3 -0
  25. package/web/dist/assets/diff-controls-BR2uqhwG.js +1 -0
  26. package/web/dist/assets/diff-view-xRPxXHXl.js +11 -0
  27. package/web/dist/assets/dropdown-menu-DhrBcVgr.js +1 -0
  28. package/web/dist/assets/es2015-D345RR4o.js +41 -0
  29. package/web/dist/assets/file-preview-D08Kq15E.js +2 -0
  30. package/web/dist/assets/git-toolbar-D9taioU5.js +1 -0
  31. package/web/dist/assets/github-bv_pBGc5.js +1 -0
  32. package/web/dist/assets/github-sidebar-model-B0Ufci5S.js +1 -0
  33. package/web/dist/assets/global-activity-route-QxTPDyx-.js +1 -0
  34. package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
  35. package/web/dist/assets/{image-preview-C_t9q45f.js → image-preview-Cq1vDiEo.js} +1 -1
  36. package/web/dist/assets/index-B18AqW0Z.css +1 -0
  37. package/web/dist/assets/index-DgU3yYUl.js +14 -0
  38. package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
  39. package/web/dist/assets/live-protocol-BVn0UA_g.js +64 -0
  40. package/web/dist/assets/live-refetch-BdnmTJ_8.js +1 -0
  41. package/web/dist/assets/{live-worker-BizfZSoh.ts → live-worker-BWdeGzQX.ts} +2 -1
  42. package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
  43. package/web/dist/assets/markdown-D7DUNWcJ.js +6 -0
  44. package/web/dist/assets/mermaid.min-3O9YjB2l.js +1 -0
  45. package/web/dist/assets/message-square-B-MD-8rD.js +1 -0
  46. package/web/dist/assets/{nav-row-styles-AoIhhIwf.js → nav-row-styles-BZUUavOF.js} +1 -1
  47. package/web/dist/assets/popover-DRcRI46x.js +1 -0
  48. package/web/dist/assets/preview-pane-connected-cD-MTiVN.js +3 -0
  49. package/web/dist/assets/project-router-MMOk9VbW.js +1 -0
  50. package/web/dist/assets/project-scope-context-B3M-u8R0.js +4 -0
  51. package/web/dist/assets/queries-DORTKwyN.js +1 -0
  52. package/web/dist/assets/repo-git-E_4Ighvg.js +1 -0
  53. package/web/dist/assets/report-reader-XVNQsXB4.js +1 -0
  54. package/web/dist/assets/report-title-D4Mbu2Er.js +1 -0
  55. package/web/dist/assets/reports-B7QAzibP.css +1 -0
  56. package/web/dist/assets/reports-B_PVTBzP.js +1 -0
  57. package/web/dist/assets/run-header-wm0gSs6X.js +2 -0
  58. package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
  59. package/web/dist/assets/skills-D2RLxUIc.js +1 -0
  60. package/web/dist/assets/skills-DFBiAuJG.js +1 -0
  61. package/web/dist/assets/skills-workflows-C21NystW.css +1 -0
  62. package/web/dist/assets/sortable.esm-zp_qkYGV.js +5 -0
  63. package/web/dist/assets/tab-link-BvoGfK8S.js +1 -0
  64. package/web/dist/assets/task-changes-DNtkfFzQ.js +1 -0
  65. package/web/dist/assets/task-commits-CivO-OrN.js +1 -0
  66. package/web/dist/assets/task-files-dczkxV_G.js +1 -0
  67. package/web/dist/assets/task-github-item-DKV4yrcf.js +1 -0
  68. package/web/dist/assets/task-thread-DIaTTGEF.js +9 -0
  69. package/web/dist/assets/textarea-DlVUfdWG.js +1 -0
  70. package/web/dist/assets/thread-state-DIozHuHb.js +4 -0
  71. package/web/dist/assets/toaster-B1MyeHiE.js +1 -0
  72. package/web/dist/assets/use-hand-to-agent-state-D58ayxI4.js +1 -0
  73. package/web/dist/assets/useInfiniteQuery-BbYMWe23.js +1 -0
  74. package/web/dist/assets/useQuery-CqqnAJvu.js +1 -0
  75. package/web/dist/assets/workflows-YMEsGXeB.js +7 -0
  76. package/web/dist/assets/ws-BtSVmivO.js +1 -0
  77. package/web/dist/assets/zoomable-image-5pOUaPEg.js +1 -0
  78. package/web/dist/index.html +31 -15
  79. package/web/dist/live-worker.js +2 -2
  80. package/LICENSE +0 -22
  81. package/README.md +0 -1745
  82. package/dist/agent-config/account-identity.d.ts +0 -28
  83. package/dist/agent-config/account-identity.js +0 -131
  84. package/dist/agent-config/account-identity.js.map +0 -1
  85. package/dist/agent-config/catalog.d.ts +0 -70
  86. package/dist/agent-config/catalog.js +0 -383
  87. package/dist/agent-config/catalog.js.map +0 -1
  88. package/dist/agent-config/files.d.ts +0 -42
  89. package/dist/agent-config/files.js +0 -115
  90. package/dist/agent-config/files.js.map +0 -1
  91. package/dist/agent-config/model-settings/claude.d.ts +0 -2
  92. package/dist/agent-config/model-settings/claude.js +0 -11
  93. package/dist/agent-config/model-settings/claude.js.map +0 -1
  94. package/dist/agent-config/model-settings/codex.d.ts +0 -2
  95. package/dist/agent-config/model-settings/codex.js +0 -16
  96. package/dist/agent-config/model-settings/codex.js.map +0 -1
  97. package/dist/agent-config/model-settings/opencode.d.ts +0 -2
  98. package/dist/agent-config/model-settings/opencode.js +0 -8
  99. package/dist/agent-config/model-settings/opencode.js.map +0 -1
  100. package/dist/agent-config/model-settings/pi.d.ts +0 -2
  101. package/dist/agent-config/model-settings/pi.js +0 -38
  102. package/dist/agent-config/model-settings/pi.js.map +0 -1
  103. package/dist/agent-config/model-settings/shared.d.ts +0 -12
  104. package/dist/agent-config/model-settings/shared.js +0 -100
  105. package/dist/agent-config/model-settings/shared.js.map +0 -1
  106. package/dist/agent-config/model-settings/types.d.ts +0 -9
  107. package/dist/agent-config/model-settings/types.js +0 -2
  108. package/dist/agent-config/model-settings/types.js.map +0 -1
  109. package/dist/agent-config/models.d.ts +0 -9
  110. package/dist/agent-config/models.js +0 -40
  111. package/dist/agent-config/models.js.map +0 -1
  112. package/dist/agent-config/seed.d.ts +0 -15
  113. package/dist/agent-config/seed.js +0 -94
  114. package/dist/agent-config/seed.js.map +0 -1
  115. package/dist/agent-config/service.d.ts +0 -44
  116. package/dist/agent-config/service.js +0 -72
  117. package/dist/agent-config/service.js.map +0 -1
  118. package/dist/agent-config/validate.d.ts +0 -18
  119. package/dist/agent-config/validate.js +0 -82
  120. package/dist/agent-config/validate.js.map +0 -1
  121. package/dist/application-update/bin-recovery.d.ts +0 -5
  122. package/dist/application-update/bin-recovery.js +0 -96
  123. package/dist/application-update/bin-recovery.js.map +0 -1
  124. package/dist/application-update/discovery.d.ts +0 -22
  125. package/dist/application-update/discovery.js +0 -91
  126. package/dist/application-update/discovery.js.map +0 -1
  127. package/dist/application-update/helper.d.ts +0 -57
  128. package/dist/application-update/helper.js +0 -369
  129. package/dist/application-update/helper.js.map +0 -1
  130. package/dist/application-update/launcher.d.ts +0 -12
  131. package/dist/application-update/launcher.js +0 -59
  132. package/dist/application-update/launcher.js.map +0 -1
  133. package/dist/application-update/lock.d.ts +0 -4
  134. package/dist/application-update/lock.js +0 -70
  135. package/dist/application-update/lock.js.map +0 -1
  136. package/dist/application-update/npm-process.d.ts +0 -17
  137. package/dist/application-update/npm-process.js +0 -133
  138. package/dist/application-update/npm-process.js.map +0 -1
  139. package/dist/application-update/service.d.ts +0 -69
  140. package/dist/application-update/service.js +0 -456
  141. package/dist/application-update/service.js.map +0 -1
  142. package/dist/archive-on-merge-setting.d.ts +0 -15
  143. package/dist/archive-on-merge-setting.js +0 -14
  144. package/dist/archive-on-merge-setting.js.map +0 -1
  145. package/dist/artifacts/cli.d.ts +0 -9
  146. package/dist/artifacts/cli.js +0 -59
  147. package/dist/artifacts/cli.js.map +0 -1
  148. package/dist/artifacts/lifecycle.d.ts +0 -4
  149. package/dist/artifacts/lifecycle.js +0 -42
  150. package/dist/artifacts/lifecycle.js.map +0 -1
  151. package/dist/artifacts/resolve.d.ts +0 -18
  152. package/dist/artifacts/resolve.js +0 -103
  153. package/dist/artifacts/resolve.js.map +0 -1
  154. package/dist/artifacts/store.d.ts +0 -8
  155. package/dist/artifacts/store.js +0 -323
  156. package/dist/artifacts/store.js.map +0 -1
  157. package/dist/automations/automation-cli.d.ts +0 -59
  158. package/dist/automations/automation-cli.js +0 -509
  159. package/dist/automations/automation-cli.js.map +0 -1
  160. package/dist/automations/builtin-skill.d.ts +0 -7
  161. package/dist/automations/builtin-skill.js +0 -14
  162. package/dist/automations/builtin-skill.js.map +0 -1
  163. package/dist/automations/coordinator.d.ts +0 -33
  164. package/dist/automations/coordinator.js +0 -86
  165. package/dist/automations/coordinator.js.map +0 -1
  166. package/dist/automations/github-baseline.d.ts +0 -3
  167. package/dist/automations/github-baseline.js +0 -17
  168. package/dist/automations/github-baseline.js.map +0 -1
  169. package/dist/automations/github-poller.d.ts +0 -93
  170. package/dist/automations/github-poller.js +0 -303
  171. package/dist/automations/github-poller.js.map +0 -1
  172. package/dist/automations/prompts.d.ts +0 -12
  173. package/dist/automations/prompts.js +0 -160
  174. package/dist/automations/prompts.js.map +0 -1
  175. package/dist/automations/schedule-runner.d.ts +0 -149
  176. package/dist/automations/schedule-runner.js +0 -513
  177. package/dist/automations/schedule-runner.js.map +0 -1
  178. package/dist/automations/scheduler.d.ts +0 -87
  179. package/dist/automations/scheduler.js +0 -434
  180. package/dist/automations/scheduler.js.map +0 -1
  181. package/dist/automations/service.d.ts +0 -777
  182. package/dist/automations/service.js +0 -444
  183. package/dist/automations/service.js.map +0 -1
  184. package/dist/automations/store.d.ts +0 -160
  185. package/dist/automations/store.js +0 -738
  186. package/dist/automations/store.js.map +0 -1
  187. package/dist/automations/task-template.d.ts +0 -59
  188. package/dist/automations/task-template.js +0 -273
  189. package/dist/automations/task-template.js.map +0 -1
  190. package/dist/automations/tool-adapter.d.ts +0 -6
  191. package/dist/automations/tool-adapter.js +0 -108
  192. package/dist/automations/tool-adapter.js.map +0 -1
  193. package/dist/automations/types.d.ts +0 -1
  194. package/dist/automations/types.js +0 -2
  195. package/dist/automations/types.js.map +0 -1
  196. package/dist/autosave-cleanup.d.ts +0 -26
  197. package/dist/autosave-cleanup.js +0 -87
  198. package/dist/autosave-cleanup.js.map +0 -1
  199. package/dist/autosave-git.d.ts +0 -21
  200. package/dist/autosave-git.js +0 -204
  201. package/dist/autosave-git.js.map +0 -1
  202. package/dist/autosave-group.d.ts +0 -8
  203. package/dist/autosave-group.js +0 -61
  204. package/dist/autosave-group.js.map +0 -1
  205. package/dist/autosave-holders.d.ts +0 -34
  206. package/dist/autosave-holders.js +0 -204
  207. package/dist/autosave-holders.js.map +0 -1
  208. package/dist/autosave-windows.d.ts +0 -25
  209. package/dist/autosave-windows.js +0 -156
  210. package/dist/autosave-windows.js.map +0 -1
  211. package/dist/ci-wait/client.d.ts +0 -28
  212. package/dist/ci-wait/client.js +0 -105
  213. package/dist/ci-wait/client.js.map +0 -1
  214. package/dist/ci-wait/controller.d.ts +0 -780
  215. package/dist/ci-wait/controller.js +0 -334
  216. package/dist/ci-wait/controller.js.map +0 -1
  217. package/dist/ci-wait/errors.d.ts +0 -27
  218. package/dist/ci-wait/errors.js +0 -253
  219. package/dist/ci-wait/errors.js.map +0 -1
  220. package/dist/ci-wait/github.d.ts +0 -87
  221. package/dist/ci-wait/github.js +0 -278
  222. package/dist/ci-wait/github.js.map +0 -1
  223. package/dist/ci-wait/injection.d.ts +0 -3
  224. package/dist/ci-wait/injection.js +0 -26
  225. package/dist/ci-wait/injection.js.map +0 -1
  226. package/dist/ci-wait/mcp.d.ts +0 -3
  227. package/dist/ci-wait/mcp.js +0 -30
  228. package/dist/ci-wait/mcp.js.map +0 -1
  229. package/dist/ci-wait/resources.d.ts +0 -7
  230. package/dist/ci-wait/resources.js +0 -32
  231. package/dist/ci-wait/resources.js.map +0 -1
  232. package/dist/ci-wait/supervisor.d.ts +0 -29
  233. package/dist/ci-wait/supervisor.js +0 -260
  234. package/dist/ci-wait/supervisor.js.map +0 -1
  235. package/dist/ci-wait/tools.d.ts +0 -830
  236. package/dist/ci-wait/tools.js +0 -209
  237. package/dist/ci-wait/tools.js.map +0 -1
  238. package/dist/config.d.ts +0 -68
  239. package/dist/config.js +0 -209
  240. package/dist/config.js.map +0 -1
  241. package/dist/contract/active-provider.d.ts +0 -12
  242. package/dist/contract/agent-config.d.ts +0 -160
  243. package/dist/contract/agent-profiles.d.ts +0 -369
  244. package/dist/contract/application-update.d.ts +0 -32
  245. package/dist/contract/artifacts.d.ts +0 -83
  246. package/dist/contract/ask-schema.d.ts +0 -50
  247. package/dist/contract/ask.d.ts +0 -9
  248. package/dist/contract/attachments.d.ts +0 -35
  249. package/dist/contract/attention.d.ts +0 -91
  250. package/dist/contract/automation-requests.d.ts +0 -308
  251. package/dist/contract/automation-schedule.d.ts +0 -89
  252. package/dist/contract/automation-storage.d.ts +0 -512
  253. package/dist/contract/automations.d.ts +0 -1542
  254. package/dist/contract/ci-wait.d.ts +0 -222
  255. package/dist/contract/config-requests.d.ts +0 -36
  256. package/dist/contract/conversations.d.ts +0 -401
  257. package/dist/contract/defined.d.ts +0 -8
  258. package/dist/contract/delegation.d.ts +0 -2165
  259. package/dist/contract/discovery.d.ts +0 -228
  260. package/dist/contract/effort.d.ts +0 -18
  261. package/dist/contract/events.d.ts +0 -303
  262. package/dist/contract/github-requests.d.ts +0 -26
  263. package/dist/contract/github.d.ts +0 -732
  264. package/dist/contract/handoff.d.ts +0 -43
  265. package/dist/contract/health.d.ts +0 -124
  266. package/dist/contract/image-path.d.ts +0 -6
  267. package/dist/contract/index.d.ts +0 -59
  268. package/dist/contract/index.js +0 -6035
  269. package/dist/contract/live-coordination.d.ts +0 -158
  270. package/dist/contract/live-limits.d.ts +0 -8
  271. package/dist/contract/live.d.ts +0 -123
  272. package/dist/contract/pending-ask.d.ts +0 -58
  273. package/dist/contract/permissions.d.ts +0 -54
  274. package/dist/contract/preview.d.ts +0 -560
  275. package/dist/contract/project-limits.d.ts +0 -33
  276. package/dist/contract/projects.d.ts +0 -716
  277. package/dist/contract/provider-requests.d.ts +0 -77
  278. package/dist/contract/query-requests.d.ts +0 -52
  279. package/dist/contract/repo-requests.d.ts +0 -12
  280. package/dist/contract/repo.d.ts +0 -515
  281. package/dist/contract/run-labels.d.ts +0 -8
  282. package/dist/contract/run-limits.d.ts +0 -8
  283. package/dist/contract/run-predicates.d.ts +0 -32
  284. package/dist/contract/run-requests.d.ts +0 -33
  285. package/dist/contract/run-search.d.ts +0 -193
  286. package/dist/contract/runs.d.ts +0 -5711
  287. package/dist/contract/scheduled-tasks.d.ts +0 -187
  288. package/dist/contract/skills.d.ts +0 -56
  289. package/dist/contract/team-skill-ref.d.ts +0 -10
  290. package/dist/contract/tool-display.d.ts +0 -25
  291. package/dist/contract/ui-state-requests.d.ts +0 -60
  292. package/dist/contract/version.d.ts +0 -3
  293. package/dist/contract/voice.d.ts +0 -213
  294. package/dist/contract/waits.d.ts +0 -1367
  295. package/dist/contract/workflow-file.d.ts +0 -37
  296. package/dist/contract/workflow-requests.d.ts +0 -7
  297. package/dist/contract/workflows.d.ts +0 -250
  298. package/dist/contract/workspace.d.ts +0 -631
  299. package/dist/contract/zoned-time.d.ts +0 -26
  300. package/dist/core/agent-env.d.ts +0 -30
  301. package/dist/core/agent-env.js +0 -400
  302. package/dist/core/agent-env.js.map +0 -1
  303. package/dist/core/agent-model-policy.d.ts +0 -10
  304. package/dist/core/agent-model-policy.js +0 -36
  305. package/dist/core/agent-model-policy.js.map +0 -1
  306. package/dist/core/agent-profiles.d.ts +0 -50
  307. package/dist/core/agent-profiles.js +0 -105
  308. package/dist/core/agent-profiles.js.map +0 -1
  309. package/dist/core/agent-runner.d.ts +0 -394
  310. package/dist/core/agent-runner.js +0 -96
  311. package/dist/core/agent-runner.js.map +0 -1
  312. package/dist/core/ask.d.ts +0 -79
  313. package/dist/core/ask.js +0 -232
  314. package/dist/core/ask.js.map +0 -1
  315. package/dist/core/backend-detect.d.ts +0 -17
  316. package/dist/core/backend-detect.js +0 -209
  317. package/dist/core/backend-detect.js.map +0 -1
  318. package/dist/core/claude-cli-runner.d.ts +0 -72
  319. package/dist/core/claude-cli-runner.js +0 -910
  320. package/dist/core/claude-cli-runner.js.map +0 -1
  321. package/dist/core/claude-model-catalog.d.ts +0 -16
  322. package/dist/core/claude-model-catalog.js +0 -198
  323. package/dist/core/claude-model-catalog.js.map +0 -1
  324. package/dist/core/claude-stream.d.ts +0 -31
  325. package/dist/core/claude-stream.js +0 -68
  326. package/dist/core/claude-stream.js.map +0 -1
  327. package/dist/core/claude-ui-mapper.d.ts +0 -80
  328. package/dist/core/claude-ui-mapper.js +0 -696
  329. package/dist/core/claude-ui-mapper.js.map +0 -1
  330. package/dist/core/codex-app-server-runner.d.ts +0 -61
  331. package/dist/core/codex-app-server-runner.js +0 -1269
  332. package/dist/core/codex-app-server-runner.js.map +0 -1
  333. package/dist/core/codex-app-server-transport.d.ts +0 -52
  334. package/dist/core/codex-app-server-transport.js +0 -199
  335. package/dist/core/codex-app-server-transport.js.map +0 -1
  336. package/dist/core/codex-approvals.d.ts +0 -12
  337. package/dist/core/codex-approvals.js +0 -161
  338. package/dist/core/codex-approvals.js.map +0 -1
  339. package/dist/core/codex-model-catalog.d.ts +0 -10
  340. package/dist/core/codex-model-catalog.js +0 -110
  341. package/dist/core/codex-model-catalog.js.map +0 -1
  342. package/dist/core/codex-native-frames.d.ts +0 -10
  343. package/dist/core/codex-native-frames.js +0 -47
  344. package/dist/core/codex-native-frames.js.map +0 -1
  345. package/dist/core/codex-permissions.d.ts +0 -6
  346. package/dist/core/codex-permissions.js +0 -27
  347. package/dist/core/codex-permissions.js.map +0 -1
  348. package/dist/core/codex-stream-error.d.ts +0 -2
  349. package/dist/core/codex-stream-error.js +0 -12
  350. package/dist/core/codex-stream-error.js.map +0 -1
  351. package/dist/core/codex-turn-outcome.d.ts +0 -8
  352. package/dist/core/codex-turn-outcome.js +0 -30
  353. package/dist/core/codex-turn-outcome.js.map +0 -1
  354. package/dist/core/codex-ui-mapper.d.ts +0 -112
  355. package/dist/core/codex-ui-mapper.js +0 -808
  356. package/dist/core/codex-ui-mapper.js.map +0 -1
  357. package/dist/core/cursor-acp-runner.d.ts +0 -34
  358. package/dist/core/cursor-acp-runner.js +0 -777
  359. package/dist/core/cursor-acp-runner.js.map +0 -1
  360. package/dist/core/cursor-cli-flags.d.ts +0 -19
  361. package/dist/core/cursor-cli-flags.js +0 -47
  362. package/dist/core/cursor-cli-flags.js.map +0 -1
  363. package/dist/core/cursor-config-options.d.ts +0 -18
  364. package/dist/core/cursor-config-options.js +0 -31
  365. package/dist/core/cursor-config-options.js.map +0 -1
  366. package/dist/core/cursor-model-catalog.d.ts +0 -45
  367. package/dist/core/cursor-model-catalog.js +0 -300
  368. package/dist/core/cursor-model-catalog.js.map +0 -1
  369. package/dist/core/cursor-print-capabilities.d.ts +0 -16
  370. package/dist/core/cursor-print-capabilities.js +0 -141
  371. package/dist/core/cursor-print-capabilities.js.map +0 -1
  372. package/dist/core/cursor-print-process.d.ts +0 -31
  373. package/dist/core/cursor-print-process.js +0 -117
  374. package/dist/core/cursor-print-process.js.map +0 -1
  375. package/dist/core/cursor-print-runner.d.ts +0 -31
  376. package/dist/core/cursor-print-runner.js +0 -555
  377. package/dist/core/cursor-print-runner.js.map +0 -1
  378. package/dist/core/cursor-print-tool-catalog.d.ts +0 -10
  379. package/dist/core/cursor-print-tool-catalog.js +0 -91
  380. package/dist/core/cursor-print-tool-catalog.js.map +0 -1
  381. package/dist/core/cursor-print-ui-mapper.d.ts +0 -47
  382. package/dist/core/cursor-print-ui-mapper.js +0 -553
  383. package/dist/core/cursor-print-ui-mapper.js.map +0 -1
  384. package/dist/core/cursor-provider-error.d.ts +0 -33
  385. package/dist/core/cursor-provider-error.js +0 -68
  386. package/dist/core/cursor-provider-error.js.map +0 -1
  387. package/dist/core/cursor-runner.d.ts +0 -24
  388. package/dist/core/cursor-runner.js +0 -149
  389. package/dist/core/cursor-runner.js.map +0 -1
  390. package/dist/core/cursor-ui-mapper.d.ts +0 -29
  391. package/dist/core/cursor-ui-mapper.js +0 -275
  392. package/dist/core/cursor-ui-mapper.js.map +0 -1
  393. package/dist/core/defined.d.ts +0 -1
  394. package/dist/core/defined.js +0 -2
  395. package/dist/core/defined.js.map +0 -1
  396. package/dist/core/hook-items.d.ts +0 -14
  397. package/dist/core/hook-items.js +0 -13
  398. package/dist/core/hook-items.js.map +0 -1
  399. package/dist/core/host-model-catalog.d.ts +0 -7
  400. package/dist/core/host-model-catalog.js +0 -21
  401. package/dist/core/host-model-catalog.js.map +0 -1
  402. package/dist/core/input-submissions.d.ts +0 -14
  403. package/dist/core/input-submissions.js +0 -26
  404. package/dist/core/input-submissions.js.map +0 -1
  405. package/dist/core/managed-session.d.ts +0 -6
  406. package/dist/core/managed-session.js +0 -116
  407. package/dist/core/managed-session.js.map +0 -1
  408. package/dist/core/model-identity.d.ts +0 -108
  409. package/dist/core/model-identity.js +0 -137
  410. package/dist/core/model-identity.js.map +0 -1
  411. package/dist/core/model-presets.d.ts +0 -10
  412. package/dist/core/model-presets.js +0 -77
  413. package/dist/core/model-presets.js.map +0 -1
  414. package/dist/core/ndjson.d.ts +0 -6
  415. package/dist/core/ndjson.js +0 -23
  416. package/dist/core/ndjson.js.map +0 -1
  417. package/dist/core/omp-model-catalog.d.ts +0 -43
  418. package/dist/core/omp-model-catalog.js +0 -205
  419. package/dist/core/omp-model-catalog.js.map +0 -1
  420. package/dist/core/omp-runner.d.ts +0 -72
  421. package/dist/core/omp-runner.js +0 -832
  422. package/dist/core/omp-runner.js.map +0 -1
  423. package/dist/core/omp-ui-mapper.d.ts +0 -106
  424. package/dist/core/omp-ui-mapper.js +0 -856
  425. package/dist/core/omp-ui-mapper.js.map +0 -1
  426. package/dist/core/opencode-model-catalog.d.ts +0 -32
  427. package/dist/core/opencode-model-catalog.js +0 -215
  428. package/dist/core/opencode-model-catalog.js.map +0 -1
  429. package/dist/core/opencode-permissions.d.ts +0 -52
  430. package/dist/core/opencode-permissions.js +0 -101
  431. package/dist/core/opencode-permissions.js.map +0 -1
  432. package/dist/core/opencode-server-runner.d.ts +0 -61
  433. package/dist/core/opencode-server-runner.js +0 -1692
  434. package/dist/core/opencode-server-runner.js.map +0 -1
  435. package/dist/core/opencode-session-error.d.ts +0 -19
  436. package/dist/core/opencode-session-error.js +0 -42
  437. package/dist/core/opencode-session-error.js.map +0 -1
  438. package/dist/core/opencode-ui-mapper.d.ts +0 -137
  439. package/dist/core/opencode-ui-mapper.js +0 -768
  440. package/dist/core/opencode-ui-mapper.js.map +0 -1
  441. package/dist/core/pi-model-catalog.d.ts +0 -38
  442. package/dist/core/pi-model-catalog.js +0 -249
  443. package/dist/core/pi-model-catalog.js.map +0 -1
  444. package/dist/core/pi-rpc-turn.d.ts +0 -184
  445. package/dist/core/pi-rpc-turn.js +0 -380
  446. package/dist/core/pi-rpc-turn.js.map +0 -1
  447. package/dist/core/pi-rpc-wire.d.ts +0 -31
  448. package/dist/core/pi-rpc-wire.js +0 -88
  449. package/dist/core/pi-rpc-wire.js.map +0 -1
  450. package/dist/core/pi-runner.d.ts +0 -43
  451. package/dist/core/pi-runner.js +0 -592
  452. package/dist/core/pi-runner.js.map +0 -1
  453. package/dist/core/pi-ui-mapper.d.ts +0 -52
  454. package/dist/core/pi-ui-mapper.js +0 -373
  455. package/dist/core/pi-ui-mapper.js.map +0 -1
  456. package/dist/core/process-usage.d.ts +0 -74
  457. package/dist/core/process-usage.js +0 -218
  458. package/dist/core/process-usage.js.map +0 -1
  459. package/dist/core/provider-auth.d.ts +0 -168
  460. package/dist/core/provider-auth.js +0 -660
  461. package/dist/core/provider-auth.js.map +0 -1
  462. package/dist/core/provider-availability.d.ts +0 -3
  463. package/dist/core/provider-availability.js +0 -14
  464. package/dist/core/provider-availability.js.map +0 -1
  465. package/dist/core/runner-factory.d.ts +0 -11
  466. package/dist/core/runner-factory.js +0 -31
  467. package/dist/core/runner-factory.js.map +0 -1
  468. package/dist/core/runner-model-catalog.d.ts +0 -34
  469. package/dist/core/runner-model-catalog.js +0 -109
  470. package/dist/core/runner-model-catalog.js.map +0 -1
  471. package/dist/core/runner-runtime.d.ts +0 -40
  472. package/dist/core/runner-runtime.js +0 -88
  473. package/dist/core/runner-runtime.js.map +0 -1
  474. package/dist/core/runner-stderr.d.ts +0 -2
  475. package/dist/core/runner-stderr.js +0 -20
  476. package/dist/core/runner-stderr.js.map +0 -1
  477. package/dist/core/runner-tool-grants.d.ts +0 -21
  478. package/dist/core/runner-tool-grants.js +0 -64
  479. package/dist/core/runner-tool-grants.js.map +0 -1
  480. package/dist/core/secret-redaction.d.ts +0 -20
  481. package/dist/core/secret-redaction.js +0 -98
  482. package/dist/core/secret-redaction.js.map +0 -1
  483. package/dist/core/session-process.d.ts +0 -42
  484. package/dist/core/session-process.js +0 -360
  485. package/dist/core/session-process.js.map +0 -1
  486. package/dist/core/shell-env.d.ts +0 -17
  487. package/dist/core/shell-env.js +0 -51
  488. package/dist/core/shell-env.js.map +0 -1
  489. package/dist/core/ui-events.d.ts +0 -348
  490. package/dist/core/ui-events.js +0 -2
  491. package/dist/core/ui-events.js.map +0 -1
  492. package/dist/core/usage-limit.d.ts +0 -42
  493. package/dist/core/usage-limit.js +0 -152
  494. package/dist/core/usage-limit.js.map +0 -1
  495. package/dist/core/usage.d.ts +0 -11
  496. package/dist/core/usage.js +0 -15
  497. package/dist/core/usage.js.map +0 -1
  498. package/dist/core/v1-text-coalescer.d.ts +0 -36
  499. package/dist/core/v1-text-coalescer.js +0 -72
  500. package/dist/core/v1-text-coalescer.js.map +0 -1
  501. package/dist/data-gitignore.d.ts +0 -6
  502. package/dist/data-gitignore.js +0 -59
  503. package/dist/data-gitignore.js.map +0 -1
  504. package/dist/delegation/capacity.d.ts +0 -15
  505. package/dist/delegation/capacity.js +0 -30
  506. package/dist/delegation/capacity.js.map +0 -1
  507. package/dist/delegation/cli.d.ts +0 -5
  508. package/dist/delegation/cli.js +0 -559
  509. package/dist/delegation/cli.js.map +0 -1
  510. package/dist/delegation/context.d.ts +0 -40
  511. package/dist/delegation/context.js +0 -383
  512. package/dist/delegation/context.js.map +0 -1
  513. package/dist/delegation/conversation-send.d.ts +0 -63
  514. package/dist/delegation/conversation-send.js +0 -60
  515. package/dist/delegation/conversation-send.js.map +0 -1
  516. package/dist/delegation/conversations.d.ts +0 -1670
  517. package/dist/delegation/conversations.js +0 -277
  518. package/dist/delegation/conversations.js.map +0 -1
  519. package/dist/delegation/credentials.d.ts +0 -21
  520. package/dist/delegation/credentials.js +0 -66
  521. package/dist/delegation/credentials.js.map +0 -1
  522. package/dist/delegation/destroy-observation.d.ts +0 -42
  523. package/dist/delegation/destroy-observation.js +0 -115
  524. package/dist/delegation/destroy-observation.js.map +0 -1
  525. package/dist/delegation/effort.d.ts +0 -1
  526. package/dist/delegation/effort.js +0 -11
  527. package/dist/delegation/effort.js.map +0 -1
  528. package/dist/delegation/execution-identity.d.ts +0 -254
  529. package/dist/delegation/execution-identity.js +0 -250
  530. package/dist/delegation/execution-identity.js.map +0 -1
  531. package/dist/delegation/execution-settings.d.ts +0 -10
  532. package/dist/delegation/execution-settings.js +0 -65
  533. package/dist/delegation/execution-settings.js.map +0 -1
  534. package/dist/delegation/idle-test-app.d.ts +0 -4
  535. package/dist/delegation/idle-test-app.js +0 -185
  536. package/dist/delegation/idle-test-app.js.map +0 -1
  537. package/dist/delegation/input.d.ts +0 -12
  538. package/dist/delegation/input.js +0 -50
  539. package/dist/delegation/input.js.map +0 -1
  540. package/dist/delegation/park-notice.d.ts +0 -45
  541. package/dist/delegation/park-notice.js +0 -79
  542. package/dist/delegation/park-notice.js.map +0 -1
  543. package/dist/delegation/policy.d.ts +0 -22
  544. package/dist/delegation/policy.js +0 -95
  545. package/dist/delegation/policy.js.map +0 -1
  546. package/dist/delegation/process-liveness.d.ts +0 -98
  547. package/dist/delegation/process-liveness.js +0 -213
  548. package/dist/delegation/process-liveness.js.map +0 -1
  549. package/dist/delegation/provision.d.ts +0 -35
  550. package/dist/delegation/provision.js +0 -178
  551. package/dist/delegation/provision.js.map +0 -1
  552. package/dist/delegation/questions.d.ts +0 -24
  553. package/dist/delegation/questions.js +0 -55
  554. package/dist/delegation/questions.js.map +0 -1
  555. package/dist/delegation/readiness.d.ts +0 -13
  556. package/dist/delegation/readiness.js +0 -19
  557. package/dist/delegation/readiness.js.map +0 -1
  558. package/dist/delegation/results.d.ts +0 -13
  559. package/dist/delegation/results.js +0 -154
  560. package/dist/delegation/results.js.map +0 -1
  561. package/dist/delegation/retry-backoff.d.ts +0 -31
  562. package/dist/delegation/retry-backoff.js +0 -26
  563. package/dist/delegation/retry-backoff.js.map +0 -1
  564. package/dist/delegation/routes.d.ts +0 -1014
  565. package/dist/delegation/routes.js +0 -77
  566. package/dist/delegation/routes.js.map +0 -1
  567. package/dist/delegation/scratch-cleanup.d.ts +0 -28
  568. package/dist/delegation/scratch-cleanup.js +0 -145
  569. package/dist/delegation/scratch-cleanup.js.map +0 -1
  570. package/dist/delegation/service.d.ts +0 -284
  571. package/dist/delegation/service.js +0 -1046
  572. package/dist/delegation/service.js.map +0 -1
  573. package/dist/delegation/task-discovery.d.ts +0 -6
  574. package/dist/delegation/task-discovery.js +0 -23
  575. package/dist/delegation/task-discovery.js.map +0 -1
  576. package/dist/delegation/transport.d.ts +0 -992
  577. package/dist/delegation/transport.js +0 -22
  578. package/dist/delegation/transport.js.map +0 -1
  579. package/dist/delegation/wait.d.ts +0 -14
  580. package/dist/delegation/wait.js +0 -72
  581. package/dist/delegation/wait.js.map +0 -1
  582. package/dist/delegation/windows-test-app.d.ts +0 -5
  583. package/dist/delegation/windows-test-app.js +0 -63
  584. package/dist/delegation/windows-test-app.js.map +0 -1
  585. package/dist/delegation/windows-workspace-identity.d.ts +0 -3
  586. package/dist/delegation/windows-workspace-identity.js +0 -22
  587. package/dist/delegation/windows-workspace-identity.js.map +0 -1
  588. package/dist/delegation/workspace.d.ts +0 -33
  589. package/dist/delegation/workspace.js +0 -560
  590. package/dist/delegation/workspace.js.map +0 -1
  591. package/dist/detached-process.d.ts +0 -125
  592. package/dist/detached-process.js +0 -448
  593. package/dist/detached-process.js.map +0 -1
  594. package/dist/discovery/catalog.d.ts +0 -15
  595. package/dist/discovery/catalog.js +0 -31
  596. package/dist/discovery/catalog.js.map +0 -1
  597. package/dist/discovery/cli.d.ts +0 -8
  598. package/dist/discovery/cli.js +0 -106
  599. package/dist/discovery/cli.js.map +0 -1
  600. package/dist/git-diff-base.d.ts +0 -41
  601. package/dist/git-diff-base.js +0 -116
  602. package/dist/git-diff-base.js.map +0 -1
  603. package/dist/git-index-copy.d.ts +0 -4
  604. package/dist/git-index-copy.js +0 -10
  605. package/dist/git-index-copy.js.map +0 -1
  606. package/dist/git-refs.d.ts +0 -11
  607. package/dist/git-refs.js +0 -14
  608. package/dist/git-refs.js.map +0 -1
  609. package/dist/git-worktree-lock-helper.d.ts +0 -7
  610. package/dist/git-worktree-lock-helper.js +0 -158
  611. package/dist/git-worktree-lock-helper.js.map +0 -1
  612. package/dist/git-worktree-lock.d.ts +0 -17
  613. package/dist/git-worktree-lock.js +0 -90
  614. package/dist/git-worktree-lock.js.map +0 -1
  615. package/dist/git-worktree-release.d.ts +0 -20
  616. package/dist/git-worktree-release.js +0 -27
  617. package/dist/git-worktree-release.js.map +0 -1
  618. package/dist/git-worktree.d.ts +0 -154
  619. package/dist/git-worktree.js +0 -858
  620. package/dist/git-worktree.js.map +0 -1
  621. package/dist/handoff.d.ts +0 -72
  622. package/dist/handoff.js +0 -209
  623. package/dist/handoff.js.map +0 -1
  624. package/dist/index.d.ts +0 -2
  625. package/dist/index.js.map +0 -1
  626. package/dist/install-as-command.d.ts +0 -40
  627. package/dist/install-as-command.js +0 -52
  628. package/dist/install-as-command.js.map +0 -1
  629. package/dist/merge-observations.d.ts +0 -13
  630. package/dist/merge-observations.js +0 -55
  631. package/dist/merge-observations.js.map +0 -1
  632. package/dist/open-url.d.ts +0 -2
  633. package/dist/open-url.js +0 -10
  634. package/dist/open-url.js.map +0 -1
  635. package/dist/pack-check.d.ts +0 -17
  636. package/dist/pack-check.js +0 -27
  637. package/dist/pack-check.js.map +0 -1
  638. package/dist/paths.d.ts +0 -138
  639. package/dist/paths.js +0 -220
  640. package/dist/paths.js.map +0 -1
  641. package/dist/planner.d.ts +0 -28
  642. package/dist/planner.js +0 -271
  643. package/dist/planner.js.map +0 -1
  644. package/dist/preview/agent-address.d.ts +0 -34
  645. package/dist/preview/agent-address.js +0 -51
  646. package/dist/preview/agent-address.js.map +0 -1
  647. package/dist/preview/agent-marker.d.ts +0 -17
  648. package/dist/preview/agent-marker.js +0 -71
  649. package/dist/preview/agent-marker.js.map +0 -1
  650. package/dist/preview/browser-launch.d.ts +0 -27
  651. package/dist/preview/browser-launch.js +0 -53
  652. package/dist/preview/browser-launch.js.map +0 -1
  653. package/dist/preview/cdp-proxy.d.ts +0 -54
  654. package/dist/preview/cdp-proxy.js +0 -151
  655. package/dist/preview/cdp-proxy.js.map +0 -1
  656. package/dist/preview/cdp.d.ts +0 -49
  657. package/dist/preview/cdp.js +0 -167
  658. package/dist/preview/cdp.js.map +0 -1
  659. package/dist/preview/chromium.d.ts +0 -88
  660. package/dist/preview/chromium.js +0 -482
  661. package/dist/preview/chromium.js.map +0 -1
  662. package/dist/preview/dev-server.d.ts +0 -68
  663. package/dist/preview/dev-server.js +0 -317
  664. package/dist/preview/dev-server.js.map +0 -1
  665. package/dist/preview/host.d.ts +0 -206
  666. package/dist/preview/host.js +0 -929
  667. package/dist/preview/host.js.map +0 -1
  668. package/dist/preview/registration.d.ts +0 -68
  669. package/dist/preview/registration.js +0 -111
  670. package/dist/preview/registration.js.map +0 -1
  671. package/dist/preview/run-tools.d.ts +0 -9
  672. package/dist/preview/run-tools.js +0 -72
  673. package/dist/preview/run-tools.js.map +0 -1
  674. package/dist/preview/session.d.ts +0 -87
  675. package/dist/preview/session.js +0 -378
  676. package/dist/preview/session.js.map +0 -1
  677. package/dist/preview/url.d.ts +0 -6
  678. package/dist/preview/url.js +0 -17
  679. package/dist/preview/url.js.map +0 -1
  680. package/dist/process-wait/exit-file.d.ts +0 -29
  681. package/dist/process-wait/exit-file.js +0 -67
  682. package/dist/process-wait/exit-file.js.map +0 -1
  683. package/dist/process-wait/supervisor.d.ts +0 -30
  684. package/dist/process-wait/supervisor.js +0 -71
  685. package/dist/process-wait/supervisor.js.map +0 -1
  686. package/dist/release/manifests.d.ts +0 -103
  687. package/dist/release/manifests.js +0 -90
  688. package/dist/release/manifests.js.map +0 -1
  689. package/dist/release/snapshot.d.ts +0 -67
  690. package/dist/release/snapshot.js +0 -97
  691. package/dist/release/snapshot.js.map +0 -1
  692. package/dist/release/stable.d.ts +0 -38
  693. package/dist/release/stable.js +0 -55
  694. package/dist/release/stable.js.map +0 -1
  695. package/dist/runs/agent-tmpdir-removal.d.ts +0 -15
  696. package/dist/runs/agent-tmpdir-removal.js +0 -60
  697. package/dist/runs/agent-tmpdir-removal.js.map +0 -1
  698. package/dist/runs/agent-tmpdir.d.ts +0 -119
  699. package/dist/runs/agent-tmpdir.js +0 -829
  700. package/dist/runs/agent-tmpdir.js.map +0 -1
  701. package/dist/runs/arm-repo-handle.d.ts +0 -9
  702. package/dist/runs/arm-repo-handle.js +0 -45
  703. package/dist/runs/arm-repo-handle.js.map +0 -1
  704. package/dist/runs/auto-name.d.ts +0 -75
  705. package/dist/runs/auto-name.js +0 -179
  706. package/dist/runs/auto-name.js.map +0 -1
  707. package/dist/runs/client-request.d.ts +0 -11
  708. package/dist/runs/client-request.js +0 -26
  709. package/dist/runs/client-request.js.map +0 -1
  710. package/dist/runs/conversation-identity.d.ts +0 -19
  711. package/dist/runs/conversation-identity.js +0 -31
  712. package/dist/runs/conversation-identity.js.map +0 -1
  713. package/dist/runs/delegation-state.d.ts +0 -409
  714. package/dist/runs/delegation-state.js +0 -22
  715. package/dist/runs/delegation-state.js.map +0 -1
  716. package/dist/runs/event-history-agent-context.d.ts +0 -14
  717. package/dist/runs/event-history-agent-context.js +0 -105
  718. package/dist/runs/event-history-agent-context.js.map +0 -1
  719. package/dist/runs/event-history-context.d.ts +0 -15
  720. package/dist/runs/event-history-context.js +0 -109
  721. package/dist/runs/event-history-context.js.map +0 -1
  722. package/dist/runs/event-history.d.ts +0 -53
  723. package/dist/runs/event-history.js +0 -535
  724. package/dist/runs/event-history.js.map +0 -1
  725. package/dist/runs/history-compressor.d.ts +0 -29
  726. package/dist/runs/history-compressor.js +0 -116
  727. package/dist/runs/history-compressor.js.map +0 -1
  728. package/dist/runs/history-file.d.ts +0 -36
  729. package/dist/runs/history-file.js +0 -463
  730. package/dist/runs/history-file.js.map +0 -1
  731. package/dist/runs/history-stream.d.ts +0 -2
  732. package/dist/runs/history-stream.js +0 -62
  733. package/dist/runs/history-stream.js.map +0 -1
  734. package/dist/runs/legacy-index.d.ts +0 -49
  735. package/dist/runs/legacy-index.js +0 -155
  736. package/dist/runs/legacy-index.js.map +0 -1
  737. package/dist/runs/live-item-snapshots.d.ts +0 -13
  738. package/dist/runs/live-item-snapshots.js +0 -79
  739. package/dist/runs/live-item-snapshots.js.map +0 -1
  740. package/dist/runs/loaded-run-healing.d.ts +0 -3
  741. package/dist/runs/loaded-run-healing.js +0 -17
  742. package/dist/runs/loaded-run-healing.js.map +0 -1
  743. package/dist/runs/outcome-commit.d.ts +0 -98
  744. package/dist/runs/outcome-commit.js +0 -132
  745. package/dist/runs/outcome-commit.js.map +0 -1
  746. package/dist/runs/pull-requests.d.ts +0 -14
  747. package/dist/runs/pull-requests.js +0 -96
  748. package/dist/runs/pull-requests.js.map +0 -1
  749. package/dist/runs/raw-record.d.ts +0 -40
  750. package/dist/runs/raw-record.js +0 -133
  751. package/dist/runs/raw-record.js.map +0 -1
  752. package/dist/runs/retention.d.ts +0 -91
  753. package/dist/runs/retention.js +0 -182
  754. package/dist/runs/retention.js.map +0 -1
  755. package/dist/runs/review-gate.d.ts +0 -18
  756. package/dist/runs/review-gate.js +0 -21
  757. package/dist/runs/review-gate.js.map +0 -1
  758. package/dist/runs/run-claims.d.ts +0 -16
  759. package/dist/runs/run-claims.js +0 -24
  760. package/dist/runs/run-claims.js.map +0 -1
  761. package/dist/runs/run-database-peer-page.d.ts +0 -12
  762. package/dist/runs/run-database-peer-page.js +0 -25
  763. package/dist/runs/run-database-peer-page.js.map +0 -1
  764. package/dist/runs/run-database.d.ts +0 -383
  765. package/dist/runs/run-database.js +0 -1004
  766. package/dist/runs/run-database.js.map +0 -1
  767. package/dist/runs/run-index.d.ts +0 -26
  768. package/dist/runs/run-index.js +0 -212
  769. package/dist/runs/run-index.js.map +0 -1
  770. package/dist/runs/run-row.d.ts +0 -15
  771. package/dist/runs/run-row.js +0 -59
  772. package/dist/runs/run-row.js.map +0 -1
  773. package/dist/runs/run-summary-page.d.ts +0 -36
  774. package/dist/runs/run-summary-page.js +0 -46
  775. package/dist/runs/run-summary-page.js.map +0 -1
  776. package/dist/runs/run-title.d.ts +0 -8
  777. package/dist/runs/run-title.js +0 -28
  778. package/dist/runs/run-title.js.map +0 -1
  779. package/dist/runs/store-open-error.d.ts +0 -24
  780. package/dist/runs/store-open-error.js +0 -61
  781. package/dist/runs/store-open-error.js.map +0 -1
  782. package/dist/runs/store.d.ts +0 -3263
  783. package/dist/runs/store.js +0 -4647
  784. package/dist/runs/store.js.map +0 -1
  785. package/dist/runs/task-markers.d.ts +0 -29
  786. package/dist/runs/task-markers.js +0 -78
  787. package/dist/runs/task-markers.js.map +0 -1
  788. package/dist/runs/task-refs.d.ts +0 -39
  789. package/dist/runs/task-refs.js +0 -107
  790. package/dist/runs/task-refs.js.map +0 -1
  791. package/dist/runs/transcript-facts-fold.d.ts +0 -64
  792. package/dist/runs/transcript-facts-fold.js +0 -109
  793. package/dist/runs/transcript-facts-fold.js.map +0 -1
  794. package/dist/runs/transcript-facts-load.d.ts +0 -11
  795. package/dist/runs/transcript-facts-load.js +0 -66
  796. package/dist/runs/transcript-facts-load.js.map +0 -1
  797. package/dist/runs/transcript-facts-queue.d.ts +0 -30
  798. package/dist/runs/transcript-facts-queue.js +0 -227
  799. package/dist/runs/transcript-facts-queue.js.map +0 -1
  800. package/dist/runs/transcript-facts-worker.d.ts +0 -15
  801. package/dist/runs/transcript-facts-worker.js +0 -26
  802. package/dist/runs/transcript-facts-worker.js.map +0 -1
  803. package/dist/runs/transcript-facts.d.ts +0 -39
  804. package/dist/runs/transcript-facts.js +0 -186
  805. package/dist/runs/transcript-facts.js.map +0 -1
  806. package/dist/runs/ui-event-sink.d.ts +0 -56
  807. package/dist/runs/ui-event-sink.js +0 -188
  808. package/dist/runs/ui-event-sink.js.map +0 -1
  809. package/dist/runs/webhook.d.ts +0 -191
  810. package/dist/runs/webhook.js +0 -360
  811. package/dist/runs/webhook.js.map +0 -1
  812. package/dist/runs/worker-deletion-proof.d.ts +0 -13
  813. package/dist/runs/worker-deletion-proof.js +0 -13
  814. package/dist/runs/worker-deletion-proof.js.map +0 -1
  815. package/dist/runs/worker-execution.d.ts +0 -22
  816. package/dist/runs/worker-execution.js +0 -30
  817. package/dist/runs/worker-execution.js.map +0 -1
  818. package/dist/serve-boot.d.ts +0 -27
  819. package/dist/serve-boot.js +0 -85
  820. package/dist/serve-boot.js.map +0 -1
  821. package/dist/server/app-type.js.map +0 -1
  822. package/dist/server/archive-on-merge.d.ts +0 -35
  823. package/dist/server/archive-on-merge.js +0 -202
  824. package/dist/server/archive-on-merge.js.map +0 -1
  825. package/dist/server/capabilities.d.ts +0 -59
  826. package/dist/server/capabilities.js +0 -141
  827. package/dist/server/capabilities.js.map +0 -1
  828. package/dist/server/checkout-progress.d.ts +0 -10
  829. package/dist/server/checkout-progress.js +0 -27
  830. package/dist/server/checkout-progress.js.map +0 -1
  831. package/dist/server/checkout.d.ts +0 -129
  832. package/dist/server/checkout.js +0 -304
  833. package/dist/server/checkout.js.map +0 -1
  834. package/dist/server/cockpit-ownership.d.ts +0 -31
  835. package/dist/server/cockpit-ownership.js +0 -191
  836. package/dist/server/cockpit-ownership.js.map +0 -1
  837. package/dist/server/cold-repo-handles.d.ts +0 -14
  838. package/dist/server/cold-repo-handles.js +0 -78
  839. package/dist/server/cold-repo-handles.js.map +0 -1
  840. package/dist/server/completion-actions.d.ts +0 -30
  841. package/dist/server/completion-actions.js +0 -204
  842. package/dist/server/completion-actions.js.map +0 -1
  843. package/dist/server/create-project.d.ts +0 -71
  844. package/dist/server/create-project.js +0 -448
  845. package/dist/server/create-project.js.map +0 -1
  846. package/dist/server/forge/github-filters.d.ts +0 -22
  847. package/dist/server/forge/github-filters.js +0 -127
  848. package/dist/server/forge/github-filters.js.map +0 -1
  849. package/dist/server/forge/github-merge-requirements.d.ts +0 -18
  850. package/dist/server/forge/github-merge-requirements.js +0 -137
  851. package/dist/server/forge/github-merge-requirements.js.map +0 -1
  852. package/dist/server/forge/github.d.ts +0 -535
  853. package/dist/server/forge/github.js +0 -3200
  854. package/dist/server/forge/github.js.map +0 -1
  855. package/dist/server/forge/index.d.ts +0 -40
  856. package/dist/server/forge/index.js +0 -72
  857. package/dist/server/forge/index.js.map +0 -1
  858. package/dist/server/forge/types.d.ts +0 -244
  859. package/dist/server/forge/types.js +0 -2
  860. package/dist/server/forge/types.js.map +0 -1
  861. package/dist/server/fs-browse.d.ts +0 -80
  862. package/dist/server/fs-browse.js +0 -182
  863. package/dist/server/fs-browse.js.map +0 -1
  864. package/dist/server/git-changes.d.ts +0 -203
  865. package/dist/server/git-changes.js +0 -508
  866. package/dist/server/git-changes.js.map +0 -1
  867. package/dist/server/git.d.ts +0 -52
  868. package/dist/server/git.js +0 -170
  869. package/dist/server/git.js.map +0 -1
  870. package/dist/server/github.d.ts +0 -9
  871. package/dist/server/github.js +0 -8
  872. package/dist/server/github.js.map +0 -1
  873. package/dist/server/launch-key.d.ts +0 -5
  874. package/dist/server/launch-key.js +0 -31
  875. package/dist/server/launch-key.js.map +0 -1
  876. package/dist/server/live-routes.d.ts +0 -68
  877. package/dist/server/live-routes.js +0 -147
  878. package/dist/server/live-routes.js.map +0 -1
  879. package/dist/server/open-in-app.d.ts +0 -57
  880. package/dist/server/open-in-app.js +0 -177
  881. package/dist/server/open-in-app.js.map +0 -1
  882. package/dist/server/open-in-targets.d.ts +0 -42
  883. package/dist/server/open-in-targets.js +0 -110
  884. package/dist/server/open-in-targets.js.map +0 -1
  885. package/dist/server/open-in-terminal.d.ts +0 -73
  886. package/dist/server/open-in-terminal.js +0 -159
  887. package/dist/server/open-in-terminal.js.map +0 -1
  888. package/dist/server/pr.d.ts +0 -7
  889. package/dist/server/pr.js +0 -7
  890. package/dist/server/pr.js.map +0 -1
  891. package/dist/server/preview-cdp-socket.d.ts +0 -21
  892. package/dist/server/preview-cdp-socket.js +0 -112
  893. package/dist/server/preview-cdp-socket.js.map +0 -1
  894. package/dist/server/preview-socket.d.ts +0 -36
  895. package/dist/server/preview-socket.js +0 -126
  896. package/dist/server/preview-socket.js.map +0 -1
  897. package/dist/server/preview-sockets.d.ts +0 -14
  898. package/dist/server/preview-sockets.js +0 -18
  899. package/dist/server/preview-sockets.js.map +0 -1
  900. package/dist/server/project-context.d.ts +0 -192
  901. package/dist/server/project-context.js +0 -452
  902. package/dist/server/project-context.js.map +0 -1
  903. package/dist/server/provider-action-gate.d.ts +0 -5
  904. package/dist/server/provider-action-gate.js +0 -27
  905. package/dist/server/provider-action-gate.js.map +0 -1
  906. package/dist/server/provider-auth-runtime.d.ts +0 -32
  907. package/dist/server/provider-auth-runtime.js +0 -116
  908. package/dist/server/provider-auth-runtime.js.map +0 -1
  909. package/dist/server/repo-branch-forge.d.ts +0 -59
  910. package/dist/server/repo-branch-forge.js +0 -157
  911. package/dist/server/repo-branch-forge.js.map +0 -1
  912. package/dist/server/repo-branch-sweep.d.ts +0 -21
  913. package/dist/server/repo-branch-sweep.js +0 -64
  914. package/dist/server/repo-branch-sweep.js.map +0 -1
  915. package/dist/server/repo-branches.d.ts +0 -101
  916. package/dist/server/repo-branches.js +0 -803
  917. package/dist/server/repo-branches.js.map +0 -1
  918. package/dist/server/repo-pull.d.ts +0 -18
  919. package/dist/server/repo-pull.js +0 -96
  920. package/dist/server/repo-pull.js.map +0 -1
  921. package/dist/server/run-event-feed.d.ts +0 -20
  922. package/dist/server/run-event-feed.js +0 -190
  923. package/dist/server/run-event-feed.js.map +0 -1
  924. package/dist/server/server-deps.d.ts +0 -37
  925. package/dist/server/server-deps.js +0 -114
  926. package/dist/server/server-deps.js.map +0 -1
  927. package/dist/server/server.d.ts +0 -29583
  928. package/dist/server/server.js +0 -5456
  929. package/dist/server/server.js.map +0 -1
  930. package/dist/server/start-run-options.d.ts +0 -83
  931. package/dist/server/start-run-options.js +0 -111
  932. package/dist/server/start-run-options.js.map +0 -1
  933. package/dist/server/static-ui.d.ts +0 -49
  934. package/dist/server/static-ui.js +0 -98
  935. package/dist/server/static-ui.js.map +0 -1
  936. package/dist/server/upgrade-router.d.ts +0 -23
  937. package/dist/server/upgrade-router.js +0 -53
  938. package/dist/server/upgrade-router.js.map +0 -1
  939. package/dist/server/validators.d.ts +0 -80
  940. package/dist/server/validators.js +0 -85
  941. package/dist/server/validators.js.map +0 -1
  942. package/dist/server/ws.d.ts +0 -65
  943. package/dist/server/ws.js +0 -200
  944. package/dist/server/ws.js.map +0 -1
  945. package/dist/server/wsl.d.ts +0 -25
  946. package/dist/server/wsl.js +0 -92
  947. package/dist/server/wsl.js.map +0 -1
  948. package/dist/server-install/engine.d.ts +0 -47
  949. package/dist/server-install/engine.js +0 -317
  950. package/dist/server-install/engine.js.map +0 -1
  951. package/dist/server-install/npx-cache.d.ts +0 -36
  952. package/dist/server-install/npx-cache.js +0 -104
  953. package/dist/server-install/npx-cache.js.map +0 -1
  954. package/dist/server-install/platforms/macosx-ngrok.d.ts +0 -6
  955. package/dist/server-install/platforms/macosx-ngrok.js +0 -371
  956. package/dist/server-install/platforms/macosx-ngrok.js.map +0 -1
  957. package/dist/server-install/platforms/ubuntu-vps.d.ts +0 -54
  958. package/dist/server-install/platforms/ubuntu-vps.js +0 -1066
  959. package/dist/server-install/platforms/ubuntu-vps.js.map +0 -1
  960. package/dist/server-install/state.d.ts +0 -50
  961. package/dist/server-install/state.js +0 -180
  962. package/dist/server-install/state.js.map +0 -1
  963. package/dist/server-install/steps.d.ts +0 -108
  964. package/dist/server-install/steps.js +0 -332
  965. package/dist/server-install/steps.js.map +0 -1
  966. package/dist/server-install/strategies.d.ts +0 -4
  967. package/dist/server-install/strategies.js +0 -20
  968. package/dist/server-install/strategies.js.map +0 -1
  969. package/dist/server-install/types.d.ts +0 -284
  970. package/dist/server-install/types.js +0 -118
  971. package/dist/server-install/types.js.map +0 -1
  972. package/dist/server-install/ui.d.ts +0 -36
  973. package/dist/server-install/ui.js +0 -130
  974. package/dist/server-install/ui.js.map +0 -1
  975. package/dist/session-context.d.ts +0 -64
  976. package/dist/session-context.js +0 -264
  977. package/dist/session-context.js.map +0 -1
  978. package/dist/skills-provision.d.ts +0 -62
  979. package/dist/skills-provision.js +0 -325
  980. package/dist/skills-provision.js.map +0 -1
  981. package/dist/skills-remote.d.ts +0 -129
  982. package/dist/skills-remote.js +0 -782
  983. package/dist/skills-remote.js.map +0 -1
  984. package/dist/skills.d.ts +0 -71
  985. package/dist/skills.js +0 -249
  986. package/dist/skills.js.map +0 -1
  987. package/dist/subcommands.d.ts +0 -11
  988. package/dist/subcommands.js +0 -25
  989. package/dist/subcommands.js.map +0 -1
  990. package/dist/task-cli/cli.d.ts +0 -39
  991. package/dist/task-cli/cli.js +0 -721
  992. package/dist/task-cli/cli.js.map +0 -1
  993. package/dist/task-cli/discovery.d.ts +0 -25
  994. package/dist/task-cli/discovery.js +0 -98
  995. package/dist/task-cli/discovery.js.map +0 -1
  996. package/dist/task-cli/hint.d.ts +0 -20
  997. package/dist/task-cli/hint.js +0 -14
  998. package/dist/task-cli/hint.js.map +0 -1
  999. package/dist/task-cli/http.d.ts +0 -49
  1000. package/dist/task-cli/http.js +0 -109
  1001. package/dist/task-cli/http.js.map +0 -1
  1002. package/dist/task-cli/projections.d.ts +0 -68
  1003. package/dist/task-cli/projections.js +0 -76
  1004. package/dist/task-cli/projections.js.map +0 -1
  1005. package/dist/task-cli/watch.d.ts +0 -119
  1006. package/dist/task-cli/watch.js +0 -475
  1007. package/dist/task-cli/watch.js.map +0 -1
  1008. package/dist/ui-state.d.ts +0 -41
  1009. package/dist/ui-state.js +0 -90
  1010. package/dist/ui-state.js.map +0 -1
  1011. package/dist/update-check.d.ts +0 -2
  1012. package/dist/update-check.js +0 -26
  1013. package/dist/update-check.js.map +0 -1
  1014. package/dist/voice/decide.d.ts +0 -32
  1015. package/dist/voice/decide.js +0 -297
  1016. package/dist/voice/decide.js.map +0 -1
  1017. package/dist/voice/decision-log.d.ts +0 -52
  1018. package/dist/voice/decision-log.js +0 -107
  1019. package/dist/voice/decision-log.js.map +0 -1
  1020. package/dist/voice/engine.d.ts +0 -119
  1021. package/dist/voice/engine.js +0 -60
  1022. package/dist/voice/engine.js.map +0 -1
  1023. package/dist/voice/fake-engine.d.ts +0 -10
  1024. package/dist/voice/fake-engine.js +0 -192
  1025. package/dist/voice/fake-engine.js.map +0 -1
  1026. package/dist/voice/jev-engine.d.ts +0 -17
  1027. package/dist/voice/jev-engine.js +0 -110
  1028. package/dist/voice/jev-engine.js.map +0 -1
  1029. package/dist/voice/pending-ask.d.ts +0 -17
  1030. package/dist/voice/pending-ask.js +0 -50
  1031. package/dist/voice/pending-ask.js.map +0 -1
  1032. package/dist/voice/routes.d.ts +0 -115
  1033. package/dist/voice/routes.js +0 -91
  1034. package/dist/voice/routes.js.map +0 -1
  1035. package/dist/voice/sentence.d.ts +0 -21
  1036. package/dist/voice/sentence.js +0 -61
  1037. package/dist/voice/sentence.js.map +0 -1
  1038. package/dist/voice/thresholds.d.ts +0 -28
  1039. package/dist/voice/thresholds.js +0 -29
  1040. package/dist/voice/thresholds.js.map +0 -1
  1041. package/dist/webhooks/cli.d.ts +0 -18
  1042. package/dist/webhooks/cli.js +0 -145
  1043. package/dist/webhooks/cli.js.map +0 -1
  1044. package/dist/webhooks/prompt.d.ts +0 -5
  1045. package/dist/webhooks/prompt.js +0 -26
  1046. package/dist/webhooks/prompt.js.map +0 -1
  1047. package/dist/workflows/active-run.d.ts +0 -170
  1048. package/dist/workflows/active-run.js +0 -21
  1049. package/dist/workflows/active-run.js.map +0 -1
  1050. package/dist/workflows/attachment-path.d.ts +0 -6
  1051. package/dist/workflows/attachment-path.js +0 -40
  1052. package/dist/workflows/attachment-path.js.map +0 -1
  1053. package/dist/workflows/completion-policy.d.ts +0 -98
  1054. package/dist/workflows/completion-policy.js +0 -87
  1055. package/dist/workflows/completion-policy.js.map +0 -1
  1056. package/dist/workflows/continuation-admission.d.ts +0 -965
  1057. package/dist/workflows/continuation-admission.js +0 -265
  1058. package/dist/workflows/continuation-admission.js.map +0 -1
  1059. package/dist/workflows/execution-account.d.ts +0 -13
  1060. package/dist/workflows/execution-account.js +0 -18
  1061. package/dist/workflows/execution-account.js.map +0 -1
  1062. package/dist/workflows/grouped-command.d.ts +0 -31
  1063. package/dist/workflows/grouped-command.js +0 -143
  1064. package/dist/workflows/grouped-command.js.map +0 -1
  1065. package/dist/workflows/input-acknowledgement.d.ts +0 -203
  1066. package/dist/workflows/input-acknowledgement.js +0 -41
  1067. package/dist/workflows/input-acknowledgement.js.map +0 -1
  1068. package/dist/workflows/line-order.d.ts +0 -5
  1069. package/dist/workflows/line-order.js +0 -25
  1070. package/dist/workflows/line-order.js.map +0 -1
  1071. package/dist/workflows/load.d.ts +0 -17
  1072. package/dist/workflows/load.js +0 -61
  1073. package/dist/workflows/load.js.map +0 -1
  1074. package/dist/workflows/outcome-batches.d.ts +0 -32
  1075. package/dist/workflows/outcome-batches.js +0 -55
  1076. package/dist/workflows/outcome-batches.js.map +0 -1
  1077. package/dist/workflows/pasted-content.d.ts +0 -60
  1078. package/dist/workflows/pasted-content.js +0 -69
  1079. package/dist/workflows/pasted-content.js.map +0 -1
  1080. package/dist/workflows/question-routing.d.ts +0 -8
  1081. package/dist/workflows/question-routing.js +0 -20
  1082. package/dist/workflows/question-routing.js.map +0 -1
  1083. package/dist/workflows/run/attachment-writer.d.ts +0 -34
  1084. package/dist/workflows/run/attachment-writer.js +0 -98
  1085. package/dist/workflows/run/attachment-writer.js.map +0 -1
  1086. package/dist/workflows/run/auto-resume.d.ts +0 -91
  1087. package/dist/workflows/run/auto-resume.js +0 -248
  1088. package/dist/workflows/run/auto-resume.js.map +0 -1
  1089. package/dist/workflows/run/cezar-tools.d.ts +0 -45
  1090. package/dist/workflows/run/cezar-tools.js +0 -129
  1091. package/dist/workflows/run/cezar-tools.js.map +0 -1
  1092. package/dist/workflows/run/completion-gate.d.ts +0 -77
  1093. package/dist/workflows/run/completion-gate.js +0 -90
  1094. package/dist/workflows/run/completion-gate.js.map +0 -1
  1095. package/dist/workflows/run/compose.d.ts +0 -174
  1096. package/dist/workflows/run/compose.js +0 -391
  1097. package/dist/workflows/run/compose.js.map +0 -1
  1098. package/dist/workflows/run/constants.d.ts +0 -48
  1099. package/dist/workflows/run/constants.js +0 -49
  1100. package/dist/workflows/run/constants.js.map +0 -1
  1101. package/dist/workflows/run/continuation-acceptance.d.ts +0 -70
  1102. package/dist/workflows/run/continuation-acceptance.js +0 -198
  1103. package/dist/workflows/run/continuation-acceptance.js.map +0 -1
  1104. package/dist/workflows/run/continuation-session.d.ts +0 -128
  1105. package/dist/workflows/run/continuation-session.js +0 -581
  1106. package/dist/workflows/run/continuation-session.js.map +0 -1
  1107. package/dist/workflows/run/drop-active.d.ts +0 -4
  1108. package/dist/workflows/run/drop-active.js +0 -11
  1109. package/dist/workflows/run/drop-active.js.map +0 -1
  1110. package/dist/workflows/run/family-reconciler.d.ts +0 -74
  1111. package/dist/workflows/run/family-reconciler.js +0 -310
  1112. package/dist/workflows/run/family-reconciler.js.map +0 -1
  1113. package/dist/workflows/run/human-waits.d.ts +0 -91
  1114. package/dist/workflows/run/human-waits.js +0 -192
  1115. package/dist/workflows/run/human-waits.js.map +0 -1
  1116. package/dist/workflows/run/inbox-claims.d.ts +0 -38
  1117. package/dist/workflows/run/inbox-claims.js +0 -107
  1118. package/dist/workflows/run/inbox-claims.js.map +0 -1
  1119. package/dist/workflows/run/input-batch.d.ts +0 -15
  1120. package/dist/workflows/run/input-batch.js +0 -31
  1121. package/dist/workflows/run/input-batch.js.map +0 -1
  1122. package/dist/workflows/run/input-delivery.d.ts +0 -122
  1123. package/dist/workflows/run/input-delivery.js +0 -661
  1124. package/dist/workflows/run/input-delivery.js.map +0 -1
  1125. package/dist/workflows/run/input-receipts.d.ts +0 -65
  1126. package/dist/workflows/run/input-receipts.js +0 -222
  1127. package/dist/workflows/run/input-receipts.js.map +0 -1
  1128. package/dist/workflows/run/input-timers.d.ts +0 -10
  1129. package/dist/workflows/run/input-timers.js +0 -42
  1130. package/dist/workflows/run/input-timers.js.map +0 -1
  1131. package/dist/workflows/run/launch-context.d.ts +0 -64
  1132. package/dist/workflows/run/launch-context.js +0 -145
  1133. package/dist/workflows/run/launch-context.js.map +0 -1
  1134. package/dist/workflows/run/launch-settings.d.ts +0 -49
  1135. package/dist/workflows/run/launch-settings.js +0 -125
  1136. package/dist/workflows/run/launch-settings.js.map +0 -1
  1137. package/dist/workflows/run/maintenance-claims.d.ts +0 -47
  1138. package/dist/workflows/run/maintenance-claims.js +0 -83
  1139. package/dist/workflows/run/maintenance-claims.js.map +0 -1
  1140. package/dist/workflows/run/memory-guard.d.ts +0 -25
  1141. package/dist/workflows/run/memory-guard.js +0 -63
  1142. package/dist/workflows/run/memory-guard.js.map +0 -1
  1143. package/dist/workflows/run/opening.d.ts +0 -41
  1144. package/dist/workflows/run/opening.js +0 -92
  1145. package/dist/workflows/run/opening.js.map +0 -1
  1146. package/dist/workflows/run/pending-ask-facts.d.ts +0 -10
  1147. package/dist/workflows/run/pending-ask-facts.js +0 -19
  1148. package/dist/workflows/run/pending-ask-facts.js.map +0 -1
  1149. package/dist/workflows/run/prompts.d.ts +0 -74
  1150. package/dist/workflows/run/prompts.js +0 -140
  1151. package/dist/workflows/run/prompts.js.map +0 -1
  1152. package/dist/workflows/run/queued-input.d.ts +0 -108
  1153. package/dist/workflows/run/queued-input.js +0 -321
  1154. package/dist/workflows/run/queued-input.js.map +0 -1
  1155. package/dist/workflows/run/queued-revival.d.ts +0 -44
  1156. package/dist/workflows/run/queued-revival.js +0 -157
  1157. package/dist/workflows/run/queued-revival.js.map +0 -1
  1158. package/dist/workflows/run/repo-root-lease.d.ts +0 -34
  1159. package/dist/workflows/run/repo-root-lease.js +0 -70
  1160. package/dist/workflows/run/repo-root-lease.js.map +0 -1
  1161. package/dist/workflows/run/resolved-wait-input-batch.d.ts +0 -7
  1162. package/dist/workflows/run/resolved-wait-input-batch.js +0 -25
  1163. package/dist/workflows/run/resolved-wait-input-batch.js.map +0 -1
  1164. package/dist/workflows/run/run-cancel.d.ts +0 -36
  1165. package/dist/workflows/run/run-cancel.js +0 -126
  1166. package/dist/workflows/run/run-cancel.js.map +0 -1
  1167. package/dist/workflows/run/run-finish.d.ts +0 -68
  1168. package/dist/workflows/run/run-finish.js +0 -239
  1169. package/dist/workflows/run/run-finish.js.map +0 -1
  1170. package/dist/workflows/run/run-guards.d.ts +0 -14
  1171. package/dist/workflows/run/run-guards.js +0 -34
  1172. package/dist/workflows/run/run-guards.js.map +0 -1
  1173. package/dist/workflows/run/run-line.d.ts +0 -179
  1174. package/dist/workflows/run/run-line.js +0 -429
  1175. package/dist/workflows/run/run-line.js.map +0 -1
  1176. package/dist/workflows/run/run-recovery.d.ts +0 -117
  1177. package/dist/workflows/run/run-recovery.js +0 -442
  1178. package/dist/workflows/run/run-recovery.js.map +0 -1
  1179. package/dist/workflows/run/run-settlement.d.ts +0 -163
  1180. package/dist/workflows/run/run-settlement.js +0 -535
  1181. package/dist/workflows/run/run-settlement.js.map +0 -1
  1182. package/dist/workflows/run/run-skills.d.ts +0 -81
  1183. package/dist/workflows/run/run-skills.js +0 -178
  1184. package/dist/workflows/run/run-skills.js.map +0 -1
  1185. package/dist/workflows/run/run-start.d.ts +0 -64
  1186. package/dist/workflows/run/run-start.js +0 -177
  1187. package/dist/workflows/run/run-start.js.map +0 -1
  1188. package/dist/workflows/run/run-workspace.d.ts +0 -25
  1189. package/dist/workflows/run/run-workspace.js +0 -65
  1190. package/dist/workflows/run/run-workspace.js.map +0 -1
  1191. package/dist/workflows/run/session-events.d.ts +0 -144
  1192. package/dist/workflows/run/session-events.js +0 -262
  1193. package/dist/workflows/run/session-events.js.map +0 -1
  1194. package/dist/workflows/run/step-decisions.d.ts +0 -37
  1195. package/dist/workflows/run/step-decisions.js +0 -42
  1196. package/dist/workflows/run/step-decisions.js.map +0 -1
  1197. package/dist/workflows/run/step-loop.d.ts +0 -140
  1198. package/dist/workflows/run/step-loop.js +0 -490
  1199. package/dist/workflows/run/step-loop.js.map +0 -1
  1200. package/dist/workflows/run/step-session.d.ts +0 -64
  1201. package/dist/workflows/run/step-session.js +0 -280
  1202. package/dist/workflows/run/step-session.js.map +0 -1
  1203. package/dist/workflows/run/steps.d.ts +0 -13
  1204. package/dist/workflows/run/steps.js +0 -14
  1205. package/dist/workflows/run/steps.js.map +0 -1
  1206. package/dist/workflows/run/tracked-work.d.ts +0 -12
  1207. package/dist/workflows/run/tracked-work.js +0 -29
  1208. package/dist/workflows/run/tracked-work.js.map +0 -1
  1209. package/dist/workflows/run/turn-bookkeeping.d.ts +0 -67
  1210. package/dist/workflows/run/turn-bookkeeping.js +0 -174
  1211. package/dist/workflows/run/turn-bookkeeping.js.map +0 -1
  1212. package/dist/workflows/run/turn-markers.d.ts +0 -85
  1213. package/dist/workflows/run/turn-markers.js +0 -262
  1214. package/dist/workflows/run/turn-markers.js.map +0 -1
  1215. package/dist/workflows/run/turn-nudges.d.ts +0 -101
  1216. package/dist/workflows/run/turn-nudges.js +0 -245
  1217. package/dist/workflows/run/turn-nudges.js.map +0 -1
  1218. package/dist/workflows/run/turn-settler.d.ts +0 -166
  1219. package/dist/workflows/run/turn-settler.js +0 -492
  1220. package/dist/workflows/run/turn-settler.js.map +0 -1
  1221. package/dist/workflows/run/types.d.ts +0 -280
  1222. package/dist/workflows/run/types.js +0 -2
  1223. package/dist/workflows/run/types.js.map +0 -1
  1224. package/dist/workflows/run/usage-accounting.d.ts +0 -28
  1225. package/dist/workflows/run/usage-accounting.js +0 -158
  1226. package/dist/workflows/run/usage-accounting.js.map +0 -1
  1227. package/dist/workflows/run/wait-registry.d.ts +0 -132
  1228. package/dist/workflows/run/wait-registry.js +0 -405
  1229. package/dist/workflows/run/wait-registry.js.map +0 -1
  1230. package/dist/workflows/run/wait-watches.d.ts +0 -855
  1231. package/dist/workflows/run/wait-watches.js +0 -221
  1232. package/dist/workflows/run/wait-watches.js.map +0 -1
  1233. package/dist/workflows/run/wake-admission.d.ts +0 -160
  1234. package/dist/workflows/run/wake-admission.js +0 -404
  1235. package/dist/workflows/run/wake-admission.js.map +0 -1
  1236. package/dist/workflows/run/wake-ledger.d.ts +0 -61
  1237. package/dist/workflows/run/wake-ledger.js +0 -77
  1238. package/dist/workflows/run/wake-ledger.js.map +0 -1
  1239. package/dist/workflows/run/wake-retries.d.ts +0 -31
  1240. package/dist/workflows/run/wake-retries.js +0 -93
  1241. package/dist/workflows/run/wake-retries.js.map +0 -1
  1242. package/dist/workflows/run/worker-executions.d.ts +0 -54
  1243. package/dist/workflows/run/worker-executions.js +0 -149
  1244. package/dist/workflows/run/worker-executions.js.map +0 -1
  1245. package/dist/workflows/run/worker-orphans.d.ts +0 -91
  1246. package/dist/workflows/run/worker-orphans.js +0 -275
  1247. package/dist/workflows/run/worker-orphans.js.map +0 -1
  1248. package/dist/workflows/run/worker-questions.d.ts +0 -122
  1249. package/dist/workflows/run/worker-questions.js +0 -309
  1250. package/dist/workflows/run/worker-questions.js.map +0 -1
  1251. package/dist/workflows/run/workflow-position.d.ts +0 -18
  1252. package/dist/workflows/run/workflow-position.js +0 -88
  1253. package/dist/workflows/run/workflow-position.js.map +0 -1
  1254. package/dist/workflows/run/worktree-autosave.d.ts +0 -39
  1255. package/dist/workflows/run/worktree-autosave.js +0 -156
  1256. package/dist/workflows/run/worktree-autosave.js.map +0 -1
  1257. package/dist/workflows/run-scheduling.d.ts +0 -40
  1258. package/dist/workflows/run-scheduling.js +0 -84
  1259. package/dist/workflows/run-scheduling.js.map +0 -1
  1260. package/dist/workflows/run-states.d.ts +0 -191
  1261. package/dist/workflows/run-states.js +0 -318
  1262. package/dist/workflows/run-states.js.map +0 -1
  1263. package/dist/workflows/run.d.ts +0 -334
  1264. package/dist/workflows/run.js +0 -603
  1265. package/dist/workflows/run.js.map +0 -1
  1266. package/dist/workflows/turn-end.d.ts +0 -126
  1267. package/dist/workflows/turn-end.js +0 -78
  1268. package/dist/workflows/turn-end.js.map +0 -1
  1269. package/dist/workflows/types.d.ts +0 -83
  1270. package/dist/workflows/types.js +0 -192
  1271. package/dist/workflows/types.js.map +0 -1
  1272. package/dist/workflows/wait-scope.d.ts +0 -80
  1273. package/dist/workflows/wait-scope.js +0 -110
  1274. package/dist/workflows/wait-scope.js.map +0 -1
  1275. package/dist/workflows/waits.d.ts +0 -188
  1276. package/dist/workflows/waits.js +0 -287
  1277. package/dist/workflows/waits.js.map +0 -1
  1278. package/dist/workspace/agent-accounts.d.ts +0 -128
  1279. package/dist/workspace/agent-accounts.js +0 -280
  1280. package/dist/workspace/agent-accounts.js.map +0 -1
  1281. package/dist/workspace/agent-profiles.d.ts +0 -124
  1282. package/dist/workspace/agent-profiles.js +0 -190
  1283. package/dist/workspace/agent-profiles.js.map +0 -1
  1284. package/dist/workspace/config.d.ts +0 -181
  1285. package/dist/workspace/config.js +0 -389
  1286. package/dist/workspace/config.js.map +0 -1
  1287. package/dist/workspace/migrations.d.ts +0 -35
  1288. package/dist/workspace/migrations.js +0 -147
  1289. package/dist/workspace/migrations.js.map +0 -1
  1290. package/dist/workspace/projects-cli.d.ts +0 -25
  1291. package/dist/workspace/projects-cli.js +0 -172
  1292. package/dist/workspace/projects-cli.js.map +0 -1
  1293. package/dist/workspace/projects.d.ts +0 -129
  1294. package/dist/workspace/projects.js +0 -267
  1295. package/dist/workspace/projects.js.map +0 -1
  1296. package/dist/workspace/semaphore.d.ts +0 -145
  1297. package/dist/workspace/semaphore.js +0 -196
  1298. package/dist/workspace/semaphore.js.map +0 -1
  1299. package/dist/workspace/ui-state.d.ts +0 -36
  1300. package/dist/workspace/ui-state.js +0 -55
  1301. package/dist/workspace/ui-state.js.map +0 -1
  1302. package/dist/workspace/webhooks.d.ts +0 -40
  1303. package/dist/workspace/webhooks.js +0 -146
  1304. package/dist/workspace/webhooks.js.map +0 -1
  1305. package/dist/worktree-manifest.d.ts +0 -165
  1306. package/dist/worktree-manifest.js +0 -530
  1307. package/dist/worktree-manifest.js.map +0 -1
  1308. package/dist/worktree-setup.d.ts +0 -85
  1309. package/dist/worktree-setup.js +0 -164
  1310. package/dist/worktree-setup.js.map +0 -1
  1311. package/scripts/benchmark-run-store-fixture.ts +0 -432
  1312. package/scripts/benchmark-run-store.ts +0 -743
  1313. package/scripts/benchmark-stuck-destroys.ts +0 -143
  1314. package/scripts/check-pack.mjs +0 -48
  1315. package/scripts/inline-contract.mjs +0 -165
  1316. package/scripts/install-as-command.mjs +0 -122
  1317. package/scripts/measure-transcript-facts-health.mjs +0 -87
  1318. package/scripts/measure-transcript-facts-lag.mjs +0 -68
  1319. package/scripts/mock-autonomous.mjs +0 -11
  1320. package/scripts/mock-ci-tool.mjs +0 -111
  1321. package/scripts/mock-claude-model-refusal.mjs +0 -42
  1322. package/scripts/mock-claude.mjs +0 -1065
  1323. package/scripts/mock-codex-app-server.mjs +0 -905
  1324. package/scripts/mock-codex-coalesce-steer.mjs +0 -59
  1325. package/scripts/mock-codex-reverse-steer.mjs +0 -130
  1326. package/scripts/mock-cursor-acp.mjs +0 -423
  1327. package/scripts/mock-cursor-hang-stdin-late.mjs +0 -35
  1328. package/scripts/mock-cursor-hang-stdin.mjs +0 -30
  1329. package/scripts/mock-cursor-print.mjs +0 -256
  1330. package/scripts/mock-deferred-turn-start.mjs +0 -16
  1331. package/scripts/mock-delivery-control.d.mts +0 -23
  1332. package/scripts/mock-delivery-control.mjs +0 -80
  1333. package/scripts/mock-env-record.mjs +0 -11
  1334. package/scripts/mock-failure-control.d.mts +0 -13
  1335. package/scripts/mock-failure-control.mjs +0 -68
  1336. package/scripts/mock-multi-pr.mjs +0 -7
  1337. package/scripts/mock-nudge.mjs +0 -45
  1338. package/scripts/mock-omp-rpc.mjs +0 -779
  1339. package/scripts/mock-opencode-serve.mjs +0 -1230
  1340. package/scripts/mock-pi-rpc.mjs +0 -698
  1341. package/scripts/mock-runner-crash.mjs +0 -58
  1342. package/scripts/mock-session-context.d.mts +0 -5
  1343. package/scripts/mock-session-context.mjs +0 -56
  1344. package/scripts/mock-silent-tail.mjs +0 -85
  1345. package/scripts/mock-turn-messages.mjs +0 -5
  1346. package/scripts/omp-ci-wait.mjs +0 -29
  1347. package/scripts/omp-restrict-delegation.yml +0 -4
  1348. package/scripts/pi-ci-wait.mjs +0 -17
  1349. package/scripts/pi-default-tools.mjs +0 -22
  1350. package/scripts/pi-project-skills.mjs +0 -59
  1351. package/scripts/pi-retry-degraded-service.mjs +0 -16
  1352. package/scripts/probe-cursor-print.mjs +0 -627
  1353. package/scripts/seed-archive-profile.ts +0 -53
  1354. package/scripts/sync-readme.mjs +0 -20
  1355. package/scripts/test-process-usage.mjs +0 -47
  1356. package/scripts/transcript-facts-fixture.mjs +0 -53
  1357. package/scripts/voice-replay.ts +0 -50
  1358. package/scripts/windows-workspace-identity.cs +0 -208
  1359. package/scripts/windows-workspace-identity.ps1 +0 -10
  1360. package/web/dist/assets/alert-dialog-DfctKUMw.js +0 -1
  1361. package/web/dist/assets/button-CeupvoKG.js +0 -41
  1362. package/web/dist/assets/centered-state-DRV994qx.js +0 -1
  1363. package/web/dist/assets/cez-idle-D3aj_9lp.js +0 -1
  1364. package/web/dist/assets/diff-CMvwOEAq2.js +0 -3
  1365. package/web/dist/assets/diff-controls-DOUOXMFa.js +0 -1
  1366. package/web/dist/assets/diff-view-CeyiYVO0.js +0 -11
  1367. package/web/dist/assets/dropdown-menu-o5TscAn1.js +0 -6
  1368. package/web/dist/assets/git-toolbar-BXqnQi8K.js +0 -1
  1369. package/web/dist/assets/github-BK1vJWfx.js +0 -1
  1370. package/web/dist/assets/index-C3hy-aA5.css +0 -1
  1371. package/web/dist/assets/index-CvfFqahx.js +0 -34
  1372. package/web/dist/assets/lib-BQXq3kEf.js +0 -1
  1373. package/web/dist/assets/live-protocol-DhRssvhp.js +0 -64
  1374. package/web/dist/assets/play-CmVAj_fu.js +0 -1
  1375. package/web/dist/assets/popover-BhkASzoh.js +0 -1
  1376. package/web/dist/assets/preview-pane-connected-DYEO_KU8.js +0 -3
  1377. package/web/dist/assets/reference-chip-CwVbHR5t.js +0 -1
  1378. package/web/dist/assets/repo-git-CHmWZuZU.js +0 -1
  1379. package/web/dist/assets/run-header-BaMbZXjb.js +0 -2
  1380. package/web/dist/assets/skill-empty-hint-oOtzR3v0.js +0 -1
  1381. package/web/dist/assets/skills-DviK76JU.js +0 -1
  1382. package/web/dist/assets/status-dot-B_zxTP5h.js +0 -1
  1383. package/web/dist/assets/tab-link-I2OzEyyp.js +0 -1
  1384. package/web/dist/assets/task-changes--tIcV2If.js +0 -1
  1385. package/web/dist/assets/task-commits-BkgYMsVZ.js +0 -1
  1386. package/web/dist/assets/task-files-CfqI5Pd4.js +0 -2
  1387. package/web/dist/assets/task-github-item-CXv13eJx.js +0 -1
  1388. package/web/dist/assets/task-thread-DJfpoqYU.js +0 -9
  1389. package/web/dist/assets/thread-state-C_J5glQD.js +0 -4
  1390. package/web/dist/assets/use-hand-to-agent-state-C-_lVGuC.js +0 -1
  1391. package/web/dist/assets/workflows-9xLAxVoB.js +0 -7
  1392. package/web/dist/assets/zoomable-image-CxQSsfcn.js +0 -1
@@ -1,1269 +0,0 @@
1
- import { uiAskQuestions } from './ask.js';
2
- import { summarizeRunnerStderr } from './runner-stderr.js';
3
- import { randomUUID } from 'node:crypto';
4
- import { parseEffort } from '../contract/index.js';
5
- import { isSignalTerminationExit, prependSystemPrompt, trackChildExit } from './agent-runner.js';
6
- import { codexToolGrantFields } from './runner-tool-grants.js';
7
- import { signalSession } from './session-process.js';
8
- import { afterExitDrain, AUTO_END_DELAY_MS, DEFAULT_RUN_TIMEOUT_MS, exitDrainBudget, KILL_GRACE_MS, } from './runner-runtime.js';
9
- import { parseAskRequest } from './ask.js';
10
- import { readNdjson } from './ndjson.js';
11
- import { drainsAfterClose, isServerRequest, isStaleTurnOutcome, parseNativeLine, stringField, turnIdOf } from './codex-native-frames.js';
12
- import { V1TextCoalescer } from './v1-text-coalescer.js';
13
- import { InputSubmissions } from './input-submissions.js';
14
- import { codexStreamError } from './codex-stream-error.js';
15
- import { codexTurnOutcome } from './codex-turn-outcome.js';
16
- import { codexNetworkIsRestricted, codexPermissionOverrides } from './codex-permissions.js';
17
- import { codexApproval, isCodexApprovalRequest } from './codex-approvals.js';
18
- import { cezarToolEnvNames } from '../ci-wait/tools.js';
19
- import { CodexAppServerRpc, CodexRpcResponseError, codexSpawnError, endCodexAppServer, resolveCodexExecutable, spawnCodexAppServer, waitForCodexAppServerExit, } from './codex-app-server-transport.js';
20
- import { codexSessionStarted, createCodexUiState, mapCodexNotification, } from './codex-ui-mapper.js';
21
- // One startup budget, including handshake ACKs and the first main-thread turn.
22
- // This is not a model-turn or human-question lifetime limit.
23
- const STARTUP_TIMEOUT_MS = 60_000;
24
- // A retry episode gets one budget, regardless of error/warning frequency.
25
- const STREAM_RETRY_TIMEOUT_MS = 60_000;
26
- /**
27
- * `AgentRunner` over `codex app-server` — the same JSONL transport the VS Code
28
- * extension and desktop app use (JSON-RPC 2.0, newline-delimited, over
29
- * stdin/stdout). One long-lived process per session gives Codex the same
30
- * multi-turn shape as the Claude runner: `turn/start` for a new turn,
31
- * `turn/steer` for a mid-turn follow-up, `turn/interrupt` to cancel, and
32
- * `thread/resume` to reopen a stored thread for "Continue".
33
- *
34
- * Auth = the host's logged-in ChatGPT/Codex session (or CODEX_API_KEY). The
35
- * agent inherits managed permissions; confirmed unmanaged sessions keep cezar's
36
- * full-access default. Approval policy always belongs to the app-server.
37
- * Codex has no per-tool allowlist, so
38
- * `spec.toolGrant` is ignored. `CEZ_CODEX_NETWORK=0` requires a confirmed
39
- * network restriction without replacing managed filesystem rules.
40
- */
41
- /**
42
- * What the codex app-server receives from each `AgentRunSpec` field (#284).
43
- * Tool access does not cross this wire: managed permissions belong to Codex;
44
- * unmanaged sessions use cezar's sandbox choice. The app-server has no per-tool
45
- * allowlist, so `toolGrant` is declared dropped rather than mapped (spec
46
- * 2026-07-17-permission-modes). Held against the recorded JSON-RPC by the harness parity matrix.
47
- */
48
- export const CODEX_SPEC_SUPPORT = {
49
- cezarTools: { honored: true, via: 'thread/start and thread/resume dotted mcp_servers config with env_vars and default_tools_approval_mode approve' },
50
- systemPrompt: { honored: true, via: 'prepended to the opening turn/start input through prependSystemPrompt' },
51
- userPrompt: { honored: true, via: 'turn/start input text' },
52
- images: { honored: false, reason: 'the adapter sends text input items only; image blocks are dropped' },
53
- cwd: { honored: true, via: 'spawn cwd, and the thread/start / thread/resume cwd' },
54
- toolGrant: { honored: false, reason: 'no per-tool allowlist on the app-server, so no command-prefix restriction either; managed permissions and approval policy belong to Codex' },
55
- restrictNativeDelegation: { honored: true, via: 'thread/start and thread/resume config features.multi_agent=false, features.multi_agent_v2=false (D1)' },
56
- additionalDirectories: { honored: false, reason: 'no extra-root mapping; managed filesystem permissions belong to Codex' },
57
- env: { honored: true, via: 'merged over the child env through buildCodexAppServerEnv' },
58
- model: { honored: true, via: 'thread/start and thread/resume model' },
59
- effort: { honored: true, via: 'turn/start effort, canonical level' },
60
- timeoutMs: { honored: true, via: 'wall-clock kill switch on the child process' },
61
- sessionId: { honored: true, via: 'thread/resume threadId when resume is set; a fresh thread/start mints its own thread id' },
62
- resume: { honored: true, via: 'thread/resume in place of thread/start' },
63
- resumeFallbackSystemPrompt: { honored: false, reason: 'thread/resume fails a missing thread; the adapter does not open a replacement thread' },
64
- };
65
- export class CodexAppServerRunner {
66
- backend = 'codex';
67
- specSupport = CODEX_SPEC_SUPPORT;
68
- systemPromptOnResume = 'in-thread';
69
- inputDelivery = {
70
- mode: 'steer', consumption: 'observable',
71
- // The userMessage item marks the input entering the thread's history (probe 2026-09-24:
72
- // 0.8 s and 26.7 s after the steer, both before the tool ended); the next model call reads it.
73
- via: 'turn/steer with clientUserMessageId; item/started userMessage clientId once in the thread history',
74
- };
75
- bin;
76
- timeoutMs;
77
- lastSession = null;
78
- constructor(opts = {}) {
79
- this.bin = resolveCodexExecutable(opts.bin);
80
- this.timeoutMs = opts.timeoutMs ?? DEFAULT_RUN_TIMEOUT_MS;
81
- }
82
- run(spec, onEvent) {
83
- return this.startSession(spec, onEvent, { autoEndAfterFirstTurn: true }).result;
84
- }
85
- async interrupt() {
86
- this.lastSession?.interrupt();
87
- }
88
- startSession(spec, onEvent, opts = {}) {
89
- const session = new CodexSession(this.bin, this.timeoutMs, spec, onEvent, opts);
90
- this.lastSession = session;
91
- return session;
92
- }
93
- }
94
- /** One live `codex app-server` process driving a single thread. */
95
- class CodexSession {
96
- bin;
97
- spec;
98
- onEvent;
99
- opts;
100
- result;
101
- child;
102
- rpc;
103
- stdinOpen = true;
104
- threadId;
105
- activeTurnId;
106
- streamRetryTimer;
107
- streamRetryError;
108
- agentInputReady = false;
109
- /** Accepted agent input not yet seen as a consumed userMessage item (#505). */
110
- submissions = new InputSubmissions();
111
- inFlightSubmissionId;
112
- refusedBeforeStartup = false;
113
- humanPromptsPending = 0;
114
- refusedForHuman = false;
115
- /** Human sendMessage client ids still inside startOrSteerTurn (#486). */
116
- humanSteerIds = new Set();
117
- /** RPC id → human client id; cleared synchronously when that response is dispatched. */
118
- humanPromptByRpc = new Map();
119
- /** Human turn/start RPC ids — release on their response even before turn/started. */
120
- humanStartRpcs = new Set();
121
- /** Hint on the next turn/started after a human turn/start was accepted without a live turn. */
122
- humanReadyOnTurnStart = false;
123
- releasedHuman = new Set();
124
- /** Human client ids already echoed as an in-turn userMessage (read-in-turn). */
125
- echoedHuman = new Set();
126
- /** Human steers admitted in-turn and not yet echoed; restarted on turn end (#486). */
127
- unreadHumanSteers = new Map();
128
- /** Submissions that opened a turn via turn/start rather than steering one. */
129
- turnStartSubmissions = new Set();
130
- /** Recent main-thread turn outcomes (true = completed without error), for a late turn/start response. */
131
- completedTurns = new Map();
132
- turnCompletions = 0;
133
- agentSubmissionPending = false;
134
- turnBoundaryVersion = 0;
135
- pendingUserInput;
136
- pendingApprovals = new Map();
137
- toolCalls = [];
138
- textChunks = [];
139
- /** Streamed agentMessage deltas buffered per item — v1 `text` is emitted
140
- * once per completed item (claude parity: one event per complete block),
141
- * never per delta, so the persisted transcript and the headless CLI get
142
- * whole paragraphs. Streaming display rides protocol v2's `item.delta`. */
143
- textCoalescer = new V1TextCoalescer((text) => {
144
- this.textChunks.push(text);
145
- this.emit({ type: 'text', text });
146
- });
147
- tokensUsed = 0;
148
- ready;
149
- startupPhase = 'initialize';
150
- openingAcknowledged = false;
151
- firstTurnStarted = false;
152
- startupComplete = false;
153
- startupTimer;
154
- stopKillTimer;
155
- hardStopStarted = false;
156
- failure;
157
- autoEndTimer;
158
- eofTermTimer;
159
- eofKillTimer;
160
- spawnFailed = null;
161
- timedOut = false;
162
- /** Explicit teardown or automatic cleanup with positive live evidence. */
163
- terminatedByCezar = false;
164
- explicitEnd = false;
165
- automaticCleanupStarted = false;
166
- /** Native termination, independent of signal delivery (`child.killed`). */
167
- hasExited;
168
- /** Protocol v2 emission — additive alongside v1 (`onEvent` keeps flowing
169
- * byte-identical); the channel is `opts.onUiEvent` (RunManager wiring
170
- * lands in R2 step 2.1). */
171
- uiState = createCodexUiState();
172
- constructor(bin, timeoutMs, spec, onEvent, opts) {
173
- this.bin = bin;
174
- this.spec = spec;
175
- this.onEvent = onEvent;
176
- this.opts = opts;
177
- try {
178
- this.child = spawnCodexAppServer(bin, spec.cwd, spec.env, { session: true });
179
- this.rpc = new CodexAppServerRpc(this.child, (error) => {
180
- if (!this.hardStopStarted && !this.hasExited())
181
- this.fail(error);
182
- });
183
- }
184
- catch (err) {
185
- throw codexSpawnError(err, bin);
186
- }
187
- const hasExited = trackChildExit(this.child);
188
- this.hasExited = hasExited;
189
- // Observe termination BEFORE bootstrap. Pending RPCs cannot own the only
190
- // path to discovering that their process has already gone (#493).
191
- const exited = waitForCodexAppServerExit(this.child);
192
- // After real process exit, allow buffered output to drain before closing pipes
193
- // a descendant may have inherited. This drain never proves termination.
194
- let cancelDrain;
195
- this.child.on('error', (err) => {
196
- if (this.child.pid === undefined) {
197
- this.spawnFailed = codexSpawnError(err, bin);
198
- this.closeInput(this.spawnFailed.message);
199
- this.child.stdout.destroy();
200
- }
201
- else if (this.stdinOpen) {
202
- this.fail(new Error(`codex app-server process error while waiting for ${this.startupPhase}`));
203
- }
204
- });
205
- this.child.once('exit', (code, signal) => {
206
- if (this.stdinOpen && !this.startupComplete) {
207
- this.failure ??= new Error(`Codex startup exited (${signal ?? code ?? 'unknown'}) while waiting for ${this.startupPhase}`);
208
- }
209
- // Do not discard final buffered text on a healthy exit. Revoke RPCs
210
- // immediately, then bound pipe draining ONLY after physical termination.
211
- this.expireApprovals('codex app-server exited', false);
212
- this.rpc.close('codex app-server exited');
213
- cancelDrain = afterExitDrain(() => this.child.stdout.destroy(), exitDrainBudget(code));
214
- if (this.stopKillTimer)
215
- clearTimeout(this.stopKillTimer);
216
- });
217
- const stderrChunks = [];
218
- this.child.stderr.setEncoding('utf8');
219
- this.child.stderr.on('data', (chunk) => stderrChunks.push(chunk));
220
- // Whole-session timeouts remain optional; startup is always bounded.
221
- const limitMs = spec.timeoutMs ?? timeoutMs;
222
- let deadline;
223
- if (limitMs > 0) {
224
- deadline = setTimeout(() => {
225
- this.timedOut = true;
226
- this.interrupt();
227
- }, limitMs);
228
- deadline.unref?.();
229
- }
230
- this.startupTimer = setTimeout(() => {
231
- this.fail(new Error(`Codex startup timed out after 60s while waiting for ${this.startupPhase}`), 'timed out after 60s');
232
- }, STARTUP_TIMEOUT_MS);
233
- this.startupTimer.unref?.();
234
- this.ready = this.bootstrap();
235
- const reader = this.readNativeOutput();
236
- this.result = (async () => {
237
- let exitCode;
238
- try {
239
- try {
240
- await Promise.all([this.ready, reader]);
241
- }
242
- catch (err) {
243
- if (this.stdinOpen && !hasExited())
244
- this.fail(err instanceof Error ? err : new Error(String(err)));
245
- }
246
- // RPC cancellation is not a receipt for process termination. Keep the
247
- // TERM→KILL watchdog alive until this independently owned promise settles.
248
- exitCode = await exited;
249
- await reader;
250
- }
251
- finally {
252
- if (deadline)
253
- clearTimeout(deadline);
254
- cancelDrain?.();
255
- if (this.stopKillTimer)
256
- clearTimeout(this.stopKillTimer);
257
- if (this.eofTermTimer)
258
- clearTimeout(this.eofTermTimer);
259
- if (this.eofKillTimer)
260
- clearTimeout(this.eofKillTimer);
261
- this.closeInput('codex app-server exited');
262
- this.child.stdin.destroy();
263
- this.child.stderr.destroy();
264
- }
265
- if (this.spawnFailed)
266
- throw this.spawnFailed;
267
- // Preserve diagnostics even when an RPC/startup failure already owns the error.
268
- const stderr = stderrChunks.join('');
269
- if (stderr.trim() && (this.failure || (!this.timedOut && exitCode !== 0 && exitCode !== null &&
270
- !(this.terminatedByCezar && isSignalTerminationExit(exitCode))))) {
271
- this.emit({ type: 'note', message: `codex app-server stderr:\n${stderr}` });
272
- }
273
- if (this.failure) {
274
- // Before the first prompt ACK, process/pipe closure can own the failure
275
- // before the ordinary crash branch. Keep its phase context and expose
276
- // the drained terminal exception on the same v1 error seam as later exits.
277
- if (!this.startupComplete && !this.timedOut && stderr.trim() && exitCode !== null && exitCode !== 0 &&
278
- !(this.terminatedByCezar && isSignalTerminationExit(exitCode))) {
279
- const detail = summarizeRunnerStderr(stderr);
280
- const message = `codex app-server exited with code ${exitCode}${detail ? ` — ${detail}` : ''} (${this.failure.message})`;
281
- this.emit({ type: 'error', message });
282
- throw new Error(message);
283
- }
284
- throw this.failure;
285
- }
286
- // Timeout/interrupt can end the read loop mid-item — recover buffered prose.
287
- this.textCoalescer.flush();
288
- const text = this.textChunks.join('\n').trim();
289
- const base = {
290
- text,
291
- toolCalls: this.toolCalls,
292
- tokensUsed: this.tokensUsed,
293
- sessionId: this.threadId ?? spec.sessionId,
294
- };
295
- if (this.timedOut) {
296
- const mins = Math.round((limitMs / 60_000) * 10) / 10;
297
- this.emit({ type: 'error', message: `codex app-server timed out after ${mins}m and was killed` });
298
- this.emit({ type: 'done' });
299
- return base;
300
- }
301
- // Our own EOF watchdog / cancel signal coming back as 143/137 — the
302
- // teardown cezar asked for, not a codex failure (#703).
303
- if (this.terminatedByCezar && (isSignalTerminationExit(exitCode) || (exitCode === null && this.child.signalCode !== null))) {
304
- this.emit({
305
- type: 'note',
306
- message: `codex app-server did not exit on its own after close; terminated by cezar (${exitCode === null ? this.child.signalCode : `code ${exitCode}`})`,
307
- });
308
- this.emit({ type: 'done' });
309
- return base;
310
- }
311
- if (exitCode === null && this.child.signalCode !== null) {
312
- const message = `codex app-server was killed by signal ${this.child.signalCode}`;
313
- this.emit({ type: 'error', message });
314
- throw new Error(message);
315
- }
316
- if (exitCode !== 0 && exitCode !== null) {
317
- const summary = summarizeRunnerStderr(stderr);
318
- const detail = summary ? ` — ${summary}` : '';
319
- const message = `codex app-server exited with code ${exitCode}${detail}`;
320
- this.emit({ type: 'error', message });
321
- throw new Error(message);
322
- }
323
- this.emit({ type: 'done' });
324
- return base;
325
- })();
326
- }
327
- get open() {
328
- return this.stdinOpen && this.rpc.open && !this.hasExited();
329
- }
330
- get pid() {
331
- return this.child.pid;
332
- }
333
- sendAgentMessage(content, inputIds = []) {
334
- // #505: a running turn is steered with turn/steer; only an unanswered native ask
335
- // or an in-flight submission refuses.
336
- // Until the thread and its first turn exist there is nothing to steer or start;
337
- // a refusal here earns one readiness hint when startup completes.
338
- if (this.open && !this.startupComplete) {
339
- this.refusedBeforeStartup = true;
340
- return false;
341
- }
342
- // A human prompt still on its way to the wire goes first (#505 local review).
343
- if (this.open && this.humanPromptsPending > 0) {
344
- this.refusedForHuman = true;
345
- return false;
346
- }
347
- if (!this.open || this.pendingUserInput || this.pendingApprovals.size || this.agentSubmissionPending)
348
- return false;
349
- this.agentInputReady = false;
350
- this.agentSubmissionPending = true;
351
- if (this.autoEndTimer)
352
- clearTimeout(this.autoEndTimer);
353
- this.autoEndTimer = undefined;
354
- const submissionId = randomUUID();
355
- this.submissions.accept(submissionId, inputIds, '');
356
- this.inFlightSubmissionId = submissionId;
357
- // Reserve synchronously; only the matching RPC result acknowledges delivery.
358
- return this.startOrSteerTurn(textOf(content), submissionId).catch((err) => {
359
- this.submissions.consume(submissionId); // never accepted: the caller keeps ownership
360
- if (this.stdinOpen)
361
- this.emit({ type: 'error', message: `codex: agent input failed: ${String(err)}` });
362
- throw err;
363
- }).finally(() => {
364
- this.agentSubmissionPending = false;
365
- if (this.inFlightSubmissionId === submissionId)
366
- this.inFlightSubmissionId = undefined;
367
- if (this.stdinOpen && this.agentInputReady && !this.pendingUserInput && !this.pendingApprovals.size) {
368
- this.opts.onAgentInputReady?.();
369
- this.scheduleAutoEnd();
370
- }
371
- });
372
- }
373
- scheduleAutoEnd() {
374
- if (!this.opts.autoEndAfterFirstTurn || !this.open || this.autoEndTimer || this.agentSubmissionPending || this.pendingApprovals.size)
375
- return;
376
- this.autoEndTimer = setTimeout(() => {
377
- this.autoEndTimer = undefined;
378
- if (this.opts.shouldAutoEnd?.() !== false)
379
- this.end();
380
- }, AUTO_END_DELAY_MS);
381
- this.autoEndTimer.unref?.();
382
- }
383
- sendMessage(content) {
384
- this.agentInputReady = false;
385
- if (!this.open || this.pendingApprovals.size)
386
- return false;
387
- if (this.autoEndTimer) {
388
- clearTimeout(this.autoEndTimer);
389
- this.autoEndTimer = undefined;
390
- }
391
- const text = textOf(content);
392
- if (!text)
393
- return true;
394
- if (this.pendingUserInput) {
395
- const pending = this.pendingUserInput;
396
- this.pendingUserInput = undefined;
397
- this.rpc.respond({ id: pending.rpcId, result: { answers: userInputAnswers(pending.questions, text) } });
398
- return this.open;
399
- }
400
- // Wait for the thread to exist, then steer the live turn or start a new one. Agent input
401
- // waits until this prompt's request settles, so it can never overtake it.
402
- const clientUserMessageId = randomUUID();
403
- this.humanSteerIds.add(clientUserMessageId);
404
- this.humanPromptsPending += 1;
405
- void this.ready
406
- .then(() => this.startOrSteerTurn(text, clientUserMessageId))
407
- .catch((err) => {
408
- if (this.stdinOpen) {
409
- const message = err instanceof Error ? err.message : String(err);
410
- this.emit({ type: 'note', message: `codex: turn failed: ${message}` });
411
- }
412
- })
413
- .finally(() => this.finishHumanSteer(clientUserMessageId));
414
- return true;
415
- }
416
- trackHumanRpc(id, clientUserMessageId, kind = 'steer') {
417
- if (!this.humanSteerIds.has(clientUserMessageId))
418
- return;
419
- this.humanPromptByRpc.set(id, clientUserMessageId);
420
- if (kind === 'start')
421
- this.humanStartRpcs.add(id);
422
- }
423
- releaseHumanPrompt(clientUserMessageId, notify = true) {
424
- for (const [rpc, id] of this.humanPromptByRpc)
425
- if (id === clientUserMessageId) {
426
- this.humanPromptByRpc.delete(rpc);
427
- this.humanStartRpcs.delete(rpc);
428
- }
429
- if (this.releasedHuman.has(clientUserMessageId))
430
- return;
431
- this.releasedHuman.add(clientUserMessageId);
432
- this.humanPromptsPending = Math.max(0, this.humanPromptsPending - 1);
433
- if (notify)
434
- this.notifyHumanInputDrained();
435
- }
436
- /** Drop bookkeeping once this id is no longer waiting for an echo or a restart. */
437
- finishHumanSteer(clientUserMessageId) {
438
- if (this.unreadHumanSteers.has(clientUserMessageId))
439
- return;
440
- this.humanSteerIds.delete(clientUserMessageId);
441
- this.releaseHumanPrompt(clientUserMessageId);
442
- this.releasedHuman.delete(clientUserMessageId);
443
- this.echoedHuman.delete(clientUserMessageId);
444
- }
445
- /** turn/steer admitted this id into a live turn; keep holding until echo or turn end. */
446
- holdUnreadHumanSteer(clientUserMessageId, text) {
447
- this.unreadHumanSteers.set(clientUserMessageId, text);
448
- }
449
- /** Read-in-turn: the userMessage echo is the read. Do not restart this id. */
450
- noteHumanEcho(clientId) {
451
- if (!this.humanSteerIds.has(clientId))
452
- return;
453
- this.echoedHuman.add(clientId);
454
- const heldUnread = this.unreadHumanSteers.delete(clientId);
455
- this.releaseHumanPrompt(clientId);
456
- if (heldUnread)
457
- this.finishHumanSteer(clientId);
458
- }
459
- /** Admitted but never echoed: start a turn under the same clientUserMessageId. */
460
- restartUnreadHumanSteers() {
461
- if (this.unreadHumanSteers.size === 0)
462
- return;
463
- const pending = [...this.unreadHumanSteers];
464
- this.unreadHumanSteers.clear();
465
- if (this.autoEndTimer) {
466
- clearTimeout(this.autoEndTimer);
467
- this.autoEndTimer = undefined;
468
- }
469
- for (const [id, text] of pending) {
470
- if (!this.open || this.echoedHuman.has(id)) {
471
- this.finishHumanSteer(id);
472
- continue;
473
- }
474
- void this.startOrSteerTurn(text, id)
475
- .catch((err) => {
476
- if (this.stdinOpen) {
477
- const message = err instanceof Error ? err.message : String(err);
478
- this.emit({ type: 'note', message: `codex: turn failed: ${message}` });
479
- }
480
- })
481
- .finally(() => this.finishHumanSteer(id));
482
- }
483
- }
484
- notifyHumanInputDrained() {
485
- // A just-accepted turn/start may not have `activeTurnId` yet; run.ts ignores
486
- // settle once turn.started clears atTurnBoundary. Do not block on activeTurnId.
487
- if (this.humanPromptsPending > 0 || this.humanReadyOnTurnStart || !this.open || this.pendingUserInput || this.pendingApprovals.size || this.agentSubmissionPending)
488
- return;
489
- if (this.refusedForHuman)
490
- this.refusedForHuman = false;
491
- this.opts.onAgentInputReady?.();
492
- }
493
- discardQueuedMessages() { }
494
- holdsHumanInput() { return this.humanPromptsPending > 0 || this.humanReadyOnTurnStart; }
495
- heldHumanInputCount() { return this.humanPromptsPending + (this.humanReadyOnTurnStart ? 1 : 0); }
496
- end(explicit = true) {
497
- if (explicit && !this.hasExited()) {
498
- this.explicitEnd = true;
499
- this.terminatedByCezar ||= this.automaticCleanupStarted;
500
- }
501
- if (!this.stdinOpen)
502
- return;
503
- this.closeInput('session ended');
504
- try {
505
- endCodexAppServer(this.child, (term, kill) => {
506
- this.eofTermTimer = term;
507
- this.eofKillTimer = kill;
508
- }, (state) => {
509
- this.automaticCleanupStarted = true;
510
- this.terminatedByCezar ||= this.explicitEnd || state === 'live';
511
- });
512
- }
513
- catch { /* already gone */ }
514
- }
515
- interrupt() {
516
- if (this.hardStopStarted || this.hasExited())
517
- return;
518
- this.hardStopStarted = true;
519
- if (!this.automaticCleanupStarted) {
520
- if (this.eofTermTimer)
521
- clearTimeout(this.eofTermTimer);
522
- if (this.eofKillTimer)
523
- clearTimeout(this.eofKillTimer);
524
- }
525
- if (this.stdinOpen && this.threadId && this.activeTurnId) {
526
- void this.rpc.request('turn/interrupt', { threadId: this.threadId, turnId: this.activeTurnId }).catch(() => undefined);
527
- }
528
- this.closeInput('codex session stopped');
529
- this.terminatedByCezar = true;
530
- signalSession(this.child, 'SIGTERM');
531
- this.stopKillTimer = setTimeout(() => {
532
- if (!this.hasExited())
533
- signalSession(this.child, 'SIGKILL');
534
- }, KILL_GRACE_MS);
535
- this.stopKillTimer.unref?.();
536
- }
537
- closeInput(reason) {
538
- this.clearStreamRetry();
539
- this.stdinOpen = false;
540
- // Respond while stdin is still writable, before rpc.close or EOF/TERM.
541
- this.expireApprovals(reason);
542
- this.humanReadyOnTurnStart = false;
543
- for (const id of [...this.unreadHumanSteers.keys()]) {
544
- this.unreadHumanSteers.delete(id);
545
- this.finishHumanSteer(id);
546
- }
547
- this.rejectPendingUserInput(reason);
548
- this.agentInputReady = false;
549
- if (this.startupTimer)
550
- clearTimeout(this.startupTimer);
551
- if (this.autoEndTimer)
552
- clearTimeout(this.autoEndTimer);
553
- this.rpc.close(reason);
554
- }
555
- fail(error, diagnostic = 'failed') {
556
- if (!this.stdinOpen)
557
- return;
558
- this.failure ??= error;
559
- // Stage-only diagnostics never include prompt/config/env or raw stderr.
560
- const message = this.startupComplete ? 'Codex app-server failed; closing app-server'
561
- : `Codex startup ${diagnostic} while waiting for ${this.startupPhase}; closing app-server`;
562
- try {
563
- this.emit({ type: 'note', message });
564
- }
565
- catch { /* A failing diagnostic sink cannot release a still-live process. */ }
566
- this.interrupt();
567
- }
568
- assertOpen() {
569
- if (!this.open)
570
- throw new Error('codex session closed');
571
- }
572
- startupWaitingFor(phase) {
573
- this.assertOpen();
574
- this.startupPhase = phase;
575
- this.emit({ type: 'note', message: `Codex startup: waiting for ${phase}` });
576
- }
577
- checkStartupComplete() {
578
- if (!this.openingAcknowledged || !this.firstTurnStarted || !this.stdinOpen)
579
- return;
580
- if (this.startupComplete)
581
- return;
582
- this.startupComplete = true;
583
- if (this.startupTimer)
584
- clearTimeout(this.startupTimer);
585
- // Input refused during startup can now steer the opening turn (#505).
586
- if (this.refusedBeforeStartup)
587
- queueMicrotask(() => {
588
- this.refusedBeforeStartup = false;
589
- if (this.open && !this.pendingUserInput && !this.pendingApprovals.size && !this.agentSubmissionPending)
590
- this.opts.onAgentInputReady?.();
591
- });
592
- }
593
- // ---- protocol -----------------------------------------------------------
594
- async bootstrap() {
595
- this.startupWaitingFor('initialize');
596
- await this.rpc.initialize();
597
- this.assertOpen();
598
- this.startupWaitingFor('configRequirements/read');
599
- // Read through the same authenticated app-server as the thread. Do not
600
- // guess policy from a local config file: enterprise requirements may be remote.
601
- let requirements;
602
- try {
603
- requirements = await this.rpc.request('configRequirements/read', {});
604
- }
605
- catch (error) {
606
- if (!(error instanceof CodexRpcResponseError))
607
- throw error;
608
- this.emit({ type: 'note', message: 'Codex requirements unavailable; using Codex permission defaults' });
609
- }
610
- this.assertOpen();
611
- const restrictNetwork = process.env.CEZ_CODEX_NETWORK === '0';
612
- const overrides = {
613
- model: this.spec.model,
614
- cwd: this.spec.cwd,
615
- ...codexToolGrantFields(this.spec.toolGrant),
616
- ...codexPermissionOverrides(requirements, restrictNetwork),
617
- // ThreadStartParams AND ThreadResumeParams accept dotted config overrides.
618
- // Both feature generations exist in Codex 0.153.4; no global config write.
619
- ...((restrictNetwork || this.spec.restrictNativeDelegation || this.spec.cezarTools) ? { config: {
620
- ...(restrictNetwork ? { 'sandbox_workspace_write.network_access': false } : {}),
621
- ...(this.spec.restrictNativeDelegation ? { 'features.multi_agent': false, 'features.multi_agent_v2': false } : {}),
622
- // hearsay-tools/cezarion#1294: Codex asks before every MCP tool call unless the
623
- // server's mode is `approve`, and cezar's own tools must never wait on that.
624
- // approval_policy stays the user's (#381); older Codex ignores the unknown key.
625
- ...(this.spec.cezarTools ? { [`mcp_servers.${this.spec.cezarTools.name}`]: { command: this.spec.cezarTools.command, args: this.spec.cezarTools.args, env_vars: cezarToolEnvNames(this.spec.env ?? {}), default_tools_approval_mode: 'approve' } } : {}),
626
- } } : {}),
627
- };
628
- let threadResponse;
629
- if (this.spec.resume && this.spec.sessionId) {
630
- this.startupWaitingFor('thread/resume');
631
- threadResponse = await this.rpc.request('thread/resume', { threadId: this.spec.sessionId, ...clean(overrides) });
632
- this.assertOpen();
633
- this.threadId = this.spec.sessionId;
634
- }
635
- else {
636
- this.startupWaitingFor('thread/start');
637
- threadResponse = await this.rpc.request('thread/start', clean(overrides));
638
- this.assertOpen();
639
- this.threadId = threadIdOf(threadResponse) ?? this.spec.sessionId;
640
- }
641
- // Named managed profiles may ignore legacy sandbox settings. Do not silently
642
- // run with network enabled, or replace their filesystem rules to disable it.
643
- if (restrictNetwork && !codexNetworkIsRestricted(threadResponse)) {
644
- throw new Error('CEZ_CODEX_NETWORK=0 requires a network-restricted Codex permission policy; the thread did not confirm one');
645
- }
646
- if (this.threadId) {
647
- this.emit({ type: 'session', sessionId: this.threadId });
648
- // The result path (thread/start response, or thread/resume which sends
649
- // no thread/started notification) — deduplicated inside the mapper.
650
- const threadId = this.threadId;
651
- this.emitUi((state) => codexSessionStarted(threadId, state));
652
- }
653
- // Seed the first turn. The system prompt (skill body + handoff contract)
654
- // has no dedicated app-server field, so it rides along as a leading block
655
- // of the opening message.
656
- const first = prependSystemPrompt(this.spec.systemPrompt, this.spec.userPrompt);
657
- this.startupWaitingFor('turn/start');
658
- await this.startOrSteerTurn(first);
659
- this.assertOpen();
660
- this.openingAcknowledged = true;
661
- this.checkStartupComplete();
662
- if (!this.startupComplete)
663
- this.startupWaitingFor('first main-thread turn');
664
- }
665
- async startOrSteerTurn(text, clientUserMessageId) {
666
- this.assertOpen();
667
- if (!this.threadId)
668
- throw new Error('codex app-server did not return a thread id');
669
- this.agentInputReady = false;
670
- const input = [{ type: 'text', text, text_elements: [] }];
671
- // Echoed as the consumed userMessage item's `clientId` (#505).
672
- const ids = clientUserMessageId ? { clientUserMessageId } : {};
673
- const humanId = clientUserMessageId && this.humanSteerIds.has(clientUserMessageId) ? clientUserMessageId : undefined;
674
- const onSteerId = humanId ? (id) => this.trackHumanRpc(id, humanId, 'steer') : undefined;
675
- const onStartId = humanId ? (id) => this.trackHumanRpc(id, humanId, 'start') : undefined;
676
- if (this.activeTurnId) {
677
- const boundary = this.turnBoundaryVersion;
678
- try {
679
- await this.rpc.request('turn/steer', {
680
- threadId: this.threadId,
681
- input,
682
- expectedTurnId: this.activeTurnId,
683
- ...ids,
684
- }, onSteerId);
685
- // Accepted, but the turn completed before the model read it: nothing will read
686
- // it now, so start a turn with it under the same client id (#505). Human steers
687
- // get the same restart so a coalesced steer+completed chunk cannot drop them (#486).
688
- // Skip when the turn already echoed this client id — it was read in-turn.
689
- const echoed = clientUserMessageId !== undefined && this.echoedHuman.has(clientUserMessageId);
690
- const stranded = clientUserMessageId !== undefined && this.turnBoundaryVersion !== boundary &&
691
- !this.activeTurnId && !echoed &&
692
- (this.submissions.has(clientUserMessageId) || this.humanSteerIds.has(clientUserMessageId));
693
- if (!stranded) {
694
- // Admission is not a read: keep a human steer held until echo or turn end.
695
- if (humanId && this.activeTurnId && !echoed) {
696
- this.holdUnreadHumanSteer(humanId, text);
697
- return;
698
- }
699
- if (humanId)
700
- this.releaseHumanPrompt(humanId);
701
- return;
702
- }
703
- }
704
- catch (err) {
705
- // Only a definitive refusal falls back: the server answered with an error AND
706
- // the turn ended meanwhile. A timeout or closed transport is ambiguous — the
707
- // steer may have landed — so it rejects without a retry (#505).
708
- if (!(err instanceof CodexRpcResponseError) || this.turnBoundaryVersion === boundary || this.activeTurnId)
709
- throw err;
710
- if (clientUserMessageId && this.echoedHuman.has(clientUserMessageId)) {
711
- if (humanId)
712
- this.releaseHumanPrompt(humanId);
713
- return;
714
- }
715
- }
716
- }
717
- // Ask the app-server for reasoning summaries; without this the model runs
718
- // with its default (no summary), so the reasoning thread stays empty even
719
- // though the mapper and UI can render it. The override persists for this
720
- // turn and every subsequent turn, so seeding it on turn/start is enough.
721
- const boundaryVersion = this.turnBoundaryVersion;
722
- const completionsBefore = this.turnCompletions;
723
- const res = await this.rpc.request('turn/start', {
724
- threadId: this.threadId,
725
- input,
726
- ...ids,
727
- ...codexTurnStartExtras(this.spec),
728
- }, humanId && !this.activeTurnId ? onStartId : undefined);
729
- if (clientUserMessageId) {
730
- // This turn's own input: its completion proves the model processed it (#505). A response
731
- // can arrive after that turn already completed; settle it from the recorded outcome.
732
- const startedTurn = turnIdOf(res);
733
- const outcome = startedTurn && this.turnCompletions > completionsBefore ? this.completedTurns.get(startedTurn) : undefined;
734
- if (outcome === undefined)
735
- this.turnStartSubmissions.add(clientUserMessageId);
736
- else {
737
- const settled = this.submissions.consume(clientUserMessageId);
738
- if (settled.length && outcome)
739
- this.opts.onAgentInputConsumed?.(settled);
740
- else if (settled.length)
741
- this.emit({ type: 'input-unconsumed', inputIds: settled });
742
- }
743
- }
744
- if (this.turnBoundaryVersion === boundaryVersion)
745
- this.activeTurnId = turnIdOf(res) ?? this.activeTurnId;
746
- }
747
- /** Native stdout reader. Every stage runs inside this one try, so a stage
748
- * throw ends the read the same way a transport failure does. */
749
- async readNativeOutput() {
750
- try {
751
- for await (const line of readNdjson(this.child.stdout))
752
- this.routeNativeLine(line);
753
- this.settleNativeEof();
754
- }
755
- catch {
756
- if (this.stdinOpen && !this.hasExited()) {
757
- this.fail(new Error(`codex app-server output failed while waiting for ${this.startupPhase}`));
758
- }
759
- }
760
- }
761
- routeNativeLine(line) {
762
- const msg = parseNativeLine(line);
763
- if (msg === undefined)
764
- return;
765
- // A method+id is a server REQUEST, even if its method happens to name
766
- // a lifecycle notification. It must never reach the notification mapper.
767
- if (isServerRequest(msg)) {
768
- if (this.open)
769
- this.dispatch(msg);
770
- return;
771
- }
772
- if (!this.admitsNotification(msg))
773
- return;
774
- this.opts.onActivity?.();
775
- this.emitUi((state) => mapCodexNotification(msg, state));
776
- this.dispatch(msg);
777
- }
778
- /** Lifecycle eligibility, then the current-turn filters, in that order. */
779
- admitsNotification(msg) {
780
- if (!this.open && !drainsAfterClose(msg, () => this.stdinOpen && this.hasExited()))
781
- return false;
782
- // Child turns do not reach either channel.
783
- if (this.isForeignTurnLifecycle(msg))
784
- return false;
785
- // The UI mapper must not retire a live approval on an older turn's tail.
786
- if (isStaleTurnOutcome(msg, this.activeTurnId))
787
- return false;
788
- // Stale/child retry errors must neither fail nor warn on this turn.
789
- return msg.method !== 'error' || this.isCurrentTurn((msg.params ?? {}));
790
- }
791
- /** Clean EOF while the process lives: a startup failure, or automatic cleanup. */
792
- settleNativeEof() {
793
- if (!this.stdinOpen || this.hasExited())
794
- return;
795
- if (!this.startupComplete)
796
- this.fail(new Error(`Codex startup stdout closed while waiting for ${this.startupPhase}`));
797
- else
798
- this.end(false);
799
- }
800
- dispatch(msg) {
801
- if (typeof msg.method === 'string' && (typeof msg.id === 'number' || typeof msg.id === 'string')) {
802
- if (msg.method === 'item/tool/requestUserInput')
803
- this.handleUserInputRequest(msg.id, msg.params ?? {});
804
- else if (isCodexApprovalRequest(msg.method, msg.params))
805
- this.handleApprovalRequest(msg.method, msg.id, msg.params);
806
- else
807
- this.rpc.respond({ id: msg.id, error: { code: -32601, message: `unsupported server request: ${msg.method}` } });
808
- return;
809
- }
810
- const humanClient = typeof msg.id === 'number' ? this.humanPromptByRpc.get(msg.id) : undefined;
811
- if (this.rpc.dispatchResponse(msg)) {
812
- // #486: settle human-prompt bookkeeping in RPC dispatch order, before the next line.
813
- // Do not release a human steer whose turn already ended with no successor — the
814
- // await continuation may still restart it, or release once it decides not to.
815
- if (humanClient) {
816
- const startRpc = typeof msg.id === 'number' && this.humanStartRpcs.has(msg.id);
817
- if (typeof msg.id === 'number') {
818
- this.humanPromptByRpc.delete(msg.id);
819
- this.humanStartRpcs.delete(msg.id);
820
- }
821
- // A turn/steer result is admission, not a read (#486 review). Keep holding
822
- // until the userMessage echo or the turn ends. turn/start still releases:
823
- // the follow-up/idle prompt was accepted (or failed). Defer the ready hint
824
- // until turn/started so run.ts does not settle the previous DONE/idle
825
- // boundary before the follow-up turn exists.
826
- if (startRpc) {
827
- const startError = msg.error !== undefined;
828
- const deferHint = !this.activeTurnId && !startError;
829
- if (deferHint)
830
- this.humanReadyOnTurnStart = true;
831
- else if (startError)
832
- this.humanReadyOnTurnStart = false;
833
- this.releaseHumanPrompt(humanClient, !deferHint);
834
- }
835
- }
836
- return;
837
- }
838
- if (typeof msg.method === 'string')
839
- this.handleNotification(msg.method, msg.params ?? {});
840
- }
841
- handleApprovalRequest(method, rpcId, params) {
842
- const duplicate = [...this.pendingApprovals.entries()].find(([, pending]) => pending.rpcId === rpcId);
843
- const approval = codexApproval(method, rpcId, params, this.spec.cezarTools?.name);
844
- const routing = params;
845
- if (!approval || !this.activeTurnId || routing?.threadId !== this.threadId || approval.turnId !== this.activeTurnId ||
846
- duplicate) {
847
- this.rpc.respond({ id: rpcId, error: { code: -32602, message: 'malformed, stale or unsupported approval routing' } });
848
- // One native id cannot identify two requests. Its error settles the wire;
849
- // revoke the old UI capability so it cannot produce a second response.
850
- if (duplicate)
851
- this.expireApproval(duplicate[0], 'duplicate native request id', false);
852
- return;
853
- }
854
- this.clearStreamRetry();
855
- this.agentInputReady = false;
856
- if (this.autoEndTimer)
857
- clearTimeout(this.autoEndTimer);
858
- this.autoEndTimer = undefined;
859
- this.pendingApprovals.set(approval.event.requestId, approval);
860
- try {
861
- if (!this.opts.onUiEvent)
862
- throw new Error('approval UI unavailable');
863
- this.opts.onUiEvent(approval.event);
864
- }
865
- catch {
866
- // A missing/throwing consumer cannot leave a native RPC waiting forever.
867
- this.expireApproval(approval.event.requestId, 'approval UI unavailable');
868
- }
869
- }
870
- respondPermission(requestId, optionId) {
871
- const approval = this.pendingApprovals.get(requestId);
872
- const response = approval?.responses.get(optionId);
873
- if (!this.open || !approval || !response || approval.turnId !== this.activeTurnId)
874
- return false;
875
- this.pendingApprovals.delete(requestId);
876
- this.rpc.respond({ id: approval.rpcId, result: response });
877
- this.emitPermissionResolved(requestId, this.open ? { optionId } : { reason: 'approval response transport failed' });
878
- return this.open;
879
- }
880
- emitPermissionResolved(requestId, resolution) {
881
- try {
882
- this.opts.onUiEvent?.({ type: 'permission.resolved', requestId, ...resolution });
883
- }
884
- catch { /* A failed consumer must not strand other pending RPCs. */ }
885
- }
886
- expireApproval(requestId, reason, respond = true) {
887
- const approval = this.pendingApprovals.get(requestId);
888
- if (!approval)
889
- return;
890
- this.pendingApprovals.delete(requestId);
891
- if (respond)
892
- this.rpc.respond({ id: approval.rpcId, error: { code: -32000, message: reason } });
893
- this.emitPermissionResolved(requestId, { reason });
894
- }
895
- expireApprovals(reason, respond = true) {
896
- for (const requestId of this.pendingApprovals.keys())
897
- this.expireApproval(requestId, reason, respond);
898
- }
899
- handleUserInputRequest(rpcId, params) {
900
- const questions = codexAskQuestions(params.questions);
901
- if (!questions) {
902
- this.rpc.respond({ id: rpcId, error: { code: -32602, message: 'unsupported or malformed requestUserInput payload' } });
903
- return;
904
- }
905
- if (this.isCurrentTurn(params))
906
- this.clearStreamRetry();
907
- if (this.pendingUserInput)
908
- this.rejectPendingUserInput('superseded by a newer requestUserInput');
909
- this.pendingUserInput = { rpcId, questions };
910
- this.opts.onUiEvent?.({ type: 'ask.requested', requestId: `codex-${String(rpcId)}`, questions: uiAskQuestions(questions) });
911
- }
912
- rejectPendingUserInput(message) {
913
- const pending = this.pendingUserInput;
914
- if (!pending)
915
- return;
916
- this.pendingUserInput = undefined;
917
- this.rpc.respond({ id: pending.rpcId, error: { code: -32000, message } });
918
- }
919
- /** True when a turn notification belongs to a sub-agent CHILD thread rather than this run's
920
- * own main thread — its lifecycle must not start or end the parent turn (#600). The app-server
921
- * multiplexes every thread over one connection, so a spawned skill's child `turn/completed`
922
- * would otherwise emit a `turn-end` and park the actively-working run under "Needs you".
923
- * Fail-open: an absent `threadId` (the single-thread wire shape) or our own id counts as ours. */
924
- isForeignThreadTurn(params) {
925
- const eventThreadId = stringField(params, 'threadId');
926
- return !!eventThreadId && !!this.threadId && eventThreadId !== this.threadId;
927
- }
928
- /** A `turn/started|completed|failed` notification for a sub-agent child thread — dropped
929
- * before either channel processes it (#600). Only turn lifecycle is filtered; child item
930
- * events still map, so nested sub-agent activity keeps rendering. */
931
- isForeignTurnLifecycle(msg) {
932
- const method = typeof msg.method === 'string' ? msg.method : undefined;
933
- if (!method || !TURN_LIFECYCLE_METHODS.has(method))
934
- return false;
935
- return this.isForeignThreadTurn((msg.params ?? {}));
936
- }
937
- isCurrentTurn(params) {
938
- const turnId = turnIdOf(params);
939
- return !!this.activeTurnId && !this.isForeignThreadTurn(params)
940
- && (!turnId || turnId === this.activeTurnId);
941
- }
942
- clearStreamRetry() {
943
- if (this.streamRetryTimer)
944
- clearTimeout(this.streamRetryTimer);
945
- this.streamRetryTimer = undefined;
946
- this.streamRetryError = undefined;
947
- }
948
- handleStreamError(params) {
949
- const message = codexStreamError(params);
950
- if (!message || !this.isCurrentTurn(params))
951
- return;
952
- if (params.willRetry === false) {
953
- this.fail(new Error(message));
954
- return;
955
- }
956
- this.emit({ type: 'note', message });
957
- if (params.willRetry !== true)
958
- return;
959
- this.streamRetryError = message;
960
- if (this.streamRetryTimer)
961
- return;
962
- this.streamRetryTimer = setTimeout(() => {
963
- const lastError = this.streamRetryError;
964
- if (!this.open || !lastError)
965
- return;
966
- this.emitUi(state => mapCodexNotification({ method: 'turn/completed', params: {
967
- turn: { id: this.activeTurnId, status: 'failed', error: { message: lastError } },
968
- } }, state));
969
- this.fail(new Error(`Codex stream made no progress for 60s: ${lastError}`));
970
- }, STREAM_RETRY_TIMEOUT_MS);
971
- this.streamRetryTimer.unref?.();
972
- }
973
- handleNotification(method, params) {
974
- if (this.streamRetryTimer && this.isCurrentTurn(params) && isStreamProgress(method, params)) {
975
- this.clearStreamRetry();
976
- }
977
- switch (method) {
978
- case 'serverRequest/resolved': {
979
- if (params.threadId !== this.threadId)
980
- break;
981
- for (const [requestId, approval] of this.pendingApprovals) {
982
- if (approval.rpcId === params.requestId)
983
- this.expireApproval(requestId, 'resolved by Codex', false);
984
- }
985
- break;
986
- }
987
- case 'error':
988
- this.handleStreamError(params);
989
- break;
990
- case 'warning':
991
- if (typeof params.message === 'string' && params.message.trim())
992
- this.emit({ type: 'note', message: params.message.trim() });
993
- break;
994
- case 'turn/started': {
995
- if (!this.isForeignThreadTurn(params))
996
- this.turnBoundaryVersion += 1;
997
- if (this.isForeignThreadTurn(params))
998
- break; // sub-agent child thread — not our turn (#600)
999
- if (this.threadId && turnIdOf(params)) {
1000
- this.firstTurnStarted = true;
1001
- this.checkStartupComplete();
1002
- }
1003
- if (turnIdOf(params) !== this.activeTurnId) {
1004
- this.clearStreamRetry();
1005
- this.expireApprovals('a new turn started');
1006
- }
1007
- this.activeTurnId = turnIdOf(params) ?? this.activeTurnId;
1008
- if (this.humanReadyOnTurnStart) {
1009
- this.humanReadyOnTurnStart = false;
1010
- // emitUi already ran (clears atTurnBoundary); hint now that the hold dropped.
1011
- this.notifyHumanInputDrained();
1012
- }
1013
- break;
1014
- }
1015
- case 'item/agentMessage/delta': {
1016
- // Child text belongs only to v2; buffering it here would pollute the
1017
- // parent's marker parse when the coalescer flushes at turn-end (#149).
1018
- if (this.isForeignThreadTurn(params))
1019
- break;
1020
- const delta = typeof params.delta === 'string' ? params.delta : '';
1021
- if (delta)
1022
- this.textCoalescer.append(stringField(params, 'itemId'), delta);
1023
- break;
1024
- }
1025
- case 'item/started': {
1026
- const item = params.item ?? {};
1027
- const type = stringField(item, 'type');
1028
- if (type === 'userMessage' && !this.isForeignThreadTurn(params)) {
1029
- // The model received this input now; `clientId` names our submission (#505).
1030
- const clientId = stringField(item, 'clientId');
1031
- if (clientId)
1032
- this.noteHumanEcho(clientId);
1033
- const ids = clientId ? this.submissions.consume(clientId) : [];
1034
- if (ids.length)
1035
- this.opts.onAgentInputConsumed?.(ids);
1036
- }
1037
- // Only tool-like items become tool events; message/reasoning stream as text.
1038
- if (type && !NON_TOOL_ITEMS.has(type)) {
1039
- const id = stringField(item, 'id') ?? `item-${this.rpc.allocateId()}`;
1040
- this.toolCalls.push({ id, name: type, input: item });
1041
- this.emit({ type: 'tool-call', id, tool: type, input: item });
1042
- }
1043
- break;
1044
- }
1045
- case 'item/completed': {
1046
- const item = params.item ?? {};
1047
- const type = stringField(item, 'type');
1048
- const id = stringField(item, 'id') ?? '';
1049
- if (type === 'agentMessage') {
1050
- if (this.isForeignThreadTurn(params))
1051
- break;
1052
- // One v1 `text` per finished message — the snapshot's full text when
1053
- // present (also covers turns that send no deltas), else the deltas.
1054
- this.textCoalescer.complete(id || undefined, typeof item.text === 'string' ? item.text : undefined);
1055
- }
1056
- else if (type && !NON_TOOL_ITEMS.has(type) && id) {
1057
- this.emit({
1058
- type: 'tool-result',
1059
- toolCallId: id,
1060
- result: safeStringify(item),
1061
- isError: /error|failed/i.test(stringField(item, 'status') ?? ''),
1062
- });
1063
- }
1064
- break;
1065
- }
1066
- case 'thread/tokenUsage/updated': {
1067
- const total = tokenTotal(params);
1068
- if (total > 0) {
1069
- this.tokensUsed = total;
1070
- this.emit({ type: 'token-usage', tokensUsed: this.tokensUsed });
1071
- }
1072
- break;
1073
- }
1074
- case 'turn/completed':
1075
- case 'turn/failed': {
1076
- if (this.isForeignThreadTurn(params))
1077
- break; // don't end the parent turn on a child turn (#600)
1078
- if (this.activeTurnId && turnIdOf(params) && turnIdOf(params) !== this.activeTurnId)
1079
- break;
1080
- if (this.isCurrentTurn(params))
1081
- this.clearStreamRetry();
1082
- this.expireApprovals('turn ended');
1083
- this.turnBoundaryVersion += 1;
1084
- this.pendingUserInput = undefined;
1085
- this.activeTurnId = undefined;
1086
- // An interrupted/failed item never sees item/completed — surface its
1087
- // partial prose before the turn boundary (run.ts reads markers there).
1088
- this.textCoalescer.flush();
1089
- const outcome = codexTurnOutcome(method, params);
1090
- const completedId = turnIdOf(params);
1091
- if (completedId) {
1092
- this.completedTurns.set(completedId, outcome.error === undefined);
1093
- if (this.completedTurns.size > 32)
1094
- this.completedTurns.delete(this.completedTurns.keys().next().value);
1095
- }
1096
- this.turnCompletions += 1;
1097
- if (outcome.error !== undefined && !this.terminatedByCezar) {
1098
- this.emit({ type: 'error', message: outcome.error });
1099
- }
1100
- this.agentInputReady = this.open;
1101
- // A completed turn processed its own input; a failed one may never have reached the
1102
- // model, so its input stays pending and is reported unconsumed below.
1103
- const started = outcome.error === undefined ? [...this.turnStartSubmissions].flatMap(id => this.submissions.consume(id)) : [];
1104
- this.turnStartSubmissions.clear();
1105
- if (started.length)
1106
- this.opts.onAgentInputConsumed?.(started);
1107
- // An in-flight steer is owned by its RPC outcome, not by this boundary.
1108
- const inFlight = this.inFlightSubmissionId ? this.submissions.consume(this.inFlightSubmissionId) : [];
1109
- const unconsumedInputIds = this.submissions.takeUnconsumed();
1110
- if (this.inFlightSubmissionId && inFlight.length)
1111
- this.submissions.accept(this.inFlightSubmissionId, inFlight, '');
1112
- this.emit(unconsumedInputIds.length ? { type: 'turn-end', unconsumedInputIds } : { type: 'turn-end' });
1113
- if (this.unreadHumanSteers.size)
1114
- this.restartUnreadHumanSteers();
1115
- else
1116
- this.scheduleAutoEnd();
1117
- break;
1118
- }
1119
- default:
1120
- break;
1121
- }
1122
- }
1123
- emit(event) {
1124
- this.onEvent?.(event);
1125
- }
1126
- /** The mapper never throws, but a defect in it must still never disturb
1127
- * the v1 stream — hence the belt-and-braces try. */
1128
- emitUi(map) {
1129
- try {
1130
- const mapped = map(this.uiState);
1131
- this.uiState = mapped.state;
1132
- if (this.opts.onUiEvent) {
1133
- for (const event of mapped.events)
1134
- this.opts.onUiEvent(event);
1135
- }
1136
- }
1137
- catch {
1138
- // v2 mapping is best-effort; v1 consumers stay unaffected.
1139
- }
1140
- }
1141
- }
1142
- // ---- helpers --------------------------------------------------------------
1143
- /** Only model/tool output proves recovery; bookkeeping, user input and retry
1144
- * chatter do not. Unknown notifications are deliberately not heartbeats. */
1145
- function isStreamProgress(method, params) {
1146
- if (STREAM_PROGRESS_DELTAS.has(method)) {
1147
- return typeof params.delta === 'string' && params.delta.length > 0;
1148
- }
1149
- if (method !== 'item/started' && method !== 'item/completed')
1150
- return false;
1151
- const item = params.item;
1152
- if (!item || typeof item !== 'object' || Array.isArray(item))
1153
- return false;
1154
- const record = item;
1155
- return !!stringField(record, 'id') && !!stringField(record, 'type') && record.type !== 'userMessage';
1156
- }
1157
- const STREAM_PROGRESS_DELTAS = new Set([
1158
- 'item/agentMessage/delta', 'item/reasoning/textDelta', 'item/reasoning/summaryDelta',
1159
- 'item/reasoning/summaryTextDelta', 'item/commandExecution/outputDelta',
1160
- ]);
1161
- function codexAskQuestions(value) {
1162
- if (!Array.isArray(value) || value.length < 1 || value.length > 4)
1163
- return null;
1164
- const questions = [];
1165
- for (const raw of value) {
1166
- if (!raw || typeof raw !== 'object' || Array.isArray(raw))
1167
- return null;
1168
- const question = raw;
1169
- if (question.isSecret === true)
1170
- return null;
1171
- const id = stringField(question, 'id');
1172
- const header = stringField(question, 'header');
1173
- const prompt = stringField(question, 'question');
1174
- if (!id || !header || !prompt || !Array.isArray(question.options))
1175
- return null;
1176
- const options = question.options.map((option) => {
1177
- if (!option || typeof option !== 'object' || Array.isArray(option))
1178
- return null;
1179
- const record = option;
1180
- const label = stringField(record, 'label');
1181
- const description = stringField(record, 'description');
1182
- return label ? { label, ...(description ? { description } : {}) } : null;
1183
- }).filter((option) => option !== null);
1184
- questions.push({ id, header, question: prompt, options, multiSelect: false });
1185
- }
1186
- return parseAskRequest({ questions })?.questions ?? null;
1187
- }
1188
- function userInputAnswers(questions, text) {
1189
- const lines = text.split(/\r?\n/);
1190
- const hasStructuredAnswer = questions.some((question) => lines.some((line) => line.startsWith(`${question.header}:`)));
1191
- const answers = {};
1192
- for (const [index, question] of questions.entries()) {
1193
- const prefix = `${question.header}:`;
1194
- const matching = lines.find((line) => line.startsWith(prefix));
1195
- const raw = matching?.slice(prefix.length).trim() ?? (!hasStructuredAnswer && index === 0 ? text.trim() : '');
1196
- answers[question.id ?? String(index)] = {
1197
- answers: raw === '' ? [] : raw.split(',').map((answer) => answer.trim()).filter(Boolean),
1198
- };
1199
- }
1200
- return answers;
1201
- }
1202
- /** ThreadItem `type`s that are conversation text, not tool activity. */
1203
- const NON_TOOL_ITEMS = new Set(['agentMessage', 'userMessage', 'reasoning', 'plan']);
1204
- /** Turn-lifecycle notification methods — the only frames whose child-thread copies must be
1205
- * dropped so a sub-agent turn can't be mistaken for the parent's (#600). */
1206
- const TURN_LIFECYCLE_METHODS = new Set(['turn/started', 'turn/completed', 'turn/failed']);
1207
- const REASONING_SUMMARIES = new Set(['auto', 'concise', 'detailed', 'none']);
1208
- /**
1209
- * The reasoning-summary override sent on `turn/start` (TurnStartParams.summary).
1210
- * Defaults to `auto` so reasoning is visible out of the box — without it the
1211
- * app-server runs with its own default (no summary) and the reasoning thread
1212
- * stays empty even when the model reasons. `CEZ_CODEX_REASONING` overrides the
1213
- * default (`auto`/`concise`/`detailed`, or `none` to opt out); an unrecognized
1214
- * value falls back to `auto`.
1215
- */
1216
- export function reasoningSummary(env = process.env) {
1217
- const raw = env.CEZ_CODEX_REASONING?.trim().toLowerCase();
1218
- if (!raw)
1219
- return 'auto';
1220
- return REASONING_SUMMARIES.has(raw) ? raw : 'auto';
1221
- }
1222
- /**
1223
- * Fields sent on `turn/start` besides thread/input. `summary` is the existing
1224
- * `CEZ_CODEX_REASONING` knob (out of scope for #45). `effort` is the per-run
1225
- * pin — omitted when unset so the app-server keeps its default.
1226
- */
1227
- export function codexTurnStartExtras(spec, env = process.env) {
1228
- const effort = parseEffort(spec.effort);
1229
- return {
1230
- summary: reasoningSummary(env),
1231
- ...(effort ? { effort } : {}),
1232
- };
1233
- }
1234
- function textOf(content) {
1235
- return content
1236
- .filter((b) => b.type === 'text')
1237
- .map((b) => b.text)
1238
- .join('\n')
1239
- .trim();
1240
- }
1241
- /** Drop undefined values so we never send `"model": null` to the server. */
1242
- function clean(obj) {
1243
- const out = {};
1244
- for (const [k, v] of Object.entries(obj)) {
1245
- if (v !== undefined && v !== null)
1246
- out[k] = v;
1247
- }
1248
- return out;
1249
- }
1250
- function threadIdOf(res) {
1251
- const thread = res.thread;
1252
- return typeof thread?.id === 'string' ? thread.id : stringField(res, 'threadId');
1253
- }
1254
- /** Cumulative tokens from a `thread/tokenUsage/updated` notification:
1255
- * `params.tokenUsage.total.totalTokens`. */
1256
- function tokenTotal(params) {
1257
- const usage = params.tokenUsage;
1258
- const total = usage?.total?.totalTokens;
1259
- return typeof total === 'number' ? total : 0;
1260
- }
1261
- function safeStringify(value) {
1262
- try {
1263
- return JSON.stringify(value);
1264
- }
1265
- catch {
1266
- return String(value);
1267
- }
1268
- }
1269
- //# sourceMappingURL=codex-app-server-runner.js.map