aibox-custom-component-packages 0.0.21 → 0.0.22
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/es/AiboxTabs.mjs +71 -0
- package/es/ExampleComponent.mjs +35 -0
- package/es/SourcePublish.mjs +1 -1
- package/es/assets/AiboxTabs.css +1 -0
- package/es/assets/BackBar.css +1 -0
- package/es/assets/ExampleComponent.css +1 -0
- package/es/assets/SourcePublish.css +1 -1
- package/es/assets/index.css +1 -0
- package/es/assets/index2.css +1 -0
- package/es/assets/index3.css +1 -0
- package/es/assets/index4.css +1 -0
- package/es/chunks/AiboxTable.CF4T_OCu.js +645 -0
- package/es/chunks/BackBar.Bc2NIuzk.js +645 -0
- package/es/chunks/{SourcePublish.BjY8OTLS.js → SourcePublish.CjzqOFwj.js} +23 -10
- package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
- package/es/chunks/config.8htFF04x.js +325 -0
- package/es/chunks/config.BU21Gda2.js +49 -0
- package/es/chunks/config.DPkdwjwD.js +49 -0
- package/es/chunks/config.gNZ_rT87.js +325 -0
- package/es/chunks/enums.CfSBDD6u.js +83 -0
- package/es/chunks/enums.WrpwbF4w.js +14 -0
- package/es/chunks/field-types.CPnMOjle.js +13 -0
- package/es/chunks/files.cduUqjHX.js +16 -0
- package/es/chunks/i18n.DmqkiK-h.js +444 -0
- package/es/chunks/i18n.k9Q_HVMs.js +443 -0
- package/es/chunks/index.BDd6hHiU.js +172 -0
- package/es/chunks/index.CF_YHLP5.js +257 -0
- package/es/chunks/index.DM3o2YX3.js +398 -0
- package/es/chunks/index.Dx-mCS4E.js +1298 -0
- package/es/chunks/index.bCzIhWFw.js +7 -0
- package/es/chunks/index.ml5i7aB5.js +257 -0
- package/es/chunks/layout.CygCXa6s.js +26 -0
- package/es/chunks/publish.D6friivo.js +50 -0
- package/es/chunks/publish.DlD0o09n.js +50 -0
- package/es/chunks/request.24c3shPx.js +5 -0
- package/es/chunks/usePreview.BHvXwaNi.js +157 -0
- package/es/index.mjs +1 -1
- package/lib/AiboxTabs.js +1 -0
- package/lib/ExampleComponent.js +1 -0
- package/lib/SourcePublish.js +1 -1
- package/lib/assets/AiboxTabs.css +1 -0
- package/lib/assets/BackBar.css +1 -0
- package/lib/assets/ExampleComponent.css +1 -0
- package/lib/assets/SourcePublish.css +1 -1
- package/lib/assets/index.css +1 -0
- package/lib/assets/index2.css +1 -0
- package/lib/assets/index3.css +1 -0
- package/lib/assets/index4.css +1 -0
- package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
- package/lib/chunks/BackBar.CZsNxoX1.js +1 -0
- package/lib/chunks/SourcePublish.eOSEULjP.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
- package/lib/chunks/config.1oaIKLGn.js +1 -0
- package/lib/chunks/config.B0XKkp1w.js +1 -0
- package/lib/chunks/config.BCAuBVxV.js +1 -0
- package/lib/chunks/config.BF7MO0O5.js +1 -0
- package/lib/chunks/enums.Dmq4PdUc.js +1 -0
- package/lib/chunks/enums.DpU2er5r.js +1 -0
- package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
- package/lib/chunks/files.B3-8UC0v.js +1 -0
- package/lib/chunks/i18n.CL5L6nx6.js +1 -0
- package/lib/chunks/i18n.DgOp_D7R.js +1 -0
- package/lib/chunks/index.4hFddClT.js +6 -0
- package/lib/chunks/index.BNivYbtq.js +1 -0
- package/lib/chunks/index.B_keI1Aq.js +1 -0
- package/lib/chunks/index.Bk-RwmaH.js +1 -0
- package/lib/chunks/index.CJFk1R2u.js +59 -0
- package/lib/chunks/index.CkihWzK6.js +1 -0
- package/lib/chunks/layout.DbBSbLgm.js +1 -0
- package/lib/chunks/publish.3TrK3fZf.js +1 -0
- package/lib/chunks/publish.Bw1acrSu.js +1 -0
- package/lib/chunks/request.D8T4MgGX.js +1 -0
- package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +0 -721
- package/es/chunks/AiboxTable.B_Yli5E8.js +0 -635
- package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +0 -47
- package/es/chunks/AuthSection.CLi8HcIx.js +0 -201
- package/es/chunks/AvailableRangePreview.BgeL_bMq.js +0 -194
- package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +0 -229
- package/es/chunks/CodeView.CWbewuHs.js +0 -148
- package/es/chunks/CommonTagsList.CJdBie2N.js +0 -156
- package/es/chunks/CreateMcpForm.C0HqvD-g.js +0 -308
- package/es/chunks/DocSyncSelect.DlJXL1lq.js +0 -2290
- package/es/chunks/FileUploader.BSIhrd9M.js +0 -216
- package/es/chunks/McpFormDialog.CDH31D2Q.js +0 -297
- package/es/chunks/McpParamsSet.Bx3aRL9j.js +0 -501
- package/es/chunks/MdEditor.Bb9S_hso.js +0 -163
- package/es/chunks/ParameterTable.CoRz_932.js +0 -2010
- package/es/chunks/PublishRecord.C8h1tu3w.js +0 -133
- package/es/chunks/SourcePublish.CebmryAz.js +0 -966
- package/es/chunks/SourcePublish.Dk7O9GzI.js +0 -968
- package/es/chunks/config.CIQoQGOb.js +0 -35
- package/es/chunks/config.lm2B-n0s.js +0 -270
- package/es/chunks/i18n.CIhVBbR3.js +0 -418
- package/lib/chunks/AddOrEditSupplierDialog.XtPxc5yr.js +0 -1
- package/lib/chunks/AiboxTable.DFyqwoGc.js +0 -1
- package/lib/chunks/ApplicationTypeTag.CZReMt-9.js +0 -1
- package/lib/chunks/AuthSection.CP9c-YTW.js +0 -1
- package/lib/chunks/AvailableRangePreview.DvREyHNH.js +0 -1
- package/lib/chunks/AvailableRangeSetting.DDHTOLJA.js +0 -1
- package/lib/chunks/CodeView.DeBxLqyC.js +0 -1
- package/lib/chunks/CommonTagsList.QEP4G-Em.js +0 -1
- package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +0 -1
- package/lib/chunks/DocSyncSelect.1gaXRzps.js +0 -2
- package/lib/chunks/FileUploader.6IW_QL-h.js +0 -1
- package/lib/chunks/McpFormDialog.FwXnBBd2.js +0 -6
- package/lib/chunks/McpParamsSet.BYrxVvDL.js +0 -1
- package/lib/chunks/MdEditor.Cp24y4DJ.js +0 -1
- package/lib/chunks/ParameterTable.CeufAEXh.js +0 -1
- package/lib/chunks/PublishRecord.BVndvj7F.js +0 -5
- package/lib/chunks/SourcePublish.Bz8MaRPm.js +0 -1
- package/lib/chunks/SourcePublish.I7ORXPok.js +0 -1
- package/lib/chunks/SourcePublish.OeB6i-Iu.js +0 -1
- package/lib/chunks/config.B9Di8LtU.js +0 -1
- package/lib/chunks/config.CZl1kYtI.js +0 -1
- package/lib/chunks/i18n.BGe5gOau.js +0 -1
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./withinstall.dLh4K-0g.js";
|
|
2
|
-
import { m as t } from "./i18n.CIhVBbR3.js";
|
|
3
|
-
import { t as n } from "./request.CfOHcfgX.js";
|
|
4
|
-
import { t as r } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
|
|
5
|
-
import { n as i, t as a } from "./CodeView.CWbewuHs.js";
|
|
6
|
-
import { r as o } from "./AiboxTable.B_Yli5E8.js";
|
|
7
|
-
import { i as s, t as c } from "./ParameterTable.CoRz_932.js";
|
|
8
|
-
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onMounted as b, onUnmounted as x, openBlock as S, ref as C, resolveComponent as w, toDisplayString as T, unref as E, watch as D, withCtx as O, withModifiers as k } from "vue";
|
|
9
|
-
import { ElButton as A, ElIcon as j, ElMessage as M, ElSkeleton as N, ElTooltip as P } from "element-plus";
|
|
10
|
-
import { ApplicationIcon as F, SOURCE_TYPE as I } from "color-star-custom-components";
|
|
11
|
-
import { useRoute as L } from "vue-router";
|
|
12
|
-
import '../assets/McpParamsSet.css';//#region components/McpParamsSet/components/TextLeft.vue
|
|
13
|
-
var R = { class: "header-nav" }, z = { class: "text-name" }, B = { class: "text-name-nav" }, V = { class: "text-ellipsis" }, H = { class: "text-name-desc text-ellipsis" }, U = /* @__PURE__ */ r({
|
|
14
|
-
__name: "TextLeft",
|
|
15
|
-
props: {
|
|
16
|
-
detailData: {
|
|
17
|
-
type: Object,
|
|
18
|
-
default: () => {}
|
|
19
|
-
},
|
|
20
|
-
showEdit: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: !0
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
emits: ["editMcp"],
|
|
26
|
-
setup(e, { emit: n }) {
|
|
27
|
-
let r = n, { t: i } = t(), a = (e) => e ? e.length > 50 ? e.slice(0, 50) + "..." : e : "", o = () => {
|
|
28
|
-
r("editMcp");
|
|
29
|
-
};
|
|
30
|
-
return (t, n) => {
|
|
31
|
-
let r = w("IconEdit2");
|
|
32
|
-
return S(), p("div", R, [g(E(F), {
|
|
33
|
-
row: e.detailData,
|
|
34
|
-
applicationType: E(I).MCP,
|
|
35
|
-
iconField: "iconUrl",
|
|
36
|
-
size: 48
|
|
37
|
-
}, null, 8, ["row", "applicationType"]), m("div", z, [m("div", B, [g(E(P), {
|
|
38
|
-
content: e.detailData.name,
|
|
39
|
-
placement: "top",
|
|
40
|
-
"show-after": 500,
|
|
41
|
-
"popper-style": { maxWidth: "500px" }
|
|
42
|
-
}, {
|
|
43
|
-
default: O(() => [m("div", V, T(a(e.detailData.name || E(i)("CONFIGURATION_MCP_TOOL.LABEL_MCP_NAME"))), 1)]),
|
|
44
|
-
_: 1
|
|
45
|
-
}, 8, ["content"]), e.showEdit ? (S(), d(E(j), {
|
|
46
|
-
key: 0,
|
|
47
|
-
class: "edit-icon",
|
|
48
|
-
onClick: o
|
|
49
|
-
}, {
|
|
50
|
-
default: O(() => [g(r)]),
|
|
51
|
-
_: 1
|
|
52
|
-
})) : f("", !0)]), g(E(P), {
|
|
53
|
-
content: e.detailData.description || E(i)("CONFIGURATION_MCP_TOOL.LABEL_DESCRIPTION"),
|
|
54
|
-
placement: "top",
|
|
55
|
-
"show-after": 500,
|
|
56
|
-
"popper-style": { maxWidth: "500px" }
|
|
57
|
-
}, {
|
|
58
|
-
default: O(() => [m("div", H, T(a(e.detailData.description || E(i)("CONFIGURATION_MCP_TOOL.LABEL_DESCRIPTION"))), 1)]),
|
|
59
|
-
_: 1
|
|
60
|
-
}, 8, ["content"])])]);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}, [["__scopeId", "data-v-f291c753"]]), W = (e) => {
|
|
64
|
-
let { heightRef: t, defaultHeight: n, minHeight: r, maxHeight: i, widthRef: a, defaultWidth: o, minWidth: s, maxWidth: c, direction: l = "vertical", reverse: u = !1, onResizeStart: d, onResizing: f, onResizeEnd: p } = e, m = !1, h = 0, g = 0, _ = 0, v = 0, y = (e) => {
|
|
65
|
-
m = !0, (l === "vertical" || l === "both") && (h = e.clientY, g = t?.value), (l === "horizontal" || l === "both") && (_ = e.clientX, v = a?.value), document.addEventListener("mousemove", b), document.addEventListener("mouseup", x), document.body.classList.add("resizing"), typeof d == "function" && d(e, {
|
|
66
|
-
height: g,
|
|
67
|
-
width: v
|
|
68
|
-
});
|
|
69
|
-
}, b = (e) => {
|
|
70
|
-
if (!m) return;
|
|
71
|
-
let n, o, d, p;
|
|
72
|
-
if ((l === "vertical" || l === "both") && t && (o = e.clientY - h, n = Math.max(r ?? 0, Math.min(i ?? Infinity, g - o)), t.value = n), (l === "horizontal" || l === "both") && a) {
|
|
73
|
-
p = e.clientX - _;
|
|
74
|
-
let t = u ? -p : p;
|
|
75
|
-
d = Math.max(s ?? 0, Math.min(c ?? Infinity, v + t)), a.value = d;
|
|
76
|
-
}
|
|
77
|
-
typeof f == "function" && f(e, {
|
|
78
|
-
height: n,
|
|
79
|
-
width: d,
|
|
80
|
-
deltaY: o,
|
|
81
|
-
deltaX: p
|
|
82
|
-
});
|
|
83
|
-
}, x = (e) => {
|
|
84
|
-
m && (m = !1, document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x), document.body.classList.remove("resizing"), typeof p == "function" && p(e, {
|
|
85
|
-
height: t?.value,
|
|
86
|
-
width: a?.value
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
89
|
-
return {
|
|
90
|
-
startResize: y,
|
|
91
|
-
handleResize: b,
|
|
92
|
-
stopResize: x,
|
|
93
|
-
reset: () => {
|
|
94
|
-
t && typeof n == "number" && (t.value = n), a && typeof o == "number" && (a.value = o);
|
|
95
|
-
},
|
|
96
|
-
cleanup: () => {
|
|
97
|
-
document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", x), document.body.classList.remove("resizing");
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region components/McpParamsSet/useHeightResizer.js
|
|
103
|
-
function G(e) {
|
|
104
|
-
let t = C(130), n = C(130), r = W({
|
|
105
|
-
heightRef: t,
|
|
106
|
-
defaultHeight: 130,
|
|
107
|
-
minHeight: 130,
|
|
108
|
-
maxHeight: 9999,
|
|
109
|
-
onResizeStart: (e, { height: t }) => {
|
|
110
|
-
n.value = t;
|
|
111
|
-
},
|
|
112
|
-
onResizing: (e, { deltaY: r }) => {
|
|
113
|
-
t.value = Math.max(130, n.value + r);
|
|
114
|
-
},
|
|
115
|
-
onResizeEnd: () => {
|
|
116
|
-
t.value < 130 && (t.value = a.value);
|
|
117
|
-
}
|
|
118
|
-
}), i = (e) => {
|
|
119
|
-
let t = 0, n = [...e];
|
|
120
|
-
for (; n.length;) {
|
|
121
|
-
let e = n.pop();
|
|
122
|
-
t++;
|
|
123
|
-
let r = e.children || e.childItems;
|
|
124
|
-
r?.length && n.push(...r);
|
|
125
|
-
}
|
|
126
|
-
return t;
|
|
127
|
-
}, a = u(() => {
|
|
128
|
-
let t = i(e.value || []) - 1;
|
|
129
|
-
return Math.max(130, Math.min(350, 130 + t * 64));
|
|
130
|
-
});
|
|
131
|
-
return D(a, (e) => {
|
|
132
|
-
r.isDragging || _(() => {
|
|
133
|
-
t.value = e;
|
|
134
|
-
});
|
|
135
|
-
}, {
|
|
136
|
-
immediate: !0,
|
|
137
|
-
flush: "post"
|
|
138
|
-
}), x(() => {
|
|
139
|
-
r.cleanup();
|
|
140
|
-
}), {
|
|
141
|
-
resizer: r,
|
|
142
|
-
boxHeight: t
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region components/McpParamsSet/components/ResponseResult.vue
|
|
147
|
-
var K = { class: "results-warp" }, q = { class: "results-warp__left_box" }, J = { class: "code-view__box" }, Y = { class: "code-view__box_left" }, X = /* @__PURE__ */ r({
|
|
148
|
-
__name: "ResponseResult",
|
|
149
|
-
props: { loading: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: !1
|
|
152
|
-
} },
|
|
153
|
-
setup(e, { expose: t }) {
|
|
154
|
-
let { copyText: n } = i(), r = C("{}"), o = () => {
|
|
155
|
-
n(r.value);
|
|
156
|
-
};
|
|
157
|
-
return t({ jsonCode: r }), (t, n) => {
|
|
158
|
-
let i = w("IconCopy");
|
|
159
|
-
return S(), p(l, null, [m("div", K, [m("div", q, [n[0] ||= m("div", { class: "results-warp__left_box_title" }, "response", -1), g(E(j), {
|
|
160
|
-
class: "results-warp__left_box_copy",
|
|
161
|
-
onClick: o
|
|
162
|
-
}, {
|
|
163
|
-
default: O(() => [g(i)]),
|
|
164
|
-
_: 1
|
|
165
|
-
})])]), m("div", J, [m("div", Y, [e.loading ? (S(), d(E(N), {
|
|
166
|
-
key: 0,
|
|
167
|
-
rows: 10,
|
|
168
|
-
animated: ""
|
|
169
|
-
})) : (S(), d(a, {
|
|
170
|
-
key: 1,
|
|
171
|
-
code: r.value,
|
|
172
|
-
language: "json"
|
|
173
|
-
}, null, 8, ["code"]))])])], 64);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}, [["__scopeId", "data-v-85dcff2e"]]);
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region components/McpParamsSet/useAutoSaveManager.js
|
|
179
|
-
function Z() {
|
|
180
|
-
let e = C(!1), t = C(!1), n = C(null), r = C(/* @__PURE__ */ new Set()), i = (e, t) => function(...r) {
|
|
181
|
-
n.value && clearTimeout(n.value), n.value = setTimeout(() => {
|
|
182
|
-
e.apply(this, r), n.value = null;
|
|
183
|
-
}, t);
|
|
184
|
-
}, a = () => {
|
|
185
|
-
e.value = !0;
|
|
186
|
-
}, o = () => {
|
|
187
|
-
e.value = !1;
|
|
188
|
-
};
|
|
189
|
-
return {
|
|
190
|
-
isDataModified: e,
|
|
191
|
-
isSaving: t,
|
|
192
|
-
markDataModified: a,
|
|
193
|
-
markDataSaved: o,
|
|
194
|
-
createAutoSaveHandler: (n, a) => i(async () => {
|
|
195
|
-
if (t.value || !e.value || a && !a()) return;
|
|
196
|
-
let i = `save_${Date.now()}_${Math.random()}`;
|
|
197
|
-
if (!(r.value.size > 0)) {
|
|
198
|
-
r.value.add(i), t.value = !0;
|
|
199
|
-
try {
|
|
200
|
-
let e = await n();
|
|
201
|
-
return e && e.code === 0 && o(), e;
|
|
202
|
-
} catch (e) {
|
|
203
|
-
throw console.error("自动保存失败:", e), e;
|
|
204
|
-
} finally {
|
|
205
|
-
r.value.delete(i), t.value = !1;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}, 500),
|
|
209
|
-
saveImmediately: async (e) => {
|
|
210
|
-
if (n.value &&= (clearTimeout(n.value), null), t.value) {
|
|
211
|
-
console.warn("正在保存中,请稍后再试");
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
let i = `immediate_save_${Date.now()}`;
|
|
215
|
-
r.value.add(i), t.value = !0;
|
|
216
|
-
try {
|
|
217
|
-
let t = await e();
|
|
218
|
-
return t && t.code === 0 && o(), t;
|
|
219
|
-
} catch (e) {
|
|
220
|
-
throw console.error("立即保存失败:", e), e;
|
|
221
|
-
} finally {
|
|
222
|
-
r.value.delete(i), t.value = !1;
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
setupDataWatcher: (e, t, n = {}) => D(e, () => {
|
|
226
|
-
a(), t();
|
|
227
|
-
}, {
|
|
228
|
-
deep: !0,
|
|
229
|
-
immediate: !1,
|
|
230
|
-
...n
|
|
231
|
-
}),
|
|
232
|
-
cleanup: () => {
|
|
233
|
-
n.value &&= (clearTimeout(n.value), null), r.value.clear(), e.value = !1, t.value = !1;
|
|
234
|
-
},
|
|
235
|
-
resetSaveState: () => {
|
|
236
|
-
e.value = !1, t.value = !1;
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region components/McpParamsSet/apis/index.js
|
|
242
|
-
var Q = () => {
|
|
243
|
-
let { $request: e, $env: t } = n();
|
|
244
|
-
return { callMcpTool: (n, r, i) => e({
|
|
245
|
-
url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/mcp/customize/call-mcp-tool/${n}/${r}`,
|
|
246
|
-
method: "post",
|
|
247
|
-
data: i
|
|
248
|
-
}) };
|
|
249
|
-
}, $ = { class: "header-nav-box" }, ee = { class: "tool-created" }, te = { class: "parameter-settings" }, ne = { class: "parameter-title" }, re = { class: "response-results" }, ie = { class: "response-title" }, ae = e(/* @__PURE__ */ r({
|
|
250
|
-
__name: "index",
|
|
251
|
-
props: {
|
|
252
|
-
getSnowFlakeId: {
|
|
253
|
-
type: Function,
|
|
254
|
-
default: () => () => Date.now()
|
|
255
|
-
},
|
|
256
|
-
mcpBnid: {
|
|
257
|
-
type: String,
|
|
258
|
-
default: ""
|
|
259
|
-
},
|
|
260
|
-
toolName: {
|
|
261
|
-
type: String,
|
|
262
|
-
default: ""
|
|
263
|
-
},
|
|
264
|
-
isBackendSystem: {
|
|
265
|
-
type: Boolean,
|
|
266
|
-
default: !1
|
|
267
|
-
},
|
|
268
|
-
propToolData: {
|
|
269
|
-
type: Object,
|
|
270
|
-
default: null
|
|
271
|
-
},
|
|
272
|
-
propMcpInfo: {
|
|
273
|
-
type: Object,
|
|
274
|
-
default: null
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
setup(e, { expose: n }) {
|
|
278
|
-
let r = e, { markDataModified: i } = Z(), { t: a } = t(), u = L(), _ = C({}), w = C({}), D = C(null), j = C(null), { callMcpTool: N } = Q(), P = () => {}, F = async () => {
|
|
279
|
-
try {
|
|
280
|
-
let e = sessionStorage.getItem("mcp_debug_mcpData");
|
|
281
|
-
(e || r.propMcpInfo) && (_.value = r.propMcpInfo || JSON.parse(e));
|
|
282
|
-
let t = sessionStorage.getItem("mcp_debug_toolData");
|
|
283
|
-
if ((t || r.propToolData) && (w.value = r.propToolData || JSON.parse(t), w.value.inputSchema && w.value.inputSchema.properties)) {
|
|
284
|
-
let e = w.value.inputSchema.properties, t = w.value.inputSchema.required || [], n = 0, r = () => `param_${n++}`, i = (e, t = [], n = 1) => Object.keys(e).map((a) => {
|
|
285
|
-
let o = e[a], s = o.type || "string", c = {
|
|
286
|
-
name: a,
|
|
287
|
-
type: s,
|
|
288
|
-
description: o.description || "",
|
|
289
|
-
required: t.includes(a),
|
|
290
|
-
uiid: r(),
|
|
291
|
-
disabled: !1,
|
|
292
|
-
deep: n,
|
|
293
|
-
value: ""
|
|
294
|
-
};
|
|
295
|
-
if (s === "array" && o.items) {
|
|
296
|
-
let e = o.items.type;
|
|
297
|
-
if (s = {
|
|
298
|
-
string: "arrayString",
|
|
299
|
-
number: "arrayNumber",
|
|
300
|
-
integer: "arrayInteger",
|
|
301
|
-
boolean: "arrayBoolean",
|
|
302
|
-
object: "arrayObject",
|
|
303
|
-
file: "arrayFile",
|
|
304
|
-
image: "arrayImage"
|
|
305
|
-
}[e] || "arrayString", c.type = s, e === "object" && o.items.properties) {
|
|
306
|
-
let e = o.items.required || [], t = {
|
|
307
|
-
name: "[Array Item]",
|
|
308
|
-
type: "object",
|
|
309
|
-
description: "",
|
|
310
|
-
required: !1,
|
|
311
|
-
uiid: r(),
|
|
312
|
-
disabled: !1,
|
|
313
|
-
deep: n + 1,
|
|
314
|
-
value: ""
|
|
315
|
-
};
|
|
316
|
-
t.children = i(o.items.properties, e, n + 2), c.children = [t];
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (s === "object" && o.properties) {
|
|
320
|
-
let e = o.required || [];
|
|
321
|
-
c.children = i(o.properties, e, n + 1);
|
|
322
|
-
}
|
|
323
|
-
return c;
|
|
324
|
-
});
|
|
325
|
-
R.value = i(e, t, 1);
|
|
326
|
-
}
|
|
327
|
-
} catch (e) {
|
|
328
|
-
console.error("解析数据失败:", e), M.error(a("CONFIGURATION_MCP_TOOL.LABEL_LOAD_DATA_FAILED"));
|
|
329
|
-
}
|
|
330
|
-
}, I = C(!1), R = C([{
|
|
331
|
-
name: "",
|
|
332
|
-
type: "string",
|
|
333
|
-
description: "",
|
|
334
|
-
required: !1,
|
|
335
|
-
uiid: "111",
|
|
336
|
-
disabled: !1,
|
|
337
|
-
deep: 1
|
|
338
|
-
}]), { resizer: z, boxHeight: B } = G(R), V = C(!1), H = () => {
|
|
339
|
-
let e = document.querySelector(".parameter-input-box");
|
|
340
|
-
e && (e.scrollTop = e.scrollHeight);
|
|
341
|
-
}, W = () => {
|
|
342
|
-
i();
|
|
343
|
-
}, K = (e) => {
|
|
344
|
-
console.log("校验结果:", e);
|
|
345
|
-
}, q = () => D.value?.validateAllRows(), J = () => {
|
|
346
|
-
let e = {}, t = (e) => e === "array" || s.includes(e), n = (e) => {
|
|
347
|
-
if (!e.children || e.children.length === 0) return;
|
|
348
|
-
let r = e.type;
|
|
349
|
-
if (t(r)) {
|
|
350
|
-
let r = [];
|
|
351
|
-
return e.children.forEach((e) => {
|
|
352
|
-
if (e.children && e.children.length > 0) {
|
|
353
|
-
let t = n(e);
|
|
354
|
-
t !== void 0 && r.push(t);
|
|
355
|
-
} else {
|
|
356
|
-
let i = e.value, a = i !== void 0 && i !== "" ? i : "", o = e.type;
|
|
357
|
-
o === "number" || o === "integer" ? a = a === "" ? 0 : Number(a) : o === "boolean" ? a = a === "" ? !1 : !!a : o === "object" ? a = n(e) || {} : t(o) && (a = n(e) || []), r.push(a);
|
|
358
|
-
}
|
|
359
|
-
}), r;
|
|
360
|
-
}
|
|
361
|
-
if (r === "object") {
|
|
362
|
-
let r = {};
|
|
363
|
-
return e.children.forEach((e) => {
|
|
364
|
-
let i = e.name;
|
|
365
|
-
if (!i || i === "[Array Item]") {
|
|
366
|
-
i === "[Array Item]" && e.children && e.children.length > 0 && e.children.forEach((e) => {
|
|
367
|
-
let i = e.name;
|
|
368
|
-
if (i && i !== "[Array Item]") if (e.children && e.children.length > 0) r[i] = n(e);
|
|
369
|
-
else {
|
|
370
|
-
let a = e.value, o = a !== void 0 && a !== "" ? a : "", s = e.type;
|
|
371
|
-
s === "number" || s === "integer" ? o = o === "" ? 0 : Number(o) : s === "boolean" ? o = o === "" ? !1 : !!o : s === "object" ? o = n(e) || {} : t(s) && (o = n(e) || []), r[i] = o;
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
if (e.children && e.children.length > 0) r[i] = n(e);
|
|
377
|
-
else {
|
|
378
|
-
let a = e.value, o = a !== void 0 && a !== "" ? a : "", s = e.type;
|
|
379
|
-
s === "number" || s === "integer" ? o = o === "" ? 0 : Number(o) : s === "boolean" ? o = o === "" ? !1 : !!o : s === "object" ? o = n(e) || {} : t(s) && (o = n(e) || []), r[i] = o;
|
|
380
|
-
}
|
|
381
|
-
}), r;
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
return R.value.forEach((r) => {
|
|
385
|
-
if (r.name && r.name.trim()) {
|
|
386
|
-
let i;
|
|
387
|
-
if (r.children && r.children.length > 0) i = n(r);
|
|
388
|
-
else if (i = r.value || "", i != null && i !== "") {
|
|
389
|
-
if (r.type === "number" || r.type === "integer") i = Number(i);
|
|
390
|
-
else if (r.type === "boolean") i = i === "true" || i === !0;
|
|
391
|
-
else if (t(r.type) || r.type === "object") try {
|
|
392
|
-
i = typeof i == "string" ? JSON.parse(i) : i;
|
|
393
|
-
} catch (e) {
|
|
394
|
-
console.warn(`参数 ${r.name} JSON解析失败:`, e), i = t(r.type) ? [] : {};
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
(i === void 0 || i === "") && (i = t(r.type) ? [] : r.type === "object" ? {} : r.type === "number" || r.type === "integer" ? 0 : r.type === "boolean" ? !1 : ""), e[r.name] = i;
|
|
398
|
-
}
|
|
399
|
-
}), e;
|
|
400
|
-
}, Y = async () => {
|
|
401
|
-
try {
|
|
402
|
-
let e = await q();
|
|
403
|
-
if (e && e.length > 0) {
|
|
404
|
-
M.warning(a("CONFIGURATION_MCP_TOOL.LABEL_REQUIRED_PARAMETERS"));
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
if (!_.value.address) {
|
|
408
|
-
M.warning(a("CONFIGURATION_MCP_TOOL.MCP_ADDRESS_NULL"));
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
let t = w.value.name;
|
|
412
|
-
if (!t) {
|
|
413
|
-
M.warning(a("CONFIGURATION_MCP_TOOL.CRAFTSMANSHIP_SPIRIT"));
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
V.value = !0;
|
|
417
|
-
let n = J();
|
|
418
|
-
console.log("调用MCP工具参数:", n), console.log("工具名称:", t);
|
|
419
|
-
let i = await N(u.params.bnId || r.mcpBnid, t, n);
|
|
420
|
-
console.log("MCP工具调用返回:", i), i.code === 0 ? (j.value && (j.value.jsonCode = JSON.stringify(i.data || i, null, 2)), M.success(a("CONFIGURATION_MCP_TOOL.DEBUG_SUCCESS"))) : (M.error(i.message || a("CONFIGURATION_MCP_TOOL.DEBUG_FAILED")), j.value && (j.value.jsonCode = JSON.stringify(i, null, 2)));
|
|
421
|
-
} catch (e) {
|
|
422
|
-
console.error("调试失败:", e), M.error(e.message || a("CONFIGURATION_MCP_TOOL.DEBUG_FAILED")), j.value && (j.value.jsonCode = JSON.stringify({
|
|
423
|
-
error: e.message || a("CONFIGURATION_MCP_TOOL.DEBUG_FAILED"),
|
|
424
|
-
details: e
|
|
425
|
-
}, null, 2));
|
|
426
|
-
} finally {
|
|
427
|
-
V.value = !1;
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
return b(() => {
|
|
431
|
-
F();
|
|
432
|
-
}), x(() => {
|
|
433
|
-
sessionStorage.removeItem("mcp_debug_mcpData"), sessionStorage.removeItem("mcp_debug_toolData");
|
|
434
|
-
}), n({
|
|
435
|
-
validateAll: q,
|
|
436
|
-
handleDebug: Y
|
|
437
|
-
}), (t, n) => (S(), p(l, null, [e.isBackendSystem ? f("", !0) : (S(), d(o, { key: 0 }, {
|
|
438
|
-
default: O(() => [m("div", $, [g(U, {
|
|
439
|
-
"detail-data": w.value,
|
|
440
|
-
"show-edit": !1,
|
|
441
|
-
onEditMcp: P
|
|
442
|
-
}, null, 8, ["detail-data"]), g(E(A), {
|
|
443
|
-
type: "primary",
|
|
444
|
-
loading: V.value,
|
|
445
|
-
onClick: Y
|
|
446
|
-
}, {
|
|
447
|
-
default: O(() => [h(T(E(a)("CONFIGURATION_MCP_TOOL.LABEL_DEBUG_TOOL")), 1)]),
|
|
448
|
-
_: 1
|
|
449
|
-
}, 8, ["loading"])])]),
|
|
450
|
-
_: 1
|
|
451
|
-
})), m("div", ee, [
|
|
452
|
-
m("div", te, [m("p", ne, T(E(a)("CONFIGURATION_MCP_TOOL.LABEL_PARAMETER_SETTINGS")), 1), m("div", {
|
|
453
|
-
class: v(["parameter-input-box", { "backend-system": e.isBackendSystem }]),
|
|
454
|
-
style: y({ height: E(B) + "px" })
|
|
455
|
-
}, [g(E(c), {
|
|
456
|
-
ref_key: "parameterTableRef",
|
|
457
|
-
ref: D,
|
|
458
|
-
tableData: R.value,
|
|
459
|
-
"onUpdate:tableData": n[0] ||= (e) => R.value = e,
|
|
460
|
-
isPluginMode: !0,
|
|
461
|
-
isDataType: !1,
|
|
462
|
-
loadingTable: I.value,
|
|
463
|
-
maxHeight: E(B),
|
|
464
|
-
disabled: !1,
|
|
465
|
-
disabledFields: [
|
|
466
|
-
"name",
|
|
467
|
-
"type",
|
|
468
|
-
"description",
|
|
469
|
-
"required",
|
|
470
|
-
"add",
|
|
471
|
-
"delete"
|
|
472
|
-
],
|
|
473
|
-
customFieldName: {
|
|
474
|
-
name: "name",
|
|
475
|
-
type: "type",
|
|
476
|
-
value: "value"
|
|
477
|
-
},
|
|
478
|
-
getSnowFlakeId: e.getSnowFlakeId,
|
|
479
|
-
onNameOrTypeChangeValue: W,
|
|
480
|
-
onDataNameValidate: K,
|
|
481
|
-
onScrollToBottom: H
|
|
482
|
-
}, null, 8, [
|
|
483
|
-
"tableData",
|
|
484
|
-
"loadingTable",
|
|
485
|
-
"maxHeight",
|
|
486
|
-
"getSnowFlakeId"
|
|
487
|
-
])], 6)]),
|
|
488
|
-
m("div", {
|
|
489
|
-
class: "resize-handle",
|
|
490
|
-
onMousedown: n[1] ||= k((...e) => E(z).startResize && E(z).startResize(...e), ["prevent"])
|
|
491
|
-
}, null, 32),
|
|
492
|
-
m("div", re, [m("p", ie, T(E(a)("CONFIGURATION_MCP_TOOL.LABEL_RESPONSE_RESULTS")), 1), g(X, {
|
|
493
|
-
ref_key: "responseMessage",
|
|
494
|
-
ref: j,
|
|
495
|
-
loading: V.value
|
|
496
|
-
}, null, 8, ["loading"])])
|
|
497
|
-
])], 64));
|
|
498
|
-
}
|
|
499
|
-
}, [["__scopeId", "data-v-385912ff"]]));
|
|
500
|
-
//#endregion
|
|
501
|
-
export { U as n, ae as t };
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./chunk.EU29TkMc.js";
|
|
2
|
-
import { t } from "./withinstall.dLh4K-0g.js";
|
|
3
|
-
import { c as n, p as r } from "./i18n.CIhVBbR3.js";
|
|
4
|
-
import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
|
|
5
|
-
import { t as a } from "./files.DvOT1nf3.js";
|
|
6
|
-
import { computed as o, createElementBlock as s, createVNode as c, normalizeStyle as l, openBlock as u, ref as d, unref as f, watch as p } from "vue";
|
|
7
|
-
import { ElMessage as m } from "element-plus";
|
|
8
|
-
import { emitsMap as h } from "color-star-custom-methods";
|
|
9
|
-
import { MdEditor as g } from "md-editor-v3";
|
|
10
|
-
(/* @__PURE__ */ e(((e, t) => {
|
|
11
|
-
t.exports = {};
|
|
12
|
-
})))();
|
|
13
|
-
import '../assets/MdEditor.css';//#endregion
|
|
14
|
-
//#region components/MdEditor/index.vue
|
|
15
|
-
var _ = { class: "md-editor-container" }, v = t(/* @__PURE__ */ i({
|
|
16
|
-
__name: "index",
|
|
17
|
-
props: {
|
|
18
|
-
modelValue: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: ""
|
|
21
|
-
},
|
|
22
|
-
height: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "500px"
|
|
25
|
-
},
|
|
26
|
-
theme: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "light"
|
|
29
|
-
},
|
|
30
|
-
previewTheme: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: "default"
|
|
33
|
-
},
|
|
34
|
-
codeTheme: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: "atom-one-dark"
|
|
37
|
-
},
|
|
38
|
-
language: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "zh-CN"
|
|
41
|
-
},
|
|
42
|
-
showToolbars: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: !0
|
|
45
|
-
},
|
|
46
|
-
businessType: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: "common"
|
|
49
|
-
},
|
|
50
|
-
toolbars: {
|
|
51
|
-
type: Array,
|
|
52
|
-
default: () => []
|
|
53
|
-
},
|
|
54
|
-
disabled: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: !1
|
|
57
|
-
},
|
|
58
|
-
placeholder: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: () => r("COMMON_DATA.PLACEHOLDER_CONTENT")
|
|
61
|
-
},
|
|
62
|
-
highlightTheme: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "atom-one-dark"
|
|
65
|
-
},
|
|
66
|
-
autoFocus: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: !1
|
|
69
|
-
},
|
|
70
|
-
previewOnly: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: !0
|
|
73
|
-
},
|
|
74
|
-
preview: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: !0
|
|
77
|
-
},
|
|
78
|
-
footers: {
|
|
79
|
-
type: Array,
|
|
80
|
-
default: () => ["markdownTotal", "htmlTotal"]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
emits: [
|
|
84
|
-
h.updateModelValue,
|
|
85
|
-
h.change,
|
|
86
|
-
h.save,
|
|
87
|
-
h.blur,
|
|
88
|
-
h.focus
|
|
89
|
-
],
|
|
90
|
-
setup(e, { emit: t }) {
|
|
91
|
-
let { commonUpload: i } = a(), v = n(), y = e, b = d(y.modelValue);
|
|
92
|
-
p(() => y.modelValue, (e) => {
|
|
93
|
-
e !== b.value && (b.value = e);
|
|
94
|
-
});
|
|
95
|
-
let x = t, S = o(() => y.showToolbars ? y.toolbars.length ? y.toolbars : /* @__PURE__ */ "bold.underline.italic.strikeThrough.-.title.sub.sup.quote.unorderedList.orderedList.task.-.codeRow.code.link.image.table.mermaid.katex.-.revoke.next.save.-.pageFullscreen.fullscreen.preview.htmlPreview.catalog".split(".") : []), C = (e) => {
|
|
96
|
-
b.value = e, x(h.updateModelValue, e), x(h.change, e);
|
|
97
|
-
}, w = (e) => {
|
|
98
|
-
x(h.save, e);
|
|
99
|
-
}, T = (e) => {
|
|
100
|
-
x(h.blur, e);
|
|
101
|
-
}, E = (e) => {
|
|
102
|
-
x(h.focus, e);
|
|
103
|
-
}, D = async (e, t) => {
|
|
104
|
-
try {
|
|
105
|
-
let n = e.map(async (e) => {
|
|
106
|
-
let t = new FormData();
|
|
107
|
-
t.append("file", e);
|
|
108
|
-
let { code: n, data: a } = await i(t, y.businessType);
|
|
109
|
-
if (n === 0) return {
|
|
110
|
-
url: `${a.url}?id="${a.bnid}"`,
|
|
111
|
-
desc: e.name
|
|
112
|
-
};
|
|
113
|
-
throw Error(r("MESSAGE_REMIND.FILE_UPLOAD_FAIL"));
|
|
114
|
-
});
|
|
115
|
-
t(await Promise.all(n));
|
|
116
|
-
} catch {
|
|
117
|
-
m.error(r("MESSAGE_REMIND.FILE_UPLOAD_FAIL_TIP")), t([]);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
return (t, n) => (u(), s("div", _, [c(f(g), {
|
|
121
|
-
modelValue: b.value,
|
|
122
|
-
"onUpdate:modelValue": n[0] ||= (e) => b.value = e,
|
|
123
|
-
theme: e.theme,
|
|
124
|
-
toolbars: S.value,
|
|
125
|
-
"preview-theme": e.previewTheme,
|
|
126
|
-
"code-theme": e.codeTheme,
|
|
127
|
-
preview: e.preview,
|
|
128
|
-
"preview-only": e.previewOnly,
|
|
129
|
-
style: l({ height: e.height }),
|
|
130
|
-
disabled: e.disabled,
|
|
131
|
-
placeholder: e.placeholder,
|
|
132
|
-
"highlight-theme": e.highlightTheme,
|
|
133
|
-
"show-code-row-number": !0,
|
|
134
|
-
"auto-focus": e.autoFocus,
|
|
135
|
-
"tab-width": 2,
|
|
136
|
-
footers: e.footers,
|
|
137
|
-
language: f(v),
|
|
138
|
-
onOnChange: C,
|
|
139
|
-
onOnSave: w,
|
|
140
|
-
onOnUploadImg: D,
|
|
141
|
-
onOnBlur: T,
|
|
142
|
-
onOnFocus: E,
|
|
143
|
-
class: "custom-md-editor"
|
|
144
|
-
}, null, 8, [
|
|
145
|
-
"modelValue",
|
|
146
|
-
"theme",
|
|
147
|
-
"toolbars",
|
|
148
|
-
"preview-theme",
|
|
149
|
-
"code-theme",
|
|
150
|
-
"preview",
|
|
151
|
-
"preview-only",
|
|
152
|
-
"style",
|
|
153
|
-
"disabled",
|
|
154
|
-
"placeholder",
|
|
155
|
-
"highlight-theme",
|
|
156
|
-
"auto-focus",
|
|
157
|
-
"footers",
|
|
158
|
-
"language"
|
|
159
|
-
])]));
|
|
160
|
-
}
|
|
161
|
-
}, [["__scopeId", "data-v-d0fca9d9"]]));
|
|
162
|
-
//#endregion
|
|
163
|
-
export { v as t };
|