chainlesschain 0.166.102 → 0.166.103
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 +1 -1
- 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-CyHIMEd8.js → AIOps-BLrXpdnP.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-vuNxDpHm.js → ActionButton-C0xy9uFy.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-D0quEM0q.js → Analytics-C6EephQP.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-xRSVpbCs.js → AppLayout-ZCXdOD9y.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-ktfVAZBC.js → Artifacts-D4MfZ-pl.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-UJW6maH4.js → Audit-BQ8c3bBu.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-BYrfdCoT.js → BackgroundAgents-BOA7_ljM.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-IBgsJ7BK.js → Backup-60uiQjGT.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BmP8_zxy.js → BaseInput-BDvEbGs_.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-urkw8_BF.js → Chat-B3IkAuFQ.js} +6 -6
- package/src/assets/web-panel/assets/ChatBubbleRenderer-n6BVStHf.js +1 -0
- package/src/assets/web-panel/assets/{Checkbox-CYboo-__.js → Checkbox-njGbfJWq.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-DaqR_Ay8.js → Codegen-CF7DtdxC.js} +1 -1
- package/src/assets/web-panel/assets/{Col-04BSIj_z.js → Col-C_3Zix40.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DxFk7Trv.js → Community-CzU-ZC2d.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-mjgWlMCB.js → Compact-BgeqsPRh.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CC5ee7QV.js → Compliance-6l7cwiqp.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-BK4BhHZd.js → Cowork-D4s905fI.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-CP6jAxq0.js → Cron-CGTYSxRS.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-DJPaViZS.js → Crosschain-BnSo-Yt3.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BTLxkuOj.js → DID-Dm4vk2X1.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-Djkiqh3d.js → Dashboard-D7H-PZ_N.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-t_eUhqom.js → Dropdown-COslkgxn.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-7w6USx_J.js → EmailListRenderer-CJWEetmk.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-mU5IHEk5.js → EvolutionSettings-BbzebAWe.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-BCh-VBBC.js → FamilyGuardDashboard-BsoTOXwk.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-Be_VpjI2.js → Federation-Ck5kM_5H.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-D_lzQ7PI.js → FormItemContext-gShxCqtF.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-LYu3KapV.js → GenericCardRenderer-DarN1G-z.js} +1 -1
- package/src/assets/web-panel/assets/{Git-BBeF-PP4.js → Git-CJfpLyP5.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-CoF8Kzg7.js → Governance-CVcJmpQz.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-C4DLMnXS.js → Inference-ComU_ig8.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-B2mlNewk.js → KnowledgeGraph-35hprFJy.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-DMZ_44Ya.js → Logs-BQDqBTz0.js} +2 -2
- package/src/assets/web-panel/assets/{MarkdownRenderer-Ck7Iv_9e.js → MarkdownRenderer-BpdGAVCC.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-BqDzTew_.js → Marketplace-B9O9OKnn.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BbwSbDN9.js → McpTools-VMKxA4Wc.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-DAaTWgrm.js → Memory-CcBbf3Bc.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-BjbTGxoR.js → MobileBridge-D7myz46N.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-DMODOBr-.js → MobileProjects-Da5KBXyx.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-DT9N2rCs.js → Mtc-x3NPZfuL.js} +5 -5
- package/src/assets/web-panel/assets/{MtcAudit-DagMfUVv.js → MtcAudit-CwnzptEC.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-C1BKP6nM.js → Multisig-CCAxf4Ye.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-B5LFh72i.js → NLProgramming-CptHKz-Q.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-Q77V3ltW.js → Notes-0uEp4DCJ.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-HxdpNIBs.js → NotificationSettings-DthvrOLd.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-CxXuPzZg.js +1 -0
- package/src/assets/web-panel/assets/{Organization-QL3NZ7uW.js → Organization-BWf2tmQQ.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-B_gqOKho.js → Overflow-BbvAtEth.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-BBJubU8Z.js → P2P-zBo6enit.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-CFnGd-2E.js → PdhVaultBrowser-D_LMQ4A4.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-BKkznIUM.js → Permissions-C1ucb2ck.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-DYK7ZAcd.js → PersonalDataHub-Bz64RddJ.js} +5 -5
- package/src/assets/web-panel/assets/{Pipeline-CoeKpjoN.js → Pipeline-DXJt3y3_.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-Diw4G-92.js → Privacy-DiZ8b_ut.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CHBOFkma.js → ProjectInit-DfLKKrJ4.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-BJIsgdOf.js → ProjectSettings-Ct6kJuIY.js} +2 -2
- package/src/assets/web-panel/assets/Projects-BBUMlZ3m.js +1 -0
- package/src/assets/web-panel/assets/{Providers-o8QCimor.js → Providers-DYVQPHvc.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-z2W-zvhW.js → QrScannerModal-23Il7iPp.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-_yubhsna.js → QuickAsk-WgOZKrv1.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CucgJwih.js → Recommend-CRIka6xT.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-EzfIIRg1.js → RemoteSession-DOy3GjVZ.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-_shttE67.js → Reputation-BXyi6xeR.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DQA_S8-9.js → Row-CoMxuIcR.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BOqWawXT.js → RssFeed-87hPkoM6.js} +3 -3
- package/src/assets/web-panel/assets/{Search-Dx1v2xOq.js → Search-B1EqFCO4.js} +1 -1
- package/src/assets/web-panel/assets/{Security-Bt4HHsT4.js → Security-HcC41eGs.js} +4 -4
- package/src/assets/web-panel/assets/{Services-sruHiQ-r.js → Services-BqLwmvCM.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CiBxvmOJ.js → Skeleton-CIMmjW4r.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-De9qKODU.js → Skills-CgurezJU.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-B_6yn8Wp.js → Sla-CJuRuqPE.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-C2CafExS.js → SpeechSettings-BUwsbd1o.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-Dhh3Qmb0.js → SyncSettings-qo04TOX-.js} +2 -2
- package/src/assets/web-panel/assets/Tasks-QEFENVsp.js +1 -0
- package/src/assets/web-panel/assets/{Templates-D7WVTQQy.js → Templates-D1PTczPW.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-7ur9Yfxd.js → Tenant-Bi0FkEPR.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BgzrOA6k.js → Terminal-DfSt3bIF.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-Dco20pT1.js → TimelineRenderer-B7bIVs4R.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-hN6qBPag.js → Tokens-B6w5XrMb.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-C4f_twAM.js → Trigger-XXVSDWiF.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Wf1SMypp.js → Trust-DYvlgcK-.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-DUXSyg3N.js → UkeySign-XyYwJMBM.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-BvqsJaL0.js → VideoEditing-C47WbtHH.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-CgAbcjKl.js → Wallet-CYfqTj_C.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-DaLT0W3s.js → WebAuthn-3AduFn1l.js} +3 -3
- package/src/assets/web-panel/assets/{WorkflowEditor-CQqAXoaS.js → WorkflowEditor-DHYEHjMJ.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BhlohFTB.js → chat-AeehErSw.js} +1 -1
- package/src/assets/web-panel/assets/{colors-D7HqXIL8.js → colors-DKXJ8paX.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-Bqk4FCLY.js → compact-item-BOlCiomD.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-CEmWrWf0.js → createContext-BAP6U85b.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-rGldFhxo.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-CDY0pFi2.js → hasIn-BLmeL1Xe.js} +1 -1
- package/src/assets/web-panel/assets/{index-BHGOdvOQ.js → index-B0IjlB9m.js} +1 -1
- package/src/assets/web-panel/assets/{index-DmKdCWq1.js → index-BAS2QqLn.js} +1 -1
- package/src/assets/web-panel/assets/{index-CqK0J4Sj.js → index-BRcJlKSa.js} +1 -1
- package/src/assets/web-panel/assets/{index-B8L3_-sG.js → index-BSOenF5s.js} +1 -1
- package/src/assets/web-panel/assets/{index-CrsM-oiD.js → index-BTnp4Nt3.js} +1 -1
- package/src/assets/web-panel/assets/{index-BPmRkxeX.js → index-BhcpWl5z.js} +1 -1
- package/src/assets/web-panel/assets/{index-CVrwozwH.js → index-Bn54FU3i.js} +1 -1
- package/src/assets/web-panel/assets/{index-C02yDu4f.js → index-Bpx54vfs.js} +1 -1
- package/src/assets/web-panel/assets/{index-Chxt0t-A.js → index-Bs2O3f81.js} +1 -1
- package/src/assets/web-panel/assets/{index-C3opQg47.js → index-Bt-FCVzh.js} +1 -1
- package/src/assets/web-panel/assets/{index-DPBoWNwq.js → index-BuUwKmEI.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cur88hoN.js → index-C5AKY6bJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-XErJQ1yF.js → index-C8qi53Ki.js} +1 -1
- package/src/assets/web-panel/assets/{index-BxYO6nde.js → index-CFKzWIo8.js} +1 -1
- package/src/assets/web-panel/assets/{index-CkqBoCiu.js → index-CRa4pAaM.js} +3 -3
- package/src/assets/web-panel/assets/{index-DGKRAO61.js → index-CaHhfpBi.js} +1 -1
- package/src/assets/web-panel/assets/{index-e9oCy7_4.js → index-CdNSmvog.js} +1 -1
- package/src/assets/web-panel/assets/{index-BiLu-ImR.js → index-CgtaOzMo.js} +1 -1
- package/src/assets/web-panel/assets/{index-lBAbMOzg.js → index-CiqeF0Pf.js} +1 -1
- package/src/assets/web-panel/assets/{index-D0nfNmbq.js → index-ClpwxOXo.js} +1 -1
- package/src/assets/web-panel/assets/{index-BxXFRLTZ.js → index-Co7pjF53.js} +1 -1
- package/src/assets/web-panel/assets/index-Cw-lfvvV.js +1 -0
- package/src/assets/web-panel/assets/{index-Dwob5XoD.js → index-DE7cbDDe.js} +1 -1
- package/src/assets/web-panel/assets/{index-DpI1LqJX.js → index-DQLQuwpA.js} +1 -1
- package/src/assets/web-panel/assets/{index-DuMt3ewl.js → index-DWYqOI1A.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXRooi-O.js → index-De2fPxdb.js} +1 -1
- package/src/assets/web-panel/assets/{index-1HBam9t1.js → index-DpZqbc4w.js} +1 -1
- package/src/assets/web-panel/assets/{index-C9mvnSii.js → index-DsQ38fVY.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEzL7s7P.js → index-Dv8-g1pY.js} +1 -1
- package/src/assets/web-panel/assets/{index-o_lc3eww.js → index-EKNODw4P.js} +1 -1
- package/src/assets/web-panel/assets/{index-6f6n0KFR.js → index-FPXLIXoy.js} +1 -1
- package/src/assets/web-panel/assets/{index-DRcDWMwP.js → index-IlzfIRNh.js} +1 -1
- package/src/assets/web-panel/assets/{index-BNrvBWDS.js → index-OLKhib9T.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cf1ha8l0.js → index-PEe9OWEQ.js} +1 -1
- package/src/assets/web-panel/assets/index-QBXRSyoZ.js +1 -0
- package/src/assets/web-panel/assets/{index-CYcjOnDX.js → index-T28naovw.js} +1 -1
- package/src/assets/web-panel/assets/{index-CkjgSHVz.js → index-ZMbXl5lo.js} +1 -1
- package/src/assets/web-panel/assets/{index-BuKGuH_y.js → index-urPvyUVk.js} +1 -1
- package/src/assets/web-panel/assets/{index-aBHlgMrq.js → index-wyKpTsGM.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-CIeEUxIN.js → initDefaultProps-CDWa1rnn.js} +1 -1
- package/src/assets/web-panel/assets/{motion-IPIj1ZtP.js → motion-CX2Cnsd5.js} +1 -1
- package/src/assets/web-panel/assets/{move-BfSeXZ-f.js → move-Bfe1NcEF.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DX03-Xp4.js → mtc-parser-DbdqleHE.js} +1 -1
- package/src/assets/web-panel/assets/{omit-z9EannfX.js → omit-CE2K7NVv.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DXKmRkqZ.js → pickAttrs-y_bZgxWG.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-k2HV7cIU.js → placementArrow-BOHR4zwr.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-bX7CsyWy.js → responsiveObserve-B8Jwq05-.js} +1 -1
- package/src/assets/web-panel/assets/{slide-NskjQLbJ.js → slide-BD7RJ3Kn.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-B3IoG-Er.js → statusUtils-BuxDJeDx.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-DHv_UilX.js → styleChecker-DgYQ2Q0o.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DEqGB5Ng.js → useFlexGapSupport-DAHF0Fwi.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-Bl9CbrqZ.js → useFs-D4kDyLFp.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-O-Ukv93M.js → usePersonalDataHub-BHtSxW4A.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-hGCHTaZt.js → vnode-CHKtdqW0.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-BWhIVeKQ.js → zoom-CIZAMma9.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/ask.js +6 -4
- package/src/commands/team.js +28 -19
- package/src/data/changelog.json +13 -0
- package/src/harness/prompt-compressor.js +2 -0
- package/src/lib/advisor-runtime.js +4 -2
- package/src/lib/agent-ipc-bus.js +2 -0
- package/src/lib/background-agent-keeper-client.js +3 -0
- package/src/lib/browser-automation.js +4 -0
- package/src/lib/cc-android-bridge.js +4 -0
- package/src/lib/chat-core.js +11 -9
- package/src/lib/cloud/cloud-client.js +10 -1
- package/src/lib/cowork-adapter.js +4 -3
- package/src/lib/decision-layer/providers.js +16 -11
- package/src/lib/evolution/governed-hub-llm.js +31 -16
- package/src/lib/evolution/governed-hub-resolver.js +4 -0
- package/src/lib/evolution/governed-skill-synthesis-process-grader.js +4 -0
- package/src/lib/evomap-client.js +14 -2
- package/src/lib/formal-budget-authority.js +191 -59
- package/src/lib/formal-budget-contract.js +7 -13
- package/src/lib/formal-budget-errors.js +31 -0
- package/src/lib/formal-budget-lineage-registry.js +612 -0
- package/src/lib/formal-budget-provider-scope.js +143 -0
- package/src/lib/formal-budget-transport.js +235 -100
- package/src/lib/gateway-client-resilience.js +5 -0
- package/src/lib/hub-llm-client.js +25 -16
- package/src/lib/llm-connection-probe.js +17 -10
- package/src/lib/llm-providers.js +4 -1
- package/src/lib/model-failure-policy.js +2 -0
- package/src/lib/plugin-runtime/marketplace-network.js +9 -5
- package/src/lib/process-execution-broker/credential-agent.js +7 -2
- package/src/lib/process-execution-broker/credential-transport.js +4 -0
- package/src/lib/process-execution-broker/index.js +8 -0
- package/src/lib/provider-stream.js +28 -13
- package/src/lib/sandbox-egress-worker.js +3 -0
- package/src/lib/stream-retry.js +2 -0
- package/src/lib/sub-agent-context.js +6 -3
- package/src/lib/web-fetch.js +2 -0
- package/src/lib/web-search.js +5 -0
- package/src/runtime/agent-core.js +30 -9
- package/src/assets/web-panel/assets/ChatBubbleRenderer-Cw44zZbh.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-Dc0DpvBH.js +0 -1
- package/src/assets/web-panel/assets/Projects-GJjItXIk.js +0 -1
- package/src/assets/web-panel/assets/Tasks-Mvo5mTWm.js +0 -1
- package/src/assets/web-panel/assets/devWarning-YPX_TU7w.js +0 -1
- package/src/assets/web-panel/assets/index-D53szVZQ.js +0 -1
- package/src/assets/web-panel/assets/index-Ub2nJbV2.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isAbortError } from "./abort-utils.js";
|
|
2
|
+
import { isFormalBudgetError } from "./formal-budget-errors.js";
|
|
2
3
|
|
|
3
4
|
export function isEvolutionIngressFailure(error) {
|
|
4
5
|
const visited = new Set();
|
|
@@ -21,6 +22,7 @@ export function isTerminalModelFailure(error) {
|
|
|
21
22
|
current.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED" ||
|
|
22
23
|
current.runtimeLedgerPersistence === true ||
|
|
23
24
|
current.workflowEffectOutcomeUnknown === true ||
|
|
25
|
+
isFormalBudgetError(current) ||
|
|
24
26
|
/^(?:CC|ERR)_SESSION_BUDGET_/u.test(current.code || "") ||
|
|
25
27
|
isAbortError(current)
|
|
26
28
|
) {
|
|
@@ -3,6 +3,10 @@ import fs from "node:fs";
|
|
|
3
3
|
import tls from "node:tls";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
5
5
|
import { Agent, ProxyAgent, fetch as undiciFetch } from "undici";
|
|
6
|
+
import {
|
|
7
|
+
requireUnscopedDescendantControl,
|
|
8
|
+
requireUnscopedExternalToolAccess,
|
|
9
|
+
} from "../formal-budget-provider-scope.js";
|
|
6
10
|
|
|
7
11
|
export const MAX_MARKETPLACE_CA_BUNDLE_BYTES = 1024 * 1024;
|
|
8
12
|
export const MAX_MARKETPLACE_PROXY_URL_LENGTH = 4096;
|
|
@@ -15,6 +19,7 @@ export const DEFAULT_MARKETPLACE_PAC_TIMEOUT_MS = 2_000;
|
|
|
15
19
|
* deliberately ignored: callers pass CLI flags or CC_PLUGIN_REGISTRY_* values.
|
|
16
20
|
*/
|
|
17
21
|
export function createMarketplaceNetworkTransport(options = {}) {
|
|
22
|
+
requireUnscopedExternalToolAccess();
|
|
18
23
|
const proxy = normalizeProxyUrl(options.proxyUrl);
|
|
19
24
|
const pac = options.pacFile ? readMarketplacePacFile(options.pacFile) : null;
|
|
20
25
|
if (proxy && pac) {
|
|
@@ -49,6 +54,7 @@ export function createMarketplaceNetworkTransport(options = {}) {
|
|
|
49
54
|
|
|
50
55
|
return {
|
|
51
56
|
fetch: async (url, fetchOptions = {}) => {
|
|
57
|
+
requireUnscopedExternalToolAccess();
|
|
52
58
|
const route = pac
|
|
53
59
|
? parsePacResult(
|
|
54
60
|
await resolveMarketplacePac(pac.script, url, {
|
|
@@ -99,11 +105,9 @@ export function readMarketplacePacFile(file) {
|
|
|
99
105
|
};
|
|
100
106
|
}
|
|
101
107
|
|
|
102
|
-
export function resolveMarketplacePac(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{ timeoutMs = DEFAULT_MARKETPLACE_PAC_TIMEOUT_MS } = {},
|
|
106
|
-
) {
|
|
108
|
+
export function resolveMarketplacePac(script, url, options = {}) {
|
|
109
|
+
requireUnscopedDescendantControl();
|
|
110
|
+
const { timeoutMs = DEFAULT_MARKETPLACE_PAC_TIMEOUT_MS } = options;
|
|
107
111
|
const timeout = Number(timeoutMs);
|
|
108
112
|
if (!Number.isInteger(timeout) || timeout < 100 || timeout > 10_000) {
|
|
109
113
|
throw new Error("Marketplace PAC timeout must be between 100 and 10000 ms");
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import crypto from "node:crypto";
|
|
16
16
|
import { CredentialTransport } from "./credential-transport.js";
|
|
17
|
+
import { requireUnscopedDescendantControl } from "../formal-budget-provider-scope.js";
|
|
17
18
|
|
|
18
19
|
const REDACTED_VALUE = "***REDACTED***";
|
|
19
20
|
const DEFAULT_TTL_MS = 60_000;
|
|
@@ -644,6 +645,7 @@ class CredentialAgent {
|
|
|
644
645
|
* self-asserted approval metadata.
|
|
645
646
|
*/
|
|
646
647
|
issueCredentialRef(request = {}) {
|
|
648
|
+
requireUnscopedDescendantControl();
|
|
647
649
|
if (!this.isEnabled()) {
|
|
648
650
|
this._recordAudit({
|
|
649
651
|
event: "credential_ref_issue",
|
|
@@ -842,6 +844,7 @@ class CredentialAgent {
|
|
|
842
844
|
* request object; child-provided claims are not sufficient attestation.
|
|
843
845
|
*/
|
|
844
846
|
resolveCredentialRef(refId, request = {}) {
|
|
847
|
+
requireUnscopedDescendantControl();
|
|
845
848
|
const refFingerprint = this._fingerprint(refId);
|
|
846
849
|
if (!this.isEnabled()) {
|
|
847
850
|
this._recordAudit({
|
|
@@ -1002,8 +1005,8 @@ class CredentialAgent {
|
|
|
1002
1005
|
_canIssueForContext(context) {
|
|
1003
1006
|
return Boolean(
|
|
1004
1007
|
context?.approved === true &&
|
|
1005
|
-
|
|
1006
|
-
|
|
1008
|
+
context.approvalId &&
|
|
1009
|
+
normalizeProcessTarget(context.target?.process ?? context.process),
|
|
1007
1010
|
);
|
|
1008
1011
|
}
|
|
1009
1012
|
|
|
@@ -1025,6 +1028,7 @@ class CredentialAgent {
|
|
|
1025
1028
|
* Strip sensitive and reserved environment variables from spawn options.
|
|
1026
1029
|
*/
|
|
1027
1030
|
filterEnvironment(env = process.env, context = null) {
|
|
1031
|
+
requireUnscopedDescendantControl();
|
|
1028
1032
|
const safeEnv = {};
|
|
1029
1033
|
const redacted = [];
|
|
1030
1034
|
const reservedRemoved = [];
|
|
@@ -1232,6 +1236,7 @@ class CredentialAgent {
|
|
|
1232
1236
|
* Apply filtering and issue references for a broker-approved spawn.
|
|
1233
1237
|
*/
|
|
1234
1238
|
applyWithReport(spawnOptions) {
|
|
1239
|
+
requireUnscopedDescendantControl();
|
|
1235
1240
|
if (!spawnOptions || typeof spawnOptions !== "object") {
|
|
1236
1241
|
throw credentialError(
|
|
1237
1242
|
CREDENTIAL_ERROR_CODES.INVALID_REQUEST,
|
|
@@ -10,6 +10,7 @@ import net from "node:net";
|
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { Worker } from "node:worker_threads";
|
|
13
|
+
import { requireUnscopedDescendantControl } from "../formal-budget-provider-scope.js";
|
|
13
14
|
|
|
14
15
|
const TRANSPORT_VERSION = "local-ipc-v1";
|
|
15
16
|
const DEFAULT_TIMEOUT_MS = 5000;
|
|
@@ -34,6 +35,7 @@ export function credentialTransportEndpoint(agentId, options = {}) {
|
|
|
34
35
|
|
|
35
36
|
export class CredentialTransport {
|
|
36
37
|
constructor(options = {}) {
|
|
38
|
+
requireUnscopedDescendantControl();
|
|
37
39
|
if (!options.agentId) {
|
|
38
40
|
throw transportError(
|
|
39
41
|
"CC_CREDENTIAL_INVALID_REQUEST",
|
|
@@ -156,6 +158,7 @@ export class CredentialTransport {
|
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
registerCredential(record) {
|
|
161
|
+
requireUnscopedDescendantControl();
|
|
159
162
|
if (!this.isAvailable()) {
|
|
160
163
|
throw (
|
|
161
164
|
this.error ||
|
|
@@ -265,6 +268,7 @@ async function connectWithRetry(endpoint, deadline) {
|
|
|
265
268
|
* approved target process.
|
|
266
269
|
*/
|
|
267
270
|
export async function resolveCredentialRefOverTransport(refId, options = {}) {
|
|
271
|
+
requireUnscopedDescendantControl();
|
|
268
272
|
const env = options.env || process.env;
|
|
269
273
|
const endpoint = options.endpoint || env.CC_CREDENTIAL_ENDPOINT;
|
|
270
274
|
const capabilityToken =
|
|
@@ -30,6 +30,7 @@ import * as fs from "node:fs";
|
|
|
30
30
|
import * as tty from "node:tty";
|
|
31
31
|
import { createRequire } from "node:module";
|
|
32
32
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
33
|
+
import { requireUnscopedDescendantControl } from "../formal-budget-provider-scope.js";
|
|
33
34
|
|
|
34
35
|
const require = createRequire(import.meta.url);
|
|
35
36
|
|
|
@@ -4692,6 +4693,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
4692
4693
|
}
|
|
4693
4694
|
|
|
4694
4695
|
spawn(command, args, options = {}) {
|
|
4696
|
+
requireUnscopedDescendantControl();
|
|
4695
4697
|
assertProcessOwnershipAvailable();
|
|
4696
4698
|
options = this._withAmbientProcessContext(command, options);
|
|
4697
4699
|
const executionId = crypto.randomUUID();
|
|
@@ -5156,6 +5158,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5156
5158
|
}
|
|
5157
5159
|
|
|
5158
5160
|
spawnSync(command, args, options = {}) {
|
|
5161
|
+
requireUnscopedDescendantControl();
|
|
5159
5162
|
assertProcessOwnershipAvailable();
|
|
5160
5163
|
options = this._withAmbientProcessContext(command, options);
|
|
5161
5164
|
const executionId = crypto.randomUUID();
|
|
@@ -5745,6 +5748,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5745
5748
|
}
|
|
5746
5749
|
|
|
5747
5750
|
exec(command, options, callback) {
|
|
5751
|
+
requireUnscopedDescendantControl();
|
|
5748
5752
|
const opts = typeof options === "function" ? {} : options;
|
|
5749
5753
|
const cb = typeof options === "function" ? options : callback;
|
|
5750
5754
|
if (this._requiresExplicitLinuxWorkspaceShell(opts.cwd || process.cwd())) {
|
|
@@ -5763,6 +5767,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5763
5767
|
}
|
|
5764
5768
|
|
|
5765
5769
|
execSync(command, options = {}) {
|
|
5770
|
+
requireUnscopedDescendantControl();
|
|
5766
5771
|
if (
|
|
5767
5772
|
this._requiresExplicitLinuxWorkspaceShell(options.cwd || process.cwd())
|
|
5768
5773
|
) {
|
|
@@ -5804,6 +5809,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5804
5809
|
}
|
|
5805
5810
|
|
|
5806
5811
|
execFile(file, args, options, callback) {
|
|
5812
|
+
requireUnscopedDescendantControl();
|
|
5807
5813
|
if (typeof args === "function") {
|
|
5808
5814
|
callback = args;
|
|
5809
5815
|
args = [];
|
|
@@ -5897,6 +5903,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5897
5903
|
}
|
|
5898
5904
|
|
|
5899
5905
|
execFileSync(file, args, options = {}) {
|
|
5906
|
+
requireUnscopedDescendantControl();
|
|
5900
5907
|
if (!Array.isArray(args)) {
|
|
5901
5908
|
options = args || {};
|
|
5902
5909
|
args = [];
|
|
@@ -5917,6 +5924,7 @@ class ProcessExecutionBroker extends EventEmitter {
|
|
|
5917
5924
|
}
|
|
5918
5925
|
|
|
5919
5926
|
fork(modulePath, args, options = {}) {
|
|
5927
|
+
requireUnscopedDescendantControl();
|
|
5920
5928
|
return this.spawn(process.execPath, [modulePath, ...(args || [])], {
|
|
5921
5929
|
...options,
|
|
5922
5930
|
origin: options.origin || "fork",
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasFormalBudgetProviderScope,
|
|
3
|
+
providerFetch,
|
|
4
|
+
} from "./formal-budget-provider-scope.js";
|
|
1
5
|
/**
|
|
2
6
|
* Provider streaming adapters — shared by `cc stream` and the Hosted Session
|
|
3
7
|
* API `stream.run` WS route. Each builder returns an AsyncIterable<string>
|
|
@@ -47,16 +51,19 @@ export async function* ollamaTokenStream({
|
|
|
47
51
|
signal,
|
|
48
52
|
requireCompletion = false,
|
|
49
53
|
}) {
|
|
50
|
-
const res = await
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
const res = await providerFetch(
|
|
55
|
+
`${baseUrl}/api/${messages ? "chat" : "generate"}`,
|
|
56
|
+
{
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers: { "Content-Type": "application/json" },
|
|
59
|
+
body: JSON.stringify(
|
|
60
|
+
messages
|
|
61
|
+
? { model, messages, stream: true }
|
|
62
|
+
: { model, prompt, stream: true },
|
|
63
|
+
),
|
|
64
|
+
signal,
|
|
65
|
+
},
|
|
66
|
+
);
|
|
60
67
|
if (!res.ok || !res.body) {
|
|
61
68
|
throw new Error(`Ollama ${res.status} ${res.statusText}`);
|
|
62
69
|
}
|
|
@@ -88,7 +95,8 @@ export async function* openAIStream({
|
|
|
88
95
|
signal,
|
|
89
96
|
requireCompletion = false,
|
|
90
97
|
}) {
|
|
91
|
-
const
|
|
98
|
+
const governed = hasFormalBudgetProviderScope();
|
|
99
|
+
const res = await providerFetch(`${baseUrl}/chat/completions`, {
|
|
92
100
|
method: "POST",
|
|
93
101
|
headers: {
|
|
94
102
|
"Content-Type": "application/json",
|
|
@@ -98,17 +106,24 @@ export async function* openAIStream({
|
|
|
98
106
|
model,
|
|
99
107
|
messages: messages ?? [{ role: "user", content: prompt }],
|
|
100
108
|
stream: true,
|
|
109
|
+
...(governed ? { stream_options: { include_usage: true } } : {}),
|
|
101
110
|
}),
|
|
102
111
|
signal,
|
|
103
112
|
});
|
|
104
113
|
if (!res.ok || !res.body) {
|
|
105
114
|
throw new Error(`${res.status} ${res.statusText}`);
|
|
106
115
|
}
|
|
116
|
+
let completed = false;
|
|
107
117
|
for await (const raw of responseLines(res.body)) {
|
|
108
118
|
const line = raw.trim();
|
|
109
119
|
if (!line || !line.startsWith("data:")) continue;
|
|
110
120
|
const payload = line.slice(5).trim();
|
|
111
|
-
if (payload === "[DONE]")
|
|
121
|
+
if (payload === "[DONE]") {
|
|
122
|
+
completed = true;
|
|
123
|
+
if (!governed) return;
|
|
124
|
+
// A governed stream must reach EOF so durable accounting can settle.
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
112
127
|
try {
|
|
113
128
|
const obj = JSON.parse(payload);
|
|
114
129
|
if (requireCompletion && obj.error)
|
|
@@ -120,7 +135,7 @@ export async function* openAIStream({
|
|
|
120
135
|
/* skip */
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
|
-
if (requireCompletion)
|
|
138
|
+
if (requireCompletion && !completed)
|
|
124
139
|
throw new Error("OpenAI stream ended before its completion marker");
|
|
125
140
|
}
|
|
126
141
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Worker } from "node:worker_threads";
|
|
7
7
|
import path from "node:path";
|
|
8
|
+
import { requireUnscopedDescendantControl } from "./formal-budget-provider-scope.js";
|
|
8
9
|
|
|
9
10
|
const RESPONSE_TIMEOUT_MS = 10_000;
|
|
10
11
|
|
|
@@ -15,6 +16,7 @@ function workerError(code) {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export async function startEgressProxyWorker(policy, options = {}) {
|
|
19
|
+
requireUnscopedDescendantControl();
|
|
18
20
|
const bindHost = options.bindHost || "127.0.0.1";
|
|
19
21
|
const socketPath = options.socketPath || null;
|
|
20
22
|
if (socketPath) {
|
|
@@ -156,6 +158,7 @@ export async function startEgressProxyWorker(policy, options = {}) {
|
|
|
156
158
|
return revision;
|
|
157
159
|
},
|
|
158
160
|
async updatePolicy(nextPolicy, expectedRevision) {
|
|
161
|
+
requireUnscopedDescendantControl();
|
|
159
162
|
const response = await request("update", {
|
|
160
163
|
policy: nextPolicy,
|
|
161
164
|
expectedRevision,
|
package/src/lib/stream-retry.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
raceWithAbort,
|
|
19
19
|
throwIfAborted,
|
|
20
20
|
} from "./abort-utils.js";
|
|
21
|
+
import { isFormalBudgetError } from "./formal-budget-errors.js";
|
|
21
22
|
|
|
22
23
|
/** Bounded auto-retry budget for streaming connection drops (Claude-Code 2.1.181). */
|
|
23
24
|
export const STREAM_RETRY_MAX = 2;
|
|
@@ -243,6 +244,7 @@ export function resolveStreamRetryMax(env = process.env) {
|
|
|
243
244
|
* @returns {boolean}
|
|
244
245
|
*/
|
|
245
246
|
export function isRetryableStreamError(err, signal) {
|
|
247
|
+
if (isFormalBudgetError(err)) return false;
|
|
246
248
|
if (isAbortError(err)) return false;
|
|
247
249
|
if (signal && signal.aborted) return false;
|
|
248
250
|
if (!err) return false;
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from "../runtime/agent-core.js";
|
|
22
22
|
import { feature } from "./feature-flags.js";
|
|
23
23
|
import { isEvolutionIngressFailure } from "./model-failure-policy.js";
|
|
24
|
+
import { isFormalBudgetError } from "./formal-budget-errors.js";
|
|
24
25
|
import { captureAgentEvolutionIngress } from "./evolution/agent-evolution-ingress.js";
|
|
25
26
|
import {
|
|
26
27
|
createWorktree,
|
|
@@ -609,6 +610,7 @@ export class SubAgentContext {
|
|
|
609
610
|
} catch (err) {
|
|
610
611
|
if (
|
|
611
612
|
isEvolutionIngressFailure(err) ||
|
|
613
|
+
isFormalBudgetError(err) ||
|
|
612
614
|
err?.runtimeLedgerPersistence === true ||
|
|
613
615
|
this._workflowEffectId
|
|
614
616
|
) {
|
|
@@ -1212,6 +1214,7 @@ export class SubAgentContext {
|
|
|
1212
1214
|
} catch (err) {
|
|
1213
1215
|
if (
|
|
1214
1216
|
isEvolutionIngressFailure(err) ||
|
|
1217
|
+
isFormalBudgetError(err) ||
|
|
1215
1218
|
err?.runtimeLedgerPersistence === true ||
|
|
1216
1219
|
this._workflowEffectId
|
|
1217
1220
|
) {
|
|
@@ -1543,9 +1546,9 @@ export class SubAgentContext {
|
|
|
1543
1546
|
isAborted() {
|
|
1544
1547
|
return Boolean(
|
|
1545
1548
|
this._signal?.aborted ||
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
+
this._abortController.signal.aborted ||
|
|
1550
|
+
this._runAbortController?.signal.aborted ||
|
|
1551
|
+
this.sessionBudget?.signal?.aborted,
|
|
1549
1552
|
);
|
|
1550
1553
|
}
|
|
1551
1554
|
|
package/src/lib/web-fetch.js
CHANGED
|
@@ -12,6 +12,7 @@ import { URL } from "node:url";
|
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import { StringDecoder } from "node:string_decoder";
|
|
14
14
|
import { webFetchSnapshots } from "./web-fetch-snapshots.js";
|
|
15
|
+
import { requireUnscopedExternalToolAccess } from "./formal-budget-provider-scope.js";
|
|
15
16
|
|
|
16
17
|
const DEFAULT_MAX_BYTES = 10_000_000;
|
|
17
18
|
const DEFAULT_MAX_CHARS = 20_000;
|
|
@@ -343,6 +344,7 @@ async function _doRequest(
|
|
|
343
344
|
}
|
|
344
345
|
|
|
345
346
|
export async function webFetch(url, options = {}) {
|
|
347
|
+
requireUnscopedExternalToolAccess();
|
|
346
348
|
const {
|
|
347
349
|
format = "markdown",
|
|
348
350
|
maxBytes = DEFAULT_MAX_BYTES,
|
package/src/lib/web-search.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import http from "http";
|
|
15
15
|
import https from "https";
|
|
16
16
|
import { URL } from "url";
|
|
17
|
+
import { requireUnscopedPaidService } from "./formal-budget-provider-scope.js";
|
|
17
18
|
|
|
18
19
|
const DEFAULT_MAX_BYTES = 10_000_000;
|
|
19
20
|
const DEFAULT_TIMEOUT_MS = 15_000;
|
|
@@ -510,6 +511,10 @@ export async function webSearch(query, options = {}) {
|
|
|
510
511
|
const q = String(query || "").trim();
|
|
511
512
|
if (!q) return { error: "web_search: empty query" };
|
|
512
513
|
|
|
514
|
+
// A model-token reservation does not price API search or configured proxy
|
|
515
|
+
// services. Reject before resolving keys or opening an HTTP request.
|
|
516
|
+
requireUnscopedPaidService();
|
|
517
|
+
|
|
513
518
|
const config = options.config || {};
|
|
514
519
|
const provider = resolveProvider(options, config);
|
|
515
520
|
let maxResults = normalizeMaxResults(options.maxResults ?? config.maxResults);
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
providerFetch,
|
|
3
|
+
requireUnscopedToolExecution,
|
|
4
|
+
} from "../lib/formal-budget-provider-scope.js";
|
|
5
|
+
import { isFormalBudgetError } from "../lib/formal-budget-errors.js";
|
|
1
6
|
/**
|
|
2
7
|
* Agent Core — transport-independent agentic logic
|
|
3
8
|
*
|
|
@@ -2613,6 +2618,7 @@ function snapshotApprovalPolicyAuthority(approvalGate, sessionId) {
|
|
|
2613
2618
|
* @returns {Promise<object>} tool result
|
|
2614
2619
|
*/
|
|
2615
2620
|
export async function executeTool(name, args, context = {}) {
|
|
2621
|
+
requireUnscopedToolExecution();
|
|
2616
2622
|
const liveExecutionContext = context;
|
|
2617
2623
|
try {
|
|
2618
2624
|
const executionPolicy = captureAgentExecutionPolicy(context);
|
|
@@ -7851,6 +7857,7 @@ async function executeToolInner(
|
|
|
7851
7857
|
});
|
|
7852
7858
|
return attachDescriptor(result);
|
|
7853
7859
|
} catch (err) {
|
|
7860
|
+
if (isFormalBudgetError(err)) throw err;
|
|
7854
7861
|
return attachDescriptor({ error: `web_search failed: ${err.message}` });
|
|
7855
7862
|
}
|
|
7856
7863
|
}
|
|
@@ -9172,6 +9179,7 @@ async function executeToolInner(
|
|
|
9172
9179
|
} catch (err) {
|
|
9173
9180
|
if (
|
|
9174
9181
|
isEvolutionIngressFailure(err) ||
|
|
9182
|
+
isFormalBudgetError(err) ||
|
|
9175
9183
|
err?.runtimeLedgerPersistence === true ||
|
|
9176
9184
|
err?.workflowEffectOutcomeUnknown === true
|
|
9177
9185
|
) {
|
|
@@ -10643,6 +10651,7 @@ function _throwBackgroundSubAgentUsageFailure(entry) {
|
|
|
10643
10651
|
const error = entry?.outcome?.fatalError;
|
|
10644
10652
|
if (
|
|
10645
10653
|
isEvolutionIngressFailure(error) ||
|
|
10654
|
+
isFormalBudgetError(error) ||
|
|
10646
10655
|
error?.runtimeLedgerPersistence === true ||
|
|
10647
10656
|
error?.workflowEffectOutcomeUnknown === true
|
|
10648
10657
|
) {
|
|
@@ -11621,6 +11630,7 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
11621
11630
|
result: subCtx.result,
|
|
11622
11631
|
error: err.message,
|
|
11623
11632
|
...(isEvolutionIngressFailure(err) ||
|
|
11633
|
+
isFormalBudgetError(err) ||
|
|
11624
11634
|
err?.runtimeLedgerPersistence === true ||
|
|
11625
11635
|
err?.workflowEffectOutcomeUnknown === true
|
|
11626
11636
|
? { fatalError: err }
|
|
@@ -11757,6 +11767,7 @@ async function _executeSpawnSubAgent(args, ctx) {
|
|
|
11757
11767
|
|
|
11758
11768
|
if (
|
|
11759
11769
|
isEvolutionIngressFailure(err) ||
|
|
11770
|
+
isFormalBudgetError(err) ||
|
|
11760
11771
|
err?.runtimeLedgerPersistence === true ||
|
|
11761
11772
|
err?.workflowEffectOutcomeUnknown === true
|
|
11762
11773
|
) {
|
|
@@ -12000,7 +12011,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12000
12011
|
},
|
|
12001
12012
|
);
|
|
12002
12013
|
}
|
|
12003
|
-
const response = await
|
|
12014
|
+
const response = await providerFetch(apiUrl, {
|
|
12004
12015
|
method: "POST",
|
|
12005
12016
|
headers: { "Content-Type": "application/json" },
|
|
12006
12017
|
signal,
|
|
@@ -12156,7 +12167,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12156
12167
|
);
|
|
12157
12168
|
}
|
|
12158
12169
|
|
|
12159
|
-
const response = await
|
|
12170
|
+
const response = await providerFetch(`${url}/messages`, {
|
|
12160
12171
|
method: "POST",
|
|
12161
12172
|
headers: {
|
|
12162
12173
|
"Content-Type": "application/json",
|
|
@@ -12312,7 +12323,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12312
12323
|
);
|
|
12313
12324
|
}
|
|
12314
12325
|
|
|
12315
|
-
const response = await
|
|
12326
|
+
const response = await providerFetch(`${url}/responses`, {
|
|
12316
12327
|
method: "POST",
|
|
12317
12328
|
headers: {
|
|
12318
12329
|
"Content-Type": "application/json",
|
|
@@ -12390,7 +12401,7 @@ export async function chatWithTools(rawMessages, options) {
|
|
|
12390
12401
|
);
|
|
12391
12402
|
}
|
|
12392
12403
|
|
|
12393
|
-
const response = await
|
|
12404
|
+
const response = await providerFetch(`${url}/chat/completions`, {
|
|
12394
12405
|
method: "POST",
|
|
12395
12406
|
headers: {
|
|
12396
12407
|
"Content-Type": "application/json",
|
|
@@ -12627,6 +12638,7 @@ export function _streamErrorDisposition(
|
|
|
12627
12638
|
partialText,
|
|
12628
12639
|
visible = false,
|
|
12629
12640
|
) {
|
|
12641
|
+
if (isFormalBudgetError(err)) return "rethrow";
|
|
12630
12642
|
if (err?.isOutputBackpressureFailure === true) return "rethrow";
|
|
12631
12643
|
if (isAbortError(err)) return "rethrow";
|
|
12632
12644
|
if (signal && signal.aborted) return "rethrow";
|
|
@@ -12871,7 +12883,7 @@ async function _chatOllamaStreaming(
|
|
|
12871
12883
|
stallMs,
|
|
12872
12884
|
stallTimeoutMs,
|
|
12873
12885
|
) {
|
|
12874
|
-
const response = await
|
|
12886
|
+
const response = await providerFetch(apiUrl, {
|
|
12875
12887
|
method: "POST",
|
|
12876
12888
|
headers: { "Content-Type": "application/json" },
|
|
12877
12889
|
signal,
|
|
@@ -12933,7 +12945,7 @@ async function _chatAnthropicStreaming(
|
|
|
12933
12945
|
stallMs,
|
|
12934
12946
|
stallTimeoutMs,
|
|
12935
12947
|
) {
|
|
12936
|
-
const response = await
|
|
12948
|
+
const response = await providerFetch(apiUrl, {
|
|
12937
12949
|
method: "POST",
|
|
12938
12950
|
headers: { "Content-Type": "application/json", ...extraHeaders },
|
|
12939
12951
|
signal,
|
|
@@ -13000,7 +13012,7 @@ async function _chatOpenAIStreaming(
|
|
|
13000
13012
|
stallTimeoutMs,
|
|
13001
13013
|
providerRequestId = null,
|
|
13002
13014
|
) {
|
|
13003
|
-
const response = await
|
|
13015
|
+
const response = await providerFetch(apiUrl, {
|
|
13004
13016
|
method: "POST",
|
|
13005
13017
|
headers: {
|
|
13006
13018
|
"Content-Type": "application/json",
|
|
@@ -13083,7 +13095,7 @@ async function _chatOpenAIResponsesStreaming(
|
|
|
13083
13095
|
stallTimeoutMs,
|
|
13084
13096
|
providerRequestId = null,
|
|
13085
13097
|
) {
|
|
13086
|
-
const response = await
|
|
13098
|
+
const response = await providerFetch(apiUrl, {
|
|
13087
13099
|
method: "POST",
|
|
13088
13100
|
headers: {
|
|
13089
13101
|
"Content-Type": "application/json",
|
|
@@ -15479,6 +15491,7 @@ export async function* agentLoop(messages, options) {
|
|
|
15479
15491
|
}
|
|
15480
15492
|
} catch (_e) {
|
|
15481
15493
|
if (isAbortError(_e) || signal?.aborted) throw _e;
|
|
15494
|
+
if (isFormalBudgetError(_e)) throw _e;
|
|
15482
15495
|
if (_e?.runtimeLedgerPersistence === true) throw _e;
|
|
15483
15496
|
if (_e?.code === "CC_AGENT_EVOLUTION_INGRESS_FAILED") throw _e;
|
|
15484
15497
|
if (
|
|
@@ -15911,6 +15924,7 @@ export async function* agentLoop(messages, options) {
|
|
|
15911
15924
|
];
|
|
15912
15925
|
}
|
|
15913
15926
|
} catch (_e) {
|
|
15927
|
+
if (isFormalBudgetError(_e)) throw _e;
|
|
15914
15928
|
// prepareCall failures are non-critical — proceed with original messages
|
|
15915
15929
|
}
|
|
15916
15930
|
}
|
|
@@ -16511,6 +16525,7 @@ export async function* agentLoop(messages, options) {
|
|
|
16511
16525
|
: {}),
|
|
16512
16526
|
},
|
|
16513
16527
|
error: err.message,
|
|
16528
|
+
fatalError: isFormalBudgetError(err) ? err : null,
|
|
16514
16529
|
}),
|
|
16515
16530
|
);
|
|
16516
16531
|
return { call, toolArgs, workflowBinding, promise };
|
|
@@ -16518,7 +16533,12 @@ export async function* agentLoop(messages, options) {
|
|
|
16518
16533
|
for (const { call, toolArgs, workflowBinding, promise } of inflight) {
|
|
16519
16534
|
throwIfAborted(signal);
|
|
16520
16535
|
_throwBackgroundUsageFailureState(backgroundUsageFailureState);
|
|
16521
|
-
const {
|
|
16536
|
+
const {
|
|
16537
|
+
result: toolResult,
|
|
16538
|
+
error: toolError,
|
|
16539
|
+
fatalError,
|
|
16540
|
+
} = await promise;
|
|
16541
|
+
if (fatalError) throw fatalError;
|
|
16522
16542
|
throwIfAborted(signal);
|
|
16523
16543
|
const taskAdvanced = taskProgressTracker.record(
|
|
16524
16544
|
call.function.name,
|
|
@@ -16961,6 +16981,7 @@ export async function* agentLoop(messages, options) {
|
|
|
16961
16981
|
} catch (err) {
|
|
16962
16982
|
if (
|
|
16963
16983
|
isEvolutionIngressFailure(err) ||
|
|
16984
|
+
isFormalBudgetError(err) ||
|
|
16964
16985
|
err?.runtimeLedgerPersistence === true
|
|
16965
16986
|
)
|
|
16966
16987
|
throw err;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as v,P as u,J as S,U as n,R as a,S as y,K as C,Q as x,V as w,_ as B,b as s}from"./vendor-Bn1JzzAn.js";import{_ as k}from"./index-CkqBoCiu.js";import"./icons-DG5UD-6K.js";const N={__name:"ChatBubbleRenderer",props:{event:{type:Object,required:!0}},setup(c,{expose:d}){d();const t=c,r=s(()=>{const e=t.event.content||{};return e.text||e.body||e.message||e.title||JSON.stringify(e).slice(0,200)}),i=s(()=>{const e=t.event.content||{};return e.from||e.sender||e.senderName||t.event.actor||"(unknown)"}),l=s(()=>{const e=(t.event.actor||"").toLowerCase();return e.includes("self")||e==="me"||e.endsWith("_self")}),o=s(()=>{const e=t.event.source.adapter||"";return e.startsWith("messaging-qq")?"magenta":e==="wechat"?"green":"blue"}),m=s(()=>{if(!t.event.occurredAt)return"";try{const e=new Date(t.event.occurredAt),p=e.getFullYear(),g=String(e.getMonth()+1).padStart(2,"0"),f=String(e.getDate()).padStart(2,"0"),h=String(e.getHours()).padStart(2,"0"),b=String(e.getMinutes()).padStart(2,"0");return`${p}-${g}-${f} ${h}:${b}`}catch{return""}}),_={props:t,messageText:r,actorLabel:i,isMine:l,adapterColor:o,formattedTime:m,computed:s};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}},T={class:"bubble"},M={class:"meta"},R={class:"actor"},V={class:"time"},q={class:"body"};function D(c,d,t,r,i,l){const o=v("a-tag");return u(),S("div",{class:B(["chat-row",{mine:r.isMine}])},[n("div",T,[n("div",M,[n("span",R,a(r.actorLabel),1),n("span",V,a(r.formattedTime),1)]),n("div",q,a(r.messageText),1),t.event.source.adapter?(u(),y(o,{key:0,class:"src",color:r.adapterColor},{default:C(()=>[x(a(t.event.source.adapter),1)]),_:1},8,["color"])):w("v-if",!0)])],2)}const j=k(N,[["render",D],["__scopeId","data-v-49238629"],["__file","/tmp/cc-web-panel-Phhog6/repo/packages/web-panel/src/components/pdh/renderers/ChatBubbleRenderer.vue"]]);export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as w,P as l,J as u,U as s,R as n,c as i,K as v,Q as _,V as g,b as o}from"./vendor-Bn1JzzAn.js";import{_ as S}from"./index-CkqBoCiu.js";import"./icons-DG5UD-6K.js";const k={__name:"OrderTableRenderer",props:{event:{type:Object,required:!0}},setup(p,{expose:r}){r();const a=p,e=o(()=>a.event.content||{}),d=o(()=>a.event.extra||{}),m=o(()=>d.value.merchant||e.value.merchant||e.value.counterparty||"—"),c=o(()=>e.value.title||e.value.name||e.value.itemName||e.value.text||"—"),y=o(()=>{const t=e.value.amount??e.value.price??e.value.total;return t==null?"—":`${e.value.currency||"¥"} ${typeof t=="number"?t.toFixed(2):t}`}),T=o(()=>d.value.orderNo||e.value.orderNo||e.value.orderId),f=o(()=>e.value.status||e.value.state),h=o(()=>{const t=(f.value||"").toLowerCase();return t.includes("成功")||t.includes("succe")||t.includes("paid")?"green":t.includes("退")||t.includes("refund")?"orange":t.includes("失败")||t.includes("fail")?"red":"default"}),b=o(()=>{if(!a.event.occurredAt)return"";const t=new Date(a.event.occurredAt);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}),x={props:a,c:e,e:d,merchantText:m,itemText:c,amountText:y,orderNo:T,statusText:f,statusColor:h,formattedTime:b,computed:o};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}},N={class:"order-card"},C={class:"head"},O={class:"time"},V={class:"row"},R={class:"val"},B={class:"row"},D={class:"val"},I={class:"row amount-row"},P={class:"val amount"},j={key:0,class:"row"},A={class:"val mono"},F={key:1,class:"row"};function M(p,r,a,e,d,m){const c=w("a-tag");return l(),u("div",N,[s("div",C,[s("span",O,n(e.formattedTime),1),i(c,{color:"gold"},{default:v(()=>[_(n(a.event.source.adapter),1)]),_:1}),i(c,null,{default:v(()=>[_(n(a.event.subtype),1)]),_:1})]),s("div",V,[r[0]||(r[0]=s("span",{class:"key"},"商户",-1)),s("span",R,n(e.merchantText),1)]),s("div",B,[r[1]||(r[1]=s("span",{class:"key"},"商品/项目",-1)),s("span",D,n(e.itemText),1)]),s("div",I,[r[2]||(r[2]=s("span",{class:"key"},"金额",-1)),s("span",P,n(e.amountText),1)]),e.orderNo?(l(),u("div",j,[r[3]||(r[3]=s("span",{class:"key"},"单号",-1)),s("span",A,n(e.orderNo),1)])):g("v-if",!0),e.statusText?(l(),u("div",F,[r[4]||(r[4]=s("span",{class:"key"},"状态",-1)),i(c,{color:e.statusColor},{default:v(()=>[_(n(e.statusText),1)]),_:1},8,["color"])])):g("v-if",!0)])}const K=S(k,[["render",M],["__scopeId","data-v-5ed5524d"],["__file","/tmp/cc-web-panel-Phhog6/repo/packages/web-panel/src/components/pdh/renderers/OrderTableRenderer.vue"]]);export{K as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as i,J as A,U as I,R as s,Q as r,c as t,K as a,V as _,S as x,o as oe,b as ee,r as u,P as p,F as ne,a2 as ge}from"./vendor-Bn1JzzAn.js";import{_ as we,b as re,u as ie,d}from"./index-CkqBoCiu.js";import{u as de}from"./useShellMode-CgR0wCYM.js";import{aN as ke,aO as Fe,aP as be,f as je,a5 as Ce,a8 as xe,at as Oe,R as Se}from"./icons-DG5UD-6K.js";const Pe={__name:"Projects",setup(se,{expose:l}){l();const{t:te}=re(),e=ie(),{isEmbedded:W}=de();async function w(o,f,ye,ae=8e3){if(W){const Z=await e.sendRaw({...f,type:o},ae);if(!Z?.ok){const $=Z?.error;throw new Error(typeof $=="string"?$:$?.message||`${o} failed`)}return Z.result}return e.executeJson(ye,ae)}const B=u(!1),y=u([]),O=u(""),S=u(""),P=u(!1),v=u(null),U=u([]),k=u(!1),E=u(!1),L=u(!1),F=u({name:"",description:"",type:"document",rootPath:""}),z=[{title:"ID",key:"id",width:110},{title:"名称",key:"name"},{title:"类型",key:"project_type",width:120},{title:"状态",key:"status",width:100},{title:"同步",key:"sync_status",width:100},{title:"更新",key:"updated_at",width:160},{title:"操作",key:"actions",width:180,fixed:"right"}],V=ee(()=>{const o={active:0,draft:0,completed:0,archived:0};for(const f of y.value)o[f.status]!==void 0&&(o[f.status]+=1);return o}),J=ee(()=>y.value.filter(o=>!(O.value&&o.status!==O.value||S.value&&!o.name.toLowerCase().includes(S.value.toLowerCase()))));function g(o){switch(o){case"active":return"green";case"draft":return"default";case"completed":return"cyan";case"archived":return"gold";default:return"default"}}function K(o){switch(o){case"synced":return"green";case"pending":return"orange";case"conflict":return"red";case"error":return"red";default:return"default"}}function Q(o){return!o&&o!==0?"-":new Date(typeof o=="number"?o:parseInt(o,10)).toLocaleString("zh-CN",{hour12:!1})}async function C(){B.value=!0;try{const o=await w("project.list",{limit:500},"project list --limit 500 --json",1e4);y.value=Array.isArray(o?.projects)?o.projects:Array.isArray(o)?o:[]}catch(o){d.error("加载失败: "+(o.message||o)),y.value=[]}finally{B.value=!1}}function G(o){return{onClick:()=>M(o)}}async function M(o){v.value=o,P.value=!0,k.value=!0,U.value=[];try{const f=await w("project.listFiles",{projectId:o.id,limit:200},`project list-files ${o.id} --json`,8e3);U.value=Array.isArray(f?.files)?f.files:[]}catch{U.value=[]}finally{k.value=!1}}async function H(o){try{(await w("project.delete",{id:o.id},`project delete ${o.id} --json`,8e3))?.ok?(d.success(`已删除项目 '${o.name}'`),P.value=!1,await C()):d.error("删除失败")}catch(f){d.error(f.message||String(f))}}function X(){F.value={name:"",description:"",type:"document",rootPath:""},E.value=!0}async function T(){if(!F.value.name.trim()){d.warning("请输入项目名称");return}L.value=!0;try{const o=await w("project.init",{name:F.value.name.trim(),description:F.value.description||null,projectType:F.value.type,rootPath:F.value.rootPath||null},`project init "${F.value.name.trim()}" --type ${F.value.type} --json`,8e3);o?.id?(d.success(`已创建项目 '${o.name}'`),E.value=!1,await C()):d.error("创建失败")}catch(o){d.error(o.message||String(o))}finally{L.value=!1}}const b=u(!1),D=u(!1),j=u({path:"",content:""}),h=u(!1),m=u(!1),R=u({path:""}),n=u(!1),c=u(null),q=u(""),Y=u(!1);function ue(){j.value={path:"",content:""},b.value=!0}function ce(){R.value={path:""},h.value=!0}async function N(){if(v.value){k.value=!0;try{const o=await w("project.listFiles",{projectId:v.value.id,limit:200},`project list-files ${v.value.id} --json`,8e3);U.value=Array.isArray(o?.files)?o.files:[]}catch(o){d.error("刷新文件失败: "+(o.message||o))}finally{k.value=!1}}}async function fe(){if(!j.value.path.trim()){d.warning("请输入文件路径");return}if(v.value){D.value=!0;try{const o=await w("project.createFile",{projectId:v.value.id,filePath:j.value.path.trim(),content:j.value.content||""},`project create-file ${v.value.id} "${j.value.path.trim()}" --json`,8e3);o?.id?(d.success(`已创建文件 '${o.file_name}'`),b.value=!1,await N(),await C()):d.error("创建文件失败")}catch(o){d.error(o.message||String(o))}finally{D.value=!1}}}async function pe(){if(!R.value.path.trim()){d.warning("请输入文件夹路径");return}if(v.value){m.value=!0;try{const o=await w("project.createFolder",{projectId:v.value.id,folderPath:R.value.path.trim()},`project create-folder ${v.value.id} "${R.value.path.trim()}" --json`,8e3);o?.id?(d.success(`已创建文件夹 '${o.file_name}'`),h.value=!1,await N(),await C()):d.error("创建文件夹失败")}catch(o){d.error(o.message||String(o))}finally{m.value=!1}}}async function ve(o){try{(await w("project.deleteFile",{fileId:o.id},`project delete-file ${o.id} --json`,8e3))?.deleted?(d.success(`已删除 '${o.file_name}'`),await N(),await C()):d.error("删除失败")}catch(f){d.error(f.message||String(f))}}async function me(o){if(o.is_folder){d.info("文件夹无内容可编辑");return}try{const f=await w("project.getFile",{fileId:o.id},`project get-file ${o.id} --json`,8e3);c.value=o,q.value=f?.content||"",n.value=!0}catch(f){d.error("读取文件失败: "+(f.message||f))}}async function _e(){if(c.value){Y.value=!0;try{(await w("project.writeFile",{fileId:c.value.id,content:q.value},`project write-file ${c.value.id} --json`,8e3))?.id?(d.success("已保存"),n.value=!1,await N()):d.error("保存失败")}catch(o){d.error(o.message||String(o))}finally{Y.value=!1}}}oe(()=>{C()});const le={t:te,ws:e,isEmbedded:W,callProjectTopic:w,loading:B,projects:y,statusFilter:O,nameFilter:S,detailOpen:P,detail:v,files:U,filesLoading:k,createOpen:E,creating:L,newProject:F,columns:z,countByStatus:V,filteredProjects:J,statusColor:g,syncColor:K,formatTime:Q,loadAll:C,onRowClick:G,openDetail:M,onDelete:H,onShowCreate:X,onCreate:T,createFileOpen:b,creatingFile:D,newFile:j,createFolderOpen:h,creatingFolder:m,newFolder:R,editFileOpen:n,editingFile:c,editFileContent:q,savingFile:Y,openCreateFile:ue,openCreateFolder:ce,refreshFiles:N,onCreateFile:fe,onCreateFolder:pe,onDeleteFile:ve,openEditFile:me,onSaveFile:_e,ref:u,computed:ee,onMounted:oe,get ReloadOutlined(){return Se},get PlusOutlined(){return Oe},get FolderOutlined(){return xe},get FileTextOutlined(){return Ce},get CheckCircleOutlined(){return je},get CheckSquareOutlined(){return be},get FileAddOutlined(){return Fe},get FolderAddOutlined(){return ke},get message(){return d},get useI18n(){return re},get useWsStore(){return ie},get useShellMode(){return de}};return Object.defineProperty(le,"__isScriptSetup",{enumerable:!1,value:!0}),le}},ze={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},he={class:"page-title"},Ae={class:"page-sub"},Ie={class:"filter-bar",style:{"margin-bottom":"12px",display:"flex",gap:"12px","align-items":"center"}},Ue={key:0,style:{"font-size":"12px",color:"#888"}},De={key:0,style:{color:"#888","font-size":"12px"}},Re={key:0},Te={key:1,style:{color:"#888"}},Be=["onClick"],Ee={key:0,style:{color:"#888","font-size":"12px"}};function Le(se,l,te,e,W,w){const B=i("router-link"),y=i("a-button"),O=i("a-space"),S=i("a-statistic"),P=i("a-card"),v=i("a-col"),U=i("a-row"),k=i("a-radio-button"),E=i("a-radio-group"),L=i("a-input-search"),F=i("a-alert"),z=i("a-tag"),V=i("a-popconfirm"),J=i("a-table"),g=i("a-descriptions-item"),K=i("a-descriptions"),Q=i("a-divider"),C=i("a-empty"),G=i("a-list-item"),M=i("a-list"),H=i("a-spin"),X=i("a-drawer"),T=i("a-input"),b=i("a-form-item"),D=i("a-textarea"),j=i("a-form"),h=i("a-modal"),m=i("a-select-option"),R=i("a-select");return p(),A("div",null,[I("div",ze,[I("div",null,[I("h2",he,s(e.t("projects.title")),1),I("p",Ae,[l[17]||(l[17]=r("桌面 / CLI / 手机 三端共享同一份项目数据,Phase 3d sync 自动同步 (",-1)),t(B,{to:"/project-init"},{default:a(()=>[...l[16]||(l[16]=[r("项目初始化 / 环境设置",-1)])]),_:1}),l[18]||(l[18]=r(")",-1))])]),t(O,null,{default:a(()=>[t(y,{loading:e.loading,onClick:e.loadAll},{icon:a(()=>[t(e.ReloadOutlined)]),default:a(()=>[l[19]||(l[19]=r(" 刷新 ",-1))]),_:1},8,["loading"]),t(y,{type:"primary",onClick:e.onShowCreate},{icon:a(()=>[t(e.PlusOutlined)]),default:a(()=>[l[20]||(l[20]=r(" 新建项目 ",-1))]),_:1})]),_:1})]),_(" Stats "),t(U,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:a(()=>[t(v,{xs:12,sm:8,lg:6},{default:a(()=>[t(P,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:a(()=>[t(S,{title:"总项目",value:e.projects.length,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:a(()=>[t(e.FolderOutlined)]),_:1},8,["value"])]),_:1})]),_:1}),t(v,{xs:12,sm:8,lg:6},{default:a(()=>[t(P,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:a(()=>[t(S,{title:"活跃",value:e.countByStatus.active,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:a(()=>[t(e.CheckCircleOutlined)]),_:1},8,["value"])]),_:1})]),_:1}),t(v,{xs:12,sm:8,lg:6},{default:a(()=>[t(P,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:a(()=>[t(S,{title:"草稿",value:e.countByStatus.draft,"value-style":{color:"#8c8c8c",fontSize:"20px"}},{prefix:a(()=>[t(e.FileTextOutlined)]),_:1},8,["value"])]),_:1})]),_:1}),t(v,{xs:12,sm:8,lg:6},{default:a(()=>[t(P,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:a(()=>[t(S,{title:"已完成",value:e.countByStatus.completed,"value-style":{color:"#13c2c2",fontSize:"20px"}},{prefix:a(()=>[t(e.CheckSquareOutlined)]),_:1},8,["value"])]),_:1})]),_:1})]),_:1}),_(" Filter "),I("div",Ie,[t(E,{value:e.statusFilter,"onUpdate:value":l[0]||(l[0]=n=>e.statusFilter=n),size:"small","button-style":"solid"},{default:a(()=>[t(k,{value:""},{default:a(()=>[...l[21]||(l[21]=[r("全部",-1)])]),_:1}),t(k,{value:"active"},{default:a(()=>[...l[22]||(l[22]=[r("活跃",-1)])]),_:1}),t(k,{value:"draft"},{default:a(()=>[...l[23]||(l[23]=[r("草稿",-1)])]),_:1}),t(k,{value:"completed"},{default:a(()=>[...l[24]||(l[24]=[r("已完成",-1)])]),_:1}),t(k,{value:"archived"},{default:a(()=>[...l[25]||(l[25]=[r("已归档",-1)])]),_:1})]),_:1},8,["value"]),t(L,{value:e.nameFilter,"onUpdate:value":l[1]||(l[1]=n=>e.nameFilter=n),placeholder:"按名称过滤",style:{"max-width":"260px"},"allow-clear":""},null,8,["value"])]),!e.projects.length&&!e.loading?(p(),x(F,{key:0,type:"info",message:"还没有项目",description:'运行 `cc project init <name>` 或点击右上角"新建项目"按钮创建。桌面 / CLI / 手机三端共享同一份数据。',"show-icon":"",style:{"margin-bottom":"16px"}})):_("v-if",!0),e.projects.length||e.loading?(p(),x(J,{key:1,columns:e.columns,"data-source":e.filteredProjects,loading:e.loading,pagination:{pageSize:20,showSizeChanger:!0},"row-key":"id","custom-row":e.onRowClick},{bodyCell:a(({column:n,record:c})=>[n.key==="id"?(p(),A("code",Ue,s(c.id.slice(0,8))+"…",1)):n.key==="name"?(p(),A(ne,{key:1},[I("strong",null,s(c.name),1),c.description?(p(),A("div",De,s(c.description),1)):_("v-if",!0)],64)):n.key==="project_type"?(p(),x(z,{key:2},{default:a(()=>[r(s(c.project_type),1)]),_:2},1024)):n.key==="status"?(p(),x(z,{key:3,color:e.statusColor(c.status)},{default:a(()=>[r(s(c.status),1)]),_:2},1032,["color"])):n.key==="sync_status"?(p(),x(z,{key:4,color:e.syncColor(c.sync_status)},{default:a(()=>[r(s(c.sync_status||"unknown"),1)]),_:2},1032,["color"])):n.key==="updated_at"?(p(),A(ne,{key:5},[r(s(e.formatTime(c.updated_at)),1)],64)):n.key==="actions"?(p(),x(O,{key:6,onClick:l[2]||(l[2]=ge(()=>{},["stop"]))},{default:a(()=>[t(y,{size:"small",onClick:q=>e.openDetail(c)},{default:a(()=>[...l[26]||(l[26]=[r("详情",-1)])]),_:1},8,["onClick"]),t(V,{title:`删除项目 '${c.name}' ?`,"ok-text":"删除","ok-type":"danger","cancel-text":"取消",onConfirm:q=>e.onDelete(c)},{default:a(()=>[t(y,{size:"small",danger:""},{default:a(()=>[...l[27]||(l[27]=[r("删除",-1)])]),_:1})]),_:1},8,["title","onConfirm"])]),_:2},1024)):_("v-if",!0)]),_:1},8,["data-source","loading"])):_("v-if",!0),_(" Detail drawer "),t(X,{open:e.detailOpen,"onUpdate:open":l[3]||(l[3]=n=>e.detailOpen=n),title:e.detail?.name||"项目详情",width:"640",placement:"right"},{default:a(()=>[e.detail?(p(),x(K,{key:0,column:1,bordered:"",size:"small"},{default:a(()=>[t(g,{label:"ID"},{default:a(()=>[I("code",null,s(e.detail.id),1)]),_:1}),t(g,{label:"名称"},{default:a(()=>[r(s(e.detail.name),1)]),_:1}),t(g,{label:"描述"},{default:a(()=>[r(s(e.detail.description||"-"),1)]),_:1}),t(g,{label:"类型"},{default:a(()=>[t(z,null,{default:a(()=>[r(s(e.detail.project_type),1)]),_:1})]),_:1}),t(g,{label:"状态"},{default:a(()=>[t(z,{color:e.statusColor(e.detail.status)},{default:a(()=>[r(s(e.detail.status),1)]),_:1},8,["color"])]),_:1}),t(g,{label:"同步状态"},{default:a(()=>[t(z,{color:e.syncColor(e.detail.sync_status)},{default:a(()=>[r(s(e.detail.sync_status||"unknown"),1)]),_:1},8,["color"])]),_:1}),t(g,{label:"用户"},{default:a(()=>[r(s(e.detail.user_id),1)]),_:1}),t(g,{label:"根路径"},{default:a(()=>[e.detail.root_path?(p(),A("code",Re,s(e.detail.root_path),1)):(p(),A("span",Te,"(无)"))]),_:1}),t(g,{label:"文件数"},{default:a(()=>[r(s(e.detail.file_count||0),1)]),_:1}),t(g,{label:"创建"},{default:a(()=>[r(s(e.formatTime(e.detail.created_at)),1)]),_:1}),t(g,{label:"更新"},{default:a(()=>[r(s(e.formatTime(e.detail.updated_at)),1)]),_:1})]),_:1})):_("v-if",!0),t(Q,null,{default:a(()=>[...l[28]||(l[28]=[r("文件",-1)])]),_:1}),_(" Sub-phase 7.3 (2026-05-17): 文件 CRUD toolbar "),t(O,{style:{"margin-bottom":"12px"}},{default:a(()=>[t(y,{size:"small",type:"primary",disabled:!e.detail,onClick:e.openCreateFile},{default:a(()=>[t(e.FileAddOutlined),l[29]||(l[29]=r(" 新建文件 ",-1))]),_:1},8,["disabled"]),t(y,{size:"small",disabled:!e.detail,onClick:e.openCreateFolder},{default:a(()=>[t(e.FolderAddOutlined),l[30]||(l[30]=r(" 新建文件夹 ",-1))]),_:1},8,["disabled"])]),_:1}),t(H,{spinning:e.filesLoading},{default:a(()=>[!e.files.length&&!e.filesLoading?(p(),x(C,{key:0,description:"无文件 (点上方按钮新建)"})):(p(),x(M,{key:1,size:"small","data-source":e.files},{renderItem:a(({item:n})=>[t(G,null,{extra:a(()=>[t(O,null,{default:a(()=>[n.file_size?(p(),A("span",Ee,s(n.file_size)+" B",1)):_("v-if",!0),t(V,{title:`删除 ${n.is_folder?"文件夹":"文件"} '${n.file_name}' ?`,"ok-text":"删除","ok-type":"danger","cancel-text":"取消",onConfirm:c=>e.onDeleteFile(n)},{default:a(()=>[t(y,{size:"small",danger:""},{default:a(()=>[...l[31]||(l[31]=[r("×",-1)])]),_:1})]),_:1},8,["title","onConfirm"])]),_:2},1024)]),default:a(()=>[I("span",{style:{cursor:"pointer"},onClick:c=>e.openEditFile(n)},s(n.is_folder?"📁":"📄")+" "+s(n.file_path),9,Be)]),_:2},1024)]),_:1},8,["data-source"]))]),_:1},8,["spinning"])]),_:1},8,["open","title"]),_(" Sub-phase 7.3: Create file modal "),t(h,{open:e.createFileOpen,"onUpdate:open":l[6]||(l[6]=n=>e.createFileOpen=n),title:"新建文件","confirm-loading":e.creatingFile,"ok-text":"创建","cancel-text":"取消",onOk:e.onCreateFile},{default:a(()=>[t(j,{layout:"vertical"},{default:a(()=>[t(b,{label:"文件路径(项目内)",required:""},{default:a(()=>[t(T,{value:e.newFile.path,"onUpdate:value":l[4]||(l[4]=n=>e.newFile.path=n),placeholder:"例如 README.md 或 src/main.kt"},null,8,["value"])]),_:1}),t(b,{label:"初始内容(可选)"},{default:a(()=>[t(D,{value:e.newFile.content,"onUpdate:value":l[5]||(l[5]=n=>e.newFile.content=n),rows:6,placeholder:"留空创建空文件"},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["open","confirm-loading"]),_(" Sub-phase 7.3: Create folder modal "),t(h,{open:e.createFolderOpen,"onUpdate:open":l[8]||(l[8]=n=>e.createFolderOpen=n),title:"新建文件夹","confirm-loading":e.creatingFolder,"ok-text":"创建","cancel-text":"取消",onOk:e.onCreateFolder},{default:a(()=>[t(j,{layout:"vertical"},{default:a(()=>[t(b,{label:"文件夹路径(项目内)",required:""},{default:a(()=>[t(T,{value:e.newFolder.path,"onUpdate:value":l[7]||(l[7]=n=>e.newFolder.path=n),placeholder:"例如 src/utils"},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["open","confirm-loading"]),_(" Sub-phase 7.3: Edit file content modal "),t(h,{open:e.editFileOpen,"onUpdate:open":l[10]||(l[10]=n=>e.editFileOpen=n),title:`编辑 ${e.editingFile?.file_name||""}`,"confirm-loading":e.savingFile,"ok-text":"保存","cancel-text":"取消",onOk:e.onSaveFile,width:"720"},{default:a(()=>[t(D,{value:e.editFileContent,"onUpdate:value":l[9]||(l[9]=n=>e.editFileContent=n),rows:18,"auto-size":{minRows:12,maxRows:24},style:{"font-family":"monospace"}},null,8,["value"])]),_:1},8,["open","title","confirm-loading"]),_(" Create modal "),t(h,{open:e.createOpen,"onUpdate:open":l[15]||(l[15]=n=>e.createOpen=n),title:"新建项目","confirm-loading":e.creating,"ok-text":"创建","cancel-text":"取消",onOk:e.onCreate},{default:a(()=>[t(j,{layout:"vertical"},{default:a(()=>[t(b,{label:"项目名称",required:""},{default:a(()=>[t(T,{value:e.newProject.name,"onUpdate:value":l[11]||(l[11]=n=>e.newProject.name=n),placeholder:"例如:旅行计划-上海"},null,8,["value"])]),_:1}),t(b,{label:"描述"},{default:a(()=>[t(D,{value:e.newProject.description,"onUpdate:value":l[12]||(l[12]=n=>e.newProject.description=n),rows:2},null,8,["value"])]),_:1}),t(b,{label:"类型"},{default:a(()=>[t(R,{value:e.newProject.type,"onUpdate:value":l[13]||(l[13]=n=>e.newProject.type=n)},{default:a(()=>[t(m,{value:"document"},{default:a(()=>[...l[32]||(l[32]=[r("文档 (document)",-1)])]),_:1}),t(m,{value:"data"},{default:a(()=>[...l[33]||(l[33]=[r("数据 (data)",-1)])]),_:1}),t(m,{value:"web"},{default:a(()=>[...l[34]||(l[34]=[r("Web",-1)])]),_:1}),t(m,{value:"app"},{default:a(()=>[...l[35]||(l[35]=[r("应用 (app)",-1)])]),_:1}),t(m,{value:"presentation"},{default:a(()=>[...l[36]||(l[36]=[r("演示文稿",-1)])]),_:1}),t(m,{value:"spreadsheet"},{default:a(()=>[...l[37]||(l[37]=[r("表格",-1)])]),_:1}),t(m,{value:"design"},{default:a(()=>[...l[38]||(l[38]=[r("设计",-1)])]),_:1}),t(m,{value:"code"},{default:a(()=>[...l[39]||(l[39]=[r("代码",-1)])]),_:1}),t(m,{value:"workflow"},{default:a(()=>[...l[40]||(l[40]=[r("工作流",-1)])]),_:1}),t(m,{value:"knowledge"},{default:a(()=>[...l[41]||(l[41]=[r("知识库",-1)])]),_:1})]),_:1},8,["value"])]),_:1}),t(b,{label:"根路径 (可选)"},{default:a(()=>[t(T,{value:e.newProject.rootPath,"onUpdate:value":l[14]||(l[14]=n=>e.newProject.rootPath=n),placeholder:"留空则仅元数据"},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["open","confirm-loading"])])}const We=we(Pe,[["render",Le],["__scopeId","data-v-019ac5aa"],["__file","/tmp/cc-web-panel-Phhog6/repo/packages/web-panel/src/views/Projects.vue"]]);export{We as default};
|