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