@wso2/am-core-ui 0.0.19 → 0.0.20
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/CatalogKindListing-DvUuZEpc.js +137 -0
- package/dist/{CodeBlock-mB_Loq7I.js → CodeBlock-B2Ecl916.js} +1 -1
- package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
- package/dist/{EnvironmentSelector-B7Bl93s2.js → EnvironmentSelector-D8S6nO9u.js} +1 -1
- package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
- package/dist/LabelChips-7rA7_yre.js +139 -0
- package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
- package/dist/{ResourceListShell-Cx6mdeqv.js → ResourceListShell-DFisKftq.js} +1 -1
- package/dist/{SwaggerSpecViewer-BvkhoKsi.js → SwaggerSpecViewer-DzjR6U6W.js} +1 -1
- package/dist/{debounce-BV83M53b.js → debounce-D17ObVdG.js} +1 -1
- package/dist/{format-BEZZRyE2.js → format-wlHhWjGo.js} +1 -1
- package/dist/{formatDistanceToNow-TErllcH8.js → formatDistanceToNow-DyjnT7l9.js} +11 -11
- package/dist/{gatewayScripts-D8O45W8u.js → gatewayScripts-D4ZDEDPS.js} +1 -1
- package/dist/{index-sr-mWz4T.js → index-3K-zqdp-.js} +32 -32
- package/dist/{index-KRsV2L4V.js → index-6liAPSDn.js} +160 -160
- package/dist/{index-B52h3RHg.js → index-B3ASENUJ.js} +109 -109
- package/dist/index-B7Pf4oPq.js +3069 -0
- package/dist/index-BNO3FhZK.js +2304 -0
- package/dist/index-BUZSfCl5.js +335 -0
- package/dist/index-BXiG1r_o.js +1409 -0
- package/dist/{index-_0Pj_ZtW.js → index-BYy7Iaam.js} +40 -40
- package/dist/{index-BfjzUWDa.js → index-BbB_yx4V.js} +103 -103
- package/dist/index-BjWJ95lH.js +2728 -0
- package/dist/{index-B_Z0MwXk.js → index-ByEInFlf.js} +10916 -9520
- package/dist/index-C8WIhzyz.js +123 -0
- package/dist/index-CnzvaT6b.js +2368 -0
- package/dist/index-CrnCf-hJ.js +763 -0
- package/dist/{index-CgCWbWzN.js → index-Cvsho9xg.js} +381 -377
- package/dist/{index-UqDmyMSA.js → index-CxnAo1_c.js} +21 -21
- package/dist/{index-BnV-PkwM.js → index-Cz7-AZwE.js} +2 -2
- package/dist/{index-BP5drcF2.js → index-DBdRFjxm.js} +232 -233
- package/dist/{index-BZ4vxviI.js → index-DFsSvmMZ.js} +5 -5
- package/dist/index-DslzOSGN.js +2549 -0
- package/dist/{index-DD4qF7gq.js → index-DvpYvchM.js} +101 -100
- package/dist/index.d.ts +784 -163
- package/dist/index.js +532 -454
- package/dist/js-yaml-CvhD-clg.js +1335 -0
- package/dist/{llmProviderPayload-CzihkdNa.js → llmProviderPayload-BPzWDy7n.js} +2 -2
- package/package.json +1 -1
- package/dist/CatalogKindListing-DtFI2YMG.js +0 -118
- package/dist/EnvironmentCard-09h1XRxx.js +0 -310
- package/dist/PolicyListSection-o4k9e8XO.js +0 -2475
- package/dist/index-CGDYgUCH.js +0 -711
- package/dist/index-COt7nJIf.js +0 -2286
- package/dist/index-CWZjOy1h.js +0 -2247
- package/dist/index-CezvogTQ.js +0 -116
- package/dist/index-CjCkcuuI.js +0 -322
- package/dist/index-CjXvuf9m.js +0 -1354
- package/dist/index-DeQ-9KTC.js +0 -737
- package/dist/index-Df6OBy4E.js +0 -3041
- package/dist/index-PUuASE1F.js +0 -2507
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import { Trash as _e, Plus as le, Package as Se, Edit as pe, ExternalLink as fe } from "@wso2/oxygen-ui-icons-react";
|
|
2
|
+
import { jsx as e, jsxs as o, Fragment as me } from "react/jsx-runtime";
|
|
3
|
+
import Oe, { useState as $, useEffect as ce, useMemo as O, useCallback as ie } from "react";
|
|
4
|
+
import { Box as U, Typography as v, Switch as ye, Stack as _, FormControlLabel as ve, IconButton as Ue, Button as G, ListingTable as r, Skeleton as W, Chip as Ie, Form as I, Select as we, MenuItem as ee, CircularProgress as He, Alert as Z, Divider as re, Menu as Ye } from "@wso2/oxygen-ui";
|
|
5
|
+
import { useNavigate as ue, useLocation as Ae, useParams as te, generatePath as B, Link as xe, Route as X, Routes as De, Navigate as Le, useSearchParams as Ge } from "react-router-dom";
|
|
6
|
+
import { n as J, aL as Fe, o as qe, u as ge, g as M, L as je, cn as Xe, p as Ze, P as ne, t as Ke, D as Pe, s as Ve, co as ze, S as We, cp as Je, cq as Qe, Q as en, K as nn } from "./index-ByEInFlf.js";
|
|
7
|
+
import { c as oe } from "react/compiler-runtime";
|
|
8
|
+
import "@tanstack/react-query";
|
|
9
|
+
import { L as Re, a as tn } from "./LabelChips-7rA7_yre.js";
|
|
10
|
+
import { j as rn } from "./js-yaml-CvhD-clg.js";
|
|
11
|
+
import { S as Ee } from "./SwaggerSpecViewer-DzjR6U6W.js";
|
|
12
|
+
import { f as an } from "./formatDistanceToNow-DyjnT7l9.js";
|
|
13
|
+
import { C as on } from "./CatalogKindListing-DvUuZEpc.js";
|
|
14
|
+
function Be(t) {
|
|
15
|
+
if (t?.trim())
|
|
16
|
+
try {
|
|
17
|
+
const n = JSON.parse(t);
|
|
18
|
+
return n && typeof n == "object" ? n : void 0;
|
|
19
|
+
} catch {
|
|
20
|
+
try {
|
|
21
|
+
const n = rn.load(t);
|
|
22
|
+
return n && typeof n == "object" ? n : void 0;
|
|
23
|
+
} catch {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const ln = /^[A-Za-z_][A-Za-z0-9_]*$/, be = 64, Ce = (t, n) => {
|
|
29
|
+
const i = t.trim();
|
|
30
|
+
return i ? i.length > be ? `Key must be at most ${be} characters.` : ln.test(i) ? (n.get(i) ?? 0) > 1 ? "Key must be unique." : null : "Key must start with a letter or underscore, and contain only letters, numbers, or underscores." : "Key is required.";
|
|
31
|
+
}, sn = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`, ae = (t = {}) => ({
|
|
32
|
+
id: sn(),
|
|
33
|
+
key: "",
|
|
34
|
+
isSecret: !1,
|
|
35
|
+
isMandatory: !1,
|
|
36
|
+
defaultValue: "",
|
|
37
|
+
...t
|
|
38
|
+
}), dn = (t) => {
|
|
39
|
+
const n = oe(41), {
|
|
40
|
+
row: i,
|
|
41
|
+
keyError: l,
|
|
42
|
+
readonlyKey: a,
|
|
43
|
+
canRemove: u,
|
|
44
|
+
onUpdate: s,
|
|
45
|
+
onRemove: p
|
|
46
|
+
} = t;
|
|
47
|
+
let g;
|
|
48
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
49
|
+
width: 180
|
|
50
|
+
}, n[0] = g) : g = n[0];
|
|
51
|
+
let d;
|
|
52
|
+
n[1] !== l || n[2] !== s || n[3] !== a || n[4] !== i.key ? (d = /* @__PURE__ */ e(U, { sx: g, children: a ? /* @__PURE__ */ e(v, { variant: "body2", fontWeight: 600, children: i.key }) : /* @__PURE__ */ o(me, { children: [
|
|
53
|
+
/* @__PURE__ */ e(J, { placeholder: "Key", value: i.key, onChange: (z) => s("key", z.target.value.replace(/\s/g, "_")), fullWidth: !0, size: "small", error: !!l }),
|
|
54
|
+
l && /* @__PURE__ */ e(v, { variant: "caption", color: "error.main", children: l })
|
|
55
|
+
] }) }), n[1] = l, n[2] = s, n[3] = a, n[4] = i.key, n[5] = d) : d = n[5];
|
|
56
|
+
let c;
|
|
57
|
+
n[6] === Symbol.for("react.memo_cache_sentinel") ? (c = {
|
|
58
|
+
width: 180
|
|
59
|
+
}, n[6] = c) : c = n[6];
|
|
60
|
+
const f = i.defaultValue ?? "";
|
|
61
|
+
let b;
|
|
62
|
+
n[7] !== s ? (b = (z) => s("defaultValue", z.target.value), n[7] = s, n[8] = b) : b = n[8];
|
|
63
|
+
let P;
|
|
64
|
+
n[9] !== f || n[10] !== b ? (P = /* @__PURE__ */ e(U, { sx: c, children: /* @__PURE__ */ e(J, { placeholder: "Default value", value: f, onChange: b, fullWidth: !0, size: "small" }) }), n[9] = f, n[10] = b, n[11] = P) : P = n[11];
|
|
65
|
+
const L = i.isMandatory ?? !1;
|
|
66
|
+
let w;
|
|
67
|
+
n[12] !== s ? (w = (z, H) => s("isMandatory", H), n[12] = s, n[13] = w) : w = n[13];
|
|
68
|
+
let S;
|
|
69
|
+
n[14] !== L || n[15] !== w ? (S = /* @__PURE__ */ e(ye, { size: "small", checked: L, onChange: w }), n[14] = L, n[15] = w, n[16] = S) : S = n[16];
|
|
70
|
+
let A;
|
|
71
|
+
n[17] === Symbol.for("react.memo_cache_sentinel") ? (A = {
|
|
72
|
+
mr: 0,
|
|
73
|
+
minWidth: 105
|
|
74
|
+
}, n[17] = A) : A = n[17];
|
|
75
|
+
let x;
|
|
76
|
+
n[18] !== S ? (x = /* @__PURE__ */ e(ve, { control: S, label: "Mandatory", sx: A }), n[18] = S, n[19] = x) : x = n[19];
|
|
77
|
+
let y;
|
|
78
|
+
n[20] !== s ? (y = (z, H) => s("isSecret", H), n[20] = s, n[21] = y) : y = n[21];
|
|
79
|
+
let C;
|
|
80
|
+
n[22] !== i.isSecret || n[23] !== y ? (C = /* @__PURE__ */ e(ye, { size: "small", checked: i.isSecret, onChange: y }), n[22] = i.isSecret, n[23] = y, n[24] = C) : C = n[24];
|
|
81
|
+
let D;
|
|
82
|
+
n[25] === Symbol.for("react.memo_cache_sentinel") ? (D = {
|
|
83
|
+
mr: 0,
|
|
84
|
+
minWidth: 80
|
|
85
|
+
}, n[25] = D) : D = n[25];
|
|
86
|
+
let N;
|
|
87
|
+
n[26] !== C ? (N = /* @__PURE__ */ e(ve, { control: C, label: "Secret", sx: D }), n[26] = C, n[27] = N) : N = n[27];
|
|
88
|
+
let K;
|
|
89
|
+
n[28] !== u || n[29] !== p || n[30] !== a ? (K = !a && /* @__PURE__ */ e(Ue, { size: "small", onClick: p, disabled: !u, "aria-label": "Remove row", color: "error", children: /* @__PURE__ */ e(_e, { size: 16 }) }), n[28] = u, n[29] = p, n[30] = a, n[31] = K) : K = n[31];
|
|
90
|
+
let V;
|
|
91
|
+
n[32] !== x || n[33] !== N || n[34] !== K ? (V = /* @__PURE__ */ o(U, { display: "flex", flexDirection: "row", flexGrow: 1, alignItems: "start", pl: 2, pt: 0.5, gap: 1, children: [
|
|
92
|
+
x,
|
|
93
|
+
N,
|
|
94
|
+
K
|
|
95
|
+
] }), n[32] = x, n[33] = N, n[34] = K, n[35] = V) : V = n[35];
|
|
96
|
+
let R;
|
|
97
|
+
return n[36] !== i.id || n[37] !== V || n[38] !== d || n[39] !== P ? (R = /* @__PURE__ */ o(_, { direction: "row", spacing: 1, alignItems: "top", justifyContent: "flex-start", children: [
|
|
98
|
+
d,
|
|
99
|
+
P,
|
|
100
|
+
V
|
|
101
|
+
] }, i.id), n[36] = i.id, n[37] = V, n[38] = d, n[39] = P, n[40] = R) : R = n[40], R;
|
|
102
|
+
}, Me = (t) => {
|
|
103
|
+
const n = oe(25), {
|
|
104
|
+
rows: i,
|
|
105
|
+
onChange: l,
|
|
106
|
+
readonlyKey: a
|
|
107
|
+
} = t;
|
|
108
|
+
let u, s, p, g, d, c;
|
|
109
|
+
if (n[0] !== l || n[1] !== a || n[2] !== i) {
|
|
110
|
+
const L = i.map(cn).reduce(hn, /* @__PURE__ */ new Map());
|
|
111
|
+
p = !a && i.some((y) => Ce(y.key, L) !== null);
|
|
112
|
+
let w;
|
|
113
|
+
n[9] !== l || n[10] !== i ? (w = (y, C, D) => {
|
|
114
|
+
const N = [...i];
|
|
115
|
+
N[y] = {
|
|
116
|
+
...N[y],
|
|
117
|
+
[C]: D
|
|
118
|
+
}, l(N);
|
|
119
|
+
}, n[9] = l, n[10] = i, n[11] = w) : w = n[11];
|
|
120
|
+
const S = w;
|
|
121
|
+
s = () => {
|
|
122
|
+
p || l([...i, ae()]);
|
|
123
|
+
};
|
|
124
|
+
let A;
|
|
125
|
+
n[12] !== l || n[13] !== i ? (A = (y) => l(i.filter((C, D) => D !== y)), n[12] = l, n[13] = i, n[14] = A) : A = n[14];
|
|
126
|
+
const x = A;
|
|
127
|
+
u = _, g = 1, d = 1, c = i.map((y, C) => /* @__PURE__ */ e(dn, { row: y, keyError: a ? null : Ce(y.key, L), readonlyKey: a, canRemove: i.length > 1, onUpdate: (D, N) => S(C, D, N), onRemove: () => x(C) }, y.id)), n[0] = l, n[1] = a, n[2] = i, n[3] = u, n[4] = s, n[5] = p, n[6] = g, n[7] = d, n[8] = c;
|
|
128
|
+
} else
|
|
129
|
+
u = n[3], s = n[4], p = n[5], g = n[6], d = n[7], c = n[8];
|
|
130
|
+
let f;
|
|
131
|
+
n[15] !== s || n[16] !== p || n[17] !== a ? (f = !a && /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(G, { size: "small", variant: "outlined", startIcon: /* @__PURE__ */ e(le, {}), onClick: s, disabled: p, children: "Add Runtime Key" }) }), n[15] = s, n[16] = p, n[17] = a, n[18] = f) : f = n[18];
|
|
132
|
+
let b;
|
|
133
|
+
return n[19] !== u || n[20] !== g || n[21] !== d || n[22] !== c || n[23] !== f ? (b = /* @__PURE__ */ o(u, { spacing: g, pt: d, children: [
|
|
134
|
+
c,
|
|
135
|
+
f
|
|
136
|
+
] }), n[19] = u, n[20] = g, n[21] = d, n[22] = c, n[23] = f, n[24] = b) : b = n[24], b;
|
|
137
|
+
};
|
|
138
|
+
function cn(t) {
|
|
139
|
+
return t.key.trim();
|
|
140
|
+
}
|
|
141
|
+
function hn(t, n) {
|
|
142
|
+
return n && t.set(n, (t.get(n) ?? 0) + 1), t;
|
|
143
|
+
}
|
|
144
|
+
const he = () => {
|
|
145
|
+
const t = ue(), n = Ae(), {
|
|
146
|
+
orgId: i,
|
|
147
|
+
projectId: l,
|
|
148
|
+
agentId: a
|
|
149
|
+
} = te(), {
|
|
150
|
+
data: u,
|
|
151
|
+
isLoading: s
|
|
152
|
+
} = Fe({
|
|
153
|
+
orgName: i,
|
|
154
|
+
kindName: a
|
|
155
|
+
}), {
|
|
156
|
+
data: p
|
|
157
|
+
} = qe({
|
|
158
|
+
orgName: i,
|
|
159
|
+
projName: l,
|
|
160
|
+
agentName: a
|
|
161
|
+
}), {
|
|
162
|
+
data: g
|
|
163
|
+
} = ge({
|
|
164
|
+
orgName: i,
|
|
165
|
+
kindName: a
|
|
166
|
+
}), d = B(M.children.org.children.projects.children.agents.children.publish.path, {
|
|
167
|
+
orgId: i ?? "",
|
|
168
|
+
projectId: l ?? "",
|
|
169
|
+
agentId: a ?? ""
|
|
170
|
+
}), c = B(M.children.org.children.projects.children.agents.children.publish.children.createNewVersion.path, {
|
|
171
|
+
orgId: i ?? "",
|
|
172
|
+
projectId: l ?? "",
|
|
173
|
+
agentId: a ?? ""
|
|
174
|
+
}), f = n.pathname.endsWith("/create-new-version"), [b, P] = $(""), [L, w] = $(""), [S, A] = $(""), [x, y] = $(""), [C, D] = $({}), [N, K] = $([ae()]), {
|
|
175
|
+
addConfirmation: V
|
|
176
|
+
} = je();
|
|
177
|
+
ce(() => {
|
|
178
|
+
f && g ? (A(g.displayName ?? ""), y(g.description ?? "")) : !g && p && (A(p.displayName ?? ""), y(p.description ?? ""));
|
|
179
|
+
}, [f, g, p]);
|
|
180
|
+
const {
|
|
181
|
+
mutateAsync: R,
|
|
182
|
+
isPending: z
|
|
183
|
+
} = Xe(), H = O(() => b.trim() !== "" || L !== "" || S.trim() !== "" || x.trim() !== "" || Object.keys(C).length > 0 || N.some((m) => m.key.trim() !== ""), [b, L, S, x, C, N]), Y = ie(() => {
|
|
184
|
+
P(""), w(""), A(""), y(""), D({}), K([ae()]);
|
|
185
|
+
}, []), h = ie(() => {
|
|
186
|
+
H ? V({
|
|
187
|
+
title: "Discard Changes?",
|
|
188
|
+
description: "You have unsaved changes. Are you sure you want to close without saving?",
|
|
189
|
+
confirmButtonText: "Discard",
|
|
190
|
+
confirmButtonColor: "error",
|
|
191
|
+
onConfirm: () => {
|
|
192
|
+
Y(), t(d);
|
|
193
|
+
}
|
|
194
|
+
}) : t(d);
|
|
195
|
+
}, [H, V, Y, t, d]), j = ie(async () => {
|
|
196
|
+
const m = N.filter((T) => T.key.trim() !== "").map((T) => ({
|
|
197
|
+
name: T.key.trim(),
|
|
198
|
+
isSecret: T.isSecret,
|
|
199
|
+
isMandatory: T.isMandatory ?? !1,
|
|
200
|
+
defaultValue: T.defaultValue?.trim() || null
|
|
201
|
+
}));
|
|
202
|
+
await R({
|
|
203
|
+
params: {
|
|
204
|
+
orgName: i,
|
|
205
|
+
projName: l,
|
|
206
|
+
agentName: a
|
|
207
|
+
},
|
|
208
|
+
body: {
|
|
209
|
+
kindName: a ?? "",
|
|
210
|
+
kindDisplayName: S.trim() || void 0,
|
|
211
|
+
kindDescription: x.trim() || void 0,
|
|
212
|
+
kindLabels: Object.keys(C).length > 0 ? C : void 0,
|
|
213
|
+
version: b.trim(),
|
|
214
|
+
buildName: L,
|
|
215
|
+
configSchema: m
|
|
216
|
+
}
|
|
217
|
+
}), Y(), t(d);
|
|
218
|
+
}, [i, l, a, b, L, S, x, C, N, R, Y, t, d]), {
|
|
219
|
+
data: E,
|
|
220
|
+
isLoading: F
|
|
221
|
+
} = Ze({
|
|
222
|
+
orgName: i,
|
|
223
|
+
projName: l,
|
|
224
|
+
agentName: a
|
|
225
|
+
}), Q = O(() => (E?.builds ?? []).filter((m) => m.status === "Completed" || m.status === "Succeeded"), [E]), q = O(() => (u ?? []).slice().sort((m, T) => new Date(T.createdAt).getTime() - new Date(m.createdAt).getTime()), [u]), de = O(() => q[0]?.version, [q]), k = (m) => {
|
|
226
|
+
t(B(M.children.org.children.projects.children.agents.children.publish.children.versionDetails.path, {
|
|
227
|
+
orgId: i ?? "",
|
|
228
|
+
projectId: l ?? "",
|
|
229
|
+
agentId: a ?? "",
|
|
230
|
+
versionId: m
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
233
|
+
return /* @__PURE__ */ o(me, { children: [
|
|
234
|
+
/* @__PURE__ */ e(ne, { title: "Publish", description: "Manage and publish versions of this Agent Kind to the catalog.", disableIcon: !0, actions: /* @__PURE__ */ e(G, { variant: "contained", component: xe, to: c, startIcon: /* @__PURE__ */ e(le, {}), color: "primary", children: "Create Version" }), children: /* @__PURE__ */ e(r.Container, { children: s ? /* @__PURE__ */ o(U, { sx: {
|
|
235
|
+
m: 2
|
|
236
|
+
}, children: [
|
|
237
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
238
|
+
mb: 1
|
|
239
|
+
} }),
|
|
240
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
241
|
+
mb: 1
|
|
242
|
+
} }),
|
|
243
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
244
|
+
mb: 1
|
|
245
|
+
} }),
|
|
246
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48 })
|
|
247
|
+
] }) : q.length === 0 ? /* @__PURE__ */ e(r.EmptyState, { illustration: /* @__PURE__ */ e(Se, { size: 64 }), title: "No versions published yet", description: "Publish a build as a version to make this Agent Kind available in the catalog." }) : /* @__PURE__ */ o(r, { children: [
|
|
248
|
+
/* @__PURE__ */ e(r.Head, { children: /* @__PURE__ */ o(r.Row, { children: [
|
|
249
|
+
/* @__PURE__ */ e(r.Cell, { width: "20%", children: "Version" }),
|
|
250
|
+
/* @__PURE__ */ e(r.Cell, { width: "18%", children: "Release Date" }),
|
|
251
|
+
/* @__PURE__ */ e(r.Cell, { children: "Build Name" })
|
|
252
|
+
] }) }),
|
|
253
|
+
/* @__PURE__ */ e(r.Body, { children: q.map((m) => /* @__PURE__ */ o(r.Row, { hover: !0, clickable: !0, onClick: () => k(m.version), children: [
|
|
254
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ o(v, { variant: "body2", fontWeight: 600, children: [
|
|
255
|
+
m.version,
|
|
256
|
+
m.version === de && /* @__PURE__ */ e(Ie, { label: "Latest", size: "small", color: "primary", sx: {
|
|
257
|
+
ml: 1,
|
|
258
|
+
height: 18,
|
|
259
|
+
fontSize: "0.65rem"
|
|
260
|
+
} })
|
|
261
|
+
] }) }),
|
|
262
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: new Date(m.createdAt).toLocaleDateString(void 0, {
|
|
263
|
+
year: "numeric",
|
|
264
|
+
month: "short",
|
|
265
|
+
day: "numeric"
|
|
266
|
+
}) }) }),
|
|
267
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: m.buildName ?? "—" }) })
|
|
268
|
+
] }, m.version)) })
|
|
269
|
+
] }) }) }),
|
|
270
|
+
/* @__PURE__ */ o(Ke, { open: f, onClose: h, minWidth: 700, maxWidth: 700, children: [
|
|
271
|
+
/* @__PURE__ */ e(Pe, { title: "Create New Version", icon: /* @__PURE__ */ e(le, { size: 24 }), onClose: h }),
|
|
272
|
+
/* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ o(I.Stack, { spacing: 3, children: [
|
|
273
|
+
!g && /* @__PURE__ */ o(I.Section, { children: [
|
|
274
|
+
/* @__PURE__ */ e(I.Subheader, { children: "Kind Details" }),
|
|
275
|
+
/* @__PURE__ */ o(I.Stack, { spacing: 2, children: [
|
|
276
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Display Name", name: "kindDisplayName", children: /* @__PURE__ */ e(J, { id: "kindDisplayName", placeholder: "e.g. My Agent Kind", value: S, onChange: (m) => A(m.target.value), fullWidth: !0, size: "small" }) }),
|
|
277
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Description", name: "kindDescription", children: /* @__PURE__ */ e(J, { id: "kindDescription", placeholder: "Describe this Agent Kind", value: x, onChange: (m) => y(m.target.value), fullWidth: !0, size: "small", multiline: !0, rows: 2 }) }),
|
|
278
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Labels (optional)", name: "kindLabels", children: /* @__PURE__ */ e(Re, { hideTitle: !0, description: "Attach key/value labels to organize and filter kinds.", value: C, onChange: D }) })
|
|
279
|
+
] })
|
|
280
|
+
] }),
|
|
281
|
+
/* @__PURE__ */ o(I.Section, { children: [
|
|
282
|
+
/* @__PURE__ */ e(I.Subheader, { children: "Version Details" }),
|
|
283
|
+
/* @__PURE__ */ o(I.Stack, { spacing: 2, children: [
|
|
284
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Version Name", name: "versionName", children: /* @__PURE__ */ e(J, { id: "versionName", placeholder: "e.g. 1.2.0", value: b, onChange: (m) => P(m.target.value), fullWidth: !0, size: "small" }) }),
|
|
285
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Build", name: "selectedBuildName", children: /* @__PURE__ */ o(we, { id: "selectedBuildName", fullWidth: !0, size: "small", displayEmpty: !0, value: L, onChange: (m) => w(m.target.value), disabled: F, renderValue: (m) => {
|
|
286
|
+
if (!m) return /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: "Select a build" });
|
|
287
|
+
const T = Q.find(($e) => $e.buildName === m);
|
|
288
|
+
return T ? T.buildName : m;
|
|
289
|
+
}, endAdornment: F ? /* @__PURE__ */ e(He, { size: 16, sx: {
|
|
290
|
+
mr: 3
|
|
291
|
+
} }) : void 0, children: [
|
|
292
|
+
Q.length === 0 && !F && /* @__PURE__ */ e(ee, { disabled: !0, value: "", children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: "No succeeded builds available" }) }),
|
|
293
|
+
Q.map((m) => /* @__PURE__ */ e(ee, { value: m.buildName, children: /* @__PURE__ */ o(U, { children: [
|
|
294
|
+
/* @__PURE__ */ e(v, { variant: "body2", fontWeight: 500, children: m.buildName }),
|
|
295
|
+
/* @__PURE__ */ o(v, { variant: "caption", color: "text.secondary", children: [
|
|
296
|
+
m.buildParameters.branch,
|
|
297
|
+
m.buildParameters.commitId ? ` · ${m.buildParameters.commitId.slice(0, 7)}` : "",
|
|
298
|
+
" · ",
|
|
299
|
+
new Date(m.startedAt).toLocaleDateString(void 0, {
|
|
300
|
+
year: "numeric",
|
|
301
|
+
month: "short",
|
|
302
|
+
day: "numeric"
|
|
303
|
+
})
|
|
304
|
+
] })
|
|
305
|
+
] }) }, m.buildName))
|
|
306
|
+
] }) })
|
|
307
|
+
] })
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ o(I.Section, { children: [
|
|
310
|
+
/* @__PURE__ */ e(I.Subheader, { children: "Runtime Configuration" }),
|
|
311
|
+
/* @__PURE__ */ e(Me, { rows: N, onChange: K })
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ o(U, { display: "flex", justifyContent: "flex-end", gap: 1, children: [
|
|
314
|
+
/* @__PURE__ */ e(G, { variant: "outlined", color: "inherit", onClick: h, disabled: z, children: "Cancel" }),
|
|
315
|
+
/* @__PURE__ */ e(G, { variant: "contained", color: "primary", onClick: j, disabled: z || !b.trim() || !L, children: z ? "Creating..." : "Create Version" })
|
|
316
|
+
] })
|
|
317
|
+
] }) })
|
|
318
|
+
] })
|
|
319
|
+
] });
|
|
320
|
+
}, se = (t, n) => {
|
|
321
|
+
if (t === n)
|
|
322
|
+
return !0;
|
|
323
|
+
if (t === null || n === null || typeof t != "object" || typeof n != "object")
|
|
324
|
+
return !1;
|
|
325
|
+
if (Array.isArray(t) && Array.isArray(n))
|
|
326
|
+
return t.length !== n.length ? !1 : t.every((s, p) => se(s, n[p]));
|
|
327
|
+
if (Array.isArray(t) || Array.isArray(n))
|
|
328
|
+
return !1;
|
|
329
|
+
const i = t, l = n, a = Object.keys(i), u = Object.keys(l);
|
|
330
|
+
return a.length !== u.length ? !1 : a.every((s) => se(i[s], l[s]));
|
|
331
|
+
}, Ne = () => {
|
|
332
|
+
const t = ue(), n = Ae(), {
|
|
333
|
+
orgId: i,
|
|
334
|
+
projectId: l,
|
|
335
|
+
agentId: a,
|
|
336
|
+
versionId: u
|
|
337
|
+
} = te(), s = B(M.children.org.children.projects.children.agents.children.publish.children.versionDetails.path, {
|
|
338
|
+
orgId: i ?? "",
|
|
339
|
+
projectId: l ?? "",
|
|
340
|
+
agentId: a ?? "",
|
|
341
|
+
versionId: u ?? ""
|
|
342
|
+
}), p = B(M.children.org.children.projects.children.agents.children.publish.path, {
|
|
343
|
+
orgId: i ?? "",
|
|
344
|
+
projectId: l ?? "",
|
|
345
|
+
agentId: a ?? ""
|
|
346
|
+
}), g = n.pathname.endsWith("/edit"), {
|
|
347
|
+
data: d
|
|
348
|
+
} = ge({
|
|
349
|
+
orgName: i,
|
|
350
|
+
kindName: a
|
|
351
|
+
}), {
|
|
352
|
+
data: c,
|
|
353
|
+
isLoading: f
|
|
354
|
+
} = ze({
|
|
355
|
+
orgName: i,
|
|
356
|
+
kindName: a,
|
|
357
|
+
versionTag: u
|
|
358
|
+
}), {
|
|
359
|
+
data: b,
|
|
360
|
+
isLoading: P
|
|
361
|
+
} = We({
|
|
362
|
+
orgName: i,
|
|
363
|
+
projName: c?.sourceProjectName,
|
|
364
|
+
agentName: c?.sourceAgentName,
|
|
365
|
+
buildName: c?.buildName
|
|
366
|
+
}), L = O(() => Be(b?.inputInterface?.schema?.content), [b]), w = O(() => c ? new Date(c.createdAt).toLocaleDateString("en-US", {
|
|
367
|
+
year: "numeric",
|
|
368
|
+
month: "long",
|
|
369
|
+
day: "numeric"
|
|
370
|
+
}) : void 0, [c]), [S, A] = $(""), [x, y] = $(""), [C, D] = $({});
|
|
371
|
+
ce(() => {
|
|
372
|
+
d && (A(d.displayName), y(d.description ?? ""), D(d.labels ?? {}));
|
|
373
|
+
}, [d]);
|
|
374
|
+
const [N, K] = $([]);
|
|
375
|
+
ce(() => {
|
|
376
|
+
c && K(c.configSchema.map((k) => ({
|
|
377
|
+
...ae({
|
|
378
|
+
key: k.name,
|
|
379
|
+
isSecret: k.isSecret,
|
|
380
|
+
isMandatory: k.isMandatory,
|
|
381
|
+
defaultValue: k.defaultValue ?? ""
|
|
382
|
+
})
|
|
383
|
+
})));
|
|
384
|
+
}, [c]);
|
|
385
|
+
const V = O(() => c?.configSchema.map((k) => ({
|
|
386
|
+
...ae({
|
|
387
|
+
key: k.name,
|
|
388
|
+
defaultValue: k.defaultValue ?? ""
|
|
389
|
+
})
|
|
390
|
+
})) ?? [], [c]), R = d?.displayName ?? "", z = d?.description ?? "", H = !se(
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
392
|
+
N.map(({
|
|
393
|
+
id: k,
|
|
394
|
+
...m
|
|
395
|
+
}) => m),
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
397
|
+
V.map(({
|
|
398
|
+
id: k,
|
|
399
|
+
...m
|
|
400
|
+
}) => m)
|
|
401
|
+
), Y = O(() => d?.labels ?? {}, [d]), h = !se(C, Y), j = S !== R || x !== z || H || h, {
|
|
402
|
+
mutateAsync: E,
|
|
403
|
+
isPending: F
|
|
404
|
+
} = Je(), {
|
|
405
|
+
addConfirmation: Q
|
|
406
|
+
} = je(), q = ie(() => {
|
|
407
|
+
j ? Q({
|
|
408
|
+
title: "Discard Changes?",
|
|
409
|
+
description: "You have unsaved changes. Are you sure you want to close without saving?",
|
|
410
|
+
confirmButtonText: "Discard",
|
|
411
|
+
confirmButtonColor: "error",
|
|
412
|
+
onConfirm: () => {
|
|
413
|
+
A(R), y(z), D(Y), K(V.map((k) => ({
|
|
414
|
+
...k
|
|
415
|
+
}))), t(s);
|
|
416
|
+
}
|
|
417
|
+
}) : t(s);
|
|
418
|
+
}, [j, Q, R, z, Y, V, t, s]), de = ie(async () => {
|
|
419
|
+
a && i && (await E({
|
|
420
|
+
params: {
|
|
421
|
+
orgName: i,
|
|
422
|
+
kindName: a
|
|
423
|
+
},
|
|
424
|
+
body: {
|
|
425
|
+
displayName: S.trim(),
|
|
426
|
+
description: x.trim() || void 0,
|
|
427
|
+
labels: C
|
|
428
|
+
}
|
|
429
|
+
}), t(s));
|
|
430
|
+
}, [i, a, S, x, C, E, t, s]);
|
|
431
|
+
return /* @__PURE__ */ o(me, { children: [
|
|
432
|
+
/* @__PURE__ */ e(ne, { title: `${S || a} ${u}`, description: c ? `Build Id: ${c.buildName ?? "—"}` : "", disableIcon: !0, backHref: p, backLabel: "Back to Publish", actions: /* @__PURE__ */ e(G, { variant: "outlined", startIcon: /* @__PURE__ */ e(pe, {}), onClick: () => t(s + "/edit"), children: "Edit" }), children: f ? /* @__PURE__ */ o(U, { sx: {
|
|
433
|
+
p: 2
|
|
434
|
+
}, children: [
|
|
435
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 32, sx: {
|
|
436
|
+
mb: 2,
|
|
437
|
+
maxWidth: 320
|
|
438
|
+
} }),
|
|
439
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
440
|
+
mb: 1
|
|
441
|
+
} }),
|
|
442
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
443
|
+
mb: 1
|
|
444
|
+
} }),
|
|
445
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48 })
|
|
446
|
+
] }) : c ? /* @__PURE__ */ o(_, { spacing: 3, children: [
|
|
447
|
+
/* @__PURE__ */ o(_, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", children: [
|
|
448
|
+
c.agentSubType && /* @__PURE__ */ e(Ie, { label: c.agentSubType, size: "small", variant: "outlined" }),
|
|
449
|
+
w && /* @__PURE__ */ o(v, { variant: "body2", color: "text.secondary", children: [
|
|
450
|
+
"Published on ",
|
|
451
|
+
w
|
|
452
|
+
] })
|
|
453
|
+
] }),
|
|
454
|
+
/* @__PURE__ */ e(re, {}),
|
|
455
|
+
/* @__PURE__ */ o(_, { spacing: 1.5, children: [
|
|
456
|
+
/* @__PURE__ */ e(v, { variant: "subtitle1", fontWeight: 600, children: "Configuration Schema" }),
|
|
457
|
+
c.configSchema.length > 0 ? /* @__PURE__ */ e(r.Container, { children: /* @__PURE__ */ o(r, { children: [
|
|
458
|
+
/* @__PURE__ */ e(r.Head, { children: /* @__PURE__ */ o(r.Row, { children: [
|
|
459
|
+
/* @__PURE__ */ e(r.Cell, { width: "25%", children: "Name" }),
|
|
460
|
+
/* @__PURE__ */ e(r.Cell, { width: "30%", children: "Description" }),
|
|
461
|
+
/* @__PURE__ */ e(r.Cell, { width: "15%", children: "Mandatory" }),
|
|
462
|
+
/* @__PURE__ */ e(r.Cell, { width: "15%", children: "Secret" }),
|
|
463
|
+
/* @__PURE__ */ e(r.Cell, { width: "15%", children: "Default Value" })
|
|
464
|
+
] }) }),
|
|
465
|
+
/* @__PURE__ */ e(r.Body, { children: c.configSchema.map((k) => /* @__PURE__ */ o(r.Row, { children: [
|
|
466
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", fontWeight: 500, children: k.name }) }),
|
|
467
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: k.description ?? "—" }) }),
|
|
468
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: k.isMandatory ? "Yes" : "No" }) }),
|
|
469
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: k.isSecret ? "Yes" : "No" }) }),
|
|
470
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: k.defaultValue ?? "—" }) })
|
|
471
|
+
] }, k.name)) })
|
|
472
|
+
] }) }) : /* @__PURE__ */ e(Z, { severity: "info", children: "No configuration schema defined for this version." })
|
|
473
|
+
] }),
|
|
474
|
+
/* @__PURE__ */ e(re, {}),
|
|
475
|
+
/* @__PURE__ */ o(_, { spacing: 1.5, children: [
|
|
476
|
+
/* @__PURE__ */ e(v, { variant: "subtitle1", fontWeight: 600, children: "API Specification" }),
|
|
477
|
+
P ? /* @__PURE__ */ e(W, { variant: "rounded", height: 300 }) : L ? /* @__PURE__ */ e(Ee, { spec: L, docExpansion: "list", hideInfoSection: !0, hideServers: !0, hideAuthorizeButton: !0 }) : /* @__PURE__ */ e(Z, { severity: "info", children: "No API specification available for this version." })
|
|
478
|
+
] })
|
|
479
|
+
] }) : /* @__PURE__ */ e(Z, { severity: "error", children: "Version not found." }) }),
|
|
480
|
+
/* @__PURE__ */ o(Ke, { open: g, onClose: q, minWidth: 700, maxWidth: 700, children: [
|
|
481
|
+
/* @__PURE__ */ e(Pe, { title: "Edit Agent Kind", icon: /* @__PURE__ */ e(pe, { size: 24 }), onClose: q }),
|
|
482
|
+
/* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ o(I.Stack, { spacing: 3, children: [
|
|
483
|
+
/* @__PURE__ */ o(I.Section, { children: [
|
|
484
|
+
/* @__PURE__ */ e(I.Subheader, { children: "Kind Details" }),
|
|
485
|
+
/* @__PURE__ */ o(I.Stack, { spacing: 2, children: [
|
|
486
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Display Name", name: "displayName", children: /* @__PURE__ */ e(J, { id: "displayName", value: S, onChange: (k) => A(k.target.value), fullWidth: !0, size: "small" }) }),
|
|
487
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Description", name: "description", children: /* @__PURE__ */ e(J, { id: "description", value: x, onChange: (k) => y(k.target.value), fullWidth: !0, size: "small", multiline: !0, rows: 3 }) }),
|
|
488
|
+
/* @__PURE__ */ e(I.ElementWrapper, { label: "Labels (optional)", name: "labels", children: /* @__PURE__ */ e(Re, { hideTitle: !0, description: "Attach key/value labels to organize and filter kinds.", value: C, onChange: D, disabled: F }) })
|
|
489
|
+
] })
|
|
490
|
+
] }),
|
|
491
|
+
N.length > 0 && /* @__PURE__ */ o(I.Section, { children: [
|
|
492
|
+
/* @__PURE__ */ e(I.Subheader, { children: "Configuration Schema" }),
|
|
493
|
+
/* @__PURE__ */ e(Me, { rows: N, onChange: K, readonlyKey: !0 })
|
|
494
|
+
] }),
|
|
495
|
+
/* @__PURE__ */ o(U, { display: "flex", justifyContent: "flex-end", gap: 1, children: [
|
|
496
|
+
/* @__PURE__ */ e(G, { variant: "outlined", color: "inherit", onClick: q, disabled: F, children: "Cancel" }),
|
|
497
|
+
/* @__PURE__ */ e(G, { variant: "contained", color: "primary", onClick: de, disabled: F || !S.trim(), children: F ? "Saving..." : "Save Changes" })
|
|
498
|
+
] })
|
|
499
|
+
] }) })
|
|
500
|
+
] })
|
|
501
|
+
] });
|
|
502
|
+
}, ke = () => {
|
|
503
|
+
const t = oe(10), {
|
|
504
|
+
orgId: n,
|
|
505
|
+
projectId: i,
|
|
506
|
+
agentId: l
|
|
507
|
+
} = te();
|
|
508
|
+
let a;
|
|
509
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ e(X, { index: !0, element: /* @__PURE__ */ e(he, {}) }), t[0] = a) : a = t[0];
|
|
510
|
+
let u;
|
|
511
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ e(X, { path: "create-new-version", element: /* @__PURE__ */ e(he, {}) }), t[1] = u) : u = t[1];
|
|
512
|
+
let s;
|
|
513
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ e(X, { path: "version-details/:versionId", element: /* @__PURE__ */ e(Ne, {}) }), t[2] = s) : s = t[2];
|
|
514
|
+
let p;
|
|
515
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ e(X, { path: "version-details/:versionId/edit", element: /* @__PURE__ */ e(Ne, {}) }), t[3] = p) : p = t[3];
|
|
516
|
+
const g = n ?? "", d = i ?? "", c = l ?? "";
|
|
517
|
+
let f;
|
|
518
|
+
t[4] !== g || t[5] !== d || t[6] !== c ? (f = B(M.children.org.children.projects.children.agents.children.publish.path, {
|
|
519
|
+
orgId: g,
|
|
520
|
+
projectId: d,
|
|
521
|
+
agentId: c
|
|
522
|
+
}), t[4] = g, t[5] = d, t[6] = c, t[7] = f) : f = t[7];
|
|
523
|
+
let b;
|
|
524
|
+
return t[8] !== f ? (b = /* @__PURE__ */ o(De, { children: [
|
|
525
|
+
a,
|
|
526
|
+
u,
|
|
527
|
+
s,
|
|
528
|
+
p,
|
|
529
|
+
/* @__PURE__ */ e(X, { path: "*", element: /* @__PURE__ */ e(Le, { to: f }) })
|
|
530
|
+
] }), t[8] = f, t[9] = b) : b = t[9], b;
|
|
531
|
+
}, Te = () => {
|
|
532
|
+
const t = ue(), {
|
|
533
|
+
kindId: n,
|
|
534
|
+
orgId: i
|
|
535
|
+
} = te(), {
|
|
536
|
+
data: l,
|
|
537
|
+
isLoading: a
|
|
538
|
+
} = ge({
|
|
539
|
+
orgName: i,
|
|
540
|
+
kindName: n ?? ""
|
|
541
|
+
}), u = O(() => [...l?.versions ?? []].sort((h, j) => new Date(j.createdAt).getTime() - new Date(h.createdAt).getTime()), [l]), [s, p] = Ge(), g = u[0]?.version ?? "", d = s.get("version") ?? g, c = u.find((h) => h.version === d) ?? u[0], {
|
|
542
|
+
data: f,
|
|
543
|
+
isLoading: b
|
|
544
|
+
} = ze({
|
|
545
|
+
orgName: i ?? "",
|
|
546
|
+
kindName: n ?? "",
|
|
547
|
+
versionTag: d
|
|
548
|
+
}), {
|
|
549
|
+
data: P,
|
|
550
|
+
isLoading: L
|
|
551
|
+
} = We({
|
|
552
|
+
orgName: i ?? "",
|
|
553
|
+
projName: f?.sourceProjectName,
|
|
554
|
+
agentName: f?.sourceAgentName,
|
|
555
|
+
buildName: f?.buildName
|
|
556
|
+
}), {
|
|
557
|
+
data: w,
|
|
558
|
+
isLoading: S
|
|
559
|
+
} = Qe({
|
|
560
|
+
orgName: i ?? "",
|
|
561
|
+
kindName: n ?? ""
|
|
562
|
+
}), {
|
|
563
|
+
data: A,
|
|
564
|
+
isLoading: x
|
|
565
|
+
} = en({
|
|
566
|
+
orgName: i
|
|
567
|
+
}), [y, C] = $(null), D = O(() => Be(P?.inputInterface?.schema?.content), [P]), N = B(M.children.org.children.catalog.path, {
|
|
568
|
+
orgId: i ?? ""
|
|
569
|
+
}), K = O(() => [...A?.projects ?? []].sort((h, j) => (h.displayName || h.name).localeCompare(j.displayName || j.name)), [A]), V = (h) => {
|
|
570
|
+
C(h.currentTarget);
|
|
571
|
+
}, R = () => {
|
|
572
|
+
C(null);
|
|
573
|
+
}, z = (h) => {
|
|
574
|
+
const j = B(M.children.org.children.projects.children.newAgent.children.create.children.catalog.children.withKind.path, {
|
|
575
|
+
orgId: i ?? "",
|
|
576
|
+
projectId: h,
|
|
577
|
+
kindId: n ?? ""
|
|
578
|
+
}), E = d ? `${j}?version=${encodeURIComponent(d)}` : j;
|
|
579
|
+
R(), t(E);
|
|
580
|
+
}, H = u.length > 1 && /* @__PURE__ */ e(we, { size: "small", value: d, onChange: (h) => p((j) => {
|
|
581
|
+
const E = new URLSearchParams(j);
|
|
582
|
+
return E.set("version", h.target.value), E;
|
|
583
|
+
}), sx: {
|
|
584
|
+
minWidth: 120
|
|
585
|
+
}, children: u.map((h) => /* @__PURE__ */ o(ee, { value: h.version, children: [
|
|
586
|
+
"v",
|
|
587
|
+
h.version
|
|
588
|
+
] }, h.version)) });
|
|
589
|
+
if (a)
|
|
590
|
+
return /* @__PURE__ */ e(ne, { title: n ?? "Agent Kind Details", backHref: N, backLabel: "Back to Agent Catalog", disableIcon: !0, children: /* @__PURE__ */ o(U, { sx: {
|
|
591
|
+
p: 2
|
|
592
|
+
}, children: [
|
|
593
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 32, sx: {
|
|
594
|
+
mb: 2,
|
|
595
|
+
maxWidth: 320
|
|
596
|
+
} }),
|
|
597
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
598
|
+
mb: 1
|
|
599
|
+
} }),
|
|
600
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 48, sx: {
|
|
601
|
+
mb: 1
|
|
602
|
+
} }),
|
|
603
|
+
/* @__PURE__ */ e(W, { variant: "rounded", height: 200 })
|
|
604
|
+
] }) });
|
|
605
|
+
if (!l)
|
|
606
|
+
return /* @__PURE__ */ e(ne, { title: "Agent Kind Details", backHref: N, backLabel: "Back to Agent Catalog", disableIcon: !0, children: /* @__PURE__ */ o(Z, { severity: "error", children: [
|
|
607
|
+
'Agent kind "',
|
|
608
|
+
n,
|
|
609
|
+
'" was not found.'
|
|
610
|
+
] }) });
|
|
611
|
+
const Y = c ? `Released on ${new Date(c.createdAt).toLocaleDateString(void 0, {
|
|
612
|
+
year: "numeric",
|
|
613
|
+
month: "long",
|
|
614
|
+
day: "numeric"
|
|
615
|
+
})}` : void 0;
|
|
616
|
+
return /* @__PURE__ */ e(ne, { title: l.displayName, description: Y ?? "View details of this Agent Kind.", backHref: N, backLabel: "Back to Agent Catalog", titleTail: /* @__PURE__ */ o(_, { direction: "row", spacing: 1, alignItems: "center", sx: {
|
|
617
|
+
width: "100%",
|
|
618
|
+
minWidth: 0
|
|
619
|
+
}, children: [
|
|
620
|
+
f?.sourceProjectName && f?.sourceAgentName && /* @__PURE__ */ e(G, { size: "small", startIcon: /* @__PURE__ */ e(fe, { size: 14 }), variant: "outlined", component: xe, to: B(M.children.org.children.projects.children.agents.path, {
|
|
621
|
+
orgId: i,
|
|
622
|
+
projectId: f.sourceProjectName,
|
|
623
|
+
agentId: f.sourceAgentName
|
|
624
|
+
}), target: "_blank", rel: "noopener noreferrer", sx: {
|
|
625
|
+
flexShrink: 0
|
|
626
|
+
}, children: "View Source Agent" }),
|
|
627
|
+
/* @__PURE__ */ e(tn, { labels: l.labels })
|
|
628
|
+
] }), actions: [H || void 0, /* @__PURE__ */ o(Oe.Fragment, { children: [
|
|
629
|
+
/* @__PURE__ */ e(G, { startIcon: /* @__PURE__ */ e(le, {}), variant: "contained", color: "primary", onClick: V, "aria-controls": y ? "add-instance-menu" : void 0, "aria-haspopup": "true", "aria-expanded": !!y, children: "Add Instance" }),
|
|
630
|
+
/* @__PURE__ */ e(Ye, { id: "add-instance-menu", anchorEl: y, open: !!y, onClose: R, anchorOrigin: {
|
|
631
|
+
vertical: "bottom",
|
|
632
|
+
horizontal: "right"
|
|
633
|
+
}, transformOrigin: {
|
|
634
|
+
vertical: "top",
|
|
635
|
+
horizontal: "right"
|
|
636
|
+
}, children: x ? /* @__PURE__ */ e(ee, { disabled: !0, children: "Loading projects..." }) : K.length > 0 ? K.map((h) => /* @__PURE__ */ e(ee, { onClick: () => z(h.name), children: h.displayName || h.name }, h.name)) : /* @__PURE__ */ e(ee, { disabled: !0, children: "No projects found" }) })
|
|
637
|
+
] }, "add-instance-action")], disableIcon: !0, children: /* @__PURE__ */ o(_, { spacing: 3, children: [
|
|
638
|
+
l.description && /* @__PURE__ */ o(U, { children: [
|
|
639
|
+
/* @__PURE__ */ e(v, { variant: "overline", color: "text.secondary", children: "Description" }),
|
|
640
|
+
/* @__PURE__ */ e(v, { variant: "body1", children: l.description })
|
|
641
|
+
] }),
|
|
642
|
+
/* @__PURE__ */ e(re, {}),
|
|
643
|
+
/* @__PURE__ */ o(_, { spacing: 1.5, children: [
|
|
644
|
+
/* @__PURE__ */ e(v, { variant: "overline", color: "text.secondary", children: "Configuration Schema" }),
|
|
645
|
+
c && c.configSchema.length > 0 ? /* @__PURE__ */ e(r.Container, { children: /* @__PURE__ */ o(r, { children: [
|
|
646
|
+
/* @__PURE__ */ e(r.Head, { children: /* @__PURE__ */ o(r.Row, { children: [
|
|
647
|
+
/* @__PURE__ */ e(r.Cell, { width: "25%", children: "Name" }),
|
|
648
|
+
/* @__PURE__ */ e(r.Cell, { width: "35%", children: "Description" }),
|
|
649
|
+
/* @__PURE__ */ e(r.Cell, { width: "15%", children: "Mandatory" }),
|
|
650
|
+
/* @__PURE__ */ e(r.Cell, { width: "15%", children: "Secret" }),
|
|
651
|
+
/* @__PURE__ */ e(r.Cell, { width: "10%", children: "Default" })
|
|
652
|
+
] }) }),
|
|
653
|
+
/* @__PURE__ */ e(r.Body, { children: c.configSchema.map((h) => /* @__PURE__ */ o(r.Row, { children: [
|
|
654
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", fontWeight: 500, children: h.name }) }),
|
|
655
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: h.description ?? "—" }) }),
|
|
656
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: h.isMandatory ? "Yes" : "No" }) }),
|
|
657
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: h.isSecret ? "Yes" : "No" }) }),
|
|
658
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: h.defaultValue ?? "—" }) })
|
|
659
|
+
] }, h.name)) })
|
|
660
|
+
] }) }) : /* @__PURE__ */ e(Z, { severity: "info", children: "No configuration schema defined for this version." })
|
|
661
|
+
] }),
|
|
662
|
+
/* @__PURE__ */ e(re, {}),
|
|
663
|
+
/* @__PURE__ */ o(_, { spacing: 1.5, children: [
|
|
664
|
+
/* @__PURE__ */ e(v, { variant: "overline", color: "text.secondary", children: "Usage" }),
|
|
665
|
+
S ? /* @__PURE__ */ e(W, { variant: "rounded", height: 120 }) : w && w.length > 0 ? /* @__PURE__ */ e(r.Container, { children: /* @__PURE__ */ o(r, { children: [
|
|
666
|
+
/* @__PURE__ */ e(r.Head, { children: /* @__PURE__ */ o(r.Row, { children: [
|
|
667
|
+
/* @__PURE__ */ e(r.Cell, { children: "Agent" }),
|
|
668
|
+
/* @__PURE__ */ e(r.Cell, { children: "Project" }),
|
|
669
|
+
/* @__PURE__ */ e(r.Cell, { children: "Created" }),
|
|
670
|
+
/* @__PURE__ */ e(r.Cell, {})
|
|
671
|
+
] }) }),
|
|
672
|
+
/* @__PURE__ */ e(r.Body, { children: w.map((h) => {
|
|
673
|
+
const j = B(M.children.org.children.projects.children.agents.path, {
|
|
674
|
+
orgId: i ?? "",
|
|
675
|
+
projectId: h.projectName,
|
|
676
|
+
agentId: h.name
|
|
677
|
+
});
|
|
678
|
+
return /* @__PURE__ */ o(r.Row, { onClick: () => window.open(j, "_blank", "noopener,noreferrer"), sx: {
|
|
679
|
+
cursor: "pointer",
|
|
680
|
+
"&:hover": {
|
|
681
|
+
bgcolor: "action.hover"
|
|
682
|
+
}
|
|
683
|
+
}, children: [
|
|
684
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", fontWeight: 500, children: h.displayName || h.name }) }),
|
|
685
|
+
/* @__PURE__ */ e(r.Cell, { children: /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: h.projectName }) }),
|
|
686
|
+
/* @__PURE__ */ e(r.Cell, { children: h.createdAt ? /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: an(new Date(h.createdAt), {
|
|
687
|
+
addSuffix: !0
|
|
688
|
+
}) }) : /* @__PURE__ */ e(v, { variant: "body2", color: "text.secondary", children: "—" }) }),
|
|
689
|
+
/* @__PURE__ */ e(r.Cell, { align: "right", children: /* @__PURE__ */ e(G, { size: "small", variant: "text", endIcon: /* @__PURE__ */ e(fe, { size: 16 }), onClick: (E) => {
|
|
690
|
+
E.stopPropagation(), window.open(j, "_blank", "noopener,noreferrer");
|
|
691
|
+
}, children: "View Agent" }) })
|
|
692
|
+
] }, `${h.projectName}/${h.name}`);
|
|
693
|
+
}) })
|
|
694
|
+
] }) }) : /* @__PURE__ */ e(Z, { severity: "info", children: "No agents are currently using this kind." })
|
|
695
|
+
] }),
|
|
696
|
+
/* @__PURE__ */ e(re, {}),
|
|
697
|
+
/* @__PURE__ */ o(_, { spacing: 1.5, children: [
|
|
698
|
+
/* @__PURE__ */ e(v, { variant: "overline", color: "text.secondary", children: "API Specification" }),
|
|
699
|
+
b || L ? /* @__PURE__ */ e(W, { variant: "rounded", height: 300 }) : D ? /* @__PURE__ */ e(Ee, { spec: D, docExpansion: "list", hideInfoSection: !0, hideServers: !0, hideAuthorizeButton: !0 }) : /* @__PURE__ */ e(Z, { severity: "info", children: "No API specification available for this version." })
|
|
700
|
+
] })
|
|
701
|
+
] }) });
|
|
702
|
+
}, mn = () => {
|
|
703
|
+
const t = oe(10), {
|
|
704
|
+
orgId: n
|
|
705
|
+
} = te(), i = n ?? "";
|
|
706
|
+
let l;
|
|
707
|
+
t[0] !== i ? (l = {
|
|
708
|
+
orgName: i
|
|
709
|
+
}, t[0] = i, t[1] = l) : l = t[1];
|
|
710
|
+
const {
|
|
711
|
+
data: a,
|
|
712
|
+
isLoading: u
|
|
713
|
+
} = nn(l);
|
|
714
|
+
let s;
|
|
715
|
+
t[2] !== n ? (s = (c) => B(M.children.org.children.catalog.children.kindDetails.path, {
|
|
716
|
+
orgId: n ?? "",
|
|
717
|
+
kindId: c.name
|
|
718
|
+
}), t[2] = n, t[3] = s) : s = t[3];
|
|
719
|
+
const p = s;
|
|
720
|
+
let g;
|
|
721
|
+
t[4] !== a?.kinds ? (g = a?.kinds ?? [], t[4] = a?.kinds, t[5] = g) : g = t[5];
|
|
722
|
+
let d;
|
|
723
|
+
return t[6] !== p || t[7] !== u || t[8] !== g ? (d = /* @__PURE__ */ e(ne, { title: "Agent Catalog", disableIcon: !0, children: /* @__PURE__ */ e(on, { items: g, isLoading: u, getViewPath: p }) }), t[6] = p, t[7] = u, t[8] = g, t[9] = d) : d = t[9], d;
|
|
724
|
+
}, un = () => {
|
|
725
|
+
const t = oe(6), {
|
|
726
|
+
orgId: n
|
|
727
|
+
} = te();
|
|
728
|
+
let i;
|
|
729
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ e(X, { index: !0, element: /* @__PURE__ */ e(mn, {}) }), t[0] = i) : i = t[0];
|
|
730
|
+
let l;
|
|
731
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ e(X, { path: "kind/:kindId", element: /* @__PURE__ */ e(Te, {}) }), t[1] = l) : l = t[1];
|
|
732
|
+
let a;
|
|
733
|
+
t[2] !== n ? (a = B(M.children.org.children.catalog.path, {
|
|
734
|
+
orgId: n
|
|
735
|
+
}), t[2] = n, t[3] = a) : a = t[3];
|
|
736
|
+
let u;
|
|
737
|
+
return t[4] !== a ? (u = /* @__PURE__ */ o(De, { children: [
|
|
738
|
+
i,
|
|
739
|
+
l,
|
|
740
|
+
/* @__PURE__ */ e(X, { path: "*", element: /* @__PURE__ */ e(Le, { to: a }) })
|
|
741
|
+
] }), t[4] = a, t[5] = u) : u = t[5], u;
|
|
742
|
+
}, xn = {
|
|
743
|
+
title: "Agent Kind",
|
|
744
|
+
description: "Agent Kind pages",
|
|
745
|
+
icon: Se,
|
|
746
|
+
path: "/agent-kind",
|
|
747
|
+
component: ke,
|
|
748
|
+
levels: {
|
|
749
|
+
component: he,
|
|
750
|
+
organization: un,
|
|
751
|
+
kindDetails: Te,
|
|
752
|
+
publishOrganization: ke
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
export {
|
|
756
|
+
Te as CatalogKindDetails,
|
|
757
|
+
on as CatalogKindListing,
|
|
758
|
+
un as CatalogOrganization,
|
|
759
|
+
ke as PublishComponent,
|
|
760
|
+
Ne as PublishVersionDetails,
|
|
761
|
+
he as PublishedList,
|
|
762
|
+
xn as metaData
|
|
763
|
+
};
|