@epam/ai-dial-chat-hooks 1.3.0-dev.5 → 1.3.0-dev.55
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-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 +100 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.d.ts.map +1 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +139 -122
- 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-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 +92 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +39 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +1 -0
- package/conversation/display-name-watch.d.ts +4 -0
- package/conversation/display-name-watch.d.ts.map +1 -0
- package/conversation/footer-message.d.ts +10 -0
- package/conversation/footer-message.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.d.ts +38 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/greeting.d.ts +18 -0
- package/conversation/greeting.d.ts.map +1 -0
- package/conversation/message-factory.d.ts +7 -0
- package/conversation/message-factory.d.ts.map +1 -0
- package/conversation/message-utils.d.ts +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/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/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-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/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 +33 -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/scheduled-tasks.d.ts +8 -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 -1237
- package/file-manager.js +25 -25
- 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 +35 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -0
- 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.model.js +7 -3
- 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 +24 -14
- package/files/useDialFileManager/useDialFileManager.d.ts +16 -0
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -0
- package/files/useDialFileManager/useDialFileManager.js +148 -140
- 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/useDialFileMutations/useDialFileMutations.js +206 -204
- 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 +159 -6974
- package/index.d.ts.map +1 -0
- package/index.js +124 -117
- 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/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/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/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/useToolsetLogin/useToolsetLogin.d.ts +79 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/oauth.d.ts +2 -472
- package/package.json +26 -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/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/scroll-anchoring.d.ts +2 -50
- package/shared/application-schema.d.ts +18 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/application-schema.js +2 -2
- 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/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/utils.js +10 -10
- package/viewport-layout.d.ts +2 -27
package/skills-state.d.ts
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Fetches all skill namespaces with a gated single request: clears state
|
|
6
|
-
* immediately when `enabled` is false, defers the fetch until `ready` is true,
|
|
7
|
-
* and exposes `refetch` / `mergeSharedSkill` for manual updates.
|
|
8
|
-
* Does not import any feature-flag hook, auth enum, or app context.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useSkillsState: ({ listSkills, enabled, ready, }: UseSkillsStateParams) => UseSkillsStateResult;
|
|
11
|
-
|
|
12
|
-
/** Parameters for {@link useSkillsState}. */
|
|
13
|
-
export declare interface UseSkillsStateParams {
|
|
14
|
-
/** Fetches the aggregate skill listing from the server. */
|
|
15
|
-
listSkills: () => Promise<SkillCatalogListResponseDto>;
|
|
16
|
-
/** Whether the Skills feature is enabled in the current overlay/tenant config. */
|
|
17
|
-
enabled: boolean;
|
|
18
|
-
/** Whether the user session is ready for API calls (auth has settled). */
|
|
19
|
-
ready: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Result returned by {@link useSkillsState}. */
|
|
23
|
-
export declare interface UseSkillsStateResult {
|
|
24
|
-
/** Skills in the caller's own bucket. */
|
|
25
|
-
skills: SkillMetadataItemDto[];
|
|
26
|
-
/** Skills in the organisation bucket. */
|
|
27
|
-
publicSkills: SkillMetadataItemDto[];
|
|
28
|
-
/** Skills other users shared with the caller. */
|
|
29
|
-
sharedWithMe: SkillMetadataItemDto[];
|
|
30
|
-
/** True until the aggregate listing has settled. */
|
|
31
|
-
isLoading: boolean;
|
|
32
|
-
/** Rejection reason of the most recent failed listing, or `null`. */
|
|
33
|
-
error: unknown;
|
|
34
|
-
/** Re-reads personal, shared, and organisation skills. */
|
|
35
|
-
refetch: () => Promise<void>;
|
|
36
|
-
/** Upserts a single skill into the shared-with-me list by URL identity. */
|
|
37
|
-
mergeSharedSkill: (item: SkillMetadataItemDto) => void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { }
|
|
1
|
+
export * from './entry-points/skills-state.js'
|
|
2
|
+
export {}
|
package/source-content.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* URLs and DIAL-relative resource paths such as
|
|
4
|
-
* `files/<bucket>/qa-routed-source.html`. Any query string or hash is dropped
|
|
5
|
-
* and percent escapes are decoded. Returns an empty string when no segment can
|
|
6
|
-
* be extracted. Used to classify a resource by extension when its display name
|
|
7
|
-
* is a citation title rather than a file name.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getUrlFileName: (url: string) => string;
|
|
10
|
-
|
|
11
|
-
/** Returns true when an external (non-DIAL) source URL should be opened in the canvas rather than a new browser tab. */
|
|
12
|
-
export declare const isExternalSourcePreviewable: (contentType: string, url: string) => boolean;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Returns the content type to trust for an external citation source: `contentType`
|
|
16
|
-
* unchanged when it is already an image/audio/PDF/document-renderer marker,
|
|
17
|
-
* otherwise the type implied by `url`'s path extension (`application/pdf` for
|
|
18
|
-
* `.pdf`, the canonical MIME for `.docx`/`.xlsx`/`.pptx`/`.csv`) when that
|
|
19
|
-
* extension is recognized, otherwise `contentType` unchanged.
|
|
20
|
-
*
|
|
21
|
-
* Web-search grounding APIs label every reference — PDFs and Office documents
|
|
22
|
-
* included — as `text/markdown`, so a mislabeled `contentType` must not win
|
|
23
|
-
* over a recognized URL extension: doing so previously sent a PDF's raw bytes
|
|
24
|
-
* into the markdown/text canvas viewer, rendering garbled text instead of
|
|
25
|
-
* opening the PDF/OOXML viewer.
|
|
26
|
-
*/
|
|
27
|
-
export declare const resolveExternalSourceContentType: (contentType: string, url: string) => string;
|
|
28
|
-
|
|
29
|
-
export { }
|
|
1
|
+
export * from './entry-points/source-content.js'
|
|
2
|
+
export {}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { UsageLimitCardData } from '@epam/ai-dial-usage-dashboard';
|
|
3
|
+
import { ResetTimeDisplay } from './usage-reset-time';
|
|
4
|
+
/** A translate function compatible with i18next's `TFunction`. */
|
|
5
|
+
type Translate = (key: string, options?: Record<string, unknown>) => string;
|
|
6
|
+
/** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
|
|
7
|
+
export type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplay | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* i18n key strings that the consuming app's translation bundle must define for
|
|
10
|
+
* `mapUsageDataToDashboard` to produce correctly translated strings. The
|
|
11
|
+
* values are the default key paths used by AI DIAL Chat.
|
|
12
|
+
*/
|
|
13
|
+
export declare const USAGE_DATA_I18N_KEYS: {
|
|
14
|
+
/** Title for the current-UTC-day card (e.g. `'Today'`). */
|
|
15
|
+
readonly todayTitle: "usage.todayTitle";
|
|
16
|
+
/** Accessible period description for the current-UTC-day card. */
|
|
17
|
+
readonly todayPeriodDescription: "usage.todayPeriodDescription";
|
|
18
|
+
/** Title for the current-UTC-week card (e.g. `'This week'`). */
|
|
19
|
+
readonly thisWeekTitle: "usage.thisWeekTitle";
|
|
20
|
+
/** Accessible period description for the current-UTC-week card. */
|
|
21
|
+
readonly thisWeekPeriodDescription: "usage.thisWeekPeriodDescription";
|
|
22
|
+
/** Title for the current-UTC-month card (e.g. `'This month'`). */
|
|
23
|
+
readonly thisMonthTitle: "usage.thisMonthTitle";
|
|
24
|
+
/** Accessible period description for the current-UTC-month card. */
|
|
25
|
+
readonly thisMonthPeriodDescription: "usage.thisMonthPeriodDescription";
|
|
26
|
+
/** Aria label when there is no limit. Receives `{ used: string }`. */
|
|
27
|
+
readonly unlimitedProgressAriaLabel: "usage.unlimitedProgressAriaLabel";
|
|
28
|
+
/** Aria label for a progress bar with a finite limit. Receives `{ used: string, total: string, percent: number }`. */
|
|
29
|
+
readonly progressAriaLabel: "usage.progressAriaLabel";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Maps a `UserLimitStatsResponseDto` into `UsageLimitCardGroup`'s `cards` prop,
|
|
33
|
+
* in Today / This week / This month order. A period is omitted entirely when
|
|
34
|
+
* the response carries no usable stat for it. Each card's reset trio comes from
|
|
35
|
+
* `formatResetTime`, and is absent when that callback returns `undefined`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const mapUsageDataToDashboard: (usage: UserLimitStatsResponseDto | undefined, t: Translate, formatResetTime: FormatResetTime) => UsageLimitCardData[];
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=map-usage-data-to-dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-usage-data-to-dashboard.d.ts","sourceRoot":"","sources":["../../src/usage/map-usage-data-to-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,kEAAkE;AAClE,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAE5E,yGAAyG;AACzG,MAAM,MAAM,eAAe,GAAG,CAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,KACzB,gBAAgB,GAAG,SAAS,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAC/B,2DAA2D;;IAE3D,kEAAkE;;IAElE,gEAAgE;;IAEhE,mEAAmE;;IAEnE,kEAAkE;;IAElE,oEAAoE;;IAEpE,sEAAsE;;IAEtE,sHAAsH;;CAE9G,CAAC;AA8FX;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,yBAAyB,GAAG,SAAS,EAC5C,GAAG,SAAS,EACZ,iBAAiB,eAAe,KAC/B,kBAAkB,EAoCpB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DeploymentItemDto, UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { ModelLimitPeriodStatuses, ModelLimitRow } from '@epam/ai-dial-usage-dashboard';
|
|
3
|
+
import { FormatResetTime } from './map-usage-data-to-dashboard';
|
|
4
|
+
export type { FormatResetTime } from './map-usage-data-to-dashboard';
|
|
5
|
+
/** A translate function compatible with i18next's `TFunction`. */
|
|
6
|
+
type Translate = (key: string, options?: Record<string, unknown>) => string;
|
|
7
|
+
/** A callback that resolves an icon URL from a deployment's raw `iconUrl` field. */
|
|
8
|
+
type ResolveIconUrl = (iconUrl: string | undefined) => string | undefined;
|
|
9
|
+
/** A callback that resolves a display name from a localized-text value. */
|
|
10
|
+
type ResolveDisplayName = (name: string | Record<string, string> | undefined | null, locale: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* i18n key strings that the consuming app's translation bundle must define for
|
|
13
|
+
* `mapUserUsageToModelLimits` and `mapOverallCostLimitsToPeriodStatuses` to produce
|
|
14
|
+
* correctly translated strings. The values are the default key paths used by AI DIAL Chat.
|
|
15
|
+
*/
|
|
16
|
+
export declare const USAGE_MODEL_LIMITS_I18N_KEYS: {
|
|
17
|
+
/** Period label used in tooltip text. Receives no interpolation. */
|
|
18
|
+
readonly todayPeriodDescription: "usage.todayPeriodDescription";
|
|
19
|
+
/** Period label used in tooltip text. Receives no interpolation. */
|
|
20
|
+
readonly thisWeekPeriodDescription: "usage.thisWeekPeriodDescription";
|
|
21
|
+
/** Period label used in tooltip text. Receives no interpolation. */
|
|
22
|
+
readonly thisMonthPeriodDescription: "usage.thisMonthPeriodDescription";
|
|
23
|
+
/** Tooltip when the overall cost limit is running low. Receives `{ period: string }`. */
|
|
24
|
+
readonly overallCostLimitRunningLowTooltip: "usage.overallCostLimitRunningLowTooltip";
|
|
25
|
+
/** Tooltip when the overall cost limit is reached. Receives `{ period: string }`. */
|
|
26
|
+
readonly overallCostLimitReachedTooltip: "usage.overallCostLimitReachedTooltip";
|
|
27
|
+
/** Aria label for a metric cell with no data. */
|
|
28
|
+
readonly unavailableLabel: "usage.unavailableLabel";
|
|
29
|
+
/** Supporting label when a token limit follows the cost limit. */
|
|
30
|
+
readonly followsCostLimitLabel: "usage.followsCostLimitLabel";
|
|
31
|
+
/** Supporting label when there is no per-deployment token limit. */
|
|
32
|
+
readonly noLimitLabel: "usage.noLimitLabel";
|
|
33
|
+
/** Aria label when token usage has no limit but follows the cost limit. Receives `{ used: string }`. */
|
|
34
|
+
readonly followsCostLimitAriaLabel: "usage.followsCostLimitAriaLabel";
|
|
35
|
+
/** Aria label when there is no limit. Receives `{ used: string }`. */
|
|
36
|
+
readonly unlimitedProgressAriaLabel: "usage.unlimitedProgressAriaLabel";
|
|
37
|
+
/** Aria label for a progress bar with a finite limit. Receives `{ used: string, total: string, percent: number }`. */
|
|
38
|
+
readonly progressAriaLabel: "usage.progressAriaLabel";
|
|
39
|
+
/** Label for the spent-cost cell. Receives `{ amount: string }`. */
|
|
40
|
+
readonly spentLabel: "usage.spentLabel";
|
|
41
|
+
/** Type caption for an application (agent) row. Receives no interpolation. */
|
|
42
|
+
readonly applicationTypeLabel: "usage.applicationTypeLabel";
|
|
43
|
+
/** Supporting label on an application row's spent cost. Receives no interpolation. */
|
|
44
|
+
readonly includesCalledModelsLabel: "usage.includesCalledModelsLabel";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Maps the same top-level Cost budgets used by the aggregate cards into table-header state.
|
|
48
|
+
*
|
|
49
|
+
* @param formatResetTime - Formats each period's top-level `resetsAt` into the header's reset trio. Omit it to produce statuses with no reset fields.
|
|
50
|
+
*/
|
|
51
|
+
export declare const mapOverallCostLimitsToPeriodStatuses: (usage: UserLimitStatsResponseDto | undefined, activeLocale: string, t: Translate, formatResetTime?: FormatResetTime) => ModelLimitPeriodStatuses;
|
|
52
|
+
/**
|
|
53
|
+
* Maps `usage.deployments` into `ModelLimitsSection`'s `rows` prop, joined with model or application
|
|
54
|
+
* identity from `deploymentItems`. Rows are included only when any displayed period stat has nonzero
|
|
55
|
+
* usage (Cost stats only, for an application). Order follows `Object.keys(deployments)` —
|
|
56
|
+
* `deploymentItems` is enrichment-only.
|
|
57
|
+
*
|
|
58
|
+
* @param resolveIconUrl - Resolves a deployment's raw `iconUrl` to the URL the avatar should load.
|
|
59
|
+
* @param resolveDisplayName - Resolves a localized-text map or plain string to the display name for `activeLocale`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const mapUserUsageToModelLimits: (usage: UserLimitStatsResponseDto | undefined, deploymentItems: DeploymentItemDto[], activeLocale: string, t: Translate, resolveIconUrl: ResolveIconUrl, resolveDisplayName: ResolveDisplayName) => ModelLimitRow[];
|
|
62
|
+
//# sourceMappingURL=map-user-usage-to-model-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-user-usage-to-model-limits.d.ts","sourceRoot":"","sources":["../../src/usage/map-user-usage-to-model-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAGjB,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAIV,wBAAwB,EACxB,aAAa,EACd,MAAM,+BAA+B,CAAC;AAMvC,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,kEAAkE;AAClE,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAE5E,oFAAoF;AACpF,KAAK,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;AAE1E,2EAA2E;AAC3E,KAAK,kBAAkB,GAAG,CACxB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,EACxD,MAAM,EAAE,MAAM,KACX,MAAM,CAAC;AAmBZ;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;IACvC,oEAAoE;;IAEpE,oEAAoE;;IAEpE,oEAAoE;;IAEpE,yFAAyF;;IAEzF,qFAAqF;;IAErF,iDAAiD;;IAEjD,kEAAkE;;IAElE,oEAAoE;;IAEpE,wGAAwG;;IAExG,sEAAsE;;IAEtE,sHAAsH;;IAEtH,oEAAoE;;IAEpE,8EAA8E;;IAE9E,sFAAsF;;CAE9E,CAAC;AA6HX;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAC/C,OAAO,yBAAyB,GAAG,SAAS,EAC5C,cAAc,MAAM,EACpB,GAAG,SAAS,EACZ,kBAAiB,eAA6B,KAC7C,wBAsBD,CAAC;AAkMH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,yBAAyB,GAAG,SAAS,EAC5C,iBAAiB,iBAAiB,EAAE,EACpC,cAAc,MAAM,EACpB,GAAG,SAAS,EACZ,gBAAgB,cAAc,EAC9B,oBAAoB,kBAAkB,KACrC,aAAa,EAgIf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { UsageLimitBannerSeverity } from '@epam/ai-dial-conversation-input';
|
|
3
|
+
import { UsagePeriod } from './usage-period';
|
|
4
|
+
/** The day/week/month usage stat the composer banner reports on, and how close it is to its limit. */
|
|
5
|
+
export interface UsageBannerSource {
|
|
6
|
+
/** Calendar period of the stat. */
|
|
7
|
+
period: UsagePeriod;
|
|
8
|
+
/** `Reached` at or above 100%, otherwise `Warning`. */
|
|
9
|
+
severity: UsageLimitBannerSeverity;
|
|
10
|
+
/** Consumed share of the stat's limit, rounded and clamped to 0–100. */
|
|
11
|
+
usedPercent: number;
|
|
12
|
+
/** DIAL Core's `resetsAt` for the stat, when it sent one. */
|
|
13
|
+
resetsAt: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** `true` when `total` is a real cap: finite, positive, and below DIAL Core's unlimited sentinel. */
|
|
16
|
+
export declare const isCappedStat: (total: number) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the capped day/week/month token or cost stat with the highest
|
|
19
|
+
* used/total ratio, classified against `thresholdPercent`, or `undefined` when
|
|
20
|
+
* no stat is capped or the worst one is below the threshold.
|
|
21
|
+
*/
|
|
22
|
+
export declare const selectUsageBannerSource: (dto: DeploymentLimitsResponseDto | undefined, thresholdPercent: number) => UsageBannerSource | undefined;
|
|
23
|
+
//# sourceMappingURL=usage-banner-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-banner-source.d.ts","sourceRoot":"","sources":["../../src/usage/usage-banner-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAE5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,sGAAsG;AACtG,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,MAAM,EAAE,WAAW,CAAC;IACpB,uDAAuD;IACvD,QAAQ,EAAE,wBAAwB,CAAC;IACnC,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAQD,qGAAqG;AACrG,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAC4B,CAAC;AA8B1E;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,KAAK,2BAA2B,GAAG,SAAS,EAC5C,kBAAkB,MAAM,KACvB,iBAAiB,GAAG,SAoCtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UsagePeriod as e } from "./usage-period.js";
|
|
2
|
+
import { UsageLimitBannerSeverity as t } from "@epam/ai-dial-conversation-input";
|
|
3
|
+
//#region src/usage/usage-banner-source.ts
|
|
4
|
+
var n = 2 ** 53 - 1, r = (e) => Number.isFinite(e) && e > 0 && e < n, i = [
|
|
5
|
+
["monthTokenStats", e.Month],
|
|
6
|
+
["monthCostStats", e.Month],
|
|
7
|
+
["weekTokenStats", e.Week],
|
|
8
|
+
["weekCostStats", e.Week],
|
|
9
|
+
["dayTokenStats", e.Day],
|
|
10
|
+
["dayCostStats", e.Day]
|
|
11
|
+
], a = (e, n) => {
|
|
12
|
+
let a;
|
|
13
|
+
for (let [t, n] of i) {
|
|
14
|
+
let i = e?.[t];
|
|
15
|
+
if (i == null || !r(i.total)) continue;
|
|
16
|
+
let o = Math.max(i.used, 0) / i.total;
|
|
17
|
+
(a == null || o > a.ratio) && (a = {
|
|
18
|
+
stat: i,
|
|
19
|
+
period: n,
|
|
20
|
+
ratio: o
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (a == null) return;
|
|
24
|
+
let o = Math.min(100, Math.round(a.ratio * 100)), s;
|
|
25
|
+
if (a.ratio >= 1) s = t.Reached;
|
|
26
|
+
else if (o >= n) s = t.Warning;
|
|
27
|
+
else return;
|
|
28
|
+
return {
|
|
29
|
+
period: a.period,
|
|
30
|
+
severity: s,
|
|
31
|
+
usedPercent: o,
|
|
32
|
+
resetsAt: a.stat.resetsAt
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { r as isCappedStat, a as selectUsageBannerSource };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-period.d.ts","sourceRoot":"","sources":["../../src/usage/usage-period.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { UsagePeriod } from './usage-period';
|
|
2
|
+
/**
|
|
3
|
+
* i18n key strings the consuming app's translation bundle must define for the
|
|
4
|
+
* reset-time formatters to produce translated strings. The values are the
|
|
5
|
+
* default key paths used by AI DIAL Chat.
|
|
6
|
+
*/
|
|
7
|
+
export declare const USAGE_RESET_I18N_KEYS: {
|
|
8
|
+
/** Visible label for a full reset time. Receives `{ dateTime: string }`. */
|
|
9
|
+
readonly resetsAtLabel: "usage.resetsAtLabel";
|
|
10
|
+
/** Spoken label for a full reset time. Receives `{ dateTime: string }`. */
|
|
11
|
+
readonly resetsAtAriaLabel: "usage.resetsAtAriaLabel";
|
|
12
|
+
/** Short daily reset sentence. Receives `{ time: string }`. */
|
|
13
|
+
readonly resetsAtTime: "conversationInput.usageBanner.resetsAtTime";
|
|
14
|
+
/** Short weekly/monthly reset sentence. Receives `{ date: string }`. */
|
|
15
|
+
readonly resetsOnDate: "conversationInput.usageBanner.resetsOnDate";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A DIAL Core `resetsAt` instant, normalized into the preformatted strings the
|
|
19
|
+
* usage dashboard renders. Every `Date` and `Intl` call for reset times lives
|
|
20
|
+
* in this module: the display components receive only these strings
|
|
21
|
+
* and never sees a raw timestamp, a locale, or a timezone.
|
|
22
|
+
*/
|
|
23
|
+
export interface ResetTimeDisplay {
|
|
24
|
+
/** Exclusive end of the period, as an epoch ms value, for boundary scheduling. */
|
|
25
|
+
resetsAtMs: number;
|
|
26
|
+
/** Machine-readable instant for a `<time dateTime>` attribute, e.g. '2026-09-16T00:00:00Z'. */
|
|
27
|
+
isoValue: string;
|
|
28
|
+
/** Visible label, e.g. 'Resets 16 Sept 2026, 03:00 GMT+3'. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Accessible expansion naming the timezone in full, e.g. 'Usage resets Sep 16, 2026 at 2:00 AM Central European Summer Time'. */
|
|
31
|
+
ariaLabel: string;
|
|
32
|
+
}
|
|
33
|
+
/** A translate function compatible with i18next's `TFunction`. */
|
|
34
|
+
export type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Formats DIAL Core's `resetsAt` for display in the viewer's locale and
|
|
37
|
+
* timezone, always stating the zone so a UTC boundary shown in local time is
|
|
38
|
+
* never ambiguous.
|
|
39
|
+
*
|
|
40
|
+
* Returns `undefined` on every failure path — an absent, empty, or
|
|
41
|
+
* unparseable value, or an `Intl` implementation that throws (embedded and
|
|
42
|
+
* restricted runtimes expose incomplete ones, which is why the resolution is
|
|
43
|
+
* wrapped, matching `getBrowserTimezone` in `@epam/ai-dial-chat-hooks`). A
|
|
44
|
+
* reset time is decoration on a usage figure and never a gate on it, so the
|
|
45
|
+
* caller renders the rest of the card unchanged when this returns nothing.
|
|
46
|
+
*
|
|
47
|
+
* The boundary is never derived from the browser's own calendar — no local
|
|
48
|
+
* midnight, no start-of-week, no arithmetic on `new Date()`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const formatUsageResetTime: (resetsAt: string | undefined, activeLocale: string, t: TranslateFn) => ResetTimeDisplay | undefined;
|
|
51
|
+
/** A `resetsAt` instant as the one-sentence reset notice the composer usage banner renders. */
|
|
52
|
+
export interface ShortResetTimeDisplay {
|
|
53
|
+
/** Machine-readable instant for a `<time dateTime>` attribute, e.g. '2026-10-13T00:00:00Z'. */
|
|
54
|
+
isoValue: string;
|
|
55
|
+
/** Visible sentence, e.g. 'Resets at 3:00 AM GMT+3.' or 'Resets on Oct 19.'. */
|
|
56
|
+
label: string;
|
|
57
|
+
/** Accessible expansion with the full date, time and zone name, from `formatUsageResetTime`. */
|
|
58
|
+
ariaLabel: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Formats DIAL Core's `resetsAt` as the banner's reset sentence: a time with
|
|
62
|
+
* its zone offset for a daily period, a short date (with the year only when it
|
|
63
|
+
* is not the current one) for a weekly or monthly period.
|
|
64
|
+
*
|
|
65
|
+
* Returns `undefined` on the same failure paths as `formatUsageResetTime`,
|
|
66
|
+
* whose spoken form it reuses, so the caller renders the period sentence alone.
|
|
67
|
+
*/
|
|
68
|
+
export declare const formatUsageResetShort: (resetsAt: string | undefined, period: UsagePeriod, activeLocale: string, t: TranslateFn) => ShortResetTimeDisplay | undefined;
|
|
69
|
+
//# sourceMappingURL=usage-reset-time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-reset-time.d.ts","sourceRoot":"","sources":["../../src/usage/usage-reset-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;IAChC,4EAA4E;;IAE5E,2EAA2E;;IAE3E,+DAA+D;;IAE/D,wEAAwE;;CAEhE,CAAC;AAEX;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,kIAAkI;IAClI,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,MAAM,CAAC;AAEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,GAAG,SAAS,EAC5B,cAAc,MAAM,EACpB,GAAG,WAAW,KACb,gBAAgB,GAAG,SA+DrB,CAAC;AAEF,+FAA+F;AAC/F,MAAM,WAAW,qBAAqB;IACpC,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,gGAAgG;IAChG,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,GAAG,SAAS,EAC5B,QAAQ,WAAW,EACnB,cAAc,MAAM,EACpB,GAAG,WAAW,KACb,qBAAqB,GAAG,SAiD1B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { UsagePeriod as e } from "./usage-period.js";
|
|
2
|
+
//#region src/usage/usage-reset-time.ts
|
|
3
|
+
var t = {
|
|
4
|
+
resetsAtLabel: "usage.resetsAtLabel",
|
|
5
|
+
resetsAtAriaLabel: "usage.resetsAtAriaLabel",
|
|
6
|
+
resetsAtTime: "conversationInput.usageBanner.resetsAtTime",
|
|
7
|
+
resetsOnDate: "conversationInput.usageBanner.resetsOnDate"
|
|
8
|
+
}, n = (e, n, r) => {
|
|
9
|
+
if (!e) return;
|
|
10
|
+
let i = Date.parse(e);
|
|
11
|
+
if (!Number.isNaN(i)) try {
|
|
12
|
+
let a = Intl.DateTimeFormat().resolvedOptions().timeZone, o = new Date(i), s = a ? { timeZone: a } : {}, c = {
|
|
13
|
+
year: "numeric",
|
|
14
|
+
month: "short",
|
|
15
|
+
day: "numeric",
|
|
16
|
+
hour: "numeric",
|
|
17
|
+
minute: "2-digit"
|
|
18
|
+
}, l = new Intl.DateTimeFormat(n, {
|
|
19
|
+
...c,
|
|
20
|
+
timeZoneName: "shortOffset",
|
|
21
|
+
...s
|
|
22
|
+
}).format(o), u = new Intl.DateTimeFormat(n, {
|
|
23
|
+
...c,
|
|
24
|
+
timeZoneName: "long",
|
|
25
|
+
...s
|
|
26
|
+
}).format(o);
|
|
27
|
+
return {
|
|
28
|
+
resetsAtMs: i,
|
|
29
|
+
isoValue: e,
|
|
30
|
+
label: r(t.resetsAtLabel, { dateTime: l }),
|
|
31
|
+
ariaLabel: r(t.resetsAtAriaLabel, { dateTime: u })
|
|
32
|
+
};
|
|
33
|
+
} catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}, r = (r, i, a, o) => {
|
|
37
|
+
let s = n(r, a, o);
|
|
38
|
+
if (s != null) try {
|
|
39
|
+
let n = Intl.DateTimeFormat().resolvedOptions().timeZone, r = n ? { timeZone: n } : {}, c = new Date(s.resetsAtMs);
|
|
40
|
+
if (i === e.Day) {
|
|
41
|
+
let e = new Intl.DateTimeFormat(a, {
|
|
42
|
+
hour: "numeric",
|
|
43
|
+
minute: "2-digit",
|
|
44
|
+
timeZoneName: "shortOffset",
|
|
45
|
+
...r
|
|
46
|
+
}).format(c);
|
|
47
|
+
return {
|
|
48
|
+
isoValue: s.isoValue,
|
|
49
|
+
label: o(t.resetsAtTime, { time: e }),
|
|
50
|
+
ariaLabel: s.ariaLabel
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
let l = new Intl.DateTimeFormat("en-US", {
|
|
54
|
+
year: "numeric",
|
|
55
|
+
...r
|
|
56
|
+
}), u = l.format(c) !== l.format(/* @__PURE__ */ new Date()), d = new Intl.DateTimeFormat(a, {
|
|
57
|
+
month: "short",
|
|
58
|
+
day: "numeric",
|
|
59
|
+
...u ? { year: "numeric" } : {},
|
|
60
|
+
...r
|
|
61
|
+
}).format(c);
|
|
62
|
+
return {
|
|
63
|
+
isoValue: s.isoValue,
|
|
64
|
+
label: o(t.resetsOnDate, { date: d }),
|
|
65
|
+
ariaLabel: s.ariaLabel
|
|
66
|
+
};
|
|
67
|
+
} catch {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { t as USAGE_RESET_I18N_KEYS, r as formatUsageResetShort, n as formatUsageResetTime };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Host-configured call that fetches the limits of one deployment. */
|
|
3
|
+
export type GetDeploymentLimits = (deploymentId: string) => Promise<DeploymentLimitsResponseDto>;
|
|
4
|
+
/** Return shape of {@link useDeploymentUsageLimits}. */
|
|
5
|
+
export interface UseDeploymentUsageLimitsResult {
|
|
6
|
+
/** Raw limits response for the selected deployment, or `undefined` before the first success. */
|
|
7
|
+
limitsDto: DeploymentLimitsResponseDto | undefined;
|
|
8
|
+
/** `true` while a fetch is in flight. */
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
/** `true` after the most recent fetch rejected. */
|
|
11
|
+
hasError: boolean;
|
|
12
|
+
/** Re-fetches the current deployment when no request is in flight. */
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the selected deployment's usage limits via the provided
|
|
17
|
+
* `getDeploymentLimits` function. The hook accepts the fetch function as a
|
|
18
|
+
* parameter so the caller supplies an already-configured API client — the hook
|
|
19
|
+
* never constructs or imports one itself. The function's identity is not a
|
|
20
|
+
* re-fetch trigger; only `deploymentId` and `refresh()` are.
|
|
21
|
+
*
|
|
22
|
+
* A monotonic request ID prevents a slower response for a previous deployment
|
|
23
|
+
* from replacing the current value. Refresh failures preserve the last known
|
|
24
|
+
* response so the open popover can surface a non-blocking error.
|
|
25
|
+
*
|
|
26
|
+
* The raw response is returned rather than a mapped display model: mapping
|
|
27
|
+
* needs the caller's translated labels and locale-bound reset formatter, and
|
|
28
|
+
* holding the mapped value in state here would leave it stale after a language
|
|
29
|
+
* change until the next fetch.
|
|
30
|
+
*/
|
|
31
|
+
export declare const useDeploymentUsageLimits: (deploymentId: string | undefined, getDeploymentLimits: GetDeploymentLimits) => UseDeploymentUsageLimitsResult;
|
|
32
|
+
//# sourceMappingURL=useDeploymentUsageLimits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeploymentUsageLimits.d.ts","sourceRoot":"","sources":["../../../src/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAGjF,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAChC,YAAY,EAAE,MAAM,KACjB,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE1C,wDAAwD;AACxD,MAAM,WAAW,8BAA8B;IAC7C,gGAAgG;IAChG,SAAS,EAAE,2BAA2B,GAAG,SAAS,CAAC;IACnD,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,GACnC,cAAc,MAAM,GAAG,SAAS,EAChC,qBAAqB,mBAAmB,KACvC,8BAgEF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
//#region src/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.ts
|
|
3
|
+
var i = (i, a) => {
|
|
4
|
+
let [o, s] = r(), [c, l] = r(!1), [u, d] = r(!1), [f, p] = r(0), m = n(0), h = n(!1), g = n(void 0), _ = n(a);
|
|
5
|
+
_.current = a;
|
|
6
|
+
let v = e(() => {
|
|
7
|
+
h.current || p((e) => e + 1);
|
|
8
|
+
}, []);
|
|
9
|
+
return t(() => {
|
|
10
|
+
let e = g.current !== i;
|
|
11
|
+
if (g.current = i, !i) {
|
|
12
|
+
m.current += 1, s(void 0), l(!1), d(!1), h.current = !1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
e && s(void 0);
|
|
16
|
+
let t = ++m.current, n = !1;
|
|
17
|
+
return l(!0), d(!1), h.current = !0, (async () => {
|
|
18
|
+
try {
|
|
19
|
+
let e = await _.current(i);
|
|
20
|
+
if (n || t !== m.current) return;
|
|
21
|
+
s(e);
|
|
22
|
+
} catch {
|
|
23
|
+
if (n || t !== m.current) return;
|
|
24
|
+
d(!0);
|
|
25
|
+
} finally {
|
|
26
|
+
!n && t === m.current && (l(!1), h.current = !1);
|
|
27
|
+
}
|
|
28
|
+
})(), () => {
|
|
29
|
+
n = !0;
|
|
30
|
+
};
|
|
31
|
+
}, [i, f]), {
|
|
32
|
+
limitsDto: o,
|
|
33
|
+
isLoading: c,
|
|
34
|
+
hasError: u,
|
|
35
|
+
refresh: v
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { i as useDeploymentUsageLimits };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface UseRefreshUsageAfterGenerationOptions {
|
|
2
|
+
/** Whether the selected deployment is currently generating a response. */
|
|
3
|
+
isGenerationInProgress: boolean;
|
|
4
|
+
/** `true` while the usage fetch is in flight; a pending refresh waits for it. */
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
/** Re-fetches the usage limits. */
|
|
7
|
+
refresh: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Refreshes usage limits once after a response finishes streaming
|
|
11
|
+
* (`isGenerationInProgress` `true` → `false`), deferring the refresh while a
|
|
12
|
+
* fetch is still in flight. Shared by the usage dial and the usage banner so
|
|
13
|
+
* the two cannot drift.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useRefreshUsageAfterGeneration: ({ isGenerationInProgress, isLoading, refresh, }: UseRefreshUsageAfterGenerationOptions) => void;
|
|
16
|
+
//# sourceMappingURL=useRefreshUsageAfterGeneration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefreshUsageAfterGeneration.d.ts","sourceRoot":"","sources":["../../../src/usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qCAAqC;IACpD,0EAA0E;IAC1E,sBAAsB,EAAE,OAAO,CAAC;IAChC,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GAAI,iDAI5C,qCAAqC,KAAG,IAe1C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t } from "react";
|
|
2
|
+
//#region src/usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.ts
|
|
3
|
+
var n = ({ isGenerationInProgress: n, isLoading: r, refresh: i }) => {
|
|
4
|
+
let a = t(n), o = t(!1);
|
|
5
|
+
e(() => {
|
|
6
|
+
a.current && !n && (o.current = !0), a.current = n, o.current && !r && (o.current = !1, i());
|
|
7
|
+
}, [
|
|
8
|
+
n,
|
|
9
|
+
r,
|
|
10
|
+
i
|
|
11
|
+
]);
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as useRefreshUsageAfterGeneration };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Return shape of {@link useUsageData}. */
|
|
3
|
+
export interface UseUsageDataResult {
|
|
4
|
+
/** Calendar-period usage and rate-limit stats for every deployment the caller has used in the current UTC day, week, and month, plus the caller's global cost budget. Retained across a `refreshToken`-triggered re-fetch until the new response resolves. */
|
|
5
|
+
usage: UserLimitStatsResponseDto | undefined;
|
|
6
|
+
/** `true` while a fetch is in flight, including a `refreshToken`-triggered re-fetch. */
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
/** Set when the `getUserUsage` call rejects. */
|
|
9
|
+
usageError: Error | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fetches usage stats via the provided `getUserUsage` function on mount, and
|
|
13
|
+
* again whenever `refreshToken` changes.
|
|
14
|
+
*
|
|
15
|
+
* `enabled` (default `true`) lets callers behind a feature flag skip the fetch
|
|
16
|
+
* entirely. The hook accepts the fetch function as a parameter so the caller
|
|
17
|
+
* supplies an already-configured API client — the hook never constructs or
|
|
18
|
+
* imports one itself.
|
|
19
|
+
*
|
|
20
|
+
* `refreshToken` (default `0`) is a caller-driven re-fetch trigger, subject to
|
|
21
|
+
* the same `enabled` gate. The hook owns no timer and reads no clock: the
|
|
22
|
+
* caller decides when to change the token. A previously resolved `usage` value
|
|
23
|
+
* is retained while a token-triggered re-fetch is in flight, so the consumer
|
|
24
|
+
* can keep rendering the last known figures and suppress a full-page loading
|
|
25
|
+
* state for a refresh.
|
|
26
|
+
*/
|
|
27
|
+
export declare const useUsageData: (getUserUsage: () => Promise<UserLimitStatsResponseDto>, enabled?: boolean, refreshToken?: number) => UseUsageDataResult;
|
|
28
|
+
//# sourceMappingURL=useUsageData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUsageData.d.ts","sourceRoot":"","sources":["../../../src/usage/useUsageData/useUsageData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC,8PAA8P;IAC9P,KAAK,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC7C,wFAAwF;IACxF,SAAS,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,KAAK,GAAG,SAAS,CAAC;CAC/B;AAKD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,GACvB,cAAc,MAAM,OAAO,CAAC,yBAAyB,CAAC,EACtD,iBAAc,EACd,qBAAgB,KACf,kBAmCF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { UsageLimitBannerViewProps } from '@epam/ai-dial-conversation-input';
|
|
2
|
+
import { TranslateFn } from '../usage-reset-time';
|
|
3
|
+
import { GetDeploymentLimits } from '../useDeploymentUsageLimits/useDeploymentUsageLimits';
|
|
4
|
+
/**
|
|
5
|
+
* i18n key strings the consuming app's translation bundle must define for
|
|
6
|
+
* `useUsageLimitBanner` to produce translated strings, in addition to
|
|
7
|
+
* `USAGE_RESET_I18N_KEYS`. The values are the default key paths used by AI
|
|
8
|
+
* DIAL Chat.
|
|
9
|
+
*/
|
|
10
|
+
export declare const USAGE_BANNER_I18N_KEYS: {
|
|
11
|
+
/** Warning sentence for a daily limit. Receives `{ percent: number }`. */
|
|
12
|
+
readonly warningDay: "conversationInput.usageBanner.warningDay";
|
|
13
|
+
/** Warning sentence for a weekly limit. Receives `{ percent: number }`. */
|
|
14
|
+
readonly warningWeek: "conversationInput.usageBanner.warningWeek";
|
|
15
|
+
/** Warning sentence for a monthly limit. Receives `{ percent: number }`. */
|
|
16
|
+
readonly warningMonth: "conversationInput.usageBanner.warningMonth";
|
|
17
|
+
/** Reached sentence for a daily limit. Receives `{ percent: number }`. */
|
|
18
|
+
readonly reachedDay: "conversationInput.usageBanner.reachedDay";
|
|
19
|
+
/** Reached sentence for a weekly limit. Receives `{ percent: number }`. */
|
|
20
|
+
readonly reachedWeek: "conversationInput.usageBanner.reachedWeek";
|
|
21
|
+
/** Reached sentence for a monthly limit. Receives `{ percent: number }`. */
|
|
22
|
+
readonly reachedMonth: "conversationInput.usageBanner.reachedMonth";
|
|
23
|
+
/** Accessible name of the close button. */
|
|
24
|
+
readonly closeLabel: "conversationInput.usageBanner.closeLabel";
|
|
25
|
+
};
|
|
26
|
+
/** Inputs of {@link useUsageLimitBanner}. */
|
|
27
|
+
export interface UseUsageLimitBannerOptions {
|
|
28
|
+
/** ID of the currently selected deployment. */
|
|
29
|
+
deploymentId: string | undefined;
|
|
30
|
+
/** Whether the selected deployment is currently generating a response. Defaults to `false`. */
|
|
31
|
+
isGenerationInProgress?: boolean;
|
|
32
|
+
/** Host-configured call that fetches one deployment's limits. */
|
|
33
|
+
getDeploymentLimits: GetDeploymentLimits;
|
|
34
|
+
/** Used percentage at or above which a not-yet-exhausted limit raises a warning. */
|
|
35
|
+
warningThresholdPercent: number;
|
|
36
|
+
/** Active UI locale, used to format the reset time. */
|
|
37
|
+
activeLocale: string;
|
|
38
|
+
/** Translate function compatible with i18next's `TFunction`. */
|
|
39
|
+
t: TranslateFn;
|
|
40
|
+
}
|
|
41
|
+
/** The part of `UsageLimitBannerViewProps` the hook decides. */
|
|
42
|
+
export type UsageLimitBannerState = Pick<UsageLimitBannerViewProps, 'severity' | 'limitText' | 'reset' | 'onClose' | 'closeAriaLabel'>;
|
|
43
|
+
/** Return shape of {@link useUsageLimitBanner}. */
|
|
44
|
+
export interface UseUsageLimitBannerResult {
|
|
45
|
+
/** Props for `UsageLimitBannerView`, or `undefined` when no banner should render (no deployment, below the threshold, or dismissed). */
|
|
46
|
+
banner: UsageLimitBannerState | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Everything the composer usage banner needs except its rendering: fetches the
|
|
50
|
+
* selected deployment's limits, refreshes them after each generation, picks
|
|
51
|
+
* the limit worth reporting, formats its sentences, and tracks tab-lifetime
|
|
52
|
+
* dismissal. Spread `banner` onto `UsageLimitBannerView` from
|
|
53
|
+
* `@epam/ai-dial-conversation-input`.
|
|
54
|
+
*/
|
|
55
|
+
export declare const useUsageLimitBanner: ({ deploymentId, isGenerationInProgress, getDeploymentLimits, warningThresholdPercent, activeLocale, t, }: UseUsageLimitBannerOptions) => UseUsageLimitBannerResult;
|
|
56
|
+
//# sourceMappingURL=useUsageLimitBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUsageLimitBanner.d.ts","sourceRoot":"","sources":["../../../src/usage/useUsageLimitBanner/useUsageLimitBanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,sDAAsD,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;IACjC,0EAA0E;;IAE1E,2EAA2E;;IAE3E,4EAA4E;;IAE5E,0EAA0E;;IAE1E,2EAA2E;;IAE3E,4EAA4E;;IAE5E,2CAA2C;;CAEnC,CAAC;AAkBX,6CAA6C;AAC7C,MAAM,WAAW,0BAA0B;IACzC,+CAA+C;IAC/C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,+FAA+F;IAC/F,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iEAAiE;IACjE,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,oFAAoF;IACpF,uBAAuB,EAAE,MAAM,CAAC;IAChC,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,CAAC,EAAE,WAAW,CAAC;CAChB;AAED,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,yBAAyB,EACzB,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,gBAAgB,CAClE,CAAC;AAEF,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC,wIAAwI;IACxI,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,0GAOjC,0BAA0B,KAAG,yBAiE/B,CAAC"}
|