chainlesschain 0.162.175 → 0.162.177
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 +10 -10
- package/src/assets/web-panel/assets/{AIOps-DherW0Rh.js → AIOps-DT-VPWuN.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CDGfqt2Y.js → ActionButton-DyOreOVN.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BYhkzdgD.js → Analytics-DslNsKux.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-cEKk1cpb.js → AppLayout-BNJJAYME.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-_aXR3WWc.js → Artifacts-DoaAtEcY.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-CYAf-gY7.js → Audit-DPG3WdJ9.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-D4Q20phR.js → BackgroundAgents-C_JO6R5G.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-Cq0Tyk58.js → Backup-Cv3BooyX.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-CPj_CdAv.js → BaseInput-D2uQXWu-.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-BQ-Qq0es.js → Chat-B4Vczyf3.js} +4 -4
- package/src/assets/web-panel/assets/ChatBubbleRenderer-DE6reP99.js +1 -0
- package/src/assets/web-panel/assets/{Checkbox-rke6l3yg.js → Checkbox-qTgk4VeP.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-DiacrIPq.js → Codegen-DlLWcIzj.js} +1 -1
- package/src/assets/web-panel/assets/{Col-Cx3BY-Up.js → Col-DNO73qp7.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DfmWiQy8.js → Community-vRDNpc4j.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-DdQnpxy5.js → Compact-CEWtIXni.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-lzliOH_r.js → Compliance-KgYC9Fxi.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CYx4Un5k.js → Cowork-zj5wvkpT.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-BGDcPFlo.js → Cron-BLDoCozU.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-0_X5g2ri.js → Crosschain-BYnff4VY.js} +1 -1
- package/src/assets/web-panel/assets/{DID-C0PEf3Eu.js → DID-C75VFsVm.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-DULQjQ58.js → Dashboard-C4Gutni2.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-DGRHRbW6.js → Dropdown-B5dbO4Kx.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-ChX8XPwB.js → EmailListRenderer-BDipZtHJ.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-Dyq6IBNu.js → FamilyGuardDashboard-DmIzt8jj.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DH1NfAL2.js → Federation-D9QOS-uW.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BN1I_uNi.js → FormItemContext-B47HRwAm.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-Dq_2UYpe.js → GenericCardRenderer-3R4mXmgV.js} +1 -1
- package/src/assets/web-panel/assets/{Git-BAy1yvI2.js → Git-DrNXZf1C.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-Db6Q2iSy.js → Governance-BGd7JR98.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-0ub6yHcr.js → Inference-D-2he1ed.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DtLetM36.js → KnowledgeGraph-C0sHIbK5.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-Bcoy7CUd.js → Logs-DiBQO-jL.js} +2 -2
- package/src/assets/web-panel/assets/{MarkdownRenderer-BfEMFAXf.js → MarkdownRenderer-DL_5eV2D.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-tt2rzwRR.js → Marketplace-VR59OdrC.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BhOgX-MU.js → McpTools-DrPzwSd3.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-BJUxeWBL.js → Memory-CBgKALwQ.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-BwUY2G9w.js → MobileBridge-pQ9Tn-Mn.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-BLRfHhqi.js → MobileProjects-mASB6jyj.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-B2WMboOm.js → Mtc-DTMgE7HC.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-8pNEXO63.js → MtcAudit-CwTnCtiL.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-C1wm5a_1.js → Multisig-ngm6WU8f.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-C1QpKF7g.js → NLProgramming-4YO4Qww9.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CiQUcxFu.js → Notes-DP1k45mF.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-BblDPJ_x.js → NotificationSettings-r2H8yPKb.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-DRjYcPtb.js → OrderTableRenderer-CoM_Zw0J.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-Dp3VKB0X.js → Organization-DrO7jRWS.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-Czx161m9.js → Overflow-Cnwu4i4t.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-ClFi6wOs.js → P2P-zi-cDwA_.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-CRweW0lz.js → PdhVaultBrowser-DBEryDv7.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-BzcRoqTn.js → Permissions-lqXK2C3x.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-ChGTpNMd.js → PersonalDataHub-b63T3HJM.js} +2 -2
- package/src/assets/web-panel/assets/{Pipeline-BMOOpKWA.js → Pipeline-Kep5KAGW.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-D0AZHObH.js → Privacy-CHdvOAh1.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-yYFlZ6Ja.js → ProjectInit-BhKfdwe9.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-DJNVuMQs.js → ProjectSettings-Yavk9K8A.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-Br0rBWH1.js → Projects-CN8E_5Mq.js} +1 -1
- package/src/assets/web-panel/assets/Providers-Bfym6SQn.js +1 -0
- package/src/assets/web-panel/assets/{QrScannerModal-81NZOitV.js → QrScannerModal-CLSQcrlR.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-Dic2lCbJ.js → QuickAsk-VPa2WKQN.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-Dh9iwViE.js → Recommend-CGXR8jVU.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-Bq9VYEFy.js → RemoteSession-C_20YfMB.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-CxFZ-NbJ.js → Reputation-awZh68UV.js} +1 -1
- package/src/assets/web-panel/assets/{Row-BVSLcaX2.js → Row-Ctb4oiYN.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BbC-5DOH.js → RssFeed-D3sdjvUV.js} +3 -3
- package/src/assets/web-panel/assets/{Search-BfjZ1GCr.js → Search-C-zfA4kT.js} +1 -1
- package/src/assets/web-panel/assets/{Security-CVjhOV5r.js → Security-D9XlmHA3.js} +4 -4
- package/src/assets/web-panel/assets/{Services-D45u-Aqe.js → Services-C3UKnr41.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-WkGoK4he.js → Skeleton-BQxagZfF.js} +1 -1
- package/src/assets/web-panel/assets/Skills-q6eb6KPZ.js +1 -0
- package/src/assets/web-panel/assets/{Sla-Bf4QTF3E.js → Sla-DveENvek.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-DVpZdbMN.js → SpeechSettings-BFjXLNgF.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-DEEojoMS.js → SyncSettings-BpHgbaP9.js} +2 -2
- package/src/assets/web-panel/assets/Tasks-DvepRb8-.js +1 -0
- package/src/assets/web-panel/assets/{Templates-Bzl-9wY5.js → Templates-DEiaoyve.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-0khxUOB8.js → Tenant-ITg774nY.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-DWGYhAYU.js → Terminal-D3ZBcvnb.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-B0Y4LONc.js → TimelineRenderer-BsLU6JjU.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DEE07SFh.js → Tokens-Cb5Pquc9.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-BM7xvA5z.js → Trigger-Dwfy-m9N.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Dv3ijvvZ.js → Trust-CnlSRGG0.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-B1-enmMt.js → UkeySign-Y4TlvKVo.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-DYiIPByd.js → VideoEditing-BpKLtTTO.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-D-y374BQ.js → Wallet-LLBzIq8x.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-HBDjcUhi.js → WebAuthn-BeSRiusP.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-sKn4qTID.js → WorkflowEditor-BK_l1tXO.js} +1 -1
- package/src/assets/web-panel/assets/{chat-TVYhaBXj.js → chat-DYd-X7Wg.js} +1 -1
- package/src/assets/web-panel/assets/{colors-DMADxY9v.js → colors-C9uip71j.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-OftcHpO_.js → compact-item-JBrfjUP6.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-DW1zVUSN.js → createContext-D03fbuiq.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-B8LQ8leS.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-CaUathNp.js → hasIn-DLQOR6l-.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cmdv6Dev.js → index-5YN7F5bO.js} +1 -1
- package/src/assets/web-panel/assets/{index-iDmgT2Dg.js → index-6GuLRpBQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-77kgkUgY.js → index-B0X76LjX.js} +1 -1
- package/src/assets/web-panel/assets/{index-CM8W07sc.js → index-B46YcgsV.js} +1 -1
- package/src/assets/web-panel/assets/{index-C9JoaYSs.js → index-BNCdRmWf.js} +1 -1
- package/src/assets/web-panel/assets/{index-CpDtN0dl.js → index-BYv-LWdy.js} +1 -1
- package/src/assets/web-panel/assets/{index-CZXYI5LU.js → index-Ba-Ps_AJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-DWVZ3T0t.js → index-BcBZwlnG.js} +1 -1
- package/src/assets/web-panel/assets/{index--5UvwqH_.js → index-BdH9l8wl.js} +1 -1
- package/src/assets/web-panel/assets/{index-BBNg08cD.js → index-BfOs_bmg.js} +3 -3
- package/src/assets/web-panel/assets/index-Bh8BPtqR.js +1 -0
- package/src/assets/web-panel/assets/{index-s-EnkUCn.js → index-BnQgRjsm.js} +1 -1
- package/src/assets/web-panel/assets/{index-Lr0MO-GU.js → index-BpYKLrUT.js} +1 -1
- package/src/assets/web-panel/assets/{index-B-19mFhn.js → index-BuNFCZCx.js} +1 -1
- package/src/assets/web-panel/assets/{index-CeCIYYG7.js → index-ByHO3SqZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-hXq7QRA_.js → index-C2zmOsyD.js} +1 -1
- package/src/assets/web-panel/assets/{index-8YelceUU.js → index-CChQBM1d.js} +1 -1
- package/src/assets/web-panel/assets/{index-B52Ztt8Q.js → index-CChaISMb.js} +1 -1
- package/src/assets/web-panel/assets/{index-DKjqFpYa.js → index-CILVyK3b.js} +1 -1
- package/src/assets/web-panel/assets/{index-DAfT3EMd.js → index-CL0ixCxk.js} +1 -1
- package/src/assets/web-panel/assets/{index-sm1sGIxW.js → index-CS63r8h3.js} +1 -1
- package/src/assets/web-panel/assets/{index-DHi634g9.js → index-CVZWiUE_.js} +1 -1
- package/src/assets/web-panel/assets/{index-BEzLLVYd.js → index-Ce0Bf1YF.js} +1 -1
- package/src/assets/web-panel/assets/index-CeVrHLzZ.js +1 -0
- package/src/assets/web-panel/assets/{index-pSVCBsG4.js → index-Ck17i0OD.js} +1 -1
- package/src/assets/web-panel/assets/{index-GUKz4Pv9.js → index-Cpn19c9k.js} +1 -1
- package/src/assets/web-panel/assets/{index-CKNdnJRo.js → index-CqWk1FLG.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bg-7FpaL.js → index-CwoDpKzW.js} +1 -1
- package/src/assets/web-panel/assets/{index-DYwwUKDg.js → index-D-1SqEpQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZdT8nio.js → index-D4UY5Z60.js} +1 -1
- package/src/assets/web-panel/assets/{index-BvRw4Fna.js → index-D8KvuDz0.js} +1 -1
- package/src/assets/web-panel/assets/{index-kdMl_0zL.js → index-DNMAAUVk.js} +1 -1
- package/src/assets/web-panel/assets/{index-CK-p7Hji.js → index-DYLZY4uh.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXcqvWBp.js → index-DaokIHt3.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFVbDpqg.js → index-Q7mmL6w4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BJ1PjRY3.js → index-SO6lgMg0.js} +1 -1
- package/src/assets/web-panel/assets/{index-BSp1Ofvx.js → index-iahNhZwm.js} +1 -1
- package/src/assets/web-panel/assets/{index-BupSWDcl.js → index-l08afIbV.js} +1 -1
- package/src/assets/web-panel/assets/{index-D63QVAiJ.js → index-rIxxfdTN.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DdcKTlQR.js → initDefaultProps-CG9z1c6w.js} +1 -1
- package/src/assets/web-panel/assets/{motion-CL-hTBQj.js → motion-B1Ky7Zff.js} +1 -1
- package/src/assets/web-panel/assets/{move-qYSAkxNG.js → move-DME8X2P1.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-ZwRSZtRP.js → mtc-parser-cuJYSWB7.js} +1 -1
- package/src/assets/web-panel/assets/{omit-Bld-8ftI.js → omit-UI_EE0uZ.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DGHs-a9Z.js → pickAttrs-BIoE_Z_V.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-DRQPMyI5.js → placementArrow-B48-9HKN.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-C5MJG_Yo.js → responsiveObserve-D7x_GDgD.js} +1 -1
- package/src/assets/web-panel/assets/{slide-VZ-fpZCD.js → slide-DjzC5_7m.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-9ocfCyHk.js → statusUtils-C6BIymhh.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-B6QAwAN5.js → styleChecker-B4dGrdD9.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-Bq1twor3.js → useFlexGapSupport-Bken4aNE.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DKZq96tz.js → useFs-BMlqECqv.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-D0RmRVXf.js → usePersonalDataHub-DLdrfmMa.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-D6kEj_tt.js → vnode-CKJQmxa0.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-2yfasoQf.js → zoom-CaZunuau.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/auth/npm-auth.js +30 -5
- package/src/commands/agenda.js +83 -5
- package/src/commands/agent.js +42 -4
- package/src/commands/background-session.js +11 -4
- package/src/commands/batch.js +79 -27
- package/src/commands/changelog.js +15 -4
- package/src/commands/config.js +70 -5
- package/src/commands/context.js +36 -2
- package/src/commands/eval.js +21 -6
- package/src/commands/hook.js +2 -2
- package/src/commands/hub.js +19 -1
- package/src/commands/loop.js +9 -2
- package/src/commands/memory.js +21 -6
- package/src/commands/permissions.js +57 -1
- package/src/commands/plugin.js +2 -0
- package/src/commands/review.js +23 -11
- package/src/commands/routine.js +31 -8
- package/src/commands/session.js +11 -3
- package/src/commands/skill.js +2 -0
- package/src/commands/statusline.js +3 -3
- package/src/commands/team.js +20 -7
- package/src/commands/update.js +65 -10
- package/src/data/changelog.json +293 -51
- package/src/gateways/terminal/PtyManager.js +8 -1
- package/src/gateways/ws/message-dispatcher.js +3 -0
- package/src/gateways/ws/session-protocol.js +26 -0
- package/src/gateways/ws/ws-agent-handler.js +107 -69
- package/src/gateways/ws/ws-server.js +74 -2
- package/src/harness/background-task-manager.js +18 -6
- package/src/harness/background-task-worker.js +11 -18
- package/src/harness/jsonl-session-store.js +13 -6
- package/src/harness/mcp-client.js +195 -2
- package/src/harness/worktree-isolator.js +18 -21
- package/src/lib/__tests__/personal-data-hub-aichat-wizard.test.js +15 -0
- package/src/lib/agent-coordinator.js +4 -0
- package/src/lib/agent-core.js +5 -0
- package/src/lib/agent-ipc-bus.js +44 -5
- package/src/lib/agent-sandbox.js +16 -2
- package/src/lib/agent-schedule-store.js +55 -0
- package/src/lib/agent-team/team-worktree.js +28 -6
- package/src/lib/agent-tool-admission.js +104 -0
- package/src/lib/agent-worktree.js +20 -19
- package/src/lib/api-key-helper.js +10 -2
- package/src/lib/async-hook-supervisor.cjs +135 -15
- package/src/lib/async-hook-supervisor.js +47 -0
- package/src/lib/background-agent-supervisor.js +35 -12
- package/src/lib/background-task-manager.js +5 -1
- package/src/lib/changelog.js +76 -11
- package/src/lib/channels/channel-manager.js +6 -0
- package/src/lib/channels/telegram-channel.js +11 -1
- package/src/lib/channels/webhook-channel.js +15 -3
- package/src/lib/checkpoint-store.js +10 -2
- package/src/lib/chrome-connector.js +6 -2
- package/src/lib/claude-code-bridge.js +24 -8
- package/src/lib/cli-anything-bridge.js +82 -25
- package/src/lib/cloud/bundle.js +12 -2
- package/src/lib/code-review.js +32 -8
- package/src/lib/computer-use/control-backend.js +18 -3
- package/src/lib/context-breakdown.js +46 -0
- package/src/lib/context-source-ledger.js +43 -0
- package/src/lib/diff-review-follow-up.js +154 -0
- package/src/lib/doctor-checkup.js +18 -6
- package/src/lib/downloader.js +17 -3
- package/src/lib/ensure-utf8.js +11 -3
- package/src/lib/eval/tasks.js +25 -31
- package/src/lib/event-runtime-producer.js +58 -0
- package/src/lib/event-runtime-store.js +354 -0
- package/src/lib/event-runtime-worker.js +109 -0
- package/src/lib/execution-backend.js +72 -21
- package/src/lib/git-integration.js +19 -4
- package/src/lib/hook-manager.js +6 -15
- package/src/lib/hook-runner.cjs +88 -8
- package/src/lib/hook-runner.js +55 -0
- package/src/lib/hooks-v2-producers.js +15 -0
- package/src/lib/hooks-v2-runtime.js +70 -21
- package/src/lib/host-adb-bridge.js +129 -24
- package/src/lib/ide-context.js +128 -1
- package/src/lib/interaction-adapter.js +39 -0
- package/src/lib/json-schema-validate.js +190 -36
- package/src/lib/lan-pairing-preflight.js +13 -2
- package/src/lib/lsp/__tests__/benchmark.test.js +61 -0
- package/src/lib/lsp/__tests__/lsp-client.test.js +6 -1
- package/src/lib/lsp/__tests__/lsp-server-registry.test.js +18 -0
- package/src/lib/lsp/benchmark.js +20 -4
- package/src/lib/lsp/lsp-client.js +22 -3
- package/src/lib/lsp/lsp-manager.js +4 -0
- package/src/lib/lsp/lsp-server-registry.js +11 -2
- package/src/lib/mcp-oauth.js +8 -2
- package/src/lib/npm-invocation.js +29 -0
- package/src/lib/orchestrator.js +8 -2
- package/src/lib/packer/pack-update-applier.js +14 -2
- package/src/lib/packer/pkg-runner.js +13 -2
- package/src/lib/packer/precheck.js +33 -16
- package/src/lib/packer/smoke-runner.js +18 -5
- package/src/lib/packer/web-panel-builder.js +16 -2
- package/src/lib/paths.js +1 -1
- package/src/lib/permission-rules.cjs +5 -1
- package/src/lib/personal-data-hub-aichat-wizard.js +22 -6
- package/src/lib/personal-data-hub-wiring.js +27 -3
- package/src/lib/plan-mode.js +204 -11
- package/src/lib/plugin-monitor-supervisor.js +48 -6
- package/src/lib/plugin-runtime/bin.js +45 -0
- package/src/lib/plugin-runtime/hooks.js +14 -1
- package/src/lib/plugin-runtime/install.js +11 -3
- package/src/lib/plugin-runtime/lsp.js +3 -0
- package/src/lib/plugin-runtime/mcp.js +8 -1
- package/src/lib/plugin-runtime/monitors.js +4 -0
- package/src/lib/plugin-runtime/plugin-options.js +74 -7
- package/src/lib/plugin-runtime/signature.js +45 -0
- package/src/lib/pr-create.js +21 -8
- package/src/lib/pr-link-ledger.js +15 -3
- package/src/lib/process-execution-broker/credential-agent.js +23 -3
- package/src/lib/process-execution-broker/index.js +315 -38
- package/src/lib/process-execution-broker/patch-child-process.js +2 -3
- package/src/lib/process-manager.js +18 -3
- package/src/lib/publish-workspace.js +14 -6
- package/src/lib/repl-bang-memorize.js +10 -2
- package/src/lib/repl-goal.js +19 -2
- package/src/lib/secret-store.js +159 -0
- package/src/lib/service-manager.js +64 -29
- package/src/lib/settings-hook-events.cjs +74 -9
- package/src/lib/settings-hook-events.js +20 -0
- package/src/lib/settings-hooks.cjs +4 -0
- package/src/lib/side-effect-ledger.js +22 -0
- package/src/lib/skill-packs/generator.js +18 -9
- package/src/lib/skill-process-broker.js +71 -0
- package/src/lib/slash-commands.js +10 -2
- package/src/lib/status-line.cjs +28 -7
- package/src/lib/status-line.js +33 -0
- package/src/lib/sub-agent-context.js +5 -0
- package/src/lib/sub-agent-profiles.js +4 -0
- package/src/lib/turn-context.js +14 -8
- package/src/lib/unattended-action-policy.js +83 -0
- package/src/lib/update-notice.js +6 -2
- package/src/lib/with-file-lock.js +7 -0
- package/src/lib/ws-server.js +1 -0
- package/src/repl/agent-repl.js +60 -23
- package/src/repl/clipboard-copy.js +8 -2
- package/src/repl/pr-comments.js +30 -7
- package/src/runtime/agent-core.js +554 -118
- package/src/runtime/agent-runtime.js +1 -0
- package/src/runtime/coding-agent-contract-shared.cjs +52 -0
- package/src/runtime/coding-agent-policy.cjs +20 -0
- package/src/runtime/diagnostics.js +73 -8
- package/src/runtime/headless-runner.js +88 -10
- package/src/runtime/headless-stream.js +343 -21
- package/src/runtime/mcp-config.js +16 -1
- package/src/runtime/session-slash-commands.js +506 -0
- package/src/skills/video-editing/extractors/audio-extractor.js +13 -5
- package/src/skills/video-editing/extractors/video-extractor.js +13 -3
- package/src/skills/video-editing/media-process.js +20 -0
- package/src/skills/video-editing/render/audio-mix.js +13 -3
- package/src/skills/video-editing/render/ffmpeg-concat.js +7 -2
- package/src/skills/video-editing/render/ffmpeg-extract.js +7 -2
- package/src/workers/background-agent-worker.js +6 -2
- package/src/assets/web-panel/assets/ChatBubbleRenderer-Ci97vNTs.js +0 -1
- package/src/assets/web-panel/assets/Providers-zZRhNtSu.js +0 -1
- package/src/assets/web-panel/assets/Skills-D_jvQZcj.js +0 -1
- package/src/assets/web-panel/assets/Tasks-DFwxpLIk.js +0 -1
- package/src/assets/web-panel/assets/devWarning-CLOk6rdE.js +0 -1
- package/src/assets/web-panel/assets/index-CSgUfMTM.js +0 -1
- package/src/assets/web-panel/assets/index-DliSZvAP.js +0 -1
|
@@ -8,6 +8,7 @@ import { describe, it, expect } from "vitest";
|
|
|
8
8
|
import {
|
|
9
9
|
percentile,
|
|
10
10
|
summarize,
|
|
11
|
+
sampleRssDefault,
|
|
11
12
|
sumSubtreeRss,
|
|
12
13
|
sumSubtreeRssFromWmicCsv,
|
|
13
14
|
} from "../benchmark.js";
|
|
@@ -86,3 +87,63 @@ describe("sumSubtreeRssFromWmicCsv", () => {
|
|
|
86
87
|
expect(sumSubtreeRssFromWmicCsv("garbage\r\n", 100)).toBeNull();
|
|
87
88
|
});
|
|
88
89
|
});
|
|
90
|
+
|
|
91
|
+
describe("sampleRssDefault", () => {
|
|
92
|
+
it("routes the POSIX process snapshot through the Broker contract", async () => {
|
|
93
|
+
const calls = [];
|
|
94
|
+
const execFileSync = (...args) => {
|
|
95
|
+
calls.push(args);
|
|
96
|
+
return "100 1 1024\n200 100 512\n400 1 9999\n";
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
await expect(
|
|
100
|
+
sampleRssDefault(100, { execFileSync, platform: "linux" }),
|
|
101
|
+
).resolves.toBe(2);
|
|
102
|
+
expect(calls).toEqual([
|
|
103
|
+
[
|
|
104
|
+
"ps",
|
|
105
|
+
["-o", "pid=,ppid=,rss="],
|
|
106
|
+
expect.objectContaining({
|
|
107
|
+
origin: "lsp:benchmark-rss",
|
|
108
|
+
policy: "allow",
|
|
109
|
+
scope: "lsp",
|
|
110
|
+
shell: false,
|
|
111
|
+
}),
|
|
112
|
+
],
|
|
113
|
+
]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("routes the Windows process snapshot through literal argv", async () => {
|
|
117
|
+
const calls = [];
|
|
118
|
+
const execFileSync = (...args) => {
|
|
119
|
+
calls.push(args);
|
|
120
|
+
return [
|
|
121
|
+
"Node,ParentProcessId,ProcessId,WorkingSetSize",
|
|
122
|
+
"HOST,1,100,1048576",
|
|
123
|
+
"HOST,100,200,1048576",
|
|
124
|
+
].join("\r\n");
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
await expect(
|
|
128
|
+
sampleRssDefault(100, { execFileSync, platform: "win32" }),
|
|
129
|
+
).resolves.toBe(2);
|
|
130
|
+
expect(calls).toEqual([
|
|
131
|
+
[
|
|
132
|
+
"wmic",
|
|
133
|
+
[
|
|
134
|
+
"process",
|
|
135
|
+
"get",
|
|
136
|
+
"ProcessId,ParentProcessId,WorkingSetSize",
|
|
137
|
+
"/format:csv",
|
|
138
|
+
],
|
|
139
|
+
expect.objectContaining({
|
|
140
|
+
origin: "lsp:benchmark-rss",
|
|
141
|
+
policy: "allow",
|
|
142
|
+
scope: "lsp",
|
|
143
|
+
shell: false,
|
|
144
|
+
windowsHide: true,
|
|
145
|
+
}),
|
|
146
|
+
],
|
|
147
|
+
]);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
@@ -87,7 +87,12 @@ describe("LSPClient handshake", () => {
|
|
|
87
87
|
expect(_deps.spawn).toHaveBeenCalledWith(
|
|
88
88
|
"fake-lsp",
|
|
89
89
|
["--stdio"],
|
|
90
|
-
expect.objectContaining({
|
|
90
|
+
expect.objectContaining({
|
|
91
|
+
origin: "lsp:server",
|
|
92
|
+
policy: "allow",
|
|
93
|
+
scope: "lsp",
|
|
94
|
+
shell: false,
|
|
95
|
+
}),
|
|
91
96
|
);
|
|
92
97
|
});
|
|
93
98
|
|
|
@@ -109,6 +109,24 @@ describe("plugin server registration", () => {
|
|
|
109
109
|
expect(s).toMatchObject({ id: "zls" });
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
it("returns plugin provenance for Broker-enforced servers", () => {
|
|
113
|
+
registerLanguageServer({
|
|
114
|
+
languageId: "kotlin",
|
|
115
|
+
command: "kotlin-lsp",
|
|
116
|
+
pluginId: "p-kotlin",
|
|
117
|
+
pluginVersion: "1.2.3",
|
|
118
|
+
pluginSource: "/plugins/kotlin/.lsp.json",
|
|
119
|
+
});
|
|
120
|
+
const isWin = process.platform === "win32";
|
|
121
|
+
existsFor([path.join("/proj", "node_modules", ".bin", isWin ? "kotlin-lsp.cmd" : "kotlin-lsp")]);
|
|
122
|
+
expect(resolveServer("kotlin", "/proj")).toMatchObject({
|
|
123
|
+
origin: "plugin:lsp",
|
|
124
|
+
pluginId: "p-kotlin",
|
|
125
|
+
pluginVersion: "1.2.3",
|
|
126
|
+
pluginSource: "/plugins/kotlin/.lsp.json",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
112
130
|
it("rejects an incomplete registration", () => {
|
|
113
131
|
expect(() => registerLanguageServer({ languageId: "x" })).toThrow(
|
|
114
132
|
/requires/,
|
package/src/lib/lsp/benchmark.js
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { CodeIntelligence } from "./code-intelligence.js";
|
|
15
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
15
16
|
|
|
16
17
|
/** now() in fractional milliseconds — injectable for deterministic tests. */
|
|
17
18
|
export const _deps = {
|
|
18
19
|
now: () => Number(process.hrtime.bigint() / 1000n) / 1000,
|
|
19
20
|
sampleRss: sampleRssDefault,
|
|
21
|
+
execFileSync: (...args) => executionBroker.execFileSync(...args),
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
/** p-th percentile (0..100) of an UNSORTED sample via linear interpolation. */
|
|
@@ -167,10 +169,12 @@ async function captureServerInfo(ci) {
|
|
|
167
169
|
* lies. We sum the whole subtree. Returns null if it can't be read (never throws
|
|
168
170
|
* — memory is a bonus metric, not load-bearing).
|
|
169
171
|
*/
|
|
170
|
-
async function sampleRssDefault(
|
|
171
|
-
|
|
172
|
+
export async function sampleRssDefault(
|
|
173
|
+
pid,
|
|
174
|
+
{ execFileSync = _deps.execFileSync, platform = process.platform } = {},
|
|
175
|
+
) {
|
|
172
176
|
try {
|
|
173
|
-
if (
|
|
177
|
+
if (platform === "win32") {
|
|
174
178
|
// One snapshot of every process → parent map → sum the subtree at `pid`.
|
|
175
179
|
const csv = execFileSync(
|
|
176
180
|
"wmic",
|
|
@@ -180,7 +184,15 @@ async function sampleRssDefault(pid) {
|
|
|
180
184
|
"ProcessId,ParentProcessId,WorkingSetSize",
|
|
181
185
|
"/format:csv",
|
|
182
186
|
],
|
|
183
|
-
{
|
|
187
|
+
{
|
|
188
|
+
encoding: "utf8",
|
|
189
|
+
windowsHide: true,
|
|
190
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
191
|
+
origin: "lsp:benchmark-rss",
|
|
192
|
+
policy: "allow",
|
|
193
|
+
scope: "lsp",
|
|
194
|
+
shell: false,
|
|
195
|
+
},
|
|
184
196
|
);
|
|
185
197
|
const bytes = sumSubtreeRssFromWmicCsv(csv, pid);
|
|
186
198
|
return bytes != null ? Math.round(bytes / (1024 * 1024)) : null;
|
|
@@ -188,6 +200,10 @@ async function sampleRssDefault(pid) {
|
|
|
188
200
|
// POSIX: not wrapped, so the pid is the real server. Sum pid + children.
|
|
189
201
|
const out = execFileSync("ps", ["-o", "pid=,ppid=,rss="], {
|
|
190
202
|
encoding: "utf8",
|
|
203
|
+
origin: "lsp:benchmark-rss",
|
|
204
|
+
policy: "allow",
|
|
205
|
+
scope: "lsp",
|
|
206
|
+
shell: false,
|
|
191
207
|
});
|
|
192
208
|
const rows = out
|
|
193
209
|
.trim()
|
|
@@ -13,15 +13,17 @@
|
|
|
13
13
|
* does not intercept this file). Nothing here is language-specific.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { spawn as nodeSpawn } from "child_process";
|
|
17
16
|
import { EventEmitter } from "events";
|
|
18
17
|
import { encodeMessage, MessageBuffer } from "./jsonrpc-stream.js";
|
|
18
|
+
import { executionBroker } from "../process-execution-broker/index.js";
|
|
19
19
|
|
|
20
20
|
const DEFAULT_REQUEST_TIMEOUT_MS = 15_000;
|
|
21
21
|
const DEFAULT_INIT_TIMEOUT_MS = 30_000;
|
|
22
22
|
|
|
23
23
|
// Injectable so unit tests can supply a fake child process.
|
|
24
|
-
export const _deps = {
|
|
24
|
+
export const _deps = {
|
|
25
|
+
spawn: (...args) => executionBroker.spawn(...args),
|
|
26
|
+
};
|
|
25
27
|
|
|
26
28
|
export class LSPClient extends EventEmitter {
|
|
27
29
|
/**
|
|
@@ -41,6 +43,10 @@ export class LSPClient extends EventEmitter {
|
|
|
41
43
|
this.env = opts.env || {};
|
|
42
44
|
this.requestTimeoutMs = opts.requestTimeoutMs || DEFAULT_REQUEST_TIMEOUT_MS;
|
|
43
45
|
this.capabilitiesOverride = opts.capabilities || null;
|
|
46
|
+
this.origin = opts.origin || null;
|
|
47
|
+
this.pluginId = opts.pluginId || null;
|
|
48
|
+
this.pluginVersion = opts.pluginVersion || null;
|
|
49
|
+
this.pluginSource = opts.pluginSource || null;
|
|
44
50
|
|
|
45
51
|
this._child = null;
|
|
46
52
|
this._buffer = new MessageBuffer();
|
|
@@ -73,13 +79,26 @@ export class LSPClient extends EventEmitter {
|
|
|
73
79
|
// fix, so buildSpawnCommand rewrites them to an explicit `cmd.exe /d /s /c`
|
|
74
80
|
// invocation with verbatim args — still no shell, still injection-safe.
|
|
75
81
|
const spawnSpec = buildSpawnCommand(this.command, this.args);
|
|
76
|
-
|
|
82
|
+
const spawnFn = String(this.origin || "").startsWith("plugin:")
|
|
83
|
+
? executionBroker.spawn.bind(executionBroker)
|
|
84
|
+
: _deps.spawn;
|
|
85
|
+
this._child = spawnFn(spawnSpec.file, spawnSpec.args, {
|
|
77
86
|
cwd: this.rootPath,
|
|
78
87
|
env: { ...process.env, ...this.env },
|
|
79
88
|
stdio: ["pipe", "pipe", "pipe"],
|
|
80
89
|
shell: false,
|
|
81
90
|
windowsHide: true,
|
|
82
91
|
windowsVerbatimArguments: spawnSpec.windowsVerbatimArguments,
|
|
92
|
+
origin: this.origin || "lsp:server",
|
|
93
|
+
policy: "allow",
|
|
94
|
+
scope: "lsp",
|
|
95
|
+
...(this.origin
|
|
96
|
+
? {
|
|
97
|
+
pluginId: this.pluginId,
|
|
98
|
+
pluginVersion: this.pluginVersion,
|
|
99
|
+
pluginSource: this.pluginSource,
|
|
100
|
+
}
|
|
101
|
+
: {}),
|
|
83
102
|
});
|
|
84
103
|
|
|
85
104
|
this._child.on("error", (err) => {
|
|
@@ -239,6 +239,10 @@ export class LSPManager {
|
|
|
239
239
|
command: resolved.command,
|
|
240
240
|
args: resolved.args,
|
|
241
241
|
rootPath: projectRoot,
|
|
242
|
+
origin: resolved.origin,
|
|
243
|
+
pluginId: resolved.pluginId,
|
|
244
|
+
pluginVersion: resolved.pluginVersion,
|
|
245
|
+
pluginSource: resolved.pluginSource,
|
|
242
246
|
});
|
|
243
247
|
// Collect pushed diagnostics keyed by document, tracking publish count/time
|
|
244
248
|
// so callers can wait for the project to load (first publish) and settle
|
|
@@ -14,11 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
import fs from "fs";
|
|
16
16
|
import path from "path";
|
|
17
|
-
import { execFileSync } from "child_process";
|
|
18
17
|
|
|
19
18
|
export const _deps = {
|
|
20
19
|
existsSync: fs.existsSync,
|
|
21
|
-
execFileSync,
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
// Extension → LSP languageId. Kept small and explicit; unknown extensions get
|
|
@@ -95,6 +93,9 @@ export function registerLanguageServer(def) {
|
|
|
95
93
|
bins: [def.command],
|
|
96
94
|
argsFor: () => (Array.isArray(def.args) ? def.args : []),
|
|
97
95
|
fromPlugin: true,
|
|
96
|
+
pluginId: def.pluginId || null,
|
|
97
|
+
pluginVersion: def.pluginVersion || null,
|
|
98
|
+
pluginSource: def.pluginSource || null,
|
|
98
99
|
};
|
|
99
100
|
const existing = pluginServers.get(def.languageId) || [];
|
|
100
101
|
// De-dupe by server id so re-registering the same server (e.g. a reload)
|
|
@@ -147,6 +148,14 @@ export function resolveServer(languageId, projectRoot) {
|
|
|
147
148
|
id: def.id,
|
|
148
149
|
command,
|
|
149
150
|
args: def.argsFor(bin),
|
|
151
|
+
...(def.fromPlugin
|
|
152
|
+
? {
|
|
153
|
+
origin: "plugin:lsp",
|
|
154
|
+
pluginId: def.pluginId,
|
|
155
|
+
pluginVersion: def.pluginVersion,
|
|
156
|
+
pluginSource: def.pluginSource,
|
|
157
|
+
}
|
|
158
|
+
: {}),
|
|
150
159
|
};
|
|
151
160
|
}
|
|
152
161
|
}
|
package/src/lib/mcp-oauth.js
CHANGED
|
@@ -25,7 +25,7 @@ import pathDefault from "node:path";
|
|
|
25
25
|
import { homedir as homedirDefault } from "node:os";
|
|
26
26
|
import crypto from "node:crypto";
|
|
27
27
|
import http from "node:http";
|
|
28
|
-
import {
|
|
28
|
+
import { executionBroker } from "./process-execution-broker/index.js";
|
|
29
29
|
|
|
30
30
|
export const _deps = {
|
|
31
31
|
fetch: (...a) => globalThis.fetch(...a),
|
|
@@ -35,7 +35,13 @@ export const _deps = {
|
|
|
35
35
|
sha256: (s) => crypto.createHash("sha256").update(s).digest(),
|
|
36
36
|
createServer: (h) => http.createServer(h),
|
|
37
37
|
openBrowser: defaultOpenBrowser,
|
|
38
|
-
spawn: (
|
|
38
|
+
spawn: (command, args, options) =>
|
|
39
|
+
executionBroker.spawn(command, args, {
|
|
40
|
+
...options,
|
|
41
|
+
origin: "mcp:oauth-browser",
|
|
42
|
+
policy: "allow",
|
|
43
|
+
scope: "oauth",
|
|
44
|
+
}),
|
|
39
45
|
now: () => Date.now(),
|
|
40
46
|
// Backoff sleep seam (tests override with a no-op so the retry doesn't wait).
|
|
41
47
|
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolve npm without asking a shell to interpret the platform shim.
|
|
5
|
+
*
|
|
6
|
+
* Windows npm installations expose `npm.cmd`, but Node cannot execute a CMD
|
|
7
|
+
* shim with `shell:false` (`spawnSync npm.cmd EINVAL`). The shim delegates to
|
|
8
|
+
* the npm CLI located beside node.exe, so invoke that JavaScript entrypoint
|
|
9
|
+
* through the current Node executable instead.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveNpmInvocation({
|
|
12
|
+
platform = process.platform,
|
|
13
|
+
execPath = process.execPath,
|
|
14
|
+
} = {}) {
|
|
15
|
+
if (platform !== "win32") {
|
|
16
|
+
return { command: "npm", prefixArgs: [] };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const npmCliPath = path.win32.join(
|
|
20
|
+
path.win32.dirname(execPath),
|
|
21
|
+
"node_modules",
|
|
22
|
+
"npm",
|
|
23
|
+
"bin",
|
|
24
|
+
"npm-cli.js",
|
|
25
|
+
);
|
|
26
|
+
return { command: execPath, prefixArgs: [npmCliPath] };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default resolveNpmInvocation;
|
package/src/lib/orchestrator.js
CHANGED
|
@@ -22,15 +22,17 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { EventEmitter } from "events";
|
|
25
|
-
import { execSync } from "child_process";
|
|
26
25
|
import crypto from "crypto";
|
|
27
26
|
import { AgentRouter } from "./agent-router.js";
|
|
28
27
|
import { NotificationManager } from "./notifiers/index.js";
|
|
29
28
|
import { createChatFn } from "./cowork-adapter.js";
|
|
30
29
|
import { firstBalancedJson } from "./json-schema-output.js";
|
|
30
|
+
import executionBroker from "./process-execution-broker/index.js";
|
|
31
31
|
|
|
32
32
|
/* ---------- _deps injection (Vitest CJS mock pattern) ---------- */
|
|
33
|
-
export const _deps = {
|
|
33
|
+
export const _deps = {
|
|
34
|
+
execSync: (...args) => executionBroker.execSync(...args),
|
|
35
|
+
};
|
|
34
36
|
|
|
35
37
|
// ─── Task statuses ────────────────────────────────────────────────
|
|
36
38
|
export const TASK_STATUS = {
|
|
@@ -389,6 +391,10 @@ export class Orchestrator extends EventEmitter {
|
|
|
389
391
|
// re-dispatch). Give CI output generous headroom.
|
|
390
392
|
maxBuffer: 64 * 1024 * 1024,
|
|
391
393
|
stdio: "pipe",
|
|
394
|
+
origin: "orchestrator:ci",
|
|
395
|
+
policy: "allow",
|
|
396
|
+
scope: "orchestrator",
|
|
397
|
+
shell: true,
|
|
392
398
|
});
|
|
393
399
|
return {
|
|
394
400
|
pass: true,
|
|
@@ -27,7 +27,11 @@
|
|
|
27
27
|
import fs from "node:fs";
|
|
28
28
|
import os from "node:os";
|
|
29
29
|
import path from "node:path";
|
|
30
|
-
import
|
|
30
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
31
|
+
|
|
32
|
+
export const _deps = {
|
|
33
|
+
spawn: (...args) => executionBroker.spawn(...args),
|
|
34
|
+
};
|
|
31
35
|
|
|
32
36
|
/**
|
|
33
37
|
* @param {object} ctx
|
|
@@ -55,7 +59,7 @@ export async function scheduleReplace(ctx) {
|
|
|
55
59
|
dryRun = false,
|
|
56
60
|
platform = process.platform === "win32" ? "win32" : "posix",
|
|
57
61
|
parentPid = process.pid,
|
|
58
|
-
spawnImpl = spawn,
|
|
62
|
+
spawnImpl = _deps.spawn,
|
|
59
63
|
} = ctx;
|
|
60
64
|
|
|
61
65
|
if (!newExePath || typeof newExePath !== "string") {
|
|
@@ -92,6 +96,10 @@ export async function scheduleReplace(ctx) {
|
|
|
92
96
|
// Detach so the sidecar survives our process exit. `windowsHide: true`
|
|
93
97
|
// keeps the cmd window from flashing — the replace itself is silent.
|
|
94
98
|
const child = spawnImpl("cmd.exe", ["/c", sidecarPath], {
|
|
99
|
+
origin: "packer:update-sidecar",
|
|
100
|
+
scope: "pack-update",
|
|
101
|
+
policy: "allow",
|
|
102
|
+
shell: false,
|
|
95
103
|
detached: true,
|
|
96
104
|
stdio: "ignore",
|
|
97
105
|
windowsHide: true,
|
|
@@ -123,6 +131,10 @@ export async function scheduleReplace(ctx) {
|
|
|
123
131
|
|
|
124
132
|
if (restart) {
|
|
125
133
|
const child = spawnImpl(targetExePath, process.argv.slice(2), {
|
|
134
|
+
origin: "packer:update-restart",
|
|
135
|
+
scope: "pack-update",
|
|
136
|
+
policy: "allow",
|
|
137
|
+
shell: false,
|
|
126
138
|
detached: true,
|
|
127
139
|
stdio: "ignore",
|
|
128
140
|
});
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
import fs from "node:fs";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
|
-
import { spawnSync } from "node:child_process";
|
|
18
17
|
import { PackError, EXIT } from "./errors.js";
|
|
18
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
19
|
+
|
|
20
|
+
export const _deps = {
|
|
21
|
+
spawnSync: (...args) => executionBroker.spawnSync(...args),
|
|
22
|
+
};
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* @param {object} ctx
|
|
@@ -47,12 +51,19 @@ export function runPkg(ctx) {
|
|
|
47
51
|
];
|
|
48
52
|
|
|
49
53
|
log(` [pkg] Running: ${pkgBin.runtime} ${args.join(" ")}`);
|
|
50
|
-
const res = spawnSync(pkgBin.runtime, args, {
|
|
54
|
+
const res = _deps.spawnSync(pkgBin.runtime, args, {
|
|
55
|
+
origin: "packer:pkg",
|
|
56
|
+
scope: "pack",
|
|
57
|
+
policy: "allow",
|
|
58
|
+
shell: false,
|
|
51
59
|
cwd: path.dirname(pkgConfigFile),
|
|
52
60
|
stdio: "inherit",
|
|
53
61
|
windowsHide: true,
|
|
54
62
|
});
|
|
55
63
|
|
|
64
|
+
if (res.error) {
|
|
65
|
+
throw new PackError(`Failed to start pkg: ${res.error.message}`, EXIT.PKG);
|
|
66
|
+
}
|
|
56
67
|
if (res.status !== 0) {
|
|
57
68
|
throw new PackError(
|
|
58
69
|
`pkg exited with code ${res.status}. See output above for details.`,
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import { execSync } from "node:child_process";
|
|
9
8
|
import { fileURLToPath } from "node:url";
|
|
10
9
|
import { PackError, EXIT } from "./errors.js";
|
|
10
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
11
|
+
|
|
12
|
+
export const _deps = {
|
|
13
|
+
execFileSync: (...args) => executionBroker.execFileSync(...args),
|
|
14
|
+
};
|
|
11
15
|
|
|
12
16
|
const WINDOWS_RESERVED = new Set([
|
|
13
17
|
"CON",
|
|
@@ -139,22 +143,35 @@ export function precheck(ctx) {
|
|
|
139
143
|
let gitCommit = null;
|
|
140
144
|
let dirty = false;
|
|
141
145
|
let repoRoot = null;
|
|
146
|
+
const gitOptions = (cwd) => ({
|
|
147
|
+
origin: "packer:precheck-git",
|
|
148
|
+
scope: "pack",
|
|
149
|
+
policy: "allow",
|
|
150
|
+
shell: false,
|
|
151
|
+
cwd,
|
|
152
|
+
encoding: "utf-8",
|
|
153
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
154
|
+
});
|
|
142
155
|
try {
|
|
143
|
-
repoRoot =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
repoRoot = _deps
|
|
157
|
+
.execFileSync(
|
|
158
|
+
"git",
|
|
159
|
+
["rev-parse", "--show-toplevel"],
|
|
160
|
+
gitOptions(projectRoot),
|
|
161
|
+
)
|
|
162
|
+
.trim();
|
|
163
|
+
gitCommit = _deps
|
|
164
|
+
.execFileSync(
|
|
165
|
+
"git",
|
|
166
|
+
["rev-parse", "--short", "HEAD"],
|
|
167
|
+
gitOptions(repoRoot),
|
|
168
|
+
)
|
|
169
|
+
.trim();
|
|
170
|
+
const status = _deps.execFileSync(
|
|
171
|
+
"git",
|
|
172
|
+
["status", "--porcelain"],
|
|
173
|
+
gitOptions(repoRoot),
|
|
174
|
+
);
|
|
158
175
|
dirty = status.trim().length > 0;
|
|
159
176
|
} catch (_e) {
|
|
160
177
|
// Not a git repo — fine, leave the metadata null
|
|
@@ -19,11 +19,15 @@
|
|
|
19
19
|
* Called from `runPack()` as Phase 8 when `cliOpts.smokeTest !== false`.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { spawn } from "node:child_process";
|
|
23
22
|
import { createConnection } from "node:net";
|
|
24
23
|
import http from "node:http";
|
|
25
24
|
import path from "node:path";
|
|
26
25
|
import { PackError, EXIT } from "./errors.js";
|
|
26
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
27
|
+
|
|
28
|
+
export const _deps = {
|
|
29
|
+
spawn: (...args) => executionBroker.spawn(...args),
|
|
30
|
+
};
|
|
27
31
|
|
|
28
32
|
const DEFAULT_BOOT_TIMEOUT_MS = 45_000;
|
|
29
33
|
const DEFAULT_PROBE_TIMEOUT_MS = 5_000;
|
|
@@ -80,7 +84,10 @@ export async function smokeTestExe(ctx) {
|
|
|
80
84
|
// artifacts are always .exe so this only kicks in during tests that use
|
|
81
85
|
// a shim — kept here so the smoke-runner is self-testable.
|
|
82
86
|
const needsShell = /\.(cmd|bat|sh)$/i.test(exePath);
|
|
83
|
-
const child = spawn(exePath, ["ui", "--no-open"], {
|
|
87
|
+
const child = _deps.spawn(exePath, ["ui", "--no-open"], {
|
|
88
|
+
origin: "packer:smoke-launch",
|
|
89
|
+
scope: "pack",
|
|
90
|
+
policy: "allow",
|
|
84
91
|
env,
|
|
85
92
|
stdio: ["ignore", "pipe", "pipe"],
|
|
86
93
|
windowsHide: true,
|
|
@@ -116,9 +123,15 @@ export async function smokeTestExe(ctx) {
|
|
|
116
123
|
// unrelated process tree that inherited the number (on CI: another
|
|
117
124
|
// vitest worker or a test's helper child).
|
|
118
125
|
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
_deps
|
|
127
|
+
.spawn("taskkill", ["/F", "/T", "/PID", String(child.pid)], {
|
|
128
|
+
origin: "packer:smoke-taskkill",
|
|
129
|
+
scope: "pack",
|
|
130
|
+
policy: "allow",
|
|
131
|
+
shell: false,
|
|
132
|
+
stdio: "ignore",
|
|
133
|
+
})
|
|
134
|
+
.unref();
|
|
122
135
|
} else if (child.pid) {
|
|
123
136
|
// Negative pid → the whole process group from the detached spawn above,
|
|
124
137
|
// so a shell:true wrapper's exec'd/forked `node` grandchild dies too
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
|
-
import { spawnSync } from "node:child_process";
|
|
14
13
|
import { PackError, EXIT } from "./errors.js";
|
|
14
|
+
import executionBroker from "../process-execution-broker/index.js";
|
|
15
|
+
|
|
16
|
+
export const _deps = {
|
|
17
|
+
spawnSync: (...args) => executionBroker.spawnSync(...args),
|
|
18
|
+
};
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* @param {object} ctx
|
|
@@ -50,11 +54,21 @@ export function ensureWebPanel(ctx) {
|
|
|
50
54
|
if (needsBuild) {
|
|
51
55
|
log(" [web-panel] Building Vue panel via 'npm run build:web-panel'...");
|
|
52
56
|
const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
53
|
-
const res = spawnSync(npmCmd, ["run", "build:web-panel"], {
|
|
57
|
+
const res = _deps.spawnSync(npmCmd, ["run", "build:web-panel"], {
|
|
58
|
+
origin: "packer:web-panel-build",
|
|
59
|
+
scope: "pack",
|
|
60
|
+
policy: "allow",
|
|
61
|
+
shell: false,
|
|
54
62
|
cwd: cliRoot,
|
|
55
63
|
stdio: "inherit",
|
|
56
64
|
windowsHide: true,
|
|
57
65
|
});
|
|
66
|
+
if (res.error) {
|
|
67
|
+
throw new PackError(
|
|
68
|
+
`Failed to start 'npm run build:web-panel': ${res.error.message}`,
|
|
69
|
+
EXIT.WEB_PANEL,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
58
72
|
if (res.status !== 0) {
|
|
59
73
|
throw new PackError(
|
|
60
74
|
`'npm run build:web-panel' exited with code ${res.status}`,
|
package/src/lib/paths.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CONFIG_DIR_NAME } from "../constants.js";
|
|
|
5
5
|
import { getPlatform } from "./platform.js";
|
|
6
6
|
|
|
7
7
|
export function getHomeDir() {
|
|
8
|
-
return join(homedir(), CONFIG_DIR_NAME);
|
|
8
|
+
return process.env.CHAINLESSCHAIN_HOME || join(homedir(), CONFIG_DIR_NAME);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function getBinDir() {
|
|
@@ -61,7 +61,7 @@ const TOOL_GROUPS = Object.freeze({
|
|
|
61
61
|
grep: ["search_files"],
|
|
62
62
|
glob: ["search_files"],
|
|
63
63
|
write: ["write_file"],
|
|
64
|
-
edit: ["edit_file", "edit_file_hashed"],
|
|
64
|
+
edit: ["edit_file", "edit_file_hashed", "delete_file", "move_file"],
|
|
65
65
|
webfetch: ["web_fetch"],
|
|
66
66
|
websearch: ["web_search"],
|
|
67
67
|
task: ["spawn_sub_agent"],
|
|
@@ -82,6 +82,8 @@ const PATH_TOOLS = new Set([
|
|
|
82
82
|
"write_file",
|
|
83
83
|
"edit_file",
|
|
84
84
|
"edit_file_hashed",
|
|
85
|
+
"delete_file",
|
|
86
|
+
"move_file",
|
|
85
87
|
]);
|
|
86
88
|
/** Tools whose match target is a URL. */
|
|
87
89
|
const URL_TOOLS = new Set(["web_fetch"]);
|
|
@@ -354,6 +356,8 @@ const SUGGEST_UMBRELLA = Object.freeze({
|
|
|
354
356
|
write_file: "Write",
|
|
355
357
|
edit_file: "Edit",
|
|
356
358
|
edit_file_hashed: "Edit",
|
|
359
|
+
delete_file: "Edit",
|
|
360
|
+
move_file: "Edit",
|
|
357
361
|
web_fetch: "WebFetch",
|
|
358
362
|
web_search: "WebSearch",
|
|
359
363
|
spawn_sub_agent: "Task",
|