@burdenoff/microfe-vibecontrols 2026.514.1 → 2026.514.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/AgentForm.js.map +1 -1
- package/dist/generated/wspace-operations.js +886 -869
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/pages/SessionsPage.js +651 -613
- package/dist/pages/SessionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useAdoptAgentSessionMutation as e, useAgentSessionOrphansLazyQuery as t, useBulkRestartSessionsMutation as n, useBulkStopSessionsMutation as r, useBulkTerminateSessionsMutation as i, useCheckSessionHealthMutation as
|
|
1
|
+
import { useAdoptAgentSessionMutation as e, useAgentSessionOrphansLazyQuery as t, useBulkRestartSessionsMutation as n, useBulkStopSessionsMutation as r, useBulkTerminateSessionsMutation as i, useCheckSessionHealthMutation as a, useCreateSessionMutation as o, useExportSessionsMutation as s, useListSessionsQuery as ee, useRestartSessionMutation as te, useRestartSessionTerminalMutation as ne, useSessionStatusChangedSubscription as re, useStartSessionMutation as ie, useStartSessionTerminalMutation as ae, useStopSessionMutation as oe, useStopSessionTerminalMutation as se, useTerminateSessionMutation as ce, useUpdateSessionMutation as le, useVibecontrolsAgentHealthProbeStreamSubscription as ue, useVibecontrolsAgentHealthProbesQuery as de } from "../generated/wspace-operations.js";
|
|
2
2
|
import { useVibeControls as fe, useVibeNavigate as pe } from "../providers/VibeControlsProvider.js";
|
|
3
3
|
import { useVibeControlsStore as me } from "../store/vibeControlsStore.js";
|
|
4
4
|
import he from "../hooks/useCachedInitialData.js";
|
|
@@ -6,33 +6,33 @@ import { PageHeader as ge } from "../components/shared/PageHeader.js";
|
|
|
6
6
|
import { LoadingState as _e } from "../components/shared/LoadingState.js";
|
|
7
7
|
import { ErrorState as ve } from "../components/shared/ErrorState.js";
|
|
8
8
|
import { ConfirmDialog as ye } from "../components/shared/ConfirmDialog.js";
|
|
9
|
-
import { getQuotaDialogContent as be, isQuotaExhaustedError as
|
|
9
|
+
import { getQuotaDialogContent as be, isQuotaExhaustedError as c } from "../utils/quotaUtils.js";
|
|
10
10
|
import { EmptyState as xe } from "../components/shared/EmptyState.js";
|
|
11
11
|
import { SearchInput as Se } from "../components/shared/SearchInput.js";
|
|
12
|
-
import { FilterDropdown as
|
|
12
|
+
import { FilterDropdown as l } from "../components/shared/FilterDropdown.js";
|
|
13
13
|
import { AgentSetupBanner as Ce } from "../components/shared/AgentSetupBanner.js";
|
|
14
14
|
import { GetHelpButton as we } from "../components/shared/GetHelpButton.js";
|
|
15
|
-
import { SearchableSelect as
|
|
16
|
-
import
|
|
15
|
+
import { SearchableSelect as u } from "../components/shared/SearchableSelect.js";
|
|
16
|
+
import Te from "../components/shared/SessionNotificationBanner.js";
|
|
17
17
|
import "../components/shared/index.js";
|
|
18
|
-
import { VIBE_PERMISSIONS as
|
|
18
|
+
import { VIBE_PERMISSIONS as Ee } from "../constants/permissions.js";
|
|
19
19
|
import { SessionCard as De } from "../components/sessions/SessionCard.js";
|
|
20
20
|
import { SessionList as Oe } from "../components/sessions/SessionList.js";
|
|
21
21
|
import { TerminalPanel as ke } from "../components/sessions/TerminalPanel.js";
|
|
22
22
|
import { SessionShareDialog as Ae } from "../components/sessions/SessionShareDialog.js";
|
|
23
23
|
import "../components/sessions/index.js";
|
|
24
|
-
import { useCallback as
|
|
24
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
25
25
|
import { useI18n as je } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
26
|
-
import { Activity as Me, CheckSquare as Ne,
|
|
27
|
-
import { useSearchParams as
|
|
28
|
-
import { usePermissions as
|
|
29
|
-
import { AnimatePresence as
|
|
30
|
-
import { jsx as
|
|
31
|
-
import { MotionItem as
|
|
32
|
-
import { AccessDenied as
|
|
26
|
+
import { Activity as Me, CheckSquare as Ne, Download as Pe, Grid as Fe, List as Ie, Monitor as Le, Play as Re, Plus as ze, RefreshCw as Be, RotateCcw as Ve, Square as He, Terminal as Ue, Trash2 as We, XSquare as Ge } from "lucide-react";
|
|
27
|
+
import { useSearchParams as Ke } from "react-router-dom";
|
|
28
|
+
import { usePermissions as qe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
29
|
+
import { AnimatePresence as Je } from "framer-motion";
|
|
30
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
31
|
+
import { MotionItem as Ye, MotionList as Xe, MotionPage as v } from "@burdenoff/fe-libs/shared/motion";
|
|
32
|
+
import { AccessDenied as Ze, PermissionButton as Qe } from "@burdenoff/fe-libs/shared/components";
|
|
33
33
|
//#region src/pages/SessionsPage.tsx
|
|
34
|
-
var
|
|
35
|
-
function
|
|
34
|
+
var $e = 3e5;
|
|
35
|
+
function et(e, t) {
|
|
36
36
|
if (!e) return null;
|
|
37
37
|
try {
|
|
38
38
|
let n = new URL(e);
|
|
@@ -49,7 +49,7 @@ function $e(e, t) {
|
|
|
49
49
|
return e;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function tt(e, t, n, r) {
|
|
53
53
|
if (e !== "RUNNING") return e;
|
|
54
54
|
if (r === !1) return "ERROR";
|
|
55
55
|
if (!t) return e;
|
|
@@ -62,220 +62,220 @@ function et(e, t, n, r) {
|
|
|
62
62
|
}
|
|
63
63
|
return e;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
let { t:
|
|
67
|
-
let r =
|
|
65
|
+
function nt() {
|
|
66
|
+
let { t: nt } = je(), { onSessionStart: rt, workspaceId: it } = fe(), at = pe(), { hasPermission: ot, isLoading: st, permissions: ct } = qe(), [y, lt] = Ke(), b = d((e, t, n) => {
|
|
67
|
+
let r = nt(e, n), i = r === e ? t : r;
|
|
68
68
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
69
|
-
}, [
|
|
69
|
+
}, [nt]), ut = p(() => [
|
|
70
70
|
{
|
|
71
71
|
value: "all",
|
|
72
|
-
label:
|
|
72
|
+
label: b("sessions.statusAll", "All Statuses")
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
value: "RUNNING",
|
|
76
|
-
label:
|
|
76
|
+
label: b("sessions.running", "Running")
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
value: "STOPPED",
|
|
80
|
-
label:
|
|
80
|
+
label: b("sessions.stopped", "Stopped")
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
value: "STARTING",
|
|
84
|
-
label:
|
|
84
|
+
label: b("sessions.starting", "Starting")
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
value: "ERROR",
|
|
88
|
-
label:
|
|
88
|
+
label: b("common.error", "Error")
|
|
89
89
|
}
|
|
90
|
-
], [
|
|
90
|
+
], [b]), dt = p(() => [
|
|
91
91
|
{
|
|
92
92
|
value: "all",
|
|
93
|
-
label:
|
|
93
|
+
label: b("sessions.typeAll", "All Types")
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
value: "TMUX",
|
|
97
|
-
label:
|
|
97
|
+
label: b("sessions.typeTmux", "Tmux")
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
value: "TERMINAL",
|
|
101
|
-
label:
|
|
101
|
+
label: b("sessions.typeTerminal", "Terminal")
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
value: "SCRIPT",
|
|
105
|
-
label:
|
|
105
|
+
label: b("sessions.typeScript", "Script")
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
value: "CUSTOM",
|
|
109
|
-
label:
|
|
109
|
+
label: b("sessions.typeCustom", "Custom")
|
|
110
110
|
}
|
|
111
|
-
], [
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
], [b]), ft = ot(Ee.SESSION_LIST), pt = ot(Ee.SESSION_CREATE), [x, mt] = h(""), [S, ht] = h("all"), [C, gt] = h("all"), [w, _t] = h("all"), [T, vt] = h("all"), [E, D] = h("terminal"), [yt, O] = h(!1), [bt, k] = h(!1), [xt, A] = h(null), [St, Ct] = h(!1), [j, M] = h(null), [N, P] = h(/* @__PURE__ */ new Set()), [wt, F] = h(!1), [Tt, Et] = h(!1), Dt = m(null), Ot = m(null), kt = m(null), At = m(null), [jt, Mt] = h(""), [Nt, Pt] = h(""), [I, Ft] = h("TMUX"), [It, Lt] = h(!1), { terminalTabs: Rt, activeTerminalTabId: zt, sessionsViewMode: Bt, setTerminalTabs: Vt, setActiveTerminalTabId: Ht, setSessionsViewMode: Ut, activeSessionId: L } = me(), [R, z] = h([]), [B, V] = h(null), [Wt, H] = h(!1), [Gt, Kt] = h(null), [qt, Jt] = h(!1), [U, Yt] = h(!1), W = y.get("view"), Xt = y.get("session"), [Zt] = o({ refetchQueries: ["ListSessions"] }), [Qt, $t] = h(!1), [en, tn] = h(""), [nn, rn] = h(null), [an, on] = h(null), [sn, { data: cn, loading: ln }] = t({ fetchPolicy: "network-only" }), [un] = e({ refetchQueries: ["ListSessions"] }), [dn] = ie({ refetchQueries: ["ListSessions"] }), [fn] = oe({ refetchQueries: ["ListSessions"] }), [pn] = te({ refetchQueries: ["ListSessions"] }), [G] = ae({ refetchQueries: ["ListSessions"] }), [mn] = se({ refetchQueries: ["ListSessions"] }), [hn] = ne({ refetchQueries: ["ListSessions"] }), [gn] = le({ refetchQueries: ["ListSessions"] }), [_n] = ce({ refetchQueries: ["ListSessions"] }), [vn] = a({ refetchQueries: ["ListSessions"] }), [yn] = r({ refetchQueries: ["ListSessions"] }), [bn] = n({ refetchQueries: ["ListSessions"] }), [xn] = i({ refetchQueries: ["ListSessions"] }), [Sn] = s();
|
|
112
|
+
f(() => {
|
|
113
|
+
U || (W === "terminal" || W === "grid" || W === "list" ? D(W) : Bt && D(Bt), Xt ? V(Xt) : zt && V(zt), Rt.length > 0 && z(Rt.map((e) => ({
|
|
114
114
|
sessionId: e.sessionId,
|
|
115
115
|
name: e.name,
|
|
116
116
|
terminalUrl: null,
|
|
117
117
|
loading: !1,
|
|
118
118
|
error: null
|
|
119
|
-
}))),
|
|
119
|
+
}))), Yt(!0));
|
|
120
120
|
}, [
|
|
121
|
-
It,
|
|
122
|
-
Lt,
|
|
123
121
|
Rt,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
zt,
|
|
123
|
+
Bt,
|
|
124
|
+
Xt,
|
|
125
|
+
W,
|
|
126
|
+
U
|
|
127
127
|
]);
|
|
128
|
-
let
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
let Cn = m(!1);
|
|
129
|
+
f(() => {
|
|
130
|
+
U && Vt(R.map((e) => ({
|
|
131
131
|
sessionId: e.sessionId,
|
|
132
132
|
name: e.name
|
|
133
133
|
})));
|
|
134
|
-
}, [
|
|
135
|
-
I,
|
|
136
|
-
V,
|
|
137
|
-
zt
|
|
138
|
-
]), d(() => {
|
|
139
|
-
V && Bt(R);
|
|
140
134
|
}, [
|
|
141
135
|
R,
|
|
142
|
-
|
|
143
|
-
Bt
|
|
144
|
-
]), d(() => {
|
|
145
|
-
V && Vt(w);
|
|
146
|
-
}, [
|
|
147
|
-
w,
|
|
148
|
-
V,
|
|
136
|
+
U,
|
|
149
137
|
Vt
|
|
150
|
-
]),
|
|
151
|
-
|
|
152
|
-
let e = new URLSearchParams(ct), t = !1, n = w === "terminal" ? null : w;
|
|
153
|
-
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), R ? e.get("session") !== R && (e.set("session", R), t = !0) : e.has("session") && (e.delete("session"), t = !0), t && lt(e, { replace: !0 });
|
|
138
|
+
]), f(() => {
|
|
139
|
+
U && Ht(B);
|
|
154
140
|
}, [
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
B,
|
|
142
|
+
U,
|
|
143
|
+
Ht
|
|
144
|
+
]), f(() => {
|
|
145
|
+
U && Ut(E);
|
|
146
|
+
}, [
|
|
147
|
+
E,
|
|
148
|
+
U,
|
|
149
|
+
Ut
|
|
150
|
+
]), f(() => {
|
|
151
|
+
if (!U) return;
|
|
152
|
+
let e = new URLSearchParams(y), t = !1, n = E === "terminal" ? null : E;
|
|
153
|
+
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), B ? e.get("session") !== B && (e.set("session", B), t = !0) : e.has("session") && (e.delete("session"), t = !0), t && lt(e, { replace: !0 });
|
|
154
|
+
}, [
|
|
155
|
+
B,
|
|
156
|
+
y,
|
|
157
157
|
lt,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
U,
|
|
159
|
+
E
|
|
160
160
|
]);
|
|
161
|
-
let K =
|
|
161
|
+
let K = m(null);
|
|
162
162
|
re({
|
|
163
|
-
skip: !
|
|
164
|
-
variables: { workspaceId:
|
|
165
|
-
}),
|
|
163
|
+
skip: !it,
|
|
164
|
+
variables: { workspaceId: it || "" }
|
|
165
|
+
}), f(() => {
|
|
166
166
|
let e = setInterval(() => {
|
|
167
|
-
|
|
168
|
-
},
|
|
167
|
+
vn().catch(() => {});
|
|
168
|
+
}, $e);
|
|
169
169
|
return () => clearInterval(e);
|
|
170
|
-
}, [
|
|
170
|
+
}, [vn]), f(() => {
|
|
171
171
|
let e = (e) => {
|
|
172
172
|
let t = e.target;
|
|
173
173
|
if (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable) return;
|
|
174
174
|
let n = e.metaKey || e.ctrlKey;
|
|
175
175
|
if (n && e.key === "t") {
|
|
176
|
-
e.preventDefault(),
|
|
176
|
+
e.preventDefault(), O(!0);
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
if (n && e.key === "w" &&
|
|
179
|
+
if (n && e.key === "w" && B) {
|
|
180
180
|
e.preventDefault();
|
|
181
|
-
let t =
|
|
182
|
-
|
|
183
|
-
let e =
|
|
181
|
+
let t = B;
|
|
182
|
+
z((e) => e.filter((e) => e.sessionId !== t)), V(() => {
|
|
183
|
+
let e = R.filter((e) => e.sessionId !== t);
|
|
184
184
|
return e.length > 0 ? e[e.length - 1].sessionId : null;
|
|
185
185
|
});
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey &&
|
|
189
|
-
e.preventDefault(),
|
|
188
|
+
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey && R.length > 1) {
|
|
189
|
+
e.preventDefault(), V(R[(R.findIndex((e) => e.sessionId === B) + 1) % R.length].sessionId);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
if (e.ctrlKey && e.key === "Tab" && e.shiftKey &&
|
|
193
|
-
e.preventDefault(),
|
|
192
|
+
if (e.ctrlKey && e.key === "Tab" && e.shiftKey && R.length > 1) {
|
|
193
|
+
e.preventDefault(), V(R[(R.findIndex((e) => e.sessionId === B) - 1 + R.length) % R.length].sessionId);
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
198
|
-
}, [
|
|
199
|
-
let { data:
|
|
198
|
+
}, [B, R]);
|
|
199
|
+
let { data: wn, previousData: Tn, loading: q, error: En, refetch: J } = ee({
|
|
200
200
|
variables: {
|
|
201
201
|
filter: {
|
|
202
|
-
status:
|
|
203
|
-
type:
|
|
204
|
-
vibeId:
|
|
205
|
-
agentId:
|
|
202
|
+
status: S === "all" ? void 0 : S,
|
|
203
|
+
type: C === "all" ? void 0 : C,
|
|
204
|
+
vibeId: w !== "all" && w !== "none" ? w : void 0,
|
|
205
|
+
agentId: T === "all" ? void 0 : T
|
|
206
206
|
},
|
|
207
207
|
pagination: { limit: 50 }
|
|
208
208
|
},
|
|
209
209
|
fetchPolicy: "cache-first"
|
|
210
|
-
}),
|
|
211
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
210
|
+
}), Dn = wn ?? Tn, { agents: On, vibes: Y } = he(), kn = de({ fetchPolicy: "cache-and-network" }), { data: An } = ue(), jn = p(() => {
|
|
211
|
+
let e = /* @__PURE__ */ new Map(), t = An?.vibecontrolsAgentHealthProbeStream ?? kn.data?.vibecontrolsAgentHealthProbes ?? [];
|
|
212
212
|
for (let n of t) e.set(n.agentId, {
|
|
213
213
|
healthy: n.healthy,
|
|
214
214
|
error: n.errorMessage ?? null
|
|
215
215
|
});
|
|
216
216
|
return e;
|
|
217
|
-
}, [
|
|
217
|
+
}, [kn.data, An]), Mn = p(() => [
|
|
218
218
|
{
|
|
219
219
|
value: "all",
|
|
220
|
-
label:
|
|
220
|
+
label: b("sessions.filterVibeAll", "All Vibes")
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
value: "none",
|
|
224
|
-
label:
|
|
224
|
+
label: b("sessions.filterVibeNone", "No Vibe")
|
|
225
225
|
},
|
|
226
226
|
...Y.map((e) => ({
|
|
227
227
|
value: e.id,
|
|
228
228
|
label: e.name
|
|
229
229
|
}))
|
|
230
|
-
], [Y,
|
|
230
|
+
], [Y, b]), Nn = p(() => [{
|
|
231
231
|
value: "all",
|
|
232
|
-
label:
|
|
233
|
-
}, ...
|
|
232
|
+
label: b("sessions.filterAgentAll", "All Agents")
|
|
233
|
+
}, ...On.map((e) => ({
|
|
234
234
|
value: e.id,
|
|
235
|
-
label: `${e.name} ${e.isActive ? "" : `(${
|
|
236
|
-
}))], [
|
|
235
|
+
label: `${e.name} ${e.isActive ? "" : `(${b("sessions.offline", "Offline")})`}`
|
|
236
|
+
}))], [On, b]), Pn = p(() => [{
|
|
237
237
|
value: "",
|
|
238
|
-
label:
|
|
238
|
+
label: b("sessions.noVibe", "No vibe")
|
|
239
239
|
}, ...Y.map((e) => ({
|
|
240
240
|
value: e.id,
|
|
241
241
|
label: e.name
|
|
242
|
-
}))], [Y,
|
|
242
|
+
}))], [Y, b]), Fn = p(() => [{
|
|
243
243
|
value: "",
|
|
244
|
-
label:
|
|
245
|
-
}, ...
|
|
244
|
+
label: b("sessions.selectAgent", "Select an agent")
|
|
245
|
+
}, ...On.map((e) => ({
|
|
246
246
|
value: e.id,
|
|
247
|
-
label: `${e.name} ${e.isActive ? `(${
|
|
248
|
-
}))], [
|
|
247
|
+
label: `${e.name} ${e.isActive ? `(${b("sessions.active", "Active")})` : `(${b("sessions.offline", "Offline")})`}`
|
|
248
|
+
}))], [On, b]), In = p(() => [
|
|
249
249
|
{
|
|
250
250
|
value: "TMUX",
|
|
251
|
-
label:
|
|
251
|
+
label: b("sessions.typeTmuxLower", "tmux")
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
value: "WEZTERM",
|
|
255
|
-
label:
|
|
255
|
+
label: b("sessions.typeWezTerm", "WezTerm")
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
value: "ZELLIJ",
|
|
259
|
-
label:
|
|
259
|
+
label: b("sessions.typeZellij", "Zellij")
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
value: "TERMINAL",
|
|
263
|
-
label:
|
|
263
|
+
label: b("sessions.typeTerminal", "Terminal")
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
value: "SSH",
|
|
267
|
-
label:
|
|
267
|
+
label: b("sessions.typeSsh", "SSH")
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
value: "SCRIPT",
|
|
271
|
-
label:
|
|
271
|
+
label: b("sessions.typeScript", "Script")
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
value: "CUSTOM",
|
|
275
|
-
label:
|
|
275
|
+
label: b("sessions.typeCustom", "Custom")
|
|
276
276
|
}
|
|
277
|
-
], [
|
|
278
|
-
let t =
|
|
277
|
+
], [b]), X = p(() => (Dn?.sessions?.items ?? []).map((e) => {
|
|
278
|
+
let t = et(e.ttydUrl || null, e.agent?.tunnelUrl || null);
|
|
279
279
|
return {
|
|
280
280
|
id: e.id,
|
|
281
281
|
workspaceId: e.workspaceId,
|
|
@@ -283,7 +283,7 @@ function tt() {
|
|
|
283
283
|
agentId: e.agentId || null,
|
|
284
284
|
name: e.name,
|
|
285
285
|
type: e.type,
|
|
286
|
-
status:
|
|
286
|
+
status: tt(e.status, e.ttydUrl || null, t, e.agent?.isActive),
|
|
287
287
|
command: e.command || null,
|
|
288
288
|
workingDirectory: e.workingDirectory || null,
|
|
289
289
|
environmentVariables: e.environmentVariables || {},
|
|
@@ -308,20 +308,20 @@ function tt() {
|
|
|
308
308
|
isActive: e.agent.isActive
|
|
309
309
|
} : void 0
|
|
310
310
|
};
|
|
311
|
-
}), [
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
}), [Dn?.sessions?.items]);
|
|
312
|
+
f(() => {
|
|
313
|
+
Cn.current || X.length === 0 || R.length === 0 || (Cn.current = !0, Promise.allSettled(R.map(async (e) => {
|
|
314
314
|
let t = X.find((t) => t.id === e.sessionId);
|
|
315
315
|
if (t) try {
|
|
316
|
-
let n = await G({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i =
|
|
317
|
-
|
|
316
|
+
let n = await G({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i = et(n.data?.startSessionTerminal?.ttydUrl ?? null, r);
|
|
317
|
+
z((t) => t.map((t) => t.sessionId === e.sessionId ? {
|
|
318
318
|
...t,
|
|
319
319
|
terminalUrl: i,
|
|
320
320
|
loading: !1,
|
|
321
321
|
error: null
|
|
322
322
|
} : t));
|
|
323
323
|
} catch (n) {
|
|
324
|
-
console.warn("[sessions] tab restore startSessionTerminal failed", n),
|
|
324
|
+
console.warn("[sessions] tab restore startSessionTerminal failed", n), z((n) => n.map((n) => n.sessionId === e.sessionId && t.ttydUrl ? {
|
|
325
325
|
...n,
|
|
326
326
|
terminalUrl: t.ttydUrl,
|
|
327
327
|
loading: !1
|
|
@@ -330,21 +330,21 @@ function tt() {
|
|
|
330
330
|
})));
|
|
331
331
|
}, [
|
|
332
332
|
X,
|
|
333
|
-
|
|
333
|
+
R,
|
|
334
334
|
G
|
|
335
|
-
]),
|
|
336
|
-
if (!
|
|
337
|
-
K.current =
|
|
335
|
+
]), f(() => {
|
|
336
|
+
if (!U || !L) {
|
|
337
|
+
K.current = L;
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
|
-
if (K.current === null &&
|
|
341
|
-
K.current =
|
|
340
|
+
if (K.current === null && L) {
|
|
341
|
+
K.current = L;
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
if (K.current ===
|
|
345
|
-
K.current =
|
|
346
|
-
let e = X.find((e) => e.id ===
|
|
347
|
-
if (e) if (
|
|
344
|
+
if (K.current === L) return;
|
|
345
|
+
K.current = L;
|
|
346
|
+
let e = X.find((e) => e.id === L);
|
|
347
|
+
if (e) if (R.find((e) => e.sessionId === L)) V(L), H(!1);
|
|
348
348
|
else {
|
|
349
349
|
let t = e.ttydUrl || null, n = {
|
|
350
350
|
sessionId: e.id,
|
|
@@ -353,17 +353,17 @@ function tt() {
|
|
|
353
353
|
loading: !t,
|
|
354
354
|
error: null
|
|
355
355
|
};
|
|
356
|
-
|
|
356
|
+
z((e) => [...e, n]), V(L), H(!1), t || G({ variables: { id: e.id } }).then((t) => {
|
|
357
357
|
let n = t.data?.startSessionTerminal?.ttydUrl || null;
|
|
358
|
-
|
|
358
|
+
z((t) => t.map((t) => t.sessionId === e.id ? {
|
|
359
359
|
...t,
|
|
360
360
|
terminalUrl: n,
|
|
361
361
|
loading: !1,
|
|
362
|
-
error: n ? null :
|
|
362
|
+
error: n ? null : b("sessions.terminalStartedNoUrl", "Terminal started but no URL was returned. Try restarting.")
|
|
363
363
|
} : t));
|
|
364
364
|
}).catch((t) => {
|
|
365
|
-
let n = t instanceof Error ? t.message :
|
|
366
|
-
|
|
365
|
+
let n = t instanceof Error ? t.message : b("sessions.failedStartTerminal", "Failed to start terminal");
|
|
366
|
+
z((t) => t.map((t) => t.sessionId === e.id ? {
|
|
367
367
|
...t,
|
|
368
368
|
loading: !1,
|
|
369
369
|
error: n
|
|
@@ -371,186 +371,216 @@ function tt() {
|
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
}, [
|
|
374
|
-
|
|
374
|
+
L,
|
|
375
375
|
X,
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
R,
|
|
377
|
+
U,
|
|
378
378
|
G
|
|
379
379
|
]);
|
|
380
|
-
let Z =
|
|
381
|
-
if (
|
|
382
|
-
let t =
|
|
380
|
+
let Z = p(() => X.filter((e) => {
|
|
381
|
+
if (x) {
|
|
382
|
+
let t = x.toLowerCase();
|
|
383
383
|
if (!(e.name.toLowerCase().includes(t) || e.command?.toLowerCase().includes(t) || e.workingDirectory?.toLowerCase().includes(t))) return !1;
|
|
384
384
|
}
|
|
385
|
-
return !(
|
|
385
|
+
return !(w === "none" && e.vibeId);
|
|
386
386
|
}), [
|
|
387
387
|
X,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
]),
|
|
391
|
-
|
|
388
|
+
x,
|
|
389
|
+
w
|
|
390
|
+
]), Ln = d((e) => {
|
|
391
|
+
P((t) => {
|
|
392
392
|
let n = new Set(t);
|
|
393
393
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
394
394
|
});
|
|
395
|
-
}, []),
|
|
396
|
-
|
|
397
|
-
}, [Z]),
|
|
398
|
-
|
|
399
|
-
}, []),
|
|
400
|
-
if (
|
|
401
|
-
|
|
395
|
+
}, []), Rn = d(() => {
|
|
396
|
+
P(new Set(Z.map((e) => e.id)));
|
|
397
|
+
}, [Z]), zn = d(() => {
|
|
398
|
+
P(/* @__PURE__ */ new Set());
|
|
399
|
+
}, []), Bn = Z.length > 0 && N.size === Z.length, Vn = N.size > 0, Hn = d(async () => {
|
|
400
|
+
if (N.size !== 0) {
|
|
401
|
+
F(!0);
|
|
402
402
|
try {
|
|
403
|
-
let e = (await
|
|
404
|
-
|
|
403
|
+
let e = (await yn({ variables: { ids: Array.from(N) } })).data?.bulkStopSessions;
|
|
404
|
+
M(`${b("sessions.stopped", "Stopped")} ${e?.succeeded ?? 0} ${b("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${b("sessions.failed", "failed")}` : ""}`), P(/* @__PURE__ */ new Set()), setTimeout(() => M(null), 3e3);
|
|
405
405
|
} catch (e) {
|
|
406
|
-
|
|
406
|
+
M(`${b("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : b("sessions.failedStop", "Failed to stop sessions")}`), setTimeout(() => M(null), 5e3);
|
|
407
407
|
} finally {
|
|
408
|
-
|
|
408
|
+
F(!1);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
}, [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
]),
|
|
416
|
-
if (
|
|
417
|
-
|
|
412
|
+
N,
|
|
413
|
+
yn,
|
|
414
|
+
b
|
|
415
|
+
]), Un = d(async () => {
|
|
416
|
+
if (N.size !== 0) {
|
|
417
|
+
F(!0);
|
|
418
418
|
try {
|
|
419
|
-
let e = (await
|
|
420
|
-
|
|
419
|
+
let e = (await bn({ variables: { ids: Array.from(N) } })).data?.bulkRestartSessions;
|
|
420
|
+
M(`${b("sessions.restarted", "Restarted")} ${e?.succeeded ?? 0} ${b("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${b("sessions.failed", "failed")}` : ""}`), P(/* @__PURE__ */ new Set()), setTimeout(() => M(null), 3e3);
|
|
421
421
|
} catch (e) {
|
|
422
|
-
|
|
422
|
+
M(`${b("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : b("sessions.failedRestart", "Failed to restart sessions")}`), setTimeout(() => M(null), 5e3);
|
|
423
423
|
} finally {
|
|
424
|
-
|
|
424
|
+
F(!1);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
}, [
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
]),
|
|
432
|
-
if (
|
|
433
|
-
|
|
428
|
+
N,
|
|
429
|
+
bn,
|
|
430
|
+
b
|
|
431
|
+
]), Wn = d(async () => {
|
|
432
|
+
if (N.size !== 0 && confirm(`${b("sessions.confirmRemovePrefix", "Are you sure you want to remove")} ${N.size} ${b("nav.sessions", "session(s)")}? ${b("sessions.confirmRemoveSuffix", "This cannot be undone.")}`)) {
|
|
433
|
+
F(!0);
|
|
434
434
|
try {
|
|
435
|
-
let e = (await
|
|
436
|
-
|
|
435
|
+
let e = (await xn({ variables: { ids: Array.from(N) } })).data?.bulkTerminateSessions;
|
|
436
|
+
M(`${b("sessions.removed", "Removed")} ${e?.succeeded ?? 0} ${b("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${b("sessions.failed", "failed")}` : ""}`), P(/* @__PURE__ */ new Set()), setTimeout(() => M(null), 3e3);
|
|
437
437
|
} catch (e) {
|
|
438
|
-
|
|
438
|
+
M(`${b("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : b("sessions.failedRemove", "Failed to remove sessions")}`), setTimeout(() => M(null), 5e3);
|
|
439
439
|
} finally {
|
|
440
|
-
|
|
440
|
+
F(!1);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}, [
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
]),
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
444
|
+
N,
|
|
445
|
+
xn,
|
|
446
|
+
b
|
|
447
|
+
]), Gn = d(async (e = "CSV") => {
|
|
448
|
+
Et(!0);
|
|
449
|
+
try {
|
|
450
|
+
let t = (await Sn({ variables: { input: {
|
|
451
|
+
filter: {
|
|
452
|
+
status: S === "all" ? void 0 : S,
|
|
453
|
+
type: C === "all" ? void 0 : C,
|
|
454
|
+
vibeId: w !== "all" && w !== "none" ? w : void 0,
|
|
455
|
+
agentId: T === "all" ? void 0 : T
|
|
456
|
+
},
|
|
457
|
+
format: e
|
|
458
|
+
} } })).data?.exportSessions;
|
|
459
|
+
if (!t) return;
|
|
460
|
+
let n = e === "CSV" ? "text/csv" : "application/json", r = new Blob([t.data], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
461
|
+
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i), M(b("sessions.exportSuccess", "Exported {{count}} sessions as {{format}}", {
|
|
462
|
+
count: t.count,
|
|
463
|
+
format: e
|
|
464
|
+
})), setTimeout(() => M(null), 3e3);
|
|
465
|
+
} catch (e) {
|
|
466
|
+
M(`${b("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : b("sessions.failedExport", "Failed to export sessions")}`), setTimeout(() => M(null), 5e3);
|
|
467
|
+
} finally {
|
|
468
|
+
Et(!1);
|
|
469
|
+
}
|
|
470
|
+
}, [
|
|
471
|
+
Sn,
|
|
472
|
+
S,
|
|
473
|
+
C,
|
|
474
|
+
w,
|
|
475
|
+
T,
|
|
476
|
+
b
|
|
477
|
+
]), Kn = (e) => {
|
|
478
|
+
at(`/sessions/${e.id}`);
|
|
479
|
+
}, qn = () => {
|
|
480
|
+
A(null), O(!0);
|
|
481
|
+
}, Jn = async () => {
|
|
482
|
+
let e = Dt.current?.value?.trim(), t = jt, n = Nt, r = I, i = Ot.current?.value?.trim(), a = kt.current?.checked ?? !1;
|
|
453
483
|
if (!e) {
|
|
454
|
-
|
|
484
|
+
A(b("sessions.nameRequired", "Name is required"));
|
|
455
485
|
return;
|
|
456
486
|
}
|
|
457
|
-
let
|
|
458
|
-
if (!
|
|
459
|
-
|
|
487
|
+
let o = Y.find((e) => e.id === t)?.agentId || n;
|
|
488
|
+
if (!o) {
|
|
489
|
+
A(b("sessions.agentRequired", "Please select an agent for this session."));
|
|
460
490
|
return;
|
|
461
491
|
}
|
|
462
|
-
let
|
|
463
|
-
if (
|
|
464
|
-
|
|
492
|
+
let s = jn.get(o);
|
|
493
|
+
if (s && !s.healthy) {
|
|
494
|
+
A(b("sessions.agentNotHealthy", "The selected agent isn’t fully reachable right now. Please wait for the agent badge to turn green and retry.") + (s.error ? ` (${s.error})` : ""));
|
|
465
495
|
return;
|
|
466
496
|
}
|
|
467
|
-
Ct(!0),
|
|
497
|
+
Ct(!0), A(null);
|
|
468
498
|
try {
|
|
469
|
-
let n =
|
|
499
|
+
let n = At.current?.value?.trim() || void 0, s = await Zt({ variables: { input: {
|
|
470
500
|
name: e,
|
|
471
501
|
type: r || "TMUX",
|
|
472
502
|
command: i || void 0,
|
|
473
503
|
vibeId: t || void 0,
|
|
474
|
-
agentId:
|
|
475
|
-
autoStart:
|
|
504
|
+
agentId: o,
|
|
505
|
+
autoStart: a,
|
|
476
506
|
externalSessionName: n
|
|
477
507
|
} } });
|
|
478
|
-
|
|
479
|
-
id:
|
|
480
|
-
workspaceId:
|
|
481
|
-
vibeId:
|
|
482
|
-
agentId:
|
|
483
|
-
name:
|
|
484
|
-
type:
|
|
485
|
-
status:
|
|
486
|
-
command:
|
|
487
|
-
workingDirectory:
|
|
488
|
-
environmentVariables:
|
|
489
|
-
autoStart:
|
|
490
|
-
providerSessionName:
|
|
491
|
-
providerWindowName:
|
|
492
|
-
pid:
|
|
493
|
-
exitCode:
|
|
494
|
-
lastOutput:
|
|
495
|
-
ttydUrl:
|
|
496
|
-
metadata:
|
|
497
|
-
createdAt:
|
|
498
|
-
updatedAt:
|
|
508
|
+
O(!1), M(b("sessions.createdSuccess", "Session created successfully")), setTimeout(() => M(null), 3e3), E === "terminal" && s.data?.createSession && Q({
|
|
509
|
+
id: s.data.createSession.id,
|
|
510
|
+
workspaceId: s.data.createSession.workspaceId,
|
|
511
|
+
vibeId: s.data.createSession.vibeId || null,
|
|
512
|
+
agentId: s.data.createSession.agentId || null,
|
|
513
|
+
name: s.data.createSession.name,
|
|
514
|
+
type: s.data.createSession.type,
|
|
515
|
+
status: s.data.createSession.status,
|
|
516
|
+
command: s.data.createSession.command || null,
|
|
517
|
+
workingDirectory: s.data.createSession.workingDirectory || null,
|
|
518
|
+
environmentVariables: s.data.createSession.environmentVariables || {},
|
|
519
|
+
autoStart: s.data.createSession.autoStart,
|
|
520
|
+
providerSessionName: s.data.createSession.providerSessionName || void 0,
|
|
521
|
+
providerWindowName: s.data.createSession.providerWindowId || void 0,
|
|
522
|
+
pid: s.data.createSession.pid || null,
|
|
523
|
+
exitCode: s.data.createSession.exitCode || null,
|
|
524
|
+
lastOutput: s.data.createSession.lastOutput || null,
|
|
525
|
+
ttydUrl: s.data.createSession.ttydUrl || null,
|
|
526
|
+
metadata: s.data.createSession.metadata || {},
|
|
527
|
+
createdAt: s.data.createSession.createdAt,
|
|
528
|
+
updatedAt: s.data.createSession.updatedAt
|
|
499
529
|
});
|
|
500
530
|
} catch (e) {
|
|
501
|
-
if (
|
|
502
|
-
|
|
531
|
+
if (c(e)) {
|
|
532
|
+
O(!1), k(!0);
|
|
503
533
|
return;
|
|
504
534
|
}
|
|
505
|
-
|
|
535
|
+
A(e instanceof Error ? e.message : b("sessions.failedCreate", "Failed to create session"));
|
|
506
536
|
} finally {
|
|
507
537
|
Ct(!1);
|
|
508
538
|
}
|
|
509
|
-
},
|
|
539
|
+
}, Yn = async (e) => {
|
|
510
540
|
try {
|
|
511
|
-
await
|
|
541
|
+
await dn({ variables: { id: e.id } }), rt?.({
|
|
512
542
|
id: e.id,
|
|
513
543
|
name: e.name,
|
|
514
544
|
type: e.type,
|
|
515
545
|
status: "RUNNING"
|
|
516
546
|
});
|
|
517
547
|
} catch (e) {
|
|
518
|
-
if (
|
|
519
|
-
|
|
548
|
+
if (c(e)) {
|
|
549
|
+
k(!0);
|
|
520
550
|
return;
|
|
521
551
|
}
|
|
522
552
|
console.error("Failed to start session:", e);
|
|
523
553
|
}
|
|
524
|
-
},
|
|
554
|
+
}, Xn = async (e) => {
|
|
525
555
|
try {
|
|
526
|
-
await
|
|
556
|
+
await fn({ variables: { id: e.id } });
|
|
527
557
|
} catch (e) {
|
|
528
558
|
console.error("Failed to stop session:", e);
|
|
529
559
|
}
|
|
530
|
-
},
|
|
560
|
+
}, Zn = async (e) => {
|
|
531
561
|
try {
|
|
532
|
-
await
|
|
562
|
+
await pn({ variables: { id: e.id } });
|
|
533
563
|
} catch (e) {
|
|
534
|
-
if (
|
|
535
|
-
|
|
564
|
+
if (c(e)) {
|
|
565
|
+
k(!0);
|
|
536
566
|
return;
|
|
537
567
|
}
|
|
538
568
|
console.error("Failed to restart session:", e);
|
|
539
569
|
}
|
|
540
|
-
},
|
|
570
|
+
}, Qn = async (e) => {
|
|
541
571
|
try {
|
|
542
|
-
await
|
|
572
|
+
await _n({ variables: { id: e.id } });
|
|
543
573
|
} catch (e) {
|
|
544
574
|
console.error("Failed to terminate session:", e);
|
|
545
575
|
}
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
}, []), Q =
|
|
549
|
-
if (
|
|
550
|
-
|
|
576
|
+
}, $n = d((e) => e.ttydUrl || null, []), er = d((e) => {
|
|
577
|
+
Kt(e);
|
|
578
|
+
}, []), Q = d(async (e) => {
|
|
579
|
+
if (R.find((t) => t.sessionId === e.id)?.terminalUrl) {
|
|
580
|
+
V(e.id), H(!1);
|
|
551
581
|
return;
|
|
552
582
|
}
|
|
553
|
-
let t =
|
|
583
|
+
let t = $n(e);
|
|
554
584
|
if (t) {
|
|
555
585
|
let n = {
|
|
556
586
|
sessionId: e.id,
|
|
@@ -559,7 +589,7 @@ function tt() {
|
|
|
559
589
|
loading: !1,
|
|
560
590
|
error: null
|
|
561
591
|
};
|
|
562
|
-
|
|
592
|
+
z((t) => [...t.filter((t) => t.sessionId !== e.id), n]), V(e.id), H(!1);
|
|
563
593
|
return;
|
|
564
594
|
}
|
|
565
595
|
let n = {
|
|
@@ -569,560 +599,568 @@ function tt() {
|
|
|
569
599
|
loading: !0,
|
|
570
600
|
error: null
|
|
571
601
|
};
|
|
572
|
-
|
|
602
|
+
z((t) => [...t.filter((t) => t.sessionId !== e.id), n]), V(e.id), H(!1);
|
|
573
603
|
try {
|
|
574
604
|
let t = await G({ variables: { id: e.id } });
|
|
575
|
-
if (t.error &&
|
|
576
|
-
let t =
|
|
577
|
-
|
|
605
|
+
if (t.error && c(t.error)) {
|
|
606
|
+
let t = R.filter((t) => t.sessionId !== e.id);
|
|
607
|
+
z(t), B === e.id && V(t.length > 0 ? t[t.length - 1].sessionId : null), k(!0);
|
|
578
608
|
return;
|
|
579
609
|
}
|
|
580
|
-
let n =
|
|
581
|
-
|
|
610
|
+
let n = et(t.data?.startSessionTerminal?.ttydUrl || null, X.find((t) => t.id === e.id)?.agent?.tunnelUrl ?? null);
|
|
611
|
+
z((t) => t.map((t) => t.sessionId === e.id ? {
|
|
582
612
|
...t,
|
|
583
613
|
terminalUrl: n,
|
|
584
614
|
loading: !1,
|
|
585
|
-
error: n ? null :
|
|
615
|
+
error: n ? null : b("sessions.terminalStartedNoTunnelUrl", "Terminal started but no tunnel URL was returned. Try restarting.")
|
|
586
616
|
} : t));
|
|
587
617
|
} catch (t) {
|
|
588
|
-
if (
|
|
589
|
-
let t =
|
|
590
|
-
|
|
618
|
+
if (c(t)) {
|
|
619
|
+
let t = R.filter((t) => t.sessionId !== e.id);
|
|
620
|
+
z(t), B === e.id && V(t.length > 0 ? t[t.length - 1].sessionId : null), k(!0);
|
|
591
621
|
return;
|
|
592
622
|
}
|
|
593
|
-
let n = t instanceof Error ? t.message :
|
|
594
|
-
|
|
623
|
+
let n = t instanceof Error ? t.message : b("sessions.failedStartTerminal", "Failed to start terminal");
|
|
624
|
+
z((t) => t.map((t) => t.sessionId === e.id ? {
|
|
595
625
|
...t,
|
|
596
626
|
loading: !1,
|
|
597
627
|
error: n
|
|
598
628
|
} : t));
|
|
599
629
|
}
|
|
600
630
|
}, [
|
|
631
|
+
B,
|
|
601
632
|
R,
|
|
602
|
-
|
|
603
|
-
qn,
|
|
633
|
+
$n,
|
|
604
634
|
G
|
|
605
635
|
]);
|
|
606
|
-
|
|
607
|
-
if (!
|
|
608
|
-
let e = X.find((e) => e.id ===
|
|
636
|
+
f(() => {
|
|
637
|
+
if (!U || !B || R.some((e) => e.sessionId === B)) return;
|
|
638
|
+
let e = X.find((e) => e.id === B);
|
|
609
639
|
e && Q(e);
|
|
610
640
|
}, [
|
|
611
|
-
|
|
641
|
+
B,
|
|
612
642
|
Q,
|
|
613
643
|
X,
|
|
614
|
-
|
|
615
|
-
|
|
644
|
+
R,
|
|
645
|
+
U
|
|
616
646
|
]);
|
|
617
|
-
let
|
|
618
|
-
|
|
619
|
-
let t =
|
|
647
|
+
let tr = d((e) => {
|
|
648
|
+
z((t) => t.filter((t) => t.sessionId !== e)), B === e && V(() => {
|
|
649
|
+
let t = R.filter((t) => t.sessionId !== e);
|
|
620
650
|
return t.length > 0 ? t[t.length - 1].sessionId : null;
|
|
621
651
|
});
|
|
622
|
-
}, [
|
|
623
|
-
let t =
|
|
652
|
+
}, [B, R]), nr = d((e) => {
|
|
653
|
+
let t = R.find((t) => t.sessionId === e);
|
|
624
654
|
t?.terminalUrl && window.open(t.terminalUrl, "_blank");
|
|
625
|
-
}, [
|
|
655
|
+
}, [R]), rr = d(async (e, t) => {
|
|
626
656
|
try {
|
|
627
|
-
await
|
|
657
|
+
await gn({ variables: {
|
|
628
658
|
id: e,
|
|
629
659
|
input: { name: t }
|
|
630
|
-
} }),
|
|
660
|
+
} }), z((n) => n.map((n) => n.sessionId === e ? {
|
|
631
661
|
...n,
|
|
632
662
|
name: t
|
|
633
663
|
} : n));
|
|
634
664
|
} catch (e) {
|
|
635
665
|
console.error("Failed to rename session:", e);
|
|
636
666
|
}
|
|
637
|
-
}, [
|
|
667
|
+
}, [gn]), ir = d(async (e) => {
|
|
638
668
|
try {
|
|
639
|
-
await
|
|
669
|
+
await mn({ variables: { id: e } }), z((t) => t.map((t) => t.sessionId === e ? {
|
|
640
670
|
...t,
|
|
641
671
|
terminalUrl: null,
|
|
642
|
-
error:
|
|
672
|
+
error: b("sessions.terminalStopped", "Terminal stopped")
|
|
643
673
|
} : t));
|
|
644
674
|
} catch (e) {
|
|
645
675
|
console.error("Failed to stop terminal:", e);
|
|
646
676
|
}
|
|
647
|
-
}, [
|
|
648
|
-
let t =
|
|
677
|
+
}, [mn]), ar = d(async (e) => {
|
|
678
|
+
let t = R.find((t) => t.sessionId === e) || null;
|
|
649
679
|
try {
|
|
650
|
-
|
|
680
|
+
z((t) => t.map((t) => t.sessionId === e ? {
|
|
651
681
|
...t,
|
|
652
682
|
loading: !0,
|
|
653
683
|
error: null,
|
|
654
684
|
terminalUrl: null
|
|
655
685
|
} : t));
|
|
656
|
-
let n = await
|
|
657
|
-
if (n.error &&
|
|
658
|
-
|
|
686
|
+
let n = await hn({ variables: { id: e } });
|
|
687
|
+
if (n.error && c(n.error)) {
|
|
688
|
+
z((n) => n.map((n) => n.sessionId === e ? {
|
|
659
689
|
...n,
|
|
660
690
|
loading: !1,
|
|
661
691
|
error: null,
|
|
662
692
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
663
|
-
} : n)),
|
|
693
|
+
} : n)), k(!0);
|
|
664
694
|
return;
|
|
665
695
|
}
|
|
666
696
|
let r = n.data?.restartSessionTerminal?.ttydUrl || null;
|
|
667
|
-
|
|
697
|
+
z((t) => t.map((t) => t.sessionId === e ? {
|
|
668
698
|
...t,
|
|
669
699
|
terminalUrl: r,
|
|
670
700
|
loading: !1,
|
|
671
|
-
error: r ? null :
|
|
701
|
+
error: r ? null : b("sessions.terminalRestartedNoUrl", "Terminal restarted but no URL returned.")
|
|
672
702
|
} : t));
|
|
673
703
|
} catch (n) {
|
|
674
|
-
if (
|
|
675
|
-
|
|
704
|
+
if (c(n)) {
|
|
705
|
+
z((n) => n.map((n) => n.sessionId === e ? {
|
|
676
706
|
...n,
|
|
677
707
|
loading: !1,
|
|
678
708
|
error: null,
|
|
679
709
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
680
|
-
} : n)),
|
|
710
|
+
} : n)), k(!0);
|
|
681
711
|
return;
|
|
682
712
|
}
|
|
683
|
-
let r = n instanceof Error ? n.message :
|
|
684
|
-
|
|
713
|
+
let r = n instanceof Error ? n.message : b("sessions.failedRestartTerminal", "Failed to restart terminal");
|
|
714
|
+
z((t) => t.map((t) => t.sessionId === e ? {
|
|
685
715
|
...t,
|
|
686
716
|
loading: !1,
|
|
687
717
|
error: r
|
|
688
718
|
} : t));
|
|
689
719
|
}
|
|
690
|
-
}, [
|
|
691
|
-
|
|
720
|
+
}, [hn, R]), or = d(() => {
|
|
721
|
+
Jt((e) => !e);
|
|
692
722
|
}, []), $ = {
|
|
693
723
|
total: X.length,
|
|
694
724
|
running: X.filter((e) => e.status === "RUNNING").length,
|
|
695
725
|
stopped: X.filter((e) => e.status === "STOPPED").length
|
|
696
726
|
};
|
|
697
|
-
if (!
|
|
727
|
+
if (!st && ct && ct.permissionStrings?.length > 0 && !ft) return /* @__PURE__ */ g(v, {
|
|
698
728
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
699
|
-
children: /* @__PURE__ */
|
|
700
|
-
title:
|
|
701
|
-
description:
|
|
702
|
-
details:
|
|
729
|
+
children: /* @__PURE__ */ g(Ze, {
|
|
730
|
+
title: b("common.accessDeniedTitle", "Access Denied"),
|
|
731
|
+
description: b("sessions.accessDeniedDescription", "You don't have permission to view sessions."),
|
|
732
|
+
details: b("sessions.requiredPermission", "Required permission: session:list")
|
|
703
733
|
})
|
|
704
734
|
});
|
|
705
|
-
if (q && !
|
|
735
|
+
if (q && !Tn && X.length === 0) return /* @__PURE__ */ g(v, {
|
|
706
736
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
707
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ g(_e, { message: b("sessions.loading", "Loading sessions...") })
|
|
708
738
|
});
|
|
709
|
-
if (
|
|
739
|
+
if (En && X.length === 0) return /* @__PURE__ */ g(v, {
|
|
710
740
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
711
|
-
children: /* @__PURE__ */
|
|
712
|
-
title:
|
|
713
|
-
message:
|
|
741
|
+
children: /* @__PURE__ */ g(ve, {
|
|
742
|
+
title: b("sessions.failedLoad", "Failed to load sessions"),
|
|
743
|
+
message: En.message,
|
|
714
744
|
onRetry: () => J()
|
|
715
745
|
})
|
|
716
746
|
});
|
|
717
|
-
let
|
|
747
|
+
let sr = () => !Vn || E === "terminal" ? null : /* @__PURE__ */ _("div", {
|
|
718
748
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-3 px-4 py-2 bg-action-primary-bg/10 border border-action-primary-bg/20 rounded-lg",
|
|
719
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ g("span", {
|
|
720
750
|
className: "text-sm font-medium text-text-primary",
|
|
721
|
-
children:
|
|
722
|
-
}), /* @__PURE__ */
|
|
751
|
+
children: b(N.size === 1 ? "sessions.selectionCountSingle" : "sessions.selectionCountPlural", N.size === 1 ? "{{count}} session selected" : "{{count}} sessions selected", { count: N.size })
|
|
752
|
+
}), /* @__PURE__ */ _("div", {
|
|
723
753
|
className: "flex items-center gap-1.5 sm:ml-auto flex-wrap",
|
|
724
754
|
children: [
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
onClick:
|
|
755
|
+
/* @__PURE__ */ _("button", {
|
|
756
|
+
onClick: Hn,
|
|
727
757
|
disabled: wt,
|
|
728
758
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-primary bg-bg-surface border border-border-default rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
729
759
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ g(He, { className: "w-3 h-3" }),
|
|
731
761
|
" ",
|
|
732
|
-
|
|
762
|
+
b("sessions.stop", "Stop")
|
|
733
763
|
]
|
|
734
764
|
}),
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
onClick:
|
|
765
|
+
/* @__PURE__ */ _("button", {
|
|
766
|
+
onClick: Un,
|
|
737
767
|
disabled: wt,
|
|
738
768
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-primary bg-bg-surface border border-border-default rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
739
769
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ g(Ve, { className: "w-3 h-3" }),
|
|
741
771
|
" ",
|
|
742
|
-
|
|
772
|
+
b("sessions.restart", "Restart")
|
|
743
773
|
]
|
|
744
774
|
}),
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
onClick:
|
|
775
|
+
/* @__PURE__ */ _("button", {
|
|
776
|
+
onClick: Wn,
|
|
747
777
|
disabled: wt,
|
|
748
778
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-status-error-text bg-status-error-bg border border-status-error-text/20 rounded-md hover:bg-status-error-bg/80 transition-colors disabled:opacity-50",
|
|
749
779
|
children: [
|
|
750
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ g(We, { className: "w-3 h-3" }),
|
|
751
781
|
" ",
|
|
752
|
-
|
|
782
|
+
b("sessions.remove", "Remove")
|
|
753
783
|
]
|
|
754
784
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
onClick:
|
|
785
|
+
/* @__PURE__ */ _("button", {
|
|
786
|
+
onClick: zn,
|
|
757
787
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
758
788
|
children: [
|
|
759
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ g(Ge, { className: "w-3 h-3" }),
|
|
760
790
|
" ",
|
|
761
|
-
|
|
791
|
+
b("sessions.deselect", "Deselect")
|
|
762
792
|
]
|
|
763
793
|
})
|
|
764
794
|
]
|
|
765
795
|
})]
|
|
766
796
|
});
|
|
767
|
-
if (
|
|
797
|
+
if (E === "terminal") return /* @__PURE__ */ _(v, {
|
|
768
798
|
className: "flex flex-col bg-bg-surface h-screen",
|
|
769
799
|
children: [
|
|
770
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ _("div", {
|
|
771
801
|
className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 px-4 py-2 border-b border-border-default bg-bg-sunken",
|
|
772
|
-
children: [/* @__PURE__ */
|
|
802
|
+
children: [/* @__PURE__ */ _("div", {
|
|
773
803
|
className: "flex flex-wrap items-center gap-3",
|
|
774
|
-
children: [/* @__PURE__ */
|
|
804
|
+
children: [/* @__PURE__ */ g("h1", {
|
|
775
805
|
className: "text-sm font-semibold text-text-primary",
|
|
776
|
-
children:
|
|
777
|
-
}), /* @__PURE__ */
|
|
806
|
+
children: b("nav.sessions", "Sessions")
|
|
807
|
+
}), /* @__PURE__ */ g("span", {
|
|
778
808
|
className: "text-xs text-text-muted",
|
|
779
|
-
children:
|
|
809
|
+
children: b("sessions.runningSummary", "{{running}} running / {{total}} total", {
|
|
780
810
|
running: $.running,
|
|
781
811
|
total: $.total
|
|
782
812
|
})
|
|
783
813
|
})]
|
|
784
|
-
}), /* @__PURE__ */
|
|
814
|
+
}), /* @__PURE__ */ _("div", {
|
|
785
815
|
className: "flex w-full flex-wrap items-center gap-2 sm:w-auto sm:justify-end",
|
|
786
816
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
onClick: () =>
|
|
817
|
+
/* @__PURE__ */ g("button", {
|
|
818
|
+
onClick: () => vn().then(() => J()),
|
|
789
819
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors",
|
|
790
|
-
title:
|
|
791
|
-
children: /* @__PURE__ */
|
|
820
|
+
title: b("sessions.checkHealth", "Check session health"),
|
|
821
|
+
children: /* @__PURE__ */ g(Me, { className: "w-3.5 h-3.5" })
|
|
792
822
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ g("button", {
|
|
794
824
|
onClick: () => J(),
|
|
795
825
|
disabled: q,
|
|
796
826
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
797
|
-
title:
|
|
798
|
-
children: /* @__PURE__ */
|
|
827
|
+
title: b("common.refresh", "Refresh"),
|
|
828
|
+
children: /* @__PURE__ */ g(Be, { className: `w-3.5 h-3.5 ${q ? "animate-spin" : ""}` })
|
|
799
829
|
}),
|
|
800
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ _("div", {
|
|
801
831
|
className: "flex items-center gap-0.5 rounded bg-bg-surface p-0.5",
|
|
802
832
|
children: [
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
onClick: () =>
|
|
833
|
+
/* @__PURE__ */ g("button", {
|
|
834
|
+
onClick: () => D("terminal"),
|
|
805
835
|
className: "p-1.5 rounded bg-bg-sunken shadow-sm",
|
|
806
|
-
title:
|
|
807
|
-
children: /* @__PURE__ */
|
|
836
|
+
title: b("sessions.terminalViewTitle", "Terminal view"),
|
|
837
|
+
children: /* @__PURE__ */ g(Le, { className: "w-3.5 h-3.5 text-text-secondary" })
|
|
808
838
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
onClick: () =>
|
|
839
|
+
/* @__PURE__ */ g("button", {
|
|
840
|
+
onClick: () => D("grid"),
|
|
811
841
|
className: "p-1.5 rounded hover:bg-bg-sunken/50",
|
|
812
|
-
title:
|
|
813
|
-
children: /* @__PURE__ */
|
|
842
|
+
title: b("sessions.gridViewTitle", "Grid view"),
|
|
843
|
+
children: /* @__PURE__ */ g(Fe, { className: "w-3.5 h-3.5 text-text-secondary" })
|
|
814
844
|
}),
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
onClick: () =>
|
|
845
|
+
/* @__PURE__ */ g("button", {
|
|
846
|
+
onClick: () => D("list"),
|
|
817
847
|
className: "p-1.5 rounded hover:bg-bg-sunken/50",
|
|
818
|
-
title:
|
|
819
|
-
children: /* @__PURE__ */
|
|
848
|
+
title: b("sessions.listViewTitle", "List view"),
|
|
849
|
+
children: /* @__PURE__ */ g(Ie, { className: "w-3.5 h-3.5 text-text-secondary" })
|
|
820
850
|
})
|
|
821
851
|
]
|
|
822
852
|
})
|
|
823
853
|
]
|
|
824
854
|
})]
|
|
825
855
|
}),
|
|
826
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ g("div", {
|
|
827
857
|
className: "px-4 pt-3",
|
|
828
|
-
children: /* @__PURE__ */
|
|
858
|
+
children: /* @__PURE__ */ g(Te, {
|
|
829
859
|
showConnectionStatus: !0,
|
|
830
860
|
maxVisible: 3
|
|
831
861
|
})
|
|
832
862
|
}),
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
tabs:
|
|
835
|
-
activeTabId:
|
|
836
|
-
onTabSelect:
|
|
837
|
-
onTabClose:
|
|
838
|
-
onOpenExternal:
|
|
863
|
+
/* @__PURE__ */ g(ke, {
|
|
864
|
+
tabs: R,
|
|
865
|
+
activeTabId: B,
|
|
866
|
+
onTabSelect: V,
|
|
867
|
+
onTabClose: tr,
|
|
868
|
+
onOpenExternal: nr,
|
|
839
869
|
collapsed: !1,
|
|
840
870
|
sessions: Z,
|
|
841
871
|
onOpenTerminal: Q,
|
|
842
872
|
onRetryTerminal: Q,
|
|
843
|
-
onRenameSession:
|
|
844
|
-
onStopTerminal:
|
|
845
|
-
onRestartTerminal:
|
|
846
|
-
onCreateSession:
|
|
873
|
+
onRenameSession: rr,
|
|
874
|
+
onStopTerminal: ir,
|
|
875
|
+
onRestartTerminal: ar,
|
|
876
|
+
onCreateSession: qn,
|
|
847
877
|
fullScreen: !0,
|
|
848
|
-
isImmersiveFullscreen:
|
|
849
|
-
onToggleImmersiveFullscreen:
|
|
878
|
+
isImmersiveFullscreen: qt,
|
|
879
|
+
onToggleImmersiveFullscreen: or,
|
|
850
880
|
contextSwitcher: void 0
|
|
851
881
|
}),
|
|
852
|
-
|
|
882
|
+
j && /* @__PURE__ */ g("div", {
|
|
853
883
|
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg text-status-success-text rounded-md shadow-lg text-sm",
|
|
854
|
-
children:
|
|
884
|
+
children: j
|
|
855
885
|
}),
|
|
856
|
-
yt &&
|
|
857
|
-
|
|
886
|
+
yt && lr(),
|
|
887
|
+
cr()
|
|
858
888
|
]
|
|
859
889
|
});
|
|
860
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ _(v, {
|
|
861
891
|
className: "flex flex-col bg-bg-surface min-h-screen",
|
|
862
892
|
children: [
|
|
863
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ _("div", {
|
|
864
894
|
className: "flex-1 overflow-y-auto space-y-6 p-4 sm:p-6",
|
|
865
895
|
children: [
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
title:
|
|
868
|
-
description:
|
|
896
|
+
/* @__PURE__ */ g(ge, {
|
|
897
|
+
title: b("nav.sessions", "Sessions"),
|
|
898
|
+
description: b("sessions.pageDescription", "{{running}} of {{total}} sessions running", {
|
|
869
899
|
running: $.running,
|
|
870
900
|
total: $.total
|
|
871
901
|
}),
|
|
872
|
-
actions: /* @__PURE__ */
|
|
902
|
+
actions: /* @__PURE__ */ _("div", {
|
|
873
903
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
874
904
|
children: [
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
onClick: () =>
|
|
905
|
+
/* @__PURE__ */ g("button", {
|
|
906
|
+
onClick: () => vn().then(() => J()),
|
|
877
907
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
878
|
-
title:
|
|
879
|
-
children: /* @__PURE__ */
|
|
908
|
+
title: b("sessions.checkHealth", "Check session health"),
|
|
909
|
+
children: /* @__PURE__ */ g(Me, { className: "w-4 h-4" })
|
|
880
910
|
}),
|
|
881
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ g("button", {
|
|
882
912
|
onClick: () => J(),
|
|
883
913
|
disabled: q,
|
|
884
914
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
885
|
-
title:
|
|
886
|
-
children: /* @__PURE__ */
|
|
915
|
+
title: b("sessions.refreshTitle", "Refresh sessions"),
|
|
916
|
+
children: /* @__PURE__ */ g(Be, { className: `w-4 h-4 ${q ? "animate-spin" : ""}` })
|
|
917
|
+
}),
|
|
918
|
+
/* @__PURE__ */ _("button", {
|
|
919
|
+
onClick: () => Gn("CSV"),
|
|
920
|
+
disabled: Tt,
|
|
921
|
+
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
922
|
+
title: b("sessions.exportTitle", "Export sessions as CSV"),
|
|
923
|
+
"data-testid": "sessions-export-button",
|
|
924
|
+
children: [/* @__PURE__ */ g(Pe, { className: `w-4 h-4 ${Tt ? "animate-pulse" : ""}` }), b("sessions.export", "Export")]
|
|
887
925
|
}),
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
permission:
|
|
890
|
-
children: /* @__PURE__ */
|
|
891
|
-
onClick: () =>
|
|
926
|
+
/* @__PURE__ */ g(Qe, {
|
|
927
|
+
permission: Ee.SESSION_CREATE,
|
|
928
|
+
children: /* @__PURE__ */ _("button", {
|
|
929
|
+
onClick: () => $t(!0),
|
|
892
930
|
className: "flex items-center gap-2 px-3 py-2 text-text-primary border border-border-default rounded-md hover:bg-bg-sunken transition-colors",
|
|
893
931
|
"data-testid": "sessions-reconnect-button",
|
|
894
|
-
title:
|
|
895
|
-
children: [/* @__PURE__ */
|
|
932
|
+
title: b("sessions.reconnectTooltip", "Reconnect orphan tmux/wezterm/zellij sessions left over from a previous agent run"),
|
|
933
|
+
children: [/* @__PURE__ */ g(Be, { className: "w-4 h-4" }), b("sessions.reconnect", "Reconnect")]
|
|
896
934
|
})
|
|
897
935
|
}),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
permission:
|
|
900
|
-
children: /* @__PURE__ */
|
|
901
|
-
onClick:
|
|
936
|
+
/* @__PURE__ */ g(Qe, {
|
|
937
|
+
permission: Ee.SESSION_CREATE,
|
|
938
|
+
children: /* @__PURE__ */ _("button", {
|
|
939
|
+
onClick: qn,
|
|
902
940
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
903
|
-
children: [/* @__PURE__ */
|
|
941
|
+
children: [/* @__PURE__ */ g(ze, { className: "w-4 h-4" }), b("sessions.newSession", "New Session")]
|
|
904
942
|
})
|
|
905
943
|
})
|
|
906
944
|
]
|
|
907
945
|
})
|
|
908
946
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ g(Te, {
|
|
910
948
|
showConnectionStatus: !0,
|
|
911
949
|
maxVisible: 3
|
|
912
950
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ _("div", {
|
|
914
952
|
"data-tour": "sessions-filters",
|
|
915
953
|
className: "space-y-3",
|
|
916
|
-
children: [/* @__PURE__ */
|
|
954
|
+
children: [/* @__PURE__ */ _("div", {
|
|
917
955
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
919
|
-
value:
|
|
956
|
+
children: [/* @__PURE__ */ g(Se, {
|
|
957
|
+
value: x,
|
|
920
958
|
onChange: mt,
|
|
921
|
-
placeholder:
|
|
959
|
+
placeholder: b("sessions.searchPlaceholder", "Search sessions..."),
|
|
922
960
|
className: "flex-1 sm:w-64 sm:flex-none"
|
|
923
|
-
}), /* @__PURE__ */
|
|
961
|
+
}), /* @__PURE__ */ _("div", {
|
|
924
962
|
className: "flex items-center gap-1 bg-bg-sunken rounded-md p-1 flex-shrink-0",
|
|
925
963
|
children: [
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
onClick: () =>
|
|
964
|
+
/* @__PURE__ */ g("button", {
|
|
965
|
+
onClick: () => D("terminal"),
|
|
928
966
|
className: "p-1.5 sm:p-2 rounded hover:bg-bg-surface/50",
|
|
929
|
-
title:
|
|
930
|
-
children: /* @__PURE__ */
|
|
967
|
+
title: b("sessions.terminalViewTitle", "Terminal view"),
|
|
968
|
+
children: /* @__PURE__ */ g(Le, { className: "w-4 h-4 text-text-secondary" })
|
|
931
969
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
onClick: () =>
|
|
934
|
-
className: `p-1.5 sm:p-2 rounded ${
|
|
935
|
-
title:
|
|
936
|
-
children: /* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ g("button", {
|
|
971
|
+
onClick: () => D("grid"),
|
|
972
|
+
className: `p-1.5 sm:p-2 rounded ${E === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
973
|
+
title: b("sessions.gridViewTitle", "Grid view"),
|
|
974
|
+
children: /* @__PURE__ */ g(Fe, { className: "w-4 h-4 text-text-secondary" })
|
|
937
975
|
}),
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
onClick: () =>
|
|
940
|
-
className: `p-1.5 sm:p-2 rounded ${
|
|
941
|
-
title:
|
|
942
|
-
children: /* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ g("button", {
|
|
977
|
+
onClick: () => D("list"),
|
|
978
|
+
className: `p-1.5 sm:p-2 rounded ${E === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
979
|
+
title: b("sessions.listViewTitle", "List view"),
|
|
980
|
+
children: /* @__PURE__ */ g(Ie, { className: "w-4 h-4 text-text-secondary" })
|
|
943
981
|
})
|
|
944
982
|
]
|
|
945
983
|
})]
|
|
946
|
-
}), /* @__PURE__ */
|
|
984
|
+
}), /* @__PURE__ */ _("div", {
|
|
947
985
|
className: "flex items-center gap-2 sm:gap-3 flex-wrap",
|
|
948
986
|
children: [
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
label:
|
|
951
|
-
value:
|
|
987
|
+
/* @__PURE__ */ g(l, {
|
|
988
|
+
label: b("sessions.filterStatus", "Status"),
|
|
989
|
+
value: S,
|
|
952
990
|
options: ut,
|
|
953
991
|
onChange: ht
|
|
954
992
|
}),
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
label:
|
|
957
|
-
value:
|
|
993
|
+
/* @__PURE__ */ g(l, {
|
|
994
|
+
label: b("sessions.filterType", "Type"),
|
|
995
|
+
value: C,
|
|
958
996
|
options: dt,
|
|
959
997
|
onChange: gt
|
|
960
998
|
}),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
label:
|
|
963
|
-
value:
|
|
964
|
-
options:
|
|
999
|
+
/* @__PURE__ */ g(l, {
|
|
1000
|
+
label: b("sessions.filterVibe", "Vibe"),
|
|
1001
|
+
value: w,
|
|
1002
|
+
options: Mn,
|
|
965
1003
|
onChange: _t
|
|
966
1004
|
}),
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
label:
|
|
969
|
-
value:
|
|
970
|
-
options:
|
|
1005
|
+
/* @__PURE__ */ g(l, {
|
|
1006
|
+
label: b("sessions.filterAgent", "Agent"),
|
|
1007
|
+
value: T,
|
|
1008
|
+
options: Nn,
|
|
971
1009
|
onChange: vt
|
|
972
1010
|
})
|
|
973
1011
|
]
|
|
974
1012
|
})]
|
|
975
1013
|
}),
|
|
976
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ _("div", {
|
|
977
1015
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-wrap",
|
|
978
1016
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ _("button", {
|
|
980
1018
|
onClick: () => ht("RUNNING"),
|
|
981
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
1019
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${S === "RUNNING" ? "bg-status-success-bg text-status-success-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
982
1020
|
children: [
|
|
983
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ g(Re, { className: "w-3 h-3" }),
|
|
984
1022
|
" ",
|
|
985
|
-
|
|
1023
|
+
b("sessions.running", "Running"),
|
|
986
1024
|
" (",
|
|
987
1025
|
$.running,
|
|
988
1026
|
")"
|
|
989
1027
|
]
|
|
990
1028
|
}),
|
|
991
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ _("button", {
|
|
992
1030
|
onClick: () => ht("STOPPED"),
|
|
993
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
1031
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${S === "STOPPED" ? "bg-bg-sunken text-text-secondary" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
994
1032
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ g(He, { className: "w-3 h-3" }),
|
|
996
1034
|
" ",
|
|
997
|
-
|
|
1035
|
+
b("sessions.stoppedState", "Stopped"),
|
|
998
1036
|
" (",
|
|
999
1037
|
$.stopped,
|
|
1000
1038
|
")"
|
|
1001
1039
|
]
|
|
1002
1040
|
}),
|
|
1003
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ g("div", {
|
|
1004
1042
|
className: "sm:ml-auto flex items-center gap-2",
|
|
1005
|
-
children: Z.length > 0 && /* @__PURE__ */
|
|
1006
|
-
onClick:
|
|
1043
|
+
children: Z.length > 0 && /* @__PURE__ */ _("button", {
|
|
1044
|
+
onClick: Bn ? zn : Rn,
|
|
1007
1045
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
1008
|
-
children: [/* @__PURE__ */
|
|
1046
|
+
children: [/* @__PURE__ */ g(Ne, { className: "w-3.5 h-3.5" }), Bn ? b("sessions.deselectAll", "Deselect All") : b("sessions.selectAll", "Select All")]
|
|
1009
1047
|
})
|
|
1010
1048
|
})
|
|
1011
1049
|
]
|
|
1012
1050
|
}),
|
|
1013
|
-
|
|
1014
|
-
|
|
1051
|
+
sr(),
|
|
1052
|
+
x || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? /* @__PURE__ */ _("p", {
|
|
1015
1053
|
className: "text-sm text-text-secondary",
|
|
1016
1054
|
children: [
|
|
1017
|
-
|
|
1055
|
+
b("sessions.showing", "Showing"),
|
|
1018
1056
|
" ",
|
|
1019
1057
|
Z.length,
|
|
1020
1058
|
" ",
|
|
1021
|
-
|
|
1059
|
+
b("sessions.of", "of"),
|
|
1022
1060
|
" ",
|
|
1023
1061
|
X.length,
|
|
1024
1062
|
" ",
|
|
1025
|
-
|
|
1026
|
-
q && /* @__PURE__ */
|
|
1063
|
+
b("nav.sessions", "sessions"),
|
|
1064
|
+
q && /* @__PURE__ */ _("span", {
|
|
1027
1065
|
className: "ml-2 text-text-muted",
|
|
1028
1066
|
children: [
|
|
1029
1067
|
"(",
|
|
1030
|
-
|
|
1068
|
+
b("sessions.refreshing", "refreshing..."),
|
|
1031
1069
|
")"
|
|
1032
1070
|
]
|
|
1033
1071
|
})
|
|
1034
1072
|
]
|
|
1035
1073
|
}) : null,
|
|
1036
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ g(Je, {
|
|
1037
1075
|
mode: "wait",
|
|
1038
|
-
children: Z.length > 0 ?
|
|
1076
|
+
children: Z.length > 0 ? E === "grid" ? /* @__PURE__ */ g(Xe, {
|
|
1039
1077
|
stagger: .04,
|
|
1040
1078
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
1041
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
1079
|
+
children: Z.map((e) => /* @__PURE__ */ g(Ye, { children: /* @__PURE__ */ g(De, {
|
|
1042
1080
|
session: e,
|
|
1043
|
-
onOpen:
|
|
1044
|
-
onStart:
|
|
1045
|
-
onStop:
|
|
1046
|
-
onRestart:
|
|
1081
|
+
onOpen: Kn,
|
|
1082
|
+
onStart: Yn,
|
|
1083
|
+
onStop: Xn,
|
|
1084
|
+
onRestart: Zn,
|
|
1047
1085
|
onOpenTerminal: Q,
|
|
1048
|
-
onShare:
|
|
1049
|
-
selected:
|
|
1050
|
-
onToggleSelect: () =>
|
|
1086
|
+
onShare: er,
|
|
1087
|
+
selected: N.has(e.id),
|
|
1088
|
+
onToggleSelect: () => Ln(e.id)
|
|
1051
1089
|
}) }, e.id))
|
|
1052
|
-
}, "grid-view") : /* @__PURE__ */
|
|
1090
|
+
}, "grid-view") : /* @__PURE__ */ g(Ye, { children: /* @__PURE__ */ g(Oe, {
|
|
1053
1091
|
sessions: Z,
|
|
1054
|
-
onOpen:
|
|
1055
|
-
onStart:
|
|
1056
|
-
onStop:
|
|
1057
|
-
onRestart:
|
|
1058
|
-
onTerminate:
|
|
1092
|
+
onOpen: Kn,
|
|
1093
|
+
onStart: Yn,
|
|
1094
|
+
onStop: Xn,
|
|
1095
|
+
onRestart: Zn,
|
|
1096
|
+
onTerminate: Qn,
|
|
1059
1097
|
onOpenTerminal: Q,
|
|
1060
|
-
onShare:
|
|
1061
|
-
selectedIds:
|
|
1062
|
-
onToggleSelect:
|
|
1063
|
-
onSelectAll:
|
|
1064
|
-
onDeselectAll:
|
|
1065
|
-
}) }, "list-view") : /* @__PURE__ */
|
|
1098
|
+
onShare: er,
|
|
1099
|
+
selectedIds: N,
|
|
1100
|
+
onToggleSelect: Ln,
|
|
1101
|
+
onSelectAll: Rn,
|
|
1102
|
+
onDeselectAll: zn
|
|
1103
|
+
}) }, "list-view") : /* @__PURE__ */ _("div", {
|
|
1066
1104
|
className: "space-y-4",
|
|
1067
|
-
children: [/* @__PURE__ */
|
|
1105
|
+
children: [/* @__PURE__ */ g(Ce, {
|
|
1068
1106
|
variant: "compact",
|
|
1069
1107
|
dismissKey: "vibecontrols-sessions-setup-banner"
|
|
1070
|
-
}), /* @__PURE__ */
|
|
1071
|
-
icon: /* @__PURE__ */
|
|
1072
|
-
title:
|
|
1073
|
-
description:
|
|
1074
|
-
action: !
|
|
1108
|
+
}), /* @__PURE__ */ g(xe, {
|
|
1109
|
+
icon: /* @__PURE__ */ g(Ue, { className: "w-8 h-8 text-text-secondary" }),
|
|
1110
|
+
title: x || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? b("sessions.emptyFound", "No sessions found") : b("sessions.emptyConfigured", "No sessions configured"),
|
|
1111
|
+
description: x || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? b("sessions.emptyAdjustSearch", "Try adjusting your search or filters") : b("sessions.emptyDescription", "Sessions require an active agent. Install the CLI agent first, then start a session."),
|
|
1112
|
+
action: !x && S === "all" && C === "all" && w === "all" && T === "all" ? /* @__PURE__ */ _("div", {
|
|
1075
1113
|
className: "flex items-center gap-2",
|
|
1076
|
-
children: [pt && /* @__PURE__ */
|
|
1077
|
-
onClick:
|
|
1114
|
+
children: [pt && /* @__PURE__ */ _("button", {
|
|
1115
|
+
onClick: qn,
|
|
1078
1116
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
1079
1117
|
children: [
|
|
1080
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ g(ze, { className: "w-4 h-4" }),
|
|
1081
1119
|
" ",
|
|
1082
|
-
|
|
1120
|
+
b("sessions.newSession", "New Session")
|
|
1083
1121
|
]
|
|
1084
|
-
}), /* @__PURE__ */
|
|
1122
|
+
}), /* @__PURE__ */ g(we, { prompt: "What is a Session in VibeControls and how do I start one?" })]
|
|
1085
1123
|
}) : void 0
|
|
1086
1124
|
})]
|
|
1087
1125
|
})
|
|
1088
1126
|
}),
|
|
1089
|
-
|
|
1127
|
+
j && /* @__PURE__ */ g("div", {
|
|
1090
1128
|
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg text-status-success-text rounded-md shadow-lg text-sm",
|
|
1091
|
-
children:
|
|
1129
|
+
children: j
|
|
1092
1130
|
})
|
|
1093
1131
|
]
|
|
1094
1132
|
}),
|
|
1095
|
-
|
|
1096
|
-
tabs:
|
|
1097
|
-
activeTabId:
|
|
1098
|
-
onTabSelect:
|
|
1099
|
-
onTabClose:
|
|
1100
|
-
onOpenExternal:
|
|
1101
|
-
onToggleCollapse: () =>
|
|
1102
|
-
collapsed:
|
|
1133
|
+
R.length > 0 && /* @__PURE__ */ g(ke, {
|
|
1134
|
+
tabs: R,
|
|
1135
|
+
activeTabId: B,
|
|
1136
|
+
onTabSelect: V,
|
|
1137
|
+
onTabClose: tr,
|
|
1138
|
+
onOpenExternal: nr,
|
|
1139
|
+
onToggleCollapse: () => H((e) => !e),
|
|
1140
|
+
collapsed: Wt,
|
|
1103
1141
|
sessions: Z,
|
|
1104
1142
|
onOpenTerminal: Q,
|
|
1105
1143
|
onRetryTerminal: Q,
|
|
1106
|
-
onRenameSession:
|
|
1107
|
-
onStopTerminal:
|
|
1108
|
-
onRestartTerminal:
|
|
1144
|
+
onRenameSession: rr,
|
|
1145
|
+
onStopTerminal: ir,
|
|
1146
|
+
onRestartTerminal: ar,
|
|
1109
1147
|
heightClass: "h-[280px] sm:h-[380px]",
|
|
1110
|
-
isImmersiveFullscreen:
|
|
1111
|
-
onToggleImmersiveFullscreen:
|
|
1148
|
+
isImmersiveFullscreen: qt,
|
|
1149
|
+
onToggleImmersiveFullscreen: or,
|
|
1112
1150
|
contextSwitcher: void 0
|
|
1113
1151
|
}),
|
|
1114
|
-
yt &&
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
session:
|
|
1118
|
-
isOpen: !!
|
|
1119
|
-
onClose: () =>
|
|
1152
|
+
yt && lr(),
|
|
1153
|
+
cr(),
|
|
1154
|
+
Gt && /* @__PURE__ */ g(Ae, {
|
|
1155
|
+
session: Gt,
|
|
1156
|
+
isOpen: !!Gt,
|
|
1157
|
+
onClose: () => Kt(null)
|
|
1120
1158
|
}),
|
|
1121
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ g(ye, {
|
|
1122
1160
|
isOpen: bt,
|
|
1123
|
-
onClose: () =>
|
|
1161
|
+
onClose: () => k(!1),
|
|
1124
1162
|
onConfirm: () => {
|
|
1125
|
-
|
|
1163
|
+
k(!1), at("/billing");
|
|
1126
1164
|
},
|
|
1127
1165
|
title: be("session").title,
|
|
1128
1166
|
message: be("session").message,
|
|
@@ -1132,62 +1170,62 @@ function tt() {
|
|
|
1132
1170
|
})
|
|
1133
1171
|
]
|
|
1134
1172
|
});
|
|
1135
|
-
function
|
|
1136
|
-
if (!
|
|
1137
|
-
let e =
|
|
1138
|
-
return /* @__PURE__ */
|
|
1173
|
+
function cr() {
|
|
1174
|
+
if (!Qt) return null;
|
|
1175
|
+
let e = cn?.agentSessionOrphans ?? [];
|
|
1176
|
+
return /* @__PURE__ */ g("div", {
|
|
1139
1177
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1140
1178
|
"data-testid": "sessions-reconnect-modal",
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ _("div", {
|
|
1142
1180
|
className: "bg-bg-surface rounded-lg p-6 w-full max-w-2xl max-h-[80vh] overflow-y-auto",
|
|
1143
1181
|
children: [
|
|
1144
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ g("h2", {
|
|
1145
1183
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
1146
|
-
children:
|
|
1184
|
+
children: b("sessions.reconnectTitle", "Reconnect orphan sessions")
|
|
1147
1185
|
}),
|
|
1148
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ g("p", {
|
|
1149
1187
|
className: "text-sm text-text-secondary mb-4",
|
|
1150
|
-
children:
|
|
1188
|
+
children: b("sessions.reconnectDesc", "Pick an agent to scan its host for tmux / wezterm / zellij sessions named vibe-* that are not currently tracked. Adopt one to start a web terminal and bring it back into the UI.")
|
|
1151
1189
|
}),
|
|
1152
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ _("div", {
|
|
1153
1191
|
className: "space-y-4",
|
|
1154
1192
|
children: [
|
|
1155
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
1156
1194
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1157
|
-
children:
|
|
1158
|
-
}), /* @__PURE__ */
|
|
1159
|
-
options:
|
|
1160
|
-
value:
|
|
1195
|
+
children: b("sessions.agent", "Agent")
|
|
1196
|
+
}), /* @__PURE__ */ g(u, {
|
|
1197
|
+
options: Fn,
|
|
1198
|
+
value: en,
|
|
1161
1199
|
onChange: (e) => {
|
|
1162
|
-
|
|
1200
|
+
tn(e), rn(null), e && sn({ variables: { agentId: e } });
|
|
1163
1201
|
},
|
|
1164
|
-
placeholder:
|
|
1165
|
-
searchPlaceholder:
|
|
1202
|
+
placeholder: b("sessions.selectAgent", "Select an agent"),
|
|
1203
|
+
searchPlaceholder: b("sessions.searchAgents", "Search agents..."),
|
|
1166
1204
|
clearable: !0
|
|
1167
1205
|
})] }),
|
|
1168
|
-
|
|
1206
|
+
nn && /* @__PURE__ */ g("div", {
|
|
1169
1207
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1170
1208
|
"data-testid": "sessions-reconnect-error",
|
|
1171
|
-
children:
|
|
1209
|
+
children: nn
|
|
1172
1210
|
}),
|
|
1173
|
-
|
|
1211
|
+
en && /* @__PURE__ */ g("div", {
|
|
1174
1212
|
"data-testid": "sessions-reconnect-list",
|
|
1175
1213
|
className: "space-y-2",
|
|
1176
|
-
children:
|
|
1214
|
+
children: ln ? /* @__PURE__ */ g("div", {
|
|
1177
1215
|
className: "text-sm text-text-secondary",
|
|
1178
|
-
children:
|
|
1179
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
1216
|
+
children: b("sessions.scanningHost", "Scanning host...")
|
|
1217
|
+
}) : e.length === 0 ? /* @__PURE__ */ g("div", {
|
|
1180
1218
|
className: "text-sm text-text-secondary",
|
|
1181
|
-
children:
|
|
1182
|
-
}) : e.map((e) => /* @__PURE__ */
|
|
1219
|
+
children: b("sessions.noOrphans", "No orphan vibe-* sessions found on this agent.")
|
|
1220
|
+
}) : e.map((e) => /* @__PURE__ */ _("div", {
|
|
1183
1221
|
className: "flex items-center justify-between gap-3 p-3 border border-border-default rounded-md bg-bg-sunken/40",
|
|
1184
1222
|
"data-testid": "sessions-reconnect-row",
|
|
1185
|
-
children: [/* @__PURE__ */
|
|
1223
|
+
children: [/* @__PURE__ */ _("div", {
|
|
1186
1224
|
className: "min-w-0 flex-1",
|
|
1187
|
-
children: [/* @__PURE__ */
|
|
1225
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1188
1226
|
className: "font-mono text-sm text-text-primary break-all",
|
|
1189
1227
|
children: e.externalName
|
|
1190
|
-
}), /* @__PURE__ */
|
|
1228
|
+
}), /* @__PURE__ */ _("div", {
|
|
1191
1229
|
className: "text-xs text-text-tertiary mt-0.5",
|
|
1192
1230
|
children: [
|
|
1193
1231
|
e.provider,
|
|
@@ -1199,179 +1237,179 @@ function tt() {
|
|
|
1199
1237
|
e.createdAt ? ` · created ${e.createdAt}` : ""
|
|
1200
1238
|
]
|
|
1201
1239
|
})]
|
|
1202
|
-
}), /* @__PURE__ */
|
|
1240
|
+
}), /* @__PURE__ */ g("button", {
|
|
1203
1241
|
type: "button",
|
|
1204
|
-
disabled:
|
|
1242
|
+
disabled: an === e.externalName,
|
|
1205
1243
|
onClick: async () => {
|
|
1206
|
-
|
|
1244
|
+
on(e.externalName), rn(null);
|
|
1207
1245
|
try {
|
|
1208
|
-
await
|
|
1209
|
-
agentId:
|
|
1246
|
+
await un({ variables: {
|
|
1247
|
+
agentId: en,
|
|
1210
1248
|
externalName: e.externalName,
|
|
1211
1249
|
name: e.externalName
|
|
1212
|
-
} }), await
|
|
1250
|
+
} }), await sn({ variables: { agentId: en } });
|
|
1213
1251
|
} catch (e) {
|
|
1214
|
-
|
|
1252
|
+
rn(e instanceof Error ? e.message : String(e));
|
|
1215
1253
|
} finally {
|
|
1216
|
-
|
|
1254
|
+
on(null);
|
|
1217
1255
|
}
|
|
1218
1256
|
},
|
|
1219
1257
|
className: "shrink-0 px-3 py-1.5 text-xs bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
1220
1258
|
"data-testid": `sessions-reconnect-adopt-${e.externalName}`,
|
|
1221
|
-
children:
|
|
1259
|
+
children: an === e.externalName ? b("sessions.adopting", "Adopting…") : b("sessions.adopt", "Adopt")
|
|
1222
1260
|
})]
|
|
1223
1261
|
}, e.externalName))
|
|
1224
1262
|
})
|
|
1225
1263
|
]
|
|
1226
1264
|
}),
|
|
1227
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ g("div", {
|
|
1228
1266
|
className: "flex justify-end gap-3 mt-6",
|
|
1229
|
-
children: /* @__PURE__ */
|
|
1267
|
+
children: /* @__PURE__ */ g("button", {
|
|
1230
1268
|
onClick: () => {
|
|
1231
|
-
|
|
1269
|
+
$t(!1), rn(null);
|
|
1232
1270
|
},
|
|
1233
1271
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1234
|
-
children:
|
|
1272
|
+
children: b("common.close", "Close")
|
|
1235
1273
|
})
|
|
1236
1274
|
})
|
|
1237
1275
|
]
|
|
1238
1276
|
})
|
|
1239
1277
|
});
|
|
1240
1278
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return /* @__PURE__ */
|
|
1279
|
+
function lr() {
|
|
1280
|
+
return /* @__PURE__ */ g("div", {
|
|
1243
1281
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1282
|
+
children: /* @__PURE__ */ _("div", {
|
|
1245
1283
|
className: "bg-bg-surface rounded-lg p-6 w-full max-w-lg",
|
|
1246
1284
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ g("h2", {
|
|
1248
1286
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
1249
|
-
children:
|
|
1287
|
+
children: b("sessions.newSession", "New Session")
|
|
1250
1288
|
}),
|
|
1251
|
-
/* @__PURE__ */
|
|
1289
|
+
/* @__PURE__ */ _("div", {
|
|
1252
1290
|
className: "space-y-4",
|
|
1253
1291
|
children: [
|
|
1254
|
-
xt && /* @__PURE__ */
|
|
1292
|
+
xt && /* @__PURE__ */ g("div", {
|
|
1255
1293
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1256
1294
|
children: xt
|
|
1257
1295
|
}),
|
|
1258
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
1259
1297
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1260
|
-
children:
|
|
1261
|
-
}), /* @__PURE__ */
|
|
1262
|
-
ref:
|
|
1298
|
+
children: b("sessions.name", "Name")
|
|
1299
|
+
}), /* @__PURE__ */ g("input", {
|
|
1300
|
+
ref: Dt,
|
|
1263
1301
|
type: "text",
|
|
1264
|
-
placeholder:
|
|
1302
|
+
placeholder: b("sessions.namePlaceholder", "dev-server"),
|
|
1265
1303
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
1266
1304
|
})] }),
|
|
1267
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
1268
1306
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1269
|
-
children:
|
|
1270
|
-
}), /* @__PURE__ */
|
|
1271
|
-
options:
|
|
1272
|
-
value:
|
|
1273
|
-
onChange:
|
|
1274
|
-
placeholder:
|
|
1275
|
-
searchPlaceholder:
|
|
1307
|
+
children: b("sessions.filterVibe", "Vibe")
|
|
1308
|
+
}), /* @__PURE__ */ g(u, {
|
|
1309
|
+
options: Pn,
|
|
1310
|
+
value: jt,
|
|
1311
|
+
onChange: Mt,
|
|
1312
|
+
placeholder: b("sessions.noVibe", "No vibe"),
|
|
1313
|
+
searchPlaceholder: b("sessions.searchVibes", "Search vibes..."),
|
|
1276
1314
|
clearable: !0
|
|
1277
1315
|
})] }),
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ _("div", { children: [
|
|
1317
|
+
/* @__PURE__ */ g("label", {
|
|
1280
1318
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1281
|
-
children:
|
|
1319
|
+
children: b("sessions.filterAgent", "Agent")
|
|
1282
1320
|
}),
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
options:
|
|
1285
|
-
value:
|
|
1286
|
-
onChange:
|
|
1287
|
-
placeholder:
|
|
1288
|
-
searchPlaceholder:
|
|
1321
|
+
/* @__PURE__ */ g(u, {
|
|
1322
|
+
options: Fn,
|
|
1323
|
+
value: Nt,
|
|
1324
|
+
onChange: Pt,
|
|
1325
|
+
placeholder: b("sessions.selectAgent", "Select an agent"),
|
|
1326
|
+
searchPlaceholder: b("sessions.searchAgents", "Search agents..."),
|
|
1289
1327
|
clearable: !0
|
|
1290
1328
|
}),
|
|
1291
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ g("p", {
|
|
1292
1330
|
className: "text-xs text-text-muted mt-1",
|
|
1293
|
-
children:
|
|
1331
|
+
children: b("sessions.agentHint", "Required when no vibe is selected. Overridden by the vibe's agent if a vibe is chosen.")
|
|
1294
1332
|
})
|
|
1295
1333
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
1297
1335
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1298
|
-
children:
|
|
1299
|
-
}), /* @__PURE__ */
|
|
1300
|
-
options:
|
|
1301
|
-
value:
|
|
1302
|
-
onChange:
|
|
1303
|
-
placeholder:
|
|
1304
|
-
searchPlaceholder:
|
|
1336
|
+
children: b("sessions.filterType", "Type")
|
|
1337
|
+
}), /* @__PURE__ */ g(u, {
|
|
1338
|
+
options: In,
|
|
1339
|
+
value: I,
|
|
1340
|
+
onChange: Ft,
|
|
1341
|
+
placeholder: b("sessions.selectType", "Select type"),
|
|
1342
|
+
searchPlaceholder: b("sessions.searchTypes", "Search types...")
|
|
1305
1343
|
})] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1344
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
1307
1345
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1308
|
-
children:
|
|
1309
|
-
}), /* @__PURE__ */
|
|
1310
|
-
ref:
|
|
1346
|
+
children: b("sessions.command", "Command")
|
|
1347
|
+
}), /* @__PURE__ */ g("input", {
|
|
1348
|
+
ref: Ot,
|
|
1311
1349
|
type: "text",
|
|
1312
|
-
placeholder:
|
|
1350
|
+
placeholder: b("sessions.commandPlaceholder", "bun run dev"),
|
|
1313
1351
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
1314
1352
|
})] }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ _("div", {
|
|
1316
1354
|
className: "flex items-center gap-2",
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1318
|
-
ref:
|
|
1355
|
+
children: [/* @__PURE__ */ g("input", {
|
|
1356
|
+
ref: kt,
|
|
1319
1357
|
type: "checkbox",
|
|
1320
1358
|
id: "autoStart",
|
|
1321
1359
|
className: "w-4 h-4 rounded border-border-default"
|
|
1322
|
-
}), /* @__PURE__ */
|
|
1360
|
+
}), /* @__PURE__ */ g("label", {
|
|
1323
1361
|
htmlFor: "autoStart",
|
|
1324
1362
|
className: "text-sm text-text-primary",
|
|
1325
|
-
children:
|
|
1363
|
+
children: b("sessions.autoStartWithVibe", "Auto-start with vibe")
|
|
1326
1364
|
})]
|
|
1327
1365
|
}),
|
|
1328
|
-
(
|
|
1366
|
+
(I === "TMUX" || I === "WEZTERM" || I === "ZELLIJ") && /* @__PURE__ */ _("div", {
|
|
1329
1367
|
className: "rounded-md border border-border-default bg-bg-sunken/40",
|
|
1330
1368
|
"data-testid": "sessions-create-advanced",
|
|
1331
|
-
children: [/* @__PURE__ */
|
|
1369
|
+
children: [/* @__PURE__ */ _("button", {
|
|
1332
1370
|
type: "button",
|
|
1333
|
-
onClick: () =>
|
|
1371
|
+
onClick: () => Lt((e) => !e),
|
|
1334
1372
|
className: "w-full flex items-center justify-between px-3 py-2 text-sm font-medium text-text-primary",
|
|
1335
|
-
"aria-expanded":
|
|
1336
|
-
children: [/* @__PURE__ */
|
|
1373
|
+
"aria-expanded": It,
|
|
1374
|
+
children: [/* @__PURE__ */ g("span", { children: b("sessions.advanced", "Advanced options") }), /* @__PURE__ */ g("span", {
|
|
1337
1375
|
className: "text-text-tertiary text-xs",
|
|
1338
|
-
children:
|
|
1376
|
+
children: It ? "▾" : "▸"
|
|
1339
1377
|
})]
|
|
1340
|
-
}),
|
|
1378
|
+
}), It && /* @__PURE__ */ _("div", {
|
|
1341
1379
|
className: "px-3 pb-3 space-y-2",
|
|
1342
1380
|
children: [
|
|
1343
|
-
/* @__PURE__ */
|
|
1381
|
+
/* @__PURE__ */ g("label", {
|
|
1344
1382
|
className: "block text-xs font-medium text-text-secondary",
|
|
1345
|
-
children:
|
|
1383
|
+
children: b("sessions.attachExistingLabel", "Attach to existing session (optional)")
|
|
1346
1384
|
}),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
ref:
|
|
1385
|
+
/* @__PURE__ */ g("input", {
|
|
1386
|
+
ref: At,
|
|
1349
1387
|
type: "text",
|
|
1350
1388
|
"data-testid": "sessions-create-external-name",
|
|
1351
|
-
placeholder:
|
|
1389
|
+
placeholder: I === "WEZTERM" ? "e.g. vibe-051c9c62 (existing wezterm workspace)" : I === "ZELLIJ" ? "e.g. vibe-051c9c62 (existing zellij session)" : "e.g. vibe-051c9c62 (existing tmux session)",
|
|
1352
1390
|
className: "w-full px-3 py-2 text-sm bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder font-mono"
|
|
1353
1391
|
}),
|
|
1354
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ g("p", {
|
|
1355
1393
|
className: "text-xs text-text-tertiary",
|
|
1356
|
-
children:
|
|
1394
|
+
children: b("sessions.attachExistingHint", "When set, the agent attaches to that existing session instead of creating a new one. Leave blank to spawn fresh.")
|
|
1357
1395
|
})
|
|
1358
1396
|
]
|
|
1359
1397
|
})]
|
|
1360
1398
|
})
|
|
1361
1399
|
]
|
|
1362
1400
|
}),
|
|
1363
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ _("div", {
|
|
1364
1402
|
className: "flex justify-end gap-3 mt-6",
|
|
1365
|
-
children: [/* @__PURE__ */
|
|
1366
|
-
onClick: () =>
|
|
1403
|
+
children: [/* @__PURE__ */ g("button", {
|
|
1404
|
+
onClick: () => O(!1),
|
|
1367
1405
|
disabled: St,
|
|
1368
1406
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1369
|
-
children:
|
|
1370
|
-
}), /* @__PURE__ */
|
|
1371
|
-
onClick:
|
|
1407
|
+
children: b("common.cancel", "Cancel")
|
|
1408
|
+
}), /* @__PURE__ */ g("button", {
|
|
1409
|
+
onClick: Jn,
|
|
1372
1410
|
disabled: St,
|
|
1373
1411
|
className: "px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
1374
|
-
children: St ?
|
|
1412
|
+
children: St ? b("sessions.creating", "Creating...") : b("sessions.createSession", "Create Session")
|
|
1375
1413
|
})]
|
|
1376
1414
|
})
|
|
1377
1415
|
]
|
|
@@ -1380,6 +1418,6 @@ function tt() {
|
|
|
1380
1418
|
}
|
|
1381
1419
|
}
|
|
1382
1420
|
//#endregion
|
|
1383
|
-
export {
|
|
1421
|
+
export { nt as SessionsPage };
|
|
1384
1422
|
|
|
1385
1423
|
//# sourceMappingURL=SessionsPage.js.map
|