@epam/ai-dial-toolset-editor 1.1.0-dev.465

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.
Files changed (32) hide show
  1. package/components/AuthSection/AuthSection.d.ts +5 -0
  2. package/components/AuthSection/AuthSection.d.ts.map +1 -0
  3. package/components/ConnectMcpUrlContent/ConnectMcpUrlContent.d.ts +12 -0
  4. package/components/ConnectMcpUrlContent/ConnectMcpUrlContent.d.ts.map +1 -0
  5. package/components/GeneralForm/GeneralForm.d.ts +5 -0
  6. package/components/GeneralForm/GeneralForm.d.ts.map +1 -0
  7. package/components/SettingsForm/SettingsForm.d.ts +5 -0
  8. package/components/SettingsForm/SettingsForm.d.ts.map +1 -0
  9. package/components/ToolsetEditor/ToolsetEditor.d.ts +5 -0
  10. package/components/ToolsetEditor/ToolsetEditor.d.ts.map +1 -0
  11. package/constants/toolsets.d.ts +15 -0
  12. package/constants/toolsets.d.ts.map +1 -0
  13. package/index.d.ts +12 -0
  14. package/index.d.ts.map +1 -0
  15. package/index.js +741 -0
  16. package/models/auth-section-props.d.ts +110 -0
  17. package/models/auth-section-props.d.ts.map +1 -0
  18. package/models/general-form-props.d.ts +42 -0
  19. package/models/general-form-props.d.ts.map +1 -0
  20. package/models/settings-form-props.d.ts +79 -0
  21. package/models/settings-form-props.d.ts.map +1 -0
  22. package/models/toolset-editor-props.d.ts +134 -0
  23. package/models/toolset-editor-props.d.ts.map +1 -0
  24. package/models/toolset-form.d.ts +112 -0
  25. package/models/toolset-form.d.ts.map +1 -0
  26. package/models/toolset-oauth-login.d.ts +60 -0
  27. package/models/toolset-oauth-login.d.ts.map +1 -0
  28. package/package.json +31 -0
  29. package/test-setup.d.ts +1 -0
  30. package/test-setup.d.ts.map +1 -0
  31. package/utils/toolsets.d.ts +33 -0
  32. package/utils/toolsets.d.ts.map +1 -0
@@ -0,0 +1,110 @@
1
+ import { ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormErrors } from './toolset-form';
2
+ import { ToolsetOAuthLoginHandler } from './toolset-oauth-login';
3
+ /** Pre-translated labels for the auth block, all optional with English defaults. */
4
+ export interface AuthSectionLabels {
5
+ /** Heading of the authentication section. Defaults to `'Authentication'`. */
6
+ sectionTitle?: string;
7
+ /** Segment label for OAuth authentication. Defaults to `'OAuth'`. */
8
+ typeOAuth?: string;
9
+ /** Segment label for API-key authentication. Defaults to `'API Key'`. */
10
+ typeApiKey?: string;
11
+ /** Segment label for no authentication. Defaults to `'Open access'`. */
12
+ typeNone?: string;
13
+ /** Radio label for the API-key "with login" mode. Defaults to `'With login'`. */
14
+ withLoginLabel?: string;
15
+ /** Radio label for the API-key "without login" mode. Defaults to `'Without login'`. */
16
+ withoutLoginLabel?: string;
17
+ /** Radio label for the OAuth standard-login mode. Defaults to `'Standard login'`. */
18
+ withLoginOAuthLabel?: string;
19
+ /** Radio label for the OAuth custom-config mode. Defaults to `'Custom login'`. */
20
+ withConfigOAuthLabel?: string;
21
+ /** Text shown when no authentication is selected. Defaults to `'Open endpoint, no credentials'`. */
22
+ openAccessDescription?: string;
23
+ /** Label for the API key parameter name field. Defaults to `'API Key parameter name'`. */
24
+ keyHeaderLabel?: string;
25
+ /** Placeholder for the API key parameter name field. Defaults to `'Enter API key parameter name'`. */
26
+ keyHeaderPlaceholder?: string;
27
+ /** Label for the API key value field. Defaults to `'API key'`. */
28
+ apiKeyLabel?: string;
29
+ /** Placeholder for the API key value field. Defaults to `'Enter API key'`. */
30
+ apiKeyPlaceholder?: string;
31
+ /** Label for the OAuth client id field. Defaults to `'Client ID'`. */
32
+ clientIdLabel?: string;
33
+ /** Placeholder for the OAuth client id field. Defaults to `'Enter client ID'`. */
34
+ clientIdPlaceholder?: string;
35
+ /** Label for the OAuth client secret field. Defaults to `'Client secret'`. */
36
+ clientSecretLabel?: string;
37
+ /** Placeholder for the OAuth client secret field. Defaults to `'Enter client secret'`. */
38
+ clientSecretPlaceholder?: string;
39
+ /** Label for the OAuth authorization endpoint field. Defaults to `'Authorization endpoint'`. */
40
+ authorizationEndpointLabel?: string;
41
+ /** Placeholder for the OAuth authorization endpoint field. Defaults to `'Enter authorization endpoint'`. */
42
+ authorizationEndpointPlaceholder?: string;
43
+ /** Label for the OAuth token endpoint field. Defaults to `'Token endpoint'`. */
44
+ tokenEndpointLabel?: string;
45
+ /** Placeholder for the OAuth token endpoint field. Defaults to `'Enter token endpoint'`. */
46
+ tokenEndpointPlaceholder?: string;
47
+ /** Label for the OAuth scopes field. Defaults to `'Scopes'`. */
48
+ scopesLabel?: string;
49
+ /** Placeholder for the OAuth scopes field. Defaults to `'Enter scopes'`. */
50
+ scopesPlaceholder?: string;
51
+ /** Label for the log-in action. Defaults to `'Log in'`. */
52
+ logInLabel?: string;
53
+ /** Label for the log-out action. Defaults to `'Log out'`. */
54
+ logOutLabel?: string;
55
+ /** Label for the logout confirmation cancel action. Defaults to `'Cancel'`. */
56
+ cancelLabel?: string;
57
+ /** Success message shown after a login. Defaults to `'Successfully logged in.'`. */
58
+ loginSuccessMessage?: string;
59
+ /** Success message shown after a logout. Defaults to `'Successfully logged out.'`. */
60
+ logoutSuccessMessage?: string;
61
+ /** Title of the logout confirmation popup. Defaults to `'Log out?'`. */
62
+ logoutConfirmTitle?: string;
63
+ /** Body of the logout confirmation popup. Defaults to `'Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.'`. */
64
+ logoutConfirmDescription?: string;
65
+ /** Error message for a failed login. Defaults to `'Failed to log in. Please check your credentials and try again.'`. */
66
+ errorLoginFailed?: string;
67
+ /** Error message for a failed logout. Defaults to `'Failed to log out. Please try again.'`. */
68
+ errorLogoutFailed?: string;
69
+ /** Error message for a browser-blocked login popup. Defaults to `'The login popup was blocked by your browser. Please allow popups for this site and try again.'`. */
70
+ errorPopupBlocked?: string;
71
+ /** Error message for an unusable OAuth client configuration. Defaults to `'The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.'`. */
72
+ errorOAuthConfigMissing?: string;
73
+ }
74
+ /** Props of the internal authentication block of the Setup section. */
75
+ export interface AuthSectionProps {
76
+ /** Current auth form state. */
77
+ auth: ToolsetAuthFormData;
78
+ /** Field error messages keyed by field name; only the auth subset is read. */
79
+ errors: ToolsetFormErrors;
80
+ /** Whether the editor is currently saving. */
81
+ isSaving: boolean;
82
+ /** Persisted toolset id, or empty before the first save in create mode. */
83
+ toolsetId: string;
84
+ /** Whether an existing toolset is being edited. */
85
+ isEditMode: boolean;
86
+ /** Current MCP endpoint URL value, used to gate the log-in action. */
87
+ endpoint: string;
88
+ /** Backend calls for login/logout/auth-settings reads, injected by the host. */
89
+ authActions: ToolsetAuthActions;
90
+ /**
91
+ * Runs the host's OAuth login flow and reports how it settled. Called
92
+ * synchronously from the click so the host can open a popup inside the
93
+ * user gesture.
94
+ */
95
+ onOAuthLogin: ToolsetOAuthLoginHandler;
96
+ /** Shows a success notification with the given message. */
97
+ onNotifySuccess: (message: string) => void;
98
+ /** Shows an error notification with the given message and optional trace id. */
99
+ onNotifyError: (message: string, requestId?: string) => void;
100
+ /** Called with the changed subset of auth form state. */
101
+ onAuthChange: (patch: Partial<ToolsetAuthFormData>) => void;
102
+ /**
103
+ * Persists the form when it changed since the last save and resolves the
104
+ * toolset id, or `false` when persisting failed.
105
+ */
106
+ onEnsureSaved: () => Promise<string | false>;
107
+ /** Pre-translated labels, all optional with English defaults. */
108
+ labels?: AuthSectionLabels;
109
+ }
110
+ //# sourceMappingURL=auth-section-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-section-props.d.ts","sourceRoot":"","sources":["../../src/models/auth-section-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,M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AC;IAC5D;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAC7C,iEAAiE;IACjE,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
@@ -0,0 +1,42 @@
1
+ import { AvatarPickerFileManagerModalProps, AvatarPickerModalLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
2
+ import { ComponentType } 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
+ */
9
+ export interface GeneralFormLabels {
10
+ /** Labels for the embedded `DeploymentCreationForm` fields. */
11
+ form?: DeploymentCreationFormLabels;
12
+ /** Labels for the avatar picker modal. */
13
+ avatarPicker?: AvatarPickerModalLabels;
14
+ }
15
+ /** Props of the general (metadata) form shared by the Toolset and Custom App editors. */
16
+ export interface GeneralFormProps {
17
+ /** Current general form values. */
18
+ form: DeploymentGeneralFormData;
19
+ /** Field error messages keyed by field name; only `name` and `version` are read. */
20
+ errors: ToolsetFormErrors;
21
+ /** Storage bucket whose files the avatar picker browses. */
22
+ bucket: string;
23
+ /** Host file-manager modal rendered inside the avatar picker. */
24
+ FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
25
+ /** Resolves an icon URL into the previewable URL the form renders. */
26
+ resolveIconUrl: (url: string) => string;
27
+ /** MIME types the avatar picker accepts. */
28
+ allowedMimeTypes: string[];
29
+ /** Maximum avatar file size in bytes. */
30
+ maxFileSizeBytes: number;
31
+ /** Locale options offered by the "Add locale" popup. */
32
+ availableLocaleOptions: DeploymentCreationFormLocaleOption[];
33
+ /** Called with the changed subset of general form values. */
34
+ onChange: (patch: Partial<DeploymentGeneralFormData>) => void;
35
+ /** Called when the Name field loses focus. */
36
+ onNameBlur?: () => void;
37
+ /** Called when the Version field loses focus. */
38
+ onVersionBlur?: () => void;
39
+ /** Pre-translated labels; each group falls back to English defaults. */
40
+ labels?: GeneralFormLabels;
41
+ }
42
+ //# sourceMappingURL=general-form-props.d.ts.map
@@ -0,0 +1 @@
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,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED,yFAAyF;AACzF,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,wEAAwE;IACxE,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
@@ -0,0 +1,79 @@
1
+ import { AuthSectionLabels } from './auth-section-props';
2
+ import { ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData, ToolsetFormErrors } from './toolset-form';
3
+ import { ToolsetOAuthLoginHandler } from './toolset-oauth-login';
4
+ /** Pre-translated labels for the Connect section, all optional with English defaults. */
5
+ export interface ConnectMcpUrlContentLabels {
6
+ /** Section title. Defaults to `'Connect toolset'`. */
7
+ title?: string;
8
+ /** Section description. Defaults to `'Copy endpoint URL to easily integrate toolset into your workflows'`. */
9
+ description?: string;
10
+ /** Label for the copy action. Defaults to `'Copy URL'`. */
11
+ copyLabel?: string;
12
+ /** Transient feedback shown after copying. Defaults to `'Copied!'`. */
13
+ copiedLabel?: string;
14
+ }
15
+ /** Pre-translated labels for the Setup section, all optional with English defaults. */
16
+ export interface SettingsFormLabels {
17
+ /** Label for the endpoint field. Defaults to `'Endpoint'`. */
18
+ endpointLabel?: string;
19
+ /** Caption under the endpoint field. Defaults to `'The HTTPS address where the server accepts MCP requests.'`. */
20
+ endpointCaption?: string;
21
+ /** Placeholder for the endpoint field. Defaults to `'https://...'`. */
22
+ endpointPlaceholder?: string;
23
+ /** Label for the protocol radio group. Defaults to `'Protocol'`. */
24
+ protocolLabel?: string;
25
+ /** Label for the allowed tools field. Defaults to `'Allowed tools'`. */
26
+ allowedToolsLabel?: string;
27
+ /** Placeholder for the allowed tools tag input. Defaults to `'Add tools, comma separated'`. */
28
+ allowedToolsPlaceholder?: string;
29
+ /** Placeholder for the allowed tools select. Defaults to `'Select allowed tools'`. */
30
+ allowedToolsSelectPlaceholder?: string;
31
+ /** Labels threaded to the embedded Connect section. */
32
+ connect?: ConnectMcpUrlContentLabels;
33
+ /** Labels threaded to the embedded auth block. */
34
+ auth?: AuthSectionLabels;
35
+ }
36
+ /** Props of the internal Setup section form. */
37
+ export interface SettingsFormProps {
38
+ /** Current toolset form state. */
39
+ form: ToolsetFormData;
40
+ /** Field error messages keyed by field name. */
41
+ errors: ToolsetFormErrors;
42
+ /** Whether the editor is currently saving. */
43
+ isSaving: boolean;
44
+ /** Persisted toolset id, or empty before the first save in create mode. */
45
+ toolsetId: string;
46
+ /** Whether an existing toolset is being edited. */
47
+ isEditMode: boolean;
48
+ /**
49
+ * MCP endpoint URL to show in the Connect section, already resolved by the
50
+ * host from its external-core URL. Empty/omitted hides the section.
51
+ */
52
+ connectUrl?: string;
53
+ /**
54
+ * Resolves the tool names offered by the "Allowed tools" picker from the
55
+ * toolset's own MCP `tools/list`. When omitted or when it resolves to an
56
+ * empty list, the free-text tag input renders instead.
57
+ */
58
+ listToolNames?: (toolsetId: string) => Promise<string[]>;
59
+ /** Backend calls for login/logout/auth-settings reads, injected by the host. */
60
+ authActions: ToolsetAuthActions;
61
+ /** Runs the host's OAuth login flow and reports how it settled. */
62
+ onOAuthLogin: ToolsetOAuthLoginHandler;
63
+ /** Shows a success notification with the given message. */
64
+ onNotifySuccess: (message: string) => void;
65
+ /** Shows an error notification with the given message and optional trace id. */
66
+ onNotifyError: (message: string, requestId?: string) => void;
67
+ /** Called with the changed subset of toolset form state. */
68
+ onChange: (patch: Partial<ToolsetFormData>) => void;
69
+ /** Called with the changed subset of auth form state. */
70
+ onAuthChange: (patch: Partial<ToolsetAuthFormData>) => void;
71
+ /**
72
+ * Persists the form when it changed since the last save and resolves the
73
+ * toolset id, or `false` when persisting failed.
74
+ */
75
+ onEnsureSaved: () => Promise<string | false>;
76
+ /** Pre-translated labels, all optional with English defaults. */
77
+ labels?: SettingsFormLabels;
78
+ }
79
+ //# sourceMappingURL=settings-form-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-form-props.d.ts","sourceRoot":"","sources":["../../src/models/settings-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAi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B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,gFAAgF;IAChF,WAAW,EAAE,kBAAkB,CAAC;IAChC,mEAAmE;IACnE,YAAY,EAAE,wBAAwB,CAAC;IACvC,2DAA2D;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gFAAgF;IAChF,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACpD,yDAAyD;IACzD,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC5D;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAC7C,iEAAiE;IACjE,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B"}
@@ -0,0 +1,134 @@
1
+ import { AvatarPickerFileManagerModalProps, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
2
+ import { ComponentType } from 'react';
3
+ import { GeneralFormLabels } from './general-form-props';
4
+ import { SettingsFormLabels } from './settings-form-props';
5
+ import { ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData } from './toolset-form';
6
+ import { ToolsetOAuthLoginHandler } from './toolset-oauth-login';
7
+ /** Validation messages surfaced under the fields, all optional with English defaults. */
8
+ export interface ToolsetEditorValidationLabels {
9
+ /** Message for a missing name. Defaults to `'Name is required'`. */
10
+ nameRequired?: string;
11
+ /** Message for a malformed version. Defaults to `'Version may only contain letters, digits, dots, underscores, and dashes'`. */
12
+ versionInvalid?: string;
13
+ /** Message for a missing endpoint. Defaults to `'Endpoint is required'`. */
14
+ endpointRequired?: string;
15
+ /** Message for a malformed endpoint. Defaults to `'Enter a valid http(s) or sse URL'`. */
16
+ endpointInvalid?: string;
17
+ /** Message for a missing API key parameter name. Defaults to `'Key name is required'`. */
18
+ keyHeaderRequired?: string;
19
+ /** Message for a missing API key value. Defaults to `'API key is required'`. */
20
+ apiKeyRequired?: string;
21
+ /** Message for a missing OAuth client id. Defaults to `'Client ID is required'`. */
22
+ clientIdRequired?: string;
23
+ /** Message for a missing OAuth client secret in create mode. Defaults to `'Client secret is required'`. */
24
+ clientSecretRequired?: string;
25
+ }
26
+ /** Labels for the editor chrome (header, actions, section titles), all optional with English defaults. */
27
+ export interface ToolsetEditorLayoutLabels {
28
+ /** Header title in create mode. Defaults to `'Create toolset'`. */
29
+ createTitle?: string;
30
+ /** Header title in edit mode. Defaults to `'Edit toolset'`. */
31
+ editTitle?: string;
32
+ /** Accessible name of the header back button. Defaults to `'Back to catalog'`. */
33
+ backAriaLabel?: string;
34
+ /** Saving status text shown in the header. Defaults to `'Saving'`. */
35
+ savingStatusLabel?: string;
36
+ /** Title of the Metadata (general) section. Defaults to `'Metadata'`. */
37
+ metadataSectionTitle?: string;
38
+ /** Title of the Setup section. Defaults to `'Setup'`. */
39
+ setupSectionTitle?: string;
40
+ /** Label of the cancel action. Defaults to `'Cancel'`. */
41
+ cancelLabel?: string;
42
+ /** Label of the save action in edit mode. Defaults to `'Save'`. */
43
+ saveLabel?: string;
44
+ /** Label of the save action in create mode. Defaults to `'Create'`. */
45
+ createLabel?: string;
46
+ }
47
+ /**
48
+ * Pre-translated labels for the whole editor. Each group is optional and
49
+ * replaced as a whole; omitting one falls back to the library's English
50
+ * defaults.
51
+ */
52
+ export interface ToolsetEditorLabels {
53
+ /** Header/action/section labels. */
54
+ layout?: ToolsetEditorLayoutLabels;
55
+ /** Labels threaded to the embedded general (metadata) form. */
56
+ general?: GeneralFormLabels;
57
+ /** Labels threaded to the embedded Setup section form. */
58
+ settings?: SettingsFormLabels;
59
+ /** Validation messages keyed by field. */
60
+ validation?: ToolsetEditorValidationLabels;
61
+ }
62
+ /** Props of the composed Toolset editor. */
63
+ export interface ToolsetEditorProps {
64
+ /**
65
+ * Initial form state, loaded by the host. The editor re-seeds its internal
66
+ * state (form, errors, dirty fields, draft id) whenever this prop's
67
+ * identity changes, so the host must memoize it per loaded entity.
68
+ */
69
+ initialForm: ToolsetFormData;
70
+ /** Toolset id from the host route; empty in create mode. */
71
+ toolsetId: string;
72
+ /**
73
+ * Persists the form — creating the toolset when `toolsetId` is empty,
74
+ * updating it otherwise. The host owns the request mapping and its own
75
+ * failure notification; resolves the persisted toolset id, or `null` when
76
+ * the request failed.
77
+ */
78
+ onPersist: (form: ToolsetFormData, toolsetId: string) => Promise<string | null>;
79
+ /**
80
+ * Runs the post-save automatic login for an API-key toolset configured
81
+ * "With login". Rejections are surfaced by the editor as a login failure
82
+ * without blocking navigation-independent state.
83
+ */
84
+ onPostSaveLogin: (toolsetId: string, auth: ToolsetAuthFormData) => Promise<void>;
85
+ /**
86
+ * Re-syncs the host's shared toolset list. Called after every successful
87
+ * persist and whenever the logged-in status changes.
88
+ */
89
+ onToolsetsChanged: () => Promise<void> | void;
90
+ /**
91
+ * Called with the saved form once persistence succeeded, before the
92
+ * post-save login attempt — the host raises its success toast here.
93
+ */
94
+ onSaveSuccess: (form: ToolsetFormData) => void;
95
+ /** Called after the save and the post-save login both succeeded — the host navigates away. */
96
+ onSaveComplete: () => void;
97
+ /** Called for the Cancel button and the header back action. */
98
+ onBack: () => void;
99
+ /**
100
+ * Builds the MCP endpoint URL shown in the Connect section for a toolset
101
+ * id. Omit when the host has no external core URL configured — the
102
+ * section stays hidden.
103
+ */
104
+ buildMcpUrl?: (toolsetId: string) => string;
105
+ /**
106
+ * Resolves the tool names offered by the "Allowed tools" picker from the
107
+ * toolset's own MCP `tools/list`. When omitted, the free-text tag input
108
+ * renders instead.
109
+ */
110
+ listToolNames?: (toolsetId: string) => Promise<string[]>;
111
+ /** Backend calls for login/logout/auth-settings reads, injected by the host. */
112
+ authActions: ToolsetAuthActions;
113
+ /** Runs the host's OAuth login flow and reports how it settled. */
114
+ onOAuthLogin: ToolsetOAuthLoginHandler;
115
+ /** Shows a success notification with the given message. */
116
+ onNotifySuccess: (message: string) => void;
117
+ /** Shows an error notification with the given message and optional trace id. */
118
+ onNotifyError: (message: string, requestId?: string) => void;
119
+ /** Storage bucket whose files the avatar picker browses. */
120
+ bucket: string;
121
+ /** Host file-manager modal rendered inside the avatar picker. */
122
+ FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
123
+ /** Resolves an icon URL into the previewable URL the form renders. */
124
+ resolveIconUrl: (url: string) => string;
125
+ /** MIME types the avatar picker accepts. */
126
+ allowedMimeTypes: string[];
127
+ /** Maximum avatar file size in bytes. */
128
+ maxFileSizeBytes: number;
129
+ /** Locale options offered by the "Add locale" popup. */
130
+ availableLocaleOptions: DeploymentCreationFormLocaleOption[];
131
+ /** Pre-translated labels; each group falls back to English defaults. */
132
+ labels?: ToolsetEditorLabels;
133
+ }
134
+ //# sourceMappingURL=toolset-editor-props.d.ts.map
@@ -0,0 +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,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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AAsE;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,wEAAwE;IACxE,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
@@ -0,0 +1,112 @@
1
+ import { DeploymentCreationFormLocaleEntry } from '../../../builder-form/src/index.ts';
2
+ import { ToolsetAuthTypes, ToolsetCredentialsLevel, WithLogin } from '../../../chat-hooks/src/index.ts';
3
+ import { ToolsetTransportType } from '../constants/toolsets';
4
+ export interface ToolsetAuthFormData {
5
+ /** Selected authentication mechanism for the toolset. */
6
+ authenticationType: ToolsetAuthTypes;
7
+ /** Whether credentials are sent per login, embedded in the config, or not at all. */
8
+ withLogin: WithLogin;
9
+ /** Whether the user is currently authenticated against the toolset. */
10
+ isLoggedIn: boolean;
11
+ /** API_KEY: header/parameter name the API key is sent under. */
12
+ keyHeader?: string;
13
+ /** API_KEY: the key value, submitted on login. */
14
+ apiKey?: string;
15
+ /** OAUTH: registered client id. */
16
+ clientId?: string;
17
+ /** OAUTH: client secret, never returned by the backend on read. */
18
+ clientSecret?: string;
19
+ /** OAUTH: authorization endpoint URL. */
20
+ authorizationEndpoint?: string;
21
+ /** OAUTH: token endpoint URL. */
22
+ tokenEndpoint?: string;
23
+ /** OAUTH: scopes requested during login. */
24
+ scopes?: string[];
25
+ /** OAUTH: PKCE code challenge value, when the backend supplied one. */
26
+ codeChallenge?: string;
27
+ /** OAUTH: PKCE code challenge method, when the backend supplied one. */
28
+ codeChallengeMethod?: string;
29
+ }
30
+ export interface DeploymentGeneralFormData {
31
+ /** Display name of the entity in its primary locale. */
32
+ name: string;
33
+ /** Display version of the entity. */
34
+ version: string;
35
+ /** URL of the entity's avatar image, or empty for the placeholder. */
36
+ iconUrl: string;
37
+ /** Description of the entity in its primary locale. */
38
+ description: string;
39
+ /** Topic tags describing the entity. */
40
+ topics: string[];
41
+ /** Additional (non-primary) locale entries for name/description, edited via the "Add locale" popup. */
42
+ otherLocales: DeploymentCreationFormLocaleEntry[];
43
+ }
44
+ export interface ToolsetFormData extends DeploymentGeneralFormData {
45
+ /** MCP server endpoint URL. */
46
+ endpoint: string;
47
+ /** MCP transport protocol used to reach the endpoint. */
48
+ protocol: ToolsetTransportType;
49
+ /** Tool names the toolset is restricted to, or empty for all tools. */
50
+ allowedTools: string[];
51
+ /** Backend-assigned immutable reference, present only in edit mode. */
52
+ reference?: string;
53
+ /** Authentication form state for the toolset. */
54
+ auth: ToolsetAuthFormData;
55
+ }
56
+ export interface ToolsetFormErrors {
57
+ /** Validation message for the Metadata name field. */
58
+ name?: string;
59
+ /** Validation message for the Metadata version field. */
60
+ version?: string;
61
+ /** Validation message for the Setup endpoint field. */
62
+ endpoint?: string;
63
+ /** Validation message for the API-key header field. */
64
+ keyHeader?: string;
65
+ /** Validation message for the API-key value field. */
66
+ apiKey?: string;
67
+ /** Validation message for the OAuth client id field. */
68
+ clientId?: string;
69
+ /** Validation message for the OAuth client secret field. */
70
+ clientSecret?: string;
71
+ /** Validation message for the OAuth authorization endpoint field. */
72
+ authorizationEndpoint?: string;
73
+ /** Validation message for the OAuth token endpoint field. */
74
+ tokenEndpoint?: string;
75
+ }
76
+ /**
77
+ * Credentials submission for one toolset login. Structurally identical to
78
+ * DIAL Core's login body; the host adapter forwards it to its own API client.
79
+ */
80
+ export interface ToolsetLoginRequest {
81
+ /** Already-encoded toolset id/url the credentials apply to. */
82
+ url: string;
83
+ /** Credentials level the submitted credentials apply to. */
84
+ credentialsLevel: ToolsetCredentialsLevel;
85
+ /** Authentication mechanism the toolset requires. */
86
+ authenticationType: ToolsetAuthTypes;
87
+ /** API key value, required for `ToolsetAuthTypes.ApiKey` logins. */
88
+ apiKey?: string;
89
+ }
90
+ /**
91
+ * Credential-clearing request for one toolset logout. Structurally identical
92
+ * to DIAL Core's logout body; the host adapter forwards it to its own API
93
+ * client.
94
+ */
95
+ export interface ToolsetLogoutRequest {
96
+ /** Already-encoded toolset id/url the credentials apply to. */
97
+ url: string;
98
+ /** Credentials level being logged out. */
99
+ credentialsLevel: ToolsetCredentialsLevel;
100
+ /** Authentication mechanism the toolset uses. */
101
+ authenticationType: ToolsetAuthTypes;
102
+ }
103
+ /** Backend calls the auth block needs, injected by the host. */
104
+ export interface ToolsetAuthActions {
105
+ /** Submits credentials for one toolset at one credentials level. */
106
+ login: (toolsetId: string, body: ToolsetLoginRequest) => Promise<unknown>;
107
+ /** Clears stored credentials for one toolset at one credentials level. */
108
+ logout: (toolsetId: string, body: ToolsetLogoutRequest) => Promise<unknown>;
109
+ /** Re-reads a toolset's stored auth settings, mapped into auth form state. */
110
+ fetchAuthSettings: (toolsetId: string) => Promise<ToolsetAuthFormData>;
111
+ }
112
+ //# sourceMappingURL=toolset-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolset-form.d.ts","sourceRoot":"","sources":["../../src/models/toolset-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,qFAAqF;IACrF,SAAS,EAAE,SAAS,CAAC;IACrB,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IACpB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IACl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C,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,qDAAqD;IACrD,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,iDAAiD;IACjD,kBAAkB,EAAE,gBAAgB,CAAC;CACtC;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1E,0EAA0E;IAC1E,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5E,8EAA8E;IAC9E,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACxE"}
@@ -0,0 +1,60 @@
1
+ import { ToolsetAuthFormData } from './toolset-form';
2
+ /**
3
+ * Outcome of the host's OAuth login flow, as this library understands it.
4
+ *
5
+ * The library never learns *how* the host logged the user in — popups,
6
+ * redirect coordination, channels, storage, callback routes and credential
7
+ * levels all stay on the host side. It only needs to know which of these
8
+ * five things happened so it can pick the right notification and update the
9
+ * form.
10
+ */
11
+ export declare enum ToolsetOAuthLoginStatus {
12
+ /** The user is logged in; the form switches to its logged-in state. */
13
+ Success = "success",
14
+ /**
15
+ * The user (or the host) abandoned the flow — a closed popup, an
16
+ * abandoned save. Deliberately silent: nothing failed.
17
+ */
18
+ Cancelled = "cancelled",
19
+ /** The browser blocked the login popup before the flow could start. */
20
+ PopupBlocked = "popup-blocked",
21
+ /** The provider returned no usable client configuration to authorize against. */
22
+ InvalidConfig = "invalid-config",
23
+ /** The flow started but did not produce a session. */
24
+ Failed = "failed"
25
+ }
26
+ /** What the host reports back once its OAuth login flow settles. */
27
+ export interface ToolsetOAuthLoginResult {
28
+ /** Which of the five outcomes the flow reached. */
29
+ status: ToolsetOAuthLoginStatus;
30
+ /**
31
+ * Auth fields the host resolved while running the flow, merged into the
32
+ * form before the status is applied. Dynamic client registration assigns
33
+ * `clientId`/`authorizationEndpoint` only once the toolset exists, so the
34
+ * host is the first to see them.
35
+ */
36
+ auth?: Partial<ToolsetAuthFormData>;
37
+ /** Trace id of the failed request, shown alongside an error notification. */
38
+ traceId?: string;
39
+ }
40
+ /** What this library hands the host when the user asks to log in with OAuth. */
41
+ export interface ToolsetOAuthLoginRequest {
42
+ /** Current auth form state, including any unsaved edits. */
43
+ auth: ToolsetAuthFormData;
44
+ /**
45
+ * Persists the form when it changed since the last save and resolves the
46
+ * toolset id, or `false` when persisting failed or was abandoned. The host
47
+ * must call this before authorizing: an unsaved toolset has no id to
48
+ * attach credentials to.
49
+ */
50
+ ensureSaved: () => Promise<string | false>;
51
+ }
52
+ /**
53
+ * Runs the host's OAuth login flow.
54
+ *
55
+ * Invoked synchronously from the user's click, before any `await`, so the
56
+ * host can open a popup inside the user gesture — browsers block one opened
57
+ * after the first suspension point.
58
+ */
59
+ export type ToolsetOAuthLoginHandler = (request: ToolsetOAuthLoginRequest) => Promise<ToolsetOAuthLoginResult>;
60
+ //# sourceMappingURL=toolset-oauth-login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolset-oauth-login.d.ts","sourceRoot":"","sources":["../../src/models/toolset-oauth-login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;;;;GAQG;AACH,oBAAY,uBAAuB;IACjC,uEAAuE;IACvE,OAAO,YAAY;IACnB;;;OAGG;IACH,SAAS,cAAc;IACvB,uEAAuE;IACvE,YAAY,kBAAkB;IAC9B,iFAAiF;IACjF,aAAa,mBAAmB;IAChC,sDAAsD;IACtD,MAAM,WAAW;CAClB;AAED,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,MAAM,EAAE,uBAAuB,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,WAAW,wBAAwB;IACvC,4DAA4D;IAC5D,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@epam/ai-dial-toolset-editor",
3
+ "description": "Host-agnostic form for authoring and editing a DIAL MCP toolset",
4
+ "version": "1.1.0-dev.465",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./index.js",
8
+ "module": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ "./package.json": "./package.json",
12
+ ".": {
13
+ "types": "./index.d.ts",
14
+ "import": "./index.js",
15
+ "default": "./index.js"
16
+ }
17
+ },
18
+ "peerDependencies": {
19
+ "@epam/ai-dial-builder-form": "1.1.0-dev.465",
20
+ "@epam/ai-dial-chat-hooks": "1.1.0-dev.465",
21
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.465",
22
+ "@epam/ai-dial-ui-kit": "*",
23
+ "@tabler/icons-react": "^3.0.0",
24
+ "react": "^19.0.0"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/epam/ai-dial-chat.git",
29
+ "directory": "libs/toolset-editor"
30
+ }
31
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}