@freecallai/pro 0.0.11 → 0.0.12
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-D2sgT7XP.js → FkpRichText.vue_vue_type_script_setup_true_lang-DiS7CZdc.js} +1470 -1455
- package/dist/{KnowledgeArea-Sbfs_E0C.js → KnowledgeArea-FGgCcubh.js} +1 -1
- package/dist/{KnowledgeArea.vue_vue_type_script_setup_true_lang-BNDRTWXW.js → KnowledgeArea.vue_vue_type_script_setup_true_lang-JH_F4CFe.js} +523 -519
- package/dist/{ToolForm-_ZTW7lwU.js → ToolForm-CHmdyhjh.js} +1 -1
- package/dist/agent-prompt-editor/index.js +304 -293
- package/dist/agent-prompt-editor/legacy-converter/index.js +98 -94
- package/dist/{choice-BqjECVyx.js → choice-CUCsR2dN.js} +1 -1
- package/dist/{guard-BmLOamCj.js → guard-DgExtfXo.js} +199 -185
- package/dist/{index-BDinNJn_.js → index-BwZXmefJ.js} +1 -1
- package/dist/{index-6VSUucFX.js → index-C54ce9Tn.js} +1 -1
- package/dist/index-CMl5mgFR.js +5 -0
- package/dist/index-Cs38tTe4.js +5 -0
- package/dist/{index-CCwmXuSJ.js → index-DIMONp3g.js} +1 -1
- package/dist/{index-CN2knQcE.js → index-DaGfiqBX.js} +1 -1
- package/dist/{index-gS1h8iW8.js → index-DqJvaPTD.js} +1 -1
- package/dist/{index-0BXLYaKG.js → index-dnsGFj0F.js} +2 -2
- package/dist/{index-B1rTu0jX.js → index-pdr6mUf0.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{inline-CRGzAti7.js → inline-BpwAryXp.js} +1 -1
- package/dist/{knowledge-DNDouB-s.js → knowledge-DIzYk2iM.js} +1 -1
- package/dist/media-extensions-YYbGuUQa.js +341 -0
- package/dist/{media-migration-D1KoHKoP.js → media-migration-Bnfn27i9.js} +1 -1
- package/dist/media-policy-tG5OHWSj.js +215 -0
- package/dist/{media-upload-C5N6YWHu.js → media-upload-_xeZtn3i.js} +1 -1
- package/dist/{model-BVh9EZ9G.js → model-DlAjlPai.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 +4 -0
- package/dist/types/rich-text/FkpRichText.vue.d.ts +2 -0
- package/dist/types/rich-text/model/qianniu-video.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +2 -2
- package/dist/types/rich-text/runtime/media-sources.d.ts +1 -1
- package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +1 -0
- package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +19 -10
- package/package.json +3 -3
- 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,7 @@ const De = {
|
|
|
519
519
|
};
|
|
520
520
|
},
|
|
521
521
|
serialize: (e) => String(e.token || `#${e.key}#`)
|
|
522
|
-
},
|
|
522
|
+
}, Ee = {
|
|
523
523
|
present: (e) => ({
|
|
524
524
|
layout: "inline",
|
|
525
525
|
icon: "sep",
|
|
@@ -528,7 +528,7 @@ const De = {
|
|
|
528
528
|
}),
|
|
529
529
|
serialize: () => "{分隔符}"
|
|
530
530
|
};
|
|
531
|
-
function
|
|
531
|
+
function Ue(e, t) {
|
|
532
532
|
if (e !== "order_note" && e !== "small_payment") return null;
|
|
533
533
|
const r = t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
534
534
|
if (e === "small_payment") {
|
|
@@ -541,14 +541,14 @@ function Fe(e, t) {
|
|
|
541
541
|
}
|
|
542
542
|
return { label: "备注", icon: "msg-tag", summary: r.contentMode === "smart" ? "智能提取" : typeof r.content == "string" ? r.content.replace(/\s+/g, " ").trim() : "" };
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
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
545
|
none: "不标记",
|
|
546
546
|
red: "红色",
|
|
547
547
|
yellow: "黄色",
|
|
548
548
|
green: "绿色",
|
|
549
549
|
blue: "蓝色",
|
|
550
550
|
purple: "紫色"
|
|
551
|
-
},
|
|
551
|
+
}, pt = {
|
|
552
552
|
none: "",
|
|
553
553
|
red: "#f53f3f",
|
|
554
554
|
yellow: "#ff7d00",
|
|
@@ -559,21 +559,21 @@ const de = (e) => typeof e == "string" && /^(?:[1-9]|[1-9]\d)$/.test(e), ge = (e
|
|
|
559
559
|
function A(e) {
|
|
560
560
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
561
561
|
const t = e;
|
|
562
|
-
return
|
|
562
|
+
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
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function ue() {
|
|
565
565
|
return `rmk_${crypto.randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function dt(e, t, r, o, i) {
|
|
568
568
|
if (e !== "small_payment" && e !== "order_note")
|
|
569
569
|
return { ok: !0, params: t };
|
|
570
570
|
let a = 0;
|
|
571
571
|
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) || ""))), (
|
|
572
|
+
var d, y, f;
|
|
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) || ""))), (f = u.content) == null || f.forEach(s);
|
|
574
574
|
};
|
|
575
575
|
if (o && s(o), e === "small_payment")
|
|
576
|
-
return
|
|
576
|
+
return ge(t.amount) ? a ? {
|
|
577
577
|
ok: !1,
|
|
578
578
|
code: "TOOL_LIMIT_REACHED",
|
|
579
579
|
message: "最多配置一个小额打款工具"
|
|
@@ -582,9 +582,9 @@ function ct(e, t, r, o, i) {
|
|
|
582
582
|
code: "TOOL_PARAMS_INVALID",
|
|
583
583
|
message: "打款金额必须是1-99的整数元"
|
|
584
584
|
};
|
|
585
|
-
let c =
|
|
585
|
+
let c = ye(r.id) ? r.id : ue();
|
|
586
586
|
if (!i)
|
|
587
|
-
for (; n.has(c); ) c =
|
|
587
|
+
for (; n.has(c); ) c = ue();
|
|
588
588
|
if (n.has(c))
|
|
589
589
|
return {
|
|
590
590
|
ok: !1,
|
|
@@ -598,7 +598,7 @@ function ct(e, t, r, o, i) {
|
|
|
598
598
|
message: "订单备注内容或配置不合法"
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function ft(e) {
|
|
602
602
|
const t = /^\{外部方法@([^\s{}:]+):([^{}\r\n]+)\}$/u.exec(e);
|
|
603
603
|
if (t && t[2].trim())
|
|
604
604
|
return {
|
|
@@ -644,7 +644,7 @@ function ut(e) {
|
|
|
644
644
|
attrs: { kind: "tool", key: "order_note", label: "订单备注", params: a }
|
|
645
645
|
} : null;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function pe(e) {
|
|
648
648
|
var r;
|
|
649
649
|
if (e.type !== "businessToken" || ((r = e.attrs) == null ? void 0 : r.kind) !== "tool") return null;
|
|
650
650
|
const { params: t } = e.attrs;
|
|
@@ -652,9 +652,9 @@ function ce(e) {
|
|
|
652
652
|
const { sceneId: o, sceneName: i } = t || {};
|
|
653
653
|
return typeof o == "string" && /^[^\s{}:]+$/u.test(o) && typeof i == "string" && i.trim() && !/[{}\r\n]/u.test(i) ? `{外部方法@${o}:${i}}` : null;
|
|
654
654
|
}
|
|
655
|
-
return e.attrs.key === "small_payment" ?
|
|
655
|
+
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
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function gt(e) {
|
|
658
658
|
try {
|
|
659
659
|
const t = JSON.parse(decodeURIComponent(e)), r = {
|
|
660
660
|
id: String(t.id || ""),
|
|
@@ -672,15 +672,15 @@ function pt(e) {
|
|
|
672
672
|
return null;
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
const
|
|
675
|
+
const ze = {
|
|
676
676
|
allowsParams: !0,
|
|
677
677
|
validate(e) {
|
|
678
678
|
return ["small_payment", "order_note", "external_method"].includes(
|
|
679
679
|
String(e.key)
|
|
680
|
-
) ?
|
|
680
|
+
) ? pe({ type: "businessToken", attrs: { ...e } }) ? null : "params" : null;
|
|
681
681
|
},
|
|
682
682
|
present(e) {
|
|
683
|
-
const t =
|
|
683
|
+
const t = Ue(e.key, e.params);
|
|
684
684
|
return t ? {
|
|
685
685
|
layout: "toolNote",
|
|
686
686
|
icon: t.icon,
|
|
@@ -699,7 +699,7 @@ const Ee = {
|
|
|
699
699
|
if (["small_payment", "order_note", "external_method"].includes(
|
|
700
700
|
String(e.key)
|
|
701
701
|
)) {
|
|
702
|
-
const t =
|
|
702
|
+
const t = pe({
|
|
703
703
|
type: "businessToken",
|
|
704
704
|
attrs: { ...e }
|
|
705
705
|
});
|
|
@@ -708,53 +708,53 @@ const Ee = {
|
|
|
708
708
|
}
|
|
709
709
|
return `{工具@${e.key}}`;
|
|
710
710
|
}
|
|
711
|
-
},
|
|
712
|
-
todo:
|
|
713
|
-
ticket:
|
|
714
|
-
tableKnowledge:
|
|
715
|
-
variable:
|
|
716
|
-
attribute:
|
|
717
|
-
tool:
|
|
718
|
-
separator:
|
|
719
|
-
},
|
|
711
|
+
}, me = {
|
|
712
|
+
todo: De,
|
|
713
|
+
ticket: Ne,
|
|
714
|
+
tableKnowledge: Ke,
|
|
715
|
+
variable: Fe,
|
|
716
|
+
attribute: Me,
|
|
717
|
+
tool: ze,
|
|
718
|
+
separator: Ee
|
|
719
|
+
}, q = me;
|
|
720
720
|
function I(e) {
|
|
721
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
721
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(q, e) ? q[e] : void 0;
|
|
722
722
|
}
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
),
|
|
726
|
-
(e) =>
|
|
727
|
-
),
|
|
723
|
+
const ke = Object.keys(
|
|
724
|
+
me
|
|
725
|
+
), We = ke.filter(
|
|
726
|
+
(e) => q[e].choice
|
|
727
|
+
), 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
728
|
"businessToken",
|
|
729
729
|
"originalReply",
|
|
730
730
|
"messageSeparator",
|
|
731
731
|
"mediaBlock"
|
|
732
|
-
]),
|
|
733
|
-
function
|
|
734
|
-
return e === "businessToken" ?
|
|
732
|
+
]), O = (e) => Ye.has(e);
|
|
733
|
+
function Xe(e, t) {
|
|
734
|
+
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
735
|
}
|
|
736
|
-
function
|
|
737
|
-
const t =
|
|
736
|
+
function Ze(e) {
|
|
737
|
+
const t = Xe(e.type || "", e.attrs);
|
|
738
738
|
return t ? {
|
|
739
739
|
id: t,
|
|
740
740
|
slot: e.type === "businessToken" || e.type === "messageSeparator" ? "knowledgeInline" : "knowledgeBlock"
|
|
741
741
|
} : null;
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function et(e) {
|
|
744
744
|
var t;
|
|
745
745
|
return !!((t = e.content) != null && t.some(
|
|
746
|
-
(r) => typeof r.type == "string" &&
|
|
746
|
+
(r) => typeof r.type == "string" && O(r.type) || et(r)
|
|
747
747
|
));
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
function
|
|
749
|
+
const mt = "fkpTrustedNodeIds";
|
|
750
|
+
function kt(e) {
|
|
751
751
|
const t = [], r = (o) => {
|
|
752
752
|
var i, a;
|
|
753
|
-
o.type &&
|
|
753
|
+
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
754
|
};
|
|
755
755
|
return Array.isArray(e) ? e.forEach(r) : r(e), t;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function bt(e, t) {
|
|
758
758
|
for (let a = 0; a < 8; a++) {
|
|
759
759
|
const n = t();
|
|
760
760
|
if (n && !e.has(n)) return n;
|
|
@@ -764,7 +764,7 @@ function yt(e, t) {
|
|
|
764
764
|
for (; e.has(o); ) o = `${r}-${i++}`;
|
|
765
765
|
return o;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function P(e) {
|
|
768
768
|
if (typeof e != "string" || !/^https?:\/\/[^\s]+$/i.test(e))
|
|
769
769
|
return !1;
|
|
770
770
|
try {
|
|
@@ -774,7 +774,15 @@ function q(e) {
|
|
|
774
774
|
return !1;
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function tt(e) {
|
|
778
|
+
try {
|
|
779
|
+
const t = new URL(e);
|
|
780
|
+
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);
|
|
781
|
+
} catch {
|
|
782
|
+
return !1;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
function nt(e) {
|
|
778
786
|
if (e.includes("[") || e.includes("]") || /[\r\n]/u.test(e))
|
|
779
787
|
return !0;
|
|
780
788
|
let t = 0;
|
|
@@ -783,10 +791,10 @@ function Ze(e) {
|
|
|
783
791
|
else if (r === "】" && --t < 0) return !0;
|
|
784
792
|
return t !== 0;
|
|
785
793
|
}
|
|
786
|
-
function
|
|
794
|
+
function he(e) {
|
|
787
795
|
return /[{}\r\n]/u.test(e);
|
|
788
796
|
}
|
|
789
|
-
function
|
|
797
|
+
function rt(e, t) {
|
|
790
798
|
var n;
|
|
791
799
|
const r = (n = e.extensionState[t]) == null ? void 0 : n.data;
|
|
792
800
|
if (!r || typeof r != "object" || Array.isArray(r)) return null;
|
|
@@ -795,25 +803,25 @@ function et(e, t) {
|
|
|
795
803
|
const { id: i, label: a } = o;
|
|
796
804
|
return typeof i != "string" || !i.trim() || typeof a != "string" || !a.trim() ? null : { id: i, label: a };
|
|
797
805
|
}
|
|
798
|
-
function
|
|
799
|
-
return
|
|
806
|
+
function it(e) {
|
|
807
|
+
return V.filter(
|
|
800
808
|
(t) => t.slot === "questionAction" && t.questionTag && t.types.includes(e.type)
|
|
801
809
|
).sort((t, r) => t.order - r.order).flatMap(({ id: t, questionTag: r }) => {
|
|
802
810
|
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 ?
|
|
811
|
+
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
812
|
if (a && !n) throw new Error(`${o}已开启但未选择方案`);
|
|
805
|
-
if (n &&
|
|
813
|
+
if (n && he(n.label))
|
|
806
814
|
throw new Error("方案名称包含协议保留字符");
|
|
807
815
|
return n ? [`{${o}@${n.label}}`] : [];
|
|
808
816
|
}).join("");
|
|
809
817
|
}
|
|
810
|
-
function
|
|
818
|
+
function wt(e) {
|
|
811
819
|
var t;
|
|
812
|
-
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" ||
|
|
820
|
+
if (typeof ((t = e.question) == null ? void 0 : t.text) != "string" || nt(e.question.text))
|
|
813
821
|
throw new Error("意图文字不能包含半角方括号、换行或未配对的【】");
|
|
814
|
-
return `[${e.question.text}]${
|
|
822
|
+
return `[${e.question.text}]${it(e)}`;
|
|
815
823
|
}
|
|
816
|
-
const
|
|
824
|
+
const $e = /* @__PURE__ */ new Set([
|
|
817
825
|
"doc",
|
|
818
826
|
"paragraph",
|
|
819
827
|
"text",
|
|
@@ -828,14 +836,14 @@ const we = /* @__PURE__ */ new Set([
|
|
|
828
836
|
"originalReply",
|
|
829
837
|
"messageSeparator",
|
|
830
838
|
"mediaBlock"
|
|
831
|
-
]),
|
|
839
|
+
]), ht = (e) => $e.has(e), ot = /* @__PURE__ */ new Set([
|
|
832
840
|
"bold",
|
|
833
841
|
"italic",
|
|
834
842
|
"strike",
|
|
835
843
|
"code",
|
|
836
844
|
"link",
|
|
837
845
|
"underline"
|
|
838
|
-
]),
|
|
846
|
+
]), v = /* @__PURE__ */ new Set([
|
|
839
847
|
"paragraph",
|
|
840
848
|
"bulletList",
|
|
841
849
|
"orderedList",
|
|
@@ -845,16 +853,16 @@ const we = /* @__PURE__ */ new Set([
|
|
|
845
853
|
"originalReply",
|
|
846
854
|
"messageSeparator",
|
|
847
855
|
"mediaBlock"
|
|
848
|
-
]),
|
|
849
|
-
doc:
|
|
856
|
+
]), de = {
|
|
857
|
+
doc: v,
|
|
850
858
|
paragraph: /* @__PURE__ */ new Set(["text", "hardBreak", "businessToken"]),
|
|
851
859
|
bulletList: /* @__PURE__ */ new Set(["listItem"]),
|
|
852
860
|
orderedList: /* @__PURE__ */ new Set(["listItem"]),
|
|
853
|
-
listItem: /* @__PURE__ */ new Set(["paragraph", ...
|
|
854
|
-
blockquote:
|
|
861
|
+
listItem: /* @__PURE__ */ new Set(["paragraph", ...v]),
|
|
862
|
+
blockquote: v,
|
|
855
863
|
codeBlock: /* @__PURE__ */ new Set(["text"]),
|
|
856
864
|
originalReply: /* @__PURE__ */ new Set(["paragraph", "mediaBlock", "messageSeparator"])
|
|
857
|
-
},
|
|
865
|
+
}, st = {
|
|
858
866
|
orderedList: /* @__PURE__ */ new Set(["start", "type"]),
|
|
859
867
|
codeBlock: /* @__PURE__ */ new Set(["language"]),
|
|
860
868
|
businessToken: /* @__PURE__ */ new Set([
|
|
@@ -872,6 +880,7 @@ const we = /* @__PURE__ */ new Set([
|
|
|
872
880
|
"id",
|
|
873
881
|
"nodeVersion",
|
|
874
882
|
"assetId",
|
|
883
|
+
"sourceType",
|
|
875
884
|
"src",
|
|
876
885
|
"kind",
|
|
877
886
|
"name",
|
|
@@ -880,16 +889,16 @@ const we = /* @__PURE__ */ new Set([
|
|
|
880
889
|
"error"
|
|
881
890
|
])
|
|
882
891
|
};
|
|
883
|
-
function
|
|
892
|
+
function at(e) {
|
|
884
893
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
885
894
|
const t = e;
|
|
886
|
-
if (typeof t.type != "string" || !
|
|
895
|
+
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
896
|
return !1;
|
|
888
897
|
const r = t.attrs || {};
|
|
889
898
|
if (t.type !== "link") return Object.keys(r).length === 0;
|
|
890
899
|
if (Object.keys(r).some(
|
|
891
900
|
(i) => !["href", "target", "rel", "class", "title"].includes(i)
|
|
892
|
-
) || !
|
|
901
|
+
) || !P(r.href))
|
|
893
902
|
return !1;
|
|
894
903
|
const o = (i) => i == null || typeof i == "string";
|
|
895
904
|
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 +909,12 @@ function k(e, t, r = "") {
|
|
|
900
909
|
);
|
|
901
910
|
return o ? r ? `${r}.${o}` : o : null;
|
|
902
911
|
}
|
|
903
|
-
function
|
|
912
|
+
function x(e, t = "knowledge.doc", r = !1) {
|
|
904
913
|
if (e === null) return null;
|
|
905
914
|
const o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new WeakSet();
|
|
906
915
|
function a(n, s, c, l = !1) {
|
|
907
|
-
var d, y,
|
|
908
|
-
if (!n || typeof n != "object" || !n.type ||
|
|
916
|
+
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;
|
|
917
|
+
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
918
|
return s;
|
|
910
919
|
for (const p of Object.keys(n))
|
|
911
920
|
if (!["type", "attrs", "content", "marks", "text"].includes(p))
|
|
@@ -916,21 +925,21 @@ function v(e, t = "knowledge.doc", r = !1) {
|
|
|
916
925
|
n.type
|
|
917
926
|
) && !((m = n.content) != null && m.length))
|
|
918
927
|
return `${s}.content`;
|
|
919
|
-
if (n.type === "listItem" && ((b = (
|
|
928
|
+
if (n.type === "listItem" && ((b = (g = n.content) == null ? void 0 : g[0]) == null ? void 0 : b.type) !== "paragraph")
|
|
920
929
|
return (_ = n.content) != null && _.length ? `${s}.content[0]` : `${s}.content`;
|
|
921
930
|
if (n.text !== void 0 && n.type !== "text") return `${s}.text`;
|
|
922
931
|
if (n.type === "text" && (typeof n.text != "string" || n.text.length === 0))
|
|
923
932
|
return `${s}.text`;
|
|
924
933
|
if (n.type === "text" && n.content !== void 0)
|
|
925
934
|
return `${s}.content`;
|
|
926
|
-
if ((j = n.content) != null && j.length && !
|
|
935
|
+
if ((j = n.content) != null && j.length && !de[n.type])
|
|
927
936
|
return `${s}.content`;
|
|
928
937
|
if (n.attrs !== void 0 && (!n.attrs || typeof n.attrs != "object" || Array.isArray(n.attrs)))
|
|
929
938
|
return `${s}.attrs`;
|
|
930
|
-
const u =
|
|
939
|
+
const u = st[n.type] || /* @__PURE__ */ new Set();
|
|
931
940
|
for (const p of Object.keys(n.attrs || {}))
|
|
932
941
|
if (!u.has(p)) return `${s}.attrs.${p}`;
|
|
933
|
-
if (n.type === "businessToken" && !
|
|
942
|
+
if (n.type === "businessToken" && !be((L = n.attrs) == null ? void 0 : L.kind))
|
|
934
943
|
return `${s}.attrs.kind`;
|
|
935
944
|
if (n.type === "businessToken") {
|
|
936
945
|
const p = (C = (h = I(
|
|
@@ -944,68 +953,72 @@ function v(e, t = "knowledge.doc", r = !1) {
|
|
|
944
953
|
return `${s}.attrs.label`;
|
|
945
954
|
if (n.type === "businessToken" && ((N = n.attrs) == null ? void 0 : N.token) !== void 0 && n.attrs.token !== null && typeof n.attrs.token != "string")
|
|
946
955
|
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) ||
|
|
956
|
+
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
957
|
return `${s}.attrs.params`;
|
|
949
|
-
if (n.type === "mediaBlock" && !
|
|
958
|
+
if (n.type === "mediaBlock" && !we((F = n.attrs) == null ? void 0 : F.kind))
|
|
950
959
|
return `${s}.attrs.kind`;
|
|
951
960
|
if (n.type === "mediaBlock") {
|
|
952
|
-
if (((E = n.attrs) == null ? void 0 : E.
|
|
961
|
+
if (((E = n.attrs) == null ? void 0 : E.sourceType) !== void 0 && n.attrs.sourceType !== null && n.attrs.sourceType !== "qianniuVideo")
|
|
962
|
+
return `${s}.attrs.sourceType`;
|
|
963
|
+
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)))
|
|
964
|
+
return `${s}.attrs.sourceType`;
|
|
965
|
+
if (((z = n.attrs) == null ? void 0 : z.assetId) !== void 0 && n.attrs.assetId !== null && typeof n.attrs.assetId != "string")
|
|
953
966
|
return `${s}.attrs.assetId`;
|
|
954
|
-
if (((
|
|
967
|
+
if (((W = n.attrs) == null ? void 0 : W.name) !== void 0 && typeof n.attrs.name != "string")
|
|
955
968
|
return `${s}.attrs.name`;
|
|
956
|
-
if (((
|
|
969
|
+
if (((H = n.attrs) == null ? void 0 : H.error) !== void 0 && typeof n.attrs.error != "string")
|
|
957
970
|
return `${s}.attrs.error`;
|
|
958
|
-
if (((
|
|
971
|
+
if (((J = n.attrs) == null ? void 0 : J.status) !== void 0 && !["ready", "uploading", "error"].includes(String(n.attrs.status)))
|
|
959
972
|
return `${s}.attrs.status`;
|
|
960
|
-
const p = (((
|
|
961
|
-
if (!
|
|
973
|
+
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:");
|
|
974
|
+
if (!P((X = n.attrs) == null ? void 0 : X.src) && !p)
|
|
962
975
|
return `${s}.attrs.src`;
|
|
963
|
-
if (((
|
|
976
|
+
if (((Z = n.attrs) == null ? void 0 : Z.poster) !== void 0 && n.attrs.poster !== null && !P(n.attrs.poster))
|
|
964
977
|
return `${s}.attrs.poster`;
|
|
965
978
|
}
|
|
966
|
-
if (
|
|
967
|
-
const p = (
|
|
979
|
+
if (O(n.type)) {
|
|
980
|
+
const p = (ee = n.attrs) == null ? void 0 : ee.id;
|
|
968
981
|
if ((n.type === "mediaBlock" || p !== void 0) && (typeof p != "string" || !p.trim() || o.has(p)))
|
|
969
982
|
return `${s}.attrs.id`;
|
|
970
|
-
if (typeof p == "string" && o.add(p), ((
|
|
983
|
+
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
984
|
return `${s}.attrs.nodeVersion`;
|
|
972
985
|
}
|
|
973
|
-
if (n.type === "orderedList" && ((
|
|
986
|
+
if (n.type === "orderedList" && ((ne = n.attrs) == null ? void 0 : ne.start) !== void 0 && (!Number.isSafeInteger(n.attrs.start) || n.attrs.start < 1))
|
|
974
987
|
return `${s}.attrs.start`;
|
|
975
|
-
if (n.type === "orderedList" && ((
|
|
988
|
+
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
989
|
return `${s}.attrs.type`;
|
|
977
|
-
if (n.type === "codeBlock" && ((
|
|
990
|
+
if (n.type === "codeBlock" && ((ie = n.attrs) == null ? void 0 : ie.language) !== void 0 && n.attrs.language !== null && typeof n.attrs.language != "string")
|
|
978
991
|
return `${s}.attrs.language`;
|
|
979
992
|
if (n.marks !== void 0 && !Array.isArray(n.marks))
|
|
980
993
|
return `${s}.marks`;
|
|
981
|
-
if (c === "codeBlock" && ((
|
|
982
|
-
if ((
|
|
994
|
+
if (c === "codeBlock" && ((oe = n.marks) != null && oe.length)) return `${s}.marks`;
|
|
995
|
+
if ((se = n.marks) != null && se.some((p) => !at(p)))
|
|
983
996
|
return `${s}.marks`;
|
|
984
|
-
if ((
|
|
997
|
+
if ((ae = n.marks) != null && ae.length) {
|
|
985
998
|
const p = n.marks.map((T) => T.type);
|
|
986
999
|
if (new Set(p).size !== p.length || p.includes("code") && p.length > 1)
|
|
987
1000
|
return `${s}.marks`;
|
|
988
1001
|
}
|
|
989
1002
|
for (const [p, T] of (n.content || []).entries()) {
|
|
990
|
-
const
|
|
1003
|
+
const le = a(
|
|
991
1004
|
T,
|
|
992
1005
|
`${s}.content[${p}]`,
|
|
993
1006
|
n.type,
|
|
994
1007
|
l || n.type === "originalReply"
|
|
995
1008
|
);
|
|
996
|
-
if (
|
|
1009
|
+
if (le) return le;
|
|
997
1010
|
}
|
|
998
1011
|
return null;
|
|
999
1012
|
}
|
|
1000
1013
|
return a(e, t);
|
|
1001
1014
|
}
|
|
1002
|
-
function
|
|
1015
|
+
function lt(e, t, r = "knowledge.doc") {
|
|
1003
1016
|
if (!e) return null;
|
|
1004
1017
|
const o = /* @__PURE__ */ new WeakSet(), i = (a, n) => {
|
|
1005
1018
|
if (o.has(a)) return n;
|
|
1006
1019
|
o.add(a);
|
|
1007
|
-
const s =
|
|
1008
|
-
if (s && !
|
|
1020
|
+
const s = Ze(a);
|
|
1021
|
+
if (s && !V.some(
|
|
1009
1022
|
(c) => c.id === s.id && c.slot === s.slot && c.types.includes(t)
|
|
1010
1023
|
))
|
|
1011
1024
|
return n;
|
|
@@ -1017,15 +1030,15 @@ function ot(e, t, r = "knowledge.doc") {
|
|
|
1017
1030
|
};
|
|
1018
1031
|
return i(e, r);
|
|
1019
1032
|
}
|
|
1020
|
-
function
|
|
1033
|
+
function $t(e) {
|
|
1021
1034
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1022
1035
|
const t = e, r = t.question, o = t.knowledge;
|
|
1023
1036
|
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
1037
|
}
|
|
1025
|
-
function
|
|
1038
|
+
function St(e) {
|
|
1026
1039
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1027
1040
|
return "modelValue";
|
|
1028
|
-
const t =
|
|
1041
|
+
const t = fe(e);
|
|
1029
1042
|
if (t !== null) return t || "modelValue";
|
|
1030
1043
|
const r = e;
|
|
1031
1044
|
if (r.schemaVersion !== 1) return "schemaVersion";
|
|
@@ -1076,14 +1089,14 @@ function wt(e) {
|
|
|
1076
1089
|
);
|
|
1077
1090
|
if (u) return u;
|
|
1078
1091
|
}
|
|
1079
|
-
const n =
|
|
1092
|
+
const n = x(r.knowledge.doc);
|
|
1080
1093
|
if (n) return n;
|
|
1081
|
-
const s =
|
|
1094
|
+
const s = lt(
|
|
1082
1095
|
r.knowledge.doc,
|
|
1083
1096
|
r.type
|
|
1084
1097
|
);
|
|
1085
1098
|
if (s) return s;
|
|
1086
|
-
const c =
|
|
1099
|
+
const c = x(
|
|
1087
1100
|
r.knowledge.retainedDoc ?? null,
|
|
1088
1101
|
"knowledge.retainedDoc",
|
|
1089
1102
|
r.type === "agent"
|
|
@@ -1092,7 +1105,7 @@ function wt(e) {
|
|
|
1092
1105
|
if (r.type === "agent") {
|
|
1093
1106
|
if (r.knowledge.agentBody && r.knowledge.retainedDoc)
|
|
1094
1107
|
return "knowledge.agentBody";
|
|
1095
|
-
const l =
|
|
1108
|
+
const l = x(
|
|
1096
1109
|
r.knowledge.agentBody ?? null,
|
|
1097
1110
|
"knowledge.agentBody",
|
|
1098
1111
|
!0
|
|
@@ -1102,8 +1115,8 @@ function wt(e) {
|
|
|
1102
1115
|
if (!r.extensionState || typeof r.extensionState != "object" || Array.isArray(r.extensionState))
|
|
1103
1116
|
return "extensionState";
|
|
1104
1117
|
for (const [l, u] of Object.entries(r.extensionState)) {
|
|
1105
|
-
const d =
|
|
1106
|
-
(
|
|
1118
|
+
const d = V.find(
|
|
1119
|
+
(f) => f.id === l && f.types.includes(r.type) && f.implementation === "plugin"
|
|
1107
1120
|
);
|
|
1108
1121
|
if (!d) return `extensionState.${l}`;
|
|
1109
1122
|
if (!u || typeof u != "object" || u.version !== d.dataVersion)
|
|
@@ -1119,20 +1132,20 @@ function wt(e) {
|
|
|
1119
1132
|
if (d.slot === "questionAction" && typeof u.data.enabled != "boolean")
|
|
1120
1133
|
return `extensionState.${l}.data.enabled`;
|
|
1121
1134
|
if (d.slot === "questionAction" && d.questionTag) {
|
|
1122
|
-
const
|
|
1123
|
-
if (
|
|
1135
|
+
const f = u.data;
|
|
1136
|
+
if (f.enabled === !0 && f.tag === void 0)
|
|
1124
1137
|
return `extensionState.${l}.data.tag`;
|
|
1125
|
-
if (
|
|
1126
|
-
const { tag: m } =
|
|
1138
|
+
if (f.tag !== void 0) {
|
|
1139
|
+
const { tag: m } = f;
|
|
1127
1140
|
if (!m || typeof m != "object" || Array.isArray(m))
|
|
1128
1141
|
return `extensionState.${l}.data.tag`;
|
|
1129
|
-
const
|
|
1130
|
-
if (typeof
|
|
1142
|
+
const g = m;
|
|
1143
|
+
if (typeof g.id != "string" || !g.id.trim())
|
|
1131
1144
|
return `extensionState.${l}.data.tag.id`;
|
|
1132
|
-
if (typeof
|
|
1145
|
+
if (typeof g.label != "string" || !g.label.trim() || he(g.label))
|
|
1133
1146
|
return `extensionState.${l}.data.tag.label`;
|
|
1134
1147
|
const b = k(
|
|
1135
|
-
|
|
1148
|
+
g,
|
|
1136
1149
|
["id", "label"],
|
|
1137
1150
|
`extensionState.${l}.data.tag`
|
|
1138
1151
|
);
|
|
@@ -1143,40 +1156,41 @@ function wt(e) {
|
|
|
1143
1156
|
return null;
|
|
1144
1157
|
}
|
|
1145
1158
|
export {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1159
|
+
et as A,
|
|
1160
|
+
V as B,
|
|
1161
|
+
We as C,
|
|
1162
|
+
ct as D,
|
|
1163
|
+
Ze as E,
|
|
1164
|
+
ht as F,
|
|
1165
|
+
$t as G,
|
|
1166
|
+
he as H,
|
|
1167
|
+
ke as I,
|
|
1168
|
+
rt as J,
|
|
1169
|
+
He as M,
|
|
1170
|
+
fe as a,
|
|
1171
|
+
x as b,
|
|
1172
|
+
ge as c,
|
|
1173
|
+
O as d,
|
|
1174
|
+
it as e,
|
|
1175
|
+
pe as f,
|
|
1162
1176
|
I as g,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1177
|
+
nt as h,
|
|
1178
|
+
P as i,
|
|
1179
|
+
St as j,
|
|
1180
|
+
Be as k,
|
|
1181
|
+
ut as l,
|
|
1182
|
+
ft as m,
|
|
1183
|
+
gt as n,
|
|
1184
|
+
tt as o,
|
|
1185
|
+
dt as p,
|
|
1186
|
+
bt as q,
|
|
1187
|
+
be as r,
|
|
1188
|
+
wt as s,
|
|
1189
|
+
mt as t,
|
|
1190
|
+
A as u,
|
|
1191
|
+
kt as v,
|
|
1192
|
+
pt as w,
|
|
1193
|
+
$ as x,
|
|
1194
|
+
yt as y,
|
|
1181
1195
|
Xe as z
|
|
1182
1196
|
};
|