page-agent-sdk 4.25.4 → 4.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/dist/page-agent-sdk.headless.js +878 -834
- package/dist/page-agent-sdk.iife.js +17 -17
- package/dist/page-agent-sdk.js +617 -559
- package/dist/page-agent-sdk.legacy.js +15406 -15347
- package/dist/page-agent-sdk.umd.cjs +17 -17
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/headless.d.ts +17 -2
- package/types/index.d.ts +22 -4
package/dist/page-agent-sdk.js
CHANGED
|
@@ -1189,11 +1189,11 @@ function hn(e, t) {
|
|
|
1189
1189
|
n[r] = pn(r, e, t);
|
|
1190
1190
|
}), n;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function gn(e, t) {
|
|
1193
1193
|
let n = hn(e, t);
|
|
1194
1194
|
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(L(n, r) && r in t ? n : t, r, i);
|
|
1195
1195
|
}
|
|
1196
|
-
var
|
|
1196
|
+
var U = { get: /* @__PURE__ */ gn(!1, !1) }, _n = { get: /* @__PURE__ */ gn(!1, !0) }, vn = { get: /* @__PURE__ */ gn(!0, !1) }, yn = { get: /* @__PURE__ */ gn(!0, !0) };
|
|
1197
1197
|
function bn(e, t, n) {
|
|
1198
1198
|
let r = /* @__PURE__ */ Fn(n);
|
|
1199
1199
|
if (r !== n && t.call(e, r)) {
|
|
@@ -1215,7 +1215,7 @@ function Tn(e) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
// @__NO_SIDE_EFFECTS__
|
|
1217
1217
|
function En(e) {
|
|
1218
|
-
return /* @__PURE__ */ Mn(e) ? e : An(e, !1, sn,
|
|
1218
|
+
return /* @__PURE__ */ Mn(e) ? e : An(e, !1, sn, U, xn);
|
|
1219
1219
|
}
|
|
1220
1220
|
// @__NO_SIDE_EFFECTS__
|
|
1221
1221
|
function Dn(e) {
|
|
@@ -9561,26 +9561,37 @@ function hg(e = {}) {
|
|
|
9561
9561
|
let t = (t, n) => e.confirm ? !!e.confirm(t, n) : e.tools === void 0 || e.tools.includes(t);
|
|
9562
9562
|
return {
|
|
9563
9563
|
name: "approval",
|
|
9564
|
-
wrapToolCall: async (n, r) =>
|
|
9565
|
-
|
|
9566
|
-
|
|
9564
|
+
wrapToolCall: async (n, r) => e.remember && e.grants?.has(n.name) ? (n.logSink?.({
|
|
9565
|
+
timestamp: Date.now(),
|
|
9566
|
+
type: "middleware",
|
|
9567
|
+
data: {
|
|
9568
|
+
stage: "approval_auto_allowed",
|
|
9569
|
+
toolName: n.name
|
|
9570
|
+
}
|
|
9571
|
+
}), r(n)) : t(n.name, n.args) ? new Promise((t) => {
|
|
9572
|
+
let i = !1, a = [], o = (o) => {
|
|
9573
|
+
if (i) return;
|
|
9574
|
+
i = !0, a.forEach((e) => e());
|
|
9575
|
+
let s = typeof o == "object" && o ? o : null, c = s ? s.approved === !0 : o !== !1, l = !!s?.remember && c;
|
|
9576
|
+
if (l && e.grants?.add(n.name), n.logSink?.({
|
|
9567
9577
|
timestamp: Date.now(),
|
|
9568
9578
|
type: "middleware",
|
|
9569
9579
|
data: {
|
|
9570
9580
|
stage: "approval_resolved",
|
|
9571
9581
|
toolName: n.name,
|
|
9572
|
-
approved:
|
|
9582
|
+
approved: c ? l ? "granted" : String(o).slice(0, 60) : !1
|
|
9573
9583
|
}
|
|
9574
|
-
}),
|
|
9584
|
+
}), c) r(n).then(t, (e) => t({
|
|
9585
|
+
content: `工具执行失败:${e?.message ?? e}`,
|
|
9586
|
+
status: "error"
|
|
9587
|
+
}));
|
|
9588
|
+
else {
|
|
9575
9589
|
let e = n.args ?? {}, r = e.path || e.jsonPath || e.patch?.jsonPath || (Array.isArray(e.patches) ? e.patches.map((e) => e?.jsonPath).filter(Boolean).join(",") : "") || "";
|
|
9576
9590
|
t({
|
|
9577
9591
|
content: `用户拒绝了 ${n.name} 调用${r ? `(path=${r})` : ""}。请改用只读工具、调整路径或换方案后再试。`,
|
|
9578
9592
|
status: "error"
|
|
9579
9593
|
});
|
|
9580
|
-
}
|
|
9581
|
-
content: `工具执行失败:${e?.message ?? e}`,
|
|
9582
|
-
status: "error"
|
|
9583
|
-
}));
|
|
9594
|
+
}
|
|
9584
9595
|
};
|
|
9585
9596
|
if (n.signal) {
|
|
9586
9597
|
if (n.signal.aborted) return o(!1);
|
|
@@ -9613,7 +9624,8 @@ function hg(e = {}) {
|
|
|
9613
9624
|
args: n.args,
|
|
9614
9625
|
resolve: o,
|
|
9615
9626
|
hold: s,
|
|
9616
|
-
...c ? { preview: c } : {}
|
|
9627
|
+
...c ? { preview: c } : {},
|
|
9628
|
+
...e.remember ? { remember: !0 } : {}
|
|
9617
9629
|
}), n.logSink?.({
|
|
9618
9630
|
timestamp: Date.now(),
|
|
9619
9631
|
type: "middleware",
|
|
@@ -9705,7 +9717,7 @@ function yg(e, t = {}) {
|
|
|
9705
9717
|
type: "approval_request",
|
|
9706
9718
|
toolName: n.name,
|
|
9707
9719
|
args: n.args,
|
|
9708
|
-
resolve: o,
|
|
9720
|
+
resolve: (e) => o(typeof e == "object" && e ? e.approved : e),
|
|
9709
9721
|
hold: s
|
|
9710
9722
|
}), n.logSink?.({
|
|
9711
9723
|
timestamp: Date.now(),
|
|
@@ -16733,9 +16745,19 @@ function jS(e, n) {
|
|
|
16733
16745
|
outcome: t,
|
|
16734
16746
|
summary: o.summary
|
|
16735
16747
|
}), !0;
|
|
16736
|
-
}, c =
|
|
16748
|
+
}, c = (e, t, r) => {
|
|
16749
|
+
let i = String(r ?? "未知错误");
|
|
16750
|
+
return n.log("read_failed", {
|
|
16751
|
+
tool: e,
|
|
16752
|
+
message: i.slice(0, 300)
|
|
16753
|
+
}), Q({
|
|
16754
|
+
code: "CONTENT_READ_FAILED",
|
|
16755
|
+
message: `${t}:${i}`,
|
|
16756
|
+
hint: "这是宿主读取通道故障(内容源不可达 / 宿主服务未运行等),不是内容本身的问题 —— 原样重试不会成功;请如实告知用户并说明稍后可重试,不要编造内容。"
|
|
16757
|
+
});
|
|
16758
|
+
}, l = s(async () => {
|
|
16737
16759
|
let e = await kS(r);
|
|
16738
|
-
if (e && typeof e == "object" && "__err" in e) return
|
|
16760
|
+
if (e && typeof e == "object" && "__err" in e) return c("read", `读取当前${r.contentKind}失败`, e.__err);
|
|
16739
16761
|
let t = e;
|
|
16740
16762
|
if (!t || typeof t.content != "string") return "当前没有可编辑的内容对象(宿主 read 返回空)。请如实告知用户,不要编造内容。";
|
|
16741
16763
|
let i = DS(t.content);
|
|
@@ -16747,7 +16769,7 @@ function jS(e, n) {
|
|
|
16747
16769
|
name: r.readToolName,
|
|
16748
16770
|
description: `读取当前${r.contentKind}的原文(修改前必须先调它拿真实基底与 hash)。返回首行是 hash(提案时作 baseHash 原样带回),分隔线后是全文。`,
|
|
16749
16771
|
schema: t.object({})
|
|
16750
|
-
}),
|
|
16772
|
+
}), u = t.object({
|
|
16751
16773
|
summary: t.string().describe("一句话修改说明(展示在评审面板):改了什么、为什么"),
|
|
16752
16774
|
baseHash: t.string().describe("read_content 返回的 hash(基底锚定;基底已变会被拒,须重读)"),
|
|
16753
16775
|
ops: t.array(AS).min(1).max(50).optional().describe("增量操作(顺序应用,原子;推荐 —— token 只花在改动上,勿全量重发)"),
|
|
@@ -16757,21 +16779,21 @@ function jS(e, n) {
|
|
|
16757
16779
|
code: t.ZodIssueCode.custom,
|
|
16758
16780
|
message: "ops 与 content 必须二选一(且只给一个)"
|
|
16759
16781
|
});
|
|
16760
|
-
}),
|
|
16782
|
+
}), d = [l, s(async (e) => {
|
|
16761
16783
|
let t = await kS(r);
|
|
16762
|
-
if (t && typeof t == "object" && "__err" in t) return
|
|
16784
|
+
if (t && typeof t == "object" && "__err" in t) return c("propose", `提案被拒:读取当前${r.contentKind}失败`, t.__err);
|
|
16763
16785
|
let a = t;
|
|
16764
16786
|
if (!a || typeof a.content != "string") return "提案被拒:当前没有可编辑的内容对象。";
|
|
16765
|
-
let o = a.content, s = typeof a.label == "string" ? a.label : void 0,
|
|
16766
|
-
if (e.baseHash !==
|
|
16767
|
-
let
|
|
16787
|
+
let o = a.content, s = typeof a.label == "string" ? a.label : void 0, l = DS(o);
|
|
16788
|
+
if (e.baseHash !== l) return n.log("rejected", { reason: "base_hash_mismatch" }), `提案被拒:基底已变(read_content 之后内容被修改,hash 不匹配)。请重新 ${r.readToolName} 取当前原文与 hash 后基于新基底重提 —— 不要在旧印象上猜测改动。`;
|
|
16789
|
+
let u = Array.isArray(e.ops) && e.ops.length > 0 ? ES(o, e.ops) : {
|
|
16768
16790
|
ok: !0,
|
|
16769
16791
|
content: String(e.content ?? "")
|
|
16770
16792
|
};
|
|
16771
|
-
if (!
|
|
16772
|
-
let
|
|
16773
|
-
if (
|
|
16774
|
-
if (i.pending.some((e) => e.baseHash ===
|
|
16793
|
+
if (!u.ok) return n.log("rejected", { reason: "ops_error" }), `提案被拒:${u.error}`;
|
|
16794
|
+
let d = u.content;
|
|
16795
|
+
if (d === o) return n.log("rejected", { reason: "identical_to_base" }), "提案内容与当前源文完全相同,未打开评审面板。";
|
|
16796
|
+
if (i.pending.some((e) => e.baseHash === l && e.content === d)) return n.log("rejected", { reason: "identical_pending" }), "提案与在审提案内容完全相同(在审面板仍有效,未被替换)。";
|
|
16775
16797
|
for (; i.pending.length >= r.maxPending;) {
|
|
16776
16798
|
let e = i.pending.shift();
|
|
16777
16799
|
e && n.log("replaced", {
|
|
@@ -16780,43 +16802,43 @@ function jS(e, n) {
|
|
|
16780
16802
|
});
|
|
16781
16803
|
}
|
|
16782
16804
|
i.seq += 1;
|
|
16783
|
-
let
|
|
16805
|
+
let f = {
|
|
16784
16806
|
id: `prop-${i.seq}-${Date.now().toString(36)}`,
|
|
16785
16807
|
summary: String(e.summary || "(无说明)"),
|
|
16786
16808
|
...s ? { label: s } : {},
|
|
16787
|
-
baseHash:
|
|
16809
|
+
baseHash: l,
|
|
16788
16810
|
baseContent: o,
|
|
16789
|
-
content:
|
|
16790
|
-
diff: CS(o,
|
|
16811
|
+
content: d,
|
|
16812
|
+
diff: CS(o, d),
|
|
16791
16813
|
createdAt: Date.now()
|
|
16792
16814
|
};
|
|
16793
|
-
i.pending.push(
|
|
16794
|
-
id:
|
|
16795
|
-
summary:
|
|
16796
|
-
added:
|
|
16797
|
-
removed:
|
|
16815
|
+
i.pending.push(f), n.log("pending", {
|
|
16816
|
+
id: f.id,
|
|
16817
|
+
summary: f.summary.slice(0, 80),
|
|
16818
|
+
added: f.diff.stats.added,
|
|
16819
|
+
removed: f.diff.stats.removed
|
|
16798
16820
|
}), n.emit({
|
|
16799
16821
|
type: "proposal_pending",
|
|
16800
|
-
id:
|
|
16801
|
-
summary:
|
|
16802
|
-
added:
|
|
16803
|
-
removed:
|
|
16822
|
+
id: f.id,
|
|
16823
|
+
summary: f.summary,
|
|
16824
|
+
added: f.diff.stats.added,
|
|
16825
|
+
removed: f.diff.stats.removed
|
|
16804
16826
|
});
|
|
16805
|
-
let
|
|
16827
|
+
let p = "";
|
|
16806
16828
|
try {
|
|
16807
|
-
|
|
16829
|
+
p = await r.onProposal(f);
|
|
16808
16830
|
} catch (e) {
|
|
16809
16831
|
return n.log("on_proposal_error", { message: String(e?.message ?? e).slice(0, 160) }), `提案已送达,但打开评审面板时出错(${String(e?.message ?? e)})。请如实告知用户。`;
|
|
16810
16832
|
}
|
|
16811
|
-
let
|
|
16812
|
-
return typeof
|
|
16833
|
+
let m = `(diff 统计:+${f.diff.stats.added} / -${f.diff.stats.removed} 行;提案待用户在评审面板确认,点「应用」才会写回 —— 请如实告知用户当前是待确认状态。)`;
|
|
16834
|
+
return typeof p == "string" && p.trim() ? `${p}\n${m}` : `提案已送达,评审面板已打开。${m}`;
|
|
16813
16835
|
}, {
|
|
16814
16836
|
name: r.toolName,
|
|
16815
16837
|
description: `提交${r.contentKind}修改提案(仅送达,用户确认才生效)。先 ${r.readToolName} 取基底与 hash,再带 baseHash 提案;优先用 ops 增量操作(token 只花在改动上),锚点用原文字面片段且须唯一命中。`,
|
|
16816
|
-
schema:
|
|
16838
|
+
schema: u
|
|
16817
16839
|
})];
|
|
16818
|
-
return Wu(
|
|
16819
|
-
tools:
|
|
16840
|
+
return Wu(d), {
|
|
16841
|
+
tools: d,
|
|
16820
16842
|
state: i,
|
|
16821
16843
|
resolve: o,
|
|
16822
16844
|
snapshot: a
|
|
@@ -17661,7 +17683,7 @@ function qC(e, n, r) {
|
|
|
17661
17683
|
prompt_tokens: 0,
|
|
17662
17684
|
completion_tokens: 0,
|
|
17663
17685
|
total_tokens: 0
|
|
17664
|
-
}, o = Iy(() =>
|
|
17686
|
+
}, o = Iy(() => Zt, () => e.conflictPolicy ?? "ask", () => U.agent?.debugLogs?.value), c = /* @__PURE__ */ W(0), l = db(e.storage);
|
|
17665
17687
|
l && (e.debug && l.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), l.onEvent((e) => {
|
|
17666
17688
|
e.type === "quota" && U.agent?.debugLogs?.value?.push({
|
|
17667
17689
|
timestamp: Date.now(),
|
|
@@ -17683,7 +17705,7 @@ function qC(e, n, r) {
|
|
|
17683
17705
|
e.debug && !d && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
17684
17706
|
let b = /* @__PURE__ */ En([]), x = g_(e.vfs?.initialFiles, {
|
|
17685
17707
|
persist: l ? { save: (e) => {
|
|
17686
|
-
|
|
17708
|
+
Cn.persistSave({ vfs: e });
|
|
17687
17709
|
} } : void 0,
|
|
17688
17710
|
maxBytes: e.vfs?.maxBytes,
|
|
17689
17711
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -17703,7 +17725,7 @@ function qC(e, n, r) {
|
|
|
17703
17725
|
data: { stage: "resume_notice" }
|
|
17704
17726
|
});
|
|
17705
17727
|
}), A = Cb(), ee = e.approval?.timeoutMs, j = ee !== void 0 && Number.isFinite(ee) && ee > 0 ? ee : ee !== void 0 && (!Number.isFinite(ee) || ee < 0) ? 0 : 3e4, te = (e) => {
|
|
17706
|
-
|
|
17728
|
+
Zt({
|
|
17707
17729
|
type: "error",
|
|
17708
17730
|
message: `确认请求(${e.toolName})${Math.round(e.waitedMs / 1e3)}s 无响应已自动拒绝 —— 当前路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
17709
17731
|
severity: "observable",
|
|
@@ -17711,7 +17733,7 @@ function qC(e, n, r) {
|
|
|
17711
17733
|
context: e
|
|
17712
17734
|
});
|
|
17713
17735
|
}, M = yg((e) => {
|
|
17714
|
-
A.lastPlanConfirmation = e,
|
|
17736
|
+
A.lastPlanConfirmation = e, Cn.persistSave({ planConfirmation: e }), U.agent?.debugLogs?.value?.push({
|
|
17715
17737
|
timestamp: Date.now(),
|
|
17716
17738
|
type: "middleware",
|
|
17717
17739
|
data: {
|
|
@@ -17726,7 +17748,7 @@ function qC(e, n, r) {
|
|
|
17726
17748
|
}), re = Km({
|
|
17727
17749
|
getSchema: () => Te()?.schema,
|
|
17728
17750
|
getBind: () => Te()?.bind,
|
|
17729
|
-
onChange: (e) =>
|
|
17751
|
+
onChange: (e) => Zt({
|
|
17730
17752
|
type: "focus_change",
|
|
17731
17753
|
focuses: e
|
|
17732
17754
|
})
|
|
@@ -17876,7 +17898,7 @@ function qC(e, n, r) {
|
|
|
17876
17898
|
let Be = e.proposals ? jS(e.proposals, {
|
|
17877
17899
|
emit: (e) => {
|
|
17878
17900
|
try {
|
|
17879
|
-
|
|
17901
|
+
Zt(e);
|
|
17880
17902
|
} catch {}
|
|
17881
17903
|
},
|
|
17882
17904
|
log: (e, t) => {
|
|
@@ -17978,16 +18000,18 @@ function qC(e, n, r) {
|
|
|
17978
18000
|
e.debug && z.agentCompression && !p && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
17979
18001
|
let mt = z.memory, ht = z.subagent, gt = ht ? Nh() : void 0, _t = e.verify?.maxAttempts ?? 2, vt = !!(e.verify?.check || e.verify?.maxAttempts || e.verify?.adversarial), yt = e.capabilities?.verify === !1, bt = (z.verify || vt && !yt) && e.verify?.enabled !== !1 && _t > 0, xt = z.contextInspector;
|
|
17980
18002
|
vt && !bt && e.verify?.enabled !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
|
|
17981
|
-
let St = e.subagent, Ct = St?.allowedTools ?? [], wt = e.permissions?.length ? mg(e.permissions) : void 0, Tt = e.approval?.preview === !0 && Ce ? (e, t) => e === "write" ? Ce(t) : null : void 0, Et = e.approval?.previewWrite || Tt ? (t, n) => e.approval?.previewWrite?.(t, n) ?? Tt?.(t, n) ?? null : void 0, Dt = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? hg({
|
|
18003
|
+
let St = e.subagent, Ct = St?.allowedTools ?? [], wt = e.permissions?.length ? mg(e.permissions) : void 0, Tt = e.approval?.preview === !0 && Ce ? (e, t) => e === "write" ? Ce(t) : null : void 0, Et = e.approval?.previewWrite || Tt ? (t, n) => e.approval?.previewWrite?.(t, n) ?? Tt?.(t, n) ?? null : void 0, Dt = /* @__PURE__ */ new Set(), Ot = e.approval && (e.approval.tools !== void 0 || e.approval.confirm || e.approval.remember === !0) ? hg({
|
|
17982
18004
|
...e.approval,
|
|
18005
|
+
remember: e.approval.remember === !0,
|
|
18006
|
+
grants: Dt,
|
|
17983
18007
|
timeoutMs: e.approval.timeoutMs ?? j,
|
|
17984
18008
|
onAutoReject: te,
|
|
17985
18009
|
previewWrite: Et
|
|
17986
|
-
}) : void 0,
|
|
18010
|
+
}) : void 0, kt = [
|
|
17987
18011
|
...wt ? [wt] : [],
|
|
17988
|
-
...
|
|
18012
|
+
...Ot ? [Ot] : [],
|
|
17989
18013
|
...ke ? [ke] : []
|
|
17990
|
-
],
|
|
18014
|
+
], At = !ht || St?.enabled === !1 ? void 0 : $h({
|
|
17991
18015
|
llm: St?.llm ?? e.llm,
|
|
17992
18016
|
allTools: () => U.agent?.allTools ?? H,
|
|
17993
18017
|
allowedTools: Ct.length ? Ct : void 0,
|
|
@@ -18003,7 +18027,7 @@ function qC(e, n, r) {
|
|
|
18003
18027
|
getFocuses: () => re.getActiveFocuses(),
|
|
18004
18028
|
getSchema: () => Te()?.schema ?? null,
|
|
18005
18029
|
tracker: gt,
|
|
18006
|
-
guardMiddleware:
|
|
18030
|
+
guardMiddleware: kt.length ? kt : void 0,
|
|
18007
18031
|
getVfsFiles: dt ? () => x.files : void 0,
|
|
18008
18032
|
enterDataScope: Se?.enterScope ? (e) => Se.enterScope(e) : void 0,
|
|
18009
18033
|
exitDataScope: Se?.exitScope ? (e) => Se.exitScope(e) : void 0,
|
|
@@ -18011,7 +18035,7 @@ function qC(e, n, r) {
|
|
|
18011
18035
|
a.prompt_tokens = (a.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), a.completion_tokens = (a.completion_tokens ?? 0) + (e.completion_tokens ?? 0), a.total_tokens = (a.total_tokens ?? 0) + (e.total_tokens ?? 0), e.reasoning_tokens && (a.reasoning_tokens = (a.reasoning_tokens ?? 0) + e.reasoning_tokens);
|
|
18012
18036
|
},
|
|
18013
18037
|
timeoutMs: St?.timeoutMs
|
|
18014
|
-
}),
|
|
18038
|
+
}), jt = de?.map((e) => {
|
|
18015
18039
|
if (!e._codeAsset) return e;
|
|
18016
18040
|
let t = e._codeAsset, n = Dv({
|
|
18017
18041
|
writablePaths: t.writablePaths,
|
|
@@ -18028,19 +18052,19 @@ function qC(e, n, r) {
|
|
|
18028
18052
|
...e,
|
|
18029
18053
|
middleware: r
|
|
18030
18054
|
};
|
|
18031
|
-
}),
|
|
18055
|
+
}), Mt = fe && ht ? Ov() : void 0, Nt = Mt ? Fv({
|
|
18032
18056
|
getBind: () => Te()?.bind,
|
|
18033
18057
|
writablePaths: pe,
|
|
18034
|
-
getLocked: () =>
|
|
18058
|
+
getLocked: () => Mt.locked(),
|
|
18035
18059
|
tools: H,
|
|
18036
18060
|
getCodeFieldPaths: () => Nv(Te()?.bind, I.map((e) => ({
|
|
18037
18061
|
writablePaths: e._codeAsset.writablePaths,
|
|
18038
18062
|
codeField: e._codeAsset.codeField
|
|
18039
18063
|
})))
|
|
18040
|
-
}) : void 0,
|
|
18064
|
+
}) : void 0, Pt = Se?.getSummarizedPaths && Se.clearSummarizedPaths ? Rv({
|
|
18041
18065
|
getSummarizedPaths: () => Se.getSummarizedPaths(),
|
|
18042
18066
|
clearSummarizedPaths: () => Se.clearSummarizedPaths()
|
|
18043
|
-
}) : void 0,
|
|
18067
|
+
}) : void 0, Ft = ht && jt !== void 0 ? ng(jt, {
|
|
18044
18068
|
llm: e.llm,
|
|
18045
18069
|
thinkingModeDefault: e.subagent?.thinkingMode,
|
|
18046
18070
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
@@ -18050,7 +18074,7 @@ function qC(e, n, r) {
|
|
|
18050
18074
|
getSchema: () => Te()?.schema ?? null,
|
|
18051
18075
|
getBind: () => Te()?.bind,
|
|
18052
18076
|
tracker: gt,
|
|
18053
|
-
guardMiddleware:
|
|
18077
|
+
guardMiddleware: kt.length ? kt : void 0,
|
|
18054
18078
|
getVfsFiles: dt ? () => x.files : void 0,
|
|
18055
18079
|
enterDataScope: Se?.enterScope ? (e) => Se.enterScope(e) : void 0,
|
|
18056
18080
|
exitDataScope: Se?.exitScope ? (e) => Se.exitScope(e) : void 0,
|
|
@@ -18058,30 +18082,30 @@ function qC(e, n, r) {
|
|
|
18058
18082
|
a.prompt_tokens = (a.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), a.completion_tokens = (a.completion_tokens ?? 0) + (e.completion_tokens ?? 0), a.total_tokens = (a.total_tokens ?? 0) + (e.total_tokens ?? 0), e.reasoning_tokens && (a.reasoning_tokens = (a.reasoning_tokens ?? 0) + e.reasoning_tokens);
|
|
18059
18083
|
},
|
|
18060
18084
|
timeoutMs: e.subagent?.timeoutMs,
|
|
18061
|
-
...
|
|
18062
|
-
componentLock:
|
|
18085
|
+
...Mt ? {
|
|
18086
|
+
componentLock: Mt,
|
|
18063
18087
|
resolveComponents: (e) => kv(e, Cv(Te()?.bind, pe))
|
|
18064
18088
|
} : {}
|
|
18065
|
-
}) : void 0,
|
|
18089
|
+
}) : void 0, It = Ft ? Ft.controller : null, Lt = (t) => {
|
|
18066
18090
|
let n = t.thinkingMode ?? e.subagent?.thinkingMode, r = n ? wy(t.llm ?? e.llm) ? "instance-noop" : "applied" : "inherited";
|
|
18067
18091
|
return {
|
|
18068
18092
|
...t,
|
|
18069
18093
|
...n ? { thinkingMode: n } : {},
|
|
18070
18094
|
thinkingApplied: r
|
|
18071
18095
|
};
|
|
18072
|
-
},
|
|
18096
|
+
}, Rt = ["read", "fetch_document"], zt = H.filter((e) => Rt.includes(e.name)), Bt = bt ? Ag({
|
|
18073
18097
|
check: e.verify.check ?? Ig({
|
|
18074
18098
|
schemas: () => Te() ? { "": Te().schema } : {},
|
|
18075
18099
|
root: () => Te()?.bind
|
|
18076
18100
|
}),
|
|
18077
18101
|
adversarial: e.verify?.adversarial ? {
|
|
18078
18102
|
llm: e.llm,
|
|
18079
|
-
tools:
|
|
18103
|
+
tools: zt
|
|
18080
18104
|
} : void 0
|
|
18081
|
-
}) : void 0,
|
|
18105
|
+
}) : void 0, Vt = xt ? Xg({
|
|
18082
18106
|
contextWindow: m.contextWindow,
|
|
18083
18107
|
thresholdRatio: bb(e, m.contextWindow).summaryThresholdRatio
|
|
18084
|
-
}) : void 0,
|
|
18108
|
+
}) : void 0, Ht = OC({
|
|
18085
18109
|
...z,
|
|
18086
18110
|
humanConfirm: Ye,
|
|
18087
18111
|
screenshot: !!Pe,
|
|
@@ -18089,21 +18113,21 @@ function qC(e, n, r) {
|
|
|
18089
18113
|
hasActions: !!e.actions && Object.keys(e.actions).length > 0,
|
|
18090
18114
|
hasProposals: !!e.proposals,
|
|
18091
18115
|
viewImage: !!Ne,
|
|
18092
|
-
subagents: de?.map(
|
|
18093
|
-
}, _e && !!se, { promptSoftCap: Oh(m.contextWindow, h.promptSoftCapTokens) }),
|
|
18116
|
+
subagents: de?.map(Lt)
|
|
18117
|
+
}, _e && !!se, { promptSoftCap: Oh(m.contextWindow, h.promptSoftCapTokens) }), Ut = z.pageContext ? AC({
|
|
18094
18118
|
getPageInfo: () => typeof document < "u" && typeof location < "u" ? {
|
|
18095
18119
|
title: document.title || "",
|
|
18096
18120
|
url: location.href
|
|
18097
18121
|
} : null,
|
|
18098
18122
|
canReadPage: z.domInspect === !0
|
|
18099
|
-
}) : void 0,
|
|
18123
|
+
}) : void 0, Wt = {
|
|
18100
18124
|
epoch: 0,
|
|
18101
18125
|
notices: [],
|
|
18102
18126
|
readsInvalidated: 0
|
|
18103
|
-
},
|
|
18127
|
+
}, Gt = 0, Kt = {
|
|
18104
18128
|
name: "hostNotice",
|
|
18105
18129
|
beforeAgent: () => {
|
|
18106
|
-
|
|
18130
|
+
Gt = Wt.epoch;
|
|
18107
18131
|
},
|
|
18108
18132
|
wrapModelCall: async (e, t) => {
|
|
18109
18133
|
if (Le) {
|
|
@@ -18121,18 +18145,18 @@ function qC(e, n, r) {
|
|
|
18121
18145
|
});
|
|
18122
18146
|
}
|
|
18123
18147
|
}
|
|
18124
|
-
if (
|
|
18125
|
-
|
|
18126
|
-
let t =
|
|
18148
|
+
if (Wt.epoch > Gt) {
|
|
18149
|
+
Gt = Wt.epoch;
|
|
18150
|
+
let t = Wt.notices[Wt.notices.length - 1] ?? "", n = Ud(e.messages, t || void 0, Ge);
|
|
18127
18151
|
if (n.invalidatedCount > 0) {
|
|
18128
18152
|
for (let t = 0; t < n.messages.length; t++) e.messages[t] = n.messages[t];
|
|
18129
|
-
|
|
18153
|
+
Wt.readsInvalidated += n.invalidatedCount, U.agent?.debugLogs?.value?.push({
|
|
18130
18154
|
timestamp: Date.now(),
|
|
18131
18155
|
type: "middleware",
|
|
18132
18156
|
data: {
|
|
18133
18157
|
stage: "host_read_invalidated",
|
|
18134
18158
|
count: n.invalidatedCount,
|
|
18135
|
-
epoch:
|
|
18159
|
+
epoch: Wt.epoch,
|
|
18136
18160
|
reason: t || void 0
|
|
18137
18161
|
}
|
|
18138
18162
|
});
|
|
@@ -18140,24 +18164,24 @@ function qC(e, n, r) {
|
|
|
18140
18164
|
}
|
|
18141
18165
|
return t(e);
|
|
18142
18166
|
},
|
|
18143
|
-
augmentPrompt: () =>
|
|
18167
|
+
augmentPrompt: () => Wt.notices.length ? [
|
|
18144
18168
|
"【宿主页面已变更】",
|
|
18145
|
-
...
|
|
18169
|
+
...Wt.notices.filter(Boolean).map((e) => `· ${e}`),
|
|
18146
18170
|
z.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
|
|
18147
18171
|
].join("\n") : void 0,
|
|
18148
18172
|
afterAgent: () => {
|
|
18149
|
-
|
|
18173
|
+
Wt.notices.length = 0;
|
|
18150
18174
|
}
|
|
18151
|
-
},
|
|
18175
|
+
}, qt = Be ? {
|
|
18152
18176
|
name: "proposalNotice",
|
|
18153
18177
|
augmentPrompt: () => Be.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...Be.state.notices].join("\n") : void 0,
|
|
18154
18178
|
afterAgent: () => {
|
|
18155
18179
|
Be.state.notices.length = 0;
|
|
18156
18180
|
}
|
|
18157
|
-
} : null,
|
|
18181
|
+
} : null, Jt = se ? {
|
|
18158
18182
|
name: "dataHint",
|
|
18159
18183
|
augmentPrompt: () => d_(Te(), e.schemaHint) || void 0
|
|
18160
|
-
} : null,
|
|
18184
|
+
} : null, Yt = e.augmentSystem ? {
|
|
18161
18185
|
name: "augmentSystem",
|
|
18162
18186
|
augmentPrompt: (t) => {
|
|
18163
18187
|
try {
|
|
@@ -18170,47 +18194,47 @@ function qC(e, n, r) {
|
|
|
18170
18194
|
return;
|
|
18171
18195
|
}
|
|
18172
18196
|
}
|
|
18173
|
-
} : null,
|
|
18197
|
+
} : null, Xt = _b(e.onEvent), Zt = Xt.emit, Qt, $t = [], en = (e) => ({
|
|
18174
18198
|
name: e.name,
|
|
18175
18199
|
description: e.description,
|
|
18176
18200
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
18177
|
-
}),
|
|
18201
|
+
}), tn = (e) => ({
|
|
18178
18202
|
name: e.name,
|
|
18179
18203
|
description: e.description,
|
|
18180
18204
|
getContent: () => e.content
|
|
18181
|
-
}),
|
|
18205
|
+
}), nn = e.skillStorage === !1 ? null : IC({
|
|
18182
18206
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
18183
18207
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
18184
|
-
}),
|
|
18185
|
-
let t =
|
|
18208
|
+
}), rn = () => {
|
|
18209
|
+
let t = Qt ? Qt.controller : null;
|
|
18186
18210
|
if (t) {
|
|
18187
|
-
let n = (e.skills || []).filter((e) =>
|
|
18188
|
-
t.set([...n,
|
|
18211
|
+
let n = (e.skills || []).filter((e) => !$t.some((t) => t.name === e.name));
|
|
18212
|
+
t.set([...n, ...$t]);
|
|
18189
18213
|
}
|
|
18190
18214
|
U.infoTick.value++;
|
|
18191
|
-
},
|
|
18192
|
-
if (
|
|
18193
|
-
let t = await
|
|
18215
|
+
}, an = async () => {
|
|
18216
|
+
if (nn) try {
|
|
18217
|
+
let t = await nn.list();
|
|
18194
18218
|
if (t.length) {
|
|
18195
|
-
|
|
18196
|
-
let n =
|
|
18219
|
+
$t = t.map(tn);
|
|
18220
|
+
let n = Qt ? Qt.controller : null;
|
|
18197
18221
|
if (n) {
|
|
18198
|
-
let t = (e.skills || []).filter((e) =>
|
|
18199
|
-
n.set([...t,
|
|
18222
|
+
let t = (e.skills || []).filter((e) => !$t.some((t) => t.name === e.name));
|
|
18223
|
+
n.set([...t, ...$t]);
|
|
18200
18224
|
}
|
|
18201
18225
|
U.infoTick.value++;
|
|
18202
18226
|
}
|
|
18203
18227
|
} catch {}
|
|
18204
|
-
},
|
|
18228
|
+
}, on = ft ? Mh({
|
|
18205
18229
|
...h,
|
|
18206
18230
|
llmInvoke: d,
|
|
18207
18231
|
getRegisteredData: () => Te() ? [{ description: Te().description ?? "主数据对象" }] : [],
|
|
18208
18232
|
preserveLastToolResults: _,
|
|
18209
18233
|
...pt ? {
|
|
18210
18234
|
decideInvoke: p,
|
|
18211
|
-
getSnapshot: () =>
|
|
18235
|
+
getSnapshot: () => Vt?.getSnapshot()
|
|
18212
18236
|
} : {}
|
|
18213
|
-
}) : void 0,
|
|
18237
|
+
}) : void 0, sn = ut ? sh([
|
|
18214
18238
|
...z.domInspect && !(e.skills || []).some((e) => e.name === "dom-inspect") ? [aC({
|
|
18215
18239
|
withScreenshot: !!Pe,
|
|
18216
18240
|
withDomEdit: z.domEdit,
|
|
@@ -18232,20 +18256,20 @@ function qC(e, n, r) {
|
|
|
18232
18256
|
H = ot(), U.agent && U.agent.setTools(H), U.infoTick.value++;
|
|
18233
18257
|
}
|
|
18234
18258
|
}) : void 0;
|
|
18235
|
-
|
|
18236
|
-
let
|
|
18259
|
+
Qt = sn;
|
|
18260
|
+
let cn = Sb([
|
|
18261
|
+
...Jt ? [Jt] : [],
|
|
18262
|
+
Ht,
|
|
18263
|
+
...Ut ? [Ut] : [],
|
|
18264
|
+
Kt,
|
|
18237
18265
|
...qt ? [qt] : [],
|
|
18238
|
-
Vt,
|
|
18239
|
-
...Ht ? [Ht] : [],
|
|
18240
|
-
Gt,
|
|
18241
|
-
...Kt ? [Kt] : [],
|
|
18242
18266
|
...ct ? [T] : [],
|
|
18243
18267
|
O,
|
|
18244
18268
|
k,
|
|
18245
18269
|
...st ? [C] : [],
|
|
18246
|
-
...
|
|
18270
|
+
...sn ? [sn] : [],
|
|
18247
18271
|
...dt ? [w_(x)] : [],
|
|
18248
|
-
...
|
|
18272
|
+
...on ? [on] : [],
|
|
18249
18273
|
...lt ? [ie] : [],
|
|
18250
18274
|
...Qe ? [re] : [],
|
|
18251
18275
|
...we ? [we] : [],
|
|
@@ -18253,52 +18277,52 @@ function qC(e, n, r) {
|
|
|
18253
18277
|
...wt ? [wt] : [],
|
|
18254
18278
|
...ge && R && L ? [Og(L)] : [],
|
|
18255
18279
|
...Ye ? [M] : [],
|
|
18256
|
-
...
|
|
18280
|
+
...Ot ? [Ot] : [],
|
|
18257
18281
|
...ke ? [ke] : [],
|
|
18258
|
-
...
|
|
18259
|
-
...
|
|
18260
|
-
...
|
|
18261
|
-
...Mt ? [Mt] : [],
|
|
18282
|
+
...Bt ? [Bt] : [],
|
|
18283
|
+
...At ? [At] : [],
|
|
18284
|
+
...Ft ? [Ft] : [],
|
|
18262
18285
|
...Nt ? [Nt] : [],
|
|
18286
|
+
...Pt ? [Pt] : [],
|
|
18263
18287
|
...Se && ht ? [Vv({
|
|
18264
18288
|
getBind: () => Te()?.bind,
|
|
18265
18289
|
getTools: () => U.agent?.allTools ?? H
|
|
18266
18290
|
})] : [],
|
|
18267
|
-
...
|
|
18268
|
-
...
|
|
18291
|
+
...Yt ? [Yt] : [],
|
|
18292
|
+
...Vt ? [Vt] : [],
|
|
18269
18293
|
...Ie ? [Ie] : [],
|
|
18270
18294
|
...e.middleware || [],
|
|
18271
18295
|
...B ? [gC(a, {
|
|
18272
18296
|
tokenBudget: e.tokenBudget,
|
|
18273
18297
|
timeBudgetMs: e.timeBudgetMs
|
|
18274
|
-
},
|
|
18275
|
-
GC(
|
|
18276
|
-
]),
|
|
18277
|
-
function
|
|
18298
|
+
}, Zt)] : [],
|
|
18299
|
+
GC(Zt, b, Te, a)
|
|
18300
|
+
]), ln = e.maxMemoryRounds ?? VC;
|
|
18301
|
+
function un(e) {
|
|
18278
18302
|
return (e) => {
|
|
18279
|
-
e.type !== "approval_request" &&
|
|
18303
|
+
e.type !== "approval_request" && Zt(Me(e));
|
|
18280
18304
|
};
|
|
18281
18305
|
}
|
|
18282
|
-
let
|
|
18283
|
-
function
|
|
18306
|
+
let dn = /* @__PURE__ */ W([]), fn = BC(), pn = /* @__PURE__ */ new Set();
|
|
18307
|
+
function mn(e) {
|
|
18284
18308
|
let t = new AbortController(), n = () => t.abort();
|
|
18285
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })),
|
|
18309
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), pn.add(t), {
|
|
18286
18310
|
controller: t,
|
|
18287
18311
|
untrack: () => {
|
|
18288
|
-
|
|
18312
|
+
pn.delete(t), e?.removeEventListener("abort", n);
|
|
18289
18313
|
}
|
|
18290
18314
|
};
|
|
18291
18315
|
}
|
|
18292
|
-
function
|
|
18293
|
-
for (let e of
|
|
18294
|
-
|
|
18316
|
+
function hn() {
|
|
18317
|
+
for (let e of pn) e.abort();
|
|
18318
|
+
pn.clear();
|
|
18295
18319
|
}
|
|
18296
|
-
let
|
|
18320
|
+
let gn = /* @__PURE__ */ W(null), U = {
|
|
18297
18321
|
agentId: n,
|
|
18298
18322
|
store: l,
|
|
18299
18323
|
messages: b,
|
|
18300
18324
|
vfsStore: x,
|
|
18301
|
-
listeners:
|
|
18325
|
+
listeners: Xt.listeners,
|
|
18302
18326
|
todosMw: C,
|
|
18303
18327
|
memoryMw: ae,
|
|
18304
18328
|
missionMw: T,
|
|
@@ -18313,18 +18337,18 @@ function qC(e, n, r) {
|
|
|
18313
18337
|
mcpFailed: [],
|
|
18314
18338
|
checkpoint: L,
|
|
18315
18339
|
dataOpsController: Se,
|
|
18316
|
-
skillsController:
|
|
18340
|
+
skillsController: Qt ? Qt.controller : null,
|
|
18317
18341
|
infoTick: c,
|
|
18318
18342
|
pendingConflict: o.pendingConflict,
|
|
18319
|
-
pendingQuote:
|
|
18320
|
-
sessions:
|
|
18321
|
-
refreshSessions: () =>
|
|
18343
|
+
pendingQuote: gn,
|
|
18344
|
+
sessions: dn,
|
|
18345
|
+
refreshSessions: () => Cn.refreshSessions(),
|
|
18322
18346
|
liveData: Te,
|
|
18323
18347
|
usage: a,
|
|
18324
|
-
emit:
|
|
18325
|
-
runSerial:
|
|
18326
|
-
trackActive:
|
|
18327
|
-
abortAllActive:
|
|
18348
|
+
emit: Zt,
|
|
18349
|
+
runSerial: fn,
|
|
18350
|
+
trackActive: mn,
|
|
18351
|
+
abortAllActive: hn,
|
|
18328
18352
|
unloadSkillTools(e) {
|
|
18329
18353
|
if (e) {
|
|
18330
18354
|
let t = it.length;
|
|
@@ -18347,21 +18371,21 @@ function qC(e, n, r) {
|
|
|
18347
18371
|
}
|
|
18348
18372
|
}
|
|
18349
18373
|
}
|
|
18350
|
-
|
|
18374
|
+
bn();
|
|
18351
18375
|
},
|
|
18352
18376
|
addSkill(e) {
|
|
18353
|
-
let t =
|
|
18354
|
-
t >= 0 ?
|
|
18377
|
+
let t = $t.findIndex((t) => t.name === e.name);
|
|
18378
|
+
t >= 0 ? $t[t] = e : $t.push(e), rn(), nn && nn.put(en(e));
|
|
18355
18379
|
},
|
|
18356
18380
|
removeSkill(e) {
|
|
18357
|
-
let t =
|
|
18358
|
-
return t < 0 ? !1 : (
|
|
18381
|
+
let t = $t.findIndex((t) => t.name === e);
|
|
18382
|
+
return t < 0 ? !1 : ($t.splice(t, 1), rn(), nn && nn.remove(e), !0);
|
|
18359
18383
|
},
|
|
18360
18384
|
listUserSkills() {
|
|
18361
|
-
return
|
|
18385
|
+
return $t.map((e) => e.name);
|
|
18362
18386
|
},
|
|
18363
18387
|
getUserSkill(e) {
|
|
18364
|
-
let t =
|
|
18388
|
+
let t = $t.find((t) => t.name === e);
|
|
18365
18389
|
if (t) return {
|
|
18366
18390
|
name: t.name,
|
|
18367
18391
|
description: t.description,
|
|
@@ -18369,7 +18393,7 @@ function qC(e, n, r) {
|
|
|
18369
18393
|
};
|
|
18370
18394
|
},
|
|
18371
18395
|
afterRound() {
|
|
18372
|
-
|
|
18396
|
+
xn(), Cn.persistRuntime();
|
|
18373
18397
|
},
|
|
18374
18398
|
clearCodeReuse() {
|
|
18375
18399
|
let e = x;
|
|
@@ -18380,9 +18404,9 @@ function qC(e, n, r) {
|
|
|
18380
18404
|
t ??= {}, t?.mission && ct && T.setMission(t.mission);
|
|
18381
18405
|
let n = e, r = (t.images ?? []).filter((e) => e && (e.dataUri || e.vfsRef || e.url));
|
|
18382
18406
|
if (r.length > 4) throw Error(`[page-agent-sdk] 单轮最多 4 张图片(收到 ${r.length})`);
|
|
18383
|
-
if (r.length && (await
|
|
18407
|
+
if (r.length && (await Sn.stowImages(r), await Sn.describeIfNeeded(r, n)), r.length && !m.vision && !r.every((e) => e.description)) {
|
|
18384
18408
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述(集成方识图子 agent / 自有 vision API)";
|
|
18385
|
-
throw
|
|
18409
|
+
throw Zt({
|
|
18386
18410
|
type: "error",
|
|
18387
18411
|
message: e,
|
|
18388
18412
|
severity: "recoverable",
|
|
@@ -18390,7 +18414,7 @@ function qC(e, n, r) {
|
|
|
18390
18414
|
}), Error(`[page-agent-sdk] ${e}`);
|
|
18391
18415
|
}
|
|
18392
18416
|
x?.setProtectedRefs?.(RC(b));
|
|
18393
|
-
let i = B ? t.maxAutoRetries ?? 1 : 0, a = 0, s = !1, c =
|
|
18417
|
+
let i = B ? t.maxAutoRetries ?? 1 : 0, a = 0, s = !1, c = un(t.signal);
|
|
18394
18418
|
if (t.signal) {
|
|
18395
18419
|
let e = () => o.resolve("keep_external");
|
|
18396
18420
|
t.signal.aborted ? e() : t.signal.addEventListener("abort", e, { once: !0 });
|
|
@@ -18407,14 +18431,14 @@ function qC(e, n, r) {
|
|
|
18407
18431
|
...n ? { anchor: n } : {}
|
|
18408
18432
|
};
|
|
18409
18433
|
}
|
|
18410
|
-
let i = e ??
|
|
18434
|
+
let i = e ?? gn.value ?? void 0;
|
|
18411
18435
|
b.push({
|
|
18412
18436
|
role: "user",
|
|
18413
18437
|
content: n,
|
|
18414
18438
|
timestamp: Date.now(),
|
|
18415
18439
|
...r.length ? { images: r } : {},
|
|
18416
18440
|
...i ? { quote: i } : {}
|
|
18417
|
-
}), s = !0, !e &&
|
|
18441
|
+
}), s = !0, !e && gn.value && (gn.value = null);
|
|
18418
18442
|
}
|
|
18419
18443
|
try {
|
|
18420
18444
|
let e = await U.agent.invoke(b, t.signal, c);
|
|
@@ -18435,7 +18459,7 @@ function qC(e, n, r) {
|
|
|
18435
18459
|
}), U.afterRound(), l) try {
|
|
18436
18460
|
await l.flush();
|
|
18437
18461
|
} catch (e) {
|
|
18438
|
-
|
|
18462
|
+
Zt({
|
|
18439
18463
|
type: "error",
|
|
18440
18464
|
message: `落盘失败(不影响本轮回复):${e instanceof Error ? e.message : String(e)}`,
|
|
18441
18465
|
severity: "observable",
|
|
@@ -18451,7 +18475,7 @@ function qC(e, n, r) {
|
|
|
18451
18475
|
code: "MODEL_UNAVAILABLE",
|
|
18452
18476
|
message: e instanceof Error ? e.message : n.message
|
|
18453
18477
|
}), a < i && L?.canRestore()) {
|
|
18454
|
-
a += 1, L.restore(), s = !0,
|
|
18478
|
+
a += 1, L.restore(), s = !0, Zt({
|
|
18455
18479
|
type: "error",
|
|
18456
18480
|
message: `致命错误自动恢复(${a}/${i}):${n.message},已回退 checkpoint 重试`,
|
|
18457
18481
|
severity: "observable",
|
|
@@ -18463,7 +18487,7 @@ function qC(e, n, r) {
|
|
|
18463
18487
|
});
|
|
18464
18488
|
continue;
|
|
18465
18489
|
}
|
|
18466
|
-
throw
|
|
18490
|
+
throw Zt({
|
|
18467
18491
|
type: "error",
|
|
18468
18492
|
message: n.message,
|
|
18469
18493
|
severity: n.severity,
|
|
@@ -18476,7 +18500,7 @@ function qC(e, n, r) {
|
|
|
18476
18500
|
async batch(e, t, n) {
|
|
18477
18501
|
if (await U.initDone, !e.length) return [];
|
|
18478
18502
|
if (U.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
|
|
18479
|
-
let r = [], i =
|
|
18503
|
+
let r = [], i = un(n);
|
|
18480
18504
|
if (x?.setProtectedRefs?.(RC(b)), n) {
|
|
18481
18505
|
let e = () => o.resolve("keep_external");
|
|
18482
18506
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
@@ -18508,7 +18532,7 @@ function qC(e, n, r) {
|
|
|
18508
18532
|
}), U.afterRound(), l) try {
|
|
18509
18533
|
await l.flush();
|
|
18510
18534
|
} catch (e) {
|
|
18511
|
-
|
|
18535
|
+
Zt({
|
|
18512
18536
|
type: "error",
|
|
18513
18537
|
message: `落盘失败(不影响本任务结果):${e instanceof Error ? e.message : String(e)}`,
|
|
18514
18538
|
severity: "observable",
|
|
@@ -18544,7 +18568,7 @@ function qC(e, n, r) {
|
|
|
18544
18568
|
}
|
|
18545
18569
|
cd(i);
|
|
18546
18570
|
let c = Zl(i, "fatal");
|
|
18547
|
-
|
|
18571
|
+
Zt({
|
|
18548
18572
|
type: "error",
|
|
18549
18573
|
message: `批量任务 ${a + 1}/${e.length} 失败:${c.message}`,
|
|
18550
18574
|
severity: "observable",
|
|
@@ -18568,16 +18592,18 @@ function qC(e, n, r) {
|
|
|
18568
18592
|
}
|
|
18569
18593
|
return r;
|
|
18570
18594
|
},
|
|
18571
|
-
switchSession: (e) =>
|
|
18572
|
-
exportSession: (e) =>
|
|
18573
|
-
importSession: (e) =>
|
|
18574
|
-
resetSession: () =>
|
|
18595
|
+
switchSession: (e) => (Dt.clear(), Cn.switchSession(e)),
|
|
18596
|
+
exportSession: (e) => Cn.exportSession(e),
|
|
18597
|
+
importSession: (e) => Cn.importSession(e),
|
|
18598
|
+
resetSession: () => {
|
|
18599
|
+
Dt.clear(), Cn.resetSession();
|
|
18600
|
+
},
|
|
18575
18601
|
stream: async (e, t, n) => {
|
|
18576
18602
|
if (!U.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
18577
18603
|
let r = [...e].reverse().find((e) => e.role === "user" && e.images?.length);
|
|
18578
|
-
if (r?.images?.length && (await
|
|
18604
|
+
if (r?.images?.length && (await Sn.stowImages(r.images), await Sn.describeIfNeeded(r.images, r.content), !m.vision && !r.images.every((e) => e.description))) {
|
|
18579
18605
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述";
|
|
18580
|
-
throw
|
|
18606
|
+
throw Zt({
|
|
18581
18607
|
type: "error",
|
|
18582
18608
|
message: e,
|
|
18583
18609
|
severity: "recoverable",
|
|
@@ -18586,18 +18612,18 @@ function qC(e, n, r) {
|
|
|
18586
18612
|
}
|
|
18587
18613
|
x?.setProtectedRefs?.(RC(e));
|
|
18588
18614
|
let i = (e) => {
|
|
18589
|
-
t?.(Me(e)),
|
|
18615
|
+
t?.(Me(e)), Zt(Me(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && U.infoTick.value++;
|
|
18590
18616
|
};
|
|
18591
18617
|
if (n) {
|
|
18592
18618
|
let e = () => o.resolve("keep_external");
|
|
18593
18619
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
18594
18620
|
}
|
|
18595
|
-
let { controller: a, untrack: s } =
|
|
18621
|
+
let { controller: a, untrack: s } = mn(n);
|
|
18596
18622
|
return U.agent.stream(e, i, a.signal).finally(s);
|
|
18597
18623
|
},
|
|
18598
18624
|
release() {
|
|
18599
18625
|
if (U.refCount--, U.refCount <= 0) {
|
|
18600
|
-
|
|
18626
|
+
hn(), Je = !0, l && (x.flush?.(), l.flush(), l.dispose()), nn && nn.dispose();
|
|
18601
18627
|
let e = U.mcpClosers.splice(0);
|
|
18602
18628
|
e.length && Promise.allSettled(e.map((e) => e())), HC.delete(n);
|
|
18603
18629
|
}
|
|
@@ -18625,7 +18651,7 @@ function qC(e, n, r) {
|
|
|
18625
18651
|
if ((e.provider ?? "openai") === "anthropic") throw Error("[page-agent-sdk][setLlm] 切换到 Anthropic 需传 BaseChatModel 实例(动态 import 无法同步);请先 const { ChatAnthropic } = await import(\"@langchain/anthropic\") 构造实例后传入");
|
|
18626
18652
|
n = ne(e);
|
|
18627
18653
|
}
|
|
18628
|
-
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Ey(n, { emit:
|
|
18654
|
+
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Ey(n, { emit: Zt }), y = t;
|
|
18629
18655
|
let r = wy(t) ? void 0 : t;
|
|
18630
18656
|
if (m = D({
|
|
18631
18657
|
model: r?.model ?? t.model ?? t.modelName,
|
|
@@ -18633,7 +18659,7 @@ function qC(e, n, r) {
|
|
|
18633
18659
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens,
|
|
18634
18660
|
vision: r?.vision ?? t.vision
|
|
18635
18661
|
}), m.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${m.contextWindow} 小于最小支持 ${S}(需 ≥200K 窗口模型)`);
|
|
18636
|
-
U.agent && (U.agent.setLlm(n), U.agent.setModelCaps?.(m)),
|
|
18662
|
+
U.agent && (U.agent.setLlm(n), U.agent.setModelCaps?.(m)), on?.setContextWindow?.(m.contextWindow), Vt?.setContextWindow?.(m.contextWindow), U.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", m);
|
|
18637
18663
|
},
|
|
18638
18664
|
setMemory(e) {
|
|
18639
18665
|
ae.reset(e), typeof e == "function" && ae.refresh(), U.infoTick.value++;
|
|
@@ -18642,22 +18668,22 @@ function qC(e, n, r) {
|
|
|
18642
18668
|
return ae.refresh();
|
|
18643
18669
|
},
|
|
18644
18670
|
setSubagents(t) {
|
|
18645
|
-
if (!
|
|
18671
|
+
if (!It) {
|
|
18646
18672
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
18647
18673
|
return;
|
|
18648
18674
|
}
|
|
18649
|
-
|
|
18675
|
+
It.set(t), U.infoTick.value++;
|
|
18650
18676
|
},
|
|
18651
18677
|
addSubagent(t) {
|
|
18652
|
-
if (!
|
|
18678
|
+
if (!It) {
|
|
18653
18679
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
18654
18680
|
return;
|
|
18655
18681
|
}
|
|
18656
|
-
|
|
18682
|
+
It.add(t), U.infoTick.value++;
|
|
18657
18683
|
},
|
|
18658
18684
|
removeSubagent(t) {
|
|
18659
|
-
if (!
|
|
18660
|
-
let n =
|
|
18685
|
+
if (!It) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
18686
|
+
let n = It.remove(t);
|
|
18661
18687
|
return n && U.infoTick.value++, n;
|
|
18662
18688
|
},
|
|
18663
18689
|
getActiveSubagents() {
|
|
@@ -18678,7 +18704,7 @@ function qC(e, n, r) {
|
|
|
18678
18704
|
schema: e.schema,
|
|
18679
18705
|
source: Ae.get(e.name) || "user"
|
|
18680
18706
|
})),
|
|
18681
|
-
skills: (
|
|
18707
|
+
skills: (Qt ? Qt.controller.get() : e.skills ?? []).map((e) => ({
|
|
18682
18708
|
name: e.name,
|
|
18683
18709
|
description: e.description
|
|
18684
18710
|
})),
|
|
@@ -18694,14 +18720,18 @@ function qC(e, n, r) {
|
|
|
18694
18720
|
},
|
|
18695
18721
|
memory: ae.get(),
|
|
18696
18722
|
staleReadsInvalidated: U.agent?.getStaleReadsInvalidated?.() ?? 0,
|
|
18697
|
-
hostReadsInvalidated:
|
|
18723
|
+
hostReadsInvalidated: Wt.readsInvalidated,
|
|
18698
18724
|
...Be ? { proposals: Be.snapshot() } : {},
|
|
18699
18725
|
...r ? { hostWatch: { ...r } } : {},
|
|
18726
|
+
...e.approval ? { approvals: {
|
|
18727
|
+
remember: e.approval.remember === !0,
|
|
18728
|
+
grantedTools: [...Dt]
|
|
18729
|
+
} } : {},
|
|
18700
18730
|
llmRetries: U.agent?.getLlmRetries?.() ?? 0,
|
|
18701
18731
|
llmCallFailures: U.agent?.getLlmCallFailures?.() ?? 0,
|
|
18702
18732
|
gates: U.agent?.getGateStats?.(),
|
|
18703
18733
|
systemSegments: U.agent?.getLastSystemSegments?.() ?? [],
|
|
18704
|
-
middleware:
|
|
18734
|
+
middleware: cn.map((e) => e.name),
|
|
18705
18735
|
todos: (U.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
18706
18736
|
id: e.id,
|
|
18707
18737
|
content: e.content,
|
|
@@ -18719,23 +18749,23 @@ function qC(e, n, r) {
|
|
|
18719
18749
|
focuses: Qe ? re.getFocuses() : [],
|
|
18720
18750
|
actions: yC(e.actions ?? {}),
|
|
18721
18751
|
subagent: {
|
|
18722
|
-
enabled: !!
|
|
18752
|
+
enabled: !!At,
|
|
18723
18753
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
18724
18754
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
18725
18755
|
timeoutMs: e.subagent?.timeoutMs === void 0 ? 18e5 : e.subagent.timeoutMs > 0 ? e.subagent.timeoutMs : 0,
|
|
18726
18756
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
18727
|
-
subagents: (
|
|
18757
|
+
subagents: (It?.get() ?? []).map(Lt),
|
|
18728
18758
|
active: gt?.getActive() ?? [],
|
|
18729
18759
|
history: gt?.getHistory() ?? [],
|
|
18730
|
-
lockedComponents:
|
|
18760
|
+
lockedComponents: Mt?.locked() ?? {}
|
|
18731
18761
|
},
|
|
18732
18762
|
verify: {
|
|
18733
|
-
enabled: !!
|
|
18763
|
+
enabled: !!Bt,
|
|
18734
18764
|
maxAttempts: bt ? _t : 0,
|
|
18735
18765
|
adversarial: bt && !!e.verify?.adversarial
|
|
18736
18766
|
},
|
|
18737
18767
|
context: (() => {
|
|
18738
|
-
let e =
|
|
18768
|
+
let e = Vt?.getSnapshot();
|
|
18739
18769
|
if (e) {
|
|
18740
18770
|
let t = U.agent?.getState?.()?.lastCompression;
|
|
18741
18771
|
t && (e.compression = t);
|
|
@@ -18822,7 +18852,7 @@ function qC(e, n, r) {
|
|
|
18822
18852
|
},
|
|
18823
18853
|
setQuote(e, t, n) {
|
|
18824
18854
|
let r = bu(e ?? ""), i = Pu(n);
|
|
18825
|
-
|
|
18855
|
+
gn.value = r ? {
|
|
18826
18856
|
text: r,
|
|
18827
18857
|
...t ? { source: t } : {},
|
|
18828
18858
|
...i ? { anchor: i } : {}
|
|
@@ -18830,18 +18860,26 @@ function qC(e, n, r) {
|
|
|
18830
18860
|
},
|
|
18831
18861
|
notifyHostChange(e) {
|
|
18832
18862
|
let t = typeof e?.reason == "string" ? e.reason.trim().slice(0, 200) : "";
|
|
18833
|
-
|
|
18863
|
+
Wt.epoch += 1, t && !Wt.notices.includes(t) ? Wt.notices.push(t) : t || Wt.notices.push(""), Wt.notices.length > 5 && Wt.notices.splice(0, Wt.notices.length - 5), U.agent?.debugLogs?.value?.push({
|
|
18834
18864
|
timestamp: Date.now(),
|
|
18835
18865
|
type: "middleware",
|
|
18836
18866
|
data: {
|
|
18837
18867
|
stage: "host_change_notified",
|
|
18838
|
-
epoch:
|
|
18868
|
+
epoch: Wt.epoch,
|
|
18839
18869
|
reason: t || void 0
|
|
18840
18870
|
}
|
|
18841
18871
|
}), U.infoTick.value++;
|
|
18842
18872
|
},
|
|
18843
18873
|
clearQuote() {
|
|
18844
|
-
|
|
18874
|
+
gn.value = null;
|
|
18875
|
+
},
|
|
18876
|
+
revokeApprovalGrants() {
|
|
18877
|
+
let e = Dt.size > 0;
|
|
18878
|
+
Dt.clear(), e && (U.agent?.debugLogs?.value?.push({
|
|
18879
|
+
timestamp: Date.now(),
|
|
18880
|
+
type: "middleware",
|
|
18881
|
+
data: { stage: "approval_grants_revoked" }
|
|
18882
|
+
}), U.infoTick.value++);
|
|
18845
18883
|
},
|
|
18846
18884
|
resolveProposal(e, t, n) {
|
|
18847
18885
|
let r = Be ? Be.resolve(e, t, n) : !1;
|
|
@@ -18851,13 +18889,13 @@ function qC(e, n, r) {
|
|
|
18851
18889
|
return Be ? Be.snapshot() : null;
|
|
18852
18890
|
}
|
|
18853
18891
|
};
|
|
18854
|
-
async function
|
|
18892
|
+
async function _n() {
|
|
18855
18893
|
if (!l) return;
|
|
18856
18894
|
let t = async (e) => {
|
|
18857
18895
|
try {
|
|
18858
18896
|
return await l.load(n, e);
|
|
18859
18897
|
} catch (t) {
|
|
18860
|
-
|
|
18898
|
+
Zt({
|
|
18861
18899
|
type: "error",
|
|
18862
18900
|
message: `会话快照读取失败,已降级空会话:${t instanceof Error ? t.message : String(t)}`,
|
|
18863
18901
|
severity: "observable",
|
|
@@ -18870,7 +18908,7 @@ function qC(e, n, r) {
|
|
|
18870
18908
|
try {
|
|
18871
18909
|
return await l.listSessions(n);
|
|
18872
18910
|
} catch (e) {
|
|
18873
|
-
return
|
|
18911
|
+
return Zt({
|
|
18874
18912
|
type: "error",
|
|
18875
18913
|
message: `会话列表读取失败,已降级新建会话:${e instanceof Error ? e.message : String(e)}`,
|
|
18876
18914
|
severity: "observable",
|
|
@@ -18878,7 +18916,7 @@ function qC(e, n, r) {
|
|
|
18878
18916
|
}), [];
|
|
18879
18917
|
}
|
|
18880
18918
|
}, i = Symbol("storage-ready-timeout");
|
|
18881
|
-
await Promise.race([l.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"),
|
|
18919
|
+
await Promise.race([l.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"), Zt({
|
|
18882
18920
|
type: "error",
|
|
18883
18921
|
message: "存储初始化 5s 未就绪(IDB blocked?),已放行降级运行",
|
|
18884
18922
|
severity: "observable",
|
|
@@ -18888,7 +18926,7 @@ function qC(e, n, r) {
|
|
|
18888
18926
|
if (a.id) {
|
|
18889
18927
|
U.sessionId = a.id;
|
|
18890
18928
|
let e = await t(U.sessionId);
|
|
18891
|
-
e ? (U.applySnapshot(e),
|
|
18929
|
+
e ? (U.applySnapshot(e), Zt({
|
|
18892
18930
|
type: "session_restored",
|
|
18893
18931
|
sessionId: U.sessionId,
|
|
18894
18932
|
rounds: e.messages?.length ?? 0
|
|
@@ -18898,19 +18936,19 @@ function qC(e, n, r) {
|
|
|
18898
18936
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, i.length, i.map((e) => e.sessionId)), i.length) {
|
|
18899
18937
|
U.sessionId = i[0].sessionId;
|
|
18900
18938
|
let n = await t(U.sessionId);
|
|
18901
|
-
n ? (U.applySnapshot(n),
|
|
18939
|
+
n ? (U.applySnapshot(n), Zt({
|
|
18902
18940
|
type: "session_restored",
|
|
18903
18941
|
sessionId: U.sessionId,
|
|
18904
18942
|
rounds: n.messages?.length ?? 0
|
|
18905
18943
|
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", U.sessionId, `${n.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", U.sessionId);
|
|
18906
18944
|
} else U.sessionId = await l.createSession(n, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", U.sessionId);
|
|
18907
18945
|
} else U.sessionId = await l.createSession(n, a.title);
|
|
18908
|
-
e.memory &&
|
|
18946
|
+
e.memory && Cn.persistSave({ memory: ae.get() || (typeof e.memory == "string" ? e.memory : "") }), Cn.refreshSessions();
|
|
18909
18947
|
}
|
|
18910
|
-
async function
|
|
18911
|
-
await
|
|
18948
|
+
async function vn() {
|
|
18949
|
+
await an();
|
|
18912
18950
|
}
|
|
18913
|
-
function
|
|
18951
|
+
function yn(e) {
|
|
18914
18952
|
let t = {};
|
|
18915
18953
|
for (let n of RC(e)) {
|
|
18916
18954
|
let e = x.files[n];
|
|
@@ -18918,15 +18956,15 @@ function qC(e, n, r) {
|
|
|
18918
18956
|
}
|
|
18919
18957
|
return t;
|
|
18920
18958
|
}
|
|
18921
|
-
function
|
|
18959
|
+
function bn() {
|
|
18922
18960
|
let e = zC(x.files, RC(b));
|
|
18923
18961
|
for (let t of e) delete x.files[t];
|
|
18924
18962
|
}
|
|
18925
|
-
function
|
|
18926
|
-
let e = gh(b,
|
|
18963
|
+
function xn() {
|
|
18964
|
+
let e = gh(b, ln);
|
|
18927
18965
|
if (!e.trimmed) return;
|
|
18928
18966
|
let { older: t, summary: n } = e;
|
|
18929
|
-
if (
|
|
18967
|
+
if (Zt({
|
|
18930
18968
|
type: "context_trimmed",
|
|
18931
18969
|
dropped: t.map((e) => ({
|
|
18932
18970
|
round: e.round,
|
|
@@ -18934,33 +18972,33 @@ function qC(e, n, r) {
|
|
|
18934
18972
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
18935
18973
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
18936
18974
|
})),
|
|
18937
|
-
vfsResults:
|
|
18975
|
+
vfsResults: yn(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
18938
18976
|
summary: n.content,
|
|
18939
18977
|
reason: "max_memory_rounds"
|
|
18940
|
-
}), b.splice(e.deleteFrom, e.deleteCount, n),
|
|
18978
|
+
}), b.splice(e.deleteFrom, e.deleteCount, n), bn(), g && d) {
|
|
18941
18979
|
let n = e.summary, { prevSeg: r } = e;
|
|
18942
18980
|
(async () => {
|
|
18943
18981
|
try {
|
|
18944
18982
|
let e = await d(Ch(t, v)), i = b.indexOf(n);
|
|
18945
18983
|
if (i < 0) return;
|
|
18946
|
-
b[i].content = hh(t, r, e),
|
|
18984
|
+
b[i].content = hh(t, r, e), Cn.persistRuntime();
|
|
18947
18985
|
} catch {}
|
|
18948
18986
|
})();
|
|
18949
18987
|
}
|
|
18950
18988
|
}
|
|
18951
|
-
let
|
|
18989
|
+
let Sn = gu({
|
|
18952
18990
|
getConfig: () => e.images,
|
|
18953
18991
|
getVision: () => m.vision === !0,
|
|
18954
|
-
emit:
|
|
18992
|
+
emit: Zt,
|
|
18955
18993
|
getVfsStore: () => U.vfsStore,
|
|
18956
|
-
noteFailure: (e, t) =>
|
|
18957
|
-
}),
|
|
18994
|
+
noteFailure: (e, t) => Cn.notePersistFailure(e, t)
|
|
18995
|
+
}), Cn = Tb({
|
|
18958
18996
|
agentId: n,
|
|
18959
18997
|
options: e,
|
|
18960
|
-
emit:
|
|
18998
|
+
emit: Zt,
|
|
18961
18999
|
getStore: () => l,
|
|
18962
19000
|
core: U,
|
|
18963
|
-
sessionsRef:
|
|
19001
|
+
sessionsRef: dn,
|
|
18964
19002
|
sessionVars: A,
|
|
18965
19003
|
messages: b,
|
|
18966
19004
|
getUsage: () => a,
|
|
@@ -18970,7 +19008,7 @@ function qC(e, n, r) {
|
|
|
18970
19008
|
missionMw: T,
|
|
18971
19009
|
workingMemoryMw: ie,
|
|
18972
19010
|
focusMw: re,
|
|
18973
|
-
summarizationMw:
|
|
19011
|
+
summarizationMw: on,
|
|
18974
19012
|
resumeNoticeMw: k,
|
|
18975
19013
|
useMission: ct,
|
|
18976
19014
|
useWorkingMemory: lt,
|
|
@@ -18980,13 +19018,13 @@ function qC(e, n, r) {
|
|
|
18980
19018
|
vfsStore: x,
|
|
18981
19019
|
checkpointMgr: L,
|
|
18982
19020
|
conflictResolve: (e) => o.resolve(e),
|
|
18983
|
-
abortAllActive:
|
|
19021
|
+
abortAllActive: hn,
|
|
18984
19022
|
titleLlmInvoke: f
|
|
18985
19023
|
});
|
|
18986
19024
|
return U.initDone = (async () => {
|
|
18987
|
-
await
|
|
19025
|
+
await _n(), await vn(), e.mcp?.length && n_({
|
|
18988
19026
|
servers: e.mcp,
|
|
18989
|
-
emit:
|
|
19027
|
+
emit: Zt,
|
|
18990
19028
|
isReleased: () => Je,
|
|
18991
19029
|
core: {
|
|
18992
19030
|
mcpClosers: U.mcpClosers,
|
|
@@ -19009,11 +19047,11 @@ function qC(e, n, r) {
|
|
|
19009
19047
|
debug: e.debug
|
|
19010
19048
|
});
|
|
19011
19049
|
let t = wy(e.llm) ? e.llm : await P(e.llm);
|
|
19012
|
-
Ey(t, { emit:
|
|
19050
|
+
Ey(t, { emit: Zt }), U.agent = wp({
|
|
19013
19051
|
llm: t,
|
|
19014
19052
|
systemPrompt: be,
|
|
19015
19053
|
tools: H,
|
|
19016
|
-
middleware:
|
|
19054
|
+
middleware: cn,
|
|
19017
19055
|
maxToolRounds: e.maxToolRounds,
|
|
19018
19056
|
hasSubagent: ht,
|
|
19019
19057
|
pageAssertionGate: z.domInspect === !0,
|
|
@@ -19035,7 +19073,7 @@ function qC(e, n, r) {
|
|
|
19035
19073
|
y = e;
|
|
19036
19074
|
},
|
|
19037
19075
|
debug: e.debug
|
|
19038
|
-
}), oe.current = U.agent,
|
|
19076
|
+
}), oe.current = U.agent, Ft && Ft.setReconfigureHook(() => {
|
|
19039
19077
|
U.agent && U.agent.setTools(ot());
|
|
19040
19078
|
});
|
|
19041
19079
|
})(), U;
|
|
@@ -19186,6 +19224,7 @@ function JC(e, t) {
|
|
|
19186
19224
|
setQuote: c.setQuote,
|
|
19187
19225
|
clearQuote: c.clearQuote,
|
|
19188
19226
|
notifyHostChange: c.notifyHostChange,
|
|
19227
|
+
revokeApprovalGrants: c.revokeApprovalGrants,
|
|
19189
19228
|
resolveProposal: c.resolveProposal,
|
|
19190
19229
|
get proposals() {
|
|
19191
19230
|
return c.getProposals();
|
|
@@ -20798,7 +20837,8 @@ function nO(e = {}) {
|
|
|
20798
20837
|
toolName: e.toolName,
|
|
20799
20838
|
args: e.args,
|
|
20800
20839
|
resolve: e.resolve,
|
|
20801
|
-
...e.preview ? { preview: e.preview } : {}
|
|
20840
|
+
...e.preview ? { preview: e.preview } : {},
|
|
20841
|
+
...e.remember ? { remember: !0 } : {}
|
|
20802
20842
|
};
|
|
20803
20843
|
break;
|
|
20804
20844
|
}
|
|
@@ -21041,6 +21081,8 @@ var oO = {
|
|
|
21041
21081
|
recommendPrefix: " 推荐:",
|
|
21042
21082
|
approve: "允许",
|
|
21043
21083
|
deny: "拒绝",
|
|
21084
|
+
approveRemember: "允许并不再询问",
|
|
21085
|
+
approveRememberHint: "允许本次,且本会话内不再询问此工具的调用(切换会话或重置后恢复询问)",
|
|
21044
21086
|
toolConfirmPrefix: "需确认工具调用:",
|
|
21045
21087
|
viewArgs: "查看参数",
|
|
21046
21088
|
collapseArgs: "收起参数",
|
|
@@ -21277,6 +21319,8 @@ var oO = {
|
|
|
21277
21319
|
recommendPrefix: " Recommend:",
|
|
21278
21320
|
approve: "Allow",
|
|
21279
21321
|
deny: "Deny",
|
|
21322
|
+
approveRemember: "Allow & don't ask again",
|
|
21323
|
+
approveRememberHint: "Allow now and skip confirmation for this tool until the session ends (switch/reset restores asking)",
|
|
21280
21324
|
toolConfirmPrefix: "Confirm tool call:",
|
|
21281
21325
|
viewArgs: "View args",
|
|
21282
21326
|
collapseArgs: "Collapse args",
|
|
@@ -32023,7 +32067,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32023
32067
|
}, xF = {
|
|
32024
32068
|
key: 2,
|
|
32025
32069
|
class: "approval-plan-context"
|
|
32026
|
-
}, SF = { class: "approval-actions" }, CF = ["disabled"], wF =
|
|
32070
|
+
}, SF = { class: "approval-actions" }, CF = ["disabled", "title"], wF = ["disabled"], TF = 20, EF = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
32027
32071
|
__name: "ApprovalBar",
|
|
32028
32072
|
setup(e) {
|
|
32029
32073
|
let t = fO(), { pendingApproval: n, resolveApproval: r } = t.chat, i = t.messages, a = t.planConfirmation, o = /* @__PURE__ */ W(!1);
|
|
@@ -32042,12 +32086,12 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32042
32086
|
} catch {
|
|
32043
32087
|
return String(e);
|
|
32044
32088
|
}
|
|
32045
|
-
}), u = mc(() => n.value?.preview?.items ?? []), d = mc(() => u.value.length >
|
|
32089
|
+
}), u = mc(() => n.value?.preview?.items ?? []), d = mc(() => u.value.length > TF), f = mc(() => {
|
|
32046
32090
|
let e = n.value?.preview;
|
|
32047
32091
|
return !!e && e.ok === !1;
|
|
32048
32092
|
});
|
|
32049
32093
|
return (e, p) => G(n) ? (J(), Y("div", eF, [s.value ? (J(), Y(q, { key: 0 }, [
|
|
32050
|
-
X("div", tF, [p[
|
|
32094
|
+
X("div", tF, [p[6] ||= X("span", { class: "approval-icon" }, "❓", -1), X("span", nF, H(G(i).humanConfirmTitle), 1)]),
|
|
32051
32095
|
G(n).args?.question ? (J(), Y("div", rF, H(G(n).args.question), 1)) : Z("", !0),
|
|
32052
32096
|
G(n).args?.context ? (J(), Y("div", iF, H(G(n).args.context), 1)) : Z("", !0),
|
|
32053
32097
|
G(n).args?.recommendation ? (J(), Y("div", aF, [Os(Jk, { icon: G(t).icons.recommend }, null, 8, ["icon"]), Ns(H(G(i).recommendPrefix) + H(G(n).args.recommendation), 1)])) : Z("", !0),
|
|
@@ -32066,7 +32110,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32066
32110
|
}, [Os(Xk, { text: G(i).approve }, null, 8, ["text"])]))])
|
|
32067
32111
|
], 64)) : (J(), Y(q, { key: 1 }, [
|
|
32068
32112
|
X("div", lF, [
|
|
32069
|
-
p[
|
|
32113
|
+
p[7] ||= X("span", { class: "approval-icon" }, "✋", -1),
|
|
32070
32114
|
X("span", uF, [Ns(H(G(i).toolConfirmPrefix), 1), X("code", null, H(G(n).toolName), 1)]),
|
|
32071
32115
|
l.value ? (J(), Y("button", {
|
|
32072
32116
|
key: 0,
|
|
@@ -32077,7 +32121,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32077
32121
|
l.value && o.value ? (J(), Y("pre", dF, H(l.value), 1)) : Z("", !0),
|
|
32078
32122
|
u.value.length || f.value ? (J(), Y("div", fF, [
|
|
32079
32123
|
f.value ? (J(), Y("div", pF, "⚠ " + H(G(n).preview.error), 1)) : Z("", !0),
|
|
32080
|
-
(J(!0), Y(q, null, Ca(u.value.slice(0,
|
|
32124
|
+
(J(!0), Y(q, null, Ca(u.value.slice(0, TF), (e, t) => (J(), Y("div", {
|
|
32081
32125
|
key: t,
|
|
32082
32126
|
class: "preview-item",
|
|
32083
32127
|
"data-test": `preview-item-${t}`
|
|
@@ -32086,31 +32130,45 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32086
32130
|
X("code", gF, H(e.jsonPath || "(主数据整体)"), 1),
|
|
32087
32131
|
X("span", _F, [
|
|
32088
32132
|
X("span", vF, H(e.oldSummary ?? "—"), 1),
|
|
32089
|
-
p[
|
|
32133
|
+
p[8] ||= X("span", { class: "preview-arrow" }, " → ", -1),
|
|
32090
32134
|
X("span", yF, H(e.newSummary ?? "—"), 1)
|
|
32091
32135
|
])
|
|
32092
32136
|
], 8, mF))), 128)),
|
|
32093
|
-
d.value ? (J(), Y("div", bF, "… 其余 " + H(u.value.length -
|
|
32137
|
+
d.value ? (J(), Y("div", bF, "… 其余 " + H(u.value.length - TF) + " 项", 1)) : Z("", !0)
|
|
32094
32138
|
])) : Z("", !0),
|
|
32095
32139
|
G(a) ? (J(), Y("div", xF, [Os(Jk, { icon: G(t).icons.recommend }, null, 8, ["icon"]), Ns(H(G(i).planConfirmedPrefix) + H(G(a).choice) + H(G(i).planConfirmedSuffix), 1)])) : Z("", !0),
|
|
32096
|
-
X("div", SF, [
|
|
32097
|
-
|
|
32098
|
-
|
|
32099
|
-
|
|
32100
|
-
|
|
32101
|
-
|
|
32102
|
-
|
|
32103
|
-
|
|
32104
|
-
|
|
32140
|
+
X("div", SF, [
|
|
32141
|
+
X("button", {
|
|
32142
|
+
class: "approval-deny",
|
|
32143
|
+
onClick: p[3] ||= (e) => G(r)(!1)
|
|
32144
|
+
}, [Os(Xk, { text: G(i).deny }, null, 8, ["text"])]),
|
|
32145
|
+
G(n).remember ? (J(), Y("button", {
|
|
32146
|
+
key: 0,
|
|
32147
|
+
class: "approval-remember",
|
|
32148
|
+
disabled: f.value,
|
|
32149
|
+
"data-test": "approval-remember",
|
|
32150
|
+
title: G(i).approveRememberHint,
|
|
32151
|
+
onClick: p[4] ||= (e) => G(r)({
|
|
32152
|
+
approved: !0,
|
|
32153
|
+
remember: !0
|
|
32154
|
+
})
|
|
32155
|
+
}, [Os(Xk, { text: G(i).approveRemember }, null, 8, ["text"])], 8, CF)) : Z("", !0),
|
|
32156
|
+
X("button", {
|
|
32157
|
+
class: "approval-allow",
|
|
32158
|
+
disabled: f.value,
|
|
32159
|
+
"data-test": "approval-allow",
|
|
32160
|
+
onClick: p[5] ||= (e) => G(r)(!0)
|
|
32161
|
+
}, [Os(Xk, { text: G(i).approve }, null, 8, ["text"])], 8, wF)
|
|
32162
|
+
])
|
|
32105
32163
|
], 64))])) : Z("", !0);
|
|
32106
32164
|
}
|
|
32107
|
-
}), [["__scopeId", "data-v-
|
|
32165
|
+
}), [["__scopeId", "data-v-12f61337"]]), DF = {
|
|
32108
32166
|
key: 0,
|
|
32109
32167
|
class: "conflict-bar"
|
|
32110
|
-
},
|
|
32168
|
+
}, OF = { class: "conflict-head" }, kF = { class: "conflict-icon" }, AF = { class: "conflict-title" }, jF = { class: "conflict-detail" }, MF = {
|
|
32111
32169
|
key: 0,
|
|
32112
32170
|
class: "conflict-diff"
|
|
32113
|
-
},
|
|
32171
|
+
}, NF = { class: "conflict-diff-col" }, PF = { class: "conflict-diff-label" }, FF = { class: "conflict-diff-pre" }, IF = { class: "conflict-diff-col" }, LF = { class: "conflict-diff-label" }, RF = { class: "conflict-diff-pre" }, zF = { class: "conflict-actions" }, BF = ["title"], VF = ["title"], HF = ["title"], UF = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
32114
32172
|
__name: "ConflictBar",
|
|
32115
32173
|
props: {
|
|
32116
32174
|
pendingConflict: {},
|
|
@@ -32142,76 +32200,76 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32142
32200
|
return String(e);
|
|
32143
32201
|
}
|
|
32144
32202
|
});
|
|
32145
|
-
return (t, a) => e.pendingConflict ? (J(), Y("div",
|
|
32146
|
-
X("div",
|
|
32203
|
+
return (t, a) => e.pendingConflict ? (J(), Y("div", DF, [
|
|
32204
|
+
X("div", OF, [X("span", kF, [Os(Jk, { icon: e.icons.conflict }, null, 8, ["icon"])]), X("span", AF, [
|
|
32147
32205
|
Ns(H(e.messages.conflictTitlePrefix), 1),
|
|
32148
32206
|
X("code", null, H(e.pendingConflict.path), 1),
|
|
32149
32207
|
Ns(H(e.messages.conflictTitleSuffix), 1)
|
|
32150
32208
|
])]),
|
|
32151
|
-
X("div",
|
|
32209
|
+
X("div", jF, H(e.messages.conflictDetailTemplate.replace("{op}", e.pendingConflict.op === "delete" ? e.messages.conflictOpDelete : e.messages.conflictOpWrite)), 1),
|
|
32152
32210
|
X("button", {
|
|
32153
32211
|
class: "conflict-toggle",
|
|
32154
32212
|
onClick: a[0] ||= (e) => n.value = !n.value
|
|
32155
32213
|
}, H(n.value ? e.messages.collapseDiff : e.messages.viewDiff) + H(n.value ? " ▴" : " ▾"), 1),
|
|
32156
|
-
n.value ? (J(), Y("div",
|
|
32157
|
-
X("div",
|
|
32214
|
+
n.value ? (J(), Y("div", MF, [X("div", NF, [X("div", PF, H(e.messages.agentValueLabel), 1), X("pre", FF, H(r.value || e.messages.deleteNoValue), 1)]), X("div", IF, [X("div", LF, H(e.messages.currentValueLabel), 1), X("pre", RF, H(i.value), 1)])])) : Z("", !0),
|
|
32215
|
+
X("div", zF, [
|
|
32158
32216
|
X("button", {
|
|
32159
32217
|
class: "conflict-keep",
|
|
32160
32218
|
onClick: a[1] ||= (t) => e.onResolve?.("keep_external"),
|
|
32161
32219
|
title: e.messages.keepExternalTitle
|
|
32162
|
-
}, [Os(Xk, { text: e.messages.keepExternal }, null, 8, ["text"])], 8,
|
|
32220
|
+
}, [Os(Xk, { text: e.messages.keepExternal }, null, 8, ["text"])], 8, BF),
|
|
32163
32221
|
X("button", {
|
|
32164
32222
|
class: "conflict-overwrite",
|
|
32165
32223
|
onClick: a[2] ||= (t) => e.onResolve?.("overwrite"),
|
|
32166
32224
|
title: e.messages.overwriteTitle
|
|
32167
|
-
}, [Os(Xk, { text: e.messages.overwrite }, null, 8, ["text"])], 8,
|
|
32225
|
+
}, [Os(Xk, { text: e.messages.overwrite }, null, 8, ["text"])], 8, VF),
|
|
32168
32226
|
X("button", {
|
|
32169
32227
|
class: "conflict-restore",
|
|
32170
32228
|
onClick: a[3] ||= (t) => e.onResolve?.("restore"),
|
|
32171
32229
|
title: e.messages.restoreTitle
|
|
32172
|
-
}, [Os(Xk, { text: e.messages.restore }, null, 8, ["text"])], 8,
|
|
32230
|
+
}, [Os(Xk, { text: e.messages.restore }, null, 8, ["text"])], 8, HF)
|
|
32173
32231
|
])
|
|
32174
32232
|
])) : Z("", !0);
|
|
32175
32233
|
}
|
|
32176
|
-
}), [["__scopeId", "data-v-36dda58c"]]),
|
|
32234
|
+
}), [["__scopeId", "data-v-36dda58c"]]), WF = { class: "chat-footer" }, GF = ["title"], KF = {
|
|
32177
32235
|
key: 0,
|
|
32178
32236
|
class: "drop-hint"
|
|
32179
|
-
},
|
|
32237
|
+
}, qF = {
|
|
32180
32238
|
key: 1,
|
|
32181
32239
|
class: "quick-actions",
|
|
32182
32240
|
"data-test": "quick-actions"
|
|
32183
|
-
},
|
|
32241
|
+
}, JF = [
|
|
32184
32242
|
"disabled",
|
|
32185
32243
|
"data-test",
|
|
32186
32244
|
"title",
|
|
32187
32245
|
"onClick"
|
|
32188
|
-
],
|
|
32246
|
+
], YF = {
|
|
32189
32247
|
key: 2,
|
|
32190
32248
|
class: "chip-stack"
|
|
32191
|
-
},
|
|
32249
|
+
}, XF = {
|
|
32192
32250
|
key: 0,
|
|
32193
32251
|
class: "focus-chips"
|
|
32194
|
-
},
|
|
32252
|
+
}, ZF = ["title", "onClick"], QF = { class: "focus-chip-icon" }, $F = { class: "focus-chip-path" }, eI = ["title", "onClick"], tI = {
|
|
32195
32253
|
key: 1,
|
|
32196
32254
|
class: "quote-chips",
|
|
32197
32255
|
"data-test": "quote-chips"
|
|
32198
|
-
},
|
|
32256
|
+
}, nI = ["title"], rI = { class: "quote-chip-text" }, iI = ["title"], aI = {
|
|
32199
32257
|
key: 2,
|
|
32200
32258
|
class: "img-chips",
|
|
32201
32259
|
"data-test": "img-chips"
|
|
32202
|
-
},
|
|
32260
|
+
}, oI = ["title"], sI = ["src", "alt"], cI = ["onClick"], lI = {
|
|
32203
32261
|
key: 3,
|
|
32204
32262
|
class: "img-error",
|
|
32205
32263
|
"data-test": "img-error"
|
|
32206
|
-
},
|
|
32264
|
+
}, uI = {
|
|
32207
32265
|
key: 3,
|
|
32208
32266
|
class: "gate-hint",
|
|
32209
32267
|
"data-test": "gate-hint"
|
|
32210
|
-
},
|
|
32268
|
+
}, dI = [
|
|
32211
32269
|
"placeholder",
|
|
32212
32270
|
"rows",
|
|
32213
32271
|
"disabled"
|
|
32214
|
-
],
|
|
32272
|
+
], fI = { class: "input-actions" }, pI = { class: "send-hint" }, mI = ["title", "disabled"], hI = {
|
|
32215
32273
|
key: 1,
|
|
32216
32274
|
width: "15",
|
|
32217
32275
|
height: "15",
|
|
@@ -32221,13 +32279,13 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32221
32279
|
"stroke-width": "2",
|
|
32222
32280
|
"stroke-linecap": "round",
|
|
32223
32281
|
"stroke-linejoin": "round"
|
|
32224
|
-
},
|
|
32282
|
+
}, gI = ["disabled", "title"], _I = {
|
|
32225
32283
|
key: 0,
|
|
32226
32284
|
width: "16",
|
|
32227
32285
|
height: "16",
|
|
32228
32286
|
viewBox: "0 0 24 24",
|
|
32229
32287
|
fill: "currentColor"
|
|
32230
|
-
},
|
|
32288
|
+
}, vI = {
|
|
32231
32289
|
key: 2,
|
|
32232
32290
|
width: "18",
|
|
32233
32291
|
height: "18",
|
|
@@ -32235,7 +32293,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32235
32293
|
fill: "none",
|
|
32236
32294
|
stroke: "currentColor",
|
|
32237
32295
|
"stroke-width": "2"
|
|
32238
|
-
},
|
|
32296
|
+
}, yI = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
32239
32297
|
__name: "ChatInput",
|
|
32240
32298
|
props: {
|
|
32241
32299
|
placeholder: {},
|
|
@@ -32286,19 +32344,19 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32286
32344
|
t.onDropElement && (window.addEventListener("dragstart", ne, !0), window.addEventListener("dragend", re, !0));
|
|
32287
32345
|
}), ga(() => {
|
|
32288
32346
|
window.removeEventListener("dragstart", ne, !0), window.removeEventListener("dragend", re, !0), M && clearTimeout(M);
|
|
32289
|
-
}), (t, n) => (J(), Y("div",
|
|
32347
|
+
}), (t, n) => (J(), Y("div", WF, [G(o) ? (J(), Y("button", {
|
|
32290
32348
|
key: 0,
|
|
32291
32349
|
class: "undo-foot-btn",
|
|
32292
32350
|
title: G(f).undoTitle,
|
|
32293
32351
|
onClick: n[0] ||= (...e) => G(s) && G(s)(...e)
|
|
32294
|
-
}, H(G(f).undo), 9,
|
|
32352
|
+
}, H(G(f).undo), 9, GF)) : Z("", !0), X("div", {
|
|
32295
32353
|
class: Je(["chat-input-wrap", { "drag-over": D.value }]),
|
|
32296
32354
|
onPointerdownCapture: T,
|
|
32297
32355
|
onDragover: n[5] ||= Fl((e) => D.value = !0, ["prevent"]),
|
|
32298
32356
|
onDragleave: n[6] ||= (e) => D.value = !1,
|
|
32299
32357
|
onDrop: Fl(A, ["prevent"])
|
|
32300
32358
|
}, [
|
|
32301
|
-
D.value ? (J(), Y("div",
|
|
32359
|
+
D.value ? (J(), Y("div", KF, [n[7] ||= X("svg", {
|
|
32302
32360
|
class: "drop-hint-icon",
|
|
32303
32361
|
viewBox: "0 0 24 24",
|
|
32304
32362
|
fill: "none",
|
|
@@ -32321,7 +32379,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32321
32379
|
}),
|
|
32322
32380
|
X("path", { d: "m21 15-4.35-4.35a1.5 1.5 0 0 0-2.12 0L5 20" })
|
|
32323
32381
|
], -1), Ns(" " + H(G(f).imageDropHint), 1)])) : Z("", !0),
|
|
32324
|
-
e.quickActions?.length ? (J(), Y("div",
|
|
32382
|
+
e.quickActions?.length ? (J(), Y("div", qF, [(J(!0), Y(q, null, Ca(e.quickActions, (t, n) => (J(), Y("button", {
|
|
32325
32383
|
key: n,
|
|
32326
32384
|
type: "button",
|
|
32327
32385
|
class: "quick-action-chip",
|
|
@@ -32329,39 +32387,39 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32329
32387
|
"data-test": `quick-action-${n}`,
|
|
32330
32388
|
title: t.prompt,
|
|
32331
32389
|
onClick: (e) => j(t)
|
|
32332
|
-
}, H(t.icon ? `${t.icon} ` : "") + H(t.label), 9,
|
|
32333
|
-
G(c).length || G(y).length || G(p) || G(S) ? (J(), Y("div",
|
|
32334
|
-
G(c).length ? (J(), Y("div",
|
|
32390
|
+
}, H(t.icon ? `${t.icon} ` : "") + H(t.label), 9, JF))), 128))])) : Z("", !0),
|
|
32391
|
+
G(c).length || G(y).length || G(p) || G(S) ? (J(), Y("div", YF, [
|
|
32392
|
+
G(c).length ? (J(), Y("div", XF, [(J(!0), Y(q, null, Ca(G(c), (e) => (J(), Y("span", {
|
|
32335
32393
|
key: e.path,
|
|
32336
32394
|
class: "focus-chip",
|
|
32337
32395
|
title: G(f).focusChipTitlePrefix + e.path + G(f).focusChipTitleHint,
|
|
32338
32396
|
onClick: (t) => G(u)(e)
|
|
32339
32397
|
}, [
|
|
32340
|
-
X("span",
|
|
32341
|
-
X("code",
|
|
32398
|
+
X("span", QF, [Os(Jk, { icon: G(d).focus }, null, 8, ["icon"])]),
|
|
32399
|
+
X("code", $F, H(e.path), 1),
|
|
32342
32400
|
X("button", {
|
|
32343
32401
|
type: "button",
|
|
32344
32402
|
class: "focus-chip-x",
|
|
32345
32403
|
"data-test": "focus-clear",
|
|
32346
32404
|
title: G(f).removeFocus,
|
|
32347
32405
|
onClick: Fl((t) => G(l)(e.path), ["stop"])
|
|
32348
|
-
}, "✕", 8,
|
|
32349
|
-
], 8,
|
|
32350
|
-
G(p) ? (J(), Y("div",
|
|
32406
|
+
}, "✕", 8, eI)
|
|
32407
|
+
], 8, ZF))), 128))])) : Z("", !0),
|
|
32408
|
+
G(p) ? (J(), Y("div", tI, [X("span", {
|
|
32351
32409
|
class: "quote-chip",
|
|
32352
32410
|
title: w(G(p))
|
|
32353
32411
|
}, [
|
|
32354
32412
|
n[8] ||= X("span", { class: "quote-chip-icon" }, "❝", -1),
|
|
32355
|
-
X("span",
|
|
32413
|
+
X("span", rI, H(G(p).text), 1),
|
|
32356
32414
|
X("button", {
|
|
32357
32415
|
type: "button",
|
|
32358
32416
|
class: "focus-chip-x",
|
|
32359
32417
|
"data-test": "quote-clear",
|
|
32360
32418
|
title: G(f).quoteRemove,
|
|
32361
32419
|
onClick: n[1] ||= Fl((e) => G(m)(), ["stop"])
|
|
32362
|
-
}, "✕", 8,
|
|
32363
|
-
], 8,
|
|
32364
|
-
G(y).length ? (J(), Y("div",
|
|
32420
|
+
}, "✕", 8, iI)
|
|
32421
|
+
], 8, nI)])) : Z("", !0),
|
|
32422
|
+
G(y).length ? (J(), Y("div", aI, [(J(!0), Y(q, null, Ca(G(y), (e) => (J(), Y("span", {
|
|
32365
32423
|
key: e.id,
|
|
32366
32424
|
class: "img-chip",
|
|
32367
32425
|
title: e.name || G(f).imageAlt
|
|
@@ -32369,15 +32427,15 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32369
32427
|
class: "img-chip-thumb",
|
|
32370
32428
|
src: e.dataUri,
|
|
32371
32429
|
alt: e.name || G(f).imageAlt
|
|
32372
|
-
}, null, 8,
|
|
32430
|
+
}, null, 8, sI), X("button", {
|
|
32373
32431
|
type: "button",
|
|
32374
32432
|
class: "img-chip-x",
|
|
32375
32433
|
"data-test": "img-chip-x",
|
|
32376
32434
|
onClick: (t) => G(x)(e.id)
|
|
32377
|
-
}, "✕", 8,
|
|
32378
|
-
G(S) ? (J(), Y("div",
|
|
32435
|
+
}, "✕", 8, cI)], 8, oI))), 128))])) : Z("", !0),
|
|
32436
|
+
G(S) ? (J(), Y("div", lI, H(G(S)), 1)) : Z("", !0)
|
|
32379
32437
|
])) : Z("", !0),
|
|
32380
|
-
e.gatePending ? (J(), Y("div",
|
|
32438
|
+
e.gatePending ? (J(), Y("div", uI, H(G(f).inputGateHint), 1)) : Z("", !0),
|
|
32381
32439
|
fi(X("textarea", {
|
|
32382
32440
|
"onUpdate:modelValue": n[2] ||= (e) => /* @__PURE__ */ zn(r) ? r.value = e : null,
|
|
32383
32441
|
class: "chat-input",
|
|
@@ -32386,9 +32444,9 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32386
32444
|
disabled: e.gatePending,
|
|
32387
32445
|
onKeydown: n[3] ||= (...e) => G(a) && G(a)(...e),
|
|
32388
32446
|
onPaste: ee
|
|
32389
|
-
}, null, 40,
|
|
32390
|
-
X("div",
|
|
32391
|
-
X("span",
|
|
32447
|
+
}, null, 40, dI), [[Ml, G(r)]]),
|
|
32448
|
+
X("div", fI, [
|
|
32449
|
+
X("span", pI, H(G(f).sendHint), 1),
|
|
32392
32450
|
X("button", {
|
|
32393
32451
|
class: "attach-btn",
|
|
32394
32452
|
title: G(f).attachImageTitle,
|
|
@@ -32398,7 +32456,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32398
32456
|
}, [G(d).attachImage ? (J(), xs(Jk, {
|
|
32399
32457
|
key: 0,
|
|
32400
32458
|
icon: G(d).attachImage
|
|
32401
|
-
}, null, 8, ["icon"])) : (J(), Y("svg",
|
|
32459
|
+
}, null, 8, ["icon"])) : (J(), Y("svg", hI, [...n[9] ||= [X("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" }, null, -1)]]))], 8, mI),
|
|
32402
32460
|
X("input", {
|
|
32403
32461
|
ref_key: "fileInput",
|
|
32404
32462
|
ref: E,
|
|
@@ -32414,7 +32472,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32414
32472
|
disabled: !G(g).loading && !G(r).trim() && !G(y).length && !G(C) || e.gatePending && !G(g).loading,
|
|
32415
32473
|
title: G(g).loading ? G(f).stopTitle : G(f).sendTitle,
|
|
32416
32474
|
onClick: n[4] ||= (e) => G(g).loading ? G(_)() : G(i)()
|
|
32417
|
-
}, [G(g).loading ? (J(), Y("svg",
|
|
32475
|
+
}, [G(g).loading ? (J(), Y("svg", _I, [...n[10] ||= [X("rect", {
|
|
32418
32476
|
x: "6",
|
|
32419
32477
|
y: "6",
|
|
32420
32478
|
width: "12",
|
|
@@ -32423,187 +32481,187 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
32423
32481
|
}, null, -1)]])) : G(d).send ? (J(), xs(Jk, {
|
|
32424
32482
|
key: 1,
|
|
32425
32483
|
icon: G(d).send
|
|
32426
|
-
}, null, 8, ["icon"])) : (J(), Y("svg",
|
|
32484
|
+
}, null, 8, ["icon"])) : (J(), Y("svg", vI, [...n[11] ||= [X("line", {
|
|
32427
32485
|
x1: "22",
|
|
32428
32486
|
y1: "2",
|
|
32429
32487
|
x2: "11",
|
|
32430
32488
|
y2: "13"
|
|
32431
|
-
}, null, -1), X("polygon", { points: "22 2 15 22 11 13 2 9 22 2" }, null, -1)]]))], 10,
|
|
32489
|
+
}, null, -1), X("polygon", { points: "22 2 15 22 11 13 2 9 22 2" }, null, -1)]]))], 10, gI)
|
|
32432
32490
|
])
|
|
32433
32491
|
], 34)]));
|
|
32434
32492
|
}
|
|
32435
|
-
}), [["__scopeId", "data-v-1580c76b"]]),
|
|
32493
|
+
}), [["__scopeId", "data-v-1580c76b"]]), bI = {
|
|
32436
32494
|
key: 0,
|
|
32437
32495
|
class: "debug-drawer"
|
|
32438
|
-
},
|
|
32496
|
+
}, xI = { class: "drawer-header" }, SI = { class: "tab-group" }, CI = { class: "header-actions" }, wI = ["title"], TI = ["title"], EI = ["title"], DI = {
|
|
32439
32497
|
key: 0,
|
|
32440
32498
|
class: "drawer-filters"
|
|
32441
|
-
},
|
|
32499
|
+
}, OI = ["onClick"], kI = { class: "chip-count" }, AI = { class: "chip-count" }, jI = {
|
|
32442
32500
|
key: 0,
|
|
32443
32501
|
class: "context-panel"
|
|
32444
|
-
},
|
|
32502
|
+
}, MI = {
|
|
32445
32503
|
key: 0,
|
|
32446
32504
|
class: "trace-empty"
|
|
32447
|
-
},
|
|
32505
|
+
}, NI = { class: "ctx-overview" }, PI = { class: "ctx-occupancy" }, FI = ["title"], II = ["title"], LI = { class: "ctx-pct" }, RI = { class: "ctx-kv-row" }, zI = { class: "ctx-kv" }, BI = {
|
|
32448
32506
|
key: 0,
|
|
32449
32507
|
class: "ctx-kv"
|
|
32450
|
-
},
|
|
32508
|
+
}, VI = {
|
|
32451
32509
|
key: 1,
|
|
32452
32510
|
class: "ctx-kv"
|
|
32453
|
-
},
|
|
32511
|
+
}, HI = { class: "ctx-section-title" }, UI = ["title"], WI = { class: "ctx-cat-bar" }, GI = { class: "ctx-cat-tokens" }, KI = {
|
|
32454
32512
|
key: 0,
|
|
32455
32513
|
class: "ctx-compression"
|
|
32456
|
-
},
|
|
32514
|
+
}, qI = { class: "ctx-section-title" }, JI = { class: "ctx-kv-row" }, YI = { class: "ctx-kv" }, XI = { class: "ctx-kv" }, ZI = { class: "ctx-kv" }, QI = {
|
|
32457
32515
|
key: 0,
|
|
32458
32516
|
class: "ctx-kv"
|
|
32459
|
-
},
|
|
32517
|
+
}, $I = {
|
|
32460
32518
|
key: 1,
|
|
32461
32519
|
class: "subagent-panel"
|
|
32462
|
-
},
|
|
32520
|
+
}, eL = {
|
|
32463
32521
|
key: 0,
|
|
32464
32522
|
class: "sub-section"
|
|
32465
|
-
},
|
|
32523
|
+
}, tL = { class: "sub-section-title" }, nL = {
|
|
32466
32524
|
key: 1,
|
|
32467
32525
|
class: "trace-empty"
|
|
32468
|
-
},
|
|
32526
|
+
}, rL = {
|
|
32469
32527
|
key: 0,
|
|
32470
32528
|
class: "sub-section"
|
|
32471
|
-
},
|
|
32529
|
+
}, iL = { class: "sub-section-title" }, aL = { class: "sub-head" }, oL = { class: "sub-label" }, sL = { class: "sub-steps-badge" }, cL = { class: "sub-task" }, lL = {
|
|
32472
32530
|
key: 1,
|
|
32473
32531
|
class: "sub-section"
|
|
32474
|
-
},
|
|
32532
|
+
}, uL = { class: "sub-section-title" }, dL = { class: "sub-head" }, fL = { class: "sub-label" }, pL = {
|
|
32475
32533
|
key: 0,
|
|
32476
32534
|
class: "sub-dur"
|
|
32477
|
-
},
|
|
32535
|
+
}, mL = ["onClick"], hL = { class: "sub-task" }, gL = {
|
|
32478
32536
|
key: 0,
|
|
32479
32537
|
class: "sub-result"
|
|
32480
|
-
},
|
|
32538
|
+
}, _L = {
|
|
32481
32539
|
key: 1,
|
|
32482
32540
|
class: "sub-steps-list"
|
|
32483
|
-
},
|
|
32541
|
+
}, vL = { class: "sub-step-kind" }, yL = { class: "sub-step-name" }, bL = { class: "sub-step-ts" }, xL = {
|
|
32484
32542
|
key: 0,
|
|
32485
32543
|
class: "empty"
|
|
32486
|
-
},
|
|
32544
|
+
}, SL = ["onClick"], CL = { class: "log-group-title" }, wL = { class: "log-group-meta" }, TL = {
|
|
32487
32545
|
key: 0,
|
|
32488
32546
|
class: "lg-badge"
|
|
32489
|
-
},
|
|
32547
|
+
}, EL = {
|
|
32490
32548
|
key: 1,
|
|
32491
32549
|
class: "lg-badge"
|
|
32492
|
-
},
|
|
32550
|
+
}, DL = {
|
|
32493
32551
|
key: 2,
|
|
32494
32552
|
class: "lg-badge err"
|
|
32495
|
-
},
|
|
32553
|
+
}, OL = { class: "log-group-body" }, kL = { class: "log-head" }, AL = {
|
|
32496
32554
|
key: 0,
|
|
32497
32555
|
class: "log-source"
|
|
32498
|
-
},
|
|
32556
|
+
}, jL = { class: "log-time" }, ML = { class: "log-body" }, NL = { class: "kv-grid" }, PL = { class: "kv" }, FL = { class: "k" }, IL = { class: "v" }, LL = { class: "kv" }, RL = { class: "k" }, zL = { class: "v" }, BL = { class: "kv" }, VL = { class: "v" }, HL = { class: "kv" }, UL = { class: "k" }, WL = { class: "v" }, GL = { class: "section-label" }, KL = { class: "chip-row" }, qL = { class: "section-label" }, JL = { class: "msg-list" }, YL = { class: "msg-text" }, XL = { class: "badge-row" }, ZL = { class: "badge" }, QL = {
|
|
32499
32557
|
key: 0,
|
|
32500
32558
|
class: "badge muted"
|
|
32501
|
-
},
|
|
32559
|
+
}, $L = { class: "badge muted" }, eR = {
|
|
32502
32560
|
key: 1,
|
|
32503
32561
|
class: "badge muted"
|
|
32504
|
-
},
|
|
32562
|
+
}, tR = ["onClick"], nR = ["title", "onClick"], rR = ["onClick"], iR = ["title", "onClick"], aR = { class: "msg-detail" }, oR = {
|
|
32505
32563
|
key: 0,
|
|
32506
32564
|
class: "msg-text"
|
|
32507
|
-
},
|
|
32565
|
+
}, sR = { class: "tc-inline-name" }, cR = { class: "tc-inline-args" }, lR = {
|
|
32508
32566
|
key: 1,
|
|
32509
32567
|
class: "tc-id"
|
|
32510
|
-
},
|
|
32568
|
+
}, uR = {
|
|
32511
32569
|
key: 1,
|
|
32512
32570
|
class: "log-raw"
|
|
32513
|
-
},
|
|
32571
|
+
}, dR = { class: "badge-row" }, fR = { class: "badge" }, pR = {
|
|
32514
32572
|
key: 0,
|
|
32515
32573
|
class: "badge warn"
|
|
32516
|
-
},
|
|
32574
|
+
}, mR = {
|
|
32517
32575
|
key: 0,
|
|
32518
32576
|
class: "resp-content"
|
|
32519
|
-
},
|
|
32577
|
+
}, hR = {
|
|
32520
32578
|
key: 1,
|
|
32521
32579
|
class: "tc-list"
|
|
32522
|
-
},
|
|
32580
|
+
}, gR = { class: "tc-name" }, _R = { class: "tc-args" }, vR = {
|
|
32523
32581
|
key: 2,
|
|
32524
32582
|
class: "usage-row"
|
|
32525
|
-
},
|
|
32583
|
+
}, yR = { class: "usage" }, bR = { class: "usage" }, xR = { class: "usage" }, SR = {
|
|
32526
32584
|
key: 0,
|
|
32527
32585
|
class: "usage"
|
|
32528
|
-
},
|
|
32586
|
+
}, CR = { class: "tc-name" }, wR = {
|
|
32529
32587
|
key: 0,
|
|
32530
32588
|
class: "tc-dur"
|
|
32531
|
-
},
|
|
32589
|
+
}, TR = ["title", "onClick"], ER = { class: "tc-args" }, DR = { class: "tc-result-sep" }, OR = { class: "tc-args tc-result" }, kR = {
|
|
32532
32590
|
key: 1,
|
|
32533
32591
|
class: "tc-card inline"
|
|
32534
|
-
},
|
|
32592
|
+
}, AR = { class: "tc-name" }, jR = {
|
|
32535
32593
|
key: 0,
|
|
32536
32594
|
class: "tc-dur running"
|
|
32537
|
-
},
|
|
32595
|
+
}, MR = { class: "tc-args" }, NR = {
|
|
32538
32596
|
key: 4,
|
|
32539
32597
|
class: "err-box"
|
|
32540
|
-
},
|
|
32598
|
+
}, PR = { class: "log-footer" }, FR = ["onClick"], IR = ["onClick"], LR = {
|
|
32541
32599
|
key: 0,
|
|
32542
32600
|
class: "log-raw"
|
|
32543
|
-
},
|
|
32601
|
+
}, RR = {
|
|
32544
32602
|
key: 3,
|
|
32545
32603
|
class: "info-body"
|
|
32546
|
-
},
|
|
32604
|
+
}, zR = {
|
|
32547
32605
|
key: 0,
|
|
32548
32606
|
class: "empty"
|
|
32549
|
-
},
|
|
32607
|
+
}, BR = { class: "info-section" }, VR = { class: "info-title" }, HR = { class: "kv-grid" }, UR = { class: "kv" }, WR = { class: "v" }, GR = { class: "kv" }, KR = { class: "k" }, qR = { class: "v" }, JR = { class: "kv" }, YR = { class: "k" }, XR = { class: "v" }, ZR = { class: "kv" }, QR = { class: "k" }, $R = { class: "v" }, ez = {
|
|
32550
32608
|
class: "kv",
|
|
32551
32609
|
style: { "margin-top": "6px" }
|
|
32552
|
-
},
|
|
32610
|
+
}, tz = { class: "k" }, nz = {
|
|
32553
32611
|
class: "v",
|
|
32554
32612
|
style: { "font-size": "11px" }
|
|
32555
|
-
},
|
|
32613
|
+
}, rz = { class: "info-section" }, iz = { class: "info-title" }, az = { class: "info-name" }, oz = { class: "info-desc" }, sz = {
|
|
32556
32614
|
key: 0,
|
|
32557
32615
|
class: "info-section"
|
|
32558
|
-
},
|
|
32616
|
+
}, cz = { class: "info-title" }, lz = { class: "info-hint" }, uz = ["onClick"], dz = { class: "info-desc" }, fz = {
|
|
32559
32617
|
key: 0,
|
|
32560
32618
|
class: "skill-content"
|
|
32561
|
-
},
|
|
32619
|
+
}, pz = {
|
|
32562
32620
|
key: 0,
|
|
32563
32621
|
class: "skill-loading"
|
|
32564
|
-
},
|
|
32622
|
+
}, mz = {
|
|
32565
32623
|
key: 1,
|
|
32566
32624
|
class: "skill-error"
|
|
32567
|
-
},
|
|
32625
|
+
}, hz = {
|
|
32568
32626
|
key: 2,
|
|
32569
32627
|
class: "skill-pre"
|
|
32570
|
-
},
|
|
32628
|
+
}, gz = {
|
|
32571
32629
|
key: 1,
|
|
32572
32630
|
class: "info-section"
|
|
32573
|
-
},
|
|
32631
|
+
}, _z = { class: "info-title" }, vz = { class: "info-item" }, yz = { class: "info-name" }, bz = { class: "info-desc" }, xz = { class: "info-section" }, Sz = { class: "info-title" }, Cz = { class: "kv-grid" }, wz = { class: "kv" }, Tz = { class: "k" }, Ez = { class: "v" }, Dz = { class: "kv" }, Oz = { class: "k" }, kz = { class: "v" }, Az = { class: "kv" }, jz = { class: "k" }, Mz = { class: "v" }, Nz = { class: "kv" }, Pz = { class: "k" }, Fz = {
|
|
32574
32632
|
class: "v",
|
|
32575
32633
|
style: { "font-size": "11px" }
|
|
32576
|
-
},
|
|
32634
|
+
}, Iz = {
|
|
32577
32635
|
key: 2,
|
|
32578
32636
|
class: "info-section"
|
|
32579
|
-
},
|
|
32637
|
+
}, Lz = { class: "info-title" }, Rz = { class: "info-name" }, zz = { class: "src-tag mcp" }, Bz = { class: "info-desc" }, Vz = {
|
|
32580
32638
|
key: 3,
|
|
32581
32639
|
class: "info-section"
|
|
32582
|
-
},
|
|
32640
|
+
}, Hz = { class: "info-title" }, Uz = { class: "kv-grid" }, Wz = { class: "kv" }, Gz = { class: "k" }, Kz = { class: "v" }, qz = { class: "kv" }, Jz = { class: "k" }, Yz = { class: "v" }, Xz = { class: "kv" }, Zz = { class: "k" }, Qz = { class: "v" }, $z = {
|
|
32583
32641
|
key: 0,
|
|
32584
32642
|
class: "kv"
|
|
32585
|
-
},
|
|
32643
|
+
}, eB = { class: "k" }, tB = {
|
|
32586
32644
|
class: "v",
|
|
32587
32645
|
style: { "font-size": "11px" }
|
|
32588
|
-
},
|
|
32646
|
+
}, nB = {
|
|
32589
32647
|
key: 4,
|
|
32590
32648
|
class: "info-section"
|
|
32591
|
-
},
|
|
32649
|
+
}, rB = { class: "info-title" }, iB = {
|
|
32592
32650
|
key: 5,
|
|
32593
32651
|
class: "info-section"
|
|
32594
|
-
},
|
|
32652
|
+
}, aB = { class: "info-title" }, oB = { class: "info-pre" }, sB = {
|
|
32595
32653
|
key: 6,
|
|
32596
32654
|
class: "info-section"
|
|
32597
|
-
},
|
|
32655
|
+
}, cB = { class: "info-title" }, lB = { class: "info-kv" }, uB = { class: "kv" }, dB = { class: "k" }, fB = { class: "v" }, pB = { class: "kv" }, mB = { class: "k" }, hB = { class: "v" }, gB = { class: "kv" }, _B = { class: "k" }, vB = { class: "v" }, yB = { class: "kv" }, bB = { class: "k" }, xB = { class: "v" }, SB = { class: "kv" }, CB = { class: "k" }, wB = {
|
|
32598
32656
|
class: "v",
|
|
32599
32657
|
style: { "font-size": "11px" }
|
|
32600
|
-
},
|
|
32658
|
+
}, TB = {
|
|
32601
32659
|
key: 0,
|
|
32602
32660
|
class: "kv"
|
|
32603
|
-
},
|
|
32661
|
+
}, EB = { class: "k" }, DB = {
|
|
32604
32662
|
class: "v",
|
|
32605
32663
|
style: { "font-size": "11px" }
|
|
32606
|
-
},
|
|
32664
|
+
}, OB = 400, kB = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
32607
32665
|
__name: "DebugDrawer",
|
|
32608
32666
|
props: {
|
|
32609
32667
|
logs: { default: () => [] },
|
|
@@ -33007,8 +33065,8 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33007
33065
|
return `${e.windowRatio == null ? `keepRounds=${e.keepRounds ?? "?"}` : `windowRatio=${e.windowRatio}`} · ${e.summarize.mode}${y.value.debugSummaryMode} · ${y.value.debugCtxRecalled}${e.recallTopK ?? "?"}${e.reason ? " · " + e.reason : ""}`;
|
|
33008
33066
|
}
|
|
33009
33067
|
return (t, n) => (J(), xs(Ni, { to: "body" }, [Os(Mc, { name: "drawer" }, {
|
|
33010
|
-
default: ui(() => [e.visible ? (J(), Y("div",
|
|
33011
|
-
X("div",
|
|
33068
|
+
default: ui(() => [e.visible ? (J(), Y("div", bI, [X("div", { class: Je(["drawer-panel", { "cs-theme-dark": e.csTheme === "dark" }]) }, [
|
|
33069
|
+
X("div", xI, [X("div", SI, [
|
|
33012
33070
|
X("button", {
|
|
33013
33071
|
class: Je(["tab-btn", { active: ue.value === "logs" }]),
|
|
33014
33072
|
onClick: n[0] ||= (e) => pe("logs")
|
|
@@ -33028,33 +33086,33 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33028
33086
|
class: Je(["tab-btn", { active: ue.value === "info" }]),
|
|
33029
33087
|
onClick: n[3] ||= (e) => pe("info")
|
|
33030
33088
|
}, "🧬 " + H(y.value.debugTabInfo), 3)) : Z("", !0)
|
|
33031
|
-
]), X("div",
|
|
33089
|
+
]), X("div", CI, [
|
|
33032
33090
|
X("button", {
|
|
33033
33091
|
class: "hd-btn",
|
|
33034
33092
|
title: y.value.debugCopyReport,
|
|
33035
33093
|
onClick: v
|
|
33036
|
-
}, H(g.value === "report" ? "✓" : "💾"), 9,
|
|
33094
|
+
}, H(g.value === "report" ? "✓" : "💾"), 9, wI),
|
|
33037
33095
|
ue.value === "logs" ? (J(), Y("button", {
|
|
33038
33096
|
key: 0,
|
|
33039
33097
|
class: "hd-btn",
|
|
33040
33098
|
title: y.value.debugClearLogs,
|
|
33041
33099
|
onClick: le
|
|
33042
|
-
}, "🗑️", 8,
|
|
33100
|
+
}, "🗑️", 8, TI)) : Z("", !0),
|
|
33043
33101
|
X("button", {
|
|
33044
33102
|
class: "hd-btn",
|
|
33045
33103
|
title: y.value.close,
|
|
33046
33104
|
onClick: ce
|
|
33047
|
-
}, "✕", 8,
|
|
33105
|
+
}, "✕", 8, EI)
|
|
33048
33106
|
])]),
|
|
33049
|
-
ue.value === "logs" ? (J(), Y("div",
|
|
33107
|
+
ue.value === "logs" ? (J(), Y("div", DI, [(J(!0), Y(q, null, Ca(b.value, (e, t) => (J(), Y("button", {
|
|
33050
33108
|
key: t,
|
|
33051
33109
|
class: Je(["filter-chip", { active: i.value === t }]),
|
|
33052
33110
|
style: Ue({ "--chip-color": e.color }),
|
|
33053
33111
|
onClick: (e) => i.value = t
|
|
33054
|
-
}, [Ns(H(e.icon) + " " + H(e.label) + " ", 1), X("span",
|
|
33112
|
+
}, [Ns(H(e.icon) + " " + H(e.label) + " ", 1), X("span", kI, H(C.value[t] || 0), 1)], 14, OI))), 128)), X("button", {
|
|
33055
33113
|
class: Je(["filter-chip all", { active: i.value === "all" }]),
|
|
33056
33114
|
onClick: n[4] ||= (e) => i.value = "all"
|
|
33057
|
-
}, [Ns(H(y.value.debugFilterAll) + " ", 1), X("span",
|
|
33115
|
+
}, [Ns(H(y.value.debugFilterAll) + " ", 1), X("span", AI, H(C.value.all || 0), 1)], 2)])) : Z("", !0),
|
|
33058
33116
|
X("div", {
|
|
33059
33117
|
class: "drawer-body",
|
|
33060
33118
|
ref_key: "drawerBodyEl",
|
|
@@ -33068,8 +33126,8 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33068
33126
|
ref_key: "drawerContentsEl",
|
|
33069
33127
|
ref: c
|
|
33070
33128
|
}, [
|
|
33071
|
-
ue.value === "context" ? (J(), Y("div",
|
|
33072
|
-
X("div",
|
|
33129
|
+
ue.value === "context" ? (J(), Y("div", jI, [z.value ? (J(), Y(q, { key: 1 }, [z.value ? (J(), Y(q, { key: 0 }, [
|
|
33130
|
+
X("div", NI, [X("div", PI, [X("div", {
|
|
33073
33131
|
class: "ctx-bar-track",
|
|
33074
33132
|
title: `${y.value.debugCtxOccupancy} ${Math.round(z.value.occupancy * 100)}%`
|
|
33075
33133
|
}, [X("div", {
|
|
@@ -33080,12 +33138,12 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33080
33138
|
class: "ctx-threshold-mark",
|
|
33081
33139
|
style: Ue({ left: Math.min(z.value.thresholdRatio * 100, 100) + "%" }),
|
|
33082
33140
|
title: y.value.debugCtxThreshold
|
|
33083
|
-
}, null, 12,
|
|
33084
|
-
X("span",
|
|
33085
|
-
z.value.contextWindow ? (J(), Y("span",
|
|
33086
|
-
z.value.thresholdRatio > 0 ? (J(), Y("span",
|
|
33141
|
+
}, null, 12, II)) : Z("", !0)], 8, FI), X("span", LI, H(Math.round(z.value.occupancy * 100)) + "%", 1)]), X("div", RI, [
|
|
33142
|
+
X("span", zI, H(y.value.debugCtxTokens) + " " + H(z.value.totalTokens) + " token", 1),
|
|
33143
|
+
z.value.contextWindow ? (J(), Y("span", BI, H(y.value.debugCtxWindow) + " " + H(z.value.contextWindow), 1)) : Z("", !0),
|
|
33144
|
+
z.value.thresholdRatio > 0 ? (J(), Y("span", VI, H(y.value.debugCtxThresholdPct) + " " + H(Math.round(z.value.thresholdRatio * 100)) + "%", 1)) : Z("", !0)
|
|
33087
33145
|
])]),
|
|
33088
|
-
X("div",
|
|
33146
|
+
X("div", HI, H(y.value.debugCtxCategories), 1),
|
|
33089
33147
|
(J(!0), Y(q, null, Ca(z.value.categories, (e) => (J(), Y("div", {
|
|
33090
33148
|
key: e.key,
|
|
33091
33149
|
class: "ctx-cat"
|
|
@@ -33093,62 +33151,62 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33093
33151
|
X("span", {
|
|
33094
33152
|
class: "ctx-cat-label",
|
|
33095
33153
|
title: e.label
|
|
33096
|
-
}, H(e.label), 9,
|
|
33097
|
-
X("div",
|
|
33154
|
+
}, H(e.label), 9, UI),
|
|
33155
|
+
X("div", WI, [X("div", {
|
|
33098
33156
|
class: "ctx-cat-fill",
|
|
33099
33157
|
style: Ue({ width: Math.max(Math.round(e.pct * 100), 2) + "%" })
|
|
33100
33158
|
}, null, 4)]),
|
|
33101
|
-
X("span",
|
|
33159
|
+
X("span", GI, [Ns(H(e.tokens) + " ", 1), X("i", null, "(" + H(Math.round(e.pct * 100)) + "%)", 1)])
|
|
33102
33160
|
]))), 128)),
|
|
33103
|
-
z.value.compression ? (J(), Y("div",
|
|
33104
|
-
X("span",
|
|
33105
|
-
X("span",
|
|
33106
|
-
X("span",
|
|
33107
|
-
z.value.compression.decision ? (J(), Y("span",
|
|
33161
|
+
z.value.compression ? (J(), Y("div", KI, [X("div", qI, H(y.value.debugCtxLastCompression), 1), X("div", JI, [
|
|
33162
|
+
X("span", YI, H(y.value.debugCtxSummarized) + " " + H(z.value.compression.roundsSummarized) + "/" + H(z.value.compression.roundsTotal) + H(y.value.debugCtxRoundsSuffix), 1),
|
|
33163
|
+
X("span", XI, H(y.value.debugCtxRecalled) + " " + H(z.value.compression.roundsRecalled), 1),
|
|
33164
|
+
X("span", ZI, H(z.value.compression.strategy), 1),
|
|
33165
|
+
z.value.compression.decision ? (J(), Y("span", QI, "🤖 " + H(y.value.debugCtxAgentDecision) + H(Se(z.value.compression.decision)), 1)) : Z("", !0)
|
|
33108
33166
|
])])) : Z("", !0)
|
|
33109
|
-
], 64)) : Z("", !0)], 64)) : (J(), Y("div",
|
|
33110
|
-
ue.value === "subagent" ? (J(), Y("div",
|
|
33167
|
+
], 64)) : Z("", !0)], 64)) : (J(), Y("div", MI, H(y.value.debugCtxEmpty), 1))])) : Z("", !0),
|
|
33168
|
+
ue.value === "subagent" ? (J(), Y("div", $I, [ye.value.length ? (J(), Y("div", eL, [X("div", tL, "🔒 " + H(y.value.debugLocksTitle) + " (" + H(ye.value.length) + ")", 1), (J(!0), Y(q, null, Ca(ye.value, ([e, t]) => (J(), Y("div", {
|
|
33111
33169
|
key: "lock-" + e,
|
|
33112
33170
|
class: "sub-task"
|
|
33113
|
-
}, "🔒 " + H(e) + " ← " + H(t), 1))), 128))])) : Z("", !0), !ve.value.length && !B.value.length ? (J(), Y("div",
|
|
33171
|
+
}, "🔒 " + H(e) + " ← " + H(t), 1))), 128))])) : Z("", !0), !ve.value.length && !B.value.length ? (J(), Y("div", nL, H(y.value.debugSubagentEmpty), 1)) : (J(), Y(q, { key: 2 }, [ve.value.length ? (J(), Y("div", rL, [X("div", iL, "▶ " + H(y.value.debugSubRunningTitle) + " (" + H(ve.value.length) + ")", 1), (J(!0), Y(q, null, Ca(ve.value, (e, t) => (J(), Y("div", {
|
|
33114
33172
|
key: "a" + t,
|
|
33115
33173
|
class: Je(["sub-card", e.status])
|
|
33116
|
-
}, [X("div",
|
|
33174
|
+
}, [X("div", aL, [
|
|
33117
33175
|
X("span", {
|
|
33118
33176
|
class: "sub-status",
|
|
33119
33177
|
style: Ue({ background: be.value[e.status] && be.value[e.status].color || "#9ca3af" })
|
|
33120
33178
|
}, H(be.value[e.status] && be.value[e.status].label || e.status), 5),
|
|
33121
|
-
X("span",
|
|
33122
|
-
X("span",
|
|
33123
|
-
]), X("div",
|
|
33179
|
+
X("span", oL, H(e.label), 1),
|
|
33180
|
+
X("span", sL, H(e.steps.length) + H(y.value.debugStepsCountSuffix), 1)
|
|
33181
|
+
]), X("div", cL, H(L(e.task, 80)), 1)], 2))), 128))])) : Z("", !0), B.value.length ? (J(), Y("div", lL, [X("div", uL, "🕐 " + H(y.value.debugSubHistoryTitle) + " (" + H(B.value.length) + ")", 1), (J(!0), Y(q, null, Ca(B.value, (e, t) => (J(), Y("div", {
|
|
33124
33182
|
key: "h" + t,
|
|
33125
33183
|
class: Je(["sub-card", e.status])
|
|
33126
33184
|
}, [
|
|
33127
|
-
X("div",
|
|
33185
|
+
X("div", dL, [
|
|
33128
33186
|
X("span", {
|
|
33129
33187
|
class: "sub-status",
|
|
33130
33188
|
style: Ue({ background: be.value[e.status] && be.value[e.status].color || "#9ca3af" })
|
|
33131
33189
|
}, H(be.value[e.status] && be.value[e.status].label || e.status), 5),
|
|
33132
|
-
X("span",
|
|
33133
|
-
e.durationMs == null ? Z("", !0) : (J(), Y("span",
|
|
33190
|
+
X("span", fL, H(e.label), 1),
|
|
33191
|
+
e.durationMs == null ? Z("", !0) : (J(), Y("span", pL, H(R(e.durationMs)), 1)),
|
|
33134
33192
|
e.steps.length ? (J(), Y("button", {
|
|
33135
33193
|
key: 1,
|
|
33136
33194
|
class: "sub-toggle",
|
|
33137
33195
|
onClick: (e) => xe(t)
|
|
33138
|
-
}, H(V.value.has(t) ? y.value.collapse : y.value.debugStepsBtn), 9,
|
|
33196
|
+
}, H(V.value.has(t) ? y.value.collapse : y.value.debugStepsBtn), 9, mL)) : Z("", !0)
|
|
33139
33197
|
]),
|
|
33140
|
-
X("div",
|
|
33141
|
-
e.resultPreview ? (J(), Y("div",
|
|
33142
|
-
V.value.has(t) && e.steps.length ? (J(), Y("div",
|
|
33198
|
+
X("div", hL, H(L(e.task, 80)), 1),
|
|
33199
|
+
e.resultPreview ? (J(), Y("div", gL, H(e.resultPreview), 1)) : Z("", !0),
|
|
33200
|
+
V.value.has(t) && e.steps.length ? (J(), Y("div", _L, [(J(!0), Y(q, null, Ca(e.steps, (e, t) => (J(), Y("div", {
|
|
33143
33201
|
key: t,
|
|
33144
33202
|
class: "sub-step"
|
|
33145
33203
|
}, [
|
|
33146
|
-
X("span",
|
|
33147
|
-
X("span",
|
|
33148
|
-
X("span",
|
|
33204
|
+
X("span", vL, H(e.kind === "tool_call" ? "🔧" : "✅"), 1),
|
|
33205
|
+
X("span", yL, H(e.name), 1),
|
|
33206
|
+
X("span", bL, H(N(e.ts)), 1)
|
|
33149
33207
|
]))), 128))])) : Z("", !0)
|
|
33150
33208
|
], 2))), 128))])) : Z("", !0)], 64))])) : Z("", !0),
|
|
33151
|
-
ue.value === "logs" ? (J(), Y(q, { key: 2 }, [S.value.length === 0 ? (J(), Y("div",
|
|
33209
|
+
ue.value === "logs" ? (J(), Y(q, { key: 2 }, [S.value.length === 0 ? (J(), Y("div", xL, H(y.value.debugLogsEmpty), 1)) : Z("", !0), (J(!0), Y(q, null, Ca(k.value, (e) => (J(), Y("div", {
|
|
33152
33210
|
key: e.key,
|
|
33153
33211
|
class: "log-group"
|
|
33154
33212
|
}, [X("div", {
|
|
@@ -33156,185 +33214,185 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33156
33214
|
onClick: (t) => M(e.key)
|
|
33157
33215
|
}, [
|
|
33158
33216
|
X("span", { class: Je(["log-group-arrow", { open: te(e.key) }]) }, "▶", 2),
|
|
33159
|
-
X("span",
|
|
33160
|
-
X("span",
|
|
33217
|
+
X("span", CL, H(ne(e)), 1),
|
|
33218
|
+
X("span", wL, [
|
|
33161
33219
|
Ns(H(N(e.firstTs)), 1),
|
|
33162
33220
|
e.lastTs > e.firstTs ? (J(), Y(q, { key: 0 }, [Ns(" ~ " + H(N(e.lastTs)), 1)], 64)) : Z("", !0),
|
|
33163
33221
|
Ns(" · " + H(R(e.lastTs - e.firstTs)), 1)
|
|
33164
33222
|
]),
|
|
33165
|
-
e.toolCount ? (J(), Y("span",
|
|
33166
|
-
e.tokens == null ? Z("", !0) : (J(), Y("span",
|
|
33167
|
-
e.errorCount ? (J(), Y("span",
|
|
33168
|
-
], 10,
|
|
33223
|
+
e.toolCount ? (J(), Y("span", TL, "🔧 " + H(e.toolCount), 1)) : Z("", !0),
|
|
33224
|
+
e.tokens == null ? Z("", !0) : (J(), Y("span", EL, "Σ " + H(e.tokens) + " tok", 1)),
|
|
33225
|
+
e.errorCount ? (J(), Y("span", DL, "❌ " + H(e.errorCount), 1)) : Z("", !0)
|
|
33226
|
+
], 10, SL), fi(X("div", OL, [(J(!0), Y(q, null, Ca(e.entries, ({ log: e, pairCall: t, prevMsgCount: r, uid: i }) => (J(), Y("div", {
|
|
33169
33227
|
key: i,
|
|
33170
33228
|
class: "log-item"
|
|
33171
33229
|
}, [
|
|
33172
|
-
X("div",
|
|
33230
|
+
X("div", kL, [
|
|
33173
33231
|
X("span", {
|
|
33174
33232
|
class: "log-type",
|
|
33175
33233
|
style: Ue({ background: b.value[e.type].color })
|
|
33176
33234
|
}, H(b.value[e.type].icon) + " " + H(b.value[e.type].label), 5),
|
|
33177
|
-
e.source ? (J(), Y("span",
|
|
33178
|
-
X("span",
|
|
33235
|
+
e.source ? (J(), Y("span", AL, "↳ " + H(e.source), 1)) : Z("", !0),
|
|
33236
|
+
X("span", jL, H(N(e.timestamp)), 1)
|
|
33179
33237
|
]),
|
|
33180
|
-
X("div",
|
|
33181
|
-
X("div",
|
|
33182
|
-
X("div",
|
|
33183
|
-
X("div",
|
|
33184
|
-
X("div",
|
|
33185
|
-
X("div",
|
|
33238
|
+
X("div", ML, [e.type === "context" ? (J(), Y(q, { key: 0 }, [
|
|
33239
|
+
X("div", NL, [
|
|
33240
|
+
X("div", PL, [X("span", FL, H(y.value.debugModel), 1), X("span", IL, H(e.data.model), 1)]),
|
|
33241
|
+
X("div", LL, [X("span", RL, H(y.value.debugTemperature), 1), X("span", zL, H(e.data.temperature), 1)]),
|
|
33242
|
+
X("div", BL, [n[5] ||= X("span", { class: "k" }, "MaxTokens", -1), X("span", VL, H(e.data.maxTokens), 1)]),
|
|
33243
|
+
X("div", HL, [X("span", UL, H(y.value.debugMessageCount), 1), X("span", WL, H(e.data.totalMessages), 1)])
|
|
33186
33244
|
]),
|
|
33187
|
-
X("div",
|
|
33188
|
-
X("div",
|
|
33245
|
+
X("div", GL, H(y.value.debugToolsLabel) + " (" + H(e.data.tools?.length || 0) + ")", 1),
|
|
33246
|
+
X("div", KL, [(J(!0), Y(q, null, Ca(e.data.tools, (e) => (J(), Y("span", {
|
|
33189
33247
|
key: e,
|
|
33190
33248
|
class: "tool-chip"
|
|
33191
33249
|
}, H(e), 1))), 128))]),
|
|
33192
|
-
X("div",
|
|
33193
|
-
X("div",
|
|
33250
|
+
X("div", qL, H(y.value.debugContextMessages), 1),
|
|
33251
|
+
X("div", JL, [(J(!0), Y(q, null, Ca(e.data.messages, (e, t) => (J(), Y("div", {
|
|
33194
33252
|
key: t,
|
|
33195
33253
|
class: "msg-row"
|
|
33196
33254
|
}, [X("span", {
|
|
33197
33255
|
class: "msg-role",
|
|
33198
33256
|
style: Ue({ background: se(e.type).color })
|
|
33199
|
-
}, H(se(e.type).label), 5), X("span",
|
|
33200
|
-
], 64)) : e.type === "llm_request" ? (J(), Y(q, { key: 1 }, [X("div",
|
|
33201
|
-
X("span",
|
|
33202
|
-
e.data.model ? (J(), Y("span",
|
|
33203
|
-
X("span",
|
|
33204
|
-
e.data.tools?.length ? (J(), Y("span",
|
|
33257
|
+
}, H(se(e.type).label), 5), X("span", YL, H(e.content), 1)]))), 128))])
|
|
33258
|
+
], 64)) : e.type === "llm_request" ? (J(), Y(q, { key: 1 }, [X("div", XL, [
|
|
33259
|
+
X("span", ZL, H(y.value.debugRoundPrefix) + H(e.data.round) + H(y.value.debugRoundSuffix), 1),
|
|
33260
|
+
e.data.model ? (J(), Y("span", QL, H(e.data.model), 1)) : Z("", !0),
|
|
33261
|
+
X("span", $L, [Ns(H((e.data.messages || []).length) + H(y.value.debugMsgCountSuffix), 1), r != null && r < (e.data.messages || []).length ? (J(), Y(q, { key: 0 }, [Ns("(+" + H((e.data.messages || []).length - r) + ")", 1)], 64)) : Z("", !0)]),
|
|
33262
|
+
e.data.tools?.length ? (J(), Y("span", eR, H(e.data.tools.length) + H(y.value.debugToolCountSuffix), 1)) : Z("", !0),
|
|
33205
33263
|
r != null && r > 0 ? (J(), Y("button", {
|
|
33206
33264
|
key: 2,
|
|
33207
33265
|
class: "view-toggle only-new-btn",
|
|
33208
33266
|
onClick: (e) => h(i)
|
|
33209
|
-
}, H(m.value.has(i) ? y.value.debugShowAll : y.value.debugOnlyNew), 9,
|
|
33267
|
+
}, H(m.value.has(i) ? y.value.debugShowAll : y.value.debugOnlyNew), 9, tR)) : Z("", !0),
|
|
33210
33268
|
X("button", {
|
|
33211
33269
|
class: "view-toggle copy-btn",
|
|
33212
33270
|
title: y.value.copy,
|
|
33213
33271
|
onClick: (t) => _(ae(e.data.messages), "req" + i)
|
|
33214
|
-
}, H(g.value === "req" + i ? "✓" : "📋"), 9,
|
|
33272
|
+
}, H(g.value === "req" + i ? "✓" : "📋"), 9, nR),
|
|
33215
33273
|
X("button", {
|
|
33216
33274
|
class: "view-toggle",
|
|
33217
33275
|
onClick: (e) => ie(i)
|
|
33218
|
-
}, H(d.value.has(i) ? y.value.debugCardView : y.value.debugRequestBody), 9,
|
|
33219
|
-
]), d.value.has(i) ? (J(), Y("pre",
|
|
33276
|
+
}, H(d.value.has(i) ? y.value.debugCardView : y.value.debugRequestBody), 9, rR)
|
|
33277
|
+
]), d.value.has(i) ? (J(), Y("pre", uR, [X("code", null, H(ae(e.data.messages)), 1)])) : (J(!0), Y(q, { key: 0 }, Ca([re(e, r, m.value.has(i))], (e) => (J(), Y("div", {
|
|
33220
33278
|
key: e.base,
|
|
33221
33279
|
class: "msg-list"
|
|
33222
33280
|
}, [(J(!0), Y(q, null, Ca(e.list, (t, n) => (J(), Y("div", {
|
|
33223
33281
|
key: n,
|
|
33224
|
-
class: Je(["msg-row", { clamped: !f.value.has(i + ":" + (e.base + n)) && String(t.content ?? "").length >
|
|
33225
|
-
title: String(t.content ?? "").length >
|
|
33226
|
-
onClick: (r) => String(t.content ?? "").length >
|
|
33282
|
+
class: Je(["msg-row", { clamped: !f.value.has(i + ":" + (e.base + n)) && String(t.content ?? "").length > OB }]),
|
|
33283
|
+
title: String(t.content ?? "").length > OB ? f.value.has(i + ":" + (e.base + n)) ? y.value.collapse : y.value.expand : void 0,
|
|
33284
|
+
onClick: (r) => String(t.content ?? "").length > OB && p(i + ":" + (e.base + n))
|
|
33227
33285
|
}, [X("span", {
|
|
33228
33286
|
class: "msg-role",
|
|
33229
33287
|
style: Ue({ background: se(t.role).color })
|
|
33230
|
-
}, H(se(t.role).label), 5), X("div",
|
|
33231
|
-
t.content ? (J(), Y("span",
|
|
33288
|
+
}, H(se(t.role).label), 5), X("div", aR, [
|
|
33289
|
+
t.content ? (J(), Y("span", oR, H(t.content), 1)) : Z("", !0),
|
|
33232
33290
|
(J(!0), Y(q, null, Ca(t.tool_calls || [], (e, t) => (J(), Y("div", {
|
|
33233
33291
|
key: t,
|
|
33234
33292
|
class: "tc-inline"
|
|
33235
|
-
}, [X("span",
|
|
33236
|
-
t.tool_call_id ? (J(), Y("span",
|
|
33237
|
-
])], 10,
|
|
33238
|
-
X("div",
|
|
33239
|
-
e.data.content ? (J(), Y("div",
|
|
33240
|
-
e.data.toolCalls?.length ? (J(), Y("div",
|
|
33293
|
+
}, [X("span", sR, "🔧 " + H(e.function?.name || e.name), 1), X("code", cR, H(e.function?.arguments ?? e.args), 1)]))), 128)),
|
|
33294
|
+
t.tool_call_id ? (J(), Y("span", lR, "↳ tool_call_id: " + H(t.tool_call_id), 1)) : Z("", !0)
|
|
33295
|
+
])], 10, iR))), 128))]))), 128))], 64)) : e.type === "llm_response" ? (J(), Y(q, { key: 2 }, [
|
|
33296
|
+
X("div", dR, [X("span", fR, H(y.value.debugRoundPrefix) + H(e.data.round) + H(y.value.debugRoundSuffix), 1), e.data.toolCalls?.length ? (J(), Y("span", pR, "🔧 " + H(e.data.toolCalls.length) + H(y.value.debugToolCallsSuffix), 1)) : Z("", !0)]),
|
|
33297
|
+
e.data.content ? (J(), Y("div", mR, H(e.data.content), 1)) : Z("", !0),
|
|
33298
|
+
e.data.toolCalls?.length ? (J(), Y("div", hR, [(J(!0), Y(q, null, Ca(e.data.toolCalls, (e, t) => (J(), Y("div", {
|
|
33241
33299
|
key: t,
|
|
33242
33300
|
class: "tc-card"
|
|
33243
|
-
}, [X("div",
|
|
33244
|
-
e.data.usage ? (J(), Y("div",
|
|
33245
|
-
X("span",
|
|
33246
|
-
X("span",
|
|
33247
|
-
X("span",
|
|
33248
|
-
e.data.usage.reasoning_tokens ? (J(), Y("span",
|
|
33301
|
+
}, [X("div", gR, "🔧 " + H(e.name), 1), X("pre", _R, H(ae(e.args)), 1)]))), 128))])) : Z("", !0),
|
|
33302
|
+
e.data.usage ? (J(), Y("div", vR, [
|
|
33303
|
+
X("span", yR, "prompt: " + H(e.data.usage.prompt_tokens ?? "-"), 1),
|
|
33304
|
+
X("span", bR, "completion: " + H(e.data.usage.completion_tokens ?? "-"), 1),
|
|
33305
|
+
X("span", xR, "total: " + H(e.data.usage.total_tokens ?? "-"), 1),
|
|
33306
|
+
e.data.usage.reasoning_tokens ? (J(), Y("span", SR, "reasoning: " + H(e.data.usage.reasoning_tokens) + "(" + H(Math.round(e.data.usage.reasoning_tokens / Math.max(1, e.data.usage.completion_tokens ?? 0) * 100)) + "%)", 1)) : Z("", !0)
|
|
33249
33307
|
])) : Z("", !0)
|
|
33250
33308
|
], 64)) : e.type === "tool_call" || e.type === "tool_result" ? (J(), Y(q, { key: 3 }, [t ? (J(), Y("div", {
|
|
33251
33309
|
key: 0,
|
|
33252
33310
|
class: Je(["tc-card inline paired", { error: e.data.status === "error" }])
|
|
33253
33311
|
}, [
|
|
33254
|
-
X("div",
|
|
33312
|
+
X("div", CR, [
|
|
33255
33313
|
Ns(H(e.data.status === "error" ? "❌" : "✅") + " " + H(e.data.name) + " ", 1),
|
|
33256
|
-
e.data.durationMs == null ? Z("", !0) : (J(), Y("span",
|
|
33314
|
+
e.data.durationMs == null ? Z("", !0) : (J(), Y("span", wR, H(R(e.data.durationMs)), 1)),
|
|
33257
33315
|
X("button", {
|
|
33258
33316
|
class: "view-toggle copy-btn",
|
|
33259
33317
|
title: y.value.copy,
|
|
33260
33318
|
onClick: (t) => _(String(e.data.result ?? ""), "res" + i)
|
|
33261
|
-
}, H(g.value === "res" + i ? "✓" : "📋"), 9,
|
|
33319
|
+
}, H(g.value === "res" + i ? "✓" : "📋"), 9, TR)
|
|
33262
33320
|
]),
|
|
33263
|
-
X("pre",
|
|
33264
|
-
X("div",
|
|
33265
|
-
X("pre",
|
|
33266
|
-
], 2)) : (J(), Y("div",
|
|
33267
|
-
X("div",
|
|
33321
|
+
X("pre", ER, H(ae(t.data.args)), 1),
|
|
33322
|
+
X("div", DR, "↓ " + H(y.value.resultLabel), 1),
|
|
33323
|
+
X("pre", OR, H(e.data.result), 1)
|
|
33324
|
+
], 2)) : (J(), Y("div", kR, [X("div", AR, [Ns(H(e.type === "tool_call" ? "🔧" : "✅") + " " + H(e.data.name) + " ", 1), e.type === "tool_call" ? (J(), Y("span", jR, H(y.value.statusRunning) + "…", 1)) : Z("", !0)]), X("pre", MR, H(e.type === "tool_call" ? ae(e.data.args) : e.data.result), 1)]))], 64)) : e.type === "error" ? (J(), Y("div", NR, H(e.data.tool ? `[${e.data.tool}] ` : "") + H(e.data.error), 1)) : Z("", !0)]),
|
|
33325
|
+
X("div", PR, [X("button", {
|
|
33268
33326
|
class: "raw-toggle",
|
|
33269
33327
|
onClick: (e) => P(i)
|
|
33270
|
-
}, H(a.value.has(i) ? y.value.debugCollapseRawJson : y.value.debugViewRawJson), 9,
|
|
33328
|
+
}, H(a.value.has(i) ? y.value.debugCollapseRawJson : y.value.debugViewRawJson), 9, FR), X("button", {
|
|
33271
33329
|
class: "raw-toggle",
|
|
33272
33330
|
onClick: (t) => G(rO)(ae(e.data))
|
|
33273
|
-
}, H(y.value.copy), 9,
|
|
33274
|
-
a.value.has(i) ? (J(), Y("pre",
|
|
33275
|
-
]))), 128))], 512), [[Xc, te(e.key)]])]))), 128))], 64)) : ue.value === "info" ? (J(), Y("div",
|
|
33276
|
-
X("div",
|
|
33277
|
-
X("div",
|
|
33278
|
-
X("div",
|
|
33279
|
-
X("div",
|
|
33280
|
-
X("div",
|
|
33281
|
-
X("div",
|
|
33282
|
-
X("div",
|
|
33331
|
+
}, H(y.value.copy), 9, IR)]),
|
|
33332
|
+
a.value.has(i) ? (J(), Y("pre", LR, [X("code", null, H(ae(e.data)), 1)])) : Z("", !0)
|
|
33333
|
+
]))), 128))], 512), [[Xc, te(e.key)]])]))), 128))], 64)) : ue.value === "info" ? (J(), Y("div", RR, [F.value ? (J(), Y(q, { key: 1 }, [
|
|
33334
|
+
X("div", BR, [
|
|
33335
|
+
X("div", VR, H(y.value.debugInfoBasic), 1),
|
|
33336
|
+
X("div", HR, [
|
|
33337
|
+
X("div", UR, [n[6] ||= X("span", { class: "k" }, "ID", -1), X("span", WR, H(F.value.id), 1)]),
|
|
33338
|
+
X("div", GR, [X("span", KR, H(y.value.debugModel), 1), X("span", qR, H(F.value.model || "-"), 1)]),
|
|
33339
|
+
X("div", JR, [X("span", YR, H(y.value.debugToolCount), 1), X("span", XR, H(F.value.tools.length), 1)]),
|
|
33340
|
+
X("div", ZR, [X("span", QR, H(y.value.debugMiddleware), 1), X("span", $R, H(F.value.middleware.length), 1)])
|
|
33283
33341
|
]),
|
|
33284
|
-
X("div",
|
|
33342
|
+
X("div", ez, [X("span", tz, H(y.value.debugMiddlewareStack), 1), X("span", nz, H(F.value.middleware.join(" → ") || "-"), 1)])
|
|
33285
33343
|
]),
|
|
33286
|
-
X("div",
|
|
33344
|
+
X("div", rz, [X("div", iz, "🔧 " + H(y.value.debugToolsLabel) + " (" + H(F.value.tools.length) + ")", 1), (J(!0), Y(q, null, Ca(F.value.tools, (e) => (J(), Y("div", {
|
|
33287
33345
|
key: e.name,
|
|
33288
33346
|
class: "info-item"
|
|
33289
|
-
}, [X("div",
|
|
33347
|
+
}, [X("div", az, [Ns(H(e.name), 1), e.source ? (J(), Y("span", {
|
|
33290
33348
|
key: 0,
|
|
33291
33349
|
class: Je(["src-tag", ge(e.source)])
|
|
33292
|
-
}, H(e.source), 3)) : Z("", !0)]), X("div",
|
|
33293
|
-
F.value.skills.length ? (J(), Y("div",
|
|
33350
|
+
}, H(e.source), 3)) : Z("", !0)]), X("div", oz, H(e.description), 1)]))), 128))]),
|
|
33351
|
+
F.value.skills.length ? (J(), Y("div", sz, [X("div", cz, [Ns("📘 " + H(y.value.debugSkillsTitle) + " (" + H(F.value.skills.length) + ")", 1), X("span", lz, H(y.value.debugSkillsHint), 1)]), (J(!0), Y(q, null, Ca(F.value.skills, (e) => (J(), Y("div", {
|
|
33294
33352
|
key: e.name,
|
|
33295
33353
|
class: "info-item"
|
|
33296
33354
|
}, [
|
|
33297
33355
|
X("div", {
|
|
33298
33356
|
class: "info-name skill-toggle",
|
|
33299
33357
|
onClick: (t) => de(e.name)
|
|
33300
|
-
}, [X("span", { class: Je(["skill-arrow", { open: !!I.value[e.name] }]) }, "▶", 2), Ns(" " + H(e.name), 1)], 8,
|
|
33301
|
-
X("div",
|
|
33302
|
-
I.value[e.name] ? (J(), Y("div",
|
|
33358
|
+
}, [X("span", { class: Je(["skill-arrow", { open: !!I.value[e.name] }]) }, "▶", 2), Ns(" " + H(e.name), 1)], 8, uz),
|
|
33359
|
+
X("div", dz, H(e.description), 1),
|
|
33360
|
+
I.value[e.name] ? (J(), Y("div", fz, [I.value[e.name].loading ? (J(), Y("div", pz, H(y.value.debugLoading), 1)) : I.value[e.name].error ? (J(), Y("div", mz, H(I.value[e.name].error), 1)) : I.value[e.name].content ? (J(), Y("pre", hz, H(I.value[e.name].content), 1)) : Z("", !0)])) : Z("", !0)
|
|
33303
33361
|
]))), 128))])) : Z("", !0),
|
|
33304
|
-
F.value.data ? (J(), Y("div",
|
|
33305
|
-
X("div",
|
|
33306
|
-
X("div",
|
|
33307
|
-
X("div",
|
|
33308
|
-
X("div",
|
|
33309
|
-
X("div",
|
|
33362
|
+
F.value.data ? (J(), Y("div", gz, [X("div", _z, "📊 " + H(y.value.debugDataTitle), 1), X("div", vz, [X("div", yz, H(F.value.data.description || y.value.debugDataFallback), 1), X("div", bz, H(y.value.debugSchemaPrefix) + H(F.value.data.schema ? y.value.debugSchemaDeclared : y.value.debugSchemaMissing), 1)])])) : Z("", !0),
|
|
33363
|
+
X("div", xz, [X("div", Sz, "🧬 " + H(y.value.debugSubagentTitle), 1), X("div", Cz, [
|
|
33364
|
+
X("div", wz, [X("span", Tz, H(y.value.debugEnabled), 1), X("span", Ez, H(F.value.subagent.enabled ? y.value.debugYes : y.value.debugNo), 1)]),
|
|
33365
|
+
X("div", Dz, [X("span", Oz, H(y.value.debugMaxDepth), 1), X("span", kz, H(F.value.subagent.maxDepth), 1)]),
|
|
33366
|
+
X("div", Az, [X("span", jz, H(y.value.debugMaxParallel), 1), X("span", Mz, H(F.value.subagent.maxParallel), 1)]),
|
|
33367
|
+
X("div", Nz, [X("span", Pz, H(y.value.debugExtraTools), 1), X("span", Fz, H(F.value.subagent.allowedTools.length ? F.value.subagent.allowedTools.join(", ") : y.value.debugDefaultReadonly), 1)])
|
|
33310
33368
|
])]),
|
|
33311
|
-
F.value.mcp?.servers?.length ? (J(), Y("div",
|
|
33369
|
+
F.value.mcp?.servers?.length ? (J(), Y("div", Iz, [X("div", Lz, "🔌 MCP (" + H(F.value.mcp.servers.length) + ")", 1), (J(!0), Y(q, null, Ca(F.value.mcp.servers, (e) => (J(), Y("div", {
|
|
33312
33370
|
key: e.name,
|
|
33313
33371
|
class: "info-item"
|
|
33314
|
-
}, [X("div",
|
|
33315
|
-
F.value.verify ? (J(), Y("div",
|
|
33316
|
-
X("div",
|
|
33317
|
-
X("div",
|
|
33318
|
-
X("div",
|
|
33319
|
-
F.value.verify.adversarial ? (J(), Y("div",
|
|
33372
|
+
}, [X("div", Rz, [Ns(H(e.name) + " ", 1), X("span", zz, H(e.toolCount) + H(y.value.debugToolCountSuffix), 1)]), X("div", Bz, H(e.url), 1)]))), 128))])) : Z("", !0),
|
|
33373
|
+
F.value.verify ? (J(), Y("div", Vz, [X("div", Hz, "✅ " + H(y.value.debugVerifyTitle), 1), X("div", Uz, [
|
|
33374
|
+
X("div", Wz, [X("span", Gz, H(y.value.debugEnabled), 1), X("span", Kz, H(F.value.verify.enabled ? y.value.debugYes : y.value.debugNo), 1)]),
|
|
33375
|
+
X("div", qz, [X("span", Jz, H(y.value.debugMaxAttempts), 1), X("span", Yz, H(F.value.verify.maxAttempts), 1)]),
|
|
33376
|
+
X("div", Xz, [X("span", Zz, H(y.value.debugAdversarial), 1), X("span", Qz, H(F.value.verify.adversarial ? y.value.debugOn : y.value.debugOff), 1)]),
|
|
33377
|
+
F.value.verify.adversarial ? (J(), Y("div", $z, [X("span", eB, H(y.value.debugAdversarialModel), 1), X("span", tB, H(F.value.model || "-") + H(y.value.debugSameAsMain), 1)])) : Z("", !0)
|
|
33320
33378
|
])])) : Z("", !0),
|
|
33321
|
-
F.value.todos.length ? (J(), Y("div",
|
|
33379
|
+
F.value.todos.length ? (J(), Y("div", nB, [X("div", rB, "📋 " + H(y.value.debugTodosTitle) + " (" + H(F.value.todos.length) + ")", 1), (J(!0), Y(q, null, Ca(F.value.todos, (e, t) => (J(), Y("div", {
|
|
33322
33380
|
key: t,
|
|
33323
33381
|
class: "info-todo"
|
|
33324
33382
|
}, [X("span", {
|
|
33325
33383
|
class: "todo-tag",
|
|
33326
33384
|
style: Ue({ background: me.value[e.status] && me.value[e.status].color || "#9ca3af" })
|
|
33327
33385
|
}, H(he(e.status)), 5), X("span", null, H(e.content), 1)]))), 128))])) : Z("", !0),
|
|
33328
|
-
F.value.memory ? (J(), Y("div",
|
|
33329
|
-
F.value.lastCompression ? (J(), Y("div",
|
|
33330
|
-
X("div",
|
|
33331
|
-
X("div",
|
|
33332
|
-
X("div",
|
|
33333
|
-
X("div",
|
|
33334
|
-
X("div",
|
|
33335
|
-
F.value.lastCompression.decision ? (J(), Y("div",
|
|
33386
|
+
F.value.memory ? (J(), Y("div", iB, [X("div", aB, "📝 " + H(y.value.debugMemoryTitle), 1), X("pre", oB, H(F.value.memory), 1)])) : Z("", !0),
|
|
33387
|
+
F.value.lastCompression ? (J(), Y("div", sB, [X("div", cB, "🗜️ " + H(y.value.debugLastCompTitle), 1), X("div", lB, [
|
|
33388
|
+
X("div", uB, [X("span", dB, H(y.value.debugTriggered), 1), X("span", fB, H(F.value.lastCompression.triggered ? "✓" : y.value.debugNotTriggered), 1)]),
|
|
33389
|
+
X("div", pB, [X("span", mB, H(y.value.debugRoundsSummarized), 1), X("span", hB, H(F.value.lastCompression.roundsSummarized) + " / " + H(F.value.lastCompression.roundsTotal), 1)]),
|
|
33390
|
+
X("div", gB, [X("span", _B, H(y.value.debugCtxRecalled), 1), X("span", vB, H(F.value.lastCompression.roundsRecalled) + H(y.value.debugCountSuffix), 1)]),
|
|
33391
|
+
X("div", yB, [X("span", bB, H(y.value.debugMessageCount), 1), X("span", xB, H(F.value.lastCompression.originalMessages) + " → " + H(F.value.lastCompression.compressedMessages), 1)]),
|
|
33392
|
+
X("div", SB, [X("span", CB, H(y.value.debugStrategy), 1), X("span", wB, H(F.value.lastCompression.strategy), 1)]),
|
|
33393
|
+
F.value.lastCompression.decision ? (J(), Y("div", TB, [X("span", EB, H(y.value.debugDecision), 1), X("span", DB, "🤖 " + H(Se(F.value.lastCompression.decision)), 1)])) : Z("", !0)
|
|
33336
33394
|
])])) : Z("", !0)
|
|
33337
|
-
], 64)) : (J(), Y("div",
|
|
33395
|
+
], 64)) : (J(), Y("div", zR, H(y.value.debugNoInfo), 1))])) : Z("", !0)
|
|
33338
33396
|
], 512)], 512)], 512)
|
|
33339
33397
|
], 2), X("div", {
|
|
33340
33398
|
class: "drawer-mask",
|
|
@@ -33343,7 +33401,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33343
33401
|
_: 1
|
|
33344
33402
|
})]));
|
|
33345
33403
|
}
|
|
33346
|
-
}), [["__scopeId", "data-v-6d9e98b4"]]),
|
|
33404
|
+
}), [["__scopeId", "data-v-6d9e98b4"]]), AB = ["title"], jB = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
33347
33405
|
__name: "SelectionMenu",
|
|
33348
33406
|
emits: ["quote"],
|
|
33349
33407
|
setup(e, { emit: t }) {
|
|
@@ -33429,18 +33487,18 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33429
33487
|
title: G(r).selectionMenuTitle,
|
|
33430
33488
|
onMousedown: t[0] ||= Fl(() => {}, ["prevent"]),
|
|
33431
33489
|
onClick: _
|
|
33432
|
-
}, "❝ " + H(G(r).selectionMenuLabel), 41,
|
|
33490
|
+
}, "❝ " + H(G(r).selectionMenuLabel), 41, AB)], 4), [[Xc, i.value]])]));
|
|
33433
33491
|
}
|
|
33434
|
-
}), [["__scopeId", "data-v-19e6dbb4"]]),
|
|
33492
|
+
}), [["__scopeId", "data-v-19e6dbb4"]]), MB = { class: "skill-panel" }, NB = { class: "skill-header" }, PB = { class: "skill-title" }, FB = ["title"], IB = { class: "skill-section" }, LB = { class: "section-title" }, RB = ["title"], zB = { class: "field" }, BB = { class: "field-label" }, VB = ["disabled", "placeholder"], HB = { class: "field" }, UB = { class: "field-label" }, WB = ["placeholder"], GB = { class: "field field-textarea" }, KB = { class: "field-label" }, qB = ["placeholder"], JB = {
|
|
33435
33493
|
key: 0,
|
|
33436
33494
|
class: "skill-error"
|
|
33437
|
-
},
|
|
33495
|
+
}, YB = { class: "skill-section" }, XB = { class: "section-title" }, ZB = {
|
|
33438
33496
|
key: 0,
|
|
33439
33497
|
class: "empty-hint"
|
|
33440
|
-
},
|
|
33498
|
+
}, QB = {
|
|
33441
33499
|
key: 1,
|
|
33442
33500
|
class: "skill-list"
|
|
33443
|
-
},
|
|
33501
|
+
}, $B = { class: "skill-actions" }, eV = ["title", "onClick"], tV = ["title", "onClick"], nV = { class: "skill-hint" }, rV = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
33444
33502
|
__name: "SkillPanel",
|
|
33445
33503
|
props: {
|
|
33446
33504
|
visible: { type: Boolean },
|
|
@@ -33495,55 +33553,55 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33495
33553
|
key: 0,
|
|
33496
33554
|
class: "skill-mask",
|
|
33497
33555
|
onClick: n[4] ||= Fl((e) => r("close"), ["self"])
|
|
33498
|
-
}, [X("div",
|
|
33499
|
-
X("div",
|
|
33556
|
+
}, [X("div", MB, [
|
|
33557
|
+
X("div", NB, [X("span", PB, H(e.messages.skillPanelTitle), 1), X("button", {
|
|
33500
33558
|
class: "skill-close",
|
|
33501
33559
|
title: e.messages.close,
|
|
33502
33560
|
onClick: n[0] ||= (e) => r("close")
|
|
33503
|
-
}, "✕", 8,
|
|
33504
|
-
X("div",
|
|
33505
|
-
X("div",
|
|
33561
|
+
}, "✕", 8, FB)]),
|
|
33562
|
+
X("div", IB, [
|
|
33563
|
+
X("div", LB, [Ns(H(u.value ? `${e.messages.skillEditingPrefix}${u.value}` : e.messages.skillCreateNew) + " ", 1), u.value ? (J(), Y("button", {
|
|
33506
33564
|
key: 0,
|
|
33507
33565
|
class: "btn btn-ghost btn-cancel",
|
|
33508
33566
|
title: e.messages.skillCancelEdit,
|
|
33509
33567
|
onClick: h
|
|
33510
|
-
}, H(e.messages.skillCancelEdit), 9,
|
|
33511
|
-
X("label",
|
|
33568
|
+
}, H(e.messages.skillCancelEdit), 9, RB)) : Z("", !0)]),
|
|
33569
|
+
X("label", zB, [X("span", BB, H(e.messages.skillNameLabel), 1), fi(X("input", {
|
|
33512
33570
|
"onUpdate:modelValue": n[1] ||= (e) => i.value = e,
|
|
33513
33571
|
disabled: !!u.value,
|
|
33514
33572
|
placeholder: e.messages.skillNamePlaceholder,
|
|
33515
33573
|
class: "field-input"
|
|
33516
|
-
}, null, 8,
|
|
33517
|
-
X("label",
|
|
33574
|
+
}, null, 8, VB), [[Ml, i.value]])]),
|
|
33575
|
+
X("label", HB, [X("span", UB, H(e.messages.skillDescLabel), 1), fi(X("input", {
|
|
33518
33576
|
"onUpdate:modelValue": n[2] ||= (e) => a.value = e,
|
|
33519
33577
|
placeholder: e.messages.skillDescPlaceholder,
|
|
33520
33578
|
class: "field-input"
|
|
33521
|
-
}, null, 8,
|
|
33522
|
-
X("label",
|
|
33579
|
+
}, null, 8, WB), [[Ml, a.value]])]),
|
|
33580
|
+
X("label", GB, [X("span", KB, H(e.messages.skillContentLabel), 1), fi(X("textarea", {
|
|
33523
33581
|
"onUpdate:modelValue": n[3] ||= (e) => o.value = e,
|
|
33524
33582
|
placeholder: e.messages.skillContentPlaceholder,
|
|
33525
33583
|
rows: "6",
|
|
33526
33584
|
class: "field-input"
|
|
33527
|
-
}, null, 8,
|
|
33528
|
-
s.value ? (J(), Y("div",
|
|
33585
|
+
}, null, 8, qB), [[Ml, o.value]])]),
|
|
33586
|
+
s.value ? (J(), Y("div", JB, H(s.value), 1)) : Z("", !0),
|
|
33529
33587
|
X("button", {
|
|
33530
33588
|
class: "btn btn-primary",
|
|
33531
33589
|
onClick: f
|
|
33532
33590
|
}, H(u.value ? e.messages.skillSave : e.messages.skillAdd), 1)
|
|
33533
33591
|
]),
|
|
33534
|
-
X("div",
|
|
33592
|
+
X("div", YB, [X("div", XB, H(e.messages.skillCreatedTitle) + "(" + H(c.value.length) + ")", 1), c.value.length ? (J(), Y("ul", QB, [(J(!0), Y(q, null, Ca(c.value, (t) => (J(), Y("li", {
|
|
33535
33593
|
key: t,
|
|
33536
33594
|
class: "skill-item"
|
|
33537
|
-
}, [X("span", { class: Je(["skill-name", { active: u.value === t }]) }, H(t), 3), X("span",
|
|
33595
|
+
}, [X("span", { class: Je(["skill-name", { active: u.value === t }]) }, H(t), 3), X("span", $B, [X("button", {
|
|
33538
33596
|
class: "btn btn-ghost btn-edit",
|
|
33539
33597
|
title: e.messages.skillEditTitle,
|
|
33540
33598
|
onClick: (e) => m(t)
|
|
33541
|
-
}, H(e.messages.skillEditBtn), 9,
|
|
33599
|
+
}, H(e.messages.skillEditBtn), 9, eV), X("button", {
|
|
33542
33600
|
class: "btn btn-ghost btn-del",
|
|
33543
33601
|
title: e.messages.skillDeleteTitle,
|
|
33544
33602
|
onClick: (e) => p(t)
|
|
33545
|
-
}, H(e.messages.skillDeleteBtn), 9,
|
|
33546
|
-
X("div",
|
|
33603
|
+
}, H(e.messages.skillDeleteBtn), 9, tV)])]))), 128))])) : (J(), Y("div", ZB, H(e.messages.skillEmpty), 1))]),
|
|
33604
|
+
X("div", nV, [
|
|
33547
33605
|
Ns(" 💡 " + H(e.messages.skillHintA) + " ", 1),
|
|
33548
33606
|
n[5] ||= X("code", null, "load_skill(name)", -1),
|
|
33549
33607
|
Ns(" " + H(e.messages.skillHintB) + " ", 1),
|
|
@@ -33554,7 +33612,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33554
33612
|
_: 1
|
|
33555
33613
|
})]));
|
|
33556
33614
|
}
|
|
33557
|
-
}), [["__scopeId", "data-v-fcd21121"]]),
|
|
33615
|
+
}), [["__scopeId", "data-v-fcd21121"]]), iV = ["aria-valuenow"], aV = "page-agent-sdk:drawerWidth", oV = 320, sV = 960, cV = 420, lV = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
33558
33616
|
__name: "ChatDialog",
|
|
33559
33617
|
props: {
|
|
33560
33618
|
fetchResponse: {},
|
|
@@ -33677,16 +33735,16 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33677
33735
|
function v() {
|
|
33678
33736
|
if (typeof localStorage > "u") return null;
|
|
33679
33737
|
try {
|
|
33680
|
-
let e = Number(localStorage.getItem(
|
|
33681
|
-
return Number.isFinite(e) && e >=
|
|
33738
|
+
let e = Number(localStorage.getItem(aV));
|
|
33739
|
+
return Number.isFinite(e) && e >= oV ? e : null;
|
|
33682
33740
|
} catch {
|
|
33683
33741
|
return null;
|
|
33684
33742
|
}
|
|
33685
33743
|
}
|
|
33686
33744
|
let y = /* @__PURE__ */ W(v()), b = /* @__PURE__ */ W(!1);
|
|
33687
33745
|
function x(e) {
|
|
33688
|
-
let t = typeof window < "u" ? window.innerWidth :
|
|
33689
|
-
return Math.min(Math.max(e,
|
|
33746
|
+
let t = typeof window < "u" ? window.innerWidth : sV, n = Math.max(Math.min(sV, t * .9), oV);
|
|
33747
|
+
return Math.min(Math.max(e, oV), n);
|
|
33690
33748
|
}
|
|
33691
33749
|
let S = mc(() => y.value == null ? typeof n.drawerWidth == "number" ? n.drawerWidth : null : y.value), C = mc(() => {
|
|
33692
33750
|
if (!n.drawer || n.drawerWidth == null) return n.drawer && y.value != null ? `${y.value}px` : null;
|
|
@@ -33716,12 +33774,12 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33716
33774
|
}
|
|
33717
33775
|
function A() {
|
|
33718
33776
|
if (!(y.value == null || typeof localStorage > "u")) try {
|
|
33719
|
-
localStorage.setItem(
|
|
33777
|
+
localStorage.setItem(aV, String(y.value));
|
|
33720
33778
|
} catch {}
|
|
33721
33779
|
}
|
|
33722
33780
|
function ee(e) {
|
|
33723
33781
|
if (!T.value) return;
|
|
33724
|
-
let t = e.shiftKey ? 64 : 16, n = S.value ?? (typeof window < "u" ? Math.min(
|
|
33782
|
+
let t = e.shiftKey ? 64 : 16, n = S.value ?? (typeof window < "u" ? Math.min(cV, window.innerWidth * .9) : cV);
|
|
33725
33783
|
if (e.key === "ArrowLeft") y.value = x(n + t);
|
|
33726
33784
|
else if (e.key === "ArrowRight") y.value = x(n - t);
|
|
33727
33785
|
else return;
|
|
@@ -33754,7 +33812,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33754
33812
|
onPointerup: k,
|
|
33755
33813
|
onPointercancel: k,
|
|
33756
33814
|
onKeydown: ee
|
|
33757
|
-
}, null, 40,
|
|
33815
|
+
}, null, 40, iV)) : Z("", !0),
|
|
33758
33816
|
g("header") ? wa(t.$slots, "header", {
|
|
33759
33817
|
key: 1,
|
|
33760
33818
|
chat: G(i)
|
|
@@ -33838,11 +33896,11 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33838
33896
|
g("approval") ? wa(t.$slots, "approval", {
|
|
33839
33897
|
key: 2,
|
|
33840
33898
|
chat: G(i)
|
|
33841
|
-
}, () => [Os(
|
|
33899
|
+
}, () => [Os(EF)], !0) : Z("", !0),
|
|
33842
33900
|
g("conflict") ? wa(t.$slots, "conflict", {
|
|
33843
33901
|
key: 3,
|
|
33844
33902
|
chat: G(i)
|
|
33845
|
-
}, () => [Os(
|
|
33903
|
+
}, () => [Os(UF, {
|
|
33846
33904
|
"pending-conflict": e.pendingConflict,
|
|
33847
33905
|
"on-resolve": e.onResolveConflict,
|
|
33848
33906
|
icons: G(i).icons,
|
|
@@ -33858,7 +33916,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33858
33916
|
key: 3,
|
|
33859
33917
|
name: "cs-slide"
|
|
33860
33918
|
}, {
|
|
33861
|
-
default: ui(() => [wa(t.$slots, "footer", { chat: G(i) }, () => [Os(
|
|
33919
|
+
default: ui(() => [wa(t.$slots, "footer", { chat: G(i) }, () => [Os(yI, {
|
|
33862
33920
|
placeholder: e.placeholder || G(i).messages.inputPlaceholder,
|
|
33863
33921
|
"input-rows": e.inputRows,
|
|
33864
33922
|
"gate-pending": f.value,
|
|
@@ -33878,7 +33936,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33878
33936
|
g("debug") ? wa(t.$slots, "debug", {
|
|
33879
33937
|
key: 4,
|
|
33880
33938
|
chat: G(i)
|
|
33881
|
-
}, () => [Os(
|
|
33939
|
+
}, () => [Os(kB, {
|
|
33882
33940
|
visible: G(o),
|
|
33883
33941
|
"onUpdate:visible": n[4] ||= (e) => /* @__PURE__ */ zn(o) ? o.value = e : null,
|
|
33884
33942
|
logs: e.debugLogs,
|
|
@@ -33904,7 +33962,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33904
33962
|
g("skill") ? wa(t.$slots, "skill", {
|
|
33905
33963
|
key: 5,
|
|
33906
33964
|
chat: G(i)
|
|
33907
|
-
}, () => [Os(
|
|
33965
|
+
}, () => [Os(rV, {
|
|
33908
33966
|
visible: G(s),
|
|
33909
33967
|
"on-add-skill": e.onAddSkill,
|
|
33910
33968
|
"on-remove-skill": e.onRemoveSkill,
|
|
@@ -33921,7 +33979,7 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33921
33979
|
"messages",
|
|
33922
33980
|
"onClose"
|
|
33923
33981
|
])], !0) : Z("", !0),
|
|
33924
|
-
e.selectionMenu ? (J(), xs(
|
|
33982
|
+
e.selectionMenu ? (J(), xs(jB, {
|
|
33925
33983
|
key: 6,
|
|
33926
33984
|
onQuote: n[6] ||= (t) => e.onSelectionQuote?.(t)
|
|
33927
33985
|
})) : Z("", !0)
|
|
@@ -33930,13 +33988,13 @@ var $N = ["innerHTML"], eP = /* @__PURE__ */ Zi({
|
|
|
33930
33988
|
}), [["__scopeId", "data-v-f232f961"]]);
|
|
33931
33989
|
//#endregion
|
|
33932
33990
|
//#region src/core/sdk/mountChatDialog.ts
|
|
33933
|
-
function
|
|
33991
|
+
function uV(e) {
|
|
33934
33992
|
let { core: t, dialogCfg: n } = e, r = null, i = e.el, a = () => {
|
|
33935
33993
|
let e = i.querySelector?.(".chat-dialog"), t = i.querySelector?.(".chat-mask");
|
|
33936
33994
|
e && e.classList.remove("cs-hidden"), t && t.classList.remove("cs-hidden");
|
|
33937
33995
|
}, o = t.agent.debugLogs;
|
|
33938
33996
|
return r = Vl(/* @__PURE__ */ Zi({ setup() {
|
|
33939
|
-
return () => hc(
|
|
33997
|
+
return () => hc(lV, {
|
|
33940
33998
|
fetchStream: e.streaming ? t.stream : void 0,
|
|
33941
33999
|
fetchResponse: e.streaming ? void 0 : (e, n) => t.stream(e, () => {}, n),
|
|
33942
34000
|
title: n.title,
|
|
@@ -34086,7 +34144,7 @@ function lV(e) {
|
|
|
34086
34144
|
}
|
|
34087
34145
|
//#endregion
|
|
34088
34146
|
//#region src/core/sdk/ragSubagent.ts
|
|
34089
|
-
function
|
|
34147
|
+
function dV(e, t, n, r, i) {
|
|
34090
34148
|
let a = [];
|
|
34091
34149
|
e && a.push("vfs_grep + vfs_read(搜预注入文档)"), t && a.push(`${r}(语义检索)`), n && a.push(`${i}(按 source 加载)`), a.push("fetch_document(公网 URL)");
|
|
34092
34150
|
let o = [];
|
|
@@ -34101,7 +34159,7 @@ function uV(e, t, n, r, i) {
|
|
|
34101
34159
|
|
|
34102
34160
|
你是只读检索角色,不要尝试修改任何数据。不要尝试上面未列出的工具。`;
|
|
34103
34161
|
}
|
|
34104
|
-
function
|
|
34162
|
+
function fV(e, t, n, r, i) {
|
|
34105
34163
|
let a = [], o = [];
|
|
34106
34164
|
return e && (a.push("- vfs_grep / vfs_read:搜集成方预注入 vfs 的文档(组件文档 / UI 规范)—— 快、静态,先查"), o.push("- 静态文档(组件库文档 / UI 规范):vfs_grep")), t && (a.push(`- ${r}:语义检索(retriever 向量库)—— 模糊匹配,关键词不确定 / 语义相似时用`), o.push(`- 语义相似(「瀑布流组件」「倒计时」「拼团」):${r}`)), n && (a.push(`- ${i}:按 source 精确加载(已知文档 id / URL / key)—— 精确取特定文档`), o.push(`- 已知文档 id / URL:${i}`)), a.push("- fetch_document:公网 URL —— 查公开资料"), o.push("- 公开 URL(设计规范网站 / 第三方文档):fetch_document"), `# 知识检索策略(RAG)
|
|
34107
34165
|
|
|
@@ -34118,12 +34176,12 @@ ${a.join("\n")}
|
|
|
34118
34176
|
## 何时用何源
|
|
34119
34177
|
${o.join("\n")}`;
|
|
34120
34178
|
}
|
|
34121
|
-
var
|
|
34179
|
+
var pV = {
|
|
34122
34180
|
name: "rag-search",
|
|
34123
34181
|
description: "多源知识检索策略:vfs 预注入文档 → 语义检索 → 指定文档加载 → 公网;综合结构化结论 + 溯源",
|
|
34124
|
-
getContent: () =>
|
|
34182
|
+
getContent: () => fV(!0, !0, !0, "search_docs", "load_doc")
|
|
34125
34183
|
};
|
|
34126
|
-
function
|
|
34184
|
+
function mV(e, n, r) {
|
|
34127
34185
|
let i = s(async ({ query: e, topK: t }) => {
|
|
34128
34186
|
try {
|
|
34129
34187
|
let i = await n(e, { topK: t ?? r });
|
|
@@ -34141,7 +34199,7 @@ function pV(e, n, r) {
|
|
|
34141
34199
|
});
|
|
34142
34200
|
return Wu([i]), i;
|
|
34143
34201
|
}
|
|
34144
|
-
function
|
|
34202
|
+
function hV(e, n) {
|
|
34145
34203
|
let r = s(async ({ source: e }) => {
|
|
34146
34204
|
try {
|
|
34147
34205
|
let t = await n(e), r = Array.isArray(t) ? t : [t];
|
|
@@ -34156,19 +34214,19 @@ function mV(e, n) {
|
|
|
34156
34214
|
});
|
|
34157
34215
|
return Wu([r]), r;
|
|
34158
34216
|
}
|
|
34159
|
-
function
|
|
34217
|
+
function gV(e) {
|
|
34160
34218
|
let { retriever: t, loader: n, useVfs: r = !0, id: i = "rag", description: a, topK: o = 5, searchToolName: s = "search_docs", loadToolName: c = "load_doc", maxToolRounds: l = 8, summarization: u, skills: d, extraTools: f } = e;
|
|
34161
34219
|
if (!t && !n && r === !1) throw Error("[page-agent-sdk][createRagSubagent] 至少配一种知识源:retriever / loader / useVfs(true)");
|
|
34162
34220
|
let p = [];
|
|
34163
|
-
t && p.push(
|
|
34221
|
+
t && p.push(mV(s, t, o)), n && p.push(hV(c, n)), f && p.push(...f);
|
|
34164
34222
|
let m = r ? [
|
|
34165
34223
|
"vfs_grep",
|
|
34166
34224
|
"vfs_read",
|
|
34167
34225
|
"vfs_json_read"
|
|
34168
|
-
] : void 0, h =
|
|
34226
|
+
] : void 0, h = dV(r, !!t, !!n, s, c), g = {
|
|
34169
34227
|
name: "rag-search",
|
|
34170
|
-
description:
|
|
34171
|
-
getContent: () =>
|
|
34228
|
+
description: pV.description,
|
|
34229
|
+
getContent: () => fV(r, !!t, !!n, s, c)
|
|
34172
34230
|
};
|
|
34173
34231
|
return {
|
|
34174
34232
|
id: i,
|
|
@@ -34183,7 +34241,7 @@ function hV(e) {
|
|
|
34183
34241
|
}
|
|
34184
34242
|
//#endregion
|
|
34185
34243
|
//#region src/core/sdk/evalToolkit.ts
|
|
34186
|
-
function
|
|
34244
|
+
function _V(e = {}) {
|
|
34187
34245
|
let t = e.quietMs ?? 9e4, n = e.confirmSamples ?? 3, r = e.baselineMessageCount ?? 0, i = 0;
|
|
34188
34246
|
return {
|
|
34189
34247
|
push(e) {
|
|
@@ -34194,12 +34252,12 @@ function gV(e = {}) {
|
|
|
34194
34252
|
}
|
|
34195
34253
|
};
|
|
34196
34254
|
}
|
|
34197
|
-
var
|
|
34198
|
-
function
|
|
34255
|
+
var vV = /* @__PURE__ */ new Set(["elapsedSec"]);
|
|
34256
|
+
function yV(e, t, n = {}) {
|
|
34199
34257
|
let r = n.tokenAbs ?? 2e3, i = n.tokenPct ?? 15, a = n.toolCountAbs ?? 3, o = [], s = 0, c = 0, l = 0, u = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
|
|
34200
34258
|
for (let n of u) {
|
|
34201
34259
|
let u = Number(e?.[n] ?? 0), d = Number(t?.[n] ?? 0), f = u - d, p = d > 0 ? Math.round(f / d * 100) : 0, m = "";
|
|
34202
|
-
|
|
34260
|
+
vV.has(n) || (n === "toolCount" ? Math.abs(f) > a : Math.abs(f) > r && Math.abs(p) >= i) && (m = f > 0 ? "up" : "down", m === "up" ? (s++, c++) : l++), o.push({
|
|
34203
34261
|
key: n,
|
|
34204
34262
|
prev: d,
|
|
34205
34263
|
cur: u,
|
|
@@ -34214,7 +34272,7 @@ function vV(e, t, n = {}) {
|
|
|
34214
34272
|
fields: o
|
|
34215
34273
|
};
|
|
34216
34274
|
}
|
|
34217
|
-
function
|
|
34275
|
+
function bV(e) {
|
|
34218
34276
|
let { sdk: t } = e, n = () => {
|
|
34219
34277
|
let e = t.debugLogs.value ?? [], n = e.length ? e[e.length - 1].timestamp : 0;
|
|
34220
34278
|
return {
|
|
@@ -34227,7 +34285,7 @@ function yV(e) {
|
|
|
34227
34285
|
};
|
|
34228
34286
|
return {
|
|
34229
34287
|
async waitForIdle(e = {}) {
|
|
34230
|
-
let { timeoutMs: r = 6e5, sampleMs: i = 2500, onSample: a, ...o } = e, s =
|
|
34288
|
+
let { timeoutMs: r = 6e5, sampleMs: i = 2500, onSample: a, ...o } = e, s = _V(o), c = Date.now();
|
|
34231
34289
|
for (;;) {
|
|
34232
34290
|
let e = n(), o = s.push(e);
|
|
34233
34291
|
if (a?.(e), o === "done") return e;
|
|
@@ -34257,20 +34315,20 @@ function yV(e) {
|
|
|
34257
34315
|
}
|
|
34258
34316
|
//#endregion
|
|
34259
34317
|
//#region src/core/components/CodePreview.vue?vue&type=script&setup=true&lang.ts
|
|
34260
|
-
var
|
|
34318
|
+
var xV = { class: "code-preview-modal" }, SV = { class: "preview-header" }, CV = { class: "preview-title" }, wV = { class: "preview-tabs" }, TV = ["disabled"], EV = { class: "preview-actions" }, DV = ["title"], OV = {
|
|
34261
34319
|
key: 0,
|
|
34262
34320
|
viewBox: "0 0 16 16",
|
|
34263
34321
|
fill: "none",
|
|
34264
34322
|
"aria-hidden": "true"
|
|
34265
|
-
},
|
|
34323
|
+
}, kV = {
|
|
34266
34324
|
key: 1,
|
|
34267
34325
|
viewBox: "0 0 16 16",
|
|
34268
34326
|
fill: "none",
|
|
34269
34327
|
"aria-hidden": "true"
|
|
34270
|
-
},
|
|
34328
|
+
}, AV = ["title"], jV = ["title"], MV = { class: "preview-body" }, NV = ["srcdoc"], PV = {
|
|
34271
34329
|
key: 1,
|
|
34272
34330
|
class: "preview-source"
|
|
34273
|
-
},
|
|
34331
|
+
}, FV = /*#__PURE__*/ qk(/* @__PURE__ */ Zi({
|
|
34274
34332
|
__name: "CodePreview",
|
|
34275
34333
|
props: {
|
|
34276
34334
|
code: {},
|
|
@@ -34337,28 +34395,28 @@ app.mount('#app');
|
|
|
34337
34395
|
return (t, n) => (J(), Y("div", {
|
|
34338
34396
|
class: "code-preview-overlay",
|
|
34339
34397
|
onClick: n[3] ||= Fl((e) => r("close"), ["self"])
|
|
34340
|
-
}, [X("div",
|
|
34341
|
-
X("span",
|
|
34342
|
-
X("div",
|
|
34398
|
+
}, [X("div", xV, [X("div", SV, [
|
|
34399
|
+
X("span", CV, H(e.messages.codePreviewTitlePrefix) + H(e.lang), 1),
|
|
34400
|
+
X("div", wV, [X("button", {
|
|
34343
34401
|
class: Je({ active: a.value === "preview" }),
|
|
34344
34402
|
disabled: !s.value,
|
|
34345
34403
|
onClick: n[0] ||= (e) => a.value = "preview"
|
|
34346
|
-
}, H(e.messages.codePreviewTab), 11,
|
|
34404
|
+
}, H(e.messages.codePreviewTab), 11, TV), X("button", {
|
|
34347
34405
|
class: Je({ active: a.value === "source" }),
|
|
34348
34406
|
onClick: n[1] ||= (e) => a.value = "source"
|
|
34349
34407
|
}, H(e.messages.codeSourceTab), 3)]),
|
|
34350
|
-
X("div",
|
|
34408
|
+
X("div", EV, [
|
|
34351
34409
|
X("button", {
|
|
34352
34410
|
class: Je(["icon-btn", { done: o.value }]),
|
|
34353
34411
|
title: o.value ? e.messages.copied : e.messages.codeCopyTitle,
|
|
34354
34412
|
onClick: u
|
|
34355
|
-
}, [o.value ? (J(), Y("svg",
|
|
34413
|
+
}, [o.value ? (J(), Y("svg", OV, [...n[4] ||= [X("path", {
|
|
34356
34414
|
d: "M3 8.5l3 3 7-7",
|
|
34357
34415
|
stroke: "currentColor",
|
|
34358
34416
|
"stroke-width": "1.6",
|
|
34359
34417
|
"stroke-linecap": "round",
|
|
34360
34418
|
"stroke-linejoin": "round"
|
|
34361
|
-
}, null, -1)]])) : (J(), Y("svg",
|
|
34419
|
+
}, null, -1)]])) : (J(), Y("svg", kV, [...n[5] ||= [X("rect", {
|
|
34362
34420
|
x: "5.5",
|
|
34363
34421
|
y: "5.5",
|
|
34364
34422
|
width: "8",
|
|
@@ -34370,7 +34428,7 @@ app.mount('#app');
|
|
|
34370
34428
|
d: "M10.5 3.5v-.5A1.5 1.5 0 0 0 9 1.5H3.5A1.5 1.5 0 0 0 2 3v5.5A1.5 1.5 0 0 0 3.5 10H4",
|
|
34371
34429
|
stroke: "currentColor",
|
|
34372
34430
|
"stroke-width": "1.3"
|
|
34373
|
-
}, null, -1)]]))], 10,
|
|
34431
|
+
}, null, -1)]]))], 10, DV),
|
|
34374
34432
|
X("button", {
|
|
34375
34433
|
class: "icon-btn",
|
|
34376
34434
|
title: e.messages.codeOpenTitle,
|
|
@@ -34390,7 +34448,7 @@ app.mount('#app');
|
|
|
34390
34448
|
"stroke-width": "1.3",
|
|
34391
34449
|
"stroke-linecap": "round",
|
|
34392
34450
|
"stroke-linejoin": "round"
|
|
34393
|
-
})], -1)]], 8,
|
|
34451
|
+
})], -1)]], 8, AV),
|
|
34394
34452
|
X("button", {
|
|
34395
34453
|
class: "icon-btn",
|
|
34396
34454
|
title: e.messages.close,
|
|
@@ -34404,22 +34462,22 @@ app.mount('#app');
|
|
|
34404
34462
|
stroke: "currentColor",
|
|
34405
34463
|
"stroke-width": "1.4",
|
|
34406
34464
|
"stroke-linecap": "round"
|
|
34407
|
-
})], -1)]], 8,
|
|
34465
|
+
})], -1)]], 8, jV)
|
|
34408
34466
|
])
|
|
34409
|
-
]), X("div",
|
|
34467
|
+
]), X("div", MV, [a.value === "preview" && s.value ? (J(), Y("iframe", {
|
|
34410
34468
|
key: 0,
|
|
34411
34469
|
ref_key: "iframeRef",
|
|
34412
34470
|
ref: i,
|
|
34413
34471
|
class: "preview-iframe",
|
|
34414
34472
|
sandbox: "allow-scripts allow-modals allow-popups allow-forms",
|
|
34415
34473
|
srcdoc: c.value
|
|
34416
|
-
}, null, 8,
|
|
34474
|
+
}, null, 8, NV)) : (J(), Y("pre", PV, [X("code", null, H(e.code), 1)]))])])]));
|
|
34417
34475
|
}
|
|
34418
34476
|
}), [["__scopeId", "data-v-27eac25e"]]);
|
|
34419
34477
|
//#endregion
|
|
34420
34478
|
//#region src/core/index.ts
|
|
34421
|
-
function
|
|
34422
|
-
return JC(e,
|
|
34479
|
+
function IV(e) {
|
|
34480
|
+
return JC(e, uV);
|
|
34423
34481
|
}
|
|
34424
34482
|
//#endregion
|
|
34425
|
-
export {
|
|
34483
|
+
export { EF as ApprovalBar, hb as CAPABILITIES, vb as CONTEXT_PRESETS, lV as ChatDialog, wA as ChatHeader, yI as ChatInput, FV as CodePreview, xy as CompressDecisionSchema, UF as ConflictBar, qS as DEFAULT_COMPUTED_STYLES, iO as DEFAULT_DIALOG_ICONS, Eh as DEFAULT_PROMPT_SOFT_CAP, r_ as DEFAULT_SYSTEM_PROMPT, i_ as DEFAULT_SYSTEM_PROMPT_EN, kB as DebugDrawer, FA as FocusBar, HN as HLJS_BLOCK_MAX_CHARS, uv as HTML_VOID_TAGS, gg as HUMAN_CONFIRM_TOOL_NAME, Jk as IconGlyph, nu as ImageInputError, T as LOW_CAPS_HINT_BASELINE, sO as MESSAGES_EN_US, oO as MESSAGES_ZH_CN, S as MIN_CONTEXT_WINDOW, sd as MODEL_UNAVAILABLE_GUIDANCE, eP as MessageContent, UP as MessageList, NP as MessageRow, $P as QueuedBar, Th as SOFT_CAP_MIN_WINDOW, _h as STOP_WORDS, rV as SkillPanel, _m as UNSAFE_KEYS, yC as actionsToInspectInfo, vC as actionsToTools, Ql as agentError, Yg as analyzeContext, jm as applyPatchToClone, Pm as applyPatchToLive, Q_ as applyPatchesToBind, ES as applyProposalOps, Ip as arrayMinLength, Zl as asAgentError, ty as buildCollectorJs, QS as buildCssPath, d_ as buildDataPrompt, qv as buildDiagnosticsReport, dy as buildHtmlFragmentSkill, ny as buildSandboxSrcdoc, f_ as buildSystemPrompt, Iu as captureSelectionQuote, uO as chatContextKey, Z_ as commitSetToBind, cy as composeStructureThenRender, pu as compressImage, t_ as connectMcp, P as constructLlmFromConfig, ne as constructOpenLlmSync, rO as copyText, TS as countOccurrences, wp as createAgent, hg as createApprovalMiddleware, dO as createChatContext, IV as createChatSdk, Dg as createCheckpointManager, Og as createCheckpointMiddleware, Iy as createConflictManager, Xg as createContextInspectorMiddleware, hy as createCraftNoteCheck, lv as createDataOps, bV as createEvalHarness, py as createHtmlFormatCheck, sy as createHtmlRenderCheck, _y as createHtmlSubagent, yg as createHumanConfirmMiddleware, vg as createHumanConfirmTool, _V as createIdleDetector, ib as createMemoryBackend, cg as createMemoryMiddleware, y as createProxyLlm, gV as createRagSubagent, pd as createSandboxRunner, _b as createSdkEvents, BC as createSerialRunner, cb as createSessionStore, lb as createSessionStoreWithBackend, IC as createSkillStore, $h as createSubagentMiddleware, Nh as createSubagentTracker, ng as createSubagentsMiddleware, OC as createUsageHintsMiddleware, Ag as createVerifyMiddleware, g_ as createVfs, ob as createWebStorageBackend, Ig as createWriteBackCheck, cd as decorateModelUnavailable, Sm as deepClone, SC as defineDataToolset, qm as defineSkill, vy as defineTool, xm as deleteByPath, Sy as deriveTitle, Xp as describeSchemaNode, sp as detectGarbledToolCall, _f as detectTransitionalReply, Rm as diffObjects, yV as diffReport, rC as domInfoTool, cC as domInspectSkill, nC as domSearchTool, LS as domToStructure, KS as domTools, xC as domToolsStatic, Lp as elementSchemaCandidates, XS as ensureDomListenerRecorder, yh as estimateMessageTokens, Sh as estimateRoundTokens, O as estimateTokens, ae as extractReasoningDelta, lm as extractSchemaHint, Zg as extractText, ie as extractTextDelta, oe as extractUsage, NS as fetchDocTools, bC as fetchTools, Lm as findStrippedKeys, Zp as formatConstraints, ql as formatZodIssues, $ as getByPath, RS as getDomTool, tC as getElementInfo, dC as getEnvSummary, ZS as getRecordedListeners, ay as getSandboxLifecycle, Op as getSchemaAtPath, Tp as getSchemaTopKeys, DS as hashContent, km as hashValue, fy as htmlFragmentSkill, im as htmlOrchestratorPrompt, Ch as indexSummarize, mC as inspectEnvTool, hC as inspectTools, wy as isChatModel, ad as isContextLengthError, Ik as isIconHtml, od as isModelUnavailableError, Ep as isPathAllowed, Xy as isQuotaError, vm as isUnsafePath, Cd as jpEval, Yl as jsonParseError, Em as limitDepth, CS as lineDiff, E as lowCapsHint, JN as markedToHtml, Gv as maskUrlCredentials, wm as maybeParseValue, zv as measureWriteScale, Nm as moveByPath, M as normalizeBaseUrl, ey as normalizeRenderResult, ce as normalizeUsage, A as offloadPassThroughChars, k as offloadThresholdChars, rm as presets, Wp as projectBySchema, Up as projectBySchemaDeep, Tm as projectFields, wh as recallRounds, oy as renderInSandbox, YN as renderMarkdownHtml, Qp as renderSchemaHint, $p as renderSchemaOverview, nm as renderSchemaShallow, gb as resolveCapabilities, bb as resolveContextOptions, fb as resolveDialogConfig, aO as resolveDialogIcons, lO as resolveDialogMessages, Fy as resolveLlm, D as resolveModelCaps, Oh as resolvePromptSoftCap, Np as resolveSchemaPath, db as resolveStorage, Im as restoreInPlace, Fm as restoreLive, Xl as routeError, Dd as runSandboxedScript, ym as safeMerge, uC as safeSerialize, Dm as safeStringify, cp as sanitizeGarbledContent, Bk as sanitizeIconHtml, Uk as sanitizeMessageHtml, Fp as schemaHasRefinement, $S as searchDom, Td as searchJson, CC as selectBuiltinTools, bm as setByPath, kh as shouldTriggerCompression, Jv as stringifyDiagnosticsReport, te as stripStainlessFetch, am as systemPromptHelpers, w as tableMaxOutputTokens, vh as tokenize, Q as toolError, Dp as unwrapSchema, nO as useChat, fO as useChatContext, Pp as validateAtPath, fv as validateHtmlFormat, Y_ as validateRootValueLocally, X_ as validateWriteLocally, Am as watchFieldsHash, e as z, Jl as zodError };
|