@epam/ai-dial-chat-hooks 1.3.0-dev.16 → 1.3.0-dev.161
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-error/api-error.js +2 -2
- 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/api-transport/create-unauthorized-middleware.js +4 -1
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +32 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -0
- package/attachment/useAttachmentAction/useAttachmentAction.js +5 -8
- 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 +34 -0
- package/catalog/create-publish-api.d.ts.map +1 -0
- package/catalog/create-publish-api.js +4 -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 +29 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.js +3 -4
- 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-entity-details-to-catalog.js +1 -1
- 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/map-skill-to-catalog-item.js +1 -5
- 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 +90 -71
- 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/useFavoriteEntitiesState/useFavoriteEntitiesState.js +1 -1
- package/catalog/usePublishFolders/usePublishFolders.d.ts +73 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -0
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- 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/useSkillItemDetails.js +3 -3
- package/catalog.d.ts +2 -1436
- 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 +50 -0
- package/conversation/conversation-transfer/attachment-refs.d.ts.map +1 -0
- package/conversation/conversation-transfer/attachment-refs.js +31 -9
- 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 +14 -0
- package/conversation/conversation-transfer/export-conversation.d.ts.map +1 -0
- package/conversation/conversation-transfer/export-conversation.js +19 -18
- package/conversation/conversation-transfer/import-conversation.d.ts +111 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.js +65 -69
- package/conversation/conversation-transfer/progress.d.ts +60 -0
- package/conversation/conversation-transfer/progress.d.ts.map +1 -0
- package/conversation/conversation-transfer/progress.js +1 -1
- 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-export.js +1 -7
- package/conversation/conversation-transfer/zip-import.d.ts +17 -0
- package/conversation/conversation-transfer/zip-import.d.ts.map +1 -0
- package/conversation/conversation-transfer/zip-import.js +1 -1
- package/conversation/create-chat-stream-api.d.ts +109 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/create-chat-stream-api.js +57 -47
- 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/useAttachmentUpload/useAttachmentUpload.js +4 -1
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.d.ts +39 -0
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.d.ts.map +1 -0
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.js +128 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +72 -0
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -0
- package/conversation/useConversationExport/useConversationExport.js +59 -60
- 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/message-utils.js +2 -2
- 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/useConversationHandlers/useConversationHandlers.js +2 -2
- package/conversation/useConversationImport/useConversationImport.d.ts +54 -0
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -0
- package/conversation/useConversationImport/useConversationImport.js +24 -24
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +65 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +31 -30
- package/conversation/useConversationScroll/useConversationScroll.d.ts +46 -0
- package/conversation/useConversationScroll/useConversationScroll.d.ts.map +1 -0
- package/conversation/useConversationScroll/useConversationScroll.js +2 -6
- 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/conversation-path.js +2 -2
- package/conversation/useConversationStream/frame-scheduler.d.ts +14 -0
- package/conversation/useConversationStream/frame-scheduler.d.ts.map +1 -0
- package/conversation/useConversationStream/frame-scheduler.js +17 -17
- package/conversation/useConversationStream/generation-resume.d.ts +98 -0
- package/conversation/useConversationStream/generation-resume.d.ts.map +1 -0
- package/conversation/useConversationStream/generation-resume.js +64 -65
- package/conversation/useConversationStream/useConversationStream.d.ts +145 -0
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -0
- package/conversation/useConversationStream/useConversationStream.js +248 -241
- 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/useMessageSelectionReply/useMessageSelectionReply.js +4 -10
- 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-overlay.js +1 -2
- 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-sources.js +1 -2
- 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-canvas.js +1 -2
- package/file-manager.d.ts +2 -1250
- 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/attachment-types.js +1 -1
- package/files/create-files-api.d.ts +52 -0
- package/files/create-files-api.d.ts.map +1 -0
- package/files/create-files-api.js +1 -1
- package/files/create-upload-file-with-progress.d.ts +27 -0
- package/files/create-upload-file-with-progress.d.ts.map +1 -0
- package/files/create-upload-file-with-progress.js +42 -34
- 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 +55 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.js +97 -69
- 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 +335 -0
- package/files/dial-file-manager.types.d.ts.map +1 -0
- 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-to-attachment.js +3 -3
- 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/download-progress.d.ts +33 -0
- package/files/download-progress.d.ts.map +1 -0
- package/files/download-progress.js +28 -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/source-content.js +1 -1
- package/files/useDialFileListing/useDialFileListing.d.ts +82 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.js +95 -107
- package/files/useDialFileManager/useDialFileManager.d.ts +16 -0
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -0
- package/files/useDialFileManager/useDialFileManager.js +5 -2
- package/files/useDialFileManagerSections/useDialFileManagerSections.d.ts +25 -0
- package/files/useDialFileManagerSections/useDialFileManagerSections.d.ts.map +1 -0
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +59 -68
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +15 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +1 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -1
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts +28 -0
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +1 -0
- package/files/useDialFileMetadata/useDialFileMetadata.js +3 -3
- package/files/useDialFileMutations/useDialFileMutations.d.ts +77 -0
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -0
- package/files/useDialFileMutations/useDialFileMutations.js +230 -159
- package/files/useDialFileSharing/useDialFileSharing.d.ts +34 -0
- package/files/useDialFileSharing/useDialFileSharing.d.ts.map +1 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +47 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +105 -97
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.d.ts +59 -0
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.d.ts.map +1 -0
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +2 -2
- package/index.d.ts +167 -6990
- 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 +28 -31
- 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/authorize-url.js +1 -1
- package/oauth/handshake.d.ts +30 -0
- package/oauth/handshake.d.ts.map +1 -0
- package/oauth/handshake.js +3 -10
- 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 +41 -42
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +79 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/oauth/useToolsetLogin/useToolsetLogin.js +2 -1
- 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-description.js +1 -1
- 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-task-trigger.js +9 -8
- 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 -79
- package/scheduled-task/use-scheduled-tasks.d.ts +28 -0
- package/scheduled-task/use-scheduled-tasks.d.ts.map +1 -0
- package/scheduled-task/use-scheduled-tasks.js +1 -1
- package/scheduled-tasks.d.ts +2 -250
- package/scheduled-tasks.js +2 -1
- package/scroll-anchoring.d.ts +2 -50
- package/scroll-anchoring.js +1 -2
- package/shared/application-schema.d.ts +16 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/application-schema.js +3 -3
- 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-day-of-month.js +10 -10
- 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/locale.js +2 -2
- 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-batch-validation.js +18 -17
- 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-types.js +1 -1
- package/skill/skill.d.ts +160 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/skill.js +12 -15
- package/skill/useSkillArchiveImport/useSkillArchiveImport.d.ts +65 -0
- package/skill/useSkillArchiveImport/useSkillArchiveImport.d.ts.map +1 -0
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +1 -7
- 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/useSkillEditorSubmit.js +1 -5
- 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/skills-state.js +1 -2
- package/source-content.d.ts +2 -29
- package/source-content.js +1 -2
- 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 +24 -0
- package/usage/usage-banner-source.d.ts.map +1 -0
- package/usage/usage-banner-source.js +60 -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 +56 -0
- package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.d.ts.map +1 -0
- package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.js +34 -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 +58 -0
- package/usage/useUsageLimitBanner/useUsageLimitBanner.d.ts.map +1 -0
- package/usage/useUsageLimitBanner/useUsageLimitBanner.js +70 -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/usePageFileDrag/usePageFileDrag.js +3 -3
- 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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** A link rendered as the call to action of an announcements-popover entry. */
|
|
2
|
+
export interface AnnouncementListItemLink {
|
|
3
|
+
/** Visible text of the call to action. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Absolute `http`/`https` target the call to action opens. */
|
|
6
|
+
href: string;
|
|
7
|
+
}
|
|
8
|
+
/** One entry of the announcements popover behind the banner's `+N` pill. */
|
|
9
|
+
export interface AnnouncementListItem {
|
|
10
|
+
/** Plain-text heading of the entry. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Supporting copy of the entry, sanitized before it is rendered. */
|
|
13
|
+
description?: string | null;
|
|
14
|
+
/** Optional call to action shown at the end of the entry. */
|
|
15
|
+
link?: AnnouncementListItemLink | null;
|
|
16
|
+
}
|
|
17
|
+
/** Structured announcement banner content. */
|
|
18
|
+
export interface AnnouncementContent {
|
|
19
|
+
title: string | null;
|
|
20
|
+
description: string | null;
|
|
21
|
+
html: string | null;
|
|
22
|
+
/** Entries of the popover the banner opens. */
|
|
23
|
+
items?: readonly AnnouncementListItem[];
|
|
24
|
+
}
|
|
25
|
+
/** Sanitizes announcement HTML to the allowed inline tag/attribute set. */
|
|
26
|
+
export declare const sanitizeAnnouncementHtml: (html: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Sanitizes the legacy `ANNOUNCEMENT_HTML_MESSAGE` banner, which permits the
|
|
29
|
+
* block-level markup the inline pass strips. See
|
|
30
|
+
* `ANNOUNCEMENT_MESSAGE_SANITIZE_OPTIONS` for why the two lists differ.
|
|
31
|
+
*/
|
|
32
|
+
export declare const sanitizeAnnouncementMessageHtml: (html: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the operator configured the structured banner (title and/or
|
|
35
|
+
* description) rather than only the legacy HTML message. Drives which of the
|
|
36
|
+
* two banner layouts renders.
|
|
37
|
+
*/
|
|
38
|
+
export declare const hasStructuredAnnouncement: ({ title, description, }: AnnouncementContent) => boolean;
|
|
39
|
+
/** True when the announcement has any renderable content (structured or legacy HTML). */
|
|
40
|
+
export declare const hasAnnouncementContent: (content: AnnouncementContent) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Builds the value persisted under `StorageKey.TextOfClosedAnnouncement` when
|
|
43
|
+
* the user dismisses the banner. Dismissal is content-keyed: the banner stays
|
|
44
|
+
* hidden only while the current announcement produces the same signature, so
|
|
45
|
+
* editing any part of it brings the banner back with no version counter.
|
|
46
|
+
*
|
|
47
|
+
* Every piece of content the banner surface renders feeds the signature — the
|
|
48
|
+
* title, the description, and the popover entries behind the pill, which live
|
|
49
|
+
* inside the banner and are hidden along with it. Publishing a new entry in
|
|
50
|
+
* that list therefore invalidates an earlier dismissal on its own, even when
|
|
51
|
+
* the banner line itself is untouched.
|
|
52
|
+
*
|
|
53
|
+
* A legacy-only announcement returns the raw HTML string — byte-identical to
|
|
54
|
+
* what shipped before the structured fields existed — so dismissals recorded
|
|
55
|
+
* by older builds keep working without a storage migration. `items` is left
|
|
56
|
+
* out of the payload entirely when the list is empty for the same reason: a
|
|
57
|
+
* deployment that never configured the popover keeps matching the signatures
|
|
58
|
+
* its users already have stored.
|
|
59
|
+
*/
|
|
60
|
+
export declare const buildAnnouncementSignature: (content: AnnouncementContent) => string;
|
|
61
|
+
//# sourceMappingURL=announcement-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-message.d.ts","sourceRoot":"","sources":["../../src/conversation/announcement-message.ts"],"names":[],"mappings":"AA+BA,+EAA+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACxC;AAED,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACzC;AAQD,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,MACgB,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAAI,MAAM,MAAM,KAAG,MACY,CAAC;AAK5E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,yBAGvC,mBAAmB,KAAG,OACqB,CAAC;AAE/C,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,KAAG,OACN,CAAC;AA2BjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,mBAAmB,KAC3B,MAgBF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ConversationDraftStore, MemoryConversationDraftStoreOptions, WebStorageConversationDraftStoreOptions } from './conversation-draft';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a `ConversationDraftStore` over a host-chosen Web `Storage`.
|
|
4
|
+
*
|
|
5
|
+
* Every host-specific fact — which storage, which key (including any user
|
|
6
|
+
* scope), how ids are canonicalised — arrives through `options`. The store owns
|
|
7
|
+
* only the versioned JSON format of its own data
|
|
8
|
+
* (`{ version: 1, drafts: { [id]: ConversationDraft } }`), the `maxEntries`
|
|
9
|
+
* cap with oldest-first eviction, a half-eviction retry when the quota is
|
|
10
|
+
* exceeded, and silent failure: an absent or throwing storage behaves as an
|
|
11
|
+
* empty store that ignores writes.
|
|
12
|
+
*/
|
|
13
|
+
export declare const createWebStorageConversationDraftStore: ({ getStorage, storageKey, maxEntries, normalizeId, }: WebStorageConversationDraftStoreOptions) => ConversationDraftStore;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a `ConversationDraftStore` that keeps drafts in memory for the
|
|
16
|
+
* lifetime of the returned instance. Same semantics as the Web Storage store
|
|
17
|
+
* (`maxEntries`, `normalizeId`, empty-draft removal); suited to hosts that want
|
|
18
|
+
* drafts only for the page lifetime, and to tests.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createMemoryConversationDraftStore: ({ maxEntries, normalizeId, }?: MemoryConversationDraftStoreOptions) => ConversationDraftStore;
|
|
21
|
+
//# sourceMappingURL=conversation-draft-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-draft-store.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-draft/conversation-draft-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,mCAAmC,EACnC,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAqE9B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sCAAsC,GAAI,sDAKpD,uCAAuC,KAAG,sBA0E5C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAAI,+BAGhD,mCAAwC,KAAG,sBAwB7C,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/conversation/conversation-draft/conversation-draft-store.ts
|
|
2
|
+
var e = (e) => e, t = (e) => e.text.trim() === "" && e.skills.length === 0, n = (e) => {
|
|
3
|
+
if (typeof e != "object" || !e) return !1;
|
|
4
|
+
let t = e;
|
|
5
|
+
return typeof t.text == "string" && Array.isArray(t.skills) && typeof t.updatedAt == "number";
|
|
6
|
+
}, r = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, i = (e) => Object.keys(e).sort((t, n) => e[t].updatedAt - e[n].updatedAt), a = (e, t) => {
|
|
7
|
+
let n = i(e), r = n.length - Math.max(t, 0);
|
|
8
|
+
if (r <= 0) return e;
|
|
9
|
+
let a = { ...e };
|
|
10
|
+
return n.slice(0, r).forEach((e) => delete a[e]), a;
|
|
11
|
+
}, o = (e, n, r, i) => {
|
|
12
|
+
let o = { ...e };
|
|
13
|
+
return t(r) ? (delete o[n], o) : (o[n] = r, a(o, i));
|
|
14
|
+
}, s = (e) => e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "NS_ERROR_DOM_QUOTA_REACHED"), c = ({ getStorage: t, storageKey: c, maxEntries: l = 50, normalizeId: u = e }) => {
|
|
15
|
+
let d = () => {
|
|
16
|
+
try {
|
|
17
|
+
return t();
|
|
18
|
+
} catch {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}, f = () => {
|
|
22
|
+
try {
|
|
23
|
+
let e = d()?.getItem(c);
|
|
24
|
+
if (!e) return {};
|
|
25
|
+
let t = JSON.parse(e);
|
|
26
|
+
return t == null || t.version !== 1 || t.drafts == null || typeof t.drafts != "object" ? {} : Object.fromEntries(Object.entries(t.drafts).filter(([, e]) => n(e)));
|
|
27
|
+
} catch {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
}, p = (e, t) => {
|
|
31
|
+
if (Object.keys(t).length === 0) {
|
|
32
|
+
e.removeItem(c);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let n = {
|
|
36
|
+
version: 1,
|
|
37
|
+
drafts: t
|
|
38
|
+
};
|
|
39
|
+
e.setItem(c, JSON.stringify(n));
|
|
40
|
+
}, m = (e) => {
|
|
41
|
+
let t = d();
|
|
42
|
+
if (t) try {
|
|
43
|
+
p(t, e);
|
|
44
|
+
} catch (n) {
|
|
45
|
+
if (!s(n)) return;
|
|
46
|
+
try {
|
|
47
|
+
let n = i(e);
|
|
48
|
+
p(t, a(e, Math.floor(n.length / 2)));
|
|
49
|
+
} catch {}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
read: (e) => r(f(), u(e)),
|
|
54
|
+
write: (e, t) => m(o(f(), u(e), t, l)),
|
|
55
|
+
remove: (e) => {
|
|
56
|
+
let t = f(), n = u(e);
|
|
57
|
+
Object.hasOwn(t, n) && (delete t[n], m(t));
|
|
58
|
+
},
|
|
59
|
+
clear: () => {
|
|
60
|
+
try {
|
|
61
|
+
d()?.removeItem(c);
|
|
62
|
+
} catch {}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, l = ({ maxEntries: t = 50, normalizeId: n = e } = {}) => {
|
|
66
|
+
let i = {};
|
|
67
|
+
return {
|
|
68
|
+
read: (e) => r(i, n(e)),
|
|
69
|
+
write: (e, r) => {
|
|
70
|
+
i = o(i, n(e), r, t);
|
|
71
|
+
},
|
|
72
|
+
remove: (e) => {
|
|
73
|
+
let t = n(e);
|
|
74
|
+
if (!Object.hasOwn(i, t)) return;
|
|
75
|
+
let r = { ...i };
|
|
76
|
+
delete r[t], i = r;
|
|
77
|
+
},
|
|
78
|
+
clear: () => {
|
|
79
|
+
i = {};
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { l as createMemoryConversationDraftStore, c as createWebStorageConversationDraftStore };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RequestSkill } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/** An unsent composer draft kept for one conversation. */
|
|
3
|
+
export interface ConversationDraft {
|
|
4
|
+
/** The composer text as the user left it. */
|
|
5
|
+
text: string;
|
|
6
|
+
/** Skills mentioned in the draft, in the same shape a sent message carries. */
|
|
7
|
+
skills: RequestSkill[];
|
|
8
|
+
/** Epoch milliseconds of the last change; the oldest entry is evicted first. */
|
|
9
|
+
updatedAt: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Synchronous, never-throwing persistence contract for conversation drafts.
|
|
13
|
+
*
|
|
14
|
+
* The host creates and owns the instance: it decides the storage medium, the
|
|
15
|
+
* key, the user scope and how conversation ids are canonicalised. A host with
|
|
16
|
+
* async persistence wraps it behind a synchronous in-memory cache, because the
|
|
17
|
+
* restore runs before the user can type and the flush on unmount must finish
|
|
18
|
+
* synchronously.
|
|
19
|
+
*/
|
|
20
|
+
export interface ConversationDraftStore {
|
|
21
|
+
/** Returns the stored draft for `conversationId`, or `undefined` when there is none. */
|
|
22
|
+
read: (conversationId: string) => ConversationDraft | undefined;
|
|
23
|
+
/** Stores `draft` for `conversationId`; an empty draft removes the entry instead. */
|
|
24
|
+
write: (conversationId: string, draft: ConversationDraft) => void;
|
|
25
|
+
/** Removes the draft for `conversationId`. */
|
|
26
|
+
remove: (conversationId: string) => void;
|
|
27
|
+
/** Removes every draft the store holds. */
|
|
28
|
+
clear: () => void;
|
|
29
|
+
}
|
|
30
|
+
/** Options shared by both store factories. */
|
|
31
|
+
export interface MemoryConversationDraftStoreOptions {
|
|
32
|
+
/** Maximum number of drafts kept; the oldest-`updatedAt` entry is evicted beyond it. Defaults to `50`. */
|
|
33
|
+
maxEntries?: number;
|
|
34
|
+
/** Canonicalises a conversation id before it is used as an entry key. Defaults to identity. */
|
|
35
|
+
normalizeId?: (conversationId: string) => string;
|
|
36
|
+
}
|
|
37
|
+
/** Options for `createWebStorageConversationDraftStore`. */
|
|
38
|
+
export interface WebStorageConversationDraftStoreOptions extends MemoryConversationDraftStoreOptions {
|
|
39
|
+
/**
|
|
40
|
+
* Returns the `Storage` to use, or `undefined` when none is available. It is
|
|
41
|
+
* a getter so an absent or throwing storage accessor (SSR, tests, blocked
|
|
42
|
+
* site data) is handled inside the store's guard.
|
|
43
|
+
*/
|
|
44
|
+
getStorage: () => Storage | undefined;
|
|
45
|
+
/** The single key all drafts are written under, including any user scope the host needs. */
|
|
46
|
+
storageKey: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=conversation-draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-draft.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-draft/conversation-draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,wFAAwF;IACxF,IAAI,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,CAAC;IAChE,qFAAqF;IACrF,KAAK,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClE,8CAA8C;IAC9C,MAAM,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,8CAA8C;AAC9C,MAAM,WAAW,mCAAmC;IAClD,0GAA0G;IAC1G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,4DAA4D;AAC5D,MAAM,WAAW,uCAAwC,SAAQ,mCAAmC;IAClG;;;;OAIG;IACH,UAAU,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;IACtC,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `worker` over `items` with at most `limit` concurrent invocations.
|
|
3
|
+
* Preserves no particular result order beyond "worker completed"; a worker
|
|
4
|
+
* that returns `undefined`, or throws, contributes nothing to the result
|
|
5
|
+
* array (used to skip failed/invalid items without aborting the whole
|
|
6
|
+
* batch) — a throwing worker is caught here so the other concurrent items
|
|
7
|
+
* keep being tracked instead of continuing unobserved in the background.
|
|
8
|
+
*/
|
|
9
|
+
export declare const runWithConcurrency: <T, R>(items: T[], limit: number, worker: (item: T) => Promise<R | undefined>) => Promise<R[]>;
|
|
10
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/async.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,EAAE,CAAC,EAC3C,OAAO,CAAC,EAAE,EACV,OAAO,MAAM,EACb,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,KAC1C,OAAO,CAAC,CAAC,EAAE,CAqBb,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Annotation, Conversation } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The reference fields shared by every attachment shape a conversation can
|
|
4
|
+
* carry — `MessageAttachment` on a message or a stage, and
|
|
5
|
+
* `AttachmentResource` on a citation's source.
|
|
6
|
+
*/
|
|
7
|
+
export interface AttachmentReference {
|
|
8
|
+
/** DIAL file id (`files/{bucket}/{path}`), optionally with a trailing `#…` anchor. */
|
|
9
|
+
url?: string;
|
|
10
|
+
/** Alternate reference resource, same shape as `url`. */
|
|
11
|
+
reference_url?: string;
|
|
12
|
+
/** Display name shown in the UI. */
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Splits a DIAL file reference into the resource id and its trailing `#…`
|
|
17
|
+
* anchor (e.g. the `#page=3` a PDF citation carries). An anchor outside
|
|
18
|
+
* {@link SAFE_ANCHOR_PATTERN} is reported as absent; the file id is returned
|
|
19
|
+
* either way, so the attachment itself is still transferred.
|
|
20
|
+
*
|
|
21
|
+
* The anchor is display metadata, not part of the stored resource path: the
|
|
22
|
+
* download endpoint 404s on it, so it has to be stripped before a reference
|
|
23
|
+
* is resolved to `{bucket, path}` — and restored afterwards, so an imported
|
|
24
|
+
* citation still opens the page it cited.
|
|
25
|
+
*/
|
|
26
|
+
export declare const splitFileIdAnchor: (url: string) => {
|
|
27
|
+
fileId: string;
|
|
28
|
+
anchor: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Applies `mapAnnotation` to every readable entry of the citation pool,
|
|
32
|
+
* keeping unreadable entries and every other `customViewState` key as they
|
|
33
|
+
* are. Returns `conversation` itself when no entry changed, so a caller can
|
|
34
|
+
* tell by identity that the pool needed no work.
|
|
35
|
+
*/
|
|
36
|
+
export declare const mapAnnotationPool: (conversation: Conversation, mapAnnotation: (annotation: Annotation) => Annotation) => Conversation;
|
|
37
|
+
/** A unique DIAL file reference found in a conversation's messages. */
|
|
38
|
+
export interface AttachmentRef {
|
|
39
|
+
fileId: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Collects unique attachment references across all messages — message
|
|
43
|
+
* attachments, stage attachments, and citation source documents — and the
|
|
44
|
+
* conversation-level citation pool, with any
|
|
45
|
+
* `#…` anchor stripped. The same file can be referenced more than once (by a
|
|
46
|
+
* later turn, by a stage and the message it belongs to, or by several
|
|
47
|
+
* citations), so dedupe by file id and process it only once.
|
|
48
|
+
*/
|
|
49
|
+
export declare const collectAttachmentRefs: (conversation: Conversation) => AttachmentRef[];
|
|
50
|
+
//# sourceMappingURL=attachment-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-refs.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/attachment-refs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK1E;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAeD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,KACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CASlC,CAAC;AAqBF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,YAAY,EAC1B,eAAe,CAAC,UAAU,EAAE,UAAU,KAAK,UAAU,KACpD,YAgBF,CAAC;AAEF,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAgDD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,YAAY,KACzB,aAAa,EAef,CAAC"}
|
|
@@ -10,7 +10,25 @@ var e = (e) => e.startsWith("files/"), t = /^#[\w.=%-]*$/, n = (e) => {
|
|
|
10
10
|
fileId: e.slice(0, n),
|
|
11
11
|
anchor: t.test(r) ? r : ""
|
|
12
12
|
};
|
|
13
|
-
}, r = (e,
|
|
13
|
+
}, r = (e) => typeof e == "object" && !!e, i = (e) => {
|
|
14
|
+
let t = e.customViewState?.annotations;
|
|
15
|
+
return Array.isArray(t) ? t.filter(r) : [];
|
|
16
|
+
}, a = (e, t) => {
|
|
17
|
+
let n = e.customViewState, i = n?.annotations;
|
|
18
|
+
if (!Array.isArray(i)) return e;
|
|
19
|
+
let a = !1, o = i.map((e) => {
|
|
20
|
+
if (!r(e)) return e;
|
|
21
|
+
let n = t(e);
|
|
22
|
+
return n !== e && (a = !0), n;
|
|
23
|
+
});
|
|
24
|
+
return a ? {
|
|
25
|
+
...e,
|
|
26
|
+
customViewState: {
|
|
27
|
+
...n,
|
|
28
|
+
annotations: o
|
|
29
|
+
}
|
|
30
|
+
} : e;
|
|
31
|
+
}, o = (e, t) => {
|
|
14
32
|
for (let n of e.messages) {
|
|
15
33
|
let e = n.custom_content;
|
|
16
34
|
if (e) {
|
|
@@ -22,15 +40,19 @@ var e = (e) => e.startsWith("files/"), t = /^#[\w.=%-]*$/, n = (e) => {
|
|
|
22
40
|
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
for (let n of i(e)) {
|
|
44
|
+
let e = n.body?.source?.attachment;
|
|
45
|
+
e && t(e);
|
|
46
|
+
}
|
|
47
|
+
}, s = (t) => {
|
|
48
|
+
let r = /* @__PURE__ */ new Set(), i = (t) => {
|
|
27
49
|
if (t == null) return;
|
|
28
|
-
let { fileId:
|
|
29
|
-
e(
|
|
50
|
+
let { fileId: i } = n(t);
|
|
51
|
+
e(i) && r.add(i);
|
|
30
52
|
};
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
}), Array.from(
|
|
53
|
+
return o(t, (e) => {
|
|
54
|
+
i(e.url), i(e.reference_url);
|
|
55
|
+
}), Array.from(r, (e) => ({ fileId: e }));
|
|
34
56
|
};
|
|
35
57
|
//#endregion
|
|
36
|
-
export {
|
|
58
|
+
export { s as collectAttachmentRefs, a as mapAnnotationPool, n as splitFileIdAnchor };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the `uploads/<YYYY-MM>/<safe-name>` upload path for a file.
|
|
3
|
+
* `date` defaults to now (regular attachment upload); conversation import
|
|
4
|
+
* passes a date fixed for the whole job so all its attachments land in the
|
|
5
|
+
* same month folder. Does not de-duplicate: a name collision is left for the
|
|
6
|
+
* upload call to reject (`create-only` mode) — use `createUploadPathAllocator`
|
|
7
|
+
* when collisions must be resolved with a ` (n)` suffix instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildUploadPath: (fileName: string, date?: Date) => string;
|
|
10
|
+
/** A file name the allocator has handed out, in the forms the caller needs. */
|
|
11
|
+
export interface AllocatedUploadPath {
|
|
12
|
+
/** Bucket-relative, percent-encoded upload path, e.g. `uploads/2026-08/report%20(1).pdf`. */
|
|
13
|
+
path: string;
|
|
14
|
+
/** Decoded name actually reserved, e.g. `report (1).pdf` — pass this as the uploaded `File`'s name. */
|
|
15
|
+
fileName: string;
|
|
16
|
+
/** Whether a ` (n)` suffix had to be appended because the requested name was taken. */
|
|
17
|
+
isRenamed: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Stateful allocator that hands out collision-free upload paths inside one month folder. */
|
|
20
|
+
export interface UploadPathAllocator {
|
|
21
|
+
/** Reserves the next free name derived from `fileName` and returns its upload path. */
|
|
22
|
+
allocate: (fileName: string) => AllocatedUploadPath;
|
|
23
|
+
/** Records `fileName` as taken — used when the server rejects a name the registry believed free. */
|
|
24
|
+
markTaken: (fileName: string) => void;
|
|
25
|
+
/** Returns a previously allocated `fileName` to the free pool — used when its upload failed for a reason other than a collision. */
|
|
26
|
+
release: (fileName: string) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates an allocator that assigns ` (1)`, ` (2)`, … suffixes to repeated or
|
|
30
|
+
* pre-existing file names so every allocation lands on a distinct path inside
|
|
31
|
+
* one `uploads/<YYYY-MM>/` folder. Mutation is deliberately confined to the
|
|
32
|
+
* private `Set` closed over here — an explicit, contained exception to the
|
|
33
|
+
* immutable-by-default rule, needed because collision-free naming is
|
|
34
|
+
* inherently a sequential, stateful decision.
|
|
35
|
+
*/
|
|
36
|
+
export declare const createUploadPathAllocator: (params?: {
|
|
37
|
+
/** Month folder to allocate into. Defaults to now. */
|
|
38
|
+
date?: Date;
|
|
39
|
+
/** Decoded names already present in the destination folder, e.g. from `listFiles`. */
|
|
40
|
+
existingNames?: Iterable<string>;
|
|
41
|
+
}) => UploadPathAllocator;
|
|
42
|
+
//# sourceMappingURL=build-upload-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-upload-path.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/build-upload-path.ts"],"names":[],"mappings":"AAmBA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAChB,OAAM,IAAiB,KACtB,MAIF,CAAC;AAUF,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,uGAAuG;IACvG,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,6FAA6F;AAC7F,MAAM,WAAW,mBAAmB;IAClC,uFAAuF;IACvF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,mBAAmB,CAAC;IACpD,oGAAoG;IACpG,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oIAAoI;IACpI,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS;IACjD,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sFAAsF;IACtF,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAClC,KAAG,mBAgCH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Formats a `Date` as `YYYY-MM-DD` using its local-time components. */
|
|
2
|
+
export declare const formatDateYMD: (date: Date) => string;
|
|
3
|
+
/** Formats a `Date` as `YYYY-MM` using its local-time components. */
|
|
4
|
+
export declare const formatDateYM: (date: Date) => string;
|
|
5
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/date.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,MAK1C,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY,GAAI,MAAM,IAAI,KAAG,MAIzC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the bucket and decoded relative path from a DIAL file ID
|
|
3
|
+
* (`files/{bucket}/{path}`). Returns `undefined` if the input does not start
|
|
4
|
+
* with `files/` or has no path segment after the bucket.
|
|
5
|
+
*/
|
|
6
|
+
export declare const resolveDialFileBucketAndPath: (fileId: string) => {
|
|
7
|
+
bucket: string;
|
|
8
|
+
path: string;
|
|
9
|
+
} | undefined;
|
|
10
|
+
//# sourceMappingURL=dial-file-resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-resolve.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/dial-file-resolve.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,MAAM,KACb;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAcrC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Conversation, ExportFolder, ExportFormat } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { ExportFileNameKind } from './types';
|
|
3
|
+
/** Placeholder app name used in every export file name — this branch has no app display-name config yet. */
|
|
4
|
+
export declare const EXPORT_APP_NAME = "ai_dial";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the conversation with every message-, stage- and citation-level
|
|
7
|
+
* attachment reference removed, including the source documents of the
|
|
8
|
+
* conversation-level citation pool.
|
|
9
|
+
*/
|
|
10
|
+
export declare const stripConversationAttachments: (conversation: Conversation) => Conversation;
|
|
11
|
+
export declare const buildExportEnvelope: (conversations: Conversation[], folders?: ExportFolder[]) => ExportFormat;
|
|
12
|
+
export declare const serializeExportEnvelope: (envelope: ExportFormat) => Blob;
|
|
13
|
+
export declare const buildExportFileName: (kind: ExportFileNameKind, appName: string, date?: Date) => string;
|
|
14
|
+
//# sourceMappingURL=export-conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-conversation.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/export-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACZ,YAAY,EACZ,YAAY,EAGb,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,4GAA4G;AAC5G,eAAO,MAAM,eAAe,YAAY,CAAC;AA8CzC;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,cAAc,YAAY,KACzB,YAOA,CAAC;AAEJ,eAAO,MAAM,mBAAmB,GAC9B,eAAe,YAAY,EAAE,EAC7B,UAAS,YAAY,EAAO,KAC3B,YAID,CAAC;AAEH,eAAO,MAAM,uBAAuB,GAAI,UAAU,YAAY,KAAG,IACY,CAAC;AAQ9E,eAAO,MAAM,mBAAmB,GAC9B,MAAM,kBAAkB,EACxB,SAAS,MAAM,EACf,OAAM,IAAiB,KACtB,MACyE,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mapAnnotationPool as e } from "./attachment-refs.js";
|
|
2
|
+
import { formatDateYMD as t } from "./date.js";
|
|
3
|
+
import { ExportFileNameKind as n } from "./types.js";
|
|
3
4
|
//#region src/conversation/conversation-transfer/export-conversation.ts
|
|
4
|
-
var
|
|
5
|
+
var r = "ai_dial", i = (e) => e.map(({ attachments: e, ...t }) => t), a = (e) => {
|
|
5
6
|
if (e.body?.source == null) return e;
|
|
6
7
|
let { source: t, ...n } = e.body;
|
|
7
8
|
return {
|
|
8
9
|
...e,
|
|
9
10
|
body: n
|
|
10
11
|
};
|
|
11
|
-
}
|
|
12
|
+
}, o = (e) => e.map(a), s = (e) => {
|
|
12
13
|
let t = e.custom_content;
|
|
13
14
|
if (!t) return e;
|
|
14
|
-
let { attachments: n, stages:
|
|
15
|
-
if (n == null &&
|
|
15
|
+
let { attachments: n, stages: r, annotations: a, ...s } = t;
|
|
16
|
+
if (n == null && r == null && a == null) return e;
|
|
16
17
|
let c = {
|
|
17
18
|
...s,
|
|
18
|
-
...
|
|
19
|
-
...
|
|
19
|
+
...r ? { stages: i(r) } : {},
|
|
20
|
+
...a ? { annotations: o(a) } : {}
|
|
20
21
|
};
|
|
21
22
|
if (Object.keys(c).length > 0) return {
|
|
22
23
|
...e,
|
|
@@ -24,17 +25,17 @@ var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) =>
|
|
|
24
25
|
};
|
|
25
26
|
let { custom_content: l, ...u } = e;
|
|
26
27
|
return u;
|
|
27
|
-
},
|
|
28
|
-
...
|
|
29
|
-
messages:
|
|
30
|
-
}),
|
|
28
|
+
}, c = (t) => e({
|
|
29
|
+
...t,
|
|
30
|
+
messages: t.messages.map(s)
|
|
31
|
+
}, a), l = (e, t = []) => ({
|
|
31
32
|
version: 5,
|
|
32
33
|
history: e,
|
|
33
34
|
folders: t
|
|
34
|
-
}),
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
},
|
|
35
|
+
}), u = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), d = {
|
|
36
|
+
[n.SingleConversation]: "json",
|
|
37
|
+
[n.SingleConversationWithAttachments]: "dial",
|
|
38
|
+
[n.AllConversationsHistory]: "json"
|
|
39
|
+
}, f = (e, n, r = /* @__PURE__ */ new Date()) => `${t(r)}_${n}_${e}.${d[e]}`;
|
|
39
40
|
//#endregion
|
|
40
|
-
export {
|
|
41
|
+
export { r as EXPORT_APP_NAME, l as buildExportEnvelope, f as buildExportFileName, u as serializeExportEnvelope, c as stripConversationAttachments };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Conversation, ExportFormat } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { AllocatedUploadPath, UploadPathAllocator } from './build-upload-path';
|
|
3
|
+
/** Thrown when an imported file cannot be parsed as a supported export envelope. */
|
|
4
|
+
export declare class UnsupportedImportFormatError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Parses raw file text into a supported export envelope (`version: 5`) with
|
|
9
|
+
* an array `history` — conversations are returned unmodified.
|
|
10
|
+
* Throws `UnsupportedImportFormatError` for malformed JSON or any other shape.
|
|
11
|
+
*/
|
|
12
|
+
export declare const parseImportEnvelope: (text: string) => ExportFormat;
|
|
13
|
+
export interface RebasedConversationId {
|
|
14
|
+
/** The conversation with `id`/`folderId` rebased to `bucket` and a fresh UUID, and `name` sanitized. */
|
|
15
|
+
conversation: Conversation;
|
|
16
|
+
/** Bucket-relative path to pass to `saveConversation`. */
|
|
17
|
+
subPath: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Rebases a conversation's id/folderId to the current user's bucket and
|
|
21
|
+
* regenerates its trailing UUID segment, so importing it can never collide
|
|
22
|
+
* with an existing conversation and needs no replace/skip dialog. Folder
|
|
23
|
+
* path segments between the bucket and the filename are preserved (not
|
|
24
|
+
* flattened) — the new chat currently displays everything at the root, but
|
|
25
|
+
* the conversation keeps its original folder location for when the folder
|
|
26
|
+
* feature ships.
|
|
27
|
+
*
|
|
28
|
+
* The filename's title segment is rewritten from the conversation's own
|
|
29
|
+
* `name` (see `buildImportedFileName`), and `name` is replaced with the same
|
|
30
|
+
* sanitized value — the invariant the conversation list relies on to render a
|
|
31
|
+
* row's title identically whether or not it read the body back.
|
|
32
|
+
*/
|
|
33
|
+
export declare const rebaseConversationId: (conversation: Conversation, bucket: string) => RebasedConversationId;
|
|
34
|
+
/**
|
|
35
|
+
* Derives the queue row's secondary breadcrumb line from a conversation's
|
|
36
|
+
* source `folderId` (`{bucket}[/<folder>/...]`) — the segments after the
|
|
37
|
+
* leading bucket, joined with " / ". Returns `undefined` for a root
|
|
38
|
+
* conversation (no folder segments).
|
|
39
|
+
*/
|
|
40
|
+
export declare const getFolderBreadcrumb: (conversation: Conversation) => string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Formats a list of names for the aggregate success/failure notifications,
|
|
43
|
+
* each individually quoted and comma-separated (e.g. `"A", "B", "C"`) so the
|
|
44
|
+
* i18n template only needs to append the trailing verb phrase.
|
|
45
|
+
*/
|
|
46
|
+
export declare const formatQuotedNameList: (names: string[]) => string;
|
|
47
|
+
/** New location — and, when the import renamed it, new display name — for an imported attachment. */
|
|
48
|
+
export interface RewrittenAttachmentTarget {
|
|
49
|
+
/** New `files/{bucket}/{path}` id to write into `url`/`reference_url`. */
|
|
50
|
+
url: string;
|
|
51
|
+
/** New display name — present only when a ` (n)` disambiguation suffix was applied. */
|
|
52
|
+
title?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Rewrites every attachment reference a conversation carries — each
|
|
56
|
+
* message's own `custom_content.attachments`, the attachments of each
|
|
57
|
+
* execution stage, the source document of each citation, and the source
|
|
58
|
+
* document of each entry in the conversation-level citation pool — from an
|
|
59
|
+
* old file id to its new uploaded location, and its `title` when the target
|
|
60
|
+
* carries a renamed one. References not present in `targetMap` are left
|
|
61
|
+
* untouched (immutable — returns a new conversation).
|
|
62
|
+
*/
|
|
63
|
+
export declare const rewriteAttachmentUrls: (conversation: Conversation, targetMap: Map<string, RewrittenAttachmentTarget>) => Conversation;
|
|
64
|
+
/**
|
|
65
|
+
* Removes every attachment reference that still points into another user's
|
|
66
|
+
* bucket once the import has re-pointed what it could.
|
|
67
|
+
*
|
|
68
|
+
* A plain `.json` export carries no attachment bytes, and an archive can miss
|
|
69
|
+
* some, so those references keep the exporting user's `files/{bucket}/…` ids.
|
|
70
|
+
* Written back verbatim, they leave the importing user with previews that
|
|
71
|
+
* fail with 403. Own-bucket references are kept — they are the
|
|
72
|
+
* user's own files on a re-import — and so are public ones. A file another
|
|
73
|
+
* user shared with the importing user is dropped too: nothing here can tell
|
|
74
|
+
* it apart from one they never had access to.
|
|
75
|
+
*
|
|
76
|
+
* The conversation-level citation pool is covered as well: a message
|
|
77
|
+
* citation stripped of its source would otherwise resolve its `<cit>` from
|
|
78
|
+
* the pool's copy, which still names the foreign file.
|
|
79
|
+
*
|
|
80
|
+
* Returns the conversation (unchanged when nothing was foreign) and the name
|
|
81
|
+
* of every dropped file, for the skipped-attachment warning.
|
|
82
|
+
*/
|
|
83
|
+
export declare const dropForeignAttachmentRefs: (conversation: Conversation, bucket: string) => {
|
|
84
|
+
conversation: Conversation;
|
|
85
|
+
droppedNames: string[];
|
|
86
|
+
};
|
|
87
|
+
/** One attachment reference planned for upload, with its collision-free destination already allocated. */
|
|
88
|
+
export interface PlannedAttachmentUpload {
|
|
89
|
+
/** Original DIAL file id this attachment is uploaded from — the key `rewriteAttachmentUrls` rewrites. */
|
|
90
|
+
fileId: string;
|
|
91
|
+
/** Raw bytes read from the archive. */
|
|
92
|
+
bytes: Uint8Array;
|
|
93
|
+
/** Basename a 409 retry re-derives its next attempt from (never the already-suffixed name). */
|
|
94
|
+
originalFileName: string;
|
|
95
|
+
/** Destination allocated for the first upload attempt. */
|
|
96
|
+
allocated: AllocatedUploadPath;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Resolves a conversation's unique attachment references to archive bytes
|
|
100
|
+
* and allocates each a collision-free upload destination, in
|
|
101
|
+
* `collectAttachmentRefs` order — a synchronous pre-pass so suffix
|
|
102
|
+
* assignment stays deterministic regardless of later upload concurrency.
|
|
103
|
+
* A reference that cannot be resolved to a `{bucket, path}` pair, or has no
|
|
104
|
+
* matching bytes in the archive, is reported in `skippedNames` and does not
|
|
105
|
+
* consume an allocator slot.
|
|
106
|
+
*/
|
|
107
|
+
export declare const planAttachmentUploads: (conversation: Conversation, attachmentBytes: Map<string, Uint8Array>, allocator: UploadPathAllocator) => {
|
|
108
|
+
plan: PlannedAttachmentUpload[];
|
|
109
|
+
skippedNames: string[];
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=import-conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-conversation.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/import-conversation.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,YAAY,EAEZ,YAAY,EAGb,MAAM,2BAA2B,CAAC;AAOnC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAG7B,oFAAoF;AACpF,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,OAAO,EAAE,MAAM;CAI5B;AAOD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,YA2BlD,CAAC;AAgGF,MAAM,WAAW,qBAAqB;IACpC,wGAAwG;IACxG,YAAY,EAAE,YAAY,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAgBD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,cAAc,YAAY,EAC1B,QAAQ,MAAM,KACb,qBAmDF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,cAAc,YAAY,KACzB,MAAM,GAAG,SAMX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,EAAE,KAAG,MACV,CAAC;AAE9C,qGAAqG;AACrG,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8HD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,YAAY,EAC1B,WAAW,GAAG,CAAC,MAAM,EAAE,yBAAyB,CAAC,KAChD,YAIA,CAAC;AA4EJ;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,YAAY,EAC1B,QAAQ,MAAM,KACb;IAAE,YAAY,EAAE,YAAY,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CA+DtD,CAAC;AAMF,0GAA0G;AAC1G,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,KAAK,EAAE,UAAU,CAAC;IAClB,+FAA+F;IAC/F,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,SAAS,EAAE,mBAAmB,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,YAAY,EAC1B,iBAAiB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,WAAW,mBAAmB,KAC7B;IAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CA2B3D,CAAC"}
|