@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,145 +1,21 @@
1
- import { MJAIAgentEntityExtended } from '@memberjunction/ai-core-plus';
2
- import { UserInfo, EntityInfo, QueryInfo, IMetadataProvider } from '@memberjunction/core';
3
- import { BaseSingleton } from '@memberjunction/global';
4
- import { MentionSuggestion } from '@memberjunction/ng-composer';
1
+ import { MentionAutocomplete } from '@memberjunction/conversations-runtime';
5
2
  /**
6
- * Shared engine behind the conversations composer plugins (the agent-mentions /
7
- * record-mentions / skill-commands `ComposerTriggerProvider`s) and the mention-parsing
8
- * consumers (message routing, saved-message badge rendering). Loads the
9
- * permission-filtered agent / user / entity / query / skill caches once per session and
10
- * serves ranked `MentionSuggestion` lists per trigger char.
3
+ * @fileoverview Angular alias for the framework-agnostic `MentionAutocomplete` engine in
4
+ * `@memberjunction/conversations-runtime`.
11
5
  *
12
- * NOT an Angular DI service — it's a `BaseSingleton` engine so the
13
- * ClassFactory-instantiated trigger providers (which live outside Angular DI) and the
14
- * Angular components share ONE instance (one cache warm-up) via
15
- * `MentionAutocompleteService.Instance`.
6
+ * The engine — permission-filtered agent / user / entity / query / skill caches, the `/` picker's
7
+ * target-agent narrowing, and the per-trigger ranking — moved into the runtime. It had never
8
+ * imported anything from `@angular/*` and carried no decorator; it was Angular-coupled only by
9
+ * which package it happened to sit in, which meant a React Native host could not reach it without
10
+ * a second implementation of the same permission rules.
11
+ *
12
+ * This alias keeps every existing `MentionAutocompleteService.Instance` call site working
13
+ * unchanged. It is a `const`, not a subclass, so there is exactly one instance and one cache
14
+ * warm-up shared with the ClassFactory-instantiated trigger providers and any non-Angular host.
15
+ *
16
+ * **For new code:** import `MentionAutocomplete` from `@memberjunction/conversations-runtime`.
16
17
  */
17
- export declare class MentionAutocompleteService extends BaseSingleton<MentionAutocompleteService> {
18
- protected constructor();
19
- /** The process-wide shared instance (Global Object Store backed). */
20
- static get Instance(): MentionAutocompleteService;
21
- private agentsCache;
22
- private usersCache;
23
- private entitiesCache;
24
- private queriesCache;
25
- /** Active skills the current user can Run — surfaced under the '/' trigger. */
26
- private skillsCache;
27
- /** The provider this instance was initialised against (multi-provider hosts); undefined = global. */
28
- private provider;
29
- /** Default icon for a skill with no IconClass of its own. */
30
- private defaultSkillIcon;
31
- /** Generic icon for all query mentions, sourced from the 'MJ: Queries' entity. */
32
- private queriesEntityIcon;
33
- private isInitialized;
34
- private initializationPromise;
35
- /** True once the caches have loaded (agents/users/entities/queries/skills). */
36
- get IsInitialized(): boolean;
37
- /**
38
- * Initialize the service by loading agents and users
39
- * Prevents concurrent initialization with promise lock
40
- */
41
- initialize(currentUser: UserInfo, provider?: IMetadataProvider): Promise<void>;
42
- /**
43
- * Internal initialization logic
44
- */
45
- private _initializeInternal;
46
- /**
47
- * Filter agents to only those the current user has 'run' permission for.
48
- * Agents with no permission records are open to everyone (canRun = true).
49
- * Agents with explicit permission records are checked against the user.
50
- */
51
- private filterAgentsByRunPermission;
52
- /**
53
- * Filter Active skills to those the current user has 'run' permission for.
54
- * Skills with no permission records are open to everyone (canRun = true);
55
- * skills with explicit records are checked against the user (open-by-default).
56
- */
57
- private filterSkillsByRunPermission;
58
- /**
59
- * Load entities the current user has read permission for.
60
- * These are the candidates surfaced for #entity mentions.
61
- */
62
- private loadReadableEntities;
63
- /**
64
- * Load queries the current user has run permission for.
65
- * These are the candidates surfaced for #query mentions.
66
- */
67
- private loadRunnableQueries;
68
- /**
69
- * Resolve the generic icon used for all query mentions from the 'MJ: Queries' entity.
70
- */
71
- private resolveQueriesEntityIcon;
72
- /**
73
- * Get suggestions based on search query
74
- * @param query The search text after the trigger character
75
- * @param includeUsers Whether to include users in suggestions
76
- * @param trigger '@' (agents + users), '#' (entities + queries) or '/' (skills)
77
- * @param targetAgentId When the host knows which agent the message will go to (the '/' trigger
78
- * only), skill suggestions are narrowed to what THAT agent accepts — `AcceptsSkills` + its
79
- * `MJ: AI Agent Skills` grants — via {@link AIEngineBase.GetSkillsForAgent}. Without it (or for an
80
- * agent not in the user's runnable set) the user's full runnable catalog is shown, as before, and
81
- * the server's `RequestedSkills` guard is the backstop.
82
- * @returns Filtered and ranked suggestions
83
- */
84
- getSuggestions(query: string, includeUsers?: boolean, trigger?: string, targetAgentId?: string | null): MentionSuggestion[];
85
- /**
86
- * Get entity + query suggestions for #mentions, ranked by query match.
87
- * Capped to keep the dropdown light (entity/query sets can be large).
88
- */
89
- private getEntityAndQuerySuggestions;
90
- /**
91
- * The skills to offer under '/': the user's runnable catalog, narrowed to the target agent's
92
- * accepted set when the agent is known. Intersection only — the agent filter never adds a skill
93
- * the user could not run. Unknown agent id (not in the user's runnable agents) → no narrowing.
94
- */
95
- private skillsForTarget;
96
- /**
97
- * Get skill suggestions for '/'-mentions, ranked by query match. Each carries the skill's own
98
- * IconClass/Color (UX metadata) so the dropdown + inserted chip render distinctly per skill.
99
- */
100
- private getSkillSuggestions;
101
- /**
102
- * Calculate match score for ranking
103
- * Higher score = better match
104
- */
105
- private calculateMatchScore;
106
- /**
107
- * Map an agent's AI Agent Configuration presets into the composer's generic
108
- * `MentionSuggestionPreset` shape so the chip's preset picker works without the
109
- * composer knowing anything about agents.
110
- *
111
- * IMPORTANT: preset.ID is the AIAgentConfiguration.ID (preset ID), not
112
- * AIConfigurationID — the backend mapping converts preset ID -> AIConfigurationID.
113
- */
114
- private getAgentPresets;
115
- /**
116
- * Get icon for agent based on type/name
117
- */
118
- private getAgentIcon;
119
- /**
120
- * Get available agents for parsing
121
- */
122
- getAvailableAgents(): MJAIAgentEntityExtended[];
123
- /**
124
- * Get available users for parsing
125
- */
126
- getAvailableUsers(): UserInfo[];
127
- /**
128
- * Get available entities for parsing
129
- */
130
- getAvailableEntities(): EntityInfo[];
131
- /**
132
- * Get available queries for parsing
133
- */
134
- getAvailableQueries(): QueryInfo[];
135
- /**
136
- * Get the generic icon used for all query mentions.
137
- */
138
- getQueriesEntityIcon(): string;
139
- /**
140
- * Refresh the caches
141
- * Resets initialization state and reloads agents
142
- */
143
- refresh(currentUser: UserInfo): Promise<void>;
144
- }
18
+ export declare const MentionAutocompleteService: typeof MentionAutocomplete;
19
+ /** The engine's type, for call sites that annotate it. */
20
+ export type MentionAutocompleteService = MentionAutocomplete;
145
21
  //# sourceMappingURL=mention-autocomplete.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mention-autocomplete.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/mention-autocomplete.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAY,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EAAE,aAAa,EAAc,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAA2B,MAAM,6BAA6B,CAAC;AAEzF;;;;;;;;;;;GAWG;AACH,qBAAa,0BAA2B,SAAQ,aAAa,CAAC,0BAA0B,CAAC;IACvF,SAAS;IAIT,qEAAqE;IACrE,WAAkB,QAAQ,IAAI,0BAA0B,CAEvD;IAED,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,YAAY,CAAmB;IACvC,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAyB;IAC5C,qGAAqG;IACrG,OAAO,CAAC,QAAQ,CAAgC;IAChD,6DAA6D;IAC7D,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,kFAAkF;IAClF,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,+EAA+E;IAC/E,IAAW,aAAa,IAAI,OAAO,CAElC;IAED;;;OAGG;IACG,UAAU,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBpF;;OAEG;YACW,mBAAmB;IAyCjC;;;;OAIG;YACW,2BAA2B;IAkBzC;;;;OAIG;YACW,2BAA2B;IAUzC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAiB5B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,GAAE,OAAc,EAAE,OAAO,GAAE,MAAY,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,GAAG,iBAAiB,EAAE;IA6D5I;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IA+CpC;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAevB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAwB3B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAmBvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;OAEG;IACH,kBAAkB,IAAI,uBAAuB,EAAE;IAI/C;;OAEG;IACH,iBAAiB,IAAI,QAAQ,EAAE;IAI/B;;OAEG;IACH,oBAAoB,IAAI,UAAU,EAAE;IAIpC;;OAEG;IACH,mBAAmB,IAAI,SAAS,EAAE;IAIlC;;OAEG;IACH,oBAAoB,IAAI,MAAM;IAI9B;;;OAGG;IACG,OAAO,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAKpD"}
1
+ {"version":3,"file":"mention-autocomplete.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/mention-autocomplete.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,4BAAsB,CAAC;AAE9D,0DAA0D;AAC1D,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC"}
@@ -1,464 +1,19 @@
1
- import { Metadata } from '@memberjunction/core';
2
- import { AIEngineBase, AIAgentPermissionHelper, AISkillPermissionHelper } from '@memberjunction/ai-engine-base';
3
- import { BaseSingleton, UUIDsEqual } from '@memberjunction/global';
4
- import { IntersectAcceptedSkills } from './skill-picker-narrowing';
1
+ import { MentionAutocomplete } from '@memberjunction/conversations-runtime';
5
2
  /**
6
- * Shared engine behind the conversations composer plugins (the agent-mentions /
7
- * record-mentions / skill-commands `ComposerTriggerProvider`s) and the mention-parsing
8
- * consumers (message routing, saved-message badge rendering). Loads the
9
- * permission-filtered agent / user / entity / query / skill caches once per session and
10
- * serves ranked `MentionSuggestion` lists per trigger char.
3
+ * @fileoverview Angular alias for the framework-agnostic `MentionAutocomplete` engine in
4
+ * `@memberjunction/conversations-runtime`.
11
5
  *
12
- * NOT an Angular DI service — it's a `BaseSingleton` engine so the
13
- * ClassFactory-instantiated trigger providers (which live outside Angular DI) and the
14
- * Angular components share ONE instance (one cache warm-up) via
15
- * `MentionAutocompleteService.Instance`.
6
+ * The engine — permission-filtered agent / user / entity / query / skill caches, the `/` picker's
7
+ * target-agent narrowing, and the per-trigger ranking — moved into the runtime. It had never
8
+ * imported anything from `@angular/*` and carried no decorator; it was Angular-coupled only by
9
+ * which package it happened to sit in, which meant a React Native host could not reach it without
10
+ * a second implementation of the same permission rules.
11
+ *
12
+ * This alias keeps every existing `MentionAutocompleteService.Instance` call site working
13
+ * unchanged. It is a `const`, not a subclass, so there is exactly one instance and one cache
14
+ * warm-up shared with the ClassFactory-instantiated trigger providers and any non-Angular host.
15
+ *
16
+ * **For new code:** import `MentionAutocomplete` from `@memberjunction/conversations-runtime`.
16
17
  */
17
- export class MentionAutocompleteService extends BaseSingleton {
18
- constructor() {
19
- super();
20
- }
21
- /** The process-wide shared instance (Global Object Store backed). */
22
- static get Instance() {
23
- return super.getInstance();
24
- }
25
- agentsCache = [];
26
- usersCache = [];
27
- entitiesCache = [];
28
- queriesCache = [];
29
- /** Active skills the current user can Run — surfaced under the '/' trigger. */
30
- skillsCache = [];
31
- /** The provider this instance was initialised against (multi-provider hosts); undefined = global. */
32
- provider;
33
- /** Default icon for a skill with no IconClass of its own. */
34
- defaultSkillIcon = 'fa-solid fa-wand-magic-sparkles';
35
- /** Generic icon for all query mentions, sourced from the 'MJ: Queries' entity. */
36
- queriesEntityIcon = 'fa-solid fa-database';
37
- isInitialized = false;
38
- initializationPromise = null;
39
- /** True once the caches have loaded (agents/users/entities/queries/skills). */
40
- get IsInitialized() {
41
- return this.isInitialized;
42
- }
43
- /**
44
- * Initialize the service by loading agents and users
45
- * Prevents concurrent initialization with promise lock
46
- */
47
- async initialize(currentUser, provider) {
48
- // If already initialized, return immediately
49
- if (this.isInitialized) {
50
- return;
51
- }
52
- // If initialization is in progress, wait for it
53
- if (this.initializationPromise) {
54
- return this.initializationPromise;
55
- }
56
- // Create initialization promise and store it
57
- this.initializationPromise = this._initializeInternal(currentUser, provider);
58
- try {
59
- await this.initializationPromise;
60
- }
61
- finally {
62
- this.initializationPromise = null;
63
- }
64
- }
65
- /**
66
- * Internal initialization logic
67
- */
68
- async _initializeInternal(currentUser, provider) {
69
- try {
70
- // Load agents from AIEngineBase
71
- await AIEngineBase.Instance.Config(false);
72
- const allAgents = AIEngineBase.Instance.Agents || [];
73
- // Filter by status, hierarchy, and invocation mode first
74
- const candidateAgents = allAgents.filter(a => !a.ParentID && a.Status === 'Active' && a.InvocationMode !== 'Sub-Agent' && !a.IsRestricted);
75
- // Filter by user's 'run' permission — respects open-by-default + explicit permissions
76
- this.agentsCache = await this.filterAgentsByRunPermission(candidateAgents, currentUser);
77
- // Load users from the system (optional - can be expanded later)
78
- // For now, we'll just use the current user
79
- this.usersCache = [currentUser];
80
- // Load entities the current user can read (candidates for #entity mentions)
81
- this.entitiesCache = this.loadReadableEntities(currentUser, provider);
82
- // Load queries the current user can run (also surfaced under the '#' trigger)
83
- this.queriesCache = this.loadRunnableQueries(currentUser, provider);
84
- this.queriesEntityIcon = this.resolveQueriesEntityIcon(provider);
85
- // Load Active skills the current user can Run (surfaced under the '/' trigger). Mirrors the
86
- // agent filter: open-by-default unless a skill has explicit permission rows. This is the user's
87
- // full run-permitted set; when the host names the target agent (getSuggestions' targetAgentId)
88
- // the picker narrows it to what that agent accepts, and the server's RequestedSkills guard is
89
- // the backstop either way.
90
- this.skillsCache = await this.filterSkillsByRunPermission(currentUser);
91
- this.provider = provider;
92
- this.isInitialized = true;
93
- }
94
- catch (error) {
95
- console.error('Failed to initialize MentionAutocompleteService:', error);
96
- throw error;
97
- }
98
- }
99
- /**
100
- * Filter agents to only those the current user has 'run' permission for.
101
- * Agents with no permission records are open to everyone (canRun = true).
102
- * Agents with explicit permission records are checked against the user.
103
- */
104
- async filterAgentsByRunPermission(agents, user) {
105
- const permitted = [];
106
- for (const agent of agents) {
107
- try {
108
- const canRun = await AIAgentPermissionHelper.HasPermission(agent.ID, user, 'run');
109
- if (canRun) {
110
- permitted.push(agent);
111
- }
112
- }
113
- catch {
114
- // Fail closed — exclude agent on error
115
- }
116
- }
117
- return permitted;
118
- }
119
- /**
120
- * Filter Active skills to those the current user has 'run' permission for.
121
- * Skills with no permission records are open to everyone (canRun = true);
122
- * skills with explicit records are checked against the user (open-by-default).
123
- */
124
- async filterSkillsByRunPermission(user) {
125
- try {
126
- const runnable = await AISkillPermissionHelper.GetAccessibleSkills(user, 'run');
127
- return runnable.filter(s => s.Status === 'Active');
128
- }
129
- catch {
130
- // Fail closed — no skills on error.
131
- return [];
132
- }
133
- }
134
- /**
135
- * Load entities the current user has read permission for.
136
- * These are the candidates surfaced for #entity mentions.
137
- */
138
- loadReadableEntities(user, provider) {
139
- try {
140
- const md = provider ?? Metadata.Provider;
141
- return (md.Entities || []).filter(entity => {
142
- try {
143
- return entity.GetUserPermisions(user).CanRead;
144
- }
145
- catch {
146
- // Fail closed — exclude entity on permission-check error
147
- return false;
148
- }
149
- });
150
- }
151
- catch (error) {
152
- console.error('Failed to load entities for mention autocomplete:', error);
153
- return [];
154
- }
155
- }
156
- /**
157
- * Load queries the current user has run permission for.
158
- * These are the candidates surfaced for #query mentions.
159
- */
160
- loadRunnableQueries(user, provider) {
161
- try {
162
- const md = provider ?? Metadata.Provider;
163
- return (md.Queries || []).filter(query => {
164
- try {
165
- return query.UserCanRun(user);
166
- }
167
- catch {
168
- // Fail closed — exclude query on permission-check error
169
- return false;
170
- }
171
- });
172
- }
173
- catch (error) {
174
- console.error('Failed to load queries for mention autocomplete:', error);
175
- return [];
176
- }
177
- }
178
- /**
179
- * Resolve the generic icon used for all query mentions from the 'MJ: Queries' entity.
180
- */
181
- resolveQueriesEntityIcon(provider) {
182
- try {
183
- const md = provider ?? Metadata.Provider;
184
- return md.EntityByName('MJ: Queries')?.Icon || 'fa-solid fa-database';
185
- }
186
- catch {
187
- return 'fa-solid fa-database';
188
- }
189
- }
190
- /**
191
- * Get suggestions based on search query
192
- * @param query The search text after the trigger character
193
- * @param includeUsers Whether to include users in suggestions
194
- * @param trigger '@' (agents + users), '#' (entities + queries) or '/' (skills)
195
- * @param targetAgentId When the host knows which agent the message will go to (the '/' trigger
196
- * only), skill suggestions are narrowed to what THAT agent accepts — `AcceptsSkills` + its
197
- * `MJ: AI Agent Skills` grants — via {@link AIEngineBase.GetSkillsForAgent}. Without it (or for an
198
- * agent not in the user's runnable set) the user's full runnable catalog is shown, as before, and
199
- * the server's `RequestedSkills` guard is the backstop.
200
- * @returns Filtered and ranked suggestions
201
- */
202
- getSuggestions(query, includeUsers = true, trigger = '@', targetAgentId = null) {
203
- // The '#' trigger searches entities + queries; '/' searches skills; '@' searches agents + users
204
- if (trigger === '#') {
205
- return this.getEntityAndQuerySuggestions(query);
206
- }
207
- if (trigger === '/') {
208
- return this.getSkillSuggestions(query, targetAgentId);
209
- }
210
- const lowerQuery = query.toLowerCase().trim();
211
- const suggestions = [];
212
- // Add agent suggestions
213
- for (const agent of this.agentsCache) {
214
- const score = this.calculateMatchScore(agent.Name || '', lowerQuery);
215
- if (score > 0 || !lowerQuery) {
216
- suggestions.push({
217
- type: 'agent',
218
- id: agent.ID,
219
- name: agent.Name || 'Unknown',
220
- displayName: agent.Name || 'Unknown',
221
- description: agent.Description || undefined,
222
- imageUrl: agent.LogoURL || undefined, // Agent logo/avatar image
223
- icon: this.getAgentIcon(agent),
224
- // Configuration presets ride on the suggestion — the (AI-blind) composer
225
- // renders a preset picker on the inserted chip when there are 2+.
226
- presets: this.getAgentPresets(agent.ID)
227
- });
228
- }
229
- }
230
- // Add user suggestions (if enabled)
231
- if (includeUsers) {
232
- for (const user of this.usersCache) {
233
- const score = this.calculateMatchScore(user.Name, lowerQuery);
234
- if (score > 0 || !lowerQuery) {
235
- suggestions.push({
236
- type: 'user',
237
- id: user.ID,
238
- name: user.Name,
239
- displayName: user.Name,
240
- description: user.Email || undefined
241
- });
242
- }
243
- }
244
- }
245
- // Sort by relevance: exact match > starts with > contains
246
- return suggestions.sort((a, b) => {
247
- const scoreA = this.calculateMatchScore(a.name, lowerQuery);
248
- const scoreB = this.calculateMatchScore(b.name, lowerQuery);
249
- if (scoreB !== scoreA)
250
- return scoreB - scoreA;
251
- // If scores are equal, sort agents before users
252
- if (a.type !== b.type)
253
- return a.type === 'agent' ? -1 : 1;
254
- // Otherwise alphabetically
255
- return a.name.localeCompare(b.name);
256
- });
257
- }
258
- /**
259
- * Get entity + query suggestions for #mentions, ranked by query match.
260
- * Capped to keep the dropdown light (entity/query sets can be large).
261
- */
262
- getEntityAndQuerySuggestions(query) {
263
- const lowerQuery = query.toLowerCase().trim();
264
- const MAX_SUGGESTIONS = 50;
265
- const entityItems = this.entitiesCache.map(entity => ({
266
- label: entity.DisplayNameOrName,
267
- score: Math.max(this.calculateMatchScore(entity.Name || '', lowerQuery), this.calculateMatchScore(entity.DisplayName || '', lowerQuery)),
268
- suggestion: {
269
- type: 'entity',
270
- id: entity.ID,
271
- name: entity.Name,
272
- displayName: entity.DisplayNameOrName,
273
- description: entity.Description || undefined,
274
- icon: entity.Icon || 'fa-solid fa-table'
275
- }
276
- }));
277
- const queryItems = this.queriesCache.map(q => ({
278
- label: q.Name || '',
279
- score: this.calculateMatchScore(q.Name || '', lowerQuery),
280
- suggestion: {
281
- type: 'query',
282
- id: q.ID,
283
- name: q.Name || '',
284
- displayName: q.Name || '',
285
- description: q.Description || undefined,
286
- icon: this.queriesEntityIcon
287
- }
288
- }));
289
- return [...entityItems, ...queryItems]
290
- .filter(x => x.score > 0 || !lowerQuery)
291
- .sort((a, b) => {
292
- if (b.score !== a.score)
293
- return b.score - a.score;
294
- // When scores tie, prioritize entities over queries
295
- if (a.suggestion.type !== b.suggestion.type) {
296
- return a.suggestion.type === 'entity' ? -1 : 1;
297
- }
298
- return a.label.localeCompare(b.label);
299
- })
300
- .slice(0, MAX_SUGGESTIONS)
301
- .map(x => x.suggestion);
302
- }
303
- /**
304
- * The skills to offer under '/': the user's runnable catalog, narrowed to the target agent's
305
- * accepted set when the agent is known. Intersection only — the agent filter never adds a skill
306
- * the user could not run. Unknown agent id (not in the user's runnable agents) → no narrowing.
307
- */
308
- skillsForTarget(targetAgentId) {
309
- if (!targetAgentId) {
310
- return this.skillsCache;
311
- }
312
- const agent = this.agentsCache.find(a => UUIDsEqual(a.ID, targetAgentId));
313
- if (!agent) {
314
- return this.skillsCache;
315
- }
316
- const engine = this.provider
317
- ? AIEngineBase.GetProviderInstance(this.provider, AIEngineBase)
318
- : AIEngineBase.Instance;
319
- return IntersectAcceptedSkills(this.skillsCache, engine.GetSkillsForAgent(agent));
320
- }
321
- /**
322
- * Get skill suggestions for '/'-mentions, ranked by query match. Each carries the skill's own
323
- * IconClass/Color (UX metadata) so the dropdown + inserted chip render distinctly per skill.
324
- */
325
- getSkillSuggestions(query, targetAgentId = null) {
326
- const lowerQuery = query.toLowerCase().trim();
327
- const MAX_SUGGESTIONS = 12;
328
- return this.skillsForTarget(targetAgentId)
329
- .map(skill => ({
330
- score: this.calculateMatchScore(skill.Name || '', lowerQuery),
331
- suggestion: {
332
- type: 'skill',
333
- id: skill.ID,
334
- name: skill.Name || 'Unknown Skill',
335
- displayName: skill.Name || 'Unknown Skill',
336
- description: skill.Description || undefined,
337
- icon: skill.IconClass || this.defaultSkillIcon,
338
- color: skill.Color || undefined
339
- }
340
- }))
341
- .filter(x => x.score > 0 || !lowerQuery)
342
- .sort((a, b) => {
343
- if (b.score !== a.score)
344
- return b.score - a.score;
345
- return a.suggestion.name.localeCompare(b.suggestion.name);
346
- })
347
- .slice(0, MAX_SUGGESTIONS)
348
- .map(x => x.suggestion);
349
- }
350
- /**
351
- * Calculate match score for ranking
352
- * Higher score = better match
353
- */
354
- calculateMatchScore(name, query) {
355
- if (!query)
356
- return 1; // Show all if no query
357
- const lowerName = name.toLowerCase();
358
- const lowerQuery = query.toLowerCase();
359
- // Exact match
360
- if (lowerName === lowerQuery)
361
- return 100;
362
- // Starts with
363
- if (lowerName.startsWith(lowerQuery))
364
- return 50;
365
- // Contains
366
- if (lowerName.includes(lowerQuery))
367
- return 25;
368
- // Word boundary match (e.g., "MA" matches "Marketing Agent")
369
- const words = lowerName.split(/\s+/);
370
- for (const word of words) {
371
- if (word.startsWith(lowerQuery))
372
- return 40;
373
- }
374
- return 0; // No match
375
- }
376
- /**
377
- * Map an agent's AI Agent Configuration presets into the composer's generic
378
- * `MentionSuggestionPreset` shape so the chip's preset picker works without the
379
- * composer knowing anything about agents.
380
- *
381
- * IMPORTANT: preset.ID is the AIAgentConfiguration.ID (preset ID), not
382
- * AIConfigurationID — the backend mapping converts preset ID -> AIConfigurationID.
383
- */
384
- getAgentPresets(agentId) {
385
- try {
386
- const presets = AIEngineBase.Instance.GetAgentConfigurationPresets(agentId, true);
387
- if (!presets || presets.length === 0) {
388
- return undefined;
389
- }
390
- return presets.map(p => ({
391
- ID: p.ID,
392
- Name: p.Name,
393
- DisplayName: p.DisplayName || undefined,
394
- Description: p.Description || undefined,
395
- IsDefault: p.IsDefault
396
- }));
397
- }
398
- catch {
399
- // Presets are a chip nicety — never let them break suggestion building
400
- return undefined;
401
- }
402
- }
403
- /**
404
- * Get icon for agent based on type/name
405
- */
406
- getAgentIcon(agent) {
407
- // Use agent's icon if available, otherwise default based on type
408
- if (agent.IconClass)
409
- return agent.IconClass;
410
- // Default icons based on agent name patterns
411
- const name = agent.Name?.toLowerCase() || '';
412
- if (name.includes('marketing'))
413
- return 'fa-megaphone';
414
- if (name.includes('data') || name.includes('analysis'))
415
- return 'fa-chart-line';
416
- if (name.includes('code') || name.includes('developer'))
417
- return 'fa-code';
418
- if (name.includes('design'))
419
- return 'fa-palette';
420
- if (name.includes('conversation') || name.includes('manager'))
421
- return 'fa-comments';
422
- return 'fa-robot'; // Default
423
- }
424
- /**
425
- * Get available agents for parsing
426
- */
427
- getAvailableAgents() {
428
- return this.agentsCache;
429
- }
430
- /**
431
- * Get available users for parsing
432
- */
433
- getAvailableUsers() {
434
- return this.usersCache;
435
- }
436
- /**
437
- * Get available entities for parsing
438
- */
439
- getAvailableEntities() {
440
- return this.entitiesCache;
441
- }
442
- /**
443
- * Get available queries for parsing
444
- */
445
- getAvailableQueries() {
446
- return this.queriesCache;
447
- }
448
- /**
449
- * Get the generic icon used for all query mentions.
450
- */
451
- getQueriesEntityIcon() {
452
- return this.queriesEntityIcon;
453
- }
454
- /**
455
- * Refresh the caches
456
- * Resets initialization state and reloads agents
457
- */
458
- async refresh(currentUser) {
459
- this.isInitialized = false;
460
- this.initializationPromise = null;
461
- await this.initialize(currentUser);
462
- }
463
- }
18
+ export const MentionAutocompleteService = MentionAutocomplete;
464
19
  //# sourceMappingURL=mention-autocomplete.service.js.map