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