@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.
- package/api-error/api-error.js +3 -4
- package/api-transport/create-csrf-middleware.js +1 -2
- package/api-transport/create-unauthorized-middleware.js +5 -3
- package/attachment/useAttachmentAction/useAttachmentAction.js +6 -10
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +1 -2
- package/catalog/catalog-derivations.js +1 -2
- package/catalog/catalog-primary-action.js +1 -2
- package/catalog/create-publish-api.js +1 -2
- package/catalog/deployment-endpoint-url.js +1 -2
- package/catalog/deployment-id.js +1 -2
- package/catalog/entity-details.js +1 -2
- package/catalog/map-deployment-limits-to-catalog.js +1 -2
- package/catalog/map-deployment-limits-to-input.js +1 -2
- package/catalog/map-deployment-to-catalog-item.js +1 -2
- package/catalog/map-entity-details-to-catalog.js +2 -3
- package/catalog/map-prompt-to-catalog-item.js +1 -2
- package/catalog/map-skill-to-catalog-item.js +1 -2
- package/catalog/mcp-endpoint-url.js +1 -2
- package/catalog/publish.js +1 -2
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +2 -7
- package/catalog/useCatalogItemDetails.js +1 -2
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +1 -2
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +2 -3
- package/catalog/usePublishFolders/usePublishFolders.js +2 -3
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +1 -2
- package/catalog/useSkillItemDetails.js +4 -5
- package/conversation/announcement-message.js +1 -2
- package/conversation/conversation-transfer/async.js +1 -2
- package/conversation/conversation-transfer/attachment-refs.js +1 -2
- package/conversation/conversation-transfer/build-upload-path.js +1 -2
- package/conversation/conversation-transfer/date.js +1 -2
- package/conversation/conversation-transfer/dial-file-resolve.js +1 -2
- package/conversation/conversation-transfer/export-conversation.js +1 -2
- package/conversation/conversation-transfer/import-conversation.js +7 -9
- package/conversation/conversation-transfer/progress.js +2 -3
- package/conversation/conversation-transfer/queue.js +1 -2
- package/conversation/conversation-transfer/types.js +1 -2
- package/conversation/conversation-transfer/zip-export.js +2 -9
- package/conversation/conversation-transfer/zip-import.js +2 -3
- package/conversation/create-chat-stream-api.js +2 -7
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +1 -2
- package/conversation/display-name-watch.js +1 -2
- package/conversation/footer-message.js +1 -2
- package/conversation/get-model-id-from-conversation-id.js +12 -13
- package/conversation/greeting.js +1 -2
- package/conversation/message-factory.js +1 -2
- package/conversation/message-utils.js +1 -2
- package/conversation/overlay-messages.js +1 -2
- package/conversation/quick-app-conversation-starters.js +1 -2
- package/conversation/starter-option.js +1 -2
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +1 -2
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +1 -2
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +5 -3
- package/conversation/useConversationExport/useConversationExport.js +12 -14
- package/conversation/useConversationHandlers/attachment-to-dto.js +1 -2
- package/conversation/useConversationHandlers/message-factory.js +1 -2
- package/conversation/useConversationHandlers/message-utils.js +3 -4
- package/conversation/useConversationHandlers/starter-option.js +1 -2
- package/conversation/useConversationHandlers/useConversationHandlers.js +3 -4
- package/conversation/useConversationImport/useConversationImport.js +29 -30
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +1 -2
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +1 -2
- package/conversation/useConversationScroll/useConversationScroll.js +3 -8
- package/conversation/useConversationStream/apply-chunk.js +1 -2
- package/conversation/useConversationStream/buffered-generation.js +1 -2
- package/conversation/useConversationStream/conversation-path.js +3 -4
- package/conversation/useConversationStream/generation-resume.js +13 -17
- package/conversation/useConversationStream/useConversationStream.js +10 -22
- package/conversation/useImportFilePicker/useImportFilePicker.js +1 -2
- package/conversation/useTranscribeAudio/audio-transcription-error.js +1 -2
- package/conversation/useTranscribeAudio/transcription-retry.js +1 -2
- package/conversation/useTranscribeAudio/useTranscribeAudio.js +1 -2
- package/conversation-overlay.js +1 -2
- package/conversation-sources/useConversationSources/useConversationSources.js +1 -2
- package/conversation-sources.js +1 -2
- package/file-manager-canvas.js +1 -2
- package/files/annotation.js +1 -2
- package/files/attachment-canvas.js +1 -2
- package/files/attachment-dto-to-display.js +1 -2
- package/files/attachment-types.js +2 -3
- package/files/create-files-api.js +1 -2
- package/files/create-upload-file-with-progress.js +6 -14
- package/files/dial-file-manager-copy-move.util.js +1 -2
- package/files/dial-file-manager-mapping.util.js +4 -5
- package/files/dial-file-manager-path.util.js +1 -2
- package/files/dial-file-manager.model.js +1 -2
- package/files/dial-file-manager.types.js +1 -2
- package/files/dial-file-to-attachment.js +4 -5
- package/files/dial-file.js +1 -2
- package/files/dial-files-api.js +1 -2
- package/files/download-destination.js +1 -2
- package/files/file-manager-variant.js +1 -2
- package/files/file-name.js +1 -2
- package/files/prepare-download-destination.js +1 -2
- package/files/resolve-dial-file-api-path.js +1 -2
- package/files/source-content.js +2 -3
- package/files/useDialFileListing/useDialFileListing.js +38 -46
- package/files/useDialFileManager/useDialFileManager.js +1 -2
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -2
- package/files/useDialFileMetadata/useDialFileMetadata.js +4 -5
- package/files/useDialFileMutations/useDialFileMutations.js +1 -2
- package/files/useDialFileSharing/useDialFileSharing.js +1 -2
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +17 -16
- package/mcp-apps/mcp-apps-api-client.js +1 -2
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +1 -2
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -2
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +4 -8
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +1 -2
- package/oauth/authorize-url.js +2 -3
- package/oauth/handshake.js +4 -12
- package/oauth/popup.js +1 -2
- package/oauth/toolset-id.js +4 -5
- package/oauth/types.js +1 -2
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +3 -7
- package/oauth/useToolsetLogin/useToolsetLogin.js +1 -2
- package/package.json +17 -17
- package/prompt/export-prompt.js +1 -2
- package/prompt/prompt-resource.js +1 -2
- package/prompt/prompt.js +1 -2
- package/prompt/usePromptsState/usePromptsState.js +1 -2
- package/scheduled-task/scheduled-task-mapping.js +1 -2
- package/scheduled-task/scheduled-task-trigger.js +2 -3
- package/scroll-anchoring.js +1 -2
- package/shared/application-schema.js +3 -4
- package/shared/browser-timezone.js +1 -2
- package/shared/cron-weekday.js +1 -2
- package/shared/custom-apps.js +1 -2
- package/shared/external-services.js +1 -2
- package/shared/formatting.js +1 -2
- package/shared/locale.js +3 -4
- package/shared/string-utils.js +1 -2
- package/shared/toolset-login-events.js +1 -2
- package/skill/skill-file-batch-validation.js +19 -19
- package/skill/skill-file-preview.js +1 -2
- package/skill/skill-manifest.js +1 -2
- package/skill/skill-types.js +2 -3
- package/skill/skill.js +11 -9
- package/skill/useSkillEditorLoad.js +1 -2
- package/skill/useSkillEditorSubmit.js +2 -7
- package/skill/useSkillFileActions.js +1 -2
- package/skill/useSkillFilePreview.js +1 -2
- package/skill/useSkillsState/useSkillsState.js +1 -2
- package/skills-state.js +1 -2
- package/source-content.js +1 -2
- package/usage/map-usage-data-to-dashboard.js +1 -2
- package/usage/map-user-usage-to-model-limits.js +1 -2
- package/usage/useUsageData/useUsageData.js +1 -2
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +1 -2
- package/usePageFileDrag/usePageFileDrag.js +4 -5
- package/usePanelMaxWidth/usePanelMaxWidth.js +1 -2
- package/useShareLink/useShareLink.js +1 -2
- package/useShareRecipientsCount/useShareRecipientsCount.js +1 -2
- package/useToolsMenu/useToolsMenu.js +1 -2
- package/useViewportWidth/useViewportWidth.js +1 -2
package/prompt/prompt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/scroll-anchoring.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as useConversationScroll };
|
|
1
|
+
export { useConversationScroll } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
var e =
|
|
3
|
-
|
|
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
|
-
|
|
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 };
|
package/shared/cron-weekday.js
CHANGED
package/shared/custom-apps.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 };
|
package/shared/formatting.js
CHANGED
package/shared/locale.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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)
|
|
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 };
|
package/shared/string-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
}
|
|
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
|
-
|
|
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 };
|
package/skill/skill-manifest.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parse as e } from "yaml";
|
|
2
|
-
|
|
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 };
|
package/skill/skill-types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
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 =
|
|
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
|
-
|
|
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) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
export { e as useSkillsState };
|
|
1
|
+
export { useSkillsState } from "./skill/useSkillsState/useSkillsState.js";
|
package/source-content.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13
|
+
p.current && e(t) && (d.current += 1, c(!0));
|
|
14
14
|
}, n = (t) => {
|
|
15
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|