@memberjunction/ng-conversations 6.2.0-edge.0 → 6.2.0-edge.2
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 +43 -2
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
- package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
- package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
- package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
- package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.js +181 -47
- package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
- package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
- package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +220 -70
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +154 -40
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +951 -367
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.js +388 -44
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
- package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1191 -124
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +2816 -785
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +139 -19
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.js +296 -59
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +579 -78
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +2322 -823
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts +42 -4
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.js +93 -21
- package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.d.ts +57 -11
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.js +128 -16
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts +68 -10
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.js +151 -27
- package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -1
- package/dist/lib/components/export/export-modal.component.d.ts +84 -10
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +173 -49
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts +29 -3
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js +58 -12
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/library/library-full-view.component.d.ts +57 -8
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +119 -35
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/members/members-modal.component.d.ts +76 -10
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
- package/dist/lib/components/members/members-modal.component.js +164 -50
- package/dist/lib/components/members/members-modal.component.js.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.d.ts +49 -5
- package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.js +140 -26
- package/dist/lib/components/message/actionable-commands.component.js.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.d.ts +46 -10
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +120 -36
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +613 -74
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +1390 -422
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +490 -29
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +1088 -244
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +297 -29
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +598 -123
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
- package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.js +13 -3
- package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
- package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.js +36 -8
- package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +348 -87
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/project/project-selector.component.d.ts +78 -8
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-selector.component.js +177 -46
- package/dist/lib/components/project/project-selector.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +18 -18
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -23
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +136 -92
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +3 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +6 -2
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/components/search/search-panel.component.d.ts +133 -22
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +312 -83
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/share/share-modal.component.d.ts +69 -9
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/share/share-modal.component.js +139 -31
- package/dist/lib/components/share/share-modal.component.js.map +1 -1
- package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
- package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
- package/dist/lib/components/shared/user-picker.component.js +110 -30
- package/dist/lib/components/shared/user-picker.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js +25 -5
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
- package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +223 -75
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
- package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.js +100 -16
- package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.js +146 -36
- package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
- package/dist/lib/components/toast/toast.component.d.ts +11 -1
- package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
- package/dist/lib/components/toast/toast.component.js +25 -5
- package/dist/lib/components/toast/toast.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +891 -292
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
- package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
- package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
- package/dist/lib/directives/chat-slot.directive.js.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.js +14 -4
- package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +34 -7
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +37 -7
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +113 -0
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
- package/dist/lib/models/agent-turn.model.js +12 -0
- package/dist/lib/models/agent-turn.model.js.map +1 -0
- package/dist/lib/models/collection-view.model.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +8 -0
- 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/models/lazy-artifact-info.d.ts +44 -12
- package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
- package/dist/lib/models/lazy-artifact-info.js +98 -34
- package/dist/lib/models/lazy-artifact-info.js.map +1 -1
- package/dist/lib/services/active-tasks.service.d.ts +30 -4
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
- package/dist/lib/services/active-tasks.service.js +71 -19
- package/dist/lib/services/active-tasks.service.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts +17 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +48 -16
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts +39 -0
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +152 -17
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts +58 -5
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +135 -35
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/collection-permission.service.d.ts +28 -0
- package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
- package/dist/lib/services/collection-permission.service.js +88 -32
- package/dist/lib/services/collection-permission.service.js.map +1 -1
- package/dist/lib/services/collection-state.service.d.ts +11 -1
- package/dist/lib/services/collection-state.service.d.ts.map +1 -1
- package/dist/lib/services/collection-state.service.js +25 -5
- package/dist/lib/services/collection-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +47 -4
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +85 -20
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +17 -0
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js +38 -10
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- package/dist/lib/services/conversation-liveness-dom.service.d.ts +42 -0
- package/dist/lib/services/conversation-liveness-dom.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-liveness-dom.service.js +74 -0
- package/dist/lib/services/conversation-liveness-dom.service.js.map +1 -0
- package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
- package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-streaming.service.js +50 -10
- package/dist/lib/services/conversation-streaming.service.js.map +1 -1
- package/dist/lib/services/data-cache.service.d.ts +31 -0
- package/dist/lib/services/data-cache.service.d.ts.map +1 -1
- package/dist/lib/services/data-cache.service.js +71 -15
- package/dist/lib/services/data-cache.service.js.map +1 -1
- package/dist/lib/services/dialog.service.d.ts +13 -0
- package/dist/lib/services/dialog.service.d.ts.map +1 -1
- package/dist/lib/services/dialog.service.js +25 -5
- package/dist/lib/services/dialog.service.js.map +1 -1
- package/dist/lib/services/export.service.d.ts +2 -0
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +5 -1
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/mention-parser.service.d.ts +10 -0
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
- package/dist/lib/services/mention-parser.service.js +25 -5
- package/dist/lib/services/mention-parser.service.js.map +1 -1
- package/dist/lib/services/notification.service.d.ts +54 -6
- package/dist/lib/services/notification.service.d.ts.map +1 -1
- package/dist/lib/services/notification.service.js +123 -27
- package/dist/lib/services/notification.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
- package/dist/lib/services/realtime-audio-recorder.js +12 -12
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.js +10 -2
- package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +42 -9
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +103 -23
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/services/toast.service.d.ts +19 -1
- package/dist/lib/services/toast.service.d.ts.map +1 -1
- package/dist/lib/services/toast.service.js +45 -9
- package/dist/lib/services/toast.service.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +56 -5
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +113 -16
- package/dist/lib/services/ui-command-handler.service.js.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
- package/dist/lib/utils/agent-artifact-summary.js +3 -3
- package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
- package/dist/lib/utils/agent-turn-routing.d.ts +70 -0
- package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
- package/dist/lib/utils/agent-turn-routing.js +84 -0
- package/dist/lib/utils/agent-turn-routing.js.map +1 -0
- package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
- package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
- package/dist/lib/utils/artifact-panel-action.js +10 -2
- package/dist/lib/utils/artifact-panel-action.js.map +1 -1
- package/dist/lib/utils/decision-routing.d.ts +68 -0
- package/dist/lib/utils/decision-routing.d.ts.map +1 -0
- package/dist/lib/utils/decision-routing.js +101 -0
- package/dist/lib/utils/decision-routing.js.map +1 -0
- package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
- package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/distinct-artifacts.js +5 -1
- package/dist/lib/utils/distinct-artifacts.js.map +1 -1
- package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
- package/dist/lib/utils/plan-mode-preference.js +6 -6
- package/dist/lib/utils/plan-mode-preference.js.map +1 -1
- package/dist/public-api.d.ts +5 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +8 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +32 -32
|
@@ -43,7 +43,7 @@ export class ConversationAttachmentService {
|
|
|
43
43
|
* Load all attachments for a list of conversation detail IDs.
|
|
44
44
|
* Returns a map of ConversationDetailID -> MessageAttachment[]
|
|
45
45
|
*/
|
|
46
|
-
async
|
|
46
|
+
async LoadAttachmentsForMessages(conversationDetailIds, contextUser) {
|
|
47
47
|
const result = new Map();
|
|
48
48
|
if (!conversationDetailIds || conversationDetailIds.length === 0) {
|
|
49
49
|
return result;
|
|
@@ -125,13 +125,21 @@ export class ConversationAttachmentService {
|
|
|
125
125
|
}
|
|
126
126
|
return result;
|
|
127
127
|
}
|
|
128
|
+
/** @deprecated Use {@link LoadAttachmentsForMessages}. */
|
|
129
|
+
async loadAttachmentsForMessages(conversationDetailIds, contextUser) {
|
|
130
|
+
return this.LoadAttachmentsForMessages(conversationDetailIds, contextUser);
|
|
131
|
+
}
|
|
128
132
|
/**
|
|
129
133
|
* Load attachments for a single message
|
|
130
134
|
*/
|
|
131
|
-
async
|
|
132
|
-
const map = await this.
|
|
135
|
+
async LoadAttachmentsForMessage(conversationDetailId, contextUser) {
|
|
136
|
+
const map = await this.LoadAttachmentsForMessages([conversationDetailId], contextUser);
|
|
133
137
|
return map.get(conversationDetailId) || [];
|
|
134
138
|
}
|
|
139
|
+
/** @deprecated Use {@link LoadAttachmentsForMessage}. */
|
|
140
|
+
async loadAttachmentsForMessage(conversationDetailId, contextUser) {
|
|
141
|
+
return this.LoadAttachmentsForMessage(conversationDetailId, contextUser);
|
|
142
|
+
}
|
|
135
143
|
/**
|
|
136
144
|
* Save pending attachments to the database.
|
|
137
145
|
* Returns the saved attachment entities.
|
|
@@ -145,7 +153,7 @@ export class ConversationAttachmentService {
|
|
|
145
153
|
* which is correct for a turn with no agent — but a caller that HAS an agent and does not pass
|
|
146
154
|
* it produces the cross-surface drift this shared policy exists to remove.
|
|
147
155
|
*/
|
|
148
|
-
async
|
|
156
|
+
async SaveAttachments(conversationDetailId, pendingAttachments, contextUser, agent) {
|
|
149
157
|
const savedAttachments = [];
|
|
150
158
|
const rejectionMessages = [];
|
|
151
159
|
const md = this.Provider;
|
|
@@ -223,11 +231,15 @@ export class ConversationAttachmentService {
|
|
|
223
231
|
}
|
|
224
232
|
return savedAttachments;
|
|
225
233
|
}
|
|
234
|
+
/** @deprecated Use {@link SaveAttachments}. */
|
|
235
|
+
async saveAttachments(conversationDetailId, pendingAttachments, contextUser, agent) {
|
|
236
|
+
return this.SaveAttachments(conversationDetailId, pendingAttachments, contextUser, agent);
|
|
237
|
+
}
|
|
226
238
|
/**
|
|
227
239
|
* Create attachment reference tokens for message text.
|
|
228
240
|
* These tokens are stored in the Message field to reference attachments.
|
|
229
241
|
*/
|
|
230
|
-
|
|
242
|
+
CreateAttachmentReferences(attachments) {
|
|
231
243
|
return attachments
|
|
232
244
|
.map(att => {
|
|
233
245
|
const content = {
|
|
@@ -246,6 +258,10 @@ export class ConversationAttachmentService {
|
|
|
246
258
|
})
|
|
247
259
|
.join(' ');
|
|
248
260
|
}
|
|
261
|
+
/** @deprecated Use {@link CreateAttachmentReferences}. */
|
|
262
|
+
createAttachmentReferences(attachments) {
|
|
263
|
+
return this.CreateAttachmentReferences(attachments);
|
|
264
|
+
}
|
|
249
265
|
/**
|
|
250
266
|
* Convert a database entity to a MessageAttachment for display
|
|
251
267
|
*/
|
|
@@ -341,7 +357,7 @@ export class ConversationAttachmentService {
|
|
|
341
357
|
* Create a thumbnail from an image file.
|
|
342
358
|
* Returns a base64 data URL of the thumbnail.
|
|
343
359
|
*/
|
|
344
|
-
async
|
|
360
|
+
async CreateThumbnail(file, maxSize = 200) {
|
|
345
361
|
return new Promise((resolve) => {
|
|
346
362
|
if (!file.type.startsWith('image/')) {
|
|
347
363
|
resolve(null);
|
|
@@ -385,10 +401,14 @@ export class ConversationAttachmentService {
|
|
|
385
401
|
reader.readAsDataURL(file);
|
|
386
402
|
});
|
|
387
403
|
}
|
|
404
|
+
/** @deprecated Use {@link CreateThumbnail}. */
|
|
405
|
+
async createThumbnail(file, maxSize = 200) {
|
|
406
|
+
return this.CreateThumbnail(file, maxSize);
|
|
407
|
+
}
|
|
388
408
|
/**
|
|
389
409
|
* Get image dimensions from a file
|
|
390
410
|
*/
|
|
391
|
-
async
|
|
411
|
+
async GetImageDimensions(file) {
|
|
392
412
|
return new Promise((resolve) => {
|
|
393
413
|
if (!file.type.startsWith('image/')) {
|
|
394
414
|
resolve(null);
|
|
@@ -407,11 +427,15 @@ export class ConversationAttachmentService {
|
|
|
407
427
|
reader.readAsDataURL(file);
|
|
408
428
|
});
|
|
409
429
|
}
|
|
430
|
+
/** @deprecated Use {@link GetImageDimensions}. */
|
|
431
|
+
async getImageDimensions(file) {
|
|
432
|
+
return this.GetImageDimensions(file);
|
|
433
|
+
}
|
|
410
434
|
/**
|
|
411
435
|
* Process a file and create a PendingAttachment.
|
|
412
436
|
* This creates the data structure needed for the mention editor component.
|
|
413
437
|
*/
|
|
414
|
-
async
|
|
438
|
+
async ProcessFile(file) {
|
|
415
439
|
// Read file data URL
|
|
416
440
|
const dataUrl = await this.fileToDataUrl(file);
|
|
417
441
|
const pending = {
|
|
@@ -425,18 +449,22 @@ export class ConversationAttachmentService {
|
|
|
425
449
|
// Get image dimensions and create thumbnail
|
|
426
450
|
const type = ConversationUtility.GetAttachmentTypeFromMime(file.type);
|
|
427
451
|
if (type === 'Image') {
|
|
428
|
-
const dimensions = await this.
|
|
452
|
+
const dimensions = await this.GetImageDimensions(file);
|
|
429
453
|
if (dimensions) {
|
|
430
454
|
pending.width = dimensions.width;
|
|
431
455
|
pending.height = dimensions.height;
|
|
432
456
|
}
|
|
433
|
-
const thumbnail = await this.
|
|
457
|
+
const thumbnail = await this.CreateThumbnail(file);
|
|
434
458
|
if (thumbnail) {
|
|
435
459
|
pending.thumbnailUrl = thumbnail;
|
|
436
460
|
}
|
|
437
461
|
}
|
|
438
462
|
return pending;
|
|
439
463
|
}
|
|
464
|
+
/** @deprecated Use {@link ProcessFile}. */
|
|
465
|
+
async processFile(file) {
|
|
466
|
+
return this.ProcessFile(file);
|
|
467
|
+
}
|
|
440
468
|
/**
|
|
441
469
|
* Convert a file to a data URL
|
|
442
470
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-attachment.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAOL,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EAGvC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAEpD;;;GAGG;AAIH,MAAM,OAAO,6BAA6B;IACxC;;;;;;;;;;;;;;;OAeG;IACc,SAAS,GAAyB,IAAI,0BAA0B,EAAE,CAAC;IAE5E,SAAS,GAA6B,IAAI,CAAC;IAEnD,gBAAe,CAAC;IAEhB;;OAEG;IACH,IAAW,QAAQ,CAAC,KAA+B;QAC/C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,0BAA0B,CAC9B,qBAA+B,EAC/B,WAAsB;QAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;QAEtD,IAAI,CAAC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,EAAE,C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,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC;YACvD,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,cAAc;QACpB,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;uHAngBU,6BAA6B;gEAA7B,6BAA6B,WAA7B,6BAA6B,mBAF5B,MAAM;;iFAEP,6BAA6B;cAHzC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { RunView, Metadata, UserInfo, IMetadataProvider } from '@memberjunction/core';\nimport {\n MJConversationDetailAttachmentEntity,\n MJConversationDetailArtifactEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity,\n MJAIModalityEntity,\n MJAIAgentEntity,\n ArtifactMetadataEngine\n} from '@memberjunction/core-entities';\nimport {\n ConversationUtility,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n AttachmentContent,\n AttachmentType\n} from '@memberjunction/ai-core-plus';\nimport type { IAttachmentBlobStore } from '@memberjunction/ai-core-plus';\nimport { GraphQLAttachmentBlobStore } from './graphql-attachment-blob-store';\nimport { MessageAttachment } from '../components/message/message-item.component';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Service for managing conversation attachments.\n * Handles loading, saving, and converting attachments between different formats.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAttachmentService {\n /**\n * Where attachment bytes go when they are too large to store inline.\n *\n * Held directly rather than read off the shared `ConversationAttachmentService` in\n * `@memberjunction/aiengine`. That package's entry point imports Node's `crypto`\n * (`AIEngine.ts`, for an embedding-cache key), so a runtime import of it from here pulls the\n * whole server AI engine into Explorer's browser bundle and the build fails to resolve `crypto`.\n * The shared service is a server-side consumer of the same seam, not a dependency of this one.\n *\n * The seam's *type* used to be imported from there with `import type`, on the reasoning that an\n * erased import costs nothing. It does at runtime — but the class-registration manifest generator\n * walks **package.json**, so the declared dependency was a live edge regardless, and it later\n * carried `@memberjunction/storage`'s drivers into the browser manifest. Both the contract and\n * the placement policy (`ConversationUtility`) now come from `@memberjunction/ai-core-plus`, and\n * this package does not declare `aiengine` at all.\n */\n private readonly blobStore: IAttachmentBlobStore = new GraphQLAttachmentBlobStore();\n\n private _provider: IMetadataProvider | null = null;\n\n constructor() {}\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all attachments for a list of conversation detail IDs.\n * Returns a map of ConversationDetailID -> MessageAttachment[]\n */\n async loadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n const result = new Map<string, MessageAttachment[]>();\n\n if (!conversationDetailIds || conversationDetailIds.length === 0) {\n return result;\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const idList = conversationDetailIds.map(id => `'${id}'`).join(',');\n\n // Load input artifacts (ConversationDetailArtifact with Direction='Input').\n // Since the backfill migration (V202605271400__Backfill_Attachment_Artifacts)\n // converted all legacy ConversationDetailAttachment rows to artifact pairs,\n // the artifact junction is the single source of truth — no separate attachment\n // query needed.\n const artifactLinksResult = await rv.RunView<MJConversationDetailArtifactEntity>({\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${idList}) AND Direction = 'Input'`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (artifactLinksResult.Success && artifactLinksResult.Results && artifactLinksResult.Results.length > 0) {\n // Load the referenced artifact versions AND their parent artifacts in parallel\n // so we can resolve the semantic artifact-type name for the tile badge.\n const versionIds = artifactLinksResult.Results.map(l => `'${l.ArtifactVersionID}'`).join(',');\n const versionsResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds})`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (versionsResult.Success && versionsResult.Results) {\n const versionMap = new Map<string, MJArtifactVersionEntity>();\n for (const v of versionsResult.Results) {\n versionMap.set(v.ID, v);\n }\n\n // Bulk-load parent artifacts to get TypeID, then resolve type names via cached engine.\n const artifactIds = Array.from(new Set(versionsResult.Results.map(v => v.ArtifactID).filter(Boolean)));\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactIdList = artifactIds.map(id => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIdList})`,\n ResultType: 'entity_object'\n }, contextUser);\n if (artifactsResult.Success && artifactsResult.Results) {\n for (const a of artifactsResult.Results) {\n artifactMap.set(a.ID, a);\n }\n }\n // Ensure the artifact-type cache is populated so FindArtifactTypeByID resolves.\n await ArtifactMetadataEngine.Instance.Config(false, contextUser);\n }\n\n for (const link of artifactLinksResult.Results) {\n const version = versionMap.get(link.ArtifactVersionID);\n if (version) {\n const parentArtifact = artifactMap.get(version.ArtifactID);\n const artifactType = parentArtifact\n ? ArtifactMetadataEngine.Instance.FindArtifactTypeByID(parentArtifact.TypeID)\n : undefined;\n const detailId = link.ConversationDetailID;\n if (!result.has(detailId)) {\n result.set(detailId, []);\n }\n result.get(detailId)!.push({\n id: link.ID,\n type: version.ContentMode === 'File' ? this.getMimeAttachmentType(version.MimeType || '') : 'Document',\n mimeType: version.MimeType || 'text/plain',\n fileName: version.FileName || version.Name || 'Artifact',\n sizeBytes: version.ContentSizeBytes || 0,\n source: 'artifact',\n artifactId: version.ArtifactID || undefined,\n artifactVersionId: version.ID,\n artifactTypeName: artifactType?.Name || undefined\n } as MessageAttachment);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error loading attachments:', error);\n }\n\n return result;\n }\n\n /**\n * Load attachments for a single message\n */\n async loadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n const map = await this.loadAttachmentsForMessages([conversationDetailId], contextUser);\n return map.get(conversationDetailId) || [];\n }\n\n /**\n * Save pending attachments to the database.\n * Returns the saved attachment entities.\n *\n * @param conversationDetailId - ID of the conversation detail to attach to\n * @param pendingAttachments - Array of pending attachments from the mention editor\n * @param contextUser - User context for the operation\n * @param agent - The agent this turn is addressed to, when the caller has resolved one. Only its\n * `InlineStorageThresholdBytes` is read, and only to make the inline-vs-storage decision match\n * what the server would decide for the same file. Omitting it falls back to the system default,\n * which is correct for a turn with no agent — but a caller that HAS an agent and does not pass\n * it produces the cross-surface drift this shared policy exists to remove.\n */\n async saveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n const savedAttachments: MJConversationDetailAttachmentEntity[] = [];\n const rejectionMessages: string[] = [];\n const md = this.Provider;\n\n for (let i = 0; i < pendingAttachments.length; i++) {\n const pending = pendingAttachments[i];\n\n try {\n const attachment = await md.GetEntityObject<MJConversationDetailAttachmentEntity>(\n 'MJ: Conversation Detail Attachments',\n contextUser\n );\n\n // Determine attachment type from MIME type\n const attachmentType = ConversationUtility.GetAttachmentTypeFromMime(pending.mimeType);\n\n attachment.ConversationDetailID = conversationDetailId;\n attachment.ModalityID = this.getModalityIdForType(attachmentType);\n attachment.MimeType = pending.mimeType;\n attachment.FileName = pending.fileName;\n attachment.FileSizeBytes = pending.sizeBytes;\n attachment.Width = pending.width ?? null;\n attachment.Height = pending.height ?? null;\n attachment.DurationSeconds = null; // PendingAttachment doesn't have duration\n attachment.DisplayOrder = i;\n attachment.ThumbnailBase64 = pending.thumbnailUrl ?? null;\n\n // For artifact references, create a ConversationDetailArtifact with Direction='Input'\n // instead of a ConversationDetailAttachment\n if (pending.source === 'artifact' && pending.artifactVersionId) {\n const artifactLink = await md.GetEntityObject<MJConversationDetailArtifactEntity>(\n 'MJ: Conversation Detail Artifacts',\n contextUser\n );\n artifactLink.ConversationDetailID = conversationDetailId;\n artifactLink.ArtifactVersionID = pending.artifactVersionId;\n artifactLink.Direction = 'Input';\n const artifactSaved = await artifactLink.Save();\n if (!artifactSaved) {\n console.error('Failed to save artifact input link:', artifactLink.LatestResult);\n }\n continue; // Skip creating a ConversationDetailAttachment for artifacts\n }\n\n // Storage placement is NOT this service's decision. `ConversationUtility.ShouldStoreInline`\n // owns it — honouring an agent's `InlineStorageThresholdBytes` before the system default —\n // and it is the same call the server and the mobile app make. This service previously set\n // `InlineData` unconditionally, so a large image went into a database column instead of\n // MJStorage, contradicting the entity's own contract that the two are mutually exclusive\n // and sized.\n if (pending.dataUrl) {\n const base64Data = this.extractBase64FromDataUrl(pending.dataUrl);\n const storeInline = ConversationUtility.ShouldStoreInline(\n pending.sizeBytes,\n agent?.InlineStorageThresholdBytes ?? null,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n );\n\n if (storeInline) {\n attachment.InlineData = base64Data;\n } else {\n const stored = await this.blobStore.Upload(\n { FileName: pending.fileName, MimeType: pending.mimeType, Base64Data: base64Data },\n contextUser ?? md.CurrentUser,\n md,\n );\n if (!stored?.Success || !stored.FileID) {\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" is too large to store inline and could not be uploaded: ${stored?.Error ?? 'storage is not available.'}`,\n );\n continue;\n }\n attachment.FileID = stored.FileID;\n }\n }\n\n const saved = await attachment.Save();\n if (saved) {\n savedAttachments.push(attachment);\n } else {\n const message = attachment.LatestResult?.CompleteMessage\n ?? `Attachment \"${pending.fileName}\" was rejected by the server.`;\n console.error('Failed to save attachment:', attachment.LatestResult);\n rejectionMessages.push(message);\n }\n } catch (error) {\n console.error('Error saving attachment:', error);\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" failed to upload: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Surface server-side rejections (e.g. unregistered MIME types) to the\n // caller — throwing here lets the message-input toast pipeline display\n // the actual server message rather than silently dropping the file.\n if (rejectionMessages.length > 0) {\n throw new Error(rejectionMessages.join('\\n'));\n }\n\n return savedAttachments;\n }\n\n /**\n * Create attachment reference tokens for message text.\n * These tokens are stored in the Message field to reference attachments.\n */\n createAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return attachments\n .map(att => {\n const content: AttachmentContent = {\n _mode: 'attachment',\n id: att.ID,\n type: this.getAttachmentTypeFromModality(att.ModalityID),\n mimeType: att.MimeType,\n fileName: att.FileName ?? undefined,\n sizeBytes: att.FileSizeBytes,\n width: att.Width ?? undefined,\n height: att.Height ?? undefined,\n durationSeconds: att.DurationSeconds ?? undefined,\n thumbnailBase64: att.ThumbnailBase64 ?? undefined\n };\n return ConversationUtility.CreateAttachmentReference(content);\n })\n .join(' ');\n }\n\n /**\n * Convert a database entity to a MessageAttachment for display\n */\n private convertToMessageAttachment(entity: MJConversationDetailAttachmentEntity): MessageAttachment {\n // Determine content URL\n let contentUrl: string | undefined;\n let thumbnailUrl: string | undefined;\n\n if (entity.InlineData) {\n // Create data URL from inline data\n contentUrl = `data:${entity.MimeType};base64,${entity.InlineData}`;\n } else if (entity.FileID) {\n // TODO: Integrate with MJStorage to get pre-authenticated URL\n contentUrl = undefined; // Will need to be loaded separately\n }\n\n // Use thumbnail if available\n if (entity.ThumbnailBase64) {\n thumbnailUrl = entity.ThumbnailBase64.startsWith('data:')\n ? entity.ThumbnailBase64\n : `data:image/jpeg;base64,${entity.ThumbnailBase64}`;\n }\n\n return {\n id: entity.ID,\n type: this.getAttachmentTypeFromModality(entity.ModalityID),\n mimeType: entity.MimeType,\n fileName: entity.FileName,\n sizeBytes: entity.FileSizeBytes,\n width: entity.Width ?? undefined,\n height: entity.Height ?? undefined,\n thumbnailUrl: thumbnailUrl,\n contentUrl: contentUrl\n };\n }\n\n /**\n * Get the AttachmentType from a modality ID\n */\n private getAttachmentTypeFromModality(modalityId: string): AttachmentType {\n const modality = AIEngineBase.Instance.Modalities.find(m => UUIDsEqual(m.ID, modalityId))\n\n const name = modality?.Name?.toLowerCase() || '';\n\n if (name === 'image') return 'Image';\n if (name === 'video') return 'Video';\n if (name === 'audio') return 'Audio';\n\n return 'Document';\n }\n\n /**\n * Get the AttachmentType from a MIME type string\n */\n private getMimeAttachmentType(mimeType: string): 'Image' | 'Video' | 'Audio' | 'Document' {\n if (mimeType.startsWith('image/')) return 'Image';\n if (mimeType.startsWith('video/')) return 'Video';\n if (mimeType.startsWith('audio/')) return 'Audio';\n return 'Document';\n }\n\n /**\n * Get the modality ID for an attachment type\n */\n private getModalityIdForType(type: AttachmentType): string {\n // Map AttachmentType to modality name\n // AttachmentType is 'Image' | 'Video' | 'Audio' | 'Document'\n // Modality names are 'Image', 'Audio', 'Video', 'File'\n let modalityName = type.toLowerCase().trim();\n if (modalityName === 'document') {\n modalityName = 'file';\n }\n\n const modality = AIEngineBase.Instance.Modalities.find(m => m.Name?.trim().toLowerCase() === modalityName);\n if (modality) {\n return modality.ID;\n }\n\n // Fallback to 'file' modality if specific type not found\n // recursive call, so long as the current modality isn't file as that\n // would cause infinite recursion/stack overflow\n if (modalityName !== 'file') {\n return this.getModalityIdForType('Document');\n }\n else {\n return '';\n }\n }\n \n /**\n * Extract base64 data from a data URL\n */\n private extractBase64FromDataUrl(dataUrl: string): string {\n const matches = dataUrl.match(/^data:[^;]+;base64,(.+)$/);\n return matches ? matches[1] : dataUrl;\n }\n\n /**\n * Create a thumbnail from an image file.\n * Returns a base64 data URL of the thumbnail.\n */\n async createThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement('canvas');\n let width = img.width;\n let height = img.height;\n\n // Scale down to maxSize\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0, width, height);\n resolve(canvas.toDataURL('image/jpeg', 0.7));\n } else {\n resolve(null);\n }\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Get image dimensions from a file\n */\n async getImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Process a file and create a PendingAttachment.\n * This creates the data structure needed for the mention editor component.\n */\n async processFile(file: File): Promise<PendingAttachment> {\n // Read file data URL\n const dataUrl = await this.fileToDataUrl(file);\n\n const pending: PendingAttachment = {\n id: this.generateTempId(),\n file: file,\n dataUrl: dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size\n };\n\n // Get image dimensions and create thumbnail\n const type = ConversationUtility.GetAttachmentTypeFromMime(file.type);\n if (type === 'Image') {\n const dimensions = await this.getImageDimensions(file);\n if (dimensions) {\n pending.width = dimensions.width;\n pending.height = dimensions.height;\n }\n\n const thumbnail = await this.createThumbnail(file);\n if (thumbnail) {\n pending.thumbnailUrl = thumbnail;\n }\n }\n\n return pending;\n }\n\n /**\n * Convert a file to a data URL\n */\n private fileToDataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Generate a temporary ID for pending attachments\n */\n private generateTempId(): string {\n return `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation-attachment.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-attachment.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA+B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAOL,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EAGvC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAEpD;;;GAGG;AAIH,MAAM,OAAO,6BAA6B;IACxC;;;;;;;;;;;;;;;OAeG;IACc,SAAS,GAAyB,IAAI,0BAA0B,EAAE,CAAC;IAE5E,SAAS,GAA6B,IAAI,CAAC;IAEnD,gBAAe,CAAC;IAEhB;;OAEG;IACH,IAAW,QAAQ,CAAC,KAA+B;QAC/C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC;IA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C,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,IAAU;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC;YACvD,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,cAAc;QACpB,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;uHApjBU,6BAA6B;gEAA7B,6BAA6B,WAA7B,6BAA6B,mBAF5B,MAAM;;iFAEP,6BAA6B;cAHzC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { RunView, Metadata, UserInfo, IMetadataProvider } from '@memberjunction/core';\nimport {\n MJConversationDetailAttachmentEntity,\n MJConversationDetailArtifactEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity,\n MJAIModalityEntity,\n MJAIAgentEntity,\n ArtifactMetadataEngine\n} from '@memberjunction/core-entities';\nimport {\n ConversationUtility,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n AttachmentContent,\n AttachmentType\n} from '@memberjunction/ai-core-plus';\nimport type { IAttachmentBlobStore } from '@memberjunction/ai-core-plus';\nimport { GraphQLAttachmentBlobStore } from './graphql-attachment-blob-store';\nimport { MessageAttachment } from '../components/message/message-item.component';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Service for managing conversation attachments.\n * Handles loading, saving, and converting attachments between different formats.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAttachmentService {\n /**\n * Where attachment bytes go when they are too large to store inline.\n *\n * Held directly rather than read off the shared `ConversationAttachmentService` in\n * `@memberjunction/aiengine`. That package's entry point imports Node's `crypto`\n * (`AIEngine.ts`, for an embedding-cache key), so a runtime import of it from here pulls the\n * whole server AI engine into Explorer's browser bundle and the build fails to resolve `crypto`.\n * The shared service is a server-side consumer of the same seam, not a dependency of this one.\n *\n * The seam's *type* used to be imported from there with `import type`, on the reasoning that an\n * erased import costs nothing. It does at runtime — but the class-registration manifest generator\n * walks **package.json**, so the declared dependency was a live edge regardless, and it later\n * carried `@memberjunction/storage`'s drivers into the browser manifest. Both the contract and\n * the placement policy (`ConversationUtility`) now come from `@memberjunction/ai-core-plus`, and\n * this package does not declare `aiengine` at all.\n */\n private readonly blobStore: IAttachmentBlobStore = new GraphQLAttachmentBlobStore();\n\n private _provider: IMetadataProvider | null = null;\n\n constructor() {}\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all attachments for a list of conversation detail IDs.\n * Returns a map of ConversationDetailID -> MessageAttachment[]\n */\n async LoadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n const result = new Map<string, MessageAttachment[]>();\n\n if (!conversationDetailIds || conversationDetailIds.length === 0) {\n return result;\n }\n\n try {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const idList = conversationDetailIds.map(id => `'${id}'`).join(',');\n\n // Load input artifacts (ConversationDetailArtifact with Direction='Input').\n // Since the backfill migration (V202605271400__Backfill_Attachment_Artifacts)\n // converted all legacy ConversationDetailAttachment rows to artifact pairs,\n // the artifact junction is the single source of truth — no separate attachment\n // query needed.\n const artifactLinksResult = await rv.RunView<MJConversationDetailArtifactEntity>({\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${idList}) AND Direction = 'Input'`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (artifactLinksResult.Success && artifactLinksResult.Results && artifactLinksResult.Results.length > 0) {\n // Load the referenced artifact versions AND their parent artifacts in parallel\n // so we can resolve the semantic artifact-type name for the tile badge.\n const versionIds = artifactLinksResult.Results.map(l => `'${l.ArtifactVersionID}'`).join(',');\n const versionsResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionIds})`,\n ResultType: 'entity_object'\n }, contextUser);\n\n if (versionsResult.Success && versionsResult.Results) {\n const versionMap = new Map<string, MJArtifactVersionEntity>();\n for (const v of versionsResult.Results) {\n versionMap.set(v.ID, v);\n }\n\n // Bulk-load parent artifacts to get TypeID, then resolve type names via cached engine.\n const artifactIds = Array.from(new Set(versionsResult.Results.map(v => v.ArtifactID).filter(Boolean)));\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactIdList = artifactIds.map(id => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIdList})`,\n ResultType: 'entity_object'\n }, contextUser);\n if (artifactsResult.Success && artifactsResult.Results) {\n for (const a of artifactsResult.Results) {\n artifactMap.set(a.ID, a);\n }\n }\n // Ensure the artifact-type cache is populated so FindArtifactTypeByID resolves.\n await ArtifactMetadataEngine.Instance.Config(false, contextUser);\n }\n\n for (const link of artifactLinksResult.Results) {\n const version = versionMap.get(link.ArtifactVersionID);\n if (version) {\n const parentArtifact = artifactMap.get(version.ArtifactID);\n const artifactType = parentArtifact\n ? ArtifactMetadataEngine.Instance.FindArtifactTypeByID(parentArtifact.TypeID)\n : undefined;\n const detailId = link.ConversationDetailID;\n if (!result.has(detailId)) {\n result.set(detailId, []);\n }\n result.get(detailId)!.push({\n id: link.ID,\n type: version.ContentMode === 'File' ? this.getMimeAttachmentType(version.MimeType || '') : 'Document',\n mimeType: version.MimeType || 'text/plain',\n fileName: version.FileName || version.Name || 'Artifact',\n sizeBytes: version.ContentSizeBytes || 0,\n source: 'artifact',\n artifactId: version.ArtifactID || undefined,\n artifactVersionId: version.ID,\n artifactTypeName: artifactType?.Name || undefined\n } as MessageAttachment);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error loading attachments:', error);\n }\n\n return result;\n }\n\n /** @deprecated Use {@link LoadAttachmentsForMessages}. */\n async loadAttachmentsForMessages(\n conversationDetailIds: string[],\n contextUser?: UserInfo\n ): Promise<Map<string, MessageAttachment[]>> {\n return this.LoadAttachmentsForMessages(conversationDetailIds, contextUser);\n }\n\n /**\n * Load attachments for a single message\n */\n async LoadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n const map = await this.LoadAttachmentsForMessages([conversationDetailId], contextUser);\n return map.get(conversationDetailId) || [];\n }\n\n /** @deprecated Use {@link LoadAttachmentsForMessage}. */\n async loadAttachmentsForMessage(\n conversationDetailId: string,\n contextUser?: UserInfo\n ): Promise<MessageAttachment[]> {\n return this.LoadAttachmentsForMessage(conversationDetailId, contextUser);\n }\n\n /**\n * Save pending attachments to the database.\n * Returns the saved attachment entities.\n *\n * @param conversationDetailId - ID of the conversation detail to attach to\n * @param pendingAttachments - Array of pending attachments from the mention editor\n * @param contextUser - User context for the operation\n * @param agent - The agent this turn is addressed to, when the caller has resolved one. Only its\n * `InlineStorageThresholdBytes` is read, and only to make the inline-vs-storage decision match\n * what the server would decide for the same file. Omitting it falls back to the system default,\n * which is correct for a turn with no agent — but a caller that HAS an agent and does not pass\n * it produces the cross-surface drift this shared policy exists to remove.\n */\n async SaveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n const savedAttachments: MJConversationDetailAttachmentEntity[] = [];\n const rejectionMessages: string[] = [];\n const md = this.Provider;\n\n for (let i = 0; i < pendingAttachments.length; i++) {\n const pending = pendingAttachments[i];\n\n try {\n const attachment = await md.GetEntityObject<MJConversationDetailAttachmentEntity>(\n 'MJ: Conversation Detail Attachments',\n contextUser\n );\n\n // Determine attachment type from MIME type\n const attachmentType = ConversationUtility.GetAttachmentTypeFromMime(pending.mimeType);\n\n attachment.ConversationDetailID = conversationDetailId;\n attachment.ModalityID = this.getModalityIdForType(attachmentType);\n attachment.MimeType = pending.mimeType;\n attachment.FileName = pending.fileName;\n attachment.FileSizeBytes = pending.sizeBytes;\n attachment.Width = pending.width ?? null;\n attachment.Height = pending.height ?? null;\n attachment.DurationSeconds = null; // PendingAttachment doesn't have duration\n attachment.DisplayOrder = i;\n attachment.ThumbnailBase64 = pending.thumbnailUrl ?? null;\n\n // For artifact references, create a ConversationDetailArtifact with Direction='Input'\n // instead of a ConversationDetailAttachment\n if (pending.source === 'artifact' && pending.artifactVersionId) {\n const artifactLink = await md.GetEntityObject<MJConversationDetailArtifactEntity>(\n 'MJ: Conversation Detail Artifacts',\n contextUser\n );\n artifactLink.ConversationDetailID = conversationDetailId;\n artifactLink.ArtifactVersionID = pending.artifactVersionId;\n artifactLink.Direction = 'Input';\n const artifactSaved = await artifactLink.Save();\n if (!artifactSaved) {\n console.error('Failed to save artifact input link:', artifactLink.LatestResult);\n }\n continue; // Skip creating a ConversationDetailAttachment for artifacts\n }\n\n // Storage placement is NOT this service's decision. `ConversationUtility.ShouldStoreInline`\n // owns it — honouring an agent's `InlineStorageThresholdBytes` before the system default —\n // and it is the same call the server and the mobile app make. This service previously set\n // `InlineData` unconditionally, so a large image went into a database column instead of\n // MJStorage, contradicting the entity's own contract that the two are mutually exclusive\n // and sized.\n if (pending.dataUrl) {\n const base64Data = this.extractBase64FromDataUrl(pending.dataUrl);\n const storeInline = ConversationUtility.ShouldStoreInline(\n pending.sizeBytes,\n agent?.InlineStorageThresholdBytes ?? null,\n DEFAULT_INLINE_STORAGE_THRESHOLD_BYTES,\n );\n\n if (storeInline) {\n attachment.InlineData = base64Data;\n } else {\n const stored = await this.blobStore.Upload(\n { FileName: pending.fileName, MimeType: pending.mimeType, Base64Data: base64Data },\n contextUser ?? md.CurrentUser,\n md,\n );\n if (!stored?.Success || !stored.FileID) {\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" is too large to store inline and could not be uploaded: ${stored?.Error ?? 'storage is not available.'}`,\n );\n continue;\n }\n attachment.FileID = stored.FileID;\n }\n }\n\n const saved = await attachment.Save();\n if (saved) {\n savedAttachments.push(attachment);\n } else {\n const message = attachment.LatestResult?.CompleteMessage\n ?? `Attachment \"${pending.fileName}\" was rejected by the server.`;\n console.error('Failed to save attachment:', attachment.LatestResult);\n rejectionMessages.push(message);\n }\n } catch (error) {\n console.error('Error saving attachment:', error);\n rejectionMessages.push(\n `Attachment \"${pending.fileName}\" failed to upload: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n // Surface server-side rejections (e.g. unregistered MIME types) to the\n // caller — throwing here lets the message-input toast pipeline display\n // the actual server message rather than silently dropping the file.\n if (rejectionMessages.length > 0) {\n throw new Error(rejectionMessages.join('\\n'));\n }\n\n return savedAttachments;\n }\n\n /** @deprecated Use {@link SaveAttachments}. */\n async saveAttachments(\n conversationDetailId: string,\n pendingAttachments: PendingAttachment[],\n contextUser?: UserInfo,\n agent?: MJAIAgentEntity | null\n ): Promise<MJConversationDetailAttachmentEntity[]> {\n return this.SaveAttachments(conversationDetailId, pendingAttachments, contextUser, agent);\n }\n\n /**\n * Create attachment reference tokens for message text.\n * These tokens are stored in the Message field to reference attachments.\n */\n CreateAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return attachments\n .map(att => {\n const content: AttachmentContent = {\n _mode: 'attachment',\n id: att.ID,\n type: this.getAttachmentTypeFromModality(att.ModalityID),\n mimeType: att.MimeType,\n fileName: att.FileName ?? undefined,\n sizeBytes: att.FileSizeBytes,\n width: att.Width ?? undefined,\n height: att.Height ?? undefined,\n durationSeconds: att.DurationSeconds ?? undefined,\n thumbnailBase64: att.ThumbnailBase64 ?? undefined\n };\n return ConversationUtility.CreateAttachmentReference(content);\n })\n .join(' ');\n }\n\n /** @deprecated Use {@link CreateAttachmentReferences}. */\n createAttachmentReferences(attachments: MJConversationDetailAttachmentEntity[]): string {\n return this.CreateAttachmentReferences(attachments);\n }\n\n /**\n * Convert a database entity to a MessageAttachment for display\n */\n private convertToMessageAttachment(entity: MJConversationDetailAttachmentEntity): MessageAttachment {\n // Determine content URL\n let contentUrl: string | undefined;\n let thumbnailUrl: string | undefined;\n\n if (entity.InlineData) {\n // Create data URL from inline data\n contentUrl = `data:${entity.MimeType};base64,${entity.InlineData}`;\n } else if (entity.FileID) {\n // TODO: Integrate with MJStorage to get pre-authenticated URL\n contentUrl = undefined; // Will need to be loaded separately\n }\n\n // Use thumbnail if available\n if (entity.ThumbnailBase64) {\n thumbnailUrl = entity.ThumbnailBase64.startsWith('data:')\n ? entity.ThumbnailBase64\n : `data:image/jpeg;base64,${entity.ThumbnailBase64}`;\n }\n\n return {\n id: entity.ID,\n type: this.getAttachmentTypeFromModality(entity.ModalityID),\n mimeType: entity.MimeType,\n fileName: entity.FileName,\n sizeBytes: entity.FileSizeBytes,\n width: entity.Width ?? undefined,\n height: entity.Height ?? undefined,\n thumbnailUrl: thumbnailUrl,\n contentUrl: contentUrl\n };\n }\n\n /**\n * Get the AttachmentType from a modality ID\n */\n private getAttachmentTypeFromModality(modalityId: string): AttachmentType {\n const modality = AIEngineBase.Instance.Modalities.find(m => UUIDsEqual(m.ID, modalityId))\n\n const name = modality?.Name?.toLowerCase() || '';\n\n if (name === 'image') return 'Image';\n if (name === 'video') return 'Video';\n if (name === 'audio') return 'Audio';\n\n return 'Document';\n }\n\n /**\n * Get the AttachmentType from a MIME type string\n */\n private getMimeAttachmentType(mimeType: string): 'Image' | 'Video' | 'Audio' | 'Document' {\n if (mimeType.startsWith('image/')) return 'Image';\n if (mimeType.startsWith('video/')) return 'Video';\n if (mimeType.startsWith('audio/')) return 'Audio';\n return 'Document';\n }\n\n /**\n * Get the modality ID for an attachment type\n */\n private getModalityIdForType(type: AttachmentType): string {\n // Map AttachmentType to modality name\n // AttachmentType is 'Image' | 'Video' | 'Audio' | 'Document'\n // Modality names are 'Image', 'Audio', 'Video', 'File'\n let modalityName = type.toLowerCase().trim();\n if (modalityName === 'document') {\n modalityName = 'file';\n }\n\n const modality = AIEngineBase.Instance.Modalities.find(m => m.Name?.trim().toLowerCase() === modalityName);\n if (modality) {\n return modality.ID;\n }\n\n // Fallback to 'file' modality if specific type not found\n // recursive call, so long as the current modality isn't file as that\n // would cause infinite recursion/stack overflow\n if (modalityName !== 'file') {\n return this.getModalityIdForType('Document');\n }\n else {\n return '';\n }\n }\n \n /**\n * Extract base64 data from a data URL\n */\n private extractBase64FromDataUrl(dataUrl: string): string {\n const matches = dataUrl.match(/^data:[^;]+;base64,(.+)$/);\n return matches ? matches[1] : dataUrl;\n }\n\n /**\n * Create a thumbnail from an image file.\n * Returns a base64 data URL of the thumbnail.\n */\n async CreateThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement('canvas');\n let width = img.width;\n let height = img.height;\n\n // Scale down to maxSize\n if (width > height) {\n if (width > maxSize) {\n height = Math.round((height * maxSize) / width);\n width = maxSize;\n }\n } else {\n if (height > maxSize) {\n width = Math.round((width * maxSize) / height);\n height = maxSize;\n }\n }\n\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(img, 0, 0, width, height);\n resolve(canvas.toDataURL('image/jpeg', 0.7));\n } else {\n resolve(null);\n }\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /** @deprecated Use {@link CreateThumbnail}. */\n async createThumbnail(\n file: File,\n maxSize: number = 200\n ): Promise<string | null> {\n return this.CreateThumbnail(file, maxSize);\n }\n\n /**\n * Get image dimensions from a file\n */\n async GetImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return new Promise((resolve) => {\n if (!file.type.startsWith('image/')) {\n resolve(null);\n return;\n }\n\n const reader = new FileReader();\n reader.onload = (e) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.width, height: img.height });\n };\n img.onerror = () => resolve(null);\n img.src = e.target?.result as string;\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /** @deprecated Use {@link GetImageDimensions}. */\n async getImageDimensions(file: File): Promise<{ width: number; height: number } | null> {\n return this.GetImageDimensions(file);\n }\n\n /**\n * Process a file and create a PendingAttachment.\n * This creates the data structure needed for the mention editor component.\n */\n async ProcessFile(file: File): Promise<PendingAttachment> {\n // Read file data URL\n const dataUrl = await this.fileToDataUrl(file);\n\n const pending: PendingAttachment = {\n id: this.generateTempId(),\n file: file,\n dataUrl: dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size\n };\n\n // Get image dimensions and create thumbnail\n const type = ConversationUtility.GetAttachmentTypeFromMime(file.type);\n if (type === 'Image') {\n const dimensions = await this.GetImageDimensions(file);\n if (dimensions) {\n pending.width = dimensions.width;\n pending.height = dimensions.height;\n }\n\n const thumbnail = await this.CreateThumbnail(file);\n if (thumbnail) {\n pending.thumbnailUrl = thumbnail;\n }\n }\n\n return pending;\n }\n\n /** @deprecated Use {@link ProcessFile}. */\n async processFile(file: File): Promise<PendingAttachment> {\n return this.ProcessFile(file);\n }\n\n /**\n * Convert a file to a data URL\n */\n private fileToDataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Generate a temporary ID for pending attachments\n */\n private generateTempId(): string {\n return `temp-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Translates browser events into liveness signals for the framework-agnostic
|
|
5
|
+
* `ConversationLiveness` supervisor in `@memberjunction/conversations-runtime` (MJ #4222).
|
|
6
|
+
*
|
|
7
|
+
* WHY THE SPLIT. The supervisor lives at L0 because that package already depends on
|
|
8
|
+
* `@memberjunction/graphql-dataprovider` and has no Angular dependency — and because the
|
|
9
|
+
* obvious alternative is closed to us: Explorer's `ServerConnectivityService` does almost
|
|
10
|
+
* exactly this, but `@memberjunction/ng-conversations` declares `"mjUILayer": "widgets"`, and
|
|
11
|
+
* `packages/Standards/src/checks/ui-layers.ts` forbids that layer from importing any
|
|
12
|
+
* `ng-explorer*` package at severity `error`. L0 cannot own the DOM half either: the runtime is
|
|
13
|
+
* documented as Node-consumable, so `document` and `window` may not exist there. Hence this thin
|
|
14
|
+
* Angular-side adapter, which is the only piece that touches the DOM.
|
|
15
|
+
*
|
|
16
|
+
* WHAT THE SIGNALS MEAN. Neither event proves anything is reachable — `navigator.onLine` reads
|
|
17
|
+
* true behind a captive portal or a dead VPN, and a tab regaining focus says nothing about the
|
|
18
|
+
* server. They are prompts to re-check, and the supervisor coalesces them with the transport-level
|
|
19
|
+
* signals before anyone acts.
|
|
20
|
+
*
|
|
21
|
+
* Root-provided so one instance serves every chat area; several open conversations must not each
|
|
22
|
+
* raise their own reconciliation for the same lid-open.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ConversationLivenessDomService implements OnDestroy {
|
|
25
|
+
/**
|
|
26
|
+
* Stored bound references — `removeEventListener` only detaches a listener when handed the
|
|
27
|
+
* same function object `addEventListener` received. Matches the pattern already used for the
|
|
28
|
+
* resize handlers in `conversation-chat-area.component.ts` and in
|
|
29
|
+
* `packages/Angular/Generic/shared/src/lib/theme.service.ts`.
|
|
30
|
+
*/
|
|
31
|
+
private boundVisibilityHandler;
|
|
32
|
+
private boundOnlineHandler;
|
|
33
|
+
private started;
|
|
34
|
+
/** Begin translating DOM events into liveness signals. Idempotent. */
|
|
35
|
+
Start(): void;
|
|
36
|
+
/** Detach both listeners. Safe to call when never started. */
|
|
37
|
+
Stop(): void;
|
|
38
|
+
ngOnDestroy(): void;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationLivenessDomService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConversationLivenessDomService>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=conversation-liveness-dom.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-liveness-dom.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-liveness-dom.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;;AAGtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,8BAA+B,YAAW,SAAS;IAC5D;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB,CAA6B;IAC3D,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,OAAO,CAAS;IAExB,sEAAsE;IAC/D,KAAK,IAAI,IAAI;IAmBpB,8DAA8D;IACvD,IAAI,IAAI,IAAI;IAYZ,WAAW,IAAI,IAAI;yCA5CjB,8BAA8B;6CAA9B,8BAA8B;CA+C1C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ConversationsRuntime } from '@memberjunction/conversations-runtime';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Translates browser events into liveness signals for the framework-agnostic
|
|
6
|
+
* `ConversationLiveness` supervisor in `@memberjunction/conversations-runtime` (MJ #4222).
|
|
7
|
+
*
|
|
8
|
+
* WHY THE SPLIT. The supervisor lives at L0 because that package already depends on
|
|
9
|
+
* `@memberjunction/graphql-dataprovider` and has no Angular dependency — and because the
|
|
10
|
+
* obvious alternative is closed to us: Explorer's `ServerConnectivityService` does almost
|
|
11
|
+
* exactly this, but `@memberjunction/ng-conversations` declares `"mjUILayer": "widgets"`, and
|
|
12
|
+
* `packages/Standards/src/checks/ui-layers.ts` forbids that layer from importing any
|
|
13
|
+
* `ng-explorer*` package at severity `error`. L0 cannot own the DOM half either: the runtime is
|
|
14
|
+
* documented as Node-consumable, so `document` and `window` may not exist there. Hence this thin
|
|
15
|
+
* Angular-side adapter, which is the only piece that touches the DOM.
|
|
16
|
+
*
|
|
17
|
+
* WHAT THE SIGNALS MEAN. Neither event proves anything is reachable — `navigator.onLine` reads
|
|
18
|
+
* true behind a captive portal or a dead VPN, and a tab regaining focus says nothing about the
|
|
19
|
+
* server. They are prompts to re-check, and the supervisor coalesces them with the transport-level
|
|
20
|
+
* signals before anyone acts.
|
|
21
|
+
*
|
|
22
|
+
* Root-provided so one instance serves every chat area; several open conversations must not each
|
|
23
|
+
* raise their own reconciliation for the same lid-open.
|
|
24
|
+
*/
|
|
25
|
+
export class ConversationLivenessDomService {
|
|
26
|
+
/**
|
|
27
|
+
* Stored bound references — `removeEventListener` only detaches a listener when handed the
|
|
28
|
+
* same function object `addEventListener` received. Matches the pattern already used for the
|
|
29
|
+
* resize handlers in `conversation-chat-area.component.ts` and in
|
|
30
|
+
* `packages/Angular/Generic/shared/src/lib/theme.service.ts`.
|
|
31
|
+
*/
|
|
32
|
+
boundVisibilityHandler = null;
|
|
33
|
+
boundOnlineHandler = null;
|
|
34
|
+
started = false;
|
|
35
|
+
/** Begin translating DOM events into liveness signals. Idempotent. */
|
|
36
|
+
Start() {
|
|
37
|
+
if (this.started || typeof document === 'undefined' || typeof window === 'undefined') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.boundVisibilityHandler = () => {
|
|
41
|
+
// Only the hidden → visible edge matters. A tab going away needs no reconciliation,
|
|
42
|
+
// and signalling on both edges would double every recovery.
|
|
43
|
+
if (!document.hidden) {
|
|
44
|
+
ConversationsRuntime.Instance.Liveness.NotifyTabVisible();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
this.boundOnlineHandler = () => ConversationsRuntime.Instance.Liveness.NotifyBrowserOnline();
|
|
48
|
+
document.addEventListener('visibilitychange', this.boundVisibilityHandler);
|
|
49
|
+
window.addEventListener('online', this.boundOnlineHandler);
|
|
50
|
+
this.started = true;
|
|
51
|
+
}
|
|
52
|
+
/** Detach both listeners. Safe to call when never started. */
|
|
53
|
+
Stop() {
|
|
54
|
+
if (this.boundVisibilityHandler && typeof document !== 'undefined') {
|
|
55
|
+
document.removeEventListener('visibilitychange', this.boundVisibilityHandler);
|
|
56
|
+
this.boundVisibilityHandler = null;
|
|
57
|
+
}
|
|
58
|
+
if (this.boundOnlineHandler && typeof window !== 'undefined') {
|
|
59
|
+
window.removeEventListener('online', this.boundOnlineHandler);
|
|
60
|
+
this.boundOnlineHandler = null;
|
|
61
|
+
}
|
|
62
|
+
this.started = false;
|
|
63
|
+
}
|
|
64
|
+
ngOnDestroy() {
|
|
65
|
+
this.Stop();
|
|
66
|
+
}
|
|
67
|
+
static ɵfac = function ConversationLivenessDomService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConversationLivenessDomService)(); };
|
|
68
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConversationLivenessDomService, factory: ConversationLivenessDomService.ɵfac, providedIn: 'root' });
|
|
69
|
+
}
|
|
70
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConversationLivenessDomService, [{
|
|
71
|
+
type: Injectable,
|
|
72
|
+
args: [{ providedIn: 'root' }]
|
|
73
|
+
}], null, null); })();
|
|
74
|
+
//# sourceMappingURL=conversation-liveness-dom.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-liveness-dom.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-liveness-dom.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;;AAE7E;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,OAAO,8BAA8B;IACvC;;;;;OAKG;IACK,sBAAsB,GAAwB,IAAI,CAAC;IACnD,kBAAkB,GAAwB,IAAI,CAAC;IAC/C,OAAO,GAAG,KAAK,CAAC;IAExB,sEAAsE;IAC/D,KAAK;QACR,IAAI,IAAI,CAAC,OAAO,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YACnF,OAAO;QACX,CAAC;QAED,IAAI,CAAC,sBAAsB,GAAG,GAAG,EAAE;YAC/B,oFAAoF;YACpF,4DAA4D;YAC5D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACnB,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YAC9D,CAAC;QACL,CAAC,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC;QAE7F,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAC3E,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,8DAA8D;IACvD,IAAI;QACP,IAAI,IAAI,CAAC,sBAAsB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;YACjE,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAC9E,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,kBAAkB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3D,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC9D,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAEM,WAAW;QACd,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;wHA9CQ,8BAA8B;gEAA9B,8BAA8B,WAA9B,8BAA8B,mBADjB,MAAM;;iFACnB,8BAA8B;cAD1C,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\n\n/**\n * Translates browser events into liveness signals for the framework-agnostic\n * `ConversationLiveness` supervisor in `@memberjunction/conversations-runtime` (MJ #4222).\n *\n * WHY THE SPLIT. The supervisor lives at L0 because that package already depends on\n * `@memberjunction/graphql-dataprovider` and has no Angular dependency — and because the\n * obvious alternative is closed to us: Explorer's `ServerConnectivityService` does almost\n * exactly this, but `@memberjunction/ng-conversations` declares `\"mjUILayer\": \"widgets\"`, and\n * `packages/Standards/src/checks/ui-layers.ts` forbids that layer from importing any\n * `ng-explorer*` package at severity `error`. L0 cannot own the DOM half either: the runtime is\n * documented as Node-consumable, so `document` and `window` may not exist there. Hence this thin\n * Angular-side adapter, which is the only piece that touches the DOM.\n *\n * WHAT THE SIGNALS MEAN. Neither event proves anything is reachable — `navigator.onLine` reads\n * true behind a captive portal or a dead VPN, and a tab regaining focus says nothing about the\n * server. They are prompts to re-check, and the supervisor coalesces them with the transport-level\n * signals before anyone acts.\n *\n * Root-provided so one instance serves every chat area; several open conversations must not each\n * raise their own reconciliation for the same lid-open.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConversationLivenessDomService implements OnDestroy {\n /**\n * Stored bound references — `removeEventListener` only detaches a listener when handed the\n * same function object `addEventListener` received. Matches the pattern already used for the\n * resize handlers in `conversation-chat-area.component.ts` and in\n * `packages/Angular/Generic/shared/src/lib/theme.service.ts`.\n */\n private boundVisibilityHandler: (() => void) | null = null;\n private boundOnlineHandler: (() => void) | null = null;\n private started = false;\n\n /** Begin translating DOM events into liveness signals. Idempotent. */\n public Start(): void {\n if (this.started || typeof document === 'undefined' || typeof window === 'undefined') {\n return;\n }\n\n this.boundVisibilityHandler = () => {\n // Only the hidden → visible edge matters. A tab going away needs no reconciliation,\n // and signalling on both edges would double every recovery.\n if (!document.hidden) {\n ConversationsRuntime.Instance.Liveness.NotifyTabVisible();\n }\n };\n this.boundOnlineHandler = () => ConversationsRuntime.Instance.Liveness.NotifyBrowserOnline();\n\n document.addEventListener('visibilitychange', this.boundVisibilityHandler);\n window.addEventListener('online', this.boundOnlineHandler);\n this.started = true;\n }\n\n /** Detach both listeners. Safe to call when never started. */\n public Stop(): void {\n if (this.boundVisibilityHandler && typeof document !== 'undefined') {\n document.removeEventListener('visibilitychange', this.boundVisibilityHandler);\n this.boundVisibilityHandler = null;\n }\n if (this.boundOnlineHandler && typeof window !== 'undefined') {\n window.removeEventListener('online', this.boundOnlineHandler);\n this.boundOnlineHandler = null;\n }\n this.started = false;\n }\n\n public ngOnDestroy(): void {\n this.Stop();\n }\n}\n"]}
|
|
@@ -19,18 +19,40 @@ export declare class ConversationStreamingService implements OnDestroy {
|
|
|
19
19
|
constructor(_bootstrap: ConversationsRuntimeBootstrap);
|
|
20
20
|
private get streaming();
|
|
21
21
|
/** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */
|
|
22
|
+
get CompletionEvents$(): Subject<CompletionEvent>;
|
|
23
|
+
/** @deprecated Use {@link CompletionEvents$}. */
|
|
22
24
|
get completionEvents$(): Subject<CompletionEvent>;
|
|
23
25
|
initialize(): void;
|
|
26
|
+
GetConnectionStatus$(): Observable<StreamingConnectionStatus>;
|
|
27
|
+
/** @deprecated Use {@link GetConnectionStatus$}. */
|
|
24
28
|
getConnectionStatus$(): Observable<StreamingConnectionStatus>;
|
|
29
|
+
GetConnectionStatus(): StreamingConnectionStatus;
|
|
30
|
+
/** @deprecated Use {@link GetConnectionStatus}. */
|
|
25
31
|
getConnectionStatus(): StreamingConnectionStatus;
|
|
32
|
+
RegisterMessageCallback(conversationDetailId: string, callback: MessageProgressCallback): void;
|
|
33
|
+
/** @deprecated Use {@link RegisterMessageCallback}. */
|
|
26
34
|
registerMessageCallback(conversationDetailId: string, callback: MessageProgressCallback): void;
|
|
35
|
+
UnregisterMessageCallback(conversationDetailId: string, callback?: MessageProgressCallback): void;
|
|
36
|
+
/** @deprecated Use {@link UnregisterMessageCallback}. */
|
|
27
37
|
unregisterMessageCallback(conversationDetailId: string, callback?: MessageProgressCallback): void;
|
|
38
|
+
GetRegisteredCallbackCount(): number;
|
|
39
|
+
/** @deprecated Use {@link GetRegisteredCallbackCount}. */
|
|
28
40
|
getRegisteredCallbackCount(): number;
|
|
41
|
+
GetTrackedMessageCount(): number;
|
|
42
|
+
/** @deprecated Use {@link GetTrackedMessageCount}. */
|
|
29
43
|
getTrackedMessageCount(): number;
|
|
44
|
+
GetRecentCompletion(conversationDetailId: string): {
|
|
45
|
+
agentRunId: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
/** @deprecated Use {@link GetRecentCompletion}. */
|
|
30
48
|
getRecentCompletion(conversationDetailId: string): {
|
|
31
49
|
agentRunId: string;
|
|
32
50
|
} | undefined;
|
|
51
|
+
ClearRecentCompletion(conversationDetailId: string): void;
|
|
52
|
+
/** @deprecated Use {@link ClearRecentCompletion}. */
|
|
33
53
|
clearRecentCompletion(conversationDetailId: string): void;
|
|
54
|
+
GetDiagnosticSnapshot(messageId: string): ReturnType<typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot>;
|
|
55
|
+
/** @deprecated Use {@link GetDiagnosticSnapshot}. */
|
|
34
56
|
getDiagnosticSnapshot(messageId: string): ReturnType<typeof ConversationsRuntime.Instance.Streaming.getDiagnosticSnapshot>;
|
|
35
57
|
/**
|
|
36
58
|
* Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-streaming.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EACH,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EACjC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;;AAG1F,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,GAC5B,CAAC;AAEF,qBACa,4BAA6B,YAAW,SAAS;gBAC9C,UAAU,EAAE,6BAA6B;IAIrD,OAAO,KAAK,SAAS,GAEpB;IAED,yFAAyF;IACzF,IAAW,iBAAiB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEvD;IAEM,UAAU,IAAI,IAAI;IAIlB,oBAAoB,IAAI,UAAU,CAAC,yBAAyB,CAAC;IAI7D,mBAAmB,IAAI,yBAAyB;IAIhD,uBAAuB,CAC1B,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,uBAAuB,GAClC,IAAI;IAIA,yBAAyB,CAC5B,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,CAAC,EAAE,uBAAuB,GACnC,IAAI;IAIA,0BAA0B,IAAI,MAAM;IAIpC,sBAAsB,IAAI,MAAM;IAIhC,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAIrF,qBAAqB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAIzD,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CACvD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CACvE;IAID;;;;;OAKG;IACI,WAAW,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"conversation-streaming.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-streaming.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EACH,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EACjC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;;AAG1F,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,GAC5B,CAAC;AAEF,qBACa,4BAA6B,YAAW,SAAS;gBAC9C,UAAU,EAAE,6BAA6B;IAIrD,OAAO,KAAK,SAAS,GAEpB;IAED,yFAAyF;IACzF,IAAW,iBAAiB,IAAI,OAAO,CAAC,eAAe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C,SAAS,CAAC,qBAAqB,CACvE;IAID,qDAAqD;IAC9C,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CACvD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CACvE;IAID;;;;;OAKG;IACI,WAAW,IAAI,IAAI;yCA9HjB,4BAA4B;6CAA5B,4BAA4B;CAiIxC"}
|
|
@@ -21,39 +21,79 @@ export class ConversationStreamingService {
|
|
|
21
21
|
return ConversationsRuntime.Instance.Streaming;
|
|
22
22
|
}
|
|
23
23
|
/** Pass-through to {@link ConversationsRuntime.Instance.Streaming.completionEvents$}. */
|
|
24
|
-
get
|
|
24
|
+
get CompletionEvents$() {
|
|
25
25
|
return this.streaming.completionEvents$;
|
|
26
26
|
}
|
|
27
|
+
/** @deprecated Use {@link CompletionEvents$}. */
|
|
28
|
+
get completionEvents$() {
|
|
29
|
+
return this.CompletionEvents$;
|
|
30
|
+
}
|
|
27
31
|
initialize() {
|
|
28
32
|
this.streaming.initialize();
|
|
29
33
|
}
|
|
30
|
-
|
|
34
|
+
GetConnectionStatus$() {
|
|
31
35
|
return this.streaming.getConnectionStatus$();
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
/** @deprecated Use {@link GetConnectionStatus$}. */
|
|
38
|
+
getConnectionStatus$() {
|
|
39
|
+
return this.GetConnectionStatus$();
|
|
40
|
+
}
|
|
41
|
+
GetConnectionStatus() {
|
|
34
42
|
return this.streaming.getConnectionStatus();
|
|
35
43
|
}
|
|
36
|
-
|
|
44
|
+
/** @deprecated Use {@link GetConnectionStatus}. */
|
|
45
|
+
getConnectionStatus() {
|
|
46
|
+
return this.GetConnectionStatus();
|
|
47
|
+
}
|
|
48
|
+
RegisterMessageCallback(conversationDetailId, callback) {
|
|
37
49
|
this.streaming.registerMessageCallback(conversationDetailId, callback);
|
|
38
50
|
}
|
|
39
|
-
|
|
51
|
+
/** @deprecated Use {@link RegisterMessageCallback}. */
|
|
52
|
+
registerMessageCallback(conversationDetailId, callback) {
|
|
53
|
+
return this.RegisterMessageCallback(conversationDetailId, callback);
|
|
54
|
+
}
|
|
55
|
+
UnregisterMessageCallback(conversationDetailId, callback) {
|
|
40
56
|
this.streaming.unregisterMessageCallback(conversationDetailId, callback);
|
|
41
57
|
}
|
|
42
|
-
|
|
58
|
+
/** @deprecated Use {@link UnregisterMessageCallback}. */
|
|
59
|
+
unregisterMessageCallback(conversationDetailId, callback) {
|
|
60
|
+
return this.UnregisterMessageCallback(conversationDetailId, callback);
|
|
61
|
+
}
|
|
62
|
+
GetRegisteredCallbackCount() {
|
|
43
63
|
return this.streaming.getRegisteredCallbackCount();
|
|
44
64
|
}
|
|
45
|
-
|
|
65
|
+
/** @deprecated Use {@link GetRegisteredCallbackCount}. */
|
|
66
|
+
getRegisteredCallbackCount() {
|
|
67
|
+
return this.GetRegisteredCallbackCount();
|
|
68
|
+
}
|
|
69
|
+
GetTrackedMessageCount() {
|
|
46
70
|
return this.streaming.getTrackedMessageCount();
|
|
47
71
|
}
|
|
48
|
-
|
|
72
|
+
/** @deprecated Use {@link GetTrackedMessageCount}. */
|
|
73
|
+
getTrackedMessageCount() {
|
|
74
|
+
return this.GetTrackedMessageCount();
|
|
75
|
+
}
|
|
76
|
+
GetRecentCompletion(conversationDetailId) {
|
|
49
77
|
return this.streaming.getRecentCompletion(conversationDetailId);
|
|
50
78
|
}
|
|
51
|
-
|
|
79
|
+
/** @deprecated Use {@link GetRecentCompletion}. */
|
|
80
|
+
getRecentCompletion(conversationDetailId) {
|
|
81
|
+
return this.GetRecentCompletion(conversationDetailId);
|
|
82
|
+
}
|
|
83
|
+
ClearRecentCompletion(conversationDetailId) {
|
|
52
84
|
this.streaming.clearRecentCompletion(conversationDetailId);
|
|
53
85
|
}
|
|
54
|
-
|
|
86
|
+
/** @deprecated Use {@link ClearRecentCompletion}. */
|
|
87
|
+
clearRecentCompletion(conversationDetailId) {
|
|
88
|
+
return this.ClearRecentCompletion(conversationDetailId);
|
|
89
|
+
}
|
|
90
|
+
GetDiagnosticSnapshot(messageId) {
|
|
55
91
|
return this.streaming.getDiagnosticSnapshot(messageId);
|
|
56
92
|
}
|
|
93
|
+
/** @deprecated Use {@link GetDiagnosticSnapshot}. */
|
|
94
|
+
getDiagnosticSnapshot(messageId) {
|
|
95
|
+
return this.GetDiagnosticSnapshot(messageId);
|
|
96
|
+
}
|
|
57
97
|
/**
|
|
58
98
|
* Angular OnDestroy hook. We do NOT call the runtime's Streaming.Dispose()
|
|
59
99
|
* here — that would tear down a shared singleton on a per-injector destroy,
|