@llmnative/runner 1.1.2 → 1.2.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
- import { RunnerError as e } from "./client.mjs";
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
- import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
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 { jsx as E, jsxs as D } from "react/jsx-runtime";
6
- import { createPortal as O } from "react-dom";
1
+ import { RUNNER_KEY_PROVIDERS as e, RunnerError as t } from "./client.mjs";
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
+ 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";
7
7
  // src/ui/texts.ts
8
- var k = {
8
+ var A = {
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.",
@@ -28,6 +28,9 @@ var k = {
28
28
  opencodeConnect: "Add OpenCode Go",
29
29
  opencodeKey: "API key of OpenCode Go",
30
30
  opencodeAdd: "Add",
31
+ keyConnect: "Add a key",
32
+ keyProvider: "Provider",
33
+ keyLabel: "API key of {provider}",
31
34
  termsNote: "A Pro or Max subscription is personal: connect only your own.",
32
35
  guideTitle: "Install a runner by hand",
33
36
  guideServerTitle: "1. A VPS",
@@ -131,6 +134,15 @@ var k = {
131
134
  consoleRequestsHint: "A platform asked to connect to this runner. Approve only if you asked from there and the code is the one it shows.",
132
135
  consoleRequestsEmpty: "No requests waiting.",
133
136
  consoleRequestFrom: "{name}, from {from}, asked at {at}",
137
+ consoleRequestProject: "For the project «{project}»: it will see only its tenants ({project}, {project}-…).",
138
+ consoleRequestAll: "Without a project: it will see every tenant of this runner.",
139
+ consolePlatforms: "Connected platforms",
140
+ consolePlatformsHint: "Who connected this runner. A platform of a project sees only the tenants of its project; one without a project (connected before 1.2) sees them all: give it its project.",
141
+ consolePlatformsEmpty: "No platform connected.",
142
+ consolePlatformAll: "every tenant",
143
+ consolePlatformProject: "Project",
144
+ consolePlatformSave: "Save",
145
+ consolePlatformRevokeConfirm: "Disconnect {name}? It will no longer reach this runner.",
134
146
  consoleRequestMatch: "The request you opened",
135
147
  consoleApprove: "Approve",
136
148
  consoleDeny: "Refuse",
@@ -139,7 +151,7 @@ var k = {
139
151
  consoleRemember: "Remember on this browser",
140
152
  close: "Close",
141
153
  cancel: "Cancel"
142
- }, A = {
154
+ }, j = {
143
155
  accountsTitleUser: "I miei abbonamenti",
144
156
  accountsTitleTenant: "Abbonamenti del tenant",
145
157
  accountsIntroUser: "Collega il tuo abbonamento: lo usano solo le tue richieste. Senza, si usano le API key del workspace.",
@@ -162,6 +174,9 @@ var k = {
162
174
  opencodeConnect: "Aggiungi OpenCode Go",
163
175
  opencodeKey: "API key di OpenCode Go",
164
176
  opencodeAdd: "Aggiungi",
177
+ keyConnect: "Aggiungi una chiave",
178
+ keyProvider: "Provider",
179
+ keyLabel: "API key di {provider}",
165
180
  termsNote: "Un abbonamento Pro o Max è personale: collega solo il tuo.",
166
181
  guideTitle: "Installa un runner a mano",
167
182
  guideServerTitle: "1. Una VPS",
@@ -265,6 +280,15 @@ var k = {
265
280
  consoleRequestsHint: "Una piattaforma ha chiesto di collegarsi a questo runner. Approva solo se l'hai chiesto tu da lì e il codice è quello che mostra.",
266
281
  consoleRequestsEmpty: "Nessuna richiesta in attesa.",
267
282
  consoleRequestFrom: "{name}, da {from}, alle {at}",
283
+ consoleRequestProject: "Per il progetto «{project}»: vedrà solo i suoi tenant ({project}, {project}-…).",
284
+ consoleRequestAll: "Senza progetto: vedrà tutti i tenant di questo runner.",
285
+ consolePlatforms: "Piattaforme collegate",
286
+ consolePlatformsHint: "Chi ha collegato questo runner. Una piattaforma di un progetto vede solo i tenant del suo progetto; una senza progetto (collegata prima della 1.2) li vede tutti: assegnale il suo progetto.",
287
+ consolePlatformsEmpty: "Nessuna piattaforma collegata.",
288
+ consolePlatformAll: "tutti i tenant",
289
+ consolePlatformProject: "Progetto",
290
+ consolePlatformSave: "Salva",
291
+ consolePlatformRevokeConfirm: "Scollegare {name}? Non raggiungerà più questo runner.",
268
292
  consoleRequestMatch: "La richiesta che hai aperto",
269
293
  consoleApprove: "Approva",
270
294
  consoleDeny: "Rifiuta",
@@ -273,191 +297,202 @@ var k = {
273
297
  consoleRemember: "Ricorda su questo browser",
274
298
  close: "Chiudi",
275
299
  cancel: "Annulla"
276
- }, j = {
277
- en: k,
278
- it: A
300
+ }, M = {
301
+ en: A,
302
+ it: j
279
303
  };
280
- function M(e, t) {
281
- let n = e && e.toLowerCase().startsWith("it") ? A : k;
304
+ function N(e, t) {
305
+ let n = e && e.toLowerCase().startsWith("it") ? j : A;
282
306
  return t ? {
283
307
  ...n,
284
308
  ...t
285
309
  } : n;
286
310
  }
287
- var N = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), P = {
311
+ var P = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), F = {
288
312
  "claude-code": "Claude Code",
289
313
  "opencode-go": "OpenCode Go",
290
- opencode: "OpenCode Zen"
291
- }, F = (e) => new Date(e).toLocaleString(void 0, {
314
+ opencode: "OpenCode Zen",
315
+ anthropic: "Anthropic",
316
+ openai: "OpenAI",
317
+ gemini: "Gemini",
318
+ mistral: "Mistral",
319
+ deepseek: "DeepSeek",
320
+ openrouter: "OpenRouter"
321
+ }, I = ["claude-code", "opencode-go"], L = (e) => new Date(e).toLocaleString(void 0, {
292
322
  dateStyle: "medium",
293
323
  timeStyle: "short"
294
324
  });
295
- function I({ client: t, scope: n, locale: r, texts: i, onChange: a }) {
296
- let o = M(r, i), [l, h] = u(null), [g, _] = u(null), [v, y] = u(null), [x, S] = u(null), C = s(async () => {
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,
328
+ "opencode",
329
+ ...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 () => {
297
331
  try {
298
- let { accounts: e } = await t.accounts.list();
299
- return h(e), _(null), e;
300
- } catch (t) {
301
- return _(t instanceof e ? t.code : String(t)), h([]), [];
332
+ let { accounts: e } = await n.accounts.list();
333
+ return y(e), S(null), e;
334
+ } catch (e) {
335
+ return S(e instanceof t ? e.code : String(e)), y([]), [];
302
336
  }
303
- }, [t]);
304
- c(() => {
305
- C();
306
- }, [C]);
307
- let w = async () => {
308
- y(null);
309
- let e = await C();
310
- a?.(e);
337
+ }, [n]);
338
+ l(() => {
339
+ k();
340
+ }, [k]);
341
+ let A = async () => {
342
+ w(null);
343
+ let e = await k();
344
+ o?.(e);
311
345
  };
312
- return /* @__PURE__ */ D(m, {
313
- title: n === "user" ? o.accountsTitleUser : o.accountsTitleTenant,
314
- loading: l === null,
346
+ return /* @__PURE__ */ O(h, {
347
+ title: r === "user" ? u.accountsTitleUser : u.accountsTitleTenant,
348
+ loading: v === null,
315
349
  loaderMinHeight: 120,
316
- children: [/* @__PURE__ */ D("div", {
350
+ children: [/* @__PURE__ */ O("div", {
317
351
  className: "flex flex-col gap-3",
318
352
  children: [
319
- /* @__PURE__ */ E("p", {
353
+ /* @__PURE__ */ D("p", {
320
354
  className: "text-sm text-muted-foreground",
321
- children: n === "user" ? o.accountsIntroUser : o.accountsIntroTenant
355
+ children: r === "user" ? u.accountsIntroUser : u.accountsIntroTenant
322
356
  }),
323
- g && /* @__PURE__ */ E(f, {
357
+ b && /* @__PURE__ */ D(p, {
324
358
  variant: "danger",
325
- children: N(o.error, { error: g })
359
+ children: P(u.error, { error: b })
326
360
  }),
327
- l?.length === 0 && !g && /* @__PURE__ */ E("p", {
361
+ v?.length === 0 && !b && /* @__PURE__ */ D("p", {
328
362
  className: "text-sm text-muted-foreground",
329
- children: o.accountsEmpty
363
+ children: u.accountsEmpty
330
364
  }),
331
- l?.map((e) => /* @__PURE__ */ D("div", {
365
+ v?.map((e) => /* @__PURE__ */ O("div", {
332
366
  className: "flex flex-wrap items-center gap-2 rounded-md border border-border p-3",
333
- children: [/* @__PURE__ */ D("div", {
367
+ children: [/* @__PURE__ */ O("div", {
334
368
  className: "min-w-0 flex-1",
335
- children: [/* @__PURE__ */ D("div", {
369
+ children: [/* @__PURE__ */ O("div", {
336
370
  className: "flex flex-wrap items-center gap-2",
337
371
  children: [
338
- /* @__PURE__ */ E("span", {
372
+ /* @__PURE__ */ D("span", {
339
373
  className: "font-medium",
340
- children: e.label ?? P[e.provider] ?? e.provider
374
+ children: e.label ?? F[e.provider] ?? e.provider
341
375
  }),
342
- /* @__PURE__ */ E(p, {
376
+ /* @__PURE__ */ D(m, {
343
377
  variant: "secondary",
344
- children: P[e.provider] ?? e.provider
378
+ children: F[e.provider] ?? e.provider
345
379
  }),
346
- e.noCreditUntil && /* @__PURE__ */ E(p, {
380
+ e.noCreditUntil && /* @__PURE__ */ D(m, {
347
381
  variant: "warning",
348
- children: N(o.accountsNoCredit, { at: F(e.noCreditUntil) })
382
+ children: P(u.accountsNoCredit, { at: L(e.noCreditUntil) })
349
383
  })
350
384
  ]
351
- }), /* @__PURE__ */ E("p", {
385
+ }), /* @__PURE__ */ D("p", {
352
386
  className: "text-xs text-muted-foreground",
353
- children: N(o.accountsConnected, { at: F(e.at) })
387
+ children: P(u.accountsConnected, { at: L(e.at) })
354
388
  })]
355
- }), /* @__PURE__ */ E(d, {
389
+ }), /* @__PURE__ */ D(f, {
356
390
  icon: "unlink",
357
- label: o.accountsRemove,
391
+ label: u.accountsRemove,
358
392
  variant: "outline-danger",
359
- onClick: () => S(e)
393
+ onClick: () => E(e)
360
394
  })]
361
395
  }, `${e.provider}/${e.id}`)),
362
- v === "claude" && /* @__PURE__ */ E(L, {
363
- client: t,
364
- t: o,
365
- onDone: w,
366
- onCancel: () => y(null)
396
+ C === "claude" && /* @__PURE__ */ D(z, {
397
+ client: n,
398
+ t: u,
399
+ onDone: A,
400
+ onCancel: () => w(null)
367
401
  }),
368
- v === "opencode" && /* @__PURE__ */ E(R, {
369
- client: t,
370
- t: o,
371
- onDone: w,
372
- onCancel: () => y(null)
402
+ C === "key" && /* @__PURE__ */ D(B, {
403
+ client: n,
404
+ t: u,
405
+ providers: _,
406
+ onDone: A,
407
+ onCancel: () => w(null)
373
408
  }),
374
- !v && /* @__PURE__ */ D("div", {
409
+ !C && /* @__PURE__ */ O("div", {
375
410
  className: "flex flex-wrap gap-2",
376
- children: [/* @__PURE__ */ E(d, {
411
+ children: [g.includes("claude-code") && /* @__PURE__ */ D(f, {
377
412
  icon: "plus",
378
- label: o.claudeConnect,
413
+ label: u.claudeConnect,
379
414
  variant: "primary",
380
- onClick: () => y("claude")
381
- }), /* @__PURE__ */ E(d, {
415
+ onClick: () => w("claude")
416
+ }), _.length > 0 && /* @__PURE__ */ D(f, {
382
417
  icon: "plus",
383
- label: o.opencodeConnect,
418
+ label: _.length === 1 && _[0] === "opencode-go" ? u.opencodeConnect : u.keyConnect,
384
419
  variant: "outline-secondary",
385
- onClick: () => y("opencode")
420
+ onClick: () => w("key")
386
421
  })]
387
422
  }),
388
- /* @__PURE__ */ E("p", {
423
+ /* @__PURE__ */ D("p", {
389
424
  className: "text-xs text-muted-foreground",
390
- children: o.termsNote
425
+ children: u.termsNote
391
426
  })
392
427
  ]
393
- }), x && /* @__PURE__ */ E(b, {
394
- title: o.accountsRemove,
428
+ }), T && /* @__PURE__ */ D(x, {
429
+ title: u.accountsRemove,
395
430
  danger: !0,
396
- onClose: () => S(null),
397
- onYes: async () => (await t.accounts.remove(x.provider, x.id).catch(() => !1), S(null), await w(), !0),
398
- children: N(o.accountsRemoveConfirm, { name: x.label ?? P[x.provider] ?? x.provider })
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 })
399
434
  })]
400
435
  });
401
436
  }
402
- function L({ client: t, t: n, onDone: r, onCancel: i }) {
403
- let [a, o] = u(null), [s, l] = u(""), [p, m] = u(""), [h, g] = u(null);
404
- return c(() => {
405
- let e = !1;
406
- return t.accounts.startClaudeLogin().then(({ url: t }) => !e && o(t)).catch(() => !e && g(n.claudeNoLink)), () => {
407
- e = !0;
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);
439
+ return l(() => {
440
+ let t = !1;
441
+ return e.accounts.startClaudeLogin().then(({ url: e }) => !t && o(e)).catch(() => !t && g(n.claudeNoLink)), () => {
442
+ t = !0;
408
443
  };
409
- }, [t, n]), /* @__PURE__ */ D("div", {
444
+ }, [e, n]), /* @__PURE__ */ O("div", {
410
445
  className: "flex flex-col gap-3 rounded-md border border-border p-3",
411
446
  children: [
412
- h && /* @__PURE__ */ E(f, {
447
+ h && /* @__PURE__ */ D(p, {
413
448
  variant: "danger",
414
449
  children: h
415
450
  }),
416
- /* @__PURE__ */ E("p", {
451
+ /* @__PURE__ */ D("p", {
417
452
  className: "text-sm",
418
453
  children: n.claudeStep1
419
454
  }),
420
- /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
455
+ /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
421
456
  icon: "external-link",
422
457
  label: n.claudeOpen,
423
458
  variant: "primary",
424
459
  disabled: !a,
425
460
  onClick: () => a && window.open(a, "_blank", "noopener,noreferrer")
426
461
  }) }),
427
- /* @__PURE__ */ E("p", {
462
+ /* @__PURE__ */ D("p", {
428
463
  className: "text-sm",
429
464
  children: n.claudeStep2
430
465
  }),
431
- /* @__PURE__ */ D(_, {
466
+ /* @__PURE__ */ O(v, {
432
467
  appearance: "empty",
433
468
  showNotice: !1,
434
469
  onSubmit: () => !1,
435
- children: [/* @__PURE__ */ E(C, {
470
+ children: [/* @__PURE__ */ D(w, {
436
471
  name: "code",
437
472
  label: n.claudeCode,
438
473
  autoComplete: "off",
439
- onChange: ({ value: e }) => l(String(e ?? ""))
440
- }), /* @__PURE__ */ E(C, {
474
+ onChange: ({ value: e }) => c(String(e ?? ""))
475
+ }), /* @__PURE__ */ D(w, {
441
476
  name: "label",
442
477
  label: n.claudeLabel,
443
478
  placeholder: n.claudeLabelPlaceholder,
444
479
  onChange: ({ value: e }) => m(String(e ?? ""))
445
480
  })]
446
481
  }),
447
- /* @__PURE__ */ D("div", {
482
+ /* @__PURE__ */ O("div", {
448
483
  className: "flex gap-2",
449
- children: [/* @__PURE__ */ E(v, {
484
+ children: [/* @__PURE__ */ D(y, {
450
485
  label: n.claudeFinish,
451
486
  variant: "primary",
452
487
  disabled: !a || !s.trim(),
453
488
  onClick: async () => {
454
489
  try {
455
- await t.accounts.finishClaudeLogin(s.trim(), p.trim() || void 0), r();
456
- } catch (t) {
457
- g(t instanceof e && t.code === "refused" ? n.claudeRefused : N(n.error, { error: t instanceof e ? t.code : String(t) }));
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) }));
458
493
  }
459
494
  }
460
- }), /* @__PURE__ */ E(d, {
495
+ }), /* @__PURE__ */ D(f, {
461
496
  label: n.cancel,
462
497
  variant: "outline-secondary",
463
498
  onClick: i
@@ -466,75 +501,88 @@ function L({ client: t, t: n, onDone: r, onCancel: i }) {
466
501
  ]
467
502
  });
468
503
  }
469
- function R({ client: t, t: n, onDone: r, onCancel: i }) {
470
- let [a, o] = u(""), [s, c] = u(""), [l, p] = u(null);
471
- return /* @__PURE__ */ D("div", {
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", {
472
507
  className: "flex flex-col gap-3 rounded-md border border-border p-3",
473
508
  children: [
474
- l && /* @__PURE__ */ E(f, {
509
+ h && /* @__PURE__ */ D(p, {
475
510
  variant: "danger",
476
- children: l
511
+ children: h
477
512
  }),
478
- /* @__PURE__ */ D(_, {
513
+ /* @__PURE__ */ O(v, {
479
514
  appearance: "empty",
480
515
  showNotice: !1,
481
516
  onSubmit: () => !1,
482
- children: [/* @__PURE__ */ E(x, {
483
- name: "key",
484
- label: n.opencodeKey,
485
- autoComplete: "off",
486
- onChange: ({ value: e }) => o(String(e ?? ""))
487
- }), /* @__PURE__ */ E(C, {
488
- name: "label",
489
- label: n.claudeLabel,
490
- onChange: ({ value: e }) => c(String(e ?? ""))
491
- })]
517
+ children: [
518
+ r.length > 1 && /* @__PURE__ */ D(C, {
519
+ name: "provider",
520
+ label: n.keyProvider,
521
+ defaultValue: o,
522
+ options: r.map((e) => ({
523
+ label: F[e] ?? e,
524
+ value: e
525
+ })),
526
+ onChange: ({ value: e }) => s(String(e ?? r[0]))
527
+ }),
528
+ /* @__PURE__ */ D(S, {
529
+ name: "key",
530
+ label: P(n.keyLabel, { provider: F[o] ?? o }),
531
+ autoComplete: "off",
532
+ onChange: ({ value: e }) => l(String(e ?? ""))
533
+ }),
534
+ /* @__PURE__ */ D(w, {
535
+ name: "label",
536
+ label: n.claudeLabel,
537
+ onChange: ({ value: e }) => m(String(e ?? ""))
538
+ })
539
+ ]
492
540
  }),
493
- /* @__PURE__ */ D("div", {
541
+ /* @__PURE__ */ O("div", {
494
542
  className: "flex gap-2",
495
- children: [/* @__PURE__ */ E(v, {
543
+ children: [/* @__PURE__ */ D(y, {
496
544
  label: n.opencodeAdd,
497
545
  variant: "primary",
498
- disabled: !a.trim(),
546
+ disabled: !c.trim(),
499
547
  onClick: async () => {
500
548
  try {
501
- await t.accounts.addKey("opencode-go", a.trim(), s.trim() || void 0), r();
502
- } catch (t) {
503
- p(N(n.error, { error: t instanceof e ? t.code : String(t) }));
549
+ await e.accounts.addKey(o, c.trim(), u.trim() || void 0), i();
550
+ } catch (e) {
551
+ g(P(n.error, { error: e instanceof t ? e.code : String(e) }));
504
552
  }
505
553
  }
506
- }), /* @__PURE__ */ E(d, {
554
+ }), /* @__PURE__ */ D(f, {
507
555
  label: n.cancel,
508
556
  variant: "outline-secondary",
509
- onClick: i
557
+ onClick: a
510
558
  })]
511
559
  })
512
560
  ]
513
561
  });
514
562
  }
515
563
  // src/ui/InstallGuide.tsx
516
- function z({ title: e, children: t, done: n }) {
517
- return /* @__PURE__ */ D("section", {
564
+ function V({ title: e, children: t, done: n }) {
565
+ return /* @__PURE__ */ O("section", {
518
566
  className: "flex flex-col gap-2 border-l-2 border-border pl-4",
519
- children: [/* @__PURE__ */ D("h4", {
567
+ children: [/* @__PURE__ */ O("h4", {
520
568
  className: "flex items-center gap-2 text-sm font-semibold",
521
- children: [e, n && /* @__PURE__ */ E(p, {
569
+ children: [e, n && /* @__PURE__ */ D(m, {
522
570
  variant: "success",
523
571
  children: "✓"
524
572
  })]
525
573
  }), t]
526
574
  });
527
575
  }
528
- function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p = n, version: m }) {
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", {
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", {
531
579
  className: "flex flex-col gap-5",
532
580
  children: [
533
- /* @__PURE__ */ E(z, {
534
- title: g.guideServerTitle,
535
- children: /* @__PURE__ */ E("p", {
581
+ /* @__PURE__ */ D(V, {
582
+ title: h.guideServerTitle,
583
+ children: /* @__PURE__ */ D("p", {
536
584
  className: "text-sm",
537
- children: N(g.guideServer, {
585
+ children: P(h.guideServer, {
538
586
  systems: R.systems.join(", "),
539
587
  cpus: R.cpus,
540
588
  memory: R.memoryGb,
@@ -543,21 +591,21 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
543
591
  })
544
592
  })
545
593
  }),
546
- /* @__PURE__ */ D(z, {
547
- title: g.guideDnsTitle,
594
+ /* @__PURE__ */ O(V, {
595
+ title: h.guideDnsTitle,
548
596
  done: !!x?.ips.length,
549
597
  children: [
550
- /* @__PURE__ */ E("p", {
598
+ /* @__PURE__ */ D("p", {
551
599
  className: "text-sm",
552
- children: g.guideDns
600
+ children: h.guideDns
553
601
  }),
554
- /* @__PURE__ */ E(_, {
602
+ /* @__PURE__ */ D(v, {
555
603
  appearance: "empty",
556
604
  showNotice: !1,
557
605
  onSubmit: () => !1,
558
- children: /* @__PURE__ */ E(C, {
606
+ children: /* @__PURE__ */ D(w, {
559
607
  name: "domain",
560
- label: g.guideDomain,
608
+ label: h.guideDomain,
561
609
  placeholder: "runner.example.com",
562
610
  autoComplete: "off",
563
611
  onChange: ({ value: e }) => {
@@ -565,141 +613,141 @@ function B({ locale: e, texts: s, onPair: c, lookup: l = (e) => a(e), check: p =
565
613
  }
566
614
  })
567
615
  }),
568
- /* @__PURE__ */ D("div", {
616
+ /* @__PURE__ */ O("div", {
569
617
  className: "flex flex-wrap items-center gap-2",
570
- children: [/* @__PURE__ */ E(v, {
571
- label: g.guideCheckDns,
618
+ children: [/* @__PURE__ */ D(y, {
619
+ label: h.guideCheckDns,
572
620
  variant: "outline-secondary",
573
621
  disabled: !I,
574
- onClick: async () => S({ ips: await l(y.trim().toLowerCase()).catch(() => []) })
575
- }), x && (x.ips.length ? /* @__PURE__ */ E(f, {
622
+ onClick: async () => S({ ips: await l(_.trim().toLowerCase()).catch(() => []) })
623
+ }), x && (x.ips.length ? /* @__PURE__ */ D(p, {
576
624
  variant: "success",
577
625
  appearance: "text",
578
- children: N(g.guideDnsOk, { ips: x.ips.join(", ") })
579
- }) : /* @__PURE__ */ E(f, {
626
+ children: P(h.guideDnsOk, { ips: x.ips.join(", ") })
627
+ }) : /* @__PURE__ */ D(p, {
580
628
  variant: "warning",
581
629
  appearance: "text",
582
- children: g.guideDnsMissing
630
+ children: h.guideDnsMissing
583
631
  }))]
584
632
  })
585
633
  ]
586
634
  }),
587
- /* @__PURE__ */ E(z, {
588
- title: g.guideAccessTitle,
589
- children: /* @__PURE__ */ E("p", {
635
+ /* @__PURE__ */ D(V, {
636
+ title: h.guideAccessTitle,
637
+ children: /* @__PURE__ */ D("p", {
590
638
  className: "text-sm",
591
- children: g.guideAccess
639
+ children: h.guideAccess
592
640
  })
593
641
  }),
594
- /* @__PURE__ */ D(z, {
595
- title: g.guideInstallTitle,
642
+ /* @__PURE__ */ O(V, {
643
+ title: h.guideInstallTitle,
596
644
  children: [
597
- /* @__PURE__ */ E("p", {
645
+ /* @__PURE__ */ D("p", {
598
646
  className: "text-sm",
599
- children: g.guideInstall
647
+ children: h.guideInstall
600
648
  }),
601
- /* @__PURE__ */ E(h, {
649
+ /* @__PURE__ */ D(g, {
602
650
  language: "bash",
603
651
  showCopy: !0,
604
- children: r({
605
- domain: I ? y : "runner.example.com",
652
+ children: i({
653
+ domain: I ? _ : "runner.example.com",
606
654
  ...m ? { version: m } : {}
607
655
  })
608
656
  }),
609
- /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
610
- label: g.guideVerified,
657
+ /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
658
+ label: h.guideVerified,
611
659
  variant: "link",
612
660
  onClick: () => j((e) => !e)
613
661
  }) }),
614
- A && /* @__PURE__ */ E(h, {
662
+ A && /* @__PURE__ */ D(g, {
615
663
  language: "bash",
616
664
  showCopy: !0,
617
- children: o({
618
- domain: I ? y : "runner.example.com",
665
+ children: s({
666
+ domain: I ? _ : "runner.example.com",
619
667
  ...m ? { version: m } : {}
620
668
  }).join("\n")
621
669
  })
622
670
  ]
623
671
  }),
624
- /* @__PURE__ */ D(z, {
625
- title: g.guidePairTitle,
626
- done: w?.ok,
672
+ /* @__PURE__ */ O(V, {
673
+ title: h.guidePairTitle,
674
+ done: C?.ok,
627
675
  children: [
628
- /* @__PURE__ */ E("p", {
676
+ /* @__PURE__ */ D("p", {
629
677
  className: "text-sm",
630
- children: g.guidePair
678
+ children: h.guidePair
631
679
  }),
632
- /* @__PURE__ */ E(_, {
680
+ /* @__PURE__ */ D(v, {
633
681
  appearance: "empty",
634
682
  showNotice: !1,
635
683
  onSubmit: () => !1,
636
- children: /* @__PURE__ */ E(C, {
684
+ children: /* @__PURE__ */ D(w, {
637
685
  name: "code",
638
- label: g.addCode,
686
+ label: h.addCode,
639
687
  placeholder: "ABCD-EFGH",
640
688
  autoComplete: "off",
641
689
  onChange: ({ value: e }) => k(String(e ?? ""))
642
690
  })
643
691
  }),
644
- w && /* @__PURE__ */ E(f, {
645
- variant: w.ok ? "success" : "warning",
692
+ C && /* @__PURE__ */ D(p, {
693
+ variant: C.ok ? "success" : "warning",
646
694
  appearance: "text",
647
- children: w.text
695
+ children: C.text
648
696
  }),
649
- P && /* @__PURE__ */ E(f, {
697
+ M && /* @__PURE__ */ D(p, {
650
698
  variant: "danger",
651
- children: P
699
+ children: M
652
700
  }),
653
- /* @__PURE__ */ D("div", {
701
+ /* @__PURE__ */ O("div", {
654
702
  className: "flex flex-wrap gap-2",
655
- children: [/* @__PURE__ */ E(v, {
656
- label: g.guideCheckHealth,
703
+ children: [/* @__PURE__ */ D(y, {
704
+ label: h.guideCheckHealth,
657
705
  variant: "outline-secondary",
658
706
  disabled: !I,
659
707
  onClick: async () => {
660
- let e = await p(L);
708
+ let e = await u(L);
661
709
  T(e.ok ? {
662
710
  ok: !0,
663
- text: N(g.guideHealthOk, {
711
+ text: P(h.guideHealthOk, {
664
712
  version: e.version,
665
713
  url: L
666
714
  })
667
715
  } : {
668
716
  ok: !1,
669
- text: N(g.guideHealthKo, { url: L })
717
+ text: P(h.guideHealthKo, { url: L })
670
718
  });
671
719
  }
672
- }), /* @__PURE__ */ E(v, {
673
- label: g.addConnect,
720
+ }), /* @__PURE__ */ D(y, {
721
+ label: h.addConnect,
674
722
  variant: "primary",
675
- disabled: !I || O.trim().length < 8,
723
+ disabled: !I || E.trim().length < 8,
676
724
  onClick: async () => {
677
725
  try {
678
726
  F(null), await c({
679
727
  url: L,
680
- code: O.trim()
728
+ code: E.trim()
681
729
  });
682
730
  } catch (e) {
683
- F(N(g.error, { error: e.message }));
731
+ F(P(h.error, { error: e.message }));
684
732
  }
685
733
  }
686
734
  })]
687
735
  })
688
736
  ]
689
737
  }),
690
- /* @__PURE__ */ E(z, {
691
- title: g.guideTroubleTitle,
692
- children: /* @__PURE__ */ E("p", {
738
+ /* @__PURE__ */ D(V, {
739
+ title: h.guideTroubleTitle,
740
+ children: /* @__PURE__ */ D("p", {
693
741
  className: "text-sm text-muted-foreground",
694
- children: g.guideTrouble
742
+ children: h.guideTrouble
695
743
  })
696
744
  })
697
745
  ]
698
746
  });
699
747
  }
700
748
  // src/ui/RunnersSettings.tsx
701
- function V({ fleet: e, locale: t, texts: n }) {
702
- let r = M(t, n), [i, a] = u(null), [o, l] = u(null), [h, g] = u(!1), [v, y] = u(null), [x, C] = u(null), T = s(async () => {
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 () => {
703
751
  try {
704
752
  let t = await e.list();
705
753
  a(t);
@@ -707,27 +755,27 @@ function V({ fleet: e, locale: t, texts: n }) {
707
755
  a(t.map((e, t) => ({
708
756
  ...e,
709
757
  status: n[t]
710
- }))), e.tenants && l(await e.tenants.list());
758
+ }))), e.tenants && s(await e.tenants.list());
711
759
  } catch (e) {
712
- C(N(r.error, { error: e.message })), a([]);
760
+ S(P(r.error, { error: e.message })), a([]);
713
761
  }
714
762
  }, [e, r]);
715
- c(() => {
716
- T();
717
- }, [T]);
718
- let O = async (t, n) => {
719
- await e.update(t, n), await T();
763
+ l(() => {
764
+ w();
765
+ }, [w]);
766
+ let E = async (t, n) => {
767
+ await e.update(t, n), await w();
720
768
  };
721
- return /* @__PURE__ */ D("div", {
769
+ return /* @__PURE__ */ O("div", {
722
770
  className: "flex flex-col gap-4",
723
771
  children: [
724
- /* @__PURE__ */ E(m, {
725
- header: /* @__PURE__ */ D("div", {
772
+ /* @__PURE__ */ D(h, {
773
+ header: /* @__PURE__ */ O("div", {
726
774
  className: "flex flex-wrap items-center gap-2",
727
- children: [/* @__PURE__ */ E("h3", {
775
+ children: [/* @__PURE__ */ D("h3", {
728
776
  className: "flex-1 text-base font-semibold",
729
777
  children: r.runnersTitle
730
- }), /* @__PURE__ */ E(d, {
778
+ }), /* @__PURE__ */ D(f, {
731
779
  icon: "plus",
732
780
  label: r.runnersAdd,
733
781
  variant: "primary",
@@ -736,56 +784,56 @@ function V({ fleet: e, locale: t, texts: n }) {
736
784
  }),
737
785
  loading: i === null,
738
786
  loaderMinHeight: 120,
739
- children: /* @__PURE__ */ D("div", {
787
+ children: /* @__PURE__ */ O("div", {
740
788
  className: "flex flex-col gap-3",
741
789
  children: [
742
- /* @__PURE__ */ E("p", {
790
+ /* @__PURE__ */ D("p", {
743
791
  className: "text-sm text-muted-foreground",
744
792
  children: r.runnersIntro
745
793
  }),
746
- x && /* @__PURE__ */ E(f, {
794
+ b && /* @__PURE__ */ D(p, {
747
795
  variant: "danger",
748
- children: x
796
+ children: b
749
797
  }),
750
- i?.length === 0 && /* @__PURE__ */ E("p", {
798
+ i?.length === 0 && /* @__PURE__ */ D("p", {
751
799
  className: "text-sm text-muted-foreground",
752
800
  children: r.runnersEmpty
753
801
  }),
754
- i?.map((e) => /* @__PURE__ */ D("div", {
802
+ i?.map((e) => /* @__PURE__ */ O("div", {
755
803
  className: "flex flex-col gap-2 rounded-md border border-border p-3",
756
- children: [/* @__PURE__ */ D("div", {
804
+ children: [/* @__PURE__ */ O("div", {
757
805
  className: "flex flex-wrap items-center gap-2",
758
806
  children: [
759
- /* @__PURE__ */ E("span", {
807
+ /* @__PURE__ */ D("span", {
760
808
  className: "font-medium",
761
809
  children: e.name
762
810
  }),
763
- /* @__PURE__ */ E("span", {
811
+ /* @__PURE__ */ D("span", {
764
812
  className: "text-xs text-muted-foreground",
765
813
  children: e.url
766
814
  }),
767
- e.status === null && /* @__PURE__ */ E(p, {
815
+ e.status === null && /* @__PURE__ */ D(m, {
768
816
  variant: "danger",
769
817
  children: r.runnersUnreachable
770
818
  }),
771
- e.status && /* @__PURE__ */ E(p, {
819
+ e.status && /* @__PURE__ */ D(m, {
772
820
  variant: "secondary",
773
- children: N(r.runnersVersion, { version: e.status.version })
821
+ children: P(r.runnersVersion, { version: e.status.version })
774
822
  }),
775
- e.status && /* @__PURE__ */ E(p, {
823
+ e.status && /* @__PURE__ */ D(m, {
776
824
  variant: "info",
777
- children: N(r.runnersLoad, {
825
+ children: P(r.runnersLoad, {
778
826
  chats: e.status.load.chats,
779
827
  max: e.status.load.maxChats
780
828
  })
781
829
  }),
782
- e.status && /* @__PURE__ */ E(p, {
830
+ e.status && /* @__PURE__ */ D(m, {
783
831
  variant: "light",
784
- children: N(r.runnersTenants, { count: e.status.tenants.length })
832
+ children: P(r.runnersTenants, { count: e.status.tenants.length })
785
833
  }),
786
- /* @__PURE__ */ E("div", {
834
+ /* @__PURE__ */ D("div", {
787
835
  className: "ml-auto",
788
- children: /* @__PURE__ */ E(d, {
836
+ children: /* @__PURE__ */ D(f, {
789
837
  icon: "trash",
790
838
  label: r.runnersRemove,
791
839
  variant: "outline-danger",
@@ -793,7 +841,7 @@ function V({ fleet: e, locale: t, texts: n }) {
793
841
  })
794
842
  })
795
843
  ]
796
- }), /* @__PURE__ */ E(_, {
844
+ }), /* @__PURE__ */ D(v, {
797
845
  appearance: "empty",
798
846
  showNotice: !1,
799
847
  onSubmit: () => !1,
@@ -801,18 +849,18 @@ function V({ fleet: e, locale: t, texts: n }) {
801
849
  isDefault: e.isDefault ? "true" : "",
802
850
  draining: e.draining ? "true" : ""
803
851
  },
804
- children: /* @__PURE__ */ D("div", {
852
+ children: /* @__PURE__ */ O("div", {
805
853
  className: "flex flex-wrap gap-4",
806
- children: [/* @__PURE__ */ E(w, {
854
+ children: [/* @__PURE__ */ D(T, {
807
855
  name: "isDefault",
808
856
  label: r.runnersDefault,
809
857
  valueChecked: "true",
810
- onChange: ({ value: t }) => void O(e.id, { isDefault: !!t })
811
- }), /* @__PURE__ */ E(w, {
858
+ onChange: ({ value: t }) => void E(e.id, { isDefault: !!t })
859
+ }), /* @__PURE__ */ D(T, {
812
860
  name: "draining",
813
861
  label: r.runnersDraining,
814
862
  valueChecked: "true",
815
- onChange: ({ value: t }) => void O(e.id, { draining: !!t })
863
+ onChange: ({ value: t }) => void E(e.id, { draining: !!t })
816
864
  })]
817
865
  })
818
866
  })]
@@ -820,26 +868,26 @@ function V({ fleet: e, locale: t, texts: n }) {
820
868
  ]
821
869
  })
822
870
  }),
823
- e.tenants && i && i.length > 0 && /* @__PURE__ */ E(m, {
871
+ e.tenants && i && i.length > 0 && /* @__PURE__ */ D(h, {
824
872
  title: r.distributionTitle,
825
873
  loading: o === null,
826
874
  loaderMinHeight: 80,
827
- children: /* @__PURE__ */ D("div", {
875
+ children: /* @__PURE__ */ O("div", {
828
876
  className: "flex flex-col gap-2",
829
- children: [/* @__PURE__ */ E("p", {
877
+ children: [/* @__PURE__ */ D("p", {
830
878
  className: "text-sm text-muted-foreground",
831
879
  children: r.distributionIntro
832
- }), /* @__PURE__ */ E(_, {
880
+ }), /* @__PURE__ */ D(v, {
833
881
  appearance: "empty",
834
882
  showNotice: !1,
835
883
  onSubmit: () => !1,
836
884
  defaultValues: Object.fromEntries((o ?? []).map((e) => [`runner_${e.id}`, e.runnerId ?? ""])),
837
- children: (o ?? []).map((t) => /* @__PURE__ */ D("div", {
885
+ children: (o ?? []).map((t) => /* @__PURE__ */ O("div", {
838
886
  className: "flex flex-wrap items-center gap-2",
839
- children: [/* @__PURE__ */ E("span", {
887
+ children: [/* @__PURE__ */ D("span", {
840
888
  className: "min-w-40 flex-1 text-sm",
841
889
  children: t.name
842
- }), /* @__PURE__ */ E(S, {
890
+ }), /* @__PURE__ */ D(C, {
843
891
  name: `runner_${t.id}`,
844
892
  title: r.distributionRunner,
845
893
  placeholderOption: {
@@ -851,80 +899,80 @@ function V({ fleet: e, locale: t, texts: n }) {
851
899
  value: e.id
852
900
  })),
853
901
  onChange: ({ value: n }) => {
854
- n && e.tenants.assign(t.id, String(n)).then(T);
902
+ n && e.tenants.assign(t.id, String(n)).then(w);
855
903
  }
856
904
  })]
857
905
  }, t.id))
858
906
  })]
859
907
  })
860
908
  }),
861
- h && /* @__PURE__ */ E(W, {
909
+ u && /* @__PURE__ */ D(K, {
862
910
  fleet: e,
863
911
  t: r,
864
912
  locale: t,
865
913
  onClose: () => g(!1),
866
914
  onAdded: async () => {
867
- g(!1), await T();
915
+ g(!1), await w();
868
916
  }
869
917
  }),
870
- v && /* @__PURE__ */ E(b, {
918
+ _ && /* @__PURE__ */ D(x, {
871
919
  title: r.runnersRemove,
872
920
  danger: !0,
873
921
  onClose: () => y(null),
874
- onYes: async () => (await e.remove(v.id).catch((e) => C(N(r.error, { error: e.message }))), y(null), await T(), !0),
875
- children: N(r.runnersRemoveConfirm, { name: v.name })
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 })
876
924
  })
877
925
  ]
878
926
  });
879
927
  }
880
- function H({ target: e, children: t }) {
881
- return e ? O(t, e) : null;
928
+ function W({ target: e, children: t }) {
929
+ return e ? k(t, e) : null;
882
930
  }
883
- var U = (e) => {
931
+ var G = (e) => {
884
932
  try {
885
933
  return new URL(e).hostname;
886
934
  } catch {
887
935
  return e;
888
936
  }
889
937
  };
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, {
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, {
893
941
  title: t.addTitle,
894
942
  size: "lg",
895
943
  onClose: r,
896
- footer: a === "choose" || a === "guided" ? !1 : /* @__PURE__ */ E("div", {
944
+ footer: a === "choose" || a === "guided" ? !1 : /* @__PURE__ */ D("div", {
897
945
  ref: m,
898
946
  className: "flex w-full flex-wrap items-center justify-end gap-3"
899
947
  }),
900
- children: /* @__PURE__ */ D("div", {
948
+ children: /* @__PURE__ */ O("div", {
901
949
  className: "flex flex-col gap-4",
902
950
  children: [
903
- c && /* @__PURE__ */ E(f, {
951
+ s && /* @__PURE__ */ D(p, {
904
952
  variant: "danger",
905
- children: c
953
+ children: s
906
954
  }),
907
- a === "choose" && /* @__PURE__ */ D("div", {
955
+ a === "choose" && /* @__PURE__ */ O("div", {
908
956
  className: "grid gap-3 sm:grid-cols-3",
909
957
  children: [
910
- e.install && /* @__PURE__ */ E(G, {
958
+ e.install && /* @__PURE__ */ D(q, {
911
959
  title: t.addAutomatic,
912
960
  hint: t.addAutomaticHint,
913
961
  onClick: () => o("automatic")
914
962
  }),
915
- /* @__PURE__ */ E(G, {
963
+ /* @__PURE__ */ D(q, {
916
964
  title: t.addGuided,
917
965
  hint: t.addGuidedHint,
918
966
  onClick: () => o("guided")
919
967
  }),
920
- /* @__PURE__ */ E(G, {
968
+ /* @__PURE__ */ D(q, {
921
969
  title: t.addExisting,
922
970
  hint: t.addExistingHint,
923
971
  onClick: () => o("existing")
924
972
  })
925
973
  ]
926
974
  }),
927
- a !== "choose" && /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(d, {
975
+ a !== "choose" && /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(f, {
928
976
  icon: "arrow-left",
929
977
  label: t.addBack,
930
978
  variant: "link",
@@ -932,9 +980,9 @@ function W({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
932
980
  o("choose"), l(null);
933
981
  }
934
982
  }) }),
935
- a === "automatic" && e.install && /* @__PURE__ */ E(ee, {
983
+ a === "automatic" && e.install && /* @__PURE__ */ D(ne, {
936
984
  t,
937
- footer: p,
985
+ footer: u,
938
986
  localKeys: !!e.localKeys,
939
987
  install: (t, n, r) => e.install({
940
988
  name: t,
@@ -944,20 +992,20 @@ function W({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
944
992
  onDone: i,
945
993
  onError: h
946
994
  }),
947
- a === "guided" && /* @__PURE__ */ E(B, {
995
+ a === "guided" && /* @__PURE__ */ D(H, {
948
996
  locale: n,
949
997
  texts: t,
950
998
  onPair: async ({ url: t, code: n }) => {
951
999
  await i(await e.add({
952
- name: U(t),
1000
+ name: G(t),
953
1001
  url: t,
954
1002
  code: n
955
1003
  }));
956
1004
  }
957
1005
  }),
958
- a === "existing" && /* @__PURE__ */ E(Y, {
1006
+ a === "existing" && /* @__PURE__ */ D(te, {
959
1007
  t,
960
- footer: p,
1008
+ footer: u,
961
1009
  pairing: e.startPairing && e.pairingStatus ? {
962
1010
  start: e.startPairing.bind(e),
963
1011
  status: e.pairingStatus.bind(e)
@@ -968,7 +1016,7 @@ function W({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
968
1016
  onConnect: async (t, n) => {
969
1017
  try {
970
1018
  await i(await e.add({
971
- name: U(t),
1019
+ name: G(t),
972
1020
  url: t,
973
1021
  code: n
974
1022
  }));
@@ -981,31 +1029,31 @@ function W({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
981
1029
  })
982
1030
  });
983
1031
  }
984
- function G({ title: e, hint: t, onClick: n }) {
985
- return /* @__PURE__ */ D("button", {
1032
+ function q({ title: e, hint: t, onClick: n }) {
1033
+ return /* @__PURE__ */ O("button", {
986
1034
  type: "button",
987
1035
  onClick: n,
988
1036
  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",
989
- children: [/* @__PURE__ */ E("span", {
1037
+ children: [/* @__PURE__ */ D("span", {
990
1038
  className: "block font-medium",
991
1039
  children: e
992
- }), /* @__PURE__ */ E("span", {
1040
+ }), /* @__PURE__ */ D("span", {
993
1041
  className: "mt-1 block text-sm text-muted-foreground",
994
1042
  children: t
995
1043
  })]
996
1044
  });
997
1045
  }
998
- var K = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), q = (e) => new Date(e).toLocaleTimeString(void 0, {
1046
+ var J = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), Y = (e) => new Date(e).toLocaleTimeString(void 0, {
999
1047
  hour: "2-digit",
1000
1048
  minute: "2-digit"
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);
1004
- return c(() => {
1005
- if (!y || !n) return;
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);
1052
+ return l(() => {
1053
+ if (!_ || !n) return;
1006
1054
  let e = !1, t = 0, a, o = async () => {
1007
1055
  try {
1008
- let i = await n.status(y.id);
1056
+ let i = await n.status(_.id);
1009
1057
  if (t = 0, e) return;
1010
1058
  if (i.status === "approved") {
1011
1059
  await r(i.runner);
@@ -1016,7 +1064,7 @@ function Y({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1016
1064
  return;
1017
1065
  }
1018
1066
  } catch (n) {
1019
- t += 1, !e && t >= J && i(n);
1067
+ t += 1, !e && t >= ee && i(n);
1020
1068
  }
1021
1069
  e || (a = setTimeout(() => void o(), 2e3));
1022
1070
  };
@@ -1024,60 +1072,60 @@ function Y({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1024
1072
  e = !0, clearTimeout(a);
1025
1073
  };
1026
1074
  }, [
1027
- y,
1075
+ _,
1028
1076
  n,
1029
1077
  r,
1030
1078
  i
1031
- ]), y ? /* @__PURE__ */ D("div", {
1079
+ ]), _ ? /* @__PURE__ */ O("div", {
1032
1080
  className: "flex flex-col gap-3",
1033
1081
  children: [
1034
- /* @__PURE__ */ E("h4", {
1082
+ /* @__PURE__ */ D("h4", {
1035
1083
  className: "font-semibold",
1036
1084
  children: e.pairWaitingTitle
1037
1085
  }),
1038
- /* @__PURE__ */ E("p", {
1086
+ /* @__PURE__ */ D("p", {
1039
1087
  className: "text-sm text-muted-foreground",
1040
1088
  children: e.pairWaitingHint
1041
1089
  }),
1042
- /* @__PURE__ */ E("div", {
1090
+ /* @__PURE__ */ D("div", {
1043
1091
  className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
1044
- children: y.code
1092
+ children: _.code
1045
1093
  }),
1046
- /* @__PURE__ */ E("p", {
1094
+ /* @__PURE__ */ D("p", {
1047
1095
  className: "text-sm text-muted-foreground",
1048
- children: N(e.pairWaiting, { at: q(y.expiresAt) })
1096
+ children: P(e.pairWaiting, { at: Y(_.expiresAt) })
1049
1097
  }),
1050
- /* @__PURE__ */ E(H, {
1098
+ /* @__PURE__ */ D(W, {
1051
1099
  target: t,
1052
- children: /* @__PURE__ */ E(d, {
1100
+ children: /* @__PURE__ */ D(f, {
1053
1101
  icon: "external-link",
1054
1102
  label: e.pairOpen,
1055
1103
  variant: "primary",
1056
- onClick: () => window.open(y.approveUrl, "_blank", "noopener")
1104
+ onClick: () => window.open(_.approveUrl, "_blank", "noopener")
1057
1105
  })
1058
1106
  })
1059
1107
  ]
1060
- }) : /* @__PURE__ */ D("div", {
1108
+ }) : /* @__PURE__ */ O("div", {
1061
1109
  className: "flex flex-col gap-3",
1062
1110
  children: [
1063
- x && /* @__PURE__ */ E(f, {
1111
+ x && /* @__PURE__ */ D(p, {
1064
1112
  variant: x === "denied" ? "danger" : "warning",
1065
1113
  children: x === "denied" ? e.pairDenied : e.pairExpired
1066
1114
  }),
1067
- /* @__PURE__ */ D(_, {
1115
+ /* @__PURE__ */ O(v, {
1068
1116
  appearance: "empty",
1069
1117
  showNotice: !1,
1070
1118
  onSubmit: () => !1,
1071
1119
  defaultValues: {
1072
1120
  url: s,
1073
- code: p
1121
+ code: u
1074
1122
  },
1075
- children: [/* @__PURE__ */ E(C, {
1123
+ children: [/* @__PURE__ */ D(w, {
1076
1124
  name: "url",
1077
1125
  label: e.addUrl,
1078
1126
  placeholder: "https://runner.example.com",
1079
- onChange: ({ value: e }) => l(String(e ?? ""))
1080
- }), h && /* @__PURE__ */ E(C, {
1127
+ onChange: ({ value: e }) => c(String(e ?? ""))
1128
+ }), h && /* @__PURE__ */ D(w, {
1081
1129
  name: "code",
1082
1130
  label: e.addCode,
1083
1131
  placeholder: "ABCD-EFGH",
@@ -1085,27 +1133,27 @@ function Y({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
1085
1133
  onChange: ({ value: e }) => m(String(e ?? ""))
1086
1134
  })]
1087
1135
  }),
1088
- /* @__PURE__ */ D(H, {
1136
+ /* @__PURE__ */ O(W, {
1089
1137
  target: t,
1090
- children: [n && /* @__PURE__ */ E(d, {
1138
+ children: [n && /* @__PURE__ */ D(f, {
1091
1139
  label: h ? e.pairWithApproval : e.pairWithCode,
1092
1140
  variant: "link",
1093
1141
  onClick: () => g((e) => !e)
1094
- }), h ? /* @__PURE__ */ E(v, {
1142
+ }), h ? /* @__PURE__ */ D(y, {
1095
1143
  label: e.addConnect,
1096
1144
  variant: "primary",
1097
- disabled: !s.trim() || p.trim().length < 8,
1098
- onClick: () => o(K(s), p.trim())
1099
- }) : /* @__PURE__ */ E(v, {
1145
+ disabled: !s.trim() || u.trim().length < 8,
1146
+ onClick: () => o(J(s), u.trim())
1147
+ }) : /* @__PURE__ */ D(y, {
1100
1148
  label: x ? e.pairAgain : e.pairNext,
1101
1149
  variant: "primary",
1102
1150
  disabled: !s.trim(),
1103
1151
  onClick: async () => {
1104
1152
  S(null), a();
1105
1153
  try {
1106
- let e = K(s);
1154
+ let e = J(s);
1107
1155
  b(await n.start({
1108
- name: U(e),
1156
+ name: G(e),
1109
1157
  url: e
1110
1158
  }));
1111
1159
  } catch (e) {
@@ -1128,8 +1176,8 @@ var X = [
1128
1176
  "tls",
1129
1177
  "done"
1130
1178
  ];
1131
- function ee({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
1132
- let [o, s] = u({
1179
+ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
1180
+ let [o, s] = d({
1133
1181
  host: "",
1134
1182
  port: "22",
1135
1183
  username: n ? "" : "root",
@@ -1137,47 +1185,47 @@ function ee({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1137
1185
  privateKey: "",
1138
1186
  password: "",
1139
1187
  domain: ""
1140
- }), [c, l] = u([]), [d, f] = u(null), [m, h] = u(!1), g = (e) => ({ value: t }) => s((n) => ({
1188
+ }), [c, l] = d([]), [u, f] = d(null), [p, h] = d(!1), g = (e) => ({ value: t }) => s((n) => ({
1141
1189
  ...n,
1142
1190
  [e]: String(t ?? "")
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", {
1191
+ })), _ = 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", {
1145
1193
  className: "flex flex-col gap-3",
1146
1194
  children: [
1147
- !m && /* @__PURE__ */ D(_, {
1195
+ !p && /* @__PURE__ */ O(v, {
1148
1196
  appearance: "empty",
1149
1197
  showNotice: !1,
1150
1198
  onSubmit: () => !1,
1151
1199
  defaultValues: o,
1152
1200
  children: [
1153
- /* @__PURE__ */ E(C, {
1201
+ /* @__PURE__ */ D(w, {
1154
1202
  name: "domain",
1155
1203
  label: e.guideDomain,
1156
1204
  placeholder: "runner.example.com",
1157
1205
  onChange: g("domain")
1158
1206
  }),
1159
- /* @__PURE__ */ D("div", {
1207
+ /* @__PURE__ */ O("div", {
1160
1208
  className: "grid gap-3 sm:grid-cols-3",
1161
1209
  children: [
1162
- /* @__PURE__ */ E(C, {
1210
+ /* @__PURE__ */ D(w, {
1163
1211
  name: "host",
1164
1212
  label: e.addHost,
1165
1213
  placeholder: "203.0.113.10",
1166
1214
  onChange: g("host")
1167
1215
  }),
1168
- /* @__PURE__ */ E(C, {
1216
+ /* @__PURE__ */ D(w, {
1169
1217
  name: "port",
1170
1218
  label: e.addPort,
1171
1219
  onChange: g("port")
1172
1220
  }),
1173
- /* @__PURE__ */ E(C, {
1221
+ /* @__PURE__ */ D(w, {
1174
1222
  name: "username",
1175
1223
  label: e.addUser,
1176
1224
  onChange: g("username")
1177
1225
  })
1178
1226
  ]
1179
1227
  }),
1180
- /* @__PURE__ */ E(S, {
1228
+ /* @__PURE__ */ D(C, {
1181
1229
  name: "auth",
1182
1230
  label: e.addAuth,
1183
1231
  options: [
@@ -1196,16 +1244,16 @@ function ee({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1196
1244
  ],
1197
1245
  onChange: g("auth")
1198
1246
  }),
1199
- o.auth === "local" && /* @__PURE__ */ E("p", {
1247
+ o.auth === "local" && /* @__PURE__ */ D("p", {
1200
1248
  className: "text-xs text-muted-foreground",
1201
1249
  children: e.addLocalKeyHint
1202
1250
  }),
1203
- o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ E(T, {
1251
+ o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ D(E, {
1204
1252
  name: "privateKey",
1205
1253
  label: e.addKey,
1206
1254
  placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----",
1207
1255
  onChange: g("privateKey")
1208
- }) : /* @__PURE__ */ E(x, {
1256
+ }) : /* @__PURE__ */ D(S, {
1209
1257
  name: "password",
1210
1258
  label: e.addPassword,
1211
1259
  autoComplete: "off",
@@ -1213,27 +1261,27 @@ function ee({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
1213
1261
  })
1214
1262
  ]
1215
1263
  }),
1216
- /* @__PURE__ */ E("p", {
1264
+ /* @__PURE__ */ D("p", {
1217
1265
  className: "text-xs text-muted-foreground",
1218
1266
  children: e.addCredentialsNote
1219
1267
  }),
1220
- m && /* @__PURE__ */ E("div", {
1268
+ p && /* @__PURE__ */ D("div", {
1221
1269
  className: "flex flex-wrap gap-1",
1222
- children: X.map((e) => /* @__PURE__ */ E(p, {
1223
- variant: d === e ? "primary" : X.indexOf(e) < X.indexOf(d ?? "check") ? "success" : "light",
1270
+ children: X.map((e) => /* @__PURE__ */ D(m, {
1271
+ variant: u === e ? "primary" : X.indexOf(e) < X.indexOf(u ?? "check") ? "success" : "light",
1224
1272
  children: e
1225
1273
  }, e))
1226
1274
  }),
1227
- c.length > 0 && /* @__PURE__ */ E("pre", {
1275
+ c.length > 0 && /* @__PURE__ */ D("pre", {
1228
1276
  className: "max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs",
1229
1277
  children: c.slice(-200).join("\n")
1230
1278
  }),
1231
- /* @__PURE__ */ E(H, {
1279
+ /* @__PURE__ */ D(W, {
1232
1280
  target: t,
1233
- children: /* @__PURE__ */ E(v, {
1234
- label: m ? e.addInstalling : e.addInstall,
1281
+ children: /* @__PURE__ */ D(y, {
1282
+ label: p ? e.addInstalling : e.addInstall,
1235
1283
  variant: "primary",
1236
- disabled: !y || m,
1284
+ disabled: !_ || p,
1237
1285
  onClick: async () => {
1238
1286
  h(!0), l([]);
1239
1287
  try {
@@ -1261,132 +1309,136 @@ var Z = (e) => (e / 1024 ** 3).toFixed(1), Q = (e) => new Date(e).toLocaleString
1261
1309
  dateStyle: "short",
1262
1310
  timeStyle: "short"
1263
1311
  });
1264
- function te({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1265
- let o = M(n, r), [l, p] = u(null), [y, b] = u(null), [x, S] = u(null), [w, T] = u({
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({
1266
1314
  id: "",
1267
1315
  name: ""
1268
- }), [O, k] = u(null), A = s(async () => {
1316
+ }), [E, k] = d(null), A = c(async () => {
1269
1317
  try {
1270
- p(await t.platform.status()), b(null);
1271
- } catch (t) {
1272
- b(N(o.error, { error: t instanceof e ? t.code : String(t) }));
1318
+ u(await e.platform.status()), b(null);
1319
+ } catch (e) {
1320
+ b(P(o.error, { error: e instanceof t ? e.code : String(e) }));
1273
1321
  }
1274
- }, [t, o]);
1275
- return c(() => {
1322
+ }, [e, o]);
1323
+ return l(() => {
1276
1324
  A();
1277
- }, [A]), /* @__PURE__ */ D("div", {
1325
+ }, [A]), /* @__PURE__ */ O("div", {
1278
1326
  className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
1279
1327
  children: [
1280
- /* @__PURE__ */ D("div", {
1328
+ /* @__PURE__ */ O("div", {
1281
1329
  className: "flex items-center gap-2",
1282
- children: [/* @__PURE__ */ E("h1", {
1330
+ children: [/* @__PURE__ */ D("h1", {
1283
1331
  className: "flex-1 text-xl font-semibold",
1284
1332
  children: o.consoleTitle
1285
- }), i && /* @__PURE__ */ E(d, {
1333
+ }), i && /* @__PURE__ */ D(f, {
1286
1334
  icon: "log-out",
1287
1335
  label: o.consoleSignOut,
1288
1336
  variant: "outline-secondary",
1289
1337
  onClick: i
1290
1338
  })]
1291
1339
  }),
1292
- y && /* @__PURE__ */ E(f, {
1340
+ m && /* @__PURE__ */ D(p, {
1293
1341
  variant: "danger",
1294
- children: y
1342
+ children: m
1295
1343
  }),
1296
- /* @__PURE__ */ E(re, {
1297
- client: t,
1344
+ /* @__PURE__ */ D(oe, {
1345
+ client: e,
1298
1346
  t: o,
1299
1347
  approve: a,
1300
1348
  onAnswered: A
1301
1349
  }),
1302
- /* @__PURE__ */ E(m, {
1350
+ /* @__PURE__ */ D(h, {
1303
1351
  title: o.consoleStatus,
1304
- loading: !l && !y,
1352
+ loading: !s && !m,
1305
1353
  loaderMinHeight: 100,
1306
- children: l && /* @__PURE__ */ E(g, { items: [
1354
+ children: s && /* @__PURE__ */ D(_, { items: [
1307
1355
  {
1308
1356
  label: "Version",
1309
- value: l.version
1357
+ value: s.version
1310
1358
  },
1311
1359
  {
1312
1360
  label: "URL",
1313
- value: l.url
1361
+ value: s.url
1314
1362
  },
1315
1363
  {
1316
1364
  label: "Chats",
1317
- value: `${l.load.chats} / ${l.load.maxChats}`
1365
+ value: `${s.load.chats} / ${s.load.maxChats}`
1318
1366
  },
1319
1367
  {
1320
1368
  label: "Machine",
1321
- value: N(o.consoleMachine, {
1322
- memory: Z(l.machine.availableBytes),
1323
- total: Z(l.machine.totalBytes),
1324
- cpus: l.machine.cpus
1369
+ value: P(o.consoleMachine, {
1370
+ memory: Z(s.machine.availableBytes),
1371
+ total: Z(s.machine.totalBytes),
1372
+ cpus: s.machine.cpus
1325
1373
  })
1326
1374
  },
1327
1375
  {
1328
1376
  label: "Agent",
1329
- value: l.agentImage
1377
+ value: s.agentImage
1330
1378
  }
1331
1379
  ] })
1332
1380
  }),
1333
- /* @__PURE__ */ E(m, {
1381
+ /* @__PURE__ */ D(h, {
1334
1382
  title: o.consolePairing,
1335
- children: /* @__PURE__ */ D("div", {
1383
+ children: /* @__PURE__ */ O("div", {
1336
1384
  className: "flex flex-col gap-2",
1337
1385
  children: [
1338
- /* @__PURE__ */ E("p", {
1386
+ /* @__PURE__ */ D("p", {
1339
1387
  className: "text-sm text-muted-foreground",
1340
1388
  children: o.consolePairingHint
1341
1389
  }),
1342
- x && /* @__PURE__ */ E(h, {
1390
+ x && /* @__PURE__ */ D(g, {
1343
1391
  showCopy: !0,
1344
1392
  children: x.code
1345
1393
  }),
1346
- x && /* @__PURE__ */ E("p", {
1394
+ x && /* @__PURE__ */ D("p", {
1347
1395
  className: "text-xs text-muted-foreground",
1348
- children: N(o.consoleCode, {
1396
+ children: P(o.consoleCode, {
1349
1397
  code: x.code,
1350
1398
  at: Q(x.expiresAt)
1351
1399
  })
1352
1400
  }),
1353
- /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(v, {
1401
+ /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(y, {
1354
1402
  label: o.consoleNewCode,
1355
1403
  variant: "outline-primary",
1356
- onClick: async () => S(await t.createPairing())
1404
+ onClick: async () => S(await e.createPairing())
1357
1405
  }) })
1358
1406
  ]
1359
1407
  })
1360
1408
  }),
1361
- /* @__PURE__ */ E(m, {
1409
+ /* @__PURE__ */ D(ie, {
1410
+ client: e,
1411
+ t: o
1412
+ }),
1413
+ /* @__PURE__ */ D(h, {
1362
1414
  title: o.consoleTenants,
1363
- children: /* @__PURE__ */ D("div", {
1415
+ children: /* @__PURE__ */ O("div", {
1364
1416
  className: "flex flex-col gap-3",
1365
1417
  children: [
1366
- O && /* @__PURE__ */ E(f, {
1418
+ E && /* @__PURE__ */ D(p, {
1367
1419
  variant: "warning",
1368
1420
  onClose: () => k(null),
1369
- children: /* @__PURE__ */ E("span", {
1421
+ children: /* @__PURE__ */ D("span", {
1370
1422
  className: "break-all",
1371
- children: N(o.consoleKeyShown, { key: O })
1423
+ children: P(o.consoleKeyShown, { key: E })
1372
1424
  })
1373
1425
  }),
1374
- l?.tenants.map((e) => /* @__PURE__ */ E(ne, {
1375
- client: t,
1376
- tenant: e,
1426
+ s?.tenants.map((t) => /* @__PURE__ */ D(ae, {
1427
+ client: e,
1428
+ tenant: t,
1377
1429
  t: o,
1378
1430
  locale: n,
1379
1431
  onKey: k,
1380
1432
  onChange: A
1381
- }, e.id)),
1382
- /* @__PURE__ */ E(_, {
1433
+ }, t.id)),
1434
+ /* @__PURE__ */ D(v, {
1383
1435
  appearance: "empty",
1384
1436
  showNotice: !1,
1385
1437
  onSubmit: () => !1,
1386
- children: /* @__PURE__ */ D("div", {
1438
+ children: /* @__PURE__ */ O("div", {
1387
1439
  className: "grid gap-2 sm:grid-cols-[1fr_1fr_auto] sm:items-end",
1388
1440
  children: [
1389
- /* @__PURE__ */ E(C, {
1441
+ /* @__PURE__ */ D(w, {
1390
1442
  name: "tenantId",
1391
1443
  label: o.consoleTenantId,
1392
1444
  placeholder: "acme",
@@ -1395,7 +1447,7 @@ function te({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1395
1447
  id: String(e ?? "")
1396
1448
  }))
1397
1449
  }),
1398
- /* @__PURE__ */ E(C, {
1450
+ /* @__PURE__ */ D(w, {
1399
1451
  name: "tenantName",
1400
1452
  label: o.consoleTenantName,
1401
1453
  placeholder: "Acme",
@@ -1404,16 +1456,16 @@ function te({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1404
1456
  name: String(e ?? "")
1405
1457
  }))
1406
1458
  }),
1407
- /* @__PURE__ */ E(v, {
1459
+ /* @__PURE__ */ D(y, {
1408
1460
  label: o.consoleCreate,
1409
1461
  variant: "primary",
1410
- disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(w.id),
1462
+ disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(C.id),
1411
1463
  onClick: async () => {
1412
1464
  try {
1413
- let e = await t.platform.createTenant(w.id, { name: w.name || void 0 });
1414
- e.key && k(e.key), await A();
1415
- } catch (t) {
1416
- b(N(o.error, { error: t instanceof e ? t.code : String(t) }));
1465
+ let t = await e.platform.createTenant(C.id, { name: C.name || void 0 });
1466
+ t.key && k(t.key), await A();
1467
+ } catch (e) {
1468
+ b(P(o.error, { error: e instanceof t ? e.code : String(e) }));
1417
1469
  }
1418
1470
  }
1419
1471
  })
@@ -1426,24 +1478,106 @@ function te({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1426
1478
  ]
1427
1479
  });
1428
1480
  }
1429
- function ne({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
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]);
1431
- return c(() => {
1432
- o && x();
1433
- }, [o, x]), /* @__PURE__ */ D("div", {
1481
+ function ie({ client: e, t }) {
1482
+ let [n, r] = d(null), [i, a] = d({}), [o, s] = d(null), u = c(async () => r(await e.platform.platformKeys()), [e]);
1483
+ return l(() => {
1484
+ u();
1485
+ }, [u]), /* @__PURE__ */ O(h, {
1486
+ title: t.consolePlatforms,
1487
+ loading: !n,
1488
+ loaderMinHeight: 60,
1489
+ children: [/* @__PURE__ */ O("div", {
1490
+ className: "flex flex-col gap-3",
1491
+ children: [
1492
+ /* @__PURE__ */ D("p", {
1493
+ className: "text-sm text-muted-foreground",
1494
+ children: t.consolePlatformsHint
1495
+ }),
1496
+ n && !n.length && /* @__PURE__ */ D("p", {
1497
+ className: "text-sm text-muted-foreground",
1498
+ children: t.consolePlatformsEmpty
1499
+ }),
1500
+ n?.map((n) => {
1501
+ let r = i[n.id] ?? n.project ?? "";
1502
+ return /* @__PURE__ */ D(v, {
1503
+ appearance: "empty",
1504
+ showNotice: !1,
1505
+ onSubmit: () => !1,
1506
+ children: /* @__PURE__ */ O("div", {
1507
+ className: "grid gap-2 rounded-md border border-border p-3 sm:grid-cols-[1fr_12rem_auto] sm:items-end",
1508
+ children: [
1509
+ /* @__PURE__ */ O("div", {
1510
+ className: "flex flex-col gap-1",
1511
+ children: [/* @__PURE__ */ D("span", {
1512
+ className: "font-medium",
1513
+ children: n.name
1514
+ }), /* @__PURE__ */ O("span", {
1515
+ className: "text-xs text-muted-foreground",
1516
+ children: [
1517
+ Q(n.createdAt),
1518
+ " · ",
1519
+ n.project ?? t.consolePlatformAll
1520
+ ]
1521
+ })]
1522
+ }),
1523
+ /* @__PURE__ */ D(w, {
1524
+ name: `project-${n.id}`,
1525
+ label: t.consolePlatformProject,
1526
+ value: r,
1527
+ placeholder: "crm",
1528
+ onChange: ({ value: e }) => a((t) => ({
1529
+ ...t,
1530
+ [n.id]: String(e ?? "").trim()
1531
+ }))
1532
+ }),
1533
+ /* @__PURE__ */ O("div", {
1534
+ className: "flex gap-2",
1535
+ children: [/* @__PURE__ */ D(y, {
1536
+ label: t.consolePlatformSave,
1537
+ variant: "outline-primary",
1538
+ disabled: r === (n.project ?? "") || r !== "" && !/^[a-z0-9]{1,32}$/.test(r),
1539
+ onClick: async () => {
1540
+ await e.setKeyProject(n.id, r || null), await u();
1541
+ }
1542
+ }), /* @__PURE__ */ D(f, {
1543
+ icon: "trash",
1544
+ label: t.consoleRevoke,
1545
+ variant: "outline-danger",
1546
+ onClick: () => s(n)
1547
+ })]
1548
+ })
1549
+ ]
1550
+ })
1551
+ }, n.id);
1552
+ })
1553
+ ]
1554
+ }), o && /* @__PURE__ */ D(x, {
1555
+ title: t.consoleRevoke,
1556
+ danger: !0,
1557
+ onClose: () => s(null),
1558
+ onYes: async () => (await e.platform.revokePlatformKey(o.id), s(null), await u(), !0),
1559
+ children: P(t.consolePlatformRevokeConfirm, { name: o.name })
1560
+ })]
1561
+ });
1562
+ }
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]);
1565
+ return l(() => {
1566
+ o && b();
1567
+ }, [o, b]), /* @__PURE__ */ O("div", {
1434
1568
  className: "rounded-md border border-border p-3",
1435
1569
  children: [
1436
- /* @__PURE__ */ D("div", {
1570
+ /* @__PURE__ */ O("div", {
1437
1571
  className: "flex flex-wrap items-center gap-2",
1438
1572
  children: [
1439
- /* @__PURE__ */ D("button", {
1573
+ /* @__PURE__ */ O("button", {
1440
1574
  type: "button",
1441
1575
  className: "flex-1 text-left font-medium",
1442
- onClick: () => f((e) => !e),
1576
+ onClick: () => s((e) => !e),
1443
1577
  children: [
1444
1578
  t.name,
1445
1579
  " ",
1446
- /* @__PURE__ */ D("span", {
1580
+ /* @__PURE__ */ O("span", {
1447
1581
  className: "text-xs text-muted-foreground",
1448
1582
  children: [
1449
1583
  "(",
@@ -1453,11 +1587,11 @@ function ne({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1453
1587
  })
1454
1588
  ]
1455
1589
  }),
1456
- t.usersWithAccounts !== void 0 && /* @__PURE__ */ D(p, {
1590
+ t.usersWithAccounts !== void 0 && /* @__PURE__ */ O(m, {
1457
1591
  variant: "light",
1458
1592
  children: [t.usersWithAccounts, " 👤"]
1459
1593
  }),
1460
- /* @__PURE__ */ E(d, {
1594
+ /* @__PURE__ */ D(f, {
1461
1595
  icon: "trash",
1462
1596
  label: n.consoleRemoveTenant,
1463
1597
  variant: "outline-danger",
@@ -1465,34 +1599,34 @@ function ne({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1465
1599
  })
1466
1600
  ]
1467
1601
  }),
1468
- o && /* @__PURE__ */ D("div", {
1602
+ o && /* @__PURE__ */ O("div", {
1469
1603
  className: "mt-3 flex flex-col gap-3",
1470
1604
  children: [
1471
- /* @__PURE__ */ E("h4", {
1605
+ /* @__PURE__ */ D("h4", {
1472
1606
  className: "text-sm font-semibold",
1473
1607
  children: n.consoleKeys
1474
1608
  }),
1475
- m?.map((r) => /* @__PURE__ */ D("div", {
1609
+ p?.map((r) => /* @__PURE__ */ O("div", {
1476
1610
  className: "flex flex-wrap items-center gap-2 text-sm",
1477
1611
  children: [
1478
- /* @__PURE__ */ E("span", {
1612
+ /* @__PURE__ */ D("span", {
1479
1613
  className: "flex-1",
1480
1614
  children: r.name
1481
1615
  }),
1482
- r.permissions.map((e) => /* @__PURE__ */ E(p, {
1616
+ r.permissions.map((e) => /* @__PURE__ */ D(m, {
1483
1617
  variant: "info",
1484
1618
  children: e
1485
1619
  }, e)),
1486
- /* @__PURE__ */ E(d, {
1620
+ /* @__PURE__ */ D(f, {
1487
1621
  label: n.consoleRevoke,
1488
1622
  variant: "outline-danger",
1489
1623
  onClick: async () => {
1490
- await e.platform.revokeKey(t.id, r.id), await x();
1624
+ await e.platform.revokeKey(t.id, r.id), await b();
1491
1625
  }
1492
1626
  })
1493
1627
  ]
1494
1628
  }, r.id)),
1495
- /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(v, {
1629
+ /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(y, {
1496
1630
  label: n.consoleNewKey,
1497
1631
  variant: "outline-secondary",
1498
1632
  onClick: async () => {
@@ -1505,34 +1639,34 @@ function ne({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1505
1639
  "accounts",
1506
1640
  "act-as-user"
1507
1641
  ]
1508
- })).key), await x();
1642
+ })).key), await b();
1509
1643
  }
1510
1644
  }) }),
1511
- /* @__PURE__ */ E("h4", {
1645
+ /* @__PURE__ */ D("h4", {
1512
1646
  className: "text-sm font-semibold",
1513
1647
  children: n.consoleAccounts
1514
1648
  }),
1515
- /* @__PURE__ */ E(I, {
1516
- client: y,
1649
+ /* @__PURE__ */ D(R, {
1650
+ client: v,
1517
1651
  scope: "tenant",
1518
1652
  locale: r,
1519
1653
  texts: n
1520
1654
  })
1521
1655
  ]
1522
1656
  }),
1523
- g && /* @__PURE__ */ E(b, {
1657
+ g && /* @__PURE__ */ D(x, {
1524
1658
  title: n.consoleRemoveTenant,
1525
1659
  danger: !0,
1526
1660
  onClose: () => _(!1),
1527
1661
  onYes: async () => (await e.platform.removeTenant(t.id), _(!1), await a(), !0),
1528
- children: N(n.consoleRemoveTenantConfirm, { name: t.name })
1662
+ children: P(n.consoleRemoveTenantConfirm, { name: t.name })
1529
1663
  })
1530
1664
  ]
1531
1665
  });
1532
1666
  }
1533
1667
  var $ = (e) => e.toUpperCase().replace(/[^A-Z0-9]/g, "");
1534
- function re({ client: e, t, approve: n, onAnswered: r }) {
1535
- let [i, a] = u(null), [o, l] = u(null), d = s(async () => {
1668
+ function oe({ client: e, t, approve: n, onAnswered: r }) {
1669
+ let [i, a] = d(null), [o, s] = d(null), u = c(async () => {
1536
1670
  try {
1537
1671
  let t = await e.pairingRequests(), r = n ? $(n) : "";
1538
1672
  a([...t].sort((e, t) => Number($(t.code) === r) - Number($(e.code) === r)));
@@ -1540,66 +1674,70 @@ function re({ client: e, t, approve: n, onAnswered: r }) {
1540
1674
  a([]);
1541
1675
  }
1542
1676
  }, [e, n]);
1543
- return c(() => {
1544
- d();
1545
- let e = setInterval(() => void d(), 5e3);
1677
+ return l(() => {
1678
+ u();
1679
+ let e = setInterval(() => void u(), 5e3);
1546
1680
  return () => clearInterval(e);
1547
- }, [d]), !n && !i?.length && !o ? null : /* @__PURE__ */ E(m, {
1681
+ }, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */ D(h, {
1548
1682
  title: t.consoleRequests,
1549
1683
  loading: i === null,
1550
1684
  loaderMinHeight: 80,
1551
- children: /* @__PURE__ */ D("div", {
1685
+ children: /* @__PURE__ */ O("div", {
1552
1686
  className: "flex flex-col gap-3",
1553
1687
  children: [
1554
- /* @__PURE__ */ E("p", {
1688
+ /* @__PURE__ */ D("p", {
1555
1689
  className: "text-sm text-muted-foreground",
1556
1690
  children: t.consoleRequestsHint
1557
1691
  }),
1558
- o && /* @__PURE__ */ E(f, {
1692
+ o && /* @__PURE__ */ D(p, {
1559
1693
  variant: o.variant,
1560
1694
  children: o.text
1561
1695
  }),
1562
- i?.length === 0 && !o && /* @__PURE__ */ E("p", {
1696
+ i?.length === 0 && !o && /* @__PURE__ */ D("p", {
1563
1697
  className: "text-sm text-muted-foreground",
1564
1698
  children: t.consoleRequestsEmpty
1565
1699
  }),
1566
1700
  i?.map((i) => {
1567
1701
  let a = !!n && $(i.code) === $(n), o = async (n) => {
1568
1702
  let a = await e.answerPairing(i.code, n);
1569
- l(n ? {
1703
+ s(n ? {
1570
1704
  variant: "success",
1571
- text: N(t.consoleApproved, { name: a.name })
1705
+ text: P(t.consoleApproved, { name: a.name })
1572
1706
  } : {
1573
1707
  variant: "info",
1574
1708
  text: t.consoleDenied
1575
- }), await d(), await r();
1709
+ }), await u(), await r();
1576
1710
  };
1577
- return /* @__PURE__ */ D("div", {
1711
+ return /* @__PURE__ */ O("div", {
1578
1712
  className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
1579
1713
  children: [
1580
- a && /* @__PURE__ */ E(p, {
1714
+ a && /* @__PURE__ */ D(m, {
1581
1715
  variant: "primary",
1582
1716
  children: t.consoleRequestMatch
1583
1717
  }),
1584
- /* @__PURE__ */ E("div", {
1718
+ /* @__PURE__ */ D("div", {
1585
1719
  className: "font-mono text-2xl font-semibold tracking-widest",
1586
1720
  children: i.code
1587
1721
  }),
1588
- /* @__PURE__ */ E("p", {
1722
+ /* @__PURE__ */ D("p", {
1589
1723
  className: "text-sm",
1590
- children: N(t.consoleRequestFrom, {
1724
+ children: P(t.consoleRequestFrom, {
1591
1725
  name: i.name,
1592
1726
  from: i.from ?? "?",
1593
1727
  at: Q(i.createdAt)
1594
1728
  })
1595
1729
  }),
1596
- /* @__PURE__ */ D("div", {
1730
+ /* @__PURE__ */ D("p", {
1731
+ className: "text-sm text-muted-foreground",
1732
+ children: i.project ? P(t.consoleRequestProject, { project: i.project }) : t.consoleRequestAll
1733
+ }),
1734
+ /* @__PURE__ */ O("div", {
1597
1735
  className: "flex flex-wrap gap-2",
1598
- children: [/* @__PURE__ */ E(v, {
1736
+ children: [/* @__PURE__ */ D(y, {
1599
1737
  label: t.consoleApprove,
1600
1738
  variant: "primary",
1601
1739
  onClick: () => o(!0)
1602
- }), /* @__PURE__ */ E(v, {
1740
+ }), /* @__PURE__ */ D(y, {
1603
1741
  label: t.consoleDeny,
1604
1742
  variant: "outline-danger",
1605
1743
  onClick: () => o(!1)
@@ -1612,6 +1750,6 @@ function re({ client: e, t, approve: n, onAnswered: r }) {
1612
1750
  })
1613
1751
  });
1614
1752
  }
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 };
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 };
1616
1754
 
1617
1755
  //# sourceMappingURL=ui.mjs.map