@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
@@ -1,350 +1,152 @@
1
- import { safeDecodeURI as e } from "../../shared/string-utils.js";
2
- import { DEFAULT_GENERATION_CONFLICT_MESSAGE as t, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as n, GenerationConflictError as r, GenerationPersistenceError as i, StopCompletionError as a, StreamInterruptedError as o, StreamUpstreamError as s } from "../create-chat-stream-api.js";
3
- import { getConversationPath as c } from "./conversation-path.js";
4
- import { applyChunkToMessages as l } from "./apply-chunk.js";
5
- import { restoreBufferedMessage as u } from "./buffered-generation.js";
6
- import { createResumeIfAwaitingGeneration as ee, fetchConversationForRecovery as te, findPendingBackgroundMessageIndex as d, hasGeneratedPayload as ne, isAwaitingGenerationResume as f } from "./generation-resume.js";
7
- import { createFrameScheduler as re } from "./frame-scheduler.js";
8
- import { MessageRole as p, generateUUID as ie } from "@epam/ai-dial-chat-shared";
9
- import { useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
10
- import { SendCompletionDtoModeEnum as y } from "@epam/ai-dial-chat-api-client";
1
+ import { DEFAULT_GENERATION_CONFLICT_MESSAGE as e, DEFAULT_GENERATION_INTERRUPTED_ERROR_MESSAGE as t, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as n } from "../create-chat-stream-api.js";
2
+ import { getConversationPath as r } from "./conversation-path.js";
3
+ import { restoreBufferedMessage as i } from "./buffered-generation.js";
4
+ import { createResumeIfAwaitingGeneration as a, isAwaitingGenerationResume as o } from "./generation-resume.js";
5
+ import { createFrameScheduler as s } from "./frame-scheduler.js";
6
+ import { findResumedBackgroundGenerationId as ee } from "./stream-errors.js";
7
+ import { runStreamSession as c } from "./stream-session.js";
8
+ import { useConversationReloadErrors as l } from "./useConversationReloadErrors.js";
9
+ import { useStopGeneration as te } from "./useStopGeneration.js";
10
+ import { useStreamPathState as ne } from "./useStreamPathState.js";
11
+ import { MessageRole as re } from "@epam/ai-dial-chat-shared";
12
+ import { useCallback as u, useEffect as d, useMemo as ie, useRef as f, useState as ae } from "react";
11
13
  //#region src/conversation/useConversationStream/useConversationStream.ts
12
- var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e instanceof s ? e.message : "", C = (e) => {
13
- if (!e) return;
14
- let t = d(e);
15
- return t === -1 ? void 0 : e.messages[t].backgroundGeneration?.generationId;
16
- }, w = ({ conversationId: s, state: { setConversation: w, conversationRef: T }, transport: E, generation: { startGeneration: ce, completeGeneration: le }, channel: D, overlay: O, onStopError: ue, generationConflictMessage: de = t, generationPersistenceErrorMessage: k = n, onStreamError: A, batchChunksPerFrame: j = !1 }) => {
17
- let fe = _(A);
18
- h(() => {
19
- fe.current = A;
20
- }, [A]);
21
- let pe = _(j);
22
- h(() => {
23
- pe.current = j;
24
- }, [j]);
25
- let [M] = v(re), [N, P] = v(() => /* @__PURE__ */ new Set()), F = _(N);
26
- F.current = N;
27
- let [I, me] = v(() => /* @__PURE__ */ new Set()), L = _(/* @__PURE__ */ new Map()), R = _(/* @__PURE__ */ new Set()), z = _(/* @__PURE__ */ new Map()), B = _(/* @__PURE__ */ new Set()), V = _(/* @__PURE__ */ new Set()), he = _(/* @__PURE__ */ new Map()), H = _(!0), U = _(/* @__PURE__ */ new Map()), [ge, W] = v(U.current), G = _(/* @__PURE__ */ new Set()), [_e, ve] = v(G.current);
28
- h(() => (H.current = !0, () => {
29
- H.current = !1;
14
+ var p = ({ conversationId: p, state: { setConversation: m, conversationRef: h }, transport: g, generation: { startGeneration: _, completeGeneration: v }, channel: y, overlay: b, onStopError: oe, generationConflictMessage: x = e, generationPersistenceErrorMessage: S = n, generationInterruptedMessage: C = t, onStreamError: w, batchChunksPerFrame: T = !1 }) => {
15
+ let E = f(w);
16
+ d(() => {
17
+ E.current = w;
18
+ }, [w]);
19
+ let D = f(T);
20
+ d(() => {
21
+ D.current = T;
22
+ }, [T]);
23
+ let [O] = ae(s), k = f(!0);
24
+ d(() => (k.current = !0, () => {
25
+ k.current = !1;
30
26
  }), []);
31
- let K = m((e) => {
32
- if (!U.current.has(e)) return;
33
- let t = new Map(U.current);
34
- t.delete(e), U.current = t, H.current && W(t);
35
- }, []), q = m((e, t, n) => {
36
- if (!H.current || !n()) return;
37
- let r = new Map(U.current);
38
- r.set(e, {
39
- retry: t,
40
- isCurrent: n
41
- }), U.current = r, W(r);
42
- }, []), ye = m(async () => {
43
- if (!s) return;
44
- let e = U.current.get(c(s));
45
- if (!(!e || !e.isCurrent() || G.current.has(e))) {
46
- G.current.add(e), ve(new Set(G.current));
47
- try {
48
- await e.retry();
49
- } finally {
50
- G.current.delete(e), H.current && ve(new Set(G.current));
51
- }
52
- }
53
- }, [s]), be = _(s);
54
- h(() => (be.current = s, () => M.cancelAll()), [s, M]);
55
- let J = m((e) => H.current && c(be.current ?? "") === e, []), Y = m((e) => {
56
- K(e), P((t) => {
57
- if (t.has(e)) return t;
58
- let n = new Set(t);
59
- return n.add(e), n;
60
- });
61
- }, [K]), X = m((e) => {
62
- P((t) => {
63
- if (!t.has(e)) return t;
64
- let n = new Set(t);
65
- return n.delete(e), n;
66
- });
67
- }, []), Z = m((e, t) => {
68
- me((n) => {
69
- if (n.has(e) === t) return n;
70
- let r = new Set(n);
71
- return t ? r.add(e) : r.delete(e), r;
72
- });
73
- }, []), xe = m((e, t) => {
74
- L.current.get(e) === t && (L.current.delete(e), Z(e, !1));
75
- }, [Z]), Q = g(() => ee({
76
- transport: E,
77
- setConversation: w,
78
- conversationRef: T,
79
- resumingPathsRef: R,
80
- bufferedGenerationsRef: z,
81
- addStreamingPath: Y,
82
- removeStreamingPath: X,
83
- isPathDisplayed: J,
84
- generationPersistenceErrorMessage: k,
85
- frameScheduler: j ? M : void 0,
86
- stoppedGenerationIdsRef: B,
87
- onReloadError: q,
88
- onReloadSuccess: K
27
+ let { reloadFailuresRef: A, reloadFailures: j, retrying: M, clearReloadError: N, reportReloadError: P, retryConversationReload: se } = l({
28
+ conversationId: p,
29
+ mountedRef: k
30
+ }), { streamingPaths: ce, streamingPathsRef: le, stoppablePaths: ue, activeGenerationIdsRef: F, resumedGenerationIdsRef: I, resumingPathsRef: L, bufferedGenerationsRef: R, stoppedGenerationIdsRef: z, stopRequestedIdsRef: B, latestGenerationIdsRef: V, isPathDisplayed: H, addStreamingPath: U, removeStreamingPath: W, setPathStoppable: G, releaseActiveGeneration: K, rememberResumedGenerationId: q, forgetResumedGenerationId: J } = ne({
31
+ conversationId: p,
32
+ frameScheduler: O,
33
+ mountedRef: k,
34
+ clearReloadError: N
35
+ }), Y = ie(() => a({
36
+ transport: g,
37
+ setConversation: m,
38
+ conversationRef: h,
39
+ resumingPathsRef: L,
40
+ bufferedGenerationsRef: R,
41
+ addStreamingPath: U,
42
+ removeStreamingPath: W,
43
+ isPathDisplayed: H,
44
+ generationPersistenceErrorMessage: S,
45
+ generationInterruptedMessage: C,
46
+ frameScheduler: T ? O : void 0,
47
+ stoppedGenerationIdsRef: z,
48
+ rememberResumedGenerationId: q,
49
+ forgetResumedGenerationId: J,
50
+ onReloadError: P,
51
+ onReloadSuccess: N
89
52
  }), [
90
- Y,
91
- X,
92
- J,
93
- E,
94
- k,
95
- j,
96
- M,
53
+ U,
54
+ W,
55
+ H,
56
+ g,
57
+ S,
58
+ C,
59
+ T,
60
+ O,
97
61
  q,
98
- K
99
- ]), Se = m((t, n, a, s, ee, re, m = y.Append, h = {}) => {
100
- let g = re ?? ie(), _ = c(t);
101
- M.flush(_), R.current.delete(_), L.current.set(_, g), he.current.set(_, g), Z(_, !0);
102
- let v;
103
- m === y.Regenerate ? v = a : m === y.Edit && (v = a - 1);
104
- let b = () => he.current.get(_) !== g, x = ce(_, g), S = T.current?.messages[a];
105
- S ? z.current.set(_, {
106
- generationId: g,
107
- messageIndex: a,
108
- message: S
109
- }) : z.current.delete(_), Y(_), O?.notifyGenerationStart?.(), D?.ensureConnected();
110
- let C = () => {
111
- b() || X(_), xe(_, g), le(_, g), D?.notifyGenerationSettled?.();
112
- }, ue = () => {
113
- if (b()) return;
114
- let e = z.current.get(_);
115
- !e || e.generationId !== g || (e.message = {
116
- ...e.message,
117
- streamErrorMessage: k
118
- }, fe.current?.(new i()), J(_) && w((t) => {
119
- if (!t || b() || !J(_)) return t;
120
- let n = u(t, e);
121
- return T.current = n, n;
122
- }));
123
- }, A = z.current.get(_), j = () => H.current && !b() && z.current.get(_) === A, N = async () => {
124
- if (j()) {
125
- if (!J(_)) {
126
- A && z.current.delete(_);
127
- return;
128
- }
129
- try {
130
- let n = await E.getConversation(e(t));
131
- if (!j()) return;
132
- if (K(_), !J(_)) {
133
- A && z.current.delete(_);
134
- return;
135
- }
136
- if (d(n) !== -1) {
137
- Q(t, n, { seedMessage: A?.message });
138
- return;
139
- }
140
- if (A && A.messageIndex === n.messages.length - 1 && f(n) && ne(A.message)) {
141
- ue();
142
- return;
143
- }
144
- A && z.current.delete(_), w(n), T.current = n;
145
- } catch {
146
- j() && q(_, N, j);
147
- }
148
- }
149
- }, P = {
150
- signal: x.signal,
151
- onChunk: (e) => {
152
- if (b()) return;
153
- let t = z.current.get(_);
154
- if (t?.generationId === g) {
155
- let n = l([t.message], 0, e);
156
- n && (t.message = n[0]);
157
- }
158
- if (J(_)) {
159
- if (pe.current && t?.generationId === g) {
160
- M.schedule(_, () => {
161
- let e = z.current.get(_);
162
- if (b() || !J(_) || e?.generationId !== g) return;
163
- let t = { ...e };
164
- w((e) => {
165
- if (!e) return e;
166
- let n = u(e, t);
167
- return T.current = n, n;
168
- });
169
- });
170
- return;
171
- }
172
- w((t) => {
173
- if (!t) return t;
174
- let n = z.current.get(_), r;
175
- if (n?.generationId === g) r = u(t, n);
176
- else {
177
- let n = l(t.messages, a, e);
178
- if (!n) return t;
179
- r = {
180
- ...t,
181
- messages: n
182
- };
183
- }
184
- return T.current = r, r;
185
- });
186
- }
187
- },
188
- onComplete: async () => {
189
- M.flush(_), C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.(), await N();
190
- },
191
- onError: (e) => {
192
- if (M.flush(_), fe.current?.(e), e instanceof o && !b()) {
193
- U(e);
194
- return;
195
- }
196
- if (e instanceof r && h.resumeOnConflict && !b()) {
197
- ge(e);
198
- return;
199
- }
200
- F(e);
201
- }
202
- }, F = (e) => {
203
- let t = z.current.get(_), n = t?.generationId === g ? t : void 0;
204
- if (n && !(e instanceof i) && z.current.delete(_), C(), n && E.saveConversation && e instanceof i && e.status === oe) {
205
- me(e, n, E.saveConversation.bind(E));
206
- return;
207
- }
208
- I(e, n);
209
- }, I = (e, t) => {
210
- if (t && e instanceof i && (t.message = {
211
- ...t.message,
212
- streamErrorMessage: k
213
- }), b() || !J(_)) return;
214
- let n = se(e, de, k);
215
- w((e) => {
216
- if (!e || b() || !J(_)) return e;
217
- let r = t?.generationId === g ? u(e, t) : e, i = {
218
- ...r,
219
- messages: r.messages.map((e, t) => t === a ? {
220
- ...e,
221
- streamErrorMessage: n
222
- } : e)
223
- };
224
- return T.current = i, i;
225
- });
226
- }, me = async (n, r, i) => {
227
- let a = () => H.current && !b() && z.current.get(_) === r;
228
- try {
229
- let o = await E.getConversation(e(t));
230
- if (!a()) return;
231
- if (r.messageIndex !== o.messages.length - 1 || !f(o)) {
232
- I(n, r);
233
- return;
234
- }
235
- let s = await i(_, u(o, r));
236
- if (!a() || (z.current.delete(_), !J(_))) return;
237
- w(s), T.current = s;
238
- } catch {
239
- a() && I(n, r);
240
- }
241
- }, V = () => {
242
- C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.();
243
- }, U = async (n) => {
244
- R.current.add(_), W(await te(() => E.getConversation(e(t)), b), n, !1);
245
- }, ge = async (n) => {
246
- L.current.get(_) === g && Z(_, !1), R.current.add(_), W(await te(() => E.getConversation(e(t)), b, (e) => e.messages.length === a && e.messages.at(-1)?.role === p.User), n, !0);
247
- }, W = (e, n, r) => {
248
- if (b()) {
249
- C();
250
- return;
251
- }
252
- let i = e?.messages[e.messages.length - 1], o = e != null && e.messages.length - 1 === a && i?.role === p.Assistant, s = r && e != null && d(e) !== -1;
253
- if (!e || !o && !s) {
254
- R.current.delete(_), F(n);
255
- return;
256
- }
257
- let c = z.current.get(_), l = c?.generationId === g ? c : void 0;
258
- if (f(e)) {
259
- Q(t, e, {
260
- seedMessage: o ? l?.message : void 0,
261
- skipDedupe: !0,
262
- onSettled: V
263
- });
264
- return;
265
- }
266
- R.current.delete(_), l && z.current.delete(_), J(_) && (w(e), T.current = e), V();
267
- };
268
- (async () => {
269
- try {
270
- let e = D?.channelId ?? await D?.waitForChannel(ae) ?? void 0, t = B.current.has(g);
271
- if (x.signal.aborted || b() || t) {
272
- z.current.get(_)?.generationId === g && z.current.delete(_), b() || X(_), xe(_, g), le(_, g), D?.notifyGenerationSettled?.(), t ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.();
273
- return;
274
- }
275
- E.streamCompletion(_, n, s, P, ee, g, m, v, e);
276
- } catch (e) {
277
- P.onError(e instanceof Error ? e : Error(String(e)));
278
- }
279
- })();
280
- }, [
281
- ce,
282
- le,
283
- Y,
284
- X,
285
- Z,
286
- xe,
287
62
  J,
288
- D?.channelId,
289
- D?.ensureConnected,
290
- D?.waitForChannel,
291
- D?.notifyGenerationSettled,
63
+ P,
64
+ N
65
+ ]), de = u((e, t, n, r, i, a, o, s) => c({
66
+ transport: g,
67
+ channel: y,
68
+ overlay: b,
69
+ startGeneration: _,
70
+ completeGeneration: v,
71
+ setConversation: m,
72
+ conversationRef: h,
73
+ generationConflictMessage: x,
74
+ generationPersistenceErrorMessage: S,
75
+ onStreamErrorRef: E,
76
+ batchChunksPerFrameRef: D,
77
+ mountedRef: k,
78
+ frameScheduler: O,
79
+ resumeGeneration: Y,
80
+ activeGenerationIdsRef: F,
81
+ latestGenerationIdsRef: V,
82
+ resumingPathsRef: L,
83
+ bufferedGenerationsRef: R,
84
+ stoppedGenerationIdsRef: z,
85
+ addStreamingPath: U,
86
+ removeStreamingPath: W,
87
+ setPathStoppable: G,
88
+ releaseActiveGeneration: K,
89
+ isPathDisplayed: H,
90
+ reportReloadError: P,
91
+ clearReloadError: N
92
+ }, e, t, n, r, i, a, o, s), [
93
+ _,
94
+ v,
95
+ U,
96
+ W,
97
+ G,
98
+ K,
99
+ H,
100
+ y?.channelId,
101
+ y?.ensureConnected,
102
+ y?.waitForChannel,
103
+ y?.notifyGenerationSettled,
104
+ b,
105
+ g,
106
+ Y,
107
+ x,
108
+ S,
292
109
  O,
293
- E,
294
- Q,
295
- de,
296
- k,
297
- M,
298
- q,
299
- K
300
- ]), Ce = m((e, t) => {
301
- let n = c(e), r = z.current.get(n);
302
- return U.current.get(n)?.isCurrent() && r && t.messages.length - 1 >= r.messageIndex && t.messages[r.messageIndex].role === p.Assistant && !f(t) ? (K(n), z.current.delete(n), t) : r ? u(t, r) : t;
303
- }, [K]), we = m(() => {
304
- if (!s) return;
305
- let e = c(s), t = L.current.get(e), n = t ?? C(T.current);
306
- if (!n || V.current.has(n)) return;
307
- V.current.add(n), B.current.add(n), M.flush(e), O?.notifyStopGenerating?.();
308
- let r = z.current.get(e)?.message.content, i = () => L.current.get(e) === n || t == null && F.current.has(e), o = async () => {
309
- let e = x / S;
310
- for (let t = 0; t < e; t++) {
311
- if (!i() || !H.current) return !0;
312
- await new Promise((e) => setTimeout(e, S));
313
- }
314
- return !i();
315
- };
316
- (async () => {
317
- try {
318
- await E.stopCompletion({
319
- generationId: n,
320
- path: e,
321
- content: r
322
- });
323
- } catch (e) {
324
- let t = e instanceof Error ? e : Error(String(e));
325
- if (t instanceof a && t.status === b && await o()) return;
326
- V.current.delete(n), ue?.(t);
327
- }
328
- })();
110
+ P,
111
+ N
112
+ ]), fe = u((e, t) => {
113
+ let n = r(e), a = R.current.get(n);
114
+ return A.current.get(n)?.isCurrent() && a && t.messages.length - 1 >= a.messageIndex && t.messages[a.messageIndex].role === re.Assistant && !o(t) ? (N(n), R.current.delete(n), t) : a ? i(t, a) : t;
329
115
  }, [
330
- s,
331
- T,
332
- M,
333
- ue,
334
- O,
335
- E
336
- ]), Te = m((e, t) => Q(e, t), [Q]), Ee = s != null && N.has(c(s)), $ = s == null ? null : c(s), De = $ != null && (I.has($) || Ee && C(T.current) != null), Oe = $ ? ge.get($) : void 0, ke = Oe?.isCurrent() ?? !1;
116
+ R,
117
+ N,
118
+ A
119
+ ]), pe = te({
120
+ conversationId: p,
121
+ conversationRef: h,
122
+ transport: g,
123
+ overlay: b,
124
+ onStopError: oe,
125
+ frameScheduler: O,
126
+ mountedRef: k,
127
+ activeGenerationIdsRef: F,
128
+ resumedGenerationIdsRef: I,
129
+ bufferedGenerationsRef: R,
130
+ stoppedGenerationIdsRef: z,
131
+ stopRequestedIdsRef: B,
132
+ streamingPathsRef: le
133
+ }), me = u((e, t) => {
134
+ F.current.has(r(e)) || Y(e, t, {
135
+ trackAttachGenerationId: !0,
136
+ shouldMarkOrphanedAsInterrupted: !0
137
+ });
138
+ }, [F, Y]), X = p != null && ce.has(r(p)), Z = p == null ? null : r(p), he = Z != null && (ue.has(Z) || X && ee(h.current) != null), Q = Z ? j.get(Z) : void 0, $ = Q?.isCurrent() ?? !1;
337
139
  return {
338
- hasConversationReloadError: ke,
339
- isReloadingConversation: !!Oe && ke && _e.has(Oe),
340
- retryConversationReload: ye,
341
- startStream: Se,
342
- handleStop: we,
343
- resumeIfAwaitingGeneration: Te,
344
- restoreBufferedGeneration: Ce,
345
- isStreaming: Ee,
346
- canStopStreaming: De
140
+ hasConversationReloadError: $,
141
+ isReloadingConversation: !!Q && $ && M.has(Q),
142
+ retryConversationReload: se,
143
+ startStream: de,
144
+ handleStop: pe,
145
+ resumeIfAwaitingGeneration: me,
146
+ restoreBufferedGeneration: fe,
147
+ isStreaming: X,
148
+ canStopStreaming: he
347
149
  };
348
150
  };
349
151
  //#endregion
350
- export { w as useConversationStream };
152
+ export { p as useConversationStream };
@@ -0,0 +1,29 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { ConversationStateAccessor, ConversationStreamOverlayNotifier, ConversationStreamTransport } from './conversation-stream.types';
3
+ import { FrameScheduler } from './frame-scheduler';
4
+ import { useStreamPathState } from './useStreamPathState';
5
+ type PathState = ReturnType<typeof useStreamPathState>;
6
+ interface UseStopGenerationParams {
7
+ conversationId: string | undefined;
8
+ conversationRef: ConversationStateAccessor['conversationRef'];
9
+ transport: ConversationStreamTransport;
10
+ overlay: ConversationStreamOverlayNotifier | undefined;
11
+ onStopError: ((error: Error) => void) | undefined;
12
+ frameScheduler: FrameScheduler;
13
+ mountedRef: MutableRefObject<boolean>;
14
+ activeGenerationIdsRef: PathState['activeGenerationIdsRef'];
15
+ resumedGenerationIdsRef: PathState['resumedGenerationIdsRef'];
16
+ bufferedGenerationsRef: PathState['bufferedGenerationsRef'];
17
+ stoppedGenerationIdsRef: PathState['stoppedGenerationIdsRef'];
18
+ stopRequestedIdsRef: PathState['stopRequestedIdsRef'];
19
+ streamingPathsRef: PathState['streamingPathsRef'];
20
+ }
21
+ /**
22
+ * Stop for the displayed conversation's generation: resolves its id (local,
23
+ * then a pending background generation, then a resumed one), flushes pending
24
+ * display writes, and asks the backend to stop it. A `404` within a short
25
+ * grace window is the generation ending on its own and is not reported.
26
+ */
27
+ export declare const useStopGeneration: ({ conversationId, conversationRef, transport, overlay, onStopError, frameScheduler, mountedRef, activeGenerationIdsRef, resumedGenerationIdsRef, bufferedGenerationsRef, stoppedGenerationIdsRef, stopRequestedIdsRef, streamingPathsRef, }: UseStopGenerationParams) => () => void;
28
+ export {};
29
+ //# sourceMappingURL=useStopGeneration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStopGeneration.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useStopGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EACjC,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEvD,UAAU,uBAAuB;IAC/B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;IAC9D,SAAS,EAAE,2BAA2B,CAAC;IACvC,OAAO,EAAE,iCAAiC,GAAG,SAAS,CAAC;IACvD,WAAW,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,cAAc,CAAC;IAE/B,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,sBAAsB,EAAE,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAC5D,uBAAuB,EAAE,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAC9D,sBAAsB,EAAE,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAC5D,uBAAuB,EAAE,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAC9D,mBAAmB,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACtD,iBAAiB,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,6OAc/B,uBAAuB,eAiFzB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { StopCompletionError as e } from "../create-chat-stream-api.js";
2
+ import { getConversationPath as t } from "./conversation-path.js";
3
+ import { STOP_NOT_FOUND_GRACE_MS as n, findResumedBackgroundGenerationId as r } from "./stream-errors.js";
4
+ import { useCallback as i } from "react";
5
+ //#region src/conversation/useConversationStream/useStopGeneration.ts
6
+ var a = ({ conversationId: a, conversationRef: o, transport: s, overlay: c, onStopError: l, frameScheduler: u, mountedRef: d, activeGenerationIdsRef: f, resumedGenerationIdsRef: p, bufferedGenerationsRef: m, stoppedGenerationIdsRef: h, stopRequestedIdsRef: g, streamingPathsRef: _ }) => i(() => {
7
+ if (!a) return;
8
+ let i = t(a), v = f.current.get(i), y = v ?? r(o.current) ?? p.current.get(i);
9
+ if (!y || g.current.has(y)) return;
10
+ g.current.add(y), h.current.add(y), u.flush(i), c?.notifyStopGenerating?.();
11
+ let b = m.current.get(i)?.message.content, x = () => f.current.get(i) === y || v == null && _.current.has(i), S = async () => {
12
+ let e = n / 100;
13
+ for (let t = 0; t < e; t++) {
14
+ if (!x() || !d.current) return !0;
15
+ await new Promise((e) => setTimeout(e, 100));
16
+ }
17
+ return !x();
18
+ };
19
+ (async () => {
20
+ try {
21
+ await s.stopCompletion({
22
+ generationId: y,
23
+ path: i,
24
+ content: b
25
+ });
26
+ } catch (t) {
27
+ let n = t instanceof Error ? t : Error(String(t));
28
+ if (n instanceof e && n.status === 404 && await S()) return;
29
+ g.current.delete(y), l?.(n);
30
+ }
31
+ })();
32
+ }, [
33
+ f,
34
+ m,
35
+ a,
36
+ o,
37
+ u,
38
+ d,
39
+ l,
40
+ c,
41
+ p,
42
+ g,
43
+ h,
44
+ _,
45
+ s
46
+ ]);
47
+ //#endregion
48
+ export { a as useStopGeneration };
@@ -0,0 +1,39 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { BufferedGeneration } from './buffered-generation';
3
+ import { FrameScheduler } from './frame-scheduler';
4
+ interface UseStreamPathStateParams {
5
+ conversationId: string | undefined;
6
+ frameScheduler: FrameScheduler;
7
+ mountedRef: MutableRefObject<boolean>;
8
+ clearReloadError: (path: string) => void;
9
+ }
10
+ /**
11
+ * Per-path generation state of `useConversationStream`: which paths are
12
+ * streaming and which offer Stop, and the refs that own each path's local,
13
+ * latest, resumed and stopped generation ids, its live buffered message and
14
+ * its resume reservation, plus the displayed-conversation guard that keeps a
15
+ * stream from writing into a conversation that is no longer shown.
16
+ * `streamingPathsRef` is synced during render so Stop polling reads the
17
+ * latest set.
18
+ */
19
+ export declare const useStreamPathState: ({ conversationId, frameScheduler, mountedRef, clearReloadError, }: UseStreamPathStateParams) => {
20
+ streamingPaths: Set<string>;
21
+ streamingPathsRef: import('react').RefObject<Set<string>>;
22
+ stoppablePaths: Set<string>;
23
+ activeGenerationIdsRef: import('react').RefObject<Map<string, string>>;
24
+ resumedGenerationIdsRef: import('react').RefObject<Map<string, string>>;
25
+ resumingPathsRef: import('react').RefObject<Set<string>>;
26
+ bufferedGenerationsRef: import('react').RefObject<Map<string, BufferedGeneration>>;
27
+ stoppedGenerationIdsRef: import('react').RefObject<Set<string>>;
28
+ stopRequestedIdsRef: import('react').RefObject<Set<string>>;
29
+ latestGenerationIdsRef: import('react').RefObject<Map<string, string>>;
30
+ isPathDisplayed: (path: string) => boolean;
31
+ addStreamingPath: (path: string) => void;
32
+ removeStreamingPath: (path: string) => void;
33
+ setPathStoppable: (path: string, isStoppable: boolean) => void;
34
+ releaseActiveGeneration: (path: string, genId: string) => void;
35
+ rememberResumedGenerationId: (path: string, generationId: string) => void;
36
+ forgetResumedGenerationId: (path: string, generationId: string) => void;
37
+ };
38
+ export {};
39
+ //# sourceMappingURL=useStreamPathState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStreamPathState.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useStreamPathState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,UAAU,wBAAwB;IAChC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC,cAAc,EAAE,cAAc,CAAC;IAE/B,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEtC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,mEAKhC,wBAAwB;;;;;;;;;;;4BAwDhB,MAAM,KAAG,OAAO;6BAOhB,MAAM;gCAYgC,MAAM;6BAST,MAAM,eAAe,OAAO;oCAY/D,MAAM,SAAS,MAAM;wCAarB,MAAM,gBAAgB,MAAM;sCAU5B,MAAM,gBAAgB,MAAM;CA6BtC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { getConversationPath as e } from "./conversation-path.js";
2
+ import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
+ //#region src/conversation/useConversationStream/useStreamPathState.ts
4
+ var a = ({ conversationId: a, frameScheduler: o, mountedRef: s, clearReloadError: c }) => {
5
+ let [l, u] = i(() => /* @__PURE__ */ new Set()), d = r(l);
6
+ d.current = l;
7
+ let [f, p] = i(() => /* @__PURE__ */ new Set()), m = r(/* @__PURE__ */ new Map()), h = r(/* @__PURE__ */ new Map()), g = r(/* @__PURE__ */ new Set()), _ = r(/* @__PURE__ */ new Map()), v = r(/* @__PURE__ */ new Set()), y = r(/* @__PURE__ */ new Set()), b = r(/* @__PURE__ */ new Map()), x = r(a);
8
+ n(() => (x.current = a, () => o.cancelAll()), [a, o]);
9
+ let S = t((t) => s.current && e(x.current ?? "") === t, [s]), C = t((e) => {
10
+ c(e), u((t) => {
11
+ if (t.has(e)) return t;
12
+ let n = new Set(t);
13
+ return n.add(e), n;
14
+ });
15
+ }, [c]), w = t((e) => {
16
+ u((t) => {
17
+ if (!t.has(e)) return t;
18
+ let n = new Set(t);
19
+ return n.delete(e), n;
20
+ });
21
+ }, []), T = t((e, t) => {
22
+ p((n) => {
23
+ if (n.has(e) === t) return n;
24
+ let r = new Set(n);
25
+ return t ? r.add(e) : r.delete(e), r;
26
+ });
27
+ }, []);
28
+ return {
29
+ streamingPaths: l,
30
+ streamingPathsRef: d,
31
+ stoppablePaths: f,
32
+ activeGenerationIdsRef: m,
33
+ resumedGenerationIdsRef: h,
34
+ resumingPathsRef: g,
35
+ bufferedGenerationsRef: _,
36
+ stoppedGenerationIdsRef: v,
37
+ stopRequestedIdsRef: y,
38
+ latestGenerationIdsRef: b,
39
+ isPathDisplayed: S,
40
+ addStreamingPath: C,
41
+ removeStreamingPath: w,
42
+ setPathStoppable: T,
43
+ releaseActiveGeneration: t((e, t) => {
44
+ m.current.get(e) === t && (m.current.delete(e), T(e, !1));
45
+ }, [T]),
46
+ rememberResumedGenerationId: t((e, t) => {
47
+ m.current.has(e) || (h.current.set(e, t), T(e, !0));
48
+ }, [T]),
49
+ forgetResumedGenerationId: t((e, t) => {
50
+ h.current.get(e) === t && (h.current.delete(e), m.current.has(e) || T(e, !1));
51
+ }, [T])
52
+ };
53
+ };
54
+ //#endregion
55
+ export { a as useStreamPathState };