@overdeck/desktop 0.50.0 → 0.50.3

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 (650) hide show
  1. package/package.json +1 -1
  2. package/server/{acceptance-criteria-B_maCGZv.js → acceptance-criteria-D-OIjvuX.js} +2 -2
  3. package/server/{active-dashboard-bundle-CCqpFWiz.js → active-dashboard-bundle-C-Ars7eG.js} +2 -2
  4. package/server/{activity-logger-B0X2JJwM.js → activity-logger-BRASNITk.js} +1 -1
  5. package/server/{activity-logger-SlTXYCVf.js → activity-logger-DNYDzAOU.js} +3 -3
  6. package/server/{advancing-selfheal-BJAfiY-C.js → advancing-selfheal-Bq8V0QUa.js} +5 -5
  7. package/server/{agent-gc-bhikjoJ_.js → agent-gc-Coz8zQt_.js} +10 -10
  8. package/server/{agent-idle-D-UQ7gDv.js → agent-idle-CAwB-K6M.js} +182 -30
  9. package/server/{agent-state-BrUPf_7Z.js → agent-state-CbUEwUEQ.js} +1 -1
  10. package/server/{agent-state-FABw8neJ.js → agent-state-Ci6PhjOE.js} +1504 -245
  11. package/server/{agent-state-service-rDenYSlD.js → agent-state-service-D6IVrX3B.js} +5 -5
  12. package/server/{agent-state-service-BAQApt97.js → agent-state-service-DcN1j6eK.js} +1 -1
  13. package/server/agents-BVvL4o_4.js +3 -0
  14. package/server/{agents-DzpQidT8.js → agents-CkngXhQr.js} +4 -4
  15. package/server/archive-planning-CohTB7hg.js +2 -0
  16. package/server/{archive-planning-BL1ABtW0.js → archive-planning-CtdBSD1-.js} +5 -5
  17. package/server/{artifact-index-jobs-Cjdme0jS.js → artifact-index-jobs-9ZdXQ9zH.js} +2 -2
  18. package/server/{auto-spawn-consent-BesWchEi.js → auto-spawn-consent-CJeQM5e0.js} +281 -77
  19. package/server/{backlog-auto-trigger-COLq639j.js → backlog-auto-trigger-BuSBqG2V.js} +3 -3
  20. package/server/{behavior-DCg8CIWC.js → behavior-Bg3yC8jC.js} +93 -38
  21. package/server/{bridge-pool-patrol-BDohuMRt.js → bridge-pool-patrol-CkJ86c_r.js} +2 -2
  22. package/server/{briefing-freshness-ENa_hW_V.js → briefing-freshness-CEoe3yWS.js} +2 -2
  23. package/server/build-info-CYlxvZSQ.js +2 -0
  24. package/server/{build-info-WuZT6xyi.js → build-info-Cj3Y0K87.js} +3 -3
  25. package/server/{checkpoint-manager-CSZ7aVQF.js → checkpoint-manager-Bt4dnyyr.js} +2 -2
  26. package/server/{checkpoint-manager-DXhGRvg4.js → checkpoint-manager-C1-9CFcu.js} +1 -1
  27. package/server/checkpoint-worker.js +1 -1
  28. package/server/{checkpoints-DUkUsPVS.js → checkpoints-3pyv5ikj.js} +2 -2
  29. package/server/{checkpoints-tm_w6Y4V.js → checkpoints-Dgtp8549.js} +1 -1
  30. package/server/{claude-hooks-provision-fRofvhTN.js → claude-hooks-provision-DWrqkc3x.js} +2 -2
  31. package/server/{claude-hooks-provision-CTh9zxEi.js → claude-hooks-provision-DXac_UDF.js} +1 -1
  32. package/server/{claude-permissions-DLrb9ovz.js → claude-permissions-DX5BSnMH.js} +2 -2
  33. package/server/{claude-settings-overlay-CMS5Jab5.js → claude-settings-overlay-ALboy05V.js} +1 -1
  34. package/server/{claude-settings-overlay-BYnXaTVc.js → claude-settings-overlay-CTkJUUHw.js} +2 -2
  35. package/server/{cli-CoQou1t_.js → cli-DIhQieif.js} +11 -11
  36. package/server/cli-ZAS502uC.js +2 -0
  37. package/server/{cliproxy-DdhFpcXU.js → cliproxy-Dz_zq_4H.js} +1 -1
  38. package/server/{cliproxy-DXDQcR3I.js → cliproxy-QTm2vdgx.js} +2 -2
  39. package/server/{close-issue-CpQ0BWg-.js → close-issue-CRlmrE5g.js} +5 -5
  40. package/server/{closed-issue-reaper-TymtZM37.js → closed-issue-reaper-DWlw2EtL.js} +1 -1
  41. package/server/{closed-issue-reaper-CdcJRvUx.js → closed-issue-reaper-DrHyYgJR.js} +13 -13
  42. package/server/{codex-BValsmtK.js → codex-DzLXjzbf.js} +1 -1
  43. package/server/{codex-DYyZL8JD.js → codex-pffr8qaN.js} +25 -18
  44. package/server/{compaction-continuation-CVjbdGKt.js → compaction-continuation-DhYgsXmF.js} +3 -3
  45. package/server/{config-_qaa1UXH.js → config-B-MLcKSo.js} +2 -2
  46. package/server/{config-NxI9Yl2f.js → config-BUjU7GZQ.js} +2 -2
  47. package/server/{config-CvKH7r7W.js → config-DN8ETZvK.js} +1 -1
  48. package/server/{config-yaml-D60AnTIu.js → config-yaml-Dce9VUd6.js} +440 -71
  49. package/server/{conflict-gate-hAUCL-un.js → conflict-gate-Bt-lLgYf.js} +4 -4
  50. package/server/{conflict-gate-0dD1kxjN.js → conflict-gate-vczgdVTa.js} +1 -1
  51. package/server/{continue-CnvrUfxw.js → continue-DvNIJ-73.js} +2 -2
  52. package/server/{control-settings-Db0uXgVM.js → control-settings-BkaVFRdm.js} +5 -5
  53. package/server/{conversation-compaction-B-1KETG9.js → conversation-compaction-CsdCbcQB.js} +8 -8
  54. package/server/{conversation-compaction-DzMXGRiJ.js → conversation-compaction-D0zgWM1f.js} +1 -1
  55. package/server/{conversation-service-BxIOd5ay.js → conversation-service-6LaymUV-.js} +224 -76
  56. package/server/conversation-service-Dlks_hSS.js +3 -0
  57. package/server/conversations-BunNL58s.js +3 -0
  58. package/server/{conversations-nS6QgYpD.js → conversations-CPXMv_JQ.js} +11 -9
  59. package/server/{scanner-BFKG3Gxv.js → conversations-search-DnWUghbM.js} +407 -51
  60. package/server/{cost-3FyqKK56.js → cost-PJXEAirJ.js} +8 -8
  61. package/server/{cost-DTuIRE4y.js → cost-ShD-G0cS.js} +52 -2
  62. package/server/{cost-Cctc-Q9M.js → cost-eaAmJTX9.js} +3 -3
  63. package/server/{cost-sync-DfmvLT9L.js → cost-sync-EFEkMYWz.js} +26 -56
  64. package/server/{dag-o-dUpw1L.js → dag-Drz6Nrnf.js} +2 -2
  65. package/server/dashboard-db-worker.js +52 -10
  66. package/server/{deacon-CsisLmPt.js → deacon-CU47dU7U.js} +169 -131
  67. package/server/{deacon-e6py3jkM.js → deacon-DYsOa_ss.js} +3 -3
  68. package/server/{deacon-canonical-state-DkdkQS5p.js → deacon-canonical-state-wi63RApC.js} +3 -3
  69. package/server/{deacon-event-client-CMQswEHX.js → deacon-event-client-DY8U1EbU.js} +2 -2
  70. package/server/{deacon-event-client-BCjHiGAY.js → deacon-event-client-uaGapjPL.js} +1 -1
  71. package/server/{deacon-nudge-log-pcliw8Dr.js → deacon-nudge-log-ZirGPRn1.js} +1 -1
  72. package/server/{deacon-pending-lifecycle-BzaE76Xo.js → deacon-pending-lifecycle-ijGX8wLb.js} +2 -2
  73. package/server/deacon.js +11 -11
  74. package/server/{dead-end-trip-Bs3hxIn6.js → dead-end-trip-B-zvz8Rw.js} +3 -3
  75. package/server/dead-end-trip-Caz9bf1A.js +2 -0
  76. package/server/delivery-DMYxIE0J.js +3 -0
  77. package/server/{deploy-patrol-B8sKkA8h.js → deploy-patrol-C4eXco1S.js} +8 -8
  78. package/server/deploy-queue-C3KIJizG.js +2 -0
  79. package/server/{deploy-queue-CCGWXFkp.js → deploy-queue-TDZ2tzRF.js} +2 -2
  80. package/server/{deploy-window-YuJewzmC.js → deploy-window-CdInEAuR.js} +4 -4
  81. package/server/{deploy-window-hgsvZ3UZ.js → deploy-window-DkjV-Haz.js} +1 -1
  82. package/server/{dev-supervisor-4SBloJHV.js → dev-supervisor-CrYlJS2n.js} +2 -2
  83. package/server/{devcontainer-renderer-BiJhwFNi.js → devcontainer-renderer-DL8lfn0Y.js} +4 -4
  84. package/server/{docker-DQzyMXkd.js → docker-DLIwccCS.js} +1 -1
  85. package/server/{docker-CWO7dcIP.js → docker-fz7ELYZ8.js} +3 -3
  86. package/server/{dod-BAk5arLF.js → dod-C9m0JqhG.js} +1 -1
  87. package/server/{done-preflight-Cx9JGznT.js → done-preflight-CaILZ394.js} +5 -5
  88. package/server/{done-preflight-CGFA0M1b.js → done-preflight-DAufsWqY.js} +1 -1
  89. package/server/{durable-review-pipeline-Djx_lvFd.js → durable-review-pipeline-CIkgDTla.js} +1 -1
  90. package/server/{durable-review-pipeline-BOEZ0chh.js → durable-review-pipeline-CYcUvz1_.js} +1 -1
  91. package/server/{ensure-devcontainer-DzYBBwnM.js → ensure-devcontainer-C2rKQXgr.js} +4 -4
  92. package/server/{ensure-devcontainer-Dk6ZMOUC.js → ensure-devcontainer-IQ_dNjjV.js} +1 -1
  93. package/server/{esm-shims-deFq5Hhl.js → esm-shims-CVzRn1Sa.js} +1 -1
  94. package/server/{event-store-DTns2XZP.js → event-store-BYOh686E.js} +5 -5
  95. package/server/{event-store-C50Qt-f1.js → event-store-Bw3YDOZ5.js} +1 -1
  96. package/server/{event-store-provider-Bu1Qrg6v.js → event-store-provider-B2PMoaap.js} +1 -1
  97. package/server/{events-B6xW8Cpm.js → events-BCPdiWG9.js} +3 -3
  98. package/server/{factory-CWVKwKFE.js → factory-BC18rvHD.js} +4 -4
  99. package/server/{feature-registry-storage-vaxRN3WO.js → feature-registry-storage-CASMzD0N.js} +2 -2
  100. package/server/{features-DXWwktJB.js → features-B1O5F33h.js} +2 -2
  101. package/server/{feedback-stuck-retirement-CXAYe2rU.js → feedback-stuck-retirement-Dd5XNrMr.js} +2 -2
  102. package/server/{feedback-target-yPD_wclF.js → feedback-target-BcsA_GRV.js} +10 -10
  103. package/server/{feedback-target-DSVpi0gT.js → feedback-target-BzdJ2wIR.js} +1 -1
  104. package/server/{feedback-writer-BzN4qvaP.js → feedback-writer-DfMoEtQc.js} +1 -1
  105. package/server/{feedback-writer-Ds1Wjsz4.js → feedback-writer-lbXBFycU.js} +5 -5
  106. package/server/{flywheel-BCZS-FlW.js → flywheel-B34cdfbd.js} +1 -1
  107. package/server/{flywheel-CC4gE_rx.js → flywheel-D0guNqkh.js} +14 -14
  108. package/server/{flywheel-DWKd7bMc.js → flywheel-Is3w2lcT.js} +16 -16
  109. package/server/{flywheel-merge-order-DDT3i57u.js → flywheel-merge-order-6HiPR2WG.js} +1 -1
  110. package/server/{flywheel-merge-order-DJwH2KpL.js → flywheel-merge-order-BsNPMu0S.js} +8 -8
  111. package/server/forge-B1cpL4SY.js +2 -0
  112. package/server/{forge-CHADjOFs.js → forge-CEe3eFjh.js} +2 -2
  113. package/server/{fs-lock-DQ_gUxfq.js → fs-lock-VCGoXZI5.js} +2 -2
  114. package/server/{fts-operations-asZo2fh1.js → fts-operations-BNRxGCU_.js} +2 -2
  115. package/server/{git-info-DMOSfJ9I.js → git-info-BZYdINlU.js} +1 -1
  116. package/server/{git-utils-BdHk8y7g.js → git-utils-D96xW28f.js} +4 -4
  117. package/server/{git-utils-BAMwn9Nf.js → git-utils-DvcWLgGS.js} +1 -1
  118. package/server/{github-app-BlMSzSTw.js → github-app-BINlfWAA.js} +3 -2
  119. package/server/{github-app-BWziYCf3.js → github-app-BxM1U38q.js} +1 -1
  120. package/server/{github-client-w6j5nVlz.js → github-client-DJVl4iDm.js} +3 -3
  121. package/server/{github-client-OK24qpol.js → github-client-oJHo9dyA.js} +1 -1
  122. package/server/{github-pr-lookup-bGcsEvLE.js → github-pr-lookup-DQEtdiyR.js} +2 -2
  123. package/server/{harness-binary-DChiynaB.js → harness-binary-DnRGvN6T.js} +6 -3
  124. package/server/{harness-resolve-BplBEbwn.js → harness-resolve-CzTFVZ5l.js} +4 -4
  125. package/server/{health-events-Bk3LjaJ9.js → health-events-CF2WMNkI.js} +2 -2
  126. package/server/{health-events-BTqsmunw.js → health-events-Dv7rzyit.js} +1 -1
  127. package/server/{hooks-EndRNrx9.js → hooks-DKzqJ4HF.js} +1 -1
  128. package/server/{hooks-DJR1yR9w.js → hooks-lPAsUc20.js} +2 -2
  129. package/server/hume-51rYfjzX.js +3 -0
  130. package/server/{hume-1FJmNDTq.js → hume-CxfI2cg-.js} +2 -2
  131. package/server/{identity-C3s8lyp0.js → identity-Dc7rQLln.js} +3 -3
  132. package/server/{idle-stack-reaper-DtoI4al6.js → idle-stack-reaper-C0NYGCVq.js} +4 -4
  133. package/server/{idle-stack-reaper-CBelVOE3.js → idle-stack-reaper-CNLvCrg9.js} +1 -1
  134. package/server/{in-flight-guard-B7khcBdQ.js → in-flight-guard-HoToxzGt.js} +1 -1
  135. package/server/{infra-CJRi_5Wu.js → infra-B05o-e2g.js} +4 -4
  136. package/server/{injection-BWsgHvrL.js → injection-Bk_pw2Ei.js} +1 -1
  137. package/server/{injection-ADWQ3D0s.js → injection-DkaIMCnX.js} +8 -8
  138. package/server/{inspect-agent-CCfNJjKr.js → inspect-agent-CP7Bu47O.js} +14 -12
  139. package/server/inspect-agent-DTuSg95i.js +2 -0
  140. package/server/{internal-token-BCTEqUCX.js → internal-token-CWcdG-Kw.js} +1 -1
  141. package/server/{internal-token-BeIWG_kT.js → internal-token-Ci0LxMIq.js} +2 -2
  142. package/server/{io-BCtZoXHo.js → io-Cm4Sf_6P.js} +4 -4
  143. package/server/{issue-closed-CiYAa6bX.js → issue-closed-D7aMUeMq.js} +7 -7
  144. package/server/{issue-lifecycle-BETNVVLq.js → issue-lifecycle-BPbczKyy.js} +32 -30
  145. package/server/{issue-lifecycle-DaKN57sx.js → issue-lifecycle-FaugTi39.js} +1 -1
  146. package/server/{issue-service-singleton-C_sZ0HjP.js → issue-service-singleton-BrZQJLRI.js} +11 -11
  147. package/server/{issue-service-singleton-1Q0ER8Yc.js → issue-service-singleton-Dsad9NTt.js} +1 -1
  148. package/server/{issue-title-fallback-B91iD66g.js → issue-title-fallback-BDxHa3-u.js} +3 -3
  149. package/server/{issues-RGHQUKhB.js → issues-Q62MKOV_.js} +2 -2
  150. package/server/{jsonl-parser-Dfs1dlYE.js → jsonl-parser-DSJisyfy.js} +5 -4
  151. package/server/{jsonl-resolver-bFtftCDd.js → jsonl-resolver-DQEe0DHM.js} +12 -9
  152. package/server/kimi-code-Cx5YUJpS.js +3 -0
  153. package/server/{kimi-parser-OcWwmOqF.js → kimi-parser-5VpMzIDq.js} +2 -2
  154. package/server/{label-cleanup-CefxK9tL.js → label-cleanup-DjQGmcZQ.js} +3 -3
  155. package/server/{lifecycle-DVXyUil2.js → lifecycle-BSQIQ1Sq.js} +2 -2
  156. package/server/{lifecycle-DDZ7w-BY.js → lifecycle-DZFHmpGI.js} +6 -6
  157. package/server/{lifecycle-io-D1oBiMce.js → lifecycle-io-Bv4XQMRi.js} +1 -1
  158. package/server/{lifecycle-io-D7N0vQNj.js → lifecycle-io-CW__VX8s.js} +5 -5
  159. package/server/{linear-client-TL32snOy.js → linear-client-DnX3CcAL.js} +1 -1
  160. package/server/{linear-client-DUN7zCeb.js → linear-client-DrRZ3We7.js} +4 -7
  161. package/server/{linear-mcp-auth-bB0CPyjh.js → linear-mcp-auth-BFlpMvWh.js} +5 -5
  162. package/server/{linear-mcp-auth-CtRKSHy5.js → linear-mcp-auth-DylPJABZ.js} +1 -1
  163. package/server/memory-fts-worker.js +1 -1
  164. package/server/{memory-governor-Cvv_9K0M.js → memory-governor-B7uDWRo9.js} +29 -22
  165. package/server/{merge-FTk4LsnM.js → merge-BGozpxFt.js} +3 -3
  166. package/server/{merge-DOCR6pHi.js → merge-CphMVME2.js} +1 -1
  167. package/server/{merge-agent-D-4_iQgy.js → merge-agent-ddEcZDZD.js} +2 -2
  168. package/server/{merge-agent-C-dsN9se.js → merge-agent-ttRY053V.js} +32 -32
  169. package/server/{merge-batch-BJjzUUL7.js → merge-batch-CBQ2YYuy.js} +1 -1
  170. package/server/{merge-completeness-CoLJxfUY.js → merge-completeness-CsSvQJxw.js} +1 -1
  171. package/server/{merge-completeness-BOtBUwTU.js → merge-completeness-YQbhKLPk.js} +4 -4
  172. package/server/{merge-eligibility-C4rTS97F.js → merge-eligibility-BGqmx_bG.js} +1 -1
  173. package/server/{merge-eligibility-D7wRnJbj.js → merge-eligibility-CvQBc_9D.js} +4 -4
  174. package/server/merge-ops-Bgc-EScO.js +2 -0
  175. package/server/{merge-rebase-KBw4rdh3.js → merge-rebase-BbLnMyfQ.js} +2 -2
  176. package/server/merge-rebase-BgYoyMul.js +2 -0
  177. package/server/{merge-set-CyW-xSn4.js → merge-set-DRPWriK9.js} +4 -4
  178. package/server/{merge-set-CVfEM57p.js → merge-set-DaU9Ruxy.js} +1 -1
  179. package/server/{merge-sync-CYGsJy0u.js → merge-sync-BRKJM70R.js} +1 -1
  180. package/server/{merge-sync-YLvOPAry.js → merge-sync-CTGkR1_m.js} +2 -2
  181. package/server/{merge-train-deps-D0y4hBB9.js → merge-train-deps-GPlHOjK6.js} +4 -4
  182. package/server/{merge-train-VxLn8Ms4.js → merge-train-f_un38UJ.js} +4 -4
  183. package/server/{merge-verification-BfJRNMiD.js → merge-verification-BPBW3Hu3.js} +6 -6
  184. package/server/{merged-docker-cleanup-worker-Ci9oeFAe.js → merged-docker-cleanup-worker-By0YSsIP.js} +1 -1
  185. package/server/{merged-docker-cleanup-worker-Bh5fKG_b.js → merged-docker-cleanup-worker-zMzGriKp.js} +3 -3
  186. package/server/messaging-BasbftDu.js +3 -0
  187. package/server/muse-parser-CFchR2vh.js +89 -0
  188. package/server/muse-session-CrSRuauJ.js +56 -0
  189. package/server/{no-resume-mode-DjMQRkId.js → no-resume-mode-BsvYzqbB.js} +1 -1
  190. package/server/node_modules/.package-lock.json +17 -17
  191. package/server/node_modules/@types/node/README.md +3 -3
  192. package/server/node_modules/@types/node/assert/strict.d.ts +56 -13
  193. package/server/node_modules/@types/node/assert.d.ts +190 -189
  194. package/server/node_modules/@types/node/async_hooks.d.ts +43 -151
  195. package/server/node_modules/@types/node/buffer.buffer.d.ts +13 -7
  196. package/server/node_modules/@types/node/buffer.d.ts +237 -102
  197. package/server/node_modules/@types/node/child_process.d.ts +154 -39
  198. package/server/node_modules/@types/node/cluster.d.ts +384 -238
  199. package/server/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  200. package/server/node_modules/@types/node/compatibility/index.d.ts +9 -0
  201. package/server/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  202. package/server/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  203. package/server/node_modules/@types/node/console.d.ts +404 -45
  204. package/server/node_modules/@types/node/constants.d.ts +10 -3
  205. package/server/node_modules/@types/node/crypto.d.ts +1600 -1009
  206. package/server/node_modules/@types/node/dgram.d.ts +77 -14
  207. package/server/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
  208. package/server/node_modules/@types/node/dns/promises.d.ts +15 -9
  209. package/server/node_modules/@types/node/dns.d.ts +183 -136
  210. package/server/node_modules/@types/node/domain.d.ts +32 -12
  211. package/server/node_modules/@types/node/events.d.ts +696 -728
  212. package/server/node_modules/@types/node/fs/promises.d.ts +21 -196
  213. package/server/node_modules/@types/node/fs.d.ts +450 -780
  214. package/server/node_modules/@types/node/globals.d.ts +34 -12
  215. package/server/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  216. package/server/node_modules/@types/node/http.d.ts +310 -431
  217. package/server/node_modules/@types/node/http2.d.ts +889 -543
  218. package/server/node_modules/@types/node/https.d.ts +243 -64
  219. package/server/node_modules/@types/node/index.d.ts +7 -24
  220. package/server/node_modules/@types/node/inspector.d.ts +57 -68
  221. package/server/node_modules/@types/node/inspector.generated.d.ts +411 -765
  222. package/server/node_modules/@types/node/module.d.ts +219 -54
  223. package/server/node_modules/@types/node/net.d.ts +207 -101
  224. package/server/node_modules/@types/node/os.d.ts +49 -41
  225. package/server/node_modules/@types/node/package.json +3 -13
  226. package/server/node_modules/@types/node/path.d.ts +141 -119
  227. package/server/node_modules/@types/node/perf_hooks.d.ts +673 -310
  228. package/server/node_modules/@types/node/process.d.ts +205 -389
  229. package/server/node_modules/@types/node/punycode.d.ts +31 -3
  230. package/server/node_modules/@types/node/querystring.d.ts +16 -3
  231. package/server/node_modules/@types/node/readline/promises.d.ts +6 -3
  232. package/server/node_modules/@types/node/readline.d.ts +152 -66
  233. package/server/node_modules/@types/node/repl.d.ts +109 -101
  234. package/server/node_modules/@types/node/sea.d.ts +116 -1
  235. package/server/node_modules/@types/node/sqlite.d.ts +68 -486
  236. package/server/node_modules/@types/node/stream/consumers.d.ts +15 -91
  237. package/server/node_modules/@types/node/stream/promises.d.ts +15 -136
  238. package/server/node_modules/@types/node/stream/web.d.ts +456 -179
  239. package/server/node_modules/@types/node/stream.d.ts +491 -603
  240. package/server/node_modules/@types/node/string_decoder.d.ts +43 -3
  241. package/server/node_modules/@types/node/test.d.ts +292 -513
  242. package/server/node_modules/@types/node/timers/promises.d.ts +18 -3
  243. package/server/node_modules/@types/node/timers.d.ts +141 -3
  244. package/server/node_modules/@types/node/tls.d.ts +242 -116
  245. package/server/node_modules/@types/node/trace_events.d.ts +97 -3
  246. package/server/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -2
  247. package/server/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  248. package/server/node_modules/@types/node/ts5.6/index.d.ts +6 -25
  249. package/server/node_modules/@types/node/tty.d.ts +40 -57
  250. package/server/node_modules/@types/node/url.d.ts +584 -156
  251. package/server/node_modules/@types/node/util.d.ts +1110 -181
  252. package/server/node_modules/@types/node/v8.d.ts +36 -175
  253. package/server/node_modules/@types/node/vm.d.ts +209 -292
  254. package/server/node_modules/@types/node/wasi.d.ts +74 -24
  255. package/server/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  256. package/server/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
  257. package/server/node_modules/@types/node/web-globals/events.d.ts +0 -9
  258. package/server/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  259. package/server/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  260. package/server/node_modules/@types/node/web-globals/streams.d.ts +0 -93
  261. package/server/node_modules/@types/node/worker_threads.d.ts +407 -257
  262. package/server/node_modules/@types/node/zlib.d.ts +165 -7
  263. package/server/node_modules/msgpackr/README.md +1 -0
  264. package/server/node_modules/msgpackr/dist/index-no-eval.cjs +2 -2
  265. package/server/node_modules/msgpackr/dist/index-no-eval.cjs.map +1 -1
  266. package/server/node_modules/msgpackr/dist/index-no-eval.min.js +1 -1
  267. package/server/node_modules/msgpackr/dist/index-no-eval.min.js.map +1 -1
  268. package/server/node_modules/msgpackr/dist/index.js +2 -2
  269. package/server/node_modules/msgpackr/dist/index.js.map +1 -1
  270. package/server/node_modules/msgpackr/dist/index.min.js +1 -1
  271. package/server/node_modules/msgpackr/dist/index.min.js.map +1 -1
  272. package/server/node_modules/msgpackr/dist/node.cjs +2 -2
  273. package/server/node_modules/msgpackr/dist/node.cjs.map +1 -1
  274. package/server/node_modules/msgpackr/dist/test.js +52 -2
  275. package/server/node_modules/msgpackr/dist/test.js.map +1 -1
  276. package/server/node_modules/msgpackr/index.d.cts +1 -0
  277. package/server/node_modules/msgpackr/index.d.ts +1 -0
  278. package/server/node_modules/msgpackr/pack.js +2 -2
  279. package/server/node_modules/msgpackr/package.json +1 -1
  280. package/server/node_modules/protobufjs/dist/light/protobuf.js +59 -6
  281. package/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  282. package/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  283. package/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  284. package/server/node_modules/protobufjs/dist/minimal/protobuf.js +22 -2
  285. package/server/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  286. package/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  287. package/server/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  288. package/server/node_modules/protobufjs/dist/protobuf.js +59 -6
  289. package/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  290. package/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  291. package/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  292. package/server/node_modules/protobufjs/package.json +1 -1
  293. package/server/node_modules/protobufjs/src/decoder.js +32 -3
  294. package/server/node_modules/protobufjs/src/reader.js +20 -0
  295. package/server/node_modules/protobufjs/src/wrappers.js +5 -1
  296. package/server/node_modules/undici/docs/docs/api/Client.md +4 -0
  297. package/server/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  298. package/server/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  299. package/server/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
  300. package/server/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  301. package/server/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  302. package/server/node_modules/undici/lib/core/symbols.js +2 -0
  303. package/server/node_modules/undici/lib/dispatcher/agent.js +7 -2
  304. package/server/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  305. package/server/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
  306. package/server/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
  307. package/server/node_modules/undici/lib/dispatcher/client.js +3 -2
  308. package/server/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  309. package/server/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  310. package/server/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  311. package/server/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
  312. package/server/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
  313. package/server/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  314. package/server/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  315. package/server/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
  316. package/server/node_modules/undici/lib/handler/cache-handler.js +29 -5
  317. package/server/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  318. package/server/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
  319. package/server/node_modules/undici/lib/handler/redirect-handler.js +21 -4
  320. package/server/node_modules/undici/lib/handler/retry-handler.js +148 -30
  321. package/server/node_modules/undici/lib/interceptor/cache.js +65 -12
  322. package/server/node_modules/undici/lib/interceptor/decompress.js +115 -13
  323. package/server/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  324. package/server/node_modules/undici/lib/interceptor/dns.js +7 -0
  325. package/server/node_modules/undici/lib/interceptor/dump.js +10 -23
  326. package/server/node_modules/undici/lib/mock/mock-agent.js +13 -1
  327. package/server/node_modules/undici/lib/mock/mock-utils.js +11 -10
  328. package/server/node_modules/undici/lib/util/cache.js +45 -3
  329. package/server/node_modules/undici/lib/web/cookies/parse.js +150 -147
  330. package/server/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  331. package/server/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
  332. package/server/node_modules/undici/lib/web/fetch/index.js +6 -0
  333. package/server/node_modules/undici/lib/web/fetch/request.js +2 -3
  334. package/server/node_modules/undici/lib/web/fetch/util.js +6 -1
  335. package/server/node_modules/undici/lib/web/webidl/index.js +3 -3
  336. package/server/node_modules/undici/lib/web/websocket/connection.js +1 -1
  337. package/server/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  338. package/server/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  339. package/server/node_modules/undici/package.json +3 -3
  340. package/server/node_modules/undici/types/client.d.ts +10 -0
  341. package/server/node_modules/undici/types/interceptors.d.ts +2 -0
  342. package/server/node_modules/undici/types/mock-agent.d.ts +11 -10
  343. package/server/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
  344. package/server/node_modules/undici-types/agent.d.ts +13 -12
  345. package/server/node_modules/undici-types/api.d.ts +26 -26
  346. package/server/node_modules/undici-types/balanced-pool.d.ts +12 -13
  347. package/server/node_modules/undici-types/client.d.ts +34 -55
  348. package/server/node_modules/undici-types/connector.d.ts +2 -4
  349. package/server/node_modules/undici-types/cookies.d.ts +0 -2
  350. package/server/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  351. package/server/node_modules/undici-types/dispatcher.d.ts +137 -134
  352. package/server/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  353. package/server/node_modules/undici-types/errors.d.ts +54 -82
  354. package/server/node_modules/undici-types/eventsource.d.ts +4 -9
  355. package/server/node_modules/undici-types/fetch.d.ts +24 -46
  356. package/server/node_modules/undici-types/file.d.ts +39 -0
  357. package/server/node_modules/undici-types/filereader.d.ts +54 -0
  358. package/server/node_modules/undici-types/formdata.d.ts +7 -7
  359. package/server/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  360. package/server/node_modules/undici-types/global-origin.d.ts +5 -5
  361. package/server/node_modules/undici-types/handlers.d.ts +9 -8
  362. package/server/node_modules/undici-types/header.d.ts +1 -162
  363. package/server/node_modules/undici-types/index.d.ts +47 -69
  364. package/server/node_modules/undici-types/interceptors.d.ts +9 -72
  365. package/server/node_modules/undici-types/mock-agent.d.ts +18 -36
  366. package/server/node_modules/undici-types/mock-client.d.ts +4 -6
  367. package/server/node_modules/undici-types/mock-errors.d.ts +3 -3
  368. package/server/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  369. package/server/node_modules/undici-types/mock-pool.d.ts +4 -6
  370. package/server/node_modules/undici-types/package.json +1 -1
  371. package/server/node_modules/undici-types/patch.d.ts +4 -0
  372. package/server/node_modules/undici-types/pool-stats.d.ts +8 -8
  373. package/server/node_modules/undici-types/pool.d.ts +14 -14
  374. package/server/node_modules/undici-types/proxy-agent.d.ts +6 -7
  375. package/server/node_modules/undici-types/readable.d.ts +16 -19
  376. package/server/node_modules/undici-types/retry-agent.d.ts +1 -1
  377. package/server/node_modules/undici-types/retry-handler.d.ts +10 -19
  378. package/server/node_modules/undici-types/util.d.ts +3 -3
  379. package/server/node_modules/undici-types/webidl.d.ts +30 -148
  380. package/server/node_modules/undici-types/websocket.d.ts +10 -48
  381. package/server/{orphan-proposed-reconciler-nFUlquZt.js → orphan-proposed-reconciler-DFHdQSEg.js} +21 -21
  382. package/server/{orphan-proposed-reconciler-CnP0K2v3.js → orphan-proposed-reconciler-DzAxrM99.js} +2 -2
  383. package/server/package-lock.json +18 -18
  384. package/server/package.json +1 -1
  385. package/server/{pan-dir-B4NfzOf3.js → pan-dir-Bs9fme2I.js} +4 -4
  386. package/server/{parked-residue-8WbU0y1z.js → parked-residue-DMtbxJml.js} +31 -31
  387. package/server/{paths-rETQhTF2.js → paths-eTg2jV4C.js} +2 -2
  388. package/server/{pickup-Dle6k9Xt.js → pickup-TwHZNJn4.js} +1 -1
  389. package/server/{pipeline-agent-reader-CeWhQzXC.js → pipeline-agent-reader-CHugmNSx.js} +3 -3
  390. package/server/{pipeline-membership-C9ykcjsn.js → pipeline-membership-BvkkuVml.js} +1 -1
  391. package/server/{pipeline-membership-BV4hdkHm.js → pipeline-membership-DxJOJOjn.js} +1 -1
  392. package/server/{pipeline-membership-gather-Ba0wJNCR.js → pipeline-membership-gather-QYMqf_Wf.js} +10 -10
  393. package/server/{pipeline-membership-gather-C9E22B2W.js → pipeline-membership-gather-fivITe13.js} +1 -1
  394. package/server/{pipeline-notifier-B5DPXvnr.js → pipeline-notifier-DUxiacft.js} +1 -1
  395. package/server/{pipeline-notifier-p190L97e.js → pipeline-notifier-vZqcB2Ts.js} +2 -2
  396. package/server/{post-merge-lifecycle-worker-OQoK8Ckg.js → post-merge-lifecycle-worker-jzN2g_EY.js} +2 -2
  397. package/server/{post-merge-state-DFaf7OI1.js → post-merge-state-DGlkiVIO.js} +4 -4
  398. package/server/{prd-locations-F2oLSAhy.js → prd-locations-Chcvxzle.js} +3 -3
  399. package/server/{project-pipelines-CUsa6U59.js → project-pipelines-BXB5FlFs.js} +2 -2
  400. package/server/{project-repos-BVdi9-ch.js → project-repos-BVSXziAz.js} +1 -1
  401. package/server/{project-repos-CsfvLtmr.js → project-repos-J6jc42uD.js} +2 -2
  402. package/server/{project-resource-refresh-queue-BehrH4Ai.js → project-resource-refresh-queue-DebwjPPA.js} +17 -17
  403. package/server/{project-resource-refresh-queue-D2110Guc.js → project-resource-refresh-queue-cqOeJ0fB.js} +1 -1
  404. package/server/{projects-BMuEf14J.js → projects-DXgHD2Xl.js} +1 -1
  405. package/server/{prompts-CKpDt8Jn.js → prompts-BJ8Twvtl.js} +2 -2
  406. package/server/{providers-Buv2wmFU.js → providers-Bx-PKo3d.js} +1 -1
  407. package/server/{providers-CxPKmyif.js → providers-DQogCKG0.js} +7 -7
  408. package/server/public/assets/{chunk-BO2N2NFS-DZOQVqV1.js → chunk-BO2N2NFS-CefmGH8f.js} +4 -4
  409. package/server/public/assets/{chunk-K2UTITRG-CopEAH22.js → chunk-K2UTITRG-DS0TExnd.js} +2 -2
  410. package/server/public/assets/codicon-ngg6Pgfi.ttf +0 -0
  411. package/server/public/assets/{diagram-OG6HWLK6-oKeXcbO1.js → diagram-OG6HWLK6-DYPEQqOy.js} +1 -1
  412. package/server/public/assets/{dist-ClBlE-Nm.js → dist-D0_QiSJD.js} +1 -1
  413. package/server/public/assets/{dist-2qPmeRzT.js → dist-DVcb72hI.js} +3 -3
  414. package/server/public/assets/editor.worker-Bd9IXS8d.js +26 -0
  415. package/server/public/assets/{ganttDiagram-6RSMTGT7-BwdG9fQv.js → ganttDiagram-6RSMTGT7-C0TVczXo.js} +1 -1
  416. package/server/public/assets/{highlighted-body-OFNGDK62-BzGNdskQ.js → highlighted-body-OFNGDK62-DqOVJX4H.js} +1 -1
  417. package/server/public/assets/image-GAAHSSAO-DQ2ivYhs.js +1 -0
  418. package/server/public/assets/index-CFZuwq0-.css +1 -0
  419. package/server/public/assets/index-CWCooHwg.js +1732 -0
  420. package/server/public/assets/{linear-DpEt1TJb.js → linear-45MX5LeL.js} +1 -1
  421. package/server/public/assets/markdown-Budfoo9I.js +1 -0
  422. package/server/public/assets/mermaid-GHXKKRXX-71HgceZK.js +1 -0
  423. package/server/public/assets/{pieDiagram-4H26LBE5-9BpM4oRJ.js → pieDiagram-4H26LBE5-BSyYJciD.js} +1 -1
  424. package/server/public/assets/{prod-CzJiNNEG.js → prod-CcWF3Ag1.js} +5 -5
  425. package/server/public/assets/{quadrantDiagram-W4KKPZXB-BXWVAoZx.js → quadrantDiagram-W4KKPZXB-DyPGNivi.js} +1 -1
  426. package/server/public/assets/{sankeyDiagram-5OEKKPKP-5oxodGEw.js → sankeyDiagram-5OEKKPKP-CdiSWvwI.js} +1 -1
  427. package/server/public/assets/{xychartDiagram-2RQKCTM6-BChDrHxZ.js → xychartDiagram-2RQKCTM6-BZeywmN2.js} +1 -1
  428. package/server/public/index.html +2 -2
  429. package/server/pull-requests-DLiyKC8q.js +2 -0
  430. package/server/{pull-requests-T0OV0Vn4.js → pull-requests-EBvcAtZO.js} +3 -3
  431. package/server/{rally-api-BFPb2oSq.js → rally-api-2KW2hJUT.js} +2 -2
  432. package/server/{rally-api-BoucQG1u.js → rally-api-BtWOXNna.js} +1 -1
  433. package/server/{rally-client-16iObny7.js → rally-client-CAQtSqJJ.js} +5 -5
  434. package/server/{rally-client-CsqLjLLa.js → rally-client-DK8Ac35q.js} +1 -1
  435. package/server/{rally-CUqj2oIN.js → rally-k5qOLHHK.js} +3 -3
  436. package/server/rally-vmQx9f0C.js +3 -0
  437. package/server/{rebuild-stack-BcBVFJp3.js → rebuild-stack-DSQSgPCI.js} +2 -2
  438. package/server/rebuild-stack-xdGFthJn.js +370 -0
  439. package/server/{reconciler-caYiRnPy.js → reconciler-xH7d13Wo.js} +6 -6
  440. package/server/{reconstruct-cache-3JzPOune.js → reconstruct-cache-Bb2Jg2DZ.js} +7 -7
  441. package/server/{record-DYOg97Iv.js → record-Dsceq536.js} +1 -1
  442. package/server/{record-update-CDPEX7BH.js → record-update-CLtgirnZ.js} +1 -1
  443. package/server/{record-update-BPqpBu3O.js → record-update-T3PMrwE-.js} +4 -4
  444. package/server/{recovery-trip-CpfW6LCJ.js → recovery-trip-7JFHFjeo.js} +3 -3
  445. package/server/{recovery-trip-xqKC07Gy.js → recovery-trip-B7UdNXjP.js} +1 -1
  446. package/server/{release-engine-C_OOhCaK.js → release-engine-78iCajIc.js} +5 -5
  447. package/server/{release-set-DOIDz2vw.js → release-set-B_sH_Mud.js} +3 -3
  448. package/server/{remote-xY0B43Ho.js → remote-C9eYHTqn.js} +3 -3
  449. package/server/{remote-agents-MuXx2gWm.js → remote-agents-CEOvYsvK.js} +1 -1
  450. package/server/{remote-agents-DbbN7vSm.js → remote-agents-CthcZHnO.js} +6 -6
  451. package/server/{remote-completion-LcWCpAm2.js → remote-completion-D5wzZCte.js} +12 -12
  452. package/server/{remote-BTh-sjpX.js → remote-gWXJyhJK.js} +3 -3
  453. package/server/{resolver-D4nsxfGo.js → resolver-BGZh3lXA.js} +7 -7
  454. package/server/{resolver-C2QKOf09.js → resolver-ChLZFIjB.js} +2 -2
  455. package/server/{memory-pressure-patrol-C6DJJQRA.js → resource-pressure-patrol-Bg23rPV-.js} +110 -9
  456. package/server/{resume-ByUrJUNX.js → resume-BKyB4hA1.js} +1 -1
  457. package/server/{review-agent-BRBTm1qE.js → review-agent-DHs-JngN.js} +52 -35
  458. package/server/{review-agent-Caodi0PX.js → review-agent-ZdP-HmwY.js} +2 -2
  459. package/server/{review-artifacts-DgaDlbO4.js → review-artifacts-DExSp5Lh.js} +6 -6
  460. package/server/{review-convoy-liveness-BBvyuRLC.js → review-convoy-liveness-BTMvU4CA.js} +8 -8
  461. package/server/{review-run-recovery-DCzWMMvE.js → review-run-recovery-BYalQzbh.js} +1 -1
  462. package/server/{review-run-recovery-THHMKlXJ.js → review-run-recovery-BvVG3oUr.js} +2 -2
  463. package/server/{review-status-DpniqzPT.js → review-status-BegAr86G.js} +33 -31
  464. package/server/{review-status-Bge_3XTR.js → review-status-DXTFzCmR.js} +1 -1
  465. package/server/{review-status-emit-D7sM720S.js → review-status-emit-C9YW6SQL.js} +3 -3
  466. package/server/{review-status-enrichment-PDI4-faj.js → review-status-enrichment-DRJKuIwU.js} +3 -3
  467. package/server/{review-status-sync-C6ZKTI8f.js → review-status-sync-CHt0oq_3.js} +2 -2
  468. package/server/{review-status-sync-CvpHWyvR.js → review-status-sync-DEGnJMfG.js} +1 -1
  469. package/server/{review-verdict-feedback-tyMoLT2L.js → review-verdict-feedback-Dp139Lmv.js} +1 -1
  470. package/server/{review-verdict-feedback-B2ojHFH5.js → review-verdict-feedback-qlVBi19-.js} +7 -7
  471. package/server/{review-verdict-writer-DjrJ64eS.js → review-verdict-writer-BVco3WoI.js} +1 -1
  472. package/server/{review-verdict-writer-Cy_1pnIj.js → review-verdict-writer-CJr_Ob0Y.js} +7 -7
  473. package/server/{rollup-DU3xBQu2.js → rollup-H2NWuNhX.js} +8 -8
  474. package/server/{rollup-Cp0KEoOu.js → rollup-iPhJvI-2.js} +1 -1
  475. package/server/{search-DhtKwbBC.js → search-BtgzCB2W.js} +2 -2
  476. package/server/{secret-redaction-DLZ-VqHq.js → secret-redaction-EqpTK7R6.js} +1 -1
  477. package/server/{sequence-io-C-Q19Jez.js → sequence-io-iljWlslY.js} +4 -4
  478. package/server/{sequencer-agent-eN2P2lDz.js → sequencer-agent-BGGVKxtw.js} +11 -6
  479. package/server/server.js +1536 -1244
  480. package/server/{service-CThO0Sar.js → service-kzhN0DLg.js} +58 -58
  481. package/server/{session-fork-ZYTHtpBh.js → session-fork-B3hkpes1.js} +2 -2
  482. package/server/{settings-nAT-eK56.js → settings-BpM0Ergn.js} +3 -3
  483. package/server/settings-CW_lAaJv.js +2 -0
  484. package/server/{settings-CTywpFw5.js → settings-aBz_GpBq.js} +9 -2
  485. package/server/{shadow-engineering-BHZKPJhq.js → shadow-engineering-C7kypoM-.js} +2 -2
  486. package/server/{shadow-state-CZ_LnPsi.js → shadow-state-Db5ExiBP.js} +1 -1
  487. package/server/{shadow-state-BTLi4Axs.js → shadow-state-IG8JSXgD.js} +2 -2
  488. package/server/{shadow-utils-CPLlPHdn.js → shadow-utils-DSDsJXLD.js} +2 -2
  489. package/server/{ship-record-BaBla0l_.js → ship-record-80n1CYp9.js} +6 -6
  490. package/server/{ship-record-BlvX8-xv.js → ship-record-DN8voLiQ.js} +1 -1
  491. package/server/{ship-status-rQbPQBsF.js → ship-status-CJvaa4QB.js} +2 -2
  492. package/server/{smart-compaction-D1CNGdZx.js → smart-compaction-C96F2aFQ.js} +7 -7
  493. package/server/{smart-compaction-CUXn8mfX.js → smart-compaction-owKHJDbL.js} +1 -1
  494. package/server/{spawn-planning-session-DfEWyrVV.js → spawn-planning-session-CiJdOHTD.js} +2 -2
  495. package/server/{spawn-planning-session-DCmO6COk.js → spawn-planning-session-FmJa6PCS.js} +41 -50
  496. package/server/{specialist-context-C1-CfYQb.js → specialist-context-_ootmzn2.js} +5 -5
  497. package/server/{specialist-handoff-logger-BDKoz5Z9.js → specialist-handoff-logger-4QCjIBPO.js} +2 -2
  498. package/server/{specialist-logs-BJQFkpdG.js → specialist-logs-BbAX221-.js} +3 -3
  499. package/server/{specialists-DhS79T9v.js → specialists-COZoYaiz.js} +266 -173
  500. package/server/{specialists-CYt1U3Zm.js → specialists-D8sYZnPb.js} +2 -2
  501. package/server/{specialists-Dx0zRTxX.js → specialists-DTAOVZpU.js} +1 -1
  502. package/server/{specialists-D6MUU31Q.js → specialists-RPLJnYc1.js} +19 -19
  503. package/server/{specialists-registry-Bng0OFGH.js → specialists-registry-CNbvfOcy.js} +2 -2
  504. package/server/{specialists-registry-BRLCi61y.js → specialists-registry-DqgQIxpu.js} +1 -1
  505. package/server/specs-ChqOBhAF.js +3 -0
  506. package/server/{src-C7gGe4KU.js → src-Cz63twgJ.js} +2 -2
  507. package/server/{src-CdwN6WY6.js → src-tnFSfiXX.js} +126 -18
  508. package/server/{stack-health-Bz711z1Y.js → stack-health-D0j1RhAj.js} +1 -1
  509. package/server/{stack-health-BKfNaqMm.js → stack-health-Y8O3UuPe.js} +3 -3
  510. package/server/{stale-task-claims-DMRLb5R2.js → stale-task-claims-Db6yxeFz.js} +5 -5
  511. package/server/{staleness-CxZaIhrn.js → staleness-CyM7ACHv.js} +1 -1
  512. package/server/{staleness-r_dkMyMG.js → staleness-akWxgpIu.js} +1 -1
  513. package/server/{stall-sweeper-CBWqSWV2.js → stall-sweeper-9bRBZhrQ.js} +8 -8
  514. package/server/{state-home-DhsMqg8W.js → state-home-CWu1dx9L.js} +2 -2
  515. package/server/{state-mapping-D2yC81Vy.js → state-mapping-CdvWOIhv.js} +1 -1
  516. package/server/{state-migrate-C2Ouyd6e.js → state-migrate-J3tFJnbd.js} +6 -6
  517. package/server/{state-mirror-BPXciz84.js → state-mirror-DQKpsskH.js} +3 -3
  518. package/server/{stuck-remediation-kta3KN7c.js → stuck-remediation-4Rf_xMEb.js} +13 -13
  519. package/server/{stuck-remediation-DALieAkx.js → stuck-remediation-BvTK_NYN.js} +1 -1
  520. package/server/{substrate-bug-weights-service-D_ICP7TI.js → substrate-bug-weights-service-9nrkZcaP.js} +3 -3
  521. package/server/{summary-fork-DhhaFhxZ.js → summary-fork-D-cylknJ.js} +54 -17
  522. package/server/{summary-fork-CojrFKb6.js → summary-fork-PLcckTRE.js} +2 -2
  523. package/server/supervisor/{injection-budget-BOH-EiFB.js → injection-budget-DfPSjiS7.js} +1 -1
  524. package/server/supervisor/pty-supervisor.js +1 -1
  525. package/server/{supervisor-DqH-laVL.js → supervisor-B2_uXxHQ.js} +4 -4
  526. package/server/supervisor-DSSr9_E4.js +2 -0
  527. package/server/{swarm-readiness-LF8ZF_hc.js → swarm-readiness-BkVvnCdr.js} +3 -3
  528. package/server/{synthesis-verdict-CGFF8uQI.js → synthesis-verdict-BtJAwMS3.js} +2 -2
  529. package/server/{synthesis-verdict-DSoOFUIV.js → synthesis-verdict-b1uY2m9Q.js} +1 -1
  530. package/server/{system-prerequisites-Lsx0jUUV.js → system-prerequisites-zlmZiJzn.js} +14 -2
  531. package/server/{teardown-workspace-DMwomEG1.js → teardown-workspace-CTL16rnG.js} +16 -16
  532. package/server/{test-agent-queue-Cu0D6BYe.js → test-agent-queue-CMgYZiR_.js} +6 -6
  533. package/server/{test-verdict-9mvl7pQn.js → test-verdict-BaiFCApG.js} +1 -1
  534. package/server/{test-verdict-oNSv1rVr.js → test-verdict-DhjFE4Go.js} +2 -2
  535. package/server/{tldr-daemon-CRSAkhBx.js → tldr-daemon-CW1MhBkM.js} +1 -1
  536. package/server/{tldr-daemon-McqCk2X7.js → tldr-daemon-CYr67NdC.js} +2 -2
  537. package/server/{tmux-CYucGrTl.js → tmux-aj9rscol.js} +2 -2
  538. package/server/{tmux-wnT_hg-s.js → tmux-l-yvNWhg.js} +2 -2
  539. package/server/{token-BdfZLRg1.js → token-BO7DAEyM.js} +2 -2
  540. package/server/{token-util-Crcay9j_.js → token-util-C_1EI72O.js} +1 -1
  541. package/server/token-util-msNwng7E.js +3 -0
  542. package/server/{tracker-config-tfAOWgng.js → tracker-config-Qq_kEwYh.js} +2 -2
  543. package/server/{tracker-utils-Dbg_pVZg.js → tracker-utils-McMENyKj.js} +2 -2
  544. package/server/{traefik-connect-DoQvQ6oJ.js → traefik-connect-BZWNRHOd.js} +1 -1
  545. package/server/{tunnel-B1MNIgkL.js → tunnel-BElVxdZw.js} +1 -1
  546. package/server/{tunnel-skW68j9B.js → tunnel-D01HhYX5.js} +3 -3
  547. package/server/{typed-errors-CZ3GFBvo.js → typed-errors-CKb5wNaG.js} +1 -1
  548. package/server/{typed-errors-DXqf3RnP.js → typed-errors-uJ-V6edU.js} +1 -1
  549. package/server/{types-PW4zkxCM.js → types-JR7ZOtpL.js} +1 -1
  550. package/server/{uat-failure-feedback-ly8ZwtfC.js → uat-failure-feedback-DS6W9X3I.js} +5 -5
  551. package/server/{uat-promote-verification-BBaMwfdc.js → uat-promote-verification-CRsIHE_q.js} +5 -5
  552. package/server/{uat-train-D7Ran2FB.js → uat-train-BoA9r6_I.js} +1 -1
  553. package/server/{uat-train-BBEiYSep.js → uat-train-Cd8CJeNe.js} +22 -22
  554. package/server/{validate-BYcBcBwg.js → validate-BdmvTIym.js} +3 -3
  555. package/server/{validation-nSrYiYvA.js → validation-ApKDjkLH.js} +1 -1
  556. package/server/{validation-BfG2jW5C.js → validation-Dxdai-37.js} +14 -4
  557. package/server/{verification-artifact-DglwaHke.js → verification-artifact-DhIkPgrP.js} +1 -1
  558. package/server/{verification-artifact-Cmhgq4b_.js → verification-artifact-olosZdZU.js} +1 -1
  559. package/server/{verification-runner-CFjAuv9u.js → verification-runner-BO0K3xNA.js} +1 -1
  560. package/server/{verification-runner-BEq5ZF-h.js → verification-runner-fEY1Qj-l.js} +31 -23
  561. package/server/{work-agent-prompt-CaD2ue8m.js → work-agent-prompt-BEpIuqw1.js} +10 -10
  562. package/server/{work-agent-prompt-BnhKNAg7.js → work-agent-prompt-Csr4vMbl.js} +1 -1
  563. package/server/{work-agent-start-0nJ-6UeA.js → work-agent-start-DA3P_ABv.js} +2 -2
  564. package/server/{work-agent-start-D8NEN5KD.js → work-agent-start-DWBmIRlg.js} +1 -1
  565. package/server/workflows-CgGNyl1z.js +2 -0
  566. package/server/{workflows-C7mxM1qc.js → workflows-CxVnygYU.js} +28 -28
  567. package/server/{workspace-Dbqv9ehn.js → workspace-BO8fIfW9.js} +1 -1
  568. package/server/{workspace-BAhMgMaO.js → workspace-BWYfzfPV.js} +3 -3
  569. package/server/{workspace-anchor-drift-Bpa3xoni.js → workspace-anchor-drift-BMSxf9wp.js} +1 -1
  570. package/server/{workspace-anchor-drift-B_3kyyxJ.js → workspace-anchor-drift-RJcMD1EV.js} +4 -4
  571. package/server/{workspace-config-D-bNq2CF.js → workspace-config-CoAaYx_w.js} +1 -1
  572. package/server/{workspace-manager-CM8RCrSc.js → workspace-manager-CnAyRh3v.js} +45 -380
  573. package/server/workspace-manager-D0jJ7StJ.js +4 -0
  574. package/server/{workspace-metadata-Cu6yfxBS.js → workspace-metadata-Copcoih9.js} +2 -2
  575. package/server/{workspace-metadata-BEOwJSdK.js → workspace-metadata-ILlbk8AX.js} +1 -1
  576. package/server/{workspaces-C7LAuZfe.js → workspaces-Cpz0xJWQ.js} +112 -112
  577. package/server/worktree-ops-CV-pRvyW.js +3 -0
  578. package/server/worktree-ops-Cnk1voFY.js +369 -0
  579. package/sync-sources/rules/context-nomenclature.md +4 -3
  580. package/sync-sources/rules/rule-authoring.md +3 -3
  581. package/sync-sources/skills/knowledge-capture/SKILL.md +13 -13
  582. package/sync-sources/skills/pan-new-project/SKILL.md +2 -2
  583. package/sync-sources/skills/pan-projects/SKILL.md +3 -3
  584. package/sync-sources/skills/pan-sync/SKILL.md +8 -10
  585. package/sync-sources/skills/refactor-radar/SKILL.md +12 -12
  586. package/server/agents-DixZjXWm.js +0 -3
  587. package/server/archive-planning-D3gw32U9.js +0 -2
  588. package/server/assemble-B_JgnCbG.js +0 -365
  589. package/server/build-info-Dx2qrVhb.js +0 -2
  590. package/server/cli-BflmtEFM.js +0 -2
  591. package/server/context-layers-CdpabJj0.js +0 -37
  592. package/server/context-layers-Ds1MnEFI.js +0 -4
  593. package/server/conversation-service-BL-asWPX.js +0 -3
  594. package/server/conversations-CEMfwMt-.js +0 -3
  595. package/server/dead-end-trip-DUbiRMtT.js +0 -2
  596. package/server/delivery-DhZGRShH.js +0 -3
  597. package/server/deploy-queue--smqHLhe.js +0 -2
  598. package/server/forge-4VVCRcF7.js +0 -2
  599. package/server/hume-gXLmRhmN.js +0 -3
  600. package/server/inspect-agent-Dhp3hCGp.js +0 -2
  601. package/server/kimi-code-BxkDgaj4.js +0 -3
  602. package/server/kimi-code-CNYRA8Dd.js +0 -581
  603. package/server/merge-ops-Cf02szJ5.js +0 -2
  604. package/server/merge-rebase-Bj7eJAG4.js +0 -2
  605. package/server/messaging-Dfbhgjd6.js +0 -3
  606. package/server/node_modules/@types/node/ffi.d.ts +0 -486
  607. package/server/node_modules/@types/node/inspector/promises.d.ts +0 -35
  608. package/server/node_modules/@types/node/path/posix.d.ts +0 -8
  609. package/server/node_modules/@types/node/path/win32.d.ts +0 -8
  610. package/server/node_modules/@types/node/quic.d.ts +0 -2125
  611. package/server/node_modules/@types/node/stream/iter.d.ts +0 -452
  612. package/server/node_modules/@types/node/test/reporters.d.ts +0 -59
  613. package/server/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  614. package/server/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  615. package/server/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  616. package/server/node_modules/@types/node/util/types.d.ts +0 -558
  617. package/server/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  618. package/server/node_modules/@types/node/web-globals/console.d.ts +0 -9
  619. package/server/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  620. package/server/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  621. package/server/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  622. package/server/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  623. package/server/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  624. package/server/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  625. package/server/node_modules/@types/node/web-globals/url.d.ts +0 -24
  626. package/server/node_modules/@types/node/zlib/iter.d.ts +0 -131
  627. package/server/node_modules/undici-types/cache-interceptor.d.ts +0 -179
  628. package/server/node_modules/undici-types/client-stats.d.ts +0 -15
  629. package/server/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
  630. package/server/node_modules/undici-types/h2c-client.d.ts +0 -73
  631. package/server/node_modules/undici-types/mock-call-history.d.ts +0 -111
  632. package/server/node_modules/undici-types/round-robin-pool.d.ts +0 -39
  633. package/server/node_modules/undici-types/snapshot-agent.d.ts +0 -113
  634. package/server/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
  635. package/server/node_modules/undici-types/utility.d.ts +0 -7
  636. package/server/public/assets/image-GAAHSSAO-rafcvWHh.js +0 -1
  637. package/server/public/assets/index-CdPveU3M.css +0 -1
  638. package/server/public/assets/index-Cg6tdZoY.js +0 -860
  639. package/server/public/assets/mermaid-GHXKKRXX-6KBD_3T_.js +0 -1
  640. package/server/pull-requests-CmlandI7.js +0 -2
  641. package/server/rally-DYIn9R2U.js +0 -3
  642. package/server/rebuild-stack-CyXMrj6K.js +0 -197
  643. package/server/settings-ByDRfuuE.js +0 -2
  644. package/server/specs-oRGyfz6C.js +0 -3
  645. package/server/supervisor-DSSWo4M2.js +0 -2
  646. package/server/token-util-DfUS3Lpp.js +0 -3
  647. package/server/workflows-BtHRlFIm.js +0 -2
  648. package/server/workspace-manager-BrbX90Rm.js +0 -3
  649. /package/server/public/assets/{pica-CgYEdS5s.js → pica-DPvnTcFS.js} +0 -0
  650. /package/server/public/assets/{wasm-DNrvLWf-.js → wasm-Ca_Unakq.js} +0 -0
@@ -1,57 +1,58 @@
1
1
  import { n as __esmMin, o as __toESM } from "./rolldown-runtime-DNCzzKnI.js";
2
- import { $t as findProjectByPathSync, Ai as encodeClaudeProjectDir, Br as OPENROUTER_MODEL_CONTEXT_WINDOWS, C as DEFAULT_TIERED_EXECUTION_CONFIG, Dr as init_roles, Dt as queueAutoCommit, E as init_tier_table, Et as pushPendingStateCommits, Gr as init_percent, Gt as shouldCommitLegacyWorkspaceArtifacts, Hi as packageRoot, Ht as init_state_read_home, Ir as resolveModelIdSync, Kn as extractPrefixSync, Lr as CLIPROXY_GPT56_CONTEXT_WINDOW, Nr as hasModelCapabilitySync, O as resolveTieredExecutionEnabled, On as resolveProjectFromIssueSync, Or as resolveModel, Ot as reconcileStatePlaneDrift, Pr as init_model_capabilities, Qr as FsError, Ri as getOverdeckHome, Rr as CLIPROXY_GPT56_LONG_CONTEXT_WINDOW, Tt as init_auto_commit, Ui as resolveOhmypiExtensionPath, Ur as fmix32, Vi as isDevMode, Wi as sessionFilePath, Wr as fnv1a32, Wt as resolveStateReadHomeSync, Xn as resolveBareNumericIdSync, Xr as ClaudeCredentialParseError, Y as init_record, _r as setupCredentialFileAuthSync, an as getProjectSwarmHotspots, at as writeAgentHarnessModelSync, br as init_openai_compatible_proxy, cr as clearCredentialFileAuthSync, d as isTldrEnabledSync, dr as getProviderEnvSync, er as require_dist, et as readIssueRecordForWorkspaceSync, fn as init_projects, fr as getProviderForModelSync, gr as resolveKimiCodeModelAlias, jr as getModelCapabilitySync, k as resolveTieredExecutionEnabledForIssue, ki as claudeSessionTranscriptExists, li as init_errors, lr as getBuiltInDefaultHarness, oi as TmuxError, on as getProjectSync, p as loadConfigSync, pr as init_providers, qn as init_issue_id, rn as getIssuePrefix, rt as resolveProjectForIssue, t as init_config_yaml, tt as readIssueRecordSync, u as isClaudeCodeChannelsMcpEnabled, ui as AGENTS_DIR, vr as ensureOpenAICompatibleProxyRunning, w as TIERED_EXECUTION_DIFFICULTIES, wt as flushAutoCommits, zi as init_paths, zr as GPT56_LONG_CONTEXT_VARIANTS } from "./config-yaml-D60AnTIu.js";
3
- import { h as loadConfigSync$1, p as init_config } from "./config-NxI9Yl2f.js";
4
- import { l as init_activity_logger, o as emitActivityEntrySync, s as emitActivityTtsSync } from "./activity-logger-SlTXYCVf.js";
5
- import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-CJRi_5Wu.js";
6
- import { n as init_fs_lock, s as withRecordFsLock } from "./fs-lock-DQ_gUxfq.js";
7
- import { c as withStateGitLock, i as init_record_update, n as clearRecordPipelineClosedOut, s as init_state_git_lock } from "./record-update-BPqpBu3O.js";
8
- import { $ as init_pane_choice_menu, B as sendKeys, C as init_tmux, D as killSessionSync, E as killSession, G as setOption, H as sendRawKeystroke, P as listSessionsSync, Q as buildChoiceKeystrokes, T as isPaneDead, U as sessionExists, W as sessionExistsSync, a as capturePaneText, c as createSessionSync, ct as BLANKED_PROVIDER_ENV, dt as init_child_env, et as paneChoiceMenuSignature, i as capturePaneSync, k as listPaneValues, nt as parsePaneChoiceMenu, p as exactPaneTarget, r as capturePane, s as createSession, v as getManagedTmuxSocketName, z as sendEscapeKeyAsync } from "./tmux-wnT_hg-s.js";
9
- import { a as getWorkspaceForIssue, o as init_resolver } from "./resolver-C2QKOf09.js";
10
- import { a as init_event_store, i as initEventStore } from "./event-store-DTns2XZP.js";
11
- import { o as OHMYPI_BEHAVIOR, s as getHarnessBehavior } from "./src-CdwN6WY6.js";
12
- import { a as readVerdictPreservationStatus, d as getOverdeckAgentStateSync, f as init_agent_state_sync, i as init_work_start_verdicts, l as resetWorkStartPipelineVerdicts, m as saveOverdeckAgentStateSync, o as refreshWorkStartReviewedAnchor, p as listOverdeckAgentStatesSync, r as registerPipelineTelemetryAgentReader, t as init_pipeline_agent_reader } from "./pipeline-agent-reader-CeWhQzXC.js";
13
- import { a as countAgentsByStatus, c as init_agents$2, g as logAgentLifecycleSync, h as init_persistent_logger } from "./agents-DzpQidT8.js";
14
- import { n as ensureSessionContextBriefingFile, r as init_briefing_freshness } from "./briefing-freshness-ENa_hW_V.js";
15
- import { a as getFlywheelActiveRunIdSync, c as init_control_settings, j as parseOhmypiSessionSync, k as init_ohmypi_parser } from "./control-settings-Db0uXgVM.js";
16
- import { _ as init_tier_metrics, g as estimateFeedDeliveryTokens, v as recordTierFeedDelivery } from "./cost-sync-DfmvLT9L.js";
17
- import { t as init_behavior } from "./behavior-DCg8CIWC.js";
18
- import { b as init_cliproxy, c as bridgeGeminiAuthToCliproxy, h as getCliproxyClientEnv, l as decodeJwtPayload$1, p as getCliproxyAuthDir, s as bridgeCodexAuthToCliproxySync, v as getCliproxyLogPath } from "./cliproxy-DXDQcR3I.js";
19
- import { a as init_feature_registry_population, i as resetPostMergeState, n as init_post_merge_state, o as recordFeatureRegistryLifecycle } from "./post-merge-state-DFaf7OI1.js";
20
- import { i as ensureInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-BeIWG_kT.js";
21
- import { A as init_conversations, B as reactivateConversationForSpawn, C as getConversationByName, b as createConversation, z as normalizeHarness } from "./conversations-nS6QgYpD.js";
22
- import { n as readActiveDashboardBundleSync, t as init_active_dashboard_bundle } from "./active-dashboard-bundle-CCqpFWiz.js";
23
- import { a as readCavemanVariant, n as init_workspace } from "./workspace-BAhMgMaO.js";
24
- import { C as generateLauncherScriptSync, D as normalizeModelOverrideSync, E as init_model_validation, O as requireModelOverrideSync, S as normalizeFlywheelRunId, _ as init_tmux_dedup, b as init_provenance, f as completeKeyedSubmit, i as init_auto_spawn_consent, k as shellQuoteModelIdSync, s as withAutoSpawnConsentClaim, w as init_launcher_generator, x as isOperatorStartedBy, y as sendKeysDedup } from "./auto-spawn-consent-BesWchEi.js";
25
- import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-DLrb9ovz.js";
26
- import { D as init_layers, F as resolveWorkspaceContextFile, L as workspaceContextFile, b as renderForHarness, d as renderProjectLayer, i as workspaceContextWithoutProjectLayer, l as init_render, r as init_assemble, u as renderGlobalLayer, y as init_harness } from "./assemble-B_JgnCbG.js";
27
- import { a as extractThreadIdFromRollout, c as initCodexHome, l as init_codex, o as findLatestRollout } from "./codex-DYyZL8JD.js";
28
- import { i as prepareHarnessLaunch, r as init_harness_binary } from "./harness-binary-DChiynaB.js";
29
- import { n as createTrackerFromConfig, r as init_factory, t as createTracker } from "./factory-CWVKwKFE.js";
30
- import { c as init_stack_health, o as getWorkspaceStackHealth } from "./stack-health-BKfNaqMm.js";
2
+ import { $r as FsError, $t as findProjectByPathSync, Bi as isDevMode, Br as OPENROUTER_MODEL_CONTEXT_WINDOWS, C as DEFAULT_TIERED_EXECUTION_CONFIG, Dt as queueAutoCommit, E as init_tier_table, Et as pushPendingStateCommits, Gr as fnv1a32, Gt as shouldCommitLegacyWorkspaceArtifacts, Hi as resolveOhmypiExtensionPath, Ht as init_state_read_home, Ir as resolveModelIdSync, Kn as extractPrefixSync, Kr as init_percent, Li as getOverdeckHome, Lr as CLIPROXY_GPT56_CONTEXT_WINDOW, Nr as hasModelCapabilitySync, O as resolveTieredExecutionEnabled, Oi as claudeSessionTranscriptExists, On as resolveProjectFromIssueSync, Or as init_roles, Ot as reconcileStatePlaneDrift, Pr as init_model_capabilities, Ri as init_paths, Rr as CLIPROXY_GPT56_LONG_CONTEXT_WINDOW, Ti as SYNC_SOURCES, Tt as init_auto_commit, Ui as sessionFilePath, Vi as packageRoot, Wr as fmix32, Wt as resolveStateReadHomeSync, Xn as resolveBareNumericIdSync, Y as init_record, Zr as ClaudeCredentialParseError, an as getProjectSwarmHotspots, at as writeAgentHarnessModelSync, cr as clearCredentialFileAuthSync, d as isTldrEnabledSync, di as AGENTS_DIR, dr as getProviderEnvSync, er as require_dist, et as readIssueRecordForWorkspaceSync, fn as init_projects, fr as getProviderForModelSync, gr as resolveKimiCodeModelAlias, jr as getModelCapabilitySync, k as resolveTieredExecutionEnabledForIssue, ki as encodeClaudeProjectDir, kr as resolveModel, lr as getBuiltInDefaultHarness, on as getProjectSync, p as loadConfigSync, pr as init_providers, qn as init_issue_id, rn as getIssuePrefix, rt as resolveProjectForIssue, si as TmuxError, t as init_config_yaml, tt as readIssueRecordSync, u as isClaudeCodeChannelsMcpEnabled, ui as init_errors, vr as setupCredentialFileAuthSync, w as TIERED_EXECUTION_DIFFICULTIES, wt as flushAutoCommits, xr as init_openai_compatible_proxy, yr as ensureOpenAICompatibleProxyRunning, zr as GPT56_LONG_CONTEXT_VARIANTS } from "./config-yaml-Dce9VUd6.js";
3
+ import { h as loadConfigSync$1, p as init_config } from "./config-BUjU7GZQ.js";
4
+ import { l as init_activity_logger, o as emitActivityEntrySync, s as emitActivityTtsSync } from "./activity-logger-DNYDzAOU.js";
5
+ import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-B05o-e2g.js";
6
+ import { n as init_fs_lock, r as isPidDead, s as withRecordFsLock } from "./fs-lock-VCGoXZI5.js";
7
+ import { c as withStateGitLock, i as init_record_update, n as clearRecordPipelineClosedOut, s as init_state_git_lock } from "./record-update-T3PMrwE-.js";
8
+ import { $ as init_pane_choice_menu, B as sendKeys, C as init_tmux, D as killSessionSync, E as killSession, G as setOption, H as sendRawKeystroke, P as listSessionsSync, Q as buildChoiceKeystrokes, T as isPaneDead, U as sessionExists, W as sessionExistsSync, a as capturePaneText, c as createSessionSync, ct as BLANKED_PROVIDER_ENV, dt as init_child_env, et as paneChoiceMenuSignature, i as capturePaneSync, k as listPaneValues, nt as parsePaneChoiceMenu, p as exactPaneTarget, r as capturePane, s as createSession, v as getManagedTmuxSocketName, z as sendEscapeKeyAsync } from "./tmux-l-yvNWhg.js";
9
+ import { a as getWorkspaceForIssue, o as init_resolver } from "./resolver-ChLZFIjB.js";
10
+ import { a as init_event_store, i as initEventStore } from "./event-store-BYOh686E.js";
11
+ import { c as getRuntimeBehavior, o as OHMYPI_BEHAVIOR, s as getHarnessBehavior } from "./src-tnFSfiXX.js";
12
+ import { a as readVerdictPreservationStatus, d as getOverdeckAgentStateSync, f as init_agent_state_sync, i as init_work_start_verdicts, l as resetWorkStartPipelineVerdicts, m as saveOverdeckAgentStateSync, o as refreshWorkStartReviewedAnchor, p as listOverdeckAgentStatesSync, r as registerPipelineTelemetryAgentReader, t as init_pipeline_agent_reader } from "./pipeline-agent-reader-CHugmNSx.js";
13
+ import { a as countAgentsByStatus, c as init_agents$2, g as logAgentLifecycleSync, h as init_persistent_logger } from "./agents-CkngXhQr.js";
14
+ import { n as ensureSessionContextBriefingFile, r as init_briefing_freshness } from "./briefing-freshness-CEoe3yWS.js";
15
+ import { a as getFlywheelActiveRunIdSync, c as init_control_settings, j as parseOhmypiSessionSync, k as init_ohmypi_parser } from "./control-settings-BkaVFRdm.js";
16
+ import { _ as init_tier_metrics, g as estimateFeedDeliveryTokens, v as recordTierFeedDelivery } from "./cost-sync-EFEkMYWz.js";
17
+ import { t as init_behavior } from "./behavior-Bg3yC8jC.js";
18
+ import { b as init_cliproxy, c as bridgeGeminiAuthToCliproxy, h as getCliproxyClientEnv, l as decodeJwtPayload$1, p as getCliproxyAuthDir, s as bridgeCodexAuthToCliproxySync, v as getCliproxyLogPath } from "./cliproxy-QTm2vdgx.js";
19
+ import { a as init_feature_registry_population, i as resetPostMergeState, n as init_post_merge_state, o as recordFeatureRegistryLifecycle } from "./post-merge-state-DGlkiVIO.js";
20
+ import { i as ensureInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-Ci0LxMIq.js";
21
+ import { A as init_conversations, B as reactivateConversationForSpawn, C as getConversationByName, G as setConversationClaudeSessionId, b as createConversation, z as normalizeHarness } from "./conversations-CPXMv_JQ.js";
22
+ import { n as readActiveDashboardBundleSync, t as init_active_dashboard_bundle } from "./active-dashboard-bundle-C-Ars7eG.js";
23
+ import { a as readCavemanVariant, n as init_workspace } from "./workspace-BWYfzfPV.js";
24
+ import { A as init_model_validation, C as generateLauncherScriptSync, D as getClaudeCodeLaunchModelSync, M as requireModelOverrideSync, N as shellQuoteModelIdSync, O as init_kimi_claude_routing, S as normalizeFlywheelRunId, _ as init_tmux_dedup, b as init_provenance, f as completeKeyedSubmit, i as init_auto_spawn_consent, j as normalizeModelOverrideSync, s as withAutoSpawnConsentClaim, w as init_launcher_generator, x as isOperatorStartedBy, y as sendKeysDedup } from "./auto-spawn-consent-CJeQM5e0.js";
25
+ import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-DX5BSnMH.js";
26
+ import { _ as tmuxKillSession, a as extractThreadIdFromRollout, c as initCodexHome, g as tmuxCreateSession, h as init_tmux_cli, l as init_codex, o as findLatestRollout, v as tmuxSessionExists } from "./codex-pffr8qaN.js";
27
+ import { i as prepareHarnessLaunch, r as init_harness_binary } from "./harness-binary-DnRGvN6T.js";
28
+ import { a as resolveMuseSessionPath, i as museSessionId, o as resolveMuseSessionPathSync, r as museDataHome, t as init_muse_session } from "./muse-session-CrSRuauJ.js";
29
+ import { n as createTrackerFromConfig, r as init_factory, t as createTracker } from "./factory-BC18rvHD.js";
30
+ import { c as init_stack_health, o as getWorkspaceStackHealth } from "./stack-health-Y8O3UuPe.js";
31
31
  import { i as readReviewStatusMap, n as init_review_status_source, r as isRoleTerminal, s as resolveCanonicalReviewStatus } from "./review-status-source-Jq0BXmn3.js";
32
- import { N as getProjectPanPaths, P as init_paths$1, h as readWorkspacePlanSync, s as init_io } from "./io-BCtZoXHo.js";
33
- import { a as getDispatchableItems, c as init_dag, o as groupItemsByWave, r as createActiveSlice } from "./dag-o-dUpw1L.js";
34
- import { c as generateFixedPointPromptSync, f as initHookSync, n as checkHookSync, p as init_hooks } from "./hooks-DJR1yR9w.js";
35
- import { a as init_git_utils, l as renderWorkspaceGitShowPromise } from "./git-utils-BdHk8y7g.js";
36
- import { n as init_workspace_anchor_drift, t as evaluateWorkspaceAnchorDrift } from "./workspace-anchor-drift-B_3kyyxJ.js";
37
- import { n as resolveHarness, t as init_harness_resolve } from "./harness-resolve-BplBEbwn.js";
38
- import { a as loadCloisterConfigSync, r as init_config$1 } from "./config-_qaa1UXH.js";
32
+ import { N as getProjectPanPaths, P as init_paths$1, h as readWorkspacePlanSync, s as init_io } from "./io-Cm4Sf_6P.js";
33
+ import { a as getDispatchableItems, c as init_dag, o as groupItemsByWave, r as createActiveSlice } from "./dag-Drz6Nrnf.js";
34
+ import { c as generateFixedPointPromptSync, f as initHookSync, n as checkHookSync, p as init_hooks } from "./hooks-lPAsUc20.js";
35
+ import { a as init_git_utils, l as renderWorkspaceGitShowPromise } from "./git-utils-D96xW28f.js";
36
+ import { n as init_workspace_anchor_drift, t as evaluateWorkspaceAnchorDrift } from "./workspace-anchor-drift-RJcMD1EV.js";
37
+ import { n as resolveHarness, t as init_harness_resolve } from "./harness-resolve-CzTFVZ5l.js";
38
+ import { a as loadCloisterConfigSync, r as init_config$1 } from "./config-B-MLcKSo.js";
39
39
  import { t as init_reap_terminal_sessions } from "./reap-terminal-sessions-BaDSNR-k.js";
40
- import { a as init_state_home, c as isStateMigrated } from "./state-home-DhsMqg8W.js";
41
- import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-fRofvhTN.js";
42
- import { d as resolveWorkspaceRepoRootsSync, i as init_project_repos } from "./project-repos-CsfvLtmr.js";
43
- import { a as init_lifecycle_io, t as appendContinueSessionEntryForIssue } from "./lifecycle-io-D7N0vQNj.js";
44
- import { a as init_tracker_config, t as getGitHubConfig } from "./tracker-config-tfAOWgng.js";
45
- import { r as init_swarm_readiness, t as analyzeSwarmReadiness } from "./swarm-readiness-LF8ZF_hc.js";
40
+ import { a as init_state_home, c as isStateMigrated } from "./state-home-CWu1dx9L.js";
41
+ import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-DWrqkc3x.js";
42
+ import { d as resolveWorkspaceRepoRootsSync, i as init_project_repos } from "./project-repos-J6jc42uD.js";
43
+ import { n as parseKimiSessionSync, t as init_kimi_parser } from "./kimi-parser-5VpMzIDq.js";
44
+ import { a as init_lifecycle_io, t as appendContinueSessionEntryForIssue } from "./lifecycle-io-CW__VX8s.js";
45
+ import { a as init_tracker_config, t as getGitHubConfig } from "./tracker-config-Qq_kEwYh.js";
46
+ import { r as init_swarm_readiness, t as analyzeSwarmReadiness } from "./swarm-readiness-BkVvnCdr.js";
46
47
  import { createRequire } from "node:module";
47
- import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
48
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
48
49
  import { Data, Duration, Effect, FileSystem } from "effect";
49
50
  import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, statfsSync, unlinkSync, writeFileSync } from "fs";
50
51
  import { basename as basename$1, dirname as dirname$1, join as join$1, resolve as resolve$1 } from "path";
51
52
  import { homedir } from "os";
52
- import { cpus as cpus$1, hostname, loadavg as loadavg$1, platform as platform$1, totalmem as totalmem$1 } from "node:os";
53
+ import { cpus as cpus$1, homedir as homedir$1, hostname, loadavg as loadavg$1, platform as platform$1, totalmem as totalmem$1 } from "node:os";
53
54
  import { chmodSync as chmodSync$1, closeSync as closeSync$1, constants, cpSync, createReadStream as createReadStream$1, existsSync as existsSync$1, fsyncSync, mkdirSync as mkdirSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1, writeSync } from "node:fs";
54
- import { chmod, lstat, mkdir, readFile, readdir, readlink, realpath, rmdir, stat, unlink, writeFile } from "node:fs/promises";
55
+ import { chmod, lstat, mkdir, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, unlink, writeFile } from "node:fs/promises";
55
56
  import { createHash, randomUUID } from "crypto";
56
57
  import { mkdir as mkdir$1, open as open$1, readFile as readFile$1, readdir as readdir$1, rename as rename$1, rm as rm$1, stat as stat$1, unlink as unlink$1, writeFile as writeFile$1 } from "fs/promises";
57
58
  import { ChildProcess } from "effect/unstable/process";
@@ -65,6 +66,7 @@ import { fileURLToPath } from "node:url";
65
66
  import { request } from "node:http";
66
67
  import { ChildProcessSpawner as ChildProcessSpawner$1 } from "effect/unstable/process/ChildProcessSpawner";
67
68
  import { layer } from "@effect/platform-node/NodeServices";
69
+ import { AsyncLocalStorage } from "node:async_hooks";
68
70
  //#region ../../lib/agent-runtime-mirror.ts
69
71
  /**
70
72
  * PAN-800 — in-process mirror of AgentStateService's canonical ref.
@@ -1416,6 +1418,7 @@ var init_provider_health = __esmMin((() => {
1416
1418
  async function getProviderEnvForModel(model, harness) {
1417
1419
  const provider = getProviderForModelSync(model);
1418
1420
  if (provider.name === "anthropic") return {};
1421
+ if (provider.name === "meta" && harness === "muse") return {};
1419
1422
  if (provider.name === "kimi" && harness === "kimi-code") return getProviderEnvSync(provider, "", harness);
1420
1423
  const { config } = loadConfigSync();
1421
1424
  if (provider.name === "openrouter") {
@@ -1444,7 +1447,7 @@ async function getProviderEnvForModel(model, harness) {
1444
1447
  }
1445
1448
  function getClaudeCodeContextPolicyForModel(model) {
1446
1449
  const provider = getProviderForModelSync(model);
1447
- if (provider.name === "anthropic") return {};
1450
+ if (provider.name === "anthropic") return hasModelCapabilitySync(model) ? { autoCompactWindow: getModelCapabilitySync(resolveModelIdSync(model)).contextWindow } : {};
1448
1451
  const resolvedModel = resolveModelIdSync(model);
1449
1452
  if (provider.name === "openrouter") {
1450
1453
  const openrouterWindow = OPENROUTER_MODEL_CONTEXT_WINDOWS[resolvedModel];
@@ -1464,11 +1467,10 @@ function getClaudeCodeContextPolicyForModel(model) {
1464
1467
  };
1465
1468
  if (!hasModelCapabilitySync(resolvedModel)) return {};
1466
1469
  const contextWindow = getModelCapabilitySync(resolvedModel).contextWindow;
1467
- if (KIMI_K3_MODELS.has(resolvedModel)) return {
1470
+ return {
1468
1471
  autoCompactWindow: contextWindow,
1469
1472
  maxContextTokens: contextWindow
1470
1473
  };
1471
- return { autoCompactWindow: contextWindow };
1472
1474
  }
1473
1475
  async function getProviderExportsForModel(model, harness) {
1474
1476
  const envVars = await getProviderEnvForModel(model, harness);
@@ -1543,7 +1545,7 @@ function determineModel(options = {}) {
1543
1545
  if ((options.role ?? "work") === "work" && !modelOverride && WORK_AGENT_BROKEN_MODELS.has(resolved)) throw new Error(`Resolved work model "${resolved}" is known-broken for work agents. Set roles.work.model to a working model in config.yaml, or pass an explicit --model override.`);
1544
1546
  return resolved;
1545
1547
  }
1546
- var CLI_PROXY_MODEL_ALIASES, PROVIDER_ENV_KEYS, GPT_56_MODELS, GPT_56_LONG_MODELS, KIMI_K3_MODELS, WORK_AGENT_BROKEN_MODELS;
1548
+ var CLI_PROXY_MODEL_ALIASES, PROVIDER_ENV_KEYS, GPT_56_MODELS, GPT_56_LONG_MODELS, WORK_AGENT_BROKEN_MODELS;
1547
1549
  var init_provider_env = __esmMin((() => {
1548
1550
  init_config_yaml();
1549
1551
  init_workspace();
@@ -1583,12 +1585,12 @@ var init_provider_env = __esmMin((() => {
1583
1585
  "QUANTUMLLAMA_API_KEY"
1584
1586
  ];
1585
1587
  GPT_56_MODELS = new Set([
1588
+ "gpt-6-astra",
1586
1589
  "gpt-5.6-sol",
1587
1590
  "gpt-5.6-terra",
1588
1591
  "gpt-5.6-luna"
1589
1592
  ]);
1590
1593
  GPT_56_LONG_MODELS = new Set(Object.keys(GPT56_LONG_CONTEXT_VARIANTS));
1591
- KIMI_K3_MODELS = new Set(["k3", "k3[1m]"]);
1592
1594
  WORK_AGENT_BROKEN_MODELS = /* @__PURE__ */ new Set([]);
1593
1595
  }));
1594
1596
  //#endregion
@@ -1697,34 +1699,406 @@ var init_claude_auth = __esmMin((() => {
1697
1699
  });
1698
1700
  }));
1699
1701
  //#endregion
1700
- //#region ../../lib/acp/context.ts
1701
- function materializeAcpContextFile(agentDir, workspace) {
1702
- const sections = [renderGlobalLayer("acp", isDevMode())];
1702
+ //#region ../../lib/context-layers/assemble.ts
1703
+ function removeMarkedProjectLayer(content) {
1704
+ const start = content.indexOf(PROJECT_LAYER_START);
1705
+ if (start < 0) return null;
1706
+ const markerEnd = content.indexOf("-->", start + 33);
1707
+ if (markerEnd < 0) return null;
1708
+ const marker = content.slice(start, markerEnd + 3);
1709
+ const lengthMatch = /\schars=(\d+)\s-->$/.exec(marker);
1710
+ if (!lengthMatch) return null;
1711
+ const projectEnd = markerEnd + 4 + Number(lengthMatch[1]);
1712
+ if (content[markerEnd + 3] !== "\n") return null;
1713
+ if (content.slice(projectEnd, projectEnd + 1 + 35) !== `\n<!-- overdeck:project-layer:end -->`) return null;
1714
+ const end = projectEnd + 1;
1715
+ let before = content.slice(0, start);
1716
+ let after = content.slice(end + 35);
1717
+ if (before.endsWith(SECTION_SEPARATOR$1) && after.startsWith(SECTION_SEPARATOR$1)) before = before.slice(0, -7);
1718
+ else if (before.endsWith(SECTION_SEPARATOR$1)) before = before.slice(0, -7);
1719
+ else if (after.startsWith(SECTION_SEPARATOR$1)) after = after.slice(7);
1720
+ return `${before}${after}`.trim();
1721
+ }
1722
+ /**
1723
+ * Remove a project layer embedded by pre-PAN-3779 workspace assembly.
1724
+ *
1725
+ * New bundles contain no project layer. Legacy marked bundles can be stripped
1726
+ * exactly. Ambiguous legacy bundles must be reviewed before launch; silently
1727
+ * truncating them would lose memory or status alongside stale project text.
1728
+ */
1729
+ function workspaceContextWithoutProjectLayer(content) {
1730
+ if (content.includes("<!-- overdeck:workspace-context:v2 harness-neutral -->")) return content.trim();
1731
+ const marked = removeMarkedProjectLayer(content);
1732
+ if (marked !== null) return marked;
1733
+ if (content.includes("<!-- overdeck:project-layer:start") || content.includes(SECTION_SEPARATOR$1)) throw new Error("Legacy workspace context has no valid project boundary. Review it with pan context edit --layer workspace and preserve its memory/status before rebuilding the workspace context.");
1734
+ return content.trim();
1735
+ }
1736
+ var SECTION_SEPARATOR$1, PROJECT_LAYER_START;
1737
+ var init_assemble = __esmMin((() => {
1738
+ SECTION_SEPARATOR$1 = "\n\n---\n\n";
1739
+ PROJECT_LAYER_START = "<!-- overdeck:project-layer:start";
1740
+ }));
1741
+ //#endregion
1742
+ //#region ../../lib/context-layers/harness.ts
1743
+ /**
1744
+ * Render a canonical layer body for one harness, or a union of harnesses
1745
+ * sharing one physical target file (e.g. AGENTS.md, read natively by both
1746
+ * ohmypi and kimi-code — PAN-1837 review fix: rendering AGENTS.md for
1747
+ * 'ohmypi' alone stripped every span authored only under
1748
+ * {{#harness:kimi-code}}, so Kimi-specific context never survived `pan
1749
+ * sync`). A span is kept when it is covered by no harness marker (always-on)
1750
+ * or by a marker naming any of the target harnesses; every marker is
1751
+ * stripped from the output. Runs of 3+ blank lines left by removed spans
1752
+ * collapse to a single blank line so output stays tidy.
1753
+ */
1754
+ function renderForHarness(content, harness) {
1755
+ const targets = new Set((Array.isArray(harness) ? harness : [harness]).map((h) => HARNESS_MARKERS[h]));
1756
+ const openCounts = /* @__PURE__ */ new Map();
1757
+ let out = "";
1758
+ let lastIndex = 0;
1759
+ const emit = (text) => {
1760
+ let covered = false;
1761
+ let anyOpen = false;
1762
+ for (const [name, count] of openCounts) if (count > 0) {
1763
+ anyOpen = true;
1764
+ if (targets.has(name)) covered = true;
1765
+ }
1766
+ if (!anyOpen || covered) out += text;
1767
+ };
1768
+ MARKER_RE.lastIndex = 0;
1769
+ let m;
1770
+ while ((m = MARKER_RE.exec(content)) !== null) {
1771
+ emit(content.slice(lastIndex, m.index));
1772
+ const [, kind, name] = m;
1773
+ const delta = kind === "#" ? 1 : -1;
1774
+ openCounts.set(name, (openCounts.get(name) ?? 0) + delta);
1775
+ lastIndex = m.index + m[0].length;
1776
+ }
1777
+ emit(content.slice(lastIndex));
1778
+ return out.replace(/\n{3,}/g, "\n\n");
1779
+ }
1780
+ /**
1781
+ * Lint a context-layer template for malformed harness blocks.
1782
+ *
1783
+ * Errors: an unclosed `{{#harness:x}}` or a stray `{{/harness:x}}` with no
1784
+ * matching open. Warnings: a marker naming a harness Overdeck has no
1785
+ * adapter for (allowed for forward compatibility, surfaced so typos —
1786
+ * `{{#harness:clade}}` — do not pass silently).
1787
+ */
1788
+ function validateTemplate(content) {
1789
+ const issues = [];
1790
+ const openCounts = /* @__PURE__ */ new Map();
1791
+ const seen = /* @__PURE__ */ new Set();
1792
+ MARKER_RE.lastIndex = 0;
1793
+ let m;
1794
+ while ((m = MARKER_RE.exec(content)) !== null) {
1795
+ const [, kind, name] = m;
1796
+ seen.add(name);
1797
+ if (kind === "#") openCounts.set(name, (openCounts.get(name) ?? 0) + 1);
1798
+ else {
1799
+ const next = (openCounts.get(name) ?? 0) - 1;
1800
+ openCounts.set(name, next);
1801
+ if (next < 0) issues.push({
1802
+ severity: "error",
1803
+ message: `stray closing marker {{/harness:${name}}} with no matching {{#harness:${name}}}`
1804
+ });
1805
+ }
1806
+ }
1807
+ for (const [name, count] of openCounts) if (count > 0) issues.push({
1808
+ severity: "error",
1809
+ message: `unclosed block: {{#harness:${name}}} opened ${count} time(s) without a matching {{/harness:${name}}}`
1810
+ });
1811
+ for (const name of seen) if (!KNOWN_HARNESS_MARKERS.has(name)) issues.push({
1812
+ severity: "warning",
1813
+ message: `unknown harness "${name}" — Overdeck ships adapters for: ${[...KNOWN_HARNESS_MARKERS].join(", ")}`
1814
+ });
1815
+ return {
1816
+ ok: !issues.some((i) => i.severity === "error"),
1817
+ issues
1818
+ };
1819
+ }
1820
+ var HARNESS_MARKERS, KNOWN_HARNESS_MARKERS, MARKER_RE;
1821
+ var init_harness = __esmMin((() => {
1822
+ HARNESS_MARKERS = {
1823
+ "claude-code": "claude",
1824
+ ohmypi: "ohmypi",
1825
+ codex: "codex",
1826
+ acp: "acp",
1827
+ opencode: "opencode",
1828
+ "kimi-code": "kimi-code",
1829
+ muse: "muse"
1830
+ };
1831
+ KNOWN_HARNESS_MARKERS = new Set([
1832
+ "claude",
1833
+ "pi",
1834
+ "ohmypi",
1835
+ "codex",
1836
+ "acp",
1837
+ "kimi-code",
1838
+ "opencode",
1839
+ "muse"
1840
+ ]);
1841
+ MARKER_RE = /\{\{([#/])harness:([a-zA-Z0-9_-]+)\}\}/g;
1842
+ }));
1843
+ //#endregion
1844
+ //#region ../../lib/context-layers/layers.ts
1845
+ /**
1846
+ * Context layer model (PAN-1201).
1847
+ *
1848
+ * Three layers of context compose at sync time:
1849
+ *
1850
+ * global — ~/.overdeck/context/global.md (+ global/{skills,agents}/)
1851
+ * Applies to every harness invocation, everywhere.
1852
+ * project — <projectRoot>/.overdeck/context/project.md
1853
+ * Applies when CWD is under a registered project. Committed.
1854
+ * workspace — <workspace>/.overdeck/context/workspace.md
1855
+ * Auto-assembled by Overdeck at spawn time. Gitignored.
1856
+ *
1857
+ * The global layer lives under ~/.overdeck (per-machine). Project and
1858
+ * Project and workspace context live outside the permanent state plane under
1859
+ * `.overdeck/`. Reads retain a `.pan/context/` compatibility fallback.
1860
+ */
1861
+ /** `~/.overdeck/context` — the global layer directory. */
1862
+ function globalContextDir() {
1863
+ return join$1(getOverdeckHome(), "context");
1864
+ }
1865
+ /** `~/.overdeck/context/global.md` — the global layer's canonical source. */
1866
+ function globalContextFile() {
1867
+ return join$1(globalContextDir(), "global.md");
1868
+ }
1869
+ /** `<projectRoot>/.overdeck/context` — a registered project's layer directory. */
1870
+ function projectContextDir(projectRoot) {
1871
+ return join$1(projectRoot, ".overdeck", "context");
1872
+ }
1873
+ /** `<projectRoot>/.overdeck/context/project.md` — a project's canonical source. */
1874
+ function projectContextFile(projectRoot) {
1875
+ return join$1(projectContextDir(projectRoot), "project.md");
1876
+ }
1877
+ function legacyProjectContextFile(projectRoot) {
1878
+ return join$1(projectRoot, ".pan", "context", "project.md");
1879
+ }
1880
+ function resolveProjectContextFile(projectRoot) {
1881
+ const canonical = projectContextFile(projectRoot);
1882
+ return existsSync(canonical) ? canonical : legacyProjectContextFile(projectRoot);
1883
+ }
1884
+ /** `<workspace>/.overdeck/context` — a workspace's layer directory. */
1885
+ function workspaceContextDir(workspacePath) {
1886
+ return join$1(workspacePath, ".overdeck", "context");
1887
+ }
1888
+ /** `<workspace>/.pan/context/workspace.md` — the auto-assembled bundle. */
1889
+ function workspaceContextFile(workspacePath) {
1890
+ return join$1(workspaceContextDir(workspacePath), "workspace.md");
1891
+ }
1892
+ function legacyWorkspaceContextFile(workspacePath) {
1893
+ return join$1(workspacePath, ".pan", "context", "workspace.md");
1894
+ }
1895
+ function resolveWorkspaceContextFile(workspacePath) {
1896
+ const canonical = workspaceContextFile(workspacePath);
1897
+ return existsSync(canonical) ? canonical : legacyWorkspaceContextFile(workspacePath);
1898
+ }
1899
+ /** `~/.overdeck/context/pi-global.md` — the rendered global layer for Pi. */
1900
+ function piGlobalContextFile() {
1901
+ return join$1(getOverdeckHome(), "context", "pi-global.md");
1902
+ }
1903
+ /** `~/.overdeck/context/claude-global.md` — launch-time global context for managed Claude sessions. */
1904
+ function claudeGlobalContextFile() {
1905
+ return join$1(getOverdeckHome(), "context", "claude-global.md");
1906
+ }
1907
+ /** `~/.overdeck/context/codex-global.md` — the rendered global layer for Codex. */
1908
+ function codexGlobalContextFile() {
1909
+ return join$1(getOverdeckHome(), "context", "codex-global.md");
1910
+ }
1911
+ /**
1912
+ * Ensure a project's layer dir exists with a stub `project.md`. Idempotent.
1913
+ * Returns true when a file was created. Called by `pan projects add`.
1914
+ */
1915
+ function ensureProjectLayer(projectRoot) {
1916
+ const file = projectContextFile(projectRoot);
1917
+ if (existsSync(file)) return false;
1918
+ mkdirSync(projectContextDir(projectRoot), { recursive: true });
1919
+ writeFileSync(file, PROJECT_STARTER, "utf-8");
1920
+ return true;
1921
+ }
1922
+ /** Read a layer's canonical markdown, or '' when the file does not exist. */
1923
+ function readLayerContent(file) {
1924
+ return existsSync(file) ? readFileSync(file, "utf-8") : "";
1925
+ }
1926
+ var PROJECT_STARTER;
1927
+ var init_layers = __esmMin((() => {
1928
+ init_paths();
1929
+ PROJECT_STARTER = `# Project Context
1930
+
1931
+ Context for this project specifically. \`pan sync\` renders it into the
1932
+ project's CLAUDE.md (and equivalents) when CWD is under this project.
1933
+
1934
+ This file is committed to the repo; \`workspace.md\` is not.
1935
+ `;
1936
+ }));
1937
+ //#endregion
1938
+ //#region ../../lib/context-layers/rules.ts
1939
+ /**
1940
+ * Bundled engineering rules (PAN-1201).
1941
+ *
1942
+ * Overdeck ships a small set of engineering rules under sync-sources/rules/.
1943
+ * Each rule carries a `scope:` frontmatter key:
1944
+ *
1945
+ * universal — distributed everywhere (relevant to anyone running agents)
1946
+ * dev — distributed only on a overdeck checkout (rules about
1947
+ * developing Overdeck itself)
1948
+ *
1949
+ * `pan sync` folds the applicable rules into the managed launch context.
1950
+ * Their `paths:` frontmatter (Claude Code path-scoping) is dropped on fold —
1951
+ * a folded rule is always-on.
1952
+ */
1953
+ /**
1954
+ * Parse a rule file into `{ scope, body }`. Rules with no frontmatter, or
1955
+ * frontmatter without a recognised `scope:`, default to `universal`.
1956
+ */
1957
+ function parseRule(name, raw) {
1958
+ const m = FRONTMATTER_RE.exec(raw);
1959
+ let scope = "universal";
1960
+ let body = raw;
1961
+ if (m) {
1962
+ body = raw.slice(m[0].length);
1963
+ const value = m[1].split(/\r?\n/).find((l) => /^\s*scope\s*:/.test(l))?.split(":")[1]?.trim().replace(/['"]/g, "");
1964
+ if (value === "dev" || value === "universal") scope = value;
1965
+ }
1966
+ return {
1967
+ name,
1968
+ scope,
1969
+ body: body.trim()
1970
+ };
1971
+ }
1972
+ /** Read every bundled rule from sync-sources/rules/, sorted by name. */
1973
+ function readBundledRules() {
1974
+ const dir = SYNC_SOURCES.rules;
1975
+ if (!existsSync(dir)) return [];
1976
+ return readdirSync(dir).filter((f) => f.endsWith(".md")).sort().map((f) => parseRule(f.replace(/\.md$/, ""), readFileSync(join$1(dir, f), "utf-8")));
1977
+ }
1978
+ /**
1979
+ * Rule names switched off via `context.rules: { <name>: false }` in
1980
+ * config.yaml. Absent keys and `true` mean the rule stays on, so a bundled
1981
+ * rule is default-on and the map only ever lists opt-outs.
1982
+ */
1983
+ function disabledRuleNames(context) {
1984
+ return new Set(Object.entries(context?.rules ?? {}).filter(([, enabled]) => enabled === false).map(([name]) => name));
1985
+ }
1986
+ /**
1987
+ * Render the applicable bundled rules into one managed instruction section.
1988
+ *
1989
+ * `includeDev` admits `scope: dev` rules — set it from `isDevMode()` so they
1990
+ * only fold in on a overdeck checkout. `disabled` names rules switched off in
1991
+ * config (see {@link disabledRuleNames}); callers that render for real
1992
+ * distribution or preview must pass it so both surfaces agree. Each rule body
1993
+ * is rendered for the target harness so any `{{#harness:*}}` blocks resolve.
1994
+ * Returns '' when no rules apply.
1995
+ */
1996
+ function renderBundledRules(harness, includeDev, disabled = /* @__PURE__ */ new Set()) {
1997
+ const sections = readBundledRules().filter((r) => (includeDev || r.scope === "universal") && !disabled.has(r.name)).map((r) => {
1998
+ const body = renderForHarness(r.body, harness).trim();
1999
+ return body ? `Source: ${join$1(SYNC_SOURCES.rules, `${r.name}.md`)} (scope: ${r.scope})\n\n${body}` : "";
2000
+ }).filter((s) => s.length > 0);
2001
+ if (sections.length === 0) return "";
2002
+ return `## Overdeck Engineering Rules\n\n${sections.join("\n\n")}`;
2003
+ }
2004
+ var FRONTMATTER_RE;
2005
+ var init_rules = __esmMin((() => {
2006
+ init_paths();
2007
+ init_harness();
2008
+ FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
2009
+ }));
2010
+ //#endregion
2011
+ //#region ../../lib/context-layers/render.ts
2012
+ /** Render machine context plus bundled rules for a managed harness launch. */
2013
+ function renderGlobalLayer(harness, includeDevRules) {
2014
+ const source = globalContextFile();
2015
+ const body = renderForHarness(readLayerContent(source), harness).trim();
2016
+ const sections = [body ? `## Machine context\n\nSource: ${source}\n\n${body}` : "", renderBundledRules(harness, includeDevRules, configDisabledRuleNames())].filter((section) => section.length > 0);
2017
+ return sections.length > 0 ? `# Overdeck managed instructions\n\nThis is a generated composition. Each section identifies its own source; the machine-context file is only one input.\n\n${sections.join("\n\n---\n\n")}` : "";
2018
+ }
2019
+ /** Resolve config-disabled bundled rules; a broken config disables nothing. */
2020
+ function configDisabledRuleNames() {
2021
+ try {
2022
+ return disabledRuleNames(loadConfigSync().config.context);
2023
+ } catch {
2024
+ return /* @__PURE__ */ new Set();
2025
+ }
2026
+ }
2027
+ /** Render one project's canonical source for a managed harness launch. */
2028
+ function renderProjectLayer(projectRoot, harness) {
2029
+ const source = resolveProjectContextFile(projectRoot);
2030
+ const raw = readLayerContent(source);
2031
+ if (raw.trim().length === 0) return "";
2032
+ const body = renderForHarness(raw, harness).trim();
2033
+ return body ? `## Project context\n\nSource: ${source}\n\n${body}` : "";
2034
+ }
2035
+ var init_render = __esmMin((() => {
2036
+ init_config_yaml();
2037
+ init_harness();
2038
+ init_rules();
2039
+ init_layers();
2040
+ }));
2041
+ //#endregion
2042
+ //#region ../../lib/context-layers/materialize.ts
2043
+ /** Build one harness-correct, Overdeck-owned context artifact for a launch. */
2044
+ /**
2045
+ * Compose global rules, the current project's canonical layer, and the
2046
+ * workspace-only portion of a saved workspace bundle for the launch harness.
2047
+ *
2048
+ * Workspace bundles created before PAN-3779 may contain a project section
2049
+ * rendered for whichever harness created the worktree (historically Claude).
2050
+ * Strip that structural section and render the canonical project source for
2051
+ * the current harness instead. This prevents stale Claude-filtered context
2052
+ * from leaking into Codex, OMP, ACP, or Kimi launches and avoids delivering
2053
+ * the project layer twice.
2054
+ */
2055
+ function renderManagedLaunchContext(workspace, harness) {
2056
+ const sections = [renderGlobalLayer(harness, isDevMode())];
1703
2057
  const project = findProjectByPathSync(workspace);
1704
- if (project) sections.push(renderProjectLayer(project.path, "acp"));
2058
+ if (project) sections.push(renderProjectLayer(project.path, harness));
1705
2059
  const workspaceFile = resolveWorkspaceContextFile(workspace);
1706
2060
  if (existsSync$1(workspaceFile)) {
1707
- const workspaceContent = readFileSync$1(workspaceFile, "utf8");
1708
- const workspaceOnly = project ? workspaceContextWithoutProjectLayer(workspaceContent) : workspaceContent;
1709
- sections.push(renderForHarness(workspaceOnly, "acp").trim());
2061
+ const body = renderForHarness(workspaceContextWithoutProjectLayer(readFileSync$1(workspaceFile, "utf8")), harness).trim();
2062
+ if (body) sections.push(`## Workspace context\n\nSource: ${workspaceFile}\n\n${body}`);
1710
2063
  }
1711
- const content = sections.filter((section) => section.trim().length > 0).join(SECTION_SEPARATOR);
1712
- const contextPath = join(agentDir, "acp-context.md");
1713
- mkdirSync$1(dirname(contextPath), { recursive: true });
1714
- writeFileSync$1(contextPath, `${content.trim()}\n`, { mode: 384 });
1715
- return contextPath;
2064
+ return sections.map((section) => section.trim()).filter((section) => section.length > 0).join(SECTION_SEPARATOR).trim();
2065
+ }
2066
+ /** Atomically materialize launch context at an explicitly Overdeck-owned path. */
2067
+ function materializeManagedLaunchContext(targetFile, workspace, harness) {
2068
+ const content = renderManagedLaunchContext(workspace, harness);
2069
+ mkdirSync$1(dirname(targetFile), { recursive: true });
2070
+ const tmp = `${targetFile}.${randomUUID$1()}.tmp`;
2071
+ writeFileSync$1(tmp, content.length > 0 ? `${content}\n` : "", { mode: 384 });
2072
+ renameSync$1(tmp, targetFile);
2073
+ return targetFile;
2074
+ }
2075
+ /**
2076
+ * Stable private artifact used by ordinary non-ACP launchers. The workspace
2077
+ * hash keeps paths short and avoids exposing project names in receipts.
2078
+ */
2079
+ function materializeSharedManagedLaunchContext(workspace, harness) {
2080
+ const workspaceHash = createHash$1("sha256").update(resolve(workspace)).digest("hex").slice(0, 16);
2081
+ return materializeManagedLaunchContext(join(getOverdeckHome(), "context", "launch", `${harness}-${workspaceHash}.md`), workspace, harness);
1716
2082
  }
1717
2083
  var SECTION_SEPARATOR;
1718
- var init_context = __esmMin((() => {
2084
+ var init_materialize = __esmMin((() => {
2085
+ init_paths();
2086
+ init_projects();
1719
2087
  init_assemble();
1720
2088
  init_harness();
1721
2089
  init_layers();
1722
2090
  init_render();
1723
- init_paths();
1724
- init_projects();
1725
2091
  SECTION_SEPARATOR = "\n\n---\n\n";
1726
2092
  }));
1727
2093
  //#endregion
2094
+ //#region ../../lib/acp/context.ts
2095
+ function materializeAcpContextFile(agentDir, workspace, harness = "acp") {
2096
+ return materializeManagedLaunchContext(join(agentDir, "acp-context.md"), workspace, harness);
2097
+ }
2098
+ var init_context = __esmMin((() => {
2099
+ init_materialize();
2100
+ }));
2101
+ //#endregion
1728
2102
  //#region ../../lib/runtimes/ohmypi-fifo.ts
1729
2103
  /**
1730
2104
  * oh-my-pi (omp) RPC named-pipe lifecycle (PAN-1989).
@@ -1769,7 +2143,7 @@ async function createOhmypiFifoPromise(agentId, home) {
1769
2143
  mode: 448
1770
2144
  });
1771
2145
  if (existsSync$1(paths.fifoPath)) unlinkSync$1(paths.fifoPath);
1772
- await execAsync$8(`mkfifo -m 600 ${shellQuote$1(paths.fifoPath)}`);
2146
+ await execAsync$9(`mkfifo -m 600 ${shellQuote$2(paths.fifoPath)}`);
1773
2147
  return paths.fifoPath;
1774
2148
  }
1775
2149
  /**
@@ -1807,14 +2181,14 @@ function writeOhmypiCommandSync(agentId, command, home) {
1807
2181
  closeSync$1(fd);
1808
2182
  }
1809
2183
  }
1810
- function shellQuote$1(s) {
2184
+ function shellQuote$2(s) {
1811
2185
  if (/^[A-Za-z0-9._/-]+$/.test(s)) return s;
1812
2186
  return `'${s.replace(/'/g, `'\\''`)}'`;
1813
2187
  }
1814
- var execAsync$8, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
2188
+ var execAsync$9, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
1815
2189
  var init_ohmypi_fifo = __esmMin((() => {
1816
2190
  init_paths();
1817
- execAsync$8 = promisify(exec);
2191
+ execAsync$9 = promisify(exec);
1818
2192
  OhmypiNotReady = class extends Error {
1819
2193
  code = "OHMYPI_NOT_READY";
1820
2194
  constructor(message) {
@@ -1849,6 +2223,28 @@ var init_pi_fifo = __esmMin((() => {
1849
2223
  Data.TaggedError("PiFifoError");
1850
2224
  }));
1851
2225
  //#endregion
2226
+ //#region ../../lib/context-layers/launch-sources.ts
2227
+ /** Resolve explicit context inputs without depending on agent lifecycle code. */
2228
+ async function claudeSystemPromptFiles(workspace, harness) {
2229
+ const effectiveHarness = harness ?? "claude-code";
2230
+ const behavior = getHarnessBehavior(effectiveHarness);
2231
+ if (behavior.contextLayerKind === "acp" || behavior.contextLayerKind === "opencode" || behavior.contextLayerKind === "muse") return [];
2232
+ const files = [];
2233
+ if (behavior.contextLayerKind === "codex") {
2234
+ const nativeOverride = join(homedir$1(), ".codex", "AGENTS.override.md");
2235
+ const nativeGlobal = existsSync$1(nativeOverride) ? nativeOverride : join(homedir$1(), ".codex", "AGENTS.md");
2236
+ if (existsSync$1(nativeGlobal)) files.push(nativeGlobal);
2237
+ }
2238
+ files.push(materializeSharedManagedLaunchContext(workspace, effectiveHarness));
2239
+ files.push(await ensureSessionContextBriefingFile());
2240
+ return files;
2241
+ }
2242
+ var init_launch_sources = __esmMin((() => {
2243
+ init_briefing_freshness();
2244
+ init_behavior();
2245
+ init_materialize();
2246
+ }));
2247
+ //#endregion
1852
2248
  //#region ../../lib/agents/runtime-command.ts
1853
2249
  /** Parse and flatten a role definition's mcpServers frontmatter. */
1854
2250
  function parseRoleMcpServersSync(definitionPath) {
@@ -1883,30 +2279,6 @@ async function writeLauncherScriptAtomic(launcherScript, content) {
1883
2279
  await writeFile$1(tmp, content, { mode: 493 });
1884
2280
  await rename$1(tmp, launcherScript);
1885
2281
  }
1886
- async function claudeSystemPromptFiles(workspace, harness) {
1887
- const behavior = getHarnessBehavior(harness);
1888
- if (behavior.contextLayerKind === "acp") return [];
1889
- const files = [];
1890
- const contextFile = workspaceContextFile(workspace);
1891
- try {
1892
- await stat$1(contextFile);
1893
- files.push(contextFile);
1894
- } catch (error) {
1895
- if (!isNodeNotFound(error)) throw error;
1896
- }
1897
- files.push(await ensureSessionContextBriefingFile());
1898
- if (behavior.contextLayerKind === "pi") {
1899
- const { piGlobalContextFile } = await import("./context-layers-Ds1MnEFI.js");
1900
- const globalFile = piGlobalContextFile();
1901
- if (existsSync(globalFile)) files.unshift(globalFile);
1902
- }
1903
- if (behavior.contextLayerKind === "codex") {
1904
- const { codexGlobalContextFile } = await import("./context-layers-Ds1MnEFI.js");
1905
- const globalFile = codexGlobalContextFile();
1906
- if (existsSync(globalFile)) files.unshift(globalFile);
1907
- }
1908
- return files;
1909
- }
1910
2282
  function isNodeNotFound(error) {
1911
2283
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
1912
2284
  }
@@ -1928,20 +2300,20 @@ async function hasAgentRuntimeInSubtree(rootPid, harness = "claude-code") {
1928
2300
  if (seen.has(pid) || !/^\d+$/.test(pid)) continue;
1929
2301
  seen.add(pid);
1930
2302
  try {
1931
- const { stdout: comm } = await execAsync$6(`ps -p ${pid} -o comm=`);
2303
+ const { stdout: comm } = await execAsync$7(`ps -p ${pid} -o comm=`);
1932
2304
  const name = comm.trim();
1933
- if (expectedProcessNames.has(name)) return true;
2305
+ if (expectedProcessNames.has(name) || harness === "muse" && name.startsWith("muse-bin-")) return true;
1934
2306
  } catch {
1935
2307
  continue;
1936
2308
  }
1937
2309
  try {
1938
- const { stdout: kids } = await execAsync$6(`pgrep -P ${pid}`);
2310
+ const { stdout: kids } = await execAsync$7(`pgrep -P ${pid}`);
1939
2311
  for (const kid of kids.trim().split("\n").filter(Boolean)) queue.push(kid);
1940
2312
  } catch {}
1941
2313
  }
1942
2314
  return false;
1943
2315
  }
1944
- async function getOhmypiLauncherFields(agentId, model) {
2316
+ async function getOhmypiLauncherFields(agentId, model, effort) {
1945
2317
  const paths = ohmypiFifoPaths(agentId);
1946
2318
  await mkdir$1(paths.agentDir, {
1947
2319
  recursive: true,
@@ -1951,39 +2323,45 @@ async function getOhmypiLauncherFields(agentId, model) {
1951
2323
  if (!ohmypiExtensionPath) throw new Error(`ohmypi extension not built. Run: npm run build\n(looked for dist/extensions/ohmypi.js and packages/ohmypi-extension/dist/index.js under ${packageRoot})`);
1952
2324
  return {
1953
2325
  harness: "ohmypi",
2326
+ piEffort: effort ?? "high",
1954
2327
  piExtensionPath: ohmypiExtensionPath,
1955
2328
  piFifoPath: await Effect.runPromise(createOhmypiFifo(agentId)),
1956
2329
  piSessionDir: paths.agentDir,
1957
2330
  model
1958
2331
  };
1959
2332
  }
1960
- function getAcpLauncherFields(agentId, model, workspace, binaryPath, _role) {
2333
+ function getAcpLauncherFields(agentId, model, workspace, binaryPath, _role, effort) {
1961
2334
  return {
1962
- harness: "acp",
2335
+ harness: model.startsWith("opencode/") || model.startsWith("opencode-go/") ? "opencode" : "acp",
1963
2336
  acpAgentId: agentId,
1964
2337
  acpProvider: getProviderForModelSync(model).name,
1965
2338
  acpWorkspace: workspace,
1966
2339
  acpBinaryPath: binaryPath,
1967
- acpContextFile: materializeAcpContextFile(getAgentDir(agentId), workspace),
2340
+ acpContextFile: materializeAcpContextFile(getAgentDir(agentId), workspace, model.startsWith("opencode/") || model.startsWith("opencode-go/") ? "opencode" : "acp"),
2341
+ ...effort ? { acpEffort: effort } : {},
1968
2342
  model,
1969
2343
  unsetProviderEnv: true
1970
2344
  };
1971
2345
  }
1972
- function getKimiCodeLauncherFields(model) {
2346
+ function getKimiCodeLauncherFields(model, effort) {
1973
2347
  return {
1974
2348
  harness: "kimi-code",
1975
2349
  kimiCodeModel: resolveKimiCodeModelAlias(model),
1976
2350
  kimiCodeYolo: true,
2351
+ ...effort ? { kimiCodeEffort: effort } : {},
1977
2352
  model,
1978
- unsetProviderEnv: true
2353
+ unsetProviderEnv: true,
2354
+ kimiContextDelivery: "initial-message"
1979
2355
  };
1980
2356
  }
1981
- function getCodexLauncherFields(agentId, model, workspacePath, role) {
1982
- const codexHome = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home");
2357
+ function getCodexLauncherFields(agentId, model, workspacePath, role, effort) {
2358
+ const codexHome = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home-v2");
1983
2359
  const codexConfig = loadConfigSync().config.codex;
1984
2360
  const codexPermMode = codexConfig?.permissionMode ?? "workspace";
1985
2361
  initCodexHome(codexHome, {
1986
2362
  trustedDir: workspacePath,
2363
+ model,
2364
+ effort,
1987
2365
  approvalPolicy: codexPermMode === "full-access" ? "never" : "on-request",
1988
2366
  sandboxMode: codexPermMode === "full-access" ? "danger-full-access" : codexPermMode === "read-only" ? "read-only" : "workspace-write",
1989
2367
  approvalsReviewer: codexPermMode === "auto-review" ? "auto_review" : void 0,
@@ -1992,6 +2370,7 @@ function getCodexLauncherFields(agentId, model, workspacePath, role) {
1992
2370
  return {
1993
2371
  harness: "codex",
1994
2372
  codexMode: codexConfig?.transport === "tui" ? "work-tui" : "app-server",
2373
+ codexEffort: effort ?? "high",
1995
2374
  codexHome,
1996
2375
  codexSessionDir: join$1(codexHome, "sessions"),
1997
2376
  model
@@ -2203,6 +2582,7 @@ async function waitForPromptReady(agentId, harness, timeoutSec = 30) {
2203
2582
  return true;
2204
2583
  }
2205
2584
  if (readinessKind === "codex-tui-prompt") return waitForCodexTuiReady(agentId, timeoutSec);
2585
+ if (readinessKind === "muse-tui-prompt") return waitForMuseTuiReady(agentId, timeoutSec);
2206
2586
  if (readinessKind === "kimi-session-signal") return waitForKimiCodeTuiReady(agentId, timeoutSec);
2207
2587
  return waitForReadySignal(agentId, timeoutSec);
2208
2588
  }
@@ -2230,7 +2610,7 @@ async function injectPiPromptTimeMemory(agentId, prompt) {
2230
2610
  agentRole: agentState.role ?? "work",
2231
2611
  agentHarness: agentState.harness ?? "claude-code"
2232
2612
  };
2233
- const { injectPromptTimeMemory } = await import("./injection-BWsgHvrL.js");
2613
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2234
2614
  const result = await injectPromptTimeMemory({
2235
2615
  prompt,
2236
2616
  identity,
@@ -2264,7 +2644,7 @@ async function injectPiConversationMemory(opts, prompt) {
2264
2644
  agentRole: "work",
2265
2645
  agentHarness: "ohmypi"
2266
2646
  };
2267
- const { injectPromptTimeMemory } = await import("./injection-BWsgHvrL.js");
2647
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2268
2648
  const result = await injectPromptTimeMemory({
2269
2649
  prompt,
2270
2650
  identity,
@@ -2312,8 +2692,7 @@ async function getProviderAuthMode(model) {
2312
2692
  *
2313
2693
  * The `harness` parameter (PAN-636) selects between Claude Code (default)
2314
2694
  * and ohmypi/Pi. When the harness uses the ohmypi RPC command, the function
2315
- * short-circuits to a
2316
- * `omp --mode rpc --model <model>` line; the launcher generator then layers
2695
+ * returns `omp --mode rpc --model <model>`; the launcher generator then layers
2317
2696
  * --session-dir, --extension, --no-context-files, and the stdin-from-fifo
2318
2697
  * redirect on top via generateLauncherScript. The `agentName` (PAN-982:
2319
2698
  * --name) and `agentDefinition` (PAN-982: --agent) parameters only apply to the
@@ -2321,11 +2700,12 @@ async function getProviderAuthMode(model) {
2321
2700
  */
2322
2701
  async function getAgentRuntimeBaseCommand(model, agentName, agentDefinition, harness = "claude-code", effort) {
2323
2702
  const validatedModel = requireModelOverrideSync(model);
2324
- const quotedModel = shellQuoteModelIdSync(validatedModel);
2703
+ const quotedModel = shellQuoteModelIdSync(harness === "claude-code" ? getClaudeCodeLaunchModelSync(validatedModel) : validatedModel);
2325
2704
  const behavior = getHarnessBehavior(harness);
2326
2705
  if (behavior.launchCommandKind === "ohmypi-rpc") return `omp --mode rpc --model ${quotedModel}`;
2327
2706
  if (behavior.launchCommandKind === "codex-work-tui") return `codex`;
2328
2707
  if (behavior.launchCommandKind === "acp-host") return "acp-host";
2708
+ if (behavior.launchCommandKind === "muse-tui") return "muse";
2329
2709
  if (behavior.launchCommandKind === "kimi-code-tui") return "kimi-code";
2330
2710
  if (process.env.OVERDECK_TEST_HARNESS_COMMAND) return process.env.OVERDECK_TEST_HARNESS_COMMAND;
2331
2711
  const provider = getProviderForModelSync(validatedModel);
@@ -2393,7 +2773,7 @@ function roleSystemPromptInjectionSync(definitionPath, explicitEffort) {
2393
2773
  mkdirSync(dir, { recursive: true });
2394
2774
  const stem = basename$1(definitionPath).replace(/\.md$/, "");
2395
2775
  const outPath = join$1(dir, `${stem}.md`);
2396
- writeFileSync(outPath, body);
2776
+ writeFileSync(outPath, `Source: ${abs}\n\n${body}`);
2397
2777
  const flags = [` --append-system-prompt-file '${outPath}'`];
2398
2778
  const effort = explicitEffort ?? (typeof frontmatter.effort === "string" ? frontmatter.effort : void 0);
2399
2779
  if (effort) flags.push(` --effort ${effort}`);
@@ -2416,7 +2796,7 @@ function roleSystemPromptInjectionSync(definitionPath, explicitEffort) {
2416
2796
  /** Build a Claude/ohmypi base command for role-based runs. */
2417
2797
  async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "claude-code", subRole, effort) {
2418
2798
  const validatedModel = requireModelOverrideSync(model);
2419
- const quotedModel = shellQuoteModelIdSync(validatedModel);
2799
+ const quotedModel = shellQuoteModelIdSync(harness === "claude-code" ? getClaudeCodeLaunchModelSync(validatedModel) : validatedModel);
2420
2800
  const behavior = getHarnessBehavior(harness);
2421
2801
  if (behavior.launchCommandKind === "ohmypi-rpc") {
2422
2802
  const mcpNames = Object.keys(parseRoleMcpServersSync(roleAgentDefinitionPath(role)));
@@ -2425,6 +2805,7 @@ async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "clau
2425
2805
  }
2426
2806
  if (behavior.launchCommandKind === "codex-work-tui") return `codex`;
2427
2807
  if (behavior.launchCommandKind === "acp-host") return "acp-host";
2808
+ if (behavior.launchCommandKind === "muse-tui") return "muse";
2428
2809
  if (behavior.launchCommandKind === "kimi-code-tui") return "kimi-code";
2429
2810
  if (process.env.OVERDECK_TEST_HARNESS_COMMAND) return process.env.OVERDECK_TEST_HARNESS_COMMAND;
2430
2811
  const provider = getProviderForModelSync(validatedModel);
@@ -2442,14 +2823,22 @@ async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "clau
2442
2823
  if (provider.name === "openai" && await getProviderAuthMode(validatedModel) === "subscription") return `claude${printFlag}${roleInject}${permissionFlags} --model ${shellQuoteModelIdSync(CLI_PROXY_MODEL_ALIASES[validatedModel] ?? validatedModel)}${effortFlag}${nameFlag}`;
2443
2824
  return `claude${printFlag}${roleInject}${permissionFlags} --model ${quotedModel}${effortFlag}${nameFlag}`;
2444
2825
  }
2445
- var import_dist, execAsync$6, missingRoleDefinitionWarnings, OHMYPI_AGENT_READY_TIMEOUT_SECONDS;
2826
+ async function waitForMuseTuiReady(agentId, timeoutSec) {
2827
+ const deadline = Date.now() + timeoutSec * 1e3;
2828
+ while (Date.now() < deadline) {
2829
+ if (!await Effect.runPromise(sessionExists(agentId))) return false;
2830
+ const pane = await Effect.runPromise(capturePane(agentId, 80));
2831
+ if (/^\s*⟩\s/m.test(pane) && /(?:muse-spark|Muse Code)/.test(pane)) return true;
2832
+ await new Promise((resolve) => setTimeout(resolve, 250));
2833
+ }
2834
+ return false;
2835
+ }
2836
+ var import_dist, execAsync$7, missingRoleDefinitionWarnings, OHMYPI_AGENT_READY_TIMEOUT_SECONDS;
2446
2837
  var init_runtime_command = __esmMin((() => {
2447
2838
  import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
2448
2839
  init_claude_permissions();
2449
2840
  init_config_yaml();
2450
- init_briefing_freshness();
2451
2841
  init_claude_auth();
2452
- init_layers();
2453
2842
  init_context();
2454
2843
  init_behavior();
2455
2844
  init_codex();
@@ -2463,11 +2852,42 @@ var init_runtime_command = __esmMin((() => {
2463
2852
  init_agent_state();
2464
2853
  init_identity();
2465
2854
  init_provider_env();
2466
- execAsync$6 = promisify$1(exec$1);
2855
+ init_kimi_claude_routing();
2856
+ init_launch_sources();
2857
+ execAsync$7 = promisify$1(exec$1);
2467
2858
  missingRoleDefinitionWarnings = /* @__PURE__ */ new Set();
2468
2859
  OHMYPI_AGENT_READY_TIMEOUT_SECONDS = 120;
2469
2860
  }));
2470
2861
  //#endregion
2862
+ //#region ../../lib/runtimes/muse-context.ts
2863
+ /** Materialize Overdeck-owned context for Muse's developer-message file input. */
2864
+ async function materializeMuseContext(agentId, workspace, roleFile) {
2865
+ museDataHome(agentId);
2866
+ const sections = [renderGlobalLayer("muse", isDevMode())];
2867
+ const project = findProjectByPathSync(workspace);
2868
+ if (project) sections.push(renderProjectLayer(project.path, "muse"));
2869
+ const workspaceLayer = await readFile(resolveWorkspaceContextFile(workspace), "utf8").catch((error) => {
2870
+ if (error.code === "ENOENT") return "";
2871
+ throw error;
2872
+ });
2873
+ sections.push(renderForHarness(project ? workspaceContextWithoutProjectLayer(workspaceLayer) : workspaceLayer, "muse"));
2874
+ if (roleFile) sections.push(await readFile(roleFile, "utf8"));
2875
+ const dir = join(getOverdeckHome(), "agents", agentId);
2876
+ await mkdir(dir, { recursive: true });
2877
+ const path = join(dir, "muse-context.md");
2878
+ await writeFile(path, sections.filter((section) => section.trim()).join("\n\n---\n\n"), { mode: 384 });
2879
+ return path;
2880
+ }
2881
+ var init_muse_context = __esmMin((() => {
2882
+ init_paths();
2883
+ init_projects();
2884
+ init_render();
2885
+ init_layers();
2886
+ init_harness();
2887
+ init_assemble();
2888
+ init_muse_session();
2889
+ }));
2890
+ //#endregion
2471
2891
  //#region ../../lib/agents/reopen-guard.ts
2472
2892
  function defaultDeps() {
2473
2893
  return {
@@ -2830,7 +3250,7 @@ async function transitionIssueToInReview(issueId, workspacePath) {
2830
3250
  async function buildAgentLaunchConfig(opts) {
2831
3251
  const model = requireModelOverrideSync(opts.model);
2832
3252
  try {
2833
- const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-CMS5Jab5.js");
3253
+ const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-ALboy05V.js");
2834
3254
  await Effect.runPromise(injectOverdeckInfraDeny(opts.workspace));
2835
3255
  } catch (err) {
2836
3256
  console.warn(`[agents] injectOverdeckInfraDeny failed for ${opts.agentId} (non-fatal): ${err instanceof Error ? err.message : err}`);
@@ -2845,11 +3265,19 @@ async function buildAgentLaunchConfig(opts) {
2845
3265
  }
2846
3266
  const providerExports = isAcp ? void 0 : await getProviderExportsForModel(model, opts.harness);
2847
3267
  const launchRole = opts.isPlanning ? "plan" : opts.role;
2848
- const piLauncherFields = behavior.usesRpcFifo ? await getOhmypiLauncherFields(opts.agentId, model) : {};
2849
- const codexLauncherFields = behavior.usesCodexHome ? getCodexLauncherFields(opts.agentId, model, opts.workspace, launchRole) : {};
2850
- const kimiCodeLauncherFields = behavior.launchCommandKind === "kimi-code-tui" ? getKimiCodeLauncherFields(model) : {};
3268
+ const piLauncherFields = behavior.usesRpcFifo ? await getOhmypiLauncherFields(opts.agentId, model, opts.effort) : {};
3269
+ const codexLauncherFields = behavior.usesCodexHome ? getCodexLauncherFields(opts.agentId, model, opts.workspace, launchRole, opts.effort) : {};
3270
+ const museSavedSession = opts.harness === "muse" && opts.spawnMode === "resume" ? await resolveMuseSessionPath(opts.agentId) : null;
3271
+ const museLauncherFields = opts.harness === "muse" ? {
3272
+ harness: "muse",
3273
+ museModel: model,
3274
+ museEffort: opts.effort,
3275
+ museContextFile: await materializeMuseContext(opts.agentId, opts.workspace, roleAgentDefinitionPath(launchRole)),
3276
+ museResumeSessionId: museSavedSession ? museSessionId(museSavedSession) : void 0
3277
+ } : {};
3278
+ const kimiCodeLauncherFields = behavior.launchCommandKind === "kimi-code-tui" ? getKimiCodeLauncherFields(model, opts.effort) : {};
2851
3279
  if (isAcp && !opts.harnessBinaryPath) throw new Error("ACP launch requires the executable path resolved by preflight");
2852
- const acpLauncherFields = isAcp ? getAcpLauncherFields(opts.agentId, model, opts.workspace, opts.harnessBinaryPath, launchRole) : {};
3280
+ const acpLauncherFields = isAcp ? getAcpLauncherFields(opts.agentId, model, opts.workspace, opts.harnessBinaryPath, launchRole, opts.effort) : {};
2853
3281
  if (opts.spawnMode === "resume" && opts.resumeSessionId) return {
2854
3282
  launcherContent: generateLauncherScriptSync({
2855
3283
  role: launchRole,
@@ -2871,7 +3299,8 @@ async function buildAgentLaunchConfig(opts) {
2871
3299
  ...piLauncherFields,
2872
3300
  ...codexLauncherFields,
2873
3301
  ...acpLauncherFields,
2874
- ...kimiCodeLauncherFields
3302
+ ...kimiCodeLauncherFields,
3303
+ ...museLauncherFields
2875
3304
  }),
2876
3305
  providerEnv
2877
3306
  };
@@ -2898,6 +3327,7 @@ async function buildAgentLaunchConfig(opts) {
2898
3327
  ...codexLauncherFields,
2899
3328
  ...acpLauncherFields,
2900
3329
  ...kimiCodeLauncherFields,
3330
+ ...museLauncherFields,
2901
3331
  ...opts.channelsBridgeMcpConfig ? {
2902
3332
  channelsBridgeMcpConfig: opts.channelsBridgeMcpConfig,
2903
3333
  channelsBridgeServerName: opts.channelsBridgeServerName ?? "overdeck-bridge"
@@ -2923,7 +3353,7 @@ async function retrieveSpawnTimeMemoryContext(input) {
2923
3353
  agentRole: input.role,
2924
3354
  agentHarness: input.harness
2925
3355
  };
2926
- const { injectPromptTimeMemory } = await import("./injection-BWsgHvrL.js");
3356
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2927
3357
  return (await injectPromptTimeMemory({
2928
3358
  prompt: input.prompt,
2929
3359
  identity,
@@ -3023,7 +3453,7 @@ async function assertWorkspaceStackHealthyForSpawn(issueId, role, allowHost = fa
3023
3453
  record.attempts += 1;
3024
3454
  spawnStackRebuildState.set(normalizedIssue, record);
3025
3455
  console.log(`[agents] Workspace stack for ${normalizedIssue} unhealthy (${details}) — rebuilding before spawn (attempt ${record.attempts}/${SPAWN_STACK_REBUILD_MAX_ATTEMPTS})`);
3026
- const { rebuildWorkspaceStack } = await import("./rebuild-stack-BcBVFJp3.js");
3456
+ const { rebuildWorkspaceStack } = await import("./rebuild-stack-DSQSgPCI.js");
3027
3457
  const result = await Effect.runPromise(rebuildWorkspaceStack(issueId, { onProgress: (m) => console.log(`[agents] ${normalizedIssue} stack rebuild: ${m}`) })).catch((err) => ({
3028
3458
  success: false,
3029
3459
  error: err instanceof Error ? err.message : String(err)
@@ -3042,6 +3472,8 @@ async function assertWorkspaceStackHealthyForSpawn(issueId, role, allowHost = fa
3042
3472
  }
3043
3473
  var spawnStackRebuildState, SPAWN_STACK_REBUILD_COOLDOWN_MS, SPAWN_STACK_REBUILD_MAX_ATTEMPTS;
3044
3474
  var init_spawn_prep = __esmMin((() => {
3475
+ init_muse_context();
3476
+ init_muse_session();
3045
3477
  init_activity_logger();
3046
3478
  init_claude_permissions();
3047
3479
  init_config();
@@ -3661,6 +4093,99 @@ var init_bridge_token = __esmMin((() => {
3661
4093
  BRIDGE_TOKEN_HEADER = "x-overdeck-bridge-token";
3662
4094
  }));
3663
4095
  //#endregion
4096
+ //#region ../../lib/runtimes/kimi-context-envelope.ts
4097
+ /** Explicit first-user-message context transport for the native Kimi CLI. */
4098
+ function receiptPath(agentId, overdeckHome = getOverdeckHome()) {
4099
+ return join(overdeckHome, "agents", agentId, "kimi-context-delivery.json");
4100
+ }
4101
+ function readReceipt(agentId, overdeckHome = getOverdeckHome()) {
4102
+ try {
4103
+ const parsed = JSON.parse(readFileSync$1(receiptPath(agentId, overdeckHome), "utf8"));
4104
+ if (parsed.version === 1 && parsed.sessions && typeof parsed.sessions === "object") return parsed;
4105
+ } catch {}
4106
+ return {
4107
+ version: 1,
4108
+ sessions: {}
4109
+ };
4110
+ }
4111
+ function readManagedKimiSessionId(agentId, overdeckHome = getOverdeckHome()) {
4112
+ try {
4113
+ return readFileSync$1(join(overdeckHome, "agents", agentId, "kimi-session-id"), "utf8").trim() || null;
4114
+ } catch {
4115
+ return null;
4116
+ }
4117
+ }
4118
+ /** Pure formatter: context first, original task afterward, with hard delimiters. */
4119
+ function buildKimiContextEnvelope(contextFiles, taskMessage) {
4120
+ const sections = contextFiles.flatMap((file) => {
4121
+ const content = readFileSync$1(file, "utf8").trim();
4122
+ return content ? [`## Context source: ${file}\n\n${content}`] : [];
4123
+ });
4124
+ if (sections.length === 0) throw new Error("Managed Kimi launch blocked: required launch context was empty or unreadable.");
4125
+ const context = sections.join("\n\n---\n\n");
4126
+ const sha256 = createHash$1("sha256").update(context).digest("hex");
4127
+ const envelope = [
4128
+ KIMI_CONTEXT_START,
4129
+ "Treat this delimited block as managed launch context for this session. Apply it throughout the session.",
4130
+ "",
4131
+ context,
4132
+ KIMI_CONTEXT_END
4133
+ ];
4134
+ if (taskMessage.length > 0) envelope.push("", KIMI_TASK_START, taskMessage, KIMI_TASK_END);
4135
+ return {
4136
+ message: envelope.join("\n"),
4137
+ sha256
4138
+ };
4139
+ }
4140
+ /**
4141
+ * Add context only if this exact native Kimi session has not received it.
4142
+ * A resume/recovery of the same session therefore keeps task messages clean;
4143
+ * a fresh session receives the envelope on its first visible user message.
4144
+ */
4145
+ async function prepareKimiMessage(agentId, workspace, taskMessage, options = {}) {
4146
+ const overdeckHome = options.overdeckHome ?? getOverdeckHome();
4147
+ const sessionId = options.sessionId ?? readManagedKimiSessionId(agentId, overdeckHome);
4148
+ if (!sessionId) throw new Error(`Managed Kimi message blocked for ${agentId}: captured kimi-session-id is missing.`);
4149
+ if (readReceipt(agentId, overdeckHome).sessions[sessionId]) return {
4150
+ message: taskMessage,
4151
+ sessionId,
4152
+ contextIncluded: false,
4153
+ overdeckHome
4154
+ };
4155
+ const envelope = buildKimiContextEnvelope(options.contextFiles ?? await claudeSystemPromptFiles(workspace, "kimi-code"), taskMessage);
4156
+ return {
4157
+ message: envelope.message,
4158
+ sessionId,
4159
+ contextIncluded: true,
4160
+ contextSha256: envelope.sha256,
4161
+ overdeckHome
4162
+ };
4163
+ }
4164
+ /** Persist only after the envelope delivery returned success. */
4165
+ function markKimiContextDelivered(agentId, prepared) {
4166
+ if (!prepared.contextIncluded || !prepared.contextSha256) return;
4167
+ const path = receiptPath(agentId, prepared.overdeckHome);
4168
+ const receipt = readReceipt(agentId, prepared.overdeckHome);
4169
+ if (receipt.sessions[prepared.sessionId]?.sha256 === prepared.contextSha256) return;
4170
+ receipt.sessions[prepared.sessionId] = {
4171
+ deliveredAt: (/* @__PURE__ */ new Date()).toISOString(),
4172
+ sha256: prepared.contextSha256
4173
+ };
4174
+ mkdirSync$1(dirname(path), { recursive: true });
4175
+ const tmp = `${path}.${randomUUID$1()}.tmp`;
4176
+ writeFileSync$1(tmp, `${JSON.stringify(receipt, null, 2)}\n`, { mode: 384 });
4177
+ renameSync$1(tmp, path);
4178
+ }
4179
+ var KIMI_CONTEXT_START, KIMI_CONTEXT_END, KIMI_TASK_START, KIMI_TASK_END;
4180
+ var init_kimi_context_envelope = __esmMin((() => {
4181
+ init_launch_sources();
4182
+ init_paths();
4183
+ KIMI_CONTEXT_START = "<overdeck-managed-context version=\"1\">";
4184
+ KIMI_CONTEXT_END = "</overdeck-managed-context>";
4185
+ KIMI_TASK_START = "<overdeck-user-task>";
4186
+ KIMI_TASK_END = "</overdeck-user-task>";
4187
+ }));
4188
+ //#endregion
3664
4189
  //#region ../../lib/channels/injection-budget.ts
3665
4190
  /** Echo window for one attempt: 2.5s floor + 100ms per KB, capped at 15s. */
3666
4191
  function echoConfirmTimeoutMs(contentLength) {
@@ -4021,16 +4546,27 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4021
4546
  } catch {
4022
4547
  resolvedMethod ??= "auto";
4023
4548
  }
4024
- const isAcpTarget = state?.harness === "acp";
4549
+ const isAcpTarget = state?.harness === "acp" || state?.harness === "opencode";
4025
4550
  if (isAcpTarget && resolvedMethod !== "auto") throw new Error(`MessageDeliveryFailed: ACP delivery failed for ${normalizedId} (${caller}): ACP requires authenticated host RPC delivery`);
4026
- if (dedupKey !== void 0) return deliverKeyedAgentMessage(normalizedId, message, caller, resolvedMethod ?? "auto", isAcpTarget, dedupKey);
4551
+ let preparedKimiMessage = opts.preparedKimiContext;
4552
+ if (preparedKimiMessage && preparedKimiMessage.message !== message) throw new Error(`Managed Kimi message blocked for ${normalizedId}: prepared envelope does not match the delivered message.`);
4553
+ const kimiContext = state?.harness === "kimi-code" && state.workspace ? { workspace: state.workspace } : opts.kimiContext;
4554
+ if (kimiContext && !preparedKimiMessage) {
4555
+ preparedKimiMessage = await prepareKimiMessage(normalizedId, kimiContext.workspace, message, { sessionId: kimiContext.sessionId });
4556
+ message = preparedKimiMessage.message;
4557
+ }
4558
+ const completeDelivery = (result) => {
4559
+ if (result.ok && !result.deduplicated && preparedKimiMessage) markKimiContextDelivered(normalizedId, preparedKimiMessage);
4560
+ return result;
4561
+ };
4562
+ if (dedupKey !== void 0) return completeDelivery(await deliverKeyedAgentMessage(normalizedId, message, caller, resolvedMethod ?? "auto", isAcpTarget, dedupKey));
4027
4563
  if (resolvedMethod === "tmux") {
4028
4564
  await assertTmuxTargetCanReceive(normalizedId, caller);
4029
4565
  await Effect.runPromise(sendKeys(normalizedId, message));
4030
- return {
4566
+ return completeDelivery({
4031
4567
  ok: true,
4032
4568
  path: "tmux"
4033
- };
4569
+ });
4034
4570
  }
4035
4571
  let appServerFailure;
4036
4572
  if (resolvedMethod === "auto" && !isAcpTarget) {
@@ -4050,10 +4586,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4050
4586
  path: "app-server",
4051
4587
  caller
4052
4588
  });
4053
- return {
4589
+ return completeDelivery({
4054
4590
  ok: true,
4055
4591
  path: "app-server"
4056
- };
4592
+ });
4057
4593
  } catch (err) {
4058
4594
  appServerFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4059
4595
  }
@@ -4077,10 +4613,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4077
4613
  path: "acp",
4078
4614
  caller
4079
4615
  });
4080
- return {
4616
+ return completeDelivery({
4081
4617
  ok: true,
4082
4618
  path: "acp"
4083
- };
4619
+ });
4084
4620
  } catch (err) {
4085
4621
  acpFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4086
4622
  }
@@ -4107,10 +4643,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4107
4643
  path: "supervisor",
4108
4644
  caller
4109
4645
  });
4110
- return {
4646
+ return completeDelivery({
4111
4647
  ok: true,
4112
4648
  path: "supervisor"
4113
- };
4649
+ });
4114
4650
  } catch (err) {
4115
4651
  supervisorFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4116
4652
  }
@@ -4134,10 +4670,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4134
4670
  caller,
4135
4671
  ...supervisorFailure ? { "pty-supervisor": supervisorFailure } : {}
4136
4672
  });
4137
- return {
4673
+ return completeDelivery({
4138
4674
  ok: true,
4139
4675
  path: "channels"
4140
- };
4676
+ });
4141
4677
  } catch (err) {
4142
4678
  channelFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4143
4679
  }
@@ -4154,18 +4690,18 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4154
4690
  });
4155
4691
  await assertTmuxTargetCanReceive(normalizedId, caller);
4156
4692
  await Effect.runPromise(sendKeys(normalizedId, message));
4157
- return {
4693
+ return completeDelivery({
4158
4694
  ok: true,
4159
4695
  path: "tmux",
4160
4696
  failure: channelFailure ?? supervisorFailure
4161
- };
4697
+ });
4162
4698
  }
4163
4699
  await assertTmuxTargetCanReceive(normalizedId, caller);
4164
4700
  await Effect.runPromise(sendKeys(normalizedId, message));
4165
- return {
4701
+ return completeDelivery({
4166
4702
  ok: true,
4167
4703
  path: "tmux"
4168
- };
4704
+ });
4169
4705
  }
4170
4706
  /**
4171
4707
  * Keyed delivery cascade (PAN-2997). Only two tiers may carry a keyed
@@ -4412,6 +4948,7 @@ async function setAgentDeliveryMethod(agentId, deliveryMethod) {
4412
4948
  var SocketPostStatusError, AmbiguousKeyedDeliveryError, RESUME_TRANSCRIPT_CONFIRM_TIMEOUT_MS, RESUME_TRANSCRIPT_CONFIRM_INTERVAL_MS;
4413
4949
  var init_delivery = __esmMin((() => {
4414
4950
  init_behavior();
4951
+ init_kimi_context_envelope();
4415
4952
  init_agents();
4416
4953
  init_runtime_state();
4417
4954
  init_tmux();
@@ -5398,7 +5935,7 @@ var init_runtime_census = __esmMin((() => {
5398
5935
  ]);
5399
5936
  runtimeCensusService = createRuntimeCensusService({
5400
5937
  listPanes: async () => {
5401
- const { listAllPaneRecords } = await import("./tmux-CYucGrTl.js");
5938
+ const { listAllPaneRecords } = await import("./tmux-aj9rscol.js");
5402
5939
  return Effect.runPromise(listAllPaneRecords());
5403
5940
  },
5404
5941
  readProcesses: readRuntimeProcessTable
@@ -5768,7 +6305,7 @@ async function killLauncherProcessAsync(agentId) {
5768
6305
  const launcherPath = join$1(AGENTS_DIR, agentId, "launcher.sh");
5769
6306
  let pidsOut;
5770
6307
  try {
5771
- const { stdout } = await execAsync$5(`pgrep -f ${JSON.stringify(launcherPath)}`);
6308
+ const { stdout } = await execAsync$6(`pgrep -f ${JSON.stringify(launcherPath)}`);
5772
6309
  pidsOut = stdout.trim();
5773
6310
  } catch {
5774
6311
  return;
@@ -5823,14 +6360,14 @@ function stopAgentSync(agentId, cause = "system") {
5823
6360
  lastActivity: (/* @__PURE__ */ new Date()).toISOString()
5824
6361
  });
5825
6362
  }
5826
- var execAsync$5, stopAgent;
6363
+ var execAsync$6, stopAgent;
5827
6364
  var init_termination = __esmMin((() => {
5828
6365
  init_agents();
5829
6366
  init_agent_runtime();
5830
6367
  init_paths();
5831
6368
  init_tmux();
5832
6369
  init_errors();
5833
- execAsync$5 = promisify$1(exec$1);
6370
+ execAsync$6 = promisify$1(exec$1);
5834
6371
  stopAgent = (agentId, cause = "system") => {
5835
6372
  const normalizedId = normalizeAgentId(agentId);
5836
6373
  return Effect.gen(function* () {
@@ -6012,7 +6549,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6012
6549
  if (expected.filter((root) => !existsSync$1(`${root.target}/.git`)).length === 0) {
6013
6550
  if ((await Promise.all(expected.map(async (root) => {
6014
6551
  try {
6015
- return (await execAsync$4("git branch --show-current", { cwd: root.target })).stdout.trim();
6552
+ return (await execAsync$5("git branch --show-current", { cwd: root.target })).stdout.trim();
6016
6553
  } catch {
6017
6554
  return "";
6018
6555
  }
@@ -6022,7 +6559,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6022
6559
  }
6023
6560
  await mkdir(slot.workspace, { recursive: true });
6024
6561
  try {
6025
- for (const root of expected) await execAsync$4(await gitBranchExists(root.dir, slot.branch) ? `git worktree add ${JSON.stringify(root.target)} ${JSON.stringify(slot.branch)}` : `git worktree add -b ${JSON.stringify(slot.branch)} ${JSON.stringify(root.target)} ${JSON.stringify(root.sourceBranch)}`, { cwd: root.dir });
6562
+ for (const root of expected) await execAsync$5(await gitBranchExists(root.dir, slot.branch) ? `git worktree add ${JSON.stringify(root.target)} ${JSON.stringify(slot.branch)}` : `git worktree add -b ${JSON.stringify(slot.branch)} ${JSON.stringify(root.target)} ${JSON.stringify(root.sourceBranch)}`, { cwd: root.dir });
6026
6563
  } catch (error) {
6027
6564
  throw new Error(`Could not create isolated polyrepo slot workspace ${slot.workspace}: ${error instanceof Error ? error.message : String(error)}`);
6028
6565
  }
@@ -6031,7 +6568,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6031
6568
  if (existsSync$1(slot.workspace)) {
6032
6569
  let branch = "";
6033
6570
  try {
6034
- branch = (await execAsync$4("git branch --show-current", { cwd: slot.workspace })).stdout.trim();
6571
+ branch = (await execAsync$5("git branch --show-current", { cwd: slot.workspace })).stdout.trim();
6035
6572
  } catch {}
6036
6573
  if (branch === slot.branch) return;
6037
6574
  throw new Error(`Registered slot workspace is incomplete at ${slot.workspace}; run pan swarm reset before dispatching it.`);
@@ -6041,11 +6578,11 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6041
6578
  if (branchExists && !await gitRefsEqual(baseWorkspace, slot.branch, repoRoots[0].sourceBranch)) throw new Error(`Registered slot branch ${slot.branch} is not at ${repoRoots[0].sourceBranch}; refusing to reuse stale work.`);
6042
6579
  const target = JSON.stringify(slot.workspace);
6043
6580
  const branch = JSON.stringify(slot.branch);
6044
- await execAsync$4(branchExists ? `git worktree add ${target} ${branch}` : `git worktree add -b ${branch} ${target} ${JSON.stringify(repoRoots[0].sourceBranch)}`, { cwd: baseWorkspace });
6581
+ await execAsync$5(branchExists ? `git worktree add ${target} ${branch}` : `git worktree add -b ${branch} ${target} ${JSON.stringify(repoRoots[0].sourceBranch)}`, { cwd: baseWorkspace });
6045
6582
  }
6046
6583
  async function gitBranchExists(workspace, branch) {
6047
6584
  try {
6048
- await execAsync$4(`git show-ref --verify --quiet ${JSON.stringify(`refs/heads/${branch}`)}`, { cwd: workspace });
6585
+ await execAsync$5(`git show-ref --verify --quiet ${JSON.stringify(`refs/heads/${branch}`)}`, { cwd: workspace });
6049
6586
  return true;
6050
6587
  } catch {
6051
6588
  return false;
@@ -6053,20 +6590,625 @@ async function gitBranchExists(workspace, branch) {
6053
6590
  }
6054
6591
  async function gitRefsEqual(workspace, left, right) {
6055
6592
  try {
6056
- const [leftResult, rightResult] = await Promise.all([execAsync$4(`git rev-parse ${JSON.stringify(left)}`, { cwd: workspace }), execAsync$4(`git rev-parse ${JSON.stringify(right)}`, { cwd: workspace })]);
6593
+ const [leftResult, rightResult] = await Promise.all([execAsync$5(`git rev-parse ${JSON.stringify(left)}`, { cwd: workspace }), execAsync$5(`git rev-parse ${JSON.stringify(right)}`, { cwd: workspace })]);
6057
6594
  return leftResult.stdout.trim() === rightResult.stdout.trim();
6058
6595
  } catch {
6059
6596
  return false;
6060
6597
  }
6061
6598
  }
6062
- var execAsync$4;
6599
+ var execAsync$5;
6063
6600
  var init_registered_slot_spawn = __esmMin((() => {
6064
6601
  init_dag();
6065
6602
  init_io();
6066
6603
  init_project_repos();
6604
+ execAsync$5 = promisify(exec);
6605
+ }));
6606
+ //#endregion
6607
+ //#region ../../lib/runtimes/kimi-code.ts
6608
+ /**
6609
+ * Kimi Code CLI runtime adapter (PAN-1837).
6610
+ *
6611
+ * Native TUI — not ACP. Kimi writes its own session tree at
6612
+ * `<kimiHome>/sessions/<workDirKey>/<sessionId>/agents/main/wire.jsonl`,
6613
+ * where `workDirKey = wd_<basename(workDir)>_<sha256(workDir).hex[:12]>`
6614
+ * (verified empirically against installed kimi 0.29.2, wi-fixture/D2 — Kimi
6615
+ * does not expose this derivation directly). Kimi generates its own session
6616
+ * id; it cannot be preset via a launch flag (D2/erratum E1: no --session, no
6617
+ * --work-dir). The id is captured post-launch as the session directory that
6618
+ * newly appears under the workspace's bucket, then persisted at
6619
+ * `~/.overdeck/agents/<id>/kimi-session-id` (mirrors codex's thread-id file)
6620
+ * so later introspection calls avoid re-walking the bucket.
6621
+ *
6622
+ * Delivery: PTY supervisor is primary (KIMI_CODE_BEHAVIOR.supportsPtySupervisor
6623
+ * is true, same as claude-code). sendMessage delegates to the existing generic
6624
+ * deliverAgentMessage() cascade (supervisor -> channels -> async tmux paste)
6625
+ * rather than re-implementing that tiering here — deliverAgentMessage already
6626
+ * dispatches on socket existence, not a hardcoded harness list, so kimi-code
6627
+ * flows through it for free once its PTY supervisor socket exists.
6628
+ *
6629
+ * getTokenUsage/getSessionCost delegate to wi8b's parseKimiSessionSync,
6630
+ * which sums every usage.record in the wire.jsonl — Kimi's own server-side
6631
+ * context cache accounting.
6632
+ */
6633
+ /**
6634
+ * Compute Kimi's on-disk workDirKey bucket name for a working directory.
6635
+ * Verified against `wd_kimi-fixture-scratch_ef33f89ad7cf` (workDir
6636
+ * `/tmp/kimi-fixture-scratch`) and several pre-existing real sessions on the
6637
+ * machine that produced the wi-fixture capture (e.g.
6638
+ * `wd_overdeck_b289e7acb782`, `wd_feature-pan-2858_1dc66dc5021d`).
6639
+ */
6640
+ function kimiWorkDirKey(workDir) {
6641
+ const hash = createHash$1("sha256").update(workDir).digest("hex").slice(0, 12);
6642
+ return `wd_${basename(workDir)}_${hash}`;
6643
+ }
6644
+ /** Absolute path to the session bucket Kimi writes for a working directory. */
6645
+ function kimiSessionsRoot(kimiHome, workDir) {
6646
+ return join(kimiHome, "sessions", kimiWorkDirKey(workDir));
6647
+ }
6648
+ /**
6649
+ * Locate wire.jsonl for a specific captured session id under the workspace's
6650
+ * bucket. Falls back to the newest session directory when the captured id's
6651
+ * wire.jsonl is missing (e.g. never captured, or the id file is stale).
6652
+ */
6653
+ function findKimiWirePath(kimiHome, workspace, sessionId) {
6654
+ if (sessionId) {
6655
+ const candidate = join(kimiSessionsRoot(kimiHome, workspace), sessionId, "agents", "main", "wire.jsonl");
6656
+ if (existsSync$1(candidate)) return candidate;
6657
+ }
6658
+ return findLatestKimiSession(kimiHome, workspace);
6659
+ }
6660
+ /** Fallback: the newest session directory by wire.jsonl mtime under the workspace's bucket. */
6661
+ function findLatestKimiSession(kimiHome, workspace) {
6662
+ const bucketDir = kimiSessionsRoot(kimiHome, workspace);
6663
+ let entries;
6664
+ try {
6665
+ entries = readdirSync$1(bucketDir);
6666
+ } catch {
6667
+ return null;
6668
+ }
6669
+ let newest = null;
6670
+ for (const entry of entries) {
6671
+ const wirePath = join(bucketDir, entry, "agents", "main", "wire.jsonl");
6672
+ let mtimeMs;
6673
+ try {
6674
+ mtimeMs = statSync$1(wirePath).mtimeMs;
6675
+ } catch {
6676
+ continue;
6677
+ }
6678
+ if (!newest || mtimeMs > newest.mtimeMs) newest = {
6679
+ path: wirePath,
6680
+ mtimeMs
6681
+ };
6682
+ }
6683
+ return newest?.path ?? null;
6684
+ }
6685
+ /**
6686
+ * Async twin of {@link findKimiWirePath} (PAN-1837 review fix, P2). The
6687
+ * dashboard's transcript resolver runs on the event loop and Command Deck
6688
+ * polling re-resolves the same session repeatedly, so the sync
6689
+ * readdirSync/statSync walk here would block the loop on every poll as a
6690
+ * session's history grows. Runtime-side sync callers (kill/spawn lifecycle)
6691
+ * keep using the sync versions above — this pair exists only for dashboard
6692
+ * routes, per the runtime's own documented sync contract.
6693
+ */
6694
+ async function findKimiWirePathAsync(kimiHome, workspace, sessionId) {
6695
+ if (sessionId) {
6696
+ const candidate = join(kimiSessionsRoot(kimiHome, workspace), sessionId, "agents", "main", "wire.jsonl");
6697
+ try {
6698
+ await stat(candidate);
6699
+ return candidate;
6700
+ } catch {}
6701
+ }
6702
+ return findLatestKimiSessionAsync(kimiHome, workspace);
6703
+ }
6704
+ /** Async twin of {@link findLatestKimiSession} — see {@link findKimiWirePathAsync}. */
6705
+ async function findLatestKimiSessionAsync(kimiHome, workspace) {
6706
+ const bucketDir = kimiSessionsRoot(kimiHome, workspace);
6707
+ let entries;
6708
+ try {
6709
+ entries = await readdir(bucketDir);
6710
+ } catch {
6711
+ return null;
6712
+ }
6713
+ let newest = null;
6714
+ for (const entry of entries) {
6715
+ const wirePath = join(bucketDir, entry, "agents", "main", "wire.jsonl");
6716
+ let mtimeMs;
6717
+ try {
6718
+ mtimeMs = (await stat(wirePath)).mtimeMs;
6719
+ } catch {
6720
+ continue;
6721
+ }
6722
+ if (!newest || mtimeMs > newest.mtimeMs) newest = {
6723
+ path: wirePath,
6724
+ mtimeMs
6725
+ };
6726
+ }
6727
+ return newest?.path ?? null;
6728
+ }
6729
+ function kimiHomeDefault() {
6730
+ return join(homedir$1(), ".kimi-code");
6731
+ }
6732
+ /**
6733
+ * Poll a workspace's Kimi session bucket for a directory that did not exist
6734
+ * in `existingBefore`, returning the newest such directory's name (the
6735
+ * session id) once one appears. Standalone so both KimiCodeRuntimeSync.spawnAgent
6736
+ * and the production `pan start` spawn path (spawn-prep.ts, which builds its
6737
+ * own launcher/tmux session rather than delegating to this class) can capture
6738
+ * the session id the same way — mirroring codex's standalone
6739
+ * waitForCodexRollout/extractThreadIdFromRollout pair.
6740
+ */
6741
+ async function waitForNewKimiSession(kimiHome, workspace, existingBefore, timeoutMs = SPAWN_READY_TIMEOUT_MS$1) {
6742
+ const bucketDir = kimiSessionsRoot(kimiHome, workspace);
6743
+ const deadline = Date.now() + timeoutMs;
6744
+ while (Date.now() < deadline) {
6745
+ let entries = [];
6746
+ try {
6747
+ entries = readdirSync$1(bucketDir);
6748
+ } catch {
6749
+ entries = [];
6750
+ }
6751
+ const fresh = entries.filter((entry) => !existingBefore.has(entry));
6752
+ if (fresh.length > 0) {
6753
+ let newest = null;
6754
+ for (const name of fresh) {
6755
+ let mtimeMs;
6756
+ try {
6757
+ mtimeMs = statSync$1(join(bucketDir, name)).mtimeMs;
6758
+ } catch {
6759
+ continue;
6760
+ }
6761
+ if (!newest || mtimeMs > newest.mtimeMs) newest = {
6762
+ name,
6763
+ mtimeMs
6764
+ };
6765
+ }
6766
+ if (newest) return newest.name;
6767
+ }
6768
+ await delay(POLL_INTERVAL_MS);
6769
+ }
6770
+ return null;
6771
+ }
6772
+ /**
6773
+ * Async twin of {@link waitForNewKimiSession} (PAN-1837 review fix, P2). The
6774
+ * conversation-spawn capture task runs on the dashboard event loop, so its
6775
+ * 250ms poll loop must not block on readdirSync/statSync — runtime-side sync
6776
+ * callers (kill/spawn lifecycle) keep the sync version above.
6777
+ */
6778
+ async function waitForNewKimiSessionAsync(kimiHome, workspace, existingBefore, timeoutMs = SPAWN_READY_TIMEOUT_MS$1) {
6779
+ const bucketDir = kimiSessionsRoot(kimiHome, workspace);
6780
+ const deadline = Date.now() + timeoutMs;
6781
+ while (Date.now() < deadline) {
6782
+ let entries = [];
6783
+ try {
6784
+ entries = await readdir(bucketDir);
6785
+ } catch {
6786
+ entries = [];
6787
+ }
6788
+ const fresh = entries.filter((entry) => !existingBefore.has(entry));
6789
+ if (fresh.length > 0) {
6790
+ let newest = null;
6791
+ for (const name of fresh) {
6792
+ let mtimeMs;
6793
+ try {
6794
+ mtimeMs = (await stat(join(bucketDir, name))).mtimeMs;
6795
+ } catch {
6796
+ continue;
6797
+ }
6798
+ if (!newest || mtimeMs > newest.mtimeMs) newest = {
6799
+ name,
6800
+ mtimeMs
6801
+ };
6802
+ }
6803
+ if (newest) return newest.name;
6804
+ }
6805
+ await delay(POLL_INTERVAL_MS);
6806
+ }
6807
+ return null;
6808
+ }
6809
+ /** Persist the captured session id to `<overdeckHome>/agents/<id>/kimi-session-id` (mirrors codex's thread-id file). */
6810
+ function writeKimiSessionId(agentId, sessionId, overdeckHome = getOverdeckHome()) {
6811
+ writeFileSync$1(join(overdeckHome, "agents", agentId, "kimi-session-id"), sessionId, "utf-8");
6812
+ }
6813
+ /** Deterministic, filesystem-safe lock path for a Kimi session bucket. */
6814
+ function kimiCaptureLockPath(bucketKey, overdeckHome = getOverdeckHome()) {
6815
+ return join(overdeckHome, "locks", "kimi-capture", `${createHash$1("sha256").update(bucketKey).digest("hex").slice(0, 24)}.lock`);
6816
+ }
6817
+ async function readKimiCaptureLockOwner(lockPath) {
6818
+ try {
6819
+ const parsed = JSON.parse(await readFile(join(lockPath, "owner.json"), "utf8"));
6820
+ if (typeof parsed.pid !== "number" || !Number.isInteger(parsed.pid) || parsed.pid <= 0) return {};
6821
+ return parsed;
6822
+ } catch {
6823
+ return {};
6824
+ }
6825
+ }
6826
+ /**
6827
+ * True once the lock directory itself (not owner.json) is older than the
6828
+ * stale-age bound. mkdir sets this directory's mtime at creation, and it is
6829
+ * never touched again once owner.json (a fresh directory entry) — if ever
6830
+ * written — settles, so this is trustworthy even when owner.json itself
6831
+ * never made it to disk.
6832
+ */
6833
+ async function isKimiCaptureLockDirStale(lockPath) {
6834
+ try {
6835
+ const dirStat = await stat(lockPath);
6836
+ return Date.now() - dirStat.mtimeMs > KIMI_CAPTURE_LOCK_STALE_AGE_MS;
6837
+ } catch {
6838
+ return true;
6839
+ }
6840
+ }
6841
+ async function acquireKimiCaptureLock(lockPath) {
6842
+ await mkdir(dirname(lockPath), {
6843
+ recursive: true,
6844
+ mode: 448
6845
+ });
6846
+ const deadline = Date.now() + KIMI_CAPTURE_LOCK_MAX_WAIT_MS;
6847
+ for (;;) {
6848
+ try {
6849
+ await mkdir(lockPath, { mode: 448 });
6850
+ const owner = {
6851
+ pid: process.pid,
6852
+ acquiredAt: (/* @__PURE__ */ new Date()).toISOString()
6853
+ };
6854
+ const tmpPath = join(lockPath, `owner.${process.pid}.${Date.now()}.tmp`);
6855
+ try {
6856
+ await writeFile(tmpPath, JSON.stringify(owner, null, 2), "utf8");
6857
+ await rename(tmpPath, join(lockPath, "owner.json"));
6858
+ } catch (error) {
6859
+ try {
6860
+ await rm(tmpPath, { force: true });
6861
+ } catch {}
6862
+ try {
6863
+ await rm(lockPath, {
6864
+ recursive: true,
6865
+ force: true
6866
+ });
6867
+ } catch {}
6868
+ throw error;
6869
+ }
6870
+ return;
6871
+ } catch (error) {
6872
+ if (error.code !== "EEXIST") throw error;
6873
+ const owner = await readKimiCaptureLockOwner(lockPath);
6874
+ if (owner.pid !== void 0) {
6875
+ if (isPidDead(owner.pid)) {
6876
+ await rm(lockPath, {
6877
+ recursive: true,
6878
+ force: true
6879
+ });
6880
+ continue;
6881
+ }
6882
+ } else if (await isKimiCaptureLockDirStale(lockPath)) {
6883
+ await rm(lockPath, {
6884
+ recursive: true,
6885
+ force: true
6886
+ });
6887
+ continue;
6888
+ }
6889
+ }
6890
+ if (Date.now() >= deadline) throw new KimiCaptureLockTimeoutError(lockPath, KIMI_CAPTURE_LOCK_MAX_WAIT_MS);
6891
+ await delay(KIMI_CAPTURE_LOCK_POLL_MS);
6892
+ }
6893
+ }
6894
+ async function releaseKimiCaptureLock(lockPath) {
6895
+ await rm(lockPath, {
6896
+ recursive: true,
6897
+ force: true
6898
+ });
6899
+ }
6900
+ async function withKimiSessionCaptureLock(kimiHome, workspace, fn, overdeckHome) {
6901
+ const lockPath = kimiCaptureLockPath(kimiSessionsRoot(kimiHome, workspace), overdeckHome);
6902
+ await acquireKimiCaptureLock(lockPath);
6903
+ try {
6904
+ return await fn();
6905
+ } finally {
6906
+ await releaseKimiCaptureLock(lockPath);
6907
+ }
6908
+ }
6909
+ /**
6910
+ * Launch one managed native Kimi session and persist the identity required by
6911
+ * the first-message context guard before any caller can deliver a prompt.
6912
+ * Fresh launches snapshot and capture a newly-created native session under the
6913
+ * per-workspace lock. Resumes pass `-S` at launcher construction time, reuse
6914
+ * that exact identity, and therefore do not wait for a new directory.
6915
+ */
6916
+ async function launchAndCaptureManagedKimiSession(options) {
6917
+ const kimiHome = options.kimiHome ?? join(homedir$1(), ".kimi-code");
6918
+ return withKimiSessionCaptureLock(kimiHome, options.workspace, async () => {
6919
+ if (options.resumeSessionId) {
6920
+ await options.launch();
6921
+ writeKimiSessionId(options.agentId, options.resumeSessionId, options.overdeckHome);
6922
+ return options.resumeSessionId;
6923
+ }
6924
+ let existingBefore = /* @__PURE__ */ new Set();
6925
+ try {
6926
+ existingBefore = new Set(await readdir(kimiSessionsRoot(kimiHome, options.workspace)));
6927
+ } catch {}
6928
+ await options.launch();
6929
+ const sessionId = await waitForNewKimiSessionAsync(kimiHome, options.workspace, existingBefore, options.timeoutMs);
6930
+ if (!sessionId) throw new KimiCodeSpawnTimeout(options.agentId);
6931
+ writeKimiSessionId(options.agentId, sessionId, options.overdeckHome);
6932
+ return sessionId;
6933
+ }, options.overdeckHome);
6934
+ }
6935
+ function delay(ms) {
6936
+ return new Promise((resolve) => setTimeout(resolve, ms));
6937
+ }
6938
+ function shellQuote$1(value) {
6939
+ return `'${value.replace(/'/g, `'\\''`)}'`;
6940
+ }
6941
+ async function pollUntilSessionGone$1(agentId, timeoutMs) {
6942
+ const deadline = Date.now() + timeoutMs;
6943
+ while (Date.now() < deadline) {
6944
+ if (!await tmuxSessionExists(agentId)) return true;
6945
+ await delay(POLL_INTERVAL_MS);
6946
+ }
6947
+ return false;
6948
+ }
6949
+ function createKimiCodeRuntimeSync(options = {}) {
6950
+ return new KimiCodeRuntimeSync(options);
6951
+ }
6952
+ var execAsync$4, SPAWN_READY_TIMEOUT_MS$1, POLL_INTERVAL_MS, KimiCodeSpawnTimeout, KIMI_CAPTURE_LOCK_POLL_MS, KIMI_CAPTURE_LOCK_MAX_WAIT_MS, KIMI_CAPTURE_LOCK_STALE_AGE_MS, KimiCaptureLockTimeoutError, KimiCodeRuntimeSync;
6953
+ var init_kimi_code = __esmMin((() => {
6954
+ init_tmux();
6955
+ init_agent_state();
6956
+ init_queries();
6957
+ init_delivery();
6958
+ init_pty_supervisor_locate();
6959
+ init_pty_token();
6960
+ init_launcher_generator();
6961
+ init_harness_binary();
6962
+ init_runtime_command();
6963
+ init_kimi_context_envelope();
6964
+ init_kimi_parser();
6965
+ init_paths();
6966
+ init_fs_lock();
6967
+ init_behavior();
6968
+ init_tmux_cli();
6067
6969
  execAsync$4 = promisify(exec);
6970
+ SPAWN_READY_TIMEOUT_MS$1 = 6e4;
6971
+ POLL_INTERVAL_MS = 250;
6972
+ KimiCodeSpawnTimeout = class extends Error {
6973
+ code = "KIMI_CODE_SPAWN_TIMEOUT";
6974
+ constructor(agentId) {
6975
+ super(`Kimi Code agent ${agentId} did not write a new session under its workDirKey bucket within ${SPAWN_READY_TIMEOUT_MS$1}ms`);
6976
+ this.name = "KimiCodeSpawnTimeout";
6977
+ }
6978
+ };
6979
+ KIMI_CAPTURE_LOCK_POLL_MS = 250;
6980
+ KIMI_CAPTURE_LOCK_MAX_WAIT_MS = 9e4;
6981
+ KIMI_CAPTURE_LOCK_STALE_AGE_MS = 75e3;
6982
+ KimiCaptureLockTimeoutError = class extends Error {
6983
+ constructor(lockPath, waitedMs) {
6984
+ super(`Timed out after ${waitedMs}ms waiting for the Kimi session-capture lock at ${lockPath} — another process is still holding it.`);
6985
+ this.name = "KimiCaptureLockTimeoutError";
6986
+ }
6987
+ };
6988
+ KimiCodeRuntimeSync = class {
6989
+ name = "kimi-code";
6990
+ overdeckHomeOverride;
6991
+ kimiHomeOverride;
6992
+ execCommand;
6993
+ prepareLaunch;
6994
+ resolveAgentStates;
6995
+ deliverMessage;
6996
+ resolveSupervisorScriptPath;
6997
+ writePtyTokenFor;
6998
+ constructor(options = {}) {
6999
+ this.overdeckHomeOverride = options.overdeckHome;
7000
+ this.kimiHomeOverride = options.kimiHome;
7001
+ this.execCommand = options.execCommand ?? (async (command) => execAsync$4(command));
7002
+ this.prepareLaunch = options.prepareLaunch ?? (() => prepareHarnessLaunch("kimi-code"));
7003
+ this.resolveAgentStates = options.listAgentStates ?? (() => listAgentStates());
7004
+ this.deliverMessage = options.deliverMessage ?? ((agentId, message, preparedKimiContext) => deliverAgentMessage(agentId, message, "runtime:kimi-code", void 0, { preparedKimiContext }));
7005
+ this.resolveSupervisorScriptPath = options.resolveSupervisorScriptPath ?? resolvePtySupervisorScriptPath;
7006
+ this.writePtyTokenFor = options.writePtyTokenFor ?? writePtyToken;
7007
+ }
7008
+ getHarnessBehavior() {
7009
+ return getRuntimeBehavior("kimi-code");
7010
+ }
7011
+ getSessionPath(agentId) {
7012
+ const workspace = this.workspaceFor(agentId);
7013
+ if (!workspace) return null;
7014
+ return findKimiWirePath(this.kimiHome(), workspace, this.readSessionId(agentId));
7015
+ }
7016
+ getLastActivity(agentId) {
7017
+ const path = this.getSessionPath(agentId);
7018
+ if (!path) return null;
7019
+ try {
7020
+ return statSync$1(path).mtime;
7021
+ } catch {
7022
+ return null;
7023
+ }
7024
+ }
7025
+ getHeartbeat(agentId) {
7026
+ const lastActivity = this.getLastActivity(agentId);
7027
+ if (!lastActivity) return null;
7028
+ return {
7029
+ timestamp: lastActivity,
7030
+ agentId,
7031
+ source: "jsonl",
7032
+ confidence: "medium"
7033
+ };
7034
+ }
7035
+ getTokenUsage(agentId) {
7036
+ const path = this.getSessionPath(agentId);
7037
+ if (!path) return null;
7038
+ return parseKimiSessionSync(path)?.usage ?? null;
7039
+ }
7040
+ getSessionCost(agentId) {
7041
+ const path = this.getSessionPath(agentId);
7042
+ if (!path) return null;
7043
+ const parsed = parseKimiSessionSync(path);
7044
+ if (!parsed) return null;
7045
+ return {
7046
+ inputCost: 0,
7047
+ outputCost: 0,
7048
+ cacheReadCost: 0,
7049
+ cacheWriteCost: 0,
7050
+ totalCost: parsed.cost_v2 ?? parsed.cost ?? 0,
7051
+ currency: "USD"
7052
+ };
7053
+ }
7054
+ async sendMessage(agentId, message) {
7055
+ const result = await this.deliverMessage(agentId, message);
7056
+ if (!result.ok) throw new Error(`Kimi Code agent ${agentId}: message delivery failed${result.failure ? ` (${result.failure})` : ""}`);
7057
+ }
7058
+ async killAgent(agentId) {
7059
+ try {
7060
+ await this.execCommand(`tmux -L ${shellQuote$1(getManagedTmuxSocketName())} send-keys -t ${shellQuote$1(agentId)} C-c 2>/dev/null || true`);
7061
+ } catch {}
7062
+ if (await pollUntilSessionGone$1(agentId, 2e3)) return;
7063
+ let panePid = null;
7064
+ try {
7065
+ const { stdout } = await this.execCommand(`tmux -L ${shellQuote$1(getManagedTmuxSocketName())} list-panes -t ${shellQuote$1(agentId)} -F '#{pane_pid}' 2>/dev/null`);
7066
+ panePid = stdout.trim() || null;
7067
+ if (panePid) await this.execCommand(`kill -TERM -- -${panePid} 2>/dev/null || kill -TERM ${panePid} 2>/dev/null || true`);
7068
+ } catch {}
7069
+ if (await pollUntilSessionGone$1(agentId, 5e3)) return;
7070
+ if (panePid) try {
7071
+ await this.execCommand(`kill -KILL -- -${panePid} 2>/dev/null || kill -KILL ${panePid} 2>/dev/null || true`);
7072
+ } catch {}
7073
+ if (await tmuxSessionExists(agentId)) await tmuxKillSession(agentId);
7074
+ }
7075
+ async spawnAgent(config) {
7076
+ const { pathExport } = await this.prepareLaunch();
7077
+ const model = config.model ?? "";
7078
+ const bucketDir = kimiSessionsRoot(this.kimiHome(), config.workspace);
7079
+ let existingBefore = /* @__PURE__ */ new Set();
7080
+ try {
7081
+ existingBefore = new Set(readdirSync$1(bucketDir));
7082
+ } catch {}
7083
+ mkdirSync$1(join(this.home(), "agents", config.agentId), { recursive: true });
7084
+ const supervisorScriptPath = this.resolveSupervisorScriptPath();
7085
+ await this.writePtyTokenFor(config.agentId);
7086
+ const launcherContent = generateLauncherScriptSync({
7087
+ role: "work",
7088
+ workingDir: config.workspace,
7089
+ harness: "kimi-code",
7090
+ kimiCodeModel: model,
7091
+ kimiCodeEffort: config.effort,
7092
+ kimiCodeYolo: true,
7093
+ extraEnvExports: [pathExport],
7094
+ overdeckEnv: { agentId: config.agentId },
7095
+ setTerminalEnv: true,
7096
+ useSupervisor: true,
7097
+ supervisorScriptPath,
7098
+ unsetProviderEnv: true,
7099
+ kimiContextDelivery: "initial-message",
7100
+ appendSystemPromptFiles: await claudeSystemPromptFiles(config.workspace, "kimi-code")
7101
+ });
7102
+ const launcherScript = this.agentPath(config.agentId, "launcher.sh");
7103
+ writeFileSync$1(launcherScript, launcherContent, { mode: 493 });
7104
+ await tmuxCreateSession(config.agentId, config.workspace, `bash ${shellQuote$1(launcherScript)}`, config.env ?? {});
7105
+ try {
7106
+ const sessionId = await this.waitForNewSessionId(config.workspace, existingBefore);
7107
+ if (!sessionId) throw new KimiCodeSpawnTimeout(config.agentId);
7108
+ this.writeSessionId(config.agentId, sessionId);
7109
+ this.markSupervisorEnabled(config.agentId);
7110
+ const initialMessage = await prepareKimiMessage(config.agentId, config.workspace, config.prompt ?? "", {
7111
+ sessionId,
7112
+ overdeckHome: this.home()
7113
+ });
7114
+ const delivery = await this.deliverMessage(config.agentId, initialMessage.message, initialMessage);
7115
+ if (!delivery.ok) throw new Error(`Kimi Code agent ${config.agentId}: initial context delivery failed` + (delivery.failure ? ` (${delivery.failure})` : ""));
7116
+ markKimiContextDelivered(config.agentId, initialMessage);
7117
+ return {
7118
+ id: config.agentId,
7119
+ sessionId,
7120
+ runtime: "kimi-code",
7121
+ model,
7122
+ workspace: config.workspace,
7123
+ startedAt: /* @__PURE__ */ new Date()
7124
+ };
7125
+ } catch (error) {
7126
+ if (await tmuxSessionExists(config.agentId)) await tmuxKillSession(config.agentId);
7127
+ throw error;
7128
+ }
7129
+ }
7130
+ listSessions(workspace) {
7131
+ const sessions = [];
7132
+ for (const state of this.resolveAgentStates()) {
7133
+ if (state.harness !== "kimi-code") continue;
7134
+ if (workspace && state.workspace !== workspace) continue;
7135
+ const sessionId = this.readSessionId(state.id);
7136
+ if (!sessionId) continue;
7137
+ const sessionPath = findKimiWirePath(this.kimiHome(), state.workspace, sessionId);
7138
+ let lastActivity;
7139
+ try {
7140
+ lastActivity = statSync$1(sessionPath ?? "").mtime;
7141
+ } catch {
7142
+ continue;
7143
+ }
7144
+ sessions.push({
7145
+ id: sessionId,
7146
+ agentId: state.id,
7147
+ workspace: state.workspace,
7148
+ model: state.model ?? "",
7149
+ startedAt: new Date(state.startedAt),
7150
+ lastActivity,
7151
+ tokenUsage: {
7152
+ inputTokens: 0,
7153
+ outputTokens: 0
7154
+ }
7155
+ });
7156
+ }
7157
+ return sessions;
7158
+ }
7159
+ async isRunning(agentId) {
7160
+ return tmuxSessionExists(agentId);
7161
+ }
7162
+ home() {
7163
+ return this.overdeckHomeOverride ?? getOverdeckHome();
7164
+ }
7165
+ kimiHome() {
7166
+ return this.kimiHomeOverride ?? kimiHomeDefault();
7167
+ }
7168
+ agentPath(agentId, file) {
7169
+ return join(this.home(), "agents", agentId, file);
7170
+ }
7171
+ workspaceFor(agentId) {
7172
+ return getAgentStateSync(agentId)?.workspace ?? null;
7173
+ }
7174
+ readSessionId(agentId) {
7175
+ try {
7176
+ return readFileSync$1(this.agentPath(agentId, "kimi-session-id"), "utf-8").trim() || null;
7177
+ } catch {
7178
+ return null;
7179
+ }
7180
+ }
7181
+ writeSessionId(agentId, sessionId) {
7182
+ writeKimiSessionId(agentId, sessionId, this.home());
7183
+ }
7184
+ /**
7185
+ * Best-effort: mark the persisted agent state as supervisor-enabled so
7186
+ * prepareSupervisorForRelaunch (supervisor-channels.ts) re-supervises this
7187
+ * agent on relaunch instead of falling back to useSupervisor:false. A
7188
+ * no-op when no state has been saved for this agent yet (some callers of
7189
+ * this adapter's spawnAgent create state afterward).
7190
+ */
7191
+ markSupervisorEnabled(agentId) {
7192
+ const state = getAgentStateSync(agentId);
7193
+ if (!state) return;
7194
+ state.supervisorEnabled = true;
7195
+ saveAgentStateSync(state);
7196
+ }
7197
+ async waitForNewSessionId(workspace, existingBefore) {
7198
+ return waitForNewKimiSession(this.kimiHome(), workspace, existingBefore);
7199
+ }
7200
+ };
6068
7201
  }));
6069
7202
  //#endregion
7203
+ //#region ../../lib/agents/managed-kimi-delivery.ts
7204
+ /** Enforce native Kimi's mandatory context contract independently of role bookkeeping. */
7205
+ async function requireManagedKimiDelivery(options) {
7206
+ if (options.harness !== "kimi-code" || options.delivery.ok) return;
7207
+ await options.onFailure();
7208
+ throw new Error(`Agent ${options.agentId} (${options.role}) managed Kimi context delivery failed: ` + (options.delivery.failure ?? `delivery returned ok=false via ${options.delivery.path}`));
7209
+ }
7210
+ var init_managed_kimi_delivery = __esmMin((() => {}));
7211
+ //#endregion
6070
7212
  //#region ../../lib/agents/spawn.ts
6071
7213
  async function spawnRun(issueId, role, options) {
6072
7214
  if (role !== "work") return spawnRunWithoutConsentClaim(issueId, role, options);
@@ -6130,7 +7272,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6130
7272
  let reapWarmIdle = false;
6131
7273
  const advancing = role === "review" || role === "test" || role === "ship";
6132
7274
  try {
6133
- const { isPaneDead } = await import("./tmux-CYucGrTl.js");
7275
+ const { isPaneDead } = await import("./tmux-aj9rscol.js");
6134
7276
  if (await Effect.runPromise(isPaneDead(agentId))) reapWarmIdle = true;
6135
7277
  else if (advancing) {
6136
7278
  const { status } = resolveCanonicalReviewStatus(issueId);
@@ -6139,7 +7281,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6139
7281
  } catch {}
6140
7282
  if (!reapWarmIdle) throw new Error(`Role run ${agentId} already running. Use 'pan tell' to message it.`);
6141
7283
  console.log(`[spawn] ${agentId} is warm-idle from the previous cycle — reaping it for the new ${role} dispatch (PAN-2579)`);
6142
- const { killSession } = await import("./tmux-CYucGrTl.js");
7284
+ const { killSession } = await import("./tmux-aj9rscol.js");
6143
7285
  await Effect.runPromise(killSession(agentId)).catch(() => {});
6144
7286
  }
6145
7287
  await prepareWorkspaceForAgentSpawn(issueId, role, options.allowHost, workspace);
@@ -6154,7 +7296,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6154
7296
  assertCodexNativeAuthForSpawn(resolvedHarness, listAgentStates());
6155
7297
  await ensureLifecycleHooksBeforeLaunch(agentId, resolvedHarness);
6156
7298
  if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
6157
- const { isCliproxyRunning } = await import("./cliproxy-DdhFpcXU.js");
7299
+ const { isCliproxyRunning } = await import("./cliproxy-Dz_zq_4H.js");
6158
7300
  if (!await Effect.runPromise(isCliproxyRunning())) throw new Error("CLIProxyAPI sidecar is not running. GPT subscription role runs route through a local cliproxy process managed by `pan up`. Run `pan up` (or restart the dashboard) before spawning a GPT role run.");
6159
7301
  }
6160
7302
  const state = {
@@ -6185,8 +7327,8 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6185
7327
  const shouldDeliverPromptViaTmux = shouldRegisterConversation && resolvedHarness === "claude-code";
6186
7328
  const shouldDeliverPromptViaPi = shouldRegisterConversation && resolvedHarness === "ohmypi";
6187
7329
  const shouldDeliverPromptViaCodexTui = shouldRegisterConversation && resolvedHarness === "codex";
6188
- const shouldDeliverPromptViaKimiCode = shouldRegisterConversation && resolvedHarness === "kimi-code";
6189
- const shouldDeliverPromptViaAcp = resolvedHarness === "acp";
7330
+ const shouldDeliverPromptViaKimiCode = resolvedHarness === "muse" || resolvedHarness === "kimi-code";
7331
+ const shouldDeliverPromptViaAcp = resolvedHarness === "acp" || resolvedHarness === "opencode";
6190
7332
  const prompt = options.prompt ? await withSpawnTimeMemoryContext({
6191
7333
  prompt: options.prompt,
6192
7334
  issueId,
@@ -6212,15 +7354,23 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6212
7354
  }
6213
7355
  const providerExports = isAcp ? void 0 : await getProviderExportsForModel(selectedModel, resolvedHarness);
6214
7356
  const providerEnv = isAcp ? {} : await getProviderEnvForModel(selectedModel, resolvedHarness);
6215
- const piLauncherFields = resolvedHarness === "ohmypi" ? await getOhmypiLauncherFields(agentId, selectedModel) : {};
6216
- const codexLauncherFields = resolvedHarness === "codex" ? getCodexLauncherFields(agentId, selectedModel, workspace, role) : {};
6217
- const acpLauncherFields = isAcp ? getAcpLauncherFields(agentId, selectedModel, workspace, harnessLaunch.binaryPath, role) : {};
6218
- const kimiCodeLauncherFields = resolvedHarness === "kimi-code" ? getKimiCodeLauncherFields(selectedModel) : {};
7357
+ const piLauncherFields = resolvedHarness === "ohmypi" ? await getOhmypiLauncherFields(agentId, selectedModel, options.effort) : {};
7358
+ const codexLauncherFields = resolvedHarness === "codex" ? getCodexLauncherFields(agentId, selectedModel, workspace, role, options.effort) : {};
7359
+ const acpLauncherFields = isAcp ? getAcpLauncherFields(agentId, selectedModel, workspace, harnessLaunch.binaryPath, role, options.effort) : {};
7360
+ const museSavedSession = resolvedHarness === "muse" && options.resumeSessionId ? await resolveMuseSessionPath(agentId) : null;
7361
+ const museLauncherFields = resolvedHarness === "muse" ? {
7362
+ harness: "muse",
7363
+ museModel: selectedModel,
7364
+ museEffort: options.effort,
7365
+ museContextFile: await materializeMuseContext(agentId, workspace, roleAgentDefinitionPath(role)),
7366
+ museResumeSessionId: museSavedSession ? museSessionId(museSavedSession) : void 0
7367
+ } : {};
7368
+ const kimiCodeLauncherFields = resolvedHarness === "kimi-code" ? getKimiCodeLauncherFields(selectedModel, options.effort) : {};
6219
7369
  let sessionId;
6220
7370
  let rawSessionId;
6221
7371
  if (shouldRegisterConversation) {
6222
- rawSessionId = isAcp ? options.resumeSessionId : options.resumeSessionId ?? randomUUID();
6223
- if (!isAcp && rawSessionId) try {
7372
+ rawSessionId = isAcp || resolvedHarness === "kimi-code" ? options.resumeSessionId : options.resumeSessionId ?? randomUUID();
7373
+ if (!isAcp && resolvedHarness !== "kimi-code" && rawSessionId) try {
6224
7374
  const agentDir = getAgentDir(agentId);
6225
7375
  await mkdir$1(agentDir, { recursive: true });
6226
7376
  await writeFile$1(join$1(agentDir, "session.id"), rawSessionId, "utf-8");
@@ -6274,18 +7424,19 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6274
7424
  ...piLauncherFields,
6275
7425
  ...codexLauncherFields,
6276
7426
  ...acpLauncherFields,
6277
- ...kimiCodeLauncherFields
7427
+ ...kimiCodeLauncherFields,
7428
+ ...museLauncherFields
6278
7429
  });
6279
7430
  const launcherScript = join$1(getAgentDir(agentId), "launcher.sh");
6280
7431
  await writeLauncherScriptAtomic(launcherScript, launcherContent);
6281
7432
  const claudeCmd = `bash ${launcherScript}`;
6282
7433
  console.log(`[claude-invoke] purpose=role-run | role=${role} | model=${state.model} | source=agents.ts:spawnRun | session=${agentId} | command="${claudeCmd}"`);
6283
7434
  try {
6284
- const { preTrustDirectory } = await import("./workspace-manager-BrbX90Rm.js");
7435
+ const { preTrustDirectory } = await import("./workspace-manager-D0jJ7StJ.js");
6285
7436
  preTrustDirectory(workspace);
6286
7437
  } catch {}
6287
7438
  clearReadySignal(agentId);
6288
- await Effect.runPromise(createSession(agentId, workspace, claudeCmd, { env: {
7439
+ const launchRoleSession = () => Effect.runPromise(createSession(agentId, workspace, claudeCmd, { env: {
6289
7440
  ...BLANKED_PROVIDER_ENV,
6290
7441
  TERM: "xterm-256color",
6291
7442
  OVERDECK_AGENT_ID: agentId,
@@ -6297,6 +7448,20 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6297
7448
  ...flywheelEnv,
6298
7449
  ...providerEnv
6299
7450
  } }));
7451
+ if (resolvedHarness === "kimi-code") try {
7452
+ rawSessionId = await launchAndCaptureManagedKimiSession({
7453
+ agentId,
7454
+ workspace,
7455
+ launch: launchRoleSession,
7456
+ resumeSessionId: options.resumeSessionId
7457
+ });
7458
+ if (shouldRegisterConversation) setConversationClaudeSessionId(agentId, rawSessionId);
7459
+ } catch (error) {
7460
+ const { killSession } = await import("./tmux-aj9rscol.js");
7461
+ await Effect.runPromise(killSession(agentId)).catch(() => {});
7462
+ throw error;
7463
+ }
7464
+ else await launchRoleSession();
6300
7465
  if (shouldRegisterConversation) await saveAgentRuntimeState(agentId, {
6301
7466
  claudeSessionId: rawSessionId,
6302
7467
  ...options.resumeSessionId ? {} : {
@@ -6306,7 +7471,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6306
7471
  });
6307
7472
  await Effect.runPromise(setOption(agentId, "destroy-unattached", "off"));
6308
7473
  await Effect.runPromise(setOption(exactPaneTarget(agentId), "remain-on-exit", "on"));
6309
- if (prompt) {
7474
+ if (prompt || resolvedHarness === "kimi-code") {
6310
7475
  if (shouldDeliverPromptViaAcp) try {
6311
7476
  await waitForPromptReady(agentId, resolvedHarness, 30);
6312
7477
  const delivery = await deliverAgentMessage(agentId, prompt, "spawnRun:initial-prompt");
@@ -6333,6 +7498,17 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6333
7498
  }
6334
7499
  else if (shouldDeliverPromptViaTmux || shouldDeliverPromptViaCodexTui || shouldDeliverPromptViaKimiCode) if (tracksKickoffDelivery) {
6335
7500
  const delivery = await deliverInitialPromptWithRetry(agentId, prompt, "spawnRun:initial-prompt");
7501
+ await requireManagedKimiDelivery({
7502
+ agentId,
7503
+ role,
7504
+ harness: resolvedHarness,
7505
+ delivery,
7506
+ onFailure: async () => {
7507
+ if (delivery.failure === "session-exited-before-kickoff") await recordStartupSessionExit(state, issueId, role);
7508
+ await recordKickoffDeliveryFailure(state, issueId, role);
7509
+ await Effect.runPromise(stopAgent(agentId)).catch(() => {});
7510
+ }
7511
+ });
6336
7512
  if (delivery.ok) {
6337
7513
  state.kickoffDelivered = true;
6338
7514
  await Effect.runPromise(saveAgentState(state));
@@ -6340,14 +7516,26 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6340
7516
  await recordStartupSessionExit(state, issueId, role);
6341
7517
  return state;
6342
7518
  }
6343
- } else if (await waitForPromptReady(agentId, resolvedHarness, 30)) {
6344
- await new Promise((resolve) => setTimeout(resolve, 500));
6345
- await deliverAgentMessage(agentId, prompt, "spawnRun:initial-prompt");
6346
- } else console.error(`[${agentId}] ${getHarnessBehavior(resolvedHarness).displayName} did not become ready within 30s`);
7519
+ } else {
7520
+ const timeout = getHarnessBehavior(resolvedHarness).readyTimeoutSeconds;
7521
+ if (await waitForPromptReady(agentId, resolvedHarness, timeout)) {
7522
+ await new Promise((resolve) => setTimeout(resolve, 500));
7523
+ try {
7524
+ const delivery = await deliverAgentMessage(agentId, prompt, "spawnRun:initial-prompt");
7525
+ if (resolvedHarness === "kimi-code" && !delivery.ok) throw new Error(delivery.failure ?? `delivery returned ok=false via ${delivery.path}`);
7526
+ } catch (error) {
7527
+ if (resolvedHarness === "kimi-code") await Effect.runPromise(stopAgent(agentId)).catch(() => {});
7528
+ throw error;
7529
+ }
7530
+ } else {
7531
+ if (resolvedHarness === "kimi-code") await Effect.runPromise(stopAgent(agentId)).catch(() => {});
7532
+ throw new Error(`[${agentId}] ${getHarnessBehavior(resolvedHarness).displayName} did not become ready within ${timeout}s`);
7533
+ }
7534
+ }
6347
7535
  }
6348
7536
  markAgentRunning(state);
6349
7537
  try {
6350
- const { snapshotWorkspaceHeadsPromise } = await import("./git-utils-BAMwn9Nf.js");
7538
+ const { snapshotWorkspaceHeadsPromise } = await import("./git-utils-DvcWLgGS.js");
6351
7539
  const headAnchor = await snapshotWorkspaceHeadsPromise(issueId, workspace);
6352
7540
  if (headAnchor) state.roleRunHead = headAnchor;
6353
7541
  } catch {}
@@ -6389,7 +7577,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6389
7577
  });
6390
7578
  console.log(`[DEBUG] Selected model: ${selectedModel}`);
6391
7579
  if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
6392
- const { isCliproxyRunning } = await import("./cliproxy-DdhFpcXU.js");
7580
+ const { isCliproxyRunning } = await import("./cliproxy-Dz_zq_4H.js");
6393
7581
  if (!await Effect.runPromise(isCliproxyRunning())) throw new Error("CLIProxyAPI sidecar is not running. GPT subscription agents route through a local cliproxy process managed by `pan up`. Run `pan up` (or restart the dashboard) before spawning a GPT agent.");
6394
7582
  }
6395
7583
  const resolvedHarness = await resolveHarness({
@@ -6439,7 +7627,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6439
7627
  });
6440
7628
  }
6441
7629
  if (role === "work") try {
6442
- const { writeStoryFeatureContext } = await import("./work-agent-prompt-BnhKNAg7.js");
7630
+ const { writeStoryFeatureContext } = await import("./work-agent-prompt-Csr4vMbl.js");
6443
7631
  await writeStoryFeatureContext(options.workspace, options.issueId);
6444
7632
  } catch (ctxErr) {
6445
7633
  console.warn(`[agents] Could not write story feature context for ${options.issueId}: ${ctxErr.message}`);
@@ -6486,7 +7674,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6486
7674
  try {
6487
7675
  const venvPath = join$1(options.workspace, ".venv");
6488
7676
  if (isTldrEnabledSync() && existsSync(venvPath)) {
6489
- const { getTldrDaemonServiceSync } = await import("./tldr-daemon-CRSAkhBx.js");
7677
+ const { getTldrDaemonServiceSync } = await import("./tldr-daemon-CW1MhBkM.js");
6490
7678
  const tldrService = getTldrDaemonServiceSync(options.workspace, venvPath);
6491
7679
  if (!(await tldrService.getStatus()).running) {
6492
7680
  await tldrService.start(true);
@@ -6526,13 +7714,13 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6526
7714
  const claudeCmd = `bash ${launcherScript}`;
6527
7715
  console.log(`[claude-invoke] purpose=work-agent | model=${state.model} | source=agents.ts:spawnAgent | session=${agentId} | command="${claudeCmd}"`);
6528
7716
  try {
6529
- const { preTrustDirectory } = await import("./workspace-manager-BrbX90Rm.js");
7717
+ const { preTrustDirectory } = await import("./workspace-manager-D0jJ7StJ.js");
6530
7718
  preTrustDirectory(options.workspace);
6531
7719
  } catch {}
6532
7720
  try {
6533
- const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-BWziYCf3.js");
7721
+ const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-BxM1U38q.js");
6534
7722
  if (isGitHubAppConfigured()) {
6535
- const { findProjectByPathSync } = await import("./projects-BMuEf14J.js");
7723
+ const { findProjectByPathSync } = await import("./projects-DXgHD2Xl.js");
6536
7724
  const ghRepo = findProjectByPathSync(resolve$1(options.workspace, "..", ".."))?.github_repo;
6537
7725
  if (ghRepo) {
6538
7726
  const [owner, repo] = ghRepo.split("/");
@@ -6545,42 +7733,29 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6545
7733
  console.warn(`[${agentId}] GitHub App config failed (falling back to SSH): ${err.message}`);
6546
7734
  }
6547
7735
  clearReadySignal(agentId);
6548
- const launchAndCaptureKimiSession = async () => {
6549
- let kimiExistingSessionsBefore;
6550
- if (resolvedHarness === "kimi-code") try {
6551
- const { kimiSessionsRoot } = await import("./kimi-code-BxkDgaj4.js");
6552
- kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), options.workspace)));
6553
- } catch {
6554
- kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
6555
- }
6556
- await Effect.runPromise(createSession(agentId, options.workspace, claudeCmd, { env: {
6557
- ...BLANKED_PROVIDER_ENV,
6558
- TERM: "xterm-256color",
6559
- OVERDECK_AGENT_ID: agentId,
6560
- OVERDECK_ISSUE_ID: options.issueId,
6561
- OVERDECK_SESSION_TYPE: role,
6562
- OVERDECK_AGENT_STARTED_BY: startedBy,
6563
- CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
6564
- GIT_SEQUENCE_EDITOR: "false",
6565
- ...flywheelEnv,
6566
- ...providerEnv
6567
- } }));
6568
- if (kimiExistingSessionsBefore) {
6569
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-BxkDgaj4.js");
6570
- const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), options.workspace, kimiExistingSessionsBefore);
6571
- if (sessionId) writeKimiSessionId(agentId, sessionId);
6572
- else throw new Error(`kimi-code session capture timed out for ${agentId} — no new session directory appeared under the workspace bucket`);
6573
- }
6574
- };
6575
- if (resolvedHarness === "kimi-code") {
6576
- const { withKimiSessionCaptureLock } = await import("./kimi-code-BxkDgaj4.js");
6577
- try {
6578
- await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), options.workspace, launchAndCaptureKimiSession);
6579
- } catch (err) {
6580
- await Effect.runPromise(stopAgent(agentId)).catch(() => void 0);
6581
- throw err;
6582
- }
6583
- } else await launchAndCaptureKimiSession();
7736
+ const launchWorkSession = () => Effect.runPromise(createSession(agentId, options.workspace, claudeCmd, { env: {
7737
+ ...BLANKED_PROVIDER_ENV,
7738
+ TERM: "xterm-256color",
7739
+ OVERDECK_AGENT_ID: agentId,
7740
+ OVERDECK_ISSUE_ID: options.issueId,
7741
+ OVERDECK_SESSION_TYPE: role,
7742
+ OVERDECK_AGENT_STARTED_BY: startedBy,
7743
+ CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
7744
+ GIT_SEQUENCE_EDITOR: "false",
7745
+ ...flywheelEnv,
7746
+ ...providerEnv
7747
+ } }));
7748
+ if (resolvedHarness === "kimi-code") try {
7749
+ await launchAndCaptureManagedKimiSession({
7750
+ agentId,
7751
+ workspace: options.workspace,
7752
+ launch: launchWorkSession
7753
+ });
7754
+ } catch (err) {
7755
+ await Effect.runPromise(stopAgent(agentId)).catch(() => void 0);
7756
+ throw err;
7757
+ }
7758
+ else await launchWorkSession();
6584
7759
  await acceptConsent?.();
6585
7760
  await saveAgentRuntimeState(agentId, {
6586
7761
  claudeSessionId: state.sessionId,
@@ -6617,9 +7792,22 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6617
7792
  throw new Error(`Agent ${agentId} kickoff delivery failed: ${err instanceof Error ? err.message : String(err)}`);
6618
7793
  }
6619
7794
  }
6620
- else if (prompt) {
7795
+ else if (prompt || resolvedHarness === "kimi-code") {
6621
7796
  if (dismissChannelsDialogPromise) await dismissChannelsDialogPromise;
6622
7797
  const delivery = await deliverInitialPromptWithRetry(agentId, prompt, "spawnAgent:initial-prompt", state.deliveryMethod);
7798
+ await requireManagedKimiDelivery({
7799
+ agentId,
7800
+ role,
7801
+ harness: resolvedHarness,
7802
+ delivery,
7803
+ onFailure: async () => {
7804
+ if (tracksKickoffDelivery) {
7805
+ if (delivery.failure === "session-exited-before-kickoff") await recordStartupSessionExit(state, options.issueId, role);
7806
+ await recordKickoffDeliveryFailure(state, options.issueId, role);
7807
+ }
7808
+ await Effect.runPromise(stopAgent(agentId)).catch(() => {});
7809
+ }
7810
+ });
6623
7811
  if (delivery.ok) {
6624
7812
  if (tracksKickoffDelivery) {
6625
7813
  state.kickoffDelivered = true;
@@ -6633,10 +7821,10 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6633
7821
  }
6634
7822
  }
6635
7823
  if (resolvedHarness === "codex" && loadConfigSync().config.codex?.transport === "tui" && getHarnessBehavior(resolvedHarness).readinessKind === "codex-tui-prompt") {
6636
- const codexHomeForAgent = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home");
7824
+ const codexHomeForAgent = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home-v2");
6637
7825
  (async () => {
6638
7826
  try {
6639
- const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-BValsmtK.js");
7827
+ const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-DzLXjzbf.js");
6640
7828
  const rollout = await waitForCodexRollout(codexHomeForAgent, 12e4);
6641
7829
  if (rollout) {
6642
7830
  const threadId = extractThreadIdFromRollout(rollout);
@@ -6688,6 +7876,8 @@ function writeTaskCache(agentId, issueId) {
6688
7876
  }
6689
7877
  var execAsync$3;
6690
7878
  var init_spawn = __esmMin((() => {
7879
+ init_muse_context();
7880
+ init_muse_session();
6691
7881
  init_activity_logger();
6692
7882
  init_child_env();
6693
7883
  init_config_yaml();
@@ -6727,6 +7917,8 @@ var init_spawn = __esmMin((() => {
6727
7917
  init_auto_spawn_consent();
6728
7918
  init_provenance();
6729
7919
  init_registered_slot_spawn();
7920
+ init_kimi_code();
7921
+ init_managed_kimi_delivery();
6730
7922
  execAsync$3 = promisify$1(exec$1);
6731
7923
  }));
6732
7924
  //#endregion
@@ -7597,7 +8789,7 @@ function queueAgentMail(agentId, message, kind = "queued", dedupKey, source) {
7597
8789
  return mailPath;
7598
8790
  }
7599
8791
  function resolveAgentDeliveryMethod(state) {
7600
- if (state?.harness === "acp") return "auto";
8792
+ if (state?.harness === "acp" || state?.harness === "opencode") return "auto";
7601
8793
  return resilientDeliveryMethod(state?.deliveryMethod);
7602
8794
  }
7603
8795
  function claimCodexIdleTurn(agentId) {
@@ -7638,7 +8830,7 @@ function deliverWithOptionalKey(normalizedId, message, caller, deliveryMethod, d
7638
8830
  * at-most-once across the whole replay window.
7639
8831
  */
7640
8832
  async function resumeThenDeliverKeyed(normalizedId, message, caller, agentState, dedupKey) {
7641
- const { resumeAgent } = await import("./agents-DixZjXWm.js");
8833
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7642
8834
  const result = await resumeAgent(normalizedId);
7643
8835
  if (!result.success) throw new Error(`Failed to auto-resume agent: ${result.error}`);
7644
8836
  const delivery = await deliverAgentMessage(normalizedId, message, `messageAgent:${caller}`, resolveAgentDeliveryMethod(agentState), { dedupKey });
@@ -7693,7 +8885,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7693
8885
  }
7694
8886
  console.log(`[agents] Auto-resuming suspended agent ${normalizedId} to deliver message`);
7695
8887
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7696
- const { resumeAgent } = await import("./agents-DixZjXWm.js");
8888
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7697
8889
  const result = await resumeAgent(normalizedId, message);
7698
8890
  if (!result.success) throw new Error(`Failed to auto-resume agent: ${result.error}`);
7699
8891
  if (result.messageDelivered === false) throw new Error(`Agent resumed but ready signal did not fire — message not delivered. Feedback is in the mail queue.`);
@@ -7718,7 +8910,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7718
8910
  }
7719
8911
  console.log(`[agents] Auto-resuming stopped agent ${normalizedId} to deliver feedback (session exists: ${await Effect.runPromise(sessionExists(normalizedId))})`);
7720
8912
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7721
- const { resumeAgent } = await import("./agents-DixZjXWm.js");
8913
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7722
8914
  const resumeResult = await resumeAgent(normalizedId, message);
7723
8915
  queueAgentMail(normalizedId, message);
7724
8916
  if (resumeResult.success && resumeResult.messageDelivered !== false) {
@@ -7762,7 +8954,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7762
8954
  const resumeModel = agentState.model || "claude-sonnet-4-6";
7763
8955
  const fallbackHarness = agentState.harness ?? "claude-code";
7764
8956
  const harnessLaunch = await prepareHarnessLaunch(fallbackHarness);
7765
- const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-DixZjXWm.js");
8957
+ const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-BVvL4o_4.js");
7766
8958
  await assertWorkspaceStackHealthyForSpawn(agentState.issueId || normalizedId.replace(/^agent-/, "").toUpperCase(), resumeRole, agentState.hostOverride === true, agentState.workspace);
7767
8959
  const fallbackPiFields = fallbackHarness === "ohmypi" ? await getOhmypiLauncherFields(normalizedId, resumeModel) : {};
7768
8960
  const fallbackCodexFields = fallbackHarness === "codex" ? getCodexLauncherFields(normalizedId, resumeModel, agentState.workspace, resumeRole) : {};
@@ -7776,6 +8968,12 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7776
8968
  extraEnvExports: [harnessLaunch.pathExport],
7777
8969
  baseCommand: await getRoleRuntimeBaseCommand(resumeModel, normalizedId, resumeRole, fallbackHarness),
7778
8970
  appendSystemPromptFiles: await claudeSystemPromptFiles(agentState.workspace, fallbackHarness),
8971
+ managedStateKey: normalizedId,
8972
+ overdeckEnv: {
8973
+ agentId: normalizedId,
8974
+ issueId: agentState.issueId,
8975
+ sessionType: resumeRole
8976
+ },
7779
8977
  useSupervisor: fallbackSupervisorLaunch.useSupervisor,
7780
8978
  supervisorScriptPath: fallbackSupervisorLaunch.supervisorScriptPath,
7781
8979
  ...fallbackPiFields,
@@ -7845,12 +9043,12 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7845
9043
  ...reason ? { reason } : {}
7846
9044
  };
7847
9045
  }
7848
- const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-MuXx2gWm.js");
9046
+ const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-CEOvYsvK.js");
7849
9047
  const remoteState = loadRemoteAgentState(normalizedId);
7850
9048
  if (remoteState && remoteState.vmName) {
7851
9049
  console.log(`[agents] Sending message to remote agent ${normalizedId} on ${remoteState.vmName}`);
7852
9050
  if (opts.dedupKey !== void 0) {
7853
- const { sendToRemoteAgentKeyed } = await import("./remote-agents-MuXx2gWm.js");
9051
+ const { sendToRemoteAgentKeyed } = await import("./remote-agents-CEOvYsvK.js");
7854
9052
  const remoteOutcome = await sendToRemoteAgentKeyed(normalizedId, remoteState.vmName, message, opts.dedupKey);
7855
9053
  queueAgentMail(normalizedId, message, "delivered", opts.dedupKey);
7856
9054
  await appendTellInterventionForUserSource(normalizedId, caller);
@@ -7914,7 +9112,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7914
9112
  if (panePids.length > 0 && !await hasAgentRuntimeInSubtree(panePids[0], expectedHarness)) {
7915
9113
  console.warn(`[agents] ${normalizedId} tmux session is a zombie (no ${expectedHarness} runtime) — attempting resume`);
7916
9114
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7917
- const { resumeAgent } = await import("./agents-DixZjXWm.js");
9115
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7918
9116
  const resumeResult = await resumeAgent(normalizedId, message);
7919
9117
  if (resumeResult.success) {
7920
9118
  const delivered = resumeResult.messageDelivered !== false;
@@ -8282,6 +9480,51 @@ var init_resume_pane_choice = __esmMin((() => {
8282
9480
  ];
8283
9481
  }));
8284
9482
  //#endregion
9483
+ //#region ../../lib/review-lifecycle-guard.ts
9484
+ /** Return the issue owned by a review parent or convoy member agent id. */
9485
+ function reviewIssueIdForAgent(agentId) {
9486
+ return /^agent-([a-z]+-\d+)-review(?:-|$)/i.exec(agentId)?.[1]?.toUpperCase() ?? null;
9487
+ }
9488
+ /**
9489
+ * Serialize review-family lifecycle mutations for one issue.
9490
+ *
9491
+ * Dispatch owns this guard across stop, state wipe, and replacement spawn.
9492
+ * Direct review-family resumes enter through the same guard. Calls made by a
9493
+ * guarded dispatch are re-entrant because dispatch legitimately warm-resumes
9494
+ * the parent and convoy members while it owns the replacement sequence.
9495
+ */
9496
+ async function withReviewLifecycleGuard(issueId, operation) {
9497
+ const key = issueId.toUpperCase();
9498
+ const held = heldReviewLifecycles.getStore();
9499
+ if (held?.has(key)) return operation();
9500
+ const previous = reviewLifecycleTails.get(key) ?? Promise.resolve();
9501
+ let release = () => {};
9502
+ const current = new Promise((resolve) => {
9503
+ release = resolve;
9504
+ });
9505
+ const tail = previous.catch(() => void 0).then(() => current);
9506
+ reviewLifecycleTails.set(key, tail);
9507
+ await previous.catch(() => void 0);
9508
+ try {
9509
+ const nextHeld = new Set(held);
9510
+ nextHeld.add(key);
9511
+ return await heldReviewLifecycles.run(nextHeld, operation);
9512
+ } finally {
9513
+ release();
9514
+ if (reviewLifecycleTails.get(key) === tail) reviewLifecycleTails.delete(key);
9515
+ }
9516
+ }
9517
+ /** Run review-family agents under their issue guard; leave other agents alone. */
9518
+ async function withReviewLifecycleGuardForAgent(agentId, operation) {
9519
+ const issueId = reviewIssueIdForAgent(agentId);
9520
+ return issueId ? withReviewLifecycleGuard(issueId, operation) : operation();
9521
+ }
9522
+ var reviewLifecycleTails, heldReviewLifecycles;
9523
+ var init_review_lifecycle_guard = __esmMin((() => {
9524
+ reviewLifecycleTails = /* @__PURE__ */ new Map();
9525
+ heldReviewLifecycles = new AsyncLocalStorage();
9526
+ }));
9527
+ //#endregion
8285
9528
  //#region ../../lib/agents/resume.ts
8286
9529
  /**
8287
9530
  * Resume a suspended agent (PAN-80)
@@ -8314,7 +9557,7 @@ async function buildCompactRecoverySeed(agentId) {
8314
9557
  if (agentState?.workspace && sessionId) {
8315
9558
  const sessionFile = sessionFilePath(agentState.workspace, sessionId);
8316
9559
  try {
8317
- const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-DzMXGRiJ.js"), import("./smart-compaction-CUXn8mfX.js")]);
9560
+ const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-D0zgWM1f.js"), import("./smart-compaction-owKHJDbL.js")]);
8318
9561
  const settings = getConversationCompactionSettings();
8319
9562
  summary = (await Effect.runPromise(generateSmartSummary({
8320
9563
  jsonlPath: sessionFile,
@@ -8325,7 +9568,7 @@ async function buildCompactRecoverySeed(agentId) {
8325
9568
  } catch (err) {
8326
9569
  logAgentLifecycleSync(normalizedId, `compact-recovery smart summary failed (${err instanceof Error ? err.message : String(err)}); trying heuristic fallback`);
8327
9570
  try {
8328
- const { generateFallbackSummary } = await import("./summary-fork-CojrFKb6.js");
9571
+ const { generateFallbackSummary } = await import("./summary-fork-PLcckTRE.js");
8329
9572
  summary = await Effect.runPromise(generateFallbackSummary(sessionFile));
8330
9573
  } catch (fallbackErr) {
8331
9574
  logAgentLifecycleSync(normalizedId, `compact-recovery fallback summary failed (${fallbackErr instanceof Error ? fallbackErr.message : String(fallbackErr)}); seeding with reseed instructions only`);
@@ -8339,6 +9582,9 @@ async function buildCompactRecoverySeed(agentId) {
8339
9582
  }
8340
9583
  async function resumeAgent(agentId, message, opts) {
8341
9584
  const normalizedId = normalizeAgentId(agentId);
9585
+ return withReviewLifecycleGuardForAgent(normalizedId, () => resumeAgentWithinLifecycle(normalizedId, message, opts));
9586
+ }
9587
+ async function resumeAgentWithinLifecycle(normalizedId, message, opts) {
8342
9588
  const requestedModel = normalizeModelOverrideSync(opts?.model);
8343
9589
  logAgentLifecycleSync(normalizedId, `resumeAgent called (message=${message ? "yes" : "no"}, harness=${opts?.harness || "unchanged"})`);
8344
9590
  const runtimeState = getAgentRuntimeStateSync(normalizedId);
@@ -8561,7 +9807,7 @@ async function resumeAgent(agentId, message, opts) {
8561
9807
  const msg = err instanceof Error ? err.message : String(err);
8562
9808
  console.error(`[resumeAgent] ohmypi prompt delivery failed: ${msg}`);
8563
9809
  }
8564
- else if (effectiveHarness === "acp") {
9810
+ else if (effectiveHarness === "acp" || effectiveHarness === "opencode") {
8565
9811
  const delivery = await deliverInitialPromptWithRetry(normalizedId, effectiveMessage, "resumeAgent:acp-continue");
8566
9812
  messageDelivered = delivery.ok;
8567
9813
  if (delivery.ok && resumeMessage.redeliveringKickoff) markKickoffRedelivered(agentState);
@@ -8726,6 +9972,7 @@ var init_resume = __esmMin((() => {
8726
9972
  init_supervisor_channels();
8727
9973
  init_spawn_prep();
8728
9974
  init_resume_contract();
9975
+ init_review_lifecycle_guard();
8729
9976
  }));
8730
9977
  //#endregion
8731
9978
  //#region ../../lib/graceful-restart.ts
@@ -9624,7 +10871,11 @@ var init_pending_decision_gate = __esmMin((() => {
9624
10871
  //#endregion
9625
10872
  //#region ../../lib/agents/recovery.ts
9626
10873
  function resolveRecoveryResumeSessionId(agentId, harness) {
9627
- if (harness !== "codex" && harness !== "acp" && harness !== "kimi-code") return void 0;
10874
+ if (harness === "muse") {
10875
+ const path = resolveMuseSessionPathSync(agentId);
10876
+ return path ? museSessionId(path) : void 0;
10877
+ }
10878
+ if (harness !== "codex" && harness !== "acp" && harness !== "kimi-code" && harness !== "opencode") return void 0;
9628
10879
  return getLatestSessionIdSync(agentId) ?? void 0;
9629
10880
  }
9630
10881
  async function restartAgent(agentId, opts = {}, deps = {}) {
@@ -9729,7 +10980,7 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9729
10980
  unlinkSync(join$1(getAgentDir(normalizedId), "kimi-session-id"));
9730
10981
  } catch {}
9731
10982
  try {
9732
- const { kimiSessionsRoot } = await import("./kimi-code-BxkDgaj4.js");
10983
+ const { kimiSessionsRoot } = await import("./kimi-code-Cx5YUJpS.js");
9733
10984
  kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), agentState.workspace)));
9734
10985
  } catch {
9735
10986
  kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
@@ -9746,14 +10997,14 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9746
10997
  ...providerEnv
9747
10998
  } }));
9748
10999
  if (kimiExistingSessionsBefore) {
9749
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-BxkDgaj4.js");
11000
+ const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cx5YUJpS.js");
9750
11001
  const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), agentState.workspace, kimiExistingSessionsBefore);
9751
11002
  if (!sessionId) throw new Error(`kimi-code session capture timed out after fresh relaunch for ${normalizedId} — no new session directory appeared under the workspace bucket`);
9752
11003
  writeKimiSessionId(normalizedId, sessionId);
9753
11004
  }
9754
11005
  };
9755
11006
  if (effectiveHarness === "kimi-code") {
9756
- const { withKimiSessionCaptureLock } = await import("./kimi-code-BxkDgaj4.js");
11007
+ const { withKimiSessionCaptureLock } = await import("./kimi-code-Cx5YUJpS.js");
9757
11008
  await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), agentState.workspace, launchAndCaptureKimiSession);
9758
11009
  } else await launchAndCaptureKimiSession();
9759
11010
  const prompt = message || buildResumeContinueMessage(agentState);
@@ -9764,9 +11015,10 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9764
11015
  console.error(`[restartAgent] ohmypi prompt delivery failed for ${normalizedId}: ${msg}`);
9765
11016
  }
9766
11017
  else {
9767
- if (!await waitForPromptReady(normalizedId, effectiveHarness, 30)) throw new Error(`${getHarnessBehavior(effectiveHarness).displayName} did not become ready within 30s for ${normalizedId}`);
11018
+ const timeout = getHarnessBehavior(effectiveHarness).readyTimeoutSeconds;
11019
+ if (!await waitForPromptReady(normalizedId, effectiveHarness, timeout)) throw new Error(`${getHarnessBehavior(effectiveHarness).displayName} did not become ready within ${timeout}s for ${normalizedId}`);
9768
11020
  await new Promise((r) => setTimeout(r, 500));
9769
- if (effectiveHarness === "codex" || effectiveHarness === "acp" || effectiveHarness === "kimi-code") {
11021
+ if (effectiveHarness === "codex" || effectiveHarness === "acp" || effectiveHarness === "kimi-code" || effectiveHarness === "opencode" || effectiveHarness === "muse") {
9770
11022
  if (!(await deliverAgentMessage(normalizedId, prompt, "restartAgent:continue-prompt", effectiveHarness === "codex" ? resilientDeliveryMethod(agentState.deliveryMethod) : void 0)).ok) throw new Error(`${getHarnessBehavior(effectiveHarness).displayName} continue prompt delivery failed`);
9771
11023
  } else await Effect.runPromise(sendKeys(normalizedId, prompt));
9772
11024
  }
@@ -9878,13 +11130,13 @@ async function recoverAgent(agentId, opts = {}) {
9878
11130
  health.recoveryCount = (health.recoveryCount || 0) + 1;
9879
11131
  writeFileSync(healthFile, JSON.stringify(health, null, 2));
9880
11132
  const recoveryPrompt = generateRecoveryPrompt(state);
9881
- const providerEnv = state.model ? await getProviderEnvForModel(state.model) : {};
11133
+ const recoveryHarness = normalizeHarness(state.harness ?? null) ?? "claude-code";
11134
+ const providerEnv = state.model ? await getProviderEnvForModel(state.model, recoveryHarness) : {};
9882
11135
  if (state.model) {
9883
11136
  const provider = getProviderForModelSync(state.model);
9884
11137
  if (provider.authType === "credential-file") setupCredentialFileAuthSync(provider, state.workspace);
9885
11138
  else clearCredentialFileAuthSync(state.workspace);
9886
11139
  }
9887
- const recoveryHarness = normalizeHarness(state.harness ?? null) ?? "claude-code";
9888
11140
  const harnessLaunch = await prepareHarnessLaunch(recoveryHarness);
9889
11141
  const recoverySupervisorLaunch = await prepareSupervisorForRelaunch(normalizedId, state, state.model, recoveryHarness);
9890
11142
  saveAgentStateSync(state);
@@ -9923,7 +11175,7 @@ async function recoverAgent(agentId, opts = {}) {
9923
11175
  state
9924
11176
  };
9925
11177
  }
9926
- if (recoveryHarness === "acp") {
11178
+ if (recoveryHarness === "acp" || recoveryHarness === "opencode" || recoveryHarness === "muse") {
9927
11179
  const resumeSessionId = resolveRecoveryResumeSessionId(normalizedId, recoveryHarness);
9928
11180
  const { launcherContent, providerEnv: acpProviderEnv } = await buildAgentLaunchConfig({
9929
11181
  agentId: normalizedId,
@@ -9935,7 +11187,9 @@ async function recoverAgent(agentId, opts = {}) {
9935
11187
  spawnMode: "resume",
9936
11188
  resumeSessionId
9937
11189
  } : {},
9938
- harness: "acp",
11190
+ harness: recoveryHarness,
11191
+ useSupervisor: recoverySupervisorLaunch.useSupervisor,
11192
+ supervisorScriptPath: recoverySupervisorLaunch.supervisorScriptPath,
9939
11193
  harnessBinaryPath: harnessLaunch.binaryPath,
9940
11194
  extraEnvExports: [harnessLaunch.pathExport]
9941
11195
  });
@@ -9949,14 +11203,18 @@ async function recoverAgent(agentId, opts = {}) {
9949
11203
  CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
9950
11204
  ...acpProviderEnv
9951
11205
  } }));
9952
- const delivery = await deliverInitialPromptWithRetry(normalizedId, recoveryPrompt, "recoverAgent:acp-recovery-prompt");
11206
+ if (recoveryHarness === "muse" && !await waitForPromptReady(normalizedId, recoveryHarness, getHarnessBehavior(recoveryHarness).readyTimeoutSeconds)) {
11207
+ await Effect.runPromise(stopAgent(normalizedId));
11208
+ throw new Error(`Muse recovery readiness timed out for ${normalizedId}`);
11209
+ }
11210
+ const delivery = await deliverInitialPromptWithRetry(normalizedId, recoveryPrompt, `recoverAgent:${recoveryHarness}-recovery-prompt`);
9953
11211
  if (!delivery.ok) {
9954
11212
  await Effect.runPromise(stopAgent(normalizedId));
9955
- throw new Error(`ACP recovery prompt delivery failed for ${normalizedId}: ${delivery.failure ?? "unknown failure"}`);
11213
+ throw new Error(`${getHarnessBehavior(recoveryHarness).displayName} recovery prompt delivery failed for ${normalizedId}: ${delivery.failure ?? "unknown failure"}`);
9956
11214
  }
9957
11215
  markAgentRunning(state);
9958
11216
  saveAgentStateSync(state);
9959
- logAgentLifecycleSync(normalizedId, `recoverAgent SUCCESS: recoveryCount=${health.recoveryCount} (acp)`);
11217
+ logAgentLifecycleSync(normalizedId, `recoverAgent SUCCESS: recoveryCount=${health.recoveryCount} (${recoveryHarness})`);
9960
11218
  return {
9961
11219
  action: "respawned",
9962
11220
  state
@@ -9983,7 +11241,7 @@ async function recoverAgent(agentId, opts = {}) {
9983
11241
  const launchAndCaptureKimiSession = async () => {
9984
11242
  let kimiExistingSessionsBefore;
9985
11243
  if (!resumeSessionId) try {
9986
- const { kimiSessionsRoot } = await import("./kimi-code-BxkDgaj4.js");
11244
+ const { kimiSessionsRoot } = await import("./kimi-code-Cx5YUJpS.js");
9987
11245
  kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), state.workspace)));
9988
11246
  } catch {
9989
11247
  kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
@@ -9997,13 +11255,13 @@ async function recoverAgent(agentId, opts = {}) {
9997
11255
  ...kimiProviderEnv
9998
11256
  } }));
9999
11257
  if (kimiExistingSessionsBefore) {
10000
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-BxkDgaj4.js");
11258
+ const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cx5YUJpS.js");
10001
11259
  const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), state.workspace, kimiExistingSessionsBefore);
10002
11260
  if (sessionId) writeKimiSessionId(normalizedId, sessionId);
10003
11261
  else throw new Error(`kimi-code session capture timed out after fresh relaunch for ${normalizedId} — no new session directory appeared under the workspace bucket`);
10004
11262
  }
10005
11263
  };
10006
- const { withKimiSessionCaptureLock } = await import("./kimi-code-BxkDgaj4.js");
11264
+ const { withKimiSessionCaptureLock } = await import("./kimi-code-Cx5YUJpS.js");
10007
11265
  try {
10008
11266
  await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), state.workspace, launchAndCaptureKimiSession);
10009
11267
  } catch (err) {
@@ -10029,7 +11287,7 @@ async function recoverAgent(agentId, opts = {}) {
10029
11287
  workingDir: state.workspace,
10030
11288
  changeDir: false,
10031
11289
  setTerminalEnv: true,
10032
- providerExports: (await getProviderExportsForModel(state.model)).trimEnd(),
11290
+ providerExports: (await getProviderExportsForModel(state.model, recoveryHarness)).trimEnd(),
10033
11291
  extraEnvExports: [harnessLaunch.pathExport],
10034
11292
  baseCommand: await getRoleRuntimeBaseCommand(state.model, normalizedId, recoveryRole, recoveryHarness),
10035
11293
  appendSystemPromptFiles: await claudeSystemPromptFiles(state.workspace, recoveryHarness),
@@ -10116,6 +11374,7 @@ async function autoRecoverAgents() {
10116
11374
  };
10117
11375
  }
10118
11376
  var init_recovery = __esmMin((() => {
11377
+ init_muse_session();
10119
11378
  init_child_env();
10120
11379
  init_activity();
10121
11380
  init_graceful_restart();
@@ -11927,6 +13186,6 @@ var init_agent_state = __esmMin((() => {
11927
13186
  };
11928
13187
  }));
11929
13188
  //#endregion
11930
- export { deliverCommitForReview as $, isTerminalSwarmSlotAgent as $n, piFifoPaths as $r, init_activity as $t, saveAgentStateSync as A, getAgentRuntimeSnapshot as Ai, init_runtime_census as An, transitionIssueToInReview as Ar, init_agent_input_detection as At, resolveAgentTargetSync as B, markAgentStateServiceInProcess as Bi, countRunningAgents as Bn, getAgentRuntimeBaseCommand as Br, isContextOverflowError as Bt, markAgentTroubled as C, writeChannelsBridgeMcpConfig as Ci, init_state_dir_removal as Cn, paneShowsCodexAuthBurn as Cr, getAgentWorkspace as Ct, recordStartupSessionExit as D, writePtyToken as Di, descendantPidsForSession as Dn, init_spawn_prep as Dr, scanPendingInputsPromise as Dt, recordAgentFailureSync as E, init_pty_token as Ei, removeAgentStateDir as En, defaultRunWorkspace as Er, isInteractiveRoleAgent as Et, writeAgentStateJsonSync as F, init_agents$1 as Fi, init_collector as Fn, init_resolve_tier as Fr, resumeAgent as Ft, init_runtime_state as G, init_concurrency as Gn, getRoleRuntimeBaseCommand as Gr, resolveAgentDeliveryMethod as Gt, waitForReadySignal as H, describeRunningAgents as Hn, getKimiCodeLauncherFields as Hr, init_messaging as Ht, isRole as I, init_agent_record_sync as Ii, LINUX_MEMORY_PRESSURE_DEFAULTS as In, resolveTier as Ir, answerSessionPaneChoice as It, compactAtTierRunBoundary as J, resetPatrolDispatchBudget as Jn, injectPiConversationMemory as Jr, appendActivity as Jt, saveAgentRuntimeState as K, releaseAdvancingSlot as Kn, hasAgentRuntimeInSubtree as Kr, init_operator_interventions as Kt, clearReadySignal as L, readAgentHarnessModelRecordSync as Li, init_linux as Ln, OHMYPI_AGENT_READY_TIMEOUT_SECONDS as Lr, captureSessionPaneChoice as Lt, setAgentPausedSync as M, appendAgentPlaneLifecycle as Mi, refreshRuntimeCensus as Mn, resolveImplicitStaffing as Mr, parseCodexApprovalPrompt as Mt, setAgentYieldedSync as N, appendAgentPlaneSession as Ni, runtimeCensusHasHarnessProcess as Nn, resolveIssueWorkModel as Nr, buildCompactRecoverySeed as Nt, resetAgentFailureCount as O, init_pty_supervisor_locate as Oi, getRuntimeCensus as On, retrieveSpawnTimeMemoryContext as Or, detectAwaitingInputForAgent as Ot, wipeAgentStateDirs as P, flushAgentPlaneWrites as Pi, createHostHealthCollector as Pn, resolveStaffing as Pr, init_resume as Pt, shouldReplayCompactAtTierRunBoundary as Q, init_swarm_slot_lifecycle as Qn, init_pi_fifo as Qr, getSessionId as Qt, isQualifiedAgentId as R, getRuntimeSnapshot as Ri, DARWIN_MEMORY_PRESSURE_DEFAULTS as Rn, describeOhmypiSpawnFailure as Rr, init_session_pane_choice as Rt, markAgentStoppedState as S, init_supervisor_channels as Si, hasRetainedTranscriptsMarker as Sn, isCodexAuthRouted as Sr, getAgentPendingQuestions as St, recordAgentFailure as T, init_resume_contract as Ti, markRetainedTranscripts as Tn, buildAgentLaunchConfig as Tr, isBlockedOnPendingInput as Tt, getAgentRuntimeState as U, emergencyBrake as Un, getOhmypiLauncherFields as Ur, messageAgent as Ut, waitForAgentIdle as V, setAgentRuntimeMirror as Vi, countRunningSwarmSlotsForIssue as Vn, getCodexLauncherFields as Vr, isContextOverflowTail as Vt, getAgentRuntimeStateSync as W, getConcurrencyLimits as Wn, getProviderAuthMode as Wr, messageAgentWithOutcome as Wt, replayCrashedStandingAgent as X, tryReserveSwarmSlot as Xn, waitForAcpHostReady as Xr, getLatestSessionId as Xt, contextWindowForModel as Y, tryReserveAdvancingSlot as Yn, roleAgentDefinitionPath as Yr, getActivity as Yt, replayStandingAgent as Z, workResumeSlotsAvailable as Zn, waitForPromptReady as Zr, getLatestSessionIdSync as Zt, init_agent_state as _, buildResumeContinueMessage as _i, listAgentStates as _n, init_bridge_token as _r, init_pending_decision_gate as _t, clearAgentOperatorGatesForIssuesSync as a, init_claude_auth as ai, init_spawn as an, deliverAgentMessage as ar, broadcastCommit as at, markAgentRunning as b, dismissDevChannelsDialog as bi, warnOnBareNumericIssueIds as bn, checkCodexAuthStatus as br, getAgentJsonlMtime as bt, clearAgentTroubled as c, determineModel as ci, ensureRegisteredSlotWorktree as cn, deliverResumeMessageWithTranscriptConfirmation as cr, init_tier_escalation as ct, decideResumeGate as d, getProviderTmuxFlags as di, init_session_history as dn, resilientDeliveryMethod as dr, reconcileSlotState as dt, init_ohmypi_fifo as ei, resolveLatestSessionIdSync as en, getCachedMemoryVerdict as er, init_tier_supervisor as et, getAgentDir as f, init_provider_health as fi, init_termination as fn, setAgentDeliveryMethod as fr, autoRecoverAgents as ft, getAgentStateSync as g, buildDefaultResumeContinueMessage as gi, init_queries as gn, BRIDGE_TOKEN_HEADER as gr, detectPendingOperatorDecision as gt, getAgentStateFilePath as h, init_openai_auth as hi, dropLegacyAgentStatesMissingRoleAsync as hn, probeTranscriptSince as hr, restartAgent as ht, clearAgentOperatorGatesForIssueSync as i, getClaudeAuthStatus as ii, init_ohmypi as in, SocketPostStatusError as ir, supervisorAgentId as it, setAgentPaused as j, init_agent_runtime as ji, panePidsForSession as jn, init_staffing as jr, normalizeAwaitingInputPrompt as jt, saveAgentState as k, resolvePtySupervisorScriptPath as ki, getRuntimeCensusSnapshot as kn, transitionIssueToInProgress as kr, detectAwaitingInputFromPaneSync as kt, clearAgentTroubledSync as l, getProviderEnvForModel as li, init_registered_slot_spawn as ln, init_delivery as lr, init_slot_reconcile as lt, getAgentState as m, getOpenAIAuthStatus as mi, stopAgentSync as mn, init_transcript_landing as mr, recoverAgent as mt, SESSION_EXITED_BEFORE_KICKOFF as n, init_context as ni, init_event_reads as nn, setCachedMemoryVerdict as nr, shouldSupervise as nt, clearAgentPaused as o, buildCavemanExports as oi, spawnAgent as on, deliverAgentPermissionDecision as or, init_tier_feed as ot, getAgentResumeGateBlockReason as p, validateProviderHealth as pi, stopAgent as pn, captureTranscriptUserRecordSnapshot as pr, detectCrashedAgents as pt, init_agents as q, releaseSwarmSlot as qn, init_runtime_command as qr, operatorInterventionEvent as qt, __testInternals as r, materializeAcpContextFile as ri, createOhmypiRuntimeSync as rn, AmbiguousKeyedDeliveryError as rr, spawnTierSupervisor as rt, clearAgentPausedSync as s, buildSpawnEnvForModel as si, spawnRun as sn, deliverInitialPromptWithRetry as sr, decideEscalation as st, GOVERNOR_SLOT_PAUSE_REASON_PREFIX as t, ohmypiFifoPaths as ti, saveSessionId as tn, init_memory_verdict_cache as tr, loadPrdDraft as tt, clearYieldForResumeSync as u, getProviderExportsForModel as ui, appendSessionIdToHistory as un, keyedSupervisorFailureKind as ur, listSlotAssignments as ut, isAgentPaused as v, decideChannelsForWorkAgent as vi, listRunningAgents as vn, writeBridgeTokenSync as vr, computeAgentEnrichment as vt, recordAgentActivitySync as w, buildResumeContract as wi, listAgentStateFilesForRemoval as wn, assertWorkspaceStackHealthyForSpawn as wr, init_agent_enrichment as wt, markAgentRunningState as x, hasCompletionMarkerForAgent as xi, RETAINED_TRANSCRIPTS_MARKER as xn, init_codex_auth as xr, getAgentJsonlPath as xt, isAgentTroubled as y, decideSupervisorForWorkAgent as yi, listRunningAgentsSync as yn, applyCodexAuthBurnFlag as yr, countPendingAskUserQuestionsForAgent as yt, normalizeAgentId as z, init_agent_runtime_mirror as zi, init_darwin as zn, getAcpLauncherFields as zr, init_context_overflow as zt };
13189
+ export { deliverCommitForReview as $, getOpenAIAuthStatus as $i, createHostHealthCollector as $n, resolveStaffing as $r, getLatestSessionIdSync as $t, saveAgentStateSync as A, codexGlobalContextFile as Ai, init_session_history as An, resilientDeliveryMethod as Ar, init_agent_input_detection as At, resolveAgentTargetSync as B, validateTemplate as Bi, RETAINED_TRANSCRIPTS_MARKER as Bn, init_codex_auth as Br, init_session_pane_choice as Bt, markAgentTroubled as C, getRuntimeSnapshot as Ca, ohmypiFifoPaths as Ci, waitForNewKimiSession as Cn, SocketPostStatusError as Cr, getAgentWorkspace as Ct, recordStartupSessionExit as D, init_render as Di, ensureRegisteredSlotWorktree as Dn, deliverResumeMessageWithTranscriptConfirmation as Dr, scanPendingInputsPromise as Dt, recordAgentFailureSync as E, setAgentRuntimeMirror as Ea, configDisabledRuleNames as Ei, writeKimiSessionId as En, deliverInitialPromptWithRetry as Er, isInteractiveRoleAgent as Et, writeAgentStateJsonSync as F, resolveProjectContextFile as Fi, init_queries as Fn, BRIDGE_TOKEN_HEADER as Fr, resumeAgent as Ft, init_runtime_state as G, buildCavemanExports as Gi, removeAgentStateDir as Gn, defaultRunWorkspace as Gr, messageAgent as Gt, waitForReadySignal as H, workspaceContextWithoutProjectLayer as Hi, init_state_dir_removal as Hn, paneShowsCodexAuthBurn as Hr, isContextOverflowError as Ht, isRole as I, resolveWorkspaceContextFile as Ii, listAgentStates as In, init_bridge_token as Ir, init_review_lifecycle_guard as It, compactAtTierRunBoundary as J, getProviderEnvForModel as Ji, getRuntimeCensusSnapshot as Jn, transitionIssueToInProgress as Jr, init_operator_interventions as Jt, saveAgentRuntimeState as K, buildSpawnEnvForModel as Ki, descendantPidsForSession as Kn, init_spawn_prep as Kr, messageAgentWithOutcome as Kt, clearReadySignal as L, workspaceContextFile as Li, listRunningAgents as Ln, writeBridgeTokenSync as Lr, withReviewLifecycleGuard as Lt, setAgentPausedSync as M, globalContextFile as Mi, stopAgent as Mn, captureTranscriptUserRecordSnapshot as Mr, parseCodexApprovalPrompt as Mt, setAgentYieldedSync as N, init_layers as Ni, stopAgentSync as Nn, init_transcript_landing as Nr, buildCompactRecoverySeed as Nt, resetAgentFailureCount as O, init_rules as Oi, init_registered_slot_spawn as On, init_delivery as Or, detectAwaitingInputForAgent as Ot, wipeAgentStateDirs as P, piGlobalContextFile as Pi, dropLegacyAgentStatesMissingRoleAsync as Pn, probeTranscriptSince as Pr, init_resume as Pt, shouldReplayCompactAtTierRunBoundary as Q, validateProviderHealth as Qi, runtimeCensusHasHarnessProcess as Qn, resolveIssueWorkModel as Qr, getLatestSessionId as Qt, isQualifiedAgentId as R, init_harness as Ri, listRunningAgentsSync as Rn, applyCodexAuthBurnFlag as Rr, answerSessionPaneChoice as Rt, markAgentStoppedState as S, readAgentHarnessModelRecordSync as Sa, init_ohmypi_fifo as Si, launchAndCaptureManagedKimiSession as Sn, AmbiguousKeyedDeliveryError as Sr, getAgentPendingQuestions as St, recordAgentFailure as T, markAgentStateServiceInProcess as Ta, materializeAcpContextFile as Ti, withKimiSessionCaptureLock as Tn, deliverAgentPermissionDecision as Tr, isBlockedOnPendingInput as Tt, getAgentRuntimeState as U, getClaudeAuthStatus as Ui, listAgentStateFilesForRemoval as Un, assertWorkspaceStackHealthyForSpawn as Ur, isContextOverflowTail as Ut, waitForAgentIdle as V, init_assemble as Vi, hasRetainedTranscriptsMarker as Vn, isCodexAuthRouted as Vr, init_context_overflow as Vt, getAgentRuntimeStateSync as W, init_claude_auth as Wi, markRetainedTranscripts as Wn, buildAgentLaunchConfig as Wr, init_messaging as Wt, replayCrashedStandingAgent as X, getProviderTmuxFlags as Xi, panePidsForSession as Xn, init_staffing as Xr, appendActivity as Xt, contextWindowForModel as Y, getProviderExportsForModel as Yi, init_runtime_census as Yn, transitionIssueToInReview as Yr, operatorInterventionEvent as Yt, replayStandingAgent as Z, init_provider_health as Zi, refreshRuntimeCensus as Zn, resolveImplicitStaffing as Zr, getActivity as Zt, init_agent_state as _, appendAgentPlaneLifecycle as _a, waitForAcpHostReady as _i, findLatestKimiSessionAsync as _n, init_swarm_slot_lifecycle as _r, init_pending_decision_gate as _t, clearAgentOperatorGatesForIssuesSync as a, dismissDevChannelsDialog as aa, describeOhmypiSpawnFailure as ai, createOhmypiRuntimeSync as an, countRunningAgents as ar, broadcastCommit as at, markAgentRunning as b, init_agents$1 as ba, init_pi_fifo as bi, kimiSessionsRoot as bn, init_memory_verdict_cache as br, getAgentJsonlMtime as bt, clearAgentTroubled as c, writeChannelsBridgeMcpConfig as ca, getCodexLauncherFields as ci, spawnAgent as cn, emergencyBrake as cr, init_tier_escalation as ct, decideResumeGate as d, init_pty_token as da, getProviderAuthMode as di, KimiCodeRuntimeSync as dn, releaseAdvancingSlot as dr, reconcileSlotState as dt, init_openai_auth as ea, init_resolve_tier as ei, getSessionId as en, init_collector as er, init_tier_supervisor as et, getAgentDir as f, writePtyToken as fa, getRoleRuntimeBaseCommand as fi, KimiCodeSpawnTimeout as fn, releaseSwarmSlot as fr, autoRecoverAgents as ft, getAgentStateSync as g, init_agent_runtime as ga, roleAgentDefinitionPath as gi, findLatestKimiSession as gn, workResumeSlotsAvailable as gr, detectPendingOperatorDecision as gt, getAgentStateFilePath as h, getAgentRuntimeSnapshot as ha, injectPiConversationMemory as hi, findKimiWirePathAsync as hn, tryReserveSwarmSlot as hr, restartAgent as ht, clearAgentOperatorGatesForIssueSync as i, decideSupervisorForWorkAgent as ia, OHMYPI_AGENT_READY_TIMEOUT_SECONDS as ii, init_event_reads as in, init_darwin as ir, supervisorAgentId as it, setAgentPaused as j, ensureProjectLayer as ji, init_termination as jn, setAgentDeliveryMethod as jr, normalizeAwaitingInputPrompt as jt, saveAgentState as k, claudeGlobalContextFile as ki, appendSessionIdToHistory as kn, keyedSupervisorFailureKind as kr, detectAwaitingInputFromPaneSync as kt, clearAgentTroubledSync as l, buildResumeContract as la, getKimiCodeLauncherFields as li, spawnRun as ln, getConcurrencyLimits as lr, init_slot_reconcile as lt, getAgentState as m, resolvePtySupervisorScriptPath as ma, init_runtime_command as mi, findKimiWirePath as mn, tryReserveAdvancingSlot as mr, recoverAgent as mt, SESSION_EXITED_BEFORE_KICKOFF as n, buildResumeContinueMessage as na, init_muse_context as ni, resolveLatestSessionIdSync as nn, init_linux as nr, shouldSupervise as nt, clearAgentPaused as o, hasCompletionMarkerForAgent as oa, getAcpLauncherFields as oi, init_ohmypi as on, countRunningSwarmSlotsForIssue as or, init_tier_feed as ot, getAgentResumeGateBlockReason as p, init_pty_supervisor_locate as pa, hasAgentRuntimeInSubtree as pi, createKimiCodeRuntimeSync as pn, resetPatrolDispatchBudget as pr, detectCrashedAgents as pt, init_agents as q, determineModel as qi, getRuntimeCensus as qn, retrieveSpawnTimeMemoryContext as qr, resolveAgentDeliveryMethod as qt, __testInternals as r, decideChannelsForWorkAgent as ra, materializeMuseContext as ri, saveSessionId as rn, DARWIN_MEMORY_PRESSURE_DEFAULTS as rr, spawnTierSupervisor as rt, clearAgentPausedSync as s, init_supervisor_channels as sa, getAgentRuntimeBaseCommand as si, init_spawn as sn, describeRunningAgents as sr, decideEscalation as st, GOVERNOR_SLOT_PAUSE_REASON_PREFIX as t, buildDefaultResumeContinueMessage as ta, resolveTier as ti, init_activity as tn, LINUX_MEMORY_PRESSURE_DEFAULTS as tr, loadPrdDraft as tt, clearYieldForResumeSync as u, init_resume_contract as ua, getOhmypiLauncherFields as ui, KimiCaptureLockTimeoutError as un, init_concurrency as ur, listSlotAssignments as ut, isAgentPaused as v, appendAgentPlaneSession as va, waitForPromptReady as vi, init_kimi_code as vn, isTerminalSwarmSlotAgent as vr, computeAgentEnrichment as vt, recordAgentActivitySync as w, init_agent_runtime_mirror as wa, init_context as wi, waitForNewKimiSessionAsync as wn, deliverAgentMessage as wr, init_agent_enrichment as wt, markAgentRunningState as x, init_agent_record_sync as xa, piFifoPaths as xi, kimiWorkDirKey as xn, setCachedMemoryVerdict as xr, getAgentJsonlPath as xt, isAgentTroubled as y, flushAgentPlaneWrites as ya, claudeSystemPromptFiles as yi, kimiCaptureLockPath as yn, getCachedMemoryVerdict as yr, countPendingAskUserQuestionsForAgent as yt, normalizeAgentId as z, renderForHarness as zi, warnOnBareNumericIssueIds as zn, checkCodexAuthStatus as zr, captureSessionPaneChoice as zt };
11931
13190
 
11932
- //# sourceMappingURL=agent-state-FABw8neJ.js.map
13191
+ //# sourceMappingURL=agent-state-Ci6PhjOE.js.map