@burdenoff/microfe-vibecontrols 2026.601.6 → 2026.601.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/components/sessions/EntityInfoPopover.js +183 -0
- package/dist/components/sessions/EntityInfoPopover.js.map +1 -0
- package/dist/components/sessions/SessionCard.js +80 -72
- package/dist/components/sessions/SessionCard.js.map +1 -1
- package/dist/components/sessions/SessionGroup.js +49 -0
- package/dist/components/sessions/SessionGroup.js.map +1 -0
- package/dist/components/sessions/SessionInfoPanel.js +128 -0
- package/dist/components/sessions/SessionInfoPanel.js.map +1 -0
- package/dist/components/sessions/SessionList.js +109 -96
- package/dist/components/sessions/SessionList.js.map +1 -1
- package/dist/components/sessions/SessionsCommandPalette.js +36 -0
- package/dist/components/sessions/SessionsCommandPalette.js.map +1 -0
- package/dist/components/sessions/ShortcutCheatsheet.js +73 -0
- package/dist/components/sessions/ShortcutCheatsheet.js.map +1 -0
- package/dist/components/sessions/TerminalPanel.js +640 -537
- package/dist/components/sessions/TerminalPanel.js.map +1 -1
- package/dist/components/sessions/groupSessions.js +46 -0
- package/dist/components/sessions/groupSessions.js.map +1 -0
- package/dist/components/sessions/index.js +7 -0
- package/dist/components/sessions/sessionShortcuts.js +149 -0
- package/dist/components/sessions/sessionShortcuts.js.map +1 -0
- package/dist/components/shared/FilterDropdown.js +14 -13
- package/dist/components/shared/FilterDropdown.js.map +1 -1
- package/dist/components/shared/LinkToVibePanel.js.map +1 -1
- package/dist/components/vibe/VibeLinkedEntitiesPanel.js.map +1 -1
- package/dist/generated/wspace-operations.js +21 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/pages/SessionsPage.js +1189 -920
- package/dist/pages/SessionsPage.js.map +1 -1
- package/dist/pages/ai/AgentManagerPage.js.map +1 -1
- package/dist/store/vibeControlsStore.js +16 -1
- package/dist/store/vibeControlsStore.js.map +1 -1
- package/dist/translations/en.js +97 -2
- package/dist/translations/en.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import { useAdoptAgentSessionMutation as e, useAgentSessionOrphansLazyQuery as t, useBulkRestartSessionsMutation as n, useBulkStopSessionsMutation as r, useBulkTerminateSessionsMutation as i, useCheckSessionHealthMutation as
|
|
2
|
-
import { ConfirmDialog as
|
|
3
|
-
import { getQuotaDialogContent as
|
|
4
|
-
import { useVibeControls as
|
|
5
|
-
import { useVibeControlsStore as
|
|
6
|
-
import
|
|
7
|
-
import { PageHeader as
|
|
8
|
-
import { LoadingState as
|
|
9
|
-
import { ErrorState as
|
|
10
|
-
import { EntityTagPicker as
|
|
11
|
-
import { useDraftEntityTags as
|
|
12
|
-
import { EmptyState as
|
|
13
|
-
import { SearchInput as
|
|
14
|
-
import { FilterDropdown as
|
|
15
|
-
import { AgentSetupBanner as
|
|
16
|
-
import { GetHelpButton as
|
|
17
|
-
import { SearchableSelect as
|
|
18
|
-
import
|
|
19
|
-
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 s, useListAgentProfilesQuery as c, useListSessionsQuery as ee, useRestartSessionMutation as te, useRestartSessionTerminalMutation as ne, useSessionStatusChangedSubscription as re, useStartSessionMutation as ie, useStartSessionTerminalMutation as ae, useStopSessionMutation as oe, useStopSessionTerminalMutation as se, useTerminateSessionMutation as ce, useUpdateSessionMutation as le, useVibecontrolsAgentHealthProbeStreamSubscription as ue, useVibecontrolsAgentHealthProbesLazyQuery as de } from "../generated/wspace-operations.js";
|
|
2
|
+
import { ConfirmDialog as fe } from "../components/shared/ConfirmDialog.js";
|
|
3
|
+
import { getQuotaDialogContent as pe, isQuotaExhaustedError as l, markQuotaHandledLocally as u } from "../utils/quotaUtils.js";
|
|
4
|
+
import { useVibeControls as me, useVibeNavigate as he } from "../providers/VibeControlsProvider.js";
|
|
5
|
+
import { useVibeControlsStore as ge } from "../store/vibeControlsStore.js";
|
|
6
|
+
import _e from "../hooks/useCachedInitialData.js";
|
|
7
|
+
import { PageHeader as ve } from "../components/shared/PageHeader.js";
|
|
8
|
+
import { LoadingState as ye } from "../components/shared/LoadingState.js";
|
|
9
|
+
import { ErrorState as be } from "../components/shared/ErrorState.js";
|
|
10
|
+
import { EntityTagPicker as xe } from "../components/shared/EntityTagPicker.js";
|
|
11
|
+
import { useDraftEntityTags as Se } from "../hooks/useDraftEntityTags.js";
|
|
12
|
+
import { EmptyState as Ce } from "../components/shared/EmptyState.js";
|
|
13
|
+
import { SearchInput as we } from "../components/shared/SearchInput.js";
|
|
14
|
+
import { FilterDropdown as d } from "../components/shared/FilterDropdown.js";
|
|
15
|
+
import { AgentSetupBanner as Te } from "../components/shared/AgentSetupBanner.js";
|
|
16
|
+
import { GetHelpButton as Ee } from "../components/shared/GetHelpButton.js";
|
|
17
|
+
import { SearchableSelect as De } from "../components/shared/SearchableSelect.js";
|
|
18
|
+
import Oe from "../components/shared/SessionNotificationBanner.js";
|
|
19
|
+
import { getAgentStatus as ke } from "../components/agents/agentStatus.js";
|
|
20
20
|
import "../components/shared/index.js";
|
|
21
|
-
import { VIBE_PERMISSIONS as
|
|
22
|
-
import { SessionCard as
|
|
23
|
-
import { SessionList as
|
|
24
|
-
import { TerminalPanel as
|
|
25
|
-
import { SessionShareDialog as
|
|
21
|
+
import { VIBE_PERMISSIONS as Ae } from "../constants/permissions.js";
|
|
22
|
+
import { SessionCard as je } from "../components/sessions/SessionCard.js";
|
|
23
|
+
import { SessionList as Me } from "../components/sessions/SessionList.js";
|
|
24
|
+
import { TerminalPanel as Ne } from "../components/sessions/TerminalPanel.js";
|
|
25
|
+
import { SessionShareDialog as Pe } from "../components/sessions/SessionShareDialog.js";
|
|
26
|
+
import { SessionGroup as Fe } from "../components/sessions/SessionGroup.js";
|
|
27
|
+
import { groupSessions as Ie } from "../components/sessions/groupSessions.js";
|
|
28
|
+
import { buildSessionShortcuts as Le } from "../components/sessions/sessionShortcuts.js";
|
|
29
|
+
import { ShortcutCheatsheet as Re } from "../components/sessions/ShortcutCheatsheet.js";
|
|
30
|
+
import { SessionsCommandPalette as ze } from "../components/sessions/SessionsCommandPalette.js";
|
|
31
|
+
import { SessionInfoPanel as Be } from "../components/sessions/SessionInfoPanel.js";
|
|
26
32
|
import "../components/sessions/index.js";
|
|
27
|
-
import { useCallback as
|
|
28
|
-
import { useI18n as
|
|
29
|
-
import { Activity as
|
|
30
|
-
import { useSearchParams as
|
|
31
|
-
import { usePermissions as
|
|
32
|
-
import { AnimatePresence as
|
|
33
|
-
import { Fragment as
|
|
34
|
-
import { SaveToFilesButton as
|
|
35
|
-
import { AccessDenied as
|
|
36
|
-
import { MotionItem as
|
|
33
|
+
import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
34
|
+
import { useI18n as Ve } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
35
|
+
import { Activity as He, CheckSquare as Ue, Grid as We, Info as Ge, Keyboard as Ke, Layers as qe, List as Je, Monitor as Ye, MonitorSmartphone as Xe, Play as Ze, Plus as Qe, RefreshCw as $e, RotateCcw as et, Server as tt, Share2 as nt, Square as rt, Terminal as it, Trash2 as at, XSquare as ot } from "lucide-react";
|
|
36
|
+
import { useSearchParams as st } from "react-router-dom";
|
|
37
|
+
import { usePermissions as ct } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
38
|
+
import { AnimatePresence as lt } from "framer-motion";
|
|
39
|
+
import { Fragment as ut, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
40
|
+
import { SaveToFilesButton as dt } from "@burdenoff/fe-libs/storage";
|
|
41
|
+
import { AccessDenied as ft, PermissionButton as pt } from "@burdenoff/fe-libs/shared/components";
|
|
42
|
+
import { MotionItem as mt, MotionList as ht, MotionPage as y } from "@burdenoff/fe-libs/shared/motion";
|
|
37
43
|
//#region src/pages/SessionsPage.tsx
|
|
38
|
-
var
|
|
39
|
-
function
|
|
44
|
+
var gt = 3e5;
|
|
45
|
+
function _t(e, t) {
|
|
40
46
|
if (!e) return null;
|
|
41
47
|
try {
|
|
42
48
|
let n = new URL(e);
|
|
@@ -53,7 +59,7 @@ function ot(e, t) {
|
|
|
53
59
|
return e;
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
|
-
function
|
|
62
|
+
function vt(e, t, n, r) {
|
|
57
63
|
if (e !== "RUNNING") return e;
|
|
58
64
|
if (r === !1) return "ERROR";
|
|
59
65
|
if (!t) return e;
|
|
@@ -66,214 +72,221 @@ function st(e, t, n, r) {
|
|
|
66
72
|
}
|
|
67
73
|
return e;
|
|
68
74
|
}
|
|
69
|
-
function
|
|
70
|
-
let { t:
|
|
71
|
-
let r =
|
|
75
|
+
function yt() {
|
|
76
|
+
let { t: yt } = Ve(), { onSessionStart: bt, workspaceId: xt } = me(), b = he(), { hasPermission: St, isLoading: Ct, permissions: wt } = ct(), [x, Tt] = st(), S = f((e, t, n) => {
|
|
77
|
+
let r = yt(e, n), i = r === e ? t : r;
|
|
72
78
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
73
|
-
}, [
|
|
79
|
+
}, [yt]), Et = m(() => [
|
|
74
80
|
{
|
|
75
81
|
value: "all",
|
|
76
|
-
label:
|
|
82
|
+
label: S("sessions.statusAll", "All Statuses")
|
|
77
83
|
},
|
|
78
84
|
{
|
|
79
85
|
value: "RUNNING",
|
|
80
|
-
label:
|
|
86
|
+
label: S("sessions.running", "Running")
|
|
81
87
|
},
|
|
82
88
|
{
|
|
83
89
|
value: "STOPPED",
|
|
84
|
-
label:
|
|
90
|
+
label: S("sessions.stopped", "Stopped")
|
|
85
91
|
},
|
|
86
92
|
{
|
|
87
93
|
value: "STARTING",
|
|
88
|
-
label:
|
|
94
|
+
label: S("sessions.starting", "Starting")
|
|
89
95
|
},
|
|
90
96
|
{
|
|
91
97
|
value: "ERROR",
|
|
92
|
-
label:
|
|
98
|
+
label: S("common.error", "Error")
|
|
93
99
|
}
|
|
94
|
-
], [
|
|
100
|
+
], [S]), Dt = m(() => [
|
|
95
101
|
{
|
|
96
102
|
value: "all",
|
|
97
|
-
label:
|
|
103
|
+
label: S("sessions.typeAll", "All Types")
|
|
98
104
|
},
|
|
99
105
|
{
|
|
100
106
|
value: "TMUX",
|
|
101
|
-
label:
|
|
107
|
+
label: S("sessions.typeTmux", "Tmux")
|
|
102
108
|
},
|
|
103
109
|
{
|
|
104
110
|
value: "TERMINAL",
|
|
105
|
-
label:
|
|
111
|
+
label: S("sessions.typeTerminal", "Terminal")
|
|
106
112
|
},
|
|
107
113
|
{
|
|
108
114
|
value: "SCRIPT",
|
|
109
|
-
label:
|
|
115
|
+
label: S("sessions.typeScript", "Script")
|
|
110
116
|
},
|
|
111
117
|
{
|
|
112
118
|
value: "CUSTOM",
|
|
113
|
-
label:
|
|
119
|
+
label: S("sessions.typeCustom", "Custom")
|
|
114
120
|
}
|
|
115
|
-
], [
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
], [S]), Ot = St(Ae.SESSION_LIST), kt = St(Ae.SESSION_CREATE), [C, At] = g(""), [w, jt] = g("all"), [T, Mt] = g("all"), [E, Nt] = g("all"), [D, Pt] = g("all"), [O, Ft] = g("all"), [k, A] = g("none"), [It, Lt] = g(() => /* @__PURE__ */ new Set()), [j, M] = g("terminal"), [Rt, N] = g(!1), [zt, P] = g(!1), [Bt, F] = g(null), [Vt, Ht] = g(!1), [Ut, I] = g(null), [L, R] = g(/* @__PURE__ */ new Set()), [Wt, z] = g(!1), [Gt, Kt] = g(!1), qt = h(null), Jt = h(null), Yt = h(null), Xt = h(null), Zt = h(null), [Qt, $t] = g(""), [en, tn] = g(""), [nn, rn] = g("default"), [B, an] = g("TMUX"), [on, sn] = g(!1), { terminalTabs: cn, activeTerminalTabId: ln, sessionsViewMode: un, sessionsGroupBy: dn, sessionsTargetFilter: fn, setTerminalTabs: pn, setActiveTerminalTabId: mn, setSessionsViewMode: hn, setSessionsGroupBy: gn, setSessionsTargetFilter: _n, sessionInfoPanelOpen: vn, setSessionInfoPanelOpen: yn, activeSessionId: V } = ge(), [H, U] = g([]), [W, G] = g(null), [bn, xn] = g(!1), [Sn, Cn] = g(!1), [wn, Tn] = g(!1), [En, Dn] = g(null), [On, kn] = g(!1), [K, An] = g(!1), jn = x.get("view"), Mn = x.get("session"), Nn = x.get("group"), Pn = x.get("target"), [Fn] = o({ refetchQueries: ["ListSessions"] }), { setDraftTagIds: In, flushTags: Ln } = Se("VIBECONTROLS_SESSION"), [Rn, zn] = g(!1), [Bn, Vn] = g(""), [Hn, Un] = g(null), [Wn, Gn] = g(null), [Kn, { data: qn, loading: Jn }] = t({ fetchPolicy: "network-only" }), [Yn] = e({ refetchQueries: ["ListSessions"] }), [Xn] = ie({ refetchQueries: ["ListSessions"] }), [Zn] = oe({ refetchQueries: ["ListSessions"] }), [Qn] = te({ refetchQueries: ["ListSessions"] }), [q] = ae({ refetchQueries: ["ListSessions"] }), [$n] = se({ refetchQueries: ["ListSessions"] }), [er] = ne({ refetchQueries: ["ListSessions"] }), [tr] = le({ refetchQueries: ["ListSessions"] }), [nr] = ce({ refetchQueries: ["ListSessions"] }), [rr] = a({ refetchQueries: ["ListSessions"] }), [ir] = r({ refetchQueries: ["ListSessions"] }), [ar] = n({ refetchQueries: ["ListSessions"] }), [or] = i({ refetchQueries: ["ListSessions"] }), [sr] = s();
|
|
122
|
+
p(() => {
|
|
123
|
+
K || (jn === "terminal" || jn === "grid" || jn === "list" ? M(jn) : un && M(un), Mn ? G(Mn) : ln && G(ln), Nn && [
|
|
124
|
+
"none",
|
|
125
|
+
"agent",
|
|
126
|
+
"target",
|
|
127
|
+
"vibe",
|
|
128
|
+
"status",
|
|
129
|
+
"type"
|
|
130
|
+
].includes(Nn) ? A(Nn) : dn && A(dn), Pn ? Ft(Pn) : fn && Ft(fn), cn.length > 0 && U(cn.map((e) => ({
|
|
118
131
|
sessionId: e.sessionId,
|
|
119
132
|
name: e.name,
|
|
133
|
+
pinned: e.pinned,
|
|
120
134
|
terminalUrl: null,
|
|
121
135
|
loading: !1,
|
|
122
136
|
error: null
|
|
123
|
-
}))),
|
|
137
|
+
}))), An(!0));
|
|
124
138
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Yt,
|
|
139
|
+
cn,
|
|
140
|
+
ln,
|
|
128
141
|
un,
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
dn,
|
|
143
|
+
fn,
|
|
144
|
+
Mn,
|
|
145
|
+
jn,
|
|
146
|
+
Nn,
|
|
147
|
+
Pn,
|
|
148
|
+
K
|
|
131
149
|
]);
|
|
132
|
-
let
|
|
133
|
-
|
|
134
|
-
|
|
150
|
+
let cr = h(!1);
|
|
151
|
+
p(() => {
|
|
152
|
+
K && pn(H.map((e) => ({
|
|
135
153
|
sessionId: e.sessionId,
|
|
136
|
-
name: e.name
|
|
154
|
+
name: e.name,
|
|
155
|
+
pinned: e.pinned
|
|
137
156
|
})));
|
|
138
157
|
}, [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
]),
|
|
143
|
-
|
|
158
|
+
H,
|
|
159
|
+
K,
|
|
160
|
+
pn
|
|
161
|
+
]), p(() => {
|
|
162
|
+
K && mn(W);
|
|
144
163
|
}, [
|
|
145
|
-
z,
|
|
146
164
|
W,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
165
|
+
K,
|
|
166
|
+
mn
|
|
167
|
+
]), p(() => {
|
|
168
|
+
K && hn(j);
|
|
150
169
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
]),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
170
|
+
j,
|
|
171
|
+
K,
|
|
172
|
+
hn
|
|
173
|
+
]), p(() => {
|
|
174
|
+
K && gn(k);
|
|
175
|
+
}, [
|
|
176
|
+
k,
|
|
177
|
+
K,
|
|
178
|
+
gn
|
|
179
|
+
]), p(() => {
|
|
180
|
+
K && _n(O);
|
|
181
|
+
}, [
|
|
182
|
+
O,
|
|
183
|
+
K,
|
|
184
|
+
_n
|
|
185
|
+
]), p(() => {
|
|
186
|
+
if (!K) return;
|
|
187
|
+
let e = new URLSearchParams(x), t = !1, n = j === "terminal" ? null : j;
|
|
188
|
+
n ? e.get("view") !== n && (e.set("view", n), t = !0) : e.has("view") && (e.delete("view"), t = !0), W ? e.get("session") !== W && (e.set("session", W), t = !0) : e.has("session") && (e.delete("session"), t = !0), k === "none" ? e.has("group") && (e.delete("group"), t = !0) : e.get("group") !== k && (e.set("group", k), t = !0), O === "all" ? e.has("target") && (e.delete("target"), t = !0) : e.get("target") !== O && (e.set("target", O), t = !0), t && Tt(e, { replace: !0 });
|
|
158
189
|
}, [
|
|
159
|
-
z,
|
|
160
|
-
ht,
|
|
161
|
-
gt,
|
|
162
190
|
W,
|
|
163
|
-
|
|
191
|
+
x,
|
|
192
|
+
Tt,
|
|
193
|
+
K,
|
|
194
|
+
j,
|
|
195
|
+
k,
|
|
196
|
+
O
|
|
164
197
|
]);
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
skip: !
|
|
168
|
-
variables: { workspaceId:
|
|
169
|
-
}),
|
|
198
|
+
let lr = h(null);
|
|
199
|
+
re({
|
|
200
|
+
skip: !xt,
|
|
201
|
+
variables: { workspaceId: xt || "" }
|
|
202
|
+
}), p(() => {
|
|
170
203
|
let e = setInterval(() => {
|
|
171
|
-
|
|
172
|
-
},
|
|
204
|
+
rr().catch(() => {});
|
|
205
|
+
}, gt);
|
|
173
206
|
return () => clearInterval(e);
|
|
174
|
-
}, [
|
|
175
|
-
|
|
176
|
-
let t = e.target;
|
|
177
|
-
if (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable) return;
|
|
178
|
-
let n = e.metaKey || e.ctrlKey;
|
|
179
|
-
if (n && e.key === "t") {
|
|
180
|
-
e.preventDefault(), D(!0);
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
if (n && e.key === "w" && z) {
|
|
184
|
-
e.preventDefault();
|
|
185
|
-
let t = z;
|
|
186
|
-
R((e) => e.filter((e) => e.sessionId !== t)), B(() => {
|
|
187
|
-
let e = L.filter((e) => e.sessionId !== t);
|
|
188
|
-
return e.length > 0 ? e[e.length - 1].sessionId : null;
|
|
189
|
-
});
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey && L.length > 1) {
|
|
193
|
-
e.preventDefault(), B(L[(L.findIndex((e) => e.sessionId === z) + 1) % L.length].sessionId);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
if (e.ctrlKey && e.key === "Tab" && e.shiftKey && L.length > 1) {
|
|
197
|
-
e.preventDefault(), B(L[(L.findIndex((e) => e.sessionId === z) - 1 + L.length) % L.length].sessionId);
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
if (n && /^[1-9]$/.test(e.key) && L.length > 0) {
|
|
201
|
-
let t = Number(e.key) - 1;
|
|
202
|
-
t < L.length && (e.preventDefault(), B(L[t].sessionId));
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (n && (e.key === "p" || e.key === "P")) {
|
|
206
|
-
e.preventDefault(), nn(""), V(!0);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (!n && !e.altKey && !e.shiftKey && e.key === "?") {
|
|
210
|
-
e.preventDefault(), en(!0);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
215
|
-
}, [z, L]);
|
|
216
|
-
let { data: Bn, previousData: Vn, loading: q, error: Hn, refetch: J } = te({
|
|
207
|
+
}, [rr]);
|
|
208
|
+
let { data: ur, previousData: dr, loading: J, error: fr, refetch: Y } = ee({
|
|
217
209
|
variables: {
|
|
218
210
|
filter: {
|
|
219
|
-
status:
|
|
220
|
-
type:
|
|
221
|
-
vibeId:
|
|
222
|
-
agentId:
|
|
211
|
+
status: w === "all" ? void 0 : w,
|
|
212
|
+
type: T === "all" ? void 0 : T,
|
|
213
|
+
vibeId: E !== "all" && E !== "none" ? E : void 0,
|
|
214
|
+
agentId: D === "all" ? void 0 : D
|
|
223
215
|
},
|
|
224
216
|
pagination: { limit: 50 }
|
|
225
217
|
},
|
|
226
|
-
fetchPolicy:
|
|
227
|
-
}),
|
|
218
|
+
fetchPolicy: w === "all" && T === "all" && E === "all" && D === "all" ? "cache-first" : "cache-and-network"
|
|
219
|
+
}), pr = ur ?? dr, { agents: mr, vibes: hr } = _e(), [gr, _r] = de({
|
|
228
220
|
fetchPolicy: "network-only",
|
|
229
221
|
notifyOnNetworkStatusChange: !0
|
|
230
|
-
}), { data:
|
|
231
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
222
|
+
}), { data: vr } = ue(), yr = m(() => {
|
|
223
|
+
let e = /* @__PURE__ */ new Map(), t = vr?.vibecontrolsAgentHealthProbeStream ?? _r.data?.vibecontrolsAgentHealthProbes ?? [];
|
|
232
224
|
for (let n of t) e.set(n.agentId, {
|
|
233
225
|
healthy: n.healthy,
|
|
234
226
|
error: n.errorMessage ?? null
|
|
235
227
|
});
|
|
236
228
|
return e;
|
|
237
|
-
}, [
|
|
229
|
+
}, [_r.data, vr]), br = m(() => [
|
|
238
230
|
{
|
|
239
231
|
value: "all",
|
|
240
|
-
label:
|
|
232
|
+
label: S("sessions.filterVibeAll", "All Vibes")
|
|
241
233
|
},
|
|
242
234
|
{
|
|
243
235
|
value: "none",
|
|
244
|
-
label:
|
|
236
|
+
label: S("sessions.filterVibeNone", "No Vibe")
|
|
245
237
|
},
|
|
246
|
-
...
|
|
238
|
+
...hr.map((e) => ({
|
|
247
239
|
value: e.id,
|
|
248
240
|
label: e.name
|
|
249
241
|
}))
|
|
250
|
-
], [
|
|
242
|
+
], [hr, S]), xr = m(() => [{
|
|
251
243
|
value: "all",
|
|
252
|
-
label:
|
|
253
|
-
}, ...
|
|
244
|
+
label: S("sessions.filterAgentAll", "All Agents")
|
|
245
|
+
}, ...mr.map((e) => ({
|
|
254
246
|
value: e.id,
|
|
255
|
-
label: `${e.name} ${
|
|
256
|
-
}))], [
|
|
247
|
+
label: `${e.name} ${ke(e) === "ACTIVE" ? "" : `(${S("sessions.offline", "Offline")})`}`
|
|
248
|
+
}))], [mr, S]), Sr = m(() => [
|
|
249
|
+
{
|
|
250
|
+
value: "agent",
|
|
251
|
+
label: S("sessions.groupBy.agent", "Agent")
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
value: "target",
|
|
255
|
+
label: S("sessions.groupBy.target", "Target")
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
value: "vibe",
|
|
259
|
+
label: S("sessions.groupBy.vibe", "Vibe")
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
value: "status",
|
|
263
|
+
label: S("sessions.groupBy.status", "Status")
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
value: "type",
|
|
267
|
+
label: S("sessions.groupBy.type", "Type")
|
|
268
|
+
}
|
|
269
|
+
], [S]), Cr = m(() => [{
|
|
257
270
|
value: "",
|
|
258
|
-
label:
|
|
259
|
-
}, ...
|
|
271
|
+
label: S("sessions.noVibe", "No vibe")
|
|
272
|
+
}, ...hr.map((e) => ({
|
|
260
273
|
value: e.id,
|
|
261
274
|
label: e.name
|
|
262
|
-
}))], [
|
|
275
|
+
}))], [hr, S]), wr = m(() => [{
|
|
263
276
|
value: "",
|
|
264
|
-
label:
|
|
265
|
-
}, ...
|
|
266
|
-
let t =
|
|
277
|
+
label: S("sessions.selectAgent", "Select an agent")
|
|
278
|
+
}, ...mr.map((e) => {
|
|
279
|
+
let t = ke(e) === "ACTIVE" ? S("sessions.active", "Active") : S("sessions.offline", "Offline");
|
|
267
280
|
return {
|
|
268
281
|
value: e.id,
|
|
269
282
|
label: `${e.name} (${t})`
|
|
270
283
|
};
|
|
271
|
-
})], [
|
|
272
|
-
variables: { agentId:
|
|
273
|
-
skip: !
|
|
284
|
+
})], [mr, S]), { data: Tr } = c({
|
|
285
|
+
variables: { agentId: en },
|
|
286
|
+
skip: !en,
|
|
274
287
|
fetchPolicy: "cache-and-network"
|
|
275
|
-
}),
|
|
276
|
-
let e = (
|
|
288
|
+
}), Er = m(() => {
|
|
289
|
+
let e = (Tr?.vibecontrolsAgentProfiles ?? []).map((e) => ({
|
|
277
290
|
value: e.name,
|
|
278
291
|
label: e.status && e.status !== "ACTIVE" ? `${e.name} (${e.status})` : e.name
|
|
279
292
|
}));
|
|
@@ -281,41 +294,41 @@ function ct() {
|
|
|
281
294
|
value: "default",
|
|
282
295
|
label: "default"
|
|
283
296
|
}, ...e];
|
|
284
|
-
}, [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}, [
|
|
288
|
-
let
|
|
297
|
+
}, [Tr]);
|
|
298
|
+
p(() => {
|
|
299
|
+
rn("default");
|
|
300
|
+
}, [en]);
|
|
301
|
+
let Dr = m(() => [
|
|
289
302
|
{
|
|
290
303
|
value: "TMUX",
|
|
291
|
-
label:
|
|
304
|
+
label: S("sessions.typeTmuxLower", "tmux")
|
|
292
305
|
},
|
|
293
306
|
{
|
|
294
307
|
value: "WEZTERM",
|
|
295
|
-
label:
|
|
308
|
+
label: S("sessions.typeWezTerm", "WezTerm")
|
|
296
309
|
},
|
|
297
310
|
{
|
|
298
311
|
value: "ZELLIJ",
|
|
299
|
-
label:
|
|
312
|
+
label: S("sessions.typeZellij", "Zellij")
|
|
300
313
|
},
|
|
301
314
|
{
|
|
302
315
|
value: "TERMINAL",
|
|
303
|
-
label:
|
|
316
|
+
label: S("sessions.typeTerminal", "Terminal")
|
|
304
317
|
},
|
|
305
318
|
{
|
|
306
319
|
value: "SSH",
|
|
307
|
-
label:
|
|
320
|
+
label: S("sessions.typeSsh", "SSH")
|
|
308
321
|
},
|
|
309
322
|
{
|
|
310
323
|
value: "SCRIPT",
|
|
311
|
-
label:
|
|
324
|
+
label: S("sessions.typeScript", "Script")
|
|
312
325
|
},
|
|
313
326
|
{
|
|
314
327
|
value: "CUSTOM",
|
|
315
|
-
label:
|
|
328
|
+
label: S("sessions.typeCustom", "Custom")
|
|
316
329
|
}
|
|
317
|
-
], [
|
|
318
|
-
let t =
|
|
330
|
+
], [S]), X = m(() => (pr?.sessions?.items ?? []).map((e) => {
|
|
331
|
+
let t = _t(e.ttydUrl || null, e.agent?.tunnelUrl || null);
|
|
319
332
|
return {
|
|
320
333
|
id: e.id,
|
|
321
334
|
workspaceId: e.workspaceId,
|
|
@@ -324,7 +337,7 @@ function ct() {
|
|
|
324
337
|
profile: e.profile ?? "default",
|
|
325
338
|
name: e.name,
|
|
326
339
|
type: e.type,
|
|
327
|
-
status:
|
|
340
|
+
status: vt(e.status, e.ttydUrl || null, t, e.agent ? ke(e.agent) === "ACTIVE" : void 0),
|
|
328
341
|
command: e.command || null,
|
|
329
342
|
workingDirectory: e.workingDirectory || null,
|
|
330
343
|
environmentVariables: e.environmentVariables || {},
|
|
@@ -345,17 +358,42 @@ function ct() {
|
|
|
345
358
|
agent: e.agent ? {
|
|
346
359
|
id: e.agent.id,
|
|
347
360
|
name: e.agent.name,
|
|
361
|
+
hostname: e.agent.hostname ?? null,
|
|
362
|
+
platform: e.agent.platform ?? null,
|
|
348
363
|
tunnelUrl: e.agent.tunnelUrl || null,
|
|
349
|
-
|
|
364
|
+
tunnelStatus: e.agent.tunnelStatus ?? null,
|
|
365
|
+
isActive: e.agent.isActive,
|
|
366
|
+
lastHeartbeat: e.agent.lastHeartbeat ?? null,
|
|
367
|
+
target: e.agent.target ? {
|
|
368
|
+
id: e.agent.target.id,
|
|
369
|
+
name: e.agent.target.name,
|
|
370
|
+
type: String(e.agent.target.type),
|
|
371
|
+
status: e.agent.target.status,
|
|
372
|
+
host: e.agent.target.host ?? null,
|
|
373
|
+
port: e.agent.target.port ?? null
|
|
374
|
+
} : null
|
|
350
375
|
} : void 0
|
|
351
376
|
};
|
|
352
|
-
}), [
|
|
353
|
-
|
|
354
|
-
|
|
377
|
+
}), [pr?.sessions?.items]), Or = m(() => {
|
|
378
|
+
let e = /* @__PURE__ */ new Map();
|
|
379
|
+
for (let t of X) {
|
|
380
|
+
let n = t.agent?.target;
|
|
381
|
+
n && !e.has(n.id) && e.set(n.id, n.name);
|
|
382
|
+
}
|
|
383
|
+
return [{
|
|
384
|
+
value: "all",
|
|
385
|
+
label: S("sessions.filterTargetAll", "All Targets")
|
|
386
|
+
}, ...Array.from(e.entries()).map(([e, t]) => ({
|
|
387
|
+
value: e,
|
|
388
|
+
label: t
|
|
389
|
+
}))];
|
|
390
|
+
}, [X, S]);
|
|
391
|
+
p(() => {
|
|
392
|
+
cr.current || X.length === 0 || H.length === 0 || (cr.current = !0, Promise.allSettled(H.map(async (e) => {
|
|
355
393
|
let t = X.find((t) => t.id === e.sessionId);
|
|
356
394
|
if (t) try {
|
|
357
|
-
let n = await
|
|
358
|
-
|
|
395
|
+
let n = await q({ variables: { id: e.sessionId } }), r = t.agent?.tunnelUrl ?? null, i = _t(n.data?.startSessionTerminal?.ttydUrl ?? null, r);
|
|
396
|
+
U((n) => n.map((n) => n.sessionId === e.sessionId ? {
|
|
359
397
|
...n,
|
|
360
398
|
terminalUrl: i,
|
|
361
399
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -363,7 +401,7 @@ function ct() {
|
|
|
363
401
|
error: null
|
|
364
402
|
} : n));
|
|
365
403
|
} catch (n) {
|
|
366
|
-
console.warn("[sessions] tab restore startSessionTerminal failed", n),
|
|
404
|
+
console.warn("[sessions] tab restore startSessionTerminal failed", n), U((n) => n.map((n) => n.sessionId === e.sessionId && t.ttydUrl ? {
|
|
367
405
|
...n,
|
|
368
406
|
terminalUrl: t.ttydUrl,
|
|
369
407
|
agentId: t.agent?.id ?? n.agentId ?? null,
|
|
@@ -373,21 +411,21 @@ function ct() {
|
|
|
373
411
|
})));
|
|
374
412
|
}, [
|
|
375
413
|
X,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
]),
|
|
379
|
-
if (!
|
|
380
|
-
|
|
414
|
+
H,
|
|
415
|
+
q
|
|
416
|
+
]), p(() => {
|
|
417
|
+
if (!K || !V) {
|
|
418
|
+
lr.current = V;
|
|
381
419
|
return;
|
|
382
420
|
}
|
|
383
|
-
if (
|
|
384
|
-
|
|
421
|
+
if (lr.current === null && V) {
|
|
422
|
+
lr.current = V;
|
|
385
423
|
return;
|
|
386
424
|
}
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
let e = X.find((e) => e.id ===
|
|
390
|
-
if (e) if (
|
|
425
|
+
if (lr.current === V) return;
|
|
426
|
+
lr.current = V;
|
|
427
|
+
let e = X.find((e) => e.id === V);
|
|
428
|
+
if (e) if (H.find((e) => e.sessionId === V)) G(V), Tn(!1);
|
|
391
429
|
else {
|
|
392
430
|
let t = e.ttydUrl || null, n = {
|
|
393
431
|
sessionId: e.id,
|
|
@@ -398,17 +436,17 @@ function ct() {
|
|
|
398
436
|
loading: !t,
|
|
399
437
|
error: null
|
|
400
438
|
};
|
|
401
|
-
|
|
439
|
+
U((e) => [...e, n]), G(V), Tn(!1), t || q({ variables: { id: e.id } }).then((t) => {
|
|
402
440
|
let n = t.data?.startSessionTerminal?.ttydUrl || null;
|
|
403
|
-
|
|
441
|
+
U((t) => t.map((t) => t.sessionId === e.id ? {
|
|
404
442
|
...t,
|
|
405
443
|
terminalUrl: n,
|
|
406
444
|
loading: !1,
|
|
407
|
-
error: n ? null :
|
|
445
|
+
error: n ? null : S("sessions.terminalStartedNoUrl", "Terminal started but no URL was returned. Try restarting.")
|
|
408
446
|
} : t));
|
|
409
447
|
}).catch((t) => {
|
|
410
|
-
let n = t instanceof Error ? t.message :
|
|
411
|
-
|
|
448
|
+
let n = t instanceof Error ? t.message : S("sessions.failedStartTerminal", "Failed to start terminal");
|
|
449
|
+
U((t) => t.map((t) => t.sessionId === e.id ? {
|
|
412
450
|
...t,
|
|
413
451
|
loading: !1,
|
|
414
452
|
error: n
|
|
@@ -416,156 +454,167 @@ function ct() {
|
|
|
416
454
|
});
|
|
417
455
|
}
|
|
418
456
|
}, [
|
|
419
|
-
|
|
457
|
+
V,
|
|
420
458
|
X,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
459
|
+
H,
|
|
460
|
+
K,
|
|
461
|
+
q
|
|
424
462
|
]);
|
|
425
|
-
let Z =
|
|
426
|
-
if (
|
|
427
|
-
let t =
|
|
463
|
+
let Z = m(() => X.filter((e) => {
|
|
464
|
+
if (C) {
|
|
465
|
+
let t = C.toLowerCase();
|
|
428
466
|
if (!(e.name.toLowerCase().includes(t) || e.command?.toLowerCase().includes(t) || e.workingDirectory?.toLowerCase().includes(t))) return !1;
|
|
429
467
|
}
|
|
430
|
-
return !(
|
|
468
|
+
return !(E === "none" && e.vibeId || O !== "all" && e.agent?.target?.id !== O);
|
|
431
469
|
}), [
|
|
432
470
|
X,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
471
|
+
C,
|
|
472
|
+
E,
|
|
473
|
+
O
|
|
474
|
+
]), kr = m(() => Ie(Z, k), [Z, k]), Ar = f((e) => {
|
|
475
|
+
R((t) => {
|
|
476
|
+
let n = new Set(t);
|
|
477
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
478
|
+
});
|
|
479
|
+
}, []), jr = f(() => {
|
|
480
|
+
R(new Set(Z.map((e) => e.id)));
|
|
481
|
+
}, [Z]), Mr = f(() => {
|
|
482
|
+
R(/* @__PURE__ */ new Set());
|
|
483
|
+
}, []), Nr = f((e) => {
|
|
484
|
+
R((t) => {
|
|
485
|
+
let n = new Set(t);
|
|
486
|
+
return e.length > 0 && e.every((e) => n.has(e)) ? e.forEach((e) => n.delete(e)) : e.forEach((e) => n.add(e)), n;
|
|
487
|
+
});
|
|
488
|
+
}, []), Pr = f((e) => {
|
|
489
|
+
Lt((t) => {
|
|
437
490
|
let n = new Set(t);
|
|
438
491
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
439
492
|
});
|
|
440
|
-
}, []),
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
M(/* @__PURE__ */ new Set());
|
|
444
|
-
}, []), ar = Z.length > 0 && j.size === Z.length, or = j.size > 0, sr = d(async () => {
|
|
445
|
-
if (j.size !== 0) {
|
|
446
|
-
N(!0);
|
|
493
|
+
}, []), Fr = Z.length > 0 && L.size === Z.length, Ir = L.size > 0, Lr = f(async () => {
|
|
494
|
+
if (L.size !== 0) {
|
|
495
|
+
z(!0);
|
|
447
496
|
try {
|
|
448
|
-
let e = (await
|
|
449
|
-
|
|
497
|
+
let e = (await ir({ variables: { ids: Array.from(L) } })).data?.bulkStopSessions;
|
|
498
|
+
I(`${S("sessions.stopped", "Stopped")} ${e?.succeeded ?? 0} ${S("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${S("sessions.failed", "failed")}` : ""}`), R(/* @__PURE__ */ new Set()), setTimeout(() => I(null), 3e3);
|
|
450
499
|
} catch (e) {
|
|
451
|
-
|
|
500
|
+
I(`${S("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : S("sessions.failedStop", "Failed to stop sessions")}`), setTimeout(() => I(null), 5e3);
|
|
452
501
|
} finally {
|
|
453
|
-
|
|
502
|
+
z(!1);
|
|
454
503
|
}
|
|
455
504
|
}
|
|
456
505
|
}, [
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
]),
|
|
461
|
-
if (
|
|
462
|
-
|
|
506
|
+
L,
|
|
507
|
+
ir,
|
|
508
|
+
S
|
|
509
|
+
]), Rr = f(async () => {
|
|
510
|
+
if (L.size !== 0) {
|
|
511
|
+
z(!0);
|
|
463
512
|
try {
|
|
464
|
-
let e = (await
|
|
465
|
-
|
|
513
|
+
let e = (await ar({ variables: { ids: Array.from(L) } })).data?.bulkRestartSessions;
|
|
514
|
+
I(`${S("sessions.restarted", "Restarted")} ${e?.succeeded ?? 0} ${S("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${S("sessions.failed", "failed")}` : ""}`), R(/* @__PURE__ */ new Set()), setTimeout(() => I(null), 3e3);
|
|
466
515
|
} catch (e) {
|
|
467
|
-
|
|
516
|
+
I(`${S("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : S("sessions.failedRestart", "Failed to restart sessions")}`), setTimeout(() => I(null), 5e3);
|
|
468
517
|
} finally {
|
|
469
|
-
|
|
518
|
+
z(!1);
|
|
470
519
|
}
|
|
471
520
|
}
|
|
472
521
|
}, [
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
]),
|
|
477
|
-
if (
|
|
478
|
-
|
|
522
|
+
L,
|
|
523
|
+
ar,
|
|
524
|
+
S
|
|
525
|
+
]), zr = f(async () => {
|
|
526
|
+
if (L.size !== 0 && confirm(`${S("sessions.confirmRemovePrefix", "Are you sure you want to remove")} ${L.size} ${S("nav.sessions", "session(s)")}? ${S("sessions.confirmRemoveSuffix", "This cannot be undone.")}`)) {
|
|
527
|
+
z(!0);
|
|
479
528
|
try {
|
|
480
|
-
let e = (await
|
|
481
|
-
|
|
529
|
+
let e = (await or({ variables: { ids: Array.from(L) } })).data?.bulkTerminateSessions;
|
|
530
|
+
I(`${S("sessions.removed", "Removed")} ${e?.succeeded ?? 0} ${S("nav.sessions", "sessions")}${e?.failed ? `, ${e.failed} ${S("sessions.failed", "failed")}` : ""}`), R(/* @__PURE__ */ new Set()), setTimeout(() => I(null), 3e3);
|
|
482
531
|
} catch (e) {
|
|
483
|
-
|
|
532
|
+
I(`${S("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : S("sessions.failedRemove", "Failed to remove sessions")}`), setTimeout(() => I(null), 5e3);
|
|
484
533
|
} finally {
|
|
485
|
-
|
|
534
|
+
z(!1);
|
|
486
535
|
}
|
|
487
536
|
}
|
|
488
537
|
}, [
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
]),
|
|
493
|
-
|
|
538
|
+
L,
|
|
539
|
+
or,
|
|
540
|
+
S
|
|
541
|
+
]), Br = f(async (e = "CSV") => {
|
|
542
|
+
Kt(!0);
|
|
494
543
|
try {
|
|
495
|
-
let t = (await
|
|
544
|
+
let t = (await sr({ variables: { input: {
|
|
496
545
|
filter: {
|
|
497
|
-
status:
|
|
498
|
-
type:
|
|
499
|
-
vibeId:
|
|
500
|
-
agentId:
|
|
546
|
+
status: w === "all" ? void 0 : w,
|
|
547
|
+
type: T === "all" ? void 0 : T,
|
|
548
|
+
vibeId: E !== "all" && E !== "none" ? E : void 0,
|
|
549
|
+
agentId: D === "all" ? void 0 : D
|
|
501
550
|
},
|
|
502
551
|
format: e
|
|
503
552
|
} } })).data?.exportSessions;
|
|
504
553
|
if (!t) return;
|
|
505
|
-
let n = e === "CSV" ? "text/csv" : "application/json", r = new Blob([t.data], { type: n }), i = URL.createObjectURL(r),
|
|
506
|
-
|
|
554
|
+
let n = e === "CSV" ? "text/csv" : "application/json", r = new Blob([t.data], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
555
|
+
a.href = i, a.download = `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.${e.toLowerCase()}`, a.click(), URL.revokeObjectURL(i), I(S("sessions.exportSuccess", "Exported {{count}} sessions as {{format}}", {
|
|
507
556
|
count: t.count,
|
|
508
557
|
format: e
|
|
509
|
-
})), setTimeout(() =>
|
|
558
|
+
})), setTimeout(() => I(null), 3e3);
|
|
510
559
|
} catch (e) {
|
|
511
|
-
|
|
560
|
+
I(`${S("sessions.errorPrefix", "Error")}: ${e instanceof Error ? e.message : S("sessions.failedExport", "Failed to export sessions")}`), setTimeout(() => I(null), 5e3);
|
|
512
561
|
} finally {
|
|
513
|
-
|
|
562
|
+
Kt(!1);
|
|
514
563
|
}
|
|
515
564
|
}, [
|
|
516
|
-
|
|
517
|
-
x,
|
|
518
|
-
S,
|
|
519
|
-
C,
|
|
565
|
+
sr,
|
|
520
566
|
w,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
567
|
+
T,
|
|
568
|
+
E,
|
|
569
|
+
D,
|
|
570
|
+
S
|
|
571
|
+
]), Vr = (e) => {
|
|
572
|
+
b(`/sessions/${e.id}`);
|
|
573
|
+
}, Hr = () => {
|
|
574
|
+
F(null), N(!0);
|
|
575
|
+
}, Ur = async () => {
|
|
576
|
+
let e = Jt.current?.value?.trim(), t = Qt, n = en, r = B, i = Yt.current?.value?.trim(), a = Xt.current?.checked ?? !1;
|
|
528
577
|
if (!e) {
|
|
529
|
-
|
|
578
|
+
F(S("sessions.nameRequired", "Name is required"));
|
|
530
579
|
return;
|
|
531
580
|
}
|
|
532
|
-
let
|
|
533
|
-
if (n && (!t ||
|
|
534
|
-
|
|
581
|
+
let o = hr.find((e) => e.id === t)?.agents ?? [], s = null;
|
|
582
|
+
if (n && (!t || o.some((e) => e.id === n)) ? s = n : o.length === 1 && (s = o[0]?.id ?? null), !s) {
|
|
583
|
+
F(t && o.length === 0 ? S("sessions.noAgentAttached", "This vibe has no agents attached. Attach one from the Vibe → Agents tab before creating sessions.") : t && o.length > 1 ? S("sessions.pickAgentFromVibe", "This vibe has multiple agents attached. Pick one before creating the session.") : S("sessions.agentRequired", "Please select an agent for this session."));
|
|
535
584
|
return;
|
|
536
585
|
}
|
|
537
|
-
let
|
|
538
|
-
if (
|
|
539
|
-
|
|
586
|
+
let c = yr.get(s);
|
|
587
|
+
if (c && !c.healthy) {
|
|
588
|
+
F(S("sessions.agentNotHealthy", "The selected agent isn’t fully reachable right now. Please wait for the agent badge to turn green and retry.") + (c.error ? ` (${c.error})` : ""));
|
|
540
589
|
return;
|
|
541
590
|
}
|
|
542
|
-
|
|
591
|
+
Ht(!0), F(null);
|
|
543
592
|
try {
|
|
544
|
-
let n =
|
|
593
|
+
let n = Zt.current?.value?.trim() || void 0, o = await Fn({ variables: { input: {
|
|
545
594
|
name: e,
|
|
546
595
|
type: r || "TMUX",
|
|
547
596
|
command: i || void 0,
|
|
548
597
|
vibeId: t || void 0,
|
|
549
|
-
agentId:
|
|
550
|
-
profile:
|
|
551
|
-
autoStart:
|
|
598
|
+
agentId: s,
|
|
599
|
+
profile: nn?.trim() || "default",
|
|
600
|
+
autoStart: a,
|
|
552
601
|
externalSessionName: n
|
|
553
602
|
} } });
|
|
554
|
-
if (
|
|
555
|
-
|
|
603
|
+
if (o.error && l(o.error)) {
|
|
604
|
+
N(!1), u(), P(!0);
|
|
556
605
|
return;
|
|
557
606
|
}
|
|
558
|
-
if (
|
|
559
|
-
|
|
607
|
+
if (o.error) {
|
|
608
|
+
F(o.error.message || S("sessions.failedCreate", "Failed to create session"));
|
|
560
609
|
return;
|
|
561
610
|
}
|
|
562
|
-
let
|
|
563
|
-
if (!
|
|
564
|
-
|
|
611
|
+
let c = o.data?.createSession?.id;
|
|
612
|
+
if (!c) {
|
|
613
|
+
F(S("sessions.failedCreate", "Failed to create session"));
|
|
565
614
|
return;
|
|
566
615
|
}
|
|
567
|
-
if (
|
|
568
|
-
let e =
|
|
616
|
+
if (N(!1), I(S("sessions.createdSuccess", "Session created successfully")), await Ln(c), setTimeout(() => I(null), 3e3), o.data?.createSession) {
|
|
617
|
+
let e = o.data.createSession, t = e.agentId ? mr.find((t) => t.id === e.agentId) : null;
|
|
569
618
|
Q({
|
|
570
619
|
id: e.id,
|
|
571
620
|
workspaceId: e.workspaceId,
|
|
@@ -597,59 +646,59 @@ function ct() {
|
|
|
597
646
|
});
|
|
598
647
|
}
|
|
599
648
|
} catch (e) {
|
|
600
|
-
if (
|
|
601
|
-
|
|
649
|
+
if (l(e)) {
|
|
650
|
+
N(!1), u(), P(!0);
|
|
602
651
|
return;
|
|
603
652
|
}
|
|
604
|
-
|
|
653
|
+
F(e instanceof Error ? e.message : S("sessions.failedCreate", "Failed to create session"));
|
|
605
654
|
} finally {
|
|
606
|
-
|
|
655
|
+
Ht(!1);
|
|
607
656
|
}
|
|
608
|
-
},
|
|
657
|
+
}, Wr = async (e) => {
|
|
609
658
|
try {
|
|
610
|
-
await
|
|
659
|
+
await Xn({ variables: { id: e.id } }), bt?.({
|
|
611
660
|
id: e.id,
|
|
612
661
|
name: e.name,
|
|
613
662
|
type: e.type,
|
|
614
663
|
status: "RUNNING"
|
|
615
664
|
});
|
|
616
665
|
} catch (e) {
|
|
617
|
-
if (
|
|
618
|
-
|
|
666
|
+
if (l(e)) {
|
|
667
|
+
u(), P(!0);
|
|
619
668
|
return;
|
|
620
669
|
}
|
|
621
670
|
console.error("Failed to start session:", e);
|
|
622
671
|
}
|
|
623
|
-
},
|
|
672
|
+
}, Gr = async (e) => {
|
|
624
673
|
try {
|
|
625
|
-
await
|
|
674
|
+
await Zn({ variables: { id: e.id } });
|
|
626
675
|
} catch (e) {
|
|
627
676
|
console.error("Failed to stop session:", e);
|
|
628
677
|
}
|
|
629
|
-
},
|
|
678
|
+
}, Kr = async (e) => {
|
|
630
679
|
try {
|
|
631
|
-
await
|
|
680
|
+
await Qn({ variables: { id: e.id } });
|
|
632
681
|
} catch (e) {
|
|
633
|
-
if (
|
|
634
|
-
|
|
682
|
+
if (l(e)) {
|
|
683
|
+
u(), P(!0);
|
|
635
684
|
return;
|
|
636
685
|
}
|
|
637
686
|
console.error("Failed to restart session:", e);
|
|
638
687
|
}
|
|
639
|
-
},
|
|
688
|
+
}, qr = async (e) => {
|
|
640
689
|
try {
|
|
641
|
-
await
|
|
690
|
+
await nr({ variables: { id: e.id } });
|
|
642
691
|
} catch (e) {
|
|
643
692
|
console.error("Failed to terminate session:", e);
|
|
644
693
|
}
|
|
645
|
-
},
|
|
646
|
-
|
|
647
|
-
}, []), Q =
|
|
648
|
-
if (
|
|
649
|
-
|
|
694
|
+
}, Jr = f((e) => e.ttydUrl || null, []), Yr = f((e) => {
|
|
695
|
+
Dn(e);
|
|
696
|
+
}, []), Q = f(async (e) => {
|
|
697
|
+
if (H.find((t) => t.sessionId === e.id)?.terminalUrl) {
|
|
698
|
+
G(e.id), Tn(!1);
|
|
650
699
|
return;
|
|
651
700
|
}
|
|
652
|
-
let t =
|
|
701
|
+
let t = Jr(e);
|
|
653
702
|
if (t) {
|
|
654
703
|
let n = {
|
|
655
704
|
sessionId: e.id,
|
|
@@ -660,7 +709,7 @@ function ct() {
|
|
|
660
709
|
loading: !1,
|
|
661
710
|
error: null
|
|
662
711
|
};
|
|
663
|
-
|
|
712
|
+
U((t) => [...t.filter((t) => t.sessionId !== e.id), n]), G(e.id), Tn(!1);
|
|
664
713
|
return;
|
|
665
714
|
}
|
|
666
715
|
let n = {
|
|
@@ -671,562 +720,770 @@ function ct() {
|
|
|
671
720
|
loading: !0,
|
|
672
721
|
error: null
|
|
673
722
|
};
|
|
674
|
-
|
|
723
|
+
U((t) => [...t.filter((t) => t.sessionId !== e.id), n]), G(e.id), Tn(!1);
|
|
675
724
|
try {
|
|
676
|
-
let t = await
|
|
677
|
-
if (t.error &&
|
|
678
|
-
let t =
|
|
679
|
-
|
|
725
|
+
let t = await q({ variables: { id: e.id } });
|
|
726
|
+
if (t.error && l(t.error)) {
|
|
727
|
+
let t = H.filter((t) => t.sessionId !== e.id);
|
|
728
|
+
U(t), W === e.id && G(t.length > 0 ? t[t.length - 1].sessionId : null), u(), P(!0);
|
|
680
729
|
return;
|
|
681
730
|
}
|
|
682
731
|
if (t.error) {
|
|
683
|
-
let n = t.error.message ||
|
|
684
|
-
|
|
732
|
+
let n = t.error.message || S("sessions.failedStartTerminal", "Failed to start terminal");
|
|
733
|
+
U((t) => t.map((t) => t.sessionId === e.id ? {
|
|
685
734
|
...t,
|
|
686
735
|
loading: !1,
|
|
687
736
|
error: n
|
|
688
737
|
} : t));
|
|
689
738
|
return;
|
|
690
739
|
}
|
|
691
|
-
let n =
|
|
692
|
-
|
|
740
|
+
let n = _t(t.data?.startSessionTerminal?.ttydUrl || null, X.find((t) => t.id === e.id)?.agent?.tunnelUrl ?? null);
|
|
741
|
+
U((t) => t.map((t) => t.sessionId === e.id ? {
|
|
693
742
|
...t,
|
|
694
743
|
terminalUrl: n,
|
|
695
744
|
loading: !1,
|
|
696
|
-
error: n ? null :
|
|
745
|
+
error: n ? null : S("sessions.terminalStartedNoTunnelUrl", "Terminal started but no tunnel URL was returned. Try restarting.")
|
|
697
746
|
} : t));
|
|
698
747
|
} catch (t) {
|
|
699
|
-
if (
|
|
700
|
-
let t =
|
|
701
|
-
|
|
748
|
+
if (l(t)) {
|
|
749
|
+
let t = H.filter((t) => t.sessionId !== e.id);
|
|
750
|
+
U(t), W === e.id && G(t.length > 0 ? t[t.length - 1].sessionId : null), u(), P(!0);
|
|
702
751
|
return;
|
|
703
752
|
}
|
|
704
|
-
let n = t instanceof Error ? t.message :
|
|
705
|
-
|
|
753
|
+
let n = t instanceof Error ? t.message : S("sessions.failedStartTerminal", "Failed to start terminal");
|
|
754
|
+
U((t) => t.map((t) => t.sessionId === e.id ? {
|
|
706
755
|
...t,
|
|
707
756
|
loading: !1,
|
|
708
757
|
error: n
|
|
709
758
|
} : t));
|
|
710
759
|
}
|
|
711
760
|
}, [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
761
|
+
W,
|
|
762
|
+
H,
|
|
763
|
+
Jr,
|
|
764
|
+
q
|
|
716
765
|
]);
|
|
717
|
-
|
|
718
|
-
if (!
|
|
719
|
-
let e = X.find((e) => e.id ===
|
|
766
|
+
p(() => {
|
|
767
|
+
if (!K || !W || H.some((e) => e.sessionId === W)) return;
|
|
768
|
+
let e = X.find((e) => e.id === W);
|
|
720
769
|
e && Q(e);
|
|
721
770
|
}, [
|
|
722
|
-
|
|
771
|
+
W,
|
|
723
772
|
Q,
|
|
724
773
|
X,
|
|
725
|
-
|
|
726
|
-
|
|
774
|
+
H,
|
|
775
|
+
K
|
|
727
776
|
]);
|
|
728
|
-
let
|
|
729
|
-
|
|
730
|
-
let t =
|
|
777
|
+
let Xr = f((e) => {
|
|
778
|
+
U((t) => t.filter((t) => t.sessionId !== e)), W === e && G(() => {
|
|
779
|
+
let t = H.filter((t) => t.sessionId !== e);
|
|
731
780
|
return t.length > 0 ? t[t.length - 1].sessionId : null;
|
|
732
781
|
});
|
|
733
|
-
}, [
|
|
734
|
-
let t =
|
|
782
|
+
}, [W, H]), Zr = f((e) => {
|
|
783
|
+
let t = H.find((t) => t.sessionId === e);
|
|
735
784
|
t?.terminalUrl && window.open(t.terminalUrl, "_blank");
|
|
736
|
-
}, [
|
|
785
|
+
}, [H]), Qr = f(async (e, t) => {
|
|
737
786
|
try {
|
|
738
|
-
await
|
|
787
|
+
await tr({ variables: {
|
|
739
788
|
id: e,
|
|
740
789
|
input: { name: t }
|
|
741
|
-
} }),
|
|
790
|
+
} }), U((n) => n.map((n) => n.sessionId === e ? {
|
|
742
791
|
...n,
|
|
743
792
|
name: t
|
|
744
793
|
} : n));
|
|
745
794
|
} catch (e) {
|
|
746
795
|
console.error("Failed to rename session:", e);
|
|
747
796
|
}
|
|
748
|
-
}, [
|
|
797
|
+
}, [tr]), $r = f(async (e) => {
|
|
749
798
|
try {
|
|
750
|
-
await
|
|
799
|
+
await $n({ variables: { id: e } }), U((t) => t.map((t) => t.sessionId === e ? {
|
|
751
800
|
...t,
|
|
752
801
|
terminalUrl: null,
|
|
753
|
-
error:
|
|
802
|
+
error: S("sessions.terminalStopped", "Terminal stopped")
|
|
754
803
|
} : t));
|
|
755
804
|
} catch (e) {
|
|
756
805
|
console.error("Failed to stop terminal:", e);
|
|
757
806
|
}
|
|
758
|
-
}, [
|
|
759
|
-
let t =
|
|
807
|
+
}, [$n]), ei = f(async (e) => {
|
|
808
|
+
let t = H.find((t) => t.sessionId === e) || null;
|
|
760
809
|
try {
|
|
761
|
-
|
|
810
|
+
U((t) => t.map((t) => t.sessionId === e ? {
|
|
762
811
|
...t,
|
|
763
812
|
loading: !0,
|
|
764
813
|
error: null,
|
|
765
814
|
terminalUrl: null
|
|
766
815
|
} : t));
|
|
767
|
-
let n = await
|
|
768
|
-
if (n.error &&
|
|
769
|
-
|
|
816
|
+
let n = await er({ variables: { id: e } });
|
|
817
|
+
if (n.error && l(n.error)) {
|
|
818
|
+
U((n) => n.map((n) => n.sessionId === e ? {
|
|
770
819
|
...n,
|
|
771
820
|
loading: !1,
|
|
772
821
|
error: null,
|
|
773
822
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
774
|
-
} : n)),
|
|
823
|
+
} : n)), u(), P(!0);
|
|
775
824
|
return;
|
|
776
825
|
}
|
|
777
826
|
let r = n.data?.restartSessionTerminal?.ttydUrl || null;
|
|
778
|
-
|
|
827
|
+
U((t) => t.map((t) => t.sessionId === e ? {
|
|
779
828
|
...t,
|
|
780
829
|
terminalUrl: r,
|
|
781
830
|
loading: !1,
|
|
782
|
-
error: r ? null :
|
|
831
|
+
error: r ? null : S("sessions.terminalRestartedNoUrl", "Terminal restarted but no URL returned.")
|
|
783
832
|
} : t));
|
|
784
833
|
} catch (n) {
|
|
785
|
-
if (
|
|
786
|
-
|
|
834
|
+
if (l(n)) {
|
|
835
|
+
U((n) => n.map((n) => n.sessionId === e ? {
|
|
787
836
|
...n,
|
|
788
837
|
loading: !1,
|
|
789
838
|
error: null,
|
|
790
839
|
terminalUrl: t?.terminalUrl ?? n.terminalUrl
|
|
791
|
-
} : n)),
|
|
840
|
+
} : n)), u(), P(!0);
|
|
792
841
|
return;
|
|
793
842
|
}
|
|
794
|
-
let r = n instanceof Error ? n.message :
|
|
795
|
-
|
|
843
|
+
let r = n instanceof Error ? n.message : S("sessions.failedRestartTerminal", "Failed to restart terminal");
|
|
844
|
+
U((t) => t.map((t) => t.sessionId === e ? {
|
|
796
845
|
...t,
|
|
797
846
|
loading: !1,
|
|
798
847
|
error: r
|
|
799
848
|
} : t));
|
|
800
849
|
}
|
|
801
|
-
}, [
|
|
802
|
-
|
|
803
|
-
|
|
850
|
+
}, [er, H]), ti = f(async (e) => {
|
|
851
|
+
let t = X.find((t) => t.id === e);
|
|
852
|
+
try {
|
|
853
|
+
let n = await q({ variables: { id: e } });
|
|
854
|
+
if (n.error) return;
|
|
855
|
+
let r = _t(n.data?.startSessionTerminal?.ttydUrl || null, t?.agent?.tunnelUrl ?? null);
|
|
856
|
+
r && U((t) => t.map((t) => t.sessionId === e ? {
|
|
857
|
+
...t,
|
|
858
|
+
terminalUrl: r,
|
|
859
|
+
loading: !1,
|
|
860
|
+
error: null
|
|
861
|
+
} : t));
|
|
862
|
+
} catch {}
|
|
863
|
+
}, [X, q]), ni = f((e) => {
|
|
864
|
+
U((t) => {
|
|
865
|
+
let n = new Map(t.map((e) => [e.sessionId, e])), r = e.map((e) => n.get(e)).filter((e) => !!e);
|
|
866
|
+
for (let n of t) e.includes(n.sessionId) || r.push(n);
|
|
867
|
+
return r;
|
|
868
|
+
});
|
|
869
|
+
}, []), ri = f((e) => {
|
|
870
|
+
U((t) => t.map((t) => t.sessionId === e ? {
|
|
871
|
+
...t,
|
|
872
|
+
pinned: !t.pinned
|
|
873
|
+
} : t));
|
|
874
|
+
}, []), ii = f(() => {
|
|
875
|
+
kn((e) => !e);
|
|
876
|
+
}, []), $ = m(() => X.find((e) => e.id === W) ?? null, [X, W]), ai = f(() => {
|
|
877
|
+
qt.current?.querySelector("input")?.focus();
|
|
878
|
+
}, []), oi = f(() => {
|
|
879
|
+
M((e) => e === "terminal" ? "grid" : e === "grid" ? "list" : "terminal");
|
|
880
|
+
}, []), si = f(() => {
|
|
881
|
+
$?.agent?.id && b(`/agents/${$.agent.id}`);
|
|
882
|
+
}, [$, b]), ci = f(() => {
|
|
883
|
+
$?.agent?.target?.id && b(`/targets/${$.agent.target.id}`);
|
|
884
|
+
}, [$, b]), li = f(() => {
|
|
885
|
+
W && ti(W);
|
|
886
|
+
}, [W, ti]), ui = f(() => {
|
|
887
|
+
W && Xr(W);
|
|
888
|
+
}, [W, Xr]), di = f(() => {
|
|
889
|
+
Cn(!0);
|
|
890
|
+
}, []), fi = f(() => {
|
|
891
|
+
yn(!vn);
|
|
892
|
+
}, [vn, yn]), pi = m(() => Le({
|
|
893
|
+
newSession: () => N(!0),
|
|
894
|
+
closeActiveTab: ui,
|
|
895
|
+
openPalette: di,
|
|
896
|
+
openCheatsheet: () => xn(!0),
|
|
897
|
+
focusSearch: ai,
|
|
898
|
+
cycleView: oi,
|
|
899
|
+
groupByNone: () => A("none"),
|
|
900
|
+
groupByAgent: () => A("agent"),
|
|
901
|
+
groupByTarget: () => A("target"),
|
|
902
|
+
groupByVibe: () => A("vibe"),
|
|
903
|
+
groupByStatus: () => A("status"),
|
|
904
|
+
reconnectActive: li,
|
|
905
|
+
toggleFullscreen: ii,
|
|
906
|
+
toggleInfoPanel: fi,
|
|
907
|
+
openActiveAgent: si,
|
|
908
|
+
openActiveTarget: ci
|
|
909
|
+
}, S), [
|
|
910
|
+
ui,
|
|
911
|
+
di,
|
|
912
|
+
ai,
|
|
913
|
+
oi,
|
|
914
|
+
li,
|
|
915
|
+
ii,
|
|
916
|
+
fi,
|
|
917
|
+
si,
|
|
918
|
+
ci,
|
|
919
|
+
S
|
|
920
|
+
]), mi = h(null);
|
|
921
|
+
p(() => {
|
|
922
|
+
let e = (e) => {
|
|
923
|
+
let t = e.target, n = t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable, r = e.metaKey || e.ctrlKey;
|
|
924
|
+
if (r && ["k", "p"].includes(e.key.toLowerCase())) {
|
|
925
|
+
e.preventDefault(), di();
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (n) return;
|
|
929
|
+
let i = Date.now(), a = mi.current;
|
|
930
|
+
if (a && a.key === "g" && i - a.at < 1e3) switch (mi.current = null, e.key) {
|
|
931
|
+
case "a":
|
|
932
|
+
e.preventDefault(), A("agent");
|
|
933
|
+
return;
|
|
934
|
+
case "t":
|
|
935
|
+
e.preventDefault(), A("target");
|
|
936
|
+
return;
|
|
937
|
+
case "v":
|
|
938
|
+
e.preventDefault(), A("vibe");
|
|
939
|
+
return;
|
|
940
|
+
case "s":
|
|
941
|
+
e.preventDefault(), A("status");
|
|
942
|
+
return;
|
|
943
|
+
case "0":
|
|
944
|
+
e.preventDefault(), A("none");
|
|
945
|
+
return;
|
|
946
|
+
case "A":
|
|
947
|
+
e.preventDefault(), si();
|
|
948
|
+
return;
|
|
949
|
+
case "T":
|
|
950
|
+
e.preventDefault(), ci();
|
|
951
|
+
return;
|
|
952
|
+
default: break;
|
|
953
|
+
}
|
|
954
|
+
if (!r && !e.altKey && e.key === "g") {
|
|
955
|
+
mi.current = {
|
|
956
|
+
key: "g",
|
|
957
|
+
at: i
|
|
958
|
+
};
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (r && e.key.toLowerCase() === "t") {
|
|
962
|
+
e.preventDefault(), N(!0);
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
if (r && e.key.toLowerCase() === "w" && W) {
|
|
966
|
+
e.preventDefault(), ui();
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
if (e.ctrlKey && e.key === "Tab" && !e.shiftKey && H.length > 1) {
|
|
970
|
+
e.preventDefault(), G(H[(H.findIndex((e) => e.sessionId === W) + 1) % H.length].sessionId);
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
if (e.ctrlKey && e.key === "Tab" && e.shiftKey && H.length > 1) {
|
|
974
|
+
e.preventDefault(), G(H[(H.findIndex((e) => e.sessionId === W) - 1 + H.length) % H.length].sessionId);
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
if (r && /^[1-9]$/.test(e.key) && H.length > 0) {
|
|
978
|
+
let t = Number(e.key) - 1;
|
|
979
|
+
t < H.length && (e.preventDefault(), G(H[t].sessionId));
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
if (r && e.key.toLowerCase() === "r" && W) {
|
|
983
|
+
e.preventDefault(), li();
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (r && e.key === "\\") {
|
|
987
|
+
e.preventDefault(), oi();
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
if (!r) {
|
|
991
|
+
if (e.key === "/") {
|
|
992
|
+
e.preventDefault(), ai();
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
if (e.key === "f") {
|
|
996
|
+
e.preventDefault(), ii();
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
if (e.key === "i") {
|
|
1000
|
+
e.preventDefault(), fi();
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
if (e.key === "?") {
|
|
1004
|
+
e.preventDefault(), xn(!0);
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1010
|
+
}, [
|
|
1011
|
+
W,
|
|
1012
|
+
H,
|
|
1013
|
+
ui,
|
|
1014
|
+
li,
|
|
1015
|
+
oi,
|
|
1016
|
+
ai,
|
|
1017
|
+
di,
|
|
1018
|
+
si,
|
|
1019
|
+
ci,
|
|
1020
|
+
fi,
|
|
1021
|
+
ii
|
|
1022
|
+
]);
|
|
1023
|
+
let hi = m(() => {
|
|
1024
|
+
let e = S("sessions.palette.groupActions", "Actions"), t = S("sessions.palette.groupView", "View"), n = S("sessions.palette.groupNav", "Navigation"), r = S("sessions.palette.groupSessions", "Sessions"), i = [
|
|
1025
|
+
{
|
|
1026
|
+
id: "new-session",
|
|
1027
|
+
label: S("sessions.newSession", "New Session"),
|
|
1028
|
+
group: e,
|
|
1029
|
+
icon: /* @__PURE__ */ _(Qe, { className: "size-4" }),
|
|
1030
|
+
shortcut: "⌘/Ctrl T",
|
|
1031
|
+
run: () => N(!0)
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
id: "reconnect",
|
|
1035
|
+
label: S("sessions.palette.reconnect", "Reconnect active terminal"),
|
|
1036
|
+
group: e,
|
|
1037
|
+
icon: /* @__PURE__ */ _(et, { className: "size-4" }),
|
|
1038
|
+
run: li
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
id: "refresh",
|
|
1042
|
+
label: S("common.refresh", "Refresh"),
|
|
1043
|
+
group: e,
|
|
1044
|
+
icon: /* @__PURE__ */ _($e, { className: "size-4" }),
|
|
1045
|
+
run: () => void Y()
|
|
1046
|
+
},
|
|
1047
|
+
...$ ? [{
|
|
1048
|
+
id: "share-active",
|
|
1049
|
+
label: S("sessions.palette.shareActive", "Share / offer active session"),
|
|
1050
|
+
group: e,
|
|
1051
|
+
icon: /* @__PURE__ */ _(nt, { className: "size-4" }),
|
|
1052
|
+
run: () => Dn($)
|
|
1053
|
+
}] : [],
|
|
1054
|
+
{
|
|
1055
|
+
id: "view-terminal",
|
|
1056
|
+
label: S("sessions.palette.viewTerminal", "Switch to terminal view"),
|
|
1057
|
+
group: t,
|
|
1058
|
+
icon: /* @__PURE__ */ _(Ye, { className: "size-4" }),
|
|
1059
|
+
run: () => M("terminal")
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
id: "view-grid",
|
|
1063
|
+
label: S("sessions.palette.viewGrid", "Switch to grid view"),
|
|
1064
|
+
group: t,
|
|
1065
|
+
icon: /* @__PURE__ */ _(We, { className: "size-4" }),
|
|
1066
|
+
run: () => M("grid")
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
id: "view-list",
|
|
1070
|
+
label: S("sessions.palette.viewList", "Switch to list view"),
|
|
1071
|
+
group: t,
|
|
1072
|
+
icon: /* @__PURE__ */ _(Je, { className: "size-4" }),
|
|
1073
|
+
run: () => M("list")
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
id: "group-agent",
|
|
1077
|
+
label: S("sessions.palette.groupByAgent", "Group by agent"),
|
|
1078
|
+
group: t,
|
|
1079
|
+
icon: /* @__PURE__ */ _(tt, { className: "size-4" }),
|
|
1080
|
+
run: () => A("agent")
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
id: "group-target",
|
|
1084
|
+
label: S("sessions.palette.groupByTarget", "Group by target"),
|
|
1085
|
+
group: t,
|
|
1086
|
+
icon: /* @__PURE__ */ _(Xe, { className: "size-4" }),
|
|
1087
|
+
run: () => A("target")
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
id: "group-vibe",
|
|
1091
|
+
label: S("sessions.palette.groupByVibe", "Group by vibe"),
|
|
1092
|
+
group: t,
|
|
1093
|
+
icon: /* @__PURE__ */ _(qe, { className: "size-4" }),
|
|
1094
|
+
run: () => A("vibe")
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
id: "group-none",
|
|
1098
|
+
label: S("sessions.palette.groupClear", "Clear grouping"),
|
|
1099
|
+
group: t,
|
|
1100
|
+
icon: /* @__PURE__ */ _(qe, { className: "size-4" }),
|
|
1101
|
+
run: () => A("none")
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
id: "toggle-info",
|
|
1105
|
+
label: S("sessions.palette.toggleInfo", "Toggle session info panel"),
|
|
1106
|
+
group: t,
|
|
1107
|
+
icon: /* @__PURE__ */ _(Ge, { className: "size-4" }),
|
|
1108
|
+
run: fi
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
id: "shortcuts",
|
|
1112
|
+
label: S("sessions.palette.shortcuts", "Keyboard shortcuts"),
|
|
1113
|
+
group: t,
|
|
1114
|
+
icon: /* @__PURE__ */ _(Ke, { className: "size-4" }),
|
|
1115
|
+
run: () => xn(!0)
|
|
1116
|
+
},
|
|
1117
|
+
...$?.agent ? [{
|
|
1118
|
+
id: "goto-agent",
|
|
1119
|
+
label: S("sessions.palette.gotoAgent", "Open active session's agent"),
|
|
1120
|
+
group: n,
|
|
1121
|
+
icon: /* @__PURE__ */ _(tt, { className: "size-4" }),
|
|
1122
|
+
run: si
|
|
1123
|
+
}] : [],
|
|
1124
|
+
...$?.agent?.target ? [{
|
|
1125
|
+
id: "goto-target",
|
|
1126
|
+
label: S("sessions.palette.gotoTarget", "Open active session's target"),
|
|
1127
|
+
group: n,
|
|
1128
|
+
icon: /* @__PURE__ */ _(Xe, { className: "size-4" }),
|
|
1129
|
+
run: ci
|
|
1130
|
+
}] : []
|
|
1131
|
+
];
|
|
1132
|
+
for (let e of Z.slice(0, 30)) i.push({
|
|
1133
|
+
id: `open-${e.id}`,
|
|
1134
|
+
label: e.name,
|
|
1135
|
+
group: r,
|
|
1136
|
+
icon: /* @__PURE__ */ _(it, { className: "size-4" }),
|
|
1137
|
+
keywords: `${e.status} ${e.agent?.name ?? ""} ${e.agent?.target?.name ?? ""}`,
|
|
1138
|
+
run: () => void Q(e)
|
|
1139
|
+
});
|
|
1140
|
+
return i;
|
|
1141
|
+
}, [
|
|
1142
|
+
S,
|
|
1143
|
+
$,
|
|
1144
|
+
Z,
|
|
1145
|
+
li,
|
|
1146
|
+
Y,
|
|
1147
|
+
fi,
|
|
1148
|
+
si,
|
|
1149
|
+
ci,
|
|
1150
|
+
Q
|
|
1151
|
+
]), gi = {
|
|
804
1152
|
total: X.length,
|
|
805
1153
|
running: X.filter((e) => e.status === "RUNNING").length,
|
|
806
1154
|
stopped: X.filter((e) => e.status === "STOPPED").length
|
|
807
1155
|
};
|
|
808
|
-
if (
|
|
1156
|
+
if (Ct) return /* @__PURE__ */ _(y, {
|
|
809
1157
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
810
|
-
children: /* @__PURE__ */
|
|
1158
|
+
children: /* @__PURE__ */ _(ye, { message: S("sessions.loadingPermissions", "Loading permissions...") })
|
|
811
1159
|
});
|
|
812
|
-
if (
|
|
1160
|
+
if (wt && wt.permissionStrings?.length > 0 && !Ot) return /* @__PURE__ */ _(y, {
|
|
813
1161
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
814
|
-
children: /* @__PURE__ */
|
|
815
|
-
title:
|
|
816
|
-
description:
|
|
817
|
-
details:
|
|
1162
|
+
children: /* @__PURE__ */ _(ft, {
|
|
1163
|
+
title: S("common.accessDeniedTitle", "Access Denied"),
|
|
1164
|
+
description: S("sessions.accessDeniedDescription", "You don't have permission to view sessions."),
|
|
1165
|
+
details: S("sessions.requiredPermission", "Required permission: session:list")
|
|
818
1166
|
})
|
|
819
1167
|
});
|
|
820
|
-
if (
|
|
1168
|
+
if (J && !dr && X.length === 0) return /* @__PURE__ */ _(y, {
|
|
821
1169
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
822
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ _(ye, { message: S("sessions.loading", "Loading sessions...") })
|
|
823
1171
|
});
|
|
824
|
-
if (
|
|
1172
|
+
if (fr && X.length === 0) return /* @__PURE__ */ _(y, {
|
|
825
1173
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
826
|
-
children: /* @__PURE__ */
|
|
827
|
-
title:
|
|
828
|
-
message:
|
|
829
|
-
onRetry: () =>
|
|
1174
|
+
children: /* @__PURE__ */ _(be, {
|
|
1175
|
+
title: S("sessions.failedLoad", "Failed to load sessions"),
|
|
1176
|
+
message: fr.message,
|
|
1177
|
+
onRetry: () => Y()
|
|
830
1178
|
})
|
|
831
1179
|
});
|
|
832
|
-
let
|
|
1180
|
+
let _i = () => !Ir || j === "terminal" ? null : /* @__PURE__ */ v("div", {
|
|
833
1181
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-3 px-4 py-2 bg-action-primary-bg/10 border border-action-primary-bg/20 rounded-lg",
|
|
834
|
-
children: [/* @__PURE__ */
|
|
1182
|
+
children: [/* @__PURE__ */ _("span", {
|
|
835
1183
|
className: "text-sm font-medium text-text-primary",
|
|
836
|
-
children:
|
|
837
|
-
}), /* @__PURE__ */
|
|
1184
|
+
children: S(L.size === 1 ? "sessions.selectionCountSingle" : "sessions.selectionCountPlural", L.size === 1 ? "{{count}} session selected" : "{{count}} sessions selected", { count: L.size })
|
|
1185
|
+
}), /* @__PURE__ */ v("div", {
|
|
838
1186
|
className: "flex items-center gap-1.5 sm:ml-auto flex-wrap",
|
|
839
1187
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ v("button", {
|
|
841
1189
|
type: "button",
|
|
842
|
-
onClick:
|
|
843
|
-
disabled:
|
|
1190
|
+
onClick: Lr,
|
|
1191
|
+
disabled: Wt,
|
|
844
1192
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-primary bg-bg-surface border border-border-default rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
845
1193
|
children: [
|
|
846
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ _(rt, { className: "size-3" }),
|
|
847
1195
|
" ",
|
|
848
|
-
|
|
1196
|
+
S("sessions.stop", "Stop")
|
|
849
1197
|
]
|
|
850
1198
|
}),
|
|
851
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ v("button", {
|
|
852
1200
|
type: "button",
|
|
853
|
-
onClick:
|
|
854
|
-
disabled:
|
|
1201
|
+
onClick: Rr,
|
|
1202
|
+
disabled: Wt,
|
|
855
1203
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-text-primary bg-bg-surface border border-border-default rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
856
1204
|
children: [
|
|
857
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ _(et, { className: "size-3" }),
|
|
858
1206
|
" ",
|
|
859
|
-
|
|
1207
|
+
S("sessions.restart", "Restart")
|
|
860
1208
|
]
|
|
861
1209
|
}),
|
|
862
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ v("button", {
|
|
863
1211
|
type: "button",
|
|
864
|
-
onClick:
|
|
865
|
-
disabled:
|
|
1212
|
+
onClick: zr,
|
|
1213
|
+
disabled: Wt,
|
|
866
1214
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-status-error-text bg-status-error-bg border border-status-error-text/20 rounded-md hover:bg-status-error-bg/80 transition-colors disabled:opacity-50",
|
|
867
1215
|
children: [
|
|
868
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ _(at, { className: "size-3" }),
|
|
869
1217
|
" ",
|
|
870
|
-
|
|
1218
|
+
S("sessions.remove", "Remove")
|
|
871
1219
|
]
|
|
872
1220
|
}),
|
|
873
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ v("button", {
|
|
874
1222
|
type: "button",
|
|
875
|
-
onClick:
|
|
1223
|
+
onClick: Mr,
|
|
876
1224
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
877
1225
|
children: [
|
|
878
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ _(ot, { className: "size-3" }),
|
|
879
1227
|
" ",
|
|
880
|
-
|
|
1228
|
+
S("sessions.deselect", "Deselect")
|
|
881
1229
|
]
|
|
882
1230
|
})
|
|
883
1231
|
]
|
|
884
1232
|
})]
|
|
885
|
-
}),
|
|
1233
|
+
}), vi = /* @__PURE__ */ v("div", {
|
|
886
1234
|
className: "flex items-center gap-0.5 rounded-md bg-bg-sunken p-0.5 flex-shrink-0",
|
|
887
1235
|
children: [
|
|
888
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ _("button", {
|
|
889
1237
|
type: "button",
|
|
890
|
-
onClick: () =>
|
|
891
|
-
className: `p-1.5 rounded ${
|
|
892
|
-
title:
|
|
893
|
-
"aria-label":
|
|
894
|
-
children: /* @__PURE__ */
|
|
1238
|
+
onClick: () => M("terminal"),
|
|
1239
|
+
className: `p-1.5 rounded ${j === "terminal" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
1240
|
+
title: S("sessions.terminalViewTitle", "Terminal view"),
|
|
1241
|
+
"aria-label": S("sessions.terminalViewTitle", "Terminal view"),
|
|
1242
|
+
children: /* @__PURE__ */ _(Ye, { className: "size-4 text-text-secondary" })
|
|
895
1243
|
}),
|
|
896
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ _("button", {
|
|
897
1245
|
type: "button",
|
|
898
|
-
onClick: () =>
|
|
899
|
-
className: `p-1.5 rounded ${
|
|
900
|
-
title:
|
|
901
|
-
"aria-label":
|
|
902
|
-
children: /* @__PURE__ */
|
|
1246
|
+
onClick: () => M("grid"),
|
|
1247
|
+
className: `p-1.5 rounded ${j === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
1248
|
+
title: S("sessions.gridViewTitle", "Grid view"),
|
|
1249
|
+
"aria-label": S("sessions.gridViewTitle", "Grid view"),
|
|
1250
|
+
children: /* @__PURE__ */ _(We, { className: "size-4 text-text-secondary" })
|
|
903
1251
|
}),
|
|
904
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ _("button", {
|
|
905
1253
|
type: "button",
|
|
906
|
-
onClick: () =>
|
|
907
|
-
className: `p-1.5 rounded ${
|
|
908
|
-
title:
|
|
909
|
-
"aria-label":
|
|
910
|
-
children: /* @__PURE__ */
|
|
1254
|
+
onClick: () => M("list"),
|
|
1255
|
+
className: `p-1.5 rounded ${j === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
1256
|
+
title: S("sessions.listViewTitle", "List view"),
|
|
1257
|
+
"aria-label": S("sessions.listViewTitle", "List view"),
|
|
1258
|
+
children: /* @__PURE__ */ _(Je, { className: "size-4 text-text-secondary" })
|
|
911
1259
|
})
|
|
912
1260
|
]
|
|
913
|
-
}),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
session:
|
|
918
|
-
isOpen: !!
|
|
919
|
-
onClose: () =>
|
|
1261
|
+
}), yi = /* @__PURE__ */ v(ut, { children: [
|
|
1262
|
+
Rt && Ci(),
|
|
1263
|
+
Si(),
|
|
1264
|
+
En && /* @__PURE__ */ _(Pe, {
|
|
1265
|
+
session: En,
|
|
1266
|
+
isOpen: !!En,
|
|
1267
|
+
onClose: () => Dn(null)
|
|
920
1268
|
}),
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
isOpen:
|
|
923
|
-
onClose: () =>
|
|
1269
|
+
/* @__PURE__ */ _(fe, {
|
|
1270
|
+
isOpen: zt,
|
|
1271
|
+
onClose: () => P(!1),
|
|
924
1272
|
onConfirm: () => {
|
|
925
|
-
|
|
1273
|
+
P(!1), b("/billing/plans");
|
|
926
1274
|
},
|
|
927
|
-
title:
|
|
928
|
-
message:
|
|
1275
|
+
title: pe("session").title,
|
|
1276
|
+
message: pe("session").message,
|
|
929
1277
|
confirmLabel: "View Billing",
|
|
930
1278
|
cancelLabel: "Dismiss",
|
|
931
1279
|
variant: "warning"
|
|
1280
|
+
}),
|
|
1281
|
+
/* @__PURE__ */ _(Re, {
|
|
1282
|
+
isOpen: bn,
|
|
1283
|
+
onClose: () => xn(!1),
|
|
1284
|
+
shortcuts: pi
|
|
1285
|
+
}),
|
|
1286
|
+
/* @__PURE__ */ _(ze, {
|
|
1287
|
+
open: Sn,
|
|
1288
|
+
onOpenChange: Cn,
|
|
1289
|
+
commands: hi
|
|
1290
|
+
}),
|
|
1291
|
+
/* @__PURE__ */ _(Be, {
|
|
1292
|
+
open: vn,
|
|
1293
|
+
onOpenChange: yn,
|
|
1294
|
+
session: $
|
|
932
1295
|
})
|
|
933
1296
|
] });
|
|
934
|
-
if (
|
|
1297
|
+
if (j === "terminal") return /* @__PURE__ */ v(y, {
|
|
935
1298
|
className: "flex flex-col bg-bg-surface h-screen",
|
|
936
1299
|
children: [
|
|
937
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ v("div", {
|
|
938
1301
|
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",
|
|
939
|
-
children: [/* @__PURE__ */
|
|
1302
|
+
children: [/* @__PURE__ */ v("div", {
|
|
940
1303
|
className: "flex flex-wrap items-center gap-3",
|
|
941
|
-
children: [/* @__PURE__ */
|
|
1304
|
+
children: [/* @__PURE__ */ _("h1", {
|
|
942
1305
|
className: "text-sm font-semibold text-text-primary",
|
|
943
|
-
children:
|
|
944
|
-
}), /* @__PURE__ */
|
|
1306
|
+
children: S("nav.sessions", "Sessions")
|
|
1307
|
+
}), /* @__PURE__ */ _("span", {
|
|
945
1308
|
className: "text-xs text-text-muted",
|
|
946
|
-
children:
|
|
947
|
-
running:
|
|
948
|
-
total:
|
|
1309
|
+
children: S("sessions.runningSummary", "{{running}} running / {{total}} total", {
|
|
1310
|
+
running: gi.running,
|
|
1311
|
+
total: gi.total
|
|
949
1312
|
})
|
|
950
1313
|
})]
|
|
951
|
-
}), /* @__PURE__ */
|
|
1314
|
+
}), /* @__PURE__ */ v("div", {
|
|
952
1315
|
className: "flex w-full flex-wrap items-center gap-2 sm:w-auto sm:justify-end",
|
|
953
1316
|
children: [
|
|
954
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ _("button", {
|
|
955
1318
|
type: "button",
|
|
956
|
-
onClick: () =>
|
|
1319
|
+
onClick: () => rr().then(() => Y()),
|
|
957
1320
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors",
|
|
958
|
-
title:
|
|
959
|
-
children: /* @__PURE__ */
|
|
1321
|
+
title: S("sessions.checkHealth", "Check session health"),
|
|
1322
|
+
children: /* @__PURE__ */ _(He, { className: "size-3.5" })
|
|
960
1323
|
}),
|
|
961
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ _("button", {
|
|
962
1325
|
type: "button",
|
|
963
1326
|
onClick: () => {
|
|
964
|
-
|
|
1327
|
+
Y(), gr();
|
|
965
1328
|
},
|
|
966
|
-
disabled:
|
|
1329
|
+
disabled: J,
|
|
967
1330
|
className: "p-1.5 text-text-secondary hover:bg-bg-surface rounded transition-colors disabled:opacity-50",
|
|
968
|
-
title:
|
|
969
|
-
children: /* @__PURE__ */
|
|
1331
|
+
title: S("common.refresh", "Refresh"),
|
|
1332
|
+
children: /* @__PURE__ */ _($e, { className: `size-3.5 ${J ? "animate-spin" : ""}` })
|
|
970
1333
|
}),
|
|
971
|
-
|
|
1334
|
+
vi
|
|
972
1335
|
]
|
|
973
1336
|
})]
|
|
974
1337
|
}),
|
|
975
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ _("div", {
|
|
976
1339
|
className: "px-4 pt-3",
|
|
977
|
-
children: /* @__PURE__ */
|
|
1340
|
+
children: /* @__PURE__ */ _(Oe, {
|
|
978
1341
|
showConnectionStatus: !0,
|
|
979
1342
|
maxVisible: 3
|
|
980
1343
|
})
|
|
981
1344
|
}),
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
tabs:
|
|
984
|
-
activeTabId:
|
|
985
|
-
onTabSelect:
|
|
986
|
-
onTabClose:
|
|
987
|
-
onOpenExternal:
|
|
1345
|
+
/* @__PURE__ */ _(Ne, {
|
|
1346
|
+
tabs: H,
|
|
1347
|
+
activeTabId: W,
|
|
1348
|
+
onTabSelect: G,
|
|
1349
|
+
onTabClose: Xr,
|
|
1350
|
+
onOpenExternal: Zr,
|
|
988
1351
|
collapsed: !1,
|
|
989
1352
|
sessions: Z,
|
|
990
1353
|
onOpenTerminal: Q,
|
|
991
1354
|
onRetryTerminal: Q,
|
|
992
|
-
onRenameSession:
|
|
993
|
-
onStopTerminal:
|
|
1355
|
+
onRenameSession: Qr,
|
|
1356
|
+
onStopTerminal: $r,
|
|
994
1357
|
onStopSession: (e) => {
|
|
995
1358
|
let t = X.find((t) => t.id === e);
|
|
996
|
-
t &&
|
|
1359
|
+
t && Gr(t);
|
|
997
1360
|
},
|
|
998
|
-
onRestartTerminal:
|
|
999
|
-
|
|
1361
|
+
onRestartTerminal: ei,
|
|
1362
|
+
onReattachTerminal: ti,
|
|
1363
|
+
onReorderTabs: ni,
|
|
1364
|
+
onTogglePin: ri,
|
|
1365
|
+
onCreateSession: Hr,
|
|
1000
1366
|
fullScreen: !0,
|
|
1001
|
-
isImmersiveFullscreen:
|
|
1002
|
-
onToggleImmersiveFullscreen:
|
|
1367
|
+
isImmersiveFullscreen: On,
|
|
1368
|
+
onToggleImmersiveFullscreen: ii,
|
|
1003
1369
|
contextSwitcher: void 0
|
|
1004
1370
|
}),
|
|
1005
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ v("div", {
|
|
1006
1372
|
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",
|
|
1007
|
-
children: [/* @__PURE__ */
|
|
1373
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1008
1374
|
className: "flex items-center gap-3",
|
|
1009
1375
|
children: [
|
|
1010
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ v("span", {
|
|
1011
1377
|
className: "inline-flex items-center gap-1.5",
|
|
1012
|
-
children: [/* @__PURE__ */
|
|
1378
|
+
children: [/* @__PURE__ */ _("span", {
|
|
1013
1379
|
className: "size-1.5 rounded-full bg-status-success-bg",
|
|
1014
1380
|
"aria-hidden": !0
|
|
1015
|
-
}),
|
|
1381
|
+
}), S("sessions.statusOnline", "Online")]
|
|
1016
1382
|
}),
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
1383
|
+
/* @__PURE__ */ v("span", { children: [
|
|
1384
|
+
H.length,
|
|
1019
1385
|
" ",
|
|
1020
|
-
|
|
1386
|
+
H.length === 1 ? "tab" : "tabs"
|
|
1021
1387
|
] }),
|
|
1022
|
-
|
|
1388
|
+
W && /* @__PURE__ */ _("span", {
|
|
1023
1389
|
className: "truncate max-w-[40ch]",
|
|
1024
|
-
children:
|
|
1390
|
+
children: H.find((e) => e.sessionId === W)?.name
|
|
1025
1391
|
})
|
|
1026
1392
|
]
|
|
1027
|
-
}), /* @__PURE__ */
|
|
1393
|
+
}), /* @__PURE__ */ v("div", {
|
|
1028
1394
|
className: "hidden sm:flex items-center gap-3",
|
|
1029
|
-
children: [/* @__PURE__ */ g("button", {
|
|
1030
|
-
type: "button",
|
|
1031
|
-
onClick: () => en(!0),
|
|
1032
|
-
className: "hover:text-text-secondary transition-colors",
|
|
1033
|
-
children: y("sessions.shortcutsHint", "Press ? for shortcuts")
|
|
1034
|
-
}), /* @__PURE__ */ g("button", {
|
|
1035
|
-
type: "button",
|
|
1036
|
-
onClick: () => {
|
|
1037
|
-
nn(""), V(!0);
|
|
1038
|
-
},
|
|
1039
|
-
className: "hover:text-text-secondary transition-colors",
|
|
1040
|
-
children: y("sessions.paletteHint", "Cmd+P · Command palette")
|
|
1041
|
-
})]
|
|
1042
|
-
})]
|
|
1043
|
-
}),
|
|
1044
|
-
jt && /* @__PURE__ */ g("div", {
|
|
1045
|
-
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg text-status-success-text rounded-md shadow-lg text-sm",
|
|
1046
|
-
children: jt
|
|
1047
|
-
}),
|
|
1048
|
-
Et && Ar(),
|
|
1049
|
-
kr(),
|
|
1050
|
-
$t && /* @__PURE__ */ g("div", {
|
|
1051
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/80 backdrop-blur-sm p-4",
|
|
1052
|
-
role: "dialog",
|
|
1053
|
-
"aria-modal": "true",
|
|
1054
|
-
"aria-labelledby": "sessions-cheatsheet-title",
|
|
1055
|
-
onClick: () => en(!1),
|
|
1056
|
-
children: /* @__PURE__ */ _("div", {
|
|
1057
|
-
className: "bg-bg-surface border border-border-default rounded-xl shadow-2xl p-6 max-w-md w-full",
|
|
1058
|
-
onClick: (e) => e.stopPropagation(),
|
|
1059
1395
|
children: [
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1396
|
+
/* @__PURE__ */ v("button", {
|
|
1397
|
+
type: "button",
|
|
1398
|
+
onClick: () => yn(!vn),
|
|
1399
|
+
className: "inline-flex items-center gap-1 hover:text-text-secondary transition-colors",
|
|
1400
|
+
title: S("sessions.infoPanelHint", "Session info (i)"),
|
|
1401
|
+
children: [/* @__PURE__ */ _(Ge, { className: "size-3" }), S("sessions.infoPanelLabel", "Info")]
|
|
1064
1402
|
}),
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
children: "Cmd / Ctrl + T"
|
|
1071
|
-
}),
|
|
1072
|
-
/* @__PURE__ */ g("dd", {
|
|
1073
|
-
className: "text-text-primary",
|
|
1074
|
-
children: "New session"
|
|
1075
|
-
}),
|
|
1076
|
-
/* @__PURE__ */ g("dt", {
|
|
1077
|
-
className: "font-mono text-text-secondary",
|
|
1078
|
-
children: "Cmd / Ctrl + W"
|
|
1079
|
-
}),
|
|
1080
|
-
/* @__PURE__ */ g("dd", {
|
|
1081
|
-
className: "text-text-primary",
|
|
1082
|
-
children: "Close active tab"
|
|
1083
|
-
}),
|
|
1084
|
-
/* @__PURE__ */ g("dt", {
|
|
1085
|
-
className: "font-mono text-text-secondary",
|
|
1086
|
-
children: "Cmd / Ctrl + 1–9"
|
|
1087
|
-
}),
|
|
1088
|
-
/* @__PURE__ */ g("dd", {
|
|
1089
|
-
className: "text-text-primary",
|
|
1090
|
-
children: "Switch to tab N"
|
|
1091
|
-
}),
|
|
1092
|
-
/* @__PURE__ */ g("dt", {
|
|
1093
|
-
className: "font-mono text-text-secondary",
|
|
1094
|
-
children: "Ctrl + Tab"
|
|
1095
|
-
}),
|
|
1096
|
-
/* @__PURE__ */ g("dd", {
|
|
1097
|
-
className: "text-text-primary",
|
|
1098
|
-
children: "Next tab"
|
|
1099
|
-
}),
|
|
1100
|
-
/* @__PURE__ */ g("dt", {
|
|
1101
|
-
className: "font-mono text-text-secondary",
|
|
1102
|
-
children: "Ctrl + Shift + Tab"
|
|
1103
|
-
}),
|
|
1104
|
-
/* @__PURE__ */ g("dd", {
|
|
1105
|
-
className: "text-text-primary",
|
|
1106
|
-
children: "Previous tab"
|
|
1107
|
-
}),
|
|
1108
|
-
/* @__PURE__ */ g("dt", {
|
|
1109
|
-
className: "font-mono text-text-secondary",
|
|
1110
|
-
children: "Cmd / Ctrl + P"
|
|
1111
|
-
}),
|
|
1112
|
-
/* @__PURE__ */ g("dd", {
|
|
1113
|
-
className: "text-text-primary",
|
|
1114
|
-
children: "Command palette"
|
|
1115
|
-
}),
|
|
1116
|
-
/* @__PURE__ */ g("dt", {
|
|
1117
|
-
className: "font-mono text-text-secondary",
|
|
1118
|
-
children: "?"
|
|
1119
|
-
}),
|
|
1120
|
-
/* @__PURE__ */ g("dd", {
|
|
1121
|
-
className: "text-text-primary",
|
|
1122
|
-
children: "This cheatsheet"
|
|
1123
|
-
})
|
|
1124
|
-
]
|
|
1403
|
+
/* @__PURE__ */ v("button", {
|
|
1404
|
+
type: "button",
|
|
1405
|
+
onClick: () => xn(!0),
|
|
1406
|
+
className: "inline-flex items-center gap-1 hover:text-text-secondary transition-colors",
|
|
1407
|
+
children: [/* @__PURE__ */ _(Ke, { className: "size-3" }), S("sessions.shortcutsHint", "Press ? for shortcuts")]
|
|
1125
1408
|
}),
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
className: "px-3 py-1.5 text-sm rounded-md bg-bg-sunken hover:bg-bg-secondary text-text-primary transition-colors",
|
|
1132
|
-
children: y("common.close", "Close")
|
|
1133
|
-
})
|
|
1409
|
+
/* @__PURE__ */ _("button", {
|
|
1410
|
+
type: "button",
|
|
1411
|
+
onClick: di,
|
|
1412
|
+
className: "hover:text-text-secondary transition-colors",
|
|
1413
|
+
children: S("sessions.paletteHint", "⌘/Ctrl K · Command palette")
|
|
1134
1414
|
})
|
|
1135
1415
|
]
|
|
1136
|
-
})
|
|
1416
|
+
})]
|
|
1137
1417
|
}),
|
|
1138
|
-
|
|
1139
|
-
className: "fixed
|
|
1140
|
-
|
|
1141
|
-
"aria-modal": "true",
|
|
1142
|
-
"aria-labelledby": "sessions-palette-title",
|
|
1143
|
-
onClick: () => V(!1),
|
|
1144
|
-
children: /* @__PURE__ */ _("div", {
|
|
1145
|
-
className: "bg-bg-surface border border-border-default rounded-xl shadow-2xl w-full max-w-lg overflow-hidden",
|
|
1146
|
-
onClick: (e) => e.stopPropagation(),
|
|
1147
|
-
children: [/* @__PURE__ */ g("input", {
|
|
1148
|
-
autoFocus: !0,
|
|
1149
|
-
type: "search",
|
|
1150
|
-
value: H,
|
|
1151
|
-
onChange: (e) => nn(e.target.value),
|
|
1152
|
-
onKeyDown: (e) => {
|
|
1153
|
-
e.key === "Escape" && V(!1);
|
|
1154
|
-
},
|
|
1155
|
-
placeholder: y("sessions.palette.placeholder", "Search sessions or type a command…"),
|
|
1156
|
-
"aria-label": "Command palette search",
|
|
1157
|
-
className: "w-full px-4 py-3 bg-bg-surface border-b border-border-default text-text-primary placeholder:text-text-muted focus:outline-none"
|
|
1158
|
-
}), /* @__PURE__ */ _("ul", {
|
|
1159
|
-
id: "sessions-palette-title",
|
|
1160
|
-
className: "max-h-80 overflow-y-auto divide-y divide-border-subtle",
|
|
1161
|
-
children: [["new"].map((e) => {
|
|
1162
|
-
let t = y("sessions.palette.new", "New session");
|
|
1163
|
-
return H && !t.toLowerCase().includes(H.toLowerCase()) ? null : /* @__PURE__ */ g("li", { children: /* @__PURE__ */ _("button", {
|
|
1164
|
-
type: "button",
|
|
1165
|
-
onClick: () => {
|
|
1166
|
-
V(!1), D(!0);
|
|
1167
|
-
},
|
|
1168
|
-
className: "w-full text-left px-4 py-2.5 text-sm hover:bg-bg-sunken transition-colors",
|
|
1169
|
-
children: [/* @__PURE__ */ g("span", {
|
|
1170
|
-
className: "font-medium text-text-primary",
|
|
1171
|
-
children: t
|
|
1172
|
-
}), /* @__PURE__ */ g("span", {
|
|
1173
|
-
className: "ml-2 text-xs text-text-muted",
|
|
1174
|
-
children: "Cmd+T"
|
|
1175
|
-
})]
|
|
1176
|
-
}) }, e);
|
|
1177
|
-
}), Z.filter((e) => !H || e.name.toLowerCase().includes(H.toLowerCase())).slice(0, 20).map((e) => /* @__PURE__ */ g("li", { children: /* @__PURE__ */ _("button", {
|
|
1178
|
-
type: "button",
|
|
1179
|
-
onClick: () => {
|
|
1180
|
-
V(!1), Q(e);
|
|
1181
|
-
},
|
|
1182
|
-
className: "w-full text-left px-4 py-2.5 text-sm hover:bg-bg-sunken transition-colors flex items-center justify-between",
|
|
1183
|
-
children: [/* @__PURE__ */ g("span", {
|
|
1184
|
-
className: "text-text-primary truncate",
|
|
1185
|
-
children: e.name
|
|
1186
|
-
}), /* @__PURE__ */ g("span", {
|
|
1187
|
-
className: "ml-2 text-xs text-text-muted",
|
|
1188
|
-
children: e.status
|
|
1189
|
-
})]
|
|
1190
|
-
}) }, e.id))]
|
|
1191
|
-
})]
|
|
1192
|
-
})
|
|
1418
|
+
Ut && /* @__PURE__ */ _("div", {
|
|
1419
|
+
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg text-status-success-text rounded-md shadow-lg text-sm",
|
|
1420
|
+
children: Ut
|
|
1193
1421
|
}),
|
|
1194
|
-
|
|
1422
|
+
yi
|
|
1195
1423
|
]
|
|
1196
1424
|
});
|
|
1197
|
-
|
|
1425
|
+
let bi = (e) => /* @__PURE__ */ _(ht, {
|
|
1426
|
+
stagger: .04,
|
|
1427
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
1428
|
+
children: e.map((e) => /* @__PURE__ */ _(mt, { children: /* @__PURE__ */ _(je, {
|
|
1429
|
+
session: e,
|
|
1430
|
+
onOpen: Vr,
|
|
1431
|
+
onStart: Wr,
|
|
1432
|
+
onStop: Gr,
|
|
1433
|
+
onRestart: Kr,
|
|
1434
|
+
onOpenTerminal: Q,
|
|
1435
|
+
onShare: Yr,
|
|
1436
|
+
selected: L.has(e.id),
|
|
1437
|
+
onToggleSelect: () => Ar(e.id)
|
|
1438
|
+
}) }, e.id))
|
|
1439
|
+
}), xi = (e, t) => /* @__PURE__ */ _(Me, {
|
|
1440
|
+
sessions: e,
|
|
1441
|
+
onOpen: Vr,
|
|
1442
|
+
onStart: Wr,
|
|
1443
|
+
onStop: Gr,
|
|
1444
|
+
onRestart: Kr,
|
|
1445
|
+
onTerminate: qr,
|
|
1446
|
+
onOpenTerminal: Q,
|
|
1447
|
+
onShare: Yr,
|
|
1448
|
+
selectedIds: L,
|
|
1449
|
+
onToggleSelect: Ar,
|
|
1450
|
+
onSelectAll: jr,
|
|
1451
|
+
onDeselectAll: Mr,
|
|
1452
|
+
hideHeaderSelectAll: t
|
|
1453
|
+
});
|
|
1454
|
+
return /* @__PURE__ */ v(y, {
|
|
1198
1455
|
className: "flex flex-col bg-bg-surface min-h-screen",
|
|
1199
1456
|
children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ v("div", {
|
|
1201
1458
|
className: "flex-1 overflow-y-auto space-y-6 p-4 sm:p-6",
|
|
1202
1459
|
children: [
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
title:
|
|
1205
|
-
description:
|
|
1206
|
-
running:
|
|
1207
|
-
total:
|
|
1460
|
+
/* @__PURE__ */ _(ve, {
|
|
1461
|
+
title: S("nav.sessions", "Sessions"),
|
|
1462
|
+
description: S("sessions.pageDescription", "{{running}} of {{total}} sessions running", {
|
|
1463
|
+
running: gi.running,
|
|
1464
|
+
total: gi.total
|
|
1208
1465
|
}),
|
|
1209
|
-
actions: /* @__PURE__ */
|
|
1466
|
+
actions: /* @__PURE__ */ v("div", {
|
|
1210
1467
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
1211
1468
|
children: [
|
|
1212
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ _("button", {
|
|
1213
1470
|
type: "button",
|
|
1214
|
-
onClick: () =>
|
|
1471
|
+
onClick: () => rr().then(() => Y()),
|
|
1215
1472
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1216
|
-
title:
|
|
1217
|
-
children: /* @__PURE__ */
|
|
1473
|
+
title: S("sessions.checkHealth", "Check session health"),
|
|
1474
|
+
children: /* @__PURE__ */ _(He, { className: "size-4" })
|
|
1218
1475
|
}),
|
|
1219
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ _("button", {
|
|
1220
1477
|
type: "button",
|
|
1221
|
-
onClick: () =>
|
|
1222
|
-
disabled:
|
|
1478
|
+
onClick: () => Y(),
|
|
1479
|
+
disabled: J,
|
|
1223
1480
|
className: "flex items-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1224
|
-
title:
|
|
1225
|
-
children: /* @__PURE__ */
|
|
1481
|
+
title: S("sessions.refreshTitle", "Refresh sessions"),
|
|
1482
|
+
children: /* @__PURE__ */ _($e, { className: `size-4 ${J ? "animate-spin" : ""}` })
|
|
1226
1483
|
}),
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
label:
|
|
1229
|
-
disabled:
|
|
1484
|
+
/* @__PURE__ */ _(dt, {
|
|
1485
|
+
label: S("sessions.export", "Export"),
|
|
1486
|
+
disabled: Gt,
|
|
1230
1487
|
testId: "sessions-export",
|
|
1231
1488
|
defaultFolderPath: "/Vibecontrols/Sessions",
|
|
1232
1489
|
source: {
|
|
@@ -1234,294 +1491,306 @@ function ct() {
|
|
|
1234
1491
|
filename: `sessions-export-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`,
|
|
1235
1492
|
mimeType: "text/csv",
|
|
1236
1493
|
getBlob: async () => {
|
|
1237
|
-
let e = (await
|
|
1494
|
+
let e = (await sr({ variables: { input: {
|
|
1238
1495
|
filter: {
|
|
1239
|
-
status:
|
|
1240
|
-
type:
|
|
1241
|
-
vibeId:
|
|
1242
|
-
agentId:
|
|
1496
|
+
status: w === "all" ? void 0 : w,
|
|
1497
|
+
type: T === "all" ? void 0 : T,
|
|
1498
|
+
vibeId: E !== "all" && E !== "none" ? E : void 0,
|
|
1499
|
+
agentId: D === "all" ? void 0 : D
|
|
1243
1500
|
},
|
|
1244
1501
|
format: "CSV"
|
|
1245
1502
|
} } })).data?.exportSessions;
|
|
1246
1503
|
return e ? { blob: new Blob([e.data], { type: "text/csv" }) } : null;
|
|
1247
1504
|
}
|
|
1248
1505
|
},
|
|
1249
|
-
onDownload: () =>
|
|
1506
|
+
onDownload: () => Br("CSV")
|
|
1250
1507
|
}),
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
permission:
|
|
1253
|
-
children: /* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ _(pt, {
|
|
1509
|
+
permission: Ae.SESSION_CREATE,
|
|
1510
|
+
children: /* @__PURE__ */ v("button", {
|
|
1254
1511
|
type: "button",
|
|
1255
|
-
onClick: () =>
|
|
1512
|
+
onClick: () => zn(!0),
|
|
1256
1513
|
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",
|
|
1257
1514
|
"data-testid": "sessions-reconnect-button",
|
|
1258
|
-
title:
|
|
1259
|
-
children: [/* @__PURE__ */
|
|
1515
|
+
title: S("sessions.reconnectTooltip", "Reconnect orphan tmux/wezterm/zellij sessions left over from a previous agent run"),
|
|
1516
|
+
children: [/* @__PURE__ */ _($e, { className: "size-4" }), S("sessions.reconnect", "Reconnect")]
|
|
1260
1517
|
})
|
|
1261
1518
|
}),
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
permission:
|
|
1264
|
-
children: /* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ _(pt, {
|
|
1520
|
+
permission: Ae.SESSION_CREATE,
|
|
1521
|
+
children: /* @__PURE__ */ v("button", {
|
|
1265
1522
|
type: "button",
|
|
1266
|
-
onClick:
|
|
1523
|
+
onClick: Hr,
|
|
1267
1524
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
1268
|
-
children: [/* @__PURE__ */
|
|
1525
|
+
children: [/* @__PURE__ */ _(Qe, { className: "size-4" }), S("sessions.newSession", "New Session")]
|
|
1269
1526
|
})
|
|
1270
1527
|
}),
|
|
1271
|
-
|
|
1528
|
+
vi
|
|
1272
1529
|
]
|
|
1273
1530
|
})
|
|
1274
1531
|
}),
|
|
1275
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ _(Oe, {
|
|
1276
1533
|
showConnectionStatus: !0,
|
|
1277
1534
|
maxVisible: 3
|
|
1278
1535
|
}),
|
|
1279
|
-
/* @__PURE__ */
|
|
1536
|
+
/* @__PURE__ */ v("div", {
|
|
1280
1537
|
"data-tour": "sessions-filters",
|
|
1281
1538
|
className: "space-y-3",
|
|
1282
|
-
children: [/* @__PURE__ */
|
|
1539
|
+
children: [/* @__PURE__ */ _("div", {
|
|
1540
|
+
ref: qt,
|
|
1283
1541
|
className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
|
|
1284
|
-
children: /* @__PURE__ */
|
|
1285
|
-
value:
|
|
1286
|
-
onChange:
|
|
1287
|
-
placeholder:
|
|
1542
|
+
children: /* @__PURE__ */ _(we, {
|
|
1543
|
+
value: C,
|
|
1544
|
+
onChange: At,
|
|
1545
|
+
placeholder: S("sessions.searchPlaceholder", "Search sessions..."),
|
|
1288
1546
|
className: "flex-1 sm:w-64 sm:flex-none"
|
|
1289
1547
|
})
|
|
1290
|
-
}), /* @__PURE__ */
|
|
1548
|
+
}), /* @__PURE__ */ v("div", {
|
|
1291
1549
|
className: "flex items-center gap-2 sm:gap-3 flex-wrap",
|
|
1292
1550
|
children: [
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
label:
|
|
1295
|
-
value:
|
|
1296
|
-
options:
|
|
1297
|
-
onChange:
|
|
1551
|
+
/* @__PURE__ */ _(d, {
|
|
1552
|
+
label: S("sessions.filterStatus", "Status"),
|
|
1553
|
+
value: w,
|
|
1554
|
+
options: Et,
|
|
1555
|
+
onChange: jt
|
|
1298
1556
|
}),
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
label:
|
|
1301
|
-
value:
|
|
1302
|
-
options:
|
|
1303
|
-
onChange:
|
|
1557
|
+
/* @__PURE__ */ _(d, {
|
|
1558
|
+
label: S("sessions.filterType", "Type"),
|
|
1559
|
+
value: T,
|
|
1560
|
+
options: Dt,
|
|
1561
|
+
onChange: Mt
|
|
1304
1562
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
label:
|
|
1307
|
-
value:
|
|
1308
|
-
options:
|
|
1309
|
-
onChange:
|
|
1563
|
+
/* @__PURE__ */ _(d, {
|
|
1564
|
+
label: S("sessions.filterVibe", "Vibe"),
|
|
1565
|
+
value: E,
|
|
1566
|
+
options: br,
|
|
1567
|
+
onChange: Nt
|
|
1310
1568
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
label:
|
|
1313
|
-
value:
|
|
1314
|
-
options:
|
|
1315
|
-
onChange:
|
|
1569
|
+
/* @__PURE__ */ _(d, {
|
|
1570
|
+
label: S("sessions.filterAgent", "Agent"),
|
|
1571
|
+
value: D,
|
|
1572
|
+
options: xr,
|
|
1573
|
+
onChange: Pt
|
|
1574
|
+
}),
|
|
1575
|
+
/* @__PURE__ */ _(d, {
|
|
1576
|
+
label: S("sessions.filterTarget", "Target"),
|
|
1577
|
+
value: O,
|
|
1578
|
+
options: Or,
|
|
1579
|
+
onChange: Ft,
|
|
1580
|
+
icon: /* @__PURE__ */ _(Xe, { className: "size-3.5 text-text-secondary" })
|
|
1581
|
+
}),
|
|
1582
|
+
/* @__PURE__ */ _("div", {
|
|
1583
|
+
className: "sm:ml-auto",
|
|
1584
|
+
children: /* @__PURE__ */ _(d, {
|
|
1585
|
+
label: S("sessions.groupByLabel", "Group"),
|
|
1586
|
+
value: k,
|
|
1587
|
+
options: Sr,
|
|
1588
|
+
onChange: (e) => A(e),
|
|
1589
|
+
allValue: "none",
|
|
1590
|
+
allLabel: S("sessions.groupBy.none", "No grouping"),
|
|
1591
|
+
icon: /* @__PURE__ */ _(qe, { className: "size-3.5 text-text-secondary" })
|
|
1592
|
+
})
|
|
1316
1593
|
})
|
|
1317
1594
|
]
|
|
1318
1595
|
})]
|
|
1319
1596
|
}),
|
|
1320
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ v("div", {
|
|
1321
1598
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-wrap",
|
|
1322
1599
|
children: [
|
|
1323
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ v("button", {
|
|
1324
1601
|
type: "button",
|
|
1325
|
-
onClick: () =>
|
|
1326
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
1602
|
+
onClick: () => jt("RUNNING"),
|
|
1603
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${w === "RUNNING" ? "bg-status-success-bg text-status-success-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
1327
1604
|
children: [
|
|
1328
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ _(Ze, { className: "size-3" }),
|
|
1329
1606
|
" ",
|
|
1330
|
-
|
|
1607
|
+
S("sessions.running", "Running"),
|
|
1331
1608
|
" (",
|
|
1332
|
-
|
|
1609
|
+
gi.running,
|
|
1333
1610
|
")"
|
|
1334
1611
|
]
|
|
1335
1612
|
}),
|
|
1336
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ v("button", {
|
|
1337
1614
|
type: "button",
|
|
1338
|
-
onClick: () =>
|
|
1339
|
-
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${
|
|
1615
|
+
onClick: () => jt("STOPPED"),
|
|
1616
|
+
className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-full transition-colors ${w === "STOPPED" ? "bg-bg-sunken text-text-secondary" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"}`,
|
|
1340
1617
|
children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ _(rt, { className: "size-3" }),
|
|
1342
1619
|
" ",
|
|
1343
|
-
|
|
1620
|
+
S("sessions.stoppedState", "Stopped"),
|
|
1344
1621
|
" (",
|
|
1345
|
-
|
|
1622
|
+
gi.stopped,
|
|
1346
1623
|
")"
|
|
1347
1624
|
]
|
|
1348
1625
|
}),
|
|
1349
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ _("div", {
|
|
1350
1627
|
className: "sm:ml-auto flex items-center gap-2",
|
|
1351
|
-
children: Z.length > 0 && /* @__PURE__ */
|
|
1628
|
+
children: Z.length > 0 && /* @__PURE__ */ v("button", {
|
|
1352
1629
|
type: "button",
|
|
1353
|
-
onClick:
|
|
1630
|
+
onClick: Fr ? Mr : jr,
|
|
1354
1631
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
1355
|
-
children: [/* @__PURE__ */
|
|
1632
|
+
children: [/* @__PURE__ */ _(Ue, { className: "size-3.5" }), Fr ? S("sessions.deselectAll", "Deselect All") : S("sessions.selectAll", "Select All")]
|
|
1356
1633
|
})
|
|
1357
1634
|
})
|
|
1358
1635
|
]
|
|
1359
1636
|
}),
|
|
1360
|
-
|
|
1361
|
-
|
|
1637
|
+
_i(),
|
|
1638
|
+
C || w !== "all" || T !== "all" || E !== "all" || D !== "all" || O !== "all" ? /* @__PURE__ */ v("p", {
|
|
1362
1639
|
className: "text-sm text-text-secondary",
|
|
1363
1640
|
children: [
|
|
1364
|
-
|
|
1641
|
+
S("sessions.showing", "Showing"),
|
|
1365
1642
|
" ",
|
|
1366
1643
|
Z.length,
|
|
1367
1644
|
" ",
|
|
1368
|
-
|
|
1645
|
+
S("sessions.of", "of"),
|
|
1369
1646
|
" ",
|
|
1370
1647
|
X.length,
|
|
1371
1648
|
" ",
|
|
1372
|
-
|
|
1373
|
-
|
|
1649
|
+
S("nav.sessions", "sessions"),
|
|
1650
|
+
J && /* @__PURE__ */ v("span", {
|
|
1374
1651
|
className: "ml-2 text-text-muted",
|
|
1375
1652
|
children: [
|
|
1376
1653
|
"(",
|
|
1377
|
-
|
|
1654
|
+
S("sessions.refreshing", "refreshing..."),
|
|
1378
1655
|
")"
|
|
1379
1656
|
]
|
|
1380
1657
|
})
|
|
1381
1658
|
]
|
|
1382
1659
|
}) : null,
|
|
1383
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ _(lt, {
|
|
1384
1661
|
mode: "wait",
|
|
1385
|
-
children: Z.length > 0 ?
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
children:
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
onStart: mr,
|
|
1403
|
-
onStop: hr,
|
|
1404
|
-
onRestart: gr,
|
|
1405
|
-
onTerminate: _r,
|
|
1406
|
-
onOpenTerminal: Q,
|
|
1407
|
-
onShare: yr,
|
|
1408
|
-
selectedIds: j,
|
|
1409
|
-
onToggleSelect: nr,
|
|
1410
|
-
onSelectAll: rr,
|
|
1411
|
-
onDeselectAll: ir
|
|
1412
|
-
}) }, "list-view") : /* @__PURE__ */ _("div", {
|
|
1662
|
+
children: Z.length > 0 ? k === "none" ? j === "grid" ? /* @__PURE__ */ _("div", { children: bi(Z) }, "grid-view") : /* @__PURE__ */ _(mt, { children: xi(Z, !1) }, "list-view") : /* @__PURE__ */ _("div", {
|
|
1663
|
+
className: "space-y-3",
|
|
1664
|
+
"data-testid": "sessions-grouped",
|
|
1665
|
+
children: kr.map((e) => {
|
|
1666
|
+
let t = e.sessions.map((e) => e.id), n = t.length > 0 && t.every((e) => L.has(e)), r = t.some((e) => L.has(e));
|
|
1667
|
+
return /* @__PURE__ */ _(Fe, {
|
|
1668
|
+
label: e.label,
|
|
1669
|
+
count: e.sessions.length,
|
|
1670
|
+
collapsed: It.has(e.key),
|
|
1671
|
+
onToggleCollapse: () => Pr(e.key),
|
|
1672
|
+
allSelected: n,
|
|
1673
|
+
someSelected: r,
|
|
1674
|
+
onToggleSelectGroup: () => Nr(t),
|
|
1675
|
+
children: j === "grid" ? bi(e.sessions) : xi(e.sessions, !0)
|
|
1676
|
+
}, e.key);
|
|
1677
|
+
})
|
|
1678
|
+
}, "grouped-view") : /* @__PURE__ */ v("div", {
|
|
1413
1679
|
className: "space-y-4",
|
|
1414
|
-
children: [/* @__PURE__ */
|
|
1680
|
+
children: [/* @__PURE__ */ _(Te, {
|
|
1415
1681
|
variant: "compact",
|
|
1416
1682
|
dismissKey: "vibecontrols-sessions-setup-banner"
|
|
1417
|
-
}), /* @__PURE__ */
|
|
1418
|
-
icon: /* @__PURE__ */
|
|
1419
|
-
title:
|
|
1420
|
-
description:
|
|
1421
|
-
action: !
|
|
1683
|
+
}), /* @__PURE__ */ _(Ce, {
|
|
1684
|
+
icon: /* @__PURE__ */ _(it, { className: "size-8 text-text-secondary" }),
|
|
1685
|
+
title: C || w !== "all" || T !== "all" || E !== "all" || D !== "all" || O !== "all" ? S("sessions.emptyFound", "No sessions found") : S("sessions.emptyConfigured", "No sessions configured"),
|
|
1686
|
+
description: C || w !== "all" || T !== "all" || E !== "all" || D !== "all" || O !== "all" ? S("sessions.emptyAdjustSearch", "Try adjusting your search or filters") : S("sessions.emptyDescription", "Sessions require an active agent. Install the CLI agent first, then start a session."),
|
|
1687
|
+
action: !C && w === "all" && T === "all" && E === "all" && D === "all" && O === "all" ? /* @__PURE__ */ v("div", {
|
|
1422
1688
|
className: "flex items-center gap-2",
|
|
1423
|
-
children: [
|
|
1689
|
+
children: [kt && /* @__PURE__ */ v("button", {
|
|
1424
1690
|
type: "button",
|
|
1425
|
-
onClick:
|
|
1691
|
+
onClick: Hr,
|
|
1426
1692
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
1427
1693
|
children: [
|
|
1428
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ _(Qe, { className: "size-4" }),
|
|
1429
1695
|
" ",
|
|
1430
|
-
|
|
1696
|
+
S("sessions.newSession", "New Session")
|
|
1431
1697
|
]
|
|
1432
|
-
}), /* @__PURE__ */
|
|
1698
|
+
}), /* @__PURE__ */ _(Ee, { prompt: "What is a Session in VibeControls and how do I start one?" })]
|
|
1433
1699
|
}) : void 0
|
|
1434
1700
|
})]
|
|
1435
1701
|
})
|
|
1436
1702
|
}),
|
|
1437
|
-
|
|
1703
|
+
Ut && /* @__PURE__ */ _("div", {
|
|
1438
1704
|
className: "fixed bottom-4 right-4 z-50 px-4 py-3 bg-status-success-bg text-status-success-text rounded-md shadow-lg text-sm",
|
|
1439
|
-
children:
|
|
1705
|
+
children: Ut
|
|
1440
1706
|
})
|
|
1441
1707
|
]
|
|
1442
1708
|
}),
|
|
1443
|
-
|
|
1444
|
-
tabs:
|
|
1445
|
-
activeTabId:
|
|
1446
|
-
onTabSelect:
|
|
1447
|
-
onTabClose:
|
|
1448
|
-
onOpenExternal:
|
|
1449
|
-
onToggleCollapse: () =>
|
|
1450
|
-
collapsed:
|
|
1709
|
+
H.length > 0 && /* @__PURE__ */ _(Ne, {
|
|
1710
|
+
tabs: H,
|
|
1711
|
+
activeTabId: W,
|
|
1712
|
+
onTabSelect: G,
|
|
1713
|
+
onTabClose: Xr,
|
|
1714
|
+
onOpenExternal: Zr,
|
|
1715
|
+
onToggleCollapse: () => Tn((e) => !e),
|
|
1716
|
+
collapsed: wn,
|
|
1451
1717
|
sessions: Z,
|
|
1452
1718
|
onOpenTerminal: Q,
|
|
1453
1719
|
onRetryTerminal: Q,
|
|
1454
|
-
onRenameSession:
|
|
1455
|
-
onStopTerminal:
|
|
1720
|
+
onRenameSession: Qr,
|
|
1721
|
+
onStopTerminal: $r,
|
|
1456
1722
|
onStopSession: (e) => {
|
|
1457
1723
|
let t = X.find((t) => t.id === e);
|
|
1458
|
-
t &&
|
|
1724
|
+
t && Gr(t);
|
|
1459
1725
|
},
|
|
1460
|
-
onRestartTerminal:
|
|
1726
|
+
onRestartTerminal: ei,
|
|
1727
|
+
onReattachTerminal: ti,
|
|
1728
|
+
onReorderTabs: ni,
|
|
1729
|
+
onTogglePin: ri,
|
|
1461
1730
|
heightClass: "h-[280px] sm:h-[380px]",
|
|
1462
|
-
isImmersiveFullscreen:
|
|
1463
|
-
onToggleImmersiveFullscreen:
|
|
1731
|
+
isImmersiveFullscreen: On,
|
|
1732
|
+
onToggleImmersiveFullscreen: ii,
|
|
1464
1733
|
contextSwitcher: void 0
|
|
1465
1734
|
}),
|
|
1466
|
-
|
|
1735
|
+
yi
|
|
1467
1736
|
]
|
|
1468
1737
|
});
|
|
1469
|
-
function
|
|
1470
|
-
if (!
|
|
1471
|
-
let e =
|
|
1472
|
-
return /* @__PURE__ */
|
|
1738
|
+
function Si() {
|
|
1739
|
+
if (!Rn) return null;
|
|
1740
|
+
let e = qn?.agentSessionOrphans ?? [];
|
|
1741
|
+
return /* @__PURE__ */ _("div", {
|
|
1473
1742
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1474
1743
|
"data-testid": "sessions-reconnect-modal",
|
|
1475
|
-
children: /* @__PURE__ */
|
|
1744
|
+
children: /* @__PURE__ */ v("div", {
|
|
1476
1745
|
className: "bg-bg-surface rounded-lg p-6 w-full max-w-2xl max-h-[80vh] overflow-y-auto",
|
|
1477
1746
|
children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ _("h2", {
|
|
1479
1748
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
1480
|
-
children:
|
|
1749
|
+
children: S("sessions.reconnectTitle", "Reconnect orphan sessions")
|
|
1481
1750
|
}),
|
|
1482
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ _("p", {
|
|
1483
1752
|
className: "text-sm text-text-secondary mb-4",
|
|
1484
|
-
children:
|
|
1753
|
+
children: S("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.")
|
|
1485
1754
|
}),
|
|
1486
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ v("div", {
|
|
1487
1756
|
className: "space-y-4",
|
|
1488
1757
|
children: [
|
|
1489
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
1490
1759
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1491
|
-
children:
|
|
1492
|
-
}), /* @__PURE__ */
|
|
1493
|
-
options:
|
|
1494
|
-
value:
|
|
1760
|
+
children: S("sessions.agent", "Agent")
|
|
1761
|
+
}), /* @__PURE__ */ _(De, {
|
|
1762
|
+
options: wr,
|
|
1763
|
+
value: Bn,
|
|
1495
1764
|
onChange: (e) => {
|
|
1496
|
-
|
|
1765
|
+
Vn(e), Un(null), e && Kn({ variables: { agentId: e } });
|
|
1497
1766
|
},
|
|
1498
|
-
placeholder:
|
|
1499
|
-
searchPlaceholder:
|
|
1767
|
+
placeholder: S("sessions.selectAgent", "Select an agent"),
|
|
1768
|
+
searchPlaceholder: S("sessions.searchAgents", "Search agents..."),
|
|
1500
1769
|
clearable: !0
|
|
1501
1770
|
})] }),
|
|
1502
|
-
|
|
1771
|
+
Hn && /* @__PURE__ */ _("div", {
|
|
1503
1772
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1504
1773
|
"data-testid": "sessions-reconnect-error",
|
|
1505
|
-
children:
|
|
1774
|
+
children: Hn
|
|
1506
1775
|
}),
|
|
1507
|
-
|
|
1776
|
+
Bn && /* @__PURE__ */ _("div", {
|
|
1508
1777
|
"data-testid": "sessions-reconnect-list",
|
|
1509
1778
|
className: "space-y-2",
|
|
1510
|
-
children:
|
|
1779
|
+
children: Jn ? /* @__PURE__ */ _("div", {
|
|
1511
1780
|
className: "text-sm text-text-secondary",
|
|
1512
|
-
children:
|
|
1513
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
1781
|
+
children: S("sessions.scanningHost", "Scanning host...")
|
|
1782
|
+
}) : e.length === 0 ? /* @__PURE__ */ _("div", {
|
|
1514
1783
|
className: "text-sm text-text-secondary",
|
|
1515
|
-
children:
|
|
1516
|
-
}) : e.map((e) => /* @__PURE__ */
|
|
1784
|
+
children: S("sessions.noOrphans", "No orphan vibe-* sessions found on this agent.")
|
|
1785
|
+
}) : e.map((e) => /* @__PURE__ */ v("div", {
|
|
1517
1786
|
className: "flex items-center justify-between gap-3 p-3 border border-border-default rounded-md bg-bg-sunken/40",
|
|
1518
1787
|
"data-testid": "sessions-reconnect-row",
|
|
1519
|
-
children: [/* @__PURE__ */
|
|
1788
|
+
children: [/* @__PURE__ */ v("div", {
|
|
1520
1789
|
className: "min-w-0 flex-1",
|
|
1521
|
-
children: [/* @__PURE__ */
|
|
1790
|
+
children: [/* @__PURE__ */ _("div", {
|
|
1522
1791
|
className: "font-mono text-sm text-text-primary break-all",
|
|
1523
1792
|
children: e.externalName
|
|
1524
|
-
}), /* @__PURE__ */
|
|
1793
|
+
}), /* @__PURE__ */ v("div", {
|
|
1525
1794
|
className: "text-xs text-text-tertiary mt-0.5",
|
|
1526
1795
|
children: [
|
|
1527
1796
|
e.provider,
|
|
@@ -1533,213 +1802,213 @@ function ct() {
|
|
|
1533
1802
|
e.createdAt ? ` · created ${e.createdAt}` : ""
|
|
1534
1803
|
]
|
|
1535
1804
|
})]
|
|
1536
|
-
}), /* @__PURE__ */
|
|
1805
|
+
}), /* @__PURE__ */ _("button", {
|
|
1537
1806
|
type: "button",
|
|
1538
|
-
disabled:
|
|
1807
|
+
disabled: Wn === e.externalName,
|
|
1539
1808
|
onClick: async () => {
|
|
1540
|
-
|
|
1809
|
+
Gn(e.externalName), Un(null);
|
|
1541
1810
|
try {
|
|
1542
|
-
await
|
|
1543
|
-
agentId:
|
|
1811
|
+
await Yn({ variables: {
|
|
1812
|
+
agentId: Bn,
|
|
1544
1813
|
externalName: e.externalName,
|
|
1545
1814
|
name: e.externalName
|
|
1546
|
-
} }), await
|
|
1815
|
+
} }), await Kn({ variables: { agentId: Bn } });
|
|
1547
1816
|
} catch (e) {
|
|
1548
|
-
|
|
1817
|
+
Un(e instanceof Error ? e.message : String(e));
|
|
1549
1818
|
} finally {
|
|
1550
|
-
|
|
1819
|
+
Gn(null);
|
|
1551
1820
|
}
|
|
1552
1821
|
},
|
|
1553
1822
|
className: "shrink-0 px-3 py-1.5 text-xs bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
1554
1823
|
"data-testid": `sessions-reconnect-adopt-${e.externalName}`,
|
|
1555
|
-
children:
|
|
1824
|
+
children: Wn === e.externalName ? S("sessions.adopting", "Adopting…") : S("sessions.adopt", "Adopt")
|
|
1556
1825
|
})]
|
|
1557
1826
|
}, e.externalName))
|
|
1558
1827
|
})
|
|
1559
1828
|
]
|
|
1560
1829
|
}),
|
|
1561
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ _("div", {
|
|
1562
1831
|
className: "flex justify-end gap-3 mt-6",
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1832
|
+
children: /* @__PURE__ */ _("button", {
|
|
1564
1833
|
type: "button",
|
|
1565
1834
|
onClick: () => {
|
|
1566
|
-
|
|
1835
|
+
zn(!1), Un(null);
|
|
1567
1836
|
},
|
|
1568
1837
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
|
|
1569
|
-
children:
|
|
1838
|
+
children: S("common.close", "Close")
|
|
1570
1839
|
})
|
|
1571
1840
|
})
|
|
1572
1841
|
]
|
|
1573
1842
|
})
|
|
1574
1843
|
});
|
|
1575
1844
|
}
|
|
1576
|
-
function
|
|
1577
|
-
return /* @__PURE__ */
|
|
1845
|
+
function Ci() {
|
|
1846
|
+
return /* @__PURE__ */ _("div", {
|
|
1578
1847
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4",
|
|
1579
|
-
children: /* @__PURE__ */
|
|
1848
|
+
children: /* @__PURE__ */ v("div", {
|
|
1580
1849
|
className: "bg-bg-surface rounded-lg p-6 w-full max-w-lg",
|
|
1581
1850
|
children: [
|
|
1582
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ _("h2", {
|
|
1583
1852
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
1584
|
-
children:
|
|
1853
|
+
children: S("sessions.newSession", "New Session")
|
|
1585
1854
|
}),
|
|
1586
|
-
/* @__PURE__ */
|
|
1855
|
+
/* @__PURE__ */ v("div", {
|
|
1587
1856
|
className: "space-y-4",
|
|
1588
1857
|
children: [
|
|
1589
|
-
|
|
1858
|
+
Bt && /* @__PURE__ */ _("div", {
|
|
1590
1859
|
className: "p-3 bg-status-error-bg text-status-error-text text-sm rounded-md",
|
|
1591
|
-
children:
|
|
1860
|
+
children: Bt
|
|
1592
1861
|
}),
|
|
1593
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
1594
1863
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1595
|
-
children:
|
|
1596
|
-
}), /* @__PURE__ */
|
|
1864
|
+
children: S("sessions.name", "Name")
|
|
1865
|
+
}), /* @__PURE__ */ _("input", {
|
|
1597
1866
|
"aria-label": "control",
|
|
1598
|
-
ref:
|
|
1867
|
+
ref: Jt,
|
|
1599
1868
|
type: "text",
|
|
1600
|
-
placeholder:
|
|
1869
|
+
placeholder: S("sessions.namePlaceholder", "dev-server"),
|
|
1601
1870
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
1602
1871
|
})] }),
|
|
1603
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
1604
1873
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1605
|
-
children:
|
|
1606
|
-
}), /* @__PURE__ */
|
|
1607
|
-
options:
|
|
1608
|
-
value:
|
|
1609
|
-
onChange:
|
|
1610
|
-
placeholder:
|
|
1611
|
-
searchPlaceholder:
|
|
1874
|
+
children: S("sessions.filterVibe", "Vibe")
|
|
1875
|
+
}), /* @__PURE__ */ _(De, {
|
|
1876
|
+
options: Cr,
|
|
1877
|
+
value: Qt,
|
|
1878
|
+
onChange: $t,
|
|
1879
|
+
placeholder: S("sessions.noVibe", "No vibe"),
|
|
1880
|
+
searchPlaceholder: S("sessions.searchVibes", "Search vibes..."),
|
|
1612
1881
|
clearable: !0
|
|
1613
1882
|
})] }),
|
|
1614
|
-
/* @__PURE__ */
|
|
1615
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ v("div", { children: [
|
|
1884
|
+
/* @__PURE__ */ _("label", {
|
|
1616
1885
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1617
|
-
children:
|
|
1886
|
+
children: S("sessions.filterAgent", "Agent")
|
|
1618
1887
|
}),
|
|
1619
|
-
/* @__PURE__ */
|
|
1620
|
-
options:
|
|
1621
|
-
value:
|
|
1622
|
-
onChange:
|
|
1623
|
-
placeholder:
|
|
1624
|
-
searchPlaceholder:
|
|
1888
|
+
/* @__PURE__ */ _(De, {
|
|
1889
|
+
options: wr,
|
|
1890
|
+
value: en,
|
|
1891
|
+
onChange: tn,
|
|
1892
|
+
placeholder: S("sessions.selectAgent", "Select an agent"),
|
|
1893
|
+
searchPlaceholder: S("sessions.searchAgents", "Search agents..."),
|
|
1625
1894
|
clearable: !0
|
|
1626
1895
|
}),
|
|
1627
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ _("p", {
|
|
1628
1897
|
className: "text-xs text-text-muted mt-1",
|
|
1629
|
-
children:
|
|
1898
|
+
children: S("sessions.agentHint", "Required when no vibe is selected. Overridden by the vibe's agent if a vibe is chosen.")
|
|
1630
1899
|
})
|
|
1631
1900
|
] }),
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ v("div", { children: [
|
|
1902
|
+
/* @__PURE__ */ _("label", {
|
|
1634
1903
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1635
|
-
children:
|
|
1904
|
+
children: S("sessions.profile", "Profile")
|
|
1636
1905
|
}),
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
options:
|
|
1639
|
-
value:
|
|
1640
|
-
onChange:
|
|
1641
|
-
placeholder:
|
|
1642
|
-
searchPlaceholder:
|
|
1906
|
+
/* @__PURE__ */ _(De, {
|
|
1907
|
+
options: Er,
|
|
1908
|
+
value: nn,
|
|
1909
|
+
onChange: rn,
|
|
1910
|
+
placeholder: S("sessions.selectProfile", "default"),
|
|
1911
|
+
searchPlaceholder: S("sessions.searchProfiles", "Search profiles...")
|
|
1643
1912
|
}),
|
|
1644
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ _("p", {
|
|
1645
1914
|
className: "text-xs text-text-muted mt-1",
|
|
1646
|
-
children:
|
|
1915
|
+
children: S("sessions.profileHint", "Which agent profile this session targets. Defaults to \"default\" — change only if the agent runs multiple isolated profiles.")
|
|
1647
1916
|
})
|
|
1648
1917
|
] }),
|
|
1649
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
1650
1919
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1651
|
-
children:
|
|
1652
|
-
}), /* @__PURE__ */
|
|
1653
|
-
options:
|
|
1654
|
-
value:
|
|
1655
|
-
onChange:
|
|
1656
|
-
placeholder:
|
|
1657
|
-
searchPlaceholder:
|
|
1920
|
+
children: S("sessions.filterType", "Type")
|
|
1921
|
+
}), /* @__PURE__ */ _(De, {
|
|
1922
|
+
options: Dr,
|
|
1923
|
+
value: B,
|
|
1924
|
+
onChange: an,
|
|
1925
|
+
placeholder: S("sessions.selectType", "Select type"),
|
|
1926
|
+
searchPlaceholder: S("sessions.searchTypes", "Search types...")
|
|
1658
1927
|
})] }),
|
|
1659
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
1660
1929
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
1661
|
-
children:
|
|
1662
|
-
}), /* @__PURE__ */
|
|
1930
|
+
children: S("sessions.command", "Command")
|
|
1931
|
+
}), /* @__PURE__ */ _("input", {
|
|
1663
1932
|
"aria-label": "control",
|
|
1664
|
-
ref:
|
|
1933
|
+
ref: Yt,
|
|
1665
1934
|
type: "text",
|
|
1666
|
-
placeholder:
|
|
1935
|
+
placeholder: S("sessions.commandPlaceholder", "bun run dev"),
|
|
1667
1936
|
className: "w-full px-3 py-2 bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
|
|
1668
1937
|
})] }),
|
|
1669
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ v("div", {
|
|
1670
1939
|
className: "flex items-center gap-2",
|
|
1671
|
-
children: [/* @__PURE__ */
|
|
1940
|
+
children: [/* @__PURE__ */ _("input", {
|
|
1672
1941
|
"aria-label": "autoStart",
|
|
1673
|
-
ref:
|
|
1942
|
+
ref: Xt,
|
|
1674
1943
|
type: "checkbox",
|
|
1675
1944
|
id: "autoStart",
|
|
1676
1945
|
className: "size-4 rounded border-border-default"
|
|
1677
|
-
}), /* @__PURE__ */
|
|
1946
|
+
}), /* @__PURE__ */ _("label", {
|
|
1678
1947
|
htmlFor: "autoStart",
|
|
1679
1948
|
className: "text-sm text-text-primary",
|
|
1680
|
-
children:
|
|
1949
|
+
children: S("sessions.autoStartWithVibe", "Auto-start with vibe")
|
|
1681
1950
|
})]
|
|
1682
1951
|
}),
|
|
1683
|
-
(
|
|
1952
|
+
(B === "TMUX" || B === "WEZTERM" || B === "ZELLIJ") && /* @__PURE__ */ v("div", {
|
|
1684
1953
|
className: "rounded-md border border-border-default bg-bg-sunken/40",
|
|
1685
1954
|
"data-testid": "sessions-create-advanced",
|
|
1686
|
-
children: [/* @__PURE__ */
|
|
1955
|
+
children: [/* @__PURE__ */ v("button", {
|
|
1687
1956
|
type: "button",
|
|
1688
|
-
onClick: () =>
|
|
1957
|
+
onClick: () => sn((e) => !e),
|
|
1689
1958
|
className: "w-full flex items-center justify-between px-3 py-2 text-sm font-medium text-text-primary",
|
|
1690
|
-
"aria-expanded":
|
|
1691
|
-
children: [/* @__PURE__ */
|
|
1959
|
+
"aria-expanded": on,
|
|
1960
|
+
children: [/* @__PURE__ */ _("span", { children: S("sessions.advanced", "Advanced options") }), /* @__PURE__ */ _("span", {
|
|
1692
1961
|
className: "text-text-tertiary text-xs",
|
|
1693
|
-
children:
|
|
1962
|
+
children: on ? "▾" : "▸"
|
|
1694
1963
|
})]
|
|
1695
|
-
}),
|
|
1964
|
+
}), on && /* @__PURE__ */ v("div", {
|
|
1696
1965
|
className: "px-3 pb-3 space-y-2",
|
|
1697
1966
|
children: [
|
|
1698
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ _("label", {
|
|
1699
1968
|
className: "block text-xs font-medium text-text-secondary",
|
|
1700
|
-
children:
|
|
1969
|
+
children: S("sessions.attachExistingLabel", "Attach to existing session (optional)")
|
|
1701
1970
|
}),
|
|
1702
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ _("input", {
|
|
1703
1972
|
"aria-label": "control",
|
|
1704
|
-
ref:
|
|
1973
|
+
ref: Zt,
|
|
1705
1974
|
type: "text",
|
|
1706
1975
|
"data-testid": "sessions-create-external-name",
|
|
1707
|
-
placeholder:
|
|
1976
|
+
placeholder: B === "WEZTERM" ? "e.g. vibe-051c9c62 (existing wezterm workspace)" : B === "ZELLIJ" ? "e.g. vibe-051c9c62 (existing zellij session)" : "e.g. vibe-051c9c62 (existing tmux session)",
|
|
1708
1977
|
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"
|
|
1709
1978
|
}),
|
|
1710
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ _("p", {
|
|
1711
1980
|
className: "text-xs text-text-tertiary",
|
|
1712
|
-
children:
|
|
1981
|
+
children: S("sessions.attachExistingHint", "When set, the agent attaches to that existing session instead of creating a new one. Leave blank to spawn fresh.")
|
|
1713
1982
|
})
|
|
1714
1983
|
]
|
|
1715
1984
|
})]
|
|
1716
1985
|
})
|
|
1717
1986
|
]
|
|
1718
1987
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ v("div", {
|
|
1720
1989
|
className: "border-t border-border-default pt-4",
|
|
1721
|
-
children: [/* @__PURE__ */
|
|
1990
|
+
children: [/* @__PURE__ */ _("h3", {
|
|
1722
1991
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
1723
|
-
children:
|
|
1724
|
-
}), /* @__PURE__ */
|
|
1992
|
+
children: S("sessions.tags", "Tags")
|
|
1993
|
+
}), /* @__PURE__ */ _(xe, {
|
|
1725
1994
|
entityType: "VIBECONTROLS_SESSION",
|
|
1726
|
-
onDraftChange:
|
|
1995
|
+
onDraftChange: In
|
|
1727
1996
|
})]
|
|
1728
1997
|
}),
|
|
1729
|
-
/* @__PURE__ */
|
|
1998
|
+
/* @__PURE__ */ v("div", {
|
|
1730
1999
|
className: "flex justify-end gap-3 mt-6",
|
|
1731
|
-
children: [/* @__PURE__ */
|
|
2000
|
+
children: [/* @__PURE__ */ _("button", {
|
|
1732
2001
|
type: "button",
|
|
1733
|
-
onClick: () =>
|
|
1734
|
-
disabled:
|
|
2002
|
+
onClick: () => N(!1),
|
|
2003
|
+
disabled: Vt,
|
|
1735
2004
|
className: "px-4 py-2 text-text-primary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
1736
|
-
children:
|
|
1737
|
-
}), /* @__PURE__ */
|
|
2005
|
+
children: S("common.cancel", "Cancel")
|
|
2006
|
+
}), /* @__PURE__ */ _("button", {
|
|
1738
2007
|
type: "button",
|
|
1739
|
-
onClick:
|
|
1740
|
-
disabled:
|
|
2008
|
+
onClick: Ur,
|
|
2009
|
+
disabled: Vt,
|
|
1741
2010
|
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",
|
|
1742
|
-
children:
|
|
2011
|
+
children: Vt ? S("sessions.creating", "Creating...") : S("sessions.createSession", "Create Session")
|
|
1743
2012
|
})]
|
|
1744
2013
|
})
|
|
1745
2014
|
]
|
|
@@ -1748,6 +2017,6 @@ function ct() {
|
|
|
1748
2017
|
}
|
|
1749
2018
|
}
|
|
1750
2019
|
//#endregion
|
|
1751
|
-
export {
|
|
2020
|
+
export { yt as SessionsPage };
|
|
1752
2021
|
|
|
1753
2022
|
//# sourceMappingURL=SessionsPage.js.map
|