@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.
- package/README.md +1 -1
- 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
- package/dist/{KnowledgeArea-ClZoLiaZ.js → KnowledgeArea-BV2T5ecq.js} +1 -1
- 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
- package/dist/{ToolForm-BK9epxdr.js → ToolForm-CJRw9QhZ.js} +1 -1
- package/dist/agent-prompt-editor/index.js +198 -179
- package/dist/agent-prompt-editor/legacy-converter/index.js +188 -162
- package/dist/{choice-UgePgrSl.js → choice-BZa68Gpl.js} +1 -1
- package/dist/{guard-DPwe4mCm.js → guard-CZOoBb3d.js} +271 -213
- package/dist/index-9-vUHS0W.js +15 -0
- package/dist/index-B4oT1Q9u.js +5 -0
- package/dist/index-BHgHsPrz.js +5 -0
- package/dist/index-Bd2S6qOP.js +19 -0
- package/dist/{index-CaA13lC9.js → index-BdSClCaD.js} +1 -1
- package/dist/{index-BIi3k45j.js → index-BwkcWrL6.js} +1 -1
- package/dist/{index-ChuzFuNm.js → index-Cn_sllKh.js} +1 -1
- package/dist/{index-DiLMgNEe.js → index-DvDbrMvv.js} +1 -1
- package/dist/{index-DfKH-RZq.js → index-OMoExOaa.js} +2 -2
- package/dist/{index-RHu4JIw7.js → index-WExTogRL.js} +1 -1
- package/dist/{index-v1UD08i6.js → index-w2M63UAJ.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{inline-CVF1zEsG.js → inline-BJJy0svW.js} +1 -1
- package/dist/{knowledge-DWM6tWnP.js → knowledge-B3aTxExW.js} +1 -1
- package/dist/media-extensions-CpwsEWCD.js +338 -0
- package/dist/{media-migration-BctCLEuT.js → media-migration-3-xnOp0T.js} +1 -1
- package/dist/{media-policy-B1UuSN2e.js → media-policy-BqquGDH1.js} +36 -36
- package/dist/{media-upload-DtH-oCtw.js → media-upload-AunEWyNv.js} +1 -1
- package/dist/{model-VLLhEQfn.js → model-aED-32GY.js} +10 -6
- package/dist/rich-text/index.js +6 -6
- package/dist/rich-text/legacy-converter/index.js +905 -842
- package/dist/style.css +1 -1
- package/dist/types/agent-prompt-editor/model.d.ts +1 -1
- package/dist/types/rich-text/config/descriptor.d.ts +2 -0
- package/dist/types/rich-text/model/qianniu-video.d.ts +1 -0
- package/dist/types/rich-text/plugins/noFollow/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/noFollow/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/noFollow/token.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningMarker/token.d.ts +2 -0
- package/dist/types/rich-text/plugins/token-catalog.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index-BMHUPL5x.js +0 -5
- package/dist/index-DJLfgC4v.js +0 -5
- package/dist/media-extensions-YYbGuUQa.js +0 -341
|
@@ -161,7 +161,7 @@ const ce = [
|
|
|
161
161
|
types: ["normal", "reasoning", "agent"],
|
|
162
162
|
icon: "memory"
|
|
163
163
|
}
|
|
164
|
-
],
|
|
164
|
+
], Ve = [
|
|
165
165
|
{
|
|
166
166
|
id: "tagged",
|
|
167
167
|
apiVersion: 1,
|
|
@@ -188,7 +188,7 @@ const ce = [
|
|
|
188
188
|
optionTrigger: "hover",
|
|
189
189
|
questionTag: { kind: "default", protocolLabel: "顾客标签" }
|
|
190
190
|
}
|
|
191
|
-
],
|
|
191
|
+
], xe = [
|
|
192
192
|
{
|
|
193
193
|
id: "attribute",
|
|
194
194
|
apiVersion: 1,
|
|
@@ -216,7 +216,7 @@ const ce = [
|
|
|
216
216
|
optionTrigger: "hover",
|
|
217
217
|
optionHierarchy: "tree"
|
|
218
218
|
}
|
|
219
|
-
],
|
|
219
|
+
], qe = [
|
|
220
220
|
{
|
|
221
221
|
id: "tool",
|
|
222
222
|
apiVersion: 1,
|
|
@@ -245,7 +245,7 @@ const ce = [
|
|
|
245
245
|
optionHierarchy: "tree",
|
|
246
246
|
uiPorts: ["getToolForm"]
|
|
247
247
|
}
|
|
248
|
-
],
|
|
248
|
+
], Pe = [
|
|
249
249
|
{
|
|
250
250
|
id: "variable",
|
|
251
251
|
apiVersion: 1,
|
|
@@ -271,7 +271,7 @@ const ce = [
|
|
|
271
271
|
optionTrigger: "hover"
|
|
272
272
|
}
|
|
273
273
|
];
|
|
274
|
-
const
|
|
274
|
+
const ft = {
|
|
275
275
|
agents: "searchAgents",
|
|
276
276
|
variables: "listVariables",
|
|
277
277
|
flatTags: "listCapabilityOptions",
|
|
@@ -309,7 +309,7 @@ const w = {
|
|
|
309
309
|
icon: "pic",
|
|
310
310
|
optionKind: "media"
|
|
311
311
|
}
|
|
312
|
-
],
|
|
312
|
+
], Le = [
|
|
313
313
|
{
|
|
314
314
|
id: "video",
|
|
315
315
|
apiVersion: 1,
|
|
@@ -324,7 +324,7 @@ const w = {
|
|
|
324
324
|
icon: "video3",
|
|
325
325
|
optionKind: "media"
|
|
326
326
|
}
|
|
327
|
-
],
|
|
327
|
+
], _e = [
|
|
328
328
|
{
|
|
329
329
|
id: "separator",
|
|
330
330
|
apiVersion: 1,
|
|
@@ -337,7 +337,37 @@ const w = {
|
|
|
337
337
|
types: ["normal", "reasoning"],
|
|
338
338
|
icon: "sep"
|
|
339
339
|
}
|
|
340
|
-
],
|
|
340
|
+
], je = [
|
|
341
|
+
{
|
|
342
|
+
id: "noFollow",
|
|
343
|
+
apiVersion: 1,
|
|
344
|
+
dataVersion: 1,
|
|
345
|
+
implementation: "plugin",
|
|
346
|
+
label: "不跟单",
|
|
347
|
+
slot: "knowledgeInline",
|
|
348
|
+
actions: [{ id: "noFollow.knowledgeInline.apply", requiredPorts: [] }],
|
|
349
|
+
toolbarOptIn: !0,
|
|
350
|
+
order: 81,
|
|
351
|
+
types: ["normal", "reasoning"],
|
|
352
|
+
icon: "sep"
|
|
353
|
+
}
|
|
354
|
+
], Re = [
|
|
355
|
+
{
|
|
356
|
+
id: "reasoningMarker",
|
|
357
|
+
apiVersion: 1,
|
|
358
|
+
dataVersion: 1,
|
|
359
|
+
implementation: "plugin",
|
|
360
|
+
label: "推理",
|
|
361
|
+
slot: "knowledgeInline",
|
|
362
|
+
actions: [
|
|
363
|
+
{ id: "reasoningMarker.knowledgeInline.apply", requiredPorts: [] }
|
|
364
|
+
],
|
|
365
|
+
toolbarOptIn: !0,
|
|
366
|
+
order: 81,
|
|
367
|
+
types: ["normal", "reasoning"],
|
|
368
|
+
icon: "AI"
|
|
369
|
+
}
|
|
370
|
+
], Ce = [
|
|
341
371
|
{
|
|
342
372
|
id: "reasoningPolish",
|
|
343
373
|
apiVersion: 1,
|
|
@@ -351,7 +381,7 @@ const w = {
|
|
|
351
381
|
types: ["reasoning"],
|
|
352
382
|
icon: "AI"
|
|
353
383
|
}
|
|
354
|
-
],
|
|
384
|
+
], De = [
|
|
355
385
|
{
|
|
356
386
|
id: "reasoningTemplate",
|
|
357
387
|
apiVersion: 1,
|
|
@@ -374,7 +404,7 @@ const w = {
|
|
|
374
404
|
optionKind: "selection",
|
|
375
405
|
optionSource: "reasoningTemplates"
|
|
376
406
|
}
|
|
377
|
-
],
|
|
407
|
+
], Be = [
|
|
378
408
|
{
|
|
379
409
|
id: "agentSelect",
|
|
380
410
|
apiVersion: 1,
|
|
@@ -402,56 +432,58 @@ const w = {
|
|
|
402
432
|
optionSource: "agents",
|
|
403
433
|
optionTrigger: "hover"
|
|
404
434
|
}
|
|
405
|
-
],
|
|
435
|
+
], P = [
|
|
406
436
|
...Se,
|
|
407
437
|
...Te,
|
|
408
438
|
...Ae,
|
|
409
439
|
...Ie,
|
|
410
440
|
...ve,
|
|
441
|
+
...Ve,
|
|
411
442
|
...xe,
|
|
412
443
|
...qe,
|
|
413
444
|
...Pe,
|
|
414
|
-
...Ve,
|
|
415
445
|
...Oe,
|
|
446
|
+
...Le,
|
|
416
447
|
..._e,
|
|
417
448
|
...je,
|
|
418
|
-
...Le,
|
|
419
449
|
...Re,
|
|
420
|
-
...Ce
|
|
450
|
+
...Ce,
|
|
451
|
+
...De,
|
|
452
|
+
...Be
|
|
421
453
|
];
|
|
422
|
-
function
|
|
423
|
-
const r = /* @__PURE__ */ new Set(),
|
|
424
|
-
if (
|
|
454
|
+
function ge(e, t = "") {
|
|
455
|
+
const r = /* @__PURE__ */ new Set(), i = (o, a, n) => {
|
|
456
|
+
if (o === null || typeof o == "string" || typeof o == "boolean")
|
|
425
457
|
return null;
|
|
426
|
-
if (typeof
|
|
427
|
-
return Number.isFinite(
|
|
428
|
-
if (typeof
|
|
458
|
+
if (typeof o == "number")
|
|
459
|
+
return Number.isFinite(o) ? null : a;
|
|
460
|
+
if (typeof o != "object" || n > 64 || r.has(o))
|
|
429
461
|
return a;
|
|
430
|
-
if (!Array.isArray(
|
|
431
|
-
const c = Object.getPrototypeOf(
|
|
462
|
+
if (!Array.isArray(o)) {
|
|
463
|
+
const c = Object.getPrototypeOf(o);
|
|
432
464
|
if (c !== Object.prototype && c !== null) return a;
|
|
433
465
|
}
|
|
434
|
-
const s = Reflect.ownKeys(
|
|
466
|
+
const s = Reflect.ownKeys(o);
|
|
435
467
|
if (s.some((c) => typeof c == "symbol")) return a;
|
|
436
|
-
if (Array.isArray(
|
|
437
|
-
if (s.length !==
|
|
438
|
-
for (let c = 0; c <
|
|
439
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
468
|
+
if (Array.isArray(o)) {
|
|
469
|
+
if (s.length !== o.length + 1) return a;
|
|
470
|
+
for (let c = 0; c < o.length; c++)
|
|
471
|
+
if (!Object.prototype.hasOwnProperty.call(o, c))
|
|
440
472
|
return `${a}[${c}]`;
|
|
441
473
|
}
|
|
442
|
-
r.add(
|
|
474
|
+
r.add(o);
|
|
443
475
|
for (const c of s) {
|
|
444
|
-
if (Array.isArray(
|
|
445
|
-
const l = Object.getOwnPropertyDescriptor(
|
|
446
|
-
if (!l || !("value" in l) || !Array.isArray(
|
|
476
|
+
if (Array.isArray(o) && c === "length") continue;
|
|
477
|
+
const l = Object.getOwnPropertyDescriptor(o, c), u = Array.isArray(o) ? `${a}[${String(c)}]` : a ? `${a}.${String(c)}` : String(c);
|
|
478
|
+
if (!l || !("value" in l) || !Array.isArray(o) && !l.enumerable)
|
|
447
479
|
return u;
|
|
448
|
-
const d =
|
|
480
|
+
const d = i(l.value, u, n + 1);
|
|
449
481
|
if (d !== null) return d;
|
|
450
482
|
}
|
|
451
|
-
return r.delete(
|
|
483
|
+
return r.delete(o), null;
|
|
452
484
|
};
|
|
453
485
|
try {
|
|
454
|
-
return
|
|
486
|
+
return i(e, t, 0);
|
|
455
487
|
} catch {
|
|
456
488
|
return t;
|
|
457
489
|
}
|
|
@@ -459,35 +491,35 @@ function fe(e, t = "") {
|
|
|
459
491
|
function S(e, t, r) {
|
|
460
492
|
return {
|
|
461
493
|
choice: !0,
|
|
462
|
-
present: (
|
|
494
|
+
present: (i) => ({
|
|
463
495
|
layout: "choice",
|
|
464
496
|
icon: t,
|
|
465
|
-
label: String(
|
|
466
|
-
ariaLabel: `${e}:${
|
|
497
|
+
label: String(i.label || ""),
|
|
498
|
+
ariaLabel: `${e}:${i.label || ""}`
|
|
467
499
|
}),
|
|
468
500
|
serialize: r
|
|
469
501
|
};
|
|
470
502
|
}
|
|
471
|
-
const
|
|
503
|
+
const Ne = S(
|
|
472
504
|
"待办",
|
|
473
505
|
"rte-todo",
|
|
474
506
|
(e) => e.label === "默认" && e.token === "{待办}" ? "{待办}" : `{待办@${e.label || e.key}}`
|
|
475
507
|
);
|
|
476
|
-
function
|
|
508
|
+
function yt(e) {
|
|
477
509
|
const t = e.match(/^\{智能工单@name=([^{};\r\n]+);id=([^\s{};]+)\}$/u);
|
|
478
510
|
if (t && t[1].trim())
|
|
479
511
|
return { key: t[2], label: t[1], params: { protocol: "legacy" } };
|
|
480
512
|
const r = e.match(/^\{智能建单@([^\s{}:]+):([^{}\r\n]+)\}$/u);
|
|
481
513
|
return r && r[2].trim() ? { key: r[1], label: r[2] } : null;
|
|
482
514
|
}
|
|
483
|
-
function
|
|
515
|
+
function Ke(e, t, r) {
|
|
484
516
|
return (r == null ? void 0 : r.protocol) === "legacy" ? `{智能工单@name=${t};id=${e}}` : `{智能建单@${e}:${t}}`;
|
|
485
517
|
}
|
|
486
|
-
const
|
|
518
|
+
const Me = {
|
|
487
519
|
...S(
|
|
488
520
|
"工单",
|
|
489
521
|
"AI-ticket",
|
|
490
|
-
(e) =>
|
|
522
|
+
(e) => Ke(
|
|
491
523
|
String(e.key || ""),
|
|
492
524
|
String(e.label || ""),
|
|
493
525
|
e.params
|
|
@@ -497,17 +529,17 @@ const Ne = {
|
|
|
497
529
|
validate(e) {
|
|
498
530
|
return e.params != null && (typeof e.params != "object" || Array.isArray(e.params) || Object.keys(e.params).length !== 1 || e.params.protocol !== "legacy") ? "params" : typeof e.key != "string" || !/^[^\s{}:]+$/u.test(e.key) ? "key" : typeof e.label != "string" || !e.label.trim() || /[{}\r\n]/u.test(e.label) || e.params != null && /[;]/u.test(e.label) ? "label" : e.params != null && /[;]/u.test(e.key) ? "key" : null;
|
|
499
531
|
}
|
|
500
|
-
},
|
|
532
|
+
}, Fe = {
|
|
501
533
|
...S(
|
|
502
534
|
"表格知识",
|
|
503
535
|
"table-knowledge",
|
|
504
536
|
(e) => `##${e.label}##`
|
|
505
537
|
),
|
|
506
538
|
validate: (e) => typeof e.label != "string" || !e.label.trim() || /[#\r\n]/u.test(e.label) ? "label" : null
|
|
507
|
-
},
|
|
539
|
+
}, Ee = {
|
|
508
540
|
...S("属性", "prte-reference", (e) => `{属性@${e.key}}`),
|
|
509
541
|
allowInOriginalReply: !1
|
|
510
|
-
},
|
|
542
|
+
}, Ue = {
|
|
511
543
|
requiresInsertToken: !0,
|
|
512
544
|
present(e) {
|
|
513
545
|
const t = String(e.label || e.key || "");
|
|
@@ -519,7 +551,7 @@ const Ne = {
|
|
|
519
551
|
};
|
|
520
552
|
},
|
|
521
553
|
serialize: (e) => String(e.token || `#${e.key}#`)
|
|
522
|
-
},
|
|
554
|
+
}, ze = {
|
|
523
555
|
validateValidity: !1,
|
|
524
556
|
present: (e) => ({
|
|
525
557
|
layout: "inline",
|
|
@@ -528,12 +560,32 @@ const Ne = {
|
|
|
528
560
|
ariaLabel: String(e.label || "")
|
|
529
561
|
}),
|
|
530
562
|
serialize: () => "{分隔符}"
|
|
563
|
+
}, We = {
|
|
564
|
+
validateValidity: !1,
|
|
565
|
+
validate: (e) => e.key !== "noFollow" ? "key" : e.label !== "不跟单" ? "label" : e.token != null && e.token !== "<不发送跟单>" ? "token" : null,
|
|
566
|
+
present: () => ({
|
|
567
|
+
layout: "inline",
|
|
568
|
+
icon: "sep",
|
|
569
|
+
label: "不跟单",
|
|
570
|
+
ariaLabel: "不跟单"
|
|
571
|
+
}),
|
|
572
|
+
serialize: () => "<不发送跟单>"
|
|
573
|
+
}, He = {
|
|
574
|
+
validateValidity: !1,
|
|
575
|
+
validate: (e) => e.key !== "reasoningMarker" ? "key" : e.label !== "推理" ? "label" : e.token != null && e.token !== "{推理}" ? "token" : null,
|
|
576
|
+
present: () => ({
|
|
577
|
+
layout: "inline",
|
|
578
|
+
icon: "AI",
|
|
579
|
+
label: "推理",
|
|
580
|
+
ariaLabel: "推理"
|
|
581
|
+
}),
|
|
582
|
+
serialize: () => "{推理}"
|
|
531
583
|
};
|
|
532
|
-
function
|
|
584
|
+
function Qe(e, t) {
|
|
533
585
|
if (e !== "order_note" && e !== "small_payment") return null;
|
|
534
586
|
const r = t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
535
587
|
if (e === "small_payment") {
|
|
536
|
-
const
|
|
588
|
+
const o = typeof r.amount == "string" ? r.amount : "", a = /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(o), [n = "", s = ""] = o.split(".");
|
|
537
589
|
return {
|
|
538
590
|
label: "小额打款",
|
|
539
591
|
icon: "rte-tool",
|
|
@@ -542,14 +594,14 @@ function Ue(e, t) {
|
|
|
542
594
|
}
|
|
543
595
|
return { label: "备注", icon: "msg-tag", summary: r.contentMode === "smart" ? "智能提取" : typeof r.content == "string" ? r.content.replace(/\s+/g, " ").trim() : "" };
|
|
544
596
|
}
|
|
545
|
-
const
|
|
597
|
+
const fe = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), ye = (e) => typeof e == "string" && /^(?:rmk_[a-z0-9]{8}|[1-9]\d*)$/.test(e), $ = {
|
|
546
598
|
none: "不标记",
|
|
547
599
|
red: "红色",
|
|
548
600
|
yellow: "黄色",
|
|
549
601
|
green: "绿色",
|
|
550
602
|
blue: "蓝色",
|
|
551
603
|
purple: "紫色"
|
|
552
|
-
},
|
|
604
|
+
}, mt = {
|
|
553
605
|
none: "",
|
|
554
606
|
red: "#f53f3f",
|
|
555
607
|
yellow: "#ff7d00",
|
|
@@ -565,16 +617,16 @@ function A(e) {
|
|
|
565
617
|
function ue() {
|
|
566
618
|
return `rmk_${crypto.randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
|
567
619
|
}
|
|
568
|
-
function
|
|
620
|
+
function kt(e, t, r, i, o) {
|
|
569
621
|
if (e !== "small_payment" && e !== "order_note")
|
|
570
622
|
return { ok: !0, params: t };
|
|
571
623
|
let a = 0;
|
|
572
624
|
const n = /* @__PURE__ */ new Set(), s = (u) => {
|
|
573
|
-
var d, y,
|
|
574
|
-
u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!
|
|
625
|
+
var d, y, g;
|
|
626
|
+
u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!o || u.attrs.id !== o) && (u.attrs.key === "small_payment" && a++, u.attrs.key === "order_note" && n.add(String(((y = u.attrs.params) == null ? void 0 : y.id) || ""))), (g = u.content) == null || g.forEach(s);
|
|
575
627
|
};
|
|
576
|
-
if (
|
|
577
|
-
return
|
|
628
|
+
if (i && s(i), e === "small_payment")
|
|
629
|
+
return fe(t.amount) ? a ? {
|
|
578
630
|
ok: !1,
|
|
579
631
|
code: "TOOL_LIMIT_REACHED",
|
|
580
632
|
message: "最多配置一个小额打款工具"
|
|
@@ -584,7 +636,7 @@ function dt(e, t, r, o, i) {
|
|
|
584
636
|
message: "打款金额必须是1-99的整数元"
|
|
585
637
|
};
|
|
586
638
|
let c = ye(r.id) ? r.id : ue();
|
|
587
|
-
if (!
|
|
639
|
+
if (!o)
|
|
588
640
|
for (; n.has(c); ) c = ue();
|
|
589
641
|
if (n.has(c))
|
|
590
642
|
return {
|
|
@@ -599,7 +651,7 @@ function dt(e, t, r, o, i) {
|
|
|
599
651
|
message: "订单备注内容或配置不合法"
|
|
600
652
|
};
|
|
601
653
|
}
|
|
602
|
-
function
|
|
654
|
+
function bt(e) {
|
|
603
655
|
const t = /^\{外部方法@([^\s{}:]+):([^{}\r\n]+)\}$/u.exec(e);
|
|
604
656
|
if (t && t[2].trim())
|
|
605
657
|
return {
|
|
@@ -624,21 +676,21 @@ function ft(e) {
|
|
|
624
676
|
}
|
|
625
677
|
};
|
|
626
678
|
}
|
|
627
|
-
const
|
|
679
|
+
const i = /^\^\^订单备注-(固定话术|智能提取)@编号=(rmk_[a-z0-9]{8}|[1-9]\d*);插旗=([^;]+);保留已有旗帜=(是|否);位置=(最前|最后);内容=([\s\S]+)\^\^$/u.exec(
|
|
628
680
|
e
|
|
629
681
|
);
|
|
630
|
-
if (!o) return null;
|
|
631
|
-
const i = Object.keys($).find(
|
|
632
|
-
(n) => $[n] === o[3]
|
|
633
|
-
);
|
|
634
682
|
if (!i) return null;
|
|
683
|
+
const o = Object.keys($).find(
|
|
684
|
+
(n) => $[n] === i[3]
|
|
685
|
+
);
|
|
686
|
+
if (!o) return null;
|
|
635
687
|
const a = {
|
|
636
|
-
id:
|
|
637
|
-
contentMode:
|
|
638
|
-
content:
|
|
639
|
-
flag:
|
|
640
|
-
preserveFlag:
|
|
641
|
-
position:
|
|
688
|
+
id: i[2],
|
|
689
|
+
contentMode: i[1] === "固定话术" ? "fixed" : "smart",
|
|
690
|
+
content: i[6],
|
|
691
|
+
flag: o,
|
|
692
|
+
preserveFlag: i[4] === "是",
|
|
693
|
+
position: i[5] === "最前" ? "first" : "last"
|
|
642
694
|
};
|
|
643
695
|
return A(a) ? {
|
|
644
696
|
type: "businessToken",
|
|
@@ -650,12 +702,12 @@ function pe(e) {
|
|
|
650
702
|
if (e.type !== "businessToken" || ((r = e.attrs) == null ? void 0 : r.kind) !== "tool") return null;
|
|
651
703
|
const { params: t } = e.attrs;
|
|
652
704
|
if (e.attrs.key === "external_method") {
|
|
653
|
-
const { sceneId:
|
|
654
|
-
return typeof
|
|
705
|
+
const { sceneId: i, sceneName: o } = t || {};
|
|
706
|
+
return typeof i == "string" && /^[^\s{}:]+$/u.test(i) && typeof o == "string" && o.trim() && !/[{}\r\n]/u.test(o) ? `{外部方法@${i}:${o}}` : null;
|
|
655
707
|
}
|
|
656
|
-
return e.attrs.key === "small_payment" ?
|
|
708
|
+
return e.attrs.key === "small_payment" ? fe(t == null ? void 0 : t.amount) ? `$$小额打款@${Number(t.amount) * 100}$$` : null : e.attrs.key !== "order_note" || !A(t) ? null : `^^订单备注-${t.contentMode === "fixed" ? "固定话术" : "智能提取"}@编号=${t.id};插旗=${$[t.flag]};保留已有旗帜=${t.preserveFlag ? "是" : "否"};位置=${t.position === "first" ? "最前" : "最后"};内容=${t.content}^^`;
|
|
657
709
|
}
|
|
658
|
-
function
|
|
710
|
+
function wt(e) {
|
|
659
711
|
try {
|
|
660
712
|
const t = JSON.parse(decodeURIComponent(e)), r = {
|
|
661
713
|
id: String(t.id || ""),
|
|
@@ -673,7 +725,7 @@ function gt(e) {
|
|
|
673
725
|
return null;
|
|
674
726
|
}
|
|
675
727
|
}
|
|
676
|
-
const
|
|
728
|
+
const Je = {
|
|
677
729
|
allowsParams: !0,
|
|
678
730
|
validate(e) {
|
|
679
731
|
return ["small_payment", "order_note", "external_method"].includes(
|
|
@@ -681,7 +733,7 @@ const ze = {
|
|
|
681
733
|
) ? pe({ type: "businessToken", attrs: { ...e } }) ? null : "params" : null;
|
|
682
734
|
},
|
|
683
735
|
present(e) {
|
|
684
|
-
const t =
|
|
736
|
+
const t = Qe(e.key, e.params);
|
|
685
737
|
return t ? {
|
|
686
738
|
layout: "toolNote",
|
|
687
739
|
icon: t.icon,
|
|
@@ -710,62 +762,64 @@ const ze = {
|
|
|
710
762
|
return `{工具@${e.key}}`;
|
|
711
763
|
}
|
|
712
764
|
}, me = {
|
|
713
|
-
todo:
|
|
714
|
-
ticket:
|
|
715
|
-
tableKnowledge:
|
|
716
|
-
variable:
|
|
717
|
-
attribute:
|
|
718
|
-
tool:
|
|
719
|
-
separator:
|
|
720
|
-
|
|
765
|
+
todo: Ne,
|
|
766
|
+
ticket: Me,
|
|
767
|
+
tableKnowledge: Fe,
|
|
768
|
+
variable: Ue,
|
|
769
|
+
attribute: Ee,
|
|
770
|
+
tool: Je,
|
|
771
|
+
separator: ze,
|
|
772
|
+
noFollow: We,
|
|
773
|
+
reasoningMarker: He
|
|
774
|
+
}, x = me;
|
|
721
775
|
function I(e) {
|
|
722
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
776
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(x, e) ? x[e] : void 0;
|
|
723
777
|
}
|
|
724
778
|
const ke = Object.keys(
|
|
725
779
|
me
|
|
726
|
-
),
|
|
727
|
-
(e) =>
|
|
728
|
-
),
|
|
780
|
+
), Ge = ke.filter(
|
|
781
|
+
(e) => x[e].choice
|
|
782
|
+
), Ye = ["image", "video"], Xe = new Set(ke), Ze = new Set(Ge), et = new Set(Ye), be = (e) => typeof e == "string" && Xe.has(e), ht = (e) => typeof e == "string" && Ze.has(e), we = (e) => typeof e == "string" && et.has(e), tt = /* @__PURE__ */ new Set([
|
|
729
783
|
"businessToken",
|
|
730
784
|
"originalReply",
|
|
731
785
|
"messageSeparator",
|
|
732
786
|
"mediaBlock"
|
|
733
|
-
]), O = (e) =>
|
|
734
|
-
function
|
|
787
|
+
]), O = (e) => tt.has(e);
|
|
788
|
+
function nt(e, t) {
|
|
735
789
|
return e === "businessToken" ? be(t == null ? void 0 : t.kind) ? t.kind : null : e === "mediaBlock" ? we(t == null ? void 0 : t.kind) ? t.kind : null : e === "originalReply" ? "originalReply" : e === "messageSeparator" ? "separator" : null;
|
|
736
790
|
}
|
|
737
|
-
function
|
|
738
|
-
const t =
|
|
791
|
+
function rt(e) {
|
|
792
|
+
const t = nt(e.type || "", e.attrs);
|
|
739
793
|
return t ? {
|
|
740
794
|
id: t,
|
|
741
795
|
slot: e.type === "businessToken" || e.type === "messageSeparator" ? "knowledgeInline" : "knowledgeBlock"
|
|
742
796
|
} : null;
|
|
743
797
|
}
|
|
744
|
-
function
|
|
798
|
+
function ot(e) {
|
|
745
799
|
var t;
|
|
746
800
|
return !!((t = e.content) != null && t.some(
|
|
747
|
-
(r) => typeof r.type == "string" && O(r.type) ||
|
|
801
|
+
(r) => typeof r.type == "string" && O(r.type) || ot(r)
|
|
748
802
|
));
|
|
749
803
|
}
|
|
750
|
-
const
|
|
751
|
-
function
|
|
752
|
-
const t = [], r = (
|
|
753
|
-
var
|
|
754
|
-
|
|
804
|
+
const $t = "fkpTrustedNodeIds";
|
|
805
|
+
function St(e) {
|
|
806
|
+
const t = [], r = (i) => {
|
|
807
|
+
var o, a;
|
|
808
|
+
i.type && O(i.type) && typeof ((o = i.attrs) == null ? void 0 : o.id) == "string" && i.attrs.id && t.push(i.attrs.id), (a = i.content) == null || a.forEach(r);
|
|
755
809
|
};
|
|
756
810
|
return Array.isArray(e) ? e.forEach(r) : r(e), t;
|
|
757
811
|
}
|
|
758
|
-
function
|
|
812
|
+
function At(e, t) {
|
|
759
813
|
for (let a = 0; a < 8; a++) {
|
|
760
814
|
const n = t();
|
|
761
815
|
if (n && !e.has(n)) return n;
|
|
762
816
|
}
|
|
763
817
|
const r = t() || "node";
|
|
764
|
-
let
|
|
765
|
-
for (; e.has(
|
|
766
|
-
return
|
|
818
|
+
let i = r, o = 1;
|
|
819
|
+
for (; e.has(i); ) i = `${r}-${o++}`;
|
|
820
|
+
return i;
|
|
767
821
|
}
|
|
768
|
-
function
|
|
822
|
+
function q(e) {
|
|
769
823
|
if (typeof e != "string" || !/^https?:\/\/[^\s]+$/i.test(e))
|
|
770
824
|
return !1;
|
|
771
825
|
try {
|
|
@@ -775,7 +829,10 @@ function P(e) {
|
|
|
775
829
|
return !1;
|
|
776
830
|
}
|
|
777
831
|
}
|
|
778
|
-
function
|
|
832
|
+
function it(e) {
|
|
833
|
+
return typeof e == "string" && /^[0-9]+$/.test(e);
|
|
834
|
+
}
|
|
835
|
+
function st(e) {
|
|
779
836
|
try {
|
|
780
837
|
const t = new URL(e);
|
|
781
838
|
return t.protocol === "https:" && t.hostname === "cloud.video.taobao.com" && t.port === "" && !t.username && !t.password && !t.search && !t.hash && /^\/vod\/[^/\s]+\.mp4$/i.test(t.pathname);
|
|
@@ -783,7 +840,7 @@ function tt(e) {
|
|
|
783
840
|
return !1;
|
|
784
841
|
}
|
|
785
842
|
}
|
|
786
|
-
function
|
|
843
|
+
function at(e) {
|
|
787
844
|
if (e.includes("[") || e.includes("]") || /[\r\n]/u.test(e))
|
|
788
845
|
return !0;
|
|
789
846
|
let t = 0;
|
|
@@ -795,32 +852,32 @@ function nt(e) {
|
|
|
795
852
|
function he(e) {
|
|
796
853
|
return /[{}\r\n]/u.test(e);
|
|
797
854
|
}
|
|
798
|
-
function
|
|
855
|
+
function lt(e, t) {
|
|
799
856
|
var n;
|
|
800
857
|
const r = (n = e.extensionState[t]) == null ? void 0 : n.data;
|
|
801
858
|
if (!r || typeof r != "object" || Array.isArray(r)) return null;
|
|
802
|
-
const { tag:
|
|
803
|
-
if (!
|
|
804
|
-
const { id:
|
|
805
|
-
return typeof
|
|
859
|
+
const { tag: i } = r;
|
|
860
|
+
if (!i || typeof i != "object" || Array.isArray(i)) return null;
|
|
861
|
+
const { id: o, label: a } = i;
|
|
862
|
+
return typeof o != "string" || !o.trim() || typeof a != "string" || !a.trim() ? null : { id: o, label: a };
|
|
806
863
|
}
|
|
807
|
-
function
|
|
808
|
-
return
|
|
864
|
+
function ct(e) {
|
|
865
|
+
return P.filter(
|
|
809
866
|
(t) => t.slot === "questionAction" && t.questionTag && t.types.includes(e.type)
|
|
810
867
|
).sort((t, r) => t.order - r.order).flatMap(({ id: t, questionTag: r }) => {
|
|
811
868
|
var s;
|
|
812
|
-
const
|
|
813
|
-
if (a && !n) throw new Error(`${
|
|
869
|
+
const i = r.protocolLabel, o = (s = e.extensionState[t]) == null ? void 0 : s.data, a = o && typeof o == "object" && !Array.isArray(o) ? o.enabled === !0 : !1, n = a ? lt(e, t) : null;
|
|
870
|
+
if (a && !n) throw new Error(`${i}已开启但未选择方案`);
|
|
814
871
|
if (n && he(n.label))
|
|
815
872
|
throw new Error("方案名称包含协议保留字符");
|
|
816
|
-
return n ? [`{${
|
|
873
|
+
return n ? [`{${i}@${n.label}}`] : [];
|
|
817
874
|
}).join("");
|
|
818
875
|
}
|
|
819
|
-
function
|
|
876
|
+
function Tt(e) {
|
|
820
877
|
var t;
|
|
821
|
-
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" ||
|
|
878
|
+
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" || at(e.question.text))
|
|
822
879
|
throw new Error("意图文字不能包含半角方括号、换行或未配对的【】");
|
|
823
|
-
return `[${e.question.text}]${
|
|
880
|
+
return `[${e.question.text}]${ct(e)}`;
|
|
824
881
|
}
|
|
825
882
|
const $e = /* @__PURE__ */ new Set([
|
|
826
883
|
"doc",
|
|
@@ -837,7 +894,7 @@ const $e = /* @__PURE__ */ new Set([
|
|
|
837
894
|
"originalReply",
|
|
838
895
|
"messageSeparator",
|
|
839
896
|
"mediaBlock"
|
|
840
|
-
]),
|
|
897
|
+
]), It = (e) => $e.has(e), ut = /* @__PURE__ */ new Set([
|
|
841
898
|
"bold",
|
|
842
899
|
"italic",
|
|
843
900
|
"strike",
|
|
@@ -863,7 +920,7 @@ const $e = /* @__PURE__ */ new Set([
|
|
|
863
920
|
blockquote: v,
|
|
864
921
|
codeBlock: /* @__PURE__ */ new Set(["text"]),
|
|
865
922
|
originalReply: /* @__PURE__ */ new Set(["paragraph", "mediaBlock", "messageSeparator"])
|
|
866
|
-
},
|
|
923
|
+
}, pt = {
|
|
867
924
|
orderedList: /* @__PURE__ */ new Set(["start", "type"]),
|
|
868
925
|
codeBlock: /* @__PURE__ */ new Set(["language"]),
|
|
869
926
|
businessToken: /* @__PURE__ */ new Set([
|
|
@@ -890,32 +947,32 @@ const $e = /* @__PURE__ */ new Set([
|
|
|
890
947
|
"error"
|
|
891
948
|
])
|
|
892
949
|
};
|
|
893
|
-
function
|
|
950
|
+
function dt(e) {
|
|
894
951
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
895
952
|
const t = e;
|
|
896
|
-
if (typeof t.type != "string" || !
|
|
953
|
+
if (typeof t.type != "string" || !ut.has(t.type) || Object.keys(t).some((o) => !["type", "attrs"].includes(o)) || t.attrs !== void 0 && (!t.attrs || typeof t.attrs != "object" || Array.isArray(t.attrs)))
|
|
897
954
|
return !1;
|
|
898
955
|
const r = t.attrs || {};
|
|
899
956
|
if (t.type !== "link") return Object.keys(r).length === 0;
|
|
900
957
|
if (Object.keys(r).some(
|
|
901
|
-
(
|
|
902
|
-
) || !
|
|
958
|
+
(o) => !["href", "target", "rel", "class", "title"].includes(o)
|
|
959
|
+
) || !q(r.href))
|
|
903
960
|
return !1;
|
|
904
|
-
const
|
|
905
|
-
return !
|
|
961
|
+
const i = (o) => o == null || typeof o == "string";
|
|
962
|
+
return !i(r.rel) || !i(r.class) || !i(r.title) || r.target !== void 0 && r.target !== null && !["_blank", "_self"].includes(String(r.target)) ? !1 : r.target !== "_blank" || typeof r.rel == "string" && r.rel.split(/\s+/).includes("noopener");
|
|
906
963
|
}
|
|
907
964
|
function k(e, t, r = "") {
|
|
908
|
-
const
|
|
909
|
-
(
|
|
965
|
+
const i = Object.keys(e).find(
|
|
966
|
+
(o) => !t.includes(o)
|
|
910
967
|
);
|
|
911
|
-
return
|
|
968
|
+
return i ? r ? `${r}.${i}` : i : null;
|
|
912
969
|
}
|
|
913
|
-
function
|
|
970
|
+
function V(e, t = "knowledge.doc", r = !1) {
|
|
914
971
|
if (e === null) return null;
|
|
915
|
-
const
|
|
972
|
+
const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new WeakSet();
|
|
916
973
|
function a(n, s, c, l = !1) {
|
|
917
|
-
var d, y,
|
|
918
|
-
if (!n || typeof n != "object" || !n.type || !$e.has(n.type) ||
|
|
974
|
+
var d, y, g, m, f, b, L, _, j, R, h, C, D, B, N, K, M, F, E, U, z, W, H, Q, J, G, Y, X, Z, ee, te, ne, re, oe, ie, se, ae;
|
|
975
|
+
if (!n || typeof n != "object" || !n.type || !$e.has(n.type) || o.has(n) || (o.add(n), c ? !((d = de[c]) != null && d.has(n.type)) : n.type !== "doc") || !r && l && n.type === "businessToken" && ((g = I((y = n.attrs) == null ? void 0 : y.kind)) == null ? void 0 : g.allowInOriginalReply) === !1)
|
|
919
976
|
return s;
|
|
920
977
|
for (const p of Object.keys(n))
|
|
921
978
|
if (!["type", "attrs", "content", "marks", "text"].includes(p))
|
|
@@ -926,21 +983,21 @@ function x(e, t = "knowledge.doc", r = !1) {
|
|
|
926
983
|
n.type
|
|
927
984
|
) && !((m = n.content) != null && m.length))
|
|
928
985
|
return `${s}.content`;
|
|
929
|
-
if (n.type === "listItem" && ((b = (
|
|
930
|
-
return (
|
|
986
|
+
if (n.type === "listItem" && ((b = (f = n.content) == null ? void 0 : f[0]) == null ? void 0 : b.type) !== "paragraph")
|
|
987
|
+
return (L = n.content) != null && L.length ? `${s}.content[0]` : `${s}.content`;
|
|
931
988
|
if (n.text !== void 0 && n.type !== "text") return `${s}.text`;
|
|
932
989
|
if (n.type === "text" && (typeof n.text != "string" || n.text.length === 0))
|
|
933
990
|
return `${s}.text`;
|
|
934
991
|
if (n.type === "text" && n.content !== void 0)
|
|
935
992
|
return `${s}.content`;
|
|
936
|
-
if ((
|
|
993
|
+
if ((_ = n.content) != null && _.length && !de[n.type])
|
|
937
994
|
return `${s}.content`;
|
|
938
995
|
if (n.attrs !== void 0 && (!n.attrs || typeof n.attrs != "object" || Array.isArray(n.attrs)))
|
|
939
996
|
return `${s}.attrs`;
|
|
940
|
-
const u =
|
|
997
|
+
const u = pt[n.type] || /* @__PURE__ */ new Set();
|
|
941
998
|
for (const p of Object.keys(n.attrs || {}))
|
|
942
999
|
if (!u.has(p)) return `${s}.attrs.${p}`;
|
|
943
|
-
if (n.type === "businessToken" && !be((
|
|
1000
|
+
if (n.type === "businessToken" && !be((j = n.attrs) == null ? void 0 : j.kind))
|
|
944
1001
|
return `${s}.attrs.kind`;
|
|
945
1002
|
if (n.type === "businessToken") {
|
|
946
1003
|
const p = (C = (h = I(
|
|
@@ -954,14 +1011,14 @@ function x(e, t = "knowledge.doc", r = !1) {
|
|
|
954
1011
|
return `${s}.attrs.label`;
|
|
955
1012
|
if (n.type === "businessToken" && ((N = n.attrs) == null ? void 0 : N.token) !== void 0 && n.attrs.token !== null && typeof n.attrs.token != "string")
|
|
956
1013
|
return `${s}.attrs.token`;
|
|
957
|
-
if (n.type === "businessToken" && ((K = n.attrs) == null ? void 0 : K.params) != null && (!((M = I(n.attrs.kind)) != null && M.allowsParams) || typeof n.attrs.params != "object" || Array.isArray(n.attrs.params) ||
|
|
1014
|
+
if (n.type === "businessToken" && ((K = n.attrs) == null ? void 0 : K.params) != null && (!((M = I(n.attrs.kind)) != null && M.allowsParams) || typeof n.attrs.params != "object" || Array.isArray(n.attrs.params) || ge(n.attrs.params) !== null || JSON.stringify(n.attrs.params).length > 8192))
|
|
958
1015
|
return `${s}.attrs.params`;
|
|
959
1016
|
if (n.type === "mediaBlock" && !we((F = n.attrs) == null ? void 0 : F.kind))
|
|
960
1017
|
return `${s}.attrs.kind`;
|
|
961
1018
|
if (n.type === "mediaBlock") {
|
|
962
1019
|
if (((E = n.attrs) == null ? void 0 : E.sourceType) !== void 0 && n.attrs.sourceType !== null && n.attrs.sourceType !== "qianniuVideo")
|
|
963
1020
|
return `${s}.attrs.sourceType`;
|
|
964
|
-
if (((U = n.attrs) == null ? void 0 : U.sourceType) === "qianniuVideo" && (n.attrs.kind !== "video" ||
|
|
1021
|
+
if (((U = n.attrs) == null ? void 0 : U.sourceType) === "qianniuVideo" && (n.attrs.kind !== "video" || !it(n.attrs.assetId) || !st(n.attrs.src)))
|
|
965
1022
|
return `${s}.attrs.sourceType`;
|
|
966
1023
|
if (((z = n.attrs) == null ? void 0 : z.assetId) !== void 0 && n.attrs.assetId !== null && typeof n.attrs.assetId != "string")
|
|
967
1024
|
return `${s}.attrs.assetId`;
|
|
@@ -969,31 +1026,31 @@ function x(e, t = "knowledge.doc", r = !1) {
|
|
|
969
1026
|
return `${s}.attrs.name`;
|
|
970
1027
|
if (((H = n.attrs) == null ? void 0 : H.error) !== void 0 && typeof n.attrs.error != "string")
|
|
971
1028
|
return `${s}.attrs.error`;
|
|
972
|
-
if (((
|
|
1029
|
+
if (((Q = n.attrs) == null ? void 0 : Q.status) !== void 0 && !["ready", "uploading", "error"].includes(String(n.attrs.status)))
|
|
973
1030
|
return `${s}.attrs.status`;
|
|
974
|
-
const p = (((
|
|
975
|
-
if (!
|
|
1031
|
+
const p = (((J = n.attrs) == null ? void 0 : J.status) === "uploading" || ((G = n.attrs) == null ? void 0 : G.status) === "error") && typeof ((Y = n.attrs) == null ? void 0 : Y.src) == "string" && n.attrs.src.startsWith("blob:");
|
|
1032
|
+
if (!q((X = n.attrs) == null ? void 0 : X.src) && !p)
|
|
976
1033
|
return `${s}.attrs.src`;
|
|
977
|
-
if (((Z = n.attrs) == null ? void 0 : Z.poster) !== void 0 && n.attrs.poster !== null && !
|
|
1034
|
+
if (((Z = n.attrs) == null ? void 0 : Z.poster) !== void 0 && n.attrs.poster !== null && !q(n.attrs.poster))
|
|
978
1035
|
return `${s}.attrs.poster`;
|
|
979
1036
|
}
|
|
980
1037
|
if (O(n.type)) {
|
|
981
1038
|
const p = (ee = n.attrs) == null ? void 0 : ee.id;
|
|
982
|
-
if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() ||
|
|
1039
|
+
if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() || i.has(p)))
|
|
983
1040
|
return `${s}.attrs.id`;
|
|
984
|
-
if (typeof p == "string" &&
|
|
1041
|
+
if (typeof p == "string" && i.add(p), ((te = n.attrs) == null ? void 0 : te.nodeVersion) !== void 0 && (!Number.isSafeInteger(n.attrs.nodeVersion) || n.attrs.nodeVersion < 0))
|
|
985
1042
|
return `${s}.attrs.nodeVersion`;
|
|
986
1043
|
}
|
|
987
1044
|
if (n.type === "orderedList" && ((ne = n.attrs) == null ? void 0 : ne.start) !== void 0 && (!Number.isSafeInteger(n.attrs.start) || n.attrs.start < 1))
|
|
988
1045
|
return `${s}.attrs.start`;
|
|
989
1046
|
if (n.type === "orderedList" && ((re = n.attrs) == null ? void 0 : re.type) !== void 0 && n.attrs.type !== null && !["1", "a", "A", "i", "I"].includes(n.attrs.type))
|
|
990
1047
|
return `${s}.attrs.type`;
|
|
991
|
-
if (n.type === "codeBlock" && ((
|
|
1048
|
+
if (n.type === "codeBlock" && ((oe = n.attrs) == null ? void 0 : oe.language) !== void 0 && n.attrs.language !== null && typeof n.attrs.language != "string")
|
|
992
1049
|
return `${s}.attrs.language`;
|
|
993
1050
|
if (n.marks !== void 0 && !Array.isArray(n.marks))
|
|
994
1051
|
return `${s}.marks`;
|
|
995
|
-
if (c === "codeBlock" && ((
|
|
996
|
-
if ((se = n.marks) != null && se.some((p) => !
|
|
1052
|
+
if (c === "codeBlock" && ((ie = n.marks) != null && ie.length)) return `${s}.marks`;
|
|
1053
|
+
if ((se = n.marks) != null && se.some((p) => !dt(p)))
|
|
997
1054
|
return `${s}.marks`;
|
|
998
1055
|
if ((ae = n.marks) != null && ae.length) {
|
|
999
1056
|
const p = n.marks.map((T) => T.type);
|
|
@@ -1013,37 +1070,37 @@ function x(e, t = "knowledge.doc", r = !1) {
|
|
|
1013
1070
|
}
|
|
1014
1071
|
return a(e, t);
|
|
1015
1072
|
}
|
|
1016
|
-
function
|
|
1073
|
+
function gt(e, t, r = "knowledge.doc") {
|
|
1017
1074
|
if (!e) return null;
|
|
1018
|
-
const
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1021
|
-
const s =
|
|
1022
|
-
if (s && !
|
|
1075
|
+
const i = /* @__PURE__ */ new WeakSet(), o = (a, n) => {
|
|
1076
|
+
if (i.has(a)) return n;
|
|
1077
|
+
i.add(a);
|
|
1078
|
+
const s = rt(a);
|
|
1079
|
+
if (s && !P.some(
|
|
1023
1080
|
(c) => c.id === s.id && c.slot === s.slot && c.types.includes(t)
|
|
1024
1081
|
))
|
|
1025
1082
|
return n;
|
|
1026
1083
|
for (const [c, l] of (a.content || []).entries()) {
|
|
1027
|
-
const u =
|
|
1084
|
+
const u = o(l, `${n}.content[${c}]`);
|
|
1028
1085
|
if (u) return u;
|
|
1029
1086
|
}
|
|
1030
1087
|
return null;
|
|
1031
1088
|
};
|
|
1032
|
-
return
|
|
1089
|
+
return o(e, r);
|
|
1033
1090
|
}
|
|
1034
|
-
function
|
|
1091
|
+
function vt(e) {
|
|
1035
1092
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1036
|
-
const t = e, r = t.question,
|
|
1037
|
-
return ["normal", "reasoning", "agent"].includes(String(t.type)) && !!r && typeof r == "object" && !Array.isArray(r) && typeof r.text == "string" && !!
|
|
1093
|
+
const t = e, r = t.question, i = t.knowledge;
|
|
1094
|
+
return ["normal", "reasoning", "agent"].includes(String(t.type)) && !!r && typeof r == "object" && !Array.isArray(r) && typeof r.text == "string" && !!i && typeof i == "object" && !Array.isArray(i) && Object.prototype.hasOwnProperty.call(i, "doc") && !!t.extensionState && typeof t.extensionState == "object" && !Array.isArray(t.extensionState);
|
|
1038
1095
|
}
|
|
1039
|
-
function
|
|
1096
|
+
function Vt(e) {
|
|
1040
1097
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1041
1098
|
return "modelValue";
|
|
1042
|
-
const t =
|
|
1099
|
+
const t = ge(e);
|
|
1043
1100
|
if (t !== null) return t || "modelValue";
|
|
1044
1101
|
const r = e;
|
|
1045
1102
|
if (r.schemaVersion !== 1) return "schemaVersion";
|
|
1046
|
-
const
|
|
1103
|
+
const i = k(r, [
|
|
1047
1104
|
"schemaVersion",
|
|
1048
1105
|
"id",
|
|
1049
1106
|
"type",
|
|
@@ -1051,17 +1108,17 @@ function St(e) {
|
|
|
1051
1108
|
"knowledge",
|
|
1052
1109
|
"extensionState"
|
|
1053
1110
|
]);
|
|
1054
|
-
if (
|
|
1111
|
+
if (i) return i;
|
|
1055
1112
|
if (r.id !== void 0 && typeof r.id != "string") return "id";
|
|
1056
1113
|
if (!["normal", "reasoning", "agent"].includes(r.type)) return "type";
|
|
1057
1114
|
if (!r.question || typeof r.question != "object" || Array.isArray(r.question) || typeof r.question.text != "string")
|
|
1058
1115
|
return "question.text";
|
|
1059
|
-
const
|
|
1116
|
+
const o = k(
|
|
1060
1117
|
r.question,
|
|
1061
1118
|
["text"],
|
|
1062
1119
|
"question"
|
|
1063
1120
|
);
|
|
1064
|
-
if (
|
|
1121
|
+
if (o) return o;
|
|
1065
1122
|
if (!r.knowledge || typeof r.knowledge != "object" || Array.isArray(r.knowledge))
|
|
1066
1123
|
return "knowledge";
|
|
1067
1124
|
const a = k(
|
|
@@ -1090,14 +1147,14 @@ function St(e) {
|
|
|
1090
1147
|
);
|
|
1091
1148
|
if (u) return u;
|
|
1092
1149
|
}
|
|
1093
|
-
const n =
|
|
1150
|
+
const n = V(r.knowledge.doc);
|
|
1094
1151
|
if (n) return n;
|
|
1095
|
-
const s =
|
|
1152
|
+
const s = gt(
|
|
1096
1153
|
r.knowledge.doc,
|
|
1097
1154
|
r.type
|
|
1098
1155
|
);
|
|
1099
1156
|
if (s) return s;
|
|
1100
|
-
const c =
|
|
1157
|
+
const c = V(
|
|
1101
1158
|
r.knowledge.retainedDoc ?? null,
|
|
1102
1159
|
"knowledge.retainedDoc",
|
|
1103
1160
|
r.type === "agent"
|
|
@@ -1106,7 +1163,7 @@ function St(e) {
|
|
|
1106
1163
|
if (r.type === "agent") {
|
|
1107
1164
|
if (r.knowledge.agentBody && r.knowledge.retainedDoc)
|
|
1108
1165
|
return "knowledge.agentBody";
|
|
1109
|
-
const l =
|
|
1166
|
+
const l = V(
|
|
1110
1167
|
r.knowledge.agentBody ?? null,
|
|
1111
1168
|
"knowledge.agentBody",
|
|
1112
1169
|
!0
|
|
@@ -1116,8 +1173,8 @@ function St(e) {
|
|
|
1116
1173
|
if (!r.extensionState || typeof r.extensionState != "object" || Array.isArray(r.extensionState))
|
|
1117
1174
|
return "extensionState";
|
|
1118
1175
|
for (const [l, u] of Object.entries(r.extensionState)) {
|
|
1119
|
-
const d =
|
|
1120
|
-
(
|
|
1176
|
+
const d = P.find(
|
|
1177
|
+
(g) => g.id === l && g.types.includes(r.type) && g.implementation === "plugin"
|
|
1121
1178
|
);
|
|
1122
1179
|
if (!d) return `extensionState.${l}`;
|
|
1123
1180
|
if (!u || typeof u != "object" || u.version !== d.dataVersion)
|
|
@@ -1133,20 +1190,20 @@ function St(e) {
|
|
|
1133
1190
|
if (d.slot === "questionAction" && typeof u.data.enabled != "boolean")
|
|
1134
1191
|
return `extensionState.${l}.data.enabled`;
|
|
1135
1192
|
if (d.slot === "questionAction" && d.questionTag) {
|
|
1136
|
-
const
|
|
1137
|
-
if (
|
|
1193
|
+
const g = u.data;
|
|
1194
|
+
if (g.enabled === !0 && g.tag === void 0)
|
|
1138
1195
|
return `extensionState.${l}.data.tag`;
|
|
1139
|
-
if (
|
|
1140
|
-
const { tag: m } =
|
|
1196
|
+
if (g.tag !== void 0) {
|
|
1197
|
+
const { tag: m } = g;
|
|
1141
1198
|
if (!m || typeof m != "object" || Array.isArray(m))
|
|
1142
1199
|
return `extensionState.${l}.data.tag`;
|
|
1143
|
-
const
|
|
1144
|
-
if (typeof
|
|
1200
|
+
const f = m;
|
|
1201
|
+
if (typeof f.id != "string" || !f.id.trim())
|
|
1145
1202
|
return `extensionState.${l}.data.tag.id`;
|
|
1146
|
-
if (typeof
|
|
1203
|
+
if (typeof f.label != "string" || !f.label.trim() || he(f.label))
|
|
1147
1204
|
return `extensionState.${l}.data.tag.label`;
|
|
1148
1205
|
const b = k(
|
|
1149
|
-
|
|
1206
|
+
f,
|
|
1150
1207
|
["id", "label"],
|
|
1151
1208
|
`extensionState.${l}.data.tag`
|
|
1152
1209
|
);
|
|
@@ -1157,41 +1214,42 @@ function St(e) {
|
|
|
1157
1214
|
return null;
|
|
1158
1215
|
}
|
|
1159
1216
|
export {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1217
|
+
nt as A,
|
|
1218
|
+
ot as B,
|
|
1219
|
+
Ge as C,
|
|
1220
|
+
P as D,
|
|
1221
|
+
ft as E,
|
|
1222
|
+
rt as F,
|
|
1223
|
+
It as G,
|
|
1224
|
+
vt as H,
|
|
1225
|
+
he as I,
|
|
1226
|
+
ke as J,
|
|
1227
|
+
lt as K,
|
|
1228
|
+
Ye as M,
|
|
1229
|
+
ge as a,
|
|
1230
|
+
V as b,
|
|
1231
|
+
fe as c,
|
|
1174
1232
|
O as d,
|
|
1175
|
-
|
|
1233
|
+
ct as e,
|
|
1176
1234
|
pe as f,
|
|
1177
1235
|
I as g,
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1236
|
+
at as h,
|
|
1237
|
+
q as i,
|
|
1238
|
+
Vt as j,
|
|
1239
|
+
Ke as k,
|
|
1240
|
+
yt as l,
|
|
1241
|
+
bt as m,
|
|
1242
|
+
wt as n,
|
|
1243
|
+
it as o,
|
|
1244
|
+
kt as p,
|
|
1245
|
+
st as q,
|
|
1246
|
+
At as r,
|
|
1247
|
+
Tt as s,
|
|
1248
|
+
$t as t,
|
|
1249
|
+
be as u,
|
|
1250
|
+
A as v,
|
|
1251
|
+
St as w,
|
|
1252
|
+
mt as x,
|
|
1253
|
+
$ as y,
|
|
1254
|
+
ht as z
|
|
1197
1255
|
};
|