@epam/ai-dial-chat-hooks 1.3.0-dev.98 → 1.4.0-dev.5

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 +19 -4
  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 +32 -2
  159. package/conversation/useConversationStream/generation-resume.d.ts.map +1 -1
  160. package/conversation/useConversationStream/generation-resume.js +114 -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,179 @@
1
+ import { AttachmentDto, ConversationResponseDto, CreateConversationDto, CreateProjectResponseDto, ListProjectsResponseDto, ProjectArtifactListResponseDto, ProjectConversationListResponseDto, ProjectConversationTitlesResponseDto, ProjectDetailsDto, GenerateTitleResponseDto, RenameConversationResponseDto, UpdateProjectResponseDto } from '@epam/ai-dial-chat-api-client';
2
+ import { RequestSkill } from '@epam/ai-dial-chat-shared';
3
+ /** A generated-client `Raw` answer, of which only the native response is read. */
4
+ interface RawApiResponse {
5
+ raw: Response;
6
+ }
7
+ /** Narrow configured generated-client (`ProjectsApi`) surface the project hooks require. */
8
+ export interface ProjectsConfiguredClient {
9
+ listProjects: (options?: RequestInit) => Promise<ListProjectsResponseDto>;
10
+ getProject: (request: {
11
+ id: string;
12
+ }, options?: RequestInit) => Promise<ProjectDetailsDto>;
13
+ createProject: (request: {
14
+ name: string;
15
+ description?: string;
16
+ instructions?: string;
17
+ fileNames?: string;
18
+ files?: Blob[];
19
+ }, options?: RequestInit) => Promise<CreateProjectResponseDto>;
20
+ updateProject: (request: {
21
+ id: string;
22
+ ifMatch: string;
23
+ name: string;
24
+ description?: string;
25
+ instructions?: string;
26
+ fileNames?: string;
27
+ removedFileNames?: string;
28
+ files?: Blob[];
29
+ }, options?: RequestInit) => Promise<UpdateProjectResponseDto>;
30
+ deleteProject: (request: {
31
+ id: string;
32
+ ifMatch: string;
33
+ }) => Promise<void>;
34
+ downloadProjectRaw: (request: {
35
+ id: string;
36
+ }, options?: RequestInit) => Promise<RawApiResponse>;
37
+ downloadProjectFileRaw: (request: {
38
+ id: string;
39
+ fileName: string;
40
+ }, options?: RequestInit) => Promise<RawApiResponse>;
41
+ listProjectConversations: (request: {
42
+ id: string;
43
+ }, options?: RequestInit) => Promise<ProjectConversationListResponseDto>;
44
+ getProjectConversationTitles: (request: {
45
+ id: string;
46
+ projectConversationTitlesBodyDto: {
47
+ names: string[];
48
+ };
49
+ }, options?: RequestInit) => Promise<ProjectConversationTitlesResponseDto>;
50
+ listProjectArtifacts: (request: {
51
+ id: string;
52
+ }, options?: RequestInit) => Promise<ProjectArtifactListResponseDto>;
53
+ createProjectConversation: (request: {
54
+ id: string;
55
+ createConversationDto: CreateConversationDto;
56
+ }) => Promise<ConversationResponseDto>;
57
+ getProjectConversation: (request: {
58
+ id: string;
59
+ conversationName: string;
60
+ }, options?: RequestInit) => Promise<ConversationResponseDto>;
61
+ saveProjectConversation: (request: {
62
+ id: string;
63
+ conversationName: string;
64
+ saveConversationBodyDto: {
65
+ conversation: ConversationResponseDto;
66
+ };
67
+ }) => Promise<ConversationResponseDto>;
68
+ renameProjectConversation: (request: {
69
+ id: string;
70
+ conversationName: string;
71
+ renameConversationBodyDto: {
72
+ newTitle: string;
73
+ };
74
+ }) => Promise<RenameConversationResponseDto>;
75
+ generateProjectConversationTitle: (request: {
76
+ id: string;
77
+ conversationName: string;
78
+ }) => Promise<GenerateTitleResponseDto>;
79
+ deleteProjectConversation: (request: {
80
+ id: string;
81
+ conversationName: string;
82
+ }) => Promise<void>;
83
+ markProjectConversationViewed: (request: {
84
+ id: string;
85
+ conversationName: string;
86
+ }) => Promise<void>;
87
+ attachToProjectGenerationRaw: (request: {
88
+ id: string;
89
+ attachGenerationDto: {
90
+ path: string;
91
+ };
92
+ }, options?: RequestInit) => Promise<RawApiResponse>;
93
+ watchProjectsRaw: (request: {
94
+ watchProjectsBodyDto: {
95
+ ids: string[];
96
+ };
97
+ }, options?: RequestInit) => Promise<RawApiResponse>;
98
+ }
99
+ /** Text fields of a project create or edit request. */
100
+ export interface ProjectFields {
101
+ /** Project name; also the last path segment of its id. */
102
+ name: string;
103
+ /** Plain-text description; when omitted, a save keeps the stored one. */
104
+ description?: string;
105
+ /** Markdown instructions, stored as the `PROJECT.md` body. */
106
+ instructions: string;
107
+ }
108
+ /** One project edit: the fields, the added files only, the stored files to drop and the loaded version. */
109
+ export interface ProjectUpdateRequest {
110
+ /** The project's DIAL id. */
111
+ id: string;
112
+ /** The edited text fields. */
113
+ fields: ProjectFields;
114
+ /** Files added in this edit. */
115
+ newFiles: File[];
116
+ /** Names of the stored context files to remove. */
117
+ removedFileNames: string[];
118
+ /** The loaded project's `contentVersion`; a conversation written meanwhile does not change it. */
119
+ contentVersion: string;
120
+ }
121
+ /** The first message of a new top-level or project conversation. */
122
+ export interface ConversationCreateRequest {
123
+ /** The first user message. */
124
+ firstMessage: string;
125
+ /** Model or application the conversation starts with. */
126
+ deploymentId: string;
127
+ /** Attachments of the first message. */
128
+ attachments?: AttachmentDto[];
129
+ /** Tool configuration of the first message. */
130
+ configurationValue?: Record<string, unknown>;
131
+ /** Form values of the first message. */
132
+ formValue?: Record<string, unknown>;
133
+ /** Skills requested with the first message. */
134
+ skills?: RequestSkill[];
135
+ }
136
+ /** App-agnostic project requests over a configured generated client. */
137
+ export interface ProjectsApiClient {
138
+ listProjects: (signal?: AbortSignal) => Promise<ListProjectsResponseDto>;
139
+ getProject: (id: string, signal?: AbortSignal) => Promise<ProjectDetailsDto>;
140
+ createProject: (fields: ProjectFields, files: File[], signal?: AbortSignal) => Promise<CreateProjectResponseDto>;
141
+ updateProject: (request: ProjectUpdateRequest, signal?: AbortSignal) => Promise<UpdateProjectResponseDto>;
142
+ deleteProject: (id: string, contentVersion: string) => Promise<void>;
143
+ downloadProjectArchive: (id: string, signal?: AbortSignal) => Promise<Response>;
144
+ downloadProjectContextFile: (id: string, fileName: string, signal?: AbortSignal) => Promise<Response>;
145
+ /** Lists the files the agents saved under the project's `artifacts/` folder, newest first. */
146
+ listProjectArtifacts: (projectId: string, signal?: AbortSignal) => Promise<ProjectArtifactListResponseDto>;
147
+ listProjectConversations: (projectId: string, signal?: AbortSignal) => Promise<ProjectConversationListResponseDto>;
148
+ getProjectConversationTitles: (projectId: string, names: string[], signal?: AbortSignal) => Promise<ProjectConversationTitlesResponseDto>;
149
+ createProjectConversation: (projectId: string, request: ConversationCreateRequest) => Promise<ConversationResponseDto>;
150
+ getProjectConversation: (conversationId: string, signal?: AbortSignal) => Promise<ConversationResponseDto>;
151
+ saveProjectConversation: (conversationId: string, conversation: ConversationResponseDto) => Promise<ConversationResponseDto>;
152
+ renameProjectConversation: (conversationId: string, newTitle: string) => Promise<RenameConversationResponseDto>;
153
+ /** Suggests a title for the conversation without saving it. */
154
+ generateProjectConversationTitle: (conversationId: string) => Promise<GenerateTitleResponseDto>;
155
+ deleteProjectConversation: (conversationId: string) => Promise<void>;
156
+ /** Records that the caller has seen the conversation's current version; a host without it keeps no read state. */
157
+ markProjectConversationViewed?: (conversationId: string) => Promise<void>;
158
+ attachToProjectGeneration: (projectId: string, path: string, signal?: AbortSignal) => Promise<ReadableStream<Uint8Array>>;
159
+ /** Opens the SSE stream of changes to the given projects; a host without it gets no live updates. */
160
+ watchProjects?: (ids: string[], signal?: AbortSignal) => Promise<ReadableStream<Uint8Array>>;
161
+ }
162
+ /**
163
+ * Splits a project conversation id `projects/{bucket}/{projectPath…}/conversations/{name}`
164
+ * into the project id and the conversation file name; `null` for any other id.
165
+ */
166
+ export declare const splitProjectConversationId: (conversationId: string) => {
167
+ projectId: string;
168
+ conversationName: string;
169
+ } | null;
170
+ /** The create-conversation body of a first message, the same for a top-level and a project conversation. */
171
+ export declare const buildCreateConversationDto: ({ firstMessage, deploymentId, attachments, configurationValue, formValue, skills, }: ConversationCreateRequest) => CreateConversationDto;
172
+ /**
173
+ * Composes the project requests over a configured generated `ProjectsApi`.
174
+ * File names travel as JSON fields, positionally paired with `files`,
175
+ * because the BFF never trusts a multipart part's own filename.
176
+ */
177
+ export declare const createProjectsApiClient: (client: ProjectsConfiguredClient) => Required<ProjectsApiClient>;
178
+ export {};
179
+ //# sourceMappingURL=projects-api-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects-api-client.d.ts","sourceRoot":"","sources":["../../src/project/projects-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,oCAAoC,EACpC,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,kFAAkF;AAClF,UA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C;IACvC,yBAAyB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,kHAAkH;IAClH,6BAA6B,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,yBAAyB,EAAE,CACzB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACzC,qGAAqG;IACrG,aAAa,CAAC,EAAE,CACd,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CAC1C;AAKD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GACrC,gBAAgB,MAAM,KACrB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAAG,IAapD,CAAC;AAYF,4GAA4G;AAC5G,eAAO,MAAM,0BAA0B,GAAI,qFAOxC,yBAAyB,KAAG,qBAe7B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,wBAAwB,KAC/B,QAAQ,CAAC,iBAAiB,CAiG3B,CAAC"}
@@ -0,0 +1,90 @@
1
+ //#region src/project/projects-api-client.ts
2
+ var e = (e) => {
3
+ let t = e.split("/");
4
+ return t.length < 5 || t[0] !== "projects" || t[t.length - 2] !== "conversations" ? null : {
5
+ projectId: t.slice(0, -2).join("/"),
6
+ conversationName: t[t.length - 1]
7
+ };
8
+ }, t = (t) => {
9
+ let n = e(t);
10
+ if (!n) throw Error("Not a project conversation id");
11
+ return {
12
+ id: n.projectId,
13
+ conversationName: n.conversationName
14
+ };
15
+ }, n = (e) => e ? [{ signal: e }] : [], r = ({ firstMessage: e, deploymentId: t, attachments: n, configurationValue: r, formValue: i, skills: a }) => ({
16
+ firstMessage: e,
17
+ deploymentId: t,
18
+ ...n?.length || r || i || a?.length ? { custom_content: {
19
+ ...n?.length ? { attachments: n } : {},
20
+ ...r ? { configuration_value: r } : {},
21
+ ...i ? { form_value: i } : {},
22
+ ...a?.length ? { skills: a } : {}
23
+ } } : {}
24
+ }), i = (e) => ({
25
+ listProjects: (t) => e.listProjects(...n(t)),
26
+ getProject: (t, r) => e.getProject({ id: t }, ...n(r)),
27
+ createProject: ({ name: t, description: r, instructions: i }, a, o) => e.createProject({
28
+ name: t,
29
+ description: r,
30
+ instructions: i,
31
+ fileNames: JSON.stringify(a.map((e) => e.name)),
32
+ files: a
33
+ }, ...n(o)),
34
+ updateProject: ({ id: t, fields: r, newFiles: i, removedFileNames: a, contentVersion: o }, s) => e.updateProject({
35
+ id: t,
36
+ ifMatch: o,
37
+ name: r.name,
38
+ description: r.description,
39
+ instructions: r.instructions,
40
+ fileNames: JSON.stringify(i.map((e) => e.name)),
41
+ removedFileNames: JSON.stringify(a),
42
+ files: i
43
+ }, ...n(s)),
44
+ deleteProject: (t, n) => e.deleteProject({
45
+ id: t,
46
+ ifMatch: n
47
+ }),
48
+ downloadProjectArchive: async (t, r) => (await e.downloadProjectRaw({ id: t }, ...n(r))).raw,
49
+ downloadProjectContextFile: async (t, r, i) => (await e.downloadProjectFileRaw({
50
+ id: t,
51
+ fileName: r
52
+ }, ...n(i))).raw,
53
+ listProjectArtifacts: (t, r) => e.listProjectArtifacts({ id: t }, ...n(r)),
54
+ listProjectConversations: (t, r) => e.listProjectConversations({ id: t }, ...n(r)),
55
+ getProjectConversationTitles: (t, r, i) => e.getProjectConversationTitles({
56
+ id: t,
57
+ projectConversationTitlesBodyDto: { names: r }
58
+ }, ...n(i)),
59
+ createProjectConversation: (t, n) => e.createProjectConversation({
60
+ id: t,
61
+ createConversationDto: r(n)
62
+ }),
63
+ getProjectConversation: (r, i) => e.getProjectConversation(t(r), ...n(i)),
64
+ saveProjectConversation: (n, r) => e.saveProjectConversation({
65
+ ...t(n),
66
+ saveConversationBodyDto: { conversation: r }
67
+ }),
68
+ renameProjectConversation: (n, r) => e.renameProjectConversation({
69
+ ...t(n),
70
+ renameConversationBodyDto: { newTitle: r }
71
+ }),
72
+ generateProjectConversationTitle: (n) => e.generateProjectConversationTitle(t(n)),
73
+ deleteProjectConversation: (n) => e.deleteProjectConversation(t(n)),
74
+ markProjectConversationViewed: (n) => e.markProjectConversationViewed(t(n)),
75
+ attachToProjectGeneration: async (t, r, i) => {
76
+ let { raw: a } = await e.attachToProjectGenerationRaw({
77
+ id: t,
78
+ attachGenerationDto: { path: r }
79
+ }, ...n(i));
80
+ if (!a.body) throw Error("Attach endpoint returned no response body");
81
+ return a.body;
82
+ },
83
+ watchProjects: async (t, r) => {
84
+ let { raw: i } = await e.watchProjectsRaw({ watchProjectsBodyDto: { ids: t } }, ...n(r));
85
+ if (!i.body) throw Error("Watch endpoint returned no response body");
86
+ return i.body;
87
+ }
88
+ });
89
+ //#endregion
90
+ export { r as buildCreateConversationDto, i as createProjectsApiClient, e as splitProjectConversationId };
@@ -0,0 +1,58 @@
1
+ import { ProjectDetailsDto } from '@epam/ai-dial-chat-api-client';
2
+ import { ProjectsApiClient } from './projects-api-client';
3
+ /** Most chats listed under one pinned project. */
4
+ export declare const PINNED_PROJECT_CHATS_LIMIT = 10;
5
+ /** What `usePinnedProjectChats` needs from the host besides the ids. */
6
+ export interface PinnedProjectChatsOptions {
7
+ /** No request is sent and `projects` is empty while `false`. */
8
+ enabled: boolean;
9
+ /** The project no longer exists (a watch `DELETE`, or `404` on a read). Called at most once per id. */
10
+ onProjectDeleted: (projectId: string) => void;
11
+ }
12
+ /** A chat listed under a pinned project. */
13
+ export interface PinnedProjectChat {
14
+ /** The conversation's DIAL id. */
15
+ id: string;
16
+ /** Display title; the file-name title when its body could not be read. */
17
+ title: string;
18
+ /** The caller has not seen the conversation's current version. */
19
+ isUnread?: boolean;
20
+ }
21
+ /** A loaded pinned project and its newest chats. */
22
+ export interface PinnedProjectChats {
23
+ /** The project's details as last read; `canEdit`, `canManage`, `contentVersion` and `conversationCount` feed the host's actions. */
24
+ project: ProjectDetailsDto;
25
+ /** At most `PINNED_PROJECT_CHATS_LIMIT` chats, newest first. */
26
+ chats: PinnedProjectChat[];
27
+ /** The project has more chats than `chats` holds. */
28
+ hasMore: boolean;
29
+ }
30
+ /** What `usePinnedProjectChats` returns. */
31
+ export interface PinnedProjectChatsResult {
32
+ /** Loaded projects, in `projectIds` order; an id whose load failed is absent while it is retried. */
33
+ projects: PinnedProjectChats[];
34
+ /** True until every id of the current `projectIds` settled once. */
35
+ isLoading: boolean;
36
+ /** Clears a chat's unread state locally until a read reports a newer version. Sends no request. */
37
+ markViewed: (conversationId: string) => void;
38
+ /** Silently re-reads one loaded project, through the same per-project gate as a watch event. */
39
+ refresh: (projectId: string) => void;
40
+ }
41
+ /**
42
+ * Loads each pinned project's details and newest chats through the injected
43
+ * client, and keeps them current with one watch stream over every pinned
44
+ * project. A changed project is refreshed silently, one refresh at a time per
45
+ * project plus one trailing run; a deleted one is dropped and reported. A
46
+ * first load that fails with anything but a `404` is retried with a bounded
47
+ * backoff, and the project stays out of the watch until it loads. A dropped
48
+ * stream is reopened with a bounded backoff and followed by a refresh of every
49
+ * project; a watch that cannot be opened is not retried for the same projects.
50
+ * Requests are aborted on unmount, when `enabled` turns false, and for an id
51
+ * that leaves `projectIds`.
52
+ *
53
+ * @param client - Configured project requests, from `createProjectsApiClient`; it must be referentially stable, because a new object reloads.
54
+ * @param projectIds - The pinned project ids, in display order.
55
+ * @param options - Whether the tree is enabled and the delete callback; the callback is read at event time, so a new identity never resubscribes.
56
+ */
57
+ export declare const usePinnedProjectChats: (client: Pick<ProjectsApiClient, "getProject" | "listProjectConversations" | "getProjectConversationTitles" | "watchProjects">, projectIds: string[], { enabled, onProjectDeleted }: PinnedProjectChatsOptions) => PinnedProjectChatsResult;
58
+ //# sourceMappingURL=use-pinned-project-chats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-pinned-project-chats.d.ts","sourceRoot":"","sources":["../../src/project/use-pinned-project-chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,kDAAkD;AAClD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAW7C,wEAAwE;AACxE,MAAM,WAAW,yBAAyB;IACxC,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,uGAAuG;IACvG,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,oIAAoI;IACpI,OAAO,EAAE,iBAAiB,CAAC;IAC3B,gEAAgE;IAChE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,wBAAwB;IACvC,qGAAqG;IACrG,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,mGAAmG;IACnG,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gGAAgG;IAChG,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAiFD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,IAAI,CACV,iBAAiB,EACf,YAAY,GACZ,0BAA0B,GAC1B,8BAA8B,GAC9B,eAAe,CAClB,EACD,YAAY,MAAM,EAAE,EACpB,+BAA+B,yBAAyB,KACvD,wBAqXF,CAAC"}
@@ -0,0 +1,269 @@
1
+ import { getApiErrorStatus as e } from "../api-error/api-error.js";
2
+ import { runProjectWatch as t } from "./project-watch-stream.js";
3
+ import { applyViewedMark as n } from "./project-viewed-marks.js";
4
+ import { ProjectWatchAction as r } from "@epam/ai-dial-chat-api-client";
5
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
6
+ //#region src/project/use-pinned-project-chats.ts
7
+ var l = 10, u = 1e3, d = [
8
+ 1e3,
9
+ 2e3,
10
+ 4e3,
11
+ 8e3,
12
+ 16e3
13
+ ], f = "\n", p = {
14
+ snapshots: /* @__PURE__ */ new Map(),
15
+ settled: /* @__PURE__ */ new Set(),
16
+ watchKey: ""
17
+ }, m = [], h = (e, { settled: t, snapshots: n }, r) => {
18
+ let i = [...e].sort();
19
+ return i.every((e) => t.has(e)) ? i.filter((e) => n.has(e)).slice(0, u).join(f) : r;
20
+ }, g = (e, t) => {
21
+ if (!e.snapshots.has(t) && !e.settled.has(t)) return e;
22
+ let n = new Map(e.snapshots);
23
+ n.delete(t);
24
+ let r = new Set(e.settled);
25
+ return r.delete(t), {
26
+ ...e,
27
+ snapshots: n,
28
+ settled: r
29
+ };
30
+ }, _ = (e, t) => {
31
+ if (t.length === 0) return e;
32
+ let n = new Map(t.map((e) => [e.id, e]));
33
+ return e.map((e) => {
34
+ let t = n.get(e.id);
35
+ return t ? {
36
+ ...e,
37
+ title: t.title,
38
+ isTitlePending: !1
39
+ } : e;
40
+ });
41
+ }, v = (l, u, { enabled: v, onProjectDeleted: y }) => {
42
+ let [b, x] = c(p), S = s(b);
43
+ a(() => {
44
+ S.current = b;
45
+ });
46
+ let C = s(y);
47
+ a(() => {
48
+ C.current = y;
49
+ });
50
+ let w = s(/* @__PURE__ */ new Set()), T = s(/* @__PURE__ */ new Map()), E = s(/* @__PURE__ */ new Map()), D = s(/* @__PURE__ */ new Set()), O = s(/* @__PURE__ */ new Map()), k = s(/* @__PURE__ */ new Map()), A = s(null), j = o(() => [...new Set(u)].sort().join(f), [u]), M = i(async (e, t) => {
51
+ let [n, r] = await Promise.allSettled([l.getProject(e, t), l.listProjectConversations(e, t)]);
52
+ if (n.status === "rejected") throw n.reason;
53
+ let i = r.status === "fulfilled" ? r.value.items : [], a = i.slice(0, 10), o = a.filter((e) => e.isTitlePending).map((e) => e.name);
54
+ if (o.length > 0) try {
55
+ let { items: n } = await l.getProjectConversationTitles(e, o, t);
56
+ a = _(a, n);
57
+ } catch {}
58
+ return {
59
+ project: n.value,
60
+ items: a,
61
+ hasMore: i.length > 10
62
+ };
63
+ }, [l]), N = i(({ project: e, items: t, hasMore: r }) => {
64
+ for (let { id: e, updatedAt: n } of t) k.current.set(e, n);
65
+ return {
66
+ project: e,
67
+ hasMore: r,
68
+ chats: t.map((e) => ({
69
+ id: e.id,
70
+ title: e.title,
71
+ ...n(O.current, e) ? { isUnread: !0 } : {}
72
+ }))
73
+ };
74
+ }, []), P = i((e) => {
75
+ D.current.has(e) || (D.current.add(e), C.current(e));
76
+ }, []), F = i((e) => {
77
+ E.current.get(e)?.controller?.abort(), E.current.delete(e);
78
+ }, []), I = i((e) => {
79
+ F(e), x((t) => {
80
+ if (!t.snapshots.has(e)) return t;
81
+ let n = new Map(t.snapshots);
82
+ return n.delete(e), {
83
+ ...t,
84
+ snapshots: n,
85
+ watchKey: h(w.current, {
86
+ settled: t.settled,
87
+ snapshots: n
88
+ }, t.watchKey)
89
+ };
90
+ });
91
+ }, [F]), L = i((t) => {
92
+ if (!S.current.snapshots.has(t)) return;
93
+ let n = E.current.get(t);
94
+ if (n ?? (n = {
95
+ isRefreshing: !1,
96
+ isPending: !1
97
+ }, E.current.set(t, n)), n.isRefreshing) {
98
+ n.isPending = !0;
99
+ return;
100
+ }
101
+ let r = n, i = new AbortController();
102
+ r.isRefreshing = !0, r.controller = i, (async () => {
103
+ try {
104
+ let e = await M(t, i.signal);
105
+ if (i.signal.aborted) return;
106
+ let n = N(e);
107
+ x((e) => {
108
+ if (!e.snapshots.has(t)) return e;
109
+ let r = new Map(e.snapshots);
110
+ return r.set(t, n), {
111
+ ...e,
112
+ snapshots: r
113
+ };
114
+ });
115
+ } catch (n) {
116
+ if (i.signal.aborted) return;
117
+ e(n) === 404 && (I(t), P(t));
118
+ } finally {
119
+ r.isRefreshing = !1, r.isPending && !i.signal.aborted && E.current.get(t) === r && (r.isPending = !1, L(t));
120
+ }
121
+ })();
122
+ }, [
123
+ I,
124
+ M,
125
+ P,
126
+ N
127
+ ]), R = i((t, n, r = 0) => {
128
+ let i = () => {
129
+ T.current.get(t) === n && T.current.delete(t);
130
+ };
131
+ (async () => {
132
+ try {
133
+ let e = await M(t, n.signal);
134
+ if (n.signal.aborted) return;
135
+ let r = N(e);
136
+ x((e) => {
137
+ let n = new Map(e.snapshots);
138
+ n.set(t, r);
139
+ let i = new Set(e.settled).add(t);
140
+ return {
141
+ snapshots: n,
142
+ settled: i,
143
+ watchKey: h(w.current, {
144
+ settled: i,
145
+ snapshots: n
146
+ }, e.watchKey)
147
+ };
148
+ }), i();
149
+ } catch (a) {
150
+ if (n.signal.aborted) return;
151
+ x((e) => {
152
+ if (e.settled.has(t)) return e;
153
+ let n = new Set(e.settled).add(t);
154
+ return {
155
+ ...e,
156
+ settled: n,
157
+ watchKey: h(w.current, {
158
+ settled: n,
159
+ snapshots: e.snapshots
160
+ }, e.watchKey)
161
+ };
162
+ });
163
+ let o = e(a) === 404, s = o ? void 0 : d[r];
164
+ if (s == null) {
165
+ i(), o && P(t);
166
+ return;
167
+ }
168
+ let c = setTimeout(() => R(t, n, r + 1), s);
169
+ n.signal.addEventListener("abort", () => clearTimeout(c), { once: !0 });
170
+ }
171
+ })();
172
+ }, [
173
+ M,
174
+ P,
175
+ N
176
+ ]);
177
+ a(() => () => {
178
+ for (let e of T.current.values()) e.abort();
179
+ T.current.clear();
180
+ for (let e of E.current.values()) e.controller?.abort();
181
+ E.current.clear(), w.current.clear(), D.current.clear(), O.current.clear(), k.current.clear(), x(p);
182
+ }, [l, v]), a(() => {
183
+ if (!v) return;
184
+ let e = new Set(j === "" ? [] : j.split(f));
185
+ for (let t of [...w.current]) e.has(t) || (w.current.delete(t), D.current.delete(t), T.current.get(t)?.abort(), T.current.delete(t), F(t), x((e) => {
186
+ let n = g(e, t);
187
+ return {
188
+ ...n,
189
+ watchKey: h(w.current, n, e.watchKey)
190
+ };
191
+ }));
192
+ for (let t of e) {
193
+ if (w.current.has(t)) continue;
194
+ w.current.add(t);
195
+ let e = new AbortController();
196
+ T.current.set(t, e), R(t, e);
197
+ }
198
+ }, [
199
+ v,
200
+ j,
201
+ F,
202
+ R
203
+ ]);
204
+ let z = v && j !== "" && j.split(f).some((e) => !b.settled.has(e)), B = v ? b.watchKey : "", { watchProjects: V } = l;
205
+ a(() => {
206
+ if (V == null || B === "" || B === A.current) return;
207
+ let e = new AbortController();
208
+ return t({
209
+ watchProjects: V,
210
+ ids: B.split(f),
211
+ signal: e.signal,
212
+ onEvent: (t) => {
213
+ if (e.signal.aborted) return;
214
+ let n = S.current.snapshots.get(t.id);
215
+ n != null && (t.action === r.Delete ? (I(t.id), P(t.id)) : (t.etag == null || t.etag !== n.project.etag) && L(t.id));
216
+ },
217
+ onReconnected: () => {
218
+ for (let e of S.current.snapshots.keys()) L(e);
219
+ },
220
+ onUnavailable: () => {
221
+ A.current = B;
222
+ }
223
+ }), () => e.abort();
224
+ }, [
225
+ V,
226
+ B,
227
+ I,
228
+ P,
229
+ L
230
+ ]);
231
+ let H = i((e) => {
232
+ k.current.has(e) && (O.current.set(e, k.current.get(e)), x((t) => {
233
+ let n;
234
+ for (let [r, i] of t.snapshots) i.chats.some((t) => t.id === e && t.isUnread) && (n ??= new Map(t.snapshots), n.set(r, {
235
+ ...i,
236
+ chats: i.chats.map((t) => t.id === e ? {
237
+ id: t.id,
238
+ title: t.title
239
+ } : t)
240
+ }));
241
+ return n ? {
242
+ ...t,
243
+ snapshots: n
244
+ } : t;
245
+ }));
246
+ }, []);
247
+ return {
248
+ projects: o(() => {
249
+ if (!v) return m;
250
+ let e = /* @__PURE__ */ new Set(), t = [];
251
+ for (let n of u) {
252
+ if (e.has(n)) continue;
253
+ e.add(n);
254
+ let r = b.snapshots.get(n);
255
+ r && t.push(r);
256
+ }
257
+ return t;
258
+ }, [
259
+ v,
260
+ u,
261
+ b.snapshots
262
+ ]),
263
+ isLoading: z,
264
+ markViewed: H,
265
+ refresh: L
266
+ };
267
+ };
268
+ //#endregion
269
+ export { l as PINNED_PROJECT_CHATS_LIMIT, v as usePinnedProjectChats };
@@ -0,0 +1,53 @@
1
+ import { ProjectDetailsDto } from '@epam/ai-dial-chat-api-client';
2
+ import { ProjectsApiClient } from './projects-api-client';
3
+ /** Which project action failed, for the host's error message. */
4
+ export declare enum ProjectActionError {
5
+ Pin = "pin",
6
+ Unpin = "unpin",
7
+ Download = "download",
8
+ Delete = "delete",
9
+ /** The delete lost to a concurrent change; the project should be reloaded. */
10
+ ChangedElsewhere = "changed-elsewhere"
11
+ }
12
+ /** Host behaviour the project actions delegate to. */
13
+ export interface ProjectActionsHandlers {
14
+ /** Whether the project is in the caller's pins. */
15
+ isPinned: boolean;
16
+ /** Persists the pin state; rejects on failure. */
17
+ setPinned: (projectId: string, isPinned: boolean) => Promise<void>;
18
+ /** Saves a downloaded response as a file and resolves the saved name. */
19
+ saveFile: (response: Response, fileName: string) => Promise<string>;
20
+ /** Called after the archive was saved, with the saved file name. */
21
+ onArchiveDownloaded?: (savedName: string) => void;
22
+ /** Called after the project was deleted; the host updates pins and navigates away. */
23
+ onDeleted: (project: ProjectDetailsDto) => void;
24
+ /** Called with a failed action and its trace id; the host shows the message. */
25
+ onError: (error: ProjectActionError, requestId?: string) => void;
26
+ /** Re-reads the project, e.g. after a delete lost to a concurrent change. */
27
+ onReload: () => void;
28
+ /** Whether the delete confirmation is open, when the host owns that state. Defaults to the hook's own state. */
29
+ isDeleteOpen?: boolean;
30
+ /** Called with the new state whenever the delete confirmation opens or closes: a request, a cancel, a success or a conflict. */
31
+ onDeleteOpenChange?: (isOpen: boolean) => void;
32
+ }
33
+ /**
34
+ * Pin, archive and context-file downloads, and the confirmed delete of one
35
+ * loaded project, with their in-flight state. Messages, notifications, pins
36
+ * and navigation stay with the host through `handlers`.
37
+ *
38
+ * @param client - Configured project requests, from `createProjectsApiClient`.
39
+ * @param project - The loaded project, or `null` while none is loaded.
40
+ * @param handlers - Host behaviour the actions delegate to.
41
+ */
42
+ export declare const useProjectActions: (client: Pick<ProjectsApiClient, "deleteProject" | "downloadProjectArchive">, project: ProjectDetailsDto | null, { isPinned, setPinned, saveFile, onArchiveDownloaded, onDeleted, onError, onReload, isDeleteOpen: controlledDeleteOpen, onDeleteOpenChange, }: ProjectActionsHandlers) => {
43
+ isPinned: boolean;
44
+ isPinPending: boolean;
45
+ togglePin: () => Promise<void>;
46
+ downloadArchive: () => Promise<void>;
47
+ isDeleteOpen: boolean;
48
+ isDeleting: boolean;
49
+ requestDelete: () => void;
50
+ cancelDelete: () => void;
51
+ confirmDelete: () => Promise<void>;
52
+ };
53
+ //# sourceMappingURL=use-project-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-project-actions.d.ts","sourceRoot":"","sources":["../../src/project/use-project-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,iEAAiE;AACjE,oBAAY,kBAAkB;IAC5B,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,8EAA8E;IAC9E,gBAAgB,sBAAsB;CACvC;AAED,sDAAsD;AACtD,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAA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