chainlesschain 0.166.101 → 0.166.102
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/package.json +2 -2
- 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/assets/{AIOps-BjBS_29I.js → AIOps-CyHIMEd8.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-CUnnQUaj.js → ActionButton-vuNxDpHm.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BqYZxgnY.js → Analytics-D0quEM0q.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-m8B886ka.js → AppLayout-xRSVpbCs.js} +3 -3
- package/src/assets/web-panel/assets/{Artifacts-JEOxU3Ug.js → Artifacts-ktfVAZBC.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DAXS5c9J.js → Audit-UJW6maH4.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-e3a9XHw3.js → BackgroundAgents-BYrfdCoT.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-D3Qmp68h.js → Backup-IBgsJ7BK.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-C7CXyiUl.js → BaseInput-BmP8_zxy.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-2AHlAGi8.js → Chat-urkw8_BF.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-D3KsyCUV.js → ChatBubbleRenderer-Cw44zZbh.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-YfBuQlBH.js → Checkbox-CYboo-__.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-DCCQDfTL.js → Codegen-DaqR_Ay8.js} +1 -1
- package/src/assets/web-panel/assets/{Col-03i2WfrV.js → Col-04BSIj_z.js} +1 -1
- package/src/assets/web-panel/assets/{Community-CJQIpng6.js → Community-DxFk7Trv.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-CCtcQ2pq.js → Compact-mjgWlMCB.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-Vxl7ZszJ.js → Compliance-CC5ee7QV.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-DN-BwA8I.js → Cowork-BK4BhHZd.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-Dc2Q46X7.js → Cron-CP6jAxq0.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-CQCblsl-.js → Crosschain-DJPaViZS.js} +1 -1
- package/src/assets/web-panel/assets/{DID-YYvqUR8C.js → DID-BTLxkuOj.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-Cafy3DZT.js → Dashboard-Djkiqh3d.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BOyYpIpv.js → Dropdown-t_eUhqom.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-B7NYjc1j.js → EmailListRenderer-7w6USx_J.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-C5wfxztf.js → EvolutionSettings-mU5IHEk5.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-aA7KnDGK.js → FamilyGuardDashboard-BCh-VBBC.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DlgXUu1L.js → Federation-Be_VpjI2.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-B5YsrLDg.js → FormItemContext-D_lzQ7PI.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DaWojPFw.js → GenericCardRenderer-LYu3KapV.js} +1 -1
- package/src/assets/web-panel/assets/{Git-dkhh6Fx2.js → Git-BBeF-PP4.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-Cz6vmkjc.js → Governance-CoF8Kzg7.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-DWt0hbh8.js → Inference-C4DLMnXS.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BZJ0Z-nL.js → KnowledgeGraph-B2mlNewk.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-BaBBmL1A.js → Logs-DMZ_44Ya.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-Ck7Iv_9e.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-ct8sgQ0s.js → Marketplace-BqDzTew_.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-CXKCRGYQ.js → McpTools-BbwSbDN9.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-O7ZwlS6a.js → Memory-DAaTWgrm.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-By12C-eC.js → MobileBridge-BjbTGxoR.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-Ba-EVdex.js → MobileProjects-DMODOBr-.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-g-932zV2.js → Mtc-DT9N2rCs.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-BW8hB0ly.js → MtcAudit-DagMfUVv.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-zspLaMbT.js → Multisig-C1BKP6nM.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-dJeUPDoq.js → NLProgramming-B5LFh72i.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-C4msiRQL.js → Notes-Q77V3ltW.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-MOCHM-qg.js → NotificationSettings-HxdpNIBs.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-Dc0DpvBH.js +1 -0
- package/src/assets/web-panel/assets/{Organization-DOZurBfk.js → Organization-QL3NZ7uW.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-qOT9BhUp.js → Overflow-B_gqOKho.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-BMoy7Eo4.js → P2P-BBJubU8Z.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-ByyV1q-D.js → PdhVaultBrowser-CFnGd-2E.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-6Qyro4ye.js → Permissions-BKkznIUM.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-DR3DRNSX.js → PersonalDataHub-DYK7ZAcd.js} +4 -4
- package/src/assets/web-panel/assets/{Pipeline-Cr6TTdud.js → Pipeline-CoeKpjoN.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-B70otG0l.js → Privacy-Diw4G-92.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-BHCqxoSk.js → ProjectInit-CHBOFkma.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-B80GZpZk.js → ProjectSettings-BJIsgdOf.js} +2 -2
- package/src/assets/web-panel/assets/Projects-GJjItXIk.js +1 -0
- package/src/assets/web-panel/assets/{Providers-dsVTimHa.js → Providers-o8QCimor.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-DRJ8YepZ.js → QrScannerModal-z2W-zvhW.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-BSXdEjIB.js → QuickAsk-_yubhsna.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CQLJGyKC.js → Recommend-CucgJwih.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-BF9WUFVZ.js → RemoteSession-EzfIIRg1.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-Cy9o5tvW.js → Reputation-_shttE67.js} +1 -1
- package/src/assets/web-panel/assets/{Row-BP346_3b.js → Row-DQA_S8-9.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BKulxXf3.js → RssFeed-BOqWawXT.js} +3 -3
- package/src/assets/web-panel/assets/{Search-EemQj2Dv.js → Search-Dx1v2xOq.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DcWPAwwk.js → Security-Bt4HHsT4.js} +3 -3
- package/src/assets/web-panel/assets/{Services-Bltqciay.js → Services-sruHiQ-r.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-BwRyOGY8.js → Skeleton-CiBxvmOJ.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-D98qlvpJ.js → Skills-De9qKODU.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-BUTtBMY0.js → Sla-B_6yn8Wp.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-C7kcY_98.js → SpeechSettings-C2CafExS.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-Bsk6lKvT.js → SyncSettings-Dhh3Qmb0.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-DvSrtz0P.js → Tasks-Mvo5mTWm.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-BUM6LwPs.js → Templates-D7WVTQQy.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-D9TkOm7z.js → Tenant-7ur9Yfxd.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-CP8ZVErN.js → Terminal-BgzrOA6k.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-V3SoKZ1T.js → TimelineRenderer-Dco20pT1.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-CCRlUTOA.js → Tokens-hN6qBPag.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-CznUcPme.js → Trigger-C4f_twAM.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-D1GIk_NF.js → Trust-Wf1SMypp.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-DHtvtyC-.js → UkeySign-DUXSyg3N.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CVxdaJIq.js → VideoEditing-BvqsJaL0.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-D221OjyE.js → Wallet-CgAbcjKl.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-Cw0-ESsq.js → WebAuthn-DaLT0W3s.js} +2 -2
- package/src/assets/web-panel/assets/{WorkflowEditor-ZYScrBx3.js → WorkflowEditor-CQqAXoaS.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BU0e1obR.js → chat-BhlohFTB.js} +1 -1
- package/src/assets/web-panel/assets/{colors-gzYweuha.js → colors-D7HqXIL8.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-ChAXal_k.js → compact-item-Bqk4FCLY.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-of3FolD7.js → createContext-CEmWrWf0.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-YPX_TU7w.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-4PsK_Kx8.js → hasIn-CDY0pFi2.js} +1 -1
- package/src/assets/web-panel/assets/{index-1dzYRBbg.js → index-1HBam9t1.js} +1 -1
- package/src/assets/web-panel/assets/{index-CHv_63Cp.js → index-6f6n0KFR.js} +1 -1
- package/src/assets/web-panel/assets/{index-DjRAIRX7.js → index-B8L3_-sG.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cn1clrxx.js → index-BHGOdvOQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-cFkMIx1x.js → index-BNrvBWDS.js} +1 -1
- package/src/assets/web-panel/assets/{index-BfI4dXbi.js → index-BPmRkxeX.js} +1 -1
- package/src/assets/web-panel/assets/{index-CO2owKe0.js → index-BXRooi-O.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEzjUgkl.js → index-BiLu-ImR.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZ0oKtBg.js → index-BuKGuH_y.js} +1 -1
- package/src/assets/web-panel/assets/{index-D1PGrfHE.js → index-BxXFRLTZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-B5L7zddz.js → index-BxYO6nde.js} +1 -1
- package/src/assets/web-panel/assets/{index-CyDQNprx.js → index-C02yDu4f.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ef5YkVAn.js → index-C3opQg47.js} +1 -1
- package/src/assets/web-panel/assets/{index-CGFL59q4.js → index-C9mvnSii.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_5LTPMH.js → index-CVrwozwH.js} +1 -1
- package/src/assets/web-panel/assets/{index-DJVrzXtk.js → index-CYcjOnDX.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bftq5rJR.js → index-Cf1ha8l0.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEXBckNR.js → index-Chxt0t-A.js} +1 -1
- package/src/assets/web-panel/assets/{index-By-pper5.js → index-CkjgSHVz.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dy0ojH6G.js → index-CkqBoCiu.js} +3 -3
- package/src/assets/web-panel/assets/{index-Cx4Z6nUl.js → index-CqK0J4Sj.js} +1 -1
- package/src/assets/web-panel/assets/{index-Djfgsjfy.js → index-CrsM-oiD.js} +1 -1
- package/src/assets/web-panel/assets/{index-BdxRVNPY.js → index-Cur88hoN.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_9k680X.js → index-D0nfNmbq.js} +1 -1
- package/src/assets/web-panel/assets/index-D53szVZQ.js +1 -0
- package/src/assets/web-panel/assets/{index-DsoV9rzn.js → index-DEzL7s7P.js} +1 -1
- package/src/assets/web-panel/assets/{index-wo0De0iG.js → index-DGKRAO61.js} +1 -1
- package/src/assets/web-panel/assets/{index-E8oDMSAo.js → index-DPBoWNwq.js} +1 -1
- package/src/assets/web-panel/assets/{index-CCLsbul3.js → index-DRcDWMwP.js} +1 -1
- package/src/assets/web-panel/assets/{index-BOeX7BzS.js → index-DmKdCWq1.js} +1 -1
- package/src/assets/web-panel/assets/{index-CxzBcXOa.js → index-DpI1LqJX.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEB5fQqG.js → index-DuMt3ewl.js} +1 -1
- package/src/assets/web-panel/assets/{index-CeEE_SGZ.js → index-Dwob5XoD.js} +1 -1
- package/src/assets/web-panel/assets/index-Ub2nJbV2.js +1 -0
- package/src/assets/web-panel/assets/{index-Wr91cnWr.js → index-XErJQ1yF.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_ialOHx.js → index-aBHlgMrq.js} +1 -1
- package/src/assets/web-panel/assets/{index-D-Zss5KL.js → index-e9oCy7_4.js} +1 -1
- package/src/assets/web-panel/assets/{index-DDYj14Q4.js → index-lBAbMOzg.js} +1 -1
- package/src/assets/web-panel/assets/{index-yMf7zmWv.js → index-o_lc3eww.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-D0Bx6pgr.js → initDefaultProps-CIeEUxIN.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BnLuJqJ5.js → motion-IPIj1ZtP.js} +1 -1
- package/src/assets/web-panel/assets/{move-Bxpq9xgR.js → move-BfSeXZ-f.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-BdmrNhOs.js → mtc-parser-DX03-Xp4.js} +1 -1
- package/src/assets/web-panel/assets/{omit-tjJD34BZ.js → omit-z9EannfX.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-CMFzLt7b.js → pickAttrs-DXKmRkqZ.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-BZf6O3cd.js → placementArrow-k2HV7cIU.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DFDLazsV.js → responsiveObserve-bX7CsyWy.js} +1 -1
- package/src/assets/web-panel/assets/{slide-CMbTvp4Y.js → slide-NskjQLbJ.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-FOan8MI7.js → statusUtils-B3IoG-Er.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-DTABspd4.js → styleChecker-DHv_UilX.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-CNHXWBpY.js → useFlexGapSupport-DEqGB5Ng.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-5K-c_RoL.js → useFs-Bl9CbrqZ.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-Di0hL4G-.js → usePersonalDataHub-O-Ukv93M.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-DTyDv4ja.js → vnode-hGCHTaZt.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-ontRt8ft.js → zoom-BWhIVeKQ.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 +64 -40
- package/src/data/changelog.json +13 -0
- package/src/lib/config-schema.js +18 -5
- package/src/lib/context-memory-kernel/memory-query-index.js +5 -2
- package/src/lib/context-memory-kernel/runtime.js +4 -0
- package/src/lib/context-memory-kernel/segmented-memory-port.js +28 -3
- package/src/lib/context-source-ledger.js +52 -9
- package/src/lib/goal-condition-engine.js +25 -2
- package/src/lib/llm-config-defaults.js +10 -4
- package/src/lib/llm-pricing.js +16 -4
- package/src/lib/model-capabilities.js +26 -0
- package/src/lib/model-catalog-review.js +18 -1
- package/src/lib/model-context-catalog.js +41 -1
- package/src/lib/openai-responses.js +8 -0
- package/src/lib/skill-retrieval-router.js +1 -0
- package/src/lib/usage-pricing-context.js +33 -2
- package/src/repl/agent-repl.js +247 -153
- package/src/runtime/agent-core.js +198 -87
- package/src/runtime/coding-agent-contract-shared.cjs +14 -1
- package/src/runtime/headless-runner.js +1 -0
- package/src/runtime/headless-stream.js +1 -0
- package/src/runtime/mcp-tool-search.js +0 -0
- package/src/runtime/provider-stream-state.js +14 -1
- package/src/assets/web-panel/assets/MarkdownRenderer-C1yByobo.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-CX0T66NM.js +0 -1
- package/src/assets/web-panel/assets/Projects-cq-b9-fQ.js +0 -1
- package/src/assets/web-panel/assets/devWarning-Pa13TVrO.js +0 -1
- package/src/assets/web-panel/assets/index-BhQg-v6V.js +0 -1
- package/src/assets/web-panel/assets/index-DUD5o-vW.js +0 -1
|
@@ -61,7 +61,11 @@ import {
|
|
|
61
61
|
} from "../lib/task-progress-tracker.js";
|
|
62
62
|
import { TOOL_RECOVERY_PAUSED_CODE } from "../lib/tool-recovery-result.js";
|
|
63
63
|
import { haiku55ThinkingParams } from "../lib/provider-options.js";
|
|
64
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
projectUsagePricingContext,
|
|
66
|
+
projectEnvelopePricingContext,
|
|
67
|
+
preserveRequestedServiceTierEvidence,
|
|
68
|
+
} from "../lib/usage-pricing-context.js";
|
|
65
69
|
import broker from "../lib/process-execution-broker/index.js";
|
|
66
70
|
import os from "os";
|
|
67
71
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -88,6 +92,7 @@ import sharedHookEvents from "../lib/settings-hook-events.js";
|
|
|
88
92
|
import {
|
|
89
93
|
resolveAgentOutputBudget,
|
|
90
94
|
resolveModelCapabilityProfile,
|
|
95
|
+
resolveModelServiceTier,
|
|
91
96
|
} from "../lib/model-capabilities.js";
|
|
92
97
|
import {
|
|
93
98
|
createOpenAIResponsesBody,
|
|
@@ -1539,18 +1544,19 @@ function filesystemIdentity(stats) {
|
|
|
1539
1544
|
function sameFilesystemObjectIdentity(left, right) {
|
|
1540
1545
|
return Boolean(
|
|
1541
1546
|
left &&
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1547
|
+
right &&
|
|
1548
|
+
left.dev === right.dev &&
|
|
1549
|
+
left.ino === right.ino &&
|
|
1550
|
+
left.type === right.type,
|
|
1546
1551
|
);
|
|
1547
1552
|
}
|
|
1548
1553
|
|
|
1549
1554
|
function sameFilesystemIdentity(left, right, { content = false } = {}) {
|
|
1550
1555
|
return Boolean(
|
|
1551
1556
|
sameFilesystemObjectIdentity(left, right) &&
|
|
1552
|
-
|
|
1553
|
-
|
|
1557
|
+
left.nlink === right.nlink &&
|
|
1558
|
+
(!content ||
|
|
1559
|
+
(left.size === right.size && left.mtimeNs === right.mtimeNs)),
|
|
1554
1560
|
);
|
|
1555
1561
|
}
|
|
1556
1562
|
|
|
@@ -3441,8 +3447,9 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3441
3447
|
GUARDED_FILE_MUTATION_TOOLS.has(name) &&
|
|
3442
3448
|
settingsVerdict.decision !== "allow"
|
|
3443
3449
|
) {
|
|
3444
|
-
const { sensitiveFileReason, autoExecConfigReason } =
|
|
3445
|
-
|
|
3450
|
+
const { sensitiveFileReason, autoExecConfigReason } = await import(
|
|
3451
|
+
"../lib/sensitive-file-guard.js"
|
|
3452
|
+
);
|
|
3446
3453
|
const guarded = fileMutationPaths(name, args)
|
|
3447
3454
|
.map((candidatePath) => ({
|
|
3448
3455
|
path: candidatePath,
|
|
@@ -3477,8 +3484,9 @@ export async function executeTool(name, args, context = {}) {
|
|
|
3477
3484
|
GUARDED_FILE_MUTATION_TOOLS.has(name) &&
|
|
3478
3485
|
settingsVerdict.decision !== "allow"
|
|
3479
3486
|
) {
|
|
3480
|
-
const { sessionStorePathReason } =
|
|
3481
|
-
|
|
3487
|
+
const { sessionStorePathReason } = await import(
|
|
3488
|
+
"../lib/session-store-guard.js"
|
|
3489
|
+
);
|
|
3482
3490
|
const guarded = fileMutationPaths(name, args)
|
|
3483
3491
|
.map((candidatePath) => ({
|
|
3484
3492
|
path: candidatePath,
|
|
@@ -4223,8 +4231,9 @@ export async function executeTool(name, args, context = {}) {
|
|
|
4223
4231
|
context.externalToolExecutors
|
|
4224
4232
|
) {
|
|
4225
4233
|
try {
|
|
4226
|
-
const { collectIdeDiagnostics, formatIdeDiagnostics } =
|
|
4227
|
-
|
|
4234
|
+
const { collectIdeDiagnostics, formatIdeDiagnostics } = await import(
|
|
4235
|
+
"../lib/ide-context.js"
|
|
4236
|
+
);
|
|
4228
4237
|
const diags = await collectIdeDiagnostics(
|
|
4229
4238
|
{
|
|
4230
4239
|
mcpClient: context.mcpHostClient || context.mcpClient,
|
|
@@ -4766,8 +4775,9 @@ export async function _getSharedCodeIntel(cwd) {
|
|
|
4766
4775
|
const root = path.resolve(cwd || process.cwd());
|
|
4767
4776
|
let entry = _codeIntelPool.get(root);
|
|
4768
4777
|
if (!entry) {
|
|
4769
|
-
const { CodeIntelligence } =
|
|
4770
|
-
|
|
4778
|
+
const { CodeIntelligence } = await import(
|
|
4779
|
+
"../lib/lsp/code-intelligence.js"
|
|
4780
|
+
);
|
|
4771
4781
|
// Re-check AFTER the await: two concurrent callers (the parallel read-only
|
|
4772
4782
|
// batch runs several `code_intelligence` calls at once) both observed an
|
|
4773
4783
|
// empty pool before this `await import`, so without this guard both would
|
|
@@ -4856,8 +4866,9 @@ async function _postEditDiagnostics(filePath, cwd, additionalDirectories) {
|
|
|
4856
4866
|
}
|
|
4857
4867
|
let hasServer = false;
|
|
4858
4868
|
try {
|
|
4859
|
-
const { languageIdForFile, resolveServer } =
|
|
4860
|
-
|
|
4869
|
+
const { languageIdForFile, resolveServer } = await import(
|
|
4870
|
+
"../lib/lsp/lsp-server-registry.js"
|
|
4871
|
+
);
|
|
4861
4872
|
const languageId = languageIdForFile(filePath);
|
|
4862
4873
|
if (!languageId) return null; // unsupported file type — no LSP, no cost
|
|
4863
4874
|
hasServer = Boolean(resolveServer(languageId, root));
|
|
@@ -4880,8 +4891,9 @@ async function _postEditDiagnostics(filePath, cwd, additionalDirectories) {
|
|
|
4880
4891
|
// the model sees the most severe diagnostics first and can't be flooded by
|
|
4881
4892
|
// a pathological diagnostics dump. Budget is overridable via
|
|
4882
4893
|
// CC_EDIT_DIAGNOSTICS_TOKENS (default 2000).
|
|
4883
|
-
const { capDiagnostics } =
|
|
4884
|
-
|
|
4894
|
+
const { capDiagnostics } = await import(
|
|
4895
|
+
"../lib/lsp/diagnostics-scheduler.js"
|
|
4896
|
+
);
|
|
4885
4897
|
const budget = Number(process.env.CC_EDIT_DIAGNOSTICS_TOKENS) || 2000;
|
|
4886
4898
|
const { kept } = capDiagnostics(diags, { maxTokens: budget });
|
|
4887
4899
|
return kept.length ? kept : null;
|
|
@@ -4945,12 +4957,14 @@ async function _getSubtreeLoader(cwd, sessionScope = "__legacy__") {
|
|
|
4945
4957
|
}
|
|
4946
4958
|
let loader = scopedLoaders.get(sessionScope);
|
|
4947
4959
|
if (!loader) {
|
|
4948
|
-
const { SubtreeInstructionLoader } =
|
|
4949
|
-
|
|
4960
|
+
const { SubtreeInstructionLoader } = await import(
|
|
4961
|
+
"../lib/project-instructions.js"
|
|
4962
|
+
);
|
|
4950
4963
|
let instructionExcludes;
|
|
4951
4964
|
try {
|
|
4952
|
-
const { readStringArraySetting } =
|
|
4953
|
-
|
|
4965
|
+
const { readStringArraySetting } = await import(
|
|
4966
|
+
"../lib/settings-loader.cjs"
|
|
4967
|
+
);
|
|
4954
4968
|
instructionExcludes = readStringArraySetting("instructionExcludes", {
|
|
4955
4969
|
cwd: root,
|
|
4956
4970
|
});
|
|
@@ -4995,8 +5009,9 @@ async function _prepareSubtreeInstructions(
|
|
|
4995
5009
|
}
|
|
4996
5010
|
const fresh = [...discovered.values()];
|
|
4997
5011
|
if (!fresh || !fresh.length) return null;
|
|
4998
|
-
const { DEFAULT_MAX_FILE_BYTES } =
|
|
4999
|
-
|
|
5012
|
+
const { DEFAULT_MAX_FILE_BYTES } = await import(
|
|
5013
|
+
"../lib/project-instructions.js"
|
|
5014
|
+
);
|
|
5000
5015
|
const out = [];
|
|
5001
5016
|
const errors = [];
|
|
5002
5017
|
for (const f of fresh) {
|
|
@@ -5103,8 +5118,9 @@ async function _withSubtreeInstructions(
|
|
|
5103
5118
|
async function filterSkillsByCwd(skills, cwd) {
|
|
5104
5119
|
try {
|
|
5105
5120
|
if (!Array.isArray(skills) || skills.every((s) => !s?.paths)) return skills;
|
|
5106
|
-
const { filterSkillsByRelCwd, relCwdForCwd } =
|
|
5107
|
-
|
|
5121
|
+
const { filterSkillsByRelCwd, relCwdForCwd } = await import(
|
|
5122
|
+
"../lib/skill-path-scope.js"
|
|
5123
|
+
);
|
|
5108
5124
|
const { findProjectRoot } = await import("../lib/project-detector.js");
|
|
5109
5125
|
const root = (cwd && findProjectRoot(cwd)) || cwd || "";
|
|
5110
5126
|
return filterSkillsByRelCwd(skills, relCwdForCwd(cwd, root));
|
|
@@ -5119,8 +5135,9 @@ async function promoteBrowserGeneratedArtifact(
|
|
|
5119
5135
|
) {
|
|
5120
5136
|
if (!filePath) return { artifact: null, error: null };
|
|
5121
5137
|
try {
|
|
5122
|
-
const { ArtifactStore, publicArtifactMetadata } =
|
|
5123
|
-
|
|
5138
|
+
const { ArtifactStore, publicArtifactMetadata } = await import(
|
|
5139
|
+
"../lib/artifact-store.js"
|
|
5140
|
+
);
|
|
5124
5141
|
const entry = new ArtifactStore().publish({
|
|
5125
5142
|
filePath,
|
|
5126
5143
|
title,
|
|
@@ -5173,8 +5190,9 @@ async function promoteBrowserDownload(
|
|
|
5173
5190
|
async function publishBrowserEvidence(envelope, sessionId) {
|
|
5174
5191
|
if (!envelope?.envelopeDigest) return { artifact: null, error: null };
|
|
5175
5192
|
try {
|
|
5176
|
-
const { ArtifactStore, publicArtifactMetadata } =
|
|
5177
|
-
|
|
5193
|
+
const { ArtifactStore, publicArtifactMetadata } = await import(
|
|
5194
|
+
"../lib/artifact-store.js"
|
|
5195
|
+
);
|
|
5178
5196
|
const {
|
|
5179
5197
|
browserEvidenceDigest,
|
|
5180
5198
|
canonicalBrowserEvidenceJson,
|
|
@@ -5237,8 +5255,9 @@ async function publishBrowserEvidence(envelope, sessionId) {
|
|
|
5237
5255
|
}
|
|
5238
5256
|
|
|
5239
5257
|
async function resolveBrowserUploadArtifact(artifactId, sessionId) {
|
|
5240
|
-
const { ArtifactStore, publicArtifactMetadata } =
|
|
5241
|
-
|
|
5258
|
+
const { ArtifactStore, publicArtifactMetadata } = await import(
|
|
5259
|
+
"../lib/artifact-store.js"
|
|
5260
|
+
);
|
|
5242
5261
|
const store = new ArtifactStore();
|
|
5243
5262
|
return store.withIndexSnapshot((entries) => {
|
|
5244
5263
|
const matches = entries.filter((entry) => entry.id === artifactId);
|
|
@@ -6219,8 +6238,9 @@ async function executeToolInner(
|
|
|
6219
6238
|
// through PowerShell via explicit argv (`powershell.exe -NoProfile
|
|
6220
6239
|
// [-ExecutionPolicy <p>] -Command <cmd>`). The unconfigured path keeps
|
|
6221
6240
|
// the historical default shell byte-identical (useDefaultShell=true).
|
|
6222
|
-
const { resolveShellInvocation } =
|
|
6223
|
-
|
|
6241
|
+
const { resolveShellInvocation } = await import(
|
|
6242
|
+
"../lib/shell-selector.cjs"
|
|
6243
|
+
);
|
|
6224
6244
|
let shellInv = resolveShellInvocation({
|
|
6225
6245
|
command: args.command,
|
|
6226
6246
|
requested: args.shell,
|
|
@@ -6993,8 +7013,9 @@ async function executeToolInner(
|
|
|
6993
7013
|
let removeSettingsAuthorityListener = null;
|
|
6994
7014
|
if (needsEgress) {
|
|
6995
7015
|
try {
|
|
6996
|
-
const { startEgressProxyWorker } =
|
|
6997
|
-
|
|
7016
|
+
const { startEgressProxyWorker } = await import(
|
|
7017
|
+
"../lib/sandbox-egress-worker.js"
|
|
7018
|
+
);
|
|
6998
7019
|
if (dockerEgress) {
|
|
6999
7020
|
privateSocketDir = fs.mkdtempSync(
|
|
7000
7021
|
path.join(os.tmpdir(), "cc-egress-"),
|
|
@@ -7035,8 +7056,9 @@ async function executeToolInner(
|
|
|
7035
7056
|
// Proxy startup and dynamic imports are asynchronous. Re-read the
|
|
7036
7057
|
// live authority after they settle and before sandbox dispatch.
|
|
7037
7058
|
if (dockerEgress && proxyHandle?.socketPath) {
|
|
7038
|
-
const { createDockerEgressAuthorityMonitor } =
|
|
7039
|
-
|
|
7059
|
+
const { createDockerEgressAuthorityMonitor } = await import(
|
|
7060
|
+
"../lib/sandbox-egress-authority-monitor.js"
|
|
7061
|
+
);
|
|
7040
7062
|
authorityMonitor = createDockerEgressAuthorityMonitor({
|
|
7041
7063
|
sessionId: sessionId || null,
|
|
7042
7064
|
policyVersion:
|
|
@@ -7656,8 +7678,9 @@ async function executeToolInner(
|
|
|
7656
7678
|
!ruleAllowed &&
|
|
7657
7679
|
typeof approvalGate.decide === "function"
|
|
7658
7680
|
) {
|
|
7659
|
-
const { APPROVAL_RISK, APPROVAL_DECISION } =
|
|
7660
|
-
|
|
7681
|
+
const { APPROVAL_RISK, APPROVAL_DECISION } = await import(
|
|
7682
|
+
"@chainlesschain/session-core"
|
|
7683
|
+
);
|
|
7661
7684
|
const gate = await approvalGate.decide({
|
|
7662
7685
|
sessionId,
|
|
7663
7686
|
riskLevel: APPROVAL_RISK.HIGH,
|
|
@@ -7868,8 +7891,9 @@ async function executeToolInner(
|
|
|
7868
7891
|
|
|
7869
7892
|
case "slash_command": {
|
|
7870
7893
|
try {
|
|
7871
|
-
const { getCommand, expandCommand, discoverCommands } =
|
|
7872
|
-
|
|
7894
|
+
const { getCommand, expandCommand, discoverCommands } = await import(
|
|
7895
|
+
"../lib/slash-commands.js"
|
|
7896
|
+
);
|
|
7873
7897
|
const raw = String(args.command || "").trim();
|
|
7874
7898
|
if (!raw) {
|
|
7875
7899
|
return attachDescriptor({
|
|
@@ -8080,8 +8104,9 @@ async function executeToolInner(
|
|
|
8080
8104
|
|
|
8081
8105
|
case "notify": {
|
|
8082
8106
|
try {
|
|
8083
|
-
const { sendAgentNotification } =
|
|
8084
|
-
|
|
8107
|
+
const { sendAgentNotification } = await import(
|
|
8108
|
+
"../lib/agent-notify.js"
|
|
8109
|
+
);
|
|
8085
8110
|
const outcome = await sendAgentNotification({
|
|
8086
8111
|
title: args.title,
|
|
8087
8112
|
body: args.body,
|
|
@@ -8095,8 +8120,9 @@ async function executeToolInner(
|
|
|
8095
8120
|
|
|
8096
8121
|
case "schedule": {
|
|
8097
8122
|
try {
|
|
8098
|
-
const { AgentScheduleStore } =
|
|
8099
|
-
|
|
8123
|
+
const { AgentScheduleStore } = await import(
|
|
8124
|
+
"../lib/agent-schedule-store.js"
|
|
8125
|
+
);
|
|
8100
8126
|
const { parseDuration } = await import("../lib/loop.js");
|
|
8101
8127
|
const store = new AgentScheduleStore();
|
|
8102
8128
|
const action = String(args.action || "").toLowerCase();
|
|
@@ -8219,8 +8245,9 @@ async function executeToolInner(
|
|
|
8219
8245
|
// Only METADATA returns to the conversation (the transcript never
|
|
8220
8246
|
// carries the file body); `cc artifacts` lists/inspects/cleans.
|
|
8221
8247
|
try {
|
|
8222
|
-
const { ArtifactStore, publicArtifactMetadata } =
|
|
8223
|
-
|
|
8248
|
+
const { ArtifactStore, publicArtifactMetadata } = await import(
|
|
8249
|
+
"../lib/artifact-store.js"
|
|
8250
|
+
);
|
|
8224
8251
|
const store = new ArtifactStore();
|
|
8225
8252
|
const entry = store.publish({
|
|
8226
8253
|
filePath: path.resolve(cwd, String(args.path || "")),
|
|
@@ -8310,8 +8337,9 @@ async function executeToolInner(
|
|
|
8310
8337
|
!ruleAllowed &&
|
|
8311
8338
|
typeof approvalGate.decide === "function"
|
|
8312
8339
|
) {
|
|
8313
|
-
const { APPROVAL_RISK, APPROVAL_DECISION } =
|
|
8314
|
-
|
|
8340
|
+
const { APPROVAL_RISK, APPROVAL_DECISION } = await import(
|
|
8341
|
+
"@chainlesschain/session-core"
|
|
8342
|
+
);
|
|
8315
8343
|
const summary = Array.isArray(args.actions)
|
|
8316
8344
|
? args.actions
|
|
8317
8345
|
.map((a) => a?.type)
|
|
@@ -8436,8 +8464,9 @@ async function executeToolInner(
|
|
|
8436
8464
|
case "search_files": {
|
|
8437
8465
|
if (typeof args.path === "string" && args.path.length > 0) {
|
|
8438
8466
|
const file = path.resolve(cwd, args.path);
|
|
8439
|
-
const { credentialFileReason } =
|
|
8440
|
-
|
|
8467
|
+
const { credentialFileReason } = await import(
|
|
8468
|
+
"../lib/credential-guard.js"
|
|
8469
|
+
);
|
|
8441
8470
|
const reason =
|
|
8442
8471
|
credentialFileReason(file) ||
|
|
8443
8472
|
(fs.existsSync(file)
|
|
@@ -9182,6 +9211,22 @@ async function executeToolInner(
|
|
|
9182
9211
|
}
|
|
9183
9212
|
|
|
9184
9213
|
case "list_skills": {
|
|
9214
|
+
const limit = args.limit ?? 20;
|
|
9215
|
+
const offset = args.offset ?? 0;
|
|
9216
|
+
if (
|
|
9217
|
+
!Number.isSafeInteger(limit) ||
|
|
9218
|
+
limit < 1 ||
|
|
9219
|
+
limit > 64 ||
|
|
9220
|
+
!Number.isSafeInteger(offset) ||
|
|
9221
|
+
offset < 0 ||
|
|
9222
|
+
offset > 10_000
|
|
9223
|
+
) {
|
|
9224
|
+
return attachDescriptor({
|
|
9225
|
+
error:
|
|
9226
|
+
"Skill directory limit must be 1–64 and offset must be 0–10000.",
|
|
9227
|
+
code: "CC_SKILL_DIRECTORY_PAGE_INVALID",
|
|
9228
|
+
});
|
|
9229
|
+
}
|
|
9185
9230
|
let skills = await filterSkillsByCwd(
|
|
9186
9231
|
skillLoader.getResolvedSkills().filter(skillAllowed),
|
|
9187
9232
|
cwd,
|
|
@@ -9271,6 +9316,19 @@ async function executeToolInner(
|
|
|
9271
9316
|
}
|
|
9272
9317
|
}
|
|
9273
9318
|
}
|
|
9319
|
+
if (!routing) {
|
|
9320
|
+
const key = (skill) =>
|
|
9321
|
+
`${skill.id}\u0000${skill.source || ""}\u0000${skill.executionIdentity?.contentDigest || ""}`;
|
|
9322
|
+
skills = [...skills].sort((left, right) =>
|
|
9323
|
+
key(left) < key(right) ? -1 : key(left) > key(right) ? 1 : 0,
|
|
9324
|
+
);
|
|
9325
|
+
}
|
|
9326
|
+
const totalCount = routing?.matchedCount ?? skills.length;
|
|
9327
|
+
const candidateCount = skills.length;
|
|
9328
|
+
skills = skills.slice(offset, offset + limit);
|
|
9329
|
+
const nextOffset =
|
|
9330
|
+
offset + skills.length < candidateCount ? offset + skills.length : null;
|
|
9331
|
+
const hasMore = offset + skills.length < totalCount;
|
|
9274
9332
|
skillLoader.recordDescriptorUse?.(skills, {
|
|
9275
9333
|
sessionId,
|
|
9276
9334
|
turnId,
|
|
@@ -9278,6 +9336,19 @@ async function executeToolInner(
|
|
|
9278
9336
|
});
|
|
9279
9337
|
return attachDescriptor({
|
|
9280
9338
|
count: skills.length,
|
|
9339
|
+
totalCount,
|
|
9340
|
+
offset,
|
|
9341
|
+
limit,
|
|
9342
|
+
hasMore,
|
|
9343
|
+
nextOffset,
|
|
9344
|
+
...(hasMore
|
|
9345
|
+
? {
|
|
9346
|
+
hint:
|
|
9347
|
+
nextOffset == null
|
|
9348
|
+
? "Refine query or category to search beyond the top 64 matches."
|
|
9349
|
+
: "Use nextOffset for the next page, or query/category to narrow the directory.",
|
|
9350
|
+
}
|
|
9351
|
+
: {}),
|
|
9281
9352
|
...(routing
|
|
9282
9353
|
? {
|
|
9283
9354
|
routing: {
|
|
@@ -10701,8 +10772,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10701
10772
|
// the breadth counter increments so spawnedCount is this-spawn-exclusive.
|
|
10702
10773
|
if (ctx.subAgentContract) {
|
|
10703
10774
|
try {
|
|
10704
|
-
const { enforceRecursionLimits } =
|
|
10705
|
-
|
|
10775
|
+
const { enforceRecursionLimits } = await import(
|
|
10776
|
+
"../lib/subagent-contract.js"
|
|
10777
|
+
);
|
|
10706
10778
|
const recur = enforceRecursionLimits({
|
|
10707
10779
|
depth: currentDepth,
|
|
10708
10780
|
spawnedCount: ctx.subAgentBudget?.spawned || 0,
|
|
@@ -10888,8 +10960,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10888
10960
|
let inheritedMcp = null;
|
|
10889
10961
|
let inheritedHooks = null;
|
|
10890
10962
|
try {
|
|
10891
|
-
const { filterInheritedMcp, filterInheritedHooks } =
|
|
10892
|
-
|
|
10963
|
+
const { filterInheritedMcp, filterInheritedHooks } = await import(
|
|
10964
|
+
"../lib/subagent-inheritance.js"
|
|
10965
|
+
);
|
|
10893
10966
|
inheritedMcp = filterInheritedMcp(
|
|
10894
10967
|
{
|
|
10895
10968
|
extraToolDefinitions: ctx.extraToolDefinitions,
|
|
@@ -10922,8 +10995,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10922
10995
|
// repo, refuse the spawn instead of silently running in the parent checkout.
|
|
10923
10996
|
if (subIsolation === "worktree") {
|
|
10924
10997
|
try {
|
|
10925
|
-
const { resolveIsolationFailClosed } =
|
|
10926
|
-
|
|
10998
|
+
const { resolveIsolationFailClosed } = await import(
|
|
10999
|
+
"../lib/subagent-contract.js"
|
|
11000
|
+
);
|
|
10927
11001
|
const { isGitRepo } = await import("../lib/git-integration.js");
|
|
10928
11002
|
const iso = resolveIsolationFailClosed({
|
|
10929
11003
|
requested: "worktree",
|
|
@@ -10942,8 +11016,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
10942
11016
|
let profile = null;
|
|
10943
11017
|
if (profileName) {
|
|
10944
11018
|
try {
|
|
10945
|
-
const { getSubAgentProfile } =
|
|
10946
|
-
|
|
11019
|
+
const { getSubAgentProfile } = await import(
|
|
11020
|
+
"../lib/sub-agent-profiles.js"
|
|
11021
|
+
);
|
|
10947
11022
|
profile = getSubAgentProfile(profileName);
|
|
10948
11023
|
if (!profile) {
|
|
10949
11024
|
return {
|
|
@@ -11011,8 +11086,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
11011
11086
|
let childApprovalGate = null;
|
|
11012
11087
|
if (effectiveContract?.permissionMode) {
|
|
11013
11088
|
try {
|
|
11014
|
-
const { resolvePermissionMode, resolveEnabledTools } =
|
|
11015
|
-
|
|
11089
|
+
const { resolvePermissionMode, resolveEnabledTools } = await import(
|
|
11090
|
+
"./headless-runner.js"
|
|
11091
|
+
);
|
|
11016
11092
|
const perm = resolvePermissionMode(effectiveContract.permissionMode);
|
|
11017
11093
|
if (perm.readOnly) {
|
|
11018
11094
|
allowedTools = resolveEnabledTools({ allowedTools, readOnly: true });
|
|
@@ -11272,8 +11348,9 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
11272
11348
|
let subWorktreeOptions = null;
|
|
11273
11349
|
if (subIsolation === "worktree") {
|
|
11274
11350
|
try {
|
|
11275
|
-
const { normalizeSparsePaths } =
|
|
11276
|
-
|
|
11351
|
+
const { normalizeSparsePaths } = await import(
|
|
11352
|
+
"../lib/worktree-sparse.js"
|
|
11353
|
+
);
|
|
11277
11354
|
const sparse = normalizeSparsePaths(
|
|
11278
11355
|
args.sparsePaths ?? mdSparsePaths ?? null,
|
|
11279
11356
|
);
|
|
@@ -11475,10 +11552,11 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
11475
11552
|
|
|
11476
11553
|
// Resolve the registry ONCE before the try so the failure path can also move
|
|
11477
11554
|
// the sub-agent out of `_active` (the success path does this via complete()).
|
|
11478
|
-
const { SubAgentRegistry } =
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11555
|
+
const { SubAgentRegistry } = await import(
|
|
11556
|
+
"../lib/sub-agent-registry.js"
|
|
11557
|
+
).catch(() => ({
|
|
11558
|
+
SubAgentRegistry: null,
|
|
11559
|
+
}));
|
|
11482
11560
|
let registry = null;
|
|
11483
11561
|
if (SubAgentRegistry) {
|
|
11484
11562
|
try {
|
|
@@ -11798,6 +11876,12 @@ function _openAIProviderRequestReceipt(response, data, clientRequestId) {
|
|
|
11798
11876
|
* @returns {Promise<object>} response with .message
|
|
11799
11877
|
*/
|
|
11800
11878
|
export async function chatWithTools(rawMessages, options) {
|
|
11879
|
+
if (options.serviceTier != null) {
|
|
11880
|
+
resolveModelServiceTier(
|
|
11881
|
+
resolveModelCapabilityProfile(options),
|
|
11882
|
+
options.serviceTier,
|
|
11883
|
+
);
|
|
11884
|
+
}
|
|
11801
11885
|
const evolutionIngress =
|
|
11802
11886
|
options.evolutionIngress == null
|
|
11803
11887
|
? null
|
|
@@ -11827,8 +11911,9 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
11827
11911
|
options.contextMemoryPreplanned !== true &&
|
|
11828
11912
|
options.contextMemorySkipPlanning !== true
|
|
11829
11913
|
) {
|
|
11830
|
-
const { prepareCanonicalProviderContext } =
|
|
11831
|
-
|
|
11914
|
+
const { prepareCanonicalProviderContext } = await import(
|
|
11915
|
+
"../lib/context-memory-kernel/provider-context.js"
|
|
11916
|
+
);
|
|
11832
11917
|
const prepared = await prepareCanonicalProviderContext(rawMessages, {
|
|
11833
11918
|
...options,
|
|
11834
11919
|
contextMemoryToolDefinitions: tools,
|
|
@@ -12190,6 +12275,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12190
12275
|
reasoning: _openAIResponsesReasoningParams(options, modelProfile),
|
|
12191
12276
|
stream: typeof options.onToken === "function",
|
|
12192
12277
|
modelProfile,
|
|
12278
|
+
serviceTier: options.serviceTier,
|
|
12193
12279
|
});
|
|
12194
12280
|
if (typeof options.onToken === "function") {
|
|
12195
12281
|
return await _retryStreamingChat(
|
|
@@ -12243,6 +12329,11 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12243
12329
|
}
|
|
12244
12330
|
const data = await response.json();
|
|
12245
12331
|
const out = normalizeOpenAIResponsesResponse(data);
|
|
12332
|
+
if (out.usage)
|
|
12333
|
+
out.usage = preserveRequestedServiceTierEvidence(
|
|
12334
|
+
out.usage,
|
|
12335
|
+
options.serviceTier,
|
|
12336
|
+
);
|
|
12246
12337
|
delete out.responseId;
|
|
12247
12338
|
const providerReceipt = supportsOpenAIRequestIdentity
|
|
12248
12339
|
? _openAIProviderRequestReceipt(response, data, providerRequestId)
|
|
@@ -12379,6 +12470,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12379
12470
|
input_tokens: promptTokens - cached,
|
|
12380
12471
|
output_tokens: completionTokens,
|
|
12381
12472
|
cache_read_input_tokens: cached,
|
|
12473
|
+
...projectEnvelopePricingContext(data.usage, data),
|
|
12382
12474
|
};
|
|
12383
12475
|
}
|
|
12384
12476
|
}
|
|
@@ -13067,6 +13159,11 @@ async function _chatOpenAIResponsesStreaming(
|
|
|
13067
13159
|
return out;
|
|
13068
13160
|
}
|
|
13069
13161
|
const out = finalizeOpenAIResponsesStream(state);
|
|
13162
|
+
if (out.usage)
|
|
13163
|
+
out.usage = preserveRequestedServiceTierEvidence(
|
|
13164
|
+
out.usage,
|
|
13165
|
+
body.service_tier,
|
|
13166
|
+
);
|
|
13070
13167
|
const responseId = out.responseId || state.responseId;
|
|
13071
13168
|
delete out.responseId;
|
|
13072
13169
|
const providerReceipt = _openAIProviderRequestReceipt(
|
|
@@ -13988,8 +14085,9 @@ async function _getAutoCompactor(options) {
|
|
|
13988
14085
|
let canonicalRequired = false;
|
|
13989
14086
|
try {
|
|
13990
14087
|
const { feature } = await import("../lib/feature-flags.js");
|
|
13991
|
-
const { resolveCliContextMemoryCutover } =
|
|
13992
|
-
|
|
14088
|
+
const { resolveCliContextMemoryCutover } = await import(
|
|
14089
|
+
"../lib/context-memory-kernel/authority.js"
|
|
14090
|
+
);
|
|
13993
14091
|
const cutover = resolveCliContextMemoryCutover({
|
|
13994
14092
|
env: options.contextMemoryEnv || process.env,
|
|
13995
14093
|
scopeKey: options.sessionId
|
|
@@ -13998,8 +14096,9 @@ async function _getAutoCompactor(options) {
|
|
|
13998
14096
|
});
|
|
13999
14097
|
canonicalRequired = cutover.canonical;
|
|
14000
14098
|
if (feature("PROMPT_COMPRESSOR") || cutover.canonical) {
|
|
14001
|
-
const { PromptCompressor } =
|
|
14002
|
-
|
|
14099
|
+
const { PromptCompressor } = await import(
|
|
14100
|
+
"../harness/prompt-compressor.js"
|
|
14101
|
+
);
|
|
14003
14102
|
const llmQuery =
|
|
14004
14103
|
typeof options.compactionLlmQuery === "function"
|
|
14005
14104
|
? options.compactionLlmQuery
|
|
@@ -14049,8 +14148,9 @@ async function _getAutoCompactor(options) {
|
|
|
14049
14148
|
compressor = _instrumentAutoCompactorUsage(compressor, options);
|
|
14050
14149
|
if (cutover.canonical) {
|
|
14051
14150
|
const compatibilitySummarizer = compressor;
|
|
14052
|
-
const { compactLiveMessagesCanonical } =
|
|
14053
|
-
|
|
14151
|
+
const { compactLiveMessagesCanonical } = await import(
|
|
14152
|
+
"../lib/context-memory-kernel/live-compaction.js"
|
|
14153
|
+
);
|
|
14054
14154
|
compressor = {
|
|
14055
14155
|
canonicalKernel: true,
|
|
14056
14156
|
shouldAutoCompact: (messages) =>
|
|
@@ -14372,6 +14472,12 @@ function permissionDecision(callId, tool, result) {
|
|
|
14372
14472
|
}
|
|
14373
14473
|
|
|
14374
14474
|
export async function* agentLoop(messages, options) {
|
|
14475
|
+
if (options.serviceTier != null) {
|
|
14476
|
+
resolveModelServiceTier(
|
|
14477
|
+
resolveModelCapabilityProfile(options),
|
|
14478
|
+
options.serviceTier,
|
|
14479
|
+
);
|
|
14480
|
+
}
|
|
14375
14481
|
const executionPolicy = captureAgentExecutionPolicy(options, {
|
|
14376
14482
|
hermetic: true,
|
|
14377
14483
|
});
|
|
@@ -14386,8 +14492,9 @@ export async function* agentLoop(messages, options) {
|
|
|
14386
14492
|
: captureAgentEvolutionIngress(options.evolutionIngress);
|
|
14387
14493
|
let llmCall = configuredChatFn || chatWithTools;
|
|
14388
14494
|
if (evolutionIngress !== null && configuredChatFn) {
|
|
14389
|
-
const { captureCanonicalFallbackChatFn } =
|
|
14390
|
-
|
|
14495
|
+
const { captureCanonicalFallbackChatFn } = await import(
|
|
14496
|
+
"./fallback-model.js"
|
|
14497
|
+
);
|
|
14391
14498
|
llmCall = captureCanonicalFallbackChatFn(
|
|
14392
14499
|
configuredChatFn,
|
|
14393
14500
|
evolutionIngress,
|
|
@@ -14396,8 +14503,9 @@ export async function* agentLoop(messages, options) {
|
|
|
14396
14503
|
// Shared iteration budget — replaces hardcoded MAX_ITERATIONS.
|
|
14397
14504
|
// When options.iterationBudget is provided (e.g. from parent agent),
|
|
14398
14505
|
// the same budget instance is shared, so parent+child consume from one pool.
|
|
14399
|
-
const { IterationBudget, WarningLevel } =
|
|
14400
|
-
|
|
14506
|
+
const { IterationBudget, WarningLevel } = await import(
|
|
14507
|
+
"../lib/iteration-budget.js"
|
|
14508
|
+
);
|
|
14401
14509
|
const budget = options.iterationBudget || new IterationBudget();
|
|
14402
14510
|
const { HostResourceBudget } = await import("../lib/host-resource-budget.js");
|
|
14403
14511
|
const hostResourceBudget =
|
|
@@ -14747,8 +14855,9 @@ export async function* agentLoop(messages, options) {
|
|
|
14747
14855
|
options.strictUsageTelemetry !== true &&
|
|
14748
14856
|
workflowEffectId == null
|
|
14749
14857
|
) {
|
|
14750
|
-
const { makeRunnableProviderFallback } =
|
|
14751
|
-
|
|
14858
|
+
const { makeRunnableProviderFallback } = await import(
|
|
14859
|
+
"../lib/runnable-provider.js"
|
|
14860
|
+
);
|
|
14752
14861
|
llmCall = makeRunnableProviderFallback(llmCall, {
|
|
14753
14862
|
onFallback: ({ from, to, reason, fromModel, toModel }) => {
|
|
14754
14863
|
// Telemetry: a provider/model fallback is a reliability signal — count
|
|
@@ -15388,8 +15497,9 @@ export async function* agentLoop(messages, options) {
|
|
|
15388
15497
|
}
|
|
15389
15498
|
compactionUsageCall =
|
|
15390
15499
|
compactionUsageCall || compactionUsageState?.calls?.at(-1) || null;
|
|
15391
|
-
const { getRejectedCompactionUsage } =
|
|
15392
|
-
|
|
15500
|
+
const { getRejectedCompactionUsage } = await import(
|
|
15501
|
+
"../lib/context-memory-kernel/live-compaction.js"
|
|
15502
|
+
);
|
|
15393
15503
|
const rejectedUsage = getRejectedCompactionUsage(_e);
|
|
15394
15504
|
const returnedUsage = compactionUsageCall?.returnedUsage;
|
|
15395
15505
|
const providerReceipt = _takeCompactionProviderReceipt(
|
|
@@ -15830,8 +15940,9 @@ export async function* agentLoop(messages, options) {
|
|
|
15830
15940
|
// the run-level ids (turn.id correlates with the agent.iteration counter).
|
|
15831
15941
|
let canonicalProviderContext = null;
|
|
15832
15942
|
if (options.contextMemorySkipPlanning !== true) {
|
|
15833
|
-
const { prepareCanonicalProviderContext } =
|
|
15834
|
-
|
|
15943
|
+
const { prepareCanonicalProviderContext } = await import(
|
|
15944
|
+
"../lib/context-memory-kernel/provider-context.js"
|
|
15945
|
+
);
|
|
15835
15946
|
canonicalProviderContext = await prepareCanonicalProviderContext(
|
|
15836
15947
|
callMessages,
|
|
15837
15948
|
{
|
|
@@ -583,7 +583,7 @@ const CODING_AGENT_TOOL_CONTRACTS = Object.freeze([
|
|
|
583
583
|
kind: "skill",
|
|
584
584
|
tier: "extension",
|
|
585
585
|
description:
|
|
586
|
-
"
|
|
586
|
+
"Search available skills by query/category. Returns up to 20 descriptors by default (maximum 64); use nextOffset for more. Skill bodies are loaded only when selected.",
|
|
587
587
|
inputSchema: {
|
|
588
588
|
type: "object",
|
|
589
589
|
properties: {
|
|
@@ -596,6 +596,19 @@ const CODING_AGENT_TOOL_CONTRACTS = Object.freeze([
|
|
|
596
596
|
type: "string",
|
|
597
597
|
description: "Search keyword to filter skills",
|
|
598
598
|
},
|
|
599
|
+
limit: {
|
|
600
|
+
type: "integer",
|
|
601
|
+
minimum: 1,
|
|
602
|
+
maximum: 64,
|
|
603
|
+
description: "Descriptors per page; default 20",
|
|
604
|
+
},
|
|
605
|
+
offset: {
|
|
606
|
+
type: "integer",
|
|
607
|
+
minimum: 0,
|
|
608
|
+
maximum: 10000,
|
|
609
|
+
description:
|
|
610
|
+
"Use nextOffset from the previous page; default 0. Query results are bounded to the top 64 matches.",
|
|
611
|
+
},
|
|
599
612
|
},
|
|
600
613
|
},
|
|
601
614
|
...TOOL_POLICY_METADATA.list_skills,
|
|
@@ -2623,6 +2623,7 @@ async function runAgentHeadlessInWorkspace(
|
|
|
2623
2623
|
apiKey,
|
|
2624
2624
|
cwd,
|
|
2625
2625
|
skillLoader: _runtimeSkillLoader,
|
|
2626
|
+
serviceTier: options.serviceTier,
|
|
2626
2627
|
...(skillDecisionRuntime === null ? {} : { skillDecisionRuntime }),
|
|
2627
2628
|
...captureSkillRuntimeDependencies(options, evolutionIngress?.tenantId),
|
|
2628
2629
|
...(skillOutcomeIndex === null ? {} : { skillOutcomeIndex }),
|
|
@@ -3632,6 +3632,7 @@ async function runAgentHeadlessStreamInWorkspace(
|
|
|
3632
3632
|
apiKey,
|
|
3633
3633
|
cwd,
|
|
3634
3634
|
additionalDirectories,
|
|
3635
|
+
serviceTier: options.serviceTier,
|
|
3635
3636
|
sandbox: options.sandbox,
|
|
3636
3637
|
shellPolicyOverrides: options.shellPolicyOverrides,
|
|
3637
3638
|
...(skillOutcomeIndex === null ? {} : { skillOutcomeIndex }),
|
|
Binary file
|