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

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 (351) hide show
  1. package/README.md +43 -2
  2. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
  3. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
  4. package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
  5. package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
  6. package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
  7. package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
  8. package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
  9. package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
  10. package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
  11. package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
  12. package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
  13. package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
  14. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
  15. package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
  16. package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
  17. package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
  18. package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
  19. package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
  20. package/dist/lib/components/attachment/image-viewer.component.js +181 -47
  21. package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
  22. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
  23. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
  24. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
  25. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
  26. package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
  27. package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
  28. package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
  29. package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
  30. package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
  31. package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
  32. package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
  33. package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
  34. package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
  35. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  36. package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
  37. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  38. package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
  39. package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
  40. package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
  41. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
  42. package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
  43. package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
  44. package/dist/lib/components/collection/collection-tree.component.js +220 -70
  45. package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
  46. package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
  47. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  48. package/dist/lib/components/collection/collection-view.component.js +154 -40
  49. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  50. package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
  51. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  52. package/dist/lib/components/collection/collections-full-view.component.js +951 -367
  53. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  54. package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
  55. package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
  56. package/dist/lib/components/composer/ai-composer.component.js +388 -44
  57. package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
  58. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
  59. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
  60. package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
  61. package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
  62. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1191 -124
  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 +2816 -785
  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 +42 -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 +93 -21
  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 +49 -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 +140 -26
  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 +613 -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 +1390 -422
  113. package/dist/lib/components/message/message-input.component.js.map +1 -1
  114. package/dist/lib/components/message/message-item.component.d.ts +490 -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 +1088 -244
  117. package/dist/lib/components/message/message-item.component.js.map +1 -1
  118. package/dist/lib/components/message/message-list.component.d.ts +297 -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 +598 -123
  121. package/dist/lib/components/message/message-list.component.js.map +1 -1
  122. package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
  123. package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
  124. package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
  125. package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
  126. package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
  127. package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
  128. package/dist/lib/components/notification/activity-indicator.component.js +13 -3
  129. package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
  130. package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
  131. package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
  132. package/dist/lib/components/notification/notification-badge.component.js +36 -8
  133. package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
  134. package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
  135. package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
  136. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  137. package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
  138. package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
  139. package/dist/lib/components/project/project-form-modal.component.js +348 -87
  140. package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
  141. package/dist/lib/components/project/project-selector.component.d.ts +78 -8
  142. package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
  143. package/dist/lib/components/project/project-selector.component.js +177 -46
  144. package/dist/lib/components/project/project-selector.component.js.map +1 -1
  145. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +1 -1
  146. package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
  147. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  148. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +1 -1
  149. package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
  150. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  151. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +2 -2
  152. package/dist/lib/components/realtime/realtime-session-overlay.component.js +18 -18
  153. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  154. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -23
  155. package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
  156. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +136 -92
  157. package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
  158. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +2 -2
  159. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
  160. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  161. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +1 -1
  162. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
  163. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  164. package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
  165. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  166. package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
  167. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  168. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +3 -1
  169. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  170. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +6 -2
  171. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  172. package/dist/lib/components/search/search-panel.component.d.ts +133 -22
  173. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  174. package/dist/lib/components/search/search-panel.component.js +312 -83
  175. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  176. package/dist/lib/components/share/share-modal.component.d.ts +69 -9
  177. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  178. package/dist/lib/components/share/share-modal.component.js +139 -31
  179. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  180. package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
  181. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
  182. package/dist/lib/components/shared/user-picker.component.js +110 -30
  183. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  184. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
  185. package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
  186. package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
  187. package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
  188. package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
  189. package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
  190. package/dist/lib/components/sidebar/routines-section.component.js +25 -5
  191. package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
  192. package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
  193. package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
  194. package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
  195. package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
  196. package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
  197. package/dist/lib/components/task/tasks-full-view.component.js +223 -75
  198. package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
  199. package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
  200. package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
  201. package/dist/lib/components/tasks/task-widget.component.js +100 -16
  202. package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
  203. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
  204. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
  205. package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
  206. package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
  207. package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
  208. package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
  209. package/dist/lib/components/thread/thread-panel.component.js +146 -36
  210. package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
  211. package/dist/lib/components/toast/toast.component.d.ts +11 -1
  212. package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
  213. package/dist/lib/components/toast/toast.component.js +25 -5
  214. package/dist/lib/components/toast/toast.component.js.map +1 -1
  215. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
  216. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  217. package/dist/lib/components/workspace/conversation-workspace.component.js +891 -292
  218. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  219. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
  220. package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
  221. package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
  222. package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
  223. package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
  224. package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
  225. package/dist/lib/directives/chat-slot.directive.js.map +1 -1
  226. package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
  227. package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
  228. package/dist/lib/directives/search-shortcut.directive.js +14 -4
  229. package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
  230. package/dist/lib/events/chat-events.d.ts +34 -7
  231. package/dist/lib/events/chat-events.d.ts.map +1 -1
  232. package/dist/lib/events/chat-events.js +37 -7
  233. package/dist/lib/events/chat-events.js.map +1 -1
  234. package/dist/lib/models/agent-turn.model.d.ts +113 -0
  235. package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
  236. package/dist/lib/models/agent-turn.model.js +12 -0
  237. package/dist/lib/models/agent-turn.model.js.map +1 -0
  238. package/dist/lib/models/collection-view.model.js.map +1 -1
  239. package/dist/lib/models/conversation-state.model.d.ts +8 -0
  240. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  241. package/dist/lib/models/conversation-state.model.js.map +1 -1
  242. package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
  243. package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
  244. package/dist/lib/models/lazy-artifact-info.js +98 -34
  245. package/dist/lib/models/lazy-artifact-info.js.map +1 -1
  246. package/dist/lib/services/active-tasks.service.d.ts +30 -4
  247. package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
  248. package/dist/lib/services/active-tasks.service.js +71 -19
  249. package/dist/lib/services/active-tasks.service.js.map +1 -1
  250. package/dist/lib/services/agent-state.service.d.ts +17 -1
  251. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  252. package/dist/lib/services/agent-state.service.js +48 -16
  253. package/dist/lib/services/agent-state.service.js.map +1 -1
  254. package/dist/lib/services/artifact-permission.service.d.ts +39 -0
  255. package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
  256. package/dist/lib/services/artifact-permission.service.js +152 -17
  257. package/dist/lib/services/artifact-permission.service.js.map +1 -1
  258. package/dist/lib/services/artifact-state.service.d.ts +58 -5
  259. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  260. package/dist/lib/services/artifact-state.service.js +135 -35
  261. package/dist/lib/services/artifact-state.service.js.map +1 -1
  262. package/dist/lib/services/collection-permission.service.d.ts +28 -0
  263. package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
  264. package/dist/lib/services/collection-permission.service.js +88 -32
  265. package/dist/lib/services/collection-permission.service.js.map +1 -1
  266. package/dist/lib/services/collection-state.service.d.ts +11 -1
  267. package/dist/lib/services/collection-state.service.d.ts.map +1 -1
  268. package/dist/lib/services/collection-state.service.js +25 -5
  269. package/dist/lib/services/collection-state.service.js.map +1 -1
  270. package/dist/lib/services/conversation-agent.service.d.ts +47 -4
  271. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  272. package/dist/lib/services/conversation-agent.service.js +85 -20
  273. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  274. package/dist/lib/services/conversation-attachment.service.d.ts +17 -0
  275. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  276. package/dist/lib/services/conversation-attachment.service.js +38 -10
  277. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  278. package/dist/lib/services/conversation-liveness-dom.service.d.ts +42 -0
  279. package/dist/lib/services/conversation-liveness-dom.service.d.ts.map +1 -0
  280. package/dist/lib/services/conversation-liveness-dom.service.js +74 -0
  281. package/dist/lib/services/conversation-liveness-dom.service.js.map +1 -0
  282. package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
  283. package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
  284. package/dist/lib/services/conversation-streaming.service.js +50 -10
  285. package/dist/lib/services/conversation-streaming.service.js.map +1 -1
  286. package/dist/lib/services/data-cache.service.d.ts +31 -0
  287. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  288. package/dist/lib/services/data-cache.service.js +71 -15
  289. package/dist/lib/services/data-cache.service.js.map +1 -1
  290. package/dist/lib/services/dialog.service.d.ts +13 -0
  291. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  292. package/dist/lib/services/dialog.service.js +25 -5
  293. package/dist/lib/services/dialog.service.js.map +1 -1
  294. package/dist/lib/services/export.service.d.ts +2 -0
  295. package/dist/lib/services/export.service.d.ts.map +1 -1
  296. package/dist/lib/services/export.service.js +5 -1
  297. package/dist/lib/services/export.service.js.map +1 -1
  298. package/dist/lib/services/mention-parser.service.d.ts +10 -0
  299. package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
  300. package/dist/lib/services/mention-parser.service.js +25 -5
  301. package/dist/lib/services/mention-parser.service.js.map +1 -1
  302. package/dist/lib/services/notification.service.d.ts +54 -6
  303. package/dist/lib/services/notification.service.d.ts.map +1 -1
  304. package/dist/lib/services/notification.service.js +123 -27
  305. package/dist/lib/services/notification.service.js.map +1 -1
  306. package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
  307. package/dist/lib/services/realtime-audio-recorder.js +12 -12
  308. package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
  309. package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
  310. package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
  311. package/dist/lib/services/realtime-pcm-wav.js +10 -2
  312. package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
  313. package/dist/lib/services/search.service.d.ts +42 -9
  314. package/dist/lib/services/search.service.d.ts.map +1 -1
  315. package/dist/lib/services/search.service.js +103 -23
  316. package/dist/lib/services/search.service.js.map +1 -1
  317. package/dist/lib/services/toast.service.d.ts +19 -1
  318. package/dist/lib/services/toast.service.d.ts.map +1 -1
  319. package/dist/lib/services/toast.service.js +45 -9
  320. package/dist/lib/services/toast.service.js.map +1 -1
  321. package/dist/lib/services/ui-command-handler.service.d.ts +56 -5
  322. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  323. package/dist/lib/services/ui-command-handler.service.js +113 -16
  324. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  325. package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
  326. package/dist/lib/utils/agent-artifact-summary.js +3 -3
  327. package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
  328. package/dist/lib/utils/agent-turn-routing.d.ts +70 -0
  329. package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
  330. package/dist/lib/utils/agent-turn-routing.js +84 -0
  331. package/dist/lib/utils/agent-turn-routing.js.map +1 -0
  332. package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
  333. package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
  334. package/dist/lib/utils/artifact-panel-action.js +10 -2
  335. package/dist/lib/utils/artifact-panel-action.js.map +1 -1
  336. package/dist/lib/utils/decision-routing.d.ts +68 -0
  337. package/dist/lib/utils/decision-routing.d.ts.map +1 -0
  338. package/dist/lib/utils/decision-routing.js +101 -0
  339. package/dist/lib/utils/decision-routing.js.map +1 -0
  340. package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
  341. package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
  342. package/dist/lib/utils/distinct-artifacts.js +5 -1
  343. package/dist/lib/utils/distinct-artifacts.js.map +1 -1
  344. package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
  345. package/dist/lib/utils/plan-mode-preference.js +6 -6
  346. package/dist/lib/utils/plan-mode-preference.js.map +1 -1
  347. package/dist/public-api.d.ts +5 -0
  348. package/dist/public-api.d.ts.map +1 -1
  349. package/dist/public-api.js +8 -0
  350. package/dist/public-api.js.map +1 -1
  351. package/package.json +32 -32
@@ -1 +1 @@
1
- {"version":3,"file":"ai-composer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/composer/ai-composer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AASlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;;;;AAErF;;;;;;;;;;;;;;;;GAgBG;AAwCH,MAAM,OAAO,mBAAmB;IACP,QAAQ,CAA4B;IAE3D,oFAAoF;IAC5E,oBAAoB,GAAY,IAAI,CAAC;IACrC,qBAAqB,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCT;aACF;;kBAEE,SAAS;mBAAC,UAAU;;kBAoBpB,KAAK;;kBAaL,KAAK;;kBAYL,KAAK;;kBAYL,KAAK;;kBAyBL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBAEN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAQN,MAAM;;kBACN,MAAM;;kFA1HI,mBAAmB","sourcesContent":["import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { MentionSuggestion,\n ComposerTriggerProvider,\n MentionEditorComponent,\n MessageInputBoxComponent,\n PendingAttachment,\n BeforeSkillsOpenedEventArgs\n} from '@memberjunction/ng-composer';\nimport { AgentMentionProvider } from '../../composer-plugins/agent-mention.provider';\nimport { RecordMentionProvider } from '../../composer-plugins/record-mention.provider';\nimport { SkillCommandProvider } from '../../composer-plugins/skill-command.provider';\n\n/**\n * AI-aware composer: wraps the generic `<mj-message-input-box>` (from\n * `@memberjunction/ng-composer`, which ships zero AI knowledge) and builds the AI\n * trigger plugins in — '@' agent/user mentions, '#' entity/query record mentions, and\n * '/' skill commands — while proxying the input box's full surface (inputs, outputs,\n * and public methods).\n *\n * The familiar granular flags live HERE now:\n * - `EnableAgentMentions` (default true) — the '@' trigger\n * - `EnableEntityMentions` (default true) — the '#' trigger\n * - `EnableSkillCommands` (default true) — the '/' trigger\n * plus the pass-through `enableMentions` master switch.\n *\n * The wrapper always runs the inner editor in EXPLICIT provider-list mode (it owns the\n * list; it deliberately does not proxy `TriggerProviders` / `ExcludedTriggerKeys` — use\n * the raw `<mj-message-input-box>` when you need custom providers or discovery mode).\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-composer',\n template: `\n <mj-message-input-box\n #inputBox\n [Placeholder]=\"placeholder\"\n [Disabled]=\"disabled\"\n [Value]=\"value\"\n [ShowCharacterCount]=\"showCharacterCount\"\n [EnableMentions]=\"enableMentions\"\n [TriggerProviders]=\"ActiveTriggerProviders\"\n [Provider]=\"Provider\"\n [CurrentUser]=\"currentUser\"\n [Rows]=\"rows\"\n [EnableAttachments]=\"enableAttachments\"\n [MaxAttachments]=\"maxAttachments\"\n [MaxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [AcceptedFileTypes]=\"acceptedFileTypes\"\n [EnableRealtime]=\"enableRealtime\"\n [VoiceActive]=\"voiceActive\"\n [CanStartRealtime]=\"canStartRealtime\"\n [EnablePlanMode]=\"enablePlanMode\"\n [EnableSkills]=\"EnableSkillCommands\"\n [PlanModeActive]=\"planModeActive\"\n (TextSubmitted)=\"textSubmitted.emit($event)\"\n (Blurred)=\"blurred.emit()\"\n (ValueChange)=\"onInnerValueChange($event)\"\n (AttachmentsChanged)=\"attachmentsChanged.emit($event)\"\n (AttachmentError)=\"attachmentError.emit($event)\"\n (AttachmentClicked)=\"attachmentClicked.emit($event)\"\n (VoiceRequested)=\"voiceRequested.emit()\"\n (VoiceOptionsRequested)=\"voiceOptionsRequested.emit()\"\n (PlanModeToggle)=\"planModeToggle.emit()\"\n (BeforeSkillsOpened)=\"beforeSkillsOpened.emit($event)\"\n (AfterSkillsOpened)=\"afterSkillsOpened.emit()\">\n </mj-message-input-box>\n `\n})\nexport class AiComposerComponent {\n @ViewChild('inputBox') inputBox?: MessageInputBoxComponent;\n\n // ── AI convenience flags (the wrapper's reason to exist) ─────────────────────────\n private _enableAgentMentions: boolean = true;\n private _enableEntityMentions: boolean = true;\n private _enableSkillCommands: boolean = true;\n private _activeTriggerProviders: ComposerTriggerProvider[] = [];\n\n // One instance per plugin per composer — all instances share the singleton\n // MentionAutocompleteService engine, so there is no duplicate cache warm-up.\n private readonly agentMentionProvider = new AgentMentionProvider();\n private readonly recordMentionProvider = new RecordMentionProvider();\n private readonly skillCommandProvider = new SkillCommandProvider();\n\n /**\n * The agent the message is expected to go to, when the host knows it (`mj-message-input` binds an\n * explicit `@agent` chip in the draft, else its resolved continuity/pinned/default agent). Narrows\n * the '/' skill picker to the skills that agent accepts (`AcceptsSkills` + `MJ: AI Agent Skills`\n * grants). Null = unknown, no narrowing — the server's RequestedSkills guard is the backstop.\n */\n @Input()\n set TargetAgentId(value: string | null) {\n this.skillCommandProvider.TargetAgentId = value ?? null;\n }\n get TargetAgentId(): string | null {\n return this.skillCommandProvider.TargetAgentId;\n }\n\n constructor() {\n this.rebuildTriggerProviders();\n }\n\n /** Enables the '@' trigger (agent + user mentions). */\n @Input()\n set EnableAgentMentions(value: boolean) {\n if (value !== this._enableAgentMentions) {\n this._enableAgentMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableAgentMentions(): boolean {\n return this._enableAgentMentions;\n }\n\n /** Enables the '#' trigger (entity + query record mentions). */\n @Input()\n set EnableEntityMentions(value: boolean) {\n if (value !== this._enableEntityMentions) {\n this._enableEntityMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableEntityMentions(): boolean {\n return this._enableEntityMentions;\n }\n\n /** Enables the '/' trigger (skill commands). */\n @Input()\n set EnableSkillCommands(value: boolean) {\n if (value !== this._enableSkillCommands) {\n this._enableSkillCommands = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableSkillCommands(): boolean {\n return this._enableSkillCommands;\n }\n\n /** The explicit provider list bound to the inner editor (stable reference; rebuilt only when a flag flips). */\n public get ActiveTriggerProviders(): ComposerTriggerProvider[] {\n return this._activeTriggerProviders;\n }\n\n private rebuildTriggerProviders(): void {\n const providers: ComposerTriggerProvider[] = [];\n if (this._enableAgentMentions) providers.push(this.agentMentionProvider);\n if (this._enableEntityMentions) providers.push(this.recordMentionProvider);\n if (this._enableSkillCommands) providers.push(this.skillCommandProvider);\n this._activeTriggerProviders = providers;\n }\n\n // ── Proxied inputs (identical names/defaults to MessageInputBoxComponent) ────────\n @Input() placeholder: string = 'Type your message to start a new conversation...';\n @Input() disabled: boolean = false;\n @Input() value: string = '';\n @Input() showCharacterCount: boolean = false;\n /** Master switch for all mention/command triggers (pass-through). */\n @Input() enableMentions: boolean = true;\n /** Optional metadata provider scoping this composer (pass-through to the trigger plugins). */\n @Input() Provider: IMetadataProvider | null = null;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n @Input() enableRealtime: boolean = false;\n @Input() voiceActive: boolean = false;\n @Input() canStartRealtime: boolean = true;\n @Input() enablePlanMode: boolean = false;\n @Input() planModeActive: boolean = false;\n\n // ── Proxied outputs ───────────────────────────────────────────────────────────────\n @Output() textSubmitted = new EventEmitter<string>();\n /** Composer lost focus — hosts persist drafts on this. */\n @Output() blurred = new EventEmitter<void>();\n @Output() valueChange = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n @Output() voiceRequested = new EventEmitter<void>();\n @Output() voiceOptionsRequested = new EventEmitter<void>();\n @Output() planModeToggle = new EventEmitter<void>();\n /**\n * Before/After pair for the Skills button, proxied straight through from the input box. Gated on\n * `EnableSkillCommands` — the button and the keystroke are two doors to the same feature, so one\n * flag governs both rather than letting a composer advertise skills it will not serve.\n *\n * Cancel on `beforeSkillsOpened` vetoes the dropdown; `afterSkillsOpened` then does not fire.\n */\n @Output() beforeSkillsOpened = new EventEmitter<BeforeSkillsOpenedEventArgs>();\n @Output() afterSkillsOpened = new EventEmitter<void>();\n\n onInnerValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(newValue);\n }\n\n // ── Proxied public methods (ViewChild delegation) ─────────────────────────────────\n\n /** The inner mention editor — kept reachable for hosts that drive it directly (e.g. clear-after-programmatic-send). */\n public get mentionEditor(): MentionEditorComponent | undefined {\n return this.inputBox?.mentionEditor;\n }\n\n /** Focus the composer input. */\n /** Inserts a resolved mention chip + space (see MentionEditorComponent.InsertMention). */\n public InsertMention(suggestion: MentionSuggestion, focus: boolean = true): boolean {\n return this.inputBox?.InsertMention(suggestion, focus) ?? false;\n }\n\n /** Focus with the caret at the end of content. */\n public FocusCaretAtEnd(): boolean {\n return this.inputBox?.FocusCaretAtEnd() ?? false;\n }\n\n public focus(): void {\n this.inputBox?.focus();\n }\n\n /** Clear the editor content and pending attachments. */\n public clear(): void {\n this.inputBox?.mentionEditor?.clear();\n }\n\n /** Mention chip data (id/type/name + preset info) currently in the editor. */\n public getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.inputBox?.GetMentionChipsData() || [];\n }\n\n /** Plain text with mentions encoded as JSON (`@{\"type\":...}`) — the persistence format. */\n public getPlainTextWithJsonMentions(): string {\n return this.inputBox?.mentionEditor?.getPlainTextWithJsonMentions() || '';\n }\n\n /** Pending (not yet uploaded) attachments. */\n public getPendingAttachments(): PendingAttachment[] {\n return this.inputBox?.GetPendingAttachments() || [];\n }\n\n /** Open the attachment file picker programmatically. */\n public openFilePicker(): void {\n this.inputBox?.OpenFilePicker();\n }\n\n /** Attach an artifact as a pending attachment (artifact picker flow). */\n public AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.inputBox?.AddArtifactAttachment(artifact);\n }\n}\n"]}
1
+ {"version":3,"file":"ai-composer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/composer/ai-composer.component.ts"],"names":[],"mappings":"AAAA,O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kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBASL,MAAM;;kBASN,MAAM;;kBAEN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBAQN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kFA1ZI,mBAAmB","sourcesContent":["import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport type { MentionPerson } from '@memberjunction/conversations-runtime';\nimport { MentionSuggestion,\n ComposerTriggerProvider,\n MentionEditorComponent,\n MessageInputBoxComponent,\n PendingAttachment,\n BeforeSkillsOpenedEventArgs\n} from '@memberjunction/ng-composer';\nimport { AgentMentionProvider } from '../../composer-plugins/agent-mention.provider';\nimport { RecordMentionProvider } from '../../composer-plugins/record-mention.provider';\nimport { SkillCommandProvider } from '../../composer-plugins/skill-command.provider';\n\n/**\n * AI-aware composer: wraps the generic `<mj-message-input-box>` (from\n * `@memberjunction/ng-composer`, which ships zero AI knowledge) and builds the AI\n * trigger plugins in — '@' agent/user mentions, '#' entity/query record mentions, and\n * '/' skill commands — while proxying the input box's full surface (inputs, outputs,\n * and public methods).\n *\n * The familiar granular flags live HERE now:\n * - `EnableAgentMentions` (default true) — the '@' trigger\n * - `EnableEntityMentions` (default true) — the '#' trigger\n * - `EnableSkillCommands` (default true) — the '/' trigger\n * plus the pass-through `enableMentions` master switch.\n *\n * The wrapper always runs the inner editor in EXPLICIT provider-list mode (it owns the\n * list; it deliberately does not proxy `TriggerProviders` / `ExcludedTriggerKeys` — use\n * the raw `<mj-message-input-box>` when you need custom providers or discovery mode).\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-composer',\n template: `\n <mj-message-input-box\n #inputBox\n [Placeholder]=\"placeholder\"\n [Disabled]=\"disabled\"\n [Value]=\"value\"\n [ShowCharacterCount]=\"showCharacterCount\"\n [EnableMentions]=\"enableMentions\"\n [TriggerProviders]=\"ActiveTriggerProviders\"\n [Provider]=\"Provider\"\n [CurrentUser]=\"currentUser\"\n [Rows]=\"rows\"\n [EnableAttachments]=\"enableAttachments\"\n [MaxAttachments]=\"maxAttachments\"\n [MaxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [AcceptedFileTypes]=\"acceptedFileTypes\"\n [EnableRealtime]=\"enableRealtime\"\n [VoiceActive]=\"voiceActive\"\n [CanStartRealtime]=\"canStartRealtime\"\n [EnablePlanMode]=\"enablePlanMode\"\n [EnableSkills]=\"EnableSkillCommands\"\n [PlanModeActive]=\"planModeActive\"\n (TextSubmitted)=\"textSubmitted.emit($event)\"\n (Blurred)=\"blurred.emit()\"\n (ValueChange)=\"onInnerValueChange($event)\"\n (AttachmentsChanged)=\"attachmentsChanged.emit($event)\"\n (AttachmentError)=\"attachmentError.emit($event)\"\n (AttachmentClicked)=\"attachmentClicked.emit($event)\"\n (VoiceRequested)=\"voiceRequested.emit()\"\n (VoiceOptionsRequested)=\"voiceOptionsRequested.emit()\"\n (PlanModeToggle)=\"planModeToggle.emit()\"\n (BeforeSkillsOpened)=\"beforeSkillsOpened.emit($event)\"\n (AfterSkillsOpened)=\"afterSkillsOpened.emit()\">\n </mj-message-input-box>\n `\n})\nexport class AiComposerComponent {\n @ViewChild('inputBox') InputBox?: MessageInputBoxComponent;\n\n /** @deprecated Use {@link InputBox}. */\n get inputBox(): MessageInputBoxComponent | undefined {\n return this.InputBox;\n }\n /** @deprecated Use {@link InputBox}. */\n set inputBox(value: MessageInputBoxComponent | undefined) {\n this.InputBox = value;\n }\n\n // ── AI convenience flags (the wrapper's reason to exist) ─────────────────────────\n private _enableAgentMentions: boolean = true;\n private _enableEntityMentions: boolean = true;\n private _enableSkillCommands: boolean = true;\n private _activeTriggerProviders: ComposerTriggerProvider[] = [];\n\n // One instance per plugin per composer — all instances share the singleton\n // MentionAutocompleteService engine, so there is no duplicate cache warm-up.\n private readonly agentMentionProvider = new AgentMentionProvider();\n private readonly recordMentionProvider = new RecordMentionProvider();\n private readonly skillCommandProvider = new SkillCommandProvider();\n\n /**\n * The agent the message is expected to go to, when the host knows it (`mj-message-input` binds an\n * explicit `@agent` chip in the draft, else its resolved continuity/pinned/default agent). Narrows\n * the '/' skill picker to the skills that agent accepts (`AcceptsSkills` + `MJ: AI Agent Skills`\n * grants). Null = unknown, no narrowing — the server's RequestedSkills guard is the backstop.\n */\n @Input()\n set TargetAgentId(value: string | null) {\n this.skillCommandProvider.TargetAgentId = value ?? null;\n }\n get TargetAgentId(): string | null {\n return this.skillCommandProvider.TargetAgentId;\n }\n\n private _allowedAgentIDs: readonly string[] | null = null;\n private _mentionPeople: readonly MentionPerson[] | null = null;\n\n /**\n * The agents the '@' list may offer. Null (the default) offers every agent the user can run;\n * an empty list offers none. Applies to this composer only.\n */\n @Input()\n set AllowedAgentIDs(value: readonly string[] | null) {\n this._allowedAgentIDs = value ?? null;\n this.applyMentionScope();\n }\n get AllowedAgentIDs(): readonly string[] | null {\n return this._allowedAgentIDs;\n }\n\n /**\n * The people the '@' list offers, such as a chat's members. Null (the default) offers the\n * current user, as before. Applies to this composer only.\n */\n @Input()\n set MentionPeople(value: readonly MentionPerson[] | null) {\n this._mentionPeople = value ?? null;\n this.applyMentionScope();\n }\n get MentionPeople(): readonly MentionPerson[] | null {\n return this._mentionPeople;\n }\n\n constructor() {\n this.rebuildTriggerProviders();\n }\n\n /** Hands this composer's '@' scope to its own agent-mention provider (never the shared engine). */\n private applyMentionScope(): void {\n this.agentMentionProvider.Scope = this._allowedAgentIDs == null && this._mentionPeople == null\n ? null\n : { AllowedAgentIDs: this._allowedAgentIDs, People: this._mentionPeople };\n }\n\n /** Enables the '@' trigger (agent + user mentions). */\n @Input()\n set EnableAgentMentions(value: boolean) {\n if (value !== this._enableAgentMentions) {\n this._enableAgentMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableAgentMentions(): boolean {\n return this._enableAgentMentions;\n }\n\n /** Enables the '#' trigger (entity + query record mentions). */\n @Input()\n set EnableEntityMentions(value: boolean) {\n if (value !== this._enableEntityMentions) {\n this._enableEntityMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableEntityMentions(): boolean {\n return this._enableEntityMentions;\n }\n\n /** Enables the '/' trigger (skill commands). */\n @Input()\n set EnableSkillCommands(value: boolean) {\n if (value !== this._enableSkillCommands) {\n this._enableSkillCommands = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableSkillCommands(): boolean {\n return this._enableSkillCommands;\n }\n\n /** The explicit provider list bound to the inner editor (stable reference; rebuilt only when a flag flips). */\n public get ActiveTriggerProviders(): ComposerTriggerProvider[] {\n return this._activeTriggerProviders;\n }\n\n private rebuildTriggerProviders(): void {\n const providers: ComposerTriggerProvider[] = [];\n if (this._enableAgentMentions) providers.push(this.agentMentionProvider);\n if (this._enableEntityMentions) providers.push(this.recordMentionProvider);\n if (this._enableSkillCommands) providers.push(this.skillCommandProvider);\n this._activeTriggerProviders = providers;\n }\n\n // ── Proxied inputs (identical names/defaults to MessageInputBoxComponent) ────────\n @Input() Placeholder: string = 'Type your message to start a new conversation...';\n\n /** @deprecated Use {@link Placeholder}. */\n @Input() set placeholder(value: string) {\n this.Placeholder = value;\n }\n /** @deprecated Use {@link Placeholder}. */\n get placeholder(): string {\n return this.Placeholder;\n }\n @Input() Disabled: boolean = false;\n\n /** @deprecated Use {@link Disabled}. */\n @Input() set disabled(value: boolean) {\n this.Disabled = value;\n }\n /** @deprecated Use {@link Disabled}. */\n get disabled(): boolean {\n return this.Disabled;\n }\n @Input() Value: string = '';\n\n /** @deprecated Use {@link Value}. */\n @Input() set value(value: string) {\n this.Value = value;\n }\n /** @deprecated Use {@link Value}. */\n get value(): string {\n return this.Value;\n }\n @Input() ShowCharacterCount: boolean = false;\n\n /** @deprecated Use {@link ShowCharacterCount}. */\n @Input() set showCharacterCount(value: boolean) {\n this.ShowCharacterCount = value;\n }\n /** @deprecated Use {@link ShowCharacterCount}. */\n get showCharacterCount(): boolean {\n return this.ShowCharacterCount;\n }\n /** Master switch for all mention/command triggers (pass-through). */\n @Input() EnableMentions: boolean = true;\n\n /** @deprecated Use {@link EnableMentions}. */\n @Input() set enableMentions(value: boolean) {\n this.EnableMentions = value;\n }\n /** @deprecated Use {@link EnableMentions}. */\n get enableMentions(): boolean {\n return this.EnableMentions;\n }\n /** Optional metadata provider scoping this composer (pass-through to the trigger plugins). */\n @Input() Provider: IMetadataProvider | null = null;\n @Input() CurrentUser?: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo | undefined) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo | undefined {\n return this.CurrentUser;\n }\n @Input() Rows: number = 3;\n\n /** @deprecated Use {@link Rows}. */\n @Input() set rows(value: number) {\n this.Rows = value;\n }\n /** @deprecated Use {@link Rows}. */\n get rows(): number {\n return this.Rows;\n }\n @Input() EnableAttachments: boolean = true;\n\n /** @deprecated Use {@link EnableAttachments}. */\n @Input() set enableAttachments(value: boolean) {\n this.EnableAttachments = value;\n }\n /** @deprecated Use {@link EnableAttachments}. */\n get enableAttachments(): boolean {\n return this.EnableAttachments;\n }\n @Input() MaxAttachments: number = 10;\n\n /** @deprecated Use {@link MaxAttachments}. */\n @Input() set maxAttachments(value: number) {\n this.MaxAttachments = value;\n }\n /** @deprecated Use {@link MaxAttachments}. */\n get maxAttachments(): number {\n return this.MaxAttachments;\n }\n @Input() MaxAttachmentSizeBytes: number = 20 * 1024 * 1024;\n\n /** @deprecated Use {@link MaxAttachmentSizeBytes}. */\n @Input() set maxAttachmentSizeBytes(value: number) {\n this.MaxAttachmentSizeBytes = value;\n }\n /** @deprecated Use {@link MaxAttachmentSizeBytes}. */\n get maxAttachmentSizeBytes(): number {\n return this.MaxAttachmentSizeBytes;\n } // 20MB\n @Input() AcceptedFileTypes: string = 'image/*';\n\n /** @deprecated Use {@link AcceptedFileTypes}. */\n @Input() set acceptedFileTypes(value: string) {\n this.AcceptedFileTypes = value;\n }\n /** @deprecated Use {@link AcceptedFileTypes}. */\n get acceptedFileTypes(): string {\n return this.AcceptedFileTypes;\n }\n @Input() EnableRealtime: boolean = false;\n\n /** @deprecated Use {@link EnableRealtime}. */\n @Input() set enableRealtime(value: boolean) {\n this.EnableRealtime = value;\n }\n /** @deprecated Use {@link EnableRealtime}. */\n get enableRealtime(): boolean {\n return this.EnableRealtime;\n }\n @Input() VoiceActive: boolean = false;\n\n /** @deprecated Use {@link VoiceActive}. */\n @Input() set voiceActive(value: boolean) {\n this.VoiceActive = value;\n }\n /** @deprecated Use {@link VoiceActive}. */\n get voiceActive(): boolean {\n return this.VoiceActive;\n }\n @Input() CanStartRealtime: boolean = true;\n\n /** @deprecated Use {@link CanStartRealtime}. */\n @Input() set canStartRealtime(value: boolean) {\n this.CanStartRealtime = value;\n }\n /** @deprecated Use {@link CanStartRealtime}. */\n get canStartRealtime(): boolean {\n return this.CanStartRealtime;\n }\n @Input() EnablePlanMode: boolean = false;\n\n /** @deprecated Use {@link EnablePlanMode}. */\n @Input() set enablePlanMode(value: boolean) {\n this.EnablePlanMode = value;\n }\n /** @deprecated Use {@link EnablePlanMode}. */\n get enablePlanMode(): boolean {\n return this.EnablePlanMode;\n }\n @Input() PlanModeActive: boolean = false;\n\n /** @deprecated Use {@link PlanModeActive}. */\n @Input() set planModeActive(value: boolean) {\n this.PlanModeActive = value;\n }\n /** @deprecated Use {@link PlanModeActive}. */\n get planModeActive(): boolean {\n return this.PlanModeActive;\n }\n\n // ── Proxied outputs ───────────────────────────────────────────────────────────────\n @Output() TextSubmitted = new EventEmitter<string>();\n\n /**\n * @deprecated Use {@link TextSubmitted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (textSubmitted) keeps working. Must stay AFTER TextSubmitted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() textSubmitted = this.TextSubmitted;\n /** Composer lost focus — hosts persist drafts on this. */\n @Output() Blurred = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link Blurred}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (blurred) keeps working. Must stay AFTER Blurred: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() blurred = this.Blurred;\n @Output() ValueChange = new EventEmitter<string>();\n\n /**\n * @deprecated Use {@link ValueChange}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (valueChange) keeps working. Must stay AFTER ValueChange: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() valueChange = this.ValueChange;\n @Output() AttachmentsChanged = new EventEmitter<PendingAttachment[]>();\n\n /**\n * @deprecated Use {@link AttachmentsChanged}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (attachmentsChanged) keeps working. Must stay AFTER AttachmentsChanged: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() attachmentsChanged = this.AttachmentsChanged;\n @Output() AttachmentError = new EventEmitter<string>();\n\n /**\n * @deprecated Use {@link AttachmentError}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (attachmentError) keeps working. Must stay AFTER AttachmentError: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() attachmentError = this.AttachmentError;\n @Output() AttachmentClicked = new EventEmitter<PendingAttachment>();\n\n /**\n * @deprecated Use {@link AttachmentClicked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (attachmentClicked) keeps working. Must stay AFTER AttachmentClicked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() attachmentClicked = this.AttachmentClicked;\n @Output() VoiceRequested = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link VoiceRequested}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (voiceRequested) keeps working. Must stay AFTER VoiceRequested: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() voiceRequested = this.VoiceRequested;\n @Output() VoiceOptionsRequested = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link VoiceOptionsRequested}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (voiceOptionsRequested) keeps working. Must stay AFTER VoiceOptionsRequested: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() voiceOptionsRequested = this.VoiceOptionsRequested;\n @Output() PlanModeToggle = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link PlanModeToggle}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (planModeToggle) keeps working. Must stay AFTER PlanModeToggle: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() planModeToggle = this.PlanModeToggle;\n /**\n * Before/After pair for the Skills button, proxied straight through from the input box. Gated on\n * `EnableSkillCommands` — the button and the keystroke are two doors to the same feature, so one\n * flag governs both rather than letting a composer advertise skills it will not serve.\n *\n * Cancel on `beforeSkillsOpened` vetoes the dropdown; `afterSkillsOpened` then does not fire.\n */\n @Output() BeforeSkillsOpened = new EventEmitter<BeforeSkillsOpenedEventArgs>();\n\n /**\n * @deprecated Use {@link BeforeSkillsOpened}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (beforeSkillsOpened) keeps working. Must stay AFTER BeforeSkillsOpened: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() beforeSkillsOpened = this.BeforeSkillsOpened;\n @Output() AfterSkillsOpened = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link AfterSkillsOpened}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (afterSkillsOpened) keeps working. Must stay AFTER AfterSkillsOpened: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() afterSkillsOpened = this.AfterSkillsOpened;\n\n OnInnerValueChange(newValue: string): void {\n this.Value = newValue;\n this.ValueChange.emit(newValue);\n }\n\n /** @deprecated Use {@link OnInnerValueChange}. */\n onInnerValueChange(newValue: string): void {\n return this.OnInnerValueChange(newValue);\n }\n\n // ── Proxied public methods (ViewChild delegation) ─────────────────────────────────\n\n /** The inner mention editor — kept reachable for hosts that drive it directly (e.g. clear-after-programmatic-send). */\n public get MentionEditor(): MentionEditorComponent | undefined {\n return this.InputBox?.mentionEditor;\n }\n\n /** @deprecated Use {@link MentionEditor}. */\n public get mentionEditor(): MentionEditorComponent | undefined {\n return this.MentionEditor;\n }\n\n /** Focus the composer input. */\n /** Inserts a resolved mention chip + space (see MentionEditorComponent.InsertMention). */\n public InsertMention(suggestion: MentionSuggestion, focus: boolean = true): boolean {\n return this.InputBox?.InsertMention(suggestion, focus) ?? false;\n }\n\n /** Focus with the caret at the end of content. */\n public FocusCaretAtEnd(): boolean {\n return this.InputBox?.FocusCaretAtEnd() ?? false;\n }\n\n public Focus(): void {\n this.InputBox?.focus();\n }\n\n /** @deprecated Use {@link Focus}. */\n public focus(): void {\n return this.Focus();\n }\n\n /** Clear the editor content and pending attachments. */\n public Clear(): void {\n this.InputBox?.mentionEditor?.clear();\n }\n\n /** @deprecated Use {@link Clear}. */\n public clear(): void {\n return this.Clear();\n }\n\n /** Mention chip data (id/type/name + preset info) currently in the editor. */\n public GetMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.InputBox?.GetMentionChipsData() || [];\n }\n\n /** @deprecated Use {@link GetMentionChipsData}. */\n public getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.GetMentionChipsData();\n }\n\n /** Plain text with mentions encoded as JSON (`@{\"type\":...}`) — the persistence format. */\n public GetPlainTextWithJsonMentions(): string {\n return this.InputBox?.mentionEditor?.getPlainTextWithJsonMentions() || '';\n }\n\n /** @deprecated Use {@link GetPlainTextWithJsonMentions}. */\n public getPlainTextWithJsonMentions(): string {\n return this.GetPlainTextWithJsonMentions();\n }\n\n /** Pending (not yet uploaded) attachments. */\n public GetPendingAttachments(): PendingAttachment[] {\n return this.InputBox?.GetPendingAttachments() || [];\n }\n\n /** @deprecated Use {@link GetPendingAttachments}. */\n public getPendingAttachments(): PendingAttachment[] {\n return this.GetPendingAttachments();\n }\n\n /** Open the attachment file picker programmatically. */\n public OpenFilePicker(): void {\n this.InputBox?.OpenFilePicker();\n }\n\n /** @deprecated Use {@link OpenFilePicker}. */\n public openFilePicker(): void {\n return this.OpenFilePicker();\n }\n\n /** Attach an artifact as a pending attachment (artifact picker flow). */\n public AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.InputBox?.AddArtifactAttachment(artifact);\n }\n}\n"]}
@@ -26,13 +26,24 @@ export declare class ConversationAgentPickerComponent implements OnInit {
26
26
  CurrentUser: UserInfo | null;
27
27
  /** Disable the picker (e.g. read-only conversation). */
28
28
  Disabled: boolean;
29
+ /**
30
+ * The agents the chat allows (the chat area's `AllowedAgentIDs`). Only these can be pinned.
31
+ * Null (the default) offers every eligible agent.
32
+ */
33
+ set AllowedAgentIDs(value: readonly string[] | null);
34
+ get AllowedAgentIDs(): readonly string[] | null;
29
35
  /** Emitted after a successful save with the new (or null) agent ID. */
30
36
  AgentChanged: EventEmitter<string | null>;
31
37
  IsOpen: boolean;
32
38
  EligibleAgents: MJAIAgentEntityExtended[];
33
39
  private readonly cdr;
34
40
  private readonly notifications;
41
+ private _allowedAgentIDs;
42
+ /** Every top-level, active agent, before the allowed list narrows it. */
43
+ private catalogAgents;
35
44
  ngOnInit(): Promise<void>;
45
+ /** Narrows the catalog to the allowed agents. */
46
+ private applyAllowedAgents;
36
47
  get CurrentAgentLabel(): string;
37
48
  get ButtonTitle(): string;
38
49
  IconClassFor(agent: MJAIAgentEntityExtended): string;
@@ -42,6 +53,6 @@ export declare class ConversationAgentPickerComponent implements OnInit {
42
53
  /** Close the menu when the user clicks outside the picker. */
43
54
  OnDocumentClick(_event: MouseEvent): void;
44
55
  static ɵfac: i0.ɵɵFactoryDeclaration<ConversationAgentPickerComponent, never>;
45
- static ɵcmp: i0.ɵɵComponentDeclaration<ConversationAgentPickerComponent, "mj-conversation-agent-picker", never, { "Conversation": { "alias": "Conversation"; "required": false; }; "CurrentUser": { "alias": "CurrentUser"; "required": false; }; "Disabled": { "alias": "Disabled"; "required": false; }; }, { "AgentChanged": "AgentChanged"; }, never, never, false, never>;
56
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConversationAgentPickerComponent, "mj-conversation-agent-picker", never, { "Conversation": { "alias": "Conversation"; "required": false; }; "CurrentUser": { "alias": "CurrentUser"; "required": false; }; "Disabled": { "alias": "Disabled"; "required": false; }; "AllowedAgentIDs": { "alias": "AllowedAgentIDs"; "required": false; }; }, { "AgentChanged": "AgentChanged"; }, never, never, false, never>;
46
57
  }
47
58
  //# sourceMappingURL=conversation-agent-picker.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent-picker.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-agent-picker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EAGZ,MAAM,EAGT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAI1E;;;;;;;;;;;;;;;GAeG;AACH,qBAyFa,gCAAiC,YAAW,MAAM;IAC3D,iEAAiE;IACxD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IAE1D,6CAA6C;IACpC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE7C,wDAAwD;IAC/C,QAAQ,EAAE,OAAO,CAAS;IAEnC,uEAAuE;IAC7D,YAAY,8BAAqC;IAEpD,MAAM,UAAS;IACf,cAAc,EAAE,uBAAuB,EAAE,CAAM;IAEtD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IACjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiC;IAElD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtC,IAAW,iBAAiB,IAAI,MAAM,CAUrC;IAED,IAAW,WAAW,IAAI,MAAM,CAI/B;IAEM,YAAY,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM;IAIpD,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO;IAKnD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOzB,SAAS,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B5E,8DAA8D;IAEvD,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;yCAvGvC,gCAAgC;2CAAhC,gCAAgC;CA6G5C"}
1
+ {"version":3,"file":"conversation-agent-picker.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-agent-picker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EAGZ,MAAM,EAGT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAK1E;;;;;;;;;;;;;;;GAeG;AACH,qBAyFa,gCAAiC,YAAW,MAAM;IAC3D,iEAAiE;IACxD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IAE1D,6CAA6C;IACpC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE7C,wDAAwD;IAC/C,QAAQ,EAAE,OAAO,CAAS;IAEnC;;;OAGG;IACH,IACI,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,EAGlD;IACD,IAAI,eAAe,IAAI,SAAS,MAAM,EAAE,GAAG,IAAI,CAE9C;IAED,uEAAuE;IAC7D,YAAY,8BAAqC;IAEpD,MAAM,UAAS;IACf,cAAc,EAAE,uBAAuB,EAAE,CAAM;IAEtD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IACjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiC;IAC/D,OAAO,CAAC,gBAAgB,CAAkC;IAC1D,yEAAyE;IACzE,OAAO,CAAC,aAAa,CAAiC;IAEzC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtC,iDAAiD;IACjD,OAAO,CAAC,kBAAkB;IAK1B,IAAW,iBAAiB,IAAI,MAAM,CAUrC;IAED,IAAW,WAAW,IAAI,MAAM,CAI/B;IAEM,YAAY,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM;IAIpD,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO;IAKnD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOzB,SAAS,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B5E,8DAA8D;IAEvD,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;yCA7HvC,gCAAgC;2CAAhC,gCAAgC;CAmI5C"}
@@ -3,6 +3,7 @@ import { LogError } from '@memberjunction/core';
3
3
  import { AIEngineBase } from '@memberjunction/ai-engine-base';
4
4
  import { MJNotificationService } from '@memberjunction/ng-notifications';
5
5
  import { UUIDsEqual } from '@memberjunction/global';
6
+ import { IsAgentAllowed } from '@memberjunction/ai-core-plus';
6
7
  import * as i0 from "@angular/core";
7
8
  const _forTrack0 = ($index, $item) => $item.ID;
8
9
  function ConversationAgentPickerComponent_Conditional_6_Conditional_7_Template(rf, ctx) { if (rf & 1) {
@@ -79,29 +80,48 @@ export class ConversationAgentPickerComponent {
79
80
  CurrentUser = null;
80
81
  /** Disable the picker (e.g. read-only conversation). */
81
82
  Disabled = false;
83
+ /**
84
+ * The agents the chat allows (the chat area's `AllowedAgentIDs`). Only these can be pinned.
85
+ * Null (the default) offers every eligible agent.
86
+ */
87
+ set AllowedAgentIDs(value) {
88
+ this._allowedAgentIDs = value ?? null;
89
+ this.applyAllowedAgents();
90
+ }
91
+ get AllowedAgentIDs() {
92
+ return this._allowedAgentIDs;
93
+ }
82
94
  /** Emitted after a successful save with the new (or null) agent ID. */
83
95
  AgentChanged = new EventEmitter();
84
96
  IsOpen = false;
85
97
  EligibleAgents = [];
86
98
  cdr = inject(ChangeDetectorRef);
87
99
  notifications = inject(MJNotificationService);
100
+ _allowedAgentIDs = null;
101
+ /** Every top-level, active agent, before the allowed list narrows it. */
102
+ catalogAgents = [];
88
103
  async ngOnInit() {
89
104
  try {
90
105
  // AIEngineBase is the live, cached agent catalog. Ensure it's
91
106
  // loaded — most app shells warm it up at boot, but the picker
92
107
  // could mount before that completes.
93
108
  await AIEngineBase.Instance.Config(false);
94
- this.EligibleAgents = (AIEngineBase.Instance.Agents ?? [])
109
+ this.catalogAgents = (AIEngineBase.Instance.Agents ?? [])
95
110
  .filter(a => !a.ParentID &&
96
111
  a.Status === 'Active' &&
97
112
  a.InvocationMode !== 'Sub-Agent')
98
113
  .sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));
99
- this.cdr.markForCheck();
114
+ this.applyAllowedAgents();
100
115
  }
101
116
  catch (err) {
102
117
  LogError(`ConversationAgentPicker.ngOnInit: ${err instanceof Error ? err.message : String(err)}`);
103
118
  }
104
119
  }
120
+ /** Narrows the catalog to the allowed agents. */
121
+ applyAllowedAgents() {
122
+ this.EligibleAgents = this.catalogAgents.filter(a => IsAgentAllowed(a.ID, this._allowedAgentIDs));
123
+ this.cdr.markForCheck();
124
+ }
105
125
  get CurrentAgentLabel() {
106
126
  const id = this.Conversation?.DefaultAgentID;
107
127
  if (!id)
@@ -172,7 +192,7 @@ export class ConversationAgentPickerComponent {
172
192
  static ɵfac = function ConversationAgentPickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConversationAgentPickerComponent)(); };
173
193
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConversationAgentPickerComponent, selectors: [["mj-conversation-agent-picker"]], hostBindings: function ConversationAgentPickerComponent_HostBindings(rf, ctx) { if (rf & 1) {
174
194
  i0.ɵɵlistener("click", function ConversationAgentPickerComponent_click_HostBindingHandler($event) { return ctx.OnDocumentClick($event); }, i0.ɵɵresolveDocument);
175
- } }, inputs: { Conversation: "Conversation", CurrentUser: "CurrentUser", Disabled: "Disabled" }, outputs: { AgentChanged: "AgentChanged" }, standalone: false, decls: 7, vars: 6, consts: [[1, "mj-cv-agent-picker"], ["type", "button", 1, "mj-cv-agent-picker__trigger", 3, "click", "title", "disabled"], [1, "fa-solid", "fa-robot"], [1, "mj-cv-agent-picker__label"], [1, "fa-solid", "fa-caret-down", "mj-cv-agent-picker__caret"], [1, "mj-cv-agent-picker__menu"], [1, "mj-cv-agent-picker__menu", 3, "click"], [1, "mj-cv-agent-picker__menu-header"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "click"], [1, "fa-solid", "fa-wand-magic-sparkles"], [1, "mj-cv-agent-picker__empty"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "mj-cv-agent-picker__item--selected", "title"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "click", "title"]], template: function ConversationAgentPickerComponent_Template(rf, ctx) { if (rf & 1) {
195
+ } }, inputs: { Conversation: "Conversation", CurrentUser: "CurrentUser", Disabled: "Disabled", AllowedAgentIDs: "AllowedAgentIDs" }, outputs: { AgentChanged: "AgentChanged" }, standalone: false, decls: 7, vars: 6, consts: [[1, "mj-cv-agent-picker"], ["type", "button", 1, "mj-cv-agent-picker__trigger", 3, "click", "title", "disabled"], [1, "fa-solid", "fa-robot"], [1, "mj-cv-agent-picker__label"], [1, "fa-solid", "fa-caret-down", "mj-cv-agent-picker__caret"], [1, "mj-cv-agent-picker__menu"], [1, "mj-cv-agent-picker__menu", 3, "click"], [1, "mj-cv-agent-picker__menu-header"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "click"], [1, "fa-solid", "fa-wand-magic-sparkles"], [1, "mj-cv-agent-picker__empty"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "mj-cv-agent-picker__item--selected", "title"], ["type", "button", 1, "mj-cv-agent-picker__item", 3, "click", "title"]], template: function ConversationAgentPickerComponent_Template(rf, ctx) { if (rf & 1) {
176
196
  i0.ɵɵelementStart(0, "div", 0)(1, "button", 1);
177
197
  i0.ɵɵlistener("click", function ConversationAgentPickerComponent_Template_button_click_1_listener($event) { return ctx.Toggle($event); });
178
198
  i0.ɵɵelement(2, "i", 2);
@@ -243,11 +263,13 @@ export class ConversationAgentPickerComponent {
243
263
  type: Input
244
264
  }], Disabled: [{
245
265
  type: Input
266
+ }], AllowedAgentIDs: [{
267
+ type: Input
246
268
  }], AgentChanged: [{
247
269
  type: Output
248
270
  }], OnDocumentClick: [{
249
271
  type: HostListener,
250
272
  args: ['document:click', ['$event']]
251
273
  }] }); })();
252
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConversationAgentPickerComponent, { className: "ConversationAgentPickerComponent", filePath: "src/lib/components/conversation/conversation-agent-picker.component.ts", lineNumber: 125 }); })();
274
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConversationAgentPickerComponent, { className: "ConversationAgentPickerComponent", filePath: "src/lib/components/conversation/conversation-agent-picker.component.ts", lineNumber: 126 }); })();
253
275
  //# sourceMappingURL=conversation-agent-picker.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent-picker.component.js","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-agent-picker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,iBAAiB,EACjB,SAAS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;YACpE,iBAAS;YACT,kGAAc;YA4BlB,iBAAM;;YAvC0B,sDAAyC;YAIjE,cAAqB;YACrB,AADA,uCAAqB,+CACiB;YAGE,eAAuB;YAAvB,2CAAuB;YAGnE,eA2BC;YA3BD,qCA2BC;;;iFA8CA,gCAAgC;cAzF5C,SAAS;6BACM,KAAK,YACP,8BAA8B,mBACvB,uBAAuB,CAAC,MAAM,YACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyCT;;kBA8CA,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,MAAM;;kBA2FN,YAAY;mBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;kFAtGjC,gCAAgC","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n HostListener,\n Input,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { LogError } from '@memberjunction/core';\nimport type { UserInfo } from '@memberjunction/core';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport type { MJAIAgentEntityExtended } from '@memberjunction/ai-core-plus';\nimport type { MJConversationEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Header widget that lets a user pin a default AI agent on the active\n * conversation. The pinned agent (saved to\n * `MJConversationEntity.DefaultAgentID`) takes precedence over the\n * embedder-supplied default in `MessageInputComponent.routeMessage()` —\n * non-mention messages route to it instead of Sage.\n *\n * Eligible agents are top-level, Active, non-Sub-Agent rows from\n * `AIEngineBase.Instance.Agents`. The widget renders as a compact button\n * showing the current pin (or \"Auto\" when nothing is pinned). Clicking\n * opens an inline list with a \"Clear\" option to remove the pin.\n *\n * The host controls visibility via `<mj-conversation-chat-area>`'s\n * `[showAgentPicker]` input (default true). Surfaces that don't want this\n * UX (e.g. agent-less embed) set it to false.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-agent-picker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"mj-cv-agent-picker\" [class.mj-cv-agent-picker--open]=\"IsOpen\">\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__trigger\"\n [title]=\"ButtonTitle\"\n [disabled]=\"Disabled || !Conversation\"\n (click)=\"Toggle($event)\">\n <i class=\"fa-solid fa-robot\"></i>\n <span class=\"mj-cv-agent-picker__label\">{{ CurrentAgentLabel }}</span>\n <i class=\"fa-solid fa-caret-down mj-cv-agent-picker__caret\"></i>\n </button>\n @if (IsOpen) {\n <div class=\"mj-cv-agent-picker__menu\" (click)=\"$event.stopPropagation()\">\n <div class=\"mj-cv-agent-picker__menu-header\">Default agent for this conversation</div>\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__item\"\n [class.mj-cv-agent-picker__item--selected]=\"!Conversation?.DefaultAgentID\"\n (click)=\"PickAgent(null)\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Auto (use default)</span>\n </button>\n @if (EligibleAgents.length === 0) {\n <div class=\"mj-cv-agent-picker__empty\">No agents available</div>\n } @else {\n @for (agent of EligibleAgents; track agent.ID) {\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__item\"\n [class.mj-cv-agent-picker__item--selected]=\"IsSelected(agent)\"\n [title]=\"agent.Description || agent.Name\"\n (click)=\"PickAgent(agent)\">\n <i [class]=\"IconClassFor(agent)\"></i>\n <span>{{ agent.Name }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n /* Match mjButton size=\"sm\" so the trigger lines up with neighboring\n Export / Share buttons: min-height 32px, 6px/12px padding,\n 0.8125rem font. Same border-radius as the other chrome buttons. */\n .mj-cv-agent-picker { position: relative; display: inline-flex; align-items: center; }\n .mj-cv-agent-picker__trigger {\n display: inline-flex; align-items: center; gap: 6px;\n padding: 6px 12px; min-height: 32px; box-sizing: border-box;\n background: var(--mj-bg-surface-card); border: 1px solid var(--mj-border-default);\n border-radius: 4px; cursor: pointer;\n color: var(--mj-text-primary); font-size: 0.8125rem; line-height: 1.5;\n transition: background 120ms, border-color 120ms;\n }\n .mj-cv-agent-picker__trigger:hover:not(:disabled) {\n background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong);\n }\n .mj-cv-agent-picker__trigger:disabled { opacity: 0.5; cursor: not-allowed; }\n .mj-cv-agent-picker--open .mj-cv-agent-picker__trigger { border-color: var(--mj-border-focus); }\n .mj-cv-agent-picker__label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .mj-cv-agent-picker__caret { font-size: 10px; opacity: 0.7; }\n .mj-cv-agent-picker__menu {\n position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;\n min-width: 220px; max-height: 320px; overflow-y: auto;\n background: var(--mj-bg-surface-elevated); border: 1px solid var(--mj-border-default);\n border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);\n padding: 4px 0;\n }\n .mj-cv-agent-picker__menu-header {\n padding: 6px 12px 4px; font-size: 11px; text-transform: uppercase;\n letter-spacing: 0.04em; color: var(--mj-text-muted);\n }\n .mj-cv-agent-picker__item {\n display: flex; align-items: center; gap: 8px; width: 100%;\n padding: 6px 12px; background: transparent; border: none; cursor: pointer;\n color: var(--mj-text-primary); font-size: 13px; text-align: left;\n }\n .mj-cv-agent-picker__item i { width: 14px; text-align: center; color: var(--mj-text-secondary); }\n .mj-cv-agent-picker__item:hover { background: var(--mj-bg-surface-hover); }\n .mj-cv-agent-picker__item--selected { background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent); }\n .mj-cv-agent-picker__item--selected i { color: var(--mj-brand-primary); }\n .mj-cv-agent-picker__empty { padding: 8px 12px; font-size: 12px; color: var(--mj-text-muted); }\n `]\n})\nexport class ConversationAgentPickerComponent implements OnInit {\n /** The conversation whose `DefaultAgentID` this widget edits. */\n @Input() Conversation: MJConversationEntity | null = null;\n\n /** Required for the Save() audit context. */\n @Input() CurrentUser: UserInfo | null = null;\n\n /** Disable the picker (e.g. read-only conversation). */\n @Input() Disabled: boolean = false;\n\n /** Emitted after a successful save with the new (or null) agent ID. */\n @Output() AgentChanged = new EventEmitter<string | null>();\n\n public IsOpen = false;\n public EligibleAgents: MJAIAgentEntityExtended[] = [];\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly notifications = inject(MJNotificationService);\n\n public async ngOnInit(): Promise<void> {\n try {\n // AIEngineBase is the live, cached agent catalog. Ensure it's\n // loaded — most app shells warm it up at boot, but the picker\n // could mount before that completes.\n await AIEngineBase.Instance.Config(false);\n this.EligibleAgents = (AIEngineBase.Instance.Agents ?? [])\n .filter(a =>\n !a.ParentID &&\n a.Status === 'Active' &&\n a.InvocationMode !== 'Sub-Agent'\n )\n .sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));\n this.cdr.markForCheck();\n } catch (err) {\n LogError(`ConversationAgentPicker.ngOnInit: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n public get CurrentAgentLabel(): string {\n const id = this.Conversation?.DefaultAgentID;\n if (!id) return 'Auto';\n const match = this.EligibleAgents.find(a => UUIDsEqual(a.ID, id));\n // If the pinned agent is no longer eligible (deactivated, demoted to\n // sub-agent), still surface its name from the cache so the user can\n // see what was pinned even though they can't re-pin it.\n const fromCache = match\n ?? (AIEngineBase.Instance.Agents ?? []).find(a => UUIDsEqual(a.ID, id));\n return fromCache?.Name ?? 'Pinned agent';\n }\n\n public get ButtonTitle(): string {\n return this.Conversation?.DefaultAgentID\n ? `This conversation routes to ${this.CurrentAgentLabel}. Click to change.`\n : 'No agent pinned — messages route via the standard rules. Click to pin an agent.';\n }\n\n public IconClassFor(agent: MJAIAgentEntityExtended): string {\n return agent.IconClass?.trim() || 'fa-solid fa-robot';\n }\n\n public IsSelected(agent: MJAIAgentEntityExtended): boolean {\n return !!this.Conversation?.DefaultAgentID\n && UUIDsEqual(agent.ID, this.Conversation.DefaultAgentID);\n }\n\n public Toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.Disabled || !this.Conversation) return;\n this.IsOpen = !this.IsOpen;\n this.cdr.markForCheck();\n }\n\n public async PickAgent(agent: MJAIAgentEntityExtended | null): Promise<void> {\n this.IsOpen = false;\n const conv = this.Conversation;\n if (!conv) return;\n const newId = agent?.ID ?? null;\n if (conv.DefaultAgentID === newId) {\n this.cdr.markForCheck();\n return;\n }\n const prev = conv.DefaultAgentID;\n conv.DefaultAgentID = newId;\n try {\n const saved = await conv.Save();\n if (!saved) {\n conv.DefaultAgentID = prev;\n this.notifications.CreateSimpleNotification(\n conv.LatestResult?.CompleteMessage ?? 'Failed to update conversation default agent.',\n 'error', 4500);\n return;\n }\n this.AgentChanged.emit(newId);\n } catch (err) {\n conv.DefaultAgentID = prev;\n LogError(`ConversationAgentPicker.PickAgent: ${err instanceof Error ? err.message : String(err)}`);\n } finally {\n this.cdr.markForCheck();\n }\n }\n\n /** Close the menu when the user clicks outside the picker. */\n @HostListener('document:click', ['$event'])\n public OnDocumentClick(_event: MouseEvent): void {\n if (this.IsOpen) {\n this.IsOpen = false;\n this.cdr.markForCheck();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"conversation-agent-picker.component.js","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-agent-picker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,MAAM,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;;;;IA8CtC,+BAAuC;IAAA,mCAAmB;IAAA,iBAAM;;;;IAG5D,kCA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AlIQ,gCAAgC;6DAAhC,gCAAgC;YAAhC,2GAAA,2BAAuB,0BAAS;;YAnFjC,AADJ,8BAA0E,gBAMzC;YAAzB,mHAAS,kBAAc,IAAC;YACxB,uBAAiC;YACjC,+BAAwC;YAAA,YAAuB;YAAA,iBAAO;YACtE,uBAAgE;YACpE,iBAAS;YACT,kGAAc;YA4BlB,iBAAM;;YAvC0B,sDAAyC;YAIjE,cAAqB;YACrB,AADA,uCAAqB,+CACiB;YAGE,eAAuB;YAAvB,2CAAuB;YAGnE,eA2BC;YA3BD,qCA2BC;;;iFA8CA,gCAAgC;cAzF5C,SAAS;6BACM,KAAK,YACP,8BAA8B,mBACvB,uBAAuB,CAAC,MAAM,YACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyCT;;kBA8CA,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAML,KAAK;;kBAUL,MAAM;;kBAoGN,YAAY;mBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;kFA5HjC,gCAAgC","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n HostListener,\n Input,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { LogError } from '@memberjunction/core';\nimport type { UserInfo } from '@memberjunction/core';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport type { MJAIAgentEntityExtended } from '@memberjunction/ai-core-plus';\nimport type { MJConversationEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { IsAgentAllowed } from '@memberjunction/ai-core-plus';\n\n/**\n * Header widget that lets a user pin a default AI agent on the active\n * conversation. The pinned agent (saved to\n * `MJConversationEntity.DefaultAgentID`) takes precedence over the\n * embedder-supplied default in `MessageInputComponent.routeMessage()` —\n * non-mention messages route to it instead of Sage.\n *\n * Eligible agents are top-level, Active, non-Sub-Agent rows from\n * `AIEngineBase.Instance.Agents`. The widget renders as a compact button\n * showing the current pin (or \"Auto\" when nothing is pinned). Clicking\n * opens an inline list with a \"Clear\" option to remove the pin.\n *\n * The host controls visibility via `<mj-conversation-chat-area>`'s\n * `[showAgentPicker]` input (default true). Surfaces that don't want this\n * UX (e.g. agent-less embed) set it to false.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-agent-picker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"mj-cv-agent-picker\" [class.mj-cv-agent-picker--open]=\"IsOpen\">\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__trigger\"\n [title]=\"ButtonTitle\"\n [disabled]=\"Disabled || !Conversation\"\n (click)=\"Toggle($event)\">\n <i class=\"fa-solid fa-robot\"></i>\n <span class=\"mj-cv-agent-picker__label\">{{ CurrentAgentLabel }}</span>\n <i class=\"fa-solid fa-caret-down mj-cv-agent-picker__caret\"></i>\n </button>\n @if (IsOpen) {\n <div class=\"mj-cv-agent-picker__menu\" (click)=\"$event.stopPropagation()\">\n <div class=\"mj-cv-agent-picker__menu-header\">Default agent for this conversation</div>\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__item\"\n [class.mj-cv-agent-picker__item--selected]=\"!Conversation?.DefaultAgentID\"\n (click)=\"PickAgent(null)\">\n <i class=\"fa-solid fa-wand-magic-sparkles\"></i>\n <span>Auto (use default)</span>\n </button>\n @if (EligibleAgents.length === 0) {\n <div class=\"mj-cv-agent-picker__empty\">No agents available</div>\n } @else {\n @for (agent of EligibleAgents; track agent.ID) {\n <button\n type=\"button\"\n class=\"mj-cv-agent-picker__item\"\n [class.mj-cv-agent-picker__item--selected]=\"IsSelected(agent)\"\n [title]=\"agent.Description || agent.Name\"\n (click)=\"PickAgent(agent)\">\n <i [class]=\"IconClassFor(agent)\"></i>\n <span>{{ agent.Name }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n /* Match mjButton size=\"sm\" so the trigger lines up with neighboring\n Export / Share buttons: min-height 32px, 6px/12px padding,\n 0.8125rem font. Same border-radius as the other chrome buttons. */\n .mj-cv-agent-picker { position: relative; display: inline-flex; align-items: center; }\n .mj-cv-agent-picker__trigger {\n display: inline-flex; align-items: center; gap: 6px;\n padding: 6px 12px; min-height: 32px; box-sizing: border-box;\n background: var(--mj-bg-surface-card); border: 1px solid var(--mj-border-default);\n border-radius: 4px; cursor: pointer;\n color: var(--mj-text-primary); font-size: 0.8125rem; line-height: 1.5;\n transition: background 120ms, border-color 120ms;\n }\n .mj-cv-agent-picker__trigger:hover:not(:disabled) {\n background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong);\n }\n .mj-cv-agent-picker__trigger:disabled { opacity: 0.5; cursor: not-allowed; }\n .mj-cv-agent-picker--open .mj-cv-agent-picker__trigger { border-color: var(--mj-border-focus); }\n .mj-cv-agent-picker__label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .mj-cv-agent-picker__caret { font-size: 10px; opacity: 0.7; }\n .mj-cv-agent-picker__menu {\n position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;\n min-width: 220px; max-height: 320px; overflow-y: auto;\n background: var(--mj-bg-surface-elevated); border: 1px solid var(--mj-border-default);\n border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);\n padding: 4px 0;\n }\n .mj-cv-agent-picker__menu-header {\n padding: 6px 12px 4px; font-size: 11px; text-transform: uppercase;\n letter-spacing: 0.04em; color: var(--mj-text-muted);\n }\n .mj-cv-agent-picker__item {\n display: flex; align-items: center; gap: 8px; width: 100%;\n padding: 6px 12px; background: transparent; border: none; cursor: pointer;\n color: var(--mj-text-primary); font-size: 13px; text-align: left;\n }\n .mj-cv-agent-picker__item i { width: 14px; text-align: center; color: var(--mj-text-secondary); }\n .mj-cv-agent-picker__item:hover { background: var(--mj-bg-surface-hover); }\n .mj-cv-agent-picker__item--selected { background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent); }\n .mj-cv-agent-picker__item--selected i { color: var(--mj-brand-primary); }\n .mj-cv-agent-picker__empty { padding: 8px 12px; font-size: 12px; color: var(--mj-text-muted); }\n `]\n})\nexport class ConversationAgentPickerComponent implements OnInit {\n /** The conversation whose `DefaultAgentID` this widget edits. */\n @Input() Conversation: MJConversationEntity | null = null;\n\n /** Required for the Save() audit context. */\n @Input() CurrentUser: UserInfo | null = null;\n\n /** Disable the picker (e.g. read-only conversation). */\n @Input() Disabled: boolean = false;\n\n /**\n * The agents the chat allows (the chat area's `AllowedAgentIDs`). Only these can be pinned.\n * Null (the default) offers every eligible agent.\n */\n @Input()\n set AllowedAgentIDs(value: readonly string[] | null) {\n this._allowedAgentIDs = value ?? null;\n this.applyAllowedAgents();\n }\n get AllowedAgentIDs(): readonly string[] | null {\n return this._allowedAgentIDs;\n }\n\n /** Emitted after a successful save with the new (or null) agent ID. */\n @Output() AgentChanged = new EventEmitter<string | null>();\n\n public IsOpen = false;\n public EligibleAgents: MJAIAgentEntityExtended[] = [];\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly notifications = inject(MJNotificationService);\n private _allowedAgentIDs: readonly string[] | null = null;\n /** Every top-level, active agent, before the allowed list narrows it. */\n private catalogAgents: MJAIAgentEntityExtended[] = [];\n\n public async ngOnInit(): Promise<void> {\n try {\n // AIEngineBase is the live, cached agent catalog. Ensure it's\n // loaded — most app shells warm it up at boot, but the picker\n // could mount before that completes.\n await AIEngineBase.Instance.Config(false);\n this.catalogAgents = (AIEngineBase.Instance.Agents ?? [])\n .filter(a =>\n !a.ParentID &&\n a.Status === 'Active' &&\n a.InvocationMode !== 'Sub-Agent'\n )\n .sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));\n this.applyAllowedAgents();\n } catch (err) {\n LogError(`ConversationAgentPicker.ngOnInit: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n /** Narrows the catalog to the allowed agents. */\n private applyAllowedAgents(): void {\n this.EligibleAgents = this.catalogAgents.filter(a => IsAgentAllowed(a.ID, this._allowedAgentIDs));\n this.cdr.markForCheck();\n }\n\n public get CurrentAgentLabel(): string {\n const id = this.Conversation?.DefaultAgentID;\n if (!id) return 'Auto';\n const match = this.EligibleAgents.find(a => UUIDsEqual(a.ID, id));\n // If the pinned agent is no longer eligible (deactivated, demoted to\n // sub-agent), still surface its name from the cache so the user can\n // see what was pinned even though they can't re-pin it.\n const fromCache = match\n ?? (AIEngineBase.Instance.Agents ?? []).find(a => UUIDsEqual(a.ID, id));\n return fromCache?.Name ?? 'Pinned agent';\n }\n\n public get ButtonTitle(): string {\n return this.Conversation?.DefaultAgentID\n ? `This conversation routes to ${this.CurrentAgentLabel}. Click to change.`\n : 'No agent pinned — messages route via the standard rules. Click to pin an agent.';\n }\n\n public IconClassFor(agent: MJAIAgentEntityExtended): string {\n return agent.IconClass?.trim() || 'fa-solid fa-robot';\n }\n\n public IsSelected(agent: MJAIAgentEntityExtended): boolean {\n return !!this.Conversation?.DefaultAgentID\n && UUIDsEqual(agent.ID, this.Conversation.DefaultAgentID);\n }\n\n public Toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.Disabled || !this.Conversation) return;\n this.IsOpen = !this.IsOpen;\n this.cdr.markForCheck();\n }\n\n public async PickAgent(agent: MJAIAgentEntityExtended | null): Promise<void> {\n this.IsOpen = false;\n const conv = this.Conversation;\n if (!conv) return;\n const newId = agent?.ID ?? null;\n if (conv.DefaultAgentID === newId) {\n this.cdr.markForCheck();\n return;\n }\n const prev = conv.DefaultAgentID;\n conv.DefaultAgentID = newId;\n try {\n const saved = await conv.Save();\n if (!saved) {\n conv.DefaultAgentID = prev;\n this.notifications.CreateSimpleNotification(\n conv.LatestResult?.CompleteMessage ?? 'Failed to update conversation default agent.',\n 'error', 4500);\n return;\n }\n this.AgentChanged.emit(newId);\n } catch (err) {\n conv.DefaultAgentID = prev;\n LogError(`ConversationAgentPicker.PickAgent: ${err instanceof Error ? err.message : String(err)}`);\n } finally {\n this.cdr.markForCheck();\n }\n }\n\n /** Close the menu when the user clicks outside the picker. */\n @HostListener('document:click', ['$event'])\n public OnDocumentClick(_event: MouseEvent): void {\n if (this.IsOpen) {\n this.IsOpen = false;\n this.cdr.markForCheck();\n }\n }\n}\n"]}