@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.
- package/LICENSE +21 -0
- package/README.md +16 -2
- package/dist/FkpRichText.vue_vue_type_script_setup_true_lang-DnknqQTh.js +4115 -0
- package/dist/KnowledgeArea-OPR7smbt.js +923 -0
- package/dist/ToolForm-CWpUIVTl.js +185 -0
- package/dist/choice-DDg5gNtS.js +29 -0
- package/dist/guard-BCatAeT4.js +749 -0
- package/dist/index-5a9mHHzg.js +41 -0
- package/dist/index-BsQLwz91.js +5 -0
- package/dist/index-CJlAseSN.js +15 -0
- package/dist/index-CzpY61Qj.js +6 -0
- package/dist/index-D8bcFtWR.js +6 -0
- package/dist/index-DOEijEGU.js +49 -0
- package/dist/index-DSgEWJGP.js +6 -0
- package/dist/index-DxxX09iY.js +6 -0
- package/dist/index-nnvfy5q0.js +31 -0
- package/dist/index-urNonkMH.js +6 -0
- package/dist/index-xAjlBylT.js +5 -0
- package/dist/index.js +16 -0
- package/dist/inline-TT_dl8Y3.js +17 -0
- package/dist/knowledge-BZCmalF_.js +6 -0
- package/dist/knowledge-DnYGicjn.js +13 -0
- package/dist/media-extensions-ZoxmhIhH.js +276 -0
- package/dist/media-migration-CGOFwdYm.js +59 -0
- package/dist/media-upload-Dx45yv6a.js +69 -0
- package/dist/operations-JgnjGx3H.js +19 -0
- package/dist/question-D1--acV8.js +10 -0
- package/dist/question-DGC6JHy5.js +6 -0
- package/dist/rich-text/index.js +224 -0
- package/dist/rich-text/legacy-converter/index.js +485 -0
- package/dist/selection-state-D47jhx0U.js +20 -0
- package/dist/state-KfOqha3d.js +16 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/rich-text/FkpRichText.vue.d.ts +242 -0
- package/dist/types/rich-text/MediaView.vue.d.ts +92 -0
- package/dist/types/rich-text/__demo__/conversion-fixtures.d.ts +35 -0
- package/dist/types/rich-text/config/catalog.d.ts +3 -0
- package/dist/types/rich-text/config/descriptor.d.ts +58 -0
- package/dist/types/rich-text/config/media-options.d.ts +6 -0
- package/dist/types/rich-text/config/resolve.d.ts +17 -0
- package/dist/types/rich-text/config/selection-options.d.ts +6 -0
- package/dist/types/rich-text/extensions.d.ts +6 -0
- package/dist/types/rich-text/index.d.ts +17 -0
- package/dist/types/rich-text/legacy-converter/index.d.ts +45 -0
- package/dist/types/rich-text/media-extensions.d.ts +4 -0
- package/dist/types/rich-text/media-id.d.ts +2 -0
- package/dist/types/rich-text/model/agent-context.d.ts +7 -0
- package/dist/types/rich-text/model/capability-diff.d.ts +14 -0
- package/dist/types/rich-text/model/condition-contract.d.ts +10 -0
- package/dist/types/rich-text/model/convert.d.ts +6 -0
- package/dist/types/rich-text/model/guard.d.ts +7 -0
- package/dist/types/rich-text/model/json-value.d.ts +2 -0
- package/dist/types/rich-text/model/media-migration.d.ts +8 -0
- package/dist/types/rich-text/model/node-contract.d.ts +10 -0
- package/dist/types/rich-text/model/node-identity.d.ts +8 -0
- package/dist/types/rich-text/model/persistence-contract.d.ts +25 -0
- package/dist/types/rich-text/model/preview.d.ts +2 -0
- package/dist/types/rich-text/model/question-text.d.ts +15 -0
- package/dist/types/rich-text/model/reasoning-context.d.ts +24 -0
- package/dist/types/rich-text/model/scene-snapshot.d.ts +4 -0
- package/dist/types/rich-text/model/validate.d.ts +19 -0
- package/dist/types/rich-text/model/web-url.d.ts +2 -0
- package/dist/types/rich-text/plugins/agentSelect/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/attribute/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/attribute/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/block.d.ts +3 -0
- package/dist/types/rich-text/plugins/choice.d.ts +4 -0
- package/dist/types/rich-text/plugins/image/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/image/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/inline.d.ts +3 -0
- package/dist/types/rich-text/plugins/media-upload.d.ts +3 -0
- package/dist/types/rich-text/plugins/memory/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/memory/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/operations.d.ts +86 -0
- package/dist/types/rich-text/plugins/originalReply/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/originalReply/knowledge.d.ts +2 -0
- package/dist/types/rich-text/plugins/originalReply/question.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningPolish/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningPolish/index.d.ts +3 -0
- package/dist/types/rich-text/plugins/reasoningTemplate/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/reasoningTemplate/index.d.ts +3 -0
- package/dist/types/rich-text/plugins/registry.d.ts +14 -0
- package/dist/types/rich-text/plugins/selection-state.d.ts +4 -0
- package/dist/types/rich-text/plugins/separator/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/separator/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/state.d.ts +3 -0
- package/dist/types/rich-text/plugins/tagged/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/tagged/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/ticket/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/ticket/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/todo/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/todo/knowledge.d.ts +2 -0
- package/dist/types/rich-text/plugins/todo/question.d.ts +2 -0
- package/dist/types/rich-text/plugins/tool/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/tool/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/tool/operations.d.ts +4 -0
- package/dist/types/rich-text/plugins/tool/presentation.d.ts +7 -0
- package/dist/types/rich-text/plugins/variable/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/variable/index.d.ts +2 -0
- package/dist/types/rich-text/plugins/video/descriptor.d.ts +2 -0
- package/dist/types/rich-text/plugins/video/index.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +588 -0
- package/dist/types/rich-text/runtime/action-ports.d.ts +15 -0
- package/dist/types/rich-text/runtime/media-state.d.ts +6 -0
- package/dist/types/rich-text/runtime/media-target.d.ts +8 -0
- package/dist/types/rich-text/runtime/media-upload-session.d.ts +59 -0
- package/dist/types/rich-text/runtime/operations.d.ts +48 -0
- package/dist/types/rich-text/runtime/option-menu-session.d.ts +28 -0
- package/dist/types/rich-text/runtime/option-source.d.ts +10 -0
- package/dist/types/rich-text/runtime/port-result.d.ts +21 -0
- package/dist/types/rich-text/runtime/schema-plan.d.ts +17 -0
- package/dist/types/rich-text/runtime/tool-form-session.d.ts +39 -0
- package/dist/types/rich-text/runtime/tool-params.d.ts +5 -0
- package/dist/types/rich-text/types.d.ts +40 -0
- package/dist/types/rich-text/ui/CapabilityHelp.vue.d.ts +9 -0
- package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +117 -0
- package/dist/types/rich-text/ui/ToolForm.vue.d.ts +14 -0
- package/dist/types/rich-text/ui/VariableOptionList.vue.d.ts +15 -0
- package/package.json +70 -3
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { defineComponent as T, ref as w, watch as q, openBlock as t, createElementBlock as n, Fragment as h, renderList as S, normalizeClass as _, createElementVNode as k, createTextVNode as c, toDisplayString as s, createCommentVNode as g, createVNode as f, unref as u, withCtx as b, createBlock as x, normalizeStyle as B } from "vue";
|
|
2
|
+
import { RadioGroup as F, Radio as E, Checkbox as P, Switch as W, Textarea as z, Input as R, Button as V } from "@freecallai/ui";
|
|
3
|
+
import { d as j } from "./FkpRichText.vue_vue_type_script_setup_true_lang-DnknqQTh.js";
|
|
4
|
+
const D = { class: "fkp-tool-form" }, G = { key: 0 }, O = { class: "fkp-visually-hidden" }, A = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "fkp-tool-form-checkbox"
|
|
7
|
+
}, H = { key: 0 }, J = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "fkp-tool-form-error",
|
|
10
|
+
role: "alert"
|
|
11
|
+
}, K = { class: "fkp-tool-form-actions" }, X = /* @__PURE__ */ T({
|
|
12
|
+
__name: "ToolForm",
|
|
13
|
+
props: {
|
|
14
|
+
definition: {},
|
|
15
|
+
initialParams: {},
|
|
16
|
+
submitLabel: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["submit", "cancel"],
|
|
19
|
+
setup($, { emit: I }) {
|
|
20
|
+
const d = $, C = I, o = w({}), i = w("");
|
|
21
|
+
q(
|
|
22
|
+
() => [d.definition, d.initialParams],
|
|
23
|
+
() => {
|
|
24
|
+
o.value = Object.fromEntries(
|
|
25
|
+
d.definition.fields.map((l) => [
|
|
26
|
+
l.id,
|
|
27
|
+
j(l, d.initialParams)
|
|
28
|
+
])
|
|
29
|
+
), i.value = "";
|
|
30
|
+
},
|
|
31
|
+
{ immediate: !0 }
|
|
32
|
+
);
|
|
33
|
+
function p(l) {
|
|
34
|
+
return l.visibleWhen ? o.value[l.visibleWhen.fieldId] === l.visibleWhen.equals : !0;
|
|
35
|
+
}
|
|
36
|
+
function L(l, r) {
|
|
37
|
+
o.value[l.id] = l.maxLength === void 0 ? r : r.slice(0, l.maxLength);
|
|
38
|
+
}
|
|
39
|
+
function N(l) {
|
|
40
|
+
var a;
|
|
41
|
+
const r = {};
|
|
42
|
+
for (const e of d.definition.fields) {
|
|
43
|
+
if (!p(e)) continue;
|
|
44
|
+
const y = o.value[e.id];
|
|
45
|
+
if (e.kind === "switch" || e.kind === "checkbox") {
|
|
46
|
+
if (e.required && y !== !0) {
|
|
47
|
+
i.value = `请选择${e.label}`;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
r[e.id] = y === !0;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const m = String(y ?? "").trim();
|
|
54
|
+
if (e.required && !m) {
|
|
55
|
+
i.value = `请填写${e.label}`;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (e.maxLength !== void 0 && [...m].length > e.maxLength) {
|
|
59
|
+
i.value = `${e.label}不能超过${e.maxLength}字`;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (e.kind === "radio" && !((a = e.options) != null && a.some((v) => v.value === m))) {
|
|
63
|
+
i.value = `请选择${e.label}`;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (e.kind === "number" && m) {
|
|
67
|
+
const v = Number(m);
|
|
68
|
+
if (!Number.isFinite(v) || e.min !== void 0 && v < e.min || e.max !== void 0 && v > e.max) {
|
|
69
|
+
i.value = `${e.label}数值无效`;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
r[e.id] = m;
|
|
74
|
+
}
|
|
75
|
+
i.value = "", C("submit", r, l.currentTarget);
|
|
76
|
+
}
|
|
77
|
+
return (l, r) => (t(), n("div", D, [
|
|
78
|
+
(t(!0), n(h, null, S(l.definition.fields, (a) => (t(), n(h, {
|
|
79
|
+
key: a.id
|
|
80
|
+
}, [
|
|
81
|
+
p(a) && a.kind === "radio" ? (t(), n("fieldset", {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: _(["fkp-tool-form-field fkp-tool-form-choice", { "fkp-tool-form-flags": a.appearance === "flag" }])
|
|
84
|
+
}, [
|
|
85
|
+
k("legend", null, [
|
|
86
|
+
c(s(a.label), 1),
|
|
87
|
+
a.required ? (t(), n("b", G, "*")) : g("", !0)
|
|
88
|
+
]),
|
|
89
|
+
f(u(F), {
|
|
90
|
+
"model-value": String(o.value[a.id] ?? ""),
|
|
91
|
+
onChange: (e) => o.value[a.id] = String(e)
|
|
92
|
+
}, {
|
|
93
|
+
default: b(() => [
|
|
94
|
+
(t(!0), n(h, null, S(a.options || [], (e) => (t(), x(u(E), {
|
|
95
|
+
key: e.value,
|
|
96
|
+
value: e.value,
|
|
97
|
+
"aria-label": e.label
|
|
98
|
+
}, {
|
|
99
|
+
default: b(() => [
|
|
100
|
+
a.appearance === "flag" && e.color ? (t(), n("span", {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: "fkp-tool-form-flag",
|
|
103
|
+
style: B({ "--fkp-flag-color": e.color })
|
|
104
|
+
}, [
|
|
105
|
+
k("span", O, s(e.label), 1)
|
|
106
|
+
], 4)) : (t(), n(h, { key: 1 }, [
|
|
107
|
+
c(s(e.label), 1)
|
|
108
|
+
], 64))
|
|
109
|
+
]),
|
|
110
|
+
_: 2
|
|
111
|
+
}, 1032, ["value", "aria-label"]))), 128))
|
|
112
|
+
]),
|
|
113
|
+
_: 2
|
|
114
|
+
}, 1032, ["model-value", "onChange"])
|
|
115
|
+
], 2)) : p(a) && a.kind === "checkbox" ? (t(), n("div", A, [
|
|
116
|
+
f(u(P), {
|
|
117
|
+
"model-value": o.value[a.id] === !0,
|
|
118
|
+
onChange: (e) => o.value[a.id] = e === !0
|
|
119
|
+
}, {
|
|
120
|
+
default: b(() => [
|
|
121
|
+
c(s(a.label), 1)
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, 1032, ["model-value", "onChange"])
|
|
125
|
+
])) : p(a) ? (t(), n("label", {
|
|
126
|
+
key: 2,
|
|
127
|
+
class: _(["fkp-tool-form-field", { "fkp-tool-form-field--no-label": a.hideLabel }])
|
|
128
|
+
}, [
|
|
129
|
+
k("span", {
|
|
130
|
+
class: _({ "fkp-visually-hidden": a.hideLabel })
|
|
131
|
+
}, [
|
|
132
|
+
c(s(a.label), 1),
|
|
133
|
+
a.required ? (t(), n("b", H, "*")) : g("", !0)
|
|
134
|
+
], 2),
|
|
135
|
+
a.kind === "switch" ? (t(), x(u(W), {
|
|
136
|
+
key: 0,
|
|
137
|
+
"model-value": o.value[a.id] === !0,
|
|
138
|
+
"aria-label": a.label,
|
|
139
|
+
onChange: (e) => o.value[a.id] = e === !0
|
|
140
|
+
}, null, 8, ["model-value", "aria-label", "onChange"])) : a.kind === "textarea" ? (t(), x(u(z), {
|
|
141
|
+
key: 1,
|
|
142
|
+
"model-value": String(o.value[a.id] ?? ""),
|
|
143
|
+
placeholder: a.placeholder,
|
|
144
|
+
"max-length": a.maxLength,
|
|
145
|
+
"show-word-limit": !!a.maxLength,
|
|
146
|
+
"textarea-attrs": { "aria-label": a.label, rows: 4 },
|
|
147
|
+
onInput: (e) => L(a, String(e))
|
|
148
|
+
}, null, 8, ["model-value", "placeholder", "max-length", "show-word-limit", "textarea-attrs", "onInput"])) : (t(), x(u(R), {
|
|
149
|
+
key: 2,
|
|
150
|
+
"model-value": String(o.value[a.id] ?? ""),
|
|
151
|
+
placeholder: a.placeholder,
|
|
152
|
+
"input-attrs": {
|
|
153
|
+
type: a.kind === "number" ? "number" : "text",
|
|
154
|
+
"aria-label": a.label
|
|
155
|
+
},
|
|
156
|
+
onInput: (e) => L(a, String(e))
|
|
157
|
+
}, null, 8, ["model-value", "placeholder", "input-attrs", "onInput"]))
|
|
158
|
+
], 2)) : g("", !0)
|
|
159
|
+
], 64))), 128)),
|
|
160
|
+
i.value ? (t(), n("p", J, s(i.value), 1)) : g("", !0),
|
|
161
|
+
k("div", K, [
|
|
162
|
+
f(u(V), {
|
|
163
|
+
onClick: r[0] || (r[0] = (a) => C("cancel"))
|
|
164
|
+
}, {
|
|
165
|
+
default: b(() => r[1] || (r[1] = [
|
|
166
|
+
c("取消")
|
|
167
|
+
])),
|
|
168
|
+
_: 1
|
|
169
|
+
}),
|
|
170
|
+
f(u(V), {
|
|
171
|
+
type: "primary",
|
|
172
|
+
onClick: N
|
|
173
|
+
}, {
|
|
174
|
+
default: b(() => [
|
|
175
|
+
c(s(l.submitLabel), 1)
|
|
176
|
+
]),
|
|
177
|
+
_: 1
|
|
178
|
+
})
|
|
179
|
+
])
|
|
180
|
+
]));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
export {
|
|
184
|
+
X as default
|
|
185
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { m as r } from "./inline-TT_dl8Y3.js";
|
|
2
|
+
const s = {
|
|
3
|
+
execute(o, e, t) {
|
|
4
|
+
if (!e.option) return [];
|
|
5
|
+
if (!e.edit) return r.execute(o, e, t);
|
|
6
|
+
const { nodeId: d, nodeVersion: n } = e.edit;
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
kind: "updateOwnNode",
|
|
10
|
+
capabilityId: o,
|
|
11
|
+
nodeId: d,
|
|
12
|
+
expectedNodeVersion: n,
|
|
13
|
+
node: {
|
|
14
|
+
type: "businessToken",
|
|
15
|
+
attrs: {
|
|
16
|
+
id: d,
|
|
17
|
+
nodeVersion: n + 1,
|
|
18
|
+
kind: o,
|
|
19
|
+
key: e.option.id,
|
|
20
|
+
label: e.option.label
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
s as c
|
|
29
|
+
};
|