chainlesschain 0.166.10 → 0.166.13
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 +33 -0
- package/bin/chainlesschain.js +5 -0
- package/package.json +4 -2
- package/src/assets/web-panel/assets/{AIOps-CLYBDAGv.js → AIOps-BN25cNOD.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CpeSttcu.js → ActionButton-Da9IP-m5.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-Ba1TNLG0.js → Analytics-D7hkEvQm.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-xBy8EOeg.js → AppLayout-CCV4Xnbc.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-CJ_3TFb8.js → Artifacts-CVSnVJeA.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DUATFCG3.js → Audit-CuYdw5Ag.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-BRXYPIGp.js → BackgroundAgents-DZCnK-Tf.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-D8auLx7y.js → Backup-cV9FdpTy.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-CBgdslQ3.js → BaseInput-BRnv6YSp.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-B32LvAiE.js → Chat-Bw5w87P4.js} +5 -5
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-CVfvAy-n.js → ChatBubbleRenderer-C0GjtUAw.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BwzBxOpC.js → Checkbox-DaoTqcdt.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-0U5vrg1H.js → Codegen-B4dYcEIi.js} +1 -1
- package/src/assets/web-panel/assets/{Col-dZ2i4aAj.js → Col-mAhuOeuD.js} +1 -1
- package/src/assets/web-panel/assets/{Community-UVvpLr8c.js → Community-BK6KEdBk.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BDNEb1Bd.js → Compact-CCglmNu5.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-BrzQPxyS.js → Compliance-Cm8S4of7.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-BbgGsu-9.js → Cowork-Dhs1QLMe.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-G321XPhp.js → Cron-CLlhmXWk.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-CgLNUyMn.js → Crosschain-BnHVbaNs.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BAfRj18q.js → DID-UzQP9-0O.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-BNIxA4TK.js → Dashboard-CBdlPClz.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BLAUmCAN.js → Dropdown-axIRPdq1.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-CsnhTW22.js → EmailListRenderer-DUalW5rx.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-zcQ7Ip1n.js → FamilyGuardDashboard-Bl4W9luY.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-KFwxodNU.js → Federation-C1yP-uEu.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-3CYRLEHG.js → FormItemContext-Xh6Ig5q8.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-D3d9D8L9.js → GenericCardRenderer-C2cz3bt2.js} +1 -1
- package/src/assets/web-panel/assets/{Git-BJ202nJY.js → Git-C_z63ixg.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-ClnnXVQ-.js → Governance-BYqB33_3.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-DNU-PTkc.js → Inference-CEULuArm.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DJuinbuY.js → KnowledgeGraph-fgMsu-0H.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-D4No-46s.js → Logs-DO9Hdcec.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-BkrK04xW.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-Ba-KqRN3.js → Marketplace-B8zyLiFe.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DVoxnPgE.js → McpTools-BLAN2mWW.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-D_C8gzAZ.js → Memory-CrQcFM7u.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-DnzTPcDH.js → MobileBridge-DVnyiiU-.js} +1 -1
- package/src/assets/web-panel/assets/MobileProjects-qjCME5OD.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-CvEHmHId.js → Mtc-4JE3C3It.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-VNJmWqmv.js → MtcAudit-CjBuak9I.js} +5 -5
- package/src/assets/web-panel/assets/{Multisig-BO0x_Vsa.js → Multisig-BtPcYQcC.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-CM2gI1UY.js → NLProgramming-Cx653_Ba.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CMc1HsML.js → Notes-CkuD3YzS.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-DGNmSKGM.js → NotificationSettings-BgNgU7HH.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-Du-Kct3p.js → OrderTableRenderer-BTC8W0a-.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-DRtRZjas.js → Organization-Dmd4Hjxz.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-Dp4OeWsn.js → Overflow-C_5DA-G0.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-DXMJVls8.js → P2P-uwslV4XC.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-CuNgwVnX.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-D1Hbb51o.js → Permissions-CJayVX9H.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-BridiDhr.js → PersonalDataHub-Cb05H5go.js} +4 -4
- package/src/assets/web-panel/assets/{Pipeline-B4bUNCm1.js → Pipeline-BZlGKapZ.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BTu_HEqK.js → Privacy-BIzZWYzd.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-SVtL2hnt.js → ProjectInit-vEYYyQXQ.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-B2Sh7JZ2.js → ProjectSettings-MZqTy5CC.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-BwU1xalW.js → Projects-CRARUOl8.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-BWdWQSDw.js → Providers-80VAK8PX.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-Brzc-Sxb.js → QrScannerModal-CzRSoIwK.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DIBz7FCe.js → QuickAsk-BpwQ2n4C.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CZ8RriIJ.js → Recommend-BC03TZ79.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-CM0KJQ3t.js → RemoteSession-DE59-jaa.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-D_wo8H0O.js → Reputation-DOHmeWyA.js} +1 -1
- package/src/assets/web-panel/assets/{Row-D1G1fD7N.js → Row-hc5RZl1D.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-dKCVtA0K.js → RssFeed-Cv5uMP7E.js} +3 -3
- package/src/assets/web-panel/assets/{Search-Be1D61xo.js → Search-qohu7Ug0.js} +1 -1
- package/src/assets/web-panel/assets/{Security-IbNiR6OC.js → Security-drCPFWV5.js} +4 -4
- package/src/assets/web-panel/assets/{Services-nuHK8y8p.js → Services-BAEgUeRy.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DnM5jdnC.js → Skeleton-CkJkKBlo.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-DCTdoq_q.js → Skills-bMuKEpez.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-DlWun-Ui.js → Sla-DxWQVHRC.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-C19kv2sd.js → SpeechSettings-BpS8idmV.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-CkQIR_Hu.js → SyncSettings-BPBLlW5v.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-DdbqOEbs.js → Tasks-C4SLEeUh.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-B7GpIXeo.js → Templates-r-wfU39U.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-ByEstFhY.js → Tenant-C7vjRmLN.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BKRVID1a.js → Terminal-DdzeFCV2.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-CNS3dHNv.js → TimelineRenderer-CYyWN2KD.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BykqylCL.js → Tokens-D8A9osUg.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-ByNxq51W.js → Trigger-DBvrNlyS.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-BlrFsdaS.js → Trust-DBVAGc7o.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-Dg26A-sd.js → UkeySign-C1vQUCRJ.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-C1wUxNn0.js → VideoEditing-BKs4dah4.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-OphEUzI4.js → Wallet-ByIuj3lD.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-_8lL08hF.js → WebAuthn-DYlAFCm9.js} +3 -3
- package/src/assets/web-panel/assets/{WorkflowEditor-BnTuIvnP.js → WorkflowEditor-Dwyadd0c.js} +1 -1
- package/src/assets/web-panel/assets/{chat-3N3VLQYr.js → chat-Bm2f3s08.js} +1 -1
- package/src/assets/web-panel/assets/{colors-Bo_G96gg.js → colors-C8ORSh7V.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-DjubfjI_.js → compact-item-1iVlnsM-.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-Cx_HSLCk.js → createContext-CmqNyUSL.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-B69RCDDH.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-D5OjAOlA.js → hasIn-rUMaX3Ul.js} +1 -1
- package/src/assets/web-panel/assets/index-9biMQ-tw.js +1 -0
- package/src/assets/web-panel/assets/{index-Bj7S5IJw.js → index-B53c3diB.js} +1 -1
- package/src/assets/web-panel/assets/{index-C-_Cy0k_.js → index-B59OWAs7.js} +1 -1
- package/src/assets/web-panel/assets/{index-DaU60K3A.js → index-B8BrB0Ls.js} +1 -1
- package/src/assets/web-panel/assets/{index-UnpsQ6A0.js → index-BC32_0xT.js} +1 -1
- package/src/assets/web-panel/assets/{index-BScGr1BY.js → index-BC8Wb6cy.js} +1 -1
- package/src/assets/web-panel/assets/{index-CC7RnaPP.js → index-BCOhTILd.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXJqa1-I.js → index-BFniLMn9.js} +1 -1
- package/src/assets/web-panel/assets/{index-C-4sfa0l.js → index-BIvM-uAX.js} +1 -1
- package/src/assets/web-panel/assets/{index-C8dPFFhy.js → index-BK-RY0-7.js} +1 -1
- package/src/assets/web-panel/assets/{index-CVPDhmVH.js → index-BQL9r73Y.js} +1 -1
- package/src/assets/web-panel/assets/{index-CqZq3zWr.js → index-BVtnizyC.js} +1 -1
- package/src/assets/web-panel/assets/{index-C5IwN9q3.js → index-Bf1PlIHp.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cz5tQ5PY.js → index-Bgw4Y2rU.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmLwI-Y8.js → index-BgwLNxmr.js} +1 -1
- package/src/assets/web-panel/assets/{index-Y-H7j25u.js → index-C-J5-pGH.js} +1 -1
- package/src/assets/web-panel/assets/{index-ydnEPOzZ.js → index-C-ZIHi42.js} +1 -1
- package/src/assets/web-panel/assets/{index-HioDjvUF.js → index-C3B1S-mW.js} +1 -1
- package/src/assets/web-panel/assets/{index-CRKk1JPX.js → index-C5RfRciU.js} +1 -1
- package/src/assets/web-panel/assets/{index-x7o-2T3S.js → index-CCEyz58d.js} +1 -1
- package/src/assets/web-panel/assets/index-COie87kl.js +1 -0
- package/src/assets/web-panel/assets/{index-BvYo09C0.js → index-CTfEmKK0.js} +1 -1
- package/src/assets/web-panel/assets/{index-CCjq3g32.js → index-CfiHyVyl.js} +1 -1
- package/src/assets/web-panel/assets/{index-3_CEBEEf.js → index-CkFvuAex.js} +3 -3
- package/src/assets/web-panel/assets/{index-EZr3bvz2.js → index-D98FXb0w.js} +1 -1
- package/src/assets/web-panel/assets/{index-C4MAnkl5.js → index-DDHk911Q.js} +1 -1
- package/src/assets/web-panel/assets/{index-BgPb37tI.js → index-DJxtPFOh.js} +1 -1
- package/src/assets/web-panel/assets/{index-CNmsP0Xf.js → index-DVJ1uKf4.js} +1 -1
- package/src/assets/web-panel/assets/{index-DBvZhdCb.js → index-Dcck8QfW.js} +1 -1
- package/src/assets/web-panel/assets/{index-B905-Mcs.js → index-DgUE51Pz.js} +1 -1
- package/src/assets/web-panel/assets/{index-DrVjatPe.js → index-Dsve5Gkv.js} +1 -1
- package/src/assets/web-panel/assets/{index-uAcJUJkx.js → index-DvedhJeM.js} +1 -1
- package/src/assets/web-panel/assets/{index-DD1zSPZH.js → index-DwMdWKiF.js} +1 -1
- package/src/assets/web-panel/assets/{index-BxgIE4PD.js → index-OcbzdRpT.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ce8EWU6r.js → index-fPK6GFEg.js} +1 -1
- package/src/assets/web-panel/assets/{index-DlcbE0sX.js → index-geQinnns.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dbdr8tVi.js → index-pHWA7bmM.js} +1 -1
- package/src/assets/web-panel/assets/{index-DE4XtzMl.js → index-reUHhuz8.js} +1 -1
- package/src/assets/web-panel/assets/{index-Q_vn0t8d.js → index-tqTx5wXo.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DurpENJY.js → initDefaultProps-CuA-cpkL.js} +1 -1
- package/src/assets/web-panel/assets/{motion-CIh-z-gR.js → motion-CimmE_9b.js} +1 -1
- package/src/assets/web-panel/assets/{move-Uc_yI2NA.js → move-DlGlrltz.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DUevj5wz.js → mtc-parser-CK6BJQ07.js} +1 -1
- package/src/assets/web-panel/assets/{omit-85eMYyur.js → omit-BKjBfZfB.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-AuxDD20F.js → pickAttrs-B2chVYw9.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-DOWn8dd1.js → placementArrow-BW8aLJJ3.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CPxTWodH.js → responsiveObserve-dXlPl66S.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BqvbGPjx.js → slide-hSa89S4G.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-BzXKkV8d.js → statusUtils-DM6KLt-s.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-B2O7yRk3.js → styleChecker-C9MQAK15.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DRWp7px1.js → useFlexGapSupport-BpQDpP0z.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-Dp0V7sjM.js → useFs-C7rtRViA.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CyCrG3ql.js → usePersonalDataHub-Dm15xafq.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CXhoFpFo.js → vnode-mEiEytw4.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-0z3mtwEg.js → zoom-DzPxflhY.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +5 -5
- package/src/commands/agent.js +51 -20
- package/src/commands/compact.js +349 -3
- package/src/commands/context.js +72 -1
- package/src/commands/graph.js +26 -15
- package/src/commands/hmemory.js +21 -0
- package/src/commands/hook.js +256 -28
- package/src/commands/memory.js +209 -42
- package/src/commands/promcomp.js +17 -0
- package/src/commands/serve.js +94 -10
- package/src/commands/session.js +2 -3
- package/src/commands/team.js +7 -1
- package/src/data/changelog.json +28 -2
- package/src/gateways/ws/session-core-protocol.js +62 -3
- package/src/gateways/ws/session-protocol.js +123 -15
- package/src/gateways/ws/ws-agent-handler.js +157 -9
- package/src/gateways/ws/ws-session-gateway.js +204 -30
- package/src/generated/cc-agent-protocol.schema.json +2094 -4
- package/src/harness/prompt-compressor.js +5 -55
- package/src/lib/agent-sandbox.js +14 -4
- package/src/lib/agent-team/team-distributed-graph-bridge.js +3 -3
- package/src/lib/app-server/context-memory-notifications.js +54 -0
- package/src/lib/app-server/rollout-store-factory.js +115 -0
- package/src/lib/app-server/rollout-store.js +310 -23
- package/src/lib/app-server/server.js +184 -7
- package/src/lib/app-server/sqlite-rollout-store.js +59 -16
- package/src/lib/auto-mode-config.js +26 -0
- package/src/lib/causal-observability.js +13 -1
- package/src/lib/context-memory-kernel/authority.js +95 -0
- package/src/lib/context-memory-kernel/durable-memory-port.js +296 -0
- package/src/lib/context-memory-kernel/index.js +8 -0
- package/src/lib/context-memory-kernel/jsonl-session-context-port.js +232 -0
- package/src/lib/context-memory-kernel/live-compaction.js +375 -0
- package/src/lib/context-memory-kernel/memory-service.js +667 -0
- package/src/lib/context-memory-kernel/message-adapter.js +451 -0
- package/src/lib/context-memory-kernel/privacy-purge-port.js +244 -0
- package/src/lib/context-memory-kernel/provider-context.js +192 -0
- package/src/lib/context-memory-kernel/runtime.js +61 -0
- package/src/lib/direct-model-usage.js +22 -18
- package/src/lib/graph-kernel/cutover-authority-resolver.js +4 -5
- package/src/lib/graph-kernel/cutover-ledger.js +2 -2
- package/src/lib/graph-kernel/event-store.js +3 -5
- package/src/lib/graph-kernel/migration-saga.js +2 -2
- package/src/lib/graph-kernel/production-cutover-evidence.js +8 -1
- package/src/lib/hierarchical-memory.js +22 -0
- package/src/lib/hook-audit-store.js +170 -0
- package/src/lib/hook-event-bus.cjs +0 -0
- package/src/lib/hook-manager.js +25 -83
- package/src/lib/hook-runtime-adapters.js +233 -0
- package/src/lib/hook-runtime-contract.cjs +291 -0
- package/src/lib/hook-runtime-contract.js +21 -0
- package/src/lib/hook-trust.js +210 -0
- package/src/lib/hooks-v2-producers.js +52 -6
- package/src/lib/hooks-v2-runtime.js +443 -178
- package/src/lib/llm-pricing.js +10 -0
- package/src/lib/memory-manager.js +29 -4
- package/src/lib/model-context-window.js +52 -0
- package/src/lib/permanent-memory.js +17 -0
- package/src/lib/plan-mode.js +8 -4
- package/src/lib/process-execution-broker/index.js +208 -16
- package/src/lib/runtime-usage-ledger.js +20 -0
- package/src/lib/session-consolidator.js +59 -0
- package/src/lib/session-core-singletons.js +17 -4
- package/src/lib/session-hooks.js +29 -2
- package/src/lib/session-transcript-migration.js +188 -0
- package/src/lib/settings-hook-events.cjs +37 -401
- package/src/lib/settings-hook-events.js +210 -8
- package/src/lib/settings-hooks.cjs +42 -83
- package/src/lib/ws-session-manager.js +4 -1
- package/src/repl/agent-repl.js +186 -53
- package/src/runtime/agent-core.js +376 -350
- package/src/runtime/headless-runner.js +40 -33
- package/src/runtime/headless-stream.js +131 -30
- package/src/assets/web-panel/assets/MarkdownRenderer-Dt8hH_qA.js +0 -1
- package/src/assets/web-panel/assets/MobileProjects-Jg2dVUc-.js +0 -1
- package/src/assets/web-panel/assets/PdhVaultBrowser-0jYeVmyY.js +0 -7
- package/src/assets/web-panel/assets/devWarning-BX944k9E.js +0 -1
- package/src/assets/web-panel/assets/index-C_9Jt_SR.js +0 -1
- package/src/assets/web-panel/assets/index-DL2EFx7m.js +0 -1
package/src/data/changelog.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": "CHANGELOG.md",
|
|
3
3
|
"releases": [
|
|
4
|
+
{
|
|
5
|
+
"productVersion": null,
|
|
6
|
+
"cliVersion": "0.166.13",
|
|
7
|
+
"cliVersions": ["0.3.8", "0.166.12", "0.166.13"],
|
|
8
|
+
"date": "2026-08-30",
|
|
9
|
+
"title": "",
|
|
10
|
+
"sections": [
|
|
11
|
+
{
|
|
12
|
+
"heading": "Fixed - cc CLI 0.166.13 and Session Core 0.3.8: fail-closed P0 security closure",
|
|
13
|
+
"body": "> `chainlesschain` **0.166.12 -> 0.166.13** and Session Core\n> **0.3.7 -> 0.3.8** (release candidates, 2026-08-30).\n\n- **Fixed renderer IPC capabilities**: remove the environment-controlled\n generic bridge bypass and generate an exact renderer/main capability\n manifest that fails the Desktop build when it drifts.\n- **Default sandbox and approval boundary**: restore workspace-write with\n network disabled as the CLI default, deny shell execution when the approval\n gate is unavailable, and fail closed when approval policy loading or\n persistence fails.\n- **Durable process audit**: require a persistent, redacted admission record\n before high-risk process creation and retain bounded actor, session,\n authorization, policy, sandbox, and result context.\n- **Release boundary**: these versions identify the source candidates for the\n security fixes; publication still requires the exact candidate to pass the\n repository's Linux, Windows, and macOS release matrices."
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"productVersion": null,
|
|
19
|
+
"cliVersion": "0.166.12",
|
|
20
|
+
"cliVersions": ["0.166.10", "0.166.12"],
|
|
21
|
+
"date": "2026-08-30",
|
|
22
|
+
"title": "",
|
|
23
|
+
"sections": [
|
|
24
|
+
{
|
|
25
|
+
"heading": "Added - cc CLI 0.166.12: durable rollout storage and converged Hooks v2",
|
|
26
|
+
"body": "> `chainlesschain` **0.166.10 -> 0.166.12** (release candidate,\n> 2026-08-30). The immutable `0.166.11` candidate was withheld after its npm\n> workflow could not bootstrap the new scoped runtime dependency; its tag is\n> not reused. Coordinated candidates are Context/Memory Kernel `0.1.0`,\n> Session Core `0.3.7`, Agent Protocol `0.1.7`, TypeScript Agent SDK `0.2.7`,\n> Python Agent SDK `0.2.7`, VS Code `0.37.75`, and JetBrains `0.4.105`.\n\n- **Canonical context planning**: ship deterministic budget allocation,\n compaction, memory reducers, inventory validation, and cross-surface\n conformance through `@chainlesschain/context-memory-kernel`.\n- **Durable memory cutover**: route CLI context, compaction, hierarchical\n memory, App Server, WebSocket, REPL, and session flows through fail-closed\n authority stages with crash-safe persistence and privacy purge receipts;\n Session Core `0.3.7` exposes the write guard used to fence legacy writers.\n- **Protocol and SDK projections**: add bounded Context/Memory messages and App\n Server pilot clients to the generated Agent Protocol, TypeScript SDK, Python\n SDK, VS Code extension, and JetBrains plugin without granting IDE surfaces\n independent write authority.\n- **Durable rollout stores**: converge App Server, WebSocket, and CLI entry\n points on bounded memory, JSON, or SQLite rollout stores with explicit\n selection, migration, recovery, and corruption handling.\n- **Hooks v2 convergence**: route CLI, REPL, headless, settings, plugins, and\n App Server through one trust-aware event runtime with deterministic ordering,\n audit replay, timeout supervision, and fail-closed decision semantics.\n- **Release integrity**: publish the new fixed CLI runtime dependency before\n the immutable CLI tarball, then verify its registry bytes and npm provenance\n against the exact release tag and commit."
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
4
30
|
{
|
|
5
31
|
"productVersion": null,
|
|
6
32
|
"cliVersion": "0.166.10",
|
|
@@ -23,7 +49,7 @@
|
|
|
23
49
|
"sections": [
|
|
24
50
|
{
|
|
25
51
|
"heading": "Added - cc CLI 0.166.9: governed UI replay and Codex compatibility gates",
|
|
26
|
-
"body": "> `chainlesschain` **0.166.8 -> 0.166.9
|
|
52
|
+
"body": "> `chainlesschain` **0.166.8 -> 0.166.9**, published 2026-08-29 from exact\n> commit `222396f6a8429d4b862292a2572067a5cacb1003`. Agent Protocol `0.1.6`,\n> TypeScript Agent SDK `0.2.5`, and Python Agent SDK `0.2.6` are public. The\n> immutable Python `0.2.5` candidate was withheld from PyPI because its\n> release metadata named a CLI that was not yet public.\n\n- **Real UI driver**: reviewed Record & Replay drafts can execute the bounded\n `observe/click/type/select/assert` vocabulary in an ephemeral Playwright\n Chromium context instead of relying on a fake executor.\n- **Fail-closed isolation**: the driver denies filesystem, HTTP(S), and\n WebSocket requests, requires exact reviewed capabilities and selectors, and\n rejects ambiguous targets, environment drift, network attempts, or missing\n terminal evidence.\n- **Content-free receipts**: selectors, typed values, page text, URLs, and\n screenshots never enter reports; only domain-separated state, page,\n screenshot, target, and receipt digests plus bounded structural metadata are\n retained.\n- **Cross-platform authority**: a dedicated exact-SHA GitHub Actions matrix\n runs the positive journey and an active network-escape probe in real Chromium\n on Linux, Windows, and macOS, then refuses partial evidence in its aggregate.\n- **Exact Codex admission**: the optional experimental App Server adapter now\n admits only explicitly listed upstream patch versions; prereleases and\n unverified future patches fail closed to the stable `codex exec --json`\n fallback before turn admission.\n- **Version-bound App Server evidence**: a second exact-SHA Actions matrix\n generates each upstream version's own schema and exercises the documented\n `initialize -> initialized -> thread/list` stdio lifecycle on Linux,\n Windows, and macOS without making a model request.\n- **Removal readiness**: every compatibility job proves that production CLI\n source has no dependency on the optional adapter and that the stable Codex\n JSONL fallback still executes and projects terminal output independently.\n- **Windows strict-sandbox cleanup**: target-identity cleanup remains bound to\n the stable file object while tolerating size and timestamp metadata settling\n after the native helper closes its writer; same-path replacement is still\n rejected.\n- **JetBrains real-host gate**: plan-review document access now runs inside\n explicit IntelliJ read/write actions, and the UI journey targets the current\n one-time permission label on every supported host/version pair.\n- **Python release metadata**: the `0.2.6` patch keeps the `0.2.5` runtime API\n and generated protocol bindings while pointing install guidance at the latest\n CLI that is actually available from the public npm registry.\n- **Release validation**: immutable tag `v-npm-0-166-9` resolves to the exact\n commit above. Its Linux/Windows/macOS CLI CI and Strict Sandbox matrices,\n npm Trusted Publishing/provenance/readback, Record & Replay real-browser\n matrix, Codex App Server compatibility matrix, Desktop signed-Skill\n qualification, and IDE release gate completed successfully. Open VSX\n `0.37.73` is public; JetBrains source/tag `0.4.104` remains distinct from the\n Marketplace-public `0.4.103` artifact."
|
|
27
53
|
}
|
|
28
54
|
]
|
|
29
55
|
},
|
|
@@ -43,7 +69,7 @@
|
|
|
43
69
|
"sections": [
|
|
44
70
|
{
|
|
45
71
|
"heading": "Added - cc CLI 0.166.8 + Agent Platform and IDE patches: durable Graph review and recovery",
|
|
46
|
-
"body": "> `chainlesschain` **0.166.7 -> 0.166.8
|
|
72
|
+
"body": "> `chainlesschain` **0.166.7 -> 0.166.8** (source candidate fully carried into\n> public `0.166.9`; it was not published as a separate npm version),\n> `@chainlesschain/agent-protocol` **0.1.5 -> 0.1.6**,\n> `@chainlesschain/agent-sdk` **0.2.4 -> 0.2.5**, and\n> `chainlesschain-agent-sdk` **0.2.4 -> 0.2.5** (withheld Python candidate,\n> superseded by public `0.2.6`, 2026-08-29).\n> VS Code **0.37.72 -> 0.37.73** and JetBrains\n> **0.4.103 -> 0.4.104** carry the paired governed review surfaces.\n\n- **Durable Graph history**: fixed App Server/SDK clients expose bounded,\n metadata-only event and snapshot history for blocked-root, revision-diff,\n and time-travel debugging across CLI, Desktop, and VS Code.\n- **Recoverable HumanTask quorum**: Graph human nodes persist exact\n revision/attempt/operation bindings, release Agent capacity while waiting,\n and enforce single-winner cancel/decision CAS, quorum, and separation of\n duties through the Desktop product surface.\n- **IDE review parity**: VS Code adds bounded Graph history/diff projection;\n both IDEs enforce revision-bound approval grants and single-winner\n settlement without accepting UI-derived authority.\n- **Migration and retirement evidence**: N-1 definition backups, rollback\n digests, replay validation, replacement reachability, historical reads, and\n zero-success legacy-writer observations are bound to durable exact-SHA\n evidence rather than prose-only rollout claims.\n- **Reliability gates**: temporal message custody, dependency/scope fairness,\n cross-process DAG recovery, effect idempotency, and worktree cleanup have\n explicit bounded artifacts and fail-closed aggregate checks.\n- **Release validation**: publication requires this exact candidate to pass\n Agent Protocol and Python SDK conformance, Linux/Windows/macOS `CLI CI` and\n `CLI Strict Sandbox`, the Graph real-journey matrix, immutable package\n checks, and public-registry provenance readback."
|
|
47
73
|
}
|
|
48
74
|
]
|
|
49
75
|
},
|
|
@@ -18,6 +18,16 @@ function fail(code, message) {
|
|
|
18
18
|
return { ok: false, error: { code, message } };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
async function canonicalMemoryService(scopeKey) {
|
|
22
|
+
const { resolveCliContextMemoryCutover } =
|
|
23
|
+
await import("../../lib/context-memory-kernel/authority.js");
|
|
24
|
+
const decision = resolveCliContextMemoryCutover({ scopeKey });
|
|
25
|
+
if (!decision.canonical) return null;
|
|
26
|
+
const { createCliCanonicalMemoryService } =
|
|
27
|
+
await import("../../lib/context-memory-kernel/memory-service.js");
|
|
28
|
+
return createCliCanonicalMemoryService();
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
async function loadSingletons() {
|
|
22
32
|
return import("../../lib/session-core-singletons.js");
|
|
23
33
|
}
|
|
@@ -133,11 +143,11 @@ async function sessionsPolicySet(message) {
|
|
|
133
143
|
const { getApprovalGate } = await loadSingletons();
|
|
134
144
|
const gate = await getApprovalGate();
|
|
135
145
|
try {
|
|
136
|
-
gate.setSessionPolicy(message.sessionId, message.policy);
|
|
146
|
+
await gate.setSessionPolicy(message.sessionId, message.policy);
|
|
147
|
+
await gate.awaitPersistence?.();
|
|
137
148
|
} catch (e) {
|
|
138
|
-
return fail("INVALID_POLICY", e.message);
|
|
149
|
+
return fail(e.code || "INVALID_POLICY", e.message);
|
|
139
150
|
}
|
|
140
|
-
await new Promise((r) => setImmediate(r));
|
|
141
151
|
return ok({
|
|
142
152
|
sessionId: message.sessionId,
|
|
143
153
|
policy: gate.getSessionPolicy(message.sessionId),
|
|
@@ -146,6 +156,24 @@ async function sessionsPolicySet(message) {
|
|
|
146
156
|
|
|
147
157
|
async function memoryStore(message) {
|
|
148
158
|
if (!message.content) return fail("BAD_REQUEST", "content required");
|
|
159
|
+
const canonical = await canonicalMemoryService("cli:ws:memory.store");
|
|
160
|
+
if (canonical) {
|
|
161
|
+
try {
|
|
162
|
+
const scope = message.scope || "global";
|
|
163
|
+
const entry = await canonical.addScoped(message.content, {
|
|
164
|
+
scope,
|
|
165
|
+
scopeId: scope === "global" ? null : message.scopeId || message.agentId,
|
|
166
|
+
category: message.category,
|
|
167
|
+
tags: message.tags || [],
|
|
168
|
+
source: "cli-ws-session-core",
|
|
169
|
+
evidenceStore: "cli-ws-session-core",
|
|
170
|
+
evidenceId: String(message.id || `memory-store-${Date.now()}`),
|
|
171
|
+
});
|
|
172
|
+
return ok({ entry });
|
|
173
|
+
} catch (error) {
|
|
174
|
+
return fail(error.code || "MEMORY_STORE_FAILED", error.message);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
149
177
|
const { getMemoryStore } = await loadSingletons();
|
|
150
178
|
const store = getMemoryStore();
|
|
151
179
|
const entry = store.add({
|
|
@@ -162,6 +190,26 @@ async function memoryStore(message) {
|
|
|
162
190
|
}
|
|
163
191
|
|
|
164
192
|
async function memoryRecall(message) {
|
|
193
|
+
const canonical = await canonicalMemoryService("cli:ws:memory.recall");
|
|
194
|
+
if (canonical) {
|
|
195
|
+
try {
|
|
196
|
+
const scope = message.scope || "global";
|
|
197
|
+
const result = await canonical.recallScoped(message.query || "*", {
|
|
198
|
+
scope,
|
|
199
|
+
scopeId: scope === "global" ? null : message.scopeId || message.agentId,
|
|
200
|
+
tags: message.tags,
|
|
201
|
+
category: message.category,
|
|
202
|
+
limit: message.limit,
|
|
203
|
+
sink: "cli.ws",
|
|
204
|
+
});
|
|
205
|
+
return ok({
|
|
206
|
+
results: result.results,
|
|
207
|
+
memoryRevision: result.memoryRevision,
|
|
208
|
+
});
|
|
209
|
+
} catch (error) {
|
|
210
|
+
return fail(error.code || "MEMORY_RECALL_FAILED", error.message);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
165
213
|
const { getMemoryStore } = await loadSingletons();
|
|
166
214
|
const store = getMemoryStore();
|
|
167
215
|
const results = store.recall({
|
|
@@ -178,6 +226,17 @@ async function memoryRecall(message) {
|
|
|
178
226
|
|
|
179
227
|
async function memoryDelete(message) {
|
|
180
228
|
if (!message.id) return fail("BAD_REQUEST", "id required");
|
|
229
|
+
const canonical = await canonicalMemoryService("cli:ws:memory.delete");
|
|
230
|
+
if (canonical) {
|
|
231
|
+
try {
|
|
232
|
+
const receipt = await canonical.delete(message.id);
|
|
233
|
+
return receipt
|
|
234
|
+
? ok({ id: message.id, deleted: true, receipt })
|
|
235
|
+
: fail("NOT_FOUND", `Memory ${message.id} not found`);
|
|
236
|
+
} catch (error) {
|
|
237
|
+
return fail(error.code || "MEMORY_DELETE_FAILED", error.message);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
181
240
|
const { getMemoryStore } = await loadSingletons();
|
|
182
241
|
const store = getMemoryStore();
|
|
183
242
|
const entry = store.get(message.id);
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
sessionBudgetAdmissionError,
|
|
31
31
|
} from "../../lib/session-budget-production-root.js";
|
|
32
32
|
import { mergePricing } from "../../lib/llm-pricing.js";
|
|
33
|
+
import { ensureCanonicalSessionTranscript } from "../../lib/session-transcript-migration.js";
|
|
33
34
|
|
|
34
35
|
const PAYLOAD_DIGEST = /^sha256:[0-9a-f]{64}$/;
|
|
35
36
|
const RAW_AUTHORITY_HASH = /^[0-9a-f]{64}$/;
|
|
@@ -752,7 +753,11 @@ export async function handleSessionCreate(server, id, ws, message) {
|
|
|
752
753
|
createdSessionId = sessionId;
|
|
753
754
|
|
|
754
755
|
const session = server.sessionManager.getSession(sessionId);
|
|
755
|
-
if (
|
|
756
|
+
if (
|
|
757
|
+
(sessionType || "agent") === "agent" &&
|
|
758
|
+
(sessionBudgetRoot.enabled ||
|
|
759
|
+
typeof server.sessionManager.markCanonicalSession === "function")
|
|
760
|
+
) {
|
|
756
761
|
bootstrapLease = wsBudgetDependency(
|
|
757
762
|
server,
|
|
758
763
|
"acquireSessionHostLease",
|
|
@@ -768,24 +773,33 @@ export async function handleSessionCreate(server, id, ws, message) {
|
|
|
768
773
|
title: `WS agent ${new Date().toISOString().slice(0, 10)}`,
|
|
769
774
|
provider: session.provider,
|
|
770
775
|
model: session.model || "",
|
|
771
|
-
sessionBudgetRoot,
|
|
776
|
+
...(sessionBudgetRoot.enabled ? { sessionBudgetRoot } : {}),
|
|
772
777
|
});
|
|
773
778
|
canonicalSessionCreated = true;
|
|
774
779
|
} catch (cause) {
|
|
775
780
|
const error = new Error(
|
|
776
|
-
"
|
|
781
|
+
"WebSocket canonical session could not be durably created",
|
|
777
782
|
{ cause },
|
|
778
783
|
);
|
|
779
|
-
error.code =
|
|
784
|
+
error.code = sessionBudgetRoot.enabled
|
|
785
|
+
? "CC_SESSION_BUDGET_SESSION_START_FAILED"
|
|
786
|
+
: "CC_WS_CANONICAL_SESSION_START_FAILED";
|
|
780
787
|
throw error;
|
|
781
788
|
}
|
|
782
789
|
if (startedSessionId !== sessionId) {
|
|
783
790
|
const error = new Error(
|
|
784
|
-
"
|
|
791
|
+
"WebSocket canonical session returned a different session id",
|
|
785
792
|
);
|
|
786
|
-
error.code =
|
|
793
|
+
error.code = sessionBudgetRoot.enabled
|
|
794
|
+
? "CC_SESSION_BUDGET_SESSION_START_FAILED"
|
|
795
|
+
: "CC_WS_CANONICAL_SESSION_START_FAILED";
|
|
787
796
|
throw error;
|
|
788
797
|
}
|
|
798
|
+
if (typeof server.sessionManager.markCanonicalSession === "function") {
|
|
799
|
+
server.sessionManager.markCanonicalSession(sessionId);
|
|
800
|
+
} else {
|
|
801
|
+
session.canonicalJsonlSession = true;
|
|
802
|
+
}
|
|
789
803
|
const canonicalStart = wsBudgetDependency(
|
|
790
804
|
server,
|
|
791
805
|
"readSessionHostResumeState",
|
|
@@ -793,17 +807,20 @@ export async function handleSessionCreate(server, id, ws, message) {
|
|
|
793
807
|
)(sessionId);
|
|
794
808
|
if (!canonicalStart?.snapshot?.verified) {
|
|
795
809
|
const error = new Error(
|
|
796
|
-
"
|
|
810
|
+
"WebSocket canonical session could not be verified",
|
|
797
811
|
);
|
|
798
|
-
error.code =
|
|
812
|
+
error.code = sessionBudgetRoot.enabled
|
|
813
|
+
? "CC_SESSION_BUDGET_SESSION_START_FAILED"
|
|
814
|
+
: "CC_WS_CANONICAL_SESSION_START_FAILED";
|
|
799
815
|
throw error;
|
|
800
816
|
}
|
|
801
817
|
if (
|
|
802
|
-
|
|
803
|
-
!
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
818
|
+
sessionBudgetRoot.enabled &&
|
|
819
|
+
(!canonicalStart.sessionBudgetRoot ||
|
|
820
|
+
!sameSessionBudgetConfig(
|
|
821
|
+
canonicalStart.sessionBudgetRoot,
|
|
822
|
+
sessionBudgetRoot,
|
|
823
|
+
))
|
|
807
824
|
) {
|
|
808
825
|
const error = new Error(
|
|
809
826
|
"Budgeted WebSocket JSONL declaration does not match the requested root",
|
|
@@ -945,7 +962,14 @@ export async function handleSessionResume(server, id, ws, message) {
|
|
|
945
962
|
}
|
|
946
963
|
|
|
947
964
|
const { sessionId } = message;
|
|
948
|
-
|
|
965
|
+
// Always consult the canonical transcript before the compatibility store.
|
|
966
|
+
// A manager without the newer markCanonicalSession() hook may still be
|
|
967
|
+
// resuming a session that another host already committed to JSONL. Skipping
|
|
968
|
+
// this read lets stale DB/WS state replace verified history and also bypasses
|
|
969
|
+
// missing/tampered/rollback refusal. readSessionHostResumeState() returns
|
|
970
|
+
// null for a genuinely absent transcript, so legacy-only sessions retain
|
|
971
|
+
// their compatibility fallback without weakening canonical authority.
|
|
972
|
+
let canonicalResume = wsBudgetDependency(
|
|
949
973
|
server,
|
|
950
974
|
"readSessionHostResumeState",
|
|
951
975
|
readSessionHostResumeState,
|
|
@@ -963,7 +987,20 @@ export async function handleSessionResume(server, id, ws, message) {
|
|
|
963
987
|
);
|
|
964
988
|
return;
|
|
965
989
|
}
|
|
966
|
-
|
|
990
|
+
let session = server.sessionManager.resumeSession(sessionId);
|
|
991
|
+
if (
|
|
992
|
+
!session &&
|
|
993
|
+
canonicalResume?.snapshot?.verified === true &&
|
|
994
|
+
typeof server.sessionManager.resumeCanonicalSession === "function"
|
|
995
|
+
) {
|
|
996
|
+
try {
|
|
997
|
+
session = server.sessionManager.resumeCanonicalSession(sessionId, {
|
|
998
|
+
type: "agent",
|
|
999
|
+
});
|
|
1000
|
+
} catch {
|
|
1001
|
+
session = null;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
967
1004
|
|
|
968
1005
|
if (!session) {
|
|
969
1006
|
server._send(
|
|
@@ -978,6 +1015,77 @@ export async function handleSessionResume(server, id, ws, message) {
|
|
|
978
1015
|
return;
|
|
979
1016
|
}
|
|
980
1017
|
|
|
1018
|
+
if (
|
|
1019
|
+
canonicalResume?.snapshot?.verified === true &&
|
|
1020
|
+
session.canonicalJsonlSession !== true &&
|
|
1021
|
+
typeof server.sessionManager.markCanonicalSession === "function"
|
|
1022
|
+
) {
|
|
1023
|
+
try {
|
|
1024
|
+
server.sessionManager.markCanonicalSession(session.id);
|
|
1025
|
+
canonicalResume = wsBudgetDependency(
|
|
1026
|
+
server,
|
|
1027
|
+
"readSessionHostResumeState",
|
|
1028
|
+
readSessionHostResumeState,
|
|
1029
|
+
)(session.id);
|
|
1030
|
+
} catch (error) {
|
|
1031
|
+
server._send(
|
|
1032
|
+
ws,
|
|
1033
|
+
envelopeError(
|
|
1034
|
+
id,
|
|
1035
|
+
error?.code || "CC_WS_CANONICAL_SESSION_BIND_FAILED",
|
|
1036
|
+
error?.message || "WebSocket canonical session binding failed",
|
|
1037
|
+
sessionId,
|
|
1038
|
+
),
|
|
1039
|
+
);
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
if (
|
|
1045
|
+
!canonicalResume &&
|
|
1046
|
+
session.type === "agent" &&
|
|
1047
|
+
typeof server.sessionManager.markCanonicalSession === "function"
|
|
1048
|
+
) {
|
|
1049
|
+
try {
|
|
1050
|
+
ensureCanonicalSessionTranscript({
|
|
1051
|
+
sessionId: session.id,
|
|
1052
|
+
title: `WS agent ${new Date().toISOString().slice(0, 10)}`,
|
|
1053
|
+
provider: session.provider,
|
|
1054
|
+
model: session.model || "",
|
|
1055
|
+
messages: session.messages,
|
|
1056
|
+
source: "sqlite:llm_sessions",
|
|
1057
|
+
stripLeadingSystem: true,
|
|
1058
|
+
});
|
|
1059
|
+
if (typeof server.sessionManager.markCanonicalSession === "function") {
|
|
1060
|
+
server.sessionManager.markCanonicalSession(session.id);
|
|
1061
|
+
} else {
|
|
1062
|
+
session.canonicalJsonlSession = true;
|
|
1063
|
+
}
|
|
1064
|
+
canonicalResume = wsBudgetDependency(
|
|
1065
|
+
server,
|
|
1066
|
+
"readSessionHostResumeState",
|
|
1067
|
+
readSessionHostResumeState,
|
|
1068
|
+
)(session.id);
|
|
1069
|
+
if (!canonicalResume?.snapshot?.verified) {
|
|
1070
|
+
throw Object.assign(
|
|
1071
|
+
new Error("Migrated WebSocket session could not be verified"),
|
|
1072
|
+
{ code: "CC_WS_CANONICAL_SESSION_MIGRATION_FAILED" },
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
} catch (error) {
|
|
1076
|
+
server._send(
|
|
1077
|
+
ws,
|
|
1078
|
+
envelopeError(
|
|
1079
|
+
id,
|
|
1080
|
+
error?.code || "CC_WS_CANONICAL_SESSION_MIGRATION_FAILED",
|
|
1081
|
+
error?.message || "WebSocket session migration failed",
|
|
1082
|
+
sessionId,
|
|
1083
|
+
),
|
|
1084
|
+
);
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
|
|
981
1089
|
let sessionBudgetRoot;
|
|
982
1090
|
let canonicalSessionBudgetRoot = null;
|
|
983
1091
|
try {
|
|
@@ -42,6 +42,12 @@ import { createWsApprovalGate } from "./ws-approval-gate.js";
|
|
|
42
42
|
import { createSessionMcpLedgerSink } from "../../lib/mcp-call-ledger-store.js";
|
|
43
43
|
import { createMcpHostRecoveryRuntime } from "../../lib/mcp-host-recovery-runtime.js";
|
|
44
44
|
import { compactConversationWithProvider } from "../../harness/provider-backed-compaction.js";
|
|
45
|
+
import {
|
|
46
|
+
estimateMessagesTokens,
|
|
47
|
+
PromptCompressor,
|
|
48
|
+
} from "../../harness/prompt-compressor.js";
|
|
49
|
+
import { resolveCliContextMemoryCutover } from "../../lib/context-memory-kernel/authority.js";
|
|
50
|
+
import { compactLiveMessagesCanonical } from "../../lib/context-memory-kernel/live-compaction.js";
|
|
45
51
|
import { projectCanonicalResumeMessages } from "../../lib/session-message-provenance.js";
|
|
46
52
|
import { feature } from "../../lib/feature-flags.js";
|
|
47
53
|
import { classifyStreamRetryReason } from "../../lib/stream-retry.js";
|
|
@@ -586,6 +592,124 @@ export class WSAgentHandler {
|
|
|
586
592
|
return block;
|
|
587
593
|
}
|
|
588
594
|
|
|
595
|
+
_contextMemoryCutover() {
|
|
596
|
+
return resolveCliContextMemoryCutover({
|
|
597
|
+
env: this.session.contextMemoryEnv || process.env,
|
|
598
|
+
scopeKey: `cli:session:${this.session.id}`,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
async _compactContextMemory(messages, providerOptions, trigger) {
|
|
603
|
+
const cutover = this._contextMemoryCutover();
|
|
604
|
+
if (!cutover.canonical) {
|
|
605
|
+
return compactConversationWithProvider(messages, providerOptions);
|
|
606
|
+
}
|
|
607
|
+
const probe = new PromptCompressor({
|
|
608
|
+
model: providerOptions.model,
|
|
609
|
+
provider: providerOptions.provider,
|
|
610
|
+
...(providerOptions.maxMessages
|
|
611
|
+
? { maxMessages: providerOptions.maxMessages }
|
|
612
|
+
: {}),
|
|
613
|
+
...(providerOptions.maxTokens
|
|
614
|
+
? { maxTokens: providerOptions.maxTokens }
|
|
615
|
+
: {}),
|
|
616
|
+
});
|
|
617
|
+
if (
|
|
618
|
+
providerOptions.onlyIfNeeded === true &&
|
|
619
|
+
!probe.shouldAutoCompact(messages)
|
|
620
|
+
) {
|
|
621
|
+
const tokens = estimateMessagesTokens(messages);
|
|
622
|
+
return {
|
|
623
|
+
messages: [...messages],
|
|
624
|
+
stats: {
|
|
625
|
+
strategy: "none",
|
|
626
|
+
originalMessages: messages.length,
|
|
627
|
+
compressedMessages: messages.length,
|
|
628
|
+
originalTokens: tokens,
|
|
629
|
+
compressedTokens: tokens,
|
|
630
|
+
saved: 0,
|
|
631
|
+
},
|
|
632
|
+
degradedEvent: null,
|
|
633
|
+
usageEvent: null,
|
|
634
|
+
usageUnknownEvent: null,
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
let compatibilityResult = null;
|
|
639
|
+
const canonical = await compactLiveMessagesCanonical(messages, {
|
|
640
|
+
compressor: {
|
|
641
|
+
maxTokens: probe.maxTokens,
|
|
642
|
+
compress: async (dropped) => {
|
|
643
|
+
compatibilityResult = await compactConversationWithProvider(
|
|
644
|
+
dropped,
|
|
645
|
+
providerOptions,
|
|
646
|
+
);
|
|
647
|
+
await providerOptions.onContextMemorySummarySettled?.(
|
|
648
|
+
compatibilityResult,
|
|
649
|
+
);
|
|
650
|
+
return compatibilityResult;
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
|
+
sessionId: this.session.id,
|
|
654
|
+
operationId: `${trigger}-${randomUUID()}`,
|
|
655
|
+
provider: this.session.provider,
|
|
656
|
+
model: this.session.model,
|
|
657
|
+
env: this.session.contextMemoryEnv || process.env,
|
|
658
|
+
persist: this.session.canonicalJsonlSession === true,
|
|
659
|
+
trigger,
|
|
660
|
+
...(this.session.canonicalJsonlSession === true
|
|
661
|
+
? {
|
|
662
|
+
commit: (stats, output, settlement) => {
|
|
663
|
+
this._sessionHostLease?.assert?.();
|
|
664
|
+
const result =
|
|
665
|
+
this._canonicalSessionStore.appendCompactEventIfMessagesMatch(
|
|
666
|
+
this.session.id,
|
|
667
|
+
{
|
|
668
|
+
...stats,
|
|
669
|
+
trigger,
|
|
670
|
+
messages: projectCanonicalResumeMessages(output, {
|
|
671
|
+
strict: true,
|
|
672
|
+
}),
|
|
673
|
+
},
|
|
674
|
+
settlement.expectedMessages,
|
|
675
|
+
);
|
|
676
|
+
if (result && typeof result.then === "function") {
|
|
677
|
+
void Promise.resolve(result).catch(() => {});
|
|
678
|
+
const error = new TypeError(
|
|
679
|
+
"Canonical compact settlement must be synchronous",
|
|
680
|
+
);
|
|
681
|
+
error.code = "CC_COMPACTION_SETTLEMENT_ASYNC";
|
|
682
|
+
throw error;
|
|
683
|
+
}
|
|
684
|
+
return result;
|
|
685
|
+
},
|
|
686
|
+
}
|
|
687
|
+
: {}),
|
|
688
|
+
});
|
|
689
|
+
if (canonical.receipt.status === "stale") {
|
|
690
|
+
const error = new Error(
|
|
691
|
+
"session messages changed during canonical compaction",
|
|
692
|
+
);
|
|
693
|
+
error.code = "SESSION_REVISION_STALE";
|
|
694
|
+
throw error;
|
|
695
|
+
}
|
|
696
|
+
if (
|
|
697
|
+
canonical.receipt.status === "reconciliation_required" &&
|
|
698
|
+
!compatibilityResult?.usageUnknownEvent
|
|
699
|
+
) {
|
|
700
|
+
const error = new Error("canonical compaction requires reconciliation");
|
|
701
|
+
error.code = "CC_COMPACTION_RECONCILIATION_REQUIRED";
|
|
702
|
+
throw error;
|
|
703
|
+
}
|
|
704
|
+
return {
|
|
705
|
+
messages: canonical.messages,
|
|
706
|
+
stats: canonical.stats,
|
|
707
|
+
degradedEvent: compatibilityResult?.degradedEvent || null,
|
|
708
|
+
usageEvent: compatibilityResult?.usageEvent || null,
|
|
709
|
+
usageUnknownEvent: compatibilityResult?.usageUnknownEvent || null,
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
|
|
589
713
|
_canonicalTurnFromAuthority(state, requestId, userMessage, inputDigest) {
|
|
590
714
|
const status = state?.status || (state?.turn ? "completed" : "none");
|
|
591
715
|
this._applyCanonicalMessages(state?.messages || []);
|
|
@@ -630,7 +754,8 @@ export class WSAgentHandler {
|
|
|
630
754
|
const { session } = this;
|
|
631
755
|
if (
|
|
632
756
|
session.autoCompact === false ||
|
|
633
|
-
!feature("PROMPT_COMPRESSOR")
|
|
757
|
+
(!feature("PROMPT_COMPRESSOR") &&
|
|
758
|
+
!this._contextMemoryCutover().canonical) ||
|
|
634
759
|
this._compactionSettlementBlock?.commitState === "provider-usage-unknown"
|
|
635
760
|
) {
|
|
636
761
|
return true;
|
|
@@ -647,7 +772,7 @@ export class WSAgentHandler {
|
|
|
647
772
|
let result;
|
|
648
773
|
try {
|
|
649
774
|
this._sessionHostLease?.assert?.();
|
|
650
|
-
result = await
|
|
775
|
+
result = await this._compactContextMemory(session.messages, {
|
|
651
776
|
provider: session.provider,
|
|
652
777
|
model: session.model,
|
|
653
778
|
baseUrl: session.baseUrl,
|
|
@@ -675,8 +800,17 @@ export class WSAgentHandler {
|
|
|
675
800
|
maxTokens: session.compactionMaxTokens,
|
|
676
801
|
maxOutputTokens: session.compactionMaxOutputTokens,
|
|
677
802
|
summaryInputMaxChars: session.compactionInputMaxChars,
|
|
678
|
-
|
|
679
|
-
|
|
803
|
+
onContextMemorySummarySettled: (summaryResult) => {
|
|
804
|
+
if (compactionUsageCall && !compactionUsageSettled) {
|
|
805
|
+
this._settleCanonicalCompactionUsage(
|
|
806
|
+
compactionUsageCall,
|
|
807
|
+
summaryResult,
|
|
808
|
+
);
|
|
809
|
+
compactionUsageSettled = true;
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
}, "auto");
|
|
813
|
+
if (compactionUsageCall && !compactionUsageSettled) {
|
|
680
814
|
this._settleCanonicalCompactionUsage(compactionUsageCall, result);
|
|
681
815
|
compactionUsageSettled = true;
|
|
682
816
|
}
|
|
@@ -747,7 +881,11 @@ export class WSAgentHandler {
|
|
|
747
881
|
);
|
|
748
882
|
const shouldSettle = stats?.strategy !== "none" && stats?.saved > 0;
|
|
749
883
|
let settlementError = null;
|
|
750
|
-
if (
|
|
884
|
+
if (
|
|
885
|
+
!messagesChanged &&
|
|
886
|
+
shouldSettle &&
|
|
887
|
+
stats?.canonicalAlreadySettled !== true
|
|
888
|
+
) {
|
|
751
889
|
try {
|
|
752
890
|
const settlement =
|
|
753
891
|
this._canonicalSessionStore.appendCompactEventIfMessagesMatch(
|
|
@@ -1977,7 +2115,7 @@ export class WSAgentHandler {
|
|
|
1977
2115
|
try {
|
|
1978
2116
|
this.assertSessionBudgetAdmission("WebSocket compaction");
|
|
1979
2117
|
this._sessionHostLease?.assert?.();
|
|
1980
|
-
result = await
|
|
2118
|
+
result = await this._compactContextMemory(session.messages, {
|
|
1981
2119
|
provider: session.provider,
|
|
1982
2120
|
model: session.model,
|
|
1983
2121
|
baseUrl: session.baseUrl,
|
|
@@ -2002,8 +2140,17 @@ export class WSAgentHandler {
|
|
|
2002
2140
|
: {}),
|
|
2003
2141
|
maxOutputTokens: session.compactionMaxOutputTokens,
|
|
2004
2142
|
summaryInputMaxChars: session.compactionInputMaxChars,
|
|
2005
|
-
|
|
2006
|
-
|
|
2143
|
+
onContextMemorySummarySettled: (summaryResult) => {
|
|
2144
|
+
if (compactionUsageCall && !compactionUsageSettled) {
|
|
2145
|
+
this._settleCanonicalCompactionUsage(
|
|
2146
|
+
compactionUsageCall,
|
|
2147
|
+
summaryResult,
|
|
2148
|
+
);
|
|
2149
|
+
compactionUsageSettled = true;
|
|
2150
|
+
}
|
|
2151
|
+
},
|
|
2152
|
+
}, "manual");
|
|
2153
|
+
if (compactionUsageCall && !compactionUsageSettled) {
|
|
2007
2154
|
this._settleCanonicalCompactionUsage(compactionUsageCall, result);
|
|
2008
2155
|
compactionUsageSettled = true;
|
|
2009
2156
|
}
|
|
@@ -2068,7 +2215,8 @@ export class WSAgentHandler {
|
|
|
2068
2215
|
if (
|
|
2069
2216
|
!commandError &&
|
|
2070
2217
|
!messagesChanged &&
|
|
2071
|
-
session.canonicalJsonlSession === true
|
|
2218
|
+
session.canonicalJsonlSession === true &&
|
|
2219
|
+
stats?.canonicalAlreadySettled !== true
|
|
2072
2220
|
) {
|
|
2073
2221
|
if (stats?.strategy !== "none") {
|
|
2074
2222
|
try {
|