@epam/ai-dial-chat-hooks 1.3.0-dev.10 → 1.3.0-dev.103
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 +30 -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 +32 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -0
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts +50 -0
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +1 -0
- package/attachments.d.ts +2 -94
- package/catalog/catalog-derivations.d.ts +27 -0
- package/catalog/catalog-derivations.d.ts.map +1 -0
- package/catalog/catalog-derivations.js +1 -1
- 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 +42 -0
- package/catalog/deployment-id.d.ts.map +1 -0
- package/catalog/entity-details.d.ts +146 -0
- package/catalog/entity-details.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts +34 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.d.ts +28 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-to-catalog-item.d.ts +61 -0
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-entity-details-to-catalog.d.ts +81 -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 +113 -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 +35 -0
- package/catalog/publish.d.ts.map +1 -0
- package/catalog/useApplicationCredentials/useApplicationCredentials.d.ts +19 -0
- package/catalog/useApplicationCredentials/useApplicationCredentials.d.ts.map +1 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.d.ts +107 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.d.ts.map +1 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +155 -119
- package/catalog/useCatalogItemDetails.d.ts +70 -0
- package/catalog/useCatalogItemDetails.d.ts.map +1 -0
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.d.ts +76 -0
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.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 +73 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -0
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.d.ts +54 -0
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.d.ts.map +1 -0
- package/catalog/useSkillItemDetails.d.ts +64 -0
- package/catalog/useSkillItemDetails.d.ts.map +1 -0
- package/catalog.d.ts +2 -1433
- package/conversation/announcement-message.d.ts +61 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/conversation-draft/conversation-draft-store.d.ts +21 -0
- package/conversation/conversation-draft/conversation-draft-store.d.ts.map +1 -0
- package/conversation/conversation-draft/conversation-draft-store.js +84 -0
- package/conversation/conversation-draft/conversation-draft.d.ts +48 -0
- package/conversation/conversation-draft/conversation-draft.d.ts.map +1 -0
- package/conversation/conversation-transfer/async.d.ts +10 -0
- package/conversation/conversation-transfer/async.d.ts.map +1 -0
- package/conversation/conversation-transfer/attachment-refs.d.ts +42 -0
- package/conversation/conversation-transfer/attachment-refs.d.ts.map +1 -0
- package/conversation/conversation-transfer/build-upload-path.d.ts +42 -0
- package/conversation/conversation-transfer/build-upload-path.d.ts.map +1 -0
- package/conversation/conversation-transfer/date.d.ts +5 -0
- package/conversation/conversation-transfer/date.d.ts.map +1 -0
- package/conversation/conversation-transfer/dial-file-resolve.d.ts +10 -0
- package/conversation/conversation-transfer/dial-file-resolve.d.ts.map +1 -0
- package/conversation/conversation-transfer/export-conversation.d.ts +10 -0
- package/conversation/conversation-transfer/export-conversation.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.d.ts +106 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -0
- package/conversation/conversation-transfer/progress.d.ts +60 -0
- package/conversation/conversation-transfer/progress.d.ts.map +1 -0
- package/conversation/conversation-transfer/queue.d.ts +54 -0
- package/conversation/conversation-transfer/queue.d.ts.map +1 -0
- package/conversation/conversation-transfer/types.d.ts +36 -0
- package/conversation/conversation-transfer/types.d.ts.map +1 -0
- package/conversation/conversation-transfer/zip-export.d.ts +31 -0
- package/conversation/conversation-transfer/zip-export.d.ts.map +1 -0
- package/conversation/conversation-transfer/zip-import.d.ts +17 -0
- package/conversation/conversation-transfer/zip-import.d.ts.map +1 -0
- package/conversation/create-chat-stream-api.d.ts +98 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/create-chat-stream-api.js +28 -23
- 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 +38 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.js +1 -1
- 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 +67 -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/stage.d.ts +77 -0
- package/conversation/stage.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 +35 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +46 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +1 -0
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts +27 -0
- package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts.map +1 -0
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.d.ts +39 -0
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.d.ts.map +1 -0
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.js +132 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +72 -0
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -0
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts +7 -0
- package/conversation/useConversationHandlers/attachment-to-dto.d.ts.map +1 -0
- package/conversation/useConversationHandlers/message-factory.d.ts +9 -0
- package/conversation/useConversationHandlers/message-factory.d.ts.map +1 -0
- package/conversation/useConversationHandlers/message-utils.d.ts +38 -0
- package/conversation/useConversationHandlers/message-utils.d.ts.map +1 -0
- package/conversation/useConversationHandlers/starter-option.d.ts +24 -0
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -0
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts +66 -0
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +1 -0
- package/conversation/useConversationImport/useConversationImport.d.ts +54 -0
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +64 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- package/conversation/useConversationScroll/useConversationScroll.d.ts +46 -0
- package/conversation/useConversationScroll/useConversationScroll.d.ts.map +1 -0
- package/conversation/useConversationStream/apply-chunk.d.ts +35 -0
- package/conversation/useConversationStream/apply-chunk.d.ts.map +1 -0
- package/conversation/useConversationStream/buffered-generation.d.ts +15 -0
- package/conversation/useConversationStream/buffered-generation.d.ts.map +1 -0
- package/conversation/useConversationStream/conversation-path.d.ts +7 -0
- package/conversation/useConversationStream/conversation-path.d.ts.map +1 -0
- package/conversation/useConversationStream/frame-scheduler.d.ts +14 -0
- package/conversation/useConversationStream/frame-scheduler.d.ts.map +1 -0
- package/conversation/useConversationStream/generation-resume.d.ts +85 -0
- package/conversation/useConversationStream/generation-resume.d.ts.map +1 -0
- package/conversation/useConversationStream/useConversationStream.d.ts +145 -0
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -0
- package/conversation/useConversationStream/useConversationStream.js +233 -219
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts +32 -0
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +1 -0
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.d.ts +42 -0
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.d.ts.map +1 -0
- package/conversation/useTranscribeAudio/audio-transcription-error.d.ts +19 -0
- package/conversation/useTranscribeAudio/audio-transcription-error.d.ts.map +1 -0
- package/conversation/useTranscribeAudio/transcription-retry.d.ts +2 -0
- package/conversation/useTranscribeAudio/transcription-retry.d.ts.map +1 -0
- package/conversation/useTranscribeAudio/useTranscribeAudio.d.ts +43 -0
- package/conversation/useTranscribeAudio/useTranscribeAudio.d.ts.map +1 -0
- package/conversation/useTranscribeAudio/useTranscribeAudio.js +30 -27
- package/conversation-overlay.d.ts +2 -7
- package/conversation-sources/useConversationSources/useConversationSources.d.ts +20 -0
- package/conversation-sources/useConversationSources/useConversationSources.d.ts.map +1 -0
- package/conversation-sources.d.ts +2 -25
- package/conversation-transfer.d.ts +2 -190
- package/conversation.d.ts +2 -1372
- package/conversation.js +34 -32
- package/entry-points/attachments.d.ts +3 -0
- package/entry-points/attachments.d.ts.map +1 -0
- package/entry-points/catalog.d.ts +25 -0
- package/entry-points/catalog.d.ts.map +1 -0
- package/entry-points/conversation-overlay.d.ts +2 -0
- package/entry-points/conversation-overlay.d.ts.map +1 -0
- package/entry-points/conversation-sources.d.ts +2 -0
- package/entry-points/conversation-sources.d.ts.map +1 -0
- package/entry-points/conversation-transfer.d.ts +7 -0
- package/entry-points/conversation-transfer.d.ts.map +1 -0
- package/entry-points/conversation.d.ts +36 -0
- package/entry-points/conversation.d.ts.map +1 -0
- package/entry-points/file-manager-canvas.d.ts +2 -0
- package/entry-points/file-manager-canvas.d.ts.map +1 -0
- package/entry-points/file-manager.d.ts +31 -0
- package/entry-points/file-manager.d.ts.map +1 -0
- package/entry-points/mcp-apps.d.ts +6 -0
- package/entry-points/mcp-apps.d.ts.map +1 -0
- package/entry-points/oauth.d.ts +10 -0
- package/entry-points/oauth.d.ts.map +1 -0
- package/entry-points/offline-credentials.d.ts +5 -0
- package/entry-points/offline-credentials.d.ts.map +1 -0
- package/entry-points/scheduled-tasks.d.ts +9 -0
- package/entry-points/scheduled-tasks.d.ts.map +1 -0
- package/entry-points/scroll-anchoring.d.ts +2 -0
- package/entry-points/scroll-anchoring.d.ts.map +1 -0
- package/entry-points/sharing.d.ts +3 -0
- package/entry-points/sharing.d.ts.map +1 -0
- package/entry-points/skill-editor.d.ts +9 -0
- package/entry-points/skill-editor.d.ts.map +1 -0
- package/entry-points/skills-state.d.ts +2 -0
- package/entry-points/skills-state.d.ts.map +1 -0
- package/entry-points/source-content.d.ts +2 -0
- package/entry-points/source-content.d.ts.map +1 -0
- package/entry-points/usage-limits.d.ts +8 -0
- package/entry-points/usage-limits.d.ts.map +1 -0
- package/entry-points/usage.d.ts +3 -0
- package/entry-points/usage.d.ts.map +1 -0
- package/entry-points/utils.d.ts +17 -0
- package/entry-points/utils.d.ts.map +1 -0
- package/entry-points/viewport-layout.d.ts +4 -0
- package/entry-points/viewport-layout.d.ts.map +1 -0
- package/file-manager-canvas.d.ts +2 -418
- package/file-manager.d.ts +2 -1239
- package/file-manager.js +21 -21
- package/files/annotation.d.ts +10 -0
- package/files/annotation.d.ts.map +1 -0
- package/files/attachment-canvas.d.ts +123 -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 +21 -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-copy-move.util.d.ts +15 -0
- package/files/dial-file-manager-copy-move.util.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts +51 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.js +77 -62
- package/files/dial-file-manager-path.util.d.ts +48 -0
- package/files/dial-file-manager-path.util.d.ts.map +1 -0
- package/files/dial-file-manager.model.d.ts +36 -0
- package/files/dial-file-manager.model.d.ts.map +1 -0
- package/files/dial-file-manager.types.d.ts +327 -0
- package/files/dial-file-manager.types.d.ts.map +1 -0
- package/files/dial-file-manager.types.js +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/dial-files-api.d.ts +71 -0
- package/files/dial-files-api.d.ts.map +1 -0
- package/files/download-destination.d.ts +31 -0
- package/files/download-destination.d.ts.map +1 -0
- package/files/file-manager-variant.d.ts +3 -0
- package/files/file-manager-variant.d.ts.map +1 -0
- package/files/file-name.d.ts +19 -0
- package/files/file-name.d.ts.map +1 -0
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/resolve-dial-file-api-path.d.ts +12 -0
- package/files/resolve-dial-file-api-path.d.ts.map +1 -0
- package/files/source-content.d.ts +28 -0
- package/files/source-content.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.d.ts +82 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.js +64 -51
- package/files/useDialFileManager/useDialFileManager.d.ts +16 -0
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -0
- package/files/useDialFileManager/useDialFileManager.js +3 -1
- package/files/useDialFileManagerSections/useDialFileManagerSections.d.ts +25 -0
- package/files/useDialFileManagerSections/useDialFileManagerSections.d.ts.map +1 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +15 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +1 -0
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts +28 -0
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +1 -0
- package/files/useDialFileMutations/useDialFileMutations.d.ts +68 -0
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -0
- package/files/useDialFileSharing/useDialFileSharing.d.ts +34 -0
- package/files/useDialFileSharing/useDialFileSharing.d.ts.map +1 -0
- package/files/useDialFileSharing/useDialFileSharing.js +45 -39
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +47 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +8 -4
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.d.ts +59 -0
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.d.ts.map +1 -0
- package/index.d.ts +167 -6976
- package/index.d.ts.map +1 -0
- package/index.js +115 -101
- package/mcp-apps/mcp-apps-api-client.d.ts +28 -0
- package/mcp-apps/mcp-apps-api-client.d.ts.map +1 -0
- package/mcp-apps/mcp-apps-api-client.js +18 -17
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.d.ts +14 -0
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.d.ts.map +1 -0
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts +29 -0
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts.map +1 -0
- package/mcp-apps/useMcpAppTools/useMcpAppTools.d.ts +22 -0
- package/mcp-apps/useMcpAppTools/useMcpAppTools.d.ts.map +1 -0
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +29 -29
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.d.ts +36 -0
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.d.ts.map +1 -0
- package/mcp-apps.d.ts +2 -256
- 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 +81 -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/popup.js +19 -17
- package/oauth/toolset-id.d.ts +53 -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/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +40 -38
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +79 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/oauth.d.ts +2 -472
- package/offline-credentials/map-offline-credentials-response.d.ts +17 -0
- package/offline-credentials/map-offline-credentials-response.d.ts.map +1 -0
- package/offline-credentials/map-offline-credentials-response.js +15 -0
- package/offline-credentials/useOfflineCredentialsAuth/useOfflineCredentialsAuth.d.ts +58 -0
- package/offline-credentials/useOfflineCredentialsAuth/useOfflineCredentialsAuth.d.ts.map +1 -0
- package/offline-credentials/useOfflineCredentialsAuth/useOfflineCredentialsAuth.js +37 -0
- package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.d.ts +57 -0
- package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.d.ts.map +1 -0
- package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.js +34 -0
- package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.d.ts +28 -0
- package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.d.ts.map +1 -0
- package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.js +29 -0
- package/offline-credentials.d.ts +2 -0
- package/offline-credentials.js +5 -0
- package/package.json +31 -17
- 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/check-scheduled-task-auth-session-error.d.ts +27 -0
- package/scheduled-task/check-scheduled-task-auth-session-error.d.ts.map +1 -0
- package/scheduled-task/check-scheduled-task-auth-session-error.js +17 -0
- package/scheduled-task/scheduled-task-description.d.ts +38 -0
- package/scheduled-task/scheduled-task-description.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-preparation.d.ts +19 -0
- package/scheduled-task/scheduled-task-preparation.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-trigger.d.ts +26 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -0
- package/scheduled-task/scheduled-tasks-api-client.d.ts +67 -0
- package/scheduled-task/scheduled-tasks-api-client.d.ts.map +1 -0
- package/scheduled-task/use-scheduled-task-runs.d.ts +40 -0
- package/scheduled-task/use-scheduled-task-runs.d.ts.map +1 -0
- package/scheduled-task/use-scheduled-task-runs.js +67 -67
- package/scheduled-task/use-scheduled-tasks.d.ts +28 -0
- package/scheduled-task/use-scheduled-tasks.d.ts.map +1 -0
- package/scheduled-tasks.d.ts +2 -250
- package/scheduled-tasks.js +2 -1
- package/scroll-anchoring.d.ts +2 -50
- package/shared/application-schema.d.ts +16 -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-day-of-month.d.ts +21 -0
- package/shared/cron-day-of-month.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 +11 -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/sharing.d.ts +2 -65
- package/skill/skill-archive.d.ts +7 -0
- package/skill/skill-archive.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 +46 -0
- package/skill/skill-types.d.ts.map +1 -0
- package/skill/skill.d.ts +160 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/useSkillArchiveImport/useSkillArchiveImport.d.ts +65 -0
- package/skill/useSkillArchiveImport/useSkillArchiveImport.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 +125 -0
- package/skill/useSkillEditorSubmit.d.ts.map +1 -0
- package/skill/useSkillFileActions.d.ts +60 -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/skill-editor.d.ts +2 -655
- package/skills-state.d.ts +2 -40
- package/source-content.d.ts +2 -29
- package/usage/map-usage-data-to-dashboard.d.ts +39 -0
- package/usage/map-usage-data-to-dashboard.d.ts.map +1 -0
- package/usage/map-user-usage-to-model-limits.d.ts +62 -0
- package/usage/map-user-usage-to-model-limits.d.ts.map +1 -0
- package/usage/usage-banner-source.d.ts +23 -0
- package/usage/usage-banner-source.d.ts.map +1 -0
- package/usage/usage-banner-source.js +36 -0
- package/usage/usage-period.d.ts +7 -0
- package/usage/usage-period.d.ts.map +1 -0
- package/usage/usage-period.js +6 -0
- package/usage/usage-reset-time.d.ts +69 -0
- package/usage/usage-reset-time.d.ts.map +1 -0
- package/usage/usage-reset-time.js +72 -0
- package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.d.ts +32 -0
- package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.d.ts.map +1 -0
- package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.js +39 -0
- package/usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.d.ts +16 -0
- package/usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.d.ts.map +1 -0
- package/usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.js +14 -0
- package/usage/useUsageData/useUsageData.d.ts +28 -0
- package/usage/useUsageData/useUsageData.d.ts.map +1 -0
- package/usage/useUsageLimitBanner/useUsageLimitBanner.d.ts +56 -0
- package/usage/useUsageLimitBanner/useUsageLimitBanner.d.ts.map +1 -0
- package/usage/useUsageLimitBanner/useUsageLimitBanner.js +67 -0
- package/usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.d.ts +14 -0
- package/usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.d.ts.map +1 -0
- package/usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.js +19 -0
- package/usage-limits.d.ts +2 -0
- package/usage-limits.js +8 -0
- package/usage.d.ts +2 -125
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts +128 -0
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts.map +1 -0
- package/usePageFileDrag/usePageFileDrag.d.ts +16 -0
- package/usePageFileDrag/usePageFileDrag.d.ts.map +1 -0
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts +6 -0
- package/usePanelMaxWidth/usePanelMaxWidth.d.ts.map +1 -0
- package/useShareLink/useShareLink.d.ts +23 -0
- package/useShareLink/useShareLink.d.ts.map +1 -0
- package/useShareLink/useShareLink.js +1 -0
- package/useShareRecipientsCount/useShareRecipientsCount.d.ts +36 -0
- package/useShareRecipientsCount/useShareRecipientsCount.d.ts.map +1 -0
- package/useToolsMenu/useToolsMenu.d.ts +31 -0
- package/useToolsMenu/useToolsMenu.d.ts.map +1 -0
- package/useViewportWidth/useViewportWidth.d.ts +3 -0
- package/useViewportWidth/useViewportWidth.d.ts.map +1 -0
- package/utils.d.ts +2 -404
- package/viewport-layout.d.ts +2 -27
|
@@ -1,336 +1,350 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../../shared/string-utils.js";
|
|
2
|
-
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as t, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as n, GenerationConflictError as r, GenerationPersistenceError as i,
|
|
3
|
-
import { getConversationPath as
|
|
4
|
-
import { applyChunkToMessages as
|
|
5
|
-
import { restoreBufferedMessage as
|
|
6
|
-
import { createResumeIfAwaitingGeneration as ee, fetchConversationForRecovery as te, findPendingBackgroundMessageIndex as
|
|
2
|
+
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as t, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as n, GenerationConflictError as r, GenerationPersistenceError as i, StopCompletionError as a, StreamInterruptedError as o, StreamUpstreamError as s } from "../create-chat-stream-api.js";
|
|
3
|
+
import { getConversationPath as c } from "./conversation-path.js";
|
|
4
|
+
import { applyChunkToMessages as l } from "./apply-chunk.js";
|
|
5
|
+
import { restoreBufferedMessage as u } from "./buffered-generation.js";
|
|
6
|
+
import { createResumeIfAwaitingGeneration as ee, fetchConversationForRecovery as te, findPendingBackgroundMessageIndex as d, hasGeneratedPayload as ne, isAwaitingGenerationResume as f } from "./generation-resume.js";
|
|
7
7
|
import { createFrameScheduler as re } from "./frame-scheduler.js";
|
|
8
|
-
import { MessageRole as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { SendCompletionDtoModeEnum as
|
|
8
|
+
import { MessageRole as p, generateUUID as ie } from "@epam/ai-dial-chat-shared";
|
|
9
|
+
import { useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
10
|
+
import { SendCompletionDtoModeEnum as y } from "@epam/ai-dial-chat-api-client";
|
|
11
11
|
//#region src/conversation/useConversationStream/useConversationStream.ts
|
|
12
|
-
var
|
|
12
|
+
var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e instanceof s ? e.message : "", C = (e) => {
|
|
13
13
|
if (!e) return;
|
|
14
|
-
let t =
|
|
14
|
+
let t = d(e);
|
|
15
15
|
return t === -1 ? void 0 : e.messages[t].backgroundGeneration?.generationId;
|
|
16
|
-
},
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
let [
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
}, w = ({ conversationId: s, state: { setConversation: w, conversationRef: T }, transport: E, generation: { startGeneration: ce, completeGeneration: le }, channel: D, overlay: O, onStopError: ue, generationConflictMessage: de = t, generationPersistenceErrorMessage: k = n, onStreamError: A, batchChunksPerFrame: j = !1 }) => {
|
|
17
|
+
let fe = _(A);
|
|
18
|
+
h(() => {
|
|
19
|
+
fe.current = A;
|
|
20
|
+
}, [A]);
|
|
21
|
+
let pe = _(j);
|
|
22
|
+
h(() => {
|
|
23
|
+
pe.current = j;
|
|
24
|
+
}, [j]);
|
|
25
|
+
let [M] = v(re), [N, P] = v(() => /* @__PURE__ */ new Set()), F = _(N);
|
|
26
|
+
F.current = N;
|
|
27
|
+
let [I, me] = v(() => /* @__PURE__ */ new Set()), L = _(/* @__PURE__ */ new Map()), R = _(/* @__PURE__ */ new Set()), z = _(/* @__PURE__ */ new Map()), B = _(/* @__PURE__ */ new Set()), V = _(/* @__PURE__ */ new Set()), he = _(/* @__PURE__ */ new Map()), H = _(!0), U = _(/* @__PURE__ */ new Map()), [ge, W] = v(U.current), G = _(/* @__PURE__ */ new Set()), [_e, ve] = v(G.current);
|
|
28
|
+
h(() => (H.current = !0, () => {
|
|
29
|
+
H.current = !1;
|
|
28
30
|
}), []);
|
|
29
|
-
let
|
|
30
|
-
if (!
|
|
31
|
-
let t = new Map(
|
|
32
|
-
t.delete(e),
|
|
33
|
-
}, []),
|
|
34
|
-
if (!
|
|
35
|
-
let r = new Map(
|
|
31
|
+
let K = m((e) => {
|
|
32
|
+
if (!U.current.has(e)) return;
|
|
33
|
+
let t = new Map(U.current);
|
|
34
|
+
t.delete(e), U.current = t, H.current && W(t);
|
|
35
|
+
}, []), q = m((e, t, n) => {
|
|
36
|
+
if (!H.current || !n()) return;
|
|
37
|
+
let r = new Map(U.current);
|
|
36
38
|
r.set(e, {
|
|
37
39
|
retry: t,
|
|
38
40
|
isCurrent: n
|
|
39
|
-
}),
|
|
40
|
-
}, []),
|
|
41
|
-
if (!
|
|
42
|
-
let e =
|
|
43
|
-
if (!(!e || !e.isCurrent() ||
|
|
44
|
-
|
|
41
|
+
}), U.current = r, W(r);
|
|
42
|
+
}, []), ye = m(async () => {
|
|
43
|
+
if (!s) return;
|
|
44
|
+
let e = U.current.get(c(s));
|
|
45
|
+
if (!(!e || !e.isCurrent() || G.current.has(e))) {
|
|
46
|
+
G.current.add(e), ve(new Set(G.current));
|
|
45
47
|
try {
|
|
46
48
|
await e.retry();
|
|
47
49
|
} finally {
|
|
48
|
-
|
|
50
|
+
G.current.delete(e), H.current && ve(new Set(G.current));
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
|
-
}, [
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
}, [s]), be = _(s);
|
|
54
|
+
h(() => (be.current = s, () => M.cancelAll()), [s, M]);
|
|
55
|
+
let J = m((e) => H.current && c(be.current ?? "") === e, []), Y = m((e) => {
|
|
56
|
+
K(e), P((t) => {
|
|
55
57
|
if (t.has(e)) return t;
|
|
56
58
|
let n = new Set(t);
|
|
57
59
|
return n.add(e), n;
|
|
58
60
|
});
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
+
}, [K]), X = m((e) => {
|
|
62
|
+
P((t) => {
|
|
61
63
|
if (!t.has(e)) return t;
|
|
62
64
|
let n = new Set(t);
|
|
63
65
|
return n.delete(e), n;
|
|
64
66
|
});
|
|
65
|
-
}, []),
|
|
66
|
-
|
|
67
|
+
}, []), Z = m((e, t) => {
|
|
68
|
+
me((n) => {
|
|
67
69
|
if (n.has(e) === t) return n;
|
|
68
70
|
let r = new Set(n);
|
|
69
71
|
return t ? r.add(e) : r.delete(e), r;
|
|
70
72
|
});
|
|
71
|
-
}, []),
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
transport:
|
|
75
|
-
setConversation:
|
|
76
|
-
conversationRef:
|
|
77
|
-
resumingPathsRef:
|
|
78
|
-
bufferedGenerationsRef:
|
|
79
|
-
addStreamingPath:
|
|
80
|
-
removeStreamingPath:
|
|
81
|
-
isPathDisplayed:
|
|
82
|
-
generationPersistenceErrorMessage:
|
|
83
|
-
frameScheduler:
|
|
84
|
-
stoppedGenerationIdsRef:
|
|
85
|
-
onReloadError:
|
|
86
|
-
onReloadSuccess:
|
|
73
|
+
}, []), xe = m((e, t) => {
|
|
74
|
+
L.current.get(e) === t && (L.current.delete(e), Z(e, !1));
|
|
75
|
+
}, [Z]), Q = g(() => ee({
|
|
76
|
+
transport: E,
|
|
77
|
+
setConversation: w,
|
|
78
|
+
conversationRef: T,
|
|
79
|
+
resumingPathsRef: R,
|
|
80
|
+
bufferedGenerationsRef: z,
|
|
81
|
+
addStreamingPath: Y,
|
|
82
|
+
removeStreamingPath: X,
|
|
83
|
+
isPathDisplayed: J,
|
|
84
|
+
generationPersistenceErrorMessage: k,
|
|
85
|
+
frameScheduler: j ? M : void 0,
|
|
86
|
+
stoppedGenerationIdsRef: B,
|
|
87
|
+
onReloadError: q,
|
|
88
|
+
onReloadSuccess: K
|
|
87
89
|
}), [
|
|
88
|
-
J,
|
|
89
90
|
Y,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
D,
|
|
91
|
+
X,
|
|
92
|
+
J,
|
|
93
|
+
E,
|
|
94
94
|
k,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
let _;
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
95
|
+
j,
|
|
96
|
+
M,
|
|
97
|
+
q,
|
|
98
|
+
K
|
|
99
|
+
]), Se = m((t, n, a, s, ee, re, m = y.Append, h = {}) => {
|
|
100
|
+
let g = re ?? ie(), _ = c(t);
|
|
101
|
+
M.flush(_), R.current.delete(_), L.current.set(_, g), he.current.set(_, g), Z(_, !0);
|
|
102
|
+
let v;
|
|
103
|
+
m === y.Regenerate ? v = a : m === y.Edit && (v = a - 1);
|
|
104
|
+
let b = () => he.current.get(_) !== g, x = ce(_, g), S = T.current?.messages[a];
|
|
105
|
+
S ? z.current.set(_, {
|
|
106
|
+
generationId: g,
|
|
107
|
+
messageIndex: a,
|
|
108
|
+
message: S
|
|
109
|
+
}) : z.current.delete(_), Y(_), O?.notifyGenerationStart?.(), D?.ensureConnected();
|
|
110
|
+
let C = () => {
|
|
111
|
+
b() || X(_), xe(_, g), le(_, g), D?.notifyGenerationSettled?.();
|
|
112
|
+
}, ue = () => {
|
|
113
|
+
if (b()) return;
|
|
114
|
+
let e = z.current.get(_);
|
|
115
|
+
!e || e.generationId !== g || (e.message = {
|
|
114
116
|
...e.message,
|
|
115
|
-
streamErrorMessage:
|
|
116
|
-
},
|
|
117
|
-
if (!t ||
|
|
118
|
-
let n =
|
|
119
|
-
return
|
|
117
|
+
streamErrorMessage: k
|
|
118
|
+
}, fe.current?.(new i()), J(_) && w((t) => {
|
|
119
|
+
if (!t || b() || !J(_)) return t;
|
|
120
|
+
let n = u(t, e);
|
|
121
|
+
return T.current = n, n;
|
|
120
122
|
}));
|
|
121
|
-
},
|
|
122
|
-
if (
|
|
123
|
-
if (!
|
|
124
|
-
|
|
123
|
+
}, A = z.current.get(_), j = () => H.current && !b() && z.current.get(_) === A, N = async () => {
|
|
124
|
+
if (j()) {
|
|
125
|
+
if (!J(_)) {
|
|
126
|
+
A && z.current.delete(_);
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
129
|
try {
|
|
128
|
-
let n = await
|
|
129
|
-
if (!
|
|
130
|
-
if (
|
|
131
|
-
|
|
130
|
+
let n = await E.getConversation(e(t));
|
|
131
|
+
if (!j()) return;
|
|
132
|
+
if (K(_), !J(_)) {
|
|
133
|
+
A && z.current.delete(_);
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
|
-
if (
|
|
135
|
-
Q(t, n, { seedMessage:
|
|
136
|
+
if (d(n) !== -1) {
|
|
137
|
+
Q(t, n, { seedMessage: A?.message });
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
+
if (A && A.messageIndex === n.messages.length - 1 && f(n) && ne(A.message)) {
|
|
141
|
+
ue();
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
|
-
|
|
144
|
+
A && z.current.delete(_), w(n), T.current = n;
|
|
143
145
|
} catch {
|
|
144
|
-
|
|
146
|
+
j() && q(_, N, j);
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
|
-
},
|
|
148
|
-
signal:
|
|
149
|
+
}, P = {
|
|
150
|
+
signal: x.signal,
|
|
149
151
|
onChunk: (e) => {
|
|
150
|
-
if (
|
|
151
|
-
let t =
|
|
152
|
-
if (t?.generationId ===
|
|
153
|
-
let n =
|
|
152
|
+
if (b()) return;
|
|
153
|
+
let t = z.current.get(_);
|
|
154
|
+
if (t?.generationId === g) {
|
|
155
|
+
let n = l([t.message], 0, e);
|
|
154
156
|
n && (t.message = n[0]);
|
|
155
157
|
}
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
let e =
|
|
160
|
-
if (
|
|
158
|
+
if (J(_)) {
|
|
159
|
+
if (pe.current && t?.generationId === g) {
|
|
160
|
+
M.schedule(_, () => {
|
|
161
|
+
let e = z.current.get(_);
|
|
162
|
+
if (b() || !J(_) || e?.generationId !== g) return;
|
|
161
163
|
let t = { ...e };
|
|
162
|
-
|
|
164
|
+
w((e) => {
|
|
163
165
|
if (!e) return e;
|
|
164
|
-
let n =
|
|
165
|
-
return
|
|
166
|
+
let n = u(e, t);
|
|
167
|
+
return T.current = n, n;
|
|
166
168
|
});
|
|
167
169
|
});
|
|
168
170
|
return;
|
|
169
171
|
}
|
|
170
|
-
|
|
172
|
+
w((t) => {
|
|
171
173
|
if (!t) return t;
|
|
172
|
-
let n =
|
|
173
|
-
if (n?.generationId ===
|
|
174
|
+
let n = z.current.get(_), r;
|
|
175
|
+
if (n?.generationId === g) r = u(t, n);
|
|
174
176
|
else {
|
|
175
|
-
let n =
|
|
177
|
+
let n = l(t.messages, a, e);
|
|
176
178
|
if (!n) return t;
|
|
177
179
|
r = {
|
|
178
180
|
...t,
|
|
179
181
|
messages: n
|
|
180
182
|
};
|
|
181
183
|
}
|
|
182
|
-
return
|
|
184
|
+
return T.current = r, r;
|
|
183
185
|
});
|
|
184
186
|
}
|
|
185
187
|
},
|
|
186
188
|
onComplete: async () => {
|
|
187
|
-
|
|
189
|
+
M.flush(_), C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.(), await N();
|
|
188
190
|
},
|
|
189
191
|
onError: (e) => {
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
+
if (M.flush(_), fe.current?.(e), e instanceof o && !b()) {
|
|
193
|
+
U(e);
|
|
192
194
|
return;
|
|
193
195
|
}
|
|
194
|
-
if (e instanceof r &&
|
|
195
|
-
|
|
196
|
+
if (e instanceof r && h.resumeOnConflict && !b()) {
|
|
197
|
+
ge(e);
|
|
196
198
|
return;
|
|
197
199
|
}
|
|
198
|
-
|
|
200
|
+
F(e);
|
|
199
201
|
}
|
|
200
|
-
},
|
|
201
|
-
let t =
|
|
202
|
-
if (n && !(e instanceof i) &&
|
|
203
|
-
me(e, n,
|
|
202
|
+
}, F = (e) => {
|
|
203
|
+
let t = z.current.get(_), n = t?.generationId === g ? t : void 0;
|
|
204
|
+
if (n && !(e instanceof i) && z.current.delete(_), C(), n && E.saveConversation && e instanceof i && e.status === oe) {
|
|
205
|
+
me(e, n, E.saveConversation.bind(E));
|
|
204
206
|
return;
|
|
205
207
|
}
|
|
206
|
-
|
|
207
|
-
},
|
|
208
|
+
I(e, n);
|
|
209
|
+
}, I = (e, t) => {
|
|
208
210
|
if (t && e instanceof i && (t.message = {
|
|
209
211
|
...t.message,
|
|
210
|
-
streamErrorMessage:
|
|
211
|
-
}),
|
|
212
|
-
let n =
|
|
213
|
-
|
|
214
|
-
if (!e ||
|
|
215
|
-
let r = t?.generationId ===
|
|
212
|
+
streamErrorMessage: k
|
|
213
|
+
}), b() || !J(_)) return;
|
|
214
|
+
let n = se(e, de, k);
|
|
215
|
+
w((e) => {
|
|
216
|
+
if (!e || b() || !J(_)) return e;
|
|
217
|
+
let r = t?.generationId === g ? u(e, t) : e, i = {
|
|
216
218
|
...r,
|
|
217
|
-
messages: r.messages.map((e, t) => t ===
|
|
219
|
+
messages: r.messages.map((e, t) => t === a ? {
|
|
218
220
|
...e,
|
|
219
221
|
streamErrorMessage: n
|
|
220
222
|
} : e)
|
|
221
223
|
};
|
|
222
|
-
return
|
|
224
|
+
return T.current = i, i;
|
|
223
225
|
});
|
|
224
226
|
}, me = async (n, r, i) => {
|
|
225
|
-
let a = () =>
|
|
227
|
+
let a = () => H.current && !b() && z.current.get(_) === r;
|
|
226
228
|
try {
|
|
227
|
-
let o = await
|
|
229
|
+
let o = await E.getConversation(e(t));
|
|
228
230
|
if (!a()) return;
|
|
229
|
-
if (r.messageIndex !== o.messages.length - 1 || !
|
|
230
|
-
|
|
231
|
+
if (r.messageIndex !== o.messages.length - 1 || !f(o)) {
|
|
232
|
+
I(n, r);
|
|
231
233
|
return;
|
|
232
234
|
}
|
|
233
|
-
let s = await i(
|
|
234
|
-
if (!a() || (
|
|
235
|
-
|
|
235
|
+
let s = await i(_, u(o, r));
|
|
236
|
+
if (!a() || (z.current.delete(_), !J(_))) return;
|
|
237
|
+
w(s), T.current = s;
|
|
236
238
|
} catch {
|
|
237
|
-
a() &&
|
|
239
|
+
a() && I(n, r);
|
|
238
240
|
}
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
if (
|
|
247
|
-
|
|
241
|
+
}, V = () => {
|
|
242
|
+
C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.();
|
|
243
|
+
}, U = async (n) => {
|
|
244
|
+
R.current.add(_), W(await te(() => E.getConversation(e(t)), b), n, !1);
|
|
245
|
+
}, ge = async (n) => {
|
|
246
|
+
L.current.get(_) === g && Z(_, !1), R.current.add(_), W(await te(() => E.getConversation(e(t)), b, (e) => e.messages.length === a && e.messages.at(-1)?.role === p.User), n, !0);
|
|
247
|
+
}, W = (e, n, r) => {
|
|
248
|
+
if (b()) {
|
|
249
|
+
C();
|
|
248
250
|
return;
|
|
249
251
|
}
|
|
250
|
-
let i = e?.messages[e.messages.length - 1],
|
|
251
|
-
if (!e || !
|
|
252
|
-
|
|
252
|
+
let i = e?.messages[e.messages.length - 1], o = e != null && e.messages.length - 1 === a && i?.role === p.Assistant, s = r && e != null && d(e) !== -1;
|
|
253
|
+
if (!e || !o && !s) {
|
|
254
|
+
R.current.delete(_), F(n);
|
|
253
255
|
return;
|
|
254
256
|
}
|
|
255
|
-
let c =
|
|
256
|
-
if (
|
|
257
|
+
let c = z.current.get(_), l = c?.generationId === g ? c : void 0;
|
|
258
|
+
if (f(e)) {
|
|
257
259
|
Q(t, e, {
|
|
258
|
-
seedMessage:
|
|
260
|
+
seedMessage: o ? l?.message : void 0,
|
|
259
261
|
skipDedupe: !0,
|
|
260
|
-
onSettled:
|
|
262
|
+
onSettled: V
|
|
261
263
|
});
|
|
262
264
|
return;
|
|
263
265
|
}
|
|
264
|
-
|
|
266
|
+
R.current.delete(_), l && z.current.delete(_), J(_) && (w(e), T.current = e), V();
|
|
265
267
|
};
|
|
266
268
|
(async () => {
|
|
267
269
|
try {
|
|
268
|
-
let e =
|
|
269
|
-
if (
|
|
270
|
-
|
|
270
|
+
let e = D?.channelId ?? await D?.waitForChannel(ae) ?? void 0, t = B.current.has(g);
|
|
271
|
+
if (x.signal.aborted || b() || t) {
|
|
272
|
+
z.current.get(_)?.generationId === g && z.current.delete(_), b() || X(_), xe(_, g), le(_, g), D?.notifyGenerationSettled?.(), t ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.();
|
|
271
273
|
return;
|
|
272
274
|
}
|
|
273
|
-
|
|
275
|
+
E.streamCompletion(_, n, s, P, ee, g, m, v, e);
|
|
274
276
|
} catch (e) {
|
|
275
|
-
|
|
277
|
+
P.onError(e instanceof Error ? e : Error(String(e)));
|
|
276
278
|
}
|
|
277
279
|
})();
|
|
278
280
|
}, [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
J,
|
|
281
|
+
ce,
|
|
282
|
+
le,
|
|
282
283
|
Y,
|
|
283
284
|
X,
|
|
284
285
|
Z,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
286
|
+
xe,
|
|
287
|
+
J,
|
|
288
|
+
D?.channelId,
|
|
289
|
+
D?.ensureConnected,
|
|
290
|
+
D?.waitForChannel,
|
|
291
|
+
D?.notifyGenerationSettled,
|
|
292
|
+
O,
|
|
293
|
+
E,
|
|
292
294
|
Q,
|
|
293
295
|
de,
|
|
294
|
-
T,
|
|
295
296
|
k,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
297
|
+
M,
|
|
298
|
+
q,
|
|
299
|
+
K
|
|
300
|
+
]), Ce = m((e, t) => {
|
|
301
|
+
let n = c(e), r = z.current.get(n);
|
|
302
|
+
return U.current.get(n)?.isCurrent() && r && t.messages.length - 1 >= r.messageIndex && t.messages[r.messageIndex].role === p.Assistant && !f(t) ? (K(n), z.current.delete(n), t) : r ? u(t, r) : t;
|
|
303
|
+
}, [K]), we = m(() => {
|
|
304
|
+
if (!s) return;
|
|
305
|
+
let e = c(s), t = L.current.get(e), n = t ?? C(T.current);
|
|
306
|
+
if (!n || V.current.has(n)) return;
|
|
307
|
+
V.current.add(n), B.current.add(n), M.flush(e), O?.notifyStopGenerating?.();
|
|
308
|
+
let r = z.current.get(e)?.message.content, i = () => L.current.get(e) === n || t == null && F.current.has(e), o = async () => {
|
|
309
|
+
let e = x / S;
|
|
310
|
+
for (let t = 0; t < e; t++) {
|
|
311
|
+
if (!i() || !H.current) return !0;
|
|
312
|
+
await new Promise((e) => setTimeout(e, S));
|
|
313
|
+
}
|
|
314
|
+
return !i();
|
|
315
|
+
};
|
|
316
|
+
(async () => {
|
|
317
|
+
try {
|
|
318
|
+
await E.stopCompletion({
|
|
319
|
+
generationId: n,
|
|
320
|
+
path: e,
|
|
321
|
+
content: r
|
|
322
|
+
});
|
|
323
|
+
} catch (e) {
|
|
324
|
+
let t = e instanceof Error ? e : Error(String(e));
|
|
325
|
+
if (t instanceof a && t.status === b && await o()) return;
|
|
326
|
+
V.current.delete(n), ue?.(t);
|
|
327
|
+
}
|
|
328
|
+
})();
|
|
315
329
|
}, [
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
]),
|
|
330
|
+
s,
|
|
331
|
+
T,
|
|
332
|
+
M,
|
|
333
|
+
ue,
|
|
334
|
+
O,
|
|
335
|
+
E
|
|
336
|
+
]), Te = m((e, t) => Q(e, t), [Q]), Ee = s != null && N.has(c(s)), $ = s == null ? null : c(s), De = $ != null && (I.has($) || Ee && C(T.current) != null), Oe = $ ? ge.get($) : void 0, ke = Oe?.isCurrent() ?? !1;
|
|
323
337
|
return {
|
|
324
|
-
hasConversationReloadError:
|
|
325
|
-
isReloadingConversation: !!
|
|
326
|
-
retryConversationReload:
|
|
327
|
-
startStream:
|
|
328
|
-
handleStop:
|
|
329
|
-
resumeIfAwaitingGeneration:
|
|
330
|
-
restoreBufferedGeneration:
|
|
331
|
-
isStreaming:
|
|
332
|
-
canStopStreaming:
|
|
338
|
+
hasConversationReloadError: ke,
|
|
339
|
+
isReloadingConversation: !!Oe && ke && _e.has(Oe),
|
|
340
|
+
retryConversationReload: ye,
|
|
341
|
+
startStream: Se,
|
|
342
|
+
handleStop: we,
|
|
343
|
+
resumeIfAwaitingGeneration: Te,
|
|
344
|
+
restoreBufferedGeneration: Ce,
|
|
345
|
+
isStreaming: Ee,
|
|
346
|
+
canStopStreaming: De
|
|
333
347
|
};
|
|
334
348
|
};
|
|
335
349
|
//#endregion
|
|
336
|
-
export {
|
|
350
|
+
export { w as useConversationStream };
|
|
@@ -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"}
|