@freecallai/pro 0.0.13 → 0.0.15

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/{FkpRichText.vue_vue_type_script_setup_true_lang-D-SOdFra.js → FkpRichText.vue_vue_type_script_setup_true_lang-DaSKjAe7.js} +246 -244
  3. package/dist/{KnowledgeArea-ClZoLiaZ.js → KnowledgeArea-BV2T5ecq.js} +1 -1
  4. package/dist/{KnowledgeArea.vue_vue_type_script_setup_true_lang-CoFF-WCe.js → KnowledgeArea.vue_vue_type_script_setup_true_lang-QJZNyAnH.js} +221 -223
  5. package/dist/{ToolForm-BK9epxdr.js → ToolForm-CJRw9QhZ.js} +1 -1
  6. package/dist/agent-prompt-editor/index.js +198 -179
  7. package/dist/agent-prompt-editor/legacy-converter/index.js +188 -162
  8. package/dist/{choice-UgePgrSl.js → choice-BZa68Gpl.js} +1 -1
  9. package/dist/{guard-DPwe4mCm.js → guard-CZOoBb3d.js} +271 -213
  10. package/dist/index-9-vUHS0W.js +15 -0
  11. package/dist/index-B4oT1Q9u.js +5 -0
  12. package/dist/index-BHgHsPrz.js +5 -0
  13. package/dist/index-Bd2S6qOP.js +19 -0
  14. package/dist/{index-CaA13lC9.js → index-BdSClCaD.js} +1 -1
  15. package/dist/{index-BIi3k45j.js → index-BwkcWrL6.js} +1 -1
  16. package/dist/{index-ChuzFuNm.js → index-Cn_sllKh.js} +1 -1
  17. package/dist/{index-DiLMgNEe.js → index-DvDbrMvv.js} +1 -1
  18. package/dist/{index-DfKH-RZq.js → index-OMoExOaa.js} +2 -2
  19. package/dist/{index-RHu4JIw7.js → index-WExTogRL.js} +1 -1
  20. package/dist/{index-v1UD08i6.js → index-w2M63UAJ.js} +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/{inline-CVF1zEsG.js → inline-BJJy0svW.js} +1 -1
  23. package/dist/{knowledge-DWM6tWnP.js → knowledge-B3aTxExW.js} +1 -1
  24. package/dist/media-extensions-CpwsEWCD.js +338 -0
  25. package/dist/{media-migration-BctCLEuT.js → media-migration-3-xnOp0T.js} +1 -1
  26. package/dist/{media-policy-B1UuSN2e.js → media-policy-BqquGDH1.js} +36 -36
  27. package/dist/{media-upload-DtH-oCtw.js → media-upload-AunEWyNv.js} +1 -1
  28. package/dist/{model-VLLhEQfn.js → model-aED-32GY.js} +10 -6
  29. package/dist/rich-text/index.js +6 -6
  30. package/dist/rich-text/legacy-converter/index.js +905 -842
  31. package/dist/style.css +1 -1
  32. package/dist/types/agent-prompt-editor/model.d.ts +1 -1
  33. package/dist/types/rich-text/config/descriptor.d.ts +2 -0
  34. package/dist/types/rich-text/model/qianniu-video.d.ts +1 -0
  35. package/dist/types/rich-text/plugins/noFollow/descriptor.d.ts +2 -0
  36. package/dist/types/rich-text/plugins/noFollow/index.d.ts +2 -0
  37. package/dist/types/rich-text/plugins/noFollow/token.d.ts +2 -0
  38. package/dist/types/rich-text/plugins/reasoningMarker/descriptor.d.ts +2 -0
  39. package/dist/types/rich-text/plugins/reasoningMarker/index.d.ts +2 -0
  40. package/dist/types/rich-text/plugins/reasoningMarker/token.d.ts +2 -0
  41. package/dist/types/rich-text/plugins/token-catalog.d.ts +2 -0
  42. package/dist/types/rich-text/public/types.d.ts +1 -1
  43. package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +6 -6
  44. package/package.json +3 -3
  45. package/dist/index-BMHUPL5x.js +0 -5
  46. package/dist/index-DJLfgC4v.js +0 -5
  47. package/dist/media-extensions-YYbGuUQa.js +0 -341
@@ -1,9 +1,9 @@
1
- import { ref as X, shallowRef as Rn, defineComponent as Uo, openBlock as A, createElementBlock as x, normalizeClass as Ne, createElementVNode as K, toDisplayString as le, createBlock as ve, unref as k, withCtx as G, createVNode as $, createTextVNode as he, createCommentVNode as ie, computed as oe, watch as be, Fragment as _e, renderList as an, getCurrentInstance as Ql, defineAsyncComponent as Ci, nextTick as ln, onMounted as Zl, onBeforeUnmount as ea, withKeys as Oo, withModifiers as io, normalizeStyle as Oi, createSlots as Po, resolveDynamicComponent as na, isRef as ta } from "vue";
1
+ import { ref as X, shallowRef as Rn, defineComponent as Uo, openBlock as A, createElementBlock as x, normalizeClass as Ne, createElementVNode as K, toDisplayString as ae, createBlock as ve, unref as k, withCtx as G, createVNode as $, createTextVNode as he, createCommentVNode as le, computed as ie, watch as be, Fragment as _e, renderList as an, getCurrentInstance as Ql, defineAsyncComponent as Ci, nextTick as ln, onMounted as Zl, onBeforeUnmount as ea, withKeys as Oo, withModifiers as io, normalizeStyle as Oi, createSlots as Po, resolveDynamicComponent as na, isRef as ta } from "vue";
2
2
  import { Button as de, Popover as ft, Switch as Pi, Input as oa, Drawer as ia, Popconfirm as la, Modal as Mo, Textarea as aa, Tooltip as sa, Message as Mi } from "@freecallai/ui";
3
3
  import Oe from "@freecallai/icons";
4
4
  import { IconExclamationCircleFill as ra, IconClose as ua } from "@freecallai/ui/es/icon/index.js";
5
- import { B as pn, D as Ji, a as qn, E as Wi, F as ca, G as Yi, h as fo, j as Bt, d as da, i as Ft, b as Fo, H as fa, g as so, z as pa, A as va, M as ga, I as ya, J as ma, p as xi } from "./guard-DPwe4mCm.js";
6
- import { m as $t, M as ka, a as ro, c as mt, b as xo, u as ba, d as We, e as Li, _ as ha } from "./media-policy-B1UuSN2e.js";
5
+ import { D as pn, E as Ji, a as qn, F as Wi, G as ca, H as Yi, h as fo, j as Bt, d as da, i as Ft, b as Fo, I as fa, g as so, A as pa, B as va, M as ga, J as ya, K as ma, p as xi } from "./guard-CZOoBb3d.js";
6
+ import { m as $t, M as ka, a as ro, c as mt, b as xo, u as ba, d as We, e as Li, _ as ha } from "./media-policy-BqquGDH1.js";
7
7
  import { e as Ln, a as pt } from "./types-PvYB5e85.js";
8
8
  import { _ as wa } from "./FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js";
9
9
  function Ut(t, o) {
@@ -103,15 +103,15 @@ function vt(t, o, l = Date.now()) {
103
103
  invalidPolicyInput: _
104
104
  })
105
105
  };
106
- const { remote: v } = o.config || {}, O = new Set(pn.map(Ce)), { policy: m } = o, h = (I) => pn.find((B) => Ce(B) === Ce(I)), N = (I) => {
106
+ const { remote: v } = o.config || {}, O = new Set(pn.map(Ce)), { policy: m } = o, h = (I) => pn.find((q) => Ce(q) === Ce(I)), N = (I) => {
107
107
  if (I.options === void 0) return !0;
108
- const B = h(I);
109
- return (B == null ? void 0 : B.optionKind) === "media" ? Ut(I.options, B.id) !== null : (B == null ? void 0 : B.optionKind) === "selection" ? Vo(I.options) !== null : !1;
108
+ const q = h(I);
109
+ return (q == null ? void 0 : q.optionKind) === "media" ? Ut(I.options, q.id) !== null : (q == null ? void 0 : q.optionKind) === "selection" ? Vo(I.options) !== null : !1;
110
110
  }, S = !!m && (!et(m, ["revision", "expiresAt", "allowed"]) || typeof m.revision != "string" || !m.revision || !Number.isFinite(m.expiresAt) || !Array.isArray(m.allowed) || !m.allowed.every(
111
111
  (I) => et(I, ["id", "slot", "options"]) && typeof I.id == "string" && typeof I.slot == "string" && O.has(Ce(I)) && N(I)
112
- ) || new Set(m.allowed.map(Ce)).size !== m.allowed.length), C = m && !S ? m.allowed : [], s = !!v && (v.status !== "ready" && v.status !== "unavailable" || typeof v.required != "boolean" || v.status === "ready" && !Number.isFinite(v.expiresAt)), W = (v == null ? void 0 : v.status) === "ready" && ((ce = v.snapshot) == null ? void 0 : ce.schemaVersion) !== 1, U = !!((Me = o.config) != null && Me.page) && o.config.page.schemaVersion !== 1, q = (I) => Array.isArray(I) && I.every(
113
- (B) => Aa(B) && O.has(Ce(B)) && N(B)
114
- ), Z = (v == null ? void 0 : v.status) === "ready" && !q((Se = v.snapshot) == null ? void 0 : Se.rules), w = !!((De = o.config) != null && De.page) && !q(o.config.page.rules), F = (v == null ? void 0 : v.status) === "ready" && !Z && !W ? v.snapshot.rules : [], re = (Ue = o.config) != null && Ue.page && !w && !U ? o.config.page.rules : [], D = (I) => new Set(I.map(Ce)).size !== I.length, ue = D(F) || D(re), fe = !!o.readonly || !!o.disabled || S || s || !!o.policy && o.policy.expiresAt <= l || W || U || Z || w || ue || (v == null ? void 0 : v.status) === "ready" && v.expiresAt <= l || (v == null ? void 0 : v.status) === "unavailable";
112
+ ) || new Set(m.allowed.map(Ce)).size !== m.allowed.length), C = m && !S ? m.allowed : [], s = !!v && (v.status !== "ready" && v.status !== "unavailable" || typeof v.required != "boolean" || v.status === "ready" && !Number.isFinite(v.expiresAt)), W = (v == null ? void 0 : v.status) === "ready" && ((ce = v.snapshot) == null ? void 0 : ce.schemaVersion) !== 1, U = !!((Me = o.config) != null && Me.page) && o.config.page.schemaVersion !== 1, V = (I) => Array.isArray(I) && I.every(
113
+ (q) => Aa(q) && O.has(Ce(q)) && N(q)
114
+ ), Z = (v == null ? void 0 : v.status) === "ready" && !V((Se = v.snapshot) == null ? void 0 : Se.rules), w = !!((De = o.config) != null && De.page) && !V(o.config.page.rules), F = (v == null ? void 0 : v.status) === "ready" && !Z && !W ? v.snapshot.rules : [], re = (Ue = o.config) != null && Ue.page && !w && !U ? o.config.page.rules : [], D = (I) => new Set(I.map(Ce)).size !== I.length, ue = D(F) || D(re), fe = !!o.readonly || !!o.disabled || S || s || !!o.policy && o.policy.expiresAt <= l || W || U || Z || w || ue || (v == null ? void 0 : v.status) === "ready" && v.expiresAt <= l || (v == null ? void 0 : v.status) === "unavailable";
115
115
  o.policy && o.policy.expiresAt <= l && i.push({
116
116
  code: "POLICY_EXPIRED",
117
117
  severity: "error",
@@ -153,23 +153,23 @@ function vt(t, o, l = Date.now()) {
153
153
  source: "config",
154
154
  message: "配置已过期,当前知识只能查看"
155
155
  });
156
- for (const [I, B] of [
156
+ for (const [I, q] of [
157
157
  ["remote", F],
158
158
  ["page", re]
159
159
  ]) {
160
- const ae = /* @__PURE__ */ new Set();
161
- for (const Te of B)
162
- ae.has(Ce(Te)) && i.push({
160
+ const te = /* @__PURE__ */ new Set();
161
+ for (const Te of q)
162
+ te.has(Ce(Te)) && i.push({
163
163
  code: "DUPLICATE_RULE",
164
164
  severity: "error",
165
165
  source: "config",
166
166
  message: `${I} 配置重复:${Ce(Te)}`,
167
167
  capabilityId: Te.id
168
- }), ae.add(Ce(Te));
168
+ }), te.add(Ce(Te));
169
169
  }
170
- const Pe = (I, B) => I == null ? void 0 : I.find((ae) => Ce(ae) === Ce(B)), Q = r.map((I) => {
170
+ const Pe = (I, q) => I == null ? void 0 : I.find((te) => Ce(te) === Ce(q)), Q = r.map((I) => {
171
171
  var wt;
172
- const B = (v == null ? void 0 : v.status) === "ready" && v.expiresAt > l ? Pe(F, I) : void 0, ae = Pe(re, I), Te = !o.policy || C.some((Ae) => Ce(Ae) === Ce(I)), Ke = (wt = I.actions) == null ? void 0 : wt.find(
172
+ const q = (v == null ? void 0 : v.status) === "ready" && v.expiresAt > l ? Pe(F, I) : void 0, te = Pe(re, I), Te = !o.policy || C.some((Ae) => Ce(Ae) === Ce(I)), Ke = (wt = I.actions) == null ? void 0 : wt.find(
173
173
  (Ae) => Ae.id === I.primaryActionId
174
174
  ), rn = [
175
175
  ...I.optionKind === "selection" && I.optionSource ? [] : (Ke == null ? void 0 : Ke.requiredPorts) || [],
@@ -207,11 +207,11 @@ function vt(t, o, l = Date.now()) {
207
207
  I.id
208
208
  ) || void 0,
209
209
  Ut(
210
- B == null ? void 0 : B.options,
210
+ q == null ? void 0 : q.options,
211
211
  I.id
212
212
  ) || void 0,
213
213
  Ut(
214
- ae == null ? void 0 : ae.options,
214
+ te == null ? void 0 : te.options,
215
215
  I.id
216
216
  ) || void 0
217
217
  ],
@@ -223,7 +223,7 @@ function vt(t, o, l = Date.now()) {
223
223
  capabilityId: I.id
224
224
  })
225
225
  ) : void 0, un = I.optionKind === "selection" ? Ia(
226
- [Ze == null ? void 0 : Ze.options, B == null ? void 0 : B.options, ae == null ? void 0 : ae.options].map(
226
+ [Ze == null ? void 0 : Ze.options, q == null ? void 0 : q.options, te == null ? void 0 : te.options].map(
227
227
  (Ae) => Ae === void 0 ? void 0 : Vo(Ae) || void 0
228
228
  ),
229
229
  () => i.push({
@@ -241,18 +241,18 @@ function vt(t, o, l = Date.now()) {
241
241
  message: `${I.id} 的可用媒体类型交集为空`,
242
242
  capabilityId: I.id
243
243
  });
244
- const zt = !fe && Te && !bt && (B == null ? void 0 : B.enabled) !== !1 && (ae == null ? void 0 : ae.enabled) !== !1, ht = zt && Fe;
244
+ const zt = !fe && Te && !bt && (q == null ? void 0 : q.enabled) !== !1 && (te == null ? void 0 : te.enabled) !== !1, ht = zt && Fe;
245
245
  return {
246
246
  ...I,
247
- label: (ae == null ? void 0 : ae.label) || (B == null ? void 0 : B.label) || I.label,
248
- order: (ae == null ? void 0 : ae.order) ?? (B == null ? void 0 : B.order) ?? I.order,
247
+ label: (te == null ? void 0 : te.label) || (q == null ? void 0 : q.label) || I.label,
248
+ order: (te == null ? void 0 : te.order) ?? (q == null ? void 0 : q.order) ?? I.order,
249
249
  canInsert: ht,
250
250
  canInsertProvided: zt,
251
251
  options: nt,
252
- visible: (B == null ? void 0 : B.visible) !== !1 && (ae == null ? void 0 : ae.visible) !== !1 && (ht || !Fe)
252
+ visible: (!I.toolbarOptIn || (te == null ? void 0 : te.visible) === !0 || (q == null ? void 0 : q.visible) === !0) && (q == null ? void 0 : q.visible) !== !1 && (te == null ? void 0 : te.visible) !== !1 && (ht || !Fe)
253
253
  };
254
254
  }).sort(
255
- (I, B) => I.order - B.order || I.id.localeCompare(B.id) || I.slot.localeCompare(B.slot)
255
+ (I, q) => I.order - q.order || I.id.localeCompare(q.id) || I.slot.localeCompare(q.slot)
256
256
  );
257
257
  return {
258
258
  type: t,
@@ -477,14 +477,14 @@ function yt(t) {
477
477
  }
478
478
  if (m.type === "businessToken") {
479
479
  if (l = !0, ((C = m.attrs) == null ? void 0 : C.kind) === "tool" && (m.attrs.key === "small_payment" && ++f > 1 && (p = !0), m.attrs.key === "order_note")) {
480
- const q = (s = m.attrs.params) == null ? void 0 : s.id;
481
- typeof q == "string" && y.has(q) && (p = !0), typeof q == "string" && y.add(q);
480
+ const V = (s = m.attrs.params) == null ? void 0 : s.id;
481
+ typeof V == "string" && y.has(V) && (p = !0), typeof V == "string" && y.add(V);
482
482
  }
483
483
  ((W = m.attrs) == null ? void 0 : W.kind) === "tool" && ((U = m.attrs) == null ? void 0 : U.params) == null && (r = !0);
484
484
  return;
485
485
  }
486
486
  if (m.type === "text" && typeof m.text == "string" && (o += m.text, uo(m.text) > 0 && (l = !0)), Array.isArray(m.content))
487
- for (const q of m.content) v(q);
487
+ for (const V of m.content) v(V);
488
488
  }
489
489
  };
490
490
  return t && v(t), {
@@ -518,7 +518,7 @@ function yr(t, o = {}) {
518
518
  const l = o.maxCharacters, i = typeof l == "number" && Number.isSafeInteger(l) && l > 0 ? Math.min(l, 2e3) : 2e3, r = [], d = /* @__PURE__ */ new Set();
519
519
  let f = 0;
520
520
  return t.forEach((p, y) => {
521
- var q, Z, w, F;
521
+ var V, Z, w, F;
522
522
  let _;
523
523
  try {
524
524
  if (qn(p) !== null)
@@ -545,7 +545,7 @@ function yr(t, o = {}) {
545
545
  sceneIndex: y,
546
546
  message: "知识数据版本不兼容"
547
547
  });
548
- const v = ((q = _.question) == null ? void 0 : q.text) || "", O = yt(
548
+ const v = ((V = _.question) == null ? void 0 : V.text) || "", O = yt(
549
549
  _.type === "agent" ? _.knowledge.agentBody || null : _.knowledge.doc
550
550
  ), m = yt(_.knowledge.retainedDoc || null);
551
551
  f += uo(v) + uo(O.text);
@@ -601,21 +601,23 @@ function yr(t, o = {}) {
601
601
  }
602
602
  const Ca = {
603
603
  "todo:questionAction": () => import("./question-C7akkjHn.js"),
604
- "todo:knowledgeInline": () => import("./knowledge-DWM6tWnP.js"),
605
- "tableKnowledge:knowledgeInline": () => import("./index-RHu4JIw7.js"),
606
- "ticket:knowledgeInline": () => import("./index-CaA13lC9.js"),
604
+ "todo:knowledgeInline": () => import("./knowledge-B3aTxExW.js"),
605
+ "tableKnowledge:knowledgeInline": () => import("./index-WExTogRL.js"),
606
+ "ticket:knowledgeInline": () => import("./index-BdSClCaD.js"),
607
607
  "originalReply:questionAction": () => import("./question-DXZ8R-34.js"),
608
608
  "originalReply:knowledgeBlock": () => import("./knowledge-DzwXQR-q.js"),
609
609
  "memory:questionAction": () => import("./index-9NM1SHoR.js"),
610
610
  "tagged:questionAction": () => import("./index-Dy2Gy3bL.js"),
611
- "attribute:knowledgeInline": () => import("./index-DiLMgNEe.js"),
612
- "tool:knowledgeInline": () => import("./index-DfKH-RZq.js"),
613
- "variable:knowledgeInline": () => import("./index-v1UD08i6.js"),
611
+ "attribute:knowledgeInline": () => import("./index-DvDbrMvv.js"),
612
+ "tool:knowledgeInline": () => import("./index-OMoExOaa.js"),
613
+ "variable:knowledgeInline": () => import("./index-w2M63UAJ.js"),
614
614
  "separator:knowledgeInline": () => import("./index-DnaEbb6l.js"),
615
- "image:knowledgeBlock": () => import("./index-BMHUPL5x.js"),
616
- "video:knowledgeBlock": () => import("./index-DJLfgC4v.js"),
617
- "reasoningPolish:sceneAction": () => import("./index-ChuzFuNm.js"),
618
- "reasoningTemplate:sceneAction": () => import("./index-BIi3k45j.js")
615
+ "noFollow:knowledgeInline": () => import("./index-9-vUHS0W.js"),
616
+ "reasoningMarker:knowledgeInline": () => import("./index-Bd2S6qOP.js"),
617
+ "image:knowledgeBlock": () => import("./index-BHgHsPrz.js"),
618
+ "video:knowledgeBlock": () => import("./index-B4oT1Q9u.js"),
619
+ "reasoningPolish:sceneAction": () => import("./index-Cn_sllKh.js"),
620
+ "reasoningTemplate:sceneAction": () => import("./index-BwkcWrL6.js")
619
621
  };
620
622
  function Vi(t, o) {
621
623
  if (!o || typeof o != "object") return !1;
@@ -1134,14 +1136,14 @@ function Ja(t) {
1134
1136
  S || (l.value = [], r.value = null, f.clear()), _();
1135
1137
  const s = new AbortController();
1136
1138
  p = s;
1137
- const W = ++y, U = o.value, q = (re = i.value.at(-1)) == null ? void 0 : re.id, Z = t.descriptor(N), w = Z == null ? void 0 : Z.options, F = w && "pageSize" in w ? w.pageSize ?? 30 : 30;
1139
+ const W = ++y, U = o.value, V = (re = i.value.at(-1)) == null ? void 0 : re.id, Z = t.descriptor(N), w = Z == null ? void 0 : Z.options, F = w && "pageSize" in w ? w.pageSize ?? 30 : 30;
1138
1140
  t.track(s, !0), d.value = !0;
1139
1141
  try {
1140
1142
  const D = Z ? await Ha(
1141
1143
  Z,
1142
1144
  {
1143
1145
  search: U,
1144
- ...q ? { parentId: q } : {},
1146
+ ...V ? { parentId: V } : {},
1145
1147
  ...C ? { cursor: C } : {},
1146
1148
  limit: F
1147
1149
  },
@@ -1422,9 +1424,9 @@ function Qa(t) {
1422
1424
  Q.type === "mediaBlock" && typeof Y == "string" && W.has(Y) && (ue.has(Y) ? fe.add(Y) : ue.set(Y, Q)), (Ve = Q.content) == null || Ve.forEach(Pe);
1423
1425
  };
1424
1426
  return D && Pe(D), fe.forEach((Q) => ue.delete(Q)), ue;
1425
- }, q = U(S.knowledge.doc), Z = U(C.knowledge.doc);
1427
+ }, V = U(S.knowledge.doc), Z = U(C.knowledge.doc);
1426
1428
  for (const [D, ue] of o) {
1427
- const fe = (w = t.editor()) == null ? void 0 : w.getMediaState(D), Pe = q.get(D), Q = Z.get(D);
1429
+ const fe = (w = t.editor()) == null ? void 0 : w.getMediaState(D), Pe = V.get(D), Q = Z.get(D);
1428
1430
  !fe || !Pe || !Q || fe.kind !== ue.kind || ((F = Q.attrs) == null ? void 0 : F.kind) !== ue.kind || !Number.isSafeInteger((re = Q.attrs) == null ? void 0 : re.nodeVersion) || Q.attrs.nodeVersion < 0 || Q.attrs.status !== "uploading" && Q.attrs.status !== "error" || (s.files.add(D), fe.status === Q.attrs.status && mt(Pe) === mt(Q) ? s.active.add(D) : Q.attrs.status === "uploading" && s.markFailed.push({
1429
1431
  id: D,
1430
1432
  nodeVersion: Q.attrs.nodeVersion
@@ -1506,8 +1508,8 @@ function Qa(t) {
1506
1508
  C.dispose();
1507
1509
  }
1508
1510
  if (U.length && W && ((ue = t.editor()) == null || ue.focus()), !U.length) return;
1509
- const q = t.sceneKey();
1510
- if ((fe = t.notify) == null || fe.call(t, "info", `正在上传 ${U.length} 个文件`), await Promise.all(U.map(h)), q !== t.sceneKey()) return;
1511
+ const V = t.sceneKey();
1512
+ if ((fe = t.notify) == null || fe.call(t, "info", `正在上传 ${U.length} 个文件`), await Promise.all(U.map(h)), V !== t.sceneKey()) return;
1511
1513
  const Z = U.map((Y) => {
1512
1514
  var Re;
1513
1515
  return (Re = t.editor()) == null ? void 0 : Re.getMediaState(Y);
@@ -1523,9 +1525,9 @@ function Qa(t) {
1523
1525
  const C = o.get(S), s = t.editor(), W = s == null ? void 0 : s.getMediaState(S);
1524
1526
  if (!C || C.controller || (W == null ? void 0 : W.status) !== "uploading" || W.kind !== C.kind)
1525
1527
  return;
1526
- const { file: U, kind: q } = C, Z = t.capability(q), w = Z == null ? void 0 : Z.primaryActionId, F = W.nodeVersion;
1528
+ const { file: U, kind: V } = C, Z = t.capability(V), w = Z == null ? void 0 : Z.primaryActionId, F = W.nodeVersion;
1527
1529
  if (!Z || !w) {
1528
- s != null && s.failMedia(S, "宿主未提供媒体上传接口", F) && t.diagnostic("PORT_MISSING", "宿主未提供媒体上传接口", "port", q);
1530
+ s != null && s.failMedia(S, "宿主未提供媒体上传接口", F) && t.diagnostic("PORT_MISSING", "宿主未提供媒体上传接口", "port", V);
1529
1531
  return;
1530
1532
  }
1531
1533
  const re = t.sceneKey(), D = new AbortController();
@@ -1536,17 +1538,17 @@ function Qa(t) {
1536
1538
  const De = await t.loadCapability(Z);
1537
1539
  if (D.signal.aborted || re !== t.sceneKey() || o.get(S) !== C)
1538
1540
  return;
1539
- if (!t.canUse(q)) {
1541
+ if (!t.canUse(V)) {
1540
1542
  (fe = t.editor()) == null || fe.failMedia(S, "媒体能力已失效,请删除后重试", F);
1541
1543
  return;
1542
1544
  }
1543
- const Ue = t.capability(q), xe = Ko(U, q, Ue);
1545
+ const Ue = t.capability(V), xe = Ko(U, V, Ue);
1544
1546
  if (xe) {
1545
1547
  (Pe = t.editor()) != null && Pe.failMedia(S, xe.message, F) && t.diagnostic(
1546
1548
  xe.code,
1547
1549
  xe.message,
1548
1550
  "validation",
1549
- q
1551
+ V
1550
1552
  );
1551
1553
  return;
1552
1554
  }
@@ -1556,7 +1558,7 @@ function Qa(t) {
1556
1558
  "PORT_MISSING",
1557
1559
  "宿主未提供媒体上传接口",
1558
1560
  "port",
1559
- q
1561
+ V
1560
1562
  );
1561
1563
  return;
1562
1564
  }
@@ -1566,21 +1568,21 @@ function Qa(t) {
1566
1568
  "PLUGIN_UNAVAILABLE",
1567
1569
  "媒体上传扩展不可用",
1568
1570
  "plugin",
1569
- q
1571
+ V
1570
1572
  );
1571
1573
  return;
1572
1574
  }
1573
- const I = t.context(q, D);
1575
+ const I = t.context(V, D);
1574
1576
  I.reportProgress = (Fe) => {
1575
1577
  var Ze;
1576
- !D.signal.aborted && re === t.sceneKey() && o.get(S) === C && t.canUse(q) && ((Ze = t.editor()) == null || Ze.reportMediaProgress(S, F, Fe));
1578
+ !D.signal.aborted && re === t.sceneKey() && o.get(S) === C && t.canUse(V) && ((Ze = t.editor()) == null || Ze.reportMediaProgress(S, F, Fe));
1577
1579
  };
1578
- const B = t.scene(), ae = await Be.execute(
1580
+ const q = t.scene(), te = await Be.execute(
1579
1581
  { upload: { file: U, nodeId: S, expectedNodeVersion: F } },
1580
1582
  {
1581
- scene: JSON.parse(JSON.stringify(B.scene)),
1583
+ scene: JSON.parse(JSON.stringify(q.scene)),
1582
1584
  sceneKey: re,
1583
- revision: B.revision,
1585
+ revision: q.revision,
1584
1586
  options: Ue == null ? void 0 : Ue.options,
1585
1587
  request: I,
1586
1588
  ports: qe
@@ -1588,30 +1590,30 @@ function Qa(t) {
1588
1590
  );
1589
1591
  if (D.signal.aborted || re !== t.sceneKey() || o.get(S) !== C)
1590
1592
  return;
1591
- if (!t.canUse(q)) {
1593
+ if (!t.canUse(V)) {
1592
1594
  (Re = t.editor()) == null || Re.failMedia(S, "媒体能力已失效,请删除后重试", F);
1593
1595
  return;
1594
1596
  }
1595
1597
  const Te = Ko(
1596
1598
  U,
1597
- q,
1598
- t.capability(q)
1599
+ V,
1600
+ t.capability(V)
1599
1601
  );
1600
1602
  if (Te) {
1601
1603
  (Ve = t.editor()) != null && Ve.failMedia(S, Te.message, F) && t.diagnostic(
1602
1604
  Te.code,
1603
1605
  Te.message,
1604
1606
  "validation",
1605
- q
1607
+ V
1606
1608
  );
1607
1609
  return;
1608
1610
  }
1609
1611
  const Ke = Kn(
1610
- ae,
1612
+ te,
1611
1613
  (Fe) => Array.isArray(Fe)
1612
1614
  );
1613
1615
  if (!Ke.ok) {
1614
- (ce = t.editor()) != null && ce.failMedia(S, Ke.error.message, F) && t.portDiagnostic(Ke.error, q);
1616
+ (ce = t.editor()) != null && ce.failMedia(S, Ke.error.message, F) && t.portDiagnostic(Ke.error, V);
1615
1617
  return;
1616
1618
  }
1617
1619
  const rn = nl(Z, Ke.data);
@@ -1620,15 +1622,15 @@ function Qa(t) {
1620
1622
  "PLUGIN_OPERATION_REJECTED",
1621
1623
  rn.ok ? "媒体扩展未返回节点更新" : rn.reason,
1622
1624
  "plugin",
1623
- q
1625
+ V
1624
1626
  );
1625
1627
  return;
1626
1628
  }
1627
- t.applyNodeUpdate(rn, q) && o.delete(S);
1629
+ t.applyNodeUpdate(rn, V) && o.delete(S);
1628
1630
  } catch (De) {
1629
1631
  if (!D.signal.aborted) {
1630
1632
  const Ue = De instanceof Error ? De.message : "上传失败";
1631
- (Se = t.editor()) != null && Se.failMedia(S, Ue, F) && t.diagnostic("PORT_FAILED", Ue, "port", q);
1633
+ (Se = t.editor()) != null && Se.failMedia(S, Ue, F) && t.diagnostic("PORT_FAILED", Ue, "port", V);
1632
1634
  }
1633
1635
  } finally {
1634
1636
  ue == null || ue(), C.controller === D && (C.controller = void 0), t.track(D, !1);
@@ -1870,7 +1872,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1870
1872
  }])
1871
1873
  }, [
1872
1874
  K("div", ts, [
1873
- K("strong", null, le(r[l.capabilityId].title), 1),
1875
+ K("strong", null, ae(r[l.capabilityId].title), 1),
1874
1876
  l.capabilityId !== "separator" ? (A(), ve(k(de), {
1875
1877
  key: 0,
1876
1878
  class: "fkp-capability-help-link",
@@ -1885,9 +1887,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1885
1887
  f[1] || (f[1] = he("我该怎么配? "))
1886
1888
  ]),
1887
1889
  _: 1
1888
- })) : ie("", !0)
1890
+ })) : le("", !0)
1889
1891
  ]),
1890
- K("p", null, le(r[l.capabilityId].description), 1)
1892
+ K("p", null, ae(r[l.capabilityId].description), 1)
1891
1893
  ], 2));
1892
1894
  }
1893
1895
  }), os = { class: "fkp-variable-columns" }, is = {
@@ -1916,20 +1918,20 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1916
1918
  function r(v) {
1917
1919
  return "group" in v && typeof v.group == "string" ? v.group.trim() : "";
1918
1920
  }
1919
- const d = oe(() => {
1921
+ const d = ie(() => {
1920
1922
  const v = [], O = /* @__PURE__ */ new Set();
1921
1923
  for (const m of l.options) {
1922
1924
  const h = r(m);
1923
1925
  h ? O.has(h) || (v.push({ kind: "group", label: h }), O.add(h)) : v.push({ kind: "option", option: m });
1924
1926
  }
1925
1927
  return v;
1926
- }), f = X(""), p = oe(
1928
+ }), f = X(""), p = ie(
1927
1929
  () => d.value.flatMap(
1928
1930
  (v) => v.kind === "group" ? [v.label] : []
1929
1931
  )
1930
- ), y = oe(
1932
+ ), y = ie(
1931
1933
  () => p.value.includes(f.value) ? f.value : p.value[0] || ""
1932
- ), _ = oe(
1934
+ ), _ = ie(
1933
1935
  () => y.value ? l.options.filter((v) => r(v) === y.value) : []
1934
1936
  );
1935
1937
  return be(
@@ -1946,7 +1948,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1946
1948
  class: "fkp-spin"
1947
1949
  }),
1948
1950
  O[1] || (O[1] = he("加载中… "))
1949
- ])) : !v.loading && !d.value.length ? (A(), x("p", as, " 暂无可选项 ")) : ie("", !0),
1951
+ ])) : !v.loading && !d.value.length ? (A(), x("p", as, " 暂无可选项 ")) : le("", !0),
1950
1952
  (A(!0), x(_e, null, an(d.value, (m) => (A(), x(_e, {
1951
1953
  key: m.kind === "group" ? `group:${m.label}` : `option:${m.option.id}`
1952
1954
  }, [
@@ -1962,7 +1964,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1962
1964
  onClick: (h) => f.value = m.label
1963
1965
  }, {
1964
1966
  default: G(() => [
1965
- K("span", ss, le(m.label), 1),
1967
+ K("span", ss, ae(m.label), 1),
1966
1968
  $(k(Oe), {
1967
1969
  class: "fkp-variable-group-arrow",
1968
1970
  name: "arrow-down",
@@ -1979,7 +1981,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1979
1981
  onClick: (h) => i("choose", m.option, h)
1980
1982
  }, {
1981
1983
  default: G(() => [
1982
- K("span", rs, le(m.option.label), 1)
1984
+ K("span", rs, ae(m.option.label), 1)
1983
1985
  ]),
1984
1986
  _: 2
1985
1987
  }, 1032, ["aria-label", "title", "disabled", "onClick"]))
@@ -1995,7 +1997,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
1995
1997
  he("加载更多")
1996
1998
  ])),
1997
1999
  _: 1
1998
- }, 8, ["disabled"])) : ie("", !0)
2000
+ }, 8, ["disabled"])) : le("", !0)
1999
2001
  ]),
2000
2002
  K("div", us, [
2001
2003
  (A(!0), x(_e, null, an(_.value, (m) => (A(), ve(k(de), {
@@ -2007,7 +2009,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2007
2009
  onClick: (h) => i("choose", m, h)
2008
2010
  }, {
2009
2011
  default: G(() => [
2010
- K("span", cs, le(m.label), 1)
2012
+ K("span", cs, ae(m.label), 1)
2011
2013
  ]),
2012
2014
  _: 2
2013
2015
  }, 1032, ["aria-label", "title", "disabled", "onClick"]))), 128))
@@ -2146,8 +2148,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2146
2148
  "noopener,noreferrer"
2147
2149
  );
2148
2150
  }
2149
- const m = (e) => e === "originalReply" || e === "memory" || e === "separator", h = () => import("./KnowledgeArea-ClZoLiaZ.js"), N = Ci(h), S = Ci(() => import("./ToolForm-BK9epxdr.js")), C = d(i.modelValue), s = X(C.scene), W = Rn(C.invalid), U = X(0), q = X([]), Z = /* @__PURE__ */ new Map(), w = X(null), F = Rn(null), re = X(0), D = X(null), ue = X(null), fe = X(null), Pe = Ja({
2150
- descriptor: (e) => te.value.capabilities.find(
2151
+ const m = (e) => e === "originalReply" || e === "memory" || e === "separator", h = () => import("./KnowledgeArea-BV2T5ecq.js"), N = Ci(h), S = Ci(() => import("./ToolForm-CJRw9QhZ.js")), C = d(i.modelValue), s = X(C.scene), W = Rn(C.invalid), U = X(0), V = X([]), Z = /* @__PURE__ */ new Map(), w = X(null), F = Rn(null), re = X(0), D = X(null), ue = X(null), fe = X(null), Pe = Ja({
2152
+ descriptor: (e) => oe.value.capabilities.find(
2151
2153
  (n) => n.id === e && n.optionKind === "selection"
2152
2154
  ),
2153
2155
  ports: () => i.ports,
@@ -2171,9 +2173,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2171
2173
  fetch: xe
2172
2174
  } = Pe, qe = X(!1);
2173
2175
  let Be = null, I = null;
2174
- const B = X(""), ae = X([]), Te = X("idle");
2176
+ const q = X(""), te = X([]), Te = X("idle");
2175
2177
  function Ke() {
2176
- B.value = "", ae.value = [], Te.value = "idle";
2178
+ q.value = "", te.value = [], Te.value = "idle";
2177
2179
  }
2178
2180
  const rn = X(!1), Fe = X({ uploading: 0, requesting: 0 }), Ze = X(), Ie = X(null), un = X(null), nt = X(!1), { suppressedMediaHint: bt, suppressMediaHint: zt, resumeMediaHintOnHover: ht } = ba(), wt = X({});
2179
2181
  let Ae = null, En = "";
@@ -2229,7 +2231,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2229
2231
  const je = Qa({
2230
2232
  editor: () => z.value,
2231
2233
  loadCapability: (e) => Bi(e, i.capabilityLoader),
2232
- capability: (e) => te.value.capabilities.find(
2234
+ capability: (e) => oe.value.capabilities.find(
2233
2235
  (n) => n.id === e && n.slot === "knowledgeBlock"
2234
2236
  ),
2235
2237
  canUse: (e) => Xe(e, "knowledgeBlock"),
@@ -2289,11 +2291,11 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2289
2291
  Wo,
2290
2292
  { immediate: !0 }
2291
2293
  );
2292
- const te = oe(
2294
+ const oe = ie(
2293
2295
  () => vt(s.value.type, i, Wt.value)
2294
- ), Yo = oe(
2295
- () => Gi(te.value.capabilities, s.value.knowledge.doc)
2296
- ), Xo = oe(
2296
+ ), Yo = ie(
2297
+ () => Gi(oe.value.capabilities, s.value.knowledge.doc)
2298
+ ), Xo = ie(
2297
2299
  () => Hi(Yo.value)
2298
2300
  );
2299
2301
  be(
@@ -2309,16 +2311,16 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2309
2311
  });
2310
2312
  }
2311
2313
  );
2312
- const Jn = oe(
2314
+ const Jn = ie(
2313
2315
  () => {
2314
2316
  var e;
2315
2317
  return ((e = W.value) == null ? void 0 : e.path) || Bt(s.value);
2316
2318
  }
2317
- ), il = oe(
2319
+ ), il = ie(
2318
2320
  () => Ro(
2319
2321
  W.value ? f(W.value.raw) : s.value.knowledge.doc || s.value.knowledge.agentBody || s.value.knowledge.retainedDoc
2320
2322
  )
2321
- ), Qo = oe(() => {
2323
+ ), Qo = ie(() => {
2322
2324
  var e;
2323
2325
  if (W.value || !((e = Jn.value) != null && e.startsWith("extensionState")))
2324
2326
  return null;
@@ -2327,31 +2329,31 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2327
2329
  } catch {
2328
2330
  return "扩展状态无法安全预览;原始数据仍保留。";
2329
2331
  }
2330
- }), ee = oe(
2331
- () => te.value.mode === "readonly" || !!Jn.value || rn.value
2332
- ), yo = oe(
2333
- () => te.value.capabilities.filter(
2332
+ }), ee = ie(
2333
+ () => oe.value.mode === "readonly" || !!Jn.value || rn.value
2334
+ ), yo = ie(
2335
+ () => oe.value.capabilities.filter(
2334
2336
  (e) => e.slot === "questionAction" && e.visible && e.toolbarVisible !== !1
2335
2337
  )
2336
- ), mo = oe(
2337
- () => te.value.capabilities.filter(
2338
+ ), mo = ie(
2339
+ () => oe.value.capabilities.filter(
2338
2340
  (e) => (e.slot === "knowledgeInline" || e.slot === "knowledgeBlock") && e.visible && e.toolbarVisible !== !1
2339
2341
  )
2340
- ), Zo = oe(
2341
- () => te.value.capabilities.filter(
2342
+ ), Zo = ie(
2343
+ () => oe.value.capabilities.filter(
2342
2344
  (e) => e.slot === "sceneAction" && e.visible && e.toolbarVisible !== !1
2343
2345
  )
2344
- ), Nt = oe(
2346
+ ), Nt = ie(
2345
2347
  () => Zo.value.find((e) => e.id === "agentSelect")
2346
2348
  );
2347
2349
  be(
2348
- () => [w.value, te.value.capabilities],
2350
+ () => [w.value, oe.value.capabilities],
2349
2351
  ([e, n]) => {
2350
2352
  e && e !== "type" && !n.some((a) => a.id === e && a.visible) && (Se(), w.value = null);
2351
2353
  },
2352
2354
  { flush: "sync" }
2353
2355
  );
2354
- const ei = oe(() => {
2356
+ const ei = ie(() => {
2355
2357
  const e = [];
2356
2358
  let n = 0;
2357
2359
  const a = (u, g, T, M = !1) => {
@@ -2376,14 +2378,14 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2376
2378
  "knowledge",
2377
2379
  mo.value.filter((u) => u.order > 40)
2378
2380
  )), a("questions", "question", yo.value)), e;
2379
- }), ko = oe(() => s.value.type === "reasoning" ? Zo.value.map((e, n) => ({
2381
+ }), ko = ie(() => s.value.type === "reasoning" ? Zo.value.map((e, n) => ({
2380
2382
  key: `${e.id}:${e.slot}`,
2381
2383
  kind: "scene",
2382
2384
  index: n,
2383
2385
  item: e
2384
- })) : s.value.type === "agent" ? [{ key: "agentOpen", kind: "agentOpen", index: 0 }] : []), bo = oe(
2386
+ })) : s.value.type === "agent" ? [{ key: "agentOpen", kind: "agentOpen", index: 0 }] : []), bo = ie(
2385
2387
  () => ei.value.flatMap((e) => e.actions)
2386
- ), ho = oe(
2388
+ ), ho = ie(
2387
2389
  () => bo.value.slice(Vn.value)
2388
2390
  );
2389
2391
  let _t, ni = 0;
@@ -2433,41 +2435,41 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2433
2435
  e.item && (e.kind === "question" ? To(e.item, n) : e.kind === "knowledge" && ii(e.item));
2434
2436
  }
2435
2437
  function li(e, n, a) {
2436
- const u = te.value.capabilities.find(
2438
+ const u = oe.value.capabilities.find(
2437
2439
  (g) => g.id === e && g.slot === "questionAction"
2438
2440
  );
2439
2441
  u && (a ? Rt(u, n) : Lt(u, n));
2440
2442
  }
2441
2443
  function al(e, n) {
2442
- const a = te.value.capabilities.find(
2444
+ const a = oe.value.capabilities.find(
2443
2445
  (u) => u.id === e && u.slot === "questionAction"
2444
2446
  );
2445
2447
  a && To(a, n);
2446
2448
  }
2447
- const dn = oe(() => s.value.knowledge.agentRef), sl = oe(
2449
+ const dn = ie(() => s.value.knowledge.agentRef), sl = ie(
2448
2450
  () => dn.value ? `${dn.value.name}${dn.value.invalid ? "(已失效)" : ""}` : ""
2449
- ), Wn = oe(
2451
+ ), Wn = ie(
2450
2452
  () => {
2451
2453
  var e, n;
2452
2454
  return !((e = dn.value) != null && e.invalid) && typeof ((n = dn.value) == null ? void 0 : n.id) == "string" ? dn.value.id.trim() : "";
2453
2455
  }
2454
- ), ai = oe(
2456
+ ), ai = ie(
2455
2457
  () => Gi([], s.value.knowledge.agentBody || null)
2456
- ), st = oe(
2458
+ ), st = ie(
2457
2459
  () => _a(s.value.knowledge.doc)
2458
2460
  );
2459
2461
  function Yn(e) {
2460
- return te.value.capabilities.some(
2462
+ return oe.value.capabilities.some(
2461
2463
  (n) => n.id === e && n.slot === "questionAction" && !!n.questionTag
2462
2464
  );
2463
2465
  }
2464
2466
  function Ot(e) {
2465
- return te.value.capabilities.some(
2467
+ return oe.value.capabilities.some(
2466
2468
  (n) => n.id === e && n.optionKind === "selection" && n.optionTrigger === "hover"
2467
2469
  );
2468
2470
  }
2469
- const wo = (e) => ma(s.value, e), si = oe(() => {
2470
- const e = [], n = te.value.capabilities.filter((a) => a.slot === "questionAction").sort((a, u) => a.order - u.order);
2471
+ const wo = (e) => ma(s.value, e), si = ie(() => {
2472
+ const e = [], n = oe.value.capabilities.filter((a) => a.slot === "questionAction").sort((a, u) => a.order - u.order);
2471
2473
  for (const a of n) {
2472
2474
  const u = a.questionTag;
2473
2475
  if (!u || !Xn(a.id) || !Yn(a.id)) continue;
@@ -2481,28 +2483,28 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2481
2483
  });
2482
2484
  }
2483
2485
  return e;
2484
- }), Pt = oe(
2485
- () => te.value.capabilities.find(
2486
+ }), Pt = ie(
2487
+ () => oe.value.capabilities.find(
2486
2488
  (e) => e.id === w.value && e.optionKind === "selection"
2487
2489
  )
2488
- ), Le = oe(() => {
2490
+ ), Le = ie(() => {
2489
2491
  var e;
2490
2492
  return (e = Pt.value) == null ? void 0 : e.menu;
2491
- }), ri = oe(
2493
+ }), ri = ie(
2492
2494
  () => !!Pt.value && Pt.value.optionSource !== "agents"
2493
- ), ui = oe(
2495
+ ), ui = ie(
2494
2496
  () => {
2495
2497
  var e;
2496
2498
  return ((e = Le.value) == null ? void 0 : e.searchLabel) || "搜索选项";
2497
2499
  }
2498
- ), ci = oe(
2500
+ ), ci = ie(
2499
2501
  () => {
2500
2502
  var e, n;
2501
2503
  return ((e = Le.value) == null ? void 0 : e.title) || ((n = Pt.value) == null ? void 0 : n.label) || "选择内容";
2502
2504
  }
2503
- ), di = oe(() => {
2505
+ ), di = ie(() => {
2504
2506
  var n, a;
2505
- const e = (n = te.value.capabilities.find(
2507
+ const e = (n = oe.value.capabilities.find(
2506
2508
  (u) => u.id === At.value && u.slot === "knowledgeBlock"
2507
2509
  )) == null ? void 0 : n.options;
2508
2510
  return e && "mimeTypes" in e && ((a = e.mimeTypes) != null && a.length) ? e.mimeTypes.filter(
@@ -2514,18 +2516,18 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2514
2516
  () => {
2515
2517
  vn(), F.value = null, On();
2516
2518
  const e = d(i.modelValue);
2517
- s.value = e.scene, W.value = e.invalid, U.value = 0, Z.clear(), q.value = [], Ke(), qe.value = !1, Be = null, I = null;
2519
+ s.value = e.scene, W.value = e.invalid, U.value = 0, Z.clear(), V.value = [], Ke(), qe.value = !1, Be = null, I = null;
2518
2520
  }
2519
2521
  ), be(
2520
2522
  () => d(i.modelValue),
2521
2523
  (e) => {
2522
2524
  if (e.invalid) {
2523
- vn(), F.value = null, On(), W.value = e.invalid, Z.clear(), q.value = [];
2525
+ vn(), F.value = null, On(), W.value = e.invalid, Z.clear(), V.value = [];
2524
2526
  return;
2525
2527
  }
2526
2528
  const n = We(e.scene);
2527
2529
  if (W.value) {
2528
- vn(), On(), s.value = e.scene, W.value = null, Z.clear(), q.value = [], Ke(), qe.value = !1, Be = null, I = null;
2530
+ vn(), On(), s.value = e.scene, W.value = null, Z.clear(), V.value = [], Ke(), qe.value = !1, Be = null, I = null;
2529
2531
  return;
2530
2532
  }
2531
2533
  if (n === We(s.value) || i.ackRevision > 0 && Z.get(i.ackRevision) === n)
@@ -2539,7 +2541,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2539
2541
  return;
2540
2542
  }
2541
2543
  const a = s.value.type !== e.scene.type, u = a ? void 0 : Pl(e.scene);
2542
- if (On(u), vn(), F.value = null, s.value = e.scene, Z.clear(), q.value = [], Ke(), a && (qe.value = !1), Be = null, I = null, u != null && u.markFailed.length) {
2544
+ if (On(u), vn(), F.value = null, s.value = e.scene, Z.clear(), V.value = [], Ke(), a && (qe.value = !1), Be = null, I = null, u != null && u.markFailed.length) {
2543
2545
  const { sceneKey: g } = i;
2544
2546
  ln(() => {
2545
2547
  var T, M, b;
@@ -2554,7 +2556,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2554
2556
  }
2555
2557
  }
2556
2558
  ), be(
2557
- () => te.value.diagnostics,
2559
+ () => oe.value.diagnostics,
2558
2560
  (e) => e.forEach(
2559
2561
  (n) => p("diagnostic", { ...n, sceneKey: i.sceneKey })
2560
2562
  ),
@@ -2608,10 +2610,10 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2608
2610
  return !1;
2609
2611
  F.value = null;
2610
2612
  const u = n === "typeSwitch" ? r(s.value) : null;
2611
- s.value = e, u ? q.value = [
2612
- ...q.value.slice(-19),
2613
+ s.value = e, u ? V.value = [
2614
+ ...V.value.slice(-19),
2613
2615
  u
2614
- ] : n !== "undo" && (q.value = []);
2616
+ ] : n !== "undo" && (V.value = []);
2615
2617
  const g = {
2616
2618
  sceneKey: i.sceneKey,
2617
2619
  revision: ++U.value,
@@ -2772,7 +2774,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2772
2774
  const T = qi(
2773
2775
  s.value.knowledge.doc,
2774
2776
  e,
2775
- te.value.capabilities
2777
+ oe.value.capabilities
2776
2778
  );
2777
2779
  if (T) {
2778
2780
  J(
@@ -2796,9 +2798,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2796
2798
  (R = z.value) == null || R.restoreDoc(s.value.knowledge.doc || Ln());
2797
2799
  return;
2798
2800
  }
2799
- const b = /* @__PURE__ */ new Set(), E = (V) => {
2801
+ const b = /* @__PURE__ */ new Set(), E = (B) => {
2800
2802
  var ne, j;
2801
- V.type === "mediaBlock" && typeof ((ne = V.attrs) == null ? void 0 : ne.id) == "string" && b.add(V.attrs.id), (j = V.content) == null || j.forEach(E);
2803
+ B.type === "mediaBlock" && typeof ((ne = B.attrs) == null ? void 0 : ne.id) == "string" && b.add(B.attrs.id), (j = B.content) == null || j.forEach(E);
2802
2804
  };
2803
2805
  E(e), je.removeAbsent(b);
2804
2806
  }
@@ -2820,7 +2822,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2820
2822
  return Bt(g) || qi(
2821
2823
  s.value.knowledge.doc,
2822
2824
  e,
2823
- te.value.capabilities
2825
+ oe.value.capabilities
2824
2826
  ) ? (J(
2825
2827
  "INVALID_RESPONSE",
2826
2828
  "接口返回的文档包含当前场景不可用的内容",
@@ -2840,7 +2842,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2840
2842
  In(e);
2841
2843
  }
2842
2844
  function Qn(e) {
2843
- const n = te.value.capabilities.find(
2845
+ const n = oe.value.capabilities.find(
2844
2846
  (a) => a.id === e && a.optionKind === "selection"
2845
2847
  );
2846
2848
  return n ? n.slot : "knowledgeInline";
@@ -2866,7 +2868,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2866
2868
  return {
2867
2869
  opened: e,
2868
2870
  locked: ee.value,
2869
- usable: !e || e === "type" || te.value.capabilities.some(
2871
+ usable: !e || e === "type" || oe.value.capabilities.some(
2870
2872
  (n) => n.id === e && n.slot === Qn(e) && n.canInsert
2871
2873
  )
2872
2874
  };
@@ -2894,7 +2896,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2894
2896
  function yi() {
2895
2897
  if (!w.value) return;
2896
2898
  const e = w.value;
2897
- te.value.capabilities.some(
2899
+ oe.value.capabilities.some(
2898
2900
  (n) => n.id === e && (n.slot === "knowledgeInline" || n.slot === "knowledgeBlock")
2899
2901
  ) && (tn(), me = !1, w.value = null);
2900
2902
  }
@@ -2906,7 +2908,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2906
2908
  (ye) => ye.id === e.id && ye.slot === e.slot && (T ? ye.canInsertProvided : ye.canInsert)
2907
2909
  ))
2908
2910
  return a == null || a.dispose(), b("CAPABILITY_REVOKED", "该扩展当前不可插入");
2909
- const V = e.slot === "knowledgeInline" || e.slot === "knowledgeBlock", ne = V && !E, j = ne ? a || (($e = z.value) == null ? void 0 : $e.captureMediaTarget()) : null;
2911
+ const B = e.slot === "knowledgeInline" || e.slot === "knowledgeBlock", ne = B && !E, j = ne ? a || (($e = z.value) == null ? void 0 : $e.captureMediaTarget()) : null;
2910
2912
  if (ne && !j)
2911
2913
  return J(
2912
2914
  "INSERT_TARGET_LOST",
@@ -2915,13 +2917,13 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
2915
2917
  e.id
2916
2918
  ), b("INSERT_TARGET_LOST", "原始插入位置已失效");
2917
2919
  j && jn.add(j);
2918
- const Ee = V ? null : `${e.id}:${e.slot}`;
2920
+ const Ee = B ? null : `${e.id}:${e.slot}`;
2919
2921
  Ee && ((dt = Gn.get(Ee)) == null || dt.abort());
2920
2922
  const pe = new AbortController();
2921
2923
  at.add(pe), Ee && Gn.set(Ee, pe);
2922
2924
  const c = U.value, H = i.sceneKey, { type: P } = s.value, se = r(s.value), kn = document.activeElement, Qe = u instanceof HTMLElement ? u : kn;
2923
2925
  let fn = !1;
2924
- const He = () => !pe.signal.aborted && (!g || g()) && H === i.sceneKey && P === s.value.type && (!j || jn.has(j)) && (V || c === U.value) && te.value.capabilities.some(
2926
+ const He = () => !pe.signal.aborted && (!g || g()) && H === i.sceneKey && P === s.value.type && (!j || jn.has(j)) && (B || c === U.value) && oe.value.capabilities.some(
2925
2927
  (ye) => ye.id === e.id && ye.slot === e.slot && (T ? ye.canInsertProvided : ye.canInsert)
2926
2928
  ) && vt(s.value.type, i).capabilities.some(
2927
2929
  (ye) => ye.id === e.id && ye.slot === e.slot && (T ? ye.canInsertProvided : ye.canInsert)
@@ -3047,7 +3049,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3047
3049
  return;
3048
3050
  }
3049
3051
  if (n.kind === "compound") {
3050
- const V = {
3052
+ const B = {
3051
3053
  ...s.value.extensionState,
3052
3054
  [e.id]: { version: e.dataVersion, data: n.data }
3053
3055
  }, { document: ne } = n;
@@ -3055,7 +3057,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3055
3057
  if (!gi(
3056
3058
  ne.doc,
3057
3059
  e.id,
3058
- V,
3060
+ B,
3059
3061
  ne.question
3060
3062
  ))
3061
3063
  return;
@@ -3066,7 +3068,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3066
3068
  ne.doc,
3067
3069
  "plugin",
3068
3070
  e.id,
3069
- V,
3071
+ B,
3070
3072
  ne.question
3071
3073
  ), e.id === "reasoningTemplate" && U.value !== c && (w.value = null);
3072
3074
  }
@@ -3085,7 +3087,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3085
3087
  );
3086
3088
  return;
3087
3089
  }
3088
- Mt(pe, "plugin", e.id, V);
3090
+ Mt(pe, "plugin", e.id, B);
3089
3091
  return;
3090
3092
  }
3091
3093
  const j = ne.kind === "batchNodes" ? ne.operations : [ne], Ee = (b = z.value) == null ? void 0 : b.previewPluginNodeOperations(j, e.id);
@@ -3098,7 +3100,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3098
3100
  );
3099
3101
  return;
3100
3102
  }
3101
- Mt(Ee, "plugin", e.id, V);
3103
+ Mt(Ee, "plugin", e.id, B);
3102
3104
  return;
3103
3105
  }
3104
3106
  if (n.kind === "replaceDoc") {
@@ -3109,7 +3111,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3109
3111
  n.question
3110
3112
  ))
3111
3113
  return;
3112
- const V = () => {
3114
+ const B = () => {
3113
3115
  if (Xe(e.id, e.slot)) {
3114
3116
  const ne = U.value;
3115
3117
  Mt(
@@ -3125,13 +3127,13 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3125
3127
  sceneKey: i.sceneKey,
3126
3128
  snapshot: We(s.value),
3127
3129
  proposed: Ro(n.doc),
3128
- apply: V
3129
- }, _n.value = "ready") : e.id === "reasoningTemplate" && !s.value.question.text.trim() && !st.value ? V() : e.id === "reasoningTemplate" && T ? pi(T, n.confirmation, V) : fi(n.confirmation, V);
3130
+ apply: B
3131
+ }, _n.value = "ready") : e.id === "reasoningTemplate" && !s.value.question.text.trim() && !st.value ? B() : e.id === "reasoningTemplate" && T ? pi(T, n.confirmation, B) : fi(n.confirmation, B);
3130
3132
  return;
3131
3133
  }
3132
3134
  if (n.kind === "updateNode" || n.kind === "removeNode" || n.kind === "batchNodes") {
3133
- const V = n.kind === "batchNodes" ? n.operations : [n];
3134
- if (["image", "video"].includes(e.id) && V.some((j) => j.kind === "updateNode")) {
3135
+ const B = n.kind === "batchNodes" ? n.operations : [n];
3136
+ if (["image", "video"].includes(e.id) && B.some((j) => j.kind === "updateNode")) {
3135
3137
  J(
3136
3138
  "PLUGIN_OPERATION_REJECTED",
3137
3139
  "媒体节点更新只能由对应节点的异步生命周期提交",
@@ -3143,7 +3145,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3143
3145
  ut = e.id;
3144
3146
  let ne = !1;
3145
3147
  try {
3146
- ne = ((E = z.value) == null ? void 0 : E.applyPluginNodeOperations(V, e.id)) || !1;
3148
+ ne = ((E = z.value) == null ? void 0 : E.applyPluginNodeOperations(B, e.id)) || !1;
3147
3149
  } finally {
3148
3150
  ut = null;
3149
3151
  }
@@ -3168,8 +3170,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3168
3170
  e.id
3169
3171
  );
3170
3172
  else {
3171
- const V = a ? (L = z.value) == null ? void 0 : L.insertBatch(n.content, a, u) : null;
3172
- if (!V) {
3173
+ const B = a ? (L = z.value) == null ? void 0 : L.insertBatch(n.content, a, u) : null;
3174
+ if (!B) {
3173
3175
  const j = !!a && a.status() !== "ready";
3174
3176
  J(
3175
3177
  j ? "INSERT_TARGET_LOST" : "INSERT_FAILED",
@@ -3180,7 +3182,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3180
3182
  return;
3181
3183
  }
3182
3184
  en(
3183
- { ...s.value, knowledge: { ...s.value.knowledge, doc: V } },
3185
+ { ...s.value, knowledge: { ...s.value.knowledge, doc: B } },
3184
3186
  "plugin",
3185
3187
  e.id
3186
3188
  ) || (R = z.value) == null || R.restoreDoc(s.value.knowledge.doc || Ln());
@@ -3247,8 +3249,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3247
3249
  Ie.value && !g(".fkp-media-source-menu") && (T == null ? void 0 : T.dataset.fkpMenuTrigger) !== Ie.value && Zn(), w.value && w.value !== "reasoningTemplate" && !g(".fkp-type-menu, .fkp-option-menu") && (T == null ? void 0 : T.dataset.fkpMenuTrigger) !== w.value && (w.value = null, me = !1, tn()), ge.value && !g(".fkp-more-menu") && (T == null ? void 0 : T.dataset.fkpMenuTrigger) !== "more" && (ge.value = !1), F.value && !g(".fkp-type-menu, .fkp-type-confirm") && (T == null ? void 0 : T.dataset.fkpMenuTrigger) !== "type" && Eo();
3248
3250
  }
3249
3251
  function ki() {
3250
- const e = q.value.at(-1);
3251
- return !e || ee.value || Fe.value.uploading > 0 || co(s.value) || !en(r(e), "undo") ? !1 : (q.value = q.value.slice(0, -1), On(), Ke(), qe.value = !1, Be = null, I = null, w.value = null, ln(() => {
3252
+ const e = V.value.at(-1);
3253
+ return !e || ee.value || Fe.value.uploading > 0 || co(s.value) || !en(r(e), "undo") ? !1 : (V.value = V.value.slice(0, -1), On(), Ke(), qe.value = !1, Be = null, I = null, w.value = null, ln(() => {
3252
3254
  var n, a;
3253
3255
  return (a = (n = bn.value) == null ? void 0 : n.querySelector("button")) == null ? void 0 : a.focus();
3254
3256
  }), !0);
@@ -3261,8 +3263,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3261
3263
  let u = !1;
3262
3264
  const g = be(
3263
3265
  [z, () => i.sceneKey, () => s.value.type, Jn],
3264
- ([E, L, R, V]) => {
3265
- L !== e || R !== n || V ? b(null) : E && b(E);
3266
+ ([E, L, R, B]) => {
3267
+ L !== e || R !== n || B ? b(null) : E && b(E);
3266
3268
  },
3267
3269
  { flush: "post" }
3268
3270
  ), T = setTimeout(() => b(null), 5e3), M = () => b(null);
@@ -3302,15 +3304,15 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3302
3304
  const R = document.activeElement;
3303
3305
  if (!en({ ...s.value, question: { text: L } }, "api"))
3304
3306
  return ke("INSERT_FAILED", "文字未能插入问法区");
3305
- const V = b.from + e.text.length;
3307
+ const B = b.from + e.text.length;
3306
3308
  I = {
3307
3309
  sceneKey: i.sceneKey,
3308
- from: V,
3309
- to: V,
3310
+ from: B,
3311
+ to: B,
3310
3312
  text: L
3311
3313
  };
3312
3314
  const ne = U.value;
3313
- return await ln(), n.isConnected && i.sceneKey === b.sceneKey && s.value.question.text === L && document.activeElement === R && (n.focus(), n.setSelectionRange(V, V)), { ok: !0, revision: ne };
3315
+ return await ln(), n.isConnected && i.sceneKey === b.sceneKey && s.value.question.text === L && document.activeElement === R && (n.focus(), n.setSelectionRange(B, B)), { ok: !0, revision: ne };
3314
3316
  }
3315
3317
  }
3316
3318
  const { sceneKey: a } = i, { type: u } = s.value;
@@ -3337,7 +3339,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3337
3339
  if (!T || T.status() !== "ready")
3338
3340
  return T == null || T.dispose(), ke("INSERT_TARGET_LOST", "知识区光标位置已失效");
3339
3341
  if (e.type === "capability") {
3340
- const b = te.value.capabilities.find(
3342
+ const b = oe.value.capabilities.find(
3341
3343
  (j) => j.id === e.capabilityId && (j.slot === "knowledgeInline" || j.slot === "knowledgeBlock") && j.implementation === "plugin"
3342
3344
  );
3343
3345
  if (!b || !So(b.id, b.slot) || b.optionKind === "media")
@@ -3368,7 +3370,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3368
3370
  return T.dispose(), ke(Ee.code, Ee.message, b.id);
3369
3371
  R.params = Ee.params;
3370
3372
  }
3371
- let V = null;
3373
+ let B = null;
3372
3374
  return await In(
3373
3375
  b,
3374
3376
  R ? { option: R } : {},
@@ -3377,9 +3379,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3377
3379
  void 0,
3378
3380
  !0,
3379
3381
  (j) => {
3380
- V = j;
3382
+ B = j;
3381
3383
  }
3382
- ) ? { ok: !0, revision: U.value } : V || {
3384
+ ) ? { ok: !0, revision: U.value } : B || {
3383
3385
  ok: !1,
3384
3386
  code: "PLUGIN_REJECTED",
3385
3387
  message: "扩展内容未能插入知识区"
@@ -3389,7 +3391,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3389
3391
  if (e.type === "media") {
3390
3392
  const { asset: R } = e;
3391
3393
  if (!R || Object.keys(R).some(
3392
- (V) => !["kind", "url", "id", "posterUrl"].includes(V)
3394
+ (B) => !["kind", "url", "id", "posterUrl"].includes(B)
3393
3395
  ) || R.kind !== "image" && R.kind !== "video" || !Ft(R.url) || R.posterUrl !== void 0 && !Ft(R.posterUrl) || R.id !== void 0 && (typeof R.id != "string" || !R.id.trim()) || e.name !== void 0 && typeof e.name != "string")
3394
3396
  return T.dispose(), ke("INVALID_INPUT", "媒体资源数据无效");
3395
3397
  if (!So(R.kind, "knowledgeBlock"))
@@ -3402,8 +3404,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3402
3404
  const b = s.value.knowledge.doc || Ln(), E = e.type === "text" ? z.value.insertBatch(
3403
3405
  e.text.replace(/\r\n?/gu, `
3404
3406
  `).split(`
3405
- `).flatMap((R, V) => [
3406
- ...V ? [{ type: "hardBreak" }] : [],
3407
+ `).flatMap((R, B) => [
3408
+ ...B ? [{ type: "hardBreak" }] : [],
3407
3409
  ...R ? [{ type: "text", text: R }] : []
3408
3410
  ]),
3409
3411
  T,
@@ -3474,7 +3476,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3474
3476
  var se, kn;
3475
3477
  if (fe.value = null, !(e instanceof HTMLElement) || !ze.value)
3476
3478
  return ue.value = null, !1;
3477
- const g = te.value.capabilities.find(
3479
+ const g = oe.value.capabilities.find(
3478
3480
  (Qe) => Qe.id === a && Qe.optionKind === "selection"
3479
3481
  ), T = (g == null ? void 0 : g.slot) === "questionAction" && g.questionTag ? e.closest(".fkp-action-toggle") : null, M = e.closest(".fkp-more-menu"), b = M ? ze.value.querySelector(".fkp-more-button") || e : T || e, E = ze.value.getBoundingClientRect(), L = ((se = g == null ? void 0 : g.menu) == null ? void 0 : se.width) || (n === "center" ? 320 : 296);
3480
3482
  if (M && ge.value) {
@@ -3499,11 +3501,11 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3499
3501
  }, !0;
3500
3502
  }
3501
3503
  }
3502
- const R = b.getBoundingClientRect(), V = M ? "viewport" : u, ne = V === "viewport" ? Math.min(
3504
+ const R = b.getBoundingClientRect(), B = M ? "viewport" : u, ne = B === "viewport" ? Math.min(
3503
3505
  L,
3504
3506
  Math.max(0, E.width - 32),
3505
3507
  Math.max(0, window.innerWidth - 32)
3506
- ) : L, j = R.left - E.left + R.width / 2, Ee = n === "center" ? j - ne / 2 : R.left - E.left, pe = V === "viewport" ? 8 - E.left : 8, c = V === "viewport" ? window.innerWidth - E.left - ne - 8 : E.width - ne - 8, H = Math.max(
3508
+ ) : L, j = R.left - E.left + R.width / 2, Ee = n === "center" ? j - ne / 2 : R.left - E.left, pe = B === "viewport" ? 8 - E.left : 8, c = B === "viewport" ? window.innerWidth - E.left - ne - 8 : E.width - ne - 8, H = Math.max(
3507
3509
  pe,
3508
3510
  Math.min(Ee, Math.max(pe, c))
3509
3511
  ), P = (kn = b.closest(".fkp-scene-toolbar")) == null ? void 0 : kn.getBoundingClientRect().bottom;
@@ -3560,7 +3562,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3560
3562
  const a = un.value, u = Ae;
3561
3563
  if (Ae = null, un.value = null, nt.value = !1, !(!a || !u))
3562
3564
  try {
3563
- const T = te.value.capabilities.find(
3565
+ const T = oe.value.capabilities.find(
3564
3566
  (b) => b.id === a && b.slot === "knowledgeBlock"
3565
3567
  );
3566
3568
  if (En !== i.sceneKey || ee.value || !(T != null && T.canInsertProvided) || u.status() !== "ready") {
@@ -3687,7 +3689,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3687
3689
  be(
3688
3690
  () => {
3689
3691
  var g, T;
3690
- const e = w.value, n = te.value, a = (g = n.capabilities.find(
3692
+ const e = w.value, n = oe.value, a = (g = n.capabilities.find(
3691
3693
  (M) => M.id === e && M.optionKind === "selection"
3692
3694
  )) == null ? void 0 : g.optionSource, u = a ? (T = i.ports) == null ? void 0 : T[Ji[a]] : void 0;
3693
3695
  return [e, u, n.fingerprint];
@@ -3707,7 +3709,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3707
3709
  J("CAPABILITY_REVOKED", "此能力当前不可用", "config", e);
3708
3710
  return;
3709
3711
  }
3710
- const u = te.value.capabilities.find(
3712
+ const u = oe.value.capabilities.find(
3711
3713
  (b) => b.id === e && b.optionKind === "selection"
3712
3714
  );
3713
3715
  if ((u == null ? void 0 : u.optionHierarchy) === "tree" && n.hasChildren) {
@@ -3736,7 +3738,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3736
3738
  J("INSERT_TARGET_LOST", "引用标签所属场景已变化", "plugin", e);
3737
3739
  return;
3738
3740
  }
3739
- const E = te.value.capabilities.find(
3741
+ const E = oe.value.capabilities.find(
3740
3742
  (L) => L.id === e && L.slot === "knowledgeInline"
3741
3743
  );
3742
3744
  if (!E) return;
@@ -3750,7 +3752,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3750
3752
  e === "reasoningTemplate" ? Qt() : w.value = null, me = !1, tn();
3751
3753
  const T = Ge;
3752
3754
  if (Ge = null, Yn(e) && Qn(e) === "questionAction") {
3753
- const b = te.value.capabilities.find(
3755
+ const b = oe.value.capabilities.find(
3754
3756
  (E) => E.id === e && E.slot === "questionAction"
3755
3757
  );
3756
3758
  b && await In(b, { option: n }), await kl(T, e);
@@ -3768,7 +3770,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3768
3770
  e
3769
3771
  );
3770
3772
  else {
3771
- const b = te.value.capabilities.find(
3773
+ const b = oe.value.capabilities.find(
3772
3774
  (E) => E.id === e && (E.slot === "knowledgeInline" || E.slot === "sceneAction")
3773
3775
  );
3774
3776
  if (b) {
@@ -3839,7 +3841,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3839
3841
  return;
3840
3842
  }
3841
3843
  e = T.params;
3842
- const M = te.value.capabilities.find(
3844
+ const M = oe.value.capabilities.find(
3843
3845
  (L) => L.id === "tool" && L.slot === "knowledgeInline"
3844
3846
  );
3845
3847
  if (!M) return;
@@ -3856,8 +3858,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3856
3858
  () => $n.value === u && Un.value === g
3857
3859
  ), $n.value !== u) return;
3858
3860
  Fn(), await ln();
3859
- const V = document.activeElement;
3860
- R && u.sceneKey === i.sceneKey && u.type === s.value.type && (V === document.body || V === a || V === n) && ((E = z.value) == null || E.focus());
3861
+ const B = document.activeElement;
3862
+ R && u.sceneKey === i.sceneKey && u.type === s.value.type && (B === document.body || B === a || B === n) && ((E = z.value) == null || E.focus());
3861
3863
  return;
3862
3864
  }
3863
3865
  const { target: b } = u;
@@ -3890,7 +3892,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3890
3892
  T,
3891
3893
  (b) => za(e, b)
3892
3894
  );
3893
- M.ok ? (B.value = M.data.prompt, ae.value = M.data.preview || [], Te.value = "ready") : (Te.value = "error", rt(M.error, "agentSelect"));
3895
+ M.ok ? (q.value = M.data.prompt, te.value = M.data.preview || [], Te.value = "ready") : (Te.value = "error", rt(M.error, "agentSelect"));
3894
3896
  } catch (T) {
3895
3897
  g() && (Te.value = "error", J(
3896
3898
  "PORT_FAILED",
@@ -3902,13 +3904,13 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
3902
3904
  Hn === a && (Hn = null), Ye.has(a) && mn(a, "requesting", !1);
3903
3905
  }
3904
3906
  }
3905
- const Co = oe(() => {
3907
+ const Co = ie(() => {
3906
3908
  var n;
3907
- const e = te.value.capabilities.find(
3909
+ const e = oe.value.capabilities.find(
3908
3910
  (a) => a.id === "agentSelect" && a.slot === "sceneAction"
3909
3911
  );
3910
3912
  return e ? (n = Oa(e, i.ports)) == null ? void 0 : n.getAgentPrompt : void 0;
3911
- }), wi = oe(() => dn.value ? Wn.value ? Co.value ? Te.value === "error" ? "Agent 提示词读取失败" : Te.value === "ready" ? B.value || "Agent 提示词为空" : "正在读取 Agent 提示词…" : "" : dn.value.invalid ? "Agent 已失效" : "Agent 尚未匹配 ID" : "选择 Agent 后,将在此处显示 Agent 提示词内容"), Bl = (e) => ({
3913
+ }), wi = ie(() => dn.value ? Wn.value ? Co.value ? Te.value === "error" ? "Agent 提示词读取失败" : Te.value === "ready" ? q.value || "Agent 提示词为空" : "正在读取 Agent 提示词…" : "" : dn.value.invalid ? "Agent 已失效" : "Agent 尚未匹配 ID" : "选择 Agent 后,将在此处显示 Agent 提示词内容"), Bl = (e) => ({
3912
3914
  todo: "rte-todo",
3913
3915
  cdp_tag: "rte-tag",
3914
3916
  separator: "sep",
@@ -4061,7 +4063,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4061
4063
  return ea(() => {
4062
4064
  vo = !0, po.forEach((e) => e()), yn(), vn(), Xt == null || Xt(), _t == null || _t.disconnect(), window.removeEventListener("resize", ti), document.removeEventListener("click", mi), St.forEach((e) => e.close()), St.clear(), On(), Et && clearTimeout(Et);
4063
4065
  }), (e, n) => {
4064
- var a, u, g, T, M, b, E, L, R, V, ne, j, Ee, pe;
4066
+ var a, u, g, T, M, b, E, L, R, B, ne, j, Ee, pe;
4065
4067
  return A(), x("section", {
4066
4068
  ref_key: "sceneRoot",
4067
4069
  ref: ze,
@@ -4100,7 +4102,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4100
4102
  trigger: "toolbar",
4101
4103
  disabled: ee.value,
4102
4104
  open: w.value === "type",
4103
- "aria-keyshortcuts": q.value.length ? "Control+Z Meta+Z" : void 0,
4105
+ "aria-keyshortcuts": V.value.length ? "Control+Z Meta+Z" : void 0,
4104
4106
  "onUpdate:open": Nl,
4105
4107
  onSelect: Al
4106
4108
  }, {
@@ -4144,7 +4146,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4144
4146
  _: 1
4145
4147
  })
4146
4148
  ])
4147
- ], 36)) : ie("", !0)
4149
+ ], 36)) : le("", !0)
4148
4150
  ]),
4149
4151
  _: 1
4150
4152
  }, 8, ["current-type", "mode", "disabled", "open", "aria-keyshortcuts"])
@@ -4170,7 +4172,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4170
4172
  onClick: n[3] || (n[3] = (H) => Lt(Nt.value, H))
4171
4173
  }, {
4172
4174
  default: G(() => [
4173
- he(le(sl.value || "选择 Agent") + " ", 1),
4175
+ he(ae(sl.value || "选择 Agent") + " ", 1),
4174
4176
  $(k(Oe), {
4175
4177
  name: "arrow-down",
4176
4178
  size: 12
@@ -4181,7 +4183,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4181
4183
  ];
4182
4184
  }),
4183
4185
  _: 1
4184
- })) : ie("", !0),
4186
+ })) : le("", !0),
4185
4187
  K("div", {
4186
4188
  ref_key: "toolbarLeft",
4187
4189
  ref: Gt,
@@ -4191,7 +4193,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4191
4193
  key: c.key
4192
4194
  }, [
4193
4195
  c.actions.some((P) => P.index < Vn.value) ? (A(), x(_e, { key: 0 }, [
4194
- H > 0 || s.value.type === "agent" && Nt.value ? (A(), x("span", ys)) : ie("", !0),
4196
+ H > 0 || s.value.type === "agent" && Nt.value ? (A(), x("span", ys)) : le("", !0),
4195
4197
  K("div", ms, [
4196
4198
  (A(!0), x(_e, null, an(c.actions, (P) => (A(), x(_e, {
4197
4199
  key: P.key
@@ -4229,7 +4231,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4229
4231
  name: P.item.icon,
4230
4232
  size: 16
4231
4233
  }, null, 8, ["name"]),
4232
- he(le(P.item.label), 1)
4234
+ he(ae(P.item.label), 1)
4233
4235
  ]),
4234
4236
  _: 2
4235
4237
  }, 1032, ["disabled", "aria-label", "aria-pressed", "onClick"]),
@@ -4289,7 +4291,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4289
4291
  name: P.item.icon,
4290
4292
  size: 16
4291
4293
  }, null, 8, ["name"]),
4292
- P.showLabel ? (A(), x("span", bs, le(P.item.label), 1)) : ie("", !0)
4294
+ P.showLabel ? (A(), x("span", bs, ae(P.item.label), 1)) : le("", !0)
4293
4295
  ]),
4294
4296
  _: 2
4295
4297
  }, 1032, ["data-fkp-menu-trigger", "disabled", "aria-label", "onMouseenter", "onPointerdownCapture", "onClick"])
@@ -4306,10 +4308,10 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4306
4308
  ]),
4307
4309
  key: "0"
4308
4310
  } : void 0
4309
- ]), 1032, ["content", "content-class", "popup-visible"])) : ie("", !0)
4311
+ ]), 1032, ["content", "content-class", "popup-visible"])) : le("", !0)
4310
4312
  ], 64))), 128))
4311
4313
  ])
4312
- ], 64)) : ie("", !0)
4314
+ ], 64)) : le("", !0)
4313
4315
  ], 64))), 128)),
4314
4316
  ho.value.length ? (A(), x("div", {
4315
4317
  key: 0,
@@ -4387,7 +4389,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4387
4389
  name: c.item ? c.item.icon : "open",
4388
4390
  size: 16
4389
4391
  }, null, 8, ["name"]),
4390
- he(le((($e = c.item) == null ? void 0 : $e.label) || "前往编辑 Agent"), 1)
4392
+ he(ae((($e = c.item) == null ? void 0 : $e.label) || "前往编辑 Agent"), 1)
4391
4393
  ];
4392
4394
  }),
4393
4395
  _: 2
@@ -4402,7 +4404,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4402
4404
  onMousedown: n[5] || (n[5] = io(() => {
4403
4405
  }, ["prevent"])),
4404
4406
  onChange: ($e) => Ao(c.item)
4405
- }, null, 8, ["model-value", "disabled", "aria-label", "onChange"])) : ie("", !0)
4407
+ }, null, 8, ["model-value", "disabled", "aria-label", "onChange"])) : le("", !0)
4406
4408
  ], 42, hs)
4407
4409
  ];
4408
4410
  }),
@@ -4420,8 +4422,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4420
4422
  } : void 0
4421
4423
  ]), 1032, ["content", "content-class", "popup-visible", "onPopupVisibleChange"]);
4422
4424
  }), 128))
4423
- ], 32)) : ie("", !0)
4424
- ], 34)) : ie("", !0)
4425
+ ], 32)) : le("", !0)
4426
+ ], 34)) : le("", !0)
4425
4427
  ], 512),
4426
4428
  ko.value.length ? (A(), x("div", ws, [
4427
4429
  n[29] || (n[29] = K("span", { class: "fkp-toolbar-divider" }, null, -1)),
@@ -4449,7 +4451,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4449
4451
  name: c.item.icon,
4450
4452
  size: 12
4451
4453
  }, null, 8, ["name"]),
4452
- he(le(c.item.label), 1)
4454
+ he(ae(c.item.label), 1)
4453
4455
  ]),
4454
4456
  _: 2
4455
4457
  }, 1032, ["class", "data-fkp-menu-trigger", "disabled", "onClick"])
@@ -4482,9 +4484,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4482
4484
  ];
4483
4485
  }),
4484
4486
  _: 2
4485
- }, 1024)) : ie("", !0)
4487
+ }, 1024)) : le("", !0)
4486
4488
  ], 64))), 128))
4487
- ])) : ie("", !0)
4489
+ ])) : le("", !0)
4488
4490
  ], 512),
4489
4491
  $(ha, {
4490
4492
  "menu-kind": Ie.value,
@@ -4521,21 +4523,21 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4521
4523
  Pn(), Zt();
4522
4524
  })
4523
4525
  }, [
4524
- w.value === "agentSelect" ? (A(), x("span", Ts)) : ie("", !0),
4526
+ w.value === "agentSelect" ? (A(), x("span", Ts)) : le("", !0),
4525
4527
  K("div", Is, [
4526
4528
  (u = Le.value) != null && u.badge ? (A(), x("span", {
4527
4529
  key: 0,
4528
4530
  class: Ne(Le.value.headingClass)
4529
4531
  }, [
4530
- K("strong", null, le(ci.value), 1),
4532
+ K("strong", null, ae(ci.value), 1),
4531
4533
  K("span", {
4532
4534
  class: Ne(Le.value.badge.className)
4533
- }, le(Le.value.badge.text), 3),
4535
+ }, ae(Le.value.badge.text), 3),
4534
4536
  K("span", {
4535
4537
  class: Ne(Le.value.badge.dotClass),
4536
4538
  "aria-hidden": "true"
4537
4539
  }, null, 2)
4538
- ], 2)) : (A(), x("strong", As, le(ci.value), 1)),
4540
+ ], 2)) : (A(), x("strong", As, ae(ci.value), 1)),
4539
4541
  Le.value ? (A(), ve(k(de), {
4540
4542
  key: 2,
4541
4543
  class: Ne(Le.value.helpClass),
@@ -4563,19 +4565,19 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4563
4565
  }))
4564
4566
  ]),
4565
4567
  (T = (g = Le.value) == null ? void 0 : g.warning) != null && T.length ? (A(), x("div", Ss, [
4566
- (A(!0), x(_e, null, an(Le.value.warning, (c) => (A(), x("p", { key: c }, le(c), 1))), 128))
4567
- ])) : ie("", !0),
4568
+ (A(!0), x(_e, null, an(Le.value.warning, (c) => (A(), x("p", { key: c }, ae(c), 1))), 128))
4569
+ ])) : le("", !0),
4568
4570
  (b = (M = Le.value) == null ? void 0 : M.guidance) != null && b.length ? (A(), ve(na(((L = (E = Le.value) == null ? void 0 : E.guidance) == null ? void 0 : L.length) === 1 ? "p" : "div"), {
4569
4571
  key: 2,
4570
4572
  class: Ne(Le.value.guidanceClass)
4571
4573
  }, {
4572
4574
  default: G(() => [
4573
4575
  Le.value.guidance.length === 1 ? (A(), x(_e, { key: 0 }, [
4574
- he(le(Le.value.guidance[0]), 1)
4575
- ], 64)) : (A(!0), x(_e, { key: 1 }, an(Le.value.guidance, (c) => (A(), x("p", { key: c }, le(c), 1))), 128))
4576
+ he(ae(Le.value.guidance[0]), 1)
4577
+ ], 64)) : (A(!0), x(_e, { key: 1 }, an(Le.value.guidance, (c) => (A(), x("p", { key: c }, ae(c), 1))), 128))
4576
4578
  ]),
4577
4579
  _: 1
4578
- }, 8, ["class"])) : ie("", !0),
4580
+ }, 8, ["class"])) : le("", !0),
4579
4581
  k(Re).length && w.value !== "variable" ? (A(), x("div", Es, [
4580
4582
  $(k(de), {
4581
4583
  type: "text",
@@ -4586,8 +4588,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4586
4588
  ])),
4587
4589
  _: 1
4588
4590
  }),
4589
- K("span", null, le(k(Re).map((c) => c.label).join(" / ")), 1)
4590
- ])) : ie("", !0),
4591
+ K("span", null, ae(k(Re).map((c) => c.label).join(" / ")), 1)
4592
+ ])) : le("", !0),
4591
4593
  K("div", {
4592
4594
  class: Ne(["fkp-menu-search", {
4593
4595
  "is-todo-search": ri.value,
@@ -4622,7 +4624,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4622
4624
  class: "fkp-spin"
4623
4625
  }),
4624
4626
  n[33] || (n[33] = he("加载中…"))
4625
- ])) : !k(ce) && !k(Y).length ? (A(), x("p", Cs, le(w.value === "ticket" ? "暂无可用工单场景" : "暂无可选项"), 1)) : ie("", !0),
4627
+ ])) : !k(ce) && !k(Y).length ? (A(), x("p", Cs, ae(w.value === "ticket" ? "暂无可用工单场景" : "暂无可选项"), 1)) : le("", !0),
4626
4628
  (A(!0), x(_e, null, an(k(Y), (c) => {
4627
4629
  var H, P, se;
4628
4630
  return A(), ve(k(de), {
@@ -4634,13 +4636,13 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4634
4636
  onClick: (kn) => _o(w.value, c, kn)
4635
4637
  }, {
4636
4638
  default: G(() => [
4637
- he(le(c.label), 1),
4639
+ he(ae(c.label), 1),
4638
4640
  c.hasChildren ? (A(), ve(k(Oe), {
4639
4641
  key: 0,
4640
4642
  class: "fkp-option-child-icon",
4641
4643
  name: "arrow-down",
4642
4644
  size: 14
4643
- })) : ie("", !0)
4645
+ })) : le("", !0)
4644
4646
  ]),
4645
4647
  _: 2
4646
4648
  }, 1032, ["aria-label", "aria-pressed", "disabled", "onClick"]);
@@ -4656,7 +4658,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4656
4658
  he("加载更多")
4657
4659
  ])),
4658
4660
  _: 1
4659
- }, 8, ["disabled"])) : ie("", !0)
4661
+ }, 8, ["disabled"])) : le("", !0)
4660
4662
  ])),
4661
4663
  w.value === "agentSelect" || w.value === "tagged" ? (A(), ve(k(de), {
4662
4664
  key: 6,
@@ -4668,8 +4670,8 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4668
4670
  he("去配置")
4669
4671
  ])),
4670
4672
  _: 1
4671
- })) : ie("", !0)
4672
- ], 38)) : ie("", !0),
4673
+ })) : le("", !0)
4674
+ ], 38)) : le("", !0),
4673
4675
  $(k(ia), {
4674
4676
  visible: w.value === "reasoningTemplate",
4675
4677
  title: "推理模板",
@@ -4686,7 +4688,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4686
4688
  K("p", null, " 推理适用于需要根据不同情况判断条件和对应处理规则的业务场景,AI 命中知识后会选择对应流程并结合实际信息进行回复或执行动作。 "),
4687
4689
  K("p", null, "您可以参考以下示例进行推理内容的配置:")
4688
4690
  ], -1)),
4689
- k(ce) ? (A(), x("p", Ps, "加载中…")) : k(Y).length ? ie("", !0) : (A(), x("p", Ms, "暂无可用模板")),
4691
+ k(ce) ? (A(), x("p", Ps, "加载中…")) : k(Y).length ? le("", !0) : (A(), x("p", Ms, "暂无可用模板")),
4690
4692
  (A(!0), x(_e, null, an(k(Y), (c) => {
4691
4693
  var H, P;
4692
4694
  return A(), x("div", {
@@ -4702,7 +4704,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4702
4704
  onClick: (se) => Nn.value = Nn.value === c.id ? null : c.id
4703
4705
  }, {
4704
4706
  default: G(() => [
4705
- he(le(c.label), 1),
4707
+ he(ae(c.label), 1),
4706
4708
  $(k(Oe), {
4707
4709
  class: "fkp-template-title-arrow",
4708
4710
  name: "arrow-down",
@@ -4712,7 +4714,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4712
4714
  _: 2
4713
4715
  }, 1032, ["aria-label", "aria-expanded", "disabled", "onClick"]),
4714
4716
  Nn.value === c.id ? (A(), x("div", xs, [
4715
- c.preview ? (A(), x("p", Ls, le(c.preview), 1)) : ie("", !0),
4717
+ c.preview ? (A(), x("p", Ls, ae(c.preview), 1)) : le("", !0),
4716
4718
  $(k(la), {
4717
4719
  type: "warning",
4718
4720
  position: "bottom",
@@ -4739,7 +4741,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4739
4741
  ]),
4740
4742
  _: 2
4741
4743
  }, 1032, ["content", "popup-visible"])
4742
- ])) : ie("", !0)
4744
+ ])) : le("", !0)
4743
4745
  ]);
4744
4746
  }), 128)),
4745
4747
  k(Ve) ? (A(), ve(k(de), {
@@ -4752,7 +4754,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4752
4754
  he("加载更多")
4753
4755
  ])),
4754
4756
  _: 1
4755
- }, 8, ["disabled"])) : ie("", !0)
4757
+ }, 8, ["disabled"])) : le("", !0)
4756
4758
  ])
4757
4759
  ]),
4758
4760
  _: 1
@@ -4795,20 +4797,20 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4795
4797
  ]))) : _n.value === "ready" && it.value ? (A(), x("div", Ds, [
4796
4798
  K("section", Ks, [
4797
4799
  n[40] || (n[40] = K("h3", null, "原文", -1)),
4798
- K("div", qs, le(Jo.value), 1)
4800
+ K("div", qs, ae(Jo.value), 1)
4799
4801
  ]),
4800
4802
  K("section", Vs, [
4801
4803
  n[41] || (n[41] = K("h3", null, "润色后", -1)),
4802
- K("div", Bs, le(it.value.proposed), 1)
4804
+ K("div", Bs, ae(it.value.proposed), 1)
4803
4805
  ])
4804
- ])) : (A(), x("div", $s, le(ot.value ? `润色失败:${ot.value}` : "润色失败,请稍后重试"), 1))
4806
+ ])) : (A(), x("div", $s, ae(ot.value ? `润色失败:${ot.value}` : "润色失败,请稍后重试"), 1))
4805
4807
  ]),
4806
4808
  _: 1
4807
4809
  }, 8, ["visible"]),
4808
4810
  k(Un) ? (A(), ve(k(Mo), {
4809
4811
  key: 1,
4810
4812
  visible: !0,
4811
- title: ((V = k($n)) == null ? void 0 : V.label) || "工具配置",
4813
+ title: ((B = k($n)) == null ? void 0 : B.label) || "工具配置",
4812
4814
  width: k(Un).toolId === "small_payment" ? 428 : k(Un).toolId === "order_note" ? 528 : 500,
4813
4815
  "modal-class": [
4814
4816
  "fkp-tool-modal",
@@ -4833,7 +4835,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4833
4835
  ];
4834
4836
  }),
4835
4837
  _: 1
4836
- }, 8, ["title", "width", "modal-class", "onCancel"])) : ie("", !0),
4838
+ }, 8, ["title", "width", "modal-class", "onCancel"])) : le("", !0),
4837
4839
  K("div", {
4838
4840
  class: Ne(["fkp-scene-body", { "has-knowledge-content": st.value }])
4839
4841
  }, [
@@ -4846,7 +4848,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4846
4848
  K("span", {
4847
4849
  class: Ne(["fkp-question-field", { "is-filled": !!s.value.question.text }])
4848
4850
  }, [
4849
- K("span", Fs, le(s.value.question.text || "填写顾客咨询意图,多种意图使用 / 分隔"), 1),
4851
+ K("span", Fs, ae(s.value.question.text || "填写顾客咨询意图,多种意图使用 / 分隔"), 1),
4850
4852
  $(k(aa), {
4851
4853
  "model-value": s.value.question.text,
4852
4854
  disabled: ee.value,
@@ -4884,7 +4886,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4884
4886
  name: c.icon,
4885
4887
  size: 16
4886
4888
  }, null, 8, ["name"]),
4887
- K("span", js, le(c.label), 1),
4889
+ K("span", js, ae(c.label), 1),
4888
4890
  $(k(Oe), {
4889
4891
  class: "fkp-question-tag-arrow",
4890
4892
  name: "arrow-down",
@@ -4893,16 +4895,16 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4893
4895
  ]),
4894
4896
  _: 2
4895
4897
  }, 1032, ["data-fkp-menu-trigger", "class", "disabled", "aria-label", "aria-expanded", "onMouseenter", "onPointerdownCapture", "onClick"]))), 128))
4896
- ])) : ie("", !0)
4898
+ ])) : le("", !0)
4897
4899
  ]),
4898
4900
  K("div", Gs, [
4899
4901
  Jn.value ? (A(), x("div", Hs, [
4900
- K("p", null, "此知识包含当前版本无法编辑的内容:" + le(Jn.value) + "。请升级扩展后编辑。", 1),
4901
- K("pre", Js, le(il.value), 1),
4902
+ K("p", null, "此知识包含当前版本无法编辑的内容:" + ae(Jn.value) + "。请升级扩展后编辑。", 1),
4903
+ K("pre", Js, ae(il.value), 1),
4902
4904
  Qo.value ? (A(), x(_e, { key: 0 }, [
4903
4905
  n[46] || (n[46] = K("p", null, "扩展状态(只读)", -1)),
4904
- K("pre", Ws, le(Qo.value), 1)
4905
- ], 64)) : ie("", !0)
4906
+ K("pre", Ws, ae(Qo.value), 1)
4907
+ ], 64)) : le("", !0)
4906
4908
  ])) : s.value.type !== "agent" ? (A(), ve(k(N), {
4907
4909
  ref_key: "area",
4908
4910
  ref: z,
@@ -4913,7 +4915,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4913
4915
  editable: !ee.value,
4914
4916
  "schema-plan": Yo.value,
4915
4917
  "document-adapter": k(Di),
4916
- "paste-capabilities": te.value.capabilities.filter((c) => c.canInsert),
4918
+ "paste-capabilities": oe.value.capabilities.filter((c) => c.canInsert),
4917
4919
  "active-choice-id": w.value === ((j = D.value) == null ? void 0 : j.kind) ? (Ee = D.value) == null ? void 0 : Ee.nodeId : null,
4918
4920
  placeholder: s.value.type === "reasoning" ? lr : "填写知识内容",
4919
4921
  onFocusin: hl,
@@ -4939,10 +4941,10 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4939
4941
  editable: !1,
4940
4942
  "schema-plan": ai.value,
4941
4943
  "document-adapter": k(Di)
4942
- }, null, 8, ["model-value", "tag-validity-port", "tag-validity-key", "schema-plan", "document-adapter"])) : ie("", !0),
4943
- Te.value === "ready" && ae.value.length ? (A(), x("div", Xs, [
4944
- (A(!0), x(_e, null, an(ae.value, (c, H) => (A(), x(_e, { key: H }, [
4945
- c.type === "text" ? (A(), x("span", Qs, le(c.text), 1)) : c.type === "break" ? (A(), x("br", Zs)) : c.type === "tag" ? (A(), x("span", {
4944
+ }, null, 8, ["model-value", "tag-validity-port", "tag-validity-key", "schema-plan", "document-adapter"])) : le("", !0),
4945
+ Te.value === "ready" && te.value.length ? (A(), x("div", Xs, [
4946
+ (A(!0), x(_e, null, an(te.value, (c, H) => (A(), x(_e, { key: H }, [
4947
+ c.type === "text" ? (A(), x("span", Qs, ae(c.text), 1)) : c.type === "break" ? (A(), x("br", Zs)) : c.type === "tag" ? (A(), x("span", {
4946
4948
  key: 2,
4947
4949
  class: Ne(["fkp-knowledge-tag fkp-agent-prompt-tag", `fkp-agent-prompt-tag--${c.kind}`]),
4948
4950
  "data-agent-tag": c.kind
@@ -4951,7 +4953,7 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4951
4953
  name: Bl(c.kind),
4952
4954
  size: 12
4953
4955
  }, null, 8, ["name"]),
4954
- he(le(c.label), 1)
4956
+ he(ae(c.label), 1)
4955
4957
  ], 10, er)) : c.kind === "image" ? (A(), x("img", {
4956
4958
  key: 3,
4957
4959
  class: "fkp-agent-prompt-media",
@@ -4967,9 +4969,9 @@ const ts = { class: "fkp-capability-help-head" }, qo = /* @__PURE__ */ Uo({
4967
4969
  ])) : wi.value ? (A(), x("div", {
4968
4970
  key: 2,
4969
4971
  class: Ne({
4970
- placeholder: !s.value.knowledge.agentBody && (Te.value !== "ready" || !B.value)
4972
+ placeholder: !s.value.knowledge.agentBody && (Te.value !== "ready" || !q.value)
4971
4973
  })
4972
- }, le(wi.value), 3)) : ie("", !0)
4974
+ }, ae(wi.value), 3)) : le("", !0)
4973
4975
  ]))
4974
4976
  ]),
4975
4977
  $(k(sa), {