@memberjunction/ng-conversations 5.43.0 → 5.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +0 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +56 -52
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +37 -41
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +10 -14
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +41 -45
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +22 -36
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +4 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +134 -166
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +73 -8
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +487 -123
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.js +6 -9
- package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +20 -24
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
- package/dist/lib/components/members/members-modal.component.js +10 -11
- package/dist/lib/components/members/members-modal.component.js.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +49 -28
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.js +24 -10
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +11 -16
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input-box.component.js +52 -46
- package/dist/lib/components/message/message-input-box.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +83 -18
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +238 -151
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +10 -1
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +67 -15
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.js +6 -9
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +3 -0
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +9 -4
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +45 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +10 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +46 -0
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/channels/client-context-channel.js +174 -0
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts +123 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js +397 -0
- package/dist/lib/components/realtime/evidence-playback/realtime-evidence-playback.component.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-state.d.ts +103 -0
- package/dist/lib/components/realtime/media/media-channel-state.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-state.js +143 -0
- package/dist/lib/components/realtime/media/media-channel-state.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-tools.d.ts +24 -0
- package/dist/lib/components/realtime/media/media-channel-tools.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel-tools.js +107 -0
- package/dist/lib/components/realtime/media/media-channel-tools.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts +89 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/media-channel.js +253 -0
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts +141 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js +574 -0
- package/dist/lib/components/realtime/media/realtime-media-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +59 -14
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +277 -74
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +28 -27
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +144 -143
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +12 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +105 -43
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +41 -7
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +216 -102
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +0 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +67 -71
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +364 -44
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +839 -153
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +5 -5
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts +70 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.js +115 -0
- package/dist/lib/components/realtime/realtime-surface-tab-style.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +55 -57
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +165 -143
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +80 -71
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +83 -113
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +270 -0
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-ui-config.js +212 -0
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -0
- package/dist/lib/components/search/search-panel.component.d.ts +2 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +92 -101
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/share/share-modal.component.js +10 -11
- package/dist/lib/components/share/share-modal.component.js.map +1 -1
- package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
- package/dist/lib/components/shared/user-picker.component.js +12 -15
- package/dist/lib/components/shared/user-picker.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +5 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +18 -7
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +29 -26
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +37 -6
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +6 -3
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/models/conversation-state.model.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +2 -2
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +6 -2
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.d.ts +17 -1
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +58 -2
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +143 -0
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -0
- package/dist/lib/services/realtime-audio-recorder.js +379 -0
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts +75 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -0
- package/dist/lib/services/realtime-pcm-wav.js +205 -0
- package/dist/lib/services/realtime-pcm-wav.js.map +1 -0
- package/dist/lib/services/realtime-session-review.service.d.ts +28 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +12 -3
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +210 -20
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +452 -21
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/realtime-sessions-adapter.js +1 -1
- package/dist/lib/services/realtime-sessions-adapter.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +7 -2
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +6 -2
- package/dist/lib/services/ui-command-handler.service.js.map +1 -1
- package/dist/lib/utils/plan-mode-preference.d.ts +62 -0
- package/dist/lib/utils/plan-mode-preference.d.ts.map +1 -0
- package/dist/lib/utils/plan-mode-preference.js +130 -0
- package/dist/lib/utils/plan-mode-preference.js.map +1 -0
- package/dist/public-api.d.ts +6 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +8 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +28 -26
- package/dist/__tests__/attachment-badge.test.d.ts +0 -2
- package/dist/__tests__/attachment-badge.test.d.ts.map +0 -1
- package/dist/__tests__/attachment-badge.test.js +0 -66
- package/dist/__tests__/attachment-badge.test.js.map +0 -1
- package/dist/__tests__/channel-optional-surface.test.d.ts +0 -2
- package/dist/__tests__/channel-optional-surface.test.d.ts.map +0 -1
- package/dist/__tests__/channel-optional-surface.test.js +0 -53
- package/dist/__tests__/channel-optional-surface.test.js.map +0 -1
- package/dist/__tests__/chat-events.test.d.ts +0 -14
- package/dist/__tests__/chat-events.test.d.ts.map +0 -1
- package/dist/__tests__/chat-events.test.js +0 -109
- package/dist/__tests__/chat-events.test.js.map +0 -1
- package/dist/__tests__/collections-full-view.test.d.ts +0 -2
- package/dist/__tests__/collections-full-view.test.d.ts.map +0 -1
- package/dist/__tests__/collections-full-view.test.js +0 -225
- package/dist/__tests__/collections-full-view.test.js.map +0 -1
- package/dist/__tests__/conversation-cache.test.d.ts +0 -2
- package/dist/__tests__/conversation-cache.test.d.ts.map +0 -1
- package/dist/__tests__/conversation-cache.test.js +0 -233
- package/dist/__tests__/conversation-cache.test.js.map +0 -1
- package/dist/__tests__/conversation-naming.test.d.ts +0 -2
- package/dist/__tests__/conversation-naming.test.d.ts.map +0 -1
- package/dist/__tests__/conversation-naming.test.js +0 -110
- package/dist/__tests__/conversation-naming.test.js.map +0 -1
- package/dist/__tests__/delegation-result-parser.test.d.ts +0 -2
- package/dist/__tests__/delegation-result-parser.test.d.ts.map +0 -1
- package/dist/__tests__/delegation-result-parser.test.js +0 -107
- package/dist/__tests__/delegation-result-parser.test.js.map +0 -1
- package/dist/__tests__/distinct-artifacts.test.d.ts +0 -2
- package/dist/__tests__/distinct-artifacts.test.d.ts.map +0 -1
- package/dist/__tests__/distinct-artifacts.test.js +0 -56
- package/dist/__tests__/distinct-artifacts.test.js.map +0 -1
- package/dist/__tests__/event-wiring.test.d.ts +0 -15
- package/dist/__tests__/event-wiring.test.d.ts.map +0 -1
- package/dist/__tests__/event-wiring.test.js +0 -100
- package/dist/__tests__/event-wiring.test.js.map +0 -1
- package/dist/__tests__/index.test.d.ts +0 -2
- package/dist/__tests__/index.test.d.ts.map +0 -1
- package/dist/__tests__/index.test.js +0 -7
- package/dist/__tests__/index.test.js.map +0 -1
- package/dist/__tests__/narration-template.test.d.ts +0 -2
- package/dist/__tests__/narration-template.test.d.ts.map +0 -1
- package/dist/__tests__/narration-template.test.js +0 -76
- package/dist/__tests__/narration-template.test.js.map +0 -1
- package/dist/__tests__/notification-model.test.d.ts +0 -2
- package/dist/__tests__/notification-model.test.d.ts.map +0 -1
- package/dist/__tests__/notification-model.test.js +0 -68
- package/dist/__tests__/notification-model.test.js.map +0 -1
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts +0 -2
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-agent-picker-models.test.js +0 -49
- package/dist/__tests__/realtime-agent-picker-models.test.js.map +0 -1
- package/dist/__tests__/realtime-audio-visuals.test.d.ts +0 -2
- package/dist/__tests__/realtime-audio-visuals.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-audio-visuals.test.js +0 -123
- package/dist/__tests__/realtime-audio-visuals.test.js.map +0 -1
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts +0 -2
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-delegation-card-cancel.test.js +0 -48
- package/dist/__tests__/realtime-delegation-card-cancel.test.js.map +0 -1
- package/dist/__tests__/realtime-disclosure.test.d.ts +0 -2
- package/dist/__tests__/realtime-disclosure.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-disclosure.test.js +0 -164
- package/dist/__tests__/realtime-disclosure.test.js.map +0 -1
- package/dist/__tests__/realtime-pairing.test.d.ts +0 -2
- package/dist/__tests__/realtime-pairing.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-pairing.test.js +0 -207
- package/dist/__tests__/realtime-pairing.test.js.map +0 -1
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts +0 -2
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-review-lifecycle.test.js +0 -154
- package/dist/__tests__/realtime-review-lifecycle.test.js.map +0 -1
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-cancel-usage.test.js +0 -230
- package/dist/__tests__/realtime-session-cancel-usage.test.js.map +0 -1
- package/dist/__tests__/realtime-session-channels.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-channels.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-channels.test.js +0 -252
- package/dist/__tests__/realtime-session-channels.test.js.map +0 -1
- package/dist/__tests__/realtime-session-client-tools.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-client-tools.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-client-tools.test.js +0 -103
- package/dist/__tests__/realtime-session-client-tools.test.js.map +0 -1
- package/dist/__tests__/realtime-session-minimized.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-minimized.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-minimized.test.js +0 -32
- package/dist/__tests__/realtime-session-minimized.test.js.map +0 -1
- package/dist/__tests__/realtime-session-mint.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-mint.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-mint.test.js +0 -69
- package/dist/__tests__/realtime-session-mint.test.js.map +0 -1
- package/dist/__tests__/realtime-session-policy.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-policy.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-policy.test.js +0 -303
- package/dist/__tests__/realtime-session-policy.test.js.map +0 -1
- package/dist/__tests__/realtime-session-review.service.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-review.service.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-review.service.test.js +0 -743
- package/dist/__tests__/realtime-session-review.service.test.js.map +0 -1
- package/dist/__tests__/realtime-session-state.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-state.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-state.test.js +0 -83
- package/dist/__tests__/realtime-session-state.test.js.map +0 -1
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-timeline-card.test.js +0 -106
- package/dist/__tests__/realtime-session-timeline-card.test.js.map +0 -1
- package/dist/__tests__/realtime-session-timeline.test.d.ts +0 -2
- package/dist/__tests__/realtime-session-timeline.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-session-timeline.test.js +0 -142
- package/dist/__tests__/realtime-session-timeline.test.js.map +0 -1
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts +0 -19
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-sessions-adapter.test.js +0 -188
- package/dist/__tests__/realtime-sessions-adapter.test.js.map +0 -1
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts +0 -2
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-surface-panel-prefs.test.js +0 -100
- package/dist/__tests__/realtime-surface-panel-prefs.test.js.map +0 -1
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts +0 -2
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts.map +0 -1
- package/dist/__tests__/realtime-surface-tabs-model.test.js +0 -193
- package/dist/__tests__/realtime-surface-tabs-model.test.js.map +0 -1
- package/dist/__tests__/remote-browser-audio-player.test.d.ts +0 -2
- package/dist/__tests__/remote-browser-audio-player.test.d.ts.map +0 -1
- package/dist/__tests__/remote-browser-audio-player.test.js +0 -137
- package/dist/__tests__/remote-browser-audio-player.test.js.map +0 -1
- package/dist/__tests__/remote-browser-channel.test.d.ts +0 -2
- package/dist/__tests__/remote-browser-channel.test.d.ts.map +0 -1
- package/dist/__tests__/remote-browser-channel.test.js +0 -585
- package/dist/__tests__/remote-browser-channel.test.js.map +0 -1
- package/dist/__tests__/search-service.test.d.ts +0 -2
- package/dist/__tests__/search-service.test.d.ts.map +0 -1
- package/dist/__tests__/search-service.test.js +0 -114
- package/dist/__tests__/search-service.test.js.map +0 -1
- package/dist/__tests__/slot-defaults.test.d.ts +0 -24
- package/dist/__tests__/slot-defaults.test.d.ts.map +0 -1
- package/dist/__tests__/slot-defaults.test.js +0 -63
- package/dist/__tests__/slot-defaults.test.js.map +0 -1
- package/dist/__tests__/toast-service.test.d.ts +0 -2
- package/dist/__tests__/toast-service.test.d.ts.map +0 -1
- package/dist/__tests__/toast-service.test.js +0 -143
- package/dist/__tests__/toast-service.test.js.map +0 -1
- package/dist/__tests__/user-authorization.test.d.ts +0 -2
- package/dist/__tests__/user-authorization.test.d.ts.map +0 -1
- package/dist/__tests__/user-authorization.test.js +0 -97
- package/dist/__tests__/user-authorization.test.js.map +0 -1
- package/dist/__tests__/voice-session-narration.test.d.ts +0 -2
- package/dist/__tests__/voice-session-narration.test.d.ts.map +0 -1
- package/dist/__tests__/voice-session-narration.test.js +0 -609
- package/dist/__tests__/voice-session-narration.test.js.map +0 -1
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-artifact-viewer.test.js +0 -101
- package/dist/__tests__/whiteboard-artifact-viewer.test.js.map +0 -1
- package/dist/__tests__/whiteboard-channel.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-channel.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-channel.test.js +0 -260
- package/dist/__tests__/whiteboard-channel.test.js.map +0 -1
- package/dist/__tests__/whiteboard-restore-state.test.d.ts +0 -2
- package/dist/__tests__/whiteboard-restore-state.test.d.ts.map +0 -1
- package/dist/__tests__/whiteboard-restore-state.test.js +0 -108
- package/dist/__tests__/whiteboard-restore-state.test.js.map +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
/** Monotonic counter feeding {@link MediaChannelState.newId} so ids stay unique within a session. */
|
|
3
|
+
let mediaIdCounter = 0;
|
|
4
|
+
/**
|
|
5
|
+
* The Media channel's STATE ENGINE — a pure, framework-free model of what's on the shared Media
|
|
6
|
+
* surface: an ordered list of {@link MediaItem}s plus which one is active. Mutations push the new
|
|
7
|
+
* state through {@link Changed$} so the channel persists it and the surface re-renders. Mirrors
|
|
8
|
+
* `WhiteboardState` (no Angular, tolerant (de)serialization, single `Changed$` notifier).
|
|
9
|
+
*/
|
|
10
|
+
export class MediaChannelState {
|
|
11
|
+
/** The media currently on the surface, in tab order (oldest first). */
|
|
12
|
+
Items = [];
|
|
13
|
+
/** The id of the active (visible) item, or `null` when the surface is empty. */
|
|
14
|
+
ActiveItemId = null;
|
|
15
|
+
/**
|
|
16
|
+
* Fires on every mutation. Replays the current state on subscribe (BehaviorSubject), so a late
|
|
17
|
+
* surface binding immediately renders what's already on the board.
|
|
18
|
+
*/
|
|
19
|
+
Changed$ = new BehaviorSubject(this);
|
|
20
|
+
/** Adds a media item, makes it active, and returns it. */
|
|
21
|
+
AddItem(item) {
|
|
22
|
+
const created = { ...item, Id: item.Id ?? this.newId() };
|
|
23
|
+
this.Items = [...this.Items, created];
|
|
24
|
+
this.ActiveItemId = created.Id;
|
|
25
|
+
this.notify();
|
|
26
|
+
return created;
|
|
27
|
+
}
|
|
28
|
+
/** Removes the item with `id` (no-op if absent). When it was active, the last remaining item becomes active. */
|
|
29
|
+
RemoveItem(id) {
|
|
30
|
+
const next = this.Items.filter((i) => i.Id !== id);
|
|
31
|
+
if (next.length === this.Items.length) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
this.Items = next;
|
|
35
|
+
if (this.ActiveItemId === id) {
|
|
36
|
+
this.ActiveItemId = next.length > 0 ? next[next.length - 1].Id : null;
|
|
37
|
+
}
|
|
38
|
+
this.notify();
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
/** Makes `id` the active item (no-op if absent). */
|
|
42
|
+
SetActive(id) {
|
|
43
|
+
if (!this.Items.some((i) => i.Id === id) || this.ActiveItemId === id) {
|
|
44
|
+
return this.ActiveItemId === id;
|
|
45
|
+
}
|
|
46
|
+
this.ActiveItemId = id;
|
|
47
|
+
this.notify();
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Activates `id` and stamps a play request on it (the surface consumes the stamp to start
|
|
52
|
+
* video/audio playback). No-op if the item is absent.
|
|
53
|
+
*/
|
|
54
|
+
RequestPlay(id) {
|
|
55
|
+
const item = this.Items.find((i) => i.Id === id);
|
|
56
|
+
if (!item) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
this.ActiveItemId = id;
|
|
60
|
+
this.Items = this.Items.map((i) => (i.Id === id ? { ...i, PlayRequestedAt: Date.now() } : i));
|
|
61
|
+
this.notify();
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
/** Sets (or, with `null`, clears) the fractional highlight on `id`. No-op if the item is absent. */
|
|
65
|
+
Highlight(id, highlight) {
|
|
66
|
+
const item = this.Items.find((i) => i.Id === id);
|
|
67
|
+
if (!item) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
this.Items = this.Items.map((i) => (i.Id === id ? { ...i, Highlight: highlight ?? undefined } : i));
|
|
71
|
+
this.notify();
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
/** Removes all media and resets the active item. */
|
|
75
|
+
Clear() {
|
|
76
|
+
if (this.Items.length === 0 && this.ActiveItemId === null) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.Items = [];
|
|
80
|
+
this.ActiveItemId = null;
|
|
81
|
+
this.notify();
|
|
82
|
+
}
|
|
83
|
+
/** The active item, or `null` when the surface is empty / the active id is stale. */
|
|
84
|
+
get ActiveItem() {
|
|
85
|
+
return this.Items.find((i) => i.Id === this.ActiveItemId) ?? null;
|
|
86
|
+
}
|
|
87
|
+
/** Serializes the state of record to a JSON string (persisted via the channel's RequestSave). */
|
|
88
|
+
ToJSON() {
|
|
89
|
+
const payload = { V: 1, Items: this.Items, ActiveItemId: this.ActiveItemId };
|
|
90
|
+
return JSON.stringify(payload);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Rehydrates a prior session's saved state IN PLACE (preserving this instance + its `Changed$`
|
|
94
|
+
* subscribers). Tolerant by contract: malformed / incompatible JSON is ignored and the method
|
|
95
|
+
* returns `false` without throwing, leaving the current state untouched.
|
|
96
|
+
*/
|
|
97
|
+
LoadFromJSON(json) {
|
|
98
|
+
try {
|
|
99
|
+
const parsed = JSON.parse(json);
|
|
100
|
+
if (!parsed || !Array.isArray(parsed.Items)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const items = parsed.Items.filter((i) => this.isValidItem(i));
|
|
104
|
+
this.Items = items;
|
|
105
|
+
const active = typeof parsed.ActiveItemId === 'string' ? parsed.ActiveItemId : null;
|
|
106
|
+
this.ActiveItemId = active && items.some((i) => i.Id === active) ? active : items.length > 0 ? items[items.length - 1].Id : null;
|
|
107
|
+
this.notify();
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validates one parsed item enough to render it safely (defensive against hand-edited / old
|
|
116
|
+
* payloads). An item must carry a SOURCE — a non-empty `Url` OR a non-empty `FileID` — since one
|
|
117
|
+
* of the two backs every render path.
|
|
118
|
+
*/
|
|
119
|
+
isValidItem(value) {
|
|
120
|
+
if (!value || typeof value !== 'object') {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const item = value;
|
|
124
|
+
const validTypes = ['image', 'video', 'audio', 'pdf', 'web'];
|
|
125
|
+
const hasUrl = typeof item['Url'] === 'string' && item['Url'].length > 0;
|
|
126
|
+
const hasFileID = typeof item['FileID'] === 'string' && item['FileID'].length > 0;
|
|
127
|
+
return (typeof item['Id'] === 'string' &&
|
|
128
|
+
(hasUrl || hasFileID) &&
|
|
129
|
+
typeof item['DisplayName'] === 'string' &&
|
|
130
|
+
typeof item['Type'] === 'string' &&
|
|
131
|
+
validTypes.includes(item['Type']));
|
|
132
|
+
}
|
|
133
|
+
/** Mints a unique-within-session item id. */
|
|
134
|
+
newId() {
|
|
135
|
+
mediaIdCounter += 1;
|
|
136
|
+
return `media-${Date.now().toString(36)}-${mediaIdCounter}`;
|
|
137
|
+
}
|
|
138
|
+
/** Pushes the current state to subscribers. */
|
|
139
|
+
notify() {
|
|
140
|
+
this.Changed$.next(this);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=media-channel-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-channel-state.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/media-channel-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AA2DvC,qGAAqG;AACrG,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IAC5B,uEAAuE;IAChE,KAAK,GAAgB,EAAE,CAAC;IAE/B,gFAAgF;IACzE,YAAY,GAAkB,IAAI,CAAC;IAE1C;;;OAGG;IACa,QAAQ,GAAG,IAAI,eAAe,CAAoB,IAAI,CAAC,CAAC;IAExE,0DAA0D;IACnD,OAAO,CAAC,IAA6C;QAC1D,MAAM,OAAO,GAAc,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAA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,CACnD,CAAC;IACJ,CAAC;IAED,6CAA6C;IACrC,KAAK;QACX,cAAc,IAAI,CAAC,CAAC;QACpB,OAAO,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,cAAc,EAAE,CAAC;IAC9D,CAAC;IAED,+CAA+C;IACvC,MAAM;QACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { BehaviorSubject } from 'rxjs';\n\n/** The media kinds the Media surface can render — one render path per value. */\nexport type MediaItemType = 'image' | 'video' | 'audio' | 'pdf' | 'web';\n\n/**\n * A fractional highlight rectangle drawn over a media item, in the item's OWN coordinate space\n * (0..1 on both axes). `X`,`Y` is the top-left corner; `W`,`H` are the width/height. Fractional\n * coordinates keep the highlight correct regardless of how the media is scaled to fit the pane.\n */\nexport interface MediaHighlight {\n /** Left edge as a fraction of width (0..1). */\n X: number;\n /** Top edge as a fraction of height (0..1). */\n Y: number;\n /** Width as a fraction of width (0..1). */\n W: number;\n /** Height as a fraction of height (0..1). */\n H: number;\n /** Optional short label rendered on the highlight. */\n Label?: string;\n}\n\n/** One piece of media on the surface — a tab + a render pane keyed by {@link MediaItemType}. */\nexport interface MediaItem {\n /** Stable id (returned to the agent by `Media_ShowMedia`, used by close/play/highlight). */\n Id: string;\n /** Which render path the pane uses. */\n Type: MediaItemType;\n /**\n * Absolute URL of the media — for an EXTERNAL/public asset. Optional/empty when {@link FileID}\n * is set (the surface resolves a secure streaming URL from the file id instead). At least one of\n * `Url` / `FileID` is always present.\n */\n Url?: string;\n /**\n * Id of an \"MJ: Files\" record this item is backed by. When set, the item is streamed securely\n * (permission-gated) from MJStorage rather than from a public {@link Url}; the surface resolves a\n * short-lived streaming URL (via `CreateMediaAccessToken`) or hands the id straight to\n * `mj-storage-media-player` for audio/video.\n */\n FileID?: string;\n /** Short tab label. */\n DisplayName: string;\n /** Optional one-line caption beneath the media. */\n Caption?: string;\n /** Optional fractional highlight overlay. */\n Highlight?: MediaHighlight;\n /** Set transiently to request playback of a video/audio item (consumed by the surface). */\n PlayRequestedAt?: number;\n}\n\n/** The serialized shape persisted as the channel's state of record (versioned for forward-compat). */\ninterface SerializedMediaState {\n V: 1;\n Items: MediaItem[];\n ActiveItemId: string | null;\n}\n\n/** Monotonic counter feeding {@link MediaChannelState.newId} so ids stay unique within a session. */\nlet mediaIdCounter = 0;\n\n/**\n * The Media channel's STATE ENGINE — a pure, framework-free model of what's on the shared Media\n * surface: an ordered list of {@link MediaItem}s plus which one is active. Mutations push the new\n * state through {@link Changed$} so the channel persists it and the surface re-renders. Mirrors\n * `WhiteboardState` (no Angular, tolerant (de)serialization, single `Changed$` notifier).\n */\nexport class MediaChannelState {\n /** The media currently on the surface, in tab order (oldest first). */\n public Items: MediaItem[] = [];\n\n /** The id of the active (visible) item, or `null` when the surface is empty. */\n public ActiveItemId: string | null = null;\n\n /**\n * Fires on every mutation. Replays the current state on subscribe (BehaviorSubject), so a late\n * surface binding immediately renders what's already on the board.\n */\n public readonly Changed$ = new BehaviorSubject<MediaChannelState>(this);\n\n /** Adds a media item, makes it active, and returns it. */\n public AddItem(item: Omit<MediaItem, 'Id'> & { Id?: string }): MediaItem {\n const created: MediaItem = { ...item, Id: item.Id ?? this.newId() };\n this.Items = [...this.Items, created];\n this.ActiveItemId = created.Id;\n this.notify();\n return created;\n }\n\n /** Removes the item with `id` (no-op if absent). When it was active, the last remaining item becomes active. */\n public RemoveItem(id: string): boolean {\n const next = this.Items.filter((i) => i.Id !== id);\n if (next.length === this.Items.length) {\n return false;\n }\n this.Items = next;\n if (this.ActiveItemId === id) {\n this.ActiveItemId = next.length > 0 ? next[next.length - 1].Id : null;\n }\n this.notify();\n return true;\n }\n\n /** Makes `id` the active item (no-op if absent). */\n public SetActive(id: string): boolean {\n if (!this.Items.some((i) => i.Id === id) || this.ActiveItemId === id) {\n return this.ActiveItemId === id;\n }\n this.ActiveItemId = id;\n this.notify();\n return true;\n }\n\n /**\n * Activates `id` and stamps a play request on it (the surface consumes the stamp to start\n * video/audio playback). No-op if the item is absent.\n */\n public RequestPlay(id: string): boolean {\n const item = this.Items.find((i) => i.Id === id);\n if (!item) {\n return false;\n }\n this.ActiveItemId = id;\n this.Items = this.Items.map((i) => (i.Id === id ? { ...i, PlayRequestedAt: Date.now() } : i));\n this.notify();\n return true;\n }\n\n /** Sets (or, with `null`, clears) the fractional highlight on `id`. No-op if the item is absent. */\n public Highlight(id: string, highlight: MediaHighlight | null): boolean {\n const item = this.Items.find((i) => i.Id === id);\n if (!item) {\n return false;\n }\n this.Items = this.Items.map((i) => (i.Id === id ? { ...i, Highlight: highlight ?? undefined } : i));\n this.notify();\n return true;\n }\n\n /** Removes all media and resets the active item. */\n public Clear(): void {\n if (this.Items.length === 0 && this.ActiveItemId === null) {\n return;\n }\n this.Items = [];\n this.ActiveItemId = null;\n this.notify();\n }\n\n /** The active item, or `null` when the surface is empty / the active id is stale. */\n public get ActiveItem(): MediaItem | null {\n return this.Items.find((i) => i.Id === this.ActiveItemId) ?? null;\n }\n\n /** Serializes the state of record to a JSON string (persisted via the channel's RequestSave). */\n public ToJSON(): string {\n const payload: SerializedMediaState = { V: 1, Items: this.Items, ActiveItemId: this.ActiveItemId };\n return JSON.stringify(payload);\n }\n\n /**\n * Rehydrates a prior session's saved state IN PLACE (preserving this instance + its `Changed$`\n * subscribers). Tolerant by contract: malformed / incompatible JSON is ignored and the method\n * returns `false` without throwing, leaving the current state untouched.\n */\n public LoadFromJSON(json: string): boolean {\n try {\n const parsed = JSON.parse(json) as Partial<SerializedMediaState> | null;\n if (!parsed || !Array.isArray(parsed.Items)) {\n return false;\n }\n const items = parsed.Items.filter((i): i is MediaItem => this.isValidItem(i));\n this.Items = items;\n const active = typeof parsed.ActiveItemId === 'string' ? parsed.ActiveItemId : null;\n this.ActiveItemId = active && items.some((i) => i.Id === active) ? active : items.length > 0 ? items[items.length - 1].Id : null;\n this.notify();\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Validates one parsed item enough to render it safely (defensive against hand-edited / old\n * payloads). An item must carry a SOURCE — a non-empty `Url` OR a non-empty `FileID` — since one\n * of the two backs every render path.\n */\n private isValidItem(value: unknown): value is MediaItem {\n if (!value || typeof value !== 'object') {\n return false;\n }\n const item = value as Record<string, unknown>;\n const validTypes: MediaItemType[] = ['image', 'video', 'audio', 'pdf', 'web'];\n const hasUrl = typeof item['Url'] === 'string' && (item['Url'] as string).length > 0;\n const hasFileID = typeof item['FileID'] === 'string' && (item['FileID'] as string).length > 0;\n return (\n typeof item['Id'] === 'string' &&\n (hasUrl || hasFileID) &&\n typeof item['DisplayName'] === 'string' &&\n typeof item['Type'] === 'string' &&\n validTypes.includes(item['Type'] as MediaItemType)\n );\n }\n\n /** Mints a unique-within-session item id. */\n private newId(): string {\n mediaIdCounter += 1;\n return `media-${Date.now().toString(36)}-${mediaIdCounter}`;\n }\n\n /** Pushes the current state to subscribers. */\n private notify(): void {\n this.Changed$.next(this);\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RealtimeToolDefinition } from '@memberjunction/ai';
|
|
2
|
+
/**
|
|
3
|
+
* The shared name prefix of every Media-channel tool — the key the session registers so all
|
|
4
|
+
* `Media_*` tool calls route locally to {@link RealtimeMediaChannel.ApplyAgentTool} (executed in
|
|
5
|
+
* the browser, mutating the channel's {@link MediaChannelState}) instead of the generic server
|
|
6
|
+
* tool relay. Mirrors `Whiteboard_` / `browser_`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MEDIA_TOOL_PREFIX = "Media_";
|
|
9
|
+
/** The canonical Media tool names (one per `Media_*` capability). */
|
|
10
|
+
export declare const MEDIA_TOOL_NAMES: {
|
|
11
|
+
readonly ShowMedia: "Media_ShowMedia";
|
|
12
|
+
readonly CloseMedia: "Media_CloseMedia";
|
|
13
|
+
readonly PlayMedia: "Media_PlayMedia";
|
|
14
|
+
readonly Highlight: "Media_Highlight";
|
|
15
|
+
readonly ClearAll: "Media_ClearAll";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The Media channel's CLIENT-EXECUTED tool declarations — registered with the realtime model at
|
|
19
|
+
* session mint and routed back to {@link RealtimeMediaChannel.ApplyAgentTool} by the `Media_`
|
|
20
|
+
* prefix. They let the agent put visuals (images, video, audio, PDFs, web pages) on the shared
|
|
21
|
+
* Media surface during the call, switch between them, highlight a region, and clear the board.
|
|
22
|
+
*/
|
|
23
|
+
export declare const MEDIA_TOOL_DEFINITIONS: RealtimeToolDefinition[];
|
|
24
|
+
//# sourceMappingURL=media-channel-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-channel-tools.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/media-channel-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,qEAAqE;AACrE,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAAsB,EAyF1D,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared name prefix of every Media-channel tool — the key the session registers so all
|
|
3
|
+
* `Media_*` tool calls route locally to {@link RealtimeMediaChannel.ApplyAgentTool} (executed in
|
|
4
|
+
* the browser, mutating the channel's {@link MediaChannelState}) instead of the generic server
|
|
5
|
+
* tool relay. Mirrors `Whiteboard_` / `browser_`.
|
|
6
|
+
*/
|
|
7
|
+
export const MEDIA_TOOL_PREFIX = 'Media_';
|
|
8
|
+
/** The canonical Media tool names (one per `Media_*` capability). */
|
|
9
|
+
export const MEDIA_TOOL_NAMES = {
|
|
10
|
+
ShowMedia: 'Media_ShowMedia',
|
|
11
|
+
CloseMedia: 'Media_CloseMedia',
|
|
12
|
+
PlayMedia: 'Media_PlayMedia',
|
|
13
|
+
Highlight: 'Media_Highlight',
|
|
14
|
+
ClearAll: 'Media_ClearAll',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The Media channel's CLIENT-EXECUTED tool declarations — registered with the realtime model at
|
|
18
|
+
* session mint and routed back to {@link RealtimeMediaChannel.ApplyAgentTool} by the `Media_`
|
|
19
|
+
* prefix. They let the agent put visuals (images, video, audio, PDFs, web pages) on the shared
|
|
20
|
+
* Media surface during the call, switch between them, highlight a region, and clear the board.
|
|
21
|
+
*/
|
|
22
|
+
export const MEDIA_TOOL_DEFINITIONS = [
|
|
23
|
+
{
|
|
24
|
+
Name: MEDIA_TOOL_NAMES.ShowMedia,
|
|
25
|
+
Description: 'Display a piece of media on the shared Media surface the user is watching during the call — ' +
|
|
26
|
+
'an image, video, audio clip, PDF, or web page. It opens in its own tab and becomes the active ' +
|
|
27
|
+
'pane. Provide `url` for an external/public asset, OR `fileId` to show a file stored in ' +
|
|
28
|
+
'MemberJunction (streamed securely, permission-gated) — supply at least one. Returns the new ' +
|
|
29
|
+
'item id so you can later play, highlight, or close it.',
|
|
30
|
+
ParametersSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
mediaType: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
enum: ['image', 'video', 'audio', 'pdf', 'web'],
|
|
36
|
+
description: 'The kind of media to display.',
|
|
37
|
+
},
|
|
38
|
+
url: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Absolute URL of an external/public media asset (include the scheme, e.g. https://…). ' +
|
|
41
|
+
'Provide this OR `fileId`.',
|
|
42
|
+
},
|
|
43
|
+
fileId: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Id of an "MJ: Files" record to show a file stored in MemberJunction — streamed securely ' +
|
|
46
|
+
'and permission-gated (no public URL needed). Provide this OR `url`.',
|
|
47
|
+
},
|
|
48
|
+
displayName: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'Short label shown on the media\'s tab (e.g. "Q3 Revenue Chart").',
|
|
51
|
+
},
|
|
52
|
+
caption: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Optional one-line caption shown beneath the media.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['mediaType', 'displayName'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Name: MEDIA_TOOL_NAMES.CloseMedia,
|
|
62
|
+
Description: 'Close one piece of media (by its id) and remove its tab from the Media surface.',
|
|
63
|
+
ParametersSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
id: { type: 'string', description: 'The id of the media item to close (returned by Media_ShowMedia).' },
|
|
67
|
+
},
|
|
68
|
+
required: ['id'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
Name: MEDIA_TOOL_NAMES.PlayMedia,
|
|
73
|
+
Description: 'Make a piece of media active (bring its tab to the front) and, for video/audio, request playback. ' +
|
|
74
|
+
'Use this to direct the user\'s attention to something already shared.',
|
|
75
|
+
ParametersSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
id: { type: 'string', description: 'The id of the media item to activate / play.' },
|
|
79
|
+
},
|
|
80
|
+
required: ['id'],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
Name: MEDIA_TOOL_NAMES.Highlight,
|
|
85
|
+
Description: 'Draw a highlight rectangle over a region of a media item to point at something specific. ' +
|
|
86
|
+
'Coordinates are FRACTIONAL (0..1) relative to the media\'s own box: x,y is the top-left corner, ' +
|
|
87
|
+
'w,h are the width/height. Replaces any prior highlight on that item.',
|
|
88
|
+
ParametersSchema: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: {
|
|
91
|
+
id: { type: 'string', description: 'The id of the media item to highlight.' },
|
|
92
|
+
x: { type: 'number', description: 'Left edge as a fraction of width (0..1).' },
|
|
93
|
+
y: { type: 'number', description: 'Top edge as a fraction of height (0..1).' },
|
|
94
|
+
w: { type: 'number', description: 'Width as a fraction of width (0..1).' },
|
|
95
|
+
h: { type: 'number', description: 'Height as a fraction of height (0..1).' },
|
|
96
|
+
label: { type: 'string', description: 'Optional short label shown on the highlight.' },
|
|
97
|
+
},
|
|
98
|
+
required: ['id', 'x', 'y', 'w', 'h'],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
Name: MEDIA_TOOL_NAMES.ClearAll,
|
|
103
|
+
Description: 'Remove all media from the Media surface, returning it to its empty state.',
|
|
104
|
+
ParametersSchema: { type: 'object', properties: {} },
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
//# sourceMappingURL=media-channel-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-channel-tools.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/media-channel-tools.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,iBAAiB;IAC5B,UAAU,EAAE,kBAAkB;IAC9B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;IAC5B,QAAQ,EAAE,gBAAgB;CAClB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA6B;IAC9D;QACE,IAAI,EAAE,gBAAgB,CAAC,SAAS;QAChC,WAAW,EACT,8FAA8F;YAC9F,gGAAgG;YAChG,yFAAyF;YACzF,8FAA8F;YAC9F,wDAAwD;QAC1D,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,OAAO,EAAE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,WAAW,EAAE,wCAAwC,EAAE;gBAC7E,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;gBAC9E,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;gBAC9E,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;gBAC1E,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;gBAC5E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;aACvF;YACD,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACrC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB,CAAC,QAAQ;QAC/B,WAAW,EAAE,2EAA2E;QACxF,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KACrD;CACF,CAAC","sourcesContent":["import { RealtimeToolDefinition } from '@memberjunction/ai';\n\n/**\n * The shared name prefix of every Media-channel tool — the key the session registers so all\n * `Media_*` tool calls route locally to {@link RealtimeMediaChannel.ApplyAgentTool} (executed in\n * the browser, mutating the channel's {@link MediaChannelState}) instead of the generic server\n * tool relay. Mirrors `Whiteboard_` / `browser_`.\n */\nexport const MEDIA_TOOL_PREFIX = 'Media_';\n\n/** The canonical Media tool names (one per `Media_*` capability). */\nexport const MEDIA_TOOL_NAMES = {\n ShowMedia: 'Media_ShowMedia',\n CloseMedia: 'Media_CloseMedia',\n PlayMedia: 'Media_PlayMedia',\n Highlight: 'Media_Highlight',\n ClearAll: 'Media_ClearAll',\n} as const;\n\n/**\n * The Media channel's CLIENT-EXECUTED tool declarations — registered with the realtime model at\n * session mint and routed back to {@link RealtimeMediaChannel.ApplyAgentTool} by the `Media_`\n * prefix. They let the agent put visuals (images, video, audio, PDFs, web pages) on the shared\n * Media surface during the call, switch between them, highlight a region, and clear the board.\n */\nexport const MEDIA_TOOL_DEFINITIONS: RealtimeToolDefinition[] = [\n {\n Name: MEDIA_TOOL_NAMES.ShowMedia,\n Description:\n 'Display a piece of media on the shared Media surface the user is watching during the call — ' +\n 'an image, video, audio clip, PDF, or web page. It opens in its own tab and becomes the active ' +\n 'pane. Provide `url` for an external/public asset, OR `fileId` to show a file stored in ' +\n 'MemberJunction (streamed securely, permission-gated) — supply at least one. Returns the new ' +\n 'item id so you can later play, highlight, or close it.',\n ParametersSchema: {\n type: 'object',\n properties: {\n mediaType: {\n type: 'string',\n enum: ['image', 'video', 'audio', 'pdf', 'web'],\n description: 'The kind of media to display.',\n },\n url: {\n type: 'string',\n description:\n 'Absolute URL of an external/public media asset (include the scheme, e.g. https://…). ' +\n 'Provide this OR `fileId`.',\n },\n fileId: {\n type: 'string',\n description:\n 'Id of an \"MJ: Files\" record to show a file stored in MemberJunction — streamed securely ' +\n 'and permission-gated (no public URL needed). Provide this OR `url`.',\n },\n displayName: {\n type: 'string',\n description: 'Short label shown on the media\\'s tab (e.g. \"Q3 Revenue Chart\").',\n },\n caption: {\n type: 'string',\n description: 'Optional one-line caption shown beneath the media.',\n },\n },\n required: ['mediaType', 'displayName'],\n },\n },\n {\n Name: MEDIA_TOOL_NAMES.CloseMedia,\n Description: 'Close one piece of media (by its id) and remove its tab from the Media surface.',\n ParametersSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'The id of the media item to close (returned by Media_ShowMedia).' },\n },\n required: ['id'],\n },\n },\n {\n Name: MEDIA_TOOL_NAMES.PlayMedia,\n Description:\n 'Make a piece of media active (bring its tab to the front) and, for video/audio, request playback. ' +\n 'Use this to direct the user\\'s attention to something already shared.',\n ParametersSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'The id of the media item to activate / play.' },\n },\n required: ['id'],\n },\n },\n {\n Name: MEDIA_TOOL_NAMES.Highlight,\n Description:\n 'Draw a highlight rectangle over a region of a media item to point at something specific. ' +\n 'Coordinates are FRACTIONAL (0..1) relative to the media\\'s own box: x,y is the top-left corner, ' +\n 'w,h are the width/height. Replaces any prior highlight on that item.',\n ParametersSchema: {\n type: 'object',\n properties: {\n id: { type: 'string', description: 'The id of the media item to highlight.' },\n x: { type: 'number', description: 'Left edge as a fraction of width (0..1).' },\n y: { type: 'number', description: 'Top edge as a fraction of height (0..1).' },\n w: { type: 'number', description: 'Width as a fraction of width (0..1).' },\n h: { type: 'number', description: 'Height as a fraction of height (0..1).' },\n label: { type: 'string', description: 'Optional short label shown on the highlight.' },\n },\n required: ['id', 'x', 'y', 'w', 'h'],\n },\n },\n {\n Name: MEDIA_TOOL_NAMES.ClearAll,\n Description: 'Remove all media from the Media surface, returning it to its empty state.',\n ParametersSchema: { type: 'object', properties: {} },\n },\n];\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Type } from '@angular/core';
|
|
2
|
+
import { RealtimeToolDefinition } from '@memberjunction/ai';
|
|
3
|
+
import { BaseRealtimeChannelClient, ChannelOnboardingDetails } from '../channels/base-realtime-channel-client';
|
|
4
|
+
import { MediaChannelState } from './media-channel-state';
|
|
5
|
+
import { RealtimeMediaSurfaceComponent } from './realtime-media-surface.component';
|
|
6
|
+
/**
|
|
7
|
+
* The shared MEDIA SURFACE as a pluggable interactive channel — a {@link BaseRealtimeChannelClient}
|
|
8
|
+
* resolved from the `MJ: AI Agent Channels` registry row whose `ClientPluginClass` is
|
|
9
|
+
* `'RealtimeMediaChannel'`. One instance per session (created via ClassFactory at session start).
|
|
10
|
+
*
|
|
11
|
+
* It owns a {@link MediaChannelState} engine and contributes the channel's full contract:
|
|
12
|
+
*
|
|
13
|
+
* - **Action**: the `Media_*` client-executed tool set ({@link MEDIA_TOOL_DEFINITIONS});
|
|
14
|
+
* {@link ApplyAgentTool} parses the args, mutates the state engine, returns a short JSON result
|
|
15
|
+
* string, and sends the model a `[media]` background context note (so it stays aware of what's
|
|
16
|
+
* on screen). Works with NO surface bound — the tools mutate the state engine directly.
|
|
17
|
+
* - **Surface**: {@link RealtimeMediaSurfaceComponent}, created dynamically by the overlay's
|
|
18
|
+
* channel tab; {@link BindSurface} hands it the shared state engine + agent name.
|
|
19
|
+
* - **State of record**: every mutation requests a debounced save of {@link MediaChannelState.ToJSON}
|
|
20
|
+
* under channel name `'Media'`; a prior session's media is rehydrated via {@link RestoreState}.
|
|
21
|
+
*
|
|
22
|
+
* Modeled directly on `RealtimeWhiteboardChannel`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class RealtimeMediaChannel extends BaseRealtimeChannelClient<RealtimeMediaSurfaceComponent> {
|
|
25
|
+
/** The media state of record — created fresh with the plugin (one per session). */
|
|
26
|
+
readonly State: MediaChannelState;
|
|
27
|
+
/** The live bound surface, when the channel tab's pane is instantiated. */
|
|
28
|
+
private surface;
|
|
29
|
+
/** Media-mutation subscription driving the debounced state-of-record save. */
|
|
30
|
+
private stateChangedSub;
|
|
31
|
+
get ChannelName(): string;
|
|
32
|
+
get ToolNamePrefix(): string;
|
|
33
|
+
get TabTitle(): string;
|
|
34
|
+
get TabIcon(): string;
|
|
35
|
+
GetToolDefinitions(): RealtimeToolDefinition[];
|
|
36
|
+
GetSurfaceComponent(): Type<RealtimeMediaSurfaceComponent>;
|
|
37
|
+
/** First-run intro shown the first time the user opens the Media tab (once per user). */
|
|
38
|
+
GetOnboardingDetails(): ChannelOnboardingDetails;
|
|
39
|
+
/** Persist the media surface (host-debounced) on EVERY mutation — agent tools and tab changes. */
|
|
40
|
+
protected OnInitialize(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Wires the dynamically-created media surface (before first CD): shared state engine + agent name,
|
|
43
|
+
* plus the live session's MJ provider so FileID-backed items stream securely (mj-storage-media-player
|
|
44
|
+
* + CreateMediaAccessToken) under the SAME authenticated, multi-provider-safe provider.
|
|
45
|
+
*/
|
|
46
|
+
BindSurface(instance: RealtimeMediaSurfaceComponent): void;
|
|
47
|
+
UnbindSurface(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Executes one `Media_*` tool call LOCALLY: parse args, mutate the state engine, push a `[media]`
|
|
50
|
+
* background context note so the agent stays aware of the surface, and return a short JSON result
|
|
51
|
+
* string for the model. Never throws — malformed args resolve to a `{ success: false, error }`
|
|
52
|
+
* payload the model can narrate. Works with or without a bound surface (it mutates the state engine,
|
|
53
|
+
* which the surface observes).
|
|
54
|
+
*/
|
|
55
|
+
ApplyAgentTool(toolName: string, argsJson: string): string;
|
|
56
|
+
/** Adds a media item and makes it active. Source is a public `url` OR an MJStorage `fileId` (>=1 required). */
|
|
57
|
+
private applyShowMedia;
|
|
58
|
+
/** Closes a media item. */
|
|
59
|
+
private applyCloseMedia;
|
|
60
|
+
/** Activates + requests playback of a media item. */
|
|
61
|
+
private applyPlayMedia;
|
|
62
|
+
/** Draws (or, with absent dims, clears) a fractional highlight on a media item. */
|
|
63
|
+
private applyHighlight;
|
|
64
|
+
/** Clears all media. */
|
|
65
|
+
private applyClearAll;
|
|
66
|
+
/** The Media channel's serialized state of record (persisted under {@link ChannelName}). */
|
|
67
|
+
SerializeState(): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* Rehydrates a prior session's saved media into THIS session's state engine (in place — the
|
|
70
|
+
* {@link State} instance and its subscriptions are preserved). Tolerant: malformed JSON returns
|
|
71
|
+
* `false` and the surface stays empty.
|
|
72
|
+
*/
|
|
73
|
+
RestoreState(stateJson: string): boolean;
|
|
74
|
+
Dispose(): void;
|
|
75
|
+
/** Builds a model-readable failure payload (never thrown — returned to the model). */
|
|
76
|
+
private fail;
|
|
77
|
+
/**
|
|
78
|
+
* Pushes a background context note so the agent stays aware of the surface state. Framed as
|
|
79
|
+
* background (like the whiteboard's scene-delta notes) so the model doesn't narrate every change.
|
|
80
|
+
*/
|
|
81
|
+
private note;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Tree-shaking prevention: the Media channel is resolved dynamically through the ClassFactory (by the
|
|
85
|
+
* registry row's `ClientPluginClass` key), so this static call keeps its `@RegisterClass` side effect
|
|
86
|
+
* from being eliminated by the bundler. Called alongside `LoadRealtimeWhiteboardChannel()`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function LoadRealtimeMediaChannel(): void;
|
|
89
|
+
//# sourceMappingURL=media-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-channel.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/media/media-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAE/G,OAAO,EAAE,iBAAiB,EAAiC,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAkBnF;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,oBAAqB,SAAQ,yBAAyB,CAAC,6BAA6B,CAAC;IAChG,mFAAmF;IACnF,SAAgB,KAAK,oBAA2B;IAEhD,2EAA2E;IAC3E,OAAO,CAAC,OAAO,CAA8C;IAC7D,8EAA8E;IAC9E,OAAO,CAAC,eAAe,CAA6B;IAEpD,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,IAAW,cAAc,IAAI,MAAM,CAElC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAEM,kBAAkB,IAAI,sBAAsB,EAAE;IAIrC,mBAAmB,IAAI,IAAI,CAAC,6BAA6B,CAAC;IAI1E,yFAAyF;IACzE,oBAAoB,IAAI,wBAAwB;IAgBhE,kGAAkG;cAC/E,YAAY,IAAI,IAAI;IAMvC;;;;OAIG;IACI,WAAW,CAAC,QAAQ,EAAE,6BAA6B,GAA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