@overdeck/desktop 0.50.1 → 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 (570) hide show
  1. package/package.json +1 -1
  2. package/server/{acceptance-criteria-DFyrgxW5.js → acceptance-criteria-D-OIjvuX.js} +2 -2
  3. package/server/{active-dashboard-bundle-DbfgP8TS.js → active-dashboard-bundle-C-Ars7eG.js} +2 -2
  4. package/server/{activity-logger-DtdKxzPh.js → activity-logger-BRASNITk.js} +1 -1
  5. package/server/{activity-logger-ru8ggv-d.js → activity-logger-DNYDzAOU.js} +3 -3
  6. package/server/{advancing-selfheal-BdZ1iFJf.js → advancing-selfheal-Bq8V0QUa.js} +5 -5
  7. package/server/{agent-gc-DBMg1vIc.js → agent-gc-Coz8zQt_.js} +10 -10
  8. package/server/{agent-idle-CQlwmcRR.js → agent-idle-CAwB-K6M.js} +182 -30
  9. package/server/{agent-state-B0v3fvGI.js → agent-state-CbUEwUEQ.js} +1 -1
  10. package/server/{agent-state-BnyNoDWQ.js → agent-state-Ci6PhjOE.js} +1503 -245
  11. package/server/{agent-state-service-D95wBjA3.js → agent-state-service-D6IVrX3B.js} +5 -5
  12. package/server/{agent-state-service-GK2Uy8zc.js → agent-state-service-DcN1j6eK.js} +1 -1
  13. package/server/agents-BVvL4o_4.js +3 -0
  14. package/server/{agents-DMs1aLRU.js → agents-CkngXhQr.js} +4 -4
  15. package/server/archive-planning-CohTB7hg.js +2 -0
  16. package/server/{archive-planning-CFf5FVHQ.js → archive-planning-CtdBSD1-.js} +5 -5
  17. package/server/{artifact-index-jobs-BdeB5RIY.js → artifact-index-jobs-9ZdXQ9zH.js} +2 -2
  18. package/server/{auto-spawn-consent-C1avLtkk.js → auto-spawn-consent-CJeQM5e0.js} +281 -77
  19. package/server/{backlog-auto-trigger-oKIGNBzZ.js → backlog-auto-trigger-BuSBqG2V.js} +3 -3
  20. package/server/{behavior-CPX0E2Fj.js → behavior-Bg3yC8jC.js} +48 -35
  21. package/server/{bridge-pool-patrol-DstxbANA.js → bridge-pool-patrol-CkJ86c_r.js} +2 -2
  22. package/server/{briefing-freshness-FF0WLPMc.js → briefing-freshness-CEoe3yWS.js} +2 -2
  23. package/server/build-info-CYlxvZSQ.js +2 -0
  24. package/server/{build-info-DiA6h4T6.js → build-info-Cj3Y0K87.js} +3 -3
  25. package/server/{checkpoint-manager-CkXA-F6Z.js → checkpoint-manager-Bt4dnyyr.js} +2 -2
  26. package/server/{checkpoint-manager-D74ueYZp.js → checkpoint-manager-C1-9CFcu.js} +1 -1
  27. package/server/checkpoint-worker.js +1 -1
  28. package/server/{checkpoints-Ds83fUb1.js → checkpoints-3pyv5ikj.js} +2 -2
  29. package/server/{checkpoints-JIKy0UFv.js → checkpoints-Dgtp8549.js} +1 -1
  30. package/server/{claude-hooks-provision-D7Z8kANm.js → claude-hooks-provision-DWrqkc3x.js} +2 -2
  31. package/server/{claude-hooks-provision-BJ8LNIAe.js → claude-hooks-provision-DXac_UDF.js} +1 -1
  32. package/server/{claude-permissions-Bn53HCXr.js → claude-permissions-DX5BSnMH.js} +2 -2
  33. package/server/{claude-settings-overlay-QByq1SQa.js → claude-settings-overlay-ALboy05V.js} +1 -1
  34. package/server/{claude-settings-overlay-CqJZjFqv.js → claude-settings-overlay-CTkJUUHw.js} +2 -2
  35. package/server/{cli-BXmAb7vN.js → cli-DIhQieif.js} +11 -11
  36. package/server/cli-ZAS502uC.js +2 -0
  37. package/server/{cliproxy-ltFu5xfR.js → cliproxy-Dz_zq_4H.js} +1 -1
  38. package/server/{cliproxy-L_2OxNJf.js → cliproxy-QTm2vdgx.js} +2 -2
  39. package/server/{close-issue-BZAf0Ii-.js → close-issue-CRlmrE5g.js} +5 -5
  40. package/server/{closed-issue-reaper-DVtyOI4C.js → closed-issue-reaper-DWlw2EtL.js} +1 -1
  41. package/server/{closed-issue-reaper-BJa8SbvQ.js → closed-issue-reaper-DrHyYgJR.js} +13 -13
  42. package/server/{codex-BqLZKVNm.js → codex-DzLXjzbf.js} +1 -1
  43. package/server/{codex-DSs-3aOm.js → codex-pffr8qaN.js} +25 -18
  44. package/server/{compaction-continuation-TG0HYkOq.js → compaction-continuation-DhYgsXmF.js} +3 -3
  45. package/server/{config-DP0VV7rX.js → config-B-MLcKSo.js} +2 -2
  46. package/server/{config-Cx3N6gWz.js → config-BUjU7GZQ.js} +2 -2
  47. package/server/{config-DURnId0k.js → config-DN8ETZvK.js} +1 -1
  48. package/server/{config-yaml-OoH-ZpTb.js → config-yaml-Dce9VUd6.js} +416 -71
  49. package/server/{conflict-gate-SgOELW84.js → conflict-gate-Bt-lLgYf.js} +4 -4
  50. package/server/{conflict-gate-pMfhBEVB.js → conflict-gate-vczgdVTa.js} +1 -1
  51. package/server/{continue-Cmzd6leL.js → continue-DvNIJ-73.js} +2 -2
  52. package/server/{control-settings-Bdud_B1j.js → control-settings-BkaVFRdm.js} +5 -5
  53. package/server/{conversation-compaction-dFx_2wpa.js → conversation-compaction-CsdCbcQB.js} +8 -8
  54. package/server/{conversation-compaction-BX9UR8nl.js → conversation-compaction-D0zgWM1f.js} +1 -1
  55. package/server/{conversation-service-zgLM2g2D.js → conversation-service-6LaymUV-.js} +216 -78
  56. package/server/conversation-service-Dlks_hSS.js +3 -0
  57. package/server/conversations-BunNL58s.js +3 -0
  58. package/server/{conversations-JyrMSeOh.js → conversations-CPXMv_JQ.js} +11 -9
  59. package/server/{scanner-BEAzmMNs.js → conversations-search-DnWUghbM.js} +397 -48
  60. package/server/{cost-DR57uJFP.js → cost-PJXEAirJ.js} +8 -8
  61. package/server/{cost-CxXv7ei-.js → cost-ShD-G0cS.js} +44 -2
  62. package/server/{cost-MZ7EZFDc.js → cost-eaAmJTX9.js} +3 -3
  63. package/server/{cost-sync-Bq_dyq9k.js → cost-sync-EFEkMYWz.js} +26 -56
  64. package/server/{dag-CKUsr8wB.js → dag-Drz6Nrnf.js} +2 -2
  65. package/server/dashboard-db-worker.js +52 -10
  66. package/server/{deacon-C7qZxRuW.js → deacon-CU47dU7U.js} +169 -131
  67. package/server/{deacon-BUOpTnmQ.js → deacon-DYsOa_ss.js} +3 -3
  68. package/server/{deacon-canonical-state-hcaZgjoT.js → deacon-canonical-state-wi63RApC.js} +3 -3
  69. package/server/{deacon-event-client-Coiopt4u.js → deacon-event-client-DY8U1EbU.js} +2 -2
  70. package/server/{deacon-event-client-DJ71Tifg.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-Dv0-8bZG.js → deacon-pending-lifecycle-ijGX8wLb.js} +2 -2
  73. package/server/deacon.js +11 -11
  74. package/server/{dead-end-trip-DH_hA7yS.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-Cv96N0s6.js → deploy-patrol-C4eXco1S.js} +8 -8
  78. package/server/deploy-queue-C3KIJizG.js +2 -0
  79. package/server/{deploy-queue-EcksuKE2.js → deploy-queue-TDZ2tzRF.js} +2 -2
  80. package/server/{deploy-window-BXbzS0zN.js → deploy-window-CdInEAuR.js} +4 -4
  81. package/server/{deploy-window-CHgL_TTN.js → deploy-window-DkjV-Haz.js} +1 -1
  82. package/server/{dev-supervisor-lNaYB136.js → dev-supervisor-CrYlJS2n.js} +2 -2
  83. package/server/{devcontainer-renderer-q8q9aXRd.js → devcontainer-renderer-DL8lfn0Y.js} +4 -4
  84. package/server/{docker-BNd0tMdS.js → docker-DLIwccCS.js} +1 -1
  85. package/server/{docker-Dk-shfga.js → docker-fz7ELYZ8.js} +3 -3
  86. package/server/{dod-BAk5arLF.js → dod-C9m0JqhG.js} +1 -1
  87. package/server/{done-preflight-CukR3Br8.js → done-preflight-CaILZ394.js} +5 -5
  88. package/server/{done-preflight-AiXnYYAy.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-YXncXZ5Q.js → ensure-devcontainer-C2rKQXgr.js} +4 -4
  92. package/server/{ensure-devcontainer-BjMV_gdX.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-DbjldlXW.js → event-store-BYOh686E.js} +5 -5
  95. package/server/{event-store-CFnLP8w-.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-Bb2x5ijT.js → events-BCPdiWG9.js} +3 -3
  98. package/server/{factory-DfIQG-qW.js → factory-BC18rvHD.js} +4 -4
  99. package/server/{feature-registry-storage-BzAGS4DA.js → feature-registry-storage-CASMzD0N.js} +2 -2
  100. package/server/{features-KxOILHX8.js → features-B1O5F33h.js} +2 -2
  101. package/server/{feedback-stuck-retirement-BqTHm-1Z.js → feedback-stuck-retirement-Dd5XNrMr.js} +2 -2
  102. package/server/{feedback-target-BjLidX0M.js → feedback-target-BcsA_GRV.js} +10 -10
  103. package/server/{feedback-target-D2CIZFwc.js → feedback-target-BzdJ2wIR.js} +1 -1
  104. package/server/{feedback-writer-BrSQ4fC-.js → feedback-writer-DfMoEtQc.js} +1 -1
  105. package/server/{feedback-writer-Dgrma-L1.js → feedback-writer-lbXBFycU.js} +5 -5
  106. package/server/{flywheel-Ds0eOd1P.js → flywheel-B34cdfbd.js} +1 -1
  107. package/server/{flywheel-X6kvGnf2.js → flywheel-D0guNqkh.js} +14 -14
  108. package/server/{flywheel-D5FchYg4.js → flywheel-Is3w2lcT.js} +16 -16
  109. package/server/{flywheel-merge-order-PTHnouQS.js → flywheel-merge-order-6HiPR2WG.js} +1 -1
  110. package/server/{flywheel-merge-order-BTY73Efv.js → flywheel-merge-order-BsNPMu0S.js} +8 -8
  111. package/server/forge-B1cpL4SY.js +2 -0
  112. package/server/{forge-B08cRXEb.js → forge-CEe3eFjh.js} +2 -2
  113. package/server/{fs-lock-DfiYlr5u.js → fs-lock-VCGoXZI5.js} +2 -2
  114. package/server/{fts-operations-Do1SP0w4.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-DfpFkvwk.js → git-utils-D96xW28f.js} +4 -4
  117. package/server/{git-utils-fcK3ZRNj.js → git-utils-DvcWLgGS.js} +1 -1
  118. package/server/{github-app-Co8ZhyUJ.js → github-app-BINlfWAA.js} +3 -2
  119. package/server/{github-app-HAqQZZRD.js → github-app-BxM1U38q.js} +1 -1
  120. package/server/{github-client-wqbDCmlL.js → github-client-DJVl4iDm.js} +3 -3
  121. package/server/{github-client-C7MUxFzX.js → github-client-oJHo9dyA.js} +1 -1
  122. package/server/{github-pr-lookup-DdLCDdu9.js → github-pr-lookup-DQEtdiyR.js} +2 -2
  123. package/server/{harness-binary-BuakhXkB.js → harness-binary-DnRGvN6T.js} +6 -3
  124. package/server/{harness-resolve-CISjc9FR.js → harness-resolve-CzTFVZ5l.js} +4 -4
  125. package/server/{health-events-CIE7gy34.js → health-events-CF2WMNkI.js} +2 -2
  126. package/server/{health-events-9RhRGZK1.js → health-events-Dv7rzyit.js} +1 -1
  127. package/server/{hooks-CmL3TXla.js → hooks-DKzqJ4HF.js} +1 -1
  128. package/server/{hooks-D55VTdQS.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-CZbJ0xpl.js → identity-Dc7rQLln.js} +3 -3
  132. package/server/{idle-stack-reaper-CjovDCet.js → idle-stack-reaper-C0NYGCVq.js} +4 -4
  133. package/server/{idle-stack-reaper-DhbFdkWv.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-BbSWNOpH.js → infra-B05o-e2g.js} +4 -4
  136. package/server/{injection-DsQDBSEi.js → injection-Bk_pw2Ei.js} +1 -1
  137. package/server/{injection-BSnn_10a.js → injection-DkaIMCnX.js} +8 -8
  138. package/server/{inspect-agent-DS8j2v6U.js → inspect-agent-CP7Bu47O.js} +14 -12
  139. package/server/inspect-agent-DTuSg95i.js +2 -0
  140. package/server/{internal-token-CkrMLCLU.js → internal-token-CWcdG-Kw.js} +1 -1
  141. package/server/{internal-token-CUKcTWSG.js → internal-token-Ci0LxMIq.js} +2 -2
  142. package/server/{io-BgzG56av.js → io-Cm4Sf_6P.js} +4 -4
  143. package/server/{issue-closed-DZEwD3ol.js → issue-closed-D7aMUeMq.js} +7 -7
  144. package/server/{issue-lifecycle-LgYeE1o2.js → issue-lifecycle-BPbczKyy.js} +32 -30
  145. package/server/{issue-lifecycle-Bnfbpkmk.js → issue-lifecycle-FaugTi39.js} +1 -1
  146. package/server/{issue-service-singleton-Bsb0GaY8.js → issue-service-singleton-BrZQJLRI.js} +11 -11
  147. package/server/{issue-service-singleton-COEqWNKE.js → issue-service-singleton-Dsad9NTt.js} +1 -1
  148. package/server/{issue-title-fallback-D4_b2XwP.js → issue-title-fallback-BDxHa3-u.js} +3 -3
  149. package/server/{issues-DYAEUW45.js → issues-Q62MKOV_.js} +2 -2
  150. package/server/{jsonl-parser-1IqHI9Yb.js → jsonl-parser-DSJisyfy.js} +5 -4
  151. package/server/{jsonl-resolver-BJ8Hg-yD.js → jsonl-resolver-DQEe0DHM.js} +12 -9
  152. package/server/kimi-code-Cx5YUJpS.js +3 -0
  153. package/server/{kimi-parser-DFsZQArz.js → kimi-parser-5VpMzIDq.js} +2 -2
  154. package/server/{label-cleanup-Bej6xDZK.js → label-cleanup-DjQGmcZQ.js} +3 -3
  155. package/server/{lifecycle-BibLMHBH.js → lifecycle-BSQIQ1Sq.js} +2 -2
  156. package/server/{lifecycle-CMpSB9sn.js → lifecycle-DZFHmpGI.js} +6 -6
  157. package/server/{lifecycle-io-CLWwYZaR.js → lifecycle-io-Bv4XQMRi.js} +1 -1
  158. package/server/{lifecycle-io-CCCAMefe.js → lifecycle-io-CW__VX8s.js} +5 -5
  159. package/server/{linear-client-BtYl16Cy.js → linear-client-DnX3CcAL.js} +1 -1
  160. package/server/{linear-client-fpL-qJEa.js → linear-client-DrRZ3We7.js} +4 -7
  161. package/server/{linear-mcp-auth-nAYWoUbH.js → linear-mcp-auth-BFlpMvWh.js} +5 -5
  162. package/server/{linear-mcp-auth-CQ7ROT1X.js → linear-mcp-auth-DylPJABZ.js} +1 -1
  163. package/server/memory-fts-worker.js +1 -1
  164. package/server/{memory-governor-Mi5zF5zw.js → memory-governor-B7uDWRo9.js} +29 -22
  165. package/server/{merge-_XIivhkq.js → merge-BGozpxFt.js} +3 -3
  166. package/server/{merge-DCuDLiy9.js → merge-CphMVME2.js} +1 -1
  167. package/server/{merge-agent-svBDRWB6.js → merge-agent-ddEcZDZD.js} +2 -2
  168. package/server/{merge-agent-zF9vqWqY.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-CeQheehh.js → merge-completeness-CsSvQJxw.js} +1 -1
  171. package/server/{merge-completeness-CQPqu-pI.js → merge-completeness-YQbhKLPk.js} +4 -4
  172. package/server/{merge-eligibility-CJrBhQQe.js → merge-eligibility-BGqmx_bG.js} +1 -1
  173. package/server/{merge-eligibility-DhxVE8qU.js → merge-eligibility-CvQBc_9D.js} +4 -4
  174. package/server/merge-ops-Bgc-EScO.js +2 -0
  175. package/server/{merge-rebase-Bjo45m3k.js → merge-rebase-BbLnMyfQ.js} +2 -2
  176. package/server/merge-rebase-BgYoyMul.js +2 -0
  177. package/server/{merge-set-COZvz2nx.js → merge-set-DRPWriK9.js} +4 -4
  178. package/server/{merge-set-ChxZgjBB.js → merge-set-DaU9Ruxy.js} +1 -1
  179. package/server/{merge-sync-DuJ6Vkl3.js → merge-sync-BRKJM70R.js} +1 -1
  180. package/server/{merge-sync-CCi1Esdx.js → merge-sync-CTGkR1_m.js} +2 -2
  181. package/server/{merge-train-deps-C0P0qGKe.js → merge-train-deps-GPlHOjK6.js} +4 -4
  182. package/server/{merge-train-DTJXF8ph.js → merge-train-f_un38UJ.js} +4 -4
  183. package/server/{merge-verification-C5FexOBZ.js → merge-verification-BPBW3Hu3.js} +6 -6
  184. package/server/{merged-docker-cleanup-worker-0SEDG3Ao.js → merged-docker-cleanup-worker-By0YSsIP.js} +1 -1
  185. package/server/{merged-docker-cleanup-worker-C-kSp_jw.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 +8 -8
  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 -12
  196. package/server/node_modules/@types/node/buffer.d.ts +237 -103
  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 -1007
  206. package/server/node_modules/@types/node/dgram.d.ts +81 -133
  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 +85 -256
  213. package/server/node_modules/@types/node/fs.d.ts +525 -865
  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 +312 -433
  217. package/server/node_modules/@types/node/http2.d.ts +891 -545
  218. package/server/node_modules/@types/node/https.d.ts +243 -64
  219. package/server/node_modules/@types/node/index.d.ts +7 -25
  220. package/server/node_modules/@types/node/inspector.d.ts +58 -70
  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 +222 -208
  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 +690 -339
  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 +454 -197
  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 +257 -166
  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 -7
  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 -26
  249. package/server/node_modules/@types/node/tty.d.ts +43 -61
  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 -24
  263. package/server/node_modules/undici-types/agent.d.ts +13 -12
  264. package/server/node_modules/undici-types/api.d.ts +26 -26
  265. package/server/node_modules/undici-types/balanced-pool.d.ts +12 -13
  266. package/server/node_modules/undici-types/client.d.ts +37 -63
  267. package/server/node_modules/undici-types/connector.d.ts +2 -5
  268. package/server/node_modules/undici-types/cookies.d.ts +1 -3
  269. package/server/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  270. package/server/node_modules/undici-types/dispatcher.d.ts +139 -136
  271. package/server/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  272. package/server/node_modules/undici-types/errors.d.ts +54 -92
  273. package/server/node_modules/undici-types/eventsource.d.ts +4 -9
  274. package/server/node_modules/undici-types/fetch.d.ts +25 -51
  275. package/server/node_modules/undici-types/file.d.ts +39 -0
  276. package/server/node_modules/undici-types/filereader.d.ts +54 -0
  277. package/server/node_modules/undici-types/formdata.d.ts +7 -7
  278. package/server/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  279. package/server/node_modules/undici-types/global-origin.d.ts +5 -5
  280. package/server/node_modules/undici-types/handlers.d.ts +9 -10
  281. package/server/node_modules/undici-types/header.d.ts +1 -162
  282. package/server/node_modules/undici-types/index.d.ts +47 -69
  283. package/server/node_modules/undici-types/interceptors.d.ts +9 -72
  284. package/server/node_modules/undici-types/mock-agent.d.ts +18 -36
  285. package/server/node_modules/undici-types/mock-client.d.ts +4 -6
  286. package/server/node_modules/undici-types/mock-errors.d.ts +3 -3
  287. package/server/node_modules/undici-types/mock-interceptor.d.ts +21 -26
  288. package/server/node_modules/undici-types/mock-pool.d.ts +4 -6
  289. package/server/node_modules/undici-types/package.json +1 -1
  290. package/server/node_modules/undici-types/patch.d.ts +4 -0
  291. package/server/node_modules/undici-types/pool-stats.d.ts +8 -8
  292. package/server/node_modules/undici-types/pool.d.ts +14 -14
  293. package/server/node_modules/undici-types/proxy-agent.d.ts +6 -14
  294. package/server/node_modules/undici-types/readable.d.ts +16 -19
  295. package/server/node_modules/undici-types/retry-agent.d.ts +1 -1
  296. package/server/node_modules/undici-types/retry-handler.d.ts +10 -19
  297. package/server/node_modules/undici-types/util.d.ts +3 -3
  298. package/server/node_modules/undici-types/webidl.d.ts +30 -148
  299. package/server/node_modules/undici-types/websocket.d.ts +10 -48
  300. package/server/{orphan-proposed-reconciler-BSsKWmsB.js → orphan-proposed-reconciler-DFHdQSEg.js} +21 -21
  301. package/server/{orphan-proposed-reconciler--V8GIzmY.js → orphan-proposed-reconciler-DzAxrM99.js} +2 -2
  302. package/server/package-lock.json +9 -9
  303. package/server/package.json +1 -1
  304. package/server/{pan-dir-COaYhZel.js → pan-dir-Bs9fme2I.js} +4 -4
  305. package/server/{parked-residue-Dvr4W9P6.js → parked-residue-DMtbxJml.js} +31 -31
  306. package/server/{paths-Cm1Q7Old.js → paths-eTg2jV4C.js} +2 -2
  307. package/server/{pickup-Dle6k9Xt.js → pickup-TwHZNJn4.js} +1 -1
  308. package/server/{pipeline-agent-reader-DCCwbUj8.js → pipeline-agent-reader-CHugmNSx.js} +3 -3
  309. package/server/{pipeline-membership-C9ykcjsn.js → pipeline-membership-BvkkuVml.js} +1 -1
  310. package/server/{pipeline-membership-BV4hdkHm.js → pipeline-membership-DxJOJOjn.js} +1 -1
  311. package/server/{pipeline-membership-gather-UN7kHpCD.js → pipeline-membership-gather-QYMqf_Wf.js} +10 -10
  312. package/server/{pipeline-membership-gather-DGoDOfKO.js → pipeline-membership-gather-fivITe13.js} +1 -1
  313. package/server/{pipeline-notifier-DsCfxoSU.js → pipeline-notifier-DUxiacft.js} +1 -1
  314. package/server/{pipeline-notifier-DfH2i_zP.js → pipeline-notifier-vZqcB2Ts.js} +2 -2
  315. package/server/{post-merge-lifecycle-worker-V51p8tSm.js → post-merge-lifecycle-worker-jzN2g_EY.js} +2 -2
  316. package/server/{post-merge-state-Cym5NVlB.js → post-merge-state-DGlkiVIO.js} +4 -4
  317. package/server/{prd-locations-CPuMD55x.js → prd-locations-Chcvxzle.js} +3 -3
  318. package/server/{project-pipelines-DdDKdXrG.js → project-pipelines-BXB5FlFs.js} +2 -2
  319. package/server/{project-repos-CNrLxJDg.js → project-repos-BVSXziAz.js} +1 -1
  320. package/server/{project-repos-DqAT7YV6.js → project-repos-J6jc42uD.js} +2 -2
  321. package/server/{project-resource-refresh-queue-Dh8k2SB7.js → project-resource-refresh-queue-DebwjPPA.js} +17 -17
  322. package/server/{project-resource-refresh-queue-C-umDazS.js → project-resource-refresh-queue-cqOeJ0fB.js} +1 -1
  323. package/server/{projects-Crur9uCa.js → projects-DXgHD2Xl.js} +1 -1
  324. package/server/{prompts-CvtVJUpG.js → prompts-BJ8Twvtl.js} +2 -2
  325. package/server/{providers-Bun8zer5.js → providers-Bx-PKo3d.js} +1 -1
  326. package/server/{providers-1BlEh5x1.js → providers-DQogCKG0.js} +7 -7
  327. package/server/public/assets/{chunk-BO2N2NFS-DzUNVdeo.js → chunk-BO2N2NFS-CefmGH8f.js} +4 -4
  328. package/server/public/assets/{chunk-K2UTITRG-CopEAH22.js → chunk-K2UTITRG-DS0TExnd.js} +2 -2
  329. package/server/public/assets/codicon-ngg6Pgfi.ttf +0 -0
  330. package/server/public/assets/{diagram-OG6HWLK6-D5iThVwA.js → diagram-OG6HWLK6-DYPEQqOy.js} +1 -1
  331. package/server/public/assets/{dist-RyrOs5EF.js → dist-D0_QiSJD.js} +1 -1
  332. package/server/public/assets/{dist-BLq-IR2D.js → dist-DVcb72hI.js} +3 -3
  333. package/server/public/assets/editor.worker-Bd9IXS8d.js +26 -0
  334. package/server/public/assets/{ganttDiagram-6RSMTGT7-n8bUPXAS.js → ganttDiagram-6RSMTGT7-C0TVczXo.js} +1 -1
  335. package/server/public/assets/{highlighted-body-OFNGDK62-1npo3yiG.js → highlighted-body-OFNGDK62-DqOVJX4H.js} +1 -1
  336. package/server/public/assets/image-GAAHSSAO-DQ2ivYhs.js +1 -0
  337. package/server/public/assets/index-CFZuwq0-.css +1 -0
  338. package/server/public/assets/index-CWCooHwg.js +1732 -0
  339. package/server/public/assets/{linear-Dd96gky1.js → linear-45MX5LeL.js} +1 -1
  340. package/server/public/assets/markdown-Budfoo9I.js +1 -0
  341. package/server/public/assets/mermaid-GHXKKRXX-71HgceZK.js +1 -0
  342. package/server/public/assets/{pieDiagram-4H26LBE5-CynZvpYP.js → pieDiagram-4H26LBE5-BSyYJciD.js} +1 -1
  343. package/server/public/assets/{prod-DBuCX9g-.js → prod-CcWF3Ag1.js} +5 -5
  344. package/server/public/assets/{quadrantDiagram-W4KKPZXB-BNlEKLKN.js → quadrantDiagram-W4KKPZXB-DyPGNivi.js} +1 -1
  345. package/server/public/assets/{sankeyDiagram-5OEKKPKP-Cq0AMnkD.js → sankeyDiagram-5OEKKPKP-CdiSWvwI.js} +1 -1
  346. package/server/public/assets/{xychartDiagram-2RQKCTM6-D7GXcBy2.js → xychartDiagram-2RQKCTM6-BZeywmN2.js} +1 -1
  347. package/server/public/index.html +2 -2
  348. package/server/pull-requests-DLiyKC8q.js +2 -0
  349. package/server/{pull-requests-DrhWU9MW.js → pull-requests-EBvcAtZO.js} +3 -3
  350. package/server/{rally-api-CNlcoTFM.js → rally-api-2KW2hJUT.js} +2 -2
  351. package/server/{rally-api-BdNfpNGk.js → rally-api-BtWOXNna.js} +1 -1
  352. package/server/{rally-client-C3eB9TM-.js → rally-client-CAQtSqJJ.js} +5 -5
  353. package/server/{rally-client-BCU7mVWE.js → rally-client-DK8Ac35q.js} +1 -1
  354. package/server/{rally-D5QkIZeb.js → rally-k5qOLHHK.js} +3 -3
  355. package/server/rally-vmQx9f0C.js +3 -0
  356. package/server/{rebuild-stack-BupKggo5.js → rebuild-stack-DSQSgPCI.js} +2 -2
  357. package/server/rebuild-stack-xdGFthJn.js +370 -0
  358. package/server/{reconciler-ComAOr_F.js → reconciler-xH7d13Wo.js} +6 -6
  359. package/server/{reconstruct-cache-DbjgwKRi.js → reconstruct-cache-Bb2Jg2DZ.js} +7 -7
  360. package/server/{record-C4JJCL2f.js → record-Dsceq536.js} +1 -1
  361. package/server/{record-update-CWwZsp9Y.js → record-update-CLtgirnZ.js} +1 -1
  362. package/server/{record-update-Cl56NqoQ.js → record-update-T3PMrwE-.js} +4 -4
  363. package/server/{recovery-trip-DA7tCXbp.js → recovery-trip-7JFHFjeo.js} +3 -3
  364. package/server/{recovery-trip-DFtSA8h5.js → recovery-trip-B7UdNXjP.js} +1 -1
  365. package/server/{release-engine-Dk99C48O.js → release-engine-78iCajIc.js} +5 -5
  366. package/server/{release-set-x8KH3nrE.js → release-set-B_sH_Mud.js} +3 -3
  367. package/server/{remote-DyZIg94K.js → remote-C9eYHTqn.js} +3 -3
  368. package/server/{remote-agents-MbWzm5Fh.js → remote-agents-CEOvYsvK.js} +1 -1
  369. package/server/{remote-agents-Blb0vO_M.js → remote-agents-CthcZHnO.js} +6 -6
  370. package/server/{remote-completion-Bcd13o-J.js → remote-completion-D5wzZCte.js} +12 -12
  371. package/server/{remote-BMZmJC5E.js → remote-gWXJyhJK.js} +3 -3
  372. package/server/{resolver-CZVWKCx0.js → resolver-BGZh3lXA.js} +7 -7
  373. package/server/{resolver-tJeEkPK5.js → resolver-ChLZFIjB.js} +2 -2
  374. package/server/{memory-pressure-patrol-CDeDh46A.js → resource-pressure-patrol-Bg23rPV-.js} +110 -9
  375. package/server/{resume-DmF2andq.js → resume-BKyB4hA1.js} +1 -1
  376. package/server/{review-agent-CmJeQc0K.js → review-agent-DHs-JngN.js} +52 -35
  377. package/server/{review-agent-DM9S22BL.js → review-agent-ZdP-HmwY.js} +2 -2
  378. package/server/{review-artifacts-DCiaejJK.js → review-artifacts-DExSp5Lh.js} +6 -6
  379. package/server/{review-convoy-liveness-C9F1Q1LN.js → review-convoy-liveness-BTMvU4CA.js} +8 -8
  380. package/server/{review-run-recovery-CRGBh7xs.js → review-run-recovery-BYalQzbh.js} +1 -1
  381. package/server/{review-run-recovery-C5TEICtx.js → review-run-recovery-BvVG3oUr.js} +2 -2
  382. package/server/{review-status-C3PJkfjv.js → review-status-BegAr86G.js} +33 -31
  383. package/server/{review-status-CDs0jQV6.js → review-status-DXTFzCmR.js} +1 -1
  384. package/server/{review-status-emit-De6PF3ZH.js → review-status-emit-C9YW6SQL.js} +3 -3
  385. package/server/{review-status-enrichment-CclcG8jk.js → review-status-enrichment-DRJKuIwU.js} +3 -3
  386. package/server/{review-status-sync-wvgdR1yZ.js → review-status-sync-CHt0oq_3.js} +2 -2
  387. package/server/{review-status-sync-B3GKewT_.js → review-status-sync-DEGnJMfG.js} +1 -1
  388. package/server/{review-verdict-feedback-DkMx_cKj.js → review-verdict-feedback-Dp139Lmv.js} +1 -1
  389. package/server/{review-verdict-feedback-20s9pG0w.js → review-verdict-feedback-qlVBi19-.js} +7 -7
  390. package/server/{review-verdict-writer-CaJPCD-q.js → review-verdict-writer-BVco3WoI.js} +1 -1
  391. package/server/{review-verdict-writer-BcG5RBWF.js → review-verdict-writer-CJr_Ob0Y.js} +7 -7
  392. package/server/{rollup-C-GXHbTG.js → rollup-H2NWuNhX.js} +8 -8
  393. package/server/{rollup-DR250WyW.js → rollup-iPhJvI-2.js} +1 -1
  394. package/server/{search-BN0MYpZW.js → search-BtgzCB2W.js} +2 -2
  395. package/server/{secret-redaction-DLZ-VqHq.js → secret-redaction-EqpTK7R6.js} +1 -1
  396. package/server/{sequence-io-BmVO0K-_.js → sequence-io-iljWlslY.js} +4 -4
  397. package/server/{sequencer-agent-CuA9PA_R.js → sequencer-agent-BGGVKxtw.js} +11 -6
  398. package/server/server.js +1526 -1240
  399. package/server/{service-D1SZCxH8.js → service-kzhN0DLg.js} +58 -58
  400. package/server/{session-fork--SMYFKVu.js → session-fork-B3hkpes1.js} +2 -2
  401. package/server/{settings-CETdzCl6.js → settings-BpM0Ergn.js} +3 -3
  402. package/server/settings-CW_lAaJv.js +2 -0
  403. package/server/{settings-CFi7CdJo.js → settings-aBz_GpBq.js} +9 -2
  404. package/server/{shadow-engineering-CNTXaC9O.js → shadow-engineering-C7kypoM-.js} +2 -2
  405. package/server/{shadow-state-6jSyeXQ7.js → shadow-state-Db5ExiBP.js} +1 -1
  406. package/server/{shadow-state-CtYJGNXt.js → shadow-state-IG8JSXgD.js} +2 -2
  407. package/server/{shadow-utils-Cq5eMfwI.js → shadow-utils-DSDsJXLD.js} +2 -2
  408. package/server/{ship-record-STA0P11l.js → ship-record-80n1CYp9.js} +6 -6
  409. package/server/{ship-record-neN0oUI9.js → ship-record-DN8voLiQ.js} +1 -1
  410. package/server/{ship-status-DzDpufmj.js → ship-status-CJvaa4QB.js} +2 -2
  411. package/server/{smart-compaction-tndAhwoc.js → smart-compaction-C96F2aFQ.js} +7 -7
  412. package/server/{smart-compaction-CdtKIcDk.js → smart-compaction-owKHJDbL.js} +1 -1
  413. package/server/{spawn-planning-session-1XLgDLjR.js → spawn-planning-session-CiJdOHTD.js} +2 -2
  414. package/server/{spawn-planning-session-CAncCBLX.js → spawn-planning-session-FmJa6PCS.js} +41 -50
  415. package/server/{specialist-context-B054OP_a.js → specialist-context-_ootmzn2.js} +5 -5
  416. package/server/{specialist-handoff-logger-B7jzypoX.js → specialist-handoff-logger-4QCjIBPO.js} +2 -2
  417. package/server/{specialist-logs-DVhOLpwy.js → specialist-logs-BbAX221-.js} +3 -3
  418. package/server/{specialists-CC_Mnc47.js → specialists-COZoYaiz.js} +266 -173
  419. package/server/{specialists-8Pc--yZI.js → specialists-D8sYZnPb.js} +2 -2
  420. package/server/{specialists-BVBIMc4L.js → specialists-DTAOVZpU.js} +1 -1
  421. package/server/{specialists-ChvCD2a-.js → specialists-RPLJnYc1.js} +19 -19
  422. package/server/{specialists-registry-Cim1fPcM.js → specialists-registry-CNbvfOcy.js} +2 -2
  423. package/server/{specialists-registry-CoPNlhud.js → specialists-registry-DqgQIxpu.js} +1 -1
  424. package/server/specs-ChqOBhAF.js +3 -0
  425. package/server/{src-C7gGe4KU.js → src-Cz63twgJ.js} +2 -2
  426. package/server/{src-CdwN6WY6.js → src-tnFSfiXX.js} +126 -18
  427. package/server/{stack-health-CvdnSVBV.js → stack-health-D0j1RhAj.js} +1 -1
  428. package/server/{stack-health-DPXaoAus.js → stack-health-Y8O3UuPe.js} +3 -3
  429. package/server/{stale-task-claims-UoNLemTn.js → stale-task-claims-Db6yxeFz.js} +5 -5
  430. package/server/{staleness-CxZaIhrn.js → staleness-CyM7ACHv.js} +1 -1
  431. package/server/{staleness-r_dkMyMG.js → staleness-akWxgpIu.js} +1 -1
  432. package/server/{stall-sweeper-C9S8FYKz.js → stall-sweeper-9bRBZhrQ.js} +8 -8
  433. package/server/{state-home-BhI8O5lU.js → state-home-CWu1dx9L.js} +2 -2
  434. package/server/{state-mapping-D2yC81Vy.js → state-mapping-CdvWOIhv.js} +1 -1
  435. package/server/{state-migrate-DtFHcOVZ.js → state-migrate-J3tFJnbd.js} +6 -6
  436. package/server/{state-mirror-CpuHFxHb.js → state-mirror-DQKpsskH.js} +3 -3
  437. package/server/{stuck-remediation-B4nKm7B2.js → stuck-remediation-4Rf_xMEb.js} +13 -13
  438. package/server/{stuck-remediation-hSOOYB9B.js → stuck-remediation-BvTK_NYN.js} +1 -1
  439. package/server/{substrate-bug-weights-service-B9f0063E.js → substrate-bug-weights-service-9nrkZcaP.js} +3 -3
  440. package/server/{summary-fork-CUyEqFyc.js → summary-fork-D-cylknJ.js} +51 -13
  441. package/server/{summary-fork-DZcsOvDD.js → summary-fork-PLcckTRE.js} +2 -2
  442. package/server/supervisor/{injection-budget-BOH-EiFB.js → injection-budget-DfPSjiS7.js} +1 -1
  443. package/server/supervisor/pty-supervisor.js +1 -1
  444. package/server/{supervisor-CGtOs9Em.js → supervisor-B2_uXxHQ.js} +4 -4
  445. package/server/supervisor-DSSr9_E4.js +2 -0
  446. package/server/{swarm-readiness-0N2p9d2C.js → swarm-readiness-BkVvnCdr.js} +3 -3
  447. package/server/{synthesis-verdict-CQdLbK1-.js → synthesis-verdict-BtJAwMS3.js} +2 -2
  448. package/server/{synthesis-verdict-CJdseCuz.js → synthesis-verdict-b1uY2m9Q.js} +1 -1
  449. package/server/{system-prerequisites-DkDOEjQP.js → system-prerequisites-zlmZiJzn.js} +14 -2
  450. package/server/{teardown-workspace-BxFMcWu7.js → teardown-workspace-CTL16rnG.js} +16 -16
  451. package/server/{test-agent-queue-Dxeae55k.js → test-agent-queue-CMgYZiR_.js} +6 -6
  452. package/server/{test-verdict-CJ-to_Hc.js → test-verdict-BaiFCApG.js} +1 -1
  453. package/server/{test-verdict-hW5kILg7.js → test-verdict-DhjFE4Go.js} +2 -2
  454. package/server/{tldr-daemon-DKCumqHU.js → tldr-daemon-CW1MhBkM.js} +1 -1
  455. package/server/{tldr-daemon-caxXegkF.js → tldr-daemon-CYr67NdC.js} +2 -2
  456. package/server/{tmux-C-hxv71f.js → tmux-aj9rscol.js} +2 -2
  457. package/server/{tmux-CvAEO9yo.js → tmux-l-yvNWhg.js} +2 -2
  458. package/server/{token-BdfZLRg1.js → token-BO7DAEyM.js} +2 -2
  459. package/server/{token-util-Crcay9j_.js → token-util-C_1EI72O.js} +1 -1
  460. package/server/token-util-msNwng7E.js +3 -0
  461. package/server/{tracker-config-BjqwtkcT.js → tracker-config-Qq_kEwYh.js} +2 -2
  462. package/server/{tracker-utils-0cDe6yil.js → tracker-utils-McMENyKj.js} +2 -2
  463. package/server/{traefik-connect-DoQvQ6oJ.js → traefik-connect-BZWNRHOd.js} +1 -1
  464. package/server/{tunnel-BEM7-jgE.js → tunnel-BElVxdZw.js} +1 -1
  465. package/server/{tunnel-SgALz_Pi.js → tunnel-D01HhYX5.js} +3 -3
  466. package/server/{typed-errors-CZ3GFBvo.js → typed-errors-CKb5wNaG.js} +1 -1
  467. package/server/{typed-errors-DXqf3RnP.js → typed-errors-uJ-V6edU.js} +1 -1
  468. package/server/{types-PW4zkxCM.js → types-JR7ZOtpL.js} +1 -1
  469. package/server/{uat-failure-feedback-BQzpUFQ6.js → uat-failure-feedback-DS6W9X3I.js} +5 -5
  470. package/server/{uat-promote-verification-BUltWC-b.js → uat-promote-verification-CRsIHE_q.js} +5 -5
  471. package/server/{uat-train-B71QG16n.js → uat-train-BoA9r6_I.js} +1 -1
  472. package/server/{uat-train-BLJ0AAIc.js → uat-train-Cd8CJeNe.js} +22 -22
  473. package/server/{validate-DqEp2Yb9.js → validate-BdmvTIym.js} +3 -3
  474. package/server/{validation-k4EpMHm0.js → validation-ApKDjkLH.js} +1 -1
  475. package/server/{validation-DHEsL3RP.js → validation-Dxdai-37.js} +14 -4
  476. package/server/{verification-artifact-DglwaHke.js → verification-artifact-DhIkPgrP.js} +1 -1
  477. package/server/{verification-artifact-Cmhgq4b_.js → verification-artifact-olosZdZU.js} +1 -1
  478. package/server/{verification-runner-Bbc-8BbR.js → verification-runner-BO0K3xNA.js} +1 -1
  479. package/server/{verification-runner-BC_zNOq5.js → verification-runner-fEY1Qj-l.js} +31 -23
  480. package/server/{work-agent-prompt-DM3uza0_.js → work-agent-prompt-BEpIuqw1.js} +10 -10
  481. package/server/{work-agent-prompt-CQWlmw_y.js → work-agent-prompt-Csr4vMbl.js} +1 -1
  482. package/server/{work-agent-start-cKf7rly8.js → work-agent-start-DA3P_ABv.js} +2 -2
  483. package/server/{work-agent-start-BColr1oI.js → work-agent-start-DWBmIRlg.js} +1 -1
  484. package/server/workflows-CgGNyl1z.js +2 -0
  485. package/server/{workflows-DrC85n8j.js → workflows-CxVnygYU.js} +28 -28
  486. package/server/{workspace-G3Cus8e9.js → workspace-BO8fIfW9.js} +1 -1
  487. package/server/{workspace-ChRFy_F9.js → workspace-BWYfzfPV.js} +3 -3
  488. package/server/{workspace-anchor-drift-DBbyK_Mf.js → workspace-anchor-drift-BMSxf9wp.js} +1 -1
  489. package/server/{workspace-anchor-drift-z7TjOORC.js → workspace-anchor-drift-RJcMD1EV.js} +4 -4
  490. package/server/{workspace-config-D-bNq2CF.js → workspace-config-CoAaYx_w.js} +1 -1
  491. package/server/{workspace-manager-Db3pCmr7.js → workspace-manager-CnAyRh3v.js} +45 -380
  492. package/server/workspace-manager-D0jJ7StJ.js +4 -0
  493. package/server/{workspace-metadata-C5Ie2FMZ.js → workspace-metadata-Copcoih9.js} +2 -2
  494. package/server/{workspace-metadata-Do-L6GFP.js → workspace-metadata-ILlbk8AX.js} +1 -1
  495. package/server/{workspaces-D0MWw7Mx.js → workspaces-Cpz0xJWQ.js} +112 -112
  496. package/server/worktree-ops-CV-pRvyW.js +3 -0
  497. package/server/worktree-ops-Cnk1voFY.js +369 -0
  498. package/sync-sources/rules/context-nomenclature.md +4 -3
  499. package/sync-sources/rules/rule-authoring.md +3 -3
  500. package/sync-sources/skills/knowledge-capture/SKILL.md +13 -13
  501. package/sync-sources/skills/pan-new-project/SKILL.md +2 -2
  502. package/sync-sources/skills/pan-projects/SKILL.md +3 -3
  503. package/sync-sources/skills/pan-sync/SKILL.md +8 -10
  504. package/sync-sources/skills/refactor-radar/SKILL.md +12 -12
  505. package/server/agents-BdkVgjxC.js +0 -3
  506. package/server/archive-planning-CNSWQPvz.js +0 -2
  507. package/server/assemble-D88iFkP-.js +0 -365
  508. package/server/build-info-Df2tkRrB.js +0 -2
  509. package/server/cli-BjznnCC3.js +0 -2
  510. package/server/context-layers-D0QBOPJJ.js +0 -4
  511. package/server/context-layers-LY5zt0da.js +0 -37
  512. package/server/conversation-service-B3h1erHm.js +0 -3
  513. package/server/conversations-Ch7UGi0F.js +0 -3
  514. package/server/dead-end-trip-B91w2PGV.js +0 -2
  515. package/server/delivery-zJM4aIkf.js +0 -3
  516. package/server/deploy-queue-2cN86Lg4.js +0 -2
  517. package/server/forge-egNLsjVi.js +0 -2
  518. package/server/hume-gXLmRhmN.js +0 -3
  519. package/server/inspect-agent-BuSYgRQs.js +0 -2
  520. package/server/kimi-code-Cdkk9vRU.js +0 -3
  521. package/server/kimi-code-DwqLCWFw.js +0 -581
  522. package/server/merge-ops-CUzpOPtO.js +0 -2
  523. package/server/merge-rebase-DkfcUT60.js +0 -2
  524. package/server/messaging-DQi-WEFB.js +0 -3
  525. package/server/node_modules/@types/node/ffi.d.ts +0 -486
  526. package/server/node_modules/@types/node/inspector/promises.d.ts +0 -35
  527. package/server/node_modules/@types/node/path/posix.d.ts +0 -8
  528. package/server/node_modules/@types/node/path/win32.d.ts +0 -8
  529. package/server/node_modules/@types/node/quic.d.ts +0 -2153
  530. package/server/node_modules/@types/node/stream/iter.d.ts +0 -452
  531. package/server/node_modules/@types/node/test/reporters.d.ts +0 -59
  532. package/server/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  533. package/server/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  534. package/server/node_modules/@types/node/ts5.7/index.d.ts +0 -118
  535. package/server/node_modules/@types/node/util/types.d.ts +0 -558
  536. package/server/node_modules/@types/node/vfs.d.ts +0 -211
  537. package/server/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  538. package/server/node_modules/@types/node/web-globals/console.d.ts +0 -9
  539. package/server/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  540. package/server/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  541. package/server/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  542. package/server/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  543. package/server/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  544. package/server/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  545. package/server/node_modules/@types/node/web-globals/url.d.ts +0 -24
  546. package/server/node_modules/@types/node/zlib/iter.d.ts +0 -131
  547. package/server/node_modules/undici-types/cache-interceptor.d.ts +0 -179
  548. package/server/node_modules/undici-types/client-stats.d.ts +0 -15
  549. package/server/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
  550. package/server/node_modules/undici-types/h2c-client.d.ts +0 -73
  551. package/server/node_modules/undici-types/mock-call-history.d.ts +0 -111
  552. package/server/node_modules/undici-types/round-robin-pool.d.ts +0 -39
  553. package/server/node_modules/undici-types/snapshot-agent.d.ts +0 -113
  554. package/server/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
  555. package/server/node_modules/undici-types/utility.d.ts +0 -7
  556. package/server/public/assets/image-GAAHSSAO-rafcvWHh.js +0 -1
  557. package/server/public/assets/index-BvN8bWpz.js +0 -860
  558. package/server/public/assets/index-DgoS288w.css +0 -1
  559. package/server/public/assets/mermaid-GHXKKRXX-fP93Za-W.js +0 -1
  560. package/server/pull-requests-DV_rJ-1u.js +0 -2
  561. package/server/rally-DlXjOIAG.js +0 -3
  562. package/server/rebuild-stack-CNknXJHL.js +0 -197
  563. package/server/settings-EGNbGKpP.js +0 -2
  564. package/server/specs-Dvq4sOy6.js +0 -3
  565. package/server/supervisor-DoJpD33i.js +0 -2
  566. package/server/token-util-DfUS3Lpp.js +0 -3
  567. package/server/workflows-CLrEiTds.js +0 -2
  568. package/server/workspace-manager-gz9Amovn.js +0 -3
  569. /package/server/public/assets/{pica-CgYEdS5s.js → pica-DPvnTcFS.js} +0 -0
  570. /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-OoH-ZpTb.js";
3
- import { h as loadConfigSync$1, p as init_config } from "./config-Cx3N6gWz.js";
4
- import { l as init_activity_logger, o as emitActivityEntrySync, s as emitActivityTtsSync } from "./activity-logger-ru8ggv-d.js";
5
- import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-BbSWNOpH.js";
6
- import { n as init_fs_lock, s as withRecordFsLock } from "./fs-lock-DfiYlr5u.js";
7
- import { c as withStateGitLock, i as init_record_update, n as clearRecordPipelineClosedOut, s as init_state_git_lock } from "./record-update-Cl56NqoQ.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-CvAEO9yo.js";
9
- import { a as getWorkspaceForIssue, o as init_resolver } from "./resolver-tJeEkPK5.js";
10
- import { a as init_event_store, i as initEventStore } from "./event-store-DbjldlXW.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-DCCwbUj8.js";
13
- import { a as countAgentsByStatus, c as init_agents$2, g as logAgentLifecycleSync, h as init_persistent_logger } from "./agents-DMs1aLRU.js";
14
- import { n as ensureSessionContextBriefingFile, r as init_briefing_freshness } from "./briefing-freshness-FF0WLPMc.js";
15
- import { a as getFlywheelActiveRunIdSync, c as init_control_settings, j as parseOhmypiSessionSync, k as init_ohmypi_parser } from "./control-settings-Bdud_B1j.js";
16
- import { _ as init_tier_metrics, g as estimateFeedDeliveryTokens, v as recordTierFeedDelivery } from "./cost-sync-Bq_dyq9k.js";
17
- import { t as init_behavior } from "./behavior-CPX0E2Fj.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-L_2OxNJf.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-Cym5NVlB.js";
20
- import { i as ensureInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-CUKcTWSG.js";
21
- import { A as init_conversations, B as reactivateConversationForSpawn, C as getConversationByName, b as createConversation, z as normalizeHarness } from "./conversations-JyrMSeOh.js";
22
- import { n as readActiveDashboardBundleSync, t as init_active_dashboard_bundle } from "./active-dashboard-bundle-DbfgP8TS.js";
23
- import { a as readCavemanVariant, n as init_workspace } from "./workspace-ChRFy_F9.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-C1avLtkk.js";
25
- import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-Bn53HCXr.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-D88iFkP-.js";
27
- import { a as extractThreadIdFromRollout, c as initCodexHome, l as init_codex, o as findLatestRollout } from "./codex-DSs-3aOm.js";
28
- import { i as prepareHarnessLaunch, r as init_harness_binary } from "./harness-binary-BuakhXkB.js";
29
- import { n as createTrackerFromConfig, r as init_factory, t as createTracker } from "./factory-DfIQG-qW.js";
30
- import { c as init_stack_health, o as getWorkspaceStackHealth } from "./stack-health-DPXaoAus.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-BgzG56av.js";
33
- import { a as getDispatchableItems, c as init_dag, o as groupItemsByWave, r as createActiveSlice } from "./dag-CKUsr8wB.js";
34
- import { c as generateFixedPointPromptSync, f as initHookSync, n as checkHookSync, p as init_hooks } from "./hooks-D55VTdQS.js";
35
- import { a as init_git_utils, l as renderWorkspaceGitShowPromise } from "./git-utils-DfpFkvwk.js";
36
- import { n as init_workspace_anchor_drift, t as evaluateWorkspaceAnchorDrift } from "./workspace-anchor-drift-z7TjOORC.js";
37
- import { n as resolveHarness, t as init_harness_resolve } from "./harness-resolve-CISjc9FR.js";
38
- import { a as loadCloisterConfigSync, r as init_config$1 } from "./config-DP0VV7rX.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-BhI8O5lU.js";
41
- import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-D7Z8kANm.js";
42
- import { d as resolveWorkspaceRepoRootsSync, i as init_project_repos } from "./project-repos-DqAT7YV6.js";
43
- import { a as init_lifecycle_io, t as appendContinueSessionEntryForIssue } from "./lifecycle-io-CCCAMefe.js";
44
- import { a as init_tracker_config, t as getGitHubConfig } from "./tracker-config-BjqwtkcT.js";
45
- import { r as init_swarm_readiness, t as analyzeSwarmReadiness } from "./swarm-readiness-0N2p9d2C.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();
@@ -1589,7 +1591,6 @@ var init_provider_env = __esmMin((() => {
1589
1591
  "gpt-5.6-luna"
1590
1592
  ]);
1591
1593
  GPT_56_LONG_MODELS = new Set(Object.keys(GPT56_LONG_CONTEXT_VARIANTS));
1592
- KIMI_K3_MODELS = new Set(["k3", "k3[1m]"]);
1593
1594
  WORK_AGENT_BROKEN_MODELS = /* @__PURE__ */ new Set([]);
1594
1595
  }));
1595
1596
  //#endregion
@@ -1698,34 +1699,406 @@ var init_claude_auth = __esmMin((() => {
1698
1699
  });
1699
1700
  }));
1700
1701
  //#endregion
1701
- //#region ../../lib/acp/context.ts
1702
- function materializeAcpContextFile(agentDir, workspace) {
1703
- 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())];
1704
2057
  const project = findProjectByPathSync(workspace);
1705
- if (project) sections.push(renderProjectLayer(project.path, "acp"));
2058
+ if (project) sections.push(renderProjectLayer(project.path, harness));
1706
2059
  const workspaceFile = resolveWorkspaceContextFile(workspace);
1707
2060
  if (existsSync$1(workspaceFile)) {
1708
- const workspaceContent = readFileSync$1(workspaceFile, "utf8");
1709
- const workspaceOnly = project ? workspaceContextWithoutProjectLayer(workspaceContent) : workspaceContent;
1710
- 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}`);
1711
2063
  }
1712
- const content = sections.filter((section) => section.trim().length > 0).join(SECTION_SEPARATOR);
1713
- const contextPath = join(agentDir, "acp-context.md");
1714
- mkdirSync$1(dirname(contextPath), { recursive: true });
1715
- writeFileSync$1(contextPath, `${content.trim()}\n`, { mode: 384 });
1716
- 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);
1717
2082
  }
1718
2083
  var SECTION_SEPARATOR;
1719
- var init_context = __esmMin((() => {
2084
+ var init_materialize = __esmMin((() => {
2085
+ init_paths();
2086
+ init_projects();
1720
2087
  init_assemble();
1721
2088
  init_harness();
1722
2089
  init_layers();
1723
2090
  init_render();
1724
- init_paths();
1725
- init_projects();
1726
2091
  SECTION_SEPARATOR = "\n\n---\n\n";
1727
2092
  }));
1728
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
1729
2102
  //#region ../../lib/runtimes/ohmypi-fifo.ts
1730
2103
  /**
1731
2104
  * oh-my-pi (omp) RPC named-pipe lifecycle (PAN-1989).
@@ -1770,7 +2143,7 @@ async function createOhmypiFifoPromise(agentId, home) {
1770
2143
  mode: 448
1771
2144
  });
1772
2145
  if (existsSync$1(paths.fifoPath)) unlinkSync$1(paths.fifoPath);
1773
- await execAsync$8(`mkfifo -m 600 ${shellQuote$1(paths.fifoPath)}`);
2146
+ await execAsync$9(`mkfifo -m 600 ${shellQuote$2(paths.fifoPath)}`);
1774
2147
  return paths.fifoPath;
1775
2148
  }
1776
2149
  /**
@@ -1808,14 +2181,14 @@ function writeOhmypiCommandSync(agentId, command, home) {
1808
2181
  closeSync$1(fd);
1809
2182
  }
1810
2183
  }
1811
- function shellQuote$1(s) {
2184
+ function shellQuote$2(s) {
1812
2185
  if (/^[A-Za-z0-9._/-]+$/.test(s)) return s;
1813
2186
  return `'${s.replace(/'/g, `'\\''`)}'`;
1814
2187
  }
1815
- var execAsync$8, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
2188
+ var execAsync$9, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
1816
2189
  var init_ohmypi_fifo = __esmMin((() => {
1817
2190
  init_paths();
1818
- execAsync$8 = promisify(exec);
2191
+ execAsync$9 = promisify(exec);
1819
2192
  OhmypiNotReady = class extends Error {
1820
2193
  code = "OHMYPI_NOT_READY";
1821
2194
  constructor(message) {
@@ -1850,6 +2223,28 @@ var init_pi_fifo = __esmMin((() => {
1850
2223
  Data.TaggedError("PiFifoError");
1851
2224
  }));
1852
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
1853
2248
  //#region ../../lib/agents/runtime-command.ts
1854
2249
  /** Parse and flatten a role definition's mcpServers frontmatter. */
1855
2250
  function parseRoleMcpServersSync(definitionPath) {
@@ -1884,30 +2279,6 @@ async function writeLauncherScriptAtomic(launcherScript, content) {
1884
2279
  await writeFile$1(tmp, content, { mode: 493 });
1885
2280
  await rename$1(tmp, launcherScript);
1886
2281
  }
1887
- async function claudeSystemPromptFiles(workspace, harness) {
1888
- const behavior = getHarnessBehavior(harness);
1889
- if (behavior.contextLayerKind === "acp") return [];
1890
- const files = [];
1891
- const contextFile = workspaceContextFile(workspace);
1892
- try {
1893
- await stat$1(contextFile);
1894
- files.push(contextFile);
1895
- } catch (error) {
1896
- if (!isNodeNotFound(error)) throw error;
1897
- }
1898
- files.push(await ensureSessionContextBriefingFile());
1899
- if (behavior.contextLayerKind === "pi") {
1900
- const { piGlobalContextFile } = await import("./context-layers-D0QBOPJJ.js");
1901
- const globalFile = piGlobalContextFile();
1902
- if (existsSync(globalFile)) files.unshift(globalFile);
1903
- }
1904
- if (behavior.contextLayerKind === "codex") {
1905
- const { codexGlobalContextFile } = await import("./context-layers-D0QBOPJJ.js");
1906
- const globalFile = codexGlobalContextFile();
1907
- if (existsSync(globalFile)) files.unshift(globalFile);
1908
- }
1909
- return files;
1910
- }
1911
2282
  function isNodeNotFound(error) {
1912
2283
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
1913
2284
  }
@@ -1929,20 +2300,20 @@ async function hasAgentRuntimeInSubtree(rootPid, harness = "claude-code") {
1929
2300
  if (seen.has(pid) || !/^\d+$/.test(pid)) continue;
1930
2301
  seen.add(pid);
1931
2302
  try {
1932
- const { stdout: comm } = await execAsync$6(`ps -p ${pid} -o comm=`);
2303
+ const { stdout: comm } = await execAsync$7(`ps -p ${pid} -o comm=`);
1933
2304
  const name = comm.trim();
1934
- if (expectedProcessNames.has(name)) return true;
2305
+ if (expectedProcessNames.has(name) || harness === "muse" && name.startsWith("muse-bin-")) return true;
1935
2306
  } catch {
1936
2307
  continue;
1937
2308
  }
1938
2309
  try {
1939
- const { stdout: kids } = await execAsync$6(`pgrep -P ${pid}`);
2310
+ const { stdout: kids } = await execAsync$7(`pgrep -P ${pid}`);
1940
2311
  for (const kid of kids.trim().split("\n").filter(Boolean)) queue.push(kid);
1941
2312
  } catch {}
1942
2313
  }
1943
2314
  return false;
1944
2315
  }
1945
- async function getOhmypiLauncherFields(agentId, model) {
2316
+ async function getOhmypiLauncherFields(agentId, model, effort) {
1946
2317
  const paths = ohmypiFifoPaths(agentId);
1947
2318
  await mkdir$1(paths.agentDir, {
1948
2319
  recursive: true,
@@ -1952,39 +2323,45 @@ async function getOhmypiLauncherFields(agentId, model) {
1952
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})`);
1953
2324
  return {
1954
2325
  harness: "ohmypi",
2326
+ piEffort: effort ?? "high",
1955
2327
  piExtensionPath: ohmypiExtensionPath,
1956
2328
  piFifoPath: await Effect.runPromise(createOhmypiFifo(agentId)),
1957
2329
  piSessionDir: paths.agentDir,
1958
2330
  model
1959
2331
  };
1960
2332
  }
1961
- function getAcpLauncherFields(agentId, model, workspace, binaryPath, _role) {
2333
+ function getAcpLauncherFields(agentId, model, workspace, binaryPath, _role, effort) {
1962
2334
  return {
1963
- harness: "acp",
2335
+ harness: model.startsWith("opencode/") || model.startsWith("opencode-go/") ? "opencode" : "acp",
1964
2336
  acpAgentId: agentId,
1965
2337
  acpProvider: getProviderForModelSync(model).name,
1966
2338
  acpWorkspace: workspace,
1967
2339
  acpBinaryPath: binaryPath,
1968
- acpContextFile: materializeAcpContextFile(getAgentDir(agentId), workspace),
2340
+ acpContextFile: materializeAcpContextFile(getAgentDir(agentId), workspace, model.startsWith("opencode/") || model.startsWith("opencode-go/") ? "opencode" : "acp"),
2341
+ ...effort ? { acpEffort: effort } : {},
1969
2342
  model,
1970
2343
  unsetProviderEnv: true
1971
2344
  };
1972
2345
  }
1973
- function getKimiCodeLauncherFields(model) {
2346
+ function getKimiCodeLauncherFields(model, effort) {
1974
2347
  return {
1975
2348
  harness: "kimi-code",
1976
2349
  kimiCodeModel: resolveKimiCodeModelAlias(model),
1977
2350
  kimiCodeYolo: true,
2351
+ ...effort ? { kimiCodeEffort: effort } : {},
1978
2352
  model,
1979
- unsetProviderEnv: true
2353
+ unsetProviderEnv: true,
2354
+ kimiContextDelivery: "initial-message"
1980
2355
  };
1981
2356
  }
1982
- function getCodexLauncherFields(agentId, model, workspacePath, role) {
1983
- 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");
1984
2359
  const codexConfig = loadConfigSync().config.codex;
1985
2360
  const codexPermMode = codexConfig?.permissionMode ?? "workspace";
1986
2361
  initCodexHome(codexHome, {
1987
2362
  trustedDir: workspacePath,
2363
+ model,
2364
+ effort,
1988
2365
  approvalPolicy: codexPermMode === "full-access" ? "never" : "on-request",
1989
2366
  sandboxMode: codexPermMode === "full-access" ? "danger-full-access" : codexPermMode === "read-only" ? "read-only" : "workspace-write",
1990
2367
  approvalsReviewer: codexPermMode === "auto-review" ? "auto_review" : void 0,
@@ -1993,6 +2370,7 @@ function getCodexLauncherFields(agentId, model, workspacePath, role) {
1993
2370
  return {
1994
2371
  harness: "codex",
1995
2372
  codexMode: codexConfig?.transport === "tui" ? "work-tui" : "app-server",
2373
+ codexEffort: effort ?? "high",
1996
2374
  codexHome,
1997
2375
  codexSessionDir: join$1(codexHome, "sessions"),
1998
2376
  model
@@ -2204,6 +2582,7 @@ async function waitForPromptReady(agentId, harness, timeoutSec = 30) {
2204
2582
  return true;
2205
2583
  }
2206
2584
  if (readinessKind === "codex-tui-prompt") return waitForCodexTuiReady(agentId, timeoutSec);
2585
+ if (readinessKind === "muse-tui-prompt") return waitForMuseTuiReady(agentId, timeoutSec);
2207
2586
  if (readinessKind === "kimi-session-signal") return waitForKimiCodeTuiReady(agentId, timeoutSec);
2208
2587
  return waitForReadySignal(agentId, timeoutSec);
2209
2588
  }
@@ -2231,7 +2610,7 @@ async function injectPiPromptTimeMemory(agentId, prompt) {
2231
2610
  agentRole: agentState.role ?? "work",
2232
2611
  agentHarness: agentState.harness ?? "claude-code"
2233
2612
  };
2234
- const { injectPromptTimeMemory } = await import("./injection-DsQDBSEi.js");
2613
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2235
2614
  const result = await injectPromptTimeMemory({
2236
2615
  prompt,
2237
2616
  identity,
@@ -2265,7 +2644,7 @@ async function injectPiConversationMemory(opts, prompt) {
2265
2644
  agentRole: "work",
2266
2645
  agentHarness: "ohmypi"
2267
2646
  };
2268
- const { injectPromptTimeMemory } = await import("./injection-DsQDBSEi.js");
2647
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2269
2648
  const result = await injectPromptTimeMemory({
2270
2649
  prompt,
2271
2650
  identity,
@@ -2313,8 +2692,7 @@ async function getProviderAuthMode(model) {
2313
2692
  *
2314
2693
  * The `harness` parameter (PAN-636) selects between Claude Code (default)
2315
2694
  * and ohmypi/Pi. When the harness uses the ohmypi RPC command, the function
2316
- * short-circuits to a
2317
- * `omp --mode rpc --model <model>` line; the launcher generator then layers
2695
+ * returns `omp --mode rpc --model <model>`; the launcher generator then layers
2318
2696
  * --session-dir, --extension, --no-context-files, and the stdin-from-fifo
2319
2697
  * redirect on top via generateLauncherScript. The `agentName` (PAN-982:
2320
2698
  * --name) and `agentDefinition` (PAN-982: --agent) parameters only apply to the
@@ -2322,11 +2700,12 @@ async function getProviderAuthMode(model) {
2322
2700
  */
2323
2701
  async function getAgentRuntimeBaseCommand(model, agentName, agentDefinition, harness = "claude-code", effort) {
2324
2702
  const validatedModel = requireModelOverrideSync(model);
2325
- const quotedModel = shellQuoteModelIdSync(validatedModel);
2703
+ const quotedModel = shellQuoteModelIdSync(harness === "claude-code" ? getClaudeCodeLaunchModelSync(validatedModel) : validatedModel);
2326
2704
  const behavior = getHarnessBehavior(harness);
2327
2705
  if (behavior.launchCommandKind === "ohmypi-rpc") return `omp --mode rpc --model ${quotedModel}`;
2328
2706
  if (behavior.launchCommandKind === "codex-work-tui") return `codex`;
2329
2707
  if (behavior.launchCommandKind === "acp-host") return "acp-host";
2708
+ if (behavior.launchCommandKind === "muse-tui") return "muse";
2330
2709
  if (behavior.launchCommandKind === "kimi-code-tui") return "kimi-code";
2331
2710
  if (process.env.OVERDECK_TEST_HARNESS_COMMAND) return process.env.OVERDECK_TEST_HARNESS_COMMAND;
2332
2711
  const provider = getProviderForModelSync(validatedModel);
@@ -2394,7 +2773,7 @@ function roleSystemPromptInjectionSync(definitionPath, explicitEffort) {
2394
2773
  mkdirSync(dir, { recursive: true });
2395
2774
  const stem = basename$1(definitionPath).replace(/\.md$/, "");
2396
2775
  const outPath = join$1(dir, `${stem}.md`);
2397
- writeFileSync(outPath, body);
2776
+ writeFileSync(outPath, `Source: ${abs}\n\n${body}`);
2398
2777
  const flags = [` --append-system-prompt-file '${outPath}'`];
2399
2778
  const effort = explicitEffort ?? (typeof frontmatter.effort === "string" ? frontmatter.effort : void 0);
2400
2779
  if (effort) flags.push(` --effort ${effort}`);
@@ -2417,7 +2796,7 @@ function roleSystemPromptInjectionSync(definitionPath, explicitEffort) {
2417
2796
  /** Build a Claude/ohmypi base command for role-based runs. */
2418
2797
  async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "claude-code", subRole, effort) {
2419
2798
  const validatedModel = requireModelOverrideSync(model);
2420
- const quotedModel = shellQuoteModelIdSync(validatedModel);
2799
+ const quotedModel = shellQuoteModelIdSync(harness === "claude-code" ? getClaudeCodeLaunchModelSync(validatedModel) : validatedModel);
2421
2800
  const behavior = getHarnessBehavior(harness);
2422
2801
  if (behavior.launchCommandKind === "ohmypi-rpc") {
2423
2802
  const mcpNames = Object.keys(parseRoleMcpServersSync(roleAgentDefinitionPath(role)));
@@ -2426,6 +2805,7 @@ async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "clau
2426
2805
  }
2427
2806
  if (behavior.launchCommandKind === "codex-work-tui") return `codex`;
2428
2807
  if (behavior.launchCommandKind === "acp-host") return "acp-host";
2808
+ if (behavior.launchCommandKind === "muse-tui") return "muse";
2429
2809
  if (behavior.launchCommandKind === "kimi-code-tui") return "kimi-code";
2430
2810
  if (process.env.OVERDECK_TEST_HARNESS_COMMAND) return process.env.OVERDECK_TEST_HARNESS_COMMAND;
2431
2811
  const provider = getProviderForModelSync(validatedModel);
@@ -2443,14 +2823,22 @@ async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "clau
2443
2823
  if (provider.name === "openai" && await getProviderAuthMode(validatedModel) === "subscription") return `claude${printFlag}${roleInject}${permissionFlags} --model ${shellQuoteModelIdSync(CLI_PROXY_MODEL_ALIASES[validatedModel] ?? validatedModel)}${effortFlag}${nameFlag}`;
2444
2824
  return `claude${printFlag}${roleInject}${permissionFlags} --model ${quotedModel}${effortFlag}${nameFlag}`;
2445
2825
  }
2446
- 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;
2447
2837
  var init_runtime_command = __esmMin((() => {
2448
2838
  import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
2449
2839
  init_claude_permissions();
2450
2840
  init_config_yaml();
2451
- init_briefing_freshness();
2452
2841
  init_claude_auth();
2453
- init_layers();
2454
2842
  init_context();
2455
2843
  init_behavior();
2456
2844
  init_codex();
@@ -2464,11 +2852,42 @@ var init_runtime_command = __esmMin((() => {
2464
2852
  init_agent_state();
2465
2853
  init_identity();
2466
2854
  init_provider_env();
2467
- execAsync$6 = promisify$1(exec$1);
2855
+ init_kimi_claude_routing();
2856
+ init_launch_sources();
2857
+ execAsync$7 = promisify$1(exec$1);
2468
2858
  missingRoleDefinitionWarnings = /* @__PURE__ */ new Set();
2469
2859
  OHMYPI_AGENT_READY_TIMEOUT_SECONDS = 120;
2470
2860
  }));
2471
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
2472
2891
  //#region ../../lib/agents/reopen-guard.ts
2473
2892
  function defaultDeps() {
2474
2893
  return {
@@ -2831,7 +3250,7 @@ async function transitionIssueToInReview(issueId, workspacePath) {
2831
3250
  async function buildAgentLaunchConfig(opts) {
2832
3251
  const model = requireModelOverrideSync(opts.model);
2833
3252
  try {
2834
- const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-QByq1SQa.js");
3253
+ const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-ALboy05V.js");
2835
3254
  await Effect.runPromise(injectOverdeckInfraDeny(opts.workspace));
2836
3255
  } catch (err) {
2837
3256
  console.warn(`[agents] injectOverdeckInfraDeny failed for ${opts.agentId} (non-fatal): ${err instanceof Error ? err.message : err}`);
@@ -2846,11 +3265,19 @@ async function buildAgentLaunchConfig(opts) {
2846
3265
  }
2847
3266
  const providerExports = isAcp ? void 0 : await getProviderExportsForModel(model, opts.harness);
2848
3267
  const launchRole = opts.isPlanning ? "plan" : opts.role;
2849
- const piLauncherFields = behavior.usesRpcFifo ? await getOhmypiLauncherFields(opts.agentId, model) : {};
2850
- const codexLauncherFields = behavior.usesCodexHome ? getCodexLauncherFields(opts.agentId, model, opts.workspace, launchRole) : {};
2851
- 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) : {};
2852
3279
  if (isAcp && !opts.harnessBinaryPath) throw new Error("ACP launch requires the executable path resolved by preflight");
2853
- 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) : {};
2854
3281
  if (opts.spawnMode === "resume" && opts.resumeSessionId) return {
2855
3282
  launcherContent: generateLauncherScriptSync({
2856
3283
  role: launchRole,
@@ -2872,7 +3299,8 @@ async function buildAgentLaunchConfig(opts) {
2872
3299
  ...piLauncherFields,
2873
3300
  ...codexLauncherFields,
2874
3301
  ...acpLauncherFields,
2875
- ...kimiCodeLauncherFields
3302
+ ...kimiCodeLauncherFields,
3303
+ ...museLauncherFields
2876
3304
  }),
2877
3305
  providerEnv
2878
3306
  };
@@ -2899,6 +3327,7 @@ async function buildAgentLaunchConfig(opts) {
2899
3327
  ...codexLauncherFields,
2900
3328
  ...acpLauncherFields,
2901
3329
  ...kimiCodeLauncherFields,
3330
+ ...museLauncherFields,
2902
3331
  ...opts.channelsBridgeMcpConfig ? {
2903
3332
  channelsBridgeMcpConfig: opts.channelsBridgeMcpConfig,
2904
3333
  channelsBridgeServerName: opts.channelsBridgeServerName ?? "overdeck-bridge"
@@ -2924,7 +3353,7 @@ async function retrieveSpawnTimeMemoryContext(input) {
2924
3353
  agentRole: input.role,
2925
3354
  agentHarness: input.harness
2926
3355
  };
2927
- const { injectPromptTimeMemory } = await import("./injection-DsQDBSEi.js");
3356
+ const { injectPromptTimeMemory } = await import("./injection-Bk_pw2Ei.js");
2928
3357
  return (await injectPromptTimeMemory({
2929
3358
  prompt: input.prompt,
2930
3359
  identity,
@@ -3024,7 +3453,7 @@ async function assertWorkspaceStackHealthyForSpawn(issueId, role, allowHost = fa
3024
3453
  record.attempts += 1;
3025
3454
  spawnStackRebuildState.set(normalizedIssue, record);
3026
3455
  console.log(`[agents] Workspace stack for ${normalizedIssue} unhealthy (${details}) — rebuilding before spawn (attempt ${record.attempts}/${SPAWN_STACK_REBUILD_MAX_ATTEMPTS})`);
3027
- const { rebuildWorkspaceStack } = await import("./rebuild-stack-BupKggo5.js");
3456
+ const { rebuildWorkspaceStack } = await import("./rebuild-stack-DSQSgPCI.js");
3028
3457
  const result = await Effect.runPromise(rebuildWorkspaceStack(issueId, { onProgress: (m) => console.log(`[agents] ${normalizedIssue} stack rebuild: ${m}`) })).catch((err) => ({
3029
3458
  success: false,
3030
3459
  error: err instanceof Error ? err.message : String(err)
@@ -3043,6 +3472,8 @@ async function assertWorkspaceStackHealthyForSpawn(issueId, role, allowHost = fa
3043
3472
  }
3044
3473
  var spawnStackRebuildState, SPAWN_STACK_REBUILD_COOLDOWN_MS, SPAWN_STACK_REBUILD_MAX_ATTEMPTS;
3045
3474
  var init_spawn_prep = __esmMin((() => {
3475
+ init_muse_context();
3476
+ init_muse_session();
3046
3477
  init_activity_logger();
3047
3478
  init_claude_permissions();
3048
3479
  init_config();
@@ -3662,6 +4093,99 @@ var init_bridge_token = __esmMin((() => {
3662
4093
  BRIDGE_TOKEN_HEADER = "x-overdeck-bridge-token";
3663
4094
  }));
3664
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
3665
4189
  //#region ../../lib/channels/injection-budget.ts
3666
4190
  /** Echo window for one attempt: 2.5s floor + 100ms per KB, capped at 15s. */
3667
4191
  function echoConfirmTimeoutMs(contentLength) {
@@ -4022,16 +4546,27 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4022
4546
  } catch {
4023
4547
  resolvedMethod ??= "auto";
4024
4548
  }
4025
- const isAcpTarget = state?.harness === "acp";
4549
+ const isAcpTarget = state?.harness === "acp" || state?.harness === "opencode";
4026
4550
  if (isAcpTarget && resolvedMethod !== "auto") throw new Error(`MessageDeliveryFailed: ACP delivery failed for ${normalizedId} (${caller}): ACP requires authenticated host RPC delivery`);
4027
- 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));
4028
4563
  if (resolvedMethod === "tmux") {
4029
4564
  await assertTmuxTargetCanReceive(normalizedId, caller);
4030
4565
  await Effect.runPromise(sendKeys(normalizedId, message));
4031
- return {
4566
+ return completeDelivery({
4032
4567
  ok: true,
4033
4568
  path: "tmux"
4034
- };
4569
+ });
4035
4570
  }
4036
4571
  let appServerFailure;
4037
4572
  if (resolvedMethod === "auto" && !isAcpTarget) {
@@ -4051,10 +4586,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4051
4586
  path: "app-server",
4052
4587
  caller
4053
4588
  });
4054
- return {
4589
+ return completeDelivery({
4055
4590
  ok: true,
4056
4591
  path: "app-server"
4057
- };
4592
+ });
4058
4593
  } catch (err) {
4059
4594
  appServerFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4060
4595
  }
@@ -4078,10 +4613,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4078
4613
  path: "acp",
4079
4614
  caller
4080
4615
  });
4081
- return {
4616
+ return completeDelivery({
4082
4617
  ok: true,
4083
4618
  path: "acp"
4084
- };
4619
+ });
4085
4620
  } catch (err) {
4086
4621
  acpFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4087
4622
  }
@@ -4108,10 +4643,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4108
4643
  path: "supervisor",
4109
4644
  caller
4110
4645
  });
4111
- return {
4646
+ return completeDelivery({
4112
4647
  ok: true,
4113
4648
  path: "supervisor"
4114
- };
4649
+ });
4115
4650
  } catch (err) {
4116
4651
  supervisorFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4117
4652
  }
@@ -4135,10 +4670,10 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4135
4670
  caller,
4136
4671
  ...supervisorFailure ? { "pty-supervisor": supervisorFailure } : {}
4137
4672
  });
4138
- return {
4673
+ return completeDelivery({
4139
4674
  ok: true,
4140
4675
  path: "channels"
4141
- };
4676
+ });
4142
4677
  } catch (err) {
4143
4678
  channelFailure = `socket-post-failed: ${err instanceof Error ? err.message : String(err)}`;
4144
4679
  }
@@ -4155,18 +4690,18 @@ async function deliverAgentMessage(agentId, message, caller = "unknown", deliver
4155
4690
  });
4156
4691
  await assertTmuxTargetCanReceive(normalizedId, caller);
4157
4692
  await Effect.runPromise(sendKeys(normalizedId, message));
4158
- return {
4693
+ return completeDelivery({
4159
4694
  ok: true,
4160
4695
  path: "tmux",
4161
4696
  failure: channelFailure ?? supervisorFailure
4162
- };
4697
+ });
4163
4698
  }
4164
4699
  await assertTmuxTargetCanReceive(normalizedId, caller);
4165
4700
  await Effect.runPromise(sendKeys(normalizedId, message));
4166
- return {
4701
+ return completeDelivery({
4167
4702
  ok: true,
4168
4703
  path: "tmux"
4169
- };
4704
+ });
4170
4705
  }
4171
4706
  /**
4172
4707
  * Keyed delivery cascade (PAN-2997). Only two tiers may carry a keyed
@@ -4413,6 +4948,7 @@ async function setAgentDeliveryMethod(agentId, deliveryMethod) {
4413
4948
  var SocketPostStatusError, AmbiguousKeyedDeliveryError, RESUME_TRANSCRIPT_CONFIRM_TIMEOUT_MS, RESUME_TRANSCRIPT_CONFIRM_INTERVAL_MS;
4414
4949
  var init_delivery = __esmMin((() => {
4415
4950
  init_behavior();
4951
+ init_kimi_context_envelope();
4416
4952
  init_agents();
4417
4953
  init_runtime_state();
4418
4954
  init_tmux();
@@ -5399,7 +5935,7 @@ var init_runtime_census = __esmMin((() => {
5399
5935
  ]);
5400
5936
  runtimeCensusService = createRuntimeCensusService({
5401
5937
  listPanes: async () => {
5402
- const { listAllPaneRecords } = await import("./tmux-C-hxv71f.js");
5938
+ const { listAllPaneRecords } = await import("./tmux-aj9rscol.js");
5403
5939
  return Effect.runPromise(listAllPaneRecords());
5404
5940
  },
5405
5941
  readProcesses: readRuntimeProcessTable
@@ -5769,7 +6305,7 @@ async function killLauncherProcessAsync(agentId) {
5769
6305
  const launcherPath = join$1(AGENTS_DIR, agentId, "launcher.sh");
5770
6306
  let pidsOut;
5771
6307
  try {
5772
- const { stdout } = await execAsync$5(`pgrep -f ${JSON.stringify(launcherPath)}`);
6308
+ const { stdout } = await execAsync$6(`pgrep -f ${JSON.stringify(launcherPath)}`);
5773
6309
  pidsOut = stdout.trim();
5774
6310
  } catch {
5775
6311
  return;
@@ -5824,14 +6360,14 @@ function stopAgentSync(agentId, cause = "system") {
5824
6360
  lastActivity: (/* @__PURE__ */ new Date()).toISOString()
5825
6361
  });
5826
6362
  }
5827
- var execAsync$5, stopAgent;
6363
+ var execAsync$6, stopAgent;
5828
6364
  var init_termination = __esmMin((() => {
5829
6365
  init_agents();
5830
6366
  init_agent_runtime();
5831
6367
  init_paths();
5832
6368
  init_tmux();
5833
6369
  init_errors();
5834
- execAsync$5 = promisify$1(exec$1);
6370
+ execAsync$6 = promisify$1(exec$1);
5835
6371
  stopAgent = (agentId, cause = "system") => {
5836
6372
  const normalizedId = normalizeAgentId(agentId);
5837
6373
  return Effect.gen(function* () {
@@ -6013,7 +6549,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6013
6549
  if (expected.filter((root) => !existsSync$1(`${root.target}/.git`)).length === 0) {
6014
6550
  if ((await Promise.all(expected.map(async (root) => {
6015
6551
  try {
6016
- 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();
6017
6553
  } catch {
6018
6554
  return "";
6019
6555
  }
@@ -6023,7 +6559,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6023
6559
  }
6024
6560
  await mkdir(slot.workspace, { recursive: true });
6025
6561
  try {
6026
- 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 });
6027
6563
  } catch (error) {
6028
6564
  throw new Error(`Could not create isolated polyrepo slot workspace ${slot.workspace}: ${error instanceof Error ? error.message : String(error)}`);
6029
6565
  }
@@ -6032,7 +6568,7 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6032
6568
  if (existsSync$1(slot.workspace)) {
6033
6569
  let branch = "";
6034
6570
  try {
6035
- 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();
6036
6572
  } catch {}
6037
6573
  if (branch === slot.branch) return;
6038
6574
  throw new Error(`Registered slot workspace is incomplete at ${slot.workspace}; run pan swarm reset before dispatching it.`);
@@ -6042,11 +6578,11 @@ async function ensureRegisteredSlotWorktree(issueId, baseWorkspace, slot) {
6042
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.`);
6043
6579
  const target = JSON.stringify(slot.workspace);
6044
6580
  const branch = JSON.stringify(slot.branch);
6045
- 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 });
6046
6582
  }
6047
6583
  async function gitBranchExists(workspace, branch) {
6048
6584
  try {
6049
- 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 });
6050
6586
  return true;
6051
6587
  } catch {
6052
6588
  return false;
@@ -6054,20 +6590,625 @@ async function gitBranchExists(workspace, branch) {
6054
6590
  }
6055
6591
  async function gitRefsEqual(workspace, left, right) {
6056
6592
  try {
6057
- 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 })]);
6058
6594
  return leftResult.stdout.trim() === rightResult.stdout.trim();
6059
6595
  } catch {
6060
6596
  return false;
6061
6597
  }
6062
6598
  }
6063
- var execAsync$4;
6599
+ var execAsync$5;
6064
6600
  var init_registered_slot_spawn = __esmMin((() => {
6065
6601
  init_dag();
6066
6602
  init_io();
6067
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();
6068
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
+ };
6069
7201
  }));
6070
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
6071
7212
  //#region ../../lib/agents/spawn.ts
6072
7213
  async function spawnRun(issueId, role, options) {
6073
7214
  if (role !== "work") return spawnRunWithoutConsentClaim(issueId, role, options);
@@ -6131,7 +7272,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6131
7272
  let reapWarmIdle = false;
6132
7273
  const advancing = role === "review" || role === "test" || role === "ship";
6133
7274
  try {
6134
- const { isPaneDead } = await import("./tmux-C-hxv71f.js");
7275
+ const { isPaneDead } = await import("./tmux-aj9rscol.js");
6135
7276
  if (await Effect.runPromise(isPaneDead(agentId))) reapWarmIdle = true;
6136
7277
  else if (advancing) {
6137
7278
  const { status } = resolveCanonicalReviewStatus(issueId);
@@ -6140,7 +7281,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6140
7281
  } catch {}
6141
7282
  if (!reapWarmIdle) throw new Error(`Role run ${agentId} already running. Use 'pan tell' to message it.`);
6142
7283
  console.log(`[spawn] ${agentId} is warm-idle from the previous cycle — reaping it for the new ${role} dispatch (PAN-2579)`);
6143
- const { killSession } = await import("./tmux-C-hxv71f.js");
7284
+ const { killSession } = await import("./tmux-aj9rscol.js");
6144
7285
  await Effect.runPromise(killSession(agentId)).catch(() => {});
6145
7286
  }
6146
7287
  await prepareWorkspaceForAgentSpawn(issueId, role, options.allowHost, workspace);
@@ -6155,7 +7296,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6155
7296
  assertCodexNativeAuthForSpawn(resolvedHarness, listAgentStates());
6156
7297
  await ensureLifecycleHooksBeforeLaunch(agentId, resolvedHarness);
6157
7298
  if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
6158
- const { isCliproxyRunning } = await import("./cliproxy-ltFu5xfR.js");
7299
+ const { isCliproxyRunning } = await import("./cliproxy-Dz_zq_4H.js");
6159
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.");
6160
7301
  }
6161
7302
  const state = {
@@ -6186,8 +7327,8 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6186
7327
  const shouldDeliverPromptViaTmux = shouldRegisterConversation && resolvedHarness === "claude-code";
6187
7328
  const shouldDeliverPromptViaPi = shouldRegisterConversation && resolvedHarness === "ohmypi";
6188
7329
  const shouldDeliverPromptViaCodexTui = shouldRegisterConversation && resolvedHarness === "codex";
6189
- const shouldDeliverPromptViaKimiCode = shouldRegisterConversation && resolvedHarness === "kimi-code";
6190
- const shouldDeliverPromptViaAcp = resolvedHarness === "acp";
7330
+ const shouldDeliverPromptViaKimiCode = resolvedHarness === "muse" || resolvedHarness === "kimi-code";
7331
+ const shouldDeliverPromptViaAcp = resolvedHarness === "acp" || resolvedHarness === "opencode";
6191
7332
  const prompt = options.prompt ? await withSpawnTimeMemoryContext({
6192
7333
  prompt: options.prompt,
6193
7334
  issueId,
@@ -6213,15 +7354,23 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6213
7354
  }
6214
7355
  const providerExports = isAcp ? void 0 : await getProviderExportsForModel(selectedModel, resolvedHarness);
6215
7356
  const providerEnv = isAcp ? {} : await getProviderEnvForModel(selectedModel, resolvedHarness);
6216
- const piLauncherFields = resolvedHarness === "ohmypi" ? await getOhmypiLauncherFields(agentId, selectedModel) : {};
6217
- const codexLauncherFields = resolvedHarness === "codex" ? getCodexLauncherFields(agentId, selectedModel, workspace, role) : {};
6218
- const acpLauncherFields = isAcp ? getAcpLauncherFields(agentId, selectedModel, workspace, harnessLaunch.binaryPath, role) : {};
6219
- 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) : {};
6220
7369
  let sessionId;
6221
7370
  let rawSessionId;
6222
7371
  if (shouldRegisterConversation) {
6223
- rawSessionId = isAcp ? options.resumeSessionId : options.resumeSessionId ?? randomUUID();
6224
- if (!isAcp && rawSessionId) try {
7372
+ rawSessionId = isAcp || resolvedHarness === "kimi-code" ? options.resumeSessionId : options.resumeSessionId ?? randomUUID();
7373
+ if (!isAcp && resolvedHarness !== "kimi-code" && rawSessionId) try {
6225
7374
  const agentDir = getAgentDir(agentId);
6226
7375
  await mkdir$1(agentDir, { recursive: true });
6227
7376
  await writeFile$1(join$1(agentDir, "session.id"), rawSessionId, "utf-8");
@@ -6275,18 +7424,19 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6275
7424
  ...piLauncherFields,
6276
7425
  ...codexLauncherFields,
6277
7426
  ...acpLauncherFields,
6278
- ...kimiCodeLauncherFields
7427
+ ...kimiCodeLauncherFields,
7428
+ ...museLauncherFields
6279
7429
  });
6280
7430
  const launcherScript = join$1(getAgentDir(agentId), "launcher.sh");
6281
7431
  await writeLauncherScriptAtomic(launcherScript, launcherContent);
6282
7432
  const claudeCmd = `bash ${launcherScript}`;
6283
7433
  console.log(`[claude-invoke] purpose=role-run | role=${role} | model=${state.model} | source=agents.ts:spawnRun | session=${agentId} | command="${claudeCmd}"`);
6284
7434
  try {
6285
- const { preTrustDirectory } = await import("./workspace-manager-gz9Amovn.js");
7435
+ const { preTrustDirectory } = await import("./workspace-manager-D0jJ7StJ.js");
6286
7436
  preTrustDirectory(workspace);
6287
7437
  } catch {}
6288
7438
  clearReadySignal(agentId);
6289
- await Effect.runPromise(createSession(agentId, workspace, claudeCmd, { env: {
7439
+ const launchRoleSession = () => Effect.runPromise(createSession(agentId, workspace, claudeCmd, { env: {
6290
7440
  ...BLANKED_PROVIDER_ENV,
6291
7441
  TERM: "xterm-256color",
6292
7442
  OVERDECK_AGENT_ID: agentId,
@@ -6298,6 +7448,20 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6298
7448
  ...flywheelEnv,
6299
7449
  ...providerEnv
6300
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();
6301
7465
  if (shouldRegisterConversation) await saveAgentRuntimeState(agentId, {
6302
7466
  claudeSessionId: rawSessionId,
6303
7467
  ...options.resumeSessionId ? {} : {
@@ -6307,7 +7471,7 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6307
7471
  });
6308
7472
  await Effect.runPromise(setOption(agentId, "destroy-unattached", "off"));
6309
7473
  await Effect.runPromise(setOption(exactPaneTarget(agentId), "remain-on-exit", "on"));
6310
- if (prompt) {
7474
+ if (prompt || resolvedHarness === "kimi-code") {
6311
7475
  if (shouldDeliverPromptViaAcp) try {
6312
7476
  await waitForPromptReady(agentId, resolvedHarness, 30);
6313
7477
  const delivery = await deliverAgentMessage(agentId, prompt, "spawnRun:initial-prompt");
@@ -6334,6 +7498,17 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6334
7498
  }
6335
7499
  else if (shouldDeliverPromptViaTmux || shouldDeliverPromptViaCodexTui || shouldDeliverPromptViaKimiCode) if (tracksKickoffDelivery) {
6336
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
+ });
6337
7512
  if (delivery.ok) {
6338
7513
  state.kickoffDelivered = true;
6339
7514
  await Effect.runPromise(saveAgentState(state));
@@ -6341,14 +7516,26 @@ async function spawnRunWithoutConsentClaim(issueId, role, options, acceptConsent
6341
7516
  await recordStartupSessionExit(state, issueId, role);
6342
7517
  return state;
6343
7518
  }
6344
- } else if (await waitForPromptReady(agentId, resolvedHarness, 30)) {
6345
- await new Promise((resolve) => setTimeout(resolve, 500));
6346
- await deliverAgentMessage(agentId, prompt, "spawnRun:initial-prompt");
6347
- } 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
+ }
6348
7535
  }
6349
7536
  markAgentRunning(state);
6350
7537
  try {
6351
- const { snapshotWorkspaceHeadsPromise } = await import("./git-utils-fcK3ZRNj.js");
7538
+ const { snapshotWorkspaceHeadsPromise } = await import("./git-utils-DvcWLgGS.js");
6352
7539
  const headAnchor = await snapshotWorkspaceHeadsPromise(issueId, workspace);
6353
7540
  if (headAnchor) state.roleRunHead = headAnchor;
6354
7541
  } catch {}
@@ -6390,7 +7577,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6390
7577
  });
6391
7578
  console.log(`[DEBUG] Selected model: ${selectedModel}`);
6392
7579
  if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
6393
- const { isCliproxyRunning } = await import("./cliproxy-ltFu5xfR.js");
7580
+ const { isCliproxyRunning } = await import("./cliproxy-Dz_zq_4H.js");
6394
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.");
6395
7582
  }
6396
7583
  const resolvedHarness = await resolveHarness({
@@ -6440,7 +7627,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6440
7627
  });
6441
7628
  }
6442
7629
  if (role === "work") try {
6443
- const { writeStoryFeatureContext } = await import("./work-agent-prompt-CQWlmw_y.js");
7630
+ const { writeStoryFeatureContext } = await import("./work-agent-prompt-Csr4vMbl.js");
6444
7631
  await writeStoryFeatureContext(options.workspace, options.issueId);
6445
7632
  } catch (ctxErr) {
6446
7633
  console.warn(`[agents] Could not write story feature context for ${options.issueId}: ${ctxErr.message}`);
@@ -6487,7 +7674,7 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6487
7674
  try {
6488
7675
  const venvPath = join$1(options.workspace, ".venv");
6489
7676
  if (isTldrEnabledSync() && existsSync(venvPath)) {
6490
- const { getTldrDaemonServiceSync } = await import("./tldr-daemon-DKCumqHU.js");
7677
+ const { getTldrDaemonServiceSync } = await import("./tldr-daemon-CW1MhBkM.js");
6491
7678
  const tldrService = getTldrDaemonServiceSync(options.workspace, venvPath);
6492
7679
  if (!(await tldrService.getStatus()).running) {
6493
7680
  await tldrService.start(true);
@@ -6527,13 +7714,13 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6527
7714
  const claudeCmd = `bash ${launcherScript}`;
6528
7715
  console.log(`[claude-invoke] purpose=work-agent | model=${state.model} | source=agents.ts:spawnAgent | session=${agentId} | command="${claudeCmd}"`);
6529
7716
  try {
6530
- const { preTrustDirectory } = await import("./workspace-manager-gz9Amovn.js");
7717
+ const { preTrustDirectory } = await import("./workspace-manager-D0jJ7StJ.js");
6531
7718
  preTrustDirectory(options.workspace);
6532
7719
  } catch {}
6533
7720
  try {
6534
- const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-HAqQZZRD.js");
7721
+ const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-BxM1U38q.js");
6535
7722
  if (isGitHubAppConfigured()) {
6536
- const { findProjectByPathSync } = await import("./projects-Crur9uCa.js");
7723
+ const { findProjectByPathSync } = await import("./projects-DXgHD2Xl.js");
6537
7724
  const ghRepo = findProjectByPathSync(resolve$1(options.workspace, "..", ".."))?.github_repo;
6538
7725
  if (ghRepo) {
6539
7726
  const [owner, repo] = ghRepo.split("/");
@@ -6546,42 +7733,29 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6546
7733
  console.warn(`[${agentId}] GitHub App config failed (falling back to SSH): ${err.message}`);
6547
7734
  }
6548
7735
  clearReadySignal(agentId);
6549
- const launchAndCaptureKimiSession = async () => {
6550
- let kimiExistingSessionsBefore;
6551
- if (resolvedHarness === "kimi-code") try {
6552
- const { kimiSessionsRoot } = await import("./kimi-code-Cdkk9vRU.js");
6553
- kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), options.workspace)));
6554
- } catch {
6555
- kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
6556
- }
6557
- await Effect.runPromise(createSession(agentId, options.workspace, claudeCmd, { env: {
6558
- ...BLANKED_PROVIDER_ENV,
6559
- TERM: "xterm-256color",
6560
- OVERDECK_AGENT_ID: agentId,
6561
- OVERDECK_ISSUE_ID: options.issueId,
6562
- OVERDECK_SESSION_TYPE: role,
6563
- OVERDECK_AGENT_STARTED_BY: startedBy,
6564
- CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
6565
- GIT_SEQUENCE_EDITOR: "false",
6566
- ...flywheelEnv,
6567
- ...providerEnv
6568
- } }));
6569
- if (kimiExistingSessionsBefore) {
6570
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cdkk9vRU.js");
6571
- const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), options.workspace, kimiExistingSessionsBefore);
6572
- if (sessionId) writeKimiSessionId(agentId, sessionId);
6573
- else throw new Error(`kimi-code session capture timed out for ${agentId} — no new session directory appeared under the workspace bucket`);
6574
- }
6575
- };
6576
- if (resolvedHarness === "kimi-code") {
6577
- const { withKimiSessionCaptureLock } = await import("./kimi-code-Cdkk9vRU.js");
6578
- try {
6579
- await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), options.workspace, launchAndCaptureKimiSession);
6580
- } catch (err) {
6581
- await Effect.runPromise(stopAgent(agentId)).catch(() => void 0);
6582
- throw err;
6583
- }
6584
- } 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();
6585
7759
  await acceptConsent?.();
6586
7760
  await saveAgentRuntimeState(agentId, {
6587
7761
  claudeSessionId: state.sessionId,
@@ -6618,9 +7792,22 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6618
7792
  throw new Error(`Agent ${agentId} kickoff delivery failed: ${err instanceof Error ? err.message : String(err)}`);
6619
7793
  }
6620
7794
  }
6621
- else if (prompt) {
7795
+ else if (prompt || resolvedHarness === "kimi-code") {
6622
7796
  if (dismissChannelsDialogPromise) await dismissChannelsDialogPromise;
6623
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
+ });
6624
7811
  if (delivery.ok) {
6625
7812
  if (tracksKickoffDelivery) {
6626
7813
  state.kickoffDelivered = true;
@@ -6634,10 +7821,10 @@ async function spawnAgentWithoutConsentClaim(options, acceptConsent) {
6634
7821
  }
6635
7822
  }
6636
7823
  if (resolvedHarness === "codex" && loadConfigSync().config.codex?.transport === "tui" && getHarnessBehavior(resolvedHarness).readinessKind === "codex-tui-prompt") {
6637
- const codexHomeForAgent = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home");
7824
+ const codexHomeForAgent = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home-v2");
6638
7825
  (async () => {
6639
7826
  try {
6640
- const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-BqLZKVNm.js");
7827
+ const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-DzLXjzbf.js");
6641
7828
  const rollout = await waitForCodexRollout(codexHomeForAgent, 12e4);
6642
7829
  if (rollout) {
6643
7830
  const threadId = extractThreadIdFromRollout(rollout);
@@ -6689,6 +7876,8 @@ function writeTaskCache(agentId, issueId) {
6689
7876
  }
6690
7877
  var execAsync$3;
6691
7878
  var init_spawn = __esmMin((() => {
7879
+ init_muse_context();
7880
+ init_muse_session();
6692
7881
  init_activity_logger();
6693
7882
  init_child_env();
6694
7883
  init_config_yaml();
@@ -6728,6 +7917,8 @@ var init_spawn = __esmMin((() => {
6728
7917
  init_auto_spawn_consent();
6729
7918
  init_provenance();
6730
7919
  init_registered_slot_spawn();
7920
+ init_kimi_code();
7921
+ init_managed_kimi_delivery();
6731
7922
  execAsync$3 = promisify$1(exec$1);
6732
7923
  }));
6733
7924
  //#endregion
@@ -7598,7 +8789,7 @@ function queueAgentMail(agentId, message, kind = "queued", dedupKey, source) {
7598
8789
  return mailPath;
7599
8790
  }
7600
8791
  function resolveAgentDeliveryMethod(state) {
7601
- if (state?.harness === "acp") return "auto";
8792
+ if (state?.harness === "acp" || state?.harness === "opencode") return "auto";
7602
8793
  return resilientDeliveryMethod(state?.deliveryMethod);
7603
8794
  }
7604
8795
  function claimCodexIdleTurn(agentId) {
@@ -7639,7 +8830,7 @@ function deliverWithOptionalKey(normalizedId, message, caller, deliveryMethod, d
7639
8830
  * at-most-once across the whole replay window.
7640
8831
  */
7641
8832
  async function resumeThenDeliverKeyed(normalizedId, message, caller, agentState, dedupKey) {
7642
- const { resumeAgent } = await import("./agents-BdkVgjxC.js");
8833
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7643
8834
  const result = await resumeAgent(normalizedId);
7644
8835
  if (!result.success) throw new Error(`Failed to auto-resume agent: ${result.error}`);
7645
8836
  const delivery = await deliverAgentMessage(normalizedId, message, `messageAgent:${caller}`, resolveAgentDeliveryMethod(agentState), { dedupKey });
@@ -7694,7 +8885,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7694
8885
  }
7695
8886
  console.log(`[agents] Auto-resuming suspended agent ${normalizedId} to deliver message`);
7696
8887
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7697
- const { resumeAgent } = await import("./agents-BdkVgjxC.js");
8888
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7698
8889
  const result = await resumeAgent(normalizedId, message);
7699
8890
  if (!result.success) throw new Error(`Failed to auto-resume agent: ${result.error}`);
7700
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.`);
@@ -7719,7 +8910,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7719
8910
  }
7720
8911
  console.log(`[agents] Auto-resuming stopped agent ${normalizedId} to deliver feedback (session exists: ${await Effect.runPromise(sessionExists(normalizedId))})`);
7721
8912
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7722
- const { resumeAgent } = await import("./agents-BdkVgjxC.js");
8913
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7723
8914
  const resumeResult = await resumeAgent(normalizedId, message);
7724
8915
  queueAgentMail(normalizedId, message);
7725
8916
  if (resumeResult.success && resumeResult.messageDelivered !== false) {
@@ -7763,7 +8954,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7763
8954
  const resumeModel = agentState.model || "claude-sonnet-4-6";
7764
8955
  const fallbackHarness = agentState.harness ?? "claude-code";
7765
8956
  const harnessLaunch = await prepareHarnessLaunch(fallbackHarness);
7766
- const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-BdkVgjxC.js");
8957
+ const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-BVvL4o_4.js");
7767
8958
  await assertWorkspaceStackHealthyForSpawn(agentState.issueId || normalizedId.replace(/^agent-/, "").toUpperCase(), resumeRole, agentState.hostOverride === true, agentState.workspace);
7768
8959
  const fallbackPiFields = fallbackHarness === "ohmypi" ? await getOhmypiLauncherFields(normalizedId, resumeModel) : {};
7769
8960
  const fallbackCodexFields = fallbackHarness === "codex" ? getCodexLauncherFields(normalizedId, resumeModel, agentState.workspace, resumeRole) : {};
@@ -7777,6 +8968,12 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7777
8968
  extraEnvExports: [harnessLaunch.pathExport],
7778
8969
  baseCommand: await getRoleRuntimeBaseCommand(resumeModel, normalizedId, resumeRole, fallbackHarness),
7779
8970
  appendSystemPromptFiles: await claudeSystemPromptFiles(agentState.workspace, fallbackHarness),
8971
+ managedStateKey: normalizedId,
8972
+ overdeckEnv: {
8973
+ agentId: normalizedId,
8974
+ issueId: agentState.issueId,
8975
+ sessionType: resumeRole
8976
+ },
7780
8977
  useSupervisor: fallbackSupervisorLaunch.useSupervisor,
7781
8978
  supervisorScriptPath: fallbackSupervisorLaunch.supervisorScriptPath,
7782
8979
  ...fallbackPiFields,
@@ -7846,12 +9043,12 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7846
9043
  ...reason ? { reason } : {}
7847
9044
  };
7848
9045
  }
7849
- const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-MbWzm5Fh.js");
9046
+ const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-CEOvYsvK.js");
7850
9047
  const remoteState = loadRemoteAgentState(normalizedId);
7851
9048
  if (remoteState && remoteState.vmName) {
7852
9049
  console.log(`[agents] Sending message to remote agent ${normalizedId} on ${remoteState.vmName}`);
7853
9050
  if (opts.dedupKey !== void 0) {
7854
- const { sendToRemoteAgentKeyed } = await import("./remote-agents-MbWzm5Fh.js");
9051
+ const { sendToRemoteAgentKeyed } = await import("./remote-agents-CEOvYsvK.js");
7855
9052
  const remoteOutcome = await sendToRemoteAgentKeyed(normalizedId, remoteState.vmName, message, opts.dedupKey);
7856
9053
  queueAgentMail(normalizedId, message, "delivered", opts.dedupKey);
7857
9054
  await appendTellInterventionForUserSource(normalizedId, caller);
@@ -7915,7 +9112,7 @@ async function messageAgent(agentId, message, caller = "internal", opts = {}) {
7915
9112
  if (panePids.length > 0 && !await hasAgentRuntimeInSubtree(panePids[0], expectedHarness)) {
7916
9113
  console.warn(`[agents] ${normalizedId} tmux session is a zombie (no ${expectedHarness} runtime) — attempting resume`);
7917
9114
  if (opts.dedupKey !== void 0) return resumeThenDeliverKeyed(normalizedId, message, caller, agentState, opts.dedupKey);
7918
- const { resumeAgent } = await import("./agents-BdkVgjxC.js");
9115
+ const { resumeAgent } = await import("./agents-BVvL4o_4.js");
7919
9116
  const resumeResult = await resumeAgent(normalizedId, message);
7920
9117
  if (resumeResult.success) {
7921
9118
  const delivered = resumeResult.messageDelivered !== false;
@@ -8283,6 +9480,51 @@ var init_resume_pane_choice = __esmMin((() => {
8283
9480
  ];
8284
9481
  }));
8285
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
8286
9528
  //#region ../../lib/agents/resume.ts
8287
9529
  /**
8288
9530
  * Resume a suspended agent (PAN-80)
@@ -8315,7 +9557,7 @@ async function buildCompactRecoverySeed(agentId) {
8315
9557
  if (agentState?.workspace && sessionId) {
8316
9558
  const sessionFile = sessionFilePath(agentState.workspace, sessionId);
8317
9559
  try {
8318
- const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-BX9UR8nl.js"), import("./smart-compaction-CdtKIcDk.js")]);
9560
+ const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-D0zgWM1f.js"), import("./smart-compaction-owKHJDbL.js")]);
8319
9561
  const settings = getConversationCompactionSettings();
8320
9562
  summary = (await Effect.runPromise(generateSmartSummary({
8321
9563
  jsonlPath: sessionFile,
@@ -8326,7 +9568,7 @@ async function buildCompactRecoverySeed(agentId) {
8326
9568
  } catch (err) {
8327
9569
  logAgentLifecycleSync(normalizedId, `compact-recovery smart summary failed (${err instanceof Error ? err.message : String(err)}); trying heuristic fallback`);
8328
9570
  try {
8329
- const { generateFallbackSummary } = await import("./summary-fork-DZcsOvDD.js");
9571
+ const { generateFallbackSummary } = await import("./summary-fork-PLcckTRE.js");
8330
9572
  summary = await Effect.runPromise(generateFallbackSummary(sessionFile));
8331
9573
  } catch (fallbackErr) {
8332
9574
  logAgentLifecycleSync(normalizedId, `compact-recovery fallback summary failed (${fallbackErr instanceof Error ? fallbackErr.message : String(fallbackErr)}); seeding with reseed instructions only`);
@@ -8340,6 +9582,9 @@ async function buildCompactRecoverySeed(agentId) {
8340
9582
  }
8341
9583
  async function resumeAgent(agentId, message, opts) {
8342
9584
  const normalizedId = normalizeAgentId(agentId);
9585
+ return withReviewLifecycleGuardForAgent(normalizedId, () => resumeAgentWithinLifecycle(normalizedId, message, opts));
9586
+ }
9587
+ async function resumeAgentWithinLifecycle(normalizedId, message, opts) {
8343
9588
  const requestedModel = normalizeModelOverrideSync(opts?.model);
8344
9589
  logAgentLifecycleSync(normalizedId, `resumeAgent called (message=${message ? "yes" : "no"}, harness=${opts?.harness || "unchanged"})`);
8345
9590
  const runtimeState = getAgentRuntimeStateSync(normalizedId);
@@ -8562,7 +9807,7 @@ async function resumeAgent(agentId, message, opts) {
8562
9807
  const msg = err instanceof Error ? err.message : String(err);
8563
9808
  console.error(`[resumeAgent] ohmypi prompt delivery failed: ${msg}`);
8564
9809
  }
8565
- else if (effectiveHarness === "acp") {
9810
+ else if (effectiveHarness === "acp" || effectiveHarness === "opencode") {
8566
9811
  const delivery = await deliverInitialPromptWithRetry(normalizedId, effectiveMessage, "resumeAgent:acp-continue");
8567
9812
  messageDelivered = delivery.ok;
8568
9813
  if (delivery.ok && resumeMessage.redeliveringKickoff) markKickoffRedelivered(agentState);
@@ -8727,6 +9972,7 @@ var init_resume = __esmMin((() => {
8727
9972
  init_supervisor_channels();
8728
9973
  init_spawn_prep();
8729
9974
  init_resume_contract();
9975
+ init_review_lifecycle_guard();
8730
9976
  }));
8731
9977
  //#endregion
8732
9978
  //#region ../../lib/graceful-restart.ts
@@ -9625,7 +10871,11 @@ var init_pending_decision_gate = __esmMin((() => {
9625
10871
  //#endregion
9626
10872
  //#region ../../lib/agents/recovery.ts
9627
10873
  function resolveRecoveryResumeSessionId(agentId, harness) {
9628
- 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;
9629
10879
  return getLatestSessionIdSync(agentId) ?? void 0;
9630
10880
  }
9631
10881
  async function restartAgent(agentId, opts = {}, deps = {}) {
@@ -9730,7 +10980,7 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9730
10980
  unlinkSync(join$1(getAgentDir(normalizedId), "kimi-session-id"));
9731
10981
  } catch {}
9732
10982
  try {
9733
- const { kimiSessionsRoot } = await import("./kimi-code-Cdkk9vRU.js");
10983
+ const { kimiSessionsRoot } = await import("./kimi-code-Cx5YUJpS.js");
9734
10984
  kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), agentState.workspace)));
9735
10985
  } catch {
9736
10986
  kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
@@ -9747,14 +10997,14 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9747
10997
  ...providerEnv
9748
10998
  } }));
9749
10999
  if (kimiExistingSessionsBefore) {
9750
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cdkk9vRU.js");
11000
+ const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cx5YUJpS.js");
9751
11001
  const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), agentState.workspace, kimiExistingSessionsBefore);
9752
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`);
9753
11003
  writeKimiSessionId(normalizedId, sessionId);
9754
11004
  }
9755
11005
  };
9756
11006
  if (effectiveHarness === "kimi-code") {
9757
- const { withKimiSessionCaptureLock } = await import("./kimi-code-Cdkk9vRU.js");
11007
+ const { withKimiSessionCaptureLock } = await import("./kimi-code-Cx5YUJpS.js");
9758
11008
  await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), agentState.workspace, launchAndCaptureKimiSession);
9759
11009
  } else await launchAndCaptureKimiSession();
9760
11010
  const prompt = message || buildResumeContinueMessage(agentState);
@@ -9765,9 +11015,10 @@ async function restartAgent(agentId, opts = {}, deps = {}) {
9765
11015
  console.error(`[restartAgent] ohmypi prompt delivery failed for ${normalizedId}: ${msg}`);
9766
11016
  }
9767
11017
  else {
9768
- 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}`);
9769
11020
  await new Promise((r) => setTimeout(r, 500));
9770
- if (effectiveHarness === "codex" || effectiveHarness === "acp" || effectiveHarness === "kimi-code") {
11021
+ if (effectiveHarness === "codex" || effectiveHarness === "acp" || effectiveHarness === "kimi-code" || effectiveHarness === "opencode" || effectiveHarness === "muse") {
9771
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`);
9772
11023
  } else await Effect.runPromise(sendKeys(normalizedId, prompt));
9773
11024
  }
@@ -9879,13 +11130,13 @@ async function recoverAgent(agentId, opts = {}) {
9879
11130
  health.recoveryCount = (health.recoveryCount || 0) + 1;
9880
11131
  writeFileSync(healthFile, JSON.stringify(health, null, 2));
9881
11132
  const recoveryPrompt = generateRecoveryPrompt(state);
9882
- 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) : {};
9883
11135
  if (state.model) {
9884
11136
  const provider = getProviderForModelSync(state.model);
9885
11137
  if (provider.authType === "credential-file") setupCredentialFileAuthSync(provider, state.workspace);
9886
11138
  else clearCredentialFileAuthSync(state.workspace);
9887
11139
  }
9888
- const recoveryHarness = normalizeHarness(state.harness ?? null) ?? "claude-code";
9889
11140
  const harnessLaunch = await prepareHarnessLaunch(recoveryHarness);
9890
11141
  const recoverySupervisorLaunch = await prepareSupervisorForRelaunch(normalizedId, state, state.model, recoveryHarness);
9891
11142
  saveAgentStateSync(state);
@@ -9924,7 +11175,7 @@ async function recoverAgent(agentId, opts = {}) {
9924
11175
  state
9925
11176
  };
9926
11177
  }
9927
- if (recoveryHarness === "acp") {
11178
+ if (recoveryHarness === "acp" || recoveryHarness === "opencode" || recoveryHarness === "muse") {
9928
11179
  const resumeSessionId = resolveRecoveryResumeSessionId(normalizedId, recoveryHarness);
9929
11180
  const { launcherContent, providerEnv: acpProviderEnv } = await buildAgentLaunchConfig({
9930
11181
  agentId: normalizedId,
@@ -9936,7 +11187,9 @@ async function recoverAgent(agentId, opts = {}) {
9936
11187
  spawnMode: "resume",
9937
11188
  resumeSessionId
9938
11189
  } : {},
9939
- harness: "acp",
11190
+ harness: recoveryHarness,
11191
+ useSupervisor: recoverySupervisorLaunch.useSupervisor,
11192
+ supervisorScriptPath: recoverySupervisorLaunch.supervisorScriptPath,
9940
11193
  harnessBinaryPath: harnessLaunch.binaryPath,
9941
11194
  extraEnvExports: [harnessLaunch.pathExport]
9942
11195
  });
@@ -9950,14 +11203,18 @@ async function recoverAgent(agentId, opts = {}) {
9950
11203
  CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
9951
11204
  ...acpProviderEnv
9952
11205
  } }));
9953
- 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`);
9954
11211
  if (!delivery.ok) {
9955
11212
  await Effect.runPromise(stopAgent(normalizedId));
9956
- 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"}`);
9957
11214
  }
9958
11215
  markAgentRunning(state);
9959
11216
  saveAgentStateSync(state);
9960
- logAgentLifecycleSync(normalizedId, `recoverAgent SUCCESS: recoveryCount=${health.recoveryCount} (acp)`);
11217
+ logAgentLifecycleSync(normalizedId, `recoverAgent SUCCESS: recoveryCount=${health.recoveryCount} (${recoveryHarness})`);
9961
11218
  return {
9962
11219
  action: "respawned",
9963
11220
  state
@@ -9984,7 +11241,7 @@ async function recoverAgent(agentId, opts = {}) {
9984
11241
  const launchAndCaptureKimiSession = async () => {
9985
11242
  let kimiExistingSessionsBefore;
9986
11243
  if (!resumeSessionId) try {
9987
- const { kimiSessionsRoot } = await import("./kimi-code-Cdkk9vRU.js");
11244
+ const { kimiSessionsRoot } = await import("./kimi-code-Cx5YUJpS.js");
9988
11245
  kimiExistingSessionsBefore = new Set(await readdir$1(kimiSessionsRoot(join$1(homedir(), ".kimi-code"), state.workspace)));
9989
11246
  } catch {
9990
11247
  kimiExistingSessionsBefore = /* @__PURE__ */ new Set();
@@ -9998,13 +11255,13 @@ async function recoverAgent(agentId, opts = {}) {
9998
11255
  ...kimiProviderEnv
9999
11256
  } }));
10000
11257
  if (kimiExistingSessionsBefore) {
10001
- const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cdkk9vRU.js");
11258
+ const { waitForNewKimiSessionAsync, writeKimiSessionId } = await import("./kimi-code-Cx5YUJpS.js");
10002
11259
  const sessionId = await waitForNewKimiSessionAsync(join$1(homedir(), ".kimi-code"), state.workspace, kimiExistingSessionsBefore);
10003
11260
  if (sessionId) writeKimiSessionId(normalizedId, sessionId);
10004
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`);
10005
11262
  }
10006
11263
  };
10007
- const { withKimiSessionCaptureLock } = await import("./kimi-code-Cdkk9vRU.js");
11264
+ const { withKimiSessionCaptureLock } = await import("./kimi-code-Cx5YUJpS.js");
10008
11265
  try {
10009
11266
  await withKimiSessionCaptureLock(join$1(homedir(), ".kimi-code"), state.workspace, launchAndCaptureKimiSession);
10010
11267
  } catch (err) {
@@ -10030,7 +11287,7 @@ async function recoverAgent(agentId, opts = {}) {
10030
11287
  workingDir: state.workspace,
10031
11288
  changeDir: false,
10032
11289
  setTerminalEnv: true,
10033
- providerExports: (await getProviderExportsForModel(state.model)).trimEnd(),
11290
+ providerExports: (await getProviderExportsForModel(state.model, recoveryHarness)).trimEnd(),
10034
11291
  extraEnvExports: [harnessLaunch.pathExport],
10035
11292
  baseCommand: await getRoleRuntimeBaseCommand(state.model, normalizedId, recoveryRole, recoveryHarness),
10036
11293
  appendSystemPromptFiles: await claudeSystemPromptFiles(state.workspace, recoveryHarness),
@@ -10117,6 +11374,7 @@ async function autoRecoverAgents() {
10117
11374
  };
10118
11375
  }
10119
11376
  var init_recovery = __esmMin((() => {
11377
+ init_muse_session();
10120
11378
  init_child_env();
10121
11379
  init_activity();
10122
11380
  init_graceful_restart();
@@ -11928,6 +13186,6 @@ var init_agent_state = __esmMin((() => {
11928
13186
  };
11929
13187
  }));
11930
13188
  //#endregion
11931
- 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 };
11932
13190
 
11933
- //# sourceMappingURL=agent-state-BnyNoDWQ.js.map
13191
+ //# sourceMappingURL=agent-state-Ci6PhjOE.js.map