@epam/ai-dial-toolset-editor 1.3.0-dev.79 → 1.3.0-dev.86
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA4C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA4C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAkdhD,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
import { DEFAULT_DEPLOYMENT_VERSION as e, DeploymentCreationFieldErrorCode as t, EntityEditor as n, MetadataField as r, MetadataForm as i, SEMVER_VERSION_PATTERN as a, useMetadataForm as o, validateDeploymentCreationFields as s } from "@epam/ai-dial-builder-form";
|
|
2
2
|
import { ToolsetAuthTypes as c, ToolsetCredentialsLevel as l, WithLogin as u, dialFileToAttachment as d, getApiErrorDetails as f } from "@epam/ai-dial-chat-hooks";
|
|
3
|
-
import { CopyButton as p, ENTITY_DESCRIPTION_MAX_LENGTH as m, ENTITY_NAME_MAX_LENGTH as h, TAG_INPUT_TAG_CLASS_NAME as g, TextRefinementField as _, mergeClasses as v, useCodeCopy as y, useTextRefinement as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { IconBrandOauth as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { ConfirmationPopup as
|
|
3
|
+
import { CopyButton as p, ENTITY_DESCRIPTION_MAX_LENGTH as m, ENTITY_NAME_MAX_LENGTH as h, TAG_INPUT_TAG_CLASS_NAME as g, TextRefinementField as _, mergeClasses as v, useCodeCopy as y, useTextRefinement as ee } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { memo as b, useCallback as x, useEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
5
|
+
import { IconBrandOauth as te, IconKey as ne, IconLockOff as re, IconLogin as E, IconLogout as ie } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import { ConfirmationPopup as ae, ConfirmationPopupVariant as oe, DIAL_ICON_SIZE as k, DIAL_KIT_ICON_STROKE as A, Input as j, NeutralButton as M, PasswordInput as N, Radio as P, RadioGroup as F, SegmentedControl as I, Select as L, TagInput as se } from "@epam/ai-dial-ui-kit";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var ce = {
|
|
10
10
|
metadataSection: "dial-toolset-editor-metadata-section",
|
|
11
11
|
setupSection: "dial-toolset-editor-setup-section"
|
|
12
|
-
},
|
|
12
|
+
}, R = /* @__PURE__ */ function(e) {
|
|
13
13
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
14
|
-
}({}),
|
|
15
|
-
[c.OAuth]:
|
|
16
|
-
[c.ApiKey]:
|
|
17
|
-
[c.None]:
|
|
18
|
-
},
|
|
14
|
+
}({}), z = e, le = { validateVersionPattern: a }, B = {
|
|
15
|
+
[c.OAuth]: te,
|
|
16
|
+
[c.ApiKey]: ne,
|
|
17
|
+
[c.None]: re
|
|
18
|
+
}, ue = () => ({
|
|
19
19
|
authenticationType: c.None,
|
|
20
20
|
withLogin: u.WithoutLogin,
|
|
21
21
|
isLoggedIn: !1
|
|
22
|
-
}),
|
|
22
|
+
}), V = () => ({
|
|
23
23
|
name: "",
|
|
24
|
-
version:
|
|
24
|
+
version: z,
|
|
25
25
|
iconUrl: "",
|
|
26
26
|
description: "",
|
|
27
27
|
topics: [],
|
|
28
28
|
otherLocales: [],
|
|
29
29
|
endpoint: "",
|
|
30
|
-
protocol:
|
|
30
|
+
protocol: R.Http,
|
|
31
31
|
allowedTools: [],
|
|
32
|
-
auth:
|
|
33
|
-
}),
|
|
32
|
+
auth: ue()
|
|
33
|
+
}), H = (e) => {
|
|
34
34
|
if (!/^https?:\/\//.test(e) || e.endsWith(".") || e.endsWith("//")) return !1;
|
|
35
35
|
try {
|
|
36
36
|
return !!new URL(e);
|
|
37
37
|
} catch {
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, U = (e) => H(e.trim()), de = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), W = (e) => {
|
|
41
41
|
let t = e?.trim() ?? "";
|
|
42
|
-
if (!t ||
|
|
42
|
+
if (!t || H(t)) return t;
|
|
43
43
|
let n = [t];
|
|
44
44
|
try {
|
|
45
45
|
let e = decodeURIComponent(t);
|
|
46
46
|
e !== t && n.push(e);
|
|
47
47
|
} catch {}
|
|
48
48
|
for (let e of n) {
|
|
49
|
-
let t =
|
|
50
|
-
if (
|
|
49
|
+
let t = de(e);
|
|
50
|
+
if (H(t)) return t;
|
|
51
51
|
}
|
|
52
52
|
return t;
|
|
53
|
-
},
|
|
53
|
+
}, G = (e) => !e?.trim() || U(e), K = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === c.ApiKey ? e.keyHeader?.trim() ? e.withLogin === u.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === c.OAuth && e.withLogin === u.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && G(e.authorizationEndpoint) && G(e.tokenEndpoint) : !0, fe = (e, t = !1) => Object.keys(s(e, le)).length === 0 && U(e.endpoint) && K(e.auth, t), pe = new Set([
|
|
54
54
|
"name",
|
|
55
55
|
"description",
|
|
56
56
|
"iconUrl",
|
|
57
57
|
"version",
|
|
58
58
|
"topics",
|
|
59
59
|
"otherLocales"
|
|
60
|
-
]),
|
|
60
|
+
]), me = (e) => ({
|
|
61
61
|
name: e.name,
|
|
62
62
|
description: e.description,
|
|
63
63
|
iconUrl: e.iconUrl,
|
|
64
64
|
version: e.version,
|
|
65
65
|
topics: e.topics,
|
|
66
66
|
otherLocales: e.otherLocales
|
|
67
|
-
}),
|
|
67
|
+
}), he = (e) => {
|
|
68
68
|
let t = {}, n = {};
|
|
69
|
-
for (let [r, i] of Object.entries(e)) (
|
|
69
|
+
for (let [r, i] of Object.entries(e)) (pe.has(r) ? t : n)[r] = i;
|
|
70
70
|
return {
|
|
71
71
|
metadata: t,
|
|
72
72
|
setup: n
|
|
73
73
|
};
|
|
74
|
-
},
|
|
74
|
+
}, q = {
|
|
75
75
|
name: {
|
|
76
76
|
label: "Name",
|
|
77
77
|
placeholder: "Enter name"
|
|
@@ -110,18 +110,18 @@ var se = {
|
|
|
110
110
|
saveLabel: "Save"
|
|
111
111
|
},
|
|
112
112
|
ariaLabel: "General"
|
|
113
|
-
},
|
|
114
|
-
let h =
|
|
113
|
+
}, ge = ({ form: e, errors: t, bucket: n, FileManagerModal: r, resolveIconUrl: a, allowedMimeTypes: o, maxFileSizeBytes: s, availableLocaleOptions: c, onChange: l, onNameBlur: u, onVersionBlur: f, renderDescription: p, labels: m }) => {
|
|
114
|
+
let h = x((e) => {
|
|
115
115
|
let [t] = e.files;
|
|
116
116
|
return (t ? d(t, n, { resolvePreviewUrl: a }) : null)?.url;
|
|
117
117
|
}, [n, a]);
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ D(i, {
|
|
119
119
|
values: e,
|
|
120
120
|
errors: t,
|
|
121
121
|
onChange: l,
|
|
122
122
|
onNameBlur: u,
|
|
123
123
|
onVersionBlur: f,
|
|
124
|
-
avatarPicker:
|
|
124
|
+
avatarPicker: C(() => ({
|
|
125
125
|
bucket: n,
|
|
126
126
|
FileManagerModal: r,
|
|
127
127
|
resolveIconUrl: a,
|
|
@@ -138,43 +138,43 @@ var se = {
|
|
|
138
138
|
]),
|
|
139
139
|
availableLocaleOptions: c,
|
|
140
140
|
renderDescription: p,
|
|
141
|
-
labels:
|
|
142
|
-
form: m?.form ??
|
|
141
|
+
labels: C(() => ({
|
|
142
|
+
form: m?.form ?? q,
|
|
143
143
|
avatarPicker: m?.avatarPicker
|
|
144
144
|
}), [m?.form, m?.avatarPicker])
|
|
145
145
|
});
|
|
146
|
-
},
|
|
146
|
+
}, J = /* @__PURE__ */ function(e) {
|
|
147
147
|
return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
|
|
148
|
-
}({}),
|
|
149
|
-
let [v, y] =
|
|
150
|
-
|
|
148
|
+
}({}), _e = (e) => e === c.None ? u.WithoutLogin : u.WithLogin, Y = (e, t) => e === c.None ? t?.typeNone ?? "Open access" : e === c.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", ve = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: s, onNotifySuccess: d, onNotifyError: p, onAuthChange: m, onEnsureSaved: h, labels: _ }) => {
|
|
149
|
+
let [v, y] = T(!1), [ee, b] = T(!1), x = e.isLoggedIn || n || v, S = U(a) && K(e, i) && !x, C = (t) => {
|
|
150
|
+
x || t === e.authenticationType || m({
|
|
151
151
|
authenticationType: t,
|
|
152
|
-
withLogin:
|
|
152
|
+
withLogin: _e(t)
|
|
153
153
|
});
|
|
154
|
-
},
|
|
154
|
+
}, w = (e) => {
|
|
155
155
|
m({ withLogin: e });
|
|
156
|
-
},
|
|
156
|
+
}, te = (e) => {
|
|
157
157
|
switch (e.auth != null && m(e.auth), e.status) {
|
|
158
|
-
case
|
|
158
|
+
case J.Success:
|
|
159
159
|
m({ isLoggedIn: !0 }), d(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
160
160
|
return;
|
|
161
|
-
case
|
|
161
|
+
case J.PopupBlocked:
|
|
162
162
|
p(_?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
|
|
163
163
|
return;
|
|
164
|
-
case
|
|
164
|
+
case J.InvalidConfig:
|
|
165
165
|
p(_?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
|
|
166
166
|
return;
|
|
167
|
-
case
|
|
167
|
+
case J.Failed:
|
|
168
168
|
p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
|
|
169
169
|
return;
|
|
170
|
-
case
|
|
170
|
+
case J.Cancelled: return;
|
|
171
171
|
}
|
|
172
|
-
},
|
|
173
|
-
if (!
|
|
172
|
+
}, ne = async () => {
|
|
173
|
+
if (!S) return;
|
|
174
174
|
if (e.authenticationType === c.OAuth) {
|
|
175
175
|
y(!0);
|
|
176
176
|
try {
|
|
177
|
-
|
|
177
|
+
te(await s({
|
|
178
178
|
auth: e,
|
|
179
179
|
ensureSaved: h
|
|
180
180
|
}));
|
|
@@ -201,7 +201,7 @@ var se = {
|
|
|
201
201
|
y(!1);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, re = async () => {
|
|
205
205
|
y(!0);
|
|
206
206
|
try {
|
|
207
207
|
let t = {
|
|
@@ -209,103 +209,103 @@ var se = {
|
|
|
209
209
|
credentialsLevel: l.User,
|
|
210
210
|
authenticationType: e.authenticationType
|
|
211
211
|
};
|
|
212
|
-
await o.logout(r, t), m({ isLoggedIn: !1 }),
|
|
212
|
+
await o.logout(r, t), m({ isLoggedIn: !1 }), b(!1), d(_?.logoutSuccessMessage ?? "Successfully logged out.");
|
|
213
213
|
} catch (e) {
|
|
214
214
|
let { traceId: t } = await f(e);
|
|
215
215
|
p(_?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
|
|
216
216
|
} finally {
|
|
217
217
|
y(!1);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, F = () => e.isLoggedIn ? /* @__PURE__ */ D("div", {
|
|
220
220
|
className: "flex",
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ D(M, {
|
|
222
222
|
label: _?.logOutLabel ?? "Log out",
|
|
223
|
-
iconBefore: /* @__PURE__ */
|
|
224
|
-
size:
|
|
225
|
-
stroke:
|
|
223
|
+
iconBefore: /* @__PURE__ */ D(ie, {
|
|
224
|
+
size: k.MD,
|
|
225
|
+
stroke: A
|
|
226
226
|
}),
|
|
227
|
-
onClick: () =>
|
|
227
|
+
onClick: () => b(!0),
|
|
228
228
|
disabled: n || v
|
|
229
229
|
})
|
|
230
|
-
}) : /* @__PURE__ */
|
|
230
|
+
}) : /* @__PURE__ */ D("div", {
|
|
231
231
|
className: "flex",
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ D(M, {
|
|
233
233
|
label: _?.logInLabel ?? "Log in",
|
|
234
|
-
iconBefore: /* @__PURE__ */
|
|
235
|
-
size:
|
|
236
|
-
stroke:
|
|
234
|
+
iconBefore: /* @__PURE__ */ D(E, {
|
|
235
|
+
size: k.MD,
|
|
236
|
+
stroke: A
|
|
237
237
|
}),
|
|
238
|
-
onClick:
|
|
239
|
-
disabled: !
|
|
238
|
+
onClick: ne,
|
|
239
|
+
disabled: !S
|
|
240
240
|
})
|
|
241
241
|
});
|
|
242
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ O("section", {
|
|
243
243
|
className: "flex flex-col gap-2",
|
|
244
244
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ D("h3", {
|
|
246
246
|
className: "dial-h3-text",
|
|
247
247
|
children: _?.sectionTitle ?? "Authentication"
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ D(I, {
|
|
250
250
|
"aria-label": _?.sectionTitle ?? "Authentication",
|
|
251
251
|
value: e.authenticationType,
|
|
252
|
-
onChange: (e) =>
|
|
252
|
+
onChange: (e) => C(e),
|
|
253
253
|
segmentClassName: "px-2",
|
|
254
254
|
items: [
|
|
255
255
|
c.None,
|
|
256
256
|
c.OAuth,
|
|
257
257
|
c.ApiKey
|
|
258
258
|
].map((t) => {
|
|
259
|
-
let n =
|
|
259
|
+
let n = B[t];
|
|
260
260
|
return {
|
|
261
261
|
value: t,
|
|
262
|
-
label: /* @__PURE__ */
|
|
262
|
+
label: /* @__PURE__ */ O("div", {
|
|
263
263
|
className: "flex items-center gap-2",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ D(n, {
|
|
265
265
|
className: "shrink-0",
|
|
266
|
-
size:
|
|
267
|
-
stroke:
|
|
266
|
+
size: k.SM,
|
|
267
|
+
stroke: A,
|
|
268
268
|
"aria-hidden": !0
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ D("span", {
|
|
270
270
|
className: "sr-only desktop:not-sr-only",
|
|
271
|
-
children:
|
|
271
|
+
children: Y(t, _)
|
|
272
272
|
})]
|
|
273
273
|
}),
|
|
274
|
-
disabled:
|
|
274
|
+
disabled: x && e.authenticationType !== t
|
|
275
275
|
};
|
|
276
276
|
})
|
|
277
277
|
}),
|
|
278
|
-
e.authenticationType === c.None && /* @__PURE__ */
|
|
278
|
+
e.authenticationType === c.None && /* @__PURE__ */ D("p", {
|
|
279
279
|
className: "dial-small-text pt-2 text-secondary",
|
|
280
280
|
children: _?.openAccessDescription ?? "Open endpoint, no credentials"
|
|
281
281
|
}),
|
|
282
|
-
e.authenticationType === c.OAuth && /* @__PURE__ */
|
|
282
|
+
e.authenticationType === c.OAuth && /* @__PURE__ */ O("div", {
|
|
283
283
|
className: "flex flex-col gap-3 pt-2",
|
|
284
284
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ O("div", {
|
|
286
286
|
className: "flex flex-col gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ D(P, {
|
|
288
288
|
name: "oauth-login-mode",
|
|
289
289
|
id: "oauth-with-login",
|
|
290
290
|
value: u.WithLogin,
|
|
291
291
|
labelProps: { label: _?.withLoginOAuthLabel ?? "Standard login" },
|
|
292
292
|
isSelected: e.withLogin === u.WithLogin,
|
|
293
|
-
disabled:
|
|
294
|
-
onChange:
|
|
295
|
-
}), /* @__PURE__ */
|
|
293
|
+
disabled: x,
|
|
294
|
+
onChange: w
|
|
295
|
+
}), /* @__PURE__ */ D(P, {
|
|
296
296
|
name: "oauth-login-mode",
|
|
297
297
|
id: "oauth-with-config",
|
|
298
298
|
value: u.WithConfig,
|
|
299
299
|
labelProps: { label: _?.withConfigOAuthLabel ?? "Custom login" },
|
|
300
300
|
isSelected: e.withLogin === u.WithConfig,
|
|
301
|
-
disabled:
|
|
302
|
-
onChange:
|
|
301
|
+
disabled: x,
|
|
302
|
+
onChange: w
|
|
303
303
|
})]
|
|
304
304
|
}),
|
|
305
|
-
e.withLogin === u.WithConfig && /* @__PURE__ */
|
|
305
|
+
e.withLogin === u.WithConfig && /* @__PURE__ */ O("div", {
|
|
306
306
|
className: "flex flex-col gap-3",
|
|
307
307
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ D(j, {
|
|
309
309
|
id: "toolset-client-id",
|
|
310
310
|
value: e.clientId ?? "",
|
|
311
311
|
onChange: (e) => m({ clientId: e ?? "" }),
|
|
@@ -316,9 +316,9 @@ var se = {
|
|
|
316
316
|
placeholder: _?.clientIdPlaceholder ?? "Enter client ID",
|
|
317
317
|
error: t.clientId || void 0,
|
|
318
318
|
invalid: !!t.clientId,
|
|
319
|
-
disabled:
|
|
319
|
+
disabled: x
|
|
320
320
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ D(N, {
|
|
322
322
|
id: "toolset-client-secret",
|
|
323
323
|
value: e.clientSecret ?? "",
|
|
324
324
|
onChange: (e) => m({ clientSecret: e ?? "" }),
|
|
@@ -331,9 +331,9 @@ var se = {
|
|
|
331
331
|
hidePasswordLabel: _?.hideClientSecretLabel ?? "Hide client secret",
|
|
332
332
|
error: t.clientSecret || void 0,
|
|
333
333
|
invalid: !!t.clientSecret,
|
|
334
|
-
disabled:
|
|
334
|
+
disabled: x
|
|
335
335
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ D(j, {
|
|
337
337
|
id: "toolset-authorization-endpoint",
|
|
338
338
|
value: e.authorizationEndpoint ?? "",
|
|
339
339
|
onChange: (e) => m({ authorizationEndpoint: e ?? "" }),
|
|
@@ -341,9 +341,9 @@ var se = {
|
|
|
341
341
|
placeholder: _?.authorizationEndpointPlaceholder ?? "Enter authorization endpoint",
|
|
342
342
|
error: t.authorizationEndpoint || void 0,
|
|
343
343
|
invalid: !!t.authorizationEndpoint,
|
|
344
|
-
disabled:
|
|
344
|
+
disabled: x
|
|
345
345
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ D(j, {
|
|
347
347
|
id: "toolset-token-endpoint",
|
|
348
348
|
value: e.tokenEndpoint ?? "",
|
|
349
349
|
onChange: (e) => m({ tokenEndpoint: e ?? "" }),
|
|
@@ -351,48 +351,48 @@ var se = {
|
|
|
351
351
|
placeholder: _?.tokenEndpointPlaceholder ?? "Enter token endpoint",
|
|
352
352
|
error: t.tokenEndpoint || void 0,
|
|
353
353
|
invalid: !!t.tokenEndpoint,
|
|
354
|
-
disabled:
|
|
354
|
+
disabled: x
|
|
355
355
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ D(se, {
|
|
357
357
|
id: "toolset-scopes",
|
|
358
358
|
labelProps: { label: _?.scopesLabel ?? "Scopes" },
|
|
359
359
|
placeholder: _?.scopesPlaceholder ?? "Enter scopes",
|
|
360
360
|
value: e.scopes ?? [],
|
|
361
361
|
onChange: (e) => m({ scopes: e }),
|
|
362
|
-
disabled:
|
|
362
|
+
disabled: x,
|
|
363
363
|
tagClassName: g
|
|
364
364
|
})
|
|
365
365
|
]
|
|
366
366
|
}),
|
|
367
|
-
|
|
367
|
+
F()
|
|
368
368
|
]
|
|
369
369
|
}),
|
|
370
|
-
e.authenticationType === c.ApiKey && /* @__PURE__ */
|
|
370
|
+
e.authenticationType === c.ApiKey && /* @__PURE__ */ O("div", {
|
|
371
371
|
className: "flex flex-col gap-3 pt-2",
|
|
372
372
|
children: [
|
|
373
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ O("div", {
|
|
374
374
|
className: "flex flex-col gap-2",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ D(P, {
|
|
376
376
|
name: "apikey-login-mode",
|
|
377
377
|
id: "apikey-with-login",
|
|
378
378
|
value: u.WithLogin,
|
|
379
379
|
labelProps: { label: _?.withLoginLabel ?? "With login" },
|
|
380
380
|
isSelected: e.withLogin === u.WithLogin,
|
|
381
|
-
disabled:
|
|
382
|
-
onChange:
|
|
383
|
-
}), /* @__PURE__ */
|
|
381
|
+
disabled: x,
|
|
382
|
+
onChange: w
|
|
383
|
+
}), /* @__PURE__ */ D(P, {
|
|
384
384
|
name: "apikey-login-mode",
|
|
385
385
|
id: "apikey-without-login",
|
|
386
386
|
value: u.WithoutLogin,
|
|
387
387
|
labelProps: { label: _?.withoutLoginLabel ?? "Without login" },
|
|
388
388
|
isSelected: e.withLogin === u.WithoutLogin,
|
|
389
|
-
disabled:
|
|
390
|
-
onChange:
|
|
389
|
+
disabled: x,
|
|
390
|
+
onChange: w
|
|
391
391
|
})]
|
|
392
392
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ O("div", {
|
|
394
394
|
className: "flex flex-col gap-3",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ D(j, {
|
|
396
396
|
id: "toolset-key-header",
|
|
397
397
|
value: e.keyHeader ?? "",
|
|
398
398
|
onChange: (e) => m({ keyHeader: e ?? "" }),
|
|
@@ -403,8 +403,8 @@ var se = {
|
|
|
403
403
|
placeholder: _?.keyHeaderPlaceholder ?? "Enter API key parameter name",
|
|
404
404
|
error: t.keyHeader || void 0,
|
|
405
405
|
invalid: !!t.keyHeader,
|
|
406
|
-
disabled:
|
|
407
|
-
}), e.withLogin === u.WithLogin && /* @__PURE__ */
|
|
406
|
+
disabled: x
|
|
407
|
+
}), e.withLogin === u.WithLogin && /* @__PURE__ */ D(N, {
|
|
408
408
|
id: "toolset-api-key",
|
|
409
409
|
value: e.apiKey ?? "",
|
|
410
410
|
onChange: (e) => m({ apiKey: e ?? "" }),
|
|
@@ -417,49 +417,49 @@ var se = {
|
|
|
417
417
|
hidePasswordLabel: _?.hideApiKeyLabel ?? "Hide API key",
|
|
418
418
|
error: t.apiKey || void 0,
|
|
419
419
|
invalid: !!t.apiKey,
|
|
420
|
-
disabled:
|
|
420
|
+
disabled: x
|
|
421
421
|
})]
|
|
422
422
|
}),
|
|
423
|
-
e.withLogin !== u.WithoutLogin &&
|
|
423
|
+
e.withLogin !== u.WithoutLogin && F()
|
|
424
424
|
]
|
|
425
425
|
}),
|
|
426
|
-
|
|
427
|
-
open:
|
|
426
|
+
ee && /* @__PURE__ */ D(ae, {
|
|
427
|
+
open: ee,
|
|
428
428
|
header: _?.logoutConfirmTitle ?? "Log out?",
|
|
429
429
|
description: _?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
|
|
430
430
|
confirmLabel: _?.logOutLabel ?? "Log out",
|
|
431
431
|
cancelLabel: _?.cancelLabel ?? "Cancel",
|
|
432
|
-
variant:
|
|
432
|
+
variant: oe.Danger,
|
|
433
433
|
isLoading: v,
|
|
434
434
|
disableConfirmButton: v,
|
|
435
|
-
onConfirm:
|
|
436
|
-
onCancel: () =>
|
|
437
|
-
onClose: () =>
|
|
435
|
+
onConfirm: re,
|
|
436
|
+
onCancel: () => b(!1),
|
|
437
|
+
onClose: () => b(!1)
|
|
438
438
|
})
|
|
439
439
|
]
|
|
440
440
|
});
|
|
441
|
-
},
|
|
441
|
+
}, X = b(({ url: e, className: t, labels: n }) => {
|
|
442
442
|
let { isCopied: r, copy: i } = y(e), a = n?.copiedLabel ?? "Copied!";
|
|
443
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ O("div", {
|
|
444
444
|
className: v("flex flex-col gap-3", t),
|
|
445
445
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ O("div", {
|
|
447
447
|
className: "flex flex-col gap-1",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ D("p", {
|
|
449
449
|
className: "dial-body-semi-text text-start text-primary",
|
|
450
450
|
children: n?.title ?? "Connect toolset"
|
|
451
|
-
}), /* @__PURE__ */
|
|
451
|
+
}), /* @__PURE__ */ D("p", {
|
|
452
452
|
className: "dial-small-text text-start text-secondary",
|
|
453
453
|
children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
|
|
454
454
|
})]
|
|
455
455
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ D("div", { children: /* @__PURE__ */ D(p, {
|
|
457
457
|
copiedLabel: a,
|
|
458
458
|
copyLabel: n?.copyLabel ?? "Copy URL",
|
|
459
459
|
isCopied: r,
|
|
460
460
|
onClick: i
|
|
461
461
|
}) }),
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ D("span", {
|
|
463
463
|
role: "status",
|
|
464
464
|
"aria-live": "polite",
|
|
465
465
|
className: "sr-only",
|
|
@@ -467,16 +467,16 @@ var se = {
|
|
|
467
467
|
})
|
|
468
468
|
]
|
|
469
469
|
});
|
|
470
|
-
}),
|
|
471
|
-
let [h, _] =
|
|
472
|
-
value:
|
|
470
|
+
}), ye = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: f, onEnsureSaved: p, labels: m }) => {
|
|
471
|
+
let [h, _] = T(null), v = !!a && !!r, y = C(() => [{
|
|
472
|
+
value: R.Http,
|
|
473
473
|
label: "HTTP"
|
|
474
474
|
}, {
|
|
475
|
-
value:
|
|
475
|
+
value: R.Sse,
|
|
476
476
|
label: "SSE"
|
|
477
477
|
}], []);
|
|
478
|
-
return
|
|
479
|
-
if (!r || !o || !
|
|
478
|
+
return S(() => {
|
|
479
|
+
if (!r || !o || !K(e.auth, i)) {
|
|
480
480
|
_(null);
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
@@ -497,10 +497,10 @@ var se = {
|
|
|
497
497
|
e.auth,
|
|
498
498
|
e.endpoint,
|
|
499
499
|
o
|
|
500
|
-
]), /* @__PURE__ */
|
|
500
|
+
]), /* @__PURE__ */ O("div", {
|
|
501
501
|
className: "flex max-w-[1060px] flex-col gap-4",
|
|
502
502
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ D(j, {
|
|
504
504
|
id: "toolset-endpoint",
|
|
505
505
|
value: e.endpoint,
|
|
506
506
|
onChange: (e) => d({ endpoint: e ?? "" }),
|
|
@@ -513,7 +513,7 @@ var se = {
|
|
|
513
513
|
error: t.endpoint || void 0,
|
|
514
514
|
invalid: !!t.endpoint
|
|
515
515
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ D(F, {
|
|
517
517
|
labelProps: {
|
|
518
518
|
label: m?.protocolLabel ?? "Protocol",
|
|
519
519
|
required: !0
|
|
@@ -525,7 +525,7 @@ var se = {
|
|
|
525
525
|
d({ protocol: e });
|
|
526
526
|
}
|
|
527
527
|
}),
|
|
528
|
-
h ? /* @__PURE__ */
|
|
528
|
+
h ? /* @__PURE__ */ D(L, {
|
|
529
529
|
id: "toolset-allowed-tools",
|
|
530
530
|
multiple: !0,
|
|
531
531
|
searchable: !0,
|
|
@@ -538,7 +538,7 @@ var se = {
|
|
|
538
538
|
})),
|
|
539
539
|
value: e.allowedTools,
|
|
540
540
|
onChange: (e) => d({ allowedTools: e })
|
|
541
|
-
}) : /* @__PURE__ */
|
|
541
|
+
}) : /* @__PURE__ */ D(se, {
|
|
542
542
|
id: "toolset-allowed-tools",
|
|
543
543
|
labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
|
|
544
544
|
placeholder: m?.allowedToolsPlaceholder ?? "Add tools, comma separated",
|
|
@@ -546,7 +546,7 @@ var se = {
|
|
|
546
546
|
onChange: (e) => d({ allowedTools: e }),
|
|
547
547
|
tagClassName: g
|
|
548
548
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ D(ve, {
|
|
550
550
|
auth: e.auth,
|
|
551
551
|
errors: t,
|
|
552
552
|
isSaving: n,
|
|
@@ -561,59 +561,63 @@ var se = {
|
|
|
561
561
|
onEnsureSaved: p,
|
|
562
562
|
labels: m?.auth
|
|
563
563
|
}),
|
|
564
|
-
v && /* @__PURE__ */
|
|
564
|
+
v && /* @__PURE__ */ D(X, {
|
|
565
565
|
url: a ?? "",
|
|
566
566
|
labels: m?.connect,
|
|
567
567
|
className: "border-t border-tertiary pt-4"
|
|
568
568
|
})
|
|
569
569
|
]
|
|
570
570
|
});
|
|
571
|
-
},
|
|
571
|
+
}, be = [
|
|
572
572
|
"keyHeader",
|
|
573
573
|
"apiKey",
|
|
574
574
|
"clientId",
|
|
575
575
|
"clientSecret",
|
|
576
576
|
"authorizationEndpoint",
|
|
577
577
|
"tokenEndpoint"
|
|
578
|
-
],
|
|
578
|
+
], xe = ["endpoint", ...be], Z = new Set(xe), Se = (e) => {
|
|
579
579
|
let t = {};
|
|
580
|
-
for (let n of Object.keys(e))
|
|
580
|
+
for (let n of Object.keys(e)) Z.has(n) && (t[n] = !0);
|
|
581
581
|
return t;
|
|
582
|
-
},
|
|
583
|
-
let N = !!i, [P, F] =
|
|
582
|
+
}, Q = ({ initialForm: e, toolsetId: i, onPersist: a, onPostSaveLogin: s, onToolsetsChanged: l, onSaveSuccess: d, onSaveComplete: p, onBack: g, onDirtyChange: v, buildMcpUrl: y, listToolNames: b, authActions: te, onOAuthLogin: ne, onNotifySuccess: re, onNotifyError: E, bucket: ie, FileManagerModal: O, resolveIconUrl: ae, allowedMimeTypes: oe, maxFileSizeBytes: k, availableLocaleOptions: A, onRefineDescription: j, labels: M }) => {
|
|
583
|
+
let N = !!i, [P, F] = T(""), I = i || P, [L, se] = T({
|
|
584
584
|
initialForm: e,
|
|
585
585
|
key: 0
|
|
586
|
-
});
|
|
587
|
-
L.initialForm !== e &&
|
|
586
|
+
}), [R, z] = T(e);
|
|
587
|
+
L.initialForm !== e && (se({
|
|
588
588
|
initialForm: e,
|
|
589
589
|
key: L.key + 1
|
|
590
|
-
});
|
|
591
|
-
let { values:
|
|
592
|
-
initialValues:
|
|
593
|
-
validationOptions:
|
|
590
|
+
}), z(e));
|
|
591
|
+
let { values: B, setValues: ue, markTouched: V, visibleErrorCodes: H, attemptSubmit: de } = o({
|
|
592
|
+
initialValues: C(() => me(e), [e]),
|
|
593
|
+
validationOptions: le,
|
|
594
594
|
reseedKey: L.key
|
|
595
|
-
}), [
|
|
596
|
-
...
|
|
597
|
-
...
|
|
598
|
-
}), [
|
|
599
|
-
|
|
600
|
-
|
|
595
|
+
}), [W, G] = T(e), K = C(() => ({
|
|
596
|
+
...W,
|
|
597
|
+
...B
|
|
598
|
+
}), [W, B]), pe = C(() => JSON.stringify(K) !== JSON.stringify(R), [K, R]);
|
|
599
|
+
S(() => {
|
|
600
|
+
v?.(pe);
|
|
601
|
+
}, [pe, v]);
|
|
602
|
+
let [q, J] = T(!1), [_e, Y] = T({}), [ve, X] = T({}), Z = w(null);
|
|
603
|
+
S(() => {
|
|
604
|
+
G(e), Z.current = e, Y({}), X({}), F("");
|
|
601
605
|
}, [e]);
|
|
602
|
-
let Q =
|
|
603
|
-
let { metadata: t, setup: n } =
|
|
604
|
-
Object.keys(t).length > 0 && (
|
|
606
|
+
let Q = x((e) => {
|
|
607
|
+
let { metadata: t, setup: n } = he(e);
|
|
608
|
+
Object.keys(t).length > 0 && (ue(t), "name" in t && V(r.Name), "version" in t && V(r.Version)), Object.keys(n).length !== 0 && (G((e) => ({
|
|
605
609
|
...e,
|
|
606
610
|
...n
|
|
607
611
|
})), X((e) => ({
|
|
608
612
|
...e,
|
|
609
|
-
...
|
|
613
|
+
...Se(n)
|
|
610
614
|
})), Y((e) => {
|
|
611
615
|
let t = { ...e };
|
|
612
616
|
for (let e of Object.keys(n)) delete t[e];
|
|
613
617
|
return t;
|
|
614
618
|
}));
|
|
615
|
-
}, [
|
|
616
|
-
|
|
619
|
+
}, [ue, V]), Ce = x((e) => {
|
|
620
|
+
G((t) => ({
|
|
617
621
|
...t,
|
|
618
622
|
auth: {
|
|
619
623
|
...t.auth,
|
|
@@ -621,55 +625,56 @@ var se = {
|
|
|
621
625
|
}
|
|
622
626
|
})), X((t) => ({
|
|
623
627
|
...t,
|
|
624
|
-
...
|
|
628
|
+
...Se(e)
|
|
625
629
|
})), Y((t) => {
|
|
626
630
|
let n = { ...t };
|
|
627
|
-
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of
|
|
631
|
+
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of be) delete n[e];
|
|
628
632
|
else for (let t of Object.keys(e)) delete n[t];
|
|
629
633
|
return n;
|
|
630
634
|
}), "isLoggedIn" in e && l();
|
|
631
|
-
}, [l]),
|
|
632
|
-
if (I && Z.current != null && JSON.stringify(Z.current) === JSON.stringify(
|
|
633
|
-
|
|
635
|
+
}, [l]), we = x(async () => {
|
|
636
|
+
if (I && Z.current != null && JSON.stringify(Z.current) === JSON.stringify(K)) return I;
|
|
637
|
+
J(!0);
|
|
634
638
|
try {
|
|
635
|
-
let e = await a(
|
|
636
|
-
return e ? (I || F(e), Z.current =
|
|
639
|
+
let e = await a(K, I);
|
|
640
|
+
return e ? (I || F(e), Z.current = K, z(K), v?.(!1), await l(), e) : null;
|
|
637
641
|
} catch {
|
|
638
642
|
return null;
|
|
639
643
|
} finally {
|
|
640
|
-
|
|
644
|
+
J(!1);
|
|
641
645
|
}
|
|
642
646
|
}, [
|
|
643
|
-
|
|
647
|
+
K,
|
|
644
648
|
I,
|
|
645
649
|
a,
|
|
646
|
-
l
|
|
647
|
-
|
|
650
|
+
l,
|
|
651
|
+
v
|
|
652
|
+
]), Te = x(async () => await we() ?? !1, [we]), $ = x((e) => {
|
|
648
653
|
let t = M?.validation, n = {};
|
|
649
|
-
return e.endpoint.trim() ?
|
|
650
|
-
}, [M, N]),
|
|
651
|
-
let e =
|
|
654
|
+
return e.endpoint.trim() ? U(e.endpoint) || (n.endpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.endpoint = t?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === c.ApiKey && (e.auth.keyHeader?.trim() || (n.keyHeader = t?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === u.WithLogin && !e.auth.apiKey?.trim() && (n.apiKey = t?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === c.OAuth && e.auth.withLogin === u.WithConfig && (e.auth.clientId?.trim() || (n.clientId = t?.clientIdRequired ?? "Client ID is required"), !N && !e.auth.clientSecret?.trim() && (n.clientSecret = t?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() && !U(e.auth.authorizationEndpoint) && (n.authorizationEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL"), e.auth.tokenEndpoint?.trim() && !U(e.auth.tokenEndpoint) && (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL"))), n;
|
|
655
|
+
}, [M, N]), Ee = x(async () => {
|
|
656
|
+
let e = de(), t = $(K);
|
|
652
657
|
if (!e || Object.keys(t).length > 0) {
|
|
653
658
|
Y(t);
|
|
654
659
|
return;
|
|
655
660
|
}
|
|
656
|
-
Y({}),
|
|
661
|
+
Y({}), J(!0);
|
|
657
662
|
try {
|
|
658
|
-
let e = await a(
|
|
663
|
+
let e = await a(K, I);
|
|
659
664
|
if (!e) return;
|
|
660
|
-
await l(), d(
|
|
665
|
+
z(K), await l(), d(K);
|
|
661
666
|
try {
|
|
662
|
-
await s(e,
|
|
667
|
+
await s(e, K.auth), p();
|
|
663
668
|
} catch (e) {
|
|
664
669
|
let { traceId: t } = await f(e);
|
|
665
|
-
|
|
670
|
+
E(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
666
671
|
}
|
|
667
672
|
} catch {} finally {
|
|
668
|
-
|
|
673
|
+
J(!1);
|
|
669
674
|
}
|
|
670
675
|
}, [
|
|
671
|
-
|
|
672
|
-
|
|
676
|
+
de,
|
|
677
|
+
K,
|
|
673
678
|
$,
|
|
674
679
|
I,
|
|
675
680
|
a,
|
|
@@ -677,48 +682,48 @@ var se = {
|
|
|
677
682
|
d,
|
|
678
683
|
p,
|
|
679
684
|
s,
|
|
680
|
-
|
|
685
|
+
E,
|
|
681
686
|
M
|
|
682
|
-
]),
|
|
683
|
-
value:
|
|
687
|
+
]), De = ee({
|
|
688
|
+
value: B.description,
|
|
684
689
|
onChange: (e) => Q({ description: e }),
|
|
685
690
|
onRefine: j,
|
|
686
|
-
disabled:
|
|
691
|
+
disabled: q,
|
|
687
692
|
resetKey: L.key
|
|
688
|
-
}),
|
|
693
|
+
}), Oe = j ? (e, t) => /* @__PURE__ */ D(_, {
|
|
689
694
|
isEnabled: !0,
|
|
690
695
|
fieldId: t,
|
|
691
696
|
label: M?.general?.form?.description.label ?? "Description",
|
|
692
697
|
labels: M?.refinement,
|
|
693
|
-
refinement:
|
|
694
|
-
disabled:
|
|
698
|
+
refinement: De,
|
|
699
|
+
disabled: De.isPending || q,
|
|
695
700
|
children: e
|
|
696
|
-
}) : void 0,
|
|
697
|
-
let e = M?.validation, n = $(
|
|
698
|
-
for (let e of
|
|
699
|
-
if (!
|
|
701
|
+
}) : void 0, ke = C(() => !fe(K, N), [K, N]), Ae = C(() => {
|
|
702
|
+
let e = M?.validation, n = $(K), r = { ..._e };
|
|
703
|
+
for (let e of xe) {
|
|
704
|
+
if (!ve[e]) continue;
|
|
700
705
|
let t = n[e];
|
|
701
706
|
t ? r[e] = t : delete r[e];
|
|
702
707
|
}
|
|
703
|
-
return
|
|
708
|
+
return H.name === t.Required ? r.name = e?.nameRequired ?? "Name is required" : H.name === t.TooLong ? r.name = e?.nameTooLong ?? `Use ${h} characters or fewer.` : H.name === t.ControlCharacters && (r.name = e?.nameControlCharacters ?? "Remove line breaks, tabs and other control characters."), H.description === t.TooLong && (r.description = e?.descriptionTooLong ?? `Use ${m} characters or fewer.`), H.version === t.InvalidFormat && (r.version = e?.versionInvalid ?? "Version must follow semantic versioning (e.g., 1.0.0)"), r;
|
|
704
709
|
}, [
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
710
|
+
ve,
|
|
711
|
+
_e,
|
|
712
|
+
K,
|
|
708
713
|
M,
|
|
709
|
-
|
|
714
|
+
H,
|
|
710
715
|
$
|
|
711
|
-
]),
|
|
712
|
-
return /* @__PURE__ */
|
|
716
|
+
]), je = y && I ? y(I) : void 0;
|
|
717
|
+
return /* @__PURE__ */ D(n, {
|
|
713
718
|
title: N ? M?.layout?.editTitle ?? "Edit toolset" : M?.layout?.createTitle ?? "Create toolset",
|
|
714
719
|
onBack: g,
|
|
715
720
|
onCancel: g,
|
|
716
|
-
onSubmit:
|
|
721
|
+
onSubmit: Ee,
|
|
717
722
|
submitLabel: N ? M?.layout?.saveLabel ?? "Save" : M?.layout?.createLabel ?? "Create",
|
|
718
|
-
isSubmitting:
|
|
719
|
-
isSubmitDisabled:
|
|
720
|
-
metadataSectionClassName:
|
|
721
|
-
setupSectionClassName:
|
|
723
|
+
isSubmitting: q,
|
|
724
|
+
isSubmitDisabled: ke || De.isPending,
|
|
725
|
+
metadataSectionClassName: ce.metadataSection,
|
|
726
|
+
setupSectionClassName: ce.setupSection,
|
|
722
727
|
labels: {
|
|
723
728
|
backAriaLabel: M?.layout?.backAriaLabel ?? "Back to catalog",
|
|
724
729
|
savingStatusLabel: M?.layout?.savingStatusLabel ?? "Saving",
|
|
@@ -726,37 +731,37 @@ var se = {
|
|
|
726
731
|
setupTitle: M?.layout?.setupSectionTitle ?? "Setup",
|
|
727
732
|
cancelLabel: M?.layout?.cancelLabel ?? "Cancel"
|
|
728
733
|
},
|
|
729
|
-
metadata: /* @__PURE__ */
|
|
730
|
-
form:
|
|
731
|
-
errors:
|
|
732
|
-
bucket:
|
|
733
|
-
FileManagerModal:
|
|
734
|
-
resolveIconUrl:
|
|
735
|
-
allowedMimeTypes:
|
|
736
|
-
maxFileSizeBytes:
|
|
734
|
+
metadata: /* @__PURE__ */ D(ge, {
|
|
735
|
+
form: K,
|
|
736
|
+
errors: Ae,
|
|
737
|
+
bucket: ie,
|
|
738
|
+
FileManagerModal: O,
|
|
739
|
+
resolveIconUrl: ae,
|
|
740
|
+
allowedMimeTypes: oe,
|
|
741
|
+
maxFileSizeBytes: k,
|
|
737
742
|
availableLocaleOptions: A,
|
|
738
743
|
onChange: Q,
|
|
739
|
-
renderDescription:
|
|
744
|
+
renderDescription: Oe,
|
|
740
745
|
labels: M?.general
|
|
741
746
|
}),
|
|
742
|
-
setup: /* @__PURE__ */
|
|
743
|
-
form:
|
|
744
|
-
errors:
|
|
745
|
-
isSaving:
|
|
747
|
+
setup: /* @__PURE__ */ D(ye, {
|
|
748
|
+
form: K,
|
|
749
|
+
errors: Ae,
|
|
750
|
+
isSaving: q,
|
|
746
751
|
toolsetId: I,
|
|
747
752
|
isEditMode: N,
|
|
748
|
-
connectUrl:
|
|
749
|
-
listToolNames:
|
|
750
|
-
authActions:
|
|
751
|
-
onOAuthLogin:
|
|
752
|
-
onNotifySuccess:
|
|
753
|
-
onNotifyError:
|
|
753
|
+
connectUrl: je,
|
|
754
|
+
listToolNames: b,
|
|
755
|
+
authActions: te,
|
|
756
|
+
onOAuthLogin: ne,
|
|
757
|
+
onNotifySuccess: re,
|
|
758
|
+
onNotifyError: E,
|
|
754
759
|
onChange: Q,
|
|
755
|
-
onAuthChange:
|
|
756
|
-
onEnsureSaved:
|
|
760
|
+
onAuthChange: Ce,
|
|
761
|
+
onEnsureSaved: Te,
|
|
757
762
|
labels: M?.settings
|
|
758
763
|
})
|
|
759
764
|
});
|
|
760
765
|
};
|
|
761
766
|
//#endregion
|
|
762
|
-
export {
|
|
767
|
+
export { B as AUTH_TYPE_ICONS, z as DEFAULT_TOOLSET_VERSION, ge as GeneralForm, ce as TOOLSET_EDITOR_CLASS, Q as ToolsetEditor, J as ToolsetOAuthLoginStatus, R as ToolsetTransportType, V as getDefaultToolsetForm, K as isToolsetAuthValid, fe as isToolsetFormValid, U as isValidEndpointUrl, W as normalizeReturnedEndpointUrl };
|
|
@@ -105,6 +105,8 @@ export interface ToolsetEditorProps {
|
|
|
105
105
|
onSaveComplete: () => void;
|
|
106
106
|
/** Called for the Cancel button and the header back action. */
|
|
107
107
|
onBack: () => void;
|
|
108
|
+
/** Called with whether the form differs from the values it was seeded with or last persisted, on mount and whenever that changes; `false` right after a Log In draft persist. */
|
|
109
|
+
onDirtyChange?: (isDirty: boolean) => void;
|
|
108
110
|
/**
|
|
109
111
|
* Builds the MCP endpoint URL shown in the Connect section for a toolset
|
|
110
112
|
* id. Omit when the host has no external core URL configured — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,k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E,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,gFAAgF;IAChF,WAAW,EAAE,kBAAkB,CAAC;IAChC,mEAAmE;IACnE,YAAY,EAAE,wBAAwB,CAAC;IACvC,2DAA2D;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gFAAgF;IAChF,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,gBAAgB,EAAE,aAAa,CAAC,iCAAiC,CAAC,CAAC;IACnE,sEAAsE;IACtE,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,4CAA4C;IAC5C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,sBAAsB,EAAE,kCAAkC,EAAE,CAAC;IAC7D,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,sBAAsB,CAAC;IAC7C,wEAAwE;IACxE,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-toolset-editor",
|
|
3
3
|
"description": "Host-agnostic form for authoring and editing a DIAL MCP toolset",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.86",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-builder-form": "1.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-builder-form": "1.3.0-dev.86"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-hooks": "1.3.0-dev.
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
24
|
+
"@epam/ai-dial-chat-hooks": "1.3.0-dev.86",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.86",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.11",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|