@epam/ai-dial-chat-hooks 1.1.0-dev.383 → 1.1.0-dev.390

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/api-error-DuLNy43N.js +45 -0
  2. package/attachment-types-AAoN9E95.js +7760 -0
  3. package/{attachment/useAttachmentValidation/useAttachmentValidation.d.ts → attachments.d.ts} +88 -44
  4. package/attachments.js +2 -0
  5. package/browser-Btsa0Lmr.js +607 -0
  6. package/catalog.d.ts +946 -0
  7. package/catalog.js +3 -0
  8. package/{conversation-sources/useConversationSources/useConversationSources.d.ts → conversation-sources.d.ts} +25 -20
  9. package/conversation-sources.js +2 -0
  10. package/conversation-transfer.d.ts +189 -0
  11. package/conversation-transfer.js +3 -0
  12. package/conversation.d.ts +907 -0
  13. package/conversation.js +2 -0
  14. package/cron-weekday-B4w29eAC.js +4 -0
  15. package/date-BeuD8G79.js +4 -0
  16. package/deployment-id-CxWgJTs9.js +6 -0
  17. package/file-manager.d.ts +1344 -0
  18. package/file-manager.js +4 -0
  19. package/formatting-CZyyxBG3.js +4 -0
  20. package/index.d.ts +4945 -126
  21. package/index.js +27 -19152
  22. package/oauth.d.ts +440 -0
  23. package/oauth.js +3 -0
  24. package/package.json +142 -21
  25. package/prompt-resource-Bt1I-8ri.js +41 -0
  26. package/scheduled-task-trigger-D9RZCk52.js +145 -0
  27. package/{scheduled-task/scheduled-task-trigger.d.ts → scheduled-tasks.d.ts} +51 -27
  28. package/scheduled-tasks.js +2 -0
  29. package/{conversation/useConversationScroll/useConversationScroll.d.ts → scroll-anchoring.d.ts} +50 -46
  30. package/scroll-anchoring.js +2 -0
  31. package/{useShareRecipientsCount/useShareRecipientsCount.d.ts → sharing.d.ts} +65 -36
  32. package/sharing.js +3 -0
  33. package/skill-editor.d.ts +503 -0
  34. package/skill-editor.js +3 -0
  35. package/skill-manifest-CCX8s4nn.js +4035 -0
  36. package/{skill/useSkillsState/useSkillsState.d.ts → skills-state.d.ts} +40 -35
  37. package/skills-state.js +2 -0
  38. package/string-utils-iBi2Y55C.js +10 -0
  39. package/toolset-id-CkxRHyU0.js +10 -0
  40. package/useAttachmentValidation-CkMTd5lA.js +102 -0
  41. package/useConversationImport-C2h1GBY4.js +807 -0
  42. package/useConversationScroll-CliIMnjP.js +122 -0
  43. package/useConversationSources-DKaKvjXZ.js +47 -0
  44. package/useDialFileManagerTabConfig-DGQw8H8H.js +2289 -0
  45. package/usePanelMaxWidth-BEZYuqF9.js +44 -0
  46. package/useShareLink-xkiaxATt.js +44 -0
  47. package/useShareRecipientsCount-BgwCLKY0.js +37 -0
  48. package/useSkillFileActions-BU5PzZ_8.js +373 -0
  49. package/useSkillFilePreview-BYfZUJhr.js +1005 -0
  50. package/useSkillsState-BoLlwmzb.js +52 -0
  51. package/useToolsMenu-BXdahO0i.js +1874 -0
  52. package/useToolsetLogin-GhFtKs4D.js +276 -0
  53. package/useUsageData-D7BxloKZ.js +201 -0
  54. package/utils.d.ts +373 -0
  55. package/utils.js +7 -0
  56. package/{usePageFileDrag/usePageFileDrag.d.ts → viewport-layout.d.ts} +27 -16
  57. package/viewport-layout.js +2 -0
  58. package/api-error/api-error.d.ts +0 -18
  59. package/api-error/api-error.d.ts.map +0 -1
  60. package/api-transport/create-csrf-middleware.d.ts +0 -15
  61. package/api-transport/create-csrf-middleware.d.ts.map +0 -1
  62. package/api-transport/create-unauthorized-middleware.d.ts +0 -40
  63. package/api-transport/create-unauthorized-middleware.d.ts.map +0 -1
  64. package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -32
  65. package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +0 -1
  66. package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +0 -1
  67. package/catalog/catalog-derivations.d.ts +0 -27
  68. package/catalog/catalog-derivations.d.ts.map +0 -1
  69. package/catalog/catalog-primary-action.d.ts +0 -47
  70. package/catalog/catalog-primary-action.d.ts.map +0 -1
  71. package/catalog/create-publish-api.d.ts +0 -32
  72. package/catalog/create-publish-api.d.ts.map +0 -1
  73. package/catalog/deployment-endpoint-url.d.ts +0 -19
  74. package/catalog/deployment-endpoint-url.d.ts.map +0 -1
  75. package/catalog/deployment-id.d.ts +0 -21
  76. package/catalog/deployment-id.d.ts.map +0 -1
  77. package/catalog/entity-details.d.ts +0 -132
  78. package/catalog/entity-details.d.ts.map +0 -1
  79. package/catalog/map-deployment-limits-to-catalog.d.ts +0 -33
  80. package/catalog/map-deployment-limits-to-catalog.d.ts.map +0 -1
  81. package/catalog/map-deployment-limits-to-input.d.ts +0 -15
  82. package/catalog/map-deployment-limits-to-input.d.ts.map +0 -1
  83. package/catalog/map-deployment-to-catalog-item.d.ts +0 -60
  84. package/catalog/map-deployment-to-catalog-item.d.ts.map +0 -1
  85. package/catalog/map-entity-details-to-catalog.d.ts +0 -23
  86. package/catalog/map-entity-details-to-catalog.d.ts.map +0 -1
  87. package/catalog/map-prompt-to-catalog-item.d.ts +0 -43
  88. package/catalog/map-prompt-to-catalog-item.d.ts.map +0 -1
  89. package/catalog/map-skill-to-catalog-item.d.ts +0 -87
  90. package/catalog/map-skill-to-catalog-item.d.ts.map +0 -1
  91. package/catalog/mcp-endpoint-url.d.ts +0 -18
  92. package/catalog/mcp-endpoint-url.d.ts.map +0 -1
  93. package/catalog/publish.d.ts +0 -17
  94. package/catalog/publish.d.ts.map +0 -1
  95. package/catalog/useCatalogItemDetails.d.ts +0 -73
  96. package/catalog/useCatalogItemDetails.d.ts.map +0 -1
  97. package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +0 -37
  98. package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +0 -1
  99. package/catalog/usePublishFolders/usePublishFolders.d.ts +0 -73
  100. package/catalog/usePublishFolders/usePublishFolders.d.ts.map +0 -1
  101. package/conversation/announcement-message.d.ts +0 -34
  102. package/conversation/announcement-message.d.ts.map +0 -1
  103. package/conversation/conversation-transfer/async.d.ts +0 -10
  104. package/conversation/conversation-transfer/async.d.ts.map +0 -1
  105. package/conversation/conversation-transfer/attachment-refs.d.ts +0 -12
  106. package/conversation/conversation-transfer/attachment-refs.d.ts.map +0 -1
  107. package/conversation/conversation-transfer/build-upload-path.d.ts +0 -40
  108. package/conversation/conversation-transfer/build-upload-path.d.ts.map +0 -1
  109. package/conversation/conversation-transfer/date.d.ts +0 -5
  110. package/conversation/conversation-transfer/date.d.ts.map +0 -1
  111. package/conversation/conversation-transfer/dial-file-resolve.d.ts +0 -10
  112. package/conversation/conversation-transfer/dial-file-resolve.d.ts.map +0 -1
  113. package/conversation/conversation-transfer/export-conversation.d.ts +0 -8
  114. package/conversation/conversation-transfer/export-conversation.d.ts.map +0 -1
  115. package/conversation/conversation-transfer/import-conversation.d.ts +0 -82
  116. package/conversation/conversation-transfer/import-conversation.d.ts.map +0 -1
  117. package/conversation/conversation-transfer/progress.d.ts +0 -60
  118. package/conversation/conversation-transfer/progress.d.ts.map +0 -1
  119. package/conversation/conversation-transfer/queue.d.ts +0 -54
  120. package/conversation/conversation-transfer/queue.d.ts.map +0 -1
  121. package/conversation/conversation-transfer/types.d.ts +0 -36
  122. package/conversation/conversation-transfer/types.d.ts.map +0 -1
  123. package/conversation/conversation-transfer/zip-export.d.ts +0 -31
  124. package/conversation/conversation-transfer/zip-export.d.ts.map +0 -1
  125. package/conversation/conversation-transfer/zip-import.d.ts +0 -17
  126. package/conversation/conversation-transfer/zip-import.d.ts.map +0 -1
  127. package/conversation/create-chat-stream-api.d.ts +0 -38
  128. package/conversation/create-chat-stream-api.d.ts.map +0 -1
  129. package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +0 -39
  130. package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +0 -1
  131. package/conversation/display-name-watch.d.ts +0 -4
  132. package/conversation/display-name-watch.d.ts.map +0 -1
  133. package/conversation/footer-message.d.ts +0 -10
  134. package/conversation/footer-message.d.ts.map +0 -1
  135. package/conversation/get-model-id-from-conversation-id.d.ts +0 -27
  136. package/conversation/get-model-id-from-conversation-id.d.ts.map +0 -1
  137. package/conversation/greeting.d.ts +0 -18
  138. package/conversation/greeting.d.ts.map +0 -1
  139. package/conversation/message-factory.d.ts +0 -7
  140. package/conversation/message-factory.d.ts.map +0 -1
  141. package/conversation/message-utils.d.ts +0 -27
  142. package/conversation/message-utils.d.ts.map +0 -1
  143. package/conversation/overlay-messages.d.ts +0 -5
  144. package/conversation/overlay-messages.d.ts.map +0 -1
  145. package/conversation/quick-app-conversation-starters.d.ts +0 -10
  146. package/conversation/quick-app-conversation-starters.d.ts.map +0 -1
  147. package/conversation/starter-option.d.ts +0 -21
  148. package/conversation/starter-option.d.ts.map +0 -1
  149. package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +0 -34
  150. package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +0 -1
  151. package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +0 -46
  152. package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +0 -1
  153. package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts +0 -26
  154. package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts.map +0 -1
  155. package/conversation/useConversationExport/useConversationExport.d.ts +0 -72
  156. package/conversation/useConversationExport/useConversationExport.d.ts.map +0 -1
  157. package/conversation/useConversationHandlers/attachment-to-dto.d.ts +0 -7
  158. package/conversation/useConversationHandlers/attachment-to-dto.d.ts.map +0 -1
  159. package/conversation/useConversationHandlers/message-factory.d.ts +0 -9
  160. package/conversation/useConversationHandlers/message-factory.d.ts.map +0 -1
  161. package/conversation/useConversationHandlers/message-utils.d.ts +0 -14
  162. package/conversation/useConversationHandlers/message-utils.d.ts.map +0 -1
  163. package/conversation/useConversationHandlers/starter-option.d.ts +0 -14
  164. package/conversation/useConversationHandlers/starter-option.d.ts.map +0 -1
  165. package/conversation/useConversationHandlers/useConversationHandlers.d.ts +0 -66
  166. package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +0 -1
  167. package/conversation/useConversationImport/useConversationImport.d.ts +0 -53
  168. package/conversation/useConversationImport/useConversationImport.d.ts.map +0 -1
  169. package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +0 -24
  170. package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +0 -1
  171. package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +0 -58
  172. package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +0 -1
  173. package/conversation/useConversationScroll/useConversationScroll.d.ts.map +0 -1
  174. package/conversation/useConversationStream/apply-chunk.d.ts +0 -20
  175. package/conversation/useConversationStream/apply-chunk.d.ts.map +0 -1
  176. package/conversation/useConversationStream/buffered-generation.d.ts +0 -15
  177. package/conversation/useConversationStream/buffered-generation.d.ts.map +0 -1
  178. package/conversation/useConversationStream/conversation-path.d.ts +0 -7
  179. package/conversation/useConversationStream/conversation-path.d.ts.map +0 -1
  180. package/conversation/useConversationStream/generation-resume.d.ts +0 -39
  181. package/conversation/useConversationStream/generation-resume.d.ts.map +0 -1
  182. package/conversation/useConversationStream/useConversationStream.d.ts +0 -92
  183. package/conversation/useConversationStream/useConversationStream.d.ts.map +0 -1
  184. package/conversation/useImportFilePicker/useImportFilePicker.d.ts +0 -32
  185. package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +0 -1
  186. package/conversation-sources/useConversationSources/useConversationSources.d.ts.map +0 -1
  187. package/files/annotation.d.ts +0 -10
  188. package/files/annotation.d.ts.map +0 -1
  189. package/files/attachment-canvas.d.ts +0 -104
  190. package/files/attachment-canvas.d.ts.map +0 -1
  191. package/files/attachment-dto-to-display.d.ts +0 -10
  192. package/files/attachment-dto-to-display.d.ts.map +0 -1
  193. package/files/attachment-types.d.ts +0 -14
  194. package/files/attachment-types.d.ts.map +0 -1
  195. package/files/create-files-api.d.ts +0 -52
  196. package/files/create-files-api.d.ts.map +0 -1
  197. package/files/create-upload-file-with-progress.d.ts +0 -24
  198. package/files/create-upload-file-with-progress.d.ts.map +0 -1
  199. package/files/dial-file-manager-copy-move.util.d.ts +0 -15
  200. package/files/dial-file-manager-copy-move.util.d.ts.map +0 -1
  201. package/files/dial-file-manager-mapping.util.d.ts +0 -35
  202. package/files/dial-file-manager-mapping.util.d.ts.map +0 -1
  203. package/files/dial-file-manager-path.util.d.ts +0 -39
  204. package/files/dial-file-manager-path.util.d.ts.map +0 -1
  205. package/files/dial-file-manager.model.d.ts +0 -26
  206. package/files/dial-file-manager.model.d.ts.map +0 -1
  207. package/files/dial-file-manager.types.d.ts +0 -317
  208. package/files/dial-file-manager.types.d.ts.map +0 -1
  209. package/files/dial-file-to-attachment.d.ts +0 -26
  210. package/files/dial-file-to-attachment.d.ts.map +0 -1
  211. package/files/dial-file.d.ts +0 -17
  212. package/files/dial-file.d.ts.map +0 -1
  213. package/files/dial-files-api.d.ts +0 -71
  214. package/files/dial-files-api.d.ts.map +0 -1
  215. package/files/download-destination.d.ts +0 -31
  216. package/files/download-destination.d.ts.map +0 -1
  217. package/files/file-manager-variant.d.ts +0 -4
  218. package/files/file-manager-variant.d.ts.map +0 -1
  219. package/files/file-name.d.ts +0 -19
  220. package/files/file-name.d.ts.map +0 -1
  221. package/files/prepare-download-destination.d.ts +0 -8
  222. package/files/prepare-download-destination.d.ts.map +0 -1
  223. package/files/resolve-dial-file-api-path.d.ts +0 -13
  224. package/files/resolve-dial-file-api-path.d.ts.map +0 -1
  225. package/files/useDialFileListing/useDialFileListing.d.ts +0 -73
  226. package/files/useDialFileListing/useDialFileListing.d.ts.map +0 -1
  227. package/files/useDialFileManager/useDialFileManager.d.ts +0 -16
  228. package/files/useDialFileManager/useDialFileManager.d.ts.map +0 -1
  229. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +0 -14
  230. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +0 -1
  231. package/files/useDialFileMetadata/useDialFileMetadata.d.ts +0 -28
  232. package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +0 -1
  233. package/files/useDialFileMutations/useDialFileMutations.d.ts +0 -68
  234. package/files/useDialFileMutations/useDialFileMutations.d.ts.map +0 -1
  235. package/files/useDialFileSharing/useDialFileSharing.d.ts +0 -30
  236. package/files/useDialFileSharing/useDialFileSharing.d.ts.map +0 -1
  237. package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +0 -45
  238. package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +0 -1
  239. package/index.d.ts.map +0 -1
  240. package/oauth/authorize-url.d.ts +0 -16
  241. package/oauth/authorize-url.d.ts.map +0 -1
  242. package/oauth/handshake.d.ts +0 -30
  243. package/oauth/handshake.d.ts.map +0 -1
  244. package/oauth/models.d.ts +0 -81
  245. package/oauth/models.d.ts.map +0 -1
  246. package/oauth/popup.d.ts +0 -30
  247. package/oauth/popup.d.ts.map +0 -1
  248. package/oauth/toolset-id.d.ts +0 -23
  249. package/oauth/toolset-id.d.ts.map +0 -1
  250. package/oauth/types.d.ts +0 -84
  251. package/oauth/types.d.ts.map +0 -1
  252. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +0 -54
  253. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +0 -1
  254. package/oauth/useToolsetLogin/useToolsetLogin.d.ts +0 -79
  255. package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +0 -1
  256. package/prompt/export-prompt.d.ts +0 -31
  257. package/prompt/export-prompt.d.ts.map +0 -1
  258. package/prompt/prompt-resource.d.ts +0 -30
  259. package/prompt/prompt-resource.d.ts.map +0 -1
  260. package/prompt/prompt.d.ts +0 -34
  261. package/prompt/prompt.d.ts.map +0 -1
  262. package/prompt/usePromptsState/usePromptsState.d.ts +0 -34
  263. package/prompt/usePromptsState/usePromptsState.d.ts.map +0 -1
  264. package/scheduled-task/scheduled-task-mapping.d.ts +0 -19
  265. package/scheduled-task/scheduled-task-mapping.d.ts.map +0 -1
  266. package/scheduled-task/scheduled-task-trigger.d.ts.map +0 -1
  267. package/shared/application-schema.d.ts +0 -10
  268. package/shared/application-schema.d.ts.map +0 -1
  269. package/shared/browser-timezone.d.ts +0 -7
  270. package/shared/browser-timezone.d.ts.map +0 -1
  271. package/shared/cron-weekday.d.ts +0 -5
  272. package/shared/cron-weekday.d.ts.map +0 -1
  273. package/shared/custom-apps.d.ts +0 -7
  274. package/shared/custom-apps.d.ts.map +0 -1
  275. package/shared/external-services.d.ts +0 -16
  276. package/shared/external-services.d.ts.map +0 -1
  277. package/shared/formatting.d.ts +0 -5
  278. package/shared/formatting.d.ts.map +0 -1
  279. package/shared/locale.d.ts +0 -45
  280. package/shared/locale.d.ts.map +0 -1
  281. package/shared/string-utils.d.ts +0 -9
  282. package/shared/string-utils.d.ts.map +0 -1
  283. package/shared/toolset-login-events.d.ts +0 -15
  284. package/shared/toolset-login-events.d.ts.map +0 -1
  285. package/skill/skill-file-batch-validation.d.ts +0 -70
  286. package/skill/skill-file-batch-validation.d.ts.map +0 -1
  287. package/skill/skill-file-preview.d.ts +0 -25
  288. package/skill/skill-file-preview.d.ts.map +0 -1
  289. package/skill/skill-manifest.d.ts +0 -28
  290. package/skill/skill-manifest.d.ts.map +0 -1
  291. package/skill/skill-types.d.ts +0 -42
  292. package/skill/skill-types.d.ts.map +0 -1
  293. package/skill/skill.d.ts +0 -114
  294. package/skill/skill.d.ts.map +0 -1
  295. package/skill/useSkillEditorLoad.d.ts +0 -74
  296. package/skill/useSkillEditorLoad.d.ts.map +0 -1
  297. package/skill/useSkillEditorSubmit.d.ts +0 -105
  298. package/skill/useSkillEditorSubmit.d.ts.map +0 -1
  299. package/skill/useSkillFileActions.d.ts +0 -53
  300. package/skill/useSkillFileActions.d.ts.map +0 -1
  301. package/skill/useSkillFilePreview.d.ts +0 -38
  302. package/skill/useSkillFilePreview.d.ts.map +0 -1
  303. package/skill/useSkillsState/useSkillsState.d.ts.map +0 -1
  304. package/test-setup.d.ts +0 -2
  305. package/test-setup.d.ts.map +0 -1
  306. package/usage/useUsageData/useUsageData.d.ts +0 -20
  307. package/usage/useUsageData/useUsageData.d.ts.map +0 -1
  308. package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts +0 -128
  309. package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts.map +0 -1
  310. package/usePageFileDrag/usePageFileDrag.d.ts.map +0 -1
  311. package/usePanelMaxWidth/usePanelMaxWidth.d.ts +0 -6
  312. package/usePanelMaxWidth/usePanelMaxWidth.d.ts.map +0 -1
  313. package/useShareLink/useShareLink.d.ts +0 -23
  314. package/useShareLink/useShareLink.d.ts.map +0 -1
  315. package/useShareRecipientsCount/useShareRecipientsCount.d.ts.map +0 -1
  316. package/useToolsMenu/useToolsMenu.d.ts +0 -31
  317. package/useToolsMenu/useToolsMenu.d.ts.map +0 -1
  318. package/useViewportWidth/useViewportWidth.d.ts +0 -3
  319. package/useViewportWidth/useViewportWidth.d.ts.map +0 -1
@@ -1,44 +1,88 @@
1
- import { AttachmentErrorReason, Attachment } from '@epam/ai-dial-chat-shared';
2
- /** Reason a rejected attachment failed validation. */
3
- export declare enum AttachmentValidationErrorReason {
4
- /** No MIME types are allowed at all — attachments are disabled entirely. */
5
- NoTypesAllowed = "noTypesAllowed",
6
- /** The attachment's content type is not among the allowed MIME types. */
7
- UnsupportedType = "unsupportedType"
8
- }
9
- /** Structured, translation-free report of a rejected attachment, emitted at most once per debounce window. */
10
- export interface AttachmentValidationErrorEvent {
11
- /** Why the attachment(s) were rejected. */
12
- reason: AttachmentValidationErrorReason;
13
- /** The resolved MIME types the caller currently allows (possibly empty). */
14
- allowedMimeTypes: string[];
15
- /** Already-formatted, non-translated extension list (e.g. ".png, .jpg"), present only when `reason` is `UnsupportedType`. */
16
- formats?: string;
17
- }
18
- /** Parameters for {@link useAttachmentValidation}. */
19
- export interface UseAttachmentValidationParams {
20
- /** Resolved MIME types currently allowed for attachments. */
21
- allowedMimeTypes: string[];
22
- /** Called with a structured event when a rejected attachment is reported, at most once per debounce window. */
23
- onValidationError?: (event: AttachmentValidationErrorEvent) => void;
24
- /** Debounce window, in ms, before firing `onValidationError` for a rejected file. Defaults to `100`. */
25
- debounceMs?: number;
26
- }
27
- /** Return value of {@link useAttachmentValidation}. */
28
- export interface UseAttachmentValidationResult {
29
- /** The resolved MIME types currently allowed for attachments (echoes the `allowedMimeTypes` param). */
30
- inputAttachmentTypes: string[];
31
- /** Whether at least one MIME type is currently allowed. */
32
- isAttachmentsAllowed: boolean;
33
- /** Classifies an attachment as allowed (`undefined`) or rejected (`AttachmentErrorReason`). */
34
- validateAttachment: (attachment: Attachment) => AttachmentErrorReason | undefined;
35
- /** `<input accept>` string derived from `allowedMimeTypes`, or `undefined` when any type accepts everything. */
36
- fileAccept: string | undefined;
37
- }
38
- /**
39
- * Validates an attachment's content type against a resolved list of allowed
40
- * MIME types, debouncing a burst of rejected files into a single
41
- * `onValidationError` call rather than firing one per file.
42
- */
43
- export declare const useAttachmentValidation: ({ allowedMimeTypes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
44
- //# sourceMappingURL=useAttachmentValidation.d.ts.map
1
+ import { Attachment } from '@epam/ai-dial-chat-shared';
2
+ import { AttachmentErrorReason } from '@epam/ai-dial-chat-shared';
3
+ import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
4
+
5
+ /** Structured, translation-free report of a rejected attachment, emitted at most once per debounce window. */
6
+ export declare interface AttachmentValidationErrorEvent {
7
+ /** Why the attachment(s) were rejected. */
8
+ reason: AttachmentValidationErrorReason;
9
+ /** The resolved MIME types the caller currently allows (possibly empty). */
10
+ allowedMimeTypes: string[];
11
+ /** Already-formatted, non-translated extension list (e.g. ".png, .jpg"), present only when `reason` is `UnsupportedType`. */
12
+ formats?: string;
13
+ }
14
+
15
+ /** Reason a rejected attachment failed validation. */
16
+ export declare enum AttachmentValidationErrorReason {
17
+ /** No MIME types are allowed at all — attachments are disabled entirely. */
18
+ NoTypesAllowed = "noTypesAllowed",
19
+ /** The attachment's content type is not among the allowed MIME types. */
20
+ UnsupportedType = "unsupportedType"
21
+ }
22
+
23
+ /**
24
+ * Downloads an attachment that carries its own content: a DIAL-hosted file
25
+ * (`url` resolves to a DIAL file id) or an inline `data` payload. Returns
26
+ * whether a download was actually triggered, so callers can skip
27
+ * non-downloadable (reference-only) attachments without duplicating the
28
+ * DIAL-file-id / URL-resolution checks.
29
+ */
30
+ export declare const downloadAttachment: (attachment: DisplayAttachment, resolveDownloadUrl: ResolveDownloadUrl) => boolean;
31
+
32
+ /** Returns true when `downloadAttachment` can trigger a download for `attachment`. */
33
+ export declare const isDownloadableAttachment: (attachment: DisplayAttachment) => boolean;
34
+
35
+ /** Resolves a DIAL Core file id to a downloadable URL. Host-owned — encodes the app's own file-download endpoint. */
36
+ export declare type ResolveDownloadUrl = (fileId: string) => string | undefined;
37
+
38
+ /**
39
+ * Default click behavior for a plain attachment tile: downloads DIAL-hosted
40
+ * and inline (`data`) files, and for reference-only attachments (no `url`/`data`,
41
+ * only `referenceUrl` — e.g. RAG/search-grounding chunks), opens a PDF
42
+ * `referenceUrl` in the canvas scrolled to its referenced page when present,
43
+ * otherwise opens/downloads the `referenceUrl` as-is.
44
+ */
45
+ export declare const useAttachmentAction: ({ resolveDownloadUrl, }: UseAttachmentActionParams) => UseAttachmentActionResult;
46
+
47
+ /** Parameters for {@link useAttachmentAction}. */
48
+ export declare interface UseAttachmentActionParams {
49
+ /** Resolves a DIAL Core file id to a downloadable URL. */
50
+ resolveDownloadUrl: ResolveDownloadUrl;
51
+ }
52
+
53
+ /** Return value of {@link useAttachmentAction}. */
54
+ export declare interface UseAttachmentActionResult {
55
+ /** Default click handler for an attachment tile: download, canvas-preview, or open-in-browser. */
56
+ handleAttachmentClick: (attachment: DisplayAttachment) => void;
57
+ }
58
+
59
+ /**
60
+ * Validates an attachment's content type against a resolved list of allowed
61
+ * MIME types, debouncing a burst of rejected files into a single
62
+ * `onValidationError` call rather than firing one per file.
63
+ */
64
+ export declare const useAttachmentValidation: ({ allowedMimeTypes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
65
+
66
+ /** Parameters for {@link useAttachmentValidation}. */
67
+ export declare interface UseAttachmentValidationParams {
68
+ /** Resolved MIME types currently allowed for attachments. */
69
+ allowedMimeTypes: string[];
70
+ /** Called with a structured event when a rejected attachment is reported, at most once per debounce window. */
71
+ onValidationError?: (event: AttachmentValidationErrorEvent) => void;
72
+ /** Debounce window, in ms, before firing `onValidationError` for a rejected file. Defaults to `100`. */
73
+ debounceMs?: number;
74
+ }
75
+
76
+ /** Return value of {@link useAttachmentValidation}. */
77
+ export declare interface UseAttachmentValidationResult {
78
+ /** The resolved MIME types currently allowed for attachments (echoes the `allowedMimeTypes` param). */
79
+ inputAttachmentTypes: string[];
80
+ /** Whether at least one MIME type is currently allowed. */
81
+ isAttachmentsAllowed: boolean;
82
+ /** Classifies an attachment as allowed (`undefined`) or rejected (`AttachmentErrorReason`). */
83
+ validateAttachment: (attachment: Attachment) => AttachmentErrorReason | undefined;
84
+ /** `<input accept>` string derived from `allowedMimeTypes`, or `undefined` when any type accepts everything. */
85
+ fileAccept: string | undefined;
86
+ }
87
+
88
+ export { }
package/attachments.js ADDED
@@ -0,0 +1,2 @@
1
+ import { a as e, i as t, n, r, t as i } from "./useAttachmentValidation-CkMTd5lA.js";
2
+ export { i as AttachmentValidationErrorReason, r as downloadAttachment, t as isDownloadableAttachment, e as useAttachmentAction, n as useAttachmentValidation };