@epam/ai-dial-chat-hooks 1.1.2 → 1.2.0-dev.101

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 (44) hide show
  1. package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
  2. package/attachments.d.ts +10 -4
  3. package/catalog/map-skill-to-catalog-item.js +48 -48
  4. package/catalog/publish.js +2 -1
  5. package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
  6. package/catalog.d.ts +22 -0
  7. package/catalog.js +6 -5
  8. package/conversation/conversation-transfer/queue.js +8 -5
  9. package/conversation/stage.js +23 -0
  10. package/conversation/useConversationImport/useConversationImport.js +1 -1
  11. package/conversation/useConversationScroll/useConversationScroll.js +68 -64
  12. package/conversation/useConversationStream/apply-chunk.js +1 -1
  13. package/conversation-sources/useConversationSources/useConversationSources.js +24 -31
  14. package/conversation-sources.d.ts +1 -1
  15. package/conversation.d.ts +107 -0
  16. package/conversation.js +23 -21
  17. package/file-manager.d.ts +71 -5
  18. package/file-manager.js +3 -2
  19. package/files/attachment-types.js +14 -13
  20. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -5
  21. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
  22. package/index.d.ts +614 -16
  23. package/index.js +123 -111
  24. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
  25. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
  26. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
  27. package/mcp-apps.d.ts +8 -6
  28. package/package.json +26 -17
  29. package/scheduled-task/scheduled-task-description.js +77 -0
  30. package/scheduled-task/scheduled-task-preparation.js +24 -0
  31. package/scheduled-task/scheduled-tasks-api-client.js +19 -0
  32. package/scheduled-task/use-scheduled-task-runs.js +82 -0
  33. package/scheduled-task/use-scheduled-tasks.js +93 -0
  34. package/scheduled-tasks.d.ts +178 -0
  35. package/scheduled-tasks.js +7 -2
  36. package/skill/skill.js +10 -7
  37. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +75 -0
  38. package/skill/useSkillEditorSubmit.js +83 -71
  39. package/skill-editor.d.ts +103 -0
  40. package/skill-editor.js +9 -8
  41. package/usage/map-usage-data-to-dashboard.js +66 -0
  42. package/usage/map-user-usage-to-model-limits.js +160 -0
  43. package/usage.d.ts +120 -0
  44. package/usage.js +3 -0
@@ -4,31 +4,38 @@ import { useCallback as n, useEffect as r, useMemo as i, useRef as a } from "rea
4
4
  import { isMimeTypeAllowed as o, mimeTypesToExtensionLabels as s } from "@epam/ai-dial-attachment-input";
5
5
  //#region src/attachment/useAttachmentValidation/useAttachmentValidation.ts
6
6
  var c = 100, l = /* @__PURE__ */ function(e) {
7
- return e.NoTypesAllowed = "noTypesAllowed", e.UnsupportedType = "unsupportedType", e;
8
- }({}), u = ({ allowedMimeTypes: l, onValidationError: u, debounceMs: d = c }) => {
9
- let f = a(l);
10
- (f.current.length !== l.length || f.current.some((e, t) => e !== l[t])) && (f.current = l);
11
- let p = f.current, m = p.length > 0, h = i(() => e(p), [p]), g = a(null);
7
+ return e.NoTypesAllowed = "noTypesAllowed", e.UnsupportedType = "unsupportedType", e.FileTooLarge = "fileTooLarge", e;
8
+ }({}), u = ({ allowedMimeTypes: l, maxFileSizeBytes: u, onValidationError: d, debounceMs: f = c }) => {
9
+ let p = a(l);
10
+ (p.current.length !== l.length || p.current.some((e, t) => e !== l[t])) && (p.current = l);
11
+ let m = p.current, h = m.length > 0, g = i(() => e(m), [m]), _ = a(null), v = a(null);
12
12
  return r(() => () => {
13
- g.current != null && clearTimeout(g.current);
13
+ _.current != null && clearTimeout(_.current), v.current != null && clearTimeout(v.current);
14
14
  }, []), {
15
- inputAttachmentTypes: p,
16
- isAttachmentsAllowed: m,
15
+ inputAttachmentTypes: m,
16
+ isAttachmentsAllowed: h,
17
17
  validateAttachment: n((e) => {
18
- if (!o(e.contentType, p)) return g.current != null && clearTimeout(g.current), g.current = setTimeout(() => {
19
- let e = p.length === 0;
20
- u?.({
18
+ if (!o(e.contentType, m)) return _.current != null && clearTimeout(_.current), _.current = setTimeout(() => {
19
+ let e = m.length === 0;
20
+ d?.({
21
21
  reason: e ? "noTypesAllowed" : "unsupportedType",
22
- allowedMimeTypes: p,
23
- ...e ? {} : { formats: s(p) }
24
- }), g.current = null;
25
- }, d), t.UnsupportedType;
22
+ allowedMimeTypes: m,
23
+ ...e ? {} : { formats: s(m) }
24
+ }), _.current = null;
25
+ }, f), t.UnsupportedType;
26
+ if (u != null && e.file.size > u) return v.current != null && clearTimeout(v.current), v.current = setTimeout(() => {
27
+ d?.({
28
+ reason: "fileTooLarge",
29
+ maxFileSizeBytes: u
30
+ }), v.current = null;
31
+ }, f), t.FileTooLarge;
26
32
  }, [
27
- p,
28
- d,
29
- u
33
+ m,
34
+ u,
35
+ f,
36
+ d
30
37
  ]),
31
- fileAccept: h
38
+ fileAccept: g
32
39
  };
33
40
  };
34
41
  //#endregion
package/attachments.d.ts CHANGED
@@ -6,10 +6,12 @@ import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
6
6
  export declare interface AttachmentValidationErrorEvent {
7
7
  /** Why the attachment(s) were rejected. */
8
8
  reason: AttachmentValidationErrorReason;
9
- /** The resolved MIME types the caller currently allows (possibly empty). */
10
- allowedMimeTypes: string[];
9
+ /** The resolved MIME types the caller currently allows (possibly empty). Present only when `reason` is `NoTypesAllowed` or `UnsupportedType`. */
10
+ allowedMimeTypes?: string[];
11
11
  /** Already-formatted, non-translated extension list (e.g. ".png, .jpg"), present only when `reason` is `UnsupportedType`. */
12
12
  formats?: string;
13
+ /** The size limit, in bytes, that was exceeded. Present only when `reason` is `FileTooLarge`. */
14
+ maxFileSizeBytes?: number;
13
15
  }
14
16
 
15
17
  /** Reason a rejected attachment failed validation. */
@@ -17,7 +19,9 @@ export declare enum AttachmentValidationErrorReason {
17
19
  /** No MIME types are allowed at all — attachments are disabled entirely. */
18
20
  NoTypesAllowed = "noTypesAllowed",
19
21
  /** The attachment's content type is not among the allowed MIME types. */
20
- UnsupportedType = "unsupportedType"
22
+ UnsupportedType = "unsupportedType",
23
+ /** The attachment's file size exceeds `maxFileSizeBytes`. */
24
+ FileTooLarge = "fileTooLarge"
21
25
  }
22
26
 
23
27
  /**
@@ -61,12 +65,14 @@ export declare interface UseAttachmentActionResult {
61
65
  * MIME types, debouncing a burst of rejected files into a single
62
66
  * `onValidationError` call rather than firing one per file.
63
67
  */
64
- export declare const useAttachmentValidation: ({ allowedMimeTypes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
68
+ export declare const useAttachmentValidation: ({ allowedMimeTypes, maxFileSizeBytes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
65
69
 
66
70
  /** Parameters for {@link useAttachmentValidation}. */
67
71
  export declare interface UseAttachmentValidationParams {
68
72
  /** Resolved MIME types currently allowed for attachments. */
69
73
  allowedMimeTypes: string[];
74
+ /** Maximum attachment file size, in bytes. When omitted, no file is rejected for size. */
75
+ maxFileSizeBytes?: number;
70
76
  /** Called with a structured event when a rejected attachment is reported, at most once per debounce window. */
71
77
  onValidationError?: (event: AttachmentValidationErrorEvent) => void;
72
78
  /** Debounce window, in ms, before firing `onValidationError` for a rejected file. Defaults to `100`. */
@@ -1,24 +1,24 @@
1
- import { safeDecodeURIComponent as e, stripSurroundingSlashes as t } from "../shared/string-utils.js";
2
- import { formatCalendarDate as n } from "../shared/formatting.js";
1
+ import { stripSurroundingSlashes as e } from "../shared/string-utils.js";
2
+ import { formatCalendarDate as t } from "../shared/formatting.js";
3
3
  import "../skill/skill.js";
4
- import { SkillSource as r } from "../skill/skill-types.js";
5
- import { CatalogEntityType as i, formatLastUsed as a } from "@epam/ai-dial-chat-shared";
6
- import { CatalogContentNodeType as o } from "@epam/ai-dial-catalog";
7
- import { SkillMetadataItemDtoNodeTypeEnum as s } from "@epam/ai-dial-chat-api-client";
4
+ import { SkillSource as n } from "../skill/skill-types.js";
5
+ import { CatalogEntityType as r, formatLastUsed as i } from "@epam/ai-dial-chat-shared";
6
+ import { CatalogContentNodeType as a } from "@epam/ai-dial-catalog";
7
+ import { SkillMetadataItemDtoNodeTypeEnum as o } from "@epam/ai-dial-chat-api-client";
8
8
  //#region src/catalog/map-skill-to-catalog-item.ts
9
- var c = {
10
- [r.Personal]: "personal",
11
- [r.SharedWithMe]: "shared",
12
- [r.Public]: "public"
13
- }, l = (t, n, r) => [r[c[n]], ...(t ?? "").split("/").filter(Boolean).map(e)], u = (e, { folderLabels: t, source: n, favoriteIds: o }) => {
14
- let s = o.has(e.url), c = n === r.Public, u = n === r.Personal;
9
+ var s = {
10
+ [n.Personal]: "personal",
11
+ [n.SharedWithMe]: "shared",
12
+ [n.Public]: "public"
13
+ }, c = (e, t, n) => [n[s[t]], ...(e ?? "").split("/").filter(Boolean)], l = (e, { folderLabels: t, source: a, favoriteIds: o }) => {
14
+ let s = o.has(e.url), l = a === n.Public, u = a === n.Personal;
15
15
  return {
16
16
  id: e.url,
17
- type: i.Skill,
17
+ type: r.Skill,
18
18
  name: e.name,
19
19
  description: e.description ?? "",
20
20
  version: "",
21
- lastUsed: a(e.updatedAt),
21
+ lastUsed: i(e.updatedAt),
22
22
  createdAt: e.createdAt,
23
23
  updatedAt: e.updatedAt,
24
24
  isFeatured: !1,
@@ -27,11 +27,11 @@ var c = {
27
27
  isUserFavorite: s,
28
28
  isStarred: s,
29
29
  isMyApp: u && (e.isMy ?? !0),
30
- sharedWithMe: e.sharedWithMe ?? n === r.SharedWithMe,
31
- isEditable: !c && (e.canEdit ?? u),
32
- folder: l(e.parentPath, n, t)
30
+ sharedWithMe: e.sharedWithMe ?? a === n.SharedWithMe,
31
+ isEditable: !l && (e.canEdit ?? u),
32
+ folder: c(e.parentPath, a, t)
33
33
  };
34
- }, d = (e) => e.join(" · "), f = (e, t) => {
34
+ }, u = (e) => e.join(" · "), d = (e, t) => {
35
35
  if (e == null) return null;
36
36
  let n = [];
37
37
  return e.whenToUse != null && n.push({
@@ -39,25 +39,25 @@ var c = {
39
39
  value: e.whenToUse
40
40
  }), e.allowedTools?.length && n.push({
41
41
  label: t.allowedToolsLabel,
42
- value: d(e.allowedTools)
42
+ value: u(e.allowedTools)
43
43
  }), e.bundledResources?.length && n.push({
44
44
  label: t.bundledResourcesLabel,
45
- value: d(e.bundledResources)
45
+ value: u(e.bundledResources)
46
46
  }), n.length === 0 ? null : {
47
47
  title: t.specificationSectionTitle,
48
48
  specs: n
49
49
  };
50
- }, p = (e) => e.filter((e) => e.nodeType === s.Item), m = (e, n) => {
51
- let r = t(n), i = r ? `${r}/files` : "files";
52
- return p(e).find((e) => {
53
- let n = t(e.path);
50
+ }, f = (e) => e.filter((e) => e.nodeType === o.Item), p = (t, n) => {
51
+ let r = e(n), i = r ? `${r}/files` : "files";
52
+ return f(t).find((t) => {
53
+ let n = e(t.path);
54
54
  return n === "SKILL.md" || n === "files/SKILL.md" || n === `${i}/SKILL.md`;
55
55
  })?.path ?? "SKILL.md";
56
- }, h = (e, n) => {
57
- let r = t(e), i = t(n), a = i ? `${i}/files` : "files";
56
+ }, m = (t, n) => {
57
+ let r = e(t), i = e(n), a = i ? `${i}/files` : "files";
58
58
  return r === "" || r === "files" || r === a ? null : r.startsWith(`${a}/`) ? r.slice(a.length + 1) : r.startsWith("files/") ? r.slice(6) : r;
59
- }, g = (e, t) => h(e, t), _ = (e, t, r, i) => {
60
- let a = [], o = f(r, i);
59
+ }, h = (e, t) => m(e, t), g = (e, n, r, i) => {
60
+ let a = [], o = d(r, i);
61
61
  o != null && a.push(o);
62
62
  let s = [];
63
63
  return e?.author && s.push({
@@ -65,26 +65,26 @@ var c = {
65
65
  value: e.author
66
66
  }), s.push({
67
67
  label: i.updatedLabel,
68
- value: e?.updatedAt ? n(e.updatedAt) : ""
68
+ value: e?.updatedAt ? t(e.updatedAt) : ""
69
69
  }), s.push({
70
70
  label: i.fileCountLabel,
71
- value: String(p(t).length)
71
+ value: String(f(n).length)
72
72
  }), a.push({
73
73
  title: i.detailsSectionTitle,
74
74
  specs: s
75
75
  }), { sections: a };
76
- }, v = (e, t, n) => {
76
+ }, _ = (e, t, n) => {
77
77
  if (e === "") return n;
78
78
  let r = t.get(e);
79
79
  if (r != null) return r.items;
80
- let i = e.split("/"), a = v(i.slice(0, -1).join("/"), t, n), s = {
81
- type: o.Folder,
80
+ let i = e.split("/"), o = _(i.slice(0, -1).join("/"), t, n), s = {
81
+ type: a.Folder,
82
82
  id: e,
83
83
  name: i[i.length - 1],
84
84
  items: []
85
85
  };
86
- return t.set(e, s), a.push(s), s.items;
87
- }, y = (e, t) => {
86
+ return t.set(e, s), o.push(s), s.items;
87
+ }, v = (e, t) => {
88
88
  e.sort((e, n) => {
89
89
  if (t) {
90
90
  if (e.name === "SKILL.md") return -1;
@@ -92,32 +92,32 @@ var c = {
92
92
  }
93
93
  return e.name.localeCompare(n.name);
94
94
  });
95
- for (let t of e) t.type === o.Folder && y(t.items, !1);
96
- }, b = (e, t) => {
95
+ for (let t of e) t.type === a.Folder && v(t.items, !1);
96
+ }, y = (e, t) => {
97
97
  let n = /* @__PURE__ */ new Map(), r = [];
98
98
  for (let i of e) {
99
- let e = h(i.path, t);
99
+ let e = m(i.path, t);
100
100
  if (e == null) continue;
101
- if (i.nodeType === s.Folder) {
102
- v(e, n, r);
101
+ if (i.nodeType === o.Folder) {
102
+ _(e, n, r);
103
103
  continue;
104
104
  }
105
- let a = e.lastIndexOf("/");
106
- v(a === -1 ? "" : e.slice(0, a), n, r).push({
107
- type: o.File,
105
+ let s = e.lastIndexOf("/");
106
+ _(s === -1 ? "" : e.slice(0, s), n, r).push({
107
+ type: a.File,
108
108
  id: i.path,
109
109
  name: i.name
110
110
  });
111
111
  }
112
- return y(r, !0), r;
113
- }, x = async (e) => {
112
+ return v(r, !0), r;
113
+ }, b = async (e) => {
114
114
  let t = Number(e.headers.get("content-length"));
115
115
  if (Number.isFinite(t) && t > 262144) return null;
116
116
  let n = await e.arrayBuffer();
117
117
  return n.byteLength > 262144 ? null : new Uint8Array(n);
118
- }, S = async (e) => new Uint8Array(await e.arrayBuffer()), C = async (e) => {
119
- let t = await x(e);
118
+ }, x = async (e) => new Uint8Array(await e.arrayBuffer()), S = async (e) => {
119
+ let t = await b(e);
120
120
  return t == null ? null : new TextDecoder().decode(t);
121
121
  };
122
122
  //#endregion
123
- export { b as buildSkillContentTree, _ as buildSkillOverview, u as mapSkillToCatalogItem, x as readSkillFileBytes, S as readSkillFilePreviewBytes, C as readSkillManifest, g as resolveSkillFileDownloadPath, m as resolveSkillManifestFileId };
123
+ export { y as buildSkillContentTree, g as buildSkillOverview, l as mapSkillToCatalogItem, b as readSkillFileBytes, x as readSkillFilePreviewBytes, S as readSkillManifest, h as resolveSkillFileDownloadPath, p as resolveSkillManifestFileId };
@@ -10,7 +10,8 @@ var n = {
10
10
  }, r = (e) => n[e], i = "public", a = (e) => e.split("/")[1] === i, o = (t) => a(t) ? t.split("/").slice(2, -1).map(e) : [], s = (e) => ({
11
11
  version: e.version,
12
12
  publishedAt: Date.parse(e.publishedAt),
13
- folderPath: e.folderPath.split("/").filter(Boolean)
13
+ folderPath: e.folderPath.split("/").filter(Boolean),
14
+ publishCredentials: e.publishCredentials
14
15
  }), c = (e) => ({
15
16
  publishedAt: Date.parse(e.publishedAt),
16
17
  folderPath: e.folderPath.split("/").filter(Boolean)
@@ -0,0 +1,39 @@
1
+ import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
+ //#region src/catalog/useApplicationCredentials/useApplicationCredentials.ts
3
+ var i = ({ appId: i, externalServicesClient: a, offlineCredentialsClient: o }) => {
4
+ let [s, c] = r([]), [l, u] = r(!1), [d, f] = r(!0), [p, m] = r(!1), h = n(0), g = n(null), _ = e(async () => {
5
+ if (g.current !== i) return;
6
+ let e = ++h.current;
7
+ f(!0), m(!1);
8
+ try {
9
+ let t = await a.listExternalServices({ appId: i });
10
+ if (h.current !== e) return;
11
+ let n = t.some((e) => e.authenticationType === "DIAL_NATIVE") ? await o.getOfflineCredentials() : void 0;
12
+ if (h.current !== e) return;
13
+ c(t.filter((e) => e.authenticationType !== "NONE")), u(n?.connected ?? !1);
14
+ } catch {
15
+ h.current === e && m(!0);
16
+ } finally {
17
+ h.current === e && f(!1);
18
+ }
19
+ }, [
20
+ i,
21
+ a,
22
+ o
23
+ ]), v = e(() => {
24
+ g.current = null, h.current++;
25
+ }, []);
26
+ return t(() => (g.current = i, c([]), f(!0), u(!1), _(), v), [
27
+ i,
28
+ _,
29
+ v
30
+ ]), {
31
+ services: s,
32
+ isOfflineConnected: l,
33
+ isLoading: d,
34
+ hasError: p,
35
+ refresh: _
36
+ };
37
+ };
38
+ //#endregion
39
+ export { i as useApplicationCredentials };
package/catalog.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ApplicationExternalServiceDto } from '@epam/ai-dial-chat-api-client';
1
2
  import { CatalogContentTreeNode } from '@epam/ai-dial-catalog';
2
3
  import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
3
4
  import { CatalogItem } from '@epam/ai-dial-catalog';
@@ -14,8 +15,10 @@ import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
14
15
  import { DialToolsetAuthSettingsDto } from '@epam/ai-dial-chat-api-client';
15
16
  import { DialToolsetDto } from '@epam/ai-dial-chat-api-client';
16
17
  import { DropdownItem } from '@epam/ai-dial-ui-kit';
18
+ import { ExternalServicesApi } from '@epam/ai-dial-chat-api-client';
17
19
  import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
18
20
  import { NotificationVariant } from '@epam/ai-dial-ui-kit';
21
+ import { OfflineCredentialsApi } from '@epam/ai-dial-chat-api-client';
19
22
  import { PromptResponseDto } from '@epam/ai-dial-chat-api-client';
20
23
  import { PublicationRule } from '@epam/ai-dial-publish-panel';
21
24
  import { PublishApi } from '@epam/ai-dial-chat-api-client';
@@ -912,6 +915,25 @@ export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPu
912
915
  */
913
916
  export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto;
914
917
 
918
+ /** Loads fresh service statuses without coupling proactive credentials to a live completion. */
919
+ export declare const useApplicationCredentials: ({ appId, externalServicesClient, offlineCredentialsClient, }: UseApplicationCredentialsParams) => {
920
+ services: ApplicationExternalServiceDto[];
921
+ isOfflineConnected: boolean;
922
+ isLoading: boolean;
923
+ hasError: boolean;
924
+ refresh: () => Promise<void>;
925
+ };
926
+
927
+ /** Configured operations for loading application credential metadata. */
928
+ export declare interface UseApplicationCredentialsParams {
929
+ /** Application identifier passed through to the configured client. */
930
+ appId: string;
931
+ /** Host-configured external-services API. */
932
+ externalServicesClient: Pick<ExternalServicesApi, 'listExternalServices'>;
933
+ /** Host-configured offline-credentials API. */
934
+ offlineCredentialsClient: Pick<OfflineCredentialsApi, 'getOfflineCredentials'>;
935
+ }
936
+
915
937
  /**
916
938
  * Owns the catalog's edit/delete/create-menu navigation: routing the details
917
939
  * panel's Edit action to the right editor URL for each item type, deleting an
package/catalog.js CHANGED
@@ -17,8 +17,9 @@ import { useCatalogEditNavigation as Z } from "./catalog/useCatalogEditNavigatio
17
17
  import { useSkillItemDetails as Q } from "./catalog/useSkillItemDetails.js";
18
18
  import { useCatalogItemDetails as $ } from "./catalog/useCatalogItemDetails.js";
19
19
  import { useCatalogToolsetCredentials as ee } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
- import { useSkillDetailsPanelData as te } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
21
- import { FavoriteEntityType as ne, useFavoriteEntitiesState as re } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
22
- import { usePublishFolders as ie } from "./catalog/usePublishFolders/usePublishFolders.js";
23
- import { SkillPreviewErrorKind as ae, useSkillFilePreview as oe } from "./skill/useSkillFilePreview.js";
24
- export { s as AuthenticationType, Y as CatalogPrimaryActionType, ne as FavoriteEntityType, P as McpResourceKind, b as PUBLIC_SKILL_BUCKET, x as SKILL_LISTING_MAX_PAGES, S as SKILL_LISTING_PAGE_SIZE, C as SKILL_MANIFEST_MAX_BYTES, ae as SkillPreviewErrorKind, w as SkillSource, F as buildApplicationMcpUrl, n as buildChatCompletionsUrl, I as buildConnectApi, r as buildDeploymentConnectApi, _ as buildPromptOverview, i as buildResponsesUrl, E as buildSkillContentTree, D as buildSkillOverview, L as buildToolsetMcpUrl, e as createPublishApiClient, W as deriveAvailableTabIds, G as deriveFavoriteItems, a as encodeDeploymentId, K as filterCatalogItemsBySelector, q as filterHiddenOwnedItems, o as findDeploymentByIdOrReference, z as getPublicCatalogEntityFolderPath, v as isOrganisationPromptItem, B as isPublicCatalogEntityId, u as mapDeploymentDetailsDtoToEntityDetails, c as mapDeploymentLimitsDtoToCatalogLimits, l as mapDeploymentLimitsToInput, p as mapDeploymentToCatalogItem, m as mapDeploymentToolsetCredentials, d as mapEntityDetailsToCatalogDetails, y as mapPromptToCatalogItem, V as mapPublishConversationResultDto, H as mapPublishHistoryEntryDto, O as mapSkillToCatalogItem, f as mapToolsetCredentials, h as mapToolsetToCatalogItem, T as parseSkillResourceUrl, k as readSkillFileBytes, A as readSkillFilePreviewBytes, j as readSkillManifest, J as reconcileFilterTopics, X as resolveCatalogPrimaryAction, g as resolveDeploymentFolder, R as resolveMcpResourceKind, M as resolveSkillFileDownloadPath, N as resolveSkillManifestFileId, U as toPublishEntityType, t as toPublishRuleDto, Z as useCatalogEditNavigation, $ as useCatalogItemDetails, ee as useCatalogToolsetCredentials, re as useFavoriteEntitiesState, ie as usePublishFolders, te as useSkillDetailsPanelData, oe as useSkillFilePreview, Q as useSkillItemDetails };
20
+ import { useApplicationCredentials as te } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
21
+ import { useSkillDetailsPanelData as ne } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
22
+ import { FavoriteEntityType as re, useFavoriteEntitiesState as ie } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
23
+ import { usePublishFolders as ae } from "./catalog/usePublishFolders/usePublishFolders.js";
24
+ import { SkillPreviewErrorKind as oe, useSkillFilePreview as se } from "./skill/useSkillFilePreview.js";
25
+ export { s as AuthenticationType, Y as CatalogPrimaryActionType, re as FavoriteEntityType, P as McpResourceKind, b as PUBLIC_SKILL_BUCKET, x as SKILL_LISTING_MAX_PAGES, S as SKILL_LISTING_PAGE_SIZE, C as SKILL_MANIFEST_MAX_BYTES, oe as SkillPreviewErrorKind, w as SkillSource, F as buildApplicationMcpUrl, n as buildChatCompletionsUrl, I as buildConnectApi, r as buildDeploymentConnectApi, _ as buildPromptOverview, i as buildResponsesUrl, E as buildSkillContentTree, D as buildSkillOverview, L as buildToolsetMcpUrl, e as createPublishApiClient, W as deriveAvailableTabIds, G as deriveFavoriteItems, a as encodeDeploymentId, K as filterCatalogItemsBySelector, q as filterHiddenOwnedItems, o as findDeploymentByIdOrReference, z as getPublicCatalogEntityFolderPath, v as isOrganisationPromptItem, B as isPublicCatalogEntityId, u as mapDeploymentDetailsDtoToEntityDetails, c as mapDeploymentLimitsDtoToCatalogLimits, l as mapDeploymentLimitsToInput, p as mapDeploymentToCatalogItem, m as mapDeploymentToolsetCredentials, d as mapEntityDetailsToCatalogDetails, y as mapPromptToCatalogItem, V as mapPublishConversationResultDto, H as mapPublishHistoryEntryDto, O as mapSkillToCatalogItem, f as mapToolsetCredentials, h as mapToolsetToCatalogItem, T as parseSkillResourceUrl, k as readSkillFileBytes, A as readSkillFilePreviewBytes, j as readSkillManifest, J as reconcileFilterTopics, X as resolveCatalogPrimaryAction, g as resolveDeploymentFolder, R as resolveMcpResourceKind, M as resolveSkillFileDownloadPath, N as resolveSkillManifestFileId, U as toPublishEntityType, t as toPublishRuleDto, te as useApplicationCredentials, Z as useCatalogEditNavigation, $ as useCatalogItemDetails, ee as useCatalogToolsetCredentials, ie as useFavoriteEntitiesState, ae as usePublishFolders, ne as useSkillDetailsPanelData, se as useSkillFilePreview, Q as useSkillItemDetails };
@@ -27,13 +27,14 @@ var o = () => {
27
27
  progress: { percent: 100 },
28
28
  errorCode: void 0
29
29
  });
30
- }, [u]), m = n((t, n) => {
31
- s((r) => r.map((r) => r.id !== t || r.status !== e.InProgress ? r : {
32
- ...r,
30
+ }, [u]), m = n((t, n, r) => {
31
+ s((i) => i.map((i) => i.id !== t || i.status !== e.InProgress ? i : {
32
+ ...i,
33
33
  status: e.Warning,
34
34
  progress: { percent: 100 },
35
35
  errorCode: void 0,
36
- warningCode: n
36
+ warningCode: n,
37
+ warningNames: r
37
38
  }));
38
39
  }, []), h = n((t, n) => {
39
40
  u(t, {
@@ -57,7 +58,9 @@ var o = () => {
57
58
  return l.current.set(t, () => (u(t, {
58
59
  status: e.InProgress,
59
60
  progress: { percent: 0 },
60
- errorCode: void 0
61
+ errorCode: void 0,
62
+ warningCode: void 0,
63
+ warningNames: void 0
61
64
  }), r())), r();
62
65
  }, [u]);
63
66
  return r(() => {
@@ -0,0 +1,23 @@
1
+ import { StageStatus as e } from "@epam/ai-dial-chat-shared";
2
+ //#region src/conversation/stage.ts
3
+ var t = (t) => t === e.Completed ? e.Completed : t === e.Failed ? e.Failed : null, n = (e) => ({
4
+ title: e.title ?? "",
5
+ ...e.index != null && { index: e.index },
6
+ ...e.type != null && { type: e.type },
7
+ ...e.data != null && { data: e.data },
8
+ ...e.url != null && { url: e.url },
9
+ ...e.reference_type != null && { reference_type: e.reference_type },
10
+ ...e.reference_url != null && { reference_url: e.reference_url }
11
+ }), r = (e) => ({
12
+ index: e.index ?? 0,
13
+ name: e.name ?? "",
14
+ status: t(e.status),
15
+ ...e.content != null && { content: e.content },
16
+ ...e.tag != null && { tag: e.tag },
17
+ ...e.attachments?.length && { attachments: e.attachments.map(n) }
18
+ }), i = (e) => {
19
+ let t = Array.isArray(e) ? e : e?.custom_content?.stages ?? e?.customContent?.stages;
20
+ if (t?.length) return t.map(r);
21
+ };
22
+ //#endregion
23
+ export { i as mapStages, r as toStage };
@@ -191,7 +191,7 @@ var b = 5, x = 5, S = (e) => /\.(dial|zip)$/i.test(e.name), C = (e) => new Promi
191
191
  jobId: n,
192
192
  code: t.AttachmentSkipped,
193
193
  names: [...j]
194
- }), A.length > 0 ? D.failJob(n, h.Unknown) : j.size > 0 ? D.warnJob(n, t.AttachmentSkipped) : D.succeedJob(n);
194
+ }), A.length > 0 ? D.failJob(n, h.Unknown) : j.size > 0 ? D.warnJob(n, t.AttachmentSkipped, [...j]) : D.succeedJob(n);
195
195
  }
196
196
  }, [
197
197
  l,
@@ -1,121 +1,125 @@
1
1
  import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
2
  //#region src/conversation/useConversationScroll/useConversationScroll.ts
3
3
  var a = 80, o = 1, s = ({ messages: s, isAssistantTyping: c, conversationId: l }) => {
4
- let [u, d] = i(!1), f = r(null), p = r(null), m = r(null), h = r(!1), g = r(!1), _ = r(null), v = r(/* @__PURE__ */ new Map()), y = e((e, t) => {
5
- t ? v.current.set(e, t) : v.current.delete(e);
6
- }, []), b = r(null), x = e((e) => {
7
- b.current = e;
8
- }, []), S = e((e, t) => {
4
+ let [u, d] = i(!1), f = r(null), p = r(null), m = r(null), h = r(!1), g = r(!1), _ = r(null), v = r(!0), y = r(/* @__PURE__ */ new Map()), b = e((e, t) => {
5
+ t ? y.current.set(e, t) : y.current.delete(e);
6
+ }, []), x = r(null), S = e((e) => {
7
+ x.current = e;
8
+ }, []), C = e((e, t) => {
9
9
  let n = f.current;
10
10
  n && n.scrollTo({
11
11
  top: e,
12
12
  behavior: t ? "instant" : "smooth"
13
13
  });
14
- }, []), C = e(() => {
15
- m.current && (m.current.style.height = "0px"), h.current = !1, g.current = !1, _.current = null;
16
14
  }, []), w = e(() => {
15
+ m.current && (m.current.style.height = "0px"), h.current = !1, g.current = !1, _.current = null;
16
+ }, []), T = e(() => {
17
17
  let e = f.current, t = p.current;
18
18
  if (!e || !t) return null;
19
19
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
20
20
  return e.scrollTop + (r.bottom - n.top) - e.clientHeight;
21
- }, []), T = e((e = !1) => {
22
- let t = w();
23
- t != null && S(Math.max(t, 0), e);
24
- }, [S, w]), E = e(() => {
21
+ }, []), E = e((e = !1) => {
22
+ let t = T();
23
+ t != null && C(Math.max(t, 0), e);
24
+ }, [C, T]), D = e(() => {
25
25
  let e = f.current, t = p.current;
26
26
  if (!e || !t) return null;
27
27
  let n = e.getBoundingClientRect();
28
28
  return t.getBoundingClientRect().bottom - n.top - e.clientHeight;
29
- }, []), D = e(() => {
29
+ }, []), O = e(() => {
30
30
  if (!g.current) return;
31
- let e = E();
32
- e == null || e < -1 || C();
33
- }, [C, E]), O = e((e) => {
34
- let t = f.current, n = v.current.get(e);
31
+ let e = D();
32
+ e == null || e < -1 || w();
33
+ }, [w, D]), k = e((e) => {
34
+ let t = f.current, n = y.current.get(e);
35
35
  if (!t || !n) return null;
36
36
  let r = t.getBoundingClientRect(), i = n.getBoundingClientRect(), a = t.scrollTop + (i.top - r.top);
37
37
  return Math.max(a, 0);
38
- }, []), k = e((e, t = !1) => {
39
- let n = O(e);
40
- n != null && S(n, t);
41
- }, [O, S]), A = e(() => {
42
- let e = w();
38
+ }, []), A = e((e, t = !1) => {
39
+ let n = k(e);
40
+ n != null && C(n, t);
41
+ }, [k, C]), j = e(() => {
42
+ let e = T();
43
43
  return e == null ? null : Math.max(e, 0);
44
- }, [w]), j = e(() => {
44
+ }, [T]), M = e(() => {
45
45
  if (!h.current) return null;
46
- let e = _.current, t = A();
46
+ let e = _.current, t = j();
47
47
  return e == null || t == null ? null : Math.max(e, t);
48
- }, [A]), M = e(() => {
49
- let e = f.current, t = j();
48
+ }, [j]), N = e(() => {
49
+ let e = f.current, t = M();
50
50
  !e || t == null || e.scrollTop > t + o && (e.scrollTop = t);
51
- }, [j]), N = e((e) => {
52
- let t = m.current, n = A();
51
+ }, [M]), P = e((e) => {
52
+ let t = m.current, n = j();
53
53
  if (!t || n == null) return;
54
54
  let r = Math.max(e - n, 0);
55
55
  t.style.height = `${r}px`, h.current = r > 0, g.current = !1, _.current = r > 0 ? e : null;
56
- }, [A]), P = e((e) => {
57
- let t = O(e);
58
- t != null && (N(t), k(e, !1));
56
+ }, [j]), F = e((e) => {
57
+ let t = k(e);
58
+ t != null && (P(t), A(e, !1));
59
59
  }, [
60
- N,
61
- O,
62
- k
63
- ]), F = e(() => {
64
- let e = E();
65
- e != null && d(e >= a);
66
- }, [E]), I = r(s.length), L = r(null);
60
+ P,
61
+ k,
62
+ A
63
+ ]), I = e(() => {
64
+ let e = D();
65
+ if (e == null) return;
66
+ let t = e < a;
67
+ v.current = t, d(!t);
68
+ }, [D]), L = r(s.length), R = r(null);
67
69
  n(() => {
68
- let e = s.length !== I.current, t = l !== L.current, n = () => {
69
- I.current = s.length, L.current = l;
70
+ let e = s.length !== L.current, t = l !== R.current, n = () => {
71
+ L.current = s.length, R.current = l;
70
72
  };
71
- t && C();
72
- let r = b.current;
73
- if (r != null && v.current.has(r)) {
74
- b.current = null, P(r), n();
73
+ t && w();
74
+ let r = x.current;
75
+ if (r != null && y.current.has(r)) {
76
+ x.current = null, F(r), n();
75
77
  return;
76
78
  }
77
- c || ((e || t) && T(!1), n());
79
+ c || ((e || t) && E(!1), n());
78
80
  }, [
79
81
  s,
80
82
  c,
81
83
  l,
82
- T,
83
- P,
84
- C
84
+ E,
85
+ F,
86
+ w
85
87
  ]), n(() => {
86
- !c && h.current && (g.current = !0, D());
87
- }, [c, D]);
88
- let R = e(() => {
89
- M(), D(), F();
88
+ !c && h.current && (g.current = !0, O());
89
+ }, [c, O]);
90
+ let z = e(() => {
91
+ N(), O(), I();
90
92
  }, [
91
- M,
92
- D,
93
- F
93
+ N,
94
+ O,
95
+ I
94
96
  ]);
95
97
  return t(() => {
96
98
  let e = f.current;
97
- if (e) return e.addEventListener("scroll", R, { passive: !0 }), () => e.removeEventListener("scroll", R);
98
- }, [R]), t(() => {
99
+ if (e) return e.addEventListener("scroll", z, { passive: !0 }), () => e.removeEventListener("scroll", z);
100
+ }, [z]), t(() => {
99
101
  let e = p.current;
100
102
  if (!e) return;
101
103
  let t = new ResizeObserver(() => {
102
- M(), D(), F();
104
+ let e = v.current && !h.current;
105
+ N(), e && E(!0), O(), I();
103
106
  });
104
107
  return t.observe(e), () => t.disconnect();
105
108
  }, [
106
- M,
107
- D,
108
- F
109
+ N,
110
+ O,
111
+ I,
112
+ E
109
113
  ]), {
110
114
  containerRef: f,
111
115
  contentRef: p,
112
116
  spacerRef: m,
113
- setMessageRef: y,
117
+ setMessageRef: b,
114
118
  isScrollButtonVisible: u,
115
119
  scrollToBottom: e(() => {
116
- T(!1);
117
- }, [T]),
118
- armAnchor: x
120
+ E(!1);
121
+ }, [E]),
122
+ armAnchor: S
119
123
  };
120
124
  };
121
125
  //#endregion
@@ -75,4 +75,4 @@ var t = (e) => {
75
75
  });
76
76
  };
77
77
  //#endregion
78
- export { o as applyChunkToMessages };
78
+ export { o as applyChunkToMessages, a as mergeStages };