@llmnative/runner 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.mjs CHANGED
@@ -2,7 +2,8 @@ import { RunnerError as e } from "./client.mjs";
2
2
  import { RUNNER_REQUIREMENTS as t, checkRunner as n, installCommand as r, isDomain as i, lookupDomain as a, verifiedInstallCommands as o } from "./steps.mjs";
3
3
  import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
4
4
  import { ActionButton as d, Alert as f, Badge as p, Card as m, Code as h, DescriptionList as g, Form as _, LoadingButton as v, Modal as y, ModalYesNo as b, Password as x, Select as S, String as C, Switch as w, TextArea as T } from "@llmnative/react";
5
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
5
+ import { jsx as E, jsxs as D } from "react/jsx-runtime";
6
+ import { createPortal as O } from "react-dom";
6
7
  // src/ui/texts.ts
7
8
  var k = {
8
9
  accountsTitleUser: "My subscriptions",
@@ -308,88 +309,88 @@ function I({ client: t, scope: n, locale: r, texts: i, onChange: a }) {
308
309
  let e = await C();
309
310
  a?.(e);
310
311
  };
311
- return /* @__PURE__ */ O(m, {
312
+ return /* @__PURE__ */ D(m, {
312
313
  title: n === "user" ? o.accountsTitleUser : o.accountsTitleTenant,
313
314
  loading: l === null,
314
315
  loaderMinHeight: 120,
315
- children: [/* @__PURE__ */ O("div", {
316
+ children: [/* @__PURE__ */ D("div", {
316
317
  className: "flex flex-col gap-3",
317
318
  children: [
318
- /* @__PURE__ */ D("p", {
319
+ /* @__PURE__ */ E("p", {
319
320
  className: "text-sm text-muted-foreground",
320
321
  children: n === "user" ? o.accountsIntroUser : o.accountsIntroTenant
321
322
  }),
322
- g && /* @__PURE__ */ D(f, {
323
+ g && /* @__PURE__ */ E(f, {
323
324
  variant: "danger",
324
325
  children: N(o.error, { error: g })
325
326
  }),
326
- l?.length === 0 && !g && /* @__PURE__ */ D("p", {
327
+ l?.length === 0 && !g && /* @__PURE__ */ E("p", {
327
328
  className: "text-sm text-muted-foreground",
328
329
  children: o.accountsEmpty
329
330
  }),
330
- l?.map((e) => /* @__PURE__ */ O("div", {
331
+ l?.map((e) => /* @__PURE__ */ D("div", {
331
332
  className: "flex flex-wrap items-center gap-2 rounded-md border border-border p-3",
332
- children: [/* @__PURE__ */ O("div", {
333
+ children: [/* @__PURE__ */ D("div", {
333
334
  className: "min-w-0 flex-1",
334
- children: [/* @__PURE__ */ O("div", {
335
+ children: [/* @__PURE__ */ D("div", {
335
336
  className: "flex flex-wrap items-center gap-2",
336
337
  children: [
337
- /* @__PURE__ */ D("span", {
338
+ /* @__PURE__ */ E("span", {
338
339
  className: "font-medium",
339
340
  children: e.label ?? P[e.provider] ?? e.provider
340
341
  }),
341
- /* @__PURE__ */ D(p, {
342
+ /* @__PURE__ */ E(p, {
342
343
  variant: "secondary",
343
344
  children: P[e.provider] ?? e.provider
344
345
  }),
345
- e.noCreditUntil && /* @__PURE__ */ D(p, {
346
+ e.noCreditUntil && /* @__PURE__ */ E(p, {
346
347
  variant: "warning",
347
348
  children: N(o.accountsNoCredit, { at: F(e.noCreditUntil) })
348
349
  })
349
350
  ]
350
- }), /* @__PURE__ */ D("p", {
351
+ }), /* @__PURE__ */ E("p", {
351
352
  className: "text-xs text-muted-foreground",
352
353
  children: N(o.accountsConnected, { at: F(e.at) })
353
354
  })]
354
- }), /* @__PURE__ */ D(d, {
355
+ }), /* @__PURE__ */ E(d, {
355
356
  icon: "unlink",
356
357
  label: o.accountsRemove,
357
358
  variant: "outline-danger",
358
359
  onClick: () => S(e)
359
360
  })]
360
361
  }, `${e.provider}/${e.id}`)),
361
- v === "claude" && /* @__PURE__ */ D(L, {
362
+ v === "claude" && /* @__PURE__ */ E(L, {
362
363
  client: t,
363
364
  t: o,
364
365
  onDone: w,
365
366
  onCancel: () => y(null)
366
367
  }),
367
- v === "opencode" && /* @__PURE__ */ D(R, {
368
+ v === "opencode" && /* @__PURE__ */ E(R, {
368
369
  client: t,
369
370
  t: o,
370
371
  onDone: w,
371
372
  onCancel: () => y(null)
372
373
  }),
373
- !v && /* @__PURE__ */ O("div", {
374
+ !v && /* @__PURE__ */ D("div", {
374
375
  className: "flex flex-wrap gap-2",
375
- children: [/* @__PURE__ */ D(d, {
376
+ children: [/* @__PURE__ */ E(d, {
376
377
  icon: "plus",
377
378
  label: o.claudeConnect,
378
379
  variant: "primary",
379
380
  onClick: () => y("claude")
380
- }), /* @__PURE__ */ D(d, {
381
+ }), /* @__PURE__ */ E(d, {
381
382
  icon: "plus",
382
383
  label: o.opencodeConnect,
383
384
  variant: "outline-secondary",
384
385
  onClick: () => y("opencode")
385
386
  })]
386
387
  }),
387
- /* @__PURE__ */ D("p", {
388
+ /* @__PURE__ */ E("p", {
388
389
  className: "text-xs text-muted-foreground",
389
390
  children: o.termsNote
390
391
  })
391
392
  ]
392
- }), x && /* @__PURE__ */ D(b, {
393
+ }), x && /* @__PURE__ */ E(b, {
393
394
  title: o.accountsRemove,
394
395
  danger: !0,
395
396
  onClose: () => S(null),
@@ -405,47 +406,47 @@ function L({ client: t, t: n, onDone: r, onCancel: i }) {
405
406
  return t.accounts.startClaudeLogin().then(({ url: t }) => !e && o(t)).catch(() => !e && g(n.claudeNoLink)), () => {
406
407
  e = !0;
407
408
  };
408
- }, [t, n]), /* @__PURE__ */ O("div", {
409
+ }, [t, n]), /* @__PURE__ */ D("div", {
409
410
  className: "flex flex-col gap-3 rounded-md border border-border p-3",
410
411
  children: [
411
- h && /* @__PURE__ */ D(f, {
412
+ h && /* @__PURE__ */ E(f, {
412
413
  variant: "danger",
413
414
  children: h
414
415
  }),
415
- /* @__PURE__ */ D("p", {
416
+ /* @__PURE__ */ E("p", {
416
417
  className: "text-sm",
417
418
  children: n.claudeStep1
418
419
  }),
419
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(d, {
420
+ /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
420
421
  icon: "external-link",
421
422
  label: n.claudeOpen,
422
423
  variant: "primary",
423
424
  disabled: !a,
424
425
  onClick: () => a && window.open(a, "_blank", "noopener,noreferrer")
425
426
  }) }),
426
- /* @__PURE__ */ D("p", {
427
+ /* @__PURE__ */ E("p", {
427
428
  className: "text-sm",
428
429
  children: n.claudeStep2
429
430
  }),
430
- /* @__PURE__ */ O(_, {
431
+ /* @__PURE__ */ D(_, {
431
432
  appearance: "empty",
432
433
  showNotice: !1,
433
434
  onSubmit: () => !1,
434
- children: [/* @__PURE__ */ D(C, {
435
+ children: [/* @__PURE__ */ E(C, {
435
436
  name: "code",
436
437
  label: n.claudeCode,
437
438
  autoComplete: "off",
438
439
  onChange: ({ value: e }) => l(String(e ?? ""))
439
- }), /* @__PURE__ */ D(C, {
440
+ }), /* @__PURE__ */ E(C, {
440
441
  name: "label",
441
442
  label: n.claudeLabel,
442
443
  placeholder: n.claudeLabelPlaceholder,
443
444
  onChange: ({ value: e }) => m(String(e ?? ""))
444
445
  })]
445
446
  }),
446
- /* @__PURE__ */ O("div", {
447
+ /* @__PURE__ */ D("div", {
447
448
  className: "flex gap-2",
448
- children: [/* @__PURE__ */ D(v, {
449
+ children: [/* @__PURE__ */ E(v, {
449
450
  label: n.claudeFinish,
450
451
  variant: "primary",
451
452
  disabled: !a || !s.trim(),
@@ -456,7 +457,7 @@ function L({ client: t, t: n, onDone: r, onCancel: i }) {
456
457
  g(t instanceof e && t.code === "refused" ? n.claudeRefused : N(n.error, { error: t instanceof e ? t.code : String(t) }));
457
458
  }
458
459
  }
459
- }), /* @__PURE__ */ D(d, {
460
+ }), /* @__PURE__ */ E(d, {
460
461
  label: n.cancel,
461
462
  variant: "outline-secondary",
462
463
  onClick: i
@@ -467,31 +468,31 @@ function L({ client: t, t: n, onDone: r, onCancel: i }) {
467
468
  }
468
469
  function R({ client: t, t: n, onDone: r, onCancel: i }) {
469
470
  let [a, o] = u(""), [s, c] = u(""), [l, p] = u(null);
470
- return /* @__PURE__ */ O("div", {
471
+ return /* @__PURE__ */ D("div", {
471
472
  className: "flex flex-col gap-3 rounded-md border border-border p-3",
472
473
  children: [
473
- l && /* @__PURE__ */ D(f, {
474
+ l && /* @__PURE__ */ E(f, {
474
475
  variant: "danger",
475
476
  children: l
476
477
  }),
477
- /* @__PURE__ */ O(_, {
478
+ /* @__PURE__ */ D(_, {
478
479
  appearance: "empty",
479
480
  showNotice: !1,
480
481
  onSubmit: () => !1,
481
- children: [/* @__PURE__ */ D(x, {
482
+ children: [/* @__PURE__ */ E(x, {
482
483
  name: "key",
483
484
  label: n.opencodeKey,
484
485
  autoComplete: "off",
485
486
  onChange: ({ value: e }) => o(String(e ?? ""))
486
- }), /* @__PURE__ */ D(C, {
487
+ }), /* @__PURE__ */ E(C, {
487
488
  name: "label",
488
489
  label: n.claudeLabel,
489
490
  onChange: ({ value: e }) => c(String(e ?? ""))
490
491
  })]
491
492
  }),
492
- /* @__PURE__ */ O("div", {
493
+ /* @__PURE__ */ D("div", {
493
494
  className: "flex gap-2",
494
- children: [/* @__PURE__ */ D(v, {
495
+ children: [/* @__PURE__ */ E(v, {
495
496
  label: n.opencodeAdd,
496
497
  variant: "primary",
497
498
  disabled: !a.trim(),
@@ -502,7 +503,7 @@ function R({ client: t, t: n, onDone: r, onCancel: i }) {
502
503
  p(N(n.error, { error: t instanceof e ? t.code : String(t) }));
503
504
  }
504
505
  }
505
- }), /* @__PURE__ */ D(d, {
506
+ }), /* @__PURE__ */ E(d, {
506
507
  label: n.cancel,
507
508
  variant: "outline-secondary",
508
509
  onClick: i
@@ -513,11 +514,11 @@ function R({ client: t, t: n, onDone: r, onCancel: i }) {
513
514
  }
514
515
  // src/ui/InstallGuide.tsx
515
516
  function z({ title: e, children: t, done: n }) {
516
- return /* @__PURE__ */ O("section", {
517
+ return /* @__PURE__ */ D("section", {
517
518
  className: "flex flex-col gap-2 border-l-2 border-border pl-4",
518
- children: [/* @__PURE__ */ O("h4", {
519
+ children: [/* @__PURE__ */ D("h4", {
519
520
  className: "flex items-center gap-2 text-sm font-semibold",
520
- children: [e, n && /* @__PURE__ */ D(p, {
521
+ children: [e, n && /* @__PURE__ */ E(p, {
521
522
  variant: "success",
522
523
  children: "✓"
523
524
  })]
@@ -525,13 +526,13 @@ function z({ title: e, children: t, done: n }) {
525
526
  });
526
527
  }
527
528
  function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p = n, version: m }) {
528
- let g = M(e, s), [y, b] = u(""), [x, S] = u(null), [w, T] = u(null), [E, k] = u(""), [A, j] = u(!1), [P, F] = u(null), I = i(y), L = `https://${y.trim().toLowerCase()}`, R = t;
529
- return /* @__PURE__ */ O("div", {
529
+ let g = M(e, s), [y, b] = u(""), [x, S] = u(null), [w, T] = u(null), [O, k] = u(""), [A, j] = u(!1), [P, F] = u(null), I = i(y), L = `https://${y.trim().toLowerCase()}`, R = t;
530
+ return /* @__PURE__ */ D("div", {
530
531
  className: "flex flex-col gap-5",
531
532
  children: [
532
- /* @__PURE__ */ D(z, {
533
+ /* @__PURE__ */ E(z, {
533
534
  title: g.guideServerTitle,
534
- children: /* @__PURE__ */ D("p", {
535
+ children: /* @__PURE__ */ E("p", {
535
536
  className: "text-sm",
536
537
  children: N(g.guideServer, {
537
538
  systems: R.systems.join(", "),
@@ -542,19 +543,19 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
542
543
  })
543
544
  })
544
545
  }),
545
- /* @__PURE__ */ O(z, {
546
+ /* @__PURE__ */ D(z, {
546
547
  title: g.guideDnsTitle,
547
548
  done: !!x?.ips.length,
548
549
  children: [
549
- /* @__PURE__ */ D("p", {
550
+ /* @__PURE__ */ E("p", {
550
551
  className: "text-sm",
551
552
  children: g.guideDns
552
553
  }),
553
- /* @__PURE__ */ D(_, {
554
+ /* @__PURE__ */ E(_, {
554
555
  appearance: "empty",
555
556
  showNotice: !1,
556
557
  onSubmit: () => !1,
557
- children: /* @__PURE__ */ D(C, {
558
+ children: /* @__PURE__ */ E(C, {
558
559
  name: "domain",
559
560
  label: g.guideDomain,
560
561
  placeholder: "runner.example.com",
@@ -564,18 +565,18 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
564
565
  }
565
566
  })
566
567
  }),
567
- /* @__PURE__ */ O("div", {
568
+ /* @__PURE__ */ D("div", {
568
569
  className: "flex flex-wrap items-center gap-2",
569
- children: [/* @__PURE__ */ D(v, {
570
+ children: [/* @__PURE__ */ E(v, {
570
571
  label: g.guideCheckDns,
571
572
  variant: "outline-secondary",
572
573
  disabled: !I,
573
574
  onClick: async () => S({ ips: await l(y.trim().toLowerCase()).catch(() => []) })
574
- }), x && (x.ips.length ? /* @__PURE__ */ D(f, {
575
+ }), x && (x.ips.length ? /* @__PURE__ */ E(f, {
575
576
  variant: "success",
576
577
  appearance: "text",
577
578
  children: N(g.guideDnsOk, { ips: x.ips.join(", ") })
578
- }) : /* @__PURE__ */ D(f, {
579
+ }) : /* @__PURE__ */ E(f, {
579
580
  variant: "warning",
580
581
  appearance: "text",
581
582
  children: g.guideDnsMissing
@@ -583,21 +584,21 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
583
584
  })
584
585
  ]
585
586
  }),
586
- /* @__PURE__ */ D(z, {
587
+ /* @__PURE__ */ E(z, {
587
588
  title: g.guideAccessTitle,
588
- children: /* @__PURE__ */ D("p", {
589
+ children: /* @__PURE__ */ E("p", {
589
590
  className: "text-sm",
590
591
  children: g.guideAccess
591
592
  })
592
593
  }),
593
- /* @__PURE__ */ O(z, {
594
+ /* @__PURE__ */ D(z, {
594
595
  title: g.guideInstallTitle,
595
596
  children: [
596
- /* @__PURE__ */ D("p", {
597
+ /* @__PURE__ */ E("p", {
597
598
  className: "text-sm",
598
599
  children: g.guideInstall
599
600
  }),
600
- /* @__PURE__ */ D(h, {
601
+ /* @__PURE__ */ E(h, {
601
602
  language: "bash",
602
603
  showCopy: !0,
603
604
  children: r({
@@ -605,12 +606,12 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
605
606
  ...m ? { version: m } : {}
606
607
  })
607
608
  }),
608
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(d, {
609
+ /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
609
610
  label: g.guideVerified,
610
611
  variant: "link",
611
612
  onClick: () => j((e) => !e)
612
613
  }) }),
613
- A && /* @__PURE__ */ D(h, {
614
+ A && /* @__PURE__ */ E(h, {
614
615
  language: "bash",
615
616
  showCopy: !0,
616
617
  children: o({
@@ -620,19 +621,19 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
620
621
  })
621
622
  ]
622
623
  }),
623
- /* @__PURE__ */ O(z, {
624
+ /* @__PURE__ */ D(z, {
624
625
  title: g.guidePairTitle,
625
626
  done: w?.ok,
626
627
  children: [
627
- /* @__PURE__ */ D("p", {
628
+ /* @__PURE__ */ E("p", {
628
629
  className: "text-sm",
629
630
  children: g.guidePair
630
631
  }),
631
- /* @__PURE__ */ D(_, {
632
+ /* @__PURE__ */ E(_, {
632
633
  appearance: "empty",
633
634
  showNotice: !1,
634
635
  onSubmit: () => !1,
635
- children: /* @__PURE__ */ D(C, {
636
+ children: /* @__PURE__ */ E(C, {
636
637
  name: "code",
637
638
  label: g.addCode,
638
639
  placeholder: "ABCD-EFGH",
@@ -640,18 +641,18 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
640
641
  onChange: ({ value: e }) => k(String(e ?? ""))
641
642
  })
642
643
  }),
643
- w && /* @__PURE__ */ D(f, {
644
+ w && /* @__PURE__ */ E(f, {
644
645
  variant: w.ok ? "success" : "warning",
645
646
  appearance: "text",
646
647
  children: w.text
647
648
  }),
648
- P && /* @__PURE__ */ D(f, {
649
+ P && /* @__PURE__ */ E(f, {
649
650
  variant: "danger",
650
651
  children: P
651
652
  }),
652
- /* @__PURE__ */ O("div", {
653
+ /* @__PURE__ */ D("div", {
653
654
  className: "flex flex-wrap gap-2",
654
- children: [/* @__PURE__ */ D(v, {
655
+ children: [/* @__PURE__ */ E(v, {
655
656
  label: g.guideCheckHealth,
656
657
  variant: "outline-secondary",
657
658
  disabled: !I,
@@ -668,15 +669,15 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
668
669
  text: N(g.guideHealthKo, { url: L })
669
670
  });
670
671
  }
671
- }), /* @__PURE__ */ D(v, {
672
+ }), /* @__PURE__ */ E(v, {
672
673
  label: g.addConnect,
673
674
  variant: "primary",
674
- disabled: !I || E.trim().length < 8,
675
+ disabled: !I || O.trim().length < 8,
675
676
  onClick: async () => {
676
677
  try {
677
678
  F(null), await c({
678
679
  url: L,
679
- code: E.trim()
680
+ code: O.trim()
680
681
  });
681
682
  } catch (e) {
682
683
  F(N(g.error, { error: e.message }));
@@ -686,9 +687,9 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
686
687
  })
687
688
  ]
688
689
  }),
689
- /* @__PURE__ */ D(z, {
690
+ /* @__PURE__ */ E(z, {
690
691
  title: g.guideTroubleTitle,
691
- children: /* @__PURE__ */ D("p", {
692
+ children: /* @__PURE__ */ E("p", {
692
693
  className: "text-sm text-muted-foreground",
693
694
  children: g.guideTrouble
694
695
  })
@@ -714,19 +715,19 @@ function V({ fleet: e, locale: t, texts: n }) {
714
715
  c(() => {
715
716
  T();
716
717
  }, [T]);
717
- let E = async (t, n) => {
718
+ let O = async (t, n) => {
718
719
  await e.update(t, n), await T();
719
720
  };
720
- return /* @__PURE__ */ O("div", {
721
+ return /* @__PURE__ */ D("div", {
721
722
  className: "flex flex-col gap-4",
722
723
  children: [
723
- /* @__PURE__ */ D(m, {
724
- header: /* @__PURE__ */ O("div", {
724
+ /* @__PURE__ */ E(m, {
725
+ header: /* @__PURE__ */ D("div", {
725
726
  className: "flex flex-wrap items-center gap-2",
726
- children: [/* @__PURE__ */ D("h3", {
727
+ children: [/* @__PURE__ */ E("h3", {
727
728
  className: "flex-1 text-base font-semibold",
728
729
  children: r.runnersTitle
729
- }), /* @__PURE__ */ D(d, {
730
+ }), /* @__PURE__ */ E(d, {
730
731
  icon: "plus",
731
732
  label: r.runnersAdd,
732
733
  variant: "primary",
@@ -735,56 +736,56 @@ function V({ fleet: e, locale: t, texts: n }) {
735
736
  }),
736
737
  loading: i === null,
737
738
  loaderMinHeight: 120,
738
- children: /* @__PURE__ */ O("div", {
739
+ children: /* @__PURE__ */ D("div", {
739
740
  className: "flex flex-col gap-3",
740
741
  children: [
741
- /* @__PURE__ */ D("p", {
742
+ /* @__PURE__ */ E("p", {
742
743
  className: "text-sm text-muted-foreground",
743
744
  children: r.runnersIntro
744
745
  }),
745
- x && /* @__PURE__ */ D(f, {
746
+ x && /* @__PURE__ */ E(f, {
746
747
  variant: "danger",
747
748
  children: x
748
749
  }),
749
- i?.length === 0 && /* @__PURE__ */ D("p", {
750
+ i?.length === 0 && /* @__PURE__ */ E("p", {
750
751
  className: "text-sm text-muted-foreground",
751
752
  children: r.runnersEmpty
752
753
  }),
753
- i?.map((e) => /* @__PURE__ */ O("div", {
754
+ i?.map((e) => /* @__PURE__ */ D("div", {
754
755
  className: "flex flex-col gap-2 rounded-md border border-border p-3",
755
- children: [/* @__PURE__ */ O("div", {
756
+ children: [/* @__PURE__ */ D("div", {
756
757
  className: "flex flex-wrap items-center gap-2",
757
758
  children: [
758
- /* @__PURE__ */ D("span", {
759
+ /* @__PURE__ */ E("span", {
759
760
  className: "font-medium",
760
761
  children: e.name
761
762
  }),
762
- /* @__PURE__ */ D("span", {
763
+ /* @__PURE__ */ E("span", {
763
764
  className: "text-xs text-muted-foreground",
764
765
  children: e.url
765
766
  }),
766
- e.status === null && /* @__PURE__ */ D(p, {
767
+ e.status === null && /* @__PURE__ */ E(p, {
767
768
  variant: "danger",
768
769
  children: r.runnersUnreachable
769
770
  }),
770
- e.status && /* @__PURE__ */ D(p, {
771
+ e.status && /* @__PURE__ */ E(p, {
771
772
  variant: "secondary",
772
773
  children: N(r.runnersVersion, { version: e.status.version })
773
774
  }),
774
- e.status && /* @__PURE__ */ D(p, {
775
+ e.status && /* @__PURE__ */ E(p, {
775
776
  variant: "info",
776
777
  children: N(r.runnersLoad, {
777
778
  chats: e.status.load.chats,
778
779
  max: e.status.load.maxChats
779
780
  })
780
781
  }),
781
- e.status && /* @__PURE__ */ D(p, {
782
+ e.status && /* @__PURE__ */ E(p, {
782
783
  variant: "light",
783
784
  children: N(r.runnersTenants, { count: e.status.tenants.length })
784
785
  }),
785
- /* @__PURE__ */ D("div", {
786
+ /* @__PURE__ */ E("div", {
786
787
  className: "ml-auto",
787
- children: /* @__PURE__ */ D(d, {
788
+ children: /* @__PURE__ */ E(d, {
788
789
  icon: "trash",
789
790
  label: r.runnersRemove,
790
791
  variant: "outline-danger",
@@ -792,7 +793,7 @@ function V({ fleet: e, locale: t, texts: n }) {
792
793
  })
793
794
  })
794
795
  ]
795
- }), /* @__PURE__ */ D(_, {
796
+ }), /* @__PURE__ */ E(_, {
796
797
  appearance: "empty",
797
798
  showNotice: !1,
798
799
  onSubmit: () => !1,
@@ -800,18 +801,18 @@ function V({ fleet: e, locale: t, texts: n }) {
800
801
  isDefault: e.isDefault ? "true" : "",
801
802
  draining: e.draining ? "true" : ""
802
803
  },
803
- children: /* @__PURE__ */ O("div", {
804
+ children: /* @__PURE__ */ D("div", {
804
805
  className: "flex flex-wrap gap-4",
805
- children: [/* @__PURE__ */ D(w, {
806
+ children: [/* @__PURE__ */ E(w, {
806
807
  name: "isDefault",
807
808
  label: r.runnersDefault,
808
809
  valueChecked: "true",
809
- onChange: ({ value: t }) => void E(e.id, { isDefault: !!t })
810
- }), /* @__PURE__ */ D(w, {
810
+ onChange: ({ value: t }) => void O(e.id, { isDefault: !!t })
811
+ }), /* @__PURE__ */ E(w, {
811
812
  name: "draining",
812
813
  label: r.runnersDraining,
813
814
  valueChecked: "true",
814
- onChange: ({ value: t }) => void E(e.id, { draining: !!t })
815
+ onChange: ({ value: t }) => void O(e.id, { draining: !!t })
815
816
  })]
816
817
  })
817
818
  })]
@@ -819,26 +820,26 @@ function V({ fleet: e, locale: t, texts: n }) {
819
820
  ]
820
821
  })
821
822
  }),
822
- e.tenants && i && i.length > 0 && /* @__PURE__ */ D(m, {
823
+ e.tenants && i && i.length > 0 && /* @__PURE__ */ E(m, {
823
824
  title: r.distributionTitle,
824
825
  loading: o === null,
825
826
  loaderMinHeight: 80,
826
- children: /* @__PURE__ */ O("div", {
827
+ children: /* @__PURE__ */ D("div", {
827
828
  className: "flex flex-col gap-2",
828
- children: [/* @__PURE__ */ D("p", {
829
+ children: [/* @__PURE__ */ E("p", {
829
830
  className: "text-sm text-muted-foreground",
830
831
  children: r.distributionIntro
831
- }), /* @__PURE__ */ D(_, {
832
+ }), /* @__PURE__ */ E(_, {
832
833
  appearance: "empty",
833
834
  showNotice: !1,
834
835
  onSubmit: () => !1,
835
836
  defaultValues: Object.fromEntries((o ?? []).map((e) => [`runner_${e.id}`, e.runnerId ?? ""])),
836
- children: (o ?? []).map((t) => /* @__PURE__ */ O("div", {
837
+ children: (o ?? []).map((t) => /* @__PURE__ */ D("div", {
837
838
  className: "flex flex-wrap items-center gap-2",
838
- children: [/* @__PURE__ */ D("span", {
839
+ children: [/* @__PURE__ */ E("span", {
839
840
  className: "min-w-40 flex-1 text-sm",
840
841
  children: t.name
841
- }), /* @__PURE__ */ D(S, {
842
+ }), /* @__PURE__ */ E(S, {
842
843
  name: `runner_${t.id}`,
843
844
  title: r.distributionRunner,
844
845
  placeholderOption: {
@@ -857,7 +858,7 @@ function V({ fleet: e, locale: t, texts: n }) {
857
858
  })]
858
859
  })
859
860
  }),
860
- h && /* @__PURE__ */ D(H, {
861
+ h && /* @__PURE__ */ E(W, {
861
862
  fleet: e,
862
863
  t: r,
863
864
  locale: t,
@@ -866,7 +867,7 @@ function V({ fleet: e, locale: t, texts: n }) {
866
867
  g(!1), await T();
867
868
  }
868
869
  }),
869
- v && /* @__PURE__ */ D(b, {
870
+ v && /* @__PURE__ */ E(b, {
870
871
  title: r.runnersRemove,
871
872
  danger: !0,
872
873
  onClose: () => y(null),
@@ -876,99 +877,103 @@ function V({ fleet: e, locale: t, texts: n }) {
876
877
  ]
877
878
  });
878
879
  }
879
- function H({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
880
- let [a, o] = u("choose"), [s, c] = u(""), [l, p] = u(null), m = (e) => p(N(t.error, { error: e.message })), h = /* @__PURE__ */ D(_, {
881
- appearance: "empty",
882
- showNotice: !1,
883
- onSubmit: () => !1,
884
- children: /* @__PURE__ */ D(C, {
885
- name: "name",
886
- label: t.addName,
887
- placeholder: t.addNamePlaceholder,
888
- onChange: ({ value: e }) => c(String(e ?? ""))
889
- })
890
- });
891
- return /* @__PURE__ */ D(y, {
880
+ function H({ target: e, children: t }) {
881
+ return e ? O(t, e) : null;
882
+ }
883
+ var U = (e) => {
884
+ try {
885
+ return new URL(e).hostname;
886
+ } catch {
887
+ return e;
888
+ }
889
+ };
890
+ function W({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
891
+ let [a, o] = u("choose"), [c, l] = u(null), [p, m] = u(null), h = s((e) => l(N(t.error, { error: e.message })), [t]);
892
+ return /* @__PURE__ */ E(y, {
892
893
  title: t.addTitle,
893
894
  size: "lg",
894
895
  onClose: r,
895
- footer: !1,
896
- children: /* @__PURE__ */ O("div", {
896
+ footer: a === "choose" || a === "guided" ? !1 : /* @__PURE__ */ E("div", {
897
+ ref: m,
898
+ className: "flex w-full flex-wrap items-center justify-end gap-3"
899
+ }),
900
+ children: /* @__PURE__ */ D("div", {
897
901
  className: "flex flex-col gap-4",
898
902
  children: [
899
- l && /* @__PURE__ */ D(f, {
903
+ c && /* @__PURE__ */ E(f, {
900
904
  variant: "danger",
901
- children: l
905
+ children: c
902
906
  }),
903
- a === "choose" && /* @__PURE__ */ O("div", {
907
+ a === "choose" && /* @__PURE__ */ D("div", {
904
908
  className: "grid gap-3 sm:grid-cols-3",
905
909
  children: [
906
- e.install && /* @__PURE__ */ D(U, {
910
+ e.install && /* @__PURE__ */ E(G, {
907
911
  title: t.addAutomatic,
908
912
  hint: t.addAutomaticHint,
909
913
  onClick: () => o("automatic")
910
914
  }),
911
- /* @__PURE__ */ D(U, {
915
+ /* @__PURE__ */ E(G, {
912
916
  title: t.addGuided,
913
917
  hint: t.addGuidedHint,
914
918
  onClick: () => o("guided")
915
919
  }),
916
- /* @__PURE__ */ D(U, {
920
+ /* @__PURE__ */ E(G, {
917
921
  title: t.addExisting,
918
922
  hint: t.addExistingHint,
919
923
  onClick: () => o("existing")
920
924
  })
921
925
  ]
922
926
  }),
923
- a !== "choose" && /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(d, {
927
+ a !== "choose" && /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
924
928
  icon: "arrow-left",
925
929
  label: t.addBack,
926
930
  variant: "link",
927
931
  onClick: () => {
928
- o("choose"), p(null);
932
+ o("choose"), l(null);
929
933
  }
930
934
  }) }),
931
- a === "automatic" && e.install && /* @__PURE__ */ O(E, { children: [h, /* @__PURE__ */ D(J, {
935
+ a === "automatic" && e.install && /* @__PURE__ */ E(ee, {
932
936
  t,
937
+ footer: p,
933
938
  localKeys: !!e.localKeys,
934
939
  install: (t, n, r) => e.install({
935
- name: s.trim() || t,
940
+ name: t,
936
941
  domain: t,
937
942
  access: n
938
943
  }, r),
939
944
  onDone: i,
940
- onError: m
941
- })] }),
942
- a === "guided" && /* @__PURE__ */ O(E, { children: [h, /* @__PURE__ */ D(B, {
945
+ onError: h
946
+ }),
947
+ a === "guided" && /* @__PURE__ */ E(B, {
943
948
  locale: n,
944
949
  texts: t,
945
950
  onPair: async ({ url: t, code: n }) => {
946
951
  await i(await e.add({
947
- name: s.trim() || new URL(t).hostname,
952
+ name: U(t),
948
953
  url: t,
949
954
  code: n
950
955
  }));
951
956
  }
952
- })] }),
953
- a === "existing" && /* @__PURE__ */ D(K, {
957
+ }),
958
+ a === "existing" && /* @__PURE__ */ E(Y, {
954
959
  t,
955
- name: s,
956
- nameField: h,
960
+ footer: p,
957
961
  pairing: e.startPairing && e.pairingStatus ? {
958
962
  start: e.startPairing.bind(e),
959
963
  status: e.pairingStatus.bind(e)
960
964
  } : void 0,
961
965
  onAdded: i,
962
- onError: m,
966
+ onError: h,
967
+ onClearError: () => l(null),
963
968
  onConnect: async (t, n) => {
964
969
  try {
965
970
  await i(await e.add({
966
- name: s.trim() || new URL(t).hostname,
971
+ name: U(t),
967
972
  url: t,
968
973
  code: n
969
974
  }));
970
975
  } catch (e) {
971
- m(e);
976
+ h(e);
972
977
  }
973
978
  }
974
979
  })
@@ -976,90 +981,90 @@ function H({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
976
981
  })
977
982
  });
978
983
  }
979
- function U({ title: e, hint: t, onClick: n }) {
980
- return /* @__PURE__ */ O("button", {
984
+ function G({ title: e, hint: t, onClick: n }) {
985
+ return /* @__PURE__ */ D("button", {
981
986
  type: "button",
982
987
  onClick: n,
983
988
  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",
984
- children: [/* @__PURE__ */ D("span", {
989
+ children: [/* @__PURE__ */ E("span", {
985
990
  className: "block font-medium",
986
991
  children: e
987
- }), /* @__PURE__ */ D("span", {
992
+ }), /* @__PURE__ */ E("span", {
988
993
  className: "mt-1 block text-sm text-muted-foreground",
989
994
  children: t
990
995
  })]
991
996
  });
992
997
  }
993
- var W = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), G = (e) => new Date(e).toLocaleTimeString(void 0, {
998
+ var K = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), q = (e) => new Date(e).toLocaleTimeString(void 0, {
994
999
  hour: "2-digit",
995
1000
  minute: "2-digit"
996
- });
997
- function K({ t: e, name: t, nameField: n, pairing: r, onAdded: i, onError: a, onConnect: o }) {
998
- let [s, l] = u(""), [p, m] = u(""), [h, g] = u(!r), [y, b] = u(null), [x, S] = u(null);
1001
+ }), J = 5;
1002
+ function Y({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError: a, onConnect: o }) {
1003
+ let [s, l] = u(""), [p, m] = u(""), [h, g] = u(!n), [y, b] = u(null), [x, S] = u(null);
999
1004
  return c(() => {
1000
- if (!y || !r) return;
1001
- let e = !1, t, n = async () => {
1005
+ if (!y || !n) return;
1006
+ let e = !1, t = 0, a, o = async () => {
1002
1007
  try {
1003
- let t = await r.status(y.id);
1004
- if (e) return;
1005
- if (t.status === "approved") {
1006
- await i(t.runner);
1008
+ let i = await n.status(y.id);
1009
+ if (t = 0, e) return;
1010
+ if (i.status === "approved") {
1011
+ await r(i.runner);
1007
1012
  return;
1008
1013
  }
1009
- if (t.status !== "pending") {
1010
- S(t.status), b(null);
1014
+ if (i.status !== "pending") {
1015
+ S(i.status), b(null);
1011
1016
  return;
1012
1017
  }
1013
- } catch (t) {
1014
- e || a(t);
1018
+ } catch (n) {
1019
+ t += 1, !e && t >= J && i(n);
1015
1020
  }
1016
- e || (t = setTimeout(() => void n(), 2e3));
1021
+ e || (a = setTimeout(() => void o(), 2e3));
1017
1022
  };
1018
- return t = setTimeout(() => void n(), 2e3), () => {
1019
- e = !0, clearTimeout(t);
1023
+ return a = setTimeout(() => void o(), 2e3), () => {
1024
+ e = !0, clearTimeout(a);
1020
1025
  };
1021
1026
  }, [
1022
1027
  y,
1028
+ n,
1023
1029
  r,
1024
- i,
1025
- a
1026
- ]), y ? /* @__PURE__ */ O("div", {
1030
+ i
1031
+ ]), y ? /* @__PURE__ */ D("div", {
1027
1032
  className: "flex flex-col gap-3",
1028
1033
  children: [
1029
- /* @__PURE__ */ D("h4", {
1034
+ /* @__PURE__ */ E("h4", {
1030
1035
  className: "font-semibold",
1031
1036
  children: e.pairWaitingTitle
1032
1037
  }),
1033
- /* @__PURE__ */ D("p", {
1038
+ /* @__PURE__ */ E("p", {
1034
1039
  className: "text-sm text-muted-foreground",
1035
1040
  children: e.pairWaitingHint
1036
1041
  }),
1037
- /* @__PURE__ */ D("div", {
1042
+ /* @__PURE__ */ E("div", {
1038
1043
  className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
1039
1044
  children: y.code
1040
1045
  }),
1041
- /* @__PURE__ */ O("div", {
1042
- className: "flex flex-wrap items-center gap-2",
1043
- children: [/* @__PURE__ */ D(d, {
1046
+ /* @__PURE__ */ E("p", {
1047
+ className: "text-sm text-muted-foreground",
1048
+ children: N(e.pairWaiting, { at: q(y.expiresAt) })
1049
+ }),
1050
+ /* @__PURE__ */ E(H, {
1051
+ target: t,
1052
+ children: /* @__PURE__ */ E(d, {
1044
1053
  icon: "external-link",
1045
1054
  label: e.pairOpen,
1046
1055
  variant: "primary",
1047
1056
  onClick: () => window.open(y.approveUrl, "_blank", "noopener")
1048
- }), /* @__PURE__ */ D("span", {
1049
- className: "text-sm text-muted-foreground",
1050
- children: N(e.pairWaiting, { at: G(y.expiresAt) })
1051
- })]
1057
+ })
1052
1058
  })
1053
1059
  ]
1054
- }) : /* @__PURE__ */ O("div", {
1060
+ }) : /* @__PURE__ */ D("div", {
1055
1061
  className: "flex flex-col gap-3",
1056
1062
  children: [
1057
- n,
1058
- x && /* @__PURE__ */ D(f, {
1063
+ x && /* @__PURE__ */ E(f, {
1059
1064
  variant: x === "denied" ? "danger" : "warning",
1060
1065
  children: x === "denied" ? e.pairDenied : e.pairExpired
1061
1066
  }),
1062
- /* @__PURE__ */ O(_, {
1067
+ /* @__PURE__ */ D(_, {
1063
1068
  appearance: "empty",
1064
1069
  showNotice: !1,
1065
1070
  onSubmit: () => !1,
@@ -1067,12 +1072,12 @@ function K({ t: e, name: t, nameField: n, pairing: r, onAdded: i, onError: a, on
1067
1072
  url: s,
1068
1073
  code: p
1069
1074
  },
1070
- children: [/* @__PURE__ */ D(C, {
1075
+ children: [/* @__PURE__ */ E(C, {
1071
1076
  name: "url",
1072
1077
  label: e.addUrl,
1073
1078
  placeholder: "https://runner.example.com",
1074
1079
  onChange: ({ value: e }) => l(String(e ?? ""))
1075
- }), h && /* @__PURE__ */ D(C, {
1080
+ }), h && /* @__PURE__ */ E(C, {
1076
1081
  name: "code",
1077
1082
  label: e.addCode,
1078
1083
  placeholder: "ABCD-EFGH",
@@ -1080,39 +1085,39 @@ function K({ t: e, name: t, nameField: n, pairing: r, onAdded: i, onError: a, on
1080
1085
  onChange: ({ value: e }) => m(String(e ?? ""))
1081
1086
  })]
1082
1087
  }),
1083
- /* @__PURE__ */ O("div", {
1084
- className: "flex flex-wrap items-center gap-2",
1085
- children: [h ? /* @__PURE__ */ D(v, {
1088
+ /* @__PURE__ */ D(H, {
1089
+ target: t,
1090
+ children: [n && /* @__PURE__ */ E(d, {
1091
+ label: h ? e.pairWithApproval : e.pairWithCode,
1092
+ variant: "link",
1093
+ onClick: () => g((e) => !e)
1094
+ }), h ? /* @__PURE__ */ E(v, {
1086
1095
  label: e.addConnect,
1087
1096
  variant: "primary",
1088
1097
  disabled: !s.trim() || p.trim().length < 8,
1089
- onClick: () => o(W(s), p.trim())
1090
- }) : /* @__PURE__ */ D(v, {
1098
+ onClick: () => o(K(s), p.trim())
1099
+ }) : /* @__PURE__ */ E(v, {
1091
1100
  label: x ? e.pairAgain : e.pairNext,
1092
1101
  variant: "primary",
1093
1102
  disabled: !s.trim(),
1094
1103
  onClick: async () => {
1095
- S(null);
1104
+ S(null), a();
1096
1105
  try {
1097
- let e = W(s);
1098
- b(await r.start({
1099
- name: t.trim() || new URL(e).hostname,
1106
+ let e = K(s);
1107
+ b(await n.start({
1108
+ name: U(e),
1100
1109
  url: e
1101
1110
  }));
1102
1111
  } catch (e) {
1103
- a(e);
1112
+ i(e);
1104
1113
  }
1105
1114
  }
1106
- }), r && /* @__PURE__ */ D(d, {
1107
- label: h ? e.pairWithApproval : e.pairWithCode,
1108
- variant: "link",
1109
- onClick: () => g((e) => !e)
1110
1115
  })]
1111
1116
  })
1112
1117
  ]
1113
1118
  });
1114
1119
  }
1115
- var q = [
1120
+ var X = [
1116
1121
  "check",
1117
1122
  "docker",
1118
1123
  "files",
@@ -1123,60 +1128,60 @@ var q = [
1123
1128
  "tls",
1124
1129
  "done"
1125
1130
  ];
1126
- function J({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
1127
- let [a, o] = u({
1131
+ function ee({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
1132
+ let [o, s] = u({
1128
1133
  host: "",
1129
1134
  port: "22",
1130
- username: t ? "" : "root",
1131
- auth: t ? "local" : "key",
1135
+ username: n ? "" : "root",
1136
+ auth: n ? "local" : "key",
1132
1137
  privateKey: "",
1133
1138
  password: "",
1134
1139
  domain: ""
1135
- }), [s, c] = u([]), [l, d] = u(null), [f, m] = u(!1), h = (e) => ({ value: t }) => o((n) => ({
1140
+ }), [c, l] = u([]), [d, f] = u(null), [m, h] = u(!1), g = (e) => ({ value: t }) => s((n) => ({
1136
1141
  ...n,
1137
1142
  [e]: String(t ?? "")
1138
- })), g = a.host.trim() && a.domain.trim() && (a.auth === "local" || a.username.trim()) && (a.auth === "local" || (a.auth === "key" ? a.privateKey.trim() : a.password));
1139
- return /* @__PURE__ */ O("div", {
1143
+ })), y = o.host.trim() && o.domain.trim() && (o.auth === "local" || o.username.trim()) && (o.auth === "local" || (o.auth === "key" ? o.privateKey.trim() : o.password));
1144
+ return /* @__PURE__ */ D("div", {
1140
1145
  className: "flex flex-col gap-3",
1141
1146
  children: [
1142
- !f && /* @__PURE__ */ O(_, {
1147
+ !m && /* @__PURE__ */ D(_, {
1143
1148
  appearance: "empty",
1144
1149
  showNotice: !1,
1145
1150
  onSubmit: () => !1,
1146
- defaultValues: a,
1151
+ defaultValues: o,
1147
1152
  children: [
1148
- /* @__PURE__ */ D(C, {
1153
+ /* @__PURE__ */ E(C, {
1149
1154
  name: "domain",
1150
1155
  label: e.guideDomain,
1151
1156
  placeholder: "runner.example.com",
1152
- onChange: h("domain")
1157
+ onChange: g("domain")
1153
1158
  }),
1154
- /* @__PURE__ */ O("div", {
1159
+ /* @__PURE__ */ D("div", {
1155
1160
  className: "grid gap-3 sm:grid-cols-3",
1156
1161
  children: [
1157
- /* @__PURE__ */ D(C, {
1162
+ /* @__PURE__ */ E(C, {
1158
1163
  name: "host",
1159
1164
  label: e.addHost,
1160
1165
  placeholder: "203.0.113.10",
1161
- onChange: h("host")
1166
+ onChange: g("host")
1162
1167
  }),
1163
- /* @__PURE__ */ D(C, {
1168
+ /* @__PURE__ */ E(C, {
1164
1169
  name: "port",
1165
1170
  label: e.addPort,
1166
- onChange: h("port")
1171
+ onChange: g("port")
1167
1172
  }),
1168
- /* @__PURE__ */ D(C, {
1173
+ /* @__PURE__ */ E(C, {
1169
1174
  name: "username",
1170
1175
  label: e.addUser,
1171
- onChange: h("username")
1176
+ onChange: g("username")
1172
1177
  })
1173
1178
  ]
1174
1179
  }),
1175
- /* @__PURE__ */ D(S, {
1180
+ /* @__PURE__ */ E(S, {
1176
1181
  name: "auth",
1177
1182
  label: e.addAuth,
1178
1183
  options: [
1179
- ...t ? [{
1184
+ ...n ? [{
1180
1185
  label: e.addLocalKey,
1181
1186
  value: "local"
1182
1187
  }] : [],
@@ -1189,75 +1194,78 @@ function J({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
1189
1194
  value: "password"
1190
1195
  }
1191
1196
  ],
1192
- onChange: h("auth")
1197
+ onChange: g("auth")
1193
1198
  }),
1194
- a.auth === "local" && /* @__PURE__ */ D("p", {
1199
+ o.auth === "local" && /* @__PURE__ */ E("p", {
1195
1200
  className: "text-xs text-muted-foreground",
1196
1201
  children: e.addLocalKeyHint
1197
1202
  }),
1198
- a.auth === "local" ? null : a.auth === "key" ? /* @__PURE__ */ D(T, {
1203
+ o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ E(T, {
1199
1204
  name: "privateKey",
1200
1205
  label: e.addKey,
1201
1206
  placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----",
1202
- onChange: h("privateKey")
1203
- }) : /* @__PURE__ */ D(x, {
1207
+ onChange: g("privateKey")
1208
+ }) : /* @__PURE__ */ E(x, {
1204
1209
  name: "password",
1205
1210
  label: e.addPassword,
1206
1211
  autoComplete: "off",
1207
- onChange: h("password")
1212
+ onChange: g("password")
1208
1213
  })
1209
1214
  ]
1210
1215
  }),
1211
- /* @__PURE__ */ D("p", {
1216
+ /* @__PURE__ */ E("p", {
1212
1217
  className: "text-xs text-muted-foreground",
1213
1218
  children: e.addCredentialsNote
1214
1219
  }),
1215
- f && /* @__PURE__ */ D("div", {
1220
+ m && /* @__PURE__ */ E("div", {
1216
1221
  className: "flex flex-wrap gap-1",
1217
- children: q.map((e) => /* @__PURE__ */ D(p, {
1218
- variant: l === e ? "primary" : q.indexOf(e) < q.indexOf(l ?? "check") ? "success" : "light",
1222
+ children: X.map((e) => /* @__PURE__ */ E(p, {
1223
+ variant: d === e ? "primary" : X.indexOf(e) < X.indexOf(d ?? "check") ? "success" : "light",
1219
1224
  children: e
1220
1225
  }, e))
1221
1226
  }),
1222
- s.length > 0 && /* @__PURE__ */ D("pre", {
1227
+ c.length > 0 && /* @__PURE__ */ E("pre", {
1223
1228
  className: "max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs",
1224
- children: s.slice(-200).join("\n")
1229
+ children: c.slice(-200).join("\n")
1225
1230
  }),
1226
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(v, {
1227
- label: f ? e.addInstalling : e.addInstall,
1228
- variant: "primary",
1229
- disabled: !g || f,
1230
- onClick: async () => {
1231
- m(!0), c([]);
1232
- try {
1233
- await r(await n(a.domain.trim().toLowerCase(), {
1234
- host: a.host.trim(),
1235
- port: Number(a.port) || 22,
1236
- username: a.username.trim(),
1237
- ...a.auth === "key" ? { privateKey: a.privateKey } : a.auth === "password" ? { password: a.password } : {}
1238
- }, ({ line: e, phase: t }) => {
1239
- t && d(t), /^[A-Z_]+=/.test(e) || c((t) => [...t, e]);
1240
- }));
1241
- } catch (e) {
1242
- i(e);
1243
- } finally {
1244
- m(!1);
1231
+ /* @__PURE__ */ E(H, {
1232
+ target: t,
1233
+ children: /* @__PURE__ */ E(v, {
1234
+ label: m ? e.addInstalling : e.addInstall,
1235
+ variant: "primary",
1236
+ disabled: !y || m,
1237
+ onClick: async () => {
1238
+ h(!0), l([]);
1239
+ try {
1240
+ await i(await r(o.domain.trim().toLowerCase(), {
1241
+ host: o.host.trim(),
1242
+ port: Number(o.port) || 22,
1243
+ username: o.username.trim(),
1244
+ ...o.auth === "key" ? { privateKey: o.privateKey } : o.auth === "password" ? { password: o.password } : {}
1245
+ }, ({ line: e, phase: t }) => {
1246
+ t && f(t), /^[A-Z_]+=/.test(e) || l((t) => [...t, e]);
1247
+ }));
1248
+ } catch (e) {
1249
+ a(e);
1250
+ } finally {
1251
+ h(!1);
1252
+ }
1245
1253
  }
1246
- }
1247
- }) })
1254
+ })
1255
+ })
1248
1256
  ]
1249
1257
  });
1250
1258
  }
1251
1259
  // src/ui/RunnerConsole.tsx
1252
- var Y = (e) => (e / 1024 ** 3).toFixed(1), X = (e) => new Date(e).toLocaleString(void 0, {
1260
+ var Z = (e) => (e / 1024 ** 3).toFixed(1), Q = (e) => new Date(e).toLocaleString(void 0, {
1253
1261
  dateStyle: "short",
1254
1262
  timeStyle: "short"
1255
1263
  });
1256
- function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1264
+ function te({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1257
1265
  let o = M(n, r), [l, p] = u(null), [y, b] = u(null), [x, S] = u(null), [w, T] = u({
1258
1266
  id: "",
1259
1267
  name: ""
1260
- }), [E, k] = u(null), A = s(async () => {
1268
+ }), [O, k] = u(null), A = s(async () => {
1261
1269
  try {
1262
1270
  p(await t.platform.status()), b(null);
1263
1271
  } catch (t) {
@@ -1266,36 +1274,36 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1266
1274
  }, [t, o]);
1267
1275
  return c(() => {
1268
1276
  A();
1269
- }, [A]), /* @__PURE__ */ O("div", {
1277
+ }, [A]), /* @__PURE__ */ D("div", {
1270
1278
  className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
1271
1279
  children: [
1272
- /* @__PURE__ */ O("div", {
1280
+ /* @__PURE__ */ D("div", {
1273
1281
  className: "flex items-center gap-2",
1274
- children: [/* @__PURE__ */ D("h1", {
1282
+ children: [/* @__PURE__ */ E("h1", {
1275
1283
  className: "flex-1 text-xl font-semibold",
1276
1284
  children: o.consoleTitle
1277
- }), i && /* @__PURE__ */ D(d, {
1285
+ }), i && /* @__PURE__ */ E(d, {
1278
1286
  icon: "log-out",
1279
1287
  label: o.consoleSignOut,
1280
1288
  variant: "outline-secondary",
1281
1289
  onClick: i
1282
1290
  })]
1283
1291
  }),
1284
- y && /* @__PURE__ */ D(f, {
1292
+ y && /* @__PURE__ */ E(f, {
1285
1293
  variant: "danger",
1286
1294
  children: y
1287
1295
  }),
1288
- /* @__PURE__ */ D(ee, {
1296
+ /* @__PURE__ */ E(re, {
1289
1297
  client: t,
1290
1298
  t: o,
1291
1299
  approve: a,
1292
1300
  onAnswered: A
1293
1301
  }),
1294
- /* @__PURE__ */ D(m, {
1302
+ /* @__PURE__ */ E(m, {
1295
1303
  title: o.consoleStatus,
1296
1304
  loading: !l && !y,
1297
1305
  loaderMinHeight: 100,
1298
- children: l && /* @__PURE__ */ D(g, { items: [
1306
+ children: l && /* @__PURE__ */ E(g, { items: [
1299
1307
  {
1300
1308
  label: "Version",
1301
1309
  value: l.version
@@ -1311,8 +1319,8 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1311
1319
  {
1312
1320
  label: "Machine",
1313
1321
  value: N(o.consoleMachine, {
1314
- memory: Y(l.machine.availableBytes),
1315
- total: Y(l.machine.totalBytes),
1322
+ memory: Z(l.machine.availableBytes),
1323
+ total: Z(l.machine.totalBytes),
1316
1324
  cpus: l.machine.cpus
1317
1325
  })
1318
1326
  },
@@ -1322,27 +1330,27 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1322
1330
  }
1323
1331
  ] })
1324
1332
  }),
1325
- /* @__PURE__ */ D(m, {
1333
+ /* @__PURE__ */ E(m, {
1326
1334
  title: o.consolePairing,
1327
- children: /* @__PURE__ */ O("div", {
1335
+ children: /* @__PURE__ */ D("div", {
1328
1336
  className: "flex flex-col gap-2",
1329
1337
  children: [
1330
- /* @__PURE__ */ D("p", {
1338
+ /* @__PURE__ */ E("p", {
1331
1339
  className: "text-sm text-muted-foreground",
1332
1340
  children: o.consolePairingHint
1333
1341
  }),
1334
- x && /* @__PURE__ */ D(h, {
1342
+ x && /* @__PURE__ */ E(h, {
1335
1343
  showCopy: !0,
1336
1344
  children: x.code
1337
1345
  }),
1338
- x && /* @__PURE__ */ D("p", {
1346
+ x && /* @__PURE__ */ E("p", {
1339
1347
  className: "text-xs text-muted-foreground",
1340
1348
  children: N(o.consoleCode, {
1341
1349
  code: x.code,
1342
- at: X(x.expiresAt)
1350
+ at: Q(x.expiresAt)
1343
1351
  })
1344
1352
  }),
1345
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(v, {
1353
+ /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(v, {
1346
1354
  label: o.consoleNewCode,
1347
1355
  variant: "outline-primary",
1348
1356
  onClick: async () => S(await t.createPairing())
@@ -1350,20 +1358,20 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1350
1358
  ]
1351
1359
  })
1352
1360
  }),
1353
- /* @__PURE__ */ D(m, {
1361
+ /* @__PURE__ */ E(m, {
1354
1362
  title: o.consoleTenants,
1355
- children: /* @__PURE__ */ O("div", {
1363
+ children: /* @__PURE__ */ D("div", {
1356
1364
  className: "flex flex-col gap-3",
1357
1365
  children: [
1358
- E && /* @__PURE__ */ D(f, {
1366
+ O && /* @__PURE__ */ E(f, {
1359
1367
  variant: "warning",
1360
1368
  onClose: () => k(null),
1361
- children: /* @__PURE__ */ D("span", {
1369
+ children: /* @__PURE__ */ E("span", {
1362
1370
  className: "break-all",
1363
- children: N(o.consoleKeyShown, { key: E })
1371
+ children: N(o.consoleKeyShown, { key: O })
1364
1372
  })
1365
1373
  }),
1366
- l?.tenants.map((e) => /* @__PURE__ */ D(Q, {
1374
+ l?.tenants.map((e) => /* @__PURE__ */ E(ne, {
1367
1375
  client: t,
1368
1376
  tenant: e,
1369
1377
  t: o,
@@ -1371,14 +1379,14 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1371
1379
  onKey: k,
1372
1380
  onChange: A
1373
1381
  }, e.id)),
1374
- /* @__PURE__ */ D(_, {
1382
+ /* @__PURE__ */ E(_, {
1375
1383
  appearance: "empty",
1376
1384
  showNotice: !1,
1377
1385
  onSubmit: () => !1,
1378
- children: /* @__PURE__ */ O("div", {
1386
+ children: /* @__PURE__ */ D("div", {
1379
1387
  className: "grid gap-2 sm:grid-cols-[1fr_1fr_auto] sm:items-end",
1380
1388
  children: [
1381
- /* @__PURE__ */ D(C, {
1389
+ /* @__PURE__ */ E(C, {
1382
1390
  name: "tenantId",
1383
1391
  label: o.consoleTenantId,
1384
1392
  placeholder: "acme",
@@ -1387,7 +1395,7 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1387
1395
  id: String(e ?? "")
1388
1396
  }))
1389
1397
  }),
1390
- /* @__PURE__ */ D(C, {
1398
+ /* @__PURE__ */ E(C, {
1391
1399
  name: "tenantName",
1392
1400
  label: o.consoleTenantName,
1393
1401
  placeholder: "Acme",
@@ -1396,7 +1404,7 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1396
1404
  name: String(e ?? "")
1397
1405
  }))
1398
1406
  }),
1399
- /* @__PURE__ */ D(v, {
1407
+ /* @__PURE__ */ E(v, {
1400
1408
  label: o.consoleCreate,
1401
1409
  variant: "primary",
1402
1410
  disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(w.id),
@@ -1418,24 +1426,24 @@ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1418
1426
  ]
1419
1427
  });
1420
1428
  }
1421
- function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1429
+ function ne({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1422
1430
  let [o, f] = u(!1), [m, h] = u(null), [g, _] = u(!1), y = l(() => e.as({ tenant: t.id }), [e, t.id]), x = s(async () => h(await e.platform.keys(t.id)), [e, t.id]);
1423
1431
  return c(() => {
1424
1432
  o && x();
1425
- }, [o, x]), /* @__PURE__ */ O("div", {
1433
+ }, [o, x]), /* @__PURE__ */ D("div", {
1426
1434
  className: "rounded-md border border-border p-3",
1427
1435
  children: [
1428
- /* @__PURE__ */ O("div", {
1436
+ /* @__PURE__ */ D("div", {
1429
1437
  className: "flex flex-wrap items-center gap-2",
1430
1438
  children: [
1431
- /* @__PURE__ */ O("button", {
1439
+ /* @__PURE__ */ D("button", {
1432
1440
  type: "button",
1433
1441
  className: "flex-1 text-left font-medium",
1434
1442
  onClick: () => f((e) => !e),
1435
1443
  children: [
1436
1444
  t.name,
1437
1445
  " ",
1438
- /* @__PURE__ */ O("span", {
1446
+ /* @__PURE__ */ D("span", {
1439
1447
  className: "text-xs text-muted-foreground",
1440
1448
  children: [
1441
1449
  "(",
@@ -1445,11 +1453,11 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1445
1453
  })
1446
1454
  ]
1447
1455
  }),
1448
- t.usersWithAccounts !== void 0 && /* @__PURE__ */ O(p, {
1456
+ t.usersWithAccounts !== void 0 && /* @__PURE__ */ D(p, {
1449
1457
  variant: "light",
1450
1458
  children: [t.usersWithAccounts, " 👤"]
1451
1459
  }),
1452
- /* @__PURE__ */ D(d, {
1460
+ /* @__PURE__ */ E(d, {
1453
1461
  icon: "trash",
1454
1462
  label: n.consoleRemoveTenant,
1455
1463
  variant: "outline-danger",
@@ -1457,25 +1465,25 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1457
1465
  })
1458
1466
  ]
1459
1467
  }),
1460
- o && /* @__PURE__ */ O("div", {
1468
+ o && /* @__PURE__ */ D("div", {
1461
1469
  className: "mt-3 flex flex-col gap-3",
1462
1470
  children: [
1463
- /* @__PURE__ */ D("h4", {
1471
+ /* @__PURE__ */ E("h4", {
1464
1472
  className: "text-sm font-semibold",
1465
1473
  children: n.consoleKeys
1466
1474
  }),
1467
- m?.map((r) => /* @__PURE__ */ O("div", {
1475
+ m?.map((r) => /* @__PURE__ */ D("div", {
1468
1476
  className: "flex flex-wrap items-center gap-2 text-sm",
1469
1477
  children: [
1470
- /* @__PURE__ */ D("span", {
1478
+ /* @__PURE__ */ E("span", {
1471
1479
  className: "flex-1",
1472
1480
  children: r.name
1473
1481
  }),
1474
- r.permissions.map((e) => /* @__PURE__ */ D(p, {
1482
+ r.permissions.map((e) => /* @__PURE__ */ E(p, {
1475
1483
  variant: "info",
1476
1484
  children: e
1477
1485
  }, e)),
1478
- /* @__PURE__ */ D(d, {
1486
+ /* @__PURE__ */ E(d, {
1479
1487
  label: n.consoleRevoke,
1480
1488
  variant: "outline-danger",
1481
1489
  onClick: async () => {
@@ -1484,7 +1492,7 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1484
1492
  })
1485
1493
  ]
1486
1494
  }, r.id)),
1487
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(v, {
1495
+ /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(v, {
1488
1496
  label: n.consoleNewKey,
1489
1497
  variant: "outline-secondary",
1490
1498
  onClick: async () => {
@@ -1500,11 +1508,11 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1500
1508
  })).key), await x();
1501
1509
  }
1502
1510
  }) }),
1503
- /* @__PURE__ */ D("h4", {
1511
+ /* @__PURE__ */ E("h4", {
1504
1512
  className: "text-sm font-semibold",
1505
1513
  children: n.consoleAccounts
1506
1514
  }),
1507
- /* @__PURE__ */ D(I, {
1515
+ /* @__PURE__ */ E(I, {
1508
1516
  client: y,
1509
1517
  scope: "tenant",
1510
1518
  locale: r,
@@ -1512,7 +1520,7 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1512
1520
  })
1513
1521
  ]
1514
1522
  }),
1515
- g && /* @__PURE__ */ D(b, {
1523
+ g && /* @__PURE__ */ E(b, {
1516
1524
  title: n.consoleRemoveTenant,
1517
1525
  danger: !0,
1518
1526
  onClose: () => _(!1),
@@ -1523,7 +1531,7 @@ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1523
1531
  });
1524
1532
  }
1525
1533
  var $ = (e) => e.toUpperCase().replace(/[^A-Z0-9]/g, "");
1526
- function ee({ client: e, t, approve: n, onAnswered: r }) {
1534
+ function re({ client: e, t, approve: n, onAnswered: r }) {
1527
1535
  let [i, a] = u(null), [o, l] = u(null), d = s(async () => {
1528
1536
  try {
1529
1537
  let t = await e.pairingRequests(), r = n ? $(n) : "";
@@ -1536,22 +1544,22 @@ function ee({ client: e, t, approve: n, onAnswered: r }) {
1536
1544
  d();
1537
1545
  let e = setInterval(() => void d(), 5e3);
1538
1546
  return () => clearInterval(e);
1539
- }, [d]), !n && !i?.length && !o ? null : /* @__PURE__ */ D(m, {
1547
+ }, [d]), !n && !i?.length && !o ? null : /* @__PURE__ */ E(m, {
1540
1548
  title: t.consoleRequests,
1541
1549
  loading: i === null,
1542
1550
  loaderMinHeight: 80,
1543
- children: /* @__PURE__ */ O("div", {
1551
+ children: /* @__PURE__ */ D("div", {
1544
1552
  className: "flex flex-col gap-3",
1545
1553
  children: [
1546
- /* @__PURE__ */ D("p", {
1554
+ /* @__PURE__ */ E("p", {
1547
1555
  className: "text-sm text-muted-foreground",
1548
1556
  children: t.consoleRequestsHint
1549
1557
  }),
1550
- o && /* @__PURE__ */ D(f, {
1558
+ o && /* @__PURE__ */ E(f, {
1551
1559
  variant: o.variant,
1552
1560
  children: o.text
1553
1561
  }),
1554
- i?.length === 0 && !o && /* @__PURE__ */ D("p", {
1562
+ i?.length === 0 && !o && /* @__PURE__ */ E("p", {
1555
1563
  className: "text-sm text-muted-foreground",
1556
1564
  children: t.consoleRequestsEmpty
1557
1565
  }),
@@ -1566,32 +1574,32 @@ function ee({ client: e, t, approve: n, onAnswered: r }) {
1566
1574
  text: t.consoleDenied
1567
1575
  }), await d(), await r();
1568
1576
  };
1569
- return /* @__PURE__ */ O("div", {
1577
+ return /* @__PURE__ */ D("div", {
1570
1578
  className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
1571
1579
  children: [
1572
- a && /* @__PURE__ */ D(p, {
1580
+ a && /* @__PURE__ */ E(p, {
1573
1581
  variant: "primary",
1574
1582
  children: t.consoleRequestMatch
1575
1583
  }),
1576
- /* @__PURE__ */ D("div", {
1584
+ /* @__PURE__ */ E("div", {
1577
1585
  className: "font-mono text-2xl font-semibold tracking-widest",
1578
1586
  children: i.code
1579
1587
  }),
1580
- /* @__PURE__ */ D("p", {
1588
+ /* @__PURE__ */ E("p", {
1581
1589
  className: "text-sm",
1582
1590
  children: N(t.consoleRequestFrom, {
1583
1591
  name: i.name,
1584
1592
  from: i.from ?? "?",
1585
- at: X(i.createdAt)
1593
+ at: Q(i.createdAt)
1586
1594
  })
1587
1595
  }),
1588
- /* @__PURE__ */ O("div", {
1596
+ /* @__PURE__ */ D("div", {
1589
1597
  className: "flex flex-wrap gap-2",
1590
- children: [/* @__PURE__ */ D(v, {
1598
+ children: [/* @__PURE__ */ E(v, {
1591
1599
  label: t.consoleApprove,
1592
1600
  variant: "primary",
1593
1601
  onClick: () => o(!0)
1594
- }), /* @__PURE__ */ D(v, {
1602
+ }), /* @__PURE__ */ E(v, {
1595
1603
  label: t.consoleDeny,
1596
1604
  variant: "outline-danger",
1597
1605
  onClick: () => o(!1)
@@ -1604,6 +1612,6 @@ function ee({ client: e, t, approve: n, onAnswered: r }) {
1604
1612
  })
1605
1613
  });
1606
1614
  }
1607
- export { H as AddRunner, B as InstallGuide, I as RunnerAccounts, Z as RunnerConsole, V as RunnersSettings, N as fill, j as runnerTexts, M as textsFor };
1615
+ export { W as AddRunner, B as InstallGuide, I as RunnerAccounts, te as RunnerConsole, V as RunnersSettings, N as fill, j as runnerTexts, M as textsFor };
1608
1616
 
1609
1617
  //# sourceMappingURL=ui.mjs.map