@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.
Files changed (94) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +23 -23
  3. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang--MPtqZY_.js +193 -0
  4. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-bw74hFS9.js +4980 -0
  5. package/dist/KnowledgeArea-CEX1esVZ.js +4 -0
  6. package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-Bg1e7xYT.js +1653 -0
  7. package/dist/ToolForm-DA-EFBhw.js +196 -0
  8. package/dist/agent-prompt-editor/index.js +917 -0
  9. package/dist/agent-prompt-editor/legacy-converter/index.js +490 -0
  10. package/dist/{choice-C1SxozNA.js → choice-2dbddjJU.js} +1 -1
  11. package/dist/edition-info/index.js +1 -1
  12. package/dist/filters/index.js +1 -1
  13. package/dist/{guard-CXpVx8UR.js → guard-Cr_ny-sR.js} +226 -213
  14. package/dist/index-7x1OTv0m.js +98 -0
  15. package/dist/{index-CM0MN2DT.js → index-BBxrpF3v.js} +1 -1
  16. package/dist/{index-UjI4WA5F.js → index-CgRisH4B.js} +1 -1
  17. package/dist/index-Ck8RYpuE.js +816 -0
  18. package/dist/index-CnjG7Mj4.js +5 -0
  19. package/dist/{index-lNhA3N9x.js → index-DBQsQ1ZK.js} +1 -0
  20. package/dist/index-DCZKt14c.js +5 -0
  21. package/dist/{index-BqXNMfLG.js → index-DiaPY8Db.js} +2 -2
  22. package/dist/{index-bSNw0XAf.js → index-DmdrsEvk.js} +1 -1
  23. package/dist/index-DnmCPdCI.js +168 -0
  24. package/dist/{index-Cy4DqT8R.js → index-DwDYy2lj.js} +1 -1
  25. package/dist/{index-B8jg37Wj.js → index-FQQfN6nm.js} +1 -1
  26. package/dist/{index-CZc2Gyjb.js → index-aic1yCBs.js} +1 -1
  27. package/dist/index.js +13 -13
  28. package/dist/{inline-Zj7Hqg-_.js → inline-8aNfINLF.js} +1 -1
  29. package/dist/knowledge-type-picker/index.js +1 -1
  30. package/dist/{knowledge-DaTnF2IW.js → knowledge-y2j0ijgx.js} +1 -1
  31. package/dist/media-id-b2dgniSy.js +15 -0
  32. package/dist/{media-migration-C2QLMSpd.js → media-migration-Dy_rbdkK.js} +1 -1
  33. package/dist/media-policy-BwKjZPWt.js +158 -0
  34. package/dist/{media-upload-D9MYBbLg.js → media-upload-NzWYyCm3.js} +1 -1
  35. package/dist/model-DvukseoR.js +146 -0
  36. package/dist/navigation/index.js +1 -1
  37. package/dist/rich-text/index.js +75 -73
  38. package/dist/rich-text/legacy-converter/index.js +822 -799
  39. package/dist/style.css +1 -1
  40. package/dist/switcher/index.js +1 -1
  41. package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +550 -0
  42. package/dist/types/agent-prompt-editor/agent-size-chart.d.ts +3 -0
  43. package/dist/types/agent-prompt-editor/document-adapter.d.ts +3 -0
  44. package/dist/types/agent-prompt-editor/index.d.ts +6 -0
  45. package/dist/types/agent-prompt-editor/legacy-converter-index.d.ts +2 -0
  46. package/dist/types/agent-prompt-editor/legacy-converter.d.ts +26 -0
  47. package/dist/types/agent-prompt-editor/model.d.ts +21 -0
  48. package/dist/types/agent-prompt-editor/types.d.ts +56 -0
  49. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +1 -3
  50. package/dist/types/edition-info/presets.d.ts +8 -0
  51. package/dist/types/edition-info/types.d.ts +1 -0
  52. package/dist/types/filters/FkpFilter.vue.d.ts +2 -2
  53. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +2 -2
  54. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +2 -2
  55. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +2 -2
  56. package/dist/types/index.d.ts +4 -1
  57. package/dist/types/navigation/FkpNavigation.vue.d.ts +20 -29
  58. package/dist/types/navigation/NavigationButton.vue.d.ts +26 -0
  59. package/dist/types/navigation/NavigationGroup.vue.d.ts +45 -0
  60. package/dist/types/navigation/NavigationIcon.vue.d.ts +28 -0
  61. package/dist/types/navigation/NavigationNodes.vue.d.ts +40 -0
  62. package/dist/types/navigation/index.d.ts +1 -1
  63. package/dist/types/navigation/types.d.ts +43 -5
  64. package/dist/types/navigation/use-navigation-tree.d.ts +13 -0
  65. package/dist/types/rich-text/FkpRichText.vue.d.ts +28 -8
  66. package/dist/types/rich-text/config/descriptor.d.ts +1 -0
  67. package/dist/types/rich-text/config/resolve.d.ts +1 -1
  68. package/dist/types/rich-text/index.d.ts +4 -1
  69. package/dist/types/rich-text/knowledge-document-adapter.d.ts +2 -0
  70. package/dist/types/rich-text/model/question-text.d.ts +1 -1
  71. package/dist/types/rich-text/plugins/registry.d.ts +2 -1
  72. package/dist/types/rich-text/public/types.d.ts +12 -0
  73. package/dist/types/rich-text/runtime/document-adapter.d.ts +9 -0
  74. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +9 -3
  75. package/dist/types/rich-text/runtime/media-sources.d.ts +7 -0
  76. package/dist/types/rich-text/runtime/media-upload-session.d.ts +2 -0
  77. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +3 -3
  78. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +18 -3
  79. package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +190 -0
  80. package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
  81. package/dist/types/rich-text/ui/token-renderer.d.ts +3 -0
  82. package/dist/types/rich-text/ui/useMediaHint.d.ts +6 -0
  83. package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
  84. package/dist/types-PvYB5e85.js +14 -0
  85. package/package.json +13 -5
  86. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-DYwu7oQs.js +0 -187
  87. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js +0 -4885
  88. package/dist/KnowledgeArea-BH-_uF6R.js +0 -1438
  89. package/dist/ToolForm-C6XW31Y7.js +0 -185
  90. package/dist/index-CS2xQQ8W.js +0 -168
  91. package/dist/index-D0bJAQSN.js +0 -327
  92. package/dist/index-DAZ1ulyA.js +0 -5
  93. package/dist/index-DCmHHi07.js +0 -71
  94. package/dist/index-F7lDP1lI.js +0 -5
@@ -1,14 +1,16 @@
1
- import { p as S, v as C, d as O, e as E } from "../FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js";
2
- import { _ as B, _ as G, r as H } from "../FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js";
3
- import { _ as W, a as X, e as Y } from "../FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-DYwu7oQs.js";
4
- import { f as v, c as x } from "../guard-CXpVx8UR.js";
5
- import { s as ee, a as ne } from "../guard-CXpVx8UR.js";
6
- import { a as se, b as oe } from "../media-migration-C2QLMSpd.js";
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 m(e) {
10
+ function v(e) {
9
11
  let n;
10
12
  try {
11
- const i = v(e);
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 o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
27
- for (const [i, s] of n.scenes.entries()) {
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(s)) return { ok: !1, path: c };
30
- const p = Object.keys(s).find(
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 s.sceneKey != "string" || !s.sceneKey.trim() || o.has(s.sceneKey))
36
+ if (typeof o.sceneKey != "string" || !o.sceneKey.trim() || s.has(o.sceneKey))
35
37
  return { ok: !1, path: `${c}.sceneKey` };
36
- o.add(s.sceneKey);
37
- const a = x(s.scene);
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 = s.scene;
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 N(e) {
54
+ function J(e) {
53
55
  var i;
54
56
  let n;
55
57
  try {
56
- const s = v(e);
57
- if (s !== null) return { ok: !1, path: s || "input" };
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
- (s) => !["condition", "expectedRevision", "idempotencyKey"].includes(s)
66
+ (o) => !["condition", "expectedRevision", "idempotencyKey"].includes(o)
65
67
  );
66
68
  if (t) return { ok: !1, path: t };
67
- const o = m(n.condition);
68
- if (!o.ok) return { ok: !1, path: `condition.${o.path}` };
69
- if (o.data.id === void 0 && n.expectedRevision !== null || o.data.id !== void 0 && !d(n.expectedRevision))
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
- o.data.scenes.map((s) => s.scene)
76
+ s.data.scenes.map((o) => o.scene)
75
77
  );
76
78
  if (!r.ok) {
77
- const s = (i = r.issues[0]) == null ? void 0 : i.sceneIndex;
79
+ const o = (i = r.issues[0]) == null ? void 0 : i.sceneIndex;
78
80
  return {
79
81
  ok: !1,
80
- path: s == null ? "condition.scenes" : `condition.scenes[${s}].scene`
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: o.data,
88
+ condition: s.data,
87
89
  expectedRevision: n.expectedRevision,
88
90
  idempotencyKey: n.idempotencyKey
89
91
  }
90
92
  };
91
93
  }
92
- const J = (e) => {
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 = m(e.condition);
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
- }, j = (e) => y(e) && A(e, [
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 = m(e.condition);
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) => J(n) || j(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 _(e, n) {
125
- const t = N(e);
126
+ function z(e, n) {
127
+ const t = J(e);
126
128
  if (!t.ok) return { ok: !1, path: t.path };
127
- const o = t.data.condition, r = T({ ok: !0, data: n });
129
+ const s = t.data.condition, r = T({ ok: !0, data: n });
128
130
  if (!r.ok) {
129
- const s = (() => {
131
+ const o = (() => {
130
132
  try {
131
- return y(n) && v(n) === null ? m(n.condition) : null;
133
+ return y(n) && m(n) === null ? v(n.condition) : null;
132
134
  } catch {
133
135
  return null;
134
136
  }
135
137
  })();
136
- return s != null && s.ok && o.scenes.length !== s.data.scenes.length ? { ok: !1, path: "scenes" } : { ok: !1, path: "saved" };
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 (o.id !== void 0 && o.id !== i.id)
143
+ if (s.id !== void 0 && s.id !== i.id)
142
144
  return { ok: !1, path: "id" };
143
- if (o.scenes.length !== i.scenes.length)
145
+ if (s.scenes.length !== i.scenes.length)
144
146
  return { ok: !1, path: "scenes" };
145
- for (const [s, c] of o.scenes.entries()) {
146
- const p = i.scenes[s];
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[${s}].sceneKey` };
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[${s}].scene` };
153
+ return { ok: !1, path: `scenes[${o}].scene` };
152
154
  }
153
155
  return { ok: !0 };
154
156
  }
155
- function z(e, n) {
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) || v(n) !== null)
163
+ if (!n || typeof n != "object" || Array.isArray(n) || m(n) !== null)
162
164
  throw new Error("属性值不是合法的 JSON 对象");
163
- const o = [], r = [], i = [], s = (a) => {
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
- o.push({
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(s);
194
+ ($ = a.content) == null || $.forEach(o);
193
195
  };
194
- return (p = (c = e.knowledge.doc) == null ? void 0 : c.content) == null || p.forEach(s), { knowledgeType: "reasoning", tickets: r, attributes: o, tools: i };
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 Q(e) {
197
- var o, r;
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 ((o = e.knowledge.agentRef) != null && o.invalid)
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
- W as FkpKnowledgeTypePicker,
210
- B as FkpRichText,
211
- se as assignLegacyExtensionIds,
212
- oe as assignLegacyMediaIds,
213
- Q as buildAgentInvocationContext,
214
- z as buildReasoningReferenceContext,
215
- G as default,
216
- X as emptyDoc,
217
- Y as emptyScene,
218
- P as parseConditionLoadResult,
219
- m as parseKnowledgeConditionV1,
220
- M as parseLoadedConditionResult,
221
- N as parseSaveConditionInput,
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
- H as resolveSceneConfig,
224
- ee as serializeQuestionForModel,
225
- ne as serializeQuestionTagsForModel,
225
+ V as resolveSceneConfig,
226
+ te as serializeQuestionForModel,
227
+ oe as serializeQuestionTagsForModel,
226
228
  C as validateKnowledgeScenes,
227
- _ as verifySavedConditionEcho
229
+ z as verifySavedConditionEcho
228
230
  };