@epam/ai-dial-chat-hooks 1.1.0-dev.383 → 1.1.0-dev.390
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-DuLNy43N.js +45 -0
- package/attachment-types-AAoN9E95.js +7760 -0
- package/{attachment/useAttachmentValidation/useAttachmentValidation.d.ts → attachments.d.ts} +88 -44
- package/attachments.js +2 -0
- package/browser-Btsa0Lmr.js +607 -0
- package/catalog.d.ts +946 -0
- package/catalog.js +3 -0
- package/{conversation-sources/useConversationSources/useConversationSources.d.ts → conversation-sources.d.ts} +25 -20
- package/conversation-sources.js +2 -0
- package/conversation-transfer.d.ts +189 -0
- package/conversation-transfer.js +3 -0
- package/conversation.d.ts +907 -0
- package/conversation.js +2 -0
- package/cron-weekday-B4w29eAC.js +4 -0
- package/date-BeuD8G79.js +4 -0
- package/deployment-id-CxWgJTs9.js +6 -0
- package/file-manager.d.ts +1344 -0
- package/file-manager.js +4 -0
- package/formatting-CZyyxBG3.js +4 -0
- package/index.d.ts +4945 -126
- package/index.js +27 -19152
- package/oauth.d.ts +440 -0
- package/oauth.js +3 -0
- package/package.json +142 -21
- package/prompt-resource-Bt1I-8ri.js +41 -0
- package/scheduled-task-trigger-D9RZCk52.js +145 -0
- package/{scheduled-task/scheduled-task-trigger.d.ts → scheduled-tasks.d.ts} +51 -27
- package/scheduled-tasks.js +2 -0
- package/{conversation/useConversationScroll/useConversationScroll.d.ts → scroll-anchoring.d.ts} +50 -46
- package/scroll-anchoring.js +2 -0
- package/{useShareRecipientsCount/useShareRecipientsCount.d.ts → sharing.d.ts} +65 -36
- package/sharing.js +3 -0
- package/skill-editor.d.ts +503 -0
- package/skill-editor.js +3 -0
- package/skill-manifest-CCX8s4nn.js +4035 -0
- package/{skill/useSkillsState/useSkillsState.d.ts → skills-state.d.ts} +40 -35
- package/skills-state.js +2 -0
- package/string-utils-iBi2Y55C.js +10 -0
- package/toolset-id-CkxRHyU0.js +10 -0
- package/useAttachmentValidation-CkMTd5lA.js +102 -0
- package/useConversationImport-C2h1GBY4.js +807 -0
- package/useConversationScroll-CliIMnjP.js +122 -0
- package/useConversationSources-DKaKvjXZ.js +47 -0
- package/useDialFileManagerTabConfig-DGQw8H8H.js +2289 -0
- package/usePanelMaxWidth-BEZYuqF9.js +44 -0
- package/useShareLink-xkiaxATt.js +44 -0
- package/useShareRecipientsCount-BgwCLKY0.js +37 -0
- package/useSkillFileActions-BU5PzZ_8.js +373 -0
- package/useSkillFilePreview-BYfZUJhr.js +1005 -0
- package/useSkillsState-BoLlwmzb.js +52 -0
- package/useToolsMenu-BXdahO0i.js +1874 -0
- package/useToolsetLogin-GhFtKs4D.js +276 -0
- package/useUsageData-D7BxloKZ.js +201 -0
- package/utils.d.ts +373 -0
- package/utils.js +7 -0
- package/{usePageFileDrag/usePageFileDrag.d.ts → viewport-layout.d.ts} +27 -16
- package/viewport-layout.js +2 -0
- package/api-error/api-error.d.ts +0 -18
- package/api-error/api-error.d.ts.map +0 -1
- package/api-transport/create-csrf-middleware.d.ts +0 -15
- package/api-transport/create-csrf-middleware.d.ts.map +0 -1
- package/api-transport/create-unauthorized-middleware.d.ts +0 -40
- package/api-transport/create-unauthorized-middleware.d.ts.map +0 -1
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -32
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +0 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +0 -1
- package/catalog/catalog-derivations.d.ts +0 -27
- package/catalog/catalog-derivations.d.ts.map +0 -1
- package/catalog/catalog-primary-action.d.ts +0 -47
- package/catalog/catalog-primary-action.d.ts.map +0 -1
- package/catalog/create-publish-api.d.ts +0 -32
- package/catalog/create-publish-api.d.ts.map +0 -1
- package/catalog/deployment-endpoint-url.d.ts +0 -19
- package/catalog/deployment-endpoint-url.d.ts.map +0 -1
- package/catalog/deployment-id.d.ts +0 -21
- package/catalog/deployment-id.d.ts.map +0 -1
- package/catalog/entity-details.d.ts +0 -132
- package/catalog/entity-details.d.ts.map +0 -1
- package/catalog/map-deployment-limits-to-catalog.d.ts +0 -33
- package/catalog/map-deployment-limits-to-catalog.d.ts.map +0 -1
- package/catalog/map-deployment-limits-to-input.d.ts +0 -15
- package/catalog/map-deployment-limits-to-input.d.ts.map +0 -1
- package/catalog/map-deployment-to-catalog-item.d.ts +0 -60
- package/catalog/map-deployment-to-catalog-item.d.ts.map +0 -1
- package/catalog/map-entity-details-to-catalog.d.ts +0 -23
- package/catalog/map-entity-details-to-catalog.d.ts.map +0 -1
- package/catalog/map-prompt-to-catalog-item.d.ts +0 -43
- package/catalog/map-prompt-to-catalog-item.d.ts.map +0 -1
- package/catalog/map-skill-to-catalog-item.d.ts +0 -87
- package/catalog/map-skill-to-catalog-item.d.ts.map +0 -1
- package/catalog/mcp-endpoint-url.d.ts +0 -18
- package/catalog/mcp-endpoint-url.d.ts.map +0 -1
- package/catalog/publish.d.ts +0 -17
- package/catalog/publish.d.ts.map +0 -1
- package/catalog/useCatalogItemDetails.d.ts +0 -73
- package/catalog/useCatalogItemDetails.d.ts.map +0 -1
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +0 -37
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +0 -1
- package/catalog/usePublishFolders/usePublishFolders.d.ts +0 -73
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +0 -1
- package/conversation/announcement-message.d.ts +0 -34
- package/conversation/announcement-message.d.ts.map +0 -1
- package/conversation/conversation-transfer/async.d.ts +0 -10
- package/conversation/conversation-transfer/async.d.ts.map +0 -1
- package/conversation/conversation-transfer/attachment-refs.d.ts +0 -12
- package/conversation/conversation-transfer/attachment-refs.d.ts.map +0 -1
- package/conversation/conversation-transfer/build-upload-path.d.ts +0 -40
- package/conversation/conversation-transfer/build-upload-path.d.ts.map +0 -1
- package/conversation/conversation-transfer/date.d.ts +0 -5
- package/conversation/conversation-transfer/date.d.ts.map +0 -1
- package/conversation/conversation-transfer/dial-file-resolve.d.ts +0 -10
- package/conversation/conversation-transfer/dial-file-resolve.d.ts.map +0 -1
- package/conversation/conversation-transfer/export-conversation.d.ts +0 -8
- package/conversation/conversation-transfer/export-conversation.d.ts.map +0 -1
- package/conversation/conversation-transfer/import-conversation.d.ts +0 -82
- package/conversation/conversation-transfer/import-conversation.d.ts.map +0 -1
- package/conversation/conversation-transfer/progress.d.ts +0 -60
- package/conversation/conversation-transfer/progress.d.ts.map +0 -1
- package/conversation/conversation-transfer/queue.d.ts +0 -54
- package/conversation/conversation-transfer/queue.d.ts.map +0 -1
- package/conversation/conversation-transfer/types.d.ts +0 -36
- package/conversation/conversation-transfer/types.d.ts.map +0 -1
- package/conversation/conversation-transfer/zip-export.d.ts +0 -31
- package/conversation/conversation-transfer/zip-export.d.ts.map +0 -1
- package/conversation/conversation-transfer/zip-import.d.ts +0 -17
- package/conversation/conversation-transfer/zip-import.d.ts.map +0 -1
- package/conversation/create-chat-stream-api.d.ts +0 -38
- package/conversation/create-chat-stream-api.d.ts.map +0 -1
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +0 -39
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +0 -1
- package/conversation/display-name-watch.d.ts +0 -4
- package/conversation/display-name-watch.d.ts.map +0 -1
- package/conversation/footer-message.d.ts +0 -10
- package/conversation/footer-message.d.ts.map +0 -1
- package/conversation/get-model-id-from-conversation-id.d.ts +0 -27
- package/conversation/get-model-id-from-conversation-id.d.ts.map +0 -1
- package/conversation/greeting.d.ts +0 -18
- package/conversation/greeting.d.ts.map +0 -1
- package/conversation/message-factory.d.ts +0 -7
- package/conversation/message-factory.d.ts.map +0 -1
- package/conversation/message-utils.d.ts +0 -27
- package/conversation/message-utils.d.ts.map +0 -1
- package/conversation/overlay-messages.d.ts +0 -5
- package/conversation/overlay-messages.d.ts.map +0 -1
- package/conversation/quick-app-conversation-starters.d.ts +0 -10
- package/conversation/quick-app-conversation-starters.d.ts.map +0 -1
- package/conversation/starter-option.d.ts +0 -21
- package/conversation/starter-option.d.ts.map +0 -1
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +0 -34
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +0 -1
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +0 -46
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +0 -1
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts +0 -26
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts.map +0 -1
- package/conversation/useConversationExport/useConversationExport.d.ts +0 -72
- package/conversation/useConversationExport/useConversationExport.d.ts.map +0 -1
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts +0 -7
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts.map +0 -1
- package/conversation/useConversationHandlers/message-factory.d.ts +0 -9
- package/conversation/useConversationHandlers/message-factory.d.ts.map +0 -1
- package/conversation/useConversationHandlers/message-utils.d.ts +0 -14
- package/conversation/useConversationHandlers/message-utils.d.ts.map +0 -1
- package/conversation/useConversationHandlers/starter-option.d.ts +0 -14
- package/conversation/useConversationHandlers/starter-option.d.ts.map +0 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts +0 -66
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +0 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +0 -53
- package/conversation/useConversationImport/useConversationImport.d.ts.map +0 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +0 -24
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +0 -1
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +0 -58
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +0 -1
- package/conversation/useConversationScroll/useConversationScroll.d.ts.map +0 -1
- package/conversation/useConversationStream/apply-chunk.d.ts +0 -20
- package/conversation/useConversationStream/apply-chunk.d.ts.map +0 -1
- package/conversation/useConversationStream/buffered-generation.d.ts +0 -15
- package/conversation/useConversationStream/buffered-generation.d.ts.map +0 -1
- package/conversation/useConversationStream/conversation-path.d.ts +0 -7
- package/conversation/useConversationStream/conversation-path.d.ts.map +0 -1
- package/conversation/useConversationStream/generation-resume.d.ts +0 -39
- package/conversation/useConversationStream/generation-resume.d.ts.map +0 -1
- package/conversation/useConversationStream/useConversationStream.d.ts +0 -92
- package/conversation/useConversationStream/useConversationStream.d.ts.map +0 -1
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts +0 -32
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +0 -1
- package/conversation-sources/useConversationSources/useConversationSources.d.ts.map +0 -1
- package/files/annotation.d.ts +0 -10
- package/files/annotation.d.ts.map +0 -1
- package/files/attachment-canvas.d.ts +0 -104
- package/files/attachment-canvas.d.ts.map +0 -1
- package/files/attachment-dto-to-display.d.ts +0 -10
- package/files/attachment-dto-to-display.d.ts.map +0 -1
- package/files/attachment-types.d.ts +0 -14
- package/files/attachment-types.d.ts.map +0 -1
- package/files/create-files-api.d.ts +0 -52
- package/files/create-files-api.d.ts.map +0 -1
- package/files/create-upload-file-with-progress.d.ts +0 -24
- package/files/create-upload-file-with-progress.d.ts.map +0 -1
- package/files/dial-file-manager-copy-move.util.d.ts +0 -15
- package/files/dial-file-manager-copy-move.util.d.ts.map +0 -1
- package/files/dial-file-manager-mapping.util.d.ts +0 -35
- package/files/dial-file-manager-mapping.util.d.ts.map +0 -1
- package/files/dial-file-manager-path.util.d.ts +0 -39
- package/files/dial-file-manager-path.util.d.ts.map +0 -1
- package/files/dial-file-manager.model.d.ts +0 -26
- package/files/dial-file-manager.model.d.ts.map +0 -1
- package/files/dial-file-manager.types.d.ts +0 -317
- package/files/dial-file-manager.types.d.ts.map +0 -1
- package/files/dial-file-to-attachment.d.ts +0 -26
- package/files/dial-file-to-attachment.d.ts.map +0 -1
- package/files/dial-file.d.ts +0 -17
- package/files/dial-file.d.ts.map +0 -1
- package/files/dial-files-api.d.ts +0 -71
- package/files/dial-files-api.d.ts.map +0 -1
- package/files/download-destination.d.ts +0 -31
- package/files/download-destination.d.ts.map +0 -1
- package/files/file-manager-variant.d.ts +0 -4
- package/files/file-manager-variant.d.ts.map +0 -1
- package/files/file-name.d.ts +0 -19
- package/files/file-name.d.ts.map +0 -1
- package/files/prepare-download-destination.d.ts +0 -8
- package/files/prepare-download-destination.d.ts.map +0 -1
- package/files/resolve-dial-file-api-path.d.ts +0 -13
- package/files/resolve-dial-file-api-path.d.ts.map +0 -1
- package/files/useDialFileListing/useDialFileListing.d.ts +0 -73
- package/files/useDialFileListing/useDialFileListing.d.ts.map +0 -1
- package/files/useDialFileManager/useDialFileManager.d.ts +0 -16
- package/files/useDialFileManager/useDialFileManager.d.ts.map +0 -1
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +0 -14
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +0 -1
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts +0 -28
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +0 -1
- package/files/useDialFileMutations/useDialFileMutations.d.ts +0 -68
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +0 -1
- package/files/useDialFileSharing/useDialFileSharing.d.ts +0 -30
- package/files/useDialFileSharing/useDialFileSharing.d.ts.map +0 -1
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +0 -45
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/oauth/authorize-url.d.ts +0 -16
- package/oauth/authorize-url.d.ts.map +0 -1
- package/oauth/handshake.d.ts +0 -30
- package/oauth/handshake.d.ts.map +0 -1
- package/oauth/models.d.ts +0 -81
- package/oauth/models.d.ts.map +0 -1
- package/oauth/popup.d.ts +0 -30
- package/oauth/popup.d.ts.map +0 -1
- package/oauth/toolset-id.d.ts +0 -23
- package/oauth/toolset-id.d.ts.map +0 -1
- package/oauth/types.d.ts +0 -84
- package/oauth/types.d.ts.map +0 -1
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +0 -54
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +0 -1
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +0 -79
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +0 -1
- package/prompt/export-prompt.d.ts +0 -31
- package/prompt/export-prompt.d.ts.map +0 -1
- package/prompt/prompt-resource.d.ts +0 -30
- package/prompt/prompt-resource.d.ts.map +0 -1
- package/prompt/prompt.d.ts +0 -34
- package/prompt/prompt.d.ts.map +0 -1
- package/prompt/usePromptsState/usePromptsState.d.ts +0 -34
- package/prompt/usePromptsState/usePromptsState.d.ts.map +0 -1
- package/scheduled-task/scheduled-task-mapping.d.ts +0 -19
- package/scheduled-task/scheduled-task-mapping.d.ts.map +0 -1
- package/scheduled-task/scheduled-task-trigger.d.ts.map +0 -1
- package/shared/application-schema.d.ts +0 -10
- package/shared/application-schema.d.ts.map +0 -1
- package/shared/browser-timezone.d.ts +0 -7
- package/shared/browser-timezone.d.ts.map +0 -1
- package/shared/cron-weekday.d.ts +0 -5
- package/shared/cron-weekday.d.ts.map +0 -1
- package/shared/custom-apps.d.ts +0 -7
- package/shared/custom-apps.d.ts.map +0 -1
- package/shared/external-services.d.ts +0 -16
- package/shared/external-services.d.ts.map +0 -1
- package/shared/formatting.d.ts +0 -5
- package/shared/formatting.d.ts.map +0 -1
- package/shared/locale.d.ts +0 -45
- package/shared/locale.d.ts.map +0 -1
- package/shared/string-utils.d.ts +0 -9
- package/shared/string-utils.d.ts.map +0 -1
- package/shared/toolset-login-events.d.ts +0 -15
- package/shared/toolset-login-events.d.ts.map +0 -1
- package/skill/skill-file-batch-validation.d.ts +0 -70
- package/skill/skill-file-batch-validation.d.ts.map +0 -1
- package/skill/skill-file-preview.d.ts +0 -25
- package/skill/skill-file-preview.d.ts.map +0 -1
- package/skill/skill-manifest.d.ts +0 -28
- package/skill/skill-manifest.d.ts.map +0 -1
- package/skill/skill-types.d.ts +0 -42
- package/skill/skill-types.d.ts.map +0 -1
- package/skill/skill.d.ts +0 -114
- package/skill/skill.d.ts.map +0 -1
- package/skill/useSkillEditorLoad.d.ts +0 -74
- package/skill/useSkillEditorLoad.d.ts.map +0 -1
- package/skill/useSkillEditorSubmit.d.ts +0 -105
- package/skill/useSkillEditorSubmit.d.ts.map +0 -1
- package/skill/useSkillFileActions.d.ts +0 -53
- package/skill/useSkillFileActions.d.ts.map +0 -1
- package/skill/useSkillFilePreview.d.ts +0 -38
- package/skill/useSkillFilePreview.d.ts.map +0 -1
- package/skill/useSkillsState/useSkillsState.d.ts.map +0 -1
- package/test-setup.d.ts +0 -2
- package/test-setup.d.ts.map +0 -1
- package/usage/useUsageData/useUsageData.d.ts +0 -20
- package/usage/useUsageData/useUsageData.d.ts.map +0 -1
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts +0 -128
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts.map +0 -1
- package/usePageFileDrag/usePageFileDrag.d.ts.map +0 -1
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts +0 -6
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts.map +0 -1
- package/useShareLink/useShareLink.d.ts +0 -23
- package/useShareLink/useShareLink.d.ts.map +0 -1
- package/useShareRecipientsCount/useShareRecipientsCount.d.ts.map +0 -1
- package/useToolsMenu/useToolsMenu.d.ts +0 -31
- package/useToolsMenu/useToolsMenu.d.ts.map +0 -1
- package/useViewportWidth/useViewportWidth.d.ts +0 -3
- package/useViewportWidth/useViewportWidth.d.ts.map +0 -1
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
import { Attachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { AttachmentDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { ChangeEvent } from 'react';
|
|
4
|
+
import { Conversation } from '@epam/ai-dial-chat-shared';
|
|
5
|
+
import { ConversationListItemDto } from '@epam/ai-dial-chat-api-client';
|
|
6
|
+
import { ConversationsApi } from '@epam/ai-dial-chat-api-client';
|
|
7
|
+
import { DeploymentConfigurationSchema } from '@epam/ai-dial-chat-shared';
|
|
8
|
+
import { DeploymentFeatures } from '@epam/ai-dial-chat-shared';
|
|
9
|
+
import { DeploymentItemDto } from '@epam/ai-dial-chat-api-client';
|
|
10
|
+
import { Dispatch } from 'react';
|
|
11
|
+
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
12
|
+
import { FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
13
|
+
import { FilterTab } from '@epam/ai-dial-chat-shared';
|
|
14
|
+
import { Message } from '@epam/ai-dial-chat-shared';
|
|
15
|
+
import { MessageCustomContent } from '@epam/ai-dial-chat-shared';
|
|
16
|
+
import { MessageRating } from '@epam/ai-dial-chat-shared';
|
|
17
|
+
import { MutableRefObject } from 'react';
|
|
18
|
+
import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
|
|
19
|
+
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
20
|
+
import { RateApi } from '@epam/ai-dial-chat-api-client';
|
|
21
|
+
import { ReactNode } from 'react';
|
|
22
|
+
import { RefObject } from 'react';
|
|
23
|
+
import { ResponseFormat } from '@epam/ai-dial-chat-shared';
|
|
24
|
+
import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
|
|
25
|
+
import { SetStateAction } from 'react';
|
|
26
|
+
import { StarterOption } from '@epam/ai-dial-chat-shared';
|
|
27
|
+
import { StatusMessage } from '@epam/ai-dial-chat-shared';
|
|
28
|
+
import { StreamChunk } from '@epam/ai-dial-chat-shared';
|
|
29
|
+
import { ToolMenuItem } from '@epam/ai-dial-chat-shared';
|
|
30
|
+
|
|
31
|
+
/** Structured announcement banner content. */
|
|
32
|
+
export declare interface AnnouncementContent {
|
|
33
|
+
title: string | null;
|
|
34
|
+
description: string | null;
|
|
35
|
+
html: string | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** State and controls returned by `useAsyncConfirmDialog`. */
|
|
39
|
+
export declare interface AsyncConfirmDialogControls<T> {
|
|
40
|
+
/**
|
|
41
|
+
* The value currently awaiting confirmation, or `null` when no dialog is
|
|
42
|
+
* open.
|
|
43
|
+
*/
|
|
44
|
+
pending: T | null;
|
|
45
|
+
/** `true` when `pending` is not `null`. */
|
|
46
|
+
isPending: boolean;
|
|
47
|
+
/** `true` while the async operation started by `confirm` is in-flight. */
|
|
48
|
+
isRunning: boolean;
|
|
49
|
+
/** Error message set when the last `confirm` run threw, or `null` otherwise. */
|
|
50
|
+
error: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Opens the dialog by setting `pending` to `value` and clearing any prior
|
|
53
|
+
* error.
|
|
54
|
+
*
|
|
55
|
+
* Pass `returnFocusTo` when the control that opened the dialog will not
|
|
56
|
+
* survive it — a row menu item, for instance, unmounts with its menu, so
|
|
57
|
+
* restoring focus to it is impossible and the caller should name a stable
|
|
58
|
+
* element such as the menu's own trigger. When omitted, whatever held focus
|
|
59
|
+
* at the moment of the call is used.
|
|
60
|
+
*/
|
|
61
|
+
open: (value: T, returnFocusTo?: HTMLElement | null) => void;
|
|
62
|
+
/** Closes the dialog by resetting `pending`, `error`, and `isRunning` to their initial values. */
|
|
63
|
+
close: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Runs `run(pending)` while enforcing a re-entry guard.
|
|
66
|
+
*
|
|
67
|
+
* - No-op when `isRunning` is already `true` or `pending` is `null`.
|
|
68
|
+
* - On success: calls `close()` to reset all state.
|
|
69
|
+
* - On failure: sets `error` to `onError(caughtError)` and leaves `pending`
|
|
70
|
+
* set so the caller may retry.
|
|
71
|
+
*/
|
|
72
|
+
confirm: (run: (value: T) => Promise<void>, onError: (error: unknown) => string) => Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Maps a list of already-uploaded attachments to DTOs, or `undefined` when the list is empty. */
|
|
76
|
+
export declare const attachmentsToDtos: (attachments: Attachment[]) => AttachmentDto[] | undefined;
|
|
77
|
+
|
|
78
|
+
/** Maps an already-uploaded attachment to its DTO shape. Throws if the attachment has no `url` yet. */
|
|
79
|
+
export declare const attachmentToDto: (attachment: Attachment) => AttachmentDto;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Builds the value persisted under `StorageKey.TextOfClosedAnnouncement` when
|
|
83
|
+
* the user dismisses the banner. Dismissal is content-keyed: the banner stays
|
|
84
|
+
* hidden only while the current announcement produces the same signature, so
|
|
85
|
+
* editing any part of it brings the banner back with no version counter.
|
|
86
|
+
*
|
|
87
|
+
* A legacy-only announcement returns the raw HTML string — byte-identical to
|
|
88
|
+
* what shipped before the structured fields existed — so dismissals recorded
|
|
89
|
+
* by older builds keep working without a storage migration.
|
|
90
|
+
*/
|
|
91
|
+
export declare const buildAnnouncementSignature: (content: AnnouncementContent) => string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Translatable strings the chat-settings form surfaces. Every field defaults
|
|
95
|
+
* to an English fallback inside the hook; pass translated values from the
|
|
96
|
+
* consuming app (e.g. via a `useTranslation`-backed labels hook).
|
|
97
|
+
*/
|
|
98
|
+
export declare interface ChatSettingsFormLabels {
|
|
99
|
+
/** Dropdown item label and modal title. */
|
|
100
|
+
settings: string;
|
|
101
|
+
/** Toast/message text announced after a successful save. */
|
|
102
|
+
savedNotification: string;
|
|
103
|
+
/** Label for the response-format field. */
|
|
104
|
+
responseFormatLabel: string;
|
|
105
|
+
/** Helper text shown below the response-format field. */
|
|
106
|
+
responseFormatHint: string;
|
|
107
|
+
/** Label for the Markdown radio option. */
|
|
108
|
+
responseFormatMarkdown: string;
|
|
109
|
+
/** Label for the plain-text radio option. */
|
|
110
|
+
responseFormatPlainText: string;
|
|
111
|
+
/** Label for the system-prompt field. */
|
|
112
|
+
systemPromptLabel: string;
|
|
113
|
+
/** Tooltip for the system-prompt field. */
|
|
114
|
+
systemPromptTooltip: string;
|
|
115
|
+
/** Label for the temperature field. */
|
|
116
|
+
temperatureLabel: string;
|
|
117
|
+
/** Label for the precise end of the temperature slider. */
|
|
118
|
+
temperaturePrecise: string;
|
|
119
|
+
/** Label for the neutral midpoint of the temperature slider. */
|
|
120
|
+
temperatureNeutral: string;
|
|
121
|
+
/** Label for the creative end of the temperature slider. */
|
|
122
|
+
temperatureCreative: string;
|
|
123
|
+
/** Hint text shown below the temperature field. */
|
|
124
|
+
temperatureHint: string;
|
|
125
|
+
/** Save button label. */
|
|
126
|
+
saveLabel: string;
|
|
127
|
+
/** Tooltip shown on the disabled Save button. */
|
|
128
|
+
saveDisabledTooltip: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Values emitted by the chat-settings modal when the user clicks Save. */
|
|
132
|
+
export declare interface ChatSettingsValues {
|
|
133
|
+
/** Updated response format, present when the response-format field was shown. */
|
|
134
|
+
responseFormat?: ResponseFormat;
|
|
135
|
+
/** Updated system prompt, present when the system-prompt field was shown. */
|
|
136
|
+
systemPrompt?: string;
|
|
137
|
+
/** Updated temperature, present when the temperature field was shown. */
|
|
138
|
+
temperature?: number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** DIAL Core completion streaming transport produced by {@link createChatStreamApi}. */
|
|
142
|
+
export declare interface ChatStreamApi {
|
|
143
|
+
streamCompletion: (path: string, message: string | undefined, model: string, options: ChatStreamCompletionOptions, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum, messageIndex?: number, clientChannelId?: string) => void;
|
|
144
|
+
stopCompletion: (dto: {
|
|
145
|
+
generationId: string;
|
|
146
|
+
path: string;
|
|
147
|
+
}) => Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Callbacks {@link streamCompletion} reports streamed completion events through. */
|
|
151
|
+
export declare interface ChatStreamCompletionOptions {
|
|
152
|
+
onChunk: (chunk: StreamChunk) => void;
|
|
153
|
+
onComplete: () => void;
|
|
154
|
+
onError: (error: Error) => void;
|
|
155
|
+
signal?: AbortSignal;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Host-owned generation lifecycle, backing cross-navigation `AbortController` ownership. */
|
|
159
|
+
export declare interface ConversationGenerationLifecycle {
|
|
160
|
+
/** Starts (or replaces) tracking for a generation on `path`, returning its `AbortController`. */
|
|
161
|
+
startGeneration: (path: string, generationId: string) => AbortController;
|
|
162
|
+
/** Marks the generation identified by `path`/`generationId` complete, if it is still the active one. */
|
|
163
|
+
completeGeneration: (path: string, generationId: string) => void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Stable reverse-lookup maps returned by `useConversationLookupMaps`. */
|
|
167
|
+
export declare interface ConversationLookupMaps {
|
|
168
|
+
/** Returns the raw context id for a panel-space conversation id, or `undefined` when not found. */
|
|
169
|
+
toContextId: (panelId: string) => string | undefined;
|
|
170
|
+
/** Returns the raw `ConversationListItemDto` for a panel-space conversation id, or `undefined` when not found. */
|
|
171
|
+
getRawItem: (panelId: string) => ConversationListItemDto | undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare interface ConversationModeParams {
|
|
175
|
+
mode: 'conversation';
|
|
176
|
+
conversation: Conversation;
|
|
177
|
+
onConversationChange: (conversation: Conversation) => void;
|
|
178
|
+
deploymentFeatures?: DeploymentFeatures;
|
|
179
|
+
/** True when the conversation's deployment is a Quick App. Its orchestrator sets its own fixed temperature, so the temperature field is forced off regardless of `deploymentFeatures`. */
|
|
180
|
+
isQuickApp?: boolean;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Distilled row-action state for a single conversation item. */
|
|
184
|
+
export declare interface ConversationRowActionState {
|
|
185
|
+
/** `true` when the item is read-only (shared-with-me, published-with-me, or explicitly readonly). */
|
|
186
|
+
isReadonly: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Deduplicated list of folder paths (as joined slash-delimited strings)
|
|
189
|
+
* to which this conversation has been published. Empty when the conversation
|
|
190
|
+
* is unowned, readonly, or publish history is unavailable.
|
|
191
|
+
*/
|
|
192
|
+
publishedFolders: string[];
|
|
193
|
+
/**
|
|
194
|
+
* `true` when the revoke-access action should be shown: either the
|
|
195
|
+
* recipient count is unknown (lookup pending/failed) or at least one
|
|
196
|
+
* recipient exists.
|
|
197
|
+
*/
|
|
198
|
+
isRevokeVisible: boolean;
|
|
199
|
+
/** `true` when publish is applicable (no published folders yet). */
|
|
200
|
+
isPublishApplicable: boolean;
|
|
201
|
+
/** `true` when unpublish is applicable (at least one published folder exists). */
|
|
202
|
+
isUnpublishApplicable: boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Shared mutable channel through which the displayed conversation's state is read/written. */
|
|
206
|
+
export declare interface ConversationStateAccessor {
|
|
207
|
+
setConversation: Dispatch<SetStateAction<Conversation | null>>;
|
|
208
|
+
conversationRef: MutableRefObject<Conversation | null>;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Optional host-owned client-channel connection, used to nudge tool-signin delivery. */
|
|
212
|
+
export declare interface ConversationStreamChannel {
|
|
213
|
+
channelId: string | null;
|
|
214
|
+
ensureConnected: () => void;
|
|
215
|
+
/** Resolves with a channel id, waiting for an in-flight subscribe if one isn't established yet, so a completion sent immediately after mount can still carry it. */
|
|
216
|
+
waitForChannel: (timeoutMs?: number) => Promise<string | null>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Optional host-owned overlay generation-lifecycle notifications. Each method is independently optional. */
|
|
220
|
+
export declare interface ConversationStreamOverlayNotifier {
|
|
221
|
+
notifyGenerationStart?: () => void;
|
|
222
|
+
notifyGenerationEnd?: () => void;
|
|
223
|
+
notifyStopGenerating?: () => void;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** The exact `startStream` shape `useConversationStream` returns. */
|
|
227
|
+
export declare type ConversationStreamStarter = (conversationPath: string, userContent: string, messageIndex: number, model: string, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum) => void;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Host-owned transport for the DIAL Core completion protocol. Implemented at
|
|
231
|
+
* the app edge — never hardcodes an `/api` path, CSRF handling, or a
|
|
232
|
+
* `server-api` import; the library only depends on this interface's shape.
|
|
233
|
+
*/
|
|
234
|
+
export declare interface ConversationStreamTransport {
|
|
235
|
+
/** Starts a completion; delivers chunks/completion/error through `options`, aborted via `options.signal`. */
|
|
236
|
+
streamCompletion(path: string, message: string | undefined, model: string, options: StreamCompletionOptions, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum, messageIndex?: number, clientChannelId?: string): void;
|
|
237
|
+
/** Requests the backend stop an active generation. */
|
|
238
|
+
stopCompletion(params: {
|
|
239
|
+
generationId: string;
|
|
240
|
+
path: string;
|
|
241
|
+
}): Promise<void>;
|
|
242
|
+
/** Opens a stream of resource-update events for `path`, until aborted via `signal`. */
|
|
243
|
+
watchConversation(path: string, signal: AbortSignal): Promise<ReadableStream<Uint8Array>>;
|
|
244
|
+
/**
|
|
245
|
+
* Attaches to an active generation's live replay: a `snapshot` event
|
|
246
|
+
* carrying the assistant message as assembled so far, then a `chunk` event
|
|
247
|
+
* per subsequent delta, then exactly one terminal event (`done`/`error`/
|
|
248
|
+
* `stopped`), until aborted via `signal`. Rejects when no active
|
|
249
|
+
* generation exists for `path` — including one that already finished —
|
|
250
|
+
* so the caller can fall back to `watchConversation`.
|
|
251
|
+
*/
|
|
252
|
+
attachToGeneration(path: string, signal: AbortSignal): Promise<ReadableStream<Uint8Array>>;
|
|
253
|
+
/** Reloads the persisted conversation by its full (bucket-qualified) id. */
|
|
254
|
+
getConversation(conversationId: string, signal?: AbortSignal): Promise<Conversation>;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Builds the streamed-completion transport `apps/chat/src/server-api/chat-stream.api.ts`
|
|
259
|
+
* exposes today: SSE parsing across partial chunks, CSRF header attachment
|
|
260
|
+
* and rotation, and an optional timezone header, backed by an injected
|
|
261
|
+
* `fetch` implementation and base path.
|
|
262
|
+
*/
|
|
263
|
+
export declare const createChatStreamApi: (deps: CreateChatStreamApiDeps) => ChatStreamApi;
|
|
264
|
+
|
|
265
|
+
/** Host capabilities {@link createChatStreamApi} needs to stream and stop completions. */
|
|
266
|
+
export declare interface CreateChatStreamApiDeps {
|
|
267
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
268
|
+
getCsrfToken: () => string | null;
|
|
269
|
+
/** Stores a CSRF token captured from a response header. */
|
|
270
|
+
setCsrfToken: (token: string | null) => void;
|
|
271
|
+
/** Base path for the completion/stop endpoints, e.g. `/api/v1/conversations`. */
|
|
272
|
+
completionsBasePath: string;
|
|
273
|
+
/** Resolves the caller's current timezone, attached as `X-Timezone` when non-empty. */
|
|
274
|
+
getTimezone?: () => string | undefined;
|
|
275
|
+
/** `fetch` implementation to issue requests through. Defaults to the global `fetch`. */
|
|
276
|
+
fetchImpl?: typeof fetch;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Creates a status message recording a deployment change in the conversation timeline.
|
|
281
|
+
* Status messages are never forwarded to DIAL Core.
|
|
282
|
+
*/
|
|
283
|
+
export declare const createDeploymentChangedMessage: (previousDeploymentId: string | null, newDeploymentId: string) => StatusMessage;
|
|
284
|
+
|
|
285
|
+
/** Builds a user message and its empty assistant placeholder, both timestamped `now`. */
|
|
286
|
+
export declare const createMessagePair: (content: string, customContent?: MessageCustomContent, deploymentId?: string | null) => MessagePair;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Derives the row-action visibility state for a single conversation item.
|
|
290
|
+
*
|
|
291
|
+
* Extracted from `getActions` in `ConversationPanelView` to isolate the
|
|
292
|
+
* readonly / publish / unpublish / revoke decision logic from the
|
|
293
|
+
* `DropdownItem` construction and `t()` calls that remain in the app.
|
|
294
|
+
*
|
|
295
|
+
* @param item - Conversation DTO fields relevant to ownership classification.
|
|
296
|
+
* @param publishHistory - Resolved publish-history entries, or `undefined`
|
|
297
|
+
* when history is unavailable or should be treated as empty (e.g. while
|
|
298
|
+
* loading or when the item is readonly).
|
|
299
|
+
* @param recipients - Current share-recipients count entry for this item.
|
|
300
|
+
*/
|
|
301
|
+
export declare const deriveConversationRowActionState: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe" | "isReadonly">, publishHistory: PublishHistoryEntry[] | undefined, recipients: RecipientsCountEntry) => ConversationRowActionState;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Normalises a version string for display. The server falls back to a bare
|
|
305
|
+
* `package.json` version (`0.45.0`), while a CI-supplied `CHAT_VERSION` is
|
|
306
|
+
* often already tagged (`v0.45.0`) — prefixing unconditionally would render
|
|
307
|
+
* `vv0.45.0`.
|
|
308
|
+
*/
|
|
309
|
+
export declare const formatAppVersion: (version: string) => string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Strips the leading bucket segment from a conversation id and decodes any
|
|
313
|
+
* already-percent-encoded remainder back to raw, so callers that re-encode
|
|
314
|
+
* the result once (e.g. an API client) don't double-encode it on the wire.
|
|
315
|
+
*/
|
|
316
|
+
export declare const getConversationPath: (conversationId: string) => string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Classifies a conversation's ownership using the shared filter-tab contract.
|
|
320
|
+
*/
|
|
321
|
+
export declare const getConversationSource: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe">) => FilterTab;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Returns the `new_deployment_id` from the last `model_changed` status message
|
|
325
|
+
* in the list, or `null` if none exists.
|
|
326
|
+
*/
|
|
327
|
+
export declare const getLastDeploymentId: (messages: Message[]) => string | null;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Returns the `configuration_value` stored on the last user message, or
|
|
331
|
+
* `undefined` if none exists. Used to restore the tools menu toggle state
|
|
332
|
+
* when a conversation is (re-)loaded, mirroring `getLastDeploymentId`.
|
|
333
|
+
*/
|
|
334
|
+
export declare const getLastUserMessageToolConfiguration: (messages: Message[]) => Record<string, unknown> | undefined;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Extracts the deployment/model ID from a DIAL Core conversation ID.
|
|
338
|
+
*
|
|
339
|
+
* The backend builds conversation paths as `{deploymentId}__{title}` then runs
|
|
340
|
+
* `encodeDialResourcePath` which splits on `/` and encodes each segment. This
|
|
341
|
+
* means both the deployment ID and the title may introduce extra `/`-separated
|
|
342
|
+
* URL segments:
|
|
343
|
+
*
|
|
344
|
+
* - Deployment `anthropic/claude-3`, title `My chat`
|
|
345
|
+
* → `conversations/bucket/anthropic/claude-3__My%20chat`
|
|
346
|
+
*
|
|
347
|
+
* - Deployment `uuid`, title `calc 6/2/2026` (title contains slashes)
|
|
348
|
+
* → `conversations/bucket/uuid__calc%206/2/2026`
|
|
349
|
+
*
|
|
350
|
+
* The `__` separator is present in the first filename segment. Versioned
|
|
351
|
+
* application deployments use `{name}__{version}__{title}`, so the version
|
|
352
|
+
* suffix still belongs to the deployment ID.
|
|
353
|
+
*
|
|
354
|
+
* In regular model conversations, the separator is always present in exactly
|
|
355
|
+
* one segment — the first one that contains it. Segments before that segment
|
|
356
|
+
* are deployment ID path prefixes; segments from that point onward are the
|
|
357
|
+
* title (possibly overflowing into further `/`-separated segments).
|
|
358
|
+
*
|
|
359
|
+
* Returns `undefined` when the format is unrecognised.
|
|
360
|
+
*/
|
|
361
|
+
export declare const getModelIdFromConversationId: (id: string) => string | undefined;
|
|
362
|
+
|
|
363
|
+
/** Parses a Quick App's raw `conversationStarters` schema value into starter options. */
|
|
364
|
+
export declare const getQuickAppConversationStarters: (conversationStarters: unknown) => QuickAppConversationStartersSettings;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Returns the text to start/populate a conversation from a selected starter button.
|
|
368
|
+
* `description` (the schema property's shared intro/question text) is used only
|
|
369
|
+
* as a fallback when the starter's own `populateText` is explicitly `null` — it
|
|
370
|
+
* must never override a starter's own configured prompt.
|
|
371
|
+
*/
|
|
372
|
+
export declare const getStarterConversationText: (starter: StarterOption, description?: string) => string;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Returns the text to populate in the input when a starter button is selected.
|
|
376
|
+
* Falls back to the button title if `populateText` is empty.
|
|
377
|
+
*/
|
|
378
|
+
export declare const getStarterPopulateText: (starter: StarterOption) => string;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Extracts starter options, the schema property key (`'starter'` or `'button'`),
|
|
382
|
+
* and the optional description text from a deployment configuration schema.
|
|
383
|
+
*
|
|
384
|
+
* - `propertyKey` — `'starter'` or `'button'`; used to build `configuration_value`.
|
|
385
|
+
* - `description` — human-readable prompt shown above the buttons (only present for `button` properties).
|
|
386
|
+
*
|
|
387
|
+
* Returns an empty starters array and `undefined` fields when no matching property is found.
|
|
388
|
+
*/
|
|
389
|
+
export declare const getStartersFromSchema: (schema: DeploymentConfigurationSchema | null | undefined) => {
|
|
390
|
+
starters: StarterOption[];
|
|
391
|
+
propertyKey: string | undefined;
|
|
392
|
+
description: string | undefined;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Returns submitted text for DIAL starter/form buttons.
|
|
397
|
+
* For submit buttons, `populateText: null` explicitly means "submit no text".
|
|
398
|
+
*/
|
|
399
|
+
export declare const getStarterSubmitText: (starter: StarterOption, description?: string) => string;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Returns a time-of-day greeting string.
|
|
403
|
+
* Hour ranges: morning 5–11, afternoon 12–16, evening 17–20, night 21–4.
|
|
404
|
+
* When firstName is provided the with-name variant is returned; otherwise the no-name variant.
|
|
405
|
+
*/
|
|
406
|
+
export declare const getTimeOfDayGreeting: (hour: number, translations: GreetingTranslations, firstName?: string) => string;
|
|
407
|
+
|
|
408
|
+
/** Pre-translated greeting phrase strings for each time-of-day period. */
|
|
409
|
+
export declare interface GreetingTranslations {
|
|
410
|
+
morningWithName: string;
|
|
411
|
+
morningNoName: string;
|
|
412
|
+
afternoonWithName: string;
|
|
413
|
+
afternoonNoName: string;
|
|
414
|
+
eveningWithName: string;
|
|
415
|
+
eveningNoName: string;
|
|
416
|
+
nightWithName: string;
|
|
417
|
+
nightNoName: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Whether at least one tool toggle in `value` is active. */
|
|
421
|
+
export declare const hasActiveToolConfig: (value: Record<string, boolean> | undefined) => boolean;
|
|
422
|
+
|
|
423
|
+
/** True when the announcement has any renderable content (structured or legacy HTML). */
|
|
424
|
+
export declare const hasAnnouncementContent: (content: AnnouncementContent) => boolean;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Whether the operator configured the structured banner (title and/or
|
|
428
|
+
* description) rather than only the legacy HTML message. Drives which of the
|
|
429
|
+
* two banner layouts renders.
|
|
430
|
+
*/
|
|
431
|
+
export declare const hasStructuredAnnouncement: ({ title, description, }: AnnouncementContent) => boolean;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* True when the conversation's last message is an unresolved assistant
|
|
435
|
+
* placeholder: the backend only persists a conversation at generation start
|
|
436
|
+
* (empty placeholder) and at generation end (final content, or a partial
|
|
437
|
+
* flagged `streamErrorMessage`/`wasStoppedByUser`), so this shape means a
|
|
438
|
+
* generation was still active elsewhere when the conversation was loaded.
|
|
439
|
+
*/
|
|
440
|
+
export declare const isAwaitingGenerationResume: (conversation: Conversation) => boolean;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Returns `true` when the edited text or attachment list differs from the
|
|
444
|
+
* original message, meaning a regeneration is needed.
|
|
445
|
+
*
|
|
446
|
+
* @param originalMessage - The unmodified message stored in the conversation.
|
|
447
|
+
* @param newText - The text the user submitted from the edit area.
|
|
448
|
+
* @param keptDisplayAttachments - Attachments the user kept (not removed).
|
|
449
|
+
* @param newAttachments - Brand-new attachments the user added during editing.
|
|
450
|
+
*/
|
|
451
|
+
export declare const isMessageChanged: (originalMessage: Message, newText: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => boolean;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Returns `true` when `message` is the actively-streaming assistant response.
|
|
455
|
+
* Only the last message in the list can be streaming, and only while
|
|
456
|
+
* `isAssistantTyping` is `true`.
|
|
457
|
+
*/
|
|
458
|
+
export declare const isMessageStreaming: (message: Message, messageIndex: number, totalMessages: number, isAssistantTyping: boolean) => boolean;
|
|
459
|
+
|
|
460
|
+
declare interface LocalModeParams {
|
|
461
|
+
mode: 'local';
|
|
462
|
+
values: LocalModeValues;
|
|
463
|
+
onValuesChange: (values: LocalModeValues) => void;
|
|
464
|
+
deploymentFeatures?: DeploymentFeatures;
|
|
465
|
+
/** True when the selected deployment is a Quick App. Its orchestrator sets its own fixed temperature, so the temperature field is forced off regardless of `deploymentFeatures`. */
|
|
466
|
+
isQuickApp?: boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
declare interface LocalModeValues {
|
|
470
|
+
responseFormat: ResponseFormat;
|
|
471
|
+
systemPrompt: string;
|
|
472
|
+
temperature: number;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** True when `message` is an assistant message carrying at least one stage. */
|
|
476
|
+
export declare const messageHasStages: (message: Message) => boolean;
|
|
477
|
+
|
|
478
|
+
/** A newly-created user message paired with its empty assistant placeholder. */
|
|
479
|
+
export declare interface MessagePair {
|
|
480
|
+
userMessage: Message;
|
|
481
|
+
assistantMessage: Message;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Normalises a stored response-format string to the current enum. Legacy data
|
|
486
|
+
* may contain `'Markdown'` or `'PlainText'` (capital-first) instead of the
|
|
487
|
+
* current enum values `'markdown'` / `'plain_text'`.
|
|
488
|
+
*/
|
|
489
|
+
export declare const normalizeResponseFormat: (value: string | undefined) => ResponseFormat;
|
|
490
|
+
|
|
491
|
+
/** Common, host-injected options shared by both modes. */
|
|
492
|
+
declare interface Options {
|
|
493
|
+
/** Translatable labels. Fields not provided fall back to English defaults. */
|
|
494
|
+
labels?: Partial<ChatSettingsFormLabels>;
|
|
495
|
+
/** Called after a successful save so the host can surface its own toast/notification. */
|
|
496
|
+
onSaved?: () => void;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
declare type Params = LocalModeParams | ConversationModeParams;
|
|
500
|
+
|
|
501
|
+
/** Resolved Quick App conversation-starter settings. */
|
|
502
|
+
export declare interface QuickAppConversationStartersSettings {
|
|
503
|
+
starters: StarterOption[];
|
|
504
|
+
introText: string | undefined;
|
|
505
|
+
isChatMessageInputDisabled: boolean;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/** State of one resource's recipient-count lookup. */
|
|
509
|
+
declare interface RecipientsCountEntry {
|
|
510
|
+
/** Where the lookup for this resource currently stands. */
|
|
511
|
+
status: RecipientsCountStatus;
|
|
512
|
+
/** Number of users holding access; present only once the status is `Resolved`. */
|
|
513
|
+
count?: number;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/** Lifecycle of an on-demand recipient-count lookup for one resource. */
|
|
517
|
+
declare enum RecipientsCountStatus {
|
|
518
|
+
/** Nothing requested yet for this resource. */
|
|
519
|
+
Idle = "idle",
|
|
520
|
+
/** A lookup is in flight. */
|
|
521
|
+
Loading = "loading",
|
|
522
|
+
/** A count came back and is known exactly. */
|
|
523
|
+
Resolved = "resolved",
|
|
524
|
+
/** The lookup failed, so the count is unknown. */
|
|
525
|
+
Unknown = "unknown"
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/** Sanitizes announcement HTML to the allowed inline tag/attribute set. */
|
|
529
|
+
export declare const sanitizeAnnouncementHtml: (html: string) => string;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Sanitizes the legacy `ANNOUNCEMENT_HTML_MESSAGE` banner, which permits the
|
|
533
|
+
* block-level markup the inline pass strips. See
|
|
534
|
+
* `ANNOUNCEMENT_MESSAGE_SANITIZE_OPTIONS` for why the two lists differ.
|
|
535
|
+
*/
|
|
536
|
+
export declare const sanitizeAnnouncementMessageHtml: (html: string) => string;
|
|
537
|
+
|
|
538
|
+
/** Sanitizes footer message HTML to the allowed tag/attribute set. */
|
|
539
|
+
export declare const sanitizeFooterHtml: (html: string) => string;
|
|
540
|
+
|
|
541
|
+
/** True when the first user/assistant exchange is complete and LLM naming may still run. */
|
|
542
|
+
export declare const shouldWatchForDisplayNameUpdate: (conversation: Conversation) => boolean;
|
|
543
|
+
|
|
544
|
+
/** Options accepted by {@link ConversationStreamTransport.streamCompletion}. */
|
|
545
|
+
export declare interface StreamCompletionOptions {
|
|
546
|
+
onChunk: (chunk: StreamChunk) => void;
|
|
547
|
+
onComplete: () => void | Promise<void>;
|
|
548
|
+
onError: (error: Error) => void;
|
|
549
|
+
signal: AbortSignal;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/** Maps chat messages to the DIAL Chat Overlay protocol's message shape. */
|
|
553
|
+
export declare const toOverlayMessages: (messages: Message[]) => OverlayChatMessage[];
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Synchronises the active conversation with the conversation list and returns
|
|
557
|
+
* the panel-space id of the active conversation, or `undefined` when none is active.
|
|
558
|
+
*
|
|
559
|
+
* Side effects:
|
|
560
|
+
* 1. If the active conversation is not present in the list, requests a
|
|
561
|
+
* refresh. The list and refresh callback are intentionally excluded from
|
|
562
|
+
* the dependency array to avoid a refresh-loop on every list update.
|
|
563
|
+
* 2. Marks the active conversation as viewed whenever it or the list changes.
|
|
564
|
+
*/
|
|
565
|
+
export declare const useActiveConversationSync: ({ activeConversationId, items, refreshConversations, markConversationViewed, conversationIdsMatch, toPanelConversationId, }: UseActiveConversationSyncParams) => string | undefined;
|
|
566
|
+
|
|
567
|
+
/** Parameters for `useActiveConversationSync`. */
|
|
568
|
+
export declare interface UseActiveConversationSyncParams {
|
|
569
|
+
/**
|
|
570
|
+
* The raw context id of the currently active conversation, as tracked by
|
|
571
|
+
* the host app. `undefined` when no conversation is active.
|
|
572
|
+
*/
|
|
573
|
+
activeConversationId: string | undefined;
|
|
574
|
+
/** Raw conversation list from the API. */
|
|
575
|
+
items: ConversationListItemDto[];
|
|
576
|
+
/** Refetches the full conversation list. */
|
|
577
|
+
refreshConversations: () => Promise<void>;
|
|
578
|
+
/** Marks a scheduler-created conversation as viewed by raw context id. */
|
|
579
|
+
markConversationViewed: (id: string) => Promise<void>;
|
|
580
|
+
/**
|
|
581
|
+
* Returns `true` when two ids refer to the same conversation despite
|
|
582
|
+
* possible encoding differences. App-specific.
|
|
583
|
+
*/
|
|
584
|
+
conversationIdsMatch: (a: string, b: string) => boolean;
|
|
585
|
+
/** Converts a raw context id to the panel-space id. App-specific. */
|
|
586
|
+
toPanelConversationId: (id: string) => string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Generic single-slot pending / loading / error state machine for
|
|
591
|
+
* confirmation dialogs that trigger an async operation.
|
|
592
|
+
*
|
|
593
|
+
* Replaces the `[pendingXxx, setXxx] / [isXxxing, setIsXxxing] / [xxxError,
|
|
594
|
+
* setXxxError]` triads that previously appeared inline at each call site in
|
|
595
|
+
* `ConversationPanelView` and `ConversationPanelMenu`.
|
|
596
|
+
*/
|
|
597
|
+
export declare const useAsyncConfirmDialog: <T>() => AsyncConfirmDialogControls<T>;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Uploads an attachment's file to DIAL Core storage against an
|
|
601
|
+
* already-configured `FilesApi` instance, coalescing a burst of
|
|
602
|
+
* offline/network upload failures into a single debounced callback rather
|
|
603
|
+
* than firing one notification per failed file.
|
|
604
|
+
*/
|
|
605
|
+
export declare const useAttachmentUpload: ({ filesApi, bucket, onNetworkError, debounceMs, }: UseAttachmentUploadParams) => UseAttachmentUploadResult;
|
|
606
|
+
|
|
607
|
+
/** Parameters for {@link useAttachmentUpload}. */
|
|
608
|
+
export declare interface UseAttachmentUploadParams {
|
|
609
|
+
/** Already-configured generated-client instance used to upload the file. */
|
|
610
|
+
filesApi: Pick<FilesApi, 'uploadFile'>;
|
|
611
|
+
/** DIAL Core bucket the file is uploaded into. */
|
|
612
|
+
bucket: string | undefined;
|
|
613
|
+
/** Called with batched filenames after a burst of network-error upload failures. */
|
|
614
|
+
onNetworkError?: (filenames: string[]) => void;
|
|
615
|
+
/** Debounce window, in ms, for coalescing offline-failure batches. Defaults to `700`. */
|
|
616
|
+
debounceMs?: number;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/** Return value of {@link useAttachmentUpload}. */
|
|
620
|
+
export declare interface UseAttachmentUploadResult {
|
|
621
|
+
/** Uploads the given attachment's file and resolves to its DIAL Core file URL. */
|
|
622
|
+
handleUploadAttachment: (attachment: Attachment) => Promise<string>;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Assembles the chat-settings form config (feature flags, current values, save
|
|
627
|
+
* handler, labels) for either an in-flight local composer or a persisted
|
|
628
|
+
* conversation. Headless: translation and notifications are the host's
|
|
629
|
+
* responsibility, supplied via `labels` and `onSaved`.
|
|
630
|
+
*/
|
|
631
|
+
export declare const useChatSettingsFormConfig: (params: Params & Options) => UseChatSettingsFormConfigResult;
|
|
632
|
+
|
|
633
|
+
/** Configuration the chat-settings popover/modal consumes. */
|
|
634
|
+
export declare type UseChatSettingsFormConfigResult = {
|
|
635
|
+
/** Feature flags controlling which fields appear. */
|
|
636
|
+
features: {
|
|
637
|
+
systemPrompt: boolean;
|
|
638
|
+
temperature: boolean;
|
|
639
|
+
responseFormat: boolean;
|
|
640
|
+
};
|
|
641
|
+
/** Current response format pre-selected in the modal. */
|
|
642
|
+
responseFormat: ResponseFormat;
|
|
643
|
+
/** Current system prompt pre-populated in the modal. */
|
|
644
|
+
systemPrompt: string;
|
|
645
|
+
/** Current temperature pre-populated in the modal. */
|
|
646
|
+
temperature: number;
|
|
647
|
+
/** Called with updated values when the user clicks Save. */
|
|
648
|
+
onSave: (values: ChatSettingsValues) => void;
|
|
649
|
+
/** Label for the dropdown menu item. */
|
|
650
|
+
menuItemLabel: string;
|
|
651
|
+
/** Modal title. */
|
|
652
|
+
title: string;
|
|
653
|
+
/** Label for the response-format field. */
|
|
654
|
+
responseFormatLabel: string;
|
|
655
|
+
/** Helper text shown below the response-format field. */
|
|
656
|
+
responseFormatHint: string;
|
|
657
|
+
/** Label for the Markdown radio option. */
|
|
658
|
+
responseFormatMarkdownLabel: string;
|
|
659
|
+
/** Label for the plain-text radio option. */
|
|
660
|
+
responseFormatPlainTextLabel: string;
|
|
661
|
+
/** Label for the system-prompt field. */
|
|
662
|
+
systemPromptLabel: string;
|
|
663
|
+
/** Tooltip for the system-prompt field. */
|
|
664
|
+
systemPromptTooltip: string;
|
|
665
|
+
/** Label for the temperature field. */
|
|
666
|
+
temperatureLabel: string;
|
|
667
|
+
/** Slider endpoint labels, in `[precise, neutral, creative]` order. */
|
|
668
|
+
temperatureLabels: [string, string, string];
|
|
669
|
+
/** Hint text shown below the temperature field. */
|
|
670
|
+
temperatureHint: string;
|
|
671
|
+
/** Save button label. */
|
|
672
|
+
saveLabel: string;
|
|
673
|
+
/** Tooltip shown on the disabled Save button. */
|
|
674
|
+
saveDisabledTooltip: string;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Composes send/regenerate/edit/delete/rate/starter-submission orchestration
|
|
679
|
+
* on top of the library's own `useAttachmentUpload` and the injected
|
|
680
|
+
* `startStream` (from `useConversationStream`). Optimistic message-pair
|
|
681
|
+
* insertion, delete confirmation, and rate revert-on-failure all mutate the
|
|
682
|
+
* shared `state` channel directly, in lockstep with the streaming hook.
|
|
683
|
+
*/
|
|
684
|
+
export declare const useConversationHandlers: ({ conversation, conversationId, bucket, isStreaming, startStream, state: { setConversation, conversationRef }, filesApi, conversationsApi, rateApi, resolveModelId, onConversationDeleted, showNetworkError, toolConfigurationValue, }: UseConversationHandlersParams) => UseConversationHandlersResult;
|
|
685
|
+
|
|
686
|
+
/** Parameters for {@link useConversationHandlers}. */
|
|
687
|
+
export declare interface UseConversationHandlersParams {
|
|
688
|
+
conversation: Conversation | null;
|
|
689
|
+
conversationId: string | undefined;
|
|
690
|
+
bucket: string | undefined;
|
|
691
|
+
isStreaming: boolean;
|
|
692
|
+
/** The `startStream` function returned by `useConversationStream`. */
|
|
693
|
+
startStream: ConversationStreamStarter;
|
|
694
|
+
/** Shared mutable channel for the displayed conversation — the same one passed to `useConversationStream`. */
|
|
695
|
+
state: ConversationStateAccessor;
|
|
696
|
+
/** Already-configured generated-client instance used to upload attachments. */
|
|
697
|
+
filesApi: Pick<FilesApi, 'uploadFile'>;
|
|
698
|
+
/** Already-configured generated-client instance used to save/delete the conversation. */
|
|
699
|
+
conversationsApi: Pick<ConversationsApi, 'saveConversation' | 'deleteConversation'>;
|
|
700
|
+
/** Already-configured generated-client instance used to rate a message. */
|
|
701
|
+
rateApi: Pick<RateApi, 'rateMessage'>;
|
|
702
|
+
/** Resolves the model id to send with the next completion. Re-evaluated on every call — never cached. */
|
|
703
|
+
resolveModelId: () => string;
|
|
704
|
+
/** Called when deleting the last message also deletes the whole conversation. */
|
|
705
|
+
onConversationDeleted?: () => void;
|
|
706
|
+
/** Called with batched filenames after a burst of network-error upload failures. */
|
|
707
|
+
showNetworkError?: (filenames: string[]) => void;
|
|
708
|
+
/** Tool toggle configuration values merged into every outgoing completion request. */
|
|
709
|
+
toolConfigurationValue?: Record<string, boolean>;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/** Return value of {@link useConversationHandlers}. */
|
|
713
|
+
export declare interface UseConversationHandlersResult {
|
|
714
|
+
handleSend: (message: string, attachments: Attachment[]) => Promise<void>;
|
|
715
|
+
handleUploadAttachment: (attachment: Attachment) => Promise<string>;
|
|
716
|
+
handleRegenerateMessage: (messageIndex: number) => void;
|
|
717
|
+
handleDeleteMessage: (messageIndex: number) => void;
|
|
718
|
+
handleConfirmDelete: () => void;
|
|
719
|
+
handleRateMessage: (messageIndex: number, rating: MessageRating | null, comment?: string) => Promise<boolean>;
|
|
720
|
+
handleButtonSelect: (starter: StarterOption, propertyKey?: string, description?: string) => void;
|
|
721
|
+
handleConfirmStarter: () => void;
|
|
722
|
+
handleStartEdit: (messageIndex: number) => void;
|
|
723
|
+
handleCancelEdit: (messageIndex: number) => void;
|
|
724
|
+
handleEditMessage: (messageIndex: number, text: string, keptDisplayAttachments: DisplayAttachment[], newAttachments: Attachment[]) => Promise<void>;
|
|
725
|
+
editingMessageIndexes: Set<number>;
|
|
726
|
+
pendingDeleteIndex: number | null;
|
|
727
|
+
setPendingDeleteIndex: (index: number | null) => void;
|
|
728
|
+
pendingStarterContext: {
|
|
729
|
+
starter: StarterOption;
|
|
730
|
+
propertyKey?: string;
|
|
731
|
+
description?: string;
|
|
732
|
+
} | null;
|
|
733
|
+
setPendingStarterContext: (context: {
|
|
734
|
+
starter: StarterOption;
|
|
735
|
+
propertyKey?: string;
|
|
736
|
+
description?: string;
|
|
737
|
+
} | null) => void;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Builds two memoised reverse-lookup maps from the raw conversation list:
|
|
742
|
+
* panel-space id → context id and panel-space id → raw DTO.
|
|
743
|
+
*
|
|
744
|
+
* Replaces the inlined `panelToContextId` map and `items.find` calls that
|
|
745
|
+
* previously appeared at each row-action call site in `ConversationPanelView`.
|
|
746
|
+
*/
|
|
747
|
+
export declare const useConversationLookupMaps: ({ items, toPanelConversationId, }: UseConversationLookupMapsParams) => ConversationLookupMaps;
|
|
748
|
+
|
|
749
|
+
/** Parameters for `useConversationLookupMaps`. */
|
|
750
|
+
export declare interface UseConversationLookupMapsParams {
|
|
751
|
+
/** Raw conversation list from the API. */
|
|
752
|
+
items: ConversationListItemDto[];
|
|
753
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
754
|
+
toPanelConversationId: (id: string) => string;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Maps raw `ConversationListItemDto[]` to panel-compatible conversation items.
|
|
759
|
+
*
|
|
760
|
+
* Returns a memoised array whose shape is compatible with the conversation
|
|
761
|
+
* panel's item contract. All app-specific concerns (icon URL resolution,
|
|
762
|
+
* route generation, id normalisation) are injected via resolver callbacks.
|
|
763
|
+
*/
|
|
764
|
+
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskBadge, }: UseConversationPanelItemsParams) => {
|
|
765
|
+
showTaskBadge?: boolean | undefined;
|
|
766
|
+
taskBadgeLabel?: string | undefined;
|
|
767
|
+
isUnread?: boolean | undefined;
|
|
768
|
+
id: string;
|
|
769
|
+
title: string;
|
|
770
|
+
isPinned: boolean;
|
|
771
|
+
iconUrl: string | undefined;
|
|
772
|
+
iconTooltip: string | undefined;
|
|
773
|
+
isIconLoading: boolean;
|
|
774
|
+
source: FilterTab;
|
|
775
|
+
href: string;
|
|
776
|
+
}[];
|
|
777
|
+
|
|
778
|
+
/** Parameters accepted by `useConversationPanelItems`. */
|
|
779
|
+
export declare interface UseConversationPanelItemsParams extends UseConversationPanelItemsResolvers {
|
|
780
|
+
/** Raw conversation list from the API. */
|
|
781
|
+
items: ConversationListItemDto[];
|
|
782
|
+
/** Available deployments used to resolve icons and tooltips. */
|
|
783
|
+
deployments: DeploymentItemDto[];
|
|
784
|
+
/** Whether the deployments list is still loading (drives `isIconLoading`). */
|
|
785
|
+
isDeploymentsLoading: boolean;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/** Resolver callbacks injected by the host app into `useConversationPanelItems`. */
|
|
789
|
+
export declare interface UseConversationPanelItemsResolvers {
|
|
790
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
791
|
+
toPanelConversationId: (id: string) => string;
|
|
792
|
+
/** Resolves the icon URL for a deployment. Returns `undefined` when not available. */
|
|
793
|
+
resolveIconUrl: (deployment: DeploymentItemDto | undefined) => string | undefined;
|
|
794
|
+
/**
|
|
795
|
+
* Resolves the icon tooltip text. Receives the matched deployment (or
|
|
796
|
+
* `undefined`) and a decoded fallback string derived from the model path.
|
|
797
|
+
*/
|
|
798
|
+
resolveIconTooltip: (deployment: DeploymentItemDto | undefined, fallback: string) => string | undefined;
|
|
799
|
+
/** Resolves the href to navigate to when the conversation row is clicked. */
|
|
800
|
+
resolveHref: (panelConversationId: string) => string;
|
|
801
|
+
/**
|
|
802
|
+
* Returns badge metadata for a scheduled-task conversation, or `undefined`
|
|
803
|
+
* when the item should not show a task badge.
|
|
804
|
+
*/
|
|
805
|
+
resolveTaskBadge?: (item: ConversationListItemDto) => {
|
|
806
|
+
label: string;
|
|
807
|
+
isUnread: boolean;
|
|
808
|
+
} | undefined;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Owns completion-streaming state: per-path streaming/stoppable tracking,
|
|
813
|
+
* stale-chunk rejection, cross-navigation live-message buffering,
|
|
814
|
+
* reload-after-complete, backend-driven stop, and hard-refresh resume
|
|
815
|
+
* detection — all driven through the injected
|
|
816
|
+
* `transport`/`generation`/`channel`/`overlay` capabilities rather than any
|
|
817
|
+
* app context or `server-api` import.
|
|
818
|
+
*/
|
|
819
|
+
export declare const useConversationStream: ({ conversationId, state: { setConversation, conversationRef }, transport, generation: { startGeneration, completeGeneration }, channel, overlay, onStopError, }: UseConversationStreamParams) => UseConversationStreamResult;
|
|
820
|
+
|
|
821
|
+
/** Parameters for {@link useConversationStream}. */
|
|
822
|
+
export declare interface UseConversationStreamParams {
|
|
823
|
+
conversationId: string | undefined;
|
|
824
|
+
state: ConversationStateAccessor;
|
|
825
|
+
transport: ConversationStreamTransport;
|
|
826
|
+
generation: ConversationGenerationLifecycle;
|
|
827
|
+
channel?: ConversationStreamChannel;
|
|
828
|
+
overlay?: ConversationStreamOverlayNotifier;
|
|
829
|
+
onStopError?: (error: Error) => void;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/** Return value of {@link useConversationStream}. */
|
|
833
|
+
export declare interface UseConversationStreamResult {
|
|
834
|
+
startStream: (conversationId: string, userContent: string, messageIndex: number, model: string, customContent?: MessageCustomContent, generationId?: string, mode?: SendCompletionDtoModeEnum) => void;
|
|
835
|
+
handleStop: () => void;
|
|
836
|
+
resumeIfAwaitingGeneration: (currentConversationId: string, conversation: Conversation) => void;
|
|
837
|
+
/** Restores the accumulated live assistant message when its conversation is loaded again before completion. */
|
|
838
|
+
restoreBufferedGeneration: (currentConversationId: string, conversation: Conversation) => Conversation;
|
|
839
|
+
isStreaming: boolean;
|
|
840
|
+
canStopStreaming: boolean;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Manages the hidden `<input type="file">` pattern used to trigger a native
|
|
845
|
+
* file-picker without a visible control.
|
|
846
|
+
*
|
|
847
|
+
* The host renders `<input ref={inputRef} type="file" onChange={handleFileChange} />`
|
|
848
|
+
* and calls `triggerImport()` when the user initiates an import action. The
|
|
849
|
+
* hook sets the `accept` attribute via a layout effect so re-selecting the
|
|
850
|
+
* same file always fires `onChange` (the value is reset after each selection).
|
|
851
|
+
*/
|
|
852
|
+
export declare const useImportFilePicker: ({ accept, onFileSelected, }: UseImportFilePickerParams) => UseImportFilePickerResult;
|
|
853
|
+
|
|
854
|
+
/** Parameters for `useImportFilePicker`. */
|
|
855
|
+
export declare interface UseImportFilePickerParams {
|
|
856
|
+
/**
|
|
857
|
+
* MIME types / file-extension filter string passed to the hidden input's
|
|
858
|
+
* `accept` attribute. The host resolves any platform-specific policy before
|
|
859
|
+
* passing this value.
|
|
860
|
+
*/
|
|
861
|
+
accept?: string;
|
|
862
|
+
/** Called with the selected `File` after the user confirms their choice. */
|
|
863
|
+
onFileSelected: (file: File) => void;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/** Controls returned by `useImportFilePicker`. */
|
|
867
|
+
export declare interface UseImportFilePickerResult {
|
|
868
|
+
/** Ref to attach to the hidden `<input type="file">` element. */
|
|
869
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
870
|
+
/** Programmatically opens the native file picker by clicking the hidden input. */
|
|
871
|
+
triggerImport: () => void;
|
|
872
|
+
/** `onChange` handler for the hidden input; calls `onFileSelected` and resets the value. */
|
|
873
|
+
handleFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Derives the tools submenu from the active deployment's configuration schema:
|
|
878
|
+
* every boolean property becomes a toggle. Manages toggle state locally, resets
|
|
879
|
+
* on deployment change, and exposes a stable `toolConfigurationValue` record for
|
|
880
|
+
* inclusion in completion requests. Headless: the tool icon is the host's
|
|
881
|
+
* responsibility, supplied via `toolIcon`.
|
|
882
|
+
*/
|
|
883
|
+
export declare const useToolsMenu: (params: UseToolsMenuParams) => UseToolsMenuResult;
|
|
884
|
+
|
|
885
|
+
/** Host-supplied inputs to {@link useToolsMenu}. */
|
|
886
|
+
export declare interface UseToolsMenuParams {
|
|
887
|
+
/** Id of the currently selected deployment, or `null` when none is selected. */
|
|
888
|
+
selectedItemId: string | null;
|
|
889
|
+
/** JSON-schema configuration for the selected deployment, or `null` when none. */
|
|
890
|
+
selectedDeploymentConfiguration: DeploymentConfigurationSchema | null;
|
|
891
|
+
/** Icon element rendered on every tool menu item. Defaults to `null`. */
|
|
892
|
+
toolIcon?: ReactNode;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/** Result returned by {@link useToolsMenu}. */
|
|
896
|
+
export declare type UseToolsMenuResult = {
|
|
897
|
+
/** One item per boolean property of the deployment configuration schema, in schema order. */
|
|
898
|
+
toolsMenuItems: ToolMenuItem[];
|
|
899
|
+
/** Toggles the tool with the given id; ignores unknown ids. */
|
|
900
|
+
onToolToggle: (id: string) => void;
|
|
901
|
+
/** Stable record of tool ids to their current on/off state, for completion requests. */
|
|
902
|
+
toolConfigurationValue: Record<string, boolean>;
|
|
903
|
+
/** Restores toggle state from a persisted tool configuration record. */
|
|
904
|
+
restoreToolConfiguration: (configurationValue: Record<string, unknown> | undefined) => void;
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
export { }
|