chainlesschain 0.162.160 → 0.162.161
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/web-panel/assets/{AIOps-CkRHjW8e.js → AIOps-DMn528q-.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-BP3MeNi2.js → ActionButton-D9ZcDCJL.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-CjbjQsOr.js → Analytics-A_K-8PX0.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-i0adH1M8.js → AppLayout-D4pFW3X6.js} +3 -3
- package/src/assets/web-panel/assets/{Artifacts-CCCG2GOU.js → Artifacts-Dz46COAd.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DrsgvwHC.js → Audit-cbMjbyg0.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-DkXNkbZM.js → BackgroundAgents-Dtf88GAj.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-DarTWCex.js → Backup-C5KRxn52.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-DaDzhcto.js → BaseInput-Dd2UK3BN.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-C4EzGw6V.js → Chat-lptKTFdG.js} +6 -6
- package/src/assets/web-panel/assets/ChatBubbleRenderer-C2KLtwHz.js +1 -0
- package/src/assets/web-panel/assets/{Checkbox-gddNgaQi.js → Checkbox-_yspG6rG.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BKldFWf9.js → Codegen-BGq_GAha.js} +1 -1
- package/src/assets/web-panel/assets/{Col-ChR-brDs.js → Col-CePor71g.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DlHtZX86.js → Community-CLOWhIT7.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BAhfcBpC.js → Compact-CivJt2vT.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-gIrKkm6m.js → Compliance-Btmo1GGE.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-BYnzLBO3.js → Cowork-Ct35OlG4.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-ByUDIljI.js → Cron-CTc2GmhB.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-DOdNbHFp.js → Crosschain-ZtiBETk1.js} +1 -1
- package/src/assets/web-panel/assets/{DID-BJHaNWD2.js → DID-BNqMQQXw.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-Drm_tClz.js → Dashboard-BmzZd-9V.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-CA1WLzGN.js → Dropdown-CMVgvP2M.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-Di1SKjNO.js → EmailListRenderer-CcqQFAfT.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-44Ve7ZFe.js → FamilyGuardDashboard-CTqB1_4V.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-CubPwv_N.js → Federation-CiKOOzlb.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-CsUFe5bU.js → FormItemContext-Wk-OT0gr.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-D7xRjPjZ.js → GenericCardRenderer-DbEQT6ue.js} +1 -1
- package/src/assets/web-panel/assets/{Git-D-Qx9dhO.js → Git-0ZvCPSD9.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-_YMYaU4n.js → Governance-CmVuKkPb.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-J7Yzh-K_.js → Inference-CTWE3Jwg.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-D37iI_Mo.js → KnowledgeGraph-CBEIF00L.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-oMTSYfGY.js → Logs-DLhxDwVG.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-DxywvhTU.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-DKUqYDaF.js → Marketplace-BgsCBrnc.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BEv3Gx61.js → McpTools-ClBUGDS2.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-CtA8XD2y.js → Memory-CnG_ZnYw.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-ug7c1mMj.js → MobileBridge-BUOAbR1Z.js} +1 -1
- package/src/assets/web-panel/assets/MobileProjects-Dnt_9-WB.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-WJaMs4i2.js → Mtc-CLjt4kCD.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-DXnK_-ru.js → MtcAudit-f24U9Aes.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-C4Ev7726.js → Multisig-GrmGQbSq.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-BMFb9_zk.js → NLProgramming-DADaWn-n.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-Bl93nvBX.js → Notes-xtf5RX6C.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-BN2W5cl6.js → NotificationSettings-Cd27Rgtx.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-Dxc9oN4o.js → OrderTableRenderer-fXRxlDjl.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-CAs48637.js → Organization-joCFlNB0.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-Bhq27Zoc.js → Overflow-B1HoURq0.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-D61-2542.js → P2P-DiwsKbT7.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-C1j4iUxz.js → PdhVaultBrowser-Xe-BsW6S.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-rJ2-fScM.js → Permissions-C23qi8kl.js} +3 -3
- package/src/assets/web-panel/assets/{PersonalDataHub-DFIlTok6.js → PersonalDataHub-BS1syX2f.js} +2 -2
- package/src/assets/web-panel/assets/{Pipeline-BjIgEWoZ.js → Pipeline-DRYwwDyh.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BQoH5wcX.js → Privacy-BQKaDHPH.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CYR_-_Ub.js → ProjectInit-BC6F9xiG.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-nkatCq-9.js → ProjectSettings-ClFPc1Nd.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-SS9uZKCl.js → Projects-Dn-f5aYe.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-BnKM9fsF.js → Providers-CLWuOUNt.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-Cfe82dbz.js → QrScannerModal-DiqULTxb.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-r1RbPufV.js → QuickAsk-9A03P-E_.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-CjCbM2WE.js → Recommend-CJZAnbq_.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-BuMGPH6V.js → RemoteSession-C9A1R77h.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-Bmj3NY1F.js → Reputation-BIZc6Rky.js} +1 -1
- package/src/assets/web-panel/assets/{Row-BIsNcE_1.js → Row-DfIPNtuG.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BObmojD2.js → RssFeed-C5znFcQ1.js} +2 -2
- package/src/assets/web-panel/assets/{Search-BRmbkQNS.js → Search-DSs2z3OX.js} +1 -1
- package/src/assets/web-panel/assets/{Security-_rF3DRpY.js → Security-CV6LcrLY.js} +3 -3
- package/src/assets/web-panel/assets/{Services-D0If9ZV4.js → Services-cmhoX0Xj.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-o7zIksUg.js → Skeleton-tCsg2po7.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-oUR7zi9u.js → Skills-BK1KUDiy.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-fqKyGi03.js → Sla-yRgyeA82.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-B1wZ_gxx.js → SpeechSettings-c1mo1mlp.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-B3qJWYXq.js → SyncSettings-koIAfuT3.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-BH5_dUfr.js → Tasks-DkkreAaB.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CCIVpjRP.js → Templates-fy5Ctf9M.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-2GZtTGnB.js → Tenant-Bw70Jf6S.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BlMkfs_u.js → Terminal-BKh6Rx-4.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-U6hi5OMc.js → TimelineRenderer-Dg54WP0c.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-C-_BerGJ.js → Tokens-BvvD5SxJ.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DaKzBgN3.js → Trigger-B7Ug9x4e.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-CLvcsco3.js → Trust-BjvuMORY.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-BFn_Y1zZ.js → UkeySign-CZqhkx8p.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-B0V18dLT.js → VideoEditing-ClR50lhX.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-BbmP7Imu.js → Wallet-DlfppYjx.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-Dewj_0kt.js → WebAuthn-BirgVr8B.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-DOxz3Lwa.js → WorkflowEditor-B8DP_bax.js} +1 -1
- package/src/assets/web-panel/assets/{chat-B1OIpZnh.js → chat-DA8AUZzL.js} +1 -1
- package/src/assets/web-panel/assets/{colors-CSGNVdri.js → colors-C38pLGp1.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-8S0vcg0u.js → compact-item-81rtr98o.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-vZyc27TN.js → createContext-D34ixq8t.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-CHDIEOeN.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-DWw3-UhA.js → hasIn-D4bzqTrZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-dxocDVD_.js → index-9qoVpPt6.js} +1 -1
- package/src/assets/web-panel/assets/{index-xx5M5Rbj.js → index-B0QArPQt.js} +1 -1
- package/src/assets/web-panel/assets/{index-DtHWHJnj.js → index-B8mkLM4x.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLgkAhEE.js → index-BIP62a6r.js} +1 -1
- package/src/assets/web-panel/assets/{index-tr1x96W9.js → index-BP-zkXK8.js} +1 -1
- package/src/assets/web-panel/assets/{index-CfEvacz7.js → index-BS3M5H9V.js} +1 -1
- package/src/assets/web-panel/assets/{index-D1i_8oop.js → index-BXd2_LmH.js} +1 -1
- package/src/assets/web-panel/assets/{index-BDHyovnK.js → index-BlxEphl7.js} +1 -1
- package/src/assets/web-panel/assets/{index-CLPr2vC_.js → index-BqIhLAbA.js} +1 -1
- package/src/assets/web-panel/assets/{index-BQssf0EQ.js → index-BtGxuQrO.js} +1 -1
- package/src/assets/web-panel/assets/{index-BuB5P0TR.js → index-BvD7b2IK.js} +1 -1
- package/src/assets/web-panel/assets/{index-DeCS12Mh.js → index-BvL_3J_n.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeBv896m.js → index-COe_cOLJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dc40pX3F.js → index-CP5alL4t.js} +1 -1
- package/src/assets/web-panel/assets/index-CY1NURWZ.js +1 -0
- package/src/assets/web-panel/assets/{index-B4pP2ycr.js → index-CbhE3j5j.js} +1 -1
- package/src/assets/web-panel/assets/{index-DKwl1AkQ.js → index-Cd3KuNK5.js} +1 -1
- package/src/assets/web-panel/assets/{index-BZnauCqN.js → index-CoVgZw_b.js} +1 -1
- package/src/assets/web-panel/assets/{index-BwKrTVV0.js → index-CuS-UPoj.js} +1 -1
- package/src/assets/web-panel/assets/{index-Q6oyLnKC.js → index-D0Ih7Hwn.js} +1 -1
- package/src/assets/web-panel/assets/{index-CB2MOS_8.js → index-D3zCCZRS.js} +3 -3
- package/src/assets/web-panel/assets/{index-BdyokEau.js → index-D6GfvEQG.js} +1 -1
- package/src/assets/web-panel/assets/{index-DPgY5GLy.js → index-DBFSo1NF.js} +1 -1
- package/src/assets/web-panel/assets/{index-CFQWZvak.js → index-DFHa1HIg.js} +1 -1
- package/src/assets/web-panel/assets/{index-BjC-TrOb.js → index-DFyWKOBD.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dg0Izipr.js → index-DMgnRwrK.js} +1 -1
- package/src/assets/web-panel/assets/{index-BKEmQQvR.js → index-DUQLXLQM.js} +1 -1
- package/src/assets/web-panel/assets/{index-DLAvUtOH.js → index-D_2VYPr1.js} +1 -1
- package/src/assets/web-panel/assets/{index-D8qXVfoV.js → index-DakfFZ-k.js} +1 -1
- package/src/assets/web-panel/assets/{index-DcfLXAW7.js → index-Ddk0e_Pi.js} +1 -1
- package/src/assets/web-panel/assets/{index-BoIPHP4R.js → index-DkHqMnn3.js} +1 -1
- package/src/assets/web-panel/assets/{index-CJgKP2cm.js → index-Dmo3dFHb.js} +1 -1
- package/src/assets/web-panel/assets/index-DokUYqpq.js +1 -0
- package/src/assets/web-panel/assets/{index-C6r27A-o.js → index-DvfCEJG-.js} +1 -1
- package/src/assets/web-panel/assets/{index-CbZqw7pg.js → index-E1OJRXs4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BkWd6YL7.js → index-F76w1NiL.js} +1 -1
- package/src/assets/web-panel/assets/{index-t-q3rkVm.js → index-ZRJRItm0.js} +1 -1
- package/src/assets/web-panel/assets/{index-CwXBblm-.js → index-fI5sXMLg.js} +1 -1
- package/src/assets/web-panel/assets/{index-CI3slBKI.js → index-tKiC8T-4.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-Di5YFId0.js → initDefaultProps-ByyvflIR.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BVSN0aeL.js → motion-B3FQm2By.js} +1 -1
- package/src/assets/web-panel/assets/{move-DHNiaP2l.js → move-BSfns6Ef.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-xJPf3gQD.js → mtc-parser-CTG1Ieri.js} +1 -1
- package/src/assets/web-panel/assets/{omit-C7qzUdkN.js → omit-DObM_2j6.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-pSpjg3Le.js → pickAttrs-DOfelQ1t.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-cs_jL_UC.js → placementArrow-CHZILds_.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DkS_Zs4r.js → responsiveObserve-REbucKSx.js} +1 -1
- package/src/assets/web-panel/assets/{slide-B5O1Kpxo.js → slide-C6EZzD7o.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-BX02GnZp.js → statusUtils-BxkWS-g3.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-EmBYRftd.js → styleChecker-Chklyoq6.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-ZGzN1cU8.js → useFlexGapSupport-CRVwKrrI.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CfP7M1m7.js → useFs-DV24ik_J.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CbIPHgNh.js → usePersonalDataHub-C7vIo4Pg.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-7xh0If_O.js → vnode-By-v5GlF.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-DmitvTR2.js → zoom-B1w9Am3r.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/agenda.js +15 -1
- package/src/commands/agent.js +7 -0
- package/src/commands/background-session.js +16 -2
- package/src/data/changelog.json +7 -2
- package/src/gateways/ws/background-agent-protocol.js +88 -14
- package/src/lib/agent-authority.js +251 -0
- package/src/lib/background-agent-phase.js +100 -0
- package/src/lib/background-agent-supervisor.js +288 -8
- package/src/lib/backpressure-policy.js +105 -0
- package/src/lib/capability-negotiation.js +212 -0
- package/src/lib/credential-guard.js +11 -0
- package/src/lib/credential-proxy.js +182 -0
- package/src/lib/event-seq-replay.js +167 -0
- package/src/lib/goal-condition-engine.js +369 -0
- package/src/lib/headless-manifest.js +13 -0
- package/src/lib/ide-context.js +53 -14
- package/src/lib/project-instructions.js +98 -1
- package/src/lib/remote-path-mapping.js +229 -0
- package/src/lib/schedule-planner.js +136 -0
- package/src/repl/bg-dashboard.js +13 -12
- package/src/runtime/agent-core.js +11 -4
- package/src/runtime/headless-stream.js +195 -11
- package/src/runtime/system-prompt.js +3 -0
- package/src/workers/background-agent-worker.js +37 -2
- package/src/assets/web-panel/assets/ChatBubbleRenderer-lkavIWMS.js +0 -1
- package/src/assets/web-panel/assets/MarkdownRenderer-BqaPmC0W.js +0 -1
- package/src/assets/web-panel/assets/MobileProjects-BpX5g9It.js +0 -1
- package/src/assets/web-panel/assets/devWarning-DYEZcY55.js +0 -1
- package/src/assets/web-panel/assets/index-DmVFfcNR.js +0 -1
- package/src/assets/web-panel/assets/index-x7YyhMUa.js +0 -1
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* not duplicate (or fork) `runAgentHeadless`'s internals.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { randomUUID } from "node:crypto";
|
|
20
|
+
import {
|
|
21
|
+
approvalBindingDigest,
|
|
22
|
+
verifyApprovalBinding,
|
|
23
|
+
} from "../lib/agent-authority.js";
|
|
19
24
|
import { bootstrap } from "./bootstrap.js";
|
|
20
25
|
import { buildSystemPrompt, agentLoop as coreAgentLoop } from "./agent-core.js";
|
|
21
26
|
import { composeSystemPrompt } from "./system-prompt.js";
|
|
@@ -48,7 +53,13 @@ import {
|
|
|
48
53
|
computePolicyDigest,
|
|
49
54
|
computeToolsHash,
|
|
50
55
|
buildLoadedSources,
|
|
56
|
+
buildAgentCapabilities,
|
|
51
57
|
} from "../lib/headless-manifest.js";
|
|
58
|
+
import {
|
|
59
|
+
negotiateProtocol,
|
|
60
|
+
buildServerOffer,
|
|
61
|
+
applyNegotiationToGate,
|
|
62
|
+
} from "../lib/capability-negotiation.js";
|
|
52
63
|
import { IterationBudget } from "../lib/iteration-budget.js";
|
|
53
64
|
import { CostBudget } from "../lib/cost-budget.js";
|
|
54
65
|
import {
|
|
@@ -86,6 +97,30 @@ export function resolveStreamCoalesceMs(options = {}, env = {}) {
|
|
|
86
97
|
return n;
|
|
87
98
|
}
|
|
88
99
|
|
|
100
|
+
/** Basic wire-safe trace-id sanitizer: keep only id-friendly chars, cap length
|
|
101
|
+
* (so an injected id can't smuggle whitespace/newlines into NDJSON or blow up
|
|
102
|
+
* a log line). Non-string / empty after trimming → falsy so a fresh one mints. */
|
|
103
|
+
function sanitizeTraceId(value) {
|
|
104
|
+
if (typeof value !== "string") return null;
|
|
105
|
+
const cleaned = value.trim().replace(/[^A-Za-z0-9._:-]/g, "");
|
|
106
|
+
return cleaned ? cleaned.slice(0, 128) : null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Resolve the run's cross-event trace id (additive protocol-v1, §1.2.1).
|
|
111
|
+
* Precedence: explicit `options.traceId` > `CC_TRACE_ID` env > a freshly
|
|
112
|
+
* minted per-process id. Callers may inject `deps.genTraceId` for
|
|
113
|
+
* deterministic tests. The result is sanitized so an externally supplied id
|
|
114
|
+
* stays a safe single NDJSON token.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveTraceId(options = {}, env = {}, deps = {}) {
|
|
117
|
+
const supplied =
|
|
118
|
+
sanitizeTraceId(options.traceId) || sanitizeTraceId(env.CC_TRACE_ID);
|
|
119
|
+
if (supplied) return supplied;
|
|
120
|
+
const gen = deps.genTraceId || (() => `tr-${randomUUID()}`);
|
|
121
|
+
return gen();
|
|
122
|
+
}
|
|
123
|
+
|
|
89
124
|
/**
|
|
90
125
|
* Coalescer for the NDJSON output stream. Every line still flows through `emit`,
|
|
91
126
|
* but consecutive partial-message text/thinking deltas are buffered and flushed
|
|
@@ -97,14 +132,41 @@ export function resolveStreamCoalesceMs(options = {}, env = {}) {
|
|
|
97
132
|
*
|
|
98
133
|
* The flush timer is `unref()`d so it never holds the process open. Pure aside
|
|
99
134
|
* from the injected `writeOut`/timer seams, so it unit-tests deterministically.
|
|
135
|
+
*
|
|
136
|
+
* Every emitted NDJSON line is stamped with a monotonic 1-based `seq`
|
|
137
|
+
* (additive protocol-v1 field, agent-sdk docs/PROTOCOL.md §1.2.1) — the
|
|
138
|
+
* coalescer is the single output choke point, so numbering here covers every
|
|
139
|
+
* line including batched delta runs (one seq per LINE, not per token).
|
|
140
|
+
* `stampSeq:false` restores the unstamped legacy output.
|
|
141
|
+
*
|
|
142
|
+
* When a `traceId` is provided, every line is ALSO stamped with `trace_id` —
|
|
143
|
+
* a run-scoped cross-event correlation id (additive protocol-v1, §1.2.1). It
|
|
144
|
+
* is opt-in (default: absent, legacy shape) so the IDE bridge can thread its
|
|
145
|
+
* own id end-to-end (CC_TRACE_ID / --trace-id) while unstamped callers stay
|
|
146
|
+
* byte-identical.
|
|
100
147
|
*/
|
|
101
148
|
export function createStreamCoalescer({
|
|
102
149
|
writeOut,
|
|
103
150
|
coalesceMs = 50,
|
|
104
151
|
setTimer,
|
|
105
152
|
clearTimer,
|
|
153
|
+
stampSeq = true,
|
|
154
|
+
traceId = null,
|
|
155
|
+
fieldGate = null,
|
|
106
156
|
} = {}) {
|
|
107
|
-
|
|
157
|
+
let seq = 0;
|
|
158
|
+
// `fieldGate` (if provided) is read LIVE per line so a capability
|
|
159
|
+
// negotiation arriving mid-stream (client `hello`) can suppress an additive
|
|
160
|
+
// field the client said it can't parse. Absent / undefined key = stamp (so
|
|
161
|
+
// the default path is byte-for-byte unchanged); only an explicit `false`
|
|
162
|
+
// suppresses. See lib/capability-negotiation.js applyNegotiationToGate.
|
|
163
|
+
const gateOn = (field) => !fieldGate || fieldGate[field] !== false;
|
|
164
|
+
const rawEmit = (obj) => {
|
|
165
|
+
let line = obj;
|
|
166
|
+
if (traceId && gateOn("trace_id")) line = { ...line, trace_id: traceId };
|
|
167
|
+
if (stampSeq && gateOn("seq")) line = { ...line, seq: ++seq };
|
|
168
|
+
writeOut(JSON.stringify(line) + "\n");
|
|
169
|
+
};
|
|
108
170
|
const startTimer =
|
|
109
171
|
setTimer ||
|
|
110
172
|
((fn, ms) => {
|
|
@@ -242,6 +304,19 @@ export function parseInputEvent(line) {
|
|
|
242
304
|
} catch {
|
|
243
305
|
return { error: `invalid JSON line: ${trimmed.slice(0, 80)}` };
|
|
244
306
|
}
|
|
307
|
+
// Capability handshake (agent-sdk docs/PROTOCOL.md §1.3): an optional first
|
|
308
|
+
// line by which the client announces the protocol range + wire features it
|
|
309
|
+
// understands, so the CLI can negotiate a common level and step down on
|
|
310
|
+
// disagreement. {"type":"hello","protocol_version":2,"features":[...]}
|
|
311
|
+
if (obj && typeof obj === "object" && obj.type === "hello") {
|
|
312
|
+
const offer = {};
|
|
313
|
+
if (obj.protocol_version !== undefined)
|
|
314
|
+
offer.protocolVersion = obj.protocol_version;
|
|
315
|
+
if (obj.min_protocol_version !== undefined)
|
|
316
|
+
offer.minProtocolVersion = obj.min_protocol_version;
|
|
317
|
+
if (obj.features !== undefined) offer.features = obj.features;
|
|
318
|
+
return { hello: offer };
|
|
319
|
+
}
|
|
245
320
|
// Plan-mode control events (chat-panel plan UI):
|
|
246
321
|
// {"type":"plan","action":"enter"|"approve"|"reject"}
|
|
247
322
|
if (obj && typeof obj === "object" && obj.type === "plan") {
|
|
@@ -264,7 +339,17 @@ export function parseInputEvent(line) {
|
|
|
264
339
|
// {"type":"approval","id":"appr-1","approve":true|false}
|
|
265
340
|
if (obj && typeof obj === "object" && obj.type === "approval") {
|
|
266
341
|
if (!obj.id) return null;
|
|
267
|
-
return {
|
|
342
|
+
return {
|
|
343
|
+
approval: {
|
|
344
|
+
id: String(obj.id),
|
|
345
|
+
approve: obj.approve === true,
|
|
346
|
+
// Optional approval binding (authority §"权限来源与跨 Agent 授权边界"):
|
|
347
|
+
// when present it must match the digest the matching approval_request
|
|
348
|
+
// advertised, so a stale/mis-routed/param-substituted verdict can't
|
|
349
|
+
// green-light a different tool call. Absent → legacy behavior.
|
|
350
|
+
binding: typeof obj.binding === "string" ? obj.binding : null,
|
|
351
|
+
},
|
|
352
|
+
};
|
|
268
353
|
}
|
|
269
354
|
// Answer to an ask_user_question (panel QuickPick for interactive questions):
|
|
270
355
|
// {"type":"answer","id":"q-1","answer":<string|string[]|null>}
|
|
@@ -446,7 +531,11 @@ export async function* readJsonLines(input, opts = {}) {
|
|
|
446
531
|
* Run a single turn through the core agent loop, emitting NDJSON events.
|
|
447
532
|
* Returns the turn outcome so the caller can grow history + the result line.
|
|
448
533
|
*/
|
|
449
|
-
async function runTurn(
|
|
534
|
+
async function runTurn(
|
|
535
|
+
messages,
|
|
536
|
+
loopOptions,
|
|
537
|
+
{ runLoop, emit, costBudget, nextToolUseId },
|
|
538
|
+
) {
|
|
450
539
|
const usage = {
|
|
451
540
|
input_tokens: 0,
|
|
452
541
|
output_tokens: 0,
|
|
@@ -482,16 +571,31 @@ async function runTurn(messages, loopOptions, { runLoop, emit, costBudget }) {
|
|
|
482
571
|
}
|
|
483
572
|
for await (const event of runLoop(messages, loopOptions)) {
|
|
484
573
|
switch (event.type) {
|
|
485
|
-
case "tool-executing":
|
|
486
|
-
|
|
487
|
-
|
|
574
|
+
case "tool-executing": {
|
|
575
|
+
// Additive protocol-v1 correlation id ("tu-<n>", session-scoped —
|
|
576
|
+
// agent-sdk docs/PROTOCOL.md §1.2.1): the matching tool_result below
|
|
577
|
+
// echoes the same id so UIs can pair calls without adjacency.
|
|
578
|
+
const toolUseId = nextToolUseId ? nextToolUseId() : undefined;
|
|
579
|
+
toolCalls.push({ id: toolUseId, tool: event.tool, args: event.args });
|
|
580
|
+
emit({
|
|
581
|
+
type: "tool_use",
|
|
582
|
+
...(toolUseId ? { id: toolUseId } : {}),
|
|
583
|
+
tool: event.tool,
|
|
584
|
+
args: event.args,
|
|
585
|
+
});
|
|
488
586
|
break;
|
|
587
|
+
}
|
|
489
588
|
case "tool-result": {
|
|
490
589
|
const err = event.error || event.result?.error || null;
|
|
491
|
-
|
|
492
|
-
|
|
590
|
+
// The loop runs tools serially, so this result settles the most
|
|
591
|
+
// recent tool_use (same adjacency rule the is_error attribution
|
|
592
|
+
// below has always used).
|
|
593
|
+
const lastCall =
|
|
594
|
+
toolCalls.length > 0 ? toolCalls[toolCalls.length - 1] : null;
|
|
595
|
+
if (lastCall) lastCall.is_error = Boolean(err);
|
|
493
596
|
emit({
|
|
494
597
|
type: "tool_result",
|
|
598
|
+
...(lastCall?.id ? { id: lastCall.id } : {}),
|
|
495
599
|
tool: event.tool,
|
|
496
600
|
is_error: Boolean(err),
|
|
497
601
|
error: err,
|
|
@@ -667,6 +771,18 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
667
771
|
if (!deps.writeOut && !deps.writeErr) {
|
|
668
772
|
installPipeSafety();
|
|
669
773
|
}
|
|
774
|
+
// Run-scoped cross-event trace id (additive protocol-v1, docs/PROTOCOL.md
|
|
775
|
+
// §1.2.1): one id stamped on EVERY stdout line so a consumer can correlate
|
|
776
|
+
// the whole run across Webview → Bridge → CLI logs, transcripts and
|
|
777
|
+
// diagnostic bundles. The IDE bridge may thread its own id through
|
|
778
|
+
// `--trace-id` / options.traceId / CC_TRACE_ID; otherwise a per-process id
|
|
779
|
+
// is minted (unique even when two runs resume the same session_id).
|
|
780
|
+
const traceId = resolveTraceId(options, process.env, deps);
|
|
781
|
+
// Live field-gate for the capability handshake (docs/PROTOCOL.md §1.3): a
|
|
782
|
+
// client `hello` narrowing the wire features flips these to suppress the
|
|
783
|
+
// additive fields it can't parse. All true by default = current behavior
|
|
784
|
+
// byte-for-byte; the coalescer reads it per line.
|
|
785
|
+
const fieldGate = { seq: true, trace_id: true, tool_use_id: true };
|
|
670
786
|
// Batch consecutive partial-message text/thinking deltas into one stream_event
|
|
671
787
|
// line (Claude-Code 2.1.191 streaming-CPU optimization). `emit` flushes any
|
|
672
788
|
// pending deltas before writing a non-delta line, so ordering is preserved;
|
|
@@ -676,6 +792,8 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
676
792
|
createStreamCoalescer({
|
|
677
793
|
writeOut,
|
|
678
794
|
coalesceMs: resolveStreamCoalesceMs(options, process.env),
|
|
795
|
+
traceId,
|
|
796
|
+
fieldGate,
|
|
679
797
|
});
|
|
680
798
|
const emit = streamCoalescer.emit;
|
|
681
799
|
|
|
@@ -743,9 +861,32 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
743
861
|
Number(process.env.CC_APPROVAL_TIMEOUT_MS) > 0
|
|
744
862
|
? Number(process.env.CC_APPROVAL_TIMEOUT_MS)
|
|
745
863
|
: 120000;
|
|
746
|
-
const settleApproval = (id, approve, via) => {
|
|
864
|
+
const settleApproval = (id, approve, via, incomingBinding = null) => {
|
|
747
865
|
const p = pendingApprovals.get(id);
|
|
748
866
|
if (!p) return;
|
|
867
|
+
// Approval binding (authority §"权限来源与跨 Agent 授权边界"): an *approve*
|
|
868
|
+
// verdict that carries a binding which does NOT match the one the request
|
|
869
|
+
// advertised is stale / mis-routed / argument-tampered — reject it (deny,
|
|
870
|
+
// fail closed) instead of green-lighting a different or changed tool call.
|
|
871
|
+
// A verdict with no binding stays backward-compatible; a deny always wins.
|
|
872
|
+
if (
|
|
873
|
+
approve === true &&
|
|
874
|
+
incomingBinding &&
|
|
875
|
+
p.binding &&
|
|
876
|
+
!verifyApprovalBinding(p.binding, incomingBinding)
|
|
877
|
+
) {
|
|
878
|
+
pendingApprovals.delete(id);
|
|
879
|
+
clearTimeout(p.timer);
|
|
880
|
+
emit({
|
|
881
|
+
type: "approval_resolved",
|
|
882
|
+
id,
|
|
883
|
+
approved: false,
|
|
884
|
+
via: "binding-mismatch",
|
|
885
|
+
session_id: sessionId,
|
|
886
|
+
});
|
|
887
|
+
p.resolve(false);
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
749
890
|
pendingApprovals.delete(id);
|
|
750
891
|
clearTimeout(p.timer);
|
|
751
892
|
emit({
|
|
@@ -760,12 +901,22 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
760
901
|
const interactiveConfirm = (ctx = {}) =>
|
|
761
902
|
new Promise((resolve) => {
|
|
762
903
|
const id = `appr-${++approvalSeq}`;
|
|
904
|
+
// Bind this approval request to the exact call it authorizes: the request
|
|
905
|
+
// id, its normalized arguments, and the policy/rule in force. The digest
|
|
906
|
+
// rides on `approval_request` so a UI/relay can echo it back on approve,
|
|
907
|
+
// letting settleApproval reject a verdict meant for a different call.
|
|
908
|
+
const binding = approvalBindingDigest({
|
|
909
|
+
toolCallId: id,
|
|
910
|
+
args:
|
|
911
|
+
ctx.args ?? (ctx.command != null ? { command: ctx.command } : null),
|
|
912
|
+
policyDigest: ctx.rule || ctx.riskLevel || ctx.risk || null,
|
|
913
|
+
});
|
|
763
914
|
const timer = setTimeout(
|
|
764
915
|
() => settleApproval(id, false, "timeout"),
|
|
765
916
|
approvalTimeoutMs,
|
|
766
917
|
);
|
|
767
918
|
timer.unref?.();
|
|
768
|
-
pendingApprovals.set(id, { resolve, timer });
|
|
919
|
+
pendingApprovals.set(id, { resolve, timer, binding });
|
|
769
920
|
emit({
|
|
770
921
|
type: "approval_request",
|
|
771
922
|
id,
|
|
@@ -775,6 +926,7 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
775
926
|
risk: ctx.riskLevel || ctx.risk || null,
|
|
776
927
|
rule: ctx.rule || null,
|
|
777
928
|
reason: ctx.reason || null,
|
|
929
|
+
binding,
|
|
778
930
|
});
|
|
779
931
|
});
|
|
780
932
|
|
|
@@ -1235,6 +1387,13 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1235
1387
|
|
|
1236
1388
|
let turns = 0;
|
|
1237
1389
|
let sawError = false;
|
|
1390
|
+
// Session-scoped tool-call correlation ids ("tu-<n>", additive protocol-v1
|
|
1391
|
+
// field): one counter across ALL turns so ids never repeat within a session.
|
|
1392
|
+
// Gated by the capability handshake (docs/PROTOCOL.md §1.3): a client that
|
|
1393
|
+
// negotiated tool_use_id off gets undefined (no `id` field emitted).
|
|
1394
|
+
let toolUseCounter = 0;
|
|
1395
|
+
const nextToolUseId = () =>
|
|
1396
|
+
fieldGate.tool_use_id === false ? undefined : `tu-${++toolUseCounter}`;
|
|
1238
1397
|
// Version-skew notice (friendly reminder): a chat-panel agent process is
|
|
1239
1398
|
// long-lived, so if cc was updated on disk while it kept running, it's still
|
|
1240
1399
|
// executing stale in-memory code (a fixed bug then looks "not fixed"). Checked
|
|
@@ -1263,6 +1422,30 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1263
1422
|
for await (const line of readJsonLines(input)) {
|
|
1264
1423
|
const parsed = parseInputEvent(line);
|
|
1265
1424
|
if (parsed == null) continue;
|
|
1425
|
+
if (parsed.hello) {
|
|
1426
|
+
// Capability handshake (docs/PROTOCOL.md §1.3): negotiate the client's
|
|
1427
|
+
// offer against this CLI's, apply the agreed feature set to the live
|
|
1428
|
+
// field-gate, and echo the result. Never queued (it's out-of-band
|
|
1429
|
+
// control, like interrupt/approval). Incompatible (ok:false) leaves
|
|
1430
|
+
// the gate untouched — the CLI keeps its safe baseline.
|
|
1431
|
+
const negotiated = negotiateProtocol(
|
|
1432
|
+
buildServerOffer(buildAgentCapabilities()),
|
|
1433
|
+
parsed.hello,
|
|
1434
|
+
);
|
|
1435
|
+
applyNegotiationToGate(negotiated, fieldGate);
|
|
1436
|
+
emit({
|
|
1437
|
+
type: "system",
|
|
1438
|
+
subtype: "negotiated",
|
|
1439
|
+
session_id: sessionId,
|
|
1440
|
+
protocol_version: negotiated.agreedVersion,
|
|
1441
|
+
features: negotiated.features,
|
|
1442
|
+
downgraded: negotiated.downgraded,
|
|
1443
|
+
disabled_features: negotiated.disabledFeatures,
|
|
1444
|
+
ok: negotiated.ok,
|
|
1445
|
+
reason: negotiated.reason,
|
|
1446
|
+
});
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1266
1449
|
if (parsed.interrupt) {
|
|
1267
1450
|
currentAbort?.abort();
|
|
1268
1451
|
continue;
|
|
@@ -1273,6 +1456,7 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1273
1456
|
parsed.approval.id,
|
|
1274
1457
|
parsed.approval.approve,
|
|
1275
1458
|
parsed.approval.approve ? "user-approve" : "user-deny",
|
|
1459
|
+
parsed.approval.binding,
|
|
1276
1460
|
);
|
|
1277
1461
|
continue;
|
|
1278
1462
|
}
|
|
@@ -1735,7 +1919,7 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1735
1919
|
// Resume-degenerate role merge for the first live model call only.
|
|
1736
1920
|
mergeRoles: mergeRolesThisTurn,
|
|
1737
1921
|
},
|
|
1738
|
-
{ runLoop, emit, costBudget },
|
|
1922
|
+
{ runLoop, emit, costBudget, nextToolUseId },
|
|
1739
1923
|
);
|
|
1740
1924
|
} catch (err) {
|
|
1741
1925
|
currentAbort = null;
|
|
@@ -70,6 +70,9 @@ export function composeSystemPrompt(base, opts = {}) {
|
|
|
70
70
|
cwd,
|
|
71
71
|
home: opts.projectMemoryHome,
|
|
72
72
|
deps: opts.projectMemoryDeps,
|
|
73
|
+
// Large-monorepo reduction lever: subtrees whose instruction/rule/@import
|
|
74
|
+
// files never load (config `instructionExcludes`, forwarded by the caller).
|
|
75
|
+
instructionExcludes: opts.instructionExcludes,
|
|
73
76
|
});
|
|
74
77
|
if (block) result = result ? `${result}\n\n${block}` : block;
|
|
75
78
|
}
|
|
@@ -38,6 +38,12 @@ let lastExit = { code: 0, signal: null };
|
|
|
38
38
|
let transportState = null;
|
|
39
39
|
const promptQueue = [];
|
|
40
40
|
|
|
41
|
+
// Backpressure (Gap 4): an attached client can push prompts faster than
|
|
42
|
+
// turns drain — an unbounded queue grows without limit and every entry is a
|
|
43
|
+
// future agent turn. Past the cap the prompt is REJECTED (the transport
|
|
44
|
+
// relays the throw as {type:"error", message}) instead of silently queued.
|
|
45
|
+
const MAX_PROMPT_QUEUE = 100;
|
|
46
|
+
|
|
41
47
|
function mergeState(patch) {
|
|
42
48
|
const current = readBackgroundAgentState(job.id) || { id: job.id };
|
|
43
49
|
const next = { ...current, id: job.id, ...patch };
|
|
@@ -109,12 +115,20 @@ function startTurn(argv, promptText) {
|
|
|
109
115
|
env: { ...process.env, CC_BACKGROUND_AGENT_ID: job.id },
|
|
110
116
|
stdio: ["ignore", log.fd, log.fd],
|
|
111
117
|
windowsHide: true,
|
|
118
|
+
// POSIX: give the agent child its own process group so an orphan reclaim
|
|
119
|
+
// (worker crashed → supervisor kills the recorded agentPid) or /stop can
|
|
120
|
+
// signal the WHOLE agent tree via -pid. Windows reaps via taskkill /T.
|
|
121
|
+
detached: process.platform !== "win32",
|
|
112
122
|
});
|
|
113
123
|
mergeState({
|
|
114
124
|
status: "running",
|
|
115
125
|
phase,
|
|
116
126
|
turnCount,
|
|
117
127
|
agentPid: child.pid,
|
|
128
|
+
// Identity anchor for the supervisor's orphan reclaim (Gap 2): pairs
|
|
129
|
+
// with agentPid the way startedAt pairs with the worker pid, so a
|
|
130
|
+
// pid-reusing stranger is never killed in the worker's name.
|
|
131
|
+
agentStartedAt: Date.now(),
|
|
118
132
|
heartbeatAt: Date.now(),
|
|
119
133
|
});
|
|
120
134
|
server?.broadcast({
|
|
@@ -150,7 +164,12 @@ function maybeContinue() {
|
|
|
150
164
|
}
|
|
151
165
|
if (server && server.clientCount() > 0) {
|
|
152
166
|
phase = "idle";
|
|
153
|
-
mergeState({
|
|
167
|
+
mergeState({
|
|
168
|
+
phase,
|
|
169
|
+
agentPid: null,
|
|
170
|
+
agentStartedAt: null,
|
|
171
|
+
heartbeatAt: Date.now(),
|
|
172
|
+
});
|
|
154
173
|
server.broadcast({ type: "idle", turn: turnCount });
|
|
155
174
|
return;
|
|
156
175
|
}
|
|
@@ -188,13 +207,29 @@ async function main() {
|
|
|
188
207
|
"this session was launched without follow-up support — start a new one with cc agent --bg",
|
|
189
208
|
);
|
|
190
209
|
}
|
|
210
|
+
if (promptQueue.length >= MAX_PROMPT_QUEUE) {
|
|
211
|
+
throw new Error(
|
|
212
|
+
`prompt queue full (${MAX_PROMPT_QUEUE} pending) — wait for queued turns to drain before sending more`,
|
|
213
|
+
);
|
|
214
|
+
}
|
|
191
215
|
promptQueue.push(text);
|
|
192
216
|
const queued = promptQueue.length;
|
|
193
217
|
if (!child) maybeContinue();
|
|
194
218
|
return { queued };
|
|
195
219
|
},
|
|
196
220
|
onStop: () => {
|
|
197
|
-
child
|
|
221
|
+
if (!child) return;
|
|
222
|
+
if (process.platform !== "win32") {
|
|
223
|
+
// The agent child is detached into its own group — signal the
|
|
224
|
+
// whole tree, not just the top-level CLI process.
|
|
225
|
+
try {
|
|
226
|
+
process.kill(-child.pid, "SIGTERM");
|
|
227
|
+
} catch {
|
|
228
|
+
child.kill("SIGTERM");
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
child.kill("SIGTERM");
|
|
232
|
+
}
|
|
198
233
|
},
|
|
199
234
|
onClientChange: (count) => {
|
|
200
235
|
// Last client detached while the session is idle → nothing left to
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as h,P as m,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-CB2MOS_8.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"}),u=s(()=>{if(!t.event.occurredAt)return"";try{const e=new Date(t.event.occurredAt),p=e.getFullYear(),f=String(e.getMonth()+1).padStart(2,"0"),g=String(e.getDate()).padStart(2,"0"),b=String(e.getHours()).padStart(2,"0"),v=String(e.getMinutes()).padStart(2,"0");return`${p}-${f}-${g} ${b}:${v}`}catch{return""}}),_={props:t,messageText:r,actorLabel:i,isMine:l,adapterColor:o,formattedTime:u,computed:s};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}},T={class:"bubble"},M={class:"meta"},O={class:"actor"},R={class:"time"},V={class:"body"};function q(c,d,t,r,i,l){const o=h("a-tag");return m(),S("div",{class:B(["chat-row",{mine:r.isMine}])},[n("div",T,[n("div",M,[n("span",O,a(r.actorLabel),1),n("span",R,a(r.formattedTime),1)]),n("div",V,a(r.messageText),1),t.event.source.adapter?(m(),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",q],["__scopeId","data-v-49238629"],["__file","/tmp/cc-web-panel-2mOPUv/repo/packages/web-panel/src/components/pdh/renderers/ChatBubbleRenderer.vue"]]);export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as c,J as p,b as s}from"./vendor-Bn1JzzAn.js";import{r as a}from"./markdown-Yo_c6Krv.js";import{_ as d}from"./index-CB2MOS_8.js";const _={__name:"MarkdownRenderer",props:{content:{type:String,default:""}},setup(t,{expose:o}){o();const e=t,r=s(()=>a(e.content||"")),n={props:e,rendered:r,computed:s,get renderMarkdown(){return a}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}},i=["innerHTML"];function m(t,o,e,r,n,u){return c(),p("div",{class:"markdown-content",innerHTML:r.rendered},null,8,i)}const w=d(_,[["render",m],["__scopeId","data-v-0b0b9f63"],["__file","/tmp/cc-web-panel-2mOPUv/repo/packages/web-panel/src/components/MarkdownRenderer.vue"]]);export{w as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as n,J as g,c as l,K as r,N as u,P as h,U as o,R as t,Q as m}from"./vendor-Bn1JzzAn.js";import{_ as v,b}from"./index-CB2MOS_8.js";import{a8 as y,M}from"./icons-DG5UD-6K.js";const B={__name:"MobileProjects",setup(p,{expose:i}){i();const c=u(),{t:e}=b();function a(){c.push("/projects")}function _(){c.push("/mobile-bridge")}const s={router:c,t:e,goToProjects:a,goToMobileBridge:_,get useRouter(){return u},get useI18n(){return b},get MobileOutlined(){return M},get FolderOutlined(){return y}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}},O={class:"mobile-projects-placeholder"},x={class:"title"},k={class:"subtitle"},w={class:"explainer"};function T(p,i,c,e,a,_){const s=n("a-alert"),d=n("a-button"),f=n("a-space"),P=n("a-empty"),j=n("a-card");return h(),g("div",O,[l(j,null,{default:r(()=>[l(P,{description:!1},{image:r(()=>[l(e.MobileOutlined,{style:{fontSize:"64px",color:"#bfbfbf"}})]),default:r(()=>[o("h2",x,t(e.t("mobileProjects.title")),1),o("p",k,t(e.t("mobileProjects.subtitle")),1),l(s,{message:e.t("mobileProjects.v02Banner"),type:"info","show-icon":"",class:"banner"},null,8,["message"]),o("div",w,[o("h3",null,t(e.t("mobileProjects.currentDirection")),1),o("p",null,t(e.t("mobileProjects.currentDirectionBody")),1),o("ul",null,[o("li",null,t(e.t("mobileProjects.stepPhone")),1),o("li",null,t(e.t("mobileProjects.stepTap")),1),o("li",null,t(e.t("mobileProjects.stepPull")),1)]),o("h3",null,t(e.t("mobileProjects.reverseDirection")),1),o("p",null,t(e.t("mobileProjects.reverseDirectionBody")),1)]),l(f,{class:"actions"},{default:r(()=>[l(d,{type:"primary",onClick:e.goToProjects},{default:r(()=>[l(e.FolderOutlined),m(" "+t(e.t("mobileProjects.viewLocalProjects")),1)]),_:1}),l(d,{onClick:e.goToMobileBridge},{default:r(()=>[l(e.MobileOutlined),m(" "+t(e.t("mobileProjects.checkBridge")),1)]),_:1})]),_:1})]),_:1})]),_:1})])}const N=v(B,[["render",T],["__scopeId","data-v-9262cc45"],["__file","/tmp/cc-web-panel-2mOPUv/repo/packages/web-panel/src/views/MobileProjects.vue"]]);export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as r}from"./index-CB2MOS_8.js";const o=((n,a,e)=>{r(n,`[ant-design-vue: ${a}] ${e}`)});export{o as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as o}from"./Row-BIsNcE_1.js";import{a0 as t}from"./index-CB2MOS_8.js";import"./vendor-Bn1JzzAn.js";import"./responsiveObserve-DkS_Zs4r.js";import"./useFlexGapSupport-ZGzN1cU8.js";import"./styleChecker-EmBYRftd.js";import"./index-DLgkAhEE.js";import"./icons-DG5UD-6K.js";const l=t(o);export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./Col-ChR-brDs.js";import{a0 as t}from"./index-CB2MOS_8.js";import"./vendor-Bn1JzzAn.js";import"./index-DLgkAhEE.js";import"./icons-DG5UD-6K.js";const s=t(o);export{s as default};
|