@epam/ai-dial-toolset-editor 1.3.0-dev.204 → 1.3.0-dev.210
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/components/ToolsetEditor/ToolsetEditor.d.ts.map +1 -1
- package/constants/toolsets.d.ts +0 -3
- package/constants/toolsets.d.ts.map +1 -1
- package/index.js +247 -247
- package/models/toolset-editor-props.d.ts +1 -1
- package/models/toolset-editor-props.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/toolsets.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAgD5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAodhD,CAAC"}
|
package/constants/toolsets.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DeploymentCreationFormValidationOptions } from '../../../builder-form/src/index.ts';
|
|
2
1
|
import { ToolsetAuthTypes } from '../../../chat-hooks/src/index.ts';
|
|
3
2
|
import { TablerIcon } from '@tabler/icons-react';
|
|
4
3
|
export declare enum ToolsetTransportType {
|
|
@@ -9,8 +8,6 @@ export declare enum ToolsetTransportType {
|
|
|
9
8
|
}
|
|
10
9
|
/** Default display version seeded into a new toolset form; the shared deployment default. */
|
|
11
10
|
export declare const DEFAULT_TOOLSET_VERSION = "1.0.0";
|
|
12
|
-
/** Metadata checks for a toolset: the version must be SemVer 2.0.0, as DIAL Admin requires. */
|
|
13
|
-
export declare const TOOLSET_METADATA_VALIDATION_OPTIONS: DeploymentCreationFormValidationOptions;
|
|
14
11
|
/** Icon shown for each toolset authentication-type segment; labels arrive via the auth labels. */
|
|
15
12
|
export declare const AUTH_TYPE_ICONS: Record<ToolsetAuthTypes, TablerIcon>;
|
|
16
13
|
//# sourceMappingURL=toolsets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/constants/toolsets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/constants/toolsets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,oBAAoB;IAC9B,qCAAqC;IACrC,IAAI,SAAS;IACb,wCAAwC;IACxC,GAAG,QAAQ;CACZ;AAED,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,UAA6B,CAAC;AAElE,kGAAkG;AAClG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAIhE,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { DEFAULT_DEPLOYMENT_VERSION as e, DeploymentCreationFieldErrorCode as t, EntityEditor as n, MetadataField as r, MetadataForm as i,
|
|
2
|
-
import { ToolsetAuthTypes as
|
|
3
|
-
import { CopyButton as
|
|
4
|
-
import { memo as b, useCallback as x, useEffect as S, useMemo as C, useRef as
|
|
5
|
-
import { IconBrandOauth as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { ConfirmationPopup as ae, ConfirmationPopupVariant as oe, DIAL_ICON_SIZE as
|
|
1
|
+
import { DEFAULT_DEPLOYMENT_VERSION as e, DeploymentCreationFieldErrorCode as t, EntityEditor as n, MetadataField as r, MetadataForm as i, useMetadataForm as a, validateDeploymentCreationFields as o } from "@epam/ai-dial-builder-form";
|
|
2
|
+
import { ToolsetAuthTypes as s, ToolsetCredentialsLevel as c, WithLogin as l, dialFileToAttachment as u, getApiErrorDetails as d } from "@epam/ai-dial-chat-hooks";
|
|
3
|
+
import { CopyButton as f, ENTITY_DESCRIPTION_MAX_LENGTH as p, ENTITY_NAME_MAX_LENGTH as m, TAG_INPUT_TAG_CLASS_NAME as h, TextRefinementField as g, mergeClasses as _, useCodeCopy as v, useTextRefinement as y } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { memo as b, useCallback as x, useEffect as S, useMemo as C, useRef as ee, useState as w } from "react";
|
|
5
|
+
import { IconBrandOauth as te, IconKey as T, IconLockOff as ne, IconLogin as re, IconLogout as ie } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
7
|
+
import { ConfirmationPopup as ae, ConfirmationPopupVariant as oe, DIAL_ICON_SIZE as O, DIAL_KIT_ICON_STROKE as k, Input as A, NeutralButton as j, PasswordInput as M, Radio as N, RadioGroup as se, SegmentedControl as ce, Select as P, TagInput as F } from "@epam/ai-dial-ui-kit";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var I = {
|
|
10
10
|
metadataSection: "dial-toolset-editor-metadata-section",
|
|
11
11
|
setupSection: "dial-toolset-editor-setup-section"
|
|
12
|
-
},
|
|
12
|
+
}, L = /* @__PURE__ */ function(e) {
|
|
13
13
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
14
|
-
}({}),
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
},
|
|
19
|
-
authenticationType:
|
|
20
|
-
withLogin:
|
|
14
|
+
}({}), R = e, z = {
|
|
15
|
+
[s.OAuth]: te,
|
|
16
|
+
[s.ApiKey]: T,
|
|
17
|
+
[s.None]: ne
|
|
18
|
+
}, le = () => ({
|
|
19
|
+
authenticationType: s.None,
|
|
20
|
+
withLogin: l.WithoutLogin,
|
|
21
21
|
isLoggedIn: !1
|
|
22
|
-
}),
|
|
22
|
+
}), B = () => ({
|
|
23
23
|
name: "",
|
|
24
|
-
version:
|
|
24
|
+
version: R,
|
|
25
25
|
iconUrl: "",
|
|
26
26
|
description: "",
|
|
27
27
|
topics: [],
|
|
28
28
|
otherLocales: [],
|
|
29
29
|
endpoint: "",
|
|
30
|
-
protocol:
|
|
30
|
+
protocol: L.Http,
|
|
31
31
|
allowedTools: [],
|
|
32
|
-
auth:
|
|
32
|
+
auth: le()
|
|
33
33
|
}), V = (e) => {
|
|
34
34
|
if (!/^https?:\/\//.test(e) || e.endsWith(".") || e.endsWith("//")) return !1;
|
|
35
35
|
try {
|
|
@@ -37,7 +37,7 @@ var ce = {
|
|
|
37
37
|
} catch {
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
|
-
}, H = (e) => V(e.trim()), U = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"),
|
|
40
|
+
}, H = (e) => V(e.trim()), U = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), W = (e) => {
|
|
41
41
|
let t = e?.trim() ?? "";
|
|
42
42
|
if (!t || V(t)) return t;
|
|
43
43
|
let n = [t];
|
|
@@ -50,23 +50,23 @@ var ce = {
|
|
|
50
50
|
if (V(t)) return t;
|
|
51
51
|
}
|
|
52
52
|
return t;
|
|
53
|
-
},
|
|
53
|
+
}, G = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === s.ApiKey ? e.keyHeader?.trim() ? e.withLogin === l.WithoutLogin || !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === s.OAuth && e.withLogin === l.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && H(e.authorizationEndpoint ?? "") && H(e.tokenEndpoint ?? "") : !0, ue = (e, t = !1) => Object.keys(o(e, { validateVersionPattern: !0 })).length === 0 && H(e.endpoint) && G(e.auth, t), de = /* @__PURE__ */ new Set([
|
|
54
54
|
"name",
|
|
55
55
|
"description",
|
|
56
56
|
"iconUrl",
|
|
57
57
|
"version",
|
|
58
58
|
"topics",
|
|
59
59
|
"otherLocales"
|
|
60
|
-
]),
|
|
60
|
+
]), fe = (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
|
+
}), pe = (e) => {
|
|
68
68
|
let t = {}, n = {};
|
|
69
|
-
for (let [r, i] of Object.entries(e)) (
|
|
69
|
+
for (let [r, i] of Object.entries(e)) (de.has(r) ? t : n)[r] = i;
|
|
70
70
|
return {
|
|
71
71
|
metadata: t,
|
|
72
72
|
setup: n
|
|
@@ -110,10 +110,10 @@ var ce = {
|
|
|
110
110
|
saveLabel: "Save"
|
|
111
111
|
},
|
|
112
112
|
ariaLabel: "General"
|
|
113
|
-
},
|
|
113
|
+
}, me = ({ form: e, errors: t, bucket: n, FileManagerModal: r, resolveIconUrl: a, allowedMimeTypes: o, maxFileSizeBytes: s, availableLocaleOptions: c, onChange: l, onNameBlur: d, onVersionBlur: f, renderDescription: p, labels: m }) => {
|
|
114
114
|
let h = x((e) => {
|
|
115
115
|
let [t] = e.files;
|
|
116
|
-
return (t ?
|
|
116
|
+
return (t ? u(t, n, { resolvePreviewUrl: a }) : null)?.url;
|
|
117
117
|
}, [n, a]), g = C(() => ({
|
|
118
118
|
bucket: n,
|
|
119
119
|
FileManagerModal: r,
|
|
@@ -132,11 +132,11 @@ var ce = {
|
|
|
132
132
|
form: m?.form ?? K,
|
|
133
133
|
avatarPicker: m?.avatarPicker
|
|
134
134
|
}), [m?.form, m?.avatarPicker]);
|
|
135
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ E(i, {
|
|
136
136
|
values: e,
|
|
137
137
|
errors: t,
|
|
138
138
|
onChange: l,
|
|
139
|
-
onNameBlur:
|
|
139
|
+
onNameBlur: d,
|
|
140
140
|
onVersionBlur: f,
|
|
141
141
|
avatarPicker: g,
|
|
142
142
|
availableLocaleOptions: c,
|
|
@@ -145,18 +145,18 @@ var ce = {
|
|
|
145
145
|
});
|
|
146
146
|
}, q = /* @__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
|
-
}({}), J = "toolset-client-secret-keep-caption", Y = (e) => `******${e}`,
|
|
149
|
-
let [v, y] = w(!1), [
|
|
150
|
-
|
|
148
|
+
}({}), J = "toolset-client-secret-keep-caption", Y = (e) => `******${e}`, X = (e) => e === s.None ? l.WithoutLogin : l.WithLogin, he = (e, t) => e === s.None ? t?.typeNone ?? "Open access" : e === s.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", Z = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: u, onNotifySuccess: f, onNotifyError: p, onAuthChange: m, onEnsureSaved: g, labels: _ }) => {
|
|
149
|
+
let [v, y] = w(!1), [b, x] = w(!1), S = e.isLoggedIn || n || v, C = i && e.clientSecretHint && !e.clientSecret ? e.clientSecretHint : void 0, ee = H(a) && G(e, i) && !S, te = (t) => {
|
|
150
|
+
S || t === e.authenticationType || m({
|
|
151
151
|
authenticationType: t,
|
|
152
|
-
withLogin:
|
|
152
|
+
withLogin: X(t)
|
|
153
153
|
});
|
|
154
154
|
}, T = (e) => {
|
|
155
155
|
m({ withLogin: e });
|
|
156
156
|
}, ne = (e) => {
|
|
157
157
|
switch (e.auth != null && m(e.auth), e.status) {
|
|
158
158
|
case q.Success:
|
|
159
|
-
m({ isLoggedIn: !0 }),
|
|
159
|
+
m({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
160
160
|
return;
|
|
161
161
|
case q.PopupBlocked:
|
|
162
162
|
p(_?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
|
|
@@ -169,143 +169,143 @@ var ce = {
|
|
|
169
169
|
return;
|
|
170
170
|
case q.Cancelled: return;
|
|
171
171
|
}
|
|
172
|
-
},
|
|
173
|
-
if (!
|
|
174
|
-
if (e.authenticationType ===
|
|
172
|
+
}, se = async () => {
|
|
173
|
+
if (!ee) return;
|
|
174
|
+
if (e.authenticationType === s.OAuth) {
|
|
175
175
|
y(!0);
|
|
176
176
|
try {
|
|
177
|
-
ne(await
|
|
177
|
+
ne(await u({
|
|
178
178
|
auth: e,
|
|
179
|
-
ensureSaved:
|
|
179
|
+
ensureSaved: g
|
|
180
180
|
}));
|
|
181
181
|
} finally {
|
|
182
182
|
y(!1);
|
|
183
183
|
}
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
let t = await
|
|
186
|
+
let t = await g();
|
|
187
187
|
if (t) {
|
|
188
188
|
y(!0);
|
|
189
189
|
try {
|
|
190
190
|
let n = {
|
|
191
191
|
url: t,
|
|
192
|
-
credentialsLevel:
|
|
192
|
+
credentialsLevel: c.User,
|
|
193
193
|
authenticationType: e.authenticationType,
|
|
194
194
|
apiKey: e.apiKey?.trim()
|
|
195
195
|
};
|
|
196
|
-
await o.login(t, n), m({ isLoggedIn: !0 }),
|
|
196
|
+
await o.login(t, n), m({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
197
197
|
} catch (e) {
|
|
198
|
-
let { traceId: t } = await
|
|
198
|
+
let { traceId: t } = await d(e);
|
|
199
199
|
p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
200
200
|
} finally {
|
|
201
201
|
y(!1);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, P = async () => {
|
|
205
205
|
y(!0);
|
|
206
206
|
try {
|
|
207
207
|
let t = {
|
|
208
208
|
url: r,
|
|
209
|
-
credentialsLevel:
|
|
209
|
+
credentialsLevel: c.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 }), x(!1), f(_?.logoutSuccessMessage ?? "Successfully logged out.");
|
|
213
213
|
} catch (e) {
|
|
214
|
-
let { traceId: t } = await
|
|
214
|
+
let { traceId: t } = await d(e);
|
|
215
215
|
p(_?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
|
|
216
216
|
} finally {
|
|
217
217
|
y(!1);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, I = () => e.isLoggedIn ? /* @__PURE__ */ E("div", {
|
|
220
220
|
className: "flex",
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ E(j, {
|
|
222
222
|
label: _?.logOutLabel ?? "Log out",
|
|
223
|
-
iconBefore: /* @__PURE__ */
|
|
224
|
-
size:
|
|
225
|
-
stroke:
|
|
223
|
+
iconBefore: /* @__PURE__ */ E(ie, {
|
|
224
|
+
size: O.MD,
|
|
225
|
+
stroke: k
|
|
226
226
|
}),
|
|
227
|
-
onClick: () =>
|
|
227
|
+
onClick: () => x(!0),
|
|
228
228
|
disabled: n || v
|
|
229
229
|
})
|
|
230
|
-
}) : /* @__PURE__ */
|
|
230
|
+
}) : /* @__PURE__ */ E("div", {
|
|
231
231
|
className: "flex",
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ E(j, {
|
|
233
233
|
label: _?.logInLabel ?? "Log in",
|
|
234
|
-
iconBefore: /* @__PURE__ */
|
|
235
|
-
size:
|
|
236
|
-
stroke:
|
|
234
|
+
iconBefore: /* @__PURE__ */ E(re, {
|
|
235
|
+
size: O.MD,
|
|
236
|
+
stroke: k
|
|
237
237
|
}),
|
|
238
|
-
onClick:
|
|
239
|
-
disabled: !
|
|
238
|
+
onClick: se,
|
|
239
|
+
disabled: !ee
|
|
240
240
|
})
|
|
241
241
|
});
|
|
242
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ D("section", {
|
|
243
243
|
className: "flex flex-col gap-2",
|
|
244
244
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ E("h3", {
|
|
246
246
|
className: "dial-h3-text",
|
|
247
247
|
children: _?.sectionTitle ?? "Authentication"
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ E(ce, {
|
|
250
250
|
"aria-label": _?.sectionTitle ?? "Authentication",
|
|
251
251
|
value: e.authenticationType,
|
|
252
252
|
onChange: (e) => te(e),
|
|
253
253
|
segmentClassName: "px-2",
|
|
254
254
|
items: [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
s.None,
|
|
256
|
+
s.OAuth,
|
|
257
|
+
s.ApiKey
|
|
258
258
|
].map((t) => {
|
|
259
|
-
let n =
|
|
259
|
+
let n = z[t];
|
|
260
260
|
return {
|
|
261
261
|
value: t,
|
|
262
|
-
label: /* @__PURE__ */
|
|
262
|
+
label: /* @__PURE__ */ D("div", {
|
|
263
263
|
className: "flex items-center gap-2",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ E(n, {
|
|
265
265
|
className: "shrink-0",
|
|
266
|
-
size:
|
|
267
|
-
stroke:
|
|
266
|
+
size: O.SM,
|
|
267
|
+
stroke: k,
|
|
268
268
|
"aria-hidden": !0
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ E("span", {
|
|
270
270
|
className: "sr-only desktop:not-sr-only",
|
|
271
|
-
children:
|
|
271
|
+
children: he(t, _)
|
|
272
272
|
})]
|
|
273
273
|
}),
|
|
274
|
-
disabled:
|
|
274
|
+
disabled: S && e.authenticationType !== t
|
|
275
275
|
};
|
|
276
276
|
})
|
|
277
277
|
}),
|
|
278
|
-
e.authenticationType ===
|
|
278
|
+
e.authenticationType === s.None && /* @__PURE__ */ E("p", {
|
|
279
279
|
className: "dial-small-text pt-2 text-secondary",
|
|
280
280
|
children: _?.openAccessDescription ?? "Open endpoint, no credentials"
|
|
281
281
|
}),
|
|
282
|
-
e.authenticationType ===
|
|
282
|
+
e.authenticationType === s.OAuth && /* @__PURE__ */ D("div", {
|
|
283
283
|
className: "flex flex-col gap-3 pt-2",
|
|
284
284
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ D("div", {
|
|
286
286
|
className: "flex flex-col gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ E(N, {
|
|
288
288
|
name: "oauth-login-mode",
|
|
289
289
|
id: "oauth-with-login",
|
|
290
|
-
value:
|
|
290
|
+
value: l.WithLogin,
|
|
291
291
|
labelProps: { label: _?.withLoginOAuthLabel ?? "Standard login" },
|
|
292
|
-
isSelected: e.withLogin ===
|
|
293
|
-
disabled:
|
|
292
|
+
isSelected: e.withLogin === l.WithLogin,
|
|
293
|
+
disabled: S,
|
|
294
294
|
onChange: T
|
|
295
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ E(N, {
|
|
296
296
|
name: "oauth-login-mode",
|
|
297
297
|
id: "oauth-with-config",
|
|
298
|
-
value:
|
|
298
|
+
value: l.WithConfig,
|
|
299
299
|
labelProps: { label: _?.withConfigOAuthLabel ?? "Custom login" },
|
|
300
|
-
isSelected: e.withLogin ===
|
|
301
|
-
disabled:
|
|
300
|
+
isSelected: e.withLogin === l.WithConfig,
|
|
301
|
+
disabled: S,
|
|
302
302
|
onChange: T
|
|
303
303
|
})]
|
|
304
304
|
}),
|
|
305
|
-
e.withLogin ===
|
|
305
|
+
e.withLogin === l.WithConfig && /* @__PURE__ */ D("div", {
|
|
306
306
|
className: "flex flex-col gap-3",
|
|
307
307
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ E(A, {
|
|
309
309
|
id: "toolset-client-id",
|
|
310
310
|
value: e.clientId ?? "",
|
|
311
311
|
onChange: (e) => m({ clientId: e ?? "" }),
|
|
@@ -316,11 +316,11 @@ var ce = {
|
|
|
316
316
|
placeholder: _?.clientIdPlaceholder ?? "Enter client ID",
|
|
317
317
|
error: t.clientId || void 0,
|
|
318
318
|
invalid: !!t.clientId,
|
|
319
|
-
disabled:
|
|
319
|
+
disabled: S
|
|
320
320
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ D("div", {
|
|
322
322
|
className: "flex flex-col gap-1",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ E(M, {
|
|
324
324
|
id: "toolset-client-secret",
|
|
325
325
|
value: e.clientSecret ?? "",
|
|
326
326
|
onChange: (e) => m({ clientSecret: e ?? "" }),
|
|
@@ -328,20 +328,20 @@ var ce = {
|
|
|
328
328
|
label: _?.clientSecretLabel ?? "Client secret",
|
|
329
329
|
required: !i
|
|
330
330
|
},
|
|
331
|
-
placeholder:
|
|
332
|
-
"aria-describedby":
|
|
331
|
+
placeholder: C == null ? _?.clientSecretPlaceholder ?? "Enter client secret" : (_?.clientSecretHintPlaceholder ?? Y)(C),
|
|
332
|
+
"aria-describedby": C == null ? void 0 : J,
|
|
333
333
|
showPasswordLabel: _?.showClientSecretLabel ?? "Show client secret",
|
|
334
334
|
hidePasswordLabel: _?.hideClientSecretLabel ?? "Hide client secret",
|
|
335
335
|
error: t.clientSecret || void 0,
|
|
336
336
|
invalid: !!t.clientSecret,
|
|
337
|
-
disabled:
|
|
338
|
-
}),
|
|
337
|
+
disabled: S
|
|
338
|
+
}), C != null && /* @__PURE__ */ E("p", {
|
|
339
339
|
id: J,
|
|
340
340
|
className: "dial-tiny-text text-secondary",
|
|
341
341
|
children: _?.clientSecretKeepCaption ?? "Leave empty to keep the saved secret."
|
|
342
342
|
})]
|
|
343
343
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ E(A, {
|
|
345
345
|
id: "toolset-authorization-endpoint",
|
|
346
346
|
value: e.authorizationEndpoint ?? "",
|
|
347
347
|
onChange: (e) => m({ authorizationEndpoint: e ?? "" }),
|
|
@@ -352,9 +352,9 @@ var ce = {
|
|
|
352
352
|
placeholder: _?.authorizationEndpointPlaceholder ?? "Enter authorization endpoint",
|
|
353
353
|
error: t.authorizationEndpoint || void 0,
|
|
354
354
|
invalid: !!t.authorizationEndpoint,
|
|
355
|
-
disabled:
|
|
355
|
+
disabled: S
|
|
356
356
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ E(A, {
|
|
358
358
|
id: "toolset-token-endpoint",
|
|
359
359
|
value: e.tokenEndpoint ?? "",
|
|
360
360
|
onChange: (e) => m({ tokenEndpoint: e ?? "" }),
|
|
@@ -365,48 +365,48 @@ var ce = {
|
|
|
365
365
|
placeholder: _?.tokenEndpointPlaceholder ?? "Enter token endpoint",
|
|
366
366
|
error: t.tokenEndpoint || void 0,
|
|
367
367
|
invalid: !!t.tokenEndpoint,
|
|
368
|
-
disabled:
|
|
368
|
+
disabled: S
|
|
369
369
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ E(F, {
|
|
371
371
|
id: "toolset-scopes",
|
|
372
372
|
labelProps: { label: _?.scopesLabel ?? "Scopes" },
|
|
373
373
|
placeholder: _?.scopesPlaceholder ?? "Enter scopes",
|
|
374
374
|
value: e.scopes ?? [],
|
|
375
375
|
onChange: (e) => m({ scopes: e }),
|
|
376
|
-
disabled:
|
|
377
|
-
tagClassName:
|
|
376
|
+
disabled: S,
|
|
377
|
+
tagClassName: h
|
|
378
378
|
})
|
|
379
379
|
]
|
|
380
380
|
}),
|
|
381
|
-
|
|
381
|
+
I()
|
|
382
382
|
]
|
|
383
383
|
}),
|
|
384
|
-
e.authenticationType ===
|
|
384
|
+
e.authenticationType === s.ApiKey && /* @__PURE__ */ D("div", {
|
|
385
385
|
className: "flex flex-col gap-3 pt-2",
|
|
386
386
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ D("div", {
|
|
388
388
|
className: "flex flex-col gap-2",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ E(N, {
|
|
390
390
|
name: "apikey-login-mode",
|
|
391
391
|
id: "apikey-with-login",
|
|
392
|
-
value:
|
|
392
|
+
value: l.WithLogin,
|
|
393
393
|
labelProps: { label: _?.withLoginLabel ?? "With login" },
|
|
394
|
-
isSelected: e.withLogin ===
|
|
395
|
-
disabled:
|
|
394
|
+
isSelected: e.withLogin === l.WithLogin,
|
|
395
|
+
disabled: S,
|
|
396
396
|
onChange: T
|
|
397
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ E(N, {
|
|
398
398
|
name: "apikey-login-mode",
|
|
399
399
|
id: "apikey-without-login",
|
|
400
|
-
value:
|
|
400
|
+
value: l.WithoutLogin,
|
|
401
401
|
labelProps: { label: _?.withoutLoginLabel ?? "Without login" },
|
|
402
|
-
isSelected: e.withLogin ===
|
|
403
|
-
disabled:
|
|
402
|
+
isSelected: e.withLogin === l.WithoutLogin,
|
|
403
|
+
disabled: S,
|
|
404
404
|
onChange: T
|
|
405
405
|
})]
|
|
406
406
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ D("div", {
|
|
408
408
|
className: "flex flex-col gap-3",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ E(A, {
|
|
410
410
|
id: "toolset-key-header",
|
|
411
411
|
value: e.keyHeader ?? "",
|
|
412
412
|
onChange: (e) => m({ keyHeader: e ?? "" }),
|
|
@@ -417,8 +417,8 @@ var ce = {
|
|
|
417
417
|
placeholder: _?.keyHeaderPlaceholder ?? "Enter API key parameter name",
|
|
418
418
|
error: t.keyHeader || void 0,
|
|
419
419
|
invalid: !!t.keyHeader,
|
|
420
|
-
disabled:
|
|
421
|
-
}), e.withLogin ===
|
|
420
|
+
disabled: S
|
|
421
|
+
}), e.withLogin === l.WithLogin && /* @__PURE__ */ E(M, {
|
|
422
422
|
id: "toolset-api-key",
|
|
423
423
|
value: e.apiKey ?? "",
|
|
424
424
|
onChange: (e) => m({ apiKey: e ?? "" }),
|
|
@@ -431,14 +431,14 @@ var ce = {
|
|
|
431
431
|
hidePasswordLabel: _?.hideApiKeyLabel ?? "Hide API key",
|
|
432
432
|
error: t.apiKey || void 0,
|
|
433
433
|
invalid: !!t.apiKey,
|
|
434
|
-
disabled:
|
|
434
|
+
disabled: S
|
|
435
435
|
})]
|
|
436
436
|
}),
|
|
437
|
-
e.withLogin !==
|
|
437
|
+
e.withLogin !== l.WithoutLogin && I()
|
|
438
438
|
]
|
|
439
439
|
}),
|
|
440
|
-
|
|
441
|
-
open:
|
|
440
|
+
b && /* @__PURE__ */ E(ae, {
|
|
441
|
+
open: b,
|
|
442
442
|
header: _?.logoutConfirmTitle ?? "Log out?",
|
|
443
443
|
description: _?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
|
|
444
444
|
confirmLabel: _?.logOutLabel ?? "Log out",
|
|
@@ -446,34 +446,34 @@ var ce = {
|
|
|
446
446
|
variant: oe.Danger,
|
|
447
447
|
isLoading: v,
|
|
448
448
|
disableConfirmButton: v,
|
|
449
|
-
onConfirm:
|
|
450
|
-
onCancel: () =>
|
|
451
|
-
onClose: () =>
|
|
449
|
+
onConfirm: P,
|
|
450
|
+
onCancel: () => x(!1),
|
|
451
|
+
onClose: () => x(!1)
|
|
452
452
|
})
|
|
453
453
|
]
|
|
454
454
|
});
|
|
455
|
-
},
|
|
456
|
-
let { isCopied: r, copy: i } =
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
className:
|
|
455
|
+
}, ge = b(({ url: e, className: t, labels: n }) => {
|
|
456
|
+
let { isCopied: r, copy: i } = v(e), a = n?.copiedLabel ?? "Copied!";
|
|
457
|
+
return /* @__PURE__ */ D("div", {
|
|
458
|
+
className: _("flex flex-col gap-3", t),
|
|
459
459
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ D("div", {
|
|
461
461
|
className: "flex flex-col gap-1",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ E("p", {
|
|
463
463
|
className: "dial-body-semi-text text-start text-primary",
|
|
464
464
|
children: n?.title ?? "Connect toolset"
|
|
465
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ E("p", {
|
|
466
466
|
className: "dial-small-text text-start text-secondary",
|
|
467
467
|
children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
|
|
468
468
|
})]
|
|
469
469
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(f, {
|
|
471
471
|
copiedLabel: a,
|
|
472
472
|
copyLabel: n?.copyLabel ?? "Copy URL",
|
|
473
473
|
isCopied: r,
|
|
474
474
|
onClick: i
|
|
475
475
|
}) }),
|
|
476
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ E("span", {
|
|
477
477
|
role: "status",
|
|
478
478
|
"aria-live": "polite",
|
|
479
479
|
className: "sr-only",
|
|
@@ -481,16 +481,16 @@ var ce = {
|
|
|
481
481
|
})
|
|
482
482
|
]
|
|
483
483
|
});
|
|
484
|
-
}),
|
|
485
|
-
let [
|
|
486
|
-
value:
|
|
484
|
+
}), _e = ({ 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 }) => {
|
|
485
|
+
let [g, _] = w(null), v = !!a && !!r, y = C(() => [{
|
|
486
|
+
value: L.Http,
|
|
487
487
|
label: "HTTP"
|
|
488
488
|
}, {
|
|
489
|
-
value:
|
|
489
|
+
value: L.Sse,
|
|
490
490
|
label: "SSE"
|
|
491
491
|
}], []);
|
|
492
492
|
return S(() => {
|
|
493
|
-
if (!r || !o || !
|
|
493
|
+
if (!r || !o || !G(e.auth, i)) {
|
|
494
494
|
_(null);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
@@ -511,10 +511,10 @@ var ce = {
|
|
|
511
511
|
e.auth,
|
|
512
512
|
e.endpoint,
|
|
513
513
|
o
|
|
514
|
-
]), /* @__PURE__ */
|
|
514
|
+
]), /* @__PURE__ */ D("div", {
|
|
515
515
|
className: "flex max-w-[1060px] flex-col gap-4",
|
|
516
516
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ E(A, {
|
|
518
518
|
id: "toolset-endpoint",
|
|
519
519
|
value: e.endpoint,
|
|
520
520
|
onChange: (e) => d({ endpoint: e ?? "" }),
|
|
@@ -527,7 +527,7 @@ var ce = {
|
|
|
527
527
|
error: t.endpoint || void 0,
|
|
528
528
|
invalid: !!t.endpoint
|
|
529
529
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ E(se, {
|
|
531
531
|
labelProps: {
|
|
532
532
|
label: m?.protocolLabel ?? "Protocol",
|
|
533
533
|
required: !0
|
|
@@ -539,28 +539,28 @@ var ce = {
|
|
|
539
539
|
d({ protocol: e });
|
|
540
540
|
}
|
|
541
541
|
}),
|
|
542
|
-
|
|
542
|
+
g ? /* @__PURE__ */ E(P, {
|
|
543
543
|
id: "toolset-allowed-tools",
|
|
544
544
|
multiple: !0,
|
|
545
545
|
searchable: !0,
|
|
546
546
|
selectAll: !0,
|
|
547
547
|
labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
|
|
548
548
|
placeholder: m?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
|
|
549
|
-
options:
|
|
549
|
+
options: g.map((e) => ({
|
|
550
550
|
value: e,
|
|
551
551
|
label: e
|
|
552
552
|
})),
|
|
553
553
|
value: e.allowedTools,
|
|
554
554
|
onChange: (e) => d({ allowedTools: e })
|
|
555
|
-
}) : /* @__PURE__ */
|
|
555
|
+
}) : /* @__PURE__ */ E(F, {
|
|
556
556
|
id: "toolset-allowed-tools",
|
|
557
557
|
labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
|
|
558
558
|
placeholder: m?.allowedToolsPlaceholder ?? "Add tools, comma separated",
|
|
559
559
|
value: e.allowedTools,
|
|
560
560
|
onChange: (e) => d({ allowedTools: e }),
|
|
561
|
-
tagClassName:
|
|
561
|
+
tagClassName: h
|
|
562
562
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ E(Z, {
|
|
564
564
|
auth: e.auth,
|
|
565
565
|
errors: t,
|
|
566
566
|
isSaving: n,
|
|
@@ -575,168 +575,168 @@ var ce = {
|
|
|
575
575
|
onEnsureSaved: p,
|
|
576
576
|
labels: m?.auth
|
|
577
577
|
}),
|
|
578
|
-
v && /* @__PURE__ */
|
|
578
|
+
v && /* @__PURE__ */ E(ge, {
|
|
579
579
|
url: a ?? "",
|
|
580
580
|
labels: m?.connect,
|
|
581
581
|
className: "border-t border-tertiary pt-4"
|
|
582
582
|
})
|
|
583
583
|
]
|
|
584
584
|
});
|
|
585
|
-
},
|
|
585
|
+
}, ve = [
|
|
586
586
|
"keyHeader",
|
|
587
587
|
"apiKey",
|
|
588
588
|
"clientId",
|
|
589
589
|
"clientSecret",
|
|
590
590
|
"authorizationEndpoint",
|
|
591
591
|
"tokenEndpoint"
|
|
592
|
-
],
|
|
592
|
+
], ye = ["endpoint", ...ve], Q = new Set(ye), be = { validateVersionPattern: !0 }, xe = (e) => {
|
|
593
593
|
let t = {};
|
|
594
594
|
for (let n of Object.keys(e)) Q.has(n) && (t[n] = !0);
|
|
595
595
|
return t;
|
|
596
|
-
},
|
|
597
|
-
let N = !!i, [
|
|
596
|
+
}, $ = ({ initialForm: e, toolsetId: i, onPersist: o, onPostSaveLogin: c, onToolsetsChanged: u, onSaveSuccess: f, onSaveComplete: h, onBack: _, onDirtyChange: v, buildMcpUrl: b, listToolNames: te, authActions: T, onOAuthLogin: ne, onNotifySuccess: re, onNotifyError: ie, bucket: D, FileManagerModal: ae, resolveIconUrl: oe, allowedMimeTypes: O, maxFileSizeBytes: k, availableLocaleOptions: A, onRefineDescription: j, labels: M }) => {
|
|
597
|
+
let N = !!i, [se, ce] = w(""), P = i || se, [F, L] = w({
|
|
598
598
|
initialForm: e,
|
|
599
599
|
key: 0
|
|
600
600
|
}), [R, z] = w(e);
|
|
601
|
-
|
|
601
|
+
F.initialForm !== e && (L({
|
|
602
602
|
initialForm: e,
|
|
603
|
-
key:
|
|
603
|
+
key: F.key + 1
|
|
604
604
|
}), z(e));
|
|
605
|
-
let
|
|
606
|
-
initialValues:
|
|
607
|
-
validationOptions:
|
|
608
|
-
reseedKey:
|
|
609
|
-
}), [
|
|
610
|
-
...
|
|
605
|
+
let le = C(() => fe(e), [e]), { values: B, setValues: V, markTouched: U, visibleErrorCodes: W, attemptSubmit: G } = a({
|
|
606
|
+
initialValues: le,
|
|
607
|
+
validationOptions: be,
|
|
608
|
+
reseedKey: F.key
|
|
609
|
+
}), [de, K] = w(e), q = C(() => ({
|
|
610
|
+
...de,
|
|
611
611
|
...B
|
|
612
|
-
}), [
|
|
612
|
+
}), [de, B]), J = C(() => JSON.stringify(q) !== JSON.stringify(R), [q, R]);
|
|
613
613
|
S(() => {
|
|
614
|
-
v?.(
|
|
615
|
-
}, [
|
|
616
|
-
let [
|
|
614
|
+
v?.(J);
|
|
615
|
+
}, [J, v]);
|
|
616
|
+
let [Y, X] = w(!1), [he, Z] = w({}), [ge, Q] = w({}), $ = ee(null);
|
|
617
617
|
S(() => {
|
|
618
|
-
|
|
618
|
+
K(e), $.current = e, Z({}), Q({}), ce("");
|
|
619
619
|
}, [e]);
|
|
620
|
-
let
|
|
621
|
-
let { metadata: t, setup: n } =
|
|
622
|
-
Object.keys(t).length > 0 && (
|
|
620
|
+
let Se = x((e) => {
|
|
621
|
+
let { metadata: t, setup: n } = pe(e);
|
|
622
|
+
Object.keys(t).length > 0 && (V(t), "name" in t && U(r.Name), "version" in t && U(r.Version)), Object.keys(n).length !== 0 && (K((e) => ({
|
|
623
623
|
...e,
|
|
624
624
|
...n
|
|
625
|
-
})),
|
|
625
|
+
})), Q((e) => ({
|
|
626
626
|
...e,
|
|
627
|
-
...
|
|
628
|
-
})),
|
|
627
|
+
...xe(n)
|
|
628
|
+
})), Z((e) => {
|
|
629
629
|
let t = { ...e };
|
|
630
630
|
for (let e of Object.keys(n)) delete t[e];
|
|
631
631
|
return t;
|
|
632
632
|
}));
|
|
633
|
-
}, [
|
|
634
|
-
|
|
633
|
+
}, [V, U]), Ce = x((e) => {
|
|
634
|
+
K((t) => ({
|
|
635
635
|
...t,
|
|
636
636
|
auth: {
|
|
637
637
|
...t.auth,
|
|
638
638
|
...e
|
|
639
639
|
}
|
|
640
|
-
})),
|
|
640
|
+
})), Q((t) => ({
|
|
641
641
|
...t,
|
|
642
|
-
...
|
|
643
|
-
})),
|
|
642
|
+
...xe(e)
|
|
643
|
+
})), Z((t) => {
|
|
644
644
|
let n = { ...t };
|
|
645
|
-
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of
|
|
645
|
+
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of ve) delete n[e];
|
|
646
646
|
else for (let t of Object.keys(e)) delete n[t];
|
|
647
647
|
return n;
|
|
648
|
-
}), "isLoggedIn" in e &&
|
|
649
|
-
}, [
|
|
650
|
-
if (
|
|
651
|
-
|
|
648
|
+
}), "isLoggedIn" in e && u();
|
|
649
|
+
}, [u]), we = x(async () => {
|
|
650
|
+
if (P && $.current != null && JSON.stringify($.current) === JSON.stringify(q)) return P;
|
|
651
|
+
X(!0);
|
|
652
652
|
try {
|
|
653
|
-
let e = await
|
|
654
|
-
return e ? (
|
|
653
|
+
let e = await o(q, P);
|
|
654
|
+
return e ? (P || ce(e), $.current = q, z(q), v?.(!1), await u(), e) : null;
|
|
655
655
|
} catch {
|
|
656
656
|
return null;
|
|
657
657
|
} finally {
|
|
658
|
-
|
|
658
|
+
X(!1);
|
|
659
659
|
}
|
|
660
660
|
}, [
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
661
|
+
q,
|
|
662
|
+
P,
|
|
663
|
+
o,
|
|
664
|
+
u,
|
|
665
665
|
v
|
|
666
|
-
]),
|
|
666
|
+
]), Te = x(async () => await we() ?? !1, [we]), Ee = x((e) => {
|
|
667
667
|
let t = M?.validation, n = {};
|
|
668
|
-
return e.endpoint.trim() ? H(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 ===
|
|
668
|
+
return e.endpoint.trim() ? H(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 === s.ApiKey && (e.auth.keyHeader?.trim() || (n.keyHeader = t?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === l.WithLogin && !e.auth.apiKey?.trim() && (n.apiKey = t?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === s.OAuth && e.auth.withLogin === l.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() ? H(e.auth.authorizationEndpoint) || (n.authorizationEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.authorizationEndpoint = t?.authorizationEndpointRequired ?? "Authorization endpoint is required", e.auth.tokenEndpoint?.trim() ? H(e.auth.tokenEndpoint) || (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.tokenEndpoint = t?.tokenEndpointRequired ?? "Token endpoint is required")), n;
|
|
669
669
|
}, [M, N]), De = x(async () => {
|
|
670
|
-
let e =
|
|
671
|
-
if (!e || Object.keys(t).length > 0)
|
|
670
|
+
let e = G(), t = Ee(q);
|
|
671
|
+
if (!e || Object.keys(t).length > 0) Z(t);
|
|
672
672
|
else {
|
|
673
|
-
|
|
673
|
+
Z({}), X(!0);
|
|
674
674
|
try {
|
|
675
|
-
let e = await
|
|
675
|
+
let e = await o(q, P);
|
|
676
676
|
if (!e) return;
|
|
677
|
-
z(
|
|
677
|
+
z(q), await u(), f(q);
|
|
678
678
|
try {
|
|
679
|
-
await
|
|
679
|
+
await c(e, q.auth), h();
|
|
680
680
|
} catch (e) {
|
|
681
|
-
let { traceId: t } = await
|
|
682
|
-
|
|
681
|
+
let { traceId: t } = await d(e);
|
|
682
|
+
ie(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
683
683
|
}
|
|
684
684
|
} catch {} finally {
|
|
685
|
-
|
|
685
|
+
X(!1);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
}, [
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
689
|
+
G,
|
|
690
|
+
q,
|
|
691
|
+
Ee,
|
|
692
|
+
P,
|
|
693
|
+
o,
|
|
694
|
+
u,
|
|
695
|
+
f,
|
|
696
|
+
h,
|
|
697
|
+
c,
|
|
698
|
+
ie,
|
|
699
699
|
M
|
|
700
|
-
]), Oe =
|
|
700
|
+
]), Oe = y({
|
|
701
701
|
value: B.description,
|
|
702
|
-
onChange: (e) =>
|
|
702
|
+
onChange: (e) => Se({ description: e }),
|
|
703
703
|
onRefine: j,
|
|
704
|
-
disabled:
|
|
705
|
-
resetKey:
|
|
706
|
-
}), ke = j ? (e, t) => /* @__PURE__ */
|
|
704
|
+
disabled: Y,
|
|
705
|
+
resetKey: F.key
|
|
706
|
+
}), ke = j ? (e, t) => /* @__PURE__ */ E(g, {
|
|
707
707
|
isEnabled: !0,
|
|
708
708
|
fieldId: t,
|
|
709
709
|
label: M?.general?.form?.description.label ?? "Description",
|
|
710
710
|
labels: M?.refinement,
|
|
711
711
|
refinement: Oe,
|
|
712
|
-
disabled: Oe.isPending ||
|
|
712
|
+
disabled: Oe.isPending || Y,
|
|
713
713
|
children: e
|
|
714
|
-
}) : void 0, Ae = C(() => !
|
|
715
|
-
let e = M?.validation, n =
|
|
716
|
-
for (let e of
|
|
717
|
-
if (!
|
|
714
|
+
}) : void 0, Ae = C(() => !ue(q, N), [q, N]), je = C(() => {
|
|
715
|
+
let e = M?.validation, n = Ee(q), r = { ...he };
|
|
716
|
+
for (let e of ye) {
|
|
717
|
+
if (!ge[e]) continue;
|
|
718
718
|
let t = n[e];
|
|
719
719
|
t ? r[e] = t : delete r[e];
|
|
720
720
|
}
|
|
721
|
-
return
|
|
721
|
+
return W.name === t.Required ? r.name = e?.nameRequired ?? "Name is required" : W.name === t.TooLong ? r.name = e?.nameTooLong ?? `Use ${m} characters or fewer.` : W.name === t.ControlCharacters && (r.name = e?.nameControlCharacters ?? "Remove line breaks, tabs and other control characters."), W.description === t.TooLong && (r.description = e?.descriptionTooLong ?? `Use ${p} characters or fewer.`), W.version === t.InvalidFormat && (r.version = e?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), r;
|
|
722
722
|
}, [
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
723
|
+
ge,
|
|
724
|
+
he,
|
|
725
|
+
q,
|
|
726
726
|
M,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
]), Me =
|
|
730
|
-
return /* @__PURE__ */
|
|
727
|
+
W,
|
|
728
|
+
Ee
|
|
729
|
+
]), Me = b && P ? b(P) : void 0;
|
|
730
|
+
return /* @__PURE__ */ E(n, {
|
|
731
731
|
title: N ? M?.layout?.editTitle ?? "Edit toolset" : M?.layout?.createTitle ?? "Create toolset",
|
|
732
|
-
onBack:
|
|
733
|
-
onCancel:
|
|
732
|
+
onBack: _,
|
|
733
|
+
onCancel: _,
|
|
734
734
|
onSubmit: De,
|
|
735
735
|
submitLabel: N ? M?.layout?.saveLabel ?? "Save" : M?.layout?.createLabel ?? "Create",
|
|
736
|
-
isSubmitting:
|
|
736
|
+
isSubmitting: Y,
|
|
737
737
|
isSubmitDisabled: Ae || Oe.isPending,
|
|
738
|
-
metadataSectionClassName:
|
|
739
|
-
setupSectionClassName:
|
|
738
|
+
metadataSectionClassName: I.metadataSection,
|
|
739
|
+
setupSectionClassName: I.setupSection,
|
|
740
740
|
labels: {
|
|
741
741
|
backAriaLabel: M?.layout?.backAriaLabel ?? "Back to catalog",
|
|
742
742
|
savingStatusLabel: M?.layout?.savingStatusLabel ?? "Saving",
|
|
@@ -744,37 +744,37 @@ var ce = {
|
|
|
744
744
|
setupTitle: M?.layout?.setupSectionTitle ?? "Setup",
|
|
745
745
|
cancelLabel: M?.layout?.cancelLabel ?? "Cancel"
|
|
746
746
|
},
|
|
747
|
-
metadata: /* @__PURE__ */
|
|
748
|
-
form:
|
|
747
|
+
metadata: /* @__PURE__ */ E(me, {
|
|
748
|
+
form: q,
|
|
749
749
|
errors: je,
|
|
750
|
-
bucket:
|
|
751
|
-
FileManagerModal:
|
|
752
|
-
resolveIconUrl:
|
|
753
|
-
allowedMimeTypes:
|
|
750
|
+
bucket: D,
|
|
751
|
+
FileManagerModal: ae,
|
|
752
|
+
resolveIconUrl: oe,
|
|
753
|
+
allowedMimeTypes: O,
|
|
754
754
|
maxFileSizeBytes: k,
|
|
755
755
|
availableLocaleOptions: A,
|
|
756
|
-
onChange:
|
|
756
|
+
onChange: Se,
|
|
757
757
|
renderDescription: ke,
|
|
758
758
|
labels: M?.general
|
|
759
759
|
}),
|
|
760
|
-
setup: /* @__PURE__ */
|
|
761
|
-
form:
|
|
760
|
+
setup: /* @__PURE__ */ E(_e, {
|
|
761
|
+
form: q,
|
|
762
762
|
errors: je,
|
|
763
|
-
isSaving:
|
|
764
|
-
toolsetId:
|
|
763
|
+
isSaving: Y,
|
|
764
|
+
toolsetId: P,
|
|
765
765
|
isEditMode: N,
|
|
766
766
|
connectUrl: Me,
|
|
767
|
-
listToolNames:
|
|
767
|
+
listToolNames: te,
|
|
768
768
|
authActions: T,
|
|
769
769
|
onOAuthLogin: ne,
|
|
770
770
|
onNotifySuccess: re,
|
|
771
|
-
onNotifyError:
|
|
772
|
-
onChange:
|
|
773
|
-
onAuthChange:
|
|
774
|
-
onEnsureSaved:
|
|
771
|
+
onNotifyError: ie,
|
|
772
|
+
onChange: Se,
|
|
773
|
+
onAuthChange: Ce,
|
|
774
|
+
onEnsureSaved: Te,
|
|
775
775
|
labels: M?.settings
|
|
776
776
|
})
|
|
777
777
|
});
|
|
778
778
|
};
|
|
779
779
|
//#endregion
|
|
780
|
-
export {
|
|
780
|
+
export { z as AUTH_TYPE_ICONS, R as DEFAULT_TOOLSET_VERSION, me as GeneralForm, I as TOOLSET_EDITOR_CLASS, $ as ToolsetEditor, q as ToolsetOAuthLoginStatus, L as ToolsetTransportType, B as getDefaultToolsetForm, G as isToolsetAuthValid, ue as isToolsetFormValid, H as isValidEndpointUrl, W as normalizeReturnedEndpointUrl };
|
|
@@ -15,7 +15,7 @@ export interface ToolsetEditorValidationLabels {
|
|
|
15
15
|
nameControlCharacters?: string;
|
|
16
16
|
/** Message for a description over the shared length limit. Defaults to `'Use 2000 characters or fewer.'`. */
|
|
17
17
|
descriptionTooLong?: string;
|
|
18
|
-
/** Message for a malformed version. Defaults to `'Version
|
|
18
|
+
/** Message for a malformed version. Defaults to `'Version may only contain letters, digits, dots, underscores, and dashes'`. */
|
|
19
19
|
versionInvalid?: string;
|
|
20
20
|
/** Message for a missing endpoint. Defaults to `'Endpoint is required'`. */
|
|
21
21
|
endpointRequired?: string;
|
|
@@ -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,kCAAkC,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,yFAAyF;AACzF,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gIAAgI;IAChI,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,
|
|
1
|
+
{"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"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"}
|
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.210",
|
|
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.210"
|
|
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.210",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.210",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|
package/utils/toolsets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/utils/toolsets.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/utils/toolsets.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAQhC,2GAA2G;AAC3G,eAAO,MAAM,qBAAqB,QAAO,eAWvC,CAAC;AAmBH,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,OACR,CAAC;AAK5C;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GAAI,QAAQ,MAAM,KAAG,MAkB7D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,mBAAmB,EACzB,oBAAkB,KACjB,OAmBF,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,eAAe,EACrB,oBAAkB,KACjB,OAKwC,CAAC;AAW5C,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,GAC9B,MAAM,eAAe,KACpB,4BAOD,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,GAChC,OAAO,OAAO,CAAC,eAAe,CAAC,KAC9B;IACD,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAChD,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAWjC,CAAC"}
|