@epam/ai-dial-chat-hooks 1.1.15 → 1.1.17

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 (156) hide show
  1. package/api-error/api-error.js +3 -4
  2. package/api-transport/create-csrf-middleware.js +1 -2
  3. package/api-transport/create-unauthorized-middleware.js +5 -3
  4. package/attachment/useAttachmentAction/useAttachmentAction.js +6 -10
  5. package/attachment/useAttachmentValidation/useAttachmentValidation.js +1 -2
  6. package/catalog/catalog-derivations.js +1 -2
  7. package/catalog/catalog-primary-action.js +1 -2
  8. package/catalog/create-publish-api.js +1 -2
  9. package/catalog/deployment-endpoint-url.js +1 -2
  10. package/catalog/deployment-id.js +6 -3
  11. package/catalog/entity-details.js +1 -2
  12. package/catalog/map-deployment-limits-to-catalog.js +1 -2
  13. package/catalog/map-deployment-limits-to-input.js +1 -2
  14. package/catalog/map-deployment-to-catalog-item.js +1 -2
  15. package/catalog/map-entity-details-to-catalog.js +2 -3
  16. package/catalog/map-prompt-to-catalog-item.js +1 -2
  17. package/catalog/map-skill-to-catalog-item.js +1 -2
  18. package/catalog/mcp-endpoint-url.js +1 -2
  19. package/catalog/publish.js +1 -2
  20. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +2 -7
  21. package/catalog/useCatalogItemDetails.js +1 -2
  22. package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +1 -2
  23. package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +2 -3
  24. package/catalog/usePublishFolders/usePublishFolders.js +2 -3
  25. package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +1 -2
  26. package/catalog/useSkillItemDetails.js +4 -5
  27. package/catalog.d.ts +7 -4
  28. package/conversation/announcement-message.js +1 -2
  29. package/conversation/conversation-transfer/async.js +1 -2
  30. package/conversation/conversation-transfer/attachment-refs.js +1 -2
  31. package/conversation/conversation-transfer/build-upload-path.js +1 -2
  32. package/conversation/conversation-transfer/date.js +1 -2
  33. package/conversation/conversation-transfer/dial-file-resolve.js +1 -2
  34. package/conversation/conversation-transfer/export-conversation.js +1 -2
  35. package/conversation/conversation-transfer/import-conversation.js +7 -9
  36. package/conversation/conversation-transfer/progress.js +2 -3
  37. package/conversation/conversation-transfer/queue.js +1 -2
  38. package/conversation/conversation-transfer/types.js +1 -2
  39. package/conversation/conversation-transfer/zip-export.js +2 -9
  40. package/conversation/conversation-transfer/zip-import.js +2 -3
  41. package/conversation/create-chat-stream-api.js +2 -7
  42. package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +1 -2
  43. package/conversation/display-name-watch.js +1 -2
  44. package/conversation/footer-message.js +1 -2
  45. package/conversation/get-model-id-from-conversation-id.js +12 -13
  46. package/conversation/greeting.js +1 -2
  47. package/conversation/message-factory.js +1 -2
  48. package/conversation/message-utils.js +1 -2
  49. package/conversation/overlay-messages.js +1 -2
  50. package/conversation/quick-app-conversation-starters.js +1 -2
  51. package/conversation/starter-option.js +1 -2
  52. package/conversation/useActiveConversationSync/useActiveConversationSync.js +1 -2
  53. package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +1 -2
  54. package/conversation/useAttachmentUpload/useAttachmentUpload.js +5 -3
  55. package/conversation/useConversationExport/useConversationExport.js +12 -14
  56. package/conversation/useConversationHandlers/attachment-to-dto.js +1 -2
  57. package/conversation/useConversationHandlers/message-factory.js +1 -2
  58. package/conversation/useConversationHandlers/message-utils.js +3 -4
  59. package/conversation/useConversationHandlers/starter-option.js +1 -2
  60. package/conversation/useConversationHandlers/useConversationHandlers.js +3 -4
  61. package/conversation/useConversationImport/useConversationImport.js +29 -30
  62. package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +1 -2
  63. package/conversation/useConversationPanelItems/useConversationPanelItems.js +1 -2
  64. package/conversation/useConversationScroll/useConversationScroll.js +3 -8
  65. package/conversation/useConversationStream/apply-chunk.js +1 -2
  66. package/conversation/useConversationStream/buffered-generation.js +1 -2
  67. package/conversation/useConversationStream/conversation-path.js +3 -4
  68. package/conversation/useConversationStream/generation-resume.js +13 -17
  69. package/conversation/useConversationStream/useConversationStream.js +10 -22
  70. package/conversation/useImportFilePicker/useImportFilePicker.js +1 -2
  71. package/conversation/useTranscribeAudio/audio-transcription-error.js +1 -2
  72. package/conversation/useTranscribeAudio/transcription-retry.js +1 -2
  73. package/conversation/useTranscribeAudio/useTranscribeAudio.js +1 -2
  74. package/conversation-overlay.js +1 -2
  75. package/conversation-sources/useConversationSources/useConversationSources.js +1 -2
  76. package/conversation-sources.js +1 -2
  77. package/file-manager-canvas.js +1 -2
  78. package/files/annotation.js +1 -2
  79. package/files/attachment-canvas.js +1 -2
  80. package/files/attachment-dto-to-display.js +1 -2
  81. package/files/attachment-types.js +2 -3
  82. package/files/create-files-api.js +1 -2
  83. package/files/create-upload-file-with-progress.js +6 -14
  84. package/files/dial-file-manager-copy-move.util.js +1 -2
  85. package/files/dial-file-manager-mapping.util.js +4 -5
  86. package/files/dial-file-manager-path.util.js +1 -2
  87. package/files/dial-file-manager.model.js +1 -2
  88. package/files/dial-file-manager.types.js +1 -2
  89. package/files/dial-file-to-attachment.js +4 -5
  90. package/files/dial-file.js +1 -2
  91. package/files/dial-files-api.js +1 -2
  92. package/files/download-destination.js +1 -2
  93. package/files/file-manager-variant.js +1 -2
  94. package/files/file-name.js +1 -2
  95. package/files/prepare-download-destination.js +1 -2
  96. package/files/resolve-dial-file-api-path.js +1 -2
  97. package/files/source-content.js +2 -3
  98. package/files/useDialFileListing/useDialFileListing.js +38 -46
  99. package/files/useDialFileManager/useDialFileManager.js +1 -2
  100. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -2
  101. package/files/useDialFileMetadata/useDialFileMetadata.js +4 -5
  102. package/files/useDialFileMutations/useDialFileMutations.js +1 -2
  103. package/files/useDialFileSharing/useDialFileSharing.js +1 -2
  104. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +17 -16
  105. package/index.d.ts +7 -4
  106. package/mcp-apps/mcp-apps-api-client.js +1 -2
  107. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +1 -2
  108. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -2
  109. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +4 -8
  110. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +1 -2
  111. package/oauth/authorize-url.js +2 -3
  112. package/oauth/handshake.js +4 -12
  113. package/oauth/popup.js +1 -2
  114. package/oauth/toolset-id.js +4 -5
  115. package/oauth/types.js +1 -2
  116. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +3 -7
  117. package/oauth/useToolsetLogin/useToolsetLogin.js +1 -2
  118. package/package.json +17 -17
  119. package/prompt/export-prompt.js +1 -2
  120. package/prompt/prompt-resource.js +1 -2
  121. package/prompt/prompt.js +1 -2
  122. package/prompt/usePromptsState/usePromptsState.js +1 -2
  123. package/scheduled-task/scheduled-task-mapping.js +1 -2
  124. package/scheduled-task/scheduled-task-trigger.js +2 -3
  125. package/scroll-anchoring.js +1 -2
  126. package/shared/application-schema.js +3 -4
  127. package/shared/browser-timezone.js +1 -2
  128. package/shared/cron-weekday.js +1 -2
  129. package/shared/custom-apps.js +1 -2
  130. package/shared/external-services.js +1 -2
  131. package/shared/formatting.js +1 -2
  132. package/shared/locale.js +3 -4
  133. package/shared/string-utils.js +1 -2
  134. package/shared/toolset-login-events.js +1 -2
  135. package/skill/skill-file-batch-validation.js +19 -19
  136. package/skill/skill-file-preview.js +1 -2
  137. package/skill/skill-manifest.js +1 -2
  138. package/skill/skill-types.js +2 -3
  139. package/skill/skill.js +11 -9
  140. package/skill/useSkillEditorLoad.js +1 -2
  141. package/skill/useSkillEditorSubmit.js +2 -7
  142. package/skill/useSkillFileActions.js +1 -2
  143. package/skill/useSkillFilePreview.js +1 -2
  144. package/skill/useSkillsState/useSkillsState.js +1 -2
  145. package/skills-state.js +1 -2
  146. package/source-content.js +1 -2
  147. package/usage/map-usage-data-to-dashboard.js +1 -2
  148. package/usage/map-user-usage-to-model-limits.js +1 -2
  149. package/usage/useUsageData/useUsageData.js +1 -2
  150. package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +1 -2
  151. package/usePageFileDrag/usePageFileDrag.js +4 -5
  152. package/usePanelMaxWidth/usePanelMaxWidth.js +1 -2
  153. package/useShareLink/useShareLink.js +1 -2
  154. package/useShareRecipientsCount/useShareRecipientsCount.js +1 -2
  155. package/useToolsMenu/useToolsMenu.js +1 -2
  156. package/useViewportWidth/useViewportWidth.js +1 -2
@@ -1,4 +1,4 @@
1
- //#region src/api-error/api-error.ts
1
+ // src/api-error/api-error.ts
2
2
  var e = (e) => typeof e == "object" && !!e, t = (t) => {
3
3
  if (!e(t)) return !1;
4
4
  let { message: n, error: r } = t;
@@ -8,11 +8,11 @@ var e = (e) => typeof e == "object" && !!e, t = (t) => {
8
8
  let t = r.exec(e);
9
9
  if (!t) return;
10
10
  let [, n, o] = t;
11
- if (!(n === i || o === a)) return n;
11
+ if (n !== i && o !== a) return n;
12
12
  }, s = (t) => {
13
13
  if (!e(t)) return;
14
14
  let n = t.response;
15
- if (!(!e(n) || typeof n.json != "function")) return n;
15
+ if (e(n) && typeof n.json == "function") return n;
16
16
  }, c = (e) => {
17
17
  let t = s(e);
18
18
  return t?.status ? t.status === 404 : !1;
@@ -41,5 +41,4 @@ var e = (e) => typeof e == "object" && !!e, t = (t) => {
41
41
  traceId: u
42
42
  };
43
43
  };
44
- //#endregion
45
44
  export { d as getApiErrorDetails, u as getApiErrorMessage, l as getApiErrorStatus, c as isConversationNotFoundError };
@@ -1,4 +1,4 @@
1
- //#region src/api-transport/create-csrf-middleware.ts
1
+ // src/api-transport/create-csrf-middleware.ts
2
2
  var e = (e) => ({
3
3
  pre: async (t) => {
4
4
  let n = e.getCsrfToken();
@@ -17,5 +17,4 @@ var e = (e) => ({
17
17
  return n && e.setCsrfToken(n), t.response;
18
18
  }
19
19
  });
20
- //#endregion
21
20
  export { e as createCsrfMiddleware };
@@ -1,4 +1,4 @@
1
- //#region src/api-transport/create-unauthorized-middleware.ts
1
+ // src/api-transport/create-unauthorized-middleware.ts
2
2
  var e = async (e) => {
3
3
  try {
4
4
  return await e.clone().text();
@@ -32,10 +32,12 @@ var e = async (e) => {
32
32
  if (t.response.status === 401) throw r.notifyUnauthorized(t.url), r.createUnauthorizedError(t.url);
33
33
  if (t.response.status === 403) {
34
34
  let n = await e(t.response);
35
- if (r.isInvalidCsrfErrorBody(n)) return a(t, await i(t));
35
+ if (r.isInvalidCsrfErrorBody(n)) {
36
+ let e = await i(t);
37
+ return a(t, e);
38
+ }
36
39
  }
37
40
  return t.response;
38
41
  } };
39
42
  };
40
- //#endregion
41
43
  export { r as createUnauthorizedMiddleware };
@@ -3,14 +3,14 @@ import { AttachmentContentType as t, useAttachmentCanvas as n } from "@epam/ai-d
3
3
  import { MIMEType as r, base64ToBlob as i, ensureDownloadFilename as a, triggerAnchorDownload as o, triggerBlobDownload as s } from "@epam/ai-dial-chat-shared";
4
4
  import { parsePdfPageReference as c } from "@epam/ai-dial-quotations";
5
5
  import { useCallback as l } from "react";
6
- //#region src/attachment/useAttachmentAction/useAttachmentAction.ts
6
+ // src/attachment/useAttachmentAction/useAttachmentAction.ts
7
7
  var u = (t) => t.url != null && e(t.url) || t.data != null, d = (t, n) => {
8
8
  let { url: c, name: l, contentType: u, data: d } = t;
9
9
  if (c != null && e(c)) {
10
10
  let e = n(c);
11
- return e == null ? !1 : (o(e, a(l, c, u)), !0);
11
+ return e != null && (o(e, a(l, c, u)), !0);
12
12
  }
13
- return d == null ? !1 : (s(i(d, u || r.Plain), a(l, c, u)), !0);
13
+ return d != null && (s(i(d, u || r.Plain), a(l, c, u)), !0);
14
14
  }, f = (t, n) => {
15
15
  let { url: r } = t;
16
16
  if (r == null) return;
@@ -18,7 +18,8 @@ var u = (t) => t.url != null && e(t.url) || t.data != null, d = (t, n) => {
18
18
  if (e(i)) {
19
19
  let e = n(i);
20
20
  if (e == null) return;
21
- o(e, a(t.title ?? i.split("/").pop() ?? "", i, t.type));
21
+ let r = t.title ?? i.split("/").pop() ?? "";
22
+ o(e, a(r, i, t.type));
22
23
  } else window.open(r, "_blank", "noopener,noreferrer");
23
24
  }, p = (n, r) => {
24
25
  let i = c(n.url);
@@ -63,12 +64,7 @@ var u = (t) => t.url != null && e(t.url) || t.data != null, d = (t, n) => {
63
64
  url: i,
64
65
  title: o
65
66
  }, c = p(s, e);
66
- if (c) {
67
- t(c, o);
68
- return;
69
- }
70
- f(s, e);
67
+ c ? t(c, o) : f(s, e);
71
68
  }, [t, e]) };
72
69
  };
73
- //#endregion
74
70
  export { d as downloadAttachment, u as isDownloadableAttachment, m as useAttachmentAction };
@@ -2,7 +2,7 @@ import { mimeTypesToFileAccept as e } from "../../files/attachment-types.js";
2
2
  import { AttachmentErrorReason as t } from "@epam/ai-dial-chat-shared";
3
3
  import { useCallback as n, useEffect as r, useMemo as i, useRef as a } from "react";
4
4
  import { isMimeTypeAllowed as o, mimeTypesToExtensionLabels as s } from "@epam/ai-dial-attachment-input";
5
- //#region src/attachment/useAttachmentValidation/useAttachmentValidation.ts
5
+ // src/attachment/useAttachmentValidation/useAttachmentValidation.ts
6
6
  var c = 100, l = /* @__PURE__ */ function(e) {
7
7
  return e.NoTypesAllowed = "noTypesAllowed", e.UnsupportedType = "unsupportedType", e;
8
8
  }({}), u = ({ allowedMimeTypes: l, onValidationError: u, debounceMs: d = c }) => {
@@ -31,5 +31,4 @@ var c = 100, l = /* @__PURE__ */ function(e) {
31
31
  fileAccept: h
32
32
  };
33
33
  };
34
- //#endregion
35
34
  export { l as AttachmentValidationErrorReason, u as useAttachmentValidation };
@@ -1,4 +1,4 @@
1
- //#region src/catalog/catalog-derivations.ts
1
+ // src/catalog/catalog-derivations.ts
2
2
  var e = (e, t) => e.filter((e) => t.has(e.type)), t = (e, t) => t ? e.filter((e) => !e.isMyApp) : [...e], n = (e) => e.filter((e) => e.isUserFavorite && !e.isHidden), r = (e, t) => {
3
3
  let n = new Set(e.map((e) => e.type));
4
4
  return t.filter((e) => n.has(e));
@@ -6,5 +6,4 @@ var e = (e, t) => e.filter((e) => t.has(e.type)), t = (e, t) => t ? e.filter((e)
6
6
  let n = new Set(t.flatMap((e) => e.topics));
7
7
  return new Set(Array.from(e).filter((e) => n.has(e)));
8
8
  };
9
- //#endregion
10
9
  export { r as deriveAvailableTabIds, n as deriveFavoriteItems, e as filterCatalogItemsBySelector, t as filterHiddenOwnedItems, i as reconcileFilterTopics };
@@ -1,5 +1,5 @@
1
1
  import { CatalogEntityType as e, extractPromptParams as t } from "@epam/ai-dial-chat-shared";
2
- //#region src/catalog/catalog-primary-action.ts
2
+ // src/catalog/catalog-primary-action.ts
3
3
  var n = /* @__PURE__ */ function(e) {
4
4
  return e.Deployment = "deployment", e.Prompt = "prompt", e;
5
5
  }({}), r = async (n, r) => {
@@ -17,5 +17,4 @@ var n = /* @__PURE__ */ function(e) {
17
17
  hasParameters: t(i).length > 0
18
18
  };
19
19
  };
20
- //#endregion
21
20
  export { n as CatalogPrimaryActionType, r as resolveCatalogPrimaryAction };
@@ -1,4 +1,4 @@
1
- //#region src/catalog/create-publish-api.ts
1
+ // src/catalog/create-publish-api.ts
2
2
  var e = (e) => ({
3
3
  source: e.source,
4
4
  targets: e.targets,
@@ -23,5 +23,4 @@ var e = (e) => ({
23
23
  function: e
24
24
  }))
25
25
  });
26
- //#endregion
27
26
  export { t as createPublishApiClient, e as toPublishRuleDto };
@@ -1,6 +1,6 @@
1
1
  import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
2
  import { CodeLanguage as t } from "@epam/ai-dial-catalog";
3
- //#region src/catalog/deployment-endpoint-url.ts
3
+ // src/catalog/deployment-endpoint-url.ts
4
4
  var n = (e) => e.endsWith("/") ? e.slice(0, -1) : e, r = (t) => t.split("/").map((t) => encodeURIComponent(e(t))).join("/"), i = (t) => t.split("/").map(e).join("/"), a = (e, t) => `${n(e)}/openai/deployments/${r(t)}/chat/completions`, o = (e) => `${n(e)}/openai/v1/responses`, s = (e, n, { hasChatCompletion: r, hasResponsesApi: s }) => {
5
5
  let c = [];
6
6
  if (r) {
@@ -30,5 +30,4 @@ var n = (e) => e.endsWith("/") ? e.slice(0, -1) : e, r = (t) => t.split("/").map
30
30
  endpoints: c
31
31
  };
32
32
  };
33
- //#endregion
34
33
  export { a as buildChatCompletionsUrl, s as buildDeploymentConnectApi, o as buildResponsesUrl };
@@ -1,4 +1,4 @@
1
- //#region src/catalog/deployment-id.ts
1
+ // src/catalog/deployment-id.ts
2
2
  var e = (e) => e.split("/").map((e) => encodeURIComponent(e)).join("/"), t = (e) => e.split("/").map((e) => {
3
3
  try {
4
4
  return decodeURIComponent(e);
@@ -6,7 +6,10 @@ var e = (e) => e.split("/").map((e) => encodeURIComponent(e)).join("/"), t = (e)
6
6
  return e;
7
7
  }
8
8
  }).join("/"), n = (n) => e(t(n)), r = (e, t) => {
9
- if (t) return e.find((e) => e.id === t) ?? e.find((e) => e.reference === t);
9
+ if (!t) return;
10
+ let r = e.find((e) => e.id === t) ?? e.find((e) => e.reference === t);
11
+ if (r) return r;
12
+ let i = n(t);
13
+ return e.find((e) => n(e.id) === i);
10
14
  };
11
- //#endregion
12
15
  export { t as decodeDeploymentId, e as encodeDeploymentId, r as findDeploymentByIdOrReference, n as normalizeDeploymentId };
@@ -1,6 +1,5 @@
1
- //#region src/catalog/entity-details.ts
1
+ // src/catalog/entity-details.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.None = "NONE", e.ApiKey = "API_KEY", e.OAuth = "OAUTH", e;
4
4
  }({});
5
- //#endregion
6
5
  export { e as AuthenticationType };
@@ -1,6 +1,6 @@
1
1
  import { formatCost as e } from "@epam/ai-dial-chat-shared";
2
2
  import { CatalogLimitStatus as t } from "@epam/ai-dial-catalog";
3
- //#region src/catalog/map-deployment-limits-to-catalog.ts
3
+ // src/catalog/map-deployment-limits-to-catalog.ts
4
4
  var n = [
5
5
  {
6
6
  key: "dayTokenStats",
@@ -69,5 +69,4 @@ var n = [
69
69
  status: h(r)
70
70
  } : void 0;
71
71
  };
72
- //#endregion
73
72
  export { g as mapDeploymentLimitsDtoToCatalogLimits };
@@ -1,6 +1,6 @@
1
1
  import { formatCost as e } from "@epam/ai-dial-chat-shared";
2
2
  import { CatalogLimitStatus as t } from "@epam/ai-dial-catalog";
3
- //#region src/catalog/map-deployment-limits-to-input.ts
3
+ // src/catalog/map-deployment-limits-to-input.ts
4
4
  var n = [
5
5
  {
6
6
  key: "dayTokenStats",
@@ -82,5 +82,4 @@ var n = [
82
82
  status: g(o)
83
83
  } : void 0;
84
84
  };
85
- //#endregion
86
85
  export { v as mapDeploymentLimitsToInput };
@@ -4,7 +4,7 @@ import { resolveLocalizedText as n } from "../shared/locale.js";
4
4
  import { mapEntityDetailsToCatalogDetails as r } from "./map-entity-details-to-catalog.js";
5
5
  import { CatalogEntityType as i, formatLastUsed as a } from "@epam/ai-dial-chat-shared";
6
6
  import { CredentialStatus as o, ToolsetAuthenticationType as s } from "@epam/ai-dial-catalog";
7
- //#region src/catalog/map-deployment-to-catalog-item.ts
7
+ // src/catalog/map-deployment-to-catalog-item.ts
8
8
  var c = {
9
9
  NONE: s.None,
10
10
  API_KEY: s.ApiKey,
@@ -88,5 +88,4 @@ var c = {
88
88
  details: f.length > 0 ? { tools: { tools: f.map((e) => ({ name: e })) } } : void 0
89
89
  };
90
90
  };
91
- //#endregion
92
91
  export { v as mapDeploymentToCatalogItem, u as mapDeploymentToolsetCredentials, y as mapToolsetToCatalogItem, g as resolveDeploymentFolder };
@@ -4,7 +4,7 @@ import { formatCalendarDate as n } from "../shared/formatting.js";
4
4
  import { formatUnitPrice as r } from "@epam/ai-dial-chat-shared";
5
5
  import { mimeTypesToExtensionLabels as i } from "@epam/ai-dial-attachment-input";
6
6
  import { CredentialStatus as a, ToolsetAuthenticationType as o } from "@epam/ai-dial-catalog";
7
- //#region src/catalog/map-entity-details-to-catalog.ts
7
+ // src/catalog/map-entity-details-to-catalog.ts
8
8
  var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens` : `${e} tokens`, c = (e) => {
9
9
  let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
10
10
  if (t == null) return e;
@@ -309,7 +309,7 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
309
309
  }, O = (t) => t === e.None || t === e.ApiKey || t === e.OAuth, k = (e) => {
310
310
  if (e == null) return;
311
311
  let { globalAuthStatus: t, appLevelAuthStatus: n, userLevelAuthStatus: r, scopesSupported: i, authorizationEndpoint: a, tokenEndpoint: o, apiKeyHeader: s } = e;
312
- if (!(t == null && n == null && r == null && a == null && o == null && s == null && !i?.length)) return {
312
+ if (t != null || n != null || r != null || a != null || o != null || s != null || i?.length) return {
313
313
  global: t,
314
314
  appLevel: n,
315
315
  userLevel: r,
@@ -346,5 +346,4 @@ var s = (e) => e >= 1e6 ? `${e / 1e6}M tokens` : e >= 1e3 ? `${e / 1e3}K tokens`
346
346
  case "toolset": return A(e);
347
347
  }
348
348
  };
349
- //#endregion
350
349
  export { j as mapDeploymentDetailsDtoToEntityDetails, C as mapEntityDetailsToCatalogDetails, b as mapToolsetCredentials };
@@ -2,7 +2,7 @@ import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
2
  import { formatCalendarDate as t } from "../shared/formatting.js";
3
3
  import { PromptSource as n } from "../prompt/prompt-resource.js";
4
4
  import { CatalogEntityType as r, formatLastUsed as i } from "@epam/ai-dial-chat-shared";
5
- //#region src/catalog/map-prompt-to-catalog-item.ts
5
+ // src/catalog/map-prompt-to-catalog-item.ts
6
6
  var a = {
7
7
  [n.Personal]: "personal",
8
8
  [n.SharedWithMe]: "shared",
@@ -45,5 +45,4 @@ var a = {
45
45
  }
46
46
  };
47
47
  };
48
- //#endregion
49
48
  export { s as buildPromptOverview, c as isOrganisationPromptItem, l as mapPromptToCatalogItem };
@@ -5,7 +5,7 @@ import { SkillSource as r } from "../skill/skill-types.js";
5
5
  import { CatalogEntityType as i, formatLastUsed as a } from "@epam/ai-dial-chat-shared";
6
6
  import { CatalogContentNodeType as o } from "@epam/ai-dial-catalog";
7
7
  import { SkillMetadataItemDtoNodeTypeEnum as s } from "@epam/ai-dial-chat-api-client";
8
- //#region src/catalog/map-skill-to-catalog-item.ts
8
+ // src/catalog/map-skill-to-catalog-item.ts
9
9
  var c = {
10
10
  [r.Personal]: "personal",
11
11
  [r.SharedWithMe]: "shared",
@@ -119,5 +119,4 @@ var c = {
119
119
  let t = await x(e);
120
120
  return t == null ? null : new TextDecoder().decode(t);
121
121
  };
122
- //#endregion
123
122
  export { b as buildSkillContentTree, _ as buildSkillOverview, u as mapSkillToCatalogItem, x as readSkillFileBytes, S as readSkillFilePreviewBytes, C as readSkillManifest, g as resolveSkillFileDownloadPath, m as resolveSkillManifestFileId };
@@ -1,6 +1,6 @@
1
1
  import { CatalogEntityType as e } from "@epam/ai-dial-chat-shared";
2
2
  import { CodeLanguage as t } from "@epam/ai-dial-catalog";
3
- //#region src/catalog/mcp-endpoint-url.ts
3
+ // src/catalog/mcp-endpoint-url.ts
4
4
  var n = /* @__PURE__ */ function(e) {
5
5
  return e.Toolset = "toolset", e.Application = "application", e;
6
6
  }({}), r = (e) => {
@@ -22,5 +22,4 @@ var n = /* @__PURE__ */ function(e) {
22
22
  }]
23
23
  };
24
24
  };
25
- //#endregion
26
25
  export { n as McpResourceKind, s as buildApplicationMcpUrl, u as buildConnectApi, o as buildToolsetMcpUrl, l as resolveMcpResourceKind };
@@ -1,6 +1,6 @@
1
1
  import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
2
  import { CatalogEntityType as t } from "@epam/ai-dial-chat-shared";
3
- //#region src/catalog/publish.ts
3
+ // src/catalog/publish.ts
4
4
  var n = {
5
5
  [t.Model]: "model",
6
6
  [t.Toolset]: "toolset",
@@ -15,5 +15,4 @@ var n = {
15
15
  publishedAt: Date.parse(e.publishedAt),
16
16
  folderPath: e.folderPath.split("/").filter(Boolean)
17
17
  });
18
- //#endregion
19
18
  export { o as getPublicCatalogEntityFolderPath, a as isPublicCatalogEntityId, c as mapPublishConversationResultDto, s as mapPublishHistoryEntryDto, r as toPublishEntityType };
@@ -3,7 +3,7 @@ import { findDeploymentByIdOrReference as t } from "../deployment-id.js";
3
3
  import { parseSkillResourceUrl as n } from "../../skill/skill-types.js";
4
4
  import { CatalogEntityType as r } from "@epam/ai-dial-chat-shared";
5
5
  import { useCallback as i, useMemo as a } from "react";
6
- //#region src/catalog/useCatalogEditNavigation/useCatalogEditNavigation.ts
6
+ // src/catalog/useCatalogEditNavigation/useCatalogEditNavigation.ts
7
7
  var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHideCustomAppCreationEnabled: l, isToolsetsEnabled: u, isPromptsEnabled: d, quickAppSchemaId: f, urls: p, onNavigate: m, deletePrompt: h, deleteToolset: g, deleteSkill: _, deleteApplication: v, refetchPrompts: y, refetchToolsets: b, refetchSkills: x, refetchDeployments: S, onDeleteSuccess: C, labels: w, onNotify: T, onSkillUploadClick: E }) => ({
8
8
  handleEdit: i((e) => {
9
9
  if (e.type === r.Prompt) {
@@ -19,11 +19,7 @@ var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHid
19
19
  return;
20
20
  }
21
21
  let n = t(o, e.id);
22
- if (s && n != null && !n.applicationTypeSchemaId) {
23
- m(p.buildCustomAppEditUrl(e.id));
24
- return;
25
- }
26
- f && m(p.buildQuickAppEditUrl(f, e.id));
22
+ s && n != null && !n.applicationTypeSchemaId ? m(p.buildCustomAppEditUrl(e.id)) : f && m(p.buildQuickAppEditUrl(f, e.id));
27
23
  }, [
28
24
  o,
29
25
  s,
@@ -105,5 +101,4 @@ var o = ({ deployments: o, isCustomAppsEnabled: s, isSchemaAppsEnabled: c, isHid
105
101
  E
106
102
  ])
107
103
  });
108
- //#endregion
109
104
  export { o as useCatalogEditNavigation };
@@ -7,7 +7,7 @@ import { buildConnectApi as c, resolveMcpResourceKind as l } from "./mcp-endpoin
7
7
  import { useSkillItemDetails as u } from "./useSkillItemDetails.js";
8
8
  import { CatalogEntityType as d } from "@epam/ai-dial-chat-shared";
9
9
  import { useCallback as f } from "react";
10
- //#region src/catalog/useCatalogItemDetails.ts
10
+ // src/catalog/useCatalogItemDetails.ts
11
11
  var p = (e) => (t) => {
12
12
  if (!s(t)) return e.getPrompt(t.id);
13
13
  let n = a(t.id);
@@ -56,5 +56,4 @@ var p = (e) => (t) => {
56
56
  onLoadSkillDetailsFile: x
57
57
  };
58
58
  };
59
- //#endregion
60
59
  export { m as useCatalogItemDetails };
@@ -4,7 +4,7 @@ import { ToolsetLoginOutcomeType as r, useToolsetLogin as i } from "../../oauth/
4
4
  import { useCallback as a } from "react";
5
5
  import { CredentialStatus as o, CredentialsLevel as s, ToolsetAuthenticationType as c } from "@epam/ai-dial-catalog";
6
6
  import { NotificationVariant as l } from "@epam/ai-dial-ui-kit";
7
- //#region src/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.ts
7
+ // src/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.ts
8
8
  var u = (e, t, n) => e === s.User ? n.user : t ? n.org : n.global, d = (e) => {
9
9
  switch (e) {
10
10
  case c.ApiKey: return t.ApiKey;
@@ -142,5 +142,4 @@ var u = (e, t, n) => e === s.User ? n.user : t ? n.org : n.global, d = (e) => {
142
142
  ])
143
143
  };
144
144
  };
145
- //#endregion
146
145
  export { f as useCatalogToolsetCredentials };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
2
- //#region src/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.ts
2
+ // src/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.ts
3
3
  var i = /* @__PURE__ */ function(e) {
4
4
  return e.Deployment = "deployment", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e;
5
5
  }({}), a = ({ loadFavorites: i, updateFavorite: a }) => {
@@ -9,7 +9,7 @@ var i = /* @__PURE__ */ function(e) {
9
9
  return (async () => {
10
10
  try {
11
11
  let t = await i();
12
- e.value || s(new Set([
12
+ e.value || s(/* @__PURE__ */ new Set([
13
13
  ...t.deployments,
14
14
  ...t.toolsets,
15
15
  ...t.prompts,
@@ -46,5 +46,4 @@ var i = /* @__PURE__ */ function(e) {
46
46
  u
47
47
  ]);
48
48
  };
49
- //#endregion
50
49
  export { i as FavoriteEntityType, a as useFavoriteEntitiesState };
@@ -1,7 +1,7 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
2
2
  import { ListFilesItemDtoNodeTypeEnum as i } from "@epam/ai-dial-chat-api-client";
3
3
  import { fromFolderPathKey as a, mergeFolderPaths as o, toFolderPathKey as s } from "@epam/ai-dial-publish-panel";
4
- //#region src/catalog/usePublishFolders/usePublishFolders.ts
4
+ // src/catalog/usePublishFolders/usePublishFolders.ts
5
5
  var c = "Production", l = 50, u = (e, t, n) => {
6
6
  let r = e.get(t);
7
7
  return r == null ? [] : r.filter((e) => e.nodeType === i.Folder).map((r) => {
@@ -48,7 +48,7 @@ var c = "Production", l = 50, u = (e, t, n) => {
48
48
  return b((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
49
49
  }, []), T = e((e) => {
50
50
  let t = s(e), n = Array.isArray(d) ? d : [];
51
- !t || n.includes(t) || f?.([t, ...n].slice(0, l));
51
+ t && !n.includes(t) && f?.([t, ...n].slice(0, l));
52
52
  }, [d, f]), E = e((e) => !e.includes(c), []);
53
53
  return {
54
54
  folderItems: n(() => {
@@ -68,5 +68,4 @@ var c = "Production", l = 50, u = (e, t, n) => {
68
68
  hasPublishWriteAccess: E
69
69
  };
70
70
  };
71
- //#endregion
72
71
  export { d as usePublishFolders };
@@ -2,7 +2,7 @@ import { SkillSource as e } from "../../skill/skill-types.js";
2
2
  import { mapSkillToCatalogItem as t } from "../map-skill-to-catalog-item.js";
3
3
  import { useSkillItemDetails as n } from "../useSkillItemDetails.js";
4
4
  import { useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
5
- //#region src/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.ts
5
+ // src/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.ts
6
6
  var s = ({ api: s, skills: c, sharedWithMe: l, publicSkills: u, skillId: d, folderLabels: f, skillOverviewLabels: p, favoriteIds: m }) => {
7
7
  let h = i(() => [
8
8
  ...c,
@@ -55,5 +55,4 @@ var s = ({ api: s, skills: c, sharedWithMe: l, publicSkills: u, skillId: d, fold
55
55
  onLoadSkillDetailsFile: _
56
56
  };
57
57
  };
58
- //#endregion
59
58
  export { s as useSkillDetailsPanelData };
@@ -3,7 +3,7 @@ import { parseSkillResourceUrl as t } from "../skill/skill-types.js";
3
3
  import { buildSkillContentTree as n, buildSkillOverview as r, readSkillFilePreviewBytes as i, readSkillManifest as a, resolveSkillFileDownloadPath as o, resolveSkillManifestFileId as s } from "./map-skill-to-catalog-item.js";
4
4
  import { parseSkillManifestDocument as c } from "../skill/skill-manifest.js";
5
5
  import { useCallback as l, useRef as u } from "react";
6
- //#region src/catalog/useSkillItemDetails.ts
6
+ // src/catalog/useSkillItemDetails.ts
7
7
  var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
8
8
  let m = u(null);
9
9
  return {
@@ -22,7 +22,7 @@ var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
22
22
  }),
23
23
  d.getSkillMetadata(l, u)
24
24
  ]), v = h.status === "fulfilled" && h.value != null ? c(h.value) : void 0, y = _.status === "fulfilled" ? _.value : f.find((e) => e.url === i.id), b = g.status === "fulfilled" ? r(y, g.value.items, v?.about, p) : void 0, x = g.status === "fulfilled" ? n(g.value.items, u) : [], S = g.status === "fulfilled" ? s(g.value.items, u) : e;
25
- if (!(v == null && b == null)) return {
25
+ if (v != null || b != null) return {
26
26
  ...v == null ? {} : { promptContent: {
27
27
  content: v.body,
28
28
  ...v.description == null ? {} : { description: v.description },
@@ -41,8 +41,8 @@ var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
41
41
  if (t == null) return;
42
42
  let n = o(e, t.path);
43
43
  if (n == null) return;
44
- let r = await a(await d.downloadSkillFile(t.bucket, t.path, n));
45
- if (r != null) return n === "SKILL.md" ? c(r).body : r;
44
+ let r = await d.downloadSkillFile(t.bucket, t.path, n), i = await a(r);
45
+ if (i != null) return n === "SKILL.md" ? c(i).body : i;
46
46
  }, [d]),
47
47
  onLoadSkillDetailsFile: l(async (e) => {
48
48
  let t = m.current;
@@ -59,5 +59,4 @@ var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
59
59
  }, [d])
60
60
  };
61
61
  };
62
- //#endregion
63
62
  export { d as useSkillItemDetails };
package/catalog.d.ts CHANGED
@@ -390,10 +390,13 @@ export declare const filterHiddenOwnedItems: (items: readonly CatalogItem[], hid
390
390
 
391
391
  /**
392
392
  * Finds a deployment matching `idOrReference` by `id` first, falling back to
393
- * `reference` when no `id` matches. DIAL Core sometimes addresses a
394
- * deployment by `reference` in places that store a deployment id (e.g. a
395
- * conversation's or message's `model.id`), so lookups against the fetched
396
- * deployments list must accept either value.
393
+ * `reference` when no `id` matches, and finally to an `id` match that ignores
394
+ * percent-encoding. DIAL Core sometimes addresses a deployment by `reference`
395
+ * in places that store a deployment id (e.g. a conversation's or message's
396
+ * `model.id`), and a conversation created by a Custom Viewer (a DIAL Loop
397
+ * agent) may store the raw, human-readable application id while the listing
398
+ * returns it encoded ([#9275](https://github.com/epam/ai-dial-chat/issues/9275)), so lookups against the fetched deployments
399
+ * list must accept any of these forms.
397
400
  */
398
401
  export declare const findDeploymentByIdOrReference: (deployments: DeploymentItemDto[], idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
399
402
 
@@ -1,5 +1,5 @@
1
1
  import e from "dompurify";
2
- //#region src/conversation/announcement-message.ts
2
+ // src/conversation/announcement-message.ts
3
3
  var t = {
4
4
  ALLOWED_TAGS: [
5
5
  "a",
@@ -49,5 +49,4 @@ var r = (n) => e.sanitize(n, t), i = (t) => e.sanitize(t, n), a = (e) => typeof
49
49
  }, n = e.items ?? [];
50
50
  return n.length > 0 && (t.items = c(n)), JSON.stringify(t);
51
51
  };
52
- //#endregion
53
52
  export { l as buildAnnouncementSignature, s as hasAnnouncementContent, o as hasStructuredAnnouncement, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml };
@@ -1,4 +1,4 @@
1
- //#region src/conversation/conversation-transfer/async.ts
1
+ // src/conversation/conversation-transfer/async.ts
2
2
  var e = async (e, t, n) => {
3
3
  let r = [], i = 0, a = async () => {
4
4
  let t = i;
@@ -14,5 +14,4 @@ var e = async (e, t, n) => {
14
14
  };
15
15
  return await Promise.all(Array.from({ length: Math.min(t, e.length) }, a)), r;
16
16
  };
17
- //#endregion
18
17
  export { e as runWithConcurrency };
@@ -1,4 +1,4 @@
1
- //#region src/conversation/conversation-transfer/attachment-refs.ts
1
+ // src/conversation/conversation-transfer/attachment-refs.ts
2
2
  var e = (e) => e.startsWith("files/"), t = /^#[\w.=%-]*$/, n = (e) => {
3
3
  let n = e.indexOf("#");
4
4
  if (n < 0) return {
@@ -32,5 +32,4 @@ var e = (e) => e.startsWith("files/"), t = /^#[\w.=%-]*$/, n = (e) => {
32
32
  a(e.url), a(e.reference_url);
33
33
  }), Array.from(i, (e) => ({ fileId: e }));
34
34
  };
35
- //#endregion
36
35
  export { i as collectAttachmentRefs, n as splitFileIdAnchor };
@@ -1,5 +1,5 @@
1
1
  import { formatDateYM as e } from "./date.js";
2
- //#region src/conversation/conversation-transfer/build-upload-path.ts
2
+ // src/conversation/conversation-transfer/build-upload-path.ts
3
3
  var t = (e) => {
4
4
  let t = e.lastIndexOf("."), n = t > 0;
5
5
  return {
@@ -26,5 +26,4 @@ var t = (e) => {
26
26
  }
27
27
  };
28
28
  };
29
- //#endregion
30
29
  export { i as createUploadPathAllocator };
@@ -1,4 +1,3 @@
1
- //#region src/conversation/conversation-transfer/date.ts
1
+ // src/conversation/conversation-transfer/date.ts
2
2
  var e = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, t = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
3
- //#endregion
4
3
  export { t as formatDateYM, e as formatDateYMD };
@@ -1,4 +1,4 @@
1
- //#region src/conversation/conversation-transfer/dial-file-resolve.ts
1
+ // src/conversation/conversation-transfer/dial-file-resolve.ts
2
2
  var e = (e) => e.startsWith("files/"), t = (t) => {
3
3
  if (!e(t)) return;
4
4
  let n = t.slice(6), r = n.indexOf("/");
@@ -14,5 +14,4 @@ var e = (e) => e.startsWith("files/"), t = (t) => {
14
14
  path: o
15
15
  };
16
16
  };
17
- //#endregion
18
17
  export { t as resolveDialFileBucketAndPath };
@@ -1,6 +1,6 @@
1
1
  import { formatDateYMD as e } from "./date.js";
2
2
  import { ExportFileNameKind as t } from "./types.js";
3
- //#region src/conversation/conversation-transfer/export-conversation.ts
3
+ // src/conversation/conversation-transfer/export-conversation.ts
4
4
  var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) => {
5
5
  let t = e.custom_content;
6
6
  if (!t) return e;
@@ -28,5 +28,4 @@ var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) =>
28
28
  [t.SingleConversationWithAttachments]: "dial",
29
29
  [t.AllConversationsHistory]: "json"
30
30
  }, l = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${c[t]}`;
31
- //#endregion
32
31
  export { n as EXPORT_APP_NAME, o as buildExportEnvelope, l as buildExportFileName, s as serializeExportEnvelope, a as stripConversationAttachments };