@burdenoff/microfe-vibecontrols 2026.608.1 → 2026.608.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/agents/OpenInBrowserEditorButton.js +22 -17
- package/dist/components/agents/OpenInBrowserEditorButton.js.map +1 -1
- package/dist/components/sessions/TerminalPanel.js +536 -413
- package/dist/components/sessions/TerminalPanel.js.map +1 -1
- package/dist/components/sessions/sessionShortcuts.js +30 -3
- package/dist/components/sessions/sessionShortcuts.js.map +1 -1
- package/dist/components/shared/SessionNotificationBanner.js +28 -21
- package/dist/components/shared/SessionNotificationBanner.js.map +1 -1
- package/dist/pages/SessionsPage.js +1126 -908
- package/dist/pages/SessionsPage.js.map +1 -1
- package/dist/store/vibeControlsStore.js +18 -0
- package/dist/store/vibeControlsStore.js.map +1 -1
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.js.map +1 -1
- package/dist/utils/randomSessionName.js +55 -0
- package/dist/utils/randomSessionName.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
2
|
import { ConnectionLogPanel as t } from "../agents/ConnectionLogPanel.js";
|
|
3
3
|
import { TerminalIframe as n } from "./TerminalIframe.js";
|
|
4
|
-
import { useCallback as r, useEffect as i,
|
|
5
|
-
import { AlertCircle as ee, ChevronDown as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
4
|
+
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { AlertCircle as ee, ChevronDown as c, ChevronUp as te, Edit3 as ne, Expand as re, ExternalLink as ie, GripVertical as ae, Info as oe, Loader2 as l, Maximize2 as se, Minimize2 as ce, MonitorSmartphone as le, Pin as ue, PinOff as de, Plus as u, RotateCcw as d, ScrollText as fe, Search as pe, Server as me, Share2 as he, Shrink as ge, Square as f, Terminal as p, Wifi as _e, WifiOff as ve, X as m } from "lucide-react";
|
|
6
|
+
import { Fragment as ye, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as be } from "react-dom";
|
|
8
8
|
//#region src/components/sessions/TerminalPanel.tsx
|
|
9
|
-
function
|
|
9
|
+
function xe({ tab: e, index: t, isActive: n, isDragging: r, statusIndicator: i, isRenaming: a, renameValue: o, renameInputRef: s, onRenameChange: ee, onRenameBlur: c, onRenameKeyDown: te, onSelect: ne, onClose: re, onContextMenu: ie, onDoubleClick: ae, onDragStart: oe, onDragOver: l, onDrop: se, onDragEnd: ce, closeLabel: de }) {
|
|
10
10
|
let u = [
|
|
11
11
|
e.name,
|
|
12
12
|
e.agentName ? `agent: ${e.agentName}` : null,
|
|
@@ -18,22 +18,22 @@ function be({ tab: e, index: t, isActive: n, isDragging: r, statusIndicator: i,
|
|
|
18
18
|
draggable: !a,
|
|
19
19
|
title: u,
|
|
20
20
|
onKeyDown: (e) => {
|
|
21
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
21
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), ne());
|
|
22
22
|
},
|
|
23
|
-
onDragStart:
|
|
24
|
-
onDragOver:
|
|
25
|
-
onDrop:
|
|
26
|
-
onDragEnd:
|
|
23
|
+
onDragStart: oe,
|
|
24
|
+
onDragOver: l,
|
|
25
|
+
onDrop: se,
|
|
26
|
+
onDragEnd: ce,
|
|
27
27
|
"data-testid": "terminal-tab",
|
|
28
28
|
"data-session-id": e.sessionId,
|
|
29
29
|
"data-tab-index": t,
|
|
30
30
|
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-[200px] group ${n ? "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"} ${r ? "opacity-50" : ""}`,
|
|
31
|
-
onClick:
|
|
31
|
+
onClick: ne,
|
|
32
32
|
onAuxClick: (e) => {
|
|
33
|
-
e.button === 1 && (e.preventDefault(),
|
|
33
|
+
e.button === 1 && (e.preventDefault(), re());
|
|
34
34
|
},
|
|
35
|
-
onContextMenu:
|
|
36
|
-
onDoubleClick:
|
|
35
|
+
onContextMenu: ie,
|
|
36
|
+
onDoubleClick: ae,
|
|
37
37
|
children: [
|
|
38
38
|
e.pinned && /* @__PURE__ */ h(ue, {
|
|
39
39
|
className: "size-2.5 text-action-primary-text shrink-0",
|
|
@@ -42,11 +42,11 @@ function be({ tab: e, index: t, isActive: n, isDragging: r, statusIndicator: i,
|
|
|
42
42
|
i,
|
|
43
43
|
a ? /* @__PURE__ */ h("input", {
|
|
44
44
|
"aria-label": "control",
|
|
45
|
-
ref:
|
|
45
|
+
ref: s,
|
|
46
46
|
value: o,
|
|
47
|
-
onChange: (e) =>
|
|
48
|
-
onBlur:
|
|
49
|
-
onKeyDown:
|
|
47
|
+
onChange: (e) => ee(e.target.value),
|
|
48
|
+
onBlur: c,
|
|
49
|
+
onKeyDown: te,
|
|
50
50
|
onClick: (e) => e.stopPropagation(),
|
|
51
51
|
className: "bg-bg-sunken border border-border-strong rounded px-1 py-0 text-xs text-text-primary w-[100px] outline-none"
|
|
52
52
|
}) : /* @__PURE__ */ h("span", {
|
|
@@ -60,38 +60,44 @@ function be({ tab: e, index: t, isActive: n, isDragging: r, statusIndicator: i,
|
|
|
60
60
|
/* @__PURE__ */ h("button", {
|
|
61
61
|
type: "button",
|
|
62
62
|
onClick: (e) => {
|
|
63
|
-
e.stopPropagation(),
|
|
63
|
+
e.stopPropagation(), re();
|
|
64
64
|
},
|
|
65
65
|
className: `ml-auto hover:text-status-error-text transition-opacity shrink-0 ${e.pinned, "opacity-0 group-hover:opacity-100"}`,
|
|
66
|
-
title:
|
|
67
|
-
"aria-label":
|
|
66
|
+
title: de,
|
|
67
|
+
"aria-label": de,
|
|
68
68
|
children: /* @__PURE__ */ h(m, { className: "size-3" })
|
|
69
69
|
})
|
|
70
70
|
]
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
function _({ tabs: _, activeTabId:
|
|
74
|
-
let
|
|
73
|
+
function _({ tabs: _, activeTabId: Se, onTabSelect: Ce, onTabClose: v, onOpenExternal: we, onToggleCollapse: Te, collapsed: y = !1, heightClass: Ee = "h-[420px]", sessions: b, onOpenTerminal: De, onRetryTerminal: x, onRenameSession: Oe, onStopTerminal: ke, onRestartTerminal: S, onReattachTerminal: Ae, onReorderTabs: je, onTogglePin: Me, onShowSessionInfo: Ne, onViewAgent: Pe, onViewTarget: Fe, onShareSession: Ie, onStopSession: C, onCreateSession: w, onQuickCreate: T, renameActiveTabNonce: E, fullScreen: D = !1, isImmersiveFullscreen: O = !1, onToggleImmersiveFullscreen: k, contextSwitcher: Le }) {
|
|
74
|
+
let A = e(), [j, Re] = s(!1), [ze, Be] = s(!1), [M, N] = s(!1), [P, F] = s(""), [I, L] = s({
|
|
75
75
|
visible: !1,
|
|
76
76
|
x: 0,
|
|
77
77
|
y: 0,
|
|
78
78
|
sessionId: null
|
|
79
|
-
}), [
|
|
80
|
-
|
|
79
|
+
}), [R, Ve] = s(null), [z, He] = s(""), [B, Ue] = s(() => /* @__PURE__ */ new Set()), [V, We] = s({}), [Ge, Ke] = s({}), [qe, Je] = s(null), Ye = o(!1), Xe = o(0), Ze = o(0), Qe = o(null), $e = o(null), et = o(null), H = o(null), tt = o(null), nt = o(null), rt = o({}), U = o({}), W = o({}), G = o({}), [it, at] = s({}), ot = o({}), [K, st] = s(null), ct = r((e) => {
|
|
80
|
+
at((t) => ({
|
|
81
81
|
...t,
|
|
82
82
|
[e]: (t[e] ?? 0) + 1
|
|
83
83
|
}));
|
|
84
|
-
}, []),
|
|
85
|
-
let t =
|
|
84
|
+
}, []), lt = [..._].sort((e, t) => !!t.pinned - +!!e.pinned).map((e) => {
|
|
85
|
+
let t = b?.find((t) => t.id === e.sessionId);
|
|
86
86
|
return {
|
|
87
87
|
...e,
|
|
88
88
|
agentName: e.agentName ?? t?.agent?.name ?? null,
|
|
89
89
|
targetName: e.targetName ?? t?.agent?.target?.name ?? null,
|
|
90
90
|
targetType: e.targetType ?? t?.agent?.target?.type ?? null
|
|
91
91
|
};
|
|
92
|
-
}), q = _.find((e) => e.sessionId ===
|
|
92
|
+
}), q = _.find((e) => e.sessionId === Se) || _[0] || null, ut = a(() => {
|
|
93
|
+
let e = /* @__PURE__ */ new Map();
|
|
94
|
+
return (b ?? []).forEach((t) => e.set(t.id, t.status)), e;
|
|
95
|
+
}, [b]), J = r((e) => {
|
|
96
|
+
let t = ut.get(e);
|
|
97
|
+
return t === "STOPPED" || t === "TERMINATED" || t === "ERROR";
|
|
98
|
+
}, [ut]), dt = r((e) => {
|
|
93
99
|
if (C) {
|
|
94
|
-
|
|
100
|
+
Ue((t) => {
|
|
95
101
|
if (t.has(e)) return t;
|
|
96
102
|
let n = new Set(t);
|
|
97
103
|
return n.add(e), n;
|
|
@@ -99,14 +105,14 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
99
105
|
try {
|
|
100
106
|
C(e);
|
|
101
107
|
} catch {
|
|
102
|
-
|
|
108
|
+
Ue((t) => {
|
|
103
109
|
if (!t.has(e)) return t;
|
|
104
110
|
let n = new Set(t);
|
|
105
111
|
return n.delete(e), n;
|
|
106
112
|
});
|
|
107
113
|
}
|
|
108
114
|
window.setTimeout(() => {
|
|
109
|
-
|
|
115
|
+
Ue((t) => {
|
|
110
116
|
if (!t.has(e)) return t;
|
|
111
117
|
let n = new Set(t);
|
|
112
118
|
return n.delete(e), n;
|
|
@@ -115,92 +121,96 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
115
121
|
}
|
|
116
122
|
}, [C]);
|
|
117
123
|
i(() => {
|
|
118
|
-
if (!
|
|
119
|
-
let e = new Set(
|
|
120
|
-
|
|
124
|
+
if (!b || B.size === 0) return;
|
|
125
|
+
let e = new Set(b.filter((e) => e.status === "STOPPED" || e.status === "TERMINATED" || e.status === "ERROR").map((e) => e.id)), t = !1, n = new Set(B);
|
|
126
|
+
B.forEach((r) => {
|
|
121
127
|
e.has(r) && (n.delete(r), t = !0);
|
|
122
|
-
}), t &&
|
|
123
|
-
}, [
|
|
124
|
-
let
|
|
125
|
-
|
|
128
|
+
}), t && Ue(n);
|
|
129
|
+
}, [b, B]);
|
|
130
|
+
let Y = r((e, t) => {
|
|
131
|
+
We((n) => n[e] === t ? n : {
|
|
126
132
|
...n,
|
|
127
133
|
[e]: t
|
|
128
134
|
});
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
135
|
+
}, []), ft = r((e, t) => {
|
|
136
|
+
Ke((n) => n[e] === t ? n : {
|
|
131
137
|
...n,
|
|
132
138
|
[e]: t
|
|
133
139
|
});
|
|
134
|
-
}, []),
|
|
140
|
+
}, []), pt = r((e) => {
|
|
135
141
|
if (!e) return null;
|
|
136
142
|
try {
|
|
137
143
|
let t = typeof window < "u" ? window.location.protocol : "https:", n = new URL(e).protocol;
|
|
138
|
-
return t === "https:" && n !== "https:" ?
|
|
144
|
+
return t === "https:" && n !== "https:" ? A("vibecontrols.sessions.terminal.mixedContentBlocked", "This terminal URL is not HTTPS, so the browser blocked it on this secure page.") : null;
|
|
139
145
|
} catch {
|
|
140
|
-
return
|
|
146
|
+
return A("vibecontrols.sessions.terminal.invalidUrl", "The terminal URL is invalid. Restart the terminal to generate a new URL.");
|
|
141
147
|
}
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, []),
|
|
145
|
-
G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]),
|
|
146
|
-
}, [
|
|
147
|
-
G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]),
|
|
148
|
-
}, [
|
|
148
|
+
}, [A]), mt = r(() => {
|
|
149
|
+
Re((e) => !e), Je(null);
|
|
150
|
+
}, []), X = (b ?? []).filter((e) => !_.some((t) => t.sessionId === e.id)), ht = P.trim() ? X.filter((e) => e.name.toLowerCase().includes(P.trim().toLowerCase())) : X, gt = r((e) => {
|
|
151
|
+
G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]), Y(e, "connected"), ft(e, void 0);
|
|
152
|
+
}, [ft, Y]), _t = r((e) => {
|
|
153
|
+
G.current[e] && (clearTimeout(G.current[e]), delete G.current[e]), Y(e, "error");
|
|
154
|
+
}, [Y]);
|
|
149
155
|
i(() => (_.forEach((e) => {
|
|
150
156
|
if (!e.terminalUrl || e.loading || e.error) return;
|
|
151
|
-
let t =
|
|
157
|
+
let t = pt(e.terminalUrl);
|
|
152
158
|
if (t) {
|
|
153
|
-
|
|
159
|
+
Y(e.sessionId, "error"), ft(e.sessionId, t);
|
|
154
160
|
return;
|
|
155
161
|
}
|
|
156
|
-
|
|
157
|
-
delete G.current[e.sessionId],
|
|
162
|
+
V[e.sessionId] || Y(e.sessionId, "connecting"), V[e.sessionId] === "connecting" && !G.current[e.sessionId] && (G.current[e.sessionId] = setTimeout(() => {
|
|
163
|
+
delete G.current[e.sessionId], Y(e.sessionId, "error"), ft(e.sessionId, A("vibecontrols.sessions.terminal.connectionTimedOut", "Timed out waiting for the terminal to connect. Check the agent tunnel and retry."));
|
|
158
164
|
}, 12e3));
|
|
159
165
|
}), () => {
|
|
160
166
|
for (let e of Object.values(G.current)) clearTimeout(e);
|
|
161
167
|
G.current = {};
|
|
162
168
|
}), [
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
V,
|
|
170
|
+
pt,
|
|
171
|
+
ft,
|
|
165
172
|
Y,
|
|
166
|
-
J,
|
|
167
173
|
_,
|
|
168
|
-
|
|
174
|
+
A
|
|
169
175
|
]);
|
|
170
|
-
let
|
|
176
|
+
let vt = r((e) => {
|
|
171
177
|
U.current[e] && (clearTimeout(U.current[e]), delete U.current[e]), delete W.current[e];
|
|
172
|
-
}, []),
|
|
173
|
-
|
|
178
|
+
}, []), Z = r((e) => {
|
|
179
|
+
vt(e), ot.current[e] = 0, Ke((t) => ({
|
|
174
180
|
...t,
|
|
175
181
|
[e]: void 0
|
|
176
|
-
})),
|
|
182
|
+
})), We((t) => ({
|
|
177
183
|
...t,
|
|
178
184
|
[e]: "connecting"
|
|
179
|
-
})),
|
|
185
|
+
})), ct(e), Ae?.(e);
|
|
180
186
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
vt,
|
|
188
|
+
ct,
|
|
183
189
|
Ae
|
|
184
|
-
]),
|
|
185
|
-
|
|
186
|
-
}, []),
|
|
190
|
+
]), yt = r((e, t) => {
|
|
191
|
+
st(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(t));
|
|
192
|
+
}, []), bt = r((e) => {
|
|
187
193
|
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
188
|
-
}, []),
|
|
194
|
+
}, []), xt = r((e, t) => {
|
|
189
195
|
if (e.preventDefault(), K === null || K === t || !je) {
|
|
190
|
-
|
|
196
|
+
st(null);
|
|
191
197
|
return;
|
|
192
198
|
}
|
|
193
|
-
let n = [...
|
|
194
|
-
n.splice(t, 0, r), je(n.map((e) => e.sessionId)),
|
|
199
|
+
let n = [...lt], [r] = n.splice(K, 1);
|
|
200
|
+
n.splice(t, 0, r), je(n.map((e) => e.sessionId)), st(null);
|
|
195
201
|
}, [
|
|
196
202
|
K,
|
|
197
|
-
|
|
203
|
+
lt,
|
|
198
204
|
je
|
|
199
|
-
]),
|
|
205
|
+
]), St = r(() => st(null), []);
|
|
200
206
|
i(() => {
|
|
201
207
|
for (let e of _) {
|
|
202
|
-
let t =
|
|
203
|
-
if (
|
|
208
|
+
let t = V[e.sessionId];
|
|
209
|
+
if (J(e.sessionId)) {
|
|
210
|
+
vt(e.sessionId);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (t === "error" && e.terminalUrl && !e.error && !Ge[e.sessionId]) {
|
|
204
214
|
if (U.current[e.sessionId]) continue;
|
|
205
215
|
let t = W.current[e.sessionId] ?? 0;
|
|
206
216
|
if (t >= 15) continue;
|
|
@@ -209,14 +219,14 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
209
219
|
delete U.current[e.sessionId], W.current[e.sessionId] = t + 1;
|
|
210
220
|
let n = e.terminalUrl, r = `${new URL(n).origin}/health`;
|
|
211
221
|
fetch(r, { signal: AbortSignal.timeout(5e3) }).then((t) => {
|
|
212
|
-
t.ok && (
|
|
222
|
+
t.ok && (We((t) => ({
|
|
213
223
|
...t,
|
|
214
224
|
[e.sessionId]: "connecting"
|
|
215
|
-
})),
|
|
225
|
+
})), ct(e.sessionId));
|
|
216
226
|
}).catch(() => {});
|
|
217
227
|
}, n);
|
|
218
228
|
}
|
|
219
|
-
t === "connected" &&
|
|
229
|
+
t === "connected" && vt(e.sessionId);
|
|
220
230
|
}
|
|
221
231
|
let e = U.current;
|
|
222
232
|
return () => {
|
|
@@ -224,12 +234,13 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
224
234
|
};
|
|
225
235
|
}, [
|
|
226
236
|
_,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
Ge,
|
|
238
|
+
V,
|
|
239
|
+
vt,
|
|
240
|
+
ct,
|
|
241
|
+
J
|
|
231
242
|
]), i(() => {
|
|
232
|
-
if (!q || !q.terminalUrl || q.loading || q.error ||
|
|
243
|
+
if (!q || !q.terminalUrl || q.loading || q.error || V[q.sessionId] !== "connected" || J(q.sessionId)) return;
|
|
233
244
|
let e;
|
|
234
245
|
try {
|
|
235
246
|
e = new URL(q.terminalUrl).origin;
|
|
@@ -238,36 +249,37 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
238
249
|
}
|
|
239
250
|
let t = q.sessionId, n = setInterval(() => {
|
|
240
251
|
fetch(`${e}/health`, { signal: AbortSignal.timeout(5e3) }).then((e) => {
|
|
241
|
-
if (e.ok)
|
|
252
|
+
if (e.ok) ot.current[t] = 0;
|
|
242
253
|
else throw Error("unhealthy");
|
|
243
254
|
}).catch(() => {
|
|
244
|
-
let e = (
|
|
245
|
-
|
|
255
|
+
let e = (ot.current[t] ?? 0) + 1;
|
|
256
|
+
ot.current[t] = e, e >= 2 && Y(t, "error");
|
|
246
257
|
});
|
|
247
258
|
}, 2e4);
|
|
248
259
|
return () => clearInterval(n);
|
|
249
260
|
}, [
|
|
250
261
|
q,
|
|
251
|
-
|
|
262
|
+
V,
|
|
263
|
+
Y,
|
|
252
264
|
J
|
|
253
265
|
]);
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
}, [
|
|
266
|
+
let Ct = r((e) => {
|
|
267
|
+
D || j || (e.preventDefault(), Ye.current = !0, Xe.current = e.clientY, Ze.current = Qe.current?.offsetHeight || 420, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none");
|
|
268
|
+
}, [D, j]);
|
|
257
269
|
i(() => {
|
|
258
270
|
let e = (e) => {
|
|
259
|
-
if (!
|
|
260
|
-
let t =
|
|
261
|
-
|
|
271
|
+
if (!Ye.current) return;
|
|
272
|
+
let t = Xe.current - e.clientY;
|
|
273
|
+
Je(Math.max(200, Math.min(Ze.current + t, window.innerHeight - 150)));
|
|
262
274
|
}, t = () => {
|
|
263
|
-
|
|
275
|
+
Ye.current && (Ye.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
264
276
|
};
|
|
265
277
|
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
|
|
266
278
|
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
|
|
267
279
|
};
|
|
268
280
|
}, []);
|
|
269
|
-
let
|
|
270
|
-
e.preventDefault(), e.stopPropagation(),
|
|
281
|
+
let wt = r((e, t) => {
|
|
282
|
+
e.preventDefault(), e.stopPropagation(), L({
|
|
271
283
|
visible: !0,
|
|
272
284
|
x: e.clientX,
|
|
273
285
|
y: e.clientY,
|
|
@@ -276,148 +288,154 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
276
288
|
}, []);
|
|
277
289
|
i(() => {
|
|
278
290
|
let e = (e) => {
|
|
279
|
-
|
|
291
|
+
et.current && !et.current.contains(e.target) && L((e) => ({
|
|
280
292
|
...e,
|
|
281
293
|
visible: !1
|
|
282
294
|
}));
|
|
283
295
|
};
|
|
284
|
-
if (
|
|
285
|
-
}, [
|
|
296
|
+
if (I.visible) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
297
|
+
}, [I.visible]), i(() => {
|
|
286
298
|
let e = (e) => {
|
|
287
299
|
let t = e.target;
|
|
288
|
-
|
|
300
|
+
tt.current && !tt.current.contains(t) && H.current && !H.current.contains(t) && (N(!1), F(""));
|
|
289
301
|
};
|
|
290
|
-
if (
|
|
291
|
-
}, [
|
|
292
|
-
|
|
293
|
-
}, [
|
|
294
|
-
|
|
295
|
-
}, [
|
|
296
|
-
if (!
|
|
302
|
+
if (M) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
303
|
+
}, [M]), i(() => {
|
|
304
|
+
M && nt.current && requestAnimationFrame(() => nt.current?.focus());
|
|
305
|
+
}, [M]), i(() => {
|
|
306
|
+
R && $e.current && ($e.current.focus(), $e.current.select());
|
|
307
|
+
}, [R]), i(() => {
|
|
308
|
+
if (!O || !k) return;
|
|
297
309
|
let e = (e) => {
|
|
298
|
-
e.key === "Escape" &&
|
|
310
|
+
e.key === "Escape" && k();
|
|
299
311
|
};
|
|
300
312
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
301
|
-
}, [
|
|
302
|
-
let
|
|
313
|
+
}, [O, k]);
|
|
314
|
+
let Q = r((e) => {
|
|
303
315
|
let t = _.find((t) => t.sessionId === e);
|
|
304
|
-
t && (
|
|
316
|
+
t && (Ve(e), He(t.name)), L((e) => ({
|
|
305
317
|
...e,
|
|
306
318
|
visible: !1
|
|
307
319
|
}));
|
|
308
|
-
}, [_]),
|
|
309
|
-
if (
|
|
310
|
-
let e = _.find((e) => e.sessionId ===
|
|
311
|
-
e &&
|
|
320
|
+
}, [_]), Tt = r(() => {
|
|
321
|
+
if (R && z.trim() && Oe) {
|
|
322
|
+
let e = _.find((e) => e.sessionId === R);
|
|
323
|
+
e && z.trim() !== e.name && Oe(R, z.trim());
|
|
312
324
|
}
|
|
313
|
-
|
|
325
|
+
Ve(null), He("");
|
|
314
326
|
}, [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
R,
|
|
328
|
+
z,
|
|
329
|
+
Oe,
|
|
318
330
|
_
|
|
319
|
-
]),
|
|
320
|
-
e.key === "Enter" ?
|
|
321
|
-
}, [
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
331
|
+
]), Et = r((e) => {
|
|
332
|
+
e.key === "Enter" ? Tt() : e.key === "Escape" && (Ve(null), He(""));
|
|
333
|
+
}, [Tt]), Dt = o(E ?? 0);
|
|
334
|
+
if (i(() => {
|
|
335
|
+
E !== void 0 && E !== Dt.current && (Dt.current = E, q && Q(q.sessionId));
|
|
336
|
+
}, [
|
|
337
|
+
E,
|
|
338
|
+
q,
|
|
339
|
+
Q
|
|
340
|
+
]), _.length === 0 && !y && !D) return null;
|
|
341
|
+
let Ot = D ? "h-full" : j ? "h-[calc(100vh-120px)]" : qe ? void 0 : Ee, kt = !D && !j && qe ? { height: `${qe}px` } : void 0, $ = I.sessionId ? _.find((e) => e.sessionId === I.sessionId) : null, At = I.sessionId ? b?.find((e) => e.id === I.sessionId) ?? null : null, jt = (e) => /* @__PURE__ */ g(ye, { children: [
|
|
342
|
+
Ne && /* @__PURE__ */ g("button", {
|
|
325
343
|
type: "button",
|
|
326
344
|
onClick: () => {
|
|
327
|
-
|
|
345
|
+
Ne(e), L((e) => ({
|
|
328
346
|
...e,
|
|
329
347
|
visible: !1
|
|
330
348
|
}));
|
|
331
349
|
},
|
|
332
350
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
333
|
-
children: [/* @__PURE__ */ h(oe, { className: "size-3.5" }),
|
|
351
|
+
children: [/* @__PURE__ */ h(oe, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.sessionInfo", "Session info")]
|
|
334
352
|
}),
|
|
335
|
-
|
|
353
|
+
Pe && At?.agent && /* @__PURE__ */ g("button", {
|
|
336
354
|
type: "button",
|
|
337
355
|
onClick: () => {
|
|
338
|
-
|
|
356
|
+
Pe(e), L((e) => ({
|
|
339
357
|
...e,
|
|
340
358
|
visible: !1
|
|
341
359
|
}));
|
|
342
360
|
},
|
|
343
361
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
344
|
-
children: [/* @__PURE__ */ h(
|
|
362
|
+
children: [/* @__PURE__ */ h(me, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.viewAgent", "View agent")]
|
|
345
363
|
}),
|
|
346
|
-
|
|
364
|
+
Fe && At?.agent?.target && /* @__PURE__ */ g("button", {
|
|
347
365
|
type: "button",
|
|
348
366
|
onClick: () => {
|
|
349
|
-
|
|
367
|
+
Fe(e), L((e) => ({
|
|
350
368
|
...e,
|
|
351
369
|
visible: !1
|
|
352
370
|
}));
|
|
353
371
|
},
|
|
354
372
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
355
|
-
children: [/* @__PURE__ */ h(le, { className: "size-3.5" }),
|
|
373
|
+
children: [/* @__PURE__ */ h(le, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.viewTarget", "View target")]
|
|
356
374
|
}),
|
|
357
|
-
|
|
375
|
+
Ie && /* @__PURE__ */ g("button", {
|
|
358
376
|
type: "button",
|
|
359
377
|
onClick: () => {
|
|
360
|
-
|
|
378
|
+
Ie(e), L((e) => ({
|
|
361
379
|
...e,
|
|
362
380
|
visible: !1
|
|
363
381
|
}));
|
|
364
382
|
},
|
|
365
383
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
366
|
-
children: [/* @__PURE__ */ h(
|
|
384
|
+
children: [/* @__PURE__ */ h(he, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.shareSession", "Share / offer session")]
|
|
367
385
|
}),
|
|
368
|
-
(
|
|
369
|
-
] }),
|
|
370
|
-
if (e.loading) return /* @__PURE__ */ h(
|
|
386
|
+
(Ne || Pe || Fe || Ie) && /* @__PURE__ */ h("div", { className: "border-t border-border-subtle my-1" })
|
|
387
|
+
] }), Mt = (e) => {
|
|
388
|
+
if (e.loading) return /* @__PURE__ */ h(l, { className: "size-3 animate-spin shrink-0" });
|
|
371
389
|
if (e.error) return /* @__PURE__ */ h(ee, { className: "size-3 text-status-error-text shrink-0" });
|
|
372
|
-
let t =
|
|
373
|
-
return t === "connected" ? /* @__PURE__ */ h(
|
|
390
|
+
let t = V[e.sessionId];
|
|
391
|
+
return t === "connected" ? /* @__PURE__ */ h(_e, { className: "size-3 text-status-success-text shrink-0" }) : t === "error" ? /* @__PURE__ */ h(ve, { className: "size-3 text-status-error-text shrink-0" }) : t === "connecting" ? /* @__PURE__ */ h(l, { className: "size-3 animate-spin text-status-warning-text shrink-0" }) : /* @__PURE__ */ h(p, { className: "size-3 shrink-0" });
|
|
374
392
|
};
|
|
375
|
-
return
|
|
393
|
+
return O ? O ? be(/* @__PURE__ */ g("div", {
|
|
376
394
|
className: "fixed inset-0 z-[9999] bg-bg-surface flex flex-col",
|
|
377
395
|
children: [
|
|
378
396
|
/* @__PURE__ */ g("div", {
|
|
379
397
|
className: "flex items-center justify-between px-3 py-2 bg-bg-sunken border-b border-border-default shrink-0",
|
|
380
398
|
children: [/* @__PURE__ */ h("div", {
|
|
381
399
|
className: "flex items-center gap-4",
|
|
382
|
-
children:
|
|
400
|
+
children: Le
|
|
383
401
|
}), /* @__PURE__ */ g("div", {
|
|
384
402
|
className: "flex items-center gap-2",
|
|
385
403
|
children: [
|
|
386
404
|
q?.terminalUrl && /* @__PURE__ */ h("button", {
|
|
387
405
|
type: "button",
|
|
388
|
-
onClick: () =>
|
|
389
|
-
className: `p-1.5 transition-colors ${
|
|
390
|
-
title:
|
|
391
|
-
"aria-label":
|
|
406
|
+
onClick: () => Z(q.sessionId),
|
|
407
|
+
className: `p-1.5 transition-colors ${V[q.sessionId] === "error" ? "text-status-warning-text hover:text-status-warning-text/80" : "text-text-secondary hover:text-text-primary"}`,
|
|
408
|
+
title: A("vibecontrols.sessions.terminal.reconnect", "Reconnect"),
|
|
409
|
+
"aria-label": A("vibecontrols.sessions.terminal.reconnect", "Reconnect"),
|
|
392
410
|
"data-testid": "terminal-reconnect",
|
|
393
|
-
children: /* @__PURE__ */ h(
|
|
411
|
+
children: /* @__PURE__ */ h(d, { className: "size-4" })
|
|
394
412
|
}),
|
|
395
413
|
q?.terminalUrl && /* @__PURE__ */ h("button", {
|
|
396
414
|
type: "button",
|
|
397
415
|
onClick: () => q && we(q.sessionId),
|
|
398
416
|
className: "p-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
399
|
-
title: "Open in new tab",
|
|
400
|
-
children: /* @__PURE__ */ h(
|
|
417
|
+
title: A("vibecontrols.sessions.terminal.openInNewTabShortcut", "Open in new tab (⌘/Ctrl+O)"),
|
|
418
|
+
children: /* @__PURE__ */ h(ie, { className: "size-4" })
|
|
401
419
|
}),
|
|
402
420
|
q && C && /* @__PURE__ */ g("button", {
|
|
403
421
|
type: "button",
|
|
404
|
-
onClick: () =>
|
|
405
|
-
disabled:
|
|
422
|
+
onClick: () => dt(q.sessionId),
|
|
423
|
+
disabled: B.has(q.sessionId),
|
|
406
424
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md border border-status-error-bg/40 bg-status-error-bg/10 text-status-error-text hover:bg-status-error-bg/20 hover:border-status-error-bg/60 active:scale-95 transition-all disabled:opacity-60 disabled:cursor-not-allowed",
|
|
407
|
-
title:
|
|
408
|
-
"aria-label":
|
|
409
|
-
"aria-busy":
|
|
410
|
-
children: [
|
|
425
|
+
title: A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
426
|
+
"aria-label": A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
427
|
+
"aria-busy": B.has(q.sessionId),
|
|
428
|
+
children: [B.has(q.sessionId) ? /* @__PURE__ */ h(l, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ h(f, { className: "size-3.5 fill-current" }), /* @__PURE__ */ h("span", {
|
|
411
429
|
className: "text-xs font-medium",
|
|
412
|
-
children:
|
|
430
|
+
children: B.has(q.sessionId) ? A("vibecontrols.sessions.terminal.stoppingSession", "Stopping…") : A("vibecontrols.sessions.terminal.stopSession", "Stop")
|
|
413
431
|
})]
|
|
414
432
|
}),
|
|
415
433
|
/* @__PURE__ */ h("button", {
|
|
416
434
|
type: "button",
|
|
417
|
-
onClick:
|
|
435
|
+
onClick: k,
|
|
418
436
|
className: "p-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
419
437
|
title: "Exit fullscreen (ESC)",
|
|
420
|
-
children: /* @__PURE__ */ h(
|
|
438
|
+
children: /* @__PURE__ */ h(ge, { className: "size-4" })
|
|
421
439
|
})
|
|
422
440
|
]
|
|
423
441
|
})]
|
|
@@ -426,49 +444,64 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
426
444
|
className: "flex items-center bg-bg-sunken border-b border-border-default shrink-0",
|
|
427
445
|
children: [/* @__PURE__ */ h("div", {
|
|
428
446
|
className: "flex items-center overflow-x-auto flex-1 min-w-0",
|
|
429
|
-
children:
|
|
447
|
+
children: lt.map((e, t) => /* @__PURE__ */ h(xe, {
|
|
430
448
|
tab: e,
|
|
431
449
|
index: t,
|
|
432
450
|
isActive: e.sessionId === q?.sessionId,
|
|
433
451
|
isDragging: K === t,
|
|
434
|
-
statusIndicator:
|
|
435
|
-
isRenaming:
|
|
436
|
-
renameValue:
|
|
437
|
-
renameInputRef:
|
|
438
|
-
onRenameChange:
|
|
439
|
-
onRenameBlur:
|
|
440
|
-
onRenameKeyDown:
|
|
441
|
-
onSelect: () =>
|
|
442
|
-
onClose: () =>
|
|
443
|
-
onContextMenu: (t) =>
|
|
444
|
-
onDoubleClick: () =>
|
|
445
|
-
onDragStart: (e) =>
|
|
446
|
-
onDragOver:
|
|
447
|
-
onDrop: (e) =>
|
|
448
|
-
onDragEnd:
|
|
449
|
-
closeLabel:
|
|
452
|
+
statusIndicator: Mt(e),
|
|
453
|
+
isRenaming: R === e.sessionId,
|
|
454
|
+
renameValue: z,
|
|
455
|
+
renameInputRef: $e,
|
|
456
|
+
onRenameChange: He,
|
|
457
|
+
onRenameBlur: Tt,
|
|
458
|
+
onRenameKeyDown: Et,
|
|
459
|
+
onSelect: () => Ce(e.sessionId),
|
|
460
|
+
onClose: () => v(e.sessionId),
|
|
461
|
+
onContextMenu: (t) => wt(t, e.sessionId),
|
|
462
|
+
onDoubleClick: () => Q(e.sessionId),
|
|
463
|
+
onDragStart: (e) => yt(e, t),
|
|
464
|
+
onDragOver: bt,
|
|
465
|
+
onDrop: (e) => xt(e, t),
|
|
466
|
+
onDragEnd: St,
|
|
467
|
+
closeLabel: A("vibecontrols.sessions.terminal.closeTab", "Close terminal")
|
|
450
468
|
}, e.sessionId))
|
|
451
|
-
}), /* @__PURE__ */
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
469
|
+
}), /* @__PURE__ */ g("div", {
|
|
470
|
+
className: "flex items-center shrink-0 border-r border-border-subtle",
|
|
471
|
+
children: [/* @__PURE__ */ h("button", {
|
|
472
|
+
type: "button",
|
|
473
|
+
onClick: () => {
|
|
474
|
+
T ? T() : (w || X.length > 0) && (N((e) => !e), F(""));
|
|
475
|
+
},
|
|
476
|
+
className: "flex items-center pl-2.5 pr-1.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
477
|
+
title: T ? A("vibecontrols.sessions.terminal.quickNewSession", "New terminal (⌘/Ctrl+T)") : A("vibecontrols.sessions.terminal.newOrOpen", "New session or open existing"),
|
|
478
|
+
"data-testid": "terminal-quick-create",
|
|
479
|
+
children: /* @__PURE__ */ h(u, { className: "size-3.5" })
|
|
480
|
+
}), /* @__PURE__ */ h("button", {
|
|
481
|
+
type: "button",
|
|
482
|
+
ref: H,
|
|
483
|
+
onClick: () => {
|
|
484
|
+
N((e) => !e), F("");
|
|
485
|
+
},
|
|
486
|
+
className: "flex items-center pr-2 pl-0.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
487
|
+
title: A("vibecontrols.sessions.terminal.moreSessionOptions", "New session with options / open existing"),
|
|
488
|
+
"aria-haspopup": "menu",
|
|
489
|
+
"aria-expanded": M,
|
|
490
|
+
"data-testid": "terminal-session-menu",
|
|
491
|
+
children: /* @__PURE__ */ h(c, { className: "size-3" })
|
|
492
|
+
})]
|
|
460
493
|
})]
|
|
461
494
|
}),
|
|
462
495
|
/* @__PURE__ */ h("div", {
|
|
463
496
|
className: "flex-1 bg-bg-sunken text-text-primary relative overflow-hidden",
|
|
464
497
|
children: q ? _.map((e) => {
|
|
465
|
-
let t =
|
|
498
|
+
let t = V[e.sessionId], r = t === "connecting" || e.loading, i = pt(e.terminalUrl), a = i ?? Ge[e.sessionId], o = !!e.terminalUrl && !e.error && !i, s = J(e.sessionId), c = ut.get(e.sessionId), te = !s && (!!i || o && t === "error");
|
|
466
499
|
return /* @__PURE__ */ g("div", {
|
|
467
500
|
className: `absolute inset-0 ${e.sessionId === q.sessionId ? "block" : "hidden"}`,
|
|
468
501
|
children: [
|
|
469
502
|
o && e.terminalUrl && /* @__PURE__ */ h(n, {
|
|
470
503
|
ref: (t) => {
|
|
471
|
-
|
|
504
|
+
rt.current[e.sessionId] = t;
|
|
472
505
|
},
|
|
473
506
|
sessionId: e.sessionId,
|
|
474
507
|
agentId: e.agentId ?? null,
|
|
@@ -477,19 +510,19 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
477
510
|
title: `Terminal - ${e.name}`,
|
|
478
511
|
className: "w-full h-full border-0",
|
|
479
512
|
allow: "clipboard-read *; clipboard-write *",
|
|
480
|
-
onLoad: () =>
|
|
481
|
-
onError: () =>
|
|
482
|
-
}, `tif-${e.sessionId}-${
|
|
483
|
-
o && r && /* @__PURE__ */ h("div", {
|
|
513
|
+
onLoad: () => gt(e.sessionId),
|
|
514
|
+
onError: () => _t(e.sessionId)
|
|
515
|
+
}, `tif-${e.sessionId}-${it[e.sessionId] ?? 0}`),
|
|
516
|
+
o && r && !s && /* @__PURE__ */ h("div", {
|
|
484
517
|
className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center pointer-events-none z-10",
|
|
485
518
|
children: /* @__PURE__ */ g("div", {
|
|
486
519
|
className: "flex items-center gap-3 px-4 py-3 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
487
|
-
children: [/* @__PURE__ */ h(
|
|
520
|
+
children: [/* @__PURE__ */ h(l, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
488
521
|
className: "text-text-primary text-sm font-medium",
|
|
489
|
-
children: e.loading ?
|
|
522
|
+
children: e.loading ? A("vibecontrols.sessions.terminal.startingTerminal", "Starting terminal...") : A("vibecontrols.sessions.terminal.connecting", "Connecting...")
|
|
490
523
|
}), /* @__PURE__ */ h("p", {
|
|
491
524
|
className: "text-text-secondary text-xs",
|
|
492
|
-
children: e.loading ?
|
|
525
|
+
children: e.loading ? A("vibecontrols.sessions.terminal.settingUpWebTerminal", "Setting up session + web terminal") : A("vibecontrols.sessions.terminal.establishingConnection", "Establishing connection")
|
|
493
526
|
})] })]
|
|
494
527
|
})
|
|
495
528
|
}),
|
|
@@ -498,23 +531,57 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
498
531
|
children: /* @__PURE__ */ g("div", {
|
|
499
532
|
className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
500
533
|
children: [
|
|
501
|
-
/* @__PURE__ */ h(
|
|
534
|
+
/* @__PURE__ */ h(ve, { className: "size-6 text-status-error-text" }),
|
|
502
535
|
/* @__PURE__ */ g("div", {
|
|
503
536
|
className: "text-center",
|
|
504
537
|
children: [/* @__PURE__ */ h("p", {
|
|
505
538
|
className: "text-text-primary text-sm font-medium",
|
|
506
|
-
children:
|
|
539
|
+
children: A("vibecontrols.sessions.terminal.connectionLost", "Connection Lost")
|
|
507
540
|
}), /* @__PURE__ */ h("p", {
|
|
508
541
|
className: "text-text-secondary text-xs mt-1",
|
|
509
|
-
children: a || ((W.current[e.sessionId] ?? 0) < 15 ?
|
|
542
|
+
children: a || ((W.current[e.sessionId] ?? 0) < 15 ? A("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : A("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
|
|
510
543
|
})]
|
|
511
544
|
}),
|
|
512
|
-
!a && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ h(
|
|
545
|
+
!a && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ h(l, { className: "size-4 text-text-tertiary animate-spin" }),
|
|
513
546
|
/* @__PURE__ */ g("button", {
|
|
514
547
|
type: "button",
|
|
515
|
-
onClick: () =>
|
|
548
|
+
onClick: () => Z(e.sessionId),
|
|
516
549
|
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",
|
|
517
|
-
children: [/* @__PURE__ */ h(
|
|
550
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
})
|
|
554
|
+
}),
|
|
555
|
+
s && /* @__PURE__ */ h("div", {
|
|
556
|
+
className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center z-20",
|
|
557
|
+
"data-testid": "terminal-session-stopped",
|
|
558
|
+
children: /* @__PURE__ */ g("div", {
|
|
559
|
+
className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
560
|
+
children: [
|
|
561
|
+
/* @__PURE__ */ h(f, { className: "size-6 text-text-secondary" }),
|
|
562
|
+
/* @__PURE__ */ g("div", {
|
|
563
|
+
className: "text-center",
|
|
564
|
+
children: [/* @__PURE__ */ h("p", {
|
|
565
|
+
className: "text-text-primary text-sm font-medium",
|
|
566
|
+
children: c === "ERROR" ? A("vibecontrols.sessions.terminal.sessionErrored", "Session ended") : A("vibecontrols.sessions.terminal.sessionStopped", "Session stopped")
|
|
567
|
+
}), /* @__PURE__ */ h("p", {
|
|
568
|
+
className: "text-text-secondary text-xs mt-1",
|
|
569
|
+
children: A("vibecontrols.sessions.terminal.sessionStoppedHint", "This terminal is no longer running.")
|
|
570
|
+
})]
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ g("div", {
|
|
573
|
+
className: "flex items-center gap-2",
|
|
574
|
+
children: [S && /* @__PURE__ */ g("button", {
|
|
575
|
+
type: "button",
|
|
576
|
+
onClick: () => S(e.sessionId),
|
|
577
|
+
className: "px-3 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",
|
|
578
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.restartSession", "Restart")]
|
|
579
|
+
}), /* @__PURE__ */ g("button", {
|
|
580
|
+
type: "button",
|
|
581
|
+
onClick: () => v(e.sessionId),
|
|
582
|
+
className: "px-3 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",
|
|
583
|
+
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.closeTab", "Close")]
|
|
584
|
+
})]
|
|
518
585
|
})
|
|
519
586
|
]
|
|
520
587
|
})
|
|
@@ -524,7 +591,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
524
591
|
children: /* @__PURE__ */ g("div", {
|
|
525
592
|
className: "text-center",
|
|
526
593
|
children: [
|
|
527
|
-
/* @__PURE__ */ h(
|
|
594
|
+
/* @__PURE__ */ h(l, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
|
|
528
595
|
/* @__PURE__ */ g("p", {
|
|
529
596
|
className: "text-text-tertiary text-sm",
|
|
530
597
|
children: [
|
|
@@ -548,7 +615,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
548
615
|
/* @__PURE__ */ h(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
|
|
549
616
|
/* @__PURE__ */ h("p", {
|
|
550
617
|
className: "text-status-error-text text-sm font-medium",
|
|
551
|
-
children:
|
|
618
|
+
children: A("vibecontrols.sessions.terminal.failedToStart", "Failed to start terminal")
|
|
552
619
|
}),
|
|
553
620
|
/* @__PURE__ */ h("p", {
|
|
554
621
|
className: "text-text-tertiary text-xs mt-2",
|
|
@@ -556,14 +623,14 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
556
623
|
}),
|
|
557
624
|
/* @__PURE__ */ h("div", {
|
|
558
625
|
className: "flex items-center justify-center gap-3 mt-4",
|
|
559
|
-
children:
|
|
626
|
+
children: x && b && /* @__PURE__ */ g("button", {
|
|
560
627
|
type: "button",
|
|
561
628
|
onClick: () => {
|
|
562
|
-
let t =
|
|
563
|
-
t &&
|
|
629
|
+
let t = b.find((t) => t.id === e.sessionId);
|
|
630
|
+
t && x(t);
|
|
564
631
|
},
|
|
565
632
|
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",
|
|
566
|
-
children: [/* @__PURE__ */ h(
|
|
633
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.retry", "Retry")]
|
|
567
634
|
})
|
|
568
635
|
})
|
|
569
636
|
]
|
|
@@ -577,20 +644,20 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
577
644
|
/* @__PURE__ */ h(p, { className: "size-8 text-text-secondary mx-auto" }),
|
|
578
645
|
/* @__PURE__ */ h("p", {
|
|
579
646
|
className: "text-text-primary text-sm font-medium",
|
|
580
|
-
children:
|
|
647
|
+
children: A("vibecontrols.sessions.terminal.terminalNotStarted", "Terminal not started yet")
|
|
581
648
|
}),
|
|
582
649
|
/* @__PURE__ */ h("p", {
|
|
583
650
|
className: "text-text-secondary text-xs",
|
|
584
|
-
children:
|
|
651
|
+
children: A("vibecontrols.sessions.terminal.startTerminalHint", "Click below to start a ttyd terminal on the agent for this session.")
|
|
585
652
|
}),
|
|
586
|
-
|
|
653
|
+
x && b && /* @__PURE__ */ g("button", {
|
|
587
654
|
type: "button",
|
|
588
655
|
onClick: () => {
|
|
589
|
-
let t =
|
|
590
|
-
t &&
|
|
656
|
+
let t = b.find((t) => t.id === e.sessionId);
|
|
657
|
+
t && x(t);
|
|
591
658
|
},
|
|
592
659
|
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",
|
|
593
|
-
children: [/* @__PURE__ */ h(p, { className: "size-3.5" }),
|
|
660
|
+
children: [/* @__PURE__ */ h(p, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.startTerminal", "Start terminal")]
|
|
594
661
|
})
|
|
595
662
|
]
|
|
596
663
|
})
|
|
@@ -605,24 +672,24 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
605
672
|
/* @__PURE__ */ h(p, { className: "size-12 text-text-secondary mx-auto mb-4" }),
|
|
606
673
|
/* @__PURE__ */ h("p", {
|
|
607
674
|
className: "text-text-secondary text-base font-medium mb-2",
|
|
608
|
-
children:
|
|
675
|
+
children: A("vibecontrols.sessions.terminal.noTerminalsOpen", "No terminals open")
|
|
609
676
|
}),
|
|
610
677
|
/* @__PURE__ */ h("p", {
|
|
611
678
|
className: "text-text-secondary text-sm mb-4",
|
|
612
|
-
children:
|
|
679
|
+
children: A("vibecontrols.sessions.terminal.clickPlusTab", "Click the + tab above to create a new session or open an existing one")
|
|
613
680
|
}),
|
|
614
|
-
w && /* @__PURE__ */ g("button", {
|
|
681
|
+
(T || w) && /* @__PURE__ */ g("button", {
|
|
615
682
|
type: "button",
|
|
616
|
-
onClick: w,
|
|
683
|
+
onClick: () => (T ?? w)?.(),
|
|
617
684
|
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",
|
|
618
|
-
children: [/* @__PURE__ */ h(
|
|
685
|
+
children: [/* @__PURE__ */ h(u, { className: "size-4" }), A("vibecontrols.sessions.terminal.newSession", "New Session")]
|
|
619
686
|
})
|
|
620
687
|
]
|
|
621
688
|
})
|
|
622
689
|
})
|
|
623
690
|
}),
|
|
624
|
-
|
|
625
|
-
ref:
|
|
691
|
+
M && (w || X.length > 0) && H.current && /* @__PURE__ */ g("div", {
|
|
692
|
+
ref: tt,
|
|
626
693
|
className: "fixed bg-bg-elevated border border-border-default rounded-md shadow-xl z-[10000] w-[280px]",
|
|
627
694
|
style: {
|
|
628
695
|
top: H.current.getBoundingClientRect().bottom + 4,
|
|
@@ -634,19 +701,19 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
634
701
|
children: /* @__PURE__ */ g("div", {
|
|
635
702
|
className: "flex items-center gap-2 px-2 py-1.5 bg-bg-sunken rounded border border-border-subtle focus-within:border-border-strong",
|
|
636
703
|
children: [
|
|
637
|
-
/* @__PURE__ */ h(
|
|
704
|
+
/* @__PURE__ */ h(pe, { className: "size-3.5 text-text-muted shrink-0" }),
|
|
638
705
|
/* @__PURE__ */ h("input", {
|
|
639
706
|
"aria-label": "Search sessions...",
|
|
640
|
-
ref:
|
|
707
|
+
ref: nt,
|
|
641
708
|
type: "text",
|
|
642
|
-
value:
|
|
643
|
-
onChange: (e) =>
|
|
709
|
+
value: P,
|
|
710
|
+
onChange: (e) => F(e.target.value),
|
|
644
711
|
placeholder: "Search sessions...",
|
|
645
712
|
className: "w-full bg-bg-surface/0 text-sm text-text-primary outline-none placeholder:text-text-placeholder"
|
|
646
713
|
}),
|
|
647
|
-
|
|
714
|
+
P && /* @__PURE__ */ h("button", {
|
|
648
715
|
type: "button",
|
|
649
|
-
onClick: () =>
|
|
716
|
+
onClick: () => F(""),
|
|
650
717
|
className: "text-text-muted hover:text-text-primary shrink-0",
|
|
651
718
|
children: /* @__PURE__ */ h(m, { className: "size-3" })
|
|
652
719
|
})
|
|
@@ -656,12 +723,12 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
656
723
|
w && /* @__PURE__ */ g("button", {
|
|
657
724
|
type: "button",
|
|
658
725
|
onClick: () => {
|
|
659
|
-
w(),
|
|
726
|
+
w(), N(!1), F("");
|
|
660
727
|
},
|
|
661
728
|
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",
|
|
662
|
-
children: [/* @__PURE__ */ h(
|
|
729
|
+
children: [/* @__PURE__ */ h(u, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ h("span", { children: A("vibecontrols.sessions.terminal.newSessionWithOptions", "New session with options…") })]
|
|
663
730
|
}),
|
|
664
|
-
|
|
731
|
+
X.length > 0 && /* @__PURE__ */ g(ye, { children: [
|
|
665
732
|
/* @__PURE__ */ h("div", { className: "border-t border-border-subtle" }),
|
|
666
733
|
/* @__PURE__ */ h("div", {
|
|
667
734
|
className: "px-3 pt-2 pb-1",
|
|
@@ -669,17 +736,17 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
669
736
|
className: "text-[10px] font-medium uppercase tracking-wider text-text-muted",
|
|
670
737
|
children: [
|
|
671
738
|
"Open existing (",
|
|
672
|
-
|
|
739
|
+
X.length,
|
|
673
740
|
")"
|
|
674
741
|
]
|
|
675
742
|
})
|
|
676
743
|
}),
|
|
677
744
|
/* @__PURE__ */ h("div", {
|
|
678
745
|
className: "max-h-48 overflow-y-auto pb-1",
|
|
679
|
-
children:
|
|
746
|
+
children: ht.length > 0 ? ht.map((e) => /* @__PURE__ */ g("button", {
|
|
680
747
|
type: "button",
|
|
681
748
|
onClick: () => {
|
|
682
|
-
De?.(e),
|
|
749
|
+
De?.(e), N(!1), F("");
|
|
683
750
|
},
|
|
684
751
|
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",
|
|
685
752
|
children: [
|
|
@@ -697,7 +764,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
697
764
|
className: "px-3 py-2 text-xs text-text-muted",
|
|
698
765
|
children: [
|
|
699
766
|
"No sessions matching “",
|
|
700
|
-
|
|
767
|
+
P,
|
|
701
768
|
"”"
|
|
702
769
|
]
|
|
703
770
|
})
|
|
@@ -705,108 +772,115 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
705
772
|
] })
|
|
706
773
|
]
|
|
707
774
|
}),
|
|
708
|
-
|
|
709
|
-
ref:
|
|
775
|
+
I.visible && $ && /* @__PURE__ */ g("div", {
|
|
776
|
+
ref: et,
|
|
710
777
|
className: "fixed bg-bg-elevated border border-border-default rounded-lg shadow-lg z-[10000] min-w-[180px] py-1",
|
|
711
778
|
style: {
|
|
712
|
-
top:
|
|
713
|
-
left:
|
|
779
|
+
top: I.y,
|
|
780
|
+
left: I.x
|
|
714
781
|
},
|
|
715
782
|
children: [
|
|
716
|
-
|
|
783
|
+
Oe && /* @__PURE__ */ g("button", {
|
|
717
784
|
type: "button",
|
|
718
|
-
onClick: () =>
|
|
785
|
+
onClick: () => Q($.sessionId),
|
|
719
786
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
720
|
-
children: [
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ h(ne, { className: "size-3.5" }),
|
|
789
|
+
A("vibecontrols.sessions.terminal.rename", "Rename"),
|
|
790
|
+
/* @__PURE__ */ h("span", {
|
|
791
|
+
className: "ml-auto text-[10px] text-text-tertiary font-mono",
|
|
792
|
+
children: "F2"
|
|
793
|
+
})
|
|
794
|
+
]
|
|
721
795
|
}),
|
|
722
796
|
$.terminalUrl && /* @__PURE__ */ g("button", {
|
|
723
797
|
type: "button",
|
|
724
798
|
onClick: () => {
|
|
725
|
-
we($.sessionId),
|
|
799
|
+
we($.sessionId), L((e) => ({
|
|
726
800
|
...e,
|
|
727
801
|
visible: !1
|
|
728
802
|
}));
|
|
729
803
|
},
|
|
730
804
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
731
|
-
children: [/* @__PURE__ */ h(
|
|
805
|
+
children: [/* @__PURE__ */ h(ie, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
|
|
732
806
|
}),
|
|
733
|
-
|
|
734
|
-
|
|
807
|
+
jt($.sessionId),
|
|
808
|
+
Me && /* @__PURE__ */ g("button", {
|
|
735
809
|
type: "button",
|
|
736
810
|
onClick: () => {
|
|
737
|
-
|
|
811
|
+
Me($.sessionId), L((e) => ({
|
|
738
812
|
...e,
|
|
739
813
|
visible: !1
|
|
740
814
|
}));
|
|
741
815
|
},
|
|
742
816
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
743
|
-
children: [$.pinned ? /* @__PURE__ */ h(de, { className: "size-3.5" }) : /* @__PURE__ */ h(ue, { className: "size-3.5" }), $.pinned ?
|
|
817
|
+
children: [$.pinned ? /* @__PURE__ */ h(de, { className: "size-3.5" }) : /* @__PURE__ */ h(ue, { className: "size-3.5" }), $.pinned ? A("vibecontrols.sessions.terminal.unpinTab", "Unpin Tab") : A("vibecontrols.sessions.terminal.pinTab", "Pin Tab")]
|
|
744
818
|
}),
|
|
745
819
|
$.terminalUrl && /* @__PURE__ */ g("button", {
|
|
746
820
|
type: "button",
|
|
747
821
|
onClick: () => {
|
|
748
|
-
|
|
822
|
+
Z($.sessionId), L((e) => ({
|
|
749
823
|
...e,
|
|
750
824
|
visible: !1
|
|
751
825
|
}));
|
|
752
826
|
},
|
|
753
|
-
className: `flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-bg-sunken transition-colors ${
|
|
754
|
-
children: [/* @__PURE__ */ h(
|
|
827
|
+
className: `flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-bg-sunken transition-colors ${V[$.sessionId] === "error" ? "text-status-warning-text" : "text-text-primary"}`,
|
|
828
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.reconnect", "Reconnect")]
|
|
755
829
|
}),
|
|
756
|
-
|
|
830
|
+
S && /* @__PURE__ */ g("button", {
|
|
757
831
|
type: "button",
|
|
758
832
|
onClick: () => {
|
|
759
|
-
|
|
833
|
+
S($.sessionId), L((e) => ({
|
|
760
834
|
...e,
|
|
761
835
|
visible: !1
|
|
762
836
|
}));
|
|
763
837
|
},
|
|
764
838
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
765
|
-
children: [/* @__PURE__ */ h(
|
|
839
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.restartTerminal", "Restart Terminal")]
|
|
766
840
|
}),
|
|
767
|
-
|
|
841
|
+
ke && /* @__PURE__ */ g("button", {
|
|
768
842
|
type: "button",
|
|
769
843
|
onClick: () => {
|
|
770
|
-
|
|
844
|
+
ke($.sessionId), L((e) => ({
|
|
771
845
|
...e,
|
|
772
846
|
visible: !1
|
|
773
847
|
}));
|
|
774
848
|
},
|
|
775
849
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
776
|
-
children: [/* @__PURE__ */ h(f, { className: "size-3.5" }),
|
|
850
|
+
children: [/* @__PURE__ */ h(f, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.stopTerminal", "Stop Terminal")]
|
|
777
851
|
}),
|
|
778
852
|
C && /* @__PURE__ */ g("button", {
|
|
779
853
|
type: "button",
|
|
780
854
|
onClick: () => {
|
|
781
|
-
C($.sessionId),
|
|
855
|
+
C($.sessionId), L((e) => ({
|
|
782
856
|
...e,
|
|
783
857
|
visible: !1
|
|
784
858
|
}));
|
|
785
859
|
},
|
|
786
860
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-warning-text hover:bg-bg-sunken transition-colors",
|
|
787
|
-
children: [/* @__PURE__ */ h(f, { className: "size-3.5" }),
|
|
861
|
+
children: [/* @__PURE__ */ h(f, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.stopSession", "Stop Session")]
|
|
788
862
|
}),
|
|
789
863
|
/* @__PURE__ */ h("div", { className: "border-t border-border-subtle my-1" }),
|
|
790
864
|
/* @__PURE__ */ g("button", {
|
|
791
865
|
type: "button",
|
|
792
866
|
onClick: () => {
|
|
793
|
-
|
|
867
|
+
v($.sessionId), L((e) => ({
|
|
794
868
|
...e,
|
|
795
869
|
visible: !1
|
|
796
870
|
}));
|
|
797
871
|
},
|
|
798
872
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-error-text hover:bg-bg-sunken transition-colors",
|
|
799
|
-
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }),
|
|
873
|
+
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
|
|
800
874
|
})
|
|
801
875
|
]
|
|
802
876
|
})
|
|
803
877
|
]
|
|
804
878
|
}), document.body) : null : /* @__PURE__ */ g("div", {
|
|
805
|
-
ref:
|
|
806
|
-
className: `${
|
|
879
|
+
ref: Qe,
|
|
880
|
+
className: `${D ? "flex flex-col h-full" : ""} border-t border-border-default bg-bg-surface ${y && _.length === 0 && !D ? "hidden" : ""}`,
|
|
807
881
|
children: [
|
|
808
|
-
!
|
|
809
|
-
onMouseDown:
|
|
882
|
+
!D && !y && _.length > 0 && /* @__PURE__ */ h("div", {
|
|
883
|
+
onMouseDown: Ct,
|
|
810
884
|
className: "h-1 cursor-ns-resize hover:bg-action-primary-bg/30 transition-colors flex items-center justify-center group",
|
|
811
885
|
title: "Drag to resize",
|
|
812
886
|
children: /* @__PURE__ */ h(ae, { className: "w-4 h-3 text-text-muted opacity-0 group-hover:opacity-100 transition-opacity rotate-90" })
|
|
@@ -814,121 +888,136 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
814
888
|
/* @__PURE__ */ g("div", {
|
|
815
889
|
className: "flex items-center bg-bg-sunken border-b border-border-default",
|
|
816
890
|
children: [
|
|
817
|
-
!
|
|
891
|
+
!D && /* @__PURE__ */ g("button", {
|
|
818
892
|
type: "button",
|
|
819
893
|
onClick: Te,
|
|
820
894
|
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",
|
|
821
|
-
title:
|
|
895
|
+
title: y ? "Expand terminal" : "Collapse terminal",
|
|
822
896
|
children: [
|
|
823
897
|
/* @__PURE__ */ h(p, { className: "size-3.5" }),
|
|
824
898
|
"Terminal",
|
|
825
|
-
h(
|
|
899
|
+
h(y ? te : c, { className: "size-3" })
|
|
826
900
|
]
|
|
827
901
|
}),
|
|
828
|
-
(!
|
|
902
|
+
(!y || D) && /* @__PURE__ */ h("div", {
|
|
829
903
|
className: "flex items-center overflow-x-auto flex-1 min-w-0",
|
|
830
|
-
children:
|
|
904
|
+
children: lt.map((e, t) => /* @__PURE__ */ h(xe, {
|
|
831
905
|
tab: e,
|
|
832
906
|
index: t,
|
|
833
907
|
isActive: e.sessionId === q?.sessionId,
|
|
834
908
|
isDragging: K === t,
|
|
835
|
-
statusIndicator:
|
|
836
|
-
isRenaming:
|
|
837
|
-
renameValue:
|
|
838
|
-
renameInputRef:
|
|
839
|
-
onRenameChange:
|
|
840
|
-
onRenameBlur:
|
|
841
|
-
onRenameKeyDown:
|
|
842
|
-
onSelect: () =>
|
|
843
|
-
onClose: () =>
|
|
844
|
-
onContextMenu: (t) =>
|
|
845
|
-
onDoubleClick: () =>
|
|
846
|
-
onDragStart: (e) =>
|
|
847
|
-
onDragOver:
|
|
848
|
-
onDrop: (e) =>
|
|
849
|
-
onDragEnd:
|
|
850
|
-
closeLabel:
|
|
909
|
+
statusIndicator: Mt(e),
|
|
910
|
+
isRenaming: R === e.sessionId,
|
|
911
|
+
renameValue: z,
|
|
912
|
+
renameInputRef: $e,
|
|
913
|
+
onRenameChange: He,
|
|
914
|
+
onRenameBlur: Tt,
|
|
915
|
+
onRenameKeyDown: Et,
|
|
916
|
+
onSelect: () => Ce(e.sessionId),
|
|
917
|
+
onClose: () => v(e.sessionId),
|
|
918
|
+
onContextMenu: (t) => wt(t, e.sessionId),
|
|
919
|
+
onDoubleClick: () => Q(e.sessionId),
|
|
920
|
+
onDragStart: (e) => yt(e, t),
|
|
921
|
+
onDragOver: bt,
|
|
922
|
+
onDrop: (e) => xt(e, t),
|
|
923
|
+
onDragEnd: St,
|
|
924
|
+
closeLabel: A("vibecontrols.sessions.terminal.closeTab", "Close terminal")
|
|
851
925
|
}, e.sessionId))
|
|
852
926
|
}),
|
|
853
|
-
(!
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
927
|
+
(!y || D) && /* @__PURE__ */ g("div", {
|
|
928
|
+
className: "flex items-center shrink-0 border-r border-border-subtle",
|
|
929
|
+
children: [/* @__PURE__ */ h("button", {
|
|
930
|
+
type: "button",
|
|
931
|
+
onClick: () => {
|
|
932
|
+
T ? T() : (w || X.length > 0) && (N((e) => !e), F(""));
|
|
933
|
+
},
|
|
934
|
+
className: "flex items-center pl-2.5 pr-1.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
935
|
+
title: T ? A("vibecontrols.sessions.terminal.quickNewSession", "New terminal (⌘/Ctrl+T)") : A("vibecontrols.sessions.terminal.newOrOpen", "New session or open existing"),
|
|
936
|
+
"data-testid": "terminal-quick-create",
|
|
937
|
+
children: /* @__PURE__ */ h(u, { className: "size-3.5" })
|
|
938
|
+
}), /* @__PURE__ */ h("button", {
|
|
939
|
+
type: "button",
|
|
940
|
+
ref: H,
|
|
941
|
+
onClick: () => {
|
|
942
|
+
N((e) => !e), F("");
|
|
943
|
+
},
|
|
944
|
+
className: "flex items-center pr-2 pl-0.5 py-1.5 text-text-secondary hover:text-text-primary transition-colors",
|
|
945
|
+
title: A("vibecontrols.sessions.terminal.moreSessionOptions", "New session with options / open existing"),
|
|
946
|
+
"aria-haspopup": "menu",
|
|
947
|
+
"aria-expanded": M,
|
|
948
|
+
"data-testid": "terminal-session-menu",
|
|
949
|
+
children: /* @__PURE__ */ h(c, { className: "size-3" })
|
|
950
|
+
})]
|
|
862
951
|
}),
|
|
863
|
-
(!
|
|
952
|
+
(!y || D) && _.length > 0 && /* @__PURE__ */ g("div", {
|
|
864
953
|
className: "flex items-center gap-1 px-2 shrink-0",
|
|
865
954
|
children: [
|
|
866
955
|
q?.terminalUrl && /* @__PURE__ */ h("button", {
|
|
867
956
|
type: "button",
|
|
868
|
-
onClick: () =>
|
|
869
|
-
className: `p-1 transition-colors ${
|
|
870
|
-
title:
|
|
871
|
-
"aria-label":
|
|
957
|
+
onClick: () => Z(q.sessionId),
|
|
958
|
+
className: `p-1 transition-colors ${V[q.sessionId] === "error" ? "text-status-warning-text hover:text-status-warning-text/80" : "text-text-secondary hover:text-text-primary"}`,
|
|
959
|
+
title: A("vibecontrols.sessions.terminal.reconnect", "Reconnect"),
|
|
960
|
+
"aria-label": A("vibecontrols.sessions.terminal.reconnect", "Reconnect"),
|
|
872
961
|
"data-testid": "terminal-reconnect",
|
|
873
|
-
children: /* @__PURE__ */ h(
|
|
962
|
+
children: /* @__PURE__ */ h(d, { className: "size-3.5" })
|
|
874
963
|
}),
|
|
875
964
|
q?.terminalUrl && /* @__PURE__ */ h("button", {
|
|
876
965
|
type: "button",
|
|
877
966
|
onClick: () => q && we(q.sessionId),
|
|
878
967
|
className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
|
|
879
|
-
title: "Open in new tab",
|
|
880
|
-
children: /* @__PURE__ */ h(
|
|
968
|
+
title: A("vibecontrols.sessions.terminal.openInNewTabShortcut", "Open in new tab (⌘/Ctrl+O)"),
|
|
969
|
+
children: /* @__PURE__ */ h(ie, { className: "size-3.5" })
|
|
881
970
|
}),
|
|
882
971
|
q && C && /* @__PURE__ */ g("button", {
|
|
883
972
|
type: "button",
|
|
884
|
-
onClick: () =>
|
|
885
|
-
disabled:
|
|
973
|
+
onClick: () => dt(q.sessionId),
|
|
974
|
+
disabled: B.has(q.sessionId),
|
|
886
975
|
className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-md border border-status-error-bg/40 bg-status-error-bg/10 text-status-error-text hover:bg-status-error-bg/20 hover:border-status-error-bg/60 active:scale-95 transition-all disabled:opacity-60 disabled:cursor-not-allowed",
|
|
887
|
-
title:
|
|
888
|
-
"aria-label":
|
|
889
|
-
"aria-busy":
|
|
890
|
-
children: [
|
|
976
|
+
title: A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
977
|
+
"aria-label": A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
978
|
+
"aria-busy": B.has(q.sessionId),
|
|
979
|
+
children: [B.has(q.sessionId) ? /* @__PURE__ */ h(l, { className: "size-3 animate-spin" }) : /* @__PURE__ */ h(f, { className: "size-3 fill-current" }), /* @__PURE__ */ h("span", {
|
|
891
980
|
className: "text-[11px] font-medium",
|
|
892
|
-
children:
|
|
981
|
+
children: B.has(q.sessionId) ? A("vibecontrols.sessions.terminal.stoppingSession", "Stopping…") : A("vibecontrols.sessions.terminal.stopSession", "Stop")
|
|
893
982
|
})]
|
|
894
983
|
}),
|
|
895
984
|
q && /* @__PURE__ */ h("button", {
|
|
896
985
|
type: "button",
|
|
897
|
-
onClick: () =>
|
|
898
|
-
className: `p-1 transition-colors ${
|
|
899
|
-
title:
|
|
900
|
-
children: /* @__PURE__ */ h(
|
|
986
|
+
onClick: () => Be((e) => !e),
|
|
987
|
+
className: `p-1 transition-colors ${ze ? "text-action-primary-text bg-action-primary-bg rounded" : "text-text-secondary hover:text-text-primary"}`,
|
|
988
|
+
title: A("vibecontrols.sessions.terminal.connectionLog", "Connection Log"),
|
|
989
|
+
children: /* @__PURE__ */ h(fe, { className: "size-3.5" })
|
|
901
990
|
}),
|
|
902
|
-
|
|
991
|
+
k && /* @__PURE__ */ h("button", {
|
|
903
992
|
type: "button",
|
|
904
|
-
onClick:
|
|
993
|
+
onClick: k,
|
|
905
994
|
className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
|
|
906
|
-
title:
|
|
907
|
-
children: h(
|
|
995
|
+
title: O ? "Exit fullscreen" : "Enter fullscreen",
|
|
996
|
+
children: h(O ? ge : re, { className: "size-3.5" })
|
|
908
997
|
}),
|
|
909
|
-
!
|
|
998
|
+
!D && !O && /* @__PURE__ */ h("button", {
|
|
910
999
|
type: "button",
|
|
911
|
-
onClick:
|
|
1000
|
+
onClick: mt,
|
|
912
1001
|
className: "p-1 text-text-secondary hover:text-text-primary transition-colors",
|
|
913
|
-
title:
|
|
914
|
-
children: h(
|
|
1002
|
+
title: j ? "Restore size" : "Maximize",
|
|
1003
|
+
children: h(j ? ce : se, { className: "size-3.5" })
|
|
915
1004
|
})
|
|
916
1005
|
]
|
|
917
1006
|
})
|
|
918
1007
|
]
|
|
919
1008
|
}),
|
|
920
|
-
(!
|
|
921
|
-
className: `${
|
|
922
|
-
style:
|
|
923
|
-
children: [
|
|
1009
|
+
(!y || D) && q && /* @__PURE__ */ g("div", {
|
|
1010
|
+
className: `${Ot || ""} bg-bg-sunken text-text-primary relative ${D ? "flex-1" : ""}`,
|
|
1011
|
+
style: kt,
|
|
1012
|
+
children: [ze && q && /* @__PURE__ */ g("div", {
|
|
924
1013
|
className: "absolute inset-0 z-30 bg-bg-surface flex flex-col",
|
|
925
1014
|
children: [/* @__PURE__ */ g("div", {
|
|
926
1015
|
className: "flex items-center justify-between px-4 py-2 border-b border-border-default",
|
|
927
1016
|
children: [/* @__PURE__ */ g("div", {
|
|
928
1017
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
929
1018
|
children: [
|
|
930
|
-
/* @__PURE__ */ h(
|
|
931
|
-
|
|
1019
|
+
/* @__PURE__ */ h(fe, { className: "size-4" }),
|
|
1020
|
+
A("vibecontrols.sessions.terminal.connectionLog", "Connection Log"),
|
|
932
1021
|
/* @__PURE__ */ g("span", {
|
|
933
1022
|
className: "text-text-tertiary font-normal",
|
|
934
1023
|
children: ["· ", q.name]
|
|
@@ -936,9 +1025,9 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
936
1025
|
]
|
|
937
1026
|
}), /* @__PURE__ */ h("button", {
|
|
938
1027
|
type: "button",
|
|
939
|
-
onClick: () =>
|
|
1028
|
+
onClick: () => Be(!1),
|
|
940
1029
|
className: "p-1 text-text-secondary hover:text-text-primary",
|
|
941
|
-
title:
|
|
1030
|
+
title: A("common.close", "Close"),
|
|
942
1031
|
children: /* @__PURE__ */ h(m, { className: "size-4" })
|
|
943
1032
|
})]
|
|
944
1033
|
}), /* @__PURE__ */ h("div", {
|
|
@@ -949,13 +1038,13 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
949
1038
|
})
|
|
950
1039
|
})]
|
|
951
1040
|
}), _.map((e) => {
|
|
952
|
-
let t =
|
|
1041
|
+
let t = V[e.sessionId], r = t === "connecting" || e.loading, i = pt(e.terminalUrl), a = i ?? Ge[e.sessionId], o = !!e.terminalUrl && !e.error && !i, s = J(e.sessionId), c = ut.get(e.sessionId), te = !s && (!!i || o && t === "error");
|
|
953
1042
|
return /* @__PURE__ */ g("div", {
|
|
954
1043
|
className: `absolute inset-0 ${e.sessionId === q.sessionId ? "block" : "hidden"}`,
|
|
955
1044
|
children: [
|
|
956
1045
|
o && e.terminalUrl && /* @__PURE__ */ h(n, {
|
|
957
1046
|
ref: (t) => {
|
|
958
|
-
|
|
1047
|
+
rt.current[e.sessionId] = t;
|
|
959
1048
|
},
|
|
960
1049
|
sessionId: e.sessionId,
|
|
961
1050
|
agentId: e.agentId ?? null,
|
|
@@ -964,19 +1053,19 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
964
1053
|
title: `Terminal - ${e.name}`,
|
|
965
1054
|
className: "w-full h-full border-0",
|
|
966
1055
|
allow: "clipboard-read *; clipboard-write *",
|
|
967
|
-
onLoad: () =>
|
|
968
|
-
onError: () =>
|
|
969
|
-
}, `tif-${e.sessionId}-${
|
|
970
|
-
o && r && /* @__PURE__ */ h("div", {
|
|
1056
|
+
onLoad: () => gt(e.sessionId),
|
|
1057
|
+
onError: () => _t(e.sessionId)
|
|
1058
|
+
}, `tif-${e.sessionId}-${it[e.sessionId] ?? 0}`),
|
|
1059
|
+
o && r && !s && /* @__PURE__ */ h("div", {
|
|
971
1060
|
className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center pointer-events-none z-10",
|
|
972
1061
|
children: /* @__PURE__ */ g("div", {
|
|
973
1062
|
className: "flex items-center gap-3 px-4 py-3 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
974
|
-
children: [/* @__PURE__ */ h(
|
|
1063
|
+
children: [/* @__PURE__ */ h(l, { className: "size-5 text-status-warning-text animate-spin" }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
975
1064
|
className: "text-text-primary text-sm font-medium",
|
|
976
|
-
children: e.loading ?
|
|
1065
|
+
children: e.loading ? A("vibecontrols.sessions.terminal.startingTerminal", "Starting terminal...") : A("vibecontrols.sessions.terminal.connecting", "Connecting...")
|
|
977
1066
|
}), /* @__PURE__ */ h("p", {
|
|
978
1067
|
className: "text-text-secondary text-xs",
|
|
979
|
-
children: e.loading ?
|
|
1068
|
+
children: e.loading ? A("vibecontrols.sessions.terminal.settingUpWebTerminal", "Setting up session + web terminal") : A("vibecontrols.sessions.terminal.establishingConnection", "Establishing connection")
|
|
980
1069
|
})] })]
|
|
981
1070
|
})
|
|
982
1071
|
}),
|
|
@@ -985,29 +1074,63 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
985
1074
|
children: /* @__PURE__ */ g("div", {
|
|
986
1075
|
className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
987
1076
|
children: [
|
|
988
|
-
/* @__PURE__ */ h(
|
|
1077
|
+
/* @__PURE__ */ h(ve, { className: "size-6 text-status-error-text" }),
|
|
989
1078
|
/* @__PURE__ */ g("div", {
|
|
990
1079
|
className: "text-center",
|
|
991
1080
|
children: [/* @__PURE__ */ h("p", {
|
|
992
1081
|
className: "text-text-primary text-sm font-medium",
|
|
993
|
-
children:
|
|
1082
|
+
children: A("vibecontrols.sessions.terminal.connectionLost", "Connection Lost")
|
|
994
1083
|
}), /* @__PURE__ */ h("p", {
|
|
995
1084
|
className: "text-text-secondary text-xs mt-1",
|
|
996
|
-
children: a || ((W.current[e.sessionId] ?? 0) < 15 ?
|
|
1085
|
+
children: a || ((W.current[e.sessionId] ?? 0) < 15 ? A("vibecontrols.sessions.terminal.reconnectingAutomatically", "Reconnecting automatically...") : A("vibecontrols.sessions.terminal.connectionInterrupted", "Terminal connection was interrupted"))
|
|
997
1086
|
})]
|
|
998
1087
|
}),
|
|
999
|
-
!a && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ h(
|
|
1088
|
+
!a && (W.current[e.sessionId] ?? 0) < 15 && /* @__PURE__ */ h(l, { className: "size-4 text-text-tertiary animate-spin" }),
|
|
1000
1089
|
/* @__PURE__ */ g("div", {
|
|
1001
1090
|
className: "flex items-center justify-center gap-2 flex-wrap",
|
|
1002
1091
|
children: [/* @__PURE__ */ g("button", {
|
|
1003
1092
|
type: "button",
|
|
1004
|
-
onClick: () =>
|
|
1093
|
+
onClick: () => Z(e.sessionId),
|
|
1005
1094
|
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",
|
|
1006
|
-
children: [/* @__PURE__ */ h(
|
|
1095
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.reconnectNow", "Reconnect Now")]
|
|
1007
1096
|
}), /* @__PURE__ */ g("a", {
|
|
1008
1097
|
href: `/vibecontrols/sessions/${e.sessionId}#connection-log`,
|
|
1009
1098
|
className: "px-4 py-2 text-action-primary-text bg-action-primary-bg text-sm rounded-md hover:bg-action-primary-bg-hover transition-colors inline-flex items-center gap-2",
|
|
1010
|
-
children: [/* @__PURE__ */ h(
|
|
1099
|
+
children: [/* @__PURE__ */ h(fe, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.seeConnectionLog", "See connection log")]
|
|
1100
|
+
})]
|
|
1101
|
+
})
|
|
1102
|
+
]
|
|
1103
|
+
})
|
|
1104
|
+
}),
|
|
1105
|
+
s && /* @__PURE__ */ h("div", {
|
|
1106
|
+
className: "absolute inset-0 bg-bg-overlay backdrop-blur-[2px] flex items-center justify-center z-20",
|
|
1107
|
+
"data-testid": "terminal-session-stopped",
|
|
1108
|
+
children: /* @__PURE__ */ g("div", {
|
|
1109
|
+
className: "flex flex-col items-center gap-3 px-6 py-4 bg-bg-surface/95 rounded-lg border border-border-default shadow-lg",
|
|
1110
|
+
children: [
|
|
1111
|
+
/* @__PURE__ */ h(f, { className: "size-6 text-text-secondary" }),
|
|
1112
|
+
/* @__PURE__ */ g("div", {
|
|
1113
|
+
className: "text-center",
|
|
1114
|
+
children: [/* @__PURE__ */ h("p", {
|
|
1115
|
+
className: "text-text-primary text-sm font-medium",
|
|
1116
|
+
children: c === "ERROR" ? A("vibecontrols.sessions.terminal.sessionErrored", "Session ended") : A("vibecontrols.sessions.terminal.sessionStopped", "Session stopped")
|
|
1117
|
+
}), /* @__PURE__ */ h("p", {
|
|
1118
|
+
className: "text-text-secondary text-xs mt-1",
|
|
1119
|
+
children: A("vibecontrols.sessions.terminal.sessionStoppedHint", "This terminal is no longer running.")
|
|
1120
|
+
})]
|
|
1121
|
+
}),
|
|
1122
|
+
/* @__PURE__ */ g("div", {
|
|
1123
|
+
className: "flex items-center gap-2",
|
|
1124
|
+
children: [S && /* @__PURE__ */ g("button", {
|
|
1125
|
+
type: "button",
|
|
1126
|
+
onClick: () => S(e.sessionId),
|
|
1127
|
+
className: "px-3 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",
|
|
1128
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.restartSession", "Restart")]
|
|
1129
|
+
}), /* @__PURE__ */ g("button", {
|
|
1130
|
+
type: "button",
|
|
1131
|
+
onClick: () => v(e.sessionId),
|
|
1132
|
+
className: "px-3 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",
|
|
1133
|
+
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.closeTab", "Close")]
|
|
1011
1134
|
})]
|
|
1012
1135
|
})
|
|
1013
1136
|
]
|
|
@@ -1018,7 +1141,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1018
1141
|
children: /* @__PURE__ */ g("div", {
|
|
1019
1142
|
className: "text-center",
|
|
1020
1143
|
children: [
|
|
1021
|
-
/* @__PURE__ */ h(
|
|
1144
|
+
/* @__PURE__ */ h(l, { className: "size-8 text-text-tertiary animate-spin mx-auto mb-3" }),
|
|
1022
1145
|
/* @__PURE__ */ g("p", {
|
|
1023
1146
|
className: "text-text-tertiary text-sm",
|
|
1024
1147
|
children: [
|
|
@@ -1042,7 +1165,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1042
1165
|
/* @__PURE__ */ h(ee, { className: "size-8 text-status-error-text mx-auto mb-3" }),
|
|
1043
1166
|
/* @__PURE__ */ h("p", {
|
|
1044
1167
|
className: "text-status-error-text text-sm font-medium",
|
|
1045
|
-
children:
|
|
1168
|
+
children: A("vibecontrols.sessions.terminal.failedToStart", "Failed to start terminal")
|
|
1046
1169
|
}),
|
|
1047
1170
|
/* @__PURE__ */ h("p", {
|
|
1048
1171
|
className: "text-text-tertiary text-xs mt-2",
|
|
@@ -1050,22 +1173,22 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1050
1173
|
}),
|
|
1051
1174
|
/* @__PURE__ */ h("p", {
|
|
1052
1175
|
className: "text-text-secondary text-xs mt-3",
|
|
1053
|
-
children:
|
|
1176
|
+
children: A("vibecontrols.sessions.terminal.seeConnectionLogPrompt", "See the connection log for the step-by-step timeline of probe / start / mint / exchange events.")
|
|
1054
1177
|
}),
|
|
1055
1178
|
/* @__PURE__ */ g("div", {
|
|
1056
1179
|
className: "flex items-center justify-center gap-3 mt-4 flex-wrap",
|
|
1057
|
-
children: [
|
|
1180
|
+
children: [x && b && /* @__PURE__ */ g("button", {
|
|
1058
1181
|
type: "button",
|
|
1059
1182
|
onClick: () => {
|
|
1060
|
-
let t =
|
|
1061
|
-
t &&
|
|
1183
|
+
let t = b.find((t) => t.id === e.sessionId);
|
|
1184
|
+
t && x(t);
|
|
1062
1185
|
},
|
|
1063
1186
|
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",
|
|
1064
|
-
children: [/* @__PURE__ */ h(
|
|
1187
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.retry", "Retry")]
|
|
1065
1188
|
}), /* @__PURE__ */ g("a", {
|
|
1066
1189
|
href: `/vibecontrols/sessions/${e.sessionId}#connection-log`,
|
|
1067
1190
|
className: "px-4 py-2 text-action-primary-text bg-action-primary-bg text-sm rounded-md hover:bg-action-primary-bg-hover transition-colors inline-flex items-center gap-2",
|
|
1068
|
-
children: [/* @__PURE__ */ h(
|
|
1191
|
+
children: [/* @__PURE__ */ h(fe, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.seeConnectionLog", "See connection log")]
|
|
1069
1192
|
})]
|
|
1070
1193
|
})
|
|
1071
1194
|
]
|
|
@@ -1079,11 +1202,11 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1079
1202
|
/* @__PURE__ */ h(p, { className: "size-8 text-text-secondary mx-auto mb-3" }),
|
|
1080
1203
|
/* @__PURE__ */ h("p", {
|
|
1081
1204
|
className: "text-text-tertiary text-sm",
|
|
1082
|
-
children:
|
|
1205
|
+
children: A("vibecontrols.sessions.terminal.noTerminalUrl", "No terminal URL available")
|
|
1083
1206
|
}),
|
|
1084
1207
|
/* @__PURE__ */ h("p", {
|
|
1085
1208
|
className: "text-text-secondary text-xs mt-1",
|
|
1086
|
-
children:
|
|
1209
|
+
children: A("vibecontrols.sessions.terminal.agentNeedsTtyd", "The agent needs to start ttyd for this session")
|
|
1087
1210
|
})
|
|
1088
1211
|
]
|
|
1089
1212
|
})
|
|
@@ -1092,7 +1215,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1092
1215
|
}, e.sessionId);
|
|
1093
1216
|
})]
|
|
1094
1217
|
}),
|
|
1095
|
-
(!
|
|
1218
|
+
(!y || D) && _.length === 0 && D && /* @__PURE__ */ h("div", {
|
|
1096
1219
|
className: "flex-1 bg-bg-sunken text-text-primary flex items-center justify-center",
|
|
1097
1220
|
children: /* @__PURE__ */ g("div", {
|
|
1098
1221
|
className: "text-center max-w-md",
|
|
@@ -1100,29 +1223,29 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1100
1223
|
/* @__PURE__ */ h(p, { className: "size-12 text-text-secondary mx-auto mb-4" }),
|
|
1101
1224
|
/* @__PURE__ */ h("p", {
|
|
1102
1225
|
className: "text-text-secondary text-base font-medium mb-2",
|
|
1103
|
-
children:
|
|
1226
|
+
children: A("vibecontrols.sessions.terminal.noTerminalsOpen", "No terminals open")
|
|
1104
1227
|
}),
|
|
1105
1228
|
/* @__PURE__ */ h("p", {
|
|
1106
1229
|
className: "text-text-secondary text-sm mb-4",
|
|
1107
|
-
children:
|
|
1230
|
+
children: A("vibecontrols.sessions.terminal.clickPlusTab", "Click the + tab above to create a new session or open an existing one")
|
|
1108
1231
|
}),
|
|
1109
1232
|
/* @__PURE__ */ h("div", {
|
|
1110
1233
|
className: "flex items-center justify-center gap-2 flex-wrap",
|
|
1111
|
-
children: w && /* @__PURE__ */ g("button", {
|
|
1234
|
+
children: (T || w) && /* @__PURE__ */ g("button", {
|
|
1112
1235
|
type: "button",
|
|
1113
|
-
onClick: w,
|
|
1236
|
+
onClick: () => (T ?? w)?.(),
|
|
1114
1237
|
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",
|
|
1115
|
-
children: [/* @__PURE__ */ h(
|
|
1238
|
+
children: [/* @__PURE__ */ h(u, { className: "size-4" }), A("vibecontrols.sessions.terminal.newSession", "New Session")]
|
|
1116
1239
|
})
|
|
1117
1240
|
}),
|
|
1118
|
-
|
|
1241
|
+
X.length > 0 && /* @__PURE__ */ g("div", {
|
|
1119
1242
|
className: "mt-6",
|
|
1120
1243
|
children: [/* @__PURE__ */ h("p", {
|
|
1121
1244
|
className: "text-text-secondary text-xs uppercase tracking-wider mb-3",
|
|
1122
1245
|
children: "Or open an existing session"
|
|
1123
1246
|
}), /* @__PURE__ */ g("div", {
|
|
1124
1247
|
className: "flex flex-col items-stretch gap-2 max-w-md mx-auto",
|
|
1125
|
-
children: [
|
|
1248
|
+
children: [X.slice(0, 6).map((e) => /* @__PURE__ */ g("div", {
|
|
1126
1249
|
className: "flex items-center gap-2 px-3 py-2 bg-bg-canvas text-text-secondary text-xs rounded-md border border-border-default",
|
|
1127
1250
|
children: [/* @__PURE__ */ g("button", {
|
|
1128
1251
|
type: "button",
|
|
@@ -1143,24 +1266,24 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1143
1266
|
}), C && e.status === "RUNNING" && /* @__PURE__ */ h("button", {
|
|
1144
1267
|
type: "button",
|
|
1145
1268
|
onClick: (t) => {
|
|
1146
|
-
t.stopPropagation(),
|
|
1269
|
+
t.stopPropagation(), dt(e.id);
|
|
1147
1270
|
},
|
|
1148
|
-
disabled:
|
|
1271
|
+
disabled: B.has(e.id),
|
|
1149
1272
|
className: "inline-flex items-center justify-center size-6 rounded-md border border-status-error-bg/40 bg-status-error-bg/10 text-status-error-text hover:bg-status-error-bg/20 hover:border-status-error-bg/60 active:scale-95 transition-all shrink-0 disabled:opacity-60 disabled:cursor-not-allowed",
|
|
1150
|
-
title:
|
|
1151
|
-
"aria-label":
|
|
1152
|
-
"aria-busy":
|
|
1153
|
-
children:
|
|
1273
|
+
title: A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
1274
|
+
"aria-label": A("vibecontrols.sessions.terminal.stopSession", "Stop Session"),
|
|
1275
|
+
"aria-busy": B.has(e.id),
|
|
1276
|
+
children: B.has(e.id) ? /* @__PURE__ */ h(l, { className: "size-3 animate-spin" }) : /* @__PURE__ */ h(f, { className: "size-3 fill-current" })
|
|
1154
1277
|
})]
|
|
1155
|
-
}, e.id)),
|
|
1278
|
+
}, e.id)), X.length > 6 && /* @__PURE__ */ g("button", {
|
|
1156
1279
|
type: "button",
|
|
1157
1280
|
onClick: () => {
|
|
1158
|
-
|
|
1281
|
+
N(!0), F("");
|
|
1159
1282
|
},
|
|
1160
1283
|
className: "text-text-tertiary text-xs self-center hover:text-text-primary transition-colors cursor-pointer",
|
|
1161
1284
|
children: [
|
|
1162
1285
|
"+",
|
|
1163
|
-
|
|
1286
|
+
X.length - 6,
|
|
1164
1287
|
" more"
|
|
1165
1288
|
]
|
|
1166
1289
|
})]
|
|
@@ -1169,8 +1292,8 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1169
1292
|
]
|
|
1170
1293
|
})
|
|
1171
1294
|
}),
|
|
1172
|
-
|
|
1173
|
-
ref:
|
|
1295
|
+
M && (w || X.length > 0) && H.current && /* @__PURE__ */ g("div", {
|
|
1296
|
+
ref: tt,
|
|
1174
1297
|
className: "fixed bg-bg-elevated border border-border-default rounded-md shadow-xl z-[100] w-[280px]",
|
|
1175
1298
|
style: {
|
|
1176
1299
|
top: H.current.getBoundingClientRect().bottom + 4,
|
|
@@ -1182,19 +1305,19 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1182
1305
|
children: /* @__PURE__ */ g("div", {
|
|
1183
1306
|
className: "flex items-center gap-2 px-2 py-1.5 bg-bg-sunken rounded border border-border-subtle focus-within:border-border-strong",
|
|
1184
1307
|
children: [
|
|
1185
|
-
/* @__PURE__ */ h(
|
|
1308
|
+
/* @__PURE__ */ h(pe, { className: "size-3.5 text-text-muted shrink-0" }),
|
|
1186
1309
|
/* @__PURE__ */ h("input", {
|
|
1187
1310
|
"aria-label": "Search sessions...",
|
|
1188
|
-
ref:
|
|
1311
|
+
ref: nt,
|
|
1189
1312
|
type: "text",
|
|
1190
|
-
value:
|
|
1191
|
-
onChange: (e) =>
|
|
1313
|
+
value: P,
|
|
1314
|
+
onChange: (e) => F(e.target.value),
|
|
1192
1315
|
placeholder: "Search sessions...",
|
|
1193
1316
|
className: "w-full bg-bg-surface/0 text-sm text-text-primary outline-none placeholder:text-text-placeholder"
|
|
1194
1317
|
}),
|
|
1195
|
-
|
|
1318
|
+
P && /* @__PURE__ */ h("button", {
|
|
1196
1319
|
type: "button",
|
|
1197
|
-
onClick: () =>
|
|
1320
|
+
onClick: () => F(""),
|
|
1198
1321
|
className: "text-text-muted hover:text-text-primary shrink-0",
|
|
1199
1322
|
children: /* @__PURE__ */ h(m, { className: "size-3" })
|
|
1200
1323
|
})
|
|
@@ -1204,12 +1327,12 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1204
1327
|
w && /* @__PURE__ */ g("button", {
|
|
1205
1328
|
type: "button",
|
|
1206
1329
|
onClick: () => {
|
|
1207
|
-
w(),
|
|
1330
|
+
w(), N(!1), F("");
|
|
1208
1331
|
},
|
|
1209
1332
|
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",
|
|
1210
|
-
children: [/* @__PURE__ */ h(
|
|
1333
|
+
children: [/* @__PURE__ */ h(u, { className: "size-3.5 text-text-secondary" }), /* @__PURE__ */ h("span", { children: A("vibecontrols.sessions.terminal.newSessionWithOptions", "New session with options…") })]
|
|
1211
1334
|
}),
|
|
1212
|
-
|
|
1335
|
+
X.length > 0 && /* @__PURE__ */ g(ye, { children: [
|
|
1213
1336
|
/* @__PURE__ */ h("div", { className: "border-t border-border-subtle" }),
|
|
1214
1337
|
/* @__PURE__ */ h("div", {
|
|
1215
1338
|
className: "px-3 pt-2 pb-1",
|
|
@@ -1217,17 +1340,17 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1217
1340
|
className: "text-[10px] font-medium uppercase tracking-wider text-text-muted",
|
|
1218
1341
|
children: [
|
|
1219
1342
|
"Open existing (",
|
|
1220
|
-
|
|
1343
|
+
X.length,
|
|
1221
1344
|
")"
|
|
1222
1345
|
]
|
|
1223
1346
|
})
|
|
1224
1347
|
}),
|
|
1225
1348
|
/* @__PURE__ */ h("div", {
|
|
1226
1349
|
className: "max-h-48 overflow-y-auto pb-1",
|
|
1227
|
-
children:
|
|
1350
|
+
children: ht.length > 0 ? ht.map((e) => /* @__PURE__ */ g("button", {
|
|
1228
1351
|
type: "button",
|
|
1229
1352
|
onClick: () => {
|
|
1230
|
-
De?.(e),
|
|
1353
|
+
De?.(e), N(!1), F("");
|
|
1231
1354
|
},
|
|
1232
1355
|
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",
|
|
1233
1356
|
children: [
|
|
@@ -1245,7 +1368,7 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1245
1368
|
className: "px-3 py-2 text-xs text-text-muted",
|
|
1246
1369
|
children: [
|
|
1247
1370
|
"No sessions matching “",
|
|
1248
|
-
|
|
1371
|
+
P,
|
|
1249
1372
|
"”"
|
|
1250
1373
|
]
|
|
1251
1374
|
})
|
|
@@ -1253,69 +1376,69 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1253
1376
|
] })
|
|
1254
1377
|
]
|
|
1255
1378
|
}),
|
|
1256
|
-
|
|
1257
|
-
ref:
|
|
1379
|
+
I.visible && $ && /* @__PURE__ */ g("div", {
|
|
1380
|
+
ref: et,
|
|
1258
1381
|
className: "fixed bg-bg-elevated border border-border-default rounded-lg shadow-lg z-[100] min-w-[180px] py-1",
|
|
1259
1382
|
style: {
|
|
1260
|
-
top:
|
|
1261
|
-
left:
|
|
1383
|
+
top: I.y,
|
|
1384
|
+
left: I.x
|
|
1262
1385
|
},
|
|
1263
1386
|
children: [
|
|
1264
|
-
|
|
1387
|
+
Oe && /* @__PURE__ */ g("button", {
|
|
1265
1388
|
type: "button",
|
|
1266
|
-
onClick: () =>
|
|
1389
|
+
onClick: () => Q($.sessionId),
|
|
1267
1390
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
1268
|
-
children: [/* @__PURE__ */ h(
|
|
1391
|
+
children: [/* @__PURE__ */ h(ne, { className: "size-3.5" }), "Rename"]
|
|
1269
1392
|
}),
|
|
1270
1393
|
$.terminalUrl && /* @__PURE__ */ g("button", {
|
|
1271
1394
|
type: "button",
|
|
1272
1395
|
onClick: () => {
|
|
1273
|
-
we($.sessionId),
|
|
1396
|
+
we($.sessionId), L((e) => ({
|
|
1274
1397
|
...e,
|
|
1275
1398
|
visible: !1
|
|
1276
1399
|
}));
|
|
1277
1400
|
},
|
|
1278
1401
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
1279
|
-
children: [/* @__PURE__ */ h(
|
|
1402
|
+
children: [/* @__PURE__ */ h(ie, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.openInNewTab", "Open in New Tab")]
|
|
1280
1403
|
}),
|
|
1281
|
-
|
|
1282
|
-
|
|
1404
|
+
jt($.sessionId),
|
|
1405
|
+
Me && /* @__PURE__ */ g("button", {
|
|
1283
1406
|
type: "button",
|
|
1284
1407
|
onClick: () => {
|
|
1285
|
-
|
|
1408
|
+
Me($.sessionId), L((e) => ({
|
|
1286
1409
|
...e,
|
|
1287
1410
|
visible: !1
|
|
1288
1411
|
}));
|
|
1289
1412
|
},
|
|
1290
1413
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
1291
|
-
children: [$.pinned ? /* @__PURE__ */ h(de, { className: "size-3.5" }) : /* @__PURE__ */ h(ue, { className: "size-3.5" }), $.pinned ?
|
|
1414
|
+
children: [$.pinned ? /* @__PURE__ */ h(de, { className: "size-3.5" }) : /* @__PURE__ */ h(ue, { className: "size-3.5" }), $.pinned ? A("vibecontrols.sessions.terminal.unpinTab", "Unpin Tab") : A("vibecontrols.sessions.terminal.pinTab", "Pin Tab")]
|
|
1292
1415
|
}),
|
|
1293
1416
|
$.terminalUrl && /* @__PURE__ */ g("button", {
|
|
1294
1417
|
type: "button",
|
|
1295
1418
|
onClick: () => {
|
|
1296
|
-
|
|
1419
|
+
Z($.sessionId), L((e) => ({
|
|
1297
1420
|
...e,
|
|
1298
1421
|
visible: !1
|
|
1299
1422
|
}));
|
|
1300
1423
|
},
|
|
1301
|
-
className: `flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-bg-sunken transition-colors ${
|
|
1302
|
-
children: [/* @__PURE__ */ h(
|
|
1424
|
+
className: `flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-bg-sunken transition-colors ${V[$.sessionId] === "error" ? "text-status-warning-text" : "text-text-primary"}`,
|
|
1425
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.reconnect", "Reconnect")]
|
|
1303
1426
|
}),
|
|
1304
|
-
|
|
1427
|
+
S && /* @__PURE__ */ g("button", {
|
|
1305
1428
|
type: "button",
|
|
1306
1429
|
onClick: () => {
|
|
1307
|
-
|
|
1430
|
+
S($.sessionId), L((e) => ({
|
|
1308
1431
|
...e,
|
|
1309
1432
|
visible: !1
|
|
1310
1433
|
}));
|
|
1311
1434
|
},
|
|
1312
1435
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
1313
|
-
children: [/* @__PURE__ */ h(
|
|
1436
|
+
children: [/* @__PURE__ */ h(d, { className: "size-3.5" }), "Restart Terminal"]
|
|
1314
1437
|
}),
|
|
1315
|
-
|
|
1438
|
+
ke && /* @__PURE__ */ g("button", {
|
|
1316
1439
|
type: "button",
|
|
1317
1440
|
onClick: () => {
|
|
1318
|
-
|
|
1441
|
+
ke($.sessionId), L((e) => ({
|
|
1319
1442
|
...e,
|
|
1320
1443
|
visible: !1
|
|
1321
1444
|
}));
|
|
@@ -1326,27 +1449,27 @@ function _({ tabs: _, activeTabId: xe, onTabSelect: Se, onTabClose: Ce, onOpenEx
|
|
|
1326
1449
|
C && /* @__PURE__ */ g("button", {
|
|
1327
1450
|
type: "button",
|
|
1328
1451
|
onClick: () => {
|
|
1329
|
-
|
|
1452
|
+
dt($.sessionId), L((e) => ({
|
|
1330
1453
|
...e,
|
|
1331
1454
|
visible: !1
|
|
1332
1455
|
}));
|
|
1333
1456
|
},
|
|
1334
|
-
disabled:
|
|
1457
|
+
disabled: B.has($.sessionId),
|
|
1335
1458
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-error-text hover:bg-status-error-bg/15 transition-colors disabled:opacity-60 disabled:cursor-not-allowed",
|
|
1336
|
-
"aria-busy":
|
|
1337
|
-
children: [
|
|
1459
|
+
"aria-busy": B.has($.sessionId),
|
|
1460
|
+
children: [B.has($.sessionId) ? /* @__PURE__ */ h(l, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ h(f, { className: "size-3.5 fill-current" }), B.has($.sessionId) ? A("vibecontrols.sessions.terminal.stoppingSession", "Stopping…") : A("vibecontrols.sessions.terminal.stopSession", "Stop Session")]
|
|
1338
1461
|
}),
|
|
1339
1462
|
/* @__PURE__ */ h("div", { className: "border-t border-border-subtle my-1" }),
|
|
1340
1463
|
/* @__PURE__ */ g("button", {
|
|
1341
1464
|
type: "button",
|
|
1342
1465
|
onClick: () => {
|
|
1343
|
-
|
|
1466
|
+
v($.sessionId), L((e) => ({
|
|
1344
1467
|
...e,
|
|
1345
1468
|
visible: !1
|
|
1346
1469
|
}));
|
|
1347
1470
|
},
|
|
1348
1471
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-status-error-text hover:bg-bg-sunken transition-colors",
|
|
1349
|
-
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }),
|
|
1472
|
+
children: [/* @__PURE__ */ h(m, { className: "size-3.5" }), A("vibecontrols.sessions.terminal.closeTab", "Close Tab")]
|
|
1350
1473
|
})
|
|
1351
1474
|
]
|
|
1352
1475
|
})
|