@burdenoff/microfe-vibecontrols 2026.529.2 → 2026.529.3

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,27 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
- import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
- import { AlertCircle as ee, ChevronDown as a, ChevronUp as te, Edit3 as ne, Expand as re, ExternalLink as o, GripVertical as ie, Loader2 as s, Maximize2 as ae, Minimize2 as oe, Plus as c, RotateCcw as l, Search as se, Shrink as ce, Square as le, Terminal as u, Wifi as ue, WifiOff as de, X as d } from "lucide-react";
4
- import { Fragment as fe, jsx as f, jsxs as p } from "react/jsx-runtime";
2
+ import { TerminalIframe as t } from "./TerminalIframe.js";
3
+ import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
4
+ import { AlertCircle as ee, ChevronDown as o, ChevronUp as te, Edit3 as ne, Expand as re, ExternalLink as s, GripVertical as ie, Loader2 as c, Maximize2 as ae, Minimize2 as oe, Plus as l, RotateCcw as u, Search as se, Shrink as ce, Square as le, Terminal as d, Wifi as ue, WifiOff as de, X as f } from "lucide-react";
5
+ import { Fragment as fe, jsx as p, jsxs as m } from "react/jsx-runtime";
5
6
  import { createPortal as pe } from "react-dom";
6
7
  //#region src/components/sessions/TerminalPanel.tsx
7
- function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExternal: _, onToggleCollapse: he, collapsed: v = !1, heightClass: ge = "h-[420px]", sessions: y, onOpenTerminal: _e, onRetryTerminal: b, onRenameSession: x, onStopTerminal: ve, onRestartTerminal: ye, onStopSession: be, onCreateSession: S, fullScreen: C = !1, isImmersiveFullscreen: w = !1, onToggleImmersiveFullscreen: T, contextSwitcher: xe }) {
8
- let E = e(), [D, Se] = i(!1), [O, k] = i(!1), [A, j] = i(""), [M, N] = i({
8
+ function h({ tabs: h, activeTabId: me, onTabSelect: he, onTabClose: ge, onOpenExternal: _e, onToggleCollapse: ve, collapsed: g = !1, heightClass: ye = "h-[420px]", sessions: _, onOpenTerminal: be, onRetryTerminal: v, onRenameSession: y, onStopTerminal: b, onRestartTerminal: x, onStopSession: xe, onCreateSession: S, fullScreen: C = !1, isImmersiveFullscreen: w = !1, onToggleImmersiveFullscreen: T, contextSwitcher: Se }) {
9
+ let E = e(), [D, Ce] = a(!1), [O, k] = a(!1), [A, j] = a(""), [M, N] = a({
9
10
  visible: !1,
10
11
  x: 0,
11
12
  y: 0,
12
13
  sessionId: null
13
- }), [P, Ce] = i(null), [F, I] = i(""), [L, we] = i({}), [R, Te] = i({}), [Ee, De] = i(null), z = r(!1), Oe = r(0), ke = r(0), Ae = r(null), B = r(null), V = r(null), H = r(null), je = r(null), Me = r(null), Ne = r({}), U = r({}), W = r({}), G = r({}), K = m.find((e) => e.sessionId === me) || m[0] || null, q = t((e, t) => {
14
- we((n) => n[e] === t ? n : {
14
+ }), [P, we] = a(null), [F, I] = a(""), [L, Te] = a({}), [R, Ee] = a({}), [De, Oe] = a(null), z = i(!1), ke = i(0), Ae = i(0), je = i(null), B = i(null), V = i(null), H = i(null), U = i(null), Me = i(null), Ne = i({}), W = i({}), G = i({}), K = i({}), q = h.find((e) => e.sessionId === me) || h[0] || null, J = n((e, t) => {
15
+ Te((n) => n[e] === t ? n : {
15
16
  ...n,
16
17
  [e]: t
17
18
  });
18
- }, []), J = t((e, t) => {
19
- Te((n) => n[e] === t ? n : {
19
+ }, []), Y = n((e, t) => {
20
+ Ee((n) => n[e] === t ? n : {
20
21
  ...n,
21
22
  [e]: t
22
23
  });
23
- }, []), Pe = t((e) => {
24
+ }, []), Pe = n((e) => {
24
25
  if (!e) return null;
25
26
  try {
26
27
  let t = typeof window < "u" ? window.location.protocol : "https:", n = new URL(e).protocol;
@@ -28,43 +29,43 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
28
29
  } catch {
29
30
  return E("vibecontrols.sessions.terminal.invalidUrl", "The terminal URL is invalid. Restart the terminal to generate a new URL.");
30
31
  }
31
- }, [E]), Fe = t(() => {
32
- Se((e) => !e), De(null);
33
- }, []), Y = (y ?? []).filter((e) => !m.some((t) => t.sessionId === e.id)), Ie = A.trim() ? Y.filter((e) => e.name.toLowerCase().includes(A.trim().toLowerCase())) : Y, Le = t((e) => {
34
- G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]), q(e, "connected"), J(e, void 0);
35
- }, [J, q]), Re = t((e) => {
36
- G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]), q(e, "error");
37
- }, [q]);
38
- n(() => (m.forEach((e) => {
32
+ }, [E]), Fe = n(() => {
33
+ Ce((e) => !e), Oe(null);
34
+ }, []), X = (_ ?? []).filter((e) => !h.some((t) => t.sessionId === e.id)), Ie = A.trim() ? X.filter((e) => e.name.toLowerCase().includes(A.trim().toLowerCase())) : X, Le = n((e) => {
35
+ K.current[e] && (clearTimeout(K.current[e]), delete K.current[e]), J(e, "connected"), Y(e, void 0);
36
+ }, [Y, J]), Re = n((e) => {
37
+ K.current[e] && (clearTimeout(K.current[e]), delete K.current[e]), J(e, "error");
38
+ }, [J]);
39
+ r(() => (h.forEach((e) => {
39
40
  if (!e.terminalUrl || e.loading || e.error) return;
40
41
  let t = Pe(e.terminalUrl);
41
42
  if (t) {
42
- q(e.sessionId, "error"), J(e.sessionId, t);
43
+ J(e.sessionId, "error"), Y(e.sessionId, t);
43
44
  return;
44
45
  }
45
- L[e.sessionId] || q(e.sessionId, "connecting"), L[e.sessionId] === "connecting" && !G.current[e.sessionId] && (G.current[e.sessionId] = setTimeout(() => {
46
- delete G.current[e.sessionId], q(e.sessionId, "error"), J(e.sessionId, E("vibecontrols.sessions.terminal.connectionTimedOut", "Timed out waiting for the terminal to connect. Check the agent tunnel and retry."));
46
+ L[e.sessionId] || J(e.sessionId, "connecting"), L[e.sessionId] === "connecting" && !K.current[e.sessionId] && (K.current[e.sessionId] = setTimeout(() => {
47
+ delete K.current[e.sessionId], J(e.sessionId, "error"), Y(e.sessionId, E("vibecontrols.sessions.terminal.connectionTimedOut", "Timed out waiting for the terminal to connect. Check the agent tunnel and retry."));
47
48
  }, 12e3));
48
49
  }), () => {
49
- for (let e of Object.values(G.current)) clearTimeout(e);
50
- G.current = {};
50
+ for (let e of Object.values(K.current)) clearTimeout(e);
51
+ K.current = {};
51
52
  }), [
52
53
  L,
53
54
  Pe,
55
+ Y,
54
56
  J,
55
- q,
56
- m,
57
+ h,
57
58
  E
58
59
  ]);
59
- let X = t((e) => {
60
- U.current[e] && (clearTimeout(U.current[e]), delete U.current[e]), delete W.current[e];
61
- }, []), Z = t((e) => {
60
+ let ze = n((e) => {
61
+ W.current[e] && (clearTimeout(W.current[e]), delete W.current[e]), delete G.current[e];
62
+ }, []), Z = n((e) => {
62
63
  let t = Ne.current[e];
63
64
  if (t) {
64
- X(e), Te((t) => ({
65
+ ze(e), Ee((t) => ({
65
66
  ...t,
66
67
  [e]: void 0
67
- })), we((t) => ({
68
+ })), Te((t) => ({
68
69
  ...t,
69
70
  [e]: "connecting"
70
71
  }));
@@ -73,23 +74,23 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
73
74
  t.src = n;
74
75
  });
75
76
  }
76
- }, [X]);
77
- n(() => {
78
- for (let e of m) {
77
+ }, [ze]);
78
+ r(() => {
79
+ for (let e of h) {
79
80
  let t = L[e.sessionId];
80
81
  if (t === "error" && e.terminalUrl && !e.error && !R[e.sessionId]) {
81
- if (U.current[e.sessionId]) continue;
82
- let t = W.current[e.sessionId] ?? 0;
82
+ if (W.current[e.sessionId]) continue;
83
+ let t = G.current[e.sessionId] ?? 0;
83
84
  if (t >= 15) continue;
84
85
  let n = Math.min(2e3 * 2 ** t, 3e4);
85
- U.current[e.sessionId] = setTimeout(() => {
86
- delete U.current[e.sessionId], W.current[e.sessionId] = t + 1;
86
+ W.current[e.sessionId] = setTimeout(() => {
87
+ delete W.current[e.sessionId], G.current[e.sessionId] = t + 1;
87
88
  let n = Ne.current[e.sessionId];
88
89
  if (!n) return;
89
90
  let r = e.terminalUrl, i = `${new URL(r).origin}/health`;
90
91
  fetch(i, { signal: AbortSignal.timeout(5e3) }).then((t) => {
91
92
  if (t.ok) {
92
- we((t) => ({
93
+ Te((t) => ({
93
94
  ...t,
94
95
  [e.sessionId]: "connecting"
95
96
  }));
@@ -101,26 +102,26 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
101
102
  }).catch(() => {});
102
103
  }, n);
103
104
  }
104
- t === "connected" && X(e.sessionId);
105
+ t === "connected" && ze(e.sessionId);
105
106
  }
106
- let e = U.current;
107
+ let e = W.current;
107
108
  return () => {
108
109
  for (let t of Object.values(e)) clearTimeout(t);
109
110
  };
110
111
  }, [
111
- m,
112
+ h,
112
113
  R,
113
114
  L,
114
- X
115
+ ze
115
116
  ]);
116
- let ze = t((e) => {
117
- C || D || (e.preventDefault(), z.current = !0, Oe.current = e.clientY, ke.current = Ae.current?.offsetHeight || 420, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none");
117
+ let Be = n((e) => {
118
+ C || D || (e.preventDefault(), z.current = !0, ke.current = e.clientY, Ae.current = je.current?.offsetHeight || 420, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none");
118
119
  }, [C, D]);
119
- n(() => {
120
+ r(() => {
120
121
  let e = (e) => {
121
122
  if (!z.current) return;
122
- let t = Oe.current - e.clientY;
123
- De(Math.max(200, Math.min(ke.current + t, window.innerHeight - 150)));
123
+ let t = ke.current - e.clientY;
124
+ Oe(Math.max(200, Math.min(Ae.current + t, window.innerHeight - 150)));
124
125
  }, t = () => {
125
126
  z.current && (z.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "");
126
127
  };
@@ -128,7 +129,7 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
128
129
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
129
130
  };
130
131
  }, []);
131
- let Be = t((e, t) => {
132
+ let Ve = n((e, t) => {
132
133
  e.preventDefault(), e.stopPropagation(), N({
133
134
  visible: !0,
134
135
  x: e.clientX,
@@ -136,7 +137,7 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
136
137
  sessionId: t
137
138
  });
138
139
  }, []);
139
- n(() => {
140
+ r(() => {
140
141
  let e = (e) => {
141
142
  V.current && !V.current.contains(e.target) && N((e) => ({
142
143
  ...e,
@@ -144,200 +145,202 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
144
145
  }));
145
146
  };
146
147
  if (M.visible) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
147
- }, [M.visible]), n(() => {
148
+ }, [M.visible]), r(() => {
148
149
  let e = (e) => {
149
150
  let t = e.target;
150
- je.current && !je.current.contains(t) && H.current && !H.current.contains(t) && (k(!1), j(""));
151
+ U.current && !U.current.contains(t) && H.current && !H.current.contains(t) && (k(!1), j(""));
151
152
  };
152
153
  if (O) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
153
- }, [O]), n(() => {
154
+ }, [O]), r(() => {
154
155
  O && Me.current && requestAnimationFrame(() => Me.current?.focus());
155
- }, [O]), n(() => {
156
+ }, [O]), r(() => {
156
157
  P && B.current && (B.current.focus(), B.current.select());
157
- }, [P]), n(() => {
158
+ }, [P]), r(() => {
158
159
  if (!w || !T) return;
159
160
  let e = (e) => {
160
161
  e.key === "Escape" && T();
161
162
  };
162
163
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
163
164
  }, [w, T]);
164
- let Ve = t((e) => {
165
- let t = m.find((t) => t.sessionId === e);
166
- t && (Ce(e), I(t.name)), N((e) => ({
165
+ let He = n((e) => {
166
+ let t = h.find((t) => t.sessionId === e);
167
+ t && (we(e), I(t.name)), N((e) => ({
167
168
  ...e,
168
169
  visible: !1
169
170
  }));
170
- }, [m]), Q = t(() => {
171
- if (P && F.trim() && x) {
172
- let e = m.find((e) => e.sessionId === P);
173
- e && F.trim() !== e.name && x(P, F.trim());
171
+ }, [h]), Q = n(() => {
172
+ if (P && F.trim() && y) {
173
+ let e = h.find((e) => e.sessionId === P);
174
+ e && F.trim() !== e.name && y(P, F.trim());
174
175
  }
175
- Ce(null), I("");
176
+ we(null), I("");
176
177
  }, [
177
178
  P,
178
179
  F,
179
- x,
180
- m
181
- ]), He = t((e) => {
182
- e.key === "Enter" ? Q() : e.key === "Escape" && (Ce(null), I(""));
180
+ y,
181
+ h
182
+ ]), Ue = n((e) => {
183
+ e.key === "Enter" ? Q() : e.key === "Escape" && (we(null), I(""));
183
184
  }, [Q]);
184
- if (m.length === 0 && !v && !C) return null;
185
- let Ue = C ? "h-full" : D ? "h-[calc(100vh-120px)]" : Ee ? void 0 : ge, We = !C && !D && Ee ? { height: `${Ee}px` } : void 0, $ = M.sessionId ? m.find((e) => e.sessionId === M.sessionId) : null, Ge = (e) => {
186
- if (e.loading) return /* @__PURE__ */ f(s, { className: "size-3 animate-spin shrink-0" });
187
- if (e.error) return /* @__PURE__ */ f(ee, { className: "size-3 text-status-error-text shrink-0" });
185
+ if (h.length === 0 && !g && !C) return null;
186
+ let We = C ? "h-full" : D ? "h-[calc(100vh-120px)]" : De ? void 0 : ye, Ge = !C && !D && De ? { height: `${De}px` } : void 0, $ = M.sessionId ? h.find((e) => e.sessionId === M.sessionId) : null, Ke = (e) => {
187
+ if (e.loading) return /* @__PURE__ */ p(c, { className: "size-3 animate-spin shrink-0" });
188
+ if (e.error) return /* @__PURE__ */ p(ee, { className: "size-3 text-status-error-text shrink-0" });
188
189
  let t = L[e.sessionId];
189
- return t === "connected" ? /* @__PURE__ */ f(ue, { className: "size-3 text-status-success-text shrink-0" }) : t === "error" ? /* @__PURE__ */ f(de, { className: "size-3 text-status-error-text shrink-0" }) : t === "connecting" ? /* @__PURE__ */ f(s, { className: "size-3 animate-spin text-status-warning-text shrink-0" }) : /* @__PURE__ */ f(u, { className: "size-3 shrink-0" });
190
+ return t === "connected" ? /* @__PURE__ */ p(ue, { className: "size-3 text-status-success-text shrink-0" }) : t === "error" ? /* @__PURE__ */ p(de, { className: "size-3 text-status-error-text shrink-0" }) : t === "connecting" ? /* @__PURE__ */ p(c, { className: "size-3 animate-spin text-status-warning-text shrink-0" }) : /* @__PURE__ */ p(d, { className: "size-3 shrink-0" });
190
191
  };
191
- return w ? w ? pe(/* @__PURE__ */ p("div", {
192
+ return w ? w ? pe(/* @__PURE__ */ m("div", {
192
193
  className: "fixed inset-0 z-[9999] bg-bg-surface flex flex-col",
193
194
  children: [
194
- /* @__PURE__ */ p("div", {
195
+ /* @__PURE__ */ m("div", {
195
196
  className: "flex items-center justify-between px-3 py-2 bg-bg-sunken border-b border-border-default shrink-0",
196
- children: [/* @__PURE__ */ f("div", {
197
+ children: [/* @__PURE__ */ p("div", {
197
198
  className: "flex items-center gap-4",
198
- children: xe
199
- }), /* @__PURE__ */ p("div", {
199
+ children: Se
200
+ }), /* @__PURE__ */ m("div", {
200
201
  className: "flex items-center gap-2",
201
202
  children: [
202
- K && L[K.sessionId] === "error" && /* @__PURE__ */ f("button", {
203
+ q && L[q.sessionId] === "error" && /* @__PURE__ */ p("button", {
203
204
  type: "button",
204
- onClick: () => Z(K.sessionId),
205
+ onClick: () => Z(q.sessionId),
205
206
  className: "p-1.5 text-status-warning-text hover:text-status-warning-text/80 transition-colors",
206
207
  title: "Reconnect terminal",
207
- children: /* @__PURE__ */ f(l, { className: "size-4" })
208
+ children: /* @__PURE__ */ p(u, { className: "size-4" })
208
209
  }),
209
- K?.terminalUrl && /* @__PURE__ */ f("button", {
210
+ q?.terminalUrl && /* @__PURE__ */ p("button", {
210
211
  type: "button",
211
- onClick: () => K && _(K.sessionId),
212
+ onClick: () => q && _e(q.sessionId),
212
213
  className: "p-1.5 text-text-secondary hover:text-text-primary transition-colors",
213
214
  title: "Open in new tab",
214
- children: /* @__PURE__ */ f(o, { className: "size-4" })
215
+ children: /* @__PURE__ */ p(s, { className: "size-4" })
215
216
  }),
216
- /* @__PURE__ */ f("button", {
217
+ /* @__PURE__ */ p("button", {
217
218
  type: "button",
218
219
  onClick: T,
219
220
  className: "p-1.5 text-text-secondary hover:text-text-primary transition-colors",
220
221
  title: "Exit fullscreen (ESC)",
221
- children: /* @__PURE__ */ f(ce, { className: "size-4" })
222
+ children: /* @__PURE__ */ p(ce, { className: "size-4" })
222
223
  })
223
224
  ]
224
225
  })]
225
226
  }),
226
- /* @__PURE__ */ p("div", {
227
+ /* @__PURE__ */ m("div", {
227
228
  className: "flex items-center bg-bg-sunken border-b border-border-default shrink-0",
228
- children: [/* @__PURE__ */ f("div", {
229
+ children: [/* @__PURE__ */ p("div", {
229
230
  className: "flex items-center overflow-x-auto flex-1 min-w-0",
230
- children: m.map((e) => /* @__PURE__ */ p("div", {
231
+ children: h.map((e) => /* @__PURE__ */ m("div", {
231
232
  role: "button",
232
233
  tabIndex: 0,
233
234
  onKeyDown: (t) => {
234
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), h(e.sessionId));
235
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), he(e.sessionId));
235
236
  },
236
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-border-subtle cursor-pointer transition-colors min-w-0 max-w-[180px] group ${e.sessionId === K?.sessionId ? "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"}`,
237
- onClick: () => h(e.sessionId),
238
- onContextMenu: (t) => Be(t, e.sessionId),
239
- onDoubleClick: () => Ve(e.sessionId),
237
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-border-subtle cursor-pointer transition-colors min-w-0 max-w-[180px] group ${e.sessionId === q?.sessionId ? "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"}`,
238
+ onClick: () => he(e.sessionId),
239
+ onContextMenu: (t) => Ve(t, e.sessionId),
240
+ onDoubleClick: () => He(e.sessionId),
240
241
  children: [
241
- Ge(e),
242
- P === e.sessionId ? /* @__PURE__ */ f("input", {
242
+ Ke(e),
243
+ P === e.sessionId ? /* @__PURE__ */ p("input", {
243
244
  "aria-label": "control",
244
245
  ref: B,
245
246
  value: F,
246
247
  onChange: (e) => I(e.target.value),
247
248
  onBlur: Q,
248
- onKeyDown: He,
249
+ onKeyDown: Ue,
249
250
  onClick: (e) => e.stopPropagation(),
250
251
  className: "bg-bg-sunken border border-border-strong rounded px-1 py-0 text-xs text-text-primary w-[100px] outline-none"
251
- }) : /* @__PURE__ */ f("span", {
252
+ }) : /* @__PURE__ */ p("span", {
252
253
  className: "truncate",
253
254
  children: e.name
254
255
  }),
255
- /* @__PURE__ */ f("button", {
256
+ /* @__PURE__ */ p("button", {
256
257
  type: "button",
257
258
  onClick: (t) => {
258
- t.stopPropagation(), g(e.sessionId);
259
+ t.stopPropagation(), ge(e.sessionId);
259
260
  },
260
261
  className: "ml-auto opacity-0 group-hover:opacity-100 hover:text-status-error-text transition-opacity shrink-0",
261
262
  title: "Close terminal",
262
- children: /* @__PURE__ */ f(d, { className: "size-3" })
263
+ children: /* @__PURE__ */ p(f, { className: "size-3" })
263
264
  })
264
265
  ]
265
266
  }, e.sessionId))
266
- }), /* @__PURE__ */ f("button", {
267
+ }), /* @__PURE__ */ p("button", {
267
268
  type: "button",
268
269
  ref: H,
269
270
  onClick: () => {
270
- (S || Y.length > 0) && (k((e) => !e), j(""));
271
+ (S || X.length > 0) && (k((e) => !e), j(""));
271
272
  },
272
273
  className: "flex items-center px-2.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors shrink-0 border-r border-border-subtle",
273
274
  title: "New session or open existing",
274
- children: /* @__PURE__ */ f(c, { className: "size-3.5" })
275
+ children: /* @__PURE__ */ p(l, { className: "size-3.5" })
275
276
  })]
276
277
  }),
277
- /* @__PURE__ */ f("div", {
278
+ /* @__PURE__ */ p("div", {
278
279
  className: "flex-1 bg-bg-sunken text-text-primary relative overflow-hidden",
279
- children: K ? m.map((e) => {
280
- let t = L[e.sessionId], n = t === "connecting" || e.loading, r = Pe(e.terminalUrl), i = r ?? R[e.sessionId], a = !!e.terminalUrl && !e.error && !r, te = !!r || a && t === "error";
281
- return /* @__PURE__ */ p("div", {
282
- className: `absolute inset-0 ${e.sessionId === K.sessionId ? "block" : "hidden"}`,
280
+ children: q ? h.map((e) => {
281
+ let n = L[e.sessionId], r = n === "connecting" || e.loading, i = Pe(e.terminalUrl), a = i ?? R[e.sessionId], o = !!e.terminalUrl && !e.error && !i, te = !!i || o && n === "error";
282
+ return /* @__PURE__ */ m("div", {
283
+ className: `absolute inset-0 ${e.sessionId === q.sessionId ? "block" : "hidden"}`,
283
284
  children: [
284
- a && e.terminalUrl && /* @__PURE__ */ f("iframe", {
285
+ o && e.terminalUrl && /* @__PURE__ */ p(t, {
285
286
  ref: (t) => {
286
287
  Ne.current[e.sessionId] = t;
287
288
  },
288
- src: e.terminalUrl,
289
+ sessionId: e.sessionId,
290
+ agentId: e.agentId ?? null,
291
+ baseTtydUrl: e.terminalUrl,
289
292
  title: `Terminal - ${e.name}`,
290
293
  className: "w-full h-full border-0",
291
294
  allow: "clipboard-read *; clipboard-write *",
292
295
  onLoad: () => Le(e.sessionId),
293
296
  onError: () => Re(e.sessionId)
294
297
  }),
295
- a && n && /* @__PURE__ */ f("div", {
298
+ o && r && /* @__PURE__ */ p("div", {
296
299
  className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center pointer-events-none z-10",
297
- children: /* @__PURE__ */ p("div", {
300
+ children: /* @__PURE__ */ m("div", {
298
301
  className: "flex items-center gap-3 px-4 py-3 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
299
- children: [/* @__PURE__ */ f(s, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
302
+ children: [/* @__PURE__ */ p(c, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
300
303
  className: "text-text-primary text-sm font-medium",
301
304
  children: e.loading ? E("vibecontrols.sessions.terminal.startingTerminal", "Starting terminal...") : E("vibecontrols.sessions.terminal.connecting", "Connecting...")
302
- }), /* @__PURE__ */ f("p", {
305
+ }), /* @__PURE__ */ p("p", {
303
306
  className: "text-text-secondary text-xs",
304
307
  children: e.loading ? E("vibecontrols.sessions.terminal.settingUpTmux", "Setting up tmux + ttyd") : E("vibecontrols.sessions.terminal.establishingConnection", "Establishing connection")
305
308
  })] })]
306
309
  })
307
310
  }),
308
- te && !e.error && /* @__PURE__ */ f("div", {
311
+ te && !e.error && /* @__PURE__ */ p("div", {
309
312
  className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center z-10",
310
- children: /* @__PURE__ */ p("div", {
313
+ children: /* @__PURE__ */ m("div", {
311
314
  className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
312
315
  children: [
313
- /* @__PURE__ */ f(de, { className: "size-6 text-status-error-text" }),
314
- /* @__PURE__ */ p("div", {
316
+ /* @__PURE__ */ p(de, { className: "size-6 text-status-error-text" }),
317
+ /* @__PURE__ */ m("div", {
315
318
  className: "text-center",
316
- children: [/* @__PURE__ */ f("p", {
319
+ children: [/* @__PURE__ */ p("p", {
317
320
  className: "text-text-primary text-sm font-medium",
318
321
  children: E("vibecontrols.sessions.terminal.connectionLost", "Connection Lost")
319
- }), /* @__PURE__ */ f("p", {
322
+ }), /* @__PURE__ */ p("p", {
320
323
  className: "text-text-secondary text-xs mt-1",
321
- children: i || ((W.current[e.sessionId] ?? 0) < 15 ? E("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : E("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
324
+ children: a || ((G.current[e.sessionId] ?? 0) < 15 ? E("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : E("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
322
325
  })]
323
326
  }),
324
- !i && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ f(s, { className: "size-4 text-text-tertiary animate-spin" }),
325
- /* @__PURE__ */ p("button", {
327
+ !a && (G.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ p(c, { className: "size-4 text-text-tertiary animate-spin" }),
328
+ /* @__PURE__ */ m("button", {
326
329
  type: "button",
327
330
  onClick: () => Z(e.sessionId),
328
331
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
329
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
332
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
330
333
  })
331
334
  ]
332
335
  })
333
336
  }),
334
- !e.terminalUrl && e.loading && /* @__PURE__ */ f("div", {
337
+ !e.terminalUrl && e.loading && /* @__PURE__ */ p("div", {
335
338
  className: "flex items-center justify-center h-full",
336
- children: /* @__PURE__ */ p("div", {
339
+ children: /* @__PURE__ */ m("div", {
337
340
  className: "text-center",
338
341
  children: [
339
- /* @__PURE__ */ f(s, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
340
- /* @__PURE__ */ p("p", {
342
+ /* @__PURE__ */ p(c, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
343
+ /* @__PURE__ */ m("p", {
341
344
  className: "text-text-tertiary text-sm",
342
345
  children: [
343
346
  "Starting terminal for ",
@@ -345,109 +348,109 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
345
348
  "..."
346
349
  ]
347
350
  }),
348
- /* @__PURE__ */ f("p", {
351
+ /* @__PURE__ */ p("p", {
349
352
  className: "text-text-secondary text-xs mt-1",
350
353
  children: "Setting up tmux + ttyd terminal"
351
354
  })
352
355
  ]
353
356
  })
354
357
  }),
355
- e.error && /* @__PURE__ */ f("div", {
358
+ e.error && /* @__PURE__ */ p("div", {
356
359
  className: "flex items-center justify-center h-full",
357
- children: /* @__PURE__ */ p("div", {
360
+ children: /* @__PURE__ */ m("div", {
358
361
  className: "text-center max-w-md",
359
362
  children: [
360
- /* @__PURE__ */ f(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
361
- /* @__PURE__ */ f("p", {
363
+ /* @__PURE__ */ p(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
364
+ /* @__PURE__ */ p("p", {
362
365
  className: "text-status-error-text text-sm font-medium",
363
366
  children: E("vibecontrols.sessions.terminal.failedToStart", "Failed to start terminal")
364
367
  }),
365
- /* @__PURE__ */ f("p", {
368
+ /* @__PURE__ */ p("p", {
366
369
  className: "text-text-tertiary text-xs mt-2",
367
370
  children: e.error
368
371
  }),
369
- /* @__PURE__ */ f("div", {
372
+ /* @__PURE__ */ p("div", {
370
373
  className: "flex items-center justify-center gap-3 mt-4",
371
- children: b && y && /* @__PURE__ */ p("button", {
374
+ children: v && _ && /* @__PURE__ */ m("button", {
372
375
  type: "button",
373
376
  onClick: () => {
374
- let t = y.find((t) => t.id === e.sessionId);
375
- t && b(t);
377
+ let t = _.find((t) => t.id === e.sessionId);
378
+ t && v(t);
376
379
  },
377
380
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
378
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.retry", "Retry")]
381
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.retry", "Retry")]
379
382
  })
380
383
  })
381
384
  ]
382
385
  })
383
386
  }),
384
- !e.terminalUrl && !e.loading && !e.error && /* @__PURE__ */ f("div", {
387
+ !e.terminalUrl && !e.loading && !e.error && /* @__PURE__ */ p("div", {
385
388
  className: "flex items-center justify-center h-full",
386
- children: /* @__PURE__ */ p("div", {
389
+ children: /* @__PURE__ */ m("div", {
387
390
  className: "text-center max-w-sm space-y-3",
388
391
  children: [
389
- /* @__PURE__ */ f(u, { className: "size-8 text-text-secondary mx-auto" }),
390
- /* @__PURE__ */ f("p", {
392
+ /* @__PURE__ */ p(d, { className: "size-8 text-text-secondary mx-auto" }),
393
+ /* @__PURE__ */ p("p", {
391
394
  className: "text-text-primary text-sm font-medium",
392
395
  children: E("vibecontrols.sessions.terminal.terminalNotStarted", "Terminal not started yet")
393
396
  }),
394
- /* @__PURE__ */ f("p", {
397
+ /* @__PURE__ */ p("p", {
395
398
  className: "text-text-secondary text-xs",
396
399
  children: E("vibecontrols.sessions.terminal.startTerminalHint", "Click below to start a ttyd terminal on the agent for this session.")
397
400
  }),
398
- b && y && /* @__PURE__ */ p("button", {
401
+ v && _ && /* @__PURE__ */ m("button", {
399
402
  type: "button",
400
403
  onClick: () => {
401
- let t = y.find((t) => t.id === e.sessionId);
402
- t && b(t);
404
+ let t = _.find((t) => t.id === e.sessionId);
405
+ t && v(t);
403
406
  },
404
407
  className: "px-4 py-2 bg-accent-primary text-white text-sm rounded-md hover:bg-accent-primary/90 transition-colors inline-flex items-center gap-2",
405
- children: [/* @__PURE__ */ f(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.startTerminal", "Start terminal")]
408
+ children: [/* @__PURE__ */ p(d, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.startTerminal", "Start terminal")]
406
409
  })
407
410
  ]
408
411
  })
409
412
  })
410
413
  ]
411
414
  }, e.sessionId);
412
- }) : /* @__PURE__ */ f("div", {
415
+ }) : /* @__PURE__ */ p("div", {
413
416
  className: "flex items-center justify-center h-full",
414
- children: /* @__PURE__ */ p("div", {
417
+ children: /* @__PURE__ */ m("div", {
415
418
  className: "text-center max-w-md",
416
419
  children: [
417
- /* @__PURE__ */ f(u, { className: "size-12 text-text-secondary mx-auto mb-4" }),
418
- /* @__PURE__ */ f("p", {
420
+ /* @__PURE__ */ p(d, { className: "size-12 text-text-secondary mx-auto mb-4" }),
421
+ /* @__PURE__ */ p("p", {
419
422
  className: "text-text-secondary text-base font-medium mb-2",
420
423
  children: E("vibecontrols.sessions.terminal.noTerminalsOpen", "No terminals open")
421
424
  }),
422
- /* @__PURE__ */ f("p", {
425
+ /* @__PURE__ */ p("p", {
423
426
  className: "text-text-secondary text-sm mb-4",
424
427
  children: E("vibecontrols.sessions.terminal.clickPlusTab", "Click the + tab above to create a new session or open an existing one")
425
428
  }),
426
- S && /* @__PURE__ */ p("button", {
429
+ S && /* @__PURE__ */ m("button", {
427
430
  type: "button",
428
431
  onClick: S,
429
432
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
430
- children: [/* @__PURE__ */ f(c, { className: "size-4" }), E("vibecontrols.sessions.terminal.newSession", "New Session")]
433
+ children: [/* @__PURE__ */ p(l, { className: "size-4" }), E("vibecontrols.sessions.terminal.newSession", "New Session")]
431
434
  })
432
435
  ]
433
436
  })
434
437
  })
435
438
  }),
436
- O && (S || Y.length > 0) && H.current && /* @__PURE__ */ p("div", {
437
- ref: je,
439
+ O && (S || X.length > 0) && H.current && /* @__PURE__ */ m("div", {
440
+ ref: U,
438
441
  className: "fixed bg-bg-elevated border border-border-default rounded-md shadow-xl z-[10000] w-[280px]",
439
442
  style: {
440
443
  top: H.current.getBoundingClientRect().bottom + 4,
441
444
  left: Math.min(H.current.getBoundingClientRect().left, window.innerWidth - 290)
442
445
  },
443
446
  children: [
444
- /* @__PURE__ */ f("div", {
447
+ /* @__PURE__ */ p("div", {
445
448
  className: "p-2 border-b border-border-subtle",
446
- children: /* @__PURE__ */ p("div", {
449
+ children: /* @__PURE__ */ m("div", {
447
450
  className: "flex items-center gap-2 px-2 py-1.5 bg-bg-sunken rounded border border-border-subtle focus-within:border-border-strong",
448
451
  children: [
449
- /* @__PURE__ */ f(se, { className: "size-3.5 text-text-muted shrink-0" }),
450
- /* @__PURE__ */ f("input", {
452
+ /* @__PURE__ */ p(se, { className: "size-3.5 text-text-muted shrink-0" }),
453
+ /* @__PURE__ */ p("input", {
451
454
  "aria-label": "Search sessions...",
452
455
  ref: Me,
453
456
  type: "text",
@@ -456,56 +459,56 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
456
459
  placeholder: "Search sessions...",
457
460
  className: "w-full bg-bg-surface/0 text-sm text-text-primary outline-none placeholder:text-text-placeholder"
458
461
  }),
459
- A && /* @__PURE__ */ f("button", {
462
+ A && /* @__PURE__ */ p("button", {
460
463
  type: "button",
461
464
  onClick: () => j(""),
462
465
  className: "text-text-muted hover:text-text-primary shrink-0",
463
- children: /* @__PURE__ */ f(d, { className: "size-3" })
466
+ children: /* @__PURE__ */ p(f, { className: "size-3" })
464
467
  })
465
468
  ]
466
469
  })
467
470
  }),
468
- S && /* @__PURE__ */ p("button", {
471
+ S && /* @__PURE__ */ m("button", {
469
472
  type: "button",
470
473
  onClick: () => {
471
474
  S(), k(!1), j("");
472
475
  },
473
476
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left font-medium",
474
- children: [/* @__PURE__ */ f(c, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ f("span", { children: E("vibecontrols.sessions.terminal.newSession", "New Session") })]
477
+ children: [/* @__PURE__ */ p(l, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ p("span", { children: E("vibecontrols.sessions.terminal.newSession", "New Session") })]
475
478
  }),
476
- Y.length > 0 && /* @__PURE__ */ p(fe, { children: [
477
- /* @__PURE__ */ f("div", { className: "border-t border-border-subtle" }),
478
- /* @__PURE__ */ f("div", {
479
+ X.length > 0 && /* @__PURE__ */ m(fe, { children: [
480
+ /* @__PURE__ */ p("div", { className: "border-t border-border-subtle" }),
481
+ /* @__PURE__ */ p("div", {
479
482
  className: "px-3 pt-2 pb-1",
480
- children: /* @__PURE__ */ p("span", {
483
+ children: /* @__PURE__ */ m("span", {
481
484
  className: "text-[10px] font-medium uppercase tracking-wider text-text-muted",
482
485
  children: [
483
486
  "Open existing (",
484
- Y.length,
487
+ X.length,
485
488
  ")"
486
489
  ]
487
490
  })
488
491
  }),
489
- /* @__PURE__ */ f("div", {
492
+ /* @__PURE__ */ p("div", {
490
493
  className: "max-h-48 overflow-y-auto pb-1",
491
- children: Ie.length > 0 ? Ie.map((e) => /* @__PURE__ */ p("button", {
494
+ children: Ie.length > 0 ? Ie.map((e) => /* @__PURE__ */ m("button", {
492
495
  type: "button",
493
496
  onClick: () => {
494
- _e?.(e), k(!1), j("");
497
+ be?.(e), k(!1), j("");
495
498
  },
496
499
  className: "flex items-center gap-2 w-full px-3 py-1.5 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left",
497
500
  children: [
498
- /* @__PURE__ */ f(u, { className: "size-3.5 text-text-secondary shrink-0" }),
499
- /* @__PURE__ */ f("span", {
501
+ /* @__PURE__ */ p(d, { className: "size-3.5 text-text-secondary shrink-0" }),
502
+ /* @__PURE__ */ p("span", {
500
503
  className: "truncate",
501
504
  children: e.name
502
505
  }),
503
- /* @__PURE__ */ f("span", {
506
+ /* @__PURE__ */ p("span", {
504
507
  className: `ml-auto text-[10px] px-1.5 py-0.5 rounded shrink-0 ${e.status === "RUNNING" ? "bg-status-success-text/10 text-status-success-text" : e.status === "STOPPED" || e.status === "TERMINATED" ? "bg-text-secondary/10 text-text-tertiary" : "bg-status-warning-text/10 text-status-warning-text"}`,
505
508
  children: e.status.toLowerCase()
506
509
  })
507
510
  ]
508
- }, e.id)) : /* @__PURE__ */ p("div", {
511
+ }, e.id)) : /* @__PURE__ */ m("div", {
509
512
  className: "px-3 py-2 text-xs text-text-muted",
510
513
  children: [
511
514
  "No sessions matching “",
@@ -517,7 +520,7 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
517
520
  ] })
518
521
  ]
519
522
  }),
520
- M.visible && $ && /* @__PURE__ */ p("div", {
523
+ M.visible && $ && /* @__PURE__ */ m("div", {
521
524
  ref: V,
522
525
  className: "fixed bg-bg-elevated border border-border-default rounded-lg shadow-lg z-[10000] min-w-[180px] py-1",
523
526
  style: {
@@ -525,24 +528,24 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
525
528
  left: M.x
526
529
  },
527
530
  children: [
528
- x && /* @__PURE__ */ p("button", {
531
+ y && /* @__PURE__ */ m("button", {
529
532
  type: "button",
530
- onClick: () => Ve($.sessionId),
533
+ onClick: () => He($.sessionId),
531
534
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
532
- children: [/* @__PURE__ */ f(ne, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.rename", "Rename")]
535
+ children: [/* @__PURE__ */ p(ne, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.rename", "Rename")]
533
536
  }),
534
- $.terminalUrl && /* @__PURE__ */ p("button", {
537
+ $.terminalUrl && /* @__PURE__ */ m("button", {
535
538
  type: "button",
536
539
  onClick: () => {
537
- _($.sessionId), N((e) => ({
540
+ _e($.sessionId), N((e) => ({
538
541
  ...e,
539
542
  visible: !1
540
543
  }));
541
544
  },
542
545
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
543
- children: [/* @__PURE__ */ f(o, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
546
+ children: [/* @__PURE__ */ p(s, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
544
547
  }),
545
- $.terminalUrl && L[$.sessionId] === "error" && /* @__PURE__ */ p("button", {
548
+ $.terminalUrl && L[$.sessionId] === "error" && /* @__PURE__ */ m("button", {
546
549
  type: "button",
547
550
  onClick: () => {
548
551
  Z($.sessionId), N((e) => ({
@@ -551,218 +554,220 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
551
554
  }));
552
555
  },
553
556
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-warning-text hover:bg-bg-sunken transition-colors",
554
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnect", "Reconnect")]
557
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnect", "Reconnect")]
555
558
  }),
556
- ye && /* @__PURE__ */ p("button", {
559
+ x && /* @__PURE__ */ m("button", {
557
560
  type: "button",
558
561
  onClick: () => {
559
- ye($.sessionId), N((e) => ({
562
+ x($.sessionId), N((e) => ({
560
563
  ...e,
561
564
  visible: !1
562
565
  }));
563
566
  },
564
567
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
565
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.restartTerminal", "Restart Terminal")]
568
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.restartTerminal", "Restart Terminal")]
566
569
  }),
567
- ve && /* @__PURE__ */ p("button", {
570
+ b && /* @__PURE__ */ m("button", {
568
571
  type: "button",
569
572
  onClick: () => {
570
- ve($.sessionId), N((e) => ({
573
+ b($.sessionId), N((e) => ({
571
574
  ...e,
572
575
  visible: !1
573
576
  }));
574
577
  },
575
578
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
576
- children: [/* @__PURE__ */ f(le, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.stopTerminal", "Stop Terminal")]
579
+ children: [/* @__PURE__ */ p(le, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.stopTerminal", "Stop Terminal")]
577
580
  }),
578
- /* @__PURE__ */ f("div", { className: "border-t border-border-subtle my-1" }),
579
- /* @__PURE__ */ p("button", {
581
+ /* @__PURE__ */ p("div", { className: "border-t border-border-subtle my-1" }),
582
+ /* @__PURE__ */ m("button", {
580
583
  type: "button",
581
584
  onClick: () => {
582
- g($.sessionId), N((e) => ({
585
+ ge($.sessionId), N((e) => ({
583
586
  ...e,
584
587
  visible: !1
585
588
  }));
586
589
  },
587
590
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-error-text hover:bg-bg-sunken transition-colors",
588
- children: [/* @__PURE__ */ f(d, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
591
+ children: [/* @__PURE__ */ p(f, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
589
592
  })
590
593
  ]
591
594
  })
592
595
  ]
593
- }), document.body) : null : /* @__PURE__ */ p("div", {
594
- ref: Ae,
595
- className: `${C ? "flex flex-col h-full" : ""} border-t border-border-default bg-bg-surface ${v && m.length === 0 && !C ? "hidden" : ""}`,
596
+ }), document.body) : null : /* @__PURE__ */ m("div", {
597
+ ref: je,
598
+ className: `${C ? "flex flex-col h-full" : ""} border-t border-border-default bg-bg-surface ${g && h.length === 0 && !C ? "hidden" : ""}`,
596
599
  children: [
597
- !C && !v && m.length > 0 && /* @__PURE__ */ f("div", {
598
- onMouseDown: ze,
600
+ !C && !g && h.length > 0 && /* @__PURE__ */ p("div", {
601
+ onMouseDown: Be,
599
602
  className: "h-1 cursor-ns-resize hover:bg-action-primary-bg/30 transition-colors flex items-center justify-center group",
600
603
  title: "Drag to resize",
601
- children: /* @__PURE__ */ f(ie, { className: "w-4 h-3 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity rotate-90" })
604
+ children: /* @__PURE__ */ p(ie, { className: "w-4 h-3 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity rotate-90" })
602
605
  }),
603
- /* @__PURE__ */ p("div", {
606
+ /* @__PURE__ */ m("div", {
604
607
  className: "flex items-center bg-bg-sunken border-b border-border-default",
605
608
  children: [
606
- !C && /* @__PURE__ */ p("button", {
609
+ !C && /* @__PURE__ */ m("button", {
607
610
  type: "button",
608
- onClick: he,
611
+ onClick: ve,
609
612
  className: "flex items-center gap-1 px-3 py-2 text-text-secondary hover:text-text-primary transition-colors text-xs font-medium uppercase tracking-wide",
610
- title: v ? "Expand terminal" : "Collapse terminal",
613
+ title: g ? "Expand terminal" : "Collapse terminal",
611
614
  children: [
612
- /* @__PURE__ */ f(u, { className: "size-3.5" }),
615
+ /* @__PURE__ */ p(d, { className: "size-3.5" }),
613
616
  "Terminal",
614
- f(v ? te : a, { className: "size-3" })
617
+ p(g ? te : o, { className: "size-3" })
615
618
  ]
616
619
  }),
617
- (!v || C) && /* @__PURE__ */ f("div", {
620
+ (!g || C) && /* @__PURE__ */ p("div", {
618
621
  className: "flex items-center overflow-x-auto flex-1 min-w-0",
619
- children: m.map((e) => /* @__PURE__ */ p("div", {
622
+ children: h.map((e) => /* @__PURE__ */ m("div", {
620
623
  role: "button",
621
624
  tabIndex: 0,
622
625
  onKeyDown: (t) => {
623
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), h(e.sessionId));
626
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), he(e.sessionId));
624
627
  },
625
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-border-subtle cursor-pointer transition-colors min-w-0 max-w-[180px] group ${e.sessionId === K?.sessionId ? "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"}`,
626
- onClick: () => h(e.sessionId),
627
- onContextMenu: (t) => Be(t, e.sessionId),
628
- onDoubleClick: () => Ve(e.sessionId),
628
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-border-subtle cursor-pointer transition-colors min-w-0 max-w-[180px] group ${e.sessionId === q?.sessionId ? "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"}`,
629
+ onClick: () => he(e.sessionId),
630
+ onContextMenu: (t) => Ve(t, e.sessionId),
631
+ onDoubleClick: () => He(e.sessionId),
629
632
  children: [
630
- Ge(e),
631
- P === e.sessionId ? /* @__PURE__ */ f("input", {
633
+ Ke(e),
634
+ P === e.sessionId ? /* @__PURE__ */ p("input", {
632
635
  "aria-label": "control",
633
636
  ref: B,
634
637
  value: F,
635
638
  onChange: (e) => I(e.target.value),
636
639
  onBlur: Q,
637
- onKeyDown: He,
640
+ onKeyDown: Ue,
638
641
  onClick: (e) => e.stopPropagation(),
639
642
  className: "bg-bg-sunken border border-border-strong rounded px-1 py-0 text-xs text-text-primary w-[100px] outline-none"
640
- }) : /* @__PURE__ */ f("span", {
643
+ }) : /* @__PURE__ */ p("span", {
641
644
  className: "truncate",
642
645
  children: e.name
643
646
  }),
644
- /* @__PURE__ */ f("button", {
647
+ /* @__PURE__ */ p("button", {
645
648
  type: "button",
646
649
  onClick: (t) => {
647
- t.stopPropagation(), g(e.sessionId);
650
+ t.stopPropagation(), ge(e.sessionId);
648
651
  },
649
652
  className: "ml-auto opacity-0 group-hover:opacity-100 hover:text-status-error-text transition-opacity shrink-0",
650
653
  title: "Close terminal",
651
- children: /* @__PURE__ */ f(d, { className: "size-3" })
654
+ children: /* @__PURE__ */ p(f, { className: "size-3" })
652
655
  })
653
656
  ]
654
657
  }, e.sessionId))
655
658
  }),
656
- (!v || C) && /* @__PURE__ */ f("button", {
659
+ (!g || C) && /* @__PURE__ */ p("button", {
657
660
  type: "button",
658
661
  ref: H,
659
662
  onClick: () => {
660
- (S || Y.length > 0) && (k((e) => !e), j(""));
663
+ (S || X.length > 0) && (k((e) => !e), j(""));
661
664
  },
662
665
  className: "flex items-center px-2.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors shrink-0 border-r border-border-subtle",
663
666
  title: "New session or open existing",
664
- children: /* @__PURE__ */ f(c, { className: "size-3.5" })
667
+ children: /* @__PURE__ */ p(l, { className: "size-3.5" })
665
668
  }),
666
- (!v || C) && m.length > 0 && /* @__PURE__ */ p("div", {
669
+ (!g || C) && h.length > 0 && /* @__PURE__ */ m("div", {
667
670
  className: "flex items-center gap-1 px-2 shrink-0",
668
671
  children: [
669
- K && L[K.sessionId] === "error" && /* @__PURE__ */ f("button", {
672
+ q && L[q.sessionId] === "error" && /* @__PURE__ */ p("button", {
670
673
  type: "button",
671
- onClick: () => Z(K.sessionId),
674
+ onClick: () => Z(q.sessionId),
672
675
  className: "p-1 text-status-warning-text hover:text-status-warning-text/80 transition-colors",
673
676
  title: "Reconnect terminal",
674
- children: /* @__PURE__ */ f(l, { className: "size-3.5" })
677
+ children: /* @__PURE__ */ p(u, { className: "size-3.5" })
675
678
  }),
676
- K?.terminalUrl && /* @__PURE__ */ f("button", {
679
+ q?.terminalUrl && /* @__PURE__ */ p("button", {
677
680
  type: "button",
678
- onClick: () => K && _(K.sessionId),
681
+ onClick: () => q && _e(q.sessionId),
679
682
  className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
680
683
  title: "Open in new tab",
681
- children: /* @__PURE__ */ f(o, { className: "size-3.5" })
684
+ children: /* @__PURE__ */ p(s, { className: "size-3.5" })
682
685
  }),
683
- T && /* @__PURE__ */ f("button", {
686
+ T && /* @__PURE__ */ p("button", {
684
687
  type: "button",
685
688
  onClick: T,
686
689
  className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
687
690
  title: w ? "Exit fullscreen" : "Enter fullscreen",
688
- children: f(w ? ce : re, { className: "size-3.5" })
691
+ children: p(w ? ce : re, { className: "size-3.5" })
689
692
  }),
690
- !C && !w && /* @__PURE__ */ f("button", {
693
+ !C && !w && /* @__PURE__ */ p("button", {
691
694
  type: "button",
692
695
  onClick: Fe,
693
696
  className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
694
697
  title: D ? "Restore size" : "Maximize",
695
- children: f(D ? oe : ae, { className: "size-3.5" })
698
+ children: p(D ? oe : ae, { className: "size-3.5" })
696
699
  })
697
700
  ]
698
701
  })
699
702
  ]
700
703
  }),
701
- (!v || C) && K && /* @__PURE__ */ f("div", {
702
- className: `${Ue || ""} bg-bg-sunken text-text-primary relative ${C ? "flex-1" : ""}`,
703
- style: We,
704
- children: m.map((e) => {
705
- let t = L[e.sessionId], n = t === "connecting" || e.loading, r = Pe(e.terminalUrl), i = r ?? R[e.sessionId], a = !!e.terminalUrl && !e.error && !r, te = !!r || a && t === "error";
706
- return /* @__PURE__ */ p("div", {
707
- className: `absolute inset-0 ${e.sessionId === K.sessionId ? "block" : "hidden"}`,
704
+ (!g || C) && q && /* @__PURE__ */ p("div", {
705
+ className: `${We || ""} bg-bg-sunken text-text-primary relative ${C ? "flex-1" : ""}`,
706
+ style: Ge,
707
+ children: h.map((e) => {
708
+ let n = L[e.sessionId], r = n === "connecting" || e.loading, i = Pe(e.terminalUrl), a = i ?? R[e.sessionId], o = !!e.terminalUrl && !e.error && !i, te = !!i || o && n === "error";
709
+ return /* @__PURE__ */ m("div", {
710
+ className: `absolute inset-0 ${e.sessionId === q.sessionId ? "block" : "hidden"}`,
708
711
  children: [
709
- a && e.terminalUrl && /* @__PURE__ */ f("iframe", {
712
+ o && e.terminalUrl && /* @__PURE__ */ p(t, {
710
713
  ref: (t) => {
711
714
  Ne.current[e.sessionId] = t;
712
715
  },
713
- src: e.terminalUrl,
716
+ sessionId: e.sessionId,
717
+ agentId: e.agentId ?? null,
718
+ baseTtydUrl: e.terminalUrl,
714
719
  title: `Terminal - ${e.name}`,
715
720
  className: "w-full h-full border-0",
716
721
  allow: "clipboard-read *; clipboard-write *",
717
722
  onLoad: () => Le(e.sessionId),
718
723
  onError: () => Re(e.sessionId)
719
724
  }),
720
- a && n && /* @__PURE__ */ f("div", {
725
+ o && r && /* @__PURE__ */ p("div", {
721
726
  className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center pointer-events-none z-10",
722
- children: /* @__PURE__ */ p("div", {
727
+ children: /* @__PURE__ */ m("div", {
723
728
  className: "flex items-center gap-3 px-4 py-3 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
724
- children: [/* @__PURE__ */ f(s, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
729
+ children: [/* @__PURE__ */ p(c, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
725
730
  className: "text-text-primary text-sm font-medium",
726
731
  children: e.loading ? E("vibecontrols.sessions.terminal.startingTerminal", "Starting terminal...") : E("vibecontrols.sessions.terminal.connecting", "Connecting...")
727
- }), /* @__PURE__ */ f("p", {
732
+ }), /* @__PURE__ */ p("p", {
728
733
  className: "text-text-secondary text-xs",
729
734
  children: e.loading ? E("vibecontrols.sessions.terminal.settingUpTmux", "Setting up tmux + ttyd") : E("vibecontrols.sessions.terminal.establishingConnection", "Establishing connection")
730
735
  })] })]
731
736
  })
732
737
  }),
733
- te && !e.error && /* @__PURE__ */ f("div", {
738
+ te && !e.error && /* @__PURE__ */ p("div", {
734
739
  className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center z-10",
735
- children: /* @__PURE__ */ p("div", {
740
+ children: /* @__PURE__ */ m("div", {
736
741
  className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
737
742
  children: [
738
- /* @__PURE__ */ f(de, { className: "size-6 text-status-error-text" }),
739
- /* @__PURE__ */ p("div", {
743
+ /* @__PURE__ */ p(de, { className: "size-6 text-status-error-text" }),
744
+ /* @__PURE__ */ m("div", {
740
745
  className: "text-center",
741
- children: [/* @__PURE__ */ f("p", {
746
+ children: [/* @__PURE__ */ p("p", {
742
747
  className: "text-text-primary text-sm font-medium",
743
748
  children: E("vibecontrols.sessions.terminal.connectionLost", "Connection Lost")
744
- }), /* @__PURE__ */ f("p", {
749
+ }), /* @__PURE__ */ p("p", {
745
750
  className: "text-text-secondary text-xs mt-1",
746
- children: i || ((W.current[e.sessionId] ?? 0) < 15 ? E("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : E("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
751
+ children: a || ((G.current[e.sessionId] ?? 0) < 15 ? E("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : E("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
747
752
  })]
748
753
  }),
749
- !i && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ f(s, { className: "size-4 text-text-tertiary animate-spin" }),
750
- /* @__PURE__ */ p("button", {
754
+ !a && (G.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ p(c, { className: "size-4 text-text-tertiary animate-spin" }),
755
+ /* @__PURE__ */ m("button", {
751
756
  type: "button",
752
757
  onClick: () => Z(e.sessionId),
753
758
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
754
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
759
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
755
760
  })
756
761
  ]
757
762
  })
758
763
  }),
759
- !e.terminalUrl && e.loading && /* @__PURE__ */ f("div", {
764
+ !e.terminalUrl && e.loading && /* @__PURE__ */ p("div", {
760
765
  className: "flex items-center justify-center h-full",
761
- children: /* @__PURE__ */ p("div", {
766
+ children: /* @__PURE__ */ m("div", {
762
767
  className: "text-center",
763
768
  children: [
764
- /* @__PURE__ */ f(s, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
765
- /* @__PURE__ */ p("p", {
769
+ /* @__PURE__ */ p(c, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
770
+ /* @__PURE__ */ m("p", {
766
771
  className: "text-text-tertiary text-sm",
767
772
  children: [
768
773
  "Starting terminal for ",
@@ -770,53 +775,53 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
770
775
  "..."
771
776
  ]
772
777
  }),
773
- /* @__PURE__ */ f("p", {
778
+ /* @__PURE__ */ p("p", {
774
779
  className: "text-text-secondary text-xs mt-1",
775
780
  children: "Setting up tmux + ttyd terminal"
776
781
  })
777
782
  ]
778
783
  })
779
784
  }),
780
- e.error && /* @__PURE__ */ f("div", {
785
+ e.error && /* @__PURE__ */ p("div", {
781
786
  className: "flex items-center justify-center h-full",
782
- children: /* @__PURE__ */ p("div", {
787
+ children: /* @__PURE__ */ m("div", {
783
788
  className: "text-center max-w-md",
784
789
  children: [
785
- /* @__PURE__ */ f(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
786
- /* @__PURE__ */ f("p", {
790
+ /* @__PURE__ */ p(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
791
+ /* @__PURE__ */ p("p", {
787
792
  className: "text-status-error-text text-sm font-medium",
788
793
  children: E("vibecontrols.sessions.terminal.failedToStart", "Failed to start terminal")
789
794
  }),
790
- /* @__PURE__ */ f("p", {
795
+ /* @__PURE__ */ p("p", {
791
796
  className: "text-text-tertiary text-xs mt-2",
792
797
  children: e.error
793
798
  }),
794
- /* @__PURE__ */ f("div", {
799
+ /* @__PURE__ */ p("div", {
795
800
  className: "flex items-center justify-center gap-3 mt-4",
796
- children: b && y && /* @__PURE__ */ p("button", {
801
+ children: v && _ && /* @__PURE__ */ m("button", {
797
802
  type: "button",
798
803
  onClick: () => {
799
- let t = y.find((t) => t.id === e.sessionId);
800
- t && b(t);
804
+ let t = _.find((t) => t.id === e.sessionId);
805
+ t && v(t);
801
806
  },
802
807
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
803
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.retry", "Retry")]
808
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.retry", "Retry")]
804
809
  })
805
810
  })
806
811
  ]
807
812
  })
808
813
  }),
809
- !e.terminalUrl && !e.loading && !e.error && /* @__PURE__ */ f("div", {
814
+ !e.terminalUrl && !e.loading && !e.error && /* @__PURE__ */ p("div", {
810
815
  className: "flex items-center justify-center h-full",
811
- children: /* @__PURE__ */ p("div", {
816
+ children: /* @__PURE__ */ m("div", {
812
817
  className: "text-center",
813
818
  children: [
814
- /* @__PURE__ */ f(u, { className: "size-8 text-text-secondary mx-auto mb-3" }),
815
- /* @__PURE__ */ f("p", {
819
+ /* @__PURE__ */ p(d, { className: "size-8 text-text-secondary mx-auto mb-3" }),
820
+ /* @__PURE__ */ p("p", {
816
821
  className: "text-text-tertiary text-sm",
817
822
  children: E("vibecontrols.sessions.terminal.noTerminalUrl", "No terminal URL available")
818
823
  }),
819
- /* @__PURE__ */ f("p", {
824
+ /* @__PURE__ */ p("p", {
820
825
  className: "text-text-secondary text-xs mt-1",
821
826
  children: E("vibecontrols.sessions.terminal.agentNeedsTtyd", "The agent needs to start ttyd for this session")
822
827
  })
@@ -827,49 +832,49 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
827
832
  }, e.sessionId);
828
833
  })
829
834
  }),
830
- (!v || C) && m.length === 0 && C && /* @__PURE__ */ f("div", {
835
+ (!g || C) && h.length === 0 && C && /* @__PURE__ */ p("div", {
831
836
  className: "flex-1 bg-bg-sunken text-text-primary flex items-center justify-center",
832
- children: /* @__PURE__ */ p("div", {
837
+ children: /* @__PURE__ */ m("div", {
833
838
  className: "text-center max-w-md",
834
839
  children: [
835
- /* @__PURE__ */ f(u, { className: "size-12 text-text-secondary mx-auto mb-4" }),
836
- /* @__PURE__ */ f("p", {
840
+ /* @__PURE__ */ p(d, { className: "size-12 text-text-secondary mx-auto mb-4" }),
841
+ /* @__PURE__ */ p("p", {
837
842
  className: "text-text-secondary text-base font-medium mb-2",
838
843
  children: E("vibecontrols.sessions.terminal.noTerminalsOpen", "No terminals open")
839
844
  }),
840
- /* @__PURE__ */ f("p", {
845
+ /* @__PURE__ */ p("p", {
841
846
  className: "text-text-secondary text-sm mb-4",
842
847
  children: E("vibecontrols.sessions.terminal.clickPlusTab", "Click the + tab above to create a new session or open an existing one")
843
848
  }),
844
- /* @__PURE__ */ f("div", {
849
+ /* @__PURE__ */ p("div", {
845
850
  className: "flex items-center justify-center gap-2 flex-wrap",
846
- children: S && /* @__PURE__ */ p("button", {
851
+ children: S && /* @__PURE__ */ m("button", {
847
852
  type: "button",
848
853
  onClick: S,
849
854
  className: "px-4 py-2 bg-bg-sunken text-text-primary text-sm rounded-md hover:bg-bg-sunken/80 transition-colors inline-flex items-center gap-2",
850
- children: [/* @__PURE__ */ f(c, { className: "size-4" }), E("vibecontrols.sessions.terminal.newSession", "New Session")]
855
+ children: [/* @__PURE__ */ p(l, { className: "size-4" }), E("vibecontrols.sessions.terminal.newSession", "New Session")]
851
856
  })
852
857
  }),
853
- Y.length > 0 && /* @__PURE__ */ p("div", {
858
+ X.length > 0 && /* @__PURE__ */ m("div", {
854
859
  className: "mt-6",
855
- children: [/* @__PURE__ */ f("p", {
860
+ children: [/* @__PURE__ */ p("p", {
856
861
  className: "text-text-secondary text-xs uppercase tracking-wider mb-3",
857
862
  children: "Or open an existing session"
858
- }), /* @__PURE__ */ p("div", {
863
+ }), /* @__PURE__ */ m("div", {
859
864
  className: "flex flex-wrap justify-center gap-2",
860
- children: [Y.slice(0, 6).map((e) => /* @__PURE__ */ p("button", {
865
+ children: [X.slice(0, 6).map((e) => /* @__PURE__ */ m("button", {
861
866
  type: "button",
862
- onClick: () => _e?.(e),
867
+ onClick: () => be?.(e),
863
868
  className: "flex items-center gap-1.5 px-3 py-1.5 bg-bg-canvas text-text-secondary text-xs rounded-md hover:bg-bg-sunken transition-colors border border-border-default",
864
869
  children: [
865
- /* @__PURE__ */ f(u, { className: "size-3" }),
866
- /* @__PURE__ */ f("span", {
870
+ /* @__PURE__ */ p(d, { className: "size-3" }),
871
+ /* @__PURE__ */ p("span", {
867
872
  className: "truncate max-w-[120px]",
868
873
  children: e.name
869
874
  }),
870
- /* @__PURE__ */ f("span", { className: `size-1.5 rounded-full ${e.status === "RUNNING" ? "bg-status-success-text" : "bg-text-secondary"}` })
875
+ /* @__PURE__ */ p("span", { className: `size-1.5 rounded-full ${e.status === "RUNNING" ? "bg-status-success-text" : "bg-text-secondary"}` })
871
876
  ]
872
- }, e.id)), Y.length > 6 && /* @__PURE__ */ p("button", {
877
+ }, e.id)), X.length > 6 && /* @__PURE__ */ m("button", {
873
878
  type: "button",
874
879
  onClick: () => {
875
880
  k(!0), j("");
@@ -877,7 +882,7 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
877
882
  className: "text-text-tertiary text-xs self-center hover:text-text-primary transition-colors cursor-pointer",
878
883
  children: [
879
884
  "+",
880
- Y.length - 6,
885
+ X.length - 6,
881
886
  " more"
882
887
  ]
883
888
  })]
@@ -886,21 +891,21 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
886
891
  ]
887
892
  })
888
893
  }),
889
- O && (S || Y.length > 0) && H.current && /* @__PURE__ */ p("div", {
890
- ref: je,
894
+ O && (S || X.length > 0) && H.current && /* @__PURE__ */ m("div", {
895
+ ref: U,
891
896
  className: "fixed bg-bg-elevated border border-border-default rounded-md shadow-xl z-[100] w-[280px]",
892
897
  style: {
893
898
  top: H.current.getBoundingClientRect().bottom + 4,
894
899
  left: Math.min(H.current.getBoundingClientRect().left, window.innerWidth - 290)
895
900
  },
896
901
  children: [
897
- /* @__PURE__ */ f("div", {
902
+ /* @__PURE__ */ p("div", {
898
903
  className: "p-2 border-b border-border-subtle",
899
- children: /* @__PURE__ */ p("div", {
904
+ children: /* @__PURE__ */ m("div", {
900
905
  className: "flex items-center gap-2 px-2 py-1.5 bg-bg-sunken rounded border border-border-subtle focus-within:border-border-strong",
901
906
  children: [
902
- /* @__PURE__ */ f(se, { className: "size-3.5 text-text-muted shrink-0" }),
903
- /* @__PURE__ */ f("input", {
907
+ /* @__PURE__ */ p(se, { className: "size-3.5 text-text-muted shrink-0" }),
908
+ /* @__PURE__ */ p("input", {
904
909
  "aria-label": "Search sessions...",
905
910
  ref: Me,
906
911
  type: "text",
@@ -909,56 +914,56 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
909
914
  placeholder: "Search sessions...",
910
915
  className: "w-full bg-bg-surface/0 text-sm text-text-primary outline-none placeholder:text-text-placeholder"
911
916
  }),
912
- A && /* @__PURE__ */ f("button", {
917
+ A && /* @__PURE__ */ p("button", {
913
918
  type: "button",
914
919
  onClick: () => j(""),
915
920
  className: "text-text-muted hover:text-text-primary shrink-0",
916
- children: /* @__PURE__ */ f(d, { className: "size-3" })
921
+ children: /* @__PURE__ */ p(f, { className: "size-3" })
917
922
  })
918
923
  ]
919
924
  })
920
925
  }),
921
- S && /* @__PURE__ */ p("button", {
926
+ S && /* @__PURE__ */ m("button", {
922
927
  type: "button",
923
928
  onClick: () => {
924
929
  S(), k(!1), j("");
925
930
  },
926
931
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left font-medium",
927
- children: [/* @__PURE__ */ f(c, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ f("span", { children: E("vibecontrols.sessions.terminal.newSession", "New Session") })]
932
+ children: [/* @__PURE__ */ p(l, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ p("span", { children: E("vibecontrols.sessions.terminal.newSession", "New Session") })]
928
933
  }),
929
- Y.length > 0 && /* @__PURE__ */ p(fe, { children: [
930
- /* @__PURE__ */ f("div", { className: "border-t border-border-subtle" }),
931
- /* @__PURE__ */ f("div", {
934
+ X.length > 0 && /* @__PURE__ */ m(fe, { children: [
935
+ /* @__PURE__ */ p("div", { className: "border-t border-border-subtle" }),
936
+ /* @__PURE__ */ p("div", {
932
937
  className: "px-3 pt-2 pb-1",
933
- children: /* @__PURE__ */ p("span", {
938
+ children: /* @__PURE__ */ m("span", {
934
939
  className: "text-[10px] font-medium uppercase tracking-wider text-text-muted",
935
940
  children: [
936
941
  "Open existing (",
937
- Y.length,
942
+ X.length,
938
943
  ")"
939
944
  ]
940
945
  })
941
946
  }),
942
- /* @__PURE__ */ f("div", {
947
+ /* @__PURE__ */ p("div", {
943
948
  className: "max-h-48 overflow-y-auto pb-1",
944
- children: Ie.length > 0 ? Ie.map((e) => /* @__PURE__ */ p("button", {
949
+ children: Ie.length > 0 ? Ie.map((e) => /* @__PURE__ */ m("button", {
945
950
  type: "button",
946
951
  onClick: () => {
947
- _e?.(e), k(!1), j("");
952
+ be?.(e), k(!1), j("");
948
953
  },
949
954
  className: "flex items-center gap-2 w-full px-3 py-1.5 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left",
950
955
  children: [
951
- /* @__PURE__ */ f(u, { className: "size-3.5 text-text-secondary shrink-0" }),
952
- /* @__PURE__ */ f("span", {
956
+ /* @__PURE__ */ p(d, { className: "size-3.5 text-text-secondary shrink-0" }),
957
+ /* @__PURE__ */ p("span", {
953
958
  className: "truncate",
954
959
  children: e.name
955
960
  }),
956
- /* @__PURE__ */ f("span", {
961
+ /* @__PURE__ */ p("span", {
957
962
  className: `ml-auto text-[10px] px-1.5 py-0.5 rounded shrink-0 ${e.status === "RUNNING" ? "bg-status-success-text/10 text-status-success-text" : e.status === "STOPPED" || e.status === "TERMINATED" ? "bg-text-secondary/10 text-text-tertiary" : "bg-status-warning-text/10 text-status-warning-text"}`,
958
963
  children: e.status.toLowerCase()
959
964
  })
960
965
  ]
961
- }, e.id)) : /* @__PURE__ */ p("div", {
966
+ }, e.id)) : /* @__PURE__ */ m("div", {
962
967
  className: "px-3 py-2 text-xs text-text-muted",
963
968
  children: [
964
969
  "No sessions matching “",
@@ -970,7 +975,7 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
970
975
  ] })
971
976
  ]
972
977
  }),
973
- M.visible && $ && /* @__PURE__ */ p("div", {
978
+ M.visible && $ && /* @__PURE__ */ m("div", {
974
979
  ref: V,
975
980
  className: "fixed bg-bg-elevated border border-border-default rounded-lg shadow-lg z-[100] min-w-[180px] py-1",
976
981
  style: {
@@ -978,24 +983,24 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
978
983
  left: M.x
979
984
  },
980
985
  children: [
981
- x && /* @__PURE__ */ p("button", {
986
+ y && /* @__PURE__ */ m("button", {
982
987
  type: "button",
983
- onClick: () => Ve($.sessionId),
988
+ onClick: () => He($.sessionId),
984
989
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
985
- children: [/* @__PURE__ */ f(ne, { className: "size-3.5" }), "Rename"]
990
+ children: [/* @__PURE__ */ p(ne, { className: "size-3.5" }), "Rename"]
986
991
  }),
987
- $.terminalUrl && /* @__PURE__ */ p("button", {
992
+ $.terminalUrl && /* @__PURE__ */ m("button", {
988
993
  type: "button",
989
994
  onClick: () => {
990
- _($.sessionId), N((e) => ({
995
+ _e($.sessionId), N((e) => ({
991
996
  ...e,
992
997
  visible: !1
993
998
  }));
994
999
  },
995
1000
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
996
- children: [/* @__PURE__ */ f(o, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
1001
+ children: [/* @__PURE__ */ p(s, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
997
1002
  }),
998
- $.terminalUrl && L[$.sessionId] === "error" && /* @__PURE__ */ p("button", {
1003
+ $.terminalUrl && L[$.sessionId] === "error" && /* @__PURE__ */ m("button", {
999
1004
  type: "button",
1000
1005
  onClick: () => {
1001
1006
  Z($.sessionId), N((e) => ({
@@ -1004,41 +1009,41 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
1004
1009
  }));
1005
1010
  },
1006
1011
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-warning-text hover:bg-bg-sunken transition-colors",
1007
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), "Reconnect"]
1012
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), "Reconnect"]
1008
1013
  }),
1009
- ye && /* @__PURE__ */ p("button", {
1014
+ x && /* @__PURE__ */ m("button", {
1010
1015
  type: "button",
1011
1016
  onClick: () => {
1012
- ye($.sessionId), N((e) => ({
1017
+ x($.sessionId), N((e) => ({
1013
1018
  ...e,
1014
1019
  visible: !1
1015
1020
  }));
1016
1021
  },
1017
1022
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
1018
- children: [/* @__PURE__ */ f(l, { className: "size-3.5" }), "Restart Terminal"]
1023
+ children: [/* @__PURE__ */ p(u, { className: "size-3.5" }), "Restart Terminal"]
1019
1024
  }),
1020
- ve && /* @__PURE__ */ p("button", {
1025
+ b && /* @__PURE__ */ m("button", {
1021
1026
  type: "button",
1022
1027
  onClick: () => {
1023
- ve($.sessionId), N((e) => ({
1028
+ b($.sessionId), N((e) => ({
1024
1029
  ...e,
1025
1030
  visible: !1
1026
1031
  }));
1027
1032
  },
1028
1033
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
1029
- children: [/* @__PURE__ */ f(le, { className: "size-3.5" }), "Stop Terminal"]
1034
+ children: [/* @__PURE__ */ p(le, { className: "size-3.5" }), "Stop Terminal"]
1030
1035
  }),
1031
- /* @__PURE__ */ f("div", { className: "border-t border-border-subtle my-1" }),
1032
- /* @__PURE__ */ p("button", {
1036
+ /* @__PURE__ */ p("div", { className: "border-t border-border-subtle my-1" }),
1037
+ /* @__PURE__ */ m("button", {
1033
1038
  type: "button",
1034
1039
  onClick: () => {
1035
- g($.sessionId), N((e) => ({
1040
+ ge($.sessionId), N((e) => ({
1036
1041
  ...e,
1037
1042
  visible: !1
1038
1043
  }));
1039
1044
  },
1040
1045
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-error-text hover:bg-bg-sunken transition-colors",
1041
- children: [/* @__PURE__ */ f(d, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
1046
+ children: [/* @__PURE__ */ p(f, { className: "size-3.5" }), E("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
1042
1047
  })
1043
1048
  ]
1044
1049
  })
@@ -1046,6 +1051,6 @@ function m({ tabs: m, activeTabId: me, onTabSelect: h, onTabClose: g, onOpenExte
1046
1051
  });
1047
1052
  }
1048
1053
  //#endregion
1049
- export { m as TerminalPanel };
1054
+ export { h as TerminalPanel };
1050
1055
 
1051
1056
  //# sourceMappingURL=TerminalPanel.js.map