aibox-custom-component-packages 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/es/SourcePublish.mjs +1 -1
  2. package/es/assets/SourcePublish.css +1 -1
  3. package/es/chunks/{SourcePublish.BhLjt18i.js → SourcePublish.Dk7O9GzI.js} +2 -6
  4. package/es/index.mjs +1 -1
  5. package/lib/SourcePublish.js +1 -1
  6. package/lib/assets/SourcePublish.css +1 -1
  7. package/lib/chunks/SourcePublish.OeB6i-Iu.js +1 -0
  8. package/lib/index.js +1 -1
  9. package/package.json +2 -2
  10. package/es/chunks/AddOrEditSupplierDialog.BKR0RsiJ.js +0 -721
  11. package/es/chunks/AddOrEditSupplierDialog.CjNRipPe.js +0 -721
  12. package/es/chunks/AddOrEditSupplierDialog.CnsquSx2.js +0 -721
  13. package/es/chunks/AiboxTable.CDqNvRfJ.js +0 -635
  14. package/es/chunks/AiboxTable.CrWMAX84.js +0 -635
  15. package/es/chunks/ApplicationTypeTag.Cbdi0D65.js +0 -47
  16. package/es/chunks/ApplicationTypeTag.Df4BZxds.js +0 -47
  17. package/es/chunks/AuthSection.DFfj5MtZ.js +0 -201
  18. package/es/chunks/AuthSection.DWD_FxtJ.js +0 -201
  19. package/es/chunks/AvailableRangePreview.Bz9QkkAM.js +0 -194
  20. package/es/chunks/AvailableRangePreview.WFzbRasx.js +0 -194
  21. package/es/chunks/AvailableRangeSetting.Bq_K1zar.js +0 -229
  22. package/es/chunks/AvailableRangeSetting.Cty5Cdmh.js +0 -229
  23. package/es/chunks/CodeView.CWuSIL_F.js +0 -148
  24. package/es/chunks/CodeView.Dhxe1PQP.js +0 -148
  25. package/es/chunks/CommonTagsList.DSPdgjc3.js +0 -156
  26. package/es/chunks/CommonTagsList.NbXVfvLW.js +0 -156
  27. package/es/chunks/CommonTagsList.qam_Fp76.js +0 -156
  28. package/es/chunks/CreateMcpForm.BBVVd2RN.js +0 -308
  29. package/es/chunks/CreateMcpForm.BWUyeP01.js +0 -308
  30. package/es/chunks/CreateMcpForm.C8YfDSEM.js +0 -308
  31. package/es/chunks/CreateMcpForm.DSE5jyiW.js +0 -308
  32. package/es/chunks/CustomSidebar.BSGAhmVY.js +0 -585
  33. package/es/chunks/DocSyncSelect.D-WIvZZN.js +0 -2290
  34. package/es/chunks/DocSyncSelect.Kk88o9gO.js +0 -2290
  35. package/es/chunks/FileDisplay.B5laA4uX.js +0 -1649
  36. package/es/chunks/FileDisplay.BCTNdpl9.js +0 -1649
  37. package/es/chunks/FileDisplay.CBNYrdsK.js +0 -1560
  38. package/es/chunks/FilePreview.B9u8ODHp.js +0 -123
  39. package/es/chunks/FileUploader.BaikPGWb.js +0 -216
  40. package/es/chunks/FileUploader.DD-lopf-.js +0 -216
  41. package/es/chunks/McpFormDialog.4HDExbTn.js +0 -297
  42. package/es/chunks/McpFormDialog.CgnC1I7i.js +0 -297
  43. package/es/chunks/McpFormDialog.D3txmoEF.js +0 -297
  44. package/es/chunks/McpFormDialog.DNzqqhaX.js +0 -297
  45. package/es/chunks/McpParamsSet.DlWx6E5S.js +0 -501
  46. package/es/chunks/McpParamsSet.Tlo_lPn-.js +0 -501
  47. package/es/chunks/MdEditor.B9-B9aiy.js +0 -163
  48. package/es/chunks/MdEditor.CeEo0P6j.js +0 -163
  49. package/es/chunks/MdEditor.DtL0Se7T.js +0 -163
  50. package/es/chunks/ParameterTable.BCdnj1gW.js +0 -2010
  51. package/es/chunks/ParameterTable.hUsxEU6F.js +0 -2010
  52. package/es/chunks/PublishRecord.9PLs9yUj.js +0 -133
  53. package/es/chunks/PublishRecord.C0841sJ-.js +0 -133
  54. package/es/chunks/PublishRecord.DEzC7hmP.js +0 -133
  55. package/es/chunks/SourcePublish.C97G36H2.js +0 -972
  56. package/es/chunks/SourcePublish.DkyY1KEk.js +0 -972
  57. package/es/chunks/SourcePublish.Dx-ltk9U.js +0 -956
  58. package/es/chunks/SourcePublish.FiswtYfr.js +0 -972
  59. package/es/chunks/SourcePublish.nfXmrVHm.js +0 -972
  60. package/es/chunks/config.BEZNFeRN.js +0 -35
  61. package/es/chunks/config.LzgBLhTz.js +0 -270
  62. package/es/chunks/config.MfNKPMiA.js +0 -35
  63. package/es/chunks/config.TaUlPTYL.js +0 -270
  64. package/es/chunks/config.l1J_qxeB.js +0 -270
  65. package/es/chunks/i18n.CIjLjyDK.js +0 -418
  66. package/es/chunks/i18n.CxsxtRq_.js +0 -418
  67. package/es/chunks/usePreview.agdxmOk8.js +0 -126
  68. package/lib/chunks/AddOrEditSupplierDialog.D0DSQZiS.js +0 -1
  69. package/lib/chunks/CommonTagsList.DbNcVId5.js +0 -1
  70. package/lib/chunks/CreateMcpForm.Cm9eHXWg.js +0 -1
  71. package/lib/chunks/CreateMcpForm.DNijYbgd.js +0 -1
  72. package/lib/chunks/CustomSidebar.Dojb1xoS.js +0 -1
  73. package/lib/chunks/FileDisplay.B4gn0Jhp.js +0 -59
  74. package/lib/chunks/FileDisplay.B7JWIcFg.js +0 -59
  75. package/lib/chunks/FileDisplay.DjtHza32.js +0 -59
  76. package/lib/chunks/FilePreview.b1Gine59.js +0 -1
  77. package/lib/chunks/McpFormDialog.BgNPOGB-.js +0 -6
  78. package/lib/chunks/McpFormDialog.CL2bInts.js +0 -6
  79. package/lib/chunks/McpFormDialog.DbhQIwYW.js +0 -6
  80. package/lib/chunks/MdEditor.rVQbuxCg.js +0 -1
  81. package/lib/chunks/PublishRecord.B7xYlRKJ.js +0 -5
  82. package/lib/chunks/SourcePublish.BBsNlnp4.js +0 -1
  83. package/lib/chunks/SourcePublish.C9JAqJcV.js +0 -1
  84. package/lib/chunks/SourcePublish.CpeV-UOG.js +0 -1
  85. package/lib/chunks/SourcePublish.K4tntn9l.js +0 -1
  86. package/lib/chunks/SourcePublish.tNsaCp3r.js +0 -1
  87. package/lib/chunks/config.CDNV0bUm.js +0 -1
  88. package/lib/chunks/usePreview.Dmhz8azZ.js +0 -1
@@ -1,501 +0,0 @@
1
- import { t as e } from "./withinstall.dLh4K-0g.js";
2
- import { m as t } from "./i18n.CIjLjyDK.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.Dhxe1PQP.js";
6
- import { r as o } from "./AiboxTable.CDqNvRfJ.js";
7
- import { i as s, t as c } from "./ParameterTable.hUsxEU6F.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 };