@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":"conversation-message-rating.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA6B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAA4B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAc,cAAc,EAAE,MAAM,+BAA+B,CAAC;;;;IA0C7D,uBAAyC;IACzC,+BAAwB;IAAA,YAAqC;IAAA,iBAAO;;;IAA5C,eAAqC;IAArC,qEAAqC;;;IAE7D,uBAA0C;IAC1C,4BAAM;IAAA,6BAAa;IAAA,iBAAO;;;;IAZ9B,iCAMgB;IAFd,sM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AAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,gBAAiB,MAAc,CAAC,YAAY,EAAE,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YACpD,OAAO,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;QACpE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAC9C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;YACpC,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;4HA9LU,kCAAkC;6DAAlC,kCAAkC;YA1FzC,AADF,8BAA8B,aACH;YAiBrB,AAhBF,uGAAe,+EAgByB;YAQ5C,AADE,iBAAM,EACF;;YAxBF,eAsBC;YAtBD,0EAsBC;;;iFAmEI,kCAAkC;cA/F9C,SAAS;6BACI,KAAK,YACP,gCAAgC,YAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;;kBAiEA,KAAK;;kBACL,KAAK;;kBAQL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kFA9BK,kCAAkC","sourcesContent":["import { Component, Input, OnInit, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { BaseEntity, CompositeKey, RunView, UserInfo } from '@memberjunction/core';\nimport { RatingJSON, UserInfoEngine } from '@memberjunction/core-entities';\nimport { DialogService } from '../../services/dialog.service';\n\nconst FEEDBACK_CONSENT_KEY = 'agent-feedback-share-consent';\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nconst FEEDBACK_ROLE_IDS = [\n 'deafccec-6a37-ef11-86d4-000d3a4e707e', // Developer\n 'dfafccec-6a37-ef11-86d4-000d3a4e707e' // Integration\n];\n\n/** Minimal shape we use against the loaded entity. All MJ entity subclasses\n * implement `Load(ID)` via codegen but the base `BaseEntity<unknown>` type\n * doesn't expose it, so we narrow here to keep the call generic across\n * entity names without resorting to `any`. */\ntype LoadableEntity = BaseEntity<unknown> & {\n Load(KeyValuePairs: CompositeKey | string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;\n};\n\n/**\n * Single-rating-per-message rating UI for an AI conversation response.\n *\n * Storage model: the rating + free-form comment live directly on the\n * ConversationDetail row, in `UserRating` (1-10, nullable) and `UserFeedback`\n * (nvarchar(max), nullable). This matches MJ's own pattern on\n * `__mj.ConversationDetail` and Skip's matching columns on\n * `Skip.ConversationDetail`. The host app picks the entity via @Input.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-message-rating',\n template: `\n <div class=\"rating-container\">\n <div class=\"user-rating\">\n @if (canEdit) {\n <button\n class=\"rating-button\"\n [class.has-rated]=\"currentUserRating != null\"\n [disabled]=\"isSaving\"\n (click)=\"OpenRatingDialog()\"\n [title]=\"currentUserRating != null ? 'Edit your rating' : 'Rate this response'\"\n type=\"button\">\n @if (currentUserRating != null) {\n <i class=\"fa-solid fa-pen-to-square\"></i>\n <span class=\"my-rating\">My rating: {{ currentUserRating }}/10</span>\n } @else {\n <i class=\"fa-regular fa-comment-dots\"></i>\n <span>Rate response</span>\n }\n </button>\n } @else if (currentUserRating != null) {\n <span class=\"rating-readonly\"\n title=\"Rating left by the conversation owner — read-only\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <span>Rated {{ currentUserRating }}/10</span>\n </span>\n }\n </div>\n </div>\n `,\n styles: [`\n .rating-container {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 4px 0;\n }\n\n .user-rating {\n display: flex;\n gap: 4px;\n margin-left: auto;\n }\n\n .rating-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n padding: 6px 12px;\n cursor: pointer;\n font-size: 13px;\n color: var(--mj-text-primary);\n opacity: 0.85;\n transition: all 0.15s ease;\n }\n\n .rating-button:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n }\n\n .rating-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .rating-button.has-rated {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n }\n\n .my-rating {\n font-weight: 500;\n }\n\n .rating-readonly {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 12px;\n color: var(--mj-text-secondary);\n background: var(--mj-bg-surface-sunken);\n cursor: default;\n }\n `]\n})\nexport class ConversationMessageRatingComponent extends BaseAngularComponent implements OnInit {\n @Input() conversationDetailId!: string;\n @Input() currentUser!: UserInfo;\n\n /**\n * When false, the rating UI renders as a read-only badge instead of an editable\n * button. Set by the parent (MessageItemComponent) to `false` when the current\n * user is not the conversation owner — the rating storage is a single field on\n * the ConversationDetail row, so only the owner is allowed to mutate it.\n */\n @Input() canEdit: boolean = true;\n\n /**\n * Entity name to load/update for the rating. Defaults to MJ's\n * `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).\n * Skip-Brain hosts pass `'Conversation Details__Skip'`.\n */\n @Input() ratingEntityName: string = 'MJ: Conversation Details';\n\n /** Column on the entity that stores the 1-10 rating. */\n @Input() ratingField: string = 'UserRating';\n\n /** Column on the entity that stores the free-form feedback. */\n @Input() ratingCommentField: string = 'UserFeedback';\n\n /**\n * Optional: legacy pre-loaded ratings array (no longer used by storage; kept\n * to preserve the input shape used by existing call sites like\n * MessageItemComponent).\n */\n @Input() ratingsData?: RatingJSON[];\n\n currentUserRating: number | null = null;\n currentUserComments: string = '';\n isSaving = false;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private dialogService: DialogService\n ) {\n super();\n }\n\n async ngOnInit() {\n await this.loadRating();\n }\n\n async OpenRatingDialog(): Promise<void> {\n if (this.isSaving) return;\n if (!this.canEdit) return;\n\n let consentAcknowledged = false;\n try {\n await UserInfoEngine.Instance.Config();\n consentAcknowledged = UserInfoEngine.Instance.GetSetting(FEEDBACK_CONSENT_KEY) === 'true';\n } catch (e) {\n console.warn('[Rating] Could not read consent flag, will require acknowledgement', e);\n }\n\n const result = await this.dialogService.rating({\n title: this.currentUserRating != null ? 'Edit your rating' : 'Rate this response',\n message: 'Rate the response on a 1-10 scale and (optionally) describe what was good or bad.',\n initialRating: this.currentUserRating,\n initialComments: this.currentUserComments,\n okText: 'Submit',\n requireConsent: !consentAcknowledged\n });\n\n if (result == null) return;\n\n const conversationID = await this.saveRating(result.rating, result.comments);\n\n if (result.consentNewlyAcknowledged) {\n try {\n const saved = await UserInfoEngine.Instance.SetSetting(FEEDBACK_CONSENT_KEY, 'true');\n if (!saved) {\n console.error(\n `[Rating] Failed to persist consent acknowledgement under key \"${FEEDBACK_CONSENT_KEY}\" — ` +\n `the dialog will re-prompt on next rating. Likely cause: the current user lacks ` +\n `create/update permission on the \"MJ: User Settings\" entity.`\n );\n }\n } catch (e) {\n console.error('[Rating] Could not persist consent flag', e);\n }\n }\n\n if (conversationID) {\n await this.grantConversationAccess(conversationID);\n }\n }\n\n /**\n * Grants the Integrations and Developer roles View access to the parent\n * Conversation via `MJ: Resource Permissions`. Idempotent — existing\n * permissions for the same role are not duplicated. Best-effort; any error\n * is logged but does not roll back the rating itself.\n */\n private async grantConversationAccess(conversationID: string): Promise<void> {\n try {\n const md = this.ProviderToUse;\n const rv = RunView.FromMetadataProvider(md);\n const existing = await rv.RunView({\n EntityName: 'MJ: Resource Permissions',\n ExtraFilter:\n `ResourceTypeID='${CONVERSATIONS_RESOURCE_TYPE_ID}' AND ` +\n `ResourceRecordID='${conversationID}' AND Type='Role' AND ` +\n `RoleID IN ('${FEEDBACK_ROLE_IDS.join(\"','\")}')`\n });\n\n const granted = new Set<string>(\n (existing.Results || []).map((r: any) => (r.RoleID || '').toLowerCase())\n );\n\n for (const roleID of FEEDBACK_ROLE_IDS) {\n if (granted.has(roleID.toLowerCase())) continue;\n const perm = await md.GetEntityObject('MJ: Resource Permissions');\n perm.NewRecord();\n perm.Set('ResourceTypeID', CONVERSATIONS_RESOURCE_TYPE_ID);\n perm.Set('ResourceRecordID', conversationID);\n perm.Set('Type', 'Role');\n perm.Set('RoleID', roleID);\n perm.Set('PermissionLevel', 'View');\n perm.Set('Status', 'Approved');\n const ok = await perm.Save();\n if (!ok) {\n console.warn('[Rating] Failed to create ResourcePermission for role', roleID, (perm as any).LatestResult);\n }\n }\n } catch (e) {\n console.warn('[Rating] grantConversationAccess failed:', e);\n }\n }\n\n private async loadRating(): Promise<void> {\n if (!this.conversationDetailId) return;\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.ratingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.conversationDetailId);\n if (loaded) {\n const rating = entity.Get(this.ratingField);\n this.currentUserRating = rating != null ? Number(rating) : null;\n this.currentUserComments = (entity.Get(this.ratingCommentField) ?? '') as string;\n this.cdr.detectChanges();\n }\n } catch (error) {\n // Silently swallow — message may not be persisted yet, or entity lookup failed.\n console.warn('[ConversationMessageRating] Could not load existing rating:', error);\n }\n }\n\n private async saveRating(rating: number, comments: string): Promise<string | null> {\n if (this.isSaving) return null;\n if (rating < 1 || rating > 10) return null;\n if (!this.conversationDetailId) return null;\n\n const prevRating = this.currentUserRating;\n const prevComments = this.currentUserComments;\n\n this.isSaving = true;\n this.currentUserRating = rating;\n this.currentUserComments = comments;\n this.cdr.detectChanges();\n\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.ratingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.conversationDetailId);\n if (!loaded) {\n throw new Error(`ConversationDetail ${this.conversationDetailId} not found in ${this.ratingEntityName}`);\n }\n entity.Set(this.ratingField, rating);\n entity.Set(this.ratingCommentField, comments || null);\n const saveResult = await entity.Save();\n if (!saveResult) {\n throw new Error(`Save failed: ${(entity as any).LatestResult?.Message ?? 'unknown'}`);\n }\n const conversationID = entity.Get('ConversationID');\n return typeof conversationID === 'string' ? conversationID : null;\n } catch (error) {\n console.error('[Rating] save failed:', error);\n this.currentUserRating = prevRating;\n this.currentUserComments = prevComments;\n this.cdr.detectChanges();\n return null;\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"conversation-message-rating.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA6B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAA4B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAc,cAAc,EAAE,MAAM,+BAA+B,CAAC;;;;IA0C7D,uBAAyC;IACzC,+BAAwB;IAAA,YAAqC;IAAA,iBAAO;;;IAA5C,eAAqC;IAArC,qEAAqC;;;IAE7D,uBAA0C;IAC1C,4BAAM;IAAA,6BAAa;IAAA,iBAAO;;;;IAZ9B,iCAMgB;IAFd,sMAAS,yBAAkB,KAAC;IAM1B,AAHF,wGAAiC,kFAGxB;IAIX,iBAAS;;;IAZP,6DAA6C;IAG7C,A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F,eAsBC;YAtBD,0EAsBC;;;iFAmEI,kCAAkC;cA/F9C,SAAS;6BACI,KAAK,YACP,gCAAgC,YAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;;kBAiEA,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAcL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBAaL,KAAK;;kBAGL,KAAK;;kFA9EK,kCAAkC","sourcesContent":["import { Component, Input, OnInit, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { BaseEntity, CompositeKey, RunView, UserInfo } from '@memberjunction/core';\nimport { RatingJSON, UserInfoEngine } from '@memberjunction/core-entities';\nimport { DialogService } from '../../services/dialog.service';\n\nconst FEEDBACK_CONSENT_KEY = 'agent-feedback-share-consent';\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nconst FEEDBACK_ROLE_IDS = [\n 'deafccec-6a37-ef11-86d4-000d3a4e707e', // Developer\n 'dfafccec-6a37-ef11-86d4-000d3a4e707e' // Integration\n];\n\n/** Minimal shape we use against the loaded entity. All MJ entity subclasses\n * implement `Load(ID)` via codegen but the base `BaseEntity<unknown>` type\n * doesn't expose it, so we narrow here to keep the call generic across\n * entity names without resorting to `any`. */\ntype LoadableEntity = BaseEntity<unknown> & {\n Load(KeyValuePairs: CompositeKey | string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;\n};\n\n/**\n * Single-rating-per-message rating UI for an AI conversation response.\n *\n * Storage model: the rating + free-form comment live directly on the\n * ConversationDetail row, in `UserRating` (1-10, nullable) and `UserFeedback`\n * (nvarchar(max), nullable). This matches MJ's own pattern on\n * `__mj.ConversationDetail` and Skip's matching columns on\n * `Skip.ConversationDetail`. The host app picks the entity via @Input.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-message-rating',\n template: `\n <div class=\"rating-container\">\n <div class=\"user-rating\">\n @if (canEdit) {\n <button\n class=\"rating-button\"\n [class.has-rated]=\"currentUserRating != null\"\n [disabled]=\"isSaving\"\n (click)=\"OpenRatingDialog()\"\n [title]=\"currentUserRating != null ? 'Edit your rating' : 'Rate this response'\"\n type=\"button\">\n @if (currentUserRating != null) {\n <i class=\"fa-solid fa-pen-to-square\"></i>\n <span class=\"my-rating\">My rating: {{ currentUserRating }}/10</span>\n } @else {\n <i class=\"fa-regular fa-comment-dots\"></i>\n <span>Rate response</span>\n }\n </button>\n } @else if (currentUserRating != null) {\n <span class=\"rating-readonly\"\n title=\"Rating left by the conversation owner — read-only\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <span>Rated {{ currentUserRating }}/10</span>\n </span>\n }\n </div>\n </div>\n `,\n styles: [`\n .rating-container {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 4px 0;\n }\n\n .user-rating {\n display: flex;\n gap: 4px;\n margin-left: auto;\n }\n\n .rating-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n padding: 6px 12px;\n cursor: pointer;\n font-size: 13px;\n color: var(--mj-text-primary);\n opacity: 0.85;\n transition: all 0.15s ease;\n }\n\n .rating-button:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n }\n\n .rating-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .rating-button.has-rated {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n }\n\n .my-rating {\n font-weight: 500;\n }\n\n .rating-readonly {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 12px;\n color: var(--mj-text-secondary);\n background: var(--mj-bg-surface-sunken);\n cursor: default;\n }\n `]\n})\nexport class ConversationMessageRatingComponent extends BaseAngularComponent implements OnInit {\n @Input() ConversationDetailId!: string;\n\n /** @deprecated Use {@link ConversationDetailId}. */\n @Input() set conversationDetailId(value: string) {\n this.ConversationDetailId = value;\n }\n /** @deprecated Use {@link ConversationDetailId}. */\n get conversationDetailId(): string {\n return this.ConversationDetailId;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n\n /**\n * When false, the rating UI renders as a read-only badge instead of an editable\n * button. Set by the parent (MessageItemComponent) to `false` when the current\n * user is not the conversation owner — the rating storage is a single field on\n * the ConversationDetail row, so only the owner is allowed to mutate it.\n */\n @Input() canEdit: boolean = true;\n\n /**\n * Entity name to load/update for the rating. Defaults to MJ's\n * `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).\n * Skip-Brain hosts pass `'Conversation Details__Skip'`.\n */\n @Input() RatingEntityName: string = 'MJ: Conversation Details';\n\n /** @deprecated Use {@link RatingEntityName}. */\n @Input() set ratingEntityName(value: string) {\n this.RatingEntityName = value;\n }\n /** @deprecated Use {@link RatingEntityName}. */\n get ratingEntityName(): string {\n return this.RatingEntityName;\n }\n\n /** Column on the entity that stores the 1-10 rating. */\n @Input() RatingField: string = 'UserRating';\n\n /** @deprecated Use {@link RatingField}. */\n @Input() set ratingField(value: string) {\n this.RatingField = value;\n }\n /** @deprecated Use {@link RatingField}. */\n get ratingField(): string {\n return this.RatingField;\n }\n\n /** Column on the entity that stores the free-form feedback. */\n @Input() RatingCommentField: string = 'UserFeedback';\n\n /** @deprecated Use {@link RatingCommentField}. */\n @Input() set ratingCommentField(value: string) {\n this.RatingCommentField = value;\n }\n /** @deprecated Use {@link RatingCommentField}. */\n get ratingCommentField(): string {\n return this.RatingCommentField;\n }\n\n /**\n * Optional: legacy pre-loaded ratings array (no longer used by storage; kept\n * to preserve the input shape used by existing call sites like\n * MessageItemComponent).\n */\n @Input() RatingsData?: RatingJSON[];\n\n /** @deprecated Use {@link RatingsData}. */\n @Input() set ratingsData(value: RatingJSON[] | undefined) {\n this.RatingsData = value;\n }\n /** @deprecated Use {@link RatingsData}. */\n get ratingsData(): RatingJSON[] | undefined {\n return this.RatingsData;\n }\n\n CurrentUserRating: number | null = null;\n\n /** @deprecated Use {@link CurrentUserRating}. */\n get currentUserRating(): number | null {\n return this.CurrentUserRating;\n }\n /** @deprecated Use {@link CurrentUserRating}. */\n set currentUserRating(value: number | null) {\n this.CurrentUserRating = value;\n }\n CurrentUserComments: string = '';\n\n /** @deprecated Use {@link CurrentUserComments}. */\n get currentUserComments(): string {\n return this.CurrentUserComments;\n }\n /** @deprecated Use {@link CurrentUserComments}. */\n set currentUserComments(value: string) {\n this.CurrentUserComments = value;\n }\n IsSaving = false;\n\n /** @deprecated Use {@link IsSaving}. */\n get isSaving() {\n return this.IsSaving;\n }\n /** @deprecated Use {@link IsSaving}. */\n set isSaving(value) {\n this.IsSaving = value;\n }\n\n constructor(\n private cdr: ChangeDetectorRef,\n private dialogService: DialogService\n ) {\n super();\n }\n\n async ngOnInit() {\n await this.loadRating();\n }\n\n async OpenRatingDialog(): Promise<void> {\n if (this.IsSaving) return;\n if (!this.canEdit) return;\n\n let consentAcknowledged = false;\n try {\n await UserInfoEngine.Instance.Config();\n consentAcknowledged = UserInfoEngine.Instance.GetSetting(FEEDBACK_CONSENT_KEY) === 'true';\n } catch (e) {\n console.warn('[Rating] Could not read consent flag, will require acknowledgement', e);\n }\n\n const result = await this.dialogService.rating({\n title: this.CurrentUserRating != null ? 'Edit your rating' : 'Rate this response',\n message: 'Rate the response on a 1-10 scale and (optionally) describe what was good or bad.',\n initialRating: this.CurrentUserRating,\n initialComments: this.CurrentUserComments,\n okText: 'Submit',\n requireConsent: !consentAcknowledged\n });\n\n if (result == null) return;\n\n const conversationID = await this.saveRating(result.rating, result.comments);\n\n if (result.consentNewlyAcknowledged) {\n try {\n const saved = await UserInfoEngine.Instance.SetSetting(FEEDBACK_CONSENT_KEY, 'true');\n if (!saved) {\n console.error(\n `[Rating] Failed to persist consent acknowledgement under key \"${FEEDBACK_CONSENT_KEY}\" — ` +\n `the dialog will re-prompt on next rating. Likely cause: the current user lacks ` +\n `create/update permission on the \"MJ: User Settings\" entity.`\n );\n }\n } catch (e) {\n console.error('[Rating] Could not persist consent flag', e);\n }\n }\n\n if (conversationID) {\n await this.grantConversationAccess(conversationID);\n }\n }\n\n /**\n * Grants the Integrations and Developer roles View access to the parent\n * Conversation via `MJ: Resource Permissions`. Idempotent — existing\n * permissions for the same role are not duplicated. Best-effort; any error\n * is logged but does not roll back the rating itself.\n */\n private async grantConversationAccess(conversationID: string): Promise<void> {\n try {\n const md = this.ProviderToUse;\n const rv = RunView.FromMetadataProvider(md);\n const existing = await rv.RunView({\n EntityName: 'MJ: Resource Permissions',\n ExtraFilter:\n `ResourceTypeID='${CONVERSATIONS_RESOURCE_TYPE_ID}' AND ` +\n `ResourceRecordID='${conversationID}' AND Type='Role' AND ` +\n `RoleID IN ('${FEEDBACK_ROLE_IDS.join(\"','\")}')`\n });\n\n const granted = new Set<string>(\n (existing.Results || []).map((r: any) => (r.RoleID || '').toLowerCase())\n );\n\n for (const roleID of FEEDBACK_ROLE_IDS) {\n if (granted.has(roleID.toLowerCase())) continue;\n const perm = await md.GetEntityObject('MJ: Resource Permissions');\n perm.NewRecord();\n perm.Set('ResourceTypeID', CONVERSATIONS_RESOURCE_TYPE_ID);\n perm.Set('ResourceRecordID', conversationID);\n perm.Set('Type', 'Role');\n perm.Set('RoleID', roleID);\n perm.Set('PermissionLevel', 'View');\n perm.Set('Status', 'Approved');\n const ok = await perm.Save();\n if (!ok) {\n console.warn('[Rating] Failed to create ResourcePermission for role', roleID, (perm as any).LatestResult);\n }\n }\n } catch (e) {\n console.warn('[Rating] grantConversationAccess failed:', e);\n }\n }\n\n private async loadRating(): Promise<void> {\n if (!this.ConversationDetailId) return;\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.RatingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.ConversationDetailId);\n if (loaded) {\n const rating = entity.Get(this.RatingField);\n this.CurrentUserRating = rating != null ? Number(rating) : null;\n this.CurrentUserComments = (entity.Get(this.RatingCommentField) ?? '') as string;\n this.cdr.detectChanges();\n }\n } catch (error) {\n // Silently swallow — message may not be persisted yet, or entity lookup failed.\n console.warn('[ConversationMessageRating] Could not load existing rating:', error);\n }\n }\n\n private async saveRating(rating: number, comments: string): Promise<string | null> {\n if (this.IsSaving) return null;\n if (rating < 1 || rating > 10) return null;\n if (!this.ConversationDetailId) return null;\n\n const prevRating = this.CurrentUserRating;\n const prevComments = this.CurrentUserComments;\n\n this.IsSaving = true;\n this.CurrentUserRating = rating;\n this.CurrentUserComments = comments;\n this.cdr.detectChanges();\n\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.RatingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.ConversationDetailId);\n if (!loaded) {\n throw new Error(`ConversationDetail ${this.ConversationDetailId} not found in ${this.RatingEntityName}`);\n }\n entity.Set(this.RatingField, rating);\n entity.Set(this.RatingCommentField, comments || null);\n const saveResult = await entity.Save();\n if (!saveResult) {\n throw new Error(`Save failed: ${(entity as any).LatestResult?.Message ?? 'unknown'}`);\n }\n const conversationID = entity.Get('ConversationID');\n return typeof conversationID === 'string' ? conversationID : null;\n } catch (error) {\n console.error('[Rating] save failed:', error);\n this.CurrentUserRating = prevRating;\n this.CurrentUserComments = prevComments;\n this.cdr.detectChanges();\n return null;\n } finally {\n this.IsSaving = false;\n this.cdr.detectChanges();\n }\n }\n}\n"]}