@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.
- package/package.json +1 -1
- package/server/{acceptance-criteria-DFyrgxW5.js → acceptance-criteria-D-OIjvuX.js} +2 -2
- package/server/{active-dashboard-bundle-DbfgP8TS.js → active-dashboard-bundle-C-Ars7eG.js} +2 -2
- package/server/{activity-logger-DtdKxzPh.js → activity-logger-BRASNITk.js} +1 -1
- package/server/{activity-logger-ru8ggv-d.js → activity-logger-DNYDzAOU.js} +3 -3
- package/server/{advancing-selfheal-BdZ1iFJf.js → advancing-selfheal-Bq8V0QUa.js} +5 -5
- package/server/{agent-gc-DBMg1vIc.js → agent-gc-Coz8zQt_.js} +10 -10
- package/server/{agent-idle-CQlwmcRR.js → agent-idle-CAwB-K6M.js} +182 -30
- package/server/{agent-state-B0v3fvGI.js → agent-state-CbUEwUEQ.js} +1 -1
- package/server/{agent-state-BnyNoDWQ.js → agent-state-Ci6PhjOE.js} +1503 -245
- package/server/{agent-state-service-D95wBjA3.js → agent-state-service-D6IVrX3B.js} +5 -5
- package/server/{agent-state-service-GK2Uy8zc.js → agent-state-service-DcN1j6eK.js} +1 -1
- package/server/agents-BVvL4o_4.js +3 -0
- package/server/{agents-DMs1aLRU.js → agents-CkngXhQr.js} +4 -4
- package/server/archive-planning-CohTB7hg.js +2 -0
- package/server/{archive-planning-CFf5FVHQ.js → archive-planning-CtdBSD1-.js} +5 -5
- package/server/{artifact-index-jobs-BdeB5RIY.js → artifact-index-jobs-9ZdXQ9zH.js} +2 -2
- package/server/{auto-spawn-consent-C1avLtkk.js → auto-spawn-consent-CJeQM5e0.js} +281 -77
- package/server/{backlog-auto-trigger-oKIGNBzZ.js → backlog-auto-trigger-BuSBqG2V.js} +3 -3
- package/server/{behavior-CPX0E2Fj.js → behavior-Bg3yC8jC.js} +48 -35
- package/server/{bridge-pool-patrol-DstxbANA.js → bridge-pool-patrol-CkJ86c_r.js} +2 -2
- package/server/{briefing-freshness-FF0WLPMc.js → briefing-freshness-CEoe3yWS.js} +2 -2
- package/server/build-info-CYlxvZSQ.js +2 -0
- package/server/{build-info-DiA6h4T6.js → build-info-Cj3Y0K87.js} +3 -3
- package/server/{checkpoint-manager-CkXA-F6Z.js → checkpoint-manager-Bt4dnyyr.js} +2 -2
- package/server/{checkpoint-manager-D74ueYZp.js → checkpoint-manager-C1-9CFcu.js} +1 -1
- package/server/checkpoint-worker.js +1 -1
- package/server/{checkpoints-Ds83fUb1.js → checkpoints-3pyv5ikj.js} +2 -2
- package/server/{checkpoints-JIKy0UFv.js → checkpoints-Dgtp8549.js} +1 -1
- package/server/{claude-hooks-provision-D7Z8kANm.js → claude-hooks-provision-DWrqkc3x.js} +2 -2
- package/server/{claude-hooks-provision-BJ8LNIAe.js → claude-hooks-provision-DXac_UDF.js} +1 -1
- package/server/{claude-permissions-Bn53HCXr.js → claude-permissions-DX5BSnMH.js} +2 -2
- package/server/{claude-settings-overlay-QByq1SQa.js → claude-settings-overlay-ALboy05V.js} +1 -1
- package/server/{claude-settings-overlay-CqJZjFqv.js → claude-settings-overlay-CTkJUUHw.js} +2 -2
- package/server/{cli-BXmAb7vN.js → cli-DIhQieif.js} +11 -11
- package/server/cli-ZAS502uC.js +2 -0
- package/server/{cliproxy-ltFu5xfR.js → cliproxy-Dz_zq_4H.js} +1 -1
- package/server/{cliproxy-L_2OxNJf.js → cliproxy-QTm2vdgx.js} +2 -2
- package/server/{close-issue-BZAf0Ii-.js → close-issue-CRlmrE5g.js} +5 -5
- package/server/{closed-issue-reaper-DVtyOI4C.js → closed-issue-reaper-DWlw2EtL.js} +1 -1
- package/server/{closed-issue-reaper-BJa8SbvQ.js → closed-issue-reaper-DrHyYgJR.js} +13 -13
- package/server/{codex-BqLZKVNm.js → codex-DzLXjzbf.js} +1 -1
- package/server/{codex-DSs-3aOm.js → codex-pffr8qaN.js} +25 -18
- package/server/{compaction-continuation-TG0HYkOq.js → compaction-continuation-DhYgsXmF.js} +3 -3
- package/server/{config-DP0VV7rX.js → config-B-MLcKSo.js} +2 -2
- package/server/{config-Cx3N6gWz.js → config-BUjU7GZQ.js} +2 -2
- package/server/{config-DURnId0k.js → config-DN8ETZvK.js} +1 -1
- package/server/{config-yaml-OoH-ZpTb.js → config-yaml-Dce9VUd6.js} +416 -71
- package/server/{conflict-gate-SgOELW84.js → conflict-gate-Bt-lLgYf.js} +4 -4
- package/server/{conflict-gate-pMfhBEVB.js → conflict-gate-vczgdVTa.js} +1 -1
- package/server/{continue-Cmzd6leL.js → continue-DvNIJ-73.js} +2 -2
- package/server/{control-settings-Bdud_B1j.js → control-settings-BkaVFRdm.js} +5 -5
- package/server/{conversation-compaction-dFx_2wpa.js → conversation-compaction-CsdCbcQB.js} +8 -8
- package/server/{conversation-compaction-BX9UR8nl.js → conversation-compaction-D0zgWM1f.js} +1 -1
- package/server/{conversation-service-zgLM2g2D.js → conversation-service-6LaymUV-.js} +216 -78
- package/server/conversation-service-Dlks_hSS.js +3 -0
- package/server/conversations-BunNL58s.js +3 -0
- package/server/{conversations-JyrMSeOh.js → conversations-CPXMv_JQ.js} +11 -9
- package/server/{scanner-BEAzmMNs.js → conversations-search-DnWUghbM.js} +397 -48
- package/server/{cost-DR57uJFP.js → cost-PJXEAirJ.js} +8 -8
- package/server/{cost-CxXv7ei-.js → cost-ShD-G0cS.js} +44 -2
- package/server/{cost-MZ7EZFDc.js → cost-eaAmJTX9.js} +3 -3
- package/server/{cost-sync-Bq_dyq9k.js → cost-sync-EFEkMYWz.js} +26 -56
- package/server/{dag-CKUsr8wB.js → dag-Drz6Nrnf.js} +2 -2
- package/server/dashboard-db-worker.js +52 -10
- package/server/{deacon-C7qZxRuW.js → deacon-CU47dU7U.js} +169 -131
- package/server/{deacon-BUOpTnmQ.js → deacon-DYsOa_ss.js} +3 -3
- package/server/{deacon-canonical-state-hcaZgjoT.js → deacon-canonical-state-wi63RApC.js} +3 -3
- package/server/{deacon-event-client-Coiopt4u.js → deacon-event-client-DY8U1EbU.js} +2 -2
- package/server/{deacon-event-client-DJ71Tifg.js → deacon-event-client-uaGapjPL.js} +1 -1
- package/server/{deacon-nudge-log-pcliw8Dr.js → deacon-nudge-log-ZirGPRn1.js} +1 -1
- package/server/{deacon-pending-lifecycle-Dv0-8bZG.js → deacon-pending-lifecycle-ijGX8wLb.js} +2 -2
- package/server/deacon.js +11 -11
- package/server/{dead-end-trip-DH_hA7yS.js → dead-end-trip-B-zvz8Rw.js} +3 -3
- package/server/dead-end-trip-Caz9bf1A.js +2 -0
- package/server/delivery-DMYxIE0J.js +3 -0
- package/server/{deploy-patrol-Cv96N0s6.js → deploy-patrol-C4eXco1S.js} +8 -8
- package/server/deploy-queue-C3KIJizG.js +2 -0
- package/server/{deploy-queue-EcksuKE2.js → deploy-queue-TDZ2tzRF.js} +2 -2
- package/server/{deploy-window-BXbzS0zN.js → deploy-window-CdInEAuR.js} +4 -4
- package/server/{deploy-window-CHgL_TTN.js → deploy-window-DkjV-Haz.js} +1 -1
- package/server/{dev-supervisor-lNaYB136.js → dev-supervisor-CrYlJS2n.js} +2 -2
- package/server/{devcontainer-renderer-q8q9aXRd.js → devcontainer-renderer-DL8lfn0Y.js} +4 -4
- package/server/{docker-BNd0tMdS.js → docker-DLIwccCS.js} +1 -1
- package/server/{docker-Dk-shfga.js → docker-fz7ELYZ8.js} +3 -3
- package/server/{dod-BAk5arLF.js → dod-C9m0JqhG.js} +1 -1
- package/server/{done-preflight-CukR3Br8.js → done-preflight-CaILZ394.js} +5 -5
- package/server/{done-preflight-AiXnYYAy.js → done-preflight-DAufsWqY.js} +1 -1
- package/server/{durable-review-pipeline-Djx_lvFd.js → durable-review-pipeline-CIkgDTla.js} +1 -1
- package/server/{durable-review-pipeline-BOEZ0chh.js → durable-review-pipeline-CYcUvz1_.js} +1 -1
- package/server/{ensure-devcontainer-YXncXZ5Q.js → ensure-devcontainer-C2rKQXgr.js} +4 -4
- package/server/{ensure-devcontainer-BjMV_gdX.js → ensure-devcontainer-IQ_dNjjV.js} +1 -1
- package/server/{esm-shims-deFq5Hhl.js → esm-shims-CVzRn1Sa.js} +1 -1
- package/server/{event-store-DbjldlXW.js → event-store-BYOh686E.js} +5 -5
- package/server/{event-store-CFnLP8w-.js → event-store-Bw3YDOZ5.js} +1 -1
- package/server/{event-store-provider-Bu1Qrg6v.js → event-store-provider-B2PMoaap.js} +1 -1
- package/server/{events-Bb2x5ijT.js → events-BCPdiWG9.js} +3 -3
- package/server/{factory-DfIQG-qW.js → factory-BC18rvHD.js} +4 -4
- package/server/{feature-registry-storage-BzAGS4DA.js → feature-registry-storage-CASMzD0N.js} +2 -2
- package/server/{features-KxOILHX8.js → features-B1O5F33h.js} +2 -2
- package/server/{feedback-stuck-retirement-BqTHm-1Z.js → feedback-stuck-retirement-Dd5XNrMr.js} +2 -2
- package/server/{feedback-target-BjLidX0M.js → feedback-target-BcsA_GRV.js} +10 -10
- package/server/{feedback-target-D2CIZFwc.js → feedback-target-BzdJ2wIR.js} +1 -1
- package/server/{feedback-writer-BrSQ4fC-.js → feedback-writer-DfMoEtQc.js} +1 -1
- package/server/{feedback-writer-Dgrma-L1.js → feedback-writer-lbXBFycU.js} +5 -5
- package/server/{flywheel-Ds0eOd1P.js → flywheel-B34cdfbd.js} +1 -1
- package/server/{flywheel-X6kvGnf2.js → flywheel-D0guNqkh.js} +14 -14
- package/server/{flywheel-D5FchYg4.js → flywheel-Is3w2lcT.js} +16 -16
- package/server/{flywheel-merge-order-PTHnouQS.js → flywheel-merge-order-6HiPR2WG.js} +1 -1
- package/server/{flywheel-merge-order-BTY73Efv.js → flywheel-merge-order-BsNPMu0S.js} +8 -8
- package/server/forge-B1cpL4SY.js +2 -0
- package/server/{forge-B08cRXEb.js → forge-CEe3eFjh.js} +2 -2
- package/server/{fs-lock-DfiYlr5u.js → fs-lock-VCGoXZI5.js} +2 -2
- package/server/{fts-operations-Do1SP0w4.js → fts-operations-BNRxGCU_.js} +2 -2
- package/server/{git-info-DMOSfJ9I.js → git-info-BZYdINlU.js} +1 -1
- package/server/{git-utils-DfpFkvwk.js → git-utils-D96xW28f.js} +4 -4
- package/server/{git-utils-fcK3ZRNj.js → git-utils-DvcWLgGS.js} +1 -1
- package/server/{github-app-Co8ZhyUJ.js → github-app-BINlfWAA.js} +3 -2
- package/server/{github-app-HAqQZZRD.js → github-app-BxM1U38q.js} +1 -1
- package/server/{github-client-wqbDCmlL.js → github-client-DJVl4iDm.js} +3 -3
- package/server/{github-client-C7MUxFzX.js → github-client-oJHo9dyA.js} +1 -1
- package/server/{github-pr-lookup-DdLCDdu9.js → github-pr-lookup-DQEtdiyR.js} +2 -2
- package/server/{harness-binary-BuakhXkB.js → harness-binary-DnRGvN6T.js} +6 -3
- package/server/{harness-resolve-CISjc9FR.js → harness-resolve-CzTFVZ5l.js} +4 -4
- package/server/{health-events-CIE7gy34.js → health-events-CF2WMNkI.js} +2 -2
- package/server/{health-events-9RhRGZK1.js → health-events-Dv7rzyit.js} +1 -1
- package/server/{hooks-CmL3TXla.js → hooks-DKzqJ4HF.js} +1 -1
- package/server/{hooks-D55VTdQS.js → hooks-lPAsUc20.js} +2 -2
- package/server/hume-51rYfjzX.js +3 -0
- package/server/{hume-1FJmNDTq.js → hume-CxfI2cg-.js} +2 -2
- package/server/{identity-CZbJ0xpl.js → identity-Dc7rQLln.js} +3 -3
- package/server/{idle-stack-reaper-CjovDCet.js → idle-stack-reaper-C0NYGCVq.js} +4 -4
- package/server/{idle-stack-reaper-DhbFdkWv.js → idle-stack-reaper-CNLvCrg9.js} +1 -1
- package/server/{in-flight-guard-B7khcBdQ.js → in-flight-guard-HoToxzGt.js} +1 -1
- package/server/{infra-BbSWNOpH.js → infra-B05o-e2g.js} +4 -4
- package/server/{injection-DsQDBSEi.js → injection-Bk_pw2Ei.js} +1 -1
- package/server/{injection-BSnn_10a.js → injection-DkaIMCnX.js} +8 -8
- package/server/{inspect-agent-DS8j2v6U.js → inspect-agent-CP7Bu47O.js} +14 -12
- package/server/inspect-agent-DTuSg95i.js +2 -0
- package/server/{internal-token-CkrMLCLU.js → internal-token-CWcdG-Kw.js} +1 -1
- package/server/{internal-token-CUKcTWSG.js → internal-token-Ci0LxMIq.js} +2 -2
- package/server/{io-BgzG56av.js → io-Cm4Sf_6P.js} +4 -4
- package/server/{issue-closed-DZEwD3ol.js → issue-closed-D7aMUeMq.js} +7 -7
- package/server/{issue-lifecycle-LgYeE1o2.js → issue-lifecycle-BPbczKyy.js} +32 -30
- package/server/{issue-lifecycle-Bnfbpkmk.js → issue-lifecycle-FaugTi39.js} +1 -1
- package/server/{issue-service-singleton-Bsb0GaY8.js → issue-service-singleton-BrZQJLRI.js} +11 -11
- package/server/{issue-service-singleton-COEqWNKE.js → issue-service-singleton-Dsad9NTt.js} +1 -1
- package/server/{issue-title-fallback-D4_b2XwP.js → issue-title-fallback-BDxHa3-u.js} +3 -3
- package/server/{issues-DYAEUW45.js → issues-Q62MKOV_.js} +2 -2
- package/server/{jsonl-parser-1IqHI9Yb.js → jsonl-parser-DSJisyfy.js} +5 -4
- package/server/{jsonl-resolver-BJ8Hg-yD.js → jsonl-resolver-DQEe0DHM.js} +12 -9
- package/server/kimi-code-Cx5YUJpS.js +3 -0
- package/server/{kimi-parser-DFsZQArz.js → kimi-parser-5VpMzIDq.js} +2 -2
- package/server/{label-cleanup-Bej6xDZK.js → label-cleanup-DjQGmcZQ.js} +3 -3
- package/server/{lifecycle-BibLMHBH.js → lifecycle-BSQIQ1Sq.js} +2 -2
- package/server/{lifecycle-CMpSB9sn.js → lifecycle-DZFHmpGI.js} +6 -6
- package/server/{lifecycle-io-CLWwYZaR.js → lifecycle-io-Bv4XQMRi.js} +1 -1
- package/server/{lifecycle-io-CCCAMefe.js → lifecycle-io-CW__VX8s.js} +5 -5
- package/server/{linear-client-BtYl16Cy.js → linear-client-DnX3CcAL.js} +1 -1
- package/server/{linear-client-fpL-qJEa.js → linear-client-DrRZ3We7.js} +4 -7
- package/server/{linear-mcp-auth-nAYWoUbH.js → linear-mcp-auth-BFlpMvWh.js} +5 -5
- package/server/{linear-mcp-auth-CQ7ROT1X.js → linear-mcp-auth-DylPJABZ.js} +1 -1
- package/server/memory-fts-worker.js +1 -1
- package/server/{memory-governor-Mi5zF5zw.js → memory-governor-B7uDWRo9.js} +29 -22
- package/server/{merge-_XIivhkq.js → merge-BGozpxFt.js} +3 -3
- package/server/{merge-DCuDLiy9.js → merge-CphMVME2.js} +1 -1
- package/server/{merge-agent-svBDRWB6.js → merge-agent-ddEcZDZD.js} +2 -2
- package/server/{merge-agent-zF9vqWqY.js → merge-agent-ttRY053V.js} +32 -32
- package/server/{merge-batch-BJjzUUL7.js → merge-batch-CBQ2YYuy.js} +1 -1
- package/server/{merge-completeness-CeQheehh.js → merge-completeness-CsSvQJxw.js} +1 -1
- package/server/{merge-completeness-CQPqu-pI.js → merge-completeness-YQbhKLPk.js} +4 -4
- package/server/{merge-eligibility-CJrBhQQe.js → merge-eligibility-BGqmx_bG.js} +1 -1
- package/server/{merge-eligibility-DhxVE8qU.js → merge-eligibility-CvQBc_9D.js} +4 -4
- package/server/merge-ops-Bgc-EScO.js +2 -0
- package/server/{merge-rebase-Bjo45m3k.js → merge-rebase-BbLnMyfQ.js} +2 -2
- package/server/merge-rebase-BgYoyMul.js +2 -0
- package/server/{merge-set-COZvz2nx.js → merge-set-DRPWriK9.js} +4 -4
- package/server/{merge-set-ChxZgjBB.js → merge-set-DaU9Ruxy.js} +1 -1
- package/server/{merge-sync-DuJ6Vkl3.js → merge-sync-BRKJM70R.js} +1 -1
- package/server/{merge-sync-CCi1Esdx.js → merge-sync-CTGkR1_m.js} +2 -2
- package/server/{merge-train-deps-C0P0qGKe.js → merge-train-deps-GPlHOjK6.js} +4 -4
- package/server/{merge-train-DTJXF8ph.js → merge-train-f_un38UJ.js} +4 -4
- package/server/{merge-verification-C5FexOBZ.js → merge-verification-BPBW3Hu3.js} +6 -6
- package/server/{merged-docker-cleanup-worker-0SEDG3Ao.js → merged-docker-cleanup-worker-By0YSsIP.js} +1 -1
- package/server/{merged-docker-cleanup-worker-C-kSp_jw.js → merged-docker-cleanup-worker-zMzGriKp.js} +3 -3
- package/server/messaging-BasbftDu.js +3 -0
- package/server/muse-parser-CFchR2vh.js +89 -0
- package/server/muse-session-CrSRuauJ.js +56 -0
- package/server/{no-resume-mode-DjMQRkId.js → no-resume-mode-BsvYzqbB.js} +1 -1
- package/server/node_modules/.package-lock.json +8 -8
- package/server/node_modules/@types/node/README.md +3 -3
- package/server/node_modules/@types/node/assert/strict.d.ts +56 -13
- package/server/node_modules/@types/node/assert.d.ts +190 -189
- package/server/node_modules/@types/node/async_hooks.d.ts +43 -151
- package/server/node_modules/@types/node/buffer.buffer.d.ts +13 -12
- package/server/node_modules/@types/node/buffer.d.ts +237 -103
- package/server/node_modules/@types/node/child_process.d.ts +154 -39
- package/server/node_modules/@types/node/cluster.d.ts +384 -238
- package/server/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/server/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/server/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/server/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/server/node_modules/@types/node/console.d.ts +404 -45
- package/server/node_modules/@types/node/constants.d.ts +10 -3
- package/server/node_modules/@types/node/crypto.d.ts +1600 -1007
- package/server/node_modules/@types/node/dgram.d.ts +81 -133
- package/server/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
- package/server/node_modules/@types/node/dns/promises.d.ts +15 -9
- package/server/node_modules/@types/node/dns.d.ts +183 -136
- package/server/node_modules/@types/node/domain.d.ts +32 -12
- package/server/node_modules/@types/node/events.d.ts +696 -728
- package/server/node_modules/@types/node/fs/promises.d.ts +85 -256
- package/server/node_modules/@types/node/fs.d.ts +525 -865
- package/server/node_modules/@types/node/globals.d.ts +34 -12
- package/server/node_modules/@types/node/globals.typedarray.d.ts +0 -63
- package/server/node_modules/@types/node/http.d.ts +312 -433
- package/server/node_modules/@types/node/http2.d.ts +891 -545
- package/server/node_modules/@types/node/https.d.ts +243 -64
- package/server/node_modules/@types/node/index.d.ts +7 -25
- package/server/node_modules/@types/node/inspector.d.ts +58 -70
- package/server/node_modules/@types/node/inspector.generated.d.ts +411 -765
- package/server/node_modules/@types/node/module.d.ts +219 -54
- package/server/node_modules/@types/node/net.d.ts +222 -208
- package/server/node_modules/@types/node/os.d.ts +49 -41
- package/server/node_modules/@types/node/package.json +3 -13
- package/server/node_modules/@types/node/path.d.ts +141 -119
- package/server/node_modules/@types/node/perf_hooks.d.ts +690 -339
- package/server/node_modules/@types/node/process.d.ts +205 -389
- package/server/node_modules/@types/node/punycode.d.ts +31 -3
- package/server/node_modules/@types/node/querystring.d.ts +16 -3
- package/server/node_modules/@types/node/readline/promises.d.ts +6 -3
- package/server/node_modules/@types/node/readline.d.ts +152 -66
- package/server/node_modules/@types/node/repl.d.ts +109 -101
- package/server/node_modules/@types/node/sea.d.ts +116 -1
- package/server/node_modules/@types/node/sqlite.d.ts +68 -486
- package/server/node_modules/@types/node/stream/consumers.d.ts +15 -91
- package/server/node_modules/@types/node/stream/promises.d.ts +15 -136
- package/server/node_modules/@types/node/stream/web.d.ts +454 -197
- package/server/node_modules/@types/node/stream.d.ts +491 -603
- package/server/node_modules/@types/node/string_decoder.d.ts +43 -3
- package/server/node_modules/@types/node/test.d.ts +292 -513
- package/server/node_modules/@types/node/timers/promises.d.ts +18 -3
- package/server/node_modules/@types/node/timers.d.ts +141 -3
- package/server/node_modules/@types/node/tls.d.ts +257 -166
- package/server/node_modules/@types/node/trace_events.d.ts +97 -3
- package/server/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
- package/server/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
- package/server/node_modules/@types/node/ts5.6/index.d.ts +6 -26
- package/server/node_modules/@types/node/tty.d.ts +43 -61
- package/server/node_modules/@types/node/url.d.ts +584 -156
- package/server/node_modules/@types/node/util.d.ts +1110 -181
- package/server/node_modules/@types/node/v8.d.ts +36 -175
- package/server/node_modules/@types/node/vm.d.ts +209 -292
- package/server/node_modules/@types/node/wasi.d.ts +74 -24
- package/server/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
- package/server/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
- package/server/node_modules/@types/node/web-globals/events.d.ts +0 -9
- package/server/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
- package/server/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
- package/server/node_modules/@types/node/web-globals/streams.d.ts +0 -93
- package/server/node_modules/@types/node/worker_threads.d.ts +407 -257
- package/server/node_modules/@types/node/zlib.d.ts +165 -24
- package/server/node_modules/undici-types/agent.d.ts +13 -12
- package/server/node_modules/undici-types/api.d.ts +26 -26
- package/server/node_modules/undici-types/balanced-pool.d.ts +12 -13
- package/server/node_modules/undici-types/client.d.ts +37 -63
- package/server/node_modules/undici-types/connector.d.ts +2 -5
- package/server/node_modules/undici-types/cookies.d.ts +1 -3
- package/server/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
- package/server/node_modules/undici-types/dispatcher.d.ts +139 -136
- package/server/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
- package/server/node_modules/undici-types/errors.d.ts +54 -92
- package/server/node_modules/undici-types/eventsource.d.ts +4 -9
- package/server/node_modules/undici-types/fetch.d.ts +25 -51
- package/server/node_modules/undici-types/file.d.ts +39 -0
- package/server/node_modules/undici-types/filereader.d.ts +54 -0
- package/server/node_modules/undici-types/formdata.d.ts +7 -7
- package/server/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/server/node_modules/undici-types/global-origin.d.ts +5 -5
- package/server/node_modules/undici-types/handlers.d.ts +9 -10
- package/server/node_modules/undici-types/header.d.ts +1 -162
- package/server/node_modules/undici-types/index.d.ts +47 -69
- package/server/node_modules/undici-types/interceptors.d.ts +9 -72
- package/server/node_modules/undici-types/mock-agent.d.ts +18 -36
- package/server/node_modules/undici-types/mock-client.d.ts +4 -6
- package/server/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/server/node_modules/undici-types/mock-interceptor.d.ts +21 -26
- package/server/node_modules/undici-types/mock-pool.d.ts +4 -6
- package/server/node_modules/undici-types/package.json +1 -1
- package/server/node_modules/undici-types/patch.d.ts +4 -0
- package/server/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/server/node_modules/undici-types/pool.d.ts +14 -14
- package/server/node_modules/undici-types/proxy-agent.d.ts +6 -14
- package/server/node_modules/undici-types/readable.d.ts +16 -19
- package/server/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/server/node_modules/undici-types/retry-handler.d.ts +10 -19
- package/server/node_modules/undici-types/util.d.ts +3 -3
- package/server/node_modules/undici-types/webidl.d.ts +30 -148
- package/server/node_modules/undici-types/websocket.d.ts +10 -48
- package/server/{orphan-proposed-reconciler-BSsKWmsB.js → orphan-proposed-reconciler-DFHdQSEg.js} +21 -21
- package/server/{orphan-proposed-reconciler--V8GIzmY.js → orphan-proposed-reconciler-DzAxrM99.js} +2 -2
- package/server/package-lock.json +9 -9
- package/server/package.json +1 -1
- package/server/{pan-dir-COaYhZel.js → pan-dir-Bs9fme2I.js} +4 -4
- package/server/{parked-residue-Dvr4W9P6.js → parked-residue-DMtbxJml.js} +31 -31
- package/server/{paths-Cm1Q7Old.js → paths-eTg2jV4C.js} +2 -2
- package/server/{pickup-Dle6k9Xt.js → pickup-TwHZNJn4.js} +1 -1
- package/server/{pipeline-agent-reader-DCCwbUj8.js → pipeline-agent-reader-CHugmNSx.js} +3 -3
- package/server/{pipeline-membership-C9ykcjsn.js → pipeline-membership-BvkkuVml.js} +1 -1
- package/server/{pipeline-membership-BV4hdkHm.js → pipeline-membership-DxJOJOjn.js} +1 -1
- package/server/{pipeline-membership-gather-UN7kHpCD.js → pipeline-membership-gather-QYMqf_Wf.js} +10 -10
- package/server/{pipeline-membership-gather-DGoDOfKO.js → pipeline-membership-gather-fivITe13.js} +1 -1
- package/server/{pipeline-notifier-DsCfxoSU.js → pipeline-notifier-DUxiacft.js} +1 -1
- package/server/{pipeline-notifier-DfH2i_zP.js → pipeline-notifier-vZqcB2Ts.js} +2 -2
- package/server/{post-merge-lifecycle-worker-V51p8tSm.js → post-merge-lifecycle-worker-jzN2g_EY.js} +2 -2
- package/server/{post-merge-state-Cym5NVlB.js → post-merge-state-DGlkiVIO.js} +4 -4
- package/server/{prd-locations-CPuMD55x.js → prd-locations-Chcvxzle.js} +3 -3
- package/server/{project-pipelines-DdDKdXrG.js → project-pipelines-BXB5FlFs.js} +2 -2
- package/server/{project-repos-CNrLxJDg.js → project-repos-BVSXziAz.js} +1 -1
- package/server/{project-repos-DqAT7YV6.js → project-repos-J6jc42uD.js} +2 -2
- package/server/{project-resource-refresh-queue-Dh8k2SB7.js → project-resource-refresh-queue-DebwjPPA.js} +17 -17
- package/server/{project-resource-refresh-queue-C-umDazS.js → project-resource-refresh-queue-cqOeJ0fB.js} +1 -1
- package/server/{projects-Crur9uCa.js → projects-DXgHD2Xl.js} +1 -1
- package/server/{prompts-CvtVJUpG.js → prompts-BJ8Twvtl.js} +2 -2
- package/server/{providers-Bun8zer5.js → providers-Bx-PKo3d.js} +1 -1
- package/server/{providers-1BlEh5x1.js → providers-DQogCKG0.js} +7 -7
- package/server/public/assets/{chunk-BO2N2NFS-DzUNVdeo.js → chunk-BO2N2NFS-CefmGH8f.js} +4 -4
- package/server/public/assets/{chunk-K2UTITRG-CopEAH22.js → chunk-K2UTITRG-DS0TExnd.js} +2 -2
- package/server/public/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/server/public/assets/{diagram-OG6HWLK6-D5iThVwA.js → diagram-OG6HWLK6-DYPEQqOy.js} +1 -1
- package/server/public/assets/{dist-RyrOs5EF.js → dist-D0_QiSJD.js} +1 -1
- package/server/public/assets/{dist-BLq-IR2D.js → dist-DVcb72hI.js} +3 -3
- package/server/public/assets/editor.worker-Bd9IXS8d.js +26 -0
- package/server/public/assets/{ganttDiagram-6RSMTGT7-n8bUPXAS.js → ganttDiagram-6RSMTGT7-C0TVczXo.js} +1 -1
- package/server/public/assets/{highlighted-body-OFNGDK62-1npo3yiG.js → highlighted-body-OFNGDK62-DqOVJX4H.js} +1 -1
- package/server/public/assets/image-GAAHSSAO-DQ2ivYhs.js +1 -0
- package/server/public/assets/index-CFZuwq0-.css +1 -0
- package/server/public/assets/index-CWCooHwg.js +1732 -0
- package/server/public/assets/{linear-Dd96gky1.js → linear-45MX5LeL.js} +1 -1
- package/server/public/assets/markdown-Budfoo9I.js +1 -0
- package/server/public/assets/mermaid-GHXKKRXX-71HgceZK.js +1 -0
- package/server/public/assets/{pieDiagram-4H26LBE5-CynZvpYP.js → pieDiagram-4H26LBE5-BSyYJciD.js} +1 -1
- package/server/public/assets/{prod-DBuCX9g-.js → prod-CcWF3Ag1.js} +5 -5
- package/server/public/assets/{quadrantDiagram-W4KKPZXB-BNlEKLKN.js → quadrantDiagram-W4KKPZXB-DyPGNivi.js} +1 -1
- package/server/public/assets/{sankeyDiagram-5OEKKPKP-Cq0AMnkD.js → sankeyDiagram-5OEKKPKP-CdiSWvwI.js} +1 -1
- package/server/public/assets/{xychartDiagram-2RQKCTM6-D7GXcBy2.js → xychartDiagram-2RQKCTM6-BZeywmN2.js} +1 -1
- package/server/public/index.html +2 -2
- package/server/pull-requests-DLiyKC8q.js +2 -0
- package/server/{pull-requests-DrhWU9MW.js → pull-requests-EBvcAtZO.js} +3 -3
- package/server/{rally-api-CNlcoTFM.js → rally-api-2KW2hJUT.js} +2 -2
- package/server/{rally-api-BdNfpNGk.js → rally-api-BtWOXNna.js} +1 -1
- package/server/{rally-client-C3eB9TM-.js → rally-client-CAQtSqJJ.js} +5 -5
- package/server/{rally-client-BCU7mVWE.js → rally-client-DK8Ac35q.js} +1 -1
- package/server/{rally-D5QkIZeb.js → rally-k5qOLHHK.js} +3 -3
- package/server/rally-vmQx9f0C.js +3 -0
- package/server/{rebuild-stack-BupKggo5.js → rebuild-stack-DSQSgPCI.js} +2 -2
- package/server/rebuild-stack-xdGFthJn.js +370 -0
- package/server/{reconciler-ComAOr_F.js → reconciler-xH7d13Wo.js} +6 -6
- package/server/{reconstruct-cache-DbjgwKRi.js → reconstruct-cache-Bb2Jg2DZ.js} +7 -7
- package/server/{record-C4JJCL2f.js → record-Dsceq536.js} +1 -1
- package/server/{record-update-CWwZsp9Y.js → record-update-CLtgirnZ.js} +1 -1
- package/server/{record-update-Cl56NqoQ.js → record-update-T3PMrwE-.js} +4 -4
- package/server/{recovery-trip-DA7tCXbp.js → recovery-trip-7JFHFjeo.js} +3 -3
- package/server/{recovery-trip-DFtSA8h5.js → recovery-trip-B7UdNXjP.js} +1 -1
- package/server/{release-engine-Dk99C48O.js → release-engine-78iCajIc.js} +5 -5
- package/server/{release-set-x8KH3nrE.js → release-set-B_sH_Mud.js} +3 -3
- package/server/{remote-DyZIg94K.js → remote-C9eYHTqn.js} +3 -3
- package/server/{remote-agents-MbWzm5Fh.js → remote-agents-CEOvYsvK.js} +1 -1
- package/server/{remote-agents-Blb0vO_M.js → remote-agents-CthcZHnO.js} +6 -6
- package/server/{remote-completion-Bcd13o-J.js → remote-completion-D5wzZCte.js} +12 -12
- package/server/{remote-BMZmJC5E.js → remote-gWXJyhJK.js} +3 -3
- package/server/{resolver-CZVWKCx0.js → resolver-BGZh3lXA.js} +7 -7
- package/server/{resolver-tJeEkPK5.js → resolver-ChLZFIjB.js} +2 -2
- package/server/{memory-pressure-patrol-CDeDh46A.js → resource-pressure-patrol-Bg23rPV-.js} +110 -9
- package/server/{resume-DmF2andq.js → resume-BKyB4hA1.js} +1 -1
- package/server/{review-agent-CmJeQc0K.js → review-agent-DHs-JngN.js} +52 -35
- package/server/{review-agent-DM9S22BL.js → review-agent-ZdP-HmwY.js} +2 -2
- package/server/{review-artifacts-DCiaejJK.js → review-artifacts-DExSp5Lh.js} +6 -6
- package/server/{review-convoy-liveness-C9F1Q1LN.js → review-convoy-liveness-BTMvU4CA.js} +8 -8
- package/server/{review-run-recovery-CRGBh7xs.js → review-run-recovery-BYalQzbh.js} +1 -1
- package/server/{review-run-recovery-C5TEICtx.js → review-run-recovery-BvVG3oUr.js} +2 -2
- package/server/{review-status-C3PJkfjv.js → review-status-BegAr86G.js} +33 -31
- package/server/{review-status-CDs0jQV6.js → review-status-DXTFzCmR.js} +1 -1
- package/server/{review-status-emit-De6PF3ZH.js → review-status-emit-C9YW6SQL.js} +3 -3
- package/server/{review-status-enrichment-CclcG8jk.js → review-status-enrichment-DRJKuIwU.js} +3 -3
- package/server/{review-status-sync-wvgdR1yZ.js → review-status-sync-CHt0oq_3.js} +2 -2
- package/server/{review-status-sync-B3GKewT_.js → review-status-sync-DEGnJMfG.js} +1 -1
- package/server/{review-verdict-feedback-DkMx_cKj.js → review-verdict-feedback-Dp139Lmv.js} +1 -1
- package/server/{review-verdict-feedback-20s9pG0w.js → review-verdict-feedback-qlVBi19-.js} +7 -7
- package/server/{review-verdict-writer-CaJPCD-q.js → review-verdict-writer-BVco3WoI.js} +1 -1
- package/server/{review-verdict-writer-BcG5RBWF.js → review-verdict-writer-CJr_Ob0Y.js} +7 -7
- package/server/{rollup-C-GXHbTG.js → rollup-H2NWuNhX.js} +8 -8
- package/server/{rollup-DR250WyW.js → rollup-iPhJvI-2.js} +1 -1
- package/server/{search-BN0MYpZW.js → search-BtgzCB2W.js} +2 -2
- package/server/{secret-redaction-DLZ-VqHq.js → secret-redaction-EqpTK7R6.js} +1 -1
- package/server/{sequence-io-BmVO0K-_.js → sequence-io-iljWlslY.js} +4 -4
- package/server/{sequencer-agent-CuA9PA_R.js → sequencer-agent-BGGVKxtw.js} +11 -6
- package/server/server.js +1526 -1240
- package/server/{service-D1SZCxH8.js → service-kzhN0DLg.js} +58 -58
- package/server/{session-fork--SMYFKVu.js → session-fork-B3hkpes1.js} +2 -2
- package/server/{settings-CETdzCl6.js → settings-BpM0Ergn.js} +3 -3
- package/server/settings-CW_lAaJv.js +2 -0
- package/server/{settings-CFi7CdJo.js → settings-aBz_GpBq.js} +9 -2
- package/server/{shadow-engineering-CNTXaC9O.js → shadow-engineering-C7kypoM-.js} +2 -2
- package/server/{shadow-state-6jSyeXQ7.js → shadow-state-Db5ExiBP.js} +1 -1
- package/server/{shadow-state-CtYJGNXt.js → shadow-state-IG8JSXgD.js} +2 -2
- package/server/{shadow-utils-Cq5eMfwI.js → shadow-utils-DSDsJXLD.js} +2 -2
- package/server/{ship-record-STA0P11l.js → ship-record-80n1CYp9.js} +6 -6
- package/server/{ship-record-neN0oUI9.js → ship-record-DN8voLiQ.js} +1 -1
- package/server/{ship-status-DzDpufmj.js → ship-status-CJvaa4QB.js} +2 -2
- package/server/{smart-compaction-tndAhwoc.js → smart-compaction-C96F2aFQ.js} +7 -7
- package/server/{smart-compaction-CdtKIcDk.js → smart-compaction-owKHJDbL.js} +1 -1
- package/server/{spawn-planning-session-1XLgDLjR.js → spawn-planning-session-CiJdOHTD.js} +2 -2
- package/server/{spawn-planning-session-CAncCBLX.js → spawn-planning-session-FmJa6PCS.js} +41 -50
- package/server/{specialist-context-B054OP_a.js → specialist-context-_ootmzn2.js} +5 -5
- package/server/{specialist-handoff-logger-B7jzypoX.js → specialist-handoff-logger-4QCjIBPO.js} +2 -2
- package/server/{specialist-logs-DVhOLpwy.js → specialist-logs-BbAX221-.js} +3 -3
- package/server/{specialists-CC_Mnc47.js → specialists-COZoYaiz.js} +266 -173
- package/server/{specialists-8Pc--yZI.js → specialists-D8sYZnPb.js} +2 -2
- package/server/{specialists-BVBIMc4L.js → specialists-DTAOVZpU.js} +1 -1
- package/server/{specialists-ChvCD2a-.js → specialists-RPLJnYc1.js} +19 -19
- package/server/{specialists-registry-Cim1fPcM.js → specialists-registry-CNbvfOcy.js} +2 -2
- package/server/{specialists-registry-CoPNlhud.js → specialists-registry-DqgQIxpu.js} +1 -1
- package/server/specs-ChqOBhAF.js +3 -0
- package/server/{src-C7gGe4KU.js → src-Cz63twgJ.js} +2 -2
- package/server/{src-CdwN6WY6.js → src-tnFSfiXX.js} +126 -18
- package/server/{stack-health-CvdnSVBV.js → stack-health-D0j1RhAj.js} +1 -1
- package/server/{stack-health-DPXaoAus.js → stack-health-Y8O3UuPe.js} +3 -3
- package/server/{stale-task-claims-UoNLemTn.js → stale-task-claims-Db6yxeFz.js} +5 -5
- package/server/{staleness-CxZaIhrn.js → staleness-CyM7ACHv.js} +1 -1
- package/server/{staleness-r_dkMyMG.js → staleness-akWxgpIu.js} +1 -1
- package/server/{stall-sweeper-C9S8FYKz.js → stall-sweeper-9bRBZhrQ.js} +8 -8
- package/server/{state-home-BhI8O5lU.js → state-home-CWu1dx9L.js} +2 -2
- package/server/{state-mapping-D2yC81Vy.js → state-mapping-CdvWOIhv.js} +1 -1
- package/server/{state-migrate-DtFHcOVZ.js → state-migrate-J3tFJnbd.js} +6 -6
- package/server/{state-mirror-CpuHFxHb.js → state-mirror-DQKpsskH.js} +3 -3
- package/server/{stuck-remediation-B4nKm7B2.js → stuck-remediation-4Rf_xMEb.js} +13 -13
- package/server/{stuck-remediation-hSOOYB9B.js → stuck-remediation-BvTK_NYN.js} +1 -1
- package/server/{substrate-bug-weights-service-B9f0063E.js → substrate-bug-weights-service-9nrkZcaP.js} +3 -3
- package/server/{summary-fork-CUyEqFyc.js → summary-fork-D-cylknJ.js} +51 -13
- package/server/{summary-fork-DZcsOvDD.js → summary-fork-PLcckTRE.js} +2 -2
- package/server/supervisor/{injection-budget-BOH-EiFB.js → injection-budget-DfPSjiS7.js} +1 -1
- package/server/supervisor/pty-supervisor.js +1 -1
- package/server/{supervisor-CGtOs9Em.js → supervisor-B2_uXxHQ.js} +4 -4
- package/server/supervisor-DSSr9_E4.js +2 -0
- package/server/{swarm-readiness-0N2p9d2C.js → swarm-readiness-BkVvnCdr.js} +3 -3
- package/server/{synthesis-verdict-CQdLbK1-.js → synthesis-verdict-BtJAwMS3.js} +2 -2
- package/server/{synthesis-verdict-CJdseCuz.js → synthesis-verdict-b1uY2m9Q.js} +1 -1
- package/server/{system-prerequisites-DkDOEjQP.js → system-prerequisites-zlmZiJzn.js} +14 -2
- package/server/{teardown-workspace-BxFMcWu7.js → teardown-workspace-CTL16rnG.js} +16 -16
- package/server/{test-agent-queue-Dxeae55k.js → test-agent-queue-CMgYZiR_.js} +6 -6
- package/server/{test-verdict-CJ-to_Hc.js → test-verdict-BaiFCApG.js} +1 -1
- package/server/{test-verdict-hW5kILg7.js → test-verdict-DhjFE4Go.js} +2 -2
- package/server/{tldr-daemon-DKCumqHU.js → tldr-daemon-CW1MhBkM.js} +1 -1
- package/server/{tldr-daemon-caxXegkF.js → tldr-daemon-CYr67NdC.js} +2 -2
- package/server/{tmux-C-hxv71f.js → tmux-aj9rscol.js} +2 -2
- package/server/{tmux-CvAEO9yo.js → tmux-l-yvNWhg.js} +2 -2
- package/server/{token-BdfZLRg1.js → token-BO7DAEyM.js} +2 -2
- package/server/{token-util-Crcay9j_.js → token-util-C_1EI72O.js} +1 -1
- package/server/token-util-msNwng7E.js +3 -0
- package/server/{tracker-config-BjqwtkcT.js → tracker-config-Qq_kEwYh.js} +2 -2
- package/server/{tracker-utils-0cDe6yil.js → tracker-utils-McMENyKj.js} +2 -2
- package/server/{traefik-connect-DoQvQ6oJ.js → traefik-connect-BZWNRHOd.js} +1 -1
- package/server/{tunnel-BEM7-jgE.js → tunnel-BElVxdZw.js} +1 -1
- package/server/{tunnel-SgALz_Pi.js → tunnel-D01HhYX5.js} +3 -3
- package/server/{typed-errors-CZ3GFBvo.js → typed-errors-CKb5wNaG.js} +1 -1
- package/server/{typed-errors-DXqf3RnP.js → typed-errors-uJ-V6edU.js} +1 -1
- package/server/{types-PW4zkxCM.js → types-JR7ZOtpL.js} +1 -1
- package/server/{uat-failure-feedback-BQzpUFQ6.js → uat-failure-feedback-DS6W9X3I.js} +5 -5
- package/server/{uat-promote-verification-BUltWC-b.js → uat-promote-verification-CRsIHE_q.js} +5 -5
- package/server/{uat-train-B71QG16n.js → uat-train-BoA9r6_I.js} +1 -1
- package/server/{uat-train-BLJ0AAIc.js → uat-train-Cd8CJeNe.js} +22 -22
- package/server/{validate-DqEp2Yb9.js → validate-BdmvTIym.js} +3 -3
- package/server/{validation-k4EpMHm0.js → validation-ApKDjkLH.js} +1 -1
- package/server/{validation-DHEsL3RP.js → validation-Dxdai-37.js} +14 -4
- package/server/{verification-artifact-DglwaHke.js → verification-artifact-DhIkPgrP.js} +1 -1
- package/server/{verification-artifact-Cmhgq4b_.js → verification-artifact-olosZdZU.js} +1 -1
- package/server/{verification-runner-Bbc-8BbR.js → verification-runner-BO0K3xNA.js} +1 -1
- package/server/{verification-runner-BC_zNOq5.js → verification-runner-fEY1Qj-l.js} +31 -23
- package/server/{work-agent-prompt-DM3uza0_.js → work-agent-prompt-BEpIuqw1.js} +10 -10
- package/server/{work-agent-prompt-CQWlmw_y.js → work-agent-prompt-Csr4vMbl.js} +1 -1
- package/server/{work-agent-start-cKf7rly8.js → work-agent-start-DA3P_ABv.js} +2 -2
- package/server/{work-agent-start-BColr1oI.js → work-agent-start-DWBmIRlg.js} +1 -1
- package/server/workflows-CgGNyl1z.js +2 -0
- package/server/{workflows-DrC85n8j.js → workflows-CxVnygYU.js} +28 -28
- package/server/{workspace-G3Cus8e9.js → workspace-BO8fIfW9.js} +1 -1
- package/server/{workspace-ChRFy_F9.js → workspace-BWYfzfPV.js} +3 -3
- package/server/{workspace-anchor-drift-DBbyK_Mf.js → workspace-anchor-drift-BMSxf9wp.js} +1 -1
- package/server/{workspace-anchor-drift-z7TjOORC.js → workspace-anchor-drift-RJcMD1EV.js} +4 -4
- package/server/{workspace-config-D-bNq2CF.js → workspace-config-CoAaYx_w.js} +1 -1
- package/server/{workspace-manager-Db3pCmr7.js → workspace-manager-CnAyRh3v.js} +45 -380
- package/server/workspace-manager-D0jJ7StJ.js +4 -0
- package/server/{workspace-metadata-C5Ie2FMZ.js → workspace-metadata-Copcoih9.js} +2 -2
- package/server/{workspace-metadata-Do-L6GFP.js → workspace-metadata-ILlbk8AX.js} +1 -1
- package/server/{workspaces-D0MWw7Mx.js → workspaces-Cpz0xJWQ.js} +112 -112
- package/server/worktree-ops-CV-pRvyW.js +3 -0
- package/server/worktree-ops-Cnk1voFY.js +369 -0
- package/sync-sources/rules/context-nomenclature.md +4 -3
- package/sync-sources/rules/rule-authoring.md +3 -3
- package/sync-sources/skills/knowledge-capture/SKILL.md +13 -13
- package/sync-sources/skills/pan-new-project/SKILL.md +2 -2
- package/sync-sources/skills/pan-projects/SKILL.md +3 -3
- package/sync-sources/skills/pan-sync/SKILL.md +8 -10
- package/sync-sources/skills/refactor-radar/SKILL.md +12 -12
- package/server/agents-BdkVgjxC.js +0 -3
- package/server/archive-planning-CNSWQPvz.js +0 -2
- package/server/assemble-D88iFkP-.js +0 -365
- package/server/build-info-Df2tkRrB.js +0 -2
- package/server/cli-BjznnCC3.js +0 -2
- package/server/context-layers-D0QBOPJJ.js +0 -4
- package/server/context-layers-LY5zt0da.js +0 -37
- package/server/conversation-service-B3h1erHm.js +0 -3
- package/server/conversations-Ch7UGi0F.js +0 -3
- package/server/dead-end-trip-B91w2PGV.js +0 -2
- package/server/delivery-zJM4aIkf.js +0 -3
- package/server/deploy-queue-2cN86Lg4.js +0 -2
- package/server/forge-egNLsjVi.js +0 -2
- package/server/hume-gXLmRhmN.js +0 -3
- package/server/inspect-agent-BuSYgRQs.js +0 -2
- package/server/kimi-code-Cdkk9vRU.js +0 -3
- package/server/kimi-code-DwqLCWFw.js +0 -581
- package/server/merge-ops-CUzpOPtO.js +0 -2
- package/server/merge-rebase-DkfcUT60.js +0 -2
- package/server/messaging-DQi-WEFB.js +0 -3
- package/server/node_modules/@types/node/ffi.d.ts +0 -486
- package/server/node_modules/@types/node/inspector/promises.d.ts +0 -35
- package/server/node_modules/@types/node/path/posix.d.ts +0 -8
- package/server/node_modules/@types/node/path/win32.d.ts +0 -8
- package/server/node_modules/@types/node/quic.d.ts +0 -2153
- package/server/node_modules/@types/node/stream/iter.d.ts +0 -452
- package/server/node_modules/@types/node/test/reporters.d.ts +0 -59
- package/server/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
- package/server/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
- package/server/node_modules/@types/node/ts5.7/index.d.ts +0 -118
- package/server/node_modules/@types/node/util/types.d.ts +0 -558
- package/server/node_modules/@types/node/vfs.d.ts +0 -211
- package/server/node_modules/@types/node/web-globals/blob.d.ts +0 -23
- package/server/node_modules/@types/node/web-globals/console.d.ts +0 -9
- package/server/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
- package/server/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
- package/server/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
- package/server/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
- package/server/node_modules/@types/node/web-globals/performance.d.ts +0 -45
- package/server/node_modules/@types/node/web-globals/timers.d.ts +0 -44
- package/server/node_modules/@types/node/web-globals/url.d.ts +0 -24
- package/server/node_modules/@types/node/zlib/iter.d.ts +0 -131
- package/server/node_modules/undici-types/cache-interceptor.d.ts +0 -179
- package/server/node_modules/undici-types/client-stats.d.ts +0 -15
- package/server/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
- package/server/node_modules/undici-types/h2c-client.d.ts +0 -73
- package/server/node_modules/undici-types/mock-call-history.d.ts +0 -111
- package/server/node_modules/undici-types/round-robin-pool.d.ts +0 -39
- package/server/node_modules/undici-types/snapshot-agent.d.ts +0 -113
- package/server/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
- package/server/node_modules/undici-types/utility.d.ts +0 -7
- package/server/public/assets/image-GAAHSSAO-rafcvWHh.js +0 -1
- package/server/public/assets/index-BvN8bWpz.js +0 -860
- package/server/public/assets/index-DgoS288w.css +0 -1
- package/server/public/assets/mermaid-GHXKKRXX-fP93Za-W.js +0 -1
- package/server/pull-requests-DV_rJ-1u.js +0 -2
- package/server/rally-DlXjOIAG.js +0 -3
- package/server/rebuild-stack-CNknXJHL.js +0 -197
- package/server/settings-EGNbGKpP.js +0 -2
- package/server/specs-Dvq4sOy6.js +0 -3
- package/server/supervisor-DoJpD33i.js +0 -2
- package/server/token-util-DfUS3Lpp.js +0 -3
- package/server/workflows-CLrEiTds.js +0 -2
- package/server/workspace-manager-gz9Amovn.js +0 -3
- /package/server/public/assets/{pica-CgYEdS5s.js → pica-DPvnTcFS.js} +0 -0
- /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,
|
|
3
|
-
import { h as loadConfigSync$1, p as init_config } from "./config-
|
|
4
|
-
import { l as init_activity_logger, o as emitActivityEntrySync, s as emitActivityTtsSync } from "./activity-logger-
|
|
5
|
-
import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-
|
|
6
|
-
import { n as init_fs_lock, s as withRecordFsLock } from "./fs-lock-
|
|
7
|
-
import { c as withStateGitLock, i as init_record_update, n as clearRecordPipelineClosedOut, s as init_state_git_lock } from "./record-update-
|
|
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-
|
|
9
|
-
import { a as getWorkspaceForIssue, o as init_resolver } from "./resolver-
|
|
10
|
-
import { a as init_event_store, i as initEventStore } from "./event-store-
|
|
11
|
-
import { o as OHMYPI_BEHAVIOR, s as getHarnessBehavior } from "./src-
|
|
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-
|
|
13
|
-
import { a as countAgentsByStatus, c as init_agents$2, g as logAgentLifecycleSync, h as init_persistent_logger } from "./agents-
|
|
14
|
-
import { n as ensureSessionContextBriefingFile, r as init_briefing_freshness } from "./briefing-freshness-
|
|
15
|
-
import { a as getFlywheelActiveRunIdSync, c as init_control_settings, j as parseOhmypiSessionSync, k as init_ohmypi_parser } from "./control-settings-
|
|
16
|
-
import { _ as init_tier_metrics, g as estimateFeedDeliveryTokens, v as recordTierFeedDelivery } from "./cost-sync-
|
|
17
|
-
import { t as init_behavior } from "./behavior-
|
|
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-
|
|
19
|
-
import { a as init_feature_registry_population, i as resetPostMergeState, n as init_post_merge_state, o as recordFeatureRegistryLifecycle } from "./post-merge-state-
|
|
20
|
-
import { i as ensureInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-
|
|
21
|
-
import { A as init_conversations, B as reactivateConversationForSpawn, C as getConversationByName, b as createConversation, z as normalizeHarness } from "./conversations-
|
|
22
|
-
import { n as readActiveDashboardBundleSync, t as init_active_dashboard_bundle } from "./active-dashboard-bundle-
|
|
23
|
-
import { a as readCavemanVariant, n as init_workspace } from "./workspace-
|
|
24
|
-
import { C as generateLauncherScriptSync, D as
|
|
25
|
-
import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { i as
|
|
29
|
-
import { n as createTrackerFromConfig, r as init_factory, t as createTracker } from "./factory-
|
|
30
|
-
import { c as init_stack_health, o as getWorkspaceStackHealth } from "./stack-health-
|
|
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-
|
|
33
|
-
import { a as getDispatchableItems, c as init_dag, o as groupItemsByWave, r as createActiveSlice } from "./dag-
|
|
34
|
-
import { c as generateFixedPointPromptSync, f as initHookSync, n as checkHookSync, p as init_hooks } from "./hooks-
|
|
35
|
-
import { a as init_git_utils, l as renderWorkspaceGitShowPromise } from "./git-utils-
|
|
36
|
-
import { n as init_workspace_anchor_drift, t as evaluateWorkspaceAnchorDrift } from "./workspace-anchor-drift-
|
|
37
|
-
import { n as resolveHarness, t as init_harness_resolve } from "./harness-resolve-
|
|
38
|
-
import { a as loadCloisterConfigSync, r as init_config$1 } from "./config-
|
|
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-
|
|
41
|
-
import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-
|
|
42
|
-
import { d as resolveWorkspaceRepoRootsSync, i as init_project_repos } from "./project-repos-
|
|
43
|
-
import {
|
|
44
|
-
import { a as
|
|
45
|
-
import {
|
|
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
|
-
|
|
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,
|
|
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/
|
|
1702
|
-
function
|
|
1703
|
-
const
|
|
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,
|
|
2058
|
+
if (project) sections.push(renderProjectLayer(project.path, harness));
|
|
1706
2059
|
const workspaceFile = resolveWorkspaceContextFile(workspace);
|
|
1707
2060
|
if (existsSync$1(workspaceFile)) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
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
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
2188
|
+
var execAsync$9, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
|
|
1816
2189
|
var init_ohmypi_fifo = __esmMin((() => {
|
|
1817
2190
|
init_paths();
|
|
1818
|
-
execAsync$
|
|
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$
|
|
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$
|
|
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-
|
|
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-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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-
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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-
|
|
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-
|
|
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-
|
|
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 =
|
|
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
|
|
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-
|
|
7435
|
+
const { preTrustDirectory } = await import("./workspace-manager-D0jJ7StJ.js");
|
|
6286
7436
|
preTrustDirectory(workspace);
|
|
6287
7437
|
} catch {}
|
|
6288
7438
|
clearReadySignal(agentId);
|
|
6289
|
-
|
|
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
|
|
6345
|
-
|
|
6346
|
-
await
|
|
6347
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
7721
|
+
const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-BxM1U38q.js");
|
|
6535
7722
|
if (isGitHubAppConfigured()) {
|
|
6536
|
-
const { findProjectByPathSync } = await import("./projects-
|
|
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
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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} (
|
|
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-
|
|
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-
|
|
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-
|
|
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 $,
|
|
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-
|
|
13191
|
+
//# sourceMappingURL=agent-state-Ci6PhjOE.js.map
|