@memberjunction/ng-conversations 5.40.2 → 5.41.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/README.md +57 -0
- package/dist/__tests__/channel-optional-surface.test.d.ts +2 -0
- package/dist/__tests__/channel-optional-surface.test.d.ts.map +1 -0
- package/dist/__tests__/channel-optional-surface.test.js +53 -0
- package/dist/__tests__/channel-optional-surface.test.js.map +1 -0
- package/dist/__tests__/chat-events.test.d.ts +14 -0
- package/dist/__tests__/chat-events.test.d.ts.map +1 -0
- package/dist/__tests__/chat-events.test.js +109 -0
- package/dist/__tests__/chat-events.test.js.map +1 -0
- package/dist/__tests__/conversation-naming.test.d.ts +2 -0
- package/dist/__tests__/conversation-naming.test.d.ts.map +1 -0
- package/dist/__tests__/conversation-naming.test.js +110 -0
- package/dist/__tests__/conversation-naming.test.js.map +1 -0
- package/dist/__tests__/delegation-result-parser.test.d.ts +2 -0
- package/dist/__tests__/delegation-result-parser.test.d.ts.map +1 -0
- package/dist/__tests__/delegation-result-parser.test.js +107 -0
- package/dist/__tests__/delegation-result-parser.test.js.map +1 -0
- package/dist/__tests__/event-wiring.test.d.ts +15 -0
- package/dist/__tests__/event-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/event-wiring.test.js +100 -0
- package/dist/__tests__/event-wiring.test.js.map +1 -0
- package/dist/__tests__/narration-template.test.d.ts +2 -0
- package/dist/__tests__/narration-template.test.d.ts.map +1 -0
- package/dist/__tests__/narration-template.test.js +76 -0
- package/dist/__tests__/narration-template.test.js.map +1 -0
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts +2 -0
- package/dist/__tests__/realtime-agent-picker-models.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-agent-picker-models.test.js +49 -0
- package/dist/__tests__/realtime-agent-picker-models.test.js.map +1 -0
- package/dist/__tests__/realtime-audio-visuals.test.d.ts +2 -0
- package/dist/__tests__/realtime-audio-visuals.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-audio-visuals.test.js +123 -0
- package/dist/__tests__/realtime-audio-visuals.test.js.map +1 -0
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts +2 -0
- package/dist/__tests__/realtime-delegation-card-cancel.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-delegation-card-cancel.test.js +48 -0
- package/dist/__tests__/realtime-delegation-card-cancel.test.js.map +1 -0
- package/dist/__tests__/realtime-disclosure.test.d.ts +2 -0
- package/dist/__tests__/realtime-disclosure.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-disclosure.test.js +164 -0
- package/dist/__tests__/realtime-disclosure.test.js.map +1 -0
- package/dist/__tests__/realtime-pairing.test.d.ts +2 -0
- package/dist/__tests__/realtime-pairing.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-pairing.test.js +207 -0
- package/dist/__tests__/realtime-pairing.test.js.map +1 -0
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts +2 -0
- package/dist/__tests__/realtime-review-lifecycle.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-review-lifecycle.test.js +154 -0
- package/dist/__tests__/realtime-review-lifecycle.test.js.map +1 -0
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-cancel-usage.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-cancel-usage.test.js +230 -0
- package/dist/__tests__/realtime-session-cancel-usage.test.js.map +1 -0
- package/dist/__tests__/realtime-session-channels.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-channels.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-channels.test.js +252 -0
- package/dist/__tests__/realtime-session-channels.test.js.map +1 -0
- package/dist/__tests__/realtime-session-client-tools.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-client-tools.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-client-tools.test.js +103 -0
- package/dist/__tests__/realtime-session-client-tools.test.js.map +1 -0
- package/dist/__tests__/realtime-session-minimized.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-minimized.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-minimized.test.js +32 -0
- package/dist/__tests__/realtime-session-minimized.test.js.map +1 -0
- package/dist/__tests__/realtime-session-mint.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-mint.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-mint.test.js +69 -0
- package/dist/__tests__/realtime-session-mint.test.js.map +1 -0
- package/dist/__tests__/realtime-session-policy.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-policy.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-policy.test.js +303 -0
- package/dist/__tests__/realtime-session-policy.test.js.map +1 -0
- package/dist/__tests__/realtime-session-review.service.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-review.service.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-review.service.test.js +743 -0
- package/dist/__tests__/realtime-session-review.service.test.js.map +1 -0
- package/dist/__tests__/realtime-session-state.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-state.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-state.test.js +83 -0
- package/dist/__tests__/realtime-session-state.test.js.map +1 -0
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-timeline-card.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-timeline-card.test.js +106 -0
- package/dist/__tests__/realtime-session-timeline-card.test.js.map +1 -0
- package/dist/__tests__/realtime-session-timeline.test.d.ts +2 -0
- package/dist/__tests__/realtime-session-timeline.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-session-timeline.test.js +142 -0
- package/dist/__tests__/realtime-session-timeline.test.js.map +1 -0
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts +19 -0
- package/dist/__tests__/realtime-sessions-adapter.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-sessions-adapter.test.js +188 -0
- package/dist/__tests__/realtime-sessions-adapter.test.js.map +1 -0
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts +2 -0
- package/dist/__tests__/realtime-surface-panel-prefs.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-surface-panel-prefs.test.js +100 -0
- package/dist/__tests__/realtime-surface-panel-prefs.test.js.map +1 -0
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts +2 -0
- package/dist/__tests__/realtime-surface-tabs-model.test.d.ts.map +1 -0
- package/dist/__tests__/realtime-surface-tabs-model.test.js +193 -0
- package/dist/__tests__/realtime-surface-tabs-model.test.js.map +1 -0
- package/dist/__tests__/remote-browser-audio-player.test.d.ts +2 -0
- package/dist/__tests__/remote-browser-audio-player.test.d.ts.map +1 -0
- package/dist/__tests__/remote-browser-audio-player.test.js +137 -0
- package/dist/__tests__/remote-browser-audio-player.test.js.map +1 -0
- package/dist/__tests__/remote-browser-channel.test.d.ts +2 -0
- package/dist/__tests__/remote-browser-channel.test.d.ts.map +1 -0
- package/dist/__tests__/remote-browser-channel.test.js +423 -0
- package/dist/__tests__/remote-browser-channel.test.js.map +1 -0
- package/dist/__tests__/slot-defaults.test.d.ts +24 -0
- package/dist/__tests__/slot-defaults.test.d.ts.map +1 -0
- package/dist/__tests__/slot-defaults.test.js +63 -0
- package/dist/__tests__/slot-defaults.test.js.map +1 -0
- package/dist/__tests__/user-authorization.test.d.ts +2 -0
- package/dist/__tests__/user-authorization.test.d.ts.map +1 -0
- package/dist/__tests__/user-authorization.test.js +97 -0
- package/dist/__tests__/user-authorization.test.js.map +1 -0
- package/dist/__tests__/voice-session-narration.test.d.ts +2 -0
- package/dist/__tests__/voice-session-narration.test.d.ts.map +1 -0
- package/dist/__tests__/voice-session-narration.test.js +609 -0
- package/dist/__tests__/voice-session-narration.test.js.map +1 -0
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts +2 -0
- package/dist/__tests__/whiteboard-artifact-viewer.test.d.ts.map +1 -0
- package/dist/__tests__/whiteboard-artifact-viewer.test.js +101 -0
- package/dist/__tests__/whiteboard-artifact-viewer.test.js.map +1 -0
- package/dist/__tests__/whiteboard-channel.test.d.ts +2 -0
- package/dist/__tests__/whiteboard-channel.test.d.ts.map +1 -0
- package/dist/__tests__/whiteboard-channel.test.js +260 -0
- package/dist/__tests__/whiteboard-channel.test.js.map +1 -0
- package/dist/__tests__/whiteboard-restore-state.test.d.ts +2 -0
- package/dist/__tests__/whiteboard-restore-state.test.d.ts.map +1 -0
- package/dist/__tests__/whiteboard-restore-state.test.js +108 -0
- package/dist/__tests__/whiteboard-restore-state.test.js.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +205 -3
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +911 -342
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +35 -17
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts +4 -0
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.js +43 -19
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +17 -1
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input-box.component.js +73 -15
- package/dist/lib/components/message/message-input-box.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +142 -6
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +328 -82
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +28 -3
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +180 -108
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +81 -2
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +252 -87
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +282 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +158 -0
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -0
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts +25 -0
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js +140 -0
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +35 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +58 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +63 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +260 -0
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +117 -0
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +504 -0
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +168 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +556 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +97 -0
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-audio-visuals.js +139 -0
- package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -0
- package/dist/lib/components/realtime/realtime-channel-strip.component.d.ts +29 -0
- package/dist/lib/components/realtime/realtime-channel-strip.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-channel-strip.component.js +69 -0
- package/dist/lib/components/realtime/realtime-channel-strip.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +65 -0
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-composer.component.js +256 -0
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +71 -0
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +324 -0
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-disclosure.d.ts +135 -0
- package/dist/lib/components/realtime/realtime-disclosure.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-disclosure.js +188 -0
- package/dist/lib/components/realtime/realtime-disclosure.js.map +1 -0
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +491 -0
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +1274 -0
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-session-state.d.ts +191 -0
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-session-state.js +244 -0
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -0
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +56 -0
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-session-thread.component.js +246 -0
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +51 -0
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +193 -0
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-panel-prefs.d.ts +77 -0
- package/dist/lib/components/realtime/realtime-surface-panel-prefs.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-panel-prefs.js +114 -0
- package/dist/lib/components/realtime/realtime-surface-panel-prefs.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +173 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +496 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +181 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +223 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-audio-player.d.ts +163 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-audio-player.d.ts.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-audio-player.js +309 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-audio-player.js.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +168 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +524 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +346 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +851 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts +86 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +210 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts +48 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js +180 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +119 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +274 -0
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-agent-presence-default.component.d.ts +11 -0
- package/dist/lib/components/slots/mj-chat-agent-presence-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-agent-presence-default.component.js +98 -0
- package/dist/lib/components/slots/mj-chat-agent-presence-default.component.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-demonstration-surface-default.component.d.ts +9 -0
- package/dist/lib/components/slots/mj-chat-demonstration-surface-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-demonstration-surface-default.component.js +35 -0
- package/dist/lib/components/slots/mj-chat-demonstration-surface-default.component.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-empty-state-default.component.d.ts +28 -0
- package/dist/lib/components/slots/mj-chat-empty-state-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-empty-state-default.component.js +104 -0
- package/dist/lib/components/slots/mj-chat-empty-state-default.component.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-header-default.component.d.ts +11 -0
- package/dist/lib/components/slots/mj-chat-header-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-header-default.component.js +103 -0
- package/dist/lib/components/slots/mj-chat-header-default.component.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-message-bubble-default.component.d.ts +15 -0
- package/dist/lib/components/slots/mj-chat-message-bubble-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-message-bubble-default.component.js +73 -0
- package/dist/lib/components/slots/mj-chat-message-bubble-default.component.js.map +1 -0
- package/dist/lib/components/slots/mj-chat-message-extra-default.component.d.ts +9 -0
- package/dist/lib/components/slots/mj-chat-message-extra-default.component.d.ts.map +1 -0
- package/dist/lib/components/slots/mj-chat-message-extra-default.component.js +34 -0
- package/dist/lib/components/slots/mj-chat-message-extra-default.component.js.map +1 -0
- package/dist/lib/components/slots/slot-interfaces.d.ts +95 -0
- package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -0
- package/dist/lib/components/slots/slot-interfaces.js +18 -0
- package/dist/lib/components/slots/slot-interfaces.js.map +1 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +11 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +28 -4
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +12 -1
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +93 -5
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/directives/chat-slot.directive.d.ts +44 -0
- package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -0
- package/dist/lib/directives/chat-slot.directive.js +54 -0
- package/dist/lib/directives/chat-slot.directive.js.map +1 -0
- package/dist/lib/events/chat-events.d.ts +137 -0
- package/dist/lib/events/chat-events.d.ts.map +1 -0
- package/dist/lib/events/chat-events.js +189 -0
- package/dist/lib/events/chat-events.js.map +1 -0
- package/dist/lib/models/conversation-state.model.d.ts +2 -1
- 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/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +23 -6
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +60 -74
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +100 -313
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-bridge.service.d.ts +11 -70
- package/dist/lib/services/conversation-bridge.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-bridge.service.js +51 -85
- package/dist/lib/services/conversation-bridge.service.js.map +1 -1
- package/dist/lib/services/conversation-naming.d.ts +63 -0
- package/dist/lib/services/conversation-naming.d.ts.map +1 -0
- package/dist/lib/services/conversation-naming.js +58 -0
- package/dist/lib/services/conversation-naming.js.map +1 -0
- package/dist/lib/services/conversation-streaming.service.d.ts +24 -154
- package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-streaming.service.js +39 -361
- package/dist/lib/services/conversation-streaming.service.js.map +1 -1
- package/dist/lib/services/conversations-runtime-bootstrap.service.d.ts +10 -0
- package/dist/lib/services/conversations-runtime-bootstrap.service.d.ts.map +1 -0
- package/dist/lib/services/conversations-runtime-bootstrap.service.js +104 -0
- package/dist/lib/services/conversations-runtime-bootstrap.service.js.map +1 -0
- package/dist/lib/services/delegation-result-parser.d.ts +45 -0
- package/dist/lib/services/delegation-result-parser.d.ts.map +1 -0
- package/dist/lib/services/delegation-result-parser.js +48 -0
- package/dist/lib/services/delegation-result-parser.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +19 -4
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +65 -4
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/mention-parser.service.d.ts +8 -53
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
- package/dist/lib/services/mention-parser.service.js +32 -243
- package/dist/lib/services/mention-parser.service.js.map +1 -1
- package/dist/lib/services/narration-template.d.ts +42 -0
- package/dist/lib/services/narration-template.d.ts.map +1 -0
- package/dist/lib/services/narration-template.js +73 -0
- package/dist/lib/services/narration-template.js.map +1 -0
- package/dist/lib/services/realtime-pairing.d.ts +120 -0
- package/dist/lib/services/realtime-pairing.d.ts.map +1 -0
- package/dist/lib/services/realtime-pairing.js +150 -0
- package/dist/lib/services/realtime-pairing.js.map +1 -0
- package/dist/lib/services/realtime-session-review.service.d.ts +233 -0
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -0
- package/dist/lib/services/realtime-session-review.service.js +417 -0
- package/dist/lib/services/realtime-session-review.service.js.map +1 -0
- package/dist/lib/services/realtime-session.service.d.ts +739 -0
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -0
- package/dist/lib/services/realtime-session.service.js +1647 -0
- package/dist/lib/services/realtime-session.service.js.map +1 -0
- package/dist/lib/services/realtime-sessions-adapter.d.ts +54 -0
- package/dist/lib/services/realtime-sessions-adapter.d.ts.map +1 -0
- package/dist/lib/services/realtime-sessions-adapter.js +154 -0
- package/dist/lib/services/realtime-sessions-adapter.js.map +1 -0
- package/dist/lib/services/user-authorization.d.ts +67 -0
- package/dist/lib/services/user-authorization.d.ts.map +1 -0
- package/dist/lib/services/user-authorization.js +66 -0
- package/dist/lib/services/user-authorization.js.map +1 -0
- package/dist/lib/utils/realtime-session-timeline.d.ts +84 -0
- package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -0
- package/dist/lib/utils/realtime-session-timeline.js +94 -0
- package/dist/lib/utils/realtime-session-timeline.js.map +1 -0
- package/dist/public-api.d.ts +41 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +50 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +27 -24
- package/dist/__tests__/conversation-bridge.service.test.d.ts +0 -2
- package/dist/__tests__/conversation-bridge.service.test.d.ts.map +0 -1
- package/dist/__tests__/conversation-bridge.service.test.js +0 -98
- package/dist/__tests__/conversation-bridge.service.test.js.map +0 -1
- package/dist/__tests__/mention-parser.test.d.ts +0 -2
- package/dist/__tests__/mention-parser.test.d.ts.map +0 -1
- package/dist/__tests__/mention-parser.test.js +0 -154
- package/dist/__tests__/mention-parser.test.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';
|
|
2
|
+
import { AIEngineBase } from '@memberjunction/ai-engine-base';
|
|
3
|
+
/**
|
|
4
|
+
* Loads the pairing rows for one co-agent from {@link AIEngineBase}'s cached
|
|
5
|
+
* `MJ: AI Agent Co Agents` metadata (provider-scoped engine instance, lazy `Config`),
|
|
6
|
+
* in `Sequence` order. The engine's BaseEntity-event reactivity keeps the cache fresh —
|
|
7
|
+
* no per-call RunView round-trip.
|
|
8
|
+
*
|
|
9
|
+
* Tolerant by design: any failure degrades to an EMPTY list — i.e. "no pairing
|
|
10
|
+
* constraint". The client gate is pure disclosure; the server independently validates
|
|
11
|
+
* the co-agent/target pairing at session mint.
|
|
12
|
+
*/
|
|
13
|
+
export async function LoadCoAgentPairings(provider, coAgentId) {
|
|
14
|
+
const id = coAgentId?.trim() ?? '';
|
|
15
|
+
if (id.length === 0) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const engine = AIEngineBase.GetProviderInstance(provider, AIEngineBase);
|
|
20
|
+
await engine.Config(false, undefined, provider);
|
|
21
|
+
const rows = (engine.AgentCoAgents ?? [])
|
|
22
|
+
.filter(p => p.Type === 'CoAgent' &&
|
|
23
|
+
p.Status === 'Active' &&
|
|
24
|
+
p.TargetAgentID != null &&
|
|
25
|
+
UUIDsEqual(p.CoAgentID, id))
|
|
26
|
+
.map(p => ({
|
|
27
|
+
ID: p.ID,
|
|
28
|
+
CoAgentID: p.CoAgentID,
|
|
29
|
+
TargetAgentID: p.TargetAgentID,
|
|
30
|
+
TargetAgent: p.TargetAgent ?? null,
|
|
31
|
+
IsDefault: p.IsDefault,
|
|
32
|
+
Sequence: p.Sequence ?? null
|
|
33
|
+
}));
|
|
34
|
+
return SortPairings(rows);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.warn('[RealtimePairing] Co-agent pairing lookup unavailable — treating co-agent as universal:', error);
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the pairing rows in canonical display order: `Sequence` ascending (null/missing
|
|
43
|
+
* sequences last), ties broken by target-agent name. Pure; never mutates the input.
|
|
44
|
+
*/
|
|
45
|
+
export function SortPairings(pairings) {
|
|
46
|
+
return [...pairings].sort((a, b) => {
|
|
47
|
+
const aSeq = a.Sequence ?? Number.MAX_SAFE_INTEGER;
|
|
48
|
+
const bSeq = b.Sequence ?? Number.MAX_SAFE_INTEGER;
|
|
49
|
+
if (aSeq !== bSeq) {
|
|
50
|
+
return aSeq - bSeq;
|
|
51
|
+
}
|
|
52
|
+
return (a.TargetAgent ?? '').localeCompare(b.TargetAgent ?? '');
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Applies the pairing constraint to a candidate target-agent list:
|
|
57
|
+
* - ZERO pairing rows → the co-agent is universal; the candidates are returned unchanged
|
|
58
|
+
* (today's flow untouched).
|
|
59
|
+
* - One or more rows → only candidates that appear among the pairing targets are
|
|
60
|
+
* returned, ordered by the pairings' `Sequence`. Paired targets the user can't see /
|
|
61
|
+
* run (absent from `agents`) are silently dropped.
|
|
62
|
+
*
|
|
63
|
+
* Pure and UUID-casing safe (`NormalizeUUID` keys).
|
|
64
|
+
*/
|
|
65
|
+
export function ConstrainTargetsToPairings(agents, pairings) {
|
|
66
|
+
if (!pairings || pairings.length === 0) {
|
|
67
|
+
return [...agents];
|
|
68
|
+
}
|
|
69
|
+
const agentsById = new Map();
|
|
70
|
+
for (const agent of agents) {
|
|
71
|
+
agentsById.set(NormalizeUUID(agent.ID), agent);
|
|
72
|
+
}
|
|
73
|
+
const constrained = [];
|
|
74
|
+
const seen = new Set();
|
|
75
|
+
for (const pairing of SortPairings(pairings)) {
|
|
76
|
+
const key = NormalizeUUID(pairing.TargetAgentID);
|
|
77
|
+
const agent = agentsById.get(key);
|
|
78
|
+
if (agent && !seen.has(key)) {
|
|
79
|
+
seen.add(key);
|
|
80
|
+
constrained.push(agent);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return constrained;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The co-agent's default target from its pairing rows — the first `IsDefault` row in
|
|
87
|
+
* `Sequence` order (server enforces at most one, but the helper stays deterministic
|
|
88
|
+
* regardless). `null` when there are no rows or none is marked default.
|
|
89
|
+
*/
|
|
90
|
+
export function DefaultPairedTargetId(pairings) {
|
|
91
|
+
for (const pairing of SortPairings(pairings ?? [])) {
|
|
92
|
+
if (pairing.IsDefault) {
|
|
93
|
+
return pairing.TargetAgentID;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Whether the pairing rows permit `targetAgentId` as a target. ZERO rows means the
|
|
100
|
+
* co-agent is universal (always allowed); otherwise the target must appear among the
|
|
101
|
+
* rows. Missing/empty target id is never allowed against a constrained co-agent.
|
|
102
|
+
*/
|
|
103
|
+
export function PairingsAllowTarget(pairings, targetAgentId) {
|
|
104
|
+
if (!pairings || pairings.length === 0) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
if (!targetAgentId) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return pairings.some(p => UUIDsEqual(p.TargetAgentID, targetAgentId));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Filters an agent list down to ACTIVE Realtime-type **co-agent** candidates. The input
|
|
114
|
+
* is expected to already be the run-permission-filtered active-agent set the host uses
|
|
115
|
+
* for routing/@mentions, so this only applies the agent-TYPE cut (trim +
|
|
116
|
+
* case-insensitive match on the denormalized `Type` name).
|
|
117
|
+
*/
|
|
118
|
+
export function FilterRealtimeCoAgents(agents) {
|
|
119
|
+
return agents.filter(a => (a.Type ?? '').trim().toLowerCase() === 'realtime');
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Builds the "Voice model" dropdown options from a cached model list: ACTIVE models whose
|
|
123
|
+
* type is `Realtime` (trim + case-insensitive — SQL-collation parity with the previous
|
|
124
|
+
* `IsActive = 1 AND AIModelType = 'Realtime'` filter), projected to {@link RealtimeModelOption}
|
|
125
|
+
* and sorted by Name. Pure; never mutates the input.
|
|
126
|
+
*/
|
|
127
|
+
export function BuildRealtimeModelOptions(models) {
|
|
128
|
+
return models
|
|
129
|
+
.filter(m => m.IsActive && (m.AIModelType ?? '').trim().toLowerCase() === 'realtime')
|
|
130
|
+
.map(m => ({ ID: m.ID, Name: m.Name }))
|
|
131
|
+
.sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Builds the `configOverridesJson` payload for the `StartRealtimeClientSession` mint from
|
|
135
|
+
* what the (authorization-gated) pickers chose. Currently the only override is the
|
|
136
|
+
* explicit realtime model preference; the envelope shape —
|
|
137
|
+
* `{"realtime":{"modelPreference":"<id>"}}` — is the pinned server contract and is
|
|
138
|
+
* structured so future overrides ride alongside without reshaping.
|
|
139
|
+
*
|
|
140
|
+
* @returns The JSON string, or `null` when nothing was overridden (the common case —
|
|
141
|
+
* `null` keeps the mint identical to today's behavior).
|
|
142
|
+
*/
|
|
143
|
+
export function BuildRealtimeConfigOverridesJson(preferredModelId) {
|
|
144
|
+
const modelId = preferredModelId?.trim() ?? '';
|
|
145
|
+
if (modelId.length === 0) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
return JSON.stringify({ realtime: { modelPreference: modelId } });
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=realtime-pairing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-pairing.js","sourceRoot":"","sources":["../../../src/lib/services/realtime-pairing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAgC9D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAA2B,EAAE,SAAiB;IACtF,MAAM,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,CAAC,mBAAmB,CAAe,QAAQ,EAAE,YAAY,CAAiB,CAAC;QACtG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC;aACtC,MAAM,CAAC,CAAC,CAAC,EAAE,CACV,CAAC,CAAC,IAAI,KAAK,SAAS;YACpB,CAAC,CAAC,MAAM,KAAK,QAAQ;YACrB,CAAC,CAAC,aAAa,IAAI,IAAI;YACvB,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;aAC7B,GAAG,CAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;YACjC,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,SAAS,EAAE,CAAC,CA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global';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\n\n/**\n * The narrow read-only projection of an `MJ: AI Agent Co Agents` row the voice UI consumes\n * (loaded via {@link LoadCoAgentPairings} from {@link AIEngineBase}'s cached `AgentCoAgents`;\n * only **Active** rows of relationship **Type `'CoAgent'`** with a specific agent target —\n * type-level rows express the resolution-chain default, not a target restriction, and\n * reserved relationship types are ignored until their features ship). Pairing semantics: a\n * co-agent with ZERO such rows is **universal** (it can front any target agent — the\n * zero-config default); a co-agent WITH rows may front exactly the listed targets, with the\n * `IsDefault` row as its preselected target.\n */\nexport interface RealtimePairedAgentRow {\n /** The pairing row id. */\n ID: string;\n /** The Realtime-type co-agent the pairing belongs to. */\n CoAgentID: string;\n /** The target agent this co-agent may front. */\n TargetAgentID: string;\n /** Denormalized target-agent display name (from the base view). */\n TargetAgent: string | null;\n /** When true, this target is the co-agent's default (at most one per co-agent). */\n IsDefault: boolean;\n /** Display/list ordering of the pairing rows. */\n Sequence: number | null;\n}\n\n/** Minimal agent shape the pure pairing/co-agent helpers operate on. */\nexport interface RealtimeAgentLike {\n ID: string;\n}\n\n/**\n * Loads the pairing rows for one co-agent from {@link AIEngineBase}'s cached\n * `MJ: AI Agent Co Agents` metadata (provider-scoped engine instance, lazy `Config`),\n * in `Sequence` order. The engine's BaseEntity-event reactivity keeps the cache fresh —\n * no per-call RunView round-trip.\n *\n * Tolerant by design: any failure degrades to an EMPTY list — i.e. \"no pairing\n * constraint\". The client gate is pure disclosure; the server independently validates\n * the co-agent/target pairing at session mint.\n */\nexport async function LoadCoAgentPairings(provider: IMetadataProvider, coAgentId: string): Promise<RealtimePairedAgentRow[]> {\n const id = coAgentId?.trim() ?? '';\n if (id.length === 0) {\n return [];\n }\n try {\n const engine = AIEngineBase.GetProviderInstance<AIEngineBase>(provider, AIEngineBase) as AIEngineBase;\n await engine.Config(false, undefined, provider);\n const rows = (engine.AgentCoAgents ?? [])\n .filter(p =>\n p.Type === 'CoAgent' &&\n p.Status === 'Active' &&\n p.TargetAgentID != null &&\n UUIDsEqual(p.CoAgentID, id))\n .map<RealtimePairedAgentRow>(p => ({\n ID: p.ID,\n CoAgentID: p.CoAgentID,\n TargetAgentID: p.TargetAgentID!,\n TargetAgent: p.TargetAgent ?? null,\n IsDefault: p.IsDefault,\n Sequence: p.Sequence ?? null\n }));\n return SortPairings(rows);\n } catch (error) {\n console.warn('[RealtimePairing] Co-agent pairing lookup unavailable — treating co-agent as universal:', error);\n return [];\n }\n}\n\n/**\n * Returns the pairing rows in canonical display order: `Sequence` ascending (null/missing\n * sequences last), ties broken by target-agent name. Pure; never mutates the input.\n */\nexport function SortPairings(pairings: readonly RealtimePairedAgentRow[]): RealtimePairedAgentRow[] {\n return [...pairings].sort((a, b) => {\n const aSeq = a.Sequence ?? Number.MAX_SAFE_INTEGER;\n const bSeq = b.Sequence ?? Number.MAX_SAFE_INTEGER;\n if (aSeq !== bSeq) {\n return aSeq - bSeq;\n }\n return (a.TargetAgent ?? '').localeCompare(b.TargetAgent ?? '');\n });\n}\n\n/**\n * Applies the pairing constraint to a candidate target-agent list:\n * - ZERO pairing rows → the co-agent is universal; the candidates are returned unchanged\n * (today's flow untouched).\n * - One or more rows → only candidates that appear among the pairing targets are\n * returned, ordered by the pairings' `Sequence`. Paired targets the user can't see /\n * run (absent from `agents`) are silently dropped.\n *\n * Pure and UUID-casing safe (`NormalizeUUID` keys).\n */\nexport function ConstrainTargetsToPairings<T extends RealtimeAgentLike>(\n agents: readonly T[],\n pairings: readonly RealtimePairedAgentRow[]\n): T[] {\n if (!pairings || pairings.length === 0) {\n return [...agents];\n }\n const agentsById = new Map<string, T>();\n for (const agent of agents) {\n agentsById.set(NormalizeUUID(agent.ID), agent);\n }\n const constrained: T[] = [];\n const seen = new Set<string>();\n for (const pairing of SortPairings(pairings)) {\n const key = NormalizeUUID(pairing.TargetAgentID);\n const agent = agentsById.get(key);\n if (agent && !seen.has(key)) {\n seen.add(key);\n constrained.push(agent);\n }\n }\n return constrained;\n}\n\n/**\n * The co-agent's default target from its pairing rows — the first `IsDefault` row in\n * `Sequence` order (server enforces at most one, but the helper stays deterministic\n * regardless). `null` when there are no rows or none is marked default.\n */\nexport function DefaultPairedTargetId(pairings: readonly RealtimePairedAgentRow[]): string | null {\n for (const pairing of SortPairings(pairings ?? [])) {\n if (pairing.IsDefault) {\n return pairing.TargetAgentID;\n }\n }\n return null;\n}\n\n/**\n * Whether the pairing rows permit `targetAgentId` as a target. ZERO rows means the\n * co-agent is universal (always allowed); otherwise the target must appear among the\n * rows. Missing/empty target id is never allowed against a constrained co-agent.\n */\nexport function PairingsAllowTarget(pairings: readonly RealtimePairedAgentRow[], targetAgentId: string | null | undefined): boolean {\n if (!pairings || pairings.length === 0) {\n return true;\n }\n if (!targetAgentId) {\n return false;\n }\n return pairings.some(p => UUIDsEqual(p.TargetAgentID, targetAgentId));\n}\n\n/**\n * Filters an agent list down to ACTIVE Realtime-type **co-agent** candidates. The input\n * is expected to already be the run-permission-filtered active-agent set the host uses\n * for routing/@mentions, so this only applies the agent-TYPE cut (trim +\n * case-insensitive match on the denormalized `Type` name).\n */\nexport function FilterRealtimeCoAgents<T extends { Type: string | null }>(agents: readonly T[]): T[] {\n return agents.filter(a => (a.Type ?? '').trim().toLowerCase() === 'realtime');\n}\n\n/**\n * A selectable realtime model option in the voice picker (narrow read-only projection of\n * `MJ: AI Models` — only the fields the dropdown renders).\n */\nexport interface RealtimeModelOption {\n /** The `MJ: AI Models` row id. */\n ID: string;\n /** The model's display name. */\n Name: string;\n}\n\n/**\n * The minimal `MJ: AI Models` row shape {@link BuildRealtimeModelOptions} consumes —\n * structurally satisfied by `AIEngineBase`'s cached `Models` entities.\n */\nexport interface VoiceModelCandidate {\n /** The `MJ: AI Models` row id. */\n ID: string;\n /** The model's display name. */\n Name: string;\n /** Denormalized model-type name (e.g. 'LLM', 'Realtime'). */\n AIModelType: string | null;\n /** Whether the model is active and selectable. */\n IsActive: boolean;\n}\n\n/**\n * Builds the \"Voice model\" dropdown options from a cached model list: ACTIVE models whose\n * type is `Realtime` (trim + case-insensitive — SQL-collation parity with the previous\n * `IsActive = 1 AND AIModelType = 'Realtime'` filter), projected to {@link RealtimeModelOption}\n * and sorted by Name. Pure; never mutates the input.\n */\nexport function BuildRealtimeModelOptions(models: ReadonlyArray<VoiceModelCandidate>): RealtimeModelOption[] {\n return models\n .filter(m => m.IsActive && (m.AIModelType ?? '').trim().toLowerCase() === 'realtime')\n .map<RealtimeModelOption>(m => ({ ID: m.ID, Name: m.Name }))\n .sort((a, b) => (a.Name ?? '').localeCompare(b.Name ?? ''));\n}\n\n/**\n * Builds the `configOverridesJson` payload for the `StartRealtimeClientSession` mint from\n * what the (authorization-gated) pickers chose. Currently the only override is the\n * explicit realtime model preference; the envelope shape —\n * `{\"realtime\":{\"modelPreference\":\"<id>\"}}` — is the pinned server contract and is\n * structured so future overrides ride alongside without reshaping.\n *\n * @returns The JSON string, or `null` when nothing was overridden (the common case —\n * `null` keeps the mint identical to today's behavior).\n */\nexport function BuildRealtimeConfigOverridesJson(preferredModelId: string | null | undefined): string | null {\n const modelId = preferredModelId?.trim() ?? '';\n if (modelId.length === 0) {\n return null;\n }\n return JSON.stringify({ realtime: { modelPreference: modelId } });\n}\n"]}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { IMetadataProvider } from '@memberjunction/core';
|
|
2
|
+
import { RealtimeDelegationCardVM, RealtimeThreadItem } from '../components/realtime/realtime-session-state';
|
|
3
|
+
import { ParsedDelegationArtifact } from './delegation-result-parser';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Why a reviewed session was closed, as stamped server-side by `SessionManager.CloseSession`
|
|
7
|
+
* (mirrors `MJAIAgentSessionEntity.CloseReason`). `null` means the session is still open OR a
|
|
8
|
+
* legacy row was closed before the column existed.
|
|
9
|
+
*/
|
|
10
|
+
export type RealtimeReviewCloseReason = 'Error' | 'Explicit' | 'Janitor' | 'Shutdown';
|
|
11
|
+
/** One historical caption turn of a reviewed session (a persisted `MJ: Conversation Details` row). */
|
|
12
|
+
export interface RealtimeSessionReviewTurn {
|
|
13
|
+
/** Who spoke the turn. Persisted `AI` rows map to `Assistant`. */
|
|
14
|
+
Role: 'User' | 'Assistant';
|
|
15
|
+
/** The transcript text. */
|
|
16
|
+
Text: string;
|
|
17
|
+
/** When the turn was persisted (`__mj_CreatedAt`), or null when unknown. */
|
|
18
|
+
At: Date | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A compact preview of one DELEGATED agent run the reviewed session spawned (an
|
|
22
|
+
* `MJ: AI Agent Runs` row linked via `AgentSessionID`, EXCLUDING the co-agent's own
|
|
23
|
+
* observability run). Carries just enough to render a done delegation card.
|
|
24
|
+
*/
|
|
25
|
+
export interface RealtimeSessionReviewRun {
|
|
26
|
+
/** `MJ: AI Agent Runs.ID`. */
|
|
27
|
+
RunID: string;
|
|
28
|
+
/** The delegated agent's id. */
|
|
29
|
+
AgentID: string;
|
|
30
|
+
/** Denormalized agent display name from the run view, when available. */
|
|
31
|
+
AgentName: string | null;
|
|
32
|
+
/** Terminal (or last-known) run status (`Completed` | `Failed` | `Running` | …). */
|
|
33
|
+
Status: string;
|
|
34
|
+
/** Whether the run reported success. */
|
|
35
|
+
Success: boolean;
|
|
36
|
+
/** The run's user-facing result message, when one was recorded. */
|
|
37
|
+
Message: string | null;
|
|
38
|
+
/** The run's error message, when it failed. */
|
|
39
|
+
ErrorMessage: string | null;
|
|
40
|
+
/** The final step the run reported (`Success` | `Failed` | `Retry` | …), when known. */
|
|
41
|
+
FinalStep: string | null;
|
|
42
|
+
StartedAt: Date | null;
|
|
43
|
+
CompletedAt: Date | null;
|
|
44
|
+
}
|
|
45
|
+
/** The persisted state of one interactive channel of the reviewed session. */
|
|
46
|
+
export interface RealtimeSessionReviewChannelState {
|
|
47
|
+
/** Channel display name (e.g. `Whiteboard`), denormalized on the session-channel row. */
|
|
48
|
+
ChannelName: string;
|
|
49
|
+
/** The channel's serialized state of record (`AIAgentSessionChannel.Config`), or null when none was saved. */
|
|
50
|
+
StateJson: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* MULTI-LEG channel-state merge: folds every leg's channel rows into one state set,
|
|
54
|
+
* NEWEST leg wins per channel name — but only a leg that actually SAVED state counts.
|
|
55
|
+
* A resumed session whose final leg never touched the whiteboard therefore still
|
|
56
|
+
* reviews with the board an EARLIER leg drew (previously only the primary/newest leg's
|
|
57
|
+
* rows were consulted, so that board silently vanished from review).
|
|
58
|
+
*
|
|
59
|
+
* @param legChannelStates Per-leg channel states, ordered OLDEST → NEWEST (the chain order).
|
|
60
|
+
* @returns One entry per channel name (case-insensitive), each from the newest leg that
|
|
61
|
+
* saved a non-empty state; channels no leg ever saved keep a null-state entry so the
|
|
62
|
+
* review still knows the channel existed.
|
|
63
|
+
*/
|
|
64
|
+
export declare function MergeChainChannelStates(legChannelStates: ReadonlyArray<ReadonlyArray<RealtimeSessionReviewChannelState>>): RealtimeSessionReviewChannelState[];
|
|
65
|
+
/**
|
|
66
|
+
* One LEG of a reviewed session chain: a single `MJ: AI Agent Sessions` row plus its own
|
|
67
|
+
* caption turns and delegated-run previews. A session resumed via `lastSessionId` chains
|
|
68
|
+
* legs together (newest leg's `LastSessionID` → prior leg); the review loader walks that
|
|
69
|
+
* chain BACKWARDS (capped — see the loader docs) so review mode can render the FULL
|
|
70
|
+
* conversation arc chronologically, with a divider between legs.
|
|
71
|
+
*/
|
|
72
|
+
export interface RealtimeSessionReviewLeg {
|
|
73
|
+
/** `MJ: AI Agent Sessions.ID` of this leg. */
|
|
74
|
+
SessionID: string;
|
|
75
|
+
/** When this leg started (`__mj_CreatedAt`). */
|
|
76
|
+
StartedAt: Date | null;
|
|
77
|
+
/** When this leg closed (null while still open). */
|
|
78
|
+
ClosedAt: Date | null;
|
|
79
|
+
/** Why this leg closed (null while open / legacy rows). */
|
|
80
|
+
CloseReason: RealtimeReviewCloseReason | null;
|
|
81
|
+
/** This leg's chronological caption turns (oldest first). */
|
|
82
|
+
Turns: RealtimeSessionReviewTurn[];
|
|
83
|
+
/** This leg's delegated-run previews (oldest first, minus its co-agent observability run). */
|
|
84
|
+
DelegatedRuns: RealtimeSessionReviewRun[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Everything the call overlay's SESSION REVIEW mode renders for one past realtime session:
|
|
88
|
+
* the session identity/lifecycle row, the chronological caption turns, previews of the
|
|
89
|
+
* delegated runs, and the saved per-channel states (e.g. the whiteboard board).
|
|
90
|
+
*/
|
|
91
|
+
export interface RealtimeSessionReview {
|
|
92
|
+
/** `MJ: AI Agent Sessions.ID` of the reviewed session. */
|
|
93
|
+
SessionID: string;
|
|
94
|
+
/** The session's fronting agent id (`AIAgentSession.AgentID` — usually the Realtime Co-Agent). */
|
|
95
|
+
AgentID: string;
|
|
96
|
+
/** Display name shown in the review banner (target agent when resolvable, else the session agent). */
|
|
97
|
+
AgentName: string;
|
|
98
|
+
/**
|
|
99
|
+
* The agent a RESUMED live session should front: the session Config's `targetAgentID`,
|
|
100
|
+
* falling back to the session's own `AgentID` when the config doesn't carry one.
|
|
101
|
+
*/
|
|
102
|
+
TargetAgentID: string;
|
|
103
|
+
/** Conversation the session was bound to, when any. */
|
|
104
|
+
ConversationID: string | null;
|
|
105
|
+
Status: 'Active' | 'Closed' | 'Idle';
|
|
106
|
+
CloseReason: RealtimeReviewCloseReason | null;
|
|
107
|
+
/** When the session started (`__mj_CreatedAt`). */
|
|
108
|
+
StartedAt: Date | null;
|
|
109
|
+
LastActiveAt: Date | null;
|
|
110
|
+
ClosedAt: Date | null;
|
|
111
|
+
/** Chronological caption turns (oldest first) — ALL legs of the chain, flattened. */
|
|
112
|
+
Turns: RealtimeSessionReviewTurn[];
|
|
113
|
+
/** Delegated run previews (oldest first, all legs), minus each leg's co-agent observability run. */
|
|
114
|
+
DelegatedRuns: RealtimeSessionReviewRun[];
|
|
115
|
+
/**
|
|
116
|
+
* Saved channel states, one per session-channel row that carried a name. Channel state
|
|
117
|
+
* (e.g. the whiteboard board) is the LATEST leg's only — earlier legs' states were
|
|
118
|
+
* superseded when the chain resumed.
|
|
119
|
+
*/
|
|
120
|
+
ChannelStates: RealtimeSessionReviewChannelState[];
|
|
121
|
+
/**
|
|
122
|
+
* The session-chain LEGS, chronological (oldest first; the LAST leg is the reviewed
|
|
123
|
+
* session itself). Single-session reviews carry exactly one leg. Drives the per-leg
|
|
124
|
+
* dividers `BuildReviewThreadItems` renders.
|
|
125
|
+
*/
|
|
126
|
+
Legs: RealtimeSessionReviewLeg[];
|
|
127
|
+
/**
|
|
128
|
+
* ARTIFACTS attached to the chain's conversation history: every `MJ: Conversation
|
|
129
|
+
* Detail Artifacts` junction (Direction `Output`) hanging off the chain's
|
|
130
|
+
* session-stamped `Conversation Details`, resolved to `{ArtifactID, ArtifactVersionID,
|
|
131
|
+
* Name}`. Review mode registers each as an (unfocused) artifact tab on the surface
|
|
132
|
+
* panel, and they carry into a resumed live session. Empty when none / on any
|
|
133
|
+
* tolerated load failure.
|
|
134
|
+
*/
|
|
135
|
+
Artifacts: ParsedDelegationArtifact[];
|
|
136
|
+
}
|
|
137
|
+
/** Maximum number of chain legs the review loader walks (the reviewed session included). */
|
|
138
|
+
export declare const MAX_REVIEW_LEGS = 5;
|
|
139
|
+
/** Maximum total caption-detail rows loaded across the whole chain (oldest legs trimmed first). */
|
|
140
|
+
export declare const MAX_REVIEW_DETAILS = 500;
|
|
141
|
+
/** Maps one delegated-run preview to the done delegation-card VM the thread/rail render. */
|
|
142
|
+
export declare function BuildReviewDelegationCard(run: RealtimeSessionReviewRun, fallbackAgentName: string): RealtimeDelegationCardVM;
|
|
143
|
+
/**
|
|
144
|
+
* Builds the chronological thread (caption turns + done delegation cards, oldest first)
|
|
145
|
+
* for a reviewed session — the items `RealtimeSessionState.LoadHistoricalItems` takes.
|
|
146
|
+
*
|
|
147
|
+
* CHAIN-AWARE: when the review carries multiple {@link RealtimeSessionReview.Legs}, each
|
|
148
|
+
* leg's items render in leg order with a `divider` item between legs ("Session leg
|
|
149
|
+
* started · <time>", carrying the PREVIOUS leg's CloseReason as a chip). A single-leg
|
|
150
|
+
* review (or a legless legacy shape) renders the flat thread with no divider —
|
|
151
|
+
* byte-identical to the pre-chain behavior.
|
|
152
|
+
*/
|
|
153
|
+
export declare function BuildReviewThreadItems(review: RealtimeSessionReview): RealtimeThreadItem[];
|
|
154
|
+
/**
|
|
155
|
+
* STATELESS loader for the call overlay's SESSION REVIEW mode: given a past
|
|
156
|
+
* `MJ: AI Agent Sessions` id, batch-loads the session row, its persisted caption turns
|
|
157
|
+
* (`MJ: Conversation Details` linked by `AgentSessionID`), its delegated agent runs
|
|
158
|
+
* (minus the co-agent observability run named in the session Config's `coAgentRunID`),
|
|
159
|
+
* and its saved channel states — and folds them into one {@link RealtimeSessionReview}.
|
|
160
|
+
*
|
|
161
|
+
* CHAIN-AWARE: when the reviewed session carries a `LastSessionID` (it RESUMED an earlier
|
|
162
|
+
* session), the loader walks the chain BACKWARDS — capped at {@link MAX_REVIEW_LEGS} legs
|
|
163
|
+
* and {@link MAX_REVIEW_DETAILS} caption rows total (oldest legs trimmed first), with a
|
|
164
|
+
* cycle guard so a corrupt A→B→A chain can never loop — and surfaces ALL legs
|
|
165
|
+
* chronologically on {@link RealtimeSessionReview.Legs}. Channel state stays the
|
|
166
|
+
* reviewed (latest) leg's only. The chain's conversation-history ARTIFACTS (junction
|
|
167
|
+
* rows on the session-stamped details) are collected onto
|
|
168
|
+
* {@link RealtimeSessionReview.Artifacts}.
|
|
169
|
+
*
|
|
170
|
+
* TOLERANT by design: any missing piece degrades to an empty collection; the loader
|
|
171
|
+
* returns `null` only when the reviewed session row itself can't be found.
|
|
172
|
+
*/
|
|
173
|
+
export declare class RealtimeSessionReviewService {
|
|
174
|
+
/**
|
|
175
|
+
* Loads everything review mode renders for one past session (and its prior-leg chain).
|
|
176
|
+
*
|
|
177
|
+
* @param agentSessionId The `MJ: AI Agent Sessions.ID` to review.
|
|
178
|
+
* @param provider Optional metadata provider (multi-server apps); falls back to the global default.
|
|
179
|
+
* @returns The assembled review, or `null` when the session doesn't exist / can't be read.
|
|
180
|
+
*/
|
|
181
|
+
LoadSessionReview(agentSessionId: string, provider?: IMetadataProvider): Promise<RealtimeSessionReview | null>;
|
|
182
|
+
/**
|
|
183
|
+
* One batched RunViews pass for one chain leg: session row + caption turns + linked
|
|
184
|
+
* runs (+ channel rows for the PRIMARY leg only — channel state is latest-leg-only).
|
|
185
|
+
* Returns `null` when the session row can't be found.
|
|
186
|
+
*/
|
|
187
|
+
private loadLegRows;
|
|
188
|
+
/**
|
|
189
|
+
* Walks the `LastSessionID` chain BACKWARDS from the reviewed (primary) leg, collecting
|
|
190
|
+
* raw leg rows OLDEST-FIRST (primary last). Safety rails:
|
|
191
|
+
* - at most {@link MAX_REVIEW_LEGS} legs total;
|
|
192
|
+
* - at most {@link MAX_REVIEW_DETAILS} caption rows across the chain — an older leg
|
|
193
|
+
* whose details would overflow the budget is trimmed to its NEWEST rows and ends
|
|
194
|
+
* the walk;
|
|
195
|
+
* - a visited-set cycle guard (case-insensitive ids) so A→B→A can never loop;
|
|
196
|
+
* - a leg that fails to load simply ends the walk (the collected legs still render).
|
|
197
|
+
*/
|
|
198
|
+
private collectChainLegs;
|
|
199
|
+
/**
|
|
200
|
+
* Collects the chain's conversation-history ARTIFACTS: `MJ: Conversation Detail
|
|
201
|
+
* Artifacts` junction rows (Direction `Output`) hanging off the chain's session-stamped
|
|
202
|
+
* details, resolved through `MJ: Artifact Versions` to `{ArtifactID, ArtifactVersionID,
|
|
203
|
+
* Name}` (version name, falling back to the artifact name). Order follows junction
|
|
204
|
+
* creation; duplicate versions are deduped. TOLERANT: any failure returns `[]`.
|
|
205
|
+
*/
|
|
206
|
+
private loadChainArtifacts;
|
|
207
|
+
/** Unique, non-empty `ArtifactVersionID`s from junction rows, in arrival order (case-insensitive dedupe). */
|
|
208
|
+
private uniqueVersionIDs;
|
|
209
|
+
/** Case-insensitive UUID key for Set/Map membership (SQL Server uppercase vs PostgreSQL lowercase). */
|
|
210
|
+
private normalizeID;
|
|
211
|
+
/**
|
|
212
|
+
* Folds the chain's raw leg rows into the typed review. The PRIMARY (reviewed) leg —
|
|
213
|
+
* the chain's LAST entry — supplies identity/lifecycle/channel state; turns and runs
|
|
214
|
+
* are surfaced both per-leg (`Legs`) and flattened chronologically (`Turns` /
|
|
215
|
+
* `DelegatedRuns`). Each leg excludes ITS OWN config's co-agent observability run.
|
|
216
|
+
*/
|
|
217
|
+
private assembleReview;
|
|
218
|
+
/** Maps one leg's raw rows to the public leg shape (per-leg co-agent-run exclusion). */
|
|
219
|
+
private mapLeg;
|
|
220
|
+
/** Persisted detail rows → caption turns: visible `User`/`AI` rows with text (AI → Assistant). */
|
|
221
|
+
private mapTurns;
|
|
222
|
+
/** Linked run rows → delegated-run previews, EXCLUDING the co-agent's observability run. */
|
|
223
|
+
private mapRuns;
|
|
224
|
+
/** Session-channel rows → named channel states (rows without a channel name are skipped). */
|
|
225
|
+
private mapChannels;
|
|
226
|
+
/** Tolerant Config JSON parse — malformed/missing payloads degrade to `{}`. */
|
|
227
|
+
private parseSessionConfig;
|
|
228
|
+
/** Tolerant date conversion — view rows arrive as ISO strings (or Dates from some providers). */
|
|
229
|
+
private toDate;
|
|
230
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RealtimeSessionReviewService, never>;
|
|
231
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RealtimeSessionReviewService>;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=realtime-session-review.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-session-review.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-session-review.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM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