@burdenoff/microfe-vibecontrols 2026.528.5 → 2026.528.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,92 +26,101 @@ import { deriveAgentStatus as Me } from "../utils/agentStatus.js";
26
26
  import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
27
27
  import { useI18n as Ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
28
  import { Bot as Pe, CheckSquare as Fe, Grid as Ie, List as Le, Plus as d, RefreshCw as Re, Trash2 as ze, XSquare as Be } from "lucide-react";
29
- import { usePermissions as Ve } from "@burdenoff/fe-libs/shared/providers/shell";
29
+ import { useSearchParams as Ve } from "react-router-dom";
30
+ import { usePermissions as He } from "@burdenoff/fe-libs/shared/providers/shell";
30
31
  import { AnimatePresence as f, motion as p } from "framer-motion";
31
32
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
32
- import { MotionItem as He, MotionList as Ue, MotionPage as _ } from "@burdenoff/fe-libs/shared/motion";
33
+ import { MotionItem as _, MotionList as Ue, MotionPage as v } from "@burdenoff/fe-libs/shared/motion";
33
34
  import { AccessDenied as We, PermissionButton as Ge } from "@burdenoff/fe-libs/shared/components";
34
35
  //#region src/pages/AgentsPage.tsx
35
36
  function Ke() {
36
- let { onAgentSelect: Ke, workspaceId: v } = pe(), y = me(), { hasPermission: qe, isLoading: Je, permissions: Ye } = Ve(), { t: Xe } = Ne(), b = o((e, t, n) => {
37
+ let { onAgentSelect: Ke, workspaceId: y } = pe(), b = me(), { hasPermission: qe, isLoading: Je, permissions: Ye } = He(), { t: Xe } = Ne(), x = o((e, t, n) => {
37
38
  let r = Xe(e, n), i = r === e ? t : r;
38
39
  return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
39
40
  }, [Xe]), Ze = [
40
41
  {
41
42
  value: "all",
42
- label: b("agentsPage.statusAll", "All Statuses")
43
+ label: x("agentsPage.statusAll", "All Statuses")
43
44
  },
44
45
  {
45
46
  value: "ACTIVE",
46
- label: b("agentsPage.statusActive", "Active")
47
+ label: x("agentsPage.statusActive", "Active")
47
48
  },
48
49
  {
49
50
  value: "STOPPED",
50
- label: b("agentsPage.statusStopped", "Stopped")
51
+ label: x("agentsPage.statusStopped", "Stopped")
51
52
  },
52
53
  {
53
54
  value: "OFFLINE",
54
- label: b("agentsPage.statusOffline", "Offline")
55
+ label: x("agentsPage.statusOffline", "Offline")
55
56
  }
56
57
  ], Qe = [
57
58
  {
58
59
  value: "all",
59
- label: b("agentsPage.platformAll", "All Platforms")
60
+ label: x("agentsPage.platformAll", "All Platforms")
60
61
  },
61
62
  {
62
63
  value: "darwin",
63
- label: b("agentsPage.platformMac", "macOS")
64
+ label: x("agentsPage.platformMac", "macOS")
64
65
  },
65
66
  {
66
67
  value: "linux",
67
- label: b("agentsPage.platformLinux", "Linux")
68
+ label: x("agentsPage.platformLinux", "Linux")
68
69
  },
69
70
  {
70
71
  value: "windows",
71
- label: b("agentsPage.platformWindows", "Windows")
72
+ label: x("agentsPage.platformWindows", "Windows")
72
73
  }
73
- ], $e = qe(De.AGENT_LIST), [x, et] = u(""), [S, tt] = u("all"), [C, nt] = u("all"), [w, rt] = u("all"), [T, it] = u("grid"), [at, E] = u(!1), [ot, st] = u(!1), [D, O] = u(null), [ct, lt] = u(!1), k = a((e) => e.connectingAgents), ut = a((e) => e.markAgentConnecting), A = a((e) => e.clearAgentConnecting), dt = c(() => new Set(Object.keys(k)), [k]), ft = l(/* @__PURE__ */ new Map());
74
+ ], $e = qe(De.AGENT_LIST), [S, et] = u(""), [C, tt] = u("all"), [w, nt] = u("all"), [T, rt] = u("all"), [E, it] = u("grid"), [at, D] = u(!1), [ot, st] = u(!1), [O, ct] = Ve();
75
+ s(() => {
76
+ if (O.get("create") === "true") {
77
+ D(!0);
78
+ let e = new URLSearchParams(O);
79
+ e.delete("create"), ct(e, { replace: !0 });
80
+ }
81
+ }, [O, ct]);
82
+ let [k, A] = u(null), [j, lt] = u(!1), M = a((e) => e.connectingAgents), ut = a((e) => e.markAgentConnecting), N = a((e) => e.clearAgentConnecting), dt = c(() => new Set(Object.keys(M)), [M]), ft = l(/* @__PURE__ */ new Map());
74
83
  s(() => {
75
84
  let e = ft.current;
76
- for (let t of Object.keys(k)) {
85
+ for (let t of Object.keys(M)) {
77
86
  if (e.has(t)) continue;
78
87
  let n = setTimeout(() => {
79
- A(t), e.delete(t);
88
+ N(t), e.delete(t);
80
89
  }, 3e4);
81
90
  e.set(t, n);
82
91
  }
83
- for (let [t, n] of e.entries()) t in k || (clearTimeout(n), e.delete(t));
92
+ for (let [t, n] of e.entries()) t in M || (clearTimeout(n), e.delete(t));
84
93
  return () => {
85
94
  for (let t of e.values()) clearTimeout(t);
86
95
  e.clear();
87
96
  };
88
- }, [k, A]);
89
- let [j, M] = u(null), [N, P] = u(!1), pt = l(null), mt = l(null), [F, I] = u(/* @__PURE__ */ new Set()), [ht, L] = u(!1), [R, z] = u(null), [gt, B] = u(null), [_t, V] = u(!1), H = l(null);
97
+ }, [M, N]);
98
+ let [P, F] = u(null), [I, L] = u(!1), pt = l(null), mt = l(null), [R, z] = u(/* @__PURE__ */ new Set()), [ht, gt] = u(!1), [_t, B] = u(null), [vt, V] = u(null), [yt, H] = u(!1), U = l(null);
90
99
  s(() => () => {
91
- H.current && clearTimeout(H.current);
100
+ U.current && clearTimeout(U.current);
92
101
  }, []);
93
- let U = o((e) => {
94
- H.current && clearTimeout(H.current), B(null), z(e), H.current = setTimeout(() => z(null), 3e3);
95
- }, []), W = o((e) => {
96
- H.current && clearTimeout(H.current), z(null), B(e), H.current = setTimeout(() => B(null), 5e3);
97
- }, []), [vt] = ee({ refetchQueries: ["ListAgents"] }), { setDraftTagIds: yt, flushTags: bt } = be("VIBECONTROLS_AGENT"), [xt] = r({ refetchQueries: ["ListAgents"] }), [St] = i({ refetchQueries: ["ListAgents"] }), [Ct] = ne({ refetchQueries: ["ListAgents"] }), [G] = se({ refetchQueries: ["ListAgents"] }), [wt] = ce({ refetchQueries: ["ListAgents"] }), [Tt] = oe({ refetchQueries: ["ListAgents"] }), { refetch: Et } = he(), { data: Dt, loading: Ot, refetch: kt } = ae({
98
- variables: { workspaceId: v ?? "" },
99
- skip: !v,
102
+ let W = o((e) => {
103
+ U.current && clearTimeout(U.current), V(null), B(e), U.current = setTimeout(() => B(null), 3e3);
104
+ }, []), G = o((e) => {
105
+ U.current && clearTimeout(U.current), B(null), V(e), U.current = setTimeout(() => V(null), 5e3);
106
+ }, []), [bt] = ee({ refetchQueries: ["ListAgents"] }), { setDraftTagIds: xt, flushTags: St } = be("VIBECONTROLS_AGENT"), [Ct] = r({ refetchQueries: ["ListAgents"] }), [wt] = i({ refetchQueries: ["ListAgents"] }), [Tt] = ne({ refetchQueries: ["ListAgents"] }), [Et] = se({ refetchQueries: ["ListAgents"] }), [Dt] = ce({ refetchQueries: ["ListAgents"] }), [Ot] = oe({ refetchQueries: ["ListAgents"] }), { refetch: kt } = he(), { data: At, loading: jt, refetch: Mt } = ae({
107
+ variables: { workspaceId: y ?? "" },
108
+ skip: !y,
100
109
  fetchPolicy: "cache-and-network"
101
- }), At = Dt?.targets?.items ?? [], jt = At.length > 0, [Mt] = le({ refetchQueries: ["ListAgents"] }), [Nt] = re({ refetchQueries: ["ListAgents"] }), [Pt] = te({
110
+ }), Nt = At?.targets?.items ?? [], Pt = Nt.length > 0, [Ft] = le({ refetchQueries: ["ListAgents"] }), [It] = re({ refetchQueries: ["ListAgents"] }), [Lt] = te({
102
111
  refetchQueries: ["VibeControlsInitialData", "ListTargets"],
103
112
  awaitRefetchQueries: !0
104
- }), Ft = o(async (e) => {
105
- if (!v || !e.trim()) return null;
113
+ }), Rt = o(async (e) => {
114
+ if (!y || !e.trim()) return null;
106
115
  try {
107
- let { data: t } = await Pt({ variables: {
108
- workspaceId: v,
116
+ let { data: t } = await Lt({ variables: {
117
+ workspaceId: y,
109
118
  input: {
110
119
  type: "DIRECT",
111
120
  name: e.trim()
112
121
  }
113
122
  } }), n = t?.createTarget;
114
- return n ? (Et(), kt(), {
123
+ return n ? (kt(), Mt(), {
115
124
  id: n.id,
116
125
  name: n.name,
117
126
  type: n.type ?? "DIRECT",
@@ -121,27 +130,27 @@ function Ke() {
121
130
  return null;
122
131
  }
123
132
  }, [
124
- Pt,
125
- Et,
133
+ Lt,
126
134
  kt,
127
- v
128
- ]), { data: It, loading: K, error: Lt, refetch: q } = ie({
135
+ Mt,
136
+ y
137
+ ]), { data: zt, loading: K, error: Bt, refetch: q } = ie({
129
138
  variables: {
130
139
  filter: {
131
- isActive: S === "ACTIVE" ? !0 : S === "OFFLINE" ? !1 : void 0,
132
- platform: C === "all" ? void 0 : C
140
+ isActive: C === "ACTIVE" ? !0 : C === "OFFLINE" ? !1 : void 0,
141
+ platform: w === "all" ? void 0 : w
133
142
  },
134
143
  pagination: { limit: 100 }
135
144
  },
136
145
  fetchPolicy: "cache-first",
137
- skip: !v
146
+ skip: !y
138
147
  }), J = fe({
139
148
  fetchPolicy: "cache-and-network",
140
149
  nextFetchPolicy: "cache-first",
141
150
  notifyOnNetworkStatusChange: !0,
142
- skip: !v,
151
+ skip: !y,
143
152
  pollInterval: 3e4
144
- }), [Rt] = de({ fetchPolicy: "network-only" }), { data: Y } = ue({ skip: !v }), zt = J.data === void 0 && Y === void 0, X = c(() => {
153
+ }), [Vt] = de({ fetchPolicy: "network-only" }), { data: Y } = ue({ skip: !y }), Ht = J.data === void 0 && Y === void 0, X = c(() => {
145
154
  let e = /* @__PURE__ */ new Map(), t = Y?.vibecontrolsAgentHealthProbeStream ?? J.data?.vibecontrolsAgentHealthProbes ?? [];
146
155
  for (let n of t) e.set(n.agentId, {
147
156
  agentId: n.agentId,
@@ -149,7 +158,7 @@ function Ke() {
149
158
  errorMessage: n.errorMessage
150
159
  });
151
160
  return e;
152
- }, [J.data, Y]), Z = c(() => (It?.vibecontrolsAgents ?? []).map((e) => ({
161
+ }, [J.data, Y]), Z = c(() => (zt?.vibecontrolsAgents ?? []).map((e) => ({
153
162
  id: e.id,
154
163
  workspaceId: e.workspaceId,
155
164
  name: e.name,
@@ -162,7 +171,7 @@ function Ke() {
162
171
  id: e.id,
163
172
  isActive: e.isActive,
164
173
  metadata: e.metadata
165
- }, X, { probesLoading: zt }),
174
+ }, X, { probesLoading: Ht }),
166
175
  healthError: X.get(e.id)?.errorMessage ?? (e.lastGatewayAuthPushStatus === "failed" ? e.lastGatewayAuthPushError ?? "Gateway-auth push failed" : null),
167
176
  lastHeartbeat: e.lastHeartbeat || null,
168
177
  tunnelUrl: e.tunnelUrl ?? null,
@@ -187,62 +196,62 @@ function Ke() {
187
196
  } : null
188
197
  }))
189
198
  })), [
190
- It?.vibecontrolsAgents,
199
+ zt?.vibecontrolsAgents,
191
200
  X,
192
- zt,
201
+ Ht,
193
202
  dt
194
203
  ]);
195
204
  s(() => {
196
- let e = Object.keys(k);
205
+ let e = Object.keys(M);
197
206
  if (e.length === 0) return;
198
207
  let t = Date.now(), n = Infinity;
199
208
  for (let r of e) {
200
- let e = k[r];
201
- e !== void 0 && (X.get(r)?.healthy === !0 && t >= e ? A(r) : e < n && (n = e));
209
+ let e = M[r];
210
+ e !== void 0 && (X.get(r)?.healthy === !0 && t >= e ? N(r) : e < n && (n = e));
202
211
  }
203
212
  if (n === Infinity) return;
204
213
  let r = Math.max(0, n - t) + 50, i = setTimeout(() => {
205
214
  let e = a.getState().connectingAgents;
206
215
  for (let t of Object.keys(e)) {
207
216
  let n = e[t];
208
- n !== void 0 && X.get(t)?.healthy === !0 && Date.now() >= n && A(t);
217
+ n !== void 0 && X.get(t)?.healthy === !0 && Date.now() >= n && N(t);
209
218
  }
210
219
  }, r);
211
220
  return () => clearTimeout(i);
212
221
  }, [
213
222
  X,
214
- k,
215
- A
223
+ M,
224
+ N
216
225
  ]);
217
226
  let Q = c(() => Z.filter((e) => {
218
- if (x) {
219
- let t = x.toLowerCase();
227
+ if (S) {
228
+ let t = S.toLowerCase();
220
229
  if (!(e.name.toLowerCase().includes(t) || e.hostname?.toLowerCase().includes(t) || e.id.toLowerCase().includes(t))) return !1;
221
230
  }
222
- return !(w !== "all" && !(e.tagAssignments ?? []).some((e) => e.tagId === w));
231
+ return !(T !== "all" && !(e.tagAssignments ?? []).some((e) => e.tagId === T));
223
232
  }), [
224
233
  Z,
225
- x,
226
- w
234
+ S,
235
+ T
227
236
  ]);
228
237
  s(() => () => {
229
- H.current && clearTimeout(H.current);
238
+ U.current && clearTimeout(U.current);
230
239
  }, []);
231
- let Bt = (e) => {
232
- y(`/agents/${e.id}`), Ke?.({
240
+ let Ut = (e) => {
241
+ b(`/agents/${e.id}`), Ke?.({
233
242
  id: e.id,
234
243
  name: e.name,
235
244
  type: e.platform || "unknown",
236
245
  status: e.status || (e.isActive ? "ACTIVE" : "OFFLINE")
237
246
  });
238
247
  }, $ = () => {
239
- E(!0);
240
- }, Vt = async (e) => {
248
+ D(!0);
249
+ }, Wt = async (e) => {
241
250
  try {
242
251
  st(!0);
243
252
  let t = e.tunnelUrl?.trim(), n = e.agentApiKey?.trim();
244
253
  if (t && n) {
245
- let r = await xt({ variables: { input: {
254
+ let r = await Ct({ variables: { input: {
246
255
  tunnelUrl: t,
247
256
  apiKey: n,
248
257
  ...e.name ? { name: e.name } : {},
@@ -251,10 +260,10 @@ function Ke() {
251
260
  if (r.error) throw r.error;
252
261
  let i = r.data?.addVibecontrolsAgentFromTunnel;
253
262
  if (!i?.success) throw Error(i?.error || "Failed to onboard agent — probe or OAuth setup failed.");
254
- if (i.agent?.id) return await bt(i.agent.id), { id: i.agent.id };
263
+ if (i.agent?.id) return await St(i.agent.id), { id: i.agent.id };
255
264
  throw Error("Agent onboarding returned no agent record.");
256
265
  }
257
- let r = await vt({ variables: { input: {
266
+ let r = await bt({ variables: { input: {
258
267
  name: e.name,
259
268
  hostname: e.hostname,
260
269
  platform: e.platform,
@@ -264,63 +273,63 @@ function Ke() {
264
273
  ...e.tunnelUrl ? { tunnelUrl: e.tunnelUrl } : {},
265
274
  ...e.tunnelStatus ? { tunnelStatus: e.tunnelStatus } : {}
266
275
  } } }), i = r.data?.createVibecontrolsAgent;
267
- if (i?.id) return await bt(i.id), { id: i.id };
276
+ if (i?.id) return await St(i.id), { id: i.id };
268
277
  throw r.error ? r.error : Error("Agent creation failed — no data returned from the server.");
269
278
  } catch (e) {
270
279
  if (t(e)) {
271
- n(), V(!0), E(!1);
280
+ n(), H(!0), D(!1);
272
281
  return;
273
282
  }
274
283
  throw console.error("Failed to create agent:", e), e;
275
284
  } finally {
276
285
  st(!1);
277
286
  }
278
- }, Ht = async (e) => {
287
+ }, Gt = async (e) => {
279
288
  try {
280
- let t = (await G({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
289
+ let t = (await Et({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
281
290
  if (!t?.success) {
282
291
  if (/not yet configured|awaiting[-\s_]config/i.test(t?.error ?? "")) {
283
- let t = (await Tt({ variables: { input: { agentId: e.id } } })).data?.setupAgentGatewayAuth;
292
+ let t = (await Ot({ variables: { input: { agentId: e.id } } })).data?.setupAgentGatewayAuth;
284
293
  if (t?.error) throw Error(`Agent needs credentials. Auto re-push failed: ${t.error}. Try "Re-push credentials" in Security tab.`);
285
294
  if (!t) throw Error("Agent needs credentials. Auto re-push returned no result. Try \"Re-push credentials\" in Security tab.");
286
295
  let n = t.agent?.lastGatewayAuthPushStatus, r = t.agent?.lastGatewayAuthPushError;
287
296
  if (n === "failed") throw Error(`Credentials created but push to agent tunnel failed: ${r || "unknown error"}. Check that the agent can reach the workspace's gateway URLs from its host network.`);
288
- let i = (await G({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
297
+ let i = (await Et({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
289
298
  if (!i?.success) throw Error(`Credentials pushed but lifecycle/start failed: ${i?.error || "unknown error"}. The agent has fresh credentials; try clicking Reconnect again or check vibe status on the host.`);
290
- await St({ variables: { id: e.id } }), U(`Agent "${e.name}" re-credentialed and started.`);
299
+ await wt({ variables: { id: e.id } }), W(`Agent "${e.name}" re-credentialed and started.`);
291
300
  return;
292
301
  }
293
302
  throw Error(t?.error || "Failed to start agent");
294
303
  }
295
- await St({ variables: { id: e.id } }), U(`Agent "${e.name}" started`);
304
+ await wt({ variables: { id: e.id } }), W(`Agent "${e.name}" started`);
296
305
  } catch (e) {
297
- console.error("Failed to start agent:", e), W(e instanceof Error ? e.message : "Failed to start agent");
306
+ console.error("Failed to start agent:", e), G(e instanceof Error ? e.message : "Failed to start agent");
298
307
  }
299
- }, Ut = async (e) => {
308
+ }, Kt = async (e) => {
300
309
  try {
301
- let t = (await wt({ variables: { agentId: e.id } })).data?.stopVibecontrolsAgent;
310
+ let t = (await Dt({ variables: { agentId: e.id } })).data?.stopVibecontrolsAgent;
302
311
  if (!t?.success) throw Error(t?.error || "Failed to stop agent");
303
- await Ct({ variables: { id: e.id } }), U(`Agent "${e.name}" stopped`);
312
+ await Tt({ variables: { id: e.id } }), W(`Agent "${e.name}" stopped`);
304
313
  } catch (e) {
305
- console.error("Failed to stop agent:", e), W(e instanceof Error ? e.message : "Failed to stop agent");
314
+ console.error("Failed to stop agent:", e), G(e instanceof Error ? e.message : "Failed to stop agent");
306
315
  }
307
- }, Wt = (e) => {
308
- M(e);
309
- }, Gt = async () => {
310
- if (!j) return;
311
- let e = j;
312
- P(!0);
316
+ }, qt = (e) => {
317
+ F(e);
318
+ }, Jt = async () => {
319
+ if (!P) return;
320
+ let e = P;
321
+ L(!0);
313
322
  try {
314
- await Ct({
323
+ await Tt({
315
324
  variables: { id: e.id },
316
325
  refetchQueries: []
317
326
  });
318
327
  } catch (e) {
319
- console.error("Failed to deactivate agent:", e), W(e instanceof Error ? e.message : "Failed to disconnect agent"), P(!1), M(null), await q();
328
+ console.error("Failed to deactivate agent:", e), G(e instanceof Error ? e.message : "Failed to disconnect agent"), L(!1), F(null), await q();
320
329
  return;
321
330
  }
322
331
  try {
323
- await Mt({
332
+ await Ft({
324
333
  variables: {
325
334
  id: e.id,
326
335
  input: {
@@ -330,20 +339,20 @@ function Ke() {
330
339
  }
331
340
  },
332
341
  refetchQueries: []
333
- }), U(`Agent "${e.name}" disconnected`);
342
+ }), W(`Agent "${e.name}" disconnected`);
334
343
  } catch (e) {
335
- console.error("Failed to clear tunnel fields:", e), W("Agent marked offline, but failed to clear connection fields — clear them manually in Settings.");
344
+ console.error("Failed to clear tunnel fields:", e), G("Agent marked offline, but failed to clear connection fields — clear them manually in Settings.");
336
345
  }
337
- P(!1), M(null), await q();
338
- }, Kt = (e) => {
339
- y(`/agents/${e.id}`);
340
- }, qt = (e) => {
341
- O(e);
342
- }, Jt = async () => {
343
- if (!D) return;
344
- let e = D.id, t = pt.current?.value?.trim() || "", n = mt.current?.value?.trim() || "";
346
+ L(!1), F(null), await q();
347
+ }, Yt = (e) => {
348
+ b(`/agents/${e.id}`);
349
+ }, Xt = (e) => {
350
+ A(e);
351
+ }, Zt = async () => {
352
+ if (!k) return;
353
+ let e = k.id, t = pt.current?.value?.trim() || "", n = mt.current?.value?.trim() || "";
345
354
  try {
346
- lt(!0), await Mt({
355
+ lt(!0), await Ft({
347
356
  variables: {
348
357
  id: e,
349
358
  input: {
@@ -353,102 +362,102 @@ function Ke() {
353
362
  }
354
363
  },
355
364
  refetchQueries: ["ListAgents", "VibecontrolsAgentHealthProbes"]
356
- }), t && ut(e), O(null);
365
+ }), t && ut(e), A(null);
357
366
  } catch (e) {
358
367
  console.error("Failed to update tunnel settings:", e);
359
368
  } finally {
360
369
  lt(!1);
361
370
  }
362
- }, Yt = o((e) => {
363
- I((t) => {
371
+ }, Qt = o((e) => {
372
+ z((t) => {
364
373
  let n = new Set(t);
365
374
  return n.has(e) ? n.delete(e) : n.add(e), n;
366
375
  });
367
- }, []), Xt = o(() => {
368
- I(new Set(Q.map((e) => e.id)));
369
- }, [Q]), Zt = o(() => {
370
- I(/* @__PURE__ */ new Set());
371
- }, []), Qt = Q.length > 0 && F.size === Q.length, $t = F.size > 0, en = o(async () => {
372
- if (F.size !== 0 && window.confirm(b("agentsPage.bulkDeleteConfirm", "Are you sure you want to remove {{count}} agent(s)? This cannot be undone.", { count: F.size }))) {
373
- L(!0);
376
+ }, []), $t = o(() => {
377
+ z(new Set(Q.map((e) => e.id)));
378
+ }, [Q]), en = o(() => {
379
+ z(/* @__PURE__ */ new Set());
380
+ }, []), tn = Q.length > 0 && R.size === Q.length, nn = R.size > 0, rn = o(async () => {
381
+ if (R.size !== 0 && window.confirm(x("agentsPage.bulkDeleteConfirm", "Are you sure you want to remove {{count}} agent(s)? This cannot be undone.", { count: R.size }))) {
382
+ gt(!0);
374
383
  try {
375
- let e = await Promise.allSettled(Array.from(F).map((e) => Nt({ variables: { id: e } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.filter((e) => e.status === "rejected").length;
376
- n > 0 ? W(`Removed ${t}, failed to remove ${n} agent${n === 1 ? "" : "s"}`) : U(`Removed ${t} agent${t === 1 ? "" : "s"}`), I(/* @__PURE__ */ new Set());
384
+ let e = await Promise.allSettled(Array.from(R).map((e) => It({ variables: { id: e } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.filter((e) => e.status === "rejected").length;
385
+ n > 0 ? G(`Removed ${t}, failed to remove ${n} agent${n === 1 ? "" : "s"}`) : W(`Removed ${t} agent${t === 1 ? "" : "s"}`), z(/* @__PURE__ */ new Set());
377
386
  } catch (e) {
378
- W(e instanceof Error ? e.message : "Failed to remove agents");
387
+ G(e instanceof Error ? e.message : "Failed to remove agents");
379
388
  } finally {
380
- L(!1);
389
+ gt(!1);
381
390
  }
382
391
  }
383
392
  }, [
384
- F,
385
- Nt,
386
- W,
387
- U
388
- ]), tn = {
393
+ R,
394
+ It,
395
+ G,
396
+ W
397
+ ]), an = {
389
398
  total: Z.length,
390
399
  active: Z.filter((e) => e.status === "ACTIVE").length,
391
400
  offline: Z.filter((e) => e.status !== "ACTIVE").length
392
401
  };
393
- return Je ? /* @__PURE__ */ h(_, {
402
+ return Je ? /* @__PURE__ */ h(v, {
394
403
  className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
395
- children: /* @__PURE__ */ h(_e, { message: b("agentsPage.loadingPermissions", "Loading permissions...") })
396
- }) : Ye && Ye.permissionStrings?.length > 0 && !$e ? /* @__PURE__ */ h(_, {
404
+ children: /* @__PURE__ */ h(_e, { message: x("agentsPage.loadingPermissions", "Loading permissions...") })
405
+ }) : Ye && Ye.permissionStrings?.length > 0 && !$e ? /* @__PURE__ */ h(v, {
397
406
  className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
398
407
  children: /* @__PURE__ */ h(We, {
399
- title: b("agentsPage.accessDeniedTitle", "Access Denied"),
400
- description: b("agentsPage.accessDeniedDescription", "You don't have permission to view agents. Contact your workspace administrator for access.")
408
+ title: x("agentsPage.accessDeniedTitle", "Access Denied"),
409
+ description: x("agentsPage.accessDeniedDescription", "You don't have permission to view agents. Contact your workspace administrator for access.")
401
410
  })
402
- }) : Lt && Z.length === 0 ? /* @__PURE__ */ h(_, {
411
+ }) : Bt && Z.length === 0 ? /* @__PURE__ */ h(v, {
403
412
  className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
404
413
  children: /* @__PURE__ */ h(ve, {
405
- title: b("agentsPage.failedLoad", "Failed to load agents"),
406
- message: Lt.message,
414
+ title: x("agentsPage.failedLoad", "Failed to load agents"),
415
+ message: Bt.message,
407
416
  onRetry: () => q()
408
417
  })
409
- }) : /* @__PURE__ */ g(_, {
418
+ }) : /* @__PURE__ */ g(v, {
410
419
  className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
411
420
  children: [
412
- R && /* @__PURE__ */ h("div", {
421
+ _t && /* @__PURE__ */ h("div", {
413
422
  className: "fixed top-4 left-4 right-4 sm:left-auto z-[101] bg-status-success-bg text-status-success-text px-4 py-3 rounded-md shadow-lg text-sm",
414
- children: R
423
+ children: _t
415
424
  }),
416
- gt && /* @__PURE__ */ h("div", {
425
+ vt && /* @__PURE__ */ h("div", {
417
426
  className: "fixed top-4 right-4 z-[101] bg-status-error-bg text-status-error-text px-4 py-3 rounded-md shadow-lg text-sm",
418
- children: gt
427
+ children: vt
419
428
  }),
420
429
  /* @__PURE__ */ h(ge, {
421
- title: b("agentsPage.title", "Agents"),
422
- description: b("agentsPage.descriptionOnline", "{{active}} of {{total}} agents online", {
423
- active: tn.active,
424
- total: tn.total
430
+ title: x("agentsPage.title", "Agents"),
431
+ description: x("agentsPage.descriptionOnline", "{{active}} of {{total}} agents online", {
432
+ active: an.active,
433
+ total: an.total
425
434
  }),
426
435
  actions: /* @__PURE__ */ g("div", {
427
436
  className: "flex w-full flex-col items-end gap-2 sm:w-auto sm:flex-row sm:items-center",
428
437
  children: [/* @__PURE__ */ h("button", {
429
438
  type: "button",
430
439
  onClick: () => {
431
- q(), Rt();
440
+ q(), Vt();
432
441
  },
433
442
  disabled: K || J.loading,
434
443
  className: "flex items-center justify-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
435
- title: b("agentsPage.refreshTitle", "Refresh agents"),
444
+ title: x("agentsPage.refreshTitle", "Refresh agents"),
436
445
  children: /* @__PURE__ */ h(Re, { className: `size-4 ${K || J.loading ? "animate-spin" : ""}` })
437
- }), jt ? /* @__PURE__ */ h(Ge, {
446
+ }), Pt ? /* @__PURE__ */ h(Ge, {
438
447
  permission: De.AGENT_CREATE,
439
448
  deniedBehavior: "disable",
440
- deniedTooltip: b("agentsPage.deniedCreateTooltip", "You don't have permission to create agents"),
449
+ deniedTooltip: x("agentsPage.deniedCreateTooltip", "You don't have permission to create agents"),
441
450
  children: /* @__PURE__ */ g("button", {
442
451
  type: "button",
443
452
  onClick: $,
444
453
  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 disabled:opacity-50 disabled:cursor-not-allowed",
445
- children: [/* @__PURE__ */ h(d, { className: "size-4" }), b("agentsPage.addAgent", "Add Agent")]
454
+ children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
446
455
  })
447
456
  }) : /* @__PURE__ */ g("button", {
448
457
  type: "button",
449
458
  onClick: $,
450
459
  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",
451
- children: [/* @__PURE__ */ h(d, { className: "size-4" }), b("agentsPage.addAgent", "Add Agent")]
460
+ children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
452
461
  })]
453
462
  })
454
463
  }),
@@ -465,27 +474,27 @@ function Ke() {
465
474
  children: [/* @__PURE__ */ g("div", {
466
475
  className: "flex items-center gap-2",
467
476
  children: [/* @__PURE__ */ h(Se, {
468
- value: x,
477
+ value: S,
469
478
  onChange: et,
470
- placeholder: b("agentsPage.searchPlaceholder", "Search agents..."),
479
+ placeholder: x("agentsPage.searchPlaceholder", "Search agents..."),
471
480
  className: "flex-1 sm:w-64 sm:flex-none"
472
481
  }), /* @__PURE__ */ g("div", {
473
482
  className: "flex items-center gap-1 bg-bg-sunken rounded-md p-1 flex-shrink-0",
474
483
  children: [/* @__PURE__ */ h("button", {
475
484
  type: "button",
476
485
  onClick: () => {
477
- it("grid"), I(/* @__PURE__ */ new Set());
486
+ it("grid"), z(/* @__PURE__ */ new Set());
478
487
  },
479
- className: `p-1.5 sm:p-2 rounded ${T === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
480
- title: b("agentsPage.gridViewTitle", "Grid view"),
488
+ className: `p-1.5 sm:p-2 rounded ${E === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
489
+ title: x("agentsPage.gridViewTitle", "Grid view"),
481
490
  children: /* @__PURE__ */ h(Ie, { className: "size-4 text-text-secondary" })
482
491
  }), /* @__PURE__ */ h("button", {
483
492
  type: "button",
484
493
  onClick: () => {
485
- it("list"), I(/* @__PURE__ */ new Set());
494
+ it("list"), z(/* @__PURE__ */ new Set());
486
495
  },
487
- className: `p-1.5 sm:p-2 rounded ${T === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
488
- title: b("agentsPage.listViewTitle", "List view"),
496
+ className: `p-1.5 sm:p-2 rounded ${E === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
497
+ title: x("agentsPage.listViewTitle", "List view"),
489
498
  children: /* @__PURE__ */ h(Le, { className: "size-4 text-text-secondary" })
490
499
  })]
491
500
  })]
@@ -493,20 +502,20 @@ function Ke() {
493
502
  className: "flex items-center gap-2 sm:gap-3 flex-wrap",
494
503
  children: [
495
504
  /* @__PURE__ */ h(Ce, {
496
- label: b("agentsPage.filterStatus", "Status"),
497
- value: S,
505
+ label: x("agentsPage.filterStatus", "Status"),
506
+ value: C,
498
507
  options: Ze,
499
508
  onChange: tt
500
509
  }),
501
510
  /* @__PURE__ */ h(Ce, {
502
- label: b("agentsPage.filterPlatform", "Platform"),
503
- value: C,
511
+ label: x("agentsPage.filterPlatform", "Platform"),
512
+ value: w,
504
513
  options: Qe,
505
514
  onChange: nt
506
515
  }),
507
516
  /* @__PURE__ */ h(Ee, {
508
- label: b("agentsPage.filterTag", "Tag"),
509
- value: w,
517
+ label: x("agentsPage.filterTag", "Tag"),
518
+ value: T,
510
519
  onChange: rt
511
520
  })
512
521
  ]
@@ -518,49 +527,49 @@ function Ke() {
518
527
  className: "ml-auto flex items-center gap-2",
519
528
  children: /* @__PURE__ */ g("button", {
520
529
  type: "button",
521
- onClick: Qt ? Zt : Xt,
530
+ onClick: tn ? en : $t,
522
531
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
523
- children: [/* @__PURE__ */ h(Fe, { className: "size-3.5" }), Qt ? b("agentsPage.deselectAll", "Deselect All") : b("agentsPage.selectAll", "Select All")]
532
+ children: [/* @__PURE__ */ h(Fe, { className: "size-3.5" }), tn ? x("agentsPage.deselectAll", "Deselect All") : x("agentsPage.selectAll", "Select All")]
524
533
  })
525
534
  })
526
535
  }),
527
- $t && /* @__PURE__ */ g("div", {
536
+ nn && /* @__PURE__ */ g("div", {
528
537
  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",
529
538
  children: [/* @__PURE__ */ h("span", {
530
539
  className: "text-sm font-medium text-text-primary",
531
- children: b("agentsPage.selectedCount", "{{count}} agents selected", { count: F.size })
540
+ children: x("agentsPage.selectedCount", "{{count}} agents selected", { count: R.size })
532
541
  }), /* @__PURE__ */ g("div", {
533
542
  className: "flex items-center gap-1.5 sm:ml-auto",
534
543
  children: [/* @__PURE__ */ g("button", {
535
544
  type: "button",
536
- onClick: en,
545
+ onClick: rn,
537
546
  disabled: ht,
538
547
  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",
539
548
  children: [
540
549
  /* @__PURE__ */ h(ze, { className: "size-3" }),
541
550
  " ",
542
- b("agentsPage.remove", "Remove")
551
+ x("agentsPage.remove", "Remove")
543
552
  ]
544
553
  }), /* @__PURE__ */ g("button", {
545
554
  type: "button",
546
- onClick: Zt,
555
+ onClick: en,
547
556
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
548
557
  children: [
549
558
  /* @__PURE__ */ h(Be, { className: "size-3" }),
550
559
  " ",
551
- b("agentsPage.deselect", "Deselect")
560
+ x("agentsPage.deselect", "Deselect")
552
561
  ]
553
562
  })]
554
563
  })]
555
564
  }),
556
- x || S !== "all" || C !== "all" ? /* @__PURE__ */ g("p", {
565
+ S || C !== "all" || w !== "all" ? /* @__PURE__ */ g("p", {
557
566
  className: "text-sm text-text-secondary",
558
- children: [b("agentsPage.showingResults", "Showing {{filtered}} of {{total}} agents", {
567
+ children: [x("agentsPage.showingResults", "Showing {{filtered}} of {{total}} agents", {
559
568
  filtered: Q.length,
560
569
  total: Z.length
561
570
  }), K && /* @__PURE__ */ h("span", {
562
571
  className: "ml-2 text-text-muted",
563
- children: b("agentsPage.refreshing", "(refreshing...)")
572
+ children: x("agentsPage.refreshing", "(refreshing...)")
564
573
  })]
565
574
  }) : null,
566
575
  K && Z.length === 0 ? /* @__PURE__ */ h(Oe, {
@@ -568,92 +577,92 @@ function Ke() {
568
577
  count: 6
569
578
  }) : Q.length > 0 ? /* @__PURE__ */ h(f, {
570
579
  mode: "wait",
571
- children: T === "grid" ? /* @__PURE__ */ h(Ue, {
580
+ children: E === "grid" ? /* @__PURE__ */ h(Ue, {
572
581
  stagger: .04,
573
582
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
574
- children: Q.map((e) => /* @__PURE__ */ h(He, {
583
+ children: Q.map((e) => /* @__PURE__ */ h(_, {
575
584
  className: "h-full",
576
585
  children: /* @__PURE__ */ h(ke, {
577
586
  agent: e,
578
- onSelect: Bt,
579
- onStart: Ht,
580
- onStop: Ut,
581
- onDisconnect: Wt,
582
- onConfigure: Kt,
583
- onEditTunnelUrl: qt,
584
- selected: F.has(e.id),
585
- onToggleSelect: () => Yt(e.id),
587
+ onSelect: Ut,
588
+ onStart: Gt,
589
+ onStop: Kt,
590
+ onDisconnect: qt,
591
+ onConfigure: Yt,
592
+ onEditTunnelUrl: Xt,
593
+ selected: R.has(e.id),
594
+ onToggleSelect: () => Qt(e.id),
586
595
  healthErrorMessage: e.healthError ?? null
587
596
  })
588
597
  }, e.id))
589
598
  }, "grid-view") : /* @__PURE__ */ h(Ue, {
590
599
  stagger: .04,
591
- children: /* @__PURE__ */ h(He, {
600
+ children: /* @__PURE__ */ h(_, {
592
601
  variant: "fadeRight",
593
602
  children: /* @__PURE__ */ h(Ae, {
594
603
  agents: Q,
595
- onSelect: Bt,
596
- onStart: Ht,
597
- onStop: Ut,
598
- onDisconnect: Wt,
599
- onSettings: Kt
604
+ onSelect: Ut,
605
+ onStart: Gt,
606
+ onStop: Kt,
607
+ onDisconnect: qt,
608
+ onSettings: Yt
600
609
  })
601
610
  })
602
611
  }, "list-view")
603
612
  }) : /* @__PURE__ */ h(xe, {
604
613
  icon: /* @__PURE__ */ h(Pe, { className: "size-8 text-text-secondary" }),
605
- title: x || S !== "all" || C !== "all" ? b("agentsPage.emptyNoAgentsFound", "No agents found") : b("agentsPage.emptyNoAgentsConfigured", "No agents configured"),
606
- description: x || S !== "all" || C !== "all" ? b("agentsPage.emptyAdjustSearch", "Try adjusting your search or filters") : b("agentsPage.emptyNoAgentsDescription", "Install the CLI agent on your machine, then add it here. You can create a target inline while adding the agent."),
607
- action: !x && S === "all" && C === "all" ? /* @__PURE__ */ g("div", {
614
+ title: S || C !== "all" || w !== "all" ? x("agentsPage.emptyNoAgentsFound", "No agents found") : x("agentsPage.emptyNoAgentsConfigured", "No agents configured"),
615
+ description: S || C !== "all" || w !== "all" ? x("agentsPage.emptyAdjustSearch", "Try adjusting your search or filters") : x("agentsPage.emptyNoAgentsDescription", "Install the CLI agent on your machine, then add it here. You can create a target inline while adding the agent."),
616
+ action: !S && C === "all" && w === "all" ? /* @__PURE__ */ g("div", {
608
617
  className: "flex flex-wrap items-center gap-3",
609
618
  children: [
610
619
  /* @__PURE__ */ g("button", {
611
620
  type: "button",
612
621
  onClick: $,
613
622
  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",
614
- children: [/* @__PURE__ */ h(d, { className: "size-4" }), b("agentsPage.addAgent", "Add Agent")]
623
+ children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
615
624
  }),
616
625
  /* @__PURE__ */ h("button", {
617
626
  type: "button",
618
- onClick: () => y("/getting-started"),
627
+ onClick: () => b("/getting-started"),
619
628
  className: "flex items-center gap-2 px-4 py-2 border border-border-default text-text-primary rounded-md hover:bg-bg-sunken transition-colors text-sm",
620
- children: b("agentsPage.setupGuide", "Setup guide")
629
+ children: x("agentsPage.setupGuide", "Setup guide")
621
630
  }),
622
631
  /* @__PURE__ */ h(Te, { prompt: "What is an Agent in VibeControls and how do I add one?" })
623
632
  ]
624
633
  }) : void 0
625
634
  }),
626
635
  at && /* @__PURE__ */ h(je, {
627
- onSubmit: Vt,
628
- onCancel: () => E(!1),
636
+ onSubmit: Wt,
637
+ onCancel: () => D(!1),
629
638
  isLoading: ot,
630
639
  onNavigate: (e) => {
631
- E(!1), y(e);
640
+ D(!1), b(e);
632
641
  },
633
- targets: At.map((e) => ({
642
+ targets: Nt.map((e) => ({
634
643
  id: e.id,
635
644
  name: e.name,
636
645
  type: e.type || "DIRECT",
637
646
  status: e.status
638
647
  })),
639
- targetsLoading: Ot,
640
- onCreateTarget: Ft,
648
+ targetsLoading: jt,
649
+ onCreateTarget: Rt,
641
650
  extraSection: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h3", {
642
651
  className: "text-sm font-medium text-text-secondary mb-2",
643
- children: b("agents.tags", "Tags")
652
+ children: x("agents.tags", "Tags")
644
653
  }), /* @__PURE__ */ h(ye, {
645
654
  entityType: "VIBECONTROLS_AGENT",
646
- onDraftChange: yt
655
+ onDraftChange: xt
647
656
  })] })
648
657
  }),
649
- /* @__PURE__ */ h(f, { children: j && /* @__PURE__ */ h("div", {
658
+ /* @__PURE__ */ h(f, { children: P && /* @__PURE__ */ h("div", {
650
659
  role: "button",
651
660
  tabIndex: 0,
652
661
  onKeyDown: (e) => {
653
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), !N && M(null));
662
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), !I && F(null));
654
663
  },
655
664
  className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4 sm:p-6",
656
- onClick: () => !N && M(null),
665
+ onClick: () => !I && F(null),
657
666
  children: /* @__PURE__ */ g(p.div, {
658
667
  initial: {
659
668
  opacity: 0,
@@ -677,14 +686,14 @@ function Ke() {
677
686
  }),
678
687
  /* @__PURE__ */ h("p", {
679
688
  className: "text-sm text-text-secondary mb-4",
680
- children: Me(j) === "OFFLINE" ? /* @__PURE__ */ g(m, { children: [
689
+ children: Me(P) === "OFFLINE" ? /* @__PURE__ */ g(m, { children: [
681
690
  "Clear the stored tunnel connection for",
682
691
  " ",
683
- /* @__PURE__ */ h("strong", { children: j.name }),
692
+ /* @__PURE__ */ h("strong", { children: P.name }),
684
693
  "? This will remove the tunnel URL and API key from this offline agent."
685
694
  ] }) : /* @__PURE__ */ g(m, { children: [
686
695
  "Mark ",
687
- /* @__PURE__ */ h("strong", { children: j.name }),
696
+ /* @__PURE__ */ h("strong", { children: P.name }),
688
697
  " as offline and clear its tunnel connection? The agent process will not be stopped automatically — you may need to stop it manually on the host machine."
689
698
  ] })
690
699
  }),
@@ -692,29 +701,29 @@ function Ke() {
692
701
  className: "flex justify-end gap-2",
693
702
  children: [/* @__PURE__ */ h("button", {
694
703
  type: "button",
695
- onClick: () => M(null),
696
- disabled: N,
704
+ onClick: () => F(null),
705
+ disabled: I,
697
706
  className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
698
707
  children: "Cancel"
699
708
  }), /* @__PURE__ */ h("button", {
700
709
  type: "button",
701
- onClick: Gt,
702
- disabled: N,
710
+ onClick: Jt,
711
+ disabled: I,
703
712
  className: "px-4 py-2 text-sm bg-action-danger-bg text-action-danger-text rounded-md hover:bg-action-danger-bg-hover transition-colors disabled:opacity-50",
704
- children: N ? "Disconnecting..." : "Disconnect"
713
+ children: I ? "Disconnecting..." : "Disconnect"
705
714
  })]
706
715
  })
707
716
  ]
708
717
  })
709
718
  }) }),
710
- /* @__PURE__ */ h(f, { children: D && /* @__PURE__ */ h("div", {
719
+ /* @__PURE__ */ h(f, { children: k && /* @__PURE__ */ h("div", {
711
720
  role: "button",
712
721
  tabIndex: 0,
713
722
  onKeyDown: (e) => {
714
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O(null));
723
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), A(null));
715
724
  },
716
725
  className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4 sm:p-6",
717
- onClick: () => O(null),
726
+ onClick: () => A(null),
718
727
  children: /* @__PURE__ */ g(p.div, {
719
728
  initial: {
720
729
  opacity: 0,
@@ -734,47 +743,47 @@ function Ke() {
734
743
  children: [
735
744
  /* @__PURE__ */ h("h3", {
736
745
  className: "text-lg font-semibold text-text-primary mb-1",
737
- children: b("agentsPage.editTunnelTitle", "Edit Tunnel")
746
+ children: x("agentsPage.editTunnelTitle", "Edit Tunnel")
738
747
  }),
739
748
  /* @__PURE__ */ h("p", {
740
749
  className: "text-sm text-text-secondary mb-4",
741
- children: b("agentsPage.editTunnelDescription", "Configure the cloudflared tunnel URL and API key for {{name}}.", { name: D.name })
750
+ children: x("agentsPage.editTunnelDescription", "Configure the cloudflared tunnel URL and API key for {{name}}.", { name: k.name })
742
751
  }),
743
752
  /* @__PURE__ */ g("div", {
744
753
  className: "space-y-4",
745
754
  children: [/* @__PURE__ */ g("div", { children: [
746
755
  /* @__PURE__ */ h("label", {
747
756
  className: "block text-sm font-medium text-text-primary mb-1",
748
- children: b("agentsPage.tunnelUrlLabel", "Tunnel URL")
757
+ children: x("agentsPage.tunnelUrlLabel", "Tunnel URL")
749
758
  }),
750
759
  /* @__PURE__ */ h("input", {
751
760
  "aria-label": "control",
752
761
  ref: pt,
753
762
  type: "url",
754
- defaultValue: D.tunnelUrl || "",
755
- placeholder: b("agentsPage.tunnelUrlPlaceholder", "https://example.trycloudflare.com"),
763
+ defaultValue: k.tunnelUrl || "",
764
+ placeholder: x("agentsPage.tunnelUrlPlaceholder", "https://example.trycloudflare.com"),
756
765
  className: "w-full px-3 py-2 border border-border-default rounded-md bg-bg-sunken text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-border-strong"
757
766
  }),
758
767
  /* @__PURE__ */ h("p", {
759
768
  className: "text-xs text-text-muted mt-1",
760
- children: b("agentsPage.tunnelUrlHint", "Leave empty to clear. Agents with auto-tunnel report this automatically on startup.")
769
+ children: x("agentsPage.tunnelUrlHint", "Leave empty to clear. Agents with auto-tunnel report this automatically on startup.")
761
770
  })
762
771
  ] }), /* @__PURE__ */ g("div", { children: [
763
772
  /* @__PURE__ */ h("label", {
764
773
  className: "block text-sm font-medium text-text-primary mb-1",
765
- children: b("agentsPage.agentApiKeyLabel", "Agent API Key")
774
+ children: x("agentsPage.agentApiKeyLabel", "Agent API Key")
766
775
  }),
767
776
  /* @__PURE__ */ h("input", {
768
777
  "aria-label": "control",
769
778
  ref: mt,
770
779
  type: "text",
771
- defaultValue: D.agentApiKey || "",
772
- placeholder: b("agentsPage.agentApiKeyPlaceholder", "sk-agent-..."),
780
+ defaultValue: k.agentApiKey || "",
781
+ placeholder: x("agentsPage.agentApiKeyPlaceholder", "sk-agent-..."),
773
782
  className: "w-full px-3 py-2 border border-border-default rounded-md bg-bg-sunken text-text-primary font-mono text-sm placeholder:text-text-placeholder focus:outline-none focus:border-border-strong"
774
783
  }),
775
784
  /* @__PURE__ */ h("p", {
776
785
  className: "text-xs text-text-muted mt-1",
777
- children: b("agentsPage.agentApiKeyHint", "Authenticates requests to the agent. Typically changes on each agent restart.")
786
+ children: x("agentsPage.agentApiKeyHint", "Authenticates requests to the agent. Typically changes on each agent restart.")
778
787
  })
779
788
  ] })]
780
789
  }),
@@ -782,25 +791,25 @@ function Ke() {
782
791
  className: "flex justify-end gap-2 mt-5",
783
792
  children: [/* @__PURE__ */ h("button", {
784
793
  type: "button",
785
- onClick: () => O(null),
794
+ onClick: () => A(null),
786
795
  className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
787
- children: b("agentsPage.cancel", "Cancel")
796
+ children: x("agentsPage.cancel", "Cancel")
788
797
  }), /* @__PURE__ */ h("button", {
789
798
  type: "button",
790
- onClick: Jt,
791
- disabled: ct,
799
+ onClick: Zt,
800
+ disabled: j,
792
801
  className: "px-4 py-2 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
793
- children: ct ? b("agentsPage.saving", "Saving...") : b("agentsPage.save", "Save")
802
+ children: j ? x("agentsPage.saving", "Saving...") : x("agentsPage.save", "Save")
794
803
  })]
795
804
  })
796
805
  ]
797
806
  })
798
807
  }) }),
799
808
  /* @__PURE__ */ h(e, {
800
- isOpen: _t,
801
- onClose: () => V(!1),
809
+ isOpen: yt,
810
+ onClose: () => H(!1),
802
811
  onConfirm: () => {
803
- V(!1), y("/billing");
812
+ H(!1), b("/billing");
804
813
  },
805
814
  title: "Agent Quota Reached",
806
815
  message: "You've used all available agent slots on your current plan. Upgrade your plan to register more agents."