aibox-custom-component-packages 0.0.6 → 0.0.8
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/AddOrEditSupplierDialog.mjs +836 -0
- package/es/ApplicationTypeTag.mjs +58 -0
- package/es/AuthSection.mjs +199 -0
- package/es/AutoShowTooltip.mjs +90 -0
- package/es/AvailableRangePreview.mjs +1 -1
- package/es/AvailableRangeSetting.mjs +16 -11
- package/es/CodeView.mjs +7 -0
- package/es/CommonTagsList.mjs +5 -5
- package/es/CreateMcpForm.mjs +385 -0
- package/es/CustomSidebar.mjs +717 -0
- package/es/CustomTitle.mjs +7 -0
- package/es/CustomToggle.mjs +224 -0
- package/es/DialogContainer.mjs +21 -21
- package/es/DocSyncSelect.mjs +2661 -0
- package/es/FileDisplay.mjs +4 -0
- package/es/FilePreview.mjs +179 -0
- package/es/FileUploader.mjs +263 -9
- package/es/Logo.mjs +72 -0
- package/es/McpFormDialog.mjs +8 -0
- package/es/McpParamsSet.mjs +630 -0
- package/es/MdEditor.mjs +201 -0
- package/es/PageContainer.mjs +582 -11
- package/es/ParameterTable.mjs +2290 -0
- package/es/PublishRecord.mjs +59 -58
- package/es/RadioGroup.mjs +119 -0
- package/es/SourcePublish.mjs +96 -94
- package/es/Table.mjs +2 -2
- package/es/assets/AddOrEditSupplierDialog.css +1 -0
- package/es/assets/AiboxTable.css +1 -0
- package/es/assets/ApplicationTypeTag.css +1 -0
- package/es/assets/AuthSection.css +1 -0
- package/es/assets/AutoShowTooltip.css +1 -0
- package/es/assets/CommonTagsList.css +1 -1
- package/es/assets/CreateMcpForm.css +1 -0
- package/es/assets/CustomSidebar.css +1 -0
- package/es/assets/CustomToggle.css +1 -0
- package/es/assets/DocSyncSelect.css +1 -0
- package/es/assets/FilePreview.css +1 -0
- package/es/assets/FileUploader.css +1 -0
- package/es/assets/Logo.css +1 -0
- package/es/assets/McpParamsSet.css +1 -0
- package/es/assets/MdEditor.css +1 -0
- package/es/assets/PageContainer.css +1 -0
- package/es/assets/ParameterTable.css +1 -0
- package/es/assets/PublishRecord.css +1 -1
- package/es/assets/RadioGroup.css +1 -0
- package/es/assets/SourcePublish.css +1 -1
- package/es/assets/index.css +1 -1
- package/es/assets/index2.css +1 -1
- package/es/assets/index3.css +1 -0
- package/es/assets/index4.css +1 -0
- package/es/assets/index5.css +1 -0
- package/es/assets/layout.css +1 -0
- package/es/assets/legacy.css +1 -0
- package/es/assets/usePreview.css +1 -0
- package/es/chunks/{BackBar.Cv1wxUcM.js → AiboxTable.CF4T_OCu.js} +123 -123
- package/es/chunks/{BackBar.DJV4JaUM.js → AiboxTable.DUGBBVXh.js} +123 -123
- package/es/chunks/{config.BU21Gda2.js → config.DPkdwjwD.js} +1 -1
- package/es/chunks/{config.BzCGum_W.js → config.Dklrsn-B.js} +1 -1
- package/es/chunks/{config.BPp4hMBq.js → config.RrNwuFkQ.js} +2 -2
- package/es/chunks/{config.DTMcCH58.js → config.gNZ_rT87.js} +2 -2
- package/es/chunks/{enums.CfSBDD6u.js → enums.Dvec-maC.js} +11 -32
- 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.DDMVloiU.js +443 -0
- package/es/chunks/{i18n.DmqkiK-h.js → i18n.k9Q_HVMs.js} +25 -26
- package/es/chunks/index.BDd6hHiU.js +172 -0
- package/es/chunks/index.BT1khSY9.js +111 -0
- package/es/chunks/{index.DB0ayMv8.js → index.CDvh263l.js} +3 -3
- package/es/chunks/{index.aMb6IVQD.js → index.CF_YHLP5.js} +19 -19
- package/es/chunks/index.CSjjAi3w.js +396 -0
- package/es/chunks/index.CdEBk4F_.js +134 -0
- package/es/chunks/index.DdD1VsH1.js +396 -0
- package/es/chunks/index.Dx-mCS4E.js +1298 -0
- package/es/chunks/layout.BREUWPEJ.js +26 -0
- package/es/chunks/layout.CygCXa6s.js +26 -0
- package/es/chunks/{publish.BCb7nCo9.js → publish.DlD0o09n.js} +1 -1
- package/es/chunks/request.24c3shPx.js +5 -0
- package/es/chunks/usePreview.B5lboHeg.js +153 -0
- package/es/chunks/usePreview.BHvXwaNi.js +157 -0
- package/es/index.mjs +404 -307
- package/lib/AddOrEditSupplierDialog.js +1 -0
- package/lib/ApplicationTypeTag.js +1 -0
- package/lib/AuthSection.js +1 -0
- package/lib/AutoShowTooltip.js +1 -0
- package/lib/AvailableRangePreview.js +1 -1
- package/lib/AvailableRangeSetting.js +1 -1
- package/lib/CodeView.js +1 -0
- package/lib/CommonTagsList.js +1 -1
- package/lib/CreateMcpForm.js +1 -0
- package/lib/CustomSidebar.js +1 -0
- package/lib/CustomTitle.js +1 -0
- package/lib/CustomToggle.js +1 -0
- package/lib/DialogContainer.js +1 -1
- package/lib/DocSyncSelect.js +2 -0
- package/lib/FileDisplay.js +1 -0
- package/lib/FilePreview.js +1 -0
- package/lib/FileUploader.js +1 -1
- package/lib/Logo.js +1 -0
- package/lib/McpFormDialog.js +1 -0
- package/lib/McpParamsSet.js +1 -0
- package/lib/MdEditor.js +1 -0
- package/lib/PageContainer.js +1 -1
- package/lib/ParameterTable.js +1 -0
- package/lib/PublishRecord.js +4 -4
- package/lib/RadioGroup.js +1 -0
- package/lib/SourcePublish.js +1 -1
- package/lib/Table.js +1 -1
- package/lib/assets/AddOrEditSupplierDialog.css +1 -0
- package/lib/assets/AiboxTable.css +1 -0
- package/lib/assets/ApplicationTypeTag.css +1 -0
- package/lib/assets/AuthSection.css +1 -0
- package/lib/assets/AutoShowTooltip.css +1 -0
- package/lib/assets/CommonTagsList.css +1 -1
- package/lib/assets/CreateMcpForm.css +1 -0
- package/lib/assets/CustomSidebar.css +1 -0
- package/lib/assets/CustomToggle.css +1 -0
- package/lib/assets/DocSyncSelect.css +1 -0
- package/lib/assets/FilePreview.css +1 -0
- package/lib/assets/FileUploader.css +1 -0
- package/lib/assets/Logo.css +1 -0
- package/lib/assets/McpParamsSet.css +1 -0
- package/lib/assets/MdEditor.css +1 -0
- package/lib/assets/PageContainer.css +1 -0
- package/lib/assets/ParameterTable.css +1 -0
- package/lib/assets/PublishRecord.css +1 -1
- package/lib/assets/RadioGroup.css +1 -0
- package/lib/assets/SourcePublish.css +1 -1
- package/lib/assets/index.css +1 -1
- package/lib/assets/index2.css +1 -1
- package/lib/assets/index3.css +1 -0
- package/lib/assets/index4.css +1 -0
- package/lib/assets/index5.css +1 -0
- package/lib/assets/layout.css +1 -0
- package/lib/assets/legacy.css +1 -0
- package/lib/assets/usePreview.css +1 -0
- package/lib/chunks/AiboxTable.BnoHJ7xL.js +1 -0
- package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
- package/lib/chunks/{config.B0XKkp1w.js → config.1oaIKLGn.js} +1 -1
- package/lib/chunks/{config.BCAuBVxV.js → config.BF7MO0O5.js} +1 -1
- package/lib/chunks/enums.DnuzPZCR.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.DgOp_D7R.js +1 -0
- package/lib/chunks/index.BNivYbtq.js +1 -0
- package/lib/chunks/{index.Bk-RwmaH.js → index.B_keI1Aq.js} +1 -1
- package/lib/chunks/{index.BsN4urmi.js → index.Bc71XWQn.js} +1 -1
- package/lib/chunks/index.C7aZx6RG.js +6 -0
- package/lib/chunks/index.CH7XdMru.js +1 -0
- package/lib/chunks/index.CJFk1R2u.js +59 -0
- package/lib/chunks/index.CaidDlAx.js +1 -0
- package/lib/chunks/index.DGWHQFdx.js +6 -0
- package/lib/chunks/layout.DbBSbLgm.js +1 -0
- package/lib/chunks/layout.sgE9JoNq.js +1 -0
- package/lib/chunks/publish.3TrK3fZf.js +1 -0
- package/lib/chunks/request.D8T4MgGX.js +1 -0
- package/lib/chunks/usePreview.2PZJSy5w.js +1 -0
- package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
- package/lib/index.js +2 -4
- package/package.json +3 -3
- package/es/ExampleComponent.mjs +0 -35
- package/es/assets/BackBar.css +0 -1
- package/es/assets/ExampleComponent.css +0 -1
- package/es/chunks/BackBar.Bc2NIuzk.js +0 -645
- package/es/chunks/config.8htFF04x.js +0 -325
- package/es/chunks/config.CFWGjEdA.js +0 -49
- package/es/chunks/config.CfWAdyUH.js +0 -325
- package/es/chunks/i18n.Vhq-tZPw.js +0 -94
- package/es/chunks/i18n.ro9yz7rE.js +0 -94
- package/es/chunks/index.ml5i7aB5.js +0 -257
- package/es/chunks/index.s-YxIOfq.js +0 -301
- package/es/chunks/publish.D6friivo.js +0 -50
- package/es/chunks/publish.Dqzn7qEl.js +0 -50
- package/es/i18n.mjs +0 -17
- package/lib/ExampleComponent.js +0 -1
- package/lib/assets/BackBar.css +0 -1
- package/lib/assets/ExampleComponent.css +0 -1
- package/lib/chunks/BackBar.CZsNxoX1.js +0 -1
- package/lib/chunks/BackBar.s5_vN6jt.js +0 -1
- package/lib/chunks/config.Bs7sh3aP.js +0 -1
- package/lib/chunks/config.C1w4hgfw.js +0 -1
- package/lib/chunks/config.ClERt2RF.js +0 -1
- package/lib/chunks/enums.Dmq4PdUc.js +0 -1
- package/lib/chunks/i18n.CL5L6nx6.js +0 -1
- package/lib/chunks/i18n.aAXi5igh.js +0 -1
- package/lib/chunks/index.BNqTEn3K.js +0 -1
- package/lib/chunks/publish.Bw1acrSu.js +0 -1
- package/lib/chunks/publish.CA1uSVnm.js +0 -1
- package/lib/i18n.js +0 -1
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { w as re } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { resolveComponent as Z, createElementBlock as X, openBlock as U, createVNode as x, createElementVNode as I, unref as h, createBlock as V, createCommentVNode as ee, withCtx as k, toDisplayString as G, ref as M, computed as ie, watch as te, nextTick as ce, onUnmounted as ae, Fragment as oe, onMounted as ue, createTextVNode as de, normalizeStyle as pe, normalizeClass as fe, withModifiers as me } from "vue";
|
|
3
|
+
import { _ as ve } from "./chunks/AiboxTable.CF4T_OCu.js";
|
|
4
|
+
import { ParameterTable as _e, ARRAYTYPES as he } from "./ParameterTable.mjs";
|
|
5
|
+
import { ElTooltip as K, ElIcon as ne, ElSkeleton as ge, ElButton as ye, ElMessage as F } from "element-plus";
|
|
6
|
+
import { u as se } from "./chunks/i18n.k9Q_HVMs.js";
|
|
7
|
+
import { ApplicationIcon as Ie, SOURCE_TYPE as Te } from "color-star-custom-components";
|
|
8
|
+
import { _ as J } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
9
|
+
import { u as Oe, C as be } from "./chunks/index.BDd6hHiU.js";
|
|
10
|
+
import { g as Se } from "./chunks/request.24c3shPx.js";
|
|
11
|
+
import { useRoute as Ee } from "vue-router";
|
|
12
|
+
import './assets/McpParamsSet.css';const Me = { class: "header-nav" }, Ne = { class: "text-name" }, Re = { class: "text-name-nav" }, Ae = { class: "text-ellipsis" }, De = { class: "text-name-desc text-ellipsis" }, Ce = {
|
|
13
|
+
__name: "TextLeft",
|
|
14
|
+
props: {
|
|
15
|
+
detailData: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => {
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
showEdit: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["editMcp"],
|
|
26
|
+
setup(s, { emit: t }) {
|
|
27
|
+
const o = t, { t: p } = se(), O = (g) => g ? g.length > 50 ? g.slice(0, 50) + "..." : g : "", n = () => {
|
|
28
|
+
o("editMcp");
|
|
29
|
+
};
|
|
30
|
+
return (g, S) => {
|
|
31
|
+
const _ = Z("IconEdit2");
|
|
32
|
+
return U(), X("div", Me, [
|
|
33
|
+
x(h(Ie), {
|
|
34
|
+
row: s.detailData,
|
|
35
|
+
applicationType: h(Te).MCP,
|
|
36
|
+
iconField: "iconUrl",
|
|
37
|
+
size: 48
|
|
38
|
+
}, null, 8, ["row", "applicationType"]),
|
|
39
|
+
I("div", Ne, [
|
|
40
|
+
I("div", Re, [
|
|
41
|
+
x(h(K), {
|
|
42
|
+
content: s.detailData.name,
|
|
43
|
+
placement: "top",
|
|
44
|
+
"show-after": 500,
|
|
45
|
+
"popper-style": { maxWidth: "500px" }
|
|
46
|
+
}, {
|
|
47
|
+
default: k(() => [
|
|
48
|
+
I("div", Ae, G(O(
|
|
49
|
+
s.detailData.name || h(p)("CONFIGURATION_MCP_TOOL.LABEL_MCP_NAME")
|
|
50
|
+
)), 1)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["content"]),
|
|
54
|
+
s.showEdit ? (U(), V(h(ne), {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "edit-icon",
|
|
57
|
+
onClick: n
|
|
58
|
+
}, {
|
|
59
|
+
default: k(() => [
|
|
60
|
+
x(_)
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
})) : ee("", !0)
|
|
64
|
+
]),
|
|
65
|
+
x(h(K), {
|
|
66
|
+
content: s.detailData.description || h(p)("CONFIGURATION_MCP_TOOL.LABEL_DESCRIPTION"),
|
|
67
|
+
placement: "top",
|
|
68
|
+
"show-after": 500,
|
|
69
|
+
"popper-style": { maxWidth: "500px" }
|
|
70
|
+
}, {
|
|
71
|
+
default: k(() => [
|
|
72
|
+
I("div", De, G(O(
|
|
73
|
+
s.detailData.description || h(p)("CONFIGURATION_MCP_TOOL.LABEL_DESCRIPTION")
|
|
74
|
+
)), 1)
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["content"])
|
|
78
|
+
])
|
|
79
|
+
]);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}, Le = /* @__PURE__ */ J(Ce, [["__scopeId", "data-v-f291c753"]]), we = (s) => {
|
|
83
|
+
const {
|
|
84
|
+
heightRef: t,
|
|
85
|
+
defaultHeight: o,
|
|
86
|
+
minHeight: p,
|
|
87
|
+
maxHeight: O,
|
|
88
|
+
widthRef: n,
|
|
89
|
+
defaultWidth: g,
|
|
90
|
+
minWidth: S,
|
|
91
|
+
maxWidth: _,
|
|
92
|
+
direction: f = "vertical",
|
|
93
|
+
// 新增,默认只支持垂直
|
|
94
|
+
reverse: y = !1,
|
|
95
|
+
// 新增,默认false,右侧面板传true
|
|
96
|
+
onResizeStart: w,
|
|
97
|
+
onResizing: B,
|
|
98
|
+
onResizeEnd: R
|
|
99
|
+
} = s;
|
|
100
|
+
let T = !1, m = 0, C = 0, A = 0, P = 0;
|
|
101
|
+
const q = (D) => {
|
|
102
|
+
T = !0, (f === "vertical" || f === "both") && (m = D.clientY, C = t?.value), (f === "horizontal" || f === "both") && (A = D.clientX, P = n?.value), document.addEventListener("mousemove", H), document.addEventListener("mouseup", z), document.body.classList.add("resizing"), typeof w == "function" && w(D, { height: C, width: P });
|
|
103
|
+
}, H = (D) => {
|
|
104
|
+
if (!T) return;
|
|
105
|
+
let l, c, u, e;
|
|
106
|
+
if ((f === "vertical" || f === "both") && t && (c = D.clientY - m, l = Math.max(
|
|
107
|
+
p,
|
|
108
|
+
Math.min(O, C - c)
|
|
109
|
+
), t.value = l), (f === "horizontal" || f === "both") && n) {
|
|
110
|
+
e = D.clientX - A;
|
|
111
|
+
const a = y ? -e : e;
|
|
112
|
+
u = Math.max(
|
|
113
|
+
S ?? 0,
|
|
114
|
+
Math.min(_ ?? 1 / 0, P + a)
|
|
115
|
+
), n.value = u;
|
|
116
|
+
}
|
|
117
|
+
typeof B == "function" && B(D, { height: l, width: u, deltaY: c, deltaX: e });
|
|
118
|
+
}, z = (D) => {
|
|
119
|
+
T && (T = !1, document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", z), document.body.classList.remove("resizing"), typeof R == "function" && R(D, { height: t?.value, width: n?.value }));
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
startResize: q,
|
|
123
|
+
handleResize: H,
|
|
124
|
+
stopResize: z,
|
|
125
|
+
reset: () => {
|
|
126
|
+
t && typeof o == "number" && (t.value = o), n && typeof g == "number" && (n.value = g);
|
|
127
|
+
},
|
|
128
|
+
cleanup: () => {
|
|
129
|
+
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", z), document.body.classList.remove("resizing");
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
function xe(s) {
|
|
134
|
+
const t = M(130), o = 130, p = 350, O = M(130), n = we({
|
|
135
|
+
heightRef: t,
|
|
136
|
+
defaultHeight: 130,
|
|
137
|
+
minHeight: o,
|
|
138
|
+
maxHeight: 9999,
|
|
139
|
+
// 拖动时几乎不限制最大高度,这里不用MAX_BOX_HEIGHT,是为了避免初始化表格高度太高
|
|
140
|
+
// 记录开始拖拽时的高度
|
|
141
|
+
onResizeStart: (_, { height: f }) => {
|
|
142
|
+
O.value = f;
|
|
143
|
+
},
|
|
144
|
+
// 自定义调整逻辑,反转方向
|
|
145
|
+
onResizing: (_, { deltaY: f }) => {
|
|
146
|
+
const y = Math.max(
|
|
147
|
+
o,
|
|
148
|
+
O.value + f
|
|
149
|
+
// 移除最大高度限制
|
|
150
|
+
);
|
|
151
|
+
t.value = y;
|
|
152
|
+
},
|
|
153
|
+
// 在调整大小结束后执行检查
|
|
154
|
+
onResizeEnd: () => {
|
|
155
|
+
t.value < o && (t.value = S.value);
|
|
156
|
+
}
|
|
157
|
+
}), g = (_) => {
|
|
158
|
+
let f = 0;
|
|
159
|
+
const y = [..._];
|
|
160
|
+
for (; y.length; ) {
|
|
161
|
+
const w = y.pop();
|
|
162
|
+
f++;
|
|
163
|
+
const B = w.children || w.childItems;
|
|
164
|
+
B?.length && y.push(...B);
|
|
165
|
+
}
|
|
166
|
+
return f;
|
|
167
|
+
}, S = ie(() => {
|
|
168
|
+
const y = s.value || [], w = g(y) - 1;
|
|
169
|
+
return Math.max(
|
|
170
|
+
o,
|
|
171
|
+
Math.min(p, 130 + w * 64)
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
return te(
|
|
175
|
+
S,
|
|
176
|
+
(_) => {
|
|
177
|
+
n.isDragging || ce(() => {
|
|
178
|
+
t.value = _;
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
immediate: !0,
|
|
183
|
+
// 立即执行一次,确保初始化时也能正确设置高度
|
|
184
|
+
flush: "post"
|
|
185
|
+
// 在DOM更新后执行
|
|
186
|
+
}
|
|
187
|
+
), ae(() => {
|
|
188
|
+
n.cleanup();
|
|
189
|
+
}), {
|
|
190
|
+
resizer: n,
|
|
191
|
+
boxHeight: t
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
const Be = { class: "results-warp" }, Pe = { class: "results-warp__left_box" }, Fe = { class: "code-view__box" }, Ue = { class: "code-view__box_left" }, He = {
|
|
195
|
+
__name: "ResponseResult",
|
|
196
|
+
props: {
|
|
197
|
+
loading: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
default: !1
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
setup(s, { expose: t }) {
|
|
203
|
+
const { copyText: o } = Oe(), p = M("{}"), O = () => {
|
|
204
|
+
o(p.value);
|
|
205
|
+
};
|
|
206
|
+
return t({
|
|
207
|
+
jsonCode: p
|
|
208
|
+
}), (n, g) => {
|
|
209
|
+
const S = Z("IconCopy");
|
|
210
|
+
return U(), X(oe, null, [
|
|
211
|
+
I("div", Be, [
|
|
212
|
+
I("div", Pe, [
|
|
213
|
+
g[0] || (g[0] = I("div", { class: "results-warp__left_box_title" }, "response", -1)),
|
|
214
|
+
x(h(ne), {
|
|
215
|
+
class: "results-warp__left_box_copy",
|
|
216
|
+
onClick: O
|
|
217
|
+
}, {
|
|
218
|
+
default: k(() => [
|
|
219
|
+
x(S)
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
})
|
|
223
|
+
])
|
|
224
|
+
]),
|
|
225
|
+
I("div", Fe, [
|
|
226
|
+
I("div", Ue, [
|
|
227
|
+
s.loading ? (U(), V(h(ge), {
|
|
228
|
+
key: 0,
|
|
229
|
+
rows: 10,
|
|
230
|
+
animated: ""
|
|
231
|
+
})) : (U(), V(be, {
|
|
232
|
+
key: 1,
|
|
233
|
+
code: p.value,
|
|
234
|
+
language: "json"
|
|
235
|
+
}, null, 8, ["code"]))
|
|
236
|
+
])
|
|
237
|
+
])
|
|
238
|
+
], 64);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}, ze = /* @__PURE__ */ J(He, [["__scopeId", "data-v-85dcff2e"]]);
|
|
242
|
+
function ke() {
|
|
243
|
+
const s = M(!1), t = M(!1), o = M(null), p = M(/* @__PURE__ */ new Set()), O = 500, n = (R, T) => function(...m) {
|
|
244
|
+
o.value && clearTimeout(o.value), o.value = setTimeout(() => {
|
|
245
|
+
R.apply(this, m), o.value = null;
|
|
246
|
+
}, T);
|
|
247
|
+
}, g = () => {
|
|
248
|
+
s.value = !0;
|
|
249
|
+
}, S = () => {
|
|
250
|
+
s.value = !1;
|
|
251
|
+
};
|
|
252
|
+
return {
|
|
253
|
+
isDataModified: s,
|
|
254
|
+
isSaving: t,
|
|
255
|
+
markDataModified: g,
|
|
256
|
+
markDataSaved: S,
|
|
257
|
+
createAutoSaveHandler: (R, T) => n(async () => {
|
|
258
|
+
if (t.value || !s.value || T && !T())
|
|
259
|
+
return;
|
|
260
|
+
const C = `save_${Date.now()}_${Math.random()}`;
|
|
261
|
+
if (!(p.value.size > 0)) {
|
|
262
|
+
p.value.add(C), t.value = !0;
|
|
263
|
+
try {
|
|
264
|
+
const A = await R();
|
|
265
|
+
return A && A.code === 0 && S(), A;
|
|
266
|
+
} catch (A) {
|
|
267
|
+
throw console.error("自动保存失败:", A), A;
|
|
268
|
+
} finally {
|
|
269
|
+
p.value.delete(C), t.value = !1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}, O),
|
|
273
|
+
saveImmediately: async (R) => {
|
|
274
|
+
if (o.value && (clearTimeout(o.value), o.value = null), t.value) {
|
|
275
|
+
console.warn("正在保存中,请稍后再试");
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const T = `immediate_save_${Date.now()}`;
|
|
279
|
+
p.value.add(T), t.value = !0;
|
|
280
|
+
try {
|
|
281
|
+
const m = await R();
|
|
282
|
+
return m && m.code === 0 && S(), m;
|
|
283
|
+
} catch (m) {
|
|
284
|
+
throw console.error("立即保存失败:", m), m;
|
|
285
|
+
} finally {
|
|
286
|
+
p.value.delete(T), t.value = !1;
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
setupDataWatcher: (R, T, m = {}) => {
|
|
290
|
+
const C = {
|
|
291
|
+
deep: !0,
|
|
292
|
+
immediate: !1,
|
|
293
|
+
...m
|
|
294
|
+
};
|
|
295
|
+
return te(
|
|
296
|
+
R,
|
|
297
|
+
() => {
|
|
298
|
+
g(), T();
|
|
299
|
+
},
|
|
300
|
+
C
|
|
301
|
+
);
|
|
302
|
+
},
|
|
303
|
+
cleanup: () => {
|
|
304
|
+
o.value && (clearTimeout(o.value), o.value = null), p.value.clear(), s.value = !1, t.value = !1;
|
|
305
|
+
},
|
|
306
|
+
resetSaveState: () => {
|
|
307
|
+
s.value = !1, t.value = !1;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const Ge = () => {
|
|
312
|
+
const { $request: s, $env: t } = Se();
|
|
313
|
+
return {
|
|
314
|
+
callMcpTool: (p, O, n) => s({
|
|
315
|
+
url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/mcp/customize/call-mcp-tool/${p}/${O}`,
|
|
316
|
+
method: "post",
|
|
317
|
+
data: n
|
|
318
|
+
})
|
|
319
|
+
};
|
|
320
|
+
}, $e = { class: "header-nav-box" }, je = { class: "tool-created" }, Ve = { class: "parameter-settings" }, qe = { class: "parameter-title" }, We = { class: "response-results" }, Xe = { class: "response-title" }, Je = {
|
|
321
|
+
__name: "index",
|
|
322
|
+
props: {
|
|
323
|
+
getSnowFlakeId: {
|
|
324
|
+
type: Function,
|
|
325
|
+
default: () => () => Date.now()
|
|
326
|
+
},
|
|
327
|
+
mcpBnid: {
|
|
328
|
+
type: String,
|
|
329
|
+
default: ""
|
|
330
|
+
},
|
|
331
|
+
toolName: {
|
|
332
|
+
type: String,
|
|
333
|
+
default: ""
|
|
334
|
+
},
|
|
335
|
+
isBackendSystem: {
|
|
336
|
+
type: Boolean,
|
|
337
|
+
default: !1
|
|
338
|
+
},
|
|
339
|
+
propToolData: {
|
|
340
|
+
type: Object,
|
|
341
|
+
default: null
|
|
342
|
+
},
|
|
343
|
+
propMcpInfo: {
|
|
344
|
+
type: Object,
|
|
345
|
+
default: null
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
setup(s, { expose: t }) {
|
|
349
|
+
const o = s, p = ke(), { markDataModified: O } = p, { t: n } = se(), g = Ee(), S = M({}), _ = M({}), f = M(null), y = M(null), { callMcpTool: w } = Ge(), B = () => {
|
|
350
|
+
}, R = async () => {
|
|
351
|
+
try {
|
|
352
|
+
const l = sessionStorage.getItem("mcp_debug_mcpData");
|
|
353
|
+
(l || o.propMcpInfo) && (S.value = o.propMcpInfo || JSON.parse(l));
|
|
354
|
+
const c = sessionStorage.getItem("mcp_debug_toolData");
|
|
355
|
+
if ((c || o.propToolData) && (_.value = o.propToolData || JSON.parse(c), _.value.inputSchema && _.value.inputSchema.properties)) {
|
|
356
|
+
const u = _.value.inputSchema.properties, e = _.value.inputSchema.required || [];
|
|
357
|
+
let a = 0;
|
|
358
|
+
const E = () => `param_${a++}`, d = (b, i = [], r = 1) => Object.keys(b).map((N) => {
|
|
359
|
+
const v = b[N];
|
|
360
|
+
let L = v.type || "string";
|
|
361
|
+
const $ = {
|
|
362
|
+
name: N,
|
|
363
|
+
type: L,
|
|
364
|
+
description: v.description || "",
|
|
365
|
+
required: i.includes(N),
|
|
366
|
+
uiid: E(),
|
|
367
|
+
disabled: !1,
|
|
368
|
+
deep: r,
|
|
369
|
+
value: ""
|
|
370
|
+
// 用户填写的值
|
|
371
|
+
};
|
|
372
|
+
if (L === "array" && v.items) {
|
|
373
|
+
const j = v.items.type;
|
|
374
|
+
if (L = {
|
|
375
|
+
string: "arrayString",
|
|
376
|
+
number: "arrayNumber",
|
|
377
|
+
integer: "arrayInteger",
|
|
378
|
+
boolean: "arrayBoolean",
|
|
379
|
+
object: "arrayObject",
|
|
380
|
+
file: "arrayFile",
|
|
381
|
+
image: "arrayImage"
|
|
382
|
+
}[j] || "arrayString", $.type = L, j === "object" && v.items.properties) {
|
|
383
|
+
const le = v.items.required || [], Q = {
|
|
384
|
+
name: "[Array Item]",
|
|
385
|
+
type: "object",
|
|
386
|
+
description: "",
|
|
387
|
+
required: !1,
|
|
388
|
+
uiid: E(),
|
|
389
|
+
disabled: !1,
|
|
390
|
+
deep: r + 1,
|
|
391
|
+
value: ""
|
|
392
|
+
};
|
|
393
|
+
Q.children = d(
|
|
394
|
+
v.items.properties,
|
|
395
|
+
le,
|
|
396
|
+
r + 2
|
|
397
|
+
), $.children = [Q];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (L === "object" && v.properties) {
|
|
401
|
+
const j = v.required || [];
|
|
402
|
+
$.children = d(
|
|
403
|
+
v.properties,
|
|
404
|
+
j,
|
|
405
|
+
r + 1
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
return $;
|
|
409
|
+
});
|
|
410
|
+
m.value = d(u, e, 1);
|
|
411
|
+
}
|
|
412
|
+
} catch (l) {
|
|
413
|
+
console.error("解析数据失败:", l), F.error(n("CONFIGURATION_MCP_TOOL.LABEL_LOAD_DATA_FAILED"));
|
|
414
|
+
}
|
|
415
|
+
}, T = M(!1), m = M([
|
|
416
|
+
{
|
|
417
|
+
name: "",
|
|
418
|
+
type: "string",
|
|
419
|
+
description: "",
|
|
420
|
+
required: !1,
|
|
421
|
+
uiid: "111",
|
|
422
|
+
disabled: !1,
|
|
423
|
+
deep: 1
|
|
424
|
+
}
|
|
425
|
+
]), { resizer: C, boxHeight: A } = xe(m), P = M(!1), q = () => {
|
|
426
|
+
const l = document.querySelector(".parameter-input-box");
|
|
427
|
+
l && (l.scrollTop = l.scrollHeight);
|
|
428
|
+
}, H = () => {
|
|
429
|
+
O();
|
|
430
|
+
}, z = (l) => {
|
|
431
|
+
console.log("校验结果:", l);
|
|
432
|
+
}, W = () => f.value?.validateAllRows(), Y = () => {
|
|
433
|
+
const l = {}, c = (e) => e === "array" || he.includes(e), u = (e) => {
|
|
434
|
+
if (!e.children || e.children.length === 0)
|
|
435
|
+
return;
|
|
436
|
+
const a = e.type;
|
|
437
|
+
if (c(a)) {
|
|
438
|
+
const E = [];
|
|
439
|
+
return e.children.forEach((d) => {
|
|
440
|
+
if (d.children && d.children.length > 0) {
|
|
441
|
+
const b = u(d);
|
|
442
|
+
b !== void 0 && E.push(b);
|
|
443
|
+
} else {
|
|
444
|
+
const b = d.value;
|
|
445
|
+
let i = b !== void 0 && b !== "" ? b : "";
|
|
446
|
+
const r = d.type;
|
|
447
|
+
r === "number" || r === "integer" ? i = i === "" ? 0 : Number(i) : r === "boolean" ? i = i === "" ? !1 : !!i : r === "object" ? i = u(d) || {} : c(r) && (i = u(d) || []), E.push(i);
|
|
448
|
+
}
|
|
449
|
+
}), E;
|
|
450
|
+
}
|
|
451
|
+
if (a === "object") {
|
|
452
|
+
const E = {};
|
|
453
|
+
return e.children.forEach((d) => {
|
|
454
|
+
const b = d.name;
|
|
455
|
+
if (!b || b === "[Array Item]") {
|
|
456
|
+
b === "[Array Item]" && d.children && d.children.length > 0 && d.children.forEach((i) => {
|
|
457
|
+
const r = i.name;
|
|
458
|
+
if (r && r !== "[Array Item]")
|
|
459
|
+
if (i.children && i.children.length > 0)
|
|
460
|
+
E[r] = u(i);
|
|
461
|
+
else {
|
|
462
|
+
const N = i.value;
|
|
463
|
+
let v = N !== void 0 && N !== "" ? N : "";
|
|
464
|
+
const L = i.type;
|
|
465
|
+
L === "number" || L === "integer" ? v = v === "" ? 0 : Number(v) : L === "boolean" ? v = v === "" ? !1 : !!v : L === "object" ? v = u(i) || {} : c(L) && (v = u(i) || []), E[r] = v;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (d.children && d.children.length > 0)
|
|
471
|
+
E[b] = u(d);
|
|
472
|
+
else {
|
|
473
|
+
const i = d.value;
|
|
474
|
+
let r = i !== void 0 && i !== "" ? i : "";
|
|
475
|
+
const N = d.type;
|
|
476
|
+
N === "number" || N === "integer" ? r = r === "" ? 0 : Number(r) : N === "boolean" ? r = r === "" ? !1 : !!r : N === "object" ? r = u(d) || {} : c(N) && (r = u(d) || []), E[b] = r;
|
|
477
|
+
}
|
|
478
|
+
}), E;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
return m.value.forEach((e) => {
|
|
482
|
+
if (e.name && e.name.trim()) {
|
|
483
|
+
let a;
|
|
484
|
+
if (e.children && e.children.length > 0)
|
|
485
|
+
a = u(e);
|
|
486
|
+
else if (a = e.value || "", a != null && a !== "") {
|
|
487
|
+
if (e.type === "number" || e.type === "integer")
|
|
488
|
+
a = Number(a);
|
|
489
|
+
else if (e.type === "boolean")
|
|
490
|
+
a = a === "true" || a === !0;
|
|
491
|
+
else if (c(e.type) || e.type === "object")
|
|
492
|
+
try {
|
|
493
|
+
a = typeof a == "string" ? JSON.parse(a) : a;
|
|
494
|
+
} catch (E) {
|
|
495
|
+
console.warn(`参数 ${e.name} JSON解析失败:`, E), a = c(e.type) ? [] : {};
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
(a === void 0 || a === "") && (c(e.type) ? a = [] : e.type === "object" ? a = {} : e.type === "number" || e.type === "integer" ? a = 0 : e.type === "boolean" ? a = !1 : a = ""), l[e.name] = a;
|
|
499
|
+
}
|
|
500
|
+
}), l;
|
|
501
|
+
}, D = async () => {
|
|
502
|
+
try {
|
|
503
|
+
const l = await W();
|
|
504
|
+
if (l && l.length > 0) {
|
|
505
|
+
F.warning(n("CONFIGURATION_MCP_TOOL.LABEL_REQUIRED_PARAMETERS"));
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
if (!S.value.address) {
|
|
509
|
+
F.warning(n("CONFIGURATION_MCP_TOOL.MCP_ADDRESS_NULL"));
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const c = _.value.name;
|
|
513
|
+
if (!c) {
|
|
514
|
+
F.warning(n("CONFIGURATION_MCP_TOOL.CRAFTSMANSHIP_SPIRIT"));
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
P.value = !0;
|
|
518
|
+
const u = Y();
|
|
519
|
+
console.log("调用MCP工具参数:", u), console.log("工具名称:", c);
|
|
520
|
+
const e = await w(
|
|
521
|
+
g.params.bnId || o.mcpBnid,
|
|
522
|
+
c,
|
|
523
|
+
u
|
|
524
|
+
);
|
|
525
|
+
console.log("MCP工具调用返回:", e), e.code === 0 ? (y.value && (y.value.jsonCode = JSON.stringify(
|
|
526
|
+
e.data || e,
|
|
527
|
+
null,
|
|
528
|
+
2
|
|
529
|
+
)), F.success(n("CONFIGURATION_MCP_TOOL.DEBUG_SUCCESS"))) : (F.error(e.message || n("CONFIGURATION_MCP_TOOL.DEBUG_FAILED")), y.value && (y.value.jsonCode = JSON.stringify(e, null, 2)));
|
|
530
|
+
} catch (l) {
|
|
531
|
+
console.error("调试失败:", l), F.error(l.message || n("CONFIGURATION_MCP_TOOL.DEBUG_FAILED")), y.value && (y.value.jsonCode = JSON.stringify(
|
|
532
|
+
{
|
|
533
|
+
error: l.message || n("CONFIGURATION_MCP_TOOL.DEBUG_FAILED"),
|
|
534
|
+
details: l
|
|
535
|
+
},
|
|
536
|
+
null,
|
|
537
|
+
2
|
|
538
|
+
));
|
|
539
|
+
} finally {
|
|
540
|
+
P.value = !1;
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
return ue(() => {
|
|
544
|
+
R();
|
|
545
|
+
}), ae(() => {
|
|
546
|
+
sessionStorage.removeItem("mcp_debug_mcpData"), sessionStorage.removeItem("mcp_debug_toolData");
|
|
547
|
+
}), t({
|
|
548
|
+
validateAll: W,
|
|
549
|
+
handleDebug: D
|
|
550
|
+
}), (l, c) => (U(), X(oe, null, [
|
|
551
|
+
s.isBackendSystem ? ee("", !0) : (U(), V(ve, { key: 0 }, {
|
|
552
|
+
default: k(() => [
|
|
553
|
+
I("div", $e, [
|
|
554
|
+
x(Le, {
|
|
555
|
+
"detail-data": _.value,
|
|
556
|
+
"show-edit": !1,
|
|
557
|
+
onEditMcp: B
|
|
558
|
+
}, null, 8, ["detail-data"]),
|
|
559
|
+
x(h(ye), {
|
|
560
|
+
type: "primary",
|
|
561
|
+
loading: P.value,
|
|
562
|
+
onClick: D
|
|
563
|
+
}, {
|
|
564
|
+
default: k(() => [
|
|
565
|
+
de(G(h(n)("CONFIGURATION_MCP_TOOL.LABEL_DEBUG_TOOL")), 1)
|
|
566
|
+
]),
|
|
567
|
+
_: 1
|
|
568
|
+
}, 8, ["loading"])
|
|
569
|
+
])
|
|
570
|
+
]),
|
|
571
|
+
_: 1
|
|
572
|
+
})),
|
|
573
|
+
I("div", je, [
|
|
574
|
+
I("div", Ve, [
|
|
575
|
+
I("p", qe, G(h(n)("CONFIGURATION_MCP_TOOL.LABEL_PARAMETER_SETTINGS")), 1),
|
|
576
|
+
I("div", {
|
|
577
|
+
class: fe(["parameter-input-box", { "backend-system": s.isBackendSystem }]),
|
|
578
|
+
style: pe({ height: h(A) + "px" })
|
|
579
|
+
}, [
|
|
580
|
+
x(h(_e), {
|
|
581
|
+
ref_key: "parameterTableRef",
|
|
582
|
+
ref: f,
|
|
583
|
+
tableData: m.value,
|
|
584
|
+
"onUpdate:tableData": c[0] || (c[0] = (u) => m.value = u),
|
|
585
|
+
isPluginMode: !0,
|
|
586
|
+
isDataType: !1,
|
|
587
|
+
loadingTable: T.value,
|
|
588
|
+
maxHeight: h(A),
|
|
589
|
+
disabled: !1,
|
|
590
|
+
disabledFields: [
|
|
591
|
+
"name",
|
|
592
|
+
"type",
|
|
593
|
+
"description",
|
|
594
|
+
"required",
|
|
595
|
+
"add",
|
|
596
|
+
"delete"
|
|
597
|
+
],
|
|
598
|
+
customFieldName: {
|
|
599
|
+
name: "name",
|
|
600
|
+
type: "type",
|
|
601
|
+
value: "value"
|
|
602
|
+
},
|
|
603
|
+
getSnowFlakeId: s.getSnowFlakeId,
|
|
604
|
+
onNameOrTypeChangeValue: H,
|
|
605
|
+
onDataNameValidate: z,
|
|
606
|
+
onScrollToBottom: q
|
|
607
|
+
}, null, 8, ["tableData", "loadingTable", "maxHeight", "getSnowFlakeId"])
|
|
608
|
+
], 6)
|
|
609
|
+
]),
|
|
610
|
+
I("div", {
|
|
611
|
+
class: "resize-handle",
|
|
612
|
+
onMousedown: c[1] || (c[1] = me((...u) => h(C).startResize && h(C).startResize(...u), ["prevent"]))
|
|
613
|
+
}, null, 32),
|
|
614
|
+
I("div", We, [
|
|
615
|
+
I("p", Xe, G(h(n)("CONFIGURATION_MCP_TOOL.LABEL_RESPONSE_RESULTS")), 1),
|
|
616
|
+
x(ze, {
|
|
617
|
+
ref_key: "responseMessage",
|
|
618
|
+
ref: y,
|
|
619
|
+
loading: P.value
|
|
620
|
+
}, null, 8, ["loading"])
|
|
621
|
+
])
|
|
622
|
+
])
|
|
623
|
+
], 64));
|
|
624
|
+
}
|
|
625
|
+
}, Ye = /* @__PURE__ */ J(Je, [["__scopeId", "data-v-385912ff"]]), ct = re(Ye);
|
|
626
|
+
export {
|
|
627
|
+
ct as McpParamsSet,
|
|
628
|
+
Le as TextLeft,
|
|
629
|
+
ct as default
|
|
630
|
+
};
|