@burdenoff/microfe-vibecontrols 2026.608.1 → 2026.608.2

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