@freecallai/pro 0.0.4 → 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-C1SxozNA.js → choice-2dbddjJU.js} +1 -1
- package/dist/edition-info/index.js +1 -1
- package/dist/filters/index.js +1 -1
- package/dist/{guard-CXpVx8UR.js → guard-Cr_ny-sR.js} +226 -213
- package/dist/index-7x1OTv0m.js +98 -0
- package/dist/{index-CM0MN2DT.js → index-BBxrpF3v.js} +1 -1
- package/dist/{index-UjI4WA5F.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-BqXNMfLG.js → index-DiaPY8Db.js} +2 -2
- package/dist/{index-bSNw0XAf.js → index-DmdrsEvk.js} +1 -1
- package/dist/index-DnmCPdCI.js +168 -0
- package/dist/{index-Cy4DqT8R.js → index-DwDYy2lj.js} +1 -1
- package/dist/{index-B8jg37Wj.js → index-FQQfN6nm.js} +1 -1
- package/dist/{index-CZc2Gyjb.js → index-aic1yCBs.js} +1 -1
- package/dist/index.js +13 -13
- package/dist/{inline-Zj7Hqg-_.js → inline-8aNfINLF.js} +1 -1
- package/dist/knowledge-type-picker/index.js +1 -1
- package/dist/{knowledge-DaTnF2IW.js → knowledge-y2j0ijgx.js} +1 -1
- package/dist/media-id-b2dgniSy.js +15 -0
- package/dist/{media-migration-C2QLMSpd.js → media-migration-Dy_rbdkK.js} +1 -1
- package/dist/media-policy-BwKjZPWt.js +158 -0
- package/dist/{media-upload-D9MYBbLg.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 +822 -799
- 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-DYwu7oQs.js +0 -187
- package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js +0 -4885
- package/dist/KnowledgeArea-BH-_uF6R.js +0 -1438
- package/dist/ToolForm-C6XW31Y7.js +0 -185
- package/dist/index-CS2xQQ8W.js +0 -168
- package/dist/index-D0bJAQSN.js +0 -327
- package/dist/index-DAZ1ulyA.js +0 -5
- package/dist/index-DCmHHi07.js +0 -71
- package/dist/index-F7lDP1lI.js +0 -5
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
|
};
|