chainlesschain 0.166.143 → 0.166.146
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 +108 -10
- package/package.json +3 -3
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-DNySV2Kf.js → AIOps-BjBY1txq.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-ByFuxJsa.js → ActionButton-CS2ov4iK.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-ETbdywk5.js → Analytics-C9LS7ahG.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-CuHekZaP.js → AppLayout-4_s9gBVg.js} +2 -2
- package/src/assets/web-panel/assets/{Artifacts-BJJq2BDq.js → Artifacts-CwS17ayg.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DXrietv8.js → Audit-D3QMRsd-.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-CFB1fxsr.js → BackgroundAgents-Bxau9H9Q.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-VLtflRmp.js → Backup--YSJyAuP.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BbqBaS2r.js → BaseInput-DZolkmdu.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-t0g7BXL8.js → Chat-DA-7fNKq.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-JNFsjV0j.js → ChatBubbleRenderer-DniEWT5j.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BCSclHQb.js → Checkbox-B4hgbnOB.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BcyINEHT.js → Codegen-BQ3HSq9S.js} +1 -1
- package/src/assets/web-panel/assets/{Col-C-0WNlwS.js → Col-DJwxq_Wu.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DxZeoORX.js → Community-DZYVM_iz.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BNnX4jpz.js → Compact-1Yq5o53N.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-KnjHtn9C.js → Compliance-52Per8mR.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CDyCrhbX.js → Cowork-BaCNxzo7.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-DxpS3D1G.js → Cron-DADTMPPr.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-BSzTZYyc.js → Crosschain-CS3rx96X.js} +1 -1
- package/src/assets/web-panel/assets/{DID-Bfj9Vdne.js → DID-B8eatIvd.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-CcERVdgo.js → Dashboard-0vsurC1X.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BtYXAz6E.js → Dropdown-BULy3ccq.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-fdCMeGXU.js → EmailListRenderer-CcwgCUpu.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-LHxhcuF2.js → EvolutionSettings-DLs_6II3.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-MIgtLsos.js → FamilyGuardDashboard-DpUpWwQP.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-9-TOztwa.js → Federation-6hx8MMYA.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BKcwEE6w.js → FormItemContext-CsdE-ZR5.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DJBPVUK2.js → GenericCardRenderer-DzXneQPV.js} +1 -1
- package/src/assets/web-panel/assets/{Git-C_XYISjG.js → Git-D_ThKL1Q.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-DWsbPrwq.js → Governance-BFBSlr-9.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-D0_bYket.js → Inference-BAI0b1Jl.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BoA3VQlw.js → KnowledgeGraph-CpO6Bdtr.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-LEGItChf.js → Logs-BcRaS_HC.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-DOHVc-Uw.js → MarkdownRenderer-CmZaA7Ct.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-BKovl9NH.js → Marketplace-BpHBn0Nw.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-D61ktoGb.js → McpTools-auVxEYSE.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-CllorS0l.js → Memory-DpCyb656.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-D-dJ78bk.js → MobileBridge-CEIGi769.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-CaxMKkd3.js → MobileProjects-pphH0a8n.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-qEc62Qsx.js → Mtc-CMJXBEp1.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-BY68jOZJ.js → MtcAudit-BI25yvzM.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-eCCR8ELt.js → Multisig-BhMDExsQ.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-VtGv8pky.js → NLProgramming-CatOR9Ez.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-CPkYQySe.js → Notes-BHG6SBpu.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-BuAvlHUu.js → NotificationSettings-BB-m0AbL.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-CLf_HAGv.js → OrderTableRenderer-W-WReAih.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-DjujhMbD.js → Organization-BkQCgon_.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-RznznTS4.js → Overflow-kCTwPrIc.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-DSa5ot0t.js → P2P-CvOF8whc.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-oSEh6vkf.js → PdhVaultBrowser-DYkTzn6u.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-CdOZguX9.js → Permissions-F-UzeWVt.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-B4--6iEF.js → PersonalDataHub-BURpZBb6.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-BnI57jE8.js → Pipeline-lZYx_7qc.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-C8MId3ad.js → Privacy-DdfYgt1_.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DPGyYO8a.js → ProjectInit-DbMBCojn.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-qBMqaJaO.js → ProjectSettings-DPGbzkyi.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-Bq87Syce.js → Projects-B9-t2ofM.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-CVuG9Ugf.js → Providers-q9dSBLsP.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-C94c8m3q.js → QrScannerModal-BIth1Lij.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-BvfsXZ8s.js → QuickAsk-C928WbdK.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CoezBYH9.js → Recommend-CzDNsNPZ.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-CcYC4v3u.js → RemoteSession-CedjOslI.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-diDbL4cO.js → Reputation-B8ggKVtj.js} +1 -1
- package/src/assets/web-panel/assets/{Row-5qp3_fNS.js → Row-Cx167nF6.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BCsMvpV4.js → RssFeed-Cj8hwiLP.js} +1 -1
- package/src/assets/web-panel/assets/{Search-Br9nVxOp.js → Search-Dsyrkogu.js} +1 -1
- package/src/assets/web-panel/assets/{Security-BdOUzRfA.js → Security-DfOcWFt-.js} +1 -1
- package/src/assets/web-panel/assets/{Services-Cp9TqzyN.js → Services-CSyv-JgS.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-DSdWsUMR.js → Skeleton-B0chhFP5.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-DRczAMTe.js → Skills-B_jrR_AF.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-B6G_Vd8N.js → Sla-krP10aUI.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-BCcLx5x4.js → SpeechSettings-Cm_Cjvf2.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BFhwtxCp.js → SyncSettings-Cmb-KoqG.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-DGRE6VHO.js → Tasks-DUOiwTxY.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CJkJRFzd.js → Templates-DcEPspsP.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-CAOv6p00.js → Tenant-Dw93LtrE.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-CDrwwrKj.js → Terminal-B04i0AIG.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-DI0YE2SN.js → TimelineRenderer-C-aAORNK.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DmqWTZSG.js → Tokens-W1RBfDKb.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-CkXkhmjk.js → Trigger-BuuH9sMn.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-U8YJLcoJ.js → Trust-Bma-Vz-f.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-BLTozMmr.js → UkeySign-CqWw3_ha.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-DHKyFlZa.js → VideoEditing-6NYmQRUe.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-DapBxIQt.js → Wallet-CTUuBxsr.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-CkvG3yOr.js → WebAuthn-D8mN5UQU.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-cNLsinXP.js → WorkflowEditor-DOB46XMH.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BzgkgfMC.js → chat-BPNlNLwi.js} +1 -1
- package/src/assets/web-panel/assets/{colors-BPpVKQsb.js → colors-D-LNng0Q.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-zepznuTv.js → compact-item-Vkl3KOAb.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-BRto-SQH.js → createContext-CFsJ9Bmp.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-CqsmU_n6.js → hasIn-C1v7eiIB.js} +1 -1
- package/src/assets/web-panel/assets/{index-DKa_jSfj.js → index-0oRhV07J.js} +1 -1
- package/src/assets/web-panel/assets/{index-wbvZayBb.js → index-5oK4ICcR.js} +1 -1
- package/src/assets/web-panel/assets/{index-CwkhrUmw.js → index-9JeeBF92.js} +1 -1
- package/src/assets/web-panel/assets/{index-B0Z6rfV-.js → index-BGyhWFpc.js} +1 -1
- package/src/assets/web-panel/assets/{index-DUclk35X.js → index-BH5PxoVq.js} +1 -1
- package/src/assets/web-panel/assets/{index-Z6DBe2RU.js → index-BMcTUbpz.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXkw-nt5.js → index-BMsRfvkp.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeBxP1M6.js → index-BObyCZ2w.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_asIcU7.js → index-BPwv3l6X.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeSzdB7x.js → index-BQr5mmyc.js} +1 -1
- package/src/assets/web-panel/assets/{index-w36TkwyO.js → index-BVHaJNpn.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_-w4KkD.js → index-BefXafSw.js} +1 -1
- package/src/assets/web-panel/assets/{index-DvGttIXQ.js → index-BgvrlrtJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-LVvzNdPa.js → index-BiPmMm38.js} +1 -1
- package/src/assets/web-panel/assets/{index-CdHXVSZ4.js → index-BoZnaD3Q.js} +1 -1
- package/src/assets/web-panel/assets/{index-Q5sAV7wp.js → index-BxJC59QT.js} +1 -1
- package/src/assets/web-panel/assets/{index-BGHd4D8F.js → index-CD8egQCF.js} +1 -1
- package/src/assets/web-panel/assets/index-CLafGdQC.js +1 -0
- package/src/assets/web-panel/assets/{index-JrVhUwyh.js → index-CaJvbmCw.js} +1 -1
- package/src/assets/web-panel/assets/{index-CTk9gY88.js → index-CfVl0Oqt.js} +1 -1
- package/src/assets/web-panel/assets/{index-DJSn3owP.js → index-ChGe005u.js} +1 -1
- package/src/assets/web-panel/assets/{index-DDPmr5Yr.js → index-Cjxxw-1P.js} +1 -1
- package/src/assets/web-panel/assets/{index-BEXKES7V.js → index-CmkppTkH.js} +1 -1
- package/src/assets/web-panel/assets/{index-CmPnDXx4.js → index-DFErisPY.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_l6gfDh.js → index-DVfUt2bK.js} +1 -1
- package/src/assets/web-panel/assets/index-DYHw3Xoi.js +1 -0
- package/src/assets/web-panel/assets/{index-CnezE05k.js → index-DZ16Oxcu.js} +1 -1
- package/src/assets/web-panel/assets/{index-faHHtBKj.js → index-DbmhJVc3.js} +1 -1
- package/src/assets/web-panel/assets/{index-CzoKAiyT.js → index-Dd0OgZmt.js} +3 -3
- package/src/assets/web-panel/assets/{index-B-bNzvdU.js → index-DgYmI2pD.js} +1 -1
- package/src/assets/web-panel/assets/{index-B9_jRD2e.js → index-DmUZGqe2.js} +1 -1
- package/src/assets/web-panel/assets/{index-BuBnM6Kz.js → index-Dq9SDl82.js} +1 -1
- package/src/assets/web-panel/assets/{index-BLwY9y0X.js → index-DuIfomtv.js} +1 -1
- package/src/assets/web-panel/assets/{index-S8fkzbQ_.js → index-MGJzHAw_.js} +1 -1
- package/src/assets/web-panel/assets/{index-Df_CY0We.js → index-PCe8NA3J.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEbAW3Ec.js → index-PiL6D-FC.js} +1 -1
- package/src/assets/web-panel/assets/{index-CBI-7Q3W.js → index-a_H30VZX.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dnvj_XU-.js → index-hBzgHVea.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bz7pG8z3.js → index-uDSUo2y2.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-BlhbrsQk.js → initDefaultProps-CCYgHcTH.js} +1 -1
- package/src/assets/web-panel/assets/{motion-UZx12NPM.js → motion-4Yr4ZkjE.js} +1 -1
- package/src/assets/web-panel/assets/{move-BTby5W4q.js → move-ZP90E-ji.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-BOOaGiCg.js → mtc-parser-s0N3WyRA.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BVylGzEr.js → omit-BZ6gx9Kf.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-Cp3Nflbr.js → pickAttrs-DxUtFOOQ.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-BVXYvwH2.js → placementArrow-Btzjn1hK.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-C67SbpBN.js → responsiveObserve-DYcoe1XJ.js} +1 -1
- package/src/assets/web-panel/assets/{slide-CnBvM22R.js → slide-BiBewdr4.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-T8fy53tf.js → statusUtils-D9vt0dkG.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-Bf7i4nlm.js → styleChecker-BXsm_vG0.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-BUKk7jqw.js → useFlexGapSupport-CIG8zET4.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-T5lg6SpD.js → useFs-ChFPF8GI.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-Brvye8Tg.js → usePersonalDataHub-D4CzWJhY.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-CK992ojP.js → vnode-6V5tphk5.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-CcABB_97.js → zoom-B2H_VwfU.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +4 -4
- package/src/commands/agent.js +64 -62
- package/src/commands/goal.js +79 -0
- package/src/commands/mcp-tasks.js +239 -0
- package/src/commands/mcp.js +58 -2
- package/src/commands/memory.js +131 -7
- package/src/commands/session-show.js +36 -1
- package/src/data/changelog.json +39 -0
- package/src/generated/cc-agent-protocol.schema.json +175 -69
- package/src/harness/jsonl-session-store.js +10 -0
- package/src/harness/mcp-client.js +701 -51
- package/src/harness/prompt-compressor.js +1 -0
- package/src/harness/session-index.js +8 -0
- package/src/harness/session-list-index.js +13 -58
- package/src/host/README.md +43 -0
- package/src/host/project-goal-graph.js +57 -0
- package/src/lib/agent-session-export.js +19 -0
- package/src/lib/app-server/context-memory-notifications.js +11 -2
- package/src/lib/app-server/server.js +1 -0
- package/src/lib/background-launch-profile.js +38 -6
- package/src/lib/codex-app-server-adapter.js +20 -0
- package/src/lib/codex-app-server-support.js +2 -2
- package/src/lib/context-memory-kernel/local-semantic-source.js +426 -0
- package/src/lib/context-memory-kernel/local-semantic-worker.py +109 -0
- package/src/lib/context-memory-kernel/memory-query-control.js +5 -1
- package/src/lib/context-memory-kernel/memory-query-index.js +37 -1
- package/src/lib/context-memory-kernel/memory-service.js +35 -2
- package/src/lib/context-memory-kernel/message-adapter.js +27 -5
- package/src/lib/context-memory-kernel/provider-context.js +197 -15
- package/src/lib/context-memory-kernel/runtime.js +40 -0
- package/src/lib/context-memory-kernel/segmented-memory-port.js +26 -1
- package/src/lib/evolution/agent-evolution-ingress.js +55 -1
- package/src/lib/evolution/evolution-artifact-ports.js +36 -1
- package/src/lib/evolution/skill-candidate-registry.js +3 -1
- package/src/lib/formal-budget-authority.js +56 -3
- package/src/lib/formal-budget-contract.js +90 -5
- package/src/lib/formal-budget-provider-scope.js +29 -7
- package/src/lib/formal-budget-transport.js +36 -5
- package/src/lib/goal-store.js +219 -0
- package/src/lib/graph-kernel/graph-runtime-surfaces.json +30 -0
- package/src/lib/graph-kernel/production-source-evidence.js +3 -3
- package/src/lib/graph-kernel/runtime-surface-manifest.js +46 -9
- package/src/lib/graph-kernel/runtime.js +12 -1
- package/src/lib/mcp-call-ledger-projection.js +1026 -0
- package/src/lib/mcp-call-ledger-store.js +19 -1024
- package/src/lib/mcp-client.js +1 -0
- package/src/lib/mcp-ledger-recovery-admission.js +25 -0
- package/src/lib/mcp-stateless-protocol.js +158 -0
- package/src/lib/mcp-task-continuation-contract.js +129 -0
- package/src/lib/mcp-task-continuation.js +147 -0
- package/src/lib/mcp-task-delivery-contract.js +190 -0
- package/src/lib/mcp-task-delivery.js +113 -0
- package/src/lib/mcp-task-journal-projection.js +495 -0
- package/src/lib/mcp-task-journal.js +57 -0
- package/src/lib/mcp-task-runtime.js +627 -0
- package/src/lib/mcp-tasks.js +217 -0
- package/src/lib/model-input-diagnostics.js +265 -0
- package/src/lib/model-input-source-mapping.js +343 -0
- package/src/lib/openai-responses.js +32 -9
- package/src/lib/provider-request-admission.js +181 -0
- package/src/lib/public-ide-capability-manifest.js +2 -0
- package/src/lib/scheduler-kernel/graph-authority-adapter.js +140 -15
- package/src/lib/session-generation-authority.js +58 -0
- package/src/lib/session-host-snapshot.js +37 -0
- package/src/lib/session-input-lifecycle.js +147 -0
- package/src/lib/session-input-receipt.js +64 -0
- package/src/lib/session-message-provenance.js +6 -5
- package/src/lib/session-model-input-diagnostics.js +262 -0
- package/src/lib/session-model-usage-recovery.js +115 -0
- package/src/lib/session-transcript-history.js +9 -0
- package/src/lib/session-transcript-page.js +7 -1
- package/src/lib/session-transcript-structure.js +45 -0
- package/src/lib/storage-failure-cause-codes.js +79 -0
- package/src/lib/sub-agent-context.js +7 -3
- package/src/repl/agent-repl.js +526 -253
- package/src/runtime/agent-core.js +296 -151
- package/src/runtime/headless-runner.js +58 -69
- package/src/runtime/headless-stream.js +40 -33
- package/src/runtime/mcp-config.js +5 -3
- package/src/runtime/policies/agent-policy.js +1 -0
- package/src/assets/web-panel/assets/index-DruOFzuF.js +0 -1
- package/src/assets/web-panel/assets/index-hhOrZ6HO.js +0 -1
|
@@ -131,6 +131,7 @@ function summaryPrompt(messages, maxChars) {
|
|
|
131
131
|
`Return exactly one strict JSON object with all keys in this order: ${schema}.`,
|
|
132
132
|
'"objective" must be a string; every other value must be an array of strings.',
|
|
133
133
|
"Preserve constraints, exact file paths, test evidence, unresolved external side effects, blockers, and actionable next steps. Do not use Markdown.",
|
|
134
|
+
"Keep the JSON concise: use short phrases, avoid repetition, and target no more than 3 items per array so the complete object fits a bounded response.",
|
|
134
135
|
"Conversation history:",
|
|
135
136
|
].join("\n");
|
|
136
137
|
const historyBudget = Math.max(0, maxChars - instructions.length - 1);
|
|
@@ -24,6 +24,7 @@ import { ensureClaudeProjectStorageTree, getHomeDir } from "../lib/paths.js";
|
|
|
24
24
|
import { resolveClaudeProjectStorageDir } from "../lib/claude-project-storage-layout.js";
|
|
25
25
|
import { ensurePrivateDirectory, ensurePrivateFile } from "../lib/secure-fs.js";
|
|
26
26
|
import { readVerifiedProjection } from "./jsonl-session-store.js";
|
|
27
|
+
import { projectSessionInputMessages } from "../lib/session-input-lifecycle.js";
|
|
27
28
|
|
|
28
29
|
const requireCjs = createRequire(import.meta.url);
|
|
29
30
|
|
|
@@ -156,6 +157,13 @@ function summarizeVerifiedSession(id) {
|
|
|
156
157
|
messageCount += 2;
|
|
157
158
|
acceptContent(event.data.user.content);
|
|
158
159
|
acceptContent(event.data.assistant.content);
|
|
160
|
+
} else if (event.type === "session_input_settled") {
|
|
161
|
+
const pair = projectSessionInputMessages(event);
|
|
162
|
+
if (pair) {
|
|
163
|
+
messageCount += 2;
|
|
164
|
+
acceptContent(pair[0].content);
|
|
165
|
+
acceptContent(pair[1].content);
|
|
166
|
+
}
|
|
159
167
|
}
|
|
160
168
|
if (typeof event.hash === "string") chainHash = event.hash;
|
|
161
169
|
},
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SESSION_GENERATION_AUTHORITY_FIELD,
|
|
3
|
+
normalizeSessionGenerationAuthority,
|
|
4
|
+
} from "../lib/session-generation-authority.js";
|
|
1
5
|
/**
|
|
2
6
|
* Rebuildable metadata index for append-only JSONL sessions.
|
|
3
7
|
*
|
|
@@ -32,9 +36,11 @@ export const SESSION_INDEX_FILE = ".sessions-index-v2.ndjson";
|
|
|
32
36
|
export const SESSION_TOMBSTONE_MARKER_SUFFIX = ".tombstone";
|
|
33
37
|
export const SESSION_TOMBSTONE_MARKER_SCHEMA =
|
|
34
38
|
"chainlesschain.session-tombstone/v1";
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
export {
|
|
40
|
+
SESSION_GENERATION_AUTHORITY_FIELD,
|
|
41
|
+
SESSION_GENERATION_AUTHORITY_SCHEMA,
|
|
42
|
+
normalizeSessionGenerationAuthority,
|
|
43
|
+
} from "../lib/session-generation-authority.js";
|
|
38
44
|
|
|
39
45
|
// Used only by an opted-in child in the independent session-scale crash gate.
|
|
40
46
|
// Keeping the injection immediately around the production sidecar/journal
|
|
@@ -239,60 +245,6 @@ export function emptySessionMeta(sessionId) {
|
|
|
239
245
|
};
|
|
240
246
|
}
|
|
241
247
|
|
|
242
|
-
export function normalizeSessionGenerationAuthority(value) {
|
|
243
|
-
if (
|
|
244
|
-
!value ||
|
|
245
|
-
typeof value !== "object" ||
|
|
246
|
-
Array.isArray(value) ||
|
|
247
|
-
value.schema !== SESSION_GENERATION_AUTHORITY_SCHEMA ||
|
|
248
|
-
typeof value.sessionId !== "string" ||
|
|
249
|
-
value.sessionId.length === 0 ||
|
|
250
|
-
typeof value.generationId !== "string" ||
|
|
251
|
-
!/^generation-[0-9a-f-]{32,36}$/.test(value.generationId) ||
|
|
252
|
-
!Number.isSafeInteger(value.ordinal) ||
|
|
253
|
-
value.ordinal < 1
|
|
254
|
-
) {
|
|
255
|
-
return null;
|
|
256
|
-
}
|
|
257
|
-
let predecessor = null;
|
|
258
|
-
if (value.predecessor !== null) {
|
|
259
|
-
const previous = value.predecessor;
|
|
260
|
-
if (
|
|
261
|
-
!previous ||
|
|
262
|
-
typeof previous !== "object" ||
|
|
263
|
-
Array.isArray(previous) ||
|
|
264
|
-
!["tombstone", "legacy-tombstone"].includes(previous.kind) ||
|
|
265
|
-
(previous.generationId !== null &&
|
|
266
|
-
(typeof previous.generationId !== "string" ||
|
|
267
|
-
!/^generation-[0-9a-f-]{32,36}$/.test(previous.generationId))) ||
|
|
268
|
-
(previous.headHash !== null &&
|
|
269
|
-
(typeof previous.headHash !== "string" ||
|
|
270
|
-
!/^[0-9a-f]{64}$/.test(previous.headHash))) ||
|
|
271
|
-
!Number.isSafeInteger(previous.eventCount) ||
|
|
272
|
-
previous.eventCount < 0 ||
|
|
273
|
-
(previous.tombstonedAtMs !== null &&
|
|
274
|
-
(!Number.isSafeInteger(previous.tombstonedAtMs) ||
|
|
275
|
-
previous.tombstonedAtMs < 0))
|
|
276
|
-
) {
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
predecessor = {
|
|
280
|
-
kind: previous.kind,
|
|
281
|
-
generationId: previous.generationId,
|
|
282
|
-
headHash: previous.headHash,
|
|
283
|
-
eventCount: previous.eventCount,
|
|
284
|
-
tombstonedAtMs: previous.tombstonedAtMs,
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
return {
|
|
288
|
-
schema: SESSION_GENERATION_AUTHORITY_SCHEMA,
|
|
289
|
-
sessionId: value.sessionId,
|
|
290
|
-
generationId: value.generationId,
|
|
291
|
-
ordinal: value.ordinal,
|
|
292
|
-
predecessor,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
248
|
export function readSessionMeta(dir, sessionId) {
|
|
297
249
|
const filePath = sessionMetaPath(dir, sessionId);
|
|
298
250
|
if (!existsSync(filePath)) return null;
|
|
@@ -326,7 +278,8 @@ export function applyEventToSessionMeta(meta, event, lastHash) {
|
|
|
326
278
|
next.title = String(event.data.title);
|
|
327
279
|
} else if (
|
|
328
280
|
event?.type === "user_message" ||
|
|
329
|
-
event?.type === "assistant_message"
|
|
281
|
+
event?.type === "assistant_message" ||
|
|
282
|
+
event?.type === "mcp_task_delivery"
|
|
330
283
|
) {
|
|
331
284
|
next.message_count = Math.max(0, Number(next.message_count) || 0) + 1;
|
|
332
285
|
} else if (
|
|
@@ -337,6 +290,8 @@ export function applyEventToSessionMeta(meta, event, lastHash) {
|
|
|
337
290
|
event.data?.assistant?.role === "assistant"
|
|
338
291
|
) {
|
|
339
292
|
next.message_count = Math.max(0, Number(next.message_count) || 0) + 2;
|
|
293
|
+
} else if (event?.type === "session_input_settled") {
|
|
294
|
+
next.message_count = Math.max(0, Number(next.message_count) || 0) + 2;
|
|
340
295
|
}
|
|
341
296
|
const generation = normalizeSessionGenerationAuthority(
|
|
342
297
|
event?.data?.[SESSION_GENERATION_AUTHORITY_FIELD],
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Native host composition APIs (unreleased source)
|
|
2
|
+
|
|
3
|
+
`project-goal-graph.js` is a supported ESM host entry independent of the CLI
|
|
4
|
+
program entry. Importing it does not preload commands or start an agent/model
|
|
5
|
+
loop. Matching source builds of the CLI, Session Core and desktop host are
|
|
6
|
+
required; the public CLI 0.166.143 release does not include this API.
|
|
7
|
+
|
|
8
|
+
The API version is `PROJECT_GOAL_GRAPH_HOST_VERSION = 1`.
|
|
9
|
+
`createProjectGoalGraphAuthority({database, mode, clock, readCommittedResult})`
|
|
10
|
+
composes the existing `SchedulerOccurrenceGraphAuthority`, `GraphKernel`,
|
|
11
|
+
`GraphEventStore`, native SQLite rollout adapter and cutover ledger. Supply a
|
|
12
|
+
dedicated, protected native database; the returned authority owns its close.
|
|
13
|
+
The desktop host derives its path and persistent identity from trusted app and
|
|
14
|
+
project storage, rather than renderer input or CLI profile environment variables.
|
|
15
|
+
|
|
16
|
+
`ProjectGoalMonitoringEngine` receives this authority through its trusted
|
|
17
|
+
`graphAuthorityFactory` and adds native participation/head watermarks. A
|
|
18
|
+
`readCommittedResult(context)` callback must synchronously return either
|
|
19
|
+
`{found: true, result}` containing the exact, currently authorized native receipt,
|
|
20
|
+
or `{found: false}`. Missing evidence never permits automatic effect replay.
|
|
21
|
+
Cached scheduler successes are checked against both native evidence and durable
|
|
22
|
+
Graph history. Reads do not acquire Graph writer authority.
|
|
23
|
+
|
|
24
|
+
The personal-project host accepts `CHAINLESSCHAIN_GRAPH_PROJECT_GOALS` values
|
|
25
|
+
`legacy` (default), `shadow`, or `canonical`. An existing cutover ledger controls
|
|
26
|
+
new occurrences; existing Graph occurrences retain their original authority
|
|
27
|
+
when the flag changes. Loss, replacement, corruption or rollback of a required
|
|
28
|
+
journal is an error and never creates an implicit legacy fallback.
|
|
29
|
+
|
|
30
|
+
Entering Graph explicitly upgrades only participating native goals to
|
|
31
|
+
`chainlesschain.goal/v2` with `requiresGraphAwareHost: true`. This is a reader-floor
|
|
32
|
+
format migration; objective revision and control generation remain unchanged.
|
|
33
|
+
Older validators reject the record. Current native CAS forbids removing the
|
|
34
|
+
reader floor, and native monitoring requires a Graph-aware host thereafter.
|
|
35
|
+
Unused goals keep v1. Native risk receipts, budgets, permissions, confirmation
|
|
36
|
+
and independent goal completion remain under their existing services.
|
|
37
|
+
|
|
38
|
+
This is local opt-in support. Real product GUI, full platform/cutover observation
|
|
39
|
+
and exact-source release validation must be recorded separately. The production
|
|
40
|
+
inventory now includes `scheduler/desktop-project-goals`: 24 total entries,
|
|
41
|
+
21 durable, eight migratable, 13 retired and three disabled. Production evidence
|
|
42
|
+
therefore requires 72 independent signed source receipts; old 23-entry evidence
|
|
43
|
+
does not qualify the new inventory.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Supported desktop host composition entry. Keep this separate from index.js:
|
|
2
|
+
* importing the CLI program would preload commands and ambient user settings.
|
|
3
|
+
* The native host owns this dedicated database and its protection/lifecycle. */
|
|
4
|
+
import { SqliteRolloutStore } from "../lib/app-server/sqlite-rollout-store.js";
|
|
5
|
+
import { GraphEventStore } from "../lib/graph-kernel/event-store.js";
|
|
6
|
+
import { GraphCutoverLedger } from "../lib/graph-kernel/cutover-ledger.js";
|
|
7
|
+
import { GraphCutoverAuthorityResolver } from "../lib/graph-kernel/cutover-authority-resolver.js";
|
|
8
|
+
import { SchedulerOccurrenceGraphAuthority } from "../lib/scheduler-kernel/graph-authority-adapter.js";
|
|
9
|
+
|
|
10
|
+
export const PROJECT_GOAL_GRAPH_HOST_VERSION = 1;
|
|
11
|
+
export function projectGoalGraphMode(env = process.env) {
|
|
12
|
+
const mode = String(env.CHAINLESSCHAIN_GRAPH_PROJECT_GOALS ?? "legacy")
|
|
13
|
+
.trim()
|
|
14
|
+
.toLowerCase();
|
|
15
|
+
if (!["legacy", "shadow", "canonical"].includes(mode))
|
|
16
|
+
throw Object.assign(
|
|
17
|
+
new Error(
|
|
18
|
+
"CHAINLESSCHAIN_GRAPH_PROJECT_GOALS must be legacy, shadow, or canonical",
|
|
19
|
+
),
|
|
20
|
+
{ code: "GOAL_MONITOR_GRAPH_MODE_INVALID" },
|
|
21
|
+
);
|
|
22
|
+
return mode;
|
|
23
|
+
}
|
|
24
|
+
export function createProjectGoalGraphAuthority({
|
|
25
|
+
database,
|
|
26
|
+
mode = "legacy",
|
|
27
|
+
clock = Date.now,
|
|
28
|
+
readCommittedResult,
|
|
29
|
+
}) {
|
|
30
|
+
mode = projectGoalGraphMode({ CHAINLESSCHAIN_GRAPH_PROJECT_GOALS: mode });
|
|
31
|
+
if (
|
|
32
|
+
!database ||
|
|
33
|
+
typeof database.prepare !== "function" ||
|
|
34
|
+
typeof readCommittedResult !== "function"
|
|
35
|
+
)
|
|
36
|
+
throw Object.assign(
|
|
37
|
+
new Error("Native database and synchronous result reader are required"),
|
|
38
|
+
{ code: "GOAL_MONITOR_GRAPH_HOST_INVALID" },
|
|
39
|
+
);
|
|
40
|
+
const rolloutStore = new SqliteRolloutStore({ database, now: clock });
|
|
41
|
+
const eventStore = new GraphEventStore({ rolloutStore });
|
|
42
|
+
const resolver = new GraphCutoverAuthorityResolver({
|
|
43
|
+
surface: "scheduler",
|
|
44
|
+
entryId: "desktop-project-goals",
|
|
45
|
+
ledger: new GraphCutoverLedger({ store: rolloutStore }),
|
|
46
|
+
fallbackMode: mode,
|
|
47
|
+
});
|
|
48
|
+
const authority = new SchedulerOccurrenceGraphAuthority({
|
|
49
|
+
mode,
|
|
50
|
+
eventStore,
|
|
51
|
+
authorityResolver: resolver,
|
|
52
|
+
readCommittedResult,
|
|
53
|
+
now: clock,
|
|
54
|
+
});
|
|
55
|
+
authority.close = () => rolloutStore.close();
|
|
56
|
+
return authority;
|
|
57
|
+
}
|
|
@@ -14,6 +14,7 @@ import { projectToolRoundMessages } from "./session-tool-round.js";
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
export const TOOL_BLOCK_CAP = 4000;
|
|
17
|
+
import { projectSessionInputMessages } from "./session-input-lifecycle.js";
|
|
17
18
|
|
|
18
19
|
function asText(content) {
|
|
19
20
|
if (content == null) return "";
|
|
@@ -116,6 +117,24 @@ export function renderAgentSessionMarkdown(sessionId, events, opts = {}) {
|
|
|
116
117
|
L.push("");
|
|
117
118
|
}
|
|
118
119
|
break;
|
|
120
|
+
case "session_input_settled": {
|
|
121
|
+
const pair = projectSessionInputMessages(ev);
|
|
122
|
+
if (pair) {
|
|
123
|
+
users += 1;
|
|
124
|
+
assistants += 1;
|
|
125
|
+
L.push(
|
|
126
|
+
"## 👤 User",
|
|
127
|
+
"",
|
|
128
|
+
asText(pair[0].content),
|
|
129
|
+
"",
|
|
130
|
+
"## 🤖 Assistant",
|
|
131
|
+
"",
|
|
132
|
+
asText(pair[1].content),
|
|
133
|
+
"",
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
119
138
|
case "system":
|
|
120
139
|
L.push("## ⚙ System");
|
|
121
140
|
L.push("");
|
|
@@ -2,6 +2,7 @@ const MEMORY_MUTATION_EVENTS = new Set([
|
|
|
2
2
|
"memory.candidate.created",
|
|
3
3
|
"memory.activated",
|
|
4
4
|
"memory.reinforced",
|
|
5
|
+
"memory.corrected",
|
|
5
6
|
"memory.superseded",
|
|
6
7
|
"memory.expired",
|
|
7
8
|
]);
|
|
@@ -29,12 +30,20 @@ export function memoryMutationNotification(mutation) {
|
|
|
29
30
|
memory_id: mutation.record.memoryId,
|
|
30
31
|
revision: mutation.record.revision,
|
|
31
32
|
record_digest: mutation.record.digest,
|
|
32
|
-
|
|
33
|
+
...(mutation.event.type === "memory.corrected"
|
|
34
|
+
? {
|
|
35
|
+
previous_revision: mutation.event.previousRevision,
|
|
36
|
+
previous_record_digest: mutation.event.previousRecordDigest,
|
|
37
|
+
}
|
|
38
|
+
: { record: mutation.record }),
|
|
33
39
|
},
|
|
34
40
|
};
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
export function memoryDeletionNotification(
|
|
43
|
+
export function memoryDeletionNotification(
|
|
44
|
+
receipt,
|
|
45
|
+
operationId = receipt?.requestId,
|
|
46
|
+
) {
|
|
38
47
|
if (!receipt?.memoryId || !receipt?.recordDigest || !receipt?.revision) {
|
|
39
48
|
return null;
|
|
40
49
|
}
|
|
@@ -12,7 +12,8 @@ import { dirname, join, parse, resolve } from "node:path";
|
|
|
12
12
|
import { getConfigPath } from "./paths.js";
|
|
13
13
|
import { assertBackgroundArgvDurable } from "./background-command-argv.js";
|
|
14
14
|
|
|
15
|
-
export const BACKGROUND_LAUNCH_PROFILE_VERSION =
|
|
15
|
+
export const BACKGROUND_LAUNCH_PROFILE_VERSION = 2;
|
|
16
|
+
const LEGACY_BACKGROUND_LAUNCH_PROFILE_VERSION = 1;
|
|
16
17
|
|
|
17
18
|
const PERMISSION_MODES = new Set([
|
|
18
19
|
"manual",
|
|
@@ -247,7 +248,7 @@ function splitLongOption(token) {
|
|
|
247
248
|
|
|
248
249
|
function emptyParsedProfile(cwd, worktree, governance) {
|
|
249
250
|
return {
|
|
250
|
-
version:
|
|
251
|
+
version: LEGACY_BACKGROUND_LAUNCH_PROFILE_VERSION,
|
|
251
252
|
command: "agent",
|
|
252
253
|
llm: {
|
|
253
254
|
provider: null,
|
|
@@ -514,6 +515,14 @@ export function captureBackgroundLaunchProfile({
|
|
|
514
515
|
"thinkingTokens",
|
|
515
516
|
);
|
|
516
517
|
break;
|
|
518
|
+
case "--max-output-tokens":
|
|
519
|
+
// Older readers must reject this profile rather than drop its cap.
|
|
520
|
+
profile.version = BACKGROUND_LAUNCH_PROFILE_VERSION;
|
|
521
|
+
profile.budget.maxOutputTokens = policyBudget(
|
|
522
|
+
takePolicy(),
|
|
523
|
+
"maxOutputTokens",
|
|
524
|
+
);
|
|
525
|
+
break;
|
|
517
526
|
case "--max-rewakes":
|
|
518
527
|
profile.budget.maxRewakes = policyBudget(takePolicy(), "maxRewakes");
|
|
519
528
|
break;
|
|
@@ -718,11 +727,24 @@ function normalizeSource(source) {
|
|
|
718
727
|
|
|
719
728
|
/** Whitelist and normalize a profile supplied across an API boundary. */
|
|
720
729
|
export function normalizeBackgroundLaunchProfile(input) {
|
|
721
|
-
|
|
730
|
+
const version = Number(input?.version);
|
|
731
|
+
if (
|
|
732
|
+
!input ||
|
|
733
|
+
![
|
|
734
|
+
LEGACY_BACKGROUND_LAUNCH_PROFILE_VERSION,
|
|
735
|
+
BACKGROUND_LAUNCH_PROFILE_VERSION,
|
|
736
|
+
].includes(version)
|
|
737
|
+
) {
|
|
722
738
|
throw new Error(
|
|
723
739
|
`Unsupported background launch profile version: ${input?.version ?? "missing"}`,
|
|
724
740
|
);
|
|
725
741
|
}
|
|
742
|
+
if (
|
|
743
|
+
version === LEGACY_BACKGROUND_LAUNCH_PROFILE_VERSION &&
|
|
744
|
+
input.budget?.maxOutputTokens != null
|
|
745
|
+
) {
|
|
746
|
+
throw invalidProfileField("version");
|
|
747
|
+
}
|
|
726
748
|
const rejectField = (field) => {
|
|
727
749
|
throw invalidProfileField(field);
|
|
728
750
|
};
|
|
@@ -800,6 +822,7 @@ export function normalizeBackgroundLaunchProfile(input) {
|
|
|
800
822
|
"maxTurns",
|
|
801
823
|
"maxCostUsd",
|
|
802
824
|
"thinkingTokens",
|
|
825
|
+
"maxOutputTokens",
|
|
803
826
|
"maxRewakes",
|
|
804
827
|
"maxOuterTurns",
|
|
805
828
|
"goalMaxTokens",
|
|
@@ -830,7 +853,7 @@ export function normalizeBackgroundLaunchProfile(input) {
|
|
|
830
853
|
.filter(Boolean)
|
|
831
854
|
.sort((a, b) => a.path.localeCompare(b.path));
|
|
832
855
|
return {
|
|
833
|
-
version
|
|
856
|
+
version,
|
|
834
857
|
command: "agent",
|
|
835
858
|
llm: {
|
|
836
859
|
provider: scalar(input.llm?.provider),
|
|
@@ -891,6 +914,14 @@ export function normalizeBackgroundLaunchProfile(input) {
|
|
|
891
914
|
maxTurns: positive(input.budget?.maxTurns, true),
|
|
892
915
|
maxCostUsd: positive(input.budget?.maxCostUsd),
|
|
893
916
|
thinkingTokens: positive(input.budget?.thinkingTokens, true),
|
|
917
|
+
...(input.budget?.maxOutputTokens == null
|
|
918
|
+
? {}
|
|
919
|
+
: {
|
|
920
|
+
maxOutputTokens: policyBudget(
|
|
921
|
+
input.budget.maxOutputTokens,
|
|
922
|
+
"maxOutputTokens",
|
|
923
|
+
),
|
|
924
|
+
}),
|
|
894
925
|
maxRewakes: positive(input.budget?.maxRewakes, true),
|
|
895
926
|
maxOuterTurns: positive(input.budget?.maxOuterTurns, true),
|
|
896
927
|
goalMaxTokens: positive(input.budget?.goalMaxTokens, true),
|
|
@@ -1001,8 +1032,8 @@ function same(a, b) {
|
|
|
1001
1032
|
}
|
|
1002
1033
|
|
|
1003
1034
|
function isBudgetLooser(before, after) {
|
|
1004
|
-
if (before
|
|
1005
|
-
return after
|
|
1035
|
+
if (before == null) return false;
|
|
1036
|
+
return after == null || Number(after) > Number(before);
|
|
1006
1037
|
}
|
|
1007
1038
|
|
|
1008
1039
|
function isToolPolicyLooser(before, after) {
|
|
@@ -1151,6 +1182,7 @@ export function buildArgvFromBackgroundLaunchProfile(profile) {
|
|
|
1151
1182
|
pushValue(argv, "--max-turns", p.budget.maxTurns);
|
|
1152
1183
|
pushValue(argv, "--max-budget-usd", p.budget.maxCostUsd);
|
|
1153
1184
|
pushValue(argv, "--thinking-budget", p.budget.thinkingTokens);
|
|
1185
|
+
pushValue(argv, "--max-output-tokens", p.budget.maxOutputTokens);
|
|
1154
1186
|
pushValue(argv, "--max-rewakes", p.budget.maxRewakes);
|
|
1155
1187
|
pushValue(argv, "--max-outer-turns", p.budget.maxOuterTurns);
|
|
1156
1188
|
pushValue(argv, "--goal-max-tokens", p.budget.goalMaxTokens);
|
|
@@ -300,7 +300,23 @@ export class CodexAppServerAdapter extends EventEmitter {
|
|
|
300
300
|
terminalResolve(projected);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
|
+
// A shared transport failure applies to every unfinished turn. Preserve a
|
|
304
|
+
// terminal already observed, and never start a duplicate execution path.
|
|
305
|
+
const onTransportFailure = (error) => {
|
|
306
|
+
if (observedTerminal || eventFailure) return;
|
|
307
|
+
eventFailure =
|
|
308
|
+
error instanceof Error
|
|
309
|
+
? error
|
|
310
|
+
: adapterError(
|
|
311
|
+
"CC_CODEX_APP_SERVER_TRANSPORT_FAILED",
|
|
312
|
+
"Codex App Server transport failed",
|
|
313
|
+
);
|
|
314
|
+
deadlineReject(eventFailure);
|
|
315
|
+
};
|
|
303
316
|
this.client.on?.("notification", onNotification);
|
|
317
|
+
this.client.on?.("transportFailure", onTransportFailure);
|
|
318
|
+
if (this.client.transportFailure)
|
|
319
|
+
onTransportFailure(this.client.transportFailure);
|
|
304
320
|
const buildResult = (terminalEvent) =>
|
|
305
321
|
Object.freeze({
|
|
306
322
|
protocol: CODEX_APP_SERVER_PROTOCOL,
|
|
@@ -317,9 +333,11 @@ export class CodexAppServerAdapter extends EventEmitter {
|
|
|
317
333
|
authoritative: false,
|
|
318
334
|
});
|
|
319
335
|
try {
|
|
336
|
+
if (eventFailure) throw eventFailure;
|
|
320
337
|
if (!this.client.running && typeof this.client.start === "function") {
|
|
321
338
|
await withinDeadline(this.client.start());
|
|
322
339
|
}
|
|
340
|
+
if (eventFailure) throw eventFailure;
|
|
323
341
|
if (!activeThreadId) {
|
|
324
342
|
const started = await withinDeadline(
|
|
325
343
|
this.client.request("thread/start", {
|
|
@@ -328,6 +346,7 @@ export class CodexAppServerAdapter extends EventEmitter {
|
|
|
328
346
|
);
|
|
329
347
|
activeThreadId = started?.thread?.id;
|
|
330
348
|
}
|
|
349
|
+
if (eventFailure) throw eventFailure;
|
|
331
350
|
if (!activeThreadId) {
|
|
332
351
|
throw adapterError(
|
|
333
352
|
"CC_CODEX_APP_SERVER_PROTOCOL_FAILED",
|
|
@@ -412,6 +431,7 @@ export class CodexAppServerAdapter extends EventEmitter {
|
|
|
412
431
|
} finally {
|
|
413
432
|
clearTimeout(timer);
|
|
414
433
|
this.client.off?.("notification", onNotification);
|
|
434
|
+
this.client.off?.("transportFailure", onTransportFailure);
|
|
415
435
|
}
|
|
416
436
|
}
|
|
417
437
|
|
|
@@ -5,7 +5,7 @@ export const CODEX_APP_SERVER_FEATURE_FLAG = "CC_EXPERIMENTAL_CODEX_APP_SERVER";
|
|
|
5
5
|
export const CODEX_APP_SERVER_FALLBACK_PROTOCOL = "codex-exec-jsonl-v1";
|
|
6
6
|
|
|
7
7
|
export const CODEX_APP_SERVER_SUPPORT = Object.freeze({
|
|
8
|
-
revision: "2026-
|
|
8
|
+
revision: "2026-11-08",
|
|
9
9
|
defaultEnabled: false,
|
|
10
10
|
productionAdmitted: false,
|
|
11
11
|
platforms: Object.freeze([
|
|
@@ -22,7 +22,7 @@ export const CODEX_APP_SERVER_SUPPORT = Object.freeze({
|
|
|
22
22
|
schemaAndTurnProbeConfigured: false,
|
|
23
23
|
}),
|
|
24
24
|
),
|
|
25
|
-
...["0.160.0", "0.164.0"].map((version) =>
|
|
25
|
+
...["0.160.0", "0.164.0", "0.167.0"].map((version) =>
|
|
26
26
|
Object.freeze({
|
|
27
27
|
version,
|
|
28
28
|
experimentalAllowed: false,
|