@memberjunction/ng-conversations 6.1.4 → 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 (424) hide show
  1. package/README.md +36 -3
  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 +2407 -731
  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/channels/channel-onboarding-panel.component.d.ts +1 -1
  146. package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -1
  147. package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -1
  148. package/dist/lib/components/realtime/channels/client-context-channel.d.ts +1 -1
  149. package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
  150. package/dist/lib/components/realtime/channels/client-context-channel.js +1 -1
  151. package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
  152. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +1 -1
  153. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
  154. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +3 -0
  155. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
  156. package/dist/lib/components/realtime/media/media-channel.d.ts +2 -1
  157. package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
  158. package/dist/lib/components/realtime/media/media-channel.js +1 -1
  159. package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
  160. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +2 -2
  161. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
  162. package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
  163. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  164. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +1 -1
  165. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
  166. package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
  167. package/dist/lib/components/realtime/realtime-composer.component.d.ts +3 -1
  168. package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
  169. package/dist/lib/components/realtime/realtime-composer.component.js +26 -8
  170. package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
  171. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
  172. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
  173. package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
  174. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  175. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +4 -4
  176. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
  177. package/dist/lib/components/realtime/realtime-session-overlay.component.js +19 -19
  178. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  179. package/dist/lib/components/realtime/realtime-session-state.d.ts +2 -3
  180. package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
  181. package/dist/lib/components/realtime/realtime-session-state.js +3 -2
  182. package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
  183. package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +17 -1
  184. package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
  185. package/dist/lib/components/realtime/realtime-session-thread.component.js +122 -45
  186. package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
  187. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -31
  188. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
  189. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +138 -124
  190. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
  191. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +4 -4
  192. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
  193. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
  194. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  195. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +2 -2
  196. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
  197. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
  198. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  199. package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
  200. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  201. package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
  202. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  203. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +1 -1
  204. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
  205. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +1 -1
  206. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
  207. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +4 -2
  208. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  209. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +7 -3
  210. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  211. package/dist/lib/components/search/search-panel.component.d.ts +133 -22
  212. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  213. package/dist/lib/components/search/search-panel.component.js +312 -83
  214. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  215. package/dist/lib/components/share/share-modal.component.d.ts +69 -9
  216. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  217. package/dist/lib/components/share/share-modal.component.js +139 -31
  218. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  219. package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
  220. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
  221. package/dist/lib/components/shared/user-picker.component.js +110 -30
  222. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  223. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
  224. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
  225. package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
  226. package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
  227. package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
  228. package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
  229. package/dist/lib/components/sidebar/routines-section.component.js +25 -5
  230. package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
  231. package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
  232. package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
  233. package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
  234. package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
  235. package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
  236. package/dist/lib/components/task/tasks-full-view.component.js +223 -75
  237. package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
  238. package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
  239. package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
  240. package/dist/lib/components/tasks/task-widget.component.js +100 -16
  241. package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
  242. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
  243. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
  244. package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
  245. package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
  246. package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
  247. package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
  248. package/dist/lib/components/thread/thread-panel.component.js +146 -36
  249. package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
  250. package/dist/lib/components/toast/toast.component.d.ts +11 -1
  251. package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
  252. package/dist/lib/components/toast/toast.component.js +25 -5
  253. package/dist/lib/components/toast/toast.component.js.map +1 -1
  254. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
  255. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  256. package/dist/lib/components/workspace/conversation-workspace.component.js +887 -291
  257. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  258. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
  259. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
  260. package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
  261. package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
  262. package/dist/lib/conversations.module.d.ts.map +1 -1
  263. package/dist/lib/conversations.module.js.map +1 -1
  264. package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
  265. package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
  266. package/dist/lib/directives/chat-slot.directive.js.map +1 -1
  267. package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
  268. package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
  269. package/dist/lib/directives/search-shortcut.directive.js +14 -4
  270. package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
  271. package/dist/lib/events/chat-events.d.ts +34 -7
  272. package/dist/lib/events/chat-events.d.ts.map +1 -1
  273. package/dist/lib/events/chat-events.js +37 -7
  274. package/dist/lib/events/chat-events.js.map +1 -1
  275. package/dist/lib/models/agent-turn.model.d.ts +103 -0
  276. package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
  277. package/dist/lib/models/agent-turn.model.js +12 -0
  278. package/dist/lib/models/agent-turn.model.js.map +1 -0
  279. package/dist/lib/models/collection-view.model.js.map +1 -1
  280. package/dist/lib/models/conversation-state.model.d.ts +8 -0
  281. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  282. package/dist/lib/models/conversation-state.model.js.map +1 -1
  283. package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
  284. package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
  285. package/dist/lib/models/lazy-artifact-info.js +98 -34
  286. package/dist/lib/models/lazy-artifact-info.js.map +1 -1
  287. package/dist/lib/services/active-tasks.service.d.ts +30 -4
  288. package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
  289. package/dist/lib/services/active-tasks.service.js +71 -19
  290. package/dist/lib/services/active-tasks.service.js.map +1 -1
  291. package/dist/lib/services/agent-state.service.d.ts +17 -1
  292. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  293. package/dist/lib/services/agent-state.service.js +48 -16
  294. package/dist/lib/services/agent-state.service.js.map +1 -1
  295. package/dist/lib/services/artifact-permission.service.d.ts +39 -0
  296. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  297. package/dist/lib/services/artifact-permission.service.js +152 -17
  298. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  299. package/dist/lib/services/artifact-state.service.d.ts +58 -5
  300. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  301. package/dist/lib/services/artifact-state.service.js +135 -35
  302. package/dist/lib/services/artifact-state.service.js.map +1 -1
  303. package/dist/lib/services/browser-realtime-media-host.d.ts +24 -0
  304. package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -0
  305. package/dist/lib/services/browser-realtime-media-host.js +95 -0
  306. package/dist/lib/services/browser-realtime-media-host.js.map +1 -0
  307. package/dist/lib/services/collection-permission.service.d.ts +28 -0
  308. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  309. package/dist/lib/services/collection-permission.service.js +88 -32
  310. package/dist/lib/services/collection-permission.service.js.map +1 -1
  311. package/dist/lib/services/collection-state.service.d.ts +11 -1
  312. package/dist/lib/services/collection-state.service.d.ts.map +1 -1
  313. package/dist/lib/services/collection-state.service.js +25 -5
  314. package/dist/lib/services/collection-state.service.js.map +1 -1
  315. package/dist/lib/services/conversation-agent.service.d.ts +26 -4
  316. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  317. package/dist/lib/services/conversation-agent.service.js +57 -18
  318. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  319. package/dist/lib/services/conversation-attachment.service.d.ts +41 -2
  320. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  321. package/dist/lib/services/conversation-attachment.service.js +80 -13
  322. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  323. package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
  324. package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
  325. package/dist/lib/services/conversation-streaming.service.js +50 -10
  326. package/dist/lib/services/conversation-streaming.service.js.map +1 -1
  327. package/dist/lib/services/data-cache.service.d.ts +31 -0
  328. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  329. package/dist/lib/services/data-cache.service.js +71 -15
  330. package/dist/lib/services/data-cache.service.js.map +1 -1
  331. package/dist/lib/services/dialog.service.d.ts +13 -0
  332. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  333. package/dist/lib/services/dialog.service.js +25 -5
  334. package/dist/lib/services/dialog.service.js.map +1 -1
  335. package/dist/lib/services/export.service.d.ts +2 -0
  336. package/dist/lib/services/export.service.d.ts.map +1 -1
  337. package/dist/lib/services/export.service.js +5 -1
  338. package/dist/lib/services/export.service.js.map +1 -1
  339. package/dist/lib/services/graphql-attachment-blob-store.d.ts +44 -0
  340. package/dist/lib/services/graphql-attachment-blob-store.d.ts.map +1 -0
  341. package/dist/lib/services/graphql-attachment-blob-store.js +113 -0
  342. package/dist/lib/services/graphql-attachment-blob-store.js.map +1 -0
  343. package/dist/lib/services/mention-autocomplete.service.d.ts +17 -141
  344. package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
  345. package/dist/lib/services/mention-autocomplete.service.js +15 -460
  346. package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
  347. package/dist/lib/services/mention-parser.service.d.ts +10 -0
  348. package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
  349. package/dist/lib/services/mention-parser.service.js +25 -5
  350. package/dist/lib/services/mention-parser.service.js.map +1 -1
  351. package/dist/lib/services/notification.service.d.ts +54 -6
  352. package/dist/lib/services/notification.service.d.ts.map +1 -1
  353. package/dist/lib/services/notification.service.js +123 -27
  354. package/dist/lib/services/notification.service.js.map +1 -1
  355. package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
  356. package/dist/lib/services/realtime-audio-recorder.js +12 -12
  357. package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
  358. package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
  359. package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
  360. package/dist/lib/services/realtime-pcm-wav.js +10 -2
  361. package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
  362. package/dist/lib/services/realtime-session-review.service.d.ts +1 -1
  363. package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
  364. package/dist/lib/services/realtime-session-review.service.js +1 -1
  365. package/dist/lib/services/realtime-session-review.service.js.map +1 -1
  366. package/dist/lib/services/realtime-session.service.d.ts +16 -1150
  367. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  368. package/dist/lib/services/realtime-session.service.js +28 -2430
  369. package/dist/lib/services/realtime-session.service.js.map +1 -1
  370. package/dist/lib/services/search.service.d.ts +42 -9
  371. package/dist/lib/services/search.service.d.ts.map +1 -1
  372. package/dist/lib/services/search.service.js +103 -23
  373. package/dist/lib/services/search.service.js.map +1 -1
  374. package/dist/lib/services/toast.service.d.ts +19 -1
  375. package/dist/lib/services/toast.service.d.ts.map +1 -1
  376. package/dist/lib/services/toast.service.js +45 -9
  377. package/dist/lib/services/toast.service.js.map +1 -1
  378. package/dist/lib/services/ui-command-handler.service.d.ts +16 -2
  379. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  380. package/dist/lib/services/ui-command-handler.service.js +36 -8
  381. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  382. package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
  383. package/dist/lib/utils/agent-artifact-summary.js +3 -3
  384. package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
  385. package/dist/lib/utils/agent-turn-routing.d.ts +69 -0
  386. package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
  387. package/dist/lib/utils/agent-turn-routing.js +96 -0
  388. package/dist/lib/utils/agent-turn-routing.js.map +1 -0
  389. package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
  390. package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
  391. package/dist/lib/utils/artifact-panel-action.js +10 -2
  392. package/dist/lib/utils/artifact-panel-action.js.map +1 -1
  393. package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
  394. package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
  395. package/dist/lib/utils/distinct-artifacts.js +5 -1
  396. package/dist/lib/utils/distinct-artifacts.js.map +1 -1
  397. package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
  398. package/dist/lib/utils/plan-mode-preference.js +6 -6
  399. package/dist/lib/utils/plan-mode-preference.js.map +1 -1
  400. package/dist/lib/utils/realtime-session-timeline.d.ts +8 -79
  401. package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -1
  402. package/dist/lib/utils/realtime-session-timeline.js +8 -89
  403. package/dist/lib/utils/realtime-session-timeline.js.map +1 -1
  404. package/dist/public-api.d.ts +5 -2
  405. package/dist/public-api.d.ts.map +1 -1
  406. package/dist/public-api.js +9 -2
  407. package/dist/public-api.js.map +1 -1
  408. package/package.json +33 -32
  409. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +0 -384
  410. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +0 -1
  411. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +0 -231
  412. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +0 -1
  413. package/dist/lib/services/delegation-result-parser.d.ts +0 -50
  414. package/dist/lib/services/delegation-result-parser.d.ts.map +0 -1
  415. package/dist/lib/services/delegation-result-parser.js +0 -60
  416. package/dist/lib/services/delegation-result-parser.js.map +0 -1
  417. package/dist/lib/services/narration-template.d.ts +0 -42
  418. package/dist/lib/services/narration-template.d.ts.map +0 -1
  419. package/dist/lib/services/narration-template.js +0 -73
  420. package/dist/lib/services/narration-template.js.map +0 -1
  421. package/dist/lib/services/skill-picker-narrowing.d.ts +0 -13
  422. package/dist/lib/services/skill-picker-narrowing.d.ts.map +0 -1
  423. package/dist/lib/services/skill-picker-narrowing.js +0 -13
  424. package/dist/lib/services/skill-picker-narrowing.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAY,iBAAiB,EAAW,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAkC,MAAM,8BAA8B,CAAC;AAElI,OAAO,EACL,0BAA0B,EAG3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;;AAqB1F;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC7D,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACh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ACU,4BAA4B,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAMrC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;;;;;OAMG;IACU,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAI3F;;;;;OAKG;YACW,qBAAqB;yCA/kBxB,wBAAwB;6CAAxB,wBAAwB;CA+mBpC"}
1
+ {"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAY,iBAAiB,EAAW,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAkC,MAAM,8BAA8B,CAAC;AAElI,OAAO,EAEL,0BAA0B,EAG3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;;AAqB1F;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC7D,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,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ClB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,GAC7B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAIrC;;;;;;OAMG;IACG,0BAA0B,CAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,0BAA0B,EAAE,GAChD,OAAO,CAAC,iBAAiB,CAAC;IA0G7B,0DAA0D;IACpD,0BAA0B,CAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,0BAA0B,EAAE,GAChD,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;;;;;;;;;;;;;;;OAkBG;YACW,qBAAqB;IA+BnC,kEAAkE;YACpD,iBAAiB;IAoB/B;;;;;;;;;;;;;;;;OAgBG;IACU,4BAA4B,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,GACxB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAMrC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,wBAAwB;IAYhC;;;;;;OAMG;IACU,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAI3F;;;;;OAKG;YACW,qBAAqB;yCA5pBxB,wBAAwB;6CAAxB,wBAAwB;CA4rBpC"}
@@ -3,6 +3,7 @@ import { Metadata, RunView } from '@memberjunction/core';
3
3
  import { GraphQLAIClient } from '@memberjunction/graphql-dataprovider';
4
4
  import { coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';
5
5
  import { AIEngineBase } from '@memberjunction/ai-engine-base';
6
+ import { ConversationEngine } from '@memberjunction/core-entities';
6
7
  import { MJNotificationService } from '@memberjunction/ng-notifications';
7
8
  import { ConversationsRuntime } from '@memberjunction/conversations-runtime';
8
9
  import { UUIDsEqual } from '@memberjunction/global';
@@ -54,14 +55,18 @@ export class ConversationAgentService {
54
55
  _conversationManagerAgent = null;
55
56
  _sessionIds = new Map();
56
57
  /** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */
57
- isProcessing$;
58
+ IsProcessing$;
59
+ /** @deprecated Use {@link IsProcessing$}. */
60
+ get isProcessing$() {
61
+ return this.IsProcessing$;
62
+ }
58
63
  _provider = null;
59
64
  constructor(_bootstrap, mentionParser, agentClientService) {
60
65
  this.mentionParser = mentionParser;
61
66
  this.agentClientService = agentClientService;
62
67
  // Injecting `_bootstrap` forces the runtime's INotificationAdapter +
63
68
  // IActiveTaskTracker adapters to register before any shim method runs.
64
- this.isProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;
69
+ this.IsProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;
65
70
  this.initializeAIClient();
66
71
  }
67
72
  /**
@@ -106,7 +111,7 @@ export class ConversationAgentService {
106
111
  * preserve that shape (returning null on failure rather than throwing)
107
112
  * so the call sites don't need to change.
108
113
  */
109
- async getConversationManagerAgent() {
114
+ async GetConversationManagerAgent() {
110
115
  if (this._conversationManagerAgent) {
111
116
  return this._conversationManagerAgent;
112
117
  }
@@ -126,6 +131,10 @@ export class ConversationAgentService {
126
131
  return null;
127
132
  }
128
133
  }
134
+ /** @deprecated Use {@link GetConversationManagerAgent}. */
135
+ async getConversationManagerAgent() {
136
+ return this.GetConversationManagerAgent();
137
+ }
129
138
  /**
130
139
  * Synchronous read of the cached conversation-manager-agent name. Returns
131
140
  * `null` until {@link getConversationManagerAgent} has been called at least
@@ -155,11 +164,15 @@ export class ConversationAgentService {
155
164
  * documented as "kept for backwards compatibility but not used" in the
156
165
  * original).
157
166
  */
158
- async processMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs) {
167
+ async ProcessMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs,
168
+ /** The agents the conversation manager may delegate to. Null or omitted allows every agent. */
169
+ allowedAgentIDs,
170
+ /** The first moment of the conversation the run may read. Null or omitted reads all of it. */
171
+ agentHistoryFrom) {
159
172
  // Warm the cached default-agent name for any synchronous consumers
160
173
  // before the runtime resolves on its own.
161
174
  if (!this._conversationManagerAgent) {
162
- await this.getConversationManagerAgent();
175
+ await this.GetConversationManagerAgent();
163
176
  }
164
177
  return ConversationsRuntime.Instance.AgentRunner.processMessage({
165
178
  conversationId,
@@ -169,8 +182,14 @@ export class ConversationAgentService {
169
182
  onProgress,
170
183
  ...(planMode ? { planMode: true } : {}),
171
184
  ...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),
185
+ ...(allowedAgentIDs != null ? { AllowedAgentIDs: allowedAgentIDs } : {}),
186
+ ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),
172
187
  });
173
188
  }
189
+ /** @deprecated Use {@link ProcessMessage}. */
190
+ async processMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom) {
191
+ return this.ProcessMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom);
192
+ }
174
193
  /**
175
194
  * Configuration preset an agent was pinned to by a previous `@mention` in this conversation.
176
195
  *
@@ -224,9 +243,13 @@ export class ConversationAgentService {
224
243
  /**
225
244
  * Clear the session for a conversation (useful when starting a new topic)
226
245
  */
227
- clearSession(conversationId) {
246
+ ClearSession(conversationId) {
228
247
  this._sessionIds.delete(conversationId);
229
248
  }
249
+ /** @deprecated Use {@link ClearSession}. */
250
+ clearSession(conversationId) {
251
+ return this.ClearSession(conversationId);
252
+ }
230
253
  /**
231
254
  * Surfaces a warning toast when the user requested skills (via /skill mentions) that the
232
255
  * target agent cannot activate — the server drops such requests, and without this the
@@ -251,7 +274,9 @@ export class ConversationAgentService {
251
274
  * Stays on the Angular shim because it directly uses AgentClientService.
252
275
  * Could move to the runtime in a follow-up if needed.
253
276
  */
254
- async invokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs) {
277
+ async InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs,
278
+ /** The first moment of the conversation the run may read. Null or omitted reads all of it. */
279
+ agentHistoryFrom) {
255
280
  try {
256
281
  // Ensure AIEngineBase is configured
257
282
  await AIEngineBase.Instance.Config(false);
@@ -294,6 +319,7 @@ export class ConversationAgentService {
294
319
  ...(aiConfigurationId ? { ConfigurationId: aiConfigurationId } : {}),
295
320
  ...(planMode ? { PlanMode: true } : {}),
296
321
  ...(requestedSkillIDs?.length ? { RequestedSkillIDs: requestedSkillIDs } : {}),
322
+ ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),
297
323
  CreateArtifacts: true,
298
324
  CreateNotification: true,
299
325
  SourceArtifactId: sourceArtifactId,
@@ -324,6 +350,10 @@ export class ConversationAgentService {
324
350
  return coerceFailedExecuteAgentResult(undefined, errorMsg);
325
351
  }
326
352
  }
353
+ /** @deprecated Use {@link InvokeSubAgent}. */
354
+ async invokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom) {
355
+ return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom);
356
+ }
327
357
  /**
328
358
  * Check if user's latest message should continue with the previous agent or route through Sage.
329
359
  * Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.
@@ -331,7 +361,7 @@ export class ConversationAgentService {
331
361
  * Stays on the Angular shim because it directly uses GraphQLAIClient.
332
362
  * Could move to the runtime in a follow-up.
333
363
  */
334
- async checkAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory) {
364
+ async CheckAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory) {
335
365
  if (!this._aiClient) {
336
366
  console.warn('AI Client not initialized, defaulting to UNSURE for intent check');
337
367
  return { decision: 'UNSURE', reasoning: 'AI Client not initialized' };
@@ -362,12 +392,12 @@ export class ConversationAgentService {
362
392
  if (agentArtifacts.length > 0) {
363
393
  artifactContext = '\n\n**Prior Artifacts Created by This Agent**:\n';
364
394
  agentArtifacts.forEach((artifact, idx) => {
365
- artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.artifactType})\n`;
366
- artifactContext += ` - Versions: ${artifact.versions.length}\n`;
367
- if (artifact.versions.length > 0) {
368
- artifactContext += ` - Latest: v${artifact.versions[0].versionNumber}`;
369
- if (artifact.versions[0].versionName) {
370
- artifactContext += ` - ${artifact.versions[0].versionName}`;
395
+ artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.ArtifactType})\n`;
396
+ artifactContext += ` - Versions: ${artifact.Versions.length}\n`;
397
+ if (artifact.Versions.length > 0) {
398
+ artifactContext += ` - Latest: v${artifact.Versions[0].versionNumber}`;
399
+ if (artifact.Versions[0].versionName) {
400
+ artifactContext += ` - ${artifact.Versions[0].versionName}`;
371
401
  }
372
402
  artifactContext += '\n';
373
403
  }
@@ -424,6 +454,10 @@ ${compactHistory}${artifactContext}
424
454
  };
425
455
  }
426
456
  }
457
+ /** @deprecated Use {@link CheckAgentContinuityIntent}. */
458
+ async checkAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory) {
459
+ return this.CheckAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory);
460
+ }
427
461
  /**
428
462
  * Every artifact this agent produced in this conversation, newest version first — resolved
429
463
  * by QUERY, not by scanning the display array.
@@ -491,9 +525,13 @@ ${compactHistory}${artifactContext}
491
525
  *
492
526
  * One round trip. The subquery walks details -> Output junctions, and versions carry
493
527
  * `__mj_CreatedAt`, so "newest" is expressible without joining back for `Sequence`.
528
+ *
529
+ * @param historyFrom The chat's history floor. When set, only artifacts on replies written at
530
+ * or after it count: a run that may not read earlier messages must not pick up their work
531
+ * as its payload either.
494
532
  */
495
- async FindLatestAgentOutputVersion(conversationId, agentId) {
496
- return this.runPayloadSourceQuery(this.agentOutputVersionFilter(conversationId, agentId), '__mj_CreatedAt DESC');
533
+ async FindLatestAgentOutputVersion(conversationId, agentId, historyFrom) {
534
+ return this.runPayloadSourceQuery(this.agentOutputVersionFilter(conversationId, agentId, historyFrom), '__mj_CreatedAt DESC');
497
535
  }
498
536
  /**
499
537
  * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced in one
@@ -506,13 +544,14 @@ ${compactHistory}${artifactContext}
506
544
  * run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the
507
545
  * detail already carries.
508
546
  */
509
- agentOutputVersionFilter(conversationId, agentId) {
547
+ agentOutputVersionFilter(conversationId, agentId, historyFrom) {
548
+ const floor = historyFrom ? ` AND ${ConversationEngine.HistoryFromFilter(historyFrom)}` : '';
510
549
  return `ID IN (
511
550
  SELECT ArtifactVersionID FROM [__mj].[vwConversationDetailArtifacts]
512
551
  WHERE Direction='Output' AND ConversationDetailID IN (
513
552
  SELECT ID FROM [__mj].[vwConversationDetails]
514
553
  WHERE ConversationID='${conversationId}' AND AgentID='${agentId}'
515
- AND Role='AI' AND Status <> 'Error'
554
+ AND Role='AI' AND Status <> 'Error'${floor}
516
555
  )
517
556
  )`;
518
557
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA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EAAE,MAAM;aACnB;;AAknBD;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,OAAkC;IAC9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Metadata, IMetadataProvider, RunView } from '@memberjunction/core';\nimport { GraphQLDataProvider, GraphQLAIClient } from '@memberjunction/graphql-dataprovider';\nimport { ExecuteAgentResult, AgentExecutionProgressCallback, coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport {\n MJConversationDetailEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity\n} from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended } from '@memberjunction/ai-core-plus';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { RunAgentFromConversationDetailParams } from '@memberjunction/ai-agent-client';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\nimport { LazyArtifactInfo } from '../models/lazy-artifact-info';\nimport { MentionParserService } from './mention-parser.service';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\nimport {\n GroupVersionsByArtifact,\n type AgentArtifactSummary\n} from '../utils/agent-artifact-summary';\n\n/**\n * Rows the configuration-preset lookup parses before giving up. The SQL prefilter is a LIKE,\n * so a few candidates may not be real mention blobs; this bounds how many we inspect.\n */\nconst CONFIG_PRESET_CANDIDATE_ROWS = 5;\n\n/**\n * Cap on artifact versions listed for the intent classifier.\n *\n * The block is a hint, not a record: the prompt prints a name, a type, a version count and\n * the latest version per artifact. Newest-first ordering means the cap only ever trims the\n * oldest versions of the busiest artifacts, which are the least useful lines in it.\n */\nconst MAX_AGENT_ARTIFACT_VERSIONS = 40;\n\n/**\n * Context for artifact lookups — pre-loaded conversation data.\n *\n * NO LONGER CONSUMED by this service. Both readers were converted to queries when transcript\n * windowing made these maps a partial view: they are keyed to the loaded window, so any\n * lookup for an older row silently missed. Retained as an exported type for API\n * compatibility; new code should not build one.\n */\nexport interface ArtifactLookupContext {\n agentRunsByDetailId: Map<string, MJAIAgentRunEntityExtended>;\n artifactsByDetailId: Map<string, LazyArtifactInfo[]>;\n}\n\n/**\n * An agent's prior OUTPUT artifact, resolved for payload continuity.\n *\n * `payload` is the parsed `ArtifactVersion.Content`, typed to match what actually consumes it\n * — `executeAgentContinuation` and `invokeSubAgent` both take `Record<string, unknown> | null`.\n * It is null when the version carried no content, the content did not parse, or the content\n * parsed to something that is not a JSON object; callers treat all three the same as \"no prior\n * artifact\", which is already a legal agent input.\n */\nexport interface AgentPayloadSource {\n artifactId: string;\n versionId: string;\n versionNumber: number;\n payload: Record<string, unknown> | null;\n}\n\n/**\n * Result from intent check - indicates whether to continue with agent\n * and which artifact version to use as payload\n */\nexport interface IntentCheckResult {\n decision: 'YES' | 'NO' | 'UNSURE';\n reasoning: string;\n targetArtifactVersionId?: string;\n}\n\n/**\n * Angular DI service for conversation-level agent orchestration.\n *\n * After PR 2 of the conversations-runtime extraction, the core\n * `processMessage` flow and the conversation-manager-agent resolution are\n * delegated to `@memberjunction/conversations-runtime`. This service is\n * primarily a shim for those operations PLUS the holder of the helpers\n * that haven't been ported yet:\n *\n * - `invokeSubAgent(...)` — used by Sage's routing decisions in\n * `message-input.component`.\n * - `checkAgentContinuityIntent(...)` — fast intent classification when the\n * user replies to a previous-agent thread.\n * - `FindConfigurationPresetForAgent(...)` — locates an agent's preset\n * from prior @mentions in the conversation.\n * - `clearSession(...)` — per-conversation session-id bookkeeping.\n *\n * These can move to the runtime in a follow-up; they aren't strictly needed\n * to invoke an agent end-to-end and stay here so the shim has zero behavior\n * difference vs. the original.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAgentService {\n /** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */\n private _aiClient: GraphQLAIClient | null = null;\n /** Cached resolution of the conversation manager agent (default agent). */\n private _conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n private _sessionIds: Map<string, string> = new Map();\n\n /** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */\n public readonly isProcessing$: Observable<boolean>;\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(\n _bootstrap: ConversationsRuntimeBootstrap,\n private mentionParser: MentionParserService,\n private agentClientService: AgentClientService\n ) {\n // Injecting `_bootstrap` forces the runtime's INotificationAdapter +\n // IActiveTaskTracker adapters to register before any shim method runs.\n this.isProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;\n this.initializeAIClient();\n }\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it re-initializes the AI client and forwards the provider to the runtime's runner.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n this.initializeAIClient();\n ConversationsRuntime.Instance.AgentRunner.Provider = value;\n }\n\n /**\n * Initialize the GraphQL AI Client.\n * Retained for RunAIPrompt calls (intent checking) which the AgentClientService doesn't wrap.\n * Agent execution (RunAIAgentFromConversationDetail) now goes through ConversationsRuntime.AgentRunner.\n */\n private initializeAIClient(): void {\n try {\n const provider = this.Provider as GraphQLDataProvider;\n if (provider) {\n this._aiClient = new GraphQLAIClient(provider);\n } else {\n console.warn('GraphQLDataProvider not available, agent functionality will be limited');\n }\n } catch (error) {\n console.error('Failed to initialize GraphQL AI Client:', error);\n }\n }\n\n /**\n * Resolve the conversation manager agent via the runtime's 4-step\n * DefaultAgentResolver chain (explicit input → app-scoped Application\n * Setting → global Application Setting → code-const Sage fallback). The\n * result is cached on this service for use by the synchronous\n * {@link ConversationManagerAgentName} getter.\n *\n * Existing callers expect a Promise<MJAIAgentEntityExtended | null> — we\n * preserve that shape (returning null on failure rather than throwing)\n * so the call sites don't need to change.\n */\n public async getConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n if (this._conversationManagerAgent) {\n return this._conversationManagerAgent;\n }\n\n try {\n const provider = this.Provider;\n const agent = await ConversationsRuntime.Instance.DefaultAgent.resolve({\n contextUser: provider.CurrentUser ?? undefined,\n provider,\n });\n this._conversationManagerAgent = agent;\n return agent;\n } catch (error) {\n const errorMsg = 'Error resolving conversation manager agent: ' + (error instanceof Error ? error.message : String(error));\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n }\n\n /**\n * Synchronous read of the cached conversation-manager-agent name. Returns\n * `null` until {@link getConversationManagerAgent} has been called at least\n * once and resolved successfully. Used by `MessageItemComponent.isConversationManager`\n * to flag messages from the routing agent without hardcoding `'Sage'`.\n */\n public get ConversationManagerAgentName(): string | null {\n return this._conversationManagerAgent?.Name ?? null;\n }\n\n /**\n * Returns `true` if the supplied agent identifier (UUID or name) matches the\n * currently cached conversation manager agent. Robust to either input.\n */\n public IsConversationManagerAgent(agentIdOrName: string | null | undefined): boolean {\n if (!agentIdOrName || !this._conversationManagerAgent) return false;\n return (\n UUIDsEqual(this._conversationManagerAgent.ID, agentIdOrName) ||\n this._conversationManagerAgent.Name === agentIdOrName\n );\n }\n\n /**\n * Process a message through the conversation manager agent. Delegates to\n * `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.\n *\n * Signature is preserved verbatim from the original service so existing\n * call sites continue to compile. The unused `conversationHistory`\n * parameter is kept for backwards compatibility (it was already\n * documented as \"kept for backwards compatibility but not used\" in the\n * original).\n */\n async processMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n conversationDetailId: string,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[]\n ): Promise<ExecuteAgentResult | null> {\n // Warm the cached default-agent name for any synchronous consumers\n // before the runtime resolves on its own.\n if (!this._conversationManagerAgent) {\n await this.getConversationManagerAgent();\n }\n return ConversationsRuntime.Instance.AgentRunner.processMessage({\n conversationId,\n message,\n conversationDetailId,\n appContext,\n onProgress,\n ...(planMode ? { planMode: true } : {}),\n ...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),\n });\n }\n\n /**\n * Configuration preset an agent was pinned to by a previous `@mention` in this conversation.\n *\n * Resolved by QUERY, not by scanning the display array. The pinning `@mention` is normally\n * the FIRST message of an exchange and everything after it is follow-up, so it is the\n * message most likely to fall below the loaded transcript window — and `undefined` is a\n * legal value for `configurationPresetId`, so the miss is silent. The visible consequence\n * is a run executed under the default configuration (a different model tier) instead of the\n * one the user explicitly chose, with a plausible-looking result and no error.\n *\n * There is no column to filter on: the preset lives inside the message body as a JSON\n * mention blob (`@{\"type\":\"agent\",\"id\":\"…\",\"configId\":\"…\"}`). So SQL narrows and the parser\n * decides — both `configId` and the agent id appear verbatim in that blob, which makes the\n * two LIKEs a tight prefilter, and `parseMentions` is what actually confirms a match.\n */\n public async FindConfigurationPresetForAgent(\n conversationId: string,\n agentId: string\n ): Promise<string | undefined> {\n type MentionRow = Pick<MJConversationDetailEntity, 'ID' | 'Message'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MentionRow>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND Role='User'`\n + ` AND Message LIKE '%\"configId\"%' AND Message LIKE '%${agentId}%'`,\n OrderBy: 'Sequence DESC',\n // >1 because LIKE cannot tell a mention blob from the same id appearing elsewhere in\n // the prose; the parse below is authoritative and picks the newest genuine match.\n MaxRows: CONFIG_PRESET_CANDIDATE_ROWS,\n Fields: ['ID', 'Message'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve configuration preset:', result.ErrorMessage);\n return undefined;\n }\n\n for (const row of result.Results || []) {\n const configurationId = this.readAgentConfigFromMention(row.Message, agentId);\n if (configurationId) {\n console.log(`\\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);\n return configurationId;\n }\n }\n return undefined;\n }\n\n /** Returns the configId this message pins for `agentId`, or null when it pins none. */\n private readAgentConfigFromMention(message: string | null, agentId: string): string | null {\n if (!message) {\n return null;\n }\n const parsed = this.mentionParser.parseMentions(message, AIEngineBase.Instance.Agents, []);\n const mention = parsed.agentMention;\n return mention?.id === agentId && mention.configurationId ? mention.configurationId : null;\n }\n\n\n /**\n * Clear the session for a conversation (useful when starting a new topic)\n */\n clearSession(conversationId: string): void {\n this._sessionIds.delete(conversationId);\n }\n\n /**\n * Surfaces a warning toast when the user requested skills (via /skill mentions) that the\n * target agent cannot activate — the server drops such requests, and without this the\n * refusal is invisible to the user. Client-side check uses the agent gate only (the server\n * additionally intersects with the user's Run permission).\n */\n private warnOnUnacceptedSkills(agent: MJAIAgentEntityExtended, requestedSkillIDs: string[]): void {\n const allowed = AIEngineBase.Instance.GetSkillsForAgent(agent);\n const dropped = requestedSkillIDs.filter(id => !allowed.some(s => UUIDsEqual(s.ID, id)));\n if (dropped.length === 0) return;\n const names = dropped.map(\n id => AIEngineBase.Instance.Skills.find(s => UUIDsEqual(s.ID, id))?.Name ?? 'requested skill'\n );\n const reason = agent.AcceptsSkills === 'None'\n ? `${agent.Name} doesn't accept skills`\n : `${agent.Name} can't activate ${names.length === 1 ? 'this skill' : 'these skills'}`;\n MJNotificationService.Instance?.CreateSimpleNotification(\n `${reason} — ${names.join(', ')} won't be used for this run.`,\n 'warning',\n 6000\n );\n }\n\n /**\n * Invoke a sub-agent based on Sage Agent's payload.\n * This is called when Sage decides to delegate to a specialist agent.\n *\n * Stays on the Angular shim because it directly uses AgentClientService.\n * Could move to the runtime in a follow-up if needed.\n */\n async invokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n conversationDetailId: string,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[]\n ): Promise<ExecuteAgentResult | null> {\n try {\n // Ensure AIEngineBase is configured\n await AIEngineBase.Instance.Config(false);\n\n // Find the agent by name\n const agent = AIEngineBase.Instance.Agents.find(a => a.Name === agentName);\n\n if (!agent || !agent.ID) {\n const errorMsg = `Sub-agent \"${agentName}\" not found`;\n console.warn(`${errorMsg}`);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n\n if (requestedSkillIDs?.length) {\n this.warnOnUnacceptedSkills(agent, requestedSkillIDs);\n }\n\n console.log(`Invoking sub-agent: ${agentName}`, { reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId });\n\n // Map AIAgentConfiguration preset ID to actual AIConfiguration ID\n let aiConfigurationId: string | undefined = undefined;\n if (agentConfigurationPresetId) {\n const presets = AIEngineBase.Instance.GetAgentConfigurationPresets(agent.ID, false);\n const preset = presets.find(p => UUIDsEqual(p.ID, agentConfigurationPresetId) || UUIDsEqual(p.AIConfigurationID, agentConfigurationPresetId));\n\n if (preset) {\n aiConfigurationId = preset.AIConfigurationID || undefined;\n console.log(`Mapped agent configuration preset \"${preset.Name}\" to AIConfigurationID: ${aiConfigurationId || 'default'}`);\n } else {\n console.warn(`Agent configuration preset ${agentConfigurationPresetId} not found for agent ${agent.ID}`);\n }\n }\n\n const agentParams: RunAgentFromConversationDetailParams = {\n ConversationDetailId: conversationDetailId,\n AgentId: agent.ID,\n MaxHistoryMessages: 20,\n Data: {\n conversationId: conversationId,\n latestMessageId: message.ID,\n invocationReason: reasoning,\n ...(appContext ? { appContext } : {}),\n },\n ...(payload ? { Payload: payload } : {}),\n ...(aiConfigurationId ? { ConfigurationId: aiConfigurationId } : {}),\n ...(planMode ? { PlanMode: true } : {}),\n ...(requestedSkillIDs?.length ? { RequestedSkillIDs: requestedSkillIDs } : {}),\n CreateArtifacts: true,\n CreateNotification: true,\n SourceArtifactId: sourceArtifactId,\n SourceArtifactVersionId: sourceArtifactVersionId,\n OnProgress: onProgress ? (progress) => {\n onProgress({\n step: progress.CurrentStep as 'initialization' | 'validation' | 'prompt_execution' | 'action_execution' | 'subagent_execution' | 'decision_processing' | 'finalization',\n percentage: progress.Percentage,\n message: progress.Message,\n metadata: progress.Metadata\n });\n } : undefined\n };\n\n const runResult = await this.agentClientService.RunAgentFromConversationDetail(agentParams);\n\n if (runResult.Success && runResult.Result) {\n return runResult.Result as ExecuteAgentResult;\n }\n\n const failed = coerceFailedExecuteAgentResult(\n runResult.Result as ExecuteAgentResult | null | undefined,\n runResult.ErrorMessage || `Sub-agent \"${agentName}\" failed`,\n );\n const errorMsg = `Sub-agent \"${agentName}\" failed: ${failed.errorMessage}`;\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return failed;\n } catch (error) {\n const errorMsg = `Error invoking sub-agent \"${agentName}\": ` + (error instanceof Error ? error.message : String(error));\n console.error(`Error invoking sub-agent \"${agentName}\":`, error);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return coerceFailedExecuteAgentResult<ExecuteAgentResult>(undefined, errorMsg);\n }\n }\n\n /**\n * Check if user's latest message should continue with the previous agent or route through Sage.\n * Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.\n *\n * Stays on the Angular shim because it directly uses GraphQLAIClient.\n * Could move to the runtime in a follow-up.\n */\n async checkAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[]\n ): Promise<IntentCheckResult> {\n if (!this._aiClient) {\n console.warn('AI Client not initialized, defaulting to UNSURE for intent check');\n return { decision: 'UNSURE', reasoning: 'AI Client not initialized' };\n }\n\n try {\n await AIEngineBase.Instance.Config(false);\n const prompt = AIEngineBase.Instance.Prompts.find(p => p.Name === 'Check Sage Intent');\n if (!prompt) {\n console.warn('⚠️ Check Sage Intent prompt not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Check Sage Intent prompt not found' };\n }\n\n const agent = AIEngineBase.Instance.Agents.find(a => UUIDsEqual(a.ID, agentId));\n if (!agent) {\n console.warn('⚠️ Previous agent not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Previous agent not found' };\n }\n\n // Queried, not read off the caller's window-scoped maps — see findAllAgentArtifacts.\n // `conversationHistory` below is still the window on purpose: the `.slice(-10)` wants\n // the most recent exchange, which the loaded tail always contains.\n const agentArtifacts = await this.findAllAgentArtifacts(conversationId, agentId);\n\n const recentHistory = conversationHistory.slice(-10);\n const compactHistory = recentHistory.map((msg, idx) => {\n const role = msg.Role === 'User' ? 'User' : agent.Name || 'Agent';\n const content = msg.Message || '';\n return `${idx + 1}. ${role}: ${content.substring(0, 150)}${content.length > 150 ? '...' : ''}`;\n }).join('\\n');\n\n let artifactContext = '';\n if (agentArtifacts.length > 0) {\n artifactContext = '\\n\\n**Prior Artifacts Created by This Agent**:\\n';\n agentArtifacts.forEach((artifact, idx) => {\n artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.artifactType})\\n`;\n artifactContext += ` - Versions: ${artifact.versions.length}\\n`;\n if (artifact.versions.length > 0) {\n artifactContext += ` - Latest: v${artifact.versions[0].versionNumber}`;\n if (artifact.versions[0].versionName) {\n artifactContext += ` - ${artifact.versions[0].versionName}`;\n }\n artifactContext += '\\n';\n }\n });\n }\n\n const userMessage = `**Previous Agent**: ${agent.Name} - ${agent.Description || 'No description'}\n\n**Conversation History** (last ${recentHistory.length} messages):\n${compactHistory}${artifactContext}\n\n**Latest User Message**: \"${latestMessage}\"`;\n\n console.log('🔍 Checking agent continuity intent...', {\n agentName: agent.Name,\n messagePreview: latestMessage.substring(0, 50),\n artifactCount: agentArtifacts.length\n });\n\n const result = await this._aiClient.RunAIPrompt({\n promptId: prompt.ID,\n messages: [{ role: 'user', content: userMessage }],\n data: {\n hasPriorArtifact: agentArtifacts.length > 0,\n priorArtifacts: agentArtifacts\n }\n });\n\n if (result && result.success && (result.parsedResult || result.output)) {\n const parsed = result.parsedResult ||\n (result.output ? JSON.parse(result.output) : null);\n\n if (parsed && parsed.continuesWith) {\n const decision = parsed.continuesWith.toUpperCase();\n const reasoning = parsed.reasoning || 'No reasoning provided';\n const targetArtifactVersionId = parsed.targetArtifactVersionId || undefined;\n\n console.log(`✅ Intent check result: ${decision}`, {\n reasoning,\n targetArtifactVersionId,\n latency: result.executionTimeMs || 'unknown'\n });\n\n if (decision === 'YES' || decision === 'NO' || decision === 'UNSURE') {\n return {\n decision: decision as 'YES' | 'NO' | 'UNSURE',\n reasoning,\n targetArtifactVersionId\n };\n }\n }\n }\n\n console.warn('⚠️ Intent check failed or returned invalid format, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Invalid format from intent check prompt' };\n } catch (error) {\n console.error('❌ Error checking agent continuity intent:', error);\n return {\n decision: 'UNSURE',\n reasoning: `Error during intent check: ${error instanceof Error ? error.message : String(error)}`\n };\n }\n }\n\n /**\n * Every artifact this agent produced in this conversation, newest version first — resolved\n * by QUERY, not by scanning the display array.\n *\n * The scan this replaces walked `conversationDetails` and looked each row up in the\n * caller's `artifactsByDetailId` / `agentRunsByDetailId` maps. Both are scoped to the\n * LOADED WINDOW, so under transcript windowing it saw only the artifacts attached to the\n * page currently on screen.\n *\n * That matters because this list is the \"Prior Artifacts Created by This Agent\" block fed\n * to the Check Sage Intent prompt, which is what produces `targetArtifactVersionId`. A\n * truncated list does not make the classifier fail — it makes it reason over a partial\n * history and confidently name the wrong version, or miss continuity altogether. Silent,\n * plausible, and wrong: the same failure class as {@link FindLatestAgentOutputVersion},\n * closed the same way.\n *\n * Two reads, not the four the old shape would have needed — see\n * {@link AgentArtifactSummary} for why dropping `runId` removes the join back to agent runs.\n */\n private async findAllAgentArtifacts(\n conversationId: string,\n agentId: string\n ): Promise<AgentArtifactSummary[]> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Name'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const versionResult = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: this.agentOutputVersionFilter(conversationId, agentId),\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: MAX_AGENT_ARTIFACT_VERSIONS,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Name'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!versionResult.Success) {\n console.error('Failed to load agent artifact versions:', versionResult.ErrorMessage);\n return []; // the classifier degrades to no artifact context\n }\n const versions = versionResult.Results || [];\n if (versions.length === 0) {\n return [];\n }\n\n const artifactsById = await this.loadArtifactNames(\n [...new Set(versions.map(v => v.ArtifactID))]\n );\n return GroupVersionsByArtifact(versions, artifactsById);\n }\n\n /** Names and types for the artifacts behind a set of versions. */\n private async loadArtifactNames(\n artifactIds: string[]\n ): Promise<Map<string, Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>>> {\n type ArtifactRow = Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<ArtifactRow>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIds.map(id => `'${id}'`).join(',')})`,\n Fields: ['ID', 'Name', 'Type'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent artifacts:', result.ErrorMessage);\n return new Map<string, ArtifactRow>();\n }\n return new Map((result.Results || []).map(a => [a.ID, a]));\n }\n\n /**\n * Newest OUTPUT artifact version an agent produced in this conversation — resolved by\n * QUERY, not by scanning the display array.\n *\n * The array scan this replaces was correct only while `conversationHistory` held the whole\n * conversation. Under transcript windowing it holds one page, so the scan silently returns\n * null for any artifact below the window's oldest row — exactly the long \"modify this\n * again\" exchanges where payload continuity matters most. A null payload is a LEGAL agent\n * input, so the failure is silent: the agent regenerates from scratch instead of modifying.\n *\n * One round trip. The subquery walks details -> Output junctions, and versions carry\n * `__mj_CreatedAt`, so \"newest\" is expressible without joining back for `Sequence`.\n */\n public async FindLatestAgentOutputVersion(\n conversationId: string,\n agentId: string\n ): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(\n this.agentOutputVersionFilter(conversationId, agentId), '__mj_CreatedAt DESC'\n );\n }\n\n /**\n * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced in one\n * conversation. Shared by {@link FindLatestAgentOutputVersion} and\n * {@link findAllAgentArtifacts} so the two can never disagree about what \"this agent's\n * artifacts\" means.\n *\n * Filters on the DETAIL's `Status <> 'Error'` rather than the agent run's\n * `Status = 'Completed'` (which is what the array scan this replaced used). Doing it on the\n * run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the\n * detail already carries.\n */\n private agentOutputVersionFilter(conversationId: string, agentId: string): string {\n return `ID IN (\n SELECT ArtifactVersionID FROM [__mj].[vwConversationDetailArtifacts]\n WHERE Direction='Output' AND ConversationDetailID IN (\n SELECT ID FROM [__mj].[vwConversationDetails]\n WHERE ConversationID='${conversationId}' AND AgentID='${agentId}'\n AND Role='AI' AND Status <> 'Error'\n )\n )`;\n }\n\n /**\n * One artifact version by ID, as a payload source.\n *\n * Used by the continuity path after the intent check names a specific version: that ID may\n * belong to a message below the loaded window, so it cannot be resolved from the window's\n * artifact maps.\n */\n public async FindArtifactVersionById(versionId: string): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(`ID='${versionId}'`, undefined);\n }\n\n /**\n * Shared read behind {@link FindLatestAgentOutputVersion} and {@link FindArtifactVersionById}.\n *\n * `ResultType: 'simple'` with an explicit `Fields` list: nothing here is mutated, and under\n * `entity_object` the `Fields` narrowing would be silently discarded by `PreRunView`.\n */\n private async runPayloadSourceQuery(\n extraFilter: string,\n orderBy: string | undefined\n ): Promise<AgentPayloadSource | null> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Content'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: extraFilter,\n OrderBy: orderBy,\n MaxRows: 1,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Content'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve agent payload source:', result.ErrorMessage);\n return null;\n }\n const row = result.Results?.[0];\n if (!row) {\n return null;\n }\n return {\n artifactId: row.ArtifactID,\n versionId: row.ID,\n versionNumber: row.VersionNumber,\n payload: parseArtifactContent(row.Content)\n };\n }\n\n}\n\n/**\n * Parses an artifact version's `Content` into an agent payload. Returns null rather than\n * throwing — a malformed artifact must not take down the send path, and \"no payload\" is\n * already a legal agent input.\n *\n * A payload must be a JSON OBJECT. Valid JSON that parses to an array, string, or number is\n * rejected for the same reason a parse failure is: every consumer spreads it or reads named\n * keys off it, so a non-object would satisfy the type at the boundary and misbehave deeper in.\n */\nfunction parseArtifactContent(content: string | null | undefined): Record<string, unknown> | null {\n if (!content) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(content);\n return isPayloadObject(parsed) ? parsed : null;\n } catch (error) {\n console.warn('Artifact version content did not parse as JSON:', error);\n return null;\n }\n}\n\n/** Narrows a parsed JSON value to a plain object — the only shape a payload may take. */\nfunction isPayloadObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
1
+ {"version":3,"file":"conversation-agent.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAqB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAuB,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAsD,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAClI,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAInB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EACL,uBAAuB,EAExB,MAAM,iCAAiC,CAAC;;;;;AAEzC;;;GAGG;AACH,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAyCvC;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,MAAM,OAAO,wBAAwB;IAmBzB;IACA;IAnBV,2GAA2G;IACnG,SAAS,GAA2B,IAAI,CAAC;IACjD,2EAA2E;IACnE,yBAAyB,GAAmC,IAAI,CAAC;IACjE,WAAW,GAAwB,IAAI,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AAU,EAAE,MAAM;aACnB;;AA+rBD;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,OAAkC;IAC9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Metadata, IMetadataProvider, RunView } from '@memberjunction/core';\nimport { GraphQLDataProvider, GraphQLAIClient } from '@memberjunction/graphql-dataprovider';\nimport { ExecuteAgentResult, AgentExecutionProgressCallback, coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport {\n ConversationEngine,\n MJConversationDetailEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity\n} from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended } from '@memberjunction/ai-core-plus';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { RunAgentFromConversationDetailParams } from '@memberjunction/ai-agent-client';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\nimport { LazyArtifactInfo } from '../models/lazy-artifact-info';\nimport { MentionParserService } from './mention-parser.service';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\nimport {\n GroupVersionsByArtifact,\n type AgentArtifactSummary\n} from '../utils/agent-artifact-summary';\n\n/**\n * Rows the configuration-preset lookup parses before giving up. The SQL prefilter is a LIKE,\n * so a few candidates may not be real mention blobs; this bounds how many we inspect.\n */\nconst CONFIG_PRESET_CANDIDATE_ROWS = 5;\n\n/**\n * Cap on artifact versions listed for the intent classifier.\n *\n * The block is a hint, not a record: the prompt prints a name, a type, a version count and\n * the latest version per artifact. Newest-first ordering means the cap only ever trims the\n * oldest versions of the busiest artifacts, which are the least useful lines in it.\n */\nconst MAX_AGENT_ARTIFACT_VERSIONS = 40;\n\n/**\n * Context for artifact lookups — pre-loaded conversation data.\n *\n * NO LONGER CONSUMED by this service. Both readers were converted to queries when transcript\n * windowing made these maps a partial view: they are keyed to the loaded window, so any\n * lookup for an older row silently missed. Retained as an exported type for API\n * compatibility; new code should not build one.\n */\nexport interface ArtifactLookupContext {\n agentRunsByDetailId: Map<string, MJAIAgentRunEntityExtended>;\n artifactsByDetailId: Map<string, LazyArtifactInfo[]>;\n}\n\n/**\n * An agent's prior OUTPUT artifact, resolved for payload continuity.\n *\n * `payload` is the parsed `ArtifactVersion.Content`, typed to match what actually consumes it\n * — `executeAgentContinuation` and `invokeSubAgent` both take `Record<string, unknown> | null`.\n * It is null when the version carried no content, the content did not parse, or the content\n * parsed to something that is not a JSON object; callers treat all three the same as \"no prior\n * artifact\", which is already a legal agent input.\n */\nexport interface AgentPayloadSource {\n artifactId: string;\n versionId: string;\n versionNumber: number;\n payload: Record<string, unknown> | null;\n}\n\n/**\n * Result from intent check - indicates whether to continue with agent\n * and which artifact version to use as payload\n */\nexport interface IntentCheckResult {\n decision: 'YES' | 'NO' | 'UNSURE';\n reasoning: string;\n targetArtifactVersionId?: string;\n}\n\n/**\n * Angular DI service for conversation-level agent orchestration.\n *\n * After PR 2 of the conversations-runtime extraction, the core\n * `processMessage` flow and the conversation-manager-agent resolution are\n * delegated to `@memberjunction/conversations-runtime`. This service is\n * primarily a shim for those operations PLUS the holder of the helpers\n * that haven't been ported yet:\n *\n * - `invokeSubAgent(...)` — used by Sage's routing decisions in\n * `message-input.component`.\n * - `checkAgentContinuityIntent(...)` — fast intent classification when the\n * user replies to a previous-agent thread.\n * - `FindConfigurationPresetForAgent(...)` — locates an agent's preset\n * from prior @mentions in the conversation.\n * - `clearSession(...)` — per-conversation session-id bookkeeping.\n *\n * These can move to the runtime in a follow-up; they aren't strictly needed\n * to invoke an agent end-to-end and stay here so the shim has zero behavior\n * difference vs. the original.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAgentService {\n /** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */\n private _aiClient: GraphQLAIClient | null = null;\n /** Cached resolution of the conversation manager agent (default agent). */\n private _conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n private _sessionIds: Map<string, string> = new Map();\n\n /** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */\n public readonly IsProcessing$: Observable<boolean>;\n\n /** @deprecated Use {@link IsProcessing$}. */\n public get isProcessing$(): Observable<boolean> {\n return this.IsProcessing$;\n }\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(\n _bootstrap: ConversationsRuntimeBootstrap,\n private mentionParser: MentionParserService,\n private agentClientService: AgentClientService\n ) {\n // Injecting `_bootstrap` forces the runtime's INotificationAdapter +\n // IActiveTaskTracker adapters to register before any shim method runs.\n this.IsProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;\n this.initializeAIClient();\n }\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it re-initializes the AI client and forwards the provider to the runtime's runner.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n this.initializeAIClient();\n ConversationsRuntime.Instance.AgentRunner.Provider = value;\n }\n\n /**\n * Initialize the GraphQL AI Client.\n * Retained for RunAIPrompt calls (intent checking) which the AgentClientService doesn't wrap.\n * Agent execution (RunAIAgentFromConversationDetail) now goes through ConversationsRuntime.AgentRunner.\n */\n private initializeAIClient(): void {\n try {\n const provider = this.Provider as GraphQLDataProvider;\n if (provider) {\n this._aiClient = new GraphQLAIClient(provider);\n } else {\n console.warn('GraphQLDataProvider not available, agent functionality will be limited');\n }\n } catch (error) {\n console.error('Failed to initialize GraphQL AI Client:', error);\n }\n }\n\n /**\n * Resolve the conversation manager agent via the runtime's 4-step\n * DefaultAgentResolver chain (explicit input → app-scoped Application\n * Setting → global Application Setting → code-const Sage fallback). The\n * result is cached on this service for use by the synchronous\n * {@link ConversationManagerAgentName} getter.\n *\n * Existing callers expect a Promise<MJAIAgentEntityExtended | null> — we\n * preserve that shape (returning null on failure rather than throwing)\n * so the call sites don't need to change.\n */\n public async GetConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n if (this._conversationManagerAgent) {\n return this._conversationManagerAgent;\n }\n\n try {\n const provider = this.Provider;\n const agent = await ConversationsRuntime.Instance.DefaultAgent.resolve({\n contextUser: provider.CurrentUser ?? undefined,\n provider,\n });\n this._conversationManagerAgent = agent;\n return agent;\n } catch (error) {\n const errorMsg = 'Error resolving conversation manager agent: ' + (error instanceof Error ? error.message : String(error));\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n }\n\n /** @deprecated Use {@link GetConversationManagerAgent}. */\n public async getConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n return this.GetConversationManagerAgent();\n }\n\n /**\n * Synchronous read of the cached conversation-manager-agent name. Returns\n * `null` until {@link getConversationManagerAgent} has been called at least\n * once and resolved successfully. Used by `MessageItemComponent.isConversationManager`\n * to flag messages from the routing agent without hardcoding `'Sage'`.\n */\n public get ConversationManagerAgentName(): string | null {\n return this._conversationManagerAgent?.Name ?? null;\n }\n\n /**\n * Returns `true` if the supplied agent identifier (UUID or name) matches the\n * currently cached conversation manager agent. Robust to either input.\n */\n public IsConversationManagerAgent(agentIdOrName: string | null | undefined): boolean {\n if (!agentIdOrName || !this._conversationManagerAgent) return false;\n return (\n UUIDsEqual(this._conversationManagerAgent.ID, agentIdOrName) ||\n this._conversationManagerAgent.Name === agentIdOrName\n );\n }\n\n /**\n * Process a message through the conversation manager agent. Delegates to\n * `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.\n *\n * Signature is preserved verbatim from the original service so existing\n * call sites continue to compile. The unused `conversationHistory`\n * parameter is kept for backwards compatibility (it was already\n * documented as \"kept for backwards compatibility but not used\" in the\n * original).\n */\n async ProcessMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n conversationDetailId: string,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The agents the conversation manager may delegate to. Null or omitted allows every agent. */\n allowedAgentIDs?: readonly string[] | null,\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null\n ): Promise<ExecuteAgentResult | null> {\n // Warm the cached default-agent name for any synchronous consumers\n // before the runtime resolves on its own.\n if (!this._conversationManagerAgent) {\n await this.GetConversationManagerAgent();\n }\n return ConversationsRuntime.Instance.AgentRunner.processMessage({\n conversationId,\n message,\n conversationDetailId,\n appContext,\n onProgress,\n ...(planMode ? { planMode: true } : {}),\n ...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),\n ...(allowedAgentIDs != null ? { AllowedAgentIDs: allowedAgentIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n });\n }\n\n /** @deprecated Use {@link ProcessMessage}. */\n async processMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n conversationDetailId: string,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n allowedAgentIDs?: readonly string[] | null,\n agentHistoryFrom?: Date | null\n ): Promise<ExecuteAgentResult | null> {\n return this.ProcessMessage(conversationId, message, conversationHistory, conversationDetailId, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom);\n }\n\n /**\n * Configuration preset an agent was pinned to by a previous `@mention` in this conversation.\n *\n * Resolved by QUERY, not by scanning the display array. The pinning `@mention` is normally\n * the FIRST message of an exchange and everything after it is follow-up, so it is the\n * message most likely to fall below the loaded transcript window — and `undefined` is a\n * legal value for `configurationPresetId`, so the miss is silent. The visible consequence\n * is a run executed under the default configuration (a different model tier) instead of the\n * one the user explicitly chose, with a plausible-looking result and no error.\n *\n * There is no column to filter on: the preset lives inside the message body as a JSON\n * mention blob (`@{\"type\":\"agent\",\"id\":\"…\",\"configId\":\"…\"}`). So SQL narrows and the parser\n * decides — both `configId` and the agent id appear verbatim in that blob, which makes the\n * two LIKEs a tight prefilter, and `parseMentions` is what actually confirms a match.\n */\n public async FindConfigurationPresetForAgent(\n conversationId: string,\n agentId: string\n ): Promise<string | undefined> {\n type MentionRow = Pick<MJConversationDetailEntity, 'ID' | 'Message'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MentionRow>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND Role='User'`\n + ` AND Message LIKE '%\"configId\"%' AND Message LIKE '%${agentId}%'`,\n OrderBy: 'Sequence DESC',\n // >1 because LIKE cannot tell a mention blob from the same id appearing elsewhere in\n // the prose; the parse below is authoritative and picks the newest genuine match.\n MaxRows: CONFIG_PRESET_CANDIDATE_ROWS,\n Fields: ['ID', 'Message'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve configuration preset:', result.ErrorMessage);\n return undefined;\n }\n\n for (const row of result.Results || []) {\n const configurationId = this.readAgentConfigFromMention(row.Message, agentId);\n if (configurationId) {\n console.log(`\\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);\n return configurationId;\n }\n }\n return undefined;\n }\n\n /** Returns the configId this message pins for `agentId`, or null when it pins none. */\n private readAgentConfigFromMention(message: string | null, agentId: string): string | null {\n if (!message) {\n return null;\n }\n const parsed = this.mentionParser.parseMentions(message, AIEngineBase.Instance.Agents, []);\n const mention = parsed.agentMention;\n return mention?.id === agentId && mention.configurationId ? mention.configurationId : null;\n }\n\n\n /**\n * Clear the session for a conversation (useful when starting a new topic)\n */\n ClearSession(conversationId: string): void {\n this._sessionIds.delete(conversationId);\n }\n\n /** @deprecated Use {@link ClearSession}. */\n clearSession(conversationId: string): void {\n return this.ClearSession(conversationId);\n }\n\n /**\n * Surfaces a warning toast when the user requested skills (via /skill mentions) that the\n * target agent cannot activate — the server drops such requests, and without this the\n * refusal is invisible to the user. Client-side check uses the agent gate only (the server\n * additionally intersects with the user's Run permission).\n */\n private warnOnUnacceptedSkills(agent: MJAIAgentEntityExtended, requestedSkillIDs: string[]): void {\n const allowed = AIEngineBase.Instance.GetSkillsForAgent(agent);\n const dropped = requestedSkillIDs.filter(id => !allowed.some(s => UUIDsEqual(s.ID, id)));\n if (dropped.length === 0) return;\n const names = dropped.map(\n id => AIEngineBase.Instance.Skills.find(s => UUIDsEqual(s.ID, id))?.Name ?? 'requested skill'\n );\n const reason = agent.AcceptsSkills === 'None'\n ? `${agent.Name} doesn't accept skills`\n : `${agent.Name} can't activate ${names.length === 1 ? 'this skill' : 'these skills'}`;\n MJNotificationService.Instance?.CreateSimpleNotification(\n `${reason} — ${names.join(', ')} won't be used for this run.`,\n 'warning',\n 6000\n );\n }\n\n /**\n * Invoke a sub-agent based on Sage Agent's payload.\n * This is called when Sage decides to delegate to a specialist agent.\n *\n * Stays on the Angular shim because it directly uses AgentClientService.\n * Could move to the runtime in a follow-up if needed.\n */\n async InvokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n conversationDetailId: string,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null\n ): Promise<ExecuteAgentResult | null> {\n try {\n // Ensure AIEngineBase is configured\n await AIEngineBase.Instance.Config(false);\n\n // Find the agent by name\n const agent = AIEngineBase.Instance.Agents.find(a => a.Name === agentName);\n\n if (!agent || !agent.ID) {\n const errorMsg = `Sub-agent \"${agentName}\" not found`;\n console.warn(`${errorMsg}`);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n\n if (requestedSkillIDs?.length) {\n this.warnOnUnacceptedSkills(agent, requestedSkillIDs);\n }\n\n console.log(`Invoking sub-agent: ${agentName}`, { reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId });\n\n // Map AIAgentConfiguration preset ID to actual AIConfiguration ID\n let aiConfigurationId: string | undefined = undefined;\n if (agentConfigurationPresetId) {\n const presets = AIEngineBase.Instance.GetAgentConfigurationPresets(agent.ID, false);\n const preset = presets.find(p => UUIDsEqual(p.ID, agentConfigurationPresetId) || UUIDsEqual(p.AIConfigurationID, agentConfigurationPresetId));\n\n if (preset) {\n aiConfigurationId = preset.AIConfigurationID || undefined;\n console.log(`Mapped agent configuration preset \"${preset.Name}\" to AIConfigurationID: ${aiConfigurationId || 'default'}`);\n } else {\n console.warn(`Agent configuration preset ${agentConfigurationPresetId} not found for agent ${agent.ID}`);\n }\n }\n\n const agentParams: RunAgentFromConversationDetailParams = {\n ConversationDetailId: conversationDetailId,\n AgentId: agent.ID,\n MaxHistoryMessages: 20,\n Data: {\n conversationId: conversationId,\n latestMessageId: message.ID,\n invocationReason: reasoning,\n ...(appContext ? { appContext } : {}),\n },\n ...(payload ? { Payload: payload } : {}),\n ...(aiConfigurationId ? { ConfigurationId: aiConfigurationId } : {}),\n ...(planMode ? { PlanMode: true } : {}),\n ...(requestedSkillIDs?.length ? { RequestedSkillIDs: requestedSkillIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n CreateArtifacts: true,\n CreateNotification: true,\n SourceArtifactId: sourceArtifactId,\n SourceArtifactVersionId: sourceArtifactVersionId,\n OnProgress: onProgress ? (progress) => {\n onProgress({\n step: progress.CurrentStep as 'initialization' | 'validation' | 'prompt_execution' | 'action_execution' | 'subagent_execution' | 'decision_processing' | 'finalization',\n percentage: progress.Percentage,\n message: progress.Message,\n metadata: progress.Metadata\n });\n } : undefined\n };\n\n const runResult = await this.agentClientService.RunAgentFromConversationDetail(agentParams);\n\n if (runResult.Success && runResult.Result) {\n return runResult.Result as ExecuteAgentResult;\n }\n\n const failed = coerceFailedExecuteAgentResult(\n runResult.Result as ExecuteAgentResult | null | undefined,\n runResult.ErrorMessage || `Sub-agent \"${agentName}\" failed`,\n );\n const errorMsg = `Sub-agent \"${agentName}\" failed: ${failed.errorMessage}`;\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return failed;\n } catch (error) {\n const errorMsg = `Error invoking sub-agent \"${agentName}\": ` + (error instanceof Error ? error.message : String(error));\n console.error(`Error invoking sub-agent \"${agentName}\":`, error);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return coerceFailedExecuteAgentResult<ExecuteAgentResult>(undefined, errorMsg);\n }\n }\n\n /** @deprecated Use {@link InvokeSubAgent}. */\n async invokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n conversationDetailId: string,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n agentHistoryFrom?: Date | null\n ): Promise<ExecuteAgentResult | null> {\n return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, conversationDetailId, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom);\n }\n\n /**\n * Check if user's latest message should continue with the previous agent or route through Sage.\n * Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.\n *\n * Stays on the Angular shim because it directly uses GraphQLAIClient.\n * Could move to the runtime in a follow-up.\n */\n async CheckAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[]\n ): Promise<IntentCheckResult> {\n if (!this._aiClient) {\n console.warn('AI Client not initialized, defaulting to UNSURE for intent check');\n return { decision: 'UNSURE', reasoning: 'AI Client not initialized' };\n }\n\n try {\n await AIEngineBase.Instance.Config(false);\n const prompt = AIEngineBase.Instance.Prompts.find(p => p.Name === 'Check Sage Intent');\n if (!prompt) {\n console.warn('⚠️ Check Sage Intent prompt not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Check Sage Intent prompt not found' };\n }\n\n const agent = AIEngineBase.Instance.Agents.find(a => UUIDsEqual(a.ID, agentId));\n if (!agent) {\n console.warn('⚠️ Previous agent not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Previous agent not found' };\n }\n\n // Queried, not read off the caller's window-scoped maps — see findAllAgentArtifacts.\n // `conversationHistory` below is still the window on purpose: the `.slice(-10)` wants\n // the most recent exchange, which the loaded tail always contains.\n const agentArtifacts = await this.findAllAgentArtifacts(conversationId, agentId);\n\n const recentHistory = conversationHistory.slice(-10);\n const compactHistory = recentHistory.map((msg, idx) => {\n const role = msg.Role === 'User' ? 'User' : agent.Name || 'Agent';\n const content = msg.Message || '';\n return `${idx + 1}. ${role}: ${content.substring(0, 150)}${content.length > 150 ? '...' : ''}`;\n }).join('\\n');\n\n let artifactContext = '';\n if (agentArtifacts.length > 0) {\n artifactContext = '\\n\\n**Prior Artifacts Created by This Agent**:\\n';\n agentArtifacts.forEach((artifact, idx) => {\n artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.ArtifactType})\\n`;\n artifactContext += ` - Versions: ${artifact.Versions.length}\\n`;\n if (artifact.Versions.length > 0) {\n artifactContext += ` - Latest: v${artifact.Versions[0].versionNumber}`;\n if (artifact.Versions[0].versionName) {\n artifactContext += ` - ${artifact.Versions[0].versionName}`;\n }\n artifactContext += '\\n';\n }\n });\n }\n\n const userMessage = `**Previous Agent**: ${agent.Name} - ${agent.Description || 'No description'}\n\n**Conversation History** (last ${recentHistory.length} messages):\n${compactHistory}${artifactContext}\n\n**Latest User Message**: \"${latestMessage}\"`;\n\n console.log('🔍 Checking agent continuity intent...', {\n agentName: agent.Name,\n messagePreview: latestMessage.substring(0, 50),\n artifactCount: agentArtifacts.length\n });\n\n const result = await this._aiClient.RunAIPrompt({\n promptId: prompt.ID,\n messages: [{ role: 'user', content: userMessage }],\n data: {\n hasPriorArtifact: agentArtifacts.length > 0,\n priorArtifacts: agentArtifacts\n }\n });\n\n if (result && result.success && (result.parsedResult || result.output)) {\n const parsed = result.parsedResult ||\n (result.output ? JSON.parse(result.output) : null);\n\n if (parsed && parsed.continuesWith) {\n const decision = parsed.continuesWith.toUpperCase();\n const reasoning = parsed.reasoning || 'No reasoning provided';\n const targetArtifactVersionId = parsed.targetArtifactVersionId || undefined;\n\n console.log(`✅ Intent check result: ${decision}`, {\n reasoning,\n targetArtifactVersionId,\n latency: result.executionTimeMs || 'unknown'\n });\n\n if (decision === 'YES' || decision === 'NO' || decision === 'UNSURE') {\n return {\n decision: decision as 'YES' | 'NO' | 'UNSURE',\n reasoning,\n targetArtifactVersionId\n };\n }\n }\n }\n\n console.warn('⚠️ Intent check failed or returned invalid format, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Invalid format from intent check prompt' };\n } catch (error) {\n console.error('❌ Error checking agent continuity intent:', error);\n return {\n decision: 'UNSURE',\n reasoning: `Error during intent check: ${error instanceof Error ? error.message : String(error)}`\n };\n }\n }\n\n /** @deprecated Use {@link CheckAgentContinuityIntent}. */\n async checkAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[]\n ): Promise<IntentCheckResult> {\n return this.CheckAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory);\n }\n\n /**\n * Every artifact this agent produced in this conversation, newest version first — resolved\n * by QUERY, not by scanning the display array.\n *\n * The scan this replaces walked `conversationDetails` and looked each row up in the\n * caller's `artifactsByDetailId` / `agentRunsByDetailId` maps. Both are scoped to the\n * LOADED WINDOW, so under transcript windowing it saw only the artifacts attached to the\n * page currently on screen.\n *\n * That matters because this list is the \"Prior Artifacts Created by This Agent\" block fed\n * to the Check Sage Intent prompt, which is what produces `targetArtifactVersionId`. A\n * truncated list does not make the classifier fail — it makes it reason over a partial\n * history and confidently name the wrong version, or miss continuity altogether. Silent,\n * plausible, and wrong: the same failure class as {@link FindLatestAgentOutputVersion},\n * closed the same way.\n *\n * Two reads, not the four the old shape would have needed — see\n * {@link AgentArtifactSummary} for why dropping `runId` removes the join back to agent runs.\n */\n private async findAllAgentArtifacts(\n conversationId: string,\n agentId: string\n ): Promise<AgentArtifactSummary[]> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Name'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const versionResult = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: this.agentOutputVersionFilter(conversationId, agentId),\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: MAX_AGENT_ARTIFACT_VERSIONS,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Name'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!versionResult.Success) {\n console.error('Failed to load agent artifact versions:', versionResult.ErrorMessage);\n return []; // the classifier degrades to no artifact context\n }\n const versions = versionResult.Results || [];\n if (versions.length === 0) {\n return [];\n }\n\n const artifactsById = await this.loadArtifactNames(\n [...new Set(versions.map(v => v.ArtifactID))]\n );\n return GroupVersionsByArtifact(versions, artifactsById);\n }\n\n /** Names and types for the artifacts behind a set of versions. */\n private async loadArtifactNames(\n artifactIds: string[]\n ): Promise<Map<string, Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>>> {\n type ArtifactRow = Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<ArtifactRow>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIds.map(id => `'${id}'`).join(',')})`,\n Fields: ['ID', 'Name', 'Type'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent artifacts:', result.ErrorMessage);\n return new Map<string, ArtifactRow>();\n }\n return new Map((result.Results || []).map(a => [a.ID, a]));\n }\n\n /**\n * Newest OUTPUT artifact version an agent produced in this conversation — resolved by\n * QUERY, not by scanning the display array.\n *\n * The array scan this replaces was correct only while `conversationHistory` held the whole\n * conversation. Under transcript windowing it holds one page, so the scan silently returns\n * null for any artifact below the window's oldest row — exactly the long \"modify this\n * again\" exchanges where payload continuity matters most. A null payload is a LEGAL agent\n * input, so the failure is silent: the agent regenerates from scratch instead of modifying.\n *\n * One round trip. The subquery walks details -> Output junctions, and versions carry\n * `__mj_CreatedAt`, so \"newest\" is expressible without joining back for `Sequence`.\n *\n * @param historyFrom The chat's history floor. When set, only artifacts on replies written at\n * or after it count: a run that may not read earlier messages must not pick up their work\n * as its payload either.\n */\n public async FindLatestAgentOutputVersion(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null\n ): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(\n this.agentOutputVersionFilter(conversationId, agentId, historyFrom), '__mj_CreatedAt DESC'\n );\n }\n\n /**\n * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced in one\n * conversation. Shared by {@link FindLatestAgentOutputVersion} and\n * {@link findAllAgentArtifacts} so the two can never disagree about what \"this agent's\n * artifacts\" means.\n *\n * Filters on the DETAIL's `Status <> 'Error'` rather than the agent run's\n * `Status = 'Completed'` (which is what the array scan this replaced used). Doing it on the\n * run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the\n * detail already carries.\n */\n private agentOutputVersionFilter(conversationId: string, agentId: string, historyFrom?: Date | null): string {\n const floor = historyFrom ? ` AND ${ConversationEngine.HistoryFromFilter(historyFrom)}` : '';\n return `ID IN (\n SELECT ArtifactVersionID FROM [__mj].[vwConversationDetailArtifacts]\n WHERE Direction='Output' AND ConversationDetailID IN (\n SELECT ID FROM [__mj].[vwConversationDetails]\n WHERE ConversationID='${conversationId}' AND AgentID='${agentId}'\n AND Role='AI' AND Status <> 'Error'${floor}\n )\n )`;\n }\n\n /**\n * One artifact version by ID, as a payload source.\n *\n * Used by the continuity path after the intent check names a specific version: that ID may\n * belong to a message below the loaded window, so it cannot be resolved from the window's\n * artifact maps.\n */\n public async FindArtifactVersionById(versionId: string): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(`ID='${versionId}'`, undefined);\n }\n\n /**\n * Shared read behind {@link FindLatestAgentOutputVersion} and {@link FindArtifactVersionById}.\n *\n * `ResultType: 'simple'` with an explicit `Fields` list: nothing here is mutated, and under\n * `entity_object` the `Fields` narrowing would be silently discarded by `PreRunView`.\n */\n private async runPayloadSourceQuery(\n extraFilter: string,\n orderBy: string | undefined\n ): Promise<AgentPayloadSource | null> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Content'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: extraFilter,\n OrderBy: orderBy,\n MaxRows: 1,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Content'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve agent payload source:', result.ErrorMessage);\n return null;\n }\n const row = result.Results?.[0];\n if (!row) {\n return null;\n }\n return {\n artifactId: row.ArtifactID,\n versionId: row.ID,\n versionNumber: row.VersionNumber,\n payload: parseArtifactContent(row.Content)\n };\n }\n\n}\n\n/**\n * Parses an artifact version's `Content` into an agent payload. Returns null rather than\n * throwing — a malformed artifact must not take down the send path, and \"no payload\" is\n * already a legal agent input.\n *\n * A payload must be a JSON OBJECT. Valid JSON that parses to an array, string, or number is\n * rejected for the same reason a parse failure is: every consumer spreads it or reads named\n * keys off it, so a non-object would satisfy the type at the boundary and misbehave deeper in.\n */\nfunction parseArtifactContent(content: string | null | undefined): Record<string, unknown> | null {\n if (!content) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(content);\n return isPayloadObject(parsed) ? parsed : null;\n } catch (error) {\n console.warn('Artifact version content did not parse as JSON:', error);\n return null;\n }\n}\n\n/** Narrows a parsed JSON value to a plain object — the only shape a payload may take. */\nfunction isPayloadObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { UserInfo, IMetadataProvider } from '@memberjunction/core';
2
- import { MJConversationDetailAttachmentEntity } from '@memberjunction/core-entities';
2
+ import { MJConversationDetailAttachmentEntity, MJAIAgentEntity } from '@memberjunction/core-entities';
3
3
  import { MessageAttachment } from '../components/message/message-item.component';
4
4
  import { PendingAttachment } from '@memberjunction/ng-composer';
5
5
  import * as i0 from "@angular/core";
@@ -8,6 +8,23 @@ import * as i0 from "@angular/core";
8
8
  * Handles loading, saving, and converting attachments between different formats.
9
9
  */
10
10
  export declare class ConversationAttachmentService {
11
+ /**
12
+ * Where attachment bytes go when they are too large to store inline.
13
+ *
14
+ * Held directly rather than read off the shared `ConversationAttachmentService` in
15
+ * `@memberjunction/aiengine`. That package's entry point imports Node's `crypto`
16
+ * (`AIEngine.ts`, for an embedding-cache key), so a runtime import of it from here pulls the
17
+ * whole server AI engine into Explorer's browser bundle and the build fails to resolve `crypto`.
18
+ * The shared service is a server-side consumer of the same seam, not a dependency of this one.
19
+ *
20
+ * The seam's *type* used to be imported from there with `import type`, on the reasoning that an
21
+ * erased import costs nothing. It does at runtime — but the class-registration manifest generator
22
+ * walks **package.json**, so the declared dependency was a live edge regardless, and it later
23
+ * carried `@memberjunction/storage`'s drivers into the browser manifest. Both the contract and
24
+ * the placement policy (`ConversationUtility`) now come from `@memberjunction/ai-core-plus`, and
25
+ * this package does not declare `aiengine` at all.
26
+ */
27
+ private readonly blobStore;
11
28
  private _provider;
12
29
  constructor();
13
30
  /**
@@ -19,10 +36,14 @@ export declare class ConversationAttachmentService {
19
36
  * Load all attachments for a list of conversation detail IDs.
20
37
  * Returns a map of ConversationDetailID -> MessageAttachment[]
21
38
  */
39
+ LoadAttachmentsForMessages(conversationDetailIds: string[], contextUser?: UserInfo): Promise<Map<string, MessageAttachment[]>>;
40
+ /** @deprecated Use {@link LoadAttachmentsForMessages}. */
22
41
  loadAttachmentsForMessages(conversationDetailIds: string[], contextUser?: UserInfo): Promise<Map<string, MessageAttachment[]>>;
23
42
  /**
24
43
  * Load attachments for a single message
25
44
  */
45
+ LoadAttachmentsForMessage(conversationDetailId: string, contextUser?: UserInfo): Promise<MessageAttachment[]>;
46
+ /** @deprecated Use {@link LoadAttachmentsForMessage}. */
26
47
  loadAttachmentsForMessage(conversationDetailId: string, contextUser?: UserInfo): Promise<MessageAttachment[]>;
27
48
  /**
28
49
  * Save pending attachments to the database.
@@ -31,12 +52,21 @@ export declare class ConversationAttachmentService {
31
52
  * @param conversationDetailId - ID of the conversation detail to attach to
32
53
  * @param pendingAttachments - Array of pending attachments from the mention editor
33
54
  * @param contextUser - User context for the operation
55
+ * @param agent - The agent this turn is addressed to, when the caller has resolved one. Only its
56
+ * `InlineStorageThresholdBytes` is read, and only to make the inline-vs-storage decision match
57
+ * what the server would decide for the same file. Omitting it falls back to the system default,
58
+ * which is correct for a turn with no agent — but a caller that HAS an agent and does not pass
59
+ * it produces the cross-surface drift this shared policy exists to remove.
34
60
  */
35
- saveAttachments(conversationDetailId: string, pendingAttachments: PendingAttachment[], contextUser?: UserInfo): Promise<MJConversationDetailAttachmentEntity[]>;
61
+ SaveAttachments(conversationDetailId: string, pendingAttachments: PendingAttachment[], contextUser?: UserInfo, agent?: MJAIAgentEntity | null): Promise<MJConversationDetailAttachmentEntity[]>;
62
+ /** @deprecated Use {@link SaveAttachments}. */
63
+ saveAttachments(conversationDetailId: string, pendingAttachments: PendingAttachment[], contextUser?: UserInfo, agent?: MJAIAgentEntity | null): Promise<MJConversationDetailAttachmentEntity[]>;
36
64
  /**
37
65
  * Create attachment reference tokens for message text.
38
66
  * These tokens are stored in the Message field to reference attachments.
39
67
  */
68
+ CreateAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string;
69
+ /** @deprecated Use {@link CreateAttachmentReferences}. */
40
70
  createAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string;
41
71
  /**
42
72
  * Convert a database entity to a MessageAttachment for display
@@ -62,10 +92,17 @@ export declare class ConversationAttachmentService {
62
92
  * Create a thumbnail from an image file.
63
93
  * Returns a base64 data URL of the thumbnail.
64
94
  */
95
+ CreateThumbnail(file: File, maxSize?: number): Promise<string | null>;
96
+ /** @deprecated Use {@link CreateThumbnail}. */
65
97
  createThumbnail(file: File, maxSize?: number): Promise<string | null>;
66
98
  /**
67
99
  * Get image dimensions from a file
68
100
  */
101
+ GetImageDimensions(file: File): Promise<{
102
+ width: number;
103
+ height: number;
104
+ } | null>;
105
+ /** @deprecated Use {@link GetImageDimensions}. */
69
106
  getImageDimensions(file: File): Promise<{
70
107
  width: number;
71
108
  height: number;
@@ -74,6 +111,8 @@ export declare class ConversationAttachmentService {
74
111
  * Process a file and create a PendingAttachment.
75
112
  * This creates the data structure needed for the mention editor component.
76
113
  */
114
+ ProcessFile(file: File): Promise<PendingAttachment>;
115
+ /** @deprecated Use {@link ProcessFile}. */
77
116
  processFile(file: File): Promise<PendingAttachment>;
78
117
  /**
79
118
  * Convert a file to a data URL
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-attachment.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,oCAAoC,EAMrC,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;;AAIhE;;;GAGG;AACH,qBAGa,6BAA6B;IACxC,OAAO,CAAC,SAAS,CAAkC;;IAInD;;OAEG;IACH,IAAW,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAElD;IAED,IAAW,QAAQ,IAAI,iBAAiB,CAEvC;IAED;;;OAGG;IACG,0BAA0B,CAC9B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IA0F5C;;OAEG;IACG,yBAAyB,CAC7B,oBAAoB,EAAE,MAAM,EAC5B,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK/B;;;;;;;OAOG;IACG,eAAe,CACnB,oBAAoB,EAAE,MAAM,EAC5B,kBAAkB,EAAE,iBAAiB,EAAE,EACvC,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,oCAAoC,EAAE,CAAC;IA8ElD;;;OAGG;IACH,0BAA0B,CAAC,WAAW,EAAE,oCAAoC,EAAE,GAAG,MAAM;IAoBvF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAiClC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAYrC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAKhC;;;OAGG;IACG,eAAe,CACnB,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,MAAY,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA+CzB;;OAEG;IACG,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAqBvF;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA+BzD;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;OAEG;IACH,OAAO,CAAC,cAAc;yCA/cX,6BAA6B;6CAA7B,6BAA6B;CAkdzC"}
1
+ {"version":3,"file":"conversation-attachment.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,oCAAoC,EAKpC,eAAe,EAEhB,MAAM,+BAA+B,CAAC;AASvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;;AAIhE;;;GAGG;AACH,qBAGa,6BAA6B;IACxC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0D;IAEpF,OAAO,CAAC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