@epam/ai-dial-chat-hooks 1.1.0-rc.0 → 1.1.0-rc.2
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/catalog/map-deployment-to-catalog-item.js +2 -2
- package/catalog/map-skill-to-catalog-item.js +2 -2
- package/catalog/useSkillItemDetails.js +2 -4
- package/catalog.d.ts +20 -1
- package/catalog.js +14 -14
- package/conversation/announcement-message.js +16 -5
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +13 -17
- package/conversation/useConversationStream/useConversationStream.js +5 -1
- package/conversation/useTranscribeAudio/transcription-retry.js +5 -4
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -0
- package/conversation.d.ts +33 -8
- package/conversation.js +22 -23
- package/file-manager-canvas.d.ts +370 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +0 -325
- package/file-manager.js +14 -15
- package/files/attachment-canvas.js +40 -13
- package/index.d.ts +98 -10
- package/index.js +109 -109
- package/package.json +26 -16
|
@@ -31,11 +31,11 @@ var c = {
|
|
|
31
31
|
}, f = "applications/", p = "toolsets/", m = "public", h = (t, n) => (t.startsWith(n) ? t.slice(n.length) : t).split("/").filter(Boolean).map(e), g = (e, t) => {
|
|
32
32
|
if (e.isMy) return [t.personal];
|
|
33
33
|
let n = h(e.applicationFolder ?? "", f);
|
|
34
|
-
return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n[0]?.toLowerCase() === m ? [t.public, ...n.slice(1)] : n;
|
|
34
|
+
return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n.length === 0 && e.type?.toLowerCase() === "application" ? [t.public] : n[0]?.toLowerCase() === m ? [t.public, ...n.slice(1)] : n;
|
|
35
35
|
}, _ = (e, t) => {
|
|
36
36
|
if (e.isMy && t != null) return [t.personal];
|
|
37
37
|
let n = e.toolset || e.id;
|
|
38
|
-
if (!n.startsWith(p)) return [];
|
|
38
|
+
if (!n.startsWith(p)) return t == null ? [] : e.sharedWithMe ? [t.shared] : n.length > 0 && !n.includes("/") ? [t.public] : [];
|
|
39
39
|
let r = h(n, p).slice(0, -1);
|
|
40
40
|
return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() === m && t != null ? [t.public, ...r.slice(1)] : r.slice(1);
|
|
41
41
|
}, v = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: o, folderLabels: s, editableSchemaIds: c = [], isCustomAppsEditable: l = !1, activeLocale: u, primaryLocale: f, resolveIconUrl: p }) => {
|
|
@@ -115,9 +115,9 @@ var c = {
|
|
|
115
115
|
if (Number.isFinite(t) && t > 262144) return null;
|
|
116
116
|
let n = await e.arrayBuffer();
|
|
117
117
|
return n.byteLength > 262144 ? null : new Uint8Array(n);
|
|
118
|
-
}, S = async (e) => {
|
|
118
|
+
}, S = async (e) => new Uint8Array(await e.arrayBuffer()), C = async (e) => {
|
|
119
119
|
let t = await x(e);
|
|
120
120
|
return t == null ? null : new TextDecoder().decode(t);
|
|
121
121
|
};
|
|
122
122
|
//#endregion
|
|
123
|
-
export { b as buildSkillContentTree, _ as buildSkillOverview, u as mapSkillToCatalogItem, x as readSkillFileBytes, S as readSkillManifest, g as resolveSkillFileDownloadPath, m as resolveSkillManifestFileId };
|
|
123
|
+
export { b as buildSkillContentTree, _ as buildSkillOverview, u as mapSkillToCatalogItem, x as readSkillFileBytes, S as readSkillFilePreviewBytes, C as readSkillManifest, g as resolveSkillFileDownloadPath, m as resolveSkillManifestFileId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SKILL_MANIFEST_FILE as e } from "../skill/skill.js";
|
|
2
2
|
import { parseSkillResourceUrl as t } from "../skill/skill-types.js";
|
|
3
|
-
import { buildSkillContentTree as n, buildSkillOverview as r,
|
|
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
6
|
//#region src/catalog/useSkillItemDetails.ts
|
|
@@ -47,9 +47,7 @@ var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
|
|
|
47
47
|
if (n == null) throw Error("A folder cannot be previewed");
|
|
48
48
|
let r = await d.downloadSkillFile(t.bucket, t.path, n);
|
|
49
49
|
if (!r.ok) throw Object.assign(/* @__PURE__ */ Error(`File preview failed with status ${r.status}`), { status: r.status });
|
|
50
|
-
let a = await i(r);
|
|
51
|
-
if (a == null) throw Error("File exceeds the preview size limit");
|
|
52
|
-
let s = r.headers.get("content-type")?.split(";")[0].trim() || void 0;
|
|
50
|
+
let a = await i(r), s = r.headers.get("content-type")?.split(";")[0].trim() || void 0;
|
|
53
51
|
return {
|
|
54
52
|
bytes: a,
|
|
55
53
|
mimeType: s === "application/octet-stream" ? void 0 : s
|
package/catalog.d.ts
CHANGED
|
@@ -652,6 +652,24 @@ export declare interface PublishApiClient {
|
|
|
652
652
|
*/
|
|
653
653
|
export declare const readSkillFileBytes: (response: Response) => Promise<Uint8Array | null>;
|
|
654
654
|
|
|
655
|
+
/**
|
|
656
|
+
* Reads a skill file response as raw bytes with no size ceiling, for the
|
|
657
|
+
* supporting-file **preview** path.
|
|
658
|
+
*
|
|
659
|
+
* Previews are user-initiated, one file at a time, and a realistic binary
|
|
660
|
+
* (a PDF, an image) routinely exceeds `SKILL_MANIFEST_MAX_BYTES` — a cap
|
|
661
|
+
* sized for `SKILL.md` frontmatter, not for binaries — so applying that cap
|
|
662
|
+
* here rejected virtually every real PDF before it was ever decoded. This
|
|
663
|
+
* reader therefore never returns `null`: file size is not a failure class on
|
|
664
|
+
* the preview path.
|
|
665
|
+
*
|
|
666
|
+
* `readSkillFileBytes` and `readSkillManifest` keep their
|
|
667
|
+
* `SKILL_MANIFEST_MAX_BYTES` ceiling, because they feed the manifest parse
|
|
668
|
+
* and the textual Content-tab read, where an oversized body must never be
|
|
669
|
+
* decoded into a string.
|
|
670
|
+
*/
|
|
671
|
+
export declare const readSkillFilePreviewBytes: (response: Response) => Promise<Uint8Array>;
|
|
672
|
+
|
|
655
673
|
/**
|
|
656
674
|
* Reads a skill manifest response as text, or `null` when the body is larger
|
|
657
675
|
* than `SKILL_MANIFEST_MAX_BYTES`. The size is checked before decoding, so an
|
|
@@ -681,7 +699,8 @@ export declare const reconcileFilterTopics: (persistedTopics: ReadonlySet<string
|
|
|
681
699
|
*/
|
|
682
700
|
export declare const resolveCatalogPrimaryAction: (item: CatalogItem, fetchPrompt: (item: CatalogItem) => Promise<PromptResponseDto>) => Promise<CatalogPrimaryActionResult>;
|
|
683
701
|
|
|
684
|
-
|
|
702
|
+
/** Resolves a deployment's display folder, including organization applications without a folder path. */
|
|
703
|
+
export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder"> & Partial<Pick<DeploymentItemDto, "type">>, labels: DeploymentFolderLabels) => string[];
|
|
685
704
|
|
|
686
705
|
/** Returns the MCP resource kind a catalog item's Connect endpoint belongs to, or `null` when the item exposes no MCP endpoint. */
|
|
687
706
|
export declare const resolveMcpResourceKind: (type: CatalogEntityType, supportsMcp?: boolean) => McpResourceKind | null;
|
package/catalog.js
CHANGED
|
@@ -8,17 +8,17 @@ import { mapDeploymentDetailsDtoToEntityDetails as u, mapEntityDetailsToCatalogD
|
|
|
8
8
|
import { mapDeploymentToCatalogItem as p, mapDeploymentToolsetCredentials as m, mapToolsetToCatalogItem as h, resolveDeploymentFolder as g } from "./catalog/map-deployment-to-catalog-item.js";
|
|
9
9
|
import { buildPromptOverview as _, isOrganisationPromptItem as v, mapPromptToCatalogItem as y } from "./catalog/map-prompt-to-catalog-item.js";
|
|
10
10
|
import { PUBLIC_SKILL_BUCKET as b, SKILL_LISTING_MAX_PAGES as x, SKILL_LISTING_PAGE_SIZE as S, SKILL_MANIFEST_MAX_BYTES as C, SkillSource as w, parseSkillResourceUrl as T } from "./skill/skill-types.js";
|
|
11
|
-
import { buildSkillContentTree as E, buildSkillOverview as D, mapSkillToCatalogItem as O, readSkillFileBytes as k,
|
|
12
|
-
import { McpResourceKind as
|
|
13
|
-
import { getPublicCatalogEntityFolderPath as
|
|
14
|
-
import { deriveAvailableTabIds as
|
|
15
|
-
import { CatalogPrimaryActionType as
|
|
16
|
-
import { useCatalogEditNavigation as
|
|
17
|
-
import { useSkillItemDetails as
|
|
18
|
-
import { useCatalogItemDetails as
|
|
19
|
-
import { useCatalogToolsetCredentials as
|
|
20
|
-
import { useSkillDetailsPanelData as
|
|
21
|
-
import { FavoriteEntityType as
|
|
22
|
-
import { usePublishFolders as
|
|
23
|
-
import { SkillPreviewErrorKind as
|
|
24
|
-
export { s as AuthenticationType,
|
|
11
|
+
import { buildSkillContentTree as E, buildSkillOverview as D, mapSkillToCatalogItem as O, readSkillFileBytes as k, readSkillFilePreviewBytes as A, readSkillManifest as j, resolveSkillFileDownloadPath as M, resolveSkillManifestFileId as N } from "./catalog/map-skill-to-catalog-item.js";
|
|
12
|
+
import { McpResourceKind as P, buildApplicationMcpUrl as F, buildConnectApi as I, buildToolsetMcpUrl as L, resolveMcpResourceKind as R } from "./catalog/mcp-endpoint-url.js";
|
|
13
|
+
import { getPublicCatalogEntityFolderPath as z, isPublicCatalogEntityId as B, mapPublishConversationResultDto as V, mapPublishHistoryEntryDto as H, toPublishEntityType as U } from "./catalog/publish.js";
|
|
14
|
+
import { deriveAvailableTabIds as W, deriveFavoriteItems as G, filterCatalogItemsBySelector as K, filterHiddenOwnedItems as q, reconcileFilterTopics as J } from "./catalog/catalog-derivations.js";
|
|
15
|
+
import { CatalogPrimaryActionType as Y, resolveCatalogPrimaryAction as X } from "./catalog/catalog-primary-action.js";
|
|
16
|
+
import { useCatalogEditNavigation as Z } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
17
|
+
import { useSkillItemDetails as Q } from "./catalog/useSkillItemDetails.js";
|
|
18
|
+
import { useCatalogItemDetails as $ } from "./catalog/useCatalogItemDetails.js";
|
|
19
|
+
import { useCatalogToolsetCredentials as ee } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
20
|
+
import { useSkillDetailsPanelData as te } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
21
|
+
import { FavoriteEntityType as ne, useFavoriteEntitiesState as re } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
22
|
+
import { usePublishFolders as ie } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
23
|
+
import { SkillPreviewErrorKind as ae, useSkillFilePreview as oe } from "./skill/useSkillFilePreview.js";
|
|
24
|
+
export { s as AuthenticationType, Y as CatalogPrimaryActionType, ne as FavoriteEntityType, P as McpResourceKind, b as PUBLIC_SKILL_BUCKET, x as SKILL_LISTING_MAX_PAGES, S as SKILL_LISTING_PAGE_SIZE, C as SKILL_MANIFEST_MAX_BYTES, ae as SkillPreviewErrorKind, w as SkillSource, F as buildApplicationMcpUrl, n as buildChatCompletionsUrl, I as buildConnectApi, r as buildDeploymentConnectApi, _ as buildPromptOverview, i as buildResponsesUrl, E as buildSkillContentTree, D as buildSkillOverview, L as buildToolsetMcpUrl, e as createPublishApiClient, W as deriveAvailableTabIds, G as deriveFavoriteItems, a as encodeDeploymentId, K as filterCatalogItemsBySelector, q as filterHiddenOwnedItems, o as findDeploymentByIdOrReference, z as getPublicCatalogEntityFolderPath, v as isOrganisationPromptItem, B as isPublicCatalogEntityId, u as mapDeploymentDetailsDtoToEntityDetails, c as mapDeploymentLimitsDtoToCatalogLimits, l as mapDeploymentLimitsToInput, p as mapDeploymentToCatalogItem, m as mapDeploymentToolsetCredentials, d as mapEntityDetailsToCatalogDetails, y as mapPromptToCatalogItem, V as mapPublishConversationResultDto, H as mapPublishHistoryEntryDto, O as mapSkillToCatalogItem, f as mapToolsetCredentials, h as mapToolsetToCatalogItem, T as parseSkillResourceUrl, k as readSkillFileBytes, A as readSkillFilePreviewBytes, j as readSkillManifest, J as reconcileFilterTopics, X as resolveCatalogPrimaryAction, g as resolveDeploymentFolder, R as resolveMcpResourceKind, M as resolveSkillFileDownloadPath, N as resolveSkillManifestFileId, U as toPublishEntityType, t as toPublishRuleDto, Z as useCatalogEditNavigation, $ as useCatalogItemDetails, ee as useCatalogToolsetCredentials, re as useFavoriteEntitiesState, ie as usePublishFolders, te as useSkillDetailsPanelData, oe as useSkillFilePreview, Q as useSkillItemDetails };
|
|
@@ -34,9 +34,20 @@ var t = {
|
|
|
34
34
|
e.addHook("afterSanitizeAttributes", (e) => {
|
|
35
35
|
e.tagName === "A" && e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer");
|
|
36
36
|
});
|
|
37
|
-
var r = (n) => e.sanitize(n, t), i = (t) => e.sanitize(t, n), a = (e) => typeof e == "string" && e.length > 0, o = ({ title: e, description: t }) => a(e) || a(t), s = (e) => o(e) || a(e.html), c = (e) =>
|
|
38
|
-
title: e.title
|
|
39
|
-
description: e.description ?? ""
|
|
40
|
-
|
|
37
|
+
var r = (n) => e.sanitize(n, t), i = (t) => e.sanitize(t, n), a = (e) => typeof e == "string" && e.length > 0, o = ({ title: e, description: t }) => a(e) || a(t), s = (e) => o(e) || a(e.html), c = (e) => e.map((e) => ({
|
|
38
|
+
title: e.title,
|
|
39
|
+
description: e.description ?? "",
|
|
40
|
+
link: e.link ? {
|
|
41
|
+
label: e.link.label,
|
|
42
|
+
href: e.link.href
|
|
43
|
+
} : null
|
|
44
|
+
})), l = (e) => {
|
|
45
|
+
if (!o(e)) return e.html ?? "";
|
|
46
|
+
let t = {
|
|
47
|
+
title: e.title ?? "",
|
|
48
|
+
description: e.description ?? ""
|
|
49
|
+
}, n = e.items ?? [];
|
|
50
|
+
return n.length > 0 && (t.items = c(n)), JSON.stringify(t);
|
|
51
|
+
};
|
|
41
52
|
//#endregion
|
|
42
|
-
export {
|
|
53
|
+
export { l as buildAnnouncementSignature, s as hasAnnouncementContent, o as hasStructuredAnnouncement, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml };
|
|
@@ -26,9 +26,16 @@ var o = 700, s = 5, c = (e) => t(e.split("/").filter(Boolean).pop() ?? "file").r
|
|
|
26
26
|
})).url,
|
|
27
27
|
name: a.fileName
|
|
28
28
|
};
|
|
29
|
-
} catch (
|
|
30
|
-
if (l(
|
|
29
|
+
} catch (c) {
|
|
30
|
+
if (l(c)) {
|
|
31
31
|
if (i.markTaken(a.fileName), o < s) {
|
|
32
|
+
if (t.listFiles) try {
|
|
33
|
+
let e = await t.listFiles({
|
|
34
|
+
bucket: u,
|
|
35
|
+
path: a.path.slice(0, a.path.lastIndexOf("/"))
|
|
36
|
+
});
|
|
37
|
+
for (let t of e.items) i.markTaken(t.name);
|
|
38
|
+
} catch {}
|
|
32
39
|
a = i.allocate(n);
|
|
33
40
|
continue;
|
|
34
41
|
}
|
|
@@ -38,10 +45,10 @@ var o = 700, s = 5, c = (e) => t(e.split("/").filter(Boolean).pop() ?? "file").r
|
|
|
38
45
|
let e = p.current.splice(0);
|
|
39
46
|
d?.(e), m.current = null;
|
|
40
47
|
}, f);
|
|
41
|
-
let
|
|
42
|
-
throw
|
|
48
|
+
let t = c instanceof Error ? c : /* @__PURE__ */ Error("Network upload failed");
|
|
49
|
+
throw t.errorReason = r.Network, t;
|
|
43
50
|
}
|
|
44
|
-
throw
|
|
51
|
+
throw c;
|
|
45
52
|
}
|
|
46
53
|
}, [
|
|
47
54
|
u,
|
|
@@ -44,23 +44,19 @@ var p = ({ conversation: p, conversationId: m, bucket: h, isStreaming: g, startS
|
|
|
44
44
|
if (g || !m || !p || e === -1 || p.messages[e]?.role !== c.Assistant) return;
|
|
45
45
|
let t = p.messages[e - 1];
|
|
46
46
|
if (!t || t.role !== c.User) return;
|
|
47
|
-
let n = C()
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
messages: [...t.messages.slice(0, e), r]
|
|
61
|
-
};
|
|
62
|
-
return y.current = i, i;
|
|
63
|
-
}), A((t) => new Set([...t].filter((t) => t < e))), _(m, t.content, e, n, t.custom_content, l(), f.Regenerate);
|
|
47
|
+
let n = C(), r = {
|
|
48
|
+
...p.messages[e],
|
|
49
|
+
content: "",
|
|
50
|
+
custom_content: void 0,
|
|
51
|
+
wasStoppedByUser: void 0,
|
|
52
|
+
stoppedWithoutContent: void 0,
|
|
53
|
+
streamErrorMessage: void 0,
|
|
54
|
+
deploymentId: n
|
|
55
|
+
}, i = {
|
|
56
|
+
...p,
|
|
57
|
+
messages: [...p.messages.slice(0, e), r]
|
|
58
|
+
};
|
|
59
|
+
y.current = i, v(i), A((t) => new Set([...t].filter((t) => t < e))), _(m, t.content, e, n, t.custom_content, l(), f.Regenerate);
|
|
64
60
|
}, [
|
|
65
61
|
p,
|
|
66
62
|
m,
|
|
@@ -86,7 +86,11 @@ var m = 2e4, h = ({ conversationId: h, state: { setConversation: g, conversation
|
|
|
86
86
|
};
|
|
87
87
|
(async () => {
|
|
88
88
|
try {
|
|
89
|
-
let e = x?.channelId ?? await x?.waitForChannel(m) ?? void 0;
|
|
89
|
+
let e = x?.channelId ?? await x?.waitForChannel(m) ?? void 0, t = N.current.has(h);
|
|
90
|
+
if (D.signal.aborted || E() || t) {
|
|
91
|
+
M.current.get(C)?.generationId === h && M.current.delete(C), E() || R(C), k.current === h && (k.current = null, A.current = null, O(null)), b(C, h), x?.notifyGenerationSettled?.(), t ? N.current.delete(h) : E() || S?.notifyGenerationEnd?.();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
90
94
|
v.streamCompletion(C, o, l, F, u, h, f, T, e);
|
|
91
95
|
} catch (e) {
|
|
92
96
|
F.onError(e instanceof Error ? e : Error(String(e)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AudioTranscriptionError as e, AudioTranscriptionErrorReason as t } from "./audio-transcription-error.js";
|
|
2
2
|
//#region src/conversation/useTranscribeAudio/transcription-retry.ts
|
|
3
|
-
var n = 2, r =
|
|
3
|
+
var n = 2, r = 6e3, i = (e, t) => (t.throwIfAborted(), new Promise((n, r) => {
|
|
4
4
|
let i = () => {
|
|
5
5
|
clearTimeout(a), r(t.reason);
|
|
6
6
|
}, a = setTimeout(() => {
|
|
@@ -28,9 +28,10 @@ var n = 2, r = 9e4, i = (e, t) => (t.throwIfAborted(), new Promise((n, r) => {
|
|
|
28
28
|
503,
|
|
29
29
|
504
|
|
30
30
|
].includes(u.status)) throw o;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
c
|
|
31
|
+
if ([429, 503].includes(u.status)) throw new e(t.Busy);
|
|
32
|
+
let d = Math.max(1e3, a(u.headers.get("retry-after")) ?? 2e3 * 2 ** l);
|
|
33
|
+
if (l >= n || c + d > r) throw new e(t.Busy);
|
|
34
|
+
c += d, await i(d, s);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Message } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
|
|
3
|
+
|
|
4
|
+
/** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
|
|
5
|
+
export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
|
|
6
|
+
|
|
7
|
+
export { }
|
package/conversation.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ import { Message } from '@epam/ai-dial-chat-shared';
|
|
|
15
15
|
import { MessageCustomContent } from '@epam/ai-dial-chat-shared';
|
|
16
16
|
import { MessageRating } from '@epam/ai-dial-chat-shared';
|
|
17
17
|
import { MutableRefObject } from 'react';
|
|
18
|
-
import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
|
|
19
18
|
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
20
19
|
import { RateApi } from '@epam/ai-dial-chat-api-client';
|
|
21
20
|
import { ReactNode } from 'react';
|
|
@@ -36,6 +35,26 @@ export declare interface AnnouncementContent {
|
|
|
36
35
|
title: string | null;
|
|
37
36
|
description: string | null;
|
|
38
37
|
html: string | null;
|
|
38
|
+
/** Entries of the popover the banner opens. */
|
|
39
|
+
items?: readonly AnnouncementListItem[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** One entry of the announcements popover behind the banner's `+N` pill. */
|
|
43
|
+
export declare interface AnnouncementListItem {
|
|
44
|
+
/** Plain-text heading of the entry. */
|
|
45
|
+
title: string;
|
|
46
|
+
/** Supporting copy of the entry, sanitized before it is rendered. */
|
|
47
|
+
description?: string | null;
|
|
48
|
+
/** Optional call to action shown at the end of the entry. */
|
|
49
|
+
link?: AnnouncementListItemLink | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** A link rendered as the call to action of an announcements-popover entry. */
|
|
53
|
+
export declare interface AnnouncementListItemLink {
|
|
54
|
+
/** Visible text of the call to action. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** Absolute `http`/`https` target the call to action opens. */
|
|
57
|
+
href: string;
|
|
39
58
|
}
|
|
40
59
|
|
|
41
60
|
/** State and controls returned by `useAsyncConfirmDialog`. */
|
|
@@ -95,7 +114,7 @@ export declare enum AudioTranscriptionErrorReason {
|
|
|
95
114
|
Unavailable = "unavailable",
|
|
96
115
|
/** The recording exceeds the caller's configured size limit. */
|
|
97
116
|
TooLarge = "tooLarge",
|
|
98
|
-
/**
|
|
117
|
+
/** Recognition is rate-limited, unavailable, or exhausted short gateway retries. */
|
|
99
118
|
Busy = "busy",
|
|
100
119
|
/** Recognition failed for any other reason. */
|
|
101
120
|
Failed = "failed"
|
|
@@ -107,9 +126,18 @@ export declare enum AudioTranscriptionErrorReason {
|
|
|
107
126
|
* hidden only while the current announcement produces the same signature, so
|
|
108
127
|
* editing any part of it brings the banner back with no version counter.
|
|
109
128
|
*
|
|
129
|
+
* Every piece of content the banner surface renders feeds the signature — the
|
|
130
|
+
* title, the description, and the popover entries behind the pill, which live
|
|
131
|
+
* inside the banner and are hidden along with it. Publishing a new entry in
|
|
132
|
+
* that list therefore invalidates an earlier dismissal on its own, even when
|
|
133
|
+
* the banner line itself is untouched.
|
|
134
|
+
*
|
|
110
135
|
* A legacy-only announcement returns the raw HTML string — byte-identical to
|
|
111
136
|
* what shipped before the structured fields existed — so dismissals recorded
|
|
112
|
-
* by older builds keep working without a storage migration.
|
|
137
|
+
* by older builds keep working without a storage migration. `items` is left
|
|
138
|
+
* out of the payload entirely when the list is empty for the same reason: a
|
|
139
|
+
* deployment that never configured the popover keeps matching the signatures
|
|
140
|
+
* its users already have stored.
|
|
113
141
|
*/
|
|
114
142
|
export declare const buildAnnouncementSignature: (content: AnnouncementContent) => string;
|
|
115
143
|
|
|
@@ -633,9 +661,6 @@ export declare interface StreamCompletionOptions {
|
|
|
633
661
|
signal: AbortSignal;
|
|
634
662
|
}
|
|
635
663
|
|
|
636
|
-
/** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
|
|
637
|
-
export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
|
|
638
|
-
|
|
639
664
|
/** Request shape the host's selected-deployment recognition call accepts. */
|
|
640
665
|
export declare interface TranscribeWithDeploymentParams {
|
|
641
666
|
audioUrl: string;
|
|
@@ -699,8 +724,8 @@ export declare const useAttachmentUpload: ({ filesApi, bucket, onNetworkError, d
|
|
|
699
724
|
|
|
700
725
|
/** Parameters for {@link useAttachmentUpload}. */
|
|
701
726
|
export declare interface UseAttachmentUploadParams {
|
|
702
|
-
/** Already-configured
|
|
703
|
-
filesApi: Pick<FilesApi, 'uploadFile'
|
|
727
|
+
/** Already-configured client; optional listing skips stored names after a conflict. */
|
|
728
|
+
filesApi: Pick<FilesApi, 'uploadFile'> & Partial<Pick<FilesApi, 'listFiles'>>;
|
|
704
729
|
/** DIAL Core bucket the file is uploaded into. */
|
|
705
730
|
bucket: string | undefined;
|
|
706
731
|
/** Called with batched filenames after a burst of network-error upload failures. */
|
package/conversation.js
CHANGED
|
@@ -6,26 +6,25 @@ import { getModelIdFromConversationId as d } from "./conversation/get-model-id-f
|
|
|
6
6
|
import { getTimeOfDayGreeting as f } from "./conversation/greeting.js";
|
|
7
7
|
import { createDeploymentChangedMessage as p } from "./conversation/message-factory.js";
|
|
8
8
|
import { getLastDeploymentId as m, getLastUserMessageToolConfiguration as h, isMessageStreaming as g, messageHasStages as _, normalizeResponseFormat as v } from "./conversation/message-utils.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
export { j as AudioTranscriptionError, M as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as GenerationConflictError, P as attachmentToDto, F as attachmentsToDtos, e as buildAnnouncementSignature, s as createChatStreamApi, p as createDeploymentChangedMessage, I as createMessagePair, C as deriveConversationRowActionState, l as formatAppVersion, W as getConversationPath, D as getConversationSource, m as getLastDeploymentId, h as getLastUserMessageToolConfiguration, d as getModelIdFromConversationId, b as getQuickAppConversationStarters, V as getStarterConversationText, H as getStarterDisplayText, x as getStarterPopulateText, U as getStarterSubmitText, S as getStartersFromSchema, f as getTimeOfDayGreeting, L as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, R as isAnswerIncomplete, K as isAwaitingGenerationResume, z as isMessageChanged, g as isMessageStreaming, _ as messageHasStages, v as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, u as sanitizeFooterHtml, B as shouldRerunGenerationOnEdit, c as shouldWatchForDisplayNameUpdate, y as toOverlayMessages, w as useActiveConversationSync, T as useAsyncConfirmDialog, A as useAttachmentUpload, J as useChatSettingsFormConfig, G as useConversationHandlers, E as useConversationLookupMaps, O as useConversationPanelItems, q as useConversationStream, k as useImportFilePicker, Y as useToolsMenu, N as useTranscribeAudio };
|
|
9
|
+
import { getQuickAppConversationStarters as y } from "./conversation/quick-app-conversation-starters.js";
|
|
10
|
+
import { getStarterPopulateText as b, getStartersFromSchema as x } from "./conversation/starter-option.js";
|
|
11
|
+
import { deriveConversationRowActionState as S } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
12
|
+
import { useActiveConversationSync as C } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
13
|
+
import { useAsyncConfirmDialog as w } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
14
|
+
import { useConversationLookupMaps as T } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
15
|
+
import { getConversationSource as E, useConversationPanelItems as D } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
16
|
+
import { useImportFilePicker as O } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
17
|
+
import { useAttachmentUpload as k } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
18
|
+
import { AudioTranscriptionError as A, AudioTranscriptionErrorReason as j } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
19
|
+
import { useTranscribeAudio as M } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
20
|
+
import { attachmentToDto as N, attachmentsToDtos as P } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
21
|
+
import { createMessagePair as F } from "./conversation/useConversationHandlers/message-factory.js";
|
|
22
|
+
import { hasActiveToolConfig as I, isAnswerIncomplete as L, isMessageChanged as R, shouldRerunGenerationOnEdit as z } from "./conversation/useConversationHandlers/message-utils.js";
|
|
23
|
+
import { getStarterConversationText as B, getStarterDisplayText as V, getStarterSubmitText as H } from "./conversation/useConversationHandlers/starter-option.js";
|
|
24
|
+
import { getConversationPath as U } from "./conversation/useConversationStream/conversation-path.js";
|
|
25
|
+
import { useConversationHandlers as W } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
26
|
+
import { isAwaitingGenerationResume as G } from "./conversation/useConversationStream/generation-resume.js";
|
|
27
|
+
import { useConversationStream as K } from "./conversation/useConversationStream/useConversationStream.js";
|
|
28
|
+
import { useChatSettingsFormConfig as q } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
29
|
+
import { useToolsMenu as J } from "./useToolsMenu/useToolsMenu.js";
|
|
30
|
+
export { A as AudioTranscriptionError, j as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as GenerationConflictError, N as attachmentToDto, P as attachmentsToDtos, e as buildAnnouncementSignature, s as createChatStreamApi, p as createDeploymentChangedMessage, F as createMessagePair, S as deriveConversationRowActionState, l as formatAppVersion, U as getConversationPath, E as getConversationSource, m as getLastDeploymentId, h as getLastUserMessageToolConfiguration, d as getModelIdFromConversationId, y as getQuickAppConversationStarters, B as getStarterConversationText, V as getStarterDisplayText, b as getStarterPopulateText, H as getStarterSubmitText, x as getStartersFromSchema, f as getTimeOfDayGreeting, I as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, L as isAnswerIncomplete, G as isAwaitingGenerationResume, R as isMessageChanged, g as isMessageStreaming, _ as messageHasStages, v as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, u as sanitizeFooterHtml, z as shouldRerunGenerationOnEdit, c as shouldWatchForDisplayNameUpdate, C as useActiveConversationSync, w as useAsyncConfirmDialog, k as useAttachmentUpload, q as useChatSettingsFormConfig, W as useConversationHandlers, T as useConversationLookupMaps, D as useConversationPanelItems, K as useConversationStream, O as useImportFilePicker, J as useToolsMenu, M as useTranscribeAudio };
|