chainlesschain 0.166.21 → 0.166.24
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 +67 -9
- package/package.json +4 -3
- package/src/assets/web-panel/assets/{AIOps-BjMnsUci.js → AIOps-DR-MWcZc.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DdYFP03A.js → ActionButton-DT8B7sEb.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-Bb8TuuK_.js → Analytics-asjh3dQJ.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-Kn3TIOtk.js → AppLayout-DivQ491i.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-4IxpqI_b.js → Artifacts-DPH2uUmy.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-BOV2caqU.js → Audit-Bp2nLyc-.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-B86k-ay4.js → BackgroundAgents-CHS28khl.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-C5_ie1e3.js → Backup-CKeaFSfz.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-xpwg6QCW.js → BaseInput-CxwM9BAH.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-CVZOcZau.js → Chat-DYLDwaCv.js} +4 -4
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-D8fPYhUu.js → ChatBubbleRenderer-DdBJDBP0.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-MKTq3zdP.js → Checkbox-uYTWOB8j.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-JUk3wzep.js → Codegen-CvYa_dwT.js} +1 -1
- package/src/assets/web-panel/assets/{Col-JPvTA0kC.js → Col-CanMAX4m.js} +1 -1
- package/src/assets/web-panel/assets/{Community-Tqgl87NQ.js → Community-B4WaDtHw.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BuAFYBmN.js → Compact-K93Uof_3.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CXS9WIPZ.js → Compliance-CKeDLgUW.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-Ds2bFHrr.js → Cowork-P93grAeB.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-C_dV_OeW.js → Cron-BSHnMtDn.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-BsO6tIRo.js → Crosschain-epAOpUVJ.js} +1 -1
- package/src/assets/web-panel/assets/{DID-rNOFqBac.js → DID-ByjXfP7t.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-C2fcKKVY.js → Dashboard-QztTU8tb.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-Y7Ndr0X_.js → Dropdown-DhUc9yhN.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-DcP_uPmL.js → EmailListRenderer-C2sLhJJN.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-Cwn3gDzk.js → FamilyGuardDashboard-CdfbWNDn.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-ClQuOsqb.js → Federation-CcF_R7NW.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-DfwtmlcK.js → FormItemContext-Cm_X2IBk.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-zNZhtbC5.js → GenericCardRenderer-DUi4NWlb.js} +1 -1
- package/src/assets/web-panel/assets/{Git-BZmdW-G5.js → Git-4Sq5FjBt.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-CqBk4lEn.js → Governance-Dx2_v4V6.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-Dbmt3ZXk.js → Inference-7Vr1xekR.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-hMTH6qf3.js → KnowledgeGraph-Cnd2XOzf.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CkiYgiW2.js → Logs-B66QPVf-.js} +2 -2
- package/src/assets/web-panel/assets/{MarkdownRenderer-BL1FElXg.js → MarkdownRenderer-PLsEvhly.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-CbB6wfin.js → Marketplace-BMIK9BmC.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BSwiFtte.js → McpTools-BDbyp3J_.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-B03PeHrz.js → Memory-CJdzfZGi.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-CRGrnd-X.js → MobileBridge-C2TH5Y3-.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-CE_5v2kO.js → MobileProjects-D1dYXkvV.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-Dp11QVx1.js → Mtc-B-4A1I1j.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-CYu-3JBu.js → MtcAudit-Bgcc9UOl.js} +5 -5
- package/src/assets/web-panel/assets/{Multisig-CGyJ0Xl3.js → Multisig-DqOe-etP.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-CoWi_ov1.js → NLProgramming-7VnhzE_6.js} +1 -1
- package/src/assets/web-panel/assets/Notes-BxawpeUQ.js +7 -0
- package/src/assets/web-panel/assets/{NotificationSettings-DX4I2b4W.js → NotificationSettings-Cr08G2aE.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-Ce8bEGlK.js +1 -0
- package/src/assets/web-panel/assets/{Organization-oopLO_tk.js → Organization-BC7lveGv.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-BFVvjMyf.js → Overflow-CakOW-G0.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CBy5t-Tk.js → P2P-Cf8CaOBZ.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser--YWJNsu6.js → PdhVaultBrowser-Dc7b98W9.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-C2dZ8scb.js → Permissions-DGJyMEfS.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-Bs3l7Hlx.js → PersonalDataHub-DNIwSdwu.js} +6 -6
- package/src/assets/web-panel/assets/{Pipeline-DEBWbZuD.js → Pipeline-5B1S12wa.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-CjHBb6NU.js → Privacy-CMB6Ke5t.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-D2WipUz5.js → ProjectInit-D5PqTFiT.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-B6WfnrGB.js → ProjectSettings-CbKNdSjV.js} +2 -2
- package/src/assets/web-panel/assets/Projects-ccXaHzYL.js +1 -0
- package/src/assets/web-panel/assets/{Providers-CCv5M_Dv.js → Providers-CJF5_-Gs.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-CGthxU54.js → QrScannerModal-CT6iEAdi.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-CnPmXPFb.js → QuickAsk-Ci0h9mJ_.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-Df_tGEa9.js → Recommend-Da5mobZu.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-Z58N0Loe.js → RemoteSession-BaCY8eey.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-CZTBQ2Vt.js → Reputation-CaITfTsI.js} +1 -1
- package/src/assets/web-panel/assets/{Row-CdK3YpCQ.js → Row-DtUDamyP.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-CFMVT5sb.js → RssFeed-DX27gFpg.js} +3 -3
- package/src/assets/web-panel/assets/{Search-DrF8RIvD.js → Search-DFL69osN.js} +1 -1
- package/src/assets/web-panel/assets/{Security-Ddk2f2DM.js → Security-BqGeoWv-.js} +3 -3
- package/src/assets/web-panel/assets/{Services-CCuK-VOo.js → Services-3z1WnEAc.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DxCpHzeM.js → Skeleton-C_OJQQ9Z.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-t2oTDgcv.js → Skills-BY7aT6Mo.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-Df63M9_R.js → Sla-BZv7DSaD.js} +1 -1
- package/src/assets/web-panel/assets/SpeechSettings-6lJKLhCn.js +1 -0
- package/src/assets/web-panel/assets/{SyncSettings-COd_tgPp.js → SyncSettings-B6D7STlI.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-CzDCcrik.js → Tasks-Co_FCZAO.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-D-vfxTGA.js → Templates-CnY-9fgz.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-BlpT_Gxc.js → Tenant-B71yXfZ8.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-D5rq52Hg.js → Terminal-Dd_P7awo.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-DdoMndkK.js → TimelineRenderer-CvIEMyli.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BhgBsI6g.js → Tokens-DknFBGOi.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DwwzoikZ.js → Trigger-D_4nJONB.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-HkTpzXFb.js → Trust-BNl21fa7.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-D9nk6Ehe.js → UkeySign-CFrCI7uK.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-BKk0rfoy.js → VideoEditing-BVfY6JLg.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-IVWIU_Lq.js → Wallet-Cj9CAK0J.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-CFTCpfsG.js → WebAuthn-DcqZlzA3.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-Dnf4Obif.js → WorkflowEditor-Dfr_dMld.js} +1 -1
- package/src/assets/web-panel/assets/{chat-D2snERdj.js → chat-Yv6UF0AD.js} +1 -1
- package/src/assets/web-panel/assets/{colors-DKEjK1N1.js → colors-CDW_-1fs.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-BEDLwQdt.js → compact-item-BYOQvd-6.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-DA9iW1a0.js → createContext-BCGO0BiP.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-H-kXSuf-.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-5l2xEcY9.js → hasIn-DY-70cfQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-B7_W_rYd.js → index-366wfQBU.js} +1 -1
- package/src/assets/web-panel/assets/index-B0o4MeNK.js +1 -0
- package/src/assets/web-panel/assets/{index-CxEtQYdi.js → index-B9ZogJJM.js} +1 -1
- package/src/assets/web-panel/assets/{index-B00GeekA.js → index-B9m5QAMg.js} +1 -1
- package/src/assets/web-panel/assets/{index-C7sKbM5s.js → index-BBs2mv5M.js} +1 -1
- package/src/assets/web-panel/assets/{index-CX1x4AFn.js → index-BFv1hzF6.js} +1 -1
- package/src/assets/web-panel/assets/index-BVafOL_I.js +1 -0
- package/src/assets/web-panel/assets/{index-DU2TXJu-.js → index-BXlEx4UH.js} +1 -1
- package/src/assets/web-panel/assets/{index-e-e40id6.js → index-BayRTE5w.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXet1xol.js → index-Bb9nyts1.js} +1 -1
- package/src/assets/web-panel/assets/{index-D7z4zB_a.js → index-Bf_Va0S-.js} +1 -1
- package/src/assets/web-panel/assets/{index-fccZmC_h.js → index-Br3wQLVY.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bqc8tdIF.js → index-BvK4fjkk.js} +1 -1
- package/src/assets/web-panel/assets/{index-BO9dQjpt.js → index-C40UdtlS.js} +1 -1
- package/src/assets/web-panel/assets/{index-Csfb-7hw.js → index-C4UJA2ju.js} +1 -1
- package/src/assets/web-panel/assets/{index-Td8ZwyoC.js → index-CB_Iw73G.js} +1 -1
- package/src/assets/web-panel/assets/{index-BZ5lY2zx.js → index-CCwWp3mT.js} +1 -1
- package/src/assets/web-panel/assets/{index-DpqtbXdE.js → index-CFa2fPCk.js} +1 -1
- package/src/assets/web-panel/assets/{index-NJieh3T1.js → index-CIyHxV4u.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dbkghqn_.js → index-CUP-A2_h.js} +1 -1
- package/src/assets/web-panel/assets/{index-DqwPFbOb.js → index-CUo27q9J.js} +3 -3
- package/src/assets/web-panel/assets/{index-B4QYBliR.js → index-CaT8trvf.js} +1 -1
- package/src/assets/web-panel/assets/{index-BgfImyZI.js → index-CnZNbcux.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dbd7eEex.js → index-Cy2NE6AO.js} +1 -1
- package/src/assets/web-panel/assets/{index-CbTPvp2_.js → index-CzeEEazr.js} +1 -1
- package/src/assets/web-panel/assets/{index-5pW4t1iD.js → index-D--TEyDj.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dg2a9owQ.js → index-DCtsjhhT.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_eCoZgW.js → index-DLOf7BSz.js} +1 -1
- package/src/assets/web-panel/assets/{index-7P1b8HZo.js → index-DM5c4pc-.js} +1 -1
- package/src/assets/web-panel/assets/{index-CRPrHE7h.js → index-DRFC2Qt0.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bq5P3piS.js → index-DT_qVaaV.js} +1 -1
- package/src/assets/web-panel/assets/{index-CjWltbi_.js → index-DUDoRk9r.js} +1 -1
- package/src/assets/web-panel/assets/{index-CkMKuqUs.js → index-Dg-AQYDf.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLoalqRX.js → index-DuIPq5MX.js} +1 -1
- package/src/assets/web-panel/assets/{index-CGlotREA.js → index-NYVBUAVN.js} +1 -1
- package/src/assets/web-panel/assets/{index-yYEQXYaU.js → index-NaCESahy.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmruhzFi.js → index-RjIMPG0u.js} +1 -1
- package/src/assets/web-panel/assets/{index-fgYk0QXO.js → index-Y9akzgFO.js} +1 -1
- package/src/assets/web-panel/assets/{index-DvV03Ayk.js → index-hZ0Eyrrw.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-CPrcB1TC.js → initDefaultProps-CG99CcR4.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BQ7mWRh_.js → motion-Z7MH0_0G.js} +1 -1
- package/src/assets/web-panel/assets/{move-CzOEq99p.js → move-BX67lOdq.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-BlQI5jrw.js → mtc-parser-CmAbG1fE.js} +1 -1
- package/src/assets/web-panel/assets/{omit-DlW4gxmv.js → omit-DiU5tI1_.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-BBYms5nP.js → pickAttrs-BGfvLrYL.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-az2MPJ_7.js → placementArrow-CggLEgaJ.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-D1-ibEol.js → responsiveObserve-t3nlghPZ.js} +1 -1
- package/src/assets/web-panel/assets/{slide-DHGqa4GA.js → slide-BkV4dL9s.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-CYGDo6lD.js → statusUtils-qec1PUoC.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-Cl2EM9K6.js → styleChecker-ChjX6T8D.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DdYhzuv1.js → useFlexGapSupport-B1jLoZcM.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DWumPuBW.js → useFs-C3X53s4E.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DxAO-Aqi.js → usePersonalDataHub-DOvbbnkZ.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CplsQf_N.js → vnode-Ie0TEVFT.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-Cw5HXNSG.js → zoom-CRUMVS8l.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +3 -3
- package/src/commands/agent.js +18 -1
- package/src/commands/evolution-benchmark.js +72 -0
- package/src/commands/evolution.js +2 -0
- package/src/commands/governed-skill-marketplace.js +142 -0
- package/src/commands/marketplace.js +4 -1
- package/src/commands/serve.js +41 -0
- package/src/commands/skill.js +3 -0
- package/src/data/changelog.json +39 -0
- package/src/gateways/ws/ws-agent-handler.js +59 -2
- package/src/gateways/ws/ws-server.js +2 -0
- package/src/harness/golden-transcript.js +1 -0
- package/src/harness/prompt-compressor.js +51 -5
- package/src/harness/provider-backed-compaction.js +28 -1
- package/src/harness/remote-session-registry.js +15 -3
- package/src/index.js +30 -4
- package/src/lazy-dispatch.js +15 -1
- package/src/lib/advisor-runtime.js +55 -2
- package/src/lib/app-server/cli-agent-kernel-adapter.js +4 -0
- package/src/lib/app-server/graph-runtime.js +32 -0
- package/src/lib/app-server/server.js +45 -1
- package/src/lib/app-server/websocket-transport.js +23 -0
- package/src/lib/autonomous-agent.js +63 -13
- package/src/lib/cowork/ab-comparator-cli.js +4 -3
- package/src/lib/cowork/debate-review-cli.js +4 -3
- package/src/lib/cowork/decision-kb-cli.js +5 -0
- package/src/lib/cowork-adapter.js +38 -16
- package/src/lib/evolution/agent-evolution-ingress.js +95 -15
- package/src/lib/evolution/agent-evolution-runtime-composition.js +82 -0
- package/src/lib/evolution/agent-evolution-session-lifecycle.js +46 -0
- package/src/lib/evolution/agent-model-projection.js +217 -0
- package/src/lib/evolution/bounded-descriptor-read.js +29 -0
- package/src/lib/evolution/controlled-skill-pilot-ledger-adapter.js +551 -0
- package/src/lib/evolution/controlled-skill-production-pilot.js +308 -18
- package/src/lib/evolution/evidence-backed-wiki-maintainer.js +10 -1
- package/src/lib/evolution/evidence-json-text.js +236 -0
- package/src/lib/evolution/evolution-artifact-ports.js +202 -21
- package/src/lib/evolution/evolution-deployment-loader.js +369 -0
- package/src/lib/evolution/evolution-eval-child-evidence-ledger-adapter.js +373 -0
- package/src/lib/evolution/evolution-eval-gate.js +14 -1
- package/src/lib/evolution/evolution-eval-process-supervisor-worker.mjs +14 -0
- package/src/lib/evolution/evolution-eval-process-supervisor.js +607 -0
- package/src/lib/evolution/evolution-evidence-artifact-adapter.js +14 -1
- package/src/lib/evolution/evolution-evidence-projector.js +240 -37
- package/src/lib/evolution/evolution-file-witness.js +153 -30
- package/src/lib/evolution/evolution-ledger-ports.js +1027 -66
- package/src/lib/evolution/evolution-ledger.js +66 -2
- package/src/lib/evolution/evolution-raw-crypto-shred.js +29 -15
- package/src/lib/evolution/evolution-raw-deletion-ledger-adapter.js +865 -0
- package/src/lib/evolution/evolution-release-train-domain-stages.js +769 -0
- package/src/lib/evolution/evolution-release-train-ledger-adapter.js +335 -0
- package/src/lib/evolution/evolution-release-train-stage-output-ledger-adapter.js +333 -0
- package/src/lib/evolution/evolution-release-train.js +586 -0
- package/src/lib/evolution/evolution-workbench-batch-executor.js +101 -144
- package/src/lib/evolution/evolution-workbench-control-ports.js +203 -0
- package/src/lib/evolution/evolution-workbench-file-resources.js +403 -0
- package/src/lib/evolution/evolution-workbench-projection.js +152 -25
- package/src/lib/evolution/evolution-workbench-registry-source.js +482 -0
- package/src/lib/evolution/evolution-workbench-review-ledger-adapter.js +823 -0
- package/src/lib/evolution/evolution-workbench-review-protocol.js +157 -0
- package/src/lib/evolution/evolution-workbench-rollback-authorization.js +57 -0
- package/src/lib/evolution/evolution-workbench-rollback-ledger-adapter.js +1016 -0
- package/src/lib/evolution/evolution-workbench-runtime.js +133 -0
- package/src/lib/evolution/evolution-workbench-version-control.js +70 -36
- package/src/lib/evolution/evolvable-artifact-ledger-adapter.js +736 -0
- package/src/lib/evolution/governed-knowledge-artifact-lifecycle.js +364 -0
- package/src/lib/evolution/governed-knowledge-candidate-rejection.js +343 -0
- package/src/lib/evolution/governed-knowledge-dependency-authority.js +227 -44
- package/src/lib/evolution/governed-knowledge-dependency-ledger-executor.js +95 -83
- package/src/lib/evolution/governed-knowledge-merge-ledger-executor.js +29 -2
- package/src/lib/evolution/governed-knowledge-merge-publisher-authority.js +31 -3
- package/src/lib/evolution/governed-knowledge-record.js +148 -0
- package/src/lib/evolution/governed-knowledge-revocation-record.js +135 -0
- package/src/lib/evolution/governed-knowledge-skill-rollback.js +475 -0
- package/src/lib/evolution/governed-knowledge-sync-ledger-adapter.js +92 -6
- package/src/lib/evolution/governed-knowledge-sync-merge-publisher.js +57 -4
- package/src/lib/evolution/governed-knowledge-sync.js +332 -99
- package/src/lib/evolution/governed-knowledge-wiki-tombstone.js +462 -0
- package/src/lib/evolution/governed-skill-marketplace-badge.js +208 -0
- package/src/lib/evolution/governed-skill-marketplace-candidate.js +330 -0
- package/src/lib/evolution/governed-skill-marketplace-cli-host.js +308 -0
- package/src/lib/evolution/governed-skill-marketplace-ledger-adapter.js +420 -0
- package/src/lib/evolution/governed-skill-marketplace.js +288 -5
- package/src/lib/evolution/governed-wiki-pruning-journal.js +302 -0
- package/src/lib/evolution/governed-wiki-pruning-ledger-adapter.js +459 -0
- package/src/lib/evolution/governed-wiki-pruning-maintenance.js +576 -0
- package/src/lib/evolution/governed-wiki-pruning-plan-authority.js +169 -0
- package/src/lib/evolution/governed-wiki-pruning-raw-shred.js +207 -0
- package/src/lib/evolution/governed-wiki-pruning-retrieval.js +587 -0
- package/src/lib/evolution/governed-wiki-pruning-runtime.js +153 -0
- package/src/lib/evolution/governed-wiki-pruning-skill-rollback.js +360 -0
- package/src/lib/evolution/governed-wiki-pruning.js +322 -143
- package/src/lib/evolution/independent-skill-revocation-source.js +231 -0
- package/src/lib/evolution/knowledge-wiki-source-admission.js +124 -0
- package/src/lib/evolution/knowledge-wiki-source-provenance.js +359 -0
- package/src/lib/evolution/progressive-canary-external-watchdog.js +578 -0
- package/src/lib/evolution/progressive-canary-traffic-worker.js +628 -0
- package/src/lib/evolution/progressive-canary-watchdog-file-store.js +285 -0
- package/src/lib/evolution/progressive-canary-watchdog-node-pki.js +265 -0
- package/src/lib/evolution/skill-candidate-registry.js +22 -0
- package/src/lib/evolution/skill-promotion-controller.js +25 -0
- package/src/lib/evolution/skill-promotion-review-ledger-adapter.js +100 -0
- package/src/lib/evolution/skill-registry-transition-ledger-adapter.js +131 -2
- package/src/lib/evolution/skill-release-registry.js +25 -4
- package/src/lib/evolution/skill-retrieval-revocation-authority.js +361 -0
- package/src/lib/evolution/skill-retrieval-revocation-ledger-adapter.js +346 -0
- package/src/lib/evolution/skill-revocation-propagation.js +467 -0
- package/src/lib/evolution/skill-target-matrix-eval.js +162 -11
- package/src/lib/evolution/skill-wiki-reconciliation.js +985 -0
- package/src/lib/evolution/skill-writer-inventory-manifest.js +15 -12
- package/src/lib/evolution/statistical-progressive-canary.js +845 -0
- package/src/lib/evolution/structured-memory-agent-control-plane.js +120 -0
- package/src/lib/evolution/structured-memory-authority-ledger-adapter.js +5 -1
- package/src/lib/evolution/structured-memory-promotion-receipt-writer.js +126 -0
- package/src/lib/evolution/wiki-informed-skill-proposer.js +127 -21
- package/src/lib/evolution/wiki-maintainer-ledger-adapter.js +760 -100
- package/src/lib/evolution/wiki-revision-protocol.js +120 -0
- package/src/lib/evolution/wiki-skill-proposal-ledger-adapter.js +307 -0
- package/src/lib/evolution/wiki-target-tombstone-revision.js +101 -0
- package/src/lib/evolution/wikiskill-benchmark-cli-host.js +178 -0
- package/src/lib/evolution/wikiskill-benchmark-execution-host.js +702 -0
- package/src/lib/evolution/wikiskill-benchmark-ledger-adapter.js +613 -0
- package/src/lib/evolution/wikiskill-benchmark.js +574 -0
- package/src/lib/goal-assess.js +17 -10
- package/src/lib/interactive-planner.js +9 -1
- package/src/lib/iteration-budget.js +16 -2
- package/src/lib/micro-compact.js +4 -1
- package/src/lib/model-failure-policy.js +21 -0
- package/src/lib/process-execution-broker/index.js +1 -0
- 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 +33 -15
- package/src/lib/read-file-page.js +191 -0
- package/src/lib/runnable-provider.js +2 -1
- package/src/lib/session-host-lease.js +11 -16
- package/src/lib/skill-retrieval-router.js +22 -1
- package/src/repl/agent-repl.js +127 -33
- package/src/runtime/agent-core.js +224 -80
- package/src/runtime/agent-runtime.js +43 -0
- package/src/runtime/coding-agent-contract-shared.cjs +7 -1
- package/src/runtime/fallback-model.js +143 -62
- package/src/runtime/headless-runner.js +54 -10
- package/src/runtime/headless-stream.js +53 -6
- package/src/runtime/runtime-factory.js +41 -2
- package/src/assets/web-panel/assets/Notes-CgU9DDo9.js +0 -7
- package/src/assets/web-panel/assets/OrderTableRenderer-CwHc15Zs.js +0 -1
- package/src/assets/web-panel/assets/Projects-FF_thRi6.js +0 -1
- package/src/assets/web-panel/assets/SpeechSettings-l7ox6KuX.js +0 -1
- package/src/assets/web-panel/assets/devWarning-DyhgpXPf.js +0 -1
- package/src/assets/web-panel/assets/index-Ck1jhFE0.js +0 -1
- package/src/assets/web-panel/assets/index-c8jJEHVs.js +0 -1
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
import fs from "fs";
|
|
18
18
|
import path from "path";
|
|
19
|
+
import { buildReadFilePage } from "../lib/read-file-page.js";
|
|
19
20
|
import broker from "../lib/process-execution-broker/index.js";
|
|
20
21
|
import os from "os";
|
|
21
22
|
import { createHash, randomUUID } from "node:crypto";
|
|
22
23
|
import skillInvocationReceipt from "@chainlesschain/session-core/skill-invocation-receipt";
|
|
23
24
|
import { isProxy } from "node:util/types";
|
|
25
|
+
import { captureAgentEvolutionIngress } from "../lib/evolution/agent-evolution-ingress.js";
|
|
24
26
|
|
|
25
27
|
const { startSkillInvocation, settleSkillInvocation } = skillInvocationReceipt;
|
|
26
28
|
import sharedCodingAgentPolicy from "./coding-agent-policy.cjs";
|
|
@@ -368,12 +370,12 @@ function resolveBackgroundShellWorkspacePaths(
|
|
|
368
370
|
|
|
369
371
|
// ─── Background shell tasks ────────────────────────────────────────────────
|
|
370
372
|
//
|
|
371
|
-
// run_shell
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
//
|
|
373
|
+
// run_shell remains synchronous by default for compatibility. Persistent
|
|
374
|
+
// stream hosts opt into an async foreground path so commands cannot block the
|
|
375
|
+
// session heartbeat or protocol pump. When the model passes
|
|
376
|
+
// run_in_background:true the command is spawned instead, returns a task_id
|
|
377
|
+
// immediately, and streams its output into this registry. The agent then polls
|
|
378
|
+
// completion + incremental output via the check_shell tool — the
|
|
377
379
|
// run_in_background + BashOutput pattern from Claude Code.
|
|
378
380
|
//
|
|
379
381
|
// In-memory, process-lifetime: a task_id is only valid within the agent process
|
|
@@ -384,6 +386,22 @@ const MAX_BG_BUFFER = 1024 * 1024; // 1 MB retained tail per stream
|
|
|
384
386
|
const _backgroundShellTasks = new Map();
|
|
385
387
|
let _backgroundTaskSeq = 0;
|
|
386
388
|
|
|
389
|
+
function _runForegroundProcessAsync(file, args, options) {
|
|
390
|
+
return new Promise((resolve, reject) => {
|
|
391
|
+
try {
|
|
392
|
+
broker.execFile(file, args, options, (error, stdout, stderr) => {
|
|
393
|
+
if (error) {
|
|
394
|
+
reject(error);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
resolve({ stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
398
|
+
});
|
|
399
|
+
} catch (error) {
|
|
400
|
+
reject(error);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
|
|
387
405
|
function _newBgStream() {
|
|
388
406
|
return { buf: "", total: 0, dropped: 0, cursor: 0 };
|
|
389
407
|
}
|
|
@@ -1068,7 +1086,7 @@ Key behaviors:
|
|
|
1068
1086
|
- When asked to run/test something, use run_shell to execute it
|
|
1069
1087
|
- For long-running commands (builds, full test suites, dev servers) set run_shell { run_in_background: true } to get a task_id back immediately, then poll output and completion with check_shell { task_id }. Kill a backgrounded server with check_shell { task_id, kill: true } when finished
|
|
1070
1088
|
- When asked about git status, diff, log, or other repository operations, use the git tool instead of run_shell
|
|
1071
|
-
- When asked about files or code, use read_file
|
|
1089
|
+
- When asked about files or code, use search_files to locate relevant sections, then read_file with offset/limit. Follow nextRead for large files. Reuse unchanged content already in context instead of repeatedly reading the same page; re-read when the file changes or the earlier content is no longer available.
|
|
1072
1090
|
- Before renaming or changing a symbol, use code_intelligence (action: references/definition) to find every real usage instead of guessing with text search. It degrades to "unavailable" when no language server is installed — fall back to search_files then.
|
|
1073
1091
|
- After an edit, if the tool result includes a "newDiagnostics" array, you just introduced (or exposed) those errors/warnings — read them and fix before moving on. You can also run code_intelligence (action: diagnostics) on any file to check it on demand.
|
|
1074
1092
|
- If a tool result includes a "subtreeInstructions" array, you just entered a subdirectory that carries its own cc.md/CLAUDE.md/AGENTS.md — treat that content as authoritative project rules for work in that subtree (it is injected once, the first time you touch the subtree).
|
|
@@ -3557,6 +3575,7 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3557
3575
|
skillAllowlist: context.skillAllowlist ?? null,
|
|
3558
3576
|
skillOutcomeIndex: context.skillOutcomeIndex,
|
|
3559
3577
|
skillVectorAuthority: context.skillVectorAuthority,
|
|
3578
|
+
skillRetrievalRevocationReader: context.skillRetrievalRevocationReader,
|
|
3560
3579
|
cwd,
|
|
3561
3580
|
parentMessages: context.parentMessages,
|
|
3562
3581
|
interaction: context.interaction,
|
|
@@ -3600,6 +3619,7 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3600
3619
|
context.subtreeInstructionScope || context.sessionId || "__legacy__",
|
|
3601
3620
|
shellPolicyOverrides: context.shellPolicyOverrides || null,
|
|
3602
3621
|
classifyAllShell: context.classifyAllShell === true,
|
|
3622
|
+
nonBlockingShell: context.nonBlockingShell === true,
|
|
3603
3623
|
approvalGate: context.approvalGate || null,
|
|
3604
3624
|
shellConfirm: context.shellConfirm || null,
|
|
3605
3625
|
additionalDirectories: context.additionalDirectories || null,
|
|
@@ -3611,6 +3631,7 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3611
3631
|
subAgentBudget: context.subAgentBudget || null,
|
|
3612
3632
|
sessionBudget: context.sessionBudget || null,
|
|
3613
3633
|
hostResourceBudget: context.hostResourceBudget || null,
|
|
3634
|
+
readFileCache: context.readFileCache || null,
|
|
3614
3635
|
// Effective contract of THIS loop (parent ceiling for a nested spawn) +
|
|
3615
3636
|
// the MCP tool definitions this loop exposes (inheritable by a spawn).
|
|
3616
3637
|
subAgentContract: context.subAgentContract || null,
|
|
@@ -5101,6 +5122,7 @@ async function executeToolInner(
|
|
|
5101
5122
|
skillAllowlist = null,
|
|
5102
5123
|
skillOutcomeIndex,
|
|
5103
5124
|
skillVectorAuthority,
|
|
5125
|
+
skillRetrievalRevocationReader,
|
|
5104
5126
|
cwd,
|
|
5105
5127
|
parentMessages,
|
|
5106
5128
|
interaction,
|
|
@@ -5154,6 +5176,7 @@ async function executeToolInner(
|
|
|
5154
5176
|
backgroundUsageFailureState = null,
|
|
5155
5177
|
toolAdmission = null,
|
|
5156
5178
|
hostResourceBudget = null,
|
|
5179
|
+
readFileCache = null,
|
|
5157
5180
|
unattendedActionPolicy = null,
|
|
5158
5181
|
managedCheckpoint = false,
|
|
5159
5182
|
fileMutationScope = null,
|
|
@@ -5168,6 +5191,7 @@ async function executeToolInner(
|
|
|
5168
5191
|
// (spawn_sub_agent / isolated run_skill) as their parent_id.
|
|
5169
5192
|
hookTraceId = null,
|
|
5170
5193
|
skillLifecycleMode = "active",
|
|
5194
|
+
nonBlockingShell = false,
|
|
5171
5195
|
},
|
|
5172
5196
|
) {
|
|
5173
5197
|
const localToolDescriptor =
|
|
@@ -5221,11 +5245,37 @@ async function executeToolInner(
|
|
|
5221
5245
|
}
|
|
5222
5246
|
// A clear, self-correcting error beats the cryptic "EISDIR: illegal
|
|
5223
5247
|
// operation on a directory" that readFileSync throws on a directory.
|
|
5224
|
-
|
|
5248
|
+
const fileStat = fs.statSync(filePath);
|
|
5249
|
+
if (fileStat.isDirectory()) {
|
|
5225
5250
|
return attachDescriptor({
|
|
5226
5251
|
error: `Path is a directory, not a file: ${filePath}. Use list_dir to see its contents.`,
|
|
5227
5252
|
});
|
|
5228
5253
|
}
|
|
5254
|
+
const fileVersion = `${fileStat.size}:${fileStat.mtimeMs}:${fileStat.ctimeMs}`;
|
|
5255
|
+
const cacheKey = JSON.stringify([
|
|
5256
|
+
filePath,
|
|
5257
|
+
args.offset ?? null,
|
|
5258
|
+
args.limit ?? null,
|
|
5259
|
+
args.column ?? null,
|
|
5260
|
+
args.hashed === true,
|
|
5261
|
+
args.raw === true,
|
|
5262
|
+
]);
|
|
5263
|
+
const cached = readFileCache?.get(cacheKey);
|
|
5264
|
+
if (cached?.fileVersion === fileVersion) {
|
|
5265
|
+
// All permission checks ran before this point. A fresh stat still
|
|
5266
|
+
// invalidates changed/deleted files; cache only bounded pages per run.
|
|
5267
|
+
_recordFileObservation(filePath);
|
|
5268
|
+
readFileCache.delete(cacheKey);
|
|
5269
|
+
readFileCache.set(cacheKey, cached);
|
|
5270
|
+
return attachDescriptor(
|
|
5271
|
+
await _withSubtreeInstructions(
|
|
5272
|
+
structuredClone(cached.page),
|
|
5273
|
+
filePath,
|
|
5274
|
+
cwd,
|
|
5275
|
+
subtreeInstructionScope,
|
|
5276
|
+
),
|
|
5277
|
+
);
|
|
5278
|
+
}
|
|
5229
5279
|
const content = fs.readFileSync(filePath, "utf8");
|
|
5230
5280
|
// Record the mtime so a later edit can detect an external change that
|
|
5231
5281
|
// happened between this read and the edit (read-freshness guard).
|
|
@@ -5234,69 +5284,32 @@ async function executeToolInner(
|
|
|
5234
5284
|
// outputs summarized) so the model can find cells for notebook_edit
|
|
5235
5285
|
// without ingesting raw JSON / base64 output blobs. `raw:true` returns the
|
|
5236
5286
|
// underlying JSON. Non-.ipynb reads are unchanged.
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
nbView.length > 50000
|
|
5242
|
-
? {
|
|
5243
|
-
content: nbView.substring(0, 50000) + "\n...(truncated)",
|
|
5244
|
-
size: nbView.length,
|
|
5245
|
-
notebook: true,
|
|
5246
|
-
}
|
|
5247
|
-
: { content: nbView, notebook: true },
|
|
5248
|
-
);
|
|
5249
|
-
}
|
|
5250
|
-
}
|
|
5287
|
+
const nbView =
|
|
5288
|
+
args.raw !== true && /\.ipynb$/i.test(filePath)
|
|
5289
|
+
? renderNotebook(content)
|
|
5290
|
+
: null;
|
|
5251
5291
|
// Hashline mode: prefix each line with a 6-char content hash tag
|
|
5252
5292
|
// so downstream edit_file_hashed calls can anchor by hash.
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
const end = limit != null ? start + limit : lines.length;
|
|
5270
|
-
rendered = lines.slice(start, end).join("\n");
|
|
5271
|
-
range = {
|
|
5272
|
-
startLine: Math.min(start + 1, lines.length),
|
|
5273
|
-
endLine: Math.min(end, lines.length),
|
|
5274
|
-
totalLines: lines.length,
|
|
5275
|
-
};
|
|
5276
|
-
}
|
|
5277
|
-
|
|
5278
|
-
if (rendered.length > 50000) {
|
|
5279
|
-
return attachDescriptor(
|
|
5280
|
-
await _withSubtreeInstructions(
|
|
5281
|
-
{
|
|
5282
|
-
content: rendered.substring(0, 50000) + "\n...(truncated)",
|
|
5283
|
-
size: rendered.length,
|
|
5284
|
-
hashed: args.hashed === true,
|
|
5285
|
-
...(range ? { range } : {}),
|
|
5286
|
-
},
|
|
5287
|
-
filePath,
|
|
5288
|
-
cwd,
|
|
5289
|
-
subtreeInstructionScope,
|
|
5290
|
-
),
|
|
5291
|
-
);
|
|
5293
|
+
const rendered =
|
|
5294
|
+
nbView || (args.hashed === true ? annotateLines(content) : content);
|
|
5295
|
+
const page = buildReadFilePage(rendered, args, {
|
|
5296
|
+
filePath,
|
|
5297
|
+
fileVersion,
|
|
5298
|
+
maxChars: MAX_TOOL_RESULT_CHARS,
|
|
5299
|
+
});
|
|
5300
|
+
if (nbView) page.notebook = true;
|
|
5301
|
+
if (readFileCache && !page.error) {
|
|
5302
|
+
readFileCache.delete(cacheKey);
|
|
5303
|
+
readFileCache.set(cacheKey, {
|
|
5304
|
+
fileVersion,
|
|
5305
|
+
page: structuredClone(page),
|
|
5306
|
+
});
|
|
5307
|
+
while (readFileCache.size > 8)
|
|
5308
|
+
readFileCache.delete(readFileCache.keys().next().value);
|
|
5292
5309
|
}
|
|
5293
5310
|
return attachDescriptor(
|
|
5294
5311
|
await _withSubtreeInstructions(
|
|
5295
|
-
|
|
5296
|
-
content: rendered,
|
|
5297
|
-
hashed: args.hashed === true,
|
|
5298
|
-
...(range ? { range } : {}),
|
|
5299
|
-
},
|
|
5312
|
+
page,
|
|
5300
5313
|
filePath,
|
|
5301
5314
|
cwd,
|
|
5302
5315
|
subtreeInstructionScope,
|
|
@@ -6637,7 +6650,23 @@ async function executeToolInner(
|
|
|
6637
6650
|
auditContext: createShellProcessAuditContext(),
|
|
6638
6651
|
...processProvenance,
|
|
6639
6652
|
};
|
|
6640
|
-
if (pluginBinInvocation) {
|
|
6653
|
+
if (pluginBinInvocation && nonBlockingShell) {
|
|
6654
|
+
const res = await _runForegroundProcessAsync(
|
|
6655
|
+
executionPlugin.sandboxExecution?.kind === "strict-plugin-node-bin"
|
|
6656
|
+
? executionPlugin.sandboxExecution.runtimePath
|
|
6657
|
+
: executionPlugin.command,
|
|
6658
|
+
executionPlugin.argv,
|
|
6659
|
+
{
|
|
6660
|
+
...brokerExecOpts,
|
|
6661
|
+
cwd:
|
|
6662
|
+
executionPlugin.sandboxExecution?.workingDirectory ||
|
|
6663
|
+
brokerExecOpts.cwd,
|
|
6664
|
+
shell: false,
|
|
6665
|
+
windowsHide: true,
|
|
6666
|
+
},
|
|
6667
|
+
);
|
|
6668
|
+
output = res.stdout;
|
|
6669
|
+
} else if (pluginBinInvocation) {
|
|
6641
6670
|
const res = broker.spawnSync(
|
|
6642
6671
|
executionPlugin.sandboxExecution?.kind === "strict-plugin-node-bin"
|
|
6643
6672
|
? executionPlugin.sandboxExecution.runtimePath
|
|
@@ -6663,8 +6692,25 @@ async function executeToolInner(
|
|
|
6663
6692
|
throw e;
|
|
6664
6693
|
}
|
|
6665
6694
|
output = res.stdout ?? "";
|
|
6695
|
+
} else if (shellInv.useDefaultShell && nonBlockingShell) {
|
|
6696
|
+
const res = await _runForegroundProcessAsync(args.command, [], {
|
|
6697
|
+
...brokerExecOpts,
|
|
6698
|
+
shell: true,
|
|
6699
|
+
windowsHide: true,
|
|
6700
|
+
});
|
|
6701
|
+
output = res.stdout;
|
|
6666
6702
|
} else if (shellInv.useDefaultShell) {
|
|
6667
6703
|
output = broker.execSync(args.command, brokerExecOpts);
|
|
6704
|
+
} else if (nonBlockingShell) {
|
|
6705
|
+
const res = await _runForegroundProcessAsync(
|
|
6706
|
+
shellInv.file,
|
|
6707
|
+
shellInv.argv,
|
|
6708
|
+
{
|
|
6709
|
+
...brokerExecOpts,
|
|
6710
|
+
windowsHide: true,
|
|
6711
|
+
},
|
|
6712
|
+
);
|
|
6713
|
+
output = res.stdout;
|
|
6668
6714
|
} else {
|
|
6669
6715
|
// PowerShell route: explicit argv, no intermediate default shell.
|
|
6670
6716
|
// Reproduce execSync's contract so the shared catch shapes errors
|
|
@@ -8232,6 +8278,7 @@ async function executeToolInner(
|
|
|
8232
8278
|
target: { os: process.platform },
|
|
8233
8279
|
vectorScores: vector?.scores ?? null,
|
|
8234
8280
|
outcomeMetrics: outcomeAuthority.metrics,
|
|
8281
|
+
revocationReader: skillRetrievalRevocationReader ?? null,
|
|
8235
8282
|
topK: Math.min(64, Math.max(1, skills.length)),
|
|
8236
8283
|
});
|
|
8237
8284
|
const byDigest = new Map(
|
|
@@ -9275,6 +9322,46 @@ export function capToolResultString(serialized, max = MAX_TOOL_RESULT_CHARS) {
|
|
|
9275
9322
|
);
|
|
9276
9323
|
}
|
|
9277
9324
|
|
|
9325
|
+
/** Avoid injecting the same file page twice while its original is still visible. */
|
|
9326
|
+
export function toolResultForModel(tool, result, messages) {
|
|
9327
|
+
const serialized = capToolResultString(safeStringifyToolResult(result));
|
|
9328
|
+
if (
|
|
9329
|
+
tool !== "read_file" ||
|
|
9330
|
+
result?.error ||
|
|
9331
|
+
!result?.path ||
|
|
9332
|
+
!result.content ||
|
|
9333
|
+
result.subtreeInstructions?.length
|
|
9334
|
+
) {
|
|
9335
|
+
return serialized;
|
|
9336
|
+
}
|
|
9337
|
+
const previous = messages.find((message) => {
|
|
9338
|
+
if (message.role !== "tool" || typeof message.content !== "string")
|
|
9339
|
+
return false;
|
|
9340
|
+
try {
|
|
9341
|
+
const prior = JSON.parse(message.content.split("\n\n[Budget ")[0]);
|
|
9342
|
+
return (
|
|
9343
|
+
prior.path === result.path &&
|
|
9344
|
+
prior.fileVersion === result.fileVersion &&
|
|
9345
|
+
prior.content === result.content &&
|
|
9346
|
+
prior.hashed === result.hashed &&
|
|
9347
|
+
JSON.stringify(prior.range) === JSON.stringify(result.range)
|
|
9348
|
+
);
|
|
9349
|
+
} catch {
|
|
9350
|
+
return false;
|
|
9351
|
+
}
|
|
9352
|
+
});
|
|
9353
|
+
if (!previous) return serialized;
|
|
9354
|
+
return JSON.stringify({
|
|
9355
|
+
path: result.path,
|
|
9356
|
+
alreadyRead: true,
|
|
9357
|
+
previousToolCallId: previous.tool_call_id,
|
|
9358
|
+
readAt: result.toolTelemetryRecord?.timestamp,
|
|
9359
|
+
...(result.range ? { range: result.range } : {}),
|
|
9360
|
+
...(result.nextRead ? { nextRead: result.nextRead } : {}),
|
|
9361
|
+
hint: "This unchanged file page is already present in the earlier tool result. Use that content to continue the task. For more content, use nextRead or search_files for a different section; do not repeat this same read.",
|
|
9362
|
+
});
|
|
9363
|
+
}
|
|
9364
|
+
|
|
9278
9365
|
/**
|
|
9279
9366
|
* Serialize a tool result for the transcript without ever throwing. A plain
|
|
9280
9367
|
* `JSON.stringify` throws on a circular reference, a BigInt, or a value whose
|
|
@@ -10679,6 +10766,10 @@ function _openAIProviderRequestReceipt(response, data, clientRequestId) {
|
|
|
10679
10766
|
* @returns {Promise<object>} response with .message
|
|
10680
10767
|
*/
|
|
10681
10768
|
export async function chatWithTools(rawMessages, options) {
|
|
10769
|
+
const evolutionIngress =
|
|
10770
|
+
options.evolutionIngress == null
|
|
10771
|
+
? null
|
|
10772
|
+
: captureAgentEvolutionIngress(options.evolutionIngress);
|
|
10682
10773
|
const {
|
|
10683
10774
|
provider,
|
|
10684
10775
|
model,
|
|
@@ -10720,13 +10811,22 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
10720
10811
|
const lastUserMsg = [...providerMessages]
|
|
10721
10812
|
.reverse()
|
|
10722
10813
|
.find((m) => m.role === "user");
|
|
10723
|
-
|
|
10814
|
+
let messages =
|
|
10724
10815
|
ce && !canonicalPlan
|
|
10725
10816
|
? ce.buildOptimizedMessages(providerMessages, {
|
|
10726
10817
|
userQuery: lastUserMsg?.content,
|
|
10727
10818
|
})
|
|
10728
10819
|
: providerMessages;
|
|
10729
10820
|
|
|
10821
|
+
if (evolutionIngress !== null) {
|
|
10822
|
+
const projected = await evolutionIngress.prepareModelRequest({
|
|
10823
|
+
messages,
|
|
10824
|
+
tools,
|
|
10825
|
+
});
|
|
10826
|
+
messages = projected.messages;
|
|
10827
|
+
tools = projected.tools;
|
|
10828
|
+
}
|
|
10829
|
+
|
|
10730
10830
|
throwIfAborted(signal);
|
|
10731
10831
|
|
|
10732
10832
|
if (provider === "ollama") {
|
|
@@ -12838,7 +12938,26 @@ function _instrumentAutoCompactorUsage(compactor, options) {
|
|
|
12838
12938
|
* loaded — callers treat that as "don't compact". Cached (including null) so we
|
|
12839
12939
|
* import once per run, not once per iteration.
|
|
12840
12940
|
*/
|
|
12941
|
+
const evolutionAutoCompactors = new WeakMap();
|
|
12942
|
+
|
|
12841
12943
|
async function _getAutoCompactor(options) {
|
|
12944
|
+
const evolutionIngress =
|
|
12945
|
+
options.evolutionIngress == null
|
|
12946
|
+
? null
|
|
12947
|
+
: captureAgentEvolutionIngress(options.evolutionIngress);
|
|
12948
|
+
if (
|
|
12949
|
+
evolutionIngress !== null &&
|
|
12950
|
+
(typeof options.compactionLlmQuery === "function" ||
|
|
12951
|
+
(options._autoCompactor != null &&
|
|
12952
|
+
evolutionAutoCompactors.get(options._autoCompactor) !==
|
|
12953
|
+
evolutionIngress))
|
|
12954
|
+
) {
|
|
12955
|
+
const error = new TypeError(
|
|
12956
|
+
"Evolution auto-compaction requires the canonical model transport and owned compressor",
|
|
12957
|
+
);
|
|
12958
|
+
error.code = "CC_AGENT_EVOLUTION_INGRESS_FAILED";
|
|
12959
|
+
throw error;
|
|
12960
|
+
}
|
|
12842
12961
|
if (Object.prototype.hasOwnProperty.call(options, "_autoCompactor")) {
|
|
12843
12962
|
return _instrumentAutoCompactorUsage(options._autoCompactor, options);
|
|
12844
12963
|
}
|
|
@@ -12932,8 +13051,11 @@ async function _getAutoCompactor(options) {
|
|
|
12932
13051
|
}
|
|
12933
13052
|
} catch (error) {
|
|
12934
13053
|
if (canonicalRequired) throw error;
|
|
13054
|
+
if (error?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw error;
|
|
12935
13055
|
compressor = null;
|
|
12936
13056
|
}
|
|
13057
|
+
if (evolutionIngress !== null && compressor !== null)
|
|
13058
|
+
evolutionAutoCompactors.set(compressor, evolutionIngress);
|
|
12937
13059
|
try {
|
|
12938
13060
|
options._autoCompactor = compressor;
|
|
12939
13061
|
} catch {
|
|
@@ -13156,6 +13278,20 @@ function permissionDecision(callId, tool, result) {
|
|
|
13156
13278
|
}
|
|
13157
13279
|
|
|
13158
13280
|
export async function* agentLoop(messages, options) {
|
|
13281
|
+
const configuredChatFn = options.chatFn;
|
|
13282
|
+
const evolutionIngress =
|
|
13283
|
+
options.evolutionIngress == null
|
|
13284
|
+
? null
|
|
13285
|
+
: captureAgentEvolutionIngress(options.evolutionIngress);
|
|
13286
|
+
let llmCall = configuredChatFn || chatWithTools;
|
|
13287
|
+
if (evolutionIngress !== null && configuredChatFn) {
|
|
13288
|
+
const { captureCanonicalFallbackChatFn } =
|
|
13289
|
+
await import("./fallback-model.js");
|
|
13290
|
+
llmCall = captureCanonicalFallbackChatFn(
|
|
13291
|
+
configuredChatFn,
|
|
13292
|
+
evolutionIngress,
|
|
13293
|
+
);
|
|
13294
|
+
}
|
|
13159
13295
|
// Shared iteration budget — replaces hardcoded MAX_ITERATIONS.
|
|
13160
13296
|
// When options.iterationBudget is provided (e.g. from parent agent),
|
|
13161
13297
|
// the same budget instance is shared, so parent+child consume from one pool.
|
|
@@ -13222,10 +13358,12 @@ export async function* agentLoop(messages, options) {
|
|
|
13222
13358
|
options.mcpConflictScheduler || createMcpConflictScheduler();
|
|
13223
13359
|
|
|
13224
13360
|
const toolContext = {
|
|
13361
|
+
readFileCache: new Map(),
|
|
13225
13362
|
hookDb: hermeticExecution ? null : options.hookDb || null,
|
|
13226
13363
|
skillLoader: options.skillLoader || _defaultSkillLoader,
|
|
13227
13364
|
skillOutcomeIndex: options.skillOutcomeIndex,
|
|
13228
13365
|
skillVectorAuthority: options.skillVectorAuthority,
|
|
13366
|
+
skillRetrievalRevocationReader: options.skillRetrievalRevocationReader,
|
|
13229
13367
|
// Hook-envelope tracing (P2 unified event bus): every settings-hook payload
|
|
13230
13368
|
// fired during this run carries trace_id = this run's id; a spawned child
|
|
13231
13369
|
// loop carries parent_id = the spawning run's id (threaded by
|
|
@@ -13295,6 +13433,7 @@ export async function* agentLoop(messages, options) {
|
|
|
13295
13433
|
// Parent LLM config — forwarded to spawn_sub_agent so a delegated subagent
|
|
13296
13434
|
// inherits the provider/key and can override just the model (cc agents `model:`).
|
|
13297
13435
|
llmOptions: {
|
|
13436
|
+
...(evolutionIngress === null ? {} : { evolutionIngress }),
|
|
13298
13437
|
provider: options.provider || null,
|
|
13299
13438
|
model: options.model || null,
|
|
13300
13439
|
baseUrl: options.baseUrl || null,
|
|
@@ -13334,6 +13473,9 @@ export async function* agentLoop(messages, options) {
|
|
|
13334
13473
|
// verification allowlist (npm test / rg / …) is classified through the
|
|
13335
13474
|
// ApprovalGate instead of fast-pathed, so no shell command auto-runs.
|
|
13336
13475
|
classifyAllShell: options.classifyAllShell || false,
|
|
13476
|
+
// Persistent stream hosts must not block their own session-lease heartbeat
|
|
13477
|
+
// while a foreground shell command (notably a networked git push) runs.
|
|
13478
|
+
nonBlockingShell: options.nonBlockingShell === true,
|
|
13337
13479
|
approvalGate: hermeticExecution ? null : options.approvalGate || null,
|
|
13338
13480
|
shellConfirm: hermeticExecution ? null : options.shellConfirm || null,
|
|
13339
13481
|
// Interactive sessions (the REPL) set this so run_code is gated through the
|
|
@@ -13467,11 +13609,8 @@ export async function* agentLoop(messages, options) {
|
|
|
13467
13609
|
}
|
|
13468
13610
|
}
|
|
13469
13611
|
|
|
13470
|
-
//
|
|
13471
|
-
//
|
|
13472
|
-
// real provider. Production code path is unchanged — the fallback is the
|
|
13473
|
-
// real `chatWithTools`.
|
|
13474
|
-
let llmCall = options.chatFn || chatWithTools;
|
|
13612
|
+
// llmCall was captured before startup awaits. With evolution ingress, only
|
|
13613
|
+
// a factory-owned canonical fallback bound to this Run may replace it.
|
|
13475
13614
|
|
|
13476
13615
|
// Runnable-first auth recovery: if the resolved provider's key is missing /
|
|
13477
13616
|
// wrong / expired, self-heal to a provider we can actually run (endpoint-
|
|
@@ -14012,6 +14151,7 @@ export async function* agentLoop(messages, options) {
|
|
|
14012
14151
|
} catch (_e) {
|
|
14013
14152
|
if (isAbortError(_e) || signal?.aborted) throw _e;
|
|
14014
14153
|
if (_e?.runtimeLedgerPersistence === true) throw _e;
|
|
14154
|
+
if (_e?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw _e;
|
|
14015
14155
|
if (
|
|
14016
14156
|
_e?.workflowEffectOutcomeUnknown === true &&
|
|
14017
14157
|
_e?.compactionFailureReported === true
|
|
@@ -14196,9 +14336,13 @@ export async function* agentLoop(messages, options) {
|
|
|
14196
14336
|
canonicalProviderContext.selectedToolNames,
|
|
14197
14337
|
}
|
|
14198
14338
|
: effectiveToolOptions;
|
|
14199
|
-
const
|
|
14339
|
+
const requestOptions = providerRequestId
|
|
14200
14340
|
? { ...plannedProviderOptions, providerRequestId }
|
|
14201
14341
|
: plannedProviderOptions;
|
|
14342
|
+
const providerCallOptions =
|
|
14343
|
+
evolutionIngress !== null
|
|
14344
|
+
? { ...requestOptions, evolutionIngress }
|
|
14345
|
+
: requestOptions;
|
|
14202
14346
|
const modelUsageCall = {
|
|
14203
14347
|
type: "model-usage-started",
|
|
14204
14348
|
callId: _newModelUsageCallId("model"),
|
|
@@ -14646,8 +14790,10 @@ export async function* agentLoop(messages, options) {
|
|
|
14646
14790
|
failed,
|
|
14647
14791
|
});
|
|
14648
14792
|
const warningMsg = budget.toWarningMessage();
|
|
14649
|
-
const resultStr =
|
|
14650
|
-
|
|
14793
|
+
const resultStr = toolResultForModel(
|
|
14794
|
+
call.function.name,
|
|
14795
|
+
toolResult,
|
|
14796
|
+
messages,
|
|
14651
14797
|
);
|
|
14652
14798
|
const toolContent = warningMsg
|
|
14653
14799
|
? `${resultStr}\n\n${warningMsg}`
|
|
@@ -15096,9 +15242,7 @@ export async function* agentLoop(messages, options) {
|
|
|
15096
15242
|
// Cap an individual tool result so one giant output can't blow the
|
|
15097
15243
|
// context — but tell the model when we cut it (no more silent
|
|
15098
15244
|
// mid-content slice). See MAX_TOOL_RESULT_CHARS / capToolResultString.
|
|
15099
|
-
const resultStr =
|
|
15100
|
-
safeStringifyToolResult(toolResult),
|
|
15101
|
-
);
|
|
15245
|
+
const resultStr = toolResultForModel(toolName, toolResult, messages);
|
|
15102
15246
|
const toolContent = warningMsg
|
|
15103
15247
|
? `${resultStr}\n\n${warningMsg}`
|
|
15104
15248
|
: resultStr;
|
|
@@ -15189,7 +15333,7 @@ export async function* agentLoop(messages, options) {
|
|
|
15189
15333
|
backgroundUsageFailureState,
|
|
15190
15334
|
);
|
|
15191
15335
|
yield* _drainSubAgentUsage(subAgentUsageSink);
|
|
15192
|
-
yield { type: "iteration-budget-exhausted", budget: budget.
|
|
15336
|
+
yield { type: "iteration-budget-exhausted", budget: budget.limit };
|
|
15193
15337
|
yield {
|
|
15194
15338
|
type: "response-complete",
|
|
15195
15339
|
content: `(Iteration budget exhausted — ${budget.toSummary()})`,
|
|
@@ -34,8 +34,13 @@ import { registerHostHooksV2Workspace } from "../lib/hooks-v2-workspace-context.
|
|
|
34
34
|
import { captureStructuredMemoryPolicyReceiptWriter } from "../lib/evolution/structured-memory-policy-receipt-writer.js";
|
|
35
35
|
import { captureStructuredMemoryAgentControlPlane } from "../lib/evolution/structured-memory-agent-control-plane.js";
|
|
36
36
|
import { captureAgentEvolutionIngress } from "../lib/evolution/agent-evolution-ingress.js";
|
|
37
|
+
import {
|
|
38
|
+
AGENT_EVOLUTION_SESSION_SCHEMA,
|
|
39
|
+
waitForAgentEvolutionSession,
|
|
40
|
+
} from "../lib/evolution/agent-evolution-session-lifecycle.js";
|
|
37
41
|
import { captureAgentSkillOutcomeIndex } from "../lib/evolution/agent-evolution-runtime-composition-brand.js";
|
|
38
42
|
import { captureSkillVectorAuthority } from "../lib/skill-vector-authority.js";
|
|
43
|
+
import { captureSkillRetrievalRevocationReader } from "../lib/evolution/skill-retrieval-revocation-authority.js";
|
|
39
44
|
|
|
40
45
|
const {
|
|
41
46
|
DEFAULT_ALLOWED_MCP_SERVER_NAMES,
|
|
@@ -79,6 +84,12 @@ export class AgentRuntime {
|
|
|
79
84
|
deps.skillVectorAuthority == null
|
|
80
85
|
? null
|
|
81
86
|
: captureSkillVectorAuthority(deps.skillVectorAuthority);
|
|
87
|
+
this.skillRetrievalRevocationReader =
|
|
88
|
+
deps.skillRetrievalRevocationReader == null
|
|
89
|
+
? null
|
|
90
|
+
: captureSkillRetrievalRevocationReader(
|
|
91
|
+
deps.skillRetrievalRevocationReader,
|
|
92
|
+
);
|
|
82
93
|
if (
|
|
83
94
|
this.evolutionIngress !== null &&
|
|
84
95
|
this.skillOutcomeIndex !== null &&
|
|
@@ -99,6 +110,21 @@ export class AgentRuntime {
|
|
|
99
110
|
) {
|
|
100
111
|
throw new Error("Agent retrieval authorities must share one tenant");
|
|
101
112
|
}
|
|
113
|
+
if (
|
|
114
|
+
this.skillVectorAuthority !== null &&
|
|
115
|
+
this.skillRetrievalRevocationReader !== null &&
|
|
116
|
+
this.skillVectorAuthority.tenantId !==
|
|
117
|
+
this.skillRetrievalRevocationReader.tenantId
|
|
118
|
+
) {
|
|
119
|
+
throw new Error("Agent retrieval authorities must share one tenant");
|
|
120
|
+
}
|
|
121
|
+
if (
|
|
122
|
+
retrievalTenant !== null &&
|
|
123
|
+
this.skillRetrievalRevocationReader !== null &&
|
|
124
|
+
retrievalTenant !== this.skillRetrievalRevocationReader.tenantId
|
|
125
|
+
) {
|
|
126
|
+
throw new Error("Agent retrieval authorities must share one tenant");
|
|
127
|
+
}
|
|
102
128
|
this.structuredMemoryControlPlane =
|
|
103
129
|
deps.structuredMemoryControlPlane == null
|
|
104
130
|
? null
|
|
@@ -333,8 +359,20 @@ export class AgentRuntime {
|
|
|
333
359
|
...(this.skillVectorAuthority === null
|
|
334
360
|
? {}
|
|
335
361
|
: { skillVectorAuthority: this.skillVectorAuthority }),
|
|
362
|
+
...(this.skillRetrievalRevocationReader === null
|
|
363
|
+
? {}
|
|
364
|
+
: {
|
|
365
|
+
skillRetrievalRevocationReader: this.skillRetrievalRevocationReader,
|
|
366
|
+
}),
|
|
336
367
|
});
|
|
337
368
|
if (this.evolutionIngress !== null) {
|
|
369
|
+
if (result?.schema === AGENT_EVOLUTION_SESSION_SCHEMA) {
|
|
370
|
+
return await waitForAgentEvolutionSession(
|
|
371
|
+
result,
|
|
372
|
+
this.evolutionIngress,
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
if (result?.started === false) return result;
|
|
338
376
|
await this.evolutionIngress.complete();
|
|
339
377
|
}
|
|
340
378
|
return result;
|
|
@@ -510,6 +548,11 @@ export class AgentRuntime {
|
|
|
510
548
|
...(this.skillVectorAuthority === null
|
|
511
549
|
? {}
|
|
512
550
|
: { skillVectorAuthority: this.skillVectorAuthority }),
|
|
551
|
+
...(this.skillRetrievalRevocationReader === null
|
|
552
|
+
? {}
|
|
553
|
+
: {
|
|
554
|
+
skillRetrievalRevocationReader: this.skillRetrievalRevocationReader,
|
|
555
|
+
}),
|
|
513
556
|
});
|
|
514
557
|
|
|
515
558
|
server.on("connection", ({ clientId, ip }) => {
|
|
@@ -28,7 +28,7 @@ const CODING_AGENT_TOOL_CONTRACTS = Object.freeze([
|
|
|
28
28
|
kind: "filesystem",
|
|
29
29
|
tier: "mvp",
|
|
30
30
|
description:
|
|
31
|
-
"Read a file's content.
|
|
31
|
+
"Read a file's content. Use search_files to locate relevant sections and offset+limit to read them. For large files, follow the returned nextRead cursor; range describes only the lines actually returned. Reuse unchanged content already in context instead of re-reading the same page. Jupyter notebooks (.ipynb) are rendered as a compact cell listing for notebook_edit — pass raw:true for underlying JSON.",
|
|
32
32
|
inputSchema: {
|
|
33
33
|
type: "object",
|
|
34
34
|
properties: {
|
|
@@ -43,6 +43,12 @@ const CODING_AGENT_TOOL_CONTRACTS = Object.freeze([
|
|
|
43
43
|
description:
|
|
44
44
|
"Maximum number of lines to return starting at offset (omit to read to end, subject to the size cap).",
|
|
45
45
|
},
|
|
46
|
+
column: {
|
|
47
|
+
type: "integer",
|
|
48
|
+
minimum: 1,
|
|
49
|
+
description:
|
|
50
|
+
"1-based character position within the first rendered line. Use the column from nextRead to continue an oversized single line without repeating its beginning.",
|
|
51
|
+
},
|
|
46
52
|
hashed: {
|
|
47
53
|
type: "boolean",
|
|
48
54
|
description:
|