@memberjunction/ng-conversations 5.43.0 → 5.44.0

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/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +0 -1
  2. package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
  3. package/dist/lib/components/active-tasks/active-tasks-panel.component.js +56 -52
  4. package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
  5. package/dist/lib/components/artifact/artifact-share-modal.component.js +37 -41
  6. package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
  7. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  8. package/dist/lib/components/collection/collection-form-modal.component.js +10 -14
  9. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  10. package/dist/lib/components/collection/collection-share-modal.component.js +41 -45
  11. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
  12. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  13. package/dist/lib/components/collection/collection-view.component.js +22 -36
  14. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  15. package/dist/lib/components/collection/collections-full-view.component.d.ts +4 -0
  16. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  17. package/dist/lib/components/collection/collections-full-view.component.js +134 -166
  18. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  19. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +73 -8
  20. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  21. package/dist/lib/components/conversation/conversation-chat-area.component.js +487 -123
  22. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  23. package/dist/lib/components/conversation/pinned-messages-panel.component.js +6 -9
  24. package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
  25. package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
  26. package/dist/lib/components/library/library-full-view.component.js +20 -24
  27. package/dist/lib/components/library/library-full-view.component.js.map +1 -1
  28. package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
  29. package/dist/lib/components/members/members-modal.component.js +10 -11
  30. package/dist/lib/components/members/members-modal.component.js.map +1 -1
  31. package/dist/lib/components/mention/mention-dropdown.component.js +49 -28
  32. package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
  33. package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
  34. package/dist/lib/components/mention/mention-editor.component.js +24 -10
  35. package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
  36. package/dist/lib/components/message/message-input-box.component.d.ts +11 -16
  37. package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
  38. package/dist/lib/components/message/message-input-box.component.js +52 -46
  39. package/dist/lib/components/message/message-input-box.component.js.map +1 -1
  40. package/dist/lib/components/message/message-input.component.d.ts +83 -18
  41. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  42. package/dist/lib/components/message/message-input.component.js +238 -151
  43. package/dist/lib/components/message/message-input.component.js.map +1 -1
  44. package/dist/lib/components/message/message-item.component.d.ts +10 -1
  45. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  46. package/dist/lib/components/message/message-item.component.js +67 -15
  47. package/dist/lib/components/message/message-item.component.js.map +1 -1
  48. package/dist/lib/components/message/message-list.component.js +6 -9
  49. package/dist/lib/components/message/message-list.component.js.map +1 -1
  50. package/dist/lib/components/overlay/chat-overlay.component.d.ts +3 -0
  51. package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
  52. package/dist/lib/components/overlay/chat-overlay.component.js +9 -4
  53. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  54. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +45 -0
  55. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -1
  56. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +10 -0
  57. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -1
  58. package/dist/lib/components/realtime/channels/client-context-channel.d.ts +46 -0
  59. package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -0
  60. package/dist/lib/components/realtime/channels/client-context-channel.js +174 -0
  61. package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -0
  62. package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts +123 -0
  63. package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts.map +1 -0
  64. package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js +397 -0
  65. package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js.map +1 -0
  66. package/dist/lib/components/realtime/media/media-channel-state.d.ts +103 -0
  67. package/dist/lib/components/realtime/media/media-channel-state.d.ts.map +1 -0
  68. package/dist/lib/components/realtime/media/media-channel-state.js +143 -0
  69. package/dist/lib/components/realtime/media/media-channel-state.js.map +1 -0
  70. package/dist/lib/components/realtime/media/media-channel-tools.d.ts +24 -0
  71. package/dist/lib/components/realtime/media/media-channel-tools.d.ts.map +1 -0
  72. package/dist/lib/components/realtime/media/media-channel-tools.js +107 -0
  73. package/dist/lib/components/realtime/media/media-channel-tools.js.map +1 -0
  74. package/dist/lib/components/realtime/media/media-channel.d.ts +89 -0
  75. package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -0
  76. package/dist/lib/components/realtime/media/media-channel.js +253 -0
  77. package/dist/lib/components/realtime/media/media-channel.js.map +1 -0
  78. package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts +141 -0
  79. package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts.map +1 -0
  80. package/dist/lib/components/realtime/media/realtime-media-surface.component.js +574 -0
  81. package/dist/lib/components/realtime/media/realtime-media-surface.component.js.map +1 -0
  82. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +59 -14
  83. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
  84. package/dist/lib/components/realtime/realtime-activity-rail.component.js +277 -74
  85. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  86. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +28 -27
  87. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
  88. package/dist/lib/components/realtime/realtime-agent-banner.component.js +144 -143
  89. package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
  90. package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +12 -0
  91. package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
  92. package/dist/lib/components/realtime/realtime-agent-picker.component.js +105 -43
  93. package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
  94. package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +2 -2
  95. package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -1
  96. package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -1
  97. package/dist/lib/components/realtime/realtime-composer.component.d.ts +41 -7
  98. package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
  99. package/dist/lib/components/realtime/realtime-composer.component.js +216 -102
  100. package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
  101. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +0 -2
  102. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
  103. package/dist/lib/components/realtime/realtime-delegation-card.component.js +67 -71
  104. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  105. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +364 -44
  106. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
  107. package/dist/lib/components/realtime/realtime-session-overlay.component.js +839 -153
  108. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  109. package/dist/lib/components/realtime/realtime-session-state.d.ts +5 -5
  110. package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
  111. package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
  112. package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts +70 -0
  113. package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts.map +1 -0
  114. package/dist/lib/components/realtime/realtime-surface-tab-style.js +115 -0
  115. package/dist/lib/components/realtime/realtime-surface-tab-style.js.map +1 -0
  116. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +55 -57
  117. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
  118. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +165 -143
  119. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  120. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +80 -71
  121. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
  122. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +83 -113
  123. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  124. package/dist/lib/components/realtime/realtime-ui-config.d.ts +270 -0
  125. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -0
  126. package/dist/lib/components/realtime/realtime-ui-config.js +212 -0
  127. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -0
  128. package/dist/lib/components/search/search-panel.component.d.ts +2 -0
  129. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  130. package/dist/lib/components/search/search-panel.component.js +92 -101
  131. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  132. package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
  133. package/dist/lib/components/share/share-modal.component.js +10 -11
  134. package/dist/lib/components/share/share-modal.component.js.map +1 -1
  135. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
  136. package/dist/lib/components/shared/user-picker.component.js +12 -15
  137. package/dist/lib/components/shared/user-picker.component.js.map +1 -1
  138. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +5 -0
  139. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  140. package/dist/lib/components/workspace/conversation-workspace.component.js +18 -7
  141. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  142. package/dist/lib/conversations.module.d.ts +29 -26
  143. package/dist/lib/conversations.module.d.ts.map +1 -1
  144. package/dist/lib/conversations.module.js +37 -6
  145. package/dist/lib/conversations.module.js.map +1 -1
  146. package/dist/lib/models/conversation-state.model.d.ts +6 -3
  147. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  148. package/dist/lib/models/conversation-state.model.js.map +1 -1
  149. package/dist/lib/services/conversation-agent.service.d.ts +2 -2
  150. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  151. package/dist/lib/services/conversation-agent.service.js +6 -2
  152. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  153. package/dist/lib/services/mention-autocomplete.service.d.ts +17 -1
  154. package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
  155. package/dist/lib/services/mention-autocomplete.service.js +58 -2
  156. package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
  157. package/dist/lib/services/realtime-audio-recorder.d.ts +143 -0
  158. package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -0
  159. package/dist/lib/services/realtime-audio-recorder.js +379 -0
  160. package/dist/lib/services/realtime-audio-recorder.js.map +1 -0
  161. package/dist/lib/services/realtime-pcm-wav.d.ts +75 -0
  162. package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -0
  163. package/dist/lib/services/realtime-pcm-wav.js +205 -0
  164. package/dist/lib/services/realtime-pcm-wav.js.map +1 -0
  165. package/dist/lib/services/realtime-session-review.service.d.ts +28 -1
  166. package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
  167. package/dist/lib/services/realtime-session-review.service.js +12 -3
  168. package/dist/lib/services/realtime-session-review.service.js.map +1 -1
  169. package/dist/lib/services/realtime-session.service.d.ts +210 -20
  170. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  171. package/dist/lib/services/realtime-session.service.js +452 -21
  172. package/dist/lib/services/realtime-session.service.js.map +1 -1
  173. package/dist/lib/services/realtime-sessions-adapter.js +1 -1
  174. package/dist/lib/services/realtime-sessions-adapter.js.map +1 -1
  175. package/dist/lib/services/ui-command-handler.service.d.ts +7 -2
  176. package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
  177. package/dist/lib/services/ui-command-handler.service.js +6 -2
  178. package/dist/lib/services/ui-command-handler.service.js.map +1 -1
  179. package/dist/lib/utils/plan-mode-preference.d.ts +62 -0
  180. package/dist/lib/utils/plan-mode-preference.d.ts.map +1 -0
  181. package/dist/lib/utils/plan-mode-preference.js +130 -0
  182. package/dist/lib/utils/plan-mode-preference.js.map +1 -0
  183. package/dist/public-api.d.ts +6 -0
  184. package/dist/public-api.d.ts.map +1 -1
  185. package/dist/public-api.js +8 -0
  186. package/dist/public-api.js.map +1 -1
  187. package/package.json +28 -26
  188. package/dist/__tests__/attachment-badge.test.d.ts +0 -2
  189. package/dist/__tests__/attachment-badge.test.d.ts.map +0 -1
  190. package/dist/__tests__/attachment-badge.test.js +0 -66
  191. package/dist/__tests__/attachment-badge.test.js.map +0 -1
  192. package/dist/__tests__/channel-optional-surface.test.d.ts +0 -2
  193. package/dist/__tests__/channel-optional-surface.test.d.ts.map +0 -1
  194. package/dist/__tests__/channel-optional-surface.test.js +0 -53
  195. package/dist/__tests__/channel-optional-surface.test.js.map +0 -1
  196. package/dist/__tests__/chat-events.test.d.ts +0 -14
  197. package/dist/__tests__/chat-events.test.d.ts.map +0 -1
  198. package/dist/__tests__/chat-events.test.js +0 -109
  199. package/dist/__tests__/chat-events.test.js.map +0 -1
  200. package/dist/__tests__/collections-full-view.test.d.ts +0 -2
  201. package/dist/__tests__/collections-full-view.test.d.ts.map +0 -1
  202. package/dist/__tests__/collections-full-view.test.js +0 -225
  203. package/dist/__tests__/collections-full-view.test.js.map +0 -1
  204. package/dist/__tests__/conversation-cache.test.d.ts +0 -2
  205. package/dist/__tests__/conversation-cache.test.d.ts.map +0 -1
  206. package/dist/__tests__/conversation-cache.test.js +0 -233
  207. package/dist/__tests__/conversation-cache.test.js.map +0 -1
  208. package/dist/__tests__/conversation-naming.test.d.ts +0 -2
  209. package/dist/__tests__/conversation-naming.test.d.ts.map +0 -1
  210. package/dist/__tests__/conversation-naming.test.js +0 -110
  211. package/dist/__tests__/conversation-naming.test.js.map +0 -1
  212. package/dist/__tests__/delegation-result-parser.test.d.ts +0 -2
  213. package/dist/__tests__/delegation-result-parser.test.d.ts.map +0 -1
  214. package/dist/__tests__/delegation-result-parser.test.js +0 -107
  215. package/dist/__tests__/delegation-result-parser.test.js.map +0 -1
  216. package/dist/__tests__/distinct-artifacts.test.d.ts +0 -2
  217. package/dist/__tests__/distinct-artifacts.test.d.ts.map +0 -1
  218. package/dist/__tests__/distinct-artifacts.test.js +0 -56
  219. package/dist/__tests__/distinct-artifacts.test.js.map +0 -1
  220. package/dist/__tests__/event-wiring.test.d.ts +0 -15
  221. package/dist/__tests__/event-wiring.test.d.ts.map +0 -1
  222. package/dist/__tests__/event-wiring.test.js +0 -100
  223. package/dist/__tests__/event-wiring.test.js.map +0 -1
  224. package/dist/__tests__/index.test.d.ts +0 -2
  225. package/dist/__tests__/index.test.d.ts.map +0 -1
  226. package/dist/__tests__/index.test.js +0 -7
  227. package/dist/__tests__/index.test.js.map +0 -1
  228. package/dist/__tests__/narration-template.test.d.ts +0 -2
  229. package/dist/__tests__/narration-template.test.d.ts.map +0 -1
  230. package/dist/__tests__/narration-template.test.js +0 -76
  231. package/dist/__tests__/narration-template.test.js.map +0 -1
  232. package/dist/__tests__/notification-model.test.d.ts +0 -2
  233. package/dist/__tests__/notification-model.test.d.ts.map +0 -1
  234. package/dist/__tests__/notification-model.test.js +0 -68
  235. package/dist/__tests__/notification-model.test.js.map +0 -1
  236. package/dist/__tests__/realtime-agent-picker-models.test.d.ts +0 -2
  237. package/dist/__tests__/realtime-agent-picker-models.test.d.ts.map +0 -1
  238. package/dist/__tests__/realtime-agent-picker-models.test.js +0 -49
  239. package/dist/__tests__/realtime-agent-picker-models.test.js.map +0 -1
  240. package/dist/__tests__/realtime-audio-visuals.test.d.ts +0 -2
  241. package/dist/__tests__/realtime-audio-visuals.test.d.ts.map +0 -1
  242. package/dist/__tests__/realtime-audio-visuals.test.js +0 -123
  243. package/dist/__tests__/realtime-audio-visuals.test.js.map +0 -1
  244. package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts +0 -2
  245. package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts.map +0 -1
  246. package/dist/__tests__/realtime-delegation-card-cancel.test.js +0 -48
  247. package/dist/__tests__/realtime-delegation-card-cancel.test.js.map +0 -1
  248. package/dist/__tests__/realtime-disclosure.test.d.ts +0 -2
  249. package/dist/__tests__/realtime-disclosure.test.d.ts.map +0 -1
  250. package/dist/__tests__/realtime-disclosure.test.js +0 -164
  251. package/dist/__tests__/realtime-disclosure.test.js.map +0 -1
  252. package/dist/__tests__/realtime-pairing.test.d.ts +0 -2
  253. package/dist/__tests__/realtime-pairing.test.d.ts.map +0 -1
  254. package/dist/__tests__/realtime-pairing.test.js +0 -207
  255. package/dist/__tests__/realtime-pairing.test.js.map +0 -1
  256. package/dist/__tests__/realtime-review-lifecycle.test.d.ts +0 -2
  257. package/dist/__tests__/realtime-review-lifecycle.test.d.ts.map +0 -1
  258. package/dist/__tests__/realtime-review-lifecycle.test.js +0 -154
  259. package/dist/__tests__/realtime-review-lifecycle.test.js.map +0 -1
  260. package/dist/__tests__/realtime-session-cancel-usage.test.d.ts +0 -2
  261. package/dist/__tests__/realtime-session-cancel-usage.test.d.ts.map +0 -1
  262. package/dist/__tests__/realtime-session-cancel-usage.test.js +0 -230
  263. package/dist/__tests__/realtime-session-cancel-usage.test.js.map +0 -1
  264. package/dist/__tests__/realtime-session-channels.test.d.ts +0 -2
  265. package/dist/__tests__/realtime-session-channels.test.d.ts.map +0 -1
  266. package/dist/__tests__/realtime-session-channels.test.js +0 -252
  267. package/dist/__tests__/realtime-session-channels.test.js.map +0 -1
  268. package/dist/__tests__/realtime-session-client-tools.test.d.ts +0 -2
  269. package/dist/__tests__/realtime-session-client-tools.test.d.ts.map +0 -1
  270. package/dist/__tests__/realtime-session-client-tools.test.js +0 -103
  271. package/dist/__tests__/realtime-session-client-tools.test.js.map +0 -1
  272. package/dist/__tests__/realtime-session-minimized.test.d.ts +0 -2
  273. package/dist/__tests__/realtime-session-minimized.test.d.ts.map +0 -1
  274. package/dist/__tests__/realtime-session-minimized.test.js +0 -32
  275. package/dist/__tests__/realtime-session-minimized.test.js.map +0 -1
  276. package/dist/__tests__/realtime-session-mint.test.d.ts +0 -2
  277. package/dist/__tests__/realtime-session-mint.test.d.ts.map +0 -1
  278. package/dist/__tests__/realtime-session-mint.test.js +0 -69
  279. package/dist/__tests__/realtime-session-mint.test.js.map +0 -1
  280. package/dist/__tests__/realtime-session-policy.test.d.ts +0 -2
  281. package/dist/__tests__/realtime-session-policy.test.d.ts.map +0 -1
  282. package/dist/__tests__/realtime-session-policy.test.js +0 -303
  283. package/dist/__tests__/realtime-session-policy.test.js.map +0 -1
  284. package/dist/__tests__/realtime-session-review.service.test.d.ts +0 -2
  285. package/dist/__tests__/realtime-session-review.service.test.d.ts.map +0 -1
  286. package/dist/__tests__/realtime-session-review.service.test.js +0 -743
  287. package/dist/__tests__/realtime-session-review.service.test.js.map +0 -1
  288. package/dist/__tests__/realtime-session-state.test.d.ts +0 -2
  289. package/dist/__tests__/realtime-session-state.test.d.ts.map +0 -1
  290. package/dist/__tests__/realtime-session-state.test.js +0 -83
  291. package/dist/__tests__/realtime-session-state.test.js.map +0 -1
  292. package/dist/__tests__/realtime-session-timeline-card.test.d.ts +0 -2
  293. package/dist/__tests__/realtime-session-timeline-card.test.d.ts.map +0 -1
  294. package/dist/__tests__/realtime-session-timeline-card.test.js +0 -106
  295. package/dist/__tests__/realtime-session-timeline-card.test.js.map +0 -1
  296. package/dist/__tests__/realtime-session-timeline.test.d.ts +0 -2
  297. package/dist/__tests__/realtime-session-timeline.test.d.ts.map +0 -1
  298. package/dist/__tests__/realtime-session-timeline.test.js +0 -142
  299. package/dist/__tests__/realtime-session-timeline.test.js.map +0 -1
  300. package/dist/__tests__/realtime-sessions-adapter.test.d.ts +0 -19
  301. package/dist/__tests__/realtime-sessions-adapter.test.d.ts.map +0 -1
  302. package/dist/__tests__/realtime-sessions-adapter.test.js +0 -188
  303. package/dist/__tests__/realtime-sessions-adapter.test.js.map +0 -1
  304. package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts +0 -2
  305. package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts.map +0 -1
  306. package/dist/__tests__/realtime-surface-panel-prefs.test.js +0 -100
  307. package/dist/__tests__/realtime-surface-panel-prefs.test.js.map +0 -1
  308. package/dist/__tests__/realtime-surface-tabs-model.test.d.ts +0 -2
  309. package/dist/__tests__/realtime-surface-tabs-model.test.d.ts.map +0 -1
  310. package/dist/__tests__/realtime-surface-tabs-model.test.js +0 -193
  311. package/dist/__tests__/realtime-surface-tabs-model.test.js.map +0 -1
  312. package/dist/__tests__/remote-browser-audio-player.test.d.ts +0 -2
  313. package/dist/__tests__/remote-browser-audio-player.test.d.ts.map +0 -1
  314. package/dist/__tests__/remote-browser-audio-player.test.js +0 -137
  315. package/dist/__tests__/remote-browser-audio-player.test.js.map +0 -1
  316. package/dist/__tests__/remote-browser-channel.test.d.ts +0 -2
  317. package/dist/__tests__/remote-browser-channel.test.d.ts.map +0 -1
  318. package/dist/__tests__/remote-browser-channel.test.js +0 -585
  319. package/dist/__tests__/remote-browser-channel.test.js.map +0 -1
  320. package/dist/__tests__/search-service.test.d.ts +0 -2
  321. package/dist/__tests__/search-service.test.d.ts.map +0 -1
  322. package/dist/__tests__/search-service.test.js +0 -114
  323. package/dist/__tests__/search-service.test.js.map +0 -1
  324. package/dist/__tests__/slot-defaults.test.d.ts +0 -24
  325. package/dist/__tests__/slot-defaults.test.d.ts.map +0 -1
  326. package/dist/__tests__/slot-defaults.test.js +0 -63
  327. package/dist/__tests__/slot-defaults.test.js.map +0 -1
  328. package/dist/__tests__/toast-service.test.d.ts +0 -2
  329. package/dist/__tests__/toast-service.test.d.ts.map +0 -1
  330. package/dist/__tests__/toast-service.test.js +0 -143
  331. package/dist/__tests__/toast-service.test.js.map +0 -1
  332. package/dist/__tests__/user-authorization.test.d.ts +0 -2
  333. package/dist/__tests__/user-authorization.test.d.ts.map +0 -1
  334. package/dist/__tests__/user-authorization.test.js +0 -97
  335. package/dist/__tests__/user-authorization.test.js.map +0 -1
  336. package/dist/__tests__/voice-session-narration.test.d.ts +0 -2
  337. package/dist/__tests__/voice-session-narration.test.d.ts.map +0 -1
  338. package/dist/__tests__/voice-session-narration.test.js +0 -609
  339. package/dist/__tests__/voice-session-narration.test.js.map +0 -1
  340. package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts +0 -2
  341. package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts.map +0 -1
  342. package/dist/__tests__/whiteboard-artifact-viewer.test.js +0 -101
  343. package/dist/__tests__/whiteboard-artifact-viewer.test.js.map +0 -1
  344. package/dist/__tests__/whiteboard-channel.test.d.ts +0 -2
  345. package/dist/__tests__/whiteboard-channel.test.d.ts.map +0 -1
  346. package/dist/__tests__/whiteboard-channel.test.js +0 -260
  347. package/dist/__tests__/whiteboard-channel.test.js.map +0 -1
  348. package/dist/__tests__/whiteboard-restore-state.test.d.ts +0 -2
  349. package/dist/__tests__/whiteboard-restore-state.test.d.ts.map +0 -1
  350. package/dist/__tests__/whiteboard-restore-state.test.js +0 -108
  351. package/dist/__tests__/whiteboard-restore-state.test.js.map +0 -1
@@ -1,66 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { ShortBadgeText, BadgeTextForAttachment } from '../lib/util/attachment-badge';
3
- function makeAttachment(overrides) {
4
- return {
5
- id: 'a1',
6
- type: 'Document',
7
- mimeType: 'text/plain',
8
- fileName: null,
9
- sizeBytes: 0,
10
- ...overrides
11
- };
12
- }
13
- describe('ShortBadgeText', () => {
14
- it('returns "FILE" for empty or whitespace-only input', () => {
15
- expect(ShortBadgeText('')).toBe('FILE');
16
- expect(ShortBadgeText(' ')).toBe('FILE');
17
- expect(ShortBadgeText(null)).toBe('FILE');
18
- expect(ShortBadgeText(undefined)).toBe('FILE');
19
- });
20
- it('uppercases names that already fit within 10 characters', () => {
21
- expect(ShortBadgeText('Report')).toBe('REPORT');
22
- expect(ShortBadgeText('Snapshot')).toBe('SNAPSHOT');
23
- expect(ShortBadgeText('json')).toBe('JSON');
24
- });
25
- it('takes the last word when the full name is too long', () => {
26
- expect(ShortBadgeText('Data Snapshot')).toBe('SNAPSHOT');
27
- expect(ShortBadgeText('Business Intelligence Dashboard')).toBe('DASHBOARD');
28
- expect(ShortBadgeText('Skip Report')).toBe('REPORT');
29
- });
30
- it('truncates with ellipsis when the last word is still too long', () => {
31
- expect(ShortBadgeText('Monstrouslylongword')).toBe('MONSTROUS…');
32
- });
33
- it('trims surrounding whitespace before measuring length', () => {
34
- expect(ShortBadgeText(' Report ')).toBe('REPORT');
35
- });
36
- });
37
- describe('BadgeTextForAttachment', () => {
38
- it('prefers the artifact type name over the file extension', () => {
39
- const a = makeAttachment({
40
- artifactTypeName: 'Data Snapshot',
41
- fileName: 'snapshot.json'
42
- });
43
- expect(BadgeTextForAttachment(a)).toBe('SNAPSHOT');
44
- });
45
- it('uses the file extension when no artifact type is present', () => {
46
- expect(BadgeTextForAttachment(makeAttachment({ fileName: 'Q1_deck.pdf' }))).toBe('PDF');
47
- expect(BadgeTextForAttachment(makeAttachment({ fileName: 'data.csv' }))).toBe('CSV');
48
- });
49
- it('uppercases the extension and caps at 10 characters', () => {
50
- expect(BadgeTextForAttachment(makeAttachment({ fileName: 'weird.abcdefghijklmnop' }))).toBe('ABCDEFGHIJ');
51
- });
52
- it('falls back to the mime subtype when the filename has no extension', () => {
53
- expect(BadgeTextForAttachment(makeAttachment({ fileName: 'noext', mimeType: 'application/pdf' }))).toBe('PDF');
54
- });
55
- it('strips mime parameters (e.g. charset) before using as a fallback', () => {
56
- expect(BadgeTextForAttachment(makeAttachment({ fileName: null, mimeType: 'text/plain; charset=utf-8' }))).toBe('PLAIN');
57
- });
58
- it('returns "FILE" when neither extension nor usable mime is available', () => {
59
- expect(BadgeTextForAttachment(makeAttachment({ fileName: null, mimeType: '' }))).toBe('FILE');
60
- });
61
- it('ignores a leading dot filename (e.g. ".gitignore") and falls back to mime', () => {
62
- // lastIndexOf('.') === 0 → dot is not > 0, so we fall through to mime
63
- expect(BadgeTextForAttachment(makeAttachment({ fileName: '.gitignore', mimeType: 'text/plain' }))).toBe('PLAIN');
64
- });
65
- });
66
- //# sourceMappingURL=attachment-badge.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment-badge.test.js","sourceRoot":"","sources":["../../src/__tests__/attachment-badge.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAGtF,SAAS,cAAc,CAAC,SAAqC;IACzD,OAAO;QACH,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,YAAY;QACtB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,CAAC;QACZ,GAAG,SAAS;KACM,CAAC;AAC3B,CAAC;AAED,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,CAAC,cAAc,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,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACjF,sEAAsE;QACtE,MAAM,CAAC,sBAAsB,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport { ShortBadgeText, BadgeTextForAttachment } from '../lib/util/attachment-badge';\nimport type { MessageAttachment } from '../lib/components/message/message-item.component';\n\nfunction makeAttachment(overrides: Partial<MessageAttachment>): MessageAttachment {\n return {\n id: 'a1',\n type: 'Document',\n mimeType: 'text/plain',\n fileName: null,\n sizeBytes: 0,\n ...overrides\n } as MessageAttachment;\n}\n\ndescribe('ShortBadgeText', () => {\n it('returns \"FILE\" for empty or whitespace-only input', () => {\n expect(ShortBadgeText('')).toBe('FILE');\n expect(ShortBadgeText(' ')).toBe('FILE');\n expect(ShortBadgeText(null)).toBe('FILE');\n expect(ShortBadgeText(undefined)).toBe('FILE');\n });\n\n it('uppercases names that already fit within 10 characters', () => {\n expect(ShortBadgeText('Report')).toBe('REPORT');\n expect(ShortBadgeText('Snapshot')).toBe('SNAPSHOT');\n expect(ShortBadgeText('json')).toBe('JSON');\n });\n\n it('takes the last word when the full name is too long', () => {\n expect(ShortBadgeText('Data Snapshot')).toBe('SNAPSHOT');\n expect(ShortBadgeText('Business Intelligence Dashboard')).toBe('DASHBOARD');\n expect(ShortBadgeText('Skip Report')).toBe('REPORT');\n });\n\n it('truncates with ellipsis when the last word is still too long', () => {\n expect(ShortBadgeText('Monstrouslylongword')).toBe('MONSTROUS…');\n });\n\n it('trims surrounding whitespace before measuring length', () => {\n expect(ShortBadgeText(' Report ')).toBe('REPORT');\n });\n});\n\ndescribe('BadgeTextForAttachment', () => {\n it('prefers the artifact type name over the file extension', () => {\n const a = makeAttachment({\n artifactTypeName: 'Data Snapshot',\n fileName: 'snapshot.json'\n });\n expect(BadgeTextForAttachment(a)).toBe('SNAPSHOT');\n });\n\n it('uses the file extension when no artifact type is present', () => {\n expect(BadgeTextForAttachment(makeAttachment({ fileName: 'Q1_deck.pdf' }))).toBe('PDF');\n expect(BadgeTextForAttachment(makeAttachment({ fileName: 'data.csv' }))).toBe('CSV');\n });\n\n it('uppercases the extension and caps at 10 characters', () => {\n expect(BadgeTextForAttachment(makeAttachment({ fileName: 'weird.abcdefghijklmnop' }))).toBe('ABCDEFGHIJ');\n });\n\n it('falls back to the mime subtype when the filename has no extension', () => {\n expect(BadgeTextForAttachment(makeAttachment({ fileName: 'noext', mimeType: 'application/pdf' }))).toBe('PDF');\n });\n\n it('strips mime parameters (e.g. charset) before using as a fallback', () => {\n expect(BadgeTextForAttachment(makeAttachment({ fileName: null, mimeType: 'text/plain; charset=utf-8' }))).toBe('PLAIN');\n });\n\n it('returns \"FILE\" when neither extension nor usable mime is available', () => {\n expect(BadgeTextForAttachment(makeAttachment({ fileName: null, mimeType: '' }))).toBe('FILE');\n });\n\n it('ignores a leading dot filename (e.g. \".gitignore\") and falls back to mime', () => {\n // lastIndexOf('.') === 0 → dot is not > 0, so we fall through to mime\n expect(BadgeTextForAttachment(makeAttachment({ fileName: '.gitignore', mimeType: 'text/plain' }))).toBe('PLAIN');\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=channel-optional-surface.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel-optional-surface.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/channel-optional-surface.test.ts"],"names":[],"mappings":""}
@@ -1,53 +0,0 @@
1
- /**
2
- * Unit tests for the OPTIONAL CLIENT SURFACE contract on {@link BaseRealtimeChannelClient} (Phase 2).
3
- *
4
- * A bridge-contributed channel (e.g. meeting-controls or a platform-native whiteboard) may be
5
- * SERVER-ONLY — no MJ Angular surface. The contract change makes `GetSurfaceComponent` optional
6
- * (defaults to `null`) and adds `HasSurface()` so the overlay can skip a surfaceless channel's tab
7
- * while still wiring its tools + perception. These tests pin both the server-only default and the
8
- * surface-bearing override, without rendering Angular.
9
- */
10
- import { describe, it, expect } from 'vitest';
11
- import { BaseRealtimeChannelClient } from '../lib/components/realtime/channels/base-realtime-channel-client';
12
- /** A server-only channel: contributes tools + perception, but renders NO surface. */
13
- class ServerOnlyChannel extends BaseRealtimeChannelClient {
14
- get ChannelName() { return 'ServerOnly'; }
15
- get ToolNamePrefix() { return 'ServerOnly_'; }
16
- get TabTitle() { return 'Server Only'; }
17
- get TabIcon() { return 'fa-solid fa-gear'; }
18
- GetToolDefinitions() {
19
- return [{ Name: 'ServerOnly_Do', Description: 'do', ParametersSchema: { type: 'object' } }];
20
- }
21
- ApplyAgentTool() { return JSON.stringify({ success: true }); }
22
- BindSurface() { }
23
- }
24
- /** A surface-bearing channel for the positive case. */
25
- class FakeSurface {
26
- }
27
- class SurfaceChannel extends BaseRealtimeChannelClient {
28
- get ChannelName() { return 'WithSurface'; }
29
- get ToolNamePrefix() { return 'WithSurface_'; }
30
- get TabTitle() { return 'With Surface'; }
31
- get TabIcon() { return 'fa-solid fa-chalkboard'; }
32
- GetToolDefinitions() { return []; }
33
- ApplyAgentTool() { return '{}'; }
34
- BindSurface() { }
35
- GetSurfaceComponent() { return FakeSurface; }
36
- }
37
- describe('BaseRealtimeChannelClient — optional client surface', () => {
38
- it('a server-only channel returns null from GetSurfaceComponent and false from HasSurface', () => {
39
- const ch = new ServerOnlyChannel();
40
- expect(ch.GetSurfaceComponent()).toBeNull();
41
- expect(ch.HasSurface()).toBe(false);
42
- });
43
- it('a server-only channel still contributes tools (tools/perception are unaffected by no surface)', () => {
44
- const ch = new ServerOnlyChannel();
45
- expect(ch.GetToolDefinitions().map((t) => t.Name)).toEqual(['ServerOnly_Do']);
46
- });
47
- it('a surface-bearing channel returns its component and reports HasSurface true', () => {
48
- const ch = new SurfaceChannel();
49
- expect(ch.GetSurfaceComponent()).toBe(FakeSurface);
50
- expect(ch.HasSurface()).toBe(true);
51
- });
52
- });
53
- //# sourceMappingURL=channel-optional-surface.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel-optional-surface.test.js","sourceRoot":"","sources":["../../src/__tests__/channel-optional-surface.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAE7G,qFAAqF;AACrF,MAAM,iBAAkB,SAAQ,yBAAyB;IACvD,IAAW,WAAW,KAAa,OAAO,YAAY,CAAC,CAAC,CAAC;IACzD,IAAW,cAAc,KAAa,OAAO,aAAa,CAAC,CAAC,CAAC;IAC7D,IAAW,QAAQ,KAAa,OAAO,aAAa,CAAC,CAAC,CAAC;IACvD,IAAW,OAAO,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACpD,kBAAkB;QACvB,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9F,CAAC;IACM,cAAc,KAAa,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,WAAW,KAA2C,CAAC;CAE/D;AAED,uDAAuD;AACvD,MAAM,WAAW;CAAG;AACpB,MAAM,cAAe,SAAQ,yBAAsC;IACjE,IAAW,WAAW,KAAa,OAAO,aAAa,CAAC,CAAC,CAAC;IAC1D,IAAW,cAAc,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IAC9D,IAAW,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tests for the OPTIONAL CLIENT SURFACE contract on {@link BaseRealtimeChannelClient} (Phase 2).\n *\n * A bridge-contributed channel (e.g. meeting-controls or a platform-native whiteboard) may be\n * SERVER-ONLY — no MJ Angular surface. The contract change makes `GetSurfaceComponent` optional\n * (defaults to `null`) and adds `HasSurface()` so the overlay can skip a surfaceless channel's tab\n * while still wiring its tools + perception. These tests pin both the server-only default and the\n * surface-bearing override, without rendering Angular.\n */\nimport { describe, it, expect } from 'vitest';\nimport type { Type } from '@angular/core';\nimport { RealtimeToolDefinition } from '@memberjunction/ai';\nimport { BaseRealtimeChannelClient } from '../lib/components/realtime/channels/base-realtime-channel-client';\n\n/** A server-only channel: contributes tools + perception, but renders NO surface. */\nclass ServerOnlyChannel extends BaseRealtimeChannelClient {\n public get ChannelName(): string { return 'ServerOnly'; }\n public get ToolNamePrefix(): string { return 'ServerOnly_'; }\n public get TabTitle(): string { return 'Server Only'; }\n public get TabIcon(): string { return 'fa-solid fa-gear'; }\n public GetToolDefinitions(): RealtimeToolDefinition[] {\n return [{ Name: 'ServerOnly_Do', Description: 'do', ParametersSchema: { type: 'object' } }];\n }\n public ApplyAgentTool(): string { return JSON.stringify({ success: true }); }\n public BindSurface(): void { /* never called — no surface */ }\n // Deliberately does NOT override GetSurfaceComponent — inherits the null default.\n}\n\n/** A surface-bearing channel for the positive case. */\nclass FakeSurface {}\nclass SurfaceChannel extends BaseRealtimeChannelClient<FakeSurface> {\n public get ChannelName(): string { return 'WithSurface'; }\n public get ToolNamePrefix(): string { return 'WithSurface_'; }\n public get TabTitle(): string { return 'With Surface'; }\n public get TabIcon(): string { return 'fa-solid fa-chalkboard'; }\n public GetToolDefinitions(): RealtimeToolDefinition[] { return []; }\n public ApplyAgentTool(): string { return '{}'; }\n public BindSurface(): void { /* no-op */ }\n public override GetSurfaceComponent(): Type<FakeSurface> { return FakeSurface; }\n}\n\ndescribe('BaseRealtimeChannelClient — optional client surface', () => {\n it('a server-only channel returns null from GetSurfaceComponent and false from HasSurface', () => {\n const ch = new ServerOnlyChannel();\n expect(ch.GetSurfaceComponent()).toBeNull();\n expect(ch.HasSurface()).toBe(false);\n });\n\n it('a server-only channel still contributes tools (tools/perception are unaffected by no surface)', () => {\n const ch = new ServerOnlyChannel();\n expect(ch.GetToolDefinitions().map((t) => t.Name)).toEqual(['ServerOnly_Do']);\n });\n\n it('a surface-bearing channel returns its component and reports HasSurface true', () => {\n const ch = new SurfaceChannel();\n expect(ch.GetSurfaceComponent()).toBe(FakeSurface);\n expect(ch.HasSurface()).toBe(true);\n });\n});\n"]}
@@ -1,14 +0,0 @@
1
- /**
2
- * @fileoverview Tests for the Before/After cancelable chat event arg classes.
3
- *
4
- * Asserts:
5
- * - CancellableChatEventArgs base class default: Cancel = false.
6
- * - Each Before* class extends CancellableChatEventArgs and carries its
7
- * readonly payload fields.
8
- * - Each After* class carries its payload as readonly fields.
9
- * - Listeners can set Cancel = true on Before events.
10
- *
11
- * Pure logic — no Angular runtime needed. Vitest-ready.
12
- */
13
- export {};
14
- //# sourceMappingURL=chat-events.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-events.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/chat-events.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -1,109 +0,0 @@
1
- /**
2
- * @fileoverview Tests for the Before/After cancelable chat event arg classes.
3
- *
4
- * Asserts:
5
- * - CancellableChatEventArgs base class default: Cancel = false.
6
- * - Each Before* class extends CancellableChatEventArgs and carries its
7
- * readonly payload fields.
8
- * - Each After* class carries its payload as readonly fields.
9
- * - Listeners can set Cancel = true on Before events.
10
- *
11
- * Pure logic — no Angular runtime needed. Vitest-ready.
12
- */
13
- import { describe, it, expect } from 'vitest';
14
- import { CancellableChatEventArgs, BeforeAgentTurnEventArgs, AfterAgentTurnEventArgs, BeforeToolInvokedEventArgs, AfterToolInvokedEventArgs, BeforeResponseFormSubmittedEventArgs, AfterResponseFormSubmittedEventArgs, SessionStartedEventArgs, SessionChannelStateChangedEventArgs, SessionEndedEventArgs, } from '../lib/events/chat-events';
15
- describe('CancellableChatEventArgs (base class)', () => {
16
- it('defaults Cancel to false', () => {
17
- const e = new CancellableChatEventArgs();
18
- expect(e.Cancel).toBe(false);
19
- });
20
- it('lets listeners flip Cancel to true', () => {
21
- const e = new CancellableChatEventArgs();
22
- e.Cancel = true;
23
- e.CancelReason = 'rate-limited';
24
- expect(e.Cancel).toBe(true);
25
- expect(e.CancelReason).toBe('rate-limited');
26
- });
27
- });
28
- describe('BeforeAgentTurnEventArgs', () => {
29
- it('extends CancellableChatEventArgs and carries its payload', () => {
30
- const e = new BeforeAgentTurnEventArgs('conv-1', 'hello', 'app-1');
31
- expect(e).toBeInstanceOf(CancellableChatEventArgs);
32
- expect(e.ConversationId).toBe('conv-1');
33
- expect(e.MessageText).toBe('hello');
34
- expect(e.ApplicationId).toBe('app-1');
35
- expect(e.Cancel).toBe(false);
36
- });
37
- it('applicationId defaults to null when omitted', () => {
38
- const e = new BeforeAgentTurnEventArgs('conv-1', 'hello');
39
- expect(e.ApplicationId).toBeNull();
40
- });
41
- });
42
- describe('AfterAgentTurnEventArgs', () => {
43
- it('carries its payload as readonly fields', () => {
44
- const result = { success: true, executionTimeMs: 100 };
45
- const e = new AfterAgentTurnEventArgs('conv-1', 'run-1', result);
46
- expect(e.ConversationId).toBe('conv-1');
47
- expect(e.AgentRunId).toBe('run-1');
48
- expect(e.Result).toBe(result);
49
- });
50
- });
51
- describe('BeforeToolInvokedEventArgs', () => {
52
- it('extends CancellableChatEventArgs and carries tool name + args', () => {
53
- const e = new BeforeToolInvokedEventArgs('NavigateToRecord', { id: '1' });
54
- expect(e).toBeInstanceOf(CancellableChatEventArgs);
55
- expect(e.ToolName).toBe('NavigateToRecord');
56
- expect(e.Args).toEqual({ id: '1' });
57
- });
58
- });
59
- describe('AfterToolInvokedEventArgs', () => {
60
- it('carries tool name + args + result', () => {
61
- const e = new AfterToolInvokedEventArgs('NavigateToRecord', { id: '1' }, { ok: true });
62
- expect(e.ToolName).toBe('NavigateToRecord');
63
- expect(e.Args).toEqual({ id: '1' });
64
- expect(e.Result).toEqual({ ok: true });
65
- });
66
- });
67
- describe('BeforeResponseFormSubmittedEventArgs', () => {
68
- it('extends CancellableChatEventArgs and carries form id + values', () => {
69
- const e = new BeforeResponseFormSubmittedEventArgs('form-1', { q1: 'yes' });
70
- expect(e).toBeInstanceOf(CancellableChatEventArgs);
71
- expect(e.FormId).toBe('form-1');
72
- expect(e.Values).toEqual({ q1: 'yes' });
73
- });
74
- });
75
- describe('AfterResponseFormSubmittedEventArgs', () => {
76
- it('carries form id + values as readonly fields', () => {
77
- const e = new AfterResponseFormSubmittedEventArgs('form-1', { q1: 'yes' });
78
- expect(e.FormId).toBe('form-1');
79
- expect(e.Values).toEqual({ q1: 'yes' });
80
- });
81
- });
82
- describe('Session* informational events', () => {
83
- it('SessionStartedEventArgs carries session id + channel kinds', () => {
84
- const e = new SessionStartedEventArgs('sess-1', ['text', 'voice']);
85
- expect(e.SessionId).toBe('sess-1');
86
- expect(e.ChannelKinds).toEqual(['text', 'voice']);
87
- });
88
- it('SessionChannelStateChangedEventArgs carries session id + channel kind + state', () => {
89
- const e = new SessionChannelStateChangedEventArgs('sess-1', 'voice', 'open');
90
- expect(e.SessionId).toBe('sess-1');
91
- expect(e.ChannelKind).toBe('voice');
92
- expect(e.State).toBe('open');
93
- });
94
- it('SessionEndedEventArgs carries session id + narrowed reason', () => {
95
- const e = new SessionEndedEventArgs('sess-1', 'explicit');
96
- expect(e.SessionId).toBe('sess-1');
97
- expect(e.Reason).toBe('explicit');
98
- });
99
- it('SessionEndedEventArgs accepts all narrowed reason values', () => {
100
- // Compile-time check: the narrowed union should permit exactly these three.
101
- const explicit = new SessionEndedEventArgs('sess-1', 'explicit');
102
- const error = new SessionEndedEventArgs('sess-1', 'error');
103
- const unknown = new SessionEndedEventArgs('sess-1', 'unknown');
104
- expect(explicit.Reason).toBe('explicit');
105
- expect(error.Reason).toBe('error');
106
- expect(unknown.Reason).toBe('unknown');
107
- });
108
- });
109
- //# sourceMappingURL=chat-events.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-events.test.js","sourceRoot":"","sources":["../../src/__tests__/chat-events.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,mCAAmC,EACnC,uBAAuB,EACvB,mCAAmC,EACnC,qBAAqB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACzC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACzC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC,CAAC,YAAY,GAAG,cAAc,CAAC;QAChC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAChE,MAAM,CAAC,GAAG,IAAI,wBAAwB,CAAC,QAAQ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CancellableChatEventArgs base class default: Cancel = false.\n * - Each Before* class extends CancellableChatEventArgs and carries its\n * readonly payload fields.\n * - Each After* class carries its payload as readonly fields.\n * - Listeners can set Cancel = true on Before events.\n *\n * Pure logic — no Angular runtime needed. Vitest-ready.\n */\n\nimport { describe, it, expect } from 'vitest';\n\nimport {\n CancellableChatEventArgs,\n BeforeAgentTurnEventArgs,\n AfterAgentTurnEventArgs,\n BeforeToolInvokedEventArgs,\n AfterToolInvokedEventArgs,\n BeforeResponseFormSubmittedEventArgs,\n AfterResponseFormSubmittedEventArgs,\n SessionStartedEventArgs,\n SessionChannelStateChangedEventArgs,\n SessionEndedEventArgs,\n} from '../lib/events/chat-events';\n\ndescribe('CancellableChatEventArgs (base class)', () => {\n it('defaults Cancel to false', () => {\n const e = new CancellableChatEventArgs();\n expect(e.Cancel).toBe(false);\n });\n\n it('lets listeners flip Cancel to true', () => {\n const e = new CancellableChatEventArgs();\n e.Cancel = true;\n e.CancelReason = 'rate-limited';\n expect(e.Cancel).toBe(true);\n expect(e.CancelReason).toBe('rate-limited');\n });\n});\n\ndescribe('BeforeAgentTurnEventArgs', () => {\n it('extends CancellableChatEventArgs and carries its payload', () => {\n const e = new BeforeAgentTurnEventArgs('conv-1', 'hello', 'app-1');\n expect(e).toBeInstanceOf(CancellableChatEventArgs);\n expect(e.ConversationId).toBe('conv-1');\n expect(e.MessageText).toBe('hello');\n expect(e.ApplicationId).toBe('app-1');\n expect(e.Cancel).toBe(false);\n });\n\n it('applicationId defaults to null when omitted', () => {\n const e = new BeforeAgentTurnEventArgs('conv-1', 'hello');\n expect(e.ApplicationId).toBeNull();\n });\n});\n\ndescribe('AfterAgentTurnEventArgs', () => {\n it('carries its payload as readonly fields', () => {\n const result = { success: true, executionTimeMs: 100 } as never;\n const e = new AfterAgentTurnEventArgs('conv-1', 'run-1', result);\n expect(e.ConversationId).toBe('conv-1');\n expect(e.AgentRunId).toBe('run-1');\n expect(e.Result).toBe(result);\n });\n});\n\ndescribe('BeforeToolInvokedEventArgs', () => {\n it('extends CancellableChatEventArgs and carries tool name + args', () => {\n const e = new BeforeToolInvokedEventArgs('NavigateToRecord', { id: '1' });\n expect(e).toBeInstanceOf(CancellableChatEventArgs);\n expect(e.ToolName).toBe('NavigateToRecord');\n expect(e.Args).toEqual({ id: '1' });\n });\n});\n\ndescribe('AfterToolInvokedEventArgs', () => {\n it('carries tool name + args + result', () => {\n const e = new AfterToolInvokedEventArgs('NavigateToRecord', { id: '1' }, { ok: true });\n expect(e.ToolName).toBe('NavigateToRecord');\n expect(e.Args).toEqual({ id: '1' });\n expect(e.Result).toEqual({ ok: true });\n });\n});\n\ndescribe('BeforeResponseFormSubmittedEventArgs', () => {\n it('extends CancellableChatEventArgs and carries form id + values', () => {\n const e = new BeforeResponseFormSubmittedEventArgs('form-1', { q1: 'yes' });\n expect(e).toBeInstanceOf(CancellableChatEventArgs);\n expect(e.FormId).toBe('form-1');\n expect(e.Values).toEqual({ q1: 'yes' });\n });\n});\n\ndescribe('AfterResponseFormSubmittedEventArgs', () => {\n it('carries form id + values as readonly fields', () => {\n const e = new AfterResponseFormSubmittedEventArgs('form-1', { q1: 'yes' });\n expect(e.FormId).toBe('form-1');\n expect(e.Values).toEqual({ q1: 'yes' });\n });\n});\n\ndescribe('Session* informational events', () => {\n it('SessionStartedEventArgs carries session id + channel kinds', () => {\n const e = new SessionStartedEventArgs('sess-1', ['text', 'voice']);\n expect(e.SessionId).toBe('sess-1');\n expect(e.ChannelKinds).toEqual(['text', 'voice']);\n });\n\n it('SessionChannelStateChangedEventArgs carries session id + channel kind + state', () => {\n const e = new SessionChannelStateChangedEventArgs('sess-1', 'voice', 'open');\n expect(e.SessionId).toBe('sess-1');\n expect(e.ChannelKind).toBe('voice');\n expect(e.State).toBe('open');\n });\n\n it('SessionEndedEventArgs carries session id + narrowed reason', () => {\n const e = new SessionEndedEventArgs('sess-1', 'explicit');\n expect(e.SessionId).toBe('sess-1');\n expect(e.Reason).toBe('explicit');\n });\n\n it('SessionEndedEventArgs accepts all narrowed reason values', () => {\n // Compile-time check: the narrowed union should permit exactly these three.\n const explicit = new SessionEndedEventArgs('sess-1', 'explicit');\n const error = new SessionEndedEventArgs('sess-1', 'error');\n const unknown = new SessionEndedEventArgs('sess-1', 'unknown');\n expect(explicit.Reason).toBe('explicit');\n expect(error.Reason).toBe('error');\n expect(unknown.Reason).toBe('unknown');\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=collections-full-view.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collections-full-view.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/collections-full-view.test.ts"],"names":[],"mappings":""}
@@ -1,225 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- /**
3
- * Reproduces the template binding logic:
4
- * [parentCollection]="editingCollection ? undefined : (currentCollection || undefined)"
5
- */
6
- function resolveParentCollection(editingCollection, currentCollection) {
7
- return editingCollection ? undefined : (currentCollection || undefined);
8
- }
9
- describe('Bug 1: parentCollection binding logic', () => {
10
- const rootCollection = {
11
- ID: 'root-1',
12
- Name: 'Root Collection',
13
- ParentID: null
14
- };
15
- const childCollection = {
16
- ID: 'child-1',
17
- Name: 'Child Collection',
18
- ParentID: 'root-1'
19
- };
20
- describe('when creating a new collection', () => {
21
- it('should pass currentCollection as parentCollection at root level', () => {
22
- // At root level, currentCollection is null
23
- const parent = resolveParentCollection(undefined, null);
24
- expect(parent).toBeUndefined();
25
- });
26
- it('should pass currentCollection as parentCollection when inside a collection', () => {
27
- // Inside rootCollection, creating a new sub-collection
28
- const parent = resolveParentCollection(undefined, rootCollection);
29
- expect(parent).toBe(rootCollection);
30
- });
31
- });
32
- describe('when editing an existing collection', () => {
33
- it('should NOT pass parentCollection when editing the current collection', () => {
34
- // Inside rootCollection, editing rootCollection itself
35
- // Before fix: parentCollection = rootCollection (the collection being edited!)
36
- // After fix: parentCollection = undefined
37
- const parent = resolveParentCollection(rootCollection, rootCollection);
38
- expect(parent).toBeUndefined();
39
- });
40
- it('should NOT pass parentCollection when editing a child collection from the list', () => {
41
- // Inside rootCollection, editing childCollection from the grid
42
- const parent = resolveParentCollection(childCollection, rootCollection);
43
- expect(parent).toBeUndefined();
44
- });
45
- it('should NOT pass parentCollection when editing at root level', () => {
46
- // At root level, editing rootCollection
47
- const parent = resolveParentCollection(rootCollection, null);
48
- expect(parent).toBeUndefined();
49
- });
50
- });
51
- });
52
- /**
53
- * Reproduces the form-modal save logic for ParentID:
54
- *
55
- * if (!this.collection) {
56
- * // creating new — set ParentID from parentCollection
57
- * } else if (this.parentCollection) {
58
- * collection.ParentID = this.parentCollection.ID;
59
- * }
60
- */
61
- function simulateSave(existingCollection, parentCollection) {
62
- if (!existingCollection) {
63
- // Creating new collection — parentCollection sets ParentID (expected)
64
- return {
65
- parentIdOverwritten: !!parentCollection,
66
- newParentId: parentCollection?.ID ?? null
67
- };
68
- }
69
- else if (parentCollection) {
70
- // Editing existing — parentCollection would overwrite ParentID
71
- return {
72
- parentIdOverwritten: true,
73
- newParentId: parentCollection.ID
74
- };
75
- }
76
- // Editing existing, no parentCollection — ParentID unchanged
77
- return {
78
- parentIdOverwritten: false,
79
- newParentId: existingCollection.ParentID
80
- };
81
- }
82
- describe('Bug 1: form-modal save logic for ParentID', () => {
83
- const collection = {
84
- ID: 'col-1',
85
- Name: 'My Collection',
86
- ParentID: 'parent-1'
87
- };
88
- it('should not overwrite ParentID when editing with no parentCollection (the fix)', () => {
89
- // After fix: parentCollection is undefined when editing
90
- const result = simulateSave(collection, undefined);
91
- expect(result.parentIdOverwritten).toBe(false);
92
- expect(result.newParentId).toBe('parent-1'); // Preserved
93
- });
94
- it('would overwrite ParentID if parentCollection were passed during edit (the bug)', () => {
95
- // Before fix: parentCollection = the collection itself
96
- const result = simulateSave(collection, collection);
97
- expect(result.parentIdOverwritten).toBe(true);
98
- expect(result.newParentId).toBe('col-1'); // Self-referencing — the bug!
99
- });
100
- it('should set ParentID when creating a new child collection', () => {
101
- const parent = { ID: 'parent-1', Name: 'Parent', ParentID: null };
102
- const result = simulateSave(undefined, parent);
103
- expect(result.parentIdOverwritten).toBe(true);
104
- expect(result.newParentId).toBe('parent-1');
105
- });
106
- it('should leave ParentID null when creating a new root collection', () => {
107
- const result = simulateSave(undefined, undefined);
108
- expect(result.parentIdOverwritten).toBe(false);
109
- expect(result.newParentId).toBeNull();
110
- });
111
- });
112
- // ============================================================
113
- // Bug 2: Item counts always showing "Empty"
114
- // ============================================================
115
- /**
116
- * Reproduces the getItemCountText display logic
117
- */
118
- function getItemCountText(itemCount) {
119
- if (itemCount !== undefined) {
120
- if (itemCount === 0)
121
- return 'Empty';
122
- if (itemCount === 1)
123
- return '1 item';
124
- return `${itemCount} items`;
125
- }
126
- return '';
127
- }
128
- /**
129
- * Reproduces the item count calculation from loadItemCounts:
130
- * counts child collections + collection artifacts per parent collection
131
- */
132
- function buildItemCountMap(childCollections, collectionArtifacts) {
133
- const map = new Map();
134
- for (const child of childCollections) {
135
- map.set(child.ParentID, (map.get(child.ParentID) || 0) + 1);
136
- }
137
- for (const ca of collectionArtifacts) {
138
- map.set(ca.CollectionID, (map.get(ca.CollectionID) || 0) + 1);
139
- }
140
- return map;
141
- }
142
- describe('Bug 2: item count display', () => {
143
- describe('getItemCountText', () => {
144
- it('should return "Empty" for count 0', () => {
145
- expect(getItemCountText(0)).toBe('Empty');
146
- });
147
- it('should return "1 item" for count 1', () => {
148
- expect(getItemCountText(1)).toBe('1 item');
149
- });
150
- it('should return "N items" for count > 1', () => {
151
- expect(getItemCountText(5)).toBe('5 items');
152
- });
153
- it('should return empty string for undefined', () => {
154
- expect(getItemCountText(undefined)).toBe('');
155
- });
156
- });
157
- describe('buildItemCountMap', () => {
158
- it('should count child collections per parent', () => {
159
- const children = [
160
- { ParentID: 'col-1' },
161
- { ParentID: 'col-1' },
162
- { ParentID: 'col-2' }
163
- ];
164
- const map = buildItemCountMap(children, []);
165
- expect(map.get('col-1')).toBe(2);
166
- expect(map.get('col-2')).toBe(1);
167
- });
168
- it('should count artifacts per collection', () => {
169
- const artifacts = [
170
- { CollectionID: 'col-1' },
171
- { CollectionID: 'col-1' },
172
- { CollectionID: 'col-1' }
173
- ];
174
- const map = buildItemCountMap([], artifacts);
175
- expect(map.get('col-1')).toBe(3);
176
- });
177
- it('should sum child collections and artifacts together', () => {
178
- const children = [
179
- { ParentID: 'col-1' },
180
- { ParentID: 'col-1' }
181
- ];
182
- const artifacts = [
183
- { CollectionID: 'col-1' },
184
- { CollectionID: 'col-1' },
185
- { CollectionID: 'col-1' }
186
- ];
187
- const map = buildItemCountMap(children, artifacts);
188
- // 2 children + 3 artifacts = 5 items
189
- expect(map.get('col-1')).toBe(5);
190
- });
191
- it('should return 0 (via map miss) for collections with no items', () => {
192
- const map = buildItemCountMap([], []);
193
- expect(map.get('col-1') || 0).toBe(0);
194
- });
195
- it('should handle multiple collections independently', () => {
196
- const children = [
197
- { ParentID: 'col-1' },
198
- { ParentID: 'col-2' },
199
- { ParentID: 'col-2' }
200
- ];
201
- const artifacts = [
202
- { CollectionID: 'col-1' },
203
- { CollectionID: 'col-3' }
204
- ];
205
- const map = buildItemCountMap(children, artifacts);
206
- expect(map.get('col-1')).toBe(2); // 1 child + 1 artifact
207
- expect(map.get('col-2')).toBe(2); // 2 children
208
- expect(map.get('col-3')).toBe(1); // 1 artifact
209
- });
210
- });
211
- describe('end-to-end: count map feeds display text', () => {
212
- it('should show correct text from calculated counts', () => {
213
- const children = [{ ParentID: 'col-1' }];
214
- const artifacts = [
215
- { CollectionID: 'col-1' },
216
- { CollectionID: 'col-2' }
217
- ];
218
- const map = buildItemCountMap(children, artifacts);
219
- expect(getItemCountText(map.get('col-1') || 0)).toBe('2 items');
220
- expect(getItemCountText(map.get('col-2') || 0)).toBe('1 item');
221
- expect(getItemCountText(map.get('col-3') || 0)).toBe('Empty');
222
- });
223
- });
224
- });
225
- //# sourceMappingURL=collections-full-view.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":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AC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect, beforeEach } from 'vitest';\n\n/**\n * Tests for collections-full-view logic — extracted from the component\n * to verify bug fixes without Angular DI.\n *\n * Bug 1: Renaming a collection set ParentID to itself (self-referencing)\n * Bug 2: All collections showed \"Empty\" because itemCount was hardcoded to 0\n */\n\n// ============================================================\n// Bug 1: parentCollection binding when editing vs creating\n// ============================================================\n\ninterface MockCollection {\n ID: string;\n Name: string;\n ParentID: string | null;\n}\n\n/**\n * Reproduces the template binding logic:\n * [parentCollection]=\"editingCollection ? undefined : (currentCollection || undefined)\"\n */\nfunction resolveParentCollection(\n editingCollection: MockCollection | undefined,\n currentCollection: MockCollection | null\n): MockCollection | undefined {\n return editingCollection ? undefined : (currentCollection || undefined);\n}\n\ndescribe('Bug 1: parentCollection binding logic', () => {\n const rootCollection: MockCollection = {\n ID: 'root-1',\n Name: 'Root Collection',\n ParentID: null\n };\n\n const childCollection: MockCollection = {\n ID: 'child-1',\n Name: 'Child Collection',\n ParentID: 'root-1'\n };\n\n describe('when creating a new collection', () => {\n it('should pass currentCollection as parentCollection at root level', () => {\n // At root level, currentCollection is null\n const parent = resolveParentCollection(undefined, null);\n expect(parent).toBeUndefined();\n });\n\n it('should pass currentCollection as parentCollection when inside a collection', () => {\n // Inside rootCollection, creating a new sub-collection\n const parent = resolveParentCollection(undefined, rootCollection);\n expect(parent).toBe(rootCollection);\n });\n });\n\n describe('when editing an existing collection', () => {\n it('should NOT pass parentCollection when editing the current collection', () => {\n // Inside rootCollection, editing rootCollection itself\n // Before fix: parentCollection = rootCollection (the collection being edited!)\n // After fix: parentCollection = undefined\n const parent = resolveParentCollection(rootCollection, rootCollection);\n expect(parent).toBeUndefined();\n });\n\n it('should NOT pass parentCollection when editing a child collection from the list', () => {\n // Inside rootCollection, editing childCollection from the grid\n const parent = resolveParentCollection(childCollection, rootCollection);\n expect(parent).toBeUndefined();\n });\n\n it('should NOT pass parentCollection when editing at root level', () => {\n // At root level, editing rootCollection\n const parent = resolveParentCollection(rootCollection, null);\n expect(parent).toBeUndefined();\n });\n });\n});\n\n/**\n * Reproduces the form-modal save logic for ParentID:\n *\n * if (!this.collection) {\n * // creating new — set ParentID from parentCollection\n * } else if (this.parentCollection) {\n * collection.ParentID = this.parentCollection.ID;\n * }\n */\nfunction simulateSave(\n existingCollection: MockCollection | undefined,\n parentCollection: MockCollection | undefined\n): { parentIdOverwritten: boolean; newParentId: string | null } {\n if (!existingCollection) {\n // Creating new collection — parentCollection sets ParentID (expected)\n return {\n parentIdOverwritten: !!parentCollection,\n newParentId: parentCollection?.ID ?? null\n };\n } else if (parentCollection) {\n // Editing existing — parentCollection would overwrite ParentID\n return {\n parentIdOverwritten: true,\n newParentId: parentCollection.ID\n };\n }\n // Editing existing, no parentCollection — ParentID unchanged\n return {\n parentIdOverwritten: false,\n newParentId: existingCollection.ParentID\n };\n}\n\ndescribe('Bug 1: form-modal save logic for ParentID', () => {\n const collection: MockCollection = {\n ID: 'col-1',\n Name: 'My Collection',\n ParentID: 'parent-1'\n };\n\n it('should not overwrite ParentID when editing with no parentCollection (the fix)', () => {\n // After fix: parentCollection is undefined when editing\n const result = simulateSave(collection, undefined);\n expect(result.parentIdOverwritten).toBe(false);\n expect(result.newParentId).toBe('parent-1'); // Preserved\n });\n\n it('would overwrite ParentID if parentCollection were passed during edit (the bug)', () => {\n // Before fix: parentCollection = the collection itself\n const result = simulateSave(collection, collection);\n expect(result.parentIdOverwritten).toBe(true);\n expect(result.newParentId).toBe('col-1'); // Self-referencing — the bug!\n });\n\n it('should set ParentID when creating a new child collection', () => {\n const parent: MockCollection = { ID: 'parent-1', Name: 'Parent', ParentID: null };\n const result = simulateSave(undefined, parent);\n expect(result.parentIdOverwritten).toBe(true);\n expect(result.newParentId).toBe('parent-1');\n });\n\n it('should leave ParentID null when creating a new root collection', () => {\n const result = simulateSave(undefined, undefined);\n expect(result.parentIdOverwritten).toBe(false);\n expect(result.newParentId).toBeNull();\n });\n});\n\n// ============================================================\n// Bug 2: Item counts always showing \"Empty\"\n// ============================================================\n\n/**\n * Reproduces the getItemCountText display logic\n */\nfunction getItemCountText(itemCount?: number): string {\n if (itemCount !== undefined) {\n if (itemCount === 0) return 'Empty';\n if (itemCount === 1) return '1 item';\n return `${itemCount} items`;\n }\n return '';\n}\n\n/**\n * Reproduces the item count calculation from loadItemCounts:\n * counts child collections + collection artifacts per parent collection\n */\nfunction buildItemCountMap(\n childCollections: Array<{ ParentID: string }>,\n collectionArtifacts: Array<{ CollectionID: string }>\n): Map<string, number> {\n const map = new Map<string, number>();\n\n for (const child of childCollections) {\n map.set(child.ParentID, (map.get(child.ParentID) || 0) + 1);\n }\n\n for (const ca of collectionArtifacts) {\n map.set(ca.CollectionID, (map.get(ca.CollectionID) || 0) + 1);\n }\n\n return map;\n}\n\ndescribe('Bug 2: item count display', () => {\n describe('getItemCountText', () => {\n it('should return \"Empty\" for count 0', () => {\n expect(getItemCountText(0)).toBe('Empty');\n });\n\n it('should return \"1 item\" for count 1', () => {\n expect(getItemCountText(1)).toBe('1 item');\n });\n\n it('should return \"N items\" for count > 1', () => {\n expect(getItemCountText(5)).toBe('5 items');\n });\n\n it('should return empty string for undefined', () => {\n expect(getItemCountText(undefined)).toBe('');\n });\n });\n\n describe('buildItemCountMap', () => {\n it('should count child collections per parent', () => {\n const children = [\n { ParentID: 'col-1' },\n { ParentID: 'col-1' },\n { ParentID: 'col-2' }\n ];\n const map = buildItemCountMap(children, []);\n\n expect(map.get('col-1')).toBe(2);\n expect(map.get('col-2')).toBe(1);\n });\n\n it('should count artifacts per collection', () => {\n const artifacts = [\n { CollectionID: 'col-1' },\n { CollectionID: 'col-1' },\n { CollectionID: 'col-1' }\n ];\n const map = buildItemCountMap([], artifacts);\n\n expect(map.get('col-1')).toBe(3);\n });\n\n it('should sum child collections and artifacts together', () => {\n const children = [\n { ParentID: 'col-1' },\n { ParentID: 'col-1' }\n ];\n const artifacts = [\n { CollectionID: 'col-1' },\n { CollectionID: 'col-1' },\n { CollectionID: 'col-1' }\n ];\n const map = buildItemCountMap(children, artifacts);\n\n // 2 children + 3 artifacts = 5 items\n expect(map.get('col-1')).toBe(5);\n });\n\n it('should return 0 (via map miss) for collections with no items', () => {\n const map = buildItemCountMap([], []);\n expect(map.get('col-1') || 0).toBe(0);\n });\n\n it('should handle multiple collections independently', () => {\n const children = [\n { ParentID: 'col-1' },\n { ParentID: 'col-2' },\n { ParentID: 'col-2' }\n ];\n const artifacts = [\n { CollectionID: 'col-1' },\n { CollectionID: 'col-3' }\n ];\n const map = buildItemCountMap(children, artifacts);\n\n expect(map.get('col-1')).toBe(2); // 1 child + 1 artifact\n expect(map.get('col-2')).toBe(2); // 2 children\n expect(map.get('col-3')).toBe(1); // 1 artifact\n });\n });\n\n describe('end-to-end: count map feeds display text', () => {\n it('should show correct text from calculated counts', () => {\n const children = [{ ParentID: 'col-1' }];\n const artifacts = [\n { CollectionID: 'col-1' },\n { CollectionID: 'col-2' }\n ];\n const map = buildItemCountMap(children, artifacts);\n\n expect(getItemCountText(map.get('col-1') || 0)).toBe('2 items');\n expect(getItemCountText(map.get('col-2') || 0)).toBe('1 item');\n expect(getItemCountText(map.get('col-3') || 0)).toBe('Empty');\n });\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=conversation-cache.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation-cache.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/conversation-cache.test.ts"],"names":[],"mappings":""}