@freecallai/pro 0.0.12 → 0.0.13
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/README.md +23 -2
- package/dist/{FkpRichText.vue_vue_type_script_setup_true_lang-DiS7CZdc.js → FkpRichText.vue_vue_type_script_setup_true_lang-D-SOdFra.js} +1364 -1349
- package/dist/{KnowledgeArea-FGgCcubh.js → KnowledgeArea-ClZoLiaZ.js} +1 -1
- package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-CoFF-WCe.js +1830 -0
- package/dist/{ToolForm-CHmdyhjh.js → ToolForm-BK9epxdr.js} +1 -1
- package/dist/agent-prompt-editor/index.js +510 -495
- package/dist/agent-prompt-editor/legacy-converter/index.js +2 -2
- package/dist/{choice-CUCsR2dN.js → choice-UgePgrSl.js} +1 -1
- package/dist/{guard-DgExtfXo.js → guard-DPwe4mCm.js} +1 -0
- package/dist/{index-DqJvaPTD.js → index-BIi3k45j.js} +1 -1
- package/dist/index-BMHUPL5x.js +5 -0
- package/dist/{index-pdr6mUf0.js → index-CaA13lC9.js} +1 -1
- package/dist/{index-C54ce9Tn.js → index-ChuzFuNm.js} +1 -1
- package/dist/index-DJLfgC4v.js +5 -0
- package/dist/{index-dnsGFj0F.js → index-DfKH-RZq.js} +2 -2
- package/dist/{index-DaGfiqBX.js → index-DiLMgNEe.js} +1 -1
- package/dist/{index-BwZXmefJ.js → index-RHu4JIw7.js} +1 -1
- package/dist/{index-DIMONp3g.js → index-v1UD08i6.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{inline-BpwAryXp.js → inline-CVF1zEsG.js} +1 -1
- package/dist/{knowledge-DIzYk2iM.js → knowledge-DWM6tWnP.js} +1 -1
- package/dist/{media-migration-Bnfn27i9.js → media-migration-BctCLEuT.js} +1 -1
- package/dist/{media-policy-tG5OHWSj.js → media-policy-B1UuSN2e.js} +1 -1
- package/dist/{media-upload-_xeZtn3i.js → media-upload-DtH-oCtw.js} +1 -1
- package/dist/{model-DlAjlPai.js → model-VLLhEQfn.js} +1 -1
- package/dist/rich-text/index.js +6 -6
- package/dist/rich-text/legacy-converter/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/agent-prompt-editor/FkpAgentPromptEditor.vue.d.ts +33 -2
- package/dist/types/agent-prompt-editor/index.d.ts +1 -0
- package/dist/types/agent-prompt-editor/types.d.ts +4 -0
- package/dist/types/filters/FkpFilter.vue.d.ts +2 -2
- package/dist/types/filters/FkpFilterDateRange.vue.d.ts +2 -2
- package/dist/types/filters/FkpFilterPeriod.vue.d.ts +2 -2
- package/dist/types/filters/FkpSearchableMultiSelect.vue.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/rich-text/FkpRichText.vue.d.ts +18 -2
- package/dist/types/rich-text/index.d.ts +1 -0
- package/dist/types/rich-text/plugins/attribute/token.d.ts +1 -0
- package/dist/types/rich-text/plugins/tableKnowledge/token.d.ts +1 -0
- package/dist/types/rich-text/plugins/ticket/token.d.ts +2 -1
- package/dist/types/rich-text/plugins/token-catalog.d.ts +4 -1
- package/dist/types/rich-text/plugins/token-definition.d.ts +2 -0
- package/dist/types/rich-text/public/types.d.ts +5 -0
- package/dist/types/rich-text/runtime/document-adapter.d.ts +3 -0
- package/dist/types/rich-text/runtime/tag-validity.d.ts +46 -0
- package/dist/types/rich-text/ui/FkpKnowledgeTypePicker.vue.d.ts +2 -2
- package/dist/types/rich-text/ui/KnowledgeArea.vue.d.ts +9 -0
- package/dist/types/rich-text/ui/MediaSourceControls.vue.d.ts +4 -4
- package/dist/types/rich-text/ui/ToolForm.vue.d.ts +2 -2
- package/dist/types/switcher/FkpSwitcher.vue.d.ts +2 -2
- package/package.json +3 -2
- package/dist/KnowledgeArea.vue_vue_type_script_setup_true_lang-JH_F4CFe.js +0 -1663
- package/dist/index-CMl5mgFR.js +0 -5
- package/dist/index-Cs38tTe4.js +0 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as It, ref as d, computed as N, onMounted as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import
|
|
4
|
-
import { u as wt, c as Ze, m as be, _ as Dt, M as je, a as Nt, b as Pt } from "../media-policy-
|
|
5
|
-
import { i as Qe } from "../guard-
|
|
6
|
-
import { _ as
|
|
7
|
-
import { Node as
|
|
8
|
-
import { f as ne, a as et, c as zt, e as Kt, v as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as It, ref as d, computed as N, onMounted as Tt, watch as $, onBeforeUnmount as Et, openBlock as m, createElementBlock as y, withKeys as Mt, withModifiers as ae, normalizeClass as Lt, createElementVNode as k, Fragment as ve, renderList as Le, createCommentVNode as q, createVNode as R, unref as T, withCtx as me, createBlock as Je, createTextVNode as Se, toDisplayString as U, renderSlot as St, normalizeStyle as Ct, withDirectives as We, vModelText as Xe, nextTick as ge } from "vue";
|
|
2
|
+
import { Popover as _t, Button as Ce } from "@freecallai/ui";
|
|
3
|
+
import _e from "@freecallai/icons";
|
|
4
|
+
import { u as wt, c as Ze, m as be, _ as Dt, M as je, a as Nt, b as Pt } from "../media-policy-B1UuSN2e.js";
|
|
5
|
+
import { i as Qe } from "../guard-DPwe4mCm.js";
|
|
6
|
+
import { _ as Vt } from "../KnowledgeArea.vue_vue_type_script_setup_true_lang-CoFF-WCe.js";
|
|
7
|
+
import { Node as Ot } from "@tiptap/core";
|
|
8
|
+
import { f as ne, a as et, c as zt, e as Kt, v as Rt } from "../model-VLLhEQfn.js";
|
|
9
|
+
const Ft = Ot.create({
|
|
10
10
|
name: "agentSizeChart",
|
|
11
11
|
group: "inline",
|
|
12
12
|
inline: !0,
|
|
@@ -19,45 +19,50 @@ const Rt = Vt.create({
|
|
|
19
19
|
return [
|
|
20
20
|
{
|
|
21
21
|
tag: "span[data-agent-size-chart]",
|
|
22
|
-
getAttrs: (
|
|
23
|
-
name:
|
|
22
|
+
getAttrs: (S) => ({
|
|
23
|
+
name: S.getAttribute("data-agent-size-chart") || ""
|
|
24
24
|
})
|
|
25
25
|
}
|
|
26
26
|
];
|
|
27
27
|
},
|
|
28
|
-
renderHTML({ node:
|
|
28
|
+
renderHTML({ node: S }) {
|
|
29
29
|
return [
|
|
30
30
|
"span",
|
|
31
31
|
{
|
|
32
|
-
"data-agent-size-chart":
|
|
32
|
+
"data-agent-size-chart": S.attrs.name,
|
|
33
33
|
class: "fkp-agent-size-chart fkp-knowledge-tag",
|
|
34
34
|
contenteditable: "false"
|
|
35
35
|
},
|
|
36
|
-
`#@${
|
|
36
|
+
`#@${S.attrs.name}@#`
|
|
37
37
|
];
|
|
38
38
|
},
|
|
39
|
-
renderText({ node:
|
|
40
|
-
return `#@${
|
|
39
|
+
renderText({ node: S }) {
|
|
40
|
+
return `#@${S.attrs.name}@#`;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
function
|
|
43
|
+
function xt(S) {
|
|
44
44
|
return {
|
|
45
45
|
ariaLabel: "Agent 提示词",
|
|
46
46
|
placeholder: "填写提示词",
|
|
47
|
-
extensions: [
|
|
47
|
+
extensions: [Ft],
|
|
48
|
+
describeTagValidity: (g) => g.type.name === "agentSizeChart" ? {
|
|
49
|
+
kind: "agentSizeChart",
|
|
50
|
+
key: String(g.attrs.name || ""),
|
|
51
|
+
label: String(g.attrs.name || "")
|
|
52
|
+
} : void 0,
|
|
48
53
|
clipboard: {
|
|
49
|
-
allowBusinessToken: (
|
|
50
|
-
sanitizeInlineNode(
|
|
51
|
-
if (!
|
|
52
|
-
const D =
|
|
53
|
-
if (!
|
|
54
|
+
allowBusinessToken: (g, D) => g !== "tool" || D === "small_payment",
|
|
55
|
+
sanitizeInlineNode(g) {
|
|
56
|
+
if (!g.hasAttribute("data-agent-size-chart")) return;
|
|
57
|
+
const D = g.getAttribute("data-agent-size-chart") || "";
|
|
58
|
+
if (!S() || !D.trim() || /[#@<>\r\n]/u.test(D) || g.textContent !== `#@${D}@#`)
|
|
54
59
|
return null;
|
|
55
|
-
const
|
|
56
|
-
return
|
|
60
|
+
const i = document.createElement("span");
|
|
61
|
+
return i.setAttribute("data-agent-size-chart", D), i.textContent = `#@${D}@#`, i;
|
|
57
62
|
},
|
|
58
|
-
serializeNode(
|
|
59
|
-
if (
|
|
60
|
-
return `#@${
|
|
63
|
+
serializeNode(g) {
|
|
64
|
+
if (g.type.name === "agentSizeChart")
|
|
65
|
+
return `#@${g.attrs.name || ""}@#`;
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
};
|
|
@@ -74,14 +79,14 @@ const Bt = {
|
|
|
74
79
|
class: "fkp-menu fkp-more-menu",
|
|
75
80
|
role: "menu",
|
|
76
81
|
"aria-label": "更多提示词操作"
|
|
77
|
-
}, Ut = { class: "fkp-toolbar-right fkp-agent-prompt-toolbar-right" }, Yt = ["aria-label"], Ht = { key: 0 },
|
|
82
|
+
}, Ut = { class: "fkp-toolbar-right fkp-agent-prompt-toolbar-right" }, Yt = ["aria-label"], Ht = { key: 0 }, Gt = { key: 1 }, Jt = ["disabled", "onClick"], Wt = {
|
|
78
83
|
key: 1,
|
|
79
84
|
class: "fkp-agent-prompt-options"
|
|
80
|
-
},
|
|
85
|
+
}, Xt = {
|
|
81
86
|
key: 2,
|
|
82
87
|
role: "alert",
|
|
83
88
|
class: "fkp-agent-prompt-error"
|
|
84
|
-
}, Zt = { class: "fkp-agent-prompt-footer" },
|
|
89
|
+
}, Zt = { class: "fkp-agent-prompt-footer" }, oa = /* @__PURE__ */ It({
|
|
85
90
|
name: "FkpAgentPromptEditor",
|
|
86
91
|
__name: "FkpAgentPromptEditor",
|
|
87
92
|
props: {
|
|
@@ -99,25 +104,25 @@ const Bt = {
|
|
|
99
104
|
maxLength: { default: 1e4 }
|
|
100
105
|
},
|
|
101
106
|
emits: ["update:modelValue", "change", "diagnostic", "busy-change"],
|
|
102
|
-
setup(
|
|
103
|
-
const
|
|
107
|
+
setup(S, { expose: g, emit: D }) {
|
|
108
|
+
const i = S, le = D;
|
|
104
109
|
function we(e) {
|
|
105
110
|
return JSON.parse(JSON.stringify(e));
|
|
106
111
|
}
|
|
107
112
|
function De(e) {
|
|
108
113
|
return ne(e) ? Kt() : we(e);
|
|
109
114
|
}
|
|
110
|
-
const C = d(De(
|
|
111
|
-
ne(
|
|
112
|
-
), Y = d(0), c = d(),
|
|
115
|
+
const C = d(De(i.modelValue)), V = d(
|
|
116
|
+
ne(i.modelValue)
|
|
117
|
+
), Y = d(0), c = d(), ie = d(), ye = d(), H = d(), G = d(Number.POSITIVE_INFINITY), E = d(!1), A = d(null), oe = d([]), J = d(""), re = d(!1), Ne = d(12), I = d(!1), W = d(null), X = d(0), Z = d(0), ue = d(), _ = d(null), P = d(null), se = d(!1), { suppressedMediaHint: tt, suppressMediaHint: at, resumeMediaHintOnHover: nt } = wt(), Pe = d({});
|
|
113
118
|
let w = null;
|
|
114
|
-
const
|
|
115
|
-
let
|
|
119
|
+
const F = /* @__PURE__ */ new Set(), ce = /* @__PURE__ */ new Map();
|
|
120
|
+
let h = null, ke = null, lt = 0;
|
|
116
121
|
const de = d(Date.now());
|
|
117
122
|
let j;
|
|
118
|
-
const
|
|
119
|
-
() => new Set(
|
|
120
|
-
),
|
|
123
|
+
const Ve = N(
|
|
124
|
+
() => new Set(i.capabilities || et)
|
|
125
|
+
), Oe = [
|
|
121
126
|
{ id: "variable", label: "变量", icon: "hashtag", group: "reference" },
|
|
122
127
|
{ id: "todo", label: "待办", icon: "rte-todo", group: "reference" },
|
|
123
128
|
{
|
|
@@ -138,42 +143,42 @@ const Bt = {
|
|
|
138
143
|
{ id: "originalReply", label: "原话复述", icon: "quote", group: "format" },
|
|
139
144
|
{ id: "separator", label: "分隔符", icon: "sep", group: "format" },
|
|
140
145
|
{ id: "smallPayment", label: "小额打款", icon: "rte-tool", group: "tool" }
|
|
141
|
-
],
|
|
146
|
+
], it = N(
|
|
142
147
|
() => {
|
|
143
148
|
var e;
|
|
144
149
|
return new Set(
|
|
145
|
-
((e =
|
|
150
|
+
((e = i.config) == null ? void 0 : e.schemaVersion) === 1 && Array.isArray(i.config.rules) ? i.config.rules.filter((t) => (t == null ? void 0 : t.visible) === !1).map((t) => t.id) : []
|
|
146
151
|
);
|
|
147
152
|
}
|
|
148
153
|
), pe = N(
|
|
149
|
-
() =>
|
|
150
|
-
(e) =>
|
|
154
|
+
() => Oe.filter(
|
|
155
|
+
(e) => Ve.value.has(e.id) && !it.value.has(e.id)
|
|
151
156
|
)
|
|
152
157
|
), ze = N(
|
|
153
|
-
() => pe.value.slice(0,
|
|
158
|
+
() => pe.value.slice(0, G.value)
|
|
154
159
|
), Ae = N(
|
|
155
|
-
() => pe.value.slice(
|
|
160
|
+
() => pe.value.slice(G.value)
|
|
156
161
|
), Ke = N(
|
|
157
162
|
() => {
|
|
158
163
|
var e;
|
|
159
|
-
return ((e =
|
|
164
|
+
return ((e = Oe.find((t) => t.id === A.value)) == null ? void 0 : e.label) || "";
|
|
160
165
|
}
|
|
161
|
-
),
|
|
162
|
-
() =>
|
|
166
|
+
), O = N(
|
|
167
|
+
() => i.readonly || i.disabled || !!V.value || !!i.policy && i.policy.expiresAt <= de.value
|
|
163
168
|
);
|
|
164
|
-
function
|
|
165
|
-
return !
|
|
169
|
+
function b(e) {
|
|
170
|
+
return !O.value && et.includes(e) && Ve.value.has(e) && (!i.policy || i.policy.allowed.includes(e));
|
|
166
171
|
}
|
|
167
|
-
const
|
|
168
|
-
function
|
|
169
|
-
var t,
|
|
170
|
-
return
|
|
172
|
+
const ot = xt(() => b("sizeChart"));
|
|
173
|
+
function he(e) {
|
|
174
|
+
var t, n;
|
|
175
|
+
return b(e) && (e === "variable" ? !!((t = i.ports) != null && t.listVariables) : !!((n = i.ports) != null && n.listCapabilityOptions));
|
|
171
176
|
}
|
|
172
177
|
function Ie(e) {
|
|
173
|
-
return e === "image" || e === "video" ?
|
|
178
|
+
return e === "image" || e === "video" ? b(e) && be(i.mediaSources, e).some(
|
|
174
179
|
(t) => {
|
|
175
|
-
var
|
|
176
|
-
return t !== "local" || !!((
|
|
180
|
+
var n;
|
|
181
|
+
return t !== "local" || !!((n = i.ports) != null && n.uploadMedia);
|
|
177
182
|
}
|
|
178
183
|
) : [
|
|
179
184
|
"variable",
|
|
@@ -181,44 +186,44 @@ const Bt = {
|
|
|
181
186
|
"tableKnowledge",
|
|
182
187
|
"sizeChart",
|
|
183
188
|
"attribute"
|
|
184
|
-
].includes(e) ?
|
|
189
|
+
].includes(e) ? he(e) : b(e);
|
|
185
190
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
191
|
+
function x() {
|
|
192
|
+
h == null || h.abort(), A.value = null;
|
|
188
193
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
194
|
+
function Re(e, t) {
|
|
195
|
+
var n;
|
|
191
196
|
if (Ie(e))
|
|
192
|
-
if (
|
|
197
|
+
if (E.value = !1, x(), z(), I.value = !1, ["variable", "todo", "tableKnowledge", "sizeChart", "attribute"].includes(
|
|
193
198
|
e
|
|
194
199
|
)) {
|
|
195
|
-
const
|
|
200
|
+
const a = t.currentTarget, l = (n = ie.value) == null ? void 0 : n.getBoundingClientRect();
|
|
196
201
|
l && (Ne.value = Math.max(
|
|
197
202
|
12,
|
|
198
203
|
Math.min(
|
|
199
|
-
|
|
204
|
+
a.getBoundingClientRect().left - l.left,
|
|
200
205
|
l.width - 332
|
|
201
206
|
)
|
|
202
207
|
)), dt(e);
|
|
203
208
|
} else e === "image" || e === "video" ? ft(e, t) : e === "smallPayment" ? mt() : fe({ type: "capability", capabilityId: e });
|
|
204
209
|
}
|
|
205
|
-
let Q,
|
|
210
|
+
let Q, Fe = 0;
|
|
206
211
|
async function ee() {
|
|
207
|
-
const e = ++
|
|
208
|
-
for (
|
|
209
|
-
|
|
210
|
-
Ae.value.length || (
|
|
212
|
+
const e = ++Fe;
|
|
213
|
+
for (G.value = pe.value.length, await ge(); e === Fe && H.value && H.value.clientWidth > 0 && H.value.scrollWidth > H.value.clientWidth + 1 && G.value > 0; )
|
|
214
|
+
G.value--, await ge();
|
|
215
|
+
Ae.value.length || (E.value = !1);
|
|
211
216
|
}
|
|
212
|
-
function
|
|
217
|
+
function xe(e) {
|
|
213
218
|
var t;
|
|
214
|
-
(t =
|
|
219
|
+
(t = ie.value) != null && t.contains(e.target) || (E.value = !1, x(), P.value || z(), I.value = !1);
|
|
215
220
|
}
|
|
216
|
-
|
|
217
|
-
window.addEventListener("resize", ee), document.addEventListener("click",
|
|
221
|
+
Tt(() => {
|
|
222
|
+
window.addEventListener("resize", ee), document.addEventListener("click", xe), typeof ResizeObserver < "u" && ye.value && (Q = new ResizeObserver(() => void ee()), Q.observe(ye.value)), ee();
|
|
218
223
|
}), $(pe, (e) => {
|
|
219
|
-
|
|
220
|
-
}), $(
|
|
221
|
-
e && (
|
|
224
|
+
A.value && !e.some((t) => t.id === A.value) && x(), I.value && !e.some((t) => t.id === "smallPayment") && (I.value = !1), ee();
|
|
225
|
+
}), $(O, (e) => {
|
|
226
|
+
e && (x(), z(), I.value = !1, E.value = !1);
|
|
222
227
|
});
|
|
223
228
|
const rt = {
|
|
224
229
|
businessToken: !0,
|
|
@@ -237,224 +242,224 @@ const Bt = {
|
|
|
237
242
|
"separator",
|
|
238
243
|
"tool"
|
|
239
244
|
].filter(
|
|
240
|
-
(e) =>
|
|
245
|
+
(e) => b(e === "tool" ? "smallPayment" : e)
|
|
241
246
|
).map((e) => ({
|
|
242
247
|
id: e,
|
|
243
248
|
slot: e === "image" || e === "video" || e === "originalReply" ? "knowledgeBlock" : "knowledgeInline"
|
|
244
249
|
}))
|
|
245
250
|
), st = N(() => zt(C.value));
|
|
246
251
|
function Be() {
|
|
247
|
-
j && clearTimeout(j), de.value = Date.now(),
|
|
252
|
+
j && clearTimeout(j), de.value = Date.now(), i.policy && i.policy.expiresAt > de.value && (j = setTimeout(
|
|
248
253
|
Be,
|
|
249
|
-
Math.min(
|
|
254
|
+
Math.min(i.policy.expiresAt - de.value + 1, 2147483647)
|
|
250
255
|
));
|
|
251
256
|
}
|
|
252
257
|
$(() => {
|
|
253
258
|
var e;
|
|
254
|
-
return (e =
|
|
259
|
+
return (e = i.policy) == null ? void 0 : e.expiresAt;
|
|
255
260
|
}, Be, { immediate: !0 });
|
|
256
261
|
function te() {
|
|
257
262
|
le("busy-change", {
|
|
258
|
-
uploading:
|
|
263
|
+
uploading: X.value,
|
|
259
264
|
requesting: Z.value
|
|
260
265
|
});
|
|
261
266
|
}
|
|
262
267
|
function $e() {
|
|
263
268
|
z();
|
|
264
|
-
for (const e of
|
|
265
|
-
|
|
269
|
+
for (const e of F) e.abort();
|
|
270
|
+
F.clear(), ce.clear(), h = null, A.value = null, E.value = !1, I.value = !1, oe.value = [], re.value = !1, X.value = 0, Z.value = 0, te();
|
|
266
271
|
}
|
|
267
272
|
$(
|
|
268
|
-
() =>
|
|
273
|
+
() => i.promptKey,
|
|
269
274
|
() => {
|
|
270
|
-
$e(), C.value = De(
|
|
275
|
+
$e(), C.value = De(i.modelValue), V.value = ne(i.modelValue), Y.value = 0;
|
|
271
276
|
},
|
|
272
277
|
{ flush: "sync" }
|
|
273
278
|
), $(
|
|
274
|
-
() => [
|
|
279
|
+
() => [i.modelValue, i.ackRevision],
|
|
275
280
|
([e, t]) => {
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
|
|
281
|
+
const n = ne(e);
|
|
282
|
+
if (n) {
|
|
283
|
+
V.value = n, f("PROMPT_DOCUMENT_INVALID", "输入的提示词文档无效", n);
|
|
279
284
|
return;
|
|
280
285
|
}
|
|
281
286
|
if (Ze(e) === Ze(C.value)) {
|
|
282
|
-
|
|
287
|
+
V.value = null;
|
|
283
288
|
return;
|
|
284
289
|
}
|
|
285
|
-
Y.value > 0 && (t || 0) < Y.value || (
|
|
290
|
+
Y.value > 0 && (t || 0) < Y.value || (V.value = null, C.value = we(e));
|
|
286
291
|
},
|
|
287
292
|
{ deep: !0 }
|
|
288
293
|
), Et(() => {
|
|
289
|
-
$e(), j && clearTimeout(j), Q == null || Q.disconnect(), window.removeEventListener("resize", ee), document.removeEventListener("click",
|
|
294
|
+
$e(), j && clearTimeout(j), Q == null || Q.disconnect(), window.removeEventListener("resize", ee), document.removeEventListener("click", xe);
|
|
290
295
|
});
|
|
291
|
-
function
|
|
296
|
+
function f(e, t, n = "doc") {
|
|
292
297
|
le("diagnostic", {
|
|
293
298
|
code: e,
|
|
294
299
|
message: t,
|
|
295
|
-
path:
|
|
300
|
+
path: n,
|
|
296
301
|
severity: "warning",
|
|
297
302
|
source: "validation"
|
|
298
303
|
});
|
|
299
304
|
}
|
|
300
|
-
function
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
305
|
+
function Te(e, t, n) {
|
|
306
|
+
if (O.value) return !1;
|
|
307
|
+
const a = { schemaVersion: 1, doc: e }, l = ne(a);
|
|
303
308
|
if (l)
|
|
304
|
-
return
|
|
305
|
-
var
|
|
306
|
-
return (
|
|
309
|
+
return f("PROMPT_DOCUMENT_INVALID", "编辑结果包含无效内容", l), ge(() => {
|
|
310
|
+
var r;
|
|
311
|
+
return (r = c.value) == null ? void 0 : r.restoreDoc(C.value.doc);
|
|
307
312
|
}), !1;
|
|
308
|
-
C.value =
|
|
309
|
-
const
|
|
310
|
-
return le("change",
|
|
311
|
-
promptKey:
|
|
312
|
-
revision:
|
|
313
|
+
C.value = a;
|
|
314
|
+
const o = ++Y.value;
|
|
315
|
+
return le("change", a, {
|
|
316
|
+
promptKey: i.promptKey,
|
|
317
|
+
revision: o,
|
|
313
318
|
origin: t,
|
|
314
|
-
...
|
|
315
|
-
}), le("update:modelValue",
|
|
319
|
+
...n ? { capabilityId: n } : {}
|
|
320
|
+
}), le("update:modelValue", a), !0;
|
|
316
321
|
}
|
|
317
322
|
function ct(e) {
|
|
318
|
-
const t =
|
|
319
|
-
|
|
323
|
+
const t = ke;
|
|
324
|
+
Te(e, (t == null ? void 0 : t.origin) || "user", t == null ? void 0 : t.capabilityId);
|
|
320
325
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
326
|
+
function M(e, t, n) {
|
|
327
|
+
ke = { origin: t, capabilityId: n };
|
|
323
328
|
try {
|
|
324
329
|
return e();
|
|
325
330
|
} finally {
|
|
326
|
-
|
|
331
|
+
ke = null;
|
|
327
332
|
}
|
|
328
333
|
}
|
|
329
334
|
function p(e, t) {
|
|
330
|
-
return
|
|
335
|
+
return f(e, t), { ok: !1, code: e, message: t };
|
|
331
336
|
}
|
|
332
337
|
function B() {
|
|
333
338
|
return { ok: !0, revision: Y.value };
|
|
334
339
|
}
|
|
335
340
|
function qe(e) {
|
|
336
|
-
const t = /* @__PURE__ */ new Set(),
|
|
337
|
-
var l,
|
|
338
|
-
e === "agentSizeChart" &&
|
|
341
|
+
const t = /* @__PURE__ */ new Set(), n = (a) => {
|
|
342
|
+
var l, o, r, u;
|
|
343
|
+
e === "agentSizeChart" && a.type === e && t.add(String(((l = a.attrs) == null ? void 0 : l.name) || "").trim()), e === "tableKnowledge" && ((o = a.attrs) == null ? void 0 : o.kind) === e && t.add(String(((r = a.attrs) == null ? void 0 : r.label) || "").trim()), (u = a.content) == null || u.forEach(n);
|
|
339
344
|
};
|
|
340
|
-
return
|
|
345
|
+
return n(C.value.doc), t;
|
|
341
346
|
}
|
|
342
347
|
function Ee(e, t) {
|
|
343
348
|
return {
|
|
344
|
-
promptKey:
|
|
349
|
+
promptKey: i.promptKey,
|
|
345
350
|
capabilityId: e,
|
|
346
351
|
requestId: `agent-prompt-${++lt}`,
|
|
347
352
|
signal: t.signal
|
|
348
353
|
};
|
|
349
354
|
}
|
|
350
355
|
async function fe(e) {
|
|
351
|
-
var
|
|
352
|
-
if (
|
|
353
|
-
const t =
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
+
var r, u, K;
|
|
357
|
+
if (O.value) return p("PROMPT_READONLY", "当前提示词不可编辑");
|
|
358
|
+
const t = i.promptKey;
|
|
359
|
+
let n = c.value;
|
|
360
|
+
if (n || (await ge(), n = c.value), !n || !await n.whenReady() || t !== i.promptKey)
|
|
356
361
|
return p("EDITOR_UNAVAILABLE", "提示词编辑器尚未就绪");
|
|
357
362
|
if (e.type === "text")
|
|
358
|
-
return e.text ?
|
|
359
|
-
() =>
|
|
363
|
+
return e.text ? M(
|
|
364
|
+
() => n.insertText(e.text, e.placement, e.selectInserted),
|
|
360
365
|
"api"
|
|
361
366
|
) ? B() : p("INSERT_FAILED", "文本插入失败") : p("EMPTY_TEXT", "插入文本不能为空");
|
|
362
367
|
if (e.type === "media") {
|
|
363
368
|
const { asset: s } = e;
|
|
364
|
-
if (!
|
|
369
|
+
if (!b(s.kind) || !Qe(s.url))
|
|
365
370
|
return p("MEDIA_INVALID", "媒体资源不可用");
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
371
|
+
const v = n.captureMediaTarget() || n.captureEndTarget();
|
|
372
|
+
if (!v) return p("INSERT_FAILED", "无法确定媒体插入位置");
|
|
368
373
|
try {
|
|
369
|
-
const
|
|
370
|
-
return
|
|
374
|
+
const L = n.insertMedia(s, e.name || "", v, !0);
|
|
375
|
+
return L && Te(L, "api", s.kind) ? B() : p("INSERT_FAILED", "媒体插入失败");
|
|
371
376
|
} finally {
|
|
372
|
-
|
|
377
|
+
v.dispose();
|
|
373
378
|
}
|
|
374
379
|
}
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
380
|
+
const a = e.capabilityId;
|
|
381
|
+
if (!b(a)) return p("CAPABILITY_DISABLED", "当前功能不可用");
|
|
377
382
|
const { option: l } = e;
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
380
|
-
if (
|
|
381
|
-
return
|
|
382
|
-
if (
|
|
383
|
-
const s = Number((
|
|
384
|
-
return !Number.isInteger(s) || s < 1 || s > 99 ? p("PAYMENT_INVALID", "小额打款金额必须为 1–99 整数元") :
|
|
385
|
-
() =>
|
|
383
|
+
if (a === "originalReply")
|
|
384
|
+
return M(() => n.insertOriginal(), "api", a) ? B() : p("INSERT_FAILED", "原话复述插入失败");
|
|
385
|
+
if (a === "separator")
|
|
386
|
+
return M(() => n.insertSeparator(), "api", a) ? B() : p("INSERT_FAILED", "分隔符插入失败");
|
|
387
|
+
if (a === "smallPayment") {
|
|
388
|
+
const s = Number((r = l == null ? void 0 : l.params) == null ? void 0 : r.amount);
|
|
389
|
+
return !Number.isInteger(s) || s < 1 || s > 99 ? p("PAYMENT_INVALID", "小额打款金额必须为 1–99 整数元") : M(
|
|
390
|
+
() => n.upsertToken("tool", "small_payment", "小额打款", {
|
|
386
391
|
amount: String(s)
|
|
387
392
|
}),
|
|
388
393
|
"api",
|
|
389
|
-
|
|
394
|
+
a
|
|
390
395
|
) ? B() : p("PAYMENT_INVALID", "小额打款金额必须为 1–99 整数元");
|
|
391
396
|
}
|
|
392
|
-
if (!((
|
|
397
|
+
if (!((u = l == null ? void 0 : l.label) != null && u.trim()) || !((K = l.id) != null && K.trim()))
|
|
393
398
|
return p("OPTION_INVALID", "请选择有效的功能选项");
|
|
394
|
-
if (
|
|
395
|
-
const s = qe("tableKnowledge"),
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
399
|
+
if (a === "tableKnowledge" || a === "sizeChart") {
|
|
400
|
+
const s = qe("tableKnowledge"), v = qe("agentSizeChart");
|
|
401
|
+
if (a === "tableKnowledge") {
|
|
402
|
+
if (v.size)
|
|
398
403
|
return p("TABLE_SIZE_CONFLICT", "表格知识与尺码表不能同时引用");
|
|
399
404
|
if (!s.has(l.label) && s.size >= 5)
|
|
400
405
|
return p("TABLE_LIMIT", "最多引用 5 个表格知识");
|
|
401
406
|
} else {
|
|
402
407
|
if (s.size)
|
|
403
408
|
return p("TABLE_SIZE_CONFLICT", "表格知识与尺码表不能同时引用");
|
|
404
|
-
if (!
|
|
409
|
+
if (!v.has(l.label) && v.size >= 4)
|
|
405
410
|
return p("SIZE_LIMIT", "最多引用 4 个尺码表");
|
|
406
411
|
}
|
|
407
412
|
}
|
|
408
|
-
return
|
|
409
|
-
() =>
|
|
413
|
+
return M(
|
|
414
|
+
() => a === "sizeChart" ? n.insertInlineNode("agentSizeChart", {
|
|
410
415
|
name: l.label.trim()
|
|
411
|
-
}) :
|
|
412
|
-
|
|
416
|
+
}) : n.insertToken(
|
|
417
|
+
a,
|
|
413
418
|
l.id,
|
|
414
419
|
l.label,
|
|
415
420
|
l.token,
|
|
416
421
|
l.params
|
|
417
422
|
),
|
|
418
423
|
"api",
|
|
419
|
-
|
|
424
|
+
a
|
|
420
425
|
) ? B() : p("INSERT_FAILED", "功能内容插入失败");
|
|
421
426
|
}
|
|
422
427
|
async function Ue(e) {
|
|
423
|
-
var
|
|
424
|
-
if (!
|
|
425
|
-
|
|
428
|
+
var a, l, o, r;
|
|
429
|
+
if (!he(e)) return;
|
|
430
|
+
h == null || h.abort(), A.value = e, oe.value = [];
|
|
426
431
|
const t = new AbortController();
|
|
427
|
-
|
|
428
|
-
const
|
|
432
|
+
h = t, F.add(t), Z.value++, re.value = !0, te();
|
|
433
|
+
const n = i.promptKey;
|
|
429
434
|
try {
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
{ search:
|
|
435
|
+
const u = e === "variable" ? await ((l = (a = i.ports) == null ? void 0 : a.listVariables) == null ? void 0 : l.call(
|
|
436
|
+
a,
|
|
437
|
+
{ search: J.value, limit: 50 },
|
|
433
438
|
Ee(e, t)
|
|
434
|
-
)) : await ((
|
|
435
|
-
|
|
436
|
-
{ capabilityId: e, search:
|
|
439
|
+
)) : await ((r = (o = i.ports) == null ? void 0 : o.listCapabilityOptions) == null ? void 0 : r.call(
|
|
440
|
+
o,
|
|
441
|
+
{ capabilityId: e, search: J.value, limit: 50 },
|
|
437
442
|
Ee(e, t)
|
|
438
443
|
));
|
|
439
|
-
if (t.signal.aborted ||
|
|
444
|
+
if (t.signal.aborted || n !== i.promptKey || A.value !== e)
|
|
440
445
|
return;
|
|
441
|
-
if (!(
|
|
442
|
-
|
|
446
|
+
if (!(u != null && u.ok)) {
|
|
447
|
+
f("OPTION_LOAD_FAILED", (u == null ? void 0 : u.error.message) || "选项加载失败");
|
|
443
448
|
return;
|
|
444
449
|
}
|
|
445
|
-
|
|
450
|
+
oe.value = u.data.items;
|
|
446
451
|
} catch {
|
|
447
|
-
t.signal.aborted ||
|
|
452
|
+
t.signal.aborted || f("OPTION_LOAD_FAILED", "选项加载失败");
|
|
448
453
|
} finally {
|
|
449
|
-
|
|
454
|
+
h === t && (h = null, re.value = !1), F.delete(t) && (Z.value = Math.max(0, Z.value - 1), te());
|
|
450
455
|
}
|
|
451
456
|
}
|
|
452
457
|
function dt(e) {
|
|
453
|
-
|
|
458
|
+
he(e) && (J.value = "", Ue(e));
|
|
454
459
|
}
|
|
455
460
|
function pt(e) {
|
|
456
|
-
const t =
|
|
457
|
-
t && (
|
|
461
|
+
const t = A.value;
|
|
462
|
+
t && (h == null || h.abort(), A.value = null, fe({
|
|
458
463
|
type: "capability",
|
|
459
464
|
capabilityId: t,
|
|
460
465
|
option: {
|
|
@@ -465,81 +470,81 @@ const Bt = {
|
|
|
465
470
|
}));
|
|
466
471
|
}
|
|
467
472
|
function z() {
|
|
468
|
-
|
|
473
|
+
_.value = null, P.value = null, se.value = !1, w == null || w.dispose(), w = null;
|
|
469
474
|
}
|
|
470
|
-
$(() =>
|
|
475
|
+
$(() => i.mediaSources, z, { deep: !0 });
|
|
471
476
|
function ft(e, t) {
|
|
472
|
-
var
|
|
473
|
-
const
|
|
477
|
+
var o, r, u;
|
|
478
|
+
const n = be(i.mediaSources, e).filter(
|
|
474
479
|
(K) => {
|
|
475
480
|
var s;
|
|
476
|
-
return K !== "local" || !!((s =
|
|
481
|
+
return K !== "local" || !!((s = i.ports) != null && s.uploadMedia);
|
|
477
482
|
}
|
|
478
483
|
);
|
|
479
|
-
if (!
|
|
480
|
-
if (at(e), w = ((
|
|
481
|
-
|
|
484
|
+
if (!b(e) || !n.length) return;
|
|
485
|
+
if (at(e), w = ((o = c.value) == null ? void 0 : o.captureMediaTarget()) || ((r = c.value) == null ? void 0 : r.captureEndTarget()) || null, !w) {
|
|
486
|
+
f("EDITOR_UNAVAILABLE", "无法确定媒体插入位置");
|
|
482
487
|
return;
|
|
483
488
|
}
|
|
484
|
-
if (
|
|
485
|
-
Ye(e,
|
|
489
|
+
if (n.length === 1) {
|
|
490
|
+
Ye(e, n[0]);
|
|
486
491
|
return;
|
|
487
492
|
}
|
|
488
|
-
const
|
|
493
|
+
const a = t.currentTarget.getBoundingClientRect(), l = (u = ie.value) == null ? void 0 : u.getBoundingClientRect();
|
|
489
494
|
Pe.value = {
|
|
490
495
|
left: `${Math.max(
|
|
491
496
|
8,
|
|
492
497
|
Math.min(
|
|
493
|
-
|
|
498
|
+
a.left - ((l == null ? void 0 : l.left) || 0),
|
|
494
499
|
((l == null ? void 0 : l.width) || 240) - 116
|
|
495
500
|
)
|
|
496
501
|
)}px`,
|
|
497
|
-
top: `${
|
|
498
|
-
},
|
|
502
|
+
top: `${a.bottom - ((l == null ? void 0 : l.top) || 0) + 4}px`
|
|
503
|
+
}, _.value = e;
|
|
499
504
|
}
|
|
500
505
|
function Ye(e, t) {
|
|
501
|
-
if (
|
|
506
|
+
if (_.value = null, t === "online" || t === "qianniu") {
|
|
502
507
|
se.value = t === "qianniu", P.value = e;
|
|
503
508
|
return;
|
|
504
509
|
}
|
|
505
510
|
ue.value && (ue.value.accept = e === "image" ? "image/png,image/jpeg" : "video/mp4", ue.value.click());
|
|
506
511
|
}
|
|
507
512
|
function vt(e) {
|
|
508
|
-
const t =
|
|
513
|
+
const t = _.value;
|
|
509
514
|
t && Ye(t, e);
|
|
510
515
|
}
|
|
511
516
|
function He(e, t) {
|
|
512
517
|
var l;
|
|
513
|
-
const
|
|
514
|
-
if (w = null, P.value = null, se.value = !1, !(!
|
|
518
|
+
const n = P.value, a = w;
|
|
519
|
+
if (w = null, P.value = null, se.value = !1, !(!n || !a))
|
|
515
520
|
try {
|
|
516
|
-
if (!
|
|
517
|
-
|
|
521
|
+
if (!b(n) || a.status() !== "ready") {
|
|
522
|
+
f("INSERT_TARGET_LOST", "媒体插入位置已失效");
|
|
518
523
|
return;
|
|
519
524
|
}
|
|
520
|
-
const
|
|
525
|
+
const o = (l = c.value) == null ? void 0 : l.insertMedia(
|
|
521
526
|
{
|
|
522
|
-
kind:
|
|
527
|
+
kind: n,
|
|
523
528
|
url: e,
|
|
524
529
|
...t ? { id: t, sourceType: "qianniuVideo" } : {}
|
|
525
530
|
},
|
|
526
531
|
"",
|
|
527
|
-
|
|
532
|
+
a,
|
|
528
533
|
!0
|
|
529
534
|
);
|
|
530
|
-
(!
|
|
535
|
+
(!o || !Te(o, "api", n)) && f("INSERT_FAILED", "在线媒体插入失败");
|
|
531
536
|
} finally {
|
|
532
|
-
|
|
537
|
+
a.dispose();
|
|
533
538
|
}
|
|
534
539
|
}
|
|
535
540
|
function mt() {
|
|
536
|
-
if (!
|
|
537
|
-
|
|
541
|
+
if (!b("smallPayment")) return;
|
|
542
|
+
W.value = null;
|
|
538
543
|
const e = (t) => {
|
|
539
|
-
var
|
|
540
|
-
t.type === "businessToken" && ((
|
|
544
|
+
var n, a, l;
|
|
545
|
+
t.type === "businessToken" && ((n = t.attrs) == null ? void 0 : n.kind) === "tool" && t.attrs.key === "small_payment" && (W.value = Number((a = t.attrs.params) == null ? void 0 : a.amount)), (l = t.content) == null || l.forEach(e);
|
|
541
546
|
};
|
|
542
|
-
e(C.value.doc),
|
|
547
|
+
e(C.value.doc), I.value = !0, A.value = null;
|
|
543
548
|
}
|
|
544
549
|
async function gt() {
|
|
545
550
|
(await fe({
|
|
@@ -548,381 +553,391 @@ const Bt = {
|
|
|
548
553
|
option: {
|
|
549
554
|
id: "small_payment",
|
|
550
555
|
label: "小额打款",
|
|
551
|
-
params: { amount:
|
|
556
|
+
params: { amount: W.value }
|
|
552
557
|
}
|
|
553
|
-
})).ok && (
|
|
558
|
+
})).ok && (I.value = !1);
|
|
554
559
|
}
|
|
555
|
-
function
|
|
556
|
-
var
|
|
560
|
+
function Me(e, t) {
|
|
561
|
+
var o;
|
|
557
562
|
if (!e.length || e.length > je) {
|
|
558
|
-
t == null || t.dispose(),
|
|
563
|
+
t == null || t.dispose(), f("INVALID_MEDIA", `一次最多添加 ${je} 个媒体文件`);
|
|
559
564
|
return;
|
|
560
565
|
}
|
|
561
|
-
const
|
|
562
|
-
var
|
|
566
|
+
const n = e.map((r) => {
|
|
567
|
+
var u;
|
|
563
568
|
return {
|
|
564
|
-
file:
|
|
565
|
-
kind: (
|
|
569
|
+
file: r,
|
|
570
|
+
kind: (u = Nt(r)) == null ? void 0 : u.kind
|
|
566
571
|
};
|
|
567
572
|
});
|
|
568
|
-
if (
|
|
569
|
-
({ file:
|
|
573
|
+
if (n.some(
|
|
574
|
+
({ file: r, kind: u }) => !u || !b(u) || r.size > Pt[u]
|
|
570
575
|
)) {
|
|
571
|
-
t == null || t.dispose(),
|
|
576
|
+
t == null || t.dispose(), f("INVALID_MEDIA", "仅支持符合大小限制的 JPG、PNG、MP4 文件");
|
|
572
577
|
return;
|
|
573
578
|
}
|
|
574
|
-
if (!((
|
|
575
|
-
t == null || t.dispose(),
|
|
579
|
+
if (!((o = i.ports) != null && o.uploadMedia) || !t || !c.value) {
|
|
580
|
+
t == null || t.dispose(), f("UPLOAD_UNAVAILABLE", "上传功能不可用");
|
|
576
581
|
return;
|
|
577
582
|
}
|
|
578
|
-
const
|
|
583
|
+
const a = n, l = M(
|
|
579
584
|
() => {
|
|
580
|
-
var
|
|
581
|
-
return ((
|
|
585
|
+
var r;
|
|
586
|
+
return ((r = c.value) == null ? void 0 : r.insertPendingMediaBatch(a, t)) || null;
|
|
582
587
|
},
|
|
583
588
|
"plugin",
|
|
584
|
-
|
|
589
|
+
a[0].kind
|
|
585
590
|
);
|
|
586
|
-
if (t.dispose(), !l || l.length !==
|
|
587
|
-
|
|
591
|
+
if (t.dispose(), !l || l.length !== a.length) {
|
|
592
|
+
f("INSERT_FAILED", "无法插入待上传的媒体");
|
|
588
593
|
return;
|
|
589
594
|
}
|
|
590
|
-
l.forEach((
|
|
591
|
-
ce.set(
|
|
595
|
+
l.forEach((r, u) => {
|
|
596
|
+
ce.set(r, a[u].file), Ge(r, a[u].file, a[u].kind);
|
|
592
597
|
});
|
|
593
598
|
}
|
|
594
|
-
async function
|
|
595
|
-
var
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
599
|
+
async function Ge(e, t, n) {
|
|
600
|
+
var r, u, K;
|
|
601
|
+
const a = (r = i.ports) == null ? void 0 : r.uploadMedia;
|
|
602
|
+
if (!a) return;
|
|
598
603
|
const l = new AbortController();
|
|
599
|
-
|
|
600
|
-
const
|
|
604
|
+
F.add(l), X.value++, te();
|
|
605
|
+
const o = i.promptKey;
|
|
601
606
|
try {
|
|
602
|
-
const s = await
|
|
603
|
-
if (l.signal.aborted ||
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
if (!s.ok || !Qe(s.data.url) || s.data.kind !==
|
|
607
|
-
|
|
607
|
+
const s = await a({ file: t, kind: n }, Ee(n, l));
|
|
608
|
+
if (l.signal.aborted || o !== i.promptKey) return;
|
|
609
|
+
const v = (u = c.value) == null ? void 0 : u.getMediaState(e);
|
|
610
|
+
if (!v || v.status !== "uploading") return;
|
|
611
|
+
if (!s.ok || !Qe(s.data.url) || s.data.kind !== n) {
|
|
612
|
+
f(
|
|
608
613
|
"UPLOAD_FAILED",
|
|
609
614
|
s.ok ? "上传资源无效" : s.error.message
|
|
610
|
-
),
|
|
615
|
+
), M(
|
|
611
616
|
() => {
|
|
612
|
-
var
|
|
613
|
-
return (
|
|
617
|
+
var L;
|
|
618
|
+
return (L = c.value) == null ? void 0 : L.failMedia(e, "上传失败", v.nodeVersion);
|
|
614
619
|
},
|
|
615
620
|
"plugin",
|
|
616
|
-
|
|
621
|
+
n
|
|
617
622
|
);
|
|
618
623
|
return;
|
|
619
624
|
}
|
|
620
|
-
if (!
|
|
621
|
-
|
|
625
|
+
if (!b(n)) {
|
|
626
|
+
M(
|
|
622
627
|
() => {
|
|
623
|
-
var
|
|
624
|
-
return (
|
|
628
|
+
var L;
|
|
629
|
+
return (L = c.value) == null ? void 0 : L.failMedia(e, "当前无媒体权限", v.nodeVersion);
|
|
625
630
|
},
|
|
626
631
|
"plugin",
|
|
627
|
-
|
|
632
|
+
n
|
|
628
633
|
);
|
|
629
634
|
return;
|
|
630
635
|
}
|
|
631
|
-
|
|
636
|
+
M(
|
|
632
637
|
() => {
|
|
633
|
-
var
|
|
634
|
-
return ((
|
|
638
|
+
var L;
|
|
639
|
+
return ((L = c.value) == null ? void 0 : L.completeMedia(e, v.nodeVersion, s.data)) || !1;
|
|
635
640
|
},
|
|
636
641
|
"plugin",
|
|
637
|
-
|
|
642
|
+
n
|
|
638
643
|
) && ce.delete(e);
|
|
639
644
|
} catch {
|
|
640
645
|
if (!l.signal.aborted) {
|
|
641
646
|
const s = (K = c.value) == null ? void 0 : K.getMediaState(e);
|
|
642
|
-
(s == null ? void 0 : s.status) === "uploading" &&
|
|
647
|
+
(s == null ? void 0 : s.status) === "uploading" && M(
|
|
643
648
|
() => {
|
|
644
|
-
var
|
|
645
|
-
return (
|
|
649
|
+
var v;
|
|
650
|
+
return (v = c.value) == null ? void 0 : v.failMedia(e, "上传失败", s.nodeVersion);
|
|
646
651
|
},
|
|
647
652
|
"plugin",
|
|
648
|
-
|
|
649
|
-
),
|
|
653
|
+
n
|
|
654
|
+
), f("UPLOAD_FAILED", "媒体上传失败");
|
|
650
655
|
}
|
|
651
656
|
} finally {
|
|
652
|
-
|
|
657
|
+
F.delete(l) && (X.value = Math.max(0, X.value - 1), te());
|
|
653
658
|
}
|
|
654
659
|
}
|
|
655
660
|
function bt(e) {
|
|
656
|
-
var
|
|
657
|
-
const t = ce.get(e),
|
|
658
|
-
!t || !
|
|
661
|
+
var a;
|
|
662
|
+
const t = ce.get(e), n = (a = c.value) == null ? void 0 : a.getMediaState(e);
|
|
663
|
+
!t || !n || n.status !== "error" || !b(n.kind) || M(
|
|
659
664
|
() => {
|
|
660
665
|
var l;
|
|
661
|
-
return (l = c.value) == null ? void 0 : l.retryMedia(e,
|
|
666
|
+
return (l = c.value) == null ? void 0 : l.retryMedia(e, n.nodeVersion);
|
|
662
667
|
},
|
|
663
668
|
"plugin",
|
|
664
|
-
|
|
665
|
-
) &&
|
|
669
|
+
n.kind
|
|
670
|
+
) && Ge(e, t, n.kind);
|
|
666
671
|
}
|
|
667
672
|
async function yt(e) {
|
|
668
|
-
var
|
|
673
|
+
var a, l, o;
|
|
669
674
|
const t = Array.from(e.target.files || []);
|
|
670
675
|
e.target.value = "";
|
|
671
|
-
const
|
|
676
|
+
const n = w;
|
|
672
677
|
if (w = null, t.length) {
|
|
673
|
-
const
|
|
674
|
-
if (!await ((
|
|
675
|
-
|
|
678
|
+
const r = i.promptKey;
|
|
679
|
+
if (!await ((a = c.value) == null ? void 0 : a.whenReady()) || r !== i.promptKey) {
|
|
680
|
+
n == null || n.dispose();
|
|
676
681
|
return;
|
|
677
682
|
}
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
} else
|
|
681
|
-
}
|
|
682
|
-
function
|
|
683
|
-
var
|
|
684
|
-
const t = Array.from(((
|
|
685
|
-
if (!t.length ||
|
|
683
|
+
const u = n || ((l = c.value) == null ? void 0 : l.captureMediaTarget()) || ((o = c.value) == null ? void 0 : o.captureEndTarget());
|
|
684
|
+
Me(t, u || null);
|
|
685
|
+
} else n == null || n.dispose();
|
|
686
|
+
}
|
|
687
|
+
function kt(e) {
|
|
688
|
+
var a, l, o, r;
|
|
689
|
+
const t = Array.from(((a = e.clipboardData) == null ? void 0 : a.files) || []);
|
|
690
|
+
if (!t.length || O.value) return;
|
|
686
691
|
e.preventDefault();
|
|
687
|
-
const
|
|
688
|
-
|
|
692
|
+
const n = ((l = c.value) == null ? void 0 : l.pasteClipboardContent(e)) || ((o = c.value) == null ? void 0 : o.captureMediaTarget()) || ((r = c.value) == null ? void 0 : r.captureEndTarget());
|
|
693
|
+
n && Me(t, n);
|
|
689
694
|
}
|
|
690
695
|
function At(e) {
|
|
691
|
-
var
|
|
692
|
-
const t = Array.from(((
|
|
693
|
-
if (!t.length ||
|
|
696
|
+
var a, l, o;
|
|
697
|
+
const t = Array.from(((a = e.dataTransfer) == null ? void 0 : a.files) || []);
|
|
698
|
+
if (!t.length || O.value) return;
|
|
694
699
|
e.preventDefault();
|
|
695
|
-
const
|
|
696
|
-
|
|
700
|
+
const n = ((l = c.value) == null ? void 0 : l.captureMediaTargetAt(e.clientX, e.clientY)) || ((o = c.value) == null ? void 0 : o.captureEndTarget());
|
|
701
|
+
n && Me(t, n);
|
|
697
702
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
703
|
+
function ht() {
|
|
704
|
+
return Rt(C.value, i.maxLength);
|
|
700
705
|
}
|
|
701
|
-
return
|
|
706
|
+
return g({
|
|
702
707
|
insertContent: fe,
|
|
708
|
+
validateTagValidity: async () => {
|
|
709
|
+
var e;
|
|
710
|
+
return ((e = c.value) == null ? void 0 : e.validateTagValidity()) || { status: "unavailable", items: [] };
|
|
711
|
+
},
|
|
703
712
|
focus: () => {
|
|
704
713
|
var e;
|
|
705
714
|
return (e = c.value) == null ? void 0 : e.focus();
|
|
706
715
|
},
|
|
707
|
-
validate:
|
|
708
|
-
}), (e, t) =>
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
ref_key: "toolbar",
|
|
721
|
-
ref: ye,
|
|
722
|
-
class: "fkp-scene-toolbar fkp-agent-prompt-toolbar",
|
|
723
|
-
role: "toolbar",
|
|
724
|
-
"aria-label": "提示词工具栏"
|
|
716
|
+
validate: ht
|
|
717
|
+
}), (e, t) => {
|
|
718
|
+
var n;
|
|
719
|
+
return m(), y("section", {
|
|
720
|
+
ref_key: "root",
|
|
721
|
+
ref: ie,
|
|
722
|
+
class: Lt(["fkp-rich-text fkp-agent-prompt-editor", {
|
|
723
|
+
"has-open-menu": !!A.value || I.value || E.value || !!_.value
|
|
724
|
+
}]),
|
|
725
|
+
"aria-label": "Agent 提示词编辑器",
|
|
726
|
+
onKeydown: t[12] || (t[12] = Mt(ae((a) => {
|
|
727
|
+
x(), I.value = !1, E.value = !1, z();
|
|
728
|
+
}, ["stop"]), ["esc"]))
|
|
725
729
|
}, [
|
|
726
|
-
|
|
727
|
-
ref_key: "
|
|
728
|
-
ref:
|
|
729
|
-
class: "fkp-toolbar
|
|
730
|
+
k("div", {
|
|
731
|
+
ref_key: "toolbar",
|
|
732
|
+
ref: ye,
|
|
733
|
+
class: "fkp-scene-toolbar fkp-agent-prompt-toolbar",
|
|
734
|
+
role: "toolbar",
|
|
735
|
+
"aria-label": "提示词工具栏"
|
|
730
736
|
}, [
|
|
731
|
-
(
|
|
732
|
-
|
|
737
|
+
k("div", {
|
|
738
|
+
ref_key: "toolbarLeft",
|
|
739
|
+
ref: H,
|
|
740
|
+
class: "fkp-toolbar-groups fkp-agent-prompt-toolbar-left"
|
|
733
741
|
}, [
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
a.
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
"aria-expanded": M.value,
|
|
776
|
-
onMousedown: t[1] || (t[1] = ae(() => {
|
|
777
|
-
}, ["prevent"])),
|
|
778
|
-
onClick: t[2] || (t[2] = (a) => M.value = !M.value)
|
|
779
|
-
}, {
|
|
780
|
-
default: me(() => [
|
|
781
|
-
x(I(Se), {
|
|
782
|
-
name: "more",
|
|
783
|
-
size: 16
|
|
784
|
-
})
|
|
785
|
-
]),
|
|
786
|
-
_: 1
|
|
787
|
-
}, 8, ["aria-expanded"]),
|
|
788
|
-
M.value ? (v(), b("div", qt, [
|
|
789
|
-
(v(!0), b(ve, null, Le(Ae.value, (a) => (v(), We(I(Ce), {
|
|
790
|
-
key: a.id,
|
|
791
|
-
class: "fkp-agent-prompt-more-item",
|
|
742
|
+
(m(!0), y(ve, null, Le(ze.value, (a, l) => (m(), y(ve, {
|
|
743
|
+
key: a.id
|
|
744
|
+
}, [
|
|
745
|
+
l > 0 && a.group !== ze.value[l - 1].group ? (m(), y("span", Bt)) : q("", !0),
|
|
746
|
+
R(T(_t), {
|
|
747
|
+
trigger: "hover",
|
|
748
|
+
position: "bottom",
|
|
749
|
+
content: a.label,
|
|
750
|
+
"popup-visible": T(tt) === a.id || a.id === "video" && T(be)(e.mediaSources, "video").includes("qianniu") || _.value === a.id || P.value === a.id ? !1 : void 0
|
|
751
|
+
}, {
|
|
752
|
+
default: me(() => [
|
|
753
|
+
R(T(Ce), {
|
|
754
|
+
class: "fkp-tool-button fkp-agent-prompt-tool",
|
|
755
|
+
type: "text",
|
|
756
|
+
"data-fkp-menu-trigger": a.id,
|
|
757
|
+
"aria-label": a.label,
|
|
758
|
+
disabled: !Ie(a.id),
|
|
759
|
+
onMouseenter: (o) => T(nt)(
|
|
760
|
+
a.id,
|
|
761
|
+
!!_.value || !!P.value
|
|
762
|
+
),
|
|
763
|
+
onMousedown: t[0] || (t[0] = ae(() => {
|
|
764
|
+
}, ["prevent"])),
|
|
765
|
+
onClick: (o) => Re(a.id, o)
|
|
766
|
+
}, {
|
|
767
|
+
default: me(() => [
|
|
768
|
+
R(T(_e), {
|
|
769
|
+
name: a.icon,
|
|
770
|
+
size: 16
|
|
771
|
+
}, null, 8, ["name"])
|
|
772
|
+
]),
|
|
773
|
+
_: 2
|
|
774
|
+
}, 1032, ["data-fkp-menu-trigger", "aria-label", "disabled", "onMouseenter", "onClick"])
|
|
775
|
+
]),
|
|
776
|
+
_: 2
|
|
777
|
+
}, 1032, ["content", "popup-visible"])
|
|
778
|
+
], 64))), 128))
|
|
779
|
+
], 512),
|
|
780
|
+
Ae.value.length ? (m(), y("div", $t, [
|
|
781
|
+
R(T(Ce), {
|
|
782
|
+
class: "fkp-more-button",
|
|
792
783
|
type: "text",
|
|
793
|
-
|
|
794
|
-
"
|
|
795
|
-
|
|
796
|
-
onMousedown: t[
|
|
784
|
+
"aria-label": "更多操作",
|
|
785
|
+
"aria-haspopup": "menu",
|
|
786
|
+
"aria-expanded": E.value,
|
|
787
|
+
onMousedown: t[1] || (t[1] = ae(() => {
|
|
797
788
|
}, ["prevent"])),
|
|
798
|
-
onClick: (
|
|
789
|
+
onClick: t[2] || (t[2] = (a) => E.value = !E.value)
|
|
799
790
|
}, {
|
|
800
791
|
default: me(() => [
|
|
801
|
-
|
|
802
|
-
name:
|
|
792
|
+
R(T(_e), {
|
|
793
|
+
name: "more",
|
|
803
794
|
size: 16
|
|
804
|
-
}
|
|
805
|
-
_e(U(a.label), 1)
|
|
795
|
+
})
|
|
806
796
|
]),
|
|
807
|
-
_:
|
|
808
|
-
},
|
|
809
|
-
|
|
797
|
+
_: 1
|
|
798
|
+
}, 8, ["aria-expanded"]),
|
|
799
|
+
E.value ? (m(), y("div", qt, [
|
|
800
|
+
(m(!0), y(ve, null, Le(Ae.value, (a) => (m(), Je(T(Ce), {
|
|
801
|
+
key: a.id,
|
|
802
|
+
class: "fkp-agent-prompt-more-item",
|
|
803
|
+
type: "text",
|
|
804
|
+
role: "menuitem",
|
|
805
|
+
"data-fkp-menu-trigger": a.id,
|
|
806
|
+
disabled: !Ie(a.id),
|
|
807
|
+
onMousedown: t[3] || (t[3] = ae(() => {
|
|
808
|
+
}, ["prevent"])),
|
|
809
|
+
onClick: (l) => Re(a.id, l)
|
|
810
|
+
}, {
|
|
811
|
+
default: me(() => [
|
|
812
|
+
R(T(_e), {
|
|
813
|
+
name: a.icon,
|
|
814
|
+
size: 16
|
|
815
|
+
}, null, 8, ["name"]),
|
|
816
|
+
Se(U(a.label), 1)
|
|
817
|
+
]),
|
|
818
|
+
_: 2
|
|
819
|
+
}, 1032, ["data-fkp-menu-trigger", "disabled", "onClick"]))), 128))
|
|
820
|
+
])) : q("", !0)
|
|
821
|
+
])) : q("", !0),
|
|
822
|
+
k("div", Ut, [
|
|
823
|
+
St(e.$slots, "toolbar-action")
|
|
824
|
+
]),
|
|
825
|
+
k("input", {
|
|
826
|
+
ref_key: "fileInput",
|
|
827
|
+
ref: ue,
|
|
828
|
+
type: "file",
|
|
829
|
+
hidden: "",
|
|
830
|
+
onChange: yt
|
|
831
|
+
}, null, 544)
|
|
832
|
+
], 512),
|
|
833
|
+
R(Dt, {
|
|
834
|
+
"menu-kind": _.value,
|
|
835
|
+
"dialog-kind": P.value,
|
|
836
|
+
"qianniu-dialog": se.value,
|
|
837
|
+
"menu-style": Pe.value,
|
|
838
|
+
sources: _.value ? T(be)(e.mediaSources, _.value).filter(
|
|
839
|
+
(a) => {
|
|
840
|
+
var l;
|
|
841
|
+
return a !== "local" || !!((l = e.ports) != null && l.uploadMedia);
|
|
842
|
+
}
|
|
843
|
+
) : [],
|
|
844
|
+
onChoose: vt,
|
|
845
|
+
onSubmit: He,
|
|
846
|
+
onSubmitQianniu: t[4] || (t[4] = ({ id: a, url: l }) => He(l, a)),
|
|
847
|
+
onClose: z
|
|
848
|
+
}, null, 8, ["menu-kind", "dialog-kind", "qianniu-dialog", "menu-style", "sources"]),
|
|
849
|
+
A.value ? (m(), y("div", {
|
|
850
|
+
key: 0,
|
|
851
|
+
class: "fkp-agent-prompt-options",
|
|
852
|
+
style: Ct({ left: `${Ne.value}px` })
|
|
853
|
+
}, [
|
|
854
|
+
k("label", null, [
|
|
855
|
+
Se(" 搜索" + U(Ke.value) + " ", 1),
|
|
856
|
+
We(k("input", {
|
|
857
|
+
"onUpdate:modelValue": t[5] || (t[5] = (a) => J.value = a),
|
|
858
|
+
type: "search",
|
|
859
|
+
"aria-label": `搜索${Ke.value}`,
|
|
860
|
+
onInput: t[6] || (t[6] = (a) => Ue(A.value))
|
|
861
|
+
}, null, 40, Yt), [
|
|
862
|
+
[Xe, J.value]
|
|
863
|
+
])
|
|
864
|
+
]),
|
|
865
|
+
k("button", {
|
|
866
|
+
type: "button",
|
|
867
|
+
"aria-label": "关闭选项",
|
|
868
|
+
onClick: x
|
|
869
|
+
}, "×"),
|
|
870
|
+
re.value ? (m(), y("p", Ht, "加载中…")) : (m(), y("ul", Gt, [
|
|
871
|
+
(m(!0), y(ve, null, Le(oe.value, (a) => (m(), y("li", {
|
|
872
|
+
key: a.id
|
|
873
|
+
}, [
|
|
874
|
+
k("button", {
|
|
875
|
+
type: "button",
|
|
876
|
+
disabled: a.disabled,
|
|
877
|
+
onMousedown: t[7] || (t[7] = ae(() => {
|
|
878
|
+
}, ["prevent"])),
|
|
879
|
+
onClick: (l) => pt(a)
|
|
880
|
+
}, U(a.label), 41, Jt)
|
|
881
|
+
]))), 128))
|
|
882
|
+
]))
|
|
883
|
+
], 4)) : q("", !0),
|
|
884
|
+
I.value ? (m(), y("div", Wt, [
|
|
885
|
+
k("label", null, [
|
|
886
|
+
t[13] || (t[13] = Se(" 小额打款金额(元) ")),
|
|
887
|
+
We(k("input", {
|
|
888
|
+
"onUpdate:modelValue": t[8] || (t[8] = (a) => W.value = a),
|
|
889
|
+
type: "number",
|
|
890
|
+
min: "1",
|
|
891
|
+
max: "99",
|
|
892
|
+
step: "1"
|
|
893
|
+
}, null, 512), [
|
|
894
|
+
[
|
|
895
|
+
Xe,
|
|
896
|
+
W.value,
|
|
897
|
+
void 0,
|
|
898
|
+
{ number: !0 }
|
|
899
|
+
]
|
|
900
|
+
])
|
|
901
|
+
]),
|
|
902
|
+
k("button", {
|
|
903
|
+
type: "button",
|
|
904
|
+
onClick: t[9] || (t[9] = (a) => I.value = !1)
|
|
905
|
+
}, "取消"),
|
|
906
|
+
k("button", {
|
|
907
|
+
type: "button",
|
|
908
|
+
onClick: gt
|
|
909
|
+
}, "确认")
|
|
810
910
|
])) : q("", !0),
|
|
811
|
-
y("
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
onClose: z
|
|
837
|
-
}, null, 8, ["menu-kind", "dialog-kind", "qianniu-dialog", "menu-style", "sources"]),
|
|
838
|
-
h.value ? (v(), b("div", {
|
|
839
|
-
key: 0,
|
|
840
|
-
class: "fkp-agent-prompt-options",
|
|
841
|
-
style: Ct({ left: `${Ne.value}px` })
|
|
842
|
-
}, [
|
|
843
|
-
y("label", null, [
|
|
844
|
-
_e(" 搜索" + U(Ke.value) + " ", 1),
|
|
845
|
-
Xe(y("input", {
|
|
846
|
-
"onUpdate:modelValue": t[5] || (t[5] = (a) => W.value = a),
|
|
847
|
-
type: "search",
|
|
848
|
-
"aria-label": `搜索${Ke.value}`,
|
|
849
|
-
onInput: t[6] || (t[6] = (a) => Ue(h.value))
|
|
850
|
-
}, null, 40, Yt), [
|
|
851
|
-
[Ge, W.value]
|
|
852
|
-
])
|
|
853
|
-
]),
|
|
854
|
-
y("button", {
|
|
855
|
-
type: "button",
|
|
856
|
-
"aria-label": "关闭选项",
|
|
857
|
-
onClick: F
|
|
858
|
-
}, "×"),
|
|
859
|
-
re.value ? (v(), b("p", Ht, "加载中…")) : (v(), b("ul", Jt, [
|
|
860
|
-
(v(!0), b(ve, null, Le(ie.value, (a) => (v(), b("li", {
|
|
861
|
-
key: a.id
|
|
862
|
-
}, [
|
|
863
|
-
y("button", {
|
|
864
|
-
type: "button",
|
|
865
|
-
disabled: a.disabled,
|
|
866
|
-
onMousedown: t[7] || (t[7] = ae(() => {
|
|
867
|
-
}, ["prevent"])),
|
|
868
|
-
onClick: (n) => pt(a)
|
|
869
|
-
}, U(a.label), 41, Wt)
|
|
870
|
-
]))), 128))
|
|
871
|
-
]))
|
|
872
|
-
], 4)) : q("", !0),
|
|
873
|
-
k.value ? (v(), b("div", Xt, [
|
|
874
|
-
y("label", null, [
|
|
875
|
-
t[12] || (t[12] = _e(" 小额打款金额(元) ")),
|
|
876
|
-
Xe(y("input", {
|
|
877
|
-
"onUpdate:modelValue": t[8] || (t[8] = (a) => X.value = a),
|
|
878
|
-
type: "number",
|
|
879
|
-
min: "1",
|
|
880
|
-
max: "99",
|
|
881
|
-
step: "1"
|
|
882
|
-
}, null, 512), [
|
|
883
|
-
[
|
|
884
|
-
Ge,
|
|
885
|
-
X.value,
|
|
886
|
-
void 0,
|
|
887
|
-
{ number: !0 }
|
|
888
|
-
]
|
|
889
|
-
])
|
|
890
|
-
]),
|
|
891
|
-
y("button", {
|
|
892
|
-
type: "button",
|
|
893
|
-
onClick: t[9] || (t[9] = (a) => k.value = !1)
|
|
894
|
-
}, "取消"),
|
|
895
|
-
y("button", {
|
|
896
|
-
type: "button",
|
|
897
|
-
onClick: gt
|
|
898
|
-
}, "确认")
|
|
899
|
-
])) : q("", !0),
|
|
900
|
-
O.value ? (v(), b("p", Gt, "提示词文档无效:" + U(O.value), 1)) : q("", !0),
|
|
901
|
-
(v(), We(Ot, {
|
|
902
|
-
key: e.promptKey,
|
|
903
|
-
ref_key: "area",
|
|
904
|
-
ref: c,
|
|
905
|
-
"model-value": C.value.doc,
|
|
906
|
-
editable: !V.value,
|
|
907
|
-
placeholder: e.placeholder,
|
|
908
|
-
"schema-plan": rt,
|
|
909
|
-
"paste-capabilities": ut.value,
|
|
910
|
-
"document-adapter": I(it),
|
|
911
|
-
"onUpdate:modelValue": ct,
|
|
912
|
-
onLoadError: t[10] || (t[10] = (a) => m("EDITOR_LOAD_FAILED", a)),
|
|
913
|
-
onRetryMedia: bt,
|
|
914
|
-
onPasteCapture: ht,
|
|
915
|
-
onDropCapture: At
|
|
916
|
-
}, null, 8, ["model-value", "editable", "placeholder", "paste-capabilities", "document-adapter"])),
|
|
917
|
-
y("div", Zt, [
|
|
918
|
-
y("span", null, U(st.value) + "/" + U(e.maxLength), 1)
|
|
919
|
-
])
|
|
920
|
-
], 34));
|
|
911
|
+
V.value ? (m(), y("p", Xt, "提示词文档无效:" + U(V.value), 1)) : q("", !0),
|
|
912
|
+
(m(), Je(Vt, {
|
|
913
|
+
key: e.promptKey,
|
|
914
|
+
ref_key: "area",
|
|
915
|
+
ref: c,
|
|
916
|
+
"model-value": C.value.doc,
|
|
917
|
+
"tag-validity-port": (n = e.ports) == null ? void 0 : n.validateTags,
|
|
918
|
+
"tag-validity-key": e.promptKey,
|
|
919
|
+
editable: !O.value,
|
|
920
|
+
placeholder: e.placeholder,
|
|
921
|
+
"schema-plan": rt,
|
|
922
|
+
"paste-capabilities": ut.value,
|
|
923
|
+
"document-adapter": T(ot),
|
|
924
|
+
"onUpdate:modelValue": ct,
|
|
925
|
+
onLoadError: t[10] || (t[10] = (a) => f("EDITOR_LOAD_FAILED", a)),
|
|
926
|
+
onTagValidityError: t[11] || (t[11] = (a) => f("TAG_VALIDITY_FAILED", a)),
|
|
927
|
+
onRetryMedia: bt,
|
|
928
|
+
onPasteCapture: kt,
|
|
929
|
+
onDropCapture: At
|
|
930
|
+
}, null, 8, ["model-value", "tag-validity-port", "tag-validity-key", "editable", "placeholder", "paste-capabilities", "document-adapter"])),
|
|
931
|
+
k("div", Zt, [
|
|
932
|
+
k("span", null, U(st.value) + "/" + U(e.maxLength), 1)
|
|
933
|
+
])
|
|
934
|
+
], 34);
|
|
935
|
+
};
|
|
921
936
|
}
|
|
922
937
|
});
|
|
923
938
|
export {
|
|
924
|
-
|
|
925
|
-
|
|
939
|
+
oa as FkpAgentPromptEditor,
|
|
940
|
+
oa as default,
|
|
926
941
|
Kt as emptyAgentPrompt,
|
|
927
|
-
|
|
942
|
+
Rt as validateAgentPrompt
|
|
928
943
|
};
|