chainlesschain 0.162.168 → 0.162.169
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-CDzzuWZV.js → AIOps-DCeNRK8z.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-Dy-8MmQi.js → ActionButton-ZfD0HgVe.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BtJ_VWkx.js → Analytics-Ccn40f9E.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-DkjiI4VS.js → AppLayout-DyXs4nSt.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-h8PyDO86.js → Artifacts-CYjMh5KR.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-DiDV0C6l.js → Audit-DZIhvx88.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-DTw_aOaf.js → BackgroundAgents-C1XJsa2d.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-CihFuUO9.js → Backup-CMXC0oUN.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-CqP2QNoR.js → BaseInput-CRVmIH1t.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-tm-ygX-p.js → Chat-acBud5Yj.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-BVKEhj_y.js → ChatBubbleRenderer-CTjqFhdD.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BFMyRN3Q.js → Checkbox-CZem825o.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-B1gTeoAS.js → Codegen-B9UjZsww.js} +1 -1
- package/src/assets/web-panel/assets/{Col-1GP8MvKL.js → Col-Dtu6Frtj.js} +1 -1
- package/src/assets/web-panel/assets/{Community-BLY938F6.js → Community-9bV55Huv.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-DVt_p36I.js → Compact-g-kQ4c84.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-DxqEBXVG.js → Compliance-CQjHzBO1.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CyWrM-T8.js → Cowork-D1Qm_Xhi.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-Domu6aI9.js → Cron-992qo8zX.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-C8LKpjHJ.js → Crosschain-4TiqEwuc.js} +1 -1
- package/src/assets/web-panel/assets/{DID-XBy15RZ5.js → DID-BbsXzXCb.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-DDAyPD-V.js → Dashboard-Dx5aO9d3.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BHV0MZ13.js → Dropdown-BhzW6i6i.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-DmFGW4PX.js → EmailListRenderer-qEib4yiq.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-CqYdbKvd.js → FamilyGuardDashboard-BZ3N-u3h.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-YP5-Puv5.js → Federation-CcOqwzHY.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BOmcIcTe.js → FormItemContext-dbi8mohd.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-CvTZdoc4.js → GenericCardRenderer-57dqulUe.js} +1 -1
- package/src/assets/web-panel/assets/{Git-Q2oxua0L.js → Git-DtSV7C5g.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-D-WpyWEU.js → Governance-CLnmH-RD.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-NUtsYHQo.js → Inference-wXiLeDnk.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BHQLa8fr.js → KnowledgeGraph-NGdIX2Gx.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-6WsR5Q1G.js → Logs-Dz0HQn69.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-CSRZ9da3.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-CigohRRW.js → Marketplace-DpPDmY3W.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-jcp6jVLf.js → McpTools-UMysoRQm.js} +5 -5
- package/src/assets/web-panel/assets/{Memory-B00NU1ph.js → Memory-DsnBpQnY.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-Cs_p3PzU.js → MobileBridge-DweooAfG.js} +1 -1
- package/src/assets/web-panel/assets/MobileProjects-UdLfZOVA.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-CSEflwzw.js → Mtc-oXWhJNgC.js} +6 -6
- package/src/assets/web-panel/assets/{MtcAudit-dxSiEZ96.js → MtcAudit-CXTD7qrm.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-CDAFEAyq.js → Multisig-BKt5mJ9O.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-HoFpZNiB.js → NLProgramming-C-zcYzje.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-tAoQvVcE.js → Notes-CGaZ_jep.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-Czo2M9F4.js → NotificationSettings-BwX-tDbq.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-CM1kNTp6.js → OrderTableRenderer-Cc9Se8H-.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-Cudr0VOC.js → Organization-8BXdC7Im.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-BSXeDKiN.js → Overflow-zCisFuGU.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-Cqv_g-F9.js → P2P-BehHH9Ro.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-DVuXYKAR.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-97pIDQKE.js → Permissions-BVDATm3p.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-bparK9eQ.js → PersonalDataHub-C43nnYoi.js} +2 -2
- package/src/assets/web-panel/assets/{Pipeline-CJgerM09.js → Pipeline-D9E7aSVD.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-JqFS3PN7.js → Privacy-CRbIchdL.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DMITd-2c.js → ProjectInit-CTsy8lhL.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-1UkdJ8Ii.js → ProjectSettings-CPEKWWJ5.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-CYZqegqw.js → Projects-CNnW0v5N.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-ChfXz3U0.js → Providers-BeZnDL9Y.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-Rzkka-mf.js → QrScannerModal-CaydwuIU.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DEz9HaON.js → QuickAsk-qYWbu7kw.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-EFGP8AVu.js → Recommend-RV_ogHrM.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-6um0lGGy.js → RemoteSession-Mah1i41_.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-CA1BXTup.js → Reputation-xZQhGktc.js} +1 -1
- package/src/assets/web-panel/assets/{Row-stTnDJ9y.js → Row-B6cVbPbJ.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-B10qCCoG.js → RssFeed-C6hKjDPz.js} +2 -2
- package/src/assets/web-panel/assets/{Search-DSJroZ6p.js → Search-0jti_-Pe.js} +1 -1
- package/src/assets/web-panel/assets/{Security-BpXkwiMW.js → Security-Cy48feGz.js} +4 -4
- package/src/assets/web-panel/assets/{Services-BPQxjwK6.js → Services-BW3ObFxH.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CfbKAMul.js → Skeleton-CfrZRvAM.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-CttYTfX0.js → Skills-yoccdk3t.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-ByluHich.js → Sla-AKBBdri6.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-BdZXKsfV.js → SpeechSettings-DH87GbkH.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-xCR7iDzy.js → SyncSettings-DUuO-ZSw.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-qTko_INn.js → Tasks-ZTUfOzMZ.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-CkIzhgDJ.js → Templates-shPrQ4NE.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-BIaCaaK8.js → Tenant-C_inPunR.js} +1 -1
- package/src/assets/web-panel/assets/Terminal-CvVtx6ie.js +3 -0
- package/src/assets/web-panel/assets/{TimelineRenderer-D5eQDnEF.js → TimelineRenderer-Bzp_T3Xc.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DmeJ8NMQ.js → Tokens-kUFRLdtp.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-C5sgb3C7.js → Trigger-BsTU2blQ.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-H2vOb3Rb.js → Trust-DEKkuAsi.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-NmPtHK2u.js → UkeySign-D1KEEgbK.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-DHv-Ti7K.js → VideoEditing-C2yYkm9W.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-BYZ3-PRP.js → Wallet-BKKod4qb.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-BaSlP7om.js → WebAuthn-XXUgED6d.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-CZ7IHuIi.js → WorkflowEditor-DnlEyYTi.js} +1 -1
- package/src/assets/web-panel/assets/{chat-Dd9kY8gn.js → chat-BaVjI6nu.js} +1 -1
- package/src/assets/web-panel/assets/{colors-yhzo6QSV.js → colors-DQ0yx43H.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-C1JneVdM.js → compact-item-DEyWDp0v.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-C_waVCg2.js → createContext-SuPOfylZ.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-C_RK48j-.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-CkVg0Xnh.js → hasIn-CQz1JNtC.js} +1 -1
- package/src/assets/web-panel/assets/{index-BsSsurcn.js → index-3xcB2i6I.js} +1 -1
- package/src/assets/web-panel/assets/{index-CUDjGt_V.js → index-57GdL9ro.js} +1 -1
- package/src/assets/web-panel/assets/{index-D7kQ_4uL.js → index-BHJhyrFr.js} +1 -1
- package/src/assets/web-panel/assets/{index-DPkqQ2Pr.js → index-BIgWgye3.js} +1 -1
- package/src/assets/web-panel/assets/{index-U_nLXGIx.js → index-BJEIjYhV.js} +1 -1
- package/src/assets/web-panel/assets/{index-C_qqYZT7.js → index-BffmUosH.js} +1 -1
- package/src/assets/web-panel/assets/{index-DUA96wEj.js → index-ByGF9ev7.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXHk9Vof.js → index-C-IKjQD3.js} +1 -1
- package/src/assets/web-panel/assets/{index-D1xIbAxQ.js → index-C2k8eHyq.js} +3 -3
- package/src/assets/web-panel/assets/{index-CmiLmG0i.js → index-C3Vlo45C.js} +1 -1
- package/src/assets/web-panel/assets/index-CDqhisfz.js +1 -0
- package/src/assets/web-panel/assets/{index-CErewFeT.js → index-CEfLMvKf.js} +1 -1
- package/src/assets/web-panel/assets/{index-BlJNvg-2.js → index-CGu-b0RE.js} +1 -1
- package/src/assets/web-panel/assets/{index-BlzbSUK9.js → index-CI5jlfyn.js} +1 -1
- package/src/assets/web-panel/assets/index-CKUoX6Yi.js +1 -0
- package/src/assets/web-panel/assets/{index-ewb0-LoH.js → index-COsmMpAO.js} +1 -1
- package/src/assets/web-panel/assets/{index-C-Sscgnv.js → index-CZrARoXd.js} +1 -1
- package/src/assets/web-panel/assets/{index-DapftLUr.js → index-C_fcNCoV.js} +1 -1
- package/src/assets/web-panel/assets/{index-_M8El5iz.js → index-CfVW-cd_.js} +1 -1
- package/src/assets/web-panel/assets/{index-Diquc7-l.js → index-CgvnudM_.js} +1 -1
- package/src/assets/web-panel/assets/{index-1VYhIr6D.js → index-CnhJU5To.js} +1 -1
- package/src/assets/web-panel/assets/{index-C4HNdMCt.js → index-CpR6M7eQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CBwmwTNa.js → index-D-gXgEsU.js} +1 -1
- package/src/assets/web-panel/assets/{index-CGtoL5mR.js → index-D5SY6Lwu.js} +1 -1
- package/src/assets/web-panel/assets/{index-DuGtLiTW.js → index-DB8AJ6T-.js} +1 -1
- package/src/assets/web-panel/assets/{index-BjDnI7oM.js → index-DNYVGZzG.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dez7TUgG.js → index-DWIuZ9bI.js} +1 -1
- package/src/assets/web-panel/assets/{index-_rZxgFtc.js → index-DXczrVij.js} +1 -1
- package/src/assets/web-panel/assets/{index-ClQhh6v3.js → index-Dfh6OJKz.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bwuu3Bf3.js → index-DhBeUGCp.js} +1 -1
- package/src/assets/web-panel/assets/{index-CfEMjbhu.js → index-DjZ6szGM.js} +1 -1
- package/src/assets/web-panel/assets/{index-DhZgULsY.js → index-DpPv8zeU.js} +1 -1
- package/src/assets/web-panel/assets/{index-BTMiVIBI.js → index-XjQfQBXH.js} +1 -1
- package/src/assets/web-panel/assets/{index-D6UXDH2D.js → index-ZKOZ-YFJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BrN2hAeE.js → index-ZMgCYtI7.js} +1 -1
- package/src/assets/web-panel/assets/{index-_VmzCYFn.js → index-fGgx2f1y.js} +1 -1
- package/src/assets/web-panel/assets/{index-BYOyb5X2.js → index-fcA6tfBA.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bx3A6X4J.js → index-v8PYYw05.js} +1 -1
- package/src/assets/web-panel/assets/{index-C_riAa6d.js → index-wBsuJZcz.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DNN6qtGa.js → initDefaultProps-KetDXPXx.js} +1 -1
- package/src/assets/web-panel/assets/{motion-BcM9exeo.js → motion-BfAtwo2m.js} +1 -1
- package/src/assets/web-panel/assets/{move-DsKJ-YvA.js → move-BnJvzHgx.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-glgGkxaK.js → mtc-parser-DZxDclhM.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BwHCU50S.js → omit-CmqfX2P_.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-BVp-bLt7.js → pickAttrs-B2B2ahzC.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CZNe0r-w.js → placementArrow-C1SIgWRj.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DUafj9pU.js → responsiveObserve-Dy_adDTl.js} +1 -1
- package/src/assets/web-panel/assets/{slide-H4NqXQxu.js → slide-hDO9sBPk.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-UjMzzGZ5.js → statusUtils-DlpTjRpg.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-qO5aCjyk.js → styleChecker-DAv9eo6h.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-ChecYwC8.js → useFlexGapSupport-vfoXaeH8.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-BR0QvwO3.js → useFs-Dzji-S7v.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DitK2Qgz.js → usePersonalDataHub-jKcLN_Gj.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-dxSb40dY.js → vnode-DAWM5GgY.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-ekJk8YB2.js → zoom-q3XgSOUd.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/plugin.js +49 -5
- package/src/data/changelog.json +17 -4
- package/src/lib/background-agent-phase.js +22 -0
- package/src/lib/background-phase-reporter.js +37 -0
- package/src/lib/install-command-policy.js +29 -0
- package/src/lib/session-lifecycle.js +3 -0
- package/src/runtime/agent-core.js +31 -7
- package/src/runtime/headless-runner.js +42 -9
- package/src/runtime/headless-stream.js +158 -2
- package/src/workers/background-agent-worker.js +17 -4
- package/src/assets/web-panel/assets/MarkdownRenderer-DuWoDwMx.js +0 -1
- package/src/assets/web-panel/assets/MobileProjects-BFs2WljZ.js +0 -1
- package/src/assets/web-panel/assets/PdhVaultBrowser-7rjprPh8.js +0 -7
- package/src/assets/web-panel/assets/Terminal-B2Qq38XP.js +0 -3
- package/src/assets/web-panel/assets/devWarning-DaDlyVDY.js +0 -1
- package/src/assets/web-panel/assets/index-BtsLExcc.js +0 -1
- package/src/assets/web-panel/assets/index-C3qDvvIb.js +0 -1
|
@@ -75,6 +75,15 @@ import {
|
|
|
75
75
|
rebuildMessages as jsonlRebuildMessages,
|
|
76
76
|
sessionExists as jsonlSessionExists,
|
|
77
77
|
} from "../harness/jsonl-session-store.js";
|
|
78
|
+
import {
|
|
79
|
+
reconcileSideEffects,
|
|
80
|
+
classifyToolSideEffect,
|
|
81
|
+
} from "../lib/side-effect-ledger.js";
|
|
82
|
+
import {
|
|
83
|
+
loadSideEffectLedger,
|
|
84
|
+
persistSideEffectLedger,
|
|
85
|
+
} from "../lib/side-effect-ledger-store.js";
|
|
86
|
+
import { operationIdempotencyKey } from "../lib/idempotency.js";
|
|
78
87
|
import { getPlanModeManager } from "../lib/plan-mode.js";
|
|
79
88
|
|
|
80
89
|
/**
|
|
@@ -527,6 +536,46 @@ export async function* readJsonLines(input, opts = {}) {
|
|
|
527
536
|
if (!overflow && buf.trim()) yield buf;
|
|
528
537
|
}
|
|
529
538
|
|
|
539
|
+
/**
|
|
540
|
+
* P0-2: on a stream resume, surface any irreversible tool that was in flight
|
|
541
|
+
* when the prior run died. Same reconcile + wording as the single-prompt
|
|
542
|
+
* runner (headless-runner.js) and the WS bridge (session-protocol.js): a
|
|
543
|
+
* `started`-but-unsettled op's outcome is UNKNOWN, so the model must VERIFY
|
|
544
|
+
* before any replay rather than silently re-issue the effect. Returns
|
|
545
|
+
* {count, items, notice} or null when nothing needs verification — a clean
|
|
546
|
+
* (or absent) ledger keeps the resume byte-identical to today.
|
|
547
|
+
*/
|
|
548
|
+
function buildSideEffectRecovery(ledger) {
|
|
549
|
+
try {
|
|
550
|
+
const plan = reconcileSideEffects(ledger);
|
|
551
|
+
if (!plan.inspect.length) return null;
|
|
552
|
+
const items = plan.plans
|
|
553
|
+
.filter((p) => p.action === "inspect")
|
|
554
|
+
.map((p) => {
|
|
555
|
+
const op = ledger.get(p.opId) || {};
|
|
556
|
+
return {
|
|
557
|
+
kind: op.kind || "unknown",
|
|
558
|
+
key: op.key || null,
|
|
559
|
+
reason: p.reason,
|
|
560
|
+
};
|
|
561
|
+
});
|
|
562
|
+
const notice =
|
|
563
|
+
"Recovery notice — the previous run was interrupted while these " +
|
|
564
|
+
"irreversible operations were in flight; their outcome is UNKNOWN. Do " +
|
|
565
|
+
"NOT blindly re-run them. Verify whether each already took effect before " +
|
|
566
|
+
"repeating it, and ask the user if unsure:\n" +
|
|
567
|
+
items
|
|
568
|
+
.map(
|
|
569
|
+
(it) =>
|
|
570
|
+
` • [${it.kind}]${it.key ? ` (${it.key})` : ""} — ${it.reason}`,
|
|
571
|
+
)
|
|
572
|
+
.join("\n");
|
|
573
|
+
return { count: items.length, items, notice };
|
|
574
|
+
} catch {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
530
579
|
/**
|
|
531
580
|
* Run a single turn through the core agent loop, emitting NDJSON events.
|
|
532
581
|
* Returns the turn outcome so the caller can grow history + the result line.
|
|
@@ -534,7 +583,7 @@ export async function* readJsonLines(input, opts = {}) {
|
|
|
534
583
|
async function runTurn(
|
|
535
584
|
messages,
|
|
536
585
|
loopOptions,
|
|
537
|
-
{ runLoop, emit, costBudget, nextToolUseId },
|
|
586
|
+
{ runLoop, emit, costBudget, nextToolUseId, sideEffects },
|
|
538
587
|
) {
|
|
539
588
|
const usage = {
|
|
540
589
|
input_tokens: 0,
|
|
@@ -546,6 +595,10 @@ async function runTurn(
|
|
|
546
595
|
let finalText = "";
|
|
547
596
|
let endReason = "complete";
|
|
548
597
|
let stopForCost = false;
|
|
598
|
+
// P0-2: the side-effect op currently in flight (at most one — the loop runs
|
|
599
|
+
// tools serially). Non-null only between a dangerous tool's tool-executing
|
|
600
|
+
// and its tool-result.
|
|
601
|
+
let currentSideEffectOpId = null;
|
|
549
602
|
|
|
550
603
|
// Collapse consecutive same-role turns before the model call ONLY when the
|
|
551
604
|
// caller flags a resume-degenerate transcript (`mergeRoles`): a resumed
|
|
@@ -583,10 +636,52 @@ async function runTurn(
|
|
|
583
636
|
tool: event.tool,
|
|
584
637
|
args: event.args,
|
|
585
638
|
});
|
|
639
|
+
// P0-2: record an irreversible effect as STARTED (persisted before it
|
|
640
|
+
// settles) so a crash before the matching tool-result leaves a
|
|
641
|
+
// reconcilable "in flight" marker instead of a silent replay — mirrors
|
|
642
|
+
// the single-prompt runner and the WS bridge. `sideEffects` is null
|
|
643
|
+
// when the session doesn't persist, keeping that path byte-identical.
|
|
644
|
+
currentSideEffectOpId = null;
|
|
645
|
+
if (sideEffects) {
|
|
646
|
+
const se = classifyToolSideEffect(event.tool, event.args);
|
|
647
|
+
if (se) {
|
|
648
|
+
const opId = sideEffects.nextOpId();
|
|
649
|
+
currentSideEffectOpId = opId;
|
|
650
|
+
sideEffects.ledger
|
|
651
|
+
.prepare(opId, {
|
|
652
|
+
kind: se.kind,
|
|
653
|
+
key: se.key,
|
|
654
|
+
// Content-addressed key: a resumed replay of the SAME effect
|
|
655
|
+
// derives the SAME key, so an external provider can de-dupe
|
|
656
|
+
// and countDuplicateCommittedEffects can measure `0` repeats.
|
|
657
|
+
meta: {
|
|
658
|
+
tool: event.tool,
|
|
659
|
+
idempotencyKey: operationIdempotencyKey({
|
|
660
|
+
tool: event.tool,
|
|
661
|
+
args: event.args,
|
|
662
|
+
}),
|
|
663
|
+
},
|
|
664
|
+
})
|
|
665
|
+
.start(opId);
|
|
666
|
+
sideEffects.persist();
|
|
667
|
+
}
|
|
668
|
+
}
|
|
586
669
|
break;
|
|
587
670
|
}
|
|
588
671
|
case "tool-result": {
|
|
589
672
|
const err = event.error || event.result?.error || null;
|
|
673
|
+
// P0-2: settle the in-flight side-effect (commit on success, fail on
|
|
674
|
+
// a clean error) and persist the updated ledger snapshot.
|
|
675
|
+
if (sideEffects && currentSideEffectOpId) {
|
|
676
|
+
if (err)
|
|
677
|
+
sideEffects.ledger.fail(
|
|
678
|
+
currentSideEffectOpId,
|
|
679
|
+
String(err).slice(0, 200),
|
|
680
|
+
);
|
|
681
|
+
else sideEffects.ledger.commit(currentSideEffectOpId);
|
|
682
|
+
sideEffects.persist();
|
|
683
|
+
currentSideEffectOpId = null;
|
|
684
|
+
}
|
|
590
685
|
// The loop runs tools serially, so this result settles the most
|
|
591
686
|
// recent tool_use (same adjacency rule the is_error attribution
|
|
592
687
|
// below has always used).
|
|
@@ -846,6 +941,39 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
846
941
|
// id is kept for event correlation only; nothing is written or replayed).
|
|
847
942
|
const persist = Boolean(options.sessionId) && options.ephemeral !== true;
|
|
848
943
|
|
|
944
|
+
// ── P0-2: crash-safe side-effect ledger — the stream twin of the
|
|
945
|
+
// single-prompt runner (headless-runner.js) and the WS bridge
|
|
946
|
+
// (ws-agent-handler.js). Dangerous tools (file writes, opaque shell,
|
|
947
|
+
// git push, publish/schedule/notify/browser actions) are recorded
|
|
948
|
+
// prepare→start→commit|fail with the snapshot persisted BEFORE the effect
|
|
949
|
+
// settles, so an IDE chat-panel worker killed mid-flight is surfaced for
|
|
950
|
+
// verification on resume instead of being blindly replayed. Only active when
|
|
951
|
+
// persisting (an anonymous/--ephemeral stream can't be resumed); a run that
|
|
952
|
+
// touches no dangerous tool writes nothing.
|
|
953
|
+
const loadLedger = deps.loadSideEffectLedger || loadSideEffectLedger;
|
|
954
|
+
const persistLedger = deps.persistSideEffectLedger || persistSideEffectLedger;
|
|
955
|
+
let sideEffectLedger = null;
|
|
956
|
+
if (persist) {
|
|
957
|
+
try {
|
|
958
|
+
sideEffectLedger = loadLedger(sessionId);
|
|
959
|
+
} catch {
|
|
960
|
+
// ledger is best-effort — never block the stream over it
|
|
961
|
+
sideEffectLedger = null;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
let sideEffectSeq = 0;
|
|
965
|
+
// Run-scoped nonce keeps op ids unique even when two runs resume the same
|
|
966
|
+
// session (prepare() is idempotent on opId, so a collision would silently
|
|
967
|
+
// drop the newer record).
|
|
968
|
+
const sideEffectRunNonce = String(deps.now ? deps.now() : Date.now());
|
|
969
|
+
const sideEffects = sideEffectLedger
|
|
970
|
+
? {
|
|
971
|
+
ledger: sideEffectLedger,
|
|
972
|
+
persist: () => persistLedger(sessionId, sideEffectLedger),
|
|
973
|
+
nextOpId: () => `${sideEffectRunNonce}:${sideEffectSeq++}`,
|
|
974
|
+
}
|
|
975
|
+
: null;
|
|
976
|
+
|
|
849
977
|
// ── Interactive approvals (--interactive-approvals; chat-panel UX) ────────
|
|
850
978
|
// CONFIRM-tier decisions (risky shell via the ApprovalGate, settings/hook
|
|
851
979
|
// `ask`) normally fail closed in headless. With this opt-in they become a
|
|
@@ -1163,9 +1291,21 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1163
1291
|
// Resume: replay the persisted conversation (fresh system prompt always
|
|
1164
1292
|
// leads; persisted system turns are dropped, mirroring runAgentHeadless).
|
|
1165
1293
|
let resumedMessages = 0;
|
|
1294
|
+
let sideEffectRecovery = null;
|
|
1166
1295
|
if (persist) {
|
|
1167
1296
|
try {
|
|
1168
1297
|
if (store.sessionExists(sessionId)) {
|
|
1298
|
+
// P0-2: reconcile the crash-safe ledger on resume (parity with
|
|
1299
|
+
// runAgentHeadless + the WS bridge). The verify-before-replay system
|
|
1300
|
+
// note goes BEFORE the replayed history — the same slot the
|
|
1301
|
+
// single-prompt runner uses — which also keeps the trailing-role
|
|
1302
|
+
// resume-degeneracy check below intact.
|
|
1303
|
+
if (sideEffectLedger) {
|
|
1304
|
+
sideEffectRecovery = buildSideEffectRecovery(sideEffectLedger);
|
|
1305
|
+
}
|
|
1306
|
+
if (sideEffectRecovery) {
|
|
1307
|
+
messages.push({ role: "system", content: sideEffectRecovery.notice });
|
|
1308
|
+
}
|
|
1169
1309
|
const history = (store.rebuildMessages(sessionId) || []).filter(
|
|
1170
1310
|
(m) => m && m.role !== "system",
|
|
1171
1311
|
);
|
|
@@ -1225,6 +1365,22 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
1225
1365
|
resumed_messages: resumedMessages,
|
|
1226
1366
|
});
|
|
1227
1367
|
|
|
1368
|
+
// P0-2 visible recovery notice: same `raw` info-line contract as
|
|
1369
|
+
// provider_fallback / version_skew (the shipped IDE panels map `raw` → an
|
|
1370
|
+
// info line), so both panels render it with zero IDE changes. Emitted right
|
|
1371
|
+
// after `init` so consumers keep seeing init as the first line; absent
|
|
1372
|
+
// entirely on a clean (or ledger-free) resume.
|
|
1373
|
+
if (sideEffectRecovery) {
|
|
1374
|
+
emit({
|
|
1375
|
+
type: "raw",
|
|
1376
|
+
subtype: "side_effect_recovery",
|
|
1377
|
+
text: `⚠️ ${sideEffectRecovery.count} interrupted side-effect(s) need verification before replay (resume ${sessionId}).`,
|
|
1378
|
+
count: sideEffectRecovery.count,
|
|
1379
|
+
items: sideEffectRecovery.items,
|
|
1380
|
+
session_id: sessionId,
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1228
1384
|
// Goal binding (cc goal, Phase 1) — resolved once and injected on every turn.
|
|
1229
1385
|
// `--goal <id>` binds explicitly; `--goal` with no value auto-resolves.
|
|
1230
1386
|
let goalPrepareCallFn;
|
|
@@ -2010,7 +2166,7 @@ export async function runAgentHeadlessStream(options = {}, deps = {}) {
|
|
|
2010
2166
|
// Resume-degenerate role merge for the first live model call only.
|
|
2011
2167
|
mergeRoles: mergeRolesThisTurn,
|
|
2012
2168
|
},
|
|
2013
|
-
{ runLoop, emit, costBudget, nextToolUseId },
|
|
2169
|
+
{ runLoop, emit, costBudget, nextToolUseId, sideEffects },
|
|
2014
2170
|
);
|
|
2015
2171
|
} catch (err) {
|
|
2016
2172
|
currentAbort = null;
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
writeBackgroundAgentState,
|
|
25
25
|
} from "../lib/background-agent-supervisor.js";
|
|
26
26
|
import { startBackgroundSessionServer } from "../lib/background-session-transport.js";
|
|
27
|
+
import { idlePhaseFor } from "../lib/background-agent-phase.js";
|
|
27
28
|
|
|
28
29
|
const jobFile = process.argv[2];
|
|
29
30
|
let job;
|
|
@@ -128,6 +129,11 @@ function startTurn(argv, promptText) {
|
|
|
128
129
|
// if the previous turn's child was hard-killed mid-approval (the child's
|
|
129
130
|
// phase reporter clears on settle, but SIGKILL never settles).
|
|
130
131
|
pendingApprovals: 0,
|
|
132
|
+
// The incoming prompt IS the user's reply to any parked question, and the
|
|
133
|
+
// uncertain-side-effect annotation only covers the verify turn it was
|
|
134
|
+
// raised in — both reset at the turn boundary.
|
|
135
|
+
pendingQuestion: null,
|
|
136
|
+
uncertainSideEffects: 0,
|
|
131
137
|
agentPid: child.pid,
|
|
132
138
|
// Identity anchor for the supervisor's orphan reclaim (Gap 2): pairs
|
|
133
139
|
// with agentPid the way startedAt pairs with the worker pid, so a
|
|
@@ -167,13 +173,20 @@ function maybeContinue() {
|
|
|
167
173
|
return;
|
|
168
174
|
}
|
|
169
175
|
if (server && server.clientCount() > 0) {
|
|
170
|
-
|
|
176
|
+
// Parked between turns. Normally `idle` — but a turn that parked an
|
|
177
|
+
// unanswered ask_user_question stays `needs_input` until the user's reply
|
|
178
|
+
// starts the next turn (the reply prompt clears pendingQuestion).
|
|
179
|
+
phase = idlePhaseFor(current);
|
|
171
180
|
mergeState({
|
|
172
181
|
phase,
|
|
173
|
-
// Between turns
|
|
174
|
-
// exited. Honest zero keeps a killed-mid-approval count from
|
|
175
|
-
// the session in "Needs input" forever.
|
|
182
|
+
// Between turns no APPROVAL can be pending — the approval-owning child
|
|
183
|
+
// has exited. Honest zero keeps a killed-mid-approval count from
|
|
184
|
+
// parking the session in "Needs input" forever. (A parked QUESTION is
|
|
185
|
+
// different: it awaits the user, so pendingQuestion survives idle.)
|
|
176
186
|
pendingApprovals: 0,
|
|
187
|
+
// The verify turn for any uncertain side effects has now run its
|
|
188
|
+
// course — the annotation does not outlive it.
|
|
189
|
+
uncertainSideEffects: 0,
|
|
177
190
|
agentPid: null,
|
|
178
191
|
agentStartedAt: null,
|
|
179
192
|
heartbeatAt: Date.now(),
|
|
@@ -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-D1xIbAxQ.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 b=d(_,[["render",m],["__scopeId","data-v-0b0b9f63"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/components/MarkdownRenderer.vue"]]);export{b 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 b}from"./vendor-Bn1JzzAn.js";import{_ as v,b as m}from"./index-D1xIbAxQ.js";import{a8 as y,M as B}from"./icons-DG5UD-6K.js";const M={__name:"MobileProjects",setup(p,{expose:i}){i();const c=u(),{t:e}=m();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 m},get MobileOutlined(){return B},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),b(" "+t(e.t("mobileProjects.viewLocalProjects")),1)]),_:1}),l(d,{onClick:e.goToMobileBridge},{default:r(()=>[l(e.MobileOutlined),b(" "+t(e.t("mobileProjects.checkBridge")),1)]),_:1})]),_:1})]),_:1})]),_:1})])}const N=v(M,[["render",T],["__scopeId","data-v-9262cc45"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/views/MobileProjects.vue"]]);export{N as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ChatBubbleRenderer-BVKEhj_y.js","./vendor-Bn1JzzAn.js","./index-D1xIbAxQ.js","./icons-DG5UD-6K.js","./index-Cq93VfoF.css","./ChatBubbleRenderer-gy5SDGw2.css","./OrderTableRenderer-CM1kNTp6.js","./OrderTableRenderer-CfrDjSHT.css","./TimelineRenderer-D5eQDnEF.js","./TimelineRenderer-BlTAtkOc.css","./EmailListRenderer-DmFGW4PX.js","./EmailListRenderer-DTPZPx_S.css","./GenericCardRenderer-CvTZdoc4.js","./GenericCardRenderer-o85VDYQS.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{E as ue,r as R,b as w,I as y,P as u,J as S,U as v,c,S as C,V as E,_ as M,F as V,Z as se,a0 as le,R as x,K as m,Q as b,W as L,o as G}from"./vendor-Bn1JzzAn.js";import{u as J}from"./usePersonalDataHub-DitK2Qgz.js";import{_ as D,e as F,d as B}from"./index-D1xIbAxQ.js";import{aa as P,ag as U,M as Q,aI as z,v as Y,aH as H,aq as K,ac as W,e as de,d as fe,k as pe,ai as me,aA as _e,R as ge}from"./icons-DG5UD-6K.js";const I=Object.freeze({q:"",category:null,adapter:null,subtype:null,since:null,until:null}),q=50,Z=300,X=ue("pdhBrowser",()=>{const r=R({...I}),t=R([]),n=R(null),e=R(!1),o=R(!1),l=R(null),a=R(null),s=R(!1),i=R({byCategory:{},byAdapter:{},bySubtype:{},total:0});let d=0,_=null;const A=w(()=>t.value.length>0),j=w(()=>n.value!=null);function h(O={}){const p={},f=r.value;return f.q&&f.q.trim()&&(p.q=f.q.trim()),f.category&&(p.category=f.category),f.adapter&&(p.adapter=f.adapter),f.subtype&&(p.subtype=f.subtype),Number.isFinite(f.since)&&(p.since=f.since),Number.isFinite(f.until)&&(p.until=f.until),{...p,...O}}async function g(){const O=++d;e.value=!0,l.value=null;const p=J();try{const[f,T]=await Promise.all([p.searchEvents(h({limit:q})),p.facetCounts({...r.value.q&&r.value.q.trim()?{q:r.value.q.trim()}:{},...Number.isFinite(r.value.since)?{since:r.value.since}:{},...Number.isFinite(r.value.until)?{until:r.value.until}:{}})]);if(O!==d)return;t.value=f.rows||[],n.value=f.nextCursor||null,a.value=f.mode||"like",s.value=!!f.shortQuery,i.value={byCategory:T.byCategory||{},byAdapter:T.byAdapter||{},bySubtype:T.bySubtype||{},total:T.total||0}}catch(f){if(O!==d)return;l.value=f&&f.message?f.message:String(f),t.value=[],n.value=null}finally{O===d&&(e.value=!1)}}async function k(){if(!n.value||o.value)return;o.value=!0,l.value=null;const O=J();try{const p=await O.searchEvents(h({cursor:n.value,limit:q}));t.value=t.value.concat(p.rows||[]),n.value=p.nextCursor||null,a.value=p.mode||a.value}catch(p){l.value=p&&p.message?p.message:String(p)}finally{o.value=!1}}function ae(O,p){if(!(O in I))throw new Error(`pdhBrowser.setFilter: unknown key "${O}"`);r.value={...r.value,[O]:p},_&&clearTimeout(_),_=setTimeout(()=>{_=null,g()},Z)}function ie(O){return r.value={...I,...O},_&&(clearTimeout(_),_=null),g()}function ce(){r.value={...I},t.value=[],n.value=null,l.value=null,i.value={byCategory:{},byAdapter:{},bySubtype:{},total:0}}return{filters:r,results:t,cursor:n,isLoading:e,isAppending:o,error:l,mode:a,shortQuery:s,facets:i,hasResults:A,canLoadMore:j,search:g,loadMore:k,setFilter:ae,setFilters:ie,reset:ce,PAGE_SIZE:q,SEARCH_DEBOUNCE_MS:Z}}),ye=Object.freeze(["chat","social","email","shopping","travel","system","ai-chat","other"]),ve=Object.freeze({chat:"社交聊天",social:"内容平台",email:"邮件",shopping:"支付订单",travel:"出行",system:"系统数据","ai-chat":"AI 对话",other:"其他"});function N(r){return ve[r]||r||"未知"}const be=Object.freeze([["wechat","chat"],["messaging-","chat"],["social-","social"],["email-","email"],["shopping-","shopping"],["alipay-","shopping"],["travel-","travel"],["system-data","system"],["browser-","system"],["vscode","system"],["win-recent","system"],["git-activity","system"],["shell-history","system"],["local-files","system"],["ai-chat-","ai-chat"]]);function $(r){if(typeof r!="string"||r.length===0)return"other";for(const[t,n]of be)if(t.endsWith("-")||t==="system-data"){if(r.startsWith(t))return n}else if(r===t)return n;return"other"}const he={__name:"CategorySidebar",props:{selected:{type:String,default:null},facets:{type:Object,default:()=>({byCategory:{},total:0})}},emits:["select"],setup(r,{expose:t}){t();const n=r,e=w(()=>n.facets.total||0),o={chat:W,social:K,email:H,shopping:Y,travel:z,system:Q,"ai-chat":U,other:P};function l(i){return o[i]||P}function a(i){return i?{backgroundColor:"#fff",color:"#1677ff"}:{backgroundColor:"#f0f0f0",color:"#666"}}const s={props:n,total:e,ICONS:o,iconFor:l,badgeStyle:a,computed:w,get AppstoreOutlined(){return P},get MessageOutlined(){return W},get PlayCircleOutlined(){return K},get MailOutlined(){return H},get ShoppingOutlined(){return Y},get CarOutlined(){return z},get MobileOutlined(){return Q},get RobotOutlined(){return U},get CATEGORIES(){return ye},get categoryLabel(){return N}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}},Oe={class:"pdh-sidebar"},Se=["onClick"],we={class:"label"};function Ce(r,t,n,e,o,l){const a=y("a-badge");return u(),S("div",Oe,[t[2]||(t[2]=v("div",{class:"sidebar-title"},"数据类型",-1)),v("div",{class:M(["cat-item",{active:n.selected===null}]),onClick:t[0]||(t[0]=s=>r.$emit("select",null))},[c(e.AppstoreOutlined,{class:"icon"}),t[1]||(t[1]=v("span",{class:"label"},"全部",-1)),e.total>0?(u(),C(a,{key:0,count:e.total,"number-style":e.badgeStyle(n.selected===null),"overflow-count":9999},null,8,["count","number-style"])):E("v-if",!0)],2),(u(!0),S(V,null,se(e.CATEGORIES,s=>(u(),S("div",{key:s,class:M(["cat-item",{active:n.selected===s,dim:!n.facets.byCategory[s]}]),onClick:i=>r.$emit("select",s)},[(u(),C(le(e.iconFor(s)),{class:"icon"})),v("span",we,x(e.categoryLabel(s)),1),n.facets.byCategory[s]?(u(),C(a,{key:0,count:n.facets.byCategory[s],"number-style":e.badgeStyle(n.selected===s),"overflow-count":9999},null,8,["count","number-style"])):E("v-if",!0)],10,Se))),128))])}const ke=D(he,[["render",Ce],["__scopeId","data-v-6b62a22e"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/components/pdh/CategorySidebar.vue"]]),Ee={__name:"SearchFilterBar",props:{filters:{type:Object,required:!0},facets:{type:Object,default:()=>({byAdapter:{}})},isLoading:{type:Boolean,default:!1},mode:{type:String,default:null},shortQuery:{type:Boolean,default:!1}},emits:["set-filter","reset"],setup(r,{expose:t,emit:n}){t();const e=r,o=n,l=w(()=>e.filters.category?`在「${e.filters.category}」类目内搜索…`:"搜索关键词(如:支付宝、罗技、Kotlin)…"),a=w(()=>Object.entries(e.facets.byAdapter||{}).sort((g,k)=>k[1]-g[1]).map(([g,k])=>({value:g,label:`${g} (${k})`}))),s=w(()=>!e.filters.since&&!e.filters.until?null:[e.filters.since?new Date(e.filters.since):null,e.filters.until?new Date(e.filters.until):null]),i=w(()=>!!(e.filters.q||e.filters.adapter||e.filters.subtype||e.filters.since||e.filters.until));function d(h){o("set-filter","q",h||"")}function _(h){o("set-filter","q",h||"")}function A(h){if(!h||h.length===0){o("set-filter","since",null),o("set-filter","until",null);return}const[g,k]=h;o("set-filter","since",g?+g:null),o("set-filter","until",k?+k:null)}const j={props:e,emit:o,placeholderText:l,adapterOptions:a,dateRangeValue:s,hasActiveFilters:i,onQInput:d,onSearch:_,onDateChange:A,computed:w,get SearchOutlined(){return pe},get CloseCircleOutlined(){return fe},get InfoCircleOutlined(){return de}};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}},Re={class:"pdh-filter-bar"},xe={key:1,class:"hint"},Ae={key:2,class:"hint"};function je(r,t,n,e,o,l){const a=y("a-input-search"),s=y("a-select"),i=y("a-range-picker"),d=y("a-button");return u(),S("div",Re,[c(a,{value:n.filters.q,placeholder:e.placeholderText,"enter-button":"搜索","allow-clear":"",loading:n.isLoading,style:{flex:"1","max-width":"480px"},"onUpdate:value":e.onQInput,onSearch:e.onSearch},{prefix:m(()=>[c(e.SearchOutlined)]),_:1},8,["value","placeholder","loading"]),c(s,{value:n.filters.adapter,placeholder:"所有 adapter","allow-clear":"",options:e.adapterOptions,style:{width:"200px"},"onUpdate:value":t[0]||(t[0]=_=>r.$emit("set-filter","adapter",_||null))},null,8,["value","options"]),c(i,{value:e.dateRangeValue,placeholder:["开始日期","结束日期"],style:{width:"280px"},"onUpdate:value":e.onDateChange},null,8,["value"]),e.hasActiveFilters?(u(),C(d,{key:0,type:"link",danger:"",onClick:t[1]||(t[1]=_=>r.$emit("reset"))},{icon:m(()=>[c(e.CloseCircleOutlined)]),default:m(()=>[t[2]||(t[2]=b(" 清空筛选 ",-1))]),_:1})):E("v-if",!0),n.shortQuery?(u(),S("span",xe,[c(e.InfoCircleOutlined),t[3]||(t[3]=b(" 关键词需至少 3 字 (FTS5 trigram 限制) ",-1))])):n.mode==="like"?(u(),S("span",Ae,[c(e.InfoCircleOutlined),t[4]||(t[4]=b(" 当前为 LIKE 兜底模式 ",-1))])):E("v-if",!0)])}const Le=D(Ee,[["render",je],["__scopeId","data-v-d7cce6e9"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/components/pdh/SearchFilterBar.vue"]]),Fe={__name:"RendererDispatcher",props:{event:{type:Object,required:!0}},setup(r,{expose:t}){t();const n=L(()=>F(()=>import("./ChatBubbleRenderer-BVKEhj_y.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),e=L(()=>F(()=>import("./OrderTableRenderer-CM1kNTp6.js"),__vite__mapDeps([6,1,2,3,4,7]),import.meta.url)),o=L(()=>F(()=>import("./TimelineRenderer-D5eQDnEF.js"),__vite__mapDeps([8,1,2,3,4,9]),import.meta.url)),l=L(()=>F(()=>import("./EmailListRenderer-DmFGW4PX.js"),__vite__mapDeps([10,1,2,3,4,11]),import.meta.url)),a=L(()=>F(()=>import("./GenericCardRenderer-CvTZdoc4.js"),__vite__mapDeps([12,1,2,3,4,13]),import.meta.url));function s(d){const _=d&&d.source&&d.source.adapter;switch($(_)){case"chat":case"ai-chat":return n;case"shopping":return e;case"travel":return o;case"email":return l;default:return a}}const i={ChatBubbleRenderer:n,OrderTableRenderer:e,TimelineRenderer:o,EmailListRenderer:l,GenericCardRenderer:a,rendererFor:s,defineAsyncComponent:L,get getCategory(){return $}};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}};function De(r,t,n,e,o,l){return u(),C(le(e.rendererFor(n.event)),{event:n.event},null,8,["event"])}const Te=D(Fe,[["render",De],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/components/pdh/renderers/RendererDispatcher.vue"]]);function ee(r){return JSON.stringify(r,null,2)}function te(r){return r.map(t=>JSON.stringify(t)).join(`
|
|
3
|
-
`)+`
|
|
4
|
-
`}function ne(r){const n=["id","subtype","occurredAt","occurredAtIso","actor","place","adapter","summary","contentJson","extraJson"].join(","),e=r.map(o=>{const l=Number.isFinite(o.occurredAt)?o.occurredAt:null,a=l?new Date(l).toISOString():"",s=o.source&&o.source.adapter||"",i=o.content&&(o.content.text||o.content.title||o.content.subject)||"";return[o.id||"",o.subtype||"",l!=null?String(l):"",a,o.actor||"",o.place||"",s,i,o.content?JSON.stringify(o.content):"",o.extra?JSON.stringify(o.extra):""].map(Ie).join(",")});return[n,...e].join(`
|
|
5
|
-
`)+`
|
|
6
|
-
`}function Ie(r){const t=String(r??"");return t.includes(",")||t.includes('"')||t.includes(`
|
|
7
|
-
`)||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}function re(r,t,n="application/octet-stream"){if(typeof window>"u"||typeof document>"u")return t;const e=new Blob([r],{type:n}),o=URL.createObjectURL(e),l=document.createElement("a");return l.href=o,l.download=t,document.body.appendChild(l),l.click(),document.body.removeChild(l),setTimeout(()=>URL.revokeObjectURL(o),1e3),t}function oe(r,t=null){const n=new Date,e=n.getFullYear(),o=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0"),a=r==="ndjson"?"ndjson":r,s=t?`-${t}`:"";return`pdh-events-${e}-${o}-${l}${s}.${a}`}const Be={__name:"ExportDropdown",props:{events:{type:Array,required:!0},category:{type:String,default:null}},setup(r,{expose:t}){t();const n=r,e=w(()=>n.events.length>0),o={json:"application/json;charset=utf-8",ndjson:"application/x-ndjson;charset=utf-8",csv:"text/csv;charset=utf-8"};function l(i){switch(i){case"json":return ee(n.events);case"ndjson":return te(n.events);case"csv":return ne(n.events);default:throw new Error(`unknown format: ${i}`)}}function a({key:i}){try{const d=l(i),_=oe(i,n.category);re(d,_,o[i]),B.success(`已导出 ${n.events.length} 条到 ${_}`)}catch(d){B.error(`导出失败: ${d.message||d}`)}}const s={props:n,hasResults:e,MIME:o,serialize:l,onClick:a,computed:w,get DownloadOutlined(){return _e},get DownOutlined(){return me},get message(){return B},get eventsToJson(){return ee},get eventsToNdjson(){return te},get eventsToCsv(){return ne},get downloadAs(){return re},get suggestFilename(){return oe}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}};function Pe(r,t,n,e,o,l){const a=y("a-button"),s=y("a-menu-item"),i=y("a-menu"),d=y("a-dropdown");return u(),C(d,{disabled:!e.hasResults},{overlay:m(()=>[c(i,{onClick:e.onClick},{default:m(()=>[c(s,{key:"json"},{default:m(()=>[...t[0]||(t[0]=[b("JSON (.json)",-1)])]),_:1}),c(s,{key:"ndjson"},{default:m(()=>[...t[1]||(t[1]=[b("NDJSON (.ndjson)",-1)])]),_:1}),c(s,{key:"csv"},{default:m(()=>[...t[2]||(t[2]=[b("CSV (.csv)",-1)])]),_:1})]),_:1})]),default:m(()=>[c(a,{disabled:!e.hasResults},{icon:m(()=>[c(e.DownloadOutlined)]),default:m(()=>[b(" 导出 ("+x(n.events.length)+") ",1),c(e.DownOutlined)]),_:1},8,["disabled"])]),_:1},8,["disabled"])}const qe=D(Be,[["render",Pe],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/components/pdh/ExportDropdown.vue"]]),Ve={__name:"PdhVaultBrowser",setup(r,{expose:t}){t();const n=X(),e=w(()=>n.filters.q?`没有匹配 "${n.filters.q}" 的事件 — 试试更短的关键词或换个类目`:n.filters.category?`「${N(n.filters.category)}」类目下还没有数据 — 去采集页同步对应 adapter`:"Vault 里还没有数据 — 去「个人数据中台」页面同步任意 adapter");function o(s){n.filters.category=s,n.search()}function l(s,i){n.setFilter(s,i)}G(()=>{!n.hasResults&&!n.isLoading&&n.search()});const a={store:n,emptyHint:e,onCategorySelect:o,onSetFilter:l,onMounted:G,computed:w,get ReloadOutlined(){return ge},get usePdhBrowserStore(){return X},get categoryLabel(){return N},CategorySidebar:ke,SearchFilterBar:Le,RendererDispatcher:Te,ExportDropdown:qe};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}},Ne={class:"pdh-browser-page"},Me={class:"page-header"},Ge={class:"main-pane"},Je={class:"results-summary"},Ue={key:0},Qe={key:0},ze={key:1},Ye={class:"loaded-of"},He={class:"results-list"},Ke={key:2,class:"load-more"};function We(r,t,n,e,o,l){const a=y("a-tag"),s=y("a-button"),i=y("a-space"),d=y("a-col"),_=y("a-spin"),A=y("a-alert"),j=y("a-empty"),h=y("a-row");return u(),S("div",Ne,[v("div",Me,[t[6]||(t[6]=v("div",null,[v("h2",{class:"page-title"},"数据浏览器"),v("p",{class:"page-sub"}," Vault 里所有已采集的数据,按类目浏览 / 全文检索 / 时间窗口筛选。 完全离线,不外传。 ")],-1)),c(i,null,{default:m(()=>[e.store.mode==="fts5"?(u(),C(a,{key:0,color:"green"},{default:m(()=>[...t[3]||(t[3]=[b("FTS5 trigram",-1)])]),_:1})):e.store.mode==="like"?(u(),C(a,{key:1,color:"orange"},{default:m(()=>[...t[4]||(t[4]=[b("LIKE 兜底",-1)])]),_:1})):E("v-if",!0),c(e.ExportDropdown,{events:e.store.results,category:e.store.filters.category},null,8,["events","category"]),c(s,{onClick:t[0]||(t[0]=g=>e.store.search()),loading:e.store.isLoading},{icon:m(()=>[c(e.ReloadOutlined)]),default:m(()=>[t[5]||(t[5]=b(" 刷新 ",-1))]),_:1},8,["loading"])]),_:1})]),c(h,{gutter:16,class:"browser-layout"},{default:m(()=>[c(d,{xs:24,sm:24,md:6,lg:5,xl:4},{default:m(()=>[c(e.CategorySidebar,{selected:e.store.filters.category,facets:e.store.facets,onSelect:e.onCategorySelect},null,8,["selected","facets"])]),_:1}),c(d,{xs:24,sm:24,md:18,lg:19,xl:20},{default:m(()=>[v("div",Ge,[c(e.SearchFilterBar,{filters:e.store.filters,facets:e.store.facets,"is-loading":e.store.isLoading,mode:e.store.mode,"short-query":e.store.shortQuery,onSetFilter:e.onSetFilter,onReset:t[1]||(t[1]=g=>{e.store.reset(),e.store.search()})},null,8,["filters","facets","is-loading","mode","short-query"]),v("div",Je,[e.store.isLoading&&e.store.results.length===0?(u(),S("span",Ue,[c(_,{size:"small"}),t[7]||(t[7]=b(" 载入中… ",-1))])):(u(),S(V,{key:1},[v("strong",null,x(e.store.facets.total),1),t[11]||(t[11]=b(" 条事件 ",-1)),e.store.filters.category?(u(),S("span",Qe,[t[8]||(t[8]=b(" / 当前类目 ",-1)),v("strong",null,x(e.categoryLabel(e.store.filters.category)),1),v("strong",null,x(e.store.facets.byCategory[e.store.filters.category]||0),1)])):E("v-if",!0),e.store.filters.q?(u(),S("span",ze,[t[9]||(t[9]=b(' / 关键词 "',-1)),v("em",null,x(e.store.filters.q),1),t[10]||(t[10]=b('"',-1))])):E("v-if",!0),v("span",Ye," / 已显示 "+x(e.store.results.length),1)],64))]),e.store.error?(u(),C(A,{key:0,type:"error","show-icon":"",message:e.store.error,closable:"",style:{margin:"12px 0"}},null,8,["message"])):E("v-if",!0),!e.store.isLoading&&e.store.results.length===0&&!e.store.error?(u(),C(j,{key:1,description:e.emptyHint,style:{"margin-top":"40px"}},null,8,["description"])):E("v-if",!0),v("div",He,[(u(!0),S(V,null,se(e.store.results,(g,k)=>(u(),C(e.RendererDispatcher,{key:`r-${k}-${g.id}`,event:g},null,8,["event"]))),128))]),e.store.canLoadMore?(u(),S("div",Ke,[c(s,{loading:e.store.isAppending,onClick:t[2]||(t[2]=g=>e.store.loadMore()),block:""},{default:m(()=>[...t[12]||(t[12]=[b(" 加载下一页 (50 条) ",-1)])]),_:1},8,["loading"])])):E("v-if",!0)])]),_:1})]),_:1})])}const tt=D(Ve,[["render",We],["__scopeId","data-v-0f7c02cd"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/views/PdhVaultBrowser.vue"]]);export{tt as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./xterm-BZcWGsqw.js","./markdown-CsiA8-E5.js","./markdown-Dfs9RUU9.css","./addon-fit-CK6X9sAG.js","./xterm-DFuMZ0ql.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as fe,_ as me,d as V,e as U}from"./index-D1xIbAxQ.js";import{I as z,J as x,U as _,Q as B,S as J,K as T,V as R,c as A,F as K,Z as Q,R as E,o as Z,f as H,w as $,n as D,b as ee,r as S,P as y,_ as ve,a2 as we,a3 as he,a4 as _e}from"./vendor-Bn1JzzAn.js";import{R as ye,b as pe,at as ge}from"./icons-DG5UD-6K.js";const k=new Map,C=new Map,N=new Set,F=new Set;let te=!1;function xe(c){te||(te=!0,c.onMessage(o=>{if(!(!o||typeof o.type!="string")){if(o.type==="terminal.stdout"){const{sessionId:s,data:e,seq:i}=o.payload||{};if(!s)return;let w;try{const d=atob(e||""),f=new Uint8Array(d.length);for(let n=0;n<d.length;n++)f[n]=d.charCodeAt(n);w=new TextDecoder("utf-8").decode(f)}catch{w=""}const u={sessionId:s,data:w,seq:i};k.get(s)?.forEach(d=>d(u)),N.forEach(d=>d(u))}else if(o.type==="terminal.exit"){const{sessionId:s,exitCode:e,signal:i}=o.payload||{};if(!s)return;const w={sessionId:s,exitCode:e,signal:i};C.get(s)?.forEach(u=>u(w)),F.forEach(u=>u(w))}}}))}function ne(c){const o=new TextEncoder().encode(c);let s="";for(let e=0;e<o.length;e++)s+=String.fromCharCode(o[e]);return btoa(s)}function ae(c){const o=atob(c||""),s=new Uint8Array(o.length);for(let e=0;e<o.length;e++)s[e]=o.charCodeAt(e);return new TextDecoder("utf-8").decode(s)}function oe(){const c=fe();xe(c);async function o(n={}){const a=await c.sendRaw({type:"terminal.create",payload:{shell:n.shell,cwd:n.cwd,env:n.env,cols:n.cols,rows:n.rows}});if(a.ok===!1)throw new Error(a.error||"terminal_create_failed");return a.result??a}async function s(){const n=await c.sendRaw({type:"terminal.list",payload:{}});if(n.ok===!1)throw new Error(n.error||"terminal_list_failed");const a=n.result??n;return Array.isArray(a.sessions)?a.sessions:[]}async function e(n,a){const r=await c.sendRaw({type:"terminal.stdin",payload:{sessionId:n,data:ne(String(a))}});if(r.ok===!1)throw new Error(r.error||"terminal_stdin_failed");return r.result??r}async function i(n,a,r){const h=await c.sendRaw({type:"terminal.resize",payload:{sessionId:n,cols:a,rows:r}});if(h.ok===!1)throw new Error(h.error||"terminal_resize_failed");return h.result??h}async function w(n){const a=await c.sendRaw({type:"terminal.close",payload:{sessionId:n}});if(a.ok===!1)throw new Error(a.error||"terminal_close_failed");return a.result??a}async function u(n,a=0){const r=await c.sendRaw({type:"terminal.history",payload:{sessionId:n,fromSeq:a}});if(r.ok===!1)throw new Error(r.error||"terminal_history_failed");const h=r.result??r;return{truncated:!!h.truncated,chunks:(h.chunks||[]).map(L=>({seq:L.seq,data:ae(L.data)}))}}function d(n,a){return n?(k.has(n)||k.set(n,new Set),k.get(n).add(a),()=>{k.get(n)?.delete(a),k.get(n)?.size===0&&k.delete(n)}):(N.add(a),()=>N.delete(a))}function f(n,a){return n?(C.has(n)||C.set(n,new Set),C.get(n).add(a),()=>{C.get(n)?.delete(a),C.get(n)?.size===0&&C.delete(n)}):(F.add(a),()=>F.delete(a))}return{create:o,list:s,stdin:e,resize:i,close:w,history:u,onStdout:d,onExit:f,_internal:{stdoutSubs:k,exitSubs:C,toBase64Utf8:ne,fromBase64Utf8:ae}}}const Se={__name:"Terminal",setup(c,{expose:o}){o();const s=oe(),e=S([]),i=S(null),w=S("pwsh"),u=S(!1),d=S(!1),f=S(""),n=S(""),a=S([]),r=[{value:"pwsh",label:"PowerShell"},{value:"cmd",label:"CMD"},{value:"bash",label:"Bash"},{value:"wsl",label:"WSL"}],h=ee(()=>e.value.find(t=>t.id===i.value));function L(t){return t?t.slice(0,8):""}let O=null,M=null;async function I(){if(O)return{xtermMod:O,fitAddonMod:M};try{O=await U(()=>import("./xterm-BZcWGsqw.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),M=await U(()=>import("./addon-fit-CK6X9sAG.js").then(t=>t.a),__vite__mapDeps([3,1,2]),import.meta.url),await U(()=>Promise.resolve({}),__vite__mapDeps([4]),import.meta.url)}catch(t){throw n.value="xterm 资源加载失败:"+(t?.message||"未知错误"),t}return{xtermMod:O,fitAddonMod:M}}async function q(t){await D();const{xtermMod:l,fitAddonMod:p}=await I(),b=a.value.find(v=>v?.dataset?.sessionId===t.id);if(!b)return;const m=new l.Terminal({cursorBlink:!0,fontFamily:'Consolas, "Courier New", monospace',fontSize:13,theme:{background:"#1e1e1e",foreground:"#d4d4d4"},convertEol:!1}),P=new p.FitAddon;m.loadAddon(P),m.open(b);try{P.fit()}catch{}t.xterm=m,t.fitAddon=P;const ie=m.onData(v=>{s.stdin(t.id,v).catch(g=>{String(g?.message||"").includes("dangerous_keyword_blocked")?V.warning("该命令被桌面端拦截(高危关键字)"):V.error("stdin 失败: "+(g?.message||g))})}),ce=s.onStdout(t.id,({data:v,seq:g})=>{t.lastSeq=g,m.write(v)}),de=s.onExit(t.id,({exitCode:v,signal:g})=>{t.alive=!1,t.exitCode=v,t.signal=g,m.writeln(`\r
|
|
3
|
-
\x1B[33m[session exited, code=${v}, signal=${g??"-"}]\x1B[0m`)});t.offs=()=>{try{ie.dispose?.()}catch{}ce(),de()};try{const{chunks:v,truncated:g}=await s.history(t.id,0);g&&m.writeln("\x1B[2m[history truncated — earlier output was evicted]\x1B[0m");for(const G of v)m.write(G.data),t.lastSeq=G.seq}catch(v){m.writeln(`\x1B[31m[history fetch failed: ${v?.message||v}]\x1B[0m`)}const j=new ResizeObserver(()=>{try{P.fit(),s.resize(t.id,m.cols,m.rows).catch(()=>{})}catch{}});j.observe(b);const ue=t.offs;t.offs=()=>{try{j.disconnect()}catch{}ue()}}async function re(){u.value=!0,f.value="";try{const t=await s.create({shell:w.value,cols:80,rows:24}),l={id:t.sessionId,shell:t.shell,cwd:"",alive:!0,lastSeq:0,exitCode:null,xterm:null,fitAddon:null,offs:()=>{}};e.value.push(l),i.value=l.id,await q(l)}catch(t){f.value=t?.message||String(t)}finally{u.value=!1}}async function se(t){try{await s.close(t)}catch(l){f.value=l?.message||String(l)}setTimeout(()=>W(t),500)}function W(t){const l=e.value.findIndex(b=>b.id===t);if(l===-1)return;const p=e.value[l];try{p.offs?.()}catch{}try{p.xterm?.dispose?.()}catch{}e.value.splice(l,1),i.value===t&&(i.value=e.value[0]?.id||null)}function le(t){i.value=t,D(()=>{const l=e.value.find(p=>p.id===t);try{l?.fitAddon?.fit()}catch{}})}async function X(){d.value=!0,f.value="";try{const t=await s.list();for(const l of t){const p=e.value.find(m=>m.id===l.id);if(p){p.alive=l.alive,p.lastSeq=l.lastSeq;continue}const b={id:l.id,shell:l.shell,cwd:l.cwd,alive:l.alive,lastSeq:l.lastSeq,exitCode:null,xterm:null,fitAddon:null,offs:()=>{}};e.value.push(b),await q(b)}!i.value&&e.value.length>0&&(i.value=e.value[0].id)}catch(t){f.value=t?.message||String(t)}finally{d.value=!1}}Z(async()=>{await X()}),H(()=>{for(const t of e.value){try{t.offs?.()}catch{}try{t.xterm?.dispose?.()}catch{}}}),$(i,()=>{D(()=>{const t=h.value;try{t?.fitAddon?.fit()}catch{}})});const Y={term:s,sessions:e,activeId:i,newShell:w,creating:u,loadingList:d,error:f,warning:n,xtermContainers:a,shellOptions:r,active:h,shortId:L,get xtermMod(){return O},set xtermMod(t){O=t},get fitAddonMod(){return M},set fitAddonMod(t){M=t},loadXterm:I,mountXterm:q,onCreate:re,onClose:se,removeSession:W,activate:le,refreshList:X,ref:S,computed:ee,onMounted:Z,onBeforeUnmount:H,nextTick:D,watch:$,get message(){return V},get PlusOutlined(){return ge},get CloseOutlined(){return pe},get ReloadOutlined(){return ye},get useTerminal(){return oe}};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}},be={class:"terminal-page"},ke={class:"terminal-header"},Ce={class:"page-sub"},Ae={class:"terminal-body"},Ee={class:"session-tabs"},Oe=["onClick"],Te={class:"session-shell"},Re={class:"session-id"},Me={key:0,class:"session-empty"},ze={class:"xterm-host"},Le=["data-session-id"],Pe={key:0,class:"xterm-placeholder"},Be={key:1,class:"terminal-footer"},De={key:0,class:"footer-exit"};function qe(c,o,s,e,i,w){const u=z("a-tag"),d=z("a-select"),f=z("a-button"),n=z("a-space"),a=z("a-alert");return y(),x("div",be,[_("div",ke,[_("div",null,[o[3]||(o[3]=_("h2",{class:"page-title"},"远程终端",-1)),_("p",Ce,[o[2]||(o[2]=B(" 桌面端托管的 PTY 会话;Android 端可远程操控同一通道 ",-1)),e.warning?(y(),J(u,{key:0,color:"orange",style:{"margin-left":"8px"}},{default:T(()=>[B(E(e.warning),1)]),_:1})):R("v-if",!0)])]),A(n,null,{default:T(()=>[A(d,{value:e.newShell,"onUpdate:value":o[0]||(o[0]=r=>e.newShell=r),style:{width:"130px"},size:"small",options:e.shellOptions},null,8,["value"]),A(f,{type:"primary",size:"small",loading:e.creating,onClick:e.onCreate},{icon:T(()=>[A(e.PlusOutlined)]),default:T(()=>[o[4]||(o[4]=B(" 新会话 ",-1))]),_:1},8,["loading"]),A(f,{size:"small",loading:e.loadingList,onClick:e.refreshList},{icon:T(()=>[A(e.ReloadOutlined)]),default:T(()=>[o[5]||(o[5]=B(" 刷新 ",-1))]),_:1},8,["loading"])]),_:1})]),e.error?(y(),J(a,{key:0,message:e.error,type:"error","show-icon":"",closable:"",style:{"margin-bottom":"12px"},onClose:o[1]||(o[1]=r=>e.error="")},null,8,["message"])):R("v-if",!0),_("div",Ae,[_("div",Ee,[(y(!0),x(K,null,Q(e.sessions,r=>(y(),x("div",{key:r.id,class:ve(["session-tab",{active:r.id===e.activeId,dead:!r.alive}]),onClick:h=>e.activate(r.id)},[_("span",Te,E(r.shell),1),_("span",Re,E(e.shortId(r.id)),1),A(e.CloseOutlined,{class:"session-close",onClick:we(h=>e.onClose(r.id),["stop"])},null,8,["onClick"])],10,Oe))),128)),e.sessions.length===0?(y(),x("div",Me,' 点击 "新会话" 创建第一个终端 ')):R("v-if",!0)]),_("div",ze,[(y(!0),x(K,null,Q(e.sessions,r=>he((y(),x("div",{key:r.id,ref_for:!0,ref:"xtermContainers","data-session-id":r.id,class:"xterm-container"},null,8,Le)),[[_e,r.id===e.activeId]])),128)),e.sessions.length===0?(y(),x("div",Pe,[...o[6]||(o[6]=[_("span",null,"无活跃会话",-1)])])):R("v-if",!0)])]),e.active?(y(),x("div",Be,[_("span",null,E(e.active.shell)+" · "+E(e.active.cwd||"(默认 cwd)")+" · seq "+E(e.active.lastSeq),1),e.active.alive?R("v-if",!0):(y(),x("span",De,"已退出 (code="+E(e.active.exitCode??"-")+")",1))])):R("v-if",!0)])}const Fe=me(Se,[["render",qe],["__scopeId","data-v-65366a29"],["__file","/tmp/cc-web-panel-tGOYbB/repo/packages/web-panel/src/views/Terminal.vue"]]);export{Fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as r}from"./index-D1xIbAxQ.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-stTnDJ9y.js";import{a0 as t}from"./index-D1xIbAxQ.js";import"./vendor-Bn1JzzAn.js";import"./responsiveObserve-DUafj9pU.js";import"./useFlexGapSupport-ChecYwC8.js";import"./styleChecker-qO5aCjyk.js";import"./index-DhZgULsY.js";import"./icons-DG5UD-6K.js";const l=t(o);export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./Col-1GP8MvKL.js";import{a0 as t}from"./index-D1xIbAxQ.js";import"./vendor-Bn1JzzAn.js";import"./index-DhZgULsY.js";import"./icons-DG5UD-6K.js";const s=t(o);export{s as default};
|