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