@kukeon/console 0.0.0-stage → 0.10.0-edge.gaa95c2af

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.
Files changed (101) hide show
  1. package/dist/assignments-Biqg1AT0.js +257 -0
  2. package/dist/assignments-tab.d.ts +4 -0
  3. package/dist/assignments.d.mts +40 -0
  4. package/dist/auth.d.ts +39 -0
  5. package/dist/bulk-ui.d.ts +49 -0
  6. package/dist/bulk.d.mts +14 -0
  7. package/dist/catalog-ChPGZP2a.js +1949 -0
  8. package/dist/catalog-url-Dr9e92Yq.js +19 -0
  9. package/dist/catalog-url.d.mts +4 -0
  10. package/dist/catalog.d.ts +40 -0
  11. package/dist/cell-filter.d.ts +10 -0
  12. package/dist/cell-sidebar.d.ts +26 -0
  13. package/dist/cells.d.mts +29 -0
  14. package/dist/cgroup-format.d.ts +17 -0
  15. package/dist/cgroup.d.ts +4 -0
  16. package/dist/config-form.d.mts +66 -0
  17. package/dist/connector-ui-CG9kLZ5s.js +2716 -0
  18. package/dist/connector-ui.d.ts +129 -0
  19. package/dist/connectors-page-C8459TcH.js +241 -0
  20. package/dist/connectors-page.d.ts +8 -0
  21. package/dist/connectors.d.mts +154 -0
  22. package/dist/container-log.d.ts +11 -0
  23. package/dist/create.d.ts +11 -0
  24. package/dist/creation-schema.d.mts +15 -0
  25. package/dist/daemon-DxP5hn4p.js +394 -0
  26. package/dist/daemon.d.ts +24 -0
  27. package/dist/display-name.d.ts +10 -0
  28. package/dist/drift-diff.d.ts +4 -0
  29. package/dist/exec.d.ts +15 -0
  30. package/dist/extensions.d.ts +111 -0
  31. package/dist/get-started.d.ts +9 -0
  32. package/dist/health.d.ts +22 -0
  33. package/dist/identities-page-CJ_ukj0Q.js +2137 -0
  34. package/dist/identities-page.d.ts +15 -0
  35. package/dist/identities.d.mts +24 -0
  36. package/dist/image-format.d.ts +6 -0
  37. package/dist/image-inventory.d.ts +12 -0
  38. package/dist/images.d.ts +5 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +5241 -0
  41. package/dist/initialize-CAOkMhlL.js +146 -0
  42. package/dist/initialize.d.ts +21 -0
  43. package/dist/inventory.d.ts +66 -0
  44. package/dist/lifecycle-policy.d.ts +11 -0
  45. package/dist/lifecycle.d.ts +24 -0
  46. package/dist/log-buffer.d.ts +8 -0
  47. package/dist/main.d.ts +13 -0
  48. package/dist/majordomo-CikLz0g9.js +3064 -0
  49. package/dist/majordomo.d.ts +102 -0
  50. package/dist/manage-nav.d.ts +4 -0
  51. package/dist/manifest-diff.d.mts +11 -0
  52. package/dist/merged-values-CBzWsNOS.js +739 -0
  53. package/dist/merged-values.d.ts +24 -0
  54. package/dist/network-format.d.ts +30 -0
  55. package/dist/network.d.ts +13 -0
  56. package/dist/new-agent-BweyzBnY.js +201 -0
  57. package/dist/new-agent.d.ts +27 -0
  58. package/dist/new-cell-Iceq2Zfv.js +1985 -0
  59. package/dist/new-cell.d.ts +29 -0
  60. package/dist/new-config-C9NSC9Ou.js +1541 -0
  61. package/dist/new-config.d.ts +7 -0
  62. package/dist/notifications.d.ts +26 -0
  63. package/dist/onboarding-oZBJXTy0.js +395 -0
  64. package/dist/onboarding.d.mts +40 -0
  65. package/dist/panel-cells.d.mts +8 -0
  66. package/dist/registry-credentials.d.ts +13 -0
  67. package/dist/relationships.d.mts +12 -0
  68. package/dist/request.d.ts +16 -0
  69. package/dist/router.d.ts +12 -0
  70. package/dist/routes.d.ts +43 -0
  71. package/dist/schedule-DzQ3Homi.js +113 -0
  72. package/dist/schedule-format.d.mts +9 -0
  73. package/dist/schedule.d.ts +16 -0
  74. package/dist/scope-actions.d.ts +9 -0
  75. package/dist/screens.d.ts +6 -0
  76. package/dist/secret-form.d.ts +24 -0
  77. package/dist/settings-nav.d.ts +5 -0
  78. package/dist/settings-page.d.ts +4 -0
  79. package/dist/settings-values.d.mts +18 -0
  80. package/dist/settings.d.ts +50 -0
  81. package/dist/sidebar-shell.d.ts +55 -0
  82. package/dist/sources-page-CxMSM-sz.js +423 -0
  83. package/dist/sources-page.d.ts +5 -0
  84. package/dist/space-subnets.d.ts +3 -0
  85. package/dist/style.css +2 -0
  86. package/dist/team-form.d.mts +56 -0
  87. package/dist/team-plan-CFOIv1lN.js +735 -0
  88. package/dist/team-plan.d.ts +22 -0
  89. package/dist/team-wizard.d.ts +8 -0
  90. package/dist/teams-page-C6UGy4Fw.js +2216 -0
  91. package/dist/teams-page.d.ts +9 -0
  92. package/dist/teams.d.mts +114 -0
  93. package/dist/terminal-palette.d.ts +8 -0
  94. package/dist/terminal.d.ts +98 -0
  95. package/dist/unread.d.mts +19 -0
  96. package/dist/use-unread.d.ts +4 -0
  97. package/dist/user-menu.d.ts +7 -0
  98. package/dist/views.d.mts +8 -0
  99. package/dist/workbench.d.ts +16 -0
  100. package/package.json +45 -4
  101. package/README.md +0 -3
@@ -0,0 +1,1949 @@
1
+ import { $ as e, A as t, An as n, At as r, Dn as i, E as a, H as o, J as s, Kn as c, Lt as l, M as u, Mt as d, N as f, On as p, Rn as m, Tn as h, U as g, Un as _, W as v, Yt as y, Z as b, c as x, d as ee, f as S, h as C, j as w, jn as te, p as T, t as E, u as ne, v as D, w as O, wn as k, y as A } from "./connector-ui-CG9kLZ5s.js";
2
+ import { D as j, F as M, I as N, M as P, N as F, S as re, b as ie, k as ae, z as I } from "./onboarding-oZBJXTy0.js";
3
+ import { n as oe, t as L } from "./catalog-url-Dr9e92Yq.js";
4
+ import { H as se, s as ce, t as le } from "./majordomo-CikLz0g9.js";
5
+ import { a as ue, i as R, n as de, s as fe, t as pe } from "./schedule-DzQ3Homi.js";
6
+ import { useEffect as me, useLayoutEffect as he, useRef as z, useState as B } from "react";
7
+ import { apiFetch as V } from "@kukeon/api-client";
8
+ import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
9
+ import { DocumentRowLink as ge, RowAction as G, RowActions as _e, ScopePath as ve, StateBadge as ye, useModalDialog as be } from "@kukeon/ui";
10
+ // src/secret-form.tsx
11
+ function xe({ scope: e, existing: r, onSaved: o, onCancel: s }) {
12
+ let c = !!r, [d, f] = B(() => y(r)), [m, h] = B(!1), [g, v] = B(), [b, x] = B(), { notify: ee } = t(), S = (e) => {
13
+ f((t) => ({
14
+ ...t,
15
+ ...e
16
+ })), v(void 0), x(void 0);
17
+ }, w = c ? r.metadata.name : d.name.trim(), T = e.join(" / ");
18
+ async function E(t) {
19
+ if (t.preventDefault(), m) return;
20
+ let n = e[0] ? i(d, c) : ["Choose where the Secret is stored."];
21
+ if (n.length) {
22
+ v({
23
+ code: "invalid_request",
24
+ message: n.join(" ")
25
+ });
26
+ return;
27
+ }
28
+ let r = JSON.stringify(p(d, c)), s = [...e, w];
29
+ f((e) => l(e)), h(!0), v(void 0), x(void 0);
30
+ try {
31
+ let e = await O(L("secrets", s), r);
32
+ ee({
33
+ key: `secret:${JSON.stringify(s)}`,
34
+ tone: "success",
35
+ message: `Secret ${e.name} ${e.action === "updated" ? "replaced" : "created"} in ${T}.`,
36
+ link: {
37
+ href: u("secrets", s),
38
+ label: "Open Secret"
39
+ }
40
+ }), c || f(y()), o(s, e.action);
41
+ } catch (e) {
42
+ let t = a(e);
43
+ t.code === "already_exists" && x(s), v(t);
44
+ } finally {
45
+ h(!1);
46
+ }
47
+ }
48
+ return /* @__PURE__ */ W("form", {
49
+ className: "creation-form identity-form secret-form",
50
+ "aria-label": c ? `Replace value of secret ${w}` : "New Secret",
51
+ method: "post",
52
+ autoComplete: "off",
53
+ onSubmit: E,
54
+ children: [
55
+ /* @__PURE__ */ U("h3", { children: c ? `Replace value of ${w}` : "Secret" }),
56
+ /* @__PURE__ */ W("p", {
57
+ className: "description",
58
+ children: [c ? /* @__PURE__ */ W(H, { children: [
59
+ "Replaces the value stored under ",
60
+ /* @__PURE__ */ U("code", { children: w }),
61
+ " in ",
62
+ T,
63
+ ". The name, scope and type stay; only the material changes."
64
+ ] }) : /* @__PURE__ */ W(H, { children: [
65
+ "Stored untagged",
66
+ T && /* @__PURE__ */ W(H, { children: [" in ", T] }),
67
+ ". A Secret for a connector is created from that connector's page."
68
+ ] }), " Values are write-only: they are sent once and never shown again."]
69
+ }),
70
+ c && /* @__PURE__ */ U("p", {
71
+ className: "secret-running-note",
72
+ role: "note",
73
+ children: "Running cells keep the value they started with. A cell reads the new value when its containers are created again; a restart re-reads only Secrets delivered as environment variables."
74
+ }),
75
+ /* @__PURE__ */ W("div", {
76
+ className: "schema-fields",
77
+ children: [/* @__PURE__ */ W("label", {
78
+ className: "schema-field",
79
+ children: [/* @__PURE__ */ W("span", { children: ["Name", !c && /* @__PURE__ */ U("b", {
80
+ "aria-label": "required",
81
+ children: " *"
82
+ })] }), /* @__PURE__ */ U("input", {
83
+ value: c ? w : d.name,
84
+ disabled: m || c,
85
+ autoComplete: "off",
86
+ spellCheck: !1,
87
+ onChange: (e) => S({ name: e.target.value })
88
+ })]
89
+ }), /* @__PURE__ */ W("label", {
90
+ className: "schema-field",
91
+ children: [/* @__PURE__ */ U("span", { children: "Type" }), c ? /* @__PURE__ */ U("input", {
92
+ value: n(r),
93
+ disabled: !0,
94
+ readOnly: !0
95
+ }) : /* @__PURE__ */ U("select", {
96
+ value: d.type,
97
+ disabled: m,
98
+ onChange: (e) => S({ type: e.target.value }),
99
+ children: te.map((e) => /* @__PURE__ */ U("option", { children: e }, e))
100
+ })]
101
+ })]
102
+ }),
103
+ /* @__PURE__ */ U(C, {
104
+ type: d.type,
105
+ form: d,
106
+ set: S,
107
+ pending: m
108
+ }),
109
+ /* @__PURE__ */ W("div", {
110
+ className: "connector-actions",
111
+ children: [/* @__PURE__ */ U("button", {
112
+ type: "submit",
113
+ disabled: m,
114
+ children: m ? "Saving…" : c ? "Replace value" : "Create Secret"
115
+ }), s && /* @__PURE__ */ U("button", {
116
+ type: "button",
117
+ className: "subtle-button",
118
+ disabled: m,
119
+ onClick: s,
120
+ children: "Cancel"
121
+ })]
122
+ }),
123
+ b ? /* @__PURE__ */ W("div", {
124
+ className: "error",
125
+ role: "alert",
126
+ children: [/* @__PURE__ */ U("strong", { children: "Secret already exists" }), /* @__PURE__ */ W("p", { children: [
127
+ "A Secret named ",
128
+ /* @__PURE__ */ U("code", { children: b.at(-1) }),
129
+ " is already stored in ",
130
+ b.slice(0, -1).join(" / "),
131
+ ". Nothing was written. ",
132
+ /* @__PURE__ */ U("a", {
133
+ href: u("secrets", b),
134
+ children: "Open it"
135
+ }),
136
+ " to replace its value."
137
+ ] })]
138
+ }) : g && /* @__PURE__ */ U(_, {
139
+ error: g,
140
+ kind: "Secret"
141
+ })
142
+ ]
143
+ });
144
+ }
145
+ function Se({ inventory: e, onChanged: t }) {
146
+ let [n, i] = B({ realm: "" });
147
+ return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
148
+ className: "detail-actions",
149
+ children: /* @__PURE__ */ U("a", {
150
+ href: d("/secrets"),
151
+ children: "← Back to secrets"
152
+ })
153
+ }), /* @__PURE__ */ U("section", {
154
+ className: "panel new-secret-panel",
155
+ "aria-label": "New Secret",
156
+ children: /* @__PURE__ */ W("div", {
157
+ className: "panel-body",
158
+ children: [/* @__PURE__ */ U(S, {
159
+ title: "Stored in",
160
+ description: "The Realm, Space or Stack the Secret belongs to. Cells reference it there through secretRef.",
161
+ children: /* @__PURE__ */ U(T, {
162
+ label: "Secret scope",
163
+ inventory: e,
164
+ levels: k,
165
+ value: n,
166
+ onChange: i
167
+ })
168
+ }), /* @__PURE__ */ U(xe, {
169
+ scope: h(n),
170
+ onSaved: (e) => {
171
+ t(), r(u("secrets", e));
172
+ },
173
+ onCancel: () => {
174
+ r(d("/secrets"));
175
+ }
176
+ }, JSON.stringify(h(n)))]
177
+ })
178
+ })] });
179
+ }
180
+ // src/display-name.tsx
181
+ async function Ce(e, t) {
182
+ let n = await V(e, {
183
+ method: "POST",
184
+ headers: {
185
+ "Content-Type": "application/json",
186
+ Accept: "application/json"
187
+ },
188
+ body: JSON.stringify(t)
189
+ }), r = {};
190
+ try {
191
+ r = await n.json();
192
+ } catch {}
193
+ if (!n.ok) throw Error(r.error?.message ?? `Request failed (HTTP ${n.status})`);
194
+ return r;
195
+ }
196
+ function we(e) {
197
+ let t = e?.annotations;
198
+ return t && typeof t == "object" ? t : void 0;
199
+ }
200
+ async function Te(e, t) {
201
+ return we((await Ce("/configs/display-name", {
202
+ config: {
203
+ name: e.name,
204
+ realm: e.realm,
205
+ ...e.space ? { space: e.space } : {},
206
+ ...e.stack ? { stack: e.stack } : {}
207
+ },
208
+ displayName: t
209
+ })).config);
210
+ }
211
+ async function Ee(e, t) {
212
+ return we((await Ce(`${w(e)}/display-name`, { displayName: t })).cell);
213
+ }
214
+ function De({ subject: e, current: t, onSave: n }) {
215
+ let [r, i] = B(!1), [a, o] = B(t), [s, c] = B(!1), [l, u] = B(""), d = z(null);
216
+ if (me(() => {
217
+ r && d.current?.focus();
218
+ }, [r]), !r) return /* @__PURE__ */ U("button", {
219
+ type: "button",
220
+ className: "subtle-button rename-action",
221
+ "aria-label": `Rename ${e}`,
222
+ onClick: () => {
223
+ o(t), u(""), i(!0);
224
+ },
225
+ children: "Rename"
226
+ });
227
+ let f = re(a);
228
+ async function p() {
229
+ if (!(s || f)) {
230
+ c(!0), u("");
231
+ try {
232
+ await n(a.trim()), i(!1);
233
+ } catch (e) {
234
+ u(e instanceof Error ? e.message : "The request could not reach the web server.");
235
+ } finally {
236
+ c(!1);
237
+ }
238
+ }
239
+ }
240
+ return /* @__PURE__ */ W("form", {
241
+ className: "rename-form",
242
+ "aria-label": `Rename ${e}`,
243
+ onSubmit: (e) => {
244
+ e.preventDefault(), p();
245
+ },
246
+ children: [
247
+ /* @__PURE__ */ W("label", { children: ["Display name", /* @__PURE__ */ U("input", {
248
+ ref: d,
249
+ type: "text",
250
+ value: a,
251
+ maxLength: 63,
252
+ placeholder: "Leave empty to clear",
253
+ onChange: (e) => o(e.target.value),
254
+ onKeyDown: (e) => {
255
+ e.key === "Escape" && i(!1);
256
+ }
257
+ })] }),
258
+ /* @__PURE__ */ U("button", {
259
+ type: "submit",
260
+ className: "primary-action",
261
+ disabled: s || !!f,
262
+ children: s ? "Saving…" : "Save"
263
+ }),
264
+ /* @__PURE__ */ U("button", {
265
+ type: "button",
266
+ className: "subtle-button",
267
+ disabled: s,
268
+ onClick: () => i(!1),
269
+ children: "Cancel"
270
+ }),
271
+ (f || l) && /* @__PURE__ */ U("p", {
272
+ className: "error",
273
+ role: "alert",
274
+ children: f || l
275
+ })
276
+ ]
277
+ });
278
+ }
279
+ var K = (e) => Array.isArray(e) ? e : [];
280
+ function Oe(e, t, n) {
281
+ let r = K(e).filter((e) => e !== t);
282
+ return n ? [...r, t] : r;
283
+ }
284
+ function ke(e, t) {
285
+ let n = new Set(K(t)), r = K(e).filter((e) => n.has(e));
286
+ return r.length === K(e).length ? e : r;
287
+ }
288
+ function Ae(e, t) {
289
+ let n = new Set(K(e)), r = K(t).filter((e) => n.has(e)).length;
290
+ return r ? r === K(t).length ? "all" : "some" : "none";
291
+ }
292
+ function je(e, t) {
293
+ let n = K(t);
294
+ if (Ae(e, n) === "all") {
295
+ let t = new Set(n);
296
+ return K(e).filter((e) => !t.has(e));
297
+ }
298
+ return [.../* @__PURE__ */ new Set([...K(e), ...n])];
299
+ }
300
+ var Me = "inside kuke-system, where kukeond runs: act on it on its own";
301
+ function Ne(e, t) {
302
+ let n = [], r = [];
303
+ for (let i of K(e)) {
304
+ let e = se(K(i?.scope)) ? Me : t(i) || "";
305
+ e ? r.push({
306
+ row: i,
307
+ reason: e
308
+ }) : n.push(i);
309
+ }
310
+ return {
311
+ targets: n,
312
+ skipped: r
313
+ };
314
+ }
315
+ function Pe(e, t, n) {
316
+ return K(t).filter((t) => Ne(e, (e) => n(e, t)).targets.length > 0);
317
+ }
318
+ async function Fe(e, t, n = 4) {
319
+ let r = K(e), i = Array(r.length), a = 0;
320
+ return await Promise.all(Array.from({ length: Math.max(1, Math.min(n, r.length)) }, async () => {
321
+ for (; a < r.length;) {
322
+ let e = a++;
323
+ try {
324
+ let n = await t(r[e]);
325
+ i[e] = {
326
+ item: r[e],
327
+ ok: n?.ok === !0,
328
+ message: n?.message ?? ""
329
+ };
330
+ } catch (t) {
331
+ i[e] = {
332
+ item: r[e],
333
+ ok: !1,
334
+ message: t instanceof Error ? t.message : String(t)
335
+ };
336
+ }
337
+ }
338
+ })), i;
339
+ }
340
+ function Ie(e, t, n, r = 0) {
341
+ let i = K(n).filter((e) => e.ok).length, a = K(n).length - i, o = [`${e}: ${i} of ${K(n).length} ${t} done`];
342
+ return a && o.push(`${a} failed`), r && o.push(`${r} skipped`), {
343
+ tone: a ? "error" : "success",
344
+ message: `${o.join(", ")}.`
345
+ };
346
+ }
347
+ function Le(e, t) {
348
+ return `purge ${e} ${t}`;
349
+ }
350
+ function Re(e, t, n = `${t}s`) {
351
+ return `${e} ${e === 1 ? t : n}`;
352
+ }
353
+ // src/bulk-ui.tsx
354
+ function ze(e, t) {
355
+ let [n, r] = B([]), i = e.join("\n");
356
+ return me(() => {
357
+ t && r((t) => ke(t, e));
358
+ }, [i, t]), {
359
+ selected: n,
360
+ has: (e) => n.includes(e),
361
+ toggle: (e, t) => r((n) => Oe(n, e, t)),
362
+ toggleAll: (e) => r((t) => je(t, e)),
363
+ state: (e) => Ae(n, e),
364
+ clear: () => r([])
365
+ };
366
+ }
367
+ function Be({ selection: e, matching: t, label: n }) {
368
+ let r = z(null), i = e.state(t);
369
+ return he(() => {
370
+ r.current && (r.current.indeterminate = i === "some");
371
+ }, [i]), /* @__PURE__ */ U("input", {
372
+ ref: r,
373
+ type: "checkbox",
374
+ className: "bulk-check",
375
+ "aria-label": n,
376
+ checked: i === "all",
377
+ disabled: !t.length,
378
+ onChange: () => e.toggleAll(t)
379
+ });
380
+ }
381
+ function Ve({ selection: e, rowKey: t, label: n }) {
382
+ return /* @__PURE__ */ U("input", {
383
+ type: "checkbox",
384
+ className: "bulk-check",
385
+ "aria-label": n,
386
+ checked: e.has(t),
387
+ onChange: (n) => e.toggle(t, n.target.checked)
388
+ });
389
+ }
390
+ var He = (e) => e(2).replace(/^2 /, "");
391
+ function Ue({ action: e, targets: t, skipped: n, noun: r, onCancel: i, onConfirm: a }) {
392
+ let o = z(null), [s, c] = B(!1), [l, u] = B(""), [d, f] = B(!1), [p, m] = B(!1);
393
+ be(o);
394
+ let h = r(t.length), g = Le(t.length, h.replace(/^\d+ /, "")), _ = e.purge ? l.trim() === g : !e.acknowledgment || s;
395
+ return /* @__PURE__ */ U("dialog", {
396
+ className: `cell-action-dialog bulk-dialog${e.purge ? " is-purge" : ""}`,
397
+ ref: o,
398
+ "aria-labelledby": "bulk-dialog-title",
399
+ "aria-describedby": "bulk-dialog-description",
400
+ onCancel: (e) => {
401
+ e.preventDefault(), i();
402
+ },
403
+ onClick: (e) => {
404
+ e.target === e.currentTarget && i();
405
+ },
406
+ children: /* @__PURE__ */ W("form", {
407
+ onSubmit: (e) => {
408
+ e.preventDefault(), _ && a({
409
+ force: d,
410
+ cascade: p
411
+ });
412
+ },
413
+ children: [
414
+ /* @__PURE__ */ W("h2", {
415
+ id: "bulk-dialog-title",
416
+ children: [
417
+ e.verb,
418
+ " ",
419
+ h
420
+ ]
421
+ }),
422
+ /* @__PURE__ */ W("p", {
423
+ id: "bulk-dialog-description",
424
+ children: [e.consequence, " Each one runs through its own request; a failure is listed and does not stop the rest."]
425
+ }),
426
+ /* @__PURE__ */ W("dl", {
427
+ className: "cell-action-target",
428
+ children: [
429
+ /* @__PURE__ */ W("dt", { children: [
430
+ "Targets (",
431
+ t.length,
432
+ ")"
433
+ ] }),
434
+ /* @__PURE__ */ U("dd", { children: /* @__PURE__ */ U("ul", {
435
+ className: "bulk-targets",
436
+ tabIndex: 0,
437
+ "aria-label": "Targets",
438
+ children: t.map((e) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U("code", { children: e.label }) }, e.key))
439
+ }) }),
440
+ !!n.length && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("dt", { children: [
441
+ "Skipped (",
442
+ n.length,
443
+ ")"
444
+ ] }), /* @__PURE__ */ U("dd", { children: /* @__PURE__ */ U("ul", {
445
+ className: "bulk-targets",
446
+ tabIndex: 0,
447
+ "aria-label": "Skipped",
448
+ children: n.map((e) => /* @__PURE__ */ W("li", { children: [
449
+ /* @__PURE__ */ U("code", { children: e.row.label }),
450
+ " — ",
451
+ e.reason
452
+ ] }, e.row.key))
453
+ }) })] })
454
+ ]
455
+ }),
456
+ e.options && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("label", {
457
+ className: "cell-action-option",
458
+ children: [
459
+ /* @__PURE__ */ U("input", {
460
+ type: "checkbox",
461
+ checked: p,
462
+ onChange: (e) => m(e.target.checked)
463
+ }),
464
+ "Pass ",
465
+ /* @__PURE__ */ U("code", { children: "--cascade" }),
466
+ " to each (",
467
+ e.name,
468
+ " child resources first)"
469
+ ]
470
+ }), /* @__PURE__ */ W("label", {
471
+ className: "cell-action-option",
472
+ children: [
473
+ /* @__PURE__ */ U("input", {
474
+ type: "checkbox",
475
+ checked: d,
476
+ onChange: (e) => f(e.target.checked)
477
+ }),
478
+ "Pass ",
479
+ /* @__PURE__ */ U("code", { children: "--force" }),
480
+ " to each (skip validation)"
481
+ ]
482
+ })] }),
483
+ e.acknowledgment && !e.purge && /* @__PURE__ */ W("label", {
484
+ className: "cell-action-acknowledgment",
485
+ children: [/* @__PURE__ */ U("input", {
486
+ type: "checkbox",
487
+ checked: s,
488
+ onChange: (e) => c(e.target.checked)
489
+ }), e.acknowledgment]
490
+ }),
491
+ e.purge && /* @__PURE__ */ W("label", {
492
+ className: "cell-action-scope-confirmation",
493
+ children: [
494
+ "Type ",
495
+ /* @__PURE__ */ U("code", { children: g }),
496
+ " to enable Purge",
497
+ /* @__PURE__ */ U("input", {
498
+ autoComplete: "off",
499
+ spellCheck: !1,
500
+ value: l,
501
+ onChange: (e) => u(e.target.value)
502
+ })
503
+ ]
504
+ }),
505
+ /* @__PURE__ */ W("div", {
506
+ className: "cell-action-dialog-buttons",
507
+ children: [/* @__PURE__ */ U("button", {
508
+ type: "button",
509
+ onClick: i,
510
+ children: "Cancel"
511
+ }), /* @__PURE__ */ W("button", {
512
+ className: e.danger ? "danger-action" : "primary-action",
513
+ type: "submit",
514
+ disabled: !_,
515
+ children: [
516
+ e.verb,
517
+ " ",
518
+ h
519
+ ]
520
+ })]
521
+ })
522
+ ]
523
+ })
524
+ });
525
+ }
526
+ function We({ rows: e, actions: n, noun: r, selection: i, run: a, extra: o }) {
527
+ let { notify: s } = t(), [c, l] = B(), [u, d] = B(""), [f, p] = B(), m = (e, t) => t.reasonOf?.(e) ?? "", h = Pe(e, n, m);
528
+ async function g(e, t, n, o) {
529
+ l(void 0), d(e.verb), p(void 0);
530
+ let c = await Fe(t, (t) => a(t, e, o)), u = c.filter((e) => !e.ok).map((e) => ({
531
+ row: e.item,
532
+ message: e.message || "The request failed."
533
+ })), f = Ie(e.verb, He(r), c, n.length);
534
+ s({
535
+ key: `bulk:${r(2)}`,
536
+ tone: f.tone,
537
+ message: f.message
538
+ }), p(u.length || n.length ? {
539
+ verb: e.verb,
540
+ failed: u,
541
+ skipped: n
542
+ } : void 0), d(""), i.clear();
543
+ }
544
+ return !e.length && !f && !u ? null : /* @__PURE__ */ W(H, { children: [
545
+ (!!e.length || u) && /* @__PURE__ */ W("div", {
546
+ className: "bulk-bar",
547
+ role: "region",
548
+ "aria-label": "Bulk actions",
549
+ children: [
550
+ /* @__PURE__ */ U("span", {
551
+ className: "bulk-count",
552
+ role: "status",
553
+ children: u ? `${u}: ${r(e.length)}…` : `${r(e.length)} selected`
554
+ }),
555
+ h.map((t) => /* @__PURE__ */ W("button", {
556
+ type: "button",
557
+ className: t.danger ? "danger-action" : void 0,
558
+ disabled: !!u,
559
+ onClick: () => {
560
+ let { targets: n, skipped: r } = Ne(e, (e) => m(e, t));
561
+ l({
562
+ action: t,
563
+ targets: n,
564
+ skipped: r
565
+ });
566
+ },
567
+ children: [t.verb, "…"]
568
+ }, t.name)),
569
+ !h.length && /* @__PURE__ */ U("span", {
570
+ className: "description",
571
+ children: "No action applies to every selected row; each one is skipped."
572
+ }),
573
+ o,
574
+ /* @__PURE__ */ U("button", {
575
+ type: "button",
576
+ className: "subtle-button",
577
+ disabled: !!u,
578
+ onClick: i.clear,
579
+ children: "Clear"
580
+ })
581
+ ]
582
+ }),
583
+ f && /* @__PURE__ */ W("div", {
584
+ className: f.failed.length ? "error bulk-report" : "bulk-report",
585
+ role: f.failed.length ? "alert" : "status",
586
+ "aria-label": `${f.verb} report`,
587
+ children: [
588
+ /* @__PURE__ */ W("strong", { children: [
589
+ f.verb,
590
+ ": ",
591
+ f.failed.length ? `${f.failed.length} failed` : "done",
592
+ f.skipped.length ? `, ${f.skipped.length} skipped` : ""
593
+ ] }),
594
+ !!f.failed.length && /* @__PURE__ */ U("ul", {
595
+ "aria-label": "Failed",
596
+ children: f.failed.map((e) => /* @__PURE__ */ W("li", { children: [
597
+ /* @__PURE__ */ U("code", { children: e.row.label }),
598
+ ": ",
599
+ e.message
600
+ ] }, e.row.key))
601
+ }),
602
+ !!f.skipped.length && /* @__PURE__ */ U("ul", {
603
+ "aria-label": "Skipped",
604
+ children: f.skipped.map((e) => /* @__PURE__ */ W("li", { children: [
605
+ /* @__PURE__ */ U("code", { children: e.row.label }),
606
+ " — ",
607
+ e.reason
608
+ ] }, e.row.key))
609
+ }),
610
+ /* @__PURE__ */ U("button", {
611
+ type: "button",
612
+ className: "subtle-button",
613
+ onClick: () => p(void 0),
614
+ children: "Dismiss"
615
+ })
616
+ ]
617
+ }),
618
+ c && /* @__PURE__ */ U(Ue, {
619
+ action: c.action,
620
+ targets: c.targets,
621
+ skipped: c.skipped,
622
+ noun: r,
623
+ onCancel: () => l(void 0),
624
+ onConfirm: (e) => void g(c.action, c.targets, c.skipped, e)
625
+ })
626
+ ] });
627
+ }
628
+ function Ge(e, t = `${e}s`) {
629
+ return (n) => Re(n, e, t);
630
+ }
631
+ // src/catalog.tsx
632
+ var Ke = [
633
+ "realm",
634
+ "space",
635
+ "stack",
636
+ "cell"
637
+ ];
638
+ function q(e) {
639
+ return Ke.map((t) => e[t]).filter((e) => !!e);
640
+ }
641
+ function J(e, t, n = !1) {
642
+ return d(`/${e}/` + t.map(encodeURIComponent).join("/") + (n ? "?document=1" : ""));
643
+ }
644
+ function qe(e) {
645
+ return [...q(e), e.name];
646
+ }
647
+ function Je(e) {
648
+ let t = [], n = (e, r) => {
649
+ if (!e || typeof e != "object") return;
650
+ if (Array.isArray(e)) {
651
+ e.forEach((e) => n(e, r));
652
+ return;
653
+ }
654
+ let i = e, a = r === "blueprint" ? "blueprints" : r === "secretRef" ? "secrets" : r === "volumeRef" ? "volumes" : void 0;
655
+ if (a && typeof i.name == "string" && typeof i.realm == "string") {
656
+ let e = {
657
+ kind: a,
658
+ name: i.name,
659
+ realm: i.realm,
660
+ space: typeof i.space == "string" ? i.space : void 0,
661
+ stack: typeof i.stack == "string" ? i.stack : void 0,
662
+ cell: typeof i.cell == "string" ? i.cell : void 0
663
+ };
664
+ t.some((t) => JSON.stringify(t) === JSON.stringify(e)) || t.push(e);
665
+ }
666
+ Object.entries(i).forEach(([e, t]) => n(t, e));
667
+ };
668
+ return n(e.spec, "spec"), t;
669
+ }
670
+ function Ye({ reference: e, revision: t }) {
671
+ let n = qe(e), r = n.some((e) => e.includes("${")), i = !e.name || !e.realm || !!e.stack && !e.space || !!e.cell && (!e.stack || e.kind !== "secrets"), a = c(r || i ? null : L(e.kind, n), t);
672
+ return /* @__PURE__ */ W("li", { children: [/* @__PURE__ */ W("div", { children: [
673
+ /* @__PURE__ */ U("span", {
674
+ className: "badge",
675
+ children: f[e.kind]
676
+ }),
677
+ " ",
678
+ r || i ? e.name : /* @__PURE__ */ U("a", {
679
+ className: "resource-name",
680
+ href: J(e.kind, n),
681
+ children: e.name
682
+ }),
683
+ /* @__PURE__ */ U("p", {
684
+ className: "description",
685
+ children: n.slice(0, -1).join(" / ")
686
+ })
687
+ ] }), /* @__PURE__ */ U("div", { children: i ? /* @__PURE__ */ U("span", { children: "Invalid reference scope" }) : r ? /* @__PURE__ */ U("span", { children: "Template reference — resolved when materialized" }) : a.loading ? /* @__PURE__ */ U("span", { children: "Checking reference…" }) : a.error ? /* @__PURE__ */ W("div", {
688
+ className: "error",
689
+ role: "alert",
690
+ children: [/* @__PURE__ */ U("strong", { children: a.error.code === "not_found" ? "Missing reference" : "Reference retrieval failed" }), /* @__PURE__ */ U("p", { children: a.error.message })]
691
+ }) : /* @__PURE__ */ U("span", {
692
+ className: "badge",
693
+ children: "Available"
694
+ }) })] });
695
+ }
696
+ function Xe(e) {
697
+ let t = /* @__PURE__ */ new Set(), n = (e) => {
698
+ if (!e || typeof e != "object") return;
699
+ if (Array.isArray(e)) {
700
+ e.forEach(n);
701
+ return;
702
+ }
703
+ let r = e;
704
+ r.kind === "volume" && typeof r.source == "string" && r.source && t.add(r.source), Object.values(r).forEach(n);
705
+ };
706
+ return n(e.spec), [...t];
707
+ }
708
+ function Ze(e) {
709
+ return {
710
+ kind: "configs",
711
+ name: e.name,
712
+ realm: e.realm ?? "",
713
+ space: e.space,
714
+ stack: e.stack
715
+ };
716
+ }
717
+ function Qe(e, t) {
718
+ return J(e, t);
719
+ }
720
+ function Y(e) {
721
+ return e.join(" / ");
722
+ }
723
+ function $e(e) {
724
+ return e.scope.length === 4 ? e.scope : [...e.scope.slice(0, 3), e.doc.metadata.name];
725
+ }
726
+ function et({ inventory: e }) {
727
+ return /* @__PURE__ */ W(H, { children: [
728
+ e.loading && !e.data && /* @__PURE__ */ U("p", {
729
+ role: "status",
730
+ children: "Loading shared Cell inventory…"
731
+ }),
732
+ e.loading && e.data && /* @__PURE__ */ U("p", {
733
+ role: "status",
734
+ children: "Refreshing Cell inventory; displayed Cells come from the last completed retrieval."
735
+ }),
736
+ e.error && /* @__PURE__ */ W("p", {
737
+ className: "stale",
738
+ children: ["Cell inventory could not be refreshed: ", e.error.message]
739
+ }),
740
+ !!e.data?.failures.length && /* @__PURE__ */ U("p", {
741
+ className: "stale",
742
+ children: "Cell inventory is incomplete; this relationship list may be partial."
743
+ }),
744
+ !e.data && !e.loading && !e.error && /* @__PURE__ */ U("p", {
745
+ className: "empty-state",
746
+ children: "Cell inventory has not been retrieved."
747
+ })
748
+ ] });
749
+ }
750
+ function X({ rows: t, inventory: n, configLabel: r }) {
751
+ return /* @__PURE__ */ W(H, { children: [
752
+ /* @__PURE__ */ U(et, { inventory: n }),
753
+ t.length > 0 && /* @__PURE__ */ U("ul", {
754
+ className: "state-list related-cell-list",
755
+ children: t.map((t) => {
756
+ let n = $e(t);
757
+ return /* @__PURE__ */ W("li", { children: [
758
+ /* @__PURE__ */ W("div", { children: [
759
+ /* @__PURE__ */ U("a", {
760
+ className: "resource-name",
761
+ href: e(n),
762
+ children: t.doc.metadata.name
763
+ }),
764
+ /* @__PURE__ */ U("p", {
765
+ className: "description",
766
+ children: Y(n.slice(0, -1))
767
+ }),
768
+ r && t.config && /* @__PURE__ */ W("p", {
769
+ className: "description",
770
+ children: [
771
+ "Config: ",
772
+ /* @__PURE__ */ U("a", {
773
+ href: Qe("configs", [...q(t.config.metadata), t.config.metadata.name]),
774
+ children: t.config.metadata.name
775
+ }),
776
+ " · ",
777
+ Y(q(t.config.metadata))
778
+ ]
779
+ })
780
+ ] }),
781
+ /* @__PURE__ */ U(ye, { state: t.doc.status?.state }),
782
+ /* @__PURE__ */ U("a", {
783
+ className: "document-action",
784
+ href: e(n),
785
+ children: "Open terminal"
786
+ })
787
+ ] }, JSON.stringify(n));
788
+ })
789
+ }),
790
+ n.data && !t.length && !n.loading && !n.error && !n.data.failures.length && /* @__PURE__ */ U("p", {
791
+ className: "description",
792
+ children: "No related Cells found."
793
+ })
794
+ ] });
795
+ }
796
+ function tt({ mounts: e, inventory: t }) {
797
+ return /* @__PURE__ */ W(H, { children: [
798
+ /* @__PURE__ */ U(et, { inventory: t }),
799
+ e.length > 0 && /* @__PURE__ */ U("div", {
800
+ className: "table-scroll",
801
+ children: /* @__PURE__ */ W("table", {
802
+ className: "stackable volume-mounts",
803
+ "aria-label": "Cells mounting this Volume",
804
+ children: [/* @__PURE__ */ U("thead", { children: /* @__PURE__ */ W("tr", { children: [
805
+ /* @__PURE__ */ U("th", { children: "Cell" }),
806
+ /* @__PURE__ */ U("th", { children: "State" }),
807
+ /* @__PURE__ */ U("th", { children: "Container" }),
808
+ /* @__PURE__ */ U("th", { children: "Mount path" }),
809
+ /* @__PURE__ */ U("th", { children: "Access" }),
810
+ /* @__PURE__ */ U("th", { children: "Created with the cell" })
811
+ ] }) }), /* @__PURE__ */ U("tbody", { children: e.map((e, t) => /* @__PURE__ */ W("tr", { children: [
812
+ /* @__PURE__ */ W("td", {
813
+ "data-label": "Cell",
814
+ children: [/* @__PURE__ */ U("a", {
815
+ className: "resource-name",
816
+ href: s(e.row.scope),
817
+ children: e.row.doc.metadata.name
818
+ }), /* @__PURE__ */ W("p", {
819
+ className: "description",
820
+ children: [Y(e.row.scope.slice(0, -1)), e.by === "source" ? " · by name" : ""]
821
+ })]
822
+ }),
823
+ /* @__PURE__ */ U("td", {
824
+ "data-label": "State",
825
+ children: /* @__PURE__ */ U(ye, { state: e.row.doc.status?.state })
826
+ }),
827
+ /* @__PURE__ */ U("td", {
828
+ "data-label": "Container",
829
+ children: /* @__PURE__ */ U("code", { children: e.container || "—" })
830
+ }),
831
+ /* @__PURE__ */ U("td", {
832
+ "data-label": "Mount path",
833
+ children: /* @__PURE__ */ U("code", { children: e.target || "—" })
834
+ }),
835
+ /* @__PURE__ */ U("td", {
836
+ "data-label": "Access",
837
+ children: e.readOnly ? "Read-only" : "Read-write"
838
+ }),
839
+ /* @__PURE__ */ U("td", {
840
+ "data-label": "Created with the cell",
841
+ children: e.ensure ? "Yes (ensure)" : "No"
842
+ })
843
+ ] }, t)) })]
844
+ })
845
+ }),
846
+ t.data && !e.length && !t.loading && !t.error && !t.data.failures.length && /* @__PURE__ */ U("p", {
847
+ className: "description",
848
+ children: "No cell in the inventory mounts this Volume."
849
+ })
850
+ ] });
851
+ }
852
+ function nt({ doc: e, revision: t, inventory: n }) {
853
+ let r = c("/catalog/volumes", t), i = c("/catalog/configs", t), a = n.data && r.data ? I(n.data.rows[3], r.data, e) : [], o = N(i.data, e), s = e.spec, l = {
854
+ connector: typeof s?.connector == "string" ? s.connector : "",
855
+ method: typeof s?.method == "string" ? s.method : ""
856
+ }, u = e.status?.login;
857
+ return /* @__PURE__ */ W("div", {
858
+ className: "relationship-grid",
859
+ children: [
860
+ /* @__PURE__ */ W("section", {
861
+ className: "panel related-resources volume-mounted-by",
862
+ "aria-label": "Mounted by",
863
+ children: [/* @__PURE__ */ W("div", {
864
+ className: "panel-heading",
865
+ children: [/* @__PURE__ */ U("h2", { children: "Mounted by" }), /* @__PURE__ */ U("span", {
866
+ className: "badge",
867
+ children: n.data && r.data ? `${a.length} mount${a.length === 1 ? "" : "s"}` : "Resolving…"
868
+ })]
869
+ }), /* @__PURE__ */ W("div", {
870
+ className: "panel-body",
871
+ children: [
872
+ /* @__PURE__ */ U("p", {
873
+ className: "description",
874
+ children: "Every cell in the inventory whose spec mounts this Volume, whatever its state. A mount by name resolves like kukeond does: the Volume of that name in the cell's Stack, else its Space, else its Realm."
875
+ }),
876
+ r.error && /* @__PURE__ */ U(_, {
877
+ error: r.error,
878
+ kind: "Volume"
879
+ }),
880
+ /* @__PURE__ */ U(tt, {
881
+ mounts: a,
882
+ inventory: n
883
+ })
884
+ ]
885
+ })]
886
+ }),
887
+ l.connector && /* @__PURE__ */ W("section", {
888
+ className: "panel related-resources volume-login-identity",
889
+ "aria-label": "Login identity",
890
+ children: [/* @__PURE__ */ W("div", {
891
+ className: "panel-heading",
892
+ children: [/* @__PURE__ */ U("h2", { children: "Login identity" }), /* @__PURE__ */ U("span", {
893
+ className: "badge",
894
+ children: l.connector
895
+ })]
896
+ }), /* @__PURE__ */ W("div", {
897
+ className: "panel-body",
898
+ children: [
899
+ /* @__PURE__ */ W("p", {
900
+ className: "description",
901
+ children: [
902
+ "This Volume is a login identity of the ",
903
+ /* @__PURE__ */ U("a", {
904
+ href: A(l.connector),
905
+ children: /* @__PURE__ */ U("code", { children: l.connector })
906
+ }),
907
+ " connector",
908
+ l.method && /* @__PURE__ */ W(H, { children: [
909
+ " (",
910
+ /* @__PURE__ */ U("code", { children: l.method }),
911
+ " method)"
912
+ ] }),
913
+ ": the harness keeps its login here. Only whether a login is present is shown — never the login itself."
914
+ ]
915
+ }),
916
+ /* @__PURE__ */ W("dl", {
917
+ className: "details-grid",
918
+ children: [/* @__PURE__ */ U("dt", { children: "Login" }), /* @__PURE__ */ W("dd", { children: [/* @__PURE__ */ U(ne, { state: u?.state }), u?.since && /* @__PURE__ */ W("span", {
919
+ className: "description",
920
+ children: [" since ", new Date(u.since).toLocaleString()]
921
+ })] })]
922
+ }),
923
+ /* @__PURE__ */ U("div", {
924
+ className: "connector-actions",
925
+ children: /* @__PURE__ */ U(x, {
926
+ connector: l.connector,
927
+ title: l.connector,
928
+ volume: {
929
+ name: e.metadata.name,
930
+ realm: e.metadata.realm ?? "",
931
+ space: e.metadata.space,
932
+ stack: e.metadata.stack
933
+ },
934
+ state: u?.state,
935
+ method: l.method || void 0
936
+ })
937
+ })
938
+ ]
939
+ })]
940
+ }),
941
+ /* @__PURE__ */ W("section", {
942
+ className: "panel related-resources",
943
+ "aria-label": "Harness state for",
944
+ children: [/* @__PURE__ */ U("div", {
945
+ className: "panel-heading",
946
+ children: /* @__PURE__ */ U("h2", { children: "Harness state for" })
947
+ }), /* @__PURE__ */ W("div", {
948
+ className: "panel-body",
949
+ children: [
950
+ /* @__PURE__ */ U("p", {
951
+ className: "description",
952
+ children: "Configs whose harness keeps its state in this Volume: the login of a connector's login method, or the sessions and settings of a token method."
953
+ }),
954
+ i.loading && !i.data && /* @__PURE__ */ U("p", {
955
+ role: "status",
956
+ children: "Loading CellConfigs…"
957
+ }),
958
+ i.error && /* @__PURE__ */ U(_, {
959
+ error: i.error,
960
+ kind: "CellConfig"
961
+ }),
962
+ o.length > 0 && /* @__PURE__ */ U("ul", {
963
+ className: "state-list",
964
+ children: o.map(({ config: e, connectors: t }) => {
965
+ let n = [...q(e.metadata), e.metadata.name];
966
+ return /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("a", {
967
+ className: "resource-name",
968
+ href: J("configs", n),
969
+ children: e.metadata.name
970
+ }), /* @__PURE__ */ W("p", {
971
+ className: "description",
972
+ children: [
973
+ Y(n.slice(0, -1)),
974
+ " · ",
975
+ t.join(", ")
976
+ ]
977
+ })] }) }, JSON.stringify(n));
978
+ })
979
+ }),
980
+ i.data && !o.length && !i.error && /* @__PURE__ */ U("p", {
981
+ className: "description",
982
+ children: "No Config keeps harness state in this Volume."
983
+ })
984
+ ]
985
+ })]
986
+ })
987
+ ]
988
+ });
989
+ }
990
+ function rt({ doc: e, revision: t, inventory: n }) {
991
+ let r = e.spec?.blueprint, i = !!r && !!r.name && !!r.realm && !(r.stack && !r.space), a = r ? qe(r) : [], o = c(i ? L("blueprints", a) : null, t), s = n.data ? F(n.data.rows[3], Ze(e.metadata)) : [];
992
+ return /* @__PURE__ */ W("div", {
993
+ className: "relationship-grid",
994
+ children: [/* @__PURE__ */ W("section", {
995
+ className: "panel related-resources",
996
+ children: [/* @__PURE__ */ U("div", {
997
+ className: "panel-heading",
998
+ children: /* @__PURE__ */ U("h2", { children: "Referenced Blueprint" })
999
+ }), /* @__PURE__ */ U("div", {
1000
+ className: "panel-body",
1001
+ children: r ? i ? o.loading && !o.data ? /* @__PURE__ */ U("p", {
1002
+ role: "status",
1003
+ children: "Loading referenced Blueprint…"
1004
+ }) : o.error ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(_, {
1005
+ error: o.error,
1006
+ kind: "Blueprint"
1007
+ }), o.data && /* @__PURE__ */ U("p", {
1008
+ className: "stale",
1009
+ children: "Showing stale Blueprint details."
1010
+ })] }) : o.data ? /* @__PURE__ */ W("p", { children: [/* @__PURE__ */ U("a", {
1011
+ className: "resource-name",
1012
+ href: J("blueprints", a),
1013
+ children: o.data.metadata.name
1014
+ }), /* @__PURE__ */ W("span", {
1015
+ className: "description",
1016
+ children: [" ", Y(a.slice(0, -1))]
1017
+ })] }) : /* @__PURE__ */ U("p", {
1018
+ className: "description",
1019
+ children: "Blueprint details are unavailable."
1020
+ }) : /* @__PURE__ */ W("div", {
1021
+ className: "error",
1022
+ role: "alert",
1023
+ children: [/* @__PURE__ */ U("strong", { children: "Blueprint reference is incomplete" }), /* @__PURE__ */ W("p", { children: ["Reference: ", Y(a)] })]
1024
+ }) : /* @__PURE__ */ W("div", {
1025
+ className: "error",
1026
+ role: "alert",
1027
+ children: [/* @__PURE__ */ U("strong", { children: "Blueprint reference missing" }), /* @__PURE__ */ U("p", { children: "This CellConfig has no Blueprint reference." })]
1028
+ })
1029
+ })]
1030
+ }), /* @__PURE__ */ W("section", {
1031
+ className: "panel related-resources",
1032
+ children: [/* @__PURE__ */ W("div", {
1033
+ className: "panel-heading",
1034
+ children: [/* @__PURE__ */ U("h2", { children: "Cells using this Config" }), /* @__PURE__ */ U("span", {
1035
+ className: "badge",
1036
+ children: "Lineage"
1037
+ })]
1038
+ }), /* @__PURE__ */ W("div", {
1039
+ className: "panel-body",
1040
+ children: [/* @__PURE__ */ U("p", {
1041
+ className: "description",
1042
+ children: "Resolved from each Cell’s scoped Config provenance."
1043
+ }), /* @__PURE__ */ U(X, {
1044
+ rows: s,
1045
+ inventory: n
1046
+ })]
1047
+ })]
1048
+ })]
1049
+ });
1050
+ }
1051
+ function it({ doc: e, revision: t, inventory: n }) {
1052
+ let r = c("/catalog/configs", t), i = {
1053
+ kind: "blueprints",
1054
+ name: e.metadata.name,
1055
+ realm: e.metadata.realm ?? "",
1056
+ space: e.metadata.space,
1057
+ stack: e.metadata.stack
1058
+ }, a = r.data ? M(r.data, i) : [], o = n.data ? P(n.data.rows[3], a) : [];
1059
+ return /* @__PURE__ */ W("div", {
1060
+ className: "relationship-grid",
1061
+ children: [/* @__PURE__ */ W("section", {
1062
+ className: "panel related-resources",
1063
+ children: [/* @__PURE__ */ W("div", {
1064
+ className: "panel-heading",
1065
+ children: [/* @__PURE__ */ U("h2", { children: "Configs using this Blueprint" }), /* @__PURE__ */ U("span", {
1066
+ className: "badge",
1067
+ children: "Scoped references"
1068
+ })]
1069
+ }), /* @__PURE__ */ W("div", {
1070
+ className: "panel-body",
1071
+ children: [
1072
+ r.loading && /* @__PURE__ */ U("p", {
1073
+ role: "status",
1074
+ children: r.data ? "Refreshing CellConfigs…" : "Loading CellConfigs…"
1075
+ }),
1076
+ r.error && /* @__PURE__ */ U(_, {
1077
+ error: r.error,
1078
+ kind: "CellConfig"
1079
+ }),
1080
+ r.error && r.data && /* @__PURE__ */ U("p", {
1081
+ className: "stale",
1082
+ children: "Showing stale CellConfig results."
1083
+ }),
1084
+ r.data && a.length > 0 && /* @__PURE__ */ U("ul", {
1085
+ className: "state-list",
1086
+ children: a.map((e) => {
1087
+ let t = [...q(e.metadata), e.metadata.name];
1088
+ return /* @__PURE__ */ W("li", { children: [/* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("a", {
1089
+ className: "resource-name",
1090
+ href: J("configs", t),
1091
+ children: e.metadata.name
1092
+ }), /* @__PURE__ */ U("p", {
1093
+ className: "description",
1094
+ children: Y(t.slice(0, -1))
1095
+ })] }), /* @__PURE__ */ U("a", {
1096
+ className: "document-action",
1097
+ href: J("configs", t),
1098
+ children: "Open Config"
1099
+ })] }, JSON.stringify(t));
1100
+ })
1101
+ }),
1102
+ r.data && !a.length && !r.error && /* @__PURE__ */ U("p", {
1103
+ className: "description",
1104
+ children: "No CellConfigs reference this Blueprint."
1105
+ })
1106
+ ]
1107
+ })]
1108
+ }), /* @__PURE__ */ W("section", {
1109
+ className: "panel related-resources",
1110
+ children: [/* @__PURE__ */ W("div", {
1111
+ className: "panel-heading",
1112
+ children: [/* @__PURE__ */ U("h2", { children: "Cells using this Blueprint through Configs" }), /* @__PURE__ */ U("span", {
1113
+ className: "badge",
1114
+ children: "Lineage"
1115
+ })]
1116
+ }), /* @__PURE__ */ W("div", {
1117
+ className: "panel-body",
1118
+ children: [/* @__PURE__ */ U("p", {
1119
+ className: "description",
1120
+ children: "Cells are matched by their scoped Config provenance, not by generated names."
1121
+ }), r.error && !r.data ? /* @__PURE__ */ U("p", {
1122
+ className: "error",
1123
+ role: "alert",
1124
+ children: "Cannot resolve indirect Cell relationships because the CellConfig inventory failed."
1125
+ }) : /* @__PURE__ */ U(X, {
1126
+ rows: o,
1127
+ inventory: n,
1128
+ configLabel: !0
1129
+ })]
1130
+ })]
1131
+ })]
1132
+ });
1133
+ }
1134
+ function at({ doc: e, revision: t }) {
1135
+ let n = Je(e), r = Xe(e);
1136
+ return !n.length && !r.length ? null : /* @__PURE__ */ W("section", {
1137
+ className: "panel related-resources",
1138
+ "aria-label": "Resource references",
1139
+ children: [/* @__PURE__ */ U("div", {
1140
+ className: "panel-heading",
1141
+ children: /* @__PURE__ */ U("h2", { children: "References" })
1142
+ }), /* @__PURE__ */ W("div", {
1143
+ className: "panel-body",
1144
+ children: [/* @__PURE__ */ U("p", {
1145
+ className: "description",
1146
+ children: "Explicit references from this document. References describe usage, not ownership."
1147
+ }), /* @__PURE__ */ W("ul", {
1148
+ className: "state-list",
1149
+ children: [n.map((e) => /* @__PURE__ */ U(Ye, {
1150
+ reference: e,
1151
+ revision: t
1152
+ }, JSON.stringify(e))), r.map((e) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W("div", { children: [
1153
+ /* @__PURE__ */ U("span", {
1154
+ className: "badge",
1155
+ children: "Volume source"
1156
+ }),
1157
+ " ",
1158
+ e,
1159
+ /* @__PURE__ */ U("p", {
1160
+ className: "description",
1161
+ children: "Scope is resolved by the daemon at create/start; no ownership is inferred."
1162
+ })
1163
+ ] }) }, e))]
1164
+ })]
1165
+ })]
1166
+ });
1167
+ }
1168
+ var Z = {
1169
+ blueprints: "Blueprint",
1170
+ configs: "Config",
1171
+ volumes: "Volume",
1172
+ secrets: "Secret"
1173
+ }, ot = {
1174
+ configs: "Delete removes this CellConfig document from kukeond. Cells created from it are not deleted; they keep running and lose only their Config lineage.",
1175
+ blueprints: "Delete removes this CellBlueprint document from kukeond. Configs created from it are independent copies and are not deleted.",
1176
+ volumes: "Delete removes this Volume and its daemon-provisioned directory, including the data stored in it. kukeond refuses while a Ready or Degraded cell mounts the Volume.",
1177
+ secrets: "Delete removes this Secret's daemon-stored value. kukeond refuses while a cell references it through secretRef. The value is never shown here."
1178
+ };
1179
+ function st({ kind: e, doc: t, revision: n, inventory: r }) {
1180
+ let i = c(e === "blueprints" ? "/catalog/configs" : null, n), a = c(e === "volumes" ? "/catalog/volumes" : null, n);
1181
+ if (e === "volumes") {
1182
+ let e = r.data && a.data ? I(r.data.rows[3], a.data, t) : [];
1183
+ return /* @__PURE__ */ W("section", {
1184
+ className: "catalog-delete-dependents",
1185
+ "aria-label": "Known related resources",
1186
+ children: [
1187
+ /* @__PURE__ */ U("h3", { children: "Cells mounting this Volume" }),
1188
+ /* @__PURE__ */ U("p", {
1189
+ className: "description",
1190
+ children: "kukeond refuses the delete while a Ready or Degraded cell mounts the Volume. Stopped cells keep their mount in the spec and fail to start once it is gone."
1191
+ }),
1192
+ a.error && /* @__PURE__ */ U(_, {
1193
+ error: a.error,
1194
+ kind: "Volume"
1195
+ }),
1196
+ /* @__PURE__ */ U(tt, {
1197
+ mounts: e,
1198
+ inventory: r
1199
+ })
1200
+ ]
1201
+ });
1202
+ }
1203
+ if (e === "configs") {
1204
+ let e = r.data ? F(r.data.rows[3], Ze(t.metadata)) : [];
1205
+ return /* @__PURE__ */ W("section", {
1206
+ className: "catalog-delete-dependents",
1207
+ "aria-label": "Known related resources",
1208
+ children: [/* @__PURE__ */ U("h3", { children: "Cells created from this Config" }), /* @__PURE__ */ U(X, {
1209
+ rows: e,
1210
+ inventory: r
1211
+ })]
1212
+ });
1213
+ }
1214
+ if (e !== "blueprints") return null;
1215
+ let o = {
1216
+ kind: "blueprints",
1217
+ name: t.metadata.name,
1218
+ realm: t.metadata.realm ?? "",
1219
+ space: t.metadata.space,
1220
+ stack: t.metadata.stack
1221
+ }, s = i.data ? M(i.data, o) : [], l = r.data ? P(r.data.rows[3], s) : [];
1222
+ return /* @__PURE__ */ W("section", {
1223
+ className: "catalog-delete-dependents",
1224
+ "aria-label": "Known related resources",
1225
+ children: [
1226
+ /* @__PURE__ */ U("h3", { children: "Configs created from this Blueprint" }),
1227
+ i.loading && /* @__PURE__ */ U("p", {
1228
+ role: "status",
1229
+ children: "Loading CellConfigs…"
1230
+ }),
1231
+ i.error && /* @__PURE__ */ U(_, {
1232
+ error: i.error,
1233
+ kind: "CellConfig"
1234
+ }),
1235
+ i.data && s.length > 0 && /* @__PURE__ */ U("ul", {
1236
+ className: "state-list",
1237
+ children: s.map((e) => {
1238
+ let t = [...q(e.metadata), e.metadata.name];
1239
+ return /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("a", {
1240
+ className: "resource-name",
1241
+ href: J("configs", t),
1242
+ children: e.metadata.name
1243
+ }), /* @__PURE__ */ U("p", {
1244
+ className: "description",
1245
+ children: Y(t.slice(0, -1))
1246
+ })] }) }, JSON.stringify(t));
1247
+ })
1248
+ }),
1249
+ i.data && !s.length && !i.error && /* @__PURE__ */ U("p", {
1250
+ className: "description",
1251
+ children: "No CellConfigs reference this Blueprint."
1252
+ }),
1253
+ s.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("h3", { children: "Cells created through those Configs" }), /* @__PURE__ */ U(X, {
1254
+ rows: l,
1255
+ inventory: r,
1256
+ configLabel: !0
1257
+ })] })
1258
+ ]
1259
+ });
1260
+ }
1261
+ function ct({ kind: e, doc: t, revision: n, inventory: r, onCancel: i, onConfirm: a }) {
1262
+ let o = z(null), [s, c] = B(!1), l = [...q(t.metadata), t.metadata.name];
1263
+ return be(o), /* @__PURE__ */ U("dialog", {
1264
+ className: "cell-action-dialog catalog-delete-dialog",
1265
+ ref: o,
1266
+ "aria-labelledby": "catalog-delete-title",
1267
+ "aria-describedby": "catalog-delete-description",
1268
+ onCancel: (e) => {
1269
+ e.preventDefault(), i();
1270
+ },
1271
+ onClick: (e) => {
1272
+ e.target === e.currentTarget && i();
1273
+ },
1274
+ children: /* @__PURE__ */ W("form", {
1275
+ onSubmit: (e) => {
1276
+ e.preventDefault(), s && a();
1277
+ },
1278
+ children: [
1279
+ /* @__PURE__ */ W("h2", {
1280
+ id: "catalog-delete-title",
1281
+ children: ["Delete ", Z[e].toLowerCase()]
1282
+ }),
1283
+ /* @__PURE__ */ U("p", {
1284
+ id: "catalog-delete-description",
1285
+ children: ot[e]
1286
+ }),
1287
+ /* @__PURE__ */ W("dl", {
1288
+ className: "cell-action-target",
1289
+ children: [
1290
+ /* @__PURE__ */ U("dt", { children: "Kind" }),
1291
+ /* @__PURE__ */ U("dd", { children: Z[e] }),
1292
+ /* @__PURE__ */ U("dt", { children: "Exact target" }),
1293
+ /* @__PURE__ */ U("dd", { children: /* @__PURE__ */ U("code", { children: l.join(" / ") }) })
1294
+ ]
1295
+ }),
1296
+ /* @__PURE__ */ U(st, {
1297
+ kind: e,
1298
+ doc: t,
1299
+ revision: n,
1300
+ inventory: r
1301
+ }),
1302
+ /* @__PURE__ */ W("label", {
1303
+ className: "cell-action-acknowledgment",
1304
+ children: [
1305
+ /* @__PURE__ */ U("input", {
1306
+ type: "checkbox",
1307
+ checked: s,
1308
+ onChange: (e) => c(e.target.checked)
1309
+ }),
1310
+ "I understand this permanently deletes the ",
1311
+ Z[e].toLowerCase(),
1312
+ " ",
1313
+ e === "volumes" ? "and its data" : "document",
1314
+ "."
1315
+ ]
1316
+ }),
1317
+ /* @__PURE__ */ W("div", {
1318
+ className: "cell-action-dialog-buttons",
1319
+ children: [/* @__PURE__ */ U("button", {
1320
+ type: "button",
1321
+ onClick: i,
1322
+ children: "Cancel"
1323
+ }), /* @__PURE__ */ U("button", {
1324
+ className: "danger-action",
1325
+ type: "submit",
1326
+ disabled: !s,
1327
+ children: "Confirm Delete"
1328
+ })]
1329
+ })
1330
+ ]
1331
+ })
1332
+ });
1333
+ }
1334
+ async function lt(e, t) {
1335
+ try {
1336
+ let n = await V(L(e, t), { headers: { Accept: "application/json" } });
1337
+ return n.ok ? !0 : (await n.json().catch(() => ({}))).error?.code !== "not_found" && null;
1338
+ } catch {
1339
+ return null;
1340
+ }
1341
+ }
1342
+ function ut({ kind: e, revision: n, inventory: r, onChanged: i }) {
1343
+ let a = c(`/catalog/${e}`, n), s = (t) => e !== "volumes" || !r.data || r.data.failures.length || !a.data ? "—" : String(I(r.data.rows[3], a.data, t).length), { notify: l } = t(), [d, p] = B(null), [m, h] = B(() => /* @__PURE__ */ new Set()), [y, b] = B(() => /* @__PURE__ */ new Set()), [x, S] = B([]);
1344
+ async function C(t, n = !1) {
1345
+ let r = JSON.stringify(t), a = t.join(" / ");
1346
+ if (m.has(r)) return {
1347
+ ok: !1,
1348
+ message: "A delete of it is still running."
1349
+ };
1350
+ h((e) => new Set(e).add(r)), S((e) => e.filter((e) => e.target !== a)), n || l({
1351
+ key: `catalog-delete:${e}:${r}`,
1352
+ tone: "pending",
1353
+ title: a,
1354
+ message: `Deleting ${Z[e].toLowerCase()}…`
1355
+ });
1356
+ let o = null;
1357
+ try {
1358
+ let n = await V(oe(e, t), {
1359
+ method: "POST",
1360
+ headers: {
1361
+ Accept: "application/json",
1362
+ "Content-Type": "application/json"
1363
+ },
1364
+ body: "{}"
1365
+ });
1366
+ n.ok || (o = (await n.json().catch(() => ({}))).error?.message ?? `HTTP ${n.status}`);
1367
+ } catch (e) {
1368
+ o = e instanceof Error ? e.message : "Request failed";
1369
+ }
1370
+ let s = await lt(e, t), c = {
1371
+ ok: !0,
1372
+ message: ""
1373
+ };
1374
+ if (s === !1) b((e) => new Set(e).add(r)), n || l({
1375
+ key: `catalog-delete:${e}:${r}`,
1376
+ tone: "success",
1377
+ title: a,
1378
+ message: `${Z[e]} deleted.`
1379
+ });
1380
+ else {
1381
+ let t = o ?? (s === null ? "Deleted, but the follow-up read failed; refresh to confirm." : "kukeond reported success, but the resource is still listed.");
1382
+ c = {
1383
+ ok: !1,
1384
+ message: t
1385
+ }, n || (S((e) => [...e.filter((e) => e.target !== a), {
1386
+ target: a,
1387
+ message: t
1388
+ }]), l({
1389
+ key: `catalog-delete:${e}:${r}`,
1390
+ tone: o ? "error" : "warning",
1391
+ title: a,
1392
+ message: t
1393
+ }));
1394
+ }
1395
+ return h((e) => {
1396
+ let t = new Set(e);
1397
+ return t.delete(r), t;
1398
+ }), i(), c;
1399
+ }
1400
+ let [w, te] = B(""), [T, E] = B(""), [ne, D] = B(0), O = (a.data ?? []).filter((e) => !y.has(JSON.stringify([...q(e.metadata), e.metadata.name]))).filter((e) => (!T || e.metadata.realm === T) && [...q(e.metadata), e.metadata.name].join(" / ").toLowerCase().includes(w.toLowerCase())).sort((e, t) => [...q(e.metadata), e.metadata.name].join("/").localeCompare([...q(t.metadata), t.metadata.name].join("/"))), k = Math.min(ne, Math.max(0, Math.ceil(O.length / 25) - 1)), A = (e) => JSON.stringify([...q(e.metadata), e.metadata.name]), M = (a.data ?? []).filter((e) => !y.has(A(e))), N = ze(M.map(A), !!a.data), P = M.filter((e) => N.has(A(e))).map((e) => {
1401
+ let t = [...q(e.metadata), e.metadata.name];
1402
+ return {
1403
+ key: A(e),
1404
+ scope: t,
1405
+ label: t.join(" / ")
1406
+ };
1407
+ }), F = Ge(Z[e].toLowerCase()), re = [{
1408
+ name: "delete",
1409
+ verb: "Delete",
1410
+ danger: !0,
1411
+ consequence: ot[e],
1412
+ reasonOf: (e) => m.has(e.key) ? "a delete of it is still running" : "",
1413
+ acknowledgment: `I understand this permanently deletes every ${Z[e].toLowerCase()} listed${e === "volumes" ? " and its data" : ""}.`
1414
+ }];
1415
+ return /* @__PURE__ */ W(H, { children: [
1416
+ a.error && /* @__PURE__ */ U(_, {
1417
+ error: a.error,
1418
+ kind: f[e].replace(/s$/, "")
1419
+ }),
1420
+ a.error && a.data && /* @__PURE__ */ W("p", {
1421
+ className: "stale",
1422
+ children: [
1423
+ "Stale ",
1424
+ e,
1425
+ " list — refresh failed."
1426
+ ]
1427
+ }),
1428
+ e === "secrets" && /* @__PURE__ */ U("p", {
1429
+ className: "description",
1430
+ children: "Metadata only. Secret values are never returned by this browser."
1431
+ }),
1432
+ x.map((e) => /* @__PURE__ */ W("div", {
1433
+ className: "error",
1434
+ role: "alert",
1435
+ children: [/* @__PURE__ */ W("strong", { children: ["Delete failed: ", e.target] }), /* @__PURE__ */ U("p", { children: e.message })]
1436
+ }, e.target)),
1437
+ /* @__PURE__ */ W("section", {
1438
+ className: "panel",
1439
+ "aria-label": `${f[e]} list`,
1440
+ "aria-busy": a.loading,
1441
+ children: [
1442
+ /* @__PURE__ */ W("div", {
1443
+ className: "list-controls",
1444
+ children: [
1445
+ /* @__PURE__ */ W("label", {
1446
+ className: "search-field",
1447
+ children: ["Search", /* @__PURE__ */ U("input", {
1448
+ type: "search",
1449
+ value: w,
1450
+ placeholder: `Search ${e}…`,
1451
+ onChange: (e) => {
1452
+ te(e.target.value), D(0);
1453
+ }
1454
+ })]
1455
+ }),
1456
+ /* @__PURE__ */ W("label", { children: ["Realm", /* @__PURE__ */ W("select", {
1457
+ "aria-label": "Filter by realm",
1458
+ value: T,
1459
+ onChange: (e) => {
1460
+ E(e.target.value), D(0);
1461
+ },
1462
+ children: [/* @__PURE__ */ U("option", {
1463
+ value: "",
1464
+ children: "All realms"
1465
+ }), [...new Set(a.data?.map((e) => e.metadata.realm))].sort().map((e) => /* @__PURE__ */ U("option", { children: e }, e))]
1466
+ })] }),
1467
+ /* @__PURE__ */ W("span", {
1468
+ className: "result-count",
1469
+ children: [O.length, " results"]
1470
+ }),
1471
+ (e === "blueprints" || e === "configs") && /* @__PURE__ */ U("a", {
1472
+ className: "document-action",
1473
+ href: g(),
1474
+ children: "New Config"
1475
+ }),
1476
+ e === "secrets" && /* @__PURE__ */ U("a", {
1477
+ className: "document-action",
1478
+ href: v(),
1479
+ children: "New Secret"
1480
+ })
1481
+ ]
1482
+ }),
1483
+ a.loading && /* @__PURE__ */ W("p", {
1484
+ className: "scope-filter",
1485
+ role: "status",
1486
+ children: [
1487
+ "Loading ",
1488
+ e,
1489
+ "…"
1490
+ ]
1491
+ }),
1492
+ /* @__PURE__ */ U(We, {
1493
+ rows: P,
1494
+ actions: re,
1495
+ noun: F,
1496
+ selection: N,
1497
+ run: (e) => C(e.scope, !0)
1498
+ }),
1499
+ /* @__PURE__ */ U("div", {
1500
+ className: "table-scroll",
1501
+ children: /* @__PURE__ */ W("table", {
1502
+ className: "stackable bulk-table",
1503
+ children: [/* @__PURE__ */ U("thead", { children: /* @__PURE__ */ W("tr", { children: [
1504
+ /* @__PURE__ */ U("th", {
1505
+ className: "bulk-column",
1506
+ children: /* @__PURE__ */ U(Be, {
1507
+ selection: N,
1508
+ matching: O.map(A),
1509
+ label: `Select all ${F(O.length)} matching`
1510
+ })
1511
+ }),
1512
+ /* @__PURE__ */ U("th", { children: "Name" }),
1513
+ /* @__PURE__ */ U("th", { children: "Scope" }),
1514
+ e === "volumes" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("th", { children: "Reclaim policy" }), /* @__PURE__ */ U("th", { children: "Mounted by" })] }) : e === "configs" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("th", { children: "Schedule" }), /* @__PURE__ */ U("th", { children: "Next fire" })] }) : /* @__PURE__ */ U("th", { children: "Type" }),
1515
+ /* @__PURE__ */ U("th", { children: /* @__PURE__ */ U("span", {
1516
+ className: "sr-only",
1517
+ children: "Actions"
1518
+ }) })
1519
+ ] }) }), /* @__PURE__ */ U("tbody", { children: O.slice(k * 25, (k + 1) * 25).map((t) => {
1520
+ let n = [...q(t.metadata), t.metadata.name];
1521
+ return /* @__PURE__ */ W("tr", { children: [
1522
+ /* @__PURE__ */ U("td", {
1523
+ className: "bulk-column",
1524
+ "data-label": "Select",
1525
+ children: /* @__PURE__ */ U(Ve, {
1526
+ selection: N,
1527
+ rowKey: A(t),
1528
+ label: `Select ${Z[e].toLowerCase()} ${n.join(" / ")}`
1529
+ })
1530
+ }),
1531
+ /* @__PURE__ */ W("td", {
1532
+ "data-label": "Name",
1533
+ children: [
1534
+ /* @__PURE__ */ U("a", {
1535
+ className: "resource-name",
1536
+ href: J(e, n),
1537
+ children: t.metadata.name
1538
+ }),
1539
+ e === "configs" && j(t) && /* @__PURE__ */ W(H, { children: [" ", /* @__PURE__ */ U(mt, {})] }),
1540
+ e === "configs" && /* @__PURE__ */ W(H, { children: [" ", /* @__PURE__ */ U(ee, { config: t })] })
1541
+ ]
1542
+ }),
1543
+ /* @__PURE__ */ U("td", {
1544
+ className: "scope-cell",
1545
+ "data-label": "Scope",
1546
+ children: /* @__PURE__ */ U(ve, { parts: n.slice(0, -1) })
1547
+ }),
1548
+ e === "volumes" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("td", {
1549
+ "data-label": "Reclaim policy",
1550
+ children: t.spec?.reclaimPolicy || "Delete"
1551
+ }), /* @__PURE__ */ U("td", {
1552
+ "data-label": "Mounted by",
1553
+ title: "Cells in the inventory that mount this Volume",
1554
+ children: s(t)
1555
+ })] }) : e === "configs" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("td", {
1556
+ className: "mono-id",
1557
+ "data-label": "Schedule",
1558
+ children: ue(t) || "—"
1559
+ }), /* @__PURE__ */ U("td", {
1560
+ className: "mono-id",
1561
+ "data-label": "Next fire",
1562
+ children: R(t) === "suspended" ? "suspended" : R(t) ? /* @__PURE__ */ U("time", {
1563
+ dateTime: R(t),
1564
+ title: fe(R(t)) ? new Date(R(t)).toLocaleString() : void 0,
1565
+ children: R(t)
1566
+ }) : "—"
1567
+ })] }) : /* @__PURE__ */ U("td", {
1568
+ "data-label": "Type",
1569
+ children: t.kind || f[e]
1570
+ }),
1571
+ /* @__PURE__ */ U("td", {
1572
+ className: "row-actions",
1573
+ children: /* @__PURE__ */ W(_e, { children: [
1574
+ e === "configs" && /* @__PURE__ */ U(G, {
1575
+ icon: "create",
1576
+ href: o(n),
1577
+ label: `New cell from config ${n.join(" / ")}`,
1578
+ title: "New cell from this config"
1579
+ }),
1580
+ e === "blueprints" && /* @__PURE__ */ U(G, {
1581
+ icon: "create",
1582
+ href: g(n),
1583
+ label: `New config from blueprint ${n.join(" / ")}`,
1584
+ title: "New config from this blueprint"
1585
+ }),
1586
+ e === "secrets" && !Q(t) && /* @__PURE__ */ U(G, {
1587
+ icon: "edit",
1588
+ href: u(e, n, { edit: !0 }),
1589
+ label: `Replace value of secret ${n.join(" / ")}`,
1590
+ title: "Replace value…"
1591
+ }),
1592
+ /* @__PURE__ */ U(ge, {
1593
+ href: J(e, n, !0),
1594
+ label: n.join(" / ")
1595
+ }),
1596
+ /* @__PURE__ */ U(G, {
1597
+ icon: "delete",
1598
+ danger: !0,
1599
+ label: `Delete ${Z[e].toLowerCase()} ${n.join(" / ")}`,
1600
+ title: "Delete…",
1601
+ disabled: m.has(JSON.stringify(n)),
1602
+ busy: m.has(JSON.stringify(n)),
1603
+ onClick: () => p(t)
1604
+ })
1605
+ ] })
1606
+ })
1607
+ ] }, JSON.stringify(n));
1608
+ }) })]
1609
+ })
1610
+ }),
1611
+ !a.loading && !O.length && /* @__PURE__ */ U("div", {
1612
+ className: "empty-state",
1613
+ children: /* @__PURE__ */ U("h3", { children: a.error ? "Resources could not be loaded" : a.data?.length ? "No matching resources" : `No ${e} found` })
1614
+ }),
1615
+ /* @__PURE__ */ W("div", {
1616
+ className: "pagination",
1617
+ children: [
1618
+ /* @__PURE__ */ U("span", { children: O.length ? `${k * 25 + 1}–${Math.min((k + 1) * 25, O.length)} of ${O.length}` : "0 results" }),
1619
+ /* @__PURE__ */ U("button", {
1620
+ disabled: !k,
1621
+ onClick: () => D(k - 1),
1622
+ children: "Previous"
1623
+ }),
1624
+ /* @__PURE__ */ U("button", {
1625
+ disabled: (k + 1) * 25 >= O.length,
1626
+ onClick: () => D(k + 1),
1627
+ children: "Next"
1628
+ })
1629
+ ]
1630
+ })
1631
+ ]
1632
+ }),
1633
+ d && /* @__PURE__ */ U(ct, {
1634
+ kind: e,
1635
+ doc: d,
1636
+ revision: n,
1637
+ inventory: r,
1638
+ onCancel: () => p(null),
1639
+ onConfirm: () => {
1640
+ let e = [...q(d.metadata), d.metadata.name];
1641
+ p(null), C(e);
1642
+ }
1643
+ })
1644
+ ] });
1645
+ }
1646
+ function Q(e) {
1647
+ return typeof e.spec?.connector == "string" ? e.spec.connector : "";
1648
+ }
1649
+ function dt({ doc: e, scope: t, edit: n, onChanged: i }) {
1650
+ let a = Q(e), o = u("secrets", t);
1651
+ return a ? /* @__PURE__ */ W("section", {
1652
+ className: "panel secret-value",
1653
+ "aria-label": "Secret value",
1654
+ children: [/* @__PURE__ */ U("div", {
1655
+ className: "panel-heading",
1656
+ children: /* @__PURE__ */ U("h2", { children: "Value" })
1657
+ }), /* @__PURE__ */ U("div", {
1658
+ className: "panel-body",
1659
+ children: /* @__PURE__ */ W("p", {
1660
+ className: "description",
1661
+ children: [
1662
+ "This Secret is an identity of connector ",
1663
+ /* @__PURE__ */ U("a", {
1664
+ className: "resource-name",
1665
+ href: A(a),
1666
+ children: /* @__PURE__ */ U("code", { children: a })
1667
+ }),
1668
+ ". Rotate it on the Identities page, which checks it against the connector; it is not replaced here."
1669
+ ]
1670
+ })
1671
+ })]
1672
+ }) : /* @__PURE__ */ W("section", {
1673
+ className: "panel secret-value",
1674
+ "aria-label": "Secret value",
1675
+ children: [/* @__PURE__ */ W("div", {
1676
+ className: "panel-heading",
1677
+ children: [/* @__PURE__ */ U("h2", { children: "Value" }), !n && /* @__PURE__ */ U("a", {
1678
+ className: "document-action",
1679
+ href: u("secrets", t, { edit: !0 }),
1680
+ children: "Replace value"
1681
+ })]
1682
+ }), /* @__PURE__ */ U("div", {
1683
+ className: "panel-body",
1684
+ children: n ? /* @__PURE__ */ U(xe, {
1685
+ scope: t.slice(0, -1),
1686
+ existing: e,
1687
+ onSaved: () => {
1688
+ i(), r(o);
1689
+ },
1690
+ onCancel: () => {
1691
+ r(o);
1692
+ }
1693
+ }) : /* @__PURE__ */ U("p", {
1694
+ className: "description",
1695
+ children: "The value is write-only and never shown. Replace value stores new material under the same name, scope and type."
1696
+ })
1697
+ })]
1698
+ });
1699
+ }
1700
+ function ft({ doc: e, inventory: t }) {
1701
+ let n = e.spec?.schedule, r = e.status?.schedule;
1702
+ return /* @__PURE__ */ W("section", {
1703
+ className: "panel config-schedule",
1704
+ "aria-label": "Schedule",
1705
+ children: [/* @__PURE__ */ W("div", {
1706
+ className: "panel-heading",
1707
+ children: [/* @__PURE__ */ U("h2", { children: "Schedule" }), /* @__PURE__ */ U("span", {
1708
+ className: "badge",
1709
+ children: "From spec.schedule"
1710
+ })]
1711
+ }), /* @__PURE__ */ W("div", {
1712
+ className: "panel-body",
1713
+ children: [
1714
+ /* @__PURE__ */ W("p", {
1715
+ className: "description",
1716
+ children: [
1717
+ "Each fire creates and starts the cell ",
1718
+ /* @__PURE__ */ W("code", { children: [e.metadata.name, "-<unix time>"] }),
1719
+ ", which deletes itself when it ends; only this status remains after a run. The schedule is edited in the Config document, not here."
1720
+ ]
1721
+ }),
1722
+ !r && /* @__PURE__ */ U("p", {
1723
+ className: "description",
1724
+ role: "status",
1725
+ children: "kukeond's scheduler has not visited this Config yet; it fills the status within a minute of the apply."
1726
+ }),
1727
+ /* @__PURE__ */ U(pe, {
1728
+ schedule: n,
1729
+ status: r,
1730
+ cellLink: de(t.data, e)
1731
+ })
1732
+ ]
1733
+ })]
1734
+ });
1735
+ }
1736
+ var $ = {
1737
+ configs: "CellConfig",
1738
+ blueprints: "CellBlueprint",
1739
+ volumes: "volume"
1740
+ };
1741
+ function pt(e, t) {
1742
+ let n = t.spec ?? {}, r = t.status;
1743
+ return e === "configs" ? [
1744
+ `stored, blueprint ${n.blueprint?.name ?? "not set"}`,
1745
+ n.schedule ? `schedule ${n.schedule.cron}${n.schedule.suspend ? " (suspended)" : ""}` : "",
1746
+ r?.schedule?.lastError ? `last schedule error: ${r.schedule.lastError}` : ""
1747
+ ].filter(Boolean).join(", ") : e === "volumes" ? `stored${n.reclaimPolicy ? `, reclaim policy ${n.reclaimPolicy}` : ""}` : "stored";
1748
+ }
1749
+ function mt() {
1750
+ return /* @__PURE__ */ U("span", {
1751
+ className: "badge template-badge",
1752
+ title: "Agent template: New agent copies it; it is not listed as an agent",
1753
+ children: "Template"
1754
+ });
1755
+ }
1756
+ function ht({ doc: e, inventory: t, onChanged: n }) {
1757
+ let r = ae(e), i = ie(e).name, a = {
1758
+ name: e.metadata.name,
1759
+ realm: e.metadata.realm ?? "",
1760
+ space: e.metadata.space,
1761
+ stack: e.metadata.stack
1762
+ };
1763
+ return /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Display name" }), /* @__PURE__ */ W("dd", {
1764
+ className: "display-name-row",
1765
+ children: [/* @__PURE__ */ U("span", { children: r || /* @__PURE__ */ W("span", {
1766
+ className: "description",
1767
+ children: ["None — listed as ", i || e.metadata.name]
1768
+ }) }), !j(e) && /* @__PURE__ */ U(De, {
1769
+ subject: `agent ${q(e.metadata).concat(e.metadata.name).join(" / ")}`,
1770
+ current: r,
1771
+ onSave: async (e) => {
1772
+ t.setConfigAnnotations(a, await Te(a, e)), n();
1773
+ }
1774
+ })]
1775
+ })] });
1776
+ }
1777
+ function gt({ kind: e, scope: t, document: r, edit: i = !1, revision: a, inventory: s, onChanged: l }) {
1778
+ let u = c(L(e, t), a), p = u.data;
1779
+ return /* @__PURE__ */ W(H, { children: [
1780
+ /* @__PURE__ */ W("div", {
1781
+ className: "detail-actions",
1782
+ children: [/* @__PURE__ */ W("a", {
1783
+ href: d(`/${e}`),
1784
+ children: ["← Back to ", e]
1785
+ }), /* @__PURE__ */ W("div", { children: [
1786
+ p && $[e] && /* @__PURE__ */ U(le, {
1787
+ question: ce($[e], t, pt(e, p)),
1788
+ subject: `${$[e]} ${t.join(" / ")}`
1789
+ }),
1790
+ /* @__PURE__ */ U("a", {
1791
+ className: "document-action",
1792
+ href: J(e, t, !r),
1793
+ children: r ? "Show overview" : "View document"
1794
+ }),
1795
+ p && e === "configs" && !r && /* @__PURE__ */ W("a", {
1796
+ className: "new-cell-action",
1797
+ href: o(t),
1798
+ children: ["Create Cell from this Config ", /* @__PURE__ */ U("span", {
1799
+ "aria-hidden": "true",
1800
+ children: "→"
1801
+ })]
1802
+ }),
1803
+ p && e === "blueprints" && !r && /* @__PURE__ */ W("a", {
1804
+ className: "new-cell-action",
1805
+ href: g(t),
1806
+ children: ["Create Config from this Blueprint ", /* @__PURE__ */ U("span", {
1807
+ "aria-hidden": "true",
1808
+ children: "→"
1809
+ })]
1810
+ })
1811
+ ] })]
1812
+ }),
1813
+ u.loading && /* @__PURE__ */ W("p", {
1814
+ role: "status",
1815
+ children: [
1816
+ "Loading ",
1817
+ e,
1818
+ " document…"
1819
+ ]
1820
+ }),
1821
+ u.error && /* @__PURE__ */ U(_, {
1822
+ error: u.error,
1823
+ kind: f[e].replace(/s$/, "")
1824
+ }),
1825
+ u.error && p && /* @__PURE__ */ W("p", {
1826
+ className: "stale",
1827
+ children: [
1828
+ "Stale ",
1829
+ e,
1830
+ " document — refresh failed."
1831
+ ]
1832
+ }),
1833
+ e === "secrets" && /* @__PURE__ */ U("p", {
1834
+ className: "description",
1835
+ children: "Secret values are redacted. Only daemon-exposed metadata is available."
1836
+ }),
1837
+ p && /* @__PURE__ */ W("section", {
1838
+ className: "panel",
1839
+ children: [/* @__PURE__ */ W("div", {
1840
+ className: "panel-heading",
1841
+ children: [/* @__PURE__ */ U("h2", { children: r ? "API document" : "Resource overview" }), e !== "secrets" && /* @__PURE__ */ U("span", {
1842
+ className: "badge",
1843
+ title: `Edits are not supported here. Delete ${e} from the list.`,
1844
+ children: "No edits — delete from list"
1845
+ })]
1846
+ }), r ? /* @__PURE__ */ U("pre", {
1847
+ tabIndex: 0,
1848
+ "aria-label": `Complete ${e} JSON`,
1849
+ children: JSON.stringify(p, null, 2)
1850
+ }) : /* @__PURE__ */ W("div", {
1851
+ className: "panel-body",
1852
+ children: [/* @__PURE__ */ W("dl", {
1853
+ className: "details-grid",
1854
+ children: [
1855
+ /* @__PURE__ */ U("dt", { children: "Name" }),
1856
+ /* @__PURE__ */ W("dd", { children: [p.metadata.name, e === "configs" && j(p) && /* @__PURE__ */ W(H, { children: [" ", /* @__PURE__ */ U(mt, {})] })] }),
1857
+ e === "configs" && /* @__PURE__ */ U(ht, {
1858
+ doc: p,
1859
+ inventory: s,
1860
+ onChanged: l
1861
+ }),
1862
+ /* @__PURE__ */ U("dt", { children: "Scope" }),
1863
+ /* @__PURE__ */ U("dd", { children: q(p.metadata).join(" / ") }),
1864
+ /* @__PURE__ */ U("dt", { children: "Kind" }),
1865
+ /* @__PURE__ */ U("dd", { children: p.kind }),
1866
+ e === "secrets" && /* @__PURE__ */ W(H, { children: [
1867
+ /* @__PURE__ */ U("dt", { children: "Type" }),
1868
+ /* @__PURE__ */ U("dd", { children: n(p) }),
1869
+ Q(p) && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Identity of connector" }), /* @__PURE__ */ U("dd", { children: /* @__PURE__ */ U("a", {
1870
+ className: "resource-name",
1871
+ href: D(Q(p)),
1872
+ children: /* @__PURE__ */ U("code", { children: Q(p) })
1873
+ }) })] })
1874
+ ] }),
1875
+ e !== "volumes" && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Labels" }), /* @__PURE__ */ W("dd", { children: [Object.entries(p.metadata.labels ?? {}).map(([e, t]) => /* @__PURE__ */ W("span", {
1876
+ className: "badge label-badge",
1877
+ children: [
1878
+ e,
1879
+ ": ",
1880
+ t
1881
+ ]
1882
+ }, e)), !Object.keys(p.metadata.labels ?? {}).length && "No labels"] })] }),
1883
+ e === "configs" && m(p) && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Team" }), /* @__PURE__ */ W("dd", { children: [
1884
+ /* @__PURE__ */ U("a", {
1885
+ className: "resource-name",
1886
+ href: b(m(p)),
1887
+ children: m(p)
1888
+ }),
1889
+ " ",
1890
+ /* @__PURE__ */ U("span", {
1891
+ className: "description",
1892
+ children: "Rendered by the team; edit it on the Teams page."
1893
+ })
1894
+ ] })] }),
1895
+ e === "configs" && !p.spec?.schedule && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Schedule" }), /* @__PURE__ */ U("dd", { children: "None" })] }),
1896
+ e === "volumes" && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Reclaim policy" }), /* @__PURE__ */ U("dd", { children: p.spec?.reclaimPolicy || "Default (Delete)" })] })
1897
+ ]
1898
+ }), /* @__PURE__ */ U("p", {
1899
+ className: "description",
1900
+ children: "Use View document for every API-exposed field."
1901
+ })]
1902
+ })]
1903
+ }),
1904
+ p && e === "secrets" && !r && /* @__PURE__ */ U(dt, {
1905
+ doc: p,
1906
+ scope: t,
1907
+ edit: i,
1908
+ onChanged: l
1909
+ }),
1910
+ p && e === "configs" && !r && !!p.spec?.schedule && /* @__PURE__ */ U(ft, {
1911
+ doc: p,
1912
+ inventory: s
1913
+ }),
1914
+ p && e === "configs" && !r && /* @__PURE__ */ U(E, {
1915
+ doc: p,
1916
+ scope: t,
1917
+ revision: a,
1918
+ onChanged: l
1919
+ }),
1920
+ p && !r && /* @__PURE__ */ U(at, {
1921
+ doc: p,
1922
+ revision: a
1923
+ }),
1924
+ p && e === "configs" && !r && /* @__PURE__ */ U(rt, {
1925
+ doc: p,
1926
+ revision: a,
1927
+ inventory: s
1928
+ }),
1929
+ p && e === "blueprints" && !r && /* @__PURE__ */ U(it, {
1930
+ doc: p,
1931
+ revision: a,
1932
+ inventory: s
1933
+ }),
1934
+ p && e === "volumes" && !r && /* @__PURE__ */ U(nt, {
1935
+ doc: p,
1936
+ revision: a,
1937
+ inventory: s
1938
+ })
1939
+ ] });
1940
+ }
1941
+ function _t(e) {
1942
+ return e.scope.length ? /* @__PURE__ */ U(gt, { ...e }, e.kind + JSON.stringify(e.scope)) : /* @__PURE__ */ U(ut, {
1943
+ kind: e.kind,
1944
+ revision: e.revision,
1945
+ inventory: e.inventory,
1946
+ onChanged: e.onChanged
1947
+ }, e.kind);
1948
+ }
1949
+ export { We as a, Ge as c, Ee as d, Te as f, J as i, ze as l, _t as n, Be as o, Se as p, at as r, Ve as s, ct as t, De as u };