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