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