@memberjunction/ng-conversations 6.2.0-edge.3 → 6.2.0-edge.5
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 +33 -7
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +1 -0
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +14 -2
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.js +35 -4
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.js +3 -3
- package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +651 -53
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +3002 -661
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/forks-popover.component.d.ts +37 -0
- package/dist/lib/components/conversation/forks-popover.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/forks-popover.component.js +164 -0
- package/dist/lib/components/conversation/forks-popover.component.js.map +1 -0
- package/dist/lib/components/export/export-modal.component.d.ts +7 -2
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +16 -3
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +11 -9
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +96 -11
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +253 -112
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +304 -16
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +2029 -363
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +101 -22
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +326 -55
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/realtime/avatar/realtime-avatar-channel.d.ts +34 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-channel.js +75 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-channel.js.map +1 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.d.ts +80 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.js +202 -0
- package/dist/lib/components/realtime/avatar/realtime-avatar-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.d.ts +45 -0
- package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.js +123 -0
- package/dist/lib/components/realtime/capture/realtime-camera-check-card.component.js.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-channel.d.ts +90 -0
- package/dist/lib/components/realtime/capture/realtime-capture-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-channel.js +223 -0
- package/dist/lib/components/realtime/capture/realtime-capture-channel.js.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-model.d.ts +98 -0
- package/dist/lib/components/realtime/capture/realtime-capture-model.d.ts.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-model.js +161 -0
- package/dist/lib/components/realtime/capture/realtime-capture-model.js.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-surface.component.d.ts +48 -0
- package/dist/lib/components/realtime/capture/realtime-capture-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/capture/realtime-capture-surface.component.js +205 -0
- package/dist/lib/components/realtime/capture/realtime-capture-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +19 -2
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +83 -9
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +30 -9
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +78 -14
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
- package/dist/lib/components/realtime/identity-verification/identity-verification-channel.d.ts +71 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-channel.js +259 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-channel.js.map +1 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-model.d.ts +129 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-model.d.ts.map +1 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-model.js +373 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-model.js.map +1 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.d.ts +77 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.js +420 -0
- package/dist/lib/components/realtime/identity-verification/identity-verification-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-contract.d.ts +83 -0
- package/dist/lib/components/realtime/interactive-component/component-contract.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-contract.js +292 -0
- package/dist/lib/components/realtime/interactive-component/component-contract.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-data-state.d.ts +39 -0
- package/dist/lib/components/realtime/interactive-component/component-data-state.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-data-state.js +152 -0
- package/dist/lib/components/realtime/interactive-component/component-data-state.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-instance-engine.d.ts +109 -0
- package/dist/lib/components/realtime/interactive-component/component-instance-engine.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-instance-engine.js +146 -0
- package/dist/lib/components/realtime/interactive-component/component-instance-engine.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-spec-content.d.ts +19 -0
- package/dist/lib/components/realtime/interactive-component/component-spec-content.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/component-spec-content.js +39 -0
- package/dist/lib/components/realtime/interactive-component/component-spec-content.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts +183 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js +761 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-config.d.ts +25 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-config.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-config.js +57 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-config.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.d.ts +40 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.js +97 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-host.component.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-types.d.ts +144 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-types.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-types.js +57 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-types.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/react-component-handle.d.ts +36 -0
- package/dist/lib/components/realtime/interactive-component/react-component-handle.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/react-component-handle.js +55 -0
- package/dist/lib/components/realtime/interactive-component/react-component-handle.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.d.ts +55 -0
- package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.js +210 -0
- package/dist/lib/components/realtime/interactive-component/realtime-interactive-component-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.d.ts +32 -0
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.d.ts.map +1 -0
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js +90 -0
- package/dist/lib/components/realtime/interactive-component/run-view-component-artifact-source.js.map +1 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts +7 -0
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.js +28 -1
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +8 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +89 -71
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-orb.component.d.ts +21 -0
- package/dist/lib/components/realtime/realtime-agent-orb.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-orb.component.js +49 -0
- package/dist/lib/components/realtime/realtime-agent-orb.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts +44 -11
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +162 -50
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts +8 -2
- package/dist/lib/components/realtime/realtime-audio-visuals.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-audio-visuals.js +14 -18
- package/dist/lib/components/realtime/realtime-audio-visuals.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +42 -2
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +137 -102
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-perception-chip.component.d.ts +71 -0
- package/dist/lib/components/realtime/realtime-perception-chip.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-perception-chip.component.js +221 -0
- package/dist/lib/components/realtime/realtime-perception-chip.component.js.map +1 -0
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +264 -22
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +851 -135
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-placement-prefs.d.ts +14 -0
- package/dist/lib/components/realtime/realtime-surface-placement-prefs.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-placement-prefs.js +14 -0
- package/dist/lib/components/realtime/realtime-surface-placement-prefs.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts +74 -0
- package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-stage.model.js +171 -0
- package/dist/lib/components/realtime/realtime-surface-stage.model.js.map +1 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +71 -13
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +232 -73
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +5 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +8 -0
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +12 -2
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.js +5 -1
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +10 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +42 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +20 -3
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +44 -10
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +28 -44
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +76 -162
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- 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 +25 -12
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +152 -31
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +2227 -214
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +4 -4
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +33 -32
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +72 -88
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +30 -29
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +27 -5
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +25 -0
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +36 -0
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +5 -0
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
- package/dist/lib/models/agent-turn.model.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts +34 -8
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +90 -37
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts +0 -9
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +1 -32
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/browser-realtime-media-host.d.ts +19 -7
- package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -1
- package/dist/lib/services/browser-realtime-media-host.js +21 -72
- package/dist/lib/services/browser-realtime-media-host.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +48 -16
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +110 -35
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.d.ts +22 -4
- package/dist/lib/services/conversation-detail-window.store.d.ts.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.js +50 -9
- package/dist/lib/services/conversation-detail-window.store.js.map +1 -1
- package/dist/lib/services/conversation-naming.d.ts +72 -22
- package/dist/lib/services/conversation-naming.d.ts.map +1 -1
- package/dist/lib/services/conversation-naming.js +93 -12
- package/dist/lib/services/conversation-naming.js.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.d.ts +15 -0
- package/dist/lib/services/conversation-tasks-filter.d.ts.map +1 -0
- package/dist/lib/services/conversation-tasks-filter.js +69 -0
- package/dist/lib/services/conversation-tasks-filter.js.map +1 -0
- package/dist/lib/services/data-cache.service.d.ts +13 -5
- package/dist/lib/services/data-cache.service.d.ts.map +1 -1
- package/dist/lib/services/data-cache.service.js +39 -19
- package/dist/lib/services/data-cache.service.js.map +1 -1
- package/dist/lib/services/export.service.d.ts +26 -9
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +61 -18
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +115 -79
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.js +273 -186
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pairing.d.ts +10 -5
- package/dist/lib/services/realtime-pairing.d.ts.map +1 -1
- package/dist/lib/services/realtime-pairing.js +15 -6
- package/dist/lib/services/realtime-pairing.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +31 -2
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +34 -2
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/recording/libopus-wasm-binary.d.ts +3 -0
- package/dist/lib/services/recording/libopus-wasm-binary.d.ts.map +1 -0
- package/dist/lib/services/recording/libopus-wasm-binary.js +489 -0
- package/dist/lib/services/recording/libopus-wasm-binary.js.map +1 -0
- package/dist/lib/services/recording/libopus-worker-source.d.ts +48 -0
- package/dist/lib/services/recording/libopus-worker-source.d.ts.map +1 -0
- package/dist/lib/services/recording/libopus-worker-source.js +170 -0
- package/dist/lib/services/recording/libopus-worker-source.js.map +1 -0
- package/dist/lib/services/recording/linear-resampler.d.ts +45 -0
- package/dist/lib/services/recording/linear-resampler.d.ts.map +1 -0
- package/dist/lib/services/recording/linear-resampler.js +85 -0
- package/dist/lib/services/recording/linear-resampler.js.map +1 -0
- package/dist/lib/services/recording/opus-packet-encoder.d.ts +50 -0
- package/dist/lib/services/recording/opus-packet-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/opus-packet-encoder.js +41 -0
- package/dist/lib/services/recording/opus-packet-encoder.js.map +1 -0
- package/dist/lib/services/recording/wasm-opus-encoder.d.ts +86 -0
- package/dist/lib/services/recording/wasm-opus-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/wasm-opus-encoder.js +232 -0
- package/dist/lib/services/recording/wasm-opus-encoder.js.map +1 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.d.ts +39 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.js +101 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.js.map +1 -0
- package/dist/lib/services/search.service.d.ts +7 -2
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +16 -20
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/utils/conversation-branching.d.ts +4 -0
- package/dist/lib/utils/conversation-branching.d.ts.map +1 -0
- package/dist/lib/utils/conversation-branching.js +5 -0
- package/dist/lib/utils/conversation-branching.js.map +1 -0
- package/dist/lib/utils/conversation-forks.d.ts +315 -0
- package/dist/lib/utils/conversation-forks.d.ts.map +1 -0
- package/dist/lib/utils/conversation-forks.js +456 -0
- package/dist/lib/utils/conversation-forks.js.map +1 -0
- package/dist/lib/utils/distinct-artifacts.d.ts +9 -3
- package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/distinct-artifacts.js +24 -5
- package/dist/lib/utils/distinct-artifacts.js.map +1 -1
- package/dist/public-api.d.ts +23 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +30 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +37 -33
- package/dist/lib/components/thread/thread-panel.component.d.ts +0 -126
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +0 -1
- package/dist/lib/components/thread/thread-panel.component.js +0 -440
- package/dist/lib/components/thread/thread-panel.component.js.map +0 -1
- package/dist/lib/services/realtime-pcm-wav.d.ts +0 -79
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +0 -1
- package/dist/lib/services/realtime-pcm-wav.js +0 -213
- package/dist/lib/services/realtime-pcm-wav.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/artifact-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,aAAa,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA+B,MAAM,sBAAsB,CAAC;;;AAGtF;;;GAGG;AAIH,MAAM,OAAO,oBAAoB;IAiDX;IAhDZ,kBAAkB,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;IAC9D,qBAAqB,GAAG,IAAI,eAA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AAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, combineLatest } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, UserInfo, IMetadataProvider } from '@memberjunction/core';\nimport { ArtifactPermissionService } from './artifact-permission.service';\n\n/**\n * State management for artifacts and the artifact panel\n * Handles artifact CRUD operations and caching with permission enforcement\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ArtifactStateService {\n private _activeArtifactId$ = new BehaviorSubject<string | null>(null);\n private _activeVersionNumber$ = new BehaviorSubject<number | null>(null);\n private _artifacts$ = new BehaviorSubject<Map<string, MJArtifactEntity>>(new Map());\n private _isPanelOpen$ = new BehaviorSubject<boolean>(false);\n private _panelMode$ = new BehaviorSubject<'view' | 'edit'>('view');\n\n // Public observable streams\n public readonly ActiveArtifactId$ = this._activeArtifactId$.asObservable();\n\n /** @deprecated Use {@link ActiveArtifactId$}. */\n public get activeArtifactId$() {\n return this.ActiveArtifactId$;\n }\n public readonly ActiveVersionNumber$ = this._activeVersionNumber$.asObservable();\n\n /** @deprecated Use {@link ActiveVersionNumber$}. */\n public get activeVersionNumber$() {\n return this.ActiveVersionNumber$;\n }\n public readonly IsPanelOpen$ = this._isPanelOpen$.asObservable();\n\n /** @deprecated Use {@link IsPanelOpen$}. */\n public get isPanelOpen$() {\n return this.IsPanelOpen$;\n }\n public readonly PanelMode$ = this._panelMode$.asObservable();\n\n /** @deprecated Use {@link PanelMode$}. */\n public get panelMode$() {\n return this.PanelMode$;\n }\n\n // Derived observable for active artifact\n public readonly ActiveArtifact$: Observable<MJArtifactEntity | null> = combineLatest([\n this.ActiveArtifactId$,\n this._artifacts$\n ]).pipe(\n map(([id, artifacts]) => id ? artifacts.get(id) || null : null),\n shareReplay(1)\n );\n\n /** @deprecated Use {@link ActiveArtifact$}. */\n public get activeArtifact$(): Observable<MJArtifactEntity | null> {\n return this.ActiveArtifact$;\n }\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(private artifactPermissionService: ArtifactPermissionService) {}\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it propagates to the dependent artifact-permission service.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n if (value !== null) {\n this.artifactPermissionService.Provider = value;\n }\n }\n\n /**\n * Check if current user can read an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has read permission\n */\n async CanReadArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'read', currentUser);\n }\n\n /** @deprecated Use {@link CanReadArtifact}. */\n async canReadArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanReadArtifact(artifactId, currentUser);\n }\n\n /**\n * Check if current user can edit an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has edit permission\n */\n async CanEditArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n }\n\n /** @deprecated Use {@link CanEditArtifact}. */\n async canEditArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanEditArtifact(artifactId, currentUser);\n }\n\n /**\n * Check if current user can share an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has share permission\n */\n async CanShareArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'share', currentUser);\n }\n\n /** @deprecated Use {@link CanShareArtifact}. */\n async canShareArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanShareArtifact(artifactId, currentUser);\n }\n\n /**\n * Opens an artifact in the panel\n * @param id The artifact ID\n * @param versionNumber Optional specific version number\n */\n OpenArtifact(id: string, versionNumber?: number): void {\n this._activeArtifactId$.next(id);\n this._activeVersionNumber$.next(versionNumber || null);\n this._isPanelOpen$.next(true);\n }\n\n /** @deprecated Use {@link OpenArtifact}. */\n openArtifact(id: string, versionNumber?: number): void {\n return this.OpenArtifact(id, versionNumber);\n }\n\n /**\n * Opens an artifact by version ID\n * @param versionId The artifact version ID\n */\n async OpenArtifactByVersionId(versionId: string): Promise<void> {\n try {\n const md = this.Provider;\n const version = await md.GetEntityObject<MJArtifactVersionEntity>('MJ: Artifact Versions');\n const loaded = await version.Load(versionId);\n\n if (loaded) {\n // Open the artifact with the specific version number\n this.OpenArtifact(version.ArtifactID, version.VersionNumber);\n } else {\n console.error('Failed to load artifact version:', versionId);\n }\n } catch (error) {\n console.error('Error loading artifact version:', error);\n }\n }\n\n /** @deprecated Use {@link OpenArtifactByVersionId}. */\n async openArtifactByVersionId(versionId: string): Promise<void> {\n return this.OpenArtifactByVersionId(versionId);\n }\n\n /**\n * Closes the artifact panel\n */\n CloseArtifact(): void {\n this._activeArtifactId$.next(null);\n this._activeVersionNumber$.next(null);\n this._isPanelOpen$.next(false);\n this._panelMode$.next('view');\n }\n\n /** @deprecated Use {@link CloseArtifact}. */\n closeArtifact(): void {\n return this.CloseArtifact();\n }\n\n /**\n * Toggles the panel open/closed state\n */\n TogglePanel(): void {\n this._isPanelOpen$.next(!this._isPanelOpen$.value);\n }\n\n /** @deprecated Use {@link TogglePanel}. */\n togglePanel(): void {\n return this.TogglePanel();\n }\n\n /**\n * Sets the panel mode\n * @param mode The mode ('view' or 'edit')\n */\n SetPanelMode(mode: 'view' | 'edit'): void {\n this._panelMode$.next(mode);\n }\n\n /** @deprecated Use {@link SetPanelMode}. */\n setPanelMode(mode: 'view' | 'edit'): void {\n return this.SetPanelMode(mode);\n }\n\n /**\n * Caches an artifact in memory\n * @param artifact The artifact to cache\n */\n CacheArtifact(artifact: MJArtifactEntity): void {\n const current = this._artifacts$.value;\n current.set(artifact.ID, artifact);\n this._artifacts$.next(new Map(current));\n }\n\n /** @deprecated Use {@link CacheArtifact}. */\n cacheArtifact(artifact: MJArtifactEntity): void {\n return this.CacheArtifact(artifact);\n }\n\n /**\n * Removes an artifact from cache\n * @param id The artifact ID\n */\n RemoveCachedArtifact(id: string): void {\n const current = this._artifacts$.value;\n current.delete(id);\n this._artifacts$.next(new Map(current));\n }\n\n /** @deprecated Use {@link RemoveCachedArtifact}. */\n removeCachedArtifact(id: string): void {\n return this.RemoveCachedArtifact(id);\n }\n\n /**\n * Clears all cached artifacts\n */\n ClearCache(): void {\n this._artifacts$.next(new Map());\n }\n\n /** @deprecated Use {@link ClearCache}. */\n clearCache(): void {\n return this.ClearCache();\n }\n\n /**\n * Loads artifacts for a conversation\n * @param conversationId The conversation ID\n * @param currentUser The current user context\n * @returns Array of artifacts\n */\n async LoadArtifactsForConversation(conversationId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJArtifactEntity>(\n {\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ConversationID='${conversationId}'`,\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: 1000,\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (result.Success && result.Results) {\n // Cache all artifacts\n result.Results.forEach(artifact => this.CacheArtifact(artifact));\n return result.Results;\n }\n return [];\n } catch (error) {\n console.error('Error loading artifacts:', error);\n return [];\n }\n }\n\n /** @deprecated Use {@link LoadArtifactsForConversation}. */\n async loadArtifactsForConversation(conversationId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n return this.LoadArtifactsForConversation(conversationId, currentUser);\n }\n\n /**\n * Loads artifacts for a collection\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @returns Array of artifacts\n */\n async LoadArtifactsForCollection(collectionId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n // Load artifacts through the collection join - use subquery to get artifact IDs from versions\n const artifactsResult = await rv.RunView<MJArtifactEntity>(\n {\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (\n SELECT DISTINCT av.ArtifactID\n FROM [__mj].[vwArtifactVersions] av\n INNER JOIN [__mj].[vwCollectionArtifacts] ca ON ca.ArtifactVersionID = av.ID\n WHERE ca.CollectionID = '${collectionId}'\n )`,\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (artifactsResult.Success && artifactsResult.Results) {\n artifactsResult.Results.forEach(artifact => this.CacheArtifact(artifact));\n return artifactsResult.Results;\n }\n return [];\n } catch (error) {\n console.error('Error loading collection artifacts:', error);\n return [];\n }\n }\n\n /** @deprecated Use {@link LoadArtifactsForCollection}. */\n async loadArtifactsForCollection(collectionId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n return this.LoadArtifactsForCollection(collectionId, currentUser);\n }\n\n /**\n * Loads artifact VERSIONS for a collection (all versions, not deduplicated by artifact ID)\n * This method returns each version as a separate item with its parent artifact metadata\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @returns Array of objects containing version and parent artifact info\n */\n async LoadArtifactVersionsForCollection(\n collectionId: string,\n currentUser: UserInfo,\n bypassCache: boolean = false\n ): Promise<Array<{ version: MJArtifactVersionEntity; artifact: MJArtifactEntity }>> {\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n\n // Resolve membership from the join entity directly rather than via a subquery\n // embedded in an Artifact Versions filter. The server RunView cache is invalidated\n // per-entity: removing a Collection Artifacts link does NOT invalidate a cached\n // 'MJ: Artifact Versions' query whose subquery happens to reference the link table,\n // so the removed artifact would keep appearing. Querying the join entity directly\n // means this read is invalidated whenever a link is added or removed.\n //\n // `bypassCache` is passed right after a move: the link delete's cache invalidation\n // is asynchronous relative to Delete() resolving, so an immediate cached read can\n // still return the old membership. Bypassing reads the committed DB state directly.\n const linkResult = await rv.RunView<{ ArtifactVersionID: string }>({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${collectionId}'`,\n Fields: ['ArtifactVersionID'],\n ResultType: 'simple',\n BypassCache: bypassCache\n }, currentUser);\n\n if (!linkResult.Success) {\n return [];\n }\n\n const versionIds = [...new Set(\n (linkResult.Results ?? [])\n .map(r => r.ArtifactVersionID)\n .filter((id): id is string => !!id)\n )];\n\n if (versionIds.length === 0) {\n return [];\n }\n\n // Load the specific versions that are members of this collection.\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds.map(id => `'${id}'`).join(',')})`,\n OrderBy: '__mj_UpdatedAt DESC',\n ResultType: 'entity_object'\n }, currentUser);\n\n if (!versionResult.Success || !versionResult.Results) {\n return [];\n }\n\n // Load parent artifacts for display metadata\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n const artifactMap = new Map<string, MJArtifactEntity>();\n\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => {\n artifactMap.set(a.ID, a);\n this.CacheArtifact(a); // Cache parent artifacts\n });\n }\n }\n\n // Combine version + artifact\n return versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null);\n } catch (error) {\n console.error('Error loading collection artifact versions:', error);\n return [];\n }\n }\n\n /** @deprecated Use {@link LoadArtifactVersionsForCollection}. */\n async loadArtifactVersionsForCollection(\n collectionId: string,\n currentUser: UserInfo,\n bypassCache: boolean = false\n ): Promise<Array<{ version: MJArtifactVersionEntity; artifact: MJArtifactEntity }>> {\n return this.LoadArtifactVersionsForCollection(collectionId, currentUser, bypassCache);\n }\n\n /**\n * Loads a single artifact by ID\n * @param id The artifact ID\n * @param currentUser The current user context\n * @returns The artifact entity or null\n */\n async LoadArtifact(id: string, currentUser: UserInfo): Promise<MJArtifactEntity | null> {\n try {\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n const loaded = await artifact.Load(id);\n\n if (loaded) {\n this.CacheArtifact(artifact);\n return artifact;\n }\n return null;\n } catch (error) {\n console.error('Error loading artifact:', error);\n return null;\n }\n }\n\n /** @deprecated Use {@link LoadArtifact}. */\n async loadArtifact(id: string, currentUser: UserInfo): Promise<MJArtifactEntity | null> {\n return this.LoadArtifact(id, currentUser);\n }\n\n /**\n * Creates a new artifact\n * @param data Artifact data\n * @param currentUser The current user context\n * @returns The created artifact\n */\n async CreateArtifact(data: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<MJArtifactEntity> {\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n Object.assign(artifact, data);\n\n const saved = await artifact.Save();\n if (saved) {\n this.CacheArtifact(artifact);\n return artifact;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to create artifact');\n }\n }\n\n /** @deprecated Use {@link CreateArtifact}. */\n async createArtifact(data: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<MJArtifactEntity> {\n return this.CreateArtifact(data, currentUser);\n }\n\n /**\n * Updates an artifact\n * @param id The artifact ID\n * @param updates The fields to update\n * @param currentUser The current user context\n * @returns True if successful\n */\n async UpdateArtifact(id: string, updates: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<boolean> {\n // Check edit permission\n const canEdit = await this.artifactPermissionService.checkPermission(id, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to edit this artifact');\n }\n\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n const loaded = await artifact.Load(id);\n if (!loaded) {\n throw new Error('Artifact not found');\n }\n\n Object.assign(artifact, updates);\n\n const saved = await artifact.Save();\n if (saved) {\n this.CacheArtifact(artifact);\n return true;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to update artifact');\n }\n }\n\n /** @deprecated Use {@link UpdateArtifact}. */\n async updateArtifact(id: string, updates: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<boolean> {\n return this.UpdateArtifact(id, updates, currentUser);\n }\n\n /**\n * Deletes an artifact\n * @param id The artifact ID\n * @param currentUser The current user context\n * @returns True if successful\n */\n async DeleteArtifact(id: string, currentUser: UserInfo): Promise<boolean> {\n // Check edit permission (required for deletion)\n const canEdit = await this.artifactPermissionService.checkPermission(id, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to delete this artifact');\n }\n\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n const loaded = await artifact.Load(id);\n if (!loaded) {\n throw new Error('Artifact not found');\n }\n\n const deleted = await artifact.Delete();\n if (deleted) {\n this.RemoveCachedArtifact(id);\n if (this._activeArtifactId$.value === id) {\n this.CloseArtifact();\n }\n return true;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to delete artifact');\n }\n }\n\n /** @deprecated Use {@link DeleteArtifact}. */\n async deleteArtifact(id: string, currentUser: UserInfo): Promise<boolean> {\n return this.DeleteArtifact(id, currentUser);\n }\n\n /**\n * Adds an artifact version to a collection\n * @param artifactId The artifact ID (for permission checking)\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @param versionId Optional specific version ID. If not provided, uses latest version\n */\n async AddToCollection(artifactId: string, collectionId: string, currentUser: UserInfo, versionId?: string): Promise<void> {\n // Check edit permission (required to modify collection membership)\n const canEdit = await this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to add this artifact to a collection');\n }\n\n // Get version ID if not provided\n let targetVersionId = versionId;\n if (!targetVersionId) {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const versionResult = await rv.RunView<any>(\n {\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifactId}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n throw new Error('No versions found for artifact');\n }\n\n targetVersionId = versionResult.Results[0].ID;\n }\n\n const md = this.Provider;\n const collectionArtifact = await md.GetEntityObject('MJ: Collection Artifacts', currentUser);\n\n (collectionArtifact as any).CollectionID = collectionId;\n (collectionArtifact as any).ArtifactVersionID = targetVersionId;\n\n const saved = await collectionArtifact.Save();\n if (!saved) {\n throw new Error('Failed to add artifact to collection');\n }\n }\n\n /** @deprecated Use {@link AddToCollection}. */\n async addToCollection(artifactId: string, collectionId: string, currentUser: UserInfo, versionId?: string): Promise<void> {\n return this.AddToCollection(artifactId, collectionId, currentUser, versionId);\n }\n\n /**\n * Removes all versions of an artifact from a collection\n * @param artifactId The artifact ID\n * @param collectionId The collection ID\n * @param currentUser The current user context\n */\n async RemoveFromCollection(artifactId: string, collectionId: string, currentUser: UserInfo): Promise<void> {\n // Check edit permission (required to modify collection membership)\n const canEdit = await this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to remove this artifact from a collection');\n }\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n // Find all versions of this artifact in the collection\n const result = await rv.RunView<any>(\n {\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${collectionId}' AND ArtifactVersionID IN (\n SELECT ID FROM [__mj].[vwArtifactVersions] WHERE ArtifactID='${artifactId}'\n )`,\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (!result.Success) {\n throw new Error(result.ErrorMessage || 'Failed to find collection artifact');\n }\n\n if (!result.Results || result.Results.length === 0) {\n throw new Error('Collection artifact link not found');\n }\n\n // Delete all version associations\n for (const collectionArtifact of result.Results) {\n const deleted = await collectionArtifact.Delete();\n if (!deleted) {\n const errorMsg = collectionArtifact.LatestResult?.Message || 'Failed to remove artifact from collection';\n throw new Error(errorMsg);\n }\n }\n }\n\n /** @deprecated Use {@link RemoveFromCollection}. */\n async removeFromCollection(artifactId: string, collectionId: string, currentUser: UserInfo): Promise<void> {\n return this.RemoveFromCollection(artifactId, collectionId, currentUser);\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"artifact-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/artifact-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,aAAa,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA+B,MAAM,sBAAsB,CAAC;;;AAGtF;;;GAGG;AAIH,MAAM,OAAO,oBAAoB;IAiDX;IAhDZ,kBAAkB,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;IAC9D,qBAAqB,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;IACjE,WAAW,GAAG,IAAI,eAAe,CAAgC,IAAI,GAAG,EAAE,CAAC,CAAC;IAC5E,aAAa,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;IACpD,WAAW,GAAG,IAAI,eAAe,CAAkB,MAAM,CAAC,CAAC;IAEnE,4BAA4B;IACZ,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAE3E,iDAAiD;IACjD,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACe,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC;IAEjF,oDAAoD;IACpD,IAA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EAAE,CAAC,OAAO,CAC7B;YACE,UAAU,EAAE,0BAA0B;YACtC,WAAW,EAAE,iBAAiB,YAAY;yEACuB,UAAU;UACzE;YACF,UAAU,EAAE,eAAe;SAC5B,EACD,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,YAAY,IAAI,oCAAoC,CAAC,CAAC;QAC/E,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,kCAAkC;QAClC,KAAK,MAAM,kBAAkB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC;YAClD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,QAAQ,GAAG,kBAAkB,CAAC,YAAY,EAAE,OAAO,IAAI,2CAA2C,CAAC;gBACzG,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,KAAK,CAAC,oBAAoB,CAAC,UAAkB,EAAE,YAAoB,EAAE,WAAqB;QACxF,OAAO,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC1E,CAAC;8GA/lBU,oBAAoB;gEAApB,oBAAoB,WAApB,oBAAoB,mBAFnB,MAAM;;iFAEP,oBAAoB;cAHhC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, combineLatest } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, UserInfo, IMetadataProvider } from '@memberjunction/core';\nimport { ArtifactPermissionService } from './artifact-permission.service';\n\n/**\n * State management for artifacts and the artifact panel\n * Handles artifact CRUD operations and caching with permission enforcement\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ArtifactStateService {\n private _activeArtifactId$ = new BehaviorSubject<string | null>(null);\n private _activeVersionNumber$ = new BehaviorSubject<number | null>(null);\n private _artifacts$ = new BehaviorSubject<Map<string, MJArtifactEntity>>(new Map());\n private _isPanelOpen$ = new BehaviorSubject<boolean>(false);\n private _panelMode$ = new BehaviorSubject<'view' | 'edit'>('view');\n\n // Public observable streams\n public readonly ActiveArtifactId$ = this._activeArtifactId$.asObservable();\n\n /** @deprecated Use {@link ActiveArtifactId$}. */\n public get activeArtifactId$() {\n return this.ActiveArtifactId$;\n }\n public readonly ActiveVersionNumber$ = this._activeVersionNumber$.asObservable();\n\n /** @deprecated Use {@link ActiveVersionNumber$}. */\n public get activeVersionNumber$() {\n return this.ActiveVersionNumber$;\n }\n public readonly IsPanelOpen$ = this._isPanelOpen$.asObservable();\n\n /** @deprecated Use {@link IsPanelOpen$}. */\n public get isPanelOpen$() {\n return this.IsPanelOpen$;\n }\n public readonly PanelMode$ = this._panelMode$.asObservable();\n\n /** @deprecated Use {@link PanelMode$}. */\n public get panelMode$() {\n return this.PanelMode$;\n }\n\n // Derived observable for active artifact\n public readonly ActiveArtifact$: Observable<MJArtifactEntity | null> = combineLatest([\n this.ActiveArtifactId$,\n this._artifacts$\n ]).pipe(\n map(([id, artifacts]) => id ? artifacts.get(id) || null : null),\n shareReplay(1)\n );\n\n /** @deprecated Use {@link ActiveArtifact$}. */\n public get activeArtifact$(): Observable<MJArtifactEntity | null> {\n return this.ActiveArtifact$;\n }\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(private artifactPermissionService: ArtifactPermissionService) {}\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it propagates to the dependent artifact-permission service.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n if (value !== null) {\n this.artifactPermissionService.Provider = value;\n }\n }\n\n /**\n * Check if current user can read an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has read permission\n */\n async CanReadArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'read', currentUser);\n }\n\n /** @deprecated Use {@link CanReadArtifact}. */\n async canReadArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanReadArtifact(artifactId, currentUser);\n }\n\n /**\n * Check if current user can edit an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has edit permission\n */\n async CanEditArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n }\n\n /** @deprecated Use {@link CanEditArtifact}. */\n async canEditArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanEditArtifact(artifactId, currentUser);\n }\n\n /**\n * Check if current user can share an artifact\n * @param artifactId The artifact ID\n * @param currentUser The current user context\n * @returns True if user has share permission\n */\n async CanShareArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'share', currentUser);\n }\n\n /** @deprecated Use {@link CanShareArtifact}. */\n async canShareArtifact(artifactId: string, currentUser: UserInfo): Promise<boolean> {\n return this.CanShareArtifact(artifactId, currentUser);\n }\n\n /**\n * Opens an artifact in the panel\n * @param id The artifact ID\n * @param versionNumber Optional specific version number\n */\n OpenArtifact(id: string, versionNumber?: number): void {\n this._activeArtifactId$.next(id);\n this._activeVersionNumber$.next(versionNumber || null);\n this._isPanelOpen$.next(true);\n }\n\n /** @deprecated Use {@link OpenArtifact}. */\n openArtifact(id: string, versionNumber?: number): void {\n return this.OpenArtifact(id, versionNumber);\n }\n\n /**\n * Opens an artifact by version ID\n * @param versionId The artifact version ID\n */\n async OpenArtifactByVersionId(versionId: string): Promise<void> {\n try {\n const md = this.Provider;\n const version = await md.GetEntityObject<MJArtifactVersionEntity>('MJ: Artifact Versions');\n const loaded = await version.Load(versionId);\n\n if (loaded) {\n // Open the artifact with the specific version number\n this.OpenArtifact(version.ArtifactID, version.VersionNumber);\n } else {\n console.error('Failed to load artifact version:', versionId);\n }\n } catch (error) {\n console.error('Error loading artifact version:', error);\n }\n }\n\n /** @deprecated Use {@link OpenArtifactByVersionId}. */\n async openArtifactByVersionId(versionId: string): Promise<void> {\n return this.OpenArtifactByVersionId(versionId);\n }\n\n /**\n * Closes the artifact panel\n */\n CloseArtifact(): void {\n this._activeArtifactId$.next(null);\n this._activeVersionNumber$.next(null);\n this._isPanelOpen$.next(false);\n this._panelMode$.next('view');\n }\n\n /** @deprecated Use {@link CloseArtifact}. */\n closeArtifact(): void {\n return this.CloseArtifact();\n }\n\n /**\n * Toggles the panel open/closed state\n */\n TogglePanel(): void {\n this._isPanelOpen$.next(!this._isPanelOpen$.value);\n }\n\n /** @deprecated Use {@link TogglePanel}. */\n togglePanel(): void {\n return this.TogglePanel();\n }\n\n /**\n * Sets the panel mode\n * @param mode The mode ('view' or 'edit')\n */\n SetPanelMode(mode: 'view' | 'edit'): void {\n this._panelMode$.next(mode);\n }\n\n /** @deprecated Use {@link SetPanelMode}. */\n setPanelMode(mode: 'view' | 'edit'): void {\n return this.SetPanelMode(mode);\n }\n\n /**\n * Caches an artifact in memory\n * @param artifact The artifact to cache\n */\n CacheArtifact(artifact: MJArtifactEntity): void {\n const current = this._artifacts$.value;\n current.set(artifact.ID, artifact);\n this._artifacts$.next(new Map(current));\n }\n\n /** @deprecated Use {@link CacheArtifact}. */\n cacheArtifact(artifact: MJArtifactEntity): void {\n return this.CacheArtifact(artifact);\n }\n\n /**\n * Removes an artifact from cache\n * @param id The artifact ID\n */\n RemoveCachedArtifact(id: string): void {\n const current = this._artifacts$.value;\n current.delete(id);\n this._artifacts$.next(new Map(current));\n }\n\n /** @deprecated Use {@link RemoveCachedArtifact}. */\n removeCachedArtifact(id: string): void {\n return this.RemoveCachedArtifact(id);\n }\n\n /**\n * Clears all cached artifacts\n */\n ClearCache(): void {\n this._artifacts$.next(new Map());\n }\n\n /** @deprecated Use {@link ClearCache}. */\n clearCache(): void {\n return this.ClearCache();\n }\n\n /**\n * Loads artifacts for a collection\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @returns Array of artifacts\n */\n async LoadArtifactsForCollection(collectionId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n // Load artifacts through the collection join - use subquery to get artifact IDs from versions\n const artifactsResult = await rv.RunView<MJArtifactEntity>(\n {\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (\n SELECT DISTINCT av.ArtifactID\n FROM [__mj].[vwArtifactVersions] av\n INNER JOIN [__mj].[vwCollectionArtifacts] ca ON ca.ArtifactVersionID = av.ID\n WHERE ca.CollectionID = '${collectionId}'\n )`,\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (artifactsResult.Success && artifactsResult.Results) {\n artifactsResult.Results.forEach(artifact => this.CacheArtifact(artifact));\n return artifactsResult.Results;\n }\n return [];\n } catch (error) {\n console.error('Error loading collection artifacts:', error);\n return [];\n }\n }\n\n /** @deprecated Use {@link LoadArtifactsForCollection}. */\n async loadArtifactsForCollection(collectionId: string, currentUser: UserInfo): Promise<MJArtifactEntity[]> {\n return this.LoadArtifactsForCollection(collectionId, currentUser);\n }\n\n /**\n * Loads artifact VERSIONS for a collection (all versions, not deduplicated by artifact ID)\n * This method returns each version as a separate item with its parent artifact metadata\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @returns Array of objects containing version and parent artifact info\n */\n async LoadArtifactVersionsForCollection(\n collectionId: string,\n currentUser: UserInfo,\n bypassCache: boolean = false\n ): Promise<Array<{ version: MJArtifactVersionEntity; artifact: MJArtifactEntity }>> {\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n\n // Resolve membership from the join entity directly rather than via a subquery\n // embedded in an Artifact Versions filter. The server RunView cache is invalidated\n // per-entity: removing a Collection Artifacts link does NOT invalidate a cached\n // 'MJ: Artifact Versions' query whose subquery happens to reference the link table,\n // so the removed artifact would keep appearing. Querying the join entity directly\n // means this read is invalidated whenever a link is added or removed.\n //\n // `bypassCache` is passed right after a move: the link delete's cache invalidation\n // is asynchronous relative to Delete() resolving, so an immediate cached read can\n // still return the old membership. Bypassing reads the committed DB state directly.\n const linkResult = await rv.RunView<{ ArtifactVersionID: string }>({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${collectionId}'`,\n Fields: ['ArtifactVersionID'],\n ResultType: 'simple',\n BypassCache: bypassCache\n }, currentUser);\n\n if (!linkResult.Success) {\n return [];\n }\n\n const versionIds = [...new Set(\n (linkResult.Results ?? [])\n .map(r => r.ArtifactVersionID)\n .filter((id): id is string => !!id)\n )];\n\n if (versionIds.length === 0) {\n return [];\n }\n\n // Load the specific versions that are members of this collection.\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds.map(id => `'${id}'`).join(',')})`,\n OrderBy: '__mj_UpdatedAt DESC',\n ResultType: 'entity_object'\n }, currentUser);\n\n if (!versionResult.Success || !versionResult.Results) {\n return [];\n }\n\n // Load parent artifacts for display metadata\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n const artifactMap = new Map<string, MJArtifactEntity>();\n\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => {\n artifactMap.set(a.ID, a);\n this.CacheArtifact(a); // Cache parent artifacts\n });\n }\n }\n\n // Combine version + artifact\n return versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null);\n } catch (error) {\n console.error('Error loading collection artifact versions:', error);\n return [];\n }\n }\n\n /** @deprecated Use {@link LoadArtifactVersionsForCollection}. */\n async loadArtifactVersionsForCollection(\n collectionId: string,\n currentUser: UserInfo,\n bypassCache: boolean = false\n ): Promise<Array<{ version: MJArtifactVersionEntity; artifact: MJArtifactEntity }>> {\n return this.LoadArtifactVersionsForCollection(collectionId, currentUser, bypassCache);\n }\n\n /**\n * Loads a single artifact by ID\n * @param id The artifact ID\n * @param currentUser The current user context\n * @returns The artifact entity or null\n */\n async LoadArtifact(id: string, currentUser: UserInfo): Promise<MJArtifactEntity | null> {\n try {\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n const loaded = await artifact.Load(id);\n\n if (loaded) {\n this.CacheArtifact(artifact);\n return artifact;\n }\n return null;\n } catch (error) {\n console.error('Error loading artifact:', error);\n return null;\n }\n }\n\n /** @deprecated Use {@link LoadArtifact}. */\n async loadArtifact(id: string, currentUser: UserInfo): Promise<MJArtifactEntity | null> {\n return this.LoadArtifact(id, currentUser);\n }\n\n /**\n * Creates a new artifact\n * @param data Artifact data\n * @param currentUser The current user context\n * @returns The created artifact\n */\n async CreateArtifact(data: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<MJArtifactEntity> {\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n Object.assign(artifact, data);\n\n const saved = await artifact.Save();\n if (saved) {\n this.CacheArtifact(artifact);\n return artifact;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to create artifact');\n }\n }\n\n /** @deprecated Use {@link CreateArtifact}. */\n async createArtifact(data: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<MJArtifactEntity> {\n return this.CreateArtifact(data, currentUser);\n }\n\n /**\n * Updates an artifact\n * @param id The artifact ID\n * @param updates The fields to update\n * @param currentUser The current user context\n * @returns True if successful\n */\n async UpdateArtifact(id: string, updates: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<boolean> {\n // Check edit permission\n const canEdit = await this.artifactPermissionService.checkPermission(id, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to edit this artifact');\n }\n\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n const loaded = await artifact.Load(id);\n if (!loaded) {\n throw new Error('Artifact not found');\n }\n\n Object.assign(artifact, updates);\n\n const saved = await artifact.Save();\n if (saved) {\n this.CacheArtifact(artifact);\n return true;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to update artifact');\n }\n }\n\n /** @deprecated Use {@link UpdateArtifact}. */\n async updateArtifact(id: string, updates: Partial<MJArtifactEntity>, currentUser: UserInfo): Promise<boolean> {\n return this.UpdateArtifact(id, updates, currentUser);\n }\n\n /**\n * Deletes an artifact\n * @param id The artifact ID\n * @param currentUser The current user context\n * @returns True if successful\n */\n async DeleteArtifact(id: string, currentUser: UserInfo): Promise<boolean> {\n // Check edit permission (required for deletion)\n const canEdit = await this.artifactPermissionService.checkPermission(id, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to delete this artifact');\n }\n\n const md = this.Provider;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', currentUser);\n\n const loaded = await artifact.Load(id);\n if (!loaded) {\n throw new Error('Artifact not found');\n }\n\n const deleted = await artifact.Delete();\n if (deleted) {\n this.RemoveCachedArtifact(id);\n if (this._activeArtifactId$.value === id) {\n this.CloseArtifact();\n }\n return true;\n } else {\n throw new Error(artifact.LatestResult?.Message || 'Failed to delete artifact');\n }\n }\n\n /** @deprecated Use {@link DeleteArtifact}. */\n async deleteArtifact(id: string, currentUser: UserInfo): Promise<boolean> {\n return this.DeleteArtifact(id, currentUser);\n }\n\n /**\n * Adds an artifact version to a collection\n * @param artifactId The artifact ID (for permission checking)\n * @param collectionId The collection ID\n * @param currentUser The current user context\n * @param versionId Optional specific version ID. If not provided, uses latest version\n */\n async AddToCollection(artifactId: string, collectionId: string, currentUser: UserInfo, versionId?: string): Promise<void> {\n // Check edit permission (required to modify collection membership)\n const canEdit = await this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to add this artifact to a collection');\n }\n\n // Get version ID if not provided\n let targetVersionId = versionId;\n if (!targetVersionId) {\n const rv = RunView.FromMetadataProvider(this.Provider);\n // conversation-scope: artifact-wide read, no conversation path applies\n const versionResult = await rv.RunView<any>(\n {\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifactId}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n throw new Error('No versions found for artifact');\n }\n\n targetVersionId = versionResult.Results[0].ID;\n }\n\n const md = this.Provider;\n const collectionArtifact = await md.GetEntityObject('MJ: Collection Artifacts', currentUser);\n\n (collectionArtifact as any).CollectionID = collectionId;\n (collectionArtifact as any).ArtifactVersionID = targetVersionId;\n\n const saved = await collectionArtifact.Save();\n if (!saved) {\n throw new Error('Failed to add artifact to collection');\n }\n }\n\n /** @deprecated Use {@link AddToCollection}. */\n async addToCollection(artifactId: string, collectionId: string, currentUser: UserInfo, versionId?: string): Promise<void> {\n return this.AddToCollection(artifactId, collectionId, currentUser, versionId);\n }\n\n /**\n * Removes all versions of an artifact from a collection\n * @param artifactId The artifact ID\n * @param collectionId The collection ID\n * @param currentUser The current user context\n */\n async RemoveFromCollection(artifactId: string, collectionId: string, currentUser: UserInfo): Promise<void> {\n // Check edit permission (required to modify collection membership)\n const canEdit = await this.artifactPermissionService.checkPermission(artifactId, currentUser.ID, 'edit', currentUser);\n if (!canEdit) {\n throw new Error('You do not have permission to remove this artifact from a collection');\n }\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n // Find all versions of this artifact in the collection\n const result = await rv.RunView<any>(\n {\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${collectionId}' AND ArtifactVersionID IN (\n SELECT ID FROM [__mj].[vwArtifactVersions] WHERE ArtifactID='${artifactId}'\n )`,\n ResultType: 'entity_object'\n },\n currentUser\n );\n\n if (!result.Success) {\n throw new Error(result.ErrorMessage || 'Failed to find collection artifact');\n }\n\n if (!result.Results || result.Results.length === 0) {\n throw new Error('Collection artifact link not found');\n }\n\n // Delete all version associations\n for (const collectionArtifact of result.Results) {\n const deleted = await collectionArtifact.Delete();\n if (!deleted) {\n const errorMsg = collectionArtifact.LatestResult?.Message || 'Failed to remove artifact from collection';\n throw new Error(errorMsg);\n }\n }\n }\n\n /** @deprecated Use {@link RemoveFromCollection}. */\n async removeFromCollection(artifactId: string, collectionId: string, currentUser: UserInfo): Promise<void> {\n return this.RemoveFromCollection(artifactId, collectionId, currentUser);\n }\n}"]}
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import { IRealtimeMediaHost, IRealtimeSessionRecorder } from '@memberjunction/realtime-runtime';
|
|
2
|
+
import { type DisplayCaptureOptions, type DisplayCaptureResult, type ILocalMediaController } from '@memberjunction/ai-realtime-client/media';
|
|
2
3
|
/**
|
|
3
4
|
* The browser's implementation of the realtime runtime's media seam.
|
|
4
5
|
*
|
|
5
6
|
* Everything here is the half of a realtime session that genuinely *is* platform-specific:
|
|
6
|
-
* how the microphone is requested, and how captured audio becomes
|
|
7
|
-
* orchestration around it — mint, connect, transcripts, tools, narration, channels,
|
|
8
|
-
* lives in `@memberjunction/realtime-runtime` and is identical on every host.
|
|
7
|
+
* how the microphone is requested, and how captured audio becomes Opus packets. The
|
|
8
|
+
* orchestration around it — mint, connect, transcripts, tools, narration, channels, shard
|
|
9
|
+
* upload, teardown — lives in `@memberjunction/realtime-runtime` and is identical on every host.
|
|
9
10
|
*/
|
|
10
11
|
export declare class BrowserRealtimeMediaHost implements IRealtimeMediaHost {
|
|
11
12
|
/**
|
|
12
13
|
* Requests the microphone through the standard Web API, which surfaces the browser's own
|
|
13
14
|
* permission prompt. A denial rejects, and the runtime treats that as a failed session start.
|
|
15
|
+
* The runtime uses {@link CreateLocalMediaController} instead when it is present, as it is here.
|
|
14
16
|
*/
|
|
15
17
|
AcquireMicrophone(): Promise<MediaStream>;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* The browser's camera-and-microphone controller. The runtime starts the microphone through it,
|
|
20
|
+
* so a call follows a device switch and keeps going when a headset is unplugged.
|
|
21
|
+
*/
|
|
22
|
+
CreateLocalMediaController(): ILocalMediaController;
|
|
23
|
+
/**
|
|
24
|
+
* Opens the browser's share picker for the session's screen share: a screen, window or tab, or one panel of
|
|
25
|
+
* this page where the browser can narrow a capture to it.
|
|
26
|
+
*/
|
|
27
|
+
RequestDisplayCapture(options?: DisplayCaptureOptions): Promise<DisplayCaptureResult>;
|
|
28
|
+
/**
|
|
29
|
+
* A fresh, unstarted 48 kHz Opus recorder for this call. {@link RealtimeAudioRecorder}
|
|
30
|
+
* implements the runtime's recorder contract itself (packets out, sample count back), so no
|
|
31
|
+
* adapter sits in between. When the browser cannot record, the recorder disables itself on
|
|
32
|
+
* Start and the runtime sees `IsRecording === false`, which it treats as "recording is off".
|
|
21
33
|
*/
|
|
22
34
|
CreateRecorder(): IRealtimeSessionRecorder | null;
|
|
23
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-realtime-media-host.d.ts","sourceRoot":"","sources":["../../../src/lib/services/browser-realtime-media-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-realtime-media-host.d.ts","sourceRoot":"","sources":["../../../src/lib/services/browser-realtime-media-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,wBAAwB,EAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAG7B,MAAM,0CAA0C,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IAC/D;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC;IAItD;;;OAGG;IACI,0BAA0B,IAAI,qBAAqB;IAI1D;;;OAGG;IACI,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAI5F;;;;;OAKG;IACI,cAAc,IAAI,wBAAwB,GAAG,IAAI;CAG3D"}
|
|
@@ -1,95 +1,44 @@
|
|
|
1
|
+
import { LocalMediaController, RequestDisplayCapture, } from '@memberjunction/ai-realtime-client/media';
|
|
1
2
|
import { RealtimeAudioRecorder } from './realtime-audio-recorder';
|
|
2
3
|
/**
|
|
3
4
|
* The browser's implementation of the realtime runtime's media seam.
|
|
4
5
|
*
|
|
5
6
|
* Everything here is the half of a realtime session that genuinely *is* platform-specific:
|
|
6
|
-
* how the microphone is requested, and how captured audio becomes
|
|
7
|
-
* orchestration around it — mint, connect, transcripts, tools, narration, channels,
|
|
8
|
-
* lives in `@memberjunction/realtime-runtime` and is identical on every host.
|
|
7
|
+
* how the microphone is requested, and how captured audio becomes Opus packets. The
|
|
8
|
+
* orchestration around it — mint, connect, transcripts, tools, narration, channels, shard
|
|
9
|
+
* upload, teardown — lives in `@memberjunction/realtime-runtime` and is identical on every host.
|
|
9
10
|
*/
|
|
10
11
|
export class BrowserRealtimeMediaHost {
|
|
11
12
|
/**
|
|
12
13
|
* Requests the microphone through the standard Web API, which surfaces the browser's own
|
|
13
14
|
* permission prompt. A denial rejects, and the runtime treats that as a failed session start.
|
|
15
|
+
* The runtime uses {@link CreateLocalMediaController} instead when it is present, as it is here.
|
|
14
16
|
*/
|
|
15
17
|
async AcquireMicrophone() {
|
|
16
18
|
return navigator.mediaDevices.getUserMedia({ audio: true });
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Returns `null` when the platform cannot record, which the runtime treats as "recording is
|
|
22
|
-
* simply off" rather than an error — recording is consent-gated and optional by design.
|
|
21
|
+
* The browser's camera-and-microphone controller. The runtime starts the microphone through it,
|
|
22
|
+
* so a call follows a device switch and keeps going when a headset is unplugged.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
return new
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Adapts {@link RealtimeAudioRecorder} (which speaks `Blob`, because that is what `MediaRecorder`
|
|
30
|
-
* and the Web Audio API hand you) to the runtime's byte-agnostic recorder contract.
|
|
31
|
-
*
|
|
32
|
-
* The base64 encoding that used to sit in the session service lives here now. That is the correct
|
|
33
|
-
* home for it: a browser reaches for `FileReader`, React Native reads a file off disk, and a test
|
|
34
|
-
* harness holds bytes in memory — three different answers to a question the orchestration layer
|
|
35
|
-
* should never have been asking.
|
|
36
|
-
*/
|
|
37
|
-
class BrowserRealtimeSessionRecorder {
|
|
38
|
-
recorder;
|
|
39
|
-
constructor(recorder) {
|
|
40
|
-
this.recorder = recorder;
|
|
41
|
-
}
|
|
42
|
-
get IsRecording() {
|
|
43
|
-
return this.recorder.IsRecording;
|
|
44
|
-
}
|
|
45
|
-
get SampleRate() {
|
|
46
|
-
return this.recorder.SampleRate;
|
|
47
|
-
}
|
|
48
|
-
get MimeType() {
|
|
49
|
-
return this.recorder.MimeType;
|
|
24
|
+
CreateLocalMediaController() {
|
|
25
|
+
return new LocalMediaController();
|
|
50
26
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
NowOffsetMs() {
|
|
58
|
-
return this.recorder.NowOffsetMs();
|
|
59
|
-
}
|
|
60
|
-
GetPeaks() {
|
|
61
|
-
return this.recorder.GetPeaks();
|
|
62
|
-
}
|
|
63
|
-
async SnapshotNewSegmentBase64() {
|
|
64
|
-
const segment = this.recorder.SnapshotNewSegment();
|
|
65
|
-
if (!segment || segment.size === 0) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
return this.blobToBase64(segment);
|
|
69
|
-
}
|
|
70
|
-
async StopAndEncode() {
|
|
71
|
-
const blob = await this.recorder.Stop();
|
|
72
|
-
if (!blob || blob.size === 0) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
return this.blobToBase64(blob);
|
|
27
|
+
/**
|
|
28
|
+
* Opens the browser's share picker for the session's screen share: a screen, window or tab, or one panel of
|
|
29
|
+
* this page where the browser can narrow a capture to it.
|
|
30
|
+
*/
|
|
31
|
+
RequestDisplayCapture(options) {
|
|
32
|
+
return RequestDisplayCapture(options);
|
|
76
33
|
}
|
|
77
34
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* the
|
|
35
|
+
* A fresh, unstarted 48 kHz Opus recorder for this call. {@link RealtimeAudioRecorder}
|
|
36
|
+
* implements the runtime's recorder contract itself (packets out, sample count back), so no
|
|
37
|
+
* adapter sits in between. When the browser cannot record, the recorder disables itself on
|
|
38
|
+
* Start and the runtime sees `IsRecording === false`, which it treats as "recording is off".
|
|
81
39
|
*/
|
|
82
|
-
|
|
83
|
-
return new
|
|
84
|
-
const reader = new FileReader();
|
|
85
|
-
reader.onloadend = () => {
|
|
86
|
-
const result = typeof reader.result === 'string' ? reader.result : '';
|
|
87
|
-
const comma = result.indexOf(',');
|
|
88
|
-
resolve(comma >= 0 ? result.slice(comma + 1) : null);
|
|
89
|
-
};
|
|
90
|
-
reader.onerror = () => resolve(null);
|
|
91
|
-
reader.readAsDataURL(blob);
|
|
92
|
-
});
|
|
40
|
+
CreateRecorder() {
|
|
41
|
+
return new RealtimeAudioRecorder();
|
|
93
42
|
}
|
|
94
43
|
}
|
|
95
44
|
//# sourceMappingURL=browser-realtime-media-host.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-realtime-media-host.js","sourceRoot":"","sources":["../../../src/lib/services/browser-realtime-media-host.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,OAAO,wBAAwB;IACjC
|
|
1
|
+
{"version":3,"file":"browser-realtime-media-host.js","sourceRoot":"","sources":["../../../src/lib/services/browser-realtime-media-host.ts"],"names":[],"mappings":"AAIA,OAAO,EAIH,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,OAAO,wBAAwB;IACjC;;;;OAIG;IACI,KAAK,CAAC,iBAAiB;QAC1B,OAAO,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,0BAA0B;QAC7B,OAAO,IAAI,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,qBAAqB,CAAC,OAA+B;QACxD,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,cAAc;QACjB,OAAO,IAAI,qBAAqB,EAAE,CAAC;IACvC,CAAC;CACJ","sourcesContent":["import {\n IRealtimeMediaHost,\n IRealtimeSessionRecorder,\n} from '@memberjunction/realtime-runtime';\nimport {\n type DisplayCaptureOptions,\n type DisplayCaptureResult,\n type ILocalMediaController,\n LocalMediaController,\n RequestDisplayCapture,\n} from '@memberjunction/ai-realtime-client/media';\nimport { RealtimeAudioRecorder } from './realtime-audio-recorder';\n\n/**\n * The browser's implementation of the realtime runtime's media seam.\n *\n * Everything here is the half of a realtime session that genuinely *is* platform-specific:\n * how the microphone is requested, and how captured audio becomes Opus packets. The\n * orchestration around it — mint, connect, transcripts, tools, narration, channels, shard\n * upload, teardown — lives in `@memberjunction/realtime-runtime` and is identical on every host.\n */\nexport class BrowserRealtimeMediaHost implements IRealtimeMediaHost {\n /**\n * Requests the microphone through the standard Web API, which surfaces the browser's own\n * permission prompt. A denial rejects, and the runtime treats that as a failed session start.\n * The runtime uses {@link CreateLocalMediaController} instead when it is present, as it is here.\n */\n public async AcquireMicrophone(): Promise<MediaStream> {\n return navigator.mediaDevices.getUserMedia({ audio: true });\n }\n\n /**\n * The browser's camera-and-microphone controller. The runtime starts the microphone through it,\n * so a call follows a device switch and keeps going when a headset is unplugged.\n */\n public CreateLocalMediaController(): ILocalMediaController {\n return new LocalMediaController();\n }\n\n /**\n * Opens the browser's share picker for the session's screen share: a screen, window or tab, or one panel of\n * this page where the browser can narrow a capture to it.\n */\n public RequestDisplayCapture(options?: DisplayCaptureOptions): Promise<DisplayCaptureResult> {\n return RequestDisplayCapture(options);\n }\n\n /**\n * A fresh, unstarted 48 kHz Opus recorder for this call. {@link RealtimeAudioRecorder}\n * implements the runtime's recorder contract itself (packets out, sample count back), so no\n * adapter sits in between. When the browser cannot record, the recorder disables itself on\n * Start and the runtime sees `IsRecording === false`, which it treats as \"recording is off\".\n */\n public CreateRecorder(): IRealtimeSessionRecorder | null {\n return new RealtimeAudioRecorder();\n }\n}\n"]}
|
|
@@ -150,8 +150,11 @@ export declare class ConversationAgentService {
|
|
|
150
150
|
* mention blob (`@{"type":"agent","id":"…","configId":"…"}`). So SQL narrows and the parser
|
|
151
151
|
* decides — both `configId` and the agent id appear verbatim in that blob, which makes the
|
|
152
152
|
* two LIKEs a tight prefilter, and `parseMentions` is what actually confirms a match.
|
|
153
|
+
*
|
|
154
|
+
* @param branchId The active branch. Only messages on its path count; null or omitted reads
|
|
155
|
+
* the trunk.
|
|
153
156
|
*/
|
|
154
|
-
FindConfigurationPresetForAgent(conversationId: string, agentId: string): Promise<string | undefined>;
|
|
157
|
+
FindConfigurationPresetForAgent(conversationId: string, agentId: string, branchId?: string | null): Promise<string | undefined>;
|
|
155
158
|
/** Returns the configId this message pins for `agentId`, or null when it pins none. */
|
|
156
159
|
private readAgentConfigFromMention;
|
|
157
160
|
/**
|
|
@@ -185,10 +188,13 @@ export declare class ConversationAgentService {
|
|
|
185
188
|
*
|
|
186
189
|
* Stays on the Angular shim because it directly uses GraphQLAIClient.
|
|
187
190
|
* Could move to the runtime in a follow-up.
|
|
191
|
+
*
|
|
192
|
+
* @param branchId The active branch. Only the agent's artifacts on its path are listed for the
|
|
193
|
+
* classifier; null or omitted reads the trunk.
|
|
188
194
|
*/
|
|
189
|
-
CheckAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[]): Promise<IntentCheckResult>;
|
|
195
|
+
CheckAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[], branchId?: string | null): Promise<IntentCheckResult>;
|
|
190
196
|
/** @deprecated Use {@link CheckAgentContinuityIntent}. */
|
|
191
|
-
checkAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[]): Promise<IntentCheckResult>;
|
|
197
|
+
checkAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[], branchId?: string | null): Promise<IntentCheckResult>;
|
|
192
198
|
/**
|
|
193
199
|
* Runs a typed decision on the server in one round trip, through
|
|
194
200
|
* {@link GraphQLAIClient.RunDecision}. Decision routing (`EnableDecisionRouting`) asks its
|
|
@@ -199,16 +205,18 @@ export declare class ConversationAgentService {
|
|
|
199
205
|
*/
|
|
200
206
|
RunDecision(params: RunDecisionParams): Promise<RunDecisionResult>;
|
|
201
207
|
/**
|
|
202
|
-
* Every artifact this agent produced
|
|
203
|
-
* routing's artifact question. Resolved by query, as {@link findAllAgentArtifacts} explains.
|
|
208
|
+
* Every artifact this agent produced on the active branch path, newest version first, for
|
|
209
|
+
* decision routing's artifact question. Resolved by query, as {@link findAllAgentArtifacts} explains.
|
|
204
210
|
*
|
|
205
211
|
* @param historyFrom The chat's history floor. When set, only artifacts on replies written at or
|
|
206
212
|
* after it count, as with {@link FindLatestAgentOutputVersion}.
|
|
213
|
+
* @param branchId The active branch. Only artifacts on its path count, as with
|
|
214
|
+
* {@link FindLatestAgentOutputVersion}; null or omitted reads the trunk.
|
|
207
215
|
*/
|
|
208
|
-
FindAgentArtifacts(conversationId: string, agentId: string, historyFrom?: Date | null): Promise<AgentArtifactSummary[]>;
|
|
216
|
+
FindAgentArtifacts(conversationId: string, agentId: string, historyFrom?: Date | null, branchId?: string | null): Promise<AgentArtifactSummary[]>;
|
|
209
217
|
/**
|
|
210
|
-
* Every artifact this agent produced
|
|
211
|
-
* by QUERY, not by scanning the display array.
|
|
218
|
+
* Every artifact this agent produced on the active branch path, newest version first —
|
|
219
|
+
* resolved by QUERY, not by scanning the display array.
|
|
212
220
|
*
|
|
213
221
|
* The scan this replaces walked `conversationDetails` and looked each row up in the
|
|
214
222
|
* caller's `artifactsByDetailId` / `agentRunsByDetailId` maps. Both are scoped to the
|
|
@@ -222,10 +230,11 @@ export declare class ConversationAgentService {
|
|
|
222
230
|
* plausible, and wrong: the same failure class as {@link FindLatestAgentOutputVersion},
|
|
223
231
|
* closed the same way.
|
|
224
232
|
*
|
|
225
|
-
*
|
|
233
|
+
* Three reads: the agent's replies, their Output versions, and the artifacts' names. See
|
|
226
234
|
* {@link AgentArtifactSummary} for why dropping `runId` removes the join back to agent runs.
|
|
227
235
|
*
|
|
228
236
|
* @param historyFrom The chat's history floor, when set (see {@link FindAgentArtifacts}).
|
|
237
|
+
* @param branchId The branch whose path to read; null or omitted reads the trunk.
|
|
229
238
|
*/
|
|
230
239
|
private findAllAgentArtifacts;
|
|
231
240
|
/** Names and types for the artifacts behind a set of versions. */
|
|
@@ -240,26 +249,49 @@ export declare class ConversationAgentService {
|
|
|
240
249
|
* again" exchanges where payload continuity matters most. A null payload is a LEGAL agent
|
|
241
250
|
* input, so the failure is silent: the agent regenerates from scratch instead of modifying.
|
|
242
251
|
*
|
|
243
|
-
*
|
|
252
|
+
* Two reads: the agent's replies, then their newest Output version. Versions carry
|
|
244
253
|
* `__mj_CreatedAt`, so "newest" is expressible without joining back for `Sequence`.
|
|
245
254
|
*
|
|
246
255
|
* @param historyFrom The chat's history floor. When set, only artifacts on replies written at
|
|
247
256
|
* or after it count: a run that may not read earlier messages must not pick up their work
|
|
248
257
|
* as its payload either.
|
|
258
|
+
* @param branchId The active branch. Only replies on its path count, so an artifact made on
|
|
259
|
+
* another branch is never the latest here; null or omitted reads the trunk.
|
|
260
|
+
*/
|
|
261
|
+
FindLatestAgentOutputVersion(conversationId: string, agentId: string, historyFrom?: Date | null, branchId?: string | null): Promise<AgentPayloadSource | null>;
|
|
262
|
+
/**
|
|
263
|
+
* `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced on one
|
|
264
|
+
* conversation path, in messages no rerun replaced, or null when the agent has no such reply
|
|
265
|
+
* there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts} so
|
|
266
|
+
* the two can never disagree about what "this agent's artifacts" means.
|
|
267
|
+
*
|
|
268
|
+
* The replies are read with their own RunView ({@link agentReplyIds}), so the row-level
|
|
269
|
+
* security on conversation messages applies. A subquery over their view would skip it, and the
|
|
270
|
+
* server refuses one for a user whose read of messages is row-filtered.
|
|
249
271
|
*/
|
|
250
|
-
|
|
272
|
+
private agentOutputVersionFilter;
|
|
251
273
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* {@link
|
|
255
|
-
* artifacts" means.
|
|
274
|
+
* IDs of the agent's replies on one conversation path, in messages no rerun replaced, written
|
|
275
|
+
* at or after the history floor when one is set. Empty when the path cannot be built
|
|
276
|
+
* ({@link branchPathFilter}) or the read fails.
|
|
256
277
|
*
|
|
257
278
|
* Filters on the DETAIL's `Status <> 'Error'` rather than the agent run's
|
|
258
279
|
* `Status = 'Completed'` (which is what the array scan this replaced used). Doing it on the
|
|
259
280
|
* run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the
|
|
260
281
|
* detail already carries.
|
|
261
282
|
*/
|
|
262
|
-
private
|
|
283
|
+
private agentReplyIds;
|
|
284
|
+
/**
|
|
285
|
+
* The SQL predicate for one branch's path in a conversation, from
|
|
286
|
+
* `ConversationEngine.BranchPathFilterFresh`. A null or omitted branch is the trunk and costs
|
|
287
|
+
* no query.
|
|
288
|
+
*
|
|
289
|
+
* Never throws. When the path cannot be built (the branch rows fail to load, or the branch is
|
|
290
|
+
* not among them), it logs the error and returns null. Each lookup then returns its own
|
|
291
|
+
* failure value, as it does when its main query fails. A caller must not fall back to the
|
|
292
|
+
* trunk predicate: on a branch, that reads trunk rows past the fork point.
|
|
293
|
+
*/
|
|
294
|
+
private branchPathFilter;
|
|
263
295
|
/**
|
|
264
296
|
* One artifact version by ID, as a payload source.
|
|
265
297
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAY,iBAAiB,
|
|
1
|
+
{"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAY,iBAAiB,EAAqB,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAwC,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sCAAsC,CA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