@freecallai/pro 0.0.3 → 0.0.5
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/LICENSE +20 -20
- package/README.md +23 -23
- package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js +193 -0
- package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js +4980 -0
- package/dist/KnowledgeArea-CEX1esVZ.js +4 -0
- package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-Bg1e7xYT.js +1653 -0
- package/dist/ToolForm-DA-EFBhw.js +196 -0
- package/dist/agent-prompt-editor/index.js +917 -0
- package/dist/agent-prompt-editor/legacy-converter/index.js +490 -0
- package/dist/{choice-Bt2xhoN_.js → choice-2dbddjJU.js} +1 -1
- package/dist/edition-info/index.js +1 -1
- package/dist/filters/index.js +1 -1
- package/dist/{guard-B7U3S4F1.js → guard-Cr_ny-sR.js} +255 -237
- package/dist/index-7x1OTv0m.js +98 -0
- package/dist/{index-BF6MRSMb.js → index-BBxrpF3v.js} +1 -1
- package/dist/{index-sjDmbR5o.js → index-CgRisH4B.js} +1 -1
- package/dist/index-Ck8RYpuE.js +816 -0
- package/dist/index-CnjG7Mj4.js +5 -0
- package/dist/{index-lNhA3N9x.js → index-DBQsQ1ZK.js} +1 -0
- package/dist/index-DCZKt14c.js +5 -0
- package/dist/{index-D9yqpH_4.js → index-DiaPY8Db.js} +2 -2
- package/dist/{index-trxE5T0w.js → index-DmdrsEvk.js} +1 -1
- package/dist/index-DnmCPdCI.js +168 -0
- package/dist/{index-B4-2_sJI.js → index-DwDYy2lj.js} +1 -1
- package/dist/{index-BBv72oZe.js → index-FQQfN6nm.js} +1 -1
- package/dist/{index-DYeJRJY1.js → index-aic1yCBs.js} +1 -1
- package/dist/index.js +13 -13
- package/dist/{inline-KPGqYMIR.js → inline-8aNfINLF.js} +1 -1
- package/dist/knowledge-type-picker/index.js +1 -1
- package/dist/{knowledge-CupkY2rK.js → knowledge-y2j0ijgx.js} +1 -1
- package/dist/{media-extensions-DhRlLKYM.js → media-extensions-wlcCEdtg.js} +27 -24
- package/dist/media-id-b2dgniSy.js +15 -0
- package/dist/{media-migration-CbMT2wS0.js → media-migration-Dy_rbdkK.js} +1 -1
- package/dist/media-policy-BwKjZPWt.js +158 -0
- package/dist/{media-upload-P9WeUHHr.js → media-upload-NzWYyCm3.js} +1 -1
- package/dist/model-DvukseoR.js +146 -0
- package/dist/navigation/index.js +1 -1
- package/dist/rich-text/index.js +75 -73
- package/dist/rich-text/legacy-converter/index.js +988 -867
- package/dist/style.css +1 -1
- package/dist/switcher/index.js +1 -1
- package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +550 -0
- package/dist/types/agent-prompt-editor/agent-size-chart.d.ts +3 -0
- package/dist/types/agent-prompt-editor/document-adapter.d.ts +3 -0
- package/dist/types/agent-prompt-editor/index.d.ts +6 -0
- package/dist/types/agent-prompt-editor/legacy-converter-index.d.ts +2 -0
- package/dist/types/agent-prompt-editor/legacy-converter.d.ts +26 -0
- package/dist/types/agent-prompt-editor/model.d.ts +21 -0
- package/dist/types/agent-prompt-editor/types.d.ts +56 -0
- package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +1 -3
- package/dist/types/edition-info/presets.d.ts +8 -0
- package/dist/types/edition-info/types.d.ts +1 -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 +4 -1
- package/dist/types/navigation/FkpNavigation.vue.d.ts +20 -29
- package/dist/types/navigation/NavigationButton.vue.d.ts +26 -0
- package/dist/types/navigation/NavigationGroup.vue.d.ts +45 -0
- package/dist/types/navigation/NavigationIcon.vue.d.ts +28 -0
- package/dist/types/navigation/NavigationNodes.vue.d.ts +40 -0
- package/dist/types/navigation/index.d.ts +1 -1
- package/dist/types/navigation/types.d.ts +43 -5
- package/dist/types/navigation/use-navigation-tree.d.ts +13 -0
- package/dist/types/rich-text/FkpRichText.vue.d.ts +28 -8
- package/dist/types/rich-text/config/descriptor.d.ts +1 -0
- package/dist/types/rich-text/config/resolve.d.ts +1 -1
- package/dist/types/rich-text/index.d.ts +4 -1
- package/dist/types/rich-text/knowledge-document-adapter.d.ts +2 -0
- package/dist/types/rich-text/model/question-text.d.ts +1 -1
- package/dist/types/rich-text/plugins/registry.d.ts +2 -1
- package/dist/types/rich-text/public/types.d.ts +12 -0
- package/dist/types/rich-text/runtime/document-adapter.d.ts +9 -0
- package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +9 -3
- package/dist/types/rich-text/runtime/media-sources.d.ts +7 -0
- package/dist/types/rich-text/runtime/media-upload-session.d.ts +2 -0
- package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +3 -3
- package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +18 -3
- package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +190 -0
- package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
- package/dist/types/rich-text/ui/token-renderer.d.ts +3 -0
- package/dist/types/rich-text/ui/useMediaHint.d.ts +6 -0
- package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
- package/dist/types-PvYB5e85.js +14 -0
- package/package.json +13 -5
- package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js +0 -187
- package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js +0 -4864
- package/dist/KnowledgeArea-_rsydhnt.js +0 -1438
- package/dist/ToolForm-Czg67cDT.js +0 -185
- package/dist/index-BQrYBmwR.js +0 -5
- package/dist/index-CS2xQQ8W.js +0 -168
- package/dist/index-D0bJAQSN.js +0 -327
- package/dist/index-DCmHHi07.js +0 -71
- package/dist/index-uCVrA6xK.js +0 -5
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { e as k } from "./types-PvYB5e85.js";
|
|
2
|
+
import { a as $, b as S, c as T } from "./guard-Cr_ny-sR.js";
|
|
3
|
+
const I = [
|
|
4
|
+
"variable",
|
|
5
|
+
"todo",
|
|
6
|
+
"tableKnowledge",
|
|
7
|
+
"sizeChart",
|
|
8
|
+
"attribute",
|
|
9
|
+
"image",
|
|
10
|
+
"video",
|
|
11
|
+
"originalReply",
|
|
12
|
+
"separator",
|
|
13
|
+
"smallPayment"
|
|
14
|
+
], x = () => ({
|
|
15
|
+
schemaVersion: 1,
|
|
16
|
+
doc: k()
|
|
17
|
+
});
|
|
18
|
+
function p(s, r, t) {
|
|
19
|
+
return { code: s, message: r, path: t, severity: "error", source: "validation" };
|
|
20
|
+
}
|
|
21
|
+
function P(s) {
|
|
22
|
+
const r = (t, e, c) => {
|
|
23
|
+
var o, l, a, u, i;
|
|
24
|
+
if (![
|
|
25
|
+
"doc",
|
|
26
|
+
"paragraph",
|
|
27
|
+
"text",
|
|
28
|
+
"hardBreak",
|
|
29
|
+
"businessToken",
|
|
30
|
+
"agentSizeChart",
|
|
31
|
+
"originalReply",
|
|
32
|
+
"messageSeparator",
|
|
33
|
+
"mediaBlock"
|
|
34
|
+
].includes(t.type || ""))
|
|
35
|
+
return e;
|
|
36
|
+
if (t.type !== "text" && ((o = t.marks) != null && o.length)) return `${e}.marks`;
|
|
37
|
+
if (t.type === "text" && ((l = t.marks) != null && l.some(
|
|
38
|
+
(n) => {
|
|
39
|
+
var f;
|
|
40
|
+
return n.type === "link" && (Object.keys(n.attrs || {}).some(
|
|
41
|
+
(m) => !["href", "target"].includes(m)
|
|
42
|
+
) || ((f = n.attrs) == null ? void 0 : f.target) !== void 0 && n.attrs.target !== "_self");
|
|
43
|
+
}
|
|
44
|
+
)))
|
|
45
|
+
return `${e}.marks`;
|
|
46
|
+
if (t.type === "businessToken") {
|
|
47
|
+
const n = (a = t.attrs) == null ? void 0 : a.kind;
|
|
48
|
+
if (![
|
|
49
|
+
"variable",
|
|
50
|
+
"todo",
|
|
51
|
+
"tableKnowledge",
|
|
52
|
+
"attribute",
|
|
53
|
+
"separator",
|
|
54
|
+
"tool"
|
|
55
|
+
].includes(String(n)) || n === "tool" && ((u = t.attrs) == null ? void 0 : u.key) !== "small_payment")
|
|
56
|
+
return `${e}.attrs.kind`;
|
|
57
|
+
}
|
|
58
|
+
if (t.type === "agentSizeChart") {
|
|
59
|
+
if (c !== "paragraph") return e;
|
|
60
|
+
if (!t.attrs || Object.keys(t.attrs).some((n) => n !== "name") || typeof t.attrs.name != "string" || !t.attrs.name.trim() || /[#@<>\r\n]/u.test(t.attrs.name) || (i = t.content) != null && i.length)
|
|
61
|
+
return `${e}.attrs.name`;
|
|
62
|
+
}
|
|
63
|
+
for (const [n, f] of (t.content || []).entries()) {
|
|
64
|
+
const m = r(f, `${e}.content[${n}]`, t.type);
|
|
65
|
+
if (m) return m;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
return r(s, "doc");
|
|
70
|
+
}
|
|
71
|
+
function d(s) {
|
|
72
|
+
var r;
|
|
73
|
+
return s.type === "agentSizeChart" ? { type: "text", text: `#@${((r = s.attrs) == null ? void 0 : r.name) || ""}@#` } : {
|
|
74
|
+
...s,
|
|
75
|
+
...s.content ? { content: s.content.map(d) } : {}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function C(s) {
|
|
79
|
+
const r = $(s);
|
|
80
|
+
if (r !== null) return r || "modelValue";
|
|
81
|
+
if (!s || typeof s != "object" || Array.isArray(s))
|
|
82
|
+
return "modelValue";
|
|
83
|
+
const t = s;
|
|
84
|
+
if (t.schemaVersion !== 1) return "schemaVersion";
|
|
85
|
+
if (Object.keys(t).some((o) => !["schemaVersion", "doc"].includes(o)))
|
|
86
|
+
return Object.keys(t).find(
|
|
87
|
+
(o) => !["schemaVersion", "doc"].includes(o)
|
|
88
|
+
);
|
|
89
|
+
if (!t.doc || typeof t.doc != "object" || Array.isArray(t.doc))
|
|
90
|
+
return "doc";
|
|
91
|
+
const e = t.doc, c = P(e);
|
|
92
|
+
return c || S(
|
|
93
|
+
d(e),
|
|
94
|
+
"doc",
|
|
95
|
+
!0
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function _(s) {
|
|
99
|
+
let r = 0;
|
|
100
|
+
const t = (e) => {
|
|
101
|
+
var c, o, l, a;
|
|
102
|
+
if (e.type === "text" && (r += (e.text || "").replace(/[\r\n]/gu, "").length), e.type === "agentSizeChart" && (r += `#@${((c = e.attrs) == null ? void 0 : c.name) || ""}@#`.length), e.type === "businessToken") {
|
|
103
|
+
const { kind: u, key: i, label: n, params: f } = e.attrs || {};
|
|
104
|
+
u === "tableKnowledge" ? r += `##${n || ""}##`.length : u === "attribute" ? r += `{业务属性@${n || ""}}`.length : u === "todo" ? r += n === "默认" && ((o = e.attrs) == null ? void 0 : o.token) === "{待办}" ? 4 : `{待办@${n || i || ""}}`.length : u === "separator" ? r += 5 : u === "tool" && i === "small_payment" ? r += `$$小额打款@${Number(f == null ? void 0 : f.amount) * 100}$$`.length : r += String(((l = e.attrs) == null ? void 0 : l.token) || n || i || "").length;
|
|
105
|
+
}
|
|
106
|
+
(a = e.content) == null || a.forEach(t);
|
|
107
|
+
};
|
|
108
|
+
return t(s.doc), r;
|
|
109
|
+
}
|
|
110
|
+
function O(s, r = 1e4) {
|
|
111
|
+
const t = C(s);
|
|
112
|
+
if (t)
|
|
113
|
+
return [
|
|
114
|
+
p("PROMPT_DOCUMENT_INVALID", "提示词文档包含无效内容", t)
|
|
115
|
+
];
|
|
116
|
+
const e = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
|
|
117
|
+
let o = 0, l = !1;
|
|
118
|
+
const a = [], u = (i, n) => {
|
|
119
|
+
var f, m;
|
|
120
|
+
if (i.type === "text" && (i.text || "").trim() && (l = !0), i.type === "agentSizeChart" && (e.add(String((f = i.attrs) == null ? void 0 : f.name).trim()), l = !0), i.type === "businessToken") {
|
|
121
|
+
const { kind: y, key: g, label: b, params: h } = i.attrs || {};
|
|
122
|
+
y === "tableKnowledge" && c.add(String(b).trim()), y === "tool" && g === "small_payment" && (o++, T(h == null ? void 0 : h.amount) || a.push(
|
|
123
|
+
p(
|
|
124
|
+
"PAYMENT_INVALID",
|
|
125
|
+
"小额打款金额必须为 1–99 整数元",
|
|
126
|
+
`${n}.attrs.params.amount`
|
|
127
|
+
)
|
|
128
|
+
)), l = !0;
|
|
129
|
+
}
|
|
130
|
+
(i.type === "mediaBlock" || i.type === "originalReply") && (l = !0), (m = i.content) == null || m.forEach(
|
|
131
|
+
(y, g) => u(y, `${n}.content[${g}]`)
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
return u(s.doc, "doc"), l || a.push(p("PROMPT_EMPTY", "请填写提示词", "doc")), _(s) > r && a.push(
|
|
135
|
+
p("PROMPT_TOO_LONG", `提示词不能超过 ${r} 字`, "doc")
|
|
136
|
+
), c.size > 5 && a.push(p("TABLE_LIMIT", "最多引用 5 个表格知识", "doc")), e.size > 4 && a.push(p("SIZE_LIMIT", "最多引用 4 个尺码表", "doc")), c.size && e.size && a.push(
|
|
137
|
+
p("TABLE_SIZE_CONFLICT", "表格知识与尺码表不能同时引用", "doc")
|
|
138
|
+
), o > 1 && a.push(p("PAYMENT_LIMIT", "最多配置一个小额打款工具", "doc")), a;
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
I as a,
|
|
142
|
+
_ as c,
|
|
143
|
+
x as e,
|
|
144
|
+
C as f,
|
|
145
|
+
O as v
|
|
146
|
+
};
|
package/dist/navigation/index.js
CHANGED
package/dist/rich-text/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { p as S, v as C, d as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { _ as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { p as S, v as C, d as E } from "../FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js";
|
|
2
|
+
import { _ as G, _ as H, r as V } from "../FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js";
|
|
3
|
+
import { _ as X } from "../FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js";
|
|
4
|
+
import { e as Z, a as ee } from "../types-PvYB5e85.js";
|
|
5
|
+
import { a as m, j as x } from "../guard-Cr_ny-sR.js";
|
|
6
|
+
import { s as te, e as oe } from "../guard-Cr_ny-sR.js";
|
|
7
|
+
import { d as O } from "../media-policy-BwKjZPWt.js";
|
|
8
|
+
import { a as ie, b as re } from "../media-migration-Dy_rbdkK.js";
|
|
7
9
|
const b = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
8
|
-
function
|
|
10
|
+
function v(e) {
|
|
9
11
|
let n;
|
|
10
12
|
try {
|
|
11
|
-
const i =
|
|
13
|
+
const i = m(e);
|
|
12
14
|
if (i !== null) return { ok: !1, path: i || "condition" };
|
|
13
15
|
n = JSON.parse(JSON.stringify(e));
|
|
14
16
|
} catch {
|
|
@@ -23,20 +25,20 @@ function m(e) {
|
|
|
23
25
|
if (n.id !== void 0 && (typeof n.id != "string" || !n.id.trim()))
|
|
24
26
|
return { ok: !1, path: "id" };
|
|
25
27
|
if (!Array.isArray(n.scenes)) return { ok: !1, path: "scenes" };
|
|
26
|
-
const
|
|
27
|
-
for (const [i,
|
|
28
|
+
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
29
|
+
for (const [i, o] of n.scenes.entries()) {
|
|
28
30
|
const c = `scenes[${i}]`;
|
|
29
|
-
if (!b(
|
|
30
|
-
const p = Object.keys(
|
|
31
|
+
if (!b(o)) return { ok: !1, path: c };
|
|
32
|
+
const p = Object.keys(o).find(
|
|
31
33
|
(h) => !["sceneKey", "scene"].includes(h)
|
|
32
34
|
);
|
|
33
35
|
if (p) return { ok: !1, path: `${c}.${p}` };
|
|
34
|
-
if (typeof
|
|
36
|
+
if (typeof o.sceneKey != "string" || !o.sceneKey.trim() || s.has(o.sceneKey))
|
|
35
37
|
return { ok: !1, path: `${c}.sceneKey` };
|
|
36
|
-
|
|
37
|
-
const a = x(
|
|
38
|
+
s.add(o.sceneKey);
|
|
39
|
+
const a = x(o.scene);
|
|
38
40
|
if (a) return { ok: !1, path: `${c}.scene.${a}` };
|
|
39
|
-
const l =
|
|
41
|
+
const l = o.scene;
|
|
40
42
|
if (l.id !== void 0) {
|
|
41
43
|
if (!l.id.trim() || r.has(l.id))
|
|
42
44
|
return { ok: !1, path: `${c}.scene.id` };
|
|
@@ -49,54 +51,54 @@ const y = (e) => !!e && typeof e == "object" && !Array.isArray(e), d = (e) => ty
|
|
|
49
51
|
function A(e, n) {
|
|
50
52
|
return Object.keys(e).every((t) => n.includes(t));
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function J(e) {
|
|
53
55
|
var i;
|
|
54
56
|
let n;
|
|
55
57
|
try {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
+
const o = m(e);
|
|
59
|
+
if (o !== null) return { ok: !1, path: o || "input" };
|
|
58
60
|
n = JSON.parse(JSON.stringify(e));
|
|
59
61
|
} catch {
|
|
60
62
|
return { ok: !1, path: "input" };
|
|
61
63
|
}
|
|
62
64
|
if (!y(n)) return { ok: !1, path: "input" };
|
|
63
65
|
const t = Object.keys(n).find(
|
|
64
|
-
(
|
|
66
|
+
(o) => !["condition", "expectedRevision", "idempotencyKey"].includes(o)
|
|
65
67
|
);
|
|
66
68
|
if (t) return { ok: !1, path: t };
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
if (
|
|
69
|
+
const s = v(n.condition);
|
|
70
|
+
if (!s.ok) return { ok: !1, path: `condition.${s.path}` };
|
|
71
|
+
if (s.data.id === void 0 && n.expectedRevision !== null || s.data.id !== void 0 && !d(n.expectedRevision))
|
|
70
72
|
return { ok: !1, path: "expectedRevision" };
|
|
71
73
|
if (!d(n.idempotencyKey))
|
|
72
74
|
return { ok: !1, path: "idempotencyKey" };
|
|
73
75
|
const r = C(
|
|
74
|
-
|
|
76
|
+
s.data.scenes.map((o) => o.scene)
|
|
75
77
|
);
|
|
76
78
|
if (!r.ok) {
|
|
77
|
-
const
|
|
79
|
+
const o = (i = r.issues[0]) == null ? void 0 : i.sceneIndex;
|
|
78
80
|
return {
|
|
79
81
|
ok: !1,
|
|
80
|
-
path:
|
|
82
|
+
path: o == null ? "condition.scenes" : `condition.scenes[${o}].scene`
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
return {
|
|
84
86
|
ok: !0,
|
|
85
87
|
data: {
|
|
86
|
-
condition:
|
|
88
|
+
condition: s.data,
|
|
87
89
|
expectedRevision: n.expectedRevision,
|
|
88
90
|
idempotencyKey: n.idempotencyKey
|
|
89
91
|
}
|
|
90
92
|
};
|
|
91
93
|
}
|
|
92
|
-
const
|
|
94
|
+
const j = (e) => {
|
|
93
95
|
if (!y(e) || !A(e, ["condition", "revision", "migrationIssues"]) || !d(e.revision) || !Array.isArray(e.migrationIssues) || !e.migrationIssues.every(
|
|
94
96
|
(t) => E(t) && t.source === "migration" && t.severity !== "error" && d(t.path)
|
|
95
97
|
))
|
|
96
98
|
return !1;
|
|
97
|
-
const n =
|
|
99
|
+
const n = v(e.condition);
|
|
98
100
|
return n.ok && d(n.data.id) && n.data.scenes.length > 0 && n.data.scenes.every((t) => d(t.scene.id));
|
|
99
|
-
},
|
|
101
|
+
}, N = (e) => y(e) && A(e, [
|
|
100
102
|
"kind",
|
|
101
103
|
"conditionId",
|
|
102
104
|
"rawCondition",
|
|
@@ -106,61 +108,61 @@ const J = (e) => {
|
|
|
106
108
|
) && e.migrationIssues.some((n) => n.severity === "error"), L = (e) => {
|
|
107
109
|
if (!y(e) || !A(e, ["condition", "revision"]) || !d(e.revision))
|
|
108
110
|
return !1;
|
|
109
|
-
const n =
|
|
111
|
+
const n = v(e.condition);
|
|
110
112
|
return n.ok && d(n.data.id) && n.data.scenes.every((t) => d(t.scene.id)) && C(n.data.scenes.map((t) => t.scene)).ok;
|
|
111
113
|
};
|
|
112
|
-
function M(e) {
|
|
113
|
-
return S(e, J);
|
|
114
|
-
}
|
|
115
114
|
function P(e) {
|
|
115
|
+
return S(e, j);
|
|
116
|
+
}
|
|
117
|
+
function _(e) {
|
|
116
118
|
return S(
|
|
117
119
|
e,
|
|
118
|
-
(n) =>
|
|
120
|
+
(n) => j(n) || N(n)
|
|
119
121
|
);
|
|
120
122
|
}
|
|
121
123
|
function T(e) {
|
|
122
124
|
return S(e, L);
|
|
123
125
|
}
|
|
124
|
-
function
|
|
125
|
-
const t =
|
|
126
|
+
function z(e, n) {
|
|
127
|
+
const t = J(e);
|
|
126
128
|
if (!t.ok) return { ok: !1, path: t.path };
|
|
127
|
-
const
|
|
129
|
+
const s = t.data.condition, r = T({ ok: !0, data: n });
|
|
128
130
|
if (!r.ok) {
|
|
129
|
-
const
|
|
131
|
+
const o = (() => {
|
|
130
132
|
try {
|
|
131
|
-
return y(n) &&
|
|
133
|
+
return y(n) && m(n) === null ? v(n.condition) : null;
|
|
132
134
|
} catch {
|
|
133
135
|
return null;
|
|
134
136
|
}
|
|
135
137
|
})();
|
|
136
|
-
return
|
|
138
|
+
return o != null && o.ok && s.scenes.length !== o.data.scenes.length ? { ok: !1, path: "scenes" } : { ok: !1, path: "saved" };
|
|
137
139
|
}
|
|
138
140
|
const i = r.data.condition;
|
|
139
141
|
if (t.data.expectedRevision !== null && r.data.revision === t.data.expectedRevision)
|
|
140
142
|
return { ok: !1, path: "revision" };
|
|
141
|
-
if (
|
|
143
|
+
if (s.id !== void 0 && s.id !== i.id)
|
|
142
144
|
return { ok: !1, path: "id" };
|
|
143
|
-
if (
|
|
145
|
+
if (s.scenes.length !== i.scenes.length)
|
|
144
146
|
return { ok: !1, path: "scenes" };
|
|
145
|
-
for (const [
|
|
146
|
-
const p = i.scenes[
|
|
147
|
+
for (const [o, c] of s.scenes.entries()) {
|
|
148
|
+
const p = i.scenes[o];
|
|
147
149
|
if (c.sceneKey !== p.sceneKey)
|
|
148
|
-
return { ok: !1, path: `scenes[${
|
|
150
|
+
return { ok: !1, path: `scenes[${o}].sceneKey` };
|
|
149
151
|
const a = { ...p.scene };
|
|
150
152
|
if (c.scene.id === void 0 && delete a.id, O(c.scene) !== O(a))
|
|
151
|
-
return { ok: !1, path: `scenes[${
|
|
153
|
+
return { ok: !1, path: `scenes[${o}].scene` };
|
|
152
154
|
}
|
|
153
155
|
return { ok: !0 };
|
|
154
156
|
}
|
|
155
|
-
function
|
|
157
|
+
function Q(e, n) {
|
|
156
158
|
var c, p;
|
|
157
159
|
if (e.type !== "reasoning")
|
|
158
160
|
throw new Error("只有推理知识可以构造推理引用上下文");
|
|
159
161
|
const t = x(e);
|
|
160
162
|
if (t) throw new Error(`知识内容无效:${t}`);
|
|
161
|
-
if (!n || typeof n != "object" || Array.isArray(n) ||
|
|
163
|
+
if (!n || typeof n != "object" || Array.isArray(n) || m(n) !== null)
|
|
162
164
|
throw new Error("属性值不是合法的 JSON 对象");
|
|
163
|
-
const
|
|
165
|
+
const s = [], r = [], i = [], o = (a) => {
|
|
164
166
|
var l, h, K, R, I, $;
|
|
165
167
|
if (a.type === "businessToken") {
|
|
166
168
|
const u = String((l = a.attrs) == null ? void 0 : l.kind), f = String((h = a.attrs) == null ? void 0 : h.key), k = String(((K = a.attrs) == null ? void 0 : K.id) || ""), w = String(((R = a.attrs) == null ? void 0 : R.label) || f);
|
|
@@ -171,7 +173,7 @@ function z(e, n) {
|
|
|
171
173
|
else if (u === "attribute") {
|
|
172
174
|
if (!Object.prototype.hasOwnProperty.call(n, f))
|
|
173
175
|
throw new Error(`缺少属性值:${f}`);
|
|
174
|
-
|
|
176
|
+
s.push({
|
|
175
177
|
nodeId: k,
|
|
176
178
|
key: f,
|
|
177
179
|
label: w,
|
|
@@ -189,40 +191,40 @@ function z(e, n) {
|
|
|
189
191
|
});
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
|
-
($ = a.content) == null || $.forEach(
|
|
194
|
+
($ = a.content) == null || $.forEach(o);
|
|
193
195
|
};
|
|
194
|
-
return (p = (c = e.knowledge.doc) == null ? void 0 : c.content) == null || p.forEach(
|
|
196
|
+
return (p = (c = e.knowledge.doc) == null ? void 0 : c.content) == null || p.forEach(o), { knowledgeType: "reasoning", tickets: r, attributes: s, tools: i };
|
|
195
197
|
}
|
|
196
|
-
function
|
|
197
|
-
var
|
|
198
|
+
function U(e) {
|
|
199
|
+
var s, r;
|
|
198
200
|
if (e.type !== "agent")
|
|
199
201
|
throw new Error("只有Agent知识可以构造Agent调用上下文");
|
|
200
202
|
const n = x(e);
|
|
201
203
|
if (n) throw new Error(`知识内容无效:${n}`);
|
|
202
|
-
if ((
|
|
204
|
+
if ((s = e.knowledge.agentRef) != null && s.invalid)
|
|
203
205
|
throw new Error("Agent 已失效,请重新选择");
|
|
204
206
|
const t = (r = e.knowledge.agentRef) == null ? void 0 : r.id;
|
|
205
207
|
if (!(t != null && t.trim())) throw new Error("请选择Agent");
|
|
206
208
|
return { knowledgeType: "agent", agentId: t };
|
|
207
209
|
}
|
|
208
210
|
export {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
X as FkpKnowledgeTypePicker,
|
|
212
|
+
G as FkpRichText,
|
|
213
|
+
ie as assignLegacyExtensionIds,
|
|
214
|
+
re as assignLegacyMediaIds,
|
|
215
|
+
U as buildAgentInvocationContext,
|
|
216
|
+
Q as buildReasoningReferenceContext,
|
|
217
|
+
H as default,
|
|
218
|
+
Z as emptyDoc,
|
|
219
|
+
ee as emptyScene,
|
|
220
|
+
_ as parseConditionLoadResult,
|
|
221
|
+
v as parseKnowledgeConditionV1,
|
|
222
|
+
P as parseLoadedConditionResult,
|
|
223
|
+
J as parseSaveConditionInput,
|
|
222
224
|
T as parseSavedConditionResult,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
V as resolveSceneConfig,
|
|
226
|
+
te as serializeQuestionForModel,
|
|
227
|
+
oe as serializeQuestionTagsForModel,
|
|
226
228
|
C as validateKnowledgeScenes,
|
|
227
|
-
|
|
229
|
+
z as verifySavedConditionEcho
|
|
228
230
|
};
|