@llmnative/runner 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { RUNNER_KEY_PROVIDERS as e, RunnerError as t } from "./client.mjs";
2
2
  import { RUNNER_REQUIREMENTS as n, checkRunner as r, installCommand as i, isDomain as a, lookupDomain as o, verifiedInstallCommands as s } from "./steps.mjs";
3
3
  import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
4
- import { ActionButton as f, Alert as p, Badge as m, Card as h, Code as g, DescriptionList as _, Form as v, LoadingButton as y, Modal as b, ModalYesNo as x, Password as S, Select as C, String as w, Switch as T, TextArea as E } from "@llmnative/react";
5
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
6
- import { createPortal as k } from "react-dom";
4
+ import { ActionButton as f, Alert as p, Badge as m, Card as h, Code as g, DescriptionList as _, Form as v, LoadingButton as y, Modal as b, ModalYesNo as x, Password as S, Select as C, SortableList as w, String as T, Switch as E, TextArea as D } from "@llmnative/react";
5
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
6
+ import { createPortal as j } from "react-dom";
7
7
  // src/ui/texts.ts
8
- var A = {
8
+ var M = {
9
9
  accountsTitleUser: "My subscriptions",
10
10
  accountsTitleTenant: "Subscriptions of the tenant",
11
11
  accountsIntroUser: "Connect your own subscription: it is used only for your requests. Without one, the API keys of the workspace are used.",
@@ -32,6 +32,26 @@ var A = {
32
32
  keyProvider: "Provider",
33
33
  keyLabel: "API key of {provider}",
34
34
  termsNote: "A Pro or Max subscription is personal: connect only your own.",
35
+ accountsSection: "{name} ({count})",
36
+ accountsByUse: "API keys of the providers by use ({count})",
37
+ accountsAdd: "Add subscription",
38
+ accountsAvailable: "Available",
39
+ accountsAddedOn: "Added on {date}",
40
+ accountsUnnamed: "Account {n}",
41
+ accountsOrderHint: "They are used in this order: when one runs out of credit, the turn goes to the next. Drag a card, or use the arrows on its handle, to change it.",
42
+ accountsName: "Name (the email of the account)",
43
+ accountsRenameTitle: "Name of the account",
44
+ accountsRenameAria: "Rename {name}",
45
+ accountsRemoveAria: "Disconnect {name}",
46
+ accountsSave: "Save",
47
+ claudeMultiWarning: "Pro and Max are personal subscriptions: Anthropic does not allow several accounts to get around the limits, and doing so risks suspension. Add only the subscription of another person who makes it available, or seats of Claude Team or Enterprise.",
48
+ claudeCopy: "Copy the link",
49
+ claudeCopied: "Link copied",
50
+ claudeManual: "I have a token made with claude setup-token",
51
+ claudeBackToLogin: "Sign in with Anthropic instead",
52
+ claudeTokenIntro: "Run claude setup-token on a computer signed in to the account, then paste the token it prints.",
53
+ claudeToken: "Token (claude setup-token)",
54
+ keyAddOf: "Add {provider}",
35
55
  guideTitle: "Install a runner by hand",
36
56
  guideServerTitle: "1. A VPS",
37
57
  guideServer: "Any provider works. It needs {systems}, at least {cpus} cores, {memory} GB of memory and {disk} GB of disk, with ports {ports} open.",
@@ -151,7 +171,7 @@ var A = {
151
171
  consoleRemember: "Remember on this browser",
152
172
  close: "Close",
153
173
  cancel: "Cancel"
154
- }, j = {
174
+ }, N = {
155
175
  accountsTitleUser: "I miei abbonamenti",
156
176
  accountsTitleTenant: "Abbonamenti del tenant",
157
177
  accountsIntroUser: "Collega il tuo abbonamento: lo usano solo le tue richieste. Senza, si usano le API key del workspace.",
@@ -178,6 +198,26 @@ var A = {
178
198
  keyProvider: "Provider",
179
199
  keyLabel: "API key di {provider}",
180
200
  termsNote: "Un abbonamento Pro o Max è personale: collega solo il tuo.",
201
+ accountsSection: "{name} ({count})",
202
+ accountsByUse: "API key dei provider a consumo ({count})",
203
+ accountsAdd: "Aggiungi abbonamento",
204
+ accountsAvailable: "Disponibile",
205
+ accountsAddedOn: "Aggiunto il {date}",
206
+ accountsUnnamed: "Account {n}",
207
+ accountsOrderHint: "Si usano in quest'ordine: quando uno finisce il credito, il turno passa al successivo. Trascina una scheda, o usa le frecce della sua maniglia, per cambiarlo.",
208
+ accountsName: "Nome (l'email dell'account)",
209
+ accountsRenameTitle: "Nome dell'account",
210
+ accountsRenameAria: "Rinomina {name}",
211
+ accountsRemoveAria: "Scollega {name}",
212
+ accountsSave: "Salva",
213
+ claudeMultiWarning: "Pro e Max sono abbonamenti personali: Anthropic non consente più account per aggirare i limiti, e farlo rischia la sospensione. Aggiungi solo l’abbonamento di un’altra persona che lo mette a disposizione, o posti di Claude Team o Enterprise.",
214
+ claudeCopy: "Copia il link",
215
+ claudeCopied: "Link copiato",
216
+ claudeManual: "Ho un token fatto con claude setup-token",
217
+ claudeBackToLogin: "Entra invece con la pagina di Anthropic",
218
+ claudeTokenIntro: "Esegui claude setup-token su un computer collegato all'account, poi incolla il token che stampa.",
219
+ claudeToken: "Token (claude setup-token)",
220
+ keyAddOf: "Aggiungi {provider}",
181
221
  guideTitle: "Installa un runner a mano",
182
222
  guideServerTitle: "1. Una VPS",
183
223
  guideServer: "Va bene qualunque fornitore. Servono {systems}, almeno {cpus} core, {memory} GB di memoria e {disk} GB di disco, con le porte {ports} aperte.",
@@ -297,18 +337,18 @@ var A = {
297
337
  consoleRemember: "Ricorda su questo browser",
298
338
  close: "Chiudi",
299
339
  cancel: "Annulla"
300
- }, M = {
301
- en: A,
302
- it: j
340
+ }, P = {
341
+ en: M,
342
+ it: N
303
343
  };
304
- function N(e, t) {
305
- let n = e && e.toLowerCase().startsWith("it") ? j : A;
344
+ function F(e, t) {
345
+ let n = e && e.toLowerCase().startsWith("it") ? N : M;
306
346
  return t ? {
307
347
  ...n,
308
348
  ...t
309
349
  } : n;
310
350
  }
311
- var P = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), F = {
351
+ var I = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), L = {
312
352
  "claude-code": "Claude Code",
313
353
  "opencode-go": "OpenCode Go",
314
354
  opencode: "OpenCode Zen",
@@ -318,229 +358,382 @@ var P = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e),
318
358
  mistral: "Mistral",
319
359
  deepseek: "DeepSeek",
320
360
  openrouter: "OpenRouter"
321
- }, I = ["claude-code", "opencode-go"], L = (e) => new Date(e).toLocaleString(void 0, {
322
- dateStyle: "medium",
361
+ }, R = ["claude-code", "opencode-go"], z = (e) => L[e] ?? e, B = (e) => new Date(e).toLocaleDateString(void 0, { dateStyle: "medium" }), ee = (e) => new Date(e).toLocaleString(void 0, {
362
+ dateStyle: "short",
323
363
  timeStyle: "short"
324
364
  });
325
- function R({ client: n, scope: r, locale: i, texts: a, onChange: o, providers: s }) {
326
- let u = N(i, a), g = s ?? (r === "tenant" ? [
327
- ...I,
365
+ function V({ client: n, scope: r, locale: i, texts: a, onChange: o, providers: s, renderProvider: u, onStack: f }) {
366
+ let m = F(i, a), g = s ?? (r === "tenant" ? [
367
+ ...R,
328
368
  "opencode",
329
369
  ...e
330
- ] : I), _ = g.filter((e) => e !== "claude-code"), [v, y] = d(null), [b, S] = d(null), [C, w] = d(null), [T, E] = d(null), k = c(async () => {
370
+ ] : R), _ = R.filter((e) => g.includes(e)), v = g.filter((e) => !R.includes(e)), [y, b] = d(null), [x, S] = d(null), C = c(async () => {
331
371
  try {
332
372
  let { accounts: e } = await n.accounts.list();
333
- return y(e), S(null), e;
373
+ return b(e), S(null), e;
334
374
  } catch (e) {
335
- return S(e instanceof t ? e.code : String(e)), y([]), [];
375
+ return S(e instanceof t ? e.code : String(e)), b([]), [];
336
376
  }
337
377
  }, [n]);
338
378
  l(() => {
339
- k();
340
- }, [k]);
341
- let A = async () => {
342
- w(null);
343
- let e = await k();
344
- o?.(e);
379
+ C();
380
+ }, [C]);
381
+ let w = async (e) => {
382
+ let t = e ?? await C();
383
+ e && b(e), o?.(t);
345
384
  };
346
- return /* @__PURE__ */ O(h, {
347
- title: r === "user" ? u.accountsTitleUser : u.accountsTitleTenant,
348
- loading: v === null,
385
+ return /* @__PURE__ */ k(h, {
386
+ title: r === "user" ? m.accountsTitleUser : m.accountsTitleTenant,
387
+ loading: y === null,
349
388
  loaderMinHeight: 120,
350
- children: [/* @__PURE__ */ O("div", {
351
- className: "flex flex-col gap-3",
389
+ children: /* @__PURE__ */ A("div", {
390
+ className: "flex flex-col gap-6",
352
391
  children: [
353
- /* @__PURE__ */ D("p", {
392
+ /* @__PURE__ */ k("p", {
354
393
  className: "text-sm text-muted-foreground",
355
- children: r === "user" ? u.accountsIntroUser : u.accountsIntroTenant
394
+ children: r === "user" ? m.accountsIntroUser : m.accountsIntroTenant
356
395
  }),
357
- b && /* @__PURE__ */ D(p, {
396
+ x && /* @__PURE__ */ k(p, {
358
397
  variant: "danger",
359
- children: P(u.error, { error: b })
360
- }),
361
- v?.length === 0 && !b && /* @__PURE__ */ D("p", {
362
- className: "text-sm text-muted-foreground",
363
- children: u.accountsEmpty
398
+ children: I(m.error, { error: x })
364
399
  }),
365
- v?.map((e) => /* @__PURE__ */ O("div", {
366
- className: "flex flex-wrap items-center gap-2 rounded-md border border-border p-3",
367
- children: [/* @__PURE__ */ O("div", {
368
- className: "min-w-0 flex-1",
369
- children: [/* @__PURE__ */ O("div", {
370
- className: "flex flex-wrap items-center gap-2",
371
- children: [
372
- /* @__PURE__ */ D("span", {
373
- className: "font-medium",
374
- children: e.label ?? F[e.provider] ?? e.provider
375
- }),
376
- /* @__PURE__ */ D(m, {
377
- variant: "secondary",
378
- children: F[e.provider] ?? e.provider
379
- }),
380
- e.noCreditUntil && /* @__PURE__ */ D(m, {
381
- variant: "warning",
382
- children: P(u.accountsNoCredit, { at: L(e.noCreditUntil) })
383
- })
384
- ]
385
- }), /* @__PURE__ */ D("p", {
386
- className: "text-xs text-muted-foreground",
387
- children: P(u.accountsConnected, { at: L(e.at) })
388
- })]
389
- }), /* @__PURE__ */ D(f, {
390
- icon: "unlink",
391
- label: u.accountsRemove,
392
- variant: "outline-danger",
393
- onClick: () => E(e)
394
- })]
395
- }, `${e.provider}/${e.id}`)),
396
- C === "claude" && /* @__PURE__ */ D(z, {
400
+ y && _.map((e) => /* @__PURE__ */ k(H, {
397
401
  client: n,
398
- t: u,
399
- onDone: A,
400
- onCancel: () => w(null)
401
- }),
402
- C === "key" && /* @__PURE__ */ D(B, {
402
+ t: m,
403
+ provider: e,
404
+ accounts: y.filter((t) => t.provider === e),
405
+ onChanged: w,
406
+ onStack: f,
407
+ extra: u?.(e, y.filter((t) => t.provider === e))
408
+ }, e)),
409
+ y && v.length > 0 && /* @__PURE__ */ k(H, {
403
410
  client: n,
404
- t: u,
405
- providers: _,
406
- onDone: A,
407
- onCancel: () => w(null)
411
+ t: m,
412
+ provider: v,
413
+ accounts: y.filter((e) => v.includes(e.provider)),
414
+ onChanged: w,
415
+ onStack: f
408
416
  }),
409
- !C && /* @__PURE__ */ O("div", {
410
- className: "flex flex-wrap gap-2",
411
- children: [g.includes("claude-code") && /* @__PURE__ */ D(f, {
412
- icon: "plus",
413
- label: u.claudeConnect,
414
- variant: "primary",
415
- onClick: () => w("claude")
416
- }), _.length > 0 && /* @__PURE__ */ D(f, {
417
- icon: "plus",
418
- label: _.length === 1 && _[0] === "opencode-go" ? u.opencodeConnect : u.keyConnect,
419
- variant: "outline-secondary",
420
- onClick: () => w("key")
421
- })]
422
- }),
423
- /* @__PURE__ */ D("p", {
417
+ /* @__PURE__ */ k("p", {
424
418
  className: "text-xs text-muted-foreground",
425
- children: u.termsNote
419
+ children: m.termsNote
426
420
  })
427
421
  ]
428
- }), T && /* @__PURE__ */ D(x, {
429
- title: u.accountsRemove,
430
- danger: !0,
431
- onClose: () => E(null),
432
- onYes: async () => (await n.accounts.remove(T.provider, T.id).catch(() => !1), E(null), await A(), !0),
433
- children: P(u.accountsRemoveConfirm, { name: T.label ?? F[T.provider] ?? T.provider })
422
+ })
423
+ });
424
+ }
425
+ function H({ client: e, t: n, provider: r, accounts: i, onChanged: a, onStack: o, extra: s }) {
426
+ let c = typeof r == "string" ? r : void 0, l = c ? I(n.accountsSection, {
427
+ name: z(c),
428
+ count: String(i.length)
429
+ }) : I(n.accountsByUse, { count: String(i.length) }), [u, h] = d(!1), [g, _] = d(null), v = (e) => {
430
+ _(e), o?.(e !== null);
431
+ }, [y, b] = d(null), [S, C] = d(null), T = (e, t) => e.label || I(n.accountsUnnamed, { n: String(t + 1) }), E = (e) => C(I(n.error, { error: e instanceof t ? e.code : String(e) }));
432
+ return /* @__PURE__ */ A("section", {
433
+ className: "flex flex-col gap-3",
434
+ children: [
435
+ /* @__PURE__ */ A("div", {
436
+ className: "flex flex-wrap items-center justify-between gap-3",
437
+ children: [/* @__PURE__ */ k("h5", {
438
+ className: "text-sm font-semibold",
439
+ children: l
440
+ }), !u && /* @__PURE__ */ k(f, {
441
+ icon: "plus",
442
+ variant: "outline-primary",
443
+ label: c ? n.accountsAdd : n.keyConnect,
444
+ onClick: () => {
445
+ C(null), h(!0);
446
+ }
447
+ })]
448
+ }),
449
+ S && /* @__PURE__ */ k(p, {
450
+ variant: "danger",
451
+ children: S
452
+ }),
453
+ /* @__PURE__ */ k(w, {
454
+ items: i,
455
+ getKey: (e) => `${e.provider}/${e.id}`,
456
+ label: l,
457
+ numbered: !!c && i.length > 1,
458
+ disabled: !c,
459
+ emptyState: /* @__PURE__ */ k("p", {
460
+ className: "text-sm text-muted-foreground",
461
+ children: n.accountsEmpty
462
+ }),
463
+ onReorder: (t) => {
464
+ c && e.accounts.order(c, t.map((e) => e.id)).then((e) => a(e), E);
465
+ },
466
+ renderItem: (e, t) => ({
467
+ icon: e.provider === "claude-code" ? "user" : "key",
468
+ title: T(e, t),
469
+ meta: [c ? void 0 : z(e.provider), I(n.accountsAddedOn, { date: B(e.at) })].filter(Boolean).join(" · "),
470
+ badge: e.noCreditUntil ? /* @__PURE__ */ k(m, {
471
+ variant: "warning",
472
+ children: I(n.accountsNoCredit, { at: ee(e.noCreditUntil) })
473
+ }) : /* @__PURE__ */ k(m, {
474
+ variant: "success",
475
+ children: n.accountsAvailable
476
+ }),
477
+ trailing: /* @__PURE__ */ A("div", {
478
+ className: "flex items-center gap-1",
479
+ children: [/* @__PURE__ */ k(f, {
480
+ icon: "pencil",
481
+ variant: "link",
482
+ ariaLabel: I(n.accountsRenameAria, { name: T(e, t) }),
483
+ onClick: () => v(e)
484
+ }), /* @__PURE__ */ k(f, {
485
+ icon: "trash-2",
486
+ variant: "link",
487
+ ariaLabel: I(n.accountsRemoveAria, { name: T(e, t) }),
488
+ onClick: () => b(e)
489
+ })]
490
+ })
491
+ })
492
+ }),
493
+ c && i.length > 1 && /* @__PURE__ */ k("p", {
494
+ className: "text-xs text-muted-foreground",
495
+ children: n.accountsOrderHint
496
+ }),
497
+ u && (c === "claude-code" ? /* @__PURE__ */ k(ne, {
498
+ client: e,
499
+ t: n,
500
+ others: i.length,
501
+ onDone: async () => {
502
+ h(!1), await a();
503
+ },
504
+ onCancel: () => h(!1)
505
+ }) : /* @__PURE__ */ k(re, {
506
+ client: e,
507
+ t: n,
508
+ providers: c ? [c] : r,
509
+ onDone: async () => {
510
+ h(!1), await a();
511
+ },
512
+ onCancel: () => h(!1)
513
+ })),
514
+ s,
515
+ g && /* @__PURE__ */ k(te, {
516
+ client: e,
517
+ t: n,
518
+ account: g,
519
+ onClose: () => v(null),
520
+ onDone: async (e) => {
521
+ v(null), await a(e);
522
+ }
523
+ }),
524
+ y && /* @__PURE__ */ k(x, {
525
+ title: n.accountsRemove,
526
+ danger: !0,
527
+ onClose: () => b(null),
528
+ onYes: async () => (await e.accounts.remove(y.provider, y.id).catch(() => !1), b(null), await a(), !0),
529
+ children: I(n.accountsRemoveConfirm, { name: y.label ?? z(y.provider) })
530
+ })
531
+ ]
532
+ });
533
+ }
534
+ function te({ client: e, t: n, account: r, onClose: i, onDone: a }) {
535
+ let [o, s] = d(r.label ?? ""), [c, l] = d(null);
536
+ return /* @__PURE__ */ A(b, {
537
+ title: n.accountsRenameTitle,
538
+ position: "right",
539
+ size: "sm",
540
+ onClose: i,
541
+ footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(f, {
542
+ variant: "link",
543
+ label: n.cancel,
544
+ onClick: i
545
+ }), /* @__PURE__ */ k(y, {
546
+ variant: "primary",
547
+ label: n.accountsSave,
548
+ onClick: async () => {
549
+ try {
550
+ await a(await e.accounts.rename(r.provider, r.id, o.trim()));
551
+ } catch (e) {
552
+ l(I(n.error, { error: e instanceof t ? e.code : String(e) }));
553
+ }
554
+ }
555
+ })] }),
556
+ children: [c && /* @__PURE__ */ k(p, {
557
+ variant: "danger",
558
+ children: c
559
+ }), /* @__PURE__ */ k(v, {
560
+ appearance: "empty",
561
+ showNotice: !1,
562
+ defaultValues: { label: r.label ?? "" },
563
+ onSubmit: () => !1,
564
+ children: /* @__PURE__ */ k(T, {
565
+ name: "label",
566
+ label: n.accountsName,
567
+ placeholder: n.claudeLabelPlaceholder,
568
+ onChange: ({ value: e }) => s(String(e ?? ""))
569
+ })
434
570
  })]
435
571
  });
436
572
  }
437
- function z({ client: e, t: n, onDone: r, onCancel: i }) {
438
- let [a, o] = d(null), [s, c] = d(""), [u, m] = d(""), [h, g] = d(null);
573
+ function ne({ client: e, t: n, others: r, onDone: i, onCancel: a }) {
574
+ let [o, s] = d(!1), [c, u] = d(null), [m, g] = d(!1), [_, b] = d(""), [x, C] = d(""), [w, E] = d(""), [D, j] = d(null);
439
575
  return l(() => {
576
+ if (o) return;
440
577
  let t = !1;
441
- return e.accounts.startClaudeLogin().then(({ url: e }) => !t && o(e)).catch(() => !t && g(n.claudeNoLink)), () => {
578
+ return e.accounts.startClaudeLogin().then(({ url: e }) => !t && u(e)).catch(() => !t && j(n.claudeNoLink)), () => {
442
579
  t = !0;
443
580
  };
444
- }, [e, n]), /* @__PURE__ */ O("div", {
445
- className: "flex flex-col gap-3 rounded-md border border-border p-3",
581
+ }, [
582
+ e,
583
+ n,
584
+ o
585
+ ]), /* @__PURE__ */ A(h, {
586
+ headerClassName: "px-4 py-3",
587
+ bodyClassName: "flex flex-col gap-3",
588
+ header: /* @__PURE__ */ k("span", {
589
+ className: "text-sm font-medium",
590
+ children: n.claudeConnect
591
+ }),
446
592
  children: [
447
- h && /* @__PURE__ */ D(p, {
448
- variant: "danger",
449
- children: h
593
+ r > 0 && /* @__PURE__ */ k(p, {
594
+ variant: "warning",
595
+ children: n.claudeMultiWarning
450
596
  }),
451
- /* @__PURE__ */ D("p", {
452
- className: "text-sm",
453
- children: n.claudeStep1
597
+ D && /* @__PURE__ */ k(p, {
598
+ variant: "danger",
599
+ children: D
454
600
  }),
455
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
456
- icon: "external-link",
457
- label: n.claudeOpen,
458
- variant: "primary",
459
- disabled: !a,
460
- onClick: () => a && window.open(a, "_blank", "noopener,noreferrer")
461
- }) }),
462
- /* @__PURE__ */ D("p", {
601
+ o ? /* @__PURE__ */ k("p", {
463
602
  className: "text-sm",
464
- children: n.claudeStep2
465
- }),
466
- /* @__PURE__ */ O(v, {
603
+ children: n.claudeTokenIntro
604
+ }) : /* @__PURE__ */ A(O, { children: [
605
+ /* @__PURE__ */ k("p", {
606
+ className: "text-sm",
607
+ children: n.claudeStep1
608
+ }),
609
+ /* @__PURE__ */ A("div", {
610
+ className: "grid grid-cols-2 gap-2",
611
+ children: [/* @__PURE__ */ k(f, {
612
+ icon: "external-link",
613
+ variant: "outline-primary",
614
+ className: "w-full justify-center whitespace-nowrap",
615
+ label: n.claudeOpen,
616
+ disabled: !c,
617
+ onClick: () => c && window.open(c, "_blank", "noopener,noreferrer")
618
+ }), /* @__PURE__ */ k(f, {
619
+ icon: m ? "check" : "copy",
620
+ variant: "outline-secondary",
621
+ className: "w-full justify-center whitespace-nowrap",
622
+ label: m ? n.claudeCopied : n.claudeCopy,
623
+ disabled: !c,
624
+ onClick: () => {
625
+ c && navigator.clipboard?.writeText(c).then(() => g(!0), () => g(!1));
626
+ }
627
+ })]
628
+ }),
629
+ /* @__PURE__ */ k("p", {
630
+ className: "text-sm",
631
+ children: n.claudeStep2
632
+ })
633
+ ] }),
634
+ /* @__PURE__ */ A(v, {
467
635
  appearance: "empty",
468
636
  showNotice: !1,
469
637
  onSubmit: () => !1,
470
- children: [/* @__PURE__ */ D(w, {
638
+ children: [o ? /* @__PURE__ */ k(S, {
639
+ name: "token",
640
+ label: n.claudeToken,
641
+ placeholder: "sk-ant-oat01-…",
642
+ autoComplete: "off",
643
+ onChange: ({ value: e }) => C(String(e ?? ""))
644
+ }) : /* @__PURE__ */ k(T, {
471
645
  name: "code",
472
646
  label: n.claudeCode,
473
647
  autoComplete: "off",
474
- onChange: ({ value: e }) => c(String(e ?? ""))
475
- }), /* @__PURE__ */ D(w, {
648
+ onChange: ({ value: e }) => b(String(e ?? ""))
649
+ }), /* @__PURE__ */ k(T, {
476
650
  name: "label",
477
- label: n.claudeLabel,
651
+ label: n.accountsName,
478
652
  placeholder: n.claudeLabelPlaceholder,
479
- onChange: ({ value: e }) => m(String(e ?? ""))
653
+ onChange: ({ value: e }) => E(String(e ?? ""))
480
654
  })]
481
655
  }),
482
- /* @__PURE__ */ O("div", {
483
- className: "flex gap-2",
484
- children: [/* @__PURE__ */ D(y, {
656
+ /* @__PURE__ */ k(f, {
657
+ variant: "link",
658
+ className: "h-auto self-start p-0 text-xs",
659
+ label: o ? n.claudeBackToLogin : n.claudeManual,
660
+ onClick: () => {
661
+ s(!o), j(null);
662
+ }
663
+ }),
664
+ /* @__PURE__ */ A("div", {
665
+ className: "flex flex-wrap justify-end gap-2",
666
+ children: [/* @__PURE__ */ k(f, {
667
+ label: n.cancel,
668
+ variant: "link",
669
+ onClick: a
670
+ }), /* @__PURE__ */ k(y, {
485
671
  label: n.claudeFinish,
486
672
  variant: "primary",
487
- disabled: !a || !s.trim(),
673
+ disabled: o ? !x.trim() : !c || !_.trim(),
488
674
  onClick: async () => {
675
+ j(null);
489
676
  try {
490
- await e.accounts.finishClaudeLogin(s.trim(), u.trim() || void 0), r();
491
- } catch (e) {
492
- g(e instanceof t && e.code === "refused" ? n.claudeRefused : P(n.error, { error: e instanceof t ? e.code : String(e) }));
677
+ o ? await e.accounts.addClaudeToken(x.trim(), w.trim() || void 0) : await e.accounts.finishClaudeLogin(_.trim(), w.trim() || void 0), i();
678
+ } catch (r) {
679
+ let i = r instanceof t && r.code === "refused";
680
+ j(i ? n.claudeRefused : I(n.error, { error: r instanceof t ? r.code : String(r) })), i && !o && (u(null), g(!1), e.accounts.startClaudeLogin().then(({ url: e }) => u(e)).catch(() => j(n.claudeNoLink)));
493
681
  }
494
682
  }
495
- }), /* @__PURE__ */ D(f, {
496
- label: n.cancel,
497
- variant: "outline-secondary",
498
- onClick: i
499
683
  })]
500
684
  })
501
685
  ]
502
686
  });
503
687
  }
504
- function B({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
505
- let [o, s] = d(r[0]), [c, l] = d(""), [u, m] = d(""), [h, g] = d(null);
506
- return /* @__PURE__ */ O("div", {
507
- className: "flex flex-col gap-3 rounded-md border border-border p-3",
688
+ function re({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
689
+ let [o, s] = d(r[0]), [c, l] = d(""), [u, m] = d(""), [g, _] = d(null);
690
+ return /* @__PURE__ */ A(h, {
691
+ headerClassName: "px-4 py-3",
692
+ bodyClassName: "flex flex-col gap-3",
693
+ header: /* @__PURE__ */ k("span", {
694
+ className: "text-sm font-medium",
695
+ children: r.length === 1 ? I(n.keyAddOf, { provider: z(r[0]) }) : n.keyConnect
696
+ }),
508
697
  children: [
509
- h && /* @__PURE__ */ D(p, {
698
+ g && /* @__PURE__ */ k(p, {
510
699
  variant: "danger",
511
- children: h
700
+ children: g
512
701
  }),
513
- /* @__PURE__ */ O(v, {
702
+ /* @__PURE__ */ A(v, {
514
703
  appearance: "empty",
515
704
  showNotice: !1,
516
705
  onSubmit: () => !1,
517
706
  children: [
518
- r.length > 1 && /* @__PURE__ */ D(C, {
707
+ r.length > 1 && /* @__PURE__ */ k(C, {
519
708
  name: "provider",
520
709
  label: n.keyProvider,
521
710
  defaultValue: o,
522
711
  options: r.map((e) => ({
523
- label: F[e] ?? e,
712
+ label: z(e),
524
713
  value: e
525
714
  })),
526
715
  onChange: ({ value: e }) => s(String(e ?? r[0]))
527
716
  }),
528
- /* @__PURE__ */ D(S, {
717
+ /* @__PURE__ */ k(S, {
529
718
  name: "key",
530
- label: P(n.keyLabel, { provider: F[o] ?? o }),
719
+ label: I(n.keyLabel, { provider: z(o) }),
531
720
  autoComplete: "off",
532
721
  onChange: ({ value: e }) => l(String(e ?? ""))
533
722
  }),
534
- /* @__PURE__ */ D(w, {
723
+ /* @__PURE__ */ k(T, {
535
724
  name: "label",
536
- label: n.claudeLabel,
725
+ label: n.accountsName,
537
726
  onChange: ({ value: e }) => m(String(e ?? ""))
538
727
  })
539
728
  ]
540
729
  }),
541
- /* @__PURE__ */ O("div", {
542
- className: "flex gap-2",
543
- children: [/* @__PURE__ */ D(y, {
730
+ /* @__PURE__ */ A("div", {
731
+ className: "flex flex-wrap justify-end gap-2",
732
+ children: [/* @__PURE__ */ k(f, {
733
+ label: n.cancel,
734
+ variant: "link",
735
+ onClick: a
736
+ }), /* @__PURE__ */ k(y, {
544
737
  label: n.opencodeAdd,
545
738
  variant: "primary",
546
739
  disabled: !c.trim(),
@@ -548,41 +741,37 @@ function B({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
548
741
  try {
549
742
  await e.accounts.addKey(o, c.trim(), u.trim() || void 0), i();
550
743
  } catch (e) {
551
- g(P(n.error, { error: e instanceof t ? e.code : String(e) }));
744
+ _(I(n.error, { error: e instanceof t ? e.code : String(e) }));
552
745
  }
553
746
  }
554
- }), /* @__PURE__ */ D(f, {
555
- label: n.cancel,
556
- variant: "outline-secondary",
557
- onClick: a
558
747
  })]
559
748
  })
560
749
  ]
561
750
  });
562
751
  }
563
752
  // src/ui/InstallGuide.tsx
564
- function V({ title: e, children: t, done: n }) {
565
- return /* @__PURE__ */ O("section", {
753
+ function U({ title: e, children: t, done: n }) {
754
+ return /* @__PURE__ */ A("section", {
566
755
  className: "flex flex-col gap-2 border-l-2 border-border pl-4",
567
- children: [/* @__PURE__ */ O("h4", {
756
+ children: [/* @__PURE__ */ A("h4", {
568
757
  className: "flex items-center gap-2 text-sm font-semibold",
569
- children: [e, n && /* @__PURE__ */ D(m, {
758
+ children: [e, n && /* @__PURE__ */ k(m, {
570
759
  variant: "success",
571
760
  children: "✓"
572
761
  })]
573
762
  }), t]
574
763
  });
575
764
  }
576
- function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u = r, version: m }) {
577
- let h = N(e, t), [_, b] = d(""), [x, S] = d(null), [C, T] = d(null), [E, k] = d(""), [A, j] = d(!1), [M, F] = d(null), I = a(_), L = `https://${_.trim().toLowerCase()}`, R = n;
578
- return /* @__PURE__ */ O("div", {
765
+ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u = r, version: m }) {
766
+ let h = F(e, t), [_, b] = d(""), [x, S] = d(null), [C, w] = d(null), [E, D] = d(""), [O, j] = d(!1), [M, N] = d(null), P = a(_), L = `https://${_.trim().toLowerCase()}`, R = n;
767
+ return /* @__PURE__ */ A("div", {
579
768
  className: "flex flex-col gap-5",
580
769
  children: [
581
- /* @__PURE__ */ D(V, {
770
+ /* @__PURE__ */ k(U, {
582
771
  title: h.guideServerTitle,
583
- children: /* @__PURE__ */ D("p", {
772
+ children: /* @__PURE__ */ k("p", {
584
773
  className: "text-sm",
585
- children: P(h.guideServer, {
774
+ children: I(h.guideServer, {
586
775
  systems: R.systems.join(", "),
587
776
  cpus: R.cpus,
588
777
  memory: R.memoryGb,
@@ -591,40 +780,40 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
591
780
  })
592
781
  })
593
782
  }),
594
- /* @__PURE__ */ O(V, {
783
+ /* @__PURE__ */ A(U, {
595
784
  title: h.guideDnsTitle,
596
785
  done: !!x?.ips.length,
597
786
  children: [
598
- /* @__PURE__ */ D("p", {
787
+ /* @__PURE__ */ k("p", {
599
788
  className: "text-sm",
600
789
  children: h.guideDns
601
790
  }),
602
- /* @__PURE__ */ D(v, {
791
+ /* @__PURE__ */ k(v, {
603
792
  appearance: "empty",
604
793
  showNotice: !1,
605
794
  onSubmit: () => !1,
606
- children: /* @__PURE__ */ D(w, {
795
+ children: /* @__PURE__ */ k(T, {
607
796
  name: "domain",
608
797
  label: h.guideDomain,
609
798
  placeholder: "runner.example.com",
610
799
  autoComplete: "off",
611
800
  onChange: ({ value: e }) => {
612
- b(String(e ?? "")), S(null), T(null);
801
+ b(String(e ?? "")), S(null), w(null);
613
802
  }
614
803
  })
615
804
  }),
616
- /* @__PURE__ */ O("div", {
805
+ /* @__PURE__ */ A("div", {
617
806
  className: "flex flex-wrap items-center gap-2",
618
- children: [/* @__PURE__ */ D(y, {
807
+ children: [/* @__PURE__ */ k(y, {
619
808
  label: h.guideCheckDns,
620
809
  variant: "outline-secondary",
621
- disabled: !I,
810
+ disabled: !P,
622
811
  onClick: async () => S({ ips: await l(_.trim().toLowerCase()).catch(() => []) })
623
- }), x && (x.ips.length ? /* @__PURE__ */ D(p, {
812
+ }), x && (x.ips.length ? /* @__PURE__ */ k(p, {
624
813
  variant: "success",
625
814
  appearance: "text",
626
- children: P(h.guideDnsOk, { ips: x.ips.join(", ") })
627
- }) : /* @__PURE__ */ D(p, {
815
+ children: I(h.guideDnsOk, { ips: x.ips.join(", ") })
816
+ }) : /* @__PURE__ */ k(p, {
628
817
  variant: "warning",
629
818
  appearance: "text",
630
819
  children: h.guideDnsMissing
@@ -632,112 +821,112 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
632
821
  })
633
822
  ]
634
823
  }),
635
- /* @__PURE__ */ D(V, {
824
+ /* @__PURE__ */ k(U, {
636
825
  title: h.guideAccessTitle,
637
- children: /* @__PURE__ */ D("p", {
826
+ children: /* @__PURE__ */ k("p", {
638
827
  className: "text-sm",
639
828
  children: h.guideAccess
640
829
  })
641
830
  }),
642
- /* @__PURE__ */ O(V, {
831
+ /* @__PURE__ */ A(U, {
643
832
  title: h.guideInstallTitle,
644
833
  children: [
645
- /* @__PURE__ */ D("p", {
834
+ /* @__PURE__ */ k("p", {
646
835
  className: "text-sm",
647
836
  children: h.guideInstall
648
837
  }),
649
- /* @__PURE__ */ D(g, {
838
+ /* @__PURE__ */ k(g, {
650
839
  language: "bash",
651
840
  showCopy: !0,
652
841
  children: i({
653
- domain: I ? _ : "runner.example.com",
842
+ domain: P ? _ : "runner.example.com",
654
843
  ...m ? { version: m } : {}
655
844
  })
656
845
  }),
657
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
846
+ /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(f, {
658
847
  label: h.guideVerified,
659
848
  variant: "link",
660
849
  onClick: () => j((e) => !e)
661
850
  }) }),
662
- A && /* @__PURE__ */ D(g, {
851
+ O && /* @__PURE__ */ k(g, {
663
852
  language: "bash",
664
853
  showCopy: !0,
665
854
  children: s({
666
- domain: I ? _ : "runner.example.com",
855
+ domain: P ? _ : "runner.example.com",
667
856
  ...m ? { version: m } : {}
668
857
  }).join("\n")
669
858
  })
670
859
  ]
671
860
  }),
672
- /* @__PURE__ */ O(V, {
861
+ /* @__PURE__ */ A(U, {
673
862
  title: h.guidePairTitle,
674
863
  done: C?.ok,
675
864
  children: [
676
- /* @__PURE__ */ D("p", {
865
+ /* @__PURE__ */ k("p", {
677
866
  className: "text-sm",
678
867
  children: h.guidePair
679
868
  }),
680
- /* @__PURE__ */ D(v, {
869
+ /* @__PURE__ */ k(v, {
681
870
  appearance: "empty",
682
871
  showNotice: !1,
683
872
  onSubmit: () => !1,
684
- children: /* @__PURE__ */ D(w, {
873
+ children: /* @__PURE__ */ k(T, {
685
874
  name: "code",
686
875
  label: h.addCode,
687
876
  placeholder: "ABCD-EFGH",
688
877
  autoComplete: "off",
689
- onChange: ({ value: e }) => k(String(e ?? ""))
878
+ onChange: ({ value: e }) => D(String(e ?? ""))
690
879
  })
691
880
  }),
692
- C && /* @__PURE__ */ D(p, {
881
+ C && /* @__PURE__ */ k(p, {
693
882
  variant: C.ok ? "success" : "warning",
694
883
  appearance: "text",
695
884
  children: C.text
696
885
  }),
697
- M && /* @__PURE__ */ D(p, {
886
+ M && /* @__PURE__ */ k(p, {
698
887
  variant: "danger",
699
888
  children: M
700
889
  }),
701
- /* @__PURE__ */ O("div", {
890
+ /* @__PURE__ */ A("div", {
702
891
  className: "flex flex-wrap gap-2",
703
- children: [/* @__PURE__ */ D(y, {
892
+ children: [/* @__PURE__ */ k(y, {
704
893
  label: h.guideCheckHealth,
705
894
  variant: "outline-secondary",
706
- disabled: !I,
895
+ disabled: !P,
707
896
  onClick: async () => {
708
897
  let e = await u(L);
709
- T(e.ok ? {
898
+ w(e.ok ? {
710
899
  ok: !0,
711
- text: P(h.guideHealthOk, {
900
+ text: I(h.guideHealthOk, {
712
901
  version: e.version,
713
902
  url: L
714
903
  })
715
904
  } : {
716
905
  ok: !1,
717
- text: P(h.guideHealthKo, { url: L })
906
+ text: I(h.guideHealthKo, { url: L })
718
907
  });
719
908
  }
720
- }), /* @__PURE__ */ D(y, {
909
+ }), /* @__PURE__ */ k(y, {
721
910
  label: h.addConnect,
722
911
  variant: "primary",
723
- disabled: !I || E.trim().length < 8,
912
+ disabled: !P || E.trim().length < 8,
724
913
  onClick: async () => {
725
914
  try {
726
- F(null), await c({
915
+ N(null), await c({
727
916
  url: L,
728
917
  code: E.trim()
729
918
  });
730
919
  } catch (e) {
731
- F(P(h.error, { error: e.message }));
920
+ N(I(h.error, { error: e.message }));
732
921
  }
733
922
  }
734
923
  })]
735
924
  })
736
925
  ]
737
926
  }),
738
- /* @__PURE__ */ D(V, {
927
+ /* @__PURE__ */ k(U, {
739
928
  title: h.guideTroubleTitle,
740
- children: /* @__PURE__ */ D("p", {
929
+ children: /* @__PURE__ */ k("p", {
741
930
  className: "text-sm text-muted-foreground",
742
931
  children: h.guideTrouble
743
932
  })
@@ -746,8 +935,8 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
746
935
  });
747
936
  }
748
937
  // src/ui/RunnersSettings.tsx
749
- function U({ fleet: e, locale: t, texts: n }) {
750
- let r = N(t, n), [i, a] = d(null), [o, s] = d(null), [u, g] = d(!1), [_, y] = d(null), [b, S] = d(null), w = c(async () => {
938
+ function ie({ fleet: e, locale: t, texts: n }) {
939
+ let r = F(t, n), [i, a] = d(null), [o, s] = d(null), [u, g] = d(!1), [_, y] = d(null), [b, S] = d(null), w = c(async () => {
751
940
  try {
752
941
  let t = await e.list();
753
942
  a(t);
@@ -757,25 +946,25 @@ function U({ fleet: e, locale: t, texts: n }) {
757
946
  status: n[t]
758
947
  }))), e.tenants && s(await e.tenants.list());
759
948
  } catch (e) {
760
- S(P(r.error, { error: e.message })), a([]);
949
+ S(I(r.error, { error: e.message })), a([]);
761
950
  }
762
951
  }, [e, r]);
763
952
  l(() => {
764
953
  w();
765
954
  }, [w]);
766
- let E = async (t, n) => {
955
+ let T = async (t, n) => {
767
956
  await e.update(t, n), await w();
768
957
  };
769
- return /* @__PURE__ */ O("div", {
958
+ return /* @__PURE__ */ A("div", {
770
959
  className: "flex flex-col gap-4",
771
960
  children: [
772
- /* @__PURE__ */ D(h, {
773
- header: /* @__PURE__ */ O("div", {
961
+ /* @__PURE__ */ k(h, {
962
+ header: /* @__PURE__ */ A("div", {
774
963
  className: "flex flex-wrap items-center gap-2",
775
- children: [/* @__PURE__ */ D("h3", {
964
+ children: [/* @__PURE__ */ k("h3", {
776
965
  className: "flex-1 text-base font-semibold",
777
966
  children: r.runnersTitle
778
- }), /* @__PURE__ */ D(f, {
967
+ }), /* @__PURE__ */ k(f, {
779
968
  icon: "plus",
780
969
  label: r.runnersAdd,
781
970
  variant: "primary",
@@ -784,56 +973,56 @@ function U({ fleet: e, locale: t, texts: n }) {
784
973
  }),
785
974
  loading: i === null,
786
975
  loaderMinHeight: 120,
787
- children: /* @__PURE__ */ O("div", {
976
+ children: /* @__PURE__ */ A("div", {
788
977
  className: "flex flex-col gap-3",
789
978
  children: [
790
- /* @__PURE__ */ D("p", {
979
+ /* @__PURE__ */ k("p", {
791
980
  className: "text-sm text-muted-foreground",
792
981
  children: r.runnersIntro
793
982
  }),
794
- b && /* @__PURE__ */ D(p, {
983
+ b && /* @__PURE__ */ k(p, {
795
984
  variant: "danger",
796
985
  children: b
797
986
  }),
798
- i?.length === 0 && /* @__PURE__ */ D("p", {
987
+ i?.length === 0 && /* @__PURE__ */ k("p", {
799
988
  className: "text-sm text-muted-foreground",
800
989
  children: r.runnersEmpty
801
990
  }),
802
- i?.map((e) => /* @__PURE__ */ O("div", {
991
+ i?.map((e) => /* @__PURE__ */ A("div", {
803
992
  className: "flex flex-col gap-2 rounded-md border border-border p-3",
804
- children: [/* @__PURE__ */ O("div", {
993
+ children: [/* @__PURE__ */ A("div", {
805
994
  className: "flex flex-wrap items-center gap-2",
806
995
  children: [
807
- /* @__PURE__ */ D("span", {
996
+ /* @__PURE__ */ k("span", {
808
997
  className: "font-medium",
809
998
  children: e.name
810
999
  }),
811
- /* @__PURE__ */ D("span", {
1000
+ /* @__PURE__ */ k("span", {
812
1001
  className: "text-xs text-muted-foreground",
813
1002
  children: e.url
814
1003
  }),
815
- e.status === null && /* @__PURE__ */ D(m, {
1004
+ e.status === null && /* @__PURE__ */ k(m, {
816
1005
  variant: "danger",
817
1006
  children: r.runnersUnreachable
818
1007
  }),
819
- e.status && /* @__PURE__ */ D(m, {
1008
+ e.status && /* @__PURE__ */ k(m, {
820
1009
  variant: "secondary",
821
- children: P(r.runnersVersion, { version: e.status.version })
1010
+ children: I(r.runnersVersion, { version: e.status.version })
822
1011
  }),
823
- e.status && /* @__PURE__ */ D(m, {
1012
+ e.status && /* @__PURE__ */ k(m, {
824
1013
  variant: "info",
825
- children: P(r.runnersLoad, {
1014
+ children: I(r.runnersLoad, {
826
1015
  chats: e.status.load.chats,
827
1016
  max: e.status.load.maxChats
828
1017
  })
829
1018
  }),
830
- e.status && /* @__PURE__ */ D(m, {
1019
+ e.status && /* @__PURE__ */ k(m, {
831
1020
  variant: "light",
832
- children: P(r.runnersTenants, { count: e.status.tenants.length })
1021
+ children: I(r.runnersTenants, { count: e.status.tenants.length })
833
1022
  }),
834
- /* @__PURE__ */ D("div", {
1023
+ /* @__PURE__ */ k("div", {
835
1024
  className: "ml-auto",
836
- children: /* @__PURE__ */ D(f, {
1025
+ children: /* @__PURE__ */ k(f, {
837
1026
  icon: "trash",
838
1027
  label: r.runnersRemove,
839
1028
  variant: "outline-danger",
@@ -841,7 +1030,7 @@ function U({ fleet: e, locale: t, texts: n }) {
841
1030
  })
842
1031
  })
843
1032
  ]
844
- }), /* @__PURE__ */ D(v, {
1033
+ }), /* @__PURE__ */ k(v, {
845
1034
  appearance: "empty",
846
1035
  showNotice: !1,
847
1036
  onSubmit: () => !1,
@@ -849,18 +1038,18 @@ function U({ fleet: e, locale: t, texts: n }) {
849
1038
  isDefault: e.isDefault ? "true" : "",
850
1039
  draining: e.draining ? "true" : ""
851
1040
  },
852
- children: /* @__PURE__ */ O("div", {
1041
+ children: /* @__PURE__ */ A("div", {
853
1042
  className: "flex flex-wrap gap-4",
854
- children: [/* @__PURE__ */ D(T, {
1043
+ children: [/* @__PURE__ */ k(E, {
855
1044
  name: "isDefault",
856
1045
  label: r.runnersDefault,
857
1046
  valueChecked: "true",
858
- onChange: ({ value: t }) => void E(e.id, { isDefault: !!t })
859
- }), /* @__PURE__ */ D(T, {
1047
+ onChange: ({ value: t }) => void T(e.id, { isDefault: !!t })
1048
+ }), /* @__PURE__ */ k(E, {
860
1049
  name: "draining",
861
1050
  label: r.runnersDraining,
862
1051
  valueChecked: "true",
863
- onChange: ({ value: t }) => void E(e.id, { draining: !!t })
1052
+ onChange: ({ value: t }) => void T(e.id, { draining: !!t })
864
1053
  })]
865
1054
  })
866
1055
  })]
@@ -868,26 +1057,26 @@ function U({ fleet: e, locale: t, texts: n }) {
868
1057
  ]
869
1058
  })
870
1059
  }),
871
- e.tenants && i && i.length > 0 && /* @__PURE__ */ D(h, {
1060
+ e.tenants && i && i.length > 0 && /* @__PURE__ */ k(h, {
872
1061
  title: r.distributionTitle,
873
1062
  loading: o === null,
874
1063
  loaderMinHeight: 80,
875
- children: /* @__PURE__ */ O("div", {
1064
+ children: /* @__PURE__ */ A("div", {
876
1065
  className: "flex flex-col gap-2",
877
- children: [/* @__PURE__ */ D("p", {
1066
+ children: [/* @__PURE__ */ k("p", {
878
1067
  className: "text-sm text-muted-foreground",
879
1068
  children: r.distributionIntro
880
- }), /* @__PURE__ */ D(v, {
1069
+ }), /* @__PURE__ */ k(v, {
881
1070
  appearance: "empty",
882
1071
  showNotice: !1,
883
1072
  onSubmit: () => !1,
884
1073
  defaultValues: Object.fromEntries((o ?? []).map((e) => [`runner_${e.id}`, e.runnerId ?? ""])),
885
- children: (o ?? []).map((t) => /* @__PURE__ */ O("div", {
1074
+ children: (o ?? []).map((t) => /* @__PURE__ */ A("div", {
886
1075
  className: "flex flex-wrap items-center gap-2",
887
- children: [/* @__PURE__ */ D("span", {
1076
+ children: [/* @__PURE__ */ k("span", {
888
1077
  className: "min-w-40 flex-1 text-sm",
889
1078
  children: t.name
890
- }), /* @__PURE__ */ D(C, {
1079
+ }), /* @__PURE__ */ k(C, {
891
1080
  name: `runner_${t.id}`,
892
1081
  title: r.distributionRunner,
893
1082
  placeholderOption: {
@@ -906,7 +1095,7 @@ function U({ fleet: e, locale: t, texts: n }) {
906
1095
  })]
907
1096
  })
908
1097
  }),
909
- u && /* @__PURE__ */ D(K, {
1098
+ u && /* @__PURE__ */ k(q, {
910
1099
  fleet: e,
911
1100
  t: r,
912
1101
  locale: t,
@@ -915,74 +1104,75 @@ function U({ fleet: e, locale: t, texts: n }) {
915
1104
  g(!1), await w();
916
1105
  }
917
1106
  }),
918
- _ && /* @__PURE__ */ D(x, {
1107
+ _ && /* @__PURE__ */ k(x, {
919
1108
  title: r.runnersRemove,
920
1109
  danger: !0,
921
1110
  onClose: () => y(null),
922
- onYes: async () => (await e.remove(_.id).catch((e) => S(P(r.error, { error: e.message }))), y(null), await w(), !0),
923
- children: P(r.runnersRemoveConfirm, { name: _.name })
1111
+ onYes: async () => (await e.remove(_.id).catch((e) => S(I(r.error, { error: e.message }))), y(null), await w(), !0),
1112
+ children: I(r.runnersRemoveConfirm, { name: _.name })
924
1113
  })
925
1114
  ]
926
1115
  });
927
1116
  }
928
- function W({ target: e, children: t }) {
929
- return e ? k(t, e) : null;
1117
+ function G({ target: e, children: t }) {
1118
+ return e ? j(t, e) : null;
930
1119
  }
931
- var G = (e) => {
1120
+ var K = (e) => {
932
1121
  try {
933
1122
  return new URL(e).hostname;
934
1123
  } catch {
935
1124
  return e;
936
1125
  }
937
1126
  };
938
- function K({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
939
- let [a, o] = d("choose"), [s, l] = d(null), [u, m] = d(null), h = c((e) => l(P(t.error, { error: e.message })), [t]);
940
- return /* @__PURE__ */ D(b, {
1127
+ function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
1128
+ let [o, s] = d("choose"), [l, u] = d(null), [m, h] = d(null), g = c((e) => u(I(t.error, { error: e.message })), [t]);
1129
+ return /* @__PURE__ */ k(b, {
941
1130
  title: t.addTitle,
1131
+ ...a === "right" ? { position: "right" } : {},
942
1132
  size: "lg",
943
1133
  onClose: r,
944
- footer: a === "choose" || a === "guided" ? !1 : /* @__PURE__ */ D("div", {
945
- ref: m,
1134
+ footer: o === "choose" || o === "guided" ? !1 : /* @__PURE__ */ k("div", {
1135
+ ref: h,
946
1136
  className: "flex w-full flex-wrap items-center justify-end gap-3"
947
1137
  }),
948
- children: /* @__PURE__ */ O("div", {
1138
+ children: /* @__PURE__ */ A("div", {
949
1139
  className: "flex flex-col gap-4",
950
1140
  children: [
951
- s && /* @__PURE__ */ D(p, {
1141
+ l && /* @__PURE__ */ k(p, {
952
1142
  variant: "danger",
953
- children: s
1143
+ children: l
954
1144
  }),
955
- a === "choose" && /* @__PURE__ */ O("div", {
1145
+ o === "choose" && /* @__PURE__ */ A("div", {
956
1146
  className: "grid gap-3 sm:grid-cols-3",
957
1147
  children: [
958
- e.install && /* @__PURE__ */ D(q, {
1148
+ e.install && /* @__PURE__ */ k(J, {
959
1149
  title: t.addAutomatic,
960
1150
  hint: t.addAutomaticHint,
961
- onClick: () => o("automatic")
1151
+ onClick: () => s("automatic")
962
1152
  }),
963
- /* @__PURE__ */ D(q, {
1153
+ /* @__PURE__ */ k(J, {
964
1154
  title: t.addGuided,
965
1155
  hint: t.addGuidedHint,
966
- onClick: () => o("guided")
1156
+ onClick: () => s("guided")
967
1157
  }),
968
- /* @__PURE__ */ D(q, {
1158
+ /* @__PURE__ */ k(J, {
969
1159
  title: t.addExisting,
970
1160
  hint: t.addExistingHint,
971
- onClick: () => o("existing")
1161
+ onClick: () => s("existing")
972
1162
  })
973
1163
  ]
974
1164
  }),
975
- a !== "choose" && /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
1165
+ o !== "choose" && /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(f, {
976
1166
  icon: "arrow-left",
977
1167
  label: t.addBack,
978
1168
  variant: "link",
979
1169
  onClick: () => {
980
- o("choose"), l(null);
1170
+ s("choose"), u(null);
981
1171
  }
982
1172
  }) }),
983
- a === "automatic" && e.install && /* @__PURE__ */ D(ne, {
1173
+ o === "automatic" && e.install && /* @__PURE__ */ k(ce, {
984
1174
  t,
985
- footer: u,
1175
+ footer: m,
986
1176
  localKeys: !!e.localKeys,
987
1177
  install: (t, n, r) => e.install({
988
1178
  name: t,
@@ -990,38 +1180,38 @@ function K({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
990
1180
  access: n
991
1181
  }, r),
992
1182
  onDone: i,
993
- onError: h
1183
+ onError: g
994
1184
  }),
995
- a === "guided" && /* @__PURE__ */ D(H, {
1185
+ o === "guided" && /* @__PURE__ */ k(W, {
996
1186
  locale: n,
997
1187
  texts: t,
998
1188
  onPair: async ({ url: t, code: n }) => {
999
1189
  await i(await e.add({
1000
- name: G(t),
1190
+ name: K(t),
1001
1191
  url: t,
1002
1192
  code: n
1003
1193
  }));
1004
1194
  }
1005
1195
  }),
1006
- a === "existing" && /* @__PURE__ */ D(te, {
1196
+ o === "existing" && /* @__PURE__ */ k(se, {
1007
1197
  t,
1008
- footer: u,
1198
+ footer: m,
1009
1199
  pairing: e.startPairing && e.pairingStatus ? {
1010
1200
  start: e.startPairing.bind(e),
1011
1201
  status: e.pairingStatus.bind(e)
1012
1202
  } : void 0,
1013
1203
  onAdded: i,
1014
- onError: h,
1015
- onClearError: () => l(null),
1204
+ onError: g,
1205
+ onClearError: () => u(null),
1016
1206
  onConnect: async (t, n) => {
1017
1207
  try {
1018
1208
  await i(await e.add({
1019
- name: G(t),
1209
+ name: K(t),
1020
1210
  url: t,
1021
1211
  code: n
1022
1212
  }));
1023
1213
  } catch (e) {
1024
- h(e);
1214
+ g(e);
1025
1215
  }
1026
1216
  }
1027
1217
  })
@@ -1029,25 +1219,25 @@ function K({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
1029
1219
  })
1030
1220
  });
1031
1221
  }
1032
- function q({ title: e, hint: t, onClick: n }) {
1033
- return /* @__PURE__ */ O("button", {
1222
+ function J({ title: e, hint: t, onClick: n }) {
1223
+ return /* @__PURE__ */ A("button", {
1034
1224
  type: "button",
1035
1225
  onClick: n,
1036
1226
  className: "rounded-lg border border-border p-4 text-left transition-colors hover:border-primary hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1037
- children: [/* @__PURE__ */ D("span", {
1227
+ children: [/* @__PURE__ */ k("span", {
1038
1228
  className: "block font-medium",
1039
1229
  children: e
1040
- }), /* @__PURE__ */ D("span", {
1230
+ }), /* @__PURE__ */ k("span", {
1041
1231
  className: "mt-1 block text-sm text-muted-foreground",
1042
1232
  children: t
1043
1233
  })]
1044
1234
  });
1045
1235
  }
1046
- var J = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), Y = (e) => new Date(e).toLocaleTimeString(void 0, {
1236
+ var Y = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), ae = (e) => new Date(e).toLocaleTimeString(void 0, {
1047
1237
  hour: "2-digit",
1048
1238
  minute: "2-digit"
1049
- }), ee = 5;
1050
- function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError: a, onConnect: o }) {
1239
+ }), oe = 5;
1240
+ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError: a, onConnect: o }) {
1051
1241
  let [s, c] = d(""), [u, m] = d(""), [h, g] = d(!n), [_, b] = d(null), [x, S] = d(null);
1052
1242
  return l(() => {
1053
1243
  if (!_ || !n) return;
@@ -1064,7 +1254,7 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1064
1254
  return;
1065
1255
  }
1066
1256
  } catch (n) {
1067
- t += 1, !e && t >= ee && i(n);
1257
+ t += 1, !e && t >= oe && i(n);
1068
1258
  }
1069
1259
  e || (a = setTimeout(() => void o(), 2e3));
1070
1260
  };
@@ -1076,28 +1266,28 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1076
1266
  n,
1077
1267
  r,
1078
1268
  i
1079
- ]), _ ? /* @__PURE__ */ O("div", {
1269
+ ]), _ ? /* @__PURE__ */ A("div", {
1080
1270
  className: "flex flex-col gap-3",
1081
1271
  children: [
1082
- /* @__PURE__ */ D("h4", {
1272
+ /* @__PURE__ */ k("h4", {
1083
1273
  className: "font-semibold",
1084
1274
  children: e.pairWaitingTitle
1085
1275
  }),
1086
- /* @__PURE__ */ D("p", {
1276
+ /* @__PURE__ */ k("p", {
1087
1277
  className: "text-sm text-muted-foreground",
1088
1278
  children: e.pairWaitingHint
1089
1279
  }),
1090
- /* @__PURE__ */ D("div", {
1280
+ /* @__PURE__ */ k("div", {
1091
1281
  className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
1092
1282
  children: _.code
1093
1283
  }),
1094
- /* @__PURE__ */ D("p", {
1284
+ /* @__PURE__ */ k("p", {
1095
1285
  className: "text-sm text-muted-foreground",
1096
- children: P(e.pairWaiting, { at: Y(_.expiresAt) })
1286
+ children: I(e.pairWaiting, { at: ae(_.expiresAt) })
1097
1287
  }),
1098
- /* @__PURE__ */ D(W, {
1288
+ /* @__PURE__ */ k(G, {
1099
1289
  target: t,
1100
- children: /* @__PURE__ */ D(f, {
1290
+ children: /* @__PURE__ */ k(f, {
1101
1291
  icon: "external-link",
1102
1292
  label: e.pairOpen,
1103
1293
  variant: "primary",
@@ -1105,14 +1295,14 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1105
1295
  })
1106
1296
  })
1107
1297
  ]
1108
- }) : /* @__PURE__ */ O("div", {
1298
+ }) : /* @__PURE__ */ A("div", {
1109
1299
  className: "flex flex-col gap-3",
1110
1300
  children: [
1111
- x && /* @__PURE__ */ D(p, {
1301
+ x && /* @__PURE__ */ k(p, {
1112
1302
  variant: x === "denied" ? "danger" : "warning",
1113
1303
  children: x === "denied" ? e.pairDenied : e.pairExpired
1114
1304
  }),
1115
- /* @__PURE__ */ O(v, {
1305
+ /* @__PURE__ */ A(v, {
1116
1306
  appearance: "empty",
1117
1307
  showNotice: !1,
1118
1308
  onSubmit: () => !1,
@@ -1120,12 +1310,12 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1120
1310
  url: s,
1121
1311
  code: u
1122
1312
  },
1123
- children: [/* @__PURE__ */ D(w, {
1313
+ children: [/* @__PURE__ */ k(T, {
1124
1314
  name: "url",
1125
1315
  label: e.addUrl,
1126
1316
  placeholder: "https://runner.example.com",
1127
1317
  onChange: ({ value: e }) => c(String(e ?? ""))
1128
- }), h && /* @__PURE__ */ D(w, {
1318
+ }), h && /* @__PURE__ */ k(T, {
1129
1319
  name: "code",
1130
1320
  label: e.addCode,
1131
1321
  placeholder: "ABCD-EFGH",
@@ -1133,27 +1323,27 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1133
1323
  onChange: ({ value: e }) => m(String(e ?? ""))
1134
1324
  })]
1135
1325
  }),
1136
- /* @__PURE__ */ O(W, {
1326
+ /* @__PURE__ */ A(G, {
1137
1327
  target: t,
1138
- children: [n && /* @__PURE__ */ D(f, {
1328
+ children: [n && /* @__PURE__ */ k(f, {
1139
1329
  label: h ? e.pairWithApproval : e.pairWithCode,
1140
1330
  variant: "link",
1141
1331
  onClick: () => g((e) => !e)
1142
- }), h ? /* @__PURE__ */ D(y, {
1332
+ }), h ? /* @__PURE__ */ k(y, {
1143
1333
  label: e.addConnect,
1144
1334
  variant: "primary",
1145
1335
  disabled: !s.trim() || u.trim().length < 8,
1146
- onClick: () => o(J(s), u.trim())
1147
- }) : /* @__PURE__ */ D(y, {
1336
+ onClick: () => o(Y(s), u.trim())
1337
+ }) : /* @__PURE__ */ k(y, {
1148
1338
  label: x ? e.pairAgain : e.pairNext,
1149
1339
  variant: "primary",
1150
1340
  disabled: !s.trim(),
1151
1341
  onClick: async () => {
1152
1342
  S(null), a();
1153
1343
  try {
1154
- let e = J(s);
1344
+ let e = Y(s);
1155
1345
  b(await n.start({
1156
- name: G(e),
1346
+ name: K(e),
1157
1347
  url: e
1158
1348
  }));
1159
1349
  } catch (e) {
@@ -1176,7 +1366,7 @@ var X = [
1176
1366
  "tls",
1177
1367
  "done"
1178
1368
  ];
1179
- function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
1369
+ function ce({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
1180
1370
  let [o, s] = d({
1181
1371
  host: "",
1182
1372
  port: "22",
@@ -1189,43 +1379,43 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1189
1379
  ...n,
1190
1380
  [e]: String(t ?? "")
1191
1381
  })), _ = o.host.trim() && o.domain.trim() && (o.auth === "local" || o.username.trim()) && (o.auth === "local" || (o.auth === "key" ? o.privateKey.trim() : o.password));
1192
- return /* @__PURE__ */ O("div", {
1382
+ return /* @__PURE__ */ A("div", {
1193
1383
  className: "flex flex-col gap-3",
1194
1384
  children: [
1195
- !p && /* @__PURE__ */ O(v, {
1385
+ !p && /* @__PURE__ */ A(v, {
1196
1386
  appearance: "empty",
1197
1387
  showNotice: !1,
1198
1388
  onSubmit: () => !1,
1199
1389
  defaultValues: o,
1200
1390
  children: [
1201
- /* @__PURE__ */ D(w, {
1391
+ /* @__PURE__ */ k(T, {
1202
1392
  name: "domain",
1203
1393
  label: e.guideDomain,
1204
1394
  placeholder: "runner.example.com",
1205
1395
  onChange: g("domain")
1206
1396
  }),
1207
- /* @__PURE__ */ O("div", {
1397
+ /* @__PURE__ */ A("div", {
1208
1398
  className: "grid gap-3 sm:grid-cols-3",
1209
1399
  children: [
1210
- /* @__PURE__ */ D(w, {
1400
+ /* @__PURE__ */ k(T, {
1211
1401
  name: "host",
1212
1402
  label: e.addHost,
1213
1403
  placeholder: "203.0.113.10",
1214
1404
  onChange: g("host")
1215
1405
  }),
1216
- /* @__PURE__ */ D(w, {
1406
+ /* @__PURE__ */ k(T, {
1217
1407
  name: "port",
1218
1408
  label: e.addPort,
1219
1409
  onChange: g("port")
1220
1410
  }),
1221
- /* @__PURE__ */ D(w, {
1411
+ /* @__PURE__ */ k(T, {
1222
1412
  name: "username",
1223
1413
  label: e.addUser,
1224
1414
  onChange: g("username")
1225
1415
  })
1226
1416
  ]
1227
1417
  }),
1228
- /* @__PURE__ */ D(C, {
1418
+ /* @__PURE__ */ k(C, {
1229
1419
  name: "auth",
1230
1420
  label: e.addAuth,
1231
1421
  options: [
@@ -1244,16 +1434,16 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1244
1434
  ],
1245
1435
  onChange: g("auth")
1246
1436
  }),
1247
- o.auth === "local" && /* @__PURE__ */ D("p", {
1437
+ o.auth === "local" && /* @__PURE__ */ k("p", {
1248
1438
  className: "text-xs text-muted-foreground",
1249
1439
  children: e.addLocalKeyHint
1250
1440
  }),
1251
- o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ D(E, {
1441
+ o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ k(D, {
1252
1442
  name: "privateKey",
1253
1443
  label: e.addKey,
1254
1444
  placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----",
1255
1445
  onChange: g("privateKey")
1256
- }) : /* @__PURE__ */ D(S, {
1446
+ }) : /* @__PURE__ */ k(S, {
1257
1447
  name: "password",
1258
1448
  label: e.addPassword,
1259
1449
  autoComplete: "off",
@@ -1261,24 +1451,24 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1261
1451
  })
1262
1452
  ]
1263
1453
  }),
1264
- /* @__PURE__ */ D("p", {
1454
+ /* @__PURE__ */ k("p", {
1265
1455
  className: "text-xs text-muted-foreground",
1266
1456
  children: e.addCredentialsNote
1267
1457
  }),
1268
- p && /* @__PURE__ */ D("div", {
1458
+ p && /* @__PURE__ */ k("div", {
1269
1459
  className: "flex flex-wrap gap-1",
1270
- children: X.map((e) => /* @__PURE__ */ D(m, {
1460
+ children: X.map((e) => /* @__PURE__ */ k(m, {
1271
1461
  variant: u === e ? "primary" : X.indexOf(e) < X.indexOf(u ?? "check") ? "success" : "light",
1272
1462
  children: e
1273
1463
  }, e))
1274
1464
  }),
1275
- c.length > 0 && /* @__PURE__ */ D("pre", {
1465
+ c.length > 0 && /* @__PURE__ */ k("pre", {
1276
1466
  className: "max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs",
1277
1467
  children: c.slice(-200).join("\n")
1278
1468
  }),
1279
- /* @__PURE__ */ D(W, {
1469
+ /* @__PURE__ */ k(G, {
1280
1470
  target: t,
1281
- children: /* @__PURE__ */ D(y, {
1471
+ children: /* @__PURE__ */ k(y, {
1282
1472
  label: p ? e.addInstalling : e.addInstall,
1283
1473
  variant: "primary",
1284
1474
  disabled: !_ || p,
@@ -1309,49 +1499,49 @@ var Z = (e) => (e / 1024 ** 3).toFixed(1), Q = (e) => new Date(e).toLocaleString
1309
1499
  dateStyle: "short",
1310
1500
  timeStyle: "short"
1311
1501
  });
1312
- function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1313
- let o = N(n, r), [s, u] = d(null), [m, b] = d(null), [x, S] = d(null), [C, T] = d({
1502
+ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1503
+ let o = F(n, r), [s, u] = d(null), [m, b] = d(null), [x, S] = d(null), [C, w] = d({
1314
1504
  id: "",
1315
1505
  name: ""
1316
- }), [E, k] = d(null), A = c(async () => {
1506
+ }), [E, D] = d(null), O = c(async () => {
1317
1507
  try {
1318
1508
  u(await e.platform.status()), b(null);
1319
1509
  } catch (e) {
1320
- b(P(o.error, { error: e instanceof t ? e.code : String(e) }));
1510
+ b(I(o.error, { error: e instanceof t ? e.code : String(e) }));
1321
1511
  }
1322
1512
  }, [e, o]);
1323
1513
  return l(() => {
1324
- A();
1325
- }, [A]), /* @__PURE__ */ O("div", {
1514
+ O();
1515
+ }, [O]), /* @__PURE__ */ A("div", {
1326
1516
  className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
1327
1517
  children: [
1328
- /* @__PURE__ */ O("div", {
1518
+ /* @__PURE__ */ A("div", {
1329
1519
  className: "flex items-center gap-2",
1330
- children: [/* @__PURE__ */ D("h1", {
1520
+ children: [/* @__PURE__ */ k("h1", {
1331
1521
  className: "flex-1 text-xl font-semibold",
1332
1522
  children: o.consoleTitle
1333
- }), i && /* @__PURE__ */ D(f, {
1523
+ }), i && /* @__PURE__ */ k(f, {
1334
1524
  icon: "log-out",
1335
1525
  label: o.consoleSignOut,
1336
1526
  variant: "outline-secondary",
1337
1527
  onClick: i
1338
1528
  })]
1339
1529
  }),
1340
- m && /* @__PURE__ */ D(p, {
1530
+ m && /* @__PURE__ */ k(p, {
1341
1531
  variant: "danger",
1342
1532
  children: m
1343
1533
  }),
1344
- /* @__PURE__ */ D(oe, {
1534
+ /* @__PURE__ */ k(fe, {
1345
1535
  client: e,
1346
1536
  t: o,
1347
1537
  approve: a,
1348
- onAnswered: A
1538
+ onAnswered: O
1349
1539
  }),
1350
- /* @__PURE__ */ D(h, {
1540
+ /* @__PURE__ */ k(h, {
1351
1541
  title: o.consoleStatus,
1352
1542
  loading: !s && !m,
1353
1543
  loaderMinHeight: 100,
1354
- children: s && /* @__PURE__ */ D(_, { items: [
1544
+ children: s && /* @__PURE__ */ k(_, { items: [
1355
1545
  {
1356
1546
  label: "Version",
1357
1547
  value: s.version
@@ -1366,7 +1556,7 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1366
1556
  },
1367
1557
  {
1368
1558
  label: "Machine",
1369
- value: P(o.consoleMachine, {
1559
+ value: I(o.consoleMachine, {
1370
1560
  memory: Z(s.machine.availableBytes),
1371
1561
  total: Z(s.machine.totalBytes),
1372
1562
  cpus: s.machine.cpus
@@ -1378,27 +1568,27 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1378
1568
  }
1379
1569
  ] })
1380
1570
  }),
1381
- /* @__PURE__ */ D(h, {
1571
+ /* @__PURE__ */ k(h, {
1382
1572
  title: o.consolePairing,
1383
- children: /* @__PURE__ */ O("div", {
1573
+ children: /* @__PURE__ */ A("div", {
1384
1574
  className: "flex flex-col gap-2",
1385
1575
  children: [
1386
- /* @__PURE__ */ D("p", {
1576
+ /* @__PURE__ */ k("p", {
1387
1577
  className: "text-sm text-muted-foreground",
1388
1578
  children: o.consolePairingHint
1389
1579
  }),
1390
- x && /* @__PURE__ */ D(g, {
1580
+ x && /* @__PURE__ */ k(g, {
1391
1581
  showCopy: !0,
1392
1582
  children: x.code
1393
1583
  }),
1394
- x && /* @__PURE__ */ D("p", {
1584
+ x && /* @__PURE__ */ k("p", {
1395
1585
  className: "text-xs text-muted-foreground",
1396
- children: P(o.consoleCode, {
1586
+ children: I(o.consoleCode, {
1397
1587
  code: x.code,
1398
1588
  at: Q(x.expiresAt)
1399
1589
  })
1400
1590
  }),
1401
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(y, {
1591
+ /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(y, {
1402
1592
  label: o.consoleNewCode,
1403
1593
  variant: "outline-primary",
1404
1594
  onClick: async () => S(await e.createPairing())
@@ -1406,66 +1596,66 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1406
1596
  ]
1407
1597
  })
1408
1598
  }),
1409
- /* @__PURE__ */ D(ie, {
1599
+ /* @__PURE__ */ k(ue, {
1410
1600
  client: e,
1411
1601
  t: o
1412
1602
  }),
1413
- /* @__PURE__ */ D(h, {
1603
+ /* @__PURE__ */ k(h, {
1414
1604
  title: o.consoleTenants,
1415
- children: /* @__PURE__ */ O("div", {
1605
+ children: /* @__PURE__ */ A("div", {
1416
1606
  className: "flex flex-col gap-3",
1417
1607
  children: [
1418
- E && /* @__PURE__ */ D(p, {
1608
+ E && /* @__PURE__ */ k(p, {
1419
1609
  variant: "warning",
1420
- onClose: () => k(null),
1421
- children: /* @__PURE__ */ D("span", {
1610
+ onClose: () => D(null),
1611
+ children: /* @__PURE__ */ k("span", {
1422
1612
  className: "break-all",
1423
- children: P(o.consoleKeyShown, { key: E })
1613
+ children: I(o.consoleKeyShown, { key: E })
1424
1614
  })
1425
1615
  }),
1426
- s?.tenants.map((t) => /* @__PURE__ */ D(ae, {
1616
+ s?.tenants.map((t) => /* @__PURE__ */ k(de, {
1427
1617
  client: e,
1428
1618
  tenant: t,
1429
1619
  t: o,
1430
1620
  locale: n,
1431
- onKey: k,
1432
- onChange: A
1621
+ onKey: D,
1622
+ onChange: O
1433
1623
  }, t.id)),
1434
- /* @__PURE__ */ D(v, {
1624
+ /* @__PURE__ */ k(v, {
1435
1625
  appearance: "empty",
1436
1626
  showNotice: !1,
1437
1627
  onSubmit: () => !1,
1438
- children: /* @__PURE__ */ O("div", {
1628
+ children: /* @__PURE__ */ A("div", {
1439
1629
  className: "grid gap-2 sm:grid-cols-[1fr_1fr_auto] sm:items-end",
1440
1630
  children: [
1441
- /* @__PURE__ */ D(w, {
1631
+ /* @__PURE__ */ k(T, {
1442
1632
  name: "tenantId",
1443
1633
  label: o.consoleTenantId,
1444
1634
  placeholder: "acme",
1445
- onChange: ({ value: e }) => T((t) => ({
1635
+ onChange: ({ value: e }) => w((t) => ({
1446
1636
  ...t,
1447
1637
  id: String(e ?? "")
1448
1638
  }))
1449
1639
  }),
1450
- /* @__PURE__ */ D(w, {
1640
+ /* @__PURE__ */ k(T, {
1451
1641
  name: "tenantName",
1452
1642
  label: o.consoleTenantName,
1453
1643
  placeholder: "Acme",
1454
- onChange: ({ value: e }) => T((t) => ({
1644
+ onChange: ({ value: e }) => w((t) => ({
1455
1645
  ...t,
1456
1646
  name: String(e ?? "")
1457
1647
  }))
1458
1648
  }),
1459
- /* @__PURE__ */ D(y, {
1649
+ /* @__PURE__ */ k(y, {
1460
1650
  label: o.consoleCreate,
1461
1651
  variant: "primary",
1462
1652
  disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(C.id),
1463
1653
  onClick: async () => {
1464
1654
  try {
1465
1655
  let t = await e.platform.createTenant(C.id, { name: C.name || void 0 });
1466
- t.key && k(t.key), await A();
1656
+ t.key && D(t.key), await O();
1467
1657
  } catch (e) {
1468
- b(P(o.error, { error: e instanceof t ? e.code : String(e) }));
1658
+ b(I(o.error, { error: e instanceof t ? e.code : String(e) }));
1469
1659
  }
1470
1660
  }
1471
1661
  })
@@ -1478,40 +1668,40 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
1478
1668
  ]
1479
1669
  });
1480
1670
  }
1481
- function ie({ client: e, t }) {
1671
+ function ue({ client: e, t }) {
1482
1672
  let [n, r] = d(null), [i, a] = d({}), [o, s] = d(null), u = c(async () => r(await e.platform.platformKeys()), [e]);
1483
1673
  return l(() => {
1484
1674
  u();
1485
- }, [u]), /* @__PURE__ */ O(h, {
1675
+ }, [u]), /* @__PURE__ */ A(h, {
1486
1676
  title: t.consolePlatforms,
1487
1677
  loading: !n,
1488
1678
  loaderMinHeight: 60,
1489
- children: [/* @__PURE__ */ O("div", {
1679
+ children: [/* @__PURE__ */ A("div", {
1490
1680
  className: "flex flex-col gap-3",
1491
1681
  children: [
1492
- /* @__PURE__ */ D("p", {
1682
+ /* @__PURE__ */ k("p", {
1493
1683
  className: "text-sm text-muted-foreground",
1494
1684
  children: t.consolePlatformsHint
1495
1685
  }),
1496
- n && !n.length && /* @__PURE__ */ D("p", {
1686
+ n && !n.length && /* @__PURE__ */ k("p", {
1497
1687
  className: "text-sm text-muted-foreground",
1498
1688
  children: t.consolePlatformsEmpty
1499
1689
  }),
1500
1690
  n?.map((n) => {
1501
1691
  let r = i[n.id] ?? n.project ?? "";
1502
- return /* @__PURE__ */ D(v, {
1692
+ return /* @__PURE__ */ k(v, {
1503
1693
  appearance: "empty",
1504
1694
  showNotice: !1,
1505
1695
  onSubmit: () => !1,
1506
- children: /* @__PURE__ */ O("div", {
1696
+ children: /* @__PURE__ */ A("div", {
1507
1697
  className: "grid gap-2 rounded-md border border-border p-3 sm:grid-cols-[1fr_12rem_auto] sm:items-end",
1508
1698
  children: [
1509
- /* @__PURE__ */ O("div", {
1699
+ /* @__PURE__ */ A("div", {
1510
1700
  className: "flex flex-col gap-1",
1511
- children: [/* @__PURE__ */ D("span", {
1701
+ children: [/* @__PURE__ */ k("span", {
1512
1702
  className: "font-medium",
1513
1703
  children: n.name
1514
- }), /* @__PURE__ */ O("span", {
1704
+ }), /* @__PURE__ */ A("span", {
1515
1705
  className: "text-xs text-muted-foreground",
1516
1706
  children: [
1517
1707
  Q(n.createdAt),
@@ -1520,7 +1710,7 @@ function ie({ client: e, t }) {
1520
1710
  ]
1521
1711
  })]
1522
1712
  }),
1523
- /* @__PURE__ */ D(w, {
1713
+ /* @__PURE__ */ k(T, {
1524
1714
  name: `project-${n.id}`,
1525
1715
  label: t.consolePlatformProject,
1526
1716
  value: r,
@@ -1530,16 +1720,16 @@ function ie({ client: e, t }) {
1530
1720
  [n.id]: String(e ?? "").trim()
1531
1721
  }))
1532
1722
  }),
1533
- /* @__PURE__ */ O("div", {
1723
+ /* @__PURE__ */ A("div", {
1534
1724
  className: "flex gap-2",
1535
- children: [/* @__PURE__ */ D(y, {
1725
+ children: [/* @__PURE__ */ k(y, {
1536
1726
  label: t.consolePlatformSave,
1537
1727
  variant: "outline-primary",
1538
1728
  disabled: r === (n.project ?? "") || r !== "" && !/^[a-z0-9]{1,32}$/.test(r),
1539
1729
  onClick: async () => {
1540
1730
  await e.setKeyProject(n.id, r || null), await u();
1541
1731
  }
1542
- }), /* @__PURE__ */ D(f, {
1732
+ }), /* @__PURE__ */ k(f, {
1543
1733
  icon: "trash",
1544
1734
  label: t.consoleRevoke,
1545
1735
  variant: "outline-danger",
@@ -1551,33 +1741,33 @@ function ie({ client: e, t }) {
1551
1741
  }, n.id);
1552
1742
  })
1553
1743
  ]
1554
- }), o && /* @__PURE__ */ D(x, {
1744
+ }), o && /* @__PURE__ */ k(x, {
1555
1745
  title: t.consoleRevoke,
1556
1746
  danger: !0,
1557
1747
  onClose: () => s(null),
1558
1748
  onYes: async () => (await e.platform.revokePlatformKey(o.id), s(null), await u(), !0),
1559
- children: P(t.consolePlatformRevokeConfirm, { name: o.name })
1749
+ children: I(t.consolePlatformRevokeConfirm, { name: o.name })
1560
1750
  })]
1561
1751
  });
1562
1752
  }
1563
- function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1753
+ function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1564
1754
  let [o, s] = d(!1), [p, h] = d(null), [g, _] = d(!1), v = u(() => e.as({ tenant: t.id }), [e, t.id]), b = c(async () => h(await e.platform.keys(t.id)), [e, t.id]);
1565
1755
  return l(() => {
1566
1756
  o && b();
1567
- }, [o, b]), /* @__PURE__ */ O("div", {
1757
+ }, [o, b]), /* @__PURE__ */ A("div", {
1568
1758
  className: "rounded-md border border-border p-3",
1569
1759
  children: [
1570
- /* @__PURE__ */ O("div", {
1760
+ /* @__PURE__ */ A("div", {
1571
1761
  className: "flex flex-wrap items-center gap-2",
1572
1762
  children: [
1573
- /* @__PURE__ */ O("button", {
1763
+ /* @__PURE__ */ A("button", {
1574
1764
  type: "button",
1575
1765
  className: "flex-1 text-left font-medium",
1576
1766
  onClick: () => s((e) => !e),
1577
1767
  children: [
1578
1768
  t.name,
1579
1769
  " ",
1580
- /* @__PURE__ */ O("span", {
1770
+ /* @__PURE__ */ A("span", {
1581
1771
  className: "text-xs text-muted-foreground",
1582
1772
  children: [
1583
1773
  "(",
@@ -1587,11 +1777,11 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1587
1777
  })
1588
1778
  ]
1589
1779
  }),
1590
- t.usersWithAccounts !== void 0 && /* @__PURE__ */ O(m, {
1780
+ t.usersWithAccounts !== void 0 && /* @__PURE__ */ A(m, {
1591
1781
  variant: "light",
1592
1782
  children: [t.usersWithAccounts, " 👤"]
1593
1783
  }),
1594
- /* @__PURE__ */ D(f, {
1784
+ /* @__PURE__ */ k(f, {
1595
1785
  icon: "trash",
1596
1786
  label: n.consoleRemoveTenant,
1597
1787
  variant: "outline-danger",
@@ -1599,25 +1789,25 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1599
1789
  })
1600
1790
  ]
1601
1791
  }),
1602
- o && /* @__PURE__ */ O("div", {
1792
+ o && /* @__PURE__ */ A("div", {
1603
1793
  className: "mt-3 flex flex-col gap-3",
1604
1794
  children: [
1605
- /* @__PURE__ */ D("h4", {
1795
+ /* @__PURE__ */ k("h4", {
1606
1796
  className: "text-sm font-semibold",
1607
1797
  children: n.consoleKeys
1608
1798
  }),
1609
- p?.map((r) => /* @__PURE__ */ O("div", {
1799
+ p?.map((r) => /* @__PURE__ */ A("div", {
1610
1800
  className: "flex flex-wrap items-center gap-2 text-sm",
1611
1801
  children: [
1612
- /* @__PURE__ */ D("span", {
1802
+ /* @__PURE__ */ k("span", {
1613
1803
  className: "flex-1",
1614
1804
  children: r.name
1615
1805
  }),
1616
- r.permissions.map((e) => /* @__PURE__ */ D(m, {
1806
+ r.permissions.map((e) => /* @__PURE__ */ k(m, {
1617
1807
  variant: "info",
1618
1808
  children: e
1619
1809
  }, e)),
1620
- /* @__PURE__ */ D(f, {
1810
+ /* @__PURE__ */ k(f, {
1621
1811
  label: n.consoleRevoke,
1622
1812
  variant: "outline-danger",
1623
1813
  onClick: async () => {
@@ -1626,7 +1816,7 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1626
1816
  })
1627
1817
  ]
1628
1818
  }, r.id)),
1629
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(y, {
1819
+ /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(y, {
1630
1820
  label: n.consoleNewKey,
1631
1821
  variant: "outline-secondary",
1632
1822
  onClick: async () => {
@@ -1642,11 +1832,11 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1642
1832
  })).key), await b();
1643
1833
  }
1644
1834
  }) }),
1645
- /* @__PURE__ */ D("h4", {
1835
+ /* @__PURE__ */ k("h4", {
1646
1836
  className: "text-sm font-semibold",
1647
1837
  children: n.consoleAccounts
1648
1838
  }),
1649
- /* @__PURE__ */ D(R, {
1839
+ /* @__PURE__ */ k(V, {
1650
1840
  client: v,
1651
1841
  scope: "tenant",
1652
1842
  locale: r,
@@ -1654,18 +1844,18 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1654
1844
  })
1655
1845
  ]
1656
1846
  }),
1657
- g && /* @__PURE__ */ D(x, {
1847
+ g && /* @__PURE__ */ k(x, {
1658
1848
  title: n.consoleRemoveTenant,
1659
1849
  danger: !0,
1660
1850
  onClose: () => _(!1),
1661
1851
  onYes: async () => (await e.platform.removeTenant(t.id), _(!1), await a(), !0),
1662
- children: P(n.consoleRemoveTenantConfirm, { name: t.name })
1852
+ children: I(n.consoleRemoveTenantConfirm, { name: t.name })
1663
1853
  })
1664
1854
  ]
1665
1855
  });
1666
1856
  }
1667
1857
  var $ = (e) => e.toUpperCase().replace(/[^A-Z0-9]/g, "");
1668
- function oe({ client: e, t, approve: n, onAnswered: r }) {
1858
+ function fe({ client: e, t, approve: n, onAnswered: r }) {
1669
1859
  let [i, a] = d(null), [o, s] = d(null), u = c(async () => {
1670
1860
  try {
1671
1861
  let t = await e.pairingRequests(), r = n ? $(n) : "";
@@ -1678,22 +1868,22 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
1678
1868
  u();
1679
1869
  let e = setInterval(() => void u(), 5e3);
1680
1870
  return () => clearInterval(e);
1681
- }, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */ D(h, {
1871
+ }, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */ k(h, {
1682
1872
  title: t.consoleRequests,
1683
1873
  loading: i === null,
1684
1874
  loaderMinHeight: 80,
1685
- children: /* @__PURE__ */ O("div", {
1875
+ children: /* @__PURE__ */ A("div", {
1686
1876
  className: "flex flex-col gap-3",
1687
1877
  children: [
1688
- /* @__PURE__ */ D("p", {
1878
+ /* @__PURE__ */ k("p", {
1689
1879
  className: "text-sm text-muted-foreground",
1690
1880
  children: t.consoleRequestsHint
1691
1881
  }),
1692
- o && /* @__PURE__ */ D(p, {
1882
+ o && /* @__PURE__ */ k(p, {
1693
1883
  variant: o.variant,
1694
1884
  children: o.text
1695
1885
  }),
1696
- i?.length === 0 && !o && /* @__PURE__ */ D("p", {
1886
+ i?.length === 0 && !o && /* @__PURE__ */ k("p", {
1697
1887
  className: "text-sm text-muted-foreground",
1698
1888
  children: t.consoleRequestsEmpty
1699
1889
  }),
@@ -1702,42 +1892,42 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
1702
1892
  let a = await e.answerPairing(i.code, n);
1703
1893
  s(n ? {
1704
1894
  variant: "success",
1705
- text: P(t.consoleApproved, { name: a.name })
1895
+ text: I(t.consoleApproved, { name: a.name })
1706
1896
  } : {
1707
1897
  variant: "info",
1708
1898
  text: t.consoleDenied
1709
1899
  }), await u(), await r();
1710
1900
  };
1711
- return /* @__PURE__ */ O("div", {
1901
+ return /* @__PURE__ */ A("div", {
1712
1902
  className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
1713
1903
  children: [
1714
- a && /* @__PURE__ */ D(m, {
1904
+ a && /* @__PURE__ */ k(m, {
1715
1905
  variant: "primary",
1716
1906
  children: t.consoleRequestMatch
1717
1907
  }),
1718
- /* @__PURE__ */ D("div", {
1908
+ /* @__PURE__ */ k("div", {
1719
1909
  className: "font-mono text-2xl font-semibold tracking-widest",
1720
1910
  children: i.code
1721
1911
  }),
1722
- /* @__PURE__ */ D("p", {
1912
+ /* @__PURE__ */ k("p", {
1723
1913
  className: "text-sm",
1724
- children: P(t.consoleRequestFrom, {
1914
+ children: I(t.consoleRequestFrom, {
1725
1915
  name: i.name,
1726
1916
  from: i.from ?? "?",
1727
1917
  at: Q(i.createdAt)
1728
1918
  })
1729
1919
  }),
1730
- /* @__PURE__ */ D("p", {
1920
+ /* @__PURE__ */ k("p", {
1731
1921
  className: "text-sm text-muted-foreground",
1732
- children: i.project ? P(t.consoleRequestProject, { project: i.project }) : t.consoleRequestAll
1922
+ children: i.project ? I(t.consoleRequestProject, { project: i.project }) : t.consoleRequestAll
1733
1923
  }),
1734
- /* @__PURE__ */ O("div", {
1924
+ /* @__PURE__ */ A("div", {
1735
1925
  className: "flex flex-wrap gap-2",
1736
- children: [/* @__PURE__ */ D(y, {
1926
+ children: [/* @__PURE__ */ k(y, {
1737
1927
  label: t.consoleApprove,
1738
1928
  variant: "primary",
1739
1929
  onClick: () => o(!0)
1740
- }), /* @__PURE__ */ D(y, {
1930
+ }), /* @__PURE__ */ k(y, {
1741
1931
  label: t.consoleDeny,
1742
1932
  variant: "outline-danger",
1743
1933
  onClick: () => o(!1)
@@ -1750,6 +1940,6 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
1750
1940
  })
1751
1941
  });
1752
1942
  }
1753
- export { K as AddRunner, H as InstallGuide, R as RunnerAccounts, re as RunnerConsole, U as RunnersSettings, P as fill, M as runnerTexts, N as textsFor };
1943
+ export { q as AddRunner, W as InstallGuide, V as RunnerAccounts, le as RunnerConsole, ie as RunnersSettings, I as fill, P as runnerTexts, F as textsFor };
1754
1944
 
1755
1945
  //# sourceMappingURL=ui.mjs.map