page-agent-sdk 4.23.3 → 4.24.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.
@@ -885,7 +885,7 @@ var $t, en, tn, nn, rn, an, on, sn, cn, ln, un, dn, fn, pn, mn, hn, gn, _n, vn,
885
885
  function ar(e, t, n) {
886
886
  e.issues.length && t.issues.push(...Ve(n, e.issues));
887
887
  }
888
- var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, wr, Tr, Er, Dr, Or = s((() => {
888
+ var or, sr, cr, lr, ur, dr, fr, pr, mr, hr, gr, R, _r, vr, yr, br, xr, Sr, Cr, wr, Tr, Er, Dr, Or = s((() => {
889
889
  x(), ir(), dt(), M(), or = /*@__PURE__*/ p("$ZodCheck", (e, t) => {
890
890
  var n;
891
891
  e._zod != null || (e._zod = {}), e._zod.def = t, (n = e._zod).onattach != null || (n.onattach = []);
@@ -1032,7 +1032,7 @@ var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, w
1032
1032
  continue: !t.abort
1033
1033
  });
1034
1034
  };
1035
- }), R = /*@__PURE__*/ p("$ZodCheckMaxSize", (e, t) => {
1035
+ }), pr = /*@__PURE__*/ p("$ZodCheckMaxSize", (e, t) => {
1036
1036
  var n;
1037
1037
  or.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
1038
1038
  let t = e.value;
@@ -1053,7 +1053,7 @@ var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, w
1053
1053
  continue: !t.abort
1054
1054
  });
1055
1055
  };
1056
- }), pr = /*@__PURE__*/ p("$ZodCheckMinSize", (e, t) => {
1056
+ }), mr = /*@__PURE__*/ p("$ZodCheckMinSize", (e, t) => {
1057
1057
  var n;
1058
1058
  or.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
1059
1059
  let t = e.value;
@@ -1074,7 +1074,7 @@ var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, w
1074
1074
  continue: !t.abort
1075
1075
  });
1076
1076
  };
1077
- }), mr = /*@__PURE__*/ p("$ZodCheckSizeEquals", (e, t) => {
1077
+ }), hr = /*@__PURE__*/ p("$ZodCheckSizeEquals", (e, t) => {
1078
1078
  var n;
1079
1079
  or.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
1080
1080
  let t = e.value;
@@ -1100,7 +1100,7 @@ var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, w
1100
1100
  continue: !t.abort
1101
1101
  }));
1102
1102
  };
1103
- }), hr = /*@__PURE__*/ p("$ZodCheckMaxLength", (e, t) => {
1103
+ }), gr = /*@__PURE__*/ p("$ZodCheckMaxLength", (e, t) => {
1104
1104
  var n;
1105
1105
  or.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
1106
1106
  let t = e.value;
@@ -1123,7 +1123,7 @@ var or, sr, cr, lr, ur, dr, fr, R, pr, mr, hr, gr, _r, vr, yr, br, xr, Sr, Cr, w
1123
1123
  continue: !t.abort
1124
1124
  });
1125
1125
  };
1126
- }), gr = /*@__PURE__*/ p("$ZodCheckMinLength", (e, t) => {
1126
+ }), R = /*@__PURE__*/ p("$ZodCheckMinLength", (e, t) => {
1127
1127
  var n;
1128
1128
  or.init(e, t), (n = e._zod.def).when != null || (n.when = (e) => {
1129
1129
  let t = e.value;
@@ -8445,23 +8445,23 @@ function Fs(e, t) {
8445
8445
  }
8446
8446
  // @__NO_SIDE_EFFECTS__
8447
8447
  function Is(e, t) {
8448
- return new R(j(j({ check: "max_size" }, L(t)), {}, { maximum: e }));
8448
+ return new pr(j(j({ check: "max_size" }, L(t)), {}, { maximum: e }));
8449
8449
  }
8450
8450
  // @__NO_SIDE_EFFECTS__
8451
8451
  function Ls(e, t) {
8452
- return new pr(j(j({ check: "min_size" }, L(t)), {}, { minimum: e }));
8452
+ return new mr(j(j({ check: "min_size" }, L(t)), {}, { minimum: e }));
8453
8453
  }
8454
8454
  // @__NO_SIDE_EFFECTS__
8455
8455
  function Rs(e, t) {
8456
- return new mr(j(j({ check: "size_equals" }, L(t)), {}, { size: e }));
8456
+ return new hr(j(j({ check: "size_equals" }, L(t)), {}, { size: e }));
8457
8457
  }
8458
8458
  // @__NO_SIDE_EFFECTS__
8459
8459
  function zs(e, t) {
8460
- return new hr(j(j({ check: "max_length" }, L(t)), {}, { maximum: e }));
8460
+ return new gr(j(j({ check: "max_length" }, L(t)), {}, { maximum: e }));
8461
8461
  }
8462
8462
  // @__NO_SIDE_EFFECTS__
8463
8463
  function Bs(e, t) {
8464
- return new gr(j(j({ check: "min_length" }, L(t)), {}, { minimum: e }));
8464
+ return new R(j(j({ check: "min_length" }, L(t)), {}, { minimum: e }));
8465
8465
  }
8466
8466
  // @__NO_SIDE_EFFECTS__
8467
8467
  function Vs(e, t) {
@@ -9418,17 +9418,17 @@ var Ine, pc, mc, hc, gc, _c, vc, yc, bc, xc, Sc, Cc, wc, Tc, Ec, Dc, Oc, kc, Ac,
9418
9418
  $ZodCheckLengthEquals: () => _r,
9419
9419
  $ZodCheckLessThan: () => cr,
9420
9420
  $ZodCheckLowerCase: () => br,
9421
- $ZodCheckMaxLength: () => hr,
9422
- $ZodCheckMaxSize: () => R,
9421
+ $ZodCheckMaxLength: () => gr,
9422
+ $ZodCheckMaxSize: () => pr,
9423
9423
  $ZodCheckMimeType: () => Er,
9424
- $ZodCheckMinLength: () => gr,
9425
- $ZodCheckMinSize: () => pr,
9424
+ $ZodCheckMinLength: () => R,
9425
+ $ZodCheckMinSize: () => mr,
9426
9426
  $ZodCheckMultipleOf: () => ur,
9427
9427
  $ZodCheckNumberFormat: () => dr,
9428
9428
  $ZodCheckOverwrite: () => Dr,
9429
9429
  $ZodCheckProperty: () => Tr,
9430
9430
  $ZodCheckRegex: () => yr,
9431
- $ZodCheckSizeEquals: () => mr,
9431
+ $ZodCheckSizeEquals: () => hr,
9432
9432
  $ZodCheckStartsWith: () => Cr,
9433
9433
  $ZodCheckStringFormat: () => vr,
9434
9434
  $ZodCheckUpperCase: () => xr,
@@ -57619,6 +57619,36 @@ var d$ = {
57619
57619
  "5. Prefer incremental write patches (send only the change, e.g. write({ value, patch:{ op, jsonPath } })) over resending the whole large JSON, which risks truncation;",
57620
57620
  "6. If a write hits an optimistic-lock conflict (VERSION_CONFLICT returned, or the tool suspends awaiting the user decision): after the tool returns, follow its instruction (keep external → re-read then edit; overwritten/restored → continue from the result); do not abandon the task."
57621
57621
  ].join("\n"),
57622
+ answerLanes: [
57623
+ "【作答车道:先判问题形态,再选纪律】",
57624
+ "用户的问题分三类,判错车道是最大的答非所问:",
57625
+ "A. 问页面内容(「这页写了什么 / 哪里提到 / 原文是什么 / 这段在说什么」)",
57626
+ " → 以页面实料为准并点明出处;页面内容与你的先验知识冲突时以页面为准;页面没写就说没写,一句话即可,不列举查过哪些节。",
57627
+ "B. 问概念术语(「X 是什么 / 啥意思 / X 和 Y 什么区别」)",
57628
+ " → 页面有语境就先按页面语境讲;页面没有也必须直接用自己的知识解释,",
57629
+ " 开头一句「本页未提及,以下是通用解释:」即可 —— 不许把「页面上没有」当答案。",
57630
+ "C. 求观点经验(「你觉得呢 / 按你的经验 / 是不是很难 / 该怎么选」)",
57631
+ " → 直接给判断和理由;笔记口径与个人观点分开说(「本页的立场是…;我的看法是…」)。",
57632
+ " 页面没写不构成不答的理由。",
57633
+ "",
57634
+ "出处密度:只有「对页面内容的断言」才标出处(句末括注即可);概念解释、个人观点、",
57635
+ "过渡句一律不标。「没找到」的说明压成一句,不报检索过程。"
57636
+ ].join("\n"),
57637
+ answerLanesEn: [
57638
+ "[Answer lanes: classify the question first, then pick the discipline]",
57639
+ "User questions fall into three categories; picking the wrong lane is the biggest way to miss the point:",
57640
+ "A. Asking about page content (\"what does this page say / where is it mentioned / what is the original text / what does this passage mean\")",
57641
+ " → Ground answers in what the page actually says and cite where it came from; when the page conflicts with your prior knowledge, the page wins; if the page does not say it, say so in one sentence — do not enumerate which sections you searched.",
57642
+ "B. Asking about a concept or term (\"what is X / what does it mean / how do X and Y differ\")",
57643
+ " → If the page has context for it, explain in that context first; if the page does not, you MUST still explain it directly from your own knowledge,",
57644
+ " opening with one line like \"Not covered on this page — general explanation:\" — never treat \"it is not on the page\" as the answer.",
57645
+ "C. Asking for your opinion or experience (\"what do you think / in your experience / is it hard to match / which should I choose\")",
57646
+ " → Give your judgment and reasoning directly; keep the notes' stance and your own view separate (\"this page's position is ...; my take is ...\").",
57647
+ " The page not covering it is never a reason to refuse.",
57648
+ "",
57649
+ "Citation density: only claims about page content get a citation (a short parenthetical); concept explanations,",
57650
+ "personal opinions, and transitions get none. Compress \"not found\" statements to one sentence; never narrate the search process."
57651
+ ].join("\n"),
57622
57652
  htmlPageOrchestrator: u$("html"),
57623
57653
  htmlPageProposeFirst: ["【新建/创意类请求】先用简短文字给出 2~3 套方案(每套一两句风格/配色/结构要点),询问用户选哪套;选定前不要委派生成代码、不要写 components。", "【方案切换】已生成某套方案后改选另一套:不重新罗列,直接依据之前描述重新委派生成并覆盖相应组件(委派工具见编排段 use_<id>)。"].join("\n"),
57624
57654
  htmlDirectWriteFallback: [
@@ -67893,14 +67923,14 @@ var IAe = [
67893
67923
  "你是一个页面内容助手,帮助用户理解、查找与排查其当前所在的网页。",
67894
67924
  "你可以经专用工具探查页面:read_page 读页面正文(长文按 hasMore 分页续读)、get_dom 读渲染后结构、dom_search / dom_info 定位元素与查属性" + (e ? "、take_screenshot 截图查看实际渲染效果(视觉问题优先截图,结构推断不能代替)" : "") + ";一切以工具读到的页面实料为准。",
67895
67925
  "用户消息可能带 [引用原文] 块(其在页面上选中的文字):优先围绕引用内容作答,需要更多上下文再向外探索(所在小节 → 整页)。",
67896
- "回答纪律:答案须来自你实际读到的页面内容并点明出处;页面内容与你的先验知识冲突时以页面为准;页面没写的不要编造,本页找不到的如实说明。",
67926
+ d$.answerLanes,
67897
67927
  "输出从简:直接说内容,不写过程 —— 不要「我先读一下页面」这类旁白、不要「先给结论/依据是」这类包装、不要解释结论是怎么推出来的、不要「下面分三点/综上」这类套话;出处用句末括注(如「(§小节名)」)带过即可。",
67898
67928
  RAe
67899
67929
  ].join("\n"), VAe = (e) => [
67900
67930
  "You are a page content assistant that helps users understand, locate, and troubleshoot the web page they are on.",
67901
67931
  "You can inspect the page through dedicated tools: read_page for page text (paginate via hasMore on long documents), get_dom for the rendered structure, dom_search / dom_info to locate elements and read attributes" + (e ? ", and take_screenshot to see the actual rendered appearance (prefer a screenshot for visual questions; structural inference is no substitute)" : "") + "; the page as read by tools is the source of truth.",
67902
67932
  "User messages may carry a [quoted text] block (text they selected on the page): answer around the quote first, then explore outward (its section → the whole page) if more context is needed.",
67903
- "Answer discipline: answers must come from the page content you actually read, citing where it came from; when the page conflicts with your prior knowledge, the page wins; never invent what the page does not say, and state honestly when something cannot be found on this page.",
67933
+ d$.answerLanesEn,
67904
67934
  "Be terse: state the content directly, never narrate process — no \"let me first read the page\" asides, no \"in summary / the evidence is\" packaging, no explaining how you derived the conclusion, no \"here are three points\" preambles; cite sources inline as a short parenthetical such as \"(§ section name)\".",
67905
67935
  zAe,
67906
67936
  "Respond in English."
@@ -75418,19 +75448,19 @@ function $Fe(e, t, n, r, i) {
75418
75448
  });
75419
75449
  }
75420
75450
  function eIe(e, t, n) {
75421
- var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, M, ee, te, P, ne, re, ie, ae, oe, se, ce, F, le, ue, I, de, fe, pe;
75422
- let me = {
75451
+ var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, M, ee, te, P, ne, re, ie, ae, oe, se, ce, F, le, ue, I, de, fe, pe, me, he;
75452
+ let ge = {
75423
75453
  prompt_tokens: 0,
75424
75454
  completion_tokens: 0,
75425
75455
  total_tokens: 0
75426
- }, he = jMe(() => Jn, () => {
75456
+ }, _e = jMe(() => Qn, () => {
75427
75457
  var t;
75428
75458
  return (t = e.conflictPolicy) == null ? "ask" : t;
75429
75459
  }, () => {
75430
75460
  var e;
75431
75461
  return (e = R.agent) == null || (e = e.debugLogs) == null ? void 0 : e.value;
75432
- }), ge = /* @__PURE__ */ Iq(0), _e = XMe(e.storage);
75433
- _e && (e.debug && _e.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), _e.onEvent((e) => {
75462
+ }), ve = /* @__PURE__ */ Iq(0), ye = XMe(e.storage);
75463
+ ye && (e.debug && ye.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), ye.onEvent((e) => {
75434
75464
  if (e.type === "quota") {
75435
75465
  var t;
75436
75466
  (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
@@ -75444,22 +75474,22 @@ function eIe(e, t, n) {
75444
75474
  });
75445
75475
  }
75446
75476
  }));
75447
- let { modelCaps: ve, summaryLlmInvoke: ye, titleLlmInvoke: be, compressDecisionInvoke: xe } = AMe(e), Se = ve;
75448
- if (e.debug && console.log("[page-agent-sdk][modelCaps]", Se), Se.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${Se.contextWindow} 小于最小支持 ${eF}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
75477
+ let { modelCaps: be, summaryLlmInvoke: xe, titleLlmInvoke: Se, compressDecisionInvoke: Ce } = AMe(e), we = be;
75478
+ if (e.debug && console.log("[page-agent-sdk][modelCaps]", we), we.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${we.contextWindow} 小于最小支持 ${eF}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
75449
75479
  {
75450
- var Ce, we, Te, Ee, De, Oe;
75451
- let t = e.llm, n = Q6(t) ? (Ce = (we = t.model) == null ? t.modelName : we) == null ? "" : Ce : (Te = t.model) == null ? "" : Te, r = Q6(t) ? (Ee = t.maxTokens) == null ? Se.maxOutputTokens : Ee : (De = (Oe = t.maxTokens) == null ? nF(t.model) : Oe) == null ? Se.maxOutputTokens : De, i = iF(n || void 0, Se, r);
75480
+ var Te, Ee, De, Oe, L, ke;
75481
+ let t = e.llm, n = Q6(t) ? (Te = (Ee = t.model) == null ? t.modelName : Ee) == null ? "" : Te : (De = t.model) == null ? "" : De, r = Q6(t) ? (Oe = t.maxTokens) == null ? we.maxOutputTokens : Oe : (L = (ke = t.maxTokens) == null ? nF(t.model) : ke) == null ? we.maxOutputTokens : L, i = iF(n || void 0, we, r);
75452
75482
  i && console.warn(i);
75453
75483
  }
75454
- let L = f8(e, Se.contextWindow), ke = L.enableLLMSummary !== !1, Ae = (r = e.contextOptions && e.contextOptions.preserveLastToolResults) == null ? nNe[(i = e.contextPreset) == null ? "auto" : i] : r, je = new Set(Ae), Me = e.llm;
75455
- e.debug && !ye && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
75456
- let Ne = /* @__PURE__ */ Tq([]), Pe = YAe((a = e.vfs) == null ? void 0 : a.initialFiles, {
75457
- persist: _e ? { save: (e) => {
75458
- yr.persistSave({ vfs: e });
75484
+ let Ae = f8(e, we.contextWindow), je = Ae.enableLLMSummary !== !1, Me = (r = e.contextOptions && e.contextOptions.preserveLastToolResults) == null ? nNe[(i = e.contextPreset) == null ? "auto" : i] : r, Ne = new Set(Me), Pe = e.llm;
75485
+ e.debug && !xe && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
75486
+ let Fe = /* @__PURE__ */ Tq([]), Ie = YAe((a = e.vfs) == null ? void 0 : a.initialFiles, {
75487
+ persist: ye ? { save: (e) => {
75488
+ Cr.persistSave({ vfs: e });
75459
75489
  } } : void 0,
75460
75490
  maxBytes: (o = e.vfs) == null ? void 0 : o.maxBytes,
75461
75491
  poolBytes: (s = e.vfs) == null ? void 0 : s.poolBytes
75462
- }), Fe = CQ([], { maxPlanRevisions: e.maxPlanRevisions }), Ie = yTe(), Le = Rwe((e) => {
75492
+ }), Le = CQ([], { maxPlanRevisions: e.maxPlanRevisions }), Re = yTe(), ze = Rwe((e) => {
75463
75493
  var t;
75464
75494
  (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
75465
75495
  timestamp: Date.now(),
@@ -75469,24 +75499,24 @@ function eIe(e, t, n) {
75469
75499
  preview: e
75470
75500
  }
75471
75501
  });
75472
- }), Re = xTe(() => {
75502
+ }), Be = xTe(() => {
75473
75503
  var e;
75474
75504
  (e = R.agent) == null || (e = e.debugLogs) == null || (e = e.value) == null || e.push({
75475
75505
  timestamp: Date.now(),
75476
75506
  type: "middleware",
75477
75507
  data: { stage: "resume_notice" }
75478
75508
  });
75479
- }), ze = aNe(), Be = (c = e.approval) == null ? void 0 : c.timeoutMs, Ve = Be !== void 0 && Number.isFinite(Be) && Be > 0 ? Be : Be !== void 0 && (!Number.isFinite(Be) || Be < 0) ? 0 : 3e4, He = (e) => {
75480
- Jn({
75509
+ }), Ve = aNe(), He = (c = e.approval) == null ? void 0 : c.timeoutMs, Ue = He !== void 0 && Number.isFinite(He) && He > 0 ? He : He !== void 0 && (!Number.isFinite(He) || He < 0) ? 0 : 3e4, We = (e) => {
75510
+ Qn({
75481
75511
  type: "error",
75482
75512
  message: `确认请求(${e.toolName})${Math.round(e.waitedMs / 1e3)}s 无响应已自动拒绝 —— 当前路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
75483
75513
  severity: "observable",
75484
75514
  code: "APPROVAL_AUTO_REJECTED",
75485
75515
  context: e
75486
75516
  });
75487
- }, Ue = S1((e) => {
75517
+ }, Ge = S1((e) => {
75488
75518
  var t;
75489
- ze.lastPlanConfirmation = e, yr.persistSave({ planConfirmation: e }), (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
75519
+ Ve.lastPlanConfirmation = e, Cr.persistSave({ planConfirmation: e }), (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
75490
75520
  timestamp: Date.now(),
75491
75521
  type: "middleware",
75492
75522
  data: {
@@ -75496,97 +75526,97 @@ function eIe(e, t, n) {
75496
75526
  }
75497
75527
  });
75498
75528
  }, {
75499
- timeoutMs: Ve,
75500
- onAutoReject: He
75501
- }), We = z$({
75529
+ timeoutMs: Ue,
75530
+ onAutoReject: We
75531
+ }), Ke = z$({
75502
75532
  getSchema: () => {
75503
75533
  var e;
75504
- return (e = St()) == null ? void 0 : e.schema;
75534
+ return (e = wt()) == null ? void 0 : e.schema;
75505
75535
  },
75506
75536
  getBind: () => {
75507
75537
  var e;
75508
- return (e = St()) == null ? void 0 : e.bind;
75538
+ return (e = wt()) == null ? void 0 : e.bind;
75509
75539
  },
75510
- onChange: (e) => Jn({
75540
+ onChange: (e) => Qn({
75511
75541
  type: "focus_change",
75512
75542
  focuses: e
75513
75543
  })
75514
- }), Ge = (e) => {
75544
+ }), qe = (e) => {
75515
75545
  var t;
75516
- let n = TTe((t = St()) == null ? void 0 : t.bind, e.path);
75546
+ let n = TTe((t = wt()) == null ? void 0 : t.bind, e.path);
75517
75547
  return n ? j(j({}, e), {}, { pgId: n }) : e;
75518
- }, Ke = lEe(), qe = v1(e.memory || "");
75519
- typeof e.memory == "function" && qe.refresh();
75520
- let Je = { current: null }, Ye = e.data ? j(j({}, e.data), {}, { description: (l = e.data.description) == null ? "主数据对象" : l }) : void 0, Xe = !((u = e.subagents) == null ? [] : u).some((e) => e._codeAsset) && d8(e.capabilities).subagent, Ze = e.subagents;
75521
- if (Xe && Ye != null && Ye.schema && e$(Ye.schema).length) {
75522
- var Qe;
75523
- Ze = [...(Qe = e.subagents) == null ? [] : Qe, hMe()], console.info("[page-agent-sdk] 检测到 schema 含代码组件数组(如 components[].code),已自动装配 HTML 代码子 agent(委派编排 + vfs 工作副本 + 格式校验 + 增量 commit)。需定制(codeField/formatCheck/craftNotes 等)请显式传 createHtmlSubagent(...)");
75524
- }
75525
- let $e = ((d = Ze) == null ? [] : d).filter((e) => !!e._codeAsset), et = /* @__PURE__ */ new Set();
75526
- for (let e of $e) {
75548
+ }, Je = lEe(), Ye = v1(e.memory || "");
75549
+ typeof e.memory == "function" && Ye.refresh();
75550
+ let Xe = { current: null }, Ze = e.data ? j(j({}, e.data), {}, { description: (l = e.data.description) == null ? "主数据对象" : l }) : void 0, Qe = !((u = e.subagents) == null ? [] : u).some((e) => e._codeAsset) && d8(e.capabilities).subagent, $e = e.subagents;
75551
+ if (Qe && Ze != null && Ze.schema && e$(Ze.schema).length) {
75552
+ var et;
75553
+ $e = [...(et = e.subagents) == null ? [] : et, hMe()], console.info("[page-agent-sdk] 检测到 schema 含代码组件数组(如 components[].code),已自动装配 HTML 代码子 agent(委派编排 + vfs 工作副本 + 格式校验 + 增量 commit)。需定制(codeField/formatCheck/craftNotes 等)请显式传 createHtmlSubagent(...)");
75554
+ }
75555
+ let tt = ((d = $e) == null ? [] : d).filter((e) => !!e._codeAsset), nt = /* @__PURE__ */ new Set();
75556
+ for (let e of tt) {
75527
75557
  if (e._codeAsset.writablePaths.length) continue;
75528
- let t = e$(Ye == null ? void 0 : Ye.schema, e._codeAsset.codeField);
75558
+ let t = e$(Ze == null ? void 0 : Ze.schema, e._codeAsset.codeField);
75529
75559
  if (t.length) {
75530
- var tt;
75531
- e._codeAsset.writablePaths = t, Array.isArray(e.writablePaths) && (e.writablePaths = t), (tt = e._rebuildCodeAssetPaths) == null || tt.call(e, t[0]), console.info(`[page-agent-sdk][createHtmlSubagent] 未传 writablePaths,已从 schema 推断: [${t.map((e) => `'${e}'`).join(", ")}]`);
75532
- } else console.warn("[page-agent-sdk][createHtmlSubagent] 未能从 schema 推断 writablePaths(开放 schema(z.any()/z.record())/嵌套容器(如 sections[].children[])/点路径 codeField(如 props.html_code)不支持自动推断),已跳过该 html 子 agent(整体不受影响);如确需代码资产机制(vfs + 格式校验 + 增量 commit),请显式传 writablePaths(代码组件 data 区,如 ['components'])"), et.add(e);
75560
+ var rt;
75561
+ e._codeAsset.writablePaths = t, Array.isArray(e.writablePaths) && (e.writablePaths = t), (rt = e._rebuildCodeAssetPaths) == null || rt.call(e, t[0]), console.info(`[page-agent-sdk][createHtmlSubagent] 未传 writablePaths,已从 schema 推断: [${t.map((e) => `'${e}'`).join(", ")}]`);
75562
+ } else console.warn("[page-agent-sdk][createHtmlSubagent] 未能从 schema 推断 writablePaths(开放 schema(z.any()/z.record())/嵌套容器(如 sections[].children[])/点路径 codeField(如 props.html_code)不支持自动推断),已跳过该 html 子 agent(整体不受影响);如确需代码资产机制(vfs + 格式校验 + 增量 commit),请显式传 writablePaths(代码组件 data 区,如 ['components'])"), nt.add(e);
75533
75563
  }
75534
- let nt = et.size ? $e.filter((e) => !et.has(e)) : $e, rt = et.size ? ((f = Ze) == null ? [] : f).filter((e) => !et.has(e)) : Ze, it = nt.length > 0, at = nt.flatMap((e) => e._codeAsset.writablePaths), ot = nt.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), st = e.checkpoint, ct = st !== void 0 && st !== !1, lt = ct ? D1({
75564
+ let it = nt.size ? tt.filter((e) => !nt.has(e)) : tt, at = nt.size ? ((f = $e) == null ? [] : f).filter((e) => !nt.has(e)) : $e, ot = it.length > 0, st = it.flatMap((e) => e._codeAsset.writablePaths), ct = it.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), lt = e.checkpoint, ut = lt !== void 0 && lt !== !1, dt = ut ? D1({
75535
75565
  getData: () => {
75536
75566
  var e;
75537
- return (e = St()) == null ? void 0 : e.bind;
75567
+ return (e = wt()) == null ? void 0 : e.bind;
75538
75568
  },
75539
75569
  consumeDataDirty: () => {
75540
75570
  var e, t;
75541
- return (e = yt == null || (t = yt.consumeDataDirty) == null ? void 0 : t.call(yt)) == null || e;
75571
+ return (e = xt == null || (t = xt.consumeDataDirty) == null ? void 0 : t.call(xt)) == null || e;
75542
75572
  },
75543
- slotPaths: Ye ? [""] : [],
75544
- vfsStore: Pe,
75545
- todosMw: Fe,
75573
+ slotPaths: Ze ? [""] : [],
75574
+ vfsStore: Ie,
75575
+ todosMw: Le,
75546
75576
  getTodos: () => {
75547
75577
  var e, t, n;
75548
- return (e = (t = Je.current) == null || (n = t.getState) == null || (n = n.call(t)) == null ? void 0 : n.todos) == null ? [] : e;
75578
+ return (e = (t = Xe.current) == null || (n = t.getState) == null || (n = n.call(t)) == null ? void 0 : n.todos) == null ? [] : e;
75549
75579
  },
75550
- messages: Ne,
75551
- maxCheckpoints: st && typeof st == "object" ? st.maxCheckpoints : void 0
75552
- }) : null, ut = !st || typeof st != "object" || st.auto !== !1, dt = d8(e.capabilities), ft = dt.dataOps, pt = dt.draftWrite, mt = dt.automation, ht = dt.domInspect && (Se.vision === !0 || typeof ((p = e.images) == null ? void 0 : p.describe) == "function"), gt = WAe(j(j({}, e), {}, {
75580
+ messages: Fe,
75581
+ maxCheckpoints: lt && typeof lt == "object" ? lt.maxCheckpoints : void 0
75582
+ }) : null, ft = !lt || typeof lt != "object" || lt.auto !== !1, pt = d8(e.capabilities), mt = pt.dataOps, ht = pt.draftWrite, gt = pt.automation, _t = pt.domInspect && (we.vision === !0 || typeof ((p = e.images) == null ? void 0 : p.describe) == "function"), vt = WAe(j(j({}, e), {}, {
75553
75583
  locale: (m = e.i18n) == null ? void 0 : m.locale,
75554
- dataOps: ft && !!Ye,
75555
- domInspect: dt.domInspect === !0,
75556
- screenshot: ht
75584
+ dataOps: mt && !!Ze,
75585
+ domInspect: pt.domInspect === !0,
75586
+ screenshot: _t
75557
75587
  }));
75558
- if (it) {
75559
- let e = nt.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
75560
- e && (gt += "\n\n" + e);
75561
- } else Ye != null && Ye.schema && oTe(Ye.schema) && (gt += "\n\n" + d$.htmlDirectWriteFallback, console.warn("[page-agent-sdk] 检测到 schema 含 code 字段但未注册 html 子 agent:已自动注入「主 agent 自己写 HTML」编排(code 作普通字段直接 write,无 vfs 工作副本 / 无格式校验门禁)。如需代码资产机制(vfs + 格式校验 + 增量 commit + 主上下文 code 摘要),注册 createHtmlSubagent;若确为降级意图可忽略。"));
75562
- let _t = ft && Ye ? P6(Ye, j(j({
75588
+ if (ot) {
75589
+ let e = it.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
75590
+ e && (vt += "\n\n" + e);
75591
+ } else Ze != null && Ze.schema && oTe(Ze.schema) && (vt += "\n\n" + d$.htmlDirectWriteFallback, console.warn("[page-agent-sdk] 检测到 schema 含 code 字段但未注册 html 子 agent:已自动注入「主 agent 自己写 HTML」编排(code 作普通字段直接 write,无 vfs 工作副本 / 无格式校验门禁)。如需代码资产机制(vfs + 格式校验 + 增量 commit + 主上下文 code 摘要),注册 createHtmlSubagent;若确为降级意图可忽略。"));
75592
+ let yt = mt && Ze ? P6(Ze, j(j({
75563
75593
  onAudit: (h = e.onAudit) == null ? e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0 : h,
75564
75594
  maxSnapshots: e.maxSnapshots,
75565
- onConflict: he.set,
75595
+ onConflict: _e.set,
75566
75596
  conflictWatchFields: e.conflictWatchFields,
75567
75597
  maxParallelTools: e.maxParallelTools,
75568
- vfsStore: pt || !(Ye == null || (g = Ye.resources) == null) && g.length ? Pe : void 0
75569
- }, at.length ? { pgIdPaths: at } : {}), ot.length ? { largeTextPaths: ot } : {})) : [], vt = ft ? _t : [], yt = ft && Ye ? (_ = _t.controller) == null ? null : _ : null, bt = ft && Ye ? _t.previewWrite : void 0, xt = ft && !(Ye == null || (v = Ye.resources) == null) && v.length && yt != null && yt.getResourcesSnapshot ? BFe({ getResourcesSnapshot: () => {
75598
+ vfsStore: ht || !(Ze == null || (g = Ze.resources) == null) && g.length ? Ie : void 0
75599
+ }, st.length ? { pgIdPaths: st } : {}), ct.length ? { largeTextPaths: ct } : {})) : [], bt = mt ? yt : [], xt = mt && Ze ? (_ = yt.controller) == null ? null : _ : null, St = mt && Ze ? yt.previewWrite : void 0, Ct = mt && !(Ze == null || (v = Ze.resources) == null) && v.length && xt != null && xt.getResourcesSnapshot ? BFe({ getResourcesSnapshot: () => {
75570
75600
  var e, t;
75571
- return (e = yt == null || (t = yt.getResourcesSnapshot) == null ? void 0 : t.call(yt)) == null ? [] : e;
75572
- } }) : void 0, St = () => {
75601
+ return (e = xt == null || (t = xt.getResourcesSnapshot) == null ? void 0 : t.call(xt)) == null ? [] : e;
75602
+ } }) : void 0, wt = () => {
75573
75603
  var e;
75574
- return (e = yt == null ? void 0 : yt.get()) == null ? Ye : e;
75575
- }, Ct = new Set(_t.map((e) => e.name)), wt = (y = e.conflictWatchFields) == null ? [] : y, Tt = !wt.includes("*") && wt.length ? new Set(wt) : void 0, Et = yt ? qje({
75604
+ return (e = xt == null ? void 0 : xt.get()) == null ? Ze : e;
75605
+ }, Tt = new Set(yt.map((e) => e.name)), Et = (y = e.conflictWatchFields) == null ? [] : y, Dt = !Et.includes("*") && Et.length ? new Set(Et) : void 0, Ot = xt ? qje({
75576
75606
  getBind: () => {
75577
75607
  var e;
75578
- return (e = St()) == null ? void 0 : e.bind;
75608
+ return (e = wt()) == null ? void 0 : e.bind;
75579
75609
  },
75580
75610
  recomputeAll: () => {
75581
75611
  var e;
75582
- return (e = yt.recomputeAllBaselines) == null ? void 0 : e.call(yt);
75612
+ return (e = xt.recomputeAllBaselines) == null ? void 0 : e.call(xt);
75583
75613
  },
75584
75614
  hasBaselines: () => {
75585
75615
  var e, t;
75586
- return (e = (t = yt.hasBaselines) == null ? void 0 : t.call(yt)) != null && e;
75616
+ return (e = (t = xt.hasBaselines) == null ? void 0 : t.call(xt)) != null && e;
75587
75617
  },
75588
- isManaged: (e) => Ct.has(e),
75589
- hash: (e) => Tt ? D$(C1(e), Tt) : E$(C1(e)),
75618
+ isManaged: (e) => Tt.has(e),
75619
+ hash: (e) => Dt ? D$(C1(e), Dt) : E$(C1(e)),
75590
75620
  log: (e, t) => {
75591
75621
  var n;
75592
75622
  let r = (n = R.agent) == null ? void 0 : n.debugLogs;
@@ -75596,34 +75626,34 @@ function eIe(e, t, n) {
75596
75626
  data: j({ stage: "baseline_guard" }, t)
75597
75627
  }), zq(r));
75598
75628
  }
75599
- }) : void 0, Dt = /* @__PURE__ */ new Map();
75600
- dt.domInspect && !ht && console.warn("[page-agent-sdk][take_screenshot] domInspect 已开启但主模型不支持图片(vision=false)且未配 images.describe,截图工具未装载(视觉验证退回 get_dom/dom_info 结构推断;换多模态模型 / llm.vision:true / 配 images.describe 后重建 SDK 生效)");
75601
- let Ot = [], kt = (e) => {
75629
+ }) : void 0, kt = /* @__PURE__ */ new Map();
75630
+ pt.domInspect && !_t && console.warn("[page-agent-sdk][take_screenshot] domInspect 已开启但主模型不支持图片(vision=false)且未配 images.describe,截图工具未装载(视觉验证退回 get_dom/dom_info 结构推断;换多模态模型 / llm.vision:true / 配 images.describe 后重建 SDK 生效)");
75631
+ let At = [], jt = (e) => {
75602
75632
  if (e.type === "tool_result" && e.name === "take_screenshot") {
75603
- let t = Ot.find((e) => !e.eventConsumed);
75633
+ let t = At.find((e) => !e.eventConsumed);
75604
75634
  if (t) return t.eventConsumed = !0, Object.assign(e, { image: {
75605
75635
  dataUri: t.image.dataUri,
75606
75636
  vfsRef: t.meta.vfsRef
75607
75637
  } });
75608
75638
  }
75609
75639
  return e;
75610
- }, At = Se.vision === !0 || typeof ((b = e.images) == null ? void 0 : b.describe) == "function" ? DPe({
75611
- getVision: () => Se.vision === !0,
75640
+ }, Mt = we.vision === !0 || typeof ((b = e.images) == null ? void 0 : b.describe) == "function" ? DPe({
75641
+ getVision: () => we.vision === !0,
75612
75642
  describe: (x = e.images) == null ? void 0 : x.describe,
75613
75643
  onShot: (e, t) => {
75614
- Ot.push({
75644
+ At.push({
75615
75645
  image: e,
75616
75646
  meta: t
75617
75647
  });
75618
75648
  }
75619
- }) : void 0, jt = ht ? TPe({
75649
+ }) : void 0, Nt = _t ? TPe({
75620
75650
  render: (S = e.screenshot) == null ? void 0 : S.renderer,
75621
75651
  getActiveFocus: () => R.getFocus(),
75622
75652
  focusSelector: (C = e.screenshot) == null ? void 0 : C.focusSelector,
75623
75653
  stow: (e) => {
75624
75654
  if (e.dataUri) try {
75625
75655
  let t = `userImages/${e.id}`;
75626
- return Pe.files[t] = {
75656
+ return Ie.files[t] = {
75627
75657
  content: e.dataUri,
75628
75658
  updatedAt: Date.now()
75629
75659
  }, t;
@@ -75631,30 +75661,30 @@ function eIe(e, t, n) {
75631
75661
  return;
75632
75662
  }
75633
75663
  },
75634
- getVision: () => Se.vision === !0,
75664
+ getVision: () => we.vision === !0,
75635
75665
  describe: (w = e.images) == null ? void 0 : w.describe,
75636
75666
  onShot: (e, t) => {
75637
- Ot.push({
75667
+ At.push({
75638
75668
  image: e,
75639
75669
  meta: t
75640
75670
  });
75641
75671
  }
75642
- }) : void 0, Mt = !Q6(e.llm) && ((T = e.llm.provider) == null ? "openai" : T) === "anthropic" ? "anthropic" : "openai", Nt = jt || At ? {
75672
+ }) : void 0, Pt = !Q6(e.llm) && ((T = e.llm.provider) == null ? "openai" : T) === "anthropic" ? "anthropic" : "openai", Ft = Nt || Mt ? {
75643
75673
  name: "screenshotChannel",
75644
75674
  wrapModelCall: async (e, t) => {
75645
- if (Ot.length) {
75646
- let t = Ot.splice(0), n = wZ(t.map((e, t) => {
75675
+ if (At.length) {
75676
+ let t = At.splice(0), n = wZ(t.map((e, t) => {
75647
75677
  var n;
75648
75678
  return e.meta.mode === "url" ? `[图片 ${t + 1}] 原图直投 ${(n = e.image.url) == null ? "" : n}(view_image,全分辨率非渲染态)` : `[截图 ${t + 1}] ${e.meta.mode}${e.meta.selector ? ` selector="${e.meta.selector}"` : ""}${e.meta.vfsRef ? `(原图 vfs:${e.meta.vfsRef})` : ""}`;
75649
75679
  }).join("\n") + "\n(视觉内容如上,请结合图片回答/继续)", t.map((e) => ({
75650
75680
  dataUri: e.image.dataUri,
75651
75681
  url: e.image.url
75652
- })), Mt);
75682
+ })), Pt);
75653
75683
  n && e.messages.push(new Hy({ content: n }));
75654
75684
  }
75655
75685
  return t(e);
75656
75686
  }
75657
- } : null, Pt = !1, Ft = dt.domEdit ? zPe({
75687
+ } : null, It = !1, Lt = pt.domEdit ? zPe({
75658
75688
  onEdit: (e) => {
75659
75689
  var t;
75660
75690
  (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
@@ -75666,22 +75696,22 @@ function eIe(e, t, n) {
75666
75696
  applied: e.applied,
75667
75697
  dryRun: e.dryRun
75668
75698
  }
75669
- }), !e.dryRun && e.applied > 0 && (Pt = !0);
75699
+ }), !e.dryRun && e.applied > 0 && (It = !0);
75670
75700
  },
75671
75701
  onRestore: (e) => {
75672
- e.restored > 0 && (Pt = !0);
75702
+ e.restored > 0 && (It = !0);
75673
75703
  }
75674
- }) : [], It = [...MFe(dt, vt, A8, dt.domInspect ? [
75704
+ }) : [], Rt = [...MFe(pt, bt, A8, pt.domInspect ? [
75675
75705
  ...j8,
75676
- ...Ft,
75677
- ...jt ? [jt] : [],
75678
- ...dt.skills ? [] : [F8, I8]
75679
- ] : [], TFe), ...At ? [At] : []];
75680
- At && Dt.set("view_image", "builtin"), It.forEach((e) => Dt.set(e.name, "builtin"));
75681
- let Lt = e.proposals ? XPe(e.proposals, {
75706
+ ...Lt,
75707
+ ...Nt ? [Nt] : [],
75708
+ ...pt.skills ? [] : [F8, I8]
75709
+ ] : [], TFe), ...Mt ? [Mt] : []];
75710
+ Mt && kt.set("view_image", "builtin"), Rt.forEach((e) => kt.set(e.name, "builtin"));
75711
+ let zt = e.proposals ? XPe(e.proposals, {
75682
75712
  emit: (e) => {
75683
75713
  try {
75684
- Jn(e);
75714
+ Qn(e);
75685
75715
  } catch (e) {}
75686
75716
  },
75687
75717
  log: (e, t) => {
@@ -75695,21 +75725,21 @@ function eIe(e, t, n) {
75695
75725
  }, t)
75696
75726
  });
75697
75727
  }
75698
- }) : null, Rt = [...e.tools || [], ...(E = Lt == null ? void 0 : Lt.tools) == null ? [] : E];
75699
- Rt.forEach((e) => Dt.set(e.name, "user"));
75700
- let zt = DFe((D = e.actions) == null ? {} : D);
75701
- zt.forEach((e) => Dt.set(e.name, "action"));
75702
- let Bt = Lt ? ((O = e.proposals) == null ? void 0 : O.readToolName) || "read_content" : null, Vt = Lt ? ((k = e.proposals) == null ? void 0 : k.toolName) || "propose_content" : null, Ht = /* @__PURE__ */ new Set([...Object.entries((A = e.actions) == null ? {} : A).filter(([, e]) => (e == null ? void 0 : e.readsHostState) === !0).map(([e]) => e), ...Bt ? [Bt] : []]), Ut = /* @__PURE__ */ new Set([...Object.entries((M = e.actions) == null ? {} : M).filter(([, e]) => (e == null ? void 0 : e.deferredWrite) === !0).map(([e]) => e), ...Vt ? [Vt] : []]), Wt = [], Gt = !1, Kt = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), qt = Kt ? x1() : null;
75703
- qt && Dt.set(b1, "builtin");
75704
- let Jt = ct && lt ? [qP(async () => {
75705
- let e = lt.list();
75706
- return e.length ? lt.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
75728
+ }) : null, Bt = [...e.tools || [], ...(E = zt == null ? void 0 : zt.tools) == null ? [] : E];
75729
+ Bt.forEach((e) => kt.set(e.name, "user"));
75730
+ let Vt = DFe((D = e.actions) == null ? {} : D);
75731
+ Vt.forEach((e) => kt.set(e.name, "action"));
75732
+ let Ht = zt ? ((O = e.proposals) == null ? void 0 : O.readToolName) || "read_content" : null, Ut = zt ? ((k = e.proposals) == null ? void 0 : k.toolName) || "propose_content" : null, Wt = /* @__PURE__ */ new Set([...Object.entries((A = e.actions) == null ? {} : A).filter(([, e]) => (e == null ? void 0 : e.readsHostState) === !0).map(([e]) => e), ...Ht ? [Ht] : []]), Gt = /* @__PURE__ */ new Set([...Object.entries((M = e.actions) == null ? {} : M).filter(([, e]) => (e == null ? void 0 : e.deferredWrite) === !0).map(([e]) => e), ...Ut ? [Ut] : []]), Kt = [], qt = !1, Jt = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), Yt = Jt ? x1() : null;
75733
+ Yt && kt.set(b1, "builtin");
75734
+ let Xt = ut && dt ? [qP(async () => {
75735
+ let e = dt.list();
75736
+ return e.length ? dt.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
75707
75737
  }, {
75708
75738
  name: "restore_last_checkpoint",
75709
75739
  description: "回退到最近一次正常状态(整体还原对话历史 + 主数据 + vfs + todos)。当本轮操作出错、页面被改坏、或走偏时调用,回到本轮起点重新来过。不传参数即回退最近一次。",
75710
75740
  schema: B({}).optional()
75711
75741
  }), qP(async () => {
75712
- let e = lt.list();
75742
+ let e = dt.list();
75713
75743
  return e.length ? "可用 checkpoint:\n" + e.map((e) => {
75714
75744
  var t;
75715
75745
  return `#${e.id} [${(t = e.label) == null ? "auto" : t}] 消息数=${e.messageCount} 时间=${new Date(e.timestamp).toLocaleTimeString()}`;
@@ -75719,11 +75749,11 @@ function eIe(e, t, n) {
75719
75749
  description: "列出可用会话 checkpoint(回退点)。",
75720
75750
  schema: B({}).optional()
75721
75751
  })] : [];
75722
- Jt.forEach((e) => Dt.set(e.name, "builtin"));
75723
- let Yt = dt.focus, Xt = qP(async ({ path: e, label: t }) => {
75752
+ Xt.forEach((e) => kt.set(e.name, "builtin"));
75753
+ let Zt = pt.focus, Qt = qP(async ({ path: e, label: t }) => {
75724
75754
  var n;
75725
- let r = (n = St()) == null ? void 0 : n.schema;
75726
- return r ? GQ(r, e) ? (We.setFocus(Ge(j({ path: e }, t ? { label: t } : {})), "agent"), `已聚焦到 ${e}${t ? `(${t})` : ""}。后续仅可写该子树(越界被拒),每轮只看到该组件结构。完成精修后调 clear_focus 退出。`) : `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。` : "聚焦失败:当前无主数据 schema,无法聚焦。";
75755
+ let r = (n = wt()) == null ? void 0 : n.schema;
75756
+ return r ? GQ(r, e) ? (Ke.setFocus(qe(j({ path: e }, t ? { label: t } : {})), "agent"), `已聚焦到 ${e}${t ? `(${t})` : ""}。后续仅可写该子树(越界被拒),每轮只看到该组件结构。完成精修后调 clear_focus 退出。`) : `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。` : "聚焦失败:当前无主数据 schema,无法聚焦。";
75727
75757
  }, {
75728
75758
  name: "set_focus",
75729
75759
  description: "聚焦到指定组件子树(如 components.3)精修,替换全部已有焦点(非累积;要保留已有焦点追加用 add_focus)。聚焦后:仅可写该子树(越界 PATH_DENIED)+ 每轮只看到该组件结构。多组件页面精修其中一个时用,避免改到别处。先 read 定位 path 再聚焦;完成调 clear_focus。",
@@ -75731,17 +75761,17 @@ function eIe(e, t, n) {
75731
75761
  path: z().describe("要聚焦的组件 jsonPath,如 components.3"),
75732
75762
  label: z().optional().describe("人类可读标签,如「导航栏」")
75733
75763
  })
75734
- }), Zt = qP(async () => (We.clearFocus("agent"), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
75764
+ }), $t = qP(async () => (Ke.clearFocus("agent"), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
75735
75765
  name: "clear_focus",
75736
75766
  description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
75737
75767
  schema: B({}).optional()
75738
- }), Qt = qP(async ({ path: e, label: t }) => {
75768
+ }), en = qP(async ({ path: e, label: t }) => {
75739
75769
  var n;
75740
- let r = (n = St()) == null ? void 0 : n.schema;
75770
+ let r = (n = wt()) == null ? void 0 : n.schema;
75741
75771
  if (!r) return "聚焦失败:当前无主数据 schema,无法聚焦。";
75742
75772
  if (!GQ(r, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
75743
- We.addFocus(Ge(j({ path: e }, t ? { label: t } : {})), "agent");
75744
- let i = We.getFocuses();
75773
+ Ke.addFocus(qe(j({ path: e }, t ? { label: t } : {})), "agent");
75774
+ let i = Ke.getFocuses();
75745
75775
  return `已聚焦 ${e}${t ? `(${t})` : ""}(当前共 ${i.length} 个焦点:${i.map((e) => e.path).join(", ")})。后续仅可写这些子树之一(越界被拒)。`;
75746
75776
  }, {
75747
75777
  name: "add_focus",
@@ -75750,81 +75780,84 @@ function eIe(e, t, n) {
75750
75780
  path: z().describe("要追加聚焦的组件 jsonPath,如 components.3"),
75751
75781
  label: z().optional().describe("人类可读标签")
75752
75782
  })
75753
- }), $t = qP(async ({ path: e }) => {
75754
- let t = We.getFocuses().length;
75755
- We.removeFocus(e, "agent");
75756
- let n = We.getFocuses();
75783
+ }), tn = qP(async ({ path: e }) => {
75784
+ let t = Ke.getFocuses().length;
75785
+ Ke.removeFocus(e, "agent");
75786
+ let n = Ke.getFocuses();
75757
75787
  return n.length === t ? `path "${e}" 不在当前焦点列表中(当前:${n.map((e) => e.path).join(", ") || "无"})。` : n.length ? `已移除焦点 ${e}(剩余 ${n.length} 个:${n.map((e) => e.path).join(", ")})。` : `已移除焦点 ${e},聚焦已清空,恢复全量操作范围。`;
75758
75788
  }, {
75759
75789
  name: "remove_focus",
75760
75790
  description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
75761
75791
  schema: B({ path: z().describe("要移除的焦点 jsonPath") })
75762
- }), en = Yt ? [
75763
- Xt,
75764
- Zt,
75792
+ }), nn = Zt ? [
75765
75793
  Qt,
75766
- $t
75794
+ $t,
75795
+ en,
75796
+ tn
75767
75797
  ] : [];
75768
- en.forEach((e) => Dt.set(e.name, "builtin"));
75769
- let tn = [], nn = /* @__PURE__ */ new Map(), rn = lNe({
75770
- builtinTools: () => It,
75771
- userTools: () => Rt,
75772
- actionTools: () => zt,
75773
- humanConfirmTool: () => qt,
75774
- checkpointTools: () => Jt,
75775
- focusTools: () => en,
75776
- mcpTools: () => Wt,
75777
- loadedSkillTools: () => tn
75778
- }), an = rn(), on = dt.planning, sn = dt.missionAnchor, cn = dt.workingMemory, ln = dt.skills, un = dt.vfs || it;
75779
- if (un) for (let e of QAe) Dt.set(e, "builtin");
75780
- if (on) {
75781
- var dn;
75782
- for (let e of (dn = Fe.tools) == null ? [] : dn) Dt.set(e.name, "builtin");
75783
- }
75784
- let fn = dt.summarization, pn = dt.agentCompression && !!xe;
75785
- e.debug && dt.agentCompression && !xe && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
75786
- let mn = dt.memory, hn = dt.subagent, gn = hn ? s1() : void 0, _n = (ee = (te = e.verify) == null ? void 0 : te.maxAttempts) == null ? 2 : ee, vn = !!((P = e.verify) != null && P.check || (ne = e.verify) != null && ne.maxAttempts || (re = e.verify) != null && re.adversarial), yn = ((ie = e.capabilities) == null ? void 0 : ie.verify) === !1, bn = (dt.verify || vn && !yn) && ((ae = e.verify) == null ? void 0 : ae.enabled) !== !1 && _n > 0, xn = dt.contextInspector;
75787
- vn && !bn && ((oe = e.verify) == null ? void 0 : oe.enabled) !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
75788
- let Sn = e.subagent, Cn = (se = Sn == null ? void 0 : Sn.allowedTools) == null ? [] : se, wn = (ce = e.permissions) != null && ce.length ? hEe(e.permissions) : void 0, Tn = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? y1(j(j({}, e.approval), {}, {
75789
- timeoutMs: (F = e.approval.timeoutMs) == null ? Ve : F,
75790
- onAutoReject: He,
75791
- previewWrite: e.approval.preview === !0 && bt ? (e, t) => e === "write" ? bt(t) : null : void 0
75792
- })) : void 0, En = [
75793
- ...wn ? [wn] : [],
75794
- ...Tn ? [Tn] : [],
75795
- ...Et ? [Et] : []
75796
- ], Dn = !hn || (Sn == null ? void 0 : Sn.enabled) === !1 ? void 0 : m1(j(j({
75797
- llm: (le = Sn == null ? void 0 : Sn.llm) == null ? e.llm : le,
75798
+ nn.forEach((e) => kt.set(e.name, "builtin"));
75799
+ let rn = [], an = /* @__PURE__ */ new Map(), on = lNe({
75800
+ builtinTools: () => Rt,
75801
+ userTools: () => Bt,
75802
+ actionTools: () => Vt,
75803
+ humanConfirmTool: () => Yt,
75804
+ checkpointTools: () => Xt,
75805
+ focusTools: () => nn,
75806
+ mcpTools: () => Kt,
75807
+ loadedSkillTools: () => rn
75808
+ }), sn = on(), cn = pt.planning, ln = pt.missionAnchor, un = pt.workingMemory, dn = pt.skills, fn = pt.vfs || ot;
75809
+ if (fn) for (let e of QAe) kt.set(e, "builtin");
75810
+ if (cn) {
75811
+ var pn;
75812
+ for (let e of (pn = Le.tools) == null ? [] : pn) kt.set(e.name, "builtin");
75813
+ }
75814
+ let mn = pt.summarization, hn = pt.agentCompression && !!Ce;
75815
+ e.debug && pt.agentCompression && !Ce && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
75816
+ let gn = pt.memory, _n = pt.subagent, vn = _n ? s1() : void 0, yn = (ee = (te = e.verify) == null ? void 0 : te.maxAttempts) == null ? 2 : ee, bn = !!((P = e.verify) != null && P.check || (ne = e.verify) != null && ne.maxAttempts || (re = e.verify) != null && re.adversarial), xn = ((ie = e.capabilities) == null ? void 0 : ie.verify) === !1, Sn = (pt.verify || bn && !xn) && ((ae = e.verify) == null ? void 0 : ae.enabled) !== !1 && yn > 0, Cn = pt.contextInspector;
75817
+ bn && !Sn && ((oe = e.verify) == null ? void 0 : oe.enabled) !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
75818
+ let wn = e.subagent, Tn = (se = wn == null ? void 0 : wn.allowedTools) == null ? [] : se, En = (ce = e.permissions) != null && ce.length ? hEe(e.permissions) : void 0, Dn = ((F = e.approval) == null ? void 0 : F.preview) === !0 && St ? (e, t) => e === "write" ? St(t) : null : void 0, On = (le = e.approval) != null && le.previewWrite || Dn ? (t, n) => {
75819
+ var r, i, a, o;
75820
+ return (r = (i = (a = e.approval) == null || (o = a.previewWrite) == null ? void 0 : o.call(a, t, n)) == null ? Dn == null ? void 0 : Dn(t, n) : i) == null ? null : r;
75821
+ } : void 0, kn = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? y1(j(j({}, e.approval), {}, {
75822
+ timeoutMs: (ue = e.approval.timeoutMs) == null ? Ue : ue,
75823
+ onAutoReject: We,
75824
+ previewWrite: On
75825
+ })) : void 0, An = [
75826
+ ...En ? [En] : [],
75827
+ ...kn ? [kn] : [],
75828
+ ...Ot ? [Ot] : []
75829
+ ], jn = !_n || (wn == null ? void 0 : wn.enabled) === !1 ? void 0 : m1(j(j({
75830
+ llm: (I = wn == null ? void 0 : wn.llm) == null ? e.llm : I,
75798
75831
  allTools: () => {
75799
75832
  var e, t;
75800
- return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? an : e;
75833
+ return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? sn : e;
75801
75834
  },
75802
- allowedTools: Cn.length ? Cn : void 0
75835
+ allowedTools: Tn.length ? Tn : void 0
75803
75836
  }, e.staleReadInvalidation === void 0 ? {} : { staleReadInvalidation: e.staleReadInvalidation }), {}, {
75804
- systemPrompt: Sn == null ? void 0 : Sn.systemPrompt,
75805
- temperature: Sn == null ? void 0 : Sn.temperature,
75806
- maxTokens: Sn == null ? void 0 : Sn.maxTokens,
75807
- skills: Sn == null ? void 0 : Sn.skills,
75808
- maxDepth: Sn == null ? void 0 : Sn.maxDepth,
75809
- maxParallel: Sn == null ? void 0 : Sn.maxParallel,
75810
- thinkingMode: Sn == null ? void 0 : Sn.thinkingMode,
75837
+ systemPrompt: wn == null ? void 0 : wn.systemPrompt,
75838
+ temperature: wn == null ? void 0 : wn.temperature,
75839
+ maxTokens: wn == null ? void 0 : wn.maxTokens,
75840
+ skills: wn == null ? void 0 : wn.skills,
75841
+ maxDepth: wn == null ? void 0 : wn.maxDepth,
75842
+ maxParallel: wn == null ? void 0 : wn.maxParallel,
75843
+ thinkingMode: wn == null ? void 0 : wn.thinkingMode,
75811
75844
  debug: e.debug,
75812
- getFocuses: () => We.getActiveFocuses(),
75845
+ getFocuses: () => Ke.getActiveFocuses(),
75813
75846
  getSchema: () => {
75814
75847
  var e, t;
75815
- return (e = (t = St()) == null ? void 0 : t.schema) == null ? null : e;
75848
+ return (e = (t = wt()) == null ? void 0 : t.schema) == null ? null : e;
75816
75849
  },
75817
- tracker: gn,
75818
- guardMiddleware: En.length ? En : void 0,
75819
- getVfsFiles: un ? () => Pe.files : void 0,
75820
- enterDataScope: yt != null && yt.enterScope ? (e) => yt.enterScope(e) : void 0,
75821
- exitDataScope: yt != null && yt.exitScope ? (e) => yt.exitScope(e) : void 0,
75850
+ tracker: vn,
75851
+ guardMiddleware: An.length ? An : void 0,
75852
+ getVfsFiles: fn ? () => Ie.files : void 0,
75853
+ enterDataScope: xt != null && xt.enterScope ? (e) => xt.enterScope(e) : void 0,
75854
+ exitDataScope: xt != null && xt.exitScope ? (e) => xt.exitScope(e) : void 0,
75822
75855
  onUsage: (e) => {
75823
75856
  var t, n, r, i, a, o, s;
75824
- me.prompt_tokens = ((t = me.prompt_tokens) == null ? 0 : t) + ((n = e.prompt_tokens) == null ? 0 : n), me.completion_tokens = ((r = me.completion_tokens) == null ? 0 : r) + ((i = e.completion_tokens) == null ? 0 : i), me.total_tokens = ((a = me.total_tokens) == null ? 0 : a) + ((o = e.total_tokens) == null ? 0 : o), e.reasoning_tokens && (me.reasoning_tokens = ((s = me.reasoning_tokens) == null ? 0 : s) + e.reasoning_tokens);
75857
+ ge.prompt_tokens = ((t = ge.prompt_tokens) == null ? 0 : t) + ((n = e.prompt_tokens) == null ? 0 : n), ge.completion_tokens = ((r = ge.completion_tokens) == null ? 0 : r) + ((i = e.completion_tokens) == null ? 0 : i), ge.total_tokens = ((a = ge.total_tokens) == null ? 0 : a) + ((o = e.total_tokens) == null ? 0 : o), e.reasoning_tokens && (ge.reasoning_tokens = ((s = ge.reasoning_tokens) == null ? 0 : s) + e.reasoning_tokens);
75825
75858
  },
75826
- timeoutMs: Sn == null ? void 0 : Sn.timeoutMs
75827
- })), On = rt == null ? void 0 : rt.map((e) => {
75859
+ timeoutMs: wn == null ? void 0 : wn.timeoutMs
75860
+ })), Mn = at == null ? void 0 : at.map((e) => {
75828
75861
  var t;
75829
75862
  if (!e._codeAsset) return e;
75830
75863
  let n = e._codeAsset, r = Nje({
@@ -75834,109 +75867,109 @@ function eIe(e, t, n) {
75834
75867
  codeField: n.codeField,
75835
75868
  craftNotes: n.craftNotes,
75836
75869
  onWarning: (e) => console.warn(`[page-agent-sdk][code-asset] ${e}`),
75837
- getController: () => yt,
75838
- vfsStore: Pe
75870
+ getController: () => xt,
75871
+ vfsStore: Ie
75839
75872
  }), i = [...(t = e.middleware) == null ? [] : t, r];
75840
- for (let e of i) e && Wwe(e) && e._setGetController(() => yt);
75873
+ for (let e of i) e && Wwe(e) && e._setGetController(() => xt);
75841
75874
  return j(j({}, e), {}, { middleware: i });
75842
- }), kn = it && hn ? Pje() : void 0, An = kn ? Bje({
75875
+ }), Nn = ot && _n ? Pje() : void 0, Pn = Nn ? Bje({
75843
75876
  getBind: () => {
75844
75877
  var e;
75845
- return (e = St()) == null ? void 0 : e.bind;
75878
+ return (e = wt()) == null ? void 0 : e.bind;
75846
75879
  },
75847
- writablePaths: at,
75848
- getLocked: () => kn.locked(),
75849
- tools: an,
75880
+ writablePaths: st,
75881
+ getLocked: () => Nn.locked(),
75882
+ tools: sn,
75850
75883
  getCodeFieldPaths: () => {
75851
75884
  var e;
75852
- return Rje((e = St()) == null ? void 0 : e.bind, nt.map((e) => ({
75885
+ return Rje((e = wt()) == null ? void 0 : e.bind, it.map((e) => ({
75853
75886
  writablePaths: e._codeAsset.writablePaths,
75854
75887
  codeField: e._codeAsset.codeField
75855
75888
  })));
75856
75889
  }
75857
- }) : void 0, jn = yt != null && yt.getSummarizedPaths && yt.clearSummarizedPaths ? Uje({
75858
- getSummarizedPaths: () => yt.getSummarizedPaths(),
75859
- clearSummarizedPaths: () => yt.clearSummarizedPaths()
75860
- }) : void 0, Mn = hn && On !== void 0 ? h1(On, j({
75890
+ }) : void 0, Fn = xt != null && xt.getSummarizedPaths && xt.clearSummarizedPaths ? Uje({
75891
+ getSummarizedPaths: () => xt.getSummarizedPaths(),
75892
+ clearSummarizedPaths: () => xt.clearSummarizedPaths()
75893
+ }) : void 0, In = _n && Mn !== void 0 ? h1(Mn, j({
75861
75894
  llm: e.llm,
75862
- thinkingModeDefault: (ue = e.subagent) == null ? void 0 : ue.thinkingMode,
75895
+ thinkingModeDefault: (de = e.subagent) == null ? void 0 : de.thinkingMode,
75863
75896
  staleReadInvalidation: e.staleReadInvalidation,
75864
75897
  allTools: () => {
75865
75898
  var e, t;
75866
- return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? an : e;
75899
+ return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? sn : e;
75867
75900
  },
75868
75901
  debug: e.debug,
75869
- getFocuses: () => We.getActiveFocuses(),
75902
+ getFocuses: () => Ke.getActiveFocuses(),
75870
75903
  getSchema: () => {
75871
75904
  var e, t;
75872
- return (e = (t = St()) == null ? void 0 : t.schema) == null ? null : e;
75905
+ return (e = (t = wt()) == null ? void 0 : t.schema) == null ? null : e;
75873
75906
  },
75874
75907
  getBind: () => {
75875
75908
  var e;
75876
- return (e = St()) == null ? void 0 : e.bind;
75909
+ return (e = wt()) == null ? void 0 : e.bind;
75877
75910
  },
75878
- tracker: gn,
75879
- guardMiddleware: En.length ? En : void 0,
75880
- getVfsFiles: un ? () => Pe.files : void 0,
75881
- enterDataScope: yt != null && yt.enterScope ? (e) => yt.enterScope(e) : void 0,
75882
- exitDataScope: yt != null && yt.exitScope ? (e) => yt.exitScope(e) : void 0,
75911
+ tracker: vn,
75912
+ guardMiddleware: An.length ? An : void 0,
75913
+ getVfsFiles: fn ? () => Ie.files : void 0,
75914
+ enterDataScope: xt != null && xt.enterScope ? (e) => xt.enterScope(e) : void 0,
75915
+ exitDataScope: xt != null && xt.exitScope ? (e) => xt.exitScope(e) : void 0,
75883
75916
  onUsage: (e) => {
75884
75917
  var t, n, r, i, a, o, s;
75885
- me.prompt_tokens = ((t = me.prompt_tokens) == null ? 0 : t) + ((n = e.prompt_tokens) == null ? 0 : n), me.completion_tokens = ((r = me.completion_tokens) == null ? 0 : r) + ((i = e.completion_tokens) == null ? 0 : i), me.total_tokens = ((a = me.total_tokens) == null ? 0 : a) + ((o = e.total_tokens) == null ? 0 : o), e.reasoning_tokens && (me.reasoning_tokens = ((s = me.reasoning_tokens) == null ? 0 : s) + e.reasoning_tokens);
75918
+ ge.prompt_tokens = ((t = ge.prompt_tokens) == null ? 0 : t) + ((n = e.prompt_tokens) == null ? 0 : n), ge.completion_tokens = ((r = ge.completion_tokens) == null ? 0 : r) + ((i = e.completion_tokens) == null ? 0 : i), ge.total_tokens = ((a = ge.total_tokens) == null ? 0 : a) + ((o = e.total_tokens) == null ? 0 : o), e.reasoning_tokens && (ge.reasoning_tokens = ((s = ge.reasoning_tokens) == null ? 0 : s) + e.reasoning_tokens);
75886
75919
  },
75887
- timeoutMs: (I = e.subagent) == null ? void 0 : I.timeoutMs
75888
- }, kn ? {
75889
- componentLock: kn,
75920
+ timeoutMs: (fe = e.subagent) == null ? void 0 : fe.timeoutMs
75921
+ }, Nn ? {
75922
+ componentLock: Nn,
75890
75923
  resolveComponents: (e) => {
75891
75924
  var t;
75892
- return Fje(e, jje((t = St()) == null ? void 0 : t.bind, at));
75925
+ return Fje(e, jje((t = wt()) == null ? void 0 : t.bind, st));
75893
75926
  }
75894
- } : {})) : void 0, Nn = Mn ? Mn.controller : null, Pn = (t) => {
75927
+ } : {})) : void 0, Ln = In ? In.controller : null, Rn = (t) => {
75895
75928
  var n, r, i;
75896
75929
  let a = (n = t.thinkingMode) == null ? (r = e.subagent) == null ? void 0 : r.thinkingMode : n, o = a ? Q6((i = t.llm) == null ? e.llm : i) ? "instance-noop" : "applied" : "inherited";
75897
75930
  return j(j(j({}, t), a ? { thinkingMode: a } : {}), {}, { thinkingApplied: o });
75898
- }, Fn = ["read", "fetch_document"], In = an.filter((e) => Fn.includes(e.name)), Ln = bn ? k1({
75899
- check: (de = e.verify.check) == null ? A1({
75900
- schemas: () => St() ? { "": St().schema } : {},
75931
+ }, zn = ["read", "fetch_document"], Bn = sn.filter((e) => zn.includes(e.name)), Vn = Sn ? k1({
75932
+ check: (pe = e.verify.check) == null ? A1({
75933
+ schemas: () => wt() ? { "": wt().schema } : {},
75901
75934
  root: () => {
75902
75935
  var e;
75903
- return (e = St()) == null ? void 0 : e.bind;
75936
+ return (e = wt()) == null ? void 0 : e.bind;
75904
75937
  }
75905
- }) : de,
75906
- adversarial: (fe = e.verify) != null && fe.adversarial ? {
75938
+ }) : pe,
75939
+ adversarial: (me = e.verify) != null && me.adversarial ? {
75907
75940
  llm: e.llm,
75908
- tools: In
75941
+ tools: Bn
75909
75942
  } : void 0
75910
- }) : void 0, Rn = xn ? F1({
75911
- contextWindow: Se.contextWindow,
75912
- thresholdRatio: f8(e, Se.contextWindow).summaryThresholdRatio
75913
- }) : void 0, zn = LFe(j(j({}, dt), {}, {
75914
- humanConfirm: Kt,
75915
- screenshot: !!jt,
75916
- domEdit: dt.domEdit,
75943
+ }) : void 0, Hn = Cn ? F1({
75944
+ contextWindow: we.contextWindow,
75945
+ thresholdRatio: f8(e, we.contextWindow).summaryThresholdRatio
75946
+ }) : void 0, Un = LFe(j(j({}, pt), {}, {
75947
+ humanConfirm: Jt,
75948
+ screenshot: !!Nt,
75949
+ domEdit: pt.domEdit,
75917
75950
  hasActions: !!e.actions && Object.keys(e.actions).length > 0,
75918
75951
  hasProposals: !!e.proposals,
75919
- viewImage: !!At,
75920
- subagents: rt == null ? void 0 : rt.map(Pn)
75921
- }), ft && !!Ye, { promptSoftCap: i1(Se.contextWindow, L.promptSoftCapTokens) }), Bn = dt.pageContext ? zFe({
75952
+ viewImage: !!Mt,
75953
+ subagents: at == null ? void 0 : at.map(Rn)
75954
+ }), mt && !!Ze, { promptSoftCap: i1(we.contextWindow, Ae.promptSoftCapTokens) }), Wn = pt.pageContext ? zFe({
75922
75955
  getPageInfo: () => typeof document < "u" && typeof location < "u" ? {
75923
75956
  title: document.title || "",
75924
75957
  url: location.href
75925
75958
  } : null,
75926
- canReadPage: dt.domInspect === !0
75927
- }) : void 0, Vn = {
75959
+ canReadPage: pt.domInspect === !0
75960
+ }) : void 0, Gn = {
75928
75961
  epoch: 0,
75929
75962
  notices: [],
75930
75963
  readsInvalidated: 0
75931
- }, Hn = 0, Un = {
75964
+ }, Kn = 0, qn = {
75932
75965
  name: "hostNotice",
75933
75966
  beforeAgent: () => {
75934
- Hn = Vn.epoch;
75967
+ Kn = Gn.epoch;
75935
75968
  },
75936
75969
  wrapModelCall: async (e, t) => {
75937
- if (Pt) {
75938
- Pt = !1;
75939
- let t = uQ(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态", Ht);
75970
+ if (It) {
75971
+ It = !1;
75972
+ let t = uQ(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态", Wt);
75940
75973
  if (t.invalidatedCount > 0) {
75941
75974
  var n;
75942
75975
  for (let n = 0; n < t.messages.length; n++) e.messages[n] = t.messages[n];
@@ -75950,20 +75983,20 @@ function eIe(e, t, n) {
75950
75983
  });
75951
75984
  }
75952
75985
  }
75953
- if (Vn.epoch > Hn) {
75986
+ if (Gn.epoch > Kn) {
75954
75987
  var r;
75955
- Hn = Vn.epoch;
75956
- let t = (r = Vn.notices[Vn.notices.length - 1]) == null ? "" : r, n = uQ(e.messages, t || void 0, Ht);
75988
+ Kn = Gn.epoch;
75989
+ let t = (r = Gn.notices[Gn.notices.length - 1]) == null ? "" : r, n = uQ(e.messages, t || void 0, Wt);
75957
75990
  if (n.invalidatedCount > 0) {
75958
75991
  var i;
75959
75992
  for (let t = 0; t < n.messages.length; t++) e.messages[t] = n.messages[t];
75960
- Vn.readsInvalidated += n.invalidatedCount, (i = R.agent) == null || (i = i.debugLogs) == null || (i = i.value) == null || i.push({
75993
+ Gn.readsInvalidated += n.invalidatedCount, (i = R.agent) == null || (i = i.debugLogs) == null || (i = i.value) == null || i.push({
75961
75994
  timestamp: Date.now(),
75962
75995
  type: "middleware",
75963
75996
  data: {
75964
75997
  stage: "host_read_invalidated",
75965
75998
  count: n.invalidatedCount,
75966
- epoch: Vn.epoch,
75999
+ epoch: Gn.epoch,
75967
76000
  reason: t || void 0
75968
76001
  }
75969
76002
  });
@@ -75971,177 +76004,177 @@ function eIe(e, t, n) {
75971
76004
  }
75972
76005
  return t(e);
75973
76006
  },
75974
- augmentPrompt: () => Vn.notices.length ? [
76007
+ augmentPrompt: () => Gn.notices.length ? [
75975
76008
  "【宿主页面已变更】",
75976
- ...Vn.notices.filter(Boolean).map((e) => `· ${e}`),
75977
- dt.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
76009
+ ...Gn.notices.filter(Boolean).map((e) => `· ${e}`),
76010
+ pt.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
75978
76011
  ].join("\n") : void 0,
75979
76012
  afterAgent: () => {
75980
- Vn.notices.length = 0;
76013
+ Gn.notices.length = 0;
75981
76014
  }
75982
- }, Wn = Lt ? {
76015
+ }, Jn = zt ? {
75983
76016
  name: "proposalNotice",
75984
- augmentPrompt: () => Lt.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...Lt.state.notices].join("\n") : void 0,
76017
+ augmentPrompt: () => zt.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...zt.state.notices].join("\n") : void 0,
75985
76018
  afterAgent: () => {
75986
- Lt.state.notices.length = 0;
76019
+ zt.state.notices.length = 0;
75987
76020
  }
75988
- } : null, Gn = Ye ? {
76021
+ } : null, Yn = Ze ? {
75989
76022
  name: "dataHint",
75990
- augmentPrompt: () => h6(St(), e.schemaHint) || void 0
75991
- } : null, Kn = e.augmentSystem ? {
76023
+ augmentPrompt: () => h6(wt(), e.schemaHint) || void 0
76024
+ } : null, Xn = e.augmentSystem ? {
75992
76025
  name: "augmentSystem",
75993
76026
  augmentPrompt: (t) => {
75994
76027
  try {
75995
76028
  return e.augmentSystem({
75996
76029
  state: t,
75997
- data: St()
76030
+ data: wt()
75998
76031
  });
75999
76032
  } catch (t) {
76000
76033
  e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
76001
76034
  return;
76002
76035
  }
76003
76036
  }
76004
- } : null, qn = eNe(e.onEvent), Jn = qn.emit, Yn, Xn = [], Zn = (e) => ({
76037
+ } : null, Zn = eNe(e.onEvent), Qn = Zn.emit, $n, er = [], tr = (e) => ({
76005
76038
  name: e.name,
76006
76039
  description: e.description,
76007
76040
  content: typeof e.getContent == "function" ? e.getContent() : ""
76008
- }), Qn = (e) => ({
76041
+ }), nr = (e) => ({
76009
76042
  name: e.name,
76010
76043
  description: e.description,
76011
76044
  getContent: () => e.content
76012
- }), $n = e.skillStorage === !1 ? null : WFe(j(j({}, typeof e.skillStorage == "object" ? e.skillStorage : {}), {}, { id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${t}` })), er = () => {
76013
- let t = Yn ? Yn.controller : null;
76045
+ }), rr = e.skillStorage === !1 ? null : WFe(j(j({}, typeof e.skillStorage == "object" ? e.skillStorage : {}), {}, { id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${t}` })), ir = () => {
76046
+ let t = $n ? $n.controller : null;
76014
76047
  if (t) {
76015
- let n = (e.skills || []).filter((e) => !Xn.some((t) => t.name === e.name));
76016
- t.set([...n, ...Xn]);
76048
+ let n = (e.skills || []).filter((e) => !er.some((t) => t.name === e.name));
76049
+ t.set([...n, ...er]);
76017
76050
  }
76018
76051
  R.infoTick.value++;
76019
- }, tr = async () => {
76020
- if ($n) try {
76021
- let t = await $n.list();
76052
+ }, ar = async () => {
76053
+ if (rr) try {
76054
+ let t = await rr.list();
76022
76055
  if (t.length) {
76023
- Xn = t.map(Qn);
76024
- let n = Yn ? Yn.controller : null;
76056
+ er = t.map(nr);
76057
+ let n = $n ? $n.controller : null;
76025
76058
  if (n) {
76026
- let t = (e.skills || []).filter((e) => !Xn.some((t) => t.name === e.name));
76027
- n.set([...t, ...Xn]);
76059
+ let t = (e.skills || []).filter((e) => !er.some((t) => t.name === e.name));
76060
+ n.set([...t, ...er]);
76028
76061
  }
76029
76062
  R.infoTick.value++;
76030
76063
  }
76031
76064
  } catch (e) {}
76032
- }, nr = fn ? o1(j(j({}, L), {}, {
76033
- llmInvoke: ye,
76065
+ }, or = mn ? o1(j(j({}, Ae), {}, {
76066
+ llmInvoke: xe,
76034
76067
  getRegisteredData: () => {
76035
76068
  var e;
76036
- return St() ? [{ description: (e = St().description) == null ? "主数据对象" : e }] : [];
76069
+ return wt() ? [{ description: (e = wt().description) == null ? "主数据对象" : e }] : [];
76037
76070
  },
76038
- preserveLastToolResults: Ae
76039
- }, pn ? {
76040
- decideInvoke: xe,
76041
- getSnapshot: () => Rn == null ? void 0 : Rn.getSnapshot()
76042
- } : {})) : void 0, rr = ln ? W$([
76043
- ...dt.domInspect && !(e.skills || []).some((e) => e.name === "dom-inspect") ? [gFe({
76044
- withScreenshot: !!jt,
76045
- withDomEdit: dt.domEdit,
76046
- withDataOps: ft && !!Ye
76071
+ preserveLastToolResults: Me
76072
+ }, hn ? {
76073
+ decideInvoke: Ce,
76074
+ getSnapshot: () => Hn == null ? void 0 : Hn.getSnapshot()
76075
+ } : {})) : void 0, sr = dn ? W$([
76076
+ ...pt.domInspect && !(e.skills || []).some((e) => e.name === "dom-inspect") ? [gFe({
76077
+ withScreenshot: !!Nt,
76078
+ withDomEdit: pt.domEdit,
76079
+ withDataOps: mt && !!Ze
76047
76080
  })] : [],
76048
- ...dt.domInspect && !(e.skills || []).some((e) => e.name === "page-analysis") ? [vFe({
76049
- withScreenshot: !!jt,
76050
- withDomEdit: dt.domEdit,
76051
- withVfs: un
76081
+ ...pt.domInspect && !(e.skills || []).some((e) => e.name === "page-analysis") ? [vFe({
76082
+ withScreenshot: !!Nt,
76083
+ withDomEdit: pt.domEdit,
76084
+ withVfs: fn
76052
76085
  })] : [],
76053
76086
  ...e.skills || []
76054
76087
  ], {
76055
- readVfs: un ? (e) => {
76088
+ readVfs: fn ? (e) => {
76056
76089
  var t;
76057
- return (t = Pe.files[e]) == null ? void 0 : t.content;
76090
+ return (t = Ie.files[e]) == null ? void 0 : t.content;
76058
76091
  } : void 0,
76059
76092
  onToolsReady: (e, t) => {
76060
76093
  for (let n of t) {
76061
- let t = tn.findIndex((e) => e.name === n.name);
76062
- t >= 0 && tn.splice(t, 1), tn.push(n), nn.set(n.name, e), Dt.set(n.name, `skill:${e}`);
76094
+ let t = rn.findIndex((e) => e.name === n.name);
76095
+ t >= 0 && rn.splice(t, 1), rn.push(n), an.set(n.name, e), kt.set(n.name, `skill:${e}`);
76063
76096
  }
76064
- an = rn(), R.agent && R.agent.setTools(an), R.infoTick.value++;
76097
+ sn = on(), R.agent && R.agent.setTools(sn), R.infoTick.value++;
76065
76098
  }
76066
76099
  }) : void 0;
76067
- Yn = rr;
76068
- let ir = iNe([
76069
- ...Gn ? [Gn] : [],
76070
- zn,
76071
- ...Bn ? [Bn] : [],
76100
+ $n = sr;
76101
+ let cr = iNe([
76102
+ ...Yn ? [Yn] : [],
76072
76103
  Un,
76073
76104
  ...Wn ? [Wn] : [],
76074
- ...sn ? [Ie] : [],
76075
- Le,
76076
- Re,
76077
- ...on ? [Fe] : [],
76078
- ...rr ? [rr] : [],
76079
- ...un ? [eje(Pe)] : [],
76080
- ...nr ? [nr] : [],
76081
- ...cn ? [Ke] : [],
76082
- ...Yt ? [We] : [],
76083
- ...xt ? [xt] : [],
76084
- ...mn ? [qe] : [],
76085
- ...wn ? [wn] : [],
76086
- ...ct && ut && lt ? [O1(lt)] : [],
76087
- ...Kt ? [Ue] : [],
76088
- ...Tn ? [Tn] : [],
76089
- ...Et ? [Et] : [],
76090
- ...Ln ? [Ln] : [],
76091
- ...Dn ? [Dn] : [],
76092
- ...Mn ? [Mn] : [],
76093
- ...An ? [An] : [],
76105
+ qn,
76106
+ ...Jn ? [Jn] : [],
76107
+ ...ln ? [Re] : [],
76108
+ ze,
76109
+ Be,
76110
+ ...cn ? [Le] : [],
76111
+ ...sr ? [sr] : [],
76112
+ ...fn ? [eje(Ie)] : [],
76113
+ ...or ? [or] : [],
76114
+ ...un ? [Je] : [],
76115
+ ...Zt ? [Ke] : [],
76116
+ ...Ct ? [Ct] : [],
76117
+ ...gn ? [Ye] : [],
76118
+ ...En ? [En] : [],
76119
+ ...ut && ft && dt ? [O1(dt)] : [],
76120
+ ...Jt ? [Ge] : [],
76121
+ ...kn ? [kn] : [],
76122
+ ...Ot ? [Ot] : [],
76123
+ ...Vn ? [Vn] : [],
76094
76124
  ...jn ? [jn] : [],
76095
- ...yt && hn ? [Kje({
76125
+ ...In ? [In] : [],
76126
+ ...Pn ? [Pn] : [],
76127
+ ...Fn ? [Fn] : [],
76128
+ ...xt && _n ? [Kje({
76096
76129
  getBind: () => {
76097
76130
  var e;
76098
- return (e = St()) == null ? void 0 : e.bind;
76131
+ return (e = wt()) == null ? void 0 : e.bind;
76099
76132
  },
76100
76133
  getTools: () => {
76101
76134
  var e, t;
76102
- return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? an : e;
76135
+ return (e = (t = R.agent) == null ? void 0 : t.allTools) == null ? sn : e;
76103
76136
  }
76104
76137
  })] : [],
76105
- ...Kn ? [Kn] : [],
76106
- ...Rn ? [Rn] : [],
76107
- ...Nt ? [Nt] : [],
76138
+ ...Xn ? [Xn] : [],
76139
+ ...Hn ? [Hn] : [],
76140
+ ...Ft ? [Ft] : [],
76108
76141
  ...e.middleware || [],
76109
- ...mt ? [EFe(me, {
76142
+ ...gt ? [EFe(ge, {
76110
76143
  tokenBudget: e.tokenBudget,
76111
76144
  timeBudgetMs: e.timeBudgetMs
76112
- }, Jn)] : [],
76113
- QFe(Jn, Ne, St, me)
76114
- ]), ar = (pe = e.maxMemoryRounds) == null ? YFe : pe;
76115
- function or(e) {
76145
+ }, Qn)] : [],
76146
+ QFe(Qn, Fe, wt, ge)
76147
+ ]), lr = (he = e.maxMemoryRounds) == null ? YFe : he;
76148
+ function ur(e) {
76116
76149
  return (e) => {
76117
- e.type !== "approval_request" && Jn(kt(e));
76150
+ e.type !== "approval_request" && Qn(jt(e));
76118
76151
  };
76119
76152
  }
76120
- let sr = /* @__PURE__ */ Iq([]), cr = qFe(), lr = /* @__PURE__ */ new Set();
76121
- function ur(e) {
76153
+ let dr = /* @__PURE__ */ Iq([]), fr = qFe(), pr = /* @__PURE__ */ new Set();
76154
+ function mr(e) {
76122
76155
  let t = new AbortController(), n = () => t.abort();
76123
- return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), lr.add(t), {
76156
+ return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), pr.add(t), {
76124
76157
  controller: t,
76125
76158
  untrack: () => {
76126
- lr.delete(t), e == null || e.removeEventListener("abort", n);
76159
+ pr.delete(t), e == null || e.removeEventListener("abort", n);
76127
76160
  }
76128
76161
  };
76129
76162
  }
76130
- function dr() {
76131
- for (let e of lr) e.abort();
76132
- lr.clear();
76163
+ function hr() {
76164
+ for (let e of pr) e.abort();
76165
+ pr.clear();
76133
76166
  }
76134
- let fr = /* @__PURE__ */ Iq(null), R = {
76167
+ let gr = /* @__PURE__ */ Iq(null), R = {
76135
76168
  agentId: t,
76136
- store: _e,
76137
- messages: Ne,
76138
- vfsStore: Pe,
76139
- listeners: qn.listeners,
76140
- todosMw: Fe,
76141
- memoryMw: qe,
76142
- missionMw: Ie,
76143
- workingMemoryMw: Ke,
76144
- focusMw: We,
76169
+ store: ye,
76170
+ messages: Fe,
76171
+ vfsStore: Ie,
76172
+ listeners: Zn.listeners,
76173
+ todosMw: Le,
76174
+ memoryMw: Ye,
76175
+ missionMw: Re,
76176
+ workingMemoryMw: Je,
76177
+ focusMw: Ke,
76145
76178
  agent: null,
76146
76179
  initDone: Promise.resolve(),
76147
76180
  sessionId: "",
@@ -76149,62 +76182,62 @@ function eIe(e, t, n) {
76149
76182
  mcpClosers: [],
76150
76183
  mcpServers: [],
76151
76184
  mcpFailed: [],
76152
- checkpoint: lt,
76153
- dataOpsController: yt,
76154
- skillsController: Yn ? Yn.controller : null,
76155
- infoTick: ge,
76156
- pendingConflict: he.pendingConflict,
76157
- pendingQuote: fr,
76158
- sessions: sr,
76159
- refreshSessions: () => yr.refreshSessions(),
76160
- liveData: St,
76161
- usage: me,
76162
- emit: Jn,
76163
- runSerial: cr,
76164
- trackActive: ur,
76165
- abortAllActive: dr,
76185
+ checkpoint: dt,
76186
+ dataOpsController: xt,
76187
+ skillsController: $n ? $n.controller : null,
76188
+ infoTick: ve,
76189
+ pendingConflict: _e.pendingConflict,
76190
+ pendingQuote: gr,
76191
+ sessions: dr,
76192
+ refreshSessions: () => Cr.refreshSessions(),
76193
+ liveData: wt,
76194
+ usage: ge,
76195
+ emit: Qn,
76196
+ runSerial: fr,
76197
+ trackActive: mr,
76198
+ abortAllActive: hr,
76166
76199
  unloadSkillTools(e) {
76167
76200
  if (e) {
76168
- let t = tn.length;
76169
- if (tn = tn.filter((t) => nn.get(t.name) === e ? (Dt.delete(t.name), nn.delete(t.name), !1) : !0), tn.length === t) return;
76201
+ let t = rn.length;
76202
+ if (rn = rn.filter((t) => an.get(t.name) === e ? (kt.delete(t.name), an.delete(t.name), !1) : !0), rn.length === t) return;
76170
76203
  } else {
76171
- if (!tn.length) return;
76172
- for (let e of tn) Dt.delete(e.name), nn.delete(e.name);
76173
- tn = [];
76204
+ if (!rn.length) return;
76205
+ for (let e of rn) kt.delete(e.name), an.delete(e.name);
76206
+ rn = [];
76174
76207
  }
76175
- an = rn(), R.agent && R.agent.setTools(an);
76208
+ sn = on(), R.agent && R.agent.setTools(sn);
76176
76209
  },
76177
76210
  applySnapshot(t) {
76178
76211
  var n, r, i;
76179
- if (t.vfs && Pe.hydrate && Pe.hydrate(t.vfs), (n = t.messages) != null && n.length && (Ne.push(...cCe(t.messages, (e) => {
76212
+ if (t.vfs && Ie.hydrate && Ie.hydrate(t.vfs), (n = t.messages) != null && n.length && (Fe.push(...cCe(t.messages, (e) => {
76180
76213
  var t;
76181
76214
  return (e ? (t = R.vfsStore) == null || (t = t.files) == null || (t = t[e]) == null ? void 0 : t.content : void 0) || void 0;
76182
- })), Re.markResumed()), (r = t.todos) != null && r.length && Fe.reset(t.todos), t.memory && !e.memory && qe.reset(t.memory), (i = t.checkpoints) != null && i.length && lt && lt.importStack(t.checkpoints), t.usage && Object.assign(me, t.usage), t.mission && sn && Ie.setMission(t.mission), t.workingMemory && cn && Ke.restore(t.workingMemory), t.planConfirmation && (ze.lastPlanConfirmation = t.planConfirmation), Yt) {
76215
+ })), Be.markResumed()), (r = t.todos) != null && r.length && Le.reset(t.todos), t.memory && !e.memory && Ye.reset(t.memory), (i = t.checkpoints) != null && i.length && dt && dt.importStack(t.checkpoints), t.usage && Object.assign(ge, t.usage), t.mission && ln && Re.setMission(t.mission), t.workingMemory && un && Je.restore(t.workingMemory), t.planConfirmation && (Ve.lastPlanConfirmation = t.planConfirmation), Zt) {
76183
76216
  let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
76184
76217
  if (r.length) {
76185
76218
  var a;
76186
- let t = (a = St()) == null ? void 0 : a.schema, n = t ? r.filter((e) => GQ(t, e.path)) : [];
76187
- if (n.length && (We.setFocus(null), n.forEach((e) => We.addFocus(Ge(e)))), e.debug && n.length < r.length) {
76219
+ let t = (a = wt()) == null ? void 0 : a.schema, n = t ? r.filter((e) => GQ(t, e.path)) : [];
76220
+ if (n.length && (Ke.setFocus(null), n.forEach((e) => Ke.addFocus(qe(e)))), e.debug && n.length < r.length) {
76188
76221
  let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
76189
76222
  console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
76190
76223
  }
76191
76224
  }
76192
76225
  }
76193
- gr();
76226
+ br();
76194
76227
  },
76195
76228
  addSkill(e) {
76196
- let t = Xn.findIndex((t) => t.name === e.name);
76197
- t >= 0 ? Xn[t] = e : Xn.push(e), er(), $n && $n.put(Zn(e));
76229
+ let t = er.findIndex((t) => t.name === e.name);
76230
+ t >= 0 ? er[t] = e : er.push(e), ir(), rr && rr.put(tr(e));
76198
76231
  },
76199
76232
  removeSkill(e) {
76200
- let t = Xn.findIndex((t) => t.name === e);
76201
- return t < 0 ? !1 : (Xn.splice(t, 1), er(), $n && $n.remove(e), !0);
76233
+ let t = er.findIndex((t) => t.name === e);
76234
+ return t < 0 ? !1 : (er.splice(t, 1), ir(), rr && rr.remove(e), !0);
76202
76235
  },
76203
76236
  listUserSkills() {
76204
- return Xn.map((e) => e.name);
76237
+ return er.map((e) => e.name);
76205
76238
  },
76206
76239
  getUserSkill(e) {
76207
- let t = Xn.find((t) => t.name === e);
76240
+ let t = er.find((t) => t.name === e);
76208
76241
  if (t) return {
76209
76242
  name: t.name,
76210
76243
  description: t.description,
@@ -76212,32 +76245,32 @@ function eIe(e, t, n) {
76212
76245
  };
76213
76246
  },
76214
76247
  afterRound() {
76215
- _r(), yr.persistRuntime();
76248
+ xr(), Cr.persistRuntime();
76216
76249
  },
76217
76250
  clearCodeReuse() {
76218
76251
  var e, t;
76219
- let n = Pe;
76252
+ let n = Ie;
76220
76253
  (e = n.__pgPendingRetry) == null || e.clear(), (t = n.__pgLastCheckout) == null || t.clear();
76221
76254
  },
76222
76255
  async send(e, t) {
76223
76256
  var n, r, i, a;
76224
76257
  if (await R.initDone, R.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 send");
76225
- t = (n = t) == null ? {} : n, t != null && t.mission && sn && Ie.setMission(t.mission);
76258
+ t = (n = t) == null ? {} : n, t != null && t.mission && ln && Re.setMission(t.mission);
76226
76259
  let o = e, s = ((r = t.images) == null ? [] : r).filter((e) => e && (e.dataUri || e.vfsRef || e.url));
76227
76260
  if (s.length > 4) throw Error(`[page-agent-sdk] 单轮最多 4 张图片(收到 ${s.length})`);
76228
- if (s.length && (await vr.stowImages(s), await vr.describeIfNeeded(s, o)), s.length && !Se.vision && !s.every((e) => e.description)) {
76261
+ if (s.length && (await Sr.stowImages(s), await Sr.describeIfNeeded(s, o)), s.length && !we.vision && !s.every((e) => e.description)) {
76229
76262
  let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述(集成方识图子 agent / 自有 vision API)";
76230
- throw Jn({
76263
+ throw Qn({
76231
76264
  type: "error",
76232
76265
  message: e,
76233
76266
  severity: "recoverable",
76234
76267
  code: "IMAGE_UNSUPPORTED_MODEL"
76235
76268
  }), Error(`[page-agent-sdk] ${e}`);
76236
76269
  }
76237
- Pe == null || (i = Pe.setProtectedRefs) == null || i.call(Pe, B8(Ne));
76238
- let c = mt ? (a = t.maxAutoRetries) == null ? 1 : a : 0, l = 0, u = !1, d = or(t.signal);
76270
+ Ie == null || (i = Ie.setProtectedRefs) == null || i.call(Ie, B8(Fe));
76271
+ let c = gt ? (a = t.maxAutoRetries) == null ? 1 : a : 0, l = 0, u = !1, d = ur(t.signal);
76239
76272
  if (t.signal) {
76240
- let e = () => he.resolve("keep_external");
76273
+ let e = () => _e.resolve("keep_external");
76241
76274
  t.signal.aborted ? e() : t.signal.addEventListener("abort", e, { once: !0 });
76242
76275
  }
76243
76276
  let f = R.sessionId;
@@ -76249,16 +76282,16 @@ function eIe(e, t, n) {
76249
76282
  let n = kZ(t.quote.anchor);
76250
76283
  e = j(j({ text: DZ(t.quote.text) }, t.quote.source ? { source: t.quote.source } : {}), n ? { anchor: n } : {});
76251
76284
  }
76252
- let n = (m = (h = e) == null ? fr.value : h) == null ? void 0 : m;
76253
- Ne.push(j(j({
76285
+ let n = (m = (h = e) == null ? gr.value : h) == null ? void 0 : m;
76286
+ Fe.push(j(j({
76254
76287
  role: "user",
76255
76288
  content: o,
76256
76289
  timestamp: Date.now()
76257
- }, s.length ? { images: s } : {}), n ? { quote: n } : {})), u = !0, !e && fr.value && (fr.value = null);
76290
+ }, s.length ? { images: s } : {}), n ? { quote: n } : {})), u = !0, !e && gr.value && (gr.value = null);
76258
76291
  }
76259
76292
  try {
76260
76293
  var g;
76261
- let e = await R.agent.invoke(Ne, t.signal, d);
76294
+ let e = await R.agent.invoke(Fe, t.signal, d);
76262
76295
  if ((g = t.signal) != null && g.aborted || R.sessionId !== f || R.refCount <= 0) {
76263
76296
  var _, v;
76264
76297
  return (_ = R.agent) == null || (_ = _.debugLogs) == null || (_ = _.value) == null || _.push({
@@ -76272,14 +76305,14 @@ function eIe(e, t, n) {
76272
76305
  }
76273
76306
  }), e;
76274
76307
  }
76275
- if (Ne.push({
76308
+ if (Fe.push({
76276
76309
  role: "assistant",
76277
76310
  content: e,
76278
76311
  timestamp: Date.now()
76279
- }), R.afterRound(), _e) try {
76280
- await _e.flush();
76312
+ }), R.afterRound(), ye) try {
76313
+ await ye.flush();
76281
76314
  } catch (e) {
76282
- Jn({
76315
+ Qn({
76283
76316
  type: "error",
76284
76317
  message: `落盘失败(不影响本轮回复):${e instanceof Error ? e.message : String(e)}`,
76285
76318
  severity: "observable",
@@ -76293,9 +76326,9 @@ function eIe(e, t, n) {
76293
76326
  if (GZ(e) && (n = j(j({}, n), {}, {
76294
76327
  code: "MODEL_UNAVAILABLE",
76295
76328
  message: e instanceof Error ? e.message : n.message
76296
- })), l < c && lt != null && lt.canRestore()) {
76329
+ })), l < c && dt != null && dt.canRestore()) {
76297
76330
  var y;
76298
- l += 1, lt.restore(), u = !0, Jn({
76331
+ l += 1, dt.restore(), u = !0, Qn({
76299
76332
  type: "error",
76300
76333
  message: `致命错误自动恢复(${l}/${c}):${n.message},已回退 checkpoint 重试`,
76301
76334
  severity: "observable",
@@ -76307,7 +76340,7 @@ function eIe(e, t, n) {
76307
76340
  });
76308
76341
  continue;
76309
76342
  }
76310
- throw Jn(j(j({
76343
+ throw Qn(j(j({
76311
76344
  type: "error",
76312
76345
  message: n.message,
76313
76346
  severity: n.severity
@@ -76319,9 +76352,9 @@ function eIe(e, t, n) {
76319
76352
  var r;
76320
76353
  if (await R.initDone, !e.length) return [];
76321
76354
  if (R.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
76322
- let i = [], a = or(n);
76323
- if (Pe == null || (r = Pe.setProtectedRefs) == null || r.call(Pe, B8(Ne)), n) {
76324
- let e = () => he.resolve("keep_external");
76355
+ let i = [], a = ur(n);
76356
+ if (Ie == null || (r = Ie.setProtectedRefs) == null || r.call(Ie, B8(Fe)), n) {
76357
+ let e = () => _e.resolve("keep_external");
76325
76358
  n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
76326
76359
  }
76327
76360
  for (let r = 0; r < e.length; r++) {
@@ -76335,23 +76368,23 @@ function eIe(e, t, n) {
76335
76368
  break;
76336
76369
  }
76337
76370
  let o = e[r];
76338
- lt && lt.save(`batch:${r}`);
76339
- let s = Ne.length;
76371
+ dt && dt.save(`batch:${r}`);
76372
+ let s = Fe.length;
76340
76373
  try {
76341
- Ne.push({
76374
+ Fe.push({
76342
76375
  role: "user",
76343
76376
  content: o,
76344
76377
  timestamp: Date.now()
76345
76378
  });
76346
- let s = await R.agent.invoke(Ne, n, a);
76347
- if (Ne.push({
76379
+ let s = await R.agent.invoke(Fe, n, a);
76380
+ if (Fe.push({
76348
76381
  role: "assistant",
76349
76382
  content: s,
76350
76383
  timestamp: Date.now()
76351
- }), R.afterRound(), _e) try {
76352
- await _e.flush();
76384
+ }), R.afterRound(), ye) try {
76385
+ await ye.flush();
76353
76386
  } catch (e) {
76354
- Jn({
76387
+ Qn({
76355
76388
  type: "error",
76356
76389
  message: `落盘失败(不影响本任务结果):${e instanceof Error ? e.message : String(e)}`,
76357
76390
  severity: "observable",
@@ -76370,7 +76403,7 @@ function eIe(e, t, n) {
76370
76403
  ok: !0
76371
76404
  });
76372
76405
  } catch (a) {
76373
- if (Ne.length > s && Ne.splice(s), FZ(a, n)) {
76406
+ if (Fe.length > s && Fe.splice(s), FZ(a, n)) {
76374
76407
  i.push({
76375
76408
  index: r,
76376
76409
  task: o,
@@ -76387,7 +76420,7 @@ function eIe(e, t, n) {
76387
76420
  }
76388
76421
  GZ(a);
76389
76422
  let c = xZ(a, "fatal");
76390
- Jn({
76423
+ Qn({
76391
76424
  type: "error",
76392
76425
  message: `批量任务 ${r + 1}/${e.length} 失败:${c.message}`,
76393
76426
  severity: "observable",
@@ -76411,10 +76444,10 @@ function eIe(e, t, n) {
76411
76444
  }
76412
76445
  return i;
76413
76446
  },
76414
- switchSession: (e) => yr.switchSession(e),
76415
- exportSession: (e) => yr.exportSession(e),
76416
- importSession: (e) => yr.importSession(e),
76417
- resetSession: () => yr.resetSession(),
76447
+ switchSession: (e) => Cr.switchSession(e),
76448
+ exportSession: (e) => Cr.exportSession(e),
76449
+ importSession: (e) => Cr.importSession(e),
76450
+ resetSession: () => Cr.resetSession(),
76418
76451
  stream: async (e, t, n) => {
76419
76452
  var r, i;
76420
76453
  if (!R.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
@@ -76422,51 +76455,51 @@ function eIe(e, t, n) {
76422
76455
  var t;
76423
76456
  return e.role === "user" && ((t = e.images) == null ? void 0 : t.length);
76424
76457
  });
76425
- if (!(a == null || (r = a.images) == null) && r.length && (await vr.stowImages(a.images), await vr.describeIfNeeded(a.images, a.content), !Se.vision && !a.images.every((e) => e.description))) {
76458
+ if (!(a == null || (r = a.images) == null) && r.length && (await Sr.stowImages(a.images), await Sr.describeIfNeeded(a.images, a.content), !we.vision && !a.images.every((e) => e.description))) {
76426
76459
  let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述";
76427
- throw Jn({
76460
+ throw Qn({
76428
76461
  type: "error",
76429
76462
  message: e,
76430
76463
  severity: "recoverable",
76431
76464
  code: "IMAGE_UNSUPPORTED_MODEL"
76432
76465
  }), Error(`[page-agent-sdk] ${e}`);
76433
76466
  }
76434
- Pe == null || (i = Pe.setProtectedRefs) == null || i.call(Pe, B8(e));
76467
+ Ie == null || (i = Ie.setProtectedRefs) == null || i.call(Ie, B8(e));
76435
76468
  let o = (e) => {
76436
- t == null || t(kt(e)), Jn(kt(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && R.infoTick.value++;
76469
+ t == null || t(jt(e)), Qn(jt(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && R.infoTick.value++;
76437
76470
  };
76438
76471
  if (n) {
76439
- let e = () => he.resolve("keep_external");
76472
+ let e = () => _e.resolve("keep_external");
76440
76473
  n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
76441
76474
  }
76442
- let { controller: s, untrack: c } = ur(n);
76475
+ let { controller: s, untrack: c } = mr(n);
76443
76476
  return R.agent.stream(e, o, s.signal).finally(c);
76444
76477
  },
76445
76478
  release() {
76446
76479
  if (R.refCount--, R.refCount <= 0) {
76447
- if (dr(), Gt = !0, _e) {
76480
+ if (hr(), qt = !0, ye) {
76448
76481
  var e;
76449
- (e = Pe.flush) == null || e.call(Pe), _e.flush(), _e.dispose();
76482
+ (e = Ie.flush) == null || e.call(Ie), ye.flush(), ye.dispose();
76450
76483
  }
76451
- $n && $n.dispose();
76484
+ rr && rr.dispose();
76452
76485
  let n = R.mcpClosers.splice(0);
76453
76486
  n.length && Promise.allSettled(n.map((e) => e())), V8.delete(t);
76454
76487
  }
76455
76488
  },
76456
- resolveConflict: he.resolve,
76489
+ resolveConflict: _e.resolve,
76457
76490
  setTools(e) {
76458
- Rt.length = 0, e.forEach((e) => {
76459
- Rt.push(e), Dt.set(e.name, "user");
76460
- }), an = rn(), R.agent && R.agent.setTools(an), R.infoTick.value++;
76491
+ Bt.length = 0, e.forEach((e) => {
76492
+ Bt.push(e), kt.set(e.name, "user");
76493
+ }), sn = on(), R.agent && R.agent.setTools(sn), R.infoTick.value++;
76461
76494
  },
76462
76495
  addTool(e) {
76463
- an.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
76464
- for (let t = Rt.length - 1; t >= 0; t--) Rt[t].name === e.name && Rt.splice(t, 1);
76465
- Rt.push(e), Dt.set(e.name, "user"), an = rn(), R.agent && R.agent.setTools(an), R.infoTick.value++;
76496
+ sn.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
76497
+ for (let t = Bt.length - 1; t >= 0; t--) Bt[t].name === e.name && Bt.splice(t, 1);
76498
+ Bt.push(e), kt.set(e.name, "user"), sn = on(), R.agent && R.agent.setTools(sn), R.infoTick.value++;
76466
76499
  },
76467
76500
  removeTool(e) {
76468
- let t = Rt.findIndex((t) => t.name === e);
76469
- return t < 0 ? !1 : (Rt.splice(t, 1), Dt.delete(e), an = rn(), R.agent && R.agent.setTools(an), R.infoTick.value++, !0);
76501
+ let t = Bt.findIndex((t) => t.name === e);
76502
+ return t < 0 ? !1 : (Bt.splice(t, 1), kt.delete(e), sn = on(), R.agent && R.agent.setTools(sn), R.infoTick.value++, !0);
76470
76503
  },
76471
76504
  setLlm(t) {
76472
76505
  var n, r, i, a, o, s, c;
@@ -76478,119 +76511,119 @@ function eIe(e, t, n) {
76478
76511
  if (((u = e.provider) == null ? "openai" : u) === "anthropic") throw Error("[page-agent-sdk][setLlm] 切换到 Anthropic 需传 BaseChatModel 实例(动态 import 无法同步);请先 const { ChatAnthropic } = await import(\"@langchain/anthropic\") 构造实例后传入");
76479
76512
  l = IG(e);
76480
76513
  }
76481
- typeof l.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), SMe(l, { emit: Jn }), Me = t;
76514
+ typeof l.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), SMe(l, { emit: Qn }), Pe = t;
76482
76515
  let d = Q6(t) ? void 0 : t;
76483
- if (Se = aF({
76516
+ if (we = aF({
76484
76517
  model: (n = (r = d == null ? void 0 : d.model) == null ? t.model : r) == null ? t.modelName : n,
76485
76518
  contextWindow: (i = e.contextWindow) == null ? d == null ? void 0 : d.contextWindow : i,
76486
76519
  maxOutputTokens: (a = e.maxOutputTokens) == null ? d == null ? void 0 : d.maxOutputTokens : a,
76487
76520
  vision: (o = d == null ? void 0 : d.vision) == null ? t.vision : o
76488
- }), Se.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${Se.contextWindow} 小于最小支持 ${eF}(需 ≥200K 窗口模型)`);
76521
+ }), we.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${we.contextWindow} 小于最小支持 ${eF}(需 ≥200K 窗口模型)`);
76489
76522
  if (R.agent) {
76490
76523
  var f, p;
76491
- R.agent.setLlm(l), (f = (p = R.agent).setModelCaps) == null || f.call(p, Se);
76524
+ R.agent.setLlm(l), (f = (p = R.agent).setModelCaps) == null || f.call(p, we);
76492
76525
  }
76493
- nr == null || (s = nr.setContextWindow) == null || s.call(nr, Se.contextWindow), Rn == null || (c = Rn.setContextWindow) == null || c.call(Rn, Se.contextWindow), R.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", Se);
76526
+ or == null || (s = or.setContextWindow) == null || s.call(or, we.contextWindow), Hn == null || (c = Hn.setContextWindow) == null || c.call(Hn, we.contextWindow), R.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", we);
76494
76527
  },
76495
76528
  setMemory(e) {
76496
- qe.reset(e), typeof e == "function" && qe.refresh(), R.infoTick.value++;
76529
+ Ye.reset(e), typeof e == "function" && Ye.refresh(), R.infoTick.value++;
76497
76530
  },
76498
76531
  refreshMemory() {
76499
- return qe.refresh();
76532
+ return Ye.refresh();
76500
76533
  },
76501
76534
  setSubagents(t) {
76502
- if (!Nn) {
76535
+ if (!Ln) {
76503
76536
  e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
76504
76537
  return;
76505
76538
  }
76506
- Nn.set(t), R.infoTick.value++;
76539
+ Ln.set(t), R.infoTick.value++;
76507
76540
  },
76508
76541
  addSubagent(t) {
76509
- if (!Nn) {
76542
+ if (!Ln) {
76510
76543
  e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
76511
76544
  return;
76512
76545
  }
76513
- Nn.add(t), R.infoTick.value++;
76546
+ Ln.add(t), R.infoTick.value++;
76514
76547
  },
76515
76548
  removeSubagent(t) {
76516
- if (!Nn) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
76517
- let n = Nn.remove(t);
76549
+ if (!Ln) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
76550
+ let n = Ln.remove(t);
76518
76551
  return n && R.infoTick.value++, n;
76519
76552
  },
76520
76553
  getActiveSubagents() {
76521
76554
  var e;
76522
- return (e = gn == null ? void 0 : gn.getActive()) == null ? [] : e;
76555
+ return (e = vn == null ? void 0 : vn.getActive()) == null ? [] : e;
76523
76556
  },
76524
76557
  get subagentHistory() {
76525
76558
  var e;
76526
- return (e = gn == null ? void 0 : gn.getHistory()) == null ? [] : e;
76559
+ return (e = vn == null ? void 0 : vn.getHistory()) == null ? [] : e;
76527
76560
  },
76528
76561
  getInfo() {
76529
76562
  var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, M, ee, te, N, P, ne, re, ie, ae, oe, se, ce, F;
76530
76563
  return j(j(j({
76531
76564
  id: t,
76532
76565
  sessionId: R.sessionId,
76533
- model: Q6(Me) ? (r = Me.model) == null ? Me.modelName : r : Me.model,
76534
- systemPrompt: (i = (a = R.agent) == null || (o = a.getEffectiveSystemPrompt) == null ? void 0 : o.call(a)) == null ? gt + h6(St(), e.schemaHint) : i,
76535
- tools: ((s = (c = R.agent) == null ? void 0 : c.allTools) == null ? an : s).map((e) => ({
76566
+ model: Q6(Pe) ? (r = Pe.model) == null ? Pe.modelName : r : Pe.model,
76567
+ systemPrompt: (i = (a = R.agent) == null || (o = a.getEffectiveSystemPrompt) == null ? void 0 : o.call(a)) == null ? vt + h6(wt(), e.schemaHint) : i,
76568
+ tools: ((s = (c = R.agent) == null ? void 0 : c.allTools) == null ? sn : s).map((e) => ({
76536
76569
  name: e.name,
76537
76570
  description: e.description,
76538
76571
  schema: e.schema,
76539
- source: Dt.get(e.name) || "user"
76572
+ source: kt.get(e.name) || "user"
76540
76573
  })),
76541
- skills: (Yn ? Yn.controller.get() : (l = e.skills) == null ? [] : l).map((e) => ({
76574
+ skills: ($n ? $n.controller.get() : (l = e.skills) == null ? [] : l).map((e) => ({
76542
76575
  name: e.name,
76543
76576
  description: e.description
76544
76577
  })),
76545
- data: St() ? {
76546
- description: St().description,
76547
- schema: St().schema
76578
+ data: wt() ? {
76579
+ description: wt().description,
76580
+ schema: wt().schema
76548
76581
  } : void 0,
76549
76582
  contextPreset: (u = e.contextPreset) == null ? "auto" : u,
76550
76583
  compression: {
76551
- contextWindow: Se.contextWindow,
76552
- summaryThresholdRatio: (d = L.summaryThresholdRatio) == null ? .5 : d,
76553
- promptSoftCap: i1(Se.contextWindow, L.promptSoftCapTokens)
76584
+ contextWindow: we.contextWindow,
76585
+ summaryThresholdRatio: (d = Ae.summaryThresholdRatio) == null ? .5 : d,
76586
+ promptSoftCap: i1(we.contextWindow, Ae.promptSoftCapTokens)
76554
76587
  },
76555
- memory: qe.get(),
76588
+ memory: Ye.get(),
76556
76589
  staleReadsInvalidated: (f = (p = R.agent) == null || (m = p.getStaleReadsInvalidated) == null ? void 0 : m.call(p)) == null ? 0 : f,
76557
- hostReadsInvalidated: Vn.readsInvalidated
76558
- }, Lt ? { proposals: Lt.snapshot() } : {}), n ? { hostWatch: j({}, n) } : {}), {}, {
76590
+ hostReadsInvalidated: Gn.readsInvalidated
76591
+ }, zt ? { proposals: zt.snapshot() } : {}), n ? { hostWatch: j({}, n) } : {}), {}, {
76559
76592
  llmRetries: (h = (g = R.agent) == null || (_ = g.getLlmRetries) == null ? void 0 : _.call(g)) == null ? 0 : h,
76560
76593
  llmCallFailures: (v = (y = R.agent) == null || (b = y.getLlmCallFailures) == null ? void 0 : b.call(y)) == null ? 0 : v,
76561
76594
  gates: (x = R.agent) == null || (S = x.getGateStats) == null ? void 0 : S.call(x),
76562
76595
  systemSegments: (C = (w = R.agent) == null || (T = w.getLastSystemSegments) == null ? void 0 : T.call(w)) == null ? [] : C,
76563
- middleware: ir.map((e) => e.name),
76596
+ middleware: cr.map((e) => e.name),
76564
76597
  todos: ((E = (D = R.agent) == null || (O = D.getState) == null || (O = O.call(D)) == null ? void 0 : O.todos) == null ? [] : E).map((e) => j(j(j(j({
76565
76598
  id: e.id,
76566
76599
  content: e.content,
76567
76600
  status: e.status
76568
76601
  }, e.parentId === void 0 ? {} : { parentId: e.parentId }), e.deps === void 0 ? {} : { deps: e.deps }), e.criteria === void 0 ? {} : { criteria: e.criteria }), e.evidence === void 0 ? {} : { evidence: e.evidence })),
76569
- planPhase: Fe.getPlanPhase(),
76570
- mission: sn ? Ie.getMission() : void 0,
76571
- planConfirmation: ze.lastPlanConfirmation,
76572
- workingMemory: cn ? Ke.getWorkingMemory() : void 0,
76573
- focus: Yt ? We.getFocus() : void 0,
76574
- focuses: Yt ? We.getFocuses() : [],
76602
+ planPhase: Le.getPlanPhase(),
76603
+ mission: ln ? Re.getMission() : void 0,
76604
+ planConfirmation: Ve.lastPlanConfirmation,
76605
+ workingMemory: un ? Je.getWorkingMemory() : void 0,
76606
+ focus: Zt ? Ke.getFocus() : void 0,
76607
+ focuses: Zt ? Ke.getFocuses() : [],
76575
76608
  actions: OFe((k = e.actions) == null ? {} : k),
76576
76609
  subagent: {
76577
- enabled: !!Dn,
76610
+ enabled: !!jn,
76578
76611
  maxDepth: (A = (M = e.subagent) == null ? void 0 : M.maxDepth) == null ? 1 : A,
76579
76612
  maxParallel: (ee = (te = e.subagent) == null ? void 0 : te.maxParallel) == null ? 4 : ee,
76580
76613
  timeoutMs: ((N = e.subagent) == null ? void 0 : N.timeoutMs) === void 0 ? 18e5 : e.subagent.timeoutMs > 0 ? e.subagent.timeoutMs : 0,
76581
76614
  allowedTools: (P = (ne = e.subagent) == null ? void 0 : ne.allowedTools) == null ? [] : P,
76582
- subagents: ((re = Nn == null ? void 0 : Nn.get()) == null ? [] : re).map(Pn),
76583
- active: (ie = gn == null ? void 0 : gn.getActive()) == null ? [] : ie,
76584
- history: (ae = gn == null ? void 0 : gn.getHistory()) == null ? [] : ae,
76585
- lockedComponents: (oe = kn == null ? void 0 : kn.locked()) == null ? {} : oe
76615
+ subagents: ((re = Ln == null ? void 0 : Ln.get()) == null ? [] : re).map(Rn),
76616
+ active: (ie = vn == null ? void 0 : vn.getActive()) == null ? [] : ie,
76617
+ history: (ae = vn == null ? void 0 : vn.getHistory()) == null ? [] : ae,
76618
+ lockedComponents: (oe = Nn == null ? void 0 : Nn.locked()) == null ? {} : oe
76586
76619
  },
76587
76620
  verify: {
76588
- enabled: !!Ln,
76589
- maxAttempts: bn ? _n : 0,
76590
- adversarial: bn && !!((se = e.verify) != null && se.adversarial)
76621
+ enabled: !!Vn,
76622
+ maxAttempts: Sn ? yn : 0,
76623
+ adversarial: Sn && !!((se = e.verify) != null && se.adversarial)
76591
76624
  },
76592
76625
  context: (() => {
76593
- let e = Rn == null ? void 0 : Rn.getSnapshot();
76626
+ let e = Hn == null ? void 0 : Hn.getSnapshot();
76594
76627
  if (e) {
76595
76628
  var t, n;
76596
76629
  let r = (t = R.agent) == null || (n = t.getState) == null || (n = n.call(t)) == null ? void 0 : n.lastCompression;
@@ -76600,10 +76633,10 @@ function eIe(e, t, n) {
76600
76633
  })(),
76601
76634
  mcp: j({ servers: R.mcpServers }, R.mcpFailed.length ? { failed: R.mcpFailed } : {}),
76602
76635
  lastCompression: (ce = R.agent) == null || (F = ce.getState) == null || (F = F.call(ce)) == null ? void 0 : F.lastCompression,
76603
- checkpoints: lt ? {
76636
+ checkpoints: dt ? {
76604
76637
  enabled: !0,
76605
- auto: ut,
76606
- list: lt.list()
76638
+ auto: ft,
76639
+ list: dt.list()
76607
76640
  } : void 0
76608
76641
  });
76609
76642
  },
@@ -76644,79 +76677,79 @@ function eIe(e, t, n) {
76644
76677
  }));
76645
76678
  },
76646
76679
  getMission() {
76647
- return sn ? Ie.getMission() : void 0;
76680
+ return ln ? Re.getMission() : void 0;
76648
76681
  },
76649
76682
  setMission(t) {
76650
- if (!sn) {
76683
+ if (!ln) {
76651
76684
  e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
76652
76685
  return;
76653
76686
  }
76654
- Ie.setMission(t), R.infoTick.value++;
76687
+ Re.setMission(t), R.infoTick.value++;
76655
76688
  },
76656
76689
  getFocus() {
76657
- return Yt ? We.getFocus() : void 0;
76690
+ return Zt ? Ke.getFocus() : void 0;
76658
76691
  },
76659
76692
  getFocuses() {
76660
- return Yt ? We.getFocuses() : [];
76693
+ return Zt ? Ke.getFocuses() : [];
76661
76694
  },
76662
76695
  setFocus(t) {
76663
- let n = $Fe(t, "setFocus", Yt, () => {
76696
+ let n = $Fe(t, "setFocus", Zt, () => {
76664
76697
  var e;
76665
- return (e = St()) == null ? void 0 : e.schema;
76698
+ return (e = wt()) == null ? void 0 : e.schema;
76666
76699
  }, e.debug);
76667
- return n.ok ? (We.setFocus(Ge(t)), e.debug && We.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), R.infoTick.value++, { ok: !0 }) : n;
76700
+ return n.ok ? (Ke.setFocus(qe(t)), e.debug && Ke.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), R.infoTick.value++, { ok: !0 }) : n;
76668
76701
  },
76669
76702
  addFocus(t) {
76670
- let n = $Fe(t, "addFocus", Yt, () => {
76703
+ let n = $Fe(t, "addFocus", Zt, () => {
76671
76704
  var e;
76672
- return (e = St()) == null ? void 0 : e.schema;
76705
+ return (e = wt()) == null ? void 0 : e.schema;
76673
76706
  }, e.debug);
76674
- return n.ok ? We.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
76707
+ return n.ok ? Ke.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
76675
76708
  ok: !1,
76676
76709
  error: "焦点数上限 8(避免 system prompt 撑爆)"
76677
- }) : (We.addFocus(Ge(t)), e.debug && We.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), R.infoTick.value++, { ok: !0 }) : n;
76710
+ }) : (Ke.addFocus(qe(t)), e.debug && Ke.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), R.infoTick.value++, { ok: !0 }) : n;
76678
76711
  },
76679
76712
  removeFocus(e) {
76680
- Yt && (We.removeFocus(e), R.infoTick.value++);
76713
+ Zt && (Ke.removeFocus(e), R.infoTick.value++);
76681
76714
  },
76682
76715
  clearFocus() {
76683
- Yt && (We.clearFocus(), R.infoTick.value++);
76716
+ Zt && (Ke.clearFocus(), R.infoTick.value++);
76684
76717
  },
76685
76718
  setQuote(e, t, n) {
76686
76719
  let r = DZ(e == null ? "" : e), i = kZ(n);
76687
- fr.value = r ? j(j({ text: r }, t ? { source: t } : {}), i ? { anchor: i } : {}) : null;
76720
+ gr.value = r ? j(j({ text: r }, t ? { source: t } : {}), i ? { anchor: i } : {}) : null;
76688
76721
  },
76689
76722
  notifyHostChange(e) {
76690
76723
  var t;
76691
76724
  let n = typeof (e == null ? void 0 : e.reason) == "string" ? e.reason.trim().slice(0, 200) : "";
76692
- Vn.epoch += 1, n && !Vn.notices.includes(n) ? Vn.notices.push(n) : n || Vn.notices.push(""), Vn.notices.length > 5 && Vn.notices.splice(0, Vn.notices.length - 5), (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
76725
+ Gn.epoch += 1, n && !Gn.notices.includes(n) ? Gn.notices.push(n) : n || Gn.notices.push(""), Gn.notices.length > 5 && Gn.notices.splice(0, Gn.notices.length - 5), (t = R.agent) == null || (t = t.debugLogs) == null || (t = t.value) == null || t.push({
76693
76726
  timestamp: Date.now(),
76694
76727
  type: "middleware",
76695
76728
  data: {
76696
76729
  stage: "host_change_notified",
76697
- epoch: Vn.epoch,
76730
+ epoch: Gn.epoch,
76698
76731
  reason: n || void 0
76699
76732
  }
76700
76733
  }), R.infoTick.value++;
76701
76734
  },
76702
76735
  clearQuote() {
76703
- fr.value = null;
76736
+ gr.value = null;
76704
76737
  },
76705
76738
  resolveProposal(e, t, n) {
76706
- let r = Lt ? Lt.resolve(e, t, n) : !1;
76739
+ let r = zt ? zt.resolve(e, t, n) : !1;
76707
76740
  return r && R.infoTick.value++, r;
76708
76741
  },
76709
76742
  getProposals() {
76710
- return Lt ? Lt.snapshot() : null;
76743
+ return zt ? zt.snapshot() : null;
76711
76744
  }
76712
76745
  };
76713
- async function pr() {
76714
- if (!_e) return;
76746
+ async function _r() {
76747
+ if (!ye) return;
76715
76748
  let n = async (e) => {
76716
76749
  try {
76717
- return await _e.load(t, e);
76750
+ return await ye.load(t, e);
76718
76751
  } catch (t) {
76719
- Jn({
76752
+ Qn({
76720
76753
  type: "error",
76721
76754
  message: `会话快照读取失败,已降级空会话:${t instanceof Error ? t.message : String(t)}`,
76722
76755
  severity: "observable",
@@ -76727,9 +76760,9 @@ function eIe(e, t, n) {
76727
76760
  }
76728
76761
  }, r = async () => {
76729
76762
  try {
76730
- return await _e.listSessions(t);
76763
+ return await ye.listSessions(t);
76731
76764
  } catch (e) {
76732
- return Jn({
76765
+ return Qn({
76733
76766
  type: "error",
76734
76767
  message: `会话列表读取失败,已降级新建会话:${e instanceof Error ? e.message : String(e)}`,
76735
76768
  severity: "observable",
@@ -76737,7 +76770,7 @@ function eIe(e, t, n) {
76737
76770
  }), [];
76738
76771
  }
76739
76772
  }, i = Symbol("storage-ready-timeout");
76740
- await Promise.race([_e.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"), Jn({
76773
+ await Promise.race([ye.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"), Qn({
76741
76774
  type: "error",
76742
76775
  message: "存储初始化 5s 未就绪(IDB blocked?),已放行降级运行",
76743
76776
  severity: "observable",
@@ -76749,12 +76782,12 @@ function eIe(e, t, n) {
76749
76782
  let e = await n(R.sessionId);
76750
76783
  if (e) {
76751
76784
  var o, s;
76752
- R.applySnapshot(e), Jn({
76785
+ R.applySnapshot(e), Qn({
76753
76786
  type: "session_restored",
76754
76787
  sessionId: R.sessionId,
76755
76788
  rounds: (o = (s = e.messages) == null ? void 0 : s.length) == null ? 0 : o
76756
76789
  });
76757
- } else await _e.createSession(t, a.title, R.sessionId);
76790
+ } else await ye.createSession(t, a.title, R.sessionId);
76758
76791
  } else if (a.autoResume !== !1) {
76759
76792
  let i = await r();
76760
76793
  if (e.debug && console.log("[page-agent-sdk][restore] listSessions", t, i.length, i.map((e) => e.sessionId)), i.length) {
@@ -76762,36 +76795,36 @@ function eIe(e, t, n) {
76762
76795
  let t = await n(R.sessionId);
76763
76796
  if (t) {
76764
76797
  var c, l, u, d;
76765
- R.applySnapshot(t), Jn({
76798
+ R.applySnapshot(t), Qn({
76766
76799
  type: "session_restored",
76767
76800
  sessionId: R.sessionId,
76768
76801
  rounds: (c = (l = t.messages) == null ? void 0 : l.length) == null ? 0 : c
76769
76802
  }), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", R.sessionId, `${(u = (d = t.messages) == null ? void 0 : d.length) == null ? 0 : u} msgs`);
76770
76803
  } else e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", R.sessionId);
76771
- } else R.sessionId = await _e.createSession(t, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", R.sessionId);
76772
- } else R.sessionId = await _e.createSession(t, a.title);
76773
- e.memory && yr.persistSave({ memory: qe.get() || (typeof e.memory == "string" ? e.memory : "") }), yr.refreshSessions();
76804
+ } else R.sessionId = await ye.createSession(t, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", R.sessionId);
76805
+ } else R.sessionId = await ye.createSession(t, a.title);
76806
+ e.memory && Cr.persistSave({ memory: Ye.get() || (typeof e.memory == "string" ? e.memory : "") }), Cr.refreshSessions();
76774
76807
  }
76775
- async function mr() {
76776
- await tr();
76808
+ async function vr() {
76809
+ await ar();
76777
76810
  }
76778
- function hr(e) {
76811
+ function yr(e) {
76779
76812
  let t = {};
76780
76813
  for (let n of B8(e)) {
76781
- let e = Pe.files[n];
76814
+ let e = Ie.files[n];
76782
76815
  e && (t[n] = e.content);
76783
76816
  }
76784
76817
  return t;
76785
76818
  }
76786
- function gr() {
76787
- let e = KFe(Pe.files, B8(Ne));
76788
- for (let t of e) delete Pe.files[t];
76819
+ function br() {
76820
+ let e = KFe(Ie.files, B8(Fe));
76821
+ for (let t of e) delete Ie.files[t];
76789
76822
  }
76790
- function _r() {
76791
- let e = BTe(Ne, ar);
76823
+ function xr() {
76824
+ let e = BTe(Fe, lr);
76792
76825
  if (!e.trimmed) return;
76793
76826
  let { older: t, summary: n } = e;
76794
- if (Jn({
76827
+ if (Qn({
76795
76828
  type: "context_trimmed",
76796
76829
  dropped: t.map((e) => ({
76797
76830
  round: e.round,
@@ -76802,61 +76835,61 @@ function eIe(e, t, n) {
76802
76835
  return (t = e.steps) == null ? [] : t;
76803
76836
  })
76804
76837
  })),
76805
- vfsResults: hr(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
76838
+ vfsResults: yr(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
76806
76839
  summary: n.content,
76807
76840
  reason: "max_memory_rounds"
76808
- }), Ne.splice(e.deleteFrom, e.deleteCount, n), gr(), ke && ye) {
76841
+ }), Fe.splice(e.deleteFrom, e.deleteCount, n), br(), je && xe) {
76809
76842
  let n = e.summary, { prevSeg: r } = e;
76810
76843
  (async () => {
76811
76844
  try {
76812
- let e = await ye(t1(t, je)), i = Ne.indexOf(n);
76845
+ let e = await xe(t1(t, Ne)), i = Fe.indexOf(n);
76813
76846
  if (i < 0) return;
76814
- Ne[i].content = zTe(t, r, e), yr.persistRuntime();
76847
+ Fe[i].content = zTe(t, r, e), Cr.persistRuntime();
76815
76848
  } catch (e) {}
76816
76849
  })();
76817
76850
  }
76818
76851
  }
76819
- let vr = pCe({
76852
+ let Sr = pCe({
76820
76853
  getConfig: () => e.images,
76821
- getVision: () => Se.vision === !0,
76822
- emit: Jn,
76854
+ getVision: () => we.vision === !0,
76855
+ emit: Qn,
76823
76856
  getVfsStore: () => R.vfsStore,
76824
- noteFailure: (e, t) => yr.notePersistFailure(e, t)
76825
- }), yr = sNe({
76857
+ noteFailure: (e, t) => Cr.notePersistFailure(e, t)
76858
+ }), Cr = sNe({
76826
76859
  agentId: t,
76827
76860
  options: e,
76828
- emit: Jn,
76829
- getStore: () => _e,
76861
+ emit: Qn,
76862
+ getStore: () => ye,
76830
76863
  core: R,
76831
- sessionsRef: sr,
76832
- sessionVars: ze,
76833
- messages: Ne,
76834
- getUsage: () => me,
76864
+ sessionsRef: dr,
76865
+ sessionVars: Ve,
76866
+ messages: Fe,
76867
+ getUsage: () => ge,
76835
76868
  mw: {
76836
- todosMw: Fe,
76837
- memoryMw: qe,
76838
- missionMw: Ie,
76839
- workingMemoryMw: Ke,
76840
- focusMw: We,
76841
- summarizationMw: nr,
76842
- resumeNoticeMw: Re,
76843
- useMission: sn,
76844
- useWorkingMemory: cn,
76845
- useFocus: Yt,
76846
- useAutomation: mt
76869
+ todosMw: Le,
76870
+ memoryMw: Ye,
76871
+ missionMw: Re,
76872
+ workingMemoryMw: Je,
76873
+ focusMw: Ke,
76874
+ summarizationMw: or,
76875
+ resumeNoticeMw: Be,
76876
+ useMission: ln,
76877
+ useWorkingMemory: un,
76878
+ useFocus: Zt,
76879
+ useAutomation: gt
76847
76880
  },
76848
- vfsStore: Pe,
76849
- checkpointMgr: lt,
76850
- conflictResolve: (e) => he.resolve(e),
76851
- abortAllActive: dr,
76852
- titleLlmInvoke: be
76881
+ vfsStore: Ie,
76882
+ checkpointMgr: dt,
76883
+ conflictResolve: (e) => _e.resolve(e),
76884
+ abortAllActive: hr,
76885
+ titleLlmInvoke: Se
76853
76886
  });
76854
76887
  return R.initDone = (async () => {
76855
76888
  var t, n, r, i;
76856
- await pr(), await mr(), (t = e.mcp) != null && t.length && FAe({
76889
+ await _r(), await vr(), (t = e.mcp) != null && t.length && FAe({
76857
76890
  servers: e.mcp,
76858
- emit: Jn,
76859
- isReleased: () => Gt,
76891
+ emit: Qn,
76892
+ isReleased: () => qt,
76860
76893
  core: {
76861
76894
  mcpClosers: R.mcpClosers,
76862
76895
  mcpServers: R.mcpServers,
@@ -76865,47 +76898,47 @@ function eIe(e, t, n) {
76865
76898
  },
76866
76899
  reservedNames: () => {
76867
76900
  let e = /* @__PURE__ */ new Set();
76868
- for (let t of an) {
76869
- let n = Dt.get(t.name);
76901
+ for (let t of sn) {
76902
+ let n = kt.get(t.name);
76870
76903
  n && !n.startsWith("mcp:") && e.add(t.name);
76871
76904
  }
76872
76905
  return e;
76873
76906
  },
76874
- pushTool: (e, t) => (Dt.set(e.name, `mcp:${t}`), Wt.push(e), !0),
76907
+ pushTool: (e, t) => (kt.set(e.name, `mcp:${t}`), Kt.push(e), !0),
76875
76908
  rebind: () => {
76876
- an = rn(), R.agent && R.agent.setTools(an), R.infoTick.value++;
76909
+ sn = on(), R.agent && R.agent.setTools(sn), R.infoTick.value++;
76877
76910
  },
76878
76911
  debug: e.debug
76879
76912
  });
76880
76913
  let a = Q6(e.llm) ? e.llm : await RG(e.llm);
76881
- SMe(a, { emit: Jn }), R.agent = VQ({
76914
+ SMe(a, { emit: Qn }), R.agent = VQ({
76882
76915
  llm: a,
76883
- systemPrompt: gt,
76884
- tools: an,
76885
- middleware: ir,
76916
+ systemPrompt: vt,
76917
+ tools: sn,
76918
+ middleware: cr,
76886
76919
  maxToolRounds: e.maxToolRounds,
76887
- hasSubagent: hn,
76888
- pageAssertionGate: dt.domInspect === !0,
76889
- pageReadTools: Ht.size ? Ht : void 0,
76890
- deferredWriteTools: Ut.size ? Ut : void 0,
76920
+ hasSubagent: _n,
76921
+ pageAssertionGate: pt.domInspect === !0,
76922
+ pageReadTools: Wt.size ? Wt : void 0,
76923
+ deferredWriteTools: Gt.size ? Gt : void 0,
76891
76924
  maxRetries: e.maxRetries,
76892
76925
  stallMs: (n = e.streamStallMs) == null ? BZ : n,
76893
76926
  streamMaxMs: (r = e.streamMaxDurationMs) == null ? BCe : r,
76894
76927
  toolTimeoutMs: e.toolTimeoutMs,
76895
76928
  maxParallelTools: e.maxParallelTools,
76896
- contextWindow: Se.contextWindow,
76897
- maxOutputTokens: Se.maxOutputTokens,
76898
- vision: Se.vision,
76899
- imageContentFormat: Mt,
76900
- maxVerifyAttempts: bn ? _n : 0,
76929
+ contextWindow: we.contextWindow,
76930
+ maxOutputTokens: we.maxOutputTokens,
76931
+ vision: we.vision,
76932
+ imageContentFormat: Pt,
76933
+ maxVerifyAttempts: Sn ? yn : 0,
76901
76934
  roundTokenBudget: (i = e.roundTokenBudget) == null ? 0 : i,
76902
76935
  staleReadInvalidation: e.staleReadInvalidation,
76903
76936
  onLlmChange: (e) => {
76904
- Me = e;
76937
+ Pe = e;
76905
76938
  },
76906
76939
  debug: e.debug
76907
- }), Je.current = R.agent, Mn && Mn.setReconfigureHook(() => {
76908
- R.agent && R.agent.setTools(rn());
76940
+ }), Xe.current = R.agent, In && In.setReconfigureHook(() => {
76941
+ R.agent && R.agent.setTools(on());
76909
76942
  });
76910
76943
  })(), R;
76911
76944
  }
@@ -91214,7 +91247,7 @@ var lGe = {
91214
91247
  _: 1
91215
91248
  })]));
91216
91249
  }
91217
- }), [["__scopeId", "data-v-ffd46605"]]), vYe = ["title"], yYe = /*#__PURE__*/ h9(/* @__PURE__ */ HJ({
91250
+ }), [["__scopeId", "data-v-6d9e98b4"]]), vYe = ["title"], yYe = /*#__PURE__*/ h9(/* @__PURE__ */ HJ({
91218
91251
  __name: "SelectionMenu",
91219
91252
  emits: ["quote"],
91220
91253
  setup(e, { emit: t }) {