@freecallai/pro 0.0.11 → 0.0.13
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 +23 -2
- package/dist/{FkpRichText.vue_vue_type_script_setup_true_lang-D2sgT7XP.js → FkpRichText.vue_vue_type_script_setup_true_lang-D-SOdFra.js} +1811 -1781
- package/dist/{KnowledgeArea-Sbfs_E0C.js → KnowledgeArea-ClZoLiaZ.js} +1 -1
- package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-CoFF-WCe.js +1830 -0
- package/dist/{ToolForm-_ZTW7lwU.js → ToolForm-BK9epxdr.js} +1 -1
- package/dist/agent-prompt-editor/index.js +575 -549
- package/dist/agent-prompt-editor/legacy-converter/index.js +98 -94
- package/dist/{choice-BqjECVyx.js → choice-UgePgrSl.js} +1 -1
- package/dist/{guard-BmLOamCj.js → guard-DPwe4mCm.js} +200 -185
- package/dist/{index-gS1h8iW8.js → index-BIi3k45j.js} +1 -1
- package/dist/index-BMHUPL5x.js +5 -0
- package/dist/{index-B1rTu0jX.js → index-CaA13lC9.js} +1 -1
- package/dist/{index-6VSUucFX.js → index-ChuzFuNm.js} +1 -1
- package/dist/index-DJLfgC4v.js +5 -0
- package/dist/{index-0BXLYaKG.js → index-DfKH-RZq.js} +2 -2
- package/dist/{index-CN2knQcE.js → index-DiLMgNEe.js} +1 -1
- package/dist/{index-BDinNJn_.js → index-RHu4JIw7.js} +1 -1
- package/dist/{index-CCwmXuSJ.js → index-v1UD08i6.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{inline-CRGzAti7.js → inline-CVF1zEsG.js} +1 -1
- package/dist/{knowledge-DNDouB-s.js → knowledge-DWM6tWnP.js} +1 -1
- package/dist/media-extensions-YYbGuUQa.js +341 -0
- package/dist/{media-migration-D1KoHKoP.js → media-migration-BctCLEuT.js} +1 -1
- package/dist/media-policy-B1UuSN2e.js +215 -0
- package/dist/{media-upload-C5N6YWHu.js → media-upload-DtH-oCtw.js} +1 -1
- package/dist/{model-BVh9EZ9G.js → model-VLLhEQfn.js} +1 -1
- package/dist/rich-text/index.js +6 -6
- package/dist/rich-text/legacy-converter/index.js +357 -355
- package/dist/style.css +1 -1
- package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +37 -2
- package/dist/types/agent-prompt-editor/index.d.ts +1 -0
- package/dist/types/agent-prompt-editor/types.d.ts +4 -0
- package/dist/types/filters/FkpFilter.vue.d.ts +2 -2
- package/dist/types/filters/FkpFilterDateRange.vue.d.ts +2 -2
- package/dist/types/filters/FkpFilterPeriod.vue.d.ts +2 -2
- package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/rich-text/FkpRichText.vue.d.ts +20 -2
- package/dist/types/rich-text/index.d.ts +1 -0
- package/dist/types/rich-text/model/qianniu-video.d.ts +2 -0
- package/dist/types/rich-text/plugins/attribute/token.d.ts +1 -0
- package/dist/types/rich-text/plugins/tableKnowledge/token.d.ts +1 -0
- package/dist/types/rich-text/plugins/ticket/token.d.ts +2 -1
- package/dist/types/rich-text/plugins/token-catalog.d.ts +4 -1
- package/dist/types/rich-text/plugins/token-definition.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +7 -2
- package/dist/types/rich-text/runtime/document-adapter.d.ts +3 -0
- package/dist/types/rich-text/runtime/media-sources.d.ts +1 -1
- package/dist/types/rich-text/runtime/tag-validity.d.ts +46 -0
- package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +2 -2
- package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +10 -0
- package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +23 -14
- package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
- package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
- package/package.json +5 -4
- package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-BNDRTWXW.js +0 -1659
- package/dist/index-CAczgwau.js +0 -5
- package/dist/index-faGbB8v6.js +0 -5
- package/dist/media-extensions-wlcCEdtg.js +0 -324
- package/dist/media-policy-D3-Qglzz.js +0 -158
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ce = [
|
|
2
2
|
"若使用千牛内部应用接待:",
|
|
3
3
|
"「辅助接待」模式,将顾客标记为“需介入”;",
|
|
4
4
|
"「全自动接待」模式,将按千牛分流规则直接转接(不支持福客转接方案)"
|
|
5
|
-
],
|
|
5
|
+
], Se = [
|
|
6
6
|
{
|
|
7
7
|
id: "todo",
|
|
8
8
|
apiVersion: 1,
|
|
@@ -20,7 +20,7 @@ const ae = [
|
|
|
20
20
|
classes: ["is-todo-menu"],
|
|
21
21
|
width: 296,
|
|
22
22
|
helpClass: "fkp-todo-help",
|
|
23
|
-
warning:
|
|
23
|
+
warning: ce,
|
|
24
24
|
guidanceClass: "fkp-todo-guidance",
|
|
25
25
|
guidance: [
|
|
26
26
|
"常规知识可直接开启待办标签;",
|
|
@@ -50,7 +50,7 @@ const ae = [
|
|
|
50
50
|
classes: ["is-todo-menu"],
|
|
51
51
|
width: 296,
|
|
52
52
|
helpClass: "fkp-todo-help",
|
|
53
|
-
warning:
|
|
53
|
+
warning: ce,
|
|
54
54
|
guidanceClass: "fkp-todo-guidance",
|
|
55
55
|
guidance: [
|
|
56
56
|
"常规知识可直接开启待办标签;",
|
|
@@ -62,7 +62,7 @@ const ae = [
|
|
|
62
62
|
optionSource: "flatTags",
|
|
63
63
|
optionTrigger: "hover"
|
|
64
64
|
}
|
|
65
|
-
],
|
|
65
|
+
], Ae = [
|
|
66
66
|
{
|
|
67
67
|
id: "tableKnowledge",
|
|
68
68
|
apiVersion: 1,
|
|
@@ -88,7 +88,7 @@ const ae = [
|
|
|
88
88
|
optionSource: "flatTags",
|
|
89
89
|
optionTrigger: "hover"
|
|
90
90
|
}
|
|
91
|
-
],
|
|
91
|
+
], Te = [
|
|
92
92
|
{
|
|
93
93
|
id: "ticket",
|
|
94
94
|
apiVersion: 1,
|
|
@@ -121,7 +121,7 @@ const ae = [
|
|
|
121
121
|
optionSource: "flatTags",
|
|
122
122
|
optionTrigger: "hover"
|
|
123
123
|
}
|
|
124
|
-
],
|
|
124
|
+
], Ie = [
|
|
125
125
|
{
|
|
126
126
|
id: "originalReply",
|
|
127
127
|
apiVersion: 1,
|
|
@@ -148,7 +148,7 @@ const ae = [
|
|
|
148
148
|
types: ["reasoning"],
|
|
149
149
|
icon: "quote"
|
|
150
150
|
}
|
|
151
|
-
],
|
|
151
|
+
], ve = [
|
|
152
152
|
{
|
|
153
153
|
id: "memory",
|
|
154
154
|
apiVersion: 1,
|
|
@@ -161,7 +161,7 @@ const ae = [
|
|
|
161
161
|
types: ["normal", "reasoning", "agent"],
|
|
162
162
|
icon: "memory"
|
|
163
163
|
}
|
|
164
|
-
],
|
|
164
|
+
], xe = [
|
|
165
165
|
{
|
|
166
166
|
id: "tagged",
|
|
167
167
|
apiVersion: 1,
|
|
@@ -188,7 +188,7 @@ const ae = [
|
|
|
188
188
|
optionTrigger: "hover",
|
|
189
189
|
questionTag: { kind: "default", protocolLabel: "顾客标签" }
|
|
190
190
|
}
|
|
191
|
-
],
|
|
191
|
+
], qe = [
|
|
192
192
|
{
|
|
193
193
|
id: "attribute",
|
|
194
194
|
apiVersion: 1,
|
|
@@ -216,7 +216,7 @@ const ae = [
|
|
|
216
216
|
optionTrigger: "hover",
|
|
217
217
|
optionHierarchy: "tree"
|
|
218
218
|
}
|
|
219
|
-
],
|
|
219
|
+
], Pe = [
|
|
220
220
|
{
|
|
221
221
|
id: "tool",
|
|
222
222
|
apiVersion: 1,
|
|
@@ -245,7 +245,7 @@ const ae = [
|
|
|
245
245
|
optionHierarchy: "tree",
|
|
246
246
|
uiPorts: ["getToolForm"]
|
|
247
247
|
}
|
|
248
|
-
],
|
|
248
|
+
], Ve = [
|
|
249
249
|
{
|
|
250
250
|
id: "variable",
|
|
251
251
|
apiVersion: 1,
|
|
@@ -271,7 +271,7 @@ const ae = [
|
|
|
271
271
|
optionTrigger: "hover"
|
|
272
272
|
}
|
|
273
273
|
];
|
|
274
|
-
const
|
|
274
|
+
const ct = {
|
|
275
275
|
agents: "searchAgents",
|
|
276
276
|
variables: "listVariables",
|
|
277
277
|
flatTags: "listCapabilityOptions",
|
|
@@ -294,7 +294,7 @@ const w = {
|
|
|
294
294
|
requiredPorts: [],
|
|
295
295
|
optionalPorts: ["getReasoningTemplate", "listCapabilityOptions"]
|
|
296
296
|
}
|
|
297
|
-
},
|
|
297
|
+
}, Oe = [
|
|
298
298
|
{
|
|
299
299
|
id: "image",
|
|
300
300
|
apiVersion: 1,
|
|
@@ -309,7 +309,7 @@ const w = {
|
|
|
309
309
|
icon: "pic",
|
|
310
310
|
optionKind: "media"
|
|
311
311
|
}
|
|
312
|
-
],
|
|
312
|
+
], _e = [
|
|
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
|
+
], je = [
|
|
328
328
|
{
|
|
329
329
|
id: "separator",
|
|
330
330
|
apiVersion: 1,
|
|
@@ -337,7 +337,7 @@ const w = {
|
|
|
337
337
|
types: ["normal", "reasoning"],
|
|
338
338
|
icon: "sep"
|
|
339
339
|
}
|
|
340
|
-
],
|
|
340
|
+
], Le = [
|
|
341
341
|
{
|
|
342
342
|
id: "reasoningPolish",
|
|
343
343
|
apiVersion: 1,
|
|
@@ -351,7 +351,7 @@ const w = {
|
|
|
351
351
|
types: ["reasoning"],
|
|
352
352
|
icon: "AI"
|
|
353
353
|
}
|
|
354
|
-
],
|
|
354
|
+
], Re = [
|
|
355
355
|
{
|
|
356
356
|
id: "reasoningTemplate",
|
|
357
357
|
apiVersion: 1,
|
|
@@ -374,7 +374,7 @@ const w = {
|
|
|
374
374
|
optionKind: "selection",
|
|
375
375
|
optionSource: "reasoningTemplates"
|
|
376
376
|
}
|
|
377
|
-
],
|
|
377
|
+
], Ce = [
|
|
378
378
|
{
|
|
379
379
|
id: "agentSelect",
|
|
380
380
|
apiVersion: 1,
|
|
@@ -402,24 +402,24 @@ const w = {
|
|
|
402
402
|
optionSource: "agents",
|
|
403
403
|
optionTrigger: "hover"
|
|
404
404
|
}
|
|
405
|
-
],
|
|
406
|
-
...he,
|
|
405
|
+
], V = [
|
|
407
406
|
...Se,
|
|
408
|
-
...$e,
|
|
409
|
-
...Ae,
|
|
410
407
|
...Te,
|
|
408
|
+
...Ae,
|
|
411
409
|
...Ie,
|
|
412
|
-
...xe,
|
|
413
410
|
...ve,
|
|
414
|
-
...
|
|
411
|
+
...xe,
|
|
415
412
|
...qe,
|
|
416
|
-
...
|
|
413
|
+
...Pe,
|
|
417
414
|
...Ve,
|
|
415
|
+
...Oe,
|
|
418
416
|
..._e,
|
|
419
417
|
...je,
|
|
420
|
-
...Le
|
|
418
|
+
...Le,
|
|
419
|
+
...Re,
|
|
420
|
+
...Ce
|
|
421
421
|
];
|
|
422
|
-
function
|
|
422
|
+
function fe(e, t = "") {
|
|
423
423
|
const r = /* @__PURE__ */ new Set(), o = (i, a, n) => {
|
|
424
424
|
if (i === null || typeof i == "string" || typeof i == "boolean")
|
|
425
425
|
return null;
|
|
@@ -468,26 +468,26 @@ function S(e, t, r) {
|
|
|
468
468
|
serialize: r
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
const
|
|
471
|
+
const De = S(
|
|
472
472
|
"待办",
|
|
473
473
|
"rte-todo",
|
|
474
474
|
(e) => e.label === "默认" && e.token === "{待办}" ? "{待办}" : `{待办@${e.label || e.key}}`
|
|
475
475
|
);
|
|
476
|
-
function
|
|
476
|
+
function ut(e) {
|
|
477
477
|
const t = e.match(/^\{智能工单@name=([^{};\r\n]+);id=([^\s{};]+)\}$/u);
|
|
478
478
|
if (t && t[1].trim())
|
|
479
479
|
return { key: t[2], label: t[1], params: { protocol: "legacy" } };
|
|
480
480
|
const r = e.match(/^\{智能建单@([^\s{}:]+):([^{}\r\n]+)\}$/u);
|
|
481
481
|
return r && r[2].trim() ? { key: r[1], label: r[2] } : null;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Be(e, t, r) {
|
|
484
484
|
return (r == null ? void 0 : r.protocol) === "legacy" ? `{智能工单@name=${t};id=${e}}` : `{智能建单@${e}:${t}}`;
|
|
485
485
|
}
|
|
486
|
-
const
|
|
486
|
+
const Ne = {
|
|
487
487
|
...S(
|
|
488
488
|
"工单",
|
|
489
489
|
"AI-ticket",
|
|
490
|
-
(e) =>
|
|
490
|
+
(e) => Be(
|
|
491
491
|
String(e.key || ""),
|
|
492
492
|
String(e.label || ""),
|
|
493
493
|
e.params
|
|
@@ -497,17 +497,17 @@ const De = {
|
|
|
497
497
|
validate(e) {
|
|
498
498
|
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
499
|
}
|
|
500
|
-
},
|
|
500
|
+
}, Ke = {
|
|
501
501
|
...S(
|
|
502
502
|
"表格知识",
|
|
503
503
|
"table-knowledge",
|
|
504
504
|
(e) => `##${e.label}##`
|
|
505
505
|
),
|
|
506
506
|
validate: (e) => typeof e.label != "string" || !e.label.trim() || /[#\r\n]/u.test(e.label) ? "label" : null
|
|
507
|
-
},
|
|
507
|
+
}, Me = {
|
|
508
508
|
...S("属性", "prte-reference", (e) => `{属性@${e.key}}`),
|
|
509
509
|
allowInOriginalReply: !1
|
|
510
|
-
},
|
|
510
|
+
}, Fe = {
|
|
511
511
|
requiresInsertToken: !0,
|
|
512
512
|
present(e) {
|
|
513
513
|
const t = String(e.label || e.key || "");
|
|
@@ -519,7 +519,8 @@ const De = {
|
|
|
519
519
|
};
|
|
520
520
|
},
|
|
521
521
|
serialize: (e) => String(e.token || `#${e.key}#`)
|
|
522
|
-
},
|
|
522
|
+
}, Ee = {
|
|
523
|
+
validateValidity: !1,
|
|
523
524
|
present: (e) => ({
|
|
524
525
|
layout: "inline",
|
|
525
526
|
icon: "sep",
|
|
@@ -528,7 +529,7 @@ const De = {
|
|
|
528
529
|
}),
|
|
529
530
|
serialize: () => "{分隔符}"
|
|
530
531
|
};
|
|
531
|
-
function
|
|
532
|
+
function Ue(e, t) {
|
|
532
533
|
if (e !== "order_note" && e !== "small_payment") return null;
|
|
533
534
|
const r = t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
534
535
|
if (e === "small_payment") {
|
|
@@ -541,14 +542,14 @@ function Fe(e, t) {
|
|
|
541
542
|
}
|
|
542
543
|
return { label: "备注", icon: "msg-tag", summary: r.contentMode === "smart" ? "智能提取" : typeof r.content == "string" ? r.content.replace(/\s+/g, " ").trim() : "" };
|
|
543
544
|
}
|
|
544
|
-
const
|
|
545
|
+
const ge = (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), $ = {
|
|
545
546
|
none: "不标记",
|
|
546
547
|
red: "红色",
|
|
547
548
|
yellow: "黄色",
|
|
548
549
|
green: "绿色",
|
|
549
550
|
blue: "蓝色",
|
|
550
551
|
purple: "紫色"
|
|
551
|
-
},
|
|
552
|
+
}, pt = {
|
|
552
553
|
none: "",
|
|
553
554
|
red: "#f53f3f",
|
|
554
555
|
yellow: "#ff7d00",
|
|
@@ -559,21 +560,21 @@ const de = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), ge = (e
|
|
|
559
560
|
function A(e) {
|
|
560
561
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
561
562
|
const t = e;
|
|
562
|
-
return
|
|
563
|
+
return ye(t.id) && (t.contentMode === "fixed" || t.contentMode === "smart") && typeof t.content == "string" && !!t.content.trim() && [...t.content.trim()].length <= 500 && !/\^\^|\$\$|¥¥/.test(t.content) && !t.content.endsWith("^") && Object.hasOwn($, String(t.flag)) && typeof t.preserveFlag == "boolean" && (t.position === "first" || t.position === "last");
|
|
563
564
|
}
|
|
564
|
-
function
|
|
565
|
+
function ue() {
|
|
565
566
|
return `rmk_${crypto.randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
|
566
567
|
}
|
|
567
|
-
function
|
|
568
|
+
function dt(e, t, r, o, i) {
|
|
568
569
|
if (e !== "small_payment" && e !== "order_note")
|
|
569
570
|
return { ok: !0, params: t };
|
|
570
571
|
let a = 0;
|
|
571
572
|
const n = /* @__PURE__ */ new Set(), s = (u) => {
|
|
572
|
-
var d, y,
|
|
573
|
-
u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!i || u.attrs.id !== i) && (u.attrs.key === "small_payment" && a++, u.attrs.key === "order_note" && n.add(String(((y = u.attrs.params) == null ? void 0 : y.id) || ""))), (
|
|
573
|
+
var d, y, f;
|
|
574
|
+
u.type === "businessToken" && ((d = u.attrs) == null ? void 0 : d.kind) === "tool" && (!i || u.attrs.id !== i) && (u.attrs.key === "small_payment" && a++, u.attrs.key === "order_note" && n.add(String(((y = u.attrs.params) == null ? void 0 : y.id) || ""))), (f = u.content) == null || f.forEach(s);
|
|
574
575
|
};
|
|
575
576
|
if (o && s(o), e === "small_payment")
|
|
576
|
-
return
|
|
577
|
+
return ge(t.amount) ? a ? {
|
|
577
578
|
ok: !1,
|
|
578
579
|
code: "TOOL_LIMIT_REACHED",
|
|
579
580
|
message: "最多配置一个小额打款工具"
|
|
@@ -582,9 +583,9 @@ function ct(e, t, r, o, i) {
|
|
|
582
583
|
code: "TOOL_PARAMS_INVALID",
|
|
583
584
|
message: "打款金额必须是1-99的整数元"
|
|
584
585
|
};
|
|
585
|
-
let c =
|
|
586
|
+
let c = ye(r.id) ? r.id : ue();
|
|
586
587
|
if (!i)
|
|
587
|
-
for (; n.has(c); ) c =
|
|
588
|
+
for (; n.has(c); ) c = ue();
|
|
588
589
|
if (n.has(c))
|
|
589
590
|
return {
|
|
590
591
|
ok: !1,
|
|
@@ -598,7 +599,7 @@ function ct(e, t, r, o, i) {
|
|
|
598
599
|
message: "订单备注内容或配置不合法"
|
|
599
600
|
};
|
|
600
601
|
}
|
|
601
|
-
function
|
|
602
|
+
function ft(e) {
|
|
602
603
|
const t = /^\{外部方法@([^\s{}:]+):([^{}\r\n]+)\}$/u.exec(e);
|
|
603
604
|
if (t && t[2].trim())
|
|
604
605
|
return {
|
|
@@ -644,7 +645,7 @@ function ut(e) {
|
|
|
644
645
|
attrs: { kind: "tool", key: "order_note", label: "订单备注", params: a }
|
|
645
646
|
} : null;
|
|
646
647
|
}
|
|
647
|
-
function
|
|
648
|
+
function pe(e) {
|
|
648
649
|
var r;
|
|
649
650
|
if (e.type !== "businessToken" || ((r = e.attrs) == null ? void 0 : r.kind) !== "tool") return null;
|
|
650
651
|
const { params: t } = e.attrs;
|
|
@@ -652,9 +653,9 @@ function ce(e) {
|
|
|
652
653
|
const { sceneId: o, sceneName: i } = t || {};
|
|
653
654
|
return typeof o == "string" && /^[^\s{}:]+$/u.test(o) && typeof i == "string" && i.trim() && !/[{}\r\n]/u.test(i) ? `{外部方法@${o}:${i}}` : null;
|
|
654
655
|
}
|
|
655
|
-
return e.attrs.key === "small_payment" ?
|
|
656
|
+
return e.attrs.key === "small_payment" ? ge(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}^^`;
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function gt(e) {
|
|
658
659
|
try {
|
|
659
660
|
const t = JSON.parse(decodeURIComponent(e)), r = {
|
|
660
661
|
id: String(t.id || ""),
|
|
@@ -672,15 +673,15 @@ function pt(e) {
|
|
|
672
673
|
return null;
|
|
673
674
|
}
|
|
674
675
|
}
|
|
675
|
-
const
|
|
676
|
+
const ze = {
|
|
676
677
|
allowsParams: !0,
|
|
677
678
|
validate(e) {
|
|
678
679
|
return ["small_payment", "order_note", "external_method"].includes(
|
|
679
680
|
String(e.key)
|
|
680
|
-
) ?
|
|
681
|
+
) ? pe({ type: "businessToken", attrs: { ...e } }) ? null : "params" : null;
|
|
681
682
|
},
|
|
682
683
|
present(e) {
|
|
683
|
-
const t =
|
|
684
|
+
const t = Ue(e.key, e.params);
|
|
684
685
|
return t ? {
|
|
685
686
|
layout: "toolNote",
|
|
686
687
|
icon: t.icon,
|
|
@@ -699,7 +700,7 @@ const Ee = {
|
|
|
699
700
|
if (["small_payment", "order_note", "external_method"].includes(
|
|
700
701
|
String(e.key)
|
|
701
702
|
)) {
|
|
702
|
-
const t =
|
|
703
|
+
const t = pe({
|
|
703
704
|
type: "businessToken",
|
|
704
705
|
attrs: { ...e }
|
|
705
706
|
});
|
|
@@ -708,53 +709,53 @@ const Ee = {
|
|
|
708
709
|
}
|
|
709
710
|
return `{工具@${e.key}}`;
|
|
710
711
|
}
|
|
711
|
-
},
|
|
712
|
-
todo:
|
|
713
|
-
ticket:
|
|
714
|
-
tableKnowledge:
|
|
715
|
-
variable:
|
|
716
|
-
attribute:
|
|
717
|
-
tool:
|
|
718
|
-
separator:
|
|
719
|
-
},
|
|
712
|
+
}, me = {
|
|
713
|
+
todo: De,
|
|
714
|
+
ticket: Ne,
|
|
715
|
+
tableKnowledge: Ke,
|
|
716
|
+
variable: Fe,
|
|
717
|
+
attribute: Me,
|
|
718
|
+
tool: ze,
|
|
719
|
+
separator: Ee
|
|
720
|
+
}, q = me;
|
|
720
721
|
function I(e) {
|
|
721
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
722
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(q, e) ? q[e] : void 0;
|
|
722
723
|
}
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
),
|
|
726
|
-
(e) =>
|
|
727
|
-
),
|
|
724
|
+
const ke = Object.keys(
|
|
725
|
+
me
|
|
726
|
+
), We = ke.filter(
|
|
727
|
+
(e) => q[e].choice
|
|
728
|
+
), He = ["image", "video"], Je = new Set(ke), Qe = new Set(We), Ge = new Set(He), be = (e) => typeof e == "string" && Je.has(e), yt = (e) => typeof e == "string" && Qe.has(e), we = (e) => typeof e == "string" && Ge.has(e), Ye = /* @__PURE__ */ new Set([
|
|
728
729
|
"businessToken",
|
|
729
730
|
"originalReply",
|
|
730
731
|
"messageSeparator",
|
|
731
732
|
"mediaBlock"
|
|
732
|
-
]),
|
|
733
|
-
function
|
|
734
|
-
return e === "businessToken" ?
|
|
733
|
+
]), O = (e) => Ye.has(e);
|
|
734
|
+
function Xe(e, t) {
|
|
735
|
+
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;
|
|
735
736
|
}
|
|
736
|
-
function
|
|
737
|
-
const t =
|
|
737
|
+
function Ze(e) {
|
|
738
|
+
const t = Xe(e.type || "", e.attrs);
|
|
738
739
|
return t ? {
|
|
739
740
|
id: t,
|
|
740
741
|
slot: e.type === "businessToken" || e.type === "messageSeparator" ? "knowledgeInline" : "knowledgeBlock"
|
|
741
742
|
} : null;
|
|
742
743
|
}
|
|
743
|
-
function
|
|
744
|
+
function et(e) {
|
|
744
745
|
var t;
|
|
745
746
|
return !!((t = e.content) != null && t.some(
|
|
746
|
-
(r) => typeof r.type == "string" &&
|
|
747
|
+
(r) => typeof r.type == "string" && O(r.type) || et(r)
|
|
747
748
|
));
|
|
748
749
|
}
|
|
749
|
-
const
|
|
750
|
-
function
|
|
750
|
+
const mt = "fkpTrustedNodeIds";
|
|
751
|
+
function kt(e) {
|
|
751
752
|
const t = [], r = (o) => {
|
|
752
753
|
var i, a;
|
|
753
|
-
o.type &&
|
|
754
|
+
o.type && O(o.type) && typeof ((i = o.attrs) == null ? void 0 : i.id) == "string" && o.attrs.id && t.push(o.attrs.id), (a = o.content) == null || a.forEach(r);
|
|
754
755
|
};
|
|
755
756
|
return Array.isArray(e) ? e.forEach(r) : r(e), t;
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
+
function bt(e, t) {
|
|
758
759
|
for (let a = 0; a < 8; a++) {
|
|
759
760
|
const n = t();
|
|
760
761
|
if (n && !e.has(n)) return n;
|
|
@@ -764,7 +765,7 @@ function yt(e, t) {
|
|
|
764
765
|
for (; e.has(o); ) o = `${r}-${i++}`;
|
|
765
766
|
return o;
|
|
766
767
|
}
|
|
767
|
-
function
|
|
768
|
+
function P(e) {
|
|
768
769
|
if (typeof e != "string" || !/^https?:\/\/[^\s]+$/i.test(e))
|
|
769
770
|
return !1;
|
|
770
771
|
try {
|
|
@@ -774,7 +775,15 @@ function q(e) {
|
|
|
774
775
|
return !1;
|
|
775
776
|
}
|
|
776
777
|
}
|
|
777
|
-
function
|
|
778
|
+
function tt(e) {
|
|
779
|
+
try {
|
|
780
|
+
const t = new URL(e);
|
|
781
|
+
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);
|
|
782
|
+
} catch {
|
|
783
|
+
return !1;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
function nt(e) {
|
|
778
787
|
if (e.includes("[") || e.includes("]") || /[\r\n]/u.test(e))
|
|
779
788
|
return !0;
|
|
780
789
|
let t = 0;
|
|
@@ -783,10 +792,10 @@ function Ze(e) {
|
|
|
783
792
|
else if (r === "】" && --t < 0) return !0;
|
|
784
793
|
return t !== 0;
|
|
785
794
|
}
|
|
786
|
-
function
|
|
795
|
+
function he(e) {
|
|
787
796
|
return /[{}\r\n]/u.test(e);
|
|
788
797
|
}
|
|
789
|
-
function
|
|
798
|
+
function rt(e, t) {
|
|
790
799
|
var n;
|
|
791
800
|
const r = (n = e.extensionState[t]) == null ? void 0 : n.data;
|
|
792
801
|
if (!r || typeof r != "object" || Array.isArray(r)) return null;
|
|
@@ -795,25 +804,25 @@ function et(e, t) {
|
|
|
795
804
|
const { id: i, label: a } = o;
|
|
796
805
|
return typeof i != "string" || !i.trim() || typeof a != "string" || !a.trim() ? null : { id: i, label: a };
|
|
797
806
|
}
|
|
798
|
-
function
|
|
799
|
-
return
|
|
807
|
+
function it(e) {
|
|
808
|
+
return V.filter(
|
|
800
809
|
(t) => t.slot === "questionAction" && t.questionTag && t.types.includes(e.type)
|
|
801
810
|
).sort((t, r) => t.order - r.order).flatMap(({ id: t, questionTag: r }) => {
|
|
802
811
|
var s;
|
|
803
|
-
const o = r.protocolLabel, i = (s = e.extensionState[t]) == null ? void 0 : s.data, a = i && typeof i == "object" && !Array.isArray(i) ? i.enabled === !0 : !1, n = a ?
|
|
812
|
+
const o = r.protocolLabel, i = (s = e.extensionState[t]) == null ? void 0 : s.data, a = i && typeof i == "object" && !Array.isArray(i) ? i.enabled === !0 : !1, n = a ? rt(e, t) : null;
|
|
804
813
|
if (a && !n) throw new Error(`${o}已开启但未选择方案`);
|
|
805
|
-
if (n &&
|
|
814
|
+
if (n && he(n.label))
|
|
806
815
|
throw new Error("方案名称包含协议保留字符");
|
|
807
816
|
return n ? [`{${o}@${n.label}}`] : [];
|
|
808
817
|
}).join("");
|
|
809
818
|
}
|
|
810
|
-
function
|
|
819
|
+
function wt(e) {
|
|
811
820
|
var t;
|
|
812
|
-
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" ||
|
|
821
|
+
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" || nt(e.question.text))
|
|
813
822
|
throw new Error("意图文字不能包含半角方括号、换行或未配对的【】");
|
|
814
|
-
return `[${e.question.text}]${
|
|
823
|
+
return `[${e.question.text}]${it(e)}`;
|
|
815
824
|
}
|
|
816
|
-
const
|
|
825
|
+
const $e = /* @__PURE__ */ new Set([
|
|
817
826
|
"doc",
|
|
818
827
|
"paragraph",
|
|
819
828
|
"text",
|
|
@@ -828,14 +837,14 @@ const we = /* @__PURE__ */ new Set([
|
|
|
828
837
|
"originalReply",
|
|
829
838
|
"messageSeparator",
|
|
830
839
|
"mediaBlock"
|
|
831
|
-
]),
|
|
840
|
+
]), ht = (e) => $e.has(e), ot = /* @__PURE__ */ new Set([
|
|
832
841
|
"bold",
|
|
833
842
|
"italic",
|
|
834
843
|
"strike",
|
|
835
844
|
"code",
|
|
836
845
|
"link",
|
|
837
846
|
"underline"
|
|
838
|
-
]),
|
|
847
|
+
]), v = /* @__PURE__ */ new Set([
|
|
839
848
|
"paragraph",
|
|
840
849
|
"bulletList",
|
|
841
850
|
"orderedList",
|
|
@@ -845,16 +854,16 @@ const we = /* @__PURE__ */ new Set([
|
|
|
845
854
|
"originalReply",
|
|
846
855
|
"messageSeparator",
|
|
847
856
|
"mediaBlock"
|
|
848
|
-
]),
|
|
849
|
-
doc:
|
|
857
|
+
]), de = {
|
|
858
|
+
doc: v,
|
|
850
859
|
paragraph: /* @__PURE__ */ new Set(["text", "hardBreak", "businessToken"]),
|
|
851
860
|
bulletList: /* @__PURE__ */ new Set(["listItem"]),
|
|
852
861
|
orderedList: /* @__PURE__ */ new Set(["listItem"]),
|
|
853
|
-
listItem: /* @__PURE__ */ new Set(["paragraph", ...
|
|
854
|
-
blockquote:
|
|
862
|
+
listItem: /* @__PURE__ */ new Set(["paragraph", ...v]),
|
|
863
|
+
blockquote: v,
|
|
855
864
|
codeBlock: /* @__PURE__ */ new Set(["text"]),
|
|
856
865
|
originalReply: /* @__PURE__ */ new Set(["paragraph", "mediaBlock", "messageSeparator"])
|
|
857
|
-
},
|
|
866
|
+
}, st = {
|
|
858
867
|
orderedList: /* @__PURE__ */ new Set(["start", "type"]),
|
|
859
868
|
codeBlock: /* @__PURE__ */ new Set(["language"]),
|
|
860
869
|
businessToken: /* @__PURE__ */ new Set([
|
|
@@ -872,6 +881,7 @@ const we = /* @__PURE__ */ new Set([
|
|
|
872
881
|
"id",
|
|
873
882
|
"nodeVersion",
|
|
874
883
|
"assetId",
|
|
884
|
+
"sourceType",
|
|
875
885
|
"src",
|
|
876
886
|
"kind",
|
|
877
887
|
"name",
|
|
@@ -880,16 +890,16 @@ const we = /* @__PURE__ */ new Set([
|
|
|
880
890
|
"error"
|
|
881
891
|
])
|
|
882
892
|
};
|
|
883
|
-
function
|
|
893
|
+
function at(e) {
|
|
884
894
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
885
895
|
const t = e;
|
|
886
|
-
if (typeof t.type != "string" || !
|
|
896
|
+
if (typeof t.type != "string" || !ot.has(t.type) || Object.keys(t).some((i) => !["type", "attrs"].includes(i)) || t.attrs !== void 0 && (!t.attrs || typeof t.attrs != "object" || Array.isArray(t.attrs)))
|
|
887
897
|
return !1;
|
|
888
898
|
const r = t.attrs || {};
|
|
889
899
|
if (t.type !== "link") return Object.keys(r).length === 0;
|
|
890
900
|
if (Object.keys(r).some(
|
|
891
901
|
(i) => !["href", "target", "rel", "class", "title"].includes(i)
|
|
892
|
-
) || !
|
|
902
|
+
) || !P(r.href))
|
|
893
903
|
return !1;
|
|
894
904
|
const o = (i) => i == null || typeof i == "string";
|
|
895
905
|
return !o(r.rel) || !o(r.class) || !o(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");
|
|
@@ -900,12 +910,12 @@ function k(e, t, r = "") {
|
|
|
900
910
|
);
|
|
901
911
|
return o ? r ? `${r}.${o}` : o : null;
|
|
902
912
|
}
|
|
903
|
-
function
|
|
913
|
+
function x(e, t = "knowledge.doc", r = !1) {
|
|
904
914
|
if (e === null) return null;
|
|
905
915
|
const o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new WeakSet();
|
|
906
916
|
function a(n, s, c, l = !1) {
|
|
907
|
-
var d, y,
|
|
908
|
-
if (!n || typeof n != "object" || !n.type ||
|
|
917
|
+
var d, y, f, m, g, b, _, j, L, R, h, C, D, B, N, K, M, F, E, U, z, W, H, J, Q, G, Y, X, Z, ee, te, ne, re, ie, oe, se, ae;
|
|
918
|
+
if (!n || typeof n != "object" || !n.type || !$e.has(n.type) || i.has(n) || (i.add(n), c ? !((d = de[c]) != null && d.has(n.type)) : n.type !== "doc") || !r && l && n.type === "businessToken" && ((f = I((y = n.attrs) == null ? void 0 : y.kind)) == null ? void 0 : f.allowInOriginalReply) === !1)
|
|
909
919
|
return s;
|
|
910
920
|
for (const p of Object.keys(n))
|
|
911
921
|
if (!["type", "attrs", "content", "marks", "text"].includes(p))
|
|
@@ -916,21 +926,21 @@ function v(e, t = "knowledge.doc", r = !1) {
|
|
|
916
926
|
n.type
|
|
917
927
|
) && !((m = n.content) != null && m.length))
|
|
918
928
|
return `${s}.content`;
|
|
919
|
-
if (n.type === "listItem" && ((b = (
|
|
929
|
+
if (n.type === "listItem" && ((b = (g = n.content) == null ? void 0 : g[0]) == null ? void 0 : b.type) !== "paragraph")
|
|
920
930
|
return (_ = n.content) != null && _.length ? `${s}.content[0]` : `${s}.content`;
|
|
921
931
|
if (n.text !== void 0 && n.type !== "text") return `${s}.text`;
|
|
922
932
|
if (n.type === "text" && (typeof n.text != "string" || n.text.length === 0))
|
|
923
933
|
return `${s}.text`;
|
|
924
934
|
if (n.type === "text" && n.content !== void 0)
|
|
925
935
|
return `${s}.content`;
|
|
926
|
-
if ((j = n.content) != null && j.length && !
|
|
936
|
+
if ((j = n.content) != null && j.length && !de[n.type])
|
|
927
937
|
return `${s}.content`;
|
|
928
938
|
if (n.attrs !== void 0 && (!n.attrs || typeof n.attrs != "object" || Array.isArray(n.attrs)))
|
|
929
939
|
return `${s}.attrs`;
|
|
930
|
-
const u =
|
|
940
|
+
const u = st[n.type] || /* @__PURE__ */ new Set();
|
|
931
941
|
for (const p of Object.keys(n.attrs || {}))
|
|
932
942
|
if (!u.has(p)) return `${s}.attrs.${p}`;
|
|
933
|
-
if (n.type === "businessToken" && !
|
|
943
|
+
if (n.type === "businessToken" && !be((L = n.attrs) == null ? void 0 : L.kind))
|
|
934
944
|
return `${s}.attrs.kind`;
|
|
935
945
|
if (n.type === "businessToken") {
|
|
936
946
|
const p = (C = (h = I(
|
|
@@ -944,68 +954,72 @@ function v(e, t = "knowledge.doc", r = !1) {
|
|
|
944
954
|
return `${s}.attrs.label`;
|
|
945
955
|
if (n.type === "businessToken" && ((N = n.attrs) == null ? void 0 : N.token) !== void 0 && n.attrs.token !== null && typeof n.attrs.token != "string")
|
|
946
956
|
return `${s}.attrs.token`;
|
|
947
|
-
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) ||
|
|
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) || fe(n.attrs.params) !== null || JSON.stringify(n.attrs.params).length > 8192))
|
|
948
958
|
return `${s}.attrs.params`;
|
|
949
|
-
if (n.type === "mediaBlock" && !
|
|
959
|
+
if (n.type === "mediaBlock" && !we((F = n.attrs) == null ? void 0 : F.kind))
|
|
950
960
|
return `${s}.attrs.kind`;
|
|
951
961
|
if (n.type === "mediaBlock") {
|
|
952
|
-
if (((E = n.attrs) == null ? void 0 : E.
|
|
962
|
+
if (((E = n.attrs) == null ? void 0 : E.sourceType) !== void 0 && n.attrs.sourceType !== null && n.attrs.sourceType !== "qianniuVideo")
|
|
963
|
+
return `${s}.attrs.sourceType`;
|
|
964
|
+
if (((U = n.attrs) == null ? void 0 : U.sourceType) === "qianniuVideo" && (n.attrs.kind !== "video" || typeof n.attrs.assetId != "string" || !n.attrs.assetId.trim() || !tt(n.attrs.src)))
|
|
965
|
+
return `${s}.attrs.sourceType`;
|
|
966
|
+
if (((z = n.attrs) == null ? void 0 : z.assetId) !== void 0 && n.attrs.assetId !== null && typeof n.attrs.assetId != "string")
|
|
953
967
|
return `${s}.attrs.assetId`;
|
|
954
|
-
if (((
|
|
968
|
+
if (((W = n.attrs) == null ? void 0 : W.name) !== void 0 && typeof n.attrs.name != "string")
|
|
955
969
|
return `${s}.attrs.name`;
|
|
956
|
-
if (((
|
|
970
|
+
if (((H = n.attrs) == null ? void 0 : H.error) !== void 0 && typeof n.attrs.error != "string")
|
|
957
971
|
return `${s}.attrs.error`;
|
|
958
|
-
if (((
|
|
972
|
+
if (((J = n.attrs) == null ? void 0 : J.status) !== void 0 && !["ready", "uploading", "error"].includes(String(n.attrs.status)))
|
|
959
973
|
return `${s}.attrs.status`;
|
|
960
|
-
const p = (((
|
|
961
|
-
if (!
|
|
974
|
+
const p = (((Q = n.attrs) == null ? void 0 : Q.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:");
|
|
975
|
+
if (!P((X = n.attrs) == null ? void 0 : X.src) && !p)
|
|
962
976
|
return `${s}.attrs.src`;
|
|
963
|
-
if (((
|
|
977
|
+
if (((Z = n.attrs) == null ? void 0 : Z.poster) !== void 0 && n.attrs.poster !== null && !P(n.attrs.poster))
|
|
964
978
|
return `${s}.attrs.poster`;
|
|
965
979
|
}
|
|
966
|
-
if (
|
|
967
|
-
const p = (
|
|
980
|
+
if (O(n.type)) {
|
|
981
|
+
const p = (ee = n.attrs) == null ? void 0 : ee.id;
|
|
968
982
|
if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() || o.has(p)))
|
|
969
983
|
return `${s}.attrs.id`;
|
|
970
|
-
if (typeof p == "string" && o.add(p), ((
|
|
984
|
+
if (typeof p == "string" && o.add(p), ((te = n.attrs) == null ? void 0 : te.nodeVersion) !== void 0 && (!Number.isSafeInteger(n.attrs.nodeVersion) || n.attrs.nodeVersion < 0))
|
|
971
985
|
return `${s}.attrs.nodeVersion`;
|
|
972
986
|
}
|
|
973
|
-
if (n.type === "orderedList" && ((
|
|
987
|
+
if (n.type === "orderedList" && ((ne = n.attrs) == null ? void 0 : ne.start) !== void 0 && (!Number.isSafeInteger(n.attrs.start) || n.attrs.start < 1))
|
|
974
988
|
return `${s}.attrs.start`;
|
|
975
|
-
if (n.type === "orderedList" && ((
|
|
989
|
+
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))
|
|
976
990
|
return `${s}.attrs.type`;
|
|
977
|
-
if (n.type === "codeBlock" && ((
|
|
991
|
+
if (n.type === "codeBlock" && ((ie = n.attrs) == null ? void 0 : ie.language) !== void 0 && n.attrs.language !== null && typeof n.attrs.language != "string")
|
|
978
992
|
return `${s}.attrs.language`;
|
|
979
993
|
if (n.marks !== void 0 && !Array.isArray(n.marks))
|
|
980
994
|
return `${s}.marks`;
|
|
981
|
-
if (c === "codeBlock" && ((
|
|
982
|
-
if ((
|
|
995
|
+
if (c === "codeBlock" && ((oe = n.marks) != null && oe.length)) return `${s}.marks`;
|
|
996
|
+
if ((se = n.marks) != null && se.some((p) => !at(p)))
|
|
983
997
|
return `${s}.marks`;
|
|
984
|
-
if ((
|
|
998
|
+
if ((ae = n.marks) != null && ae.length) {
|
|
985
999
|
const p = n.marks.map((T) => T.type);
|
|
986
1000
|
if (new Set(p).size !== p.length || p.includes("code") && p.length > 1)
|
|
987
1001
|
return `${s}.marks`;
|
|
988
1002
|
}
|
|
989
1003
|
for (const [p, T] of (n.content || []).entries()) {
|
|
990
|
-
const
|
|
1004
|
+
const le = a(
|
|
991
1005
|
T,
|
|
992
1006
|
`${s}.content[${p}]`,
|
|
993
1007
|
n.type,
|
|
994
1008
|
l || n.type === "originalReply"
|
|
995
1009
|
);
|
|
996
|
-
if (
|
|
1010
|
+
if (le) return le;
|
|
997
1011
|
}
|
|
998
1012
|
return null;
|
|
999
1013
|
}
|
|
1000
1014
|
return a(e, t);
|
|
1001
1015
|
}
|
|
1002
|
-
function
|
|
1016
|
+
function lt(e, t, r = "knowledge.doc") {
|
|
1003
1017
|
if (!e) return null;
|
|
1004
1018
|
const o = /* @__PURE__ */ new WeakSet(), i = (a, n) => {
|
|
1005
1019
|
if (o.has(a)) return n;
|
|
1006
1020
|
o.add(a);
|
|
1007
|
-
const s =
|
|
1008
|
-
if (s && !
|
|
1021
|
+
const s = Ze(a);
|
|
1022
|
+
if (s && !V.some(
|
|
1009
1023
|
(c) => c.id === s.id && c.slot === s.slot && c.types.includes(t)
|
|
1010
1024
|
))
|
|
1011
1025
|
return n;
|
|
@@ -1017,15 +1031,15 @@ function ot(e, t, r = "knowledge.doc") {
|
|
|
1017
1031
|
};
|
|
1018
1032
|
return i(e, r);
|
|
1019
1033
|
}
|
|
1020
|
-
function
|
|
1034
|
+
function $t(e) {
|
|
1021
1035
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1022
1036
|
const t = e, r = t.question, o = t.knowledge;
|
|
1023
1037
|
return ["normal", "reasoning", "agent"].includes(String(t.type)) && !!r && typeof r == "object" && !Array.isArray(r) && typeof r.text == "string" && !!o && typeof o == "object" && !Array.isArray(o) && Object.prototype.hasOwnProperty.call(o, "doc") && !!t.extensionState && typeof t.extensionState == "object" && !Array.isArray(t.extensionState);
|
|
1024
1038
|
}
|
|
1025
|
-
function
|
|
1039
|
+
function St(e) {
|
|
1026
1040
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1027
1041
|
return "modelValue";
|
|
1028
|
-
const t =
|
|
1042
|
+
const t = fe(e);
|
|
1029
1043
|
if (t !== null) return t || "modelValue";
|
|
1030
1044
|
const r = e;
|
|
1031
1045
|
if (r.schemaVersion !== 1) return "schemaVersion";
|
|
@@ -1076,14 +1090,14 @@ function wt(e) {
|
|
|
1076
1090
|
);
|
|
1077
1091
|
if (u) return u;
|
|
1078
1092
|
}
|
|
1079
|
-
const n =
|
|
1093
|
+
const n = x(r.knowledge.doc);
|
|
1080
1094
|
if (n) return n;
|
|
1081
|
-
const s =
|
|
1095
|
+
const s = lt(
|
|
1082
1096
|
r.knowledge.doc,
|
|
1083
1097
|
r.type
|
|
1084
1098
|
);
|
|
1085
1099
|
if (s) return s;
|
|
1086
|
-
const c =
|
|
1100
|
+
const c = x(
|
|
1087
1101
|
r.knowledge.retainedDoc ?? null,
|
|
1088
1102
|
"knowledge.retainedDoc",
|
|
1089
1103
|
r.type === "agent"
|
|
@@ -1092,7 +1106,7 @@ function wt(e) {
|
|
|
1092
1106
|
if (r.type === "agent") {
|
|
1093
1107
|
if (r.knowledge.agentBody && r.knowledge.retainedDoc)
|
|
1094
1108
|
return "knowledge.agentBody";
|
|
1095
|
-
const l =
|
|
1109
|
+
const l = x(
|
|
1096
1110
|
r.knowledge.agentBody ?? null,
|
|
1097
1111
|
"knowledge.agentBody",
|
|
1098
1112
|
!0
|
|
@@ -1102,8 +1116,8 @@ function wt(e) {
|
|
|
1102
1116
|
if (!r.extensionState || typeof r.extensionState != "object" || Array.isArray(r.extensionState))
|
|
1103
1117
|
return "extensionState";
|
|
1104
1118
|
for (const [l, u] of Object.entries(r.extensionState)) {
|
|
1105
|
-
const d =
|
|
1106
|
-
(
|
|
1119
|
+
const d = V.find(
|
|
1120
|
+
(f) => f.id === l && f.types.includes(r.type) && f.implementation === "plugin"
|
|
1107
1121
|
);
|
|
1108
1122
|
if (!d) return `extensionState.${l}`;
|
|
1109
1123
|
if (!u || typeof u != "object" || u.version !== d.dataVersion)
|
|
@@ -1119,20 +1133,20 @@ function wt(e) {
|
|
|
1119
1133
|
if (d.slot === "questionAction" && typeof u.data.enabled != "boolean")
|
|
1120
1134
|
return `extensionState.${l}.data.enabled`;
|
|
1121
1135
|
if (d.slot === "questionAction" && d.questionTag) {
|
|
1122
|
-
const
|
|
1123
|
-
if (
|
|
1136
|
+
const f = u.data;
|
|
1137
|
+
if (f.enabled === !0 && f.tag === void 0)
|
|
1124
1138
|
return `extensionState.${l}.data.tag`;
|
|
1125
|
-
if (
|
|
1126
|
-
const { tag: m } =
|
|
1139
|
+
if (f.tag !== void 0) {
|
|
1140
|
+
const { tag: m } = f;
|
|
1127
1141
|
if (!m || typeof m != "object" || Array.isArray(m))
|
|
1128
1142
|
return `extensionState.${l}.data.tag`;
|
|
1129
|
-
const
|
|
1130
|
-
if (typeof
|
|
1143
|
+
const g = m;
|
|
1144
|
+
if (typeof g.id != "string" || !g.id.trim())
|
|
1131
1145
|
return `extensionState.${l}.data.tag.id`;
|
|
1132
|
-
if (typeof
|
|
1146
|
+
if (typeof g.label != "string" || !g.label.trim() || he(g.label))
|
|
1133
1147
|
return `extensionState.${l}.data.tag.label`;
|
|
1134
1148
|
const b = k(
|
|
1135
|
-
|
|
1149
|
+
g,
|
|
1136
1150
|
["id", "label"],
|
|
1137
1151
|
`extensionState.${l}.data.tag`
|
|
1138
1152
|
);
|
|
@@ -1143,40 +1157,41 @@ function wt(e) {
|
|
|
1143
1157
|
return null;
|
|
1144
1158
|
}
|
|
1145
1159
|
export {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
et as A,
|
|
1161
|
+
V as B,
|
|
1162
|
+
We as C,
|
|
1163
|
+
ct as D,
|
|
1164
|
+
Ze as E,
|
|
1165
|
+
ht as F,
|
|
1166
|
+
$t as G,
|
|
1167
|
+
he as H,
|
|
1168
|
+
ke as I,
|
|
1169
|
+
rt as J,
|
|
1170
|
+
He as M,
|
|
1171
|
+
fe as a,
|
|
1172
|
+
x as b,
|
|
1173
|
+
ge as c,
|
|
1174
|
+
O as d,
|
|
1175
|
+
it as e,
|
|
1176
|
+
pe as f,
|
|
1162
1177
|
I as g,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1178
|
+
nt as h,
|
|
1179
|
+
P as i,
|
|
1180
|
+
St as j,
|
|
1181
|
+
Be as k,
|
|
1182
|
+
ut as l,
|
|
1183
|
+
ft as m,
|
|
1184
|
+
gt as n,
|
|
1185
|
+
tt as o,
|
|
1186
|
+
dt as p,
|
|
1187
|
+
bt as q,
|
|
1188
|
+
be as r,
|
|
1189
|
+
wt as s,
|
|
1190
|
+
mt as t,
|
|
1191
|
+
A as u,
|
|
1192
|
+
kt as v,
|
|
1193
|
+
pt as w,
|
|
1194
|
+
$ as x,
|
|
1195
|
+
yt as y,
|
|
1181
1196
|
Xe as z
|
|
1182
1197
|
};
|