@burdenoff/microfe-vibecontrols 2026.529.4 → 2026.529.5
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 +273 -264
- package/dist/pages/SessionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -112,66 +112,66 @@ function st() {
|
|
|
112
112
|
value: "CUSTOM",
|
|
113
113
|
label: v("sessions.typeCustom", "Custom")
|
|
114
114
|
}
|
|
115
|
-
], [v]), vt = dt(je.SESSION_LIST), yt = dt(je.SESSION_CREATE), [y, bt] = m(""), [b, xt] = m("all"), [x, St] = m("all"), [S, Ct] = m("all"), [C, wt] = m("all"), [w, T] = m("terminal"), [Tt, E] = m(!1), [Et, D] = m(!1), [Dt, O] = m(null), [Ot, kt] = m(!1), [
|
|
115
|
+
], [v]), vt = dt(je.SESSION_LIST), yt = dt(je.SESSION_CREATE), [y, bt] = m(""), [b, xt] = m("all"), [x, St] = m("all"), [S, Ct] = m("all"), [C, wt] = m("all"), [w, T] = m("terminal"), [Tt, E] = m(!1), [Et, D] = m(!1), [Dt, O] = m(null), [Ot, kt] = m(!1), [At, k] = m(null), [A, j] = m(/* @__PURE__ */ new Set()), [jt, M] = m(!1), [Mt, Nt] = m(!1), Pt = p(null), Ft = p(null), It = p(null), Lt = p(null), [Rt, zt] = m(""), [Bt, Vt] = m(""), [N, Ht] = m("TMUX"), [Ut, Wt] = m(!1), { terminalTabs: Gt, activeTerminalTabId: Kt, sessionsViewMode: qt, setTerminalTabs: Jt, setActiveTerminalTabId: Yt, setSessionsViewMode: Xt, activeSessionId: P } = _e(), [F, I] = m([]), [L, R] = m(null), [Zt, Qt] = m(!1), [$t, z] = m(!1), [B, en] = m(""), [tn, V] = m(!1), [nn, rn] = m(null), [an, on] = m(!1), [H, sn] = m(!1), U = mt.get("view"), cn = mt.get("session"), [ln] = c({ refetchQueries: ["ListSessions"] }), { setDraftTagIds: un, flushTags: dn } = Ce("VIBECONTROLS_SESSION"), [fn, pn] = m(!1), [mn, hn] = m(""), [gn, _n] = m(null), [vn, yn] = m(null), [bn, { data: xn, loading: Sn }] = a({ fetchPolicy: "network-only" }), [Cn] = i({ refetchQueries: ["ListSessions"] }), [wn] = se({ refetchQueries: ["ListSessions"] }), [Tn] = le({ refetchQueries: ["ListSessions"] }), [En] = ie({ refetchQueries: ["ListSessions"] }), [W] = ce({ refetchQueries: ["ListSessions"] }), [Dn] = ue({ refetchQueries: ["ListSessions"] }), [On] = ae({ refetchQueries: ["ListSessions"] }), [kn] = fe({ refetchQueries: ["ListSessions"] }), [An] = de({ refetchQueries: ["ListSessions"] }), [jn] = s({ refetchQueries: ["ListSessions"] }), [Mn] = te({ refetchQueries: ["ListSessions"] }), [Nn] = ee({ refetchQueries: ["ListSessions"] }), [Pn] = o({ refetchQueries: ["ListSessions"] }), [Fn] = ne();
|
|
116
116
|
d(() => {
|
|
117
|
-
|
|
117
|
+
H || (U === "terminal" || U === "grid" || U === "list" ? T(U) : qt && T(qt), cn ? R(cn) : Kt && R(Kt), Gt.length > 0 && I(Gt.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
|
+
}))), sn(!0));
|
|
124
124
|
}, [
|
|
125
|
-
Wt,
|
|
126
125
|
Gt,
|
|
127
126
|
Kt,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
U
|
|
127
|
+
qt,
|
|
128
|
+
cn,
|
|
129
|
+
U,
|
|
130
|
+
H
|
|
131
131
|
]);
|
|
132
|
-
let
|
|
132
|
+
let In = p(!1);
|
|
133
133
|
d(() => {
|
|
134
|
-
|
|
134
|
+
H && Jt(F.map((e) => ({
|
|
135
135
|
sessionId: e.sessionId,
|
|
136
136
|
name: e.name
|
|
137
137
|
})));
|
|
138
138
|
}, [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
F,
|
|
140
|
+
H,
|
|
141
|
+
Jt
|
|
142
142
|
]), d(() => {
|
|
143
|
-
|
|
143
|
+
H && Yt(L);
|
|
144
144
|
}, [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
L,
|
|
146
|
+
H,
|
|
147
|
+
Yt
|
|
148
148
|
]), d(() => {
|
|
149
|
-
|
|
149
|
+
H && Xt(w);
|
|
150
150
|
}, [
|
|
151
151
|
w,
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
H,
|
|
153
|
+
Xt
|
|
154
154
|
]), d(() => {
|
|
155
|
-
if (!
|
|
155
|
+
if (!H) return;
|
|
156
156
|
let e = new URLSearchParams(mt), 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),
|
|
157
|
+
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), L ? e.get("session") !== L && (e.set("session", L), t = !0) : e.has("session") && (e.delete("session"), t = !0), t && ht(e, { replace: !0 });
|
|
158
158
|
}, [
|
|
159
|
-
|
|
159
|
+
L,
|
|
160
160
|
mt,
|
|
161
161
|
ht,
|
|
162
|
-
|
|
162
|
+
H,
|
|
163
163
|
w
|
|
164
164
|
]);
|
|
165
|
-
let
|
|
165
|
+
let G = p(null);
|
|
166
166
|
oe({
|
|
167
167
|
skip: !lt,
|
|
168
168
|
variables: { workspaceId: lt || "" }
|
|
169
169
|
}), d(() => {
|
|
170
170
|
let e = setInterval(() => {
|
|
171
|
-
|
|
171
|
+
jn().catch(() => {});
|
|
172
172
|
}, it);
|
|
173
173
|
return () => clearInterval(e);
|
|
174
|
-
}, [
|
|
174
|
+
}, [jn]), 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;
|
|
@@ -180,40 +180,40 @@ function st() {
|
|
|
180
180
|
e.preventDefault(), E(!0);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
if (n && e.key === "w" &&
|
|
183
|
+
if (n && e.key === "w" && L) {
|
|
184
184
|
e.preventDefault();
|
|
185
|
-
let t =
|
|
186
|
-
|
|
187
|
-
let e =
|
|
185
|
+
let t = L;
|
|
186
|
+
I((e) => e.filter((e) => e.sessionId !== t)), R(() => {
|
|
187
|
+
let e = F.filter((e) => e.sessionId !== t);
|
|
188
188
|
return e.length > 0 ? e[e.length - 1].sessionId : null;
|
|
189
189
|
});
|
|
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 && F.length > 1) {
|
|
193
|
+
e.preventDefault(), R(F[(F.findIndex((e) => e.sessionId === L) + 1) % F.length].sessionId);
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
if (e.ctrlKey && e.key === "Tab" && e.shiftKey &&
|
|
197
|
-
e.preventDefault(),
|
|
196
|
+
if (e.ctrlKey && e.key === "Tab" && e.shiftKey && F.length > 1) {
|
|
197
|
+
e.preventDefault(), R(F[(F.findIndex((e) => e.sessionId === L) - 1 + F.length) % F.length].sessionId);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (n && /^[1-9]$/.test(e.key) &&
|
|
200
|
+
if (n && /^[1-9]$/.test(e.key) && F.length > 0) {
|
|
201
201
|
let t = Number(e.key) - 1;
|
|
202
|
-
t <
|
|
202
|
+
t < F.length && (e.preventDefault(), R(F[t].sessionId));
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
if (n && (e.key === "p" || e.key === "P")) {
|
|
206
|
-
e.preventDefault(),
|
|
206
|
+
e.preventDefault(), en(""), z(!0);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
if (!n && !e.altKey && !e.shiftKey && e.key === "?") {
|
|
210
|
-
e.preventDefault(),
|
|
210
|
+
e.preventDefault(), Qt(!0);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
215
|
-
}, [
|
|
216
|
-
let { data:
|
|
215
|
+
}, [L, F]);
|
|
216
|
+
let { data: Ln, previousData: Rn, loading: K, error: zn, refetch: q } = re({
|
|
217
217
|
variables: {
|
|
218
218
|
filter: {
|
|
219
219
|
status: b === "all" ? void 0 : b,
|
|
@@ -224,7 +224,7 @@ function st() {
|
|
|
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
|
+
}), Bn = Ln ?? Rn, { agents: J, vibes: Y } = ve(), [Vn, Hn] = me({
|
|
228
228
|
fetchPolicy: "network-only",
|
|
229
229
|
notifyOnNetworkStatusChange: !0
|
|
230
230
|
}), { data: Un } = pe(), Wn = f(() => {
|
|
@@ -250,10 +250,10 @@ function st() {
|
|
|
250
250
|
], [Y, v]), Kn = f(() => [{
|
|
251
251
|
value: "all",
|
|
252
252
|
label: v("sessions.filterAgentAll", "All Agents")
|
|
253
|
-
}, ...
|
|
253
|
+
}, ...J.map((e) => ({
|
|
254
254
|
value: e.id,
|
|
255
255
|
label: `${e.name} ${Ae(e) === "ACTIVE" ? "" : `(${v("sessions.offline", "Offline")})`}`
|
|
256
|
-
}))], [
|
|
256
|
+
}))], [J, v]), qn = f(() => [{
|
|
257
257
|
value: "",
|
|
258
258
|
label: v("sessions.noVibe", "No vibe")
|
|
259
259
|
}, ...Y.map((e) => ({
|
|
@@ -262,13 +262,13 @@ function st() {
|
|
|
262
262
|
}))], [Y, v]), Jn = f(() => [{
|
|
263
263
|
value: "",
|
|
264
264
|
label: v("sessions.selectAgent", "Select an agent")
|
|
265
|
-
}, ...
|
|
265
|
+
}, ...J.map((e) => {
|
|
266
266
|
let t = Ae(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
|
+
})], [J, v]), Yn = f(() => [
|
|
272
272
|
{
|
|
273
273
|
value: "TMUX",
|
|
274
274
|
label: v("sessions.typeTmuxLower", "tmux")
|
|
@@ -297,7 +297,7 @@ function st() {
|
|
|
297
297
|
value: "CUSTOM",
|
|
298
298
|
label: v("sessions.typeCustom", "Custom")
|
|
299
299
|
}
|
|
300
|
-
], [v]), X = f(() => (
|
|
300
|
+
], [v]), X = f(() => (Bn?.sessions?.items ?? []).map((e) => {
|
|
301
301
|
let t = at(e.ttydUrl || null, e.agent?.tunnelUrl || null);
|
|
302
302
|
return {
|
|
303
303
|
id: e.id,
|
|
@@ -331,13 +331,13 @@ function st() {
|
|
|
331
331
|
isActive: e.agent.isActive
|
|
332
332
|
} : void 0
|
|
333
333
|
};
|
|
334
|
-
}), [
|
|
334
|
+
}), [Bn?.sessions?.items]);
|
|
335
335
|
d(() => {
|
|
336
|
-
|
|
336
|
+
In.current || X.length === 0 || F.length === 0 || (In.current = !0, Promise.allSettled(F.map(async (e) => {
|
|
337
337
|
let t = X.find((t) => t.id === e.sessionId);
|
|
338
338
|
if (t) try {
|
|
339
|
-
let n = await
|
|
340
|
-
|
|
339
|
+
let n = await W({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i = at(n.data?.startSessionTerminal?.ttydUrl ?? null, r);
|
|
340
|
+
I((n) => n.map((n) => n.sessionId === e.sessionId ? {
|
|
341
341
|
...n,
|
|
342
342
|
terminalUrl: i,
|
|
343
343
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -345,7 +345,7 @@ function st() {
|
|
|
345
345
|
error: null
|
|
346
346
|
} : n));
|
|
347
347
|
} catch (n) {
|
|
348
|
-
console.warn("[sessions] tab restore startSessionTerminal failed", n),
|
|
348
|
+
console.warn("[sessions] tab restore startSessionTerminal failed", n), I((n) => n.map((n) => n.sessionId === e.sessionId && t.ttydUrl ? {
|
|
349
349
|
...n,
|
|
350
350
|
terminalUrl: t.ttydUrl,
|
|
351
351
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -355,21 +355,21 @@ function st() {
|
|
|
355
355
|
})));
|
|
356
356
|
}, [
|
|
357
357
|
X,
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
F,
|
|
359
|
+
W
|
|
360
360
|
]), d(() => {
|
|
361
|
-
if (!
|
|
362
|
-
|
|
361
|
+
if (!H || !P) {
|
|
362
|
+
G.current = P;
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
|
-
if (
|
|
366
|
-
|
|
365
|
+
if (G.current === null && P) {
|
|
366
|
+
G.current = P;
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
let e = X.find((e) => e.id ===
|
|
372
|
-
if (e) if (
|
|
369
|
+
if (G.current === P) return;
|
|
370
|
+
G.current = P;
|
|
371
|
+
let e = X.find((e) => e.id === P);
|
|
372
|
+
if (e) if (F.find((e) => e.sessionId === P)) R(P), V(!1);
|
|
373
373
|
else {
|
|
374
374
|
let t = e.ttydUrl || null, n = {
|
|
375
375
|
sessionId: e.id,
|
|
@@ -379,9 +379,9 @@ function st() {
|
|
|
379
379
|
loading: !t,
|
|
380
380
|
error: null
|
|
381
381
|
};
|
|
382
|
-
|
|
382
|
+
I((e) => [...e, n]), R(P), V(!1), t || W({ variables: { id: e.id } }).then((t) => {
|
|
383
383
|
let n = t.data?.startSessionTerminal?.ttydUrl || null;
|
|
384
|
-
|
|
384
|
+
I((t) => t.map((t) => t.sessionId === e.id ? {
|
|
385
385
|
...t,
|
|
386
386
|
terminalUrl: n,
|
|
387
387
|
loading: !1,
|
|
@@ -389,7 +389,7 @@ function st() {
|
|
|
389
389
|
} : t));
|
|
390
390
|
}).catch((t) => {
|
|
391
391
|
let n = t instanceof Error ? t.message : v("sessions.failedStartTerminal", "Failed to start terminal");
|
|
392
|
-
|
|
392
|
+
I((t) => t.map((t) => t.sessionId === e.id ? {
|
|
393
393
|
...t,
|
|
394
394
|
loading: !1,
|
|
395
395
|
error: n
|
|
@@ -397,11 +397,11 @@ function st() {
|
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
}, [
|
|
400
|
-
|
|
400
|
+
P,
|
|
401
401
|
X,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
F,
|
|
403
|
+
H,
|
|
404
|
+
W
|
|
405
405
|
]);
|
|
406
406
|
let Z = f(() => X.filter((e) => {
|
|
407
407
|
if (y) {
|
|
@@ -414,66 +414,66 @@ function st() {
|
|
|
414
414
|
y,
|
|
415
415
|
S
|
|
416
416
|
]), Xn = u((e) => {
|
|
417
|
-
|
|
417
|
+
j((t) => {
|
|
418
418
|
let n = new Set(t);
|
|
419
419
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
420
420
|
});
|
|
421
421
|
}, []), Zn = u(() => {
|
|
422
|
-
|
|
422
|
+
j(new Set(Z.map((e) => e.id)));
|
|
423
423
|
}, [Z]), Qn = u(() => {
|
|
424
|
-
|
|
425
|
-
}, []), $n = Z.length > 0 &&
|
|
426
|
-
if (
|
|
427
|
-
|
|
424
|
+
j(/* @__PURE__ */ new Set());
|
|
425
|
+
}, []), $n = Z.length > 0 && A.size === Z.length, er = A.size > 0, tr = u(async () => {
|
|
426
|
+
if (A.size !== 0) {
|
|
427
|
+
M(!0);
|
|
428
428
|
try {
|
|
429
|
-
let e = (await
|
|
430
|
-
|
|
429
|
+
let e = (await Mn({ variables: { ids: Array.from(A) } })).data?.bulkStopSessions;
|
|
430
|
+
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);
|
|
431
431
|
} catch (e) {
|
|
432
|
-
|
|
432
|
+
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedStop", "Failed to stop sessions")}`), setTimeout(() => k(null), 5e3);
|
|
433
433
|
} finally {
|
|
434
|
-
|
|
434
|
+
M(!1);
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
}, [
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
A,
|
|
439
|
+
Mn,
|
|
440
440
|
v
|
|
441
441
|
]), nr = u(async () => {
|
|
442
|
-
if (
|
|
443
|
-
|
|
442
|
+
if (A.size !== 0) {
|
|
443
|
+
M(!0);
|
|
444
444
|
try {
|
|
445
|
-
let e = (await
|
|
446
|
-
|
|
445
|
+
let e = (await Nn({ variables: { ids: Array.from(A) } })).data?.bulkRestartSessions;
|
|
446
|
+
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);
|
|
447
447
|
} catch (e) {
|
|
448
|
-
|
|
448
|
+
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedRestart", "Failed to restart sessions")}`), setTimeout(() => k(null), 5e3);
|
|
449
449
|
} finally {
|
|
450
|
-
|
|
450
|
+
M(!1);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
}, [
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
A,
|
|
455
|
+
Nn,
|
|
456
456
|
v
|
|
457
457
|
]), rr = u(async () => {
|
|
458
|
-
if (
|
|
459
|
-
|
|
458
|
+
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.")}`)) {
|
|
459
|
+
M(!0);
|
|
460
460
|
try {
|
|
461
|
-
let e = (await
|
|
462
|
-
|
|
461
|
+
let e = (await Pn({ variables: { ids: Array.from(A) } })).data?.bulkTerminateSessions;
|
|
462
|
+
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);
|
|
463
463
|
} catch (e) {
|
|
464
|
-
|
|
464
|
+
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedRemove", "Failed to remove sessions")}`), setTimeout(() => k(null), 5e3);
|
|
465
465
|
} finally {
|
|
466
|
-
|
|
466
|
+
M(!1);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
}, [
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
A,
|
|
471
|
+
Pn,
|
|
472
472
|
v
|
|
473
473
|
]), ir = u(async (e = "CSV") => {
|
|
474
|
-
|
|
474
|
+
Nt(!0);
|
|
475
475
|
try {
|
|
476
|
-
let t = (await
|
|
476
|
+
let t = (await Fn({ variables: { input: {
|
|
477
477
|
filter: {
|
|
478
478
|
status: b === "all" ? void 0 : b,
|
|
479
479
|
type: x === "all" ? void 0 : x,
|
|
@@ -484,17 +484,17 @@ function st() {
|
|
|
484
484
|
} } })).data?.exportSessions;
|
|
485
485
|
if (!t) return;
|
|
486
486
|
let n = e === "CSV" ? "text/csv" : "application/json", r = new Blob([t.data], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
487
|
-
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i),
|
|
487
|
+
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i), k(v("sessions.exportSuccess", "Exported {{count}} sessions as {{format}}", {
|
|
488
488
|
count: t.count,
|
|
489
489
|
format: e
|
|
490
|
-
})), setTimeout(() =>
|
|
490
|
+
})), setTimeout(() => k(null), 3e3);
|
|
491
491
|
} catch (e) {
|
|
492
|
-
|
|
492
|
+
k(`${v("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : v("sessions.failedExport", "Failed to export sessions")}`), setTimeout(() => k(null), 5e3);
|
|
493
493
|
} finally {
|
|
494
|
-
|
|
494
|
+
Nt(!1);
|
|
495
495
|
}
|
|
496
496
|
}, [
|
|
497
|
-
|
|
497
|
+
Fn,
|
|
498
498
|
b,
|
|
499
499
|
x,
|
|
500
500
|
S,
|
|
@@ -505,7 +505,7 @@ function st() {
|
|
|
505
505
|
}, or = () => {
|
|
506
506
|
O(null), E(!0);
|
|
507
507
|
}, sr = async () => {
|
|
508
|
-
let e =
|
|
508
|
+
let e = Pt.current?.value?.trim(), t = Rt, i = Bt, a = N, ee = Ft.current?.value?.trim(), te = It.current?.checked ?? !1;
|
|
509
509
|
if (!e) {
|
|
510
510
|
O(v("sessions.nameRequired", "Name is required"));
|
|
511
511
|
return;
|
|
@@ -522,7 +522,7 @@ function st() {
|
|
|
522
522
|
}
|
|
523
523
|
kt(!0), O(null);
|
|
524
524
|
try {
|
|
525
|
-
let n =
|
|
525
|
+
let n = Lt.current?.value?.trim() || void 0, r = await ln({ variables: { input: {
|
|
526
526
|
name: e,
|
|
527
527
|
type: a || "TMUX",
|
|
528
528
|
command: ee || void 0,
|
|
@@ -531,28 +531,37 @@ function st() {
|
|
|
531
531
|
autoStart: te,
|
|
532
532
|
externalSessionName: n
|
|
533
533
|
} } }), i = r.data?.createSession?.id;
|
|
534
|
-
E(!1),
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
534
|
+
if (E(!1), k(v("sessions.createdSuccess", "Session created successfully")), i && await dn(i), setTimeout(() => k(null), 3e3), r.data?.createSession) {
|
|
535
|
+
let e = r.data.createSession, t = e.agentId ? J.find((t) => t.id === e.agentId) : null;
|
|
536
|
+
Q({
|
|
537
|
+
id: e.id,
|
|
538
|
+
workspaceId: e.workspaceId,
|
|
539
|
+
vibeId: e.vibeId || null,
|
|
540
|
+
agentId: e.agentId || null,
|
|
541
|
+
name: e.name,
|
|
542
|
+
type: e.type,
|
|
543
|
+
status: e.status,
|
|
544
|
+
command: e.command || null,
|
|
545
|
+
workingDirectory: e.workingDirectory || null,
|
|
546
|
+
environmentVariables: e.environmentVariables || {},
|
|
547
|
+
autoStart: e.autoStart,
|
|
548
|
+
providerSessionName: e.providerSessionName || void 0,
|
|
549
|
+
providerWindowName: e.providerWindowId || void 0,
|
|
550
|
+
pid: e.pid || null,
|
|
551
|
+
exitCode: e.exitCode || null,
|
|
552
|
+
lastOutput: e.lastOutput || null,
|
|
553
|
+
ttydUrl: e.ttydUrl || null,
|
|
554
|
+
metadata: e.metadata || {},
|
|
555
|
+
createdAt: e.createdAt,
|
|
556
|
+
updatedAt: e.updatedAt,
|
|
557
|
+
agent: t ? {
|
|
558
|
+
id: t.id,
|
|
559
|
+
name: t.name,
|
|
560
|
+
tunnelUrl: t.tunnelUrl || null,
|
|
561
|
+
isActive: t.isActive
|
|
562
|
+
} : void 0
|
|
563
|
+
});
|
|
564
|
+
}
|
|
556
565
|
} catch (e) {
|
|
557
566
|
if (n(e)) {
|
|
558
567
|
E(!1), r(), D(!0);
|
|
@@ -564,7 +573,7 @@ function st() {
|
|
|
564
573
|
}
|
|
565
574
|
}, cr = async (e) => {
|
|
566
575
|
try {
|
|
567
|
-
await
|
|
576
|
+
await wn({ variables: { id: e.id } }), ct?.({
|
|
568
577
|
id: e.id,
|
|
569
578
|
name: e.name,
|
|
570
579
|
type: e.type,
|
|
@@ -579,13 +588,13 @@ function st() {
|
|
|
579
588
|
}
|
|
580
589
|
}, lr = async (e) => {
|
|
581
590
|
try {
|
|
582
|
-
await
|
|
591
|
+
await Tn({ variables: { id: e.id } });
|
|
583
592
|
} catch (e) {
|
|
584
593
|
console.error("Failed to stop session:", e);
|
|
585
594
|
}
|
|
586
595
|
}, ur = async (e) => {
|
|
587
596
|
try {
|
|
588
|
-
await
|
|
597
|
+
await En({ variables: { id: e.id } });
|
|
589
598
|
} catch (e) {
|
|
590
599
|
if (n(e)) {
|
|
591
600
|
r(), D(!0);
|
|
@@ -595,15 +604,15 @@ function st() {
|
|
|
595
604
|
}
|
|
596
605
|
}, dr = async (e) => {
|
|
597
606
|
try {
|
|
598
|
-
await
|
|
607
|
+
await An({ variables: { id: e.id } });
|
|
599
608
|
} catch (e) {
|
|
600
609
|
console.error("Failed to terminate session:", e);
|
|
601
610
|
}
|
|
602
611
|
}, fr = u((e) => e.ttydUrl || null, []), pr = u((e) => {
|
|
603
|
-
|
|
612
|
+
rn(e);
|
|
604
613
|
}, []), Q = u(async (e) => {
|
|
605
|
-
if (
|
|
606
|
-
|
|
614
|
+
if (F.find((t) => t.sessionId === e.id)?.terminalUrl) {
|
|
615
|
+
R(e.id), V(!1);
|
|
607
616
|
return;
|
|
608
617
|
}
|
|
609
618
|
let t = fr(e);
|
|
@@ -612,11 +621,11 @@ function st() {
|
|
|
612
621
|
sessionId: e.id,
|
|
613
622
|
name: e.name,
|
|
614
623
|
terminalUrl: t,
|
|
615
|
-
agentId: e.agent?.id ?? null,
|
|
624
|
+
agentId: e.agent?.id ?? e.agentId ?? null,
|
|
616
625
|
loading: !1,
|
|
617
626
|
error: null
|
|
618
627
|
};
|
|
619
|
-
|
|
628
|
+
I((t) => [...t.filter((t) => t.sessionId !== e.id), n]), R(e.id), V(!1);
|
|
620
629
|
return;
|
|
621
630
|
}
|
|
622
631
|
let i = {
|
|
@@ -627,16 +636,16 @@ function st() {
|
|
|
627
636
|
loading: !0,
|
|
628
637
|
error: null
|
|
629
638
|
};
|
|
630
|
-
|
|
639
|
+
I((t) => [...t.filter((t) => t.sessionId !== e.id), i]), R(e.id), V(!1);
|
|
631
640
|
try {
|
|
632
|
-
let t = await
|
|
641
|
+
let t = await W({ variables: { id: e.id } });
|
|
633
642
|
if (t.error && n(t.error)) {
|
|
634
|
-
let t =
|
|
635
|
-
|
|
643
|
+
let t = F.filter((t) => t.sessionId !== e.id);
|
|
644
|
+
I(t), L === e.id && R(t.length > 0 ? t[t.length - 1].sessionId : null), r(), D(!0);
|
|
636
645
|
return;
|
|
637
646
|
}
|
|
638
647
|
let i = at(t.data?.startSessionTerminal?.ttydUrl || null, X.find((t) => t.id === e.id)?.agent?.tunnelUrl ?? null);
|
|
639
|
-
|
|
648
|
+
I((t) => t.map((t) => t.sessionId === e.id ? {
|
|
640
649
|
...t,
|
|
641
650
|
terminalUrl: i,
|
|
642
651
|
loading: !1,
|
|
@@ -644,57 +653,57 @@ function st() {
|
|
|
644
653
|
} : t));
|
|
645
654
|
} catch (t) {
|
|
646
655
|
if (n(t)) {
|
|
647
|
-
let t =
|
|
648
|
-
|
|
656
|
+
let t = F.filter((t) => t.sessionId !== e.id);
|
|
657
|
+
I(t), L === e.id && R(t.length > 0 ? t[t.length - 1].sessionId : null), r(), D(!0);
|
|
649
658
|
return;
|
|
650
659
|
}
|
|
651
660
|
let i = t instanceof Error ? t.message : v("sessions.failedStartTerminal", "Failed to start terminal");
|
|
652
|
-
|
|
661
|
+
I((t) => t.map((t) => t.sessionId === e.id ? {
|
|
653
662
|
...t,
|
|
654
663
|
loading: !1,
|
|
655
664
|
error: i
|
|
656
665
|
} : t));
|
|
657
666
|
}
|
|
658
667
|
}, [
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
L,
|
|
669
|
+
F,
|
|
661
670
|
fr,
|
|
662
|
-
|
|
671
|
+
W
|
|
663
672
|
]);
|
|
664
673
|
d(() => {
|
|
665
|
-
if (!
|
|
666
|
-
let e = X.find((e) => e.id ===
|
|
674
|
+
if (!H || !L || F.some((e) => e.sessionId === L)) return;
|
|
675
|
+
let e = X.find((e) => e.id === L);
|
|
667
676
|
e && Q(e);
|
|
668
677
|
}, [
|
|
669
|
-
|
|
678
|
+
L,
|
|
670
679
|
Q,
|
|
671
680
|
X,
|
|
672
|
-
|
|
673
|
-
|
|
681
|
+
F,
|
|
682
|
+
H
|
|
674
683
|
]);
|
|
675
684
|
let mr = u((e) => {
|
|
676
|
-
|
|
677
|
-
let t =
|
|
685
|
+
I((t) => t.filter((t) => t.sessionId !== e)), L === e && R(() => {
|
|
686
|
+
let t = F.filter((t) => t.sessionId !== e);
|
|
678
687
|
return t.length > 0 ? t[t.length - 1].sessionId : null;
|
|
679
688
|
});
|
|
680
|
-
}, [
|
|
681
|
-
let t =
|
|
689
|
+
}, [L, F]), hr = u((e) => {
|
|
690
|
+
let t = F.find((t) => t.sessionId === e);
|
|
682
691
|
t?.terminalUrl && window.open(t.terminalUrl, "_blank");
|
|
683
|
-
}, [
|
|
692
|
+
}, [F]), gr = u(async (e, t) => {
|
|
684
693
|
try {
|
|
685
|
-
await
|
|
694
|
+
await kn({ variables: {
|
|
686
695
|
id: e,
|
|
687
696
|
input: { name: t }
|
|
688
|
-
} }),
|
|
697
|
+
} }), I((n) => n.map((n) => n.sessionId === e ? {
|
|
689
698
|
...n,
|
|
690
699
|
name: t
|
|
691
700
|
} : n));
|
|
692
701
|
} catch (e) {
|
|
693
702
|
console.error("Failed to rename session:", e);
|
|
694
703
|
}
|
|
695
|
-
}, [
|
|
704
|
+
}, [kn]), _r = u(async (e) => {
|
|
696
705
|
try {
|
|
697
|
-
await
|
|
706
|
+
await Dn({ variables: { id: e } }), I((t) => t.map((t) => t.sessionId === e ? {
|
|
698
707
|
...t,
|
|
699
708
|
terminalUrl: null,
|
|
700
709
|
error: v("sessions.terminalStopped", "Terminal stopped")
|
|
@@ -702,18 +711,18 @@ function st() {
|
|
|
702
711
|
} catch (e) {
|
|
703
712
|
console.error("Failed to stop terminal:", e);
|
|
704
713
|
}
|
|
705
|
-
}, [
|
|
706
|
-
let t =
|
|
714
|
+
}, [Dn]), vr = u(async (e) => {
|
|
715
|
+
let t = F.find((t) => t.sessionId === e) || null;
|
|
707
716
|
try {
|
|
708
|
-
|
|
717
|
+
I((t) => t.map((t) => t.sessionId === e ? {
|
|
709
718
|
...t,
|
|
710
719
|
loading: !0,
|
|
711
720
|
error: null,
|
|
712
721
|
terminalUrl: null
|
|
713
722
|
} : t));
|
|
714
|
-
let i = await
|
|
723
|
+
let i = await On({ variables: { id: e } });
|
|
715
724
|
if (i.error && n(i.error)) {
|
|
716
|
-
|
|
725
|
+
I((n) => n.map((n) => n.sessionId === e ? {
|
|
717
726
|
...n,
|
|
718
727
|
loading: !1,
|
|
719
728
|
error: null,
|
|
@@ -722,7 +731,7 @@ function st() {
|
|
|
722
731
|
return;
|
|
723
732
|
}
|
|
724
733
|
let a = i.data?.restartSessionTerminal?.ttydUrl || null;
|
|
725
|
-
|
|
734
|
+
I((t) => t.map((t) => t.sessionId === e ? {
|
|
726
735
|
...t,
|
|
727
736
|
terminalUrl: a,
|
|
728
737
|
loading: !1,
|
|
@@ -730,7 +739,7 @@ function st() {
|
|
|
730
739
|
} : t));
|
|
731
740
|
} catch (i) {
|
|
732
741
|
if (n(i)) {
|
|
733
|
-
|
|
742
|
+
I((n) => n.map((n) => n.sessionId === e ? {
|
|
734
743
|
...n,
|
|
735
744
|
loading: !1,
|
|
736
745
|
error: null,
|
|
@@ -739,14 +748,14 @@ function st() {
|
|
|
739
748
|
return;
|
|
740
749
|
}
|
|
741
750
|
let a = i instanceof Error ? i.message : v("sessions.failedRestartTerminal", "Failed to restart terminal");
|
|
742
|
-
|
|
751
|
+
I((t) => t.map((t) => t.sessionId === e ? {
|
|
743
752
|
...t,
|
|
744
753
|
loading: !1,
|
|
745
754
|
error: a
|
|
746
755
|
} : t));
|
|
747
756
|
}
|
|
748
|
-
}, [
|
|
749
|
-
|
|
757
|
+
}, [On, F]), yr = u(() => {
|
|
758
|
+
on((e) => !e);
|
|
750
759
|
}, []), $ = {
|
|
751
760
|
total: X.length,
|
|
752
761
|
running: X.filter((e) => e.status === "RUNNING").length,
|
|
@@ -764,30 +773,30 @@ function st() {
|
|
|
764
773
|
details: v("sessions.requiredPermission", "Required permission: session:list")
|
|
765
774
|
})
|
|
766
775
|
});
|
|
767
|
-
if (
|
|
776
|
+
if (K && !Rn && X.length === 0) return /* @__PURE__ */ h(_, {
|
|
768
777
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
769
778
|
children: /* @__PURE__ */ h(be, { message: v("sessions.loading", "Loading sessions...") })
|
|
770
779
|
});
|
|
771
|
-
if (
|
|
780
|
+
if (zn && X.length === 0) return /* @__PURE__ */ h(_, {
|
|
772
781
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
773
782
|
children: /* @__PURE__ */ h(xe, {
|
|
774
783
|
title: v("sessions.failedLoad", "Failed to load sessions"),
|
|
775
|
-
message:
|
|
776
|
-
onRetry: () =>
|
|
784
|
+
message: zn.message,
|
|
785
|
+
onRetry: () => q()
|
|
777
786
|
})
|
|
778
787
|
});
|
|
779
788
|
let br = () => !er || w === "terminal" ? null : /* @__PURE__ */ g("div", {
|
|
780
789
|
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",
|
|
781
790
|
children: [/* @__PURE__ */ h("span", {
|
|
782
791
|
className: "text-sm font-medium text-text-primary",
|
|
783
|
-
children: v(
|
|
792
|
+
children: v(A.size === 1 ? "sessions.selectionCountSingle" : "sessions.selectionCountPlural", A.size === 1 ? "{{count}} session selected" : "{{count}} sessions selected", { count: A.size })
|
|
784
793
|
}), /* @__PURE__ */ g("div", {
|
|
785
794
|
className: "flex items-center gap-1.5 sm:ml-auto flex-wrap",
|
|
786
795
|
children: [
|
|
787
796
|
/* @__PURE__ */ g("button", {
|
|
788
797
|
type: "button",
|
|
789
798
|
onClick: tr,
|
|
790
|
-
disabled:
|
|
799
|
+
disabled: jt,
|
|
791
800
|
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",
|
|
792
801
|
children: [
|
|
793
802
|
/* @__PURE__ */ h(Ke, { className: "size-3" }),
|
|
@@ -798,7 +807,7 @@ function st() {
|
|
|
798
807
|
/* @__PURE__ */ g("button", {
|
|
799
808
|
type: "button",
|
|
800
809
|
onClick: nr,
|
|
801
|
-
disabled:
|
|
810
|
+
disabled: jt,
|
|
802
811
|
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",
|
|
803
812
|
children: [
|
|
804
813
|
/* @__PURE__ */ h(Ge, { className: "size-3" }),
|
|
@@ -809,7 +818,7 @@ function st() {
|
|
|
809
818
|
/* @__PURE__ */ g("button", {
|
|
810
819
|
type: "button",
|
|
811
820
|
onClick: rr,
|
|
812
|
-
disabled:
|
|
821
|
+
disabled: jt,
|
|
813
822
|
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",
|
|
814
823
|
children: [
|
|
815
824
|
/* @__PURE__ */ h(Je, { className: "size-3" }),
|
|
@@ -852,7 +861,7 @@ function st() {
|
|
|
852
861
|
children: [
|
|
853
862
|
/* @__PURE__ */ h("button", {
|
|
854
863
|
type: "button",
|
|
855
|
-
onClick: () =>
|
|
864
|
+
onClick: () => jn().then(() => q()),
|
|
856
865
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors",
|
|
857
866
|
title: v("sessions.checkHealth", "Check session health"),
|
|
858
867
|
children: /* @__PURE__ */ h(Le, { className: "size-3.5" })
|
|
@@ -860,12 +869,12 @@ function st() {
|
|
|
860
869
|
/* @__PURE__ */ h("button", {
|
|
861
870
|
type: "button",
|
|
862
871
|
onClick: () => {
|
|
863
|
-
|
|
872
|
+
q(), Vn();
|
|
864
873
|
},
|
|
865
|
-
disabled:
|
|
874
|
+
disabled: K,
|
|
866
875
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
867
876
|
title: v("common.refresh", "Refresh"),
|
|
868
|
-
children: /* @__PURE__ */ h(We, { className: `size-3.5 ${
|
|
877
|
+
children: /* @__PURE__ */ h(We, { className: `size-3.5 ${K ? "animate-spin" : ""}` })
|
|
869
878
|
}),
|
|
870
879
|
/* @__PURE__ */ g("div", {
|
|
871
880
|
className: "flex items-center gap-0.5 rounded bg-bg-surface p-0.5",
|
|
@@ -904,9 +913,9 @@ function st() {
|
|
|
904
913
|
})
|
|
905
914
|
}),
|
|
906
915
|
/* @__PURE__ */ h(Pe, {
|
|
907
|
-
tabs:
|
|
908
|
-
activeTabId:
|
|
909
|
-
onTabSelect:
|
|
916
|
+
tabs: F,
|
|
917
|
+
activeTabId: L,
|
|
918
|
+
onTabSelect: R,
|
|
910
919
|
onTabClose: mr,
|
|
911
920
|
onOpenExternal: hr,
|
|
912
921
|
collapsed: !1,
|
|
@@ -918,7 +927,7 @@ function st() {
|
|
|
918
927
|
onRestartTerminal: vr,
|
|
919
928
|
onCreateSession: or,
|
|
920
929
|
fullScreen: !0,
|
|
921
|
-
isImmersiveFullscreen:
|
|
930
|
+
isImmersiveFullscreen: an,
|
|
922
931
|
onToggleImmersiveFullscreen: yr,
|
|
923
932
|
contextSwitcher: void 0
|
|
924
933
|
}),
|
|
@@ -935,44 +944,44 @@ function st() {
|
|
|
935
944
|
}), v("sessions.statusOnline", "Online")]
|
|
936
945
|
}),
|
|
937
946
|
/* @__PURE__ */ g("span", { children: [
|
|
938
|
-
|
|
947
|
+
F.length,
|
|
939
948
|
" ",
|
|
940
|
-
|
|
949
|
+
F.length === 1 ? "tab" : "tabs"
|
|
941
950
|
] }),
|
|
942
|
-
|
|
951
|
+
L && /* @__PURE__ */ h("span", {
|
|
943
952
|
className: "truncate max-w-[40ch]",
|
|
944
|
-
children:
|
|
953
|
+
children: F.find((e) => e.sessionId === L)?.name
|
|
945
954
|
})
|
|
946
955
|
]
|
|
947
956
|
}), /* @__PURE__ */ g("div", {
|
|
948
957
|
className: "hidden sm:flex items-center gap-3",
|
|
949
958
|
children: [/* @__PURE__ */ h("button", {
|
|
950
959
|
type: "button",
|
|
951
|
-
onClick: () =>
|
|
960
|
+
onClick: () => Qt(!0),
|
|
952
961
|
className: "hover:text-text-secondary transition-colors",
|
|
953
962
|
children: v("sessions.shortcutsHint", "Press ? for shortcuts")
|
|
954
963
|
}), /* @__PURE__ */ h("button", {
|
|
955
964
|
type: "button",
|
|
956
965
|
onClick: () => {
|
|
957
|
-
|
|
966
|
+
en(""), z(!0);
|
|
958
967
|
},
|
|
959
968
|
className: "hover:text-text-secondary transition-colors",
|
|
960
969
|
children: v("sessions.paletteHint", "Cmd+P · Command palette")
|
|
961
970
|
})]
|
|
962
971
|
})]
|
|
963
972
|
}),
|
|
964
|
-
|
|
973
|
+
At && /* @__PURE__ */ h("div", {
|
|
965
974
|
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",
|
|
966
|
-
children:
|
|
975
|
+
children: At
|
|
967
976
|
}),
|
|
968
977
|
Tt && Sr(),
|
|
969
978
|
xr(),
|
|
970
|
-
|
|
979
|
+
Zt && /* @__PURE__ */ h("div", {
|
|
971
980
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/80 backdrop-blur-sm p-4",
|
|
972
981
|
role: "dialog",
|
|
973
982
|
"aria-modal": "true",
|
|
974
983
|
"aria-labelledby": "sessions-cheatsheet-title",
|
|
975
|
-
onClick: () =>
|
|
984
|
+
onClick: () => Qt(!1),
|
|
976
985
|
children: /* @__PURE__ */ g("div", {
|
|
977
986
|
className: "bg-bg-surface border border-border-default rounded-xl shadow-2xl p-6 max-w-md w-full",
|
|
978
987
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -1047,7 +1056,7 @@ function st() {
|
|
|
1047
1056
|
className: "mt-5 flex justify-end",
|
|
1048
1057
|
children: /* @__PURE__ */ h("button", {
|
|
1049
1058
|
type: "button",
|
|
1050
|
-
onClick: () =>
|
|
1059
|
+
onClick: () => Qt(!1),
|
|
1051
1060
|
className: "px-3 py-1.5 text-sm rounded-md bg-bg-sunken hover:bg-bg-secondary text-text-primary transition-colors",
|
|
1052
1061
|
children: v("common.close", "Close")
|
|
1053
1062
|
})
|
|
@@ -1055,22 +1064,22 @@ function st() {
|
|
|
1055
1064
|
]
|
|
1056
1065
|
})
|
|
1057
1066
|
}),
|
|
1058
|
-
|
|
1067
|
+
$t && /* @__PURE__ */ h("div", {
|
|
1059
1068
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-bg-overlay/80 backdrop-blur-sm p-4 pt-20",
|
|
1060
1069
|
role: "dialog",
|
|
1061
1070
|
"aria-modal": "true",
|
|
1062
1071
|
"aria-labelledby": "sessions-palette-title",
|
|
1063
|
-
onClick: () =>
|
|
1072
|
+
onClick: () => z(!1),
|
|
1064
1073
|
children: /* @__PURE__ */ g("div", {
|
|
1065
1074
|
className: "bg-bg-surface border border-border-default rounded-xl shadow-2xl w-full max-w-lg overflow-hidden",
|
|
1066
1075
|
onClick: (e) => e.stopPropagation(),
|
|
1067
1076
|
children: [/* @__PURE__ */ h("input", {
|
|
1068
1077
|
autoFocus: !0,
|
|
1069
1078
|
type: "search",
|
|
1070
|
-
value:
|
|
1071
|
-
onChange: (e) =>
|
|
1079
|
+
value: B,
|
|
1080
|
+
onChange: (e) => en(e.target.value),
|
|
1072
1081
|
onKeyDown: (e) => {
|
|
1073
|
-
e.key === "Escape" &&
|
|
1082
|
+
e.key === "Escape" && z(!1);
|
|
1074
1083
|
},
|
|
1075
1084
|
placeholder: v("sessions.palette.placeholder", "Search sessions or type a command…"),
|
|
1076
1085
|
"aria-label": "Command palette search",
|
|
@@ -1080,10 +1089,10 @@ function st() {
|
|
|
1080
1089
|
className: "max-h-80 overflow-y-auto divide-y divide-border-subtle",
|
|
1081
1090
|
children: [["new"].map((e) => {
|
|
1082
1091
|
let t = v("sessions.palette.new", "New session");
|
|
1083
|
-
return
|
|
1092
|
+
return B && !t.toLowerCase().includes(B.toLowerCase()) ? null : /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("button", {
|
|
1084
1093
|
type: "button",
|
|
1085
1094
|
onClick: () => {
|
|
1086
|
-
|
|
1095
|
+
z(!1), E(!0);
|
|
1087
1096
|
},
|
|
1088
1097
|
className: "w-full text-left px-4 py-2.5 text-sm hover:bg-bg-sunken transition-colors",
|
|
1089
1098
|
children: [/* @__PURE__ */ h("span", {
|
|
@@ -1094,10 +1103,10 @@ function st() {
|
|
|
1094
1103
|
children: "Cmd+T"
|
|
1095
1104
|
})]
|
|
1096
1105
|
}) }, e);
|
|
1097
|
-
}), Z.filter((e) => !
|
|
1106
|
+
}), Z.filter((e) => !B || e.name.toLowerCase().includes(B.toLowerCase())).slice(0, 20).map((e) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("button", {
|
|
1098
1107
|
type: "button",
|
|
1099
1108
|
onClick: () => {
|
|
1100
|
-
|
|
1109
|
+
z(!1), Q(e);
|
|
1101
1110
|
},
|
|
1102
1111
|
className: "w-full text-left px-4 py-2.5 text-sm hover:bg-bg-sunken transition-colors flex items-center justify-between",
|
|
1103
1112
|
children: [/* @__PURE__ */ h("span", {
|
|
@@ -1130,22 +1139,22 @@ function st() {
|
|
|
1130
1139
|
children: [
|
|
1131
1140
|
/* @__PURE__ */ h("button", {
|
|
1132
1141
|
type: "button",
|
|
1133
|
-
onClick: () =>
|
|
1142
|
+
onClick: () => jn().then(() => q()),
|
|
1134
1143
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1135
1144
|
title: v("sessions.checkHealth", "Check session health"),
|
|
1136
1145
|
children: /* @__PURE__ */ h(Le, { className: "size-4" })
|
|
1137
1146
|
}),
|
|
1138
1147
|
/* @__PURE__ */ h("button", {
|
|
1139
1148
|
type: "button",
|
|
1140
|
-
onClick: () =>
|
|
1141
|
-
disabled:
|
|
1149
|
+
onClick: () => q(),
|
|
1150
|
+
disabled: K,
|
|
1142
1151
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1143
1152
|
title: v("sessions.refreshTitle", "Refresh sessions"),
|
|
1144
|
-
children: /* @__PURE__ */ h(We, { className: `size-4 ${
|
|
1153
|
+
children: /* @__PURE__ */ h(We, { className: `size-4 ${K ? "animate-spin" : ""}` })
|
|
1145
1154
|
}),
|
|
1146
1155
|
/* @__PURE__ */ h($e, {
|
|
1147
1156
|
label: v("sessions.export", "Export"),
|
|
1148
|
-
disabled:
|
|
1157
|
+
disabled: Mt,
|
|
1149
1158
|
testId: "sessions-export",
|
|
1150
1159
|
defaultFolderPath: "/Vibecontrols/Sessions",
|
|
1151
1160
|
source: {
|
|
@@ -1153,7 +1162,7 @@ function st() {
|
|
|
1153
1162
|
filename: `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`,
|
|
1154
1163
|
mimeType: "text/csv",
|
|
1155
1164
|
getBlob: async () => {
|
|
1156
|
-
let e = (await
|
|
1165
|
+
let e = (await Fn({ variables: { input: {
|
|
1157
1166
|
filter: {
|
|
1158
1167
|
status: b === "all" ? void 0 : b,
|
|
1159
1168
|
type: x === "all" ? void 0 : x,
|
|
@@ -1171,7 +1180,7 @@ function st() {
|
|
|
1171
1180
|
permission: je.SESSION_CREATE,
|
|
1172
1181
|
children: /* @__PURE__ */ g("button", {
|
|
1173
1182
|
type: "button",
|
|
1174
|
-
onClick: () =>
|
|
1183
|
+
onClick: () => pn(!0),
|
|
1175
1184
|
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",
|
|
1176
1185
|
"data-testid": "sessions-reconnect-button",
|
|
1177
1186
|
title: v("sessions.reconnectTooltip", "Reconnect orphan tmux/wezterm/zellij sessions left over from a previous agent run"),
|
|
@@ -1313,7 +1322,7 @@ function st() {
|
|
|
1313
1322
|
X.length,
|
|
1314
1323
|
" ",
|
|
1315
1324
|
v("nav.sessions", "sessions"),
|
|
1316
|
-
|
|
1325
|
+
K && /* @__PURE__ */ g("span", {
|
|
1317
1326
|
className: "ml-2 text-text-muted",
|
|
1318
1327
|
children: [
|
|
1319
1328
|
"(",
|
|
@@ -1336,7 +1345,7 @@ function st() {
|
|
|
1336
1345
|
onRestart: ur,
|
|
1337
1346
|
onOpenTerminal: Q,
|
|
1338
1347
|
onShare: pr,
|
|
1339
|
-
selected:
|
|
1348
|
+
selected: A.has(e.id),
|
|
1340
1349
|
onToggleSelect: () => Xn(e.id)
|
|
1341
1350
|
}) }, e.id))
|
|
1342
1351
|
}, "grid-view") : /* @__PURE__ */ h(et, { children: /* @__PURE__ */ h(Ne, {
|
|
@@ -1348,7 +1357,7 @@ function st() {
|
|
|
1348
1357
|
onTerminate: dr,
|
|
1349
1358
|
onOpenTerminal: Q,
|
|
1350
1359
|
onShare: pr,
|
|
1351
|
-
selectedIds:
|
|
1360
|
+
selectedIds: A,
|
|
1352
1361
|
onToggleSelect: Xn,
|
|
1353
1362
|
onSelectAll: Zn,
|
|
1354
1363
|
onDeselectAll: Qn
|
|
@@ -1377,20 +1386,20 @@ function st() {
|
|
|
1377
1386
|
})]
|
|
1378
1387
|
})
|
|
1379
1388
|
}),
|
|
1380
|
-
|
|
1389
|
+
At && /* @__PURE__ */ h("div", {
|
|
1381
1390
|
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",
|
|
1382
|
-
children:
|
|
1391
|
+
children: At
|
|
1383
1392
|
})
|
|
1384
1393
|
]
|
|
1385
1394
|
}),
|
|
1386
|
-
|
|
1387
|
-
tabs:
|
|
1388
|
-
activeTabId:
|
|
1389
|
-
onTabSelect:
|
|
1395
|
+
F.length > 0 && /* @__PURE__ */ h(Pe, {
|
|
1396
|
+
tabs: F,
|
|
1397
|
+
activeTabId: L,
|
|
1398
|
+
onTabSelect: R,
|
|
1390
1399
|
onTabClose: mr,
|
|
1391
1400
|
onOpenExternal: hr,
|
|
1392
|
-
onToggleCollapse: () =>
|
|
1393
|
-
collapsed:
|
|
1401
|
+
onToggleCollapse: () => V((e) => !e),
|
|
1402
|
+
collapsed: tn,
|
|
1394
1403
|
sessions: Z,
|
|
1395
1404
|
onOpenTerminal: Q,
|
|
1396
1405
|
onRetryTerminal: Q,
|
|
@@ -1398,16 +1407,16 @@ function st() {
|
|
|
1398
1407
|
onStopTerminal: _r,
|
|
1399
1408
|
onRestartTerminal: vr,
|
|
1400
1409
|
heightClass: "h-[280px] sm:h-[380px]",
|
|
1401
|
-
isImmersiveFullscreen:
|
|
1410
|
+
isImmersiveFullscreen: an,
|
|
1402
1411
|
onToggleImmersiveFullscreen: yr,
|
|
1403
1412
|
contextSwitcher: void 0
|
|
1404
1413
|
}),
|
|
1405
1414
|
Tt && Sr(),
|
|
1406
1415
|
xr(),
|
|
1407
|
-
|
|
1408
|
-
session:
|
|
1409
|
-
isOpen: !!
|
|
1410
|
-
onClose: () =>
|
|
1416
|
+
nn && /* @__PURE__ */ h(Fe, {
|
|
1417
|
+
session: nn,
|
|
1418
|
+
isOpen: !!nn,
|
|
1419
|
+
onClose: () => rn(null)
|
|
1411
1420
|
}),
|
|
1412
1421
|
/* @__PURE__ */ h(e, {
|
|
1413
1422
|
isOpen: Et,
|
|
@@ -1424,8 +1433,8 @@ function st() {
|
|
|
1424
1433
|
]
|
|
1425
1434
|
});
|
|
1426
1435
|
function xr() {
|
|
1427
|
-
if (!
|
|
1428
|
-
let e =
|
|
1436
|
+
if (!fn) return null;
|
|
1437
|
+
let e = xn?.agentSessionOrphans ?? [];
|
|
1429
1438
|
return /* @__PURE__ */ h("div", {
|
|
1430
1439
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1431
1440
|
"data-testid": "sessions-reconnect-modal",
|
|
@@ -1448,23 +1457,23 @@ function st() {
|
|
|
1448
1457
|
children: v("sessions.agent", "Agent")
|
|
1449
1458
|
}), /* @__PURE__ */ h(Oe, {
|
|
1450
1459
|
options: Jn,
|
|
1451
|
-
value:
|
|
1460
|
+
value: mn,
|
|
1452
1461
|
onChange: (e) => {
|
|
1453
|
-
|
|
1462
|
+
hn(e), _n(null), e && bn({ variables: { agentId: e } });
|
|
1454
1463
|
},
|
|
1455
1464
|
placeholder: v("sessions.selectAgent", "Select an agent"),
|
|
1456
1465
|
searchPlaceholder: v("sessions.searchAgents", "Search agents..."),
|
|
1457
1466
|
clearable: !0
|
|
1458
1467
|
})] }),
|
|
1459
|
-
|
|
1468
|
+
gn && /* @__PURE__ */ h("div", {
|
|
1460
1469
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1461
1470
|
"data-testid": "sessions-reconnect-error",
|
|
1462
|
-
children:
|
|
1471
|
+
children: gn
|
|
1463
1472
|
}),
|
|
1464
|
-
|
|
1473
|
+
mn && /* @__PURE__ */ h("div", {
|
|
1465
1474
|
"data-testid": "sessions-reconnect-list",
|
|
1466
1475
|
className: "space-y-2",
|
|
1467
|
-
children:
|
|
1476
|
+
children: Sn ? /* @__PURE__ */ h("div", {
|
|
1468
1477
|
className: "text-sm text-text-secondary",
|
|
1469
1478
|
children: v("sessions.scanningHost", "Scanning host...")
|
|
1470
1479
|
}) : e.length === 0 ? /* @__PURE__ */ h("div", {
|
|
@@ -1492,24 +1501,24 @@ function st() {
|
|
|
1492
1501
|
})]
|
|
1493
1502
|
}), /* @__PURE__ */ h("button", {
|
|
1494
1503
|
type: "button",
|
|
1495
|
-
disabled:
|
|
1504
|
+
disabled: vn === e.externalName,
|
|
1496
1505
|
onClick: async () => {
|
|
1497
|
-
|
|
1506
|
+
yn(e.externalName), _n(null);
|
|
1498
1507
|
try {
|
|
1499
|
-
await
|
|
1500
|
-
agentId:
|
|
1508
|
+
await Cn({ variables: {
|
|
1509
|
+
agentId: mn,
|
|
1501
1510
|
externalName: e.externalName,
|
|
1502
1511
|
name: e.externalName
|
|
1503
|
-
} }), await
|
|
1512
|
+
} }), await bn({ variables: { agentId: mn } });
|
|
1504
1513
|
} catch (e) {
|
|
1505
|
-
|
|
1514
|
+
_n(e instanceof Error ? e.message : String(e));
|
|
1506
1515
|
} finally {
|
|
1507
|
-
|
|
1516
|
+
yn(null);
|
|
1508
1517
|
}
|
|
1509
1518
|
},
|
|
1510
1519
|
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",
|
|
1511
1520
|
"data-testid": `sessions-reconnect-adopt-${e.externalName}`,
|
|
1512
|
-
children:
|
|
1521
|
+
children: vn === e.externalName ? v("sessions.adopting", "Adopting…") : v("sessions.adopt", "Adopt")
|
|
1513
1522
|
})]
|
|
1514
1523
|
}, e.externalName))
|
|
1515
1524
|
})
|
|
@@ -1520,7 +1529,7 @@ function st() {
|
|
|
1520
1529
|
children: /* @__PURE__ */ h("button", {
|
|
1521
1530
|
type: "button",
|
|
1522
1531
|
onClick: () => {
|
|
1523
|
-
|
|
1532
|
+
pn(!1), _n(null);
|
|
1524
1533
|
},
|
|
1525
1534
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1526
1535
|
children: v("common.close", "Close")
|
|
@@ -1552,7 +1561,7 @@ function st() {
|
|
|
1552
1561
|
children: v("sessions.name", "Name")
|
|
1553
1562
|
}), /* @__PURE__ */ h("input", {
|
|
1554
1563
|
"aria-label": "control",
|
|
1555
|
-
ref:
|
|
1564
|
+
ref: Pt,
|
|
1556
1565
|
type: "text",
|
|
1557
1566
|
placeholder: v("sessions.namePlaceholder", "dev-server"),
|
|
1558
1567
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
@@ -1562,8 +1571,8 @@ function st() {
|
|
|
1562
1571
|
children: v("sessions.filterVibe", "Vibe")
|
|
1563
1572
|
}), /* @__PURE__ */ h(Oe, {
|
|
1564
1573
|
options: qn,
|
|
1565
|
-
value:
|
|
1566
|
-
onChange:
|
|
1574
|
+
value: Rt,
|
|
1575
|
+
onChange: zt,
|
|
1567
1576
|
placeholder: v("sessions.noVibe", "No vibe"),
|
|
1568
1577
|
searchPlaceholder: v("sessions.searchVibes", "Search vibes..."),
|
|
1569
1578
|
clearable: !0
|
|
@@ -1575,8 +1584,8 @@ function st() {
|
|
|
1575
1584
|
}),
|
|
1576
1585
|
/* @__PURE__ */ h(Oe, {
|
|
1577
1586
|
options: Jn,
|
|
1578
|
-
value:
|
|
1579
|
-
onChange:
|
|
1587
|
+
value: Bt,
|
|
1588
|
+
onChange: Vt,
|
|
1580
1589
|
placeholder: v("sessions.selectAgent", "Select an agent"),
|
|
1581
1590
|
searchPlaceholder: v("sessions.searchAgents", "Search agents..."),
|
|
1582
1591
|
clearable: !0
|
|
@@ -1591,8 +1600,8 @@ function st() {
|
|
|
1591
1600
|
children: v("sessions.filterType", "Type")
|
|
1592
1601
|
}), /* @__PURE__ */ h(Oe, {
|
|
1593
1602
|
options: Yn,
|
|
1594
|
-
value:
|
|
1595
|
-
onChange:
|
|
1603
|
+
value: N,
|
|
1604
|
+
onChange: Ht,
|
|
1596
1605
|
placeholder: v("sessions.selectType", "Select type"),
|
|
1597
1606
|
searchPlaceholder: v("sessions.searchTypes", "Search types...")
|
|
1598
1607
|
})] }),
|
|
@@ -1601,7 +1610,7 @@ function st() {
|
|
|
1601
1610
|
children: v("sessions.command", "Command")
|
|
1602
1611
|
}), /* @__PURE__ */ h("input", {
|
|
1603
1612
|
"aria-label": "control",
|
|
1604
|
-
ref:
|
|
1613
|
+
ref: Ft,
|
|
1605
1614
|
type: "text",
|
|
1606
1615
|
placeholder: v("sessions.commandPlaceholder", "bun run dev"),
|
|
1607
1616
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
@@ -1610,7 +1619,7 @@ function st() {
|
|
|
1610
1619
|
className: "flex items-center gap-2",
|
|
1611
1620
|
children: [/* @__PURE__ */ h("input", {
|
|
1612
1621
|
"aria-label": "autoStart",
|
|
1613
|
-
ref:
|
|
1622
|
+
ref: It,
|
|
1614
1623
|
type: "checkbox",
|
|
1615
1624
|
id: "autoStart",
|
|
1616
1625
|
className: "size-4 rounded border-border-default"
|
|
@@ -1620,19 +1629,19 @@ function st() {
|
|
|
1620
1629
|
children: v("sessions.autoStartWithVibe", "Auto-start with vibe")
|
|
1621
1630
|
})]
|
|
1622
1631
|
}),
|
|
1623
|
-
(
|
|
1632
|
+
(N === "TMUX" || N === "WEZTERM" || N === "ZELLIJ") && /* @__PURE__ */ g("div", {
|
|
1624
1633
|
className: "rounded-md border border-border-default bg-bg-sunken/40",
|
|
1625
1634
|
"data-testid": "sessions-create-advanced",
|
|
1626
1635
|
children: [/* @__PURE__ */ g("button", {
|
|
1627
1636
|
type: "button",
|
|
1628
|
-
onClick: () =>
|
|
1637
|
+
onClick: () => Wt((e) => !e),
|
|
1629
1638
|
className: "w-full flex items-center justify-between px-3 py-2 text-sm font-medium text-text-primary",
|
|
1630
|
-
"aria-expanded":
|
|
1639
|
+
"aria-expanded": Ut,
|
|
1631
1640
|
children: [/* @__PURE__ */ h("span", { children: v("sessions.advanced", "Advanced options") }), /* @__PURE__ */ h("span", {
|
|
1632
1641
|
className: "text-text-tertiary text-xs",
|
|
1633
|
-
children:
|
|
1642
|
+
children: Ut ? "▾" : "▸"
|
|
1634
1643
|
})]
|
|
1635
|
-
}),
|
|
1644
|
+
}), Ut && /* @__PURE__ */ g("div", {
|
|
1636
1645
|
className: "px-3 pb-3 space-y-2",
|
|
1637
1646
|
children: [
|
|
1638
1647
|
/* @__PURE__ */ h("label", {
|
|
@@ -1641,10 +1650,10 @@ function st() {
|
|
|
1641
1650
|
}),
|
|
1642
1651
|
/* @__PURE__ */ h("input", {
|
|
1643
1652
|
"aria-label": "control",
|
|
1644
|
-
ref:
|
|
1653
|
+
ref: Lt,
|
|
1645
1654
|
type: "text",
|
|
1646
1655
|
"data-testid": "sessions-create-external-name",
|
|
1647
|
-
placeholder:
|
|
1656
|
+
placeholder: N === "WEZTERM" ? "e.g. vibe-051c9c62 (existing wezterm workspace)" : N === "ZELLIJ" ? "e.g. vibe-051c9c62 (existing zellij session)" : "e.g. vibe-051c9c62 (existing tmux session)",
|
|
1648
1657
|
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"
|
|
1649
1658
|
}),
|
|
1650
1659
|
/* @__PURE__ */ h("p", {
|
|
@@ -1663,7 +1672,7 @@ function st() {
|
|
|
1663
1672
|
children: v("sessions.tags", "Tags")
|
|
1664
1673
|
}), /* @__PURE__ */ h(Se, {
|
|
1665
1674
|
entityType: "VIBECONTROLS_SESSION",
|
|
1666
|
-
onDraftChange:
|
|
1675
|
+
onDraftChange: un
|
|
1667
1676
|
})]
|
|
1668
1677
|
}),
|
|
1669
1678
|
/* @__PURE__ */ g("div", {
|