@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,1985 @@
1
+ import { $t as e, Bt as t, Fn as n, Ft as r, In as i, It as a, Kn as o, Mt as s, Pt as c, Rn as l, Vn as u, a as d, cn as f, en as p, fn as ee, g as m, gt as h, i as te, in as ne, l as re, n as ie, pn as ae, s as oe, xt as g, yn as se, zt as _ } from "./connector-ui-CG9kLZ5s.js";
2
+ import { d as ce, n as v, r as y } from "./merged-values-CBzWsNOS.js";
3
+ import { r as b, t as x } from "./catalog-url-Dr9e92Yq.js";
4
+ import { useEffect as le, useMemo as ue, useRef as S, useState as C } from "react";
5
+ import { apiFetch as de } from "@kukeon/api-client";
6
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
7
+ import { Disclosure as D } from "@kukeon/ui";
8
+ // src/creation-schema.mjs
9
+ var O = [{
10
+ key: "name",
11
+ label: "Name",
12
+ kind: "text",
13
+ required: !0
14
+ }, {
15
+ key: "email",
16
+ label: "Email",
17
+ kind: "text",
18
+ required: !0
19
+ }], k = [
20
+ {
21
+ key: "id",
22
+ label: "Container ID / name",
23
+ kind: "text",
24
+ required: !0
25
+ },
26
+ {
27
+ key: "image",
28
+ label: "OCI image",
29
+ kind: "text",
30
+ required: !0,
31
+ help: "For example: ghcr.io/example/app:latest"
32
+ },
33
+ {
34
+ key: "command",
35
+ label: "Command",
36
+ kind: "text"
37
+ },
38
+ {
39
+ key: "args",
40
+ label: "Arguments",
41
+ kind: "strings",
42
+ help: "One argument per row."
43
+ },
44
+ {
45
+ key: "workingDir",
46
+ label: "Working directory",
47
+ kind: "text"
48
+ },
49
+ {
50
+ key: "env",
51
+ label: "Environment variables",
52
+ kind: "env",
53
+ help: "Values are redacted in previews and server errors. Prefer Secret references for credentials."
54
+ },
55
+ {
56
+ key: "attachable",
57
+ label: "Attachable terminal",
58
+ kind: "boolean"
59
+ },
60
+ {
61
+ key: "root",
62
+ label: "Explicitly mark this container as the root",
63
+ kind: "boolean",
64
+ advanced: !0,
65
+ help: "Leave off to let kukeon add its default root container."
66
+ },
67
+ {
68
+ key: "volumes",
69
+ label: "Volumes and mounts",
70
+ kind: "objects",
71
+ advanced: !0,
72
+ itemLabel: "Mount",
73
+ fields: [
74
+ {
75
+ key: "kind",
76
+ label: "Mount kind",
77
+ kind: "enum",
78
+ options: [
79
+ "bind",
80
+ "tmpfs",
81
+ "volume"
82
+ ]
83
+ },
84
+ {
85
+ key: "source",
86
+ label: "Source / volume name",
87
+ kind: "text"
88
+ },
89
+ {
90
+ key: "target",
91
+ label: "Container target",
92
+ kind: "text",
93
+ required: !0
94
+ },
95
+ {
96
+ key: "readOnly",
97
+ label: "Read only",
98
+ kind: "boolean"
99
+ },
100
+ {
101
+ key: "sizeBytes",
102
+ label: "Size (bytes)",
103
+ kind: "number"
104
+ },
105
+ {
106
+ key: "mode",
107
+ label: "Mode",
108
+ kind: "number"
109
+ },
110
+ {
111
+ key: "ensure",
112
+ label: "Create referenced volume if missing",
113
+ kind: "boolean"
114
+ },
115
+ {
116
+ key: "volumeRef",
117
+ label: "Scoped volume reference",
118
+ kind: "object",
119
+ fields: [
120
+ {
121
+ key: "name",
122
+ label: "Volume name",
123
+ kind: "text",
124
+ required: !0
125
+ },
126
+ {
127
+ key: "realm",
128
+ label: "Realm",
129
+ kind: "text",
130
+ required: !0
131
+ },
132
+ {
133
+ key: "space",
134
+ label: "Space",
135
+ kind: "text"
136
+ },
137
+ {
138
+ key: "stack",
139
+ label: "Stack",
140
+ kind: "text"
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ key: "privileged",
148
+ label: "Privileged mode",
149
+ kind: "boolean",
150
+ advanced: !0
151
+ },
152
+ {
153
+ key: "hostNetwork",
154
+ label: "Host network namespace",
155
+ kind: "boolean",
156
+ advanced: !0
157
+ },
158
+ {
159
+ key: "hostPID",
160
+ label: "Host PID namespace",
161
+ kind: "boolean",
162
+ advanced: !0
163
+ },
164
+ {
165
+ key: "hostCgroup",
166
+ label: "Host cgroup namespace",
167
+ kind: "boolean",
168
+ advanced: !0
169
+ },
170
+ {
171
+ key: "user",
172
+ label: "User",
173
+ kind: "text",
174
+ advanced: !0
175
+ },
176
+ {
177
+ key: "readOnlyRootFilesystem",
178
+ label: "Read-only root filesystem",
179
+ kind: "boolean",
180
+ advanced: !0
181
+ },
182
+ {
183
+ key: "capabilities",
184
+ label: "Linux capabilities",
185
+ kind: "object",
186
+ advanced: !0,
187
+ fields: [{
188
+ key: "add",
189
+ label: "Add",
190
+ kind: "strings"
191
+ }, {
192
+ key: "drop",
193
+ label: "Drop",
194
+ kind: "strings"
195
+ }]
196
+ },
197
+ {
198
+ key: "securityOpts",
199
+ label: "Security options",
200
+ kind: "strings",
201
+ advanced: !0
202
+ },
203
+ {
204
+ key: "devices",
205
+ label: "Device passthrough paths",
206
+ kind: "strings",
207
+ advanced: !0
208
+ },
209
+ {
210
+ key: "tmpfs",
211
+ label: "Tmpfs mounts",
212
+ kind: "objects",
213
+ advanced: !0,
214
+ itemLabel: "Tmpfs mount",
215
+ fields: [
216
+ {
217
+ key: "path",
218
+ label: "Container path",
219
+ kind: "text",
220
+ required: !0
221
+ },
222
+ {
223
+ key: "sizeBytes",
224
+ label: "Size (bytes)",
225
+ kind: "number"
226
+ },
227
+ {
228
+ key: "options",
229
+ label: "Mount options",
230
+ kind: "strings"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ key: "resources",
236
+ label: "Resource limits",
237
+ kind: "object",
238
+ advanced: !0,
239
+ fields: [
240
+ {
241
+ key: "memoryLimitBytes",
242
+ label: "Memory limit (bytes)",
243
+ kind: "number"
244
+ },
245
+ {
246
+ key: "cpuShares",
247
+ label: "CPU shares",
248
+ kind: "number"
249
+ },
250
+ {
251
+ key: "pidsLimit",
252
+ label: "PIDs limit",
253
+ kind: "number"
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ key: "secrets",
259
+ label: "Secret references",
260
+ kind: "objects",
261
+ advanced: !0,
262
+ itemLabel: "Secret",
263
+ fields: [
264
+ {
265
+ key: "name",
266
+ label: "Container secret name",
267
+ kind: "text",
268
+ required: !0
269
+ },
270
+ {
271
+ key: "fromFile",
272
+ label: "Read host file",
273
+ kind: "text"
274
+ },
275
+ {
276
+ key: "fromEnv",
277
+ label: "Read host environment variable",
278
+ kind: "text"
279
+ },
280
+ {
281
+ key: "mountPath",
282
+ label: "Mount path",
283
+ kind: "text"
284
+ },
285
+ {
286
+ key: "secretRef",
287
+ label: "kukeon Secret reference",
288
+ kind: "object",
289
+ fields: [
290
+ {
291
+ key: "name",
292
+ label: "Secret name",
293
+ kind: "text",
294
+ required: !0
295
+ },
296
+ {
297
+ key: "realm",
298
+ label: "Realm",
299
+ kind: "text",
300
+ required: !0
301
+ },
302
+ {
303
+ key: "space",
304
+ label: "Space",
305
+ kind: "text"
306
+ },
307
+ {
308
+ key: "stack",
309
+ label: "Stack",
310
+ kind: "text"
311
+ },
312
+ {
313
+ key: "cell",
314
+ label: "Cell",
315
+ kind: "text"
316
+ }
317
+ ]
318
+ }
319
+ ]
320
+ },
321
+ {
322
+ key: "repos",
323
+ label: "Repository configuration",
324
+ kind: "objects",
325
+ advanced: !0,
326
+ itemLabel: "Repository",
327
+ sourcePicker: !0,
328
+ fields: [
329
+ {
330
+ key: "name",
331
+ label: "Name",
332
+ kind: "text",
333
+ required: !0
334
+ },
335
+ {
336
+ key: "target",
337
+ label: "Target path",
338
+ kind: "text",
339
+ required: !0
340
+ },
341
+ {
342
+ key: "url",
343
+ label: "Repository URL",
344
+ kind: "text",
345
+ required: !0
346
+ },
347
+ {
348
+ key: "branch",
349
+ label: "Branch",
350
+ kind: "text"
351
+ },
352
+ {
353
+ key: "ref",
354
+ label: "Tag or commit ref",
355
+ kind: "text"
356
+ },
357
+ {
358
+ key: "required",
359
+ label: "Fail if setup fails",
360
+ kind: "boolean"
361
+ }
362
+ ]
363
+ },
364
+ {
365
+ key: "git",
366
+ label: "Git identity and signing",
367
+ kind: "object",
368
+ advanced: !0,
369
+ fields: [
370
+ {
371
+ key: "author",
372
+ label: "Author",
373
+ kind: "object",
374
+ fields: O
375
+ },
376
+ {
377
+ key: "committer",
378
+ label: "Committer",
379
+ kind: "object",
380
+ fields: O
381
+ },
382
+ {
383
+ key: "signingKey",
384
+ label: "Signing key path",
385
+ kind: "text"
386
+ },
387
+ {
388
+ key: "sign",
389
+ label: "Sign",
390
+ kind: "strings"
391
+ },
392
+ {
393
+ key: "allowedSigners",
394
+ label: "Allowed signers file",
395
+ kind: "text"
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ key: "cniConfigPath",
401
+ label: "CNI configuration path",
402
+ kind: "text",
403
+ advanced: !0
404
+ },
405
+ {
406
+ key: "restartPolicy",
407
+ label: "Restart policy",
408
+ kind: "enum",
409
+ options: [
410
+ "",
411
+ "never",
412
+ "always",
413
+ "on-failure"
414
+ ],
415
+ advanced: !0
416
+ },
417
+ {
418
+ key: "restartBackoffSeconds",
419
+ label: "Restart backoff (seconds)",
420
+ kind: "number",
421
+ advanced: !0
422
+ },
423
+ {
424
+ key: "restartMaxRetries",
425
+ label: "Maximum restart retries",
426
+ kind: "number",
427
+ advanced: !0
428
+ },
429
+ {
430
+ key: "tty",
431
+ label: "Attachable TTY configuration",
432
+ kind: "object",
433
+ advanced: !0,
434
+ fields: [
435
+ {
436
+ key: "prompt",
437
+ label: "Prompt",
438
+ kind: "text"
439
+ },
440
+ {
441
+ key: "logFile",
442
+ label: "Log file",
443
+ kind: "text"
444
+ },
445
+ {
446
+ key: "logLevel",
447
+ label: "Log level",
448
+ kind: "enum",
449
+ options: [
450
+ "debug",
451
+ "info",
452
+ "warn",
453
+ "error"
454
+ ]
455
+ },
456
+ {
457
+ key: "onInit",
458
+ label: "Initialization scripts",
459
+ kind: "objects",
460
+ itemLabel: "Script",
461
+ fields: [{
462
+ key: "script",
463
+ label: "Script",
464
+ kind: "text",
465
+ required: !0
466
+ }, {
467
+ key: "runOn",
468
+ label: "Run on",
469
+ kind: "enum",
470
+ options: ["start", "create"]
471
+ }]
472
+ }
473
+ ]
474
+ }
475
+ ], fe = [
476
+ {
477
+ key: "rootContainerId",
478
+ label: "Explicit root container ID",
479
+ kind: "text",
480
+ help: "Leave empty to use an explicitly marked root or kukeon's generated default."
481
+ },
482
+ {
483
+ key: "tty",
484
+ label: "Cell TTY settings",
485
+ kind: "object",
486
+ fields: [{
487
+ key: "default",
488
+ label: "Default attachable container",
489
+ kind: "text"
490
+ }]
491
+ },
492
+ {
493
+ key: "nestedCgroupRuntime",
494
+ label: "Nested cgroup runtime",
495
+ kind: "boolean"
496
+ },
497
+ {
498
+ key: "ignoreDiskPressure",
499
+ label: "Ignore disk pressure for this creation",
500
+ kind: "boolean"
501
+ }
502
+ ];
503
+ // src/new-cell.tsx
504
+ function pe(e) {
505
+ return [
506
+ e.realm,
507
+ e.space,
508
+ e.stack,
509
+ e.name
510
+ ].filter((e) => !!e);
511
+ }
512
+ function A(e, t, n = !1) {
513
+ return s(`/${e}/` + t.map(encodeURIComponent).join("/") + (n ? "?document=1" : ""));
514
+ }
515
+ function j(e) {
516
+ return e.join(" / ");
517
+ }
518
+ function me(e) {
519
+ return typeof e.name != "string" || typeof e.realm != "string" ? null : x("blueprints", b(e));
520
+ }
521
+ function M(e, t, n) {
522
+ return {
523
+ ...e,
524
+ [t]: n
525
+ };
526
+ }
527
+ function N(e) {
528
+ return Object.fromEntries(e.filter((e) => e.kind !== "objects").map((e) => [e.key, e.kind === "boolean" ? !1 : e.kind === "strings" || e.kind === "env" ? [] : e.kind === "map" ? {} : e.kind === "number" || e.kind === "object" ? void 0 : ""]));
529
+ }
530
+ function P(e, t, n) {
531
+ let r = {};
532
+ for (let i of t) {
533
+ let t = `${n}.${i.key}`, a = e[i.key];
534
+ i.required && (a == null || String(a).trim() === "") && (r[t] = "This field is required."), i.kind === "object" && i.fields && a && typeof a == "object" && Object.assign(r, P(a, i.fields, t)), i.kind === "objects" && i.fields && Array.isArray(a) && a.forEach((e, n) => Object.assign(r, P(e, i.fields, `${t}.${n}`)));
535
+ }
536
+ return r;
537
+ }
538
+ function he({ document: e, connectors: n }) {
539
+ let r = e.spec.containers ?? [], i = [...new Set(r.map((e) => e.image).filter((e) => !!e))];
540
+ return /* @__PURE__ */ E("dl", {
541
+ className: "details-grid creation-summary",
542
+ children: [
543
+ /* @__PURE__ */ T("dt", { children: "Name" }),
544
+ /* @__PURE__ */ T("dd", { children: e.metadata.name }),
545
+ /* @__PURE__ */ T("dt", { children: "Scope" }),
546
+ /* @__PURE__ */ T("dd", {
547
+ className: "mono-id",
548
+ children: j([
549
+ e.spec.realmId,
550
+ e.spec.spaceId,
551
+ e.spec.stackId
552
+ ])
553
+ }),
554
+ /* @__PURE__ */ T("dt", { children: "Containers" }),
555
+ /* @__PURE__ */ T("dd", { children: r.length ? `${r.length} (${r.map((e) => e.id).join(", ")})` : "None declared" }),
556
+ /* @__PURE__ */ T("dt", { children: "Images" }),
557
+ /* @__PURE__ */ T("dd", { children: i.length ? i.map((e) => /* @__PURE__ */ T("code", {
558
+ className: "creation-summary-image",
559
+ children: e
560
+ }, e)) : "None declared" }),
561
+ /* @__PURE__ */ T("dt", { children: "Connectors" }),
562
+ /* @__PURE__ */ T("dd", { children: n?.length ? n.map((e) => `${t(e)}${e.method ? ` (${e.method})` : ""}`).join(", ") : "None" })
563
+ ]
564
+ });
565
+ }
566
+ function ge({ document: e, label: t }) {
567
+ return /* @__PURE__ */ E("details", {
568
+ className: "creation-json",
569
+ children: [/* @__PURE__ */ T("summary", { children: "Full preview (JSON)" }), /* @__PURE__ */ T("pre", {
570
+ tabIndex: 0,
571
+ "aria-label": t,
572
+ children: JSON.stringify(e, null, 2)
573
+ })]
574
+ });
575
+ }
576
+ function _e(e) {
577
+ let t = S(null);
578
+ return le(() => {
579
+ e && t.current?.scrollIntoView({ block: "nearest" });
580
+ }, [e]), t;
581
+ }
582
+ var ve = ({ review: e, onHide: t, children: n }) => /* @__PURE__ */ E("section", {
583
+ className: "panel preview-panel",
584
+ "aria-label": "Preview",
585
+ ref: e,
586
+ children: [/* @__PURE__ */ E("div", {
587
+ className: "panel-heading",
588
+ children: [
589
+ /* @__PURE__ */ T("h2", { children: "Preview" }),
590
+ /* @__PURE__ */ T("span", {
591
+ className: "badge",
592
+ children: "Not created yet"
593
+ }),
594
+ /* @__PURE__ */ T("button", {
595
+ type: "button",
596
+ className: "subtle-button",
597
+ onClick: t,
598
+ children: "Hide preview"
599
+ })
600
+ ]
601
+ }), /* @__PURE__ */ T("div", {
602
+ className: "panel-body creation-review",
603
+ children: n
604
+ })]
605
+ });
606
+ function ye({ start: e, attach: t, onStart: n, onAttach: r, pending: i, hasPreview: a, previewLabel: o, canPreview: s, canCreate: c, onPreview: l, onCreate: u }) {
607
+ return /* @__PURE__ */ E("div", {
608
+ className: "form-actions",
609
+ children: [
610
+ /* @__PURE__ */ E("label", {
611
+ className: "schema-check",
612
+ children: [/* @__PURE__ */ T("input", {
613
+ type: "checkbox",
614
+ checked: e,
615
+ disabled: i,
616
+ onChange: (e) => n(e.target.checked)
617
+ }), " Start the cell"]
618
+ }),
619
+ /* @__PURE__ */ E("label", {
620
+ className: "schema-check",
621
+ children: [/* @__PURE__ */ T("input", {
622
+ type: "checkbox",
623
+ checked: e && t,
624
+ disabled: i || !e,
625
+ onChange: (e) => r(e.target.checked)
626
+ }), " Attach a terminal"]
627
+ }),
628
+ /* @__PURE__ */ T("button", {
629
+ type: "button",
630
+ disabled: !s,
631
+ onClick: l,
632
+ children: a ? "Refresh preview" : o
633
+ }),
634
+ /* @__PURE__ */ T("button", {
635
+ type: "button",
636
+ className: "primary-action",
637
+ disabled: !c,
638
+ onClick: u,
639
+ children: "Create Cell"
640
+ })
641
+ ]
642
+ });
643
+ }
644
+ function be({ label: e, value: t, options: n, pinned: r, disabled: i, onChange: a }) {
645
+ let o = n.includes(t) ? n : [t, ...n];
646
+ return /* @__PURE__ */ E("label", {
647
+ className: "schema-field",
648
+ children: [
649
+ e,
650
+ /* @__PURE__ */ T("select", {
651
+ value: t,
652
+ disabled: i || r,
653
+ onChange: (e) => a(e.target.value),
654
+ children: o.map((e) => /* @__PURE__ */ T("option", {
655
+ value: e,
656
+ children: e
657
+ }, e))
658
+ }),
659
+ r && /* @__PURE__ */ T("small", { children: "Set by the Config's scope." })
660
+ ]
661
+ });
662
+ }
663
+ function xe(e, t) {
664
+ return e || (t.includes("default") || !t.length ? "default" : t[0]);
665
+ }
666
+ function F({ label: e, disabled: t, onPick: n }) {
667
+ let r = o(g(), 0), [i, a] = C(""), s = r.data?.sources.find((e) => e.name === i);
668
+ return /* @__PURE__ */ E("div", {
669
+ className: "schema-field repository-source",
670
+ children: [/* @__PURE__ */ E("label", { children: [/* @__PURE__ */ T("span", { children: "From source" }), /* @__PURE__ */ E("select", {
671
+ "aria-label": `From source for ${e}`,
672
+ value: i,
673
+ disabled: t || !r.data?.sources.length,
674
+ onChange: (e) => {
675
+ a(e.target.value);
676
+ let t = r.data?.sources.find((t) => t.name === e.target.value);
677
+ t && n(h(t));
678
+ },
679
+ children: [/* @__PURE__ */ T("option", {
680
+ value: "",
681
+ children: r.data?.sources.length ? "Choose a stored Source…" : "No Source is stored"
682
+ }), r.data?.sources.map((e) => /* @__PURE__ */ E("option", {
683
+ value: e.name,
684
+ children: [
685
+ e.name,
686
+ " — ",
687
+ e.url
688
+ ]
689
+ }, e.name))]
690
+ })] }), s && /* @__PURE__ */ E("small", { children: [
691
+ "Identity: ",
692
+ s.identity || "Default",
693
+ ". The fields are copied; the cell does not follow the Source afterwards."
694
+ ] })]
695
+ });
696
+ }
697
+ function I({ field: e, value: t, onChange: n, path: r, errors: i, disabled: a = !1 }) {
698
+ let o = i[r], s = `field-${r.replace(/[^a-zA-Z0-9_-]/g, "-")}`, c = e.help ? `${s}-help` : void 0, l = o ? `${s}-error` : void 0, u = [c, l].filter(Boolean).join(" ") || void 0;
699
+ if (e.kind === "boolean") return /* @__PURE__ */ E("label", {
700
+ className: "schema-check",
701
+ children: [
702
+ /* @__PURE__ */ T("input", {
703
+ id: s,
704
+ type: "checkbox",
705
+ checked: t === !0,
706
+ disabled: a,
707
+ onChange: (e) => n(e.target.checked),
708
+ "aria-describedby": u
709
+ }),
710
+ e.label,
711
+ e.help && /* @__PURE__ */ T("small", {
712
+ id: c,
713
+ children: e.help
714
+ }),
715
+ o && /* @__PURE__ */ T("small", {
716
+ className: "field-error",
717
+ id: l,
718
+ children: o
719
+ })
720
+ ]
721
+ });
722
+ if (e.kind === "object") {
723
+ let o = t && typeof t == "object" ? t : void 0;
724
+ return /* @__PURE__ */ E("fieldset", {
725
+ className: "schema-object",
726
+ children: [
727
+ /* @__PURE__ */ T("legend", { children: e.label }),
728
+ e.help && /* @__PURE__ */ T("p", {
729
+ className: "description",
730
+ children: e.help
731
+ }),
732
+ o ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
733
+ className: "schema-fields",
734
+ children: (e.fields ?? []).map((e) => /* @__PURE__ */ T(I, {
735
+ field: e,
736
+ value: o[e.key],
737
+ path: `${r}.${e.key}`,
738
+ errors: i,
739
+ disabled: a,
740
+ onChange: (t) => n(M(o, e.key, t))
741
+ }, `${r}.${e.key}`))
742
+ }), /* @__PURE__ */ E("button", {
743
+ type: "button",
744
+ className: "subtle-button",
745
+ disabled: a,
746
+ onClick: () => n(void 0),
747
+ children: ["Remove ", e.label.toLowerCase()]
748
+ })] }) : /* @__PURE__ */ E("button", {
749
+ type: "button",
750
+ disabled: a,
751
+ onClick: () => n(N(e.fields ?? [])),
752
+ children: ["Add ", e.label.toLowerCase()]
753
+ })
754
+ ]
755
+ });
756
+ }
757
+ if (e.kind === "objects") {
758
+ let o = Array.isArray(t) ? t : [];
759
+ return /* @__PURE__ */ E("fieldset", {
760
+ className: "schema-array",
761
+ children: [
762
+ /* @__PURE__ */ T("legend", { children: e.label }),
763
+ e.help && /* @__PURE__ */ T("p", {
764
+ className: "description",
765
+ children: e.help
766
+ }),
767
+ o.map((t, s) => /* @__PURE__ */ E("section", {
768
+ className: "schema-array-item",
769
+ children: [
770
+ /* @__PURE__ */ E("div", {
771
+ className: "schema-array-heading",
772
+ children: [/* @__PURE__ */ E("h4", { children: [
773
+ e.itemLabel ?? e.label.slice(0, -1),
774
+ " ",
775
+ s + 1
776
+ ] }), /* @__PURE__ */ T("button", {
777
+ type: "button",
778
+ className: "subtle-button",
779
+ disabled: a,
780
+ onClick: () => n(o.filter((e, t) => t !== s)),
781
+ children: "Remove"
782
+ })]
783
+ }),
784
+ e.sourcePicker && /* @__PURE__ */ T(F, {
785
+ label: `${e.itemLabel ?? "Item"} ${s + 1}`,
786
+ disabled: a,
787
+ onPick: (e) => n(o.map((t, n) => n === s ? {
788
+ ...t,
789
+ ...e
790
+ } : t))
791
+ }),
792
+ /* @__PURE__ */ T("div", {
793
+ className: "schema-fields",
794
+ children: (e.fields ?? []).map((e) => /* @__PURE__ */ T(I, {
795
+ field: e,
796
+ value: t[e.key],
797
+ path: `${r}.${s}.${e.key}`,
798
+ errors: i,
799
+ disabled: a,
800
+ onChange: (t) => n(o.map((n, r) => r === s ? M(n, e.key, t) : n))
801
+ }, `${r}.${s}.${e.key}`))
802
+ })
803
+ ]
804
+ }, `${r}.${s}`)),
805
+ /* @__PURE__ */ E("button", {
806
+ type: "button",
807
+ disabled: a,
808
+ onClick: () => n([...o, N(e.fields ?? [])]),
809
+ children: ["Add ", e.itemLabel?.toLowerCase() ?? "item"]
810
+ })
811
+ ]
812
+ });
813
+ }
814
+ if (e.kind === "map") {
815
+ let i = Object.entries(t && typeof t == "object" ? t : {}), o = (e, t, r) => {
816
+ let a = { ...Object.fromEntries(i) }, o = i[e]?.[0];
817
+ delete a[o], t.trim() && (a[t] = r), n(a);
818
+ };
819
+ return /* @__PURE__ */ E("fieldset", {
820
+ className: "schema-array",
821
+ children: [
822
+ /* @__PURE__ */ T("legend", { children: e.label }),
823
+ i.map(([e, t], s) => /* @__PURE__ */ E("div", {
824
+ className: "map-entry",
825
+ children: [
826
+ /* @__PURE__ */ E("label", { children: ["Key", /* @__PURE__ */ T("input", {
827
+ value: e,
828
+ disabled: a,
829
+ onChange: (e) => o(s, e.target.value, t)
830
+ })] }),
831
+ /* @__PURE__ */ E("label", { children: ["Value", /* @__PURE__ */ T("input", {
832
+ value: t,
833
+ disabled: a,
834
+ onChange: (t) => o(s, e, t.target.value)
835
+ })] }),
836
+ /* @__PURE__ */ T("button", {
837
+ type: "button",
838
+ className: "subtle-button",
839
+ disabled: a,
840
+ onClick: () => n(Object.fromEntries(i.filter((e, t) => t !== s))),
841
+ children: "Remove"
842
+ })
843
+ ]
844
+ }, `${r}.${s}`)),
845
+ /* @__PURE__ */ T("button", {
846
+ type: "button",
847
+ disabled: a,
848
+ onClick: () => n({
849
+ ...Object.fromEntries(i),
850
+ [`key-${i.length + 1}`]: ""
851
+ }),
852
+ children: "Add key/value"
853
+ })
854
+ ]
855
+ });
856
+ }
857
+ if (e.kind === "strings" || e.kind === "env") {
858
+ let i = Array.isArray(t) ? t : [], o = (e, t) => n(i.map((n, r) => r === e ? t : n));
859
+ return e.kind === "env" ? /* @__PURE__ */ E("fieldset", {
860
+ className: "schema-array",
861
+ children: [
862
+ /* @__PURE__ */ T("legend", { children: e.label }),
863
+ e.help && /* @__PURE__ */ T("p", {
864
+ className: "description",
865
+ children: e.help
866
+ }),
867
+ i.map((e, t) => {
868
+ let [s, ...c] = e.split("="), l = c.join("=");
869
+ return /* @__PURE__ */ E("div", {
870
+ className: "map-entry",
871
+ children: [
872
+ /* @__PURE__ */ E("label", { children: ["Variable", /* @__PURE__ */ T("input", {
873
+ value: s,
874
+ disabled: a,
875
+ onChange: (e) => o(t, `${e.target.value}=${l}`)
876
+ })] }),
877
+ /* @__PURE__ */ E("label", { children: ["Value", /* @__PURE__ */ T("input", {
878
+ value: l,
879
+ disabled: a,
880
+ onChange: (e) => o(t, `${s}=${e.target.value}`)
881
+ })] }),
882
+ /* @__PURE__ */ T("button", {
883
+ type: "button",
884
+ className: "subtle-button",
885
+ disabled: a,
886
+ onClick: () => n(i.filter((e, n) => n !== t)),
887
+ children: "Remove"
888
+ })
889
+ ]
890
+ }, `${r}.${t}`);
891
+ }),
892
+ /* @__PURE__ */ T("button", {
893
+ type: "button",
894
+ disabled: a,
895
+ onClick: () => n([...i, "="]),
896
+ children: "Add environment variable"
897
+ })
898
+ ]
899
+ }) : /* @__PURE__ */ E("fieldset", {
900
+ className: "schema-array",
901
+ children: [
902
+ /* @__PURE__ */ T("legend", { children: e.label }),
903
+ e.help && /* @__PURE__ */ T("p", {
904
+ className: "description",
905
+ children: e.help
906
+ }),
907
+ i.map((t, s) => /* @__PURE__ */ E("div", {
908
+ className: "string-entry",
909
+ children: [/* @__PURE__ */ T("input", {
910
+ "aria-label": `${e.label} ${s + 1}`,
911
+ value: t,
912
+ disabled: a,
913
+ onChange: (e) => o(s, e.target.value)
914
+ }), /* @__PURE__ */ T("button", {
915
+ type: "button",
916
+ className: "subtle-button",
917
+ disabled: a,
918
+ onClick: () => n(i.filter((e, t) => t !== s)),
919
+ children: "Remove"
920
+ })]
921
+ }, `${r}.${s}`)),
922
+ /* @__PURE__ */ E("button", {
923
+ type: "button",
924
+ disabled: a,
925
+ onClick: () => n([...i, ""]),
926
+ children: ["Add ", e.label.toLowerCase().replace(/s$/, "")]
927
+ })
928
+ ]
929
+ });
930
+ }
931
+ let d = e.kind === "enum" ? /* @__PURE__ */ E("select", {
932
+ id: s,
933
+ value: typeof t == "string" ? t : "",
934
+ disabled: a,
935
+ onChange: (e) => n(e.target.value),
936
+ "aria-invalid": !!o,
937
+ "aria-describedby": u,
938
+ children: [/* @__PURE__ */ T("option", {
939
+ value: "",
940
+ children: "Select…"
941
+ }), (e.options ?? []).filter((e) => e !== "").map((e) => /* @__PURE__ */ T("option", { children: e }, e))]
942
+ }) : /* @__PURE__ */ T("input", {
943
+ id: s,
944
+ type: e.kind === "number" ? "number" : "text",
945
+ min: e.kind === "number" ? 0 : void 0,
946
+ value: t == null ? "" : String(t),
947
+ disabled: a,
948
+ "aria-invalid": !!o,
949
+ "aria-describedby": u,
950
+ onChange: (t) => n(e.kind === "number" ? t.target.value === "" ? void 0 : Number(t.target.value) : t.target.value)
951
+ });
952
+ return /* @__PURE__ */ E("label", {
953
+ className: "schema-field",
954
+ htmlFor: s,
955
+ children: [
956
+ /* @__PURE__ */ E("span", { children: [e.label, e.required && /* @__PURE__ */ T("b", {
957
+ "aria-label": "required",
958
+ children: " *"
959
+ })] }),
960
+ d,
961
+ e.help && /* @__PURE__ */ T("small", {
962
+ id: c,
963
+ children: e.help
964
+ }),
965
+ o && /* @__PURE__ */ T("small", {
966
+ className: "field-error",
967
+ id: l,
968
+ children: o
969
+ })
970
+ ]
971
+ });
972
+ }
973
+ function L({ revision: s, inventory: h, configScope: g, onCreated: ue }) {
974
+ let S = o("/catalog/configs", s), [O, k] = C(""), [fe, M] = C(g ? JSON.stringify(g) : ""), [N, P] = C(!g), F = (S.data ?? []).map((e) => ({
975
+ doc: e,
976
+ scope: pe(e.metadata)
977
+ })), I = F.filter(({ scope: e }) => j(e).toLowerCase().includes(O.toLowerCase())), L = F.find((e) => JSON.stringify(e.scope) === fe), Se = N || !S.loading && !L, [R, Ce] = C(0), z = o(L ? x("configs", L.scope) : null, s + R), B = _(z.data), we = o(B.length ? "/connectors" : null, s), [Te, Ee] = C({}), V = r(B, Te), H = ae(B, we.data, Te), U = o(H.some((e) => i(e.delivery)) ? "/catalog/secrets" : null, s + R), De = o(H.some(ne) ? "/connectors/logins" : null, s + R), [Oe, ke] = C({}), [Ae, je] = C(""), W = B.find((e) => !!e.harnessState)?.harnessState ?? "", Me = H.some(ne), Ne = !!W && !Me, Pe = Ne && Ae !== W ? Ae : "", Fe = a(H, Oe), G = u(H, Oe), K = l(z.data), q = z.data?.spec?.blueprint, Ie = !!q && typeof q.name == "string" && !!q.name && typeof q.realm == "string" && !!q.realm && !(q.stack && !q.space), Le = Ie && q ? me(q) : null, J = o(Le, s), Y = b(q), [Re, ze] = C(""), [Be, Ve] = C(""), [He, Ue] = C(!1), [We, Ge] = C(!0), [Ke, qe] = C(!0), [X, Je] = C(), [Z, Ye] = C(!1), [Xe, Ze] = C("preview"), [Qe, $e] = C(""), [et, tt] = C(!1), [nt, rt] = C(!1), [it, at] = C(!1), [ot, st] = C(!1), ct = G.length > 0;
978
+ le(() => {
979
+ ct && tt(!0);
980
+ }, [ct]);
981
+ let lt = L?.doc.metadata.realm || "default", ut = L?.doc.metadata.space || "", dt = L?.doc.metadata.stack || "", [ft, pt] = C(), [mt, ht] = C(), gt = (h.data?.rows[1] ?? []).filter((e) => e.scope[0] === lt).map((e) => e.scope[1]), Q = ut || ft || xe("", gt), _t = (h.data?.rows[2] ?? []).filter((e) => e.scope[0] === lt && e.scope[1] === Q).map((e) => e.scope[2]), vt = dt || mt || xe("", _t), yt = !!L && !!h.data && !h.data.rows[2].some((e) => e.scope[0] === lt && e.scope[1] === Q && e.scope[2] === vt), bt = _e(X);
982
+ function $() {
983
+ Je(void 0);
984
+ }
985
+ function xt(e) {
986
+ let t = X?.connectors ?? [];
987
+ return t.find((t) => t.connector === e.connector && t.component === e.component) ?? t.find((t) => t.connector === e.connector);
988
+ }
989
+ async function St(e) {
990
+ if (L && !Z) {
991
+ Ye(!0), Ze(e ? "create" : "preview"), $e("");
992
+ try {
993
+ let t = {
994
+ config: {
995
+ name: L.doc.metadata.name,
996
+ realm: L.doc.metadata.realm,
997
+ space: L.doc.metadata.space,
998
+ stack: L.doc.metadata.stack
999
+ },
1000
+ name: Re.trim(),
1001
+ ...e && X ? {
1002
+ resolvedName: X.document.metadata.name,
1003
+ preview: X.preview
1004
+ } : {},
1005
+ env: Be.split("\n").filter(Boolean),
1006
+ ignoreDiskPressure: He,
1007
+ targetSpace: Q,
1008
+ targetStack: vt,
1009
+ ...Object.keys(Fe).length ? { connectors: Fe } : {},
1010
+ ...Object.keys(V).length ? { methods: V } : {},
1011
+ ...Pe ? { state: Pe } : {}
1012
+ }, n = await de(`/cells/from-config/${e ? "create" : "preview"}`, {
1013
+ method: "POST",
1014
+ headers: {
1015
+ "Content-Type": "application/json",
1016
+ Accept: "application/json"
1017
+ },
1018
+ body: JSON.stringify(t)
1019
+ }), r = await n.json();
1020
+ if (!n.ok) {
1021
+ let t = r.error?.message ?? r.message ?? `Request failed (HTTP ${n.status})`;
1022
+ throw (r.error?.code === "connector_unresolved" || r.error?.code === "connector_invalid") && Ce((e) => e + 1), Error(e && (r.error?.code === "unavailable" || n.status >= 500) ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${t}` : t);
1023
+ }
1024
+ e ? ue(r, {
1025
+ start: We,
1026
+ attach: We && Ke,
1027
+ warnings: se(r)
1028
+ }) : Je(r);
1029
+ } catch (t) {
1030
+ let n = t instanceof Error ? t.message : "The request could not reach the web server.";
1031
+ $e(e && t instanceof TypeError ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${n}` : n);
1032
+ } finally {
1033
+ Ye(!1);
1034
+ }
1035
+ }
1036
+ }
1037
+ let Ct = (X?.connectors ?? []).some(c), wt = !!z.data && !!J.data && !yt && G.length === 0, Tt = !Z && wt && !Ct, Et = Object.keys(Fe).length + Object.keys(V).length + +!!Pe, Dt = Be.split("\n").filter((e) => e.trim()).length, Ot = q ? Ie ? J.loading ? /* @__PURE__ */ T("p", {
1038
+ role: "status",
1039
+ children: "Checking referenced Blueprint…"
1040
+ }) : J.error ? /* @__PURE__ */ E("div", {
1041
+ className: "error",
1042
+ role: "alert",
1043
+ children: [
1044
+ /* @__PURE__ */ T("strong", { children: J.error.code === "not_found" ? "Blueprint reference is missing" : "Blueprint could not be loaded" }),
1045
+ /* @__PURE__ */ T("p", { children: J.error.message }),
1046
+ /* @__PURE__ */ E("p", { children: ["Reference: ", j(Y)] })
1047
+ ]
1048
+ }) : null : /* @__PURE__ */ E("p", {
1049
+ className: "error",
1050
+ role: "alert",
1051
+ children: ["The Blueprint reference is incomplete: ", j(Y)]
1052
+ }) : /* @__PURE__ */ T("p", {
1053
+ className: "error",
1054
+ role: "alert",
1055
+ children: "This config does not contain a Blueprint reference."
1056
+ }), kt = L && z.data && H.length > 0 && /* @__PURE__ */ T(D, {
1057
+ className: "cell-connectors",
1058
+ label: "Connectors",
1059
+ title: "Connectors",
1060
+ open: et,
1061
+ onToggle: tt,
1062
+ summary: G.length ? void 0 : `${H.length} resolved${Et ? `, ${Et} picked for this cell` : ""}`,
1063
+ badge: G.length ? /* @__PURE__ */ E("span", {
1064
+ className: "badge needs-connector",
1065
+ children: ["Needs connector: ", [...new Set(G.map(t))].join(", ")]
1066
+ }) : void 0,
1067
+ children: /* @__PURE__ */ E("div", {
1068
+ className: "panel-body",
1069
+ children: [
1070
+ /* @__PURE__ */ T("p", {
1071
+ className: "description",
1072
+ children: "A method or identity picked here applies to this cell only."
1073
+ }),
1074
+ K && /* @__PURE__ */ E("p", {
1075
+ className: "connector-team",
1076
+ role: "note",
1077
+ children: [
1078
+ "This Config's identities are set by team ",
1079
+ /* @__PURE__ */ T("code", { children: K }),
1080
+ ". A pick here still applies to this cell only."
1081
+ ]
1082
+ }),
1083
+ U.error && /* @__PURE__ */ E("p", {
1084
+ className: "stale",
1085
+ children: [
1086
+ "Identities could not be listed: ",
1087
+ U.error.message,
1088
+ ". Name a secret by hand instead."
1089
+ ]
1090
+ }),
1091
+ /* @__PURE__ */ T("ul", {
1092
+ className: "state-list connector-status-list",
1093
+ children: H.map((e) => {
1094
+ let r = t(e), a = Fe[e.connector], o = V[e.connector], s = B.find((t) => t.connector === e.connector) ?? e, c = s.method ? ee(we.data?.find((t) => t.name === e.connector)) : [], l = G.includes(e);
1095
+ return /* @__PURE__ */ T("li", {
1096
+ "aria-label": `${r} connector`,
1097
+ children: /* @__PURE__ */ E("div", {
1098
+ className: "connector-status",
1099
+ children: [
1100
+ /* @__PURE__ */ E("div", { children: [
1101
+ /* @__PURE__ */ T("strong", { children: r }),
1102
+ " ",
1103
+ /* @__PURE__ */ T("span", {
1104
+ className: "badge",
1105
+ children: e.connector
1106
+ }),
1107
+ e.method && /* @__PURE__ */ E(w, { children: [" ", /* @__PURE__ */ T("span", {
1108
+ className: "badge",
1109
+ children: e.method
1110
+ })] }),
1111
+ " ",
1112
+ a || o ? /* @__PURE__ */ T("span", {
1113
+ className: "badge",
1114
+ children: "Picked for this cell"
1115
+ }) : /* @__PURE__ */ T(te, { status: e })
1116
+ ] }),
1117
+ c.length > 0 && /* @__PURE__ */ E("label", {
1118
+ className: "schema-field",
1119
+ children: [
1120
+ "Method",
1121
+ /* @__PURE__ */ T("select", {
1122
+ "aria-label": `${r} method`,
1123
+ value: o ?? s.method,
1124
+ disabled: Z,
1125
+ onChange: (t) => {
1126
+ let n = t.target.value;
1127
+ Ee((t) => ({
1128
+ ...t,
1129
+ [e.connector]: n === s.method ? void 0 : n
1130
+ })), ke((t) => ({
1131
+ ...t,
1132
+ [e.connector]: void 0
1133
+ })), $();
1134
+ },
1135
+ children: c.map((e) => /* @__PURE__ */ E("option", {
1136
+ value: e.name,
1137
+ children: [e.name, e.name === s.method ? " (the Config's)" : ""]
1138
+ }, e.name))
1139
+ }),
1140
+ /* @__PURE__ */ T("small", { children: o ? `${c.find((e) => e.name === o)?.description ?? ""} Used for this cell only; the Config uses ${s.method}.` : c.find((e) => e.name === s.method)?.description })
1141
+ ]
1142
+ }),
1143
+ i(e.delivery) ? /* @__PURE__ */ T(oe, {
1144
+ label: `${r} identity`,
1145
+ identities: p(U.data, e.connector),
1146
+ value: Oe[e.connector] ?? e.identity,
1147
+ extra: [e.identity],
1148
+ emptyLabel: o ? "Use the default identity for this method" : e.identity ? "Use the Config's identity" : e.required ? "No identity — required" : "No identity",
1149
+ disabled: Z,
1150
+ required: e.required,
1151
+ realm: L.doc.metadata.realm,
1152
+ onChange: (t) => {
1153
+ ke((n) => ({
1154
+ ...n,
1155
+ [e.connector]: t
1156
+ })), $();
1157
+ },
1158
+ help: o ? /* @__PURE__ */ E(w, { children: [
1159
+ "The ",
1160
+ o,
1161
+ " method resolves its identity from the Realm, Space or Stack defaults unless one is picked here; the preview shows which."
1162
+ ] }) : /* @__PURE__ */ E(w, { children: ["The Config resolves to: ", /* @__PURE__ */ T(m, {
1163
+ status: e,
1164
+ team: K
1165
+ })] })
1166
+ }) : ne(e) ? /* @__PURE__ */ T(re, {
1167
+ label: `${r} login identity`,
1168
+ identities: f(De.data, e.connector),
1169
+ value: Oe[e.connector] ?? n(e),
1170
+ extra: [n(e)],
1171
+ emptyLabel: "Use the Config's login identity",
1172
+ disabled: Z,
1173
+ onChange: (t) => {
1174
+ ke((n) => ({
1175
+ ...n,
1176
+ [e.connector]: t
1177
+ })), $();
1178
+ },
1179
+ help: /* @__PURE__ */ E(w, { children: [
1180
+ "The Config resolves to: ",
1181
+ /* @__PURE__ */ T(m, {
1182
+ status: e,
1183
+ team: K
1184
+ }),
1185
+ ". A login identity picked here becomes this cell's state volume. ",
1186
+ "A login identity normally serves one role; another role may share it at your risk (its start rewrites role content in the state directory, and a Codex refresh token is single-use)."
1187
+ ] })
1188
+ }) : /* @__PURE__ */ T("p", {
1189
+ className: "description",
1190
+ children: /* @__PURE__ */ T(m, {
1191
+ status: e,
1192
+ team: K
1193
+ })
1194
+ }),
1195
+ /* @__PURE__ */ T(d, { warning: xt(e)?.warning }),
1196
+ l && /* @__PURE__ */ E("p", {
1197
+ className: "field-error",
1198
+ role: "alert",
1199
+ children: [
1200
+ r,
1201
+ " has no usable identity",
1202
+ e.message ? `: ${e.message}` : "",
1203
+ ". Pick one for this cell above, set a default, or pick one for the Config."
1204
+ ]
1205
+ }),
1206
+ !o && e.state !== "resolved" && /* @__PURE__ */ T(ie, {
1207
+ status: e,
1208
+ connector: we.data?.find((t) => t.name === e.connector),
1209
+ config: z.data.metadata,
1210
+ identities: p(U.data, e.connector),
1211
+ logins: f(De.data, e.connector),
1212
+ secrets: U.data,
1213
+ onChanged: () => {
1214
+ Ce((e) => e + 1), $();
1215
+ }
1216
+ })
1217
+ ]
1218
+ })
1219
+ }, `${e.connector}:${e.component}`);
1220
+ })
1221
+ }),
1222
+ Ne && /* @__PURE__ */ E("label", {
1223
+ className: "schema-field",
1224
+ children: [
1225
+ "Harness state",
1226
+ /* @__PURE__ */ T("select", {
1227
+ "aria-label": "Harness state",
1228
+ value: Ae || W,
1229
+ disabled: Z,
1230
+ onChange: (e) => {
1231
+ je(e.target.value), $();
1232
+ },
1233
+ children: e.map((e) => /* @__PURE__ */ E("option", {
1234
+ value: e,
1235
+ children: [e, e === W ? " (the Config's)" : ""]
1236
+ }, e))
1237
+ }),
1238
+ /* @__PURE__ */ E("small", { children: [(Ae || W) === "ephemeral" ? "Ephemeral: this cell mounts no state volume; the harness state directory lives and dies with the cell, and the cell authenticates from its Secret." : "Persistent: this cell mounts the Config's state volume, so sessions and settings survive the cell.", Pe ? ` Used for this cell only; the Config uses ${W || "persistent"}.` : ""] })
1239
+ ]
1240
+ }),
1241
+ !!W && Me && /* @__PURE__ */ T("p", {
1242
+ className: "description",
1243
+ children: "Harness state is persistent: a method that keeps its login in the state volume cannot use ephemeral state."
1244
+ })
1245
+ ]
1246
+ })
1247
+ }), At = ce(X?.values);
1248
+ return /* @__PURE__ */ E("div", {
1249
+ className: "creation-layout",
1250
+ children: [/* @__PURE__ */ E("section", {
1251
+ className: "panel",
1252
+ "aria-label": "Config",
1253
+ children: [/* @__PURE__ */ E("div", {
1254
+ className: "panel-heading",
1255
+ children: [/* @__PURE__ */ T("h2", { children: "Config" }), L && !Se && /* @__PURE__ */ T("button", {
1256
+ type: "button",
1257
+ className: "subtle-button",
1258
+ onClick: () => P(!0),
1259
+ children: "Change"
1260
+ })]
1261
+ }), /* @__PURE__ */ E("div", {
1262
+ className: "panel-body creation-form",
1263
+ children: [Se ? /* @__PURE__ */ E(w, { children: [
1264
+ S.loading && /* @__PURE__ */ T("p", {
1265
+ role: "status",
1266
+ children: "Loading CellConfigs…"
1267
+ }),
1268
+ S.error && /* @__PURE__ */ E("div", {
1269
+ className: "error",
1270
+ role: "alert",
1271
+ children: [/* @__PURE__ */ T("strong", { children: "CellConfigs unavailable" }), /* @__PURE__ */ T("p", { children: S.error.message })]
1272
+ }),
1273
+ S.error && S.data && /* @__PURE__ */ T("p", {
1274
+ className: "stale",
1275
+ children: "Showing stale CellConfigs."
1276
+ }),
1277
+ /* @__PURE__ */ E("label", { children: ["Search CellConfigs", /* @__PURE__ */ T("input", {
1278
+ type: "search",
1279
+ value: O,
1280
+ placeholder: "Name or full scope",
1281
+ onChange: (e) => k(e.target.value)
1282
+ })] }),
1283
+ /* @__PURE__ */ E("label", { children: ["CellConfig", /* @__PURE__ */ E("select", {
1284
+ value: fe,
1285
+ onChange: (e) => {
1286
+ M(e.target.value), ke({}), Ee({}), je(""), pt(void 0), ht(void 0), Je(void 0), $e("");
1287
+ },
1288
+ children: [/* @__PURE__ */ T("option", {
1289
+ value: "",
1290
+ children: "Select a CellConfig…"
1291
+ }), I.map((e) => /* @__PURE__ */ E("option", {
1292
+ value: JSON.stringify(e.scope),
1293
+ children: [
1294
+ e.doc.metadata.name,
1295
+ " — ",
1296
+ j(e.scope.slice(0, -1))
1297
+ ]
1298
+ }, JSON.stringify(e.scope)))]
1299
+ })] }),
1300
+ !S.loading && !S.error && !F.length && /* @__PURE__ */ T("p", {
1301
+ className: "description",
1302
+ children: "No CellConfigs are available."
1303
+ })
1304
+ ] }) : L ? null : /* @__PURE__ */ T("p", {
1305
+ role: "status",
1306
+ children: "Loading CellConfigs…"
1307
+ }), L && /* @__PURE__ */ E(w, { children: [
1308
+ z.loading && /* @__PURE__ */ T("p", {
1309
+ role: "status",
1310
+ children: z.data ? "Refreshing CellConfig details…" : "Loading CellConfig details…"
1311
+ }),
1312
+ z.error && /* @__PURE__ */ E("div", {
1313
+ className: "error",
1314
+ role: "alert",
1315
+ children: [/* @__PURE__ */ T("strong", { children: "CellConfig details unavailable" }), /* @__PURE__ */ T("p", { children: z.error.message })]
1316
+ }),
1317
+ z.error && z.data && /* @__PURE__ */ T("p", {
1318
+ className: "stale",
1319
+ children: "Showing stale CellConfig details."
1320
+ }),
1321
+ z.data && /* @__PURE__ */ E("p", {
1322
+ className: "config-summary",
1323
+ children: [
1324
+ "Config ",
1325
+ /* @__PURE__ */ T("a", {
1326
+ className: "resource-name",
1327
+ href: A("configs", L.scope, !0),
1328
+ children: z.data.metadata.name
1329
+ }),
1330
+ " ",
1331
+ /* @__PURE__ */ T("span", {
1332
+ className: "description",
1333
+ children: j(L.scope.slice(0, -1))
1334
+ }),
1335
+ J.data && Ie && /* @__PURE__ */ E(w, { children: [
1336
+ " · Blueprint ",
1337
+ /* @__PURE__ */ T("a", {
1338
+ className: "resource-name",
1339
+ href: A("blueprints", Y),
1340
+ children: J.data.metadata.name
1341
+ }),
1342
+ " ",
1343
+ /* @__PURE__ */ T("span", {
1344
+ className: "description",
1345
+ children: j(Y.slice(0, -1))
1346
+ })
1347
+ ] })
1348
+ ]
1349
+ }),
1350
+ z.data && Ot
1351
+ ] })]
1352
+ })]
1353
+ }), L && /* @__PURE__ */ E(w, { children: [
1354
+ /* @__PURE__ */ E("section", {
1355
+ className: "panel",
1356
+ "aria-label": "Cell",
1357
+ children: [/* @__PURE__ */ T("div", {
1358
+ className: "panel-heading",
1359
+ children: /* @__PURE__ */ T("h2", { children: "Cell" })
1360
+ }), /* @__PURE__ */ E("form", {
1361
+ className: "panel-body creation-form",
1362
+ onSubmit: (e) => {
1363
+ e.preventDefault(), wt && St(!1);
1364
+ },
1365
+ children: [
1366
+ /* @__PURE__ */ E("label", { children: [
1367
+ "Cell name (optional)",
1368
+ /* @__PURE__ */ T("input", {
1369
+ value: Re,
1370
+ disabled: Z,
1371
+ onChange: (e) => {
1372
+ ze(e.target.value), $();
1373
+ }
1374
+ }),
1375
+ /* @__PURE__ */ T("small", { children: "Leave blank to let kukeon pick a name." })
1376
+ ] }),
1377
+ /* @__PURE__ */ E("div", {
1378
+ className: "schema-fields",
1379
+ children: [
1380
+ /* @__PURE__ */ E("p", {
1381
+ className: "schema-field",
1382
+ children: ["Realm", /* @__PURE__ */ T("strong", { children: lt })]
1383
+ }),
1384
+ /* @__PURE__ */ T(be, {
1385
+ label: "Target space",
1386
+ value: Q,
1387
+ options: gt,
1388
+ pinned: !!ut,
1389
+ disabled: Z,
1390
+ onChange: (e) => {
1391
+ pt(e), ht(void 0), $();
1392
+ }
1393
+ }),
1394
+ /* @__PURE__ */ T(be, {
1395
+ label: "Target stack",
1396
+ value: vt,
1397
+ options: _t,
1398
+ pinned: !!dt,
1399
+ disabled: Z,
1400
+ onChange: (e) => {
1401
+ ht(e), $();
1402
+ }
1403
+ })
1404
+ ]
1405
+ }),
1406
+ yt && /* @__PURE__ */ T("p", {
1407
+ className: "error",
1408
+ role: "alert",
1409
+ children: "The target Stack is not present in the loaded inventory."
1410
+ }),
1411
+ h.data?.failures.length ? /* @__PURE__ */ T("p", {
1412
+ className: "stale",
1413
+ children: "Inventory is incomplete. Target scope may be unavailable."
1414
+ }) : null
1415
+ ]
1416
+ })]
1417
+ }),
1418
+ kt,
1419
+ /* @__PURE__ */ T(D, {
1420
+ title: "Environment overrides",
1421
+ level: 3,
1422
+ summary: Dt ? `${Dt} set` : "None",
1423
+ open: nt,
1424
+ onToggle: rt,
1425
+ children: /* @__PURE__ */ T("div", {
1426
+ className: "panel-body creation-form",
1427
+ children: /* @__PURE__ */ E("label", { children: [
1428
+ "Environment overrides",
1429
+ /* @__PURE__ */ T("textarea", {
1430
+ value: Be,
1431
+ disabled: Z,
1432
+ placeholder: "KEY=VALUE, one per line",
1433
+ onChange: (e) => {
1434
+ Ve(e.target.value), $();
1435
+ }
1436
+ }),
1437
+ /* @__PURE__ */ T("small", { children: "Values are redacted in the preview." })
1438
+ ] })
1439
+ })
1440
+ }),
1441
+ /* @__PURE__ */ T(D, {
1442
+ title: "Advanced",
1443
+ level: 3,
1444
+ summary: He ? "Ignoring disk pressure" : "Defaults",
1445
+ open: it,
1446
+ onToggle: at,
1447
+ children: /* @__PURE__ */ T("div", {
1448
+ className: "panel-body creation-form",
1449
+ children: /* @__PURE__ */ E("label", {
1450
+ className: "schema-check",
1451
+ children: [/* @__PURE__ */ T("input", {
1452
+ type: "checkbox",
1453
+ checked: He,
1454
+ disabled: Z,
1455
+ onChange: (e) => {
1456
+ Ue(e.target.checked), $();
1457
+ }
1458
+ }), " Ignore disk pressure for this creation"]
1459
+ })
1460
+ })
1461
+ }),
1462
+ Qe && /* @__PURE__ */ T("p", {
1463
+ className: "error",
1464
+ role: "alert",
1465
+ children: Qe
1466
+ }),
1467
+ Z && /* @__PURE__ */ T("p", {
1468
+ role: "status",
1469
+ children: Xe === "create" ? "Creating Cell…" : "Preparing preview…"
1470
+ }),
1471
+ X && /* @__PURE__ */ E(ve, {
1472
+ review: bt,
1473
+ onHide: () => Je(void 0),
1474
+ children: [
1475
+ /* @__PURE__ */ T(he, {
1476
+ document: X.document,
1477
+ connectors: X.connectors
1478
+ }),
1479
+ /* @__PURE__ */ T(v, {
1480
+ values: X.values,
1481
+ connectors: X.connectors,
1482
+ team: K,
1483
+ sources: {
1484
+ blueprint: J.data && Ie ? /* @__PURE__ */ T("a", {
1485
+ className: "resource-name",
1486
+ href: A("blueprints", Y),
1487
+ children: J.data.metadata.name
1488
+ }) : void 0,
1489
+ config: /* @__PURE__ */ T("a", {
1490
+ className: "resource-name",
1491
+ href: A("configs", L.scope, !0),
1492
+ children: L.doc.metadata.name
1493
+ }),
1494
+ realm: X.document.spec.realmId,
1495
+ space: X.document.spec.spaceId,
1496
+ stack: X.document.spec.stackId
1497
+ }
1498
+ }),
1499
+ (At.repos.length > 0 || At.defaults.length > 0) && /* @__PURE__ */ T(D, {
1500
+ title: "Git identity per repository",
1501
+ level: 3,
1502
+ open: ot,
1503
+ onToggle: st,
1504
+ children: /* @__PURE__ */ T("div", {
1505
+ className: "panel-body",
1506
+ children: /* @__PURE__ */ T(y, { values: X.values ?? [] })
1507
+ })
1508
+ }),
1509
+ /* @__PURE__ */ T(ge, {
1510
+ document: X.document,
1511
+ label: "Complete Cell preview"
1512
+ }),
1513
+ X.digest && /* @__PURE__ */ E("p", {
1514
+ className: "description",
1515
+ children: ["Render digest: ", /* @__PURE__ */ T("code", { children: X.digest })]
1516
+ })
1517
+ ]
1518
+ }),
1519
+ G.length > 0 && /* @__PURE__ */ E("p", {
1520
+ className: "field-error",
1521
+ role: "alert",
1522
+ children: [
1523
+ "Create is disabled until every required connector resolves: ",
1524
+ [...new Set(G.map(t))].join(", "),
1525
+ "."
1526
+ ]
1527
+ }),
1528
+ /* @__PURE__ */ T(ye, {
1529
+ start: We,
1530
+ attach: Ke,
1531
+ onStart: Ge,
1532
+ onAttach: qe,
1533
+ pending: Z,
1534
+ hasPreview: !!X,
1535
+ previewLabel: "Preview Cell",
1536
+ canPreview: !Z && wt,
1537
+ canCreate: Tt,
1538
+ onPreview: () => void St(!1),
1539
+ onCreate: () => void St(!0)
1540
+ })
1541
+ ] })]
1542
+ });
1543
+ }
1544
+ function Se({ inventory: e, onCreated: t }) {
1545
+ let n = e.data?.rows[0] ?? [], [r, i] = C(() => ({
1546
+ name: "",
1547
+ realm: "",
1548
+ space: "",
1549
+ stack: "",
1550
+ labels: {},
1551
+ annotations: {},
1552
+ spec: {
1553
+ containers: [],
1554
+ autoDelete: !1,
1555
+ nestedCgroupRuntime: !1,
1556
+ ignoreDiskPressure: !1
1557
+ }
1558
+ })), [a, o] = C(!1), [s, c] = C({}), [l, u] = C({}), [d, f] = C(), [p, ee] = C(!1), [m, h] = C("preview"), [te, ne] = C(!0), [re, ie] = C(!0), [ae, oe] = C(""), g = String(r.realm ?? ""), se = (e.data?.rows[1] ?? []).filter((e) => e.scope[0] === g), _ = String(r.space ?? ""), ce = (e.data?.rows[2] ?? []).filter((e) => e.scope[0] === g && e.scope[1] === _), v = r.spec, y = v.containers ?? [];
1559
+ le(() => {
1560
+ if (!e.data || r.realm) return;
1561
+ let t = n.find((e) => e.doc.metadata.name === "default") ?? n[0];
1562
+ if (!t) return;
1563
+ let a = e.data.rows[1].find((e) => e.scope[0] === t.scope[0] && e.doc.metadata.name === "default") ?? e.data.rows[1].find((e) => e.scope[0] === t.scope[0]), o = a && (e.data.rows[2].find((e) => e.scope[0] === a.scope[0] && e.scope[1] === a.scope[1] && e.doc.metadata.name === "default") ?? e.data.rows[2].find((e) => e.scope[0] === a.scope[0] && e.scope[1] === a.scope[1]));
1564
+ i((e) => e.realm ? e : {
1565
+ ...e,
1566
+ realm: t.scope[0],
1567
+ space: a?.scope[1] ?? "",
1568
+ stack: o?.scope[2] ?? ""
1569
+ });
1570
+ }, [
1571
+ e.data,
1572
+ r.realm,
1573
+ n
1574
+ ]);
1575
+ let b = ue(() => ({
1576
+ ...P({ name: r.name }, [{
1577
+ key: "name",
1578
+ label: "Cell name",
1579
+ kind: "text",
1580
+ required: !0
1581
+ }], "cell"),
1582
+ ...P({
1583
+ realm: g,
1584
+ space: _,
1585
+ stack: r.stack
1586
+ }, [
1587
+ "realm",
1588
+ "space",
1589
+ "stack"
1590
+ ].map((e) => ({
1591
+ key: e,
1592
+ label: e,
1593
+ kind: "text",
1594
+ required: !0
1595
+ })), "cell"),
1596
+ ...P({ containers: y }, [{
1597
+ key: "containers",
1598
+ label: "Containers",
1599
+ kind: "objects",
1600
+ fields: k.filter((e) => e.required)
1601
+ }], "cell.spec")
1602
+ }), [
1603
+ r,
1604
+ g,
1605
+ _,
1606
+ v,
1607
+ y
1608
+ ]);
1609
+ function x(e, t) {
1610
+ i((n) => M(n, e, t)), f(void 0), u({});
1611
+ }
1612
+ function S(e, t) {
1613
+ i((n) => M(n, "spec", M(n.spec, e, t))), f(void 0), u({});
1614
+ }
1615
+ function w(e, t, n) {
1616
+ S("containers", y.map((r, i) => i === e ? M(r, t, n) : r));
1617
+ }
1618
+ async function D(e) {
1619
+ if (!p) {
1620
+ if ((!e || !d) && Object.keys(b).length) u(b);
1621
+ else {
1622
+ ee(!0), h(e ? "create" : "preview"), oe("");
1623
+ try {
1624
+ let n = {
1625
+ name: String(r.name).trim(),
1626
+ realm: g,
1627
+ space: _,
1628
+ stack: String(r.stack ?? ""),
1629
+ labels: r.labels,
1630
+ annotations: r.annotations,
1631
+ spec: v
1632
+ }, i = await de(`/cells/manual/${e ? "create" : "preview"}`, {
1633
+ method: "POST",
1634
+ headers: {
1635
+ "Content-Type": "application/json",
1636
+ Accept: "application/json"
1637
+ },
1638
+ body: JSON.stringify({
1639
+ ...n,
1640
+ ...e && d ? { preview: d.preview } : {}
1641
+ })
1642
+ }), a = await i.json();
1643
+ if (!i.ok) {
1644
+ let t = a.error?.message ?? a.message ?? `Request failed (HTTP ${i.status})`;
1645
+ throw Error(e && (a.error?.code === "unavailable" || i.status >= 500) ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${t}` : t);
1646
+ }
1647
+ e ? t(a, {
1648
+ start: te,
1649
+ attach: te && re
1650
+ }) : f(a);
1651
+ } catch (t) {
1652
+ let n = t instanceof Error ? t.message : "The request could not reach the web server.";
1653
+ oe(e && t instanceof TypeError ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${n}` : n);
1654
+ } finally {
1655
+ ee(!1);
1656
+ }
1657
+ }
1658
+ }
1659
+ }
1660
+ let O = _e(d);
1661
+ return /* @__PURE__ */ E("div", {
1662
+ className: "creation-layout",
1663
+ children: [
1664
+ /* @__PURE__ */ E("section", {
1665
+ className: "panel",
1666
+ children: [/* @__PURE__ */ E("div", {
1667
+ className: "panel-heading",
1668
+ children: [/* @__PURE__ */ T("h2", { children: "Build a Cell specification" }), /* @__PURE__ */ T("span", {
1669
+ className: "badge",
1670
+ children: "No Config or Blueprint"
1671
+ })]
1672
+ }), /* @__PURE__ */ E("form", {
1673
+ className: "panel-body creation-form",
1674
+ onSubmit: (e) => {
1675
+ e.preventDefault(), D(!1);
1676
+ },
1677
+ children: [
1678
+ /* @__PURE__ */ E("div", {
1679
+ className: "schema-section",
1680
+ children: [/* @__PURE__ */ T("h3", { children: "Basic Cell configuration" }), /* @__PURE__ */ E("div", {
1681
+ className: "schema-fields",
1682
+ children: [
1683
+ /* @__PURE__ */ E("label", {
1684
+ className: "schema-field",
1685
+ htmlFor: "manual-name",
1686
+ children: [
1687
+ /* @__PURE__ */ E("span", { children: ["Cell name ", /* @__PURE__ */ T("b", {
1688
+ "aria-label": "required",
1689
+ children: " *"
1690
+ })] }),
1691
+ /* @__PURE__ */ T("input", {
1692
+ id: "manual-name",
1693
+ value: String(r.name),
1694
+ disabled: p,
1695
+ "aria-invalid": !!l["cell.name"],
1696
+ "aria-describedby": l["cell.name"] ? "manual-name-error" : void 0,
1697
+ onChange: (e) => x("name", e.target.value)
1698
+ }),
1699
+ l["cell.name"] && /* @__PURE__ */ T("small", {
1700
+ id: "manual-name-error",
1701
+ className: "field-error",
1702
+ children: l["cell.name"]
1703
+ })
1704
+ ]
1705
+ }),
1706
+ /* @__PURE__ */ E("label", {
1707
+ className: "schema-field",
1708
+ children: [
1709
+ /* @__PURE__ */ E("span", { children: ["Realm ", /* @__PURE__ */ T("b", {
1710
+ "aria-label": "required",
1711
+ children: " *"
1712
+ })] }),
1713
+ /* @__PURE__ */ E("select", {
1714
+ value: g,
1715
+ disabled: p,
1716
+ onChange: (e) => {
1717
+ x("realm", e.target.value), x("space", ""), x("stack", "");
1718
+ },
1719
+ children: [/* @__PURE__ */ T("option", {
1720
+ value: "",
1721
+ children: "Select a Realm…"
1722
+ }), n.map((e) => /* @__PURE__ */ T("option", { children: e.scope[0] }, e.scope[0]))]
1723
+ }),
1724
+ l["cell.realm"] && /* @__PURE__ */ T("small", {
1725
+ className: "field-error",
1726
+ children: l["cell.realm"]
1727
+ })
1728
+ ]
1729
+ }),
1730
+ /* @__PURE__ */ E("label", {
1731
+ className: "schema-field",
1732
+ children: [
1733
+ /* @__PURE__ */ E("span", { children: ["Space ", /* @__PURE__ */ T("b", {
1734
+ "aria-label": "required",
1735
+ children: " *"
1736
+ })] }),
1737
+ /* @__PURE__ */ E("select", {
1738
+ value: _,
1739
+ disabled: p || !g,
1740
+ onChange: (e) => {
1741
+ x("space", e.target.value), x("stack", "");
1742
+ },
1743
+ children: [/* @__PURE__ */ T("option", {
1744
+ value: "",
1745
+ children: "Select a Space…"
1746
+ }), se.map((e) => /* @__PURE__ */ T("option", { children: e.scope[1] }, e.scope[1]))]
1747
+ }),
1748
+ l["cell.space"] && /* @__PURE__ */ T("small", {
1749
+ className: "field-error",
1750
+ children: l["cell.space"]
1751
+ })
1752
+ ]
1753
+ }),
1754
+ /* @__PURE__ */ E("label", {
1755
+ className: "schema-field",
1756
+ children: [
1757
+ /* @__PURE__ */ E("span", { children: ["Stack ", /* @__PURE__ */ T("b", {
1758
+ "aria-label": "required",
1759
+ children: " *"
1760
+ })] }),
1761
+ /* @__PURE__ */ E("select", {
1762
+ value: String(r.stack ?? ""),
1763
+ disabled: p || !_,
1764
+ onChange: (e) => x("stack", e.target.value),
1765
+ children: [/* @__PURE__ */ T("option", {
1766
+ value: "",
1767
+ children: "Select a Stack…"
1768
+ }), ce.map((e) => /* @__PURE__ */ T("option", { children: e.scope[2] }, e.scope[2]))]
1769
+ }),
1770
+ l["cell.stack"] && /* @__PURE__ */ T("small", {
1771
+ className: "field-error",
1772
+ children: l["cell.stack"]
1773
+ })
1774
+ ]
1775
+ })
1776
+ ]
1777
+ })]
1778
+ }),
1779
+ /* @__PURE__ */ E("div", {
1780
+ className: "schema-section",
1781
+ children: [/* @__PURE__ */ T("h3", { children: "Metadata" }), /* @__PURE__ */ T("div", {
1782
+ className: "schema-fields",
1783
+ children: ["labels", "annotations"].map((e) => /* @__PURE__ */ T(I, {
1784
+ field: {
1785
+ key: e,
1786
+ label: e === "labels" ? "Labels" : "Annotations",
1787
+ kind: "map"
1788
+ },
1789
+ value: r[e],
1790
+ path: `cell.${e}`,
1791
+ errors: l,
1792
+ disabled: p,
1793
+ onChange: (t) => x(e, t)
1794
+ }, e))
1795
+ })]
1796
+ }),
1797
+ /* @__PURE__ */ E("div", {
1798
+ className: "schema-section",
1799
+ children: [
1800
+ /* @__PURE__ */ E("div", {
1801
+ className: "schema-section-heading",
1802
+ children: [/* @__PURE__ */ T("h3", { children: "Workload containers" }), /* @__PURE__ */ T("button", {
1803
+ type: "button",
1804
+ disabled: p,
1805
+ onClick: () => S("containers", [...y, N(k)]),
1806
+ children: "Add container"
1807
+ })]
1808
+ }),
1809
+ /* @__PURE__ */ T("p", {
1810
+ className: "description",
1811
+ children: "Define workload containers only; kukeon adds its default root container unless one is marked as root."
1812
+ }),
1813
+ !y.length && /* @__PURE__ */ T("p", {
1814
+ className: "empty-state compact-empty",
1815
+ children: "No workload containers added. kukeon will add its default root container when the Cell is created."
1816
+ }),
1817
+ y.map((e, t) => /* @__PURE__ */ E("section", {
1818
+ className: "container-editor",
1819
+ children: [
1820
+ /* @__PURE__ */ E("div", {
1821
+ className: "schema-array-heading",
1822
+ children: [/* @__PURE__ */ E("h4", { children: [
1823
+ "Container ",
1824
+ t + 1,
1825
+ e.id ? ` · ${String(e.id)}` : ""
1826
+ ] }), /* @__PURE__ */ T("button", {
1827
+ type: "button",
1828
+ className: "subtle-button",
1829
+ disabled: p,
1830
+ onClick: () => S("containers", y.filter((e, n) => n !== t)),
1831
+ children: "Remove container"
1832
+ })]
1833
+ }),
1834
+ /* @__PURE__ */ T("div", {
1835
+ className: "schema-fields",
1836
+ children: k.filter((e) => !e.advanced).map((n) => /* @__PURE__ */ T(I, {
1837
+ field: n,
1838
+ value: e[n.key],
1839
+ path: `cell.spec.containers.${t}.${n.key}`,
1840
+ errors: l,
1841
+ disabled: p,
1842
+ onChange: (e) => w(t, n.key, e)
1843
+ }, n.key))
1844
+ }),
1845
+ /* @__PURE__ */ E("button", {
1846
+ type: "button",
1847
+ className: "subtle-button",
1848
+ "aria-expanded": !!s[t],
1849
+ onClick: () => c((e) => ({
1850
+ ...e,
1851
+ [t]: !e[t]
1852
+ })),
1853
+ children: [s[t] ? "Hide" : "Show", " advanced container fields"]
1854
+ }),
1855
+ s[t] && /* @__PURE__ */ T("div", {
1856
+ className: "schema-fields advanced-fields",
1857
+ children: k.filter((e) => e.advanced).map((n) => /* @__PURE__ */ T(I, {
1858
+ field: n,
1859
+ value: e[n.key],
1860
+ path: `cell.spec.containers.${t}.${n.key}`,
1861
+ errors: l,
1862
+ disabled: p,
1863
+ onChange: (e) => w(t, n.key, e)
1864
+ }, n.key))
1865
+ })
1866
+ ]
1867
+ }, t))
1868
+ ]
1869
+ }),
1870
+ /* @__PURE__ */ E("div", {
1871
+ className: "schema-section",
1872
+ children: [/* @__PURE__ */ E("button", {
1873
+ type: "button",
1874
+ className: "subtle-button",
1875
+ "aria-expanded": a,
1876
+ onClick: () => o((e) => !e),
1877
+ children: [a ? "Hide" : "Show", " advanced Cell configuration"]
1878
+ }), a && /* @__PURE__ */ E("div", {
1879
+ className: "schema-fields advanced-fields",
1880
+ children: [fe.map((e) => /* @__PURE__ */ T(I, {
1881
+ field: e,
1882
+ value: v[e.key],
1883
+ path: `cell.spec.${e.key}`,
1884
+ errors: l,
1885
+ disabled: p,
1886
+ onChange: (t) => S(e.key, t)
1887
+ }, e.key)), ["autoDelete"].map((e) => /* @__PURE__ */ T(I, {
1888
+ field: {
1889
+ key: e,
1890
+ label: "Delete Cell after root exits",
1891
+ kind: "boolean"
1892
+ },
1893
+ value: v[e],
1894
+ path: `cell.spec.${e}`,
1895
+ errors: l,
1896
+ disabled: p,
1897
+ onChange: (t) => S(e, t)
1898
+ }, e))]
1899
+ })]
1900
+ }),
1901
+ e.error && /* @__PURE__ */ E("p", {
1902
+ className: "error",
1903
+ role: "alert",
1904
+ children: ["Scope inventory could not be loaded: ", e.error.message]
1905
+ }),
1906
+ !!e.data?.failures.length && /* @__PURE__ */ T("p", {
1907
+ className: "stale",
1908
+ children: "Scope inventory is incomplete. Verify the selected target resources before creating."
1909
+ }),
1910
+ Object.keys(l).length > 0 && /* @__PURE__ */ T("p", {
1911
+ className: "field-error",
1912
+ role: "alert",
1913
+ children: "Fix the highlighted fields before previewing or creating."
1914
+ })
1915
+ ]
1916
+ })]
1917
+ }),
1918
+ ae && /* @__PURE__ */ T("p", {
1919
+ className: "error",
1920
+ role: "alert",
1921
+ children: ae
1922
+ }),
1923
+ p && /* @__PURE__ */ T("p", {
1924
+ role: "status",
1925
+ children: m === "create" ? "Creating Cell…" : "Validating and preparing preview…"
1926
+ }),
1927
+ d && /* @__PURE__ */ E(ve, {
1928
+ review: O,
1929
+ onHide: () => f(void 0),
1930
+ children: [
1931
+ /* @__PURE__ */ T(he, { document: d.document }),
1932
+ /* @__PURE__ */ T("p", {
1933
+ className: "description",
1934
+ children: "kukeon adds its default root container on creation unless one is defined; the created Cell shows the final specification."
1935
+ }),
1936
+ /* @__PURE__ */ T(ge, {
1937
+ document: d.document,
1938
+ label: "Complete manual Cell preview"
1939
+ })
1940
+ ]
1941
+ }),
1942
+ /* @__PURE__ */ T(ye, {
1943
+ start: te,
1944
+ attach: re,
1945
+ onStart: ne,
1946
+ onAttach: ie,
1947
+ pending: p,
1948
+ hasPreview: !!d,
1949
+ previewLabel: "Validate and preview Cell",
1950
+ canPreview: !p,
1951
+ canCreate: !p,
1952
+ onPreview: () => void D(!1),
1953
+ onCreate: () => void D(!0)
1954
+ })
1955
+ ]
1956
+ });
1957
+ }
1958
+ function R({ revision: e, inventory: t, configScope: n, onCreated: r }) {
1959
+ let [i, a] = C("config");
1960
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("div", {
1961
+ className: "creation-method-switch",
1962
+ role: "group",
1963
+ "aria-label": "Cell creation method",
1964
+ children: [/* @__PURE__ */ T("button", {
1965
+ type: "button",
1966
+ "aria-pressed": i === "config",
1967
+ onClick: () => a("config"),
1968
+ children: "From Config"
1969
+ }), /* @__PURE__ */ T("button", {
1970
+ type: "button",
1971
+ "aria-pressed": i === "manual",
1972
+ onClick: () => a("manual"),
1973
+ children: "Manual"
1974
+ })]
1975
+ }), i === "config" ? /* @__PURE__ */ T(L, {
1976
+ revision: e,
1977
+ inventory: t,
1978
+ configScope: n,
1979
+ onCreated: r
1980
+ }, JSON.stringify(n ?? [])) : /* @__PURE__ */ T(Se, {
1981
+ inventory: t,
1982
+ onCreated: r
1983
+ })] });
1984
+ }
1985
+ export { R as NewCellPage };