@epam/ai-dial-chat-hooks 1.3.0-dev.98 → 1.3.0-rc.0

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 (545) hide show
  1. package/api-error/api-error.d.ts +2 -0
  2. package/api-error/api-error.d.ts.map +1 -1
  3. package/api-error/api-error.js +31 -23
  4. package/api-transport/create-unauthorized-middleware.js +4 -1
  5. package/attachment/attach-constraints.d.ts +31 -0
  6. package/attachment/attach-constraints.d.ts.map +1 -0
  7. package/attachment/attach-constraints.js +18 -0
  8. package/attachment/useAttachmentAction/useAttachmentAction.d.ts +1 -1
  9. package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
  10. package/attachment/useAttachmentAction/useAttachmentAction.js +25 -28
  11. package/attachments.js +2 -1
  12. package/catalog/application-credentials.d.ts +15 -0
  13. package/catalog/application-credentials.d.ts.map +1 -0
  14. package/catalog/application-credentials.js +28 -0
  15. package/catalog/catalog-derivations.d.ts +5 -3
  16. package/catalog/catalog-derivations.d.ts.map +1 -1
  17. package/catalog/catalog-derivations.js +13 -6
  18. package/catalog/catalog-entity-kind.d.ts +31 -0
  19. package/catalog/catalog-entity-kind.d.ts.map +1 -0
  20. package/catalog/catalog-entity-kind.js +21 -0
  21. package/catalog/catalog-preferences.d.ts +8 -0
  22. package/catalog/catalog-preferences.d.ts.map +1 -0
  23. package/catalog/catalog-preferences.js +5 -0
  24. package/catalog/create-publish-api.d.ts +3 -1
  25. package/catalog/create-publish-api.d.ts.map +1 -1
  26. package/catalog/create-publish-api.js +4 -0
  27. package/catalog/deployment-id.d.ts +13 -4
  28. package/catalog/deployment-id.d.ts.map +1 -1
  29. package/catalog/deployment-id.js +17 -3
  30. package/catalog/entity-details.d.ts +2 -0
  31. package/catalog/entity-details.d.ts.map +1 -1
  32. package/catalog/favorite-entity-type.d.ts +5 -0
  33. package/catalog/favorite-entity-type.d.ts.map +1 -0
  34. package/catalog/favorite-entity-type.js +10 -0
  35. package/catalog/map-deployment-limits-to-input.d.ts +4 -3
  36. package/catalog/map-deployment-limits-to-input.d.ts.map +1 -1
  37. package/catalog/map-deployment-limits-to-input.js +3 -4
  38. package/catalog/map-deployment-to-catalog-item.d.ts +12 -1
  39. package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -1
  40. package/catalog/map-deployment-to-catalog-item.js +22 -15
  41. package/catalog/map-entity-details-to-catalog.d.ts.map +1 -1
  42. package/catalog/map-entity-details-to-catalog.js +69 -24
  43. package/catalog/map-skill-to-catalog-item.d.ts +4 -5
  44. package/catalog/map-skill-to-catalog-item.d.ts.map +1 -1
  45. package/catalog/map-skill-to-catalog-item.js +29 -38
  46. package/catalog/publish.d.ts +1 -1
  47. package/catalog/publish.d.ts.map +1 -1
  48. package/catalog/resource-folder.d.ts +8 -0
  49. package/catalog/resource-folder.d.ts.map +1 -0
  50. package/catalog/resource-folder.js +13 -0
  51. package/catalog/resource-name-conflict.d.ts +22 -0
  52. package/catalog/resource-name-conflict.d.ts.map +1 -0
  53. package/catalog/resource-name-conflict.js +32 -0
  54. package/catalog/resource-save-adapter.d.ts +36 -0
  55. package/catalog/resource-save-adapter.d.ts.map +1 -0
  56. package/catalog/resource-save-adapter.js +4 -0
  57. package/catalog/resource-save-adapters.d.ts +93 -0
  58. package/catalog/resource-save-adapters.d.ts.map +1 -0
  59. package/catalog/resource-save-adapters.js +116 -0
  60. package/catalog/resource-save.d.ts +76 -0
  61. package/catalog/resource-save.d.ts.map +1 -0
  62. package/catalog/resource-save.js +52 -0
  63. package/catalog/unpublishable-folders.d.ts +21 -0
  64. package/catalog/unpublishable-folders.d.ts.map +1 -0
  65. package/catalog/unpublishable-folders.js +21 -0
  66. package/catalog/usage-limit-rows.d.ts +14 -0
  67. package/catalog/usage-limit-rows.d.ts.map +1 -0
  68. package/catalog/usage-limit-rows.js +19 -0
  69. package/catalog/use-publish-history.d.ts +19 -0
  70. package/catalog/use-publish-history.d.ts.map +1 -0
  71. package/catalog/use-publish-history.js +25 -0
  72. package/catalog/useApplicationCredentialActions/useApplicationCredentialActions.d.ts +57 -0
  73. package/catalog/useApplicationCredentialActions/useApplicationCredentialActions.d.ts.map +1 -0
  74. package/catalog/useApplicationCredentialActions/useApplicationCredentialActions.js +67 -0
  75. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.d.ts +15 -5
  76. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.d.ts.map +1 -1
  77. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +71 -89
  78. package/catalog/useCatalogItemDelete/useCatalogItemDelete.d.ts +41 -0
  79. package/catalog/useCatalogItemDelete/useCatalogItemDelete.d.ts.map +1 -0
  80. package/catalog/useCatalogItemDelete/useCatalogItemDelete.js +37 -0
  81. package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.d.ts.map +1 -1
  82. package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +72 -77
  83. package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +1 -1
  84. package/catalog/usePublishFolders/usePublishFolders.d.ts +8 -0
  85. package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
  86. package/catalog/usePublishFolders/usePublishFolders.js +32 -29
  87. package/catalog/useResourceFolders/useResourceFolders.d.ts +33 -0
  88. package/catalog/useResourceFolders/useResourceFolders.d.ts.map +1 -0
  89. package/catalog/useResourceFolders/useResourceFolders.js +58 -0
  90. package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +64 -0
  91. package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -0
  92. package/catalog/useResourceSavePanel/useResourceSavePanel.js +173 -0
  93. package/catalog/useSkillItemDetails.js +3 -3
  94. package/catalog/useUnpublishConfirmation/useUnpublishConfirmation.d.ts +43 -0
  95. package/catalog/useUnpublishConfirmation/useUnpublishConfirmation.d.ts.map +1 -0
  96. package/catalog/useUnpublishConfirmation/useUnpublishConfirmation.js +46 -0
  97. package/catalog/useUnpublishableFolders/useUnpublishableFolders.d.ts +22 -0
  98. package/catalog/useUnpublishableFolders/useUnpublishableFolders.d.ts.map +1 -0
  99. package/catalog/useUnpublishableFolders/useUnpublishableFolders.js +53 -0
  100. package/catalog.js +41 -23
  101. package/conversation/conversation-data-source.d.ts +47 -0
  102. package/conversation/conversation-data-source.d.ts.map +1 -0
  103. package/conversation/conversation-data-source.js +11 -0
  104. package/conversation/conversation-draft/conversation-draft-store.js +40 -40
  105. package/conversation/conversation-list.d.ts +6 -0
  106. package/conversation/conversation-list.d.ts.map +1 -0
  107. package/conversation/conversation-list.js +5 -0
  108. package/conversation/conversation-title-stream.d.ts +33 -0
  109. package/conversation/conversation-title-stream.d.ts.map +1 -0
  110. package/conversation/conversation-title-stream.js +103 -0
  111. package/conversation/conversation-transfer/attachment-refs.d.ts +10 -2
  112. package/conversation/conversation-transfer/attachment-refs.d.ts.map +1 -1
  113. package/conversation/conversation-transfer/attachment-refs.js +31 -9
  114. package/conversation/conversation-transfer/export-conversation.d.ts +5 -1
  115. package/conversation/conversation-transfer/export-conversation.d.ts.map +1 -1
  116. package/conversation/conversation-transfer/export-conversation.js +19 -18
  117. package/conversation/conversation-transfer/import-conversation.d.ts +11 -6
  118. package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -1
  119. package/conversation/conversation-transfer/import-conversation.js +65 -69
  120. package/conversation/conversation-transfer/progress.js +1 -1
  121. package/conversation/conversation-transfer/zip-export.js +1 -7
  122. package/conversation/conversation-transfer/zip-import.js +1 -1
  123. package/conversation/create-chat-stream-api.d.ts +18 -3
  124. package/conversation/create-chat-stream-api.d.ts.map +1 -1
  125. package/conversation/create-chat-stream-api.js +67 -61
  126. package/conversation/generation-registry.d.ts +30 -0
  127. package/conversation/generation-registry.d.ts.map +1 -0
  128. package/conversation/generation-registry.js +33 -0
  129. package/conversation/message-utils.d.ts +6 -0
  130. package/conversation/message-utils.d.ts.map +1 -1
  131. package/conversation/message-utils.js +14 -10
  132. package/conversation/scheduled-task-grouping.d.ts +53 -0
  133. package/conversation/scheduled-task-grouping.d.ts.map +1 -0
  134. package/conversation/scheduled-task-grouping.js +45 -0
  135. package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +4 -2
  136. package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -1
  137. package/conversation/useActiveConversationSync/useActiveConversationSync.js +19 -12
  138. package/conversation/useAttachmentUpload/useAttachmentUpload.d.ts.map +1 -1
  139. package/conversation/useAttachmentUpload/useAttachmentUpload.js +4 -1
  140. package/conversation/useConversationComposerDraft/useConversationComposerDraft.js +1 -5
  141. package/conversation/useConversationDiscovery/useConversationDiscovery.d.ts +22 -0
  142. package/conversation/useConversationDiscovery/useConversationDiscovery.d.ts.map +1 -0
  143. package/conversation/useConversationDiscovery/useConversationDiscovery.js +60 -0
  144. package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
  145. package/conversation/useConversationExport/useConversationExport.js +113 -122
  146. package/conversation/useConversationHandlers/message-utils.js +2 -2
  147. package/conversation/useConversationHandlers/useConversationHandlers.js +41 -41
  148. package/conversation/useConversationImport/useConversationImport.js +24 -24
  149. package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +18 -5
  150. package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -1
  151. package/conversation/useConversationPanelItems/useConversationPanelItems.js +34 -30
  152. package/conversation/useConversationScroll/useConversationScroll.d.ts.map +1 -1
  153. package/conversation/useConversationScroll/useConversationScroll.js +69 -72
  154. package/conversation/useConversationStream/conversation-path.js +2 -2
  155. package/conversation/useConversationStream/conversation-stream.types.d.ts +142 -0
  156. package/conversation/useConversationStream/conversation-stream.types.d.ts.map +1 -0
  157. package/conversation/useConversationStream/frame-scheduler.js +17 -17
  158. package/conversation/useConversationStream/generation-resume.d.ts +24 -2
  159. package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
  160. package/conversation/useConversationStream/generation-resume.js +110 -121
  161. package/conversation/useConversationStream/stream-errors.d.ts +10 -0
  162. package/conversation/useConversationStream/stream-errors.d.ts.map +1 -0
  163. package/conversation/useConversationStream/stream-errors.js +10 -0
  164. package/conversation/useConversationStream/stream-session.d.ts +51 -0
  165. package/conversation/useConversationStream/stream-session.d.ts.map +1 -0
  166. package/conversation/useConversationStream/stream-session.js +179 -0
  167. package/conversation/useConversationStream/useConversationReloadErrors.d.ts +25 -0
  168. package/conversation/useConversationStream/useConversationReloadErrors.d.ts.map +1 -0
  169. package/conversation/useConversationStream/useConversationReloadErrors.js +38 -0
  170. package/conversation/useConversationStream/useConversationStream.d.ts +3 -136
  171. package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
  172. package/conversation/useConversationStream/useConversationStream.js +141 -339
  173. package/conversation/useConversationStream/useStopGeneration.d.ts +29 -0
  174. package/conversation/useConversationStream/useStopGeneration.d.ts.map +1 -0
  175. package/conversation/useConversationStream/useStopGeneration.js +48 -0
  176. package/conversation/useConversationStream/useStreamPathState.d.ts +39 -0
  177. package/conversation/useConversationStream/useStreamPathState.d.ts.map +1 -0
  178. package/conversation/useConversationStream/useStreamPathState.js +55 -0
  179. package/conversation/useConversationTitleEnrichmentController.d.ts +64 -0
  180. package/conversation/useConversationTitleEnrichmentController.d.ts.map +1 -0
  181. package/conversation/useConversationTitleEnrichmentController.js +155 -0
  182. package/conversation/useDeploymentChangeTracking.d.ts +14 -0
  183. package/conversation/useDeploymentChangeTracking.d.ts.map +1 -0
  184. package/conversation/useDeploymentChangeTracking.js +23 -0
  185. package/conversation/useEntityPreselection/useEntityPreselection.d.ts +108 -0
  186. package/conversation/useEntityPreselection/useEntityPreselection.d.ts.map +1 -0
  187. package/conversation/useEntityPreselection/useEntityPreselection.js +78 -0
  188. package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +4 -10
  189. package/conversation/useTranscribeAudio/useTranscribeAudio.d.ts +8 -1
  190. package/conversation/useTranscribeAudio/useTranscribeAudio.d.ts.map +1 -1
  191. package/conversation/useTranscribeAudio/useTranscribeAudio.js +23 -17
  192. package/conversation/useVisibleConversationIdsReporter/useVisibleConversationIdsReporter.d.ts +16 -0
  193. package/conversation/useVisibleConversationIdsReporter/useVisibleConversationIdsReporter.d.ts.map +1 -0
  194. package/conversation/useVisibleConversationIdsReporter/useVisibleConversationIdsReporter.js +17 -0
  195. package/conversation-overlay.js +1 -2
  196. package/conversation-sources/stage-citations.d.ts +9 -0
  197. package/conversation-sources/stage-citations.d.ts.map +1 -0
  198. package/conversation-sources/stage-citations.js +8 -0
  199. package/conversation-sources/useConversationAnnotationPool/useConversationAnnotationPool.d.ts +4 -0
  200. package/conversation-sources/useConversationAnnotationPool/useConversationAnnotationPool.d.ts.map +1 -0
  201. package/conversation-sources/useConversationAnnotationPool/useConversationAnnotationPool.js +5 -0
  202. package/conversation-sources.js +3 -1
  203. package/conversation.js +45 -35
  204. package/entry-points/attachments.d.ts +1 -0
  205. package/entry-points/attachments.d.ts.map +1 -1
  206. package/entry-points/catalog.d.ts +17 -0
  207. package/entry-points/catalog.d.ts.map +1 -1
  208. package/entry-points/conversation-sources.d.ts +2 -0
  209. package/entry-points/conversation-sources.d.ts.map +1 -1
  210. package/entry-points/conversation.d.ts +10 -0
  211. package/entry-points/conversation.d.ts.map +1 -1
  212. package/entry-points/external-services.d.ts +6 -0
  213. package/entry-points/external-services.d.ts.map +1 -0
  214. package/entry-points/file-manager-canvas.d.ts +1 -0
  215. package/entry-points/file-manager-canvas.d.ts.map +1 -1
  216. package/entry-points/file-manager.d.ts +2 -0
  217. package/entry-points/file-manager.d.ts.map +1 -1
  218. package/entry-points/oauth.d.ts +1 -0
  219. package/entry-points/oauth.d.ts.map +1 -1
  220. package/entry-points/offline-credentials.d.ts +2 -0
  221. package/entry-points/offline-credentials.d.ts.map +1 -1
  222. package/entry-points/project.d.ts +20 -0
  223. package/entry-points/project.d.ts.map +1 -0
  224. package/entry-points/scheduled-tasks.d.ts +6 -0
  225. package/entry-points/scheduled-tasks.d.ts.map +1 -1
  226. package/entry-points/sharing.d.ts +4 -0
  227. package/entry-points/sharing.d.ts.map +1 -1
  228. package/entry-points/skill-editor.d.ts +2 -0
  229. package/entry-points/skill-editor.d.ts.map +1 -1
  230. package/entry-points/skills-state.d.ts +1 -0
  231. package/entry-points/skills-state.d.ts.map +1 -1
  232. package/entry-points/usage-limits.d.ts +1 -0
  233. package/entry-points/usage-limits.d.ts.map +1 -1
  234. package/entry-points/utils.d.ts +6 -0
  235. package/entry-points/utils.d.ts.map +1 -1
  236. package/entry-points/viewport-layout.d.ts +1 -0
  237. package/entry-points/viewport-layout.d.ts.map +1 -1
  238. package/external-services/useExternalServiceLogin.d.ts +99 -0
  239. package/external-services/useExternalServiceLogin.d.ts.map +1 -0
  240. package/external-services/useExternalServiceLogin.js +93 -0
  241. package/external-services.d.ts +2 -0
  242. package/external-services.js +5 -0
  243. package/file-manager-canvas.js +3 -2
  244. package/file-manager.js +32 -30
  245. package/files/attachment-canvas.d.ts +12 -0
  246. package/files/attachment-canvas.d.ts.map +1 -1
  247. package/files/attachment-canvas.js +18 -10
  248. package/files/attachment-dto-to-display.d.ts.map +1 -1
  249. package/files/attachment-dto-to-display.js +13 -12
  250. package/files/attachment-types.js +1 -1
  251. package/files/browser-download.d.ts +9 -0
  252. package/files/browser-download.d.ts.map +1 -0
  253. package/files/browser-download.js +23 -0
  254. package/files/create-files-api.d.ts +3 -4
  255. package/files/create-files-api.d.ts.map +1 -1
  256. package/files/create-files-api.js +1 -1
  257. package/files/create-upload-file-with-progress.d.ts +21 -1
  258. package/files/create-upload-file-with-progress.d.ts.map +1 -1
  259. package/files/create-upload-file-with-progress.js +50 -34
  260. package/files/dial-file-manager-copy-move.util.d.ts.map +1 -1
  261. package/files/dial-file-manager-copy-move.util.js +28 -28
  262. package/files/dial-file-manager-mapping.util.d.ts +6 -2
  263. package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
  264. package/files/dial-file-manager-mapping.util.js +85 -72
  265. package/files/dial-file-manager.types.d.ts +15 -5
  266. package/files/dial-file-manager.types.d.ts.map +1 -1
  267. package/files/dial-file-to-attachment.js +3 -3
  268. package/files/dial-file.d.ts +19 -0
  269. package/files/dial-file.d.ts.map +1 -1
  270. package/files/dial-file.js +20 -12
  271. package/files/dial-files-api.d.ts +2 -2
  272. package/files/dial-files-api.d.ts.map +1 -1
  273. package/files/download-progress.d.ts +33 -0
  274. package/files/download-progress.d.ts.map +1 -0
  275. package/files/download-progress.js +28 -0
  276. package/files/source-content.js +1 -1
  277. package/files/useDialFileListing/useDialFileListing.js +51 -66
  278. package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -1
  279. package/files/useDialFileManager/useDialFileManager.js +5 -2
  280. package/files/useDialFileManagerSections/useDialFileManagerSections.d.ts.map +1 -1
  281. package/files/useDialFileManagerSections/useDialFileManagerSections.js +59 -68
  282. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -1
  283. package/files/useDialFileMetadata/useDialFileMetadata.js +3 -3
  284. package/files/useDialFileMutations/useDialFileMutations.d.ts +9 -0
  285. package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -1
  286. package/files/useDialFileMutations/useDialFileMutations.js +232 -159
  287. package/files/useDialFilePreview/useDialFilePreview.d.ts +33 -0
  288. package/files/useDialFilePreview/useDialFilePreview.d.ts.map +1 -0
  289. package/files/useDialFilePreview/useDialFilePreview.js +45 -0
  290. package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -1
  291. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +114 -103
  292. package/files/useFileAttachmentModalState/useFileAttachmentModalState.d.ts +25 -0
  293. package/files/useFileAttachmentModalState/useFileAttachmentModalState.d.ts.map +1 -0
  294. package/files/useFileAttachmentModalState/useFileAttachmentModalState.js +19 -0
  295. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +2 -2
  296. package/files/useUnshareConfirmationState/useUnshareConfirmationState.d.ts +23 -0
  297. package/files/useUnshareConfirmationState/useUnshareConfirmationState.d.ts.map +1 -0
  298. package/files/useUnshareConfirmationState/useUnshareConfirmationState.js +18 -0
  299. package/index.d.ts +81 -0
  300. package/index.d.ts.map +1 -1
  301. package/index.js +244 -163
  302. package/mcp-apps/mcp-apps-api-client.d.ts.map +1 -1
  303. package/mcp-apps/mcp-apps-api-client.js +18 -17
  304. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts +3 -2
  305. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.d.ts.map +1 -1
  306. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +28 -10
  307. package/mcp-apps/useMcpAppTools/useMcpAppTools.d.ts.map +1 -1
  308. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +45 -45
  309. package/oauth/authorize-url.d.ts +7 -1
  310. package/oauth/authorize-url.d.ts.map +1 -1
  311. package/oauth/authorize-url.js +14 -4
  312. package/oauth/callback-exchange.d.ts +49 -0
  313. package/oauth/callback-exchange.d.ts.map +1 -0
  314. package/oauth/callback-exchange.js +29 -0
  315. package/oauth/handshake.js +3 -10
  316. package/oauth/models.d.ts +25 -0
  317. package/oauth/models.d.ts.map +1 -1
  318. package/oauth/toolset-id.d.ts +7 -0
  319. package/oauth/toolset-id.d.ts.map +1 -1
  320. package/oauth/toolset-id.js +9 -2
  321. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +2 -5
  322. package/oauth/useToolsetLogin/useToolsetLogin.d.ts +7 -1
  323. package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -1
  324. package/oauth/useToolsetLogin/useToolsetLogin.js +51 -42
  325. package/oauth.js +9 -8
  326. package/offline-credentials/map-offline-credentials-response.d.ts +5 -2
  327. package/offline-credentials/map-offline-credentials-response.d.ts.map +1 -1
  328. package/offline-credentials/map-offline-credentials-response.js +9 -7
  329. package/offline-credentials/scheduled-tasks-login-banner.d.ts +31 -0
  330. package/offline-credentials/scheduled-tasks-login-banner.d.ts.map +1 -0
  331. package/offline-credentials/scheduled-tasks-login-banner.js +17 -0
  332. package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.d.ts +5 -1
  333. package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.d.ts.map +1 -1
  334. package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.js +25 -22
  335. package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.js +13 -13
  336. package/offline-credentials.js +6 -4
  337. package/package.json +36 -26
  338. package/project/create-project-chat.d.ts +34 -0
  339. package/project/create-project-chat.d.ts.map +1 -0
  340. package/project/create-project-chat.js +27 -0
  341. package/project/project-conversation-data-source.d.ts +36 -0
  342. package/project/project-conversation-data-source.d.ts.map +1 -0
  343. package/project/project-conversation-data-source.js +67 -0
  344. package/project/project-events.d.ts +14 -0
  345. package/project/project-events.d.ts.map +1 -0
  346. package/project/project-events.js +25 -0
  347. package/project/project-file-preview.d.ts +32 -0
  348. package/project/project-file-preview.d.ts.map +1 -0
  349. package/project/project-file-preview.js +25 -0
  350. package/project/project-form-errors.d.ts +23 -0
  351. package/project/project-form-errors.d.ts.map +1 -0
  352. package/project/project-form-errors.js +46 -0
  353. package/project/project-limits.d.ts +17 -0
  354. package/project/project-limits.d.ts.map +1 -0
  355. package/project/project-limits.js +11 -0
  356. package/project/project-mapping.d.ts +16 -0
  357. package/project/project-mapping.d.ts.map +1 -0
  358. package/project/project-mapping.js +43 -0
  359. package/project/project-refresh.d.ts +12 -0
  360. package/project/project-refresh.d.ts.map +1 -0
  361. package/project/project-refresh.js +6 -0
  362. package/project/project-viewed-marks.d.ts +9 -0
  363. package/project/project-viewed-marks.d.ts.map +1 -0
  364. package/project/project-viewed-marks.js +8 -0
  365. package/project/project-watch-stream.d.ts +26 -0
  366. package/project/project-watch-stream.d.ts.map +1 -0
  367. package/project/project-watch-stream.js +39 -0
  368. package/project/projects-api-client.d.ts +179 -0
  369. package/project/projects-api-client.d.ts.map +1 -0
  370. package/project/projects-api-client.js +90 -0
  371. package/project/use-pinned-project-chats.d.ts +58 -0
  372. package/project/use-pinned-project-chats.d.ts.map +1 -0
  373. package/project/use-pinned-project-chats.js +269 -0
  374. package/project/use-project-actions.d.ts +53 -0
  375. package/project/use-project-actions.d.ts.map +1 -0
  376. package/project/use-project-actions.js +92 -0
  377. package/project/use-project-artifacts.d.ts +24 -0
  378. package/project/use-project-artifacts.d.ts.map +1 -0
  379. package/project/use-project-artifacts.js +78 -0
  380. package/project/use-project-conversations.d.ts +32 -0
  381. package/project/use-project-conversations.d.ts.map +1 -0
  382. package/project/use-project-conversations.js +200 -0
  383. package/project/use-project-draft.d.ts +46 -0
  384. package/project/use-project-draft.d.ts.map +1 -0
  385. package/project/use-project-draft.js +54 -0
  386. package/project/use-project-file-preview.d.ts +47 -0
  387. package/project/use-project-file-preview.d.ts.map +1 -0
  388. package/project/use-project-file-preview.js +50 -0
  389. package/project/use-project-submit.d.ts +49 -0
  390. package/project/use-project-submit.d.ts.map +1 -0
  391. package/project/use-project-submit.js +73 -0
  392. package/project/use-project-watch.d.ts +24 -0
  393. package/project/use-project-watch.d.ts.map +1 -0
  394. package/project/use-project-watch.js +41 -0
  395. package/project/use-project.d.ts +23 -0
  396. package/project/use-project.d.ts.map +1 -0
  397. package/project/use-project.js +73 -0
  398. package/project/use-projects.d.ts +27 -0
  399. package/project/use-projects.d.ts.map +1 -0
  400. package/project/use-projects.js +92 -0
  401. package/project.d.ts +2 -0
  402. package/project.js +20 -0
  403. package/prompt/prompt.d.ts +11 -0
  404. package/prompt/prompt.d.ts.map +1 -1
  405. package/prompt/prompt.js +7 -3
  406. package/scheduled-task/active-scheduled-task.d.ts +58 -0
  407. package/scheduled-task/active-scheduled-task.d.ts.map +1 -0
  408. package/scheduled-task/active-scheduled-task.js +18 -0
  409. package/scheduled-task/scheduled-task-description.d.ts +2 -0
  410. package/scheduled-task/scheduled-task-description.d.ts.map +1 -1
  411. package/scheduled-task/scheduled-task-description.js +33 -24
  412. package/scheduled-task/scheduled-task-display.d.ts +106 -0
  413. package/scheduled-task/scheduled-task-display.d.ts.map +1 -0
  414. package/scheduled-task/scheduled-task-display.js +69 -0
  415. package/scheduled-task/scheduled-task-next-occurrence.d.ts +9 -0
  416. package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -0
  417. package/scheduled-task/scheduled-task-next-occurrence.js +20 -0
  418. package/scheduled-task/scheduled-task-preparation.d.ts +1 -1
  419. package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
  420. package/scheduled-task/scheduled-task-trigger.js +75 -48
  421. package/scheduled-task/use-scheduled-task-runs.js +19 -31
  422. package/scheduled-task/use-scheduled-tasks.d.ts +2 -2
  423. package/scheduled-task/use-scheduled-tasks.js +1 -1
  424. package/scheduled-task/useActiveScheduledTaskDetails.d.ts +18 -0
  425. package/scheduled-task/useActiveScheduledTaskDetails.d.ts.map +1 -0
  426. package/scheduled-task/useActiveScheduledTaskDetails.js +40 -0
  427. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.d.ts +17 -0
  428. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.d.ts.map +1 -0
  429. package/scheduled-task/useScheduledTaskSkillDisplayNames/useScheduledTaskSkillDisplayNames.js +29 -0
  430. package/scheduled-task/useStartScheduledTask.d.ts +41 -0
  431. package/scheduled-task/useStartScheduledTask.d.ts.map +1 -0
  432. package/scheduled-task/useStartScheduledTask.js +169 -0
  433. package/scheduled-tasks.js +13 -7
  434. package/scroll-anchoring.js +1 -2
  435. package/share-invitation/models.d.ts +46 -0
  436. package/share-invitation/models.d.ts.map +1 -0
  437. package/share-invitation/share-invitation-error.d.ts +6 -0
  438. package/share-invitation/share-invitation-error.d.ts.map +1 -0
  439. package/share-invitation/share-invitation-error.js +37 -0
  440. package/share-invitation/types.d.ts +10 -0
  441. package/share-invitation/types.d.ts.map +1 -0
  442. package/share-invitation/types.js +6 -0
  443. package/share-invitation/useAcceptShareInvitation/useAcceptShareInvitation.d.ts +9 -0
  444. package/share-invitation/useAcceptShareInvitation/useAcceptShareInvitation.d.ts.map +1 -0
  445. package/share-invitation/useAcceptShareInvitation/useAcceptShareInvitation.js +26 -0
  446. package/shared/application-schema.js +3 -3
  447. package/shared/client-channel.d.ts +53 -0
  448. package/shared/client-channel.d.ts.map +1 -0
  449. package/shared/client-channel.js +6 -0
  450. package/shared/cron-day-of-month.js +10 -10
  451. package/shared/external-services.d.ts +1 -1
  452. package/shared/locale.d.ts +6 -2
  453. package/shared/locale.d.ts.map +1 -1
  454. package/shared/locale.js +4 -4
  455. package/shared/read-sse-events.d.ts +10 -0
  456. package/shared/read-sse-events.d.ts.map +1 -0
  457. package/shared/read-sse-events.js +33 -0
  458. package/shared/serialized-writer.d.ts +12 -0
  459. package/shared/serialized-writer.d.ts.map +1 -0
  460. package/shared/serialized-writer.js +44 -0
  461. package/shared/sleep.d.ts +3 -0
  462. package/shared/sleep.d.ts.map +1 -0
  463. package/shared/sleep.js +13 -0
  464. package/shared/theme-colors.d.ts +16 -0
  465. package/shared/theme-colors.d.ts.map +1 -0
  466. package/shared/theme-colors.js +14 -0
  467. package/shared/url-cleanup.d.ts +18 -0
  468. package/shared/url-cleanup.d.ts.map +1 -0
  469. package/shared/url-cleanup.js +18 -0
  470. package/shared/usage-stat.d.ts +3 -0
  471. package/shared/usage-stat.d.ts.map +1 -0
  472. package/shared/usage-stat.js +4 -0
  473. package/shared/useAppVersionCheck/useAppVersionCheck.d.ts +22 -0
  474. package/shared/useAppVersionCheck/useAppVersionCheck.d.ts.map +1 -0
  475. package/shared/useAppVersionCheck/useAppVersionCheck.js +36 -0
  476. package/shared/usePersistedState/usePersistedState.d.ts +28 -0
  477. package/shared/usePersistedState/usePersistedState.d.ts.map +1 -0
  478. package/shared/usePersistedState/usePersistedState.js +24 -0
  479. package/sharing.js +5 -2
  480. package/signin-interrupt/models.d.ts +48 -0
  481. package/signin-interrupt/models.d.ts.map +1 -0
  482. package/signin-interrupt/signin-row-info.d.ts +10 -0
  483. package/signin-interrupt/signin-row-info.d.ts.map +1 -0
  484. package/signin-interrupt/signin-row-info.js +21 -0
  485. package/signin-interrupt/types.d.ts +28 -0
  486. package/signin-interrupt/types.d.ts.map +1 -0
  487. package/signin-interrupt/types.js +10 -0
  488. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.d.ts +52 -0
  489. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.d.ts.map +1 -0
  490. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.js +270 -0
  491. package/skill/skill-file-batch-validation.d.ts +4 -0
  492. package/skill/skill-file-batch-validation.d.ts.map +1 -1
  493. package/skill/skill-file-batch-validation.js +34 -33
  494. package/skill/skill-lookup.d.ts +20 -0
  495. package/skill/skill-lookup.d.ts.map +1 -0
  496. package/skill/skill-lookup.js +12 -0
  497. package/skill/skill-types.js +1 -1
  498. package/skill/skill.d.ts +5 -1
  499. package/skill/skill.d.ts.map +1 -1
  500. package/skill/skill.js +27 -28
  501. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +1 -7
  502. package/skill/useSkillEditorSubmit.d.ts +15 -1
  503. package/skill/useSkillEditorSubmit.d.ts.map +1 -1
  504. package/skill/useSkillEditorSubmit.js +164 -87
  505. package/skill/useSkillFileActions.d.ts +2 -0
  506. package/skill/useSkillFileActions.d.ts.map +1 -1
  507. package/skill/useSkillFileActions.js +36 -21
  508. package/skill-editor/useSkillFilePreviewSyncController.d.ts +41 -0
  509. package/skill-editor/useSkillFilePreviewSyncController.d.ts.map +1 -0
  510. package/skill-editor/useSkillFilePreviewSyncController.js +58 -0
  511. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.d.ts +23 -0
  512. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.d.ts.map +1 -0
  513. package/skill-editor/useSkillFileSystemPicker/useSkillFileSystemPicker.js +43 -0
  514. package/skill-editor.js +11 -9
  515. package/skills-state.js +3 -2
  516. package/source-content.js +1 -2
  517. package/usage/map-user-usage-to-model-limits.d.ts.map +1 -1
  518. package/usage/map-user-usage-to-model-limits.js +24 -24
  519. package/usage/usage-banner-source.d.ts +8 -7
  520. package/usage/usage-banner-source.d.ts.map +1 -1
  521. package/usage/usage-banner-source.js +46 -21
  522. package/usage/usage-gauge.d.ts +3 -0
  523. package/usage/usage-gauge.d.ts.map +1 -0
  524. package/usage/usage-gauge.js +4 -0
  525. package/usage/usage-reset-time.d.ts +12 -3
  526. package/usage/usage-reset-time.d.ts.map +1 -1
  527. package/usage/usage-reset-time.js +48 -38
  528. package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.d.ts +42 -18
  529. package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.d.ts.map +1 -1
  530. package/usage/useDeploymentUsageLimits/useDeploymentUsageLimits.js +23 -28
  531. package/usage/useUsageLimitBanner/useUsageLimitBanner.d.ts +10 -8
  532. package/usage/useUsageLimitBanner/useUsageLimitBanner.d.ts.map +1 -1
  533. package/usage/useUsageLimitBanner/useUsageLimitBanner.js +28 -25
  534. package/usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.js +1 -1
  535. package/usage-limits.js +10 -8
  536. package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts +2 -0
  537. package/useChatSettingsFormConfig/useChatSettingsFormConfig.d.ts.map +1 -1
  538. package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +25 -21
  539. package/usePageFileDrag/usePageFileDrag.js +3 -3
  540. package/useShareLink/useShareLink.js +18 -18
  541. package/utils.js +23 -17
  542. package/viewport-layout/canvas-width.d.ts +39 -0
  543. package/viewport-layout/canvas-width.d.ts.map +1 -0
  544. package/viewport-layout/canvas-width.js +23 -0
  545. package/viewport-layout.js +2 -1
@@ -0,0 +1,64 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ /** Completion outcome of one incremental request. */
3
+ export declare enum ConversationTitleRequestEnd {
4
+ Complete = "complete",
5
+ Budget = "budget",
6
+ Unsupported = "unsupported",
7
+ Stopped = "stopped"
8
+ }
9
+ /** Minimal list row required for title reconciliation. */
10
+ export interface ConversationTitleItem {
11
+ /** Exact resource identity. */
12
+ id: string;
13
+ /** Current display title. */
14
+ title: string;
15
+ /** Whether the title still needs enrichment. */
16
+ isTitlePending?: boolean;
17
+ }
18
+ /** Outcome of an incremental transport call. */
19
+ export interface ConversationTitleTransportResult {
20
+ /** Completion or fallback outcome. */
21
+ end: ConversationTitleRequestEnd;
22
+ /** IDs with a terminal outcome, including missing titles. */
23
+ settledIds: readonly string[];
24
+ }
25
+ /** Host transports and scheduling policies. Keep this object stable. */
26
+ export interface ConversationTitleEnrichmentOptions {
27
+ /** Fetches one JSON batch. */
28
+ getTitles: (ids: string[], signal: AbortSignal) => Promise<{
29
+ items: {
30
+ id: string;
31
+ title: string;
32
+ }[];
33
+ }>;
34
+ /** Optional incremental transport; omitted for JSON-only hosts. */
35
+ streamTitles?: (ids: string[], signal: AbortSignal, onTitle: (id: string, title: string) => void) => Promise<ConversationTitleTransportResult>;
36
+ /** Maximum IDs in each JSON batch; must be positive. */
37
+ batchSize: number;
38
+ /** Maximum IDs in each incremental request; must be positive. */
39
+ maxIds: number;
40
+ /** Maximum encoded JSON-array bytes per incremental request. */
41
+ maxBytes: number;
42
+ /** Maximum delay before buffered titles flush. */
43
+ flushMs: number;
44
+ /** Maximum buffered title count; must be positive. */
45
+ maxPendingUpdates: number;
46
+ /** Duration for which local writes override remote snapshots. */
47
+ protectionMs: number;
48
+ /** Clock for local protection; defaults to Date.now. */
49
+ now?: () => number;
50
+ }
51
+ /** Resolves list titles without blocking the initial history response. */
52
+ export declare const useConversationTitleEnrichmentController: <T extends ConversationTitleItem>(identityScope: unknown, setConversations: Dispatch<SetStateAction<T[]>>, options: ConversationTitleEnrichmentOptions) => {
53
+ applyConversationList: (items: T[], requestedAtRevision: number) => void;
54
+ getTitleRevision: () => number;
55
+ rememberTitle: (id: string, title: string, options?: {
56
+ isWriting?: boolean;
57
+ protect?: boolean;
58
+ }) => void;
59
+ forgetTitle: (id: string, isPending?: boolean) => void;
60
+ restoreTitle: (id: string, title: string) => void;
61
+ setVisibleConversationIds: (viewKey: string, ids: string[] | null) => void;
62
+ isUpdatingTitles: boolean;
63
+ };
64
+ //# sourceMappingURL=useConversationTitleEnrichmentController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConversationTitleEnrichmentController.d.ts","sourceRoot":"","sources":["../../src/conversation/useConversationTitleEnrichmentController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAEf,qDAAqD;AACrD,oBAAY,2BAA2B;IACrC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;CACpB;AACD,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,gDAAgD;AAChD,MAAM,WAAW,gCAAgC;IAC/C,sCAAsC;IACtC,GAAG,EAAE,2BAA2B,CAAC;IACjC,6DAA6D;IAC7D,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AACD,wEAAwE;AACxE,MAAM,WAAW,kCAAkC;IACjD,8BAA8B;IAC9B,SAAS,EAAE,CACT,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC;QAAE,KAAK,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC,CAAC;IACzD,mEAAmE;IACnE,YAAY,CAAC,EAAE,CACb,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACzC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC/C,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AA2DD,0EAA0E;AAC1E,eAAO,MAAM,wCAAwC,GACnD,CAAC,SAAS,qBAAqB,EAE/B,eAAe,OAAO,EACtB,kBAAkB,QAAQ,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,EAC/C,SAAS,kCAAkC;mCAwFjC,CAAC,EAAE,uBAAuB,MAAM;;wBApClC,MAAM,SACH,MAAM,YACJ;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;sBAelB,MAAM;uBAUpC,MAAM,SAAS,MAAM;yCApChB,MAAM,OAAO,MAAM,EAAE,GAAG,IAAI;;CA+RzC,CAAC"}
@@ -0,0 +1,155 @@
1
+ import { useCallback as e, useLayoutEffect as t, useRef as n, useState as r } from "react";
2
+ //#region src/conversation/useConversationTitleEnrichmentController.ts
3
+ var i = /* @__PURE__ */ function(e) {
4
+ return e.Complete = "complete", e.Budget = "budget", e.Unsupported = "unsupported", e.Stopped = "stopped", e;
5
+ }({}), a = new TextEncoder(), o = (e, t, n) => {
6
+ let r = 2, i = [];
7
+ for (let o of e) {
8
+ if (i.length >= t) break;
9
+ let e = a.encode(JSON.stringify(o)).length + +!!i.length;
10
+ if (r + e > n) break;
11
+ r += e, i.push(o);
12
+ }
13
+ return i;
14
+ }, s = (e, t) => new Promise((n) => {
15
+ let r = () => {
16
+ cancelAnimationFrame(i), clearTimeout(a), e.removeEventListener("abort", r), n();
17
+ }, i = requestAnimationFrame(r), a = setTimeout(r, t);
18
+ e.addEventListener("abort", r, { once: !0 });
19
+ }), c = (e, t) => {
20
+ let n = new Set(e), r = /* @__PURE__ */ new Set();
21
+ for (let e of t.values()) for (let t of e) n.has(t) && r.add(t);
22
+ return r.size === 0 ? e : [...r, ...e.filter((e) => !r.has(e))];
23
+ }, l = (i, a, l) => {
24
+ let { getTitles: u, streamTitles: d, batchSize: f, maxIds: p, maxBytes: m, flushMs: h, maxPendingUpdates: g, protectionMs: _, now: v = Date.now } = l, y = n(null), b = n(/* @__PURE__ */ new Map()), x = n(/* @__PURE__ */ new Map()), S = n(/* @__PURE__ */ new Map()), C = n(/* @__PURE__ */ new Set()), w = n(0), T = n(!!d), E = n(/* @__PURE__ */ new Map()), [D, O] = r(!1);
25
+ t(() => (b.current.clear(), x.current.clear(), S.current.clear(), C.current.clear(), w.current = 0, E.current.clear(), T.current = !!d, O(!1), () => {
26
+ y.current?.abort(), y.current = null;
27
+ }), [i, d]);
28
+ let k = e(() => w.current, []), A = e((e, t) => {
29
+ t ? E.current.set(e, t) : E.current.delete(e);
30
+ }, []), j = e((e, t, n = {}) => {
31
+ let r = ++w.current;
32
+ x.current.set(e, r), b.current.set(e, {
33
+ title: t,
34
+ revision: r,
35
+ isWriting: n.isWriting,
36
+ protectedUntil: n.protect === !1 ? void 0 : v() + _
37
+ });
38
+ }, [v, _]), M = e((e, t = !1) => {
39
+ let n = ++w.current;
40
+ x.current.set(e, n), S.current.set(e, n), t ? C.current.add(e) : C.current.delete(e), b.current.delete(e);
41
+ }, []), N = e((e, t) => {
42
+ S.current.delete(e), C.current.delete(e), j(e, t, { protect: !1 });
43
+ }, [j]);
44
+ return {
45
+ applyConversationList: e((e, t) => {
46
+ y.current?.abort();
47
+ let n = new AbortController();
48
+ y.current = n;
49
+ let r = e.filter(({ id: e }) => !C.current.has(e) && (S.current.get(e) ?? 0) <= t);
50
+ for (let [e, n] of S.current) n <= t && !C.current.has(e) && S.current.delete(e);
51
+ let i = new Set(r.map(({ id: e }) => e));
52
+ for (let e of b.current.keys()) i.has(e) || b.current.delete(e);
53
+ for (let e of x.current.keys()) !i.has(e) && !S.current.has(e) && x.current.delete(e);
54
+ a(r.map((e) => {
55
+ let n = b.current.get(e.id);
56
+ return n && (e.isTitlePending || n.isWriting || (n.protectedUntil ?? 0) > v() || n.revision > t) ? {
57
+ ...e,
58
+ title: n.title,
59
+ ...(n.protectedUntil ?? 0) > v() || n.isWriting || n.revision > t ? { isTitlePending: !1 } : {}
60
+ } : (e.isTitlePending || b.current.set(e.id, {
61
+ title: e.title,
62
+ revision: x.current.get(e.id) ?? 0
63
+ }), e);
64
+ }));
65
+ let l = [...new Set(r.filter((e) => e.isTitlePending && !b.current.get(e.id)?.isWriting && (b.current.get(e.id)?.protectedUntil ?? 0) <= v() && (x.current.get(e.id) ?? 0) <= t).map((e) => e.id))], _ = new Map(l.map((e) => [e, x.current.get(e) ?? 0])), w = (e) => _.get(e) === (x.current.get(e) ?? 0), D = () => y.current === n && !n.signal.aborted;
66
+ O(l.length > 0);
67
+ let k = /* @__PURE__ */ new Map(), A, j, M = () => {
68
+ if (A !== void 0 && cancelAnimationFrame(A), clearTimeout(j), A = void 0, j = void 0, k.size === 0) return;
69
+ let e = new Map([...k].filter(([e]) => w(e)));
70
+ k.clear(), D() && e.size !== 0 && (e.forEach((e, t) => {
71
+ b.current.set(t, {
72
+ title: e,
73
+ revision: x.current.get(t) ?? 0
74
+ });
75
+ }), a((t) => {
76
+ if (!D()) return t;
77
+ let n = !1, r = t.map((t) => {
78
+ let r = e.get(t.id);
79
+ return r !== void 0 && w(t.id) && (t.title !== r || t.isTitlePending) ? (n = !0, {
80
+ ...t,
81
+ title: r,
82
+ isTitlePending: !1
83
+ }) : t;
84
+ });
85
+ return n ? r : t;
86
+ }));
87
+ };
88
+ n.signal.addEventListener("abort", M, { once: !0 });
89
+ let N = (e, t) => {
90
+ D() && w(e) && (k.set(e, t), k.size >= g ? M() : j === void 0 && (A = requestAnimationFrame(M), j = setTimeout(M, h)));
91
+ }, P = async (e) => {
92
+ for (let t = 0; t < e.length; t += f) {
93
+ if (!D()) return;
94
+ let r = e.slice(t, t + f).filter(w);
95
+ if (r.length !== 0) try {
96
+ let e = await u(r, n.signal);
97
+ if (!D()) return;
98
+ for (let { id: t, title: n } of e.items) r.includes(t) && N(t, n);
99
+ M();
100
+ } catch {
101
+ return;
102
+ }
103
+ }
104
+ }, F = async (e, t) => {
105
+ if (!d) return "unsupported";
106
+ try {
107
+ let r = new Set(e), i = await d(e, n.signal, (e, t) => {
108
+ D() && r.has(e) && N(e, t);
109
+ });
110
+ if (!D()) return "stopped";
111
+ for (let e of i.settledIds) r.has(e) && t.add(e);
112
+ return i.end;
113
+ } catch {
114
+ return "stopped";
115
+ }
116
+ };
117
+ (async () => {
118
+ let e = l;
119
+ try {
120
+ for (e.length > 0 && await s(n.signal, h); e.length > 0 && D();) {
121
+ if (e = c(e.filter(w), E.current), T.current === !1) {
122
+ await P(e);
123
+ return;
124
+ }
125
+ let t = o(e, p, m);
126
+ if (t.length === 0) return;
127
+ let r = /* @__PURE__ */ new Set(), i = await F(t, r);
128
+ if (i === "unsupported") y.current === n && (T.current = !1);
129
+ else if (e = e.filter((e) => !r.has(e)), i === "stopped" || r.size === 0) return;
130
+ }
131
+ } finally {
132
+ M(), y.current === n && O(!1);
133
+ }
134
+ })();
135
+ }, [
136
+ a,
137
+ u,
138
+ d,
139
+ f,
140
+ p,
141
+ m,
142
+ h,
143
+ g,
144
+ v
145
+ ]),
146
+ getTitleRevision: k,
147
+ rememberTitle: j,
148
+ forgetTitle: M,
149
+ restoreTitle: N,
150
+ setVisibleConversationIds: A,
151
+ isUpdatingTitles: D
152
+ };
153
+ };
154
+ //#endregion
155
+ export { i as ConversationTitleRequestEnd, l as useConversationTitleEnrichmentController };
@@ -0,0 +1,14 @@
1
+ /** Host selection and conversation lifecycle inputs. */
2
+ export interface DeploymentChangeTrackingOptions {
3
+ /** Active conversation identity; absent outside a conversation. */
4
+ conversationId: string | undefined;
5
+ /** Restored or user-selected deployment. */
6
+ selectedDeploymentId: string | null;
7
+ /** Whether conversation restoration has finished. */
8
+ isLoaded: boolean;
9
+ /** Reports user changes after restoration. */
10
+ onChange: (previous: string | null, next: string) => void;
11
+ }
12
+ /** Tracks user selection changes without treating conversation restoration as a change. */
13
+ export declare const useDeploymentChangeTracking: ({ conversationId, selectedDeploymentId, isLoaded, onChange, }: DeploymentChangeTrackingOptions) => void;
14
+ //# sourceMappingURL=useDeploymentChangeTracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDeploymentChangeTracking.d.ts","sourceRoot":"","sources":["../../src/conversation/useDeploymentChangeTracking.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,WAAW,+BAA+B;IAC9C,mEAAmE;IACnE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,4CAA4C;IAC5C,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D;AACD,2FAA2F;AAC3F,eAAO,MAAM,2BAA2B,GAAI,+DAKzC,+BAA+B,KAAG,IAoBpC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { useEffect as e, useRef as t } from "react";
2
+ //#region src/conversation/useDeploymentChangeTracking.ts
3
+ var n = ({ conversationId: n, selectedDeploymentId: r, isLoaded: i, onChange: a }) => {
4
+ let o = t(void 0);
5
+ e(() => {
6
+ if (!n || !i) {
7
+ o.current = void 0;
8
+ return;
9
+ }
10
+ let e = o.current;
11
+ o.current = {
12
+ conversationId: n,
13
+ deploymentId: r
14
+ }, e && e.conversationId === n && e.deploymentId !== r && r !== null && a(e.deploymentId, r);
15
+ }, [
16
+ n,
17
+ r,
18
+ i,
19
+ a
20
+ ]);
21
+ };
22
+ //#endregion
23
+ export { n as useDeploymentChangeTracking };
@@ -0,0 +1,108 @@
1
+ /** Sources whose arrival values may be consumed. */
2
+ export declare enum EntityPreselectionSource {
3
+ Deployment = "deployment",
4
+ Skill = "skill",
5
+ Prompt = "prompt"
6
+ }
7
+ /** Failure outcomes interpreted by the host. */
8
+ export declare enum EntityPreselectionOutcome {
9
+ DeploymentUnavailable = "deployment-unavailable",
10
+ DeploymentsLoadFailed = "deployments-load-failed",
11
+ SkillUnavailable = "skill-unavailable",
12
+ SkillsLoadFailed = "skills-load-failed",
13
+ PromptUnavailable = "prompt-unavailable"
14
+ }
15
+ /** Parsed arrival values; the controller captures these once per mount. */
16
+ export interface EntityPreselectionSnapshot {
17
+ /** Requested deployment identity. */
18
+ deploymentId: string | null;
19
+ /** Requested skill reference. */
20
+ skillId: string | null;
21
+ /** Requested prompt identity. */
22
+ promptId: string | null;
23
+ /** Sources already provided by the host, which take precedence. */
24
+ superseded: readonly EntityPreselectionSource[];
25
+ /** Disables all application, consumption and outcome side effects. */
26
+ isDisabled: boolean;
27
+ }
28
+ /** Structural prompt passed to the host's composer or parameter popup. */
29
+ export interface EntityPreselectionPrompt {
30
+ /** Canonical identity. */
31
+ id: string;
32
+ /** Display name. */
33
+ name: string;
34
+ /** Optional description. */
35
+ description?: string;
36
+ /** Prompt content. */
37
+ content: string;
38
+ }
39
+ /** A resolved skill mention. */
40
+ export interface EntityPreselectionSkill {
41
+ /** Canonical reference. */
42
+ url: string;
43
+ /** Resolved display name. */
44
+ name: string;
45
+ }
46
+ /** Loaded prompt and parameter policy. */
47
+ export interface EntityPreselectionPromptResult {
48
+ /** Resolved prompt. */
49
+ prompt: EntityPreselectionPrompt;
50
+ /** Whether the host must ask for parameter values. */
51
+ hasParameters: boolean;
52
+ }
53
+ /** Host actions for applying resolved entities. */
54
+ export interface EntityPreselectionSinks {
55
+ /** Selects a deployment without persisting a preference. */
56
+ restoreSelectedItemId: (id: string) => void;
57
+ /** Inserts a skill mention. */
58
+ selectSkillByUrl: (url: string) => void;
59
+ /** Seeds combined prompt text and skill references. */
60
+ seedSkillMentions: (content: string, entries: {
61
+ url: string;
62
+ }[] | undefined) => void;
63
+ /** Seeds plain prompt text. */
64
+ seedComposerText: (text: string) => void;
65
+ /** Opens a parameterized prompt. */
66
+ openParametersPopup: (prompt: EntityPreselectionPrompt) => void;
67
+ }
68
+ /** Host listings, loaders and side-effect adapters. */
69
+ export interface UseEntityPreselectionOptions {
70
+ /** Parsed arrival snapshot. */
71
+ snapshot: EntityPreselectionSnapshot;
72
+ /** Whether the deployment listing is pending. */
73
+ isDeploymentsLoading: boolean;
74
+ /** Whether deployment loading failed. */
75
+ deploymentsError: unknown;
76
+ /** Looks up an eligible deployment in the current listing. */
77
+ resolveDeployment: (id: string) => {
78
+ id: string;
79
+ } | undefined;
80
+ /** Whether skill listing is pending. */
81
+ isSkillsLoading: boolean;
82
+ /** Whether skill loading failed. */
83
+ skillsError: unknown;
84
+ /** Whether skills are available in this host. */
85
+ isSkillsEnabled: boolean;
86
+ /** Looks up a valid skill in current listings. */
87
+ resolveSkill: (id: string) => EntityPreselectionSkill | undefined;
88
+ /** Whether prompts are available in this host. */
89
+ isPromptsEnabled: boolean;
90
+ /** Loads and adapts a prompt; undefined means unavailable. */
91
+ loadPrompt: (id: string, signal: AbortSignal) => Promise<EntityPreselectionPromptResult | undefined>;
92
+ /** Application sinks, read from the latest committed render. */
93
+ sinks: EntityPreselectionSinks;
94
+ /** Consumes supplied arrival sources, leaving URL/router policy to the host. */
95
+ onConsume: (sources: EntityPreselectionSource[]) => void;
96
+ /** Reports a typed failure, optional host error and original identity. */
97
+ onOutcome: (outcome: EntityPreselectionOutcome, id: string, error?: unknown) => void;
98
+ }
99
+ /** Deployment override flags for default-selection coordination. */
100
+ export interface UseEntityPreselectionResult {
101
+ /** Pending or successfully applied deployment override. */
102
+ isDeploymentOverrideActive: boolean;
103
+ /** Deployment resolution has not settled yet. */
104
+ isDeploymentPending: boolean;
105
+ }
106
+ /** Applies arrival entities once, preserving source precedence and ignoring retired work. */
107
+ export declare const useEntityPreselection: (options: UseEntityPreselectionOptions) => UseEntityPreselectionResult;
108
+ //# sourceMappingURL=useEntityPreselection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntityPreselection.d.ts","sourceRoot":"","sources":["../../../src/conversation/useEntityPreselection/useEntityPreselection.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AACD,gDAAgD;AAChD,oBAAY,yBAAyB;IACnC,qBAAqB,2BAA2B;IAChD,qBAAqB,4BAA4B;IACjD,gBAAgB,sBAAsB;IACtC,gBAAgB,uBAAuB;IACvC,iBAAiB,uBAAuB;CACzC;AACD,2EAA2E;AAC3E,MAAM,WAAW,0BAA0B;IACzC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mEAAmE;IACnE,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAChD,sEAAsE;IACtE,UAAU,EAAE,OAAO,CAAC;CACrB;AACD,0EAA0E;AAC1E,MAAM,WAAW,wBAAwB;IACvC,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,gCAAgC;AAChC,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AACD,0CAA0C;AAC1C,MAAM,WAAW,8BAA8B;IAC7C,uBAAuB;IACvB,MAAM,EAAE,wBAAwB,CAAC;IACjC,sDAAsD;IACtD,aAAa,EAAE,OAAO,CAAC;CACxB;AACD,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,+BAA+B;IAC/B,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uDAAuD;IACvD,iBAAiB,EAAE,CACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,SAAS,KACnC,IAAI,CAAC;IACV,+BAA+B;IAC/B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,oCAAoC;IACpC,mBAAmB,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACjE;AACD,uDAAuD;AACvD,MAAM,WAAW,4BAA4B;IAC3C,+BAA+B;IAC/B,QAAQ,EAAE,0BAA0B,CAAC;IACrC,iDAAiD;IACjD,oBAAoB,EAAE,OAAO,CAAC;IAC9B,yCAAyC;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9D,wCAAwC;IACxC,eAAe,EAAE,OAAO,CAAC;IACzB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,eAAe,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,CAAC;IAClE,kDAAkD;IAClD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,8BAA8B,GAAG,SAAS,CAAC,CAAC;IACzD,gEAAgE;IAChE,KAAK,EAAE,uBAAuB,CAAC;IAC/B,gFAAgF;IAChF,SAAS,EAAE,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,IAAI,CAAC;IACzD,0EAA0E;IAC1E,SAAS,EAAE,CACT,OAAO,EAAE,yBAAyB,EAClC,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,OAAO,KACZ,IAAI,CAAC;CACX;AACD,oEAAoE;AACpE,MAAM,WAAW,2BAA2B;IAC1C,2DAA2D;IAC3D,0BAA0B,EAAE,OAAO,CAAC;IACpC,iDAAiD;IACjD,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAQD,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,GAChC,SAAS,4BAA4B,KACpC,2BAsLF,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { useEffect as e, useRef as t, useState as n } from "react";
2
+ //#region src/conversation/useEntityPreselection/useEntityPreselection.ts
3
+ var r = /* @__PURE__ */ function(e) {
4
+ return e.Deployment = "deployment", e.Skill = "skill", e.Prompt = "prompt", e;
5
+ }({}), i = /* @__PURE__ */ function(e) {
6
+ return e.DeploymentUnavailable = "deployment-unavailable", e.DeploymentsLoadFailed = "deployments-load-failed", e.SkillUnavailable = "skill-unavailable", e.SkillsLoadFailed = "skills-load-failed", e.PromptUnavailable = "prompt-unavailable", e;
7
+ }({}), a = (r) => {
8
+ let [i] = n(r.snapshot), a = (e, t) => !i.isDisabled && t !== null && !i.superseded.includes(e), [o, s] = n(() => a("deployment", i.deploymentId) ? "pending" : "idle"), [c, l] = n(() => ({ status: a("skill", i.skillId) ? "pending" : "idle" })), [u, d] = n(() => ({ status: a("prompt", i.promptId) ? "pending" : "idle" })), f = t(r);
9
+ e(() => {
10
+ f.current = r;
11
+ });
12
+ let p = t(!1), m = t(!1), h = t(!1), g = t(!1), _ = t(!1);
13
+ return e(() => {
14
+ if (i.isDisabled || p.current) return;
15
+ p.current = !0;
16
+ let e = {
17
+ deployment: i.deploymentId,
18
+ skill: i.skillId,
19
+ prompt: i.promptId
20
+ };
21
+ f.current.onConsume(i.superseded.filter((t) => !!e[t]));
22
+ }, [i]), e(() => {
23
+ if (o !== "pending" || r.isDeploymentsLoading || m.current) return;
24
+ m.current = !0;
25
+ let e = i.deploymentId ?? "", t = f.current, n = t.resolveDeployment(e);
26
+ n ? (t.sinks.restoreSelectedItemId(n.id), s("resolved")) : (t.onOutcome(t.deploymentsError == null ? "deployment-unavailable" : "deployments-load-failed", e), s("failed")), t.onConsume(["deployment"]);
27
+ }, [
28
+ o,
29
+ r.isDeploymentsLoading,
30
+ r.deploymentsError,
31
+ r.resolveDeployment,
32
+ i.deploymentId
33
+ ]), e(() => {
34
+ if (c.status !== "pending" || r.isSkillsLoading || h.current) return;
35
+ h.current = !0;
36
+ let e = i.skillId ?? "", t = f.current, n = t.isSkillsEnabled ? t.resolveSkill(e) : void 0;
37
+ n ? l({
38
+ status: "resolved",
39
+ value: n
40
+ }) : (t.onOutcome(t.isSkillsEnabled && t.skillsError != null ? "skills-load-failed" : "skill-unavailable", e), l({ status: "failed" }), t.onConsume(["skill"]));
41
+ }, [
42
+ c.status,
43
+ r.isSkillsLoading,
44
+ r.skillsError,
45
+ r.isSkillsEnabled,
46
+ r.resolveSkill,
47
+ i.skillId
48
+ ]), e(() => {
49
+ if (u.status !== "pending" || g.current) return;
50
+ let e = new AbortController(), t = i.promptId ?? "";
51
+ return (async () => {
52
+ let n, i;
53
+ try {
54
+ n = r.isPromptsEnabled ? await f.current.loadPrompt(t, e.signal) : void 0;
55
+ } catch (e) {
56
+ i = e;
57
+ }
58
+ e.signal.aborted || (g.current = !0, n ? d({
59
+ status: "resolved",
60
+ value: n
61
+ }) : (f.current.onOutcome("prompt-unavailable", t, i), d({ status: "failed" }), f.current.onConsume(["prompt"])));
62
+ })(), () => e.abort();
63
+ }, [
64
+ u.status,
65
+ r.isPromptsEnabled,
66
+ i.promptId
67
+ ]), e(() => {
68
+ if (_.current || c.status === "pending" || u.status === "pending" || !c.value && !u.value) return;
69
+ _.current = !0;
70
+ let { sinks: e, onConsume: t } = f.current, n = u.value?.prompt, r = [];
71
+ c.value && n ? (u.value?.hasParameters ? (e.selectSkillByUrl(c.value.url), e.openParametersPopup(n)) : e.seedSkillMentions(`/${c.value.name} ${n.content}`, [{ url: c.value.url }]), r.push("skill", "prompt")) : c.value ? (e.selectSkillByUrl(c.value.url), r.push("skill")) : n && (u.value?.hasParameters ? e.openParametersPopup(n) : e.seedComposerText(n.content), r.push("prompt")), t(r);
72
+ }, [c, u]), {
73
+ isDeploymentOverrideActive: o === "pending" || o === "resolved",
74
+ isDeploymentPending: o === "pending"
75
+ };
76
+ };
77
+ //#endregion
78
+ export { i as EntityPreselectionOutcome, r as EntityPreselectionSource, a as useEntityPreselection };
@@ -112,16 +112,10 @@ var o = "button,input,textarea,select,iframe,[role=\"button\"],[contenteditable=
112
112
  "End",
113
113
  "PageUp",
114
114
  "PageDown"
115
- ].includes(e.key) || (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a")) {
116
- r = !0, O(), _.current = null;
117
- return;
118
- }
119
- if (g.current) {
120
- if (e.key === "Escape") {
121
- O();
122
- return;
123
- }
124
- if (e.key === "Tab" && !e.shiftKey && !h.current?.contains(document.activeElement)) {
115
+ ].includes(e.key) || (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a")) r = !0, O(), _.current = null;
116
+ else if (g.current) {
117
+ if (e.key === "Escape") O();
118
+ else if (e.key === "Tab" && !e.shiftKey && !h.current?.contains(document.activeElement)) {
125
119
  let t = h.current?.querySelector("button");
126
120
  t && (e.preventDefault(), t.focus());
127
121
  }
@@ -6,8 +6,15 @@ export interface TranscribeWithDeploymentParams {
6
6
  deployment: string;
7
7
  signal: AbortSignal;
8
8
  }
9
+ /** Upload file MIME policy. */
10
+ export declare enum UploadMimeTypePolicy {
11
+ Preserve = "preserve",
12
+ Normalize = "normalize"
13
+ }
9
14
  /** Parameters for {@link useTranscribeAudio}. */
10
15
  export interface UseTranscribeAudioParams {
16
+ /** File upload MIME policy; defaults to preserve. */
17
+ uploadMimeTypePolicy?: UploadMimeTypePolicy;
11
18
  /** Already-configured generated-client instance used for the ASR-model path. */
12
19
  transcriptionApi?: Pick<TranscriptionApi, 'transcribeAudio'>;
13
20
  /** Already-configured generated-client instance used to upload the recording. */
@@ -39,5 +46,5 @@ export interface UseTranscribeAudioResult {
39
46
  * library's concern — callers translate `AudioTranscriptionErrorReason` at
40
47
  * the call site.
41
48
  */
42
- export declare const useTranscribeAudio: ({ transcriptionApi, filesApi, transcribeWithDeployment, bucket, asrModelId, selectedDeploymentId, maxSizeBytes, }: UseTranscribeAudioParams) => UseTranscribeAudioResult;
49
+ export declare const useTranscribeAudio: ({ transcriptionApi, filesApi, transcribeWithDeployment, bucket, asrModelId, selectedDeploymentId, maxSizeBytes, uploadMimeTypePolicy, }: UseTranscribeAudioParams) => UseTranscribeAudioResult;
43
50
  //# sourceMappingURL=useTranscribeAudio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTranscribeAudio.d.ts","sourceRoot":"","sources":["../../../src/conversation/useTranscribeAudio/useTranscribeAudio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAShF,6EAA6E;AAC7E,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7D,iFAAiF;IACjF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACvC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,CACzB,MAAM,EAAE,8BAA8B,KACnC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAClC,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,sGAAsG;IACtG,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,mHAQhC,wBAAwB,KAAG,wBAyE7B,CAAC"}
1
+ {"version":3,"file":"useTranscribeAudio.d.ts","sourceRoot":"","sources":["../../../src/conversation/useTranscribeAudio/useTranscribeAudio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAShF,6EAA6E;AAC7E,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,+BAA+B;AAC/B,oBAAY,oBAAoB;IAC9B,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,iDAAiD;AACjD,MAAM,WAAW,wBAAwB;IACvC,qDAAqD;IACrD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7D,iFAAiF;IACjF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACvC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,CACzB,MAAM,EAAE,8BAA8B,KACnC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAClC,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,sGAAsG;IACtG,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,yIAShC,wBAAwB,KAAG,wBAmF7B,CAAC"}
@@ -3,42 +3,48 @@ import { withTranscriptionRetry as n } from "./transcription-retry.js";
3
3
  import { normalizeMimeType as r } from "@epam/ai-dial-chat-shared";
4
4
  import { useCallback as i } from "react";
5
5
  //#region src/conversation/useTranscribeAudio/useTranscribeAudio.ts
6
- var a = ({ transcriptionApi: a, filesApi: o, transcribeWithDeployment: s, bucket: c, asrModelId: l, selectedDeploymentId: u, maxSizeBytes: d }) => ({ transcribeAudio: i(async (i, f) => {
7
- if (f.throwIfAborted(), !c || !l && !u) throw new e(t.Unavailable);
6
+ var a = /* @__PURE__ */ function(e) {
7
+ return e.Preserve = "preserve", e.Normalize = "normalize", e;
8
+ }({}), o = ({ transcriptionApi: a, filesApi: o, transcribeWithDeployment: s, bucket: c, asrModelId: l, selectedDeploymentId: u, maxSizeBytes: d, uploadMimeTypePolicy: f = "preserve" }) => ({ transcribeAudio: i(async (i, p) => {
9
+ if (p.throwIfAborted(), !c || !l && !u) throw new e(t.Unavailable);
8
10
  if (i.size > d) throw new e(t.TooLarge, d);
9
11
  try {
10
- let d = `uploads/${(/* @__PURE__ */ new Date()).toISOString().slice(0, 7)}/${encodeURIComponent(i.name)}`, { url: p } = await o.uploadFile({
12
+ let d = r(i.type), m = f === "normalize" && i.type !== d ? new File([i], i.name, {
13
+ type: d,
14
+ lastModified: i.lastModified
15
+ }) : i, h = `uploads/${(/* @__PURE__ */ new Date()).toISOString().slice(0, 7)}/${encodeURIComponent(i.name)}`, { url: g } = await o.uploadFile({
11
16
  bucket: c,
12
- path: d,
13
- file: i
14
- }, { signal: f });
15
- f.throwIfAborted();
16
- let m = r(i.type);
17
+ path: h,
18
+ file: m
19
+ }, { signal: p });
20
+ p.throwIfAborted();
21
+ let _ = r(i.type);
17
22
  if (l) {
18
23
  if (!a) throw new e(t.Unavailable);
19
24
  return await n(async () => (await a.transcribeAudio({ transcribeAudioDto: {
20
- audioUrl: p,
21
- mimeType: m
22
- } }, { signal: f })).transcript ?? "", f);
25
+ audioUrl: g,
26
+ mimeType: _
27
+ } }, { signal: p })).transcript ?? "", p);
23
28
  }
24
29
  if (!u || !s) throw new e(t.Unavailable);
25
30
  return await n(() => s({
26
- audioUrl: p,
27
- mimeType: m,
31
+ audioUrl: g,
32
+ mimeType: _,
28
33
  deployment: u,
29
- signal: f
30
- }), f);
34
+ signal: p
35
+ }), p);
31
36
  } catch (n) {
32
- throw f.aborted || n instanceof e ? n : new e(t.Failed);
37
+ throw p.aborted || n instanceof e ? n : new e(t.Failed);
33
38
  }
34
39
  }, [
35
40
  c,
36
41
  l,
37
42
  u,
38
43
  d,
44
+ f,
39
45
  o,
40
46
  a,
41
47
  s
42
48
  ]) });
43
49
  //#endregion
44
- export { a as useTranscribeAudio };
50
+ export { a as UploadMimeTypePolicy, o as useTranscribeAudio };
@@ -0,0 +1,16 @@
1
+ /** Parameters of `useVisibleConversationIdsReporter`. */
2
+ export interface UseVisibleConversationIdsReporterParams {
3
+ /** Conversations the view lists, by their list resource id. */
4
+ items: readonly {
5
+ id: string;
6
+ }[];
7
+ /** Whether the view is shown; a hidden view reports `null` but keeps its last ids. */
8
+ isVisible: boolean;
9
+ /** Maps a list resource id to the id the rendered panel reports. */
10
+ toPanelConversationId: (id: string) => string;
11
+ /** Registers this view's visible list ids, or `null` to withdraw them; usually from `useConversationTitleEnrichmentController`. */
12
+ setVisibleConversationIds: (viewKey: string, ids: string[] | null) => void;
13
+ }
14
+ /** Returns the panel's visible-ids callback, which registers the matching list ids under this view while it is visible. */
15
+ export declare const useVisibleConversationIdsReporter: ({ items, isVisible, toPanelConversationId, setVisibleConversationIds, }: UseVisibleConversationIdsReporterParams) => ((panelIds: string[]) => void);
16
+ //# sourceMappingURL=useVisibleConversationIdsReporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVisibleConversationIdsReporter.d.ts","sourceRoot":"","sources":["../../../src/conversation/useVisibleConversationIdsReporter/useVisibleConversationIdsReporter.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,MAAM,WAAW,uCAAuC;IACtD,+DAA+D;IAC/D,KAAK,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjC,sFAAsF;IACtF,SAAS,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,mIAAmI;IACnI,yBAAyB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5E;AAOD,2HAA2H;AAC3H,eAAO,MAAM,iCAAiC,GAAI,yEAK/C,uCAAuC,KAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAoCzE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i } from "react";
2
+ //#region src/conversation/useVisibleConversationIdsReporter/useVisibleConversationIdsReporter.ts
3
+ var a = ({ items: a, isVisible: o, toPanelConversationId: s, setVisibleConversationIds: c }) => {
4
+ let l = n(), u = r(() => new Map(a.map((e) => [s(e.id), e.id])), [a, s]), d = i([]), f = i(o), p = e(() => {
5
+ c(l, f.current ? d.current : null);
6
+ }, [c, l]), m = e((e) => {
7
+ d.current = e.flatMap((e) => {
8
+ let t = u.get(e);
9
+ return t ? [t] : [];
10
+ }), p();
11
+ }, [u, p]);
12
+ return t(() => {
13
+ f.current = o, p();
14
+ }, [o, p]), t(() => () => c(l, null), [c, l]), m;
15
+ };
16
+ //#endregion
17
+ export { a as useVisibleConversationIdsReporter };
@@ -1,2 +1 @@
1
- import { toOverlayMessages as e } from "./conversation/overlay-messages.js";
2
- export { e as toOverlayMessages };
1
+ export { toOverlayMessages } from "./conversation/overlay-messages.js";
@@ -0,0 +1,9 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ /**
3
+ * Returns `stages` with citation markup in each stage's `content` prepared
4
+ * for rendering (hidden while streaming, unsupported shapes escaped), keeping
5
+ * every stage without `<cit` markup — and the array itself when none has
6
+ * any — by reference so memoized stage rows are not re-rendered.
7
+ */
8
+ export declare const prepareStageCitations: (stages: Stage[], isStreaming: boolean) => Stage[];
9
+ //# sourceMappingURL=stage-citations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-citations.d.ts","sourceRoot":"","sources":["../../src/conversation-sources/stage-citations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,KAAK,EAAE,EACf,aAAa,OAAO,KACnB,KAAK,EAUP,CAAC"}