@kukeon/console 0.0.0-stage → 0.10.0-edge.g4f69f964
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assignments-Biqg1AT0.js +257 -0
- package/dist/assignments-tab.d.ts +4 -0
- package/dist/assignments.d.mts +40 -0
- package/dist/auth.d.ts +39 -0
- package/dist/bulk-ui.d.ts +49 -0
- package/dist/bulk.d.mts +14 -0
- package/dist/catalog-B29wwZiy.js +1949 -0
- package/dist/catalog-url-Dr9e92Yq.js +19 -0
- package/dist/catalog-url.d.mts +4 -0
- package/dist/catalog.d.ts +40 -0
- package/dist/cell-filter.d.ts +10 -0
- package/dist/cell-sidebar.d.ts +26 -0
- package/dist/cells.d.mts +29 -0
- package/dist/cgroup-format.d.ts +17 -0
- package/dist/cgroup.d.ts +4 -0
- package/dist/config-form.d.mts +66 -0
- package/dist/connector-ui-CG9kLZ5s.js +2716 -0
- package/dist/connector-ui.d.ts +129 -0
- package/dist/connectors-page-ZyuSRdHC.js +241 -0
- package/dist/connectors-page.d.ts +8 -0
- package/dist/connectors.d.mts +154 -0
- package/dist/container-log.d.ts +11 -0
- package/dist/create.d.ts +11 -0
- package/dist/creation-schema.d.mts +15 -0
- package/dist/daemon-CLdOLhDb.js +394 -0
- package/dist/daemon.d.ts +24 -0
- package/dist/display-name.d.ts +10 -0
- package/dist/drift-diff.d.ts +4 -0
- package/dist/exec.d.ts +15 -0
- package/dist/extensions.d.ts +111 -0
- package/dist/get-started.d.ts +9 -0
- package/dist/health.d.ts +22 -0
- package/dist/identities-page-CyW0d5n2.js +2137 -0
- package/dist/identities-page.d.ts +15 -0
- package/dist/identities.d.mts +24 -0
- package/dist/image-format.d.ts +6 -0
- package/dist/image-inventory.d.ts +12 -0
- package/dist/images.d.ts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5241 -0
- package/dist/initialize-CAOkMhlL.js +146 -0
- package/dist/initialize.d.ts +21 -0
- package/dist/inventory.d.ts +66 -0
- package/dist/lifecycle-policy.d.ts +11 -0
- package/dist/lifecycle.d.ts +24 -0
- package/dist/log-buffer.d.ts +8 -0
- package/dist/main.d.ts +13 -0
- package/dist/majordomo-p7giptj3.js +3782 -0
- package/dist/majordomo.d.ts +102 -0
- package/dist/manage-nav.d.ts +4 -0
- package/dist/manifest-diff.d.mts +11 -0
- package/dist/merged-values-CBzWsNOS.js +739 -0
- package/dist/merged-values.d.ts +24 -0
- package/dist/network-format.d.ts +30 -0
- package/dist/network.d.ts +13 -0
- package/dist/new-agent-BweyzBnY.js +201 -0
- package/dist/new-agent.d.ts +27 -0
- package/dist/new-cell-Iceq2Zfv.js +1985 -0
- package/dist/new-cell.d.ts +29 -0
- package/dist/new-config-C9NSC9Ou.js +1541 -0
- package/dist/new-config.d.ts +7 -0
- package/dist/notifications.d.ts +26 -0
- package/dist/onboarding-oZBJXTy0.js +395 -0
- package/dist/onboarding.d.mts +40 -0
- package/dist/panel-cells.d.mts +8 -0
- package/dist/recording-source.d.ts +37 -0
- package/dist/recording.d.mts +24 -0
- package/dist/registry-credentials.d.ts +13 -0
- package/dist/relationships.d.mts +12 -0
- package/dist/replay.d.ts +14 -0
- package/dist/request.d.ts +16 -0
- package/dist/router.d.ts +12 -0
- package/dist/routes.d.ts +43 -0
- package/dist/schedule-DzQ3Homi.js +113 -0
- package/dist/schedule-format.d.mts +9 -0
- package/dist/schedule.d.ts +16 -0
- package/dist/scope-actions.d.ts +9 -0
- package/dist/screens.d.ts +6 -0
- package/dist/secret-form.d.ts +24 -0
- package/dist/settings-nav.d.ts +5 -0
- package/dist/settings-page.d.ts +4 -0
- package/dist/settings-values.d.mts +18 -0
- package/dist/settings.d.ts +50 -0
- package/dist/sidebar-shell.d.ts +55 -0
- package/dist/sources-page-CxMSM-sz.js +423 -0
- package/dist/sources-page.d.ts +5 -0
- package/dist/space-subnets.d.ts +3 -0
- package/dist/style.css +2 -0
- package/dist/team-form.d.mts +56 -0
- package/dist/team-plan-CFOIv1lN.js +735 -0
- package/dist/team-plan.d.ts +22 -0
- package/dist/team-wizard.d.ts +8 -0
- package/dist/teams-page-C6UGy4Fw.js +2216 -0
- package/dist/teams-page.d.ts +9 -0
- package/dist/teams.d.mts +114 -0
- package/dist/terminal-palette.d.ts +8 -0
- package/dist/terminal.d.ts +98 -0
- package/dist/unread.d.mts +19 -0
- package/dist/use-unread.d.ts +4 -0
- package/dist/user-menu.d.ts +7 -0
- package/dist/views.d.mts +8 -0
- package/dist/workbench.d.ts +16 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InventoryResource } from "./inventory";
|
|
2
|
+
export declare function NewConfigPage({ revision, inventory, blueprintScope, onCreated }: {
|
|
3
|
+
revision: number;
|
|
4
|
+
inventory: InventoryResource;
|
|
5
|
+
blueprintScope?: string[];
|
|
6
|
+
onCreated: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type Resource } from "./request";
|
|
3
|
+
import type { Inventory } from "./inventory";
|
|
4
|
+
export type ToastTone = "pending" | "success" | "warning" | "error";
|
|
5
|
+
export type ToastInput = {
|
|
6
|
+
key: string;
|
|
7
|
+
tone: ToastTone;
|
|
8
|
+
message: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
link?: {
|
|
11
|
+
href: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type Notifier = {
|
|
16
|
+
notify: (toast: ToastInput) => void;
|
|
17
|
+
dismiss: (key: string) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function useNotify(): Notifier;
|
|
20
|
+
export declare function NotificationProvider({ children }: {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function InventoryIndicator({ inventory }: {
|
|
24
|
+
inventory: Resource<Inventory>;
|
|
25
|
+
}): import("react").JSX.Element | null;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { Bn as e, cn as t, en as n, nn as r } from "./connector-ui-CG9kLZ5s.js";
|
|
2
|
+
// src/relationships.mjs
|
|
3
|
+
function i(e, t) {
|
|
4
|
+
return typeof e?.[t] == "string" ? e[t] : "";
|
|
5
|
+
}
|
|
6
|
+
function a(e, t) {
|
|
7
|
+
return [
|
|
8
|
+
"realm",
|
|
9
|
+
"space",
|
|
10
|
+
"stack",
|
|
11
|
+
"name"
|
|
12
|
+
].every((n) => i(e, n) === i(t, n));
|
|
13
|
+
}
|
|
14
|
+
function o(e, t) {
|
|
15
|
+
return e.filter((e) => a(e.spec?.blueprint, t));
|
|
16
|
+
}
|
|
17
|
+
function s(e) {
|
|
18
|
+
let t = e?.spec?.provenance;
|
|
19
|
+
return t?.bindingKind !== "config" || !i(t.bindingRef, "name") ? null : Object.fromEntries([
|
|
20
|
+
"realm",
|
|
21
|
+
"space",
|
|
22
|
+
"stack",
|
|
23
|
+
"name"
|
|
24
|
+
].map((e) => [e, i(t.bindingRef, e)]).filter(([, e]) => e));
|
|
25
|
+
}
|
|
26
|
+
function c(e, t) {
|
|
27
|
+
let n = /* @__PURE__ */ new Set();
|
|
28
|
+
return e.filter((e) => {
|
|
29
|
+
let r = e.doc.spec?.provenance;
|
|
30
|
+
if (r?.bindingKind !== "config" || !a(r.bindingRef, t)) return !1;
|
|
31
|
+
let i = JSON.stringify(e.scope);
|
|
32
|
+
return !n.has(i) && (n.add(i), !0);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function l(e, t) {
|
|
36
|
+
let n = new Map(t.map((e) => [JSON.stringify([
|
|
37
|
+
i(e.metadata, "realm"),
|
|
38
|
+
i(e.metadata, "space"),
|
|
39
|
+
i(e.metadata, "stack"),
|
|
40
|
+
i(e.metadata, "name")
|
|
41
|
+
]), e])), r = /* @__PURE__ */ new Set(), a = [];
|
|
42
|
+
for (let t of e) {
|
|
43
|
+
let e = t.doc.spec?.provenance;
|
|
44
|
+
if (e?.bindingKind !== "config") continue;
|
|
45
|
+
let o = e.bindingRef, s = JSON.stringify([
|
|
46
|
+
i(o, "realm"),
|
|
47
|
+
i(o, "space"),
|
|
48
|
+
i(o, "stack"),
|
|
49
|
+
i(o, "name")
|
|
50
|
+
]), c = n.get(s);
|
|
51
|
+
if (!c) continue;
|
|
52
|
+
let l = t.scope;
|
|
53
|
+
if (l.some((e) => typeof e != "string" || e.length === 0)) continue;
|
|
54
|
+
let u = JSON.stringify(l);
|
|
55
|
+
r.has(u) || (r.add(u), a.push({
|
|
56
|
+
...t,
|
|
57
|
+
config: c
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
return a;
|
|
61
|
+
}
|
|
62
|
+
var u = (e) => typeof e == "string" && e.includes("${");
|
|
63
|
+
function d(e, t, n, r) {
|
|
64
|
+
return JSON.stringify([
|
|
65
|
+
e || "",
|
|
66
|
+
t || "",
|
|
67
|
+
n || "",
|
|
68
|
+
r || ""
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
function f(e, t, n) {
|
|
72
|
+
let r = d(i(n?.metadata ?? n, "realm"), i(n?.metadata ?? n, "space"), i(n?.metadata ?? n, "stack"), i(n?.metadata ?? n, "name")), a = new Set((Array.isArray(t) ? t : []).map((e) => d(i(e?.metadata, "realm"), i(e?.metadata, "space"), i(e?.metadata, "stack"), i(e?.metadata, "name")))), o = [];
|
|
73
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
74
|
+
let [e, n, s] = t.scope ?? [], c = Array.isArray(t.doc?.spec?.containers) ? t.doc.spec.containers : [];
|
|
75
|
+
for (let l of c) for (let c of Array.isArray(l?.volumes) ? l.volumes : []) {
|
|
76
|
+
if (c?.kind !== "volume") continue;
|
|
77
|
+
let f = "", p = "";
|
|
78
|
+
if (c.volumeRef && typeof c.volumeRef == "object") {
|
|
79
|
+
let e = c.volumeRef;
|
|
80
|
+
if ([
|
|
81
|
+
"name",
|
|
82
|
+
"realm",
|
|
83
|
+
"space",
|
|
84
|
+
"stack"
|
|
85
|
+
].some((t) => u(e[t]))) continue;
|
|
86
|
+
f = d(i(e, "realm"), i(e, "space"), i(e, "stack"), i(e, "name")), p = "volumeRef";
|
|
87
|
+
} else typeof c.source == "string" && c.source && !u(c.source) && (f = [
|
|
88
|
+
...e && n && s ? [d(e, n, s, c.source)] : [],
|
|
89
|
+
...e && n ? [d(e, n, "", c.source)] : [],
|
|
90
|
+
...e ? [d(e, "", "", c.source)] : []
|
|
91
|
+
].find((e) => a.has(e)) ?? "", p = "source");
|
|
92
|
+
f && f === r && o.push({
|
|
93
|
+
row: t,
|
|
94
|
+
container: typeof l.id == "string" ? l.id : "",
|
|
95
|
+
target: typeof c.target == "string" ? c.target : "",
|
|
96
|
+
readOnly: c.readOnly === !0,
|
|
97
|
+
ensure: c.ensure === !0,
|
|
98
|
+
by: p
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return o;
|
|
103
|
+
}
|
|
104
|
+
function p(e, t) {
|
|
105
|
+
let n = t?.metadata ?? t, r = [];
|
|
106
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
107
|
+
let e = Array.isArray(t?.status?.connectors) ? t.status.connectors : [], o = [...new Set(e.filter((e) => e?.volumeRef && a(e.volumeRef, n)).map((e) => i(e, "title") || i(e, "connector")).filter(Boolean))];
|
|
108
|
+
o.length && r.push({
|
|
109
|
+
config: t,
|
|
110
|
+
connectors: o
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return r;
|
|
114
|
+
}
|
|
115
|
+
var m = "kukeon.io/schedule";
|
|
116
|
+
function ee(e) {
|
|
117
|
+
let t = e?.metadata?.labels?.[m];
|
|
118
|
+
if (typeof t != "string" || !t) return null;
|
|
119
|
+
let n = i(e.metadata, "name"), r = n.startsWith(`${t}-`) ? n.slice(t.length + 1) : "", a = /^\d{9,10}$/.test(r) ? Number(r) : NaN;
|
|
120
|
+
return {
|
|
121
|
+
config: t,
|
|
122
|
+
firedAt: a >= 946684800 && a < 7258118400 ? (/* @__PURE__ */ new Date(a * 1e3)).toISOString() : void 0
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// src/cells.mjs
|
|
126
|
+
var te = /* @__PURE__ */ new Set(["Stopped", "Exited"]), h = (e) => !te.has(e ?? ""), g = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]);
|
|
127
|
+
function ne(e, t = []) {
|
|
128
|
+
return e.filter((e) => h(e.doc.status?.state) || t.length === 4 && g(e.scope, t));
|
|
129
|
+
}
|
|
130
|
+
var _ = (e) => e?.state !== "Ready" || !!e?.outOfSync || !!e?.outOfSyncError;
|
|
131
|
+
function v(e) {
|
|
132
|
+
return [...e.filter((e) => _(e.doc.status)), ...e.filter((e) => !_(e.doc.status))];
|
|
133
|
+
}
|
|
134
|
+
function y(e, t) {
|
|
135
|
+
return t ? t === "active" ? h(e) : t === "inactive" ? !h(e) : (e ?? "") === t : !0;
|
|
136
|
+
}
|
|
137
|
+
function b(e, t = 12) {
|
|
138
|
+
let n = (e ?? "").split(/\r?\n/).map((e) => e.trimEnd());
|
|
139
|
+
for (; n.length && !n[n.length - 1];) n.pop();
|
|
140
|
+
return n.slice(-t).join("\n");
|
|
141
|
+
}
|
|
142
|
+
function re(e, t) {
|
|
143
|
+
let n = (t ?? "").trim().toLocaleLowerCase();
|
|
144
|
+
return !n || e.scope.join(" / ").toLocaleLowerCase().includes(n);
|
|
145
|
+
}
|
|
146
|
+
var x = "Ungrouped", ie = /^[^/]*\.kukeon\.io(\/|$)/;
|
|
147
|
+
function ae(e, t) {
|
|
148
|
+
return [...new Set(e.flatMap((e) => Object.keys(e.doc.metadata.labels ?? {})))].filter((e) => e === t || !ie.test(e)).sort();
|
|
149
|
+
}
|
|
150
|
+
var S = (e, t) => JSON.stringify([e, t]);
|
|
151
|
+
function C(e, t) {
|
|
152
|
+
if (!t) return [{
|
|
153
|
+
id: S("", "All cells"),
|
|
154
|
+
label: "All cells",
|
|
155
|
+
rows: e
|
|
156
|
+
}];
|
|
157
|
+
let n = /* @__PURE__ */ new Map();
|
|
158
|
+
for (let r of e) {
|
|
159
|
+
let e = r.doc.metadata.labels?.[t]?.trim() || null, i = n.get(e) ?? [];
|
|
160
|
+
i.push(r), n.set(e, i);
|
|
161
|
+
}
|
|
162
|
+
return [...n].sort(([e], [t]) => e === null ? 1 : t === null ? -1 : e.localeCompare(t)).map(([e, n]) => ({
|
|
163
|
+
id: S(t, e),
|
|
164
|
+
label: e === null ? x : e === "Ungrouped" ? `${x} (label value)` : e,
|
|
165
|
+
rows: n
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
var w = "kukeon.io/config", T = "kukeon.io/template", E = "kukeon.io/harness", D = "kukeon.io/display-name", O = (e) => typeof e == "string" ? e.trim() : "", k = (e) => O(e?.metadata?.labels?.[T]) === "true", A = (e) => O(e?.metadata?.annotations?.[D]), oe = (e) => e ? e[0].toLocaleUpperCase() + e.slice(1) : "";
|
|
169
|
+
function se(e) {
|
|
170
|
+
let t = O(e);
|
|
171
|
+
return [...t].length > 63 ? "A display name has at most 63 characters." : /[\u0000-\u001f\u007f-\u009f]/.test(t) ? "A display name cannot contain control characters." : "";
|
|
172
|
+
}
|
|
173
|
+
function j(e) {
|
|
174
|
+
let t = A(e);
|
|
175
|
+
if (t) return {
|
|
176
|
+
name: t,
|
|
177
|
+
named: !0
|
|
178
|
+
};
|
|
179
|
+
if (O(e?.metadata?.annotations?.["kukeon.io/agent-template"])) {
|
|
180
|
+
let t = oe(O(e.metadata.labels?.[E]));
|
|
181
|
+
return {
|
|
182
|
+
name: t ? `${t} agent` : "Agent",
|
|
183
|
+
named: !0
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
name: "",
|
|
188
|
+
named: !1
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function M(e, t, n, r, i) {
|
|
192
|
+
let a = Array.isArray(e) ? e : [], o = a.find((e) => O(e?.metadata?.realm) === t && O(e?.metadata?.space) === n && O(e?.metadata?.stack) === r && O(e?.metadata?.name) === i);
|
|
193
|
+
if (o || n || r) return o;
|
|
194
|
+
let s = a.filter((e) => O(e?.metadata?.realm) === t && O(e?.metadata?.name) === i);
|
|
195
|
+
return s.length === 1 ? s[0] : void 0;
|
|
196
|
+
}
|
|
197
|
+
function N(e, t = []) {
|
|
198
|
+
e = e.filter((e) => !k(e.doc));
|
|
199
|
+
let n = (e, t, n, r) => JSON.stringify([
|
|
200
|
+
e,
|
|
201
|
+
t,
|
|
202
|
+
n,
|
|
203
|
+
r
|
|
204
|
+
]), r = /* @__PURE__ */ new Map();
|
|
205
|
+
for (let t of e) {
|
|
206
|
+
let e = s(t.doc);
|
|
207
|
+
if (!e) continue;
|
|
208
|
+
let i = [
|
|
209
|
+
e.realm || t.scope[0],
|
|
210
|
+
e.space ?? "",
|
|
211
|
+
e.stack ?? "",
|
|
212
|
+
e.name
|
|
213
|
+
], a = n(...i), o = JSON.stringify([i[0], i[3]]);
|
|
214
|
+
(!r.has(o) || a < r.get(o)) && r.set(o, a);
|
|
215
|
+
}
|
|
216
|
+
let i = /* @__PURE__ */ new Map(), a = [];
|
|
217
|
+
for (let o of e) {
|
|
218
|
+
let e = s(o.doc), c = o.doc.metadata.labels?.[w]?.trim(), l;
|
|
219
|
+
if (e) l = [
|
|
220
|
+
e.realm || o.scope[0],
|
|
221
|
+
e.space ?? "",
|
|
222
|
+
e.stack ?? "",
|
|
223
|
+
e.name
|
|
224
|
+
];
|
|
225
|
+
else if (c) l = JSON.parse(r.get(JSON.stringify([o.scope[0], c])) ?? n(o.scope[0], "", "", c));
|
|
226
|
+
else {
|
|
227
|
+
a.push(o);
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
let u = n(...l), d = i.get(u);
|
|
231
|
+
if (!d) {
|
|
232
|
+
let e = M(t, ...l);
|
|
233
|
+
if (e && k(e)) continue;
|
|
234
|
+
let n = j(e);
|
|
235
|
+
d = {
|
|
236
|
+
id: S("agent", u),
|
|
237
|
+
name: l[3],
|
|
238
|
+
displayName: n.name || l[3],
|
|
239
|
+
named: n.named,
|
|
240
|
+
realm: l[0],
|
|
241
|
+
scope: l.slice(0, 3).filter(Boolean),
|
|
242
|
+
rows: []
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
d.rows.push(o), i.set(u, d);
|
|
246
|
+
}
|
|
247
|
+
let o = [...i.values()].sort((e, t) => e.displayName.localeCompare(t.displayName) || e.name.localeCompare(t.name) || e.realm.localeCompare(t.realm) || e.id.localeCompare(t.id));
|
|
248
|
+
for (let e of o) {
|
|
249
|
+
let t = o.filter((t) => t.displayName === e.displayName);
|
|
250
|
+
e.showRealm = t.some((t) => t.realm !== e.realm), e.context = t.some((t) => t !== e && t.realm === e.realm) ? e.scope.join(" / ") : e.showRealm ? e.realm : "";
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
agents: o,
|
|
254
|
+
others: a
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function P({ agents: e, others: t }, n) {
|
|
258
|
+
return {
|
|
259
|
+
agents: e.map((e) => ({
|
|
260
|
+
...e,
|
|
261
|
+
rows: e.rows.filter(n)
|
|
262
|
+
})).filter((e) => e.rows.length),
|
|
263
|
+
others: t.filter(n)
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function F(e) {
|
|
267
|
+
let t = e.doc.status?.createdAt;
|
|
268
|
+
return typeof t == "string" && !t.startsWith("0001-") ? Date.parse(t) : NaN;
|
|
269
|
+
}
|
|
270
|
+
function I(e, t = []) {
|
|
271
|
+
let n = /* @__PURE__ */ new Map();
|
|
272
|
+
for (let t of e) {
|
|
273
|
+
let e = A(t.doc);
|
|
274
|
+
e && n.set(JSON.stringify(t.scope), e);
|
|
275
|
+
}
|
|
276
|
+
for (let r of N(e, t).agents) r.named && [...r.rows].sort((e, t) => {
|
|
277
|
+
let n = F(e), r = F(t);
|
|
278
|
+
return Number.isFinite(n) && Number.isFinite(r) && n !== r ? n - r : Number.isFinite(n) === Number.isFinite(r) ? e.scope.join("/").localeCompare(t.scope.join("/")) : Number.isFinite(n) ? -1 : 1;
|
|
279
|
+
}).forEach((e, t) => {
|
|
280
|
+
let i = JSON.stringify(e.scope);
|
|
281
|
+
n.has(i) || n.set(i, `${r.displayName} #${t + 1}`);
|
|
282
|
+
});
|
|
283
|
+
return n;
|
|
284
|
+
}
|
|
285
|
+
function L(e) {
|
|
286
|
+
return (e.find((e) => _(e.doc.status)) ?? e[0])?.doc.status?.state;
|
|
287
|
+
}
|
|
288
|
+
var R = "initialize", z = "login", B = "git-identity", V = "majordomo", H = "agent", U = "required", W = "recommended", G = "optional", K = (e) => Array.isArray(e) ? e : [], q = (e) => typeof e == "string" ? e.trim() : "", J = (e) => q(e?.title) || q(e?.name);
|
|
289
|
+
function ce(e) {
|
|
290
|
+
let t = K(e).map((e) => q(e?.name));
|
|
291
|
+
return t.includes("kuke") && t.includes("default");
|
|
292
|
+
}
|
|
293
|
+
function Y(e) {
|
|
294
|
+
return K(e).filter((e) => !!q(e?.harness));
|
|
295
|
+
}
|
|
296
|
+
function X(t) {
|
|
297
|
+
return K(t).filter((t) => r(t) || !!e(t));
|
|
298
|
+
}
|
|
299
|
+
function le(e) {
|
|
300
|
+
return X(e).find(r);
|
|
301
|
+
}
|
|
302
|
+
function ue(e, r, i) {
|
|
303
|
+
let a = q(e?.name);
|
|
304
|
+
return a ? n(r, a).length > 0 || t(i, a).some((e) => e.exists && e.state !== "empty") : !1;
|
|
305
|
+
}
|
|
306
|
+
function de(e) {
|
|
307
|
+
let t = q(e).replace(/\.$/, "");
|
|
308
|
+
return /^[A-Z][a-z]*(\s|$)/.test(t) ? t[0].toLowerCase() + t.slice(1) : t;
|
|
309
|
+
}
|
|
310
|
+
function fe(e) {
|
|
311
|
+
let t = de(e?.description);
|
|
312
|
+
return t ? `Not set up — recommended for ${t}.` : "Not set up — recommended.";
|
|
313
|
+
}
|
|
314
|
+
function pe(e, r, i) {
|
|
315
|
+
let a = q(e?.name);
|
|
316
|
+
return a ? t(i, a).some((e) => e.state === "logged in") || n(r, a).length > 0 : !1;
|
|
317
|
+
}
|
|
318
|
+
function Z(e, n, r) {
|
|
319
|
+
let i = q(n?.name), a = q(r?.name);
|
|
320
|
+
if (i && a) return t(e, i).find((e) => e.usedBy.some((e) => q(e.name) === a && (!q(r.realm) || !q(e.realm) || e.realm === r.realm)));
|
|
321
|
+
}
|
|
322
|
+
function me(e, t) {
|
|
323
|
+
return q(t) ? Y(e).find((e) => e.harness === t) : void 0;
|
|
324
|
+
}
|
|
325
|
+
function he(e, t, n) {
|
|
326
|
+
return Y(e).map((e) => {
|
|
327
|
+
let r = K(n).find((t) => t?.harness === e.harness && t.exists === !0);
|
|
328
|
+
return {
|
|
329
|
+
connector: e,
|
|
330
|
+
login: r ? Z(t, e, r) : void 0
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function Q(e, t) {
|
|
335
|
+
let n = K(t).filter((e) => q(e?.metadata?.annotations?.["kukeon.io/agent-template"]) && q(e.metadata.name));
|
|
336
|
+
return n.length ? K(e).some((e) => {
|
|
337
|
+
let t = s(e?.doc), r = q(t?.realm) || q(e?.scope?.[0]), i = q(t ? t.name : e?.doc?.metadata?.labels?.[w]);
|
|
338
|
+
return !!i && n.some((e) => e.metadata.name === i && (q(e.metadata.realm) || r) === r);
|
|
339
|
+
}) : !1;
|
|
340
|
+
}
|
|
341
|
+
var $ = (e, t) => e.length > 1 ? `${e.slice(0, -1).join(", ")} ${t} ${e.at(-1)}` : e[0] ?? "";
|
|
342
|
+
function ge({ teams: e, connectors: t, secrets: r, logins: i, cells: a, configs: o, majordomoCells: s = 0 } = {}) {
|
|
343
|
+
let c = Y(t), l = X(t);
|
|
344
|
+
return [
|
|
345
|
+
{
|
|
346
|
+
id: R,
|
|
347
|
+
kind: U,
|
|
348
|
+
title: "Initialize",
|
|
349
|
+
done: ce(e),
|
|
350
|
+
description: "Store the kuke team (majordomo) and the default team (the agent templates)."
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: z,
|
|
354
|
+
kind: U,
|
|
355
|
+
title: c.length ? `Log in to ${$(c.map(J), "or")}` : "Log in to a harness",
|
|
356
|
+
done: c.some((e) => pe(e, r, i)),
|
|
357
|
+
description: "An agent needs a login, or a token, for its harness."
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id: B,
|
|
361
|
+
kind: W,
|
|
362
|
+
title: l.length ? `Set up ${$(l.map(J), "and")}` : "Set up git",
|
|
363
|
+
done: l.some((e) => n(r, e.name).length > 0),
|
|
364
|
+
description: "Give cells an identity to clone, push and sign with."
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: V,
|
|
368
|
+
kind: G,
|
|
369
|
+
title: "Enable majordomo",
|
|
370
|
+
done: s > 0,
|
|
371
|
+
description: "Majordomo is kukeon's own assistant, docked beside every page."
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: H,
|
|
375
|
+
kind: U,
|
|
376
|
+
title: "Launch your first agent",
|
|
377
|
+
done: Q(a, o),
|
|
378
|
+
description: "A Claude or Codex cell with a terminal of its own."
|
|
379
|
+
}
|
|
380
|
+
];
|
|
381
|
+
}
|
|
382
|
+
function _e(e) {
|
|
383
|
+
return K(e).filter((e) => e.kind === "required" && !e.done);
|
|
384
|
+
}
|
|
385
|
+
function ve(e) {
|
|
386
|
+
let t = K(e).filter((e) => e.kind === U);
|
|
387
|
+
return {
|
|
388
|
+
done: t.filter((e) => e.done).length,
|
|
389
|
+
total: t.length
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function ye(e) {
|
|
393
|
+
return e?.done ? "Done" : e?.kind === "recommended" ? "Recommended" : e?.kind === "optional" ? "Optional" : "To do";
|
|
394
|
+
}
|
|
395
|
+
export { L as A, P as C, k as D, I as E, o as F, p as I, a as L, l as M, c as N, y as O, s as P, ee as R, se as S, ae as T, N as _, me as a, j as b, _e as c, R as d, z as f, ne as g, he as h, le as i, b as j, A as k, H as l, ye as m, Z as n, fe as o, V as p, ue as r, ve as s, ge as t, B as u, v, C as w, w as x, re as y, f as z };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Connector, LoginIdentity } from "./connectors.mjs";
|
|
2
|
+
|
|
3
|
+
export const defaultTeam: string;
|
|
4
|
+
export const stepInitialize: string;
|
|
5
|
+
export const stepLogin: string;
|
|
6
|
+
export const stepGit: string;
|
|
7
|
+
export const stepMajordomo: string;
|
|
8
|
+
export const stepAgent: string;
|
|
9
|
+
export const kindRequired: string;
|
|
10
|
+
export const kindRecommended: string;
|
|
11
|
+
export const kindOptional: string;
|
|
12
|
+
|
|
13
|
+
export type Step = { id: string; kind: string; title: string; description: string; done: boolean };
|
|
14
|
+
export type AgentTemplateRef = { harness: string; name: string; realm?: string; exists: boolean };
|
|
15
|
+
export type ChecklistInput = {
|
|
16
|
+
teams?: Array<{ name: string }>;
|
|
17
|
+
connectors?: Connector[];
|
|
18
|
+
secrets?: unknown[];
|
|
19
|
+
logins?: unknown[];
|
|
20
|
+
cells?: unknown[];
|
|
21
|
+
configs?: unknown[];
|
|
22
|
+
majordomoCells?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function teamsInitialized(teams: Array<{ name: string }> | undefined): boolean;
|
|
26
|
+
export function harnessConnectors(connectors: Connector[] | undefined): Connector[];
|
|
27
|
+
export function gitConnectors(connectors: Connector[] | undefined): Connector[];
|
|
28
|
+
export function gitIdentityConnector(connectors: Connector[] | undefined): Connector | undefined;
|
|
29
|
+
export function connectorSetUp(connector: Connector | undefined, secrets: unknown[] | undefined, logins: unknown[] | undefined): boolean;
|
|
30
|
+
export function recommendedFor(description: string | undefined): string;
|
|
31
|
+
export function notSetUpText(connector: { description?: string } | undefined): string;
|
|
32
|
+
export function harnessLoggedIn(connector: Connector | undefined, secrets: unknown[] | undefined, logins: unknown[] | undefined): boolean;
|
|
33
|
+
export function configLogin(logins: unknown[] | undefined, connector: { name: string } | undefined, config: { name: string; realm?: string } | undefined): LoginIdentity | undefined;
|
|
34
|
+
export function harnessConnector(connectors: Connector[] | undefined, harness: string | undefined): Connector | undefined;
|
|
35
|
+
export function templateLogins(connectors: Connector[] | undefined, logins: unknown[] | undefined, templates: AgentTemplateRef[] | undefined): Array<{ connector: Connector; login?: LoginIdentity }>;
|
|
36
|
+
export function hasAgentCell(rows: unknown[] | undefined, configs: unknown[] | undefined): boolean;
|
|
37
|
+
export function checklist(input?: ChecklistInput): Step[];
|
|
38
|
+
export function requiredOpen(items: Step[] | undefined): Step[];
|
|
39
|
+
export function progress(items: Step[] | undefined): { done: number; total: number };
|
|
40
|
+
export function stepState(item: Step | undefined): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Membership = { added: string[]; removed: string[] };
|
|
2
|
+
export const membershipKey: string;
|
|
3
|
+
export function parseMembership(raw: string | null | undefined): Membership;
|
|
4
|
+
export function panelKeys(majordomo: string[], existing: Iterable<string>, membership: Membership): string[];
|
|
5
|
+
export function addToPanel(membership: Membership, key: string, isMajordomo: boolean): Membership;
|
|
6
|
+
export function removeFromPanel(membership: Membership, key: string, isMajordomo: boolean): Membership;
|
|
7
|
+
export function pruneMembership(membership: Membership, cellKeys: Iterable<string>): Membership;
|
|
8
|
+
export function sameMembership(a: Membership, b: Membership): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type RecordingFormat = "asciicast" | "raw";
|
|
2
|
+
export type SourceError = {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
export type SourceHandlers = {
|
|
7
|
+
begin(format: RecordingFormat, dropped: boolean): void;
|
|
8
|
+
lines(lines: string[]): void;
|
|
9
|
+
bytes(bytes: Uint8Array): void;
|
|
10
|
+
progress(read: number, total: number, loaded: boolean): void;
|
|
11
|
+
error(error: SourceError): void;
|
|
12
|
+
};
|
|
13
|
+
export declare const FOLLOW_INTERVAL_MS = 2000;
|
|
14
|
+
export declare class RecordingSource {
|
|
15
|
+
private readonly handlers;
|
|
16
|
+
private readonly following;
|
|
17
|
+
private readonly base;
|
|
18
|
+
private readonly controller;
|
|
19
|
+
private format;
|
|
20
|
+
private held;
|
|
21
|
+
private lastSeq;
|
|
22
|
+
private live;
|
|
23
|
+
private busy;
|
|
24
|
+
private timer;
|
|
25
|
+
constructor(scope: string[], container: string, handlers: SourceHandlers, following: () => boolean);
|
|
26
|
+
start(): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
private run;
|
|
29
|
+
private get;
|
|
30
|
+
private list;
|
|
31
|
+
private chunk;
|
|
32
|
+
private readNew;
|
|
33
|
+
private hold;
|
|
34
|
+
private readClosed;
|
|
35
|
+
private readLive;
|
|
36
|
+
private follow;
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const IDLE_LIMIT: number;
|
|
2
|
+
export const RUN_PAUSE: number;
|
|
3
|
+
export type LineSplitter = { push(bytes: Uint8Array): string[]; readonly pending: number };
|
|
4
|
+
export type Header = { width: number; height: number; timestamp: number };
|
|
5
|
+
export type Event = { time: number; code: string; data: string };
|
|
6
|
+
export type ParsedLine = { header: Header; event?: undefined } | { event: Event; header?: undefined } | null;
|
|
7
|
+
export type Op = { kind: "o"; run: number; t: number; data: string } | { kind: "size"; run: number; t: number; cols: number; rows: number };
|
|
8
|
+
export type Run = { timestamp: number; firstOp: number };
|
|
9
|
+
export type Recording = { runs: Run[]; ops: Op[]; play: { idle: number[]; full: number[] }; cols: number; rows: number; lastT: number };
|
|
10
|
+
export type Write = { data: string; cols?: undefined; rows?: undefined } | { cols: number; rows: number; data?: undefined };
|
|
11
|
+
export function createLineSplitter(): LineSplitter;
|
|
12
|
+
export function parseLine(line: string): ParsedLine;
|
|
13
|
+
export function parseSize(data: string): { cols: number; rows: number } | null;
|
|
14
|
+
export function createRecording(): Recording;
|
|
15
|
+
export function addRecord(recording: Recording, record: ParsedLine): void;
|
|
16
|
+
export function addLines(recording: Recording, lines: string[]): void;
|
|
17
|
+
export function duration(recording: Recording, idleSkip: boolean): number;
|
|
18
|
+
export function opsDue(recording: Recording, idleSkip: boolean, pos: number): number;
|
|
19
|
+
export function positionOf(recording: Recording, idleSkip: boolean, count: number): number;
|
|
20
|
+
export function sizeAt(recording: Recording, count: number): { cols: number; rows: number };
|
|
21
|
+
export function wallClockAt(recording: Recording, idleSkip: boolean, pos: number): number | null;
|
|
22
|
+
export function runMarks(recording: Recording, idleSkip: boolean): { index: number; position: number; timestamp: number }[];
|
|
23
|
+
export function writesBetween(recording: Recording, from: number, to: number, maxChars?: number): Write[];
|
|
24
|
+
export function exportCast(recording: Recording): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type RegistryCredential = {
|
|
2
|
+
serverAddress?: string;
|
|
3
|
+
username?: string;
|
|
4
|
+
secretRef?: {
|
|
5
|
+
name: string;
|
|
6
|
+
realm?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function RegistryCredentialsPanel({ realm, credentials, onSaved }: {
|
|
10
|
+
realm: string;
|
|
11
|
+
credentials: RegistryCredential[];
|
|
12
|
+
onSaved: () => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ScopedReference = { name?: string; realm?: string; space?: string; stack?: string };
|
|
2
|
+
export type CellRow = { scope: string[]; doc: { metadata: { name: string }; status?: { state?: unknown }; spec?: Record<string, unknown> } };
|
|
3
|
+
export type ConfigDoc = { metadata: ScopedReference; spec?: { blueprint?: ScopedReference } };
|
|
4
|
+
export function sameScopedReference(left: ScopedReference, right: ScopedReference): boolean;
|
|
5
|
+
export function configsForBlueprint<T extends ConfigDoc>(configs: T[], blueprint: ScopedReference): T[];
|
|
6
|
+
export function configForCell(doc: { [key: string]: unknown } | null | undefined): ScopedReference | null;
|
|
7
|
+
export function cellsForConfig<T extends CellRow>(cells: T[], config: ScopedReference): T[];
|
|
8
|
+
export function cellsForBlueprint<T extends CellRow, C extends ConfigDoc>(cells: T[], configs: C[]): Array<T & { config: C }>;
|
|
9
|
+
type VolumeMountUse<T extends CellRow> = { row: T; container: string; target: string; readOnly: boolean; ensure: boolean; by: "source" | "volumeRef" };
|
|
10
|
+
export function volumeMounts<T extends CellRow>(cells: T[], volumes: Array<{ metadata: ScopedReference }> | undefined, volume: { metadata: ScopedReference } | ScopedReference): Array<VolumeMountUse<T>>;
|
|
11
|
+
export function configsForStateVolume<C extends { metadata: ScopedReference; status?: unknown }>(configs: C[] | undefined, volume: { metadata: ScopedReference } | ScopedReference): Array<{ config: C; connectors: string[] }>;
|
|
12
|
+
export function scheduledRun(doc: { metadata?: { name?: string; labels?: Record<string, string> } } | null | undefined): { config: string; firedAt?: string } | null;
|
package/dist/replay.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Theme } from "./terminal";
|
|
2
|
+
export declare function ReplayButton({ container, open, onToggle }: {
|
|
3
|
+
container: string;
|
|
4
|
+
open: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function ReplayPanel({ scope, container, live, theme, expanded, onClose }: {
|
|
8
|
+
scope: string[];
|
|
9
|
+
container: string;
|
|
10
|
+
live: boolean;
|
|
11
|
+
theme: Theme;
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Failure = {
|
|
2
|
+
code: string;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
export type Resource<T> = {
|
|
6
|
+
data?: T;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error?: Failure;
|
|
9
|
+
};
|
|
10
|
+
export declare function useResource<T>(path: string | null, revision: number): Resource<T>;
|
|
11
|
+
export declare function toFailure(error: unknown): Failure;
|
|
12
|
+
export declare function failureTitle(error: Failure, kind?: string): string;
|
|
13
|
+
export declare function ErrorNotice({ error, kind }: {
|
|
14
|
+
error: Failure;
|
|
15
|
+
kind?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Router = {
|
|
2
|
+
current: () => string;
|
|
3
|
+
href: (path: string) => string;
|
|
4
|
+
navigate: (href: string) => void;
|
|
5
|
+
subscribe: (listener: () => void) => () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const hashRouter: Router;
|
|
8
|
+
export declare function configureRouter(router?: Router): void;
|
|
9
|
+
export declare function currentRoutePath(): string;
|
|
10
|
+
export declare function routeHref(path: string): string;
|
|
11
|
+
export declare function navigate(href: string): void;
|
|
12
|
+
export declare function onRouteChange(listener: () => void): () => void;
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const kinds: string[];
|
|
2
|
+
export declare const titles: string[];
|
|
3
|
+
export declare const catalogTitles: Record<string, string>;
|
|
4
|
+
export type Route = {
|
|
5
|
+
view: string;
|
|
6
|
+
scope: string[];
|
|
7
|
+
parent: string[];
|
|
8
|
+
document: boolean;
|
|
9
|
+
config?: string[];
|
|
10
|
+
blueprint?: string[];
|
|
11
|
+
target?: string[];
|
|
12
|
+
edit?: boolean;
|
|
13
|
+
action?: string;
|
|
14
|
+
identity?: string[];
|
|
15
|
+
state?: string;
|
|
16
|
+
connector?: string;
|
|
17
|
+
section?: string;
|
|
18
|
+
extension?: string;
|
|
19
|
+
extensionPath?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function homeLink(): string;
|
|
22
|
+
export declare function overviewLink(): string;
|
|
23
|
+
export declare function readRoute(): Route;
|
|
24
|
+
export declare function workspaceLink(scope: string[]): string;
|
|
25
|
+
export declare function newCellLink(config?: string[]): string;
|
|
26
|
+
export declare function newConfigLink(blueprint?: string[]): string;
|
|
27
|
+
export declare function newAgentLink(): string;
|
|
28
|
+
export declare function newSecretLink(): string;
|
|
29
|
+
export declare function catalogPageLink(kind: string, scope: string[], options?: {
|
|
30
|
+
document?: boolean;
|
|
31
|
+
edit?: boolean;
|
|
32
|
+
}): string;
|
|
33
|
+
export declare function settingsLink(): string;
|
|
34
|
+
export declare function healthLink(): string;
|
|
35
|
+
export declare function daemonLink(section?: "logs" | "connectors"): string;
|
|
36
|
+
export declare function imagesLink(realm?: string, ref?: string): string;
|
|
37
|
+
export declare function resourceLink(scope: string[], document?: boolean): string;
|
|
38
|
+
export declare function listLink(depth: number, parent?: string[], state?: string): string;
|
|
39
|
+
export declare function teamsLink(name?: string, section?: "edit" | "export"): string;
|
|
40
|
+
export declare function newTeamLink(): string;
|
|
41
|
+
export declare function sourcesLink(name?: string): string;
|
|
42
|
+
export declare function configPageLink(scope: string[], name: string): string;
|
|
43
|
+
export declare function apiPath(scope: string[]): string;
|