chainlesschain 0.166.17 → 0.166.18
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 +14 -7
- package/package.json +1 -1
- package/src/assets/web-panel/assets/{AIOps-CVW2n2rh.js → AIOps-CQSBl3hY.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DtuM163O.js → ActionButton-IQt-vRLt.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BXvl_qHu.js → Analytics-DkHC8O7k.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-VDBTFKOp.js → AppLayout-CSti2P2T.js} +3 -3
- package/src/assets/web-panel/assets/{Artifacts-BNz2xCiG.js → Artifacts-C57hxn3v.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DTu9Hn9P.js → Audit-DByLntcf.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-D2OCPzLe.js → BackgroundAgents-D1Bd2EOa.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-C9M-vG7G.js → Backup-VstHzHng.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BUkCNiUQ.js → BaseInput-CLhdexIf.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-OJ2ajF7l.js → Chat-BefC_JZS.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-BdZt76Ab.js → ChatBubbleRenderer-DbXMvgmn.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-C1gXKDsc.js → Checkbox-CEY982vx.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BXbznLg7.js → Codegen-Dcm_DTvJ.js} +1 -1
- package/src/assets/web-panel/assets/{Col-CbCq5N0i.js → Col-C8SSu4KA.js} +1 -1
- package/src/assets/web-panel/assets/{Community-V8Ks6Yun.js → Community-BVV9vwRR.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-DkeHQTpQ.js → Compact-B7c5Vo18.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-JeLKwn4Q.js → Compliance-Tq9jSZ5a.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-azfetcBz.js → Cowork-BJUjT09Q.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-Q691i_Gp.js → Cron-CjV9PEaS.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-BLjDRbr_.js → Crosschain-Dl7ReL8F.js} +1 -1
- package/src/assets/web-panel/assets/{DID-D8ptXplK.js → DID-CG8PjWmM.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-Ctj2VVZL.js → Dashboard-CDBM6wmF.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-D8VgkMJ8.js → Dropdown-8_55bXTD.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-CQPe5S6q.js → EmailListRenderer-D3qOU1Cm.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-ySA-7SiN.js → FamilyGuardDashboard-Bv5oWMZF.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-1PMD-fBf.js → Federation-hpZ1xkKd.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-C_jr6U4Q.js → FormItemContext-BN7GT191.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-Bu3bKf2B.js → GenericCardRenderer-PCRhfA7M.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Dv4Fa_T5.js → Git-CIlP2vy7.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-DOEy1n1k.js → Governance-81lgm7YL.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-DkvqzWcJ.js → Inference-Cs24xMOV.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DdUJK949.js → KnowledgeGraph-CrJLVCZo.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CRelcdUZ.js → Logs-DLyO8RKT.js} +2 -2
- package/src/assets/web-panel/assets/{MarkdownRenderer-0AHbbTA4.js → MarkdownRenderer-DBOqijrP.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-BuuBKsev.js → Marketplace-Dz7AbQZc.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DlgpEmA1.js → McpTools-BM0aFiWv.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-DTfdqUGy.js → Memory-C9SJzENX.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-CXLE5ZFO.js → MobileBridge-BO2HnNRk.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-Dz25OB0n.js → MobileProjects-CK_jMz0l.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-kEL0fhgD.js → Mtc-CfhrJsdO.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-BE4UvFJU.js → MtcAudit-BE2ELxgI.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-CSApSn8c.js → Multisig-CgR_E3Jd.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-D11FpKWx.js → NLProgramming-Cw9445_K.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CDL-D2CS.js → Notes-DZimkTrb.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-C0Q6lO-c.js → NotificationSettings-DxHVh4uT.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-Iy-pnX56.js +1 -0
- package/src/assets/web-panel/assets/{Organization-Dc-maVAq.js → Organization-pPXJtWo4.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-B5mUpSvi.js → Overflow-YamdTJwA.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-TjXV53wq.js → P2P-BvqP53x7.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-Blz1Xn2n.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-DKRzQ2O6.js → Permissions-CgFRQqFJ.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-Dx2eqft8.js → PersonalDataHub-CFeo3-6O.js} +4 -4
- package/src/assets/web-panel/assets/{Pipeline-CnYZMB5p.js → Pipeline-BkaRojEK.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BonKpPnp.js → Privacy-BNZEx2Qp.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DWO0Du3J.js → ProjectInit-HUBOgEEK.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-C9jqyYRv.js → ProjectSettings-CFMmhROS.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-CYpKwXbz.js → Projects-Dc517BXp.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-CW-fkwJq.js → Providers-DTLf8bgj.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-Cw0J3Zud.js → QrScannerModal-BBNjPszk.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-BH4A4IpR.js → QuickAsk-DCsHvk3G.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CDwMwJus.js → Recommend-Dpr5YSop.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-DKIPwzTf.js → RemoteSession-DmKnvqGg.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-CklDj7qS.js → Reputation-CSRfuurX.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DJWZKsH0.js → Row-CDj3pQ_w.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BfSLCewo.js → RssFeed-DI0a_kNq.js} +2 -2
- package/src/assets/web-panel/assets/{Search-B0IST--x.js → Search-jAy7B2nU.js} +1 -1
- package/src/assets/web-panel/assets/{Security-h1sYNWtt.js → Security-CkHTqYhc.js} +4 -4
- package/src/assets/web-panel/assets/{Services-Gh0-oxI_.js → Services-CP-0Nzga.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CNDV_jOs.js → Skeleton-BkF5-p3n.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-ByCLTh1n.js → Skills-BDu-utDE.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-BfyrJTJz.js → Sla-CQvq_2Qb.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-BQzo9kNX.js → SpeechSettings-T7Ap512g.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-B6fS6z_1.js → SyncSettings-Bt-PLvot.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-C-uKCP-l.js → Tasks-yLEcCogg.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-D6oDy7wL.js → Templates-ByN3fmbr.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-D3LT2wNQ.js → Tenant-DBI7hITH.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BteLcv_O.js → Terminal-B77_DlGX.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-DHHuxfqH.js → TimelineRenderer-CsLTB_QO.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BRQeykXw.js → Tokens-BV2N6cR8.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-p2XaFWEu.js → Trigger-CjXWGH3p.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-BxadBMft.js → Trust-uqXIq3WC.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-DRBP7LDk.js → UkeySign-D-6qu4vY.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CZ3NZkh7.js → VideoEditing-CxGmx_2e.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-C3NTBN7G.js → Wallet-DSq7WlAg.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-C7LVgMlb.js → WebAuthn-CDBiD57O.js} +2 -2
- package/src/assets/web-panel/assets/{WorkflowEditor-0_Iveog7.js → WorkflowEditor-Z8f63TSb.js} +1 -1
- package/src/assets/web-panel/assets/{chat-DzzluYo3.js → chat-B-UZFBjy.js} +1 -1
- package/src/assets/web-panel/assets/{colors-DSMYXpaj.js → colors-CFk7K-7Q.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-W76u1VSV.js → compact-item-X0IVMvgi.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-otsESjb5.js → createContext-DWg4j2n6.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-B2IW1J_J.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-3sNLrvug.js → hasIn-CkVCwNNF.js} +1 -1
- package/src/assets/web-panel/assets/{index-BdtmEKat.js → index-5OcZHdzc.js} +1 -1
- package/src/assets/web-panel/assets/{index-DS9WYDMf.js → index-B273IY-E.js} +1 -1
- package/src/assets/web-panel/assets/{index-NaO9AE-F.js → index-B3-B3FWD.js} +1 -1
- package/src/assets/web-panel/assets/{index-BcGJtmHM.js → index-BB4KHHcv.js} +1 -1
- package/src/assets/web-panel/assets/index-BCp2ir-1.js +1 -0
- package/src/assets/web-panel/assets/{index-pVm_iUre.js → index-BG-GaZri.js} +1 -1
- package/src/assets/web-panel/assets/{index-BpcQYzP7.js → index-BPBia4b-.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXLx9HfA.js → index-BipwEbTA.js} +1 -1
- package/src/assets/web-panel/assets/{index-uSCkbpZH.js → index-BoskgPt9.js} +1 -1
- package/src/assets/web-panel/assets/{index-DMmdIpLA.js → index-Btqk6zWb.js} +1 -1
- package/src/assets/web-panel/assets/index-Bw4iuzRD.js +1 -0
- package/src/assets/web-panel/assets/{index-DLDh1OW3.js → index-BzXjYUmd.js} +1 -1
- package/src/assets/web-panel/assets/{index-B9X_jqXe.js → index-C1ZAOJRW.js} +1 -1
- package/src/assets/web-panel/assets/{index-vBKPcmAP.js → index-CCLwoATF.js} +1 -1
- package/src/assets/web-panel/assets/{index-vUmYkqmu.js → index-CDfSD07S.js} +1 -1
- package/src/assets/web-panel/assets/{index-D7A5U2IH.js → index-CLlP1E4X.js} +1 -1
- package/src/assets/web-panel/assets/{index-ClOFeZ-t.js → index-CMCEXBRh.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cg86EzNp.js → index-CN8HZlLH.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ddd4mird.js → index-CNKFsBlz.js} +1 -1
- package/src/assets/web-panel/assets/{index-CE7tSow-.js → index-CUBkvFPH.js} +1 -1
- package/src/assets/web-panel/assets/{index-GlIOE4ja.js → index-Ca0mij1n.js} +1 -1
- package/src/assets/web-panel/assets/{index-DdU7IkKX.js → index-CbIAWbma.js} +1 -1
- package/src/assets/web-panel/assets/{index-UUHCwfNq.js → index-CbihMThv.js} +1 -1
- package/src/assets/web-panel/assets/{index-BRsD1PT2.js → index-CvOa-IFV.js} +1 -1
- package/src/assets/web-panel/assets/{index-C2aht9-M.js → index-Cvwu_rA_.js} +1 -1
- package/src/assets/web-panel/assets/{index-BJsQio5O.js → index-D-EJNxgR.js} +1 -1
- package/src/assets/web-panel/assets/{index-q7ftLqNt.js → index-D8uEL8Uw.js} +1 -1
- package/src/assets/web-panel/assets/{index-B1I1AYJs.js → index-D92g4l3n.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZKAzEge.js → index-DCqpl_E_.js} +1 -1
- package/src/assets/web-panel/assets/{index-CKoFyHYQ.js → index-DLSBks8h.js} +1 -1
- package/src/assets/web-panel/assets/{index-BDlDO2px.js → index-Db_5xhrU.js} +1 -1
- package/src/assets/web-panel/assets/{index-CENWwjef.js → index-DcDggpWR.js} +1 -1
- package/src/assets/web-panel/assets/{index-DH4cl52p.js → index-DeWKPQGs.js} +1 -1
- package/src/assets/web-panel/assets/{index-DTA8Iavv.js → index-DhVHoqGL.js} +3 -3
- package/src/assets/web-panel/assets/{index-DmpaC2yk.js → index-DyWlOuak.js} +1 -1
- package/src/assets/web-panel/assets/{index-BA8mZxd-.js → index-LU54bChK.js} +1 -1
- package/src/assets/web-panel/assets/{index-CtFOt5x1.js → index-OjnAwUJo.js} +1 -1
- package/src/assets/web-panel/assets/{index-B5LOYdYm.js → index-P83LDnCz.js} +1 -1
- package/src/assets/web-panel/assets/{index-MhQQ3h8q.js → index-_-9k3Tna.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DF6llUXV.js → initDefaultProps-CFNgY8lJ.js} +1 -1
- package/src/assets/web-panel/assets/{motion-vtDV8_5K.js → motion-D-5RrDzn.js} +1 -1
- package/src/assets/web-panel/assets/{move-B6c0bdy2.js → move-DN-L0Bd-.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DlLYWuBK.js → mtc-parser-6mgLSeCK.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BH0zOxLN.js → omit-ClWW8eTP.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-D9di8_In.js → pickAttrs-Vystq3R8.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-BDSngufM.js → placementArrow-D0H9hK4W.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-C_EawMvP.js → responsiveObserve-B3iNRU-a.js} +1 -1
- package/src/assets/web-panel/assets/{slide-B_4wShxA.js → slide-CiMXe6am.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-CbQu6qJ-.js → statusUtils-CGDZJ1uT.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-CvXJWYXb.js → styleChecker-D2zA6NkY.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-jjY1XknO.js → useFlexGapSupport-C1sYU6QE.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CMXBdsK_.js → useFs-BzUHSjg2.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-YbAhhPXx.js → usePersonalDataHub-CxB5yZCq.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-BFCTKc0H.js → vnode-BfUfMwtc.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-CY9aBl5O.js → zoom-CFYmj1TO.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/agent.js +80 -2
- package/src/commands/evolution.js +33 -27
- package/src/commands/serve.js +11 -2
- package/src/data/changelog.json +5 -5
- package/src/gateways/ws/session-protocol.js +1 -0
- package/src/gateways/ws/ws-agent-handler.js +70 -2
- package/src/gateways/ws/ws-server.js +8 -0
- package/src/lib/app-server/cli-agent-kernel-adapter.js +4 -0
- package/src/lib/app-server/graph-runtime.js +115 -8
- package/src/lib/app-server/server.js +21 -2
- package/src/lib/app-server/websocket-transport.js +2 -0
- package/src/lib/evolution/agent-evolution-ingress.js +300 -0
- package/src/lib/evolution/agent-evolution-runtime-composition-brand.js +22 -0
- package/src/lib/evolution/agent-evolution-runtime-composition.js +369 -0
- package/src/lib/evolution/evidence-backed-wiki-maintainer.js +752 -0
- package/src/lib/evolution/evolution-artifact-ports.js +48 -0
- package/src/lib/evolution/evolution-eval-gate.js +11 -4
- package/src/lib/evolution/evolution-evidence-artifact-adapter.js +499 -0
- package/src/lib/evolution/evolution-evidence-projector.js +61 -1
- package/src/lib/evolution/evolution-file-witness.js +601 -0
- package/src/lib/evolution/evolution-ledger-file-backend.js +176 -0
- package/src/lib/evolution/evolution-ledger-ports.js +353 -16
- package/src/lib/evolution/evolution-ledger.js +1355 -54
- package/src/lib/evolution/evolution-run-ledger-adapter.js +409 -0
- package/src/lib/evolution/evolution-run-wiki-maintenance-source.js +300 -0
- package/src/lib/evolution/scheduled-batch-wiki-maintenance-source.js +368 -0
- package/src/lib/evolution/skill-candidate-registry.js +649 -0
- package/src/lib/evolution/skill-promotion-controller.js +109 -38
- package/src/lib/evolution/skill-promotion-review-ledger-adapter.js +451 -0
- package/src/lib/evolution/skill-promotion-review.js +793 -0
- package/src/lib/evolution/skill-registry-transition-capability.js +55 -0
- package/src/lib/evolution/skill-registry-transition-ledger-adapter.js +1280 -0
- package/src/lib/evolution/skill-registry-transition-source.js +372 -0
- package/src/lib/evolution/skill-release-registry.js +2191 -11
- package/src/lib/evolution/skill-target-matrix-eval.js +133 -10
- package/src/lib/evolution/structured-memory-agent-control-plane.js +222 -0
- package/src/lib/evolution/structured-memory-authority-ledger-adapter.js +351 -0
- package/src/lib/evolution/structured-memory-ledger-adapter.js +220 -0
- package/src/lib/evolution/structured-memory-policy-receipt-writer.js +164 -0
- package/src/lib/evolution/structured-memory-post-compact-hook.js +87 -0
- package/src/lib/evolution/structured-memory-promotion-receipt-writer.js +221 -0
- package/src/lib/evolution/structured-memory-semantic-review-pipeline.js +313 -0
- package/src/lib/evolution/wiki-maintainer-ledger-adapter.js +200 -0
- package/src/lib/evolution/wiki-maintenance-trigger-ledger-adapter.js +687 -0
- package/src/lib/evolution-system.js +65 -30
- package/src/lib/mcp-lifecycle-authority.js +21 -2
- package/src/lib/remote-approval-bridge.js +24 -0
- package/src/lib/scheduler-kernel/store.js +62 -14
- package/src/repl/agent-repl.js +45 -0
- package/src/runtime/agent-runtime.js +114 -1
- package/src/runtime/headless-runner.js +19 -0
- package/src/runtime/headless-stream.js +43 -0
- package/src/runtime/runtime-factory.js +19 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-ZRE0OKbj.js +0 -1
- package/src/assets/web-panel/assets/PdhVaultBrowser-DvV2btIr.js +0 -7
- package/src/assets/web-panel/assets/devWarning-BztaXF84.js +0 -1
- package/src/assets/web-panel/assets/index-4jP_hG_4.js +0 -1
- package/src/assets/web-panel/assets/index-zxwuAXL5.js +0 -1
- package/src/lib/learning/learning-hooks.js +0 -123
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* adapter.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { randomUUID } from "node:crypto";
|
|
14
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
15
15
|
import { agentLoop, formatToolArgs } from "../../runtime/agent-core.js";
|
|
16
16
|
import { classifyToolSideEffect } from "../../lib/side-effect-ledger.js";
|
|
17
17
|
import { DiffReviewFollowUpTracker } from "../../lib/diff-review-follow-up.js";
|
|
@@ -81,6 +81,7 @@ import {
|
|
|
81
81
|
rejectSessionBudgetUsageUnknown,
|
|
82
82
|
} from "../../lib/session-budget-usage.js";
|
|
83
83
|
import { HostResourceBudget } from "../../lib/host-resource-budget.js";
|
|
84
|
+
import { captureAgentEvolutionRuntimeComposition } from "../../lib/evolution/agent-evolution-runtime-composition-brand.js";
|
|
84
85
|
|
|
85
86
|
const CANONICAL_WS_TURN_QUEUES = new Map();
|
|
86
87
|
const CANONICAL_WS_CLAIM_CAS_ATTEMPTS = 4;
|
|
@@ -176,6 +177,7 @@ export class WSAgentHandler {
|
|
|
176
177
|
sessionHostLease = null,
|
|
177
178
|
sessionBudgetRoot = null,
|
|
178
179
|
hostResourceBudget = null,
|
|
180
|
+
evolutionCompositionFactory = null,
|
|
179
181
|
}) {
|
|
180
182
|
this.session = session;
|
|
181
183
|
this.interaction = interaction;
|
|
@@ -243,6 +245,13 @@ export class WSAgentHandler {
|
|
|
243
245
|
this._mcpRecoveryRevision = null;
|
|
244
246
|
this._mcpRecoveryClient = null;
|
|
245
247
|
this._agentLoop = runAgentLoop || agentLoop;
|
|
248
|
+
if (
|
|
249
|
+
evolutionCompositionFactory !== null &&
|
|
250
|
+
typeof evolutionCompositionFactory !== "function"
|
|
251
|
+
) {
|
|
252
|
+
throw new TypeError("evolutionCompositionFactory must be a function");
|
|
253
|
+
}
|
|
254
|
+
this._evolutionCompositionFactory = evolutionCompositionFactory;
|
|
246
255
|
this._compactionLlmQuery = compactionLlmQuery || null;
|
|
247
256
|
this._compactionSettlementBlock = null;
|
|
248
257
|
this._compactionChatFn =
|
|
@@ -297,6 +306,46 @@ export class WSAgentHandler {
|
|
|
297
306
|
: Object.freeze(hostSystemPrefix);
|
|
298
307
|
}
|
|
299
308
|
|
|
309
|
+
async _prepareEvolutionTurn(requestId) {
|
|
310
|
+
if (!this._evolutionCompositionFactory) return null;
|
|
311
|
+
const sessionId = String(this.session.id);
|
|
312
|
+
const stableRequestId =
|
|
313
|
+
typeof requestId === "string" && requestId.trim()
|
|
314
|
+
? requestId.trim()
|
|
315
|
+
: randomUUID();
|
|
316
|
+
const runId = `ws-run-${createHash("sha256")
|
|
317
|
+
.update(`${sessionId}\0${stableRequestId}`, "utf8")
|
|
318
|
+
.digest("hex")}`;
|
|
319
|
+
try {
|
|
320
|
+
const composition = captureAgentEvolutionRuntimeComposition(
|
|
321
|
+
await this._evolutionCompositionFactory(
|
|
322
|
+
Object.freeze({
|
|
323
|
+
mode: "legacy-websocket",
|
|
324
|
+
runId,
|
|
325
|
+
sessionId,
|
|
326
|
+
requestId: stableRequestId,
|
|
327
|
+
cwd: this.session.projectRoot,
|
|
328
|
+
}),
|
|
329
|
+
),
|
|
330
|
+
);
|
|
331
|
+
if (composition.runId !== runId) {
|
|
332
|
+
throw new TypeError(
|
|
333
|
+
"Agent evolution composition belongs to another WebSocket turn",
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
await composition.evolutionIngress.start();
|
|
337
|
+
return composition;
|
|
338
|
+
} catch (cause) {
|
|
339
|
+
if (cause?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw cause;
|
|
340
|
+
const error = new Error(
|
|
341
|
+
`WebSocket evolution ingress failed: ${cause?.message || String(cause)}`,
|
|
342
|
+
{ cause },
|
|
343
|
+
);
|
|
344
|
+
error.code = "CC_AGENT_EVOLUTION_INGRESS_FAILED";
|
|
345
|
+
throw error;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
300
349
|
attachInteraction(interaction) {
|
|
301
350
|
if (!interaction || interaction === this.interaction) return false;
|
|
302
351
|
const previous = this.interaction;
|
|
@@ -1277,6 +1326,7 @@ export class WSAgentHandler {
|
|
|
1277
1326
|
let runRecorded = false;
|
|
1278
1327
|
let canonicalTurn = null;
|
|
1279
1328
|
let strictUsageTelemetry = false;
|
|
1329
|
+
let evolutionComposition = null;
|
|
1280
1330
|
|
|
1281
1331
|
try {
|
|
1282
1332
|
const { session } = this;
|
|
@@ -1335,7 +1385,19 @@ export class WSAgentHandler {
|
|
|
1335
1385
|
});
|
|
1336
1386
|
return;
|
|
1337
1387
|
}
|
|
1338
|
-
}
|
|
1388
|
+
}
|
|
1389
|
+
if (this._evolutionCompositionFactory !== null) {
|
|
1390
|
+
evolutionComposition = await this._prepareEvolutionTurn(requestId);
|
|
1391
|
+
}
|
|
1392
|
+
if (evolutionComposition !== null) {
|
|
1393
|
+
await evolutionComposition.evolutionIngress.ingestUserPrompt({
|
|
1394
|
+
content: userMessage,
|
|
1395
|
+
sessionId: session.id,
|
|
1396
|
+
requestId: requestId || null,
|
|
1397
|
+
source: "legacy-websocket",
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
if (session.canonicalJsonlSession !== true) {
|
|
1339
1401
|
session.messages.push({ role: "user", content: userMessage });
|
|
1340
1402
|
}
|
|
1341
1403
|
this._recordSessionState("run.started", {
|
|
@@ -1520,6 +1582,9 @@ export class WSAgentHandler {
|
|
|
1520
1582
|
session.messages,
|
|
1521
1583
|
loopOptions,
|
|
1522
1584
|
)) {
|
|
1585
|
+
if (evolutionComposition !== null) {
|
|
1586
|
+
await evolutionComposition.evolutionIngress.ingestAgentEvent(event);
|
|
1587
|
+
}
|
|
1523
1588
|
switch (event.type) {
|
|
1524
1589
|
case "slot-filling":
|
|
1525
1590
|
this.interaction.emit("slot-filling", {
|
|
@@ -1710,6 +1775,9 @@ export class WSAgentHandler {
|
|
|
1710
1775
|
break;
|
|
1711
1776
|
|
|
1712
1777
|
case "response-complete":
|
|
1778
|
+
if (evolutionComposition !== null) {
|
|
1779
|
+
await evolutionComposition.evolutionIngress.complete();
|
|
1780
|
+
}
|
|
1713
1781
|
if (session.canonicalJsonlSession === true) {
|
|
1714
1782
|
const settled = this._settleCanonicalSuccess(
|
|
1715
1783
|
canonicalTurn,
|
|
@@ -322,6 +322,14 @@ export class ChainlessChainWSServer extends EventEmitter {
|
|
|
322
322
|
LEGACY_WS_FLOW_DEFAULTS.maxCommandOutputBytes,
|
|
323
323
|
);
|
|
324
324
|
this._spawnProcess = options.spawn || _deps.spawn;
|
|
325
|
+
if (
|
|
326
|
+
options.evolutionCompositionFactory != null &&
|
|
327
|
+
typeof options.evolutionCompositionFactory !== "function"
|
|
328
|
+
) {
|
|
329
|
+
throw new TypeError("evolutionCompositionFactory must be a function");
|
|
330
|
+
}
|
|
331
|
+
this.evolutionCompositionFactory =
|
|
332
|
+
options.evolutionCompositionFactory || null;
|
|
325
333
|
|
|
326
334
|
/** Optional Phase-5 envelope bus for fan-out to hosted HTTP SSE. */
|
|
327
335
|
this.envelopeBus = options.envelopeBus || null;
|
|
@@ -196,6 +196,10 @@ export class CliAgentKernelAdapter {
|
|
|
196
196
|
interactiveApprovals: true,
|
|
197
197
|
includePartialMessages: true,
|
|
198
198
|
ephemeral: false,
|
|
199
|
+
evolutionIngress:
|
|
200
|
+
turnOptions.evolutionIngress ??
|
|
201
|
+
this.sessionOptions.evolutionIngress ??
|
|
202
|
+
null,
|
|
199
203
|
},
|
|
200
204
|
{
|
|
201
205
|
...this.dependencies,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { createGraphAuthorityBinding } from "../graph-kernel/authority.js";
|
|
7
7
|
import { GraphEventStore } from "../graph-kernel/event-store.js";
|
|
8
8
|
import { GraphKernel } from "../graph-kernel/runtime.js";
|
|
9
|
+
import { captureAgentEvolutionRuntimeComposition } from "../evolution/agent-evolution-runtime-composition-brand.js";
|
|
9
10
|
import {
|
|
10
11
|
diffGraphTrace,
|
|
11
12
|
locateBlockedRoot,
|
|
@@ -143,11 +144,18 @@ export class AppServerGraphRuntime {
|
|
|
143
144
|
now = Date.now,
|
|
144
145
|
createId = randomUUID,
|
|
145
146
|
onEvent = null,
|
|
147
|
+
evolutionCompositionFactory = null,
|
|
146
148
|
writerLeaseTtlMs = 24 * 60 * 60 * 1000,
|
|
147
149
|
} = {}) {
|
|
148
150
|
if (typeof executeNode !== "function") {
|
|
149
151
|
throw new TypeError("AppServerGraphRuntime requires executeNode()");
|
|
150
152
|
}
|
|
153
|
+
if (
|
|
154
|
+
evolutionCompositionFactory !== null &&
|
|
155
|
+
typeof evolutionCompositionFactory !== "function"
|
|
156
|
+
) {
|
|
157
|
+
throw new TypeError("evolutionCompositionFactory must be a function");
|
|
158
|
+
}
|
|
151
159
|
this.eventStore = eventStore;
|
|
152
160
|
this.rolloutStore = eventStore.rolloutStore;
|
|
153
161
|
this.executeNode = executeNode;
|
|
@@ -156,12 +164,88 @@ export class AppServerGraphRuntime {
|
|
|
156
164
|
this.now = now;
|
|
157
165
|
this.createId = createId;
|
|
158
166
|
this.onEvent = typeof onEvent === "function" ? onEvent : null;
|
|
167
|
+
this.evolutionCompositionFactory = evolutionCompositionFactory;
|
|
159
168
|
this.writerLeaseTtlMs = writerLeaseTtlMs;
|
|
160
169
|
this.runs = new Map();
|
|
161
170
|
this.drives = new Map();
|
|
162
171
|
this.active = new Map();
|
|
163
172
|
}
|
|
164
173
|
|
|
174
|
+
async _prepareEvolution(entry) {
|
|
175
|
+
if (!this.evolutionCompositionFactory) return null;
|
|
176
|
+
if (!entry.evolutionCompositionPromise) {
|
|
177
|
+
const context = Object.freeze({
|
|
178
|
+
mode: "graph",
|
|
179
|
+
runId: entry.runId,
|
|
180
|
+
originSurface: entry.originSurface,
|
|
181
|
+
revisionDigest: entry.compiled.revisionDigest,
|
|
182
|
+
authorityMode: entry.authorityMode,
|
|
183
|
+
});
|
|
184
|
+
entry.evolutionCompositionPromise = Promise.resolve()
|
|
185
|
+
.then(() => this.evolutionCompositionFactory(context))
|
|
186
|
+
.then((value) => {
|
|
187
|
+
const composition = captureAgentEvolutionRuntimeComposition(value);
|
|
188
|
+
if (composition.runId !== entry.runId) {
|
|
189
|
+
throw new TypeError(
|
|
190
|
+
"Agent evolution composition belongs to another Graph run",
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
if (
|
|
194
|
+
typeof composition.evolutionIngress?.start !== "function" ||
|
|
195
|
+
typeof composition.evolutionIngress?.complete !== "function"
|
|
196
|
+
) {
|
|
197
|
+
throw new TypeError(
|
|
198
|
+
"Agent evolution composition has no usable ingress",
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return composition;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (!entry.evolutionStartPromise) {
|
|
205
|
+
entry.evolutionStartPromise = entry.evolutionCompositionPromise.then(
|
|
206
|
+
async (composition) => {
|
|
207
|
+
await composition.evolutionIngress.start();
|
|
208
|
+
return composition;
|
|
209
|
+
},
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
return await entry.evolutionStartPromise;
|
|
214
|
+
} catch (cause) {
|
|
215
|
+
entry.evolutionIngressFailed = true;
|
|
216
|
+
if (cause?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw cause;
|
|
217
|
+
const error = runtimeError(
|
|
218
|
+
"CC_AGENT_EVOLUTION_INGRESS_FAILED",
|
|
219
|
+
`Graph evolution ingress failed: ${cause?.message || String(cause)}`,
|
|
220
|
+
{ cause },
|
|
221
|
+
);
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async _completeEvolution(entry) {
|
|
227
|
+
if (!this.evolutionCompositionFactory || entry.evolutionIngressFailed) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (entry.evolutionCompletionPromise) {
|
|
231
|
+
return entry.evolutionCompletionPromise;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
entry.evolutionCompletionPromise = this._prepareEvolution(entry).then(
|
|
235
|
+
(composition) => composition.evolutionIngress.complete(),
|
|
236
|
+
);
|
|
237
|
+
await entry.evolutionCompletionPromise;
|
|
238
|
+
} catch (cause) {
|
|
239
|
+
entry.evolutionIngressFailed = true;
|
|
240
|
+
if (cause?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw cause;
|
|
241
|
+
throw runtimeError(
|
|
242
|
+
"CC_AGENT_EVOLUTION_INGRESS_FAILED",
|
|
243
|
+
`Graph evolution completion failed: ${cause?.message || String(cause)}`,
|
|
244
|
+
{ cause },
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
165
249
|
_requestThread(runId) {
|
|
166
250
|
return `graph-request:${graphDigest(
|
|
167
251
|
runId,
|
|
@@ -329,6 +413,8 @@ export class AppServerGraphRuntime {
|
|
|
329
413
|
runId: id,
|
|
330
414
|
compiled,
|
|
331
415
|
inputs: { ...inputs },
|
|
416
|
+
originSurface,
|
|
417
|
+
authorityMode,
|
|
332
418
|
});
|
|
333
419
|
this._emit(id, "graph/run-started", { projection });
|
|
334
420
|
return this.status(id);
|
|
@@ -339,9 +425,16 @@ export class AppServerGraphRuntime {
|
|
|
339
425
|
if (projection.authorityMode === "shadow") {
|
|
340
426
|
return Promise.resolve(this.status(projection.id));
|
|
341
427
|
}
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
428
|
+
const entry = this.runs.get(projection.id);
|
|
429
|
+
const launch = () => {
|
|
430
|
+
const settled = this._drive(projection.id);
|
|
431
|
+
if (options.waitForCompletion === true) return settled;
|
|
432
|
+
return projection;
|
|
433
|
+
};
|
|
434
|
+
if (this.evolutionCompositionFactory) {
|
|
435
|
+
return this._prepareEvolution(entry).then(launch);
|
|
436
|
+
}
|
|
437
|
+
return Promise.resolve(launch());
|
|
345
438
|
}
|
|
346
439
|
|
|
347
440
|
resume(runId, { waitForCompletion = false } = {}) {
|
|
@@ -375,12 +468,15 @@ export class AppServerGraphRuntime {
|
|
|
375
468
|
if (!entry)
|
|
376
469
|
throw runtimeError("CC_GRAPH_RUN_NOT_FOUND", "Graph run missing");
|
|
377
470
|
const { kernel } = entry;
|
|
471
|
+
await this._prepareEvolution(entry);
|
|
378
472
|
for (let steps = 0; steps < 10_000; steps += 1) {
|
|
379
473
|
const status = kernel.getRun(runId);
|
|
380
|
-
if (
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
474
|
+
if (TERMINAL.has(status.status)) {
|
|
475
|
+
await this._completeEvolution(entry);
|
|
476
|
+
this._emit(runId, "graph/run-settled", { projection: status });
|
|
477
|
+
return status;
|
|
478
|
+
}
|
|
479
|
+
if (status.status === "reconciliation_required") {
|
|
384
480
|
this._emit(runId, "graph/run-settled", { projection: status });
|
|
385
481
|
return status;
|
|
386
482
|
}
|
|
@@ -562,6 +658,7 @@ export class AppServerGraphRuntime {
|
|
|
562
658
|
async _executeAttempt(entry, nodeId) {
|
|
563
659
|
const { kernel } = entry;
|
|
564
660
|
const runId = entry.runId;
|
|
661
|
+
const evolutionComposition = await this._prepareEvolution(entry);
|
|
565
662
|
const attempt = kernel.assignNode(runId, nodeId, "app-server-agent", {
|
|
566
663
|
ttlMs: this.writerLeaseTtlMs,
|
|
567
664
|
leaseId: `app-server-attempt:${this.createId()}`,
|
|
@@ -595,6 +692,7 @@ export class AppServerGraphRuntime {
|
|
|
595
692
|
attempt,
|
|
596
693
|
input: nodeInput(entry.inputs, nodeId),
|
|
597
694
|
signal: controller.signal,
|
|
695
|
+
evolutionIngress: evolutionComposition?.evolutionIngress || null,
|
|
598
696
|
});
|
|
599
697
|
if (!result || !["succeeded", "completed"].includes(result.status)) {
|
|
600
698
|
const error = runtimeError(
|
|
@@ -631,6 +729,9 @@ export class AppServerGraphRuntime {
|
|
|
631
729
|
});
|
|
632
730
|
return settled;
|
|
633
731
|
} catch (error) {
|
|
732
|
+
if (error?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") {
|
|
733
|
+
entry.evolutionIngressFailed = true;
|
|
734
|
+
}
|
|
634
735
|
if (controller.signal.aborted) return kernel.getRun(runId);
|
|
635
736
|
if (effect) {
|
|
636
737
|
const known = error?.outcomeKnown === true;
|
|
@@ -826,6 +927,8 @@ export class AppServerGraphRuntime {
|
|
|
826
927
|
runId,
|
|
827
928
|
compiled: compileGraphDefinition(request.definition),
|
|
828
929
|
inputs: { ...request.inputs },
|
|
930
|
+
originSurface: request.originSurface,
|
|
931
|
+
authorityMode: request.authorityMode,
|
|
829
932
|
};
|
|
830
933
|
this.runs.set(runId, entry);
|
|
831
934
|
this._recoverReceiptedAttempts(entry);
|
|
@@ -1003,7 +1106,7 @@ export class AppServerGraphRuntime {
|
|
|
1003
1106
|
async cancel(runId, reason = "cancelled by App Server client") {
|
|
1004
1107
|
const id = String(runId);
|
|
1005
1108
|
const entry = this.runs.get(id) || this._recover(id);
|
|
1006
|
-
|
|
1109
|
+
const projection = await entry.kernel.cancelRun(id, {
|
|
1007
1110
|
reason,
|
|
1008
1111
|
interrupt: async (attempt) => {
|
|
1009
1112
|
const active = this.active.get(attempt.id);
|
|
@@ -1012,6 +1115,10 @@ export class AppServerGraphRuntime {
|
|
|
1012
1115
|
await active.done;
|
|
1013
1116
|
},
|
|
1014
1117
|
});
|
|
1118
|
+
if (TERMINAL.has(projection.status)) {
|
|
1119
|
+
await this._completeEvolution(entry);
|
|
1120
|
+
}
|
|
1121
|
+
return projection;
|
|
1015
1122
|
}
|
|
1016
1123
|
|
|
1017
1124
|
async reconcile(runId, input = {}) {
|
|
@@ -144,6 +144,7 @@ export class CcAppServer {
|
|
|
144
144
|
interruptSettlementMs = 30_000,
|
|
145
145
|
transport = "stdio",
|
|
146
146
|
graphRuntime = null,
|
|
147
|
+
evolutionCompositionFactory = null,
|
|
147
148
|
contextMemoryRuntimeFactory = createCliContextMemoryRuntime,
|
|
148
149
|
} = {}) {
|
|
149
150
|
if (typeof send !== "function") {
|
|
@@ -165,12 +166,18 @@ export class CcAppServer {
|
|
|
165
166
|
throw new TypeError("contextMemoryRuntimeFactory must be a function");
|
|
166
167
|
}
|
|
167
168
|
this.contextMemoryRuntimeFactory = contextMemoryRuntimeFactory;
|
|
169
|
+
if (graphRuntime && evolutionCompositionFactory) {
|
|
170
|
+
throw new TypeError(
|
|
171
|
+
"graphRuntime and evolutionCompositionFactory cannot both be provided",
|
|
172
|
+
);
|
|
173
|
+
}
|
|
168
174
|
this.graphRuntime =
|
|
169
175
|
graphRuntime ||
|
|
170
176
|
new AppServerGraphRuntime({
|
|
171
177
|
rolloutStore: resolvedStore,
|
|
172
178
|
now,
|
|
173
179
|
createId,
|
|
180
|
+
evolutionCompositionFactory,
|
|
174
181
|
executeNode: (context) => this._executeGraphNode(context),
|
|
175
182
|
requestHumanTask: (context) => this._requestHumanTask(context),
|
|
176
183
|
onEvent: (event) => {
|
|
@@ -598,7 +605,14 @@ export class CcAppServer {
|
|
|
598
605
|
);
|
|
599
606
|
}
|
|
600
607
|
|
|
601
|
-
async _executeGraphNode({
|
|
608
|
+
async _executeGraphNode({
|
|
609
|
+
runId,
|
|
610
|
+
nodeId,
|
|
611
|
+
attempt,
|
|
612
|
+
input,
|
|
613
|
+
signal,
|
|
614
|
+
evolutionIngress,
|
|
615
|
+
}) {
|
|
602
616
|
const threadId = `graph-agent:${runId}:${nodeId}`;
|
|
603
617
|
const turn = { id: attempt.id, threadId };
|
|
604
618
|
const onAbort = () => {
|
|
@@ -606,11 +620,16 @@ export class CcAppServer {
|
|
|
606
620
|
};
|
|
607
621
|
signal?.addEventListener?.("abort", onAbort, { once: true });
|
|
608
622
|
try {
|
|
623
|
+
const turnOptions = { ...(input?.options || {}) };
|
|
624
|
+
delete turnOptions.evolutionIngress;
|
|
625
|
+
if (evolutionIngress !== null && evolutionIngress !== undefined) {
|
|
626
|
+
turnOptions.evolutionIngress = evolutionIngress;
|
|
627
|
+
}
|
|
609
628
|
const result = await this.kernel.startTurn({
|
|
610
629
|
threadId,
|
|
611
630
|
turnId: attempt.id,
|
|
612
631
|
input: requiredString(input?.prompt, `inputs.${nodeId}.prompt`),
|
|
613
|
-
options:
|
|
632
|
+
options: turnOptions,
|
|
614
633
|
emit: (event) =>
|
|
615
634
|
this._notify("graph/event", {
|
|
616
635
|
type: "graph/agent-event",
|
|
@@ -396,6 +396,8 @@ export class WebSocketAppServerHost extends EventEmitter {
|
|
|
396
396
|
send,
|
|
397
397
|
store: this.store,
|
|
398
398
|
kernel: this.kernelFactory?.(),
|
|
399
|
+
evolutionCompositionFactory:
|
|
400
|
+
this.options.evolutionCompositionFactory ?? null,
|
|
399
401
|
transport: "websocket",
|
|
400
402
|
maxQueuedRequests: this.options.maxQueuedRequests,
|
|
401
403
|
maxQueuedRequestBytes: this.options.maxQueuedRequestBytes,
|