@epam/ai-dial-toolset-editor 1.3.0-dev.235 → 1.3.0-dev.244
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/AuthSection/AuthSection.d.ts.map +1 -1
- package/components/ToolsetEditor/ToolsetEditor.d.ts.map +1 -1
- package/constants/toolsets.d.ts +3 -0
- package/constants/toolsets.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +301 -336
- package/models/general-form-labels.d.ts +14 -0
- package/models/general-form-labels.d.ts.map +1 -0
- package/models/toolset-editor-props.d.ts +4 -13
- package/models/toolset-editor-props.d.ts.map +1 -1
- package/package.json +4 -4
- package/components/GeneralForm/GeneralForm.d.ts +0 -8
- package/components/GeneralForm/GeneralForm.d.ts.map +0 -1
- package/models/general-form-props.d.ts +0 -48
- package/models/general-form-props.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthSection.d.ts","sourceRoot":"","sources":["../../../src/components/AuthSection/AuthSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthSection.d.ts","sourceRoot":"","sources":["../../../src/components/AuthSection/AuthSection.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AA+BzC,uIAAuI;AACvI,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAid5C,CAAC"}
|
|
@@ -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":"AAmBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA+C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAodhD,CAAC"}
|
package/constants/toolsets.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeploymentCreationFormLabels } from '../../../builder-form/src/index.ts';
|
|
1
2
|
import { ToolsetAuthTypes } from '../../../chat-hooks/src/index.ts';
|
|
2
3
|
import { TablerIcon } from '@tabler/icons-react';
|
|
3
4
|
export declare enum ToolsetTransportType {
|
|
@@ -8,6 +9,8 @@ export declare enum ToolsetTransportType {
|
|
|
8
9
|
}
|
|
9
10
|
/** Default display version seeded into a new toolset form; the shared deployment default. */
|
|
10
11
|
export declare const DEFAULT_TOOLSET_VERSION = "1.0.0";
|
|
12
|
+
/** Toolset-flavoured English metadata field labels used when the host omits `labels.general.form`. */
|
|
13
|
+
export declare const DEFAULT_TOOLSET_METADATA_LABELS: DeploymentCreationFormLabels;
|
|
11
14
|
/** Icon shown for each toolset authentication-type segment; labels arrive via the auth labels. */
|
|
12
15
|
export declare const AUTH_TYPE_ICONS: Record<ToolsetAuthTypes, TablerIcon>;
|
|
13
16
|
//# 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":"AAAA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,4BAA4B,CAAC;AACpC,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,sGAAsG;AACtG,eAAO,MAAM,+BAA+B,EAAE,4BA8B7C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAIhE,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid}}}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid}}}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.block{display:block}.flex{display:flex}.inline{display:inline}.max-w-\[1060px\]{max-width:1060px}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-tertiary{border-color:var(--stroke-tertiary,#e0e6f0)}.px-2{padding-inline:.5rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-start{text-align:start}.text-primary{color:var(--text-primary,#161b2d)}.text-secondary{color:var(--text-secondary,#57647a)}@media (min-width:1280px){.desktop\:not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { ToolsetEditor } from './components/ToolsetEditor/ToolsetEditor';
|
|
2
|
-
export { GeneralForm } from './components/GeneralForm/GeneralForm';
|
|
3
2
|
export type { ToolsetEditorLabels, ToolsetEditorLayoutLabels, ToolsetEditorProps, ToolsetEditorValidationLabels, } from './models/toolset-editor-props';
|
|
4
|
-
export type { GeneralFormLabels
|
|
3
|
+
export type { GeneralFormLabels } from './models/general-form-labels';
|
|
5
4
|
export type { ConnectMcpUrlContentLabels, SettingsFormLabels, } from './models/settings-form-props';
|
|
6
5
|
export type { AuthSectionLabels } from './models/auth-section-props';
|
|
7
6
|
export { ToolsetOAuthLoginStatus } from './models/toolset-oauth-login';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,180 +1,147 @@
|
|
|
1
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,
|
|
3
|
-
import { CopyButton as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { IconBrandOauth as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { ToolsetAuthTypes as s, ToolsetCredentialsLevel as c, WithLogin as l, getApiErrorDetails as u } from "@epam/ai-dial-chat-hooks";
|
|
3
|
+
import { CopyButton as d, ENTITY_DESCRIPTION_MAX_LENGTH as f, ENTITY_NAME_MAX_LENGTH as p, TAG_INPUT_TAG_CLASS_NAME as m, TextRefinementField as h, mergeClasses as g, useCodeCopy as _, useTextRefinement as v } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { memo as y, useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
5
|
+
import { IconBrandOauth as T, IconKey as E, IconLockOff as D, IconLogin as ee, IconLogout as te } from "@tabler/icons-react";
|
|
6
|
+
import { CaptionText as ne, ConfirmationPopup as O, ConfirmationPopupVariant as re, DIAL_ICON_SIZE as k, DIAL_KIT_ICON_STROKE as A, Input as j, NeutralButton as M, PasswordInput as ie, Radio as N, RadioGroup as P, SegmentedControl as F, Select as ae, TagInput as I } from "@epam/ai-dial-ui-kit";
|
|
7
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var z = {
|
|
10
10
|
metadataSection: "dial-toolset-editor-metadata-section",
|
|
11
11
|
setupSection: "dial-toolset-editor-setup-section"
|
|
12
|
-
},
|
|
12
|
+
}, B = /* @__PURE__ */ function(e) {
|
|
13
13
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
14
|
-
}({}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
14
|
+
}({}), V = e, oe = {
|
|
15
|
+
name: {
|
|
16
|
+
label: "Name",
|
|
17
|
+
placeholder: "Enter name"
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
label: "Description",
|
|
21
|
+
placeholder: "Describe what this toolset does"
|
|
22
|
+
},
|
|
23
|
+
iconUrl: {
|
|
24
|
+
label: "Avatar",
|
|
25
|
+
addAvatarLabel: "Add avatar",
|
|
26
|
+
captionText: "PNG, JPG or SVG (max 1 MB)"
|
|
27
|
+
},
|
|
28
|
+
version: {
|
|
29
|
+
label: "Version",
|
|
30
|
+
placeholder: "e.g. 1.0.0"
|
|
31
|
+
},
|
|
32
|
+
topics: {
|
|
33
|
+
label: "Tags",
|
|
34
|
+
placeholder: "Add tags, comma separated"
|
|
35
|
+
},
|
|
36
|
+
otherLocales: {
|
|
37
|
+
summaryLabel: "Locales",
|
|
38
|
+
addLabel: "Add locales",
|
|
39
|
+
editLabel: "Edit locales",
|
|
40
|
+
popupTitle: "Add locale",
|
|
41
|
+
addLocaleLabel: "Add locale",
|
|
42
|
+
localeRowLabel: "Locale",
|
|
43
|
+
languageLabel: "Language",
|
|
44
|
+
nameLabel: "Name",
|
|
45
|
+
namePlaceholder: "Enter name",
|
|
46
|
+
descriptionLabel: "About",
|
|
47
|
+
descriptionPlaceholder: "Enter brief description",
|
|
48
|
+
deleteAriaLabel: "Delete locale",
|
|
49
|
+
cancelLabel: "Cancel",
|
|
50
|
+
saveLabel: "Save"
|
|
51
|
+
},
|
|
52
|
+
ariaLabel: "General"
|
|
53
|
+
}, H = {
|
|
54
|
+
[s.OAuth]: T,
|
|
55
|
+
[s.ApiKey]: E,
|
|
56
|
+
[s.None]: D
|
|
57
|
+
}, U = () => ({
|
|
19
58
|
authenticationType: s.None,
|
|
20
59
|
withLogin: l.WithoutLogin,
|
|
21
60
|
isLoggedIn: !1
|
|
22
|
-
}),
|
|
61
|
+
}), W = () => ({
|
|
23
62
|
name: "",
|
|
24
|
-
version:
|
|
63
|
+
version: V,
|
|
25
64
|
iconUrl: "",
|
|
26
65
|
description: "",
|
|
27
66
|
topics: [],
|
|
28
67
|
otherLocales: [],
|
|
29
68
|
endpoint: "",
|
|
30
|
-
protocol:
|
|
69
|
+
protocol: B.Http,
|
|
31
70
|
allowedTools: [],
|
|
32
|
-
auth:
|
|
33
|
-
}),
|
|
71
|
+
auth: U()
|
|
72
|
+
}), G = (e) => {
|
|
34
73
|
if (!/^https?:\/\//.test(e) || e.endsWith(".") || e.endsWith("//")) return !1;
|
|
35
74
|
try {
|
|
36
75
|
return !!new URL(e);
|
|
37
76
|
} catch {
|
|
38
77
|
return !1;
|
|
39
78
|
}
|
|
40
|
-
},
|
|
79
|
+
}, K = (e) => G(e.trim()), se = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), q = (e) => {
|
|
41
80
|
let t = e?.trim() ?? "";
|
|
42
|
-
if (!t ||
|
|
81
|
+
if (!t || G(t)) return t;
|
|
43
82
|
let n = [t];
|
|
44
83
|
try {
|
|
45
84
|
let e = decodeURIComponent(t);
|
|
46
85
|
e !== t && n.push(e);
|
|
47
86
|
} catch {}
|
|
48
87
|
for (let e of n) {
|
|
49
|
-
let t =
|
|
50
|
-
if (
|
|
88
|
+
let t = se(e);
|
|
89
|
+
if (G(t)) return t;
|
|
51
90
|
}
|
|
52
91
|
return t;
|
|
53
|
-
},
|
|
92
|
+
}, J = (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()) && K(e.authorizationEndpoint ?? "") && K(e.tokenEndpoint ?? "") : !0, ce = (e, t = !1) => Object.keys(o(e, { validateVersionPattern: !0 })).length === 0 && K(e.endpoint) && J(e.auth, t), le = /* @__PURE__ */ new Set([
|
|
54
93
|
"name",
|
|
55
94
|
"description",
|
|
56
95
|
"iconUrl",
|
|
57
96
|
"version",
|
|
58
97
|
"topics",
|
|
59
98
|
"otherLocales"
|
|
60
|
-
]),
|
|
99
|
+
]), ue = (e) => ({
|
|
61
100
|
name: e.name,
|
|
62
101
|
description: e.description,
|
|
63
102
|
iconUrl: e.iconUrl,
|
|
64
103
|
version: e.version,
|
|
65
104
|
topics: e.topics,
|
|
66
105
|
otherLocales: e.otherLocales
|
|
67
|
-
}),
|
|
106
|
+
}), de = (e) => {
|
|
68
107
|
let t = {}, n = {};
|
|
69
|
-
for (let [r, i] of Object.entries(e)) (
|
|
108
|
+
for (let [r, i] of Object.entries(e)) (le.has(r) ? t : n)[r] = i;
|
|
70
109
|
return {
|
|
71
110
|
metadata: t,
|
|
72
111
|
setup: n
|
|
73
112
|
};
|
|
74
|
-
},
|
|
75
|
-
name: {
|
|
76
|
-
label: "Name",
|
|
77
|
-
placeholder: "Enter name"
|
|
78
|
-
},
|
|
79
|
-
description: {
|
|
80
|
-
label: "Description",
|
|
81
|
-
placeholder: "Describe what this toolset does"
|
|
82
|
-
},
|
|
83
|
-
iconUrl: {
|
|
84
|
-
label: "Avatar",
|
|
85
|
-
addAvatarLabel: "Add avatar",
|
|
86
|
-
captionText: "PNG, JPG or SVG (max 1 MB)"
|
|
87
|
-
},
|
|
88
|
-
version: {
|
|
89
|
-
label: "Version",
|
|
90
|
-
placeholder: "e.g. 1.0.0"
|
|
91
|
-
},
|
|
92
|
-
topics: {
|
|
93
|
-
label: "Tags",
|
|
94
|
-
placeholder: "Add tags, comma separated"
|
|
95
|
-
},
|
|
96
|
-
otherLocales: {
|
|
97
|
-
summaryLabel: "Locales",
|
|
98
|
-
addLabel: "Add locales",
|
|
99
|
-
editLabel: "Edit locales",
|
|
100
|
-
popupTitle: "Add locale",
|
|
101
|
-
addLocaleLabel: "Add locale",
|
|
102
|
-
localeRowLabel: "Locale",
|
|
103
|
-
languageLabel: "Language",
|
|
104
|
-
nameLabel: "Name",
|
|
105
|
-
namePlaceholder: "Enter name",
|
|
106
|
-
descriptionLabel: "About",
|
|
107
|
-
descriptionPlaceholder: "Enter brief description",
|
|
108
|
-
deleteAriaLabel: "Delete locale",
|
|
109
|
-
cancelLabel: "Cancel",
|
|
110
|
-
saveLabel: "Save"
|
|
111
|
-
},
|
|
112
|
-
ariaLabel: "General"
|
|
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
|
-
let h = x((e) => {
|
|
115
|
-
let [t] = e.files;
|
|
116
|
-
return (t ? u(t, n, { resolvePreviewUrl: a }) : null)?.url;
|
|
117
|
-
}, [n, a]), g = C(() => ({
|
|
118
|
-
bucket: n,
|
|
119
|
-
FileManagerModal: r,
|
|
120
|
-
resolveIconUrl: a,
|
|
121
|
-
resolveAttachedIconUrl: h,
|
|
122
|
-
allowedMimeTypes: o,
|
|
123
|
-
maxFileSizeBytes: s
|
|
124
|
-
}), [
|
|
125
|
-
n,
|
|
126
|
-
r,
|
|
127
|
-
a,
|
|
128
|
-
h,
|
|
129
|
-
o,
|
|
130
|
-
s
|
|
131
|
-
]), _ = C(() => ({
|
|
132
|
-
form: m?.form ?? K,
|
|
133
|
-
avatarPicker: m?.avatarPicker
|
|
134
|
-
}), [m?.form, m?.avatarPicker]);
|
|
135
|
-
return /* @__PURE__ */ E(i, {
|
|
136
|
-
values: e,
|
|
137
|
-
errors: t,
|
|
138
|
-
onChange: l,
|
|
139
|
-
onNameBlur: d,
|
|
140
|
-
onVersionBlur: f,
|
|
141
|
-
avatarPicker: g,
|
|
142
|
-
availableLocaleOptions: c,
|
|
143
|
-
renderDescription: p,
|
|
144
|
-
labels: _
|
|
145
|
-
});
|
|
146
|
-
}, q = /* @__PURE__ */ function(e) {
|
|
113
|
+
}, Y = /* @__PURE__ */ function(e) {
|
|
147
114
|
return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
|
|
148
|
-
}({}),
|
|
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,
|
|
150
|
-
S || t === e.authenticationType ||
|
|
115
|
+
}({}), X = "toolset-client-secret-keep-caption", fe = (e) => `******${e}`, Z = (e) => e === s.None ? l.WithoutLogin : l.WithLogin, pe = (e, t) => e === s.None ? t?.typeNone ?? "Open access" : e === s.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", Q = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: d, onNotifySuccess: f, onNotifyError: p, onAuthChange: h, onEnsureSaved: g, labels: _ }) => {
|
|
116
|
+
let [v, y] = w(!1), [b, x] = w(!1), S = e.isLoggedIn || n || v, C = i && e.clientSecretHint && !e.clientSecret ? e.clientSecretHint : void 0, T = K(a) && J(e, i) && !S, E = (t) => {
|
|
117
|
+
S || t === e.authenticationType || h({
|
|
151
118
|
authenticationType: t,
|
|
152
|
-
withLogin:
|
|
119
|
+
withLogin: Z(t)
|
|
153
120
|
});
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
switch (e.auth != null &&
|
|
158
|
-
case
|
|
159
|
-
|
|
121
|
+
}, D = (e) => {
|
|
122
|
+
h({ withLogin: e });
|
|
123
|
+
}, P = (e) => {
|
|
124
|
+
switch (e.auth != null && h(e.auth), e.status) {
|
|
125
|
+
case Y.Success:
|
|
126
|
+
h({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
160
127
|
return;
|
|
161
|
-
case
|
|
128
|
+
case Y.PopupBlocked:
|
|
162
129
|
p(_?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
|
|
163
130
|
return;
|
|
164
|
-
case
|
|
131
|
+
case Y.InvalidConfig:
|
|
165
132
|
p(_?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
|
|
166
133
|
return;
|
|
167
|
-
case
|
|
134
|
+
case Y.Failed:
|
|
168
135
|
p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
|
|
169
136
|
return;
|
|
170
|
-
case
|
|
137
|
+
case Y.Cancelled: return;
|
|
171
138
|
}
|
|
172
|
-
},
|
|
173
|
-
if (!
|
|
139
|
+
}, ae = async () => {
|
|
140
|
+
if (!T) return;
|
|
174
141
|
if (e.authenticationType === s.OAuth) {
|
|
175
142
|
y(!0);
|
|
176
143
|
try {
|
|
177
|
-
|
|
144
|
+
P(await d({
|
|
178
145
|
auth: e,
|
|
179
146
|
ensureSaved: g
|
|
180
147
|
}));
|
|
@@ -193,15 +160,15 @@ var I = {
|
|
|
193
160
|
authenticationType: e.authenticationType,
|
|
194
161
|
apiKey: e.apiKey?.trim()
|
|
195
162
|
};
|
|
196
|
-
await o.login(t, n),
|
|
163
|
+
await o.login(t, n), h({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
197
164
|
} catch (e) {
|
|
198
|
-
let { traceId: t } = await
|
|
165
|
+
let { traceId: t } = await u(e);
|
|
199
166
|
p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
200
167
|
} finally {
|
|
201
168
|
y(!1);
|
|
202
169
|
}
|
|
203
170
|
}
|
|
204
|
-
},
|
|
171
|
+
}, z = async () => {
|
|
205
172
|
y(!0);
|
|
206
173
|
try {
|
|
207
174
|
let t = {
|
|
@@ -209,106 +176,106 @@ var I = {
|
|
|
209
176
|
credentialsLevel: c.User,
|
|
210
177
|
authenticationType: e.authenticationType
|
|
211
178
|
};
|
|
212
|
-
await o.logout(r, t),
|
|
179
|
+
await o.logout(r, t), h({ isLoggedIn: !1 }), x(!1), f(_?.logoutSuccessMessage ?? "Successfully logged out.");
|
|
213
180
|
} catch (e) {
|
|
214
|
-
let { traceId: t } = await
|
|
181
|
+
let { traceId: t } = await u(e);
|
|
215
182
|
p(_?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
|
|
216
183
|
} finally {
|
|
217
184
|
y(!1);
|
|
218
185
|
}
|
|
219
|
-
},
|
|
186
|
+
}, B = () => e.isLoggedIn ? /* @__PURE__ */ L("div", {
|
|
220
187
|
className: "flex",
|
|
221
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ L(M, {
|
|
222
189
|
label: _?.logOutLabel ?? "Log out",
|
|
223
|
-
iconBefore: /* @__PURE__ */
|
|
224
|
-
size:
|
|
225
|
-
stroke:
|
|
190
|
+
iconBefore: /* @__PURE__ */ L(te, {
|
|
191
|
+
size: k.MD,
|
|
192
|
+
stroke: A
|
|
226
193
|
}),
|
|
227
194
|
onClick: () => x(!0),
|
|
228
195
|
disabled: n || v
|
|
229
196
|
})
|
|
230
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ L("div", {
|
|
231
198
|
className: "flex",
|
|
232
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ L(M, {
|
|
233
200
|
label: _?.logInLabel ?? "Log in",
|
|
234
|
-
iconBefore: /* @__PURE__ */
|
|
235
|
-
size:
|
|
236
|
-
stroke:
|
|
201
|
+
iconBefore: /* @__PURE__ */ L(ee, {
|
|
202
|
+
size: k.MD,
|
|
203
|
+
stroke: A
|
|
237
204
|
}),
|
|
238
|
-
onClick:
|
|
239
|
-
disabled: !
|
|
205
|
+
onClick: ae,
|
|
206
|
+
disabled: !T
|
|
240
207
|
})
|
|
241
208
|
});
|
|
242
|
-
return /* @__PURE__ */
|
|
209
|
+
return /* @__PURE__ */ R("section", {
|
|
243
210
|
className: "flex flex-col gap-2",
|
|
244
211
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ L("h3", {
|
|
246
213
|
className: "dial-h3-text",
|
|
247
214
|
children: _?.sectionTitle ?? "Authentication"
|
|
248
215
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ L(F, {
|
|
250
217
|
"aria-label": _?.sectionTitle ?? "Authentication",
|
|
251
218
|
value: e.authenticationType,
|
|
252
|
-
onChange: (e) =>
|
|
219
|
+
onChange: (e) => E(e),
|
|
253
220
|
segmentClassName: "px-2",
|
|
254
221
|
items: [
|
|
255
222
|
s.None,
|
|
256
223
|
s.OAuth,
|
|
257
224
|
s.ApiKey
|
|
258
225
|
].map((t) => {
|
|
259
|
-
let n =
|
|
226
|
+
let n = H[t];
|
|
260
227
|
return {
|
|
261
228
|
value: t,
|
|
262
|
-
label: /* @__PURE__ */
|
|
229
|
+
label: /* @__PURE__ */ R("div", {
|
|
263
230
|
className: "flex items-center gap-2",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ L(n, {
|
|
265
232
|
className: "shrink-0",
|
|
266
|
-
size:
|
|
267
|
-
stroke:
|
|
233
|
+
size: k.SM,
|
|
234
|
+
stroke: A,
|
|
268
235
|
"aria-hidden": !0
|
|
269
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), /* @__PURE__ */ L("span", {
|
|
270
237
|
className: "sr-only desktop:not-sr-only",
|
|
271
|
-
children:
|
|
238
|
+
children: pe(t, _)
|
|
272
239
|
})]
|
|
273
240
|
}),
|
|
274
241
|
disabled: S && e.authenticationType !== t
|
|
275
242
|
};
|
|
276
243
|
})
|
|
277
244
|
}),
|
|
278
|
-
e.authenticationType === s.None && /* @__PURE__ */
|
|
245
|
+
e.authenticationType === s.None && /* @__PURE__ */ L("p", {
|
|
279
246
|
className: "dial-small-text pt-2 text-secondary",
|
|
280
247
|
children: _?.openAccessDescription ?? "Open endpoint, no credentials"
|
|
281
248
|
}),
|
|
282
|
-
e.authenticationType === s.OAuth && /* @__PURE__ */
|
|
249
|
+
e.authenticationType === s.OAuth && /* @__PURE__ */ R("div", {
|
|
283
250
|
className: "flex flex-col gap-3 pt-2",
|
|
284
251
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ R("div", {
|
|
286
253
|
className: "flex flex-col gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ L(N, {
|
|
288
255
|
name: "oauth-login-mode",
|
|
289
256
|
id: "oauth-with-login",
|
|
290
257
|
value: l.WithLogin,
|
|
291
258
|
labelProps: { label: _?.withLoginOAuthLabel ?? "Standard login" },
|
|
292
259
|
isSelected: e.withLogin === l.WithLogin,
|
|
293
260
|
disabled: S,
|
|
294
|
-
onChange:
|
|
295
|
-
}), /* @__PURE__ */
|
|
261
|
+
onChange: D
|
|
262
|
+
}), /* @__PURE__ */ L(N, {
|
|
296
263
|
name: "oauth-login-mode",
|
|
297
264
|
id: "oauth-with-config",
|
|
298
265
|
value: l.WithConfig,
|
|
299
266
|
labelProps: { label: _?.withConfigOAuthLabel ?? "Custom login" },
|
|
300
267
|
isSelected: e.withLogin === l.WithConfig,
|
|
301
268
|
disabled: S,
|
|
302
|
-
onChange:
|
|
269
|
+
onChange: D
|
|
303
270
|
})]
|
|
304
271
|
}),
|
|
305
|
-
e.withLogin === l.WithConfig && /* @__PURE__ */
|
|
272
|
+
e.withLogin === l.WithConfig && /* @__PURE__ */ R("div", {
|
|
306
273
|
className: "flex flex-col gap-3",
|
|
307
274
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ L(j, {
|
|
309
276
|
id: "toolset-client-id",
|
|
310
277
|
value: e.clientId ?? "",
|
|
311
|
-
onChange: (e) =>
|
|
278
|
+
onChange: (e) => h({ clientId: e ?? "" }),
|
|
312
279
|
labelProps: {
|
|
313
280
|
label: _?.clientIdLabel ?? "Client ID",
|
|
314
281
|
required: !0
|
|
@@ -318,33 +285,32 @@ var I = {
|
|
|
318
285
|
invalid: !!t.clientId,
|
|
319
286
|
disabled: S
|
|
320
287
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ R("div", {
|
|
322
289
|
className: "flex flex-col gap-1",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ L(ie, {
|
|
324
291
|
id: "toolset-client-secret",
|
|
325
292
|
value: e.clientSecret ?? "",
|
|
326
|
-
onChange: (e) =>
|
|
293
|
+
onChange: (e) => h({ clientSecret: e ?? "" }),
|
|
327
294
|
labelProps: {
|
|
328
295
|
label: _?.clientSecretLabel ?? "Client secret",
|
|
329
296
|
required: !i
|
|
330
297
|
},
|
|
331
|
-
placeholder: C == null ? _?.clientSecretPlaceholder ?? "Enter client secret" : (_?.clientSecretHintPlaceholder ??
|
|
332
|
-
"aria-describedby": C == null ? void 0 :
|
|
298
|
+
placeholder: C == null ? _?.clientSecretPlaceholder ?? "Enter client secret" : (_?.clientSecretHintPlaceholder ?? fe)(C),
|
|
299
|
+
"aria-describedby": C == null ? void 0 : X,
|
|
333
300
|
showPasswordLabel: _?.showClientSecretLabel ?? "Show client secret",
|
|
334
301
|
hidePasswordLabel: _?.hideClientSecretLabel ?? "Hide client secret",
|
|
335
302
|
error: t.clientSecret || void 0,
|
|
336
303
|
invalid: !!t.clientSecret,
|
|
337
304
|
disabled: S
|
|
338
|
-
}), C != null && /* @__PURE__ */
|
|
339
|
-
id:
|
|
340
|
-
|
|
341
|
-
children: _?.clientSecretKeepCaption ?? "Leave empty to keep the saved secret."
|
|
305
|
+
}), C != null && /* @__PURE__ */ L(ne, {
|
|
306
|
+
id: X,
|
|
307
|
+
text: _?.clientSecretKeepCaption ?? "Leave empty to keep the saved secret."
|
|
342
308
|
})]
|
|
343
309
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ L(j, {
|
|
345
311
|
id: "toolset-authorization-endpoint",
|
|
346
312
|
value: e.authorizationEndpoint ?? "",
|
|
347
|
-
onChange: (e) =>
|
|
313
|
+
onChange: (e) => h({ authorizationEndpoint: e ?? "" }),
|
|
348
314
|
labelProps: {
|
|
349
315
|
label: _?.authorizationEndpointLabel ?? "Authorization endpoint",
|
|
350
316
|
required: !0
|
|
@@ -354,10 +320,10 @@ var I = {
|
|
|
354
320
|
invalid: !!t.authorizationEndpoint,
|
|
355
321
|
disabled: S
|
|
356
322
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ L(j, {
|
|
358
324
|
id: "toolset-token-endpoint",
|
|
359
325
|
value: e.tokenEndpoint ?? "",
|
|
360
|
-
onChange: (e) =>
|
|
326
|
+
onChange: (e) => h({ tokenEndpoint: e ?? "" }),
|
|
361
327
|
labelProps: {
|
|
362
328
|
label: _?.tokenEndpointLabel ?? "Token endpoint",
|
|
363
329
|
required: !0
|
|
@@ -367,49 +333,49 @@ var I = {
|
|
|
367
333
|
invalid: !!t.tokenEndpoint,
|
|
368
334
|
disabled: S
|
|
369
335
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ L(I, {
|
|
371
337
|
id: "toolset-scopes",
|
|
372
338
|
labelProps: { label: _?.scopesLabel ?? "Scopes" },
|
|
373
339
|
placeholder: _?.scopesPlaceholder ?? "Enter scopes",
|
|
374
340
|
value: e.scopes ?? [],
|
|
375
|
-
onChange: (e) =>
|
|
341
|
+
onChange: (e) => h({ scopes: e }),
|
|
376
342
|
disabled: S,
|
|
377
|
-
tagClassName:
|
|
343
|
+
tagClassName: m
|
|
378
344
|
})
|
|
379
345
|
]
|
|
380
346
|
}),
|
|
381
|
-
|
|
347
|
+
B()
|
|
382
348
|
]
|
|
383
349
|
}),
|
|
384
|
-
e.authenticationType === s.ApiKey && /* @__PURE__ */
|
|
350
|
+
e.authenticationType === s.ApiKey && /* @__PURE__ */ R("div", {
|
|
385
351
|
className: "flex flex-col gap-3 pt-2",
|
|
386
352
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ R("div", {
|
|
388
354
|
className: "flex flex-col gap-2",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ L(N, {
|
|
390
356
|
name: "apikey-login-mode",
|
|
391
357
|
id: "apikey-with-login",
|
|
392
358
|
value: l.WithLogin,
|
|
393
359
|
labelProps: { label: _?.withLoginLabel ?? "With login" },
|
|
394
360
|
isSelected: e.withLogin === l.WithLogin,
|
|
395
361
|
disabled: S,
|
|
396
|
-
onChange:
|
|
397
|
-
}), /* @__PURE__ */
|
|
362
|
+
onChange: D
|
|
363
|
+
}), /* @__PURE__ */ L(N, {
|
|
398
364
|
name: "apikey-login-mode",
|
|
399
365
|
id: "apikey-without-login",
|
|
400
366
|
value: l.WithoutLogin,
|
|
401
367
|
labelProps: { label: _?.withoutLoginLabel ?? "Without login" },
|
|
402
368
|
isSelected: e.withLogin === l.WithoutLogin,
|
|
403
369
|
disabled: S,
|
|
404
|
-
onChange:
|
|
370
|
+
onChange: D
|
|
405
371
|
})]
|
|
406
372
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ R("div", {
|
|
408
374
|
className: "flex flex-col gap-3",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ L(j, {
|
|
410
376
|
id: "toolset-key-header",
|
|
411
377
|
value: e.keyHeader ?? "",
|
|
412
|
-
onChange: (e) =>
|
|
378
|
+
onChange: (e) => h({ keyHeader: e ?? "" }),
|
|
413
379
|
labelProps: {
|
|
414
380
|
label: _?.keyHeaderLabel ?? "API Key parameter name",
|
|
415
381
|
required: !0
|
|
@@ -418,10 +384,10 @@ var I = {
|
|
|
418
384
|
error: t.keyHeader || void 0,
|
|
419
385
|
invalid: !!t.keyHeader,
|
|
420
386
|
disabled: S
|
|
421
|
-
}), e.withLogin === l.WithLogin && /* @__PURE__ */
|
|
387
|
+
}), e.withLogin === l.WithLogin && /* @__PURE__ */ L(ie, {
|
|
422
388
|
id: "toolset-api-key",
|
|
423
389
|
value: e.apiKey ?? "",
|
|
424
|
-
onChange: (e) =>
|
|
390
|
+
onChange: (e) => h({ apiKey: e ?? "" }),
|
|
425
391
|
labelProps: {
|
|
426
392
|
label: _?.apiKeyLabel ?? "API key",
|
|
427
393
|
required: !0
|
|
@@ -434,46 +400,46 @@ var I = {
|
|
|
434
400
|
disabled: S
|
|
435
401
|
})]
|
|
436
402
|
}),
|
|
437
|
-
e.withLogin !== l.WithoutLogin &&
|
|
403
|
+
e.withLogin !== l.WithoutLogin && B()
|
|
438
404
|
]
|
|
439
405
|
}),
|
|
440
|
-
b && /* @__PURE__ */
|
|
406
|
+
b && /* @__PURE__ */ L(O, {
|
|
441
407
|
open: b,
|
|
442
408
|
header: _?.logoutConfirmTitle ?? "Log out?",
|
|
443
409
|
description: _?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
|
|
444
410
|
confirmLabel: _?.logOutLabel ?? "Log out",
|
|
445
411
|
cancelLabel: _?.cancelLabel ?? "Cancel",
|
|
446
|
-
variant:
|
|
412
|
+
variant: re.Danger,
|
|
447
413
|
isLoading: v,
|
|
448
414
|
disableConfirmButton: v,
|
|
449
|
-
onConfirm:
|
|
415
|
+
onConfirm: z,
|
|
450
416
|
onCancel: () => x(!1),
|
|
451
417
|
onClose: () => x(!1)
|
|
452
418
|
})
|
|
453
419
|
]
|
|
454
420
|
});
|
|
455
|
-
},
|
|
456
|
-
let { isCopied: r, copy: i } =
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
className:
|
|
421
|
+
}, $ = y(({ url: e, className: t, labels: n }) => {
|
|
422
|
+
let { isCopied: r, copy: i } = _(e), a = n?.copiedLabel ?? "Copied!";
|
|
423
|
+
return /* @__PURE__ */ R("div", {
|
|
424
|
+
className: g("flex flex-col gap-3", t),
|
|
459
425
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ R("div", {
|
|
461
427
|
className: "flex flex-col gap-1",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ L("p", {
|
|
463
429
|
className: "dial-body-semi-text text-start text-primary",
|
|
464
430
|
children: n?.title ?? "Connect toolset"
|
|
465
|
-
}), /* @__PURE__ */
|
|
431
|
+
}), /* @__PURE__ */ L("p", {
|
|
466
432
|
className: "dial-small-text text-start text-secondary",
|
|
467
433
|
children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
|
|
468
434
|
})]
|
|
469
435
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ L(d, {
|
|
471
437
|
copiedLabel: a,
|
|
472
438
|
copyLabel: n?.copyLabel ?? "Copy URL",
|
|
473
439
|
isCopied: r,
|
|
474
440
|
onClick: i
|
|
475
441
|
}) }),
|
|
476
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ L("span", {
|
|
477
443
|
role: "status",
|
|
478
444
|
"aria-live": "polite",
|
|
479
445
|
className: "sr-only",
|
|
@@ -481,16 +447,16 @@ var I = {
|
|
|
481
447
|
})
|
|
482
448
|
]
|
|
483
449
|
});
|
|
484
|
-
}),
|
|
485
|
-
let [g, _] = w(null), v = !!a && !!r, y =
|
|
486
|
-
value:
|
|
450
|
+
}), me = ({ 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: h }) => {
|
|
451
|
+
let [g, _] = w(null), v = !!a && !!r, y = S(() => [{
|
|
452
|
+
value: B.Http,
|
|
487
453
|
label: "HTTP"
|
|
488
454
|
}, {
|
|
489
|
-
value:
|
|
455
|
+
value: B.Sse,
|
|
490
456
|
label: "SSE"
|
|
491
457
|
}], []);
|
|
492
|
-
return
|
|
493
|
-
if (!r || !o || !
|
|
458
|
+
return x(() => {
|
|
459
|
+
if (!r || !o || !J(e.auth, i)) {
|
|
494
460
|
_(null);
|
|
495
461
|
return;
|
|
496
462
|
}
|
|
@@ -511,25 +477,25 @@ var I = {
|
|
|
511
477
|
e.auth,
|
|
512
478
|
e.endpoint,
|
|
513
479
|
o
|
|
514
|
-
]), /* @__PURE__ */
|
|
480
|
+
]), /* @__PURE__ */ R("div", {
|
|
515
481
|
className: "flex max-w-[1060px] flex-col gap-4",
|
|
516
482
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ L(j, {
|
|
518
484
|
id: "toolset-endpoint",
|
|
519
485
|
value: e.endpoint,
|
|
520
486
|
onChange: (e) => d({ endpoint: e ?? "" }),
|
|
521
487
|
labelProps: {
|
|
522
|
-
label:
|
|
488
|
+
label: h?.endpointLabel ?? "Endpoint",
|
|
523
489
|
required: !0
|
|
524
490
|
},
|
|
525
|
-
placeholder:
|
|
526
|
-
caption:
|
|
491
|
+
placeholder: h?.endpointPlaceholder ?? "https://...",
|
|
492
|
+
caption: h?.endpointCaption ?? "The HTTPS address where the server accepts MCP requests. Choose the transport under Protocol below.",
|
|
527
493
|
error: t.endpoint || void 0,
|
|
528
494
|
invalid: !!t.endpoint
|
|
529
495
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ L(P, {
|
|
531
497
|
labelProps: {
|
|
532
|
-
label:
|
|
498
|
+
label: h?.protocolLabel ?? "Protocol",
|
|
533
499
|
required: !0
|
|
534
500
|
},
|
|
535
501
|
id: "toolset-protocol",
|
|
@@ -539,28 +505,28 @@ var I = {
|
|
|
539
505
|
d({ protocol: e });
|
|
540
506
|
}
|
|
541
507
|
}),
|
|
542
|
-
g ? /* @__PURE__ */
|
|
508
|
+
g ? /* @__PURE__ */ L(ae, {
|
|
543
509
|
id: "toolset-allowed-tools",
|
|
544
510
|
multiple: !0,
|
|
545
511
|
searchable: !0,
|
|
546
512
|
selectAll: !0,
|
|
547
|
-
labelProps: { label:
|
|
548
|
-
placeholder:
|
|
513
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
514
|
+
placeholder: h?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
|
|
549
515
|
options: g.map((e) => ({
|
|
550
516
|
value: e,
|
|
551
517
|
label: e
|
|
552
518
|
})),
|
|
553
519
|
value: e.allowedTools,
|
|
554
520
|
onChange: (e) => d({ allowedTools: e })
|
|
555
|
-
}) : /* @__PURE__ */
|
|
521
|
+
}) : /* @__PURE__ */ L(I, {
|
|
556
522
|
id: "toolset-allowed-tools",
|
|
557
|
-
labelProps: { label:
|
|
558
|
-
placeholder:
|
|
523
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
524
|
+
placeholder: h?.allowedToolsPlaceholder ?? "Add tools, comma separated",
|
|
559
525
|
value: e.allowedTools,
|
|
560
526
|
onChange: (e) => d({ allowedTools: e }),
|
|
561
|
-
tagClassName:
|
|
527
|
+
tagClassName: m
|
|
562
528
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ L(Q, {
|
|
564
530
|
auth: e.auth,
|
|
565
531
|
errors: t,
|
|
566
532
|
isSaving: n,
|
|
@@ -573,65 +539,65 @@ var I = {
|
|
|
573
539
|
onNotifyError: u,
|
|
574
540
|
onAuthChange: f,
|
|
575
541
|
onEnsureSaved: p,
|
|
576
|
-
labels:
|
|
542
|
+
labels: h?.auth
|
|
577
543
|
}),
|
|
578
|
-
v && /* @__PURE__ */
|
|
544
|
+
v && /* @__PURE__ */ L($, {
|
|
579
545
|
url: a ?? "",
|
|
580
|
-
labels:
|
|
546
|
+
labels: h?.connect,
|
|
581
547
|
className: "border-t border-tertiary pt-4"
|
|
582
548
|
})
|
|
583
549
|
]
|
|
584
550
|
});
|
|
585
|
-
},
|
|
551
|
+
}, he = [
|
|
586
552
|
"keyHeader",
|
|
587
553
|
"apiKey",
|
|
588
554
|
"clientId",
|
|
589
555
|
"clientSecret",
|
|
590
556
|
"authorizationEndpoint",
|
|
591
557
|
"tokenEndpoint"
|
|
592
|
-
],
|
|
558
|
+
], ge = ["endpoint", ...he], _e = new Set(ge), ve = { validateVersionPattern: !0 }, ye = (e) => {
|
|
593
559
|
let t = {};
|
|
594
|
-
for (let n of Object.keys(e))
|
|
560
|
+
for (let n of Object.keys(e)) _e.has(n) && (t[n] = !0);
|
|
595
561
|
return t;
|
|
596
|
-
},
|
|
597
|
-
let
|
|
562
|
+
}, be = ({ initialForm: e, toolsetId: o, onPersist: c, onPostSaveLogin: d, onToolsetsChanged: m, onSaveSuccess: g, onSaveComplete: _, onBack: y, onDirtyChange: T, buildMcpUrl: E, listToolNames: D, authActions: ee, onOAuthLogin: te, onNotifySuccess: ne, onNotifyError: O, avatarPicker: re, availableLocaleOptions: k, onRefineDescription: A, labels: j }) => {
|
|
563
|
+
let M = !!o, [ie, N] = w(""), P = o || ie, [F, ae] = w({
|
|
598
564
|
initialForm: e,
|
|
599
565
|
key: 0
|
|
600
|
-
}), [
|
|
601
|
-
F.initialForm !== e && (
|
|
566
|
+
}), [I, R] = w(e);
|
|
567
|
+
F.initialForm !== e && (ae({
|
|
602
568
|
initialForm: e,
|
|
603
569
|
key: F.key + 1
|
|
604
|
-
}),
|
|
605
|
-
let
|
|
606
|
-
initialValues:
|
|
607
|
-
validationOptions:
|
|
570
|
+
}), R(e));
|
|
571
|
+
let B = S(() => ue(e), [e]), { values: V, setValues: H, markTouched: U, visibleErrorCodes: W, attemptSubmit: G } = a({
|
|
572
|
+
initialValues: B,
|
|
573
|
+
validationOptions: ve,
|
|
608
574
|
reseedKey: F.key
|
|
609
|
-
}), [
|
|
610
|
-
...
|
|
611
|
-
...
|
|
612
|
-
}), [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}, [
|
|
616
|
-
let [Y, X] = w(!1), [
|
|
617
|
-
|
|
618
|
-
|
|
575
|
+
}), [se, q] = w(e), J = S(() => ({
|
|
576
|
+
...se,
|
|
577
|
+
...V
|
|
578
|
+
}), [se, V]), le = S(() => JSON.stringify(J) !== JSON.stringify(I), [J, I]);
|
|
579
|
+
x(() => {
|
|
580
|
+
T?.(le);
|
|
581
|
+
}, [le, T]);
|
|
582
|
+
let [Y, X] = w(!1), [fe, Z] = w({}), [pe, Q] = w({}), $ = C(null);
|
|
583
|
+
x(() => {
|
|
584
|
+
q(e), $.current = e, Z({}), Q({}), N("");
|
|
619
585
|
}, [e]);
|
|
620
|
-
let
|
|
621
|
-
let { metadata: t, setup: n } =
|
|
622
|
-
Object.keys(t).length > 0 && (
|
|
586
|
+
let _e = b((e) => {
|
|
587
|
+
let { metadata: t, setup: n } = de(e);
|
|
588
|
+
Object.keys(t).length > 0 && (H(t), "name" in t && U(r.Name), "version" in t && U(r.Version)), Object.keys(n).length !== 0 && (q((e) => ({
|
|
623
589
|
...e,
|
|
624
590
|
...n
|
|
625
591
|
})), Q((e) => ({
|
|
626
592
|
...e,
|
|
627
|
-
...
|
|
593
|
+
...ye(n)
|
|
628
594
|
})), Z((e) => {
|
|
629
595
|
let t = { ...e };
|
|
630
596
|
for (let e of Object.keys(n)) delete t[e];
|
|
631
597
|
return t;
|
|
632
598
|
}));
|
|
633
|
-
}, [
|
|
634
|
-
|
|
599
|
+
}, [H, U]), be = b((e) => {
|
|
600
|
+
q((t) => ({
|
|
635
601
|
...t,
|
|
636
602
|
auth: {
|
|
637
603
|
...t.auth,
|
|
@@ -639,47 +605,47 @@ var I = {
|
|
|
639
605
|
}
|
|
640
606
|
})), Q((t) => ({
|
|
641
607
|
...t,
|
|
642
|
-
...
|
|
608
|
+
...ye(e)
|
|
643
609
|
})), Z((t) => {
|
|
644
610
|
let n = { ...t };
|
|
645
|
-
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of
|
|
611
|
+
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of he) delete n[e];
|
|
646
612
|
else for (let t of Object.keys(e)) delete n[t];
|
|
647
613
|
return n;
|
|
648
|
-
}), "isLoggedIn" in e &&
|
|
649
|
-
}, [
|
|
650
|
-
if (P && $.current != null && JSON.stringify($.current) === JSON.stringify(
|
|
614
|
+
}), "isLoggedIn" in e && m();
|
|
615
|
+
}, [m]), xe = b(async () => {
|
|
616
|
+
if (P && $.current != null && JSON.stringify($.current) === JSON.stringify(J)) return P;
|
|
651
617
|
X(!0);
|
|
652
618
|
try {
|
|
653
|
-
let e = await
|
|
654
|
-
return e ? (P ||
|
|
619
|
+
let e = await c(J, P);
|
|
620
|
+
return e ? (P || N(e), $.current = J, R(J), T?.(!1), await m(), e) : null;
|
|
655
621
|
} catch {
|
|
656
622
|
return null;
|
|
657
623
|
} finally {
|
|
658
624
|
X(!1);
|
|
659
625
|
}
|
|
660
626
|
}, [
|
|
661
|
-
|
|
627
|
+
J,
|
|
662
628
|
P,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
]),
|
|
667
|
-
let t =
|
|
668
|
-
return e.endpoint.trim() ?
|
|
669
|
-
}, [
|
|
670
|
-
let e = G(), t =
|
|
629
|
+
c,
|
|
630
|
+
m,
|
|
631
|
+
T
|
|
632
|
+
]), Se = b(async () => await xe() ?? !1, [xe]), Ce = b((e) => {
|
|
633
|
+
let t = j?.validation, n = {};
|
|
634
|
+
return e.endpoint.trim() ? K(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"), !M && !e.auth.clientSecret?.trim() && (n.clientSecret = t?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() ? K(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() ? K(e.auth.tokenEndpoint) || (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.tokenEndpoint = t?.tokenEndpointRequired ?? "Token endpoint is required")), n;
|
|
635
|
+
}, [j, M]), we = b(async () => {
|
|
636
|
+
let e = G(), t = Ce(J);
|
|
671
637
|
if (!e || Object.keys(t).length > 0) Z(t);
|
|
672
638
|
else {
|
|
673
639
|
Z({}), X(!0);
|
|
674
640
|
try {
|
|
675
|
-
let e = await
|
|
641
|
+
let e = await c(J, P);
|
|
676
642
|
if (!e) return;
|
|
677
|
-
|
|
643
|
+
R(J), await m(), g(J);
|
|
678
644
|
try {
|
|
679
|
-
await
|
|
645
|
+
await d(e, J.auth), _();
|
|
680
646
|
} catch (e) {
|
|
681
|
-
let { traceId: t } = await
|
|
682
|
-
|
|
647
|
+
let { traceId: t } = await u(e);
|
|
648
|
+
O(j?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
683
649
|
}
|
|
684
650
|
} catch {} finally {
|
|
685
651
|
X(!1);
|
|
@@ -687,94 +653,93 @@ var I = {
|
|
|
687
653
|
}
|
|
688
654
|
}, [
|
|
689
655
|
G,
|
|
690
|
-
|
|
691
|
-
|
|
656
|
+
J,
|
|
657
|
+
Ce,
|
|
692
658
|
P,
|
|
693
|
-
o,
|
|
694
|
-
u,
|
|
695
|
-
f,
|
|
696
|
-
h,
|
|
697
659
|
c,
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
660
|
+
m,
|
|
661
|
+
g,
|
|
662
|
+
_,
|
|
663
|
+
d,
|
|
664
|
+
O,
|
|
665
|
+
j
|
|
666
|
+
]), Te = v({
|
|
667
|
+
value: V.description,
|
|
668
|
+
onChange: (e) => _e({ description: e }),
|
|
669
|
+
onRefine: A,
|
|
704
670
|
disabled: Y,
|
|
705
671
|
resetKey: F.key
|
|
706
|
-
}),
|
|
672
|
+
}), Ee = A ? (e, t) => /* @__PURE__ */ L(h, {
|
|
707
673
|
isEnabled: !0,
|
|
708
674
|
fieldId: t,
|
|
709
|
-
label:
|
|
710
|
-
labels:
|
|
711
|
-
refinement:
|
|
712
|
-
disabled:
|
|
675
|
+
label: j?.general?.form?.description.label ?? "Description",
|
|
676
|
+
labels: j?.refinement,
|
|
677
|
+
refinement: Te,
|
|
678
|
+
disabled: Te.isPending || Y,
|
|
713
679
|
children: e
|
|
714
|
-
}) : void 0,
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
680
|
+
}) : void 0, De = S(() => ({
|
|
681
|
+
form: j?.general?.form ?? oe,
|
|
682
|
+
avatarPicker: j?.general?.avatarPicker
|
|
683
|
+
}), [j?.general?.form, j?.general?.avatarPicker]), Oe = S(() => !ce(J, M), [J, M]), ke = S(() => {
|
|
684
|
+
let e = j?.validation, n = Ce(J), r = { ...fe };
|
|
685
|
+
for (let e of ge) {
|
|
686
|
+
if (!pe[e]) continue;
|
|
718
687
|
let t = n[e];
|
|
719
688
|
t ? r[e] = t : delete r[e];
|
|
720
689
|
}
|
|
721
|
-
return W.name === t.Required ? r.name = e?.nameRequired ?? "Name is required" : W.name === t.TooLong ? r.name = e?.nameTooLong ?? `Use ${
|
|
690
|
+
return W.name === t.Required ? r.name = e?.nameRequired ?? "Name is required" : W.name === t.TooLong ? r.name = e?.nameTooLong ?? `Use ${p} 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 ${f} characters or fewer.`), W.version === t.InvalidFormat && (r.version = e?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), r;
|
|
722
691
|
}, [
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
692
|
+
pe,
|
|
693
|
+
fe,
|
|
694
|
+
J,
|
|
695
|
+
j,
|
|
727
696
|
W,
|
|
728
|
-
|
|
729
|
-
]),
|
|
730
|
-
return /* @__PURE__ */
|
|
731
|
-
title:
|
|
732
|
-
onBack:
|
|
733
|
-
onCancel:
|
|
734
|
-
onSubmit:
|
|
735
|
-
submitLabel:
|
|
697
|
+
Ce
|
|
698
|
+
]), Ae = E && P ? E(P) : void 0;
|
|
699
|
+
return /* @__PURE__ */ L(n, {
|
|
700
|
+
title: M ? j?.layout?.editTitle ?? "Edit toolset" : j?.layout?.createTitle ?? "Create toolset",
|
|
701
|
+
onBack: y,
|
|
702
|
+
onCancel: y,
|
|
703
|
+
onSubmit: we,
|
|
704
|
+
submitLabel: M ? j?.layout?.saveLabel ?? "Save" : j?.layout?.createLabel ?? "Create",
|
|
736
705
|
isSubmitting: Y,
|
|
737
|
-
isSubmitDisabled:
|
|
738
|
-
metadataSectionClassName:
|
|
739
|
-
setupSectionClassName:
|
|
706
|
+
isSubmitDisabled: Oe || Te.isPending,
|
|
707
|
+
metadataSectionClassName: z.metadataSection,
|
|
708
|
+
setupSectionClassName: z.setupSection,
|
|
740
709
|
labels: {
|
|
741
|
-
backAriaLabel:
|
|
742
|
-
savingStatusLabel:
|
|
743
|
-
metadataTitle:
|
|
744
|
-
setupTitle:
|
|
745
|
-
cancelLabel:
|
|
710
|
+
backAriaLabel: j?.layout?.backAriaLabel ?? "Back to catalog",
|
|
711
|
+
savingStatusLabel: j?.layout?.savingStatusLabel ?? "Saving",
|
|
712
|
+
metadataTitle: j?.layout?.metadataSectionTitle ?? "Metadata",
|
|
713
|
+
setupTitle: j?.layout?.setupSectionTitle ?? "Setup",
|
|
714
|
+
cancelLabel: j?.layout?.cancelLabel ?? "Cancel"
|
|
746
715
|
},
|
|
747
|
-
metadata: /* @__PURE__ */
|
|
748
|
-
|
|
749
|
-
errors:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
availableLocaleOptions: A,
|
|
756
|
-
onChange: Se,
|
|
757
|
-
renderDescription: ke,
|
|
758
|
-
labels: M?.general
|
|
716
|
+
metadata: /* @__PURE__ */ L(i, {
|
|
717
|
+
values: J,
|
|
718
|
+
errors: ke,
|
|
719
|
+
onChange: _e,
|
|
720
|
+
avatarPicker: re,
|
|
721
|
+
availableLocaleOptions: k,
|
|
722
|
+
renderDescription: Ee,
|
|
723
|
+
labels: De
|
|
759
724
|
}),
|
|
760
|
-
setup: /* @__PURE__ */
|
|
761
|
-
form:
|
|
762
|
-
errors:
|
|
725
|
+
setup: /* @__PURE__ */ L(me, {
|
|
726
|
+
form: J,
|
|
727
|
+
errors: ke,
|
|
763
728
|
isSaving: Y,
|
|
764
729
|
toolsetId: P,
|
|
765
|
-
isEditMode:
|
|
766
|
-
connectUrl:
|
|
767
|
-
listToolNames:
|
|
768
|
-
authActions:
|
|
769
|
-
onOAuthLogin:
|
|
770
|
-
onNotifySuccess:
|
|
771
|
-
onNotifyError:
|
|
772
|
-
onChange:
|
|
773
|
-
onAuthChange:
|
|
774
|
-
onEnsureSaved:
|
|
775
|
-
labels:
|
|
730
|
+
isEditMode: M,
|
|
731
|
+
connectUrl: Ae,
|
|
732
|
+
listToolNames: D,
|
|
733
|
+
authActions: ee,
|
|
734
|
+
onOAuthLogin: te,
|
|
735
|
+
onNotifySuccess: ne,
|
|
736
|
+
onNotifyError: O,
|
|
737
|
+
onChange: _e,
|
|
738
|
+
onAuthChange: be,
|
|
739
|
+
onEnsureSaved: Se,
|
|
740
|
+
labels: j?.settings
|
|
776
741
|
})
|
|
777
742
|
});
|
|
778
743
|
};
|
|
779
744
|
//#endregion
|
|
780
|
-
export {
|
|
745
|
+
export { H as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_VERSION, z as TOOLSET_EDITOR_CLASS, be as ToolsetEditor, Y as ToolsetOAuthLoginStatus, B as ToolsetTransportType, W as getDefaultToolsetForm, J as isToolsetAuthValid, ce as isToolsetFormValid, K as isValidEndpointUrl, q as normalizeReturnedEndpointUrl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AvatarPickerModalLabels, DeploymentCreationFormLabels } from '../../../builder-form/src/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Pre-translated labels for the general (metadata) form. Each group is
|
|
4
|
+
* optional and replaced as a whole; omitting one falls back to the library's
|
|
5
|
+
* English defaults.
|
|
6
|
+
* @deprecated Use `MetadataFormLabels` from `@epam/ai-dial-builder-form`.
|
|
7
|
+
*/
|
|
8
|
+
export interface GeneralFormLabels {
|
|
9
|
+
/** Labels for the embedded `DeploymentCreationForm` fields. */
|
|
10
|
+
form?: DeploymentCreationFormLabels;
|
|
11
|
+
/** Labels for the avatar picker modal. */
|
|
12
|
+
avatarPicker?: AvatarPickerModalLabels;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=general-form-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general-form-labels.d.ts","sourceRoot":"","sources":["../../src/models/general-form-labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeploymentCreationFormLocaleOption, MetadataFormAvatarPicker } from '../../../builder-form/src/index.ts';
|
|
2
2
|
import { TextRefinementCallback, TextRefinementLabels } from '../../../chat-shared/src/index.ts';
|
|
3
|
-
import {
|
|
4
|
-
import { GeneralFormLabels } from './general-form-props';
|
|
3
|
+
import { GeneralFormLabels } from './general-form-labels';
|
|
5
4
|
import { SettingsFormLabels } from './settings-form-props';
|
|
6
5
|
import { ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData } from './toolset-form';
|
|
7
6
|
import { ToolsetOAuthLoginHandler } from './toolset-oauth-login';
|
|
@@ -131,16 +130,8 @@ export interface ToolsetEditorProps {
|
|
|
131
130
|
onNotifySuccess: (message: string) => void;
|
|
132
131
|
/** Shows an error notification with the given message and optional trace id. */
|
|
133
132
|
onNotifyError: (message: string, requestId?: string) => void;
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/** Host file-manager modal rendered inside the avatar picker. */
|
|
137
|
-
FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
|
|
138
|
-
/** Resolves an icon URL into the previewable URL the form renders. */
|
|
139
|
-
resolveIconUrl: (url: string) => string;
|
|
140
|
-
/** MIME types the avatar picker accepts. */
|
|
141
|
-
allowedMimeTypes: string[];
|
|
142
|
-
/** Maximum avatar file size in bytes. */
|
|
143
|
-
maxFileSizeBytes: number;
|
|
133
|
+
/** Host wiring for the avatar picker: bucket, file manager, icon URL resolution, picked-file resolution and file limits. */
|
|
134
|
+
avatarPicker: MetadataFormAvatarPicker;
|
|
144
135
|
/** Locale options offered by the "Add locale" popup. */
|
|
145
136
|
availableLocaleOptions: DeploymentCreationFormLocaleOption[];
|
|
146
137
|
/** Optional Description rewrite callback; omission hides the Refine with AI action. */
|
|
@@ -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,
|
|
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.244",
|
|
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.244"
|
|
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.244",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.244",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { GeneralFormProps } from '../../models/general-form-props';
|
|
3
|
-
/**
|
|
4
|
-
* General (metadata) form shared by the Toolset and Custom App editors.
|
|
5
|
-
* @deprecated Render `MetadataForm` from `@epam/ai-dial-builder-form` and supply `avatarPicker.resolveAttachedIconUrl` instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare const GeneralForm: FC<GeneralFormProps>;
|
|
8
|
-
//# sourceMappingURL=GeneralForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralForm.d.ts","sourceRoot":"","sources":["../../../src/components/GeneralForm/GeneralForm.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAmCxE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqE5C,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AvatarPickerFileManagerModalProps, AvatarPickerModalLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
|
|
2
|
-
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { DeploymentGeneralFormData, ToolsetFormErrors } from './toolset-form';
|
|
4
|
-
/**
|
|
5
|
-
* Pre-translated labels for the general (metadata) form. Each group is
|
|
6
|
-
* optional and replaced as a whole; omitting one falls back to the library's
|
|
7
|
-
* English defaults.
|
|
8
|
-
* @deprecated Use `MetadataFormLabels` from `@epam/ai-dial-builder-form`.
|
|
9
|
-
*/
|
|
10
|
-
export interface GeneralFormLabels {
|
|
11
|
-
/** Labels for the embedded `DeploymentCreationForm` fields. */
|
|
12
|
-
form?: DeploymentCreationFormLabels;
|
|
13
|
-
/** Labels for the avatar picker modal. */
|
|
14
|
-
avatarPicker?: AvatarPickerModalLabels;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Props of the general (metadata) form shared by the Toolset and Custom App editors.
|
|
18
|
-
* @deprecated Use `MetadataFormProps` from `@epam/ai-dial-builder-form`.
|
|
19
|
-
*/
|
|
20
|
-
export interface GeneralFormProps {
|
|
21
|
-
/** Current general form values. */
|
|
22
|
-
form: DeploymentGeneralFormData;
|
|
23
|
-
/** Field error messages keyed by field name; only `name` and `version` are read. */
|
|
24
|
-
errors: ToolsetFormErrors;
|
|
25
|
-
/** Storage bucket whose files the avatar picker browses. */
|
|
26
|
-
bucket: string;
|
|
27
|
-
/** Host file-manager modal rendered inside the avatar picker. */
|
|
28
|
-
FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
|
|
29
|
-
/** Resolves an icon URL into the previewable URL the form renders. */
|
|
30
|
-
resolveIconUrl: (url: string) => string;
|
|
31
|
-
/** MIME types the avatar picker accepts. */
|
|
32
|
-
allowedMimeTypes: string[];
|
|
33
|
-
/** Maximum avatar file size in bytes. */
|
|
34
|
-
maxFileSizeBytes: number;
|
|
35
|
-
/** Locale options offered by the "Add locale" popup. */
|
|
36
|
-
availableLocaleOptions: DeploymentCreationFormLocaleOption[];
|
|
37
|
-
/** Called with the changed subset of general form values. */
|
|
38
|
-
onChange: (patch: Partial<DeploymentGeneralFormData>) => void;
|
|
39
|
-
/** Called when the Name field loses focus. */
|
|
40
|
-
onNameBlur?: () => void;
|
|
41
|
-
/** Called when the Version field loses focus. */
|
|
42
|
-
onVersionBlur?: () => void;
|
|
43
|
-
/** Wraps the Description textarea; see `MetadataFormProps.renderDescription`. */
|
|
44
|
-
renderDescription?: (textarea: ReactNode, fieldId: string) => ReactNode;
|
|
45
|
-
/** Pre-translated labels; each group falls back to English defaults. */
|
|
46
|
-
labels?: GeneralFormLabels;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=general-form-props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"general-form-props.d.ts","sourceRoot":"","sources":["../../src/models/general-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,IAAI,EAAE,yBAAyB,CAAC;IAChC,oFAAoF;IACpF,MAAM,EAAE,iBAAiB,CAAC;IAC1B,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,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;IAC9D,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC;IACxE,wEAAwE;IACxE,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
|