@freecallai/pro 0.0.14 → 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 (46) 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/package.json +1 -1
  44. package/dist/index-BMHUPL5x.js +0 -5
  45. package/dist/index-DJLfgC4v.js +0 -5
  46. package/dist/media-extensions-YYbGuUQa.js +0 -341
@@ -1,7 +1,7 @@
1
- import { c as L } from "../../media-id-b2dgniSy.js";
2
- import { i as N, f as x } from "../../guard-DPwe4mCm.js";
3
- import { f as I, v as U } from "../../model-VLLhEQfn.js";
4
- const O = 1024 * 1024, V = 1e4, _ = /[\u200b-\u200d\ufeff]/gu, R = /#@|##|\$\$小额打款@|\{(?:待办|业务属性|属性|分隔符|原话复述|变量|自定义Agent|推理)|\[sep\]|<\s*(?:img|video)\b/iu, T = /* @__PURE__ */ new Set(["DIV", "P", "LI", "SECTION", "ARTICLE"]), M = /* @__PURE__ */ new Set([
1
+ import { c as x } from "../../media-id-b2dgniSy.js";
2
+ import { i as T, f as U } from "../../guard-CZOoBb3d.js";
3
+ import { f as R, v as V } from "../../model-aED-32GY.js";
4
+ const O = 1024 * 1024, z = 1e4, P = /[\u200b-\u200d\ufeff]/gu, M = /<不发送跟单>|#@|##|\$\$小额打款@|\{(?:待办|业务属性|属性|分隔符|原话复述|变量|自定义Agent|推理)|\[sep\]|<\s*(?:img|video)\b/iu, $ = /* @__PURE__ */ new Set(["DIV", "P", "LI", "SECTION", "ARTICLE"]), I = /* @__PURE__ */ new Set([
5
5
  "SPAN",
6
6
  "B",
7
7
  "STRONG",
@@ -20,13 +20,13 @@ function m(t, e, a) {
20
20
  function g(t) {
21
21
  return t.replace(/&/gu, "&amp;").replace(/</gu, "&lt;").replace(/>/gu, "&gt;").replace(/"/gu, "&quot;");
22
22
  }
23
- function z(t) {
23
+ function G(t) {
24
24
  return t.replace(
25
25
  /<video\b((?:[^"'<>]|"[^"]*"|'[^']*')*)\/>/giu,
26
26
  "<video$1></video>"
27
27
  );
28
28
  }
29
- function S(t, e = []) {
29
+ function k(t, e = []) {
30
30
  return {
31
31
  type: "text",
32
32
  text: t,
@@ -39,7 +39,7 @@ function A(t, e, a, n) {
39
39
  attrs: { kind: t, key: e, label: a, ...n ? { token: n } : {} }
40
40
  };
41
41
  }
42
- function G(t, e) {
42
+ function B(t, e) {
43
43
  const a = t.getAttribute("data-attr-key") || e, n = t.getAttribute("data-attr-id");
44
44
  return A(
45
45
  "attribute",
@@ -49,59 +49,68 @@ function G(t, e) {
49
49
  );
50
50
  }
51
51
  function v(t) {
52
- var u, c, i, s;
53
- const e = t.getAttribute("data-tag-type") || (t.getAttribute("data-size") === "true" ? "size_chart" : "") || (t.getAttribute("data-tableknowledge") === "true" ? "table_knowledge" : "") || (t.getAttribute("data-variable") === "true" ? "variable" : "") || (t.getAttribute("data-divider") === "true" ? "separator" : "") || (t.getAttribute("data-tag") === "true" ? "biz_attribute" : "");
52
+ var u, l, r, s;
53
+ const e = t.getAttribute("data-tag-type") || (t.getAttribute("data-size") === "true" ? "size_chart" : "") || (t.getAttribute("data-tableknowledge") === "true" ? "table_knowledge" : "") || (t.getAttribute("data-variable") === "true" ? "variable" : "") || (t.getAttribute("data-divider") === "true" ? "separator" : "") || (t.getAttribute("data-tag") === "no_send_follow_order" ? "no_send_follow_order" : "") || (t.getAttribute("data-reasoning") === "true" ? "reasoning" : "") || (t.getAttribute("data-tag") === "true" ? "biz_attribute" : "");
54
54
  if (!e) return null;
55
- const a = ((u = t.textContent) == null ? void 0 : u.replace(_, "").trim()) || "", n = (r, l) => {
55
+ const a = ((u = t.textContent) == null ? void 0 : u.replace(P, "").trim()) || "", n = (i, c) => {
56
56
  var b, h;
57
- return (r == null ? void 0 : r.trim()) || ((h = (b = l.exec(a)) == null ? void 0 : b[1]) == null ? void 0 : h.trim()) || "";
57
+ return (i == null ? void 0 : i.trim()) || ((h = (b = c.exec(a)) == null ? void 0 : b[1]) == null ? void 0 : h.trim()) || "";
58
58
  };
59
59
  switch (e) {
60
60
  case "table_knowledge": {
61
- const r = n(
61
+ const i = n(
62
62
  t.getAttribute("data-table-name"),
63
63
  /^##([^#]+)##$/u
64
64
  );
65
- return r && a === `##${r}##` ? A("tableKnowledge", r, r) : null;
65
+ return i && a === `##${i}##` ? A("tableKnowledge", i, i) : null;
66
66
  }
67
67
  case "size_chart": {
68
- const r = n(
68
+ const i = n(
69
69
  t.getAttribute("data-size-name"),
70
70
  /^#@([^@#]+)@#$/u
71
71
  );
72
- return r && a === `#@${r}@#` ? { type: "agentSizeChart", attrs: { name: r } } : null;
72
+ return i && a === `#@${i}@#` ? { type: "agentSizeChart", attrs: { name: i } } : null;
73
73
  }
74
74
  case "biz_attribute": {
75
- const r = ((c = t.getAttribute("data-attr-name")) == null ? void 0 : c.trim()) || ((s = (i = /^\{业务属性@([^}]+)\}$/u.exec(a)) == null ? void 0 : i[1]) == null ? void 0 : s.trim()) || a;
76
- return r && (a === r || a === `{业务属性@${r}}`) ? G(t, r) : null;
75
+ const i = ((l = t.getAttribute("data-attr-name")) == null ? void 0 : l.trim()) || ((s = (r = /^\{业务属性@([^}]+)\}$/u.exec(a)) == null ? void 0 : r[1]) == null ? void 0 : s.trim()) || a;
76
+ return i && (a === i || a === `{业务属性@${i}}`) ? B(t, i) : null;
77
77
  }
78
78
  case "variable": {
79
- const r = n(
79
+ const i = n(
80
80
  t.getAttribute("data-variable-name"),
81
81
  /^#([^#]+)#$/u
82
82
  );
83
- return r && a === `#${r}#` ? A("variable", r, r, `#${r}#`) : null;
83
+ return i && a === `#${i}#` ? A(
84
+ "variable",
85
+ i,
86
+ i,
87
+ i === "订单链接" ? "{订单链接}" : `#${i}#`
88
+ ) : null;
84
89
  }
90
+ case "no_send_follow_order":
91
+ return a === "不跟单" || a === "不发送跟单" ? A("noFollow", "noFollow", "不跟单", "<不发送跟单>") : null;
92
+ case "reasoning":
93
+ return a === "推理" || a === "{推理}" ? A("reasoningMarker", "reasoningMarker", "推理", "{推理}") : null;
85
94
  case "todo": {
86
- const r = n(t.getAttribute("data-tag-name"), /^\{待办@([^}]+)\}$/u) || (a === "{待办}" ? "默认" : "");
87
- return r && a === (r === "默认" ? "{待办}" : `{待办@${r}}`) ? A(
95
+ const i = n(t.getAttribute("data-tag-name"), /^\{待办@([^}]+)\}$/u) || (a === "{待办}" ? "默认" : "");
96
+ return i && a === (i === "默认" ? "{待办}" : `{待办@${i}}`) ? A(
88
97
  "todo",
89
- t.getAttribute("plan_id") || r,
90
- r,
91
- r === "默认" ? "{待办}" : void 0
98
+ t.getAttribute("plan_id") || i,
99
+ i,
100
+ i === "默认" ? "{待办}" : void 0
92
101
  ) : null;
93
102
  }
94
103
  case "separator":
95
104
  return a === "{分隔符}" || a === "[sep]" ? A("separator", "separator", "分隔符", "{分隔符}") : null;
96
105
  case "small_payment": {
97
- const r = Number(t.getAttribute("data-max-amount-cent"));
98
- return !Number.isInteger(r) || r < 100 || r > 9900 || r % 100 !== 0 || a !== `$$小额打款@${r}$$` ? null : {
106
+ const i = Number(t.getAttribute("data-max-amount-cent"));
107
+ return !Number.isInteger(i) || i < 100 || i > 9900 || i % 100 !== 0 || a !== `$$小额打款@${i}$$` ? null : {
99
108
  type: "businessToken",
100
109
  attrs: {
101
110
  kind: "tool",
102
111
  key: "small_payment",
103
112
  label: "小额打款",
104
- params: { amount: String(r / 100) }
113
+ params: { amount: String(i / 100) }
105
114
  }
106
115
  };
107
116
  }
@@ -112,15 +121,15 @@ function v(t) {
112
121
  function C(t) {
113
122
  var u;
114
123
  const e = t.tagName === "VIDEO" ? "video" : "image", a = t.getAttribute("src") || ((u = t.querySelector("source[src]")) == null ? void 0 : u.getAttribute("src")), n = t.getAttribute("poster");
115
- return !N(a) || n && !N(n) ? null : {
124
+ return !T(a) || n && !T(n) ? null : {
116
125
  type: "mediaBlock",
117
126
  attrs: {
118
- id: L(),
127
+ id: x(),
119
128
  nodeVersion: 0,
120
129
  kind: e,
121
130
  src: a,
122
131
  name: t.getAttribute("data-media-name") || "",
123
- assetId: t.getAttribute("data-asset-id"),
132
+ assetId: t.getAttribute("data-asset-id") || t.getAttribute("data-video-id") || (t.getAttribute("data-source-type") === "qianniuVideo" ? t.getAttribute("id") : null),
124
133
  sourceType: t.getAttribute("data-source-type"),
125
134
  poster: n || null,
126
135
  status: "ready"
@@ -129,78 +138,78 @@ function C(t) {
129
138
  }
130
139
  function w(t) {
131
140
  const e = (n, u) => {
132
- const c = (i) => {
141
+ const l = (r) => {
133
142
  var s;
134
- return ((s = new RegExp(`\\b${i}=["']([^"']*)["']`, "iu").exec(n)) == null ? void 0 : s[1]) || "";
143
+ return ((s = new RegExp(`\\b${r}=["']([^"']*)["']`, "iu").exec(n)) == null ? void 0 : s[1]) || "";
135
144
  };
136
145
  return `${u}:${JSON.stringify([
137
- c("src"),
138
- c("data-asset-id"),
139
- c("data-media-name"),
140
- c("poster")
146
+ l("src"),
147
+ l("data-asset-id"),
148
+ l("data-media-name"),
149
+ l("poster")
141
150
  ])}`;
142
151
  };
143
152
  return t.replace(/&nbsp;|&#160;|&#xa0;/giu, " ").replace(/&amp;/giu, "&").replace(/&lt;/giu, "<").replace(/&gt;/giu, ">").replace(/&quot;/giu, '"').replace(/&#39;/giu, "'").replace(/<img\b[^>]*>/giu, (n) => e(n, "img")).replace(
144
153
  /<video\b[^>]*\/?>(?:<\/video>)?/giu,
145
154
  (n) => e(n, "video")
146
- ).replace(/\[sep\]|\{分隔符\}/gu, "sep").replace(_, "").replace(/\r\n?/gu, `
155
+ ).replace(/\[sep\]|\{分隔符\}/gu, "sep").replace(P, "").replace(/\r\n?/gu, `
147
156
  `).replace(/[\t\u00a0 ]+/gu, " ").replace(/ *\n */gu, `
148
157
  `).trim();
149
158
  }
150
- function B(t) {
159
+ function F(t) {
151
160
  const e = [];
152
161
  let a = [], n = !1;
153
- const u = (i = !1) => {
154
- (a.length || i) && (e.push({
162
+ const u = (r = !1) => {
163
+ (a.length || r) && (e.push({
155
164
  type: "paragraph",
156
165
  ...a.length ? { content: a } : {}
157
166
  }), a = []);
158
- }, c = (i, s = []) => {
167
+ }, l = (r, s = []) => {
159
168
  if (n) return;
160
- if (i.nodeType === Node.TEXT_NODE) {
161
- (i.textContent || "").replace(_, "").split(/\r\n?|\n/u).forEach((b, h) => {
162
- h && u(!0), b && a.push(S(b, s));
169
+ if (r.nodeType === Node.TEXT_NODE) {
170
+ (r.textContent || "").replace(P, "").split(/\r\n?|\n/u).forEach((b, h) => {
171
+ h && u(!0), b && a.push(k(b, s));
163
172
  });
164
173
  return;
165
174
  }
166
- if (!(i instanceof Element) || i.getAttribute("data-tag-icon") === "true") return;
167
- if (i.tagName === "BR") {
175
+ if (!(r instanceof Element) || r.getAttribute("data-tag-icon") === "true") return;
176
+ if (r.tagName === "BR") {
168
177
  u(!0);
169
178
  return;
170
179
  }
171
- if (i.tagName === "IMG" || i.tagName === "VIDEO") {
172
- const l = C(i);
173
- l ? (u(), e.push(l)) : n = !0;
180
+ if (r.tagName === "IMG" || r.tagName === "VIDEO") {
181
+ const c = C(r);
182
+ c ? (u(), e.push(c)) : n = !0;
174
183
  return;
175
184
  }
176
- if (i.hasAttribute("data-tag-type")) {
177
- const l = v(i);
178
- !l || l.type === "agentSizeChart" ? n = !0 : a.push(l);
185
+ if (r.hasAttribute("data-tag-type") || r.getAttribute("data-tag") === "no_send_follow_order" || r.getAttribute("data-reasoning") === "true") {
186
+ const c = v(r);
187
+ !c || c.type === "agentSizeChart" ? n = !0 : a.push(c);
179
188
  return;
180
189
  }
181
- if (!M.has(i.tagName) && !T.has(i.tagName)) {
190
+ if (!I.has(r.tagName) && !$.has(r.tagName)) {
182
191
  n = !0;
183
192
  return;
184
193
  }
185
- T.has(i.tagName) && u();
186
- const r = [...s || []];
187
- if ((i.tagName === "B" || i.tagName === "STRONG") && r.push({ type: "bold" }), (i.tagName === "I" || i.tagName === "EM") && r.push({ type: "italic" }), i.tagName === "U" && r.push({ type: "underline" }), (i.tagName === "S" || i.tagName === "STRIKE") && r.push({ type: "strike" }), i.tagName === "CODE" && r.push({ type: "code" }), i.tagName === "A") {
188
- const l = i.getAttribute("href");
189
- if (!N(l)) {
194
+ $.has(r.tagName) && u();
195
+ const i = [...s || []];
196
+ if ((r.tagName === "B" || r.tagName === "STRONG") && i.push({ type: "bold" }), (r.tagName === "I" || r.tagName === "EM") && i.push({ type: "italic" }), r.tagName === "U" && i.push({ type: "underline" }), (r.tagName === "S" || r.tagName === "STRIKE") && i.push({ type: "strike" }), r.tagName === "CODE" && i.push({ type: "code" }), r.tagName === "A") {
197
+ const c = r.getAttribute("href");
198
+ if (!T(c)) {
190
199
  n = !0;
191
200
  return;
192
201
  }
193
- r.push({ type: "link", attrs: { href: l, target: "_self" } });
202
+ i.push({ type: "link", attrs: { href: c, target: "_self" } });
194
203
  }
195
- i.childNodes.forEach((l) => c(l, r)), T.has(i.tagName) && u();
204
+ r.childNodes.forEach((c) => l(c, i)), $.has(r.tagName) && u();
196
205
  };
197
- return t.childNodes.forEach((i) => c(i)), u(), n ? null : e.length ? e : [{ type: "paragraph" }];
206
+ return t.childNodes.forEach((r) => l(r)), u(), n ? null : e.length ? e : [{ type: "paragraph" }];
198
207
  }
199
- function Y(t) {
200
- const e = { clues: t.clues || "", webClues: t.webClues || "" }, a = (o, f, $) => ({
208
+ function Q(t) {
209
+ const e = { clues: t.clues || "", webClues: t.webClues || "" }, a = (o, p, _) => ({
201
210
  ok: !1,
202
211
  raw: e,
203
- issues: [m(o, f, $)]
212
+ issues: [m(o, p, _)]
204
213
  });
205
214
  if (typeof t.clues != "string" || typeof t.webClues != "string")
206
215
  return a("PROMPT_FIELDS_INVALID", "提示词字段必须为字符串", "clues");
@@ -209,7 +218,7 @@ function Y(t) {
209
218
  if (typeof DOMParser > "u")
210
219
  return a("DOM_UNAVAILABLE", "当前环境无法解析旧提示词", "webClues");
211
220
  if (!e.webClues.trim())
212
- return R.test(e.clues) ? a(
221
+ return M.test(e.clues) ? a(
213
222
  "PROMPT_STRUCTURE_MISSING",
214
223
  "缺少可恢复业务标签的展示字段",
215
224
  "webClues"
@@ -219,125 +228,133 @@ function Y(t) {
219
228
  schemaVersion: 1,
220
229
  doc: {
221
230
  type: "doc",
222
- content: e.clues.split(/\r\n?|\n/u).map((f) => ({
231
+ content: e.clues.split(/\r\n?|\n/u).map((p) => ({
223
232
  type: "paragraph",
224
- ...f ? { content: [S(f)] } : {}
233
+ ...p ? { content: [k(p)] } : {}
225
234
  }))
226
235
  }
227
236
  },
228
237
  warnings: []
229
238
  };
230
239
  const n = new DOMParser().parseFromString(
231
- z(e.webClues),
240
+ G(e.webClues),
232
241
  "text/html"
233
242
  ), u = [];
234
- let c = [], i = 0;
235
- const s = [], r = (o, f, $) => {
236
- if (R.test(o)) {
243
+ let l = [], r = 0;
244
+ const s = [], i = (o, p, _) => {
245
+ if (M.test(o)) {
237
246
  s.push(
238
247
  m(
239
248
  "PROMPT_UNTAGGED_MARKER",
240
249
  "历史提示词含无法确认的普通文本标记",
241
- $
250
+ _
242
251
  )
243
252
  );
244
253
  return;
245
254
  }
246
- for (const [p, y] of o.replace(_, "").split(/\r\n?|\n/u).entries())
247
- p && l(!0), y && c.push(S(y, f));
248
- }, l = (o = !1) => {
249
- (c.length || o) && (u.push({
255
+ for (const [d, y] of o.replace(P, "").split(/\r\n?|\n/u).entries())
256
+ d && c(!0), y && l.push(k(y, p));
257
+ }, c = (o = !1) => {
258
+ (l.length || o) && (u.push({
250
259
  type: "paragraph",
251
- ...c.length ? { content: c } : {}
252
- }), c = []);
253
- }, b = (o, f, $ = []) => {
254
- if (++i > V) {
255
- s.push(m("PROMPT_TOO_LARGE", "历史提示词节点过多", f));
260
+ ...l.length ? { content: l } : {}
261
+ }), l = []);
262
+ }, b = (o, p, _ = []) => {
263
+ if (++r > z) {
264
+ s.push(m("PROMPT_TOO_LARGE", "历史提示词节点过多", p));
256
265
  return;
257
266
  }
258
267
  if (o.nodeType === Node.TEXT_NODE) {
259
- r(o.textContent || "", $, f);
268
+ i(o.textContent || "", _, p);
260
269
  return;
261
270
  }
262
271
  if (!(o instanceof Element)) return;
263
- const p = o.tagName;
272
+ const d = o.tagName;
264
273
  if (o.getAttribute("data-tag-icon") === "true") return;
265
- if (["SCRIPT", "STYLE", "IFRAME", "OBJECT", "SVG", "TEMPLATE"].includes(p)) {
274
+ if (["SCRIPT", "STYLE", "IFRAME", "OBJECT", "SVG", "TEMPLATE"].includes(d)) {
266
275
  s.push(
267
- m("PROMPT_HTML_UNSUPPORTED", "旧提示词含无法编辑的 HTML", f)
276
+ m("PROMPT_HTML_UNSUPPORTED", "旧提示词含无法编辑的 HTML", p)
268
277
  );
269
278
  return;
270
279
  }
271
- if (p === "BR") {
272
- l(!0);
280
+ if (d === "BR") {
281
+ c(!0);
273
282
  return;
274
283
  }
275
- if (p === "IMG" || p === "VIDEO") {
276
- const d = C(o);
277
- d ? (l(), u.push(d)) : s.push(m("PROMPT_MEDIA_INVALID", "媒体地址或类型无效", f));
284
+ if (d === "IMG" || d === "VIDEO") {
285
+ const f = C(o);
286
+ f ? (c(), u.push(f)) : s.push(m("PROMPT_MEDIA_INVALID", "媒体地址或类型无效", p));
278
287
  return;
279
288
  }
280
289
  if (o.hasAttribute("data-original-repeat-template") || o.getAttribute("data-tag-type") === "original_repeat") {
281
- const d = o.querySelector(
290
+ const f = o.querySelector(
282
291
  "[data-original-repeat-input], .original-repeat-input"
283
- ), E = d && B(d);
292
+ ), E = f && F(f);
284
293
  if (!E) {
285
294
  s.push(
286
- m("PROMPT_REPLY_UNSUPPORTED", "原话复述模板无法无损恢复", f)
295
+ m("PROMPT_REPLY_UNSUPPORTED", "原话复述模板无法无损恢复", p)
287
296
  );
288
297
  return;
289
298
  }
290
- l(), u.push({
299
+ c(), u.push({
291
300
  type: "originalReply",
292
301
  content: E
293
302
  });
294
303
  return;
295
304
  }
296
- if (o.hasAttribute("data-tag-type") || o.hasAttribute("data-size") || o.hasAttribute("data-tableknowledge") || o.hasAttribute("data-variable") || o.hasAttribute("data-divider") || o.getAttribute("data-tag") === "true") {
297
- const d = v(o);
298
- d ? c.push(d) : s.push(
299
- m("PROMPT_TAG_UNSUPPORTED", "业务标签无法无损恢复", f)
305
+ if (o.hasAttribute("data-tag-type") || o.hasAttribute("data-size") || o.hasAttribute("data-tableknowledge") || o.hasAttribute("data-variable") || o.hasAttribute("data-divider") || o.getAttribute("data-tag") === "true" || o.getAttribute("data-tag") === "no_send_follow_order" || o.getAttribute("data-reasoning") === "true") {
306
+ const f = v(o);
307
+ f ? l.push(f) : s.push(
308
+ m("PROMPT_TAG_UNSUPPORTED", "业务标签无法无损恢复", p)
300
309
  );
301
310
  return;
302
311
  }
303
- if (!M.has(p) && !T.has(p)) {
312
+ if (!I.has(d) && !$.has(d)) {
304
313
  s.push(
305
- m("PROMPT_HTML_UNSUPPORTED", "旧提示词含不支持的排版节点", f)
314
+ m("PROMPT_HTML_UNSUPPORTED", "旧提示词含不支持的排版节点", p)
306
315
  );
307
316
  return;
308
317
  }
309
- T.has(p) && l();
310
- const y = [...$ || []];
311
- if ((p === "B" || p === "STRONG") && y.push({ type: "bold" }), (p === "I" || p === "EM") && y.push({ type: "italic" }), p === "U" && y.push({ type: "underline" }), (p === "S" || p === "STRIKE") && y.push({ type: "strike" }), p === "CODE" && y.push({ type: "code" }), p === "A") {
312
- const d = o.getAttribute("href");
313
- if (!N(d)) {
314
- s.push(m("PROMPT_LINK_INVALID", "链接地址无效", f));
318
+ $.has(d) && c();
319
+ const y = [..._ || []];
320
+ if ((d === "B" || d === "STRONG") && y.push({ type: "bold" }), (d === "I" || d === "EM") && y.push({ type: "italic" }), d === "U" && y.push({ type: "underline" }), (d === "S" || d === "STRIKE") && y.push({ type: "strike" }), d === "CODE" && y.push({ type: "code" }), d === "A") {
321
+ const f = o.getAttribute("href");
322
+ if (!T(f)) {
323
+ s.push(m("PROMPT_LINK_INVALID", "链接地址无效", p));
315
324
  return;
316
325
  }
317
- y.push({ type: "link", attrs: { href: d, target: "_self" } });
326
+ y.push({ type: "link", attrs: { href: f, target: "_self" } });
318
327
  }
319
328
  o.childNodes.forEach(
320
- (d, E) => b(d, `${f}.childNodes[${E}]`, y)
321
- ), T.has(p) && l();
329
+ (f, E) => b(f, `${p}.childNodes[${E}]`, y)
330
+ ), $.has(d) && c();
322
331
  };
323
332
  if (n.body.childNodes.forEach(
324
- (o, f) => b(o, `webClues.childNodes[${f}]`)
325
- ), l(), s.length) return { ok: !1, raw: e, issues: s };
333
+ (o, p) => b(o, `webClues.childNodes[${p}]`)
334
+ ), c(), s.length) return { ok: !1, raw: e, issues: s };
326
335
  const h = {
327
336
  schemaVersion: 1,
328
337
  doc: {
329
338
  type: "doc",
330
339
  content: u.length ? u : [{ type: "paragraph" }]
331
340
  }
332
- }, k = I(h);
333
- if (k)
334
- return a("PROMPT_DOCUMENT_INVALID", "历史提示词结构无效", k);
335
- const P = X(h);
336
- return P.ok ? w(P.clues) !== w(e.clues) ? a(
341
+ }, S = R(h);
342
+ if (S)
343
+ return a("PROMPT_DOCUMENT_INVALID", "历史提示词结构无效", S);
344
+ const N = j(h);
345
+ if (!N.ok) return { ok: !1, raw: e, issues: N.issues };
346
+ const L = N.clues.replace(
347
+ /<video\b[^>]*data-source-type="qianniuVideo"[^>]*\/>/giu,
348
+ (o) => {
349
+ var p;
350
+ return ((p = /\bsrc="([^"]+)"/iu.exec(o)) == null ? void 0 : p[1]) || o;
351
+ }
352
+ );
353
+ return w(N.clues) !== w(e.clues) && w(L) !== w(e.clues) ? a(
337
354
  "PROMPT_FIELDS_MISMATCH",
338
355
  "展示内容与算法提示词不一致",
339
356
  "clues"
340
- ) : { ok: !0, value: h, warnings: [] } : { ok: !1, raw: e, issues: P.issues };
357
+ ) : { ok: !0, value: h, warnings: [] };
341
358
  }
342
359
  function K(t) {
343
360
  var a;
@@ -349,39 +366,49 @@ function K(t) {
349
366
  return e;
350
367
  }
351
368
  function q(t) {
352
- const { kind: e, key: a, label: n, token: u, params: c } = t.attrs || {}, i = String(n || "");
369
+ const { kind: e, key: a, label: n, token: u, params: l } = t.attrs || {}, r = String(n || "");
353
370
  if (e === "tableKnowledge") {
354
- const s = `##${i}##`;
371
+ const s = `##${r}##`;
355
372
  return {
356
373
  clues: s,
357
374
  web: `<span data-tableKnowledge="true" data-tag-type="table_knowledge" data-table-name="${g(
358
- i
375
+ r
359
376
  )}">${g(s)}</span>`
360
377
  };
361
378
  }
362
379
  if (e === "attribute") {
363
- const s = `{业务属性@${i}}`, r = typeof u == "string" && u.startsWith("legacy-id:") ? u.slice(10) : "";
380
+ const s = `{业务属性@${r}}`, i = typeof u == "string" && u.startsWith("legacy-id:") ? u.slice(10) : "";
364
381
  return {
365
382
  clues: s,
366
383
  web: `<span data-tag="true" data-tag-type="biz_attribute" data-attr-name="${g(
367
- i
368
- )}" data-attr-key="${g(String(a || i))}"${r ? ` data-attr-id="${g(r)}"` : ""}>${g(i)}</span>`
384
+ r
385
+ )}" data-attr-key="${g(String(a || r))}"${i ? ` data-attr-id="${g(i)}"` : ""}>${g(r)}</span>`
369
386
  };
370
387
  }
371
388
  if (e === "variable") {
372
- const s = typeof u == "string" && u.trim() ? u : `#${i}#`;
389
+ const s = r === "订单链接" ? "{订单链接}" : typeof u == "string" && u.trim() ? u : `#${r}#`;
373
390
  return {
374
391
  clues: s,
375
392
  web: `<span data-variable="true" data-tag-type="variable" data-variable-name="${g(
376
- i
377
- )}">${g(s)}</span>`
393
+ r
394
+ )}">${g(r === "订单链接" ? "#订单链接#" : s)}</span>`
378
395
  };
379
396
  }
397
+ if (e === "noFollow")
398
+ return {
399
+ clues: "<不发送跟单>",
400
+ web: '<span data-tag="no_send_follow_order">不跟单</span>'
401
+ };
402
+ if (e === "reasoningMarker")
403
+ return {
404
+ clues: "{推理}",
405
+ web: '<span data-tag-type="reasoning" data-reasoning="true">推理</span>'
406
+ };
380
407
  if (e === "todo") {
381
- const s = i === "默认" && u === "{待办}" ? "{待办}" : `{待办@${i}}`;
408
+ const s = r === "默认" && u === "{待办}" ? "{待办}" : `{待办@${r}}`;
382
409
  return {
383
410
  clues: s,
384
- web: `<span data-tag="true" data-tag-type="todo"${i === "默认" ? "" : ` data-tag-name="${g(i)}"`}${a && a !== i ? ` plan_id="${g(String(a))}"` : ""}>${g(s)}</span>`
411
+ web: `<span data-tag="true" data-tag-type="todo"${r === "默认" ? "" : ` data-tag-name="${g(r)}"`}${a && a !== r ? ` plan_id="${g(String(a))}"` : ""}>${g(s)}</span>`
385
412
  };
386
413
  }
387
414
  if (e === "separator")
@@ -390,27 +417,26 @@ function q(t) {
390
417
  web: '<span data-divider="true" data-tag-type="separator">{分隔符}</span>'
391
418
  };
392
419
  if (e === "tool" && a === "small_payment") {
393
- const s = x(t);
420
+ const s = U(t);
394
421
  if (!s) return null;
395
- const r = Number(c == null ? void 0 : c.amount) * 100;
422
+ const i = Number(l == null ? void 0 : l.amount) * 100;
396
423
  return {
397
424
  clues: s,
398
- web: `<span contenteditable="false" data-tag="true" data-tag-type="small_payment" data-max-amount-cent="${r}">${s}</span>`
425
+ web: `<span contenteditable="false" data-tag="true" data-tag-type="small_payment" data-max-amount-cent="${i}">${s}</span>`
399
426
  };
400
427
  }
401
428
  return null;
402
429
  }
403
- function F(t) {
404
- const { kind: e, src: a, assetId: n, name: u, poster: c, status: i, sourceType: s } = t.attrs || {};
405
- if (i !== "ready" || e !== "image" && e !== "video" || !N(a))
430
+ function H(t) {
431
+ const { kind: e, src: a, assetId: n, name: u, poster: l, status: r, sourceType: s } = t.attrs || {};
432
+ if (r !== "ready" || e !== "image" && e !== "video" || !T(a))
406
433
  return null;
407
- const r = `src="${g(a)}"${n ? ` data-asset-id="${g(String(n))}"` : ""}${s === "qianniuVideo" ? ' data-source-type="qianniuVideo"' : ""}${u ? ` data-media-name="${g(String(u))}"` : ""}${c ? ` poster="${g(String(c))}"` : ""}`, l = e === "image" ? `<img ${r} width="120"/>` : `<video ${r} width="240" controls/>`;
408
- return {
409
- clues: s === "qianniuVideo" ? String(a) : l,
410
- web: l
411
- };
434
+ const i = `src="${g(a)}"${n ? ` data-asset-id="${g(String(n))}"` : ""}${s === "qianniuVideo" ? ' data-source-type="qianniuVideo"' : ""}${s === "qianniuVideo" && n ? ` id="${g(String(n))}" data-video-id="${g(
435
+ String(n)
436
+ )}"` : ""}${u ? ` data-media-name="${g(String(u))}"` : ""}${l ? ` poster="${g(String(l))}"` : ""}`, c = e === "image" ? `<img ${i} width="120"/>` : `<video ${i} width="240" controls/>`;
437
+ return { clues: c, web: c };
412
438
  }
413
- function H(t) {
439
+ function X(t) {
414
440
  var e;
415
441
  if (t.type === "text")
416
442
  return { clues: t.text || "", web: K(t) };
@@ -428,15 +454,15 @@ function H(t) {
428
454
  return t.type === "businessToken" ? q(t) : null;
429
455
  }
430
456
  function D(t) {
431
- if (t.type === "mediaBlock") return F(t);
457
+ if (t.type === "mediaBlock") return H(t);
432
458
  if (t.type === "originalReply") {
433
459
  const a = (t.content || []).map(D);
434
- if (a.some((i) => !i)) return null;
435
- let n = "", u = "", c = !1;
436
- return (t.content || []).forEach((i, s) => {
437
- const r = a[s];
438
- c && i.type === "paragraph" && (n += `
439
- `, u += "<br>"), n += r.clues, u += i.type === "paragraph" ? r.web.replace(/^<div>/u, "").replace(/<\/div>$/u, "") : r.web, c = i.type === "paragraph";
460
+ if (a.some((r) => !r)) return null;
461
+ let n = "", u = "", l = !1;
462
+ return (t.content || []).forEach((r, s) => {
463
+ const i = a[s];
464
+ l && r.type === "paragraph" && (n += `
465
+ `, u += "<br>"), n += i.clues, u += r.type === "paragraph" ? i.web.replace(/^<div>/u, "").replace(/<\/div>$/u, "") : i.web, l = r.type === "paragraph";
440
466
  }), {
441
467
  clues: `<{原话复述}${n}>`,
442
468
  web: `<span data-original-repeat-template="true" data-tag-type="original_repeat"><span data-original-repeat-input="true">${u}</span></span>`
@@ -448,14 +474,14 @@ function D(t) {
448
474
  web: '<span data-divider="true" data-tag-type="separator">{分隔符}</span>'
449
475
  };
450
476
  if (t.type !== "paragraph") return null;
451
- const e = (t.content || []).map(H);
477
+ const e = (t.content || []).map(X);
452
478
  return e.some((a) => !a) ? null : {
453
479
  clues: e.map((a) => a.clues).join(""),
454
480
  web: `<div>${e.map((a) => a.web).join("") || "<br>"}</div>`
455
481
  };
456
482
  }
457
- function X(t, e = 1e4) {
458
- const a = I(t);
483
+ function j(t, e = 1e4) {
484
+ const a = R(t);
459
485
  if (a)
460
486
  return {
461
487
  ok: !1,
@@ -463,32 +489,32 @@ function X(t, e = 1e4) {
463
489
  m("PROMPT_DOCUMENT_INVALID", "提示词文档包含无效内容", a)
464
490
  ]
465
491
  };
466
- const n = U(t, e);
492
+ const n = V(t, e);
467
493
  if (n.length) return { ok: !1, issues: n };
468
- const u = (t.doc.content || []).map(D), c = u.findIndex((s) => !s);
469
- if (c >= 0)
494
+ const u = (t.doc.content || []).map(D), l = u.findIndex((s) => !s);
495
+ if (l >= 0)
470
496
  return {
471
497
  ok: !1,
472
498
  issues: [
473
499
  m(
474
500
  "PROMPT_NODE_UNSUPPORTED",
475
501
  "提示词包含旧接口不能保存的内容",
476
- `doc.content[${c}]`
502
+ `doc.content[${l}]`
477
503
  )
478
504
  ]
479
505
  };
480
- let i = "";
481
- return (t.doc.content || []).forEach((s, r) => {
482
- var l, b;
483
- r > 0 && s.type !== "originalReply" && ((b = (l = t.doc.content) == null ? void 0 : l[r - 1]) == null ? void 0 : b.type) !== "originalReply" && (i += `
484
- `), i += u[r].clues;
506
+ let r = "";
507
+ return (t.doc.content || []).forEach((s, i) => {
508
+ var c, b;
509
+ i > 0 && s.type !== "originalReply" && ((b = (c = t.doc.content) == null ? void 0 : c[i - 1]) == null ? void 0 : b.type) !== "originalReply" && (r += `
510
+ `), r += u[i].clues;
485
511
  }), {
486
512
  ok: !0,
487
- clues: i.trim(),
513
+ clues: r.trim(),
488
514
  webClues: u.map((s) => s.web).join("")
489
515
  };
490
516
  }
491
517
  export {
492
- X as exportLegacyAgentPrompt,
493
- Y as importLegacyAgentPrompt
518
+ j as exportLegacyAgentPrompt,
519
+ Q as importLegacyAgentPrompt
494
520
  };
@@ -1,4 +1,4 @@
1
- import { m as r } from "./inline-CVF1zEsG.js";
1
+ import { m as r } from "./inline-BJJy0svW.js";
2
2
  const s = {
3
3
  execute(o, e, t) {
4
4
  if (!e.option) return [];