@epam/ai-dial-chat-hooks 1.1.0-dev.277 → 1.1.0-dev.279
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.d.ts +18 -0
- package/api-error/api-error.d.ts.map +1 -0
- package/api-transport/create-csrf-middleware.d.ts +15 -0
- package/api-transport/create-csrf-middleware.d.ts.map +1 -0
- package/api-transport/create-unauthorized-middleware.d.ts +40 -0
- package/api-transport/create-unauthorized-middleware.d.ts.map +1 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -2
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +1 -1
- package/catalog/deployment-endpoint-url.d.ts +19 -0
- package/catalog/deployment-endpoint-url.d.ts.map +1 -0
- package/catalog/deployment-id.d.ts +21 -0
- package/catalog/deployment-id.d.ts.map +1 -0
- package/catalog/entity-details.d.ts +132 -0
- package/catalog/entity-details.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.d.ts +15 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-to-catalog-item.d.ts +60 -0
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-entity-details-to-catalog.d.ts +23 -0
- package/catalog/map-entity-details-to-catalog.d.ts.map +1 -0
- package/catalog/map-prompt-to-catalog-item.d.ts +45 -0
- package/catalog/map-prompt-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-skill-to-catalog-item.d.ts +87 -0
- package/catalog/map-skill-to-catalog-item.d.ts.map +1 -0
- package/catalog/mcp-endpoint-url.d.ts +18 -0
- package/catalog/mcp-endpoint-url.d.ts.map +1 -0
- package/catalog/publish.d.ts +17 -0
- package/catalog/publish.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +28 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/display-name-watch.d.ts +4 -0
- package/conversation/display-name-watch.d.ts.map +1 -0
- package/conversation/footer-message.d.ts +10 -0
- package/conversation/footer-message.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.d.ts +27 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/greeting.d.ts +18 -0
- package/conversation/greeting.d.ts.map +1 -0
- package/conversation/message-factory.d.ts +7 -0
- package/conversation/message-factory.d.ts.map +1 -0
- package/conversation/message-utils.d.ts +27 -0
- package/conversation/message-utils.d.ts.map +1 -0
- package/conversation/overlay-messages.d.ts +5 -0
- package/conversation/overlay-messages.d.ts.map +1 -0
- package/conversation/quick-app-conversation-starters.d.ts +10 -0
- package/conversation/quick-app-conversation-starters.d.ts.map +1 -0
- package/conversation/starter-option.d.ts +21 -0
- package/conversation/starter-option.d.ts.map +1 -0
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationStream/conversation-path.d.ts +0 -2
- package/conversation/useConversationStream/conversation-path.d.ts.map +1 -1
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
- package/files/annotation.d.ts +10 -0
- package/files/annotation.d.ts.map +1 -0
- package/files/attachment-canvas.d.ts +90 -0
- package/files/attachment-canvas.d.ts.map +1 -0
- package/files/attachment-dto-to-display.d.ts +10 -0
- package/files/attachment-dto-to-display.d.ts.map +1 -0
- package/files/attachment-types.d.ts +14 -0
- package/files/attachment-types.d.ts.map +1 -0
- package/files/create-files-api.d.ts +52 -0
- package/files/create-files-api.d.ts.map +1 -0
- package/files/create-upload-file-with-progress.d.ts +24 -0
- package/files/create-upload-file-with-progress.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
- package/files/dial-file-manager-path.util.d.ts.map +1 -1
- package/files/dial-file-to-attachment.d.ts +26 -0
- package/files/dial-file-to-attachment.d.ts.map +1 -0
- package/files/dial-file.d.ts +17 -0
- package/files/dial-file.d.ts.map +1 -0
- package/files/file-path.d.ts +3 -0
- package/files/file-path.d.ts.map +1 -0
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/index.d.ts +54 -1
- package/index.d.ts.map +1 -1
- package/index.js +15717 -1054
- package/package.json +20 -8
- package/prompt/export-prompt.d.ts +31 -0
- package/prompt/export-prompt.d.ts.map +1 -0
- package/prompt/prompt-resource.d.ts +31 -0
- package/prompt/prompt-resource.d.ts.map +1 -0
- package/prompt/prompt.d.ts +34 -0
- package/prompt/prompt.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-mapping.d.ts +19 -0
- package/scheduled-task/scheduled-task-mapping.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-trigger.d.ts +27 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -0
- package/shared/application-schema.d.ts +10 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/browser-timezone.d.ts +7 -0
- package/shared/browser-timezone.d.ts.map +1 -0
- package/shared/cron-weekday.d.ts +5 -0
- package/shared/cron-weekday.d.ts.map +1 -0
- package/shared/custom-apps.d.ts +7 -0
- package/shared/custom-apps.d.ts.map +1 -0
- package/shared/external-services.d.ts +16 -0
- package/shared/external-services.d.ts.map +1 -0
- package/shared/formatting.d.ts +5 -0
- package/shared/formatting.d.ts.map +1 -0
- package/shared/locale.d.ts +45 -0
- package/shared/locale.d.ts.map +1 -0
- package/shared/string-utils.d.ts +17 -0
- package/shared/string-utils.d.ts.map +1 -0
- package/shared/toolset-login-events.d.ts +15 -0
- package/shared/toolset-login-events.d.ts.map +1 -0
- package/skill/skill-file-preview.d.ts +25 -0
- package/skill/skill-file-preview.d.ts.map +1 -0
- package/skill/skill-manifest.d.ts +28 -0
- package/skill/skill-manifest.d.ts.map +1 -0
- package/skill/skill-types.d.ts +42 -0
- package/skill/skill-types.d.ts.map +1 -0
- package/skill/skill.d.ts +88 -0
- package/skill/skill.d.ts.map +1 -0
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Structured announcement banner content. */
|
|
2
|
+
export interface AnnouncementContent {
|
|
3
|
+
title: string | null;
|
|
4
|
+
description: string | null;
|
|
5
|
+
html: string | null;
|
|
6
|
+
}
|
|
7
|
+
/** Sanitizes announcement HTML to the allowed tag/attribute set. */
|
|
8
|
+
export declare const sanitizeAnnouncementHtml: (html: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the operator configured the structured banner (title and/or
|
|
11
|
+
* description) rather than only the legacy HTML message. Drives which of the
|
|
12
|
+
* two banner layouts renders.
|
|
13
|
+
*/
|
|
14
|
+
export declare const hasStructuredAnnouncement: ({ title, description, }: AnnouncementContent) => boolean;
|
|
15
|
+
/** True when the announcement has any renderable content (structured or legacy HTML). */
|
|
16
|
+
export declare const hasAnnouncementContent: (content: AnnouncementContent) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Builds the value persisted under `StorageKey.TextOfClosedAnnouncement` when
|
|
19
|
+
* the user dismisses the banner. Dismissal is content-keyed: the banner stays
|
|
20
|
+
* hidden only while the current announcement produces the same signature, so
|
|
21
|
+
* editing any part of it brings the banner back with no version counter.
|
|
22
|
+
*
|
|
23
|
+
* A legacy-only announcement returns the raw HTML string — byte-identical to
|
|
24
|
+
* what shipped before the structured fields existed — so dismissals recorded
|
|
25
|
+
* by older builds keep working without a storage migration.
|
|
26
|
+
*/
|
|
27
|
+
export declare const buildAnnouncementSignature: (content: AnnouncementContent) => string;
|
|
28
|
+
//# sourceMappingURL=announcement-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-message.d.ts","sourceRoot":"","sources":["../../src/conversation/announcement-message.ts"],"names":[],"mappings":"AAYA,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAQD,oEAAoE;AACpE,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,MACgB,CAAC;AAKzE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,yBAGvC,mBAAmB,KAAG,OACqB,CAAC;AAE/C,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,KAAG,OACN,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,mBAAmB,KAC3B,MASF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { MessageCustomContent, StreamChunk } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/** Callbacks {@link streamCompletion} reports streamed completion events through. */
|
|
4
|
+
export interface ChatStreamCompletionOptions {
|
|
5
|
+
onChunk: (chunk: StreamChunk) => void;
|
|
6
|
+
onComplete: () => void;
|
|
7
|
+
onError: (error: Error) => void;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
/** Host capabilities {@link createChatStreamApi} needs to stream and stop completions. */
|
|
11
|
+
export interface CreateChatStreamApiDeps {
|
|
12
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
13
|
+
getCsrfToken: () => string | null;
|
|
14
|
+
/** Stores a CSRF token captured from a response header. */
|
|
15
|
+
setCsrfToken: (token: string | null) => void;
|
|
16
|
+
/** Base path for the completion/stop endpoints, e.g. `/api/v1/conversations`. */
|
|
17
|
+
completionsBasePath: string;
|
|
18
|
+
/** Resolves the caller's current timezone, attached as `X-Timezone` when non-empty. */
|
|
19
|
+
getTimezone?: () => string | undefined;
|
|
20
|
+
/** `fetch` implementation to issue requests through. Defaults to the global `fetch`. */
|
|
21
|
+
fetchImpl?: typeof fetch;
|
|
22
|
+
}
|
|
23
|
+
/** DIAL Core completion streaming transport produced by {@link createChatStreamApi}. */
|
|
24
|
+
export interface ChatStreamApi {
|
|
25
|
+
streamCompletion: (path: string, message: string | undefined, model: string, options: ChatStreamCompletionOptions, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum, messageIndex?: number, clientChannelId?: string) => void;
|
|
26
|
+
stopCompletion: (dto: {
|
|
27
|
+
generationId: string;
|
|
28
|
+
path: string;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Builds the streamed-completion transport `apps/chat/src/server-api/chat-stream.api.ts`
|
|
33
|
+
* exposes today: SSE parsing across partial chunks, CSRF header attachment
|
|
34
|
+
* and rotation, and an optional timezone header, backed by an injected
|
|
35
|
+
* `fetch` implementation and base path.
|
|
36
|
+
*/
|
|
37
|
+
export declare const createChatStreamApi: (deps: CreateChatStreamApiDeps) => ChatStreamApi;
|
|
38
|
+
//# sourceMappingURL=create-chat-stream-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-chat-stream-api.d.ts","sourceRoot":"","sources":["../../src/conversation/create-chat-stream-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAInC,qFAAqF;AACrF,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,0FAA0F;AAC1F,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,iFAAiF;IACjF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACvC,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AA0BD,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,EACpC,aAAa,CAAC,EAAE,oBAAoB,EACpC,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,yBAAyB,EAChC,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE,MAAM,KACrB,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;KACd,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,uBAAuB,KAC5B,aAuIF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Conversation } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/** True when the first user/assistant exchange is complete and LLM naming may still run. */
|
|
3
|
+
export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
|
|
4
|
+
//# sourceMappingURL=display-name-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-name-watch.d.ts","sourceRoot":"","sources":["../../src/conversation/display-name-watch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,4FAA4F;AAC5F,eAAO,MAAM,+BAA+B,GAC1C,cAAc,YAAY,KACzB,OAQF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Sanitizes footer message HTML to the allowed tag/attribute set. */
|
|
2
|
+
export declare const sanitizeFooterHtml: (html: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Normalises a version string for display. The server falls back to a bare
|
|
5
|
+
* `package.json` version (`0.45.0`), while a CI-supplied `CHAT_VERSION` is
|
|
6
|
+
* often already tagged (`v0.45.0`) — prefixing unconditionally would render
|
|
7
|
+
* `vv0.45.0`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatAppVersion: (version: string) => string;
|
|
10
|
+
//# sourceMappingURL=footer-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer-message.d.ts","sourceRoot":"","sources":["../../src/conversation/footer-message.ts"],"names":[],"mappings":"AAOA,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MACgB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAGlD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the deployment/model ID from a DIAL Core conversation ID.
|
|
3
|
+
*
|
|
4
|
+
* The backend builds conversation paths as `{deploymentId}__{title}` then runs
|
|
5
|
+
* `encodeDialResourcePath` which splits on `/` and encodes each segment. This
|
|
6
|
+
* means both the deployment ID and the title may introduce extra `/`-separated
|
|
7
|
+
* URL segments:
|
|
8
|
+
*
|
|
9
|
+
* - Deployment `anthropic/claude-3`, title `My chat`
|
|
10
|
+
* → `conversations/bucket/anthropic/claude-3__My%20chat`
|
|
11
|
+
*
|
|
12
|
+
* - Deployment `uuid`, title `calc 6/2/2026` (title contains slashes)
|
|
13
|
+
* → `conversations/bucket/uuid__calc%206/2/2026`
|
|
14
|
+
*
|
|
15
|
+
* The `__` separator is present in the first filename segment. Versioned
|
|
16
|
+
* application deployments use `{name}__{version}__{title}`, so the version
|
|
17
|
+
* suffix still belongs to the deployment ID.
|
|
18
|
+
*
|
|
19
|
+
* In regular model conversations, the separator is always present in exactly
|
|
20
|
+
* one segment — the first one that contains it. Segments before that segment
|
|
21
|
+
* are deployment ID path prefixes; segments from that point onward are the
|
|
22
|
+
* title (possibly overflowing into further `/`-separated segments).
|
|
23
|
+
*
|
|
24
|
+
* Returns `undefined` when the format is unrecognised.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getModelIdFromConversationId: (id: string) => string | undefined;
|
|
27
|
+
//# sourceMappingURL=get-model-id-from-conversation-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-model-id-from-conversation-id.d.ts","sourceRoot":"","sources":["../../src/conversation/get-model-id-from-conversation-id.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B,GACvC,IAAI,MAAM,KACT,MAAM,GAAG,SAkCX,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Pre-translated greeting phrase strings for each time-of-day period. */
|
|
2
|
+
export interface GreetingTranslations {
|
|
3
|
+
morningWithName: string;
|
|
4
|
+
morningNoName: string;
|
|
5
|
+
afternoonWithName: string;
|
|
6
|
+
afternoonNoName: string;
|
|
7
|
+
eveningWithName: string;
|
|
8
|
+
eveningNoName: string;
|
|
9
|
+
nightWithName: string;
|
|
10
|
+
nightNoName: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns a time-of-day greeting string.
|
|
14
|
+
* Hour ranges: morning 5–11, afternoon 12–16, evening 17–20, night 21–4.
|
|
15
|
+
* When firstName is provided the with-name variant is returned; otherwise the no-name variant.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getTimeOfDayGreeting: (hour: number, translations: GreetingTranslations, firstName?: string) => string;
|
|
18
|
+
//# sourceMappingURL=greeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.d.ts","sourceRoot":"","sources":["../../src/conversation/greeting.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,cAAc,oBAAoB,EAClC,YAAY,MAAM,KACjB,MAeF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StatusMessage } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a status message recording a deployment change in the conversation timeline.
|
|
4
|
+
* Status messages are never forwarded to DIAL Core.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createDeploymentChangedMessage: (previousDeploymentId: string | null, newDeploymentId: string) => StatusMessage;
|
|
7
|
+
//# sourceMappingURL=message-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-factory.d.ts","sourceRoot":"","sources":["../../src/conversation/message-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GACzC,sBAAsB,MAAM,GAAG,IAAI,EACnC,iBAAiB,MAAM,KACtB,aAcF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Message, ResponseFormat } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Returns `true` when `message` is the actively-streaming assistant response.
|
|
4
|
+
* Only the last message in the list can be streaming, and only while
|
|
5
|
+
* `isAssistantTyping` is `true`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isMessageStreaming: (message: Message, messageIndex: number, totalMessages: number, isAssistantTyping: boolean) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the `new_deployment_id` from the last `model_changed` status message
|
|
10
|
+
* in the list, or `null` if none exists.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getLastDeploymentId: (messages: Message[]) => string | null;
|
|
13
|
+
/** True when `message` is an assistant message carrying at least one stage. */
|
|
14
|
+
export declare const messageHasStages: (message: Message) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the `configuration_value` stored on the last user message, or
|
|
17
|
+
* `undefined` if none exists. Used to restore the tools menu toggle state
|
|
18
|
+
* when a conversation is (re-)loaded, mirroring `getLastDeploymentId`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getLastUserMessageToolConfiguration: (messages: Message[]) => Record<string, unknown> | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Normalises a stored response-format string to the current enum. Legacy data
|
|
23
|
+
* may contain `'Markdown'` or `'PlainText'` (capital-first) instead of the
|
|
24
|
+
* current enum values `'markdown'` / `'plain_text'`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const normalizeResponseFormat: (value: string | undefined) => ResponseFormat;
|
|
27
|
+
//# sourceMappingURL=message-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-utils.d.ts","sourceRoot":"","sources":["../../src/conversation/message-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,cAAc,EAGf,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,OAAO,EAChB,cAAc,MAAM,EACpB,eAAe,MAAM,EACrB,mBAAmB,OAAO,KACzB,OAGqC,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,OAAO,EAAE,KAAG,MAAM,GAAG,IAUlE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,OAED,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAC9C,UAAU,OAAO,EAAE,KAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAO5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,MAAM,GAAG,SAAS,KACxB,cAIF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
|
|
2
|
+
import { Message } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
|
|
4
|
+
export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
|
|
5
|
+
//# sourceMappingURL=overlay-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-messages.d.ts","sourceRoot":"","sources":["../../src/conversation/overlay-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,GAAI,UAAU,OAAO,EAAE,KAAG,kBAAkB,EAKrE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StarterOption } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/** Resolved Quick App conversation-starter settings. */
|
|
3
|
+
export interface QuickAppConversationStartersSettings {
|
|
4
|
+
starters: StarterOption[];
|
|
5
|
+
introText: string | undefined;
|
|
6
|
+
isChatMessageInputDisabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Parses a Quick App's raw `conversationStarters` schema value into starter options. */
|
|
9
|
+
export declare const getQuickAppConversationStarters: (conversationStarters: unknown) => QuickAppConversationStartersSettings;
|
|
10
|
+
//# sourceMappingURL=quick-app-conversation-starters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-app-conversation-starters.d.ts","sourceRoot":"","sources":["../../src/conversation/quick-app-conversation-starters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wDAAwD;AACxD,MAAM,WAAW,oCAAoC;IACnD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,0BAA0B,EAAE,OAAO,CAAC;CACrC;AAWD,yFAAyF;AACzF,eAAO,MAAM,+BAA+B,GAC1C,sBAAsB,OAAO,KAC5B,oCAyCF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DeploymentConfigurationSchema, StarterOption } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the text to populate in the input when a starter button is selected.
|
|
4
|
+
* Falls back to the button title if `populateText` is empty.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getStarterPopulateText: (starter: StarterOption) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Extracts starter options, the schema property key (`'starter'` or `'button'`),
|
|
9
|
+
* and the optional description text from a deployment configuration schema.
|
|
10
|
+
*
|
|
11
|
+
* - `propertyKey` — `'starter'` or `'button'`; used to build `configuration_value`.
|
|
12
|
+
* - `description` — human-readable prompt shown above the buttons (only present for `button` properties).
|
|
13
|
+
*
|
|
14
|
+
* Returns an empty starters array and `undefined` fields when no matching property is found.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getStartersFromSchema: (schema: DeploymentConfigurationSchema | null | undefined) => {
|
|
17
|
+
starters: StarterOption[];
|
|
18
|
+
propertyKey: string | undefined;
|
|
19
|
+
description: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=starter-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starter-option.d.ts","sourceRoot":"","sources":["../../src/conversation/starter-option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,aAAa,KAAG,MACH,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,6BAA6B,GAAG,IAAI,GAAG,SAAS,KACvD;IACD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CA8BjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starter-option.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationHandlers/starter-option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"starter-option.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationHandlers/starter-option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,aAAa,EACtB,cAAc,MAAM,KACnB,MAQF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,aAAa,EACtB,cAAc,MAAM,KACnB,MAQF,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** Decodes a percent-encoded path segment, leaving it unchanged if decoding fails. */
|
|
2
|
-
export declare const safeDecodeURI: (path: string) => string;
|
|
3
1
|
/**
|
|
4
2
|
* Strips the leading bucket segment from a conversation id and decodes any
|
|
5
3
|
* already-percent-encoded remainder back to raw, so callers that re-encode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-path.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/conversation-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation-path.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/conversation-path.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,KAAG,MAO5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAcf,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAA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M,qBAAqB,GAAI,iKAQnC,2BAA2B,KAAG,2BAqXhC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AttachmentResource } from '@epam/ai-dial-quotations';
|
|
2
|
+
import { ResolveDownloadUrl } from '../attachment/useAttachmentAction/useAttachmentAction';
|
|
3
|
+
/**
|
|
4
|
+
* Opens a cited/referenced attachment: triggers a browser download for
|
|
5
|
+
* DIAL-hosted files (`files/...` ids) via the injected `resolveDownloadUrl`,
|
|
6
|
+
* otherwise opens the URL in a new tab. No-ops when the attachment has no
|
|
7
|
+
* URL or the download URL cannot be resolved.
|
|
8
|
+
*/
|
|
9
|
+
export declare const openAnnotationAttachment: (attachment: AttachmentResource, resolveDownloadUrl: ResolveDownloadUrl) => void;
|
|
10
|
+
//# sourceMappingURL=annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/files/annotation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAGhG;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,kBAAkB,EAC9B,oBAAoB,kBAAkB,KACrC,IAeF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CodeCanvasContent, ErrorCanvasContent, HtmlCanvasContent, ImageCanvasContent, JsonCanvasContent, MarkdownCanvasContent, OoxmlCanvasContent, OoxmlFileType, PdfCanvasContent, PlainTextCanvasContent, VisualizerCanvasContent } from '../../../attachment-canvas/src/index.ts';
|
|
2
|
+
import { Annotation, AttachmentResource, CustomVisualizer, DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { AnnotationGroup } from '@epam/ai-dial-quotations';
|
|
4
|
+
/**
|
|
5
|
+
* DIAL-file URL resolution injected by the host into every attachment-canvas
|
|
6
|
+
* content resolver below. Host-owned — encodes the app's own
|
|
7
|
+
* file-download endpoint.
|
|
8
|
+
*/
|
|
9
|
+
export interface AttachmentCanvasUrlResolvers {
|
|
10
|
+
/** Resolves a DIAL Core file id to a downloadable URL. */
|
|
11
|
+
resolveDialFileDownloadUrl: (fileId: string) => string | undefined;
|
|
12
|
+
/** Resolves the best downloadable DIAL-file URL from an attachment's `url` or `referenceUrl`. */
|
|
13
|
+
resolveDialUrl: (attachment: DisplayAttachment) => string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the last path segment of `url` — its file name — for both absolute
|
|
17
|
+
* URLs and DIAL-relative resource paths such as
|
|
18
|
+
* `files/<bucket>/qa-routed-source.html`. Any query string or hash is dropped
|
|
19
|
+
* and percent escapes are decoded. Returns an empty string when no segment can
|
|
20
|
+
* be extracted. Used to classify a resource by extension when its display name
|
|
21
|
+
* is a citation title rather than a file name.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getUrlFileName: (url: string) => string;
|
|
24
|
+
/** Returns true when an external (non-DIAL) source URL should be opened in the canvas rather than a new browser tab. */
|
|
25
|
+
export declare const isExternalSourcePreviewable: (contentType: string, url: string) => boolean;
|
|
26
|
+
/** Clears all cached fetch results. Call this when leaving a conversation. */
|
|
27
|
+
export declare const clearAttachmentCache: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the attachment carries text `resolveAttachmentText` can resolve —
|
|
30
|
+
* inline data, a DIAL download URL, or a locally-picked file. Mirrors that
|
|
31
|
+
* function's source list, so a `null` resolver result can be read as "the text
|
|
32
|
+
* was fetched and rejected" rather than "there was no text to fetch".
|
|
33
|
+
*/
|
|
34
|
+
export declare const hasAttachmentTextSource: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves an image canvas content payload from a DisplayAttachment without
|
|
37
|
+
* fetching — returns the BFF download URL (or a local/inline blob URL)
|
|
38
|
+
* directly so the browser cache can be shared with the conversation view's
|
|
39
|
+
* `<img>` element. Error detection is delegated to `<img onError>` in the
|
|
40
|
+
* canvas renderer. Returns `null` if no URL source is available.
|
|
41
|
+
*/
|
|
42
|
+
export declare const resolveImageCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => ImageCanvasContent | null;
|
|
43
|
+
/** Resolves a plain-text canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
44
|
+
export declare const resolveTextCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<PlainTextCanvasContent | ErrorCanvasContent | null>;
|
|
45
|
+
/** Resolves a Markdown canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
46
|
+
export declare const resolveMarkdownCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<MarkdownCanvasContent | ErrorCanvasContent | null>;
|
|
47
|
+
/** Resolves a syntax-highlighted code canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
48
|
+
export declare const resolveCodeCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, language?: string) => Promise<CodeCanvasContent | ErrorCanvasContent | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
51
|
+
* Fetches and inlines the HTML as `srcdoc` when the attachment has a download URL or inline data.
|
|
52
|
+
* Returns `null` if no source is available, or an `ErrorCanvasContent` on fetch failure.
|
|
53
|
+
* Rejects `srcdoc` payloads larger than 1 MiB to prevent browser truncation.
|
|
54
|
+
*/
|
|
55
|
+
export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
58
|
+
* for all annotations in the same source group and scroll target for the clicked one.
|
|
59
|
+
* Returns `null` if the annotation has no PDF source attachment.
|
|
60
|
+
*/
|
|
61
|
+
export declare const annotationToPdfCanvasContent: (annotation: Annotation, groups: AnnotationGroup[], resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
62
|
+
/**
|
|
63
|
+
* Builds a `PdfCanvasContent` for a reference-only attachment whose
|
|
64
|
+
* `reference_url` points at a PDF file (optionally with a `#page=N`
|
|
65
|
+
* fragment), so it can be opened in the canvas and scrolled to the
|
|
66
|
+
* referenced page the same way a regular PDF citation is. Returns `null`
|
|
67
|
+
* when the attachment's `url` does not target a PDF.
|
|
68
|
+
*/
|
|
69
|
+
export declare const referenceAttachmentToPdfCanvasContent: (attachment: AttachmentResource, resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
70
|
+
/** Resolves a PDF canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
71
|
+
export declare const resolvePdfCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<PdfCanvasContent | ErrorCanvasContent | null>;
|
|
72
|
+
/** Resolves an OOXML canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
73
|
+
export declare const resolveOoxmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, format: OoxmlFileType) => Promise<OoxmlCanvasContent | ErrorCanvasContent | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Resolves a JSON canvas content payload from a DisplayAttachment, or `null` if unavailable.
|
|
76
|
+
* Falls back to `PlainTextCanvasContent` when the fetched text is not valid JSON.
|
|
77
|
+
*/
|
|
78
|
+
export declare const resolveJsonCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<JsonCanvasContent | PlainTextCanvasContent | ErrorCanvasContent | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Fetches the attachment payload and builds a `VisualizerCanvasContent` for the
|
|
81
|
+
* given registry entry and theme. Returns `null` when the payload cannot be
|
|
82
|
+
* fetched (caller should fall through to default content-type handling).
|
|
83
|
+
*
|
|
84
|
+
* Only JSON payloads are parsed into `data`. Non-JSON payloads (plain text,
|
|
85
|
+
* CSV, binary, …) resolve with `data: {}` — the visualizer still receives
|
|
86
|
+
* `mimeType` and `layout`, just no payload body. This is intentional: only
|
|
87
|
+
* JSON attachment content is forwarded to visualizers in this version.
|
|
88
|
+
*/
|
|
89
|
+
export declare const resolveVisualizerCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, entry: CustomVisualizer, themeId: string) => Promise<VisualizerCanvasContent | null>;
|
|
90
|
+
//# sourceMappingURL=attachment-canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/files/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAIlC;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,0BAA0B,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACnE,iGAAiG;IACjG,cAAc,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;CACvE;AAgDD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAiB5C,CAAC;AAEF,wHAAwH;AACxH,eAAO,MAAM,2BAA2B,GACtC,aAA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,MAAM,uBAAuB,GAClC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,KACtC,OAAO,CAAC,gBAAgB,GAAG,kBAAkB,GAAG,IAAI,CAOtD,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,yBAAyB,GACpC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,EACvC,QAAQ,aAAa,KACpB,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,GAAG,IAAI,CAKxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,KACtC,OAAO,CACR,iBAAiB,GAAG,sBAAsB,GAAG,kBAAkB,GAAG,IAAI,CAYvE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,GACzC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,EACvC,OAAO,gBAAgB,EACvB,SAAS,MAAM,KACd,OAAO,CAAC,uBAAuB,GAAG,IAAI,CA4BxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Annotation, AttachmentDisplayResolvers, DisplayAttachment, MessageAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a message attachment payload to the display-only attachment model used by UI components.
|
|
4
|
+
*/
|
|
5
|
+
export declare const attachmentDtoToDisplayAttachment: (dto: MessageAttachment, resolvers: AttachmentDisplayResolvers) => DisplayAttachment;
|
|
6
|
+
/** Maps an annotation's source attachment to the display-only attachment model. */
|
|
7
|
+
export declare const annotationToDisplayAttachment: (annotation: Annotation) => DisplayAttachment | null;
|
|
8
|
+
/** Maps Chat API attachment DTOs to display-only attachment models. */
|
|
9
|
+
export declare const attachmentDtosToDisplayAttachments: (dtos: MessageAttachment[] | undefined, resolvers: AttachmentDisplayResolvers) => DisplayAttachment[];
|
|
10
|
+
//# sourceMappingURL=attachment-dto-to-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-dto-to-display.d.ts","sourceRoot":"","sources":["../../src/files/attachment-dto-to-display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAOnC;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,KAAK,iBAAiB,EACtB,WAAW,0BAA0B,KACpC,iBAAyE,CAAC;AAE7E,mFAAmF;AACnF,eAAO,MAAM,6BAA6B,GACxC,YAAY,UAAU,KACrB,iBAAiB,GAAG,IAatB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,kCAAkC,GAC7C,MAAM,iBAAiB,EAAE,GAAG,SAAS,EACrC,WAAW,0BAA0B,KACpC,iBAAiB,EACwD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DialFileAcceptType } from '@epam/ai-dial-react-file-manager';
|
|
2
|
+
/** Narrows a string to a `DialFileAcceptType` — a dotted extension or a MIME type/wildcard. */
|
|
3
|
+
export declare const isDialFileAcceptType: (type: string) => type is DialFileAcceptType;
|
|
4
|
+
/** Normalizes `*` to the all-files wildcard and drops any value that is not a valid `DialFileAcceptType`. */
|
|
5
|
+
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Builds an `<input accept>` string from resolved MIME types, filtering out
|
|
8
|
+
* any value `isDialFileAcceptType` rejects, or `undefined` when no types are
|
|
9
|
+
* given or any type accepts everything.
|
|
10
|
+
*/
|
|
11
|
+
export declare const mimeTypesToFileAccept: (types?: string[]) => string | undefined;
|
|
12
|
+
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
13
|
+
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
14
|
+
//# sourceMappingURL=attachment-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-types.d.ts","sourceRoot":"","sources":["../../src/files/attachment-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,KACX,IAAI,IAAI,kBAAgE,CAAC;AAE5E,6GAA6G;AAC7G,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EAAE,KACf,kBAAkB,EAAE,GAAG,SAQzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,EAAE,KAAG,MAAM,GAAG,SASjE,CAAC;AAEF,iIAAiI;AACjI,eAAO,MAAM,oCAAoC,GAAI,OAAO,MAAM,EAAE,KAAG,MAgBxD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ArchiveItemDto, CopyFilesResponseDto, CopyItemDto, CreateFolderDto, CreateFolderResponseDto, DeleteFilesResponseDto, DeleteItemDto, DiscardSharedItemDto, DiscardSharedResponseDto, FileMetadataResponseDto, FileUploadResponseDto, FilesApi, ListFilesResponseDto, ListPublicFilesRequest, ListSharedFilesRequest, MoveFilesResponseDto, MoveItemDto, RenameFilesResponseDto, RenameItemDto, RevokeAccessItemDto, RevokeAccessResponseDto, UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Upload mode passed to `FilesApi.uploadFile`: overwrite an existing file or fail if it already exists. */
|
|
3
|
+
export type UploadMode = 'overwrite' | 'create-only';
|
|
4
|
+
/** Options accepted by an {@link UploadFileWithProgressFn}. */
|
|
5
|
+
export interface UploadFileWithProgressOptions {
|
|
6
|
+
/** Aborts the upload in flight. */
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
/** Called with the upload's progress percentage (0–100). */
|
|
9
|
+
onProgress?: (percent: number) => void;
|
|
10
|
+
/** Defaults to the generated client's own default when omitted. */
|
|
11
|
+
uploadMode?: UploadMode;
|
|
12
|
+
}
|
|
13
|
+
/** Shape of a progress-reporting file upload function, e.g. the return value of `createUploadFileWithProgress`. */
|
|
14
|
+
export type UploadFileWithProgressFn = (bucket: string, path: string, file: File, options?: UploadFileWithProgressOptions) => Promise<FileUploadResponseDto>;
|
|
15
|
+
/** Options accepted by the returned `uploadFile`. */
|
|
16
|
+
export type UploadFileOptions = UploadFileWithProgressOptions;
|
|
17
|
+
/** The DIAL files API surface produced by {@link createFilesApiClient}. */
|
|
18
|
+
export interface FilesApiClient {
|
|
19
|
+
listPublicFiles: (params: ListPublicFilesRequest) => Promise<ListFilesResponseDto>;
|
|
20
|
+
listSharedFiles: (params: ListSharedFilesRequest) => Promise<ListFilesResponseDto>;
|
|
21
|
+
listFiles: (params: {
|
|
22
|
+
bucket: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
recursive?: boolean;
|
|
27
|
+
permissions?: boolean;
|
|
28
|
+
}, signal?: AbortSignal) => Promise<ListFilesResponseDto>;
|
|
29
|
+
uploadFile: (bucket: string, path: string, file: File, options?: AbortSignal | UploadFileOptions) => Promise<FileUploadResponseDto>;
|
|
30
|
+
uploadArchive: (file: File, bucket: string, destinationPath: string) => Promise<UploadArchiveResponseDto>;
|
|
31
|
+
getFileMetadata: (params: {
|
|
32
|
+
bucket: string;
|
|
33
|
+
path: string;
|
|
34
|
+
}) => Promise<FileMetadataResponseDto>;
|
|
35
|
+
downloadFile: (bucket: string, path: string, signal?: AbortSignal) => Promise<Response>;
|
|
36
|
+
createFolder: (params: CreateFolderDto) => Promise<CreateFolderResponseDto>;
|
|
37
|
+
deleteFiles: (items: DeleteItemDto[]) => Promise<DeleteFilesResponseDto>;
|
|
38
|
+
renameFiles: (items: RenameItemDto[]) => Promise<RenameFilesResponseDto>;
|
|
39
|
+
copyFiles: (items: CopyItemDto[], signal?: AbortSignal) => Promise<CopyFilesResponseDto>;
|
|
40
|
+
moveFiles: (items: MoveItemDto[], signal?: AbortSignal) => Promise<MoveFilesResponseDto>;
|
|
41
|
+
downloadArchive: (items: ArchiveItemDto[]) => Promise<Response>;
|
|
42
|
+
revokeAccess: (items: RevokeAccessItemDto[]) => Promise<RevokeAccessResponseDto>;
|
|
43
|
+
discardShared: (items: DiscardSharedItemDto[]) => Promise<DiscardSharedResponseDto>;
|
|
44
|
+
listSharedByMe: (bucket: string) => Promise<ListFilesResponseDto>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds the DIAL files API wrapper functions `apps/chat/src/server-api/files.api.ts`
|
|
48
|
+
* exposes today, delegating to an already-configured `FilesApi` instance and
|
|
49
|
+
* an injected progress-reporting upload function.
|
|
50
|
+
*/
|
|
51
|
+
export declare const createFilesApiClient: (filesApi: FilesApi, uploadFileWithProgress: UploadFileWithProgressFn) => FilesApiClient;
|
|
52
|
+
//# sourceMappingURL=create-files-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-files-api.d.ts","sourceRoot":"","sources":["../../src/files/create-files-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,4GAA4G;AAC5G,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;AAErD,+DAA+D;AAC/D,MAAM,WAAW,6BAA6B;IAC5C,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,UAAU,CAAC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/** Host capabilities {@link createUploadFileWithProgress} needs to perform an XHR upload. */
|
|
3
|
+
export interface CreateUploadFileWithProgressDeps {
|
|
4
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
5
|
+
getCsrfToken: () => string | null;
|
|
6
|
+
/** Stores a CSRF token captured from the upload response header. */
|
|
7
|
+
setCsrfToken: (token: string | null) => void;
|
|
8
|
+
/** Notifies the host that the upload request was unauthorized. */
|
|
9
|
+
notifyUnauthorized: (url: string) => void;
|
|
10
|
+
/** Constructs the error thrown to signal an unauthorized upload. */
|
|
11
|
+
createUnauthorizedError: (url: string) => Error;
|
|
12
|
+
/** The upload endpoint's URL. */
|
|
13
|
+
uploadUrl: string;
|
|
14
|
+
/** Builds the `XMLHttpRequest` instance to upload through. Defaults to `() => new XMLHttpRequest()`. */
|
|
15
|
+
xhrFactory?: () => XMLHttpRequest;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds a progress-reporting file-upload function backed by
|
|
19
|
+
* `XMLHttpRequest` (needed because the `fetch`-based generated client has no
|
|
20
|
+
* upload-progress event), reporting progress, honoring an `AbortSignal`,
|
|
21
|
+
* attaching/rotating a CSRF token, and reporting an unauthorized response.
|
|
22
|
+
*/
|
|
23
|
+
export declare const createUploadFileWithProgress: (deps: CreateUploadFileWithProgressDeps) => UploadFileWithProgressFn;
|
|
24
|
+
//# sourceMappingURL=create-upload-file-with-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-upload-file-with-progress.d.ts","sourceRoot":"","sources":["../../src/files/create-upload-file-with-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AAE5B,6FAA6F;AAC7F,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kEAAkE;IAClE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,oEAAoE;IACpE,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC;IAChD,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,cAAc,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,gCAAgC,KACrC,wBA8EF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-mapping.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-mapping.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,eA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,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,KAC1C,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA4C/D,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,UAAU,YAAY,EACtB,KAAK,mBAAmB,EACxB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,gBAAgB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,KAC1C,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAuCvC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,MAAM,gBAAgB,EACtB,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,QAiCF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,uBAAuB,EACjC,UAAU,QAAQ,KACjB,QAgBD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file-manager-path.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-path.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"dial-file-manager-path.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-path.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAMjE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,EACZ,yBAAyB,MAAM,KAC9B,OAQF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,KAAG,MAGpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MA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';
|
|
3
|
+
/** Options for {@link dialFileToAttachment} and {@link dialFilesToAttachments}. */
|
|
4
|
+
export interface DialFileToAttachmentOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Resolves an image attachment's `previewUrl` from its DIAL resource URL.
|
|
7
|
+
* Left unset, image attachments get no `previewUrl`. The host owns bucket/
|
|
8
|
+
* icon-path REST construction — this hook never builds those URLs itself.
|
|
9
|
+
*/
|
|
10
|
+
resolvePreviewUrl?: (url: string) => string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Converts a selected ui-kit file into the generic attachment contract.
|
|
14
|
+
* DIAL storage identifiers are resolved at the app edge so the input library
|
|
15
|
+
* remains unaware of buckets, server routes, and external file systems.
|
|
16
|
+
*/
|
|
17
|
+
export declare const dialFileToAttachment: (file: DialFile, bucket: string, options?: DialFileToAttachmentOptions) => Attachment | null;
|
|
18
|
+
/** Maps a batch of selected DIAL files to attachments, dropping folders and unresolvable entries. */
|
|
19
|
+
export declare const dialFilesToAttachments: (files: DialFile[], bucket: string, options?: DialFileToAttachmentOptions) => Attachment[];
|
|
20
|
+
/**
|
|
21
|
+
* Converts a DIAL Core folder path (e.g. `files/{bucket}/{path}/`) into an
|
|
22
|
+
* attachment. DIAL Core resolves folder contents server-side when the path is
|
|
23
|
+
* sent as an attachment URL.
|
|
24
|
+
*/
|
|
25
|
+
export declare const dialFolderPathToAttachment: (folderPath: string) => Attachment;
|
|
26
|
+
//# sourceMappingURL=dial-file-to-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-to-attachment.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-to-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAkBvE,mFAAmF;AACnF,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,QAAQ,EACd,QAAQ,MAAM,EACd,UAAU,2BAA2B,KACpC,UAAU,GAAG,IAoBf,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,sBAAsB,GACjC,OAAO,QAAQ,EAAE,EACjB,QAAQ,MAAM,EACd,UAAU,2BAA2B,KACpC,UAAU,EAG4D,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,YAAY,MAAM,KAAG,UAa/D,CAAC"}
|