@freecallai/pro 0.0.0-stage → 0.0.1

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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -2
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-DnknqQTh.js +4115 -0
  4. package/dist/KnowledgeArea-OPR7smbt.js +923 -0
  5. package/dist/ToolForm-CWpUIVTl.js +185 -0
  6. package/dist/choice-DDg5gNtS.js +29 -0
  7. package/dist/guard-BCatAeT4.js +749 -0
  8. package/dist/index-5a9mHHzg.js +41 -0
  9. package/dist/index-BsQLwz91.js +5 -0
  10. package/dist/index-CJlAseSN.js +15 -0
  11. package/dist/index-CzpY61Qj.js +6 -0
  12. package/dist/index-D8bcFtWR.js +6 -0
  13. package/dist/index-DOEijEGU.js +49 -0
  14. package/dist/index-DSgEWJGP.js +6 -0
  15. package/dist/index-DxxX09iY.js +6 -0
  16. package/dist/index-nnvfy5q0.js +31 -0
  17. package/dist/index-urNonkMH.js +6 -0
  18. package/dist/index-xAjlBylT.js +5 -0
  19. package/dist/index.js +16 -0
  20. package/dist/inline-TT_dl8Y3.js +17 -0
  21. package/dist/knowledge-BZCmalF_.js +6 -0
  22. package/dist/knowledge-DnYGicjn.js +13 -0
  23. package/dist/media-extensions-ZoxmhIhH.js +276 -0
  24. package/dist/media-migration-CGOFwdYm.js +59 -0
  25. package/dist/media-upload-Dx45yv6a.js +69 -0
  26. package/dist/operations-JgnjGx3H.js +19 -0
  27. package/dist/question-D1--acV8.js +10 -0
  28. package/dist/question-DGC6JHy5.js +6 -0
  29. package/dist/rich-text/index.js +224 -0
  30. package/dist/rich-text/legacy-converter/index.js +485 -0
  31. package/dist/selection-state-D47jhx0U.js +20 -0
  32. package/dist/state-KfOqha3d.js +16 -0
  33. package/dist/style.css +1 -0
  34. package/dist/types/index.d.ts +10 -0
  35. package/dist/types/rich-text/FkpRichText.vue.d.ts +242 -0
  36. package/dist/types/rich-text/MediaView.vue.d.ts +92 -0
  37. package/dist/types/rich-text/__demo__/conversion-fixtures.d.ts +35 -0
  38. package/dist/types/rich-text/config/catalog.d.ts +3 -0
  39. package/dist/types/rich-text/config/descriptor.d.ts +58 -0
  40. package/dist/types/rich-text/config/media-options.d.ts +6 -0
  41. package/dist/types/rich-text/config/resolve.d.ts +17 -0
  42. package/dist/types/rich-text/config/selection-options.d.ts +6 -0
  43. package/dist/types/rich-text/extensions.d.ts +6 -0
  44. package/dist/types/rich-text/index.d.ts +17 -0
  45. package/dist/types/rich-text/legacy-converter/index.d.ts +45 -0
  46. package/dist/types/rich-text/media-extensions.d.ts +4 -0
  47. package/dist/types/rich-text/media-id.d.ts +2 -0
  48. package/dist/types/rich-text/model/agent-context.d.ts +7 -0
  49. package/dist/types/rich-text/model/capability-diff.d.ts +14 -0
  50. package/dist/types/rich-text/model/condition-contract.d.ts +10 -0
  51. package/dist/types/rich-text/model/convert.d.ts +6 -0
  52. package/dist/types/rich-text/model/guard.d.ts +7 -0
  53. package/dist/types/rich-text/model/json-value.d.ts +2 -0
  54. package/dist/types/rich-text/model/media-migration.d.ts +8 -0
  55. package/dist/types/rich-text/model/node-contract.d.ts +10 -0
  56. package/dist/types/rich-text/model/node-identity.d.ts +8 -0
  57. package/dist/types/rich-text/model/persistence-contract.d.ts +25 -0
  58. package/dist/types/rich-text/model/preview.d.ts +2 -0
  59. package/dist/types/rich-text/model/question-text.d.ts +15 -0
  60. package/dist/types/rich-text/model/reasoning-context.d.ts +24 -0
  61. package/dist/types/rich-text/model/scene-snapshot.d.ts +4 -0
  62. package/dist/types/rich-text/model/validate.d.ts +19 -0
  63. package/dist/types/rich-text/model/web-url.d.ts +2 -0
  64. package/dist/types/rich-text/plugins/agentSelect/descriptor.d.ts +2 -0
  65. package/dist/types/rich-text/plugins/attribute/descriptor.d.ts +2 -0
  66. package/dist/types/rich-text/plugins/attribute/index.d.ts +2 -0
  67. package/dist/types/rich-text/plugins/block.d.ts +3 -0
  68. package/dist/types/rich-text/plugins/choice.d.ts +4 -0
  69. package/dist/types/rich-text/plugins/image/descriptor.d.ts +2 -0
  70. package/dist/types/rich-text/plugins/image/index.d.ts +2 -0
  71. package/dist/types/rich-text/plugins/inline.d.ts +3 -0
  72. package/dist/types/rich-text/plugins/media-upload.d.ts +3 -0
  73. package/dist/types/rich-text/plugins/memory/descriptor.d.ts +2 -0
  74. package/dist/types/rich-text/plugins/memory/index.d.ts +2 -0
  75. package/dist/types/rich-text/plugins/operations.d.ts +86 -0
  76. package/dist/types/rich-text/plugins/originalReply/descriptor.d.ts +2 -0
  77. package/dist/types/rich-text/plugins/originalReply/knowledge.d.ts +2 -0
  78. package/dist/types/rich-text/plugins/originalReply/question.d.ts +2 -0
  79. package/dist/types/rich-text/plugins/reasoningPolish/descriptor.d.ts +2 -0
  80. package/dist/types/rich-text/plugins/reasoningPolish/index.d.ts +3 -0
  81. package/dist/types/rich-text/plugins/reasoningTemplate/descriptor.d.ts +2 -0
  82. package/dist/types/rich-text/plugins/reasoningTemplate/index.d.ts +3 -0
  83. package/dist/types/rich-text/plugins/registry.d.ts +14 -0
  84. package/dist/types/rich-text/plugins/selection-state.d.ts +4 -0
  85. package/dist/types/rich-text/plugins/separator/descriptor.d.ts +2 -0
  86. package/dist/types/rich-text/plugins/separator/index.d.ts +2 -0
  87. package/dist/types/rich-text/plugins/state.d.ts +3 -0
  88. package/dist/types/rich-text/plugins/tagged/descriptor.d.ts +2 -0
  89. package/dist/types/rich-text/plugins/tagged/index.d.ts +2 -0
  90. package/dist/types/rich-text/plugins/ticket/descriptor.d.ts +2 -0
  91. package/dist/types/rich-text/plugins/ticket/index.d.ts +2 -0
  92. package/dist/types/rich-text/plugins/todo/descriptor.d.ts +2 -0
  93. package/dist/types/rich-text/plugins/todo/knowledge.d.ts +2 -0
  94. package/dist/types/rich-text/plugins/todo/question.d.ts +2 -0
  95. package/dist/types/rich-text/plugins/tool/descriptor.d.ts +2 -0
  96. package/dist/types/rich-text/plugins/tool/index.d.ts +2 -0
  97. package/dist/types/rich-text/plugins/tool/operations.d.ts +4 -0
  98. package/dist/types/rich-text/plugins/tool/presentation.d.ts +7 -0
  99. package/dist/types/rich-text/plugins/variable/descriptor.d.ts +2 -0
  100. package/dist/types/rich-text/plugins/variable/index.d.ts +2 -0
  101. package/dist/types/rich-text/plugins/video/descriptor.d.ts +2 -0
  102. package/dist/types/rich-text/plugins/video/index.d.ts +2 -0
  103. package/dist/types/rich-text/public/types.d.ts +588 -0
  104. package/dist/types/rich-text/runtime/action-ports.d.ts +15 -0
  105. package/dist/types/rich-text/runtime/media-state.d.ts +6 -0
  106. package/dist/types/rich-text/runtime/media-target.d.ts +8 -0
  107. package/dist/types/rich-text/runtime/media-upload-session.d.ts +59 -0
  108. package/dist/types/rich-text/runtime/operations.d.ts +48 -0
  109. package/dist/types/rich-text/runtime/option-menu-session.d.ts +28 -0
  110. package/dist/types/rich-text/runtime/option-source.d.ts +10 -0
  111. package/dist/types/rich-text/runtime/port-result.d.ts +21 -0
  112. package/dist/types/rich-text/runtime/schema-plan.d.ts +17 -0
  113. package/dist/types/rich-text/runtime/tool-form-session.d.ts +39 -0
  114. package/dist/types/rich-text/runtime/tool-params.d.ts +5 -0
  115. package/dist/types/rich-text/types.d.ts +40 -0
  116. package/dist/types/rich-text/ui/CapabilityHelp.vue.d.ts +9 -0
  117. package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +117 -0
  118. package/dist/types/rich-text/ui/ToolForm.vue.d.ts +14 -0
  119. package/dist/types/rich-text/ui/VariableOptionList.vue.d.ts +15 -0
  120. package/package.json +70 -3
@@ -0,0 +1,6 @@
1
+ import { b as t } from "./operations-JgnjGx3H.js";
2
+ import { s as o } from "./selection-state-D47jhx0U.js";
3
+ const a = t("todo", "questionAction", o);
4
+ export {
5
+ a as default
6
+ };
@@ -0,0 +1,224 @@
1
+ import { p as S, v as C, c as b, i as E } from "../FkpRichText.vue_vue_type_script_setup_true_lang-DnknqQTh.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-DnknqQTh.js";
3
+ import { f as v, b as x } from "../guard-BCatAeT4.js";
4
+ import { s as Y, a as Z } from "../guard-BCatAeT4.js";
5
+ import { a as ne, b as te } from "../media-migration-CGOFwdYm.js";
6
+ const O = (e) => !!e && typeof e == "object" && !Array.isArray(e);
7
+ function m(e) {
8
+ let n;
9
+ try {
10
+ const i = v(e);
11
+ if (i !== null) return { ok: !1, path: i || "condition" };
12
+ n = JSON.parse(JSON.stringify(e));
13
+ } catch {
14
+ return { ok: !1, path: "condition" };
15
+ }
16
+ if (!O(n)) return { ok: !1, path: "condition" };
17
+ if (n.schemaVersion !== 1) return { ok: !1, path: "schemaVersion" };
18
+ const t = Object.keys(n).find(
19
+ (i) => !["schemaVersion", "id", "scenes"].includes(i)
20
+ );
21
+ if (t) return { ok: !1, path: t };
22
+ if (n.id !== void 0 && (typeof n.id != "string" || !n.id.trim()))
23
+ return { ok: !1, path: "id" };
24
+ if (!Array.isArray(n.scenes)) return { ok: !1, path: "scenes" };
25
+ const o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
26
+ for (const [i, s] of n.scenes.entries()) {
27
+ const c = `scenes[${i}]`;
28
+ if (!O(s)) return { ok: !1, path: c };
29
+ const p = Object.keys(s).find(
30
+ (h) => !["sceneKey", "scene"].includes(h)
31
+ );
32
+ if (p) return { ok: !1, path: `${c}.${p}` };
33
+ if (typeof s.sceneKey != "string" || !s.sceneKey.trim() || o.has(s.sceneKey))
34
+ return { ok: !1, path: `${c}.sceneKey` };
35
+ 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))
41
+ return { ok: !1, path: `${c}.scene.id` };
42
+ a.add(u.id);
43
+ }
44
+ }
45
+ return { ok: !0, data: n };
46
+ }
47
+ const y = (e) => !!e && typeof e == "object" && !Array.isArray(e), d = (e) => typeof e == "string" && !!e.trim();
48
+ function A(e, n) {
49
+ return Object.keys(e).every((t) => n.includes(t));
50
+ }
51
+ function N(e) {
52
+ var i;
53
+ let n;
54
+ try {
55
+ const s = v(e);
56
+ if (s !== null) return { ok: !1, path: s || "input" };
57
+ n = JSON.parse(JSON.stringify(e));
58
+ } catch {
59
+ return { ok: !1, path: "input" };
60
+ }
61
+ if (!y(n)) return { ok: !1, path: "input" };
62
+ const t = Object.keys(n).find(
63
+ (s) => !["condition", "expectedRevision", "idempotencyKey"].includes(s)
64
+ );
65
+ if (t) return { ok: !1, path: t };
66
+ const o = m(n.condition);
67
+ if (!o.ok) return { ok: !1, path: `condition.${o.path}` };
68
+ if (o.data.id === void 0 && n.expectedRevision !== null || o.data.id !== void 0 && !d(n.expectedRevision))
69
+ return { ok: !1, path: "expectedRevision" };
70
+ if (!d(n.idempotencyKey))
71
+ return { ok: !1, path: "idempotencyKey" };
72
+ const a = C(
73
+ o.data.scenes.map((s) => s.scene)
74
+ );
75
+ if (!a.ok) {
76
+ const s = (i = a.issues[0]) == null ? void 0 : i.sceneIndex;
77
+ return {
78
+ ok: !1,
79
+ path: s == null ? "condition.scenes" : `condition.scenes[${s}].scene`
80
+ };
81
+ }
82
+ return {
83
+ ok: !0,
84
+ data: {
85
+ condition: o.data,
86
+ expectedRevision: n.expectedRevision,
87
+ idempotencyKey: n.idempotencyKey
88
+ }
89
+ };
90
+ }
91
+ const J = (e) => {
92
+ if (!y(e) || !A(e, ["condition", "revision", "migrationIssues"]) || !d(e.revision) || !Array.isArray(e.migrationIssues) || !e.migrationIssues.every(
93
+ (t) => E(t) && t.source === "migration" && t.severity !== "error" && d(t.path)
94
+ ))
95
+ return !1;
96
+ const n = m(e.condition);
97
+ return n.ok && d(n.data.id) && n.data.scenes.length > 0 && n.data.scenes.every((t) => d(t.scene.id));
98
+ }, j = (e) => y(e) && A(e, [
99
+ "kind",
100
+ "conditionId",
101
+ "rawCondition",
102
+ "migrationIssues"
103
+ ]) && e.kind === "legacyReadonly" && d(e.conditionId) && y(e.rawCondition) && Array.isArray(e.migrationIssues) && e.migrationIssues.length > 0 && e.migrationIssues.every(
104
+ (n) => E(n) && n.source === "migration" && d(n.path)
105
+ ) && e.migrationIssues.some((n) => n.severity === "error"), L = (e) => {
106
+ if (!y(e) || !A(e, ["condition", "revision"]) || !d(e.revision))
107
+ return !1;
108
+ const n = m(e.condition);
109
+ 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;
110
+ };
111
+ function M(e) {
112
+ return S(e, J);
113
+ }
114
+ function z(e) {
115
+ return S(
116
+ e,
117
+ (n) => J(n) || j(n)
118
+ );
119
+ }
120
+ function T(e) {
121
+ return S(e, L);
122
+ }
123
+ function P(e, n) {
124
+ const t = N(e);
125
+ 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) {
128
+ const s = (() => {
129
+ try {
130
+ return y(n) && v(n) === null ? m(n.condition) : null;
131
+ } catch {
132
+ return null;
133
+ }
134
+ })();
135
+ return s != null && s.ok && o.scenes.length !== s.data.scenes.length ? { ok: !1, path: "scenes" } : { ok: !1, path: "saved" };
136
+ }
137
+ const i = a.data.condition;
138
+ if (t.data.expectedRevision !== null && a.data.revision === t.data.expectedRevision)
139
+ return { ok: !1, path: "revision" };
140
+ if (o.id !== void 0 && o.id !== i.id)
141
+ return { ok: !1, path: "id" };
142
+ if (o.scenes.length !== i.scenes.length)
143
+ return { ok: !1, path: "scenes" };
144
+ for (const [s, c] of o.scenes.entries()) {
145
+ const p = i.scenes[s];
146
+ if (c.sceneKey !== p.sceneKey)
147
+ 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))
150
+ return { ok: !1, path: `scenes[${s}].scene` };
151
+ }
152
+ return { ok: !0 };
153
+ }
154
+ function Q(e, n) {
155
+ var c, p;
156
+ if (e.type !== "reasoning")
157
+ throw new Error("只有推理知识可以构造推理引用上下文");
158
+ const t = x(e);
159
+ if (t) throw new Error(`知识内容无效:${t}`);
160
+ if (!n || typeof n != "object" || Array.isArray(n) || v(n) !== null)
161
+ 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())
167
+ throw new Error(`引用缺少稳定节点 ID:${f}`);
168
+ if (l === "ticket")
169
+ a.push({ nodeId: k, key: f, label: w });
170
+ else if (l === "attribute") {
171
+ if (!Object.prototype.hasOwnProperty.call(n, f))
172
+ throw new Error(`缺少属性值:${f}`);
173
+ o.push({
174
+ nodeId: k,
175
+ key: f,
176
+ label: w,
177
+ value: JSON.parse(JSON.stringify(n[f]))
178
+ });
179
+ } else if (l === "tool") {
180
+ const g = (I = r.attrs) == null ? void 0 : I.params;
181
+ if (!g || typeof g != "object" || Array.isArray(g))
182
+ throw new Error(`工具缺少配置参数:${f}`);
183
+ i.push({
184
+ nodeId: k,
185
+ key: f,
186
+ label: w,
187
+ params: JSON.parse(JSON.stringify(g))
188
+ });
189
+ }
190
+ }
191
+ ($ = r.content) == null || $.forEach(s);
192
+ };
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
+ }
195
+ function _(e) {
196
+ var o;
197
+ if (e.type !== "agent")
198
+ throw new Error("只有Agent知识可以构造Agent调用上下文");
199
+ const n = x(e);
200
+ if (n) throw new Error(`知识内容无效:${n}`);
201
+ const t = (o = e.knowledge.agentRef) == null ? void 0 : o.id;
202
+ if (!(t != null && t.trim())) throw new Error("请选择Agent");
203
+ return { knowledgeType: "agent", agentId: t };
204
+ }
205
+ export {
206
+ B as FkpRichText,
207
+ ne as assignLegacyExtensionIds,
208
+ te as assignLegacyMediaIds,
209
+ _ as buildAgentInvocationContext,
210
+ Q as buildReasoningReferenceContext,
211
+ G as default,
212
+ H as emptyDoc,
213
+ V as emptyScene,
214
+ z as parseConditionLoadResult,
215
+ m as parseKnowledgeConditionV1,
216
+ M as parseLoadedConditionResult,
217
+ N as parseSaveConditionInput,
218
+ T as parseSavedConditionResult,
219
+ W as resolveSceneConfig,
220
+ Y as serializeQuestionForModel,
221
+ Z as serializeQuestionTagsForModel,
222
+ C as validateKnowledgeScenes,
223
+ P as verifySavedConditionEcho
224
+ };