@opentiny/tiny-robot 0.3.0-alpha.21 → 0.3.0-alpha.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/dist/index.d.ts +2 -0
- package/dist/mcp-add-form/index.js +22 -22
- package/dist/mcp-server-picker/index.js +172 -167
- package/dist/sender/index.js +640 -641
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TinyPopconfirm as
|
|
3
|
-
import { IconArrowRight as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { o as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as q, ref as V, computed as p, createElementBlock as i, openBlock as o, normalizeClass as G, createElementVNode as s, createBlock as k, createCommentVNode as v, toDisplayString as S, renderSlot as U, Fragment as F, unref as d, createVNode as m, withCtx as T, Transition as K, withDirectives as pe, renderList as N, vShow as ge, mergeModels as J, useModel as oe, watch as H, normalizeStyle as _e, createTextVNode as me } from "vue";
|
|
2
|
+
import { TinyPopconfirm as ve, TinySwitch as X, TinyTabs as fe, TinyTabItem as Y, TinyInput as Z, TinyBaseSelect as he, TinyOption as ye } from "@opentiny/vue";
|
|
3
|
+
import { IconArrowRight as ke, IconArrowDown as be, IconDelete as Te, IconClose as ae, IconEmptySearch as Ce, IconPlus as Pe, IconSearch as ee } from "@opentiny/tiny-robot-svgs";
|
|
4
|
+
import { _ as z } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
import { _ as we } from "../no-data.js";
|
|
6
|
+
import { o as Se } from "../index2.js";
|
|
7
|
+
import $e from "../mcp-add-form/index.js";
|
|
8
|
+
const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-card__content" }, Ae = { class: "plugin-card__info" }, Fe = { class: "plugin-card__name" }, Me = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "plugin-card__count"
|
|
11
|
-
},
|
|
11
|
+
}, De = ["title"], Ie = { class: "plugin-card__actions" }, Ee = { class: "plugin-card__operations" }, Le = { title: "移除插件" }, Ue = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "plugin-card__add"
|
|
14
|
-
},
|
|
14
|
+
}, Ne = { key: 0 }, Oe = { key: 1 }, qe = { key: 2 }, ze = { class: "plugin-card__tools" }, Qe = { class: "plugin-card__tool" }, Re = { class: "plugin-card__content" }, je = { class: "plugin-card__info" }, He = { class: "plugin-card__name" }, Ge = ["title"], Je = { class: "plugin-card__actions plugin-card__actions--tool" }, Ke = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "plugin-card__divider"
|
|
17
|
-
},
|
|
17
|
+
}, We = /* @__PURE__ */ q({
|
|
18
18
|
__name: "PluginCard",
|
|
19
19
|
props: {
|
|
20
20
|
plugin: {},
|
|
@@ -23,83 +23,83 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
23
23
|
},
|
|
24
24
|
emits: ["toggle-plugin", "toggle-tool", "add-plugin", "delete-plugin"],
|
|
25
25
|
setup(g, { emit: b }) {
|
|
26
|
-
const e = g, r = b,
|
|
27
|
-
var
|
|
28
|
-
return ((
|
|
26
|
+
const e = g, r = b, c = V(e.plugin.expanded || !1), f = p(() => {
|
|
27
|
+
var a;
|
|
28
|
+
return ((a = e.plugin.tools) == null ? void 0 : a.length) || 0;
|
|
29
29
|
}), h = p(() => f.value > 0), C = p(() => ({
|
|
30
30
|
"plugin-card--expandable": h.value,
|
|
31
|
-
"plugin-card--expanded":
|
|
31
|
+
"plugin-card--expanded": c.value,
|
|
32
32
|
[`plugin-card--${e.mode}`]: !0
|
|
33
33
|
})), w = () => {
|
|
34
|
-
h.value && (
|
|
34
|
+
h.value && (c.value = !c.value);
|
|
35
35
|
}, $ = p(() => {
|
|
36
36
|
if (!h.value)
|
|
37
37
|
return { checked: e.plugin.enabled || !1, indeterminate: !1 };
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
}), Q = (
|
|
38
|
+
const a = e.plugin.tools.filter((y) => y.enabled), _ = e.plugin.tools.length;
|
|
39
|
+
return a.length === 0 ? { checked: !1, indeterminate: !1 } : a.length === _ ? { checked: !0, indeterminate: !1 } : { checked: !0, indeterminate: !0 };
|
|
40
|
+
}), Q = (a) => {
|
|
41
41
|
h.value && e.plugin.tools.forEach((_) => {
|
|
42
|
-
_.enabled !==
|
|
43
|
-
}), r("toggle-plugin",
|
|
44
|
-
}, R = (
|
|
45
|
-
r("toggle-tool",
|
|
46
|
-
},
|
|
42
|
+
_.enabled !== a && (_.enabled = a, r("toggle-tool", _.id, a));
|
|
43
|
+
}), r("toggle-plugin", a);
|
|
44
|
+
}, R = (a, _) => {
|
|
45
|
+
r("toggle-tool", a, _);
|
|
46
|
+
}, D = () => {
|
|
47
47
|
r("delete-plugin");
|
|
48
|
-
}, x = p(() => e.plugin.addState || "idle"),
|
|
49
|
-
x.value === "idle" && r("add-plugin",
|
|
50
|
-
}, E = (
|
|
51
|
-
return (
|
|
48
|
+
}, x = p(() => e.plugin.addState || "idle"), I = (a) => {
|
|
49
|
+
x.value === "idle" && r("add-plugin", a);
|
|
50
|
+
}, E = (a) => a ? "关闭插件" : "打开插件";
|
|
51
|
+
return (a, _) => (o(), i("div", {
|
|
52
52
|
class: G(["plugin-card", C.value])
|
|
53
53
|
}, [
|
|
54
|
-
s("div",
|
|
54
|
+
s("div", xe, [
|
|
55
55
|
s("img", {
|
|
56
|
-
src:
|
|
56
|
+
src: a.plugin.icon,
|
|
57
57
|
class: "plugin-card__icon"
|
|
58
|
-
}, null, 8,
|
|
59
|
-
s("div",
|
|
60
|
-
s("div",
|
|
61
|
-
s("span",
|
|
62
|
-
|
|
58
|
+
}, null, 8, Be),
|
|
59
|
+
s("div", Ve, [
|
|
60
|
+
s("div", Ae, [
|
|
61
|
+
s("span", Fe, S(a.plugin.name), 1),
|
|
62
|
+
a.showToolCount && f.value ? (o(), i("span", Me, S(f.value) + " 个工具 ", 1)) : v("", !0)
|
|
63
63
|
]),
|
|
64
64
|
s("div", {
|
|
65
65
|
class: "plugin-card__desc",
|
|
66
|
-
title:
|
|
67
|
-
}, S(
|
|
66
|
+
title: a.plugin.description
|
|
67
|
+
}, S(a.plugin.description), 9, De)
|
|
68
68
|
]),
|
|
69
69
|
s("div", Ie, [
|
|
70
|
-
U(
|
|
71
|
-
plugin:
|
|
72
|
-
expanded:
|
|
73
|
-
mode:
|
|
70
|
+
U(a.$slots, "actions", {
|
|
71
|
+
plugin: a.plugin,
|
|
72
|
+
expanded: c.value,
|
|
73
|
+
mode: a.mode
|
|
74
74
|
}, () => [
|
|
75
|
-
|
|
75
|
+
a.mode === "installed" ? (o(), i(F, { key: 0 }, [
|
|
76
76
|
h.value ? (o(), i("div", {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "plugin-card__expand",
|
|
79
79
|
onClick: w
|
|
80
80
|
}, [
|
|
81
|
-
U(
|
|
82
|
-
|
|
81
|
+
U(a.$slots, "expand-icon", { expanded: c.value }, () => [
|
|
82
|
+
c.value ? (o(), k(d(be), {
|
|
83
83
|
key: 1,
|
|
84
84
|
class: "common-icon"
|
|
85
|
-
})) : (o(), k(d(
|
|
85
|
+
})) : (o(), k(d(ke), {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: "common-icon"
|
|
88
88
|
}))
|
|
89
89
|
], !0)
|
|
90
90
|
])) : v("", !0),
|
|
91
|
-
s("div",
|
|
92
|
-
m(d(
|
|
91
|
+
s("div", Ee, [
|
|
92
|
+
m(d(ve), {
|
|
93
93
|
title: "确定移除该插件吗?",
|
|
94
94
|
style: { height: "16px" },
|
|
95
95
|
type: "info",
|
|
96
|
-
onConfirm:
|
|
96
|
+
onConfirm: D,
|
|
97
97
|
trigger: "click"
|
|
98
98
|
}, {
|
|
99
99
|
reference: T(() => [
|
|
100
|
-
U(
|
|
101
|
-
s("span",
|
|
102
|
-
m(d(
|
|
100
|
+
U(a.$slots, "delete-icon", {}, () => [
|
|
101
|
+
s("span", Le, [
|
|
102
|
+
m(d(Te), { class: "common-icon delete" })
|
|
103
103
|
])
|
|
104
104
|
], !0)
|
|
105
105
|
]),
|
|
@@ -112,16 +112,16 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
112
112
|
"onUpdate:modelValue": Q
|
|
113
113
|
}, null, 8, ["title", "model-value", "indeterminate"])
|
|
114
114
|
])
|
|
115
|
-
], 64)) :
|
|
116
|
-
U(
|
|
115
|
+
], 64)) : a.mode === "market" ? (o(), i("div", Ue, [
|
|
116
|
+
U(a.$slots, "add-button", {}, () => [
|
|
117
117
|
s("div", {
|
|
118
118
|
class: G(["plugin-card__add-button", {
|
|
119
119
|
"plugin-card__add-button--loading": x.value === "loading",
|
|
120
120
|
"plugin-card__add-button--added": x.value === "added"
|
|
121
121
|
}]),
|
|
122
|
-
onClick: _[0] || (_[0] = (y) =>
|
|
122
|
+
onClick: _[0] || (_[0] = (y) => I(a.plugin))
|
|
123
123
|
}, [
|
|
124
|
-
x.value === "idle" ? (o(), i("span",
|
|
124
|
+
x.value === "idle" ? (o(), i("span", Ne, "添加")) : x.value === "loading" ? (o(), i("span", Oe, "添加中")) : (o(), i("span", qe, "已添加"))
|
|
125
125
|
], 2)
|
|
126
126
|
], !0)
|
|
127
127
|
])) : v("", !0)
|
|
@@ -133,26 +133,26 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
133
133
|
name: "plugin-card-slide"
|
|
134
134
|
}, {
|
|
135
135
|
default: T(() => [
|
|
136
|
-
|
|
136
|
+
pe(s("div", ze, [
|
|
137
137
|
_[2] || (_[2] = s("div", { class: "plugin-card__divider" }, null, -1)),
|
|
138
|
-
(o(!0), i(F, null, N(
|
|
138
|
+
(o(!0), i(F, null, N(a.plugin.tools, (y, A) => {
|
|
139
139
|
var L;
|
|
140
140
|
return o(), i("div", {
|
|
141
141
|
key: y.id,
|
|
142
142
|
class: "plugin-card__tool-item"
|
|
143
143
|
}, [
|
|
144
|
-
s("div",
|
|
144
|
+
s("div", Qe, [
|
|
145
145
|
_[1] || (_[1] = s("div", { class: "plugin-card__icon plugin-card__icon--placeholder" }, null, -1)),
|
|
146
|
-
s("div",
|
|
147
|
-
s("div",
|
|
148
|
-
s("span",
|
|
146
|
+
s("div", Re, [
|
|
147
|
+
s("div", je, [
|
|
148
|
+
s("span", He, S(y.name), 1)
|
|
149
149
|
]),
|
|
150
150
|
s("div", {
|
|
151
151
|
class: "plugin-card__desc",
|
|
152
152
|
title: y.description
|
|
153
|
-
}, S(y.description), 9,
|
|
153
|
+
}, S(y.description), 9, Ge)
|
|
154
154
|
]),
|
|
155
|
-
s("div",
|
|
155
|
+
s("div", Je, [
|
|
156
156
|
m(d(X), {
|
|
157
157
|
title: E(y.enabled),
|
|
158
158
|
"model-value": y.enabled,
|
|
@@ -160,21 +160,21 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
160
160
|
}, null, 8, ["title", "model-value", "onUpdate:modelValue"])
|
|
161
161
|
])
|
|
162
162
|
]),
|
|
163
|
-
A < (((L =
|
|
163
|
+
A < (((L = a.plugin.tools) == null ? void 0 : L.length) || 0) - 1 ? (o(), i("div", Ke)) : v("", !0)
|
|
164
164
|
]);
|
|
165
165
|
}), 128))
|
|
166
166
|
], 512), [
|
|
167
|
-
[
|
|
167
|
+
[ge, c.value]
|
|
168
168
|
])
|
|
169
169
|
]),
|
|
170
170
|
_: 1
|
|
171
171
|
})) : v("", !0)
|
|
172
172
|
], 2));
|
|
173
173
|
}
|
|
174
|
-
}), te = /* @__PURE__ */
|
|
174
|
+
}), te = /* @__PURE__ */ z(We, [["__scopeId", "data-v-c4e722eb"]]), Xe = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "plugin-editor__backdrop"
|
|
177
|
-
},
|
|
177
|
+
}, Ye = { class: "plugin-editor__header" }, Ze = /* @__PURE__ */ q({
|
|
178
178
|
__name: "PluginModal",
|
|
179
179
|
props: {
|
|
180
180
|
visible: { type: Boolean, required: !0 },
|
|
@@ -182,33 +182,33 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
182
182
|
},
|
|
183
183
|
emits: /* @__PURE__ */ J(["update:visible", "confirm"], ["update:visible"]),
|
|
184
184
|
setup(g, { emit: b }) {
|
|
185
|
-
const e = b, r = oe(g, "visible"),
|
|
185
|
+
const e = b, r = oe(g, "visible"), c = V(null), f = () => {
|
|
186
186
|
r.value = !1;
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
Se(c, () => {
|
|
189
189
|
r.value && f();
|
|
190
190
|
});
|
|
191
191
|
const h = (C, w) => {
|
|
192
192
|
C === "form" ? e("confirm", "form", w) : e("confirm", "code", w), f();
|
|
193
193
|
};
|
|
194
194
|
return (C, w) => (o(), i(F, null, [
|
|
195
|
-
r.value ? (o(), i("div",
|
|
195
|
+
r.value ? (o(), i("div", Xe)) : v("", !0),
|
|
196
196
|
m(K, { name: "plugin-editor" }, {
|
|
197
197
|
default: T(() => [
|
|
198
198
|
r.value ? (o(), i("div", {
|
|
199
199
|
key: 0,
|
|
200
200
|
class: "plugin-editor",
|
|
201
201
|
ref_key: "dialogRef",
|
|
202
|
-
ref:
|
|
202
|
+
ref: c
|
|
203
203
|
}, [
|
|
204
|
-
s("div",
|
|
204
|
+
s("div", Ye, [
|
|
205
205
|
w[0] || (w[0] = s("h3", { class: "plugin-editor__title" }, "添加插件", -1)),
|
|
206
|
-
m(d(
|
|
206
|
+
m(d(ae), {
|
|
207
207
|
class: "plugin-editor__close",
|
|
208
208
|
onClick: f
|
|
209
209
|
})
|
|
210
210
|
]),
|
|
211
|
-
m(d(
|
|
211
|
+
m(d($e), {
|
|
212
212
|
onConfirm: h,
|
|
213
213
|
onCancel: f
|
|
214
214
|
})
|
|
@@ -218,57 +218,57 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
218
218
|
})
|
|
219
219
|
], 64));
|
|
220
220
|
}
|
|
221
|
-
}),
|
|
221
|
+
}), et = /* @__PURE__ */ z(Ze, [["__scopeId", "data-v-f2f12f4a"]]), tt = {
|
|
222
222
|
class: "empty-state",
|
|
223
223
|
role: "status",
|
|
224
224
|
"aria-live": "polite"
|
|
225
|
-
},
|
|
225
|
+
}, lt = {
|
|
226
226
|
key: 1,
|
|
227
|
-
src:
|
|
227
|
+
src: we,
|
|
228
228
|
class: "empty-state__illustration"
|
|
229
|
-
},
|
|
229
|
+
}, ot = { class: "empty-state__message" }, at = /* @__PURE__ */ q({
|
|
230
230
|
__name: "NoData",
|
|
231
231
|
props: {
|
|
232
232
|
searchQuery: { default: "" }
|
|
233
233
|
},
|
|
234
234
|
setup(g) {
|
|
235
235
|
const b = g, e = p(() => {
|
|
236
|
-
var
|
|
237
|
-
return !!((
|
|
236
|
+
var c;
|
|
237
|
+
return !!((c = b.searchQuery) != null && c.trim());
|
|
238
238
|
}), r = p(() => e.value ? "暂无搜索结果" : "暂无数据");
|
|
239
|
-
return (
|
|
240
|
-
e.value ? (o(), k(d(
|
|
239
|
+
return (c, f) => (o(), i("section", tt, [
|
|
240
|
+
e.value ? (o(), k(d(Ce), {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: "empty-state__illustration"
|
|
243
|
-
})) : (o(), i("img",
|
|
244
|
-
s("p",
|
|
243
|
+
})) : (o(), i("img", lt)),
|
|
244
|
+
s("p", ot, S(r.value), 1)
|
|
245
245
|
]));
|
|
246
246
|
}
|
|
247
|
-
}), le = /* @__PURE__ */
|
|
247
|
+
}), le = /* @__PURE__ */ z(at, [["__scopeId", "data-v-05810d65"]]), nt = { class: "mcp-server-picker__header" }, it = { class: "mcp-server-picker__header-left" }, st = { class: "mcp-server-picker__header-right" }, rt = { class: "mcp-server-picker__content" }, dt = {
|
|
248
248
|
key: 0,
|
|
249
249
|
class: "mcp-server-picker__content-installed-search"
|
|
250
|
-
},
|
|
250
|
+
}, ct = {
|
|
251
251
|
key: 1,
|
|
252
252
|
class: "mcp-server-picker__content-list"
|
|
253
253
|
}, ut = {
|
|
254
254
|
key: 0,
|
|
255
255
|
class: "mcp-server-picker__loading"
|
|
256
|
-
},
|
|
256
|
+
}, pt = {
|
|
257
257
|
key: 0,
|
|
258
258
|
class: "mcp-server-picker__content-market-header"
|
|
259
|
-
},
|
|
259
|
+
}, gt = {
|
|
260
260
|
key: 0,
|
|
261
261
|
style: { width: "168px" }
|
|
262
|
-
},
|
|
262
|
+
}, _t = {
|
|
263
263
|
key: 1,
|
|
264
264
|
style: { width: "264px", "flex-shrink": "0" }
|
|
265
|
-
},
|
|
265
|
+
}, mt = {
|
|
266
266
|
key: 1,
|
|
267
267
|
class: "mcp-server-picker__content-list"
|
|
268
|
-
},
|
|
268
|
+
}, vt = {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "mcp-server-picker__loading"
|
|
271
|
-
},
|
|
271
|
+
}, ft = /* @__PURE__ */ q({
|
|
272
272
|
__name: "index",
|
|
273
273
|
props: /* @__PURE__ */ J({
|
|
274
274
|
installedPlugins: { default: () => [] },
|
|
@@ -307,8 +307,8 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
307
307
|
}),
|
|
308
308
|
emits: /* @__PURE__ */ J(["market-category-change", "tab-change", "plugin-toggle", "plugin-delete", "plugin-add", "plugin-create", "tool-toggle", "refresh", "update:activeCount", "update:visible"], ["update:visible"]),
|
|
309
309
|
setup(g, { emit: b }) {
|
|
310
|
-
const e = g, r = b,
|
|
311
|
-
() =>
|
|
310
|
+
const e = g, r = b, c = V(e.defaultActiveTab), f = V(""), h = V(""), C = V(""), w = p(
|
|
311
|
+
() => c.value === "installed" ? e.searchPlaceholder : "搜索市场插件"
|
|
312
312
|
), $ = p(() => e.installedPlugins), Q = p(() => e.marketPlugins), R = p(() => !$.value || $.value.length === 0 ? 0 : $.value.filter((t) => t.enabled).length);
|
|
313
313
|
H(
|
|
314
314
|
R,
|
|
@@ -316,33 +316,33 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
316
316
|
r("update:activeCount", t);
|
|
317
317
|
},
|
|
318
318
|
{ immediate: !0 }
|
|
319
|
-
), H(
|
|
320
|
-
t !==
|
|
319
|
+
), H(c, (t, n) => {
|
|
320
|
+
t !== n && r("tab-change", t);
|
|
321
321
|
});
|
|
322
|
-
const
|
|
323
|
-
const { category: t, search:
|
|
322
|
+
const D = p(() => $.value.filter((t) => e.installedSearchFn(f.value, t))), x = p(() => {
|
|
323
|
+
const { category: t, search: n } = {
|
|
324
324
|
category: C.value,
|
|
325
325
|
search: h.value
|
|
326
|
-
},
|
|
327
|
-
const P = !t || l.category === t, B = !
|
|
326
|
+
}, u = (l) => {
|
|
327
|
+
const P = !t || l.category === t, B = !n || e.marketSearchFn(n, l);
|
|
328
328
|
return P && B;
|
|
329
329
|
};
|
|
330
|
-
return Q.value.filter(
|
|
331
|
-
}),
|
|
330
|
+
return Q.value.filter(u);
|
|
331
|
+
}), I = p(() => c.value === "installed" ? D.value.length > 0 : x.value.length > 0);
|
|
332
332
|
H(C, (t) => {
|
|
333
333
|
r("market-category-change", t);
|
|
334
334
|
});
|
|
335
|
-
const E = (t,
|
|
336
|
-
var
|
|
337
|
-
e.allowPluginToggle && (r("plugin-toggle", t,
|
|
335
|
+
const E = (t, n) => {
|
|
336
|
+
var u;
|
|
337
|
+
e.allowPluginToggle && (r("plugin-toggle", t, n), (u = t.tools) != null && u.length && (n ? t.tools.filter((P) => P.enabled).length === 0 && t.tools.forEach((P) => {
|
|
338
338
|
r("tool-toggle", t, P.id, !0);
|
|
339
339
|
}) : t.tools.forEach((l) => {
|
|
340
340
|
l.enabled && r("tool-toggle", t, l.id, !1);
|
|
341
341
|
})));
|
|
342
|
-
},
|
|
342
|
+
}, a = (t, n, u) => {
|
|
343
343
|
var l;
|
|
344
|
-
if (e.allowToolToggle && (r("tool-toggle", t,
|
|
345
|
-
const P = t.tools.filter((M) => M.id !==
|
|
344
|
+
if (e.allowToolToggle && (r("tool-toggle", t, n, u), (l = t.tools) != null && l.length)) {
|
|
345
|
+
const P = t.tools.filter((M) => M.id !== n).some((M) => M.enabled), B = u || P;
|
|
346
346
|
t.enabled !== B && r("plugin-toggle", t, B);
|
|
347
347
|
}
|
|
348
348
|
}, _ = (t) => {
|
|
@@ -351,83 +351,86 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
351
351
|
e.allowPluginAdd && r("plugin-add", t);
|
|
352
352
|
}, A = V(!1), L = () => {
|
|
353
353
|
A.value = !0;
|
|
354
|
-
}, j = (t,
|
|
355
|
-
r("plugin-create", t,
|
|
356
|
-
},
|
|
354
|
+
}, j = (t, n) => {
|
|
355
|
+
r("plugin-create", t, n), A.value = !1;
|
|
356
|
+
}, ne = oe(g, "visible"), ie = () => {
|
|
357
357
|
r("update:visible", !1);
|
|
358
358
|
}, se = p(() => {
|
|
359
|
-
const { type: t, position:
|
|
359
|
+
const { type: t, position: n, drawer: u } = e.popupConfig || {}, l = {
|
|
360
360
|
"z-index": "1000",
|
|
361
361
|
position: "fixed"
|
|
362
362
|
};
|
|
363
363
|
return t === "fixed" ? {
|
|
364
364
|
...l,
|
|
365
|
-
...re(
|
|
365
|
+
...re(n)
|
|
366
366
|
} : t === "drawer" ? {
|
|
367
367
|
...l,
|
|
368
|
-
...de(
|
|
368
|
+
...de(u)
|
|
369
369
|
} : l;
|
|
370
370
|
}), re = (t = {}) => {
|
|
371
|
-
const
|
|
372
|
-
return Object.entries(t).forEach(([
|
|
373
|
-
l !== void 0 && (
|
|
374
|
-
}), Object.keys(
|
|
371
|
+
const n = {};
|
|
372
|
+
return Object.entries(t).forEach(([u, l]) => {
|
|
373
|
+
l !== void 0 && (n[u] = typeof l == "number" ? `${l}px` : l);
|
|
374
|
+
}), Object.keys(n).length === 0 ? {
|
|
375
375
|
top: "50%",
|
|
376
376
|
left: "50%",
|
|
377
377
|
transform: "translate(-50%, -50%)"
|
|
378
|
-
} :
|
|
378
|
+
} : n;
|
|
379
379
|
}, de = (t = { direction: "right" }) => {
|
|
380
|
-
const { direction:
|
|
380
|
+
const { direction: n } = t, u = {
|
|
381
381
|
top: "0",
|
|
382
382
|
bottom: "0",
|
|
383
383
|
height: "100%"
|
|
384
384
|
};
|
|
385
|
-
return
|
|
386
|
-
...
|
|
385
|
+
return n === "left" ? {
|
|
386
|
+
...u,
|
|
387
387
|
left: "0",
|
|
388
388
|
"border-right": "1px solid rgb(219, 219, 219)"
|
|
389
389
|
} : {
|
|
390
|
-
...
|
|
390
|
+
...u,
|
|
391
391
|
right: "0",
|
|
392
392
|
"border-left": "1px solid rgb(219, 219, 219)"
|
|
393
393
|
};
|
|
394
394
|
}, W = p(() => {
|
|
395
|
-
const { type: t, drawer:
|
|
396
|
-
return t !== "drawer" ? "" : `drawer-${(
|
|
397
|
-
}),
|
|
395
|
+
const { type: t, drawer: n } = e.popupConfig || {};
|
|
396
|
+
return t !== "drawer" ? "" : `drawer-${(n == null ? void 0 : n.direction) || "right"}`;
|
|
397
|
+
}), ce = p(() => {
|
|
398
398
|
const { type: t } = e.popupConfig || {};
|
|
399
399
|
return t === "drawer" ? W.value : "fade";
|
|
400
|
-
})
|
|
401
|
-
|
|
400
|
+
}), ue = {
|
|
401
|
+
background: "var(--tr-mcp-server-picker-bg-default-2)",
|
|
402
|
+
color: "var(--tr-text-primary)"
|
|
403
|
+
};
|
|
404
|
+
return (t, n) => (o(), k(K, { name: ce.value }, {
|
|
402
405
|
default: T(() => {
|
|
403
|
-
var
|
|
406
|
+
var u;
|
|
404
407
|
return [
|
|
405
|
-
|
|
408
|
+
ne.value ? (o(), i("div", {
|
|
406
409
|
key: 0,
|
|
407
|
-
class: G(["mcp-server-picker", [`popup-type-${((
|
|
408
|
-
style:
|
|
410
|
+
class: G(["mcp-server-picker", [`popup-type-${((u = e.popupConfig) == null ? void 0 : u.type) || "fixed"}`, W.value]]),
|
|
411
|
+
style: _e(se.value)
|
|
409
412
|
}, [
|
|
410
413
|
s("div", nt, [
|
|
411
|
-
s("div",
|
|
412
|
-
s("div",
|
|
414
|
+
s("div", it, S(e.title), 1),
|
|
415
|
+
s("div", st, [
|
|
413
416
|
e.showCustomAddButton ? (o(), i("div", {
|
|
414
417
|
key: 0,
|
|
415
418
|
class: "mcp-server-picker__header-right-item",
|
|
416
419
|
onClick: L
|
|
417
420
|
}, [
|
|
418
|
-
m(d(
|
|
421
|
+
m(d(Pe), { class: "mcp-server-picker__icon" }),
|
|
419
422
|
s("span", null, S(e.customAddButtonText), 1)
|
|
420
423
|
])) : v("", !0),
|
|
421
|
-
m(d(
|
|
424
|
+
m(d(ae), {
|
|
422
425
|
class: "mcp-server-picker__header-right-close",
|
|
423
426
|
onClick: ie
|
|
424
427
|
})
|
|
425
428
|
])
|
|
426
429
|
]),
|
|
427
|
-
s("div",
|
|
428
|
-
m(d(
|
|
429
|
-
modelValue:
|
|
430
|
-
"onUpdate:modelValue":
|
|
430
|
+
s("div", rt, [
|
|
431
|
+
m(d(fe), {
|
|
432
|
+
modelValue: c.value,
|
|
433
|
+
"onUpdate:modelValue": n[3] || (n[3] = (l) => c.value = l)
|
|
431
434
|
}, {
|
|
432
435
|
default: T(() => [
|
|
433
436
|
e.showInstalledTab ? (o(), k(d(Y), {
|
|
@@ -436,20 +439,20 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
436
439
|
name: "installed"
|
|
437
440
|
}, {
|
|
438
441
|
default: T(() => [
|
|
439
|
-
e.enableSearch ? (o(), i("div",
|
|
442
|
+
e.enableSearch ? (o(), i("div", dt, [
|
|
440
443
|
m(d(Z), {
|
|
441
444
|
modelValue: f.value,
|
|
442
|
-
"onUpdate:modelValue":
|
|
445
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => f.value = l),
|
|
443
446
|
placeholder: e.searchPlaceholder
|
|
444
447
|
}, {
|
|
445
448
|
suffix: T(() => [
|
|
446
|
-
m(d(ee), {
|
|
449
|
+
m(d(ee), { class: "mcp-server-picker__icon" })
|
|
447
450
|
]),
|
|
448
451
|
_: 1
|
|
449
452
|
}, 8, ["modelValue", "placeholder"])
|
|
450
453
|
])) : v("", !0),
|
|
451
|
-
|
|
452
|
-
e.loading ? (o(), i("div", ut, "加载中...")) : (o(!0), i(F, { key: 1 }, N(
|
|
454
|
+
I.value ? (o(), i("div", ct, [
|
|
455
|
+
e.loading ? (o(), i("div", ut, "加载中...")) : (o(!0), i(F, { key: 1 }, N(D.value, (l) => {
|
|
453
456
|
var P;
|
|
454
457
|
return o(), k(d(te), {
|
|
455
458
|
key: l.id,
|
|
@@ -457,7 +460,7 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
457
460
|
mode: "installed",
|
|
458
461
|
expandable: !!((P = l.tools) != null && P.length),
|
|
459
462
|
onTogglePlugin: (B) => E(l, B),
|
|
460
|
-
onToggleTool: (B, M) =>
|
|
463
|
+
onToggleTool: (B, M) => a(l, B, M),
|
|
461
464
|
onDeletePlugin: () => _(l)
|
|
462
465
|
}, null, 8, ["plugin", "expandable", "onTogglePlugin", "onToggleTool", "onDeletePlugin"]);
|
|
463
466
|
}), 128))
|
|
@@ -474,21 +477,23 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
474
477
|
name: "market"
|
|
475
478
|
}, {
|
|
476
479
|
default: T(() => [
|
|
477
|
-
e.enableSearch || e.enableMarketCategoryFilter ? (o(), i("div",
|
|
478
|
-
e.enableMarketCategoryFilter ? (o(), i("div",
|
|
479
|
-
m(d(
|
|
480
|
+
e.enableSearch || e.enableMarketCategoryFilter ? (o(), i("div", pt, [
|
|
481
|
+
e.enableMarketCategoryFilter ? (o(), i("div", gt, [
|
|
482
|
+
m(d(he), {
|
|
480
483
|
modelValue: C.value,
|
|
481
|
-
"onUpdate:modelValue":
|
|
482
|
-
placeholder: e.marketCategoryPlaceholder
|
|
484
|
+
"onUpdate:modelValue": n[1] || (n[1] = (l) => C.value = l),
|
|
485
|
+
placeholder: e.marketCategoryPlaceholder,
|
|
486
|
+
"drop-style": ue
|
|
483
487
|
}, {
|
|
484
488
|
default: T(() => [
|
|
485
|
-
(o(!0), i(F, null, N(e.marketCategoryOptions, (l) => (o(), k(d(
|
|
489
|
+
(o(!0), i(F, null, N(e.marketCategoryOptions, (l) => (o(), k(d(ye), {
|
|
486
490
|
key: l.value,
|
|
487
491
|
label: l.label,
|
|
488
|
-
value: l.value
|
|
492
|
+
value: l.value,
|
|
493
|
+
class: "mcp-server-picker__content-market-header-select-option"
|
|
489
494
|
}, {
|
|
490
495
|
default: T(() => [
|
|
491
|
-
|
|
496
|
+
me(S(l.label), 1)
|
|
492
497
|
]),
|
|
493
498
|
_: 2
|
|
494
499
|
}, 1032, ["label", "value"]))), 128))
|
|
@@ -496,21 +501,21 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
496
501
|
_: 1
|
|
497
502
|
}, 8, ["modelValue", "placeholder"])
|
|
498
503
|
])) : v("", !0),
|
|
499
|
-
e.enableSearch ? (o(), i("div",
|
|
504
|
+
e.enableSearch ? (o(), i("div", _t, [
|
|
500
505
|
m(d(Z), {
|
|
501
506
|
modelValue: h.value,
|
|
502
|
-
"onUpdate:modelValue":
|
|
507
|
+
"onUpdate:modelValue": n[2] || (n[2] = (l) => h.value = l),
|
|
503
508
|
placeholder: w.value
|
|
504
509
|
}, {
|
|
505
510
|
suffix: T(() => [
|
|
506
|
-
m(d(ee), {
|
|
511
|
+
m(d(ee), { class: "mcp-server-picker__icon" })
|
|
507
512
|
]),
|
|
508
513
|
_: 1
|
|
509
514
|
}, 8, ["modelValue", "placeholder"])
|
|
510
515
|
])) : v("", !0)
|
|
511
516
|
])) : v("", !0),
|
|
512
|
-
|
|
513
|
-
e.marketLoading ? (o(), i("div",
|
|
517
|
+
I.value ? (o(), i("div", mt, [
|
|
518
|
+
e.marketLoading ? (o(), i("div", vt, "加载中...")) : (o(!0), i(F, { key: 1 }, N(x.value, (l) => (o(), k(d(te), {
|
|
514
519
|
key: l.id,
|
|
515
520
|
plugin: l,
|
|
516
521
|
mode: "market",
|
|
@@ -529,9 +534,9 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
529
534
|
_: 1
|
|
530
535
|
}, 8, ["modelValue"])
|
|
531
536
|
]),
|
|
532
|
-
m(d(
|
|
537
|
+
m(d(et), {
|
|
533
538
|
visible: A.value,
|
|
534
|
-
"onUpdate:visible":
|
|
539
|
+
"onUpdate:visible": n[4] || (n[4] = (l) => A.value = l),
|
|
535
540
|
onConfirm: j
|
|
536
541
|
}, null, 8, ["visible"])
|
|
537
542
|
], 6)) : v("", !0)
|
|
@@ -540,12 +545,12 @@ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-c
|
|
|
540
545
|
_: 1
|
|
541
546
|
}, 8, ["name"]));
|
|
542
547
|
}
|
|
543
|
-
}),
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
g.component(
|
|
548
|
+
}), O = /* @__PURE__ */ z(ft, [["__scopeId", "data-v-7f8cfb42"]]);
|
|
549
|
+
O.name = "McpServerPicker";
|
|
550
|
+
const ht = function(g) {
|
|
551
|
+
g.component(O.name, O);
|
|
547
552
|
};
|
|
548
|
-
|
|
553
|
+
O.install = ht;
|
|
549
554
|
export {
|
|
550
|
-
|
|
555
|
+
O as default
|
|
551
556
|
};
|