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