@llmnative/runner 1.0.2 → 1.1.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
@@ -73,7 +73,7 @@ var k = {
73
73
  addGuided: "Guide me",
74
74
  addGuidedHint: "Step by step instructions to install it by hand.",
75
75
  addExisting: "It is already installed",
76
- addExistingHint: "Its address and a pairing code.",
76
+ addExistingHint: "Its address: you approve on the runner.",
77
77
  addName: "Name",
78
78
  addNamePlaceholder: "Runner Europe 1",
79
79
  addUrl: "Address",
@@ -116,6 +116,26 @@ var k = {
116
116
  consoleRemoveTenant: "Remove tenant",
117
117
  consoleRemoveTenantConfirm: "Remove {name}, its keys and chats?",
118
118
  consoleAccounts: "Accounts",
119
+ pairNext: "Continue",
120
+ pairWaitingTitle: "Approve on the runner",
121
+ pairWaitingHint: "Open the runner and approve the request: check that it shows this same code.",
122
+ pairOpen: "Open the runner to approve",
123
+ pairWaiting: "Waiting for the approval… (until {at})",
124
+ pairDenied: "The request was refused on the runner.",
125
+ pairExpired: "The request expired: ask again.",
126
+ pairAgain: "Ask again",
127
+ pairWithCode: "I have a pairing code",
128
+ pairWithApproval: "Approve on the runner instead",
129
+ consoleRequests: "Requests to connect",
130
+ consoleRequestsHint: "A platform asked to connect to this runner. Approve only if you asked from there and the code is the one it shows.",
131
+ consoleRequestsEmpty: "No requests waiting.",
132
+ consoleRequestFrom: "{name}, from {from}, asked at {at}",
133
+ consoleRequestMatch: "The request you opened",
134
+ consoleApprove: "Approve",
135
+ consoleDeny: "Refuse",
136
+ consoleApproved: "Approved: {name} is connected.",
137
+ consoleDenied: "Refused.",
138
+ consoleRemember: "Remember on this browser",
119
139
  close: "Close",
120
140
  cancel: "Cancel"
121
141
  }, A = {
@@ -187,7 +207,7 @@ var k = {
187
207
  addGuided: "Guidami",
188
208
  addGuidedHint: "Istruzioni passo passo per installarlo a mano.",
189
209
  addExisting: "È già installato",
190
- addExistingHint: "Il suo indirizzo e un codice di abbinamento.",
210
+ addExistingHint: "Il suo indirizzo: approvi sul runner.",
191
211
  addName: "Nome",
192
212
  addNamePlaceholder: "Runner Europa 1",
193
213
  addUrl: "Indirizzo",
@@ -230,6 +250,26 @@ var k = {
230
250
  consoleRemoveTenant: "Rimuovi tenant",
231
251
  consoleRemoveTenantConfirm: "Rimuovere {name}, le sue chiavi e le sue chat?",
232
252
  consoleAccounts: "Account",
253
+ pairNext: "Continua",
254
+ pairWaitingTitle: "Approva sul runner",
255
+ pairWaitingHint: "Apri il runner e approva la richiesta: controlla che mostri questo stesso codice.",
256
+ pairOpen: "Apri il runner per approvare",
257
+ pairWaiting: "In attesa dell'approvazione… (fino alle {at})",
258
+ pairDenied: "La richiesta è stata rifiutata sul runner.",
259
+ pairExpired: "La richiesta è scaduta: chiedi di nuovo.",
260
+ pairAgain: "Chiedi di nuovo",
261
+ pairWithCode: "Ho un codice di abbinamento",
262
+ pairWithApproval: "Approva sul runner invece",
263
+ consoleRequests: "Richieste di collegamento",
264
+ 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.",
265
+ consoleRequestsEmpty: "Nessuna richiesta in attesa.",
266
+ consoleRequestFrom: "{name}, da {from}, alle {at}",
267
+ consoleRequestMatch: "La richiesta che hai aperto",
268
+ consoleApprove: "Approva",
269
+ consoleDeny: "Rifiuta",
270
+ consoleApproved: "Approvata: {name} è collegato.",
271
+ consoleDenied: "Rifiutata.",
272
+ consoleRemember: "Ricorda su questo browser",
233
273
  close: "Chiudi",
234
274
  cancel: "Annulla"
235
275
  }, j = {
@@ -888,7 +928,7 @@ function H({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
888
928
  o("choose"), p(null);
889
929
  }
890
930
  }) }),
891
- a === "automatic" && e.install && /* @__PURE__ */ O(E, { children: [h, /* @__PURE__ */ D(K, {
931
+ a === "automatic" && e.install && /* @__PURE__ */ O(E, { children: [h, /* @__PURE__ */ D(J, {
892
932
  t,
893
933
  localKeys: !!e.localKeys,
894
934
  install: (t, n, r) => e.install({
@@ -910,10 +950,16 @@ function H({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
910
950
  }));
911
951
  }
912
952
  })] }),
913
- a === "existing" && /* @__PURE__ */ D(W, {
953
+ a === "existing" && /* @__PURE__ */ D(K, {
914
954
  t,
915
955
  name: s,
916
956
  nameField: h,
957
+ pairing: e.startPairing && e.pairingStatus ? {
958
+ start: e.startPairing.bind(e),
959
+ status: e.pairingStatus.bind(e)
960
+ } : void 0,
961
+ onAdded: i,
962
+ onError: m,
917
963
  onConnect: async (t, n) => {
918
964
  try {
919
965
  await i(await e.add({
@@ -944,39 +990,129 @@ function U({ title: e, hint: t, onClick: n }) {
944
990
  })]
945
991
  });
946
992
  }
947
- function W({ t: e, nameField: t, onConnect: n }) {
948
- let [r, i] = u(""), [a, o] = u(""), s = /^https?:\/\//.test(r.trim()) ? r.trim() : `https://${r.trim()}`;
949
- return /* @__PURE__ */ O("div", {
993
+ var W = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), G = (e) => new Date(e).toLocaleTimeString(void 0, {
994
+ hour: "2-digit",
995
+ 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);
999
+ return c(() => {
1000
+ if (!y || !r) return;
1001
+ let e = !1, t, n = async () => {
1002
+ try {
1003
+ let t = await r.status(y.id);
1004
+ if (e) return;
1005
+ if (t.status === "approved") {
1006
+ await i(t.runner);
1007
+ return;
1008
+ }
1009
+ if (t.status !== "pending") {
1010
+ S(t.status), b(null);
1011
+ return;
1012
+ }
1013
+ } catch (t) {
1014
+ e || a(t);
1015
+ }
1016
+ e || (t = setTimeout(() => void n(), 2e3));
1017
+ };
1018
+ return t = setTimeout(() => void n(), 2e3), () => {
1019
+ e = !0, clearTimeout(t);
1020
+ };
1021
+ }, [
1022
+ y,
1023
+ r,
1024
+ i,
1025
+ a
1026
+ ]), y ? /* @__PURE__ */ O("div", {
1027
+ className: "flex flex-col gap-3",
1028
+ children: [
1029
+ /* @__PURE__ */ D("h4", {
1030
+ className: "font-semibold",
1031
+ children: e.pairWaitingTitle
1032
+ }),
1033
+ /* @__PURE__ */ D("p", {
1034
+ className: "text-sm text-muted-foreground",
1035
+ children: e.pairWaitingHint
1036
+ }),
1037
+ /* @__PURE__ */ D("div", {
1038
+ className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
1039
+ children: y.code
1040
+ }),
1041
+ /* @__PURE__ */ O("div", {
1042
+ className: "flex flex-wrap items-center gap-2",
1043
+ children: [/* @__PURE__ */ D(d, {
1044
+ icon: "external-link",
1045
+ label: e.pairOpen,
1046
+ variant: "primary",
1047
+ 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
+ })]
1052
+ })
1053
+ ]
1054
+ }) : /* @__PURE__ */ O("div", {
950
1055
  className: "flex flex-col gap-3",
951
1056
  children: [
952
- t,
1057
+ n,
1058
+ x && /* @__PURE__ */ D(f, {
1059
+ variant: x === "denied" ? "danger" : "warning",
1060
+ children: x === "denied" ? e.pairDenied : e.pairExpired
1061
+ }),
953
1062
  /* @__PURE__ */ O(_, {
954
1063
  appearance: "empty",
955
1064
  showNotice: !1,
956
1065
  onSubmit: () => !1,
1066
+ defaultValues: {
1067
+ url: s,
1068
+ code: p
1069
+ },
957
1070
  children: [/* @__PURE__ */ D(C, {
958
1071
  name: "url",
959
1072
  label: e.addUrl,
960
1073
  placeholder: "https://runner.example.com",
961
- onChange: ({ value: e }) => i(String(e ?? ""))
962
- }), /* @__PURE__ */ D(C, {
1074
+ onChange: ({ value: e }) => l(String(e ?? ""))
1075
+ }), h && /* @__PURE__ */ D(C, {
963
1076
  name: "code",
964
1077
  label: e.addCode,
965
1078
  placeholder: "ABCD-EFGH",
966
1079
  autoComplete: "off",
967
- onChange: ({ value: e }) => o(String(e ?? ""))
1080
+ onChange: ({ value: e }) => m(String(e ?? ""))
968
1081
  })]
969
1082
  }),
970
- /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(v, {
971
- label: e.addConnect,
972
- variant: "primary",
973
- disabled: !r.trim() || a.trim().length < 8,
974
- onClick: () => n(s, a.trim())
975
- }) })
1083
+ /* @__PURE__ */ O("div", {
1084
+ className: "flex flex-wrap items-center gap-2",
1085
+ children: [h ? /* @__PURE__ */ D(v, {
1086
+ label: e.addConnect,
1087
+ variant: "primary",
1088
+ disabled: !s.trim() || p.trim().length < 8,
1089
+ onClick: () => o(W(s), p.trim())
1090
+ }) : /* @__PURE__ */ D(v, {
1091
+ label: x ? e.pairAgain : e.pairNext,
1092
+ variant: "primary",
1093
+ disabled: !s.trim(),
1094
+ onClick: async () => {
1095
+ S(null);
1096
+ try {
1097
+ let e = W(s);
1098
+ b(await r.start({
1099
+ name: t.trim() || new URL(e).hostname,
1100
+ url: e
1101
+ }));
1102
+ } catch (e) {
1103
+ a(e);
1104
+ }
1105
+ }
1106
+ }), r && /* @__PURE__ */ D(d, {
1107
+ label: h ? e.pairWithApproval : e.pairWithCode,
1108
+ variant: "link",
1109
+ onClick: () => g((e) => !e)
1110
+ })]
1111
+ })
976
1112
  ]
977
1113
  });
978
1114
  }
979
- var G = [
1115
+ var q = [
980
1116
  "check",
981
1117
  "docker",
982
1118
  "files",
@@ -987,7 +1123,7 @@ var G = [
987
1123
  "tls",
988
1124
  "done"
989
1125
  ];
990
- function K({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
1126
+ function J({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
991
1127
  let [a, o] = u({
992
1128
  host: "",
993
1129
  port: "22",
@@ -1078,8 +1214,8 @@ function K({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
1078
1214
  }),
1079
1215
  f && /* @__PURE__ */ D("div", {
1080
1216
  className: "flex flex-wrap gap-1",
1081
- children: G.map((e) => /* @__PURE__ */ D(p, {
1082
- variant: l === e ? "primary" : G.indexOf(e) < G.indexOf(l ?? "check") ? "success" : "light",
1217
+ children: q.map((e) => /* @__PURE__ */ D(p, {
1218
+ variant: l === e ? "primary" : q.indexOf(e) < q.indexOf(l ?? "check") ? "success" : "light",
1083
1219
  children: e
1084
1220
  }, e))
1085
1221
  }),
@@ -1113,121 +1249,127 @@ function K({ t: e, localKeys: t, install: n, onDone: r, onError: i }) {
1113
1249
  });
1114
1250
  }
1115
1251
  // src/ui/RunnerConsole.tsx
1116
- var q = (e) => (e / 1024 ** 3).toFixed(1), J = (e) => new Date(e).toLocaleString(void 0, {
1252
+ var Y = (e) => (e / 1024 ** 3).toFixed(1), X = (e) => new Date(e).toLocaleString(void 0, {
1117
1253
  dateStyle: "short",
1118
1254
  timeStyle: "short"
1119
1255
  });
1120
- function Y({ client: t, locale: n, texts: r, onSignOut: i }) {
1121
- let a = M(n, r), [o, l] = u(null), [p, y] = u(null), [b, x] = u(null), [S, w] = u({
1256
+ function Z({ client: t, locale: n, texts: r, onSignOut: i, approve: a }) {
1257
+ let o = M(n, r), [l, p] = u(null), [y, b] = u(null), [x, S] = u(null), [w, T] = u({
1122
1258
  id: "",
1123
1259
  name: ""
1124
- }), [T, E] = u(null), k = s(async () => {
1260
+ }), [E, k] = u(null), A = s(async () => {
1125
1261
  try {
1126
- l(await t.platform.status()), y(null);
1262
+ p(await t.platform.status()), b(null);
1127
1263
  } catch (t) {
1128
- y(N(a.error, { error: t instanceof e ? t.code : String(t) }));
1264
+ b(N(o.error, { error: t instanceof e ? t.code : String(t) }));
1129
1265
  }
1130
- }, [t, a]);
1266
+ }, [t, o]);
1131
1267
  return c(() => {
1132
- k();
1133
- }, [k]), /* @__PURE__ */ O("div", {
1268
+ A();
1269
+ }, [A]), /* @__PURE__ */ O("div", {
1134
1270
  className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
1135
1271
  children: [
1136
1272
  /* @__PURE__ */ O("div", {
1137
1273
  className: "flex items-center gap-2",
1138
1274
  children: [/* @__PURE__ */ D("h1", {
1139
1275
  className: "flex-1 text-xl font-semibold",
1140
- children: a.consoleTitle
1276
+ children: o.consoleTitle
1141
1277
  }), i && /* @__PURE__ */ D(d, {
1142
1278
  icon: "log-out",
1143
- label: a.consoleSignOut,
1279
+ label: o.consoleSignOut,
1144
1280
  variant: "outline-secondary",
1145
1281
  onClick: i
1146
1282
  })]
1147
1283
  }),
1148
- p && /* @__PURE__ */ D(f, {
1284
+ y && /* @__PURE__ */ D(f, {
1149
1285
  variant: "danger",
1150
- children: p
1286
+ children: y
1287
+ }),
1288
+ /* @__PURE__ */ D(ee, {
1289
+ client: t,
1290
+ t: o,
1291
+ approve: a,
1292
+ onAnswered: A
1151
1293
  }),
1152
1294
  /* @__PURE__ */ D(m, {
1153
- title: a.consoleStatus,
1154
- loading: !o && !p,
1295
+ title: o.consoleStatus,
1296
+ loading: !l && !y,
1155
1297
  loaderMinHeight: 100,
1156
- children: o && /* @__PURE__ */ D(g, { items: [
1298
+ children: l && /* @__PURE__ */ D(g, { items: [
1157
1299
  {
1158
1300
  label: "Version",
1159
- value: o.version
1301
+ value: l.version
1160
1302
  },
1161
1303
  {
1162
1304
  label: "URL",
1163
- value: o.url
1305
+ value: l.url
1164
1306
  },
1165
1307
  {
1166
1308
  label: "Chats",
1167
- value: `${o.load.chats} / ${o.load.maxChats}`
1309
+ value: `${l.load.chats} / ${l.load.maxChats}`
1168
1310
  },
1169
1311
  {
1170
1312
  label: "Machine",
1171
- value: N(a.consoleMachine, {
1172
- memory: q(o.machine.availableBytes),
1173
- total: q(o.machine.totalBytes),
1174
- cpus: o.machine.cpus
1313
+ value: N(o.consoleMachine, {
1314
+ memory: Y(l.machine.availableBytes),
1315
+ total: Y(l.machine.totalBytes),
1316
+ cpus: l.machine.cpus
1175
1317
  })
1176
1318
  },
1177
1319
  {
1178
1320
  label: "Agent",
1179
- value: o.agentImage
1321
+ value: l.agentImage
1180
1322
  }
1181
1323
  ] })
1182
1324
  }),
1183
1325
  /* @__PURE__ */ D(m, {
1184
- title: a.consolePairing,
1326
+ title: o.consolePairing,
1185
1327
  children: /* @__PURE__ */ O("div", {
1186
1328
  className: "flex flex-col gap-2",
1187
1329
  children: [
1188
1330
  /* @__PURE__ */ D("p", {
1189
1331
  className: "text-sm text-muted-foreground",
1190
- children: a.consolePairingHint
1332
+ children: o.consolePairingHint
1191
1333
  }),
1192
- b && /* @__PURE__ */ D(h, {
1334
+ x && /* @__PURE__ */ D(h, {
1193
1335
  showCopy: !0,
1194
- children: b.code
1336
+ children: x.code
1195
1337
  }),
1196
- b && /* @__PURE__ */ D("p", {
1338
+ x && /* @__PURE__ */ D("p", {
1197
1339
  className: "text-xs text-muted-foreground",
1198
- children: N(a.consoleCode, {
1199
- code: b.code,
1200
- at: J(b.expiresAt)
1340
+ children: N(o.consoleCode, {
1341
+ code: x.code,
1342
+ at: X(x.expiresAt)
1201
1343
  })
1202
1344
  }),
1203
1345
  /* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(v, {
1204
- label: a.consoleNewCode,
1346
+ label: o.consoleNewCode,
1205
1347
  variant: "outline-primary",
1206
- onClick: async () => x(await t.createPairing())
1348
+ onClick: async () => S(await t.createPairing())
1207
1349
  }) })
1208
1350
  ]
1209
1351
  })
1210
1352
  }),
1211
1353
  /* @__PURE__ */ D(m, {
1212
- title: a.consoleTenants,
1354
+ title: o.consoleTenants,
1213
1355
  children: /* @__PURE__ */ O("div", {
1214
1356
  className: "flex flex-col gap-3",
1215
1357
  children: [
1216
- T && /* @__PURE__ */ D(f, {
1358
+ E && /* @__PURE__ */ D(f, {
1217
1359
  variant: "warning",
1218
- onClose: () => E(null),
1360
+ onClose: () => k(null),
1219
1361
  children: /* @__PURE__ */ D("span", {
1220
1362
  className: "break-all",
1221
- children: N(a.consoleKeyShown, { key: T })
1363
+ children: N(o.consoleKeyShown, { key: E })
1222
1364
  })
1223
1365
  }),
1224
- o?.tenants.map((e) => /* @__PURE__ */ D(X, {
1366
+ l?.tenants.map((e) => /* @__PURE__ */ D(Q, {
1225
1367
  client: t,
1226
1368
  tenant: e,
1227
- t: a,
1369
+ t: o,
1228
1370
  locale: n,
1229
- onKey: E,
1230
- onChange: k
1371
+ onKey: k,
1372
+ onChange: A
1231
1373
  }, e.id)),
1232
1374
  /* @__PURE__ */ D(_, {
1233
1375
  appearance: "empty",
@@ -1238,32 +1380,32 @@ function Y({ client: t, locale: n, texts: r, onSignOut: i }) {
1238
1380
  children: [
1239
1381
  /* @__PURE__ */ D(C, {
1240
1382
  name: "tenantId",
1241
- label: a.consoleTenantId,
1383
+ label: o.consoleTenantId,
1242
1384
  placeholder: "acme",
1243
- onChange: ({ value: e }) => w((t) => ({
1385
+ onChange: ({ value: e }) => T((t) => ({
1244
1386
  ...t,
1245
1387
  id: String(e ?? "")
1246
1388
  }))
1247
1389
  }),
1248
1390
  /* @__PURE__ */ D(C, {
1249
1391
  name: "tenantName",
1250
- label: a.consoleTenantName,
1392
+ label: o.consoleTenantName,
1251
1393
  placeholder: "Acme",
1252
- onChange: ({ value: e }) => w((t) => ({
1394
+ onChange: ({ value: e }) => T((t) => ({
1253
1395
  ...t,
1254
1396
  name: String(e ?? "")
1255
1397
  }))
1256
1398
  }),
1257
1399
  /* @__PURE__ */ D(v, {
1258
- label: a.consoleCreate,
1400
+ label: o.consoleCreate,
1259
1401
  variant: "primary",
1260
- disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(S.id),
1402
+ disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(w.id),
1261
1403
  onClick: async () => {
1262
1404
  try {
1263
- let e = await t.platform.createTenant(S.id, { name: S.name || void 0 });
1264
- e.key && E(e.key), await k();
1405
+ let e = await t.platform.createTenant(w.id, { name: w.name || void 0 });
1406
+ e.key && k(e.key), await A();
1265
1407
  } catch (t) {
1266
- y(N(a.error, { error: t instanceof e ? t.code : String(t) }));
1408
+ b(N(o.error, { error: t instanceof e ? t.code : String(t) }));
1267
1409
  }
1268
1410
  }
1269
1411
  })
@@ -1276,7 +1418,7 @@ function Y({ client: t, locale: n, texts: r, onSignOut: i }) {
1276
1418
  ]
1277
1419
  });
1278
1420
  }
1279
- function X({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1421
+ function Q({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1280
1422
  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]);
1281
1423
  return c(() => {
1282
1424
  o && x();
@@ -1380,6 +1522,88 @@ function X({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
1380
1522
  ]
1381
1523
  });
1382
1524
  }
1383
- export { H as AddRunner, B as InstallGuide, I as RunnerAccounts, Y as RunnerConsole, V as RunnersSettings, N as fill, j as runnerTexts, M as textsFor };
1525
+ var $ = (e) => e.toUpperCase().replace(/[^A-Z0-9]/g, "");
1526
+ function ee({ client: e, t, approve: n, onAnswered: r }) {
1527
+ let [i, a] = u(null), [o, l] = u(null), d = s(async () => {
1528
+ try {
1529
+ let t = await e.pairingRequests(), r = n ? $(n) : "";
1530
+ a([...t].sort((e, t) => Number($(t.code) === r) - Number($(e.code) === r)));
1531
+ } catch {
1532
+ a([]);
1533
+ }
1534
+ }, [e, n]);
1535
+ return c(() => {
1536
+ d();
1537
+ let e = setInterval(() => void d(), 5e3);
1538
+ return () => clearInterval(e);
1539
+ }, [d]), !n && !i?.length && !o ? null : /* @__PURE__ */ D(m, {
1540
+ title: t.consoleRequests,
1541
+ loading: i === null,
1542
+ loaderMinHeight: 80,
1543
+ children: /* @__PURE__ */ O("div", {
1544
+ className: "flex flex-col gap-3",
1545
+ children: [
1546
+ /* @__PURE__ */ D("p", {
1547
+ className: "text-sm text-muted-foreground",
1548
+ children: t.consoleRequestsHint
1549
+ }),
1550
+ o && /* @__PURE__ */ D(f, {
1551
+ variant: o.variant,
1552
+ children: o.text
1553
+ }),
1554
+ i?.length === 0 && !o && /* @__PURE__ */ D("p", {
1555
+ className: "text-sm text-muted-foreground",
1556
+ children: t.consoleRequestsEmpty
1557
+ }),
1558
+ i?.map((i) => {
1559
+ let a = !!n && $(i.code) === $(n), o = async (n) => {
1560
+ let a = await e.answerPairing(i.code, n);
1561
+ l(n ? {
1562
+ variant: "success",
1563
+ text: N(t.consoleApproved, { name: a.name })
1564
+ } : {
1565
+ variant: "info",
1566
+ text: t.consoleDenied
1567
+ }), await d(), await r();
1568
+ };
1569
+ return /* @__PURE__ */ O("div", {
1570
+ className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
1571
+ children: [
1572
+ a && /* @__PURE__ */ D(p, {
1573
+ variant: "primary",
1574
+ children: t.consoleRequestMatch
1575
+ }),
1576
+ /* @__PURE__ */ D("div", {
1577
+ className: "font-mono text-2xl font-semibold tracking-widest",
1578
+ children: i.code
1579
+ }),
1580
+ /* @__PURE__ */ D("p", {
1581
+ className: "text-sm",
1582
+ children: N(t.consoleRequestFrom, {
1583
+ name: i.name,
1584
+ from: i.from ?? "?",
1585
+ at: X(i.createdAt)
1586
+ })
1587
+ }),
1588
+ /* @__PURE__ */ O("div", {
1589
+ className: "flex flex-wrap gap-2",
1590
+ children: [/* @__PURE__ */ D(v, {
1591
+ label: t.consoleApprove,
1592
+ variant: "primary",
1593
+ onClick: () => o(!0)
1594
+ }), /* @__PURE__ */ D(v, {
1595
+ label: t.consoleDeny,
1596
+ variant: "outline-danger",
1597
+ onClick: () => o(!1)
1598
+ })]
1599
+ })
1600
+ ]
1601
+ }, i.code);
1602
+ })
1603
+ ]
1604
+ })
1605
+ });
1606
+ }
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 };
1384
1608
 
1385
1609
  //# sourceMappingURL=ui.mjs.map