@epam/ai-dial-chat-hooks 1.0.0 → 1.0.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/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/catalog-derivations.d.ts +27 -0
- package/catalog/catalog-derivations.d.ts.map +1 -0
- package/catalog/catalog-primary-action.d.ts +47 -0
- package/catalog/catalog-primary-action.d.ts.map +1 -0
- package/catalog/create-publish-api.d.ts +32 -0
- package/catalog/create-publish-api.d.ts.map +1 -0
- 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-catalog.d.ts +33 -0
- package/catalog/map-deployment-limits-to-catalog.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 +43 -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/catalog/useCatalogItemDetails.d.ts +73 -0
- package/catalog/useCatalogItemDetails.d.ts.map +1 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +37 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +1 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts +71 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +34 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -1
- package/conversation/conversation-transfer/queue.d.ts +1 -1
- package/conversation/conversation-transfer/queue.d.ts.map +1 -1
- package/conversation/conversation-transfer/types.d.ts +0 -27
- package/conversation/conversation-transfer/types.d.ts.map +1 -1
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +39 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.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/useActiveConversationSync/useActiveConversationSync.d.ts +34 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +37 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +1 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +2 -1
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +1 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +2 -1
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +58 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- 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/conversation/useImportFilePicker/useImportFilePicker.d.ts +32 -0
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +1 -0
- 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 +1 -1
- 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-manager.types.d.ts +2 -5
- package/files/dial-file-manager.types.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-manager-variant.d.ts +2 -20
- package/files/file-manager-variant.d.ts.map +1 -1
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/resolve-dial-file-api-path.d.ts +1 -5
- package/files/resolve-dial-file-api-path.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +1 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -1
- package/index.d.ts +82 -3
- package/index.d.ts.map +1 -1
- package/index.js +17933 -2128
- package/oauth/authorize-url.d.ts +16 -0
- package/oauth/authorize-url.d.ts.map +1 -0
- package/oauth/handshake.d.ts +30 -0
- package/oauth/handshake.d.ts.map +1 -0
- package/oauth/models.d.ts +74 -0
- package/oauth/models.d.ts.map +1 -0
- package/oauth/popup.d.ts +30 -0
- package/oauth/popup.d.ts.map +1 -0
- package/oauth/toolset-id.d.ts +23 -0
- package/oauth/toolset-id.d.ts.map +1 -0
- package/oauth/types.d.ts +84 -0
- package/oauth/types.d.ts.map +1 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +54 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +1 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +72 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/package.json +20 -9
- package/prompt/export-prompt.d.ts +31 -0
- package/prompt/export-prompt.d.ts.map +1 -0
- package/prompt/prompt-resource.d.ts +30 -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/prompt/usePromptsState/usePromptsState.d.ts +34 -0
- package/prompt/usePromptsState/usePromptsState.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 +9 -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-batch-validation.d.ts +70 -0
- package/skill/skill-file-batch-validation.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 +114 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/useSkillEditorLoad.d.ts +74 -0
- package/skill/useSkillEditorLoad.d.ts.map +1 -0
- package/skill/useSkillEditorSubmit.d.ts +105 -0
- package/skill/useSkillEditorSubmit.d.ts.map +1 -0
- package/skill/useSkillFileActions.d.ts +53 -0
- package/skill/useSkillFileActions.d.ts.map +1 -0
- package/skill/useSkillFilePreview.d.ts +38 -0
- package/skill/useSkillFilePreview.d.ts.map +1 -0
- package/skill/useSkillsState/useSkillsState.d.ts +35 -0
- package/skill/useSkillsState/useSkillsState.d.ts.map +1 -0
- package/usage/useUsageData/useUsageData.d.ts +20 -0
- package/usage/useUsageData/useUsageData.d.ts.map +1 -0
- package/useShareLink/useShareLink.d.ts +2 -2
- package/useShareLink/useShareLink.d.ts.map +1 -1
- package/useToolsMenu/useToolsMenu.d.ts +7 -16
- package/useToolsMenu/useToolsMenu.d.ts.map +1 -1
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
- package/files/upload-batch.types.d.ts +0 -22
- package/files/upload-batch.types.d.ts.map +0 -1
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts +0 -27
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts.map +0 -1
|
@@ -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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ConversationListItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Parameters for `useActiveConversationSync`. */
|
|
3
|
+
export interface UseActiveConversationSyncParams {
|
|
4
|
+
/**
|
|
5
|
+
* The raw context id of the currently active conversation, as tracked by
|
|
6
|
+
* the host app. `undefined` when no conversation is active.
|
|
7
|
+
*/
|
|
8
|
+
activeConversationId: string | undefined;
|
|
9
|
+
/** Raw conversation list from the API. */
|
|
10
|
+
items: ConversationListItemDto[];
|
|
11
|
+
/** Refetches the full conversation list. */
|
|
12
|
+
refreshConversations: () => Promise<void>;
|
|
13
|
+
/** Marks a scheduler-created conversation as viewed by raw context id. */
|
|
14
|
+
markConversationViewed: (id: string) => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns `true` when two ids refer to the same conversation despite
|
|
17
|
+
* possible encoding differences. App-specific.
|
|
18
|
+
*/
|
|
19
|
+
conversationIdsMatch: (a: string, b: string) => boolean;
|
|
20
|
+
/** Converts a raw context id to the panel-space id. App-specific. */
|
|
21
|
+
toPanelConversationId: (id: string) => string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Synchronises the active conversation with the conversation list and returns
|
|
25
|
+
* the panel-space id of the active conversation, or `undefined` when none is active.
|
|
26
|
+
*
|
|
27
|
+
* Side effects:
|
|
28
|
+
* 1. If the active conversation is not present in the list, requests a
|
|
29
|
+
* refresh. The list and refresh callback are intentionally excluded from
|
|
30
|
+
* the dependency array to avoid a refresh-loop on every list update.
|
|
31
|
+
* 2. Marks the active conversation as viewed whenever it or the list changes.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useActiveConversationSync: ({ activeConversationId, items, refreshConversations, markConversationViewed, conversationIdsMatch, toPanelConversationId, }: UseActiveConversationSyncParams) => string | undefined;
|
|
34
|
+
//# sourceMappingURL=useActiveConversationSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useActiveConversationSync.d.ts","sourceRoot":"","sources":["../../../src/conversation/useActiveConversationSync/useActiveConversationSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAG7E,kDAAkD;AAClD,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,4CAA4C;IAC5C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,0EAA0E;IAC1E,sBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;OAGG;IACH,oBAAoB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACxD,qEAAqE;IACrE,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,6HAOvC,+BAA+B,KAAG,MAAM,GAAG,SAyC7C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** State and controls returned by `useAsyncConfirmDialog`. */
|
|
2
|
+
export interface AsyncConfirmDialogControls<T> {
|
|
3
|
+
/**
|
|
4
|
+
* The value currently awaiting confirmation, or `null` when no dialog is
|
|
5
|
+
* open.
|
|
6
|
+
*/
|
|
7
|
+
pending: T | null;
|
|
8
|
+
/** `true` when `pending` is not `null`. */
|
|
9
|
+
isPending: boolean;
|
|
10
|
+
/** `true` while the async operation started by `confirm` is in-flight. */
|
|
11
|
+
isRunning: boolean;
|
|
12
|
+
/** Error message set when the last `confirm` run threw, or `null` otherwise. */
|
|
13
|
+
error: string | null;
|
|
14
|
+
/** Opens the dialog by setting `pending` to `value` and clearing any prior error. */
|
|
15
|
+
open: (value: T) => void;
|
|
16
|
+
/** Closes the dialog by resetting `pending`, `error`, and `isRunning` to their initial values. */
|
|
17
|
+
close: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Runs `run(pending)` while enforcing a re-entry guard.
|
|
20
|
+
*
|
|
21
|
+
* - No-op when `isRunning` is already `true` or `pending` is `null`.
|
|
22
|
+
* - On success: calls `close()` to reset all state.
|
|
23
|
+
* - On failure: sets `error` to `onError(caughtError)` and leaves `pending`
|
|
24
|
+
* set so the caller may retry.
|
|
25
|
+
*/
|
|
26
|
+
confirm: (run: (value: T) => Promise<void>, onError: (error: unknown) => string) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Generic single-slot pending / loading / error state machine for
|
|
30
|
+
* confirmation dialogs that trigger an async operation.
|
|
31
|
+
*
|
|
32
|
+
* Replaces the `[pendingXxx, setXxx] / [isXxxing, setIsXxxing] / [xxxError,
|
|
33
|
+
* setXxxError]` triads that previously appeared inline at each call site in
|
|
34
|
+
* `ConversationPanelView` and `ConversationPanelMenu`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const useAsyncConfirmDialog: <T>() => AsyncConfirmDialogControls<T>;
|
|
37
|
+
//# sourceMappingURL=useAsyncConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAsyncConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.ts"],"names":[],"mappings":"AAEA,8DAA8D;AAC9D,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C;;;OAGG;IACH,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qFAAqF;IACrF,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACzB,kGAAkG;IAClG,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;;;OAOG;IACH,OAAO,EAAE,CACP,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EAChC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,OAAK,0BAA0B,CAAC,CAAC,CAgEvE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConversationsApi, FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
2
|
-
import {
|
|
2
|
+
import { ConversationTransferJob } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { ConversationExportMode, ConversationTransferErrorEvent, ConversationTransferSuccessEvent, ConversationTransferWarningEvent } from '../conversation-transfer/types';
|
|
3
4
|
interface ExportErrorClassification {
|
|
4
5
|
isUnauthorized?: boolean;
|
|
5
6
|
isNotFound?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationExport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationExport/useConversationExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"useConversationExport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationExport/useConversationExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,uBAAuB,EAI7B,MAAM,2BAA2B,CAAC;AAenC,OAAO,EACL,sBAAsB,EAEtB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAEtC,MAAM,gCAAgC,CAAC;AASxC,UAAU,yBAAyB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAUD,oDAAoD;AACpD,MAAM,WAAW,2BAA2B;IAC1C,+EAA+E;IAC/E,gBAAgB,EAAE,IAAI,CACpB,gBAAgB,EAChB,iBAAiB,GAAG,mBAAmB,CACxC,CAAC;IACF,iFAAiF;IACjF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC5C,yFAAyF;IACzF,yBAAyB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,2GAA2G;IAC3G,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC;IACtE,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtE,gDAAgD;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,6FAA6F;IAC7F,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,+BAA+B;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;CAC3D;AAED,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,4FAA4F;IAC5F,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,2EAA2E;IAC3E,YAAY,EAAE,CACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,sBAAsB,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,wEAAwE;IACxE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,uIASnC,2BAA2B,KAAG,2BAkVhC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationHandlers.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationHandlers/useConversationHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useConversationHandlers.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationHandlers/useConversationHandlers.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConversationsApi, FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
2
|
-
import {
|
|
2
|
+
import { ConversationTransferJob } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { ConversationTransferErrorEvent, ConversationTransferSuccessEvent, ConversationTransferWarningEvent } from '../conversation-transfer/types';
|
|
3
4
|
/** Parameters for {@link useConversationImport}. */
|
|
4
5
|
export interface UseConversationImportParams {
|
|
5
6
|
/** Already-configured generated-client instance used to persist imported conversations. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationImport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationImport/useConversationImport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"useConversationImport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationImport/useConversationImport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,uBAAuB,EAK7B,MAAM,2BAA2B,CAAC;AAkBnC,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AAgExC,oDAAoD;AACpD,MAAM,WAAW,2BAA2B;IAC1C,2FAA2F;IAC3F,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAC7D,oFAAoF;IACpF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC;IACrD,uGAAuG;IACvG,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,+FAA+F;IAC/F,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACzE,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,4EAA4E;IAC5E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;CAC3D;AA2GD,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,4FAA4F;IAC5F,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,kEAAkE;IAClE,mBAAmB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,wFAAwF;IACxF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,gIAUnC,2BAA2B,KAAG,2BAiPhC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConversationListItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Parameters for `useConversationLookupMaps`. */
|
|
3
|
+
export interface UseConversationLookupMapsParams {
|
|
4
|
+
/** Raw conversation list from the API. */
|
|
5
|
+
items: ConversationListItemDto[];
|
|
6
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
7
|
+
toPanelConversationId: (id: string) => string;
|
|
8
|
+
}
|
|
9
|
+
/** Stable reverse-lookup maps returned by `useConversationLookupMaps`. */
|
|
10
|
+
export interface ConversationLookupMaps {
|
|
11
|
+
/** Returns the raw context id for a panel-space conversation id, or `undefined` when not found. */
|
|
12
|
+
toContextId: (panelId: string) => string | undefined;
|
|
13
|
+
/** Returns the raw `ConversationListItemDto` for a panel-space conversation id, or `undefined` when not found. */
|
|
14
|
+
getRawItem: (panelId: string) => ConversationListItemDto | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Builds two memoised reverse-lookup maps from the raw conversation list:
|
|
18
|
+
* panel-space id → context id and panel-space id → raw DTO.
|
|
19
|
+
*
|
|
20
|
+
* Replaces the inlined `panelToContextId` map and `items.find` calls that
|
|
21
|
+
* previously appeared at each row-action call site in `ConversationPanelView`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const useConversationLookupMaps: ({ items, toPanelConversationId, }: UseConversationLookupMapsParams) => ConversationLookupMaps;
|
|
24
|
+
//# sourceMappingURL=useConversationLookupMaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversationLookupMaps.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationLookupMaps/useConversationLookupMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAG7E,kDAAkD;AAClD,MAAM,WAAW,+BAA+B;IAC9C,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,mGAAmG;IACnG,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD,kHAAkH;IAClH,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,CAAC;CACtE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,mCAGvC,+BAA+B,KAAG,sBAaD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ConversationListItemDto, DeploymentItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { FilterTab } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Classifies a conversation's ownership using the shared filter-tab contract.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getConversationSource: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe">) => FilterTab;
|
|
7
|
+
/** Resolver callbacks injected by the host app into `useConversationPanelItems`. */
|
|
8
|
+
export interface UseConversationPanelItemsResolvers {
|
|
9
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
10
|
+
toPanelConversationId: (id: string) => string;
|
|
11
|
+
/** Resolves the icon URL for a deployment. Returns `undefined` when not available. */
|
|
12
|
+
resolveIconUrl: (deployment: DeploymentItemDto | undefined) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the icon tooltip text. Receives the matched deployment (or
|
|
15
|
+
* `undefined`) and a decoded fallback string derived from the model path.
|
|
16
|
+
*/
|
|
17
|
+
resolveIconTooltip: (deployment: DeploymentItemDto | undefined, fallback: string) => string | undefined;
|
|
18
|
+
/** Resolves the href to navigate to when the conversation row is clicked. */
|
|
19
|
+
resolveHref: (panelConversationId: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns badge metadata for a scheduled-task conversation, or `undefined`
|
|
22
|
+
* when the item should not show a task badge.
|
|
23
|
+
*/
|
|
24
|
+
resolveTaskBadge?: (item: ConversationListItemDto) => {
|
|
25
|
+
label: string;
|
|
26
|
+
isUnread: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}
|
|
29
|
+
/** Parameters accepted by `useConversationPanelItems`. */
|
|
30
|
+
export interface UseConversationPanelItemsParams extends UseConversationPanelItemsResolvers {
|
|
31
|
+
/** Raw conversation list from the API. */
|
|
32
|
+
items: ConversationListItemDto[];
|
|
33
|
+
/** Available deployments used to resolve icons and tooltips. */
|
|
34
|
+
deployments: DeploymentItemDto[];
|
|
35
|
+
/** Whether the deployments list is still loading (drives `isIconLoading`). */
|
|
36
|
+
isDeploymentsLoading: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Maps raw `ConversationListItemDto[]` to panel-compatible conversation items.
|
|
40
|
+
*
|
|
41
|
+
* Returns a memoised array whose shape is compatible with the conversation
|
|
42
|
+
* panel's item contract. All app-specific concerns (icon URL resolution,
|
|
43
|
+
* route generation, id normalisation) are injected via resolver callbacks.
|
|
44
|
+
*/
|
|
45
|
+
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskBadge, }: UseConversationPanelItemsParams) => {
|
|
46
|
+
showTaskBadge?: boolean | undefined;
|
|
47
|
+
taskBadgeLabel?: string | undefined;
|
|
48
|
+
isUnread?: boolean | undefined;
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
isPinned: boolean;
|
|
52
|
+
iconUrl: string | undefined;
|
|
53
|
+
iconTooltip: string | undefined;
|
|
54
|
+
isIconLoading: boolean;
|
|
55
|
+
source: FilterTab;
|
|
56
|
+
href: string;
|
|
57
|
+
}[];
|
|
58
|
+
//# sourceMappingURL=useConversationPanelItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversationPanelItems.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationPanelItems/useConversationPanelItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,IAAI,CAAC,uBAAuB,EAAE,cAAc,GAAG,iBAAiB,CAAC,KACtE,SAIF,CAAC;AAEF,oFAAoF;AACpF,MAAM,WAAW,kCAAkC;IACjD,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,sFAAsF;IACtF,cAAc,EAAE,CACd,UAAU,EAAE,iBAAiB,GAAG,SAAS,KACtC,MAAM,GAAG,SAAS,CAAC;IACxB;;;OAGG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,SAAS,CAAC;IACxB,6EAA6E;IAC7E,WAAW,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,uBAAuB,KAC1B;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACvD;AAED,0DAA0D;AAC1D,MAAM,WAAW,+BAAgC,SAAQ,kCAAkC;IACzF,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,gEAAgE;IAChE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,yIASvC,+BAA+B;;;;;;;;;;;;GAkD/B,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,
|
|
1
|
+
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChangeEvent, RefObject } from 'react';
|
|
2
|
+
/** Parameters for `useImportFilePicker`. */
|
|
3
|
+
export interface UseImportFilePickerParams {
|
|
4
|
+
/**
|
|
5
|
+
* MIME types / file-extension filter string passed to the hidden input's
|
|
6
|
+
* `accept` attribute. The host resolves any platform-specific policy before
|
|
7
|
+
* passing this value.
|
|
8
|
+
*/
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Called with the selected `File` after the user confirms their choice. */
|
|
11
|
+
onFileSelected: (file: File) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Controls returned by `useImportFilePicker`. */
|
|
14
|
+
export interface UseImportFilePickerResult {
|
|
15
|
+
/** Ref to attach to the hidden `<input type="file">` element. */
|
|
16
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
17
|
+
/** Programmatically opens the native file picker by clicking the hidden input. */
|
|
18
|
+
triggerImport: () => void;
|
|
19
|
+
/** `onChange` handler for the hidden input; calls `onFileSelected` and resets the value. */
|
|
20
|
+
handleFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Manages the hidden `<input type="file">` pattern used to trigger a native
|
|
24
|
+
* file-picker without a visible control.
|
|
25
|
+
*
|
|
26
|
+
* The host renders `<input ref={inputRef} type="file" onChange={handleFileChange} />`
|
|
27
|
+
* and calls `triggerImport()` when the user initiates an import action. The
|
|
28
|
+
* hook sets the `accept` attribute via a layout effect so re-selecting the
|
|
29
|
+
* same file always fires `onChange` (the value is reset after each selection).
|
|
30
|
+
*/
|
|
31
|
+
export declare const useImportFilePicker: ({ accept, onFileSelected, }: UseImportFilePickerParams) => UseImportFilePickerResult;
|
|
32
|
+
//# sourceMappingURL=useImportFilePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImportFilePicker.d.ts","sourceRoot":"","sources":["../../../src/conversation/useImportFilePicker/useImportFilePicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAED,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,kFAAkF;IAClF,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,4FAA4F;IAC5F,gBAAgB,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAClE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,6BAGjC,yBAAyB,KAAG,yBA6B9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AttachmentResource } from '@epam/ai-dial-chat-shared';
|
|
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":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AACnC,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":"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"}
|
|
@@ -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
|