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

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 (279) hide show
  1. package/README.md +4 -7
  2. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  3. package/dist/lib/components/collection/collection-view.component.js +1 -0
  4. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  5. package/dist/lib/components/composer/ai-composer.component.d.ts +14 -2
  6. package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
  7. package/dist/lib/components/composer/ai-composer.component.js +35 -4
  8. package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
  9. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +632 -55
  10. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  11. package/dist/lib/components/conversation/conversation-chat-area.component.js +2748 -624
  12. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  13. package/dist/lib/components/conversation/forks-popover.component.d.ts +37 -0
  14. package/dist/lib/components/conversation/forks-popover.component.d.ts.map +1 -0
  15. package/dist/lib/components/conversation/forks-popover.component.js +164 -0
  16. package/dist/lib/components/conversation/forks-popover.component.js.map +1 -0
  17. package/dist/lib/components/export/export-modal.component.d.ts +7 -2
  18. package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
  19. package/dist/lib/components/export/export-modal.component.js +16 -3
  20. package/dist/lib/components/export/export-modal.component.js.map +1 -1
  21. package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
  22. package/dist/lib/components/message/conversation-message-rating.component.js +11 -9
  23. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  24. package/dist/lib/components/message/message-input.component.d.ts +121 -11
  25. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  26. package/dist/lib/components/message/message-input.component.js +307 -106
  27. package/dist/lib/components/message/message-input.component.js.map +1 -1
  28. package/dist/lib/components/message/message-item.component.d.ts +178 -5
  29. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  30. package/dist/lib/components/message/message-item.component.js +919 -306
  31. package/dist/lib/components/message/message-item.component.js.map +1 -1
  32. package/dist/lib/components/message/message-list.component.d.ts +92 -21
  33. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  34. package/dist/lib/components/message/message-list.component.js +337 -52
  35. package/dist/lib/components/message/message-list.component.js.map +1 -1
  36. package/dist/lib/components/realtime/avatar/realtime-avatar-channel.d.ts +34 -0
  37. package/dist/lib/components/realtime/avatar/realtime-avatar-channel.d.ts.map +1 -0
  38. package/dist/lib/components/realtime/avatar/realtime-avatar-channel.js +75 -0
  39. package/dist/lib/components/realtime/avatar/realtime-avatar-channel.js.map +1 -0
  40. package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.d.ts +80 -0
  41. package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.d.ts.map +1 -0
  42. package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.js +202 -0
  43. package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.js.map +1 -0
  44. package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.d.ts +45 -0
  45. package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.d.ts.map +1 -0
  46. package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.js +123 -0
  47. package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.js.map +1 -0
  48. package/dist/lib/components/realtime/capture/realtime-capture-channel.d.ts +90 -0
  49. package/dist/lib/components/realtime/capture/realtime-capture-channel.d.ts.map +1 -0
  50. package/dist/lib/components/realtime/capture/realtime-capture-channel.js +223 -0
  51. package/dist/lib/components/realtime/capture/realtime-capture-channel.js.map +1 -0
  52. package/dist/lib/components/realtime/capture/realtime-capture-model.d.ts +98 -0
  53. package/dist/lib/components/realtime/capture/realtime-capture-model.d.ts.map +1 -0
  54. package/dist/lib/components/realtime/capture/realtime-capture-model.js +161 -0
  55. package/dist/lib/components/realtime/capture/realtime-capture-model.js.map +1 -0
  56. package/dist/lib/components/realtime/capture/realtime-capture-surface.component.d.ts +48 -0
  57. package/dist/lib/components/realtime/capture/realtime-capture-surface.component.d.ts.map +1 -0
  58. package/dist/lib/components/realtime/capture/realtime-capture-surface.component.js +205 -0
  59. package/dist/lib/components/realtime/capture/realtime-capture-surface.component.js.map +1 -0
  60. package/dist/lib/components/realtime/channels/client-context-channel.d.ts +19 -2
  61. package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
  62. package/dist/lib/components/realtime/channels/client-context-channel.js +83 -9
  63. package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
  64. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +30 -9
  65. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
  66. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +78 -14
  67. package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
  68. package/dist/lib/components/realtime/identity-verification/identity-verification-channel.d.ts +71 -0
  69. package/dist/lib/components/realtime/identity-verification/identity-verification-channel.d.ts.map +1 -0
  70. package/dist/lib/components/realtime/identity-verification/identity-verification-channel.js +259 -0
  71. package/dist/lib/components/realtime/identity-verification/identity-verification-channel.js.map +1 -0
  72. package/dist/lib/components/realtime/identity-verification/identity-verification-model.d.ts +129 -0
  73. package/dist/lib/components/realtime/identity-verification/identity-verification-model.d.ts.map +1 -0
  74. package/dist/lib/components/realtime/identity-verification/identity-verification-model.js +373 -0
  75. package/dist/lib/components/realtime/identity-verification/identity-verification-model.js.map +1 -0
  76. package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.d.ts +77 -0
  77. package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.d.ts.map +1 -0
  78. package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.js +420 -0
  79. package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.js.map +1 -0
  80. package/dist/lib/components/realtime/interactive-component/component-contract.d.ts +83 -0
  81. package/dist/lib/components/realtime/interactive-component/component-contract.d.ts.map +1 -0
  82. package/dist/lib/components/realtime/interactive-component/component-contract.js +292 -0
  83. package/dist/lib/components/realtime/interactive-component/component-contract.js.map +1 -0
  84. package/dist/lib/components/realtime/interactive-component/component-data-state.d.ts +39 -0
  85. package/dist/lib/components/realtime/interactive-component/component-data-state.d.ts.map +1 -0
  86. package/dist/lib/components/realtime/interactive-component/component-data-state.js +152 -0
  87. package/dist/lib/components/realtime/interactive-component/component-data-state.js.map +1 -0
  88. package/dist/lib/components/realtime/interactive-component/component-instance-engine.d.ts +109 -0
  89. package/dist/lib/components/realtime/interactive-component/component-instance-engine.d.ts.map +1 -0
  90. package/dist/lib/components/realtime/interactive-component/component-instance-engine.js +146 -0
  91. package/dist/lib/components/realtime/interactive-component/component-instance-engine.js.map +1 -0
  92. package/dist/lib/components/realtime/interactive-component/component-spec-content.d.ts +19 -0
  93. package/dist/lib/components/realtime/interactive-component/component-spec-content.d.ts.map +1 -0
  94. package/dist/lib/components/realtime/interactive-component/component-spec-content.js +39 -0
  95. package/dist/lib/components/realtime/interactive-component/component-spec-content.js.map +1 -0
  96. package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts +183 -0
  97. package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts.map +1 -0
  98. package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js +761 -0
  99. package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js.map +1 -0
  100. package/dist/lib/components/realtime/interactive-component/interactive-component-config.d.ts +25 -0
  101. package/dist/lib/components/realtime/interactive-component/interactive-component-config.d.ts.map +1 -0
  102. package/dist/lib/components/realtime/interactive-component/interactive-component-config.js +57 -0
  103. package/dist/lib/components/realtime/interactive-component/interactive-component-config.js.map +1 -0
  104. package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.d.ts +40 -0
  105. package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.d.ts.map +1 -0
  106. package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.js +97 -0
  107. package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.js.map +1 -0
  108. package/dist/lib/components/realtime/interactive-component/interactive-component-types.d.ts +144 -0
  109. package/dist/lib/components/realtime/interactive-component/interactive-component-types.d.ts.map +1 -0
  110. package/dist/lib/components/realtime/interactive-component/interactive-component-types.js +57 -0
  111. package/dist/lib/components/realtime/interactive-component/interactive-component-types.js.map +1 -0
  112. package/dist/lib/components/realtime/interactive-component/react-component-handle.d.ts +36 -0
  113. package/dist/lib/components/realtime/interactive-component/react-component-handle.d.ts.map +1 -0
  114. package/dist/lib/components/realtime/interactive-component/react-component-handle.js +55 -0
  115. package/dist/lib/components/realtime/interactive-component/react-component-handle.js.map +1 -0
  116. package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.d.ts +55 -0
  117. package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.d.ts.map +1 -0
  118. package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.js +210 -0
  119. package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.js.map +1 -0
  120. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.d.ts +32 -0
  121. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.d.ts.map +1 -0
  122. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js +90 -0
  123. package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js.map +1 -0
  124. package/dist/lib/components/realtime/media/media-channel.d.ts +7 -0
  125. package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
  126. package/dist/lib/components/realtime/media/media-channel.js +28 -1
  127. package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
  128. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +8 -1
  129. package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
  130. package/dist/lib/components/realtime/realtime-agent-banner.component.js +89 -71
  131. package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
  132. package/dist/lib/components/realtime/realtime-agent-orb.component.d.ts +21 -0
  133. package/dist/lib/components/realtime/realtime-agent-orb.component.d.ts.map +1 -0
  134. package/dist/lib/components/realtime/realtime-agent-orb.component.js +49 -0
  135. package/dist/lib/components/realtime/realtime-agent-orb.component.js.map +1 -0
  136. package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +44 -11
  137. package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
  138. package/dist/lib/components/realtime/realtime-agent-picker.component.js +162 -50
  139. package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
  140. package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +8 -2
  141. package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -1
  142. package/dist/lib/components/realtime/realtime-audio-visuals.js +14 -18
  143. package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -1
  144. package/dist/lib/components/realtime/realtime-composer.component.d.ts +42 -2
  145. package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
  146. package/dist/lib/components/realtime/realtime-composer.component.js +137 -102
  147. package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
  148. package/dist/lib/components/realtime/realtime-perception-chip.component.d.ts +71 -0
  149. package/dist/lib/components/realtime/realtime-perception-chip.component.d.ts.map +1 -0
  150. package/dist/lib/components/realtime/realtime-perception-chip.component.js +221 -0
  151. package/dist/lib/components/realtime/realtime-perception-chip.component.js.map +1 -0
  152. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +264 -22
  153. package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
  154. package/dist/lib/components/realtime/realtime-session-overlay.component.js +851 -135
  155. package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
  156. package/dist/lib/components/realtime/realtime-surface-placement-prefs.d.ts +14 -0
  157. package/dist/lib/components/realtime/realtime-surface-placement-prefs.d.ts.map +1 -0
  158. package/dist/lib/components/realtime/realtime-surface-placement-prefs.js +14 -0
  159. package/dist/lib/components/realtime/realtime-surface-placement-prefs.js.map +1 -0
  160. package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts +74 -0
  161. package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts.map +1 -0
  162. package/dist/lib/components/realtime/realtime-surface-stage.model.js +171 -0
  163. package/dist/lib/components/realtime/realtime-surface-stage.model.js.map +1 -0
  164. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +71 -13
  165. package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
  166. package/dist/lib/components/realtime/realtime-surface-tabs.component.js +232 -73
  167. package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
  168. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +5 -0
  169. package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
  170. package/dist/lib/components/realtime/realtime-surface-tabs.model.js +8 -0
  171. package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
  172. package/dist/lib/components/realtime/realtime-ui-config.d.ts +12 -2
  173. package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
  174. package/dist/lib/components/realtime/realtime-ui-config.js +5 -1
  175. package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
  176. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +10 -1
  177. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
  178. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +42 -2
  179. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
  180. package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +20 -3
  181. package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -1
  182. package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +44 -10
  183. package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -1
  184. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +28 -44
  185. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  186. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +76 -162
  187. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  188. package/dist/lib/components/search/search-panel.component.d.ts +2 -0
  189. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  190. package/dist/lib/components/search/search-panel.component.js +25 -12
  191. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  192. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +22 -31
  193. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  194. package/dist/lib/components/workspace/conversation-workspace.component.js +50 -63
  195. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  196. package/dist/lib/conversations.module.d.ts +30 -29
  197. package/dist/lib/conversations.module.d.ts.map +1 -1
  198. package/dist/lib/conversations.module.js +27 -5
  199. package/dist/lib/conversations.module.js.map +1 -1
  200. package/dist/lib/events/chat-events.d.ts +25 -0
  201. package/dist/lib/events/chat-events.d.ts.map +1 -1
  202. package/dist/lib/events/chat-events.js +36 -0
  203. package/dist/lib/events/chat-events.js.map +1 -1
  204. package/dist/lib/models/agent-turn.model.d.ts +5 -0
  205. package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
  206. package/dist/lib/models/agent-turn.model.js.map +1 -1
  207. package/dist/lib/services/agent-state.service.d.ts +34 -8
  208. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  209. package/dist/lib/services/agent-state.service.js +82 -29
  210. package/dist/lib/services/agent-state.service.js.map +1 -1
  211. package/dist/lib/services/artifact-state.service.d.ts +0 -9
  212. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  213. package/dist/lib/services/artifact-state.service.js +1 -32
  214. package/dist/lib/services/artifact-state.service.js.map +1 -1
  215. package/dist/lib/services/browser-realtime-media-host.d.ts +12 -0
  216. package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -1
  217. package/dist/lib/services/browser-realtime-media-host.js +19 -0
  218. package/dist/lib/services/browser-realtime-media-host.js.map +1 -1
  219. package/dist/lib/services/browser-recording-unload-guard.d.ts +30 -0
  220. package/dist/lib/services/browser-recording-unload-guard.d.ts.map +1 -0
  221. package/dist/lib/services/browser-recording-unload-guard.js +43 -0
  222. package/dist/lib/services/browser-recording-unload-guard.js.map +1 -0
  223. package/dist/lib/services/conversation-agent.service.d.ts +35 -11
  224. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  225. package/dist/lib/services/conversation-agent.service.js +65 -20
  226. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  227. package/dist/lib/services/conversation-detail-window.store.d.ts +22 -4
  228. package/dist/lib/services/conversation-detail-window.store.d.ts.map +1 -1
  229. package/dist/lib/services/conversation-detail-window.store.js +50 -9
  230. package/dist/lib/services/conversation-detail-window.store.js.map +1 -1
  231. package/dist/lib/services/conversation-naming.d.ts +72 -22
  232. package/dist/lib/services/conversation-naming.d.ts.map +1 -1
  233. package/dist/lib/services/conversation-naming.js +84 -10
  234. package/dist/lib/services/conversation-naming.js.map +1 -1
  235. package/dist/lib/services/data-cache.service.d.ts +13 -5
  236. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  237. package/dist/lib/services/data-cache.service.js +39 -19
  238. package/dist/lib/services/data-cache.service.js.map +1 -1
  239. package/dist/lib/services/export.service.d.ts +26 -9
  240. package/dist/lib/services/export.service.d.ts.map +1 -1
  241. package/dist/lib/services/export.service.js +61 -18
  242. package/dist/lib/services/export.service.js.map +1 -1
  243. package/dist/lib/services/realtime-audio-recorder.d.ts +33 -5
  244. package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -1
  245. package/dist/lib/services/realtime-audio-recorder.js +71 -11
  246. package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
  247. package/dist/lib/services/realtime-pairing.d.ts +10 -5
  248. package/dist/lib/services/realtime-pairing.d.ts.map +1 -1
  249. package/dist/lib/services/realtime-pairing.js +15 -6
  250. package/dist/lib/services/realtime-pairing.js.map +1 -1
  251. package/dist/lib/services/realtime-session.service.d.ts +3 -2
  252. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  253. package/dist/lib/services/realtime-session.service.js +7 -2
  254. package/dist/lib/services/realtime-session.service.js.map +1 -1
  255. package/dist/lib/services/search.service.d.ts +7 -2
  256. package/dist/lib/services/search.service.d.ts.map +1 -1
  257. package/dist/lib/services/search.service.js +13 -4
  258. package/dist/lib/services/search.service.js.map +1 -1
  259. package/dist/lib/util/frame-zone.d.ts +10 -0
  260. package/dist/lib/util/frame-zone.d.ts.map +1 -0
  261. package/dist/lib/util/frame-zone.js +10 -0
  262. package/dist/lib/util/frame-zone.js.map +1 -0
  263. package/dist/lib/utils/conversation-branching.d.ts +4 -0
  264. package/dist/lib/utils/conversation-branching.d.ts.map +1 -0
  265. package/dist/lib/utils/conversation-branching.js +5 -0
  266. package/dist/lib/utils/conversation-branching.js.map +1 -0
  267. package/dist/lib/utils/conversation-forks.d.ts +315 -0
  268. package/dist/lib/utils/conversation-forks.d.ts.map +1 -0
  269. package/dist/lib/utils/conversation-forks.js +456 -0
  270. package/dist/lib/utils/conversation-forks.js.map +1 -0
  271. package/dist/public-api.d.ts +23 -1
  272. package/dist/public-api.d.ts.map +1 -1
  273. package/dist/public-api.js +30 -1
  274. package/dist/public-api.js.map +1 -1
  275. package/package.json +37 -32
  276. package/dist/lib/components/thread/thread-panel.component.d.ts +0 -126
  277. package/dist/lib/components/thread/thread-panel.component.d.ts.map +0 -1
  278. package/dist/lib/components/thread/thread-panel.component.js +0 -440
  279. package/dist/lib/components/thread/thread-panel.component.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-channel.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EACH,iCAAiC,EAEjC,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C;QAC7G,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,KAAK,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;IAED,yCAAyC;IACjC,UAAU,CAAC,MAA+B;QAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QACpF,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACK,cAAc,CAAC,MAA4B;QAC/C,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxD,OAAO;QACX,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE;YAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;CACJ,CAAA;AAxuBY,2BAA2B;IADvC,aAAa,CAAC,yBAAyB,EAAE,yCAAyC,CAAC;GACvE,2BAA2B,CAwuBvC;;AAED;;;;GAIG;AACH,MAAM,UAAU,uCAAuC;IACnD,sEAAsE;AAC1E,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport type { JSONObject, RealtimeToolDefinition } from '@memberjunction/ai';\nimport {\n REALTIME_CHANNEL_CONTRACT_VERSION,\n type RealtimeChannelActor,\n ValidateJsonAgainstSchemaSubset,\n type RealtimeChannelDescriptor,\n type RealtimeChannelEventSpec,\n type RealtimeChannelVerb,\n} from '@memberjunction/ai-core-plus';\nimport { LogError } from '@memberjunction/core';\nimport { IsPlainObject, RegisterClass } from '@memberjunction/global';\nimport {\n BaseRealtimeChannelClient,\n FormatChannelNote,\n FormatParameterList,\n type ChannelOnboardingDetails,\n type ParsedDelegationArtifact,\n type RealtimeChannelVerbResult,\n} from '@memberjunction/realtime-runtime';\nimport { DeriveComponentContract, MergeVerbOffers, type DerivedVerb } from './component-contract';\nimport { SummarizeDataState, ToBoundedJson } from './component-data-state';\nimport { ComponentInstanceEngine, InstanceLimitError, type ComponentInstanceRecord } from './component-instance-engine';\nimport { ParseInteractiveComponentConfig } from './interactive-component-config';\nimport { ChannelFrameCapture } from '@memberjunction/ng-realtime-channels';\nimport { RealtimeInteractiveComponentSurfaceComponent } from './realtime-interactive-component-surface.component';\nimport { RunViewComponentArtifactSource } from './run-view-component-artifact-source';\nimport {\n BUILTIN_VERBS,\n ComponentArtifactError,\n DEFAULT_INTERACTIVE_COMPONENT_CONFIG,\n INTERACTIVE_COMPONENT_CHANNEL_KEY,\n INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS,\n type ComponentActivity,\n type ComponentVersionChangeReason,\n type IComponentArtifactSource,\n type IInteractiveComponentHandle,\n type InteractiveComponentConfig,\n type ResolvedComponentArtifact,\n} from './interactive-component-types';\n\n/** How long a verb waits for a freshly opened component to finish initializing (the poll interval times the attempt cap). */\nconst HANDLE_POLL_INTERVAL_MS = 100;\nconst HANDLE_POLL_MAX_ATTEMPTS = 80;\n\n/** How long after the user (or the agent) acts the data is read once more, because a component's data arrives after the action that asked for it. */\nconst DATA_SETTLE_MS = 1200;\n\n/** The events every instance can report, whatever its spec declares. */\nconst BUILTIN_EVENTS: readonly RealtimeChannelEventSpec[] = [\n { Name: 'opened', Description: 'A component was opened. Carries the inputs it was opened with.' },\n { Name: 'closed', Description: 'A component was closed.' },\n {\n Name: 'version_changed',\n Description: 'A component now shows a different version of its artifact (you asked for it, or a newer version appeared).',\n PayloadSchema: {\n type: 'object',\n properties: {\n from: { type: 'string', description: 'The version id it showed.' },\n to: { type: 'string', description: 'The version id it shows now.' },\n reason: { type: 'string', enum: ['agent', 'newer-version'] },\n },\n },\n },\n {\n Name: 'newer_version_available',\n Description: 'A newer version of an open component exists, and this session is not set to swap to it automatically.',\n PayloadSchema: { type: 'object', properties: { current: { type: 'string' }, available: { type: 'string' } } },\n },\n];\n\n/** A failure the dispatcher turns into a message the model can act on. */\nfunction failure(code: string, error: string, details?: string[]): RealtimeChannelVerbResult {\n return details ? { Success: false, ErrorCode: code, Error: error, Details: details } : { Success: false, ErrorCode: code, Error: error };\n}\n\n/** A non-empty string argument, or `undefined`. */\nfunction readString(bag: JSONObject, key: string): string | undefined {\n const value = bag[key];\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * The INTERACTIVE COMPONENT channel: shows the user any interactive component artifact (a dashboard, a report, a\n * form, a chart) next to the voice conversation, and lets the agent operate it.\n *\n * It is a MULTI-INSTANCE channel (several components may be open at once, each addressed by `target.instance`) and\n * its contract is DERIVED from what it hosts: the actions an agent can take on an instance are that component's own\n * `customMethods` and the standard methods its spec says it supports; its state is the component's data state;\n * its events are the spec's `events`; the inputs for opening it are the spec's `properties`. A component nobody\n * wrote channel code for is therefore operable from its spec alone. See `DeriveComponentContract`.\n *\n * Built-in: `open { artifactId | artifactVersionId, inputs? }` (the dispatcher's reserved action), `show_version`, `close`.\n *\n * ### What the model perceives\n * Per instance: which artifact version is open, what the user last did in it (its events), and its data state,\n * bounded to a handful of rows. All of it is gated by exposure policy (`min(channel, agent config, zero-data-retention,\n * user)`). Pixels flow only if the host registered a frame capturer ({@link ChannelFrameCapture}).\n * Agent-INVOKED verbs return what the component returns; exposure gates what is volunteered to the model, not what it\n * asked for.\n *\n * ### Access\n * Artifacts are loaded through the signed-in user's own session and read permission (see `RunViewComponentArtifactSource`).\n * The agent cannot open anything the user cannot.\n *\n * ### Lifetime\n * Open components are live-only: they are not persisted with the session and are not restored on resume.\n */\n@RegisterClass(BaseRealtimeChannelClient, INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS)\nexport class InteractiveComponentChannel extends BaseRealtimeChannelClient<RealtimeInteractiveComponentSurfaceComponent> {\n /** The components that are open. */\n public readonly Engine = new ComponentInstanceEngine(DEFAULT_INTERACTIVE_COMPONENT_CONFIG.MaxInstances);\n\n /** The resolved configuration; the defaults until {@link Initialize} reads the cascade. */\n public Config: InteractiveComponentConfig = { ...DEFAULT_INTERACTIVE_COMPONENT_CONFIG };\n\n /** How long a verb waits for a component to initialize; overridable so tests need not sleep. */\n protected HandlePollIntervalMs = HANDLE_POLL_INTERVAL_MS;\n /** How long after an action the data state is re-read; overridable for tests. */\n protected DataSettleMs = DATA_SETTLE_MS;\n\n private artifactSource: IComponentArtifactSource | null = null;\n private surface: RealtimeInteractiveComponentSurfaceComponent | null = null;\n private settleTimer: ReturnType<typeof setTimeout> | null = null;\n\n public get ChannelName(): string {\n return INTERACTIVE_COMPONENT_CHANNEL_KEY;\n }\n\n /**\n * The id state notes carry. A multi-instance channel's snapshot describes ALL its instances (keyed by their own ids,\n * `c1`, `c2`, ...), so the notes about the snapshot as a whole are addressed to `all` rather than to one of them.\n */\n public override get InstanceId(): string {\n return 'all';\n }\n\n public override get TabTitle(): string {\n return 'Components';\n }\n\n public override get TabIcon(): string {\n return 'fa-solid fa-cubes';\n }\n\n /** The channel has no native tools: every verb is reached through the `ContextTool` proxy, because the verbs depend on what is open. */\n public override GetToolDefinitions(): RealtimeToolDefinition[] {\n return [];\n }\n\n /**\n * Replaces where artifacts are loaded from (a host with its own store, or a test). Without it the channel loads\n * through the session's provider and the signed-in user's access.\n */\n public SetArtifactSource(source: IComponentArtifactSource | null): void {\n this.artifactSource = source;\n }\n\n // ── Contract: descriptor ───────────────────────────────────────────────────\n\n /**\n * The channel's self-description. The verbs and events are the built-ins plus those of every component that is\n * open right now, so the contract grows as components are opened and the dispatcher validates against it.\n */\n public override GetDescriptor(): RealtimeChannelDescriptor {\n return {\n Key: this.ChannelName,\n Version: REALTIME_CHANNEL_CONTRACT_VERSION,\n DisplayName: 'Interactive Components',\n OwningPackage: '@memberjunction/ng-conversations',\n Instructions:\n 'Shows the user an interactive component (a dashboard, report, chart or form) built as an artifact, next to the conversation. ' +\n 'Open one with action \"open\" and an artifactId (its latest version) or an artifactVersionId. The result lists the actions THAT component supports ' +\n 'and the events it reports; use them as actions of this channel. Several components can be open: pass the instance id to say which, ' +\n 'otherwise the one the user is looking at is used. You can open components other agents built (they come back as artifacts). ' +\n 'You are told what the user is looking at and what they do in it; do not narrate routine changes.',\n Nouns: [\n {\n Name: 'components',\n Description:\n 'The open components keyed by instance id: which artifact version each shows, whether it is the one the user is looking at, ' +\n 'what the user last did in it, and (when the component reports one) a bounded summary of its data.',\n Schema: { type: 'object', additionalProperties: { type: 'object' } },\n },\n ],\n Verbs: this.collectVerbs(),\n Inputs: {\n type: 'object',\n properties: {\n artifactId: { type: 'string', description: 'The artifact to open (its latest version is shown).' },\n artifactVersionId: { type: 'string', description: 'A specific artifact version to open (instead of artifactId).' },\n inputs: { type: 'object', description: 'Values for the component\\'s own properties, as its spec declares them.' },\n },\n additionalProperties: false,\n },\n Events: this.collectEvents(),\n DisplayPolicy: 'on-demand',\n DefaultAvailability: 'opt-in',\n MaxExposure: 'pixels',\n MultiInstance: true,\n };\n }\n\n /** The built-in verbs plus each open component's, merged by name. */\n private collectVerbs(): RealtimeChannelVerb[] {\n const builtins: RealtimeChannelVerb[] = [\n {\n Name: BUILTIN_VERBS.ShowVersion,\n Description: 'Shows another version of an open component\\'s own artifact in place (the instance stays open and keeps its id).',\n ParametersSchema: {\n type: 'object',\n properties: { versionId: { type: 'string', description: 'The artifact version to show.' } },\n required: ['versionId'],\n additionalProperties: false,\n },\n InvokableBy: 'agent',\n },\n {\n Name: BUILTIN_VERBS.Close,\n Description: 'Closes an open component.',\n ParametersSchema: { type: 'object', properties: {}, additionalProperties: false },\n InvokableBy: 'agent',\n },\n ];\n const byName = new Map<string, Array<{ Component: string; Verb: RealtimeChannelVerb }>>();\n for (const record of this.Engine.Instances) {\n for (const derived of record.Contract.Verbs) {\n const key = derived.Verb.Name.toLowerCase();\n const offers = byName.get(key) ?? [];\n offers.push({ Component: record.Artifact.Name, Verb: derived.Verb });\n byName.set(key, offers);\n }\n }\n return [...builtins, ...[...byName.values()].map((offers) => MergeVerbOffers(offers))];\n }\n\n /** The built-in events plus each open component's declared ones. */\n private collectEvents(): RealtimeChannelEventSpec[] {\n const events = new Map<string, RealtimeChannelEventSpec>(BUILTIN_EVENTS.map((e) => [e.Name.toLowerCase(), e]));\n for (const record of this.Engine.Instances) {\n for (const event of record.Contract.Events) {\n if (!events.has(event.Name.toLowerCase())) {\n events.set(event.Name.toLowerCase(), event);\n }\n }\n }\n return [...events.values()];\n }\n\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Interactive components',\n Description:\n 'The agent can open an interactive component — a dashboard, report or form — right here during the call, and work with it alongside you.',\n Tips: [\n 'Switch between open components using the tabs along the top.',\n 'The agent sees what you select and change, so you can say \"this one\" and point.',\n 'Use the \"Agent can see\" control to limit what the agent perceives.',\n ],\n IconClass: 'fa-solid fa-cubes',\n };\n }\n\n // ── Lifecycle ──────────────────────────────────────────────────────────────\n\n protected override OnInitialize(): void {\n const parsed = ParseInteractiveComponentConfig(this.Context?.ChannelConfig);\n this.Config = parsed.Config;\n this.Engine.SetMaxInstances(this.Config.MaxInstances);\n for (const problem of parsed.Problems) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Configuration: ${problem}`);\n }\n if (!this.artifactSource) {\n const provider = this.Context?.Provider;\n const user = provider?.CurrentUser;\n if (provider && user) {\n this.artifactSource = new RunViewComponentArtifactSource(provider, user);\n }\n }\n this.enableVisualPerceptionIfAvailable();\n }\n\n /** Opts into pixels only when the host registered something that can rasterize a component. */\n private enableVisualPerceptionIfAvailable(): void {\n if (!ChannelFrameCapture.Instance.Capturer) {\n return;\n }\n this.EnableVisualPerception({ GetLatestFrame: () => this.CaptureActiveFrame() });\n }\n\n /**\n * A picture of the component the user is looking at, as base64 JPEG, or `null` when there is none to send: exposure is\n * below `pixels`, the session has no inbound video track, nothing is on screen, or the host's rasterizer produced nothing\n * (it reports why, once, itself). Never throws.\n *\n * The base channel's visual pump has already checked exposure and the track before it asks; they are checked again so a\n * frame is never rasterized (the costly part) for a model that may not see it, whoever asks.\n */\n protected async CaptureActiveFrame(): Promise<string | null> {\n const capturer = ChannelFrameCapture.Instance.Capturer;\n if (!capturer || this.Exposure !== 'pixels' || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return null;\n }\n const element = this.surface?.GetActiveElement() ?? null;\n if (!element) {\n return null;\n }\n try {\n return await capturer(element);\n } catch (error) {\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Capturing a component frame failed: ${error instanceof Error ? error.message : String(error)}`);\n return null;\n }\n }\n\n public override GetSurfaceComponent(): Type<RealtimeInteractiveComponentSurfaceComponent> {\n return RealtimeInteractiveComponentSurfaceComponent;\n }\n\n /** Hands the dynamically created surface the engine it renders and the hooks it reports through. */\n public override BindSurface(instance: RealtimeInteractiveComponentSurfaceComponent): void {\n this.surface = instance;\n instance.Engine = this.Engine;\n instance.AgentName = this.Context?.AgentName ?? 'The agent';\n instance.Provider = this.Context?.Provider ?? null;\n instance.ActivityHandler = (instanceId: string, activity: ComponentActivity) => this.OnComponentActivity(instanceId, activity);\n }\n\n public override UnbindSurface(): void {\n this.surface = null;\n }\n\n public override Dispose(): void {\n if (this.settleTimer !== null) {\n clearTimeout(this.settleTimer);\n this.settleTimer = null;\n }\n this.surface = null;\n this.Engine.Dispose();\n super.Dispose();\n }\n\n // ── Contract: state ────────────────────────────────────────────────────────\n\n /**\n * Open components are LIVE-ONLY: there is no state of record to persist, so nothing is saved with the session\n * (`null`, which the host never writes) and {@link RestoreState} refuses what it is offered. A resumed session starts\n * with no component open; the agent opens them again. What the model perceives right now is {@link GetState}.\n */\n public override SerializeState(): string | null {\n return null;\n }\n\n /** Live-only: a resumed session never restores open components (see {@link SerializeState}). Always `false`. */\n public override RestoreState(_stateJson: string): boolean {\n return false;\n }\n\n /** The open components, keyed by instance id (see the `components` noun). A pure read. */\n public override GetState(): JSONObject {\n const components: JSONObject = {};\n for (const record of this.Engine.Instances) {\n components[record.InstanceID] = this.describeForState(record);\n }\n return { components };\n }\n\n /** One instance as the model perceives it. */\n private describeForState(record: ComponentInstanceRecord): JSONObject {\n const entry: JSONObject = {\n name: record.Artifact.Name,\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n active: this.Engine.ActiveID === record.InstanceID,\n };\n if (Object.keys(record.Inputs).length > 0) {\n entry['inputs'] = ToBoundedJson(record.Inputs);\n }\n if (record.LastEvent) {\n entry['lastEvent'] = { type: record.LastEvent.Type, payload: record.LastEvent.Payload, seq: record.LastEvent.Seq };\n }\n if (record.Contract.SupportsDataState && record.Handle?.IsReady) {\n const data = SummarizeDataState(record.Handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n if (data) {\n entry['data'] = data;\n }\n }\n return entry;\n }\n\n // ── Opening ────────────────────────────────────────────────────────────────\n\n /**\n * Loads the artifact and opens it as a new instance (or, when that artifact is already open, brings the existing\n * instance forward and moves it to the requested version). Refusals are structured results, never exceptions.\n */\n protected override async OnOpen(inputs: JSONObject): Promise<RealtimeChannelVerbResult> {\n const artifactId = readString(inputs, 'artifactId');\n const versionId = readString(inputs, 'artifactVersionId');\n if ((artifactId === undefined) === (versionId === undefined)) {\n return failure('invalid_params', 'Provide exactly one of artifactId (the latest version) or artifactVersionId (a specific version).');\n }\n const source = this.artifactSource;\n if (!source) {\n return failure('open_failed', 'Components cannot be loaded in this session (no signed-in user to load them for).');\n }\n let artifact: ResolvedComponentArtifact;\n try {\n artifact = versionId ? await source.LoadVersion(versionId) : await source.LoadLatest(artifactId as string);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n const existing = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (existing) {\n return this.reuseOpenInstance(existing, artifact);\n }\n return this.addInstance(artifact, inputs);\n }\n\n /** Opens a new instance for a loaded artifact. */\n private addInstance(artifact: ResolvedComponentArtifact, inputs: JSONObject): RealtimeChannelVerbResult {\n const componentInputs = IsPlainObject(inputs['inputs']) ? (inputs['inputs'] as JSONObject) : {};\n const contractIssues = ValidateJsonAgainstSchemaSubset(componentInputs, this.inputsSchemaFor(artifact), '$.inputs');\n if (contractIssues.length > 0) {\n return failure('invalid_params', `The inputs for \"${artifact.Name}\" are invalid.`, contractIssues);\n }\n try {\n const record = this.Engine.Add(artifact, componentInputs);\n return { Success: true, Instance: record.InstanceID, Result: this.describeOpened(record) };\n } catch (error) {\n if (error instanceof InstanceLimitError) {\n return failure('open_failed', error.message, [`open: ${this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ')}`]);\n }\n throw error;\n }\n }\n\n /** The inputs schema a freshly derived contract would have, so opening is validated before an instance exists. */\n private inputsSchemaFor(artifact: ResolvedComponentArtifact): JSONObject {\n return DeriveComponentContract(artifact.Spec).InputsSchema;\n }\n\n /** An artifact that is already open is not opened twice: focus it, and show the requested version. */\n private async reuseOpenInstance(existing: ComponentInstanceRecord, artifact: ResolvedComponentArtifact): Promise<RealtimeChannelVerbResult> {\n this.Engine.SetActive(existing.InstanceID);\n if (existing.Artifact.VersionID !== artifact.VersionID) {\n this.swapVersion(existing, artifact, 'agent');\n }\n return {\n Success: true,\n Instance: existing.InstanceID,\n Result: { ...this.describeOpened(existing), alreadyOpen: true },\n };\n }\n\n /** What the agent is told when it opens (or revisits) a component: how to operate it. */\n private describeOpened(record: ComponentInstanceRecord): JSONObject {\n return {\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n name: record.Artifact.Name,\n actions: record.Contract.Verbs.map((v) => `${v.Verb.Name}(${FormatParameterList(v.Verb.ParametersSchema)}) — ${v.Verb.Description}`),\n events: record.Contract.Events.map((e) => e.Name),\n ...(record.Contract.Skipped.length > 0\n ? { unavailable: record.Contract.Skipped.map((s) => `${s.Name}: ${s.Reason}`) }\n : {}),\n };\n }\n\n /** Maps a failed artifact load to a result the model can act on. */\n private mapLoadFailure(error: unknown): RealtimeChannelVerbResult {\n if (error instanceof ComponentArtifactError) {\n return failure(error.Code === 'invalid_id' ? 'invalid_params' : 'open_failed', error.message, [error.Code]);\n }\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Loading a component artifact failed: ${error instanceof Error ? error.message : String(error)}`);\n return failure('open_failed', 'That artifact could not be loaded.');\n }\n\n // ── Delegated artifacts ────────────────────────────────────────────────────\n\n /**\n * Asks to be offered a delegated run's artifacts when the operator turned on auto-open, or when one of them is\n * already open here (so a revised version replaces it). Whether an artifact is a component is only known once it\n * is loaded, so with auto-open on the channel is mounted for any delegated artifact and ignores the ones that are not.\n */\n public override AcceptsDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[], config: JSONObject): boolean {\n if (artifacts.some((a) => this.Engine.FindByArtifact(a.ArtifactID))) {\n return true;\n }\n return artifacts.length > 0 && ParseInteractiveComponentConfig(config).Config.AutoOpenDelegatedComponents;\n }\n\n /**\n * Takes a delegated run's artifacts: an artifact that is already open moves to its newer version (or, when the\n * configuration says not to swap, the agent is told one exists); with auto-open on, a component that is not open is opened.\n */\n public override async OnDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[]): Promise<void> {\n for (const artifact of artifacts) {\n const open = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (open) {\n await this.takeNewerVersion(open, artifact);\n } else if (this.Config.AutoOpenDelegatedComponents) {\n await this.autoOpen(artifact);\n }\n }\n }\n\n /** Opens a delegated artifact; one that is not a component is ignored (expected), anything else is logged. */\n private async autoOpen(artifact: ParsedDelegationArtifact): Promise<void> {\n const opened = await this.Open({ artifactVersionId: artifact.ArtifactVersionID });\n if (!opened.Success && !(opened.Details ?? []).includes('not_a_component')) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not open delegated artifact \"${artifact.Name}\": ${opened.Error ?? opened.ErrorCode}`);\n }\n }\n\n /** Moves an open instance to the version a delegated run produced, when that version is newer. */\n private async takeNewerVersion(open: ComponentInstanceRecord, artifact: ParsedDelegationArtifact): Promise<void> {\n if (open.Artifact.VersionID.toLowerCase() === artifact.ArtifactVersionID.toLowerCase() || !this.artifactSource) {\n return;\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(artifact.ArtifactVersionID);\n } catch (error) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not load the newer version of \"${open.Artifact.Name}\": ${error instanceof Error ? error.message : String(error)}`);\n return;\n }\n if (loaded.VersionNumber <= open.Artifact.VersionNumber) {\n return;\n }\n if (this.Config.SwapToNewerVersions) {\n this.swapVersion(open, loaded, 'newer-version');\n } else {\n this.EmitChannelEvent('newer_version_available', { current: open.Artifact.VersionID, available: loaded.VersionID }, undefined, open.InstanceID);\n if (this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, open.InstanceID, 'newer_version_available', {\n current: open.Artifact.VersionID,\n available: loaded.VersionID,\n })\n );\n }\n }\n }\n\n // ── Version swap ───────────────────────────────────────────────────────────\n\n /** Shows another version in an existing instance, keeping its id; tells observers, and the model when it did not ask. */\n private swapVersion(record: ComponentInstanceRecord, artifact: ResolvedComponentArtifact, reason: ComponentVersionChangeReason): void {\n const from = record.Artifact.VersionID;\n this.Engine.SwapVersion(record.InstanceID, artifact);\n const payload: JSONObject = { from, to: artifact.VersionID, reason };\n this.EmitChannelEvent('version_changed', payload, undefined, record.InstanceID);\n if (reason === 'newer-version' && this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, record.InstanceID, 'version_changed', {\n ...payload,\n actions: record.Contract.Verbs.map((v) => v.Verb.Name),\n })\n );\n }\n this.RecordChange({ Author: reason === 'agent' ? 'agent' : 'system' });\n }\n\n // ── Verbs ──────────────────────────────────────────────────────────────────\n\n /**\n * Runs one verb. The dispatcher has already checked the verb against the (merged) descriptor; the exact check against\n * the addressed component's own schema happens here.\n */\n public override async ApplyVerb(\n verb: string,\n args: JSONObject,\n actor: RealtimeChannelActor,\n instanceId?: string\n ): Promise<RealtimeChannelVerbResult> {\n const name = verb.trim().toLowerCase();\n const target = this.resolveInstance(name, instanceId);\n if ('Success' in target) {\n return target;\n }\n const refusal = actor === 'agent' ? this.refuseForExposure(target, name) : null;\n if (refusal) {\n return refusal;\n }\n if (name === BUILTIN_VERBS.ShowVersion) {\n return this.showVersion(target, args);\n }\n if (name === BUILTIN_VERBS.Close) {\n return this.closeInstance(target);\n }\n return this.invokeDerived(target, name, args, actor);\n }\n\n /**\n * Refuses a verb whose result carries the component's data while exposure keeps that from the agent. The dispatcher\n * checks the same thing against the (merged) descriptor; this is the exact per-instance check, and it keeps the\n * channel safe when it is driven by something other than the dispatcher.\n */\n private refuseForExposure(record: ComponentInstanceRecord, verbName: string): RealtimeChannelVerbResult | null {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === verbName);\n const message = derived ? this.RefuseVerbForExposure(derived.Verb) : null;\n return message ? failure('exposure_restricted', message, [...this.ExposureReasons]) : null;\n }\n\n /**\n * Finds the instance a verb addresses: the one named, else the one the user is looking at when it supports the verb,\n * else the only one that does. Anything else is a refusal that lists what would have worked.\n */\n private resolveInstance(verb: string, instanceId: string | undefined): ComponentInstanceRecord | RealtimeChannelVerbResult {\n const supports = (r: ComponentInstanceRecord): boolean =>\n verb === BUILTIN_VERBS.ShowVersion || verb === BUILTIN_VERBS.Close || r.Contract.Verbs.some((v) => v.Verb.Name.toLowerCase() === verb);\n if (instanceId !== undefined) {\n const named = this.Engine.Get(instanceId);\n if (!named) {\n return failure('unknown_instance', `No component \"${instanceId}\" is open.`, [`open: ${this.listOpen()}`]);\n }\n return supports(named) ? named : failure('verb_failed', `\"${named.Artifact.Name}\" has no action \"${verb}\".`);\n }\n const candidates = this.Engine.Instances.filter(supports);\n const active = candidates.find((r) => r.InstanceID === this.Engine.ActiveID);\n if (active) {\n return active;\n }\n if (candidates.length === 1) {\n return candidates[0];\n }\n if (candidates.length === 0) {\n return failure('verb_failed', `No open component has an action \"${verb}\".`, [`open: ${this.listOpen() || 'nothing'}`]);\n }\n return failure('ambiguous_instance', `Several open components have \"${verb}\"; say which with the instance.`, [`open: ${this.listOpen()}`]);\n }\n\n /** `c1 (Revenue), c2 (Pipeline)`. */\n private listOpen(): string {\n return this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ');\n }\n\n /** `show_version`: swap an instance to another version of ITS artifact. */\n private async showVersion(record: ComponentInstanceRecord, args: JSONObject): Promise<RealtimeChannelVerbResult> {\n const versionId = readString(args, 'versionId');\n if (!versionId || !this.artifactSource) {\n return failure('invalid_params', versionId ? 'Components cannot be loaded in this session.' : 'show_version needs a versionId.');\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(versionId);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n if (loaded.ArtifactID.toLowerCase() !== record.Artifact.ArtifactID.toLowerCase()) {\n return failure('verb_failed', `That version belongs to a different artifact (\"${loaded.Name}\"). Open it with \"open\" instead.`);\n }\n if (loaded.VersionID.toLowerCase() === record.Artifact.VersionID.toLowerCase()) {\n return { Success: true, Result: { changed: false, instance: record.InstanceID, versionNumber: loaded.VersionNumber } };\n }\n this.swapVersion(record, loaded, 'agent');\n return { Success: true, Result: { changed: true, instance: record.InstanceID, ...this.describeOpened(record) } };\n }\n\n /** `close`. */\n private closeInstance(record: ComponentInstanceRecord): RealtimeChannelVerbResult {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'agent' });\n return { Success: true, Result: { closed: true, instance: record.InstanceID } };\n }\n\n /** Runs a verb derived from the component's spec. */\n private async invokeDerived(\n record: ComponentInstanceRecord,\n name: string,\n args: JSONObject,\n actor: RealtimeChannelActor\n ): Promise<RealtimeChannelVerbResult> {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === name);\n if (!derived) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" has no action \"${name}\".`);\n }\n const issues = ValidateJsonAgainstSchemaSubset(args, derived.Verb.ParametersSchema);\n if (issues.length > 0) {\n return failure(\n 'invalid_params',\n `The parameters for ${derived.Verb.Name} on \"${record.Artifact.Name}\" are invalid. Expected ${derived.Verb.Name}(${FormatParameterList(derived.Verb.ParametersSchema)}).`,\n issues\n );\n }\n const handle = await this.waitForHandle(record);\n if (!handle) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" is still loading. Try again in a moment.`);\n }\n try {\n const result = await this.runBinding(record, handle, derived, args);\n this.afterAction(record, derived, actor);\n return { Success: true, Result: { instance: record.InstanceID, ...result } };\n } catch (error) {\n console.error(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] ${derived.Verb.Name} on \"${record.Artifact.Name}\" threw:`, error);\n return failure('verb_failed', `${derived.Verb.Name} failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /** Waits (bounded) for the surface to mount the component and report it ready. */\n private async waitForHandle(record: ComponentInstanceRecord): Promise<IInteractiveComponentHandle | null> {\n for (let attempt = 0; attempt < HANDLE_POLL_MAX_ATTEMPTS; attempt++) {\n if (record.Handle?.IsReady) {\n return record.Handle;\n }\n if (!this.Engine.Get(record.InstanceID)) {\n return null;\n }\n await new Promise((resolve) => setTimeout(resolve, this.HandlePollIntervalMs));\n }\n return record.Handle?.IsReady ? record.Handle : null;\n }\n\n /** Executes a derived verb against the live component and returns what to tell the model. */\n private async runBinding(\n record: ComponentInstanceRecord,\n handle: IInteractiveComponentHandle,\n derived: DerivedVerb,\n args: JSONObject\n ): Promise<JSONObject> {\n const binding = derived.Binding;\n if (binding.Kind === 'custom') {\n if (!handle.HasMethod(binding.Method)) {\n throw new Error(`the component does not implement ${binding.Method}`);\n }\n const positional = binding.ParameterNames.map((n) => args[n]);\n const returned = await handle.InvokeMethod(binding.Method, positional);\n return { result: ToBoundedJson(returned) };\n }\n switch (binding.Standard) {\n case 'Refresh':\n handle.Refresh();\n return { refreshed: true };\n case 'Print':\n handle.Print();\n return { printing: true };\n case 'Validate':\n return { validation: ToBoundedJson(handle.Validate()) };\n case 'IsDirty':\n return { dirty: handle.IsDirty() };\n case 'Reset':\n handle.Reset();\n return { reset: true };\n case 'ScrollTo':\n return this.scrollTo(handle, args);\n case 'Focus':\n handle.Focus(readString(args, 'target'));\n return { focused: true };\n case 'GetDataState': {\n const data = SummarizeDataState(handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n return data ? { data } : { data: null, note: 'The component has no data state yet.' };\n }\n default:\n throw new Error(`unsupported standard action ${String(binding.Standard)} on ${record.Artifact.Name}`);\n }\n }\n\n /** `scroll_to`: a selector, or an offset. */\n private scrollTo(handle: IInteractiveComponentHandle, args: JSONObject): JSONObject {\n const target = readString(args, 'target');\n if (target !== undefined) {\n handle.ScrollTo(target);\n return { scrolledTo: target };\n }\n const top = typeof args['top'] === 'number' ? args['top'] : undefined;\n const left = typeof args['left'] === 'number' ? args['left'] : undefined;\n if (top === undefined && left === undefined) {\n throw new Error('scroll_to needs a target selector or a top/left offset');\n }\n handle.ScrollTo({ top, left });\n return { scrolled: true };\n }\n\n /** What happens after a verb ran: the state may have changed, and the picture may have too. */\n private afterAction(record: ComponentInstanceRecord, derived: DerivedVerb, actor: RealtimeChannelActor): void {\n const readOnly =\n derived.Binding.Kind === 'standard' &&\n (derived.Binding.Standard === 'GetDataState' || derived.Binding.Standard === 'IsDirty' || derived.Binding.Standard === 'Validate' || derived.Binding.Standard === 'Print');\n if (readOnly) {\n return;\n }\n this.Engine.SetActive(record.InstanceID);\n this.RecordChange({ Author: actor });\n this.scheduleSettle(actor);\n void this.ConfirmVisualChange();\n }\n\n // ── What the user does ─────────────────────────────────────────────────────\n\n /**\n * Called by the surface when something happens inside a rendered component: an event it emits, a state change,\n * or the end of its initialization. Becomes a change in the state the model perceives and a typed event for observers.\n */\n public OnComponentActivity(instanceId: string, activity: ComponentActivity): void {\n const record = this.Engine.Get(instanceId);\n if (!record) {\n return;\n }\n if (activity.Kind === 'closed') {\n this.userClosed(record);\n return;\n }\n if (activity.Kind === 'selected') {\n if (this.Engine.ActiveID !== instanceId) {\n this.Engine.SetActive(instanceId);\n this.RecordChange({ Author: 'user' });\n void this.NotifyVisualChange();\n }\n return;\n }\n if (activity.Kind === 'event' && activity.Name) {\n this.Engine.RecordEvent(instanceId, activity.Name, ToBoundedJson(activity.Payload));\n }\n const changeId = this.RecordChange({ Author: activity.Kind === 'initialized' ? 'system' : 'user' });\n if (activity.Kind === 'event' && activity.Name) {\n this.EmitChannelEvent(activity.Name, { payload: ToBoundedJson(activity.Payload) }, changeId, instanceId);\n }\n this.scheduleSettle('user');\n void this.NotifyVisualChange();\n }\n\n /** The user closed a component's tab. */\n private userClosed(record: ComponentInstanceRecord): void {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name, by: 'user' }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'user' });\n }\n\n /**\n * A component's data usually arrives AFTER the action that asked for it, so the state is described once more shortly\n * afterward. One timer covers a burst.\n */\n private scheduleSettle(author: RealtimeChannelActor): void {\n if (this.settleTimer !== null || this.Exposure === 'none') {\n return;\n }\n this.settleTimer = setTimeout(() => {\n this.settleTimer = null;\n this.RecordChange({ Author: author });\n }, this.DataSettleMs);\n }\n}\n\n/**\n * Tree-shaking prevention: the channel is resolved through the ClassFactory by the registry row's `ClientPluginClass`\n * key, so this static call keeps its `@RegisterClass` side effect from being eliminated by the bundler. Called alongside\n * `LoadRealtimeMediaChannel()`.\n */\nexport function LoadRealtimeInteractiveComponentChannel(): void {\n // intentional no-op: the import side effect performs the registration\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @fileoverview Parsing of the Interactive Component channel's per-channel configuration.
3
+ *
4
+ * The configuration is JSON an operator typed into the config cascade (`channels.config.InteractiveComponent`),
5
+ * so nothing about its shape can be trusted. Each member is read independently and anything that is not valid
6
+ * falls back to its default, reporting what was wrong so a typo is visible rather than silently ignored.
7
+ *
8
+ * @module @memberjunction/ng-conversations
9
+ */
10
+ import type { JSONObject } from '@memberjunction/ai';
11
+ import { type InteractiveComponentConfig } from './interactive-component-types';
12
+ /** The outcome of {@link ParseInteractiveComponentConfig}. */
13
+ export interface ParsedInteractiveComponentConfig {
14
+ /** The resolved configuration: defaults for anything absent or invalid. */
15
+ Config: InteractiveComponentConfig;
16
+ /** One sentence per member that was present but invalid (empty when the configuration was clean). */
17
+ Problems: string[];
18
+ }
19
+ /**
20
+ * Resolves the channel's configuration from the JSON the cascade supplied.
21
+ *
22
+ * @param raw The channel's resolved `config` bag (`RealtimeChannelContext.ChannelConfig`), or nothing.
23
+ */
24
+ export declare function ParseInteractiveComponentConfig(raw: Readonly<JSONObject> | undefined | null): ParsedInteractiveComponentConfig;
25
+ //# sourceMappingURL=interactive-component-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-config.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAA+D,KAAK,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE7I,8DAA8D;AAC9D,MAAM,WAAW,gCAAgC;IAC7C,2EAA2E;IAC3E,MAAM,EAAE,0BAA0B,CAAC;IACnC,qGAAqG;IACrG,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAmCD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,gCAAgC,CAe9H"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @fileoverview Parsing of the Interactive Component channel's per-channel configuration.
3
+ *
4
+ * The configuration is JSON an operator typed into the config cascade (`channels.config.InteractiveComponent`),
5
+ * so nothing about its shape can be trusted. Each member is read independently and anything that is not valid
6
+ * falls back to its default, reporting what was wrong so a typo is visible rather than silently ignored.
7
+ *
8
+ * @module @memberjunction/ng-conversations
9
+ */
10
+ import { IsPlainObject } from '@memberjunction/global';
11
+ import { DEFAULT_INTERACTIVE_COMPONENT_CONFIG, MAX_INSTANCES_CEILING } from './interactive-component-types';
12
+ /** Reads an integer in `[min, max]`, recording a problem when the value is present but unusable. */
13
+ function readBoundedInteger(raw, key, fallback, min, max, problems) {
14
+ const value = raw[key];
15
+ if (value === undefined) {
16
+ return fallback;
17
+ }
18
+ if (typeof value === 'number' && Number.isInteger(value) && value >= min && value <= max) {
19
+ return value;
20
+ }
21
+ problems.push(`"${key}" must be a whole number from ${min} to ${max}; using ${fallback}.`);
22
+ return fallback;
23
+ }
24
+ /** Reads a boolean, recording a problem when the value is present but not one. */
25
+ function readBoolean(raw, key, fallback, problems) {
26
+ const value = raw[key];
27
+ if (value === undefined) {
28
+ return fallback;
29
+ }
30
+ if (typeof value === 'boolean') {
31
+ return value;
32
+ }
33
+ problems.push(`"${key}" must be true or false; using ${fallback}.`);
34
+ return fallback;
35
+ }
36
+ /**
37
+ * Resolves the channel's configuration from the JSON the cascade supplied.
38
+ *
39
+ * @param raw The channel's resolved `config` bag (`RealtimeChannelContext.ChannelConfig`), or nothing.
40
+ */
41
+ export function ParseInteractiveComponentConfig(raw) {
42
+ const defaults = DEFAULT_INTERACTIVE_COMPONENT_CONFIG;
43
+ if (!IsPlainObject(raw)) {
44
+ return { Config: { ...defaults }, Problems: [] };
45
+ }
46
+ const bag = raw;
47
+ const problems = [];
48
+ const config = {
49
+ AutoOpenDelegatedComponents: readBoolean(bag, 'autoOpenDelegatedComponents', defaults.AutoOpenDelegatedComponents, problems),
50
+ SwapToNewerVersions: readBoolean(bag, 'swapToNewerVersions', defaults.SwapToNewerVersions, problems),
51
+ MaxInstances: readBoundedInteger(bag, 'maxInstances', defaults.MaxInstances, 1, MAX_INSTANCES_CEILING, problems),
52
+ MaxStateRows: readBoundedInteger(bag, 'maxStateRows', defaults.MaxStateRows, 1, 500, problems),
53
+ MaxStateChars: readBoundedInteger(bag, 'maxStateChars', defaults.MaxStateChars, 500, 50000, problems),
54
+ };
55
+ return { Config: config, Problems: problems };
56
+ }
57
+ //# sourceMappingURL=interactive-component-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-config.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,oCAAoC,EAAE,qBAAqB,EAAmC,MAAM,+BAA+B,CAAC;AAU7I,oGAAoG;AACpG,SAAS,kBAAkB,CACvB,GAAe,EACf,GAAW,EACX,QAAgB,EAChB,GAAW,EACX,GAAW,EACX,QAAkB;IAElB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAA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,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,EAAE,qBAAqB,EAAE,QAAQ,CAAC;QAChH,YAAY,EAAE,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC;QAC9F,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC;KACxG,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAClD,CAAC","sourcesContent":["/**\n * @fileoverview Parsing of the Interactive Component channel's per-channel configuration.\n *\n * The configuration is JSON an operator typed into the config cascade (`channels.config.InteractiveComponent`),\n * so nothing about its shape can be trusted. Each member is read independently and anything that is not valid\n * falls back to its default, reporting what was wrong so a typo is visible rather than silently ignored.\n *\n * @module @memberjunction/ng-conversations\n */\n\nimport type { JSONObject } from '@memberjunction/ai';\nimport { IsPlainObject } from '@memberjunction/global';\nimport { DEFAULT_INTERACTIVE_COMPONENT_CONFIG, MAX_INSTANCES_CEILING, type InteractiveComponentConfig } from './interactive-component-types';\n\n/** The outcome of {@link ParseInteractiveComponentConfig}. */\nexport interface ParsedInteractiveComponentConfig {\n /** The resolved configuration: defaults for anything absent or invalid. */\n Config: InteractiveComponentConfig;\n /** One sentence per member that was present but invalid (empty when the configuration was clean). */\n Problems: string[];\n}\n\n/** Reads an integer in `[min, max]`, recording a problem when the value is present but unusable. */\nfunction readBoundedInteger(\n raw: JSONObject,\n key: string,\n fallback: number,\n min: number,\n max: number,\n problems: string[]\n): number {\n const value = raw[key];\n if (value === undefined) {\n return fallback;\n }\n if (typeof value === 'number' && Number.isInteger(value) && value >= min && value <= max) {\n return value;\n }\n problems.push(`\"${key}\" must be a whole number from ${min} to ${max}; using ${fallback}.`);\n return fallback;\n}\n\n/** Reads a boolean, recording a problem when the value is present but not one. */\nfunction readBoolean(raw: JSONObject, key: string, fallback: boolean, problems: string[]): boolean {\n const value = raw[key];\n if (value === undefined) {\n return fallback;\n }\n if (typeof value === 'boolean') {\n return value;\n }\n problems.push(`\"${key}\" must be true or false; using ${fallback}.`);\n return fallback;\n}\n\n/**\n * Resolves the channel's configuration from the JSON the cascade supplied.\n *\n * @param raw The channel's resolved `config` bag (`RealtimeChannelContext.ChannelConfig`), or nothing.\n */\nexport function ParseInteractiveComponentConfig(raw: Readonly<JSONObject> | undefined | null): ParsedInteractiveComponentConfig {\n const defaults = DEFAULT_INTERACTIVE_COMPONENT_CONFIG;\n if (!IsPlainObject(raw)) {\n return { Config: { ...defaults }, Problems: [] };\n }\n const bag = raw as JSONObject;\n const problems: string[] = [];\n const config: InteractiveComponentConfig = {\n AutoOpenDelegatedComponents: readBoolean(bag, 'autoOpenDelegatedComponents', defaults.AutoOpenDelegatedComponents, problems),\n SwapToNewerVersions: readBoolean(bag, 'swapToNewerVersions', defaults.SwapToNewerVersions, problems),\n MaxInstances: readBoundedInteger(bag, 'maxInstances', defaults.MaxInstances, 1, MAX_INSTANCES_CEILING, problems),\n MaxStateRows: readBoundedInteger(bag, 'maxStateRows', defaults.MaxStateRows, 1, 500, problems),\n MaxStateChars: readBoundedInteger(bag, 'maxStateChars', defaults.MaxStateChars, 500, 50000, problems),\n };\n return { Config: config, Problems: problems };\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import type { IMetadataProvider } from '@memberjunction/core';
3
+ import type { ComponentSpec } from '@memberjunction/interactive-component-types';
4
+ import { type ReactComponentEvent } from '@memberjunction/ng-react';
5
+ import type { ComponentActivity, IInteractiveComponentHandle } from './interactive-component-types';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Hosts ONE interactive component for the Interactive Component channel and reports what the channel needs: a live
9
+ * handle once the component has initialized (and `null` while a new version is loading), and what the user does in
10
+ * it.
11
+ *
12
+ * It exists as its own component because a version swap is just a new `Spec` input: the host drops the handle,
13
+ * lets `mj-react-component` reinitialize in place, and hands out a fresh handle when that finishes. The instance
14
+ * (and so its id, tab and place) never changes.
15
+ */
16
+ export declare class InteractiveComponentHostComponent {
17
+ private _spec;
18
+ /** The component to render. A new value is a new version: the handle is dropped until the new one has initialized. */
19
+ set Spec(value: ComponentSpec);
20
+ get Spec(): ComponentSpec;
21
+ /** Values for the component's own properties. */
22
+ Inputs: object;
23
+ /** The session's metadata provider, so the component's data access runs as the signed-in user. */
24
+ Provider: IMetadataProvider | null;
25
+ /** What the user did inside the component. */
26
+ Activity: EventEmitter<ComponentActivity>;
27
+ /** The live handle once the component is ready; `null` when it is not (loading a new version). */
28
+ HandleChange: EventEmitter<IInteractiveComponentHandle | null>;
29
+ private react?;
30
+ private readonly hostRef;
31
+ /** The host's element: what a frame capturer rasterizes to show the model the component. */
32
+ get Element(): HTMLElement;
33
+ /** The component finished initializing (first load or a new version). */
34
+ OnInitialized(): void;
35
+ /** A component event: reported with its type and payload. */
36
+ OnComponentEvent(event: ReactComponentEvent): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveComponentHostComponent, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveComponentHostComponent, "mj-interactive-component-host", never, { "Spec": { "alias": "Spec"; "required": true; }; "Inputs": { "alias": "Inputs"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; }, { "Activity": "Activity"; "HandleChange": "HandleChange"; }, never, never, true, never>;
39
+ }
40
+ //# sourceMappingURL=interactive-component-host.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-host.component.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-host.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,YAAY,EAAoC,MAAM,eAAe,CAAC;AAC/H,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAmC,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAErG,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;;AAEpG;;;;;;;;GAQG;AACH,qBAgCa,iCAAiC;IAC5C,OAAO,CAAC,KAAK,CAAiB;IAE9B,sHAAsH;IACtH,IACW,IAAI,CAAC,KAAK,EAAE,aAAa,EAKnC;IACD,IAAW,IAAI,IAAI,aAAa,CAE/B;IAED,iDAAiD;IACjC,MAAM,EAAE,MAAM,CAAM;IAEpC,kGAAkG;IAClF,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAE1D,8CAA8C;IAC7B,QAAQ,kCAAyC;IAElE,kGAAkG;IACjF,YAAY,mDAA0D;IAEnE,OAAO,CAAC,KAAK,CAAC,CAAmB;IAErD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IAEvE,4FAA4F;IAC5F,IAAW,OAAO,IAAI,WAAW,CAEhC;IAED,yEAAyE;IAClE,aAAa,IAAI,IAAI;IAO5B,6DAA6D;IACtD,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;yCA7C9C,iCAAiC;2CAAjC,iCAAiC;CAgD7C"}
@@ -0,0 +1,97 @@
1
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild, inject } from '@angular/core';
2
+ import { MJReactModule } from '@memberjunction/ng-react';
3
+ import { ReactComponentHandle } from './react-component-handle';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@memberjunction/ng-react";
6
+ const _c0 = ["react"];
7
+ /**
8
+ * Hosts ONE interactive component for the Interactive Component channel and reports what the channel needs: a live
9
+ * handle once the component has initialized (and `null` while a new version is loading), and what the user does in
10
+ * it.
11
+ *
12
+ * It exists as its own component because a version swap is just a new `Spec` input: the host drops the handle,
13
+ * lets `mj-react-component` reinitialize in place, and hands out a fresh handle when that finishes. The instance
14
+ * (and so its id, tab and place) never changes.
15
+ */
16
+ export class InteractiveComponentHostComponent {
17
+ _spec;
18
+ /** The component to render. A new value is a new version: the handle is dropped until the new one has initialized. */
19
+ set Spec(value) {
20
+ if (this._spec !== undefined && value !== this._spec) {
21
+ this.HandleChange.emit(null);
22
+ }
23
+ this._spec = value;
24
+ }
25
+ get Spec() {
26
+ return this._spec;
27
+ }
28
+ /** Values for the component's own properties. */
29
+ Inputs = {};
30
+ /** The session's metadata provider, so the component's data access runs as the signed-in user. */
31
+ Provider = null;
32
+ /** What the user did inside the component. */
33
+ Activity = new EventEmitter();
34
+ /** The live handle once the component is ready; `null` when it is not (loading a new version). */
35
+ HandleChange = new EventEmitter();
36
+ react;
37
+ hostRef = inject(ElementRef);
38
+ /** The host's element: what a frame capturer rasterizes to show the model the component. */
39
+ get Element() {
40
+ return this.hostRef.nativeElement;
41
+ }
42
+ /** The component finished initializing (first load or a new version). */
43
+ OnInitialized() {
44
+ if (this.react) {
45
+ this.HandleChange.emit(new ReactComponentHandle(this.react));
46
+ }
47
+ this.Activity.emit({ Kind: 'initialized' });
48
+ }
49
+ /** A component event: reported with its type and payload. */
50
+ OnComponentEvent(event) {
51
+ this.Activity.emit({ Kind: 'event', Name: event.type, Payload: event.payload });
52
+ }
53
+ static ɵfac = function InteractiveComponentHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InteractiveComponentHostComponent)(); };
54
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InteractiveComponentHostComponent, selectors: [["mj-interactive-component-host"]], viewQuery: function InteractiveComponentHostComponent_Query(rf, ctx) { if (rf & 1) {
55
+ i0.ɵɵviewQuery(_c0, 5);
56
+ } if (rf & 2) {
57
+ let _t;
58
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.react = _t.first);
59
+ } }, inputs: { Spec: "Spec", Inputs: "Inputs", Provider: "Provider" }, outputs: { Activity: "Activity", HandleChange: "HandleChange" }, decls: 2, vars: 3, consts: [["react", ""], [1, "ic-host__component", 3, "ComponentEvent", "StateChange", "Initialized", "Component", "ComponentProps", "Provider"]], template: function InteractiveComponentHostComponent_Template(rf, ctx) { if (rf & 1) {
60
+ i0.ɵɵelementStart(0, "mj-react-component", 1, 0);
61
+ i0.ɵɵlistener("ComponentEvent", function InteractiveComponentHostComponent_Template_mj_react_component_ComponentEvent_0_listener($event) { return ctx.OnComponentEvent($event); })("StateChange", function InteractiveComponentHostComponent_Template_mj_react_component_StateChange_0_listener() { return ctx.Activity.emit({ Kind: "state" }); })("Initialized", function InteractiveComponentHostComponent_Template_mj_react_component_Initialized_0_listener() { return ctx.OnInitialized(); });
62
+ i0.ɵɵelementEnd();
63
+ } if (rf & 2) {
64
+ i0.ɵɵproperty("Component", ctx.Spec)("ComponentProps", ctx.Inputs)("Provider", ctx.Provider);
65
+ } }, dependencies: [MJReactModule, i1.MJReactComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100%;\n min-height: 0;\n overflow: auto;\n }\n .ic-host__component[_ngcontent-%COMP%] {\n display: block;\n height: 100%;\n }"], changeDetection: 0 });
66
+ }
67
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InteractiveComponentHostComponent, [{
68
+ type: Component,
69
+ args: [{ standalone: true, selector: 'mj-interactive-component-host', imports: [MJReactModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
70
+ <mj-react-component
71
+ #react
72
+ class="ic-host__component"
73
+ [Component]="Spec"
74
+ [ComponentProps]="Inputs"
75
+ [Provider]="Provider"
76
+ (ComponentEvent)="OnComponentEvent($event)"
77
+ (StateChange)="Activity.emit({ Kind: 'state' })"
78
+ (Initialized)="OnInitialized()"
79
+ ></mj-react-component>
80
+ `, styles: ["\n :host {\n display: block;\n height: 100%;\n min-height: 0;\n overflow: auto;\n }\n .ic-host__component {\n display: block;\n height: 100%;\n }\n "] }]
81
+ }], null, { Spec: [{
82
+ type: Input,
83
+ args: [{ required: true }]
84
+ }], Inputs: [{
85
+ type: Input
86
+ }], Provider: [{
87
+ type: Input
88
+ }], Activity: [{
89
+ type: Output
90
+ }], HandleChange: [{
91
+ type: Output
92
+ }], react: [{
93
+ type: ViewChild,
94
+ args: ['react']
95
+ }] }); })();
96
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InteractiveComponentHostComponent, { className: "InteractiveComponentHostComponent", filePath: "src/lib/components/realtime/interactive-component/interactive-component-host.component.ts", lineNumber: 49 }); })();
97
+ //# sourceMappingURL=interactive-component-host.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-host.component.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-host.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG/H,OAAO,EAAoB,aAAa,EAA4B,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;;;;AAGhE;;;;;;;;GAQG;AAiCH,MAAM,OAAO,iCAAiC;IACpC,KAAK,CAAiB;IAE9B,sHAAsH;IACtH,IACW,IAAI,CAAC,KAAoB;QAClC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;YACrD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IACD,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,iDAAiD;IACjC,MAAM,GAAW,EAAE,CAAC;IAEpC,kGAAkG;IAClF,QA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KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kBAEN,SAAS;mBAAC,OAAO;;kFA3BP,iCAAiC","sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild, inject } from '@angular/core';\nimport type { IMetadataProvider } from '@memberjunction/core';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport { MJReactComponent, MJReactModule, type ReactComponentEvent } from '@memberjunction/ng-react';\nimport { ReactComponentHandle } from './react-component-handle';\nimport type { ComponentActivity, IInteractiveComponentHandle } from './interactive-component-types';\n\n/**\n * Hosts ONE interactive component for the Interactive Component channel and reports what the channel needs: a live\n * handle once the component has initialized (and `null` while a new version is loading), and what the user does in\n * it.\n *\n * It exists as its own component because a version swap is just a new `Spec` input: the host drops the handle,\n * lets `mj-react-component` reinitialize in place, and hands out a fresh handle when that finishes. The instance\n * (and so its id, tab and place) never changes.\n */\n@Component({\n standalone: true,\n selector: 'mj-interactive-component-host',\n imports: [MJReactModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <mj-react-component\n #react\n class=\"ic-host__component\"\n [Component]=\"Spec\"\n [ComponentProps]=\"Inputs\"\n [Provider]=\"Provider\"\n (ComponentEvent)=\"OnComponentEvent($event)\"\n (StateChange)=\"Activity.emit({ Kind: 'state' })\"\n (Initialized)=\"OnInitialized()\"\n ></mj-react-component>\n `,\n styles: [\n `\n :host {\n display: block;\n height: 100%;\n min-height: 0;\n overflow: auto;\n }\n .ic-host__component {\n display: block;\n height: 100%;\n }\n `,\n ],\n})\nexport class InteractiveComponentHostComponent {\n private _spec!: ComponentSpec;\n\n /** The component to render. A new value is a new version: the handle is dropped until the new one has initialized. */\n @Input({ required: true })\n public set Spec(value: ComponentSpec) {\n if (this._spec !== undefined && value !== this._spec) {\n this.HandleChange.emit(null);\n }\n this._spec = value;\n }\n public get Spec(): ComponentSpec {\n return this._spec;\n }\n\n /** Values for the component's own properties. */\n @Input() public Inputs: object = {};\n\n /** The session's metadata provider, so the component's data access runs as the signed-in user. */\n @Input() public Provider: IMetadataProvider | null = null;\n\n /** What the user did inside the component. */\n @Output() public Activity = new EventEmitter<ComponentActivity>();\n\n /** The live handle once the component is ready; `null` when it is not (loading a new version). */\n @Output() public HandleChange = new EventEmitter<IInteractiveComponentHandle | null>();\n\n @ViewChild('react') private react?: MJReactComponent;\n\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The host's element: what a frame capturer rasterizes to show the model the component. */\n public get Element(): HTMLElement {\n return this.hostRef.nativeElement;\n }\n\n /** The component finished initializing (first load or a new version). */\n public OnInitialized(): void {\n if (this.react) {\n this.HandleChange.emit(new ReactComponentHandle(this.react));\n }\n this.Activity.emit({ Kind: 'initialized' });\n }\n\n /** A component event: reported with its type and payload. */\n public OnComponentEvent(event: ReactComponentEvent): void {\n this.Activity.emit({ Kind: 'event', Name: event.type, Payload: event.payload });\n }\n}\n"]}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * @fileoverview Shared vocabulary of the **Interactive Component realtime channel**: names, the
3
+ * channel's configuration, the artifact source port and the handle a rendered component exposes.
4
+ *
5
+ * Everything in this file is framework-free (no Angular, no DOM), so the channel's logic can be
6
+ * tested without a browser and reused by a host that renders components some other way.
7
+ *
8
+ * @module @memberjunction/ng-conversations
9
+ */
10
+ import type { ComponentSpec } from '@memberjunction/interactive-component-types';
11
+ /** The channel's key: the `target.channel` an agent addresses. */
12
+ export declare const INTERACTIVE_COMPONENT_CHANNEL_KEY = "InteractiveComponent";
13
+ /** The `ClientPluginClass` of the channel's `MJ: AI Agent Channels` row (its ClassFactory key). */
14
+ export declare const INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS = "RealtimeInteractiveComponentChannel";
15
+ /** The `ServerPluginClass` of the channel's `MJ: AI Agent Channels` row. */
16
+ export declare const INTERACTIVE_COMPONENT_SERVER_PLUGIN_CLASS = "InteractiveComponentChannelServer";
17
+ /** The verbs every instance has, whatever its spec says. `open` is the dispatcher's reserved action, not a verb. */
18
+ export declare const BUILTIN_VERBS: {
19
+ /** Swap an open instance to another version of its own artifact. */
20
+ readonly ShowVersion: "show_version";
21
+ /** Close an instance. */
22
+ readonly Close: "close";
23
+ };
24
+ /**
25
+ * The verbs derived from a spec's *standard* methods. Their names are reserved: a custom method that
26
+ * collides with one is exposed as `custom_<name>` instead (see `DeriveComponentContract`).
27
+ */
28
+ export declare const STANDARD_VERBS: {
29
+ readonly Refresh: "refresh";
30
+ readonly Print: "print";
31
+ readonly Validate: "validate";
32
+ readonly IsDirty: "is_dirty";
33
+ readonly Reset: "reset";
34
+ readonly ScrollTo: "scroll_to";
35
+ readonly Focus: "focus";
36
+ readonly GetDataState: "get_data_state";
37
+ };
38
+ /** Where in the channel's life a version swap came from. */
39
+ export type ComponentVersionChangeReason = 'agent' | 'newer-version';
40
+ /**
41
+ * Per-channel configuration read from `channels.config.InteractiveComponent` in the config cascade.
42
+ * It is operator-authored JSON of unknown shape, so every member is validated by `ParseInteractiveComponentConfig`;
43
+ * these are the resolved, always-valid values.
44
+ */
45
+ export interface InteractiveComponentConfig {
46
+ /**
47
+ * Whether component artifacts produced by a delegated run (the agent asked Skip or Sage to build
48
+ * something) are opened automatically. Off by default: the channel is opt-in, and so is the behavior of
49
+ * a tab appearing by itself. The channel cannot tell a component from another kind of artifact until it
50
+ * has loaded it, so with this on it is mounted for ANY delegated artifact and ignores those that are not components.
51
+ */
52
+ AutoOpenDelegatedComponents: boolean;
53
+ /** Whether a newer version of an artifact that is already open replaces it in place (default `true`); when `false` the agent is only told one exists. */
54
+ SwapToNewerVersions: boolean;
55
+ /** How many components may be open at once (1 to {@link MAX_INSTANCES_CEILING}; default 4). */
56
+ MaxInstances: number;
57
+ /** The most data rows per table described to the model (default 25). */
58
+ MaxStateRows: number;
59
+ /** The most characters of data-state JSON described to the model per component (default 6000). */
60
+ MaxStateChars: number;
61
+ }
62
+ /** The highest `maxInstances` an operator may configure. */
63
+ export declare const MAX_INSTANCES_CEILING = 8;
64
+ /** The configuration used when none is supplied. */
65
+ export declare const DEFAULT_INTERACTIVE_COMPONENT_CONFIG: Readonly<InteractiveComponentConfig>;
66
+ /** A component artifact version, loaded and parsed, ready to render. */
67
+ export interface ResolvedComponentArtifact {
68
+ /** The `MJ: Artifacts` id. */
69
+ ArtifactID: string;
70
+ /** The `MJ: Artifact Versions` id this was loaded from. */
71
+ VersionID: string;
72
+ /** The version number within the artifact. */
73
+ VersionNumber: number;
74
+ /** Display name (the version's name, else the artifact's, else the spec's). */
75
+ Name: string;
76
+ /** The parsed component specification. */
77
+ Spec: ComponentSpec;
78
+ }
79
+ /** Why an artifact could not be loaded; each maps to a message the model can act on. */
80
+ export type ComponentArtifactErrorCode = 'invalid_id' | 'not_found' | 'access_denied' | 'not_a_component' | 'unreadable' | 'load_failed';
81
+ /** An artifact load that failed, thrown by an {@link IComponentArtifactSource}. */
82
+ export declare class ComponentArtifactError extends Error {
83
+ readonly Code: ComponentArtifactErrorCode;
84
+ /** @param Code A stable machine-readable reason. @param message A sentence the model can read. */
85
+ constructor(Code: ComponentArtifactErrorCode, message: string);
86
+ }
87
+ /**
88
+ * Loads component artifacts. The channel only ever asks this port, so what "the user's own access" means
89
+ * (the user's own session, their read permission on the artifact) is the implementation's concern and the
90
+ * channel is testable without a database.
91
+ *
92
+ * Implementations throw {@link ComponentArtifactError} for anything the agent can be told.
93
+ */
94
+ export interface IComponentArtifactSource {
95
+ /** Loads one specific version. */
96
+ LoadVersion(versionId: string): Promise<ResolvedComponentArtifact>;
97
+ /** Loads an artifact's latest version. */
98
+ LoadLatest(artifactId: string): Promise<ResolvedComponentArtifact>;
99
+ }
100
+ /**
101
+ * What the channel can do to a rendered component. The Angular host component implements it over
102
+ * `mj-react-component`; tests implement it over a fake. Every member must tolerate being called before the
103
+ * component finished initializing (return `undefined`/`false`, never throw).
104
+ */
105
+ export interface IInteractiveComponentHandle {
106
+ /** Whether the component has finished initializing and can be driven. */
107
+ readonly IsReady: boolean;
108
+ /** Whether the component implements `methodName`. */
109
+ HasMethod(methodName: string): boolean;
110
+ /** Calls one of the component's methods with positional arguments; resolves with its (possibly async) result. */
111
+ InvokeMethod(methodName: string, args: readonly unknown[]): Promise<unknown>;
112
+ /** The component's current data state (`getCurrentDataState`, or what it fetched), if it has one. */
113
+ GetCurrentDataState(): object | undefined;
114
+ /** Re-fetches / re-renders the component. */
115
+ Refresh(): void;
116
+ /** Prints the component. */
117
+ Print(): void;
118
+ /** `validate()`: a boolean or a validation result. */
119
+ Validate(): unknown;
120
+ /** `isDirty()`. */
121
+ IsDirty(): boolean;
122
+ /** `reset()`. */
123
+ Reset(): void;
124
+ /** `scrollTo(target)`. */
125
+ ScrollTo(target: string | {
126
+ top?: number;
127
+ left?: number;
128
+ }): void;
129
+ /** `focus(target?)`. */
130
+ Focus(target?: string): void;
131
+ }
132
+ /** Something the user did inside a rendered component, reported by the host to the channel. */
133
+ export interface ComponentActivity {
134
+ /**
135
+ * `'event'` for a component event (the spec's `events`), `'state'` for a state change, `'initialized'` when it
136
+ * finished loading, `'selected'` when the user switched to this component's tab, `'closed'` when the user closed it.
137
+ */
138
+ Kind: 'event' | 'state' | 'initialized' | 'selected' | 'closed';
139
+ /** The event type or state path. */
140
+ Name?: string;
141
+ /** The event payload or new state value (already untyped JSON-ish; the channel bounds it). */
142
+ Payload?: unknown;
143
+ }
144
+ //# sourceMappingURL=interactive-component-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-component-types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF,kEAAkE;AAClE,eAAO,MAAM,iCAAiC,yBAAyB,CAAC;AAExE,mGAAmG;AACnG,eAAO,MAAM,yCAAyC,wCAAwC,CAAC;AAE/F,4EAA4E;AAC5E,eAAO,MAAM,yCAAyC,sCAAsC,C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