@burdenoff/microfe-vibecontrols 2026.529.7 → 2026.529.8
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/pages/SessionsPage.js +305 -323
- package/dist/pages/SessionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -30,13 +30,13 @@ import { Activity as Re, CheckSquare as ze, Grid as Be, List as Ve, Monitor as H
|
|
|
30
30
|
import { useSearchParams as Ze } from "react-router-dom";
|
|
31
31
|
import { usePermissions as Qe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
32
32
|
import { AnimatePresence as $e } from "framer-motion";
|
|
33
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
34
|
-
import { SaveToFilesButton as
|
|
35
|
-
import { MotionItem as
|
|
36
|
-
import { AccessDenied as
|
|
33
|
+
import { Fragment as et, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
34
|
+
import { SaveToFilesButton as tt } from "@burdenoff/fe-libs/storage";
|
|
35
|
+
import { MotionItem as nt, MotionList as rt, MotionPage as _ } from "@burdenoff/fe-libs/shared/motion";
|
|
36
|
+
import { AccessDenied as it, PermissionButton as at } from "@burdenoff/fe-libs/shared/components";
|
|
37
37
|
//#region src/pages/SessionsPage.tsx
|
|
38
|
-
var
|
|
39
|
-
function
|
|
38
|
+
var ot = 3e5;
|
|
39
|
+
function st(e, t) {
|
|
40
40
|
if (!e) return null;
|
|
41
41
|
try {
|
|
42
42
|
let n = new URL(e);
|
|
@@ -53,7 +53,7 @@ function ot(e, t) {
|
|
|
53
53
|
return e;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ct(e, t, n, r) {
|
|
57
57
|
if (e !== "RUNNING") return e;
|
|
58
58
|
if (r === !1) return "ERROR";
|
|
59
59
|
if (!t) return e;
|
|
@@ -66,11 +66,11 @@ function st(e, t, n, r) {
|
|
|
66
66
|
}
|
|
67
67
|
return e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
let { t:
|
|
71
|
-
let r =
|
|
69
|
+
function lt() {
|
|
70
|
+
let { t: lt } = Le(), { onSessionStart: ut, workspaceId: dt } = ge(), ft = _e(), { hasPermission: pt, isLoading: mt, permissions: ht } = Qe(), [gt, _t] = Ze(), v = u((e, t, n) => {
|
|
71
|
+
let r = lt(e, n), i = r === e ? t : r;
|
|
72
72
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
73
|
-
}, [
|
|
73
|
+
}, [lt]), vt = f(() => [
|
|
74
74
|
{
|
|
75
75
|
value: "all",
|
|
76
76
|
label: v("sessions.statusAll", "All Statuses")
|
|
@@ -91,7 +91,7 @@ function ct() {
|
|
|
91
91
|
value: "ERROR",
|
|
92
92
|
label: v("common.error", "Error")
|
|
93
93
|
}
|
|
94
|
-
], [v]),
|
|
94
|
+
], [v]), yt = f(() => [
|
|
95
95
|
{
|
|
96
96
|
value: "all",
|
|
97
97
|
label: v("sessions.typeAll", "All Types")
|
|
@@ -112,66 +112,66 @@ function ct() {
|
|
|
112
112
|
value: "CUSTOM",
|
|
113
113
|
label: v("sessions.typeCustom", "Custom")
|
|
114
114
|
}
|
|
115
|
-
], [v]),
|
|
115
|
+
], [v]), bt = pt(Me.SESSION_LIST), xt = pt(Me.SESSION_CREATE), [y, St] = m(""), [b, Ct] = m("all"), [x, wt] = m("all"), [S, Tt] = m("all"), [C, Et] = m("all"), [w, T] = m("terminal"), [Dt, E] = m(!1), [Ot, D] = m(!1), [kt, O] = m(null), [At, jt] = m(!1), [Mt, k] = m(null), [A, j] = m(/* @__PURE__ */ new Set()), [Nt, M] = m(!1), [Pt, Ft] = m(!1), It = p(null), Lt = p(null), Rt = p(null), zt = p(null), [Bt, Vt] = m(""), [N, Ht] = m(""), [Ut, Wt] = m("default"), [P, Gt] = m("TMUX"), [Kt, qt] = m(!1), { terminalTabs: Jt, activeTerminalTabId: Yt, sessionsViewMode: Xt, setTerminalTabs: Zt, setActiveTerminalTabId: Qt, setSessionsViewMode: $t, activeSessionId: F } = ve(), [I, L] = m([]), [R, z] = m(null), [en, tn] = m(!1), [nn, B] = m(!1), [V, rn] = m(""), [an, H] = m(!1), [on, sn] = m(null), [cn, ln] = m(!1), [U, un] = m(!1), W = gt.get("view"), dn = gt.get("session"), [fn] = c({ refetchQueries: ["ListSessions"] }), { setDraftTagIds: pn, flushTags: mn } = we("VIBECONTROLS_SESSION"), [hn, gn] = m(!1), [_n, vn] = m(""), [yn, bn] = m(null), [xn, Sn] = m(null), [Cn, { data: wn, loading: Tn }] = a({ fetchPolicy: "network-only" }), [En] = i({ refetchQueries: ["ListSessions"] }), [Dn] = ce({ refetchQueries: ["ListSessions"] }), [On] = ue({ refetchQueries: ["ListSessions"] }), [kn] = ae({ refetchQueries: ["ListSessions"] }), [G] = le({ refetchQueries: ["ListSessions"] }), [An] = de({ refetchQueries: ["ListSessions"] }), [jn] = oe({ refetchQueries: ["ListSessions"] }), [Mn] = pe({ refetchQueries: ["ListSessions"] }), [Nn] = fe({ refetchQueries: ["ListSessions"] }), [Pn] = s({ refetchQueries: ["ListSessions"] }), [Fn] = te({ refetchQueries: ["ListSessions"] }), [In] = ee({ refetchQueries: ["ListSessions"] }), [Ln] = o({ refetchQueries: ["ListSessions"] }), [Rn] = ne();
|
|
116
116
|
d(() => {
|
|
117
|
-
U || (W === "terminal" || W === "grid" || W === "list" ? T(W) :
|
|
117
|
+
U || (W === "terminal" || W === "grid" || W === "list" ? T(W) : Xt && T(Xt), dn ? z(dn) : Yt && z(Yt), Jt.length > 0 && L(Jt.map((e) => ({
|
|
118
118
|
sessionId: e.sessionId,
|
|
119
119
|
name: e.name,
|
|
120
120
|
terminalUrl: null,
|
|
121
121
|
loading: !1,
|
|
122
122
|
error: null
|
|
123
|
-
}))),
|
|
123
|
+
}))), un(!0));
|
|
124
124
|
}, [
|
|
125
|
-
qt,
|
|
126
125
|
Jt,
|
|
127
126
|
Yt,
|
|
128
|
-
|
|
127
|
+
Xt,
|
|
128
|
+
dn,
|
|
129
129
|
W,
|
|
130
130
|
U
|
|
131
131
|
]);
|
|
132
|
-
let
|
|
132
|
+
let zn = p(!1);
|
|
133
133
|
d(() => {
|
|
134
|
-
U &&
|
|
134
|
+
U && Zt(I.map((e) => ({
|
|
135
135
|
sessionId: e.sessionId,
|
|
136
136
|
name: e.name
|
|
137
137
|
})));
|
|
138
138
|
}, [
|
|
139
139
|
I,
|
|
140
140
|
U,
|
|
141
|
-
|
|
141
|
+
Zt
|
|
142
142
|
]), d(() => {
|
|
143
|
-
U &&
|
|
143
|
+
U && Qt(R);
|
|
144
144
|
}, [
|
|
145
145
|
R,
|
|
146
146
|
U,
|
|
147
|
-
|
|
147
|
+
Qt
|
|
148
148
|
]), d(() => {
|
|
149
|
-
U &&
|
|
149
|
+
U && $t(w);
|
|
150
150
|
}, [
|
|
151
151
|
w,
|
|
152
152
|
U,
|
|
153
|
-
|
|
153
|
+
$t
|
|
154
154
|
]), d(() => {
|
|
155
155
|
if (!U) return;
|
|
156
|
-
let e = new URLSearchParams(
|
|
157
|
-
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 &&
|
|
156
|
+
let e = new URLSearchParams(gt), t = !1, n = w === "terminal" ? null : w;
|
|
157
|
+
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 && _t(e, { replace: !0 });
|
|
158
158
|
}, [
|
|
159
159
|
R,
|
|
160
|
-
ht,
|
|
161
160
|
gt,
|
|
161
|
+
_t,
|
|
162
162
|
U,
|
|
163
163
|
w
|
|
164
164
|
]);
|
|
165
165
|
let K = p(null);
|
|
166
166
|
se({
|
|
167
|
-
skip: !
|
|
168
|
-
variables: { workspaceId:
|
|
167
|
+
skip: !dt,
|
|
168
|
+
variables: { workspaceId: dt || "" }
|
|
169
169
|
}), d(() => {
|
|
170
170
|
let e = setInterval(() => {
|
|
171
|
-
|
|
172
|
-
},
|
|
171
|
+
Pn().catch(() => {});
|
|
172
|
+
}, ot);
|
|
173
173
|
return () => clearInterval(e);
|
|
174
|
-
}, [
|
|
174
|
+
}, [Pn]), d(() => {
|
|
175
175
|
let e = (e) => {
|
|
176
176
|
let t = e.target;
|
|
177
177
|
if (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable) return;
|
|
@@ -203,17 +203,17 @@ function ct() {
|
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
if (n && (e.key === "p" || e.key === "P")) {
|
|
206
|
-
e.preventDefault(),
|
|
206
|
+
e.preventDefault(), rn(""), B(!0);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
if (!n && !e.altKey && !e.shiftKey && e.key === "?") {
|
|
210
|
-
e.preventDefault(),
|
|
210
|
+
e.preventDefault(), tn(!0);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
215
215
|
}, [R, I]);
|
|
216
|
-
let { data:
|
|
216
|
+
let { data: Bn, previousData: Vn, loading: q, error: Hn, refetch: J } = ie({
|
|
217
217
|
variables: {
|
|
218
218
|
filter: {
|
|
219
219
|
status: b === "all" ? void 0 : b,
|
|
@@ -224,17 +224,17 @@ function ct() {
|
|
|
224
224
|
pagination: { limit: 50 }
|
|
225
225
|
},
|
|
226
226
|
fetchPolicy: b === "all" && x === "all" && S === "all" && C === "all" ? "cache-first" : "cache-and-network"
|
|
227
|
-
}),
|
|
227
|
+
}), Un = Bn ?? Vn, { agents: Y, vibes: Wn } = ye(), [Gn, Kn] = he({
|
|
228
228
|
fetchPolicy: "network-only",
|
|
229
229
|
notifyOnNetworkStatusChange: !0
|
|
230
|
-
}), { data:
|
|
231
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
230
|
+
}), { data: qn } = me(), Jn = f(() => {
|
|
231
|
+
let e = /* @__PURE__ */ new Map(), t = qn?.vibecontrolsAgentHealthProbeStream ?? Kn.data?.vibecontrolsAgentHealthProbes ?? [];
|
|
232
232
|
for (let n of t) e.set(n.agentId, {
|
|
233
233
|
healthy: n.healthy,
|
|
234
234
|
error: n.errorMessage ?? null
|
|
235
235
|
});
|
|
236
236
|
return e;
|
|
237
|
-
}, [
|
|
237
|
+
}, [Kn.data, qn]), Yn = f(() => [
|
|
238
238
|
{
|
|
239
239
|
value: "all",
|
|
240
240
|
label: v("sessions.filterVibeAll", "All Vibes")
|
|
@@ -243,37 +243,37 @@ function ct() {
|
|
|
243
243
|
value: "none",
|
|
244
244
|
label: v("sessions.filterVibeNone", "No Vibe")
|
|
245
245
|
},
|
|
246
|
-
...
|
|
246
|
+
...Wn.map((e) => ({
|
|
247
247
|
value: e.id,
|
|
248
248
|
label: e.name
|
|
249
249
|
}))
|
|
250
|
-
], [
|
|
250
|
+
], [Wn, v]), Xn = f(() => [{
|
|
251
251
|
value: "all",
|
|
252
252
|
label: v("sessions.filterAgentAll", "All Agents")
|
|
253
|
-
}, ...
|
|
253
|
+
}, ...Y.map((e) => ({
|
|
254
254
|
value: e.id,
|
|
255
255
|
label: `${e.name} ${je(e) === "ACTIVE" ? "" : `(${v("sessions.offline", "Offline")})`}`
|
|
256
|
-
}))], [
|
|
256
|
+
}))], [Y, v]), Zn = f(() => [{
|
|
257
257
|
value: "",
|
|
258
258
|
label: v("sessions.noVibe", "No vibe")
|
|
259
|
-
}, ...
|
|
259
|
+
}, ...Wn.map((e) => ({
|
|
260
260
|
value: e.id,
|
|
261
261
|
label: e.name
|
|
262
|
-
}))], [
|
|
262
|
+
}))], [Wn, v]), Qn = f(() => [{
|
|
263
263
|
value: "",
|
|
264
264
|
label: v("sessions.selectAgent", "Select an agent")
|
|
265
|
-
}, ...
|
|
265
|
+
}, ...Y.map((e) => {
|
|
266
266
|
let t = je(e) === "ACTIVE" ? v("sessions.active", "Active") : v("sessions.offline", "Offline");
|
|
267
267
|
return {
|
|
268
268
|
value: e.id,
|
|
269
269
|
label: `${e.name} (${t})`
|
|
270
270
|
};
|
|
271
|
-
})], [
|
|
271
|
+
})], [Y, v]), { data: $n } = re({
|
|
272
272
|
variables: { agentId: N },
|
|
273
273
|
skip: !N,
|
|
274
274
|
fetchPolicy: "cache-and-network"
|
|
275
|
-
}),
|
|
276
|
-
let e = (
|
|
275
|
+
}), er = f(() => {
|
|
276
|
+
let e = ($n?.vibecontrolsAgentProfiles ?? []).map((e) => ({
|
|
277
277
|
value: e.name,
|
|
278
278
|
label: e.status && e.status !== "ACTIVE" ? `${e.name} (${e.status})` : e.name
|
|
279
279
|
}));
|
|
@@ -281,11 +281,11 @@ function ct() {
|
|
|
281
281
|
value: "default",
|
|
282
282
|
label: "default"
|
|
283
283
|
}, ...e];
|
|
284
|
-
}, [
|
|
284
|
+
}, [$n]);
|
|
285
285
|
d(() => {
|
|
286
|
-
|
|
286
|
+
Wt("default");
|
|
287
287
|
}, [N]);
|
|
288
|
-
let
|
|
288
|
+
let tr = f(() => [
|
|
289
289
|
{
|
|
290
290
|
value: "TMUX",
|
|
291
291
|
label: v("sessions.typeTmuxLower", "tmux")
|
|
@@ -314,8 +314,8 @@ function ct() {
|
|
|
314
314
|
value: "CUSTOM",
|
|
315
315
|
label: v("sessions.typeCustom", "Custom")
|
|
316
316
|
}
|
|
317
|
-
], [v]), X = f(() => (
|
|
318
|
-
let t =
|
|
317
|
+
], [v]), X = f(() => (Un?.sessions?.items ?? []).map((e) => {
|
|
318
|
+
let t = st(e.ttydUrl || null, e.agent?.tunnelUrl || null);
|
|
319
319
|
return {
|
|
320
320
|
id: e.id,
|
|
321
321
|
workspaceId: e.workspaceId,
|
|
@@ -324,7 +324,7 @@ function ct() {
|
|
|
324
324
|
profile: e.profile ?? "default",
|
|
325
325
|
name: e.name,
|
|
326
326
|
type: e.type,
|
|
327
|
-
status:
|
|
327
|
+
status: ct(e.status, e.ttydUrl || null, t, e.agent ? je(e.agent) === "ACTIVE" : void 0),
|
|
328
328
|
command: e.command || null,
|
|
329
329
|
workingDirectory: e.workingDirectory || null,
|
|
330
330
|
environmentVariables: e.environmentVariables || {},
|
|
@@ -349,12 +349,12 @@ function ct() {
|
|
|
349
349
|
isActive: e.agent.isActive
|
|
350
350
|
} : void 0
|
|
351
351
|
};
|
|
352
|
-
}), [
|
|
352
|
+
}), [Un?.sessions?.items]);
|
|
353
353
|
d(() => {
|
|
354
|
-
|
|
354
|
+
zn.current || X.length === 0 || I.length === 0 || (zn.current = !0, Promise.allSettled(I.map(async (e) => {
|
|
355
355
|
let t = X.find((t) => t.id === e.sessionId);
|
|
356
356
|
if (t) try {
|
|
357
|
-
let n = await G({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i =
|
|
357
|
+
let n = await G({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i = st(n.data?.startSessionTerminal?.ttydUrl ?? null, r);
|
|
358
358
|
L((n) => n.map((n) => n.sessionId === e.sessionId ? {
|
|
359
359
|
...n,
|
|
360
360
|
terminalUrl: i,
|
|
@@ -432,20 +432,20 @@ function ct() {
|
|
|
432
432
|
X,
|
|
433
433
|
y,
|
|
434
434
|
S
|
|
435
|
-
]),
|
|
435
|
+
]), nr = u((e) => {
|
|
436
436
|
j((t) => {
|
|
437
437
|
let n = new Set(t);
|
|
438
438
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
439
439
|
});
|
|
440
|
-
}, []),
|
|
440
|
+
}, []), rr = u(() => {
|
|
441
441
|
j(new Set(Z.map((e) => e.id)));
|
|
442
|
-
}, [Z]),
|
|
442
|
+
}, [Z]), ir = u(() => {
|
|
443
443
|
j(/* @__PURE__ */ new Set());
|
|
444
|
-
}, []),
|
|
444
|
+
}, []), ar = Z.length > 0 && A.size === Z.length, or = A.size > 0, sr = u(async () => {
|
|
445
445
|
if (A.size !== 0) {
|
|
446
446
|
M(!0);
|
|
447
447
|
try {
|
|
448
|
-
let e = (await
|
|
448
|
+
let e = (await Fn({ variables: { ids: Array.from(A) } })).data?.bulkStopSessions;
|
|
449
449
|
k(`${v("sessions.stopped", "Stopped")} ${e?.succeeded ?? 0} ${v("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${v("sessions.failed", "failed")}` : ""}`), j(/* @__PURE__ */ new Set()), setTimeout(() => k(null), 3e3);
|
|
450
450
|
} catch (e) {
|
|
451
451
|
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedStop", "Failed to stop sessions")}`), setTimeout(() => k(null), 5e3);
|
|
@@ -455,13 +455,13 @@ function ct() {
|
|
|
455
455
|
}
|
|
456
456
|
}, [
|
|
457
457
|
A,
|
|
458
|
-
|
|
458
|
+
Fn,
|
|
459
459
|
v
|
|
460
|
-
]),
|
|
460
|
+
]), cr = u(async () => {
|
|
461
461
|
if (A.size !== 0) {
|
|
462
462
|
M(!0);
|
|
463
463
|
try {
|
|
464
|
-
let e = (await
|
|
464
|
+
let e = (await In({ variables: { ids: Array.from(A) } })).data?.bulkRestartSessions;
|
|
465
465
|
k(`${v("sessions.restarted", "Restarted")} ${e?.succeeded ?? 0} ${v("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${v("sessions.failed", "failed")}` : ""}`), j(/* @__PURE__ */ new Set()), setTimeout(() => k(null), 3e3);
|
|
466
466
|
} catch (e) {
|
|
467
467
|
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedRestart", "Failed to restart sessions")}`), setTimeout(() => k(null), 5e3);
|
|
@@ -471,13 +471,13 @@ function ct() {
|
|
|
471
471
|
}
|
|
472
472
|
}, [
|
|
473
473
|
A,
|
|
474
|
-
|
|
474
|
+
In,
|
|
475
475
|
v
|
|
476
|
-
]),
|
|
476
|
+
]), lr = u(async () => {
|
|
477
477
|
if (A.size !== 0 && confirm(`${v("sessions.confirmRemovePrefix", "Are you sure you want to remove")} ${A.size} ${v("nav.sessions", "session(s)")}? ${v("sessions.confirmRemoveSuffix", "This cannot be undone.")}`)) {
|
|
478
478
|
M(!0);
|
|
479
479
|
try {
|
|
480
|
-
let e = (await
|
|
480
|
+
let e = (await Ln({ variables: { ids: Array.from(A) } })).data?.bulkTerminateSessions;
|
|
481
481
|
k(`${v("sessions.removed", "Removed")} ${e?.succeeded ?? 0} ${v("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${v("sessions.failed", "failed")}` : ""}`), j(/* @__PURE__ */ new Set()), setTimeout(() => k(null), 3e3);
|
|
482
482
|
} catch (e) {
|
|
483
483
|
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedRemove", "Failed to remove sessions")}`), setTimeout(() => k(null), 5e3);
|
|
@@ -487,12 +487,12 @@ function ct() {
|
|
|
487
487
|
}
|
|
488
488
|
}, [
|
|
489
489
|
A,
|
|
490
|
-
|
|
490
|
+
Ln,
|
|
491
491
|
v
|
|
492
|
-
]),
|
|
493
|
-
|
|
492
|
+
]), ur = u(async (e = "CSV") => {
|
|
493
|
+
Ft(!0);
|
|
494
494
|
try {
|
|
495
|
-
let t = (await
|
|
495
|
+
let t = (await Rn({ variables: { input: {
|
|
496
496
|
filter: {
|
|
497
497
|
status: b === "all" ? void 0 : b,
|
|
498
498
|
type: x === "all" ? void 0 : x,
|
|
@@ -510,44 +510,44 @@ function ct() {
|
|
|
510
510
|
} catch (e) {
|
|
511
511
|
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedExport", "Failed to export sessions")}`), setTimeout(() => k(null), 5e3);
|
|
512
512
|
} finally {
|
|
513
|
-
|
|
513
|
+
Ft(!1);
|
|
514
514
|
}
|
|
515
515
|
}, [
|
|
516
|
-
|
|
516
|
+
Rn,
|
|
517
517
|
b,
|
|
518
518
|
x,
|
|
519
519
|
S,
|
|
520
520
|
C,
|
|
521
521
|
v
|
|
522
|
-
]),
|
|
523
|
-
|
|
524
|
-
},
|
|
522
|
+
]), dr = (e) => {
|
|
523
|
+
ft(`/sessions/${e.id}`);
|
|
524
|
+
}, fr = () => {
|
|
525
525
|
O(null), E(!0);
|
|
526
|
-
},
|
|
527
|
-
let e =
|
|
526
|
+
}, pr = async () => {
|
|
527
|
+
let e = It.current?.value?.trim(), t = Bt, i = N, a = P, ee = Lt.current?.value?.trim(), te = Rt.current?.checked ?? !1;
|
|
528
528
|
if (!e) {
|
|
529
529
|
O(v("sessions.nameRequired", "Name is required"));
|
|
530
530
|
return;
|
|
531
531
|
}
|
|
532
|
-
let o =
|
|
532
|
+
let o = Wn.find((e) => e.id === t)?.agents ?? [], s = null;
|
|
533
533
|
if (i && (!t || o.some((e) => e.id === i)) ? s = i : o.length === 1 && (s = o[0]?.id ?? null), !s) {
|
|
534
534
|
O(t && o.length === 0 ? v("sessions.noAgentAttached", "This vibe has no agents attached. Attach one from the Vibe → Agents tab before creating sessions.") : t && o.length > 1 ? v("sessions.pickAgentFromVibe", "This vibe has multiple agents attached. Pick one before creating the session.") : v("sessions.agentRequired", "Please select an agent for this session."));
|
|
535
535
|
return;
|
|
536
536
|
}
|
|
537
|
-
let c =
|
|
537
|
+
let c = Jn.get(s);
|
|
538
538
|
if (c && !c.healthy) {
|
|
539
539
|
O(v("sessions.agentNotHealthy", "The selected agent isn’t fully reachable right now. Please wait for the agent badge to turn green and retry.") + (c.error ? ` (${c.error})` : ""));
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
|
|
542
|
+
jt(!0), O(null);
|
|
543
543
|
try {
|
|
544
|
-
let i =
|
|
544
|
+
let i = zt.current?.value?.trim() || void 0, o = await fn({ variables: { input: {
|
|
545
545
|
name: e,
|
|
546
546
|
type: a || "TMUX",
|
|
547
547
|
command: ee || void 0,
|
|
548
548
|
vibeId: t || void 0,
|
|
549
549
|
agentId: s,
|
|
550
|
-
profile:
|
|
550
|
+
profile: Ut?.trim() || "default",
|
|
551
551
|
autoStart: te,
|
|
552
552
|
externalSessionName: i
|
|
553
553
|
} } });
|
|
@@ -564,8 +564,8 @@ function ct() {
|
|
|
564
564
|
O(v("sessions.failedCreate", "Failed to create session"));
|
|
565
565
|
return;
|
|
566
566
|
}
|
|
567
|
-
if (E(!1), k(v("sessions.createdSuccess", "Session created successfully")), await
|
|
568
|
-
let e = o.data.createSession, t = e.agentId ?
|
|
567
|
+
if (E(!1), k(v("sessions.createdSuccess", "Session created successfully")), await mn(c), setTimeout(() => k(null), 3e3), o.data?.createSession) {
|
|
568
|
+
let e = o.data.createSession, t = e.agentId ? Y.find((t) => t.id === e.agentId) : null;
|
|
569
569
|
Q({
|
|
570
570
|
id: e.id,
|
|
571
571
|
workspaceId: e.workspaceId,
|
|
@@ -603,11 +603,11 @@ function ct() {
|
|
|
603
603
|
}
|
|
604
604
|
O(e instanceof Error ? e.message : v("sessions.failedCreate", "Failed to create session"));
|
|
605
605
|
} finally {
|
|
606
|
-
|
|
606
|
+
jt(!1);
|
|
607
607
|
}
|
|
608
|
-
},
|
|
608
|
+
}, mr = async (e) => {
|
|
609
609
|
try {
|
|
610
|
-
await
|
|
610
|
+
await Dn({ variables: { id: e.id } }), ut?.({
|
|
611
611
|
id: e.id,
|
|
612
612
|
name: e.name,
|
|
613
613
|
type: e.type,
|
|
@@ -620,15 +620,15 @@ function ct() {
|
|
|
620
620
|
}
|
|
621
621
|
console.error("Failed to start session:", e);
|
|
622
622
|
}
|
|
623
|
-
},
|
|
623
|
+
}, hr = async (e) => {
|
|
624
624
|
try {
|
|
625
|
-
await
|
|
625
|
+
await On({ variables: { id: e.id } });
|
|
626
626
|
} catch (e) {
|
|
627
627
|
console.error("Failed to stop session:", e);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
629
|
+
}, gr = async (e) => {
|
|
630
630
|
try {
|
|
631
|
-
await
|
|
631
|
+
await kn({ variables: { id: e.id } });
|
|
632
632
|
} catch (e) {
|
|
633
633
|
if (n(e)) {
|
|
634
634
|
r(), D(!0);
|
|
@@ -636,20 +636,20 @@ function ct() {
|
|
|
636
636
|
}
|
|
637
637
|
console.error("Failed to restart session:", e);
|
|
638
638
|
}
|
|
639
|
-
},
|
|
639
|
+
}, _r = async (e) => {
|
|
640
640
|
try {
|
|
641
|
-
await
|
|
641
|
+
await Nn({ variables: { id: e.id } });
|
|
642
642
|
} catch (e) {
|
|
643
643
|
console.error("Failed to terminate session:", e);
|
|
644
644
|
}
|
|
645
|
-
},
|
|
646
|
-
|
|
645
|
+
}, vr = u((e) => e.ttydUrl || null, []), yr = u((e) => {
|
|
646
|
+
sn(e);
|
|
647
647
|
}, []), Q = u(async (e) => {
|
|
648
648
|
if (I.find((t) => t.sessionId === e.id)?.terminalUrl) {
|
|
649
649
|
z(e.id), H(!1);
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
|
-
let t =
|
|
652
|
+
let t = vr(e);
|
|
653
653
|
if (t) {
|
|
654
654
|
let n = {
|
|
655
655
|
sessionId: e.id,
|
|
@@ -679,7 +679,7 @@ function ct() {
|
|
|
679
679
|
L(t), R === e.id && z(t.length > 0 ? t[t.length - 1].sessionId : null), r(), D(!0);
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
|
-
let i =
|
|
682
|
+
let i = st(t.data?.startSessionTerminal?.ttydUrl || null, X.find((t) => t.id === e.id)?.agent?.tunnelUrl ?? null);
|
|
683
683
|
L((t) => t.map((t) => t.sessionId === e.id ? {
|
|
684
684
|
...t,
|
|
685
685
|
terminalUrl: i,
|
|
@@ -702,7 +702,7 @@ function ct() {
|
|
|
702
702
|
}, [
|
|
703
703
|
R,
|
|
704
704
|
I,
|
|
705
|
-
|
|
705
|
+
vr,
|
|
706
706
|
G
|
|
707
707
|
]);
|
|
708
708
|
d(() => {
|
|
@@ -716,17 +716,17 @@ function ct() {
|
|
|
716
716
|
I,
|
|
717
717
|
U
|
|
718
718
|
]);
|
|
719
|
-
let
|
|
719
|
+
let br = u((e) => {
|
|
720
720
|
L((t) => t.filter((t) => t.sessionId !== e)), R === e && z(() => {
|
|
721
721
|
let t = I.filter((t) => t.sessionId !== e);
|
|
722
722
|
return t.length > 0 ? t[t.length - 1].sessionId : null;
|
|
723
723
|
});
|
|
724
|
-
}, [R, I]),
|
|
724
|
+
}, [R, I]), xr = u((e) => {
|
|
725
725
|
let t = I.find((t) => t.sessionId === e);
|
|
726
726
|
t?.terminalUrl && window.open(t.terminalUrl, "_blank");
|
|
727
|
-
}, [I]),
|
|
727
|
+
}, [I]), Sr = u(async (e, t) => {
|
|
728
728
|
try {
|
|
729
|
-
await
|
|
729
|
+
await Mn({ variables: {
|
|
730
730
|
id: e,
|
|
731
731
|
input: { name: t }
|
|
732
732
|
} }), L((n) => n.map((n) => n.sessionId === e ? {
|
|
@@ -736,9 +736,9 @@ function ct() {
|
|
|
736
736
|
} catch (e) {
|
|
737
737
|
console.error("Failed to rename session:", e);
|
|
738
738
|
}
|
|
739
|
-
}, [
|
|
739
|
+
}, [Mn]), Cr = u(async (e) => {
|
|
740
740
|
try {
|
|
741
|
-
await
|
|
741
|
+
await An({ variables: { id: e } }), L((t) => t.map((t) => t.sessionId === e ? {
|
|
742
742
|
...t,
|
|
743
743
|
terminalUrl: null,
|
|
744
744
|
error: v("sessions.terminalStopped", "Terminal stopped")
|
|
@@ -746,7 +746,7 @@ function ct() {
|
|
|
746
746
|
} catch (e) {
|
|
747
747
|
console.error("Failed to stop terminal:", e);
|
|
748
748
|
}
|
|
749
|
-
}, [
|
|
749
|
+
}, [An]), wr = u(async (e) => {
|
|
750
750
|
let t = I.find((t) => t.sessionId === e) || null;
|
|
751
751
|
try {
|
|
752
752
|
L((t) => t.map((t) => t.sessionId === e ? {
|
|
@@ -755,7 +755,7 @@ function ct() {
|
|
|
755
755
|
error: null,
|
|
756
756
|
terminalUrl: null
|
|
757
757
|
} : t));
|
|
758
|
-
let i = await
|
|
758
|
+
let i = await jn({ variables: { id: e } });
|
|
759
759
|
if (i.error && n(i.error)) {
|
|
760
760
|
L((n) => n.map((n) => n.sessionId === e ? {
|
|
761
761
|
...n,
|
|
@@ -789,38 +789,38 @@ function ct() {
|
|
|
789
789
|
error: a
|
|
790
790
|
} : t));
|
|
791
791
|
}
|
|
792
|
-
}, [
|
|
793
|
-
|
|
792
|
+
}, [jn, I]), Tr = u(() => {
|
|
793
|
+
ln((e) => !e);
|
|
794
794
|
}, []), $ = {
|
|
795
795
|
total: X.length,
|
|
796
796
|
running: X.filter((e) => e.status === "RUNNING").length,
|
|
797
797
|
stopped: X.filter((e) => e.status === "STOPPED").length
|
|
798
798
|
};
|
|
799
|
-
if (
|
|
799
|
+
if (mt) return /* @__PURE__ */ h(_, {
|
|
800
800
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
801
801
|
children: /* @__PURE__ */ h(xe, { message: v("sessions.loadingPermissions", "Loading permissions...") })
|
|
802
802
|
});
|
|
803
|
-
if (
|
|
803
|
+
if (ht && ht.permissionStrings?.length > 0 && !bt) return /* @__PURE__ */ h(_, {
|
|
804
804
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
805
|
-
children: /* @__PURE__ */ h(
|
|
805
|
+
children: /* @__PURE__ */ h(it, {
|
|
806
806
|
title: v("common.accessDeniedTitle", "Access Denied"),
|
|
807
807
|
description: v("sessions.accessDeniedDescription", "You don't have permission to view sessions."),
|
|
808
808
|
details: v("sessions.requiredPermission", "Required permission: session:list")
|
|
809
809
|
})
|
|
810
810
|
});
|
|
811
|
-
if (q && !
|
|
811
|
+
if (q && !Vn && X.length === 0) return /* @__PURE__ */ h(_, {
|
|
812
812
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
813
813
|
children: /* @__PURE__ */ h(xe, { message: v("sessions.loading", "Loading sessions...") })
|
|
814
814
|
});
|
|
815
|
-
if (
|
|
815
|
+
if (Hn && X.length === 0) return /* @__PURE__ */ h(_, {
|
|
816
816
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
817
817
|
children: /* @__PURE__ */ h(Se, {
|
|
818
818
|
title: v("sessions.failedLoad", "Failed to load sessions"),
|
|
819
|
-
message:
|
|
819
|
+
message: Hn.message,
|
|
820
820
|
onRetry: () => J()
|
|
821
821
|
})
|
|
822
822
|
});
|
|
823
|
-
let
|
|
823
|
+
let Er = () => !or || w === "terminal" ? null : /* @__PURE__ */ g("div", {
|
|
824
824
|
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",
|
|
825
825
|
children: [/* @__PURE__ */ h("span", {
|
|
826
826
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -830,8 +830,8 @@ function ct() {
|
|
|
830
830
|
children: [
|
|
831
831
|
/* @__PURE__ */ g("button", {
|
|
832
832
|
type: "button",
|
|
833
|
-
onClick:
|
|
834
|
-
disabled:
|
|
833
|
+
onClick: sr,
|
|
834
|
+
disabled: Nt,
|
|
835
835
|
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",
|
|
836
836
|
children: [
|
|
837
837
|
/* @__PURE__ */ h(qe, { className: "size-3" }),
|
|
@@ -841,8 +841,8 @@ function ct() {
|
|
|
841
841
|
}),
|
|
842
842
|
/* @__PURE__ */ g("button", {
|
|
843
843
|
type: "button",
|
|
844
|
-
onClick:
|
|
845
|
-
disabled:
|
|
844
|
+
onClick: cr,
|
|
845
|
+
disabled: Nt,
|
|
846
846
|
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",
|
|
847
847
|
children: [
|
|
848
848
|
/* @__PURE__ */ h(Ke, { className: "size-3" }),
|
|
@@ -852,8 +852,8 @@ function ct() {
|
|
|
852
852
|
}),
|
|
853
853
|
/* @__PURE__ */ g("button", {
|
|
854
854
|
type: "button",
|
|
855
|
-
onClick:
|
|
856
|
-
disabled:
|
|
855
|
+
onClick: lr,
|
|
856
|
+
disabled: Nt,
|
|
857
857
|
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",
|
|
858
858
|
children: [
|
|
859
859
|
/* @__PURE__ */ h(Ye, { className: "size-3" }),
|
|
@@ -863,7 +863,7 @@ function ct() {
|
|
|
863
863
|
}),
|
|
864
864
|
/* @__PURE__ */ g("button", {
|
|
865
865
|
type: "button",
|
|
866
|
-
onClick:
|
|
866
|
+
onClick: ir,
|
|
867
867
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
868
868
|
children: [
|
|
869
869
|
/* @__PURE__ */ h(Xe, { className: "size-3" }),
|
|
@@ -873,7 +873,55 @@ function ct() {
|
|
|
873
873
|
})
|
|
874
874
|
]
|
|
875
875
|
})]
|
|
876
|
-
})
|
|
876
|
+
}), Dr = /* @__PURE__ */ g("div", {
|
|
877
|
+
className: "flex items-center gap-0.5 rounded-md bg-bg-sunken p-0.5 flex-shrink-0",
|
|
878
|
+
children: [
|
|
879
|
+
/* @__PURE__ */ h("button", {
|
|
880
|
+
type: "button",
|
|
881
|
+
onClick: () => T("terminal"),
|
|
882
|
+
className: `p-1.5 rounded ${w === "terminal" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
883
|
+
title: v("sessions.terminalViewTitle", "Terminal view"),
|
|
884
|
+
"aria-label": v("sessions.terminalViewTitle", "Terminal view"),
|
|
885
|
+
children: /* @__PURE__ */ h(He, { className: "size-4 text-text-secondary" })
|
|
886
|
+
}),
|
|
887
|
+
/* @__PURE__ */ h("button", {
|
|
888
|
+
type: "button",
|
|
889
|
+
onClick: () => T("grid"),
|
|
890
|
+
className: `p-1.5 rounded ${w === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
891
|
+
title: v("sessions.gridViewTitle", "Grid view"),
|
|
892
|
+
"aria-label": v("sessions.gridViewTitle", "Grid view"),
|
|
893
|
+
children: /* @__PURE__ */ h(Be, { className: "size-4 text-text-secondary" })
|
|
894
|
+
}),
|
|
895
|
+
/* @__PURE__ */ h("button", {
|
|
896
|
+
type: "button",
|
|
897
|
+
onClick: () => T("list"),
|
|
898
|
+
className: `p-1.5 rounded ${w === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
899
|
+
title: v("sessions.listViewTitle", "List view"),
|
|
900
|
+
"aria-label": v("sessions.listViewTitle", "List view"),
|
|
901
|
+
children: /* @__PURE__ */ h(Ve, { className: "size-4 text-text-secondary" })
|
|
902
|
+
})
|
|
903
|
+
]
|
|
904
|
+
}), Or = /* @__PURE__ */ g(et, { children: [
|
|
905
|
+
Dt && Ar(),
|
|
906
|
+
kr(),
|
|
907
|
+
on && /* @__PURE__ */ h(Ie, {
|
|
908
|
+
session: on,
|
|
909
|
+
isOpen: !!on,
|
|
910
|
+
onClose: () => sn(null)
|
|
911
|
+
}),
|
|
912
|
+
/* @__PURE__ */ h(e, {
|
|
913
|
+
isOpen: Ot,
|
|
914
|
+
onClose: () => D(!1),
|
|
915
|
+
onConfirm: () => {
|
|
916
|
+
D(!1), ft("/billing");
|
|
917
|
+
},
|
|
918
|
+
title: t("session").title,
|
|
919
|
+
message: t("session").message,
|
|
920
|
+
confirmLabel: "View Billing",
|
|
921
|
+
cancelLabel: "Dismiss",
|
|
922
|
+
variant: "warning"
|
|
923
|
+
})
|
|
924
|
+
] });
|
|
877
925
|
if (w === "terminal") return /* @__PURE__ */ g(_, {
|
|
878
926
|
className: "flex flex-col bg-bg-surface h-screen",
|
|
879
927
|
children: [
|
|
@@ -896,7 +944,7 @@ function ct() {
|
|
|
896
944
|
children: [
|
|
897
945
|
/* @__PURE__ */ h("button", {
|
|
898
946
|
type: "button",
|
|
899
|
-
onClick: () =>
|
|
947
|
+
onClick: () => Pn().then(() => J()),
|
|
900
948
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors",
|
|
901
949
|
title: v("sessions.checkHealth", "Check session health"),
|
|
902
950
|
children: /* @__PURE__ */ h(Re, { className: "size-3.5" })
|
|
@@ -904,39 +952,14 @@ function ct() {
|
|
|
904
952
|
/* @__PURE__ */ h("button", {
|
|
905
953
|
type: "button",
|
|
906
954
|
onClick: () => {
|
|
907
|
-
J(),
|
|
955
|
+
J(), Gn();
|
|
908
956
|
},
|
|
909
957
|
disabled: q,
|
|
910
958
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
911
959
|
title: v("common.refresh", "Refresh"),
|
|
912
960
|
children: /* @__PURE__ */ h(Ge, { className: `size-3.5 ${q ? "animate-spin" : ""}` })
|
|
913
961
|
}),
|
|
914
|
-
|
|
915
|
-
className: "flex items-center gap-0.5 rounded bg-bg-surface p-0.5",
|
|
916
|
-
children: [
|
|
917
|
-
/* @__PURE__ */ h("button", {
|
|
918
|
-
type: "button",
|
|
919
|
-
onClick: () => T("terminal"),
|
|
920
|
-
className: "p-1.5 rounded bg-bg-sunken shadow-sm",
|
|
921
|
-
title: v("sessions.terminalViewTitle", "Terminal view"),
|
|
922
|
-
children: /* @__PURE__ */ h(He, { className: "size-3.5 text-text-secondary" })
|
|
923
|
-
}),
|
|
924
|
-
/* @__PURE__ */ h("button", {
|
|
925
|
-
type: "button",
|
|
926
|
-
onClick: () => T("grid"),
|
|
927
|
-
className: "p-1.5 rounded hover:bg-bg-sunken/50",
|
|
928
|
-
title: v("sessions.gridViewTitle", "Grid view"),
|
|
929
|
-
children: /* @__PURE__ */ h(Be, { className: "size-3.5 text-text-secondary" })
|
|
930
|
-
}),
|
|
931
|
-
/* @__PURE__ */ h("button", {
|
|
932
|
-
type: "button",
|
|
933
|
-
onClick: () => T("list"),
|
|
934
|
-
className: "p-1.5 rounded hover:bg-bg-sunken/50",
|
|
935
|
-
title: v("sessions.listViewTitle", "List view"),
|
|
936
|
-
children: /* @__PURE__ */ h(Ve, { className: "size-3.5 text-text-secondary" })
|
|
937
|
-
})
|
|
938
|
-
]
|
|
939
|
-
})
|
|
962
|
+
Dr
|
|
940
963
|
]
|
|
941
964
|
})]
|
|
942
965
|
}),
|
|
@@ -951,23 +974,23 @@ function ct() {
|
|
|
951
974
|
tabs: I,
|
|
952
975
|
activeTabId: R,
|
|
953
976
|
onTabSelect: z,
|
|
954
|
-
onTabClose:
|
|
955
|
-
onOpenExternal:
|
|
977
|
+
onTabClose: br,
|
|
978
|
+
onOpenExternal: xr,
|
|
956
979
|
collapsed: !1,
|
|
957
980
|
sessions: Z,
|
|
958
981
|
onOpenTerminal: Q,
|
|
959
982
|
onRetryTerminal: Q,
|
|
960
|
-
onRenameSession:
|
|
961
|
-
onStopTerminal:
|
|
983
|
+
onRenameSession: Sr,
|
|
984
|
+
onStopTerminal: Cr,
|
|
962
985
|
onStopSession: (e) => {
|
|
963
986
|
let t = X.find((t) => t.id === e);
|
|
964
|
-
t &&
|
|
987
|
+
t && hr(t);
|
|
965
988
|
},
|
|
966
|
-
onRestartTerminal:
|
|
967
|
-
onCreateSession:
|
|
989
|
+
onRestartTerminal: wr,
|
|
990
|
+
onCreateSession: fr,
|
|
968
991
|
fullScreen: !0,
|
|
969
|
-
isImmersiveFullscreen:
|
|
970
|
-
onToggleImmersiveFullscreen:
|
|
992
|
+
isImmersiveFullscreen: cn,
|
|
993
|
+
onToggleImmersiveFullscreen: Tr,
|
|
971
994
|
contextSwitcher: void 0
|
|
972
995
|
}),
|
|
973
996
|
/* @__PURE__ */ g("div", {
|
|
@@ -996,31 +1019,31 @@ function ct() {
|
|
|
996
1019
|
className: "hidden sm:flex items-center gap-3",
|
|
997
1020
|
children: [/* @__PURE__ */ h("button", {
|
|
998
1021
|
type: "button",
|
|
999
|
-
onClick: () =>
|
|
1022
|
+
onClick: () => tn(!0),
|
|
1000
1023
|
className: "hover:text-text-secondary transition-colors",
|
|
1001
1024
|
children: v("sessions.shortcutsHint", "Press ? for shortcuts")
|
|
1002
1025
|
}), /* @__PURE__ */ h("button", {
|
|
1003
1026
|
type: "button",
|
|
1004
1027
|
onClick: () => {
|
|
1005
|
-
|
|
1028
|
+
rn(""), B(!0);
|
|
1006
1029
|
},
|
|
1007
1030
|
className: "hover:text-text-secondary transition-colors",
|
|
1008
1031
|
children: v("sessions.paletteHint", "Cmd+P · Command palette")
|
|
1009
1032
|
})]
|
|
1010
1033
|
})]
|
|
1011
1034
|
}),
|
|
1012
|
-
|
|
1035
|
+
Mt && /* @__PURE__ */ h("div", {
|
|
1013
1036
|
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",
|
|
1014
|
-
children:
|
|
1037
|
+
children: Mt
|
|
1015
1038
|
}),
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1039
|
+
Dt && Ar(),
|
|
1040
|
+
kr(),
|
|
1041
|
+
en && /* @__PURE__ */ h("div", {
|
|
1019
1042
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/80 backdrop-blur-sm p-4",
|
|
1020
1043
|
role: "dialog",
|
|
1021
1044
|
"aria-modal": "true",
|
|
1022
1045
|
"aria-labelledby": "sessions-cheatsheet-title",
|
|
1023
|
-
onClick: () =>
|
|
1046
|
+
onClick: () => tn(!1),
|
|
1024
1047
|
children: /* @__PURE__ */ g("div", {
|
|
1025
1048
|
className: "bg-bg-surface border border-border-default rounded-xl shadow-2xl p-6 max-w-md w-full",
|
|
1026
1049
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -1095,7 +1118,7 @@ function ct() {
|
|
|
1095
1118
|
className: "mt-5 flex justify-end",
|
|
1096
1119
|
children: /* @__PURE__ */ h("button", {
|
|
1097
1120
|
type: "button",
|
|
1098
|
-
onClick: () =>
|
|
1121
|
+
onClick: () => tn(!1),
|
|
1099
1122
|
className: "px-3 py-1.5 text-sm rounded-md bg-bg-sunken hover:bg-bg-secondary text-text-primary transition-colors",
|
|
1100
1123
|
children: v("common.close", "Close")
|
|
1101
1124
|
})
|
|
@@ -1103,7 +1126,7 @@ function ct() {
|
|
|
1103
1126
|
]
|
|
1104
1127
|
})
|
|
1105
1128
|
}),
|
|
1106
|
-
|
|
1129
|
+
nn && /* @__PURE__ */ h("div", {
|
|
1107
1130
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-bg-overlay/80 backdrop-blur-sm p-4 pt-20",
|
|
1108
1131
|
role: "dialog",
|
|
1109
1132
|
"aria-modal": "true",
|
|
@@ -1116,7 +1139,7 @@ function ct() {
|
|
|
1116
1139
|
autoFocus: !0,
|
|
1117
1140
|
type: "search",
|
|
1118
1141
|
value: V,
|
|
1119
|
-
onChange: (e) =>
|
|
1142
|
+
onChange: (e) => rn(e.target.value),
|
|
1120
1143
|
onKeyDown: (e) => {
|
|
1121
1144
|
e.key === "Escape" && B(!1);
|
|
1122
1145
|
},
|
|
@@ -1158,7 +1181,8 @@ function ct() {
|
|
|
1158
1181
|
}) }, e.id))]
|
|
1159
1182
|
})]
|
|
1160
1183
|
})
|
|
1161
|
-
})
|
|
1184
|
+
}),
|
|
1185
|
+
Or
|
|
1162
1186
|
]
|
|
1163
1187
|
});
|
|
1164
1188
|
return /* @__PURE__ */ g(_, {
|
|
@@ -1178,7 +1202,7 @@ function ct() {
|
|
|
1178
1202
|
children: [
|
|
1179
1203
|
/* @__PURE__ */ h("button", {
|
|
1180
1204
|
type: "button",
|
|
1181
|
-
onClick: () =>
|
|
1205
|
+
onClick: () => Pn().then(() => J()),
|
|
1182
1206
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1183
1207
|
title: v("sessions.checkHealth", "Check session health"),
|
|
1184
1208
|
children: /* @__PURE__ */ h(Re, { className: "size-4" })
|
|
@@ -1191,9 +1215,9 @@ function ct() {
|
|
|
1191
1215
|
title: v("sessions.refreshTitle", "Refresh sessions"),
|
|
1192
1216
|
children: /* @__PURE__ */ h(Ge, { className: `size-4 ${q ? "animate-spin" : ""}` })
|
|
1193
1217
|
}),
|
|
1194
|
-
/* @__PURE__ */ h(
|
|
1218
|
+
/* @__PURE__ */ h(tt, {
|
|
1195
1219
|
label: v("sessions.export", "Export"),
|
|
1196
|
-
disabled:
|
|
1220
|
+
disabled: Pt,
|
|
1197
1221
|
testId: "sessions-export",
|
|
1198
1222
|
defaultFolderPath: "/Vibecontrols/Sessions",
|
|
1199
1223
|
source: {
|
|
@@ -1201,7 +1225,7 @@ function ct() {
|
|
|
1201
1225
|
filename: `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`,
|
|
1202
1226
|
mimeType: "text/csv",
|
|
1203
1227
|
getBlob: async () => {
|
|
1204
|
-
let e = (await
|
|
1228
|
+
let e = (await Rn({ variables: { input: {
|
|
1205
1229
|
filter: {
|
|
1206
1230
|
status: b === "all" ? void 0 : b,
|
|
1207
1231
|
type: x === "all" ? void 0 : x,
|
|
@@ -1213,28 +1237,29 @@ function ct() {
|
|
|
1213
1237
|
return e ? { blob: new Blob([e.data], { type: "text/csv" }) } : null;
|
|
1214
1238
|
}
|
|
1215
1239
|
},
|
|
1216
|
-
onDownload: () =>
|
|
1240
|
+
onDownload: () => ur("CSV")
|
|
1217
1241
|
}),
|
|
1218
|
-
/* @__PURE__ */ h(
|
|
1242
|
+
/* @__PURE__ */ h(at, {
|
|
1219
1243
|
permission: Me.SESSION_CREATE,
|
|
1220
1244
|
children: /* @__PURE__ */ g("button", {
|
|
1221
1245
|
type: "button",
|
|
1222
|
-
onClick: () =>
|
|
1246
|
+
onClick: () => gn(!0),
|
|
1223
1247
|
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",
|
|
1224
1248
|
"data-testid": "sessions-reconnect-button",
|
|
1225
1249
|
title: v("sessions.reconnectTooltip", "Reconnect orphan tmux/wezterm/zellij sessions left over from a previous agent run"),
|
|
1226
1250
|
children: [/* @__PURE__ */ h(Ge, { className: "size-4" }), v("sessions.reconnect", "Reconnect")]
|
|
1227
1251
|
})
|
|
1228
1252
|
}),
|
|
1229
|
-
/* @__PURE__ */ h(
|
|
1253
|
+
/* @__PURE__ */ h(at, {
|
|
1230
1254
|
permission: Me.SESSION_CREATE,
|
|
1231
1255
|
children: /* @__PURE__ */ g("button", {
|
|
1232
1256
|
type: "button",
|
|
1233
|
-
onClick:
|
|
1257
|
+
onClick: fr,
|
|
1234
1258
|
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",
|
|
1235
1259
|
children: [/* @__PURE__ */ h(We, { className: "size-4" }), v("sessions.newSession", "New Session")]
|
|
1236
1260
|
})
|
|
1237
|
-
})
|
|
1261
|
+
}),
|
|
1262
|
+
Dr
|
|
1238
1263
|
]
|
|
1239
1264
|
})
|
|
1240
1265
|
}),
|
|
@@ -1245,65 +1270,40 @@ function ct() {
|
|
|
1245
1270
|
/* @__PURE__ */ g("div", {
|
|
1246
1271
|
"data-tour": "sessions-filters",
|
|
1247
1272
|
className: "space-y-3",
|
|
1248
|
-
children: [/* @__PURE__ */
|
|
1273
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1249
1274
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
1250
|
-
children:
|
|
1275
|
+
children: /* @__PURE__ */ h(Ee, {
|
|
1251
1276
|
value: y,
|
|
1252
|
-
onChange:
|
|
1277
|
+
onChange: St,
|
|
1253
1278
|
placeholder: v("sessions.searchPlaceholder", "Search sessions..."),
|
|
1254
1279
|
className: "flex-1 sm:w-64 sm:flex-none"
|
|
1255
|
-
})
|
|
1256
|
-
className: "flex items-center gap-1 bg-bg-sunken rounded-md p-1 flex-shrink-0",
|
|
1257
|
-
children: [
|
|
1258
|
-
/* @__PURE__ */ h("button", {
|
|
1259
|
-
type: "button",
|
|
1260
|
-
onClick: () => T("terminal"),
|
|
1261
|
-
className: "p-1.5 sm:p-2 rounded hover:bg-bg-surface/50",
|
|
1262
|
-
title: v("sessions.terminalViewTitle", "Terminal view"),
|
|
1263
|
-
children: /* @__PURE__ */ h(He, { className: "size-4 text-text-secondary" })
|
|
1264
|
-
}),
|
|
1265
|
-
/* @__PURE__ */ h("button", {
|
|
1266
|
-
type: "button",
|
|
1267
|
-
onClick: () => T("grid"),
|
|
1268
|
-
className: `p-1.5 sm:p-2 rounded ${w === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
1269
|
-
title: v("sessions.gridViewTitle", "Grid view"),
|
|
1270
|
-
children: /* @__PURE__ */ h(Be, { className: "size-4 text-text-secondary" })
|
|
1271
|
-
}),
|
|
1272
|
-
/* @__PURE__ */ h("button", {
|
|
1273
|
-
type: "button",
|
|
1274
|
-
onClick: () => T("list"),
|
|
1275
|
-
className: `p-1.5 sm:p-2 rounded ${w === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
1276
|
-
title: v("sessions.listViewTitle", "List view"),
|
|
1277
|
-
children: /* @__PURE__ */ h(Ve, { className: "size-4 text-text-secondary" })
|
|
1278
|
-
})
|
|
1279
|
-
]
|
|
1280
|
-
})]
|
|
1280
|
+
})
|
|
1281
1281
|
}), /* @__PURE__ */ g("div", {
|
|
1282
1282
|
className: "flex items-center gap-2 sm:gap-3 flex-wrap",
|
|
1283
1283
|
children: [
|
|
1284
1284
|
/* @__PURE__ */ h(De, {
|
|
1285
1285
|
label: v("sessions.filterStatus", "Status"),
|
|
1286
1286
|
value: b,
|
|
1287
|
-
options:
|
|
1288
|
-
onChange:
|
|
1287
|
+
options: vt,
|
|
1288
|
+
onChange: Ct
|
|
1289
1289
|
}),
|
|
1290
1290
|
/* @__PURE__ */ h(De, {
|
|
1291
1291
|
label: v("sessions.filterType", "Type"),
|
|
1292
1292
|
value: x,
|
|
1293
|
-
options:
|
|
1294
|
-
onChange:
|
|
1293
|
+
options: yt,
|
|
1294
|
+
onChange: wt
|
|
1295
1295
|
}),
|
|
1296
1296
|
/* @__PURE__ */ h(De, {
|
|
1297
1297
|
label: v("sessions.filterVibe", "Vibe"),
|
|
1298
1298
|
value: S,
|
|
1299
|
-
options:
|
|
1300
|
-
onChange:
|
|
1299
|
+
options: Yn,
|
|
1300
|
+
onChange: Tt
|
|
1301
1301
|
}),
|
|
1302
1302
|
/* @__PURE__ */ h(De, {
|
|
1303
1303
|
label: v("sessions.filterAgent", "Agent"),
|
|
1304
1304
|
value: C,
|
|
1305
|
-
options:
|
|
1306
|
-
onChange:
|
|
1305
|
+
options: Xn,
|
|
1306
|
+
onChange: Et
|
|
1307
1307
|
})
|
|
1308
1308
|
]
|
|
1309
1309
|
})]
|
|
@@ -1313,7 +1313,7 @@ function ct() {
|
|
|
1313
1313
|
children: [
|
|
1314
1314
|
/* @__PURE__ */ g("button", {
|
|
1315
1315
|
type: "button",
|
|
1316
|
-
onClick: () =>
|
|
1316
|
+
onClick: () => Ct("RUNNING"),
|
|
1317
1317
|
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${b === "RUNNING" ? "bg-status-success-bg text-status-success-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
1318
1318
|
children: [
|
|
1319
1319
|
/* @__PURE__ */ h(Ue, { className: "size-3" }),
|
|
@@ -1326,7 +1326,7 @@ function ct() {
|
|
|
1326
1326
|
}),
|
|
1327
1327
|
/* @__PURE__ */ g("button", {
|
|
1328
1328
|
type: "button",
|
|
1329
|
-
onClick: () =>
|
|
1329
|
+
onClick: () => Ct("STOPPED"),
|
|
1330
1330
|
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${b === "STOPPED" ? "bg-bg-sunken text-text-secondary" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
1331
1331
|
children: [
|
|
1332
1332
|
/* @__PURE__ */ h(qe, { className: "size-3" }),
|
|
@@ -1341,14 +1341,14 @@ function ct() {
|
|
|
1341
1341
|
className: "sm:ml-auto flex items-center gap-2",
|
|
1342
1342
|
children: Z.length > 0 && /* @__PURE__ */ g("button", {
|
|
1343
1343
|
type: "button",
|
|
1344
|
-
onClick:
|
|
1344
|
+
onClick: ar ? ir : rr,
|
|
1345
1345
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
1346
|
-
children: [/* @__PURE__ */ h(ze, { className: "size-3.5" }),
|
|
1346
|
+
children: [/* @__PURE__ */ h(ze, { className: "size-3.5" }), ar ? v("sessions.deselectAll", "Deselect All") : v("sessions.selectAll", "Select All")]
|
|
1347
1347
|
})
|
|
1348
1348
|
})
|
|
1349
1349
|
]
|
|
1350
1350
|
}),
|
|
1351
|
-
|
|
1351
|
+
Er(),
|
|
1352
1352
|
y || b !== "all" || x !== "all" || S !== "all" || C !== "all" ? /* @__PURE__ */ g("p", {
|
|
1353
1353
|
className: "text-sm text-text-secondary",
|
|
1354
1354
|
children: [
|
|
@@ -1373,33 +1373,33 @@ function ct() {
|
|
|
1373
1373
|
}) : null,
|
|
1374
1374
|
/* @__PURE__ */ h($e, {
|
|
1375
1375
|
mode: "wait",
|
|
1376
|
-
children: Z.length > 0 ? w === "grid" ? /* @__PURE__ */ h(
|
|
1376
|
+
children: Z.length > 0 ? w === "grid" ? /* @__PURE__ */ h(rt, {
|
|
1377
1377
|
stagger: .04,
|
|
1378
1378
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
1379
|
-
children: Z.map((e) => /* @__PURE__ */ h(
|
|
1379
|
+
children: Z.map((e) => /* @__PURE__ */ h(nt, { children: /* @__PURE__ */ h(Ne, {
|
|
1380
1380
|
session: e,
|
|
1381
|
-
onOpen:
|
|
1382
|
-
onStart:
|
|
1383
|
-
onStop:
|
|
1384
|
-
onRestart:
|
|
1381
|
+
onOpen: dr,
|
|
1382
|
+
onStart: mr,
|
|
1383
|
+
onStop: hr,
|
|
1384
|
+
onRestart: gr,
|
|
1385
1385
|
onOpenTerminal: Q,
|
|
1386
|
-
onShare:
|
|
1386
|
+
onShare: yr,
|
|
1387
1387
|
selected: A.has(e.id),
|
|
1388
|
-
onToggleSelect: () =>
|
|
1388
|
+
onToggleSelect: () => nr(e.id)
|
|
1389
1389
|
}) }, e.id))
|
|
1390
|
-
}, "grid-view") : /* @__PURE__ */ h(
|
|
1390
|
+
}, "grid-view") : /* @__PURE__ */ h(nt, { children: /* @__PURE__ */ h(Pe, {
|
|
1391
1391
|
sessions: Z,
|
|
1392
|
-
onOpen:
|
|
1393
|
-
onStart:
|
|
1394
|
-
onStop:
|
|
1395
|
-
onRestart:
|
|
1396
|
-
onTerminate:
|
|
1392
|
+
onOpen: dr,
|
|
1393
|
+
onStart: mr,
|
|
1394
|
+
onStop: hr,
|
|
1395
|
+
onRestart: gr,
|
|
1396
|
+
onTerminate: _r,
|
|
1397
1397
|
onOpenTerminal: Q,
|
|
1398
|
-
onShare:
|
|
1398
|
+
onShare: yr,
|
|
1399
1399
|
selectedIds: A,
|
|
1400
|
-
onToggleSelect:
|
|
1401
|
-
onSelectAll:
|
|
1402
|
-
onDeselectAll:
|
|
1400
|
+
onToggleSelect: nr,
|
|
1401
|
+
onSelectAll: rr,
|
|
1402
|
+
onDeselectAll: ir
|
|
1403
1403
|
}) }, "list-view") : /* @__PURE__ */ g("div", {
|
|
1404
1404
|
className: "space-y-4",
|
|
1405
1405
|
children: [/* @__PURE__ */ h(Oe, {
|
|
@@ -1411,9 +1411,9 @@ function ct() {
|
|
|
1411
1411
|
description: y || b !== "all" || x !== "all" || S !== "all" || C !== "all" ? v("sessions.emptyAdjustSearch", "Try adjusting your search or filters") : v("sessions.emptyDescription", "Sessions require an active agent. Install the CLI agent first, then start a session."),
|
|
1412
1412
|
action: !y && b === "all" && x === "all" && S === "all" && C === "all" ? /* @__PURE__ */ g("div", {
|
|
1413
1413
|
className: "flex items-center gap-2",
|
|
1414
|
-
children: [
|
|
1414
|
+
children: [xt && /* @__PURE__ */ g("button", {
|
|
1415
1415
|
type: "button",
|
|
1416
|
-
onClick:
|
|
1416
|
+
onClick: fr,
|
|
1417
1417
|
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",
|
|
1418
1418
|
children: [
|
|
1419
1419
|
/* @__PURE__ */ h(We, { className: "size-4" }),
|
|
@@ -1425,9 +1425,9 @@ function ct() {
|
|
|
1425
1425
|
})]
|
|
1426
1426
|
})
|
|
1427
1427
|
}),
|
|
1428
|
-
|
|
1428
|
+
Mt && /* @__PURE__ */ h("div", {
|
|
1429
1429
|
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",
|
|
1430
|
-
children:
|
|
1430
|
+
children: Mt
|
|
1431
1431
|
})
|
|
1432
1432
|
]
|
|
1433
1433
|
}),
|
|
@@ -1435,49 +1435,31 @@ function ct() {
|
|
|
1435
1435
|
tabs: I,
|
|
1436
1436
|
activeTabId: R,
|
|
1437
1437
|
onTabSelect: z,
|
|
1438
|
-
onTabClose:
|
|
1439
|
-
onOpenExternal:
|
|
1438
|
+
onTabClose: br,
|
|
1439
|
+
onOpenExternal: xr,
|
|
1440
1440
|
onToggleCollapse: () => H((e) => !e),
|
|
1441
|
-
collapsed:
|
|
1441
|
+
collapsed: an,
|
|
1442
1442
|
sessions: Z,
|
|
1443
1443
|
onOpenTerminal: Q,
|
|
1444
1444
|
onRetryTerminal: Q,
|
|
1445
|
-
onRenameSession:
|
|
1446
|
-
onStopTerminal:
|
|
1445
|
+
onRenameSession: Sr,
|
|
1446
|
+
onStopTerminal: Cr,
|
|
1447
1447
|
onStopSession: (e) => {
|
|
1448
1448
|
let t = X.find((t) => t.id === e);
|
|
1449
|
-
t &&
|
|
1449
|
+
t && hr(t);
|
|
1450
1450
|
},
|
|
1451
|
-
onRestartTerminal:
|
|
1451
|
+
onRestartTerminal: wr,
|
|
1452
1452
|
heightClass: "h-[280px] sm:h-[380px]",
|
|
1453
|
-
isImmersiveFullscreen:
|
|
1454
|
-
onToggleImmersiveFullscreen:
|
|
1453
|
+
isImmersiveFullscreen: cn,
|
|
1454
|
+
onToggleImmersiveFullscreen: Tr,
|
|
1455
1455
|
contextSwitcher: void 0
|
|
1456
1456
|
}),
|
|
1457
|
-
|
|
1458
|
-
Er(),
|
|
1459
|
-
an && /* @__PURE__ */ h(Ie, {
|
|
1460
|
-
session: an,
|
|
1461
|
-
isOpen: !!an,
|
|
1462
|
-
onClose: () => on(null)
|
|
1463
|
-
}),
|
|
1464
|
-
/* @__PURE__ */ h(e, {
|
|
1465
|
-
isOpen: Dt,
|
|
1466
|
-
onClose: () => D(!1),
|
|
1467
|
-
onConfirm: () => {
|
|
1468
|
-
D(!1), dt("/billing");
|
|
1469
|
-
},
|
|
1470
|
-
title: t("session").title,
|
|
1471
|
-
message: t("session").message,
|
|
1472
|
-
confirmLabel: "View Billing",
|
|
1473
|
-
cancelLabel: "Dismiss",
|
|
1474
|
-
variant: "warning"
|
|
1475
|
-
})
|
|
1457
|
+
Or
|
|
1476
1458
|
]
|
|
1477
1459
|
});
|
|
1478
|
-
function
|
|
1479
|
-
if (!
|
|
1480
|
-
let e =
|
|
1460
|
+
function kr() {
|
|
1461
|
+
if (!hn) return null;
|
|
1462
|
+
let e = wn?.agentSessionOrphans ?? [];
|
|
1481
1463
|
return /* @__PURE__ */ h("div", {
|
|
1482
1464
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1483
1465
|
"data-testid": "sessions-reconnect-modal",
|
|
@@ -1499,24 +1481,24 @@ function ct() {
|
|
|
1499
1481
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1500
1482
|
children: v("sessions.agent", "Agent")
|
|
1501
1483
|
}), /* @__PURE__ */ h(l, {
|
|
1502
|
-
options:
|
|
1503
|
-
value:
|
|
1484
|
+
options: Qn,
|
|
1485
|
+
value: _n,
|
|
1504
1486
|
onChange: (e) => {
|
|
1505
|
-
|
|
1487
|
+
vn(e), bn(null), e && Cn({ variables: { agentId: e } });
|
|
1506
1488
|
},
|
|
1507
1489
|
placeholder: v("sessions.selectAgent", "Select an agent"),
|
|
1508
1490
|
searchPlaceholder: v("sessions.searchAgents", "Search agents..."),
|
|
1509
1491
|
clearable: !0
|
|
1510
1492
|
})] }),
|
|
1511
|
-
|
|
1493
|
+
yn && /* @__PURE__ */ h("div", {
|
|
1512
1494
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1513
1495
|
"data-testid": "sessions-reconnect-error",
|
|
1514
|
-
children:
|
|
1496
|
+
children: yn
|
|
1515
1497
|
}),
|
|
1516
|
-
|
|
1498
|
+
_n && /* @__PURE__ */ h("div", {
|
|
1517
1499
|
"data-testid": "sessions-reconnect-list",
|
|
1518
1500
|
className: "space-y-2",
|
|
1519
|
-
children:
|
|
1501
|
+
children: Tn ? /* @__PURE__ */ h("div", {
|
|
1520
1502
|
className: "text-sm text-text-secondary",
|
|
1521
1503
|
children: v("sessions.scanningHost", "Scanning host...")
|
|
1522
1504
|
}) : e.length === 0 ? /* @__PURE__ */ h("div", {
|
|
@@ -1544,24 +1526,24 @@ function ct() {
|
|
|
1544
1526
|
})]
|
|
1545
1527
|
}), /* @__PURE__ */ h("button", {
|
|
1546
1528
|
type: "button",
|
|
1547
|
-
disabled:
|
|
1529
|
+
disabled: xn === e.externalName,
|
|
1548
1530
|
onClick: async () => {
|
|
1549
|
-
|
|
1531
|
+
Sn(e.externalName), bn(null);
|
|
1550
1532
|
try {
|
|
1551
|
-
await
|
|
1552
|
-
agentId:
|
|
1533
|
+
await En({ variables: {
|
|
1534
|
+
agentId: _n,
|
|
1553
1535
|
externalName: e.externalName,
|
|
1554
1536
|
name: e.externalName
|
|
1555
|
-
} }), await
|
|
1537
|
+
} }), await Cn({ variables: { agentId: _n } });
|
|
1556
1538
|
} catch (e) {
|
|
1557
|
-
|
|
1539
|
+
bn(e instanceof Error ? e.message : String(e));
|
|
1558
1540
|
} finally {
|
|
1559
|
-
|
|
1541
|
+
Sn(null);
|
|
1560
1542
|
}
|
|
1561
1543
|
},
|
|
1562
1544
|
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",
|
|
1563
1545
|
"data-testid": `sessions-reconnect-adopt-${e.externalName}`,
|
|
1564
|
-
children:
|
|
1546
|
+
children: xn === e.externalName ? v("sessions.adopting", "Adopting…") : v("sessions.adopt", "Adopt")
|
|
1565
1547
|
})]
|
|
1566
1548
|
}, e.externalName))
|
|
1567
1549
|
})
|
|
@@ -1572,7 +1554,7 @@ function ct() {
|
|
|
1572
1554
|
children: /* @__PURE__ */ h("button", {
|
|
1573
1555
|
type: "button",
|
|
1574
1556
|
onClick: () => {
|
|
1575
|
-
|
|
1557
|
+
gn(!1), bn(null);
|
|
1576
1558
|
},
|
|
1577
1559
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1578
1560
|
children: v("common.close", "Close")
|
|
@@ -1582,7 +1564,7 @@ function ct() {
|
|
|
1582
1564
|
})
|
|
1583
1565
|
});
|
|
1584
1566
|
}
|
|
1585
|
-
function
|
|
1567
|
+
function Ar() {
|
|
1586
1568
|
return /* @__PURE__ */ h("div", {
|
|
1587
1569
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1588
1570
|
children: /* @__PURE__ */ g("div", {
|
|
@@ -1595,16 +1577,16 @@ function ct() {
|
|
|
1595
1577
|
/* @__PURE__ */ g("div", {
|
|
1596
1578
|
className: "space-y-4",
|
|
1597
1579
|
children: [
|
|
1598
|
-
|
|
1580
|
+
kt && /* @__PURE__ */ h("div", {
|
|
1599
1581
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1600
|
-
children:
|
|
1582
|
+
children: kt
|
|
1601
1583
|
}),
|
|
1602
1584
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
1603
1585
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1604
1586
|
children: v("sessions.name", "Name")
|
|
1605
1587
|
}), /* @__PURE__ */ h("input", {
|
|
1606
1588
|
"aria-label": "control",
|
|
1607
|
-
ref:
|
|
1589
|
+
ref: It,
|
|
1608
1590
|
type: "text",
|
|
1609
1591
|
placeholder: v("sessions.namePlaceholder", "dev-server"),
|
|
1610
1592
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
@@ -1613,9 +1595,9 @@ function ct() {
|
|
|
1613
1595
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1614
1596
|
children: v("sessions.filterVibe", "Vibe")
|
|
1615
1597
|
}), /* @__PURE__ */ h(l, {
|
|
1616
|
-
options:
|
|
1617
|
-
value:
|
|
1618
|
-
onChange:
|
|
1598
|
+
options: Zn,
|
|
1599
|
+
value: Bt,
|
|
1600
|
+
onChange: Vt,
|
|
1619
1601
|
placeholder: v("sessions.noVibe", "No vibe"),
|
|
1620
1602
|
searchPlaceholder: v("sessions.searchVibes", "Search vibes..."),
|
|
1621
1603
|
clearable: !0
|
|
@@ -1626,9 +1608,9 @@ function ct() {
|
|
|
1626
1608
|
children: v("sessions.filterAgent", "Agent")
|
|
1627
1609
|
}),
|
|
1628
1610
|
/* @__PURE__ */ h(l, {
|
|
1629
|
-
options:
|
|
1611
|
+
options: Qn,
|
|
1630
1612
|
value: N,
|
|
1631
|
-
onChange:
|
|
1613
|
+
onChange: Ht,
|
|
1632
1614
|
placeholder: v("sessions.selectAgent", "Select an agent"),
|
|
1633
1615
|
searchPlaceholder: v("sessions.searchAgents", "Search agents..."),
|
|
1634
1616
|
clearable: !0
|
|
@@ -1644,9 +1626,9 @@ function ct() {
|
|
|
1644
1626
|
children: v("sessions.profile", "Profile")
|
|
1645
1627
|
}),
|
|
1646
1628
|
/* @__PURE__ */ h(l, {
|
|
1647
|
-
options:
|
|
1648
|
-
value:
|
|
1649
|
-
onChange:
|
|
1629
|
+
options: er,
|
|
1630
|
+
value: Ut,
|
|
1631
|
+
onChange: Wt,
|
|
1650
1632
|
placeholder: v("sessions.selectProfile", "default"),
|
|
1651
1633
|
searchPlaceholder: v("sessions.searchProfiles", "Search profiles...")
|
|
1652
1634
|
}),
|
|
@@ -1659,9 +1641,9 @@ function ct() {
|
|
|
1659
1641
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1660
1642
|
children: v("sessions.filterType", "Type")
|
|
1661
1643
|
}), /* @__PURE__ */ h(l, {
|
|
1662
|
-
options:
|
|
1644
|
+
options: tr,
|
|
1663
1645
|
value: P,
|
|
1664
|
-
onChange:
|
|
1646
|
+
onChange: Gt,
|
|
1665
1647
|
placeholder: v("sessions.selectType", "Select type"),
|
|
1666
1648
|
searchPlaceholder: v("sessions.searchTypes", "Search types...")
|
|
1667
1649
|
})] }),
|
|
@@ -1670,7 +1652,7 @@ function ct() {
|
|
|
1670
1652
|
children: v("sessions.command", "Command")
|
|
1671
1653
|
}), /* @__PURE__ */ h("input", {
|
|
1672
1654
|
"aria-label": "control",
|
|
1673
|
-
ref:
|
|
1655
|
+
ref: Lt,
|
|
1674
1656
|
type: "text",
|
|
1675
1657
|
placeholder: v("sessions.commandPlaceholder", "bun run dev"),
|
|
1676
1658
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
@@ -1679,7 +1661,7 @@ function ct() {
|
|
|
1679
1661
|
className: "flex items-center gap-2",
|
|
1680
1662
|
children: [/* @__PURE__ */ h("input", {
|
|
1681
1663
|
"aria-label": "autoStart",
|
|
1682
|
-
ref:
|
|
1664
|
+
ref: Rt,
|
|
1683
1665
|
type: "checkbox",
|
|
1684
1666
|
id: "autoStart",
|
|
1685
1667
|
className: "size-4 rounded border-border-default"
|
|
@@ -1694,14 +1676,14 @@ function ct() {
|
|
|
1694
1676
|
"data-testid": "sessions-create-advanced",
|
|
1695
1677
|
children: [/* @__PURE__ */ g("button", {
|
|
1696
1678
|
type: "button",
|
|
1697
|
-
onClick: () =>
|
|
1679
|
+
onClick: () => qt((e) => !e),
|
|
1698
1680
|
className: "w-full flex items-center justify-between px-3 py-2 text-sm font-medium text-text-primary",
|
|
1699
|
-
"aria-expanded":
|
|
1681
|
+
"aria-expanded": Kt,
|
|
1700
1682
|
children: [/* @__PURE__ */ h("span", { children: v("sessions.advanced", "Advanced options") }), /* @__PURE__ */ h("span", {
|
|
1701
1683
|
className: "text-text-tertiary text-xs",
|
|
1702
|
-
children:
|
|
1684
|
+
children: Kt ? "▾" : "▸"
|
|
1703
1685
|
})]
|
|
1704
|
-
}),
|
|
1686
|
+
}), Kt && /* @__PURE__ */ g("div", {
|
|
1705
1687
|
className: "px-3 pb-3 space-y-2",
|
|
1706
1688
|
children: [
|
|
1707
1689
|
/* @__PURE__ */ h("label", {
|
|
@@ -1710,7 +1692,7 @@ function ct() {
|
|
|
1710
1692
|
}),
|
|
1711
1693
|
/* @__PURE__ */ h("input", {
|
|
1712
1694
|
"aria-label": "control",
|
|
1713
|
-
ref:
|
|
1695
|
+
ref: zt,
|
|
1714
1696
|
type: "text",
|
|
1715
1697
|
"data-testid": "sessions-create-external-name",
|
|
1716
1698
|
placeholder: P === "WEZTERM" ? "e.g. vibe-051c9c62 (existing wezterm workspace)" : P === "ZELLIJ" ? "e.g. vibe-051c9c62 (existing zellij session)" : "e.g. vibe-051c9c62 (existing tmux session)",
|
|
@@ -1732,7 +1714,7 @@ function ct() {
|
|
|
1732
1714
|
children: v("sessions.tags", "Tags")
|
|
1733
1715
|
}), /* @__PURE__ */ h(Ce, {
|
|
1734
1716
|
entityType: "VIBECONTROLS_SESSION",
|
|
1735
|
-
onDraftChange:
|
|
1717
|
+
onDraftChange: pn
|
|
1736
1718
|
})]
|
|
1737
1719
|
}),
|
|
1738
1720
|
/* @__PURE__ */ g("div", {
|
|
@@ -1740,15 +1722,15 @@ function ct() {
|
|
|
1740
1722
|
children: [/* @__PURE__ */ h("button", {
|
|
1741
1723
|
type: "button",
|
|
1742
1724
|
onClick: () => E(!1),
|
|
1743
|
-
disabled:
|
|
1725
|
+
disabled: At,
|
|
1744
1726
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1745
1727
|
children: v("common.cancel", "Cancel")
|
|
1746
1728
|
}), /* @__PURE__ */ h("button", {
|
|
1747
1729
|
type: "button",
|
|
1748
|
-
onClick:
|
|
1749
|
-
disabled:
|
|
1730
|
+
onClick: pr,
|
|
1731
|
+
disabled: At,
|
|
1750
1732
|
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",
|
|
1751
|
-
children:
|
|
1733
|
+
children: At ? v("sessions.creating", "Creating...") : v("sessions.createSession", "Create Session")
|
|
1752
1734
|
})]
|
|
1753
1735
|
})
|
|
1754
1736
|
]
|
|
@@ -1757,6 +1739,6 @@ function ct() {
|
|
|
1757
1739
|
}
|
|
1758
1740
|
}
|
|
1759
1741
|
//#endregion
|
|
1760
|
-
export {
|
|
1742
|
+
export { lt as SessionsPage };
|
|
1761
1743
|
|
|
1762
1744
|
//# sourceMappingURL=SessionsPage.js.map
|