@freecallai/pro 0.0.2 → 0.0.3

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 (116) hide show
  1. package/README.md +23 -17
  2. package/dist/FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js +187 -0
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js +4864 -0
  4. package/dist/KnowledgeArea-_rsydhnt.js +1438 -0
  5. package/dist/{ToolForm-BSJxTJ7U.js → ToolForm-Czg67cDT.js} +1 -1
  6. package/dist/{choice-DDg5gNtS.js → choice-Bt2xhoN_.js} +1 -1
  7. package/dist/edition-info/index.js +4 -0
  8. package/dist/filters/index.js +7 -0
  9. package/dist/guard-B7U3S4F1.js +1163 -0
  10. package/dist/{index-D8bcFtWR.js → index-9NM1SHoR.js} +1 -1
  11. package/dist/index-B4-2_sJI.js +10 -0
  12. package/dist/{index-BnFTr8u9.js → index-BBv72oZe.js} +10 -10
  13. package/dist/index-BF6MRSMb.js +6 -0
  14. package/dist/index-BQrYBmwR.js +5 -0
  15. package/dist/index-CS2xQQ8W.js +168 -0
  16. package/dist/index-D0bJAQSN.js +327 -0
  17. package/dist/index-D9yqpH_4.js +57 -0
  18. package/dist/index-DCmHHi07.js +71 -0
  19. package/dist/index-DYeJRJY1.js +6 -0
  20. package/dist/{index-CJlAseSN.js → index-DnaEbb6l.js} +1 -1
  21. package/dist/{index-DSgEWJGP.js → index-Dy2Gy3bL.js} +1 -1
  22. package/dist/index-lNhA3N9x.js +379 -0
  23. package/dist/{index-CG2j9Znw.js → index-sjDmbR5o.js} +1 -1
  24. package/dist/index-trxE5T0w.js +6 -0
  25. package/dist/index-uCVrA6xK.js +5 -0
  26. package/dist/index.js +36 -11
  27. package/dist/inline-KPGqYMIR.js +19 -0
  28. package/dist/knowledge-CupkY2rK.js +6 -0
  29. package/dist/{knowledge-DnYGicjn.js → knowledge-DzwXQR-q.js} +1 -1
  30. package/dist/knowledge-type-picker/index.js +5 -0
  31. package/dist/media-extensions-DhRlLKYM.js +321 -0
  32. package/dist/{media-migration-Cj-3xrxd.js → media-migration-CbMT2wS0.js} +1 -1
  33. package/dist/{media-upload-D7DpMJYx.js → media-upload-P9WeUHHr.js} +1 -1
  34. package/dist/navigation/index.js +4 -0
  35. package/dist/operations-D8pn-_iW.js +20 -0
  36. package/dist/{question-DGC6JHy5.js → question-C7akkjHn.js} +1 -1
  37. package/dist/{question-D1--acV8.js → question-DXZ8R-34.js} +1 -1
  38. package/dist/rich-text/index.js +57 -53
  39. package/dist/rich-text/legacy-converter/index.js +1129 -643
  40. package/dist/style.css +1 -1
  41. package/dist/switcher/index.js +4 -0
  42. package/dist/types/edition-info/FkpEditionInfo.vue.d.ts +5 -0
  43. package/dist/types/edition-info/index.d.ts +2 -0
  44. package/dist/types/edition-info/types.d.ts +5 -0
  45. package/dist/types/filters/FkpFilter.vue.d.ts +20 -0
  46. package/dist/types/filters/FkpFilterDateRange.vue.d.ts +13 -0
  47. package/dist/types/filters/FkpFilterPeriod.vue.d.ts +17 -0
  48. package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +44 -0
  49. package/dist/types/filters/index.d.ts +5 -0
  50. package/dist/types/filters/selection.d.ts +5 -0
  51. package/dist/types/filters/types.d.ts +30 -0
  52. package/dist/types/index.d.ts +7 -1
  53. package/dist/types/knowledge-type-picker/index.d.ts +3 -0
  54. package/dist/types/navigation/FkpNavigation.vue.d.ts +51 -0
  55. package/dist/types/navigation/index.d.ts +2 -0
  56. package/dist/types/navigation/types.d.ts +15 -0
  57. package/dist/types/rich-text/FkpRichText.vue.d.ts +18 -5
  58. package/dist/types/rich-text/__demo__/conversion-fixtures.d.ts +2 -2
  59. package/dist/types/rich-text/__demo__/reasoning-template-examples.d.ts +2 -3
  60. package/dist/types/rich-text/config/descriptor.d.ts +25 -2
  61. package/dist/types/rich-text/config/resolve.d.ts +2 -0
  62. package/dist/types/rich-text/index.d.ts +3 -1
  63. package/dist/types/rich-text/legacy-converter/agent-prompt-preview.d.ts +2 -0
  64. package/dist/types/rich-text/legacy-converter/business-attribute.d.ts +9 -29
  65. package/dist/types/rich-text/legacy-converter/index.d.ts +8 -1
  66. package/dist/types/rich-text/legacy-converter/tool-contract.d.ts +1 -5
  67. package/dist/types/rich-text/model/guard.d.ts +2 -1
  68. package/dist/types/rich-text/model/node-contract.d.ts +3 -5
  69. package/dist/types/rich-text/model/node-identity.d.ts +7 -1
  70. package/dist/types/rich-text/model/question-text.d.ts +2 -4
  71. package/dist/types/rich-text/plugins/attribute/token.d.ts +9 -0
  72. package/dist/types/rich-text/plugins/operations.d.ts +9 -0
  73. package/dist/types/rich-text/plugins/reasoningTemplate/defaults.d.ts +14 -0
  74. package/dist/types/rich-text/plugins/reasoningTemplate/examples.d.ts +9 -0
  75. package/dist/types/rich-text/plugins/separator/token.d.ts +2 -0
  76. package/dist/types/rich-text/plugins/tableKnowledge/descriptor.d.ts +2 -0
  77. package/dist/types/rich-text/plugins/tableKnowledge/index.d.ts +2 -0
  78. package/dist/types/rich-text/plugins/tableKnowledge/token.d.ts +9 -0
  79. package/dist/types/rich-text/plugins/ticket/protocol.d.ts +8 -0
  80. package/dist/types/rich-text/plugins/ticket/token.d.ts +9 -0
  81. package/dist/types/rich-text/plugins/todo/token.d.ts +3 -0
  82. package/dist/types/rich-text/plugins/token-catalog.d.ts +46 -0
  83. package/dist/types/rich-text/plugins/token-definition.d.ts +24 -0
  84. package/dist/types/rich-text/plugins/tool/presentation.d.ts +2 -1
  85. package/dist/types/rich-text/plugins/tool/protocol.d.ts +5 -0
  86. package/dist/types/rich-text/plugins/tool/rules.d.ts +1 -0
  87. package/dist/types/rich-text/plugins/tool/token.d.ts +2 -0
  88. package/dist/types/rich-text/plugins/variable/token.d.ts +2 -0
  89. package/dist/types/rich-text/public/types.d.ts +63 -6
  90. package/dist/types/rich-text/runtime/action-ports.d.ts +6 -1
  91. package/dist/types/rich-text/runtime/knowledge-clipboard.d.ts +16 -0
  92. package/dist/types/rich-text/runtime/media-target.d.ts +2 -0
  93. package/dist/types/rich-text/runtime/media-upload-session.d.ts +1 -1
  94. package/dist/types/rich-text/runtime/schema-plan.d.ts +1 -0
  95. package/dist/types/rich-text/types.d.ts +3 -40
  96. package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +38 -0
  97. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +7 -3
  98. package/dist/types/rich-text/ui/knowledge-type-picker-types.d.ts +14 -0
  99. package/dist/types/rich-text/ui/token-renderer.d.ts +5 -0
  100. package/dist/types/switcher/FkpSwitcher.vue.d.ts +52 -0
  101. package/dist/types/switcher/index.d.ts +2 -0
  102. package/dist/types/switcher/types.d.ts +7 -0
  103. package/package.json +26 -6
  104. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js +0 -4416
  105. package/dist/KnowledgeArea-BkRVWFrg.js +0 -1224
  106. package/dist/index-BVHYCLDv.js +0 -5
  107. package/dist/index-CzpY61Qj.js +0 -6
  108. package/dist/index-DxxX09iY.js +0 -6
  109. package/dist/index-kOPLn4DD.js +0 -5
  110. package/dist/index-nnvfy5q0.js +0 -31
  111. package/dist/index-urNonkMH.js +0 -6
  112. package/dist/inline-TT_dl8Y3.js +0 -17
  113. package/dist/knowledge-BZCmalF_.js +0 -6
  114. package/dist/media-extensions-ZoxmhIhH.js +0 -276
  115. package/dist/operations-JgnjGx3H.js +0 -19
  116. package/dist/rules-CC6NoltX.js +0 -811
@@ -1,9 +1,10 @@
1
- import { p as S, v as C, c as b, i as E } from "../FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js";
2
- import { _ as B, _ as G, a as H, e as V, r as W } from "../FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js";
3
- import { f as v, b as x } from "../rules-CC6NoltX.js";
4
- import { s as Y, a as Z } from "../rules-CC6NoltX.js";
5
- import { a as ne, b as te } from "../media-migration-Cj-3xrxd.js";
6
- const O = (e) => !!e && typeof e == "object" && !Array.isArray(e);
1
+ import { p as S, v as C, d as O, e as E } from "../FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js";
2
+ import { _ as B, _ as G, r as H } from "../FkpRichText.vue_vue_type_script_setup_true_lang-CaHRIHab.js";
3
+ import { _ as W, a as X, e as Y } from "../FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-xR8ZhhdJ.js";
4
+ import { f as v, c as x } from "../guard-B7U3S4F1.js";
5
+ import { s as ee, a as ne } from "../guard-B7U3S4F1.js";
6
+ import { a as se, b as oe } from "../media-migration-CbMT2wS0.js";
7
+ const b = (e) => !!e && typeof e == "object" && !Array.isArray(e);
7
8
  function m(e) {
8
9
  let n;
9
10
  try {
@@ -13,7 +14,7 @@ function m(e) {
13
14
  } catch {
14
15
  return { ok: !1, path: "condition" };
15
16
  }
16
- if (!O(n)) return { ok: !1, path: "condition" };
17
+ if (!b(n)) return { ok: !1, path: "condition" };
17
18
  if (n.schemaVersion !== 1) return { ok: !1, path: "schemaVersion" };
18
19
  const t = Object.keys(n).find(
19
20
  (i) => !["schemaVersion", "id", "scenes"].includes(i)
@@ -22,10 +23,10 @@ function m(e) {
22
23
  if (n.id !== void 0 && (typeof n.id != "string" || !n.id.trim()))
23
24
  return { ok: !1, path: "id" };
24
25
  if (!Array.isArray(n.scenes)) return { ok: !1, path: "scenes" };
25
- const o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
26
+ const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
26
27
  for (const [i, s] of n.scenes.entries()) {
27
28
  const c = `scenes[${i}]`;
28
- if (!O(s)) return { ok: !1, path: c };
29
+ if (!b(s)) return { ok: !1, path: c };
29
30
  const p = Object.keys(s).find(
30
31
  (h) => !["sceneKey", "scene"].includes(h)
31
32
  );
@@ -33,13 +34,13 @@ function m(e) {
33
34
  if (typeof s.sceneKey != "string" || !s.sceneKey.trim() || o.has(s.sceneKey))
34
35
  return { ok: !1, path: `${c}.sceneKey` };
35
36
  o.add(s.sceneKey);
36
- const r = x(s.scene);
37
- if (r) return { ok: !1, path: `${c}.scene.${r}` };
38
- const u = s.scene;
39
- if (u.id !== void 0) {
40
- if (!u.id.trim() || a.has(u.id))
37
+ const a = x(s.scene);
38
+ if (a) return { ok: !1, path: `${c}.scene.${a}` };
39
+ const l = s.scene;
40
+ if (l.id !== void 0) {
41
+ if (!l.id.trim() || r.has(l.id))
41
42
  return { ok: !1, path: `${c}.scene.id` };
42
- a.add(u.id);
43
+ r.add(l.id);
43
44
  }
44
45
  }
45
46
  return { ok: !0, data: n };
@@ -69,11 +70,11 @@ function N(e) {
69
70
  return { ok: !1, path: "expectedRevision" };
70
71
  if (!d(n.idempotencyKey))
71
72
  return { ok: !1, path: "idempotencyKey" };
72
- const a = C(
73
+ const r = C(
73
74
  o.data.scenes.map((s) => s.scene)
74
75
  );
75
- if (!a.ok) {
76
- const s = (i = a.issues[0]) == null ? void 0 : i.sceneIndex;
76
+ if (!r.ok) {
77
+ const s = (i = r.issues[0]) == null ? void 0 : i.sceneIndex;
77
78
  return {
78
79
  ok: !1,
79
80
  path: s == null ? "condition.scenes" : `condition.scenes[${s}].scene`
@@ -111,7 +112,7 @@ const J = (e) => {
111
112
  function M(e) {
112
113
  return S(e, J);
113
114
  }
114
- function z(e) {
115
+ function P(e) {
115
116
  return S(
116
117
  e,
117
118
  (n) => J(n) || j(n)
@@ -120,11 +121,11 @@ function z(e) {
120
121
  function T(e) {
121
122
  return S(e, L);
122
123
  }
123
- function P(e, n) {
124
+ function _(e, n) {
124
125
  const t = N(e);
125
126
  if (!t.ok) return { ok: !1, path: t.path };
126
- const o = t.data.condition, a = T({ ok: !0, data: n });
127
- if (!a.ok) {
127
+ const o = t.data.condition, r = T({ ok: !0, data: n });
128
+ if (!r.ok) {
128
129
  const s = (() => {
129
130
  try {
130
131
  return y(n) && v(n) === null ? m(n.condition) : null;
@@ -134,8 +135,8 @@ function P(e, n) {
134
135
  })();
135
136
  return s != null && s.ok && o.scenes.length !== s.data.scenes.length ? { ok: !1, path: "scenes" } : { ok: !1, path: "saved" };
136
137
  }
137
- const i = a.data.condition;
138
- if (t.data.expectedRevision !== null && a.data.revision === t.data.expectedRevision)
138
+ const i = r.data.condition;
139
+ if (t.data.expectedRevision !== null && r.data.revision === t.data.expectedRevision)
139
140
  return { ok: !1, path: "revision" };
140
141
  if (o.id !== void 0 && o.id !== i.id)
141
142
  return { ok: !1, path: "id" };
@@ -145,13 +146,13 @@ function P(e, n) {
145
146
  const p = i.scenes[s];
146
147
  if (c.sceneKey !== p.sceneKey)
147
148
  return { ok: !1, path: `scenes[${s}].sceneKey` };
148
- const r = { ...p.scene };
149
- if (c.scene.id === void 0 && delete r.id, b(c.scene) !== b(r))
149
+ const a = { ...p.scene };
150
+ if (c.scene.id === void 0 && delete a.id, O(c.scene) !== O(a))
150
151
  return { ok: !1, path: `scenes[${s}].scene` };
151
152
  }
152
153
  return { ok: !0 };
153
154
  }
154
- function Q(e, n) {
155
+ function z(e, n) {
155
156
  var c, p;
156
157
  if (e.type !== "reasoning")
157
158
  throw new Error("只有推理知识可以构造推理引用上下文");
@@ -159,15 +160,15 @@ function Q(e, n) {
159
160
  if (t) throw new Error(`知识内容无效:${t}`);
160
161
  if (!n || typeof n != "object" || Array.isArray(n) || v(n) !== null)
161
162
  throw new Error("属性值不是合法的 JSON 对象");
162
- const o = [], a = [], i = [], s = (r) => {
163
- var u, h, K, R, I, $;
164
- if (r.type === "businessToken") {
165
- const l = String((u = r.attrs) == null ? void 0 : u.kind), f = String((h = r.attrs) == null ? void 0 : h.key), k = String(((K = r.attrs) == null ? void 0 : K.id) || ""), w = String(((R = r.attrs) == null ? void 0 : R.label) || f);
166
- if ((l === "ticket" || l === "attribute" || l === "tool") && !k.trim())
163
+ const o = [], r = [], i = [], s = (a) => {
164
+ var l, h, K, R, I, $;
165
+ if (a.type === "businessToken") {
166
+ 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);
167
+ if ((u === "ticket" || u === "attribute" || u === "tool") && !k.trim())
167
168
  throw new Error(`引用缺少稳定节点 ID:${f}`);
168
- if (l === "ticket")
169
- a.push({ nodeId: k, key: f, label: w });
170
- else if (l === "attribute") {
169
+ if (u === "ticket")
170
+ r.push({ nodeId: k, key: f, label: w });
171
+ else if (u === "attribute") {
171
172
  if (!Object.prototype.hasOwnProperty.call(n, f))
172
173
  throw new Error(`缺少属性值:${f}`);
173
174
  o.push({
@@ -176,8 +177,8 @@ function Q(e, n) {
176
177
  label: w,
177
178
  value: JSON.parse(JSON.stringify(n[f]))
178
179
  });
179
- } else if (l === "tool") {
180
- const g = (I = r.attrs) == null ? void 0 : I.params;
180
+ } else if (u === "tool") {
181
+ const g = (I = a.attrs) == null ? void 0 : I.params;
181
182
  if (!g || typeof g != "object" || Array.isArray(g))
182
183
  throw new Error(`工具缺少配置参数:${f}`);
183
184
  i.push({
@@ -188,37 +189,40 @@ function Q(e, n) {
188
189
  });
189
190
  }
190
191
  }
191
- ($ = r.content) == null || $.forEach(s);
192
+ ($ = a.content) == null || $.forEach(s);
192
193
  };
193
- return (p = (c = e.knowledge.doc) == null ? void 0 : c.content) == null || p.forEach(s), { knowledgeType: "reasoning", tickets: a, attributes: o, tools: i };
194
+ return (p = (c = e.knowledge.doc) == null ? void 0 : c.content) == null || p.forEach(s), { knowledgeType: "reasoning", tickets: r, attributes: o, tools: i };
194
195
  }
195
- function _(e) {
196
- var o;
196
+ function Q(e) {
197
+ var o, r;
197
198
  if (e.type !== "agent")
198
199
  throw new Error("只有Agent知识可以构造Agent调用上下文");
199
200
  const n = x(e);
200
201
  if (n) throw new Error(`知识内容无效:${n}`);
201
- const t = (o = e.knowledge.agentRef) == null ? void 0 : o.id;
202
+ if ((o = e.knowledge.agentRef) != null && o.invalid)
203
+ throw new Error("Agent 已失效,请重新选择");
204
+ const t = (r = e.knowledge.agentRef) == null ? void 0 : r.id;
202
205
  if (!(t != null && t.trim())) throw new Error("请选择Agent");
203
206
  return { knowledgeType: "agent", agentId: t };
204
207
  }
205
208
  export {
209
+ W as FkpKnowledgeTypePicker,
206
210
  B as FkpRichText,
207
- ne as assignLegacyExtensionIds,
208
- te as assignLegacyMediaIds,
209
- _ as buildAgentInvocationContext,
210
- Q as buildReasoningReferenceContext,
211
+ se as assignLegacyExtensionIds,
212
+ oe as assignLegacyMediaIds,
213
+ Q as buildAgentInvocationContext,
214
+ z as buildReasoningReferenceContext,
211
215
  G as default,
212
- H as emptyDoc,
213
- V as emptyScene,
214
- z as parseConditionLoadResult,
216
+ X as emptyDoc,
217
+ Y as emptyScene,
218
+ P as parseConditionLoadResult,
215
219
  m as parseKnowledgeConditionV1,
216
220
  M as parseLoadedConditionResult,
217
221
  N as parseSaveConditionInput,
218
222
  T as parseSavedConditionResult,
219
- W as resolveSceneConfig,
220
- Y as serializeQuestionForModel,
221
- Z as serializeQuestionTagsForModel,
223
+ H as resolveSceneConfig,
224
+ ee as serializeQuestionForModel,
225
+ ne as serializeQuestionTagsForModel,
222
226
  C as validateKnowledgeScenes,
223
- P as verifySavedConditionEcho
227
+ _ as verifySavedConditionEcho
224
228
  };