@epam/ai-dial-toolset-editor 1.2.0-dev.282 → 1.2.0-dev.285

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AuthSection.d.ts","sourceRoot":"","sources":["../../../src/components/AuthSection/AuthSection.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AAwCzC,uIAAuI;AACvI,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAob5C,CAAC"}
1
+ {"version":3,"file":"AuthSection.d.ts","sourceRoot":"","sources":["../../../src/components/AuthSection/AuthSection.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AA0BzC,uIAAuI;AACvI,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAob5C,CAAC"}
@@ -1 +1 @@
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,CAmE5C,CAAC"}
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 +1 @@
1
- {"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA4C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAqahD,CAAC"}
1
+ {"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA4C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6bhD,CAAC"}
package/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { DeploymentCreationFieldErrorCode as e, EntityEditor as t, MetadataField as n, MetadataForm as r, SEMVER_VERSION_PATTERN as i, useMetadataForm as a, validateDeploymentCreationFields as o } from "@epam/ai-dial-builder-form";
2
2
  import { ToolsetAuthTypes as s, ToolsetCredentialsLevel as c, WithLogin as l, dialFileToAttachment as u, getApiErrorDetails as d } from "@epam/ai-dial-chat-hooks";
3
- import { CopyButton as f, ENTITY_DESCRIPTION_MAX_LENGTH as p, ENTITY_NAME_MAX_LENGTH as m, TAG_INPUT_TAG_CLASS_NAME as h, mergeClasses as g, useCodeCopy as _ } from "@epam/ai-dial-chat-shared";
4
- import { memo as v, useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
5
- import { IconBrandOauth as w, IconKey as ee, IconLockOff as T, IconLogin as E, IconLogout as te } from "@tabler/icons-react";
3
+ import { CopyButton as f, ENTITY_DESCRIPTION_MAX_LENGTH as p, ENTITY_NAME_MAX_LENGTH as m, TAG_INPUT_TAG_CLASS_NAME as h, TextRefinementField as g, mergeClasses as _, useCodeCopy as v, useTextRefinement as y } from "@epam/ai-dial-chat-shared";
4
+ import { memo as b, useCallback as x, useEffect as S, useMemo as C, useRef as ee, useState as w } from "react";
5
+ import { IconBrandOauth as T, IconKey as te, IconLockOff as ne, IconLogin as E, IconLogout as re } from "@tabler/icons-react";
6
6
  import { jsx as D, jsxs as O } from "react/jsx-runtime";
7
- import { ConfirmationPopup as ne, 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 { ConfirmationPopup as ie, ConfirmationPopupVariant as ae, DIAL_ICON_SIZE as k, DIAL_KIT_ICON_STROKE as A, Input as j, NeutralButton as M, PasswordInput as N, Radio as P, RadioGroup as F, SegmentedControl as I, Select as L, TagInput as oe } from "@epam/ai-dial-ui-kit";
8
8
  //#region src/constants/public-class-names.ts
9
- var L = {
9
+ var se = {
10
10
  metadataSection: "dial-toolset-editor-metadata-section",
11
11
  setupSection: "dial-toolset-editor-setup-section"
12
12
  }, R = /* @__PURE__ */ function(e) {
13
13
  return e.Http = "HTTP", e.Sse = "SSE", e;
14
- }({}), z = "New toolset", B = "1.0.0", oe = { validateVersionPattern: i }, V = {
15
- [s.OAuth]: w,
16
- [s.ApiKey]: ee,
17
- [s.None]: T
14
+ }({}), z = "New toolset", B = "1.0.0", ce = { validateVersionPattern: i }, V = {
15
+ [s.OAuth]: T,
16
+ [s.ApiKey]: te,
17
+ [s.None]: ne
18
18
  }, H = ({ defaultName: e = z, existingNames: t }) => {
19
19
  let n = new Set(t);
20
20
  if (!n.has(e)) return e;
21
21
  let r = 1;
22
22
  for (; n.has(`${e} ${r}`);) r += 1;
23
23
  return `${e} ${r}`;
24
- }, U = () => ({
24
+ }, le = () => ({
25
25
  authenticationType: s.None,
26
26
  withLogin: l.WithoutLogin,
27
27
  isLoggedIn: !1
28
- }), W = (e = []) => ({
28
+ }), U = (e = []) => ({
29
29
  name: H({ existingNames: e }),
30
30
  version: B,
31
31
  iconUrl: "",
@@ -35,49 +35,49 @@ var L = {
35
35
  endpoint: "",
36
36
  protocol: R.Http,
37
37
  allowedTools: [],
38
- auth: U()
39
- }), G = (e) => {
38
+ auth: le()
39
+ }), W = (e) => {
40
40
  if (!/^https?:\/\//.test(e) || e.endsWith(".") || e.endsWith("//")) return !1;
41
41
  try {
42
42
  return !!new URL(e);
43
43
  } catch {
44
44
  return !1;
45
45
  }
46
- }, K = (e) => G(e.trim()), q = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), se = (e) => {
46
+ }, G = (e) => W(e.trim()), K = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), q = (e) => {
47
47
  let t = e?.trim() ?? "";
48
- if (!t || G(t)) return t;
48
+ if (!t || W(t)) return t;
49
49
  let n = [t];
50
50
  try {
51
51
  let e = decodeURIComponent(t);
52
52
  e !== t && n.push(e);
53
53
  } catch {}
54
54
  for (let e of n) {
55
- let t = q(e);
56
- if (G(t)) return t;
55
+ let t = K(e);
56
+ if (W(t)) return t;
57
57
  }
58
58
  return t;
59
- }, J = (e) => !e?.trim() || K(e), Y = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === s.ApiKey ? e.keyHeader?.trim() ? e.withLogin === l.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === s.OAuth && e.withLogin === l.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && J(e.authorizationEndpoint) && J(e.tokenEndpoint) : !0, ce = (e, t = !1) => Object.keys(o(e, oe)).length === 0 && K(e.endpoint) && Y(e.auth, t), X = new Set([
59
+ }, J = (e) => !e?.trim() || G(e), Y = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === s.ApiKey ? e.keyHeader?.trim() ? e.withLogin === l.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === s.OAuth && e.withLogin === l.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && J(e.authorizationEndpoint) && J(e.tokenEndpoint) : !0, ue = (e, t = !1) => Object.keys(o(e, ce)).length === 0 && G(e.endpoint) && Y(e.auth, t), de = new Set([
60
60
  "name",
61
61
  "description",
62
62
  "iconUrl",
63
63
  "version",
64
64
  "topics",
65
65
  "otherLocales"
66
- ]), le = (e) => ({
66
+ ]), fe = (e) => ({
67
67
  name: e.name,
68
68
  description: e.description,
69
69
  iconUrl: e.iconUrl,
70
70
  version: e.version,
71
71
  topics: e.topics,
72
72
  otherLocales: e.otherLocales
73
- }), ue = (e) => {
73
+ }), pe = (e) => {
74
74
  let t = {}, n = {};
75
- for (let [r, i] of Object.entries(e)) (X.has(r) ? t : n)[r] = i;
75
+ for (let [r, i] of Object.entries(e)) (de.has(r) ? t : n)[r] = i;
76
76
  return {
77
77
  metadata: t,
78
78
  setup: n
79
79
  };
80
- }, Z = {
80
+ }, X = {
81
81
  name: {
82
82
  label: "Name",
83
83
  placeholder: "Enter name"
@@ -116,8 +116,8 @@ var L = {
116
116
  saveLabel: "Save"
117
117
  },
118
118
  ariaLabel: "General"
119
- }, de = ({ form: e, errors: t, bucket: n, FileManagerModal: i, resolveIconUrl: a, allowedMimeTypes: o, maxFileSizeBytes: s, availableLocaleOptions: c, onChange: l, onNameBlur: d, onVersionBlur: f, labels: p }) => {
120
- let m = y((e) => {
119
+ }, me = ({ form: e, errors: t, bucket: n, FileManagerModal: i, resolveIconUrl: a, allowedMimeTypes: o, maxFileSizeBytes: s, availableLocaleOptions: c, onChange: l, onNameBlur: d, onVersionBlur: f, renderDescription: p, labels: m }) => {
120
+ let h = x((e) => {
121
121
  let [t] = e.files;
122
122
  return (t ? u(t, n, { resolvePreviewUrl: a }) : null)?.url;
123
123
  }, [n, a]);
@@ -127,59 +127,60 @@ var L = {
127
127
  onChange: l,
128
128
  onNameBlur: d,
129
129
  onVersionBlur: f,
130
- avatarPicker: x(() => ({
130
+ avatarPicker: C(() => ({
131
131
  bucket: n,
132
132
  FileManagerModal: i,
133
133
  resolveIconUrl: a,
134
- resolveAttachedIconUrl: m,
134
+ resolveAttachedIconUrl: h,
135
135
  allowedMimeTypes: o,
136
136
  maxFileSizeBytes: s
137
137
  }), [
138
138
  n,
139
139
  i,
140
140
  a,
141
- m,
141
+ h,
142
142
  o,
143
143
  s
144
144
  ]),
145
145
  availableLocaleOptions: c,
146
- labels: x(() => ({
147
- form: p?.form ?? Z,
148
- avatarPicker: p?.avatarPicker
149
- }), [p?.form, p?.avatarPicker])
146
+ renderDescription: p,
147
+ labels: C(() => ({
148
+ form: m?.form ?? X,
149
+ avatarPicker: m?.avatarPicker
150
+ }), [m?.form, m?.avatarPicker])
150
151
  });
151
- }, Q = /* @__PURE__ */ function(e) {
152
+ }, Z = /* @__PURE__ */ function(e) {
152
153
  return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
153
- }({}), fe = (e, t) => e === s.None ? l.WithoutLogin : e === s.OAuth && !t ? l.WithConfig : l.WithLogin, pe = (e, t) => e === s.None ? t?.typeNone ?? "Open access" : e === s.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", me = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: u, onNotifySuccess: f, onNotifyError: p, onAuthChange: m, onEnsureSaved: g, labels: _ }) => {
154
- let [v, y] = C(!1), [b, x] = C(!1), S = e.isLoggedIn || n || v, w = K(a) && Y(e, i) && !S, ee = (t) => {
154
+ }({}), Q = (e) => e === s.None ? l.WithoutLogin : l.WithLogin, he = (e, t) => e === s.None ? t?.typeNone ?? "Open access" : e === s.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", ge = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: u, onNotifySuccess: f, onNotifyError: p, onAuthChange: m, onEnsureSaved: g, labels: _ }) => {
155
+ let [v, y] = w(!1), [b, x] = w(!1), S = e.isLoggedIn || n || v, C = G(a) && Y(e, i) && !S, ee = (t) => {
155
156
  S || t === e.authenticationType || m({
156
157
  authenticationType: t,
157
- withLogin: fe(t, !!e.clientId?.trim())
158
+ withLogin: Q(t)
158
159
  });
159
160
  }, T = (e) => {
160
161
  m({ withLogin: e });
161
- }, P = (e) => {
162
+ }, te = (e) => {
162
163
  switch (e.auth != null && m(e.auth), e.status) {
163
- case Q.Success:
164
+ case Z.Success:
164
165
  m({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
165
166
  return;
166
- case Q.PopupBlocked:
167
+ case Z.PopupBlocked:
167
168
  p(_?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
168
169
  return;
169
- case Q.InvalidConfig:
170
+ case Z.InvalidConfig:
170
171
  p(_?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
171
172
  return;
172
- case Q.Failed:
173
+ case Z.Failed:
173
174
  p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
174
175
  return;
175
- case Q.Cancelled: return;
176
+ case Z.Cancelled: return;
176
177
  }
177
- }, ae = async () => {
178
- if (!w) return;
178
+ }, ne = async () => {
179
+ if (!C) return;
179
180
  if (e.authenticationType === s.OAuth) {
180
181
  y(!0);
181
182
  try {
182
- P(await u({
183
+ te(await u({
183
184
  auth: e,
184
185
  ensureSaved: g
185
186
  }));
@@ -206,7 +207,7 @@ var L = {
206
207
  y(!1);
207
208
  }
208
209
  }
209
- }, L = async () => {
210
+ }, F = async () => {
210
211
  y(!0);
211
212
  try {
212
213
  let t = {
@@ -221,11 +222,11 @@ var L = {
221
222
  } finally {
222
223
  y(!1);
223
224
  }
224
- }, R = () => e.isLoggedIn ? /* @__PURE__ */ D("div", {
225
+ }, L = () => e.isLoggedIn ? /* @__PURE__ */ D("div", {
225
226
  className: "flex",
226
227
  children: /* @__PURE__ */ D(M, {
227
228
  label: _?.logOutLabel ?? "Log out",
228
- iconBefore: /* @__PURE__ */ D(te, {
229
+ iconBefore: /* @__PURE__ */ D(re, {
229
230
  size: k.MD,
230
231
  stroke: A
231
232
  }),
@@ -240,8 +241,8 @@ var L = {
240
241
  size: k.MD,
241
242
  stroke: A
242
243
  }),
243
- onClick: ae,
244
- disabled: !w
244
+ onClick: ne,
245
+ disabled: !C
245
246
  })
246
247
  });
247
248
  return /* @__PURE__ */ O("section", {
@@ -251,7 +252,7 @@ var L = {
251
252
  className: "dial-h3-text",
252
253
  children: _?.sectionTitle ?? "Authentication"
253
254
  }),
254
- /* @__PURE__ */ D(F, {
255
+ /* @__PURE__ */ D(I, {
255
256
  "aria-label": _?.sectionTitle ?? "Authentication",
256
257
  value: e.authenticationType,
257
258
  onChange: (e) => ee(e),
@@ -273,7 +274,7 @@ var L = {
273
274
  "aria-hidden": !0
274
275
  }), /* @__PURE__ */ D("span", {
275
276
  className: "sr-only desktop:not-sr-only",
276
- children: pe(t, _)
277
+ children: he(t, _)
277
278
  })]
278
279
  }),
279
280
  disabled: S && e.authenticationType !== t
@@ -289,7 +290,7 @@ var L = {
289
290
  children: [
290
291
  /* @__PURE__ */ O("div", {
291
292
  className: "flex flex-col gap-2",
292
- children: [/* @__PURE__ */ D(N, {
293
+ children: [/* @__PURE__ */ D(P, {
293
294
  name: "oauth-login-mode",
294
295
  id: "oauth-with-login",
295
296
  value: l.WithLogin,
@@ -297,7 +298,7 @@ var L = {
297
298
  isSelected: e.withLogin === l.WithLogin,
298
299
  disabled: S,
299
300
  onChange: T
300
- }), /* @__PURE__ */ D(N, {
301
+ }), /* @__PURE__ */ D(P, {
301
302
  name: "oauth-login-mode",
302
303
  id: "oauth-with-config",
303
304
  value: l.WithConfig,
@@ -323,7 +324,7 @@ var L = {
323
324
  invalid: !!t.clientId,
324
325
  disabled: S
325
326
  }),
326
- /* @__PURE__ */ D(ie, {
327
+ /* @__PURE__ */ D(N, {
327
328
  id: "toolset-client-secret",
328
329
  value: e.clientSecret ?? "",
329
330
  onChange: (e) => m({ clientSecret: e ?? "" }),
@@ -358,7 +359,7 @@ var L = {
358
359
  invalid: !!t.tokenEndpoint,
359
360
  disabled: S
360
361
  }),
361
- /* @__PURE__ */ D(I, {
362
+ /* @__PURE__ */ D(oe, {
362
363
  id: "toolset-scopes",
363
364
  labelProps: { label: _?.scopesLabel ?? "Scopes" },
364
365
  placeholder: _?.scopesPlaceholder ?? "Enter scopes",
@@ -369,7 +370,7 @@ var L = {
369
370
  })
370
371
  ]
371
372
  }),
372
- R()
373
+ L()
373
374
  ]
374
375
  }),
375
376
  e.authenticationType === s.ApiKey && /* @__PURE__ */ O("div", {
@@ -377,7 +378,7 @@ var L = {
377
378
  children: [
378
379
  /* @__PURE__ */ O("div", {
379
380
  className: "flex flex-col gap-2",
380
- children: [/* @__PURE__ */ D(N, {
381
+ children: [/* @__PURE__ */ D(P, {
381
382
  name: "apikey-login-mode",
382
383
  id: "apikey-with-login",
383
384
  value: l.WithLogin,
@@ -385,7 +386,7 @@ var L = {
385
386
  isSelected: e.withLogin === l.WithLogin,
386
387
  disabled: S,
387
388
  onChange: T
388
- }), /* @__PURE__ */ D(N, {
389
+ }), /* @__PURE__ */ D(P, {
389
390
  name: "apikey-login-mode",
390
391
  id: "apikey-without-login",
391
392
  value: l.WithoutLogin,
@@ -409,7 +410,7 @@ var L = {
409
410
  error: t.keyHeader || void 0,
410
411
  invalid: !!t.keyHeader,
411
412
  disabled: S
412
- }), e.withLogin === l.WithLogin && /* @__PURE__ */ D(ie, {
413
+ }), e.withLogin === l.WithLogin && /* @__PURE__ */ D(N, {
413
414
  id: "toolset-api-key",
414
415
  value: e.apiKey ?? "",
415
416
  onChange: (e) => m({ apiKey: e ?? "" }),
@@ -425,28 +426,28 @@ var L = {
425
426
  disabled: S
426
427
  })]
427
428
  }),
428
- e.withLogin !== l.WithoutLogin && R()
429
+ e.withLogin !== l.WithoutLogin && L()
429
430
  ]
430
431
  }),
431
- b && /* @__PURE__ */ D(ne, {
432
+ b && /* @__PURE__ */ D(ie, {
432
433
  open: b,
433
434
  header: _?.logoutConfirmTitle ?? "Log out?",
434
435
  description: _?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
435
436
  confirmLabel: _?.logOutLabel ?? "Log out",
436
437
  cancelLabel: _?.cancelLabel ?? "Cancel",
437
- variant: re.Danger,
438
+ variant: ae.Danger,
438
439
  isLoading: v,
439
440
  disableConfirmButton: v,
440
- onConfirm: L,
441
+ onConfirm: F,
441
442
  onCancel: () => x(!1),
442
443
  onClose: () => x(!1)
443
444
  })
444
445
  ]
445
446
  });
446
- }, $ = v(({ url: e, className: t, labels: n }) => {
447
- let { isCopied: r, copy: i } = _(e), a = n?.copiedLabel ?? "Copied!";
447
+ }, _e = b(({ url: e, className: t, labels: n }) => {
448
+ let { isCopied: r, copy: i } = v(e), a = n?.copiedLabel ?? "Copied!";
448
449
  return /* @__PURE__ */ O("div", {
449
- className: g("flex flex-col gap-3", t),
450
+ className: _("flex flex-col gap-3", t),
450
451
  children: [
451
452
  /* @__PURE__ */ O("div", {
452
453
  className: "flex flex-col gap-1",
@@ -472,15 +473,15 @@ var L = {
472
473
  })
473
474
  ]
474
475
  });
475
- }), he = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: f, onEnsureSaved: p, labels: m }) => {
476
- let [g, _] = C(null), v = !!a && !!r, y = x(() => [{
476
+ }), ve = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: f, onEnsureSaved: p, labels: m }) => {
477
+ let [g, _] = w(null), v = !!a && !!r, y = C(() => [{
477
478
  value: R.Http,
478
479
  label: "HTTP"
479
480
  }, {
480
481
  value: R.Sse,
481
482
  label: "SSE"
482
483
  }], []);
483
- return b(() => {
484
+ return S(() => {
484
485
  if (!r || !o || !Y(e.auth, i)) {
485
486
  _(null);
486
487
  return;
@@ -518,7 +519,7 @@ var L = {
518
519
  error: t.endpoint || void 0,
519
520
  invalid: !!t.endpoint
520
521
  }),
521
- /* @__PURE__ */ D(P, {
522
+ /* @__PURE__ */ D(F, {
522
523
  labelProps: {
523
524
  label: m?.protocolLabel ?? "Protocol",
524
525
  required: !0
@@ -530,7 +531,7 @@ var L = {
530
531
  d({ protocol: e });
531
532
  }
532
533
  }),
533
- g ? /* @__PURE__ */ D(ae, {
534
+ g ? /* @__PURE__ */ D(L, {
534
535
  id: "toolset-allowed-tools",
535
536
  multiple: !0,
536
537
  searchable: !0,
@@ -543,7 +544,7 @@ var L = {
543
544
  })),
544
545
  value: e.allowedTools,
545
546
  onChange: (e) => d({ allowedTools: e })
546
- }) : /* @__PURE__ */ D(I, {
547
+ }) : /* @__PURE__ */ D(oe, {
547
548
  id: "toolset-allowed-tools",
548
549
  labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
549
550
  placeholder: m?.allowedToolsPlaceholder ?? "Add tools, comma separated",
@@ -551,7 +552,7 @@ var L = {
551
552
  onChange: (e) => d({ allowedTools: e }),
552
553
  tagClassName: h
553
554
  }),
554
- /* @__PURE__ */ D(me, {
555
+ /* @__PURE__ */ D(ge, {
555
556
  auth: e.auth,
556
557
  errors: t,
557
558
  isSaving: n,
@@ -566,58 +567,58 @@ var L = {
566
567
  onEnsureSaved: p,
567
568
  labels: m?.auth
568
569
  }),
569
- v && /* @__PURE__ */ D($, {
570
+ v && /* @__PURE__ */ D(_e, {
570
571
  url: a ?? "",
571
572
  labels: m?.connect,
572
573
  className: "border-t border-tertiary pt-4"
573
574
  })
574
575
  ]
575
576
  });
576
- }, ge = [
577
+ }, ye = [
577
578
  "keyHeader",
578
579
  "apiKey",
579
580
  "clientId",
580
581
  "clientSecret",
581
582
  "authorizationEndpoint",
582
583
  "tokenEndpoint"
583
- ], _e = ["endpoint", ...ge], ve = new Set(_e), ye = (e) => {
584
+ ], be = ["endpoint", ...ye], $ = new Set(be), xe = (e) => {
584
585
  let t = {};
585
- for (let n of Object.keys(e)) ve.has(n) && (t[n] = !0);
586
+ for (let n of Object.keys(e)) $.has(n) && (t[n] = !0);
586
587
  return t;
587
- }, be = ({ initialForm: r, toolsetId: i, onPersist: o, onPostSaveLogin: c, onToolsetsChanged: u, onSaveSuccess: f, onSaveComplete: h, onBack: g, buildMcpUrl: _, listToolNames: v, authActions: w, onOAuthLogin: ee, onNotifySuccess: T, onNotifyError: E, bucket: te, FileManagerModal: O, resolveIconUrl: ne, allowedMimeTypes: re, maxFileSizeBytes: k, availableLocaleOptions: A, labels: j }) => {
588
- let M = !!i, [ie, N] = C(""), P = i || ie, [F, ae] = C({
588
+ }, Se = ({ initialForm: r, toolsetId: i, onPersist: o, onPostSaveLogin: c, onToolsetsChanged: u, onSaveSuccess: f, onSaveComplete: h, onBack: _, buildMcpUrl: v, listToolNames: b, authActions: T, onOAuthLogin: te, onNotifySuccess: ne, onNotifyError: E, bucket: re, FileManagerModal: O, resolveIconUrl: ie, allowedMimeTypes: ae, maxFileSizeBytes: k, availableLocaleOptions: A, onRefineDescription: j, labels: M }) => {
589
+ let N = !!i, [P, F] = w(""), I = i || P, [L, oe] = w({
589
590
  initialForm: r,
590
591
  key: 0
591
592
  });
592
- F.initialForm !== r && ae({
593
+ L.initialForm !== r && oe({
593
594
  initialForm: r,
594
- key: F.key + 1
595
+ key: L.key + 1
595
596
  });
596
- let { values: I, setValues: R, markTouched: z, visibleErrorCodes: B, attemptSubmit: V } = a({
597
- initialValues: x(() => le(r), [r]),
598
- validationOptions: oe,
599
- reseedKey: F.key
600
- }), [H, U] = C(r), W = x(() => ({
601
- ...H,
602
- ...I
603
- }), [H, I]), [G, q] = C(!1), [se, J] = C({}), [Y, X] = C({}), Z = S(null);
604
- b(() => {
605
- U(r), Z.current = r, J({}), X({}), N("");
597
+ let { values: R, setValues: z, markTouched: B, visibleErrorCodes: V, attemptSubmit: H } = a({
598
+ initialValues: C(() => fe(r), [r]),
599
+ validationOptions: ce,
600
+ reseedKey: L.key
601
+ }), [le, U] = w(r), W = C(() => ({
602
+ ...le,
603
+ ...R
604
+ }), [le, R]), [K, q] = w(!1), [J, Y] = w({}), [de, X] = w({}), Z = ee(null);
605
+ S(() => {
606
+ U(r), Z.current = r, Y({}), X({}), F("");
606
607
  }, [r]);
607
- let Q = y((e) => {
608
- let { metadata: t, setup: r } = ue(e);
609
- Object.keys(t).length > 0 && (R(t), "name" in t && z(n.Name), "version" in t && z(n.Version)), Object.keys(r).length !== 0 && (U((e) => ({
608
+ let Q = x((e) => {
609
+ let { metadata: t, setup: r } = pe(e);
610
+ Object.keys(t).length > 0 && (z(t), "name" in t && B(n.Name), "version" in t && B(n.Version)), Object.keys(r).length !== 0 && (U((e) => ({
610
611
  ...e,
611
612
  ...r
612
613
  })), X((e) => ({
613
614
  ...e,
614
- ...ye(r)
615
- })), J((e) => {
615
+ ...xe(r)
616
+ })), Y((e) => {
616
617
  let t = { ...e };
617
618
  for (let e of Object.keys(r)) delete t[e];
618
619
  return t;
619
620
  }));
620
- }, [R, z]), fe = y((e) => {
621
+ }, [z, B]), he = x((e) => {
621
622
  U((t) => ({
622
623
  ...t,
623
624
  auth: {
@@ -626,19 +627,19 @@ var L = {
626
627
  }
627
628
  })), X((t) => ({
628
629
  ...t,
629
- ...ye(e)
630
- })), J((t) => {
630
+ ...xe(e)
631
+ })), Y((t) => {
631
632
  let n = { ...t };
632
- if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of ge) delete n[e];
633
+ if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of ye) delete n[e];
633
634
  else for (let t of Object.keys(e)) delete n[t];
634
635
  return n;
635
636
  }), "isLoggedIn" in e && u();
636
- }, [u]), pe = y(async () => {
637
- if (P && Z.current != null && JSON.stringify(Z.current) === JSON.stringify(W)) return P;
637
+ }, [u]), ge = x(async () => {
638
+ if (I && Z.current != null && JSON.stringify(Z.current) === JSON.stringify(W)) return I;
638
639
  q(!0);
639
640
  try {
640
- let e = await o(W, P);
641
- return e ? (P || N(e), Z.current = W, await u(), e) : null;
641
+ let e = await o(W, I);
642
+ return e ? (I || F(e), Z.current = W, await u(), e) : null;
642
643
  } catch {
643
644
  return null;
644
645
  } finally {
@@ -646,107 +647,122 @@ var L = {
646
647
  }
647
648
  }, [
648
649
  W,
649
- P,
650
+ I,
650
651
  o,
651
652
  u
652
- ]), me = y(async () => await pe() ?? !1, [pe]), $ = y((e) => {
653
- let t = j?.validation, n = {};
654
- 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"), e.auth.tokenEndpoint?.trim() && !K(e.auth.tokenEndpoint) && (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL"))), n;
655
- }, [j, M]), ve = y(async () => {
656
- let e = V(), t = $(W);
653
+ ]), _e = x(async () => await ge() ?? !1, [ge]), $ = x((e) => {
654
+ let t = M?.validation, n = {};
655
+ return e.endpoint.trim() ? G(e.endpoint) || (n.endpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.endpoint = t?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === s.ApiKey && (e.auth.keyHeader?.trim() || (n.keyHeader = t?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === l.WithLogin && !e.auth.apiKey?.trim() && (n.apiKey = t?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === s.OAuth && e.auth.withLogin === l.WithConfig && (e.auth.clientId?.trim() || (n.clientId = t?.clientIdRequired ?? "Client ID is required"), !N && !e.auth.clientSecret?.trim() && (n.clientSecret = t?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() && !G(e.auth.authorizationEndpoint) && (n.authorizationEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL"), e.auth.tokenEndpoint?.trim() && !G(e.auth.tokenEndpoint) && (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL"))), n;
656
+ }, [M, N]), Se = x(async () => {
657
+ let e = H(), t = $(W);
657
658
  if (!e || Object.keys(t).length > 0) {
658
- J(t);
659
+ Y(t);
659
660
  return;
660
661
  }
661
- J({}), q(!0);
662
+ Y({}), q(!0);
662
663
  try {
663
- let e = await o(W, P);
664
+ let e = await o(W, I);
664
665
  if (!e) return;
665
666
  await u(), f(W);
666
667
  try {
667
668
  await c(e, W.auth), h();
668
669
  } catch (e) {
669
670
  let { traceId: t } = await d(e);
670
- E(j?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
671
+ E(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
671
672
  }
672
673
  } catch {} finally {
673
674
  q(!1);
674
675
  }
675
676
  }, [
676
- V,
677
+ H,
677
678
  W,
678
679
  $,
679
- P,
680
+ I,
680
681
  o,
681
682
  u,
682
683
  f,
683
684
  h,
684
685
  c,
685
686
  E,
686
- j
687
- ]), be = x(() => !ce(W, M), [W, M]), xe = x(() => {
688
- let t = j?.validation, n = $(W), r = { ...se };
689
- for (let e of _e) {
690
- if (!Y[e]) continue;
687
+ M
688
+ ]), Ce = y({
689
+ value: R.description,
690
+ onChange: (e) => Q({ description: e }),
691
+ onRefine: j,
692
+ disabled: K,
693
+ resetKey: L.key
694
+ }), we = j ? (e, t) => /* @__PURE__ */ D(g, {
695
+ isEnabled: !0,
696
+ fieldId: t,
697
+ label: M?.general?.form?.description.label ?? "Description",
698
+ labels: M?.refinement,
699
+ refinement: Ce,
700
+ disabled: Ce.isPending || K,
701
+ children: e
702
+ }) : void 0, Te = C(() => !ue(W, N), [W, N]), Ee = C(() => {
703
+ let t = M?.validation, n = $(W), r = { ...J };
704
+ for (let e of be) {
705
+ if (!de[e]) continue;
691
706
  let t = n[e];
692
707
  t ? r[e] = t : delete r[e];
693
708
  }
694
- return B.name === e.Required ? r.name = t?.nameRequired ?? "Name is required" : B.name === e.TooLong ? r.name = t?.nameTooLong ?? `Use ${m} characters or fewer.` : B.name === e.ControlCharacters && (r.name = t?.nameControlCharacters ?? "Remove line breaks, tabs and other control characters."), B.description === e.TooLong && (r.description = t?.descriptionTooLong ?? `Use ${p} characters or fewer.`), B.version === e.InvalidFormat && (r.version = t?.versionInvalid ?? "Version must follow semantic versioning (e.g., 1.0.0)"), r;
709
+ return V.name === e.Required ? r.name = t?.nameRequired ?? "Name is required" : V.name === e.TooLong ? r.name = t?.nameTooLong ?? `Use ${m} characters or fewer.` : V.name === e.ControlCharacters && (r.name = t?.nameControlCharacters ?? "Remove line breaks, tabs and other control characters."), V.description === e.TooLong && (r.description = t?.descriptionTooLong ?? `Use ${p} characters or fewer.`), V.version === e.InvalidFormat && (r.version = t?.versionInvalid ?? "Version must follow semantic versioning (e.g., 1.0.0)"), r;
695
710
  }, [
696
- Y,
697
- se,
711
+ de,
712
+ J,
698
713
  W,
699
- j,
700
- B,
714
+ M,
715
+ V,
701
716
  $
702
- ]), Se = _ && P ? _(P) : void 0;
717
+ ]), De = v && I ? v(I) : void 0;
703
718
  return /* @__PURE__ */ D(t, {
704
- title: M ? j?.layout?.editTitle ?? "Edit toolset" : j?.layout?.createTitle ?? "Create toolset",
705
- onBack: g,
706
- onCancel: g,
707
- onSubmit: ve,
708
- submitLabel: M ? j?.layout?.saveLabel ?? "Save" : j?.layout?.createLabel ?? "Create",
709
- isSubmitting: G,
710
- isSubmitDisabled: be,
711
- metadataSectionClassName: L.metadataSection,
712
- setupSectionClassName: L.setupSection,
719
+ title: N ? M?.layout?.editTitle ?? "Edit toolset" : M?.layout?.createTitle ?? "Create toolset",
720
+ onBack: _,
721
+ onCancel: _,
722
+ onSubmit: Se,
723
+ submitLabel: N ? M?.layout?.saveLabel ?? "Save" : M?.layout?.createLabel ?? "Create",
724
+ isSubmitting: K,
725
+ isSubmitDisabled: Te || Ce.isPending,
726
+ metadataSectionClassName: se.metadataSection,
727
+ setupSectionClassName: se.setupSection,
713
728
  labels: {
714
- backAriaLabel: j?.layout?.backAriaLabel ?? "Back to catalog",
715
- savingStatusLabel: j?.layout?.savingStatusLabel ?? "Saving",
716
- metadataTitle: j?.layout?.metadataSectionTitle ?? "Metadata",
717
- setupTitle: j?.layout?.setupSectionTitle ?? "Setup",
718
- cancelLabel: j?.layout?.cancelLabel ?? "Cancel"
729
+ backAriaLabel: M?.layout?.backAriaLabel ?? "Back to catalog",
730
+ savingStatusLabel: M?.layout?.savingStatusLabel ?? "Saving",
731
+ metadataTitle: M?.layout?.metadataSectionTitle ?? "Metadata",
732
+ setupTitle: M?.layout?.setupSectionTitle ?? "Setup",
733
+ cancelLabel: M?.layout?.cancelLabel ?? "Cancel"
719
734
  },
720
- metadata: /* @__PURE__ */ D(de, {
735
+ metadata: /* @__PURE__ */ D(me, {
721
736
  form: W,
722
- errors: xe,
723
- bucket: te,
737
+ errors: Ee,
738
+ bucket: re,
724
739
  FileManagerModal: O,
725
- resolveIconUrl: ne,
726
- allowedMimeTypes: re,
740
+ resolveIconUrl: ie,
741
+ allowedMimeTypes: ae,
727
742
  maxFileSizeBytes: k,
728
743
  availableLocaleOptions: A,
729
744
  onChange: Q,
730
- labels: j?.general
745
+ renderDescription: we,
746
+ labels: M?.general
731
747
  }),
732
- setup: /* @__PURE__ */ D(he, {
748
+ setup: /* @__PURE__ */ D(ve, {
733
749
  form: W,
734
- errors: xe,
735
- isSaving: G,
736
- toolsetId: P,
737
- isEditMode: M,
738
- connectUrl: Se,
739
- listToolNames: v,
740
- authActions: w,
741
- onOAuthLogin: ee,
742
- onNotifySuccess: T,
750
+ errors: Ee,
751
+ isSaving: K,
752
+ toolsetId: I,
753
+ isEditMode: N,
754
+ connectUrl: De,
755
+ listToolNames: b,
756
+ authActions: T,
757
+ onOAuthLogin: te,
758
+ onNotifySuccess: ne,
743
759
  onNotifyError: E,
744
760
  onChange: Q,
745
- onAuthChange: fe,
746
- onEnsureSaved: me,
747
- labels: j?.settings
761
+ onAuthChange: he,
762
+ onEnsureSaved: _e,
763
+ labels: M?.settings
748
764
  })
749
765
  });
750
766
  };
751
767
  //#endregion
752
- export { V as AUTH_TYPE_ICONS, z as DEFAULT_TOOLSET_NAME, B as DEFAULT_TOOLSET_VERSION, de as GeneralForm, L as TOOLSET_EDITOR_CLASS, be as ToolsetEditor, Q as ToolsetOAuthLoginStatus, R as ToolsetTransportType, W as getDefaultToolsetForm, H as getStorageSafeUniqueToolsetName, Y as isToolsetAuthValid, ce as isToolsetFormValid, K as isValidEndpointUrl, se as normalizeReturnedEndpointUrl };
768
+ export { V as AUTH_TYPE_ICONS, z as DEFAULT_TOOLSET_NAME, B as DEFAULT_TOOLSET_VERSION, me as GeneralForm, se as TOOLSET_EDITOR_CLASS, Se as ToolsetEditor, Z as ToolsetOAuthLoginStatus, R as ToolsetTransportType, U as getDefaultToolsetForm, H as getStorageSafeUniqueToolsetName, Y as isToolsetAuthValid, ue as isToolsetFormValid, G as isValidEndpointUrl, q as normalizeReturnedEndpointUrl };
@@ -1,5 +1,5 @@
1
1
  import { AvatarPickerFileManagerModalProps, AvatarPickerModalLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
2
- import { ComponentType } from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
3
3
  import { DeploymentGeneralFormData, ToolsetFormErrors } from './toolset-form';
4
4
  /**
5
5
  * Pre-translated labels for the general (metadata) form. Each group is
@@ -40,6 +40,8 @@ export interface GeneralFormProps {
40
40
  onNameBlur?: () => void;
41
41
  /** Called when the Version field loses focus. */
42
42
  onVersionBlur?: () => void;
43
+ /** Wraps the Description textarea; see `MetadataFormProps.renderDescription`. */
44
+ renderDescription?: (textarea: ReactNode, fieldId: string) => ReactNode;
43
45
  /** Pre-translated labels; each group falls back to English defaults. */
44
46
  labels?: GeneralFormLabels;
45
47
  }
@@ -1 +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;;;;;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,wEAAwE;IACxE,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
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"}
@@ -1,4 +1,5 @@
1
1
  import { AvatarPickerFileManagerModalProps, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
2
+ import { TextRefinementCallback, TextRefinementLabels } from '../../../chat-shared/src/index.ts';
2
3
  import { ComponentType } from 'react';
3
4
  import { GeneralFormLabels } from './general-form-props';
4
5
  import { SettingsFormLabels } from './settings-form-props';
@@ -56,6 +57,8 @@ export interface ToolsetEditorLayoutLabels {
56
57
  * defaults.
57
58
  */
58
59
  export interface ToolsetEditorLabels {
60
+ /** Refine-with-AI action, status, and error copy for the Description field. */
61
+ refinement?: TextRefinementLabels;
59
62
  /** Header/action/section labels. */
60
63
  layout?: ToolsetEditorLayoutLabels;
61
64
  /** Labels threaded to the embedded general (metadata) form. */
@@ -134,6 +137,8 @@ export interface ToolsetEditorProps {
134
137
  maxFileSizeBytes: number;
135
138
  /** Locale options offered by the "Add locale" popup. */
136
139
  availableLocaleOptions: DeploymentCreationFormLocaleOption[];
140
+ /** Optional Description rewrite callback; omission hides the Refine with AI action. */
141
+ onRefineDescription?: TextRefinementCallback;
137
142
  /** Pre-translated labels; each group falls back to English defaults. */
138
143
  labels?: ToolsetEditorLabels;
139
144
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,yFAAyF;AACzF,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gIAAgI;IAChI,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8GAA8G;IAC9G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,iBAAiB,CAAC,EAAE,MA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9B"}
1
+ {"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,yFAAyF;AACzF,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gIAAgI;IAChI,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8GAA8G;IAC9G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2GAA2G;IAC3G,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,0GAA0G;AAC1G,MAAM,WAAW,yBAAyB;IACxC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AL MCP toolset",
4
- "version": "1.2.0-dev.282",
4
+ "version": "1.2.0-dev.285",
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.2.0-dev.282"
21
+ "@epam/ai-dial-builder-form": "1.2.0-dev.285"
22
22
  },
23
23
  "peerDependencies": {
24
- "@epam/ai-dial-chat-hooks": "1.2.0-dev.282",
25
- "@epam/ai-dial-chat-shared": "1.2.0-dev.282",
24
+ "@epam/ai-dial-chat-hooks": "1.2.0-dev.285",
25
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.285",
26
26
  "@epam/ai-dial-ui-kit": "^0.15.0-dev.36",
27
27
  "react": "^19.2.8"
28
28
  },