@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.
@@ -1,17 +1,16 @@
1
- import { defineComponent as q, ref as V, computed as g, openBlock as a, createElementBlock as n, normalizeClass as G, createElementVNode as s, toDisplayString as x, createCommentVNode as v, renderSlot as D, Fragment as F, createBlock as k, unref as d, createVNode as _, withCtx as T, Transition as K, withDirectives as pe, renderList as N, vShow as ge, useModel as ae, mergeModels as J, watch as H, normalizeStyle as me, createTextVNode as _e } from "vue";
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 oe, IconEmptySearch as Ce, IconPlus as Pe, IconSearch as ee } from "@opentiny/tiny-robot-svgs";
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" }, Me = {
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
- }, De = ["title"], Ie = { class: "plugin-card__actions" }, Ee = { class: "plugin-card__operations" }, Le = { title: "移除插件" }, Ue = {
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
- }, Ne = { key: 0 }, Oe = { key: 1 }, qe = { key: 2 }, ze = { class: "plugin-card__tools" }, Qe = { class: "plugin-card__tool" }, Re = { class: "plugin-card__content" }, je = { class: "plugin-card__info" }, He = { class: "plugin-card__name" }, Ge = ["title"], Je = { class: "plugin-card__actions plugin-card__actions--tool" }, Ke = {
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(i, { emit: b }) {
26
- const e = i, r = b, u = V(e.plugin.expanded || !1), f = g(() => {
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((y) => y.enabled), m = e.plugin.tools.length;
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, r("toggle-tool", m.id, c));
43
- }), r("toggle-plugin", c);
41
+ m.enabled !== c && (m.enabled = c, d("toggle-tool", m.id, c));
42
+ }), d("toggle-plugin", c);
44
43
  }, R = (c, m) => {
45
- r("toggle-tool", c, m);
46
- }, I = () => {
47
- r("delete-plugin");
44
+ d("toggle-tool", c, m);
45
+ }, M = () => {
46
+ d("delete-plugin");
48
47
  }, $ = g(() => e.plugin.addState || "idle"), E = (c) => {
49
- $.value === "idle" && r("add-plugin", c);
48
+ $.value === "idle" && d("add-plugin", c);
50
49
  }, L = (c) => c ? "关闭插件" : "打开插件";
51
- return (c, m) => (a(), n("div", {
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: i.plugin.icon,
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(i.plugin.name), 1),
62
- i.showToolCount && f.value ? (a(), n("span", Me, x(f.value) + " 个工具 ", 1)) : v("", !0)
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: i.plugin.description
67
- }, x(i.plugin.description), 9, De)
65
+ title: o.plugin.description
66
+ }, x(o.plugin.description), 9, Ie)
68
67
  ]),
69
- s("div", Ie, [
70
- D(c.$slots, "actions", {
71
- plugin: i.plugin,
68
+ s("div", Me, [
69
+ I(c.$slots, "actions", {
70
+ plugin: o.plugin,
72
71
  expanded: u.value,
73
- mode: i.mode
72
+ mode: o.mode
74
73
  }, () => [
75
- i.mode === "installed" ? (a(), n(F, { key: 0 }, [
76
- h.value ? (a(), n("div", {
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
- D(c.$slots, "expand-icon", { expanded: u.value }, () => [
82
- u.value ? (a(), k(d(be), {
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(), k(d(ke), {
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
- _(d(ve), {
91
+ _(r(ve), {
93
92
  title: "确定移除该插件吗?",
94
93
  style: { height: "16px" },
95
94
  type: "info",
96
- onConfirm: I,
95
+ onConfirm: M,
97
96
  trigger: "click"
98
97
  }, {
99
98
  reference: T(() => [
100
- D(c.$slots, "delete-icon", {}, () => [
99
+ I(c.$slots, "delete-icon", {}, () => [
101
100
  s("span", Le, [
102
- _(d(Te), { class: "common-icon delete" })
101
+ _(r(Te), { class: "common-icon delete" })
103
102
  ])
104
103
  ], !0)
105
104
  ]),
106
105
  _: 3
107
106
  }),
108
- _(d(X), {
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)) : i.mode === "market" ? (a(), n("div", Ue, [
116
- D(c.$slots, "add-button", {}, () => [
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] = (y) => E(i.plugin))
121
+ onClick: m[0] || (m[0] = (k) => E(o.plugin))
123
122
  }, [
124
- $.value === "idle" ? (a(), n("span", Ne, "添加")) : $.value === "loading" ? (a(), n("span", Oe, "添加中")) : (a(), n("span", qe, "已添加"))
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(), k(K, {
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), n(F, null, N(i.plugin.tools, (y, A) => {
139
- var U;
140
- return a(), n("div", {
141
- key: y.id,
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(y.name), 1)
147
+ s("span", He, x(k.name), 1)
149
148
  ]),
150
149
  s("div", {
151
150
  class: "plugin-card__desc",
152
- title: y.description
153
- }, x(y.description), 9, Ge)
151
+ title: k.description
152
+ }, x(k.description), 9, Ge)
154
153
  ]),
155
154
  s("div", Je, [
156
- _(d(X), {
157
- title: L(y.enabled),
158
- "model-value": y.enabled,
159
- "onUpdate:modelValue": (j) => R(y.id, j)
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 < (((U = i.plugin.tools) == null ? void 0 : U.length) || 0) - 1 ? (a(), n("div", Ke)) : v("", !0)
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(i, { emit: b }) {
185
- const e = b, r = ae(i, "visible"), u = V(null), f = () => {
186
- r.value = !1;
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
- r.value && f();
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(), n(F, null, [
195
- r.value ? (a(), n("div", Xe)) : v("", !0),
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
- r.value ? (a(), n("div", {
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
- _(d(oe), {
205
+ _(r(ne), {
207
206
  class: "plugin-editor__close",
208
207
  onClick: f
209
208
  })
210
209
  ]),
211
- _(d(Se), {
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(i) {
235
- const b = i, e = g(() => {
229
+ setup(o) {
230
+ const b = o, e = g(() => {
236
231
  var u;
237
232
  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), {
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(), n("img", lt)),
244
- s("p", at, x(r.value), 1)
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(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 = {
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
- }, ct = {
248
+ }, dt = {
251
249
  key: 1,
252
250
  class: "mcp-server-picker__content-list"
253
- }, ut = {
251
+ }, ct = {
254
252
  key: 0,
255
253
  class: "mcp-server-picker__loading"
256
- }, pt = {
254
+ }, ut = {
257
255
  key: 0,
258
256
  class: "mcp-server-picker__content-market-header"
259
- }, gt = {
257
+ }, pt = {
260
258
  key: 0,
261
259
  style: { width: "168px" }
262
- }, mt = {
260
+ }, gt = {
263
261
  key: 1,
264
262
  style: { width: "264px", "flex-shrink": "0" }
265
- }, _t = {
263
+ }, mt = {
266
264
  key: 1,
267
265
  class: "mcp-server-picker__content-list"
268
- }, vt = {
266
+ }, _t = {
269
267
  key: 0,
270
268
  class: "mcp-server-picker__loading"
271
- }, ft = /* @__PURE__ */ q({
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: (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 },
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(i, { emit: b }) {
310
- const e = i, r = b, u = V(e.defaultActiveTab), f = V(""), h = V(""), C = V(""), w = g(
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
- r("update:activeCount", t);
314
+ d("update:activeCount", t);
317
315
  },
318
316
  { immediate: !0 }
319
- ), H(u, (t, o) => {
320
- t !== o && r("tab-change", t);
317
+ ), H(u, (t, n) => {
318
+ t !== n && d("tab-change", t);
321
319
  });
322
- const I = g(() => S.value.filter((t) => e.installedSearchFn(f.value, t))), $ = g(() => {
323
- const { category: t, search: o } = {
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 = !o || e.marketSearchFn(o, l);
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" ? I.value.length > 0 : $.value.length > 0);
329
+ }), E = g(() => u.value === "installed" ? M.value.length > 0 : $.value.length > 0);
332
330
  H(C, (t) => {
333
- r("market-category-change", t);
331
+ d("market-category-change", t);
334
332
  });
335
- const L = (t, o) => {
333
+ const L = (t, n) => {
336
334
  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
- r("tool-toggle", t, P.id, !0);
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 && r("tool-toggle", t, l.id, !1);
338
+ l.enabled && d("tool-toggle", t, l.id, !1);
341
339
  })));
342
- }, c = (t, o, p) => {
340
+ }, c = (t, n, p) => {
343
341
  var l;
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
- t.enabled !== B && r("plugin-toggle", t, 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 && r("plugin-delete", t);
350
- }, y = (t) => {
351
- e.allowPluginAdd && r("plugin-add", t);
352
- }, A = V(!1), U = () => {
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, o) => {
355
- r("plugin-create", t, o), A.value = !1;
356
- }, ne = ae(i, "visible"), ie = () => {
357
- r("update:visible", !1);
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: o, drawer: p } = e.popupConfig || {}, l = {
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(o)
363
+ ...re(n)
366
364
  } : t === "drawer" ? {
367
365
  ...l,
368
366
  ...de(p)
369
367
  } : l;
370
368
  }), re = (t = {}) => {
371
- const o = {};
369
+ const n = {};
372
370
  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 ? {
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
- } : o;
376
+ } : n;
379
377
  }, de = (t = { direction: "right" }) => {
380
- const { direction: o } = t, p = {
378
+ const { direction: n } = t, p = {
381
379
  top: "0",
382
380
  bottom: "0",
383
381
  height: "100%"
384
382
  };
385
- return o === "left" ? {
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: o } = e.popupConfig || {};
396
- return t !== "drawer" ? "" : `drawer-${(o == null ? void 0 : o.direction) || "right"}`;
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, o) => (a(), k(K, { name: ce.value }, {
402
+ return (t, n) => (a(), y(K, { name: ce.value }, {
405
403
  default: T(() => {
406
404
  var p;
407
405
  return [
408
- ne.value ? (a(), n("div", {
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", it, x(e.title), 1),
415
- s("div", st, [
416
- D(t.$slots, "header-actions", {}, void 0, !0),
417
- e.showCustomAddButton ? (a(), n("div", {
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: U
418
+ onClick: N
421
419
  }, [
422
- _(d(Pe), { class: "mcp-server-picker__icon" }),
420
+ _(r(we), { class: "mcp-server-picker__icon" }),
423
421
  s("span", null, x(e.customAddButtonText), 1)
424
422
  ])) : v("", !0),
425
- _(d(oe), {
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", rt, [
432
- _(d(fe), {
429
+ s("div", st, [
430
+ _(r(fe), {
433
431
  modelValue: u.value,
434
- "onUpdate:modelValue": o[3] || (o[3] = (l) => u.value = l)
432
+ "onUpdate:modelValue": n[3] || (n[3] = (l) => u.value = l)
435
433
  }, {
436
434
  default: T(() => [
437
- e.showInstalledTab ? (a(), k(d(Y), {
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(), n("div", dt, [
444
- _(d(Z), {
441
+ e.enableSearch ? (a(), i("div", rt, [
442
+ _(r(Z), {
445
443
  modelValue: f.value,
446
- "onUpdate:modelValue": o[0] || (o[0] = (l) => f.value = l),
444
+ "onUpdate:modelValue": n[0] || (n[0] = (l) => f.value = l),
447
445
  placeholder: e.searchPlaceholder
448
446
  }, {
449
447
  suffix: T(() => [
450
- _(d(ee), { class: "mcp-server-picker__icon" })
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(), n("div", ct, [
456
- e.loading ? (a(), n("div", ut, "加载中...")) : (a(!0), n(F, { key: 1 }, N(I.value, (l) => {
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(), k(d(te), {
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, M) => c(l, B, M),
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(), k(d(le), {
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(), k(d(Y), {
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(), n("div", pt, [
482
- e.enableMarketCategoryFilter ? (a(), n("div", gt, [
483
- _(d(he), {
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": o[1] || (o[1] = (l) => C.value = l),
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), n(F, null, N(e.marketCategoryOptions, (l) => (a(), k(d(ye), {
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(), n("div", mt, [
506
- _(d(Z), {
503
+ e.enableSearch ? (a(), i("div", gt, [
504
+ _(r(Z), {
507
505
  modelValue: h.value,
508
- "onUpdate:modelValue": o[2] || (o[2] = (l) => h.value = l),
506
+ "onUpdate:modelValue": n[2] || (n[2] = (l) => h.value = l),
509
507
  placeholder: w.value
510
508
  }, {
511
509
  suffix: T(() => [
512
- _(d(ee), { class: "mcp-server-picker__icon" })
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(), n("div", _t, [
519
- e.marketLoading ? (a(), n("div", vt, "加载中...")) : (a(!0), n(F, { key: 1 }, N($.value, (l) => (a(), k(d(te), {
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: y
523
+ onAddPlugin: k
526
524
  }, null, 8, ["plugin"]))), 128))
527
- ])) : (a(), k(d(le), {
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
- _(d(et), {
536
+ _(r(et), {
539
537
  visible: A.value,
540
- "onUpdate:visible": o[4] || (o[4] = (l) => A.value = l),
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(ft, [["__scopeId", "data-v-1708103a"]]);
547
+ }), O = /* @__PURE__ */ z(vt, [["__scopeId", "data-v-1708103a"]]);
550
548
  O.name = "McpServerPicker";
551
- const ht = function(i) {
552
- i.component(O.name, O);
549
+ const ft = function(o) {
550
+ o.component(O.name, O);
553
551
  };
554
- O.install = ht;
552
+ O.install = ft;
555
553
  export {
556
554
  O as default
557
555
  };