chainlesschain 0.162.188 → 0.162.193
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/README.md +61 -11
- package/bin/chainlesschain.js +7 -52
- package/completions/_cc +209 -0
- package/completions/cc.bash +18 -0
- package/completions/cc.fish +13 -0
- package/completions/cc.ps1 +226 -0
- package/package.json +10 -2
- package/src/assets/web-panel/assets/{AIOps-Brr1LVcE.js → AIOps-DBLkaTje.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DQU74DKG.js → ActionButton-BAy-Qebo.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-CYp9178y.js → Analytics-Dfb1Mlau.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-DW4SCYsW.js → AppLayout-BbFkN8m0.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-CYlD_ed1.js → Artifacts-kM4-cEEH.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-CWl1rZOi.js → Audit-BSQfYWf3.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-BOR-LPsa.js → BackgroundAgents-CWDbI_fG.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-DLpG7j1X.js → Backup-BxLPbq_Q.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-B35K9wdr.js → BaseInput-DuIbdrp6.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-CwUJb9gB.js → Chat-NEmjGahU.js} +5 -5
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-1v6aMS1m.js → ChatBubbleRenderer-DfJEo-5_.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-pi3-tPNW.js → Checkbox-CaoeG3Ns.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-FyNF35eL.js → Codegen-BFf_g3xY.js} +1 -1
- package/src/assets/web-panel/assets/{Col-tGt_JDEr.js → Col-CNOd8mdQ.js} +1 -1
- package/src/assets/web-panel/assets/{Community-CC7LonQX.js → Community-BhpDqz-i.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BGXrHHjE.js → Compact-CQ42T7Z6.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-DSW0TBZ8.js → Compliance-DI5PcLMN.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-Bhk7rbvE.js → Cowork-wYYZe0wR.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-DxyiQ2NZ.js → Cron-Dlq03DD_.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-B2ZkxHok.js → Crosschain-BzqS8PP3.js} +1 -1
- package/src/assets/web-panel/assets/{DID-yOJV99eJ.js → DID-It55Yem7.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-CKsttz7D.js → Dashboard-9HkH6oxn.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-CVFldXSL.js → Dropdown-00e2YWRB.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-Bufv638J.js → EmailListRenderer-By-ugRDL.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-4ncjoIjL.js → FamilyGuardDashboard-C396yu5m.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DsknEDoX.js → Federation-BME5sbZY.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-Cqe5jWXA.js → FormItemContext-B4TEZCr-.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-NAJaFKxc.js → GenericCardRenderer-_9CX9ieY.js} +1 -1
- package/src/assets/web-panel/assets/{Git-CszKQpnl.js → Git-BrS6WVSr.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-BXGodXi6.js → Governance-BMdCWnKF.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CkoYuG2c.js → Inference-Bcp3vzcA.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DFlEr_T0.js → KnowledgeGraph-DlLuqGY5.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CVaENddA.js → Logs-D-W_6x09.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-DElGPxCZ.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-CDlLT0fw.js → Marketplace-Dzn2guvI.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DdwOyszN.js → McpTools-uPict-KL.js} +6 -6
- package/src/assets/web-panel/assets/{Memory-DKQnkKuG.js → Memory-BCw43kOb.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-DGseqlzJ.js → MobileBridge-DmV8Wv7F.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-COBbEOlj.js → MobileProjects-C-HaCmSM.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-O61Vwyli.js → Mtc-C6jxJ34Y.js} +5 -5
- package/src/assets/web-panel/assets/{MtcAudit-Dw2SyasS.js → MtcAudit-Za8ExwhQ.js} +5 -5
- package/src/assets/web-panel/assets/{Multisig-hSu_l8kf.js → Multisig-KKDbuEgb.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-CX1Epurr.js → NLProgramming-Dj97zbCk.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-R9xX8o8_.js → Notes-DBXvMraU.js} +4 -4
- package/src/assets/web-panel/assets/{NotificationSettings-jtSNLCuK.js → NotificationSettings-DOxITLYl.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-7DVjZwMM.js +1 -0
- package/src/assets/web-panel/assets/{Organization-Pu2WO-U3.js → Organization-D1i73mjb.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-BjnqUyFp.js → Overflow-kW6Q3rvg.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-jjkvz44c.js → P2P-C-v_8p2v.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-tUbbY64W.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-D4yDpivd.js → Permissions-DkHxEZ58.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-0qsL6iH1.js → PersonalDataHub-DWuMPGrK.js} +5 -5
- package/src/assets/web-panel/assets/{Pipeline-Cx7Ybrk2.js → Pipeline-30IYXWWm.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-PbfR_M_V.js → Privacy-DZNQ4RrH.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CyV6Gsub.js → ProjectInit-De2MCElf.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-C7KZ2Wdk.js → ProjectSettings-5uHk9wsC.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-DQDjO-yK.js → Projects-XjDfrFLb.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-DyFVBBMX.js → Providers-Bgwj6gcE.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-CzB1BC9_.js → QrScannerModal-gKql9umv.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-Bk636mC1.js → QuickAsk-BWvmwkh7.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-DoWxHIT3.js → Recommend-Uok4hZPd.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-oOVIv9wq.js → RemoteSession-DLJzTk9a.js} +3 -3
- package/src/assets/web-panel/assets/{Reputation-BucoReGG.js → Reputation-ZVwIPMSO.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DzmOdJU7.js → Row-CN04HxWR.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-C1tK7KGU.js → RssFeed-BdSrEG4g.js} +3 -3
- package/src/assets/web-panel/assets/{Search-CSnInOqk.js → Search-5PwVd0IR.js} +1 -1
- package/src/assets/web-panel/assets/{Security-dlejr15l.js → Security-DdBo4zjN.js} +3 -3
- package/src/assets/web-panel/assets/{Services-BioPZuNh.js → Services-D3letU7M.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DWMibwpC.js → Skeleton--Jb83f1v.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-BAAnx1B2.js → Skills-Bg-CulHX.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-jWNp4hNO.js → Sla-7QOa7S-X.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-y5kqKha-.js → SpeechSettings-DQwppjRw.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-B9GNsc3e.js → SyncSettings-dNPQGL-s.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-BDBYKRen.js → Tasks-Ggs-Z48q.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-DRiE5eaN.js → Templates-78TYHgRO.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-BGlAvExF.js → Tenant-xHwwv9vO.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-B8uzrbNY.js → Terminal-BJXSJfm4.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-Df48iveY.js → TimelineRenderer-fLbjRhJw.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-CcmHndN6.js → Tokens-oMSBSBmB.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DPkWxmQ2.js → Trigger-CfnY_wX_.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-DTb5a5AV.js → Trust-AdyTgYKO.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-CBmg5vch.js → UkeySign-C5K_81dS.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-B0mZrz4O.js → VideoEditing-vcGVDqki.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-Bxs7_mpd.js → Wallet-hhOc3hlY.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-C8x3cMxU.js → WebAuthn-CVloC11s.js} +3 -3
- package/src/assets/web-panel/assets/{WorkflowEditor-DPrNznrP.js → WorkflowEditor-CYeE32R5.js} +1 -1
- package/src/assets/web-panel/assets/{chat-D3bYWu7S.js → chat-CNROR5bN.js} +1 -1
- package/src/assets/web-panel/assets/{colors-DY-PwMu4.js → colors-Cjx-cnwU.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-LDk10Kw6.js → compact-item-DOIfelvD.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-C-2MZnFq.js → createContext-DfA7UZ8u.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-ChcCBGs7.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-BQIBjcnB.js → hasIn-BMSCzcfM.js} +1 -1
- package/src/assets/web-panel/assets/{index-CQVb2dWp.js → index-5-HXgOX5.js} +1 -1
- package/src/assets/web-panel/assets/{index-BdXnYMCZ.js → index-AWg-0M1S.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cx6D_dx2.js → index-B4iYzpkL.js} +1 -1
- package/src/assets/web-panel/assets/{index-_HRO_cIu.js → index-B5Udeb_6.js} +1 -1
- package/src/assets/web-panel/assets/{index-DlRYqt3S.js → index-B7gf77CJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BrnRO9yE.js → index-BEMwBBHk.js} +1 -1
- package/src/assets/web-panel/assets/{index-VCh5zNJo.js → index-BM1y_9hM.js} +1 -1
- package/src/assets/web-panel/assets/{index-BRI3ngNg.js → index-BUonmKSE.js} +1 -1
- package/src/assets/web-panel/assets/{index-C3GNvExG.js → index-BbQ2eQ8H.js} +1 -1
- package/src/assets/web-panel/assets/{index-DSvo_bp0.js → index-BemJ2u_E.js} +1 -1
- package/src/assets/web-panel/assets/{index-L6qixyLc.js → index-BolaOQxx.js} +1 -1
- package/src/assets/web-panel/assets/{index-BI4KgcYC.js → index-BxOk9vkG.js} +1 -1
- package/src/assets/web-panel/assets/{index-CY4KnaO9.js → index-By61ojUx.js} +1 -1
- package/src/assets/web-panel/assets/{index-L3smcoQX.js → index-C2K9SNVX.js} +1 -1
- package/src/assets/web-panel/assets/{index-BX2b9Orc.js → index-C3L5gdiD.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cz4b6Z_7.js → index-C7xn0Nub.js} +1 -1
- package/src/assets/web-panel/assets/{index-COG61sRv.js → index-CAnvhwg6.js} +1 -1
- package/src/assets/web-panel/assets/{index-C7FC8cP2.js → index-CEKMcOyU.js} +1 -1
- package/src/assets/web-panel/assets/{index-BN-xdSWZ.js → index-CNC5onm4.js} +1 -1
- package/src/assets/web-panel/assets/{index-DY2FIrmz.js → index-CVL27kXC.js} +1 -1
- package/src/assets/web-panel/assets/{index-CiTvBAr-.js → index-CVm1_i3t.js} +1 -1
- package/src/assets/web-panel/assets/{index-DhRt9cYJ.js → index-CdYBye8B.js} +1 -1
- package/src/assets/web-panel/assets/{index-B5pgtZnY.js → index-ClNMrqEY.js} +1 -1
- package/src/assets/web-panel/assets/{index-7xKu7Fns.js → index-Cs6l7uRu.js} +1 -1
- package/src/assets/web-panel/assets/{index-D4K1weKc.js → index-CshQbilz.js} +1 -1
- package/src/assets/web-panel/assets/{index-k7C_oDCO.js → index-Cyweh0Hy.js} +1 -1
- package/src/assets/web-panel/assets/{index-D3Oq-DLL.js → index-DBpWXFed.js} +3 -3
- package/src/assets/web-panel/assets/{index-DYyLJPlF.js → index-DHtpHZAQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dh-tkpKQ.js → index-DLmn0BoK.js} +1 -1
- package/src/assets/web-panel/assets/{index-8JC9BJa1.js → index-DPAWBrMf.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dd2Km97U.js → index-DjEsxO5h.js} +1 -1
- package/src/assets/web-panel/assets/{index-KFZO_lcx.js → index-FBc_CJBd.js} +1 -1
- package/src/assets/web-panel/assets/{index-DTIZpPtG.js → index-Icdoqmzt.js} +1 -1
- package/src/assets/web-panel/assets/index-Q2IajL54.js +1 -0
- package/src/assets/web-panel/assets/index-bRkHgOMc.js +1 -0
- package/src/assets/web-panel/assets/{index-lmm9p-jm.js → index-dCd8cSUq.js} +1 -1
- package/src/assets/web-panel/assets/{index-HasPt4-h.js → index-m2vG9gG_.js} +1 -1
- package/src/assets/web-panel/assets/{index-CaslYch6.js → index-mTpHoEzr.js} +1 -1
- package/src/assets/web-panel/assets/{index-CbR6ROOa.js → index-ti_lnTWl.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-zQPSHf2C.js → initDefaultProps-Bu8k7H1Y.js} +1 -1
- package/src/assets/web-panel/assets/{motion-CKCStGVk.js → motion-s3iVK41k.js} +1 -1
- package/src/assets/web-panel/assets/{move-BufVDGYF.js → move-B6B-E5Jz.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DcaFxy5D.js → mtc-parser-BiYgTidA.js} +1 -1
- package/src/assets/web-panel/assets/{omit-EScpkGdo.js → omit-pU1RdUDA.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-72hG_qfT.js → pickAttrs-Cdoq_SeM.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CMFWiH20.js → placementArrow-DIuvAn2K.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DKQHS41p.js → responsiveObserve-8w16YR2D.js} +1 -1
- package/src/assets/web-panel/assets/{slide-QVAFHTIQ.js → slide-VZ01cZe3.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-DIz38e2G.js → statusUtils-lh8YMN8Z.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-zK5cyLby.js → styleChecker-CmDyreec.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DhZngk62.js → useFlexGapSupport-hiJWMU5y.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-BvV2cvkg.js → useFs-Thnu-Iaj.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CRmxb9l3.js → usePersonalDataHub-LBdOxjwY.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CgQIbobP.js → vnode-Cg6lFY_X.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-D4XrrO0R.js → zoom-DVfsR1YO.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/cli-help.js +181 -0
- package/src/command-help-index.json +181 -0
- package/src/command-manifest.json +1107 -175
- package/src/command-surface-policy.js +197 -0
- package/src/commands/agent.js +98 -33
- package/src/commands/artifacts.js +400 -2
- package/src/commands/background-session.js +41 -3
- package/src/commands/checkpoint-managed.js +1059 -0
- package/src/commands/checkpoint-restore-recovery.js +1476 -0
- package/src/commands/checkpoint.js +950 -22
- package/src/commands/compact.js +101 -25
- package/src/commands/config.js +506 -20
- package/src/commands/doctor.js +4 -1
- package/src/commands/hub.js +1 -1
- package/src/commands/mcp.js +688 -24
- package/src/commands/pack.js +16 -2
- package/src/commands/plugin.js +20 -12
- package/src/commands/session-mcp-recovery.js +218 -0
- package/src/commands/session.js +470 -110
- package/src/commands/setup.js +36 -10
- package/src/commands/skill.js +181 -110
- package/src/commands/status.js +21 -5
- package/src/commands/team-distributed.js +3324 -0
- package/src/commands/team.js +1130 -74
- package/src/commands/update.js +68 -6
- package/src/constants.js +11 -0
- package/src/data/changelog.json +26 -0
- package/src/gateways/ws/action-protocol.js +10 -0
- package/src/gateways/ws/session-protocol.js +555 -27
- package/src/gateways/ws/ws-agent-handler.js +541 -14
- package/src/gateways/ws/ws-session-gateway.js +129 -22
- package/src/gateways/ws/ws-session-state.js +431 -0
- package/src/harness/background-task-manager.js +233 -36
- package/src/harness/jsonl-session-store.js +2551 -167
- package/src/harness/mcp-client.js +802 -61
- package/src/harness/prompt-compressor.js +227 -27
- package/src/harness/session-index.js +89 -38
- package/src/harness/session-list-index.js +254 -0
- package/src/harness/structured-handoff.js +410 -0
- package/src/lazy-dispatch.js +747 -84
- package/src/lib/__tests__/logger.test.js +50 -2
- package/src/lib/advisor-runtime.js +1047 -0
- package/src/lib/agent-core.js +2 -0
- package/src/lib/agent-sandbox.js +120 -26
- package/src/lib/agent-session-export.js +20 -0
- package/src/lib/agent-team/task-lease.js +271 -3
- package/src/lib/agent-team/team-adjudication.js +1501 -0
- package/src/lib/agent-team/team-budget.js +4 -1
- package/src/lib/agent-team/team-control-store.js +582 -0
- package/src/lib/agent-team/team-distributed-queue.js +5246 -0
- package/src/lib/agent-team/team-process-checkpoint.js +211 -0
- package/src/lib/agent-team/team-runner.js +543 -24
- package/src/lib/agent-team/team-worktree.js +1403 -95
- package/src/lib/artifact-store.js +131 -8
- package/src/lib/background-agent-supervisor.js +185 -13
- package/src/lib/background-interaction-journal.js +37 -9
- package/src/lib/background-launch-profile.js +1058 -0
- package/src/lib/checkpoint-restore-already-completed-controller.js +902 -0
- package/src/lib/checkpoint-restore-orchestrator.js +987 -0
- package/src/lib/checkpoint-restore-partial-rollback-controller.js +1953 -0
- package/src/lib/checkpoint-restore-recovery-controller.js +689 -0
- package/src/lib/checkpoint-restore-recovery.js +884 -0
- package/src/lib/checkpoint-restore-retention.js +126 -0
- package/src/lib/checkpoint-restore-saga.js +5079 -0
- package/src/lib/checkpoint-restore-session-recovery.js +1178 -0
- package/src/lib/checkpoint-restore-workspace-target-verifier.js +270 -0
- package/src/lib/checkpoint-store.js +1688 -97
- package/src/lib/checkpoint-timeline-authority.js +522 -0
- package/src/lib/checkpoint-timeline.js +642 -0
- package/src/lib/config-keys.js +18 -119
- package/src/lib/config-manager.js +446 -27
- package/src/lib/config-redaction.js +57 -0
- package/src/lib/config-schema.js +853 -0
- package/src/lib/cowork-mcp-tools.js +5 -0
- package/src/lib/cowork-task-runner.js +458 -63
- package/src/lib/delivery-coordinator.js +1234 -0
- package/src/lib/delivery-evidence.js +450 -0
- package/src/lib/doctor-checkup.js +199 -14
- package/src/lib/executable-path.js +34 -0
- package/src/lib/fatal-handler.js +16 -0
- package/src/lib/file-checkpoint.js +4909 -186
- package/src/lib/file-lines.js +125 -0
- package/src/lib/headless-config-command.js +16 -5
- package/src/lib/hook-runner.cjs +139 -38
- package/src/lib/hooks-v2-workspace-context.js +10 -0
- package/src/lib/impacted-gate-selector.js +424 -0
- package/src/lib/interaction-adapter.js +62 -0
- package/src/lib/jsonl-session-store.js +1 -35
- package/src/lib/logger.js +66 -14
- package/src/lib/managed-checkpoint-render.js +60 -0
- package/src/lib/managed-tool-checkpoint.js +194 -0
- package/src/lib/mcp-call-ledger-store.js +1069 -0
- package/src/lib/mcp-call-ledger.js +747 -0
- package/src/lib/mcp-client.js +5 -0
- package/src/lib/mcp-conflict-scheduler.js +468 -0
- package/src/lib/mcp-effect-contract.js +102 -0
- package/src/lib/mcp-headers-helper-trust.js +145 -0
- package/src/lib/mcp-headers-helper.js +616 -0
- package/src/lib/mcp-host-recovery-runtime.js +131 -0
- package/src/lib/mcp-ledger-recovery-admission.js +1065 -0
- package/src/lib/mcp-recovery-adjudication.js +443 -0
- package/src/lib/output-context.js +86 -0
- package/src/lib/packer/file-identity.js +170 -0
- package/src/lib/packer/index.js +3 -0
- package/src/lib/packer/native-update-state.js +277 -0
- package/src/lib/packer/pack-update-applier.js +1983 -136
- package/src/lib/packer/pack-update-checker.js +34 -0
- package/src/lib/packer/pack-update-downloader.js +875 -86
- package/src/lib/packer/pack-update-signature.js +86 -0
- package/src/lib/packer/pkg-config-generator.js +6 -0
- package/src/lib/paths.js +65 -10
- package/src/lib/plan-mode.js +831 -14
- package/src/lib/plan-persistence.js +540 -0
- package/src/lib/plugin-runtime/hooks.js +227 -69
- package/src/lib/plugin-runtime/plugin-options.js +189 -44
- package/src/lib/pr-automation-policy.js +146 -8
- package/src/lib/process-execution-broker/credential-agent.js +7 -0
- package/src/lib/process-execution-broker/index.js +491 -13
- package/src/lib/process-execution-broker/linux-generic-bwrap-runtime.js +28 -1
- package/src/lib/process-execution-broker/linux-generic-bwrap.js +28 -4
- package/src/lib/process-execution-broker/platform-sandbox.js +92 -70
- package/src/lib/process-execution-broker/windows-sandbox-helper.dll +0 -0
- package/src/lib/process-execution-broker/windows-sandbox-helper.exe +0 -0
- package/src/lib/process-execution-broker/windows-sandbox.cs +284 -19
- package/src/lib/process-execution-broker/workspace-transaction.js +4459 -0
- package/src/lib/project-instructions.js +165 -29
- package/src/lib/project-mcp-trust.js +67 -0
- package/src/lib/public-ide-capability-manifest.js +272 -0
- package/src/lib/public-ide-capability-validation.js +351 -0
- package/src/lib/secret-store.js +267 -43
- package/src/lib/secure-file-identity.js +433 -0
- package/src/lib/secure-fs.js +1089 -0
- package/src/lib/security-audit.js +58 -0
- package/src/lib/service-manager.js +34 -13
- package/src/lib/session-budget-runtime.js +1452 -0
- package/src/lib/session-host-snapshot.js +388 -0
- package/src/lib/session-message-provenance.js +429 -0
- package/src/lib/session-projection.js +804 -0
- package/src/lib/session-resource-budget.js +1495 -0
- package/src/lib/settings-hooks.cjs +138 -22
- package/src/lib/settings-loader.cjs +25 -2
- package/src/lib/side-effect-ledger-store.js +45 -23
- package/src/lib/skill-execution-identity.js +217 -0
- package/src/lib/skill-loader.js +299 -18
- package/src/lib/sub-agent-context.js +236 -28
- package/src/lib/sub-agent-registry.js +5 -0
- package/src/lib/subagent-contract.js +94 -0
- package/src/lib/todo-manager.js +185 -18
- package/src/lib/todo-persistence.js +417 -0
- package/src/lib/turn-binding-store.js +41 -23
- package/src/lib/turn-binding.js +160 -2
- package/src/lib/with-file-lock.js +165 -24
- package/src/lib/ws-chat-handler.js +21 -0
- package/src/program-base.js +18 -0
- package/src/repl/advisor-command.js +103 -0
- package/src/repl/agent-repl.js +2175 -146
- package/src/repl/btw-command.js +93 -10
- package/src/repl/clipboard-image.js +119 -0
- package/src/repl/config-summary.js +64 -108
- package/src/repl/prompt-editor.js +233 -0
- package/src/repl/prompt-interactions.js +344 -0
- package/src/repl/prompt-stash.js +354 -0
- package/src/repl/prompt-suggestions.js +312 -0
- package/src/repl/repl-keybindings.js +227 -0
- package/src/repl/session-recap.js +217 -0
- package/src/repl/slash-command-registry.js +22 -0
- package/src/repl/terminal-layout.js +88 -0
- package/src/runtime/agent-core.js +1630 -447
- package/src/runtime/coding-agent-contract-shared.cjs +13 -1
- package/src/runtime/coding-agent-managed-tool-policy.cjs +7 -2
- package/src/runtime/diagnostics.js +32 -13
- package/src/runtime/headless-runner.js +310 -118
- package/src/runtime/headless-stream.js +356 -95
- package/src/runtime/mcp-config.js +148 -14
- package/src/runtime/policies/agent-policy.js +14 -0
- package/src/runtime/status-diagnostics-lite.js +137 -0
- package/src/assets/web-panel/assets/MarkdownRenderer-7iWGwZ-r.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-BU2Yqq5H.js +0 -1
- package/src/assets/web-panel/assets/PdhVaultBrowser-69ca_WeR.js +0 -7
- package/src/assets/web-panel/assets/devWarning-B4dXIJqD.js +0 -1
- package/src/assets/web-panel/assets/index-C-C7DaG6.js +0 -1
- package/src/assets/web-panel/assets/index-DkfWzWtd.js +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable command-surface policy used by the manifest generator.
|
|
3
|
+
*
|
|
4
|
+
* Keep this module dependency-free: phase-0 help and manifest generation both
|
|
5
|
+
* consume it before the full Commander command graph is loaded.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const COMMAND_MANIFEST_SCHEMA = "chainlesschain.command-manifest.v3";
|
|
9
|
+
export const COMMAND_SURFACE_SCHEMA = "chainlesschain.command-surface.v2";
|
|
10
|
+
export const COMMAND_LIFECYCLE_SCHEMA = "chainlesschain.command-lifecycle.v1";
|
|
11
|
+
export const DEFAULT_COMMAND = "agent";
|
|
12
|
+
|
|
13
|
+
export const TOP_LEVEL_GROWTH_POLICY = Object.freeze({
|
|
14
|
+
baselineCommandCount: 175,
|
|
15
|
+
maximumNetGrowth: 0,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const COMMAND_NAMESPACES = Object.freeze([
|
|
19
|
+
Object.freeze({
|
|
20
|
+
name: "lab",
|
|
21
|
+
summary: "Compatibility namespace for long-tail and experimental commands",
|
|
22
|
+
visibility: "extended",
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
const MINIMUM_COMPATIBILITY_RELEASE_CYCLES = 2;
|
|
27
|
+
|
|
28
|
+
const COMMAND_MIGRATIONS = Object.freeze({
|
|
29
|
+
dao: Object.freeze({
|
|
30
|
+
namespace: "lab",
|
|
31
|
+
deprecatedSince: "0.162.189",
|
|
32
|
+
removalNotBefore: "0.164.0",
|
|
33
|
+
}),
|
|
34
|
+
evomap: Object.freeze({
|
|
35
|
+
namespace: "lab",
|
|
36
|
+
deprecatedSince: "0.162.189",
|
|
37
|
+
removalNotBefore: "0.164.0",
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const CORE_COMMAND_GROUPS = Object.freeze([
|
|
42
|
+
Object.freeze({
|
|
43
|
+
id: "code",
|
|
44
|
+
label: "Code",
|
|
45
|
+
commands: Object.freeze(["agent", "session", "skill"]),
|
|
46
|
+
}),
|
|
47
|
+
Object.freeze({
|
|
48
|
+
id: "integrations",
|
|
49
|
+
label: "Integrations",
|
|
50
|
+
commands: Object.freeze(["mcp", "plugin"]),
|
|
51
|
+
}),
|
|
52
|
+
Object.freeze({
|
|
53
|
+
id: "configuration",
|
|
54
|
+
label: "Configuration",
|
|
55
|
+
commands: Object.freeze(["config", "auth", "doctor", "status", "update"]),
|
|
56
|
+
}),
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
const CORE_GROUP_BY_COMMAND = new Map(
|
|
60
|
+
CORE_COMMAND_GROUPS.flatMap((group) =>
|
|
61
|
+
group.commands.map((command) => [command, group]),
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
function parseReleaseVersion(value, label) {
|
|
66
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(value);
|
|
67
|
+
if (!match) throw new Error(`${label} must be an exact semver release`);
|
|
68
|
+
return match.slice(1).map(Number);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function releaseCycleDistance(from, to) {
|
|
72
|
+
const [fromMajor, fromMinor] = parseReleaseVersion(from, "deprecatedSince");
|
|
73
|
+
const [toMajor, toMinor] = parseReleaseVersion(to, "removalNotBefore");
|
|
74
|
+
if (fromMajor !== toMajor) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
"command migration windows may not cross a major release boundary",
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return toMinor - fromMinor;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function lifecycleForCommand(commandName) {
|
|
83
|
+
const migration = COMMAND_MIGRATIONS[commandName];
|
|
84
|
+
if (!migration) return Object.freeze({ state: "active" });
|
|
85
|
+
|
|
86
|
+
const releaseCycles = releaseCycleDistance(
|
|
87
|
+
migration.deprecatedSince,
|
|
88
|
+
migration.removalNotBefore,
|
|
89
|
+
);
|
|
90
|
+
if (releaseCycles < MINIMUM_COMPATIBILITY_RELEASE_CYCLES) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`${commandName} must remain compatible for at least ${MINIMUM_COMPATIBILITY_RELEASE_CYCLES} release cycles`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return Object.freeze({
|
|
97
|
+
state: "deprecated",
|
|
98
|
+
deprecatedSince: migration.deprecatedSince,
|
|
99
|
+
removalNotBefore: migration.removalNotBefore,
|
|
100
|
+
minimumReleaseCycles: MINIMUM_COMPATIBILITY_RELEASE_CYCLES,
|
|
101
|
+
releaseCycle: "minor",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function validateCommandSurface(entries) {
|
|
106
|
+
if (!Array.isArray(entries)) {
|
|
107
|
+
throw new TypeError("command surface entries must be an array");
|
|
108
|
+
}
|
|
109
|
+
const netGrowth =
|
|
110
|
+
entries.length - TOP_LEVEL_GROWTH_POLICY.baselineCommandCount;
|
|
111
|
+
if (netGrowth > TOP_LEVEL_GROWTH_POLICY.maximumNetGrowth) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`Top-level command net growth is ${netGrowth}; maximum is ${TOP_LEVEL_GROWTH_POLICY.maximumNetGrowth}`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const names = new Set(entries.map((entry) => entry.name));
|
|
118
|
+
const topLevelTokens = new Set(
|
|
119
|
+
entries.flatMap((entry) => [
|
|
120
|
+
entry.name,
|
|
121
|
+
...(Array.isArray(entry.aliases) ? entry.aliases : []),
|
|
122
|
+
]),
|
|
123
|
+
);
|
|
124
|
+
for (const namespace of COMMAND_NAMESPACES) {
|
|
125
|
+
if (topLevelTokens.has(namespace.name)) {
|
|
126
|
+
throw new Error(
|
|
127
|
+
`Virtual command namespace '${namespace.name}' collides with a registered top-level command or alias`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
for (const commandName of Object.keys(COMMAND_MIGRATIONS)) {
|
|
132
|
+
if (!names.has(commandName)) {
|
|
133
|
+
throw new Error(`Migrated command is not registered: ${commandName}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const deprecatedCompatibilityCount = entries.filter(
|
|
138
|
+
(entry) => entry.lifecycle?.state === "deprecated",
|
|
139
|
+
).length;
|
|
140
|
+
const activeRegisteredCommandCount =
|
|
141
|
+
entries.length - deprecatedCompatibilityCount;
|
|
142
|
+
return {
|
|
143
|
+
...TOP_LEVEL_GROWTH_POLICY,
|
|
144
|
+
registeredCommandCount: entries.length,
|
|
145
|
+
activeRegisteredCommandCount,
|
|
146
|
+
virtualNamespaceCount: COMMAND_NAMESPACES.length,
|
|
147
|
+
deprecatedCompatibilityCount,
|
|
148
|
+
recommendedTopLevelCommandCount:
|
|
149
|
+
activeRegisteredCommandCount + COMMAND_NAMESPACES.length,
|
|
150
|
+
netGrowth,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function describeCommandSurface(commandName) {
|
|
155
|
+
const group = CORE_GROUP_BY_COMMAND.get(commandName);
|
|
156
|
+
const migration = COMMAND_MIGRATIONS[commandName];
|
|
157
|
+
return {
|
|
158
|
+
stability: group ? "stable" : "compatibility",
|
|
159
|
+
category: group?.id || "compatibility",
|
|
160
|
+
visibility: group ? "core" : "extended",
|
|
161
|
+
replacement: migration ? `${migration.namespace} ${commandName}` : null,
|
|
162
|
+
lifecycle: lifecycleForCommand(commandName),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function buildCommandSurfaceDescriptor(entries = []) {
|
|
167
|
+
const migrationCommands = Object.entries(COMMAND_MIGRATIONS).map(
|
|
168
|
+
([command, migration]) => ({
|
|
169
|
+
command,
|
|
170
|
+
replacement: `${migration.namespace} ${command}`,
|
|
171
|
+
}),
|
|
172
|
+
);
|
|
173
|
+
return {
|
|
174
|
+
schema: COMMAND_SURFACE_SCHEMA,
|
|
175
|
+
defaultCommand: DEFAULT_COMMAND,
|
|
176
|
+
lifecyclePolicy: {
|
|
177
|
+
schema: COMMAND_LIFECYCLE_SCHEMA,
|
|
178
|
+
minimumCompatibilityReleaseCycles: MINIMUM_COMPATIBILITY_RELEASE_CYCLES,
|
|
179
|
+
releaseCycle: "minor",
|
|
180
|
+
},
|
|
181
|
+
topLevelGrowth: validateCommandSurface(entries),
|
|
182
|
+
namespaces: COMMAND_NAMESPACES.map((namespace) => ({
|
|
183
|
+
...namespace,
|
|
184
|
+
commands: migrationCommands
|
|
185
|
+
.filter(({ replacement }) =>
|
|
186
|
+
replacement.startsWith(`${namespace.name} `),
|
|
187
|
+
)
|
|
188
|
+
.map(({ command }) => command)
|
|
189
|
+
.sort(),
|
|
190
|
+
})),
|
|
191
|
+
coreGroups: CORE_COMMAND_GROUPS.map((group) => ({
|
|
192
|
+
id: group.id,
|
|
193
|
+
label: group.label,
|
|
194
|
+
commands: [...group.commands],
|
|
195
|
+
})),
|
|
196
|
+
};
|
|
197
|
+
}
|
package/src/commands/agent.js
CHANGED
|
@@ -17,9 +17,11 @@ import {
|
|
|
17
17
|
import { resolveImages, resolveVisionLlm } from "../lib/image-input.js";
|
|
18
18
|
import { loadConfig } from "../lib/config-manager.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
20
|
+
normalizeAgentSandboxMode,
|
|
21
21
|
assertSandboxAvailable,
|
|
22
|
+
enforceSandboxFailClosed,
|
|
22
23
|
} from "../lib/agent-sandbox.js";
|
|
24
|
+
import { appendSecurityAuditEvent } from "../lib/security-audit.js";
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Resolve + validate `--add-dir` values into absolute, existing, de-duped
|
|
@@ -82,6 +84,12 @@ export function resolveFallbackModels(flagValue, llm = {}) {
|
|
|
82
84
|
return normalizeFallbackModels(configured);
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
export function containsApiKeyArgument(argv = process.argv) {
|
|
88
|
+
return argv.some(
|
|
89
|
+
(value) => value === "--api-key" || String(value).startsWith("--api-key="),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
85
93
|
/**
|
|
86
94
|
* Read all of stdin as a UTF-8 string. Resolves "" immediately when stdin is a
|
|
87
95
|
* TTY (nothing piped) so we never block an interactive invocation.
|
|
@@ -154,6 +162,10 @@ export function registerAgentCommand(program) {
|
|
|
154
162
|
"--fork-session",
|
|
155
163
|
"When resuming, branch into a NEW session id and leave the original untouched (claude --fork-session parity)",
|
|
156
164
|
)
|
|
165
|
+
.option(
|
|
166
|
+
"--fork-request-id <key>",
|
|
167
|
+
"Stable idempotency key for --fork-session retries (omit for a new fork each invocation)",
|
|
168
|
+
)
|
|
157
169
|
.option(
|
|
158
170
|
"--add-dir <dir>",
|
|
159
171
|
"Extra working directory the agent may read/search/edit (repeatable)",
|
|
@@ -167,6 +179,19 @@ export function registerAgentCommand(program) {
|
|
|
167
179
|
"--no-checkpoint",
|
|
168
180
|
"Disable auto-checkpointing (it is on by default inside git repos)",
|
|
169
181
|
)
|
|
182
|
+
.option(
|
|
183
|
+
"--managed-checkpoint",
|
|
184
|
+
"Checkpoint bounded mutating tools with Process Broker; unavailable writer lifetimes are reported as coverage none",
|
|
185
|
+
)
|
|
186
|
+
.option(
|
|
187
|
+
"--managed-checkpoint-state <dir>",
|
|
188
|
+
"Durable managed-checkpoint state directory (must be outside the workspace)",
|
|
189
|
+
)
|
|
190
|
+
.option(
|
|
191
|
+
"--managed-checkpoint-exclude <path>",
|
|
192
|
+
"Explicit workspace path excluded from managed checkpoints; repeatable and reported as partial coverage",
|
|
193
|
+
(val, prev) => (prev || []).concat([val]),
|
|
194
|
+
)
|
|
170
195
|
.option(
|
|
171
196
|
"--safe-mode",
|
|
172
197
|
"Run bare: disable project memory, settings hooks, memory recall, IDE context, status line and update notice (permission rules STAY active)",
|
|
@@ -207,6 +232,10 @@ export function registerAgentCommand(program) {
|
|
|
207
232
|
"--sandbox [image]",
|
|
208
233
|
"Run shell commands in an ephemeral Docker sandbox (network disabled by default)",
|
|
209
234
|
)
|
|
235
|
+
.option(
|
|
236
|
+
"--sandbox-mode <mode>",
|
|
237
|
+
"Sandbox posture: off | workspace-write | strict (explicit isolation modes fail closed)",
|
|
238
|
+
)
|
|
210
239
|
.option("--sandbox-network", "Allow network access inside --sandbox")
|
|
211
240
|
.option(
|
|
212
241
|
"--otlp <file>",
|
|
@@ -453,7 +482,7 @@ export function registerAgentCommand(program) {
|
|
|
453
482
|
options.apiKey = process.env.CC_API_KEY;
|
|
454
483
|
} else if (
|
|
455
484
|
options.apiKey &&
|
|
456
|
-
process.argv
|
|
485
|
+
containsApiKeyArgument(process.argv) &&
|
|
457
486
|
!process.env.VITEST &&
|
|
458
487
|
!process.env.VITEST_WORKER_ID
|
|
459
488
|
) {
|
|
@@ -478,6 +507,7 @@ export function registerAgentCommand(program) {
|
|
|
478
507
|
// 2.1.169 parity): flip every customization kill-switch BEFORE anything
|
|
479
508
|
// loads. Permission rules stay active. --bare (CC_BARE) is safe mode
|
|
480
509
|
// PLUS skills, plugins and MCP/IDE/PDH/JetBrains auto-connect off.
|
|
510
|
+
let safeIsolationRequested = options.permissionMode === "auto";
|
|
481
511
|
{
|
|
482
512
|
const {
|
|
483
513
|
applySafeMode,
|
|
@@ -486,6 +516,7 @@ export function registerAgentCommand(program) {
|
|
|
486
516
|
bareModeRequested,
|
|
487
517
|
} = await import("../lib/safe-mode.js");
|
|
488
518
|
if (bareModeRequested(options)) {
|
|
519
|
+
safeIsolationRequested = true;
|
|
489
520
|
const applied = applyBareMode();
|
|
490
521
|
// Ambient auto-connects off; an EXPLICIT --ide/--pdh/--jetbrains
|
|
491
522
|
// (or --mcp-config, handled downstream) still wins — bare kills
|
|
@@ -498,6 +529,7 @@ export function registerAgentCommand(program) {
|
|
|
498
529
|
`bare mode: hooks/skills/plugins/memory/MCP-auto-connect disabled (${applied.join(", ")}) — permission rules stay active.\n`,
|
|
499
530
|
);
|
|
500
531
|
} else if (safeModeRequested(options)) {
|
|
532
|
+
safeIsolationRequested = true;
|
|
501
533
|
const applied = applySafeMode();
|
|
502
534
|
process.stderr.write(
|
|
503
535
|
`safe mode: customizations disabled (${applied.join(", ")}) — permission rules stay active.\n`,
|
|
@@ -721,7 +753,11 @@ export function registerAgentCommand(program) {
|
|
|
721
753
|
const { applyForkSession } =
|
|
722
754
|
await import("../runtime/headless-runner.js");
|
|
723
755
|
const fork = applyForkSession(
|
|
724
|
-
{
|
|
756
|
+
{
|
|
757
|
+
forkSession: true,
|
|
758
|
+
sessionId: options.session,
|
|
759
|
+
forkRequestId: options.forkRequestId,
|
|
760
|
+
},
|
|
725
761
|
store,
|
|
726
762
|
);
|
|
727
763
|
if (fork.missing) {
|
|
@@ -778,6 +814,7 @@ export function registerAgentCommand(program) {
|
|
|
778
814
|
// interactive, which all read options.model) picks it up; env vars are
|
|
779
815
|
// set on the process so the agent loop + child tools inherit them.
|
|
780
816
|
let settingsSandbox = null;
|
|
817
|
+
let managedSettingsSandbox = null;
|
|
781
818
|
try {
|
|
782
819
|
const { loadSettingsConfig } =
|
|
783
820
|
await import("../lib/settings-loader.cjs");
|
|
@@ -800,8 +837,52 @@ export function registerAgentCommand(program) {
|
|
|
800
837
|
}
|
|
801
838
|
if (!options.model && sc.model) options.model = sc.model;
|
|
802
839
|
settingsSandbox = sc.sandbox || null;
|
|
803
|
-
|
|
804
|
-
|
|
840
|
+
managedSettingsSandbox = sc.managedSandbox || null;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
if (error?.code === "CC_MANAGED_SETTINGS_INVALID") {
|
|
843
|
+
process.stderr.write(`Error: ${error.message}\n`);
|
|
844
|
+
await _finishWorktree();
|
|
845
|
+
process.exit(6);
|
|
846
|
+
}
|
|
847
|
+
// User/project settings overrides remain best-effort. Organization
|
|
848
|
+
// managed settings are handled above and may never fail open.
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
let resolvedAgentSandbox;
|
|
852
|
+
try {
|
|
853
|
+
resolvedAgentSandbox = normalizeAgentSandboxMode(
|
|
854
|
+
options.sandboxMode,
|
|
855
|
+
options.sandbox,
|
|
856
|
+
{
|
|
857
|
+
cwd: process.cwd(),
|
|
858
|
+
network: options.sandboxNetwork === true,
|
|
859
|
+
settings: settingsSandbox,
|
|
860
|
+
managedSettings: managedSettingsSandbox,
|
|
861
|
+
},
|
|
862
|
+
);
|
|
863
|
+
if (safeIsolationRequested && resolvedAgentSandbox) {
|
|
864
|
+
resolvedAgentSandbox = enforceSandboxFailClosed(
|
|
865
|
+
resolvedAgentSandbox,
|
|
866
|
+
options.permissionMode === "auto" ? "auto" : "safe",
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
assertSandboxAvailable(resolvedAgentSandbox);
|
|
870
|
+
if (options.sandboxMode === "off") {
|
|
871
|
+
appendSecurityAuditEvent("sandbox_mode_off", {
|
|
872
|
+
details: {
|
|
873
|
+
command: "agent",
|
|
874
|
+
permissionMode: options.permissionMode || "default",
|
|
875
|
+
isolation: "policy-only",
|
|
876
|
+
},
|
|
877
|
+
});
|
|
878
|
+
process.stderr.write(
|
|
879
|
+
"Warning: sandbox mode is explicitly off; shell commands use policy checks without OS isolation.\n",
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
} catch (err) {
|
|
883
|
+
process.stderr.write(`Error: ${err.message}\n`);
|
|
884
|
+
await _finishWorktree();
|
|
885
|
+
process.exit(6);
|
|
805
886
|
}
|
|
806
887
|
|
|
807
888
|
// Extra workspace roots (--add-dir) 鈥?shared by headless + interactive.
|
|
@@ -994,10 +1075,14 @@ export function registerAgentCommand(program) {
|
|
|
994
1075
|
// paths (default ON in a git repo) so panel/stream sessions snapshot
|
|
995
1076
|
// before mutating tools and can be rewound via `cc checkpoint`.
|
|
996
1077
|
autoCheckpoint,
|
|
1078
|
+
managedCheckpoint: options.managedCheckpoint === true,
|
|
1079
|
+
managedCheckpointStateDir: options.managedCheckpointState || null,
|
|
1080
|
+
managedCheckpointExclusions: options.managedCheckpointExclude || [],
|
|
997
1081
|
permissionMode: options.permissionMode,
|
|
998
1082
|
allowedTools: parseToolList(options.allowedTools),
|
|
999
1083
|
disallowedTools: parseToolList(options.disallowedTools),
|
|
1000
1084
|
additionalDirectories,
|
|
1085
|
+
sandbox: resolvedAgentSandbox,
|
|
1001
1086
|
maxTurns: options.maxTurns
|
|
1002
1087
|
? parseInt(options.maxTurns, 10)
|
|
1003
1088
|
: undefined,
|
|
@@ -1163,20 +1248,6 @@ export function registerAgentCommand(program) {
|
|
|
1163
1248
|
}
|
|
1164
1249
|
return;
|
|
1165
1250
|
}
|
|
1166
|
-
const agentSandbox = normalizeAgentSandbox(options.sandbox, {
|
|
1167
|
-
cwd: process.cwd(),
|
|
1168
|
-
network: options.sandboxNetwork === true,
|
|
1169
|
-
settings: settingsSandbox,
|
|
1170
|
-
});
|
|
1171
|
-
// Strict sandbox mode: failIfUnavailable refuses to START when the
|
|
1172
|
-
// configured engine can't run — no silent per-command degradation.
|
|
1173
|
-
try {
|
|
1174
|
-
assertSandboxAvailable(agentSandbox);
|
|
1175
|
-
} catch (err) {
|
|
1176
|
-
process.stderr.write(`Error: ${err.message}\n`);
|
|
1177
|
-
await _finishWorktree();
|
|
1178
|
-
process.exit(6); // config error (see lib/exit-codes.cjs)
|
|
1179
|
-
}
|
|
1180
1251
|
// Resume requested onto a session with no headless (JSONL) transcript?
|
|
1181
1252
|
// Warn instead of silently starting empty 鈥?headless resume rebuilds
|
|
1182
1253
|
// from the JSONL store only (DB-only sessions are not replayable here).
|
|
@@ -1230,8 +1301,11 @@ export function registerAgentCommand(program) {
|
|
|
1230
1301
|
allowedTools: parseToolList(options.allowedTools),
|
|
1231
1302
|
disallowedTools: parseToolList(options.disallowedTools),
|
|
1232
1303
|
additionalDirectories,
|
|
1233
|
-
sandbox:
|
|
1304
|
+
sandbox: resolvedAgentSandbox,
|
|
1234
1305
|
autoCheckpoint,
|
|
1306
|
+
managedCheckpoint: options.managedCheckpoint === true,
|
|
1307
|
+
managedCheckpointStateDir: options.managedCheckpointState || null,
|
|
1308
|
+
managedCheckpointExclusions: options.managedCheckpointExclude || [],
|
|
1235
1309
|
// --worktree: stamp the isolation worktree (branch name) onto each
|
|
1236
1310
|
// turn's explicit turn-binding record (advisory; null without it).
|
|
1237
1311
|
worktreeId: _worktree ? _worktree.branch : null,
|
|
@@ -1401,18 +1475,6 @@ export function registerAgentCommand(program) {
|
|
|
1401
1475
|
|
|
1402
1476
|
// Strict sandbox mode also guards the interactive session: refuse to
|
|
1403
1477
|
// start when failIfUnavailable is set and the engine can't run.
|
|
1404
|
-
const interactiveSandbox = normalizeAgentSandbox(options.sandbox, {
|
|
1405
|
-
cwd: process.cwd(),
|
|
1406
|
-
network: options.sandboxNetwork === true,
|
|
1407
|
-
settings: settingsSandbox,
|
|
1408
|
-
});
|
|
1409
|
-
try {
|
|
1410
|
-
assertSandboxAvailable(interactiveSandbox);
|
|
1411
|
-
} catch (err) {
|
|
1412
|
-
process.stderr.write(`Error: ${err.message}\n`);
|
|
1413
|
-
process.exit(6); // config error (see lib/exit-codes.cjs)
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
1478
|
const runtime = createAgentRuntimeFactory().createAgentRuntime({
|
|
1417
1479
|
model: options.model,
|
|
1418
1480
|
thinking,
|
|
@@ -1434,8 +1496,11 @@ export function registerAgentCommand(program) {
|
|
|
1434
1496
|
parkOnExit: options.parkOnExit, // false when --no-park-on-exit
|
|
1435
1497
|
bundlePath: options.bundle || null,
|
|
1436
1498
|
additionalDirectories,
|
|
1437
|
-
sandbox:
|
|
1499
|
+
sandbox: resolvedAgentSandbox,
|
|
1438
1500
|
autoCheckpoint,
|
|
1501
|
+
managedCheckpoint: options.managedCheckpoint === true,
|
|
1502
|
+
managedCheckpointStateDir: options.managedCheckpointState || null,
|
|
1503
|
+
managedCheckpointExclusions: options.managedCheckpointExclude || [],
|
|
1439
1504
|
// Keep interactive --worktree sessions in the same explicit
|
|
1440
1505
|
// turn-binding coverage model as headless runs.
|
|
1441
1506
|
worktreeId: _worktree ? _worktree.branch : null,
|