@epam/ai-dial-chat-hooks 1.1.16 → 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 (154) 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 +1 -2
  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/conversation/announcement-message.js +1 -2
  28. package/conversation/conversation-transfer/async.js +1 -2
  29. package/conversation/conversation-transfer/attachment-refs.js +1 -2
  30. package/conversation/conversation-transfer/build-upload-path.js +1 -2
  31. package/conversation/conversation-transfer/date.js +1 -2
  32. package/conversation/conversation-transfer/dial-file-resolve.js +1 -2
  33. package/conversation/conversation-transfer/export-conversation.js +1 -2
  34. package/conversation/conversation-transfer/import-conversation.js +7 -9
  35. package/conversation/conversation-transfer/progress.js +2 -3
  36. package/conversation/conversation-transfer/queue.js +1 -2
  37. package/conversation/conversation-transfer/types.js +1 -2
  38. package/conversation/conversation-transfer/zip-export.js +2 -9
  39. package/conversation/conversation-transfer/zip-import.js +2 -3
  40. package/conversation/create-chat-stream-api.js +2 -7
  41. package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +1 -2
  42. package/conversation/display-name-watch.js +1 -2
  43. package/conversation/footer-message.js +1 -2
  44. package/conversation/get-model-id-from-conversation-id.js +12 -13
  45. package/conversation/greeting.js +1 -2
  46. package/conversation/message-factory.js +1 -2
  47. package/conversation/message-utils.js +1 -2
  48. package/conversation/overlay-messages.js +1 -2
  49. package/conversation/quick-app-conversation-starters.js +1 -2
  50. package/conversation/starter-option.js +1 -2
  51. package/conversation/useActiveConversationSync/useActiveConversationSync.js +1 -2
  52. package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +1 -2
  53. package/conversation/useAttachmentUpload/useAttachmentUpload.js +5 -3
  54. package/conversation/useConversationExport/useConversationExport.js +12 -14
  55. package/conversation/useConversationHandlers/attachment-to-dto.js +1 -2
  56. package/conversation/useConversationHandlers/message-factory.js +1 -2
  57. package/conversation/useConversationHandlers/message-utils.js +3 -4
  58. package/conversation/useConversationHandlers/starter-option.js +1 -2
  59. package/conversation/useConversationHandlers/useConversationHandlers.js +3 -4
  60. package/conversation/useConversationImport/useConversationImport.js +29 -30
  61. package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +1 -2
  62. package/conversation/useConversationPanelItems/useConversationPanelItems.js +1 -2
  63. package/conversation/useConversationScroll/useConversationScroll.js +3 -8
  64. package/conversation/useConversationStream/apply-chunk.js +1 -2
  65. package/conversation/useConversationStream/buffered-generation.js +1 -2
  66. package/conversation/useConversationStream/conversation-path.js +3 -4
  67. package/conversation/useConversationStream/generation-resume.js +13 -17
  68. package/conversation/useConversationStream/useConversationStream.js +10 -22
  69. package/conversation/useImportFilePicker/useImportFilePicker.js +1 -2
  70. package/conversation/useTranscribeAudio/audio-transcription-error.js +1 -2
  71. package/conversation/useTranscribeAudio/transcription-retry.js +1 -2
  72. package/conversation/useTranscribeAudio/useTranscribeAudio.js +1 -2
  73. package/conversation-overlay.js +1 -2
  74. package/conversation-sources/useConversationSources/useConversationSources.js +1 -2
  75. package/conversation-sources.js +1 -2
  76. package/file-manager-canvas.js +1 -2
  77. package/files/annotation.js +1 -2
  78. package/files/attachment-canvas.js +1 -2
  79. package/files/attachment-dto-to-display.js +1 -2
  80. package/files/attachment-types.js +2 -3
  81. package/files/create-files-api.js +1 -2
  82. package/files/create-upload-file-with-progress.js +6 -14
  83. package/files/dial-file-manager-copy-move.util.js +1 -2
  84. package/files/dial-file-manager-mapping.util.js +4 -5
  85. package/files/dial-file-manager-path.util.js +1 -2
  86. package/files/dial-file-manager.model.js +1 -2
  87. package/files/dial-file-manager.types.js +1 -2
  88. package/files/dial-file-to-attachment.js +4 -5
  89. package/files/dial-file.js +1 -2
  90. package/files/dial-files-api.js +1 -2
  91. package/files/download-destination.js +1 -2
  92. package/files/file-manager-variant.js +1 -2
  93. package/files/file-name.js +1 -2
  94. package/files/prepare-download-destination.js +1 -2
  95. package/files/resolve-dial-file-api-path.js +1 -2
  96. package/files/source-content.js +2 -3
  97. package/files/useDialFileListing/useDialFileListing.js +38 -46
  98. package/files/useDialFileManager/useDialFileManager.js +1 -2
  99. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -2
  100. package/files/useDialFileMetadata/useDialFileMetadata.js +4 -5
  101. package/files/useDialFileMutations/useDialFileMutations.js +1 -2
  102. package/files/useDialFileSharing/useDialFileSharing.js +1 -2
  103. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +17 -16
  104. package/mcp-apps/mcp-apps-api-client.js +1 -2
  105. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +1 -2
  106. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -2
  107. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +4 -8
  108. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +1 -2
  109. package/oauth/authorize-url.js +2 -3
  110. package/oauth/handshake.js +4 -12
  111. package/oauth/popup.js +1 -2
  112. package/oauth/toolset-id.js +4 -5
  113. package/oauth/types.js +1 -2
  114. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +3 -7
  115. package/oauth/useToolsetLogin/useToolsetLogin.js +1 -2
  116. package/package.json +17 -17
  117. package/prompt/export-prompt.js +1 -2
  118. package/prompt/prompt-resource.js +1 -2
  119. package/prompt/prompt.js +1 -2
  120. package/prompt/usePromptsState/usePromptsState.js +1 -2
  121. package/scheduled-task/scheduled-task-mapping.js +1 -2
  122. package/scheduled-task/scheduled-task-trigger.js +2 -3
  123. package/scroll-anchoring.js +1 -2
  124. package/shared/application-schema.js +3 -4
  125. package/shared/browser-timezone.js +1 -2
  126. package/shared/cron-weekday.js +1 -2
  127. package/shared/custom-apps.js +1 -2
  128. package/shared/external-services.js +1 -2
  129. package/shared/formatting.js +1 -2
  130. package/shared/locale.js +3 -4
  131. package/shared/string-utils.js +1 -2
  132. package/shared/toolset-login-events.js +1 -2
  133. package/skill/skill-file-batch-validation.js +19 -19
  134. package/skill/skill-file-preview.js +1 -2
  135. package/skill/skill-manifest.js +1 -2
  136. package/skill/skill-types.js +2 -3
  137. package/skill/skill.js +11 -9
  138. package/skill/useSkillEditorLoad.js +1 -2
  139. package/skill/useSkillEditorSubmit.js +2 -7
  140. package/skill/useSkillFileActions.js +1 -2
  141. package/skill/useSkillFilePreview.js +1 -2
  142. package/skill/useSkillsState/useSkillsState.js +1 -2
  143. package/skills-state.js +1 -2
  144. package/source-content.js +1 -2
  145. package/usage/map-usage-data-to-dashboard.js +1 -2
  146. package/usage/map-user-usage-to-model-limits.js +1 -2
  147. package/usage/useUsageData/useUsageData.js +1 -2
  148. package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +1 -2
  149. package/usePageFileDrag/usePageFileDrag.js +4 -5
  150. package/usePanelMaxWidth/usePanelMaxWidth.js +1 -2
  151. package/useShareLink/useShareLink.js +1 -2
  152. package/useShareRecipientsCount/useShareRecipientsCount.js +1 -2
  153. package/useToolsMenu/useToolsMenu.js +1 -2
  154. package/useViewportWidth/useViewportWidth.js +1 -2
package/prompt/prompt.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/prompt/prompt.ts
1
+ // src/prompt/prompt.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.Required = "required", e.TooLong = "tooLong", e.InvalidName = "invalidName", e.Conflict = "conflict", e;
4
4
  }({}), t = /^(?!\.{1,2}$)[a-zA-Z0-9 _.-]+$/, n = 256, r = 2e3, i = 5e4, a = 10, o = (e) => {
@@ -8,5 +8,4 @@ var e = /* @__PURE__ */ function(e) {
8
8
  let n = t - e.length;
9
9
  return n <= 10 ? n : null;
10
10
  }, u = (e, t) => e ? `${e}/${t}` : t;
11
- //#endregion
12
11
  export { i as PROMPT_CONTENT_MAX_LENGTH, a as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, r as PROMPT_DESCRIPTION_MAX_LENGTH, n as PROMPT_NAME_MAX_LENGTH, e as PromptFieldError, u as buildPromptPath, l as getRemainingCharacters, c as validatePromptContent, s as validatePromptDescription, o as validatePromptName };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
2
- //#region src/prompt/usePromptsState/usePromptsState.ts
2
+ // src/prompt/usePromptsState/usePromptsState.ts
3
3
  var i = ({ listPrompts: i }) => {
4
4
  let [a, o] = r([]), [s, c] = r([]), [l, u] = r([]), [d, f] = r([]), [p, m] = r([]), [h, g] = r(!0), [_, v] = r(null), y = e(async () => {
5
5
  try {
@@ -38,5 +38,4 @@ var i = ({ listPrompts: i }) => {
38
38
  y
39
39
  ]);
40
40
  };
41
- //#endregion
42
41
  export { i as usePromptsState };
@@ -1,6 +1,5 @@
1
- //#region src/scheduled-task/scheduled-task-mapping.ts
1
+ // src/scheduled-task/scheduled-task-mapping.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.UnsupportedCronShape = "unsupportedCronShape", e.UnsupportedTriggerType = "unsupportedTriggerType", e.MissingRequiredFields = "missingRequiredFields", e;
4
4
  }({});
5
- //#endregion
6
5
  export { e as UnsupportedTriggerReason };
@@ -2,8 +2,8 @@ import { padTwoDigits as e } from "../shared/formatting.js";
2
2
  import { UnsupportedTriggerReason as t } from "./scheduled-task-mapping.js";
3
3
  import { apSchedulerDayToJsDay as n, jsDayToApSchedulerDay as r } from "../shared/cron-weekday.js";
4
4
  import { ScheduledTaskRepeat as i } from "@epam/ai-dial-scheduled-tasks";
5
- //#region src/scheduled-task/scheduled-task-trigger.ts
6
- var a = new Set([
5
+ // src/scheduled-task/scheduled-task-trigger.ts
6
+ var a = /* @__PURE__ */ new Set([
7
7
  "hour",
8
8
  "minute",
9
9
  "day_of_week",
@@ -140,5 +140,4 @@ var a = new Set([
140
140
  }
141
141
  };
142
142
  };
143
- //#endregion
144
143
  export { l as mapFormValuesToCreateBody, u as mapFormValuesToUpdateBody, m as mapScheduledTaskDtoToFormValues };
@@ -1,2 +1 @@
1
- import { useConversationScroll as e } from "./conversation/useConversationScroll/useConversationScroll.js";
2
- export { e as useConversationScroll };
1
+ export { useConversationScroll } from "./conversation/useConversationScroll/useConversationScroll.js";
@@ -1,4 +1,3 @@
1
- //#region src/shared/application-schema.ts
2
- var e = "custom_app", t = (t) => !!t && t.id === e, n = (e) => !!e && (!!e.id?.endsWith("quickapps2") || e.displayName === "Quick app 2.0");
3
- //#endregion
4
- export { t as isCustomAppSchema, n as isQuickAppSchema };
1
+ // src/shared/application-schema.ts
2
+ var e = (e) => !!e && e.id === "custom_app", t = (e) => !!e && (!!e.id?.endsWith("quickapps2") || e.displayName === "Quick app 2.0");
3
+ export { e as isCustomAppSchema, t as isQuickAppSchema };
@@ -1,4 +1,4 @@
1
- //#region src/shared/browser-timezone.ts
1
+ // src/shared/browser-timezone.ts
2
2
  var e = () => {
3
3
  try {
4
4
  return Intl.DateTimeFormat().resolvedOptions().timeZone || void 0;
@@ -6,5 +6,4 @@ var e = () => {
6
6
  return;
7
7
  }
8
8
  };
9
- //#endregion
10
9
  export { e as getBrowserTimezone };
@@ -1,4 +1,3 @@
1
- //#region src/shared/cron-weekday.ts
1
+ // src/shared/cron-weekday.ts
2
2
  var e = (e) => (e + 1) % 7, t = (e) => (e + 6) % 7;
3
- //#endregion
4
3
  export { e as apSchedulerDayToJsDay, t as jsDayToApSchedulerDay };
@@ -1,4 +1,4 @@
1
- //#region src/shared/custom-apps.ts
1
+ // src/shared/custom-apps.ts
2
2
  var e = (e) => {
3
3
  let t = e.trim();
4
4
  if (!t || !/^https?:\/\//.test(t)) return !1;
@@ -26,5 +26,4 @@ var e = (e) => {
26
26
  return !1;
27
27
  }
28
28
  };
29
- //#endregion
30
29
  export { e as isValidAbsoluteUrl, r as isValidFeaturesData, t as parseFeaturesData };
@@ -1,4 +1,4 @@
1
- //#region src/shared/external-services.ts
1
+ // src/shared/external-services.ts
2
2
  var e = "/external_services/", t = (t) => {
3
3
  let n = t.indexOf(e);
4
4
  if (n === -1) return null;
@@ -14,5 +14,4 @@ var e = "/external_services/", t = (t) => {
14
14
  return e;
15
15
  }
16
16
  };
17
- //#endregion
18
17
  export { n as buildExternalServiceScopeId, r as getExternalServiceFallbackName, t as parseExternalServiceUrl };
@@ -1,4 +1,3 @@
1
- //#region src/shared/formatting.ts
1
+ // src/shared/formatting.ts
2
2
  var e = (e) => String(e).padStart(2, "0"), t = (e) => new Date(e).toLocaleDateString();
3
- //#endregion
4
3
  export { t as formatCalendarDate, e as padTwoDigits };
package/shared/locale.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/shared/locale.ts
1
+ // src/shared/locale.ts
2
2
  var e = (e) => e.split("-")[0].toLowerCase(), t = (t, n, r) => {
3
3
  if (t == null) return "";
4
4
  if (typeof t == "string") return t;
@@ -6,14 +6,14 @@ var e = (e) => e.split("-")[0].toLowerCase(), t = (t, n, r) => {
6
6
  return t[n] ?? t[i] ?? t[r] ?? Object.values(t).find((e) => e !== void 0) ?? "";
7
7
  }, n = (t, n) => `${t} [${e(n).toUpperCase()}]`, r = (e, t) => {
8
8
  let n = /* @__PURE__ */ new Map();
9
- for (let r of e) !r.language || r.language === t || !r.name && !r.description || n.set(r.language, {
9
+ for (let r of e) r.language && r.language !== t && (r.name || r.description) && n.set(r.language, {
10
10
  language: r.language,
11
11
  name: r.name || void 0,
12
12
  description: r.description || void 0
13
13
  });
14
14
  return n.size > 0 ? Array.from(n.values()) : void 0;
15
15
  }, i = (e, t, n) => {
16
- let r = typeof e == "object" ? e : {}, i = typeof t == "object" ? t : {}, a = new Set([...Object.keys(r), ...Object.keys(i)]);
16
+ let r = typeof e == "object" ? e : {}, i = typeof t == "object" ? t : {}, a = /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)]);
17
17
  a.delete(n);
18
18
  let o = 0;
19
19
  return Array.from(a, (e) => ({
@@ -26,5 +26,4 @@ var e = (e) => e.split("-")[0].toLowerCase(), t = (t, n, r) => {
26
26
  code: e,
27
27
  label: e.toUpperCase()
28
28
  }));
29
- //#endregion
30
29
  export { n as appendLocaleCode, a as buildAdditionalLocaleOptions, r as composeLocalePayload, i as decomposeLocalizedFields, t as resolveLocalizedText, e as toBaseLocale };
@@ -1,4 +1,4 @@
1
- //#region src/shared/string-utils.ts
1
+ // src/shared/string-utils.ts
2
2
  var e = (e, t) => e.toLowerCase().includes(t.toLowerCase()), t = (e) => {
3
3
  try {
4
4
  return decodeURIComponent(e);
@@ -15,5 +15,4 @@ var e = (e, t) => e.toLowerCase().includes(t.toLowerCase()), t = (e) => {
15
15
  for (; n > t && e[n - 1] === "/";) --n;
16
16
  return e.slice(t, n);
17
17
  };
18
- //#endregion
19
18
  export { e as includesIgnoreCase, t as safeDecodeURI, n as safeDecodeURIComponent, i as stripSurroundingSlashes, r as stripTrailingSlashes };
@@ -1,4 +1,4 @@
1
- //#region src/shared/toolset-login-events.ts
1
+ // src/shared/toolset-login-events.ts
2
2
  var e = "toolset-login-success", t = new EventTarget(), n = (n) => {
3
3
  t.dispatchEvent(new CustomEvent(e, { detail: n }));
4
4
  }, r = (n) => {
@@ -9,5 +9,4 @@ var e = "toolset-login-success", t = new EventTarget(), n = (n) => {
9
9
  t.removeEventListener(e, r);
10
10
  };
11
11
  };
12
- //#endregion
13
12
  export { n as emitToolsetLoginSuccess, r as subscribeToolsetLoginSuccess };
@@ -1,7 +1,7 @@
1
1
  import { SKILL_FILE_UPLOAD_MAX_BYTES as e, isValidSkillRelativePath as t, parseSkillManifest as n } from "./skill.js";
2
2
  import { formatFileSize as r } from "@epam/ai-dial-chat-shared";
3
3
  import { SkillFileCandidateKind as i, SkillFileValidationStatus as a } from "@epam/ai-dial-skill-editor";
4
- //#region src/skill/skill-file-batch-validation.ts
4
+ // src/skill/skill-file-batch-validation.ts
5
5
  var o = async (o, s) => {
6
6
  let { existingPaths: c, existingTotalBytes: l, manifestByteLength: u, messages: d } = s, f = [], p = [], m = new Set(c), h = /* @__PURE__ */ new Map();
7
7
  for (let { path: e } of o) e !== "SKILL.md" && h.set(e, (h.get(e) ?? 0) + 1);
@@ -9,24 +9,25 @@ var o = async (o, s) => {
9
9
  for (let s of o) {
10
10
  let { id: o, file: c, path: l } = s, u, p = i.SupportingFile;
11
11
  if (l.toLowerCase() === "skill.md" && l !== "SKILL.md") u = d.manifestCasingInvalid;
12
- else if (l === "SKILL.md") if (p = i.Manifest, b += 1, c.size > 1048576) u = d.fileTooLarge(r(e));
13
- else try {
14
- let e = await c.text();
15
- if (e.includes("�")) u = d.manifestInvalidUtf8;
16
- else {
17
- let { frontmatter: t, instructions: r } = n(e), i = typeof t.name == "string" ? t.name : "", a = typeof t.description == "string" ? t.description : "";
18
- !i.trim() || !a.trim() ? u = d.manifestInvalidFrontmatter : b === 1 && (v = {
19
- candidateId: o,
20
- name: i,
21
- description: a,
22
- frontmatter: t,
23
- instructions: r
24
- }, y = c.size);
12
+ else if (l === "SKILL.md") {
13
+ if (p = i.Manifest, b += 1, c.size > 1048576) u = d.fileTooLarge(r(e));
14
+ else try {
15
+ let e = await c.text();
16
+ if (e.includes("�")) u = d.manifestInvalidUtf8;
17
+ else {
18
+ let { frontmatter: t, instructions: r } = n(e), i = typeof t.name == "string" ? t.name : "", a = typeof t.description == "string" ? t.description : "";
19
+ !i.trim() || !a.trim() ? u = d.manifestInvalidFrontmatter : b === 1 && (v = {
20
+ candidateId: o,
21
+ name: i,
22
+ description: a,
23
+ frontmatter: t,
24
+ instructions: r
25
+ }, y = c.size);
26
+ }
27
+ } catch {
28
+ u = d.manifestInvalidFrontmatter;
25
29
  }
26
- } catch {
27
- u = d.manifestInvalidFrontmatter;
28
- }
29
- else l ? t(l) ? m.has(l) || (h.get(l) ?? 0) > 1 ? u = d.pathDuplicate : c.size > 1048576 && (u = d.fileTooLarge(r(e))) : u = d.pathInvalid : u = d.required;
30
+ } else l ? t(l) ? m.has(l) || (h.get(l) ?? 0) > 1 ? u = d.pathDuplicate : c.size > 1048576 && (u = d.fileTooLarge(r(e))) : u = d.pathInvalid : u = d.required;
30
31
  !u && p === i.SupportingFile && (_.add(l), g += c.size), f.push({
31
32
  candidateId: o,
32
33
  status: u ? a.Invalid : a.Valid,
@@ -44,5 +45,4 @@ var o = async (o, s) => {
44
45
  manifestCandidate: v
45
46
  };
46
47
  };
47
- //#endregion
48
48
  export { o as validateSkillFileBatch };
@@ -1,5 +1,5 @@
1
1
  import { RequestStatus as e, getAttachmentTypeFromMime as t, inferMimeTypeFromPath as n } from "@epam/ai-dial-chat-shared";
2
- //#region src/skill/skill-file-preview.ts
2
+ // src/skill/skill-file-preview.ts
3
3
  var r = (r, i) => {
4
4
  let a = i.mimeType || n(r.path) || "", o = new File([new Uint8Array(i.bytes)], r.name, a ? { type: a } : void 0);
5
5
  return {
@@ -11,5 +11,4 @@ var r = (r, i) => {
11
11
  file: o
12
12
  };
13
13
  };
14
- //#endregion
15
14
  export { r as skillFileToAttachment };
@@ -1,5 +1,5 @@
1
1
  import { parse as e } from "yaml";
2
- //#region src/skill/skill-manifest.ts
2
+ // src/skill/skill-manifest.ts
3
3
  var t = /^---[ \t]*$/, n = {
4
4
  whenToUse: [
5
5
  "when_to_use",
@@ -66,5 +66,4 @@ var t = /^---[ \t]*$/, n = {
66
66
  body: u
67
67
  };
68
68
  };
69
- //#endregion
70
69
  export { o as parseSkillManifestDocument };
@@ -1,7 +1,7 @@
1
- //#region src/skill/skill-types.ts
1
+ // src/skill/skill-types.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e.Personal = "personal", e.SharedWithMe = "sharedWithMe", e.Public = "public", e;
4
- }({}), t = "public", n = "skills/", r = 256 * 1024, i = 1e3, a = 10, o = (e) => {
4
+ }({}), t = "public", n = "skills/", r = 262144, i = 1e3, a = 10, o = (e) => {
5
5
  if (!e.startsWith(n)) return null;
6
6
  let t = e.slice(7), r = t.indexOf("/");
7
7
  if (r <= 0) return null;
@@ -11,5 +11,4 @@ var e = /* @__PURE__ */ function(e) {
11
11
  path: a
12
12
  };
13
13
  };
14
- //#endregion
15
14
  export { t as PUBLIC_SKILL_BUCKET, a as SKILL_LISTING_MAX_PAGES, i as SKILL_LISTING_PAGE_SIZE, r as SKILL_MANIFEST_MAX_BYTES, e as SkillSource, o as parseSkillResourceUrl };
package/skill/skill.js CHANGED
@@ -1,19 +1,22 @@
1
1
  import { SkillFileNodeKind as e } from "@epam/ai-dial-skill-editor";
2
2
  import { unzipSync as t } from "fflate";
3
3
  import { parse as n, stringify as r } from "yaml";
4
- //#region src/skill/skill.ts
5
- var i = "SKILL.md", a = 1048576, o = 16777216, s = 100, c = new Set([".dial-resource", ".dial-folder"]), l = new Set(["files", "v"]), u = /^[a-zA-Z]:/, d = /[\x00-\x1f]/, f = (e) => {
4
+ // src/skill/skill.ts
5
+ var i = "SKILL.md", a = 1048576, o = 16777216, s = 100, c = /* @__PURE__ */ new Set([".dial-resource", ".dial-folder"]), l = /* @__PURE__ */ new Set(["files", "v"]), u = /^[a-zA-Z]:/, d = /[\x00-\x1f]/, f = (e) => {
6
6
  if (e === "" || e.startsWith("/") || u.test(e) || e.includes("\\") || d.test(e)) return !1;
7
7
  let t = e.split("/");
8
8
  return !(t.some((e) => e === "" || e === "." || e === "..") || t.some((e) => c.has(e)) || l.has(t[0]));
9
9
  }, p = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-/, "").replace(/-$/, ""), m = ({ name: e, description: t, instructions: n }) => `---\n${r({
10
10
  name: e,
11
11
  description: t
12
- }).trimEnd()}\n---\n\n${n}`, h = (e, t, n, i) => `---\n${r({
13
- ...e,
14
- name: t,
15
- description: n
16
- }).trimEnd()}\n---\n\n${i}`, g = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/, _ = (e) => {
12
+ }).trimEnd()}\n---\n\n${n}`, h = (e, t, n, i) => {
13
+ let a = {
14
+ ...e,
15
+ name: t,
16
+ description: n
17
+ };
18
+ return `---\n${r(a).trimEnd()}\n---\n\n${i}`;
19
+ }, g = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/, _ = (e) => {
17
20
  let t = g.exec(e);
18
21
  if (!t) throw Error("SKILL.md is missing its YAML frontmatter block");
19
22
  let [, r, i] = t;
@@ -41,8 +44,7 @@ var i = "SKILL.md", a = 1048576, o = 16777216, s = 100, c = new Set([".dial-reso
41
44
  let r = t.filter((t) => t.kind === e.File);
42
45
  return {
43
46
  filePaths: r.map((e) => e.path),
44
- files: r.map((e) => b(n.get(e.path)?.bytes ?? new Uint8Array()))
47
+ files: r.map((e) => b(n.get(e.path)?.bytes ?? /* @__PURE__ */ new Uint8Array()))
45
48
  };
46
49
  };
47
- //#endregion
48
50
  export { a as SKILL_FILE_UPLOAD_MAX_BYTES, i as SKILL_MANIFEST_FILE, s as SKILL_UPLOAD_MAX_FILES, o as SKILL_UPLOAD_MAX_TOTAL_BYTES, S as buildSkillFilesPayload, m as buildSkillManifest, x as buildSkillManifestForSubmit, h as buildSkillManifestFromFrontmatter, f as isValidSkillRelativePath, y as nameFromPath, p as normalizeSkillName, _ as parseSkillManifest, b as skillFileBytesToBlob, v as unpackSkillArchive };
@@ -3,7 +3,7 @@ import { stripSurroundingSlashes as t, stripTrailingSlashes as n } from "../shar
3
3
  import { SKILL_MANIFEST_FILE as r, nameFromPath as i, parseSkillManifest as a, unpackSkillArchive as o } from "./skill.js";
4
4
  import { useEffect as s, useRef as c, useState as l } from "react";
5
5
  import { SkillFileNodeKind as u } from "@epam/ai-dial-skill-editor";
6
- //#region src/skill/useSkillEditorLoad.ts
6
+ // src/skill/useSkillEditorLoad.ts
7
7
  var d = /* @__PURE__ */ function(e) {
8
8
  return e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e.Forbidden = "forbidden", e.NotFound = "not-found", e;
9
9
  }({}), f = class extends Error {}, p = (e, r) => {
@@ -99,5 +99,4 @@ var d = /* @__PURE__ */ function(e) {
99
99
  retryLoad: () => _((e) => e + 1)
100
100
  };
101
101
  };
102
- //#endregion
103
102
  export { d as SkillEditorLoadState, g as useSkillEditorLoad };
@@ -2,7 +2,7 @@ import { getApiErrorDetails as e, getApiErrorStatus as t } from "../api-error/ap
2
2
  import { buildSkillFilesPayload as n, buildSkillManifestForSubmit as r, isValidSkillRelativePath as i, normalizeSkillName as a } from "./skill.js";
3
3
  import { useCallback as o, useRef as s, useState as c } from "react";
4
4
  import { NotificationVariant as l } from "@epam/ai-dial-ui-kit";
5
- //#region src/skill/useSkillEditorSubmit.ts
5
+ // src/skill/useSkillEditorSubmit.ts
6
6
  var u = (e, t) => JSON.stringify({
7
7
  values: e,
8
8
  files: [...t].sort((e, t) => e.path.localeCompare(t.path))
@@ -116,11 +116,7 @@ var u = (e, t) => JSON.stringify({
116
116
  handleSubmit: o(async (e) => {
117
117
  if (A === "submitting" || !d) return;
118
118
  let t = {};
119
- if (e.name.trim() || (t.name = x.required), e.description.trim() || (t.description = x.required), e.instructions.trim() || (t.instructions = x.required), Object.keys(t).length > 0) {
120
- T(t);
121
- return;
122
- }
123
- T({}), D(void 0), k(void 0), f ? await F(e) : await P(e);
119
+ e.name.trim() || (t.name = x.required), e.description.trim() || (t.description = x.required), e.instructions.trim() || (t.instructions = x.required), Object.keys(t).length > 0 ? T(t) : (T({}), D(void 0), k(void 0), f ? await F(e) : await P(e));
124
120
  }, [
125
121
  A,
126
122
  d,
@@ -131,5 +127,4 @@ var u = (e, t) => JSON.stringify({
131
127
  ])
132
128
  };
133
129
  };
134
- //#endregion
135
130
  export { d as useSkillEditorSubmit };
@@ -3,7 +3,7 @@ import { validateSkillFileBatch as i } from "./skill-file-batch-validation.js";
3
3
  import { getUtf8ByteLength as a } from "@epam/ai-dial-chat-shared";
4
4
  import { useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
5
5
  import { SkillFileNodeKind as u } from "@epam/ai-dial-skill-editor";
6
- //#region src/skill/useSkillFileActions.ts
6
+ // src/skill/useSkillFileActions.ts
7
7
  var d = ({ files: d, setFiles: f, filesContentRef: p, frontmatterRef: m, loadedValues: h, setLoadedValues: g, isEditMode: _, isDirty: v, setSelectedPath: y, messages: b }) => {
8
8
  let [x, S] = l(!1), C = c(null), w = o(() => {
9
9
  let e = d.filter((e) => e.kind === u.File).map((e) => e.path), r = 0;
@@ -95,5 +95,4 @@ var d = ({ files: d, setFiles: f, filesContentRef: p, frontmatterRef: m, loadedV
95
95
  resolveManifestImport: E
96
96
  };
97
97
  };
98
- //#endregion
99
98
  export { d as useSkillFileActions };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- //#region src/skill/useSkillFilePreview.ts
2
+ // src/skill/useSkillFilePreview.ts
3
3
  var n = /* @__PURE__ */ function(e) {
4
4
  return e.Forbidden = "forbidden", e.Generic = "generic", e;
5
5
  }({}), r = ({ fileId: n, onLoadFile: r }) => {
@@ -25,5 +25,4 @@ var n = /* @__PURE__ */ function(e) {
25
25
  error: c
26
26
  };
27
27
  };
28
- //#endregion
29
28
  export { n as SkillPreviewErrorKind, r as useSkillFilePreview };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
2
- //#region src/skill/useSkillsState/useSkillsState.ts
2
+ // src/skill/useSkillsState/useSkillsState.ts
3
3
  var i = ({ listSkills: i, enabled: a, ready: o }) => {
4
4
  let [s, c] = r([]), [l, u] = r([]), [d, f] = r([]), [p, m] = r(!0), [h, g] = r(null), _ = e(async () => {
5
5
  try {
@@ -48,5 +48,4 @@ var i = ({ listSkills: i, enabled: a, ready: o }) => {
48
48
  v
49
49
  ]);
50
50
  };
51
- //#endregion
52
51
  export { i as useSkillsState };
package/skills-state.js CHANGED
@@ -1,2 +1 @@
1
- import { useSkillsState as e } from "./skill/useSkillsState/useSkillsState.js";
2
- export { e as useSkillsState };
1
+ export { useSkillsState } from "./skill/useSkillsState/useSkillsState.js";
package/source-content.js CHANGED
@@ -1,2 +1 @@
1
- import { getUrlFileName as e, isExternalSourcePreviewable as t, resolveExternalSourceContentType as n } from "./files/source-content.js";
2
- export { e as getUrlFileName, t as isExternalSourcePreviewable, n as resolveExternalSourceContentType };
1
+ export { getUrlFileName, isExternalSourcePreviewable, resolveExternalSourceContentType } from "./files/source-content.js";
@@ -1,6 +1,6 @@
1
1
  import { formatCost as e } from "@epam/ai-dial-chat-shared";
2
2
  import { UsageLimitStatus as t } from "@epam/ai-dial-usage-dashboard";
3
- //#region src/usage/map-usage-data-to-dashboard.ts
3
+ // src/usage/map-usage-data-to-dashboard.ts
4
4
  var n = {
5
5
  todayTitle: "usage.todayTitle",
6
6
  todayPeriodDescription: "usage.todayPeriodDescription",
@@ -62,5 +62,4 @@ var n = {
62
62
  periodDescriptionKey: n.thisMonthPeriodDescription
63
63
  }
64
64
  ].flatMap(({ stats: e, titleKey: n, periodDescriptionKey: i }) => a(e) ? [c(e, t(n), t(i), t, r(e.resetsAt))] : []);
65
- //#endregion
66
65
  export { n as USAGE_DATA_I18N_KEYS, l as mapUsageDataToDashboard };
@@ -2,7 +2,7 @@ import { normalizeDeploymentId as e } from "../catalog/deployment-id.js";
2
2
  import { formatCost as t } from "@epam/ai-dial-chat-shared";
3
3
  import { DeploymentItemDtoTypeEnum as n } from "@epam/ai-dial-chat-api-client";
4
4
  import { ModelLimitMetricKind as r, ModelLimitStatus as i } from "@epam/ai-dial-usage-dashboard";
5
- //#region src/usage/map-user-usage-to-model-limits.ts
5
+ // src/usage/map-user-usage-to-model-limits.ts
6
6
  var a = 2 ** 53, o = 75, s = new Intl.NumberFormat(void 0, {
7
7
  notation: "compact",
8
8
  maximumFractionDigits: 1
@@ -198,5 +198,4 @@ var a = 2 ** 53, o = 75, s = new Intl.NumberFormat(void 0, {
198
198
  };
199
199
  }).filter(({ hasUsage: e }) => e).map(({ row: e }) => e);
200
200
  };
201
- //#endregion
202
201
  export { l as USAGE_MODEL_LIMITS_I18N_KEYS, v as mapOverallCostLimitsToPeriodStatuses, D as mapUserUsageToModelLimits };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- //#region src/usage/useUsageData/useUsageData.ts
2
+ // src/usage/useUsageData/useUsageData.ts
3
3
  var n = (e) => e instanceof Error ? e : Error(String(e)), r = (r, i = !0, a = 0) => {
4
4
  let [o, s] = t(), [c, l] = t(i), [u, d] = t();
5
5
  return e(() => {
@@ -32,5 +32,4 @@ var n = (e) => e instanceof Error ? e : Error(String(e)), r = (r, i = !0, a = 0)
32
32
  usageError: u
33
33
  };
34
34
  };
35
- //#endregion
36
35
  export { r as useUsageData };
@@ -1,6 +1,6 @@
1
1
  import { ResponseFormat as e } from "@epam/ai-dial-chat-shared";
2
2
  import { useCallback as t, useMemo as n } from "react";
3
- //#region src/useChatSettingsFormConfig/useChatSettingsFormConfig.ts
3
+ // src/useChatSettingsFormConfig/useChatSettingsFormConfig.ts
4
4
  var r = {
5
5
  settings: "Settings",
6
6
  savedNotification: "Chat settings have been saved",
@@ -70,5 +70,4 @@ var r = {
70
70
  l
71
71
  ]);
72
72
  };
73
- //#endregion
74
73
  export { a as useChatSettingsFormConfig };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
- //#region src/usePageFileDrag/usePageFileDrag.ts
2
+ // src/usePageFileDrag/usePageFileDrag.ts
3
3
  var a = (a = !0, o = !0) => {
4
4
  let [s, c] = i(!1), [l, u] = i([]), d = r(0), f = r(a), p = r(o);
5
5
  n(() => {
@@ -10,13 +10,13 @@ var a = (a = !0, o = !0) => {
10
10
  }, []);
11
11
  return t(() => {
12
12
  let e = (e) => !!e.dataTransfer?.types.includes("Files"), t = (t) => {
13
- !p.current || !e(t) || (d.current += 1, c(!0));
13
+ p.current && e(t) && (d.current += 1, c(!0));
14
14
  }, n = (t) => {
15
- !p.current || !e(t) || (--d.current, d.current <= 0 && (d.current = 0, c(!1)));
15
+ p.current && e(t) && (--d.current, d.current <= 0 && (d.current = 0, c(!1)));
16
16
  }, r = (t) => {
17
17
  e(t) && (t.preventDefault(), p.current);
18
18
  }, i = (t) => {
19
- if (!(!e(t) || !p.current) && (t.preventDefault(), d.current = 0, c(!1), f.current)) {
19
+ if (e(t) && p.current && (t.preventDefault(), d.current = 0, c(!1), f.current)) {
20
20
  let e = Array.from(t.dataTransfer?.files ?? []);
21
21
  e.length > 0 && u(e);
22
22
  }
@@ -30,5 +30,4 @@ var a = (a = !0, o = !0) => {
30
30
  onFilesConsumed: m
31
31
  };
32
32
  };
33
- //#endregion
34
33
  export { a as usePageFileDrag };
@@ -1,8 +1,7 @@
1
1
  import { useViewportWidth as e } from "../useViewportWidth/useViewportWidth.js";
2
- //#region src/usePanelMaxWidth/usePanelMaxWidth.ts
2
+ // src/usePanelMaxWidth/usePanelMaxWidth.ts
3
3
  var t = (t) => {
4
4
  let n = e();
5
5
  return Math.max(0, n - t);
6
6
  };
7
- //#endregion
8
7
  export { t as usePanelMaxWidth };
@@ -1,7 +1,7 @@
1
1
  import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
2
  import { ShareLinkResponseDtoAccessEnum as i } from "@epam/ai-dial-chat-api-client";
3
3
  import { ShareLinkAccess as a } from "@epam/ai-dial-share";
4
- //#region src/useShareLink/useShareLink.ts
4
+ // src/useShareLink/useShareLink.ts
5
5
  var o = (e) => e.map((e) => e === i.Edit ? a.Edit : a.View), s = (e, t) => {
6
6
  let n = new URL(e, t);
7
7
  return `${t}${n.pathname}${n.search}${n.hash}`;
@@ -40,5 +40,4 @@ var o = (e) => e.map((e) => e === i.Edit ? a.Edit : a.View), s = (e, t) => {
40
40
  }, [_])
41
41
  };
42
42
  };
43
- //#endregion
44
43
  export { c as useShareLink };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useRef as t, useState as n } from "react";
2
- //#region src/useShareRecipientsCount/useShareRecipientsCount.ts
2
+ // src/useShareRecipientsCount/useShareRecipientsCount.ts
3
3
  var r = /* @__PURE__ */ function(e) {
4
4
  return e.Idle = "idle", e.Loading = "loading", e.Resolved = "resolved", e.Unknown = "unknown", e;
5
5
  }({}), i = { status: "idle" }, a = (r) => {
@@ -33,5 +33,4 @@ var r = /* @__PURE__ */ function(e) {
33
33
  }, [])
34
34
  };
35
35
  };
36
- //#endregion
37
36
  export { r as RecipientsCountStatus, a as useShareRecipientsCount };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- //#region src/useToolsMenu/useToolsMenu.ts
2
+ // src/useToolsMenu/useToolsMenu.ts
3
3
  var a = (e) => e.type === "boolean" || e.type == null && typeof e.default == "boolean", o = (e) => {
4
4
  let t = e.replace(/[_-]+/g, " ").trim();
5
5
  return t.length === 0 ? e : t.charAt(0).toUpperCase() + t.slice(1);
@@ -46,5 +46,4 @@ var a = (e) => e.type === "boolean" || e.type == null && typeof e.default == "bo
46
46
  restoreToolConfiguration: _
47
47
  };
48
48
  };
49
- //#endregion
50
49
  export { c as useToolsMenu };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- //#region src/useViewportWidth/useViewportWidth.ts
2
+ // src/useViewportWidth/useViewportWidth.ts
3
3
  var n = () => typeof window < "u" ? window.innerWidth : 1024, r = () => {
4
4
  let [r, i] = t(n);
5
5
  return e(() => {
@@ -8,5 +8,4 @@ var n = () => typeof window < "u" ? window.innerWidth : 1024, r = () => {
8
8
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
9
9
  }, []), r;
10
10
  };
11
- //#endregion
12
11
  export { r as useViewportWidth };