@opentiny/tiny-robot 0.3.0-alpha.2 → 0.3.0-alpha.21

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.
@@ -0,0 +1,551 @@
1
+ import { defineComponent as O, 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 ce, renderList as N, vShow as pe, mergeModels as J, useModel as oe, watch as H, normalizeStyle as ge, createTextVNode as _e } from "vue";
2
+ import { TinyPopconfirm as me, TinySwitch as X, TinyTabs as ve, TinyTabItem as Y, TinyInput as Z, TinyBaseSelect as fe, TinyOption as he } from "@opentiny/vue";
3
+ import { IconArrowRight as ye, IconArrowDown as ke, IconDelete as be, IconClose as ne, IconEmptySearch as Te, IconPlus as Ce, IconSearch as ee } from "@opentiny/tiny-robot-svgs";
4
+ import { _ as q } from "../_plugin-vue_export-helper.js";
5
+ import { _ as Pe } from "../no-data.js";
6
+ import { o as we } from "../index2.js";
7
+ import Se from "../mcp-add-form/index.js";
8
+ const $e = { class: "plugin-card__main" }, xe = ["src"], Be = { class: "plugin-card__content" }, Ve = { class: "plugin-card__info" }, Ae = { class: "plugin-card__name" }, Fe = {
9
+ key: 0,
10
+ class: "plugin-card__count"
11
+ }, Me = ["title"], Ie = { class: "plugin-card__actions" }, De = { class: "plugin-card__operations" }, Ee = { title: "移除插件" }, Le = {
12
+ key: 1,
13
+ class: "plugin-card__add"
14
+ }, Ue = { key: 0 }, Ne = { key: 1 }, ze = { key: 2 }, Oe = { class: "plugin-card__tools" }, qe = { class: "plugin-card__tool" }, Qe = { class: "plugin-card__content" }, Re = { class: "plugin-card__info" }, je = { class: "plugin-card__name" }, He = ["title"], Ge = { class: "plugin-card__actions plugin-card__actions--tool" }, Je = {
15
+ key: 0,
16
+ class: "plugin-card__divider"
17
+ }, Ke = /* @__PURE__ */ O({
18
+ __name: "PluginCard",
19
+ props: {
20
+ plugin: {},
21
+ mode: { default: "installed" },
22
+ showToolCount: { type: Boolean, default: !0 }
23
+ },
24
+ emits: ["toggle-plugin", "toggle-tool", "add-plugin", "delete-plugin"],
25
+ setup(g, { emit: b }) {
26
+ const e = g, r = b, u = V(e.plugin.expanded || !1), f = p(() => {
27
+ var n;
28
+ return ((n = e.plugin.tools) == null ? void 0 : n.length) || 0;
29
+ }), h = p(() => f.value > 0), C = p(() => ({
30
+ "plugin-card--expandable": h.value,
31
+ "plugin-card--expanded": u.value,
32
+ [`plugin-card--${e.mode}`]: !0
33
+ })), w = () => {
34
+ h.value && (u.value = !u.value);
35
+ }, $ = p(() => {
36
+ if (!h.value)
37
+ return { checked: e.plugin.enabled || !1, indeterminate: !1 };
38
+ const n = e.plugin.tools.filter((y) => y.enabled), _ = e.plugin.tools.length;
39
+ return n.length === 0 ? { checked: !1, indeterminate: !1 } : n.length === _ ? { checked: !0, indeterminate: !1 } : { checked: !0, indeterminate: !0 };
40
+ }), Q = (n) => {
41
+ h.value && e.plugin.tools.forEach((_) => {
42
+ _.enabled !== n && (_.enabled = n, r("toggle-tool", _.id, n));
43
+ }), r("toggle-plugin", n);
44
+ }, R = (n, _) => {
45
+ r("toggle-tool", n, _);
46
+ }, I = () => {
47
+ r("delete-plugin");
48
+ }, x = p(() => e.plugin.addState || "idle"), D = (n) => {
49
+ x.value === "idle" && r("add-plugin", n);
50
+ }, E = (n) => n ? "关闭插件" : "打开插件";
51
+ return (n, _) => (o(), i("div", {
52
+ class: G(["plugin-card", C.value])
53
+ }, [
54
+ s("div", $e, [
55
+ s("img", {
56
+ src: n.plugin.icon,
57
+ class: "plugin-card__icon"
58
+ }, null, 8, xe),
59
+ s("div", Be, [
60
+ s("div", Ve, [
61
+ s("span", Ae, S(n.plugin.name), 1),
62
+ n.showToolCount && f.value ? (o(), i("span", Fe, S(f.value) + " 个工具 ", 1)) : v("", !0)
63
+ ]),
64
+ s("div", {
65
+ class: "plugin-card__desc",
66
+ title: n.plugin.description
67
+ }, S(n.plugin.description), 9, Me)
68
+ ]),
69
+ s("div", Ie, [
70
+ U(n.$slots, "actions", {
71
+ plugin: n.plugin,
72
+ expanded: u.value,
73
+ mode: n.mode
74
+ }, () => [
75
+ n.mode === "installed" ? (o(), i(F, { key: 0 }, [
76
+ h.value ? (o(), i("div", {
77
+ key: 0,
78
+ class: "plugin-card__expand",
79
+ onClick: w
80
+ }, [
81
+ U(n.$slots, "expand-icon", { expanded: u.value }, () => [
82
+ u.value ? (o(), k(d(ke), {
83
+ key: 1,
84
+ class: "common-icon"
85
+ })) : (o(), k(d(ye), {
86
+ key: 0,
87
+ class: "common-icon"
88
+ }))
89
+ ], !0)
90
+ ])) : v("", !0),
91
+ s("div", De, [
92
+ m(d(me), {
93
+ title: "确定移除该插件吗?",
94
+ style: { height: "16px" },
95
+ type: "info",
96
+ onConfirm: I,
97
+ trigger: "click"
98
+ }, {
99
+ reference: T(() => [
100
+ U(n.$slots, "delete-icon", {}, () => [
101
+ s("span", Ee, [
102
+ m(d(be), { class: "common-icon delete" })
103
+ ])
104
+ ], !0)
105
+ ]),
106
+ _: 3
107
+ }),
108
+ m(d(X), {
109
+ title: E($.value.checked),
110
+ "model-value": $.value.checked,
111
+ indeterminate: $.value.indeterminate,
112
+ "onUpdate:modelValue": Q
113
+ }, null, 8, ["title", "model-value", "indeterminate"])
114
+ ])
115
+ ], 64)) : n.mode === "market" ? (o(), i("div", Le, [
116
+ U(n.$slots, "add-button", {}, () => [
117
+ s("div", {
118
+ class: G(["plugin-card__add-button", {
119
+ "plugin-card__add-button--loading": x.value === "loading",
120
+ "plugin-card__add-button--added": x.value === "added"
121
+ }]),
122
+ onClick: _[0] || (_[0] = (y) => D(n.plugin))
123
+ }, [
124
+ x.value === "idle" ? (o(), i("span", Ue, "添加")) : x.value === "loading" ? (o(), i("span", Ne, "添加中")) : (o(), i("span", ze, "已添加"))
125
+ ], 2)
126
+ ], !0)
127
+ ])) : v("", !0)
128
+ ], !0)
129
+ ])
130
+ ]),
131
+ h.value ? (o(), k(K, {
132
+ key: 0,
133
+ name: "plugin-card-slide"
134
+ }, {
135
+ default: T(() => [
136
+ ce(s("div", Oe, [
137
+ _[2] || (_[2] = s("div", { class: "plugin-card__divider" }, null, -1)),
138
+ (o(!0), i(F, null, N(n.plugin.tools, (y, A) => {
139
+ var L;
140
+ return o(), i("div", {
141
+ key: y.id,
142
+ class: "plugin-card__tool-item"
143
+ }, [
144
+ s("div", qe, [
145
+ _[1] || (_[1] = s("div", { class: "plugin-card__icon plugin-card__icon--placeholder" }, null, -1)),
146
+ s("div", Qe, [
147
+ s("div", Re, [
148
+ s("span", je, S(y.name), 1)
149
+ ]),
150
+ s("div", {
151
+ class: "plugin-card__desc",
152
+ title: y.description
153
+ }, S(y.description), 9, He)
154
+ ]),
155
+ s("div", Ge, [
156
+ m(d(X), {
157
+ title: E(y.enabled),
158
+ "model-value": y.enabled,
159
+ "onUpdate:modelValue": (j) => R(y.id, j)
160
+ }, null, 8, ["title", "model-value", "onUpdate:modelValue"])
161
+ ])
162
+ ]),
163
+ A < (((L = n.plugin.tools) == null ? void 0 : L.length) || 0) - 1 ? (o(), i("div", Je)) : v("", !0)
164
+ ]);
165
+ }), 128))
166
+ ], 512), [
167
+ [pe, u.value]
168
+ ])
169
+ ]),
170
+ _: 1
171
+ })) : v("", !0)
172
+ ], 2));
173
+ }
174
+ }), te = /* @__PURE__ */ q(Ke, [["__scopeId", "data-v-f406f1f0"]]), We = {
175
+ key: 0,
176
+ class: "plugin-editor__backdrop"
177
+ }, Xe = { class: "plugin-editor__header" }, Ye = /* @__PURE__ */ O({
178
+ __name: "PluginModal",
179
+ props: {
180
+ visible: { type: Boolean, required: !0 },
181
+ visibleModifiers: {}
182
+ },
183
+ emits: /* @__PURE__ */ J(["update:visible", "confirm"], ["update:visible"]),
184
+ setup(g, { emit: b }) {
185
+ const e = b, r = oe(g, "visible"), u = V(null), f = () => {
186
+ r.value = !1;
187
+ };
188
+ we(u, () => {
189
+ r.value && f();
190
+ });
191
+ const h = (C, w) => {
192
+ C === "form" ? e("confirm", "form", w) : e("confirm", "code", w), f();
193
+ };
194
+ return (C, w) => (o(), i(F, null, [
195
+ r.value ? (o(), i("div", We)) : v("", !0),
196
+ m(K, { name: "plugin-editor" }, {
197
+ default: T(() => [
198
+ r.value ? (o(), i("div", {
199
+ key: 0,
200
+ class: "plugin-editor",
201
+ ref_key: "dialogRef",
202
+ ref: u
203
+ }, [
204
+ s("div", Xe, [
205
+ w[0] || (w[0] = s("h3", { class: "plugin-editor__title" }, "添加插件", -1)),
206
+ m(d(ne), {
207
+ class: "plugin-editor__close",
208
+ onClick: f
209
+ })
210
+ ]),
211
+ m(d(Se), {
212
+ onConfirm: h,
213
+ onCancel: f
214
+ })
215
+ ], 512)) : v("", !0)
216
+ ]),
217
+ _: 1
218
+ })
219
+ ], 64));
220
+ }
221
+ }), Ze = /* @__PURE__ */ q(Ye, [["__scopeId", "data-v-b6ec8753"]]), et = {
222
+ class: "empty-state",
223
+ role: "status",
224
+ "aria-live": "polite"
225
+ }, tt = {
226
+ key: 1,
227
+ src: Pe,
228
+ class: "empty-state__illustration"
229
+ }, lt = { class: "empty-state__message" }, ot = /* @__PURE__ */ O({
230
+ __name: "NoData",
231
+ props: {
232
+ searchQuery: { default: "" }
233
+ },
234
+ setup(g) {
235
+ const b = g, e = p(() => {
236
+ var u;
237
+ return !!((u = b.searchQuery) != null && u.trim());
238
+ }), r = p(() => e.value ? "暂无搜索结果" : "暂无数据");
239
+ return (u, f) => (o(), i("section", et, [
240
+ e.value ? (o(), k(d(Te), {
241
+ key: 0,
242
+ class: "empty-state__illustration"
243
+ })) : (o(), i("img", tt)),
244
+ s("p", lt, S(r.value), 1)
245
+ ]));
246
+ }
247
+ }), le = /* @__PURE__ */ q(ot, [["__scopeId", "data-v-839781e5"]]), nt = { class: "mcp-server-picker__header" }, at = { class: "mcp-server-picker__header-left" }, it = { class: "mcp-server-picker__header-right" }, st = { class: "mcp-server-picker__content" }, rt = {
248
+ key: 0,
249
+ class: "mcp-server-picker__content-installed-search"
250
+ }, dt = {
251
+ key: 1,
252
+ class: "mcp-server-picker__content-list"
253
+ }, ut = {
254
+ key: 0,
255
+ class: "mcp-server-picker__loading"
256
+ }, ct = {
257
+ key: 0,
258
+ class: "mcp-server-picker__content-market-header"
259
+ }, pt = {
260
+ key: 0,
261
+ style: { width: "168px" }
262
+ }, gt = {
263
+ key: 1,
264
+ style: { width: "264px", "flex-shrink": "0" }
265
+ }, _t = {
266
+ key: 1,
267
+ class: "mcp-server-picker__content-list"
268
+ }, mt = {
269
+ key: 0,
270
+ class: "mcp-server-picker__loading"
271
+ }, vt = /* @__PURE__ */ O({
272
+ __name: "index",
273
+ props: /* @__PURE__ */ J({
274
+ installedPlugins: { default: () => [] },
275
+ marketPlugins: { default: () => [] },
276
+ searchPlaceholder: { default: "搜索插件" },
277
+ enableSearch: { type: Boolean, default: !0 },
278
+ installedSearchFn: { type: Function, default: (g, b) => g ? b.name.toLowerCase().includes(g.toLowerCase()) : !0 },
279
+ marketSearchFn: { type: Function, default: (g, b) => g ? b.name.toLowerCase().includes(g.toLowerCase()) : !0 },
280
+ marketCategoryOptions: { default: () => [] },
281
+ marketCategoryPlaceholder: { default: "按照分类筛选" },
282
+ enableMarketCategoryFilter: { type: Boolean, default: !0 },
283
+ defaultActiveTab: { default: "installed" },
284
+ showInstalledTab: { type: Boolean, default: !0 },
285
+ showMarketTab: { type: Boolean, default: !0 },
286
+ visible: { type: Boolean },
287
+ popupConfig: { default: () => ({
288
+ type: "fixed",
289
+ position: {},
290
+ drawer: { direction: "right" }
291
+ }) },
292
+ activeCount: {},
293
+ installedTabTitle: { default: "已添加插件" },
294
+ marketTabTitle: { default: "市场" },
295
+ title: { default: "插件" },
296
+ showCustomAddButton: { type: Boolean, default: !0 },
297
+ customAddButtonText: { default: "自定义添加" },
298
+ allowPluginToggle: { type: Boolean, default: !0 },
299
+ allowToolToggle: { type: Boolean, default: !0 },
300
+ allowPluginDelete: { type: Boolean, default: !0 },
301
+ allowPluginAdd: { type: Boolean, default: !0 },
302
+ loading: { type: Boolean, default: !1 },
303
+ marketLoading: { type: Boolean, default: !1 }
304
+ }, {
305
+ visible: { type: Boolean, required: !0 },
306
+ visibleModifiers: {}
307
+ }),
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(g, { emit: b }) {
310
+ const e = g, r = b, u = V(e.defaultActiveTab), f = V(""), h = V(""), C = V(""), w = p(
311
+ () => u.value === "installed" ? e.searchPlaceholder : "搜索市场插件"
312
+ ), $ = p(() => e.installedPlugins), Q = p(() => e.marketPlugins), R = p(() => !$.value || $.value.length === 0 ? 0 : $.value.filter((t) => t.enabled).length);
313
+ H(
314
+ R,
315
+ (t) => {
316
+ r("update:activeCount", t);
317
+ },
318
+ { immediate: !0 }
319
+ ), H(u, (t, a) => {
320
+ t !== a && r("tab-change", t);
321
+ });
322
+ const I = p(() => $.value.filter((t) => e.installedSearchFn(f.value, t))), x = p(() => {
323
+ const { category: t, search: a } = {
324
+ category: C.value,
325
+ search: h.value
326
+ }, c = (l) => {
327
+ const P = !t || l.category === t, B = !a || e.marketSearchFn(a, l);
328
+ return P && B;
329
+ };
330
+ return Q.value.filter(c);
331
+ }), D = p(() => u.value === "installed" ? I.value.length > 0 : x.value.length > 0);
332
+ H(C, (t) => {
333
+ r("market-category-change", t);
334
+ });
335
+ const E = (t, a) => {
336
+ var c;
337
+ e.allowPluginToggle && (r("plugin-toggle", t, a), (c = t.tools) != null && c.length && (a ? t.tools.filter((P) => P.enabled).length === 0 && t.tools.forEach((P) => {
338
+ r("tool-toggle", t, P.id, !0);
339
+ }) : t.tools.forEach((l) => {
340
+ l.enabled && r("tool-toggle", t, l.id, !1);
341
+ })));
342
+ }, n = (t, a, c) => {
343
+ var l;
344
+ if (e.allowToolToggle && (r("tool-toggle", t, a, c), (l = t.tools) != null && l.length)) {
345
+ const P = t.tools.filter((M) => M.id !== a).some((M) => M.enabled), B = c || P;
346
+ t.enabled !== B && r("plugin-toggle", t, B);
347
+ }
348
+ }, _ = (t) => {
349
+ e.allowPluginDelete && r("plugin-delete", t);
350
+ }, y = (t) => {
351
+ e.allowPluginAdd && r("plugin-add", t);
352
+ }, A = V(!1), L = () => {
353
+ A.value = !0;
354
+ }, j = (t, a) => {
355
+ r("plugin-create", t, a), A.value = !1;
356
+ }, ae = oe(g, "visible"), ie = () => {
357
+ r("update:visible", !1);
358
+ }, se = p(() => {
359
+ const { type: t, position: a, drawer: c } = e.popupConfig || {}, l = {
360
+ "z-index": "1000",
361
+ position: "fixed"
362
+ };
363
+ return t === "fixed" ? {
364
+ ...l,
365
+ ...re(a)
366
+ } : t === "drawer" ? {
367
+ ...l,
368
+ ...de(c)
369
+ } : l;
370
+ }), re = (t = {}) => {
371
+ const a = {};
372
+ return Object.entries(t).forEach(([c, l]) => {
373
+ l !== void 0 && (a[c] = typeof l == "number" ? `${l}px` : l);
374
+ }), Object.keys(a).length === 0 ? {
375
+ top: "50%",
376
+ left: "50%",
377
+ transform: "translate(-50%, -50%)"
378
+ } : a;
379
+ }, de = (t = { direction: "right" }) => {
380
+ const { direction: a } = t, c = {
381
+ top: "0",
382
+ bottom: "0",
383
+ height: "100%"
384
+ };
385
+ return a === "left" ? {
386
+ ...c,
387
+ left: "0",
388
+ "border-right": "1px solid rgb(219, 219, 219)"
389
+ } : {
390
+ ...c,
391
+ right: "0",
392
+ "border-left": "1px solid rgb(219, 219, 219)"
393
+ };
394
+ }, W = p(() => {
395
+ const { type: t, drawer: a } = e.popupConfig || {};
396
+ return t !== "drawer" ? "" : `drawer-${(a == null ? void 0 : a.direction) || "right"}`;
397
+ }), ue = p(() => {
398
+ const { type: t } = e.popupConfig || {};
399
+ return t === "drawer" ? W.value : "fade";
400
+ });
401
+ return (t, a) => (o(), k(K, { name: ue.value }, {
402
+ default: T(() => {
403
+ var c;
404
+ return [
405
+ ae.value ? (o(), i("div", {
406
+ key: 0,
407
+ class: G(["mcp-server-picker", [`popup-type-${((c = e.popupConfig) == null ? void 0 : c.type) || "fixed"}`, W.value]]),
408
+ style: ge(se.value)
409
+ }, [
410
+ s("div", nt, [
411
+ s("div", at, S(e.title), 1),
412
+ s("div", it, [
413
+ e.showCustomAddButton ? (o(), i("div", {
414
+ key: 0,
415
+ class: "mcp-server-picker__header-right-item",
416
+ onClick: L
417
+ }, [
418
+ m(d(Ce), { style: { "font-size": "16px", cursor: "pointer" } }),
419
+ s("span", null, S(e.customAddButtonText), 1)
420
+ ])) : v("", !0),
421
+ m(d(ne), {
422
+ class: "mcp-server-picker__header-right-close",
423
+ onClick: ie
424
+ })
425
+ ])
426
+ ]),
427
+ s("div", st, [
428
+ m(d(ve), {
429
+ modelValue: u.value,
430
+ "onUpdate:modelValue": a[3] || (a[3] = (l) => u.value = l)
431
+ }, {
432
+ default: T(() => [
433
+ e.showInstalledTab ? (o(), k(d(Y), {
434
+ key: 0,
435
+ title: e.installedTabTitle,
436
+ name: "installed"
437
+ }, {
438
+ default: T(() => [
439
+ e.enableSearch ? (o(), i("div", rt, [
440
+ m(d(Z), {
441
+ modelValue: f.value,
442
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => f.value = l),
443
+ placeholder: e.searchPlaceholder
444
+ }, {
445
+ suffix: T(() => [
446
+ m(d(ee), { style: { "font-size": "16px", cursor: "pointer" } })
447
+ ]),
448
+ _: 1
449
+ }, 8, ["modelValue", "placeholder"])
450
+ ])) : v("", !0),
451
+ D.value ? (o(), i("div", dt, [
452
+ e.loading ? (o(), i("div", ut, "加载中...")) : (o(!0), i(F, { key: 1 }, N(I.value, (l) => {
453
+ var P;
454
+ return o(), k(d(te), {
455
+ key: l.id,
456
+ plugin: l,
457
+ mode: "installed",
458
+ expandable: !!((P = l.tools) != null && P.length),
459
+ onTogglePlugin: (B) => E(l, B),
460
+ onToggleTool: (B, M) => n(l, B, M),
461
+ onDeletePlugin: () => _(l)
462
+ }, null, 8, ["plugin", "expandable", "onTogglePlugin", "onToggleTool", "onDeletePlugin"]);
463
+ }), 128))
464
+ ])) : (o(), k(d(le), {
465
+ key: 2,
466
+ "search-query": f.value
467
+ }, null, 8, ["search-query"]))
468
+ ]),
469
+ _: 1
470
+ }, 8, ["title"])) : v("", !0),
471
+ e.showMarketTab ? (o(), k(d(Y), {
472
+ key: 1,
473
+ title: e.marketTabTitle,
474
+ name: "market"
475
+ }, {
476
+ default: T(() => [
477
+ e.enableSearch || e.enableMarketCategoryFilter ? (o(), i("div", ct, [
478
+ e.enableMarketCategoryFilter ? (o(), i("div", pt, [
479
+ m(d(fe), {
480
+ modelValue: C.value,
481
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => C.value = l),
482
+ placeholder: e.marketCategoryPlaceholder
483
+ }, {
484
+ default: T(() => [
485
+ (o(!0), i(F, null, N(e.marketCategoryOptions, (l) => (o(), k(d(he), {
486
+ key: l.value,
487
+ label: l.label,
488
+ value: l.value
489
+ }, {
490
+ default: T(() => [
491
+ _e(S(l.label), 1)
492
+ ]),
493
+ _: 2
494
+ }, 1032, ["label", "value"]))), 128))
495
+ ]),
496
+ _: 1
497
+ }, 8, ["modelValue", "placeholder"])
498
+ ])) : v("", !0),
499
+ e.enableSearch ? (o(), i("div", gt, [
500
+ m(d(Z), {
501
+ modelValue: h.value,
502
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => h.value = l),
503
+ placeholder: w.value
504
+ }, {
505
+ suffix: T(() => [
506
+ m(d(ee), { style: { "font-size": "16px", cursor: "pointer" } })
507
+ ]),
508
+ _: 1
509
+ }, 8, ["modelValue", "placeholder"])
510
+ ])) : v("", !0)
511
+ ])) : v("", !0),
512
+ D.value ? (o(), i("div", _t, [
513
+ e.marketLoading ? (o(), i("div", mt, "加载中...")) : (o(!0), i(F, { key: 1 }, N(x.value, (l) => (o(), k(d(te), {
514
+ key: l.id,
515
+ plugin: l,
516
+ mode: "market",
517
+ expandable: !1,
518
+ "show-tool-count": !1,
519
+ onAddPlugin: y
520
+ }, null, 8, ["plugin"]))), 128))
521
+ ])) : (o(), k(d(le), {
522
+ key: 2,
523
+ "search-query": h.value || C.value
524
+ }, null, 8, ["search-query"]))
525
+ ]),
526
+ _: 1
527
+ }, 8, ["title"])) : v("", !0)
528
+ ]),
529
+ _: 1
530
+ }, 8, ["modelValue"])
531
+ ]),
532
+ m(d(Ze), {
533
+ visible: A.value,
534
+ "onUpdate:visible": a[4] || (a[4] = (l) => A.value = l),
535
+ onConfirm: j
536
+ }, null, 8, ["visible"])
537
+ ], 6)) : v("", !0)
538
+ ];
539
+ }),
540
+ _: 1
541
+ }, 8, ["name"]));
542
+ }
543
+ }), z = /* @__PURE__ */ q(vt, [["__scopeId", "data-v-21023081"]]);
544
+ z.name = "McpServerPicker";
545
+ const ft = function(g) {
546
+ g.component(z.name, z);
547
+ };
548
+ z.install = ft;
549
+ export {
550
+ z as default
551
+ };
@@ -0,0 +1,4 @@
1
+ const l = "data:image/svg+xml,%3csvg%20width='120.000000'%20height='120.000000'%20viewBox='0%200%20120%20120'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%20/%3e%3crect%20width='120.000000'%20height='120.000000'%20fill='%23FFFFFF'%20fill-opacity='0'%20/%3e%3cpath%20d='M18.75%2037.31L104.52%2037.31C107.68%2037.31%20110.25%2039.87%20110.25%2043.04L110.25%20105.15C110.25%20108.28%20107.71%20110.81%20104.59%20110.81L24.4%20110.81C21.28%20110.81%2018.75%20108.28%2018.75%20105.15L18.75%2037.31Z'%20fill='%23F0F0F0'%20fill-opacity='1.000000'%20fill-rule='evenodd'%20/%3e%3cpath%20d='M13.22%2038.06L84.75%2038.06L84.75%20105.15C84.75%20108.28%2082.21%20110.81%2079.09%20110.81L16.9%20110.81C13.78%20110.81%2011.25%20108.12%2011.25%20105L11.25%2059.25L0.75%2059.25C0.75%2058.15%2012.13%2038.06%2013.22%2038.06Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'%20/%3e%3cpath%20d='M84.44%2038.06L105.13%2038.06C106.16%2038.06%20107.41%2037.86%20107.91%2038.76L118.07%2056.96C118.45%2057.64%20119.18%2058.68%20118.5%2059.06C118.28%2059.17%20117.08%2059.06%20116.84%2059.06L99.33%2059.06C97.21%2059.06%2095.27%2057.87%2094.3%2055.98L84.44%2038.06Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'%20/%3e%3cpath%20d='M110.42%2059.08L110.42%20105.09C110.42%20108.35%20107.78%20111%20104.51%20111L78.89%20111L78.89%20109.68L104.51%20109.68C107.05%20109.68%20109.11%20107.63%20109.11%20105.09L109.11%2059.08L110.42%2059.08Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3cpath%20d='M85.38%2037.5L85.38%20105.09C85.38%20108.35%2082.73%20111%2079.46%20111L16.42%20111C13.15%20111%2010.51%20108.35%2010.51%20105.09L10.51%2059.08L11.82%2059.08L11.82%20105.09C11.82%20107.63%2013.88%20109.68%2016.42%20109.68L79.46%20109.68C82%20109.68%2084.06%20107.63%2084.06%20105.09L84.06%2038.81L16%2038.81L16%2037.5L85.38%2037.5Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3cpath%20d='M14.14%2037.5C13.25%2037.5%2012.42%2037.96%2011.95%2038.74L0.19%2057.97C-0.19%2058.59%200%2059.41%200.6%2059.79C0.81%2059.92%201.05%2060%201.29%2060L68.53%2060C70.28%2060%2071.92%2059.08%2072.87%2057.58L85.56%2037.5L14.14%2037.5ZM14.47%2039L82.76%2039L71.48%2056.71C70.78%2057.82%2069.56%2058.5%2068.26%2058.5L1.76%2058.5L13.39%2039.61C13.62%2039.23%2014.03%2039%2014.47%2039Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3cpath%20d='M106.12%2037.5C106.97%2037.5%20107.75%2037.95%20108.21%2038.7L119.8%2057.79C120.17%2058.4%20120%2059.21%20119.43%2059.6C119.22%2059.74%20118.99%2059.81%20118.75%2059.81L99.22%2059.81C97.46%2059.81%2095.83%2058.82%2094.94%2057.22L83.97%2037.5L106.12%2037.5ZM106.09%2039L86.69%2039L96.27%2056.57C96.92%2057.76%2098.11%2058.5%2099.39%2058.5L118.35%2058.5L107.1%2039.59C106.88%2039.22%20106.5%2039%20106.09%2039Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3crect%20x='20.250000'%20y='84.000000'%20rx='1.886225'%20width='20.999998'%20height='6.000000'%20fill='%231476FF'%20fill-opacity='1.000000'%20/%3e%3cpath%20d='M35.34%2094.5C35.7%2094.5%2036%2094.83%2036%2095.25C36%2095.66%2035.7%2096%2035.34%2096L20.9%2096C20.54%2096%2020.25%2095.66%2020.25%2095.25C20.25%2094.83%2020.54%2094.5%2020.9%2094.5L35.34%2094.5Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3crect%20x='20.250000'%20y='99.000000'%20rx='0.750000'%20width='7.500000'%20height='1.500000'%20fill='%23808080'%20fill-opacity='1.000000'%20/%3e%3cpath%20d='M60%209C60.41%209%2060.75%209.29%2060.75%209.66L60.75%2018.91C60.75%2019.27%2060.41%2019.57%2060%2019.57C59.58%2019.57%2059.24%2019.27%2059.24%2018.91L59.24%209.66C59.24%209.29%2059.58%209%2060%209Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3cpath%20d='M84.83%2012.96C85.19%2013.17%2085.33%2013.59%2085.15%2013.91L80.52%2021.92C80.34%2022.24%2079.9%2022.33%2079.54%2022.12C79.18%2021.91%2079.03%2021.48%2079.21%2021.17L83.84%2013.16C84.02%2012.84%2084.46%2012.75%2084.83%2012.96Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3cpath%20d='M35.17%2012.96C35.53%2012.75%2035.97%2012.84%2036.15%2013.16L40.78%2021.17C40.96%2021.48%2040.81%2021.91%2040.45%2022.12C40.09%2022.33%2039.65%2022.24%2039.47%2021.92L34.84%2013.91C34.66%2013.59%2034.81%2013.17%2035.17%2012.96Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='nonzero'%20/%3e%3c/svg%3e";
2
+ export {
3
+ l as _
4
+ };
@@ -1,9 +1,9 @@
1
- import { defineComponent as u, createElementBlock as c, openBlock as e, normalizeClass as m, createElementVNode as n, createBlock as d, resolveDynamicComponent as f, createCommentVNode as h, toDisplayString as l, Fragment as y, createTextVNode as P, renderSlot as B, renderList as w, mergeProps as x, toRaw as S } from "vue";
1
+ import { defineComponent as f, createElementBlock as r, openBlock as e, normalizeClass as y, createBlock as m, createElementVNode as i, resolveDynamicComponent as u, createCommentVNode as h, toDisplayString as l, Fragment as k, createTextVNode as P, renderSlot as B, renderList as w, mergeProps as x, toRaw as S } from "vue";
2
2
  import { _ as v } from "../_plugin-vue_export-helper.js";
3
- const N = { class: "tr-prompt__icon" }, T = { class: "tr-prompt__content" }, V = { class: "tr-prompt__content-label" }, $ = {
3
+ const z = { class: "tr-prompt__content" }, N = { class: "tr-prompt__content-title" }, T = {
4
4
  key: 0,
5
5
  class: "tr-prompt__content-description"
6
- }, D = /* @__PURE__ */ u({
6
+ }, V = { class: "tr-prompt__badge" }, $ = /* @__PURE__ */ f({
7
7
  __name: "prompt",
8
8
  props: {
9
9
  label: {},
@@ -11,30 +11,27 @@ const N = { class: "tr-prompt__icon" }, T = { class: "tr-prompt__content" }, V =
11
11
  description: {},
12
12
  icon: {},
13
13
  disabled: { type: Boolean },
14
- badge: {}
14
+ badge: {},
15
+ size: { default: "medium" }
15
16
  },
16
17
  setup(o) {
17
18
  const t = o;
18
- return (s, _) => (e(), c("div", {
19
- class: m(["tr-prompt", { disabled: t.disabled }])
19
+ return (s, d) => (e(), r("div", {
20
+ class: y(["tr-prompt", { disabled: t.disabled }, t.size])
20
21
  }, [
21
- n("div", N, [
22
- (e(), d(f(t.icon)))
22
+ (e(), m(u(t.icon))),
23
+ i("div", z, [
24
+ i("h6", N, l(t.label), 1),
25
+ t.description ? (e(), r("p", T, l(t.description), 1)) : h("", !0)
23
26
  ]),
24
- n("div", T, [
25
- n("h6", V, l(t.label), 1),
26
- t.description ? (e(), c("p", $, l(t.description), 1)) : h("", !0)
27
- ]),
28
- n("div", {
29
- class: m(["tr-prompt__badge", { label: typeof t.badge == "string" }])
30
- }, [
31
- typeof t.badge == "string" ? (e(), c(y, { key: 0 }, [
27
+ i("div", V, [
28
+ typeof t.badge == "string" ? (e(), r(k, { key: 0 }, [
32
29
  P(l(t.badge), 1)
33
- ], 64)) : (e(), d(f(t.badge), { key: 1 }))
34
- ], 2)
30
+ ], 64)) : (e(), m(u(t.badge), { key: 1 }))
31
+ ])
35
32
  ], 2));
36
33
  }
37
- }), r = /* @__PURE__ */ v(D, [["__scopeId", "data-v-e04bfae3"]]), E = { class: "tr-prompts" }, I = /* @__PURE__ */ u({
34
+ }), n = /* @__PURE__ */ v($, [["__scopeId", "data-v-fdc72803"]]), D = { class: "tr-prompts" }, E = /* @__PURE__ */ f({
38
35
  __name: "prompts",
39
36
  props: {
40
37
  items: {},
@@ -45,37 +42,37 @@ const N = { class: "tr-prompt__icon" }, T = { class: "tr-prompt__content" }, V =
45
42
  },
46
43
  emits: ["item-click"],
47
44
  setup(o, { emit: t }) {
48
- const s = o, _ = t, k = (p, b) => {
49
- _("item-click", p, S(b));
45
+ const s = o, d = t, C = (a, _) => {
46
+ d("item-click", a, S(_));
50
47
  };
51
- return (p, b) => (e(), c("div", E, [
52
- n("div", {
53
- class: m(["tr-prompts__list-container", { wrap: s.wrap, vertical: s.vertical }])
48
+ return (a, _) => (e(), r("div", D, [
49
+ i("div", {
50
+ class: y(["tr-prompts__list-container", { wrap: s.wrap, vertical: s.vertical }])
54
51
  }, [
55
- (e(!0), c(y, null, w(s.items, (i, g) => (e(), d(r, x({
56
- key: i.id || g
57
- }, { ref_for: !0 }, i, {
52
+ (e(!0), r(k, null, w(s.items, (p, b) => (e(), m(n, x({
53
+ key: p.id || b
54
+ }, { ref_for: !0 }, p, {
58
55
  style: s.itemStyle,
59
56
  class: s.itemClass,
60
- onClick: (C) => k(C, i)
57
+ onClick: (g) => C(g, p)
61
58
  }), null, 16, ["style", "class", "onClick"]))), 128))
62
59
  ], 2),
63
- B(p.$slots, "footer", {}, void 0, !0)
60
+ B(a.$slots, "footer", {}, void 0, !0)
64
61
  ]));
65
62
  }
66
- }), a = /* @__PURE__ */ v(I, [["__scopeId", "data-v-a3ceb6f3"]]);
67
- r.name = "TrPrompt";
68
- const z = function(o) {
69
- o.component(r.name, r);
63
+ }), c = /* @__PURE__ */ v(E, [["__scopeId", "data-v-641a878e"]]);
64
+ n.name = "TrPrompt";
65
+ const I = function(o) {
66
+ o.component(n.name, n);
70
67
  };
71
- r.install = z;
72
- const j = r;
73
- a.name = "TrPrompts";
68
+ n.install = I;
69
+ const j = n;
70
+ c.name = "TrPrompts";
74
71
  const F = function(o) {
75
- o.component(a.name, a);
72
+ o.component(c.name, c);
76
73
  };
77
- a.install = F;
78
- const q = a;
74
+ c.install = F;
75
+ const q = c;
79
76
  export {
80
77
  j as Prompt,
81
78
  q as Prompts