@opentiny/tiny-robot 0.3.0-rc.5 → 0.3.0-rc.6
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/attachments/index.js +216 -216
- package/dist/bubble/index.js +1070 -1040
- package/dist/drag-overlay/index.js +15 -15
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +66 -3
- package/dist/index2.js +144 -138
- package/dist/index4.js +16 -16
- package/dist/mcp-server-picker/index.js +149 -149
- package/dist/prompts/index.js +5 -5
- package/dist/sender/index.js +1054 -930
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +38 -38
- package/dist/suggestion-popover/index.js +13 -13
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as q, ref as V, computed as
|
|
1
|
+
import { defineComponent as q, ref as V, computed as g, createElementBlock as n, openBlock as a, normalizeClass as G, createElementVNode as s, createBlock as k, createCommentVNode as v, toDisplayString as x, 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 ae, watch as H, normalizeStyle as _e, createTextVNode as me } 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 oe, IconEmptySearch as Ce, IconPlus as Pe, IconSearch as ee } from "@opentiny/tiny-robot-svgs";
|
|
4
4
|
import { _ as z } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
import { _ as we } from "../no-data.js";
|
|
6
|
-
import { o as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
6
|
+
import { o as xe } from "../index3.js";
|
|
7
|
+
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" }, 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 = {
|
|
@@ -22,67 +22,67 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
22
22
|
showToolCount: { type: Boolean, default: !0 }
|
|
23
23
|
},
|
|
24
24
|
emits: ["toggle-plugin", "toggle-tool", "add-plugin", "delete-plugin"],
|
|
25
|
-
setup(
|
|
26
|
-
const e =
|
|
27
|
-
var
|
|
28
|
-
return ((
|
|
29
|
-
}), h =
|
|
25
|
+
setup(i, { emit: b }) {
|
|
26
|
+
const e = i, r = b, u = V(e.plugin.expanded || !1), f = g(() => {
|
|
27
|
+
var c;
|
|
28
|
+
return ((c = e.plugin.tools) == null ? void 0 : c.length) || 0;
|
|
29
|
+
}), h = g(() => f.value > 0), C = g(() => ({
|
|
30
30
|
"plugin-card--expandable": h.value,
|
|
31
|
-
"plugin-card--expanded":
|
|
31
|
+
"plugin-card--expanded": u.value,
|
|
32
32
|
[`plugin-card--${e.mode}`]: !0
|
|
33
33
|
})), w = () => {
|
|
34
|
-
h.value && (
|
|
35
|
-
},
|
|
34
|
+
h.value && (u.value = !u.value);
|
|
35
|
+
}, S = g(() => {
|
|
36
36
|
if (!h.value)
|
|
37
37
|
return { checked: e.plugin.enabled || !1, indeterminate: !1 };
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
}), Q = (
|
|
38
|
+
const c = e.plugin.tools.filter((y) => y.enabled), _ = e.plugin.tools.length;
|
|
39
|
+
return c.length === 0 ? { checked: !1, indeterminate: !1 } : c.length === _ ? { checked: !0, indeterminate: !1 } : { checked: !0, indeterminate: !0 };
|
|
40
|
+
}), Q = (c) => {
|
|
41
41
|
h.value && e.plugin.tools.forEach((_) => {
|
|
42
|
-
_.enabled !==
|
|
43
|
-
}), r("toggle-plugin",
|
|
44
|
-
}, R = (
|
|
45
|
-
r("toggle-tool",
|
|
42
|
+
_.enabled !== c && (_.enabled = c, r("toggle-tool", _.id, c));
|
|
43
|
+
}), r("toggle-plugin", c);
|
|
44
|
+
}, R = (c, _) => {
|
|
45
|
+
r("toggle-tool", c, _);
|
|
46
46
|
}, D = () => {
|
|
47
47
|
r("delete-plugin");
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
}, E = (
|
|
51
|
-
return (
|
|
48
|
+
}, $ = g(() => e.plugin.addState || "idle"), I = (c) => {
|
|
49
|
+
$.value === "idle" && r("add-plugin", c);
|
|
50
|
+
}, E = (c) => c ? "关闭插件" : "打开插件";
|
|
51
|
+
return (c, _) => (a(), n("div", {
|
|
52
52
|
class: G(["plugin-card", C.value])
|
|
53
53
|
}, [
|
|
54
|
-
s("div",
|
|
54
|
+
s("div", $e, [
|
|
55
55
|
s("img", {
|
|
56
|
-
src:
|
|
56
|
+
src: i.plugin.icon,
|
|
57
57
|
class: "plugin-card__icon"
|
|
58
58
|
}, null, 8, Be),
|
|
59
59
|
s("div", Ve, [
|
|
60
60
|
s("div", Ae, [
|
|
61
|
-
s("span", Fe,
|
|
62
|
-
|
|
61
|
+
s("span", Fe, x(i.plugin.name), 1),
|
|
62
|
+
i.showToolCount && f.value ? (a(), n("span", Me, x(f.value) + " 个工具 ", 1)) : v("", !0)
|
|
63
63
|
]),
|
|
64
64
|
s("div", {
|
|
65
65
|
class: "plugin-card__desc",
|
|
66
|
-
title:
|
|
67
|
-
},
|
|
66
|
+
title: i.plugin.description
|
|
67
|
+
}, x(i.plugin.description), 9, De)
|
|
68
68
|
]),
|
|
69
69
|
s("div", Ie, [
|
|
70
|
-
U(
|
|
71
|
-
plugin:
|
|
72
|
-
expanded:
|
|
73
|
-
mode:
|
|
70
|
+
U(c.$slots, "actions", {
|
|
71
|
+
plugin: i.plugin,
|
|
72
|
+
expanded: u.value,
|
|
73
|
+
mode: i.mode
|
|
74
74
|
}, () => [
|
|
75
|
-
|
|
76
|
-
h.value ? (
|
|
75
|
+
i.mode === "installed" ? (a(), n(F, { key: 0 }, [
|
|
76
|
+
h.value ? (a(), n("div", {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "plugin-card__expand",
|
|
79
79
|
onClick: w
|
|
80
80
|
}, [
|
|
81
|
-
U(
|
|
82
|
-
|
|
81
|
+
U(c.$slots, "expand-icon", { expanded: u.value }, () => [
|
|
82
|
+
u.value ? (a(), k(d(be), {
|
|
83
83
|
key: 1,
|
|
84
84
|
class: "common-icon"
|
|
85
|
-
})) : (
|
|
85
|
+
})) : (a(), k(d(ke), {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: "common-icon"
|
|
88
88
|
}))
|
|
@@ -97,7 +97,7 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
97
97
|
trigger: "click"
|
|
98
98
|
}, {
|
|
99
99
|
reference: T(() => [
|
|
100
|
-
U(
|
|
100
|
+
U(c.$slots, "delete-icon", {}, () => [
|
|
101
101
|
s("span", Le, [
|
|
102
102
|
m(d(Te), { class: "common-icon delete" })
|
|
103
103
|
])
|
|
@@ -106,38 +106,38 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
106
106
|
_: 3
|
|
107
107
|
}),
|
|
108
108
|
m(d(X), {
|
|
109
|
-
title: E(
|
|
110
|
-
"model-value":
|
|
111
|
-
indeterminate:
|
|
109
|
+
title: E(S.value.checked),
|
|
110
|
+
"model-value": S.value.checked,
|
|
111
|
+
indeterminate: S.value.indeterminate,
|
|
112
112
|
"onUpdate:modelValue": Q
|
|
113
113
|
}, null, 8, ["title", "model-value", "indeterminate"])
|
|
114
114
|
])
|
|
115
|
-
], 64)) :
|
|
116
|
-
U(
|
|
115
|
+
], 64)) : i.mode === "market" ? (a(), n("div", Ue, [
|
|
116
|
+
U(c.$slots, "add-button", {}, () => [
|
|
117
117
|
s("div", {
|
|
118
118
|
class: G(["plugin-card__add-button", {
|
|
119
|
-
"plugin-card__add-button--loading":
|
|
120
|
-
"plugin-card__add-button--added":
|
|
119
|
+
"plugin-card__add-button--loading": $.value === "loading",
|
|
120
|
+
"plugin-card__add-button--added": $.value === "added"
|
|
121
121
|
}]),
|
|
122
|
-
onClick: _[0] || (_[0] = (y) => I(
|
|
122
|
+
onClick: _[0] || (_[0] = (y) => I(i.plugin))
|
|
123
123
|
}, [
|
|
124
|
-
|
|
124
|
+
$.value === "idle" ? (a(), n("span", Ne, "添加")) : $.value === "loading" ? (a(), n("span", Oe, "添加中")) : (a(), n("span", qe, "已添加"))
|
|
125
125
|
], 2)
|
|
126
126
|
], !0)
|
|
127
127
|
])) : v("", !0)
|
|
128
128
|
], !0)
|
|
129
129
|
])
|
|
130
130
|
]),
|
|
131
|
-
h.value ? (
|
|
131
|
+
h.value ? (a(), k(K, {
|
|
132
132
|
key: 0,
|
|
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
|
-
(
|
|
138
|
+
(a(!0), n(F, null, N(i.plugin.tools, (y, A) => {
|
|
139
139
|
var L;
|
|
140
|
-
return
|
|
140
|
+
return a(), n("div", {
|
|
141
141
|
key: y.id,
|
|
142
142
|
class: "plugin-card__tool-item"
|
|
143
143
|
}, [
|
|
@@ -145,12 +145,12 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
145
145
|
_[1] || (_[1] = s("div", { class: "plugin-card__icon plugin-card__icon--placeholder" }, null, -1)),
|
|
146
146
|
s("div", Re, [
|
|
147
147
|
s("div", je, [
|
|
148
|
-
s("span", He,
|
|
148
|
+
s("span", He, x(y.name), 1)
|
|
149
149
|
]),
|
|
150
150
|
s("div", {
|
|
151
151
|
class: "plugin-card__desc",
|
|
152
152
|
title: y.description
|
|
153
|
-
},
|
|
153
|
+
}, x(y.description), 9, Ge)
|
|
154
154
|
]),
|
|
155
155
|
s("div", Je, [
|
|
156
156
|
m(d(X), {
|
|
@@ -160,18 +160,18 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
160
160
|
}, null, 8, ["title", "model-value", "onUpdate:modelValue"])
|
|
161
161
|
])
|
|
162
162
|
]),
|
|
163
|
-
A < (((L =
|
|
163
|
+
A < (((L = i.plugin.tools) == null ? void 0 : L.length) || 0) - 1 ? (a(), n("div", Ke)) : v("", !0)
|
|
164
164
|
]);
|
|
165
165
|
}), 128))
|
|
166
166
|
], 512), [
|
|
167
|
-
[ge,
|
|
167
|
+
[ge, u.value]
|
|
168
168
|
])
|
|
169
169
|
]),
|
|
170
170
|
_: 1
|
|
171
171
|
})) : v("", !0)
|
|
172
172
|
], 2));
|
|
173
173
|
}
|
|
174
|
-
}), te = /* @__PURE__ */ z(We, [["__scopeId", "data-v-
|
|
174
|
+
}), te = /* @__PURE__ */ z(We, [["__scopeId", "data-v-89b32345"]]), Xe = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "plugin-editor__backdrop"
|
|
177
177
|
}, Ye = { class: "plugin-editor__header" }, Ze = /* @__PURE__ */ q({
|
|
@@ -181,34 +181,34 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
181
181
|
visibleModifiers: {}
|
|
182
182
|
},
|
|
183
183
|
emits: /* @__PURE__ */ J(["update:visible", "confirm"], ["update:visible"]),
|
|
184
|
-
setup(
|
|
185
|
-
const e = b, r =
|
|
184
|
+
setup(i, { emit: b }) {
|
|
185
|
+
const e = b, r = ae(i, "visible"), u = V(null), f = () => {
|
|
186
186
|
r.value = !1;
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
xe(u, () => {
|
|
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
|
-
return (C, w) => (
|
|
195
|
-
r.value ? (
|
|
194
|
+
return (C, w) => (a(), n(F, null, [
|
|
195
|
+
r.value ? (a(), n("div", Xe)) : v("", !0),
|
|
196
196
|
m(K, { name: "plugin-editor" }, {
|
|
197
197
|
default: T(() => [
|
|
198
|
-
r.value ? (
|
|
198
|
+
r.value ? (a(), n("div", {
|
|
199
199
|
key: 0,
|
|
200
200
|
class: "plugin-editor",
|
|
201
201
|
ref_key: "dialogRef",
|
|
202
|
-
ref:
|
|
202
|
+
ref: u
|
|
203
203
|
}, [
|
|
204
204
|
s("div", Ye, [
|
|
205
205
|
w[0] || (w[0] = s("h3", { class: "plugin-editor__title" }, "添加插件", -1)),
|
|
206
|
-
m(d(
|
|
206
|
+
m(d(oe), {
|
|
207
207
|
class: "plugin-editor__close",
|
|
208
208
|
onClick: f
|
|
209
209
|
})
|
|
210
210
|
]),
|
|
211
|
-
m(d(
|
|
211
|
+
m(d(Se), {
|
|
212
212
|
onConfirm: h,
|
|
213
213
|
onCancel: f
|
|
214
214
|
})
|
|
@@ -226,25 +226,25 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
226
226
|
key: 1,
|
|
227
227
|
src: we,
|
|
228
228
|
class: "empty-state__illustration"
|
|
229
|
-
},
|
|
229
|
+
}, at = { class: "empty-state__message" }, ot = /* @__PURE__ */ q({
|
|
230
230
|
__name: "NoData",
|
|
231
231
|
props: {
|
|
232
232
|
searchQuery: { default: "" }
|
|
233
233
|
},
|
|
234
|
-
setup(
|
|
235
|
-
const b =
|
|
236
|
-
var
|
|
237
|
-
return !!((
|
|
238
|
-
}), r =
|
|
239
|
-
return (
|
|
240
|
-
e.value ? (
|
|
234
|
+
setup(i) {
|
|
235
|
+
const b = i, e = g(() => {
|
|
236
|
+
var u;
|
|
237
|
+
return !!((u = b.searchQuery) != null && u.trim());
|
|
238
|
+
}), r = g(() => e.value ? "暂无搜索结果" : "暂无数据");
|
|
239
|
+
return (u, f) => (a(), n("section", tt, [
|
|
240
|
+
e.value ? (a(), k(d(Ce), {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: "empty-state__illustration"
|
|
243
|
-
})) : (
|
|
244
|
-
s("p",
|
|
243
|
+
})) : (a(), n("img", lt)),
|
|
244
|
+
s("p", at, x(r.value), 1)
|
|
245
245
|
]));
|
|
246
246
|
}
|
|
247
|
-
}), le = /* @__PURE__ */ z(
|
|
247
|
+
}), le = /* @__PURE__ */ z(ot, [["__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 = {
|
|
@@ -275,8 +275,8 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
275
275
|
marketPlugins: { default: () => [] },
|
|
276
276
|
searchPlaceholder: { default: "搜索插件" },
|
|
277
277
|
enableSearch: { type: Boolean, default: !0 },
|
|
278
|
-
installedSearchFn: { type: Function, default: (
|
|
279
|
-
marketSearchFn: { type: Function, default: (
|
|
278
|
+
installedSearchFn: { type: Function, default: (i, b) => i ? b.name.toLowerCase().includes(i.toLowerCase()) : !0 },
|
|
279
|
+
marketSearchFn: { type: Function, default: (i, b) => i ? b.name.toLowerCase().includes(i.toLowerCase()) : !0 },
|
|
280
280
|
marketCategoryOptions: { default: () => [] },
|
|
281
281
|
marketCategoryPlaceholder: { default: "按照分类筛选" },
|
|
282
282
|
enableMarketCategoryFilter: { type: Boolean, default: !0 },
|
|
@@ -306,43 +306,43 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
306
306
|
visibleModifiers: {}
|
|
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
|
-
setup(
|
|
310
|
-
const e =
|
|
311
|
-
() =>
|
|
312
|
-
),
|
|
309
|
+
setup(i, { emit: b }) {
|
|
310
|
+
const e = i, r = b, u = V(e.defaultActiveTab), f = V(""), h = V(""), C = V(""), w = g(
|
|
311
|
+
() => u.value === "installed" ? e.searchPlaceholder : "搜索市场插件"
|
|
312
|
+
), 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
313
|
H(
|
|
314
314
|
R,
|
|
315
315
|
(t) => {
|
|
316
316
|
r("update:activeCount", t);
|
|
317
317
|
},
|
|
318
318
|
{ immediate: !0 }
|
|
319
|
-
), H(
|
|
320
|
-
t !==
|
|
319
|
+
), H(u, (t, o) => {
|
|
320
|
+
t !== o && r("tab-change", t);
|
|
321
321
|
});
|
|
322
|
-
const D =
|
|
323
|
-
const { category: t, search:
|
|
322
|
+
const D = g(() => S.value.filter((t) => e.installedSearchFn(f.value, t))), $ = g(() => {
|
|
323
|
+
const { category: t, search: o } = {
|
|
324
324
|
category: C.value,
|
|
325
325
|
search: h.value
|
|
326
|
-
},
|
|
327
|
-
const P = !t || l.category === t, B = !
|
|
326
|
+
}, p = (l) => {
|
|
327
|
+
const P = !t || l.category === t, B = !o || e.marketSearchFn(o, l);
|
|
328
328
|
return P && B;
|
|
329
329
|
};
|
|
330
|
-
return Q.value.filter(
|
|
331
|
-
}), I =
|
|
330
|
+
return Q.value.filter(p);
|
|
331
|
+
}), I = g(() => u.value === "installed" ? D.value.length > 0 : $.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, o) => {
|
|
336
|
+
var p;
|
|
337
|
+
e.allowPluginToggle && (r("plugin-toggle", t, o), (p = t.tools) != null && p.length && (o ? 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
|
+
}, c = (t, o, p) => {
|
|
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, o, p), (l = t.tools) != null && l.length)) {
|
|
345
|
+
const P = t.tools.filter((M) => M.id !== o).some((M) => M.enabled), B = p || P;
|
|
346
346
|
t.enabled !== B && r("plugin-toggle", t, B);
|
|
347
347
|
}
|
|
348
348
|
}, _ = (t) => {
|
|
@@ -351,77 +351,77 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { 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
|
-
}, ne =
|
|
354
|
+
}, j = (t, o) => {
|
|
355
|
+
r("plugin-create", t, o), A.value = !1;
|
|
356
|
+
}, ne = ae(i, "visible"), ie = () => {
|
|
357
357
|
r("update:visible", !1);
|
|
358
|
-
}, se =
|
|
359
|
-
const { type: t, position:
|
|
358
|
+
}, se = g(() => {
|
|
359
|
+
const { type: t, position: o, drawer: p } = 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(o)
|
|
366
366
|
} : t === "drawer" ? {
|
|
367
367
|
...l,
|
|
368
|
-
...de(
|
|
368
|
+
...de(p)
|
|
369
369
|
} : l;
|
|
370
370
|
}), re = (t = {}) => {
|
|
371
|
-
const
|
|
372
|
-
return Object.entries(t).forEach(([
|
|
373
|
-
l !== void 0 && (
|
|
374
|
-
}), Object.keys(
|
|
371
|
+
const o = {};
|
|
372
|
+
return Object.entries(t).forEach(([p, l]) => {
|
|
373
|
+
l !== void 0 && (o[p] = typeof l == "number" ? `${l}px` : l);
|
|
374
|
+
}), Object.keys(o).length === 0 ? {
|
|
375
375
|
top: "50%",
|
|
376
376
|
left: "50%",
|
|
377
377
|
transform: "translate(-50%, -50%)"
|
|
378
|
-
} :
|
|
378
|
+
} : o;
|
|
379
379
|
}, de = (t = { direction: "right" }) => {
|
|
380
|
-
const { direction:
|
|
380
|
+
const { direction: o } = t, p = {
|
|
381
381
|
top: "0",
|
|
382
382
|
bottom: "0",
|
|
383
383
|
height: "100%"
|
|
384
384
|
};
|
|
385
|
-
return
|
|
386
|
-
...
|
|
385
|
+
return o === "left" ? {
|
|
386
|
+
...p,
|
|
387
387
|
left: "0",
|
|
388
388
|
"border-right": "1px solid rgb(219, 219, 219)"
|
|
389
389
|
} : {
|
|
390
|
-
...
|
|
390
|
+
...p,
|
|
391
391
|
right: "0",
|
|
392
392
|
"border-left": "1px solid rgb(219, 219, 219)"
|
|
393
393
|
};
|
|
394
|
-
}, W =
|
|
395
|
-
const { type: t, drawer:
|
|
396
|
-
return t !== "drawer" ? "" : `drawer-${(
|
|
397
|
-
}), ce =
|
|
394
|
+
}, W = g(() => {
|
|
395
|
+
const { type: t, drawer: o } = e.popupConfig || {};
|
|
396
|
+
return t !== "drawer" ? "" : `drawer-${(o == null ? void 0 : o.direction) || "right"}`;
|
|
397
|
+
}), ce = g(() => {
|
|
398
398
|
const { type: t } = e.popupConfig || {};
|
|
399
399
|
return t === "drawer" ? W.value : "fade";
|
|
400
400
|
}), ue = {
|
|
401
401
|
background: "var(--tr-mcp-server-picker-bg-default-2)",
|
|
402
402
|
color: "var(--tr-text-primary)"
|
|
403
403
|
};
|
|
404
|
-
return (t,
|
|
404
|
+
return (t, o) => (a(), k(K, { name: ce.value }, {
|
|
405
405
|
default: T(() => {
|
|
406
|
-
var
|
|
406
|
+
var p;
|
|
407
407
|
return [
|
|
408
|
-
ne.value ? (
|
|
408
|
+
ne.value ? (a(), n("div", {
|
|
409
409
|
key: 0,
|
|
410
|
-
class: G(["mcp-server-picker", [`popup-type-${((
|
|
410
|
+
class: G(["mcp-server-picker", [`popup-type-${((p = e.popupConfig) == null ? void 0 : p.type) || "fixed"}`, W.value]]),
|
|
411
411
|
style: _e(se.value)
|
|
412
412
|
}, [
|
|
413
413
|
s("div", nt, [
|
|
414
|
-
s("div", it,
|
|
414
|
+
s("div", it, x(e.title), 1),
|
|
415
415
|
s("div", st, [
|
|
416
|
-
e.showCustomAddButton ? (
|
|
416
|
+
e.showCustomAddButton ? (a(), n("div", {
|
|
417
417
|
key: 0,
|
|
418
418
|
class: "mcp-server-picker__header-right-item",
|
|
419
419
|
onClick: L
|
|
420
420
|
}, [
|
|
421
421
|
m(d(Pe), { class: "mcp-server-picker__icon" }),
|
|
422
|
-
s("span", null,
|
|
422
|
+
s("span", null, x(e.customAddButtonText), 1)
|
|
423
423
|
])) : v("", !0),
|
|
424
|
-
m(d(
|
|
424
|
+
m(d(oe), {
|
|
425
425
|
class: "mcp-server-picker__header-right-close",
|
|
426
426
|
onClick: ie
|
|
427
427
|
})
|
|
@@ -429,20 +429,20 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
429
429
|
]),
|
|
430
430
|
s("div", rt, [
|
|
431
431
|
m(d(fe), {
|
|
432
|
-
modelValue:
|
|
433
|
-
"onUpdate:modelValue":
|
|
432
|
+
modelValue: u.value,
|
|
433
|
+
"onUpdate:modelValue": o[3] || (o[3] = (l) => u.value = l)
|
|
434
434
|
}, {
|
|
435
435
|
default: T(() => [
|
|
436
|
-
e.showInstalledTab ? (
|
|
436
|
+
e.showInstalledTab ? (a(), k(d(Y), {
|
|
437
437
|
key: 0,
|
|
438
438
|
title: e.installedTabTitle,
|
|
439
439
|
name: "installed"
|
|
440
440
|
}, {
|
|
441
441
|
default: T(() => [
|
|
442
|
-
e.enableSearch ? (
|
|
442
|
+
e.enableSearch ? (a(), n("div", dt, [
|
|
443
443
|
m(d(Z), {
|
|
444
444
|
modelValue: f.value,
|
|
445
|
-
"onUpdate:modelValue":
|
|
445
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => f.value = l),
|
|
446
446
|
placeholder: e.searchPlaceholder
|
|
447
447
|
}, {
|
|
448
448
|
suffix: T(() => [
|
|
@@ -451,49 +451,49 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
451
451
|
_: 1
|
|
452
452
|
}, 8, ["modelValue", "placeholder"])
|
|
453
453
|
])) : v("", !0),
|
|
454
|
-
I.value ? (
|
|
455
|
-
e.loading ? (
|
|
454
|
+
I.value ? (a(), n("div", ct, [
|
|
455
|
+
e.loading ? (a(), n("div", ut, "加载中...")) : (a(!0), n(F, { key: 1 }, N(D.value, (l) => {
|
|
456
456
|
var P;
|
|
457
|
-
return
|
|
457
|
+
return a(), k(d(te), {
|
|
458
458
|
key: l.id,
|
|
459
459
|
plugin: l,
|
|
460
460
|
mode: "installed",
|
|
461
461
|
expandable: !!((P = l.tools) != null && P.length),
|
|
462
462
|
onTogglePlugin: (B) => E(l, B),
|
|
463
|
-
onToggleTool: (B, M) =>
|
|
463
|
+
onToggleTool: (B, M) => c(l, B, M),
|
|
464
464
|
onDeletePlugin: () => _(l)
|
|
465
465
|
}, null, 8, ["plugin", "expandable", "onTogglePlugin", "onToggleTool", "onDeletePlugin"]);
|
|
466
466
|
}), 128))
|
|
467
|
-
])) : (
|
|
467
|
+
])) : (a(), k(d(le), {
|
|
468
468
|
key: 2,
|
|
469
469
|
"search-query": f.value
|
|
470
470
|
}, null, 8, ["search-query"]))
|
|
471
471
|
]),
|
|
472
472
|
_: 1
|
|
473
473
|
}, 8, ["title"])) : v("", !0),
|
|
474
|
-
e.showMarketTab ? (
|
|
474
|
+
e.showMarketTab ? (a(), k(d(Y), {
|
|
475
475
|
key: 1,
|
|
476
476
|
title: e.marketTabTitle,
|
|
477
477
|
name: "market"
|
|
478
478
|
}, {
|
|
479
479
|
default: T(() => [
|
|
480
|
-
e.enableSearch || e.enableMarketCategoryFilter ? (
|
|
481
|
-
e.enableMarketCategoryFilter ? (
|
|
480
|
+
e.enableSearch || e.enableMarketCategoryFilter ? (a(), n("div", pt, [
|
|
481
|
+
e.enableMarketCategoryFilter ? (a(), n("div", gt, [
|
|
482
482
|
m(d(he), {
|
|
483
483
|
modelValue: C.value,
|
|
484
|
-
"onUpdate:modelValue":
|
|
484
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => C.value = l),
|
|
485
485
|
placeholder: e.marketCategoryPlaceholder,
|
|
486
486
|
"drop-style": ue
|
|
487
487
|
}, {
|
|
488
488
|
default: T(() => [
|
|
489
|
-
(
|
|
489
|
+
(a(!0), n(F, null, N(e.marketCategoryOptions, (l) => (a(), k(d(ye), {
|
|
490
490
|
key: l.value,
|
|
491
491
|
label: l.label,
|
|
492
492
|
value: l.value,
|
|
493
493
|
class: "mcp-server-picker__content-market-header-select-option"
|
|
494
494
|
}, {
|
|
495
495
|
default: T(() => [
|
|
496
|
-
me(
|
|
496
|
+
me(x(l.label), 1)
|
|
497
497
|
]),
|
|
498
498
|
_: 2
|
|
499
499
|
}, 1032, ["label", "value"]))), 128))
|
|
@@ -501,10 +501,10 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
501
501
|
_: 1
|
|
502
502
|
}, 8, ["modelValue", "placeholder"])
|
|
503
503
|
])) : v("", !0),
|
|
504
|
-
e.enableSearch ? (
|
|
504
|
+
e.enableSearch ? (a(), n("div", _t, [
|
|
505
505
|
m(d(Z), {
|
|
506
506
|
modelValue: h.value,
|
|
507
|
-
"onUpdate:modelValue":
|
|
507
|
+
"onUpdate:modelValue": o[2] || (o[2] = (l) => h.value = l),
|
|
508
508
|
placeholder: w.value
|
|
509
509
|
}, {
|
|
510
510
|
suffix: T(() => [
|
|
@@ -514,8 +514,8 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
514
514
|
}, 8, ["modelValue", "placeholder"])
|
|
515
515
|
])) : v("", !0)
|
|
516
516
|
])) : v("", !0),
|
|
517
|
-
I.value ? (
|
|
518
|
-
e.marketLoading ? (
|
|
517
|
+
I.value ? (a(), n("div", mt, [
|
|
518
|
+
e.marketLoading ? (a(), n("div", vt, "加载中...")) : (a(!0), n(F, { key: 1 }, N($.value, (l) => (a(), k(d(te), {
|
|
519
519
|
key: l.id,
|
|
520
520
|
plugin: l,
|
|
521
521
|
mode: "market",
|
|
@@ -523,7 +523,7 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
523
523
|
"show-tool-count": !1,
|
|
524
524
|
onAddPlugin: y
|
|
525
525
|
}, null, 8, ["plugin"]))), 128))
|
|
526
|
-
])) : (
|
|
526
|
+
])) : (a(), k(d(le), {
|
|
527
527
|
key: 2,
|
|
528
528
|
"search-query": h.value || C.value
|
|
529
529
|
}, null, 8, ["search-query"]))
|
|
@@ -536,7 +536,7 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
536
536
|
]),
|
|
537
537
|
m(d(et), {
|
|
538
538
|
visible: A.value,
|
|
539
|
-
"onUpdate:visible":
|
|
539
|
+
"onUpdate:visible": o[4] || (o[4] = (l) => A.value = l),
|
|
540
540
|
onConfirm: j
|
|
541
541
|
}, null, 8, ["visible"])
|
|
542
542
|
], 6)) : v("", !0)
|
|
@@ -547,8 +547,8 @@ const xe = { class: "plugin-card__main" }, Be = ["src"], Ve = { class: "plugin-c
|
|
|
547
547
|
}
|
|
548
548
|
}), O = /* @__PURE__ */ z(ft, [["__scopeId", "data-v-7f8cfb42"]]);
|
|
549
549
|
O.name = "McpServerPicker";
|
|
550
|
-
const ht = function(
|
|
551
|
-
|
|
550
|
+
const ht = function(i) {
|
|
551
|
+
i.component(O.name, O);
|
|
552
552
|
};
|
|
553
553
|
O.install = ht;
|
|
554
554
|
export {
|