@freecallai/pro 0.0.2 → 0.0.4

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-DYwu7oQs.js +187 -0
  3. package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js +4885 -0
  4. package/dist/KnowledgeArea-BH-_uF6R.js +1438 -0
  5. package/dist/{ToolForm-BSJxTJ7U.js → ToolForm-C6XW31Y7.js} +1 -1
  6. package/dist/{choice-DDg5gNtS.js → choice-C1SxozNA.js} +1 -1
  7. package/dist/edition-info/index.js +4 -0
  8. package/dist/filters/index.js +7 -0
  9. package/dist/guard-CXpVx8UR.js +1168 -0
  10. package/dist/{index-D8bcFtWR.js → index-9NM1SHoR.js} +1 -1
  11. package/dist/{index-BnFTr8u9.js → index-B8jg37Wj.js} +10 -10
  12. package/dist/index-BqXNMfLG.js +57 -0
  13. package/dist/index-CM0MN2DT.js +6 -0
  14. package/dist/index-CS2xQQ8W.js +168 -0
  15. package/dist/index-CZc2Gyjb.js +6 -0
  16. package/dist/index-Cy4DqT8R.js +10 -0
  17. package/dist/index-D0bJAQSN.js +327 -0
  18. package/dist/index-DAZ1ulyA.js +5 -0
  19. package/dist/index-DCmHHi07.js +71 -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-F7lDP1lI.js +5 -0
  23. package/dist/{index-CG2j9Znw.js → index-UjI4WA5F.js} +1 -1
  24. package/dist/index-bSNw0XAf.js +6 -0
  25. package/dist/index-lNhA3N9x.js +379 -0
  26. package/dist/index.js +36 -11
  27. package/dist/inline-Zj7Hqg-_.js +19 -0
  28. package/dist/knowledge-DaTnF2IW.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-wlcCEdtg.js +324 -0
  32. package/dist/{media-migration-Cj-3xrxd.js → media-migration-C2QLMSpd.js} +1 -1
  33. package/dist/{media-upload-D7DpMJYx.js → media-upload-D9MYBbLg.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 +1250 -666
  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 +27 -7
  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
@@ -0,0 +1,19 @@
1
+ import { g as s } from "./guard-CXpVx8UR.js";
2
+ const t = {
3
+ execute(a, o) {
4
+ const e = s(a);
5
+ return o.option ? [
6
+ {
7
+ kind: "insertOwnToken",
8
+ capabilityId: a,
9
+ key: o.option.id,
10
+ label: o.option.label,
11
+ ...e != null && e.requiresInsertToken && o.option.token ? { token: o.option.token } : {},
12
+ ...e != null && e.allowsParams && o.option.params ? { params: o.option.params } : {}
13
+ }
14
+ ] : [];
15
+ }
16
+ };
17
+ export {
18
+ t as m
19
+ };
@@ -0,0 +1,6 @@
1
+ import { b as o } from "./operations-D8pn-_iW.js";
2
+ import { c as e } from "./choice-C1SxozNA.js";
3
+ const a = o("todo", "knowledgeInline", e);
4
+ export {
5
+ a as default
6
+ };
@@ -1,4 +1,4 @@
1
- import { b as l } from "./operations-JgnjGx3H.js";
1
+ import { b as l } from "./operations-D8pn-_iW.js";
2
2
  const o = {
3
3
  execute(e) {
4
4
  return e === "originalReply" ? [{ kind: "insertOwnBlock", capabilityId: e, block: e }] : [];
@@ -0,0 +1,5 @@
1
+ import { _ as o, _ as p } from "../FkpKnowledgeTypePicker.vue_vue_type_script_setup_true_lang-DYwu7oQs.js";
2
+ export {
3
+ o as FkpKnowledgeTypePicker,
4
+ p as default
5
+ };
@@ -0,0 +1,324 @@
1
+ import { Node as I, mergeAttributes as D } from "@tiptap/core";
2
+ import { nodeViewProps as L, NodeViewWrapper as T, VueNodeViewRenderer as q } from "@tiptap/vue-3";
3
+ import { defineComponent as F, ref as C, watch as $, onMounted as H, onBeforeUnmount as P, openBlock as i, createBlock as p, unref as s, normalizeClass as B, withCtx as l, createElementVNode as z, createElementBlock as f, createVNode as u, createTextVNode as k, toDisplayString as E, createCommentVNode as n, withModifiers as N, Fragment as U } from "vue";
4
+ import { Button as c, ImagePreview as O, Modal as R } from "@freecallai/ui";
5
+ import { closeHistory as W } from "@tiptap/pm/history";
6
+ import b from "@freecallai/icons";
7
+ import { IconDragDotVertical as j } from "@freecallai/ui/es/icon/index.js";
8
+ const G = { class: "fk-media-surface" }, J = {
9
+ key: 0,
10
+ class: "fk-media-failed"
11
+ }, K = ["draggable", "src", "alt"], Q = ["draggable", "src", "poster", "controls"], X = {
12
+ key: 4,
13
+ class: "fk-media-actions"
14
+ }, Y = {
15
+ key: 0,
16
+ "data-drag-handle": "",
17
+ class: "fk-media-handle",
18
+ title: "拖动调整位置"
19
+ }, Z = {
20
+ key: 5,
21
+ class: "fk-upload-state"
22
+ }, h = { class: "fk-media-caption" }, x = {
23
+ key: 1,
24
+ class: "fk-error"
25
+ }, _ = ["src"], ee = /* @__PURE__ */ F({
26
+ __name: "MediaView",
27
+ props: L,
28
+ setup(r) {
29
+ const a = r, o = a.extension.options.sceneStyle === !0, d = C(!1), g = C(!1), y = C(null), v = C(a.editor.isEditable);
30
+ function M(t) {
31
+ const { detail: e } = t;
32
+ (e == null ? void 0 : e.id) === a.node.attrs.id && a.node.attrs.status === "uploading" && typeof e.percent == "number" && Number.isFinite(e.percent) && (y.value = e.percent);
33
+ }
34
+ const w = () => {
35
+ v.value = a.editor.isEditable;
36
+ };
37
+ a.editor.on("update", w), a.editor.on("transaction", w);
38
+ function V() {
39
+ a.editor.isEditable && (a.editor.view.dispatch(W(a.editor.state.tr)), a.deleteNode());
40
+ }
41
+ function A() {
42
+ a.editor.view.dom.dispatchEvent(
43
+ new CustomEvent("fkp-media-retry", {
44
+ bubbles: !0,
45
+ detail: { id: a.node.attrs.id }
46
+ })
47
+ );
48
+ }
49
+ function S() {
50
+ !o || g.value || !["image", "video"].includes(a.node.attrs.kind) || a.node.attrs.status !== "ready" || (d.value = !0);
51
+ }
52
+ return $(
53
+ () => a.node.attrs.src,
54
+ () => {
55
+ g.value = !1;
56
+ }
57
+ ), $(
58
+ () => a.node.attrs.status,
59
+ (t) => {
60
+ t !== "uploading" && (y.value = null);
61
+ }
62
+ ), H(() => {
63
+ a.editor.view.dom.addEventListener("fkp-media-progress", M);
64
+ }), P(() => {
65
+ a.editor.view.dom.removeEventListener("fkp-media-progress", M), a.editor.off("update", w), a.editor.off("transaction", w);
66
+ }), (t, e) => (i(), p(s(T), {
67
+ class: B(["fk-media", {
68
+ "is-selected": t.selected,
69
+ "is-scene-media": o,
70
+ "is-video": t.node.attrs.kind === "video",
71
+ "is-error": t.node.attrs.status === "error"
72
+ }]),
73
+ "data-media-id": t.node.attrs.id,
74
+ "data-drag-handle": o && v.value ? "" : void 0,
75
+ contenteditable: "false",
76
+ onClick: S
77
+ }, {
78
+ default: l(() => [
79
+ z("div", G, [
80
+ g.value ? (i(), f("div", J, [
81
+ u(s(b), {
82
+ name: "fail",
83
+ size: 24
84
+ }),
85
+ e[7] || (e[7] = k("媒体无法加载"))
86
+ ])) : t.node.attrs.kind === "image" ? (i(), f("img", {
87
+ key: 1,
88
+ draggable: o ? !1 : void 0,
89
+ src: t.node.attrs.src,
90
+ alt: t.node.attrs.name,
91
+ onError: e[0] || (e[0] = (m) => g.value = !0),
92
+ onDblclick: e[1] || (e[1] = (m) => d.value = !0)
93
+ }, null, 40, K)) : (i(), f("video", {
94
+ key: 2,
95
+ draggable: o ? !1 : void 0,
96
+ src: t.node.attrs.src,
97
+ poster: t.node.attrs.poster || void 0,
98
+ controls: !o,
99
+ muted: o,
100
+ playsinline: "",
101
+ preload: "metadata",
102
+ onError: e[2] || (e[2] = (m) => g.value = !0)
103
+ }, null, 40, Q)),
104
+ o && !g.value && t.node.attrs.status === "ready" && ["image", "video"].includes(t.node.attrs.kind) ? (i(), p(s(c), {
105
+ key: 3,
106
+ class: B(["fk-media-play", { "is-image-preview": t.node.attrs.kind === "image" }]),
107
+ type: "text",
108
+ "aria-label": t.node.attrs.kind === "image" ? "查看大图" : "播放视频",
109
+ style: { "pointer-events": "none" },
110
+ onClick: e[3] || (e[3] = (m) => d.value = !0)
111
+ }, {
112
+ default: l(() => [
113
+ u(s(b), {
114
+ name: "visible",
115
+ size: 14
116
+ }),
117
+ k(E(t.node.attrs.kind === "image" ? "点击查看大图" : "点击播放视频"), 1)
118
+ ]),
119
+ _: 1
120
+ }, 8, ["class", "aria-label"])) : n("", !0),
121
+ o ? n("", !0) : (i(), f("div", X, [
122
+ v.value ? (i(), f("span", Y, [
123
+ u(s(j), { size: 15 })
124
+ ])) : n("", !0),
125
+ u(s(c), {
126
+ type: "text",
127
+ size: "mini",
128
+ title: "预览媒体",
129
+ "aria-label": "预览媒体",
130
+ onClick: e[4] || (e[4] = (m) => d.value = !0)
131
+ }, {
132
+ default: l(() => [
133
+ u(s(b), {
134
+ name: "open",
135
+ size: 15
136
+ })
137
+ ]),
138
+ _: 1
139
+ }),
140
+ v.value && t.node.attrs.status === "error" ? (i(), p(s(c), {
141
+ key: 1,
142
+ type: "text",
143
+ size: "mini",
144
+ title: "重试上传",
145
+ "aria-label": "重试上传",
146
+ onClick: A
147
+ }, {
148
+ default: l(() => e[8] || (e[8] = [
149
+ k("重试")
150
+ ])),
151
+ _: 1
152
+ })) : n("", !0),
153
+ v.value ? (i(), p(s(c), {
154
+ key: 2,
155
+ type: "text",
156
+ size: "mini",
157
+ title: "删除媒体",
158
+ "aria-label": "删除媒体",
159
+ onClick: V
160
+ }, {
161
+ default: l(() => [
162
+ u(s(b), {
163
+ name: "rte-del",
164
+ size: 15
165
+ })
166
+ ]),
167
+ _: 1
168
+ })) : n("", !0)
169
+ ])),
170
+ t.node.attrs.status === "uploading" ? (i(), f("div", Z, [
171
+ u(s(b), {
172
+ name: "sync",
173
+ size: 17,
174
+ class: "fk-spin"
175
+ }),
176
+ k("正在上传" + E(y.value === null ? "…" : ` ${y.value}%`), 1),
177
+ o && v.value ? (i(), p(s(c), {
178
+ key: 0,
179
+ class: "fk-media-status-action",
180
+ type: "text",
181
+ size: "mini",
182
+ "aria-label": "取消上传",
183
+ onClick: N(V, ["stop"])
184
+ }, {
185
+ default: l(() => e[9] || (e[9] = [
186
+ k("取消上传")
187
+ ])),
188
+ _: 1
189
+ })) : n("", !0)
190
+ ])) : n("", !0)
191
+ ]),
192
+ z("div", h, [
193
+ t.node.attrs.kind === "video" ? (i(), p(s(b), {
194
+ key: 0,
195
+ name: "video2",
196
+ size: 12
197
+ })) : n("", !0),
198
+ z("span", null, E(t.node.attrs.name), 1),
199
+ t.node.attrs.status === "error" ? (i(), f("span", x, E(t.node.attrs.error), 1)) : n("", !0),
200
+ o && v.value && t.node.attrs.status === "error" ? (i(), f(U, { key: 2 }, [
201
+ u(s(c), {
202
+ class: "fk-media-status-action",
203
+ type: "text",
204
+ size: "mini",
205
+ "aria-label": "重试上传",
206
+ onClick: N(A, ["stop"])
207
+ }, {
208
+ default: l(() => e[10] || (e[10] = [
209
+ k("重试")
210
+ ])),
211
+ _: 1
212
+ }),
213
+ u(s(c), {
214
+ class: "fk-media-status-action",
215
+ type: "text",
216
+ size: "mini",
217
+ "aria-label": "移除失败媒体",
218
+ onClick: N(V, ["stop"])
219
+ }, {
220
+ default: l(() => e[11] || (e[11] = [
221
+ k("移除")
222
+ ])),
223
+ _: 1
224
+ })
225
+ ], 64)) : n("", !0)
226
+ ]),
227
+ t.node.attrs.kind === "image" ? (i(), p(s(O), {
228
+ key: 0,
229
+ visible: d.value,
230
+ "onUpdate:visible": e[5] || (e[5] = (m) => d.value = m),
231
+ src: t.node.attrs.src,
232
+ "mask-closable": !0
233
+ }, null, 8, ["visible", "src"])) : (i(), p(s(R), {
234
+ key: 1,
235
+ visible: d.value,
236
+ "onUpdate:visible": e[6] || (e[6] = (m) => d.value = m),
237
+ title: t.node.attrs.name,
238
+ footer: !1,
239
+ width: "min(960px, 90vw)",
240
+ "unmount-on-close": ""
241
+ }, {
242
+ default: l(() => [
243
+ z("video", {
244
+ class: "fk-video-preview",
245
+ src: t.node.attrs.src,
246
+ controls: "",
247
+ autoplay: ""
248
+ }, null, 8, _)
249
+ ]),
250
+ _: 1
251
+ }, 8, ["visible", "title"]))
252
+ ]),
253
+ _: 1
254
+ }, 8, ["class", "data-media-id", "data-drag-handle"]));
255
+ }
256
+ }), ne = I.create({
257
+ name: "mediaBlock",
258
+ group: "block",
259
+ atom: !0,
260
+ draggable: !0,
261
+ selectable: !0,
262
+ addOptions() {
263
+ return { sceneStyle: !1 };
264
+ },
265
+ addAttributes() {
266
+ return {
267
+ id: { default: "" },
268
+ nodeVersion: { default: 0 },
269
+ assetId: { default: null },
270
+ src: { default: "" },
271
+ kind: { default: "image" },
272
+ name: { default: "" },
273
+ poster: { default: null },
274
+ status: { default: "ready" },
275
+ error: { default: "" }
276
+ };
277
+ },
278
+ parseHTML() {
279
+ return [
280
+ {
281
+ tag: "figure[data-media-block]",
282
+ getAttrs: (r) => {
283
+ var a, o, d;
284
+ return {
285
+ id: r.getAttribute("data-id"),
286
+ kind: r.getAttribute("data-kind"),
287
+ src: (a = r.querySelector("img,video")) == null ? void 0 : a.getAttribute("src"),
288
+ name: (o = r.querySelector("figcaption")) == null ? void 0 : o.textContent,
289
+ assetId: r.getAttribute("data-asset-id"),
290
+ poster: (d = r.querySelector("video")) == null ? void 0 : d.getAttribute("poster"),
291
+ status: "ready"
292
+ };
293
+ }
294
+ }
295
+ ];
296
+ },
297
+ renderHTML({ node: r, HTMLAttributes: a }) {
298
+ return [
299
+ "figure",
300
+ D(a, {
301
+ "data-media-block": "",
302
+ "data-fkp-node": "media-block",
303
+ "data-id": r.attrs.id,
304
+ "data-kind": r.attrs.kind,
305
+ "data-asset-id": r.attrs.assetId,
306
+ "data-name": r.attrs.name
307
+ }),
308
+ r.attrs.kind === "video" ? [
309
+ "video",
310
+ { src: r.attrs.src, controls: "", poster: r.attrs.poster }
311
+ ] : ["img", { src: r.attrs.src, alt: r.attrs.name }],
312
+ ["figcaption", {}, r.attrs.name]
313
+ ];
314
+ },
315
+ renderText({ node: r }) {
316
+ return `[${r.attrs.kind === "video" ? "视频" : "图片"}:${r.attrs.name}]`;
317
+ },
318
+ addNodeView() {
319
+ return q(ee);
320
+ }
321
+ });
322
+ export {
323
+ ne as MediaBlock
324
+ };
@@ -1,4 +1,4 @@
1
- import { f as m, e as A } from "./rules-CC6NoltX.js";
1
+ import { f as m, i as A } from "./guard-CXpVx8UR.js";
2
2
  function b(i) {
3
3
  let s = 2166136261;
4
4
  for (let a = 0; a < i.length; a++)
@@ -1,4 +1,4 @@
1
- import { p as l, f as c } from "./FkpRichText.vue_vue_type_script_setup_true_lang-BuMz8Tyy.js";
1
+ import { p as l, i as c } from "./FkpRichText.vue_vue_type_script_setup_true_lang-BowbZoTQ.js";
2
2
  function u(o) {
3
3
  return {
4
4
  id: o,
@@ -0,0 +1,4 @@
1
+ import { _ as i } from "../index-D0bJAQSN.js";
2
+ export {
3
+ i as FkpNavigation
4
+ };
@@ -0,0 +1,20 @@
1
+ function s(a, t, e) {
2
+ return {
3
+ id: a,
4
+ slot: t,
5
+ apiVersion: 1,
6
+ dataVersion: 1,
7
+ actions: {
8
+ [`${a}.${t}.apply`]: {
9
+ execute: async (r, n) => ({
10
+ ok: !0,
11
+ data: e.execute(a, r, n.scene)
12
+ })
13
+ }
14
+ },
15
+ ...e.validateInsert ? { validateInsert: e.validateInsert } : {}
16
+ };
17
+ }
18
+ export {
19
+ s as b
20
+ };
@@ -1,4 +1,4 @@
1
- import { b as t } from "./operations-JgnjGx3H.js";
1
+ import { b as t } from "./operations-D8pn-_iW.js";
2
2
  import { s as o } from "./selection-state-D47jhx0U.js";
3
3
  const a = t("todo", "questionAction", o);
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { b as o } from "./operations-JgnjGx3H.js";
1
+ import { b as o } from "./operations-D8pn-_iW.js";
2
2
  import { m as i } from "./state-KfOqha3d.js";
3
3
  const e = o(
4
4
  "originalReply",
@@ -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-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";
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
  };