@memberjunction/ng-conversations 6.2.0-edge.0 → 6.2.0-edge.1

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 (343) hide show
  1. package/README.md +35 -2
  2. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
  3. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
  4. package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
  5. package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
  6. package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
  7. package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
  8. package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
  9. package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
  10. package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
  11. package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
  12. package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
  13. package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
  14. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
  15. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
  16. package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
  17. package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
  18. package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
  19. package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
  20. package/dist/lib/components/attachment/image-viewer.component.js +181 -47
  21. package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
  22. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
  23. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
  24. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
  25. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
  26. package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
  27. package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
  28. package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
  29. package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
  30. package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
  31. package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
  32. package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
  33. package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
  34. package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
  35. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  36. package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
  37. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  38. package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
  39. package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
  40. package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
  41. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
  42. package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
  43. package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
  44. package/dist/lib/components/collection/collection-tree.component.js +220 -70
  45. package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
  46. package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
  47. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  48. package/dist/lib/components/collection/collection-view.component.js +154 -40
  49. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  50. package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
  51. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  52. package/dist/lib/components/collection/collections-full-view.component.js +951 -367
  53. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  54. package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
  55. package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
  56. package/dist/lib/components/composer/ai-composer.component.js +388 -44
  57. package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
  58. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
  59. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
  60. package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
  61. package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
  62. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1090 -123
  63. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  64. package/dist/lib/components/conversation/conversation-chat-area.component.js +2399 -706
  65. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  66. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +139 -19
  67. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
  68. package/dist/lib/components/conversation/conversation-empty-state.component.js +296 -59
  69. package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
  70. package/dist/lib/components/conversation/conversation-list.component.d.ts +579 -78
  71. package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
  72. package/dist/lib/components/conversation/conversation-list.component.js +2322 -823
  73. package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
  74. package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts +40 -4
  75. package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts.map +1 -1
  76. package/dist/lib/components/conversation/pinned-messages-panel.component.js +72 -14
  77. package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
  78. package/dist/lib/components/dialogs/input-dialog.component.d.ts +57 -11
  79. package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
  80. package/dist/lib/components/dialogs/input-dialog.component.js +128 -16
  81. package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
  82. package/dist/lib/components/dialogs/rating-dialog.component.d.ts +68 -10
  83. package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -1
  84. package/dist/lib/components/dialogs/rating-dialog.component.js +151 -27
  85. package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -1
  86. package/dist/lib/components/export/export-modal.component.d.ts +84 -10
  87. package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
  88. package/dist/lib/components/export/export-modal.component.js +173 -49
  89. package/dist/lib/components/export/export-modal.component.js.map +1 -1
  90. package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts +29 -3
  91. package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts.map +1 -1
  92. package/dist/lib/components/global-tasks/global-tasks-panel.component.js +58 -12
  93. package/dist/lib/components/global-tasks/global-tasks-panel.component.js.map +1 -1
  94. package/dist/lib/components/library/library-full-view.component.d.ts +57 -8
  95. package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
  96. package/dist/lib/components/library/library-full-view.component.js +119 -35
  97. package/dist/lib/components/library/library-full-view.component.js.map +1 -1
  98. package/dist/lib/components/members/members-modal.component.d.ts +76 -10
  99. package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
  100. package/dist/lib/components/members/members-modal.component.js +164 -50
  101. package/dist/lib/components/members/members-modal.component.js.map +1 -1
  102. package/dist/lib/components/message/actionable-commands.component.d.ts +37 -5
  103. package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
  104. package/dist/lib/components/message/actionable-commands.component.js +82 -16
  105. package/dist/lib/components/message/actionable-commands.component.js.map +1 -1
  106. package/dist/lib/components/message/conversation-message-rating.component.d.ts +46 -10
  107. package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
  108. package/dist/lib/components/message/conversation-message-rating.component.js +120 -36
  109. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  110. package/dist/lib/components/message/message-input.component.d.ts +549 -74
  111. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  112. package/dist/lib/components/message/message-input.component.js +1250 -421
  113. package/dist/lib/components/message/message-input.component.js.map +1 -1
  114. package/dist/lib/components/message/message-item.component.d.ts +411 -29
  115. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  116. package/dist/lib/components/message/message-item.component.js +896 -222
  117. package/dist/lib/components/message/message-item.component.js.map +1 -1
  118. package/dist/lib/components/message/message-list.component.d.ts +288 -29
  119. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  120. package/dist/lib/components/message/message-list.component.js +561 -123
  121. package/dist/lib/components/message/message-list.component.js.map +1 -1
  122. package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
  123. package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
  124. package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
  125. package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
  126. package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
  127. package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
  128. package/dist/lib/components/notification/activity-indicator.component.js +13 -3
  129. package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
  130. package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
  131. package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
  132. package/dist/lib/components/notification/notification-badge.component.js +36 -8
  133. package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
  134. package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
  135. package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
  136. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  137. package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
  138. package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
  139. package/dist/lib/components/project/project-form-modal.component.js +348 -87
  140. package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
  141. package/dist/lib/components/project/project-selector.component.d.ts +78 -8
  142. package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
  143. package/dist/lib/components/project/project-selector.component.js +177 -46
  144. package/dist/lib/components/project/project-selector.component.js.map +1 -1
  145. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +1 -1
  146. package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
  147. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  148. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +1 -1
  149. package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
  150. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  151. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +2 -2
  152. package/dist/lib/components/realtime/realtime-session-overlay.component.js +18 -18
  153. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  154. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -23
  155. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
  156. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +136 -92
  157. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
  158. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +2 -2
  159. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
  160. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  161. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +1 -1
  162. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
  163. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  164. package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
  165. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  166. package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
  167. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  168. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +3 -1
  169. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  170. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +6 -2
  171. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  172. package/dist/lib/components/search/search-panel.component.d.ts +133 -22
  173. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  174. package/dist/lib/components/search/search-panel.component.js +312 -83
  175. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  176. package/dist/lib/components/share/share-modal.component.d.ts +69 -9
  177. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  178. package/dist/lib/components/share/share-modal.component.js +139 -31
  179. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  180. package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
  181. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
  182. package/dist/lib/components/shared/user-picker.component.js +110 -30
  183. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  184. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
  185. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
  186. package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
  187. package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
  188. package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
  189. package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
  190. package/dist/lib/components/sidebar/routines-section.component.js +25 -5
  191. package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
  192. package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
  193. package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
  194. package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
  195. package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
  196. package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
  197. package/dist/lib/components/task/tasks-full-view.component.js +223 -75
  198. package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
  199. package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
  200. package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
  201. package/dist/lib/components/tasks/task-widget.component.js +100 -16
  202. package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
  203. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
  204. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
  205. package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
  206. package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
  207. package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
  208. package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
  209. package/dist/lib/components/thread/thread-panel.component.js +146 -36
  210. package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
  211. package/dist/lib/components/toast/toast.component.d.ts +11 -1
  212. package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
  213. package/dist/lib/components/toast/toast.component.js +25 -5
  214. package/dist/lib/components/toast/toast.component.js.map +1 -1
  215. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
  216. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  217. package/dist/lib/components/workspace/conversation-workspace.component.js +887 -291
  218. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  219. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
  220. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
  221. package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
  222. package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
  223. package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
  224. package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
  225. package/dist/lib/directives/chat-slot.directive.js.map +1 -1
  226. package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
  227. package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
  228. package/dist/lib/directives/search-shortcut.directive.js +14 -4
  229. package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
  230. package/dist/lib/events/chat-events.d.ts +34 -7
  231. package/dist/lib/events/chat-events.d.ts.map +1 -1
  232. package/dist/lib/events/chat-events.js +37 -7
  233. package/dist/lib/events/chat-events.js.map +1 -1
  234. package/dist/lib/models/agent-turn.model.d.ts +103 -0
  235. package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
  236. package/dist/lib/models/agent-turn.model.js +12 -0
  237. package/dist/lib/models/agent-turn.model.js.map +1 -0
  238. package/dist/lib/models/collection-view.model.js.map +1 -1
  239. package/dist/lib/models/conversation-state.model.d.ts +8 -0
  240. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  241. package/dist/lib/models/conversation-state.model.js.map +1 -1
  242. package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
  243. package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
  244. package/dist/lib/models/lazy-artifact-info.js +98 -34
  245. package/dist/lib/models/lazy-artifact-info.js.map +1 -1
  246. package/dist/lib/services/active-tasks.service.d.ts +30 -4
  247. package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
  248. package/dist/lib/services/active-tasks.service.js +71 -19
  249. package/dist/lib/services/active-tasks.service.js.map +1 -1
  250. package/dist/lib/services/agent-state.service.d.ts +17 -1
  251. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  252. package/dist/lib/services/agent-state.service.js +48 -16
  253. package/dist/lib/services/agent-state.service.js.map +1 -1
  254. package/dist/lib/services/artifact-permission.service.d.ts +39 -0
  255. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  256. package/dist/lib/services/artifact-permission.service.js +152 -17
  257. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  258. package/dist/lib/services/artifact-state.service.d.ts +58 -5
  259. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  260. package/dist/lib/services/artifact-state.service.js +135 -35
  261. package/dist/lib/services/artifact-state.service.js.map +1 -1
  262. package/dist/lib/services/collection-permission.service.d.ts +28 -0
  263. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  264. package/dist/lib/services/collection-permission.service.js +88 -32
  265. package/dist/lib/services/collection-permission.service.js.map +1 -1
  266. package/dist/lib/services/collection-state.service.d.ts +11 -1
  267. package/dist/lib/services/collection-state.service.d.ts.map +1 -1
  268. package/dist/lib/services/collection-state.service.js +25 -5
  269. package/dist/lib/services/collection-state.service.js.map +1 -1
  270. package/dist/lib/services/conversation-agent.service.d.ts +26 -4
  271. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  272. package/dist/lib/services/conversation-agent.service.js +57 -18
  273. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  274. package/dist/lib/services/conversation-attachment.service.d.ts +17 -0
  275. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  276. package/dist/lib/services/conversation-attachment.service.js +38 -10
  277. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  278. package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
  279. package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
  280. package/dist/lib/services/conversation-streaming.service.js +50 -10
  281. package/dist/lib/services/conversation-streaming.service.js.map +1 -1
  282. package/dist/lib/services/data-cache.service.d.ts +31 -0
  283. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  284. package/dist/lib/services/data-cache.service.js +71 -15
  285. package/dist/lib/services/data-cache.service.js.map +1 -1
  286. package/dist/lib/services/dialog.service.d.ts +13 -0
  287. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  288. package/dist/lib/services/dialog.service.js +25 -5
  289. package/dist/lib/services/dialog.service.js.map +1 -1
  290. package/dist/lib/services/export.service.d.ts +2 -0
  291. package/dist/lib/services/export.service.d.ts.map +1 -1
  292. package/dist/lib/services/export.service.js +5 -1
  293. package/dist/lib/services/export.service.js.map +1 -1
  294. package/dist/lib/services/mention-parser.service.d.ts +10 -0
  295. package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
  296. package/dist/lib/services/mention-parser.service.js +25 -5
  297. package/dist/lib/services/mention-parser.service.js.map +1 -1
  298. package/dist/lib/services/notification.service.d.ts +54 -6
  299. package/dist/lib/services/notification.service.d.ts.map +1 -1
  300. package/dist/lib/services/notification.service.js +123 -27
  301. package/dist/lib/services/notification.service.js.map +1 -1
  302. package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
  303. package/dist/lib/services/realtime-audio-recorder.js +12 -12
  304. package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
  305. package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
  306. package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
  307. package/dist/lib/services/realtime-pcm-wav.js +10 -2
  308. package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
  309. package/dist/lib/services/search.service.d.ts +42 -9
  310. package/dist/lib/services/search.service.d.ts.map +1 -1
  311. package/dist/lib/services/search.service.js +103 -23
  312. package/dist/lib/services/search.service.js.map +1 -1
  313. package/dist/lib/services/toast.service.d.ts +19 -1
  314. package/dist/lib/services/toast.service.d.ts.map +1 -1
  315. package/dist/lib/services/toast.service.js +45 -9
  316. package/dist/lib/services/toast.service.js.map +1 -1
  317. package/dist/lib/services/ui-command-handler.service.d.ts +16 -2
  318. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  319. package/dist/lib/services/ui-command-handler.service.js +36 -8
  320. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  321. package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
  322. package/dist/lib/utils/agent-artifact-summary.js +3 -3
  323. package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
  324. package/dist/lib/utils/agent-turn-routing.d.ts +69 -0
  325. package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
  326. package/dist/lib/utils/agent-turn-routing.js +96 -0
  327. package/dist/lib/utils/agent-turn-routing.js.map +1 -0
  328. package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
  329. package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
  330. package/dist/lib/utils/artifact-panel-action.js +10 -2
  331. package/dist/lib/utils/artifact-panel-action.js.map +1 -1
  332. package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
  333. package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
  334. package/dist/lib/utils/distinct-artifacts.js +5 -1
  335. package/dist/lib/utils/distinct-artifacts.js.map +1 -1
  336. package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
  337. package/dist/lib/utils/plan-mode-preference.js +6 -6
  338. package/dist/lib/utils/plan-mode-preference.js.map +1 -1
  339. package/dist/public-api.d.ts +3 -0
  340. package/dist/public-api.d.ts.map +1 -1
  341. package/dist/public-api.js +3 -0
  342. package/dist/public-api.js.map +1 -1
  343. package/package.json +32 -32
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-attachment.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAOL,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EAGvC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAEpD;;;GAGG;AAIH,MAAM,OAAO,6BAA6B;IACxC;;;;;;;;;;;;;;;OAeG;IACc,SAAS,GAAyB,IAAI,0BAA0B,EAAE,CAAC;IAE5E,SAAS,GAA6B,IAAI,CAAC;IAEnD,gBAAe,CAAC;IAEhB;;OAEG;IACH,IAAW,QAAQ,CAAC,KAA+B;QAC/C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,IAAI,Q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AAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YACrC,CAAC;YAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;YACnC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,IAAU;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC;YACvD,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,cAAc;QACpB,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;uHAngBU,6BAA6B;gEAA7B,6BAA6B,WAA7B,6BAA6B,mBAF5B,MAAM;;iFAEP,6BAA6B;cAHzC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { RunView, Metadata, UserInfo, IMetadataProvider } from '@memberjunction/core';\nimport {\n MJConversationDetailAttachmentEntity,\n MJConversationDetailArtifactEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity,\n MJAIModalityEntity,\n MJAIAgentEntity,\n ArtifactMetadataEngine\n} from '@memberjunction/core-entities';\nimport {\n ConversationUtility,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n AttachmentContent,\n AttachmentType\n} from '@memberjunction/ai-core-plus';\nimport type { IAttachmentBlobStore } from '@memberjunction/ai-core-plus';\nimport { GraphQLAttachmentBlobStore } from './graphql-attachment-blob-store';\nimport { MessageAttachment } from '../components/message/message-item.component';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Service for managing conversation attachments.\n * Handles loading, saving, and converting attachments between different formats.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAttachmentService {\n /**\n * Where attachment bytes go when they are too large to store inline.\n *\n * Held directly rather than read off the shared `ConversationAttachmentService` in\n * `@memberjunction/aiengine`. That package's entry point imports Node's `crypto`\n * (`AIEngine.ts`, for an embedding-cache key), so a runtime import of it from here pulls the\n * whole server AI engine into Explorer's browser bundle and the build fails to resolve `crypto`.\n * The shared service is a server-side consumer of the same seam, not a dependency of this one.\n *\n * The seam's *type* used to be imported from there with `import type`, on the reasoning that an\n * erased import costs nothing. It does at runtime — but the class-registration manifest generator\n * walks **package.json**, so the declared dependency was a live edge regardless, and it later\n * carried `@memberjunction/storage`'s drivers into the browser manifest. Both the contract and\n * the placement policy (`ConversationUtility`) now come from `@memberjunction/ai-core-plus`, and\n * this package does not declare `aiengine` at all.\n */\n private readonly blobStore: IAttachmentBlobStore = new GraphQLAttachmentBlobStore();\n\n private _provider: IMetadataProvider | null = null;\n\n constructor() {}\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all attachments for a list of conversation detail IDs.\n * Returns a map of ConversationDetailID -> MessageAttachment[]\n */\n async loadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n const result = new Map<string, MessageAttachment[]>();\n\n if (!conversationDetailIds || conversationDetailIds.length === 0) {\n return result;\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const idList = conversationDetailIds.map(id => `'${id}'`).join(',');\n\n // Load input artifacts (ConversationDetailArtifact with Direction='Input').\n // Since the backfill migration (V202605271400__Backfill_Attachment_Artifacts)\n // converted all legacy ConversationDetailAttachment rows to artifact pairs,\n // the artifact junction is the single source of truth — no separate attachment\n // query needed.\n const artifactLinksResult = await rv.RunView<MJConversationDetailArtifactEntity>({\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${idList}) AND Direction = 'Input'`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (artifactLinksResult.Success && artifactLinksResult.Results && artifactLinksResult.Results.length > 0) {\n // Load the referenced artifact versions AND their parent artifacts in parallel\n // so we can resolve the semantic artifact-type name for the tile badge.\n const versionIds = artifactLinksResult.Results.map(l => `'${l.ArtifactVersionID}'`).join(',');\n const versionsResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds})`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (versionsResult.Success && versionsResult.Results) {\n const versionMap = new Map<string, MJArtifactVersionEntity>();\n for (const v of versionsResult.Results) {\n versionMap.set(v.ID, v);\n }\n\n // Bulk-load parent artifacts to get TypeID, then resolve type names via cached engine.\n const artifactIds = Array.from(new Set(versionsResult.Results.map(v => v.ArtifactID).filter(Boolean)));\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactIdList = artifactIds.map(id => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIdList})`,\n ResultType: 'entity_object'\n }, contextUser);\n if (artifactsResult.Success && artifactsResult.Results) {\n for (const a of artifactsResult.Results) {\n artifactMap.set(a.ID, a);\n }\n }\n // Ensure the artifact-type cache is populated so FindArtifactTypeByID resolves.\n await ArtifactMetadataEngine.Instance.Config(false, contextUser);\n }\n\n for (const link of artifactLinksResult.Results) {\n const version = versionMap.get(link.ArtifactVersionID);\n if (version) {\n const parentArtifact = artifactMap.get(version.ArtifactID);\n const artifactType = parentArtifact\n ? ArtifactMetadataEngine.Instance.FindArtifactTypeByID(parentArtifact.TypeID)\n : undefined;\n const detailId = link.ConversationDetailID;\n if (!result.has(detailId)) {\n result.set(detailId, []);\n }\n result.get(detailId)!.push({\n id: link.ID,\n type: version.ContentMode === 'File' ? this.getMimeAttachmentType(version.MimeType || '') : 'Document',\n mimeType: version.MimeType || 'text/plain',\n fileName: version.FileName || version.Name || 'Artifact',\n sizeBytes: version.ContentSizeBytes || 0,\n source: 'artifact',\n artifactId: version.ArtifactID || undefined,\n artifactVersionId: version.ID,\n artifactTypeName: artifactType?.Name || undefined\n } as MessageAttachment);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error loading attachments:', error);\n }\n\n return result;\n }\n\n /**\n * Load attachments for a single message\n */\n async loadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n const map = await this.loadAttachmentsForMessages([conversationDetailId], contextUser);\n return map.get(conversationDetailId) || [];\n }\n\n /**\n * Save pending attachments to the database.\n * Returns the saved attachment entities.\n *\n * @param conversationDetailId - ID of the conversation detail to attach to\n * @param pendingAttachments - Array of pending attachments from the mention editor\n * @param contextUser - User context for the operation\n * @param agent - The agent this turn is addressed to, when the caller has resolved one. Only its\n * `InlineStorageThresholdBytes` is read, and only to make the inline-vs-storage decision match\n * what the server would decide for the same file. Omitting it falls back to the system default,\n * which is correct for a turn with no agent — but a caller that HAS an agent and does not pass\n * it produces the cross-surface drift this shared policy exists to remove.\n */\n async saveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n const savedAttachments: MJConversationDetailAttachmentEntity[] = [];\n const rejectionMessages: string[] = [];\n const md = this.Provider;\n\n for (let i = 0; i < pendingAttachments.length; i++) {\n const pending = pendingAttachments[i];\n\n try {\n const attachment = await md.GetEntityObject<MJConversationDetailAttachmentEntity>(\n 'MJ: Conversation Detail Attachments',\n contextUser\n );\n\n // Determine attachment type from MIME type\n const attachmentType = ConversationUtility.GetAttachmentTypeFromMime(pending.mimeType);\n\n attachment.ConversationDetailID = conversationDetailId;\n attachment.ModalityID = this.getModalityIdForType(attachmentType);\n attachment.MimeType = pending.mimeType;\n attachment.FileName = pending.fileName;\n attachment.FileSizeBytes = pending.sizeBytes;\n attachment.Width = pending.width ?? null;\n attachment.Height = pending.height ?? null;\n attachment.DurationSeconds = null; // PendingAttachment doesn't have duration\n attachment.DisplayOrder = i;\n attachment.ThumbnailBase64 = pending.thumbnailUrl ?? null;\n\n // For artifact references, create a ConversationDetailArtifact with Direction='Input'\n // instead of a ConversationDetailAttachment\n if (pending.source === 'artifact' && pending.artifactVersionId) {\n const artifactLink = await md.GetEntityObject<MJConversationDetailArtifactEntity>(\n 'MJ: Conversation Detail Artifacts',\n contextUser\n );\n artifactLink.ConversationDetailID = conversationDetailId;\n artifactLink.ArtifactVersionID = pending.artifactVersionId;\n artifactLink.Direction = 'Input';\n const artifactSaved = await artifactLink.Save();\n if (!artifactSaved) {\n console.error('Failed to save artifact input link:', artifactLink.LatestResult);\n }\n continue; // Skip creating a ConversationDetailAttachment for artifacts\n }\n\n // Storage placement is NOT this service's decision. `ConversationUtility.ShouldStoreInline`\n // owns it — honouring an agent's `InlineStorageThresholdBytes` before the system default —\n // and it is the same call the server and the mobile app make. This service previously set\n // `InlineData` unconditionally, so a large image went into a database column instead of\n // MJStorage, contradicting the entity's own contract that the two are mutually exclusive\n // and sized.\n if (pending.dataUrl) {\n const base64Data = this.extractBase64FromDataUrl(pending.dataUrl);\n const storeInline = ConversationUtility.ShouldStoreInline(\n pending.sizeBytes,\n agent?.InlineStorageThresholdBytes ?? null,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n );\n\n if (storeInline) {\n attachment.InlineData = base64Data;\n } else {\n const stored = await this.blobStore.Upload(\n { FileName: pending.fileName, MimeType: pending.mimeType, Base64Data: base64Data },\n contextUser ?? md.CurrentUser,\n md,\n );\n if (!stored?.Success || !stored.FileID) {\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" is too large to store inline and could not be uploaded: ${stored?.Error ?? 'storage is not available.'}`,\n );\n continue;\n }\n attachment.FileID = stored.FileID;\n }\n }\n\n const saved = await attachment.Save();\n if (saved) {\n savedAttachments.push(attachment);\n } else {\n const message = attachment.LatestResult?.CompleteMessage\n ?? `Attachment \"${pending.fileName}\" was rejected by the server.`;\n console.error('Failed to save attachment:', attachment.LatestResult);\n rejectionMessages.push(message);\n }\n } catch (error) {\n console.error('Error saving attachment:', error);\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" failed to upload: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Surface server-side rejections (e.g. unregistered MIME types) to the\n // caller — throwing here lets the message-input toast pipeline display\n // the actual server message rather than silently dropping the file.\n if (rejectionMessages.length > 0) {\n throw new Error(rejectionMessages.join('\\n'));\n }\n\n return savedAttachments;\n }\n\n /**\n * Create attachment reference tokens for message text.\n * These tokens are stored in the Message field to reference attachments.\n */\n createAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return attachments\n .map(att => {\n const content: AttachmentContent = {\n _mode: 'attachment',\n id: att.ID,\n type: this.getAttachmentTypeFromModality(att.ModalityID),\n mimeType: att.MimeType,\n fileName: att.FileName ?? undefined,\n sizeBytes: att.FileSizeBytes,\n width: att.Width ?? undefined,\n height: att.Height ?? undefined,\n durationSeconds: att.DurationSeconds ?? undefined,\n thumbnailBase64: att.ThumbnailBase64 ?? undefined\n };\n return ConversationUtility.CreateAttachmentReference(content);\n })\n .join(' ');\n }\n\n /**\n * Convert a database entity to a MessageAttachment for display\n */\n private convertToMessageAttachment(entity: MJConversationDetailAttachmentEntity): MessageAttachment {\n // Determine content URL\n let contentUrl: string | undefined;\n let thumbnailUrl: string | undefined;\n\n if (entity.InlineData) {\n // Create data URL from inline data\n contentUrl = `data:${entity.MimeType};base64,${entity.InlineData}`;\n } else if (entity.FileID) {\n // TODO: Integrate with MJStorage to get pre-authenticated URL\n contentUrl = undefined; // Will need to be loaded separately\n }\n\n // Use thumbnail if available\n if (entity.ThumbnailBase64) {\n thumbnailUrl = entity.ThumbnailBase64.startsWith('data:')\n ? entity.ThumbnailBase64\n : `data:image/jpeg;base64,${entity.ThumbnailBase64}`;\n }\n\n return {\n id: entity.ID,\n type: this.getAttachmentTypeFromModality(entity.ModalityID),\n mimeType: entity.MimeType,\n fileName: entity.FileName,\n sizeBytes: entity.FileSizeBytes,\n width: entity.Width ?? undefined,\n height: entity.Height ?? undefined,\n thumbnailUrl: thumbnailUrl,\n contentUrl: contentUrl\n };\n }\n\n /**\n * Get the AttachmentType from a modality ID\n */\n private getAttachmentTypeFromModality(modalityId: string): AttachmentType {\n const modality = AIEngineBase.Instance.Modalities.find(m => UUIDsEqual(m.ID, modalityId))\n\n const name = modality?.Name?.toLowerCase() || '';\n\n if (name === 'image') return 'Image';\n if (name === 'video') return 'Video';\n if (name === 'audio') return 'Audio';\n\n return 'Document';\n }\n\n /**\n * Get the AttachmentType from a MIME type string\n */\n private getMimeAttachmentType(mimeType: string): 'Image' | 'Video' | 'Audio' | 'Document' {\n if (mimeType.startsWith('image/')) return 'Image';\n if (mimeType.startsWith('video/')) return 'Video';\n if (mimeType.startsWith('audio/')) return 'Audio';\n return 'Document';\n }\n\n /**\n * Get the modality ID for an attachment type\n */\n private getModalityIdForType(type: AttachmentType): string {\n // Map AttachmentType to modality name\n // AttachmentType is 'Image' | 'Video' | 'Audio' | 'Document'\n // Modality names are 'Image', 'Audio', 'Video', 'File'\n let modalityName = type.toLowerCase().trim();\n if (modalityName === 'document') {\n modalityName = 'file';\n }\n\n const modality = AIEngineBase.Instance.Modalities.find(m => m.Name?.trim().toLowerCase() === modalityName);\n if (modality) {\n return modality.ID;\n }\n\n // Fallback to 'file' modality if specific type not found\n // recursive call, so long as the current modality isn't file as that\n // would cause infinite recursion/stack overflow\n if (modalityName !== 'file') {\n return this.getModalityIdForType('Document');\n }\n else {\n return '';\n }\n }\n \n /**\n * Extract base64 data from a data URL\n */\n private extractBase64FromDataUrl(dataUrl: string): string {\n const matches = dataUrl.match(/^data:[^;]+;base64,(.+)$/);\n return matches ? matches[1] : dataUrl;\n }\n\n /**\n * Create a thumbnail from an image file.\n * Returns a base64 data URL of the thumbnail.\n */\n async createThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement('canvas');\n let width = img.width;\n let height = img.height;\n\n // Scale down to maxSize\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0, width, height);\n resolve(canvas.toDataURL('image/jpeg', 0.7));\n } else {\n resolve(null);\n }\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Get image dimensions from a file\n */\n async getImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Process a file and create a PendingAttachment.\n * This creates the data structure needed for the mention editor component.\n */\n async processFile(file: File): Promise<PendingAttachment> {\n // Read file data URL\n const dataUrl = await this.fileToDataUrl(file);\n\n const pending: PendingAttachment = {\n id: this.generateTempId(),\n file: file,\n dataUrl: dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size\n };\n\n // Get image dimensions and create thumbnail\n const type = ConversationUtility.GetAttachmentTypeFromMime(file.type);\n if (type === 'Image') {\n const dimensions = await this.getImageDimensions(file);\n if (dimensions) {\n pending.width = dimensions.width;\n pending.height = dimensions.height;\n }\n\n const thumbnail = await this.createThumbnail(file);\n if (thumbnail) {\n pending.thumbnailUrl = thumbnail;\n }\n }\n\n return pending;\n }\n\n /**\n * Convert a file to a data URL\n */\n private fileToDataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Generate a temporary ID for pending attachments\n */\n private generateTempId(): string {\n return `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n"]}
1
+ {"version":3,"file":"conversation-attachment.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAOL,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EAGvC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,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from '@memberjunction/core';\nimport {\n MJConversationDetailAttachmentEntity,\n MJConversationDetailArtifactEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity,\n MJAIModalityEntity,\n MJAIAgentEntity,\n ArtifactMetadataEngine\n} from '@memberjunction/core-entities';\nimport {\n ConversationUtility,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n AttachmentContent,\n AttachmentType\n} from '@memberjunction/ai-core-plus';\nimport type { IAttachmentBlobStore } from '@memberjunction/ai-core-plus';\nimport { GraphQLAttachmentBlobStore } from './graphql-attachment-blob-store';\nimport { MessageAttachment } from '../components/message/message-item.component';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Service for managing conversation attachments.\n * Handles loading, saving, and converting attachments between different formats.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAttachmentService {\n /**\n * Where attachment bytes go when they are too large to store inline.\n *\n * Held directly rather than read off the shared `ConversationAttachmentService` in\n * `@memberjunction/aiengine`. That package's entry point imports Node's `crypto`\n * (`AIEngine.ts`, for an embedding-cache key), so a runtime import of it from here pulls the\n * whole server AI engine into Explorer's browser bundle and the build fails to resolve `crypto`.\n * The shared service is a server-side consumer of the same seam, not a dependency of this one.\n *\n * The seam's *type* used to be imported from there with `import type`, on the reasoning that an\n * erased import costs nothing. It does at runtime — but the class-registration manifest generator\n * walks **package.json**, so the declared dependency was a live edge regardless, and it later\n * carried `@memberjunction/storage`'s drivers into the browser manifest. Both the contract and\n * the placement policy (`ConversationUtility`) now come from `@memberjunction/ai-core-plus`, and\n * this package does not declare `aiengine` at all.\n */\n private readonly blobStore: IAttachmentBlobStore = new GraphQLAttachmentBlobStore();\n\n private _provider: IMetadataProvider | null = null;\n\n constructor() {}\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all attachments for a list of conversation detail IDs.\n * Returns a map of ConversationDetailID -> MessageAttachment[]\n */\n async LoadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n const result = new Map<string, MessageAttachment[]>();\n\n if (!conversationDetailIds || conversationDetailIds.length === 0) {\n return result;\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const idList = conversationDetailIds.map(id => `'${id}'`).join(',');\n\n // Load input artifacts (ConversationDetailArtifact with Direction='Input').\n // Since the backfill migration (V202605271400__Backfill_Attachment_Artifacts)\n // converted all legacy ConversationDetailAttachment rows to artifact pairs,\n // the artifact junction is the single source of truth — no separate attachment\n // query needed.\n const artifactLinksResult = await rv.RunView<MJConversationDetailArtifactEntity>({\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${idList}) AND Direction = 'Input'`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (artifactLinksResult.Success && artifactLinksResult.Results && artifactLinksResult.Results.length > 0) {\n // Load the referenced artifact versions AND their parent artifacts in parallel\n // so we can resolve the semantic artifact-type name for the tile badge.\n const versionIds = artifactLinksResult.Results.map(l => `'${l.ArtifactVersionID}'`).join(',');\n const versionsResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds})`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (versionsResult.Success && versionsResult.Results) {\n const versionMap = new Map<string, MJArtifactVersionEntity>();\n for (const v of versionsResult.Results) {\n versionMap.set(v.ID, v);\n }\n\n // Bulk-load parent artifacts to get TypeID, then resolve type names via cached engine.\n const artifactIds = Array.from(new Set(versionsResult.Results.map(v => v.ArtifactID).filter(Boolean)));\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactIdList = artifactIds.map(id => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIdList})`,\n ResultType: 'entity_object'\n }, contextUser);\n if (artifactsResult.Success && artifactsResult.Results) {\n for (const a of artifactsResult.Results) {\n artifactMap.set(a.ID, a);\n }\n }\n // Ensure the artifact-type cache is populated so FindArtifactTypeByID resolves.\n await ArtifactMetadataEngine.Instance.Config(false, contextUser);\n }\n\n for (const link of artifactLinksResult.Results) {\n const version = versionMap.get(link.ArtifactVersionID);\n if (version) {\n const parentArtifact = artifactMap.get(version.ArtifactID);\n const artifactType = parentArtifact\n ? ArtifactMetadataEngine.Instance.FindArtifactTypeByID(parentArtifact.TypeID)\n : undefined;\n const detailId = link.ConversationDetailID;\n if (!result.has(detailId)) {\n result.set(detailId, []);\n }\n result.get(detailId)!.push({\n id: link.ID,\n type: version.ContentMode === 'File' ? this.getMimeAttachmentType(version.MimeType || '') : 'Document',\n mimeType: version.MimeType || 'text/plain',\n fileName: version.FileName || version.Name || 'Artifact',\n sizeBytes: version.ContentSizeBytes || 0,\n source: 'artifact',\n artifactId: version.ArtifactID || undefined,\n artifactVersionId: version.ID,\n artifactTypeName: artifactType?.Name || undefined\n } as MessageAttachment);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error loading attachments:', error);\n }\n\n return result;\n }\n\n /** @deprecated Use {@link LoadAttachmentsForMessages}. */\n async loadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n return this.LoadAttachmentsForMessages(conversationDetailIds, contextUser);\n }\n\n /**\n * Load attachments for a single message\n */\n async LoadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n const map = await this.LoadAttachmentsForMessages([conversationDetailId], contextUser);\n return map.get(conversationDetailId) || [];\n }\n\n /** @deprecated Use {@link LoadAttachmentsForMessage}. */\n async loadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n return this.LoadAttachmentsForMessage(conversationDetailId, contextUser);\n }\n\n /**\n * Save pending attachments to the database.\n * Returns the saved attachment entities.\n *\n * @param conversationDetailId - ID of the conversation detail to attach to\n * @param pendingAttachments - Array of pending attachments from the mention editor\n * @param contextUser - User context for the operation\n * @param agent - The agent this turn is addressed to, when the caller has resolved one. Only its\n * `InlineStorageThresholdBytes` is read, and only to make the inline-vs-storage decision match\n * what the server would decide for the same file. Omitting it falls back to the system default,\n * which is correct for a turn with no agent — but a caller that HAS an agent and does not pass\n * it produces the cross-surface drift this shared policy exists to remove.\n */\n async SaveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n const savedAttachments: MJConversationDetailAttachmentEntity[] = [];\n const rejectionMessages: string[] = [];\n const md = this.Provider;\n\n for (let i = 0; i < pendingAttachments.length; i++) {\n const pending = pendingAttachments[i];\n\n try {\n const attachment = await md.GetEntityObject<MJConversationDetailAttachmentEntity>(\n 'MJ: Conversation Detail Attachments',\n contextUser\n );\n\n // Determine attachment type from MIME type\n const attachmentType = ConversationUtility.GetAttachmentTypeFromMime(pending.mimeType);\n\n attachment.ConversationDetailID = conversationDetailId;\n attachment.ModalityID = this.getModalityIdForType(attachmentType);\n attachment.MimeType = pending.mimeType;\n attachment.FileName = pending.fileName;\n attachment.FileSizeBytes = pending.sizeBytes;\n attachment.Width = pending.width ?? null;\n attachment.Height = pending.height ?? null;\n attachment.DurationSeconds = null; // PendingAttachment doesn't have duration\n attachment.DisplayOrder = i;\n attachment.ThumbnailBase64 = pending.thumbnailUrl ?? null;\n\n // For artifact references, create a ConversationDetailArtifact with Direction='Input'\n // instead of a ConversationDetailAttachment\n if (pending.source === 'artifact' && pending.artifactVersionId) {\n const artifactLink = await md.GetEntityObject<MJConversationDetailArtifactEntity>(\n 'MJ: Conversation Detail Artifacts',\n contextUser\n );\n artifactLink.ConversationDetailID = conversationDetailId;\n artifactLink.ArtifactVersionID = pending.artifactVersionId;\n artifactLink.Direction = 'Input';\n const artifactSaved = await artifactLink.Save();\n if (!artifactSaved) {\n console.error('Failed to save artifact input link:', artifactLink.LatestResult);\n }\n continue; // Skip creating a ConversationDetailAttachment for artifacts\n }\n\n // Storage placement is NOT this service's decision. `ConversationUtility.ShouldStoreInline`\n // owns it — honouring an agent's `InlineStorageThresholdBytes` before the system default —\n // and it is the same call the server and the mobile app make. This service previously set\n // `InlineData` unconditionally, so a large image went into a database column instead of\n // MJStorage, contradicting the entity's own contract that the two are mutually exclusive\n // and sized.\n if (pending.dataUrl) {\n const base64Data = this.extractBase64FromDataUrl(pending.dataUrl);\n const storeInline = ConversationUtility.ShouldStoreInline(\n pending.sizeBytes,\n agent?.InlineStorageThresholdBytes ?? null,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n );\n\n if (storeInline) {\n attachment.InlineData = base64Data;\n } else {\n const stored = await this.blobStore.Upload(\n { FileName: pending.fileName, MimeType: pending.mimeType, Base64Data: base64Data },\n contextUser ?? md.CurrentUser,\n md,\n );\n if (!stored?.Success || !stored.FileID) {\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" is too large to store inline and could not be uploaded: ${stored?.Error ?? 'storage is not available.'}`,\n );\n continue;\n }\n attachment.FileID = stored.FileID;\n }\n }\n\n const saved = await attachment.Save();\n if (saved) {\n savedAttachments.push(attachment);\n } else {\n const message = attachment.LatestResult?.CompleteMessage\n ?? `Attachment \"${pending.fileName}\" was rejected by the server.`;\n console.error('Failed to save attachment:', attachment.LatestResult);\n rejectionMessages.push(message);\n }\n } catch (error) {\n console.error('Error saving attachment:', error);\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" failed to upload: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Surface server-side rejections (e.g. unregistered MIME types) to the\n // caller — throwing here lets the message-input toast pipeline display\n // the actual server message rather than silently dropping the file.\n if (rejectionMessages.length > 0) {\n throw new Error(rejectionMessages.join('\\n'));\n }\n\n return savedAttachments;\n }\n\n /** @deprecated Use {@link SaveAttachments}. */\n async saveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n return this.SaveAttachments(conversationDetailId, pendingAttachments, contextUser, agent);\n }\n\n /**\n * Create attachment reference tokens for message text.\n * These tokens are stored in the Message field to reference attachments.\n */\n CreateAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return attachments\n .map(att => {\n const content: AttachmentContent = {\n _mode: 'attachment',\n id: att.ID,\n type: this.getAttachmentTypeFromModality(att.ModalityID),\n mimeType: att.MimeType,\n fileName: att.FileName ?? undefined,\n sizeBytes: att.FileSizeBytes,\n width: att.Width ?? undefined,\n height: att.Height ?? undefined,\n durationSeconds: att.DurationSeconds ?? undefined,\n thumbnailBase64: att.ThumbnailBase64 ?? undefined\n };\n return ConversationUtility.CreateAttachmentReference(content);\n })\n .join(' ');\n }\n\n /** @deprecated Use {@link CreateAttachmentReferences}. */\n createAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return this.CreateAttachmentReferences(attachments);\n }\n\n /**\n * Convert a database entity to a MessageAttachment for display\n */\n private convertToMessageAttachment(entity: MJConversationDetailAttachmentEntity): MessageAttachment {\n // Determine content URL\n let contentUrl: string | undefined;\n let thumbnailUrl: string | undefined;\n\n if (entity.InlineData) {\n // Create data URL from inline data\n contentUrl = `data:${entity.MimeType};base64,${entity.InlineData}`;\n } else if (entity.FileID) {\n // TODO: Integrate with MJStorage to get pre-authenticated URL\n contentUrl = undefined; // Will need to be loaded separately\n }\n\n // Use thumbnail if available\n if (entity.ThumbnailBase64) {\n thumbnailUrl = entity.ThumbnailBase64.startsWith('data:')\n ? entity.ThumbnailBase64\n : `data:image/jpeg;base64,${entity.ThumbnailBase64}`;\n }\n\n return {\n id: entity.ID,\n type: this.getAttachmentTypeFromModality(entity.ModalityID),\n mimeType: entity.MimeType,\n fileName: entity.FileName,\n sizeBytes: entity.FileSizeBytes,\n width: entity.Width ?? undefined,\n height: entity.Height ?? undefined,\n thumbnailUrl: thumbnailUrl,\n contentUrl: contentUrl\n };\n }\n\n /**\n * Get the AttachmentType from a modality ID\n */\n private getAttachmentTypeFromModality(modalityId: string): AttachmentType {\n const modality = AIEngineBase.Instance.Modalities.find(m => UUIDsEqual(m.ID, modalityId))\n\n const name = modality?.Name?.toLowerCase() || '';\n\n if (name === 'image') return 'Image';\n if (name === 'video') return 'Video';\n if (name === 'audio') return 'Audio';\n\n return 'Document';\n }\n\n /**\n * Get the AttachmentType from a MIME type string\n */\n private getMimeAttachmentType(mimeType: string): 'Image' | 'Video' | 'Audio' | 'Document' {\n if (mimeType.startsWith('image/')) return 'Image';\n if (mimeType.startsWith('video/')) return 'Video';\n if (mimeType.startsWith('audio/')) return 'Audio';\n return 'Document';\n }\n\n /**\n * Get the modality ID for an attachment type\n */\n private getModalityIdForType(type: AttachmentType): string {\n // Map AttachmentType to modality name\n // AttachmentType is 'Image' | 'Video' | 'Audio' | 'Document'\n // Modality names are 'Image', 'Audio', 'Video', 'File'\n let modalityName = type.toLowerCase().trim();\n if (modalityName === 'document') {\n modalityName = 'file';\n }\n\n const modality = AIEngineBase.Instance.Modalities.find(m => m.Name?.trim().toLowerCase() === modalityName);\n if (modality) {\n return modality.ID;\n }\n\n // Fallback to 'file' modality if specific type not found\n // recursive call, so long as the current modality isn't file as that\n // would cause infinite recursion/stack overflow\n if (modalityName !== 'file') {\n return this.getModalityIdForType('Document');\n }\n else {\n return '';\n }\n }\n \n /**\n * Extract base64 data from a data URL\n */\n private extractBase64FromDataUrl(dataUrl: string): string {\n const matches = dataUrl.match(/^data:[^;]+;base64,(.+)$/);\n return matches ? matches[1] : dataUrl;\n }\n\n /**\n * Create a thumbnail from an image file.\n * Returns a base64 data URL of the thumbnail.\n */\n async CreateThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement('canvas');\n let width = img.width;\n let height = img.height;\n\n // Scale down to maxSize\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0, width, height);\n resolve(canvas.toDataURL('image/jpeg', 0.7));\n } else {\n resolve(null);\n }\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /** @deprecated Use {@link CreateThumbnail}. */\n async createThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return this.CreateThumbnail(file, maxSize);\n }\n\n /**\n * Get image dimensions from a file\n */\n async GetImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /** @deprecated Use {@link GetImageDimensions}. */\n async getImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return this.GetImageDimensions(file);\n }\n\n /**\n * Process a file and create a PendingAttachment.\n * This creates the data structure needed for the mention editor component.\n */\n async ProcessFile(file: File): Promise<PendingAttachment> {\n // Read file data URL\n const dataUrl = await this.fileToDataUrl(file);\n\n const pending: PendingAttachment = {\n id: this.generateTempId(),\n file: file,\n dataUrl: dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size\n };\n\n // Get image dimensions and create thumbnail\n const type = ConversationUtility.GetAttachmentTypeFromMime(file.type);\n if (type === 'Image') {\n const dimensions = await this.GetImageDimensions(file);\n if (dimensions) {\n pending.width = dimensions.width;\n pending.height = dimensions.height;\n }\n\n const thumbnail = await this.CreateThumbnail(file);\n if (thumbnail) {\n pending.thumbnailUrl = thumbnail;\n }\n }\n\n return pending;\n }\n\n /** @deprecated Use {@link ProcessFile}. */\n async processFile(file: File): Promise<PendingAttachment> {\n return this.ProcessFile(file);\n }\n\n /**\n * Convert a file to a data URL\n */\n private fileToDataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Generate a temporary ID for pending attachments\n */\n private generateTempId(): string {\n return `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n"]}
@@ -19,18 +19,40 @@ export declare class ConversationStreamingService implements OnDestroy {
19
19
  constructor(_bootstrap: ConversationsRuntimeBootstrap);
20
20
  private get streaming();
21
21
  /** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */
22
+ get CompletionEvents$(): Subject<CompletionEvent>;
23
+ /** @deprecated Use {@link CompletionEvents$}. */
22
24
  get completionEvents$(): Subject<CompletionEvent>;
23
25
  initialize(): void;
26
+ GetConnectionStatus$(): Observable<StreamingConnectionStatus>;
27
+ /** @deprecated Use {@link GetConnectionStatus$}. */
24
28
  getConnectionStatus$(): Observable<StreamingConnectionStatus>;
29
+ GetConnectionStatus(): StreamingConnectionStatus;
30
+ /** @deprecated Use {@link GetConnectionStatus}. */
25
31
  getConnectionStatus(): StreamingConnectionStatus;
32
+ RegisterMessageCallback(conversationDetailId: string, callback: MessageProgressCallback): void;
33
+ /** @deprecated Use {@link RegisterMessageCallback}. */
26
34
  registerMessageCallback(conversationDetailId: string, callback: MessageProgressCallback): void;
35
+ UnregisterMessageCallback(conversationDetailId: string, callback?: MessageProgressCallback): void;
36
+ /** @deprecated Use {@link UnregisterMessageCallback}. */
27
37
  unregisterMessageCallback(conversationDetailId: string, callback?: MessageProgressCallback): void;
38
+ GetRegisteredCallbackCount(): number;
39
+ /** @deprecated Use {@link GetRegisteredCallbackCount}. */
28
40
  getRegisteredCallbackCount(): number;
41
+ GetTrackedMessageCount(): number;
42
+ /** @deprecated Use {@link GetTrackedMessageCount}. */
29
43
  getTrackedMessageCount(): number;
44
+ GetRecentCompletion(conversationDetailId: string): {
45
+ agentRunId: string;
46
+ } | undefined;
47
+ /** @deprecated Use {@link GetRecentCompletion}. */
30
48
  getRecentCompletion(conversationDetailId: string): {
31
49
  agentRunId: string;
32
50
  } | undefined;
51
+ ClearRecentCompletion(conversationDetailId: string): void;
52
+ /** @deprecated Use {@link ClearRecentCompletion}. */
33
53
  clearRecentCompletion(conversationDetailId: string): void;
54
+ GetDiagnosticSnapshot(messageId: string): ReturnType<typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot>;
55
+ /** @deprecated Use {@link GetDiagnosticSnapshot}. */
34
56
  getDiagnosticSnapshot(messageId: string): ReturnType<typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot>;
35
57
  /**
36
58
  * Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-streaming.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EACH,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EACjC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;;AAG1F,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,GAC5B,CAAC;AAEF,qBACa,4BAA6B,YAAW,SAAS;gBAC9C,UAAU,EAAE,6BAA6B;IAIrD,OAAO,KAAK,SAAS,GAEpB;IAED,yFAAyF;IACzF,IAAW,iBAAiB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEvD;IAEM,UAAU,IAAI,IAAI;IAIlB,oBAAoB,IAAI,UAAU,CAAC,yBAAyB,CAAC;IAI7D,mBAAmB,IAAI,yBAAyB;IAIhD,uBAAuB,CAC1B,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,uBAAuB,GAClC,IAAI;IAIA,yBAAyB,CAC5B,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,CAAC,EAAE,uBAAuB,GACnC,IAAI;IAIA,0BAA0B,IAAI,MAAM;IAIpC,sBAAsB,IAAI,MAAM;IAIhC,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAIrF,qBAAqB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAIzD,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CACvD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CACvE;IAID;;;;;OAKG;IACI,WAAW,IAAI,IAAI;yCApEjB,4BAA4B;6CAA5B,4BAA4B;CAuExC"}
1
+ {"version":3,"file":"conversation-streaming.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,eAA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AA0D;IACnD,0BAA0B,IAAI,MAAM;IAIpC,sBAAsB,IAAI,MAAM;IAIvC,sDAAsD;IAC/C,sBAAsB,IAAI,MAAM;IAIhC,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAI5F,mDAAmD;IAC5C,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAIrF,qBAAqB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAIhE,qDAAqD;IAC9C,qBAAqB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAIzD,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CACvD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CACvE;IAID,qDAAqD;IAC9C,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CACvD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CACvE;IAID;;;;;OAKG;IACI,WAAW,IAAI,IAAI;yCA9HjB,4BAA4B;6CAA5B,4BAA4B;CAiIxC"}
@@ -21,39 +21,79 @@ export class ConversationStreamingService {
21
21
  return ConversationsRuntime.Instance.Streaming;
22
22
  }
23
23
  /** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */
24
- get completionEvents$() {
24
+ get CompletionEvents$() {
25
25
  return this.streaming.completionEvents$;
26
26
  }
27
+ /** @deprecated Use {@link CompletionEvents$}. */
28
+ get completionEvents$() {
29
+ return this.CompletionEvents$;
30
+ }
27
31
  initialize() {
28
32
  this.streaming.initialize();
29
33
  }
30
- getConnectionStatus$() {
34
+ GetConnectionStatus$() {
31
35
  return this.streaming.getConnectionStatus$();
32
36
  }
33
- getConnectionStatus() {
37
+ /** @deprecated Use {@link GetConnectionStatus$}. */
38
+ getConnectionStatus$() {
39
+ return this.GetConnectionStatus$();
40
+ }
41
+ GetConnectionStatus() {
34
42
  return this.streaming.getConnectionStatus();
35
43
  }
36
- registerMessageCallback(conversationDetailId, callback) {
44
+ /** @deprecated Use {@link GetConnectionStatus}. */
45
+ getConnectionStatus() {
46
+ return this.GetConnectionStatus();
47
+ }
48
+ RegisterMessageCallback(conversationDetailId, callback) {
37
49
  this.streaming.registerMessageCallback(conversationDetailId, callback);
38
50
  }
39
- unregisterMessageCallback(conversationDetailId, callback) {
51
+ /** @deprecated Use {@link RegisterMessageCallback}. */
52
+ registerMessageCallback(conversationDetailId, callback) {
53
+ return this.RegisterMessageCallback(conversationDetailId, callback);
54
+ }
55
+ UnregisterMessageCallback(conversationDetailId, callback) {
40
56
  this.streaming.unregisterMessageCallback(conversationDetailId, callback);
41
57
  }
42
- getRegisteredCallbackCount() {
58
+ /** @deprecated Use {@link UnregisterMessageCallback}. */
59
+ unregisterMessageCallback(conversationDetailId, callback) {
60
+ return this.UnregisterMessageCallback(conversationDetailId, callback);
61
+ }
62
+ GetRegisteredCallbackCount() {
43
63
  return this.streaming.getRegisteredCallbackCount();
44
64
  }
45
- getTrackedMessageCount() {
65
+ /** @deprecated Use {@link GetRegisteredCallbackCount}. */
66
+ getRegisteredCallbackCount() {
67
+ return this.GetRegisteredCallbackCount();
68
+ }
69
+ GetTrackedMessageCount() {
46
70
  return this.streaming.getTrackedMessageCount();
47
71
  }
48
- getRecentCompletion(conversationDetailId) {
72
+ /** @deprecated Use {@link GetTrackedMessageCount}. */
73
+ getTrackedMessageCount() {
74
+ return this.GetTrackedMessageCount();
75
+ }
76
+ GetRecentCompletion(conversationDetailId) {
49
77
  return this.streaming.getRecentCompletion(conversationDetailId);
50
78
  }
51
- clearRecentCompletion(conversationDetailId) {
79
+ /** @deprecated Use {@link GetRecentCompletion}. */
80
+ getRecentCompletion(conversationDetailId) {
81
+ return this.GetRecentCompletion(conversationDetailId);
82
+ }
83
+ ClearRecentCompletion(conversationDetailId) {
52
84
  this.streaming.clearRecentCompletion(conversationDetailId);
53
85
  }
54
- getDiagnosticSnapshot(messageId) {
86
+ /** @deprecated Use {@link ClearRecentCompletion}. */
87
+ clearRecentCompletion(conversationDetailId) {
88
+ return this.ClearRecentCompletion(conversationDetailId);
89
+ }
90
+ GetDiagnosticSnapshot(messageId) {
55
91
  return this.streaming.getDiagnosticSnapshot(messageId);
56
92
  }
93
+ /** @deprecated Use {@link GetDiagnosticSnapshot}. */
94
+ getDiagnosticSnapshot(messageId) {
95
+ return this.GetDiagnosticSnapshot(messageId);
96
+ }
57
97
  /**
58
98
  * Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()
59
99
  * here — that would tear down a shared singleton on a per-injector destroy,
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-streaming.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAEtD,OAAO,EACH,oBAAoB,GAMvB,MAAM,uCAAuC,CAAC;;;AAc/C,MAAM,OAAO,4BAA4B;IACrC,YAAY,UAAyC;QACjD,6EAA6E;IACjF,CAAC;IAED,IAAY,SAAS;QACjB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC;IACnD,CAAC;IAED,yFAAyF;IACzF,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAC5C,CAAC;IAEM,UAAU;QACb,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAEM,oBAAoB;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC;IACjD,CAAC;IAEM,mBAAmB;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;IAChD,CAAC;IAEM,uBAAuB,CAC1B,oBAA4B,EAC5B,QAAiC;QAEjC,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAC3E,CAAC;IAEM,yBAAyB,CAC5B,oBAA4B,EAC5B,QAAkC;QAElC,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;IAEM,0BAA0B;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,CAAC;IACvD,CAAC;IAEM,sBAAsB;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,sBAAsB,EAAE,CAAC;IACnD,CAAC;IAEM,mBAAmB,CAAC,oBAA4B;QACnD,OAAO,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC;IAEM,qBAAqB,CAAC,oBAA4B;QACrD,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IAC/D,CAAC;IAEM,qBAAqB,CAAC,SAAiB;QAG1C,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACI,WAAW;QACd,wCAAwC;IAC5C,CAAC;sHAtEQ,4BAA4B;gEAA5B,4BAA4B,WAA5B,4BAA4B,mBADf,MAAM;;iFACnB,4BAA4B;cADxC,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Angular DI shim over the framework-agnostic `ConversationStreaming`\n * from `@memberjunction/conversations-runtime`.\n *\n * The PubSub subscription, message routing, completion replay, and reconnection\n * logic all moved into the runtime in PR 2a. This service is now a thin pass-\n * through. The runtime accesses the active-task tracker via the adapter\n * registered by `ConversationsRuntimeBootstrap`.\n *\n * **For new code:** prefer `ConversationsRuntime.Instance.Streaming` directly.\n */\n\nimport { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport {\n ConversationsRuntime,\n type CompletionEvent,\n type MessageProgressCallback,\n type MessageProgressMetadata,\n type MessageProgressUpdate,\n type StreamingConnectionStatus,\n} from '@memberjunction/conversations-runtime';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\n\n// Re-export the runtime's types so existing imports from this file continue to compile.\nexport type {\n CompletionEvent,\n MessageProgressCallback,\n MessageProgressMetadata,\n MessageProgressUpdate,\n StreamingConnectionStatus,\n};\n\n@Injectable({ providedIn: 'root' })\nexport class ConversationStreamingService implements OnDestroy {\n constructor(_bootstrap: ConversationsRuntimeBootstrap) {\n // Injecting the bootstrap forces adapter registration on first construction.\n }\n\n private get streaming() {\n return ConversationsRuntime.Instance.Streaming;\n }\n\n /** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */\n public get completionEvents$(): Subject<CompletionEvent> {\n return this.streaming.completionEvents$;\n }\n\n public initialize(): void {\n this.streaming.initialize();\n }\n\n public getConnectionStatus$(): Observable<StreamingConnectionStatus> {\n return this.streaming.getConnectionStatus$();\n }\n\n public getConnectionStatus(): StreamingConnectionStatus {\n return this.streaming.getConnectionStatus();\n }\n\n public registerMessageCallback(\n conversationDetailId: string,\n callback: MessageProgressCallback\n ): void {\n this.streaming.registerMessageCallback(conversationDetailId, callback);\n }\n\n public unregisterMessageCallback(\n conversationDetailId: string,\n callback?: MessageProgressCallback\n ): void {\n this.streaming.unregisterMessageCallback(conversationDetailId, callback);\n }\n\n public getRegisteredCallbackCount(): number {\n return this.streaming.getRegisteredCallbackCount();\n }\n\n public getTrackedMessageCount(): number {\n return this.streaming.getTrackedMessageCount();\n }\n\n public getRecentCompletion(conversationDetailId: string): { agentRunId: string } | undefined {\n return this.streaming.getRecentCompletion(conversationDetailId);\n }\n\n public clearRecentCompletion(conversationDetailId: string): void {\n this.streaming.clearRecentCompletion(conversationDetailId);\n }\n\n public getDiagnosticSnapshot(messageId: string): ReturnType<\n typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot\n > {\n return this.streaming.getDiagnosticSnapshot(messageId);\n }\n\n /**\n * Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()\n * here — that would tear down a shared singleton on a per-injector destroy,\n * which could affect other consumers. The runtime is process-scoped; its\n * lifecycle ends with the process, not with any Angular injector.\n */\n public ngOnDestroy(): void {\n // intentionally empty — see jsdoc above\n }\n}\n"]}
1
+ {"version":3,"file":"conversation-streaming.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAEtD,OAAO,EACH,oBAAoB,GAMvB,MAAM,uCAAuC,CAAC;;;AAc/C,MAAM,OAAO,4BAA4B;IACrC,YAAY,UAAyC;QACjD,6EAA6E;IACjF,CAAC;IAED,IAAY,SAAS;QACjB,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC;IACnD,CAAC;IAED,yFAAyF;IACzF,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAC5C,CAAC;IAED,iDAAiD;IACjD,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAEM,UAAU;QACb,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAEM,oBAAoB;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC;IACjD,CAAC;IAED,oDAAoD;IAC7C,oBAAoB;QACvB,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACvC,CAAC;IAEM,mBAAmB;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;IAChD,CAAC;IAED,mDAAmD;IAC5C,mBAAmB;QACtB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACtC,CAAC;IAEM,uBAAuB,CAC1B,oBAA4B,EAC5B,QAAiC;QAEjC,IAAI,CA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I,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IAC5D,CAAC;IAEM,qBAAqB,CAAC,SAAiB;QAG1C,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,qDAAqD;IAC9C,qBAAqB,CAAC,SAAiB;QAG1C,OAAO,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACI,WAAW;QACd,wCAAwC;IAC5C,CAAC;sHAhIQ,4BAA4B;gEAA5B,4BAA4B,WAA5B,4BAA4B,mBADf,MAAM;;iFACnB,4BAA4B;cADxC,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["/**\n * @fileoverview Angular DI shim over the framework-agnostic `ConversationStreaming`\n * from `@memberjunction/conversations-runtime`.\n *\n * The PubSub subscription, message routing, completion replay, and reconnection\n * logic all moved into the runtime in PR 2a. This service is now a thin pass-\n * through. The runtime accesses the active-task tracker via the adapter\n * registered by `ConversationsRuntimeBootstrap`.\n *\n * **For new code:** prefer `ConversationsRuntime.Instance.Streaming` directly.\n */\n\nimport { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport {\n ConversationsRuntime,\n type CompletionEvent,\n type MessageProgressCallback,\n type MessageProgressMetadata,\n type MessageProgressUpdate,\n type StreamingConnectionStatus,\n} from '@memberjunction/conversations-runtime';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\n\n// Re-export the runtime's types so existing imports from this file continue to compile.\nexport type {\n CompletionEvent,\n MessageProgressCallback,\n MessageProgressMetadata,\n MessageProgressUpdate,\n StreamingConnectionStatus,\n};\n\n@Injectable({ providedIn: 'root' })\nexport class ConversationStreamingService implements OnDestroy {\n constructor(_bootstrap: ConversationsRuntimeBootstrap) {\n // Injecting the bootstrap forces adapter registration on first construction.\n }\n\n private get streaming() {\n return ConversationsRuntime.Instance.Streaming;\n }\n\n /** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */\n public get CompletionEvents$(): Subject<CompletionEvent> {\n return this.streaming.completionEvents$;\n }\n\n /** @deprecated Use {@link CompletionEvents$}. */\n public get completionEvents$(): Subject<CompletionEvent> {\n return this.CompletionEvents$;\n }\n\n public initialize(): void {\n this.streaming.initialize();\n }\n\n public GetConnectionStatus$(): Observable<StreamingConnectionStatus> {\n return this.streaming.getConnectionStatus$();\n }\n\n /** @deprecated Use {@link GetConnectionStatus$}. */\n public getConnectionStatus$(): Observable<StreamingConnectionStatus> {\n return this.GetConnectionStatus$();\n }\n\n public GetConnectionStatus(): StreamingConnectionStatus {\n return this.streaming.getConnectionStatus();\n }\n\n /** @deprecated Use {@link GetConnectionStatus}. */\n public getConnectionStatus(): StreamingConnectionStatus {\n return this.GetConnectionStatus();\n }\n\n public RegisterMessageCallback(\n conversationDetailId: string,\n callback: MessageProgressCallback\n ): void {\n this.streaming.registerMessageCallback(conversationDetailId, callback);\n }\n\n /** @deprecated Use {@link RegisterMessageCallback}. */\n public registerMessageCallback(\n conversationDetailId: string,\n callback: MessageProgressCallback\n ): void {\n return this.RegisterMessageCallback(conversationDetailId, callback);\n }\n\n public UnregisterMessageCallback(\n conversationDetailId: string,\n callback?: MessageProgressCallback\n ): void {\n this.streaming.unregisterMessageCallback(conversationDetailId, callback);\n }\n\n /** @deprecated Use {@link UnregisterMessageCallback}. */\n public unregisterMessageCallback(\n conversationDetailId: string,\n callback?: MessageProgressCallback\n ): void {\n return this.UnregisterMessageCallback(conversationDetailId, callback);\n }\n\n public GetRegisteredCallbackCount(): number {\n return this.streaming.getRegisteredCallbackCount();\n }\n\n /** @deprecated Use {@link GetRegisteredCallbackCount}. */\n public getRegisteredCallbackCount(): number {\n return this.GetRegisteredCallbackCount();\n }\n\n public GetTrackedMessageCount(): number {\n return this.streaming.getTrackedMessageCount();\n }\n\n /** @deprecated Use {@link GetTrackedMessageCount}. */\n public getTrackedMessageCount(): number {\n return this.GetTrackedMessageCount();\n }\n\n public GetRecentCompletion(conversationDetailId: string): { agentRunId: string } | undefined {\n return this.streaming.getRecentCompletion(conversationDetailId);\n }\n\n /** @deprecated Use {@link GetRecentCompletion}. */\n public getRecentCompletion(conversationDetailId: string): { agentRunId: string } | undefined {\n return this.GetRecentCompletion(conversationDetailId);\n }\n\n public ClearRecentCompletion(conversationDetailId: string): void {\n this.streaming.clearRecentCompletion(conversationDetailId);\n }\n\n /** @deprecated Use {@link ClearRecentCompletion}. */\n public clearRecentCompletion(conversationDetailId: string): void {\n return this.ClearRecentCompletion(conversationDetailId);\n }\n\n public GetDiagnosticSnapshot(messageId: string): ReturnType<\n typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot\n > {\n return this.streaming.getDiagnosticSnapshot(messageId);\n }\n\n /** @deprecated Use {@link GetDiagnosticSnapshot}. */\n public getDiagnosticSnapshot(messageId: string): ReturnType<\n typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot\n > {\n return this.GetDiagnosticSnapshot(messageId);\n }\n\n /**\n * Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()\n * here — that would tear down a shared singleton on a per-injector destroy,\n * which could affect other consumers. The runtime is process-scoped; its\n * lifecycle ends with the process, not with any Angular injector.\n */\n public ngOnDestroy(): void {\n // intentionally empty — see jsdoc above\n }\n}\n"]}
@@ -27,6 +27,8 @@ export declare class DataCacheService {
27
27
  * @param currentUser User context for loading
28
28
  * @returns The cached or loaded MJConversationEntity, or null if not found
29
29
  */
30
+ GetConversation(id: string, currentUser: UserInfo): Promise<MJConversationEntity | null>;
31
+ /** @deprecated Use {@link GetConversation}. */
30
32
  getConversation(id: string, currentUser: UserInfo): Promise<MJConversationEntity | null>;
31
33
  /**
32
34
  * Create a new MJConversationEntity and automatically cache it
@@ -34,16 +36,22 @@ export declare class DataCacheService {
34
36
  * @param currentUser User context
35
37
  * @returns New MJConversationEntity instance (already cached)
36
38
  */
39
+ CreateConversation(currentUser: UserInfo): Promise<MJConversationEntity>;
40
+ /** @deprecated Use {@link CreateConversation}. */
37
41
  createConversation(currentUser: UserInfo): Promise<MJConversationEntity>;
38
42
  /**
39
43
  * Remove a MJConversationEntity from the cache
40
44
  * @param id The conversation ID to remove
41
45
  */
46
+ RemoveConversation(id: string): void;
47
+ /** @deprecated Use {@link RemoveConversation}. */
42
48
  removeConversation(id: string): void;
43
49
  /**
44
50
  * Get all cached MJConversationEntity objects (no DB call)
45
51
  * @returns Array of cached conversations
46
52
  */
53
+ GetCachedConversations(): MJConversationEntity[];
54
+ /** @deprecated Use {@link GetCachedConversations}. */
47
55
  getCachedConversations(): MJConversationEntity[];
48
56
  /**
49
57
  * Get a MJConversationDetailEntity by ID from cache, or load it if not cached
@@ -51,6 +59,8 @@ export declare class DataCacheService {
51
59
  * @param currentUser User context for loading
52
60
  * @returns The cached or loaded MJConversationDetailEntity, or null if not found
53
61
  */
62
+ GetConversationDetail(id: string, currentUser: UserInfo): Promise<MJConversationDetailEntity | null>;
63
+ /** @deprecated Use {@link GetConversationDetail}. */
54
64
  getConversationDetail(id: string, currentUser: UserInfo): Promise<MJConversationDetailEntity | null>;
55
65
  /**
56
66
  * Create a new MJConversationDetailEntity and automatically cache it
@@ -58,6 +68,8 @@ export declare class DataCacheService {
58
68
  * @param currentUser User context
59
69
  * @returns New MJConversationDetailEntity instance (already cached)
60
70
  */
71
+ CreateConversationDetail(currentUser: UserInfo): Promise<MJConversationDetailEntity>;
72
+ /** @deprecated Use {@link CreateConversationDetail}. */
61
73
  createConversationDetail(currentUser: UserInfo): Promise<MJConversationDetailEntity>;
62
74
  /**
63
75
  * Load all ConversationDetail entities for a conversation and cache them
@@ -66,44 +78,63 @@ export declare class DataCacheService {
66
78
  * @param currentUser User context
67
79
  * @returns Array of MJConversationDetailEntity objects
68
80
  */
81
+ LoadConversationDetails(conversationId: string, currentUser: UserInfo): Promise<MJConversationDetailEntity[]>;
82
+ /** @deprecated Use {@link LoadConversationDetails}. */
69
83
  loadConversationDetails(conversationId: string, currentUser: UserInfo): Promise<MJConversationDetailEntity[]>;
70
84
  /**
71
85
  * Get all cached ConversationDetail entities for a conversation (no DB call)
72
86
  * @param conversationId The conversation ID
73
87
  * @returns Array of cached conversation details
74
88
  */
89
+ GetCachedConversationDetails(conversationId: string): MJConversationDetailEntity[];
90
+ /** @deprecated Use {@link GetCachedConversationDetails}. */
75
91
  getCachedConversationDetails(conversationId: string): MJConversationDetailEntity[];
76
92
  /**
77
93
  * Remove a MJConversationDetailEntity from the cache
78
94
  * @param id The conversation detail ID to remove
79
95
  */
96
+ RemoveConversationDetail(id: string): void;
97
+ /** @deprecated Use {@link RemoveConversationDetail}. */
80
98
  removeConversationDetail(id: string): void;
81
99
  /**
82
100
  * Refresh entity data by clearing cached entities of a specific type
83
101
  * This forces a reload from the database on next access
84
102
  * @param entityName The entity name to refresh (e.g., 'Conversations', 'MJ: Conversation Details')
85
103
  */
104
+ RefreshEntity(entityName: string): Promise<void>;
105
+ /** @deprecated Use {@link RefreshEntity}. */
86
106
  refreshEntity(entityName: string): Promise<void>;
87
107
  /**
88
108
  * Refresh a specific cache by name
89
109
  * This method can be extended to handle different cache types
90
110
  * @param cacheName The cache name ('Core', 'AI', 'Actions')
91
111
  */
112
+ RefreshCache(cacheName: 'Core' | 'AI' | 'Actions'): Promise<void>;
113
+ /** @deprecated Use {@link RefreshCache}. */
92
114
  refreshCache(cacheName: 'Core' | 'AI' | 'Actions'): Promise<void>;
93
115
  /**
94
116
  * Clear all cached entities
95
117
  * Call when switching environments, users, or when needed
96
118
  */
119
+ Clear(): void;
120
+ /** @deprecated Use {@link Clear}. */
97
121
  clear(): void;
98
122
  /**
99
123
  * Clear cached entities for a specific conversation
100
124
  * @param conversationId The conversation ID
101
125
  */
126
+ ClearConversation(conversationId: string): void;
127
+ /** @deprecated Use {@link ClearConversation}. */
102
128
  clearConversation(conversationId: string): void;
103
129
  /**
104
130
  * Get cache statistics for debugging
105
131
  * @returns Object with cache sizes
106
132
  */
133
+ GetStats(): {
134
+ conversations: number;
135
+ conversationDetails: number;
136
+ };
137
+ /** @deprecated Use {@link GetStats}. */
107
138
  getStats(): {
108
139
  conversations: number;
109
140
  conversationDetails: number;
@@ -1 +1 @@
1
- {"version":3,"file":"data-cache.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/data-cache.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAY,QAAQ,EAAuB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;AAGlG;;;;;;;;;GASG;AACH,qBAGa,gBAAgB;IAE3B,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,mBAAmB,CAAoC;IAE/D,OAAO,CAAC,SAAS,CAAkC;;IAInD;;OAEG;IACH,IAAW,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAElD;IAED,IAAW,QAAQ,IAAI,iBAAiB,CAEvC;IAMD;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAqB9F;;;;;OAKG;IACG,kBAAkB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAY9E;;;OAGG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIpC;;;OAGG;IACH,sBAAsB,IAAI,oBAAoB,EAAE;IAQhD;;;;;OAKG;IACG,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAqB1G;;;;;OAKG;IACG,wBAAwB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAa1F;;;;;;OAMG;IACG,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,WAA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