@burdenoff/microfe-vibecontrols 2026.1117.2 → 2026.1123.2

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,26 +1,28 @@
1
1
  import { useMintAgentCapabilityMutation as e } from "../../generated/wspace-operations.js";
2
2
  import { AgentCapabilityScope as t } from "../../generated/wspace-types.js";
3
3
  import { useTr as n } from "../../shared/hooks/useTr.js";
4
- import { useCallback as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
5
- import { AlertCircle as ee, ChevronDown as c, ExternalLink as te, GripVertical as l, Loader2 as u, Maximize2 as ne, Minimize2 as re, Monitor as d, Plus as ie, RotateCcw as ae, Wifi as f, WifiOff as p, X as oe } from "lucide-react";
6
- import { Fragment as se, jsx as m, jsxs as h } from "react/jsx-runtime";
7
- import { DropdownMenu as ce, DropdownMenuContent as le, DropdownMenuItem as ue, DropdownMenuTrigger as de } from "@burdenoff/fe-libs/ui";
4
+ import { getSafeTunnelIframeUrl as r } from "../../utils/iframeUrl.js";
5
+ import { useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
6
+ import { AlertCircle as ee, ChevronDown as l, ExternalLink as te, GripVertical as ne, Loader2 as u, Maximize2 as re, Minimize2 as d, Monitor as f, Plus as ie, RotateCcw as ae, Wifi as oe, WifiOff as p, X as se } from "lucide-react";
7
+ import { Fragment as ce, jsx as m, jsxs as h } from "react/jsx-runtime";
8
+ import { DropdownMenu as le, DropdownMenuContent as ue, DropdownMenuItem as de, DropdownMenuTrigger as fe } from "@burdenoff/fe-libs/ui";
8
9
  // src/components/agents/PluginUIPanel.tsx
9
- var g = 320, fe = 32;
10
+ var g = 320, pe = 32;
10
11
  function _(e) {
11
12
  let t = typeof window < "u" ? window.innerHeight - 150 : 800;
12
13
  return Math.max(g, Math.min(e, t));
13
14
  }
14
15
  var v = "inline-flex size-7 max-md:size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-surface/50 hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus";
15
16
  function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
16
- let [C] = e(), w = n(), T = a(), E = o(0), D = r(() => (E.current += 1, `${T}-ui-tab-${E.current}`), [T]), [O, k] = s(() => [{
17
+ let [C] = e(), w = n(), T = o(), E = s(0), D = i(() => (E.current += 1, `${T}-ui-tab-${E.current}`), [T]), [O, k] = c(() => [{
17
18
  id: D(),
18
19
  pluginName: null,
19
20
  name: "New Tab",
20
21
  uiUrl: null
21
- }]), [A, j] = s(O[0].id), [M, pe] = s(!1), [N, P] = s({}), [F, I] = s(null), [L, R] = s(null), [z, B] = s(!1), [me, he] = s(null), V = o(0), H = o(0), U = o(null), W = o({}), G = o({}), K = O.find((e) => e.id === A) || O[0] || null, q = r(async (e, n) => {
22
+ }]), [A, j] = c(O[0].id), [M, me] = c(!1), [N, P] = c({}), [F, I] = c(null), [L, R] = c(null), [z, B] = c(!1), [he, ge] = c(null), V = s(0), H = s(0), U = s(null), W = s({}), G = s({}), K = O.find((e) => e.id === A) || O[0] || null, q = i(async (e, n) => {
22
23
  if (!b || !x) return null;
23
- let r = b.replace(/\/$/, ""), i = n ? n.startsWith("http") ? n : `${r}${n}` : `${r}/ui/${e}`, a = new URL(i).toString();
24
+ let i = b.replace(/\/$/, ""), a = n ? n.startsWith("http") ? n : `${i}${n}` : `${i}/ui/${e}`, o = r(a);
25
+ if (!o) return null;
24
26
  try {
25
27
  let n = (await C({ variables: {
26
28
  agentId: x,
@@ -29,18 +31,18 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
29
31
  resourceId: e,
30
32
  ttlSeconds: 60
31
33
  } })).data?.mintAgentCapability?.token;
32
- if (!n) return a;
33
- let r = new URL(a);
34
- return e === "code-server" || r.pathname.startsWith("/code-server") ? (r.searchParams.set("vt", n), r.toString()) : `${a}#vt=${encodeURIComponent(n)}`;
34
+ if (!n) return o;
35
+ let i = new URL(o);
36
+ return e === "code-server" || i.pathname.startsWith("/code-server") ? (i.searchParams.set("vt", n), r(i.toString())) : r(`${o}#vt=${encodeURIComponent(n)}`);
35
37
  } catch {
36
- return a;
38
+ return o;
37
39
  }
38
40
  }, [
39
41
  b,
40
42
  x,
41
43
  S,
42
44
  C
43
- ]), J = r((e) => y.find((t) => t.pluginName === e)?.displayName || e.replace(/^ui-/, "").replace(/-/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()), [y]), ge = r(() => {
45
+ ]), J = i((e) => y.find((t) => t.pluginName === e)?.displayName || e.replace(/^ui-/, "").replace(/-/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()), [y]), _e = i(() => {
44
46
  let e = {
45
47
  id: D(),
46
48
  pluginName: null,
@@ -48,7 +50,7 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
48
50
  uiUrl: null
49
51
  };
50
52
  k((t) => [...t, e]), j(e.id), I(e.id);
51
- }, [D]), _e = r((e) => {
53
+ }, [D]), ve = i((e) => {
52
54
  k((t) => {
53
55
  let n = t.filter((t) => t.id !== e);
54
56
  if (n.length === 0) {
@@ -68,7 +70,7 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
68
70
  let n = { ...t };
69
71
  return delete n[e], n;
70
72
  });
71
- }, [A, D]), ve = r(async (e, t) => {
73
+ }, [A, D]), ye = i(async (e, t) => {
72
74
  let n = y.find((e) => e.pluginName === t), r = J(t);
73
75
  P((t) => ({
74
76
  ...t,
@@ -85,17 +87,17 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
85
87
  y,
86
88
  q,
87
89
  J
88
- ]), ye = r((e) => {
90
+ ]), be = i((e) => {
89
91
  P((t) => ({
90
92
  ...t,
91
93
  [e]: "connected"
92
94
  }));
93
- }, []), be = r((e) => {
95
+ }, []), xe = i((e) => {
94
96
  P((t) => ({
95
97
  ...t,
96
98
  [e]: "error"
97
99
  }));
98
- }, []), Y = r((e) => {
100
+ }, []), Y = i((e) => {
99
101
  let t = W.current[e];
100
102
  if (t) {
101
103
  P((t) => ({
@@ -107,12 +109,12 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
107
109
  t.src = n;
108
110
  });
109
111
  }
110
- }, []), xe = r((e) => {
111
- let t = O.find((t) => t.id === e);
112
- t?.uiUrl && window.open(t.uiUrl, "_blank");
113
- }, [O]), X = r((e) => {
112
+ }, []), Se = i((e) => {
113
+ let t = O.find((t) => t.id === e), n = r(t?.uiUrl);
114
+ n && window.open(n, "_blank", "noopener,noreferrer");
115
+ }, [O]), X = i((e) => {
114
116
  j(e), G.current[e]?.focus();
115
- }, []), Se = r((e, t) => {
117
+ }, []), Ce = i((e, t) => {
116
118
  if (e.target !== e.currentTarget) return;
117
119
  if (e.key === "Enter" || e.key === " ") {
118
120
  e.preventDefault(), j(t);
@@ -120,10 +122,10 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
120
122
  }
121
123
  let n = O.findIndex((e) => e.id === t);
122
124
  n !== -1 && (e.key === "ArrowRight" ? (e.preventDefault(), X(O[(n + 1) % O.length].id)) : e.key === "ArrowLeft" ? (e.preventDefault(), X(O[(n - 1 + O.length) % O.length].id)) : e.key === "Home" ? (e.preventDefault(), X(O[0].id)) : e.key === "End" && (e.preventDefault(), X(O[O.length - 1].id)));
123
- }, [O, X]), Ce = r((e) => {
125
+ }, [O, X]), we = i((e) => {
124
126
  M || (e.preventDefault(), V.current = e.clientY, H.current = U.current?.offsetHeight ?? 480, B(!0));
125
127
  }, [M]);
126
- i(() => {
128
+ a(() => {
127
129
  if (!z) return;
128
130
  let e = (e) => {
129
131
  let t = V.current - e.clientY;
@@ -133,18 +135,18 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
133
135
  document.removeEventListener("pointermove", e), document.removeEventListener("pointerup", t), document.removeEventListener("pointercancel", t), document.body.style.cursor = "", document.body.style.userSelect = "";
134
136
  };
135
137
  }, [z]);
136
- let Z = r((e) => {
138
+ let Z = i((e) => {
137
139
  if (M || e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
138
140
  e.preventDefault();
139
- let t = _((L ?? U.current?.offsetHeight ?? 480) + (e.key === "ArrowUp" ? fe : -32));
141
+ let t = _((L ?? U.current?.offsetHeight ?? 480) + (e.key === "ArrowUp" ? pe : -32));
140
142
  R(t);
141
143
  }, [M, L]);
142
- i(() => {
143
- he(U.current?.offsetHeight ?? null);
144
+ a(() => {
145
+ ge(U.current?.offsetHeight ?? null);
144
146
  }, []);
145
- let we = (e) => {
147
+ let Te = (e) => {
146
148
  let t = N[e];
147
- return t === "connected" ? /* @__PURE__ */ m(f, {
149
+ return t === "connected" ? /* @__PURE__ */ m(oe, {
148
150
  className: "size-3 text-status-success-text shrink-0",
149
151
  "aria-hidden": "true"
150
152
  }) : t === "error" ? /* @__PURE__ */ m(p, {
@@ -153,11 +155,11 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
153
155
  }) : t === "connecting" ? /* @__PURE__ */ m(u, {
154
156
  className: "size-3 animate-spin text-status-warning-text shrink-0",
155
157
  "aria-hidden": "true"
156
- }) : /* @__PURE__ */ m(d, {
158
+ }) : /* @__PURE__ */ m(f, {
157
159
  className: "size-3 text-text-muted shrink-0",
158
160
  "aria-hidden": "true"
159
161
  });
160
- }, Te = M ? "h-[80vh]" : L ? void 0 : "h-[60vh] min-h-[20rem]", Ee = !M && L ? { height: `${L}px` } : void 0, Q = (e) => `${e}-tab`, $ = (e) => `${e}-panel`;
162
+ }, Ee = M ? "h-[80vh]" : L ? void 0 : "h-[60vh] min-h-[20rem]", De = !M && L ? { height: `${L}px` } : void 0, Q = (e) => `${e}-tab`, $ = (e) => `${e}-panel`;
161
163
  return /* @__PURE__ */ h("div", {
162
164
  className: "border border-border-default rounded-lg overflow-hidden bg-bg-sunken",
163
165
  children: [
@@ -166,14 +168,14 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
166
168
  tabIndex: 0,
167
169
  "aria-orientation": "horizontal",
168
170
  "aria-label": w("vibecontrols.pluginPanel.resize", "Resize panel"),
169
- "aria-valuenow": Math.round(L ?? me ?? 480),
171
+ "aria-valuenow": Math.round(L ?? he ?? 480),
170
172
  "aria-valuemin": g,
171
173
  "aria-valuemax": typeof window < "u" ? window.innerHeight - 150 : 800,
172
- onPointerDown: Ce,
174
+ onPointerDown: we,
173
175
  onKeyDown: Z,
174
176
  className: "group flex h-2 max-md:h-3 cursor-ns-resize touch-none items-center justify-center transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
175
177
  title: w("vibecontrols.pluginPanel.resize", "Resize panel"),
176
- children: /* @__PURE__ */ m(l, {
178
+ children: /* @__PURE__ */ m(ne, {
177
179
  className: "w-4 h-3 rotate-90 text-text-muted transition-opacity opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100",
178
180
  "aria-hidden": "true"
179
181
  })
@@ -196,11 +198,11 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
196
198
  ref: (t) => {
197
199
  G.current[e.id] = t;
198
200
  },
199
- onKeyDown: (t) => Se(t, e.id),
201
+ onKeyDown: (t) => Ce(t, e.id),
200
202
  className: `group flex items-center gap-1.5 pl-3 pr-1.5 py-1.5 text-xs border-r border-border-subtle cursor-pointer transition-colors min-w-0 max-w-[200px] shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-border-focus ${t ? "bg-bg-surface text-text-primary border-b-2 border-b-action-primary-bg" : "text-text-secondary hover:text-text-primary hover:bg-bg-surface/50"}`,
201
203
  onClick: () => j(e.id),
202
204
  children: [
203
- we(e.id),
205
+ Te(e.id),
204
206
  /* @__PURE__ */ m("span", {
205
207
  className: "truncate",
206
208
  children: e.name
@@ -208,11 +210,11 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
208
210
  /* @__PURE__ */ m("button", {
209
211
  type: "button",
210
212
  onClick: (t) => {
211
- t.stopPropagation(), _e(e.id);
213
+ t.stopPropagation(), ve(e.id);
212
214
  },
213
215
  "aria-label": w("vibecontrols.pluginPanel.closeTab", "Close tab {{name}}", { name: e.name }),
214
216
  className: "ml-auto shrink-0 p-0.5 rounded-button transition-opacity hover:text-status-error-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100",
215
- children: /* @__PURE__ */ m(oe, {
217
+ children: /* @__PURE__ */ m(se, {
216
218
  className: "size-3",
217
219
  "aria-hidden": "true"
218
220
  })
@@ -223,7 +225,7 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
223
225
  }),
224
226
  /* @__PURE__ */ m("button", {
225
227
  type: "button",
226
- onClick: ge,
228
+ onClick: _e,
227
229
  "aria-label": w("vibecontrols.pluginPanel.newTab", "New tab"),
228
230
  className: "flex items-center justify-center size-8 max-md:size-11 shrink-0 text-text-secondary hover:text-text-primary hover:bg-bg-surface/50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-border-focus",
229
231
  children: /* @__PURE__ */ m(ie, {
@@ -234,7 +236,7 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
234
236
  /* @__PURE__ */ m("div", { className: "flex-1 min-w-0" }),
235
237
  /* @__PURE__ */ h("div", {
236
238
  className: "flex items-center gap-0.5 px-2 shrink-0",
237
- children: [K?.uiUrl && /* @__PURE__ */ h(se, { children: [/* @__PURE__ */ m("button", {
239
+ children: [K?.uiUrl && /* @__PURE__ */ h(ce, { children: [/* @__PURE__ */ m("button", {
238
240
  type: "button",
239
241
  onClick: () => K && Y(K.id),
240
242
  className: v,
@@ -246,7 +248,7 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
246
248
  })
247
249
  }), /* @__PURE__ */ m("button", {
248
250
  type: "button",
249
- onClick: () => K && xe(K.id),
251
+ onClick: () => K && Se(K.id),
250
252
  className: v,
251
253
  "aria-label": w("vibecontrols.pluginPanel.openExternal", "Open in new browser tab"),
252
254
  title: w("vibecontrols.pluginPanel.openExternal", "Open in new browser tab"),
@@ -257,12 +259,12 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
257
259
  })] }), /* @__PURE__ */ m("button", {
258
260
  type: "button",
259
261
  onClick: () => {
260
- pe((e) => !e), R(null);
262
+ me((e) => !e), R(null);
261
263
  },
262
264
  className: v,
263
265
  "aria-label": M ? w("vibecontrols.pluginPanel.restore", "Restore size") : w("vibecontrols.pluginPanel.maximize", "Maximize"),
264
266
  title: M ? w("vibecontrols.pluginPanel.restore", "Restore size") : w("vibecontrols.pluginPanel.maximize", "Maximize"),
265
- children: m(M ? re : ne, {
267
+ children: m(M ? d : re, {
266
268
  className: "size-3.5",
267
269
  "aria-hidden": "true"
268
270
  })
@@ -272,15 +274,15 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
272
274
  }),
273
275
  K && /* @__PURE__ */ h("div", {
274
276
  className: "flex items-center gap-2 px-3 py-1.5 bg-bg-surface border-b border-border-default",
275
- children: [/* @__PURE__ */ m(d, {
277
+ children: [/* @__PURE__ */ m(f, {
276
278
  className: "size-4 text-text-muted shrink-0",
277
279
  "aria-hidden": "true"
278
280
  }), /* @__PURE__ */ m("div", {
279
281
  className: "relative flex-1 min-w-0",
280
- children: /* @__PURE__ */ h(ce, {
282
+ children: /* @__PURE__ */ h(le, {
281
283
  open: F === K.id,
282
284
  onOpenChange: (e) => I(e ? K.id : null),
283
- children: [/* @__PURE__ */ m(de, {
285
+ children: [/* @__PURE__ */ m(fe, {
284
286
  asChild: !0,
285
287
  children: /* @__PURE__ */ h("button", {
286
288
  type: "button",
@@ -288,18 +290,18 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
288
290
  children: [/* @__PURE__ */ m("span", {
289
291
  className: `truncate ${K.pluginName ? "text-text-primary" : "text-text-muted"}`,
290
292
  children: K.pluginName ? `${K.name} — ${K.pluginName}` : "Select a plugin to load..."
291
- }), /* @__PURE__ */ m(c, {
293
+ }), /* @__PURE__ */ m(l, {
292
294
  "aria-hidden": "true",
293
295
  className: `size-3.5 text-text-muted shrink-0 transition-transform ${F === K.id ? "rotate-180" : ""}`
294
296
  })]
295
297
  })
296
- }), /* @__PURE__ */ m(le, {
298
+ }), /* @__PURE__ */ m(ue, {
297
299
  align: "start",
298
300
  className: "w-[var(--radix-dropdown-menu-trigger-width)] max-w-[calc(100vw-2rem)] max-h-64 overflow-y-auto",
299
301
  children: y.length > 0 ? y.map((e) => {
300
302
  let t = K.pluginName === e.pluginName;
301
- return /* @__PURE__ */ h(ue, {
302
- onSelect: () => void ve(K.id, e.pluginName),
303
+ return /* @__PURE__ */ h(de, {
304
+ onSelect: () => void ye(K.id, e.pluginName),
303
305
  className: `cursor-pointer flex-col items-stretch gap-0.5 px-3 py-2.5 border-b border-border-subtle last:border-b-0 ${t ? "bg-action-primary-bg/10" : ""}`,
304
306
  children: [
305
307
  /* @__PURE__ */ h("div", {
@@ -332,73 +334,77 @@ function y({ availablePlugins: y, tunnelUrl: b, agentId: x, profile: S }) {
332
334
  }),
333
335
  /* @__PURE__ */ h("div", {
334
336
  ref: U,
335
- className: `${Te || ""} min-h-[20rem] bg-bg-inverse text-text-inverse relative`,
336
- style: Ee,
337
+ className: `${Ee || ""} min-h-[20rem] bg-bg-inverse text-text-inverse relative`,
338
+ style: De,
337
339
  children: [
338
- O.map((e) => /* @__PURE__ */ m("div", {
339
- role: "tabpanel",
340
- id: $(e.id),
341
- "aria-labelledby": Q(e.id),
342
- className: `absolute inset-0 ${e.id === K?.id ? "block" : "hidden"}`,
343
- children: e.pluginName ? e.uiUrl ? /* @__PURE__ */ m("iframe", {
344
- ref: (t) => {
345
- W.current[e.id] = t;
346
- },
347
- src: e.uiUrl,
348
- title: `Plugin UI — ${e.name}`,
349
- className: "w-full h-full border-0",
350
- allow: "clipboard-read; clipboard-write",
351
- onLoad: () => ye(e.id),
352
- onError: () => be(e.id)
353
- }) : /* @__PURE__ */ m("div", {
354
- className: "flex items-center justify-center h-full",
355
- children: /* @__PURE__ */ h("div", {
356
- className: "text-center",
357
- children: [
358
- /* @__PURE__ */ m(ee, {
359
- className: "size-8 text-text-secondary mx-auto mb-3",
360
- "aria-hidden": "true"
361
- }),
362
- /* @__PURE__ */ m("p", {
363
- className: "text-text-inverse text-sm",
364
- children: "Agent tunnel not active"
365
- }),
366
- /* @__PURE__ */ m("p", {
367
- className: "text-text-inverse/70 text-xs mt-1",
368
- children: "Cannot load plugin UI without an active tunnel connection."
369
- })
370
- ]
371
- })
372
- }) : /* @__PURE__ */ m("div", {
373
- className: "flex items-center justify-center h-full",
374
- children: /* @__PURE__ */ h("div", {
375
- className: "text-center max-w-sm",
376
- children: [
377
- /* @__PURE__ */ m(d, {
378
- className: "size-10 text-text-secondary mx-auto mb-3",
379
- "aria-hidden": "true"
380
- }),
381
- /* @__PURE__ */ m("p", {
382
- className: "text-text-inverse text-sm font-medium",
383
- children: "No plugin selected"
384
- }),
385
- /* @__PURE__ */ m("p", {
386
- className: "text-text-inverse/70 text-xs mt-1",
387
- children: "Use the dropdown above to pick a plugin UI to load in this tab."
388
- }),
389
- /* @__PURE__ */ h("button", {
390
- type: "button",
391
- onClick: () => I(e.id),
392
- className: "mt-4 px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken transition-colors inline-flex items-center gap-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
393
- children: [/* @__PURE__ */ m(c, {
394
- className: "size-3.5",
340
+ O.map((e) => {
341
+ let t = r(e.uiUrl);
342
+ return /* @__PURE__ */ m("div", {
343
+ role: "tabpanel",
344
+ id: $(e.id),
345
+ "aria-labelledby": Q(e.id),
346
+ className: `absolute inset-0 ${e.id === K?.id ? "block" : "hidden"}`,
347
+ children: e.pluginName ? t ? /* @__PURE__ */ m("iframe", {
348
+ ref: (t) => {
349
+ W.current[e.id] = t;
350
+ },
351
+ src: t,
352
+ title: `Plugin UI — ${e.name}`,
353
+ className: "w-full h-full border-0",
354
+ sandbox: "allow-scripts allow-same-origin allow-forms",
355
+ referrerPolicy: "no-referrer",
356
+ onLoad: () => be(e.id),
357
+ onError: () => xe(e.id)
358
+ }) : /* @__PURE__ */ m("div", {
359
+ className: "flex items-center justify-center h-full",
360
+ children: /* @__PURE__ */ h("div", {
361
+ className: "text-center",
362
+ children: [
363
+ /* @__PURE__ */ m(ee, {
364
+ className: "size-8 text-text-secondary mx-auto mb-3",
395
365
  "aria-hidden": "true"
396
- }), "Select Plugin"]
397
- })
398
- ]
366
+ }),
367
+ /* @__PURE__ */ m("p", {
368
+ className: "text-text-inverse text-sm",
369
+ children: "Agent tunnel not active"
370
+ }),
371
+ /* @__PURE__ */ m("p", {
372
+ className: "text-text-inverse/70 text-xs mt-1",
373
+ children: "Cannot load plugin UI without an active tunnel connection."
374
+ })
375
+ ]
376
+ })
377
+ }) : /* @__PURE__ */ m("div", {
378
+ className: "flex items-center justify-center h-full",
379
+ children: /* @__PURE__ */ h("div", {
380
+ className: "text-center max-w-sm",
381
+ children: [
382
+ /* @__PURE__ */ m(f, {
383
+ className: "size-10 text-text-secondary mx-auto mb-3",
384
+ "aria-hidden": "true"
385
+ }),
386
+ /* @__PURE__ */ m("p", {
387
+ className: "text-text-inverse text-sm font-medium",
388
+ children: "No plugin selected"
389
+ }),
390
+ /* @__PURE__ */ m("p", {
391
+ className: "text-text-inverse/70 text-xs mt-1",
392
+ children: "Use the dropdown above to pick a plugin UI to load in this tab."
393
+ }),
394
+ /* @__PURE__ */ h("button", {
395
+ type: "button",
396
+ onClick: () => I(e.id),
397
+ className: "mt-4 px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken transition-colors inline-flex items-center gap-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
398
+ children: [/* @__PURE__ */ m(l, {
399
+ className: "size-3.5",
400
+ "aria-hidden": "true"
401
+ }), "Select Plugin"]
402
+ })
403
+ ]
404
+ })
399
405
  })
400
- })
401
- }, e.id)),
406
+ }, e.id);
407
+ }),
402
408
  K && N[K.id] === "connecting" && K.uiUrl && /* @__PURE__ */ h("div", {
403
409
  role: "status",
404
410
  className: "absolute bottom-3 right-3 flex items-center gap-2 px-3 py-1.5 bg-bg-overlay backdrop-blur-sm rounded-md text-xs text-status-warning-border pointer-events-none",