@burdenoff/microfe-vibecontrols 2026.1023.6 → 2026.1023.7
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 +1019 -1015
- package/dist/utils/pageContext.js +17 -14
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { useAdoptAgentSessionMutation as e, useAgentSessionOrphansLazyQuery as t, useBulkRestartSessionsMutation as n, useBulkStopSessionsMutation as r, useBulkTerminateSessionsMutation as i, useCheckSessionHealthMutation as a, useCreateSessionMutation as o, useExportSessionsMutation as
|
|
2
|
-
import { ConfirmDialog as
|
|
3
|
-
import { useVibeControlsDocsUrl as
|
|
4
|
-
import { getQuotaDialogContent as
|
|
5
|
-
import { BILLING_PLANS_ROUTE as
|
|
6
|
-
import { useVibeControlsStore as
|
|
7
|
-
import
|
|
8
|
-
import { PageHeader as
|
|
9
|
-
import { LoadingState as
|
|
10
|
-
import { ErrorState as
|
|
11
|
-
import { EntityTagPicker as
|
|
12
|
-
import { useDraftEntityTags as
|
|
13
|
-
import { EmptyState as
|
|
14
|
-
import { SearchInput as
|
|
15
|
-
import { FilterDropdown as
|
|
16
|
-
import { AgentSetupBanner as
|
|
17
|
-
import { GetHelpButton as
|
|
18
|
-
import { SearchableSelect as
|
|
19
|
-
import
|
|
20
|
-
import { getAgentStatus as
|
|
1
|
+
import { useAdoptAgentSessionMutation as e, useAgentSessionOrphansLazyQuery as t, useBulkRestartSessionsMutation as n, useBulkStopSessionsMutation as r, useBulkTerminateSessionsMutation as i, useCheckSessionHealthMutation as a, useCreateSessionMutation as o, useExportSessionsMutation as ee, useListAgentProfilesQuery as te, useListSessionsQuery as ne, useRestartSessionMutation as re, useRestartSessionTerminalMutation as ie, useSessionStatusChangedSubscription as ae, useStartSessionMutation as oe, useStartSessionTerminalMutation as se, useStopSessionMutation as ce, useStopSessionTerminalMutation as le, useTerminateSessionMutation as ue, useUpdateSessionMutation as de, useVibecontrolsAgentHealthProbeStreamSubscription as fe, useVibecontrolsAgentHealthProbesLazyQuery as pe } from "../generated/wspace-operations.js";
|
|
2
|
+
import { ConfirmDialog as me } from "../components/shared/ConfirmDialog.js";
|
|
3
|
+
import { VibeControlsDocsLink as he, useVibeControlsDocsUrl as ge } from "../components/shared/VibeControlsDocsLink.js";
|
|
4
|
+
import { getQuotaDialogContent as _e, isQuotaExhaustedError as s, markQuotaHandledLocally as c } from "../utils/quotaUtils.js";
|
|
5
|
+
import { BILLING_PLANS_ROUTE as ve, useVibeControls as ye, useVibeNavigate as be } from "../providers/VibeControlsProvider.js";
|
|
6
|
+
import { useVibeControlsStore as xe } from "../store/vibeControlsStore.js";
|
|
7
|
+
import Se from "../hooks/useCachedInitialData.js";
|
|
8
|
+
import { PageHeader as Ce } from "../components/shared/PageHeader.js";
|
|
9
|
+
import { LoadingState as we } from "../components/shared/LoadingState.js";
|
|
10
|
+
import { ErrorState as Te } from "../components/shared/ErrorState.js";
|
|
11
|
+
import { EntityTagPicker as Ee } from "../components/shared/EntityTagPicker.js";
|
|
12
|
+
import { useDraftEntityTags as De } from "../hooks/useDraftEntityTags.js";
|
|
13
|
+
import { EmptyState as Oe } from "../components/shared/EmptyState.js";
|
|
14
|
+
import { SearchInput as ke } from "../components/shared/SearchInput.js";
|
|
15
|
+
import { FilterDropdown as Ae } from "../components/shared/FilterDropdown.js";
|
|
16
|
+
import { AgentSetupBanner as je } from "../components/shared/AgentSetupBanner.js";
|
|
17
|
+
import { GetHelpButton as Me } from "../components/shared/GetHelpButton.js";
|
|
18
|
+
import { SearchableSelect as Ne } from "../components/shared/SearchableSelect.js";
|
|
19
|
+
import Pe, { SessionConnectionStatus as Fe } from "../components/shared/SessionNotificationBanner.js";
|
|
20
|
+
import { getAgentStatus as Ie } from "../components/agents/agentStatus.js";
|
|
21
21
|
import "../components/shared/index.js";
|
|
22
|
-
import { notify as
|
|
23
|
-
import { VIBE_PERMISSIONS as
|
|
24
|
-
import { EntityShareButton as
|
|
22
|
+
import { notify as Le } from "../lib/toast.js";
|
|
23
|
+
import { VIBE_PERMISSIONS as Re } from "../constants/permissions.js";
|
|
24
|
+
import { EntityShareButton as ze } from "../components/sharing/EntityShareButton.js";
|
|
25
25
|
import "../components/sharing/index.js";
|
|
26
|
-
import { CheckSessionHealthDialog as
|
|
27
|
-
import { AgentInfoPopover as
|
|
28
|
-
import { SessionCard as
|
|
29
|
-
import { SessionList as
|
|
30
|
-
import { TerminalPanel as
|
|
31
|
-
import { SessionShareDialog as
|
|
32
|
-
import { SessionGroup as
|
|
33
|
-
import { groupSessions as
|
|
34
|
-
import { buildSessionShortcuts as
|
|
35
|
-
import { ShortcutCheatsheet as
|
|
36
|
-
import { SessionsCommandPalette as
|
|
37
|
-
import { SessionInfoPanel as
|
|
26
|
+
import { CheckSessionHealthDialog as Be } from "../components/agents/CheckSessionHealthDialog.js";
|
|
27
|
+
import { AgentInfoPopover as Ve, TargetInfoPopover as He } from "../components/sessions/EntityInfoPopover.js";
|
|
28
|
+
import { SessionCard as Ue } from "../components/sessions/SessionCard.js";
|
|
29
|
+
import { SessionList as We } from "../components/sessions/SessionList.js";
|
|
30
|
+
import { TerminalPanel as Ge } from "../components/sessions/TerminalPanel.js";
|
|
31
|
+
import { SessionShareDialog as Ke } from "../components/sessions/SessionShareDialog.js";
|
|
32
|
+
import { SessionGroup as qe } from "../components/sessions/SessionGroup.js";
|
|
33
|
+
import { groupSessions as Je } from "../components/sessions/groupSessions.js";
|
|
34
|
+
import { buildSessionShortcuts as Ye } from "../components/sessions/sessionShortcuts.js";
|
|
35
|
+
import { ShortcutCheatsheet as Xe } from "../components/sessions/ShortcutCheatsheet.js";
|
|
36
|
+
import { SessionsCommandPalette as Ze } from "../components/sessions/SessionsCommandPalette.js";
|
|
37
|
+
import { SessionInfoPanel as Qe } from "../components/sessions/SessionInfoPanel.js";
|
|
38
38
|
import "../components/sessions/index.js";
|
|
39
|
-
import { randomSessionName as
|
|
40
|
-
import { useCallback as
|
|
41
|
-
import { useI18n as
|
|
42
|
-
import { Activity as
|
|
43
|
-
import { useSearchParams as
|
|
44
|
-
import { usePermissions as
|
|
45
|
-
import { AnimatePresence as
|
|
46
|
-
import { Fragment as
|
|
47
|
-
import { useEventBus as
|
|
48
|
-
import { PagePurpose as
|
|
49
|
-
import { AccessDenied as
|
|
50
|
-
import { MotionItem as
|
|
51
|
-
import { useAssistantPageControls as
|
|
52
|
-
import { enumFilter as
|
|
53
|
-
import { useSafeShellUi as
|
|
54
|
-
import { SaveToFilesButton as
|
|
39
|
+
import { randomSessionName as $e } from "../utils/randomSessionName.js";
|
|
40
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
41
|
+
import { useI18n as et } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
42
|
+
import { Activity as tt, CheckSquare as nt, ChevronDown as rt, Grid as it, Info as at, Keyboard as ot, Layers as st, List as ct, Monitor as lt, MonitorSmartphone as ut, Play as dt, Plus as ft, RefreshCw as pt, RotateCcw as mt, Server as ht, Share2 as gt, SlidersHorizontal as _t, Square as vt, Terminal as yt, Trash2 as bt, XSquare as xt } from "lucide-react";
|
|
43
|
+
import { useSearchParams as St } from "react-router";
|
|
44
|
+
import { usePermissions as Ct } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
45
|
+
import { AnimatePresence as wt } from "framer-motion";
|
|
46
|
+
import { Fragment as Tt, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
47
|
+
import { useEventBus as Et } from "@burdenoff/fe-libs/shared/events";
|
|
48
|
+
import { PagePurpose as Dt } from "@burdenoff/fe-libs/ui";
|
|
49
|
+
import { AccessDenied as Ot, PermissionButton as kt } from "@burdenoff/fe-libs/shared/components";
|
|
50
|
+
import { MotionItem as At, MotionList as jt, MotionPage as Mt } from "@burdenoff/fe-libs/shared/motion";
|
|
51
|
+
import { useAssistantPageControls as Nt } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
|
|
52
|
+
import { enumFilter as Pt, filtersOf as Ft, searchOf as It, tabsOf as Lt } from "@burdenoff/fe-libs/shared/assistant/appControls/pageAdapters";
|
|
53
|
+
import { useSafeShellUi as Rt } from "@burdenoff/fe-libs/shared/providers/shell/ShellUiProvider";
|
|
54
|
+
import { SaveToFilesButton as zt } from "@burdenoff/fe-libs/storage";
|
|
55
55
|
//#region src/pages/SessionsPage.tsx
|
|
56
|
-
function
|
|
56
|
+
function Bt(e, t) {
|
|
57
57
|
if (!e) return null;
|
|
58
58
|
try {
|
|
59
59
|
let n = new URL(e);
|
|
@@ -70,7 +70,7 @@ function Rt(e, t) {
|
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Vt(e, t, n, r) {
|
|
74
74
|
if (e !== "RUNNING") return e;
|
|
75
75
|
if (r === !1) return "ERROR";
|
|
76
76
|
if (!t) return e;
|
|
@@ -83,79 +83,79 @@ function zt(e, t, n, r) {
|
|
|
83
83
|
}
|
|
84
84
|
return e;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
let { t:
|
|
88
|
-
let r =
|
|
86
|
+
function Ht() {
|
|
87
|
+
let { t: Ht } = et(), { onSessionStart: Ut, workspaceId: g } = ye(), _ = Et(), v = be(), { hasPermission: Wt, isLoading: Gt, permissions: Kt } = Ct(), [qt, Jt] = St(), Yt = ge("sessions"), y = l((e, t, n) => {
|
|
88
|
+
let r = Ht(e, n), i = r === e ? t : r;
|
|
89
89
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
90
|
-
}, [
|
|
90
|
+
}, [Ht]), Xt = d(() => [
|
|
91
91
|
{
|
|
92
92
|
value: "all",
|
|
93
|
-
label:
|
|
93
|
+
label: y("sessions.statusAll", "All Statuses")
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
value: "RUNNING",
|
|
97
|
-
label:
|
|
97
|
+
label: y("sessions.running", "Running")
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
value: "STOPPED",
|
|
101
|
-
label:
|
|
101
|
+
label: y("sessions.stopped", "Stopped")
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
value: "STARTING",
|
|
105
|
-
label:
|
|
105
|
+
label: y("sessions.starting", "Starting")
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
value: "ERROR",
|
|
109
|
-
label:
|
|
109
|
+
label: y("common.error", "Error")
|
|
110
110
|
}
|
|
111
|
-
], [
|
|
111
|
+
], [y]), Zt = d(() => [
|
|
112
112
|
{
|
|
113
113
|
value: "all",
|
|
114
|
-
label:
|
|
114
|
+
label: y("sessions.typeAll", "All Types")
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
value: "TMUX",
|
|
118
|
-
label:
|
|
118
|
+
label: y("sessions.typeTmux", "Tmux")
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
value: "TERMINAL",
|
|
122
|
-
label:
|
|
122
|
+
label: y("sessions.typeTerminal", "Terminal")
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
value: "SCRIPT",
|
|
126
|
-
label:
|
|
126
|
+
label: y("sessions.typeScript", "Script")
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
value: "CUSTOM",
|
|
130
|
-
label:
|
|
130
|
+
label: y("sessions.typeCustom", "Custom")
|
|
131
131
|
}
|
|
132
|
-
], [
|
|
133
|
-
|
|
134
|
-
if (!
|
|
132
|
+
], [y]), Qt = Wt(Re.SESSION_LIST), $t = Wt(Re.SESSION_CREATE), en = Wt(Re.SESSION_UPDATE), [b, tn] = p(""), [x, nn] = p("all"), [S, rn] = p("all"), [C, an] = p("all"), [w, on] = p("all"), [T, sn] = p("all"), [E, D] = p("none"), [cn, ln] = p(() => /* @__PURE__ */ new Set()), [O, k] = p("terminal"), [un, A] = p(!1), [dn, fn] = p(!1), pn = f(null), [mn, j] = p(!1), [hn, M] = p(null), [gn, _n] = p(!1), [vn, N] = p(null), [P, F] = p(/* @__PURE__ */ new Set()), [yn, I] = p(!1), [bn, xn] = p(!1), Sn = f(null), Cn = f(null), wn = f(null), Tn = f(null), En = f(null), Dn = f(null);
|
|
133
|
+
u(() => {
|
|
134
|
+
if (!dn) return;
|
|
135
135
|
let e = (e) => {
|
|
136
|
-
|
|
136
|
+
pn.current && !pn.current.contains(e.target) && fn(!1);
|
|
137
137
|
};
|
|
138
138
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
139
|
-
}, [
|
|
140
|
-
let [
|
|
141
|
-
$n.current = Qn,
|
|
139
|
+
}, [dn]);
|
|
140
|
+
let [On, kn] = p(""), [An, jn] = p(""), [Mn, Nn] = p("default"), [L, Pn] = p("TMUX"), [Fn, In] = p(!1), { terminalTabs: Ln, activeTerminalTabId: Rn, sessionsViewMode: zn, sessionsGroupBy: Bn, sessionsTargetFilter: Vn, setTerminalTabs: Hn, setActiveTerminalTabId: Un, setSessionsViewMode: Wn, setSessionsGroupBy: Gn, setSessionsTargetFilter: Kn, sessionInfoPanelOpen: qn, setSessionInfoPanelOpen: R, activeSessionId: z, lastUsedAgentId: Jn, lastUsedVibeId: B, lastUsedSessionType: Yn, lastUsedProfile: Xn, setLastUsedSessionDefaults: Zn } = xe(), Qn = Rt(), $n = f(Qn);
|
|
141
|
+
$n.current = Qn, u(() => {
|
|
142
142
|
let e = $n.current;
|
|
143
|
-
if (!e ||
|
|
143
|
+
if (!e || O !== "terminal") return;
|
|
144
144
|
let t = e.isBreadcrumbCollapsed, n = e.footerVisible;
|
|
145
145
|
return e.setBreadcrumbCollapsed(!0), e.setFooterVisible(!1), () => {
|
|
146
146
|
$n.current?.setBreadcrumbCollapsed(t), $n.current?.setFooterVisible(n);
|
|
147
147
|
};
|
|
148
|
-
}, [
|
|
149
|
-
let [
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
}, [O]);
|
|
149
|
+
let [V, H] = p([]), [U, W] = p(null), [er, G] = p(!1), [tr, nr] = p(!1), [rr, ir] = p(!1), [ar, or] = p(0), [sr, cr] = p(null), [lr, ur] = p(!1), [K, dr] = p(!1), fr = qt.get("view"), pr = qt.get("session"), mr = qt.get("group"), hr = qt.get("target"), [gr] = o({ refetchQueries: ["ListSessions"] }), { setDraftTagIds: _r, flushTags: vr } = De("VIBECONTROLS_SESSION"), [yr, br] = p(!1), [xr, Sr] = p(""), [Cr, wr] = p(null), [Tr, Er] = p(null), [Dr, { data: Or, loading: kr }] = t({ fetchPolicy: "network-only" }), [Ar] = e({ refetchQueries: ["ListSessions"] }), [jr] = oe({ refetchQueries: ["ListSessions"] }), [Mr] = ce({ refetchQueries: ["ListSessions"] }), [Nr] = re({ refetchQueries: ["ListSessions"] }), [q] = se({ refetchQueries: ["ListSessions"] }), [Pr] = le({ refetchQueries: ["ListSessions"] }), [Fr] = ie({ refetchQueries: ["ListSessions"] }), [Ir] = de({ refetchQueries: ["ListSessions"] }), [Lr] = ue({ refetchQueries: ["ListSessions"] }), [Rr] = a({ refetchQueries: ["ListSessions"] }), [zr] = r({ refetchQueries: ["ListSessions"] }), [Br] = n({ refetchQueries: ["ListSessions"] }), [Vr] = i({ refetchQueries: ["ListSessions"] }), [Hr] = ee();
|
|
150
|
+
u(() => {
|
|
151
|
+
K || (fr === "terminal" || fr === "grid" || fr === "list" ? k(fr) : zn && k(zn), pr ? W(pr) : Rn && W(Rn), mr && [
|
|
152
152
|
"none",
|
|
153
153
|
"agent",
|
|
154
154
|
"target",
|
|
155
155
|
"vibe",
|
|
156
156
|
"status",
|
|
157
157
|
"type"
|
|
158
|
-
].includes(mr) ?
|
|
158
|
+
].includes(mr) ? D(mr) : Bn && D(Bn), hr ? sn(hr) : Vn && sn(Vn), Ln.length > 0 && H(Ln.map((e) => ({
|
|
159
159
|
sessionId: e.sessionId,
|
|
160
160
|
name: e.name,
|
|
161
161
|
pinned: e.pinned,
|
|
@@ -164,172 +164,172 @@ function Bt() {
|
|
|
164
164
|
error: null
|
|
165
165
|
}))), dr(!0));
|
|
166
166
|
}, [
|
|
167
|
-
Fn,
|
|
168
|
-
In,
|
|
169
167
|
Ln,
|
|
170
168
|
Rn,
|
|
171
169
|
zn,
|
|
170
|
+
Bn,
|
|
171
|
+
Vn,
|
|
172
172
|
pr,
|
|
173
173
|
fr,
|
|
174
174
|
mr,
|
|
175
175
|
hr,
|
|
176
|
-
|
|
176
|
+
K
|
|
177
177
|
]);
|
|
178
|
-
let Ur =
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
let Ur = f(!1);
|
|
179
|
+
u(() => {
|
|
180
|
+
K && Hn(V.map((e) => ({
|
|
181
181
|
sessionId: e.sessionId,
|
|
182
182
|
name: e.name,
|
|
183
183
|
pinned: e.pinned
|
|
184
184
|
})));
|
|
185
185
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
Bn
|
|
189
|
-
]), d(() => {
|
|
190
|
-
G && Vn(H);
|
|
191
|
-
}, [
|
|
192
|
-
H,
|
|
193
|
-
G,
|
|
194
|
-
Vn
|
|
195
|
-
]), d(() => {
|
|
196
|
-
G && Hn(A);
|
|
197
|
-
}, [
|
|
198
|
-
A,
|
|
199
|
-
G,
|
|
186
|
+
V,
|
|
187
|
+
K,
|
|
200
188
|
Hn
|
|
201
|
-
]),
|
|
202
|
-
|
|
189
|
+
]), u(() => {
|
|
190
|
+
K && Un(U);
|
|
203
191
|
}, [
|
|
204
|
-
|
|
205
|
-
|
|
192
|
+
U,
|
|
193
|
+
K,
|
|
206
194
|
Un
|
|
207
|
-
]),
|
|
208
|
-
|
|
195
|
+
]), u(() => {
|
|
196
|
+
K && Wn(O);
|
|
209
197
|
}, [
|
|
210
|
-
|
|
211
|
-
|
|
198
|
+
O,
|
|
199
|
+
K,
|
|
212
200
|
Wn
|
|
213
|
-
]),
|
|
214
|
-
|
|
215
|
-
let e = new URLSearchParams(b), t = !1, n = A === "terminal" ? null : A;
|
|
216
|
-
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), H ? e.get("session") !== H && (e.set("session", H), t = !0) : e.has("session") && (e.delete("session"), t = !0), O === "none" ? e.has("group") && (e.delete("group"), t = !0) : e.get("group") !== O && (e.set("group", O), t = !0), D === "all" ? e.has("target") && (e.delete("target"), t = !0) : e.get("target") !== D && (e.set("target", D), t = !0), t && Gt(e, { replace: !0 });
|
|
201
|
+
]), u(() => {
|
|
202
|
+
K && Gn(E);
|
|
217
203
|
}, [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
204
|
+
E,
|
|
205
|
+
K,
|
|
206
|
+
Gn
|
|
207
|
+
]), u(() => {
|
|
208
|
+
K && Kn(T);
|
|
209
|
+
}, [
|
|
210
|
+
T,
|
|
211
|
+
K,
|
|
212
|
+
Kn
|
|
213
|
+
]), u(() => {
|
|
214
|
+
if (!K) return;
|
|
215
|
+
let e = new URLSearchParams(qt), t = !1, n = O === "terminal" ? null : O;
|
|
216
|
+
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), U ? e.get("session") !== U && (e.set("session", U), t = !0) : e.has("session") && (e.delete("session"), t = !0), E === "none" ? e.has("group") && (e.delete("group"), t = !0) : e.get("group") !== E && (e.set("group", E), t = !0), T === "all" ? e.has("target") && (e.delete("target"), t = !0) : e.get("target") !== T && (e.set("target", T), t = !0), t && Jt(e, { replace: !0 });
|
|
217
|
+
}, [
|
|
218
|
+
U,
|
|
219
|
+
qt,
|
|
220
|
+
Jt,
|
|
221
|
+
K,
|
|
223
222
|
O,
|
|
224
|
-
|
|
223
|
+
E,
|
|
224
|
+
T
|
|
225
225
|
]);
|
|
226
|
-
let Wr =
|
|
227
|
-
|
|
228
|
-
skip: !
|
|
229
|
-
variables: { workspaceId:
|
|
226
|
+
let Wr = f(null);
|
|
227
|
+
ae({
|
|
228
|
+
skip: !g,
|
|
229
|
+
variables: { workspaceId: g || "" }
|
|
230
230
|
});
|
|
231
|
-
let [Gr, Kr] =
|
|
231
|
+
let [Gr, Kr] = p(!1), [qr, Jr] = p(!1), Yr = l(async () => {
|
|
232
232
|
Jr(!0);
|
|
233
233
|
try {
|
|
234
234
|
let e = await Rr(), t = e.data?.checkSessionHealth;
|
|
235
235
|
if (e.error || !t) {
|
|
236
|
-
|
|
236
|
+
Le.error(e.error?.message || y("agentDetails.checkSessionHealthFailed", "Session health check failed"));
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
239
|
let n = {
|
|
240
240
|
checked: t.checked,
|
|
241
241
|
updated: t.updated
|
|
242
242
|
};
|
|
243
|
-
t.errors.length > 0 ?
|
|
243
|
+
t.errors.length > 0 ? Le.warning(y("agentDetails.checkSessionHealthPartial", "Checked {{checked}} sessions, {{updated}} marked stopped, but {{problems}} reported a problem", {
|
|
244
244
|
...n,
|
|
245
245
|
problems: t.errors.length
|
|
246
|
-
}), t.errors.slice(0, 3).join("\n")) :
|
|
246
|
+
}), t.errors.slice(0, 3).join("\n")) : Le.success(y("agentDetails.checkSessionHealthDone", "Checked {{checked}} sessions, {{updated}} marked stopped", n));
|
|
247
247
|
} catch (e) {
|
|
248
|
-
|
|
248
|
+
Le.error(e instanceof Error ? e.message : y("agentDetails.checkSessionHealthFailed", "Session health check failed"));
|
|
249
249
|
} finally {
|
|
250
250
|
Jr(!1), Kr(!1);
|
|
251
251
|
}
|
|
252
|
-
}, [Rr,
|
|
252
|
+
}, [Rr, y]), { data: Xr, previousData: Zr, loading: Qr, error: $r, refetch: ei } = ne({
|
|
253
253
|
variables: {
|
|
254
254
|
filter: {
|
|
255
|
-
status:
|
|
256
|
-
type:
|
|
257
|
-
vibeId:
|
|
258
|
-
agentId:
|
|
255
|
+
status: x === "all" ? void 0 : x,
|
|
256
|
+
type: S === "all" ? void 0 : S,
|
|
257
|
+
vibeId: C !== "all" && C !== "none" ? C : void 0,
|
|
258
|
+
agentId: w === "all" ? void 0 : w
|
|
259
259
|
},
|
|
260
260
|
pagination: { limit: 50 }
|
|
261
261
|
},
|
|
262
|
-
fetchPolicy:
|
|
263
|
-
}), ti = Xr ?? Zr, { agents:
|
|
262
|
+
fetchPolicy: x === "all" && S === "all" && C === "all" && w === "all" ? "cache-first" : "cache-and-network"
|
|
263
|
+
}), ti = Xr ?? Zr, { agents: J, vibes: Y } = Se(), [ni, ri] = pe({
|
|
264
264
|
fetchPolicy: "network-only",
|
|
265
265
|
notifyOnNetworkStatusChange: !0
|
|
266
|
-
}), { data: ii } =
|
|
266
|
+
}), { data: ii } = fe(), ai = d(() => {
|
|
267
267
|
let e = /* @__PURE__ */ new Map(), t = ii?.vibecontrolsAgentHealthProbeStream ?? ri.data?.vibecontrolsAgentHealthProbes ?? [];
|
|
268
268
|
for (let n of t) e.set(n.agentId, {
|
|
269
269
|
healthy: n.healthy,
|
|
270
270
|
error: n.errorMessage ?? null
|
|
271
271
|
});
|
|
272
272
|
return e;
|
|
273
|
-
}, [ri.data, ii]), oi =
|
|
273
|
+
}, [ri.data, ii]), oi = d(() => [
|
|
274
274
|
{
|
|
275
275
|
value: "all",
|
|
276
|
-
label:
|
|
276
|
+
label: y("sessions.filterVibeAll", "All Vibes")
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
value: "none",
|
|
280
|
-
label:
|
|
280
|
+
label: y("sessions.filterVibeNone", "No Vibe")
|
|
281
281
|
},
|
|
282
|
-
...
|
|
282
|
+
...Y.map((e) => ({
|
|
283
283
|
value: e.id,
|
|
284
284
|
label: e.name
|
|
285
285
|
}))
|
|
286
|
-
], [
|
|
286
|
+
], [Y, y]), si = d(() => [{
|
|
287
287
|
value: "all",
|
|
288
|
-
label:
|
|
289
|
-
}, ...
|
|
288
|
+
label: y("sessions.filterAgentAll", "All Agents")
|
|
289
|
+
}, ...J.map((e) => ({
|
|
290
290
|
value: e.id,
|
|
291
|
-
label: `${e.name} ${
|
|
292
|
-
}))], [
|
|
291
|
+
label: `${e.name} ${Ie(e) === "ACTIVE" ? "" : `(${y("sessions.offline", "Offline")})`}`
|
|
292
|
+
}))], [J, y]), ci = d(() => [
|
|
293
293
|
{
|
|
294
294
|
value: "agent",
|
|
295
|
-
label:
|
|
295
|
+
label: y("sessions.groupBy.agent", "Agent")
|
|
296
296
|
},
|
|
297
297
|
{
|
|
298
298
|
value: "target",
|
|
299
|
-
label:
|
|
299
|
+
label: y("sessions.groupBy.target", "Target")
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
value: "vibe",
|
|
303
|
-
label:
|
|
303
|
+
label: y("sessions.groupBy.vibe", "Vibe")
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
value: "status",
|
|
307
|
-
label:
|
|
307
|
+
label: y("sessions.groupBy.status", "Status")
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
value: "type",
|
|
311
|
-
label:
|
|
311
|
+
label: y("sessions.groupBy.type", "Type")
|
|
312
312
|
}
|
|
313
|
-
], [
|
|
313
|
+
], [y]), li = d(() => [{
|
|
314
314
|
value: "",
|
|
315
|
-
label:
|
|
316
|
-
}, ...
|
|
315
|
+
label: y("sessions.noVibe", "No vibe")
|
|
316
|
+
}, ...Y.map((e) => ({
|
|
317
317
|
value: e.id,
|
|
318
318
|
label: e.name
|
|
319
|
-
}))], [
|
|
319
|
+
}))], [Y, y]), ui = d(() => [{
|
|
320
320
|
value: "",
|
|
321
|
-
label:
|
|
322
|
-
}, ...
|
|
323
|
-
let t =
|
|
321
|
+
label: y("sessions.selectAgent", "Select an agent")
|
|
322
|
+
}, ...J.map((e) => {
|
|
323
|
+
let t = Ie(e) === "ACTIVE" ? y("sessions.active", "Active") : y("sessions.offline", "Offline");
|
|
324
324
|
return {
|
|
325
325
|
value: e.id,
|
|
326
326
|
label: `${e.name} (${t})`
|
|
327
327
|
};
|
|
328
|
-
})], [
|
|
329
|
-
variables: { agentId:
|
|
330
|
-
skip: !
|
|
328
|
+
})], [J, y]), { data: di } = te({
|
|
329
|
+
variables: { agentId: An },
|
|
330
|
+
skip: !An,
|
|
331
331
|
fetchPolicy: "cache-and-network"
|
|
332
|
-
}), fi =
|
|
332
|
+
}), fi = d(() => {
|
|
333
333
|
let e = (di?.vibecontrolsAgentProfiles ?? []).map((e) => ({
|
|
334
334
|
value: e.name,
|
|
335
335
|
label: e.status && e.status !== "ACTIVE" ? `${e.name} (${e.status})` : e.name
|
|
@@ -339,40 +339,40 @@ function Bt() {
|
|
|
339
339
|
label: "default"
|
|
340
340
|
}, ...e];
|
|
341
341
|
}, [di]);
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}, [
|
|
345
|
-
let pi =
|
|
342
|
+
u(() => {
|
|
343
|
+
Nn("default");
|
|
344
|
+
}, [An]);
|
|
345
|
+
let pi = d(() => [
|
|
346
346
|
{
|
|
347
347
|
value: "TMUX",
|
|
348
|
-
label:
|
|
348
|
+
label: y("sessions.typeTmuxLower", "tmux")
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
351
|
value: "WEZTERM",
|
|
352
|
-
label:
|
|
352
|
+
label: y("sessions.typeWezTerm", "WezTerm")
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
355
|
value: "ZELLIJ",
|
|
356
|
-
label:
|
|
356
|
+
label: y("sessions.typeZellij", "Zellij")
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
value: "TERMINAL",
|
|
360
|
-
label:
|
|
360
|
+
label: y("sessions.typeTerminal", "Terminal")
|
|
361
361
|
},
|
|
362
362
|
{
|
|
363
363
|
value: "SSH",
|
|
364
|
-
label:
|
|
364
|
+
label: y("sessions.typeSsh", "SSH")
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
367
|
value: "SCRIPT",
|
|
368
|
-
label:
|
|
368
|
+
label: y("sessions.typeScript", "Script")
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
value: "CUSTOM",
|
|
372
|
-
label:
|
|
372
|
+
label: y("sessions.typeCustom", "Custom")
|
|
373
373
|
}
|
|
374
|
-
], [
|
|
375
|
-
let t =
|
|
374
|
+
], [y]), X = d(() => (ti?.sessions?.items ?? []).map((e) => {
|
|
375
|
+
let t = Bt(e.ttydUrl || null, e.agent?.tunnelUrl || null);
|
|
376
376
|
return {
|
|
377
377
|
id: e.id,
|
|
378
378
|
workspaceId: e.workspaceId,
|
|
@@ -381,7 +381,7 @@ function Bt() {
|
|
|
381
381
|
profile: e.profile ?? "default",
|
|
382
382
|
name: e.name,
|
|
383
383
|
type: e.type,
|
|
384
|
-
status:
|
|
384
|
+
status: Vt(e.status, e.ttydUrl || null, t, e.agent ? Ie(e.agent) === "ACTIVE" : void 0),
|
|
385
385
|
command: e.command || null,
|
|
386
386
|
workingDirectory: e.workingDirectory || null,
|
|
387
387
|
environmentVariables: e.environmentVariables || {},
|
|
@@ -418,104 +418,104 @@ function Bt() {
|
|
|
418
418
|
} : null
|
|
419
419
|
} : void 0
|
|
420
420
|
};
|
|
421
|
-
}), [ti?.sessions?.items]), mi =
|
|
421
|
+
}), [ti?.sessions?.items]), mi = d(() => {
|
|
422
422
|
let e = /* @__PURE__ */ new Map();
|
|
423
|
-
for (let t of
|
|
423
|
+
for (let t of X) {
|
|
424
424
|
let n = t.agent?.target;
|
|
425
425
|
n && !e.has(n.id) && e.set(n.id, n.name);
|
|
426
426
|
}
|
|
427
427
|
return [{
|
|
428
428
|
value: "all",
|
|
429
|
-
label:
|
|
429
|
+
label: y("sessions.filterTargetAll", "All Targets")
|
|
430
430
|
}, ...Array.from(e.entries()).map(([e, t]) => ({
|
|
431
431
|
value: e,
|
|
432
432
|
label: t
|
|
433
433
|
}))];
|
|
434
|
-
}, [
|
|
435
|
-
|
|
436
|
-
page:
|
|
437
|
-
tabs:
|
|
434
|
+
}, [X, y]);
|
|
435
|
+
Nt(d(() => ({
|
|
436
|
+
page: y("vibecontrols.assistant.page.sessions", "Sessions"),
|
|
437
|
+
tabs: Lt({
|
|
438
438
|
items: [
|
|
439
439
|
{
|
|
440
440
|
id: "terminal",
|
|
441
|
-
label:
|
|
441
|
+
label: y("sessions.terminalViewTitle", "Terminal view")
|
|
442
442
|
},
|
|
443
443
|
{
|
|
444
444
|
id: "grid",
|
|
445
|
-
label:
|
|
445
|
+
label: y("sessions.gridViewTitle", "Grid view")
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
448
|
id: "list",
|
|
449
|
-
label:
|
|
449
|
+
label: y("sessions.listViewTitle", "List view")
|
|
450
450
|
}
|
|
451
451
|
],
|
|
452
|
-
value:
|
|
453
|
-
set:
|
|
452
|
+
value: O,
|
|
453
|
+
set: k
|
|
454
454
|
}),
|
|
455
|
-
...
|
|
456
|
-
filters:
|
|
457
|
-
|
|
455
|
+
...O === "terminal" ? {} : {
|
|
456
|
+
filters: Ft([
|
|
457
|
+
Pt({
|
|
458
458
|
id: "status",
|
|
459
|
-
label:
|
|
460
|
-
options:
|
|
459
|
+
label: y("sessions.filterStatus", "Status"),
|
|
460
|
+
options: Xt,
|
|
461
461
|
neutral: "all",
|
|
462
|
-
value:
|
|
463
|
-
set:
|
|
462
|
+
value: x,
|
|
463
|
+
set: nn
|
|
464
464
|
}),
|
|
465
|
-
|
|
465
|
+
Pt({
|
|
466
466
|
id: "type",
|
|
467
|
-
label:
|
|
468
|
-
options:
|
|
467
|
+
label: y("sessions.filterType", "Type"),
|
|
468
|
+
options: Zt,
|
|
469
469
|
neutral: "all",
|
|
470
|
-
value:
|
|
471
|
-
set:
|
|
470
|
+
value: S,
|
|
471
|
+
set: rn
|
|
472
472
|
}),
|
|
473
|
-
|
|
473
|
+
Pt({
|
|
474
474
|
id: "vibe",
|
|
475
|
-
label:
|
|
475
|
+
label: y("sessions.filterVibe", "Vibe"),
|
|
476
476
|
options: oi,
|
|
477
477
|
neutral: "all",
|
|
478
|
-
value:
|
|
479
|
-
set:
|
|
478
|
+
value: C,
|
|
479
|
+
set: an
|
|
480
480
|
}),
|
|
481
|
-
|
|
481
|
+
Pt({
|
|
482
482
|
id: "agent",
|
|
483
|
-
label:
|
|
483
|
+
label: y("sessions.filterAgent", "Agent"),
|
|
484
484
|
options: si,
|
|
485
485
|
neutral: "all",
|
|
486
|
-
value:
|
|
487
|
-
set:
|
|
486
|
+
value: w,
|
|
487
|
+
set: on
|
|
488
488
|
}),
|
|
489
|
-
|
|
489
|
+
Pt({
|
|
490
490
|
id: "target",
|
|
491
|
-
label:
|
|
491
|
+
label: y("sessions.filterTarget", "Target"),
|
|
492
492
|
options: mi,
|
|
493
493
|
neutral: "all",
|
|
494
|
-
value:
|
|
495
|
-
set:
|
|
494
|
+
value: T,
|
|
495
|
+
set: sn
|
|
496
496
|
})
|
|
497
497
|
]),
|
|
498
|
-
search:
|
|
498
|
+
search: It(tn)
|
|
499
499
|
}
|
|
500
500
|
}), [
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
y,
|
|
502
|
+
O,
|
|
503
|
+
Xt,
|
|
504
|
+
Zt,
|
|
505
505
|
oi,
|
|
506
506
|
si,
|
|
507
507
|
mi,
|
|
508
|
+
x,
|
|
509
|
+
S,
|
|
508
510
|
C,
|
|
509
511
|
w,
|
|
510
|
-
T
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
Ur.current || Y.length === 0 || B.length === 0 || (Ur.current = !0, Promise.allSettled(B.map(async (e) => {
|
|
515
|
-
let t = Y.find((t) => t.id === e.sessionId);
|
|
512
|
+
T
|
|
513
|
+
])), u(() => {
|
|
514
|
+
Ur.current || X.length === 0 || V.length === 0 || (Ur.current = !0, Promise.allSettled(V.map(async (e) => {
|
|
515
|
+
let t = X.find((t) => t.id === e.sessionId);
|
|
516
516
|
if (t) try {
|
|
517
|
-
let n = await
|
|
518
|
-
|
|
517
|
+
let n = await q({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i = Bt(n.data?.startSessionTerminal?.ttydUrl ?? null, r);
|
|
518
|
+
H((n) => n.map((n) => n.sessionId === e.sessionId ? {
|
|
519
519
|
...n,
|
|
520
520
|
terminalUrl: i,
|
|
521
521
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -523,7 +523,7 @@ function Bt() {
|
|
|
523
523
|
error: null
|
|
524
524
|
} : n));
|
|
525
525
|
} catch (n) {
|
|
526
|
-
console.warn("[sessions] tab restore startSessionTerminal failed", n),
|
|
526
|
+
console.warn("[sessions] tab restore startSessionTerminal failed", n), H((n) => n.map((n) => n.sessionId === e.sessionId && t.ttydUrl ? {
|
|
527
527
|
...n,
|
|
528
528
|
terminalUrl: t.ttydUrl,
|
|
529
529
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -532,11 +532,11 @@ function Bt() {
|
|
|
532
532
|
}
|
|
533
533
|
})));
|
|
534
534
|
}, [
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
]),
|
|
539
|
-
if (!
|
|
535
|
+
X,
|
|
536
|
+
V,
|
|
537
|
+
q
|
|
538
|
+
]), u(() => {
|
|
539
|
+
if (!K || !z) {
|
|
540
540
|
Wr.current = z;
|
|
541
541
|
return;
|
|
542
542
|
}
|
|
@@ -546,8 +546,8 @@ function Bt() {
|
|
|
546
546
|
}
|
|
547
547
|
if (Wr.current === z) return;
|
|
548
548
|
Wr.current = z;
|
|
549
|
-
let e =
|
|
550
|
-
if (e) if (
|
|
549
|
+
let e = X.find((e) => e.id === z);
|
|
550
|
+
if (e) if (V.find((e) => e.sessionId === z)) W(z), ir(!1);
|
|
551
551
|
else {
|
|
552
552
|
let t = e.ttydUrl || null, n = {
|
|
553
553
|
sessionId: e.id,
|
|
@@ -558,17 +558,17 @@ function Bt() {
|
|
|
558
558
|
loading: !t,
|
|
559
559
|
error: null
|
|
560
560
|
};
|
|
561
|
-
|
|
561
|
+
H((e) => [...e, n]), W(z), ir(!1), t || q({ variables: { id: e.id } }).then((t) => {
|
|
562
562
|
let n = t.data?.startSessionTerminal?.ttydUrl || null;
|
|
563
|
-
|
|
563
|
+
H((t) => t.map((t) => t.sessionId === e.id ? {
|
|
564
564
|
...t,
|
|
565
565
|
terminalUrl: n,
|
|
566
566
|
loading: !1,
|
|
567
|
-
error: n ? null :
|
|
567
|
+
error: n ? null : y("sessions.terminalStartedNoUrl", "Terminal started but no URL was returned. Try restarting.")
|
|
568
568
|
} : t));
|
|
569
569
|
}).catch((t) => {
|
|
570
|
-
let n = t instanceof Error ? t.message :
|
|
571
|
-
|
|
570
|
+
let n = t instanceof Error ? t.message : y("sessions.failedStartTerminal", "Failed to start terminal");
|
|
571
|
+
H((t) => t.map((t) => t.sessionId === e.id ? {
|
|
572
572
|
...t,
|
|
573
573
|
loading: !1,
|
|
574
574
|
error: n
|
|
@@ -577,125 +577,125 @@ function Bt() {
|
|
|
577
577
|
}
|
|
578
578
|
}, [
|
|
579
579
|
z,
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
X,
|
|
581
|
+
V,
|
|
582
|
+
K,
|
|
583
|
+
q
|
|
584
584
|
]);
|
|
585
|
-
let
|
|
586
|
-
if (
|
|
587
|
-
let t =
|
|
585
|
+
let Z = d(() => X.filter((e) => {
|
|
586
|
+
if (b) {
|
|
587
|
+
let t = b.toLowerCase();
|
|
588
588
|
if (!(e.name.toLowerCase().includes(t) || e.command?.toLowerCase().includes(t) || e.workingDirectory?.toLowerCase().includes(t))) return !1;
|
|
589
589
|
}
|
|
590
|
-
return !(
|
|
590
|
+
return !(C === "none" && e.vibeId || T !== "all" && e.agent?.target?.id !== T);
|
|
591
591
|
}), [
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
]), hi =
|
|
597
|
-
|
|
592
|
+
X,
|
|
593
|
+
b,
|
|
594
|
+
C,
|
|
595
|
+
T
|
|
596
|
+
]), hi = d(() => Je(Z, E), [Z, E]), gi = l((e) => {
|
|
597
|
+
F((t) => {
|
|
598
598
|
let n = new Set(t);
|
|
599
599
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
600
600
|
});
|
|
601
|
-
}, []), _i =
|
|
602
|
-
|
|
603
|
-
}, [
|
|
604
|
-
|
|
605
|
-
}, []), yi =
|
|
606
|
-
|
|
601
|
+
}, []), _i = l(() => {
|
|
602
|
+
F(new Set(Z.map((e) => e.id)));
|
|
603
|
+
}, [Z]), vi = l(() => {
|
|
604
|
+
F(/* @__PURE__ */ new Set());
|
|
605
|
+
}, []), yi = l((e) => {
|
|
606
|
+
F((t) => {
|
|
607
607
|
let n = new Set(t);
|
|
608
608
|
return e.length > 0 && e.every((e) => n.has(e)) ? e.forEach((e) => n.delete(e)) : e.forEach((e) => n.add(e)), n;
|
|
609
609
|
});
|
|
610
|
-
}, []), bi =
|
|
611
|
-
|
|
610
|
+
}, []), bi = l((e) => {
|
|
611
|
+
ln((t) => {
|
|
612
612
|
let n = new Set(t);
|
|
613
613
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
614
614
|
});
|
|
615
|
-
}, []), xi =
|
|
616
|
-
if (
|
|
617
|
-
|
|
615
|
+
}, []), xi = Z.length > 0 && P.size === Z.length, Si = P.size > 0, Ci = l(async () => {
|
|
616
|
+
if (P.size !== 0) {
|
|
617
|
+
I(!0);
|
|
618
618
|
try {
|
|
619
|
-
let e = (await zr({ variables: { ids: Array.from(
|
|
620
|
-
|
|
619
|
+
let e = (await zr({ variables: { ids: Array.from(P) } })).data?.bulkStopSessions;
|
|
620
|
+
N(`${y("sessions.stopped", "Stopped")} ${e?.succeeded ?? 0} ${y("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${y("sessions.failed", "failed")}` : ""}`), F(/* @__PURE__ */ new Set()), setTimeout(() => N(null), 3e3);
|
|
621
621
|
} catch (e) {
|
|
622
|
-
|
|
622
|
+
N(`${y("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : y("sessions.failedStop", "Failed to stop sessions")}`), setTimeout(() => N(null), 5e3);
|
|
623
623
|
} finally {
|
|
624
|
-
|
|
624
|
+
I(!1);
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
}, [
|
|
628
|
-
|
|
628
|
+
P,
|
|
629
629
|
zr,
|
|
630
|
-
|
|
631
|
-
]), wi =
|
|
632
|
-
if (
|
|
633
|
-
|
|
630
|
+
y
|
|
631
|
+
]), wi = l(async () => {
|
|
632
|
+
if (P.size !== 0) {
|
|
633
|
+
I(!0);
|
|
634
634
|
try {
|
|
635
|
-
let e = (await Br({ variables: { ids: Array.from(
|
|
636
|
-
|
|
635
|
+
let e = (await Br({ variables: { ids: Array.from(P) } })).data?.bulkRestartSessions;
|
|
636
|
+
N(`${y("sessions.restarted", "Restarted")} ${e?.succeeded ?? 0} ${y("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${y("sessions.failed", "failed")}` : ""}`), F(/* @__PURE__ */ new Set()), setTimeout(() => N(null), 3e3);
|
|
637
637
|
} catch (e) {
|
|
638
|
-
|
|
638
|
+
N(`${y("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : y("sessions.failedRestart", "Failed to restart sessions")}`), setTimeout(() => N(null), 5e3);
|
|
639
639
|
} finally {
|
|
640
|
-
|
|
640
|
+
I(!1);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
}, [
|
|
644
|
-
|
|
644
|
+
P,
|
|
645
645
|
Br,
|
|
646
|
-
|
|
647
|
-
]), Ti =
|
|
648
|
-
if (
|
|
649
|
-
|
|
646
|
+
y
|
|
647
|
+
]), Ti = l(async () => {
|
|
648
|
+
if (P.size !== 0 && confirm(`${y("sessions.confirmRemovePrefix", "Are you sure you want to remove")} ${P.size} ${y("nav.sessions", "session(s)")}? ${y("sessions.confirmRemoveSuffix", "This cannot be undone.")}`)) {
|
|
649
|
+
I(!0);
|
|
650
650
|
try {
|
|
651
|
-
let e = (await Vr({ variables: { ids: Array.from(
|
|
652
|
-
|
|
651
|
+
let e = (await Vr({ variables: { ids: Array.from(P) } })).data?.bulkTerminateSessions;
|
|
652
|
+
N(`${y("sessions.removed", "Removed")} ${e?.succeeded ?? 0} ${y("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${y("sessions.failed", "failed")}` : ""}`), F(/* @__PURE__ */ new Set()), setTimeout(() => N(null), 3e3);
|
|
653
653
|
} catch (e) {
|
|
654
|
-
|
|
654
|
+
N(`${y("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : y("sessions.failedRemove", "Failed to remove sessions")}`), setTimeout(() => N(null), 5e3);
|
|
655
655
|
} finally {
|
|
656
|
-
|
|
656
|
+
I(!1);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
}, [
|
|
660
|
-
|
|
660
|
+
P,
|
|
661
661
|
Vr,
|
|
662
|
-
|
|
663
|
-
]), Ei =
|
|
664
|
-
|
|
662
|
+
y
|
|
663
|
+
]), Ei = l(async (e = "CSV") => {
|
|
664
|
+
xn(!0);
|
|
665
665
|
try {
|
|
666
666
|
let t = (await Hr({ variables: { input: {
|
|
667
667
|
filter: {
|
|
668
|
-
status:
|
|
669
|
-
type:
|
|
670
|
-
vibeId:
|
|
671
|
-
agentId:
|
|
668
|
+
status: x === "all" ? void 0 : x,
|
|
669
|
+
type: S === "all" ? void 0 : S,
|
|
670
|
+
vibeId: C !== "all" && C !== "none" ? C : void 0,
|
|
671
|
+
agentId: w === "all" ? void 0 : w
|
|
672
672
|
},
|
|
673
673
|
format: e
|
|
674
674
|
} } })).data?.exportSessions;
|
|
675
675
|
if (!t) return;
|
|
676
676
|
let n = e === "CSV" ? "text/csv" : "application/json", r = new Blob([t.data], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
677
|
-
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i),
|
|
677
|
+
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i), N(y("sessions.exportSuccess", "Exported {{count}} sessions as {{format}}", {
|
|
678
678
|
count: t.count,
|
|
679
679
|
format: e
|
|
680
|
-
})), setTimeout(() =>
|
|
680
|
+
})), setTimeout(() => N(null), 3e3);
|
|
681
681
|
} catch (e) {
|
|
682
|
-
|
|
682
|
+
N(`${y("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : y("sessions.failedExport", "Failed to export sessions")}`), setTimeout(() => N(null), 5e3);
|
|
683
683
|
} finally {
|
|
684
|
-
|
|
684
|
+
xn(!1);
|
|
685
685
|
}
|
|
686
686
|
}, [
|
|
687
687
|
Hr,
|
|
688
|
+
x,
|
|
689
|
+
S,
|
|
688
690
|
C,
|
|
689
691
|
w,
|
|
690
|
-
|
|
691
|
-
E,
|
|
692
|
-
x
|
|
692
|
+
y
|
|
693
693
|
]), Di = (e) => {
|
|
694
|
-
|
|
694
|
+
v(`/sessions/${e.id}`);
|
|
695
695
|
}, Oi = () => {
|
|
696
|
-
|
|
696
|
+
M(null), A(!0), _.emitCustom("vibecontrols.session.create_clicked", { workspaceId: g ?? void 0 });
|
|
697
697
|
}, ki = async (e) => {
|
|
698
|
-
|
|
698
|
+
_n(!0), M(null);
|
|
699
699
|
try {
|
|
700
700
|
let t = await gr({ variables: { input: {
|
|
701
701
|
name: e.name,
|
|
@@ -707,17 +707,17 @@ function Bt() {
|
|
|
707
707
|
autoStart: e.autoStart,
|
|
708
708
|
externalSessionName: e.externalSessionName
|
|
709
709
|
} } });
|
|
710
|
-
if (t.error &&
|
|
711
|
-
|
|
710
|
+
if (t.error && s(t.error)) {
|
|
711
|
+
A(!1), c(), j(!0), _.emitCustom("vibecontrols.quota.session_limit_hit", { workspaceId: g ?? void 0 });
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
714
714
|
if (t.error) {
|
|
715
|
-
|
|
715
|
+
M(t.error.message || y("sessions.failedCreate", "Failed to create session"));
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
let n = t.data?.createSession?.id;
|
|
719
719
|
if (!n) {
|
|
720
|
-
|
|
720
|
+
M(y("sessions.failedCreate", "Failed to create session"));
|
|
721
721
|
return;
|
|
722
722
|
}
|
|
723
723
|
if (Zn({
|
|
@@ -725,12 +725,12 @@ function Bt() {
|
|
|
725
725
|
vibeId: e.vibeId || null,
|
|
726
726
|
sessionType: e.type,
|
|
727
727
|
profile: e.profile?.trim() || "default"
|
|
728
|
-
}),
|
|
729
|
-
workspaceId:
|
|
728
|
+
}), A(!1), N(y("sessions.createdSuccess", "Session created successfully")), _.emitCustom("vibecontrols.session.created", {
|
|
729
|
+
workspaceId: g ?? void 0,
|
|
730
730
|
sessionId: n
|
|
731
|
-
}), e.fromModal && await vr(n), setTimeout(() =>
|
|
732
|
-
let e = t.data.createSession, n = e.agentId ?
|
|
733
|
-
|
|
731
|
+
}), e.fromModal && await vr(n), setTimeout(() => N(null), 3e3), t.data?.createSession) {
|
|
732
|
+
let e = t.data.createSession, n = e.agentId ? J.find((t) => t.id === e.agentId) : null;
|
|
733
|
+
Q({
|
|
734
734
|
id: e.id,
|
|
735
735
|
workspaceId: e.workspaceId,
|
|
736
736
|
vibeId: e.vibeId || null,
|
|
@@ -761,64 +761,64 @@ function Bt() {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
} catch (e) {
|
|
764
|
-
if (
|
|
765
|
-
|
|
764
|
+
if (s(e)) {
|
|
765
|
+
A(!1), c(), j(!0), _.emitCustom("vibecontrols.quota.session_limit_hit", { workspaceId: g ?? void 0 });
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
M(e instanceof Error ? e.message : y("sessions.failedCreate", "Failed to create session"));
|
|
769
769
|
} finally {
|
|
770
|
-
|
|
770
|
+
_n(!1);
|
|
771
771
|
}
|
|
772
772
|
}, Ai = async () => {
|
|
773
|
-
let e =
|
|
773
|
+
let e = wn.current?.value?.trim(), t = On, n = An, r = L, i = Tn.current?.value?.trim(), a = En.current?.checked ?? !1;
|
|
774
774
|
if (!e) {
|
|
775
|
-
|
|
775
|
+
M(y("sessions.nameRequired", "Name is required"));
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
let o =
|
|
779
|
-
if (n && (!t || o.some((e) => e.id === n)) ?
|
|
780
|
-
|
|
778
|
+
let o = Y.find((e) => e.id === t)?.agents ?? [], ee = null;
|
|
779
|
+
if (n && (!t || o.some((e) => e.id === n)) ? ee = n : o.length === 1 && (ee = o[0]?.id ?? null), !ee) {
|
|
780
|
+
M(t && o.length === 0 ? y("sessions.noAgentAttached", "This vibe has no agents attached. Attach one from the Vibe → Agents tab before creating sessions.") : t && o.length > 1 ? y("sessions.pickAgentFromVibe", "This vibe has multiple agents attached. Pick one before creating the session.") : y("sessions.agentRequired", "Please select an agent for this session."));
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
|
-
let
|
|
784
|
-
if (
|
|
785
|
-
|
|
783
|
+
let te = ai.get(ee);
|
|
784
|
+
if (te && !te.healthy) {
|
|
785
|
+
M(y("sessions.agentNotHealthy", "The selected agent isn’t fully reachable right now. Please wait for the agent badge to turn green and retry.") + (te.error ? ` (${te.error})` : ""));
|
|
786
786
|
return;
|
|
787
787
|
}
|
|
788
|
-
let
|
|
788
|
+
let ne = Dn.current?.value?.trim() || void 0;
|
|
789
789
|
await ki({
|
|
790
790
|
name: e,
|
|
791
791
|
type: r || "TMUX",
|
|
792
792
|
command: i || void 0,
|
|
793
793
|
vibeId: t || void 0,
|
|
794
|
-
agentId:
|
|
795
|
-
profile:
|
|
794
|
+
agentId: ee,
|
|
795
|
+
profile: Mn?.trim() || "default",
|
|
796
796
|
autoStart: a,
|
|
797
|
-
externalSessionName:
|
|
797
|
+
externalSessionName: ne,
|
|
798
798
|
fromModal: !0
|
|
799
799
|
});
|
|
800
800
|
}, ji = () => {
|
|
801
|
-
|
|
801
|
+
M(null);
|
|
802
802
|
let e = (e) => {
|
|
803
803
|
let t = ai.get(e);
|
|
804
804
|
return !t || t.healthy;
|
|
805
|
-
}, t =
|
|
805
|
+
}, t = Jn && J.some((e) => e.id === Jn) ? Jn : null, n = null;
|
|
806
806
|
if (t && e(t)) n = t;
|
|
807
807
|
else {
|
|
808
|
-
let t =
|
|
808
|
+
let t = J.filter((t) => e(t.id));
|
|
809
809
|
n = (t.find((e) => e.isActive) ?? t[0])?.id ?? null;
|
|
810
810
|
}
|
|
811
811
|
if (!n) {
|
|
812
|
-
t &&
|
|
812
|
+
t && jn(t), B && Y.some((e) => e.id === B) && kn(B), Pn(Yn || "TMUX"), Nn(Xn || "default"), A(!0), _.emitCustom("vibecontrols.session.create_clicked", { workspaceId: g ?? void 0 });
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
815
|
let r;
|
|
816
|
-
if (
|
|
817
|
-
let e =
|
|
818
|
-
e && (e.agents ?? []).some((e) => e.id === n) && (r =
|
|
816
|
+
if (B) {
|
|
817
|
+
let e = Y.find((e) => e.id === B);
|
|
818
|
+
e && (e.agents ?? []).some((e) => e.id === n) && (r = B);
|
|
819
819
|
}
|
|
820
820
|
ki({
|
|
821
|
-
name:
|
|
821
|
+
name: $e(),
|
|
822
822
|
type: Yn || "TMUX",
|
|
823
823
|
vibeId: r,
|
|
824
824
|
agentId: n,
|
|
@@ -828,18 +828,18 @@ function Bt() {
|
|
|
828
828
|
});
|
|
829
829
|
}, Mi = async (e) => {
|
|
830
830
|
try {
|
|
831
|
-
await jr({ variables: { id: e.id } }),
|
|
831
|
+
await jr({ variables: { id: e.id } }), Ut?.({
|
|
832
832
|
id: e.id,
|
|
833
833
|
name: e.name,
|
|
834
834
|
type: e.type,
|
|
835
835
|
status: "RUNNING"
|
|
836
|
-
}),
|
|
837
|
-
workspaceId:
|
|
836
|
+
}), _.emitCustom("vibecontrols.session.started", {
|
|
837
|
+
workspaceId: g ?? void 0,
|
|
838
838
|
sessionId: e.id
|
|
839
839
|
});
|
|
840
840
|
} catch (e) {
|
|
841
|
-
if (
|
|
842
|
-
|
|
841
|
+
if (s(e)) {
|
|
842
|
+
c(), j(!0), _.emitCustom("vibecontrols.quota.session_limit_hit", { workspaceId: g ?? void 0 });
|
|
843
843
|
return;
|
|
844
844
|
}
|
|
845
845
|
console.error("Failed to start session:", e);
|
|
@@ -854,8 +854,8 @@ function Bt() {
|
|
|
854
854
|
try {
|
|
855
855
|
await Nr({ variables: { id: e.id } });
|
|
856
856
|
} catch (e) {
|
|
857
|
-
if (
|
|
858
|
-
|
|
857
|
+
if (s(e)) {
|
|
858
|
+
c(), j(!0);
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
861
|
console.error("Failed to restart session:", e);
|
|
@@ -866,11 +866,11 @@ function Bt() {
|
|
|
866
866
|
} catch (e) {
|
|
867
867
|
console.error("Failed to terminate session:", e);
|
|
868
868
|
}
|
|
869
|
-
}, Ii =
|
|
869
|
+
}, Ii = l((e) => e.ttydUrl || null, []), Li = l((e) => {
|
|
870
870
|
cr(e);
|
|
871
|
-
}, []),
|
|
872
|
-
if (
|
|
873
|
-
|
|
871
|
+
}, []), Q = l(async (e) => {
|
|
872
|
+
if (V.find((t) => t.sessionId === e.id)?.terminalUrl) {
|
|
873
|
+
W(e.id), ir(!1);
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
876
|
let t = Ii(e);
|
|
@@ -884,7 +884,7 @@ function Bt() {
|
|
|
884
884
|
loading: !1,
|
|
885
885
|
error: null
|
|
886
886
|
};
|
|
887
|
-
|
|
887
|
+
H((t) => [...t.filter((t) => t.sessionId !== e.id), n]), W(e.id), ir(!1);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
890
|
let n = {
|
|
@@ -895,194 +895,194 @@ function Bt() {
|
|
|
895
895
|
loading: !0,
|
|
896
896
|
error: null
|
|
897
897
|
};
|
|
898
|
-
|
|
898
|
+
H((t) => [...t.filter((t) => t.sessionId !== e.id), n]), W(e.id), ir(!1);
|
|
899
899
|
try {
|
|
900
|
-
let t = await
|
|
901
|
-
if (t.error &&
|
|
902
|
-
let t =
|
|
903
|
-
|
|
900
|
+
let t = await q({ variables: { id: e.id } });
|
|
901
|
+
if (t.error && s(t.error)) {
|
|
902
|
+
let t = V.filter((t) => t.sessionId !== e.id);
|
|
903
|
+
H(t), U === e.id && W(t.length > 0 ? t[t.length - 1].sessionId : null), c(), j(!0);
|
|
904
904
|
return;
|
|
905
905
|
}
|
|
906
906
|
if (t.error) {
|
|
907
|
-
let n = t.error.message ||
|
|
908
|
-
|
|
907
|
+
let n = t.error.message || y("sessions.failedStartTerminal", "Failed to start terminal");
|
|
908
|
+
H((t) => t.map((t) => t.sessionId === e.id ? {
|
|
909
909
|
...t,
|
|
910
910
|
loading: !1,
|
|
911
911
|
error: n
|
|
912
912
|
} : t));
|
|
913
913
|
return;
|
|
914
914
|
}
|
|
915
|
-
let n =
|
|
916
|
-
|
|
915
|
+
let n = Bt(t.data?.startSessionTerminal?.ttydUrl || null, X.find((t) => t.id === e.id)?.agent?.tunnelUrl ?? null);
|
|
916
|
+
H((t) => t.map((t) => t.sessionId === e.id ? {
|
|
917
917
|
...t,
|
|
918
918
|
terminalUrl: n,
|
|
919
919
|
loading: !1,
|
|
920
|
-
error: n ? null :
|
|
920
|
+
error: n ? null : y("sessions.terminalStartedNoTunnelUrl", "Terminal started but no tunnel URL was returned. Try restarting.")
|
|
921
921
|
} : t));
|
|
922
922
|
} catch (t) {
|
|
923
|
-
if (
|
|
924
|
-
let t =
|
|
925
|
-
|
|
923
|
+
if (s(t)) {
|
|
924
|
+
let t = V.filter((t) => t.sessionId !== e.id);
|
|
925
|
+
H(t), U === e.id && W(t.length > 0 ? t[t.length - 1].sessionId : null), c(), j(!0);
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
|
-
let n = t instanceof Error ? t.message :
|
|
929
|
-
|
|
928
|
+
let n = t instanceof Error ? t.message : y("sessions.failedStartTerminal", "Failed to start terminal");
|
|
929
|
+
H((t) => t.map((t) => t.sessionId === e.id ? {
|
|
930
930
|
...t,
|
|
931
931
|
loading: !1,
|
|
932
932
|
error: n
|
|
933
933
|
} : t));
|
|
934
934
|
}
|
|
935
935
|
}, [
|
|
936
|
-
|
|
937
|
-
|
|
936
|
+
U,
|
|
937
|
+
V,
|
|
938
938
|
Ii,
|
|
939
|
-
|
|
939
|
+
q
|
|
940
940
|
]);
|
|
941
|
-
|
|
942
|
-
if (!
|
|
943
|
-
let e =
|
|
944
|
-
e &&
|
|
941
|
+
u(() => {
|
|
942
|
+
if (!K || !U || V.some((e) => e.sessionId === U)) return;
|
|
943
|
+
let e = X.find((e) => e.id === U);
|
|
944
|
+
e && Q(e);
|
|
945
945
|
}, [
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
946
|
+
U,
|
|
947
|
+
Q,
|
|
948
|
+
X,
|
|
949
|
+
V,
|
|
950
|
+
K
|
|
951
951
|
]);
|
|
952
|
-
let Ri =
|
|
953
|
-
|
|
954
|
-
let t =
|
|
952
|
+
let Ri = l((e) => {
|
|
953
|
+
H((t) => t.filter((t) => t.sessionId !== e)), U === e && W(() => {
|
|
954
|
+
let t = V.filter((t) => t.sessionId !== e);
|
|
955
955
|
return t.length > 0 ? t[t.length - 1].sessionId : null;
|
|
956
956
|
});
|
|
957
|
-
}, [
|
|
958
|
-
let t =
|
|
959
|
-
t?.terminalUrl && (
|
|
960
|
-
workspaceId:
|
|
957
|
+
}, [U, V]), zi = l((e) => {
|
|
958
|
+
let t = V.find((t) => t.sessionId === e);
|
|
959
|
+
t?.terminalUrl && (_.emitCustom("vibecontrols.session.terminal_opened_in_browser", {
|
|
960
|
+
workspaceId: g ?? void 0,
|
|
961
961
|
sessionId: e
|
|
962
962
|
}), window.open(t.terminalUrl, "_blank"));
|
|
963
963
|
}, [
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
]), Bi =
|
|
964
|
+
V,
|
|
965
|
+
g,
|
|
966
|
+
_
|
|
967
|
+
]), Bi = l(async (e, t) => {
|
|
968
968
|
try {
|
|
969
969
|
await Ir({ variables: {
|
|
970
970
|
id: e,
|
|
971
971
|
input: { name: t }
|
|
972
|
-
} }),
|
|
972
|
+
} }), H((n) => n.map((n) => n.sessionId === e ? {
|
|
973
973
|
...n,
|
|
974
974
|
name: t
|
|
975
975
|
} : n));
|
|
976
976
|
} catch (e) {
|
|
977
977
|
console.error("Failed to rename session:", e);
|
|
978
978
|
}
|
|
979
|
-
}, [Ir]), Vi =
|
|
979
|
+
}, [Ir]), Vi = l(async (e) => {
|
|
980
980
|
try {
|
|
981
|
-
await Pr({ variables: { id: e } }),
|
|
981
|
+
await Pr({ variables: { id: e } }), H((t) => t.map((t) => t.sessionId === e ? {
|
|
982
982
|
...t,
|
|
983
983
|
terminalUrl: null,
|
|
984
|
-
error:
|
|
984
|
+
error: y("sessions.terminalStopped", "Terminal stopped")
|
|
985
985
|
} : t));
|
|
986
986
|
} catch (e) {
|
|
987
987
|
console.error("Failed to stop terminal:", e);
|
|
988
988
|
}
|
|
989
|
-
}, [Pr]), Hi =
|
|
990
|
-
let t =
|
|
989
|
+
}, [Pr]), Hi = l(async (e) => {
|
|
990
|
+
let t = V.find((t) => t.sessionId === e) || null;
|
|
991
991
|
try {
|
|
992
|
-
|
|
992
|
+
H((t) => t.map((t) => t.sessionId === e ? {
|
|
993
993
|
...t,
|
|
994
994
|
loading: !0,
|
|
995
995
|
error: null,
|
|
996
996
|
terminalUrl: null
|
|
997
997
|
} : t));
|
|
998
998
|
let n = await Fr({ variables: { id: e } });
|
|
999
|
-
if (n.error &&
|
|
1000
|
-
|
|
999
|
+
if (n.error && s(n.error)) {
|
|
1000
|
+
H((n) => n.map((n) => n.sessionId === e ? {
|
|
1001
1001
|
...n,
|
|
1002
1002
|
loading: !1,
|
|
1003
1003
|
error: null,
|
|
1004
1004
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
1005
|
-
} : n)),
|
|
1005
|
+
} : n)), c(), j(!0);
|
|
1006
1006
|
return;
|
|
1007
1007
|
}
|
|
1008
1008
|
let r = n.data?.restartSessionTerminal?.ttydUrl || null;
|
|
1009
|
-
|
|
1009
|
+
H((t) => t.map((t) => t.sessionId === e ? {
|
|
1010
1010
|
...t,
|
|
1011
1011
|
terminalUrl: r,
|
|
1012
1012
|
loading: !1,
|
|
1013
|
-
error: r ? null :
|
|
1013
|
+
error: r ? null : y("sessions.terminalRestartedNoUrl", "Terminal restarted but no URL returned.")
|
|
1014
1014
|
} : t));
|
|
1015
1015
|
} catch (n) {
|
|
1016
|
-
if (
|
|
1017
|
-
|
|
1016
|
+
if (s(n)) {
|
|
1017
|
+
H((n) => n.map((n) => n.sessionId === e ? {
|
|
1018
1018
|
...n,
|
|
1019
1019
|
loading: !1,
|
|
1020
1020
|
error: null,
|
|
1021
1021
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
1022
|
-
} : n)),
|
|
1022
|
+
} : n)), c(), j(!0);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
let r = n instanceof Error ? n.message :
|
|
1026
|
-
|
|
1025
|
+
let r = n instanceof Error ? n.message : y("sessions.failedRestartTerminal", "Failed to restart terminal");
|
|
1026
|
+
H((t) => t.map((t) => t.sessionId === e ? {
|
|
1027
1027
|
...t,
|
|
1028
1028
|
loading: !1,
|
|
1029
1029
|
error: r
|
|
1030
1030
|
} : t));
|
|
1031
1031
|
}
|
|
1032
|
-
}, [Fr,
|
|
1033
|
-
let t =
|
|
1032
|
+
}, [Fr, V]), Ui = l(async (e) => {
|
|
1033
|
+
let t = X.find((t) => t.id === e);
|
|
1034
1034
|
try {
|
|
1035
|
-
let n = await
|
|
1035
|
+
let n = await q({ variables: { id: e } });
|
|
1036
1036
|
if (n.error) return;
|
|
1037
|
-
let r =
|
|
1038
|
-
r &&
|
|
1037
|
+
let r = Bt(n.data?.startSessionTerminal?.ttydUrl || null, t?.agent?.tunnelUrl ?? null);
|
|
1038
|
+
r && H((t) => t.map((t) => t.sessionId === e ? {
|
|
1039
1039
|
...t,
|
|
1040
1040
|
terminalUrl: r,
|
|
1041
1041
|
loading: !1,
|
|
1042
1042
|
error: null
|
|
1043
1043
|
} : t));
|
|
1044
1044
|
} catch {}
|
|
1045
|
-
}, [
|
|
1046
|
-
|
|
1045
|
+
}, [X, q]), Wi = l((e) => {
|
|
1046
|
+
H((t) => {
|
|
1047
1047
|
let n = new Map(t.map((e) => [e.sessionId, e])), r = e.map((e) => n.get(e)).filter((e) => !!e);
|
|
1048
1048
|
for (let n of t) e.includes(n.sessionId) || r.push(n);
|
|
1049
1049
|
return r;
|
|
1050
1050
|
});
|
|
1051
|
-
}, []), Gi =
|
|
1052
|
-
|
|
1051
|
+
}, []), Gi = l((e) => {
|
|
1052
|
+
H((t) => t.map((t) => t.sessionId === e ? {
|
|
1053
1053
|
...t,
|
|
1054
1054
|
pinned: !t.pinned
|
|
1055
1055
|
} : t));
|
|
1056
|
-
}, []), Ki =
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
let t =
|
|
1060
|
-
t?.agent?.id &&
|
|
1061
|
-
}, [
|
|
1062
|
-
let t =
|
|
1063
|
-
t?.agent?.target?.id &&
|
|
1064
|
-
}, [
|
|
1065
|
-
let t =
|
|
1056
|
+
}, []), Ki = l((e) => {
|
|
1057
|
+
W(e), R(!0);
|
|
1058
|
+
}, [R]), qi = l((e) => {
|
|
1059
|
+
let t = X.find((t) => t.id === e);
|
|
1060
|
+
t?.agent?.id && v(`/agents/${t.agent.id}`);
|
|
1061
|
+
}, [X, v]), Ji = l((e) => {
|
|
1062
|
+
let t = X.find((t) => t.id === e);
|
|
1063
|
+
t?.agent?.target?.id && v(`/targets/${t.agent.target.id}`);
|
|
1064
|
+
}, [X, v]), Yi = l((e) => {
|
|
1065
|
+
let t = X.find((t) => t.id === e);
|
|
1066
1066
|
t && cr(t);
|
|
1067
|
-
}, [
|
|
1067
|
+
}, [X]), Xi = l(() => {
|
|
1068
1068
|
ur((e) => !e);
|
|
1069
|
-
}, []), $ =
|
|
1070
|
-
|
|
1071
|
-
}, []),
|
|
1072
|
-
|
|
1073
|
-
}, []),
|
|
1074
|
-
$?.agent?.id &&
|
|
1075
|
-
}, [$,
|
|
1076
|
-
$?.agent?.target?.id &&
|
|
1077
|
-
}, [$,
|
|
1078
|
-
|
|
1079
|
-
}, [
|
|
1080
|
-
|
|
1081
|
-
}, [
|
|
1082
|
-
|
|
1083
|
-
}, [
|
|
1084
|
-
|
|
1085
|
-
}, [
|
|
1069
|
+
}, []), $ = d(() => X.find((e) => e.id === U) ?? null, [X, U]), Zi = l(() => {
|
|
1070
|
+
Sn.current?.querySelector("input")?.focus();
|
|
1071
|
+
}, []), Qi = l(() => {
|
|
1072
|
+
k((e) => e === "terminal" ? "grid" : e === "grid" ? "list" : "terminal");
|
|
1073
|
+
}, []), $i = l(() => {
|
|
1074
|
+
$?.agent?.id && v(`/agents/${$.agent.id}`);
|
|
1075
|
+
}, [$, v]), ea = l(() => {
|
|
1076
|
+
$?.agent?.target?.id && v(`/targets/${$.agent.target.id}`);
|
|
1077
|
+
}, [$, v]), ta = l(() => {
|
|
1078
|
+
U && Ui(U);
|
|
1079
|
+
}, [U, Ui]), na = l(() => {
|
|
1080
|
+
U && Ri(U);
|
|
1081
|
+
}, [U, Ri]), ra = l(() => {
|
|
1082
|
+
U && or((e) => e + 1);
|
|
1083
|
+
}, [U]), ia = l(() => {
|
|
1084
|
+
U && zi(U);
|
|
1085
|
+
}, [U, zi]), aa = l((e) => {
|
|
1086
1086
|
let t = [], n = (e) => {
|
|
1087
1087
|
e && t.push({
|
|
1088
1088
|
el: e,
|
|
@@ -1090,578 +1090,582 @@ function Bt() {
|
|
|
1090
1090
|
left: e.scrollLeft
|
|
1091
1091
|
});
|
|
1092
1092
|
};
|
|
1093
|
-
n(
|
|
1093
|
+
n(Cn.current), n(document.querySelector("[data-shell-scroll-container]")), n(document.scrollingElement), e(), requestAnimationFrame(() => {
|
|
1094
1094
|
t.forEach(({ el: e, top: t, left: n }) => {
|
|
1095
1095
|
e.scrollTop = t, e.scrollLeft = n;
|
|
1096
1096
|
});
|
|
1097
1097
|
});
|
|
1098
|
-
}, []),
|
|
1099
|
-
|
|
1100
|
-
}, [
|
|
1101
|
-
|
|
1102
|
-
let
|
|
1098
|
+
}, []), oa = l((e) => {
|
|
1099
|
+
aa(() => W(e));
|
|
1100
|
+
}, [aa]), sa = f(ji);
|
|
1101
|
+
sa.current = ji;
|
|
1102
|
+
let ca = l(() => {
|
|
1103
1103
|
nr(!0);
|
|
1104
|
-
}, []),
|
|
1105
|
-
|
|
1106
|
-
}, [
|
|
1107
|
-
newSession: () =>
|
|
1108
|
-
newSessionWithOptions: () =>
|
|
1109
|
-
renameActiveTab:
|
|
1110
|
-
openActiveInNewTab:
|
|
1111
|
-
closeActiveTab:
|
|
1112
|
-
openPalette:
|
|
1113
|
-
openCheatsheet: () =>
|
|
1114
|
-
focusSearch:
|
|
1115
|
-
cycleView:
|
|
1116
|
-
groupByNone: () =>
|
|
1117
|
-
groupByAgent: () =>
|
|
1118
|
-
groupByTarget: () =>
|
|
1119
|
-
groupByVibe: () =>
|
|
1120
|
-
groupByStatus: () =>
|
|
1121
|
-
reconnectActive:
|
|
1122
|
-
toggleFullscreen:
|
|
1123
|
-
toggleInfoPanel:
|
|
1124
|
-
openActiveAgent:
|
|
1125
|
-
openActiveTarget:
|
|
1126
|
-
},
|
|
1127
|
-
na,
|
|
1104
|
+
}, []), la = l(() => {
|
|
1105
|
+
R(!qn);
|
|
1106
|
+
}, [qn, R]), ua = d(() => Ye({
|
|
1107
|
+
newSession: () => sa.current(),
|
|
1108
|
+
newSessionWithOptions: () => A(!0),
|
|
1109
|
+
renameActiveTab: ra,
|
|
1110
|
+
openActiveInNewTab: ia,
|
|
1111
|
+
closeActiveTab: na,
|
|
1112
|
+
openPalette: ca,
|
|
1113
|
+
openCheatsheet: () => G(!0),
|
|
1114
|
+
focusSearch: Zi,
|
|
1115
|
+
cycleView: Qi,
|
|
1116
|
+
groupByNone: () => D("none"),
|
|
1117
|
+
groupByAgent: () => D("agent"),
|
|
1118
|
+
groupByTarget: () => D("target"),
|
|
1119
|
+
groupByVibe: () => D("vibe"),
|
|
1120
|
+
groupByStatus: () => D("status"),
|
|
1121
|
+
reconnectActive: ta,
|
|
1122
|
+
toggleFullscreen: Xi,
|
|
1123
|
+
toggleInfoPanel: la,
|
|
1124
|
+
openActiveAgent: $i,
|
|
1125
|
+
openActiveTarget: ea
|
|
1126
|
+
}, y), [
|
|
1128
1127
|
ra,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
Xi,
|
|
1132
|
-
Zi,
|
|
1133
|
-
ea,
|
|
1134
|
-
Q,
|
|
1128
|
+
ia,
|
|
1129
|
+
na,
|
|
1135
1130
|
ca,
|
|
1131
|
+
Zi,
|
|
1136
1132
|
Qi,
|
|
1133
|
+
ta,
|
|
1134
|
+
Xi,
|
|
1135
|
+
la,
|
|
1137
1136
|
$i,
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1137
|
+
ea,
|
|
1138
|
+
y
|
|
1139
|
+
]), da = f(null);
|
|
1140
|
+
u(() => {
|
|
1141
1141
|
let e = (e) => {
|
|
1142
1142
|
let t = e.target, n = t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable, r = e.metaKey || e.ctrlKey;
|
|
1143
1143
|
if (r && ["k", "p"].includes(e.key.toLowerCase())) {
|
|
1144
|
-
e.preventDefault(),
|
|
1144
|
+
e.preventDefault(), ca();
|
|
1145
1145
|
return;
|
|
1146
1146
|
}
|
|
1147
1147
|
if (n) return;
|
|
1148
|
-
let i = Date.now(), a =
|
|
1149
|
-
if (a && a.key === "g" && i - a.at < 1e3) switch (
|
|
1148
|
+
let i = Date.now(), a = da.current;
|
|
1149
|
+
if (a && a.key === "g" && i - a.at < 1e3) switch (da.current = null, e.key) {
|
|
1150
1150
|
case "a":
|
|
1151
|
-
e.preventDefault(),
|
|
1151
|
+
e.preventDefault(), D("agent");
|
|
1152
1152
|
return;
|
|
1153
1153
|
case "t":
|
|
1154
|
-
e.preventDefault(),
|
|
1154
|
+
e.preventDefault(), D("target");
|
|
1155
1155
|
return;
|
|
1156
1156
|
case "v":
|
|
1157
|
-
e.preventDefault(),
|
|
1157
|
+
e.preventDefault(), D("vibe");
|
|
1158
1158
|
return;
|
|
1159
1159
|
case "s":
|
|
1160
|
-
e.preventDefault(),
|
|
1160
|
+
e.preventDefault(), D("status");
|
|
1161
1161
|
return;
|
|
1162
1162
|
case "0":
|
|
1163
|
-
e.preventDefault(),
|
|
1163
|
+
e.preventDefault(), D("none");
|
|
1164
1164
|
return;
|
|
1165
1165
|
case "A":
|
|
1166
|
-
e.preventDefault(),
|
|
1166
|
+
e.preventDefault(), $i();
|
|
1167
1167
|
return;
|
|
1168
1168
|
case "T":
|
|
1169
|
-
e.preventDefault(),
|
|
1169
|
+
e.preventDefault(), ea();
|
|
1170
1170
|
return;
|
|
1171
1171
|
default: break;
|
|
1172
1172
|
}
|
|
1173
1173
|
if (!r && !e.altKey && e.key === "g") {
|
|
1174
|
-
|
|
1174
|
+
da.current = {
|
|
1175
1175
|
key: "g",
|
|
1176
1176
|
at: i
|
|
1177
1177
|
};
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
1180
|
if (r && e.shiftKey && e.key.toLowerCase() === "t") {
|
|
1181
|
-
e.preventDefault(),
|
|
1181
|
+
e.preventDefault(), A(!0);
|
|
1182
1182
|
return;
|
|
1183
1183
|
}
|
|
1184
1184
|
if (r && !e.shiftKey && e.key.toLowerCase() === "t") {
|
|
1185
|
-
e.preventDefault(),
|
|
1185
|
+
e.preventDefault(), sa.current();
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
1188
|
-
if (r && !e.shiftKey && e.key.toLowerCase() === "o" &&
|
|
1189
|
-
e.preventDefault(),
|
|
1188
|
+
if (r && !e.shiftKey && e.key.toLowerCase() === "o" && U) {
|
|
1189
|
+
e.preventDefault(), ia();
|
|
1190
1190
|
return;
|
|
1191
1191
|
}
|
|
1192
|
-
if (r && e.key.toLowerCase() === "w" &&
|
|
1193
|
-
e.preventDefault(),
|
|
1192
|
+
if (r && e.key.toLowerCase() === "w" && U) {
|
|
1193
|
+
e.preventDefault(), na();
|
|
1194
1194
|
return;
|
|
1195
1195
|
}
|
|
1196
1196
|
let o = (e) => {
|
|
1197
|
-
if (
|
|
1198
|
-
let t =
|
|
1199
|
-
|
|
1197
|
+
if (V.length < 2) return;
|
|
1198
|
+
let t = V.findIndex((e) => e.sessionId === U);
|
|
1199
|
+
W(V[((t < 0 ? 0 : t) + e + V.length) % V.length].sessionId);
|
|
1200
1200
|
};
|
|
1201
|
-
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey &&
|
|
1201
|
+
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey && V.length > 1) {
|
|
1202
1202
|
e.preventDefault(), o(1);
|
|
1203
1203
|
return;
|
|
1204
1204
|
}
|
|
1205
|
-
if (e.ctrlKey && e.key === "Tab" && e.shiftKey &&
|
|
1205
|
+
if (e.ctrlKey && e.key === "Tab" && e.shiftKey && V.length > 1) {
|
|
1206
1206
|
e.preventDefault(), o(-1);
|
|
1207
1207
|
return;
|
|
1208
1208
|
}
|
|
1209
|
-
if (r && e.shiftKey && e.code === "BracketRight" &&
|
|
1209
|
+
if (r && e.shiftKey && e.code === "BracketRight" && V.length > 1) {
|
|
1210
1210
|
e.preventDefault(), o(1);
|
|
1211
1211
|
return;
|
|
1212
1212
|
}
|
|
1213
|
-
if (r && e.shiftKey && e.code === "BracketLeft" &&
|
|
1213
|
+
if (r && e.shiftKey && e.code === "BracketLeft" && V.length > 1) {
|
|
1214
1214
|
e.preventDefault(), o(-1);
|
|
1215
1215
|
return;
|
|
1216
1216
|
}
|
|
1217
|
-
if (r && /^[1-9]$/.test(e.key) &&
|
|
1217
|
+
if (r && /^[1-9]$/.test(e.key) && V.length > 0) {
|
|
1218
1218
|
let t = Number(e.key) - 1;
|
|
1219
|
-
t <
|
|
1219
|
+
t < V.length && (e.preventDefault(), W(V[t].sessionId));
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
if (r && e.key.toLowerCase() === "r" &&
|
|
1223
|
-
e.preventDefault(),
|
|
1222
|
+
if (r && e.key.toLowerCase() === "r" && U) {
|
|
1223
|
+
e.preventDefault(), ta();
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
1226
|
if (r && e.key === "\\") {
|
|
1227
|
-
e.preventDefault(),
|
|
1227
|
+
e.preventDefault(), Qi();
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
1230
1230
|
if (!r) {
|
|
1231
1231
|
if (e.key === "/") {
|
|
1232
|
-
e.preventDefault(),
|
|
1232
|
+
e.preventDefault(), Zi();
|
|
1233
1233
|
return;
|
|
1234
1234
|
}
|
|
1235
1235
|
if (e.key === "f") {
|
|
1236
|
-
e.preventDefault(),
|
|
1236
|
+
e.preventDefault(), Xi();
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
if (e.key === "i") {
|
|
1240
|
-
e.preventDefault(),
|
|
1240
|
+
e.preventDefault(), la();
|
|
1241
1241
|
return;
|
|
1242
1242
|
}
|
|
1243
|
-
if (e.key === "F2" &&
|
|
1244
|
-
e.preventDefault(),
|
|
1243
|
+
if (e.key === "F2" && U) {
|
|
1244
|
+
e.preventDefault(), ra();
|
|
1245
1245
|
return;
|
|
1246
1246
|
}
|
|
1247
1247
|
if (e.key === "?") {
|
|
1248
|
-
e.preventDefault(),
|
|
1248
|
+
e.preventDefault(), G(!0);
|
|
1249
1249
|
return;
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
};
|
|
1253
1253
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1254
1254
|
}, [
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
ta,
|
|
1255
|
+
U,
|
|
1256
|
+
V,
|
|
1258
1257
|
na,
|
|
1259
1258
|
ra,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
Xi,
|
|
1263
|
-
sa,
|
|
1259
|
+
ia,
|
|
1260
|
+
ta,
|
|
1264
1261
|
Qi,
|
|
1265
|
-
|
|
1262
|
+
Zi,
|
|
1266
1263
|
ca,
|
|
1267
|
-
|
|
1264
|
+
$i,
|
|
1265
|
+
ea,
|
|
1266
|
+
la,
|
|
1267
|
+
Xi
|
|
1268
1268
|
]);
|
|
1269
|
-
let
|
|
1270
|
-
let e =
|
|
1269
|
+
let fa = d(() => {
|
|
1270
|
+
let e = y("sessions.palette.groupActions", "Actions"), t = y("sessions.palette.groupView", "View"), n = y("sessions.palette.groupNav", "Navigation"), r = y("sessions.palette.groupSessions", "Sessions"), i = [
|
|
1271
1271
|
{
|
|
1272
1272
|
id: "new-session",
|
|
1273
|
-
label:
|
|
1273
|
+
label: y("sessions.palette.newSessionQuick", "New terminal (quick)"),
|
|
1274
1274
|
group: e,
|
|
1275
|
-
icon: /* @__PURE__ */
|
|
1275
|
+
icon: /* @__PURE__ */ m(ft, { className: "size-4" }),
|
|
1276
1276
|
shortcut: "⌘/Ctrl T",
|
|
1277
|
-
run: () =>
|
|
1277
|
+
run: () => sa.current()
|
|
1278
1278
|
},
|
|
1279
1279
|
{
|
|
1280
1280
|
id: "new-session-options",
|
|
1281
|
-
label:
|
|
1281
|
+
label: y("sessions.newSessionWithOptions", "New session with options…"),
|
|
1282
1282
|
group: e,
|
|
1283
|
-
icon: /* @__PURE__ */
|
|
1283
|
+
icon: /* @__PURE__ */ m(_t, { className: "size-4" }),
|
|
1284
1284
|
shortcut: "⌘/Ctrl ⇧ T",
|
|
1285
|
-
run: () =>
|
|
1285
|
+
run: () => A(!0)
|
|
1286
1286
|
},
|
|
1287
|
-
...
|
|
1287
|
+
...U ? [{
|
|
1288
1288
|
id: "rename-tab",
|
|
1289
|
-
label:
|
|
1289
|
+
label: y("sessions.sc.renameTab", "Rename active tab"),
|
|
1290
1290
|
group: e,
|
|
1291
|
-
icon: /* @__PURE__ */
|
|
1291
|
+
icon: /* @__PURE__ */ m(ot, { className: "size-4" }),
|
|
1292
1292
|
shortcut: "F2",
|
|
1293
|
-
run:
|
|
1293
|
+
run: ra
|
|
1294
1294
|
}, {
|
|
1295
1295
|
id: "open-tab-new",
|
|
1296
|
-
label:
|
|
1296
|
+
label: y("sessions.sc.openTabNew", "Open active tab in new browser tab"),
|
|
1297
1297
|
group: e,
|
|
1298
|
-
icon: /* @__PURE__ */
|
|
1298
|
+
icon: /* @__PURE__ */ m(gt, { className: "size-4" }),
|
|
1299
1299
|
shortcut: "⌘/Ctrl O",
|
|
1300
|
-
run:
|
|
1300
|
+
run: ia
|
|
1301
1301
|
}] : [],
|
|
1302
1302
|
{
|
|
1303
1303
|
id: "reconnect",
|
|
1304
|
-
label:
|
|
1304
|
+
label: y("sessions.palette.reconnect", "Reconnect active terminal"),
|
|
1305
1305
|
group: e,
|
|
1306
|
-
icon: /* @__PURE__ */
|
|
1307
|
-
run:
|
|
1306
|
+
icon: /* @__PURE__ */ m(mt, { className: "size-4" }),
|
|
1307
|
+
run: ta
|
|
1308
1308
|
},
|
|
1309
1309
|
{
|
|
1310
1310
|
id: "refresh",
|
|
1311
|
-
label:
|
|
1311
|
+
label: y("common.refresh", "Refresh"),
|
|
1312
1312
|
group: e,
|
|
1313
|
-
icon: /* @__PURE__ */
|
|
1313
|
+
icon: /* @__PURE__ */ m(pt, { className: "size-4" }),
|
|
1314
1314
|
run: () => void ei()
|
|
1315
1315
|
},
|
|
1316
1316
|
...$ ? [{
|
|
1317
1317
|
id: "share-active",
|
|
1318
|
-
label:
|
|
1318
|
+
label: y("sessions.palette.shareActive", "Share / offer active session"),
|
|
1319
1319
|
group: e,
|
|
1320
|
-
icon: /* @__PURE__ */
|
|
1320
|
+
icon: /* @__PURE__ */ m(gt, { className: "size-4" }),
|
|
1321
1321
|
run: () => cr($)
|
|
1322
1322
|
}] : [],
|
|
1323
1323
|
{
|
|
1324
1324
|
id: "view-terminal",
|
|
1325
|
-
label:
|
|
1325
|
+
label: y("sessions.palette.viewTerminal", "Switch to terminal view"),
|
|
1326
1326
|
group: t,
|
|
1327
|
-
icon: /* @__PURE__ */
|
|
1328
|
-
run: () =>
|
|
1327
|
+
icon: /* @__PURE__ */ m(lt, { className: "size-4" }),
|
|
1328
|
+
run: () => k("terminal")
|
|
1329
1329
|
},
|
|
1330
1330
|
{
|
|
1331
1331
|
id: "view-grid",
|
|
1332
|
-
label:
|
|
1332
|
+
label: y("sessions.palette.viewGrid", "Switch to grid view"),
|
|
1333
1333
|
group: t,
|
|
1334
|
-
icon: /* @__PURE__ */
|
|
1335
|
-
run: () =>
|
|
1334
|
+
icon: /* @__PURE__ */ m(it, { className: "size-4" }),
|
|
1335
|
+
run: () => k("grid")
|
|
1336
1336
|
},
|
|
1337
1337
|
{
|
|
1338
1338
|
id: "view-list",
|
|
1339
|
-
label:
|
|
1339
|
+
label: y("sessions.palette.viewList", "Switch to list view"),
|
|
1340
1340
|
group: t,
|
|
1341
|
-
icon: /* @__PURE__ */
|
|
1342
|
-
run: () =>
|
|
1341
|
+
icon: /* @__PURE__ */ m(ct, { className: "size-4" }),
|
|
1342
|
+
run: () => k("list")
|
|
1343
1343
|
},
|
|
1344
1344
|
{
|
|
1345
1345
|
id: "group-agent",
|
|
1346
|
-
label:
|
|
1346
|
+
label: y("sessions.palette.groupByAgent", "Group by agent"),
|
|
1347
1347
|
group: t,
|
|
1348
|
-
icon: /* @__PURE__ */
|
|
1349
|
-
run: () =>
|
|
1348
|
+
icon: /* @__PURE__ */ m(ht, { className: "size-4" }),
|
|
1349
|
+
run: () => D("agent")
|
|
1350
1350
|
},
|
|
1351
1351
|
{
|
|
1352
1352
|
id: "group-target",
|
|
1353
|
-
label:
|
|
1353
|
+
label: y("sessions.palette.groupByTarget", "Group by target"),
|
|
1354
1354
|
group: t,
|
|
1355
|
-
icon: /* @__PURE__ */
|
|
1356
|
-
run: () =>
|
|
1355
|
+
icon: /* @__PURE__ */ m(ut, { className: "size-4" }),
|
|
1356
|
+
run: () => D("target")
|
|
1357
1357
|
},
|
|
1358
1358
|
{
|
|
1359
1359
|
id: "group-vibe",
|
|
1360
|
-
label:
|
|
1360
|
+
label: y("sessions.palette.groupByVibe", "Group by vibe"),
|
|
1361
1361
|
group: t,
|
|
1362
|
-
icon: /* @__PURE__ */
|
|
1363
|
-
run: () =>
|
|
1362
|
+
icon: /* @__PURE__ */ m(st, { className: "size-4" }),
|
|
1363
|
+
run: () => D("vibe")
|
|
1364
1364
|
},
|
|
1365
1365
|
{
|
|
1366
1366
|
id: "group-none",
|
|
1367
|
-
label:
|
|
1367
|
+
label: y("sessions.palette.groupClear", "Clear grouping"),
|
|
1368
1368
|
group: t,
|
|
1369
|
-
icon: /* @__PURE__ */
|
|
1370
|
-
run: () =>
|
|
1369
|
+
icon: /* @__PURE__ */ m(st, { className: "size-4" }),
|
|
1370
|
+
run: () => D("none")
|
|
1371
1371
|
},
|
|
1372
1372
|
{
|
|
1373
1373
|
id: "toggle-info",
|
|
1374
|
-
label:
|
|
1374
|
+
label: y("sessions.palette.toggleInfo", "Toggle session info panel"),
|
|
1375
1375
|
group: t,
|
|
1376
|
-
icon: /* @__PURE__ */
|
|
1377
|
-
run:
|
|
1376
|
+
icon: /* @__PURE__ */ m(at, { className: "size-4" }),
|
|
1377
|
+
run: la
|
|
1378
1378
|
},
|
|
1379
1379
|
{
|
|
1380
1380
|
id: "shortcuts",
|
|
1381
|
-
label:
|
|
1381
|
+
label: y("sessions.palette.shortcuts", "Keyboard shortcuts"),
|
|
1382
1382
|
group: t,
|
|
1383
|
-
icon: /* @__PURE__ */
|
|
1384
|
-
run: () =>
|
|
1383
|
+
icon: /* @__PURE__ */ m(ot, { className: "size-4" }),
|
|
1384
|
+
run: () => G(!0)
|
|
1385
1385
|
},
|
|
1386
1386
|
...$?.agent ? [{
|
|
1387
1387
|
id: "goto-agent",
|
|
1388
|
-
label:
|
|
1388
|
+
label: y("sessions.palette.gotoAgent", "Open active session's agent"),
|
|
1389
1389
|
group: n,
|
|
1390
|
-
icon: /* @__PURE__ */
|
|
1391
|
-
run:
|
|
1390
|
+
icon: /* @__PURE__ */ m(ht, { className: "size-4" }),
|
|
1391
|
+
run: $i
|
|
1392
1392
|
}] : [],
|
|
1393
1393
|
...$?.agent?.target ? [{
|
|
1394
1394
|
id: "goto-target",
|
|
1395
|
-
label:
|
|
1395
|
+
label: y("sessions.palette.gotoTarget", "Open active session's target"),
|
|
1396
1396
|
group: n,
|
|
1397
|
-
icon: /* @__PURE__ */
|
|
1398
|
-
run:
|
|
1397
|
+
icon: /* @__PURE__ */ m(ut, { className: "size-4" }),
|
|
1398
|
+
run: ea
|
|
1399
1399
|
}] : []
|
|
1400
1400
|
];
|
|
1401
|
-
for (let e of
|
|
1401
|
+
for (let e of Z.slice(0, 30)) i.push({
|
|
1402
1402
|
id: `open-${e.id}`,
|
|
1403
1403
|
label: e.name,
|
|
1404
1404
|
group: r,
|
|
1405
|
-
icon: /* @__PURE__ */
|
|
1405
|
+
icon: /* @__PURE__ */ m(yt, { className: "size-4" }),
|
|
1406
1406
|
keywords: `${e.status} ${e.agent?.name ?? ""} ${e.agent?.target?.name ?? ""}`,
|
|
1407
|
-
run: () => void
|
|
1407
|
+
run: () => void Q(e)
|
|
1408
1408
|
});
|
|
1409
1409
|
return i;
|
|
1410
1410
|
}, [
|
|
1411
|
-
|
|
1411
|
+
y,
|
|
1412
1412
|
$,
|
|
1413
|
-
|
|
1414
|
-
na,
|
|
1413
|
+
U,
|
|
1415
1414
|
ra,
|
|
1416
|
-
|
|
1417
|
-
|
|
1415
|
+
ia,
|
|
1416
|
+
Z,
|
|
1417
|
+
ta,
|
|
1418
1418
|
ei,
|
|
1419
|
-
|
|
1420
|
-
Qi,
|
|
1419
|
+
la,
|
|
1421
1420
|
$i,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1421
|
+
ea,
|
|
1422
|
+
Q
|
|
1423
|
+
]), pa = {
|
|
1424
|
+
total: X.length,
|
|
1425
|
+
running: X.filter((e) => e.status === "RUNNING").length,
|
|
1426
|
+
stopped: X.filter((e) => e.status === "STOPPED").length
|
|
1427
1427
|
};
|
|
1428
|
-
if (
|
|
1428
|
+
if (Gt) return /* @__PURE__ */ m(Mt, {
|
|
1429
1429
|
className: "space-y-6 px-6 lg:px-8 py-6 bg-bg-canvas min-h-screen",
|
|
1430
|
-
children: /* @__PURE__ */
|
|
1430
|
+
children: /* @__PURE__ */ m(we, { message: y("sessions.loadingPermissions", "Loading permissions...") })
|
|
1431
1431
|
});
|
|
1432
|
-
if (
|
|
1432
|
+
if (Kt && Kt.permissionStrings?.length > 0 && !Qt) return /* @__PURE__ */ m(Mt, {
|
|
1433
1433
|
className: "space-y-6 px-6 lg:px-8 py-6 bg-bg-canvas min-h-screen",
|
|
1434
|
-
children: /* @__PURE__ */
|
|
1435
|
-
title:
|
|
1436
|
-
description:
|
|
1437
|
-
details:
|
|
1434
|
+
children: /* @__PURE__ */ m(Ot, {
|
|
1435
|
+
title: y("common.accessDeniedTitle", "Access Denied"),
|
|
1436
|
+
description: y("sessions.accessDeniedDescription", "You don't have permission to view sessions."),
|
|
1437
|
+
details: y("sessions.requiredPermission", "Required permission: session:list")
|
|
1438
1438
|
})
|
|
1439
1439
|
});
|
|
1440
|
-
if (Qr && !Zr &&
|
|
1440
|
+
if (Qr && !Zr && X.length === 0) return /* @__PURE__ */ m(Mt, {
|
|
1441
1441
|
className: "space-y-6 px-6 lg:px-8 py-6 bg-bg-canvas min-h-screen",
|
|
1442
|
-
children: /* @__PURE__ */
|
|
1442
|
+
children: /* @__PURE__ */ m(we, { message: y("sessions.loading", "Loading sessions...") })
|
|
1443
1443
|
});
|
|
1444
|
-
if ($r &&
|
|
1444
|
+
if ($r && X.length === 0) return /* @__PURE__ */ m(Mt, {
|
|
1445
1445
|
className: "space-y-6 px-6 lg:px-8 py-6 bg-bg-canvas min-h-screen",
|
|
1446
|
-
children: /* @__PURE__ */
|
|
1447
|
-
title:
|
|
1446
|
+
children: /* @__PURE__ */ m(Te, {
|
|
1447
|
+
title: y("sessions.failedLoad", "Failed to load sessions"),
|
|
1448
1448
|
message: $r.message,
|
|
1449
1449
|
onRetry: () => ei()
|
|
1450
1450
|
})
|
|
1451
1451
|
});
|
|
1452
|
-
let
|
|
1452
|
+
let ma = () => !Si || O === "terminal" ? null : /* @__PURE__ */ h("div", {
|
|
1453
1453
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-3 px-4 py-2.5 bg-[var(--color-accent-soft)] border border-border-subtle rounded-card",
|
|
1454
|
-
children: [/* @__PURE__ */
|
|
1454
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1455
1455
|
className: "text-sm font-medium text-text-primary",
|
|
1456
|
-
children:
|
|
1457
|
-
}), /* @__PURE__ */
|
|
1456
|
+
children: y(P.size === 1 ? "sessions.selectionCountSingle" : "sessions.selectionCountPlural", P.size === 1 ? "{{count}} session selected" : "{{count}} sessions selected", { count: P.size })
|
|
1457
|
+
}), /* @__PURE__ */ h("div", {
|
|
1458
1458
|
className: "flex items-center gap-1.5 sm:ml-auto flex-wrap",
|
|
1459
1459
|
children: [
|
|
1460
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ h("button", {
|
|
1461
1461
|
type: "button",
|
|
1462
1462
|
onClick: Ci,
|
|
1463
|
-
disabled:
|
|
1463
|
+
disabled: yn,
|
|
1464
1464
|
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-subtle rounded-button hover:bg-bg-sunken hover:border-border-strong transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
1465
1465
|
children: [
|
|
1466
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ m(vt, { className: "size-3" }),
|
|
1467
1467
|
" ",
|
|
1468
|
-
|
|
1468
|
+
y("sessions.stop", "Stop")
|
|
1469
1469
|
]
|
|
1470
1470
|
}),
|
|
1471
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ h("button", {
|
|
1472
1472
|
type: "button",
|
|
1473
1473
|
onClick: wi,
|
|
1474
|
-
disabled:
|
|
1474
|
+
disabled: yn,
|
|
1475
1475
|
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-subtle rounded-button hover:bg-bg-sunken hover:border-border-strong transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
1476
1476
|
children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ m(mt, { className: "size-3" }),
|
|
1478
1478
|
" ",
|
|
1479
|
-
|
|
1479
|
+
y("sessions.restart", "Restart")
|
|
1480
1480
|
]
|
|
1481
1481
|
}),
|
|
1482
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ h("button", {
|
|
1483
1483
|
type: "button",
|
|
1484
1484
|
onClick: Ti,
|
|
1485
|
-
disabled:
|
|
1485
|
+
disabled: yn,
|
|
1486
1486
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-status-error-text bg-status-error-bg-subtle border border-status-error-border rounded-button hover:bg-status-error-bg-subtle/80 transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
1487
1487
|
children: [
|
|
1488
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ m(bt, { className: "size-3" }),
|
|
1489
1489
|
" ",
|
|
1490
|
-
|
|
1490
|
+
y("sessions.remove", "Remove")
|
|
1491
1491
|
]
|
|
1492
1492
|
}),
|
|
1493
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ h("button", {
|
|
1494
1494
|
type: "button",
|
|
1495
1495
|
onClick: vi,
|
|
1496
1496
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
1497
1497
|
children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ m(xt, { className: "size-3" }),
|
|
1499
1499
|
" ",
|
|
1500
|
-
|
|
1500
|
+
y("sessions.deselect", "Deselect")
|
|
1501
1501
|
]
|
|
1502
1502
|
})
|
|
1503
1503
|
]
|
|
1504
1504
|
})]
|
|
1505
|
-
}),
|
|
1505
|
+
}), ha = /* @__PURE__ */ h("div", {
|
|
1506
1506
|
className: "flex items-center gap-0.5 rounded-button bg-bg-sunken p-0.5 flex-shrink-0 border border-border-subtle",
|
|
1507
1507
|
children: [
|
|
1508
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ m("button", {
|
|
1509
1509
|
type: "button",
|
|
1510
|
-
onClick: () =>
|
|
1511
|
-
className: `p-1.5 rounded ${
|
|
1512
|
-
title:
|
|
1513
|
-
"aria-label":
|
|
1514
|
-
children: /* @__PURE__ */
|
|
1510
|
+
onClick: () => k("terminal"),
|
|
1511
|
+
className: `p-1.5 rounded ${O === "terminal" ? "bg-[var(--color-accent-soft)] text-text-primary" : "text-text-secondary hover:bg-bg-surface/60"}`,
|
|
1512
|
+
title: y("sessions.terminalViewTitle", "Terminal view"),
|
|
1513
|
+
"aria-label": y("sessions.terminalViewTitle", "Terminal view"),
|
|
1514
|
+
children: /* @__PURE__ */ m(lt, { className: "size-4 text-text-secondary" })
|
|
1515
1515
|
}),
|
|
1516
|
-
/* @__PURE__ */
|
|
1516
|
+
/* @__PURE__ */ m("button", {
|
|
1517
1517
|
type: "button",
|
|
1518
|
-
onClick: () =>
|
|
1519
|
-
className: `p-1.5 rounded ${
|
|
1520
|
-
title:
|
|
1521
|
-
"aria-label":
|
|
1522
|
-
children: /* @__PURE__ */
|
|
1518
|
+
onClick: () => k("grid"),
|
|
1519
|
+
className: `p-1.5 rounded ${O === "grid" ? "bg-[var(--color-accent-soft)] text-text-primary" : "text-text-secondary hover:bg-bg-surface/60"}`,
|
|
1520
|
+
title: y("sessions.gridViewTitle", "Grid view"),
|
|
1521
|
+
"aria-label": y("sessions.gridViewTitle", "Grid view"),
|
|
1522
|
+
children: /* @__PURE__ */ m(it, { className: "size-4 text-text-secondary" })
|
|
1523
1523
|
}),
|
|
1524
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ m("button", {
|
|
1525
1525
|
type: "button",
|
|
1526
|
-
onClick: () =>
|
|
1527
|
-
className: `p-1.5 rounded ${
|
|
1528
|
-
title:
|
|
1529
|
-
"aria-label":
|
|
1530
|
-
children: /* @__PURE__ */
|
|
1526
|
+
onClick: () => k("list"),
|
|
1527
|
+
className: `p-1.5 rounded ${O === "list" ? "bg-[var(--color-accent-soft)] text-text-primary" : "text-text-secondary hover:bg-bg-surface/60"}`,
|
|
1528
|
+
title: y("sessions.listViewTitle", "List view"),
|
|
1529
|
+
"aria-label": y("sessions.listViewTitle", "List view"),
|
|
1530
|
+
children: /* @__PURE__ */ m(ct, { className: "size-4 text-text-secondary" })
|
|
1531
1531
|
})
|
|
1532
1532
|
]
|
|
1533
|
-
}),
|
|
1533
|
+
}), ga = /* @__PURE__ */ m("p", {
|
|
1534
1534
|
className: "text-xs text-text-muted",
|
|
1535
1535
|
"data-testid": "sessions-staleness-note",
|
|
1536
|
-
children:
|
|
1537
|
-
}),
|
|
1538
|
-
/* @__PURE__ */
|
|
1536
|
+
children: y("sessions.statusNotRechecked", "Session statuses are not re-checked automatically. A session whose agent has gone away can still show as running until you use Check session health.")
|
|
1537
|
+
}), _a = /* @__PURE__ */ h(Tt, { children: [
|
|
1538
|
+
/* @__PURE__ */ m(Be, {
|
|
1539
1539
|
isOpen: Gr,
|
|
1540
1540
|
onClose: () => {
|
|
1541
1541
|
qr || Kr(!1);
|
|
1542
1542
|
},
|
|
1543
1543
|
onConfirm: () => void Yr(),
|
|
1544
1544
|
isLoading: qr,
|
|
1545
|
-
message:
|
|
1545
|
+
message: y("sessions.checkHealthMessage", "This checks every running session in the whole workspace, across all agents. Any session whose agent reports it dead or cannot be reached is marked stopped.")
|
|
1546
1546
|
}),
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
sr && /* @__PURE__ */
|
|
1547
|
+
un && xa(),
|
|
1548
|
+
ba(),
|
|
1549
|
+
sr && /* @__PURE__ */ m(Ke, {
|
|
1550
1550
|
session: sr,
|
|
1551
1551
|
isOpen: !!sr,
|
|
1552
1552
|
onClose: () => cr(null)
|
|
1553
1553
|
}),
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
isOpen:
|
|
1556
|
-
onClose: () =>
|
|
1554
|
+
/* @__PURE__ */ m(me, {
|
|
1555
|
+
isOpen: mn,
|
|
1556
|
+
onClose: () => j(!1),
|
|
1557
1557
|
onConfirm: () => {
|
|
1558
|
-
|
|
1558
|
+
j(!1), v(ve);
|
|
1559
1559
|
},
|
|
1560
|
-
title:
|
|
1561
|
-
message:
|
|
1560
|
+
title: _e("session").title,
|
|
1561
|
+
message: _e("session").message,
|
|
1562
1562
|
confirmLabel: "View Billing",
|
|
1563
1563
|
cancelLabel: "Dismiss",
|
|
1564
1564
|
variant: "warning"
|
|
1565
1565
|
}),
|
|
1566
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ m(Xe, {
|
|
1567
1567
|
isOpen: er,
|
|
1568
|
-
onClose: () =>
|
|
1569
|
-
shortcuts:
|
|
1568
|
+
onClose: () => G(!1),
|
|
1569
|
+
shortcuts: ua
|
|
1570
1570
|
}),
|
|
1571
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ m(Ze, {
|
|
1572
1572
|
open: tr,
|
|
1573
1573
|
onOpenChange: nr,
|
|
1574
|
-
commands:
|
|
1574
|
+
commands: fa
|
|
1575
1575
|
}),
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
open:
|
|
1578
|
-
onOpenChange:
|
|
1576
|
+
/* @__PURE__ */ m(Qe, {
|
|
1577
|
+
open: qn,
|
|
1578
|
+
onOpenChange: R,
|
|
1579
1579
|
session: $
|
|
1580
1580
|
})
|
|
1581
1581
|
] });
|
|
1582
|
-
if (
|
|
1582
|
+
if (O === "terminal") return /* @__PURE__ */ h(Mt, {
|
|
1583
1583
|
className: "flex flex-col bg-bg-surface min-h-0 flex-1",
|
|
1584
1584
|
children: [
|
|
1585
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ h("div", {
|
|
1586
1586
|
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",
|
|
1587
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1588
1588
|
className: "flex flex-wrap items-center gap-3",
|
|
1589
1589
|
children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ m("h1", {
|
|
1591
1591
|
className: "text-sm font-semibold text-text-primary",
|
|
1592
|
-
children:
|
|
1592
|
+
children: y("nav.sessions", "Sessions")
|
|
1593
1593
|
}),
|
|
1594
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ m("span", {
|
|
1595
1595
|
className: "text-xs text-text-muted",
|
|
1596
|
-
children:
|
|
1597
|
-
running:
|
|
1598
|
-
total:
|
|
1596
|
+
children: y("sessions.runningSummary", "{{running}} running / {{total}} total", {
|
|
1597
|
+
running: pa.running,
|
|
1598
|
+
total: pa.total
|
|
1599
1599
|
})
|
|
1600
1600
|
}),
|
|
1601
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ m(Fe, {}),
|
|
1602
|
+
/* @__PURE__ */ m(he, {
|
|
1603
|
+
topic: "sessions",
|
|
1604
|
+
className: "text-xs"
|
|
1605
|
+
})
|
|
1602
1606
|
]
|
|
1603
|
-
}), /* @__PURE__ */
|
|
1607
|
+
}), /* @__PURE__ */ h("div", {
|
|
1604
1608
|
className: "flex w-full flex-wrap items-center gap-2 sm:w-auto sm:justify-end",
|
|
1605
1609
|
children: [
|
|
1606
|
-
/* @__PURE__ */
|
|
1610
|
+
/* @__PURE__ */ m("button", {
|
|
1607
1611
|
type: "button",
|
|
1608
1612
|
onClick: () => Kr(!0),
|
|
1609
1613
|
disabled: qr,
|
|
1610
1614
|
"aria-busy": qr,
|
|
1611
1615
|
"data-testid": "check-session-health-btn",
|
|
1612
1616
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
1613
|
-
title:
|
|
1614
|
-
"aria-label":
|
|
1615
|
-
children: /* @__PURE__ */
|
|
1617
|
+
title: y("sessions.checkHealth", "Check session health"),
|
|
1618
|
+
"aria-label": y("sessions.checkHealth", "Check session health"),
|
|
1619
|
+
children: /* @__PURE__ */ m(tt, { className: "size-3.5" })
|
|
1616
1620
|
}),
|
|
1617
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ m("button", {
|
|
1618
1622
|
type: "button",
|
|
1619
1623
|
onClick: () => {
|
|
1620
1624
|
ei(), ni();
|
|
1621
1625
|
},
|
|
1622
1626
|
disabled: Qr,
|
|
1623
1627
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
1624
|
-
title:
|
|
1625
|
-
children: /* @__PURE__ */
|
|
1628
|
+
title: y("common.refresh", "Refresh"),
|
|
1629
|
+
children: /* @__PURE__ */ m(pt, { className: `size-3.5 ${Qr ? "animate-spin" : ""}` })
|
|
1626
1630
|
}),
|
|
1627
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ m("button", {
|
|
1628
1632
|
type: "button",
|
|
1629
|
-
onClick: () =>
|
|
1633
|
+
onClick: () => G(!0),
|
|
1630
1634
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors",
|
|
1631
|
-
title:
|
|
1632
|
-
"aria-label":
|
|
1635
|
+
title: y("sessions.keyboardShortcuts", "Keyboard shortcuts (?)"),
|
|
1636
|
+
"aria-label": y("sessions.keyboardShortcuts", "Keyboard shortcuts (?)"),
|
|
1633
1637
|
"data-testid": "sessions-shortcuts-button",
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1638
|
+
children: /* @__PURE__ */ m(ot, { className: "size-3.5" })
|
|
1635
1639
|
}),
|
|
1636
|
-
|
|
1640
|
+
ha
|
|
1637
1641
|
]
|
|
1638
1642
|
})]
|
|
1639
1643
|
}),
|
|
1640
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ m("div", {
|
|
1641
1645
|
className: "px-4 pt-2",
|
|
1642
|
-
children:
|
|
1646
|
+
children: ga
|
|
1643
1647
|
}),
|
|
1644
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ m("div", {
|
|
1645
1649
|
className: "px-4 pt-3 empty:hidden empty:p-0",
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1650
|
+
children: /* @__PURE__ */ m(Pe, {
|
|
1647
1651
|
compact: !0,
|
|
1648
1652
|
maxVisible: 3
|
|
1649
1653
|
})
|
|
1650
1654
|
}),
|
|
1651
|
-
/* @__PURE__ */
|
|
1652
|
-
tabs:
|
|
1653
|
-
activeTabId:
|
|
1654
|
-
onTabSelect:
|
|
1655
|
+
/* @__PURE__ */ m(Ge, {
|
|
1656
|
+
tabs: V,
|
|
1657
|
+
activeTabId: U,
|
|
1658
|
+
onTabSelect: W,
|
|
1655
1659
|
onTabClose: Ri,
|
|
1656
1660
|
onOpenExternal: zi,
|
|
1657
1661
|
collapsed: !1,
|
|
1658
|
-
sessions:
|
|
1659
|
-
onOpenTerminal:
|
|
1660
|
-
onRetryTerminal:
|
|
1662
|
+
sessions: Z,
|
|
1663
|
+
onOpenTerminal: Q,
|
|
1664
|
+
onRetryTerminal: Q,
|
|
1661
1665
|
onRenameSession: Bi,
|
|
1662
1666
|
onStopTerminal: Vi,
|
|
1663
1667
|
onStopSession: (e) => {
|
|
1664
|
-
let t =
|
|
1668
|
+
let t = X.find((t) => t.id === e);
|
|
1665
1669
|
t && Ni(t);
|
|
1666
1670
|
},
|
|
1667
1671
|
onRestartTerminal: Hi,
|
|
@@ -1671,161 +1675,161 @@ function Bt() {
|
|
|
1671
1675
|
onShowSessionInfo: Ki,
|
|
1672
1676
|
onViewAgent: qi,
|
|
1673
1677
|
onViewTarget: Ji,
|
|
1674
|
-
onShareSession:
|
|
1678
|
+
onShareSession: en ? Yi : void 0,
|
|
1675
1679
|
onCreateSession: Oi,
|
|
1676
|
-
onQuickCreate:
|
|
1680
|
+
onQuickCreate: $t ? ji : void 0,
|
|
1677
1681
|
renameActiveTabNonce: ar,
|
|
1678
1682
|
fullScreen: !0,
|
|
1679
1683
|
isImmersiveFullscreen: lr,
|
|
1680
|
-
onToggleImmersiveFullscreen:
|
|
1684
|
+
onToggleImmersiveFullscreen: Xi,
|
|
1681
1685
|
contextSwitcher: void 0
|
|
1682
1686
|
}),
|
|
1683
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ h("div", {
|
|
1684
1688
|
className: "flex items-center justify-between gap-3 px-4 py-1.5 border-t border-border-default bg-bg-sunken text-[11px] text-text-tertiary",
|
|
1685
|
-
children: [/* @__PURE__ */
|
|
1689
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1686
1690
|
className: "flex items-center gap-3",
|
|
1687
1691
|
children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ h("span", {
|
|
1689
1693
|
className: "inline-flex items-center gap-1.5",
|
|
1690
|
-
children: [/* @__PURE__ */
|
|
1694
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1691
1695
|
className: "size-1.5 rounded-full bg-status-success-bg",
|
|
1692
1696
|
"aria-hidden": !0
|
|
1693
|
-
}),
|
|
1697
|
+
}), y("sessions.statusOnline", "Online")]
|
|
1694
1698
|
}),
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
|
|
1699
|
+
/* @__PURE__ */ h("span", { children: [
|
|
1700
|
+
V.length,
|
|
1697
1701
|
" ",
|
|
1698
|
-
|
|
1702
|
+
V.length === 1 ? "tab" : "tabs"
|
|
1699
1703
|
] }),
|
|
1700
|
-
|
|
1704
|
+
U && /* @__PURE__ */ m("span", {
|
|
1701
1705
|
className: "truncate max-w-[28ch]",
|
|
1702
|
-
children:
|
|
1706
|
+
children: V.find((e) => e.sessionId === U)?.name
|
|
1703
1707
|
}),
|
|
1704
|
-
$?.agent && /* @__PURE__ */
|
|
1708
|
+
$?.agent && /* @__PURE__ */ h("span", {
|
|
1705
1709
|
className: "hidden md:inline-flex items-center gap-1",
|
|
1706
1710
|
children: [
|
|
1707
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ m("span", {
|
|
1708
1712
|
className: "text-text-muted",
|
|
1709
1713
|
children: "·"
|
|
1710
1714
|
}),
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
$.agent.target && /* @__PURE__ */
|
|
1715
|
+
/* @__PURE__ */ m(Ve, { agent: $.agent }),
|
|
1716
|
+
$.agent.target && /* @__PURE__ */ m(He, { target: $.agent.target })
|
|
1713
1717
|
]
|
|
1714
1718
|
})
|
|
1715
1719
|
]
|
|
1716
|
-
}), /* @__PURE__ */
|
|
1720
|
+
}), /* @__PURE__ */ h("div", {
|
|
1717
1721
|
className: "hidden sm:flex items-center gap-3",
|
|
1718
1722
|
children: [
|
|
1719
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ h("button", {
|
|
1720
1724
|
type: "button",
|
|
1721
|
-
onClick: () =>
|
|
1725
|
+
onClick: () => R(!qn),
|
|
1722
1726
|
className: "inline-flex items-center gap-1 hover:text-text-secondary transition-colors",
|
|
1723
|
-
title:
|
|
1724
|
-
children: [/* @__PURE__ */
|
|
1727
|
+
title: y("sessions.infoPanelHint", "Session info (i)"),
|
|
1728
|
+
children: [/* @__PURE__ */ m(at, { className: "size-3" }), y("sessions.infoPanelLabel", "Info")]
|
|
1725
1729
|
}),
|
|
1726
|
-
$ && /* @__PURE__ */
|
|
1730
|
+
$ && /* @__PURE__ */ m(ze, {
|
|
1727
1731
|
entity: "session",
|
|
1728
1732
|
resource: {
|
|
1729
1733
|
id: $.id,
|
|
1730
1734
|
name: $.name,
|
|
1731
1735
|
vibeId: $.vibeId ?? null
|
|
1732
1736
|
},
|
|
1733
|
-
label:
|
|
1737
|
+
label: y("sessions.shareOfferLabel", "Share"),
|
|
1734
1738
|
variant: "button"
|
|
1735
1739
|
}),
|
|
1736
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ h("button", {
|
|
1737
1741
|
type: "button",
|
|
1738
|
-
onClick: () =>
|
|
1742
|
+
onClick: () => G(!0),
|
|
1739
1743
|
className: "inline-flex items-center gap-1 hover:text-text-secondary transition-colors",
|
|
1740
|
-
children: [/* @__PURE__ */
|
|
1744
|
+
children: [/* @__PURE__ */ m(ot, { className: "size-3" }), y("sessions.shortcutsHint", "Press ? for shortcuts")]
|
|
1741
1745
|
}),
|
|
1742
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ m("button", {
|
|
1743
1747
|
type: "button",
|
|
1744
|
-
onClick:
|
|
1748
|
+
onClick: ca,
|
|
1745
1749
|
className: "hover:text-text-secondary transition-colors",
|
|
1746
|
-
children:
|
|
1750
|
+
children: y("sessions.paletteHint", "⌘/Ctrl K · Command palette")
|
|
1747
1751
|
})
|
|
1748
1752
|
]
|
|
1749
1753
|
})]
|
|
1750
1754
|
}),
|
|
1751
|
-
|
|
1755
|
+
vn && /* @__PURE__ */ m("div", {
|
|
1752
1756
|
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg-subtle text-status-success-text border border-status-success-border rounded-card shadow-elevation-3 text-sm",
|
|
1753
|
-
children:
|
|
1757
|
+
children: vn
|
|
1754
1758
|
}),
|
|
1755
|
-
|
|
1759
|
+
_a
|
|
1756
1760
|
]
|
|
1757
1761
|
});
|
|
1758
|
-
let
|
|
1762
|
+
let va = (e) => /* @__PURE__ */ m(jt, {
|
|
1759
1763
|
stagger: .04,
|
|
1760
1764
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
1761
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1765
|
+
children: e.map((e) => /* @__PURE__ */ m(At, { children: /* @__PURE__ */ m(Ue, {
|
|
1762
1766
|
session: e,
|
|
1763
1767
|
onOpen: Di,
|
|
1764
1768
|
onStart: Mi,
|
|
1765
1769
|
onStop: Ni,
|
|
1766
1770
|
onRestart: Pi,
|
|
1767
|
-
onOpenTerminal:
|
|
1768
|
-
onShare:
|
|
1769
|
-
selected:
|
|
1771
|
+
onOpenTerminal: Q,
|
|
1772
|
+
onShare: en ? Li : void 0,
|
|
1773
|
+
selected: P.has(e.id),
|
|
1770
1774
|
onToggleSelect: () => gi(e.id)
|
|
1771
1775
|
}) }, e.id))
|
|
1772
|
-
}),
|
|
1776
|
+
}), ya = (e, t) => /* @__PURE__ */ m(We, {
|
|
1773
1777
|
sessions: e,
|
|
1774
1778
|
onOpen: Di,
|
|
1775
1779
|
onStart: Mi,
|
|
1776
1780
|
onStop: Ni,
|
|
1777
1781
|
onRestart: Pi,
|
|
1778
1782
|
onTerminate: Fi,
|
|
1779
|
-
onOpenTerminal:
|
|
1780
|
-
onShare:
|
|
1781
|
-
selectedIds:
|
|
1783
|
+
onOpenTerminal: Q,
|
|
1784
|
+
onShare: en ? Li : void 0,
|
|
1785
|
+
selectedIds: P,
|
|
1782
1786
|
onToggleSelect: gi,
|
|
1783
1787
|
onSelectAll: _i,
|
|
1784
1788
|
onDeselectAll: vi,
|
|
1785
1789
|
hideHeaderSelectAll: t
|
|
1786
1790
|
});
|
|
1787
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ h(Mt, {
|
|
1788
1792
|
className: "flex flex-col bg-bg-surface min-h-0 flex-1",
|
|
1789
1793
|
children: [
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
ref:
|
|
1794
|
+
/* @__PURE__ */ h("div", {
|
|
1795
|
+
ref: Cn,
|
|
1792
1796
|
className: "flex-1 overflow-y-auto space-y-6 p-4 sm:p-6",
|
|
1793
1797
|
children: [
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
title:
|
|
1796
|
-
description:
|
|
1797
|
-
running:
|
|
1798
|
-
total:
|
|
1798
|
+
/* @__PURE__ */ m(Ce, {
|
|
1799
|
+
title: y("nav.sessions", "Sessions"),
|
|
1800
|
+
description: y("sessions.pageDescription", "{{running}} of {{total}} sessions running", {
|
|
1801
|
+
running: pa.running,
|
|
1802
|
+
total: pa.total
|
|
1799
1803
|
}),
|
|
1800
|
-
actions: /* @__PURE__ */
|
|
1804
|
+
actions: /* @__PURE__ */ h("div", {
|
|
1801
1805
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
1802
1806
|
children: [
|
|
1803
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ m("div", {
|
|
1804
1808
|
className: "flex items-center self-center",
|
|
1805
|
-
children: /* @__PURE__ */
|
|
1809
|
+
children: /* @__PURE__ */ m(Fe, {})
|
|
1806
1810
|
}),
|
|
1807
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ m("button", {
|
|
1808
1812
|
type: "button",
|
|
1809
1813
|
onClick: () => Kr(!0),
|
|
1810
1814
|
disabled: qr,
|
|
1811
1815
|
"aria-busy": qr,
|
|
1812
1816
|
"data-testid": "check-session-health-btn",
|
|
1813
1817
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1814
|
-
title:
|
|
1815
|
-
"aria-label":
|
|
1816
|
-
children: /* @__PURE__ */
|
|
1818
|
+
title: y("sessions.checkHealth", "Check session health"),
|
|
1819
|
+
"aria-label": y("sessions.checkHealth", "Check session health"),
|
|
1820
|
+
children: /* @__PURE__ */ m(tt, { className: "size-4" })
|
|
1817
1821
|
}),
|
|
1818
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ m("button", {
|
|
1819
1823
|
type: "button",
|
|
1820
1824
|
onClick: () => ei(),
|
|
1821
1825
|
disabled: Qr,
|
|
1822
1826
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1823
|
-
title:
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1827
|
+
title: y("sessions.refreshTitle", "Refresh sessions"),
|
|
1828
|
+
children: /* @__PURE__ */ m(pt, { className: `size-4 ${Qr ? "animate-spin" : ""}` })
|
|
1825
1829
|
}),
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
label:
|
|
1828
|
-
disabled:
|
|
1830
|
+
/* @__PURE__ */ m(zt, {
|
|
1831
|
+
label: y("sessions.export", "Export"),
|
|
1832
|
+
disabled: bn,
|
|
1829
1833
|
testId: "sessions-export",
|
|
1830
1834
|
defaultFolderPath: "/Vibecontrols/Sessions",
|
|
1831
1835
|
source: {
|
|
@@ -1835,10 +1839,10 @@ function Bt() {
|
|
|
1835
1839
|
getBlob: async () => {
|
|
1836
1840
|
let e = (await Hr({ variables: { input: {
|
|
1837
1841
|
filter: {
|
|
1838
|
-
status:
|
|
1839
|
-
type:
|
|
1840
|
-
vibeId:
|
|
1841
|
-
agentId:
|
|
1842
|
+
status: x === "all" ? void 0 : x,
|
|
1843
|
+
type: S === "all" ? void 0 : S,
|
|
1844
|
+
vibeId: C !== "all" && C !== "none" ? C : void 0,
|
|
1845
|
+
agentId: w === "all" ? void 0 : w
|
|
1842
1846
|
},
|
|
1843
1847
|
format: "CSV"
|
|
1844
1848
|
} } })).data?.exportSessions;
|
|
@@ -1847,278 +1851,278 @@ function Bt() {
|
|
|
1847
1851
|
},
|
|
1848
1852
|
onDownload: () => Ei("CSV")
|
|
1849
1853
|
}),
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
permission:
|
|
1852
|
-
children: /* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ m(kt, {
|
|
1855
|
+
permission: Re.SESSION_CREATE,
|
|
1856
|
+
children: /* @__PURE__ */ h("button", {
|
|
1853
1857
|
type: "button",
|
|
1854
1858
|
onClick: () => br(!0),
|
|
1855
1859
|
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",
|
|
1856
1860
|
"data-testid": "sessions-reconnect-button",
|
|
1857
|
-
title:
|
|
1858
|
-
children: [/* @__PURE__ */
|
|
1861
|
+
title: y("sessions.reconnectTooltip", "Reconnect orphan tmux/wezterm/zellij sessions left over from a previous agent run"),
|
|
1862
|
+
children: [/* @__PURE__ */ m(pt, { className: "size-4" }), y("sessions.reconnect", "Reconnect")]
|
|
1859
1863
|
})
|
|
1860
1864
|
}),
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
permission:
|
|
1863
|
-
children: /* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ m(kt, {
|
|
1866
|
+
permission: Re.SESSION_CREATE,
|
|
1867
|
+
children: /* @__PURE__ */ h("div", {
|
|
1864
1868
|
className: "relative flex items-stretch",
|
|
1865
|
-
ref:
|
|
1869
|
+
ref: pn,
|
|
1866
1870
|
children: [
|
|
1867
|
-
/* @__PURE__ */
|
|
1871
|
+
/* @__PURE__ */ h("button", {
|
|
1868
1872
|
type: "button",
|
|
1869
1873
|
onClick: ji,
|
|
1870
1874
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-l-md hover:bg-action-primary-bg-hover transition-colors",
|
|
1871
|
-
title:
|
|
1875
|
+
title: y("sessions.quickNewSessionHint", "New terminal (⌘/Ctrl+T)"),
|
|
1872
1876
|
"data-testid": "sessions-new-session",
|
|
1873
|
-
children: [/* @__PURE__ */
|
|
1877
|
+
children: [/* @__PURE__ */ m(ft, { className: "size-4" }), y("sessions.newSession", "New Session")]
|
|
1874
1878
|
}),
|
|
1875
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ m("button", {
|
|
1876
1880
|
type: "button",
|
|
1877
|
-
onClick: () =>
|
|
1881
|
+
onClick: () => fn((e) => !e),
|
|
1878
1882
|
className: "flex items-center px-2 bg-action-primary-bg text-action-primary-text rounded-r-md border-l border-action-primary-text/20 hover:bg-action-primary-bg-hover transition-colors",
|
|
1879
1883
|
"aria-haspopup": "menu",
|
|
1880
|
-
"aria-expanded":
|
|
1881
|
-
title:
|
|
1884
|
+
"aria-expanded": dn,
|
|
1885
|
+
title: y("sessions.newSessionOptions", "New session options"),
|
|
1882
1886
|
"data-testid": "sessions-new-session-menu",
|
|
1883
|
-
children: /* @__PURE__ */
|
|
1887
|
+
children: /* @__PURE__ */ m(rt, { className: "size-4" })
|
|
1884
1888
|
}),
|
|
1885
|
-
|
|
1889
|
+
dn && /* @__PURE__ */ h("div", {
|
|
1886
1890
|
role: "menu",
|
|
1887
1891
|
className: "absolute right-0 top-full mt-1 z-50 w-64 bg-bg-elevated border border-border-default rounded-md shadow-xl py-1",
|
|
1888
|
-
children: [/* @__PURE__ */
|
|
1892
|
+
children: [/* @__PURE__ */ h("button", {
|
|
1889
1893
|
type: "button",
|
|
1890
1894
|
role: "menuitem",
|
|
1891
1895
|
onClick: () => {
|
|
1892
|
-
|
|
1896
|
+
fn(!1), Oi();
|
|
1893
1897
|
},
|
|
1894
1898
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left",
|
|
1895
|
-
children: [/* @__PURE__ */
|
|
1896
|
-
}), /* @__PURE__ */
|
|
1899
|
+
children: [/* @__PURE__ */ m(_t, { className: "size-3.5 text-text-secondary" }), y("sessions.newSessionWithOptions", "New session with options…")]
|
|
1900
|
+
}), /* @__PURE__ */ h("button", {
|
|
1897
1901
|
type: "button",
|
|
1898
1902
|
role: "menuitem",
|
|
1899
1903
|
onClick: () => {
|
|
1900
|
-
|
|
1904
|
+
fn(!1), br(!0);
|
|
1901
1905
|
},
|
|
1902
1906
|
className: "flex items-center gap-2 w-full px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors text-left",
|
|
1903
|
-
children: [/* @__PURE__ */
|
|
1907
|
+
children: [/* @__PURE__ */ m(pt, { className: "size-3.5 text-text-secondary" }), y("sessions.reconnectExisting", "Reconnect existing session…")]
|
|
1904
1908
|
})]
|
|
1905
1909
|
})
|
|
1906
1910
|
]
|
|
1907
1911
|
})
|
|
1908
1912
|
}),
|
|
1909
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ m("button", {
|
|
1910
1914
|
type: "button",
|
|
1911
|
-
onClick: () =>
|
|
1915
|
+
onClick: () => G(!0),
|
|
1912
1916
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1913
|
-
title:
|
|
1914
|
-
"aria-label":
|
|
1917
|
+
title: y("sessions.keyboardShortcuts", "Keyboard shortcuts (?)"),
|
|
1918
|
+
"aria-label": y("sessions.keyboardShortcuts", "Keyboard shortcuts (?)"),
|
|
1915
1919
|
"data-testid": "sessions-shortcuts-button",
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1920
|
+
children: /* @__PURE__ */ m(ot, { className: "size-4" })
|
|
1917
1921
|
}),
|
|
1918
|
-
|
|
1922
|
+
ha
|
|
1919
1923
|
]
|
|
1920
1924
|
})
|
|
1921
1925
|
}),
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
icon: /* @__PURE__ */
|
|
1924
|
-
learnMoreHref:
|
|
1925
|
-
learnMoreLabel:
|
|
1926
|
-
children:
|
|
1926
|
+
/* @__PURE__ */ m(Dt, {
|
|
1927
|
+
icon: /* @__PURE__ */ m(yt, { className: "size-4" }),
|
|
1928
|
+
learnMoreHref: Yt,
|
|
1929
|
+
learnMoreLabel: y("vibecontrols.docs.learnMore", "Learn more"),
|
|
1930
|
+
children: y("sessions.purpose", "Sessions are the live terminals and tasks running on your agents. Open a session to get a real shell (or an AI task) executing on your own machine through a vibe — watch its output stream in, share a read-only link, or review the logs afterwards. This page lists every session across your vibes so you can jump back into work or see what is still running.")
|
|
1927
1931
|
}),
|
|
1928
|
-
|
|
1929
|
-
/* @__PURE__ */
|
|
1932
|
+
ga,
|
|
1933
|
+
/* @__PURE__ */ m(Pe, {
|
|
1930
1934
|
compact: !0,
|
|
1931
1935
|
maxVisible: 3
|
|
1932
1936
|
}),
|
|
1933
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ h("div", {
|
|
1934
1938
|
"data-tour": "sessions-filters",
|
|
1935
1939
|
className: "space-y-3",
|
|
1936
|
-
children: [/* @__PURE__ */
|
|
1937
|
-
ref:
|
|
1940
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1941
|
+
ref: Sn,
|
|
1938
1942
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
1939
|
-
children: /* @__PURE__ */
|
|
1940
|
-
value:
|
|
1941
|
-
onChange:
|
|
1942
|
-
placeholder:
|
|
1943
|
+
children: /* @__PURE__ */ m(ke, {
|
|
1944
|
+
value: b,
|
|
1945
|
+
onChange: tn,
|
|
1946
|
+
placeholder: y("sessions.searchPlaceholder", "Search sessions..."),
|
|
1943
1947
|
className: "flex-1 sm:w-64 sm:flex-none"
|
|
1944
1948
|
})
|
|
1945
|
-
}), /* @__PURE__ */
|
|
1949
|
+
}), /* @__PURE__ */ h("div", {
|
|
1946
1950
|
className: "flex items-center gap-2 sm:gap-3 flex-wrap",
|
|
1947
1951
|
children: [
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
label:
|
|
1950
|
-
value:
|
|
1951
|
-
options:
|
|
1952
|
-
onChange:
|
|
1952
|
+
/* @__PURE__ */ m(Ae, {
|
|
1953
|
+
label: y("sessions.filterStatus", "Status"),
|
|
1954
|
+
value: x,
|
|
1955
|
+
options: Xt,
|
|
1956
|
+
onChange: nn
|
|
1953
1957
|
}),
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
label:
|
|
1956
|
-
value:
|
|
1957
|
-
options:
|
|
1958
|
-
onChange:
|
|
1958
|
+
/* @__PURE__ */ m(Ae, {
|
|
1959
|
+
label: y("sessions.filterType", "Type"),
|
|
1960
|
+
value: S,
|
|
1961
|
+
options: Zt,
|
|
1962
|
+
onChange: rn
|
|
1959
1963
|
}),
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
label:
|
|
1962
|
-
value:
|
|
1964
|
+
/* @__PURE__ */ m(Ae, {
|
|
1965
|
+
label: y("sessions.filterVibe", "Vibe"),
|
|
1966
|
+
value: C,
|
|
1963
1967
|
options: oi,
|
|
1964
|
-
onChange:
|
|
1968
|
+
onChange: an
|
|
1965
1969
|
}),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
label:
|
|
1968
|
-
value:
|
|
1970
|
+
/* @__PURE__ */ m(Ae, {
|
|
1971
|
+
label: y("sessions.filterAgent", "Agent"),
|
|
1972
|
+
value: w,
|
|
1969
1973
|
options: si,
|
|
1970
|
-
onChange:
|
|
1974
|
+
onChange: on
|
|
1971
1975
|
}),
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
label:
|
|
1974
|
-
value:
|
|
1976
|
+
/* @__PURE__ */ m(Ae, {
|
|
1977
|
+
label: y("sessions.filterTarget", "Target"),
|
|
1978
|
+
value: T,
|
|
1975
1979
|
options: mi,
|
|
1976
|
-
onChange:
|
|
1977
|
-
icon: /* @__PURE__ */
|
|
1980
|
+
onChange: sn,
|
|
1981
|
+
icon: /* @__PURE__ */ m(ut, { className: "size-3.5 text-text-secondary" })
|
|
1978
1982
|
}),
|
|
1979
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ m("div", {
|
|
1980
1984
|
className: "sm:ml-auto",
|
|
1981
|
-
children: /* @__PURE__ */
|
|
1982
|
-
label:
|
|
1983
|
-
value:
|
|
1985
|
+
children: /* @__PURE__ */ m(Ae, {
|
|
1986
|
+
label: y("sessions.groupByLabel", "Group"),
|
|
1987
|
+
value: E,
|
|
1984
1988
|
options: ci,
|
|
1985
|
-
onChange: (e) =>
|
|
1989
|
+
onChange: (e) => D(e),
|
|
1986
1990
|
allValue: "none",
|
|
1987
|
-
allLabel:
|
|
1988
|
-
icon: /* @__PURE__ */
|
|
1991
|
+
allLabel: y("sessions.groupBy.none", "No grouping"),
|
|
1992
|
+
icon: /* @__PURE__ */ m(st, { className: "size-3.5 text-text-secondary" })
|
|
1989
1993
|
})
|
|
1990
1994
|
})
|
|
1991
1995
|
]
|
|
1992
1996
|
})]
|
|
1993
1997
|
}),
|
|
1994
|
-
/* @__PURE__ */
|
|
1998
|
+
/* @__PURE__ */ h("div", {
|
|
1995
1999
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-wrap",
|
|
1996
2000
|
children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ h("button", {
|
|
1998
2002
|
type: "button",
|
|
1999
|
-
onClick: () =>
|
|
2000
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
2003
|
+
onClick: () => nn("RUNNING"),
|
|
2004
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${x === "RUNNING" ? "bg-status-success-bg text-status-success-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
2001
2005
|
children: [
|
|
2002
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ m(dt, { className: "size-3" }),
|
|
2003
2007
|
" ",
|
|
2004
|
-
|
|
2008
|
+
y("sessions.running", "Running"),
|
|
2005
2009
|
" (",
|
|
2006
|
-
|
|
2010
|
+
pa.running,
|
|
2007
2011
|
")"
|
|
2008
2012
|
]
|
|
2009
2013
|
}),
|
|
2010
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ h("button", {
|
|
2011
2015
|
type: "button",
|
|
2012
|
-
onClick: () =>
|
|
2013
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
2016
|
+
onClick: () => nn("STOPPED"),
|
|
2017
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${x === "STOPPED" ? "bg-bg-sunken text-text-secondary" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
2014
2018
|
children: [
|
|
2015
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ m(vt, { className: "size-3" }),
|
|
2016
2020
|
" ",
|
|
2017
|
-
|
|
2021
|
+
y("sessions.stoppedState", "Stopped"),
|
|
2018
2022
|
" (",
|
|
2019
|
-
|
|
2023
|
+
pa.stopped,
|
|
2020
2024
|
")"
|
|
2021
2025
|
]
|
|
2022
2026
|
}),
|
|
2023
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ m("div", {
|
|
2024
2028
|
className: "sm:ml-auto flex items-center gap-2",
|
|
2025
|
-
children:
|
|
2029
|
+
children: Z.length > 0 && /* @__PURE__ */ h("button", {
|
|
2026
2030
|
type: "button",
|
|
2027
2031
|
onClick: xi ? vi : _i,
|
|
2028
2032
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
2029
|
-
children: [/* @__PURE__ */
|
|
2033
|
+
children: [/* @__PURE__ */ m(nt, { className: "size-3.5" }), xi ? y("sessions.deselectAll", "Deselect All") : y("sessions.selectAll", "Select All")]
|
|
2030
2034
|
})
|
|
2031
2035
|
})
|
|
2032
2036
|
]
|
|
2033
2037
|
}),
|
|
2034
|
-
|
|
2035
|
-
|
|
2038
|
+
ma(),
|
|
2039
|
+
b || x !== "all" || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? /* @__PURE__ */ h("p", {
|
|
2036
2040
|
className: "text-sm text-text-secondary",
|
|
2037
2041
|
children: [
|
|
2038
|
-
|
|
2042
|
+
y("sessions.showing", "Showing"),
|
|
2039
2043
|
" ",
|
|
2040
|
-
|
|
2044
|
+
Z.length,
|
|
2041
2045
|
" ",
|
|
2042
|
-
|
|
2046
|
+
y("sessions.of", "of"),
|
|
2043
2047
|
" ",
|
|
2044
|
-
|
|
2048
|
+
X.length,
|
|
2045
2049
|
" ",
|
|
2046
|
-
|
|
2047
|
-
Qr && /* @__PURE__ */
|
|
2050
|
+
y("nav.sessions", "sessions"),
|
|
2051
|
+
Qr && /* @__PURE__ */ h("span", {
|
|
2048
2052
|
className: "ml-2 text-text-muted",
|
|
2049
2053
|
children: [
|
|
2050
2054
|
"(",
|
|
2051
|
-
|
|
2055
|
+
y("sessions.refreshing", "refreshing..."),
|
|
2052
2056
|
")"
|
|
2053
2057
|
]
|
|
2054
2058
|
})
|
|
2055
2059
|
]
|
|
2056
2060
|
}) : null,
|
|
2057
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ m(wt, {
|
|
2058
2062
|
mode: "wait",
|
|
2059
|
-
children:
|
|
2063
|
+
children: Z.length > 0 ? E === "none" ? O === "grid" ? /* @__PURE__ */ m("div", { children: va(Z) }, "grid-view") : /* @__PURE__ */ m(At, { children: ya(Z, !1) }, "list-view") : /* @__PURE__ */ m("div", {
|
|
2060
2064
|
className: "space-y-3",
|
|
2061
2065
|
"data-testid": "sessions-grouped",
|
|
2062
2066
|
children: hi.map((e) => {
|
|
2063
|
-
let t = e.sessions.map((e) => e.id), n = t.length > 0 && t.every((e) =>
|
|
2064
|
-
return /* @__PURE__ */
|
|
2067
|
+
let t = e.sessions.map((e) => e.id), n = t.length > 0 && t.every((e) => P.has(e)), r = t.some((e) => P.has(e));
|
|
2068
|
+
return /* @__PURE__ */ m(qe, {
|
|
2065
2069
|
label: e.label,
|
|
2066
2070
|
count: e.sessions.length,
|
|
2067
|
-
collapsed:
|
|
2071
|
+
collapsed: cn.has(e.key),
|
|
2068
2072
|
onToggleCollapse: () => bi(e.key),
|
|
2069
2073
|
allSelected: n,
|
|
2070
2074
|
someSelected: r,
|
|
2071
2075
|
onToggleSelectGroup: () => yi(t),
|
|
2072
|
-
children:
|
|
2076
|
+
children: O === "grid" ? va(e.sessions) : ya(e.sessions, !0)
|
|
2073
2077
|
}, e.key);
|
|
2074
2078
|
})
|
|
2075
|
-
}, "grouped-view") : /* @__PURE__ */
|
|
2079
|
+
}, "grouped-view") : /* @__PURE__ */ h("div", {
|
|
2076
2080
|
className: "space-y-4",
|
|
2077
|
-
children: [/* @__PURE__ */
|
|
2081
|
+
children: [/* @__PURE__ */ m(je, {
|
|
2078
2082
|
variant: "compact",
|
|
2079
2083
|
dismissKey: "vibecontrols-sessions-setup-banner"
|
|
2080
|
-
}), /* @__PURE__ */
|
|
2081
|
-
icon: /* @__PURE__ */
|
|
2082
|
-
illustration:
|
|
2083
|
-
title:
|
|
2084
|
-
description:
|
|
2085
|
-
action: !
|
|
2084
|
+
}), /* @__PURE__ */ m(Oe, {
|
|
2085
|
+
icon: /* @__PURE__ */ m(yt, { className: "size-8 text-text-secondary" }),
|
|
2086
|
+
illustration: b || x !== "all" || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? "empty-search" : "empty-sessions",
|
|
2087
|
+
title: b || x !== "all" || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? y("sessions.emptyFound", "No sessions found") : y("sessions.emptyConfigured", "No sessions configured"),
|
|
2088
|
+
description: b || x !== "all" || S !== "all" || C !== "all" || w !== "all" || T !== "all" ? y("sessions.emptyAdjustSearch", "Try adjusting your search or filters") : y("sessions.emptyDescription", "Sessions require an active agent. Install the CLI agent first, then start a session."),
|
|
2089
|
+
action: !b && x === "all" && S === "all" && C === "all" && w === "all" && T === "all" ? /* @__PURE__ */ h("div", {
|
|
2086
2090
|
className: "flex items-center gap-2",
|
|
2087
|
-
children: [
|
|
2091
|
+
children: [$t && /* @__PURE__ */ h("button", {
|
|
2088
2092
|
type: "button",
|
|
2089
2093
|
onClick: ji,
|
|
2090
2094
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2091
2095
|
children: [
|
|
2092
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ m(ft, { className: "size-4" }),
|
|
2093
2097
|
" ",
|
|
2094
|
-
|
|
2098
|
+
y("sessions.newSession", "New Session")
|
|
2095
2099
|
]
|
|
2096
|
-
}), /* @__PURE__ */
|
|
2100
|
+
}), /* @__PURE__ */ m(Me, { prompt: "What is a Session in VibeControls and how do I start one?" })]
|
|
2097
2101
|
}) : void 0
|
|
2098
2102
|
})]
|
|
2099
2103
|
})
|
|
2100
2104
|
}),
|
|
2101
|
-
|
|
2105
|
+
vn && /* @__PURE__ */ m("div", {
|
|
2102
2106
|
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg-subtle text-status-success-text border border-status-success-border rounded-card shadow-elevation-3 text-sm",
|
|
2103
|
-
children:
|
|
2107
|
+
children: vn
|
|
2104
2108
|
})
|
|
2105
2109
|
]
|
|
2106
2110
|
}),
|
|
2107
|
-
|
|
2108
|
-
tabs:
|
|
2109
|
-
activeTabId:
|
|
2110
|
-
onTabSelect:
|
|
2111
|
+
V.length > 0 && /* @__PURE__ */ m(Ge, {
|
|
2112
|
+
tabs: V,
|
|
2113
|
+
activeTabId: U,
|
|
2114
|
+
onTabSelect: oa,
|
|
2111
2115
|
onTabClose: Ri,
|
|
2112
2116
|
onOpenExternal: zi,
|
|
2113
2117
|
onToggleCollapse: () => ir((e) => !e),
|
|
2114
2118
|
collapsed: rr,
|
|
2115
|
-
sessions:
|
|
2116
|
-
onOpenTerminal:
|
|
2117
|
-
onRetryTerminal:
|
|
2119
|
+
sessions: Z,
|
|
2120
|
+
onOpenTerminal: Q,
|
|
2121
|
+
onRetryTerminal: Q,
|
|
2118
2122
|
onRenameSession: Bi,
|
|
2119
2123
|
onStopTerminal: Vi,
|
|
2120
2124
|
onStopSession: (e) => {
|
|
2121
|
-
let t =
|
|
2125
|
+
let t = X.find((t) => t.id === e);
|
|
2122
2126
|
t && Ni(t);
|
|
2123
2127
|
},
|
|
2124
2128
|
onRestartTerminal: Hi,
|
|
@@ -2128,74 +2132,74 @@ function Bt() {
|
|
|
2128
2132
|
onShowSessionInfo: Ki,
|
|
2129
2133
|
onViewAgent: qi,
|
|
2130
2134
|
onViewTarget: Ji,
|
|
2131
|
-
onShareSession:
|
|
2132
|
-
onCreateSession:
|
|
2133
|
-
onQuickCreate:
|
|
2135
|
+
onShareSession: en ? Yi : void 0,
|
|
2136
|
+
onCreateSession: $t ? Oi : void 0,
|
|
2137
|
+
onQuickCreate: $t ? ji : void 0,
|
|
2134
2138
|
renameActiveTabNonce: ar,
|
|
2135
2139
|
heightClass: "h-[280px] sm:h-[380px]",
|
|
2136
2140
|
isImmersiveFullscreen: lr,
|
|
2137
|
-
onToggleImmersiveFullscreen:
|
|
2141
|
+
onToggleImmersiveFullscreen: Xi,
|
|
2138
2142
|
contextSwitcher: void 0
|
|
2139
2143
|
}),
|
|
2140
|
-
|
|
2144
|
+
_a
|
|
2141
2145
|
]
|
|
2142
2146
|
});
|
|
2143
|
-
function
|
|
2147
|
+
function ba() {
|
|
2144
2148
|
if (!yr) return null;
|
|
2145
2149
|
let e = Or?.agentSessionOrphans ?? [];
|
|
2146
|
-
return /* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ m("div", {
|
|
2147
2151
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
2148
2152
|
"data-testid": "sessions-reconnect-modal",
|
|
2149
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ h("div", {
|
|
2150
2154
|
className: "bg-bg-surface rounded-card border border-border-subtle shadow-[var(--shadow-elevation-4)] p-6 w-full max-w-2xl max-h-[80vh] overflow-y-auto",
|
|
2151
2155
|
children: [
|
|
2152
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ m("h2", {
|
|
2153
2157
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
2154
|
-
children:
|
|
2158
|
+
children: y("sessions.reconnectTitle", "Reconnect orphan sessions")
|
|
2155
2159
|
}),
|
|
2156
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ m("p", {
|
|
2157
2161
|
className: "text-sm text-text-secondary mb-4",
|
|
2158
|
-
children:
|
|
2162
|
+
children: y("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.")
|
|
2159
2163
|
}),
|
|
2160
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ h("div", {
|
|
2161
2165
|
className: "space-y-4",
|
|
2162
2166
|
children: [
|
|
2163
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
2164
2168
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2165
|
-
children:
|
|
2166
|
-
}), /* @__PURE__ */
|
|
2169
|
+
children: y("sessions.agent", "Agent")
|
|
2170
|
+
}), /* @__PURE__ */ m(Ne, {
|
|
2167
2171
|
options: ui,
|
|
2168
2172
|
value: xr,
|
|
2169
2173
|
onChange: (e) => {
|
|
2170
2174
|
Sr(e), wr(null), e && Dr({ variables: { agentId: e } });
|
|
2171
2175
|
},
|
|
2172
|
-
placeholder:
|
|
2173
|
-
searchPlaceholder:
|
|
2176
|
+
placeholder: y("sessions.selectAgent", "Select an agent"),
|
|
2177
|
+
searchPlaceholder: y("sessions.searchAgents", "Search agents..."),
|
|
2174
2178
|
clearable: !0
|
|
2175
2179
|
})] }),
|
|
2176
|
-
Cr && /* @__PURE__ */
|
|
2180
|
+
Cr && /* @__PURE__ */ m("div", {
|
|
2177
2181
|
className: "p-3 bg-status-error-bg-subtle text-status-error-text border border-status-error-border text-sm rounded-card",
|
|
2178
2182
|
"data-testid": "sessions-reconnect-error",
|
|
2179
2183
|
children: Cr
|
|
2180
2184
|
}),
|
|
2181
|
-
xr && /* @__PURE__ */
|
|
2185
|
+
xr && /* @__PURE__ */ m("div", {
|
|
2182
2186
|
"data-testid": "sessions-reconnect-list",
|
|
2183
2187
|
className: "space-y-2",
|
|
2184
|
-
children: kr ? /* @__PURE__ */
|
|
2188
|
+
children: kr ? /* @__PURE__ */ m("div", {
|
|
2185
2189
|
className: "text-sm text-text-secondary",
|
|
2186
|
-
children:
|
|
2187
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
2190
|
+
children: y("sessions.scanningHost", "Scanning host...")
|
|
2191
|
+
}) : e.length === 0 ? /* @__PURE__ */ m("div", {
|
|
2188
2192
|
className: "text-sm text-text-secondary",
|
|
2189
|
-
children:
|
|
2190
|
-
}) : e.map((e) => /* @__PURE__ */
|
|
2193
|
+
children: y("sessions.noOrphans", "No orphan vibe-* sessions found on this agent.")
|
|
2194
|
+
}) : e.map((e) => /* @__PURE__ */ h("div", {
|
|
2191
2195
|
className: "flex items-center justify-between gap-3 p-3 border border-border-default rounded-md bg-bg-sunken/40",
|
|
2192
2196
|
"data-testid": "sessions-reconnect-row",
|
|
2193
|
-
children: [/* @__PURE__ */
|
|
2197
|
+
children: [/* @__PURE__ */ h("div", {
|
|
2194
2198
|
className: "min-w-0 flex-1",
|
|
2195
|
-
children: [/* @__PURE__ */
|
|
2199
|
+
children: [/* @__PURE__ */ m("div", {
|
|
2196
2200
|
className: "font-mono text-sm text-text-primary break-all",
|
|
2197
2201
|
children: e.externalName
|
|
2198
|
-
}), /* @__PURE__ */
|
|
2202
|
+
}), /* @__PURE__ */ h("div", {
|
|
2199
2203
|
className: "text-xs text-text-tertiary mt-0.5",
|
|
2200
2204
|
children: [
|
|
2201
2205
|
e.provider,
|
|
@@ -2207,7 +2211,7 @@ function Bt() {
|
|
|
2207
2211
|
e.createdAt ? ` · created ${e.createdAt}` : ""
|
|
2208
2212
|
]
|
|
2209
2213
|
})]
|
|
2210
|
-
}), /* @__PURE__ */
|
|
2214
|
+
}), /* @__PURE__ */ m("button", {
|
|
2211
2215
|
type: "button",
|
|
2212
2216
|
disabled: Tr === e.externalName,
|
|
2213
2217
|
onClick: async () => {
|
|
@@ -2226,201 +2230,201 @@ function Bt() {
|
|
|
2226
2230
|
},
|
|
2227
2231
|
className: "shrink-0 px-3 py-1.5 text-xs bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-all duration-200 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
2228
2232
|
"data-testid": `sessions-reconnect-adopt-${e.externalName}`,
|
|
2229
|
-
children: Tr === e.externalName ?
|
|
2233
|
+
children: Tr === e.externalName ? y("sessions.adopting", "Adopting…") : y("sessions.adopt", "Adopt")
|
|
2230
2234
|
})]
|
|
2231
2235
|
}, e.externalName))
|
|
2232
2236
|
})
|
|
2233
2237
|
]
|
|
2234
2238
|
}),
|
|
2235
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ m("div", {
|
|
2236
2240
|
className: "flex justify-end gap-3 mt-6",
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2241
|
+
children: /* @__PURE__ */ m("button", {
|
|
2238
2242
|
type: "button",
|
|
2239
2243
|
onClick: () => {
|
|
2240
2244
|
br(!1), wr(null);
|
|
2241
2245
|
},
|
|
2242
2246
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
|
|
2243
|
-
children:
|
|
2247
|
+
children: y("common.close", "Close")
|
|
2244
2248
|
})
|
|
2245
2249
|
})
|
|
2246
2250
|
]
|
|
2247
2251
|
})
|
|
2248
2252
|
});
|
|
2249
2253
|
}
|
|
2250
|
-
function
|
|
2251
|
-
return /* @__PURE__ */
|
|
2254
|
+
function xa() {
|
|
2255
|
+
return /* @__PURE__ */ m("div", {
|
|
2252
2256
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2257
|
+
children: /* @__PURE__ */ h("div", {
|
|
2254
2258
|
className: "bg-bg-surface rounded-card border border-border-subtle shadow-[var(--shadow-elevation-4)] p-6 w-full max-w-lg",
|
|
2255
2259
|
children: [
|
|
2256
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ m("h2", {
|
|
2257
2261
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
2258
|
-
children:
|
|
2262
|
+
children: y("sessions.newSession", "New Session")
|
|
2259
2263
|
}),
|
|
2260
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ h("div", {
|
|
2261
2265
|
className: "space-y-4",
|
|
2262
2266
|
children: [
|
|
2263
|
-
|
|
2267
|
+
hn && /* @__PURE__ */ m("div", {
|
|
2264
2268
|
className: "p-3 bg-status-error-bg-subtle text-status-error-text border border-status-error-border text-sm rounded-card",
|
|
2265
|
-
children:
|
|
2269
|
+
children: hn
|
|
2266
2270
|
}),
|
|
2267
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
2268
2272
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2269
|
-
children:
|
|
2270
|
-
}), /* @__PURE__ */
|
|
2273
|
+
children: y("sessions.name", "Name")
|
|
2274
|
+
}), /* @__PURE__ */ m("input", {
|
|
2271
2275
|
"aria-label": "control",
|
|
2272
|
-
ref:
|
|
2276
|
+
ref: wn,
|
|
2273
2277
|
type: "text",
|
|
2274
|
-
placeholder:
|
|
2278
|
+
placeholder: y("sessions.namePlaceholder", "dev-server"),
|
|
2275
2279
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
2276
2280
|
})] }),
|
|
2277
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
2278
2282
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2279
|
-
children:
|
|
2280
|
-
}), /* @__PURE__ */
|
|
2283
|
+
children: y("sessions.filterVibe", "Vibe")
|
|
2284
|
+
}), /* @__PURE__ */ m(Ne, {
|
|
2281
2285
|
options: li,
|
|
2282
|
-
value:
|
|
2283
|
-
onChange:
|
|
2284
|
-
placeholder:
|
|
2285
|
-
searchPlaceholder:
|
|
2286
|
+
value: On,
|
|
2287
|
+
onChange: kn,
|
|
2288
|
+
placeholder: y("sessions.noVibe", "No vibe"),
|
|
2289
|
+
searchPlaceholder: y("sessions.searchVibes", "Search vibes..."),
|
|
2286
2290
|
clearable: !0
|
|
2287
2291
|
})] }),
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ h("div", { children: [
|
|
2293
|
+
/* @__PURE__ */ m("label", {
|
|
2290
2294
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2291
|
-
children:
|
|
2295
|
+
children: y("sessions.filterAgent", "Agent")
|
|
2292
2296
|
}),
|
|
2293
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ m(Ne, {
|
|
2294
2298
|
options: ui,
|
|
2295
|
-
value:
|
|
2296
|
-
onChange:
|
|
2297
|
-
placeholder:
|
|
2298
|
-
searchPlaceholder:
|
|
2299
|
+
value: An,
|
|
2300
|
+
onChange: jn,
|
|
2301
|
+
placeholder: y("sessions.selectAgent", "Select an agent"),
|
|
2302
|
+
searchPlaceholder: y("sessions.searchAgents", "Search agents..."),
|
|
2299
2303
|
clearable: !0
|
|
2300
2304
|
}),
|
|
2301
|
-
/* @__PURE__ */
|
|
2305
|
+
/* @__PURE__ */ m("p", {
|
|
2302
2306
|
className: "text-xs text-text-muted mt-1",
|
|
2303
|
-
children:
|
|
2307
|
+
children: y("sessions.agentHint", "Required when no vibe is selected. Overridden by the vibe's agent if a vibe is chosen.")
|
|
2304
2308
|
})
|
|
2305
2309
|
] }),
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ h("div", { children: [
|
|
2311
|
+
/* @__PURE__ */ m("label", {
|
|
2308
2312
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2309
|
-
children:
|
|
2313
|
+
children: y("sessions.profile", "Profile")
|
|
2310
2314
|
}),
|
|
2311
|
-
/* @__PURE__ */
|
|
2315
|
+
/* @__PURE__ */ m(Ne, {
|
|
2312
2316
|
options: fi,
|
|
2313
|
-
value:
|
|
2314
|
-
onChange:
|
|
2315
|
-
placeholder:
|
|
2316
|
-
searchPlaceholder:
|
|
2317
|
+
value: Mn,
|
|
2318
|
+
onChange: Nn,
|
|
2319
|
+
placeholder: y("sessions.selectProfile", "default"),
|
|
2320
|
+
searchPlaceholder: y("sessions.searchProfiles", "Search profiles...")
|
|
2317
2321
|
}),
|
|
2318
|
-
/* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ m("p", {
|
|
2319
2323
|
className: "text-xs text-text-muted mt-1",
|
|
2320
|
-
children:
|
|
2324
|
+
children: y("sessions.profileHint", "Which agent profile this session targets. Defaults to \"default\" — change only if the agent runs multiple isolated profiles.")
|
|
2321
2325
|
})
|
|
2322
2326
|
] }),
|
|
2323
|
-
/* @__PURE__ */
|
|
2324
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ h("div", { children: [
|
|
2328
|
+
/* @__PURE__ */ m("label", {
|
|
2325
2329
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2326
|
-
children:
|
|
2330
|
+
children: y("sessions.filterType", "Type")
|
|
2327
2331
|
}),
|
|
2328
|
-
/* @__PURE__ */
|
|
2332
|
+
/* @__PURE__ */ m(Ne, {
|
|
2329
2333
|
options: pi,
|
|
2330
|
-
value:
|
|
2331
|
-
onChange:
|
|
2332
|
-
placeholder:
|
|
2333
|
-
searchPlaceholder:
|
|
2334
|
+
value: L,
|
|
2335
|
+
onChange: Pn,
|
|
2336
|
+
placeholder: y("sessions.selectType", "Select type"),
|
|
2337
|
+
searchPlaceholder: y("sessions.searchTypes", "Search types...")
|
|
2334
2338
|
}),
|
|
2335
|
-
|
|
2339
|
+
L === "TERMINAL" && /* @__PURE__ */ m("p", {
|
|
2336
2340
|
className: "mt-1 text-xs text-text-muted",
|
|
2337
|
-
children:
|
|
2341
|
+
children: y("sessions.terminalTypeHint", "Plain terminal — a shell over ttyd with no tmux/wezterm/zellij multiplexer and no persisted session. Native drag-to-select copy/paste.")
|
|
2338
2342
|
})
|
|
2339
2343
|
] }),
|
|
2340
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
2341
2345
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
2342
|
-
children:
|
|
2343
|
-
}), /* @__PURE__ */
|
|
2346
|
+
children: y("sessions.command", "Command")
|
|
2347
|
+
}), /* @__PURE__ */ m("input", {
|
|
2344
2348
|
"aria-label": "control",
|
|
2345
|
-
ref:
|
|
2349
|
+
ref: Tn,
|
|
2346
2350
|
type: "text",
|
|
2347
|
-
placeholder:
|
|
2351
|
+
placeholder: y("sessions.commandPlaceholder", "bun run dev"),
|
|
2348
2352
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
2349
2353
|
})] }),
|
|
2350
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ h("div", {
|
|
2351
2355
|
className: "flex items-center gap-2",
|
|
2352
|
-
children: [/* @__PURE__ */
|
|
2356
|
+
children: [/* @__PURE__ */ m("input", {
|
|
2353
2357
|
"aria-label": "autoStart",
|
|
2354
|
-
ref:
|
|
2358
|
+
ref: En,
|
|
2355
2359
|
type: "checkbox",
|
|
2356
2360
|
id: "autoStart",
|
|
2357
2361
|
className: "size-4 rounded border-border-default"
|
|
2358
|
-
}), /* @__PURE__ */
|
|
2362
|
+
}), /* @__PURE__ */ m("label", {
|
|
2359
2363
|
htmlFor: "autoStart",
|
|
2360
2364
|
className: "text-sm text-text-primary",
|
|
2361
|
-
children:
|
|
2365
|
+
children: y("sessions.autoStartWithVibe", "Auto-start with vibe")
|
|
2362
2366
|
})]
|
|
2363
2367
|
}),
|
|
2364
|
-
(
|
|
2368
|
+
(L === "TMUX" || L === "WEZTERM" || L === "ZELLIJ") && /* @__PURE__ */ h("div", {
|
|
2365
2369
|
className: "rounded-md border border-border-default bg-bg-sunken/40",
|
|
2366
2370
|
"data-testid": "sessions-create-advanced",
|
|
2367
|
-
children: [/* @__PURE__ */
|
|
2371
|
+
children: [/* @__PURE__ */ h("button", {
|
|
2368
2372
|
type: "button",
|
|
2369
|
-
onClick: () =>
|
|
2373
|
+
onClick: () => In((e) => !e),
|
|
2370
2374
|
className: "w-full flex items-center justify-between px-3 py-2 text-sm font-medium text-text-primary",
|
|
2371
|
-
"aria-expanded":
|
|
2372
|
-
children: [/* @__PURE__ */
|
|
2375
|
+
"aria-expanded": Fn,
|
|
2376
|
+
children: [/* @__PURE__ */ m("span", { children: y("sessions.advanced", "Advanced options") }), /* @__PURE__ */ m("span", {
|
|
2373
2377
|
className: "text-text-tertiary text-xs",
|
|
2374
|
-
children:
|
|
2378
|
+
children: Fn ? "▾" : "▸"
|
|
2375
2379
|
})]
|
|
2376
|
-
}),
|
|
2380
|
+
}), Fn && /* @__PURE__ */ h("div", {
|
|
2377
2381
|
className: "px-3 pb-3 space-y-2",
|
|
2378
2382
|
children: [
|
|
2379
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ m("label", {
|
|
2380
2384
|
className: "block text-xs font-medium text-text-secondary",
|
|
2381
|
-
children:
|
|
2385
|
+
children: y("sessions.attachExistingLabel", "Attach to existing session (optional)")
|
|
2382
2386
|
}),
|
|
2383
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ m("input", {
|
|
2384
2388
|
"aria-label": "control",
|
|
2385
|
-
ref:
|
|
2389
|
+
ref: Dn,
|
|
2386
2390
|
type: "text",
|
|
2387
2391
|
"data-testid": "sessions-create-external-name",
|
|
2388
|
-
placeholder:
|
|
2392
|
+
placeholder: L === "WEZTERM" ? "e.g. vibe-051c9c62 (existing wezterm workspace)" : L === "ZELLIJ" ? "e.g. vibe-051c9c62 (existing zellij session)" : "e.g. vibe-051c9c62 (existing tmux session)",
|
|
2389
2393
|
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"
|
|
2390
2394
|
}),
|
|
2391
|
-
/* @__PURE__ */
|
|
2395
|
+
/* @__PURE__ */ m("p", {
|
|
2392
2396
|
className: "text-xs text-text-tertiary",
|
|
2393
|
-
children:
|
|
2397
|
+
children: y("sessions.attachExistingHint", "When set, the agent attaches to that existing session instead of creating a new one. Leave blank to spawn fresh.")
|
|
2394
2398
|
})
|
|
2395
2399
|
]
|
|
2396
2400
|
})]
|
|
2397
2401
|
})
|
|
2398
2402
|
]
|
|
2399
2403
|
}),
|
|
2400
|
-
/* @__PURE__ */
|
|
2404
|
+
/* @__PURE__ */ h("div", {
|
|
2401
2405
|
className: "border-t border-border-default pt-4",
|
|
2402
|
-
children: [/* @__PURE__ */
|
|
2406
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
2403
2407
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
2404
|
-
children:
|
|
2405
|
-
}), /* @__PURE__ */
|
|
2408
|
+
children: y("sessions.tags", "Tags")
|
|
2409
|
+
}), /* @__PURE__ */ m(Ee, {
|
|
2406
2410
|
entityType: "VIBECONTROLS_SESSION",
|
|
2407
2411
|
onDraftChange: _r
|
|
2408
2412
|
})]
|
|
2409
2413
|
}),
|
|
2410
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ h("div", {
|
|
2411
2415
|
className: "flex justify-end gap-3 mt-6",
|
|
2412
|
-
children: [/* @__PURE__ */
|
|
2416
|
+
children: [/* @__PURE__ */ m("button", {
|
|
2413
2417
|
type: "button",
|
|
2414
|
-
onClick: () =>
|
|
2415
|
-
disabled:
|
|
2418
|
+
onClick: () => A(!1),
|
|
2419
|
+
disabled: gn,
|
|
2416
2420
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
2417
|
-
children:
|
|
2418
|
-
}), /* @__PURE__ */
|
|
2421
|
+
children: y("common.cancel", "Cancel")
|
|
2422
|
+
}), /* @__PURE__ */ m("button", {
|
|
2419
2423
|
type: "button",
|
|
2420
2424
|
onClick: Ai,
|
|
2421
|
-
disabled:
|
|
2425
|
+
disabled: gn,
|
|
2422
2426
|
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",
|
|
2423
|
-
children:
|
|
2427
|
+
children: gn ? y("sessions.creating", "Creating...") : y("sessions.createSession", "Create Session")
|
|
2424
2428
|
})]
|
|
2425
2429
|
})
|
|
2426
2430
|
]
|
|
@@ -2429,4 +2433,4 @@ function Bt() {
|
|
|
2429
2433
|
}
|
|
2430
2434
|
}
|
|
2431
2435
|
//#endregion
|
|
2432
|
-
export {
|
|
2436
|
+
export { Ht as SessionsPage };
|