@memberjunction/ng-conversations 6.1.4 → 6.2.0-edge.1
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 +36 -3
- 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 +1090 -123
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +2407 -731
- 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 +40 -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 +72 -14
- 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 +37 -5
- package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.js +82 -16
- 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 +549 -74
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +1250 -421
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +411 -29
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +896 -222
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +288 -29
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +561 -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/channels/channel-onboarding-panel.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +3 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts +2 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.js +1 -1
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +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-agent-banner.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +3 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +26 -8
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +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 +4 -4
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +19 -19
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +2 -3
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js +3 -2
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +17 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.js +122 -45
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -31
- 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 +138 -124
- 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 +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- 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 +2 -2
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +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/remote-browser/remote-browser-channel.d.ts +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +4 -2
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +7 -3
- 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 +887 -291
- 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/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.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 +103 -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/browser-realtime-media-host.d.ts +24 -0
- package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -0
- package/dist/lib/services/browser-realtime-media-host.js +95 -0
- package/dist/lib/services/browser-realtime-media-host.js.map +1 -0
- 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 +26 -4
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +57 -18
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +41 -2
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js +80 -13
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- 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/graphql-attachment-blob-store.d.ts +44 -0
- package/dist/lib/services/graphql-attachment-blob-store.d.ts.map +1 -0
- package/dist/lib/services/graphql-attachment-blob-store.js +113 -0
- package/dist/lib/services/graphql-attachment-blob-store.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +17 -141
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +15 -460
- package/dist/lib/services/mention-autocomplete.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/realtime-session-review.service.d.ts +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +1 -1
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +16 -1150
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +28 -2430
- package/dist/lib/services/realtime-session.service.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 +16 -2
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +36 -8
- 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 +69 -0
- package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
- package/dist/lib/utils/agent-turn-routing.js +96 -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/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/lib/utils/realtime-session-timeline.d.ts +8 -79
- package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -1
- package/dist/lib/utils/realtime-session-timeline.js +8 -89
- package/dist/lib/utils/realtime-session-timeline.js.map +1 -1
- package/dist/public-api.d.ts +5 -2
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +9 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +33 -32
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +0 -384
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +0 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +0 -231
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +0 -1
- package/dist/lib/services/delegation-result-parser.d.ts +0 -50
- package/dist/lib/services/delegation-result-parser.d.ts.map +0 -1
- package/dist/lib/services/delegation-result-parser.js +0 -60
- package/dist/lib/services/delegation-result-parser.js.map +0 -1
- package/dist/lib/services/narration-template.d.ts +0 -42
- package/dist/lib/services/narration-template.d.ts.map +0 -1
- package/dist/lib/services/narration-template.js +0 -73
- package/dist/lib/services/narration-template.js.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.d.ts +0 -13
- package/dist/lib/services/skill-picker-narrowing.d.ts.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.js +0 -13
- package/dist/lib/services/skill-picker-narrowing.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-chat-area.component.js","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-chat-area.component.ts","../../../../src/lib/components/conversation/conversation-chat-area.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAwC,SAAS,EAAE,YAAY,EAAa,eAAe,EAA6C,MAAM,EAAE,MAAM,eAAe,CAAC;AACrN,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAY,OAAO,EAAsB,YAAY,EAAE,WAAW,EAAqD,MAAM,sBAAsB,CAAC;AAC3J,OAAO,EAAwG,sBAAsB,EAAE,kBAAkB,EAAwD,MAAM,+BAA+B,CAAC;AACvP,OAAO,EAAuG,mBAAmB,EAAuB,MAAM,8BAA8B,CAAC;AAE7L,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAI9D,OAAO,EACL,6BAA6B,EAE9B,MAAM,iDAAiD,CAAC;AAGzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAGzF,OAAO,EAAE,gCAAgC,EAAwB,MAAM,yCAAyC,CAAC;AAKjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAA0E,MAA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AAe;mBAAC,iBAAiB;;kBA2OjC,SAAS;mBAAC,oBAAoB;;kFAt3BpB,6BAA6B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, ViewChildren, QueryList, ContentChildren, TemplateRef, ElementRef, AfterViewChecked, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { UserInfo, RunView, RunQuery, Metadata, CompositeKey, LogStatusEx, TransformSimpleObjectToEntityObject, DataSnapshot } from '@memberjunction/core';\nimport { MJConversationEntity, MJConversationDetailEntity, MJAIAgentRunEntity, MJArtifactEntity, MJTaskEntity, ArtifactMetadataEngine, ConversationEngine, ConversationDetailComplete, RatingJSON, ArtifactJSON } from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended, CaptureDataSnapshotCommand, AppContextSnapshot, ConversationUtility, OpenResourceCommand } from \"@memberjunction/ai-core-plus\";\nimport { ActionableCommandRequest, UICommandHandlerService } from '../../services/ui-command-handler.service';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { AgentStateService } from '../../services/agent-state.service';\nimport { ConversationAgentService } from '../../services/conversation-agent.service';\nimport {\n ConversationDetailWindowStore,\n ConversationDetailWindowSnapshot\n} from '../../services/conversation-detail-window.store';\nimport { ActiveTasksService } from '../../services/active-tasks.service';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { MentionAutocompleteService } from '../../services/mention-autocomplete.service';\nimport { ArtifactPermissionService } from '../../services/artifact-permission.service';\nimport { ConversationAttachmentService } from '../../services/conversation-attachment.service';\nimport { MJResourcePermissionShareAdapter, ResourceShareContext } from '@memberjunction/ng-resource-permissions';\n\n/** `MJ: Resource Types.ID` for Conversations. */\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nimport { MessageAttachment } from '../message/message-item.component';\nimport { LazyArtifactInfo } from '../../models/lazy-artifact-info';\nimport { MessageInputComponent } from '../message/message-input.component';\nimport { ArtifactViewerPanelComponent, NavigationRequest, AnalyzeArtifactService, InteractiveFormApplyService } from '@memberjunction/ng-artifacts';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { ComposerDraftStore } from '../../services/composer-draft-store';\nimport { ConversationEmptyStateComponent } from './conversation-empty-state.component';\nimport { TestFeedbackDialogData, TestFeedbackDialogResult } from '@memberjunction/ng-testing';\nimport { DialogService as ConversationsDialogService } from '../../services/dialog.service';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ConversationStreamingService } from '../../services/conversation-streaming.service';\nimport { ConversationBridgeService } from '../../services/conversation-bridge.service';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\nimport { RealtimeSessionService } from '../../services/realtime-session.service';\nimport { RealtimeSessionReview, RealtimeSessionReviewService } from '../../services/realtime-session-review.service';\nimport { GenerateAndApplyConversationName } from '../../services/conversation-naming';\nimport type { ExportBranding } from '../../services/export.service';\nimport { RealtimeNavigateRequest, RealtimeStartLiveRequest } from '../realtime/realtime-session-overlay.component';\nimport { RealtimeSessionTimelineMeta } from '../../utils/realtime-session-timeline';\nimport {\n ResolveDateJumpTarget,\n CombineDateJumpOutcome,\n DescribeDateJumpOutcome,\n DATE_JUMP_MAX_PAGES,\n type DateJumpPeriod,\n type DateJumpOutcome\n} from '../../utils/date-jump';\nimport { MessageListComponent } from '../message/message-list.component';\nimport { decideArtifactPanelAction, snapshotArtifactVersions, ArtifactPanelAction, ArtifactPanelBaseline, ArtifactVersionRef } from '../../utils/artifact-panel-action';\nimport { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';\n\n// PR 2c — Widget extension surface\nimport { ChatSlotDirective, type MJChatSlotName } from '../../directives/chat-slot.directive';\nimport type {\n IMJChatAgentPresenceComponent,\n MJChatAgentPresenceState,\n IMJChatEmptyStateComponent,\n} from '../slots/slot-interfaces';\nimport {\n BeforeAgentTurnEventArgs,\n AfterAgentTurnEventArgs,\n BeforeToolInvokedEventArgs,\n AfterToolInvokedEventArgs,\n BeforeResponseFormSubmittedEventArgs,\n AfterResponseFormSubmittedEventArgs,\n SessionStartedEventArgs,\n SessionChannelStateChangedEventArgs,\n SessionEndedEventArgs,\n} from '../../events/chat-events';\n\n/**\n * Configuration for the persona/character rendering in the `agentPresence` slot.\n * Off by default — opt in via `showAgentCharacter`. Mirrors {@link IMJChatAgentPresenceComponent}.\n */\nexport interface AgentCharacterConfig {\n /** Optional avatar URL. */\n avatarUrl?: string;\n /** Display name. */\n characterName?: string;\n /** Visual intensity. */\n voiceStateMode?: 'subtle' | 'prominent';\n /** Current voice state — drives state-colored styling on the default presence component. */\n state?: MJChatAgentPresenceState;\n}\n\n/**\n * Configuration payload for the `emptyState` slot's default component. When\n * supplied, drives the empty-state's greeting / subtext / suggested prompts.\n */\nexport interface EmptyStateConfig {\n greeting?: string;\n subtext?: string;\n suggestedPrompts?: string[];\n /** Hide the default suggested prompts even if greeting/subtext are set. */\n hideDefaultPrompts?: boolean;\n}\n\n/** Default width (percentage) for the artifact viewer pane */\nexport const DEFAULT_ARTIFACT_PANE_WIDTH = 40;\n\n@Component({\n standalone: false,\n selector: 'mj-conversation-chat-area',\n templateUrl: `./conversation-chat-area.component.html`,\n styleUrls: ['./conversation-chat-area.component.css']\n})\nexport class ConversationChatAreaComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewChecked {\n @Input() environmentId!: string;\n @Input() currentUser!: UserInfo;\n\n // LOCAL STATE INPUTS - passed from parent workspace\n private _conversationId: string | null = null;\n @Input()\n set conversationId(value: string | null) {\n if (value !== this._conversationId) {\n // Leaving a conversation is a save point for its in-progress draft.\n // (Optional-chained: harness-constructed instances may skip field initializers.)\n this.draftStore?.Flush();\n this._conversationId = value;\n // SESSION-REVIEW lifecycle: changing the active conversation must NEVER leave a\n // stale review overlay hosted over the new conversation. A LIVE call is untouched\n // by this — the overlay's live mode renders off RealtimeSession.Active$, not\n // RealtimeReview (and a review can't open while a call is live anyway).\n this.ClearRealtimeSessionReview();\n // Trigger change handler after initialization is complete\n // Only skip during Angular's initial binding before ngOnInit completes\n if (this.isInitialized) {\n this.onConversationChanged(value);\n }\n }\n }\n get conversationId(): string | null {\n return this._conversationId;\n }\n\n @Input() conversation: MJConversationEntity | null = null;\n @Input() threadId: string | null = null;\n\n /**\n * When true, render the normal message-list + message-input layout even\n * before a conversation exists, instead of the centered empty-state\n * welcome card. Lets host pages (e.g. Form Builder cockpit) put the chat\n * header + mode picker front-and-center on first open and let the user\n * pick a mode before typing. The first send still routes through\n * MessageInputComponent and triggers conversationCreated as usual.\n */\n @Input() suppressNewConversationEmptyState = false;\n\n /**\n * Host-level MASTER cap for the composer's mention/command triggers.\n * Defaults true. When false, ALL triggers (@ agents, # entities, / skills)\n * are off regardless of the per-type flags below. Hosts addressing a single\n * fixed agent (e.g. Form Builder cockpit) can set false wholesale.\n */\n @Input() allowMentions = true;\n\n /**\n * Per-type caps under {@link allowMentions}, all default true. Let a host keep\n * one trigger while dropping another — e.g. a white-label surface pinned to a\n * default agent that wants to offer `/` skill-commands but NOT `@` agent\n * mentions (an `@` overrides the pinned default agent in message routing).\n * Effective only when `allowMentions` is also true.\n */\n @Input() allowAgentMentions = true;\n @Input() allowEntityMentions = true;\n @Input() allowSkillCommands = true;\n\n /**\n * Host-level cap for attachments. Defaults true. When false, the host\n * disables attachments regardless of agent modality support — useful for\n * surfaces where attachments don't make sense (cockpit text-only flows).\n * When true (default), attachment availability still depends on the\n * agent's modality support, computed at runtime.\n */\n @Input() allowAttachments = true;\n\n /**\n * Host-level cap for the composer's Plan Mode toggle. Defaults true\n * (current behavior). White-labeled / end-user hosts that don't expose\n * plan-mode workflows set false to remove the button entirely.\n */\n @Input() allowPlanMode = true;\n\n /**\n * Host-level cap for the composer's realtime voice-call launcher (and its\n * options caret). Defaults true (current behavior). Hosts with no voice\n * experience set false to remove the buttons entirely.\n */\n @Input() allowRealtime = true;\n\n /**\n * Whether the message list renders its built-in \"No messages yet\" filler\n * when a conversation has zero messages. Defaults true. Hosts that render\n * their own empty-state chrome around the chat area set false.\n */\n @Input() showEmptyFill = true;\n\n /**\n * Whether the built-in centered loading indicator renders while a\n * conversation loads. Defaults true. When false the pane stays blank\n * during the load (the loading branch still short-circuits rendering, so\n * no premature empty-state flash). Hosts with their own loading chrome\n * set false.\n */\n @Input() showLoadingState = true;\n\n /**\n * Read each reply from its top instead of its bottom.\n *\n * Default false (current behaviour): the pane follows the tail, so a run ends with the\n * reader looking at the END of the answer and scrolling back up to start reading it.\n *\n * When true, sending and the run itself behave as before, but when the reply lands and\n * the reader was following it, the turn — the reader's own message with the reply under\n * it — is scrolled so it starts at the top of the pane, IF it is taller than the pane. A\n * turn that fits stays where it is: it is all on screen anyway. A reader who scrolled up\n * during the run is never moved; the scroll-to-bottom button is their way back.\n */\n @Input() readReplyFromTop = false;\n\n // --- Additional host-level feature gates (all default true; false removes the\n // affordance entirely). Forwarded to the message list / message items / empty\n // state so white-labeled end-user surfaces can pare the chat down through the\n // component contract instead of CSS on internal class names. ---\n /** Show the per-message agent run-detail grid (run ID, step/token counts, $ cost). */\n @Input() showAgentRunDetails = true;\n /** Show the per-message reaction buttons (like / comment). */\n @Input() showReactions = true;\n /** Show the per-message thumbs rating control on completed AI messages. */\n @Input() showMessageRating = true;\n /** Allow pinning messages (per-message pin button, the header pin chip, and the pinned-messages panel). */\n @Input() allowPinning = true;\n /** Allow editing the user's own messages (per-message edit button). */\n @Input() allowMessageEdit = true;\n /** Allow deleting the user's own messages (per-message delete button). */\n @Input() allowMessageDelete = true;\n /** Show the empty-state's built-in suggested-prompt chips (and the @mention tip). */\n @Input() showSuggestedPrompts = true;\n /** Show the message list's sticky date header + jump-to-date navigation. */\n @Input() showDateNavigation = true;\n\n // --- Assistant identity overrides (both default null = engine-resolved agent\n // identity, today's behavior). White-label hosts brand the AI side of the\n // message feed — the persona NAME shown on AI messages and an IMAGE avatar\n // replacing the Font Awesome agent icon — through the component contract\n // instead of ::ng-deep on .message-sender / .avatar-circle internals.\n // Complements agentCharacterConfig, which covers only the presence strip. ---\n /** Display name for AI messages (e.g. a per-tenant persona). Null = the agent record's name. */\n @Input() assistantDisplayName: string | null = null;\n /** Image URL for the AI message avatar. Null = the agent's Font Awesome icon. */\n @Input() assistantAvatarUrl: string | null = null;\n\n private _isNewConversation: boolean = false;\n @Input()\n set isNewConversation(value: boolean) {\n this._isNewConversation = value;\n if (value) {\n this.focusEmptyStateInput();\n }\n }\n get isNewConversation(): boolean {\n return this._isNewConversation;\n }\n\n // Using getter/setter to ensure correct type handling\n private _pendingMessage: string | null = null;\n @Input()\n set pendingMessage(value: string | null) {\n const previousPendingMessage = this._pendingMessage;\n // Handle case where an object is incorrectly passed\n if (value && typeof value === 'object' && 'text' in value) {\n this._pendingMessage = (value as { text: string }).text;\n } else {\n this._pendingMessage = value;\n }\n // Once the host clears the pending message (consumed), drop the captured target so a later\n // pending message can't be misrouted to a stale conversation.\n if (!this._pendingMessage) {\n this._pendingMessageTargetId = null;\n this._pendingMessageReservedTargetId = null;\n } else if (this._pendingMessage !== previousPendingMessage) {\n this._pendingMessageReservedTargetId = null;\n }\n }\n get pendingMessage(): string | null {\n return this._pendingMessage;\n }\n\n /**\n * The conversation the {@link pendingMessage} was created FOR. The pending message's\n * auto-send is delivered ONLY to the cached input whose conversationId matches this —\n * NOT the live-active conversationId. Without this, swapping conversations during the\n * (async) auto-send window lets the swapped-to conversation's input grab the still-set\n * pendingMessage and send it too, duplicating the message into the wrong conversation.\n *\n * Hosts MAY set this explicitly; it also self-resolves from {@link _pendingMessageTargetId}\n * (captured in onEmptyStateMessageSent) so the guard works regardless of host wiring.\n */\n @Input() pendingMessageConversationId: string | null = null;\n\n /** Internally-captured target for {@link pendingMessage}, set when this component creates a\n * new conversation from the empty state. Host-independent; immune to conversation-swap timing. */\n private _pendingMessageTargetId: string | null = null;\n private _pendingMessageReservedTargetId: string | null = null;\n\n /**\n * The conversation a pending message must be delivered to. Prefers the explicit host input,\n * then the internally-captured new-conversation target, finally the active conversation\n * (legacy fallback for single-conversation hosts that never swap).\n */\n public get EffectivePendingMessageTarget(): string | null {\n return this.pendingMessageConversationId ?? this._pendingMessageTargetId ?? this.conversationId;\n }\n\n public shouldDeliverPendingMessageTo(conversationId: string): boolean {\n const targetId = this.EffectivePendingMessageTarget;\n return UUIDsEqual(conversationId, targetId) && !UUIDsEqual(this._pendingMessageReservedTargetId, targetId);\n }\n\n // Using getter/setter to ensure reactivity\n private _pendingAttachments: PendingAttachment[] | null = null;\n @Input()\n set pendingAttachments(value: PendingAttachment[] | null) {\n this._pendingAttachments = value;\n }\n get pendingAttachments(): PendingAttachment[] | null {\n return this._pendingAttachments;\n }\n\n @Input() pendingArtifactId: string | null = null;\n @Input() pendingArtifactVersionNumber: number | null = null;\n @Input() pendingArtifactConversationId: string | null = null;\n\n /** When true, the component is rendered inside the floating overlay (hides suggested topics, etc.) */\n @Input() overlayMode: boolean = false;\n\n /** Show the Export button in the conversation header. Default true. */\n @Input() showExportButton: boolean = true;\n\n /** Label for the header Export button (white-label hosts relabel it, e.g. \"Download\"). */\n @Input() exportButtonLabel: string = 'Export';\n\n /** Font Awesome class(es) for the header Export button's icon. */\n @Input() exportButtonIcon: string = 'fas fa-download';\n\n /**\n * Branding applied to exported files (theme tokens / logo / title) — forwarded\n * to the export modal, where it also defaults the \"Include branding\" checkbox\n * on. See `ExportBranding` in the export service. Null (default) keeps the\n * stock unthemed export.\n */\n @Input() exportBranding: ExportBranding | null = null;\n\n /** Show the Share button in the conversation header. Default true. */\n @Input() showShareButton: boolean = true;\n\n /** Show the artifact count indicator in the conversation header. Default true. */\n @Input() showArtifactIndicator: boolean = true;\n\n /** Application context snapshot for AI agent awareness. Included in agent execution data. */\n @Input() appContext: Record<string, unknown> | null = null;\n\n /**\n * Optional default agent ID for the conversation. Forwarded to\n * `<mj-message-input>` as its `[defaultAgentId]` so the first message\n * routes directly to this agent instead of Sage. See\n * `MessageInputComponent.routeMessage` priority rules — explicit\n * @mention and prior-agent continuity still take precedence.\n *\n * Embedded chat surfaces (Form Builder cockpit, future domain chats)\n * set this to the specialist agent's ID; the main Chat app leaves it\n * unset to preserve the Sage-fronted UX.\n */\n @Input() defaultAgentId: string | null = null;\n\n /**\n * Scope to apply when this surface CREATES a new conversation. Forwarded\n * to `ConversationEngine.CreateConversation` so the new row's\n * `ApplicationScope` column is stamped correctly. Embedded surfaces\n * (e.g. the Form Builder cockpit) set this to `'Application'` so their\n * conversations don't pollute the main Chat app list. Main Chat leaves\n * it as the default `'Global'`. Has no effect on existing conversations.\n */\n @Input() applicationScope: 'Global' | 'Application' | 'Both' = 'Global';\n\n /**\n * Application ID to bind a newly-created conversation to. REQUIRED when\n * `applicationScope` is 'Application' or 'Both' (DB CHECK constraint\n * enforces it). Used by embedded chat surfaces to scope their\n * conversations to their owning Application.\n */\n @Input() applicationId: string | null = null;\n\n /**\n * \"What is this conversation about?\" — the Entity ID this conversation\n * references. Forwarded to `ConversationEngine.CreateConversation` so\n * the new row's `LinkedEntityID` is stamped at creation time. Paired\n * with {@link linkedRecordId} (DB CHECK requires both populated or both\n * null). Form Builder cockpit passes the MJ: Components entity ID;\n * Component Studio's AI panel does the same. Surfaces use this to\n * later list \"prior conversations about THIS form/component.\"\n * Has no effect on existing conversations.\n */\n @Input() linkedEntityId: string | null = null;\n\n /**\n * Primary key of the linked record, serialized as a string. Used with\n * {@link linkedEntityId}. Form Builder cockpit passes the active\n * form's ComponentID; Component Studio's AI panel passes the\n * currently-selected component's ID.\n */\n @Input() linkedRecordId: string | null = null;\n\n /**\n * Whether the conversation header should render the per-conversation\n * agent picker. Default true. The picker lets a user pin a default\n * agent on the active conversation (saved to\n * `MJConversationEntity.DefaultAgentID`), so non-mention messages route\n * to that agent instead of through Sage. Surfaces with no meaningful\n * agent-choice UX can set this to false to hide the widget.\n */\n @Input() showAgentPicker: boolean = true;\n\n /**\n * Whether the chat header should render the per-agent mode/quality\n * picker (Draft / Standard / High, etc.). Default true. The picker\n * auto-hides when the bound agent has fewer than 2 configured\n * presets, so embedders rarely need to set this explicitly — turn\n * off only when the surface should never expose model-tier choice\n * (kiosks, specialty embeds).\n */\n @Input() showAgentModePicker: boolean = true;\n\n /**\n * The mode/preset picker's selected configuration ID, forwarded to\n * `<mj-message-input>` so non-mention routes apply it on the next\n * send. Past messages are NOT retroactively re-routed — the picker\n * only affects subsequent requests. Updated when the user picks a\n * row in the mode picker; the picker itself persists the choice\n * per-user, per-agent via UserInfoEngine.\n */\n public ActiveAgentConfigurationPresetId: string | null = null;\n\n /**\n * Agent the mode picker should target. Mirrors the routing precedence\n * minus message-history continuity (the picker is persistent UI; it\n * shouldn't flip as the user scrolls history).\n *\n * Order: conversation-pinned default → embedder default → Sage.\n */\n /**\n * True when the chat header should render even before a conversation\n * row exists. Currently means: the embedder has enabled the mode\n * picker AND we resolved a target agent for it (so there's actually\n * something to put in the header). Lets surfaces like the Form\n * Builder cockpit show the mode picker on top of the empty-state\n * instead of waiting for the first message to create a conversation.\n */\n public get HasPreConversationHeader(): boolean {\n return this.showAgentModePicker && !!this.ModePickerTargetAgentId;\n }\n\n public get ModePickerTargetAgentId(): string | null {\n return this.conversation?.DefaultAgentID\n ?? this.defaultAgentId\n ?? this.conversationManagerAgent?.ID\n ?? null;\n }\n\n /**\n * Mode picker emitted a new selection. Store it; the next message's\n * route picks it up via `<mj-message-input>`'s\n * `[agentConfigurationPresetId]` binding. Past messages stay routed\n * as they were — the change is forward-only.\n */\n public OnAgentModePresetChanged(presetId: string | null): void {\n this.ActiveAgentConfigurationPresetId = presetId;\n this.cdr.markForCheck();\n }\n\n /** Greeting message shown in the empty state when no conversation is active */\n @Input() emptyStateGreeting: string = 'How can I help you?';\n\n // Sidebar toggle - when true, shows toggle button in header to expand sidebar\n @Input() showSidebarToggle: boolean = false;\n\n // ────────────────────────────────────────────────────────────────────\n // PR 2c — Widget extension surface (additive — no breaking changes)\n // ────────────────────────────────────────────────────────────────────\n\n /**\n * When true, the `agentPresence` slot is allowed to render (using the\n * supplied `agentCharacterConfig` for visualization data). Off by default\n * so existing embeds (Form Builder, Component Studio AI Assistant, the\n * corner overlay) see no UI change.\n */\n @Input() showAgentCharacter: boolean = false;\n\n /**\n * Visualization data forwarded to the `agentPresence` slot's default\n * component (or to any consumer-projected template via slot context).\n * Includes avatar URL, character name, voice state, and visual intensity.\n */\n @Input() agentCharacterConfig: AgentCharacterConfig | null = null;\n\n /**\n * Structured config for the `emptyState` slot's default component —\n * greeting, subtext, and optional suggested prompts. Backwards-compatible\n * with the existing `emptyStateGreeting` input (which still wins when\n * `emptyStateConfig` is null).\n */\n @Input() emptyStateConfig: EmptyStateConfig | null = null;\n\n /**\n * Activate the `demonstrationSurface` slot layout-mode. Per Matt's 06-10\n * placement design: when true AND a consumer has projected\n * `mjChatSlot=\"demonstrationSurface\"`, the chat-content-area restructures\n * into [stage | conversation-rail] — the stage takes the main pane, the\n * messages pane shrinks to a side rail (below the stage on mobile). When\n * false (default), no layout change; the chat-area renders as normal.\n *\n * The consumer is expected to drive this from their own state (e.g., an\n * agent emits a demonstration intent → host sets this true; user dismisses\n * → host sets it false). The widget itself doesn't decide.\n */\n @Input() showDemonstrationSurface: boolean = false;\n\n /**\n * Content payload forwarded to the `demonstrationSurface` slot via\n * `$implicit` + named `content` context. Shape is consumer-defined per the\n * {@link IMJChatDemonstrationSurfaceComponent} interface — the widget\n * doesn't introspect or render it directly, just hands it through.\n */\n @Input() demonstrationSurfaceContent: unknown = null;\n\n /**\n * True when the demonstrationSurface layout-mode is BOTH opted-in\n * (`showDemonstrationSurface`) AND has a slot template projected to render\n * into. Both conditions must hold for the layout restructure to kick in.\n */\n public get isDemonstrationActive(): boolean {\n return this.showDemonstrationSurface && this.slotTemplate('demonstrationSurface') !== null;\n }\n\n // ────────────────────────────────────────────────────────────────────\n // PR 2c — Before/After cancelable @Output() events\n // ────────────────────────────────────────────────────────────────────\n //\n // Listeners set `event.Cancel = true` on the `Before*` event to halt the\n // default behavior; the matching `After*` event then does NOT fire.\n // Informational events (progress, shown notifications, session lifecycle)\n // stay as single emitters without a Before-pair.\n //\n // WIRING STATUS:\n // ✓ beforeAgentTurn / afterAgentTurn — wired in message-input.component\n // around `agentService.processMessage()` (re-emitted from chat-area).\n // ✓ beforeResponseFormSubmitted / afterResponseFormSubmitted — wired in\n // message-item.component's `onFormSubmitted()`, forwarded through\n // message-list to chat-area.\n // ✓ beforeToolInvoked / afterToolInvoked — wired AND cancel-enforced.\n // Subscribed to AgentClientService.ToolRequested$ / ToolExecuted$ in\n // ngOnInit. When a listener sets event.Cancel = true, the chat-area's\n // subscriber copies it back to the ClientToolRequestEvent and\n // AgentClientSession.handleToolRequest short-circuits dispatch (tool\n // handler NOT called, ToolExecuted$ NOT emitted, server receives a\n // failure response carrying any CancelReason).\n // ✓ sessionStarted / sessionChannelStateChanged / sessionEnded — subscribed\n // to ConversationsRuntime.Sessions.SessionLifecycle$ in ngOnInit. The\n // runtime's SessionsObserver consumes whichever ISessionsAdapter the host\n // registered at bootstrap; the Angular default is RealtimeSessionsAdapter,\n // which bridges RealtimeSessionService's SessionStarted$ / ActiveChannels$\n // (diffed for open/close) / SessionEnded$. Non-Angular hosts (React,\n // Vue, Node) register their own adapter — the chat-area code is unchanged.\n\n /** Cancelable — fired BEFORE a user message is sent to the agent. */\n @Output() beforeAgentTurn = new EventEmitter<BeforeAgentTurnEventArgs>();\n /** Fired AFTER a successful agent turn completes. */\n @Output() afterAgentTurn = new EventEmitter<AfterAgentTurnEventArgs>();\n\n /** Cancelable — fired BEFORE a registered client tool is invoked by the agent. */\n @Output() beforeToolInvoked = new EventEmitter<BeforeToolInvokedEventArgs>();\n /** Fired AFTER a client tool invocation completes. */\n @Output() afterToolInvoked = new EventEmitter<AfterToolInvokedEventArgs>();\n\n /** Cancelable — fired BEFORE a response form's submitted values are sent. */\n @Output() beforeResponseFormSubmitted = new EventEmitter<BeforeResponseFormSubmittedEventArgs>();\n /** Fired AFTER a response form's values have been sent. */\n @Output() afterResponseFormSubmitted = new EventEmitter<AfterResponseFormSubmittedEventArgs>();\n\n /** Informational. */\n @Output() sessionStarted = new EventEmitter<SessionStartedEventArgs>();\n /** Informational. */\n @Output() sessionChannelStateChanged = new EventEmitter<SessionChannelStateChangedEventArgs>();\n /** Informational. */\n @Output() sessionEnded = new EventEmitter<SessionEndedEventArgs>();\n\n @Output() conversationRenamed = new EventEmitter<{conversationId: string; name: string; description: string}>();\n @Output() openEntityRecord = new EventEmitter<{entityName: string; compositeKey: CompositeKey}>();\n\n /**\n * A realtime session that CREATED its own conversation has ended — the new\n * conversation is named (background, shared helper) and ready. The workspace folds\n * it into the cached list and selects it when the conversation list is visible.\n */\n @Output() realtimeConversationReady = new EventEmitter<{conversationId: string; select: boolean}>();\n @Output() navigationRequest = new EventEmitter<NavigationRequest>();\n @Output() taskClicked = new EventEmitter<MJTaskEntity>();\n @Output() artifactLinkClicked = new EventEmitter<{type: 'conversation' | 'collection'; id: string}>();\n @Output() sidebarToggleClicked = new EventEmitter<void>();\n\n // STATE CHANGE OUTPUTS - notify parent of state changes\n // conversationCreated now includes pendingMessage and pendingAttachments to ensure atomic state update\n @Output() conversationCreated = new EventEmitter<{\n conversation: MJConversationEntity;\n pendingMessage?: string;\n pendingAttachments?: PendingAttachment[];\n }>();\n @Output() threadOpened = new EventEmitter<string>();\n @Output() threadClosed = new EventEmitter<void>();\n @Output() pendingArtifactConsumed = new EventEmitter<void>();\n @Output() pendingMessageConsumed = new EventEmitter<void>();\n // pendingMessageRequested is deprecated - use conversationCreated with pendingMessage instead\n @Output() pendingMessageRequested = new EventEmitter<{text: string; attachments: PendingAttachment[]}>();\n\n @ViewChild('scrollContainer') private scrollContainer!: ElementRef;\n @ViewChildren('messageInput') private messageInputComponents!: QueryList<MessageInputComponent>;\n\n /**\n * Prefill the composer with draft text (NOT sent — unlike pendingMessage) and focus\n * it. Targets the empty-state input for new/unsaved conversations, else the active\n * conversation's cached input. Emits composerDraftConsumed once applied. Retries\n * briefly because the target input mounts asynchronously (config params can arrive\n * before the first render).\n */\n @Input() composerDraft: string | null = null;\n\n @Output() composerDraftConsumed = new EventEmitter<void>();\n\n /**\n * Pre-address the composer to an AGENT as a resolved mention pill (+ space +\n * focus) — the chip-resolving sibling of {@link composerDraft}. Value = the\n * agent's name. Emits composerAgentMentionConsumed once applied.\n */\n @Input()\n set composerAgentMention(value: string | null) {\n if (value && value !== this._composerAgentMention) {\n this._composerAgentMention = value;\n this.applyComposerAgentMention(0);\n } else if (!value) {\n this._composerAgentMention = null;\n }\n }\n get composerAgentMention(): string | null {\n return this._composerAgentMention;\n }\n private _composerAgentMention: string | null = null;\n\n @Output() composerAgentMentionConsumed = new EventEmitter<void>();\n\n /**\n * Per-user persisted composer drafts (UserInfoEngine-backed): restore on mount,\n * debounced-persist while typing, flush on blur/switch, delete on send.\n * See {@link ComposerDraftStore} for the storage contract.\n */\n private readonly draftStore = new ComposerDraftStore();\n\n /**\n * ONE-SHOT restore snapshot per composer key. This MUST NOT be a live read:\n * the store updates on every keystroke (DraftStateChanged), and a live binding\n * would re-stage the serialized draft into the composer while the user types —\n * rewriting content and scrambling the caret. The first evaluation per key wins\n * for the life of this chat area: a pending agent pre-address or host-supplied\n * composerDraft outranks the persisted draft (fresher intent); afterwards the\n * binding returns the frozen snapshot so the initialDraft setter's dedupe holds.\n */\n private readonly initialDraftSnapshots = new Map<string, string | null>();\n\n public GetInitialDraftFor(conversationId: string | null): string | null {\n const key = conversationId ? conversationId.trim().toLowerCase() : 'new';\n if (!this.initialDraftSnapshots.has(key)) {\n let snapshot: string | null;\n if (this._composerAgentMention) {\n snapshot = null; // pre-address wins; never restore over it\n } else if (!conversationId && this.composerDraft) {\n snapshot = this.composerDraft;\n } else {\n snapshot = this.draftStore.GetDraft(conversationId);\n }\n this.initialDraftSnapshots.set(key, snapshot);\n }\n return this.initialDraftSnapshots.get(key) ?? null;\n }\n\n /** Live draft persistence (store debounces the server write). */\n public OnDraftStateChanged(conversationId: string | null, serialized: string): void {\n // verboseOnly: fires on every keystroke, same as the store's own SetDraft log below it.\n LogStatusEx({ message: `[Drafts] chat-area: draft change for '${conversationId ?? 'new'}' (${serialized.length} chars)`, verboseOnly: true });\n this.draftStore.SetDraft(conversationId, serialized);\n }\n\n /** Blur = a natural save point — persist immediately. */\n public OnComposerBlurred(): void {\n this.draftStore.Flush();\n }\n\n /** Cold deep-link boots can take several seconds before a composer mounts. */\n private static readonly AGENT_MENTION_MAX_ATTEMPTS = 60; // × 150ms ≈ 9s\n\n private applyComposerAgentMention(attempt: number): void {\n const agentName = this._composerAgentMention;\n if (!agentName) {\n return;\n }\n // New/unsaved conversations render the empty-state composer; established ones\n // use the active cached input. Both resolve the agent to a pill.\n const target = this.emptyStateComponent ? 'empty-state' : this.messageInputComponents?.first ? 'active-input' : null;\n if (attempt === 0 || attempt % 10 === 0 || target) {\n console.log(`[Omnibar→Chat] chat-area apply('${agentName}') attempt ${attempt}: target=${target ?? 'none-mounted'}`);\n }\n const insert: Promise<boolean> | null = this.emptyStateComponent\n ? this.emptyStateComponent.InsertAgentMention(agentName, true)\n : this.messageInputComponents?.first\n ? this.messageInputComponents.first.InsertAgentMention(agentName, true)\n : null;\n if (insert) {\n void insert.then((applied: boolean) => {\n if (applied) {\n console.log(`[Omnibar→Chat] chat-area apply('${agentName}'): APPLIED on ${target} (attempt ${attempt})`);\n this._composerAgentMention = null;\n this.composerAgentMentionConsumed.emit();\n } else if (attempt < ConversationChatAreaComponent.AGENT_MENTION_MAX_ATTEMPTS) {\n setTimeout(() => this.applyComposerAgentMention(attempt + 1), 150);\n } else {\n console.error(`[Omnibar→Chat] chat-area apply('${agentName}'): GAVE UP after ${attempt} attempts — composer never became insertable`);\n }\n });\n return;\n }\n if (attempt < ConversationChatAreaComponent.AGENT_MENTION_MAX_ATTEMPTS) {\n setTimeout(() => this.applyComposerAgentMention(attempt + 1), 150);\n } else {\n console.error(`[Omnibar→Chat] chat-area apply('${agentName}'): GAVE UP after ${attempt} attempts — no composer mounted (emptyState=${!!this.emptyStateComponent}, inputs=${this.messageInputComponents?.length ?? 0})`);\n }\n }\n\n /** The empty-state input applied the staged draft — clear + inform the host. */\n public OnComposerDraftApplied(): void {\n this.composerDraft = null;\n this.composerDraftConsumed.emit();\n }\n @ViewChild(ArtifactViewerPanelComponent) private artifactViewerComponent?: ArtifactViewerPanelComponent;\n @ViewChild(ConversationEmptyStateComponent) private emptyStateComponent?: ConversationEmptyStateComponent;\n\n /**\n * Slot-fill templates supplied by consumers via the `mjChatSlot` directive.\n * Looked up by slot name with {@link slotTemplate}.\n */\n @ContentChildren(ChatSlotDirective) private chatSlotChildren!: QueryList<ChatSlotDirective>;\n\n /**\n * Public helper for the template + consumers — resolve a slot name to the\n * consumer-supplied `TemplateRef`, or `null` if no consumer template was\n * projected for that slot. When `null`, the template should render the\n * slot's default standalone component.\n */\n public slotTemplate(name: MJChatSlotName): TemplateRef<unknown> | null {\n return this.chatSlotChildren?.find((s) => s.SlotName === name)?.Template ?? null;\n }\n\n public messages: MJConversationDetailEntity[] = [];\n public showScrollToBottomIcon = false;\n private scrollToBottom = false;\n /**\n * Whether the reader was at (within a few px of) the bottom at the last scroll event.\n * An in-place message update only follows the tail for a reader who is already there;\n * one who scrolled up to reread history is left alone, whichever mode is on.\n */\n private readerAtBottom = true;\n /** readReplyFromTop: the reader's message that opened the current turn. */\n private currentTurnStartMessageId: string | null = null;\n /** readReplyFromTop: set when the reply lands, consumed once it has rendered. */\n private pendingTurnStartMessageId: string | null = null;\n /**\n * readReplyFromTop: while a landing is under way, bottom-follow timers already armed by the\n * last progress updates must not fire and drag the reader back down.\n */\n private bottomFollowSuppressedUntil = 0;\n private turnStartRetryHandle: ReturnType<typeof setTimeout> | null = null;\n /** Gap kept between the pane's top edge and the turn's first message. */\n private static readonly TURN_TOP_GAP_PX = 16;\n private lastLoadedConversationId: string | null = null; // Track which conversation's peripheral data was loaded\n private currentlyLoadingConversationId: string | null = null; // Track which conversation is currently being loaded\n private conversationLoadToken = 0; // Monotonic token to discard stale async conversation loads\n public isProcessing: boolean = false;\n private intentCheckMessage: MJConversationDetailEntity | null = null; // Temporary message shown during intent checking\n public isLoadingConversation: boolean = false; // Set to true only when actively loading conversation data\n\n // User avatar map derived from engine cache\n public userAvatarMap: Map<string, {imageUrl: string | null; iconClass: string | null}> = new Map();\n public memberCount: number = 1;\n public artifactCount: number = 0;\n public artifactCountDisplay: number = 0;\n public isShared: boolean = false;\n public showExportModal: boolean = false;\n public showShareModal: boolean = false;\n public shareContext: ResourceShareContext | null = null;\n public shareAdapter = new MJResourcePermissionShareAdapter(CONVERSATIONS_RESOURCE_TYPE_ID);\n public showAgentPanel: boolean = false;\n public showMembersModal: boolean = false;\n public showProjectSelector: boolean = false;\n public showArtifactPanel: boolean = false;\n public showArtifactsModal: boolean = false;\n public showSystemArtifacts: boolean = false; // Toggle for showing system-only artifacts\n public selectedArtifactId: string | null = null;\n public selectedVersionNumber: number | undefined = undefined; // Version to show in artifact viewer\n\n /**\n * Bumped whenever artifacts are MERGED into `artifactsByDetailId` by something other than the\n * turn in flight — today only the scroll-up paging path. A before/after diff spanning such a\n * merge cannot tell an artifact that arrived from an older page from one a run just created, so\n * the baseline records this counter and the decision refuses to infer creations when it moved.\n */\n private artifactMapGeneration = 0;\n\n /**\n * Bumped whenever the USER changes what the artifact panel is showing (clicks a card, opens one\n * from the modal or a deep link, closes the panel). An agent turn can finish while such a click\n * is in flight — two completion handlers run per turn, each holding its own pre-turn snapshot —\n * and without this the slower one would pull the panel back onto the run's artifact and discard\n * the selection the user just made.\n */\n private artifactSelectionEpoch = 0;\n public artifactPaneWidth: number = DEFAULT_ARTIFACT_PANE_WIDTH;\n public isArtifactPaneMaximized: boolean = false; // Track maximize state\n private artifactPaneWidthBeforeMaximize: number = DEFAULT_ARTIFACT_PANE_WIDTH;\n public expandedArtifactId: string | null = null; // Track which artifact card is expanded in modal\n public showCollectionPicker: boolean = false;\n public collectionPickerArtifactId: string | null = null;\n public collectionPickerExcludedIds: string[] = [];\n public collectionPickerVersionId: string | null = null;\n public collectionPickerArtifactName: string = '';\n public collectionPickerVersionNumber: number | null = null;\n\n // Artifact permissions\n public canShareSelectedArtifact: boolean = false;\n public canEditSelectedArtifact: boolean = false;\n\n // Share modal state\n public isArtifactShareModalOpen: boolean = false;\n public artifactToShare: MJArtifactEntity | null = null;\n\n\n // Artifact mapping: ConversationDetailID -> Array of LazyArtifactInfo\n // Uses lazy-loading pattern: display data loaded immediately, full entities on-demand\n // Supports multiple artifacts per conversation detail (0-N relationship)\n public artifactsByDetailId = new Map<string, LazyArtifactInfo[]>();\n\n // System artifacts mapping: ConversationDetailID -> Array of LazyArtifactInfo (Visibility='System Only')\n // Kept separate so we can toggle their display without reloading\n // Made public so it can be passed to MessageInputComponent for payload loading\n public systemArtifactsByDetailId = new Map<string, LazyArtifactInfo[]>();\n\n // Cached combined artifacts map - updated when toggle changes\n private _combinedArtifactsMap: Map<string, LazyArtifactInfo[]> | null = null;\n\n // Agent run mapping: ConversationDetailID -> MJAIAgentRunEntityExtended\n // Loaded once per conversation and kept in sync as new runs are created\n public agentRunsByDetailId = new Map<string, MJAIAgentRunEntityExtended>();\n\n /**\n * Ratings by conversation detail ID (parsed from RatingsJSON)\n */\n public ratingsByDetailId = new Map<string, RatingJSON[]>();\n\n /**\n * Attachments by conversation detail ID (loaded from ConversationDetailAttachments)\n */\n public attachmentsByDetailId = new Map<string, MessageAttachment[]>();\n\n /**\n * In-progress message IDs for streaming reconnection\n * Passed to message-input component to reconnect PubSub updates\n */\n public inProgressMessageIds: string[] = [];\n\n // Subject for cleanup on destroy\n private destroy$ = new Subject<void>();\n\n // Cache of message-input metadata for rendering multiple instances\n // Prevents destruction/recreation when switching conversations for performance\n private messageInputMetadataCache = new Map<string, {conversationId: string; conversationName: string | null}>();\n\n // Empty collections for hidden message-input components\n public readonly emptyArtifactsMap = new Map<string, LazyArtifactInfo[]>();\n public readonly emptyAgentRunsMap = new Map<string, MJAIAgentRunEntityExtended>();\n public readonly emptyInProgressIds: string[] = [];\n\n // Loading state for peripheral data\n public isLoadingPeripheralData: boolean = false;\n\n // Subject to trigger artifact viewer refresh when new version is created\n public artifactViewerRefresh$ = new Subject<{artifactId: string; versionNumber: number}>();\n\n // Track initialization state to prevent loading messages before agents are ready\n private isInitialized: boolean = false;\n\n // Track whether we had active agents on the current conversation's last poll cycle.\n // Used to detect when polling transitions from active → no active agents (completion via poll).\n private hadActiveAgents: boolean = false;\n\n // Resize state\n private isResizing: boolean = false;\n private startX: number = 0;\n private startWidth: number = 0;\n\n // Stored bound references so addEventListener and removeEventListener get the same function object.\n private readonly boundOnResizeMove = this.onResizeMove.bind(this);\n private readonly boundOnResizeEnd = this.onResizeEnd.bind(this);\n private readonly boundOnResizeTouchMove = this.onResizeTouchMove.bind(this);\n private readonly boundOnResizeTouchEnd = this.onResizeTouchEnd.bind(this);\n\n // LocalStorage key\n private readonly ARTIFACT_PANE_WIDTH_KEY = 'mj-conversations-artifact-pane-width';\n\n // Pinned messages panel state\n public showPinsPanel: boolean = false;\n\n /** True once the pin ENTITIES are loaded. The COUNT is known from conversation open. */\n private pinsHydrated = false;\n\n /** Spinner state for the panel's first open — the rows now arrive after the panel does. */\n public isLoadingPins = false;\n\n /**\n * TRUE pin count for the chip. Deliberately NOT `pinnedMessages.length`, which is 0 until\n * the panel has been opened and would hide the chip on a conversation full of pins.\n */\n get pinnedMessageCount(): number {\n return this.windowStore.PinnedTotalCount;\n }\n\n /**\n * Opens/closes the pins panel, hydrating its rows on first open.\n *\n * Lazy on purpose: the panel is closed by default, so loading pin entities during\n * conversation open costs every user for a panel most never open.\n */\n public async TogglePinsPanel(): Promise<void> {\n this.showPinsPanel = !this.showPinsPanel;\n if (this.showPinsPanel && !this.pinsHydrated && this.conversationId) {\n this.isLoadingPins = true;\n this.cdr.detectChanges();\n try {\n await this.hydratePinnedMessages(this.conversationId);\n } finally {\n this.isLoadingPins = false;\n }\n }\n this.cdr.detectChanges();\n }\n\n /**\n * All currently pinned messages in the active conversation, newest pin first.\n *\n * Read from the window store's separate pin set, NOT filtered out of `messages` — a pin\n * older than the loaded window would otherwise vanish from the panel. Loaded by its own\n * `IsPinned=1` query in {@link loadMessages}, already ordered `Sequence DESC`.\n *\n * This and the three getters around it are TEMPLATE-BOUND, so they run on every change\n * detection cycle. They read the store's cheap single-value accessors rather than\n * `GetSnapshot()`, which copies the whole loaded window on every call — four of those per\n * cycle, during streaming per token, is exactly the length-proportional work this feature\n * exists to remove.\n */\n get pinnedMessages(): readonly MJConversationDetailEntity[] {\n return this.windowStore.PinnedDetails;\n }\n\n /** True when older transcript pages remain above the loaded window (drives the sentinel). */\n get hasMoreMessagesAbove(): boolean {\n return this.windowStore.HasMoreAbove;\n }\n\n /** True while an older transcript page is being fetched. */\n get isLoadingOlderMessages(): boolean {\n return this.windowStore.IsLoadingOlder;\n }\n\n /**\n * The transcript list — needed so a date jump can scroll AFTER this component has finished\n * paging older history. The list owns the scroll; this component owns the window.\n */\n @ViewChild(MessageListComponent) private messageListComponent?: MessageListComponent;\n\n /**\n * The element that actually scrolls the transcript, handed to the message list so its\n * \"earlier messages\" observer has a correct root.\n *\n * The list's own container does not scroll — this one carries the `overflow-y: auto` and\n * `min-height: 0` that make it a real scroller. Passing it down beats having the list\n * discover it, which depends on layout having settled.\n */\n public get messageScrollRoot(): HTMLElement | null {\n return this.scrollContainer?.nativeElement ?? null;\n }\n\n /**\n * Loads the next older page — fired by the message list's \"earlier messages\" sentinel.\n *\n * `LoadOlder` already no-ops when nothing is above or a load is in flight, so repeated\n * observer fires during a fast scroll are harmless. `messages` is reassigned to a NEW\n * array so the list's ngOnChanges runs; the list then detects the prepend and holds the\n * user's scroll position rather than jumping.\n */\n public async onOlderMessagesRequested(): Promise<void> {\n const conversationId = this.conversationId;\n await this.windowStore.LoadOlder(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n await this.refreshAfterPaging(conversationId!);\n }\n\n /**\n * Re-renders the transcript after one or more older pages have been merged.\n *\n * Costs proportional to what was ADDED, not to the whole window. It diffs the snapshot\n * against the rows currently rendered and hands only the difference to\n * {@link mergePeripheralsForNewRows} — so ordinary sentinel paging and a 50-page date jump\n * both pay per new row exactly once, and neither re-queries attachments for rows that are\n * already on screen.\n *\n * `this.messages` is assigned ONCE, after the peripherals land. Assigning it before the\n * await would show the rows a beat sooner, but the second assignment then changes bubble\n * heights (artifacts and attachments render) AFTER the list has already restored the\n * scroll position for the prepend — which is a visible jump. One render keeps the\n * measurement the list scrolls to and the content it finally paints in agreement.\n */\n private async refreshAfterPaging(conversationId: string): Promise<void> {\n const snapshot = this.windowStore.GetSnapshot();\n const renderedIds = new Set(this.messages.map(m => NormalizeUUID(m.ID)));\n const newDetails = snapshot.Details.filter(d => !renderedIds.has(NormalizeUUID(d.ID)));\n\n if (newDetails.length > 0) {\n await this.mergePeripheralsForNewRows(conversationId, snapshot, newDetails);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n }\n\n this.messages = [...snapshot.Details];\n this.cdr.detectChanges();\n }\n\n /**\n * Pages older history until a date jump can be satisfied, then scrolls to it.\n *\n * Windowing is exactly what broke the old implementation: the transcript no longer holds\n * every day, so \"jump to last month\" targets messages that are simply not loaded. This\n * pages until the target is in the loaded set, history runs out, or the page cap is hit —\n * and always reports the outcome, because the plan forbids a silent no-op here.\n */\n public async onDateJumpRequested(period: DateJumpPeriod): Promise<void> {\n const conversationId = this.conversationId;\n let pagesLoaded = 0;\n\n // The loop's ONLY job is to load enough history for the jump to be answerable. It does\n // not decide whether the jump succeeded — see CombineDateJumpOutcome.\n while (pagesLoaded < DATE_JUMP_MAX_PAGES) {\n const snapshot = this.windowStore.GetSnapshot();\n const { NeedsOlder } = ResolveDateJumpTarget(snapshot.Details, period, new Date());\n if (!NeedsOlder || !snapshot.Cursor.HasMoreAbove) {\n break; // answerable, or no more history to load\n }\n\n // Store-level paging: the per-page peripheral rebuild is deferred to a single\n // refresh below, so a deep jump costs one rebuild instead of one per page.\n await this.windowStore.LoadOlder(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return; // user switched away mid-jump\n }\n pagesLoaded++;\n }\n\n // One rebuild for however many pages arrived, then let it render before measuring.\n if (pagesLoaded > 0) {\n await this.refreshAfterPaging(conversationId!);\n }\n this.cdr.detectChanges();\n const scrollOutcome = this.messageListComponent?.ScrollToDateTarget(period) ?? 'empty';\n const finalOutcome = CombineDateJumpOutcome(scrollOutcome, pagesLoaded >= DATE_JUMP_MAX_PAGES);\n\n if (finalOutcome !== 'reached') {\n MJNotificationService.Instance.CreateSimpleNotification(\n DescribeDateJumpOutcome(finalOutcome, period), 'info', 3000\n );\n }\n }\n\n // Test feedback dialog state\n public showTestFeedbackDialog: boolean = false;\n public testFeedbackDialogData: TestFeedbackDialogData | null = null;\n\n // Image viewer state\n public showImageViewer: boolean = false;\n public selectedImageUrl: string = '';\n public selectedImageAlt: string = '';\n public selectedImageFileName: string = '';\n\n // Upload indicator state (shown centered in conversation area)\n public isUploadingAttachments: boolean = false;\n public uploadingMessage: string = '';\n\n // Attachment support based on agent modalities\n // Computed from conversation manager (Sage) and any previous agent in conversation\n public enableAttachments: boolean = false;\n public maxAttachments: number = 10;\n public maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB default\n public acceptedFileTypes: string = 'image/*';\n private conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n\n private engine = ConversationEngine.Instance;\n\n private windowStore = new ConversationDetailWindowStore(ConversationEngine.Instance);\n\n\n /**\n * Voice session service — exposed to the template so the realtime \"call mode\"\n * overlay can be hosted here (it fills this conversation panel in place while\n * `Active$` is true). The trigger wiring lives in <mj-message-input>.\n */\n public readonly RealtimeSession = inject(RealtimeSessionService);\n\n /** Stateless loader for the call overlay's SESSION REVIEW mode (past realtime sessions). */\n private readonly realtimeReviewService = inject(RealtimeSessionReviewService);\n\n /**\n * The PAST realtime session currently under review, or null. While set (and no live\n * call is active) the realtime overlay renders in SESSION REVIEW mode over this\n * conversation panel. Populated via {@link OpenRealtimeSessionReview}; cleared when\n * the user closes the review or resumes it as a new live call.\n */\n public RealtimeReview: RealtimeSessionReview | null = null;\n\n /**\n * Session-row enrichment for the timeline's realtime SESSION BLOCKS (details stamped\n * with an `AgentSessionID` collapse to one card per session — see the message list's\n * timeline pass). Keyed by `NormalizeUUID(sessionId)`; loaded with ONE batched\n * `MJ: AI Agent Sessions` lookup per conversation, only when stamped rows exist.\n * Tolerant: a failed lookup leaves the map empty and cards render their generic label.\n */\n public realtimeSessionMetaMap: Map<string, RealtimeSessionTimelineMeta> = new Map();\n\n /** Agent name the overlay banner shows: the reviewed session's agent while reviewing, else the live call's. */\n public get realtimeOverlayAgentName(): string {\n if (this.RealtimeReview && !this.RealtimeSession.IsActive) {\n return this.RealtimeReview.AgentName;\n }\n return this.RealtimeSession.CurrentAgentName;\n }\n\n // Shared AI mention/suggestion engine (BaseSingleton — same instance the composer plugins use)\n private mentionAutocompleteService = MentionAutocompleteService.Instance;\n\n constructor(\n private agentStateService: AgentStateService,\n private conversationAgentService: ConversationAgentService,\n private activeTasks: ActiveTasksService,\n private cdr: ChangeDetectorRef,\n private artifactPermissionService: ArtifactPermissionService,\n private attachmentService: ConversationAttachmentService,\n private streamingService: ConversationStreamingService,\n private confirmDialog: ConversationsDialogService,\n private bridge: ConversationBridgeService,\n private analyzeArtifactService: AnalyzeArtifactService,\n private uiCommandHandler: UICommandHandlerService,\n private interactiveFormApplyService: InteractiveFormApplyService,\n private agentClientService: AgentClientService\n ) {\n super();}\n\n /**\n * Apply a form-role artifact's spec as an EntityFormOverride for the\n * current user. The service handles the Create-vs-Modify decision (based\n * on whether an Active override already exists), confirms via dialog,\n * and surfaces success/failure via notification.\n */\n async OnApplyFormRequested(event: { spec: unknown; entityName: string }): Promise<void> {\n await this.interactiveFormApplyService.ConfirmAndApply(\n event.spec as ComponentSpec,\n event.entityName,\n this.ProviderToUse,\n );\n }\n\n async ngOnInit() {\n // Bind provider-aware services to this component's provider so multi-server\n // browser apps don't silently fall back to the global Metadata.Provider.\n const p = this.ProviderToUse;\n this.agentStateService.Provider = p;\n this.conversationAgentService.Provider = p;\n this.activeTasks.Provider = p;\n this.artifactPermissionService.Provider = p;\n this.attachmentService.Provider = p;\n this.analyzeArtifactService.Provider = p;\n\n // Subscribe to actionable commands from UICommandHandlerService so we can\n // intercept and locally handle commands that depend on the conversation\n // surface (e.g. `client:capture-data-snapshot`, which needs access to the\n // artifact viewer panel and the message input — both live in this chat-area).\n // The workspace's existing subscription still fires and bubbles every command\n // up to the host application; this is purely additive — host apps can still\n // override or augment behavior by handling the bubbled event.\n this.uiCommandHandler.actionableCommandRequested\n .pipe(takeUntil(this.destroy$))\n .subscribe((request: ActionableCommandRequest) => {\n const { command, conversationId } = request;\n if (command.type === 'client:capture-data-snapshot') {\n if (conversationId && !this.isActiveConversation(conversationId)) {\n return;\n }\n void this.handleCaptureDataSnapshotCommand(command);\n return;\n }\n if (command.type === 'open:resource' && command.resourceType === 'Record' && command.entityName) {\n if (conversationId && !this.isActiveConversation(conversationId)) {\n return;\n }\n this.emitOpenResourceRecord(command);\n }\n });\n\n // REALTIME-CREATED CONVERSATIONS — three-beat lifecycle so the UI feels live:\n // START: fold the server-created conversation into the cached list right away\n // (it shows as 'New Conversation' while the call runs; no selection yet).\n // Driven by SessionStarted$ — it fires AFTER mintSession resolves, so the\n // created conversation id is guaranteed present (Active$ races the mint).\n // FIRST UTTERANCE: auto-name it via the shared helper (background) — the list\n // updates reactively through ConversationEngine.Conversations$.\n // END: select it (workspace gates on the list being visible).\n let namedThisSession = false;\n this.RealtimeSession.SessionStarted$\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n namedThisSession = false;\n this.onRealtimeSessionStarted();\n });\n let voiceWasActive = false;\n this.RealtimeSession.Active$\n .pipe(takeUntil(this.destroy$))\n .subscribe((active) => {\n if (voiceWasActive && !active) {\n this.onRealtimeSessionEnded();\n }\n voiceWasActive = active;\n });\n this.RealtimeSession.Captions$\n .pipe(takeUntil(this.destroy$))\n .subscribe((captions) => {\n if (namedThisSession) {\n return;\n }\n const created = this.RealtimeSession.SessionCreatedConversationId;\n const seed = this.RealtimeSession.FirstUserTranscript;\n if (created && seed && captions.some(c => c.Role === 'User')) {\n namedThisSession = true;\n void GenerateAndApplyConversationName({\n ConversationId: created,\n MessageText: seed,\n Provider: this.ProviderToUse as GraphQLDataProvider,\n CurrentUser: this.currentUser\n });\n }\n });\n\n // Bridge AgentClientService's tool-dispatch observables to chat-area's\n // Before/After cancelable @Outputs. `ToolRequested$` fires synchronously\n // BEFORE the tool runs; `ToolExecuted$` fires after a successful dispatch\n // (suppressed when the host vetoes via Cancel).\n //\n // Cancel-enforcement: the `ClientToolRequestEvent` carries a mutable\n // `Cancel: boolean` field. We emit the Angular `beforeToolInvoked` event\n // synchronously inside the RxJS subscriber, listeners can flip\n // `args.Cancel = true`, and we copy that decision back to `toolEvent.Cancel`\n // before the subscriber returns. `AgentClientSession.handleToolRequest` then\n // sees the veto, short-circuits dispatch, and reports the cancellation back\n // to the server. `afterToolInvoked` does NOT fire in the canceled case.\n this.agentClientService.ToolRequested$\n .pipe(takeUntil(this.destroy$))\n .subscribe((toolEvent) => {\n const args = new BeforeToolInvokedEventArgs(\n toolEvent.Request.ToolName,\n toolEvent.Request.Params\n );\n this.beforeToolInvoked.emit(args);\n if (args.Cancel) {\n toolEvent.Cancel = true;\n toolEvent.CancelReason = args.CancelReason;\n }\n });\n this.agentClientService.ToolExecuted$\n .pipe(takeUntil(this.destroy$))\n .subscribe((toolEvent) => {\n this.afterToolInvoked.emit(\n new AfterToolInvokedEventArgs(\n toolEvent.Request.ToolName,\n toolEvent.Request.Params,\n toolEvent.Result\n )\n );\n });\n\n // Bridge ConversationsRuntime.Sessions.SessionLifecycle$ → chat-area's\n // informational session* outputs. The runtime's SessionsObserver subscribes\n // to whichever ISessionsAdapter the host registered at bootstrap (today:\n // RealtimeSessionsAdapter from ConversationsRuntimeBootstrap, bridging\n // RealtimeSessionService from PR #2787). Each event variant maps 1:1 to one\n // of the three @Output() emitters declared above.\n ConversationsRuntime.Instance.Sessions.SessionLifecycle$\n .pipe(takeUntil(this.destroy$))\n .subscribe((event) => {\n switch (event.kind) {\n case 'session-started':\n this.sessionStarted.emit(\n new SessionStartedEventArgs(event.sessionId, event.channelKinds)\n );\n return;\n case 'session-channel':\n this.sessionChannelStateChanged.emit(\n new SessionChannelStateChangedEventArgs(\n event.sessionId,\n event.channelKind,\n event.state\n )\n );\n return;\n case 'session-ended':\n this.sessionEnded.emit(\n new SessionEndedEventArgs(event.sessionId, event.reason)\n );\n return;\n }\n });\n\n // The workspace component initializes AI Engine and mention service before\n // any child components render, so we can safely skip duplicate initialization.\n // This prevents race conditions and ensures agents are fully loaded.\n\n // Fallback: If workspace didn't initialize (shouldn't happen), initialize now\n if (!this.mentionAutocompleteService.IsInitialized) {\n console.warn('⚠️ Mention autocomplete not initialized by workspace, initializing now...');\n await this.mentionAutocompleteService.initialize(this.currentUser);\n }\n\n // Ensure ConversationEngine and ArtifactMetadataEngine are loaded.\n // Config(false) is a no-op if already loaded by another component.\n // ConversationEngine.Config() also initializes ArtifactMetadataEngine internally.\n await ConversationEngine.Instance.Config(false, this.currentUser);\n\n // Initialize attachment support based on agent modalities\n await this.initializeAttachmentSupport();\n\n // Load saved artifact pane width\n this.loadArtifactPaneWidth();\n\n // Mark as initialized so setter can trigger conversation changes\n this.isInitialized = true;\n\n // Initial load if there's already an active conversation\n if (this.conversationId) {\n await this.onConversationChanged(this.conversationId);\n }\n\n // Setup resize listeners\n window.addEventListener('mousemove', this.boundOnResizeMove);\n window.addEventListener('mouseup', this.boundOnResizeEnd);\n window.addEventListener('touchmove', this.boundOnResizeTouchMove);\n window.addEventListener('touchend', this.boundOnResizeTouchEnd);\n\n // Handle overlay→workspace handoffs: if the handed-off conversation is already\n // loaded, force a reload from the engine (which has the latest data).\n this.bridge.SwitchEvent$\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => {\n if (event.Target === 'workspace' && event.ConversationID) {\n if (UUIDsEqual(event.ConversationID, this._conversationId)) {\n // Same conversation already displayed — reload from engine\n this.lastLoadedConversationId = null; // Reset so peripheral data reprocesses\n void this.onConversationChanged(event.ConversationID);\n }\n // Different conversation — engine cache is already warm, onConversationChanged\n // will read from it when the parent sets the conversationId input.\n }\n });\n\n // Subscribe to completion events from PubSub\n this.streamingService.completionEvents$\n .pipe(takeUntil(this.destroy$))\n .subscribe(async (event) => {\n // Find the message in our current conversation\n const conversationId = this.conversationId;\n const message = this.messages.find(m => UUIDsEqual(m.ID, event.conversationDetailId));\n if (message && conversationId) {\n await this.handleMessageCompletion(message, event.agentRunId, conversationId);\n }\n });\n\n // Subscribe to polling-based agent state as a secondary fallback for completion detection.\n // The sessionId is persisted in localStorage and reused on refresh, so WebSocket events\n // normally arrive correctly. However, there's a brief timing gap between page load and\n // WebSocket reconnection where events can be lost. The catch-up check in\n // detectAndReconcileAgentRuns() is the primary fallback; polling is the last resort.\n this.agentStateService.activeAgents$\n .pipe(takeUntil(this.destroy$))\n .subscribe(async (agents) => {\n const conversationId = this.conversationId;\n if (!conversationId) return;\n const conversationAgents = agents.filter(a => UUIDsEqual(a.run.ConversationID, conversationId));\n const hasActiveAgents = conversationAgents.length > 0;\n if (this.hadActiveAgents && !hasActiveAgents) {\n // Agents just completed — refresh the NEWEST window page to pick up new messages,\n // updated agent runs, and new artifacts. Deliberately not the engine's full-history\n // RefreshConversationDetails: that would re-query the whole conversation and, via\n // GetCachedDetails, replace the loaded window with every row.\n await this.windowStore.RefreshLatest(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n const refreshed = this.windowStore.GetSnapshot();\n this.messages = refreshed.Details;\n\n // Reprocess peripheral data (artifacts, ratings) from the refreshed window\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(conversationId, refreshed);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Clear active tasks for messages that are no longer in-progress\n for (const message of this.messages) {\n if (message.Status !== 'In-Progress') {\n const task = this.activeTasks.getByConversationDetailId(message.ID);\n if (task) {\n this.activeTasks.remove(task.id);\n }\n }\n }\n\n this.cdr.detectChanges();\n }\n this.hadActiveAgents = hasActiveAgents;\n });\n }\n\n /**\n * Initializes attachment support by checking if the conversation manager agent (Sage)\n * or any recent agent in the conversation supports non-text input modalities.\n */\n private async initializeAttachmentSupport(): Promise<void> {\n try {\n // Ensure AIEngineBase is configured with modality data\n await AIEngineBase.Instance.Config(false);\n\n // Get the conversation manager agent (Sage)\n this.conversationManagerAgent = await this.conversationAgentService.getConversationManagerAgent();\n\n if (this.conversationManagerAgent?.ID) {\n // Get attachment limits from agent metadata (uses Agent → Model → System → Default cascade)\n const limits = AIEngineBase.Instance.GetAgentAttachmentLimits(this.conversationManagerAgent.ID);\n this.enableAttachments = limits.enabled;\n this.maxAttachments = limits.maxAttachments;\n this.maxAttachmentSizeBytes = limits.maxAttachmentSizeBytes;\n this.acceptedFileTypes = limits.acceptedFileTypes;\n LogStatusEx({message: `Attachment support initialized: ${this.enableAttachments} (max ${this.maxAttachments}, ${(this.maxAttachmentSizeBytes / 1024 / 1024).toFixed(0)}MB)`, verboseOnly: true});\n } else {\n // Default to false if we can't determine\n this.enableAttachments = false;\n LogStatusEx({message: 'Attachment support disabled: conversation manager agent not available', verboseOnly: true});\n }\n } catch (error) {\n console.warn('Failed to initialize attachment support:', error);\n this.enableAttachments = false;\n }\n }\n\n /**\n * Updates attachment support based on the current conversation context.\n * Called when conversation changes to check if any agent in the conversation supports attachments.\n */\n private updateAttachmentSupport(): void {\n // Determine which agent to use for limits - prefer last non-Sage agent, fall back to Sage\n let agentIdForLimits = this.conversationManagerAgent?.ID || null;\n\n // Check if any previous non-Sage agent in the conversation supports attachments\n if (this.messages.length > 0) {\n const lastNonSageAgent = this.messages\n .slice()\n .reverse()\n .find(msg =>\n msg.Role === 'AI' &&\n msg.AgentID &&\n !UUIDsEqual(msg.AgentID, this.conversationManagerAgent?.ID)\n );\n\n if (lastNonSageAgent?.AgentID) {\n // Check if this agent supports attachments\n if (AIEngineBase.Instance.AgentSupportsAttachments(lastNonSageAgent.AgentID)) {\n agentIdForLimits = lastNonSageAgent.AgentID;\n }\n }\n }\n\n // Get limits from the determined agent\n if (agentIdForLimits) {\n const limits = AIEngineBase.Instance.GetAgentAttachmentLimits(agentIdForLimits);\n this.enableAttachments = limits.enabled;\n this.maxAttachments = limits.maxAttachments;\n this.maxAttachmentSizeBytes = limits.maxAttachmentSizeBytes;\n this.acceptedFileTypes = limits.acceptedFileTypes;\n } else {\n this.enableAttachments = false;\n }\n }\n\n ngAfterViewChecked() {\n if (this.scrollToBottom) {\n this.scrollToBottom = false;\n setTimeout(() => {\n if (Date.now() < this.bottomFollowSuppressedUntil) {\n return;\n }\n this.scrollToBottomNow();\n // Check scroll state after scrolling to bottom\n this.checkScroll();\n }, 100);\n }\n if (this.pendingTurnStartMessageId) {\n const messageId = this.pendingTurnStartMessageId;\n this.pendingTurnStartMessageId = null;\n // Deferred for the same reason checkScroll() is not called synchronously below.\n setTimeout(() => this.scrollTurnToTop(messageId), 0);\n }\n // Removed synchronous checkScroll() from else branch to prevent\n // ExpressionChangedAfterItHasBeenCheckedError. Calling detectChanges()\n // inside ngAfterViewChecked re-enters change detection and causes\n // Angular's verification pass to see inconsistent state.\n // Scroll icon visibility is still updated via:\n // 1. (scroll)=\"checkScroll()\" on the scroll container (user scroll events)\n // 2. setTimeout callback above (after programmatic scroll-to-bottom)\n }\n\n ngOnDestroy() {\n // Stop polling when component is destroyed\n this.agentStateService.stopPolling();\n\n // Complete destroy subject to cleanup subscriptions\n this.destroy$.next();\n this.destroy$.complete();\n\n this.clearTurnTracking();\n\n // Remove resize listeners\n window.removeEventListener('mousemove', this.boundOnResizeMove);\n window.removeEventListener('mouseup', this.boundOnResizeEnd);\n window.removeEventListener('touchmove', this.boundOnResizeTouchMove);\n window.removeEventListener('touchend', this.boundOnResizeTouchEnd);\n }\n\n private isActiveConversation(conversationId: string | null | undefined): boolean {\n return UUIDsEqual(conversationId, this.conversationId);\n }\n\n private isActiveConversationLoad(conversationId: string | null | undefined, loadToken: number): boolean {\n return loadToken === this.conversationLoadToken && this.isActiveConversation(conversationId);\n }\n\n private isCurrentConversationContext(conversationId: string | null | undefined, loadToken?: number): boolean {\n return loadToken != null\n ? this.isActiveConversationLoad(conversationId, loadToken)\n : this.isActiveConversation(conversationId);\n }\n\n private resetConversationScopedViewState(): void {\n this.clearTurnTracking();\n this.showArtifactPanel = false;\n this.selectedArtifactId = null;\n this.selectedVersionNumber = undefined;\n this.canShareSelectedArtifact = false;\n this.canEditSelectedArtifact = false;\n this.showArtifactsModal = false;\n this.showSystemArtifacts = false;\n this.expandedArtifactId = null;\n this._combinedArtifactsMap = null;\n\n this.isArtifactShareModalOpen = false;\n this.artifactToShare = null;\n this.showCollectionPicker = false;\n this.collectionPickerArtifactId = null;\n this.collectionPickerExcludedIds = [];\n this.collectionPickerVersionId = null;\n this.collectionPickerArtifactName = '';\n this.collectionPickerVersionNumber = null;\n\n this.showImageViewer = false;\n this.selectedImageUrl = '';\n this.selectedImageAlt = '';\n this.selectedImageFileName = '';\n this.showTestFeedbackDialog = false;\n this.testFeedbackDialogData = null;\n this.showPinsPanel = false;\n this.pinsHydrated = false;\n this.showAgentPanel = false;\n this.showExportModal = false;\n this.showShareModal = false;\n this.shareContext = null;\n this.showMembersModal = false;\n this.showProjectSelector = false;\n this.isUploadingAttachments = false;\n this.uploadingMessage = '';\n this.intentCheckMessage = null;\n\n // Reset width along with the flag — otherwise a pane maximized in the\n // previous conversation leaves artifactPaneWidth at 100, and the next\n // artifact opens overflowing the viewport (chat area still visible).\n // Guarded so a non-maximized user-dragged width survives the switch.\n if (this.isArtifactPaneMaximized) {\n this.resetArtifactPaneSizing();\n }\n }\n\n private resetArtifactPaneSizing(): void {\n this.isArtifactPaneMaximized = false;\n this.artifactPaneWidth = DEFAULT_ARTIFACT_PANE_WIDTH;\n }\n\n private async onConversationChanged(conversationId: string | null): Promise<void> {\n // Prevent double-loading if we're already loading this same conversation\n // (ngDoCheck can fire multiple times during state changes)\n if (this.currentlyLoadingConversationId === conversationId && conversationId !== null) {\n return;\n }\n const loadToken = ++this.conversationLoadToken;\n\n this.resetConversationScopedViewState();\n\n // Reset poll-based completion tracking whenever we switch conversations,\n // so the first empty poll on the new conversation doesn't trigger a spurious reload.\n this.hadActiveAgents = false;\n\n if (conversationId) {\n this.currentlyLoadingConversationId = conversationId;\n\n if (!this.messageInputMetadataCache.has(conversationId)) {\n this.messageInputMetadataCache.set(conversationId, {\n conversationId: conversationId,\n conversationName: this.conversation?.Name || null\n });\n }\n\n // Only show loading spinner if the engine doesn't have cached data for this conversation.\n // This prevents the \"no messages\" flash when switching between conversations.\n const hasCachedMessages = this.engine.HasCachedDetails(conversationId);\n if (!hasCachedMessages) {\n this.isLoadingConversation = true;\n this.messages = [];\n this.cdr.detectChanges();\n }\n\n try {\n await this.loadMessages(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.restoreActiveTasks(conversationId);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n // TODO: Replace polling with PubSub - see plans/repair-conversations-ui-performance.md\n this.agentStateService.startPolling(this.currentUser, conversationId);\n } catch (error) {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n console.error('Error loading conversation:', error);\n this.messages = [];\n } finally {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.currentlyLoadingConversationId = null;\n this.isLoadingConversation = false;\n\n // Create new array reference to trigger Angular change detection\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n // Defensive fallback: force another change detection cycle after async ops complete\n setTimeout(() => {\n if (conversationId === this._conversationId && this.messages.length > 0) {\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n }, 50);\n }\n } else {\n // No active conversation - show empty state\n this.messages = [];\n this.isLoadingConversation = false;\n this.currentlyLoadingConversationId = null;\n this.lastLoadedConversationId = null;\n this.agentStateService.stopPolling();\n }\n }\n\n /**\n * Returns array of cached message-input metadata for rendering\n * This allows multiple message-input components to exist simultaneously (hidden)\n * preserving their state when switching conversations\n */\n public getCachedInputs(): Array<{conversationId: string; conversationName: string | null}> {\n return Array.from(this.messageInputMetadataCache.values());\n }\n\n /**\n * Focus the message input inside the empty state component.\n * Uses a delay to allow Angular to render the empty state if it's being created.\n */\n private focusEmptyStateInput(): void {\n setTimeout(() => {\n if (this.emptyStateComponent) {\n this.emptyStateComponent.FocusInput();\n }\n }, 150);\n }\n\n /**\n * Get the message input component for the current conversation.\n * Since we cache multiple message-input instances (one per visited conversation),\n * we need to find the one that matches the current conversationId.\n */\n private getActiveMessageInputComponent(): MessageInputComponent | undefined {\n if (!this.messageInputComponents || !this.conversationId) {\n return undefined;\n }\n return this.messageInputComponents.find(\n component => component.conversationId === this.conversationId\n );\n }\n\n private async loadMessages(conversationId: string, loadToken: number): Promise<void> {\n try {\n // WINDOWED read: only the newest page of the transcript, not the whole conversation.\n // The store owns the loaded window and its paging cursors; the engine's full-history\n // LoadConversationDetails stays untouched for agent/server callers. There is no\n // forceRefresh here — a window is always fetched fresh, so no cache can go stale.\n //\n // DELIBERATE TRADE, both directions. The path this replaced went through\n // LoadConversationDetails, which cached per conversation id in the engine's\n // `_detailCache` — so re-entering a conversation you had already opened was instant\n // with zero database work. `LoadLatest` always fetches, so every re-entry now costs a\n // window read plus the follow-ups in LoadDetailWindow's round-trip profile. For a user\n // tabbing between a handful of conversations that is a REGRESSION against the old\n // behaviour, on a change whose headline is that opening a conversation got cheaper.\n //\n // Accepted for now because the win it buys is unbounded (first open no longer scales\n // with conversation length) and the loss is bounded (a fixed handful of queries), and\n // because the obvious remedy — caching partial windows — is exactly the thing that must\n // never leak into `_detailCache`, where `GetAgentContextWindow` would read it as\n // complete history. A separate `_partialDetailCache` is the shape to reach for if\n // measurement says re-entry is worth it. Measure before building it.\n // Pins are counted separately: a pin can sit far below the window's oldest Sequence,\n // and the pins panel must list ALL of them, not just the ones currently on screen.\n // Concurrent with the window — the two share only the conversation id, and running the\n // pin read after the window made it delay first paint for no reason.\n await Promise.all([\n this.windowStore.LoadLatest(conversationId, this.currentUser),\n this.loadPinnedMessageCount(conversationId, loadToken)\n ]);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n\n // Read the loaded window back off the store\n const snapshot = this.windowStore.GetSnapshot();\n this.messages = snapshot.Details;\n\n // Copy user avatars from the window result\n this.userAvatarMap.clear();\n for (const [userId, avatar] of snapshot.UserAvatars) {\n this.userAvatarMap.set(userId, {\n imageUrl: avatar.ImageURL,\n iconClass: avatar.IconClass\n });\n }\n\n this.updateAttachmentSupport();\n\n // Detect in-progress messages for streaming reconnection\n this.inProgressMessageIds = [...this.messages\n .filter(m => m.Status === 'In-Progress')\n .map(m => m.ID)];\n\n if (this.inProgressMessageIds.length > 0) {\n LogStatusEx({message: `🔌 Detected ${this.inProgressMessageIds.length} in-progress messages for reconnection`, verboseOnly: true});\n }\n\n // Check for missed completions (user navigated away, agent completed, user returned)\n for (const message of this.messages) {\n if (message.Status === 'In-Progress' && message.ID) {\n const recentCompletion = this.streamingService.getRecentCompletion(message.ID);\n if (recentCompletion) {\n LogStatusEx({message: `📥 Found missed completion for message ${message.ID}, handling...`, verboseOnly: true});\n await this.handleMessageCompletion(message, recentCompletion.agentRunId, conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.streamingService.clearRecentCompletion(message.ID);\n }\n }\n }\n\n this.followTranscript('load');\n\n // Process peripheral data (agent runs, artifacts, ratings, attachments) from engine cache\n await this.loadPeripheralData(conversationId, snapshot, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n\n await this.detectAndReconcileAgentRuns(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.handlePendingArtifactNavigation();\n\n } catch (error) {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n console.error('Error loading messages:', error);\n this.messages = [];\n }\n }\n\n\n /**\n * Reads only the PIN COUNT on conversation open.\n *\n * `count_only` returns no rows at all — the chip needs a number, and the panel needs\n * nothing until it is opened. Hydrating every pin here put an unbounded `entity_object`\n * read on the critical path of a change whose whole point is a bounded open, and because\n * it was awaited AFTER the window load it also delayed first paint.\n *\n * The entities load in {@link hydratePinnedMessages}, on first panel open.\n */\n private async loadPinnedMessageCount(conversationId: string, loadToken: number): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJConversationDetailEntity>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND IsPinned=1`,\n ResultType: 'count_only'\n }, this.currentUser);\n\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.windowStore.SetPinnedCount(result.Success ? result.TotalRowCount : 0);\n }\n\n /**\n * Hydrates the pins panel's rows — first panel open only.\n *\n * Deliberately unbounded: the panel's contract is that it lists EVERY pin, including ones\n * below the loaded window, and by this point the user has explicitly asked for them.\n *\n * `entity_object` is required, not incidental — {@link onUnpinFromPanel} mutates `IsPinned`\n * and calls `.Save()` on these instances directly, so `'simple'` would break unpinning\n * from the panel with no error at all.\n */\n private async hydratePinnedMessages(conversationId: string): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJConversationDetailEntity>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND IsPinned=1`,\n OrderBy: 'Sequence DESC', // newest pin first — the panel's order\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n if (!result.Success) {\n console.error('Failed to load pinned messages:', result.ErrorMessage);\n return; // keep the count — the chip stays honest even though the panel is empty\n }\n this.windowStore.SetPinnedDetails(result.Results ?? []);\n this.pinsHydrated = true;\n }\n\n\n /**\n * Reshapes one detail's artifacts into the UI's `LazyArtifactInfo` lists, splitting the\n * system-only ones out. Shared by the full rebuild and the incremental prepend so the two\n * can never disagree about how an artifact becomes a card.\n */\n private applyArtifactsForDetail(detailId: string, artifacts: ArtifactJSON[]): void {\n const artifactList: LazyArtifactInfo[] = [];\n const systemArtifactList: LazyArtifactInfo[] = [];\n\n for (const artifactData of artifacts) {\n const lazyInfo = new LazyArtifactInfo(artifactData, this.currentUser);\n if (artifactData.Visibility === 'System Only') {\n systemArtifactList.push(lazyInfo);\n } else {\n artifactList.push(lazyInfo);\n }\n }\n\n if (artifactList.length > 0) {\n this.artifactsByDetailId.set(detailId, artifactList);\n }\n if (systemArtifactList.length > 0) {\n this.systemArtifactsByDetailId.set(detailId, systemArtifactList);\n }\n }\n\n /**\n * Extends the display maps with JUST the rows a prepend added.\n *\n * The counterpart to {@link loadPeripheralData}, which clears and rebuilds all four maps\n * over the whole accumulated window, re-queries attachments for every loaded id, and\n * re-allocates every `LazyArtifactInfo`. Paying that per page makes ordinary scroll-up\n * paging quadratic — ten pages back re-queries attachments for roughly fifty-five pages'\n * worth of ids — which, stacked on the per-page round trips documented on\n * `LoadDetailWindow`, ends up costing more than the single full load this feature replaced.\n *\n * Everything here is scoped to `newDetails`, so the cost is proportional to the PAGE. The\n * store already accumulates peripherals correctly across pages, so the snapshot's maps are\n * read only at the new ids.\n *\n * @param newDetails - Rows present in the snapshot that were not already rendered\n */\n private async mergePeripheralsForNewRows(\n conversationId: string,\n snapshot: ConversationDetailWindowSnapshot,\n newDetails: MJConversationDetailEntity[]\n ): Promise<void> {\n const newIds = newDetails.map(d => d.ID).filter((id): id is string => !!id);\n\n // Merge, never clear — the rows already on screen keep the peripherals they were\n // rendered with.\n for (const detailId of newIds) {\n const agentRun = snapshot.AgentRunsByDetailId.get(detailId);\n if (agentRun) {\n this.agentRunsByDetailId.set(detailId, agentRun as MJAIAgentRunEntityExtended);\n }\n const artifacts = snapshot.ArtifactsByDetailId.get(detailId);\n if (artifacts) {\n this.applyArtifactsForDetail(detailId, artifacts);\n }\n const ratings = snapshot.RatingsByDetailId.get(detailId);\n if (ratings) {\n this.ratingsByDetailId.set(detailId, ratings);\n }\n }\n\n if (newIds.length > 0) {\n const attachmentsMap = await this.attachmentService.loadAttachmentsForMessages(newIds, this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n for (const [detailId, attachments] of attachmentsMap) {\n this.attachmentsByDetailId.set(detailId, attachments);\n }\n }\n\n // Session meta MERGES here rather than replacing: an older page's sessions are additional\n // cards, and replacing would strip the status chips off the ones already rendered.\n const sessionMeta = await this.fetchRealtimeSessionMeta(newDetails, conversationId);\n if (sessionMeta === null) {\n return;\n }\n if (sessionMeta.size > 0) {\n this.realtimeSessionMetaMap = new Map([...this.realtimeSessionMetaMap, ...sessionMeta]);\n }\n\n // A page of OLDER artifacts just entered the map. Any artifact-panel baseline taken before\n // this point can no longer be diffed against the map for creations — these arrived from\n // history, not from a run. See snapshotArtifactPanelBaseline.\n this.artifactMapGeneration++;\n\n // New references so the message list's ngOnChanges sees the extended maps.\n this.agentRunsByDetailId = new Map(this.agentRunsByDetailId);\n this.artifactsByDetailId = new Map(this.artifactsByDetailId);\n this.ratingsByDetailId = new Map(this.ratingsByDetailId);\n this.systemArtifactsByDetailId = new Map(this.systemArtifactsByDetailId);\n this.attachmentsByDetailId = new Map(this.attachmentsByDetailId);\n\n this._combinedArtifactsMap = null;\n this.artifactCount = this.calculateUniqueArtifactCount();\n this.updateArtifactCountDisplay();\n }\n\n /**\n * Builds the display maps (agent runs, artifacts, ratings) for the LOADED WINDOW.\n *\n * The peripherals arrive with the window itself — `ConversationEngine.LoadDetailWindow`\n * batches them in one `RunViews` scoped to the window's detail IDs — so this method only\n * reshapes them for the UI and issues no queries of its own.\n *\n * @param snapshot - The loaded window, from `windowStore.GetSnapshot()`. Passed in rather\n * than read from the engine's `_detailCache`, which the windowed path never populates.\n */\n private async loadPeripheralData(\n conversationId: string,\n snapshot: ConversationDetailWindowSnapshot,\n loadToken?: number\n ): Promise<void> {\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n\n // Skip if we've already processed peripheral data for this conversation.\n // NOTE (Phase 5): paging up loads OLDER rows with their own peripherals — this guard\n // must not block that refresh once the sentinel lands.\n if (this.lastLoadedConversationId === conversationId) {\n return;\n }\n\n try {\n const cacheEntry = snapshot;\n\n // Clear and rebuild component maps from the window's peripherals\n this.agentRunsByDetailId.clear();\n this.artifactsByDetailId.clear();\n this.systemArtifactsByDetailId.clear();\n this.ratingsByDetailId.clear();\n\n // Copy agent runs from engine (cast to extended type for UI compatibility)\n for (const [detailId, agentRun] of cacheEntry.AgentRunsByDetailId) {\n this.agentRunsByDetailId.set(detailId, agentRun as MJAIAgentRunEntityExtended);\n }\n\n // Convert ArtifactJSON[] from engine cache into LazyArtifactInfo[] for UI\n for (const [detailId, artifacts] of cacheEntry.ArtifactsByDetailId) {\n this.applyArtifactsForDetail(detailId, artifacts);\n }\n\n // Copy ratings from engine cache\n for (const [detailId, ratings] of cacheEntry.RatingsByDetailId) {\n this.ratingsByDetailId.set(detailId, ratings);\n }\n\n // Load attachments (still separate — not part of GetConversationComplete query)\n this.attachmentsByDetailId.clear();\n const messageIds = cacheEntry.Details.map(d => d.ID).filter((id): id is string => !!id);\n if (messageIds.length > 0) {\n const attachmentsMap = await this.attachmentService.loadAttachmentsForMessages(messageIds, this.currentUser);\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n for (const [detailId, attachments] of attachmentsMap) {\n this.attachmentsByDetailId.set(detailId, attachments);\n }\n }\n\n // Load session-row meta for any realtime SESSION BLOCKS in the timeline\n // (agent name + status/close-reason chip on the collapsed session cards)\n await this.loadRealtimeSessionMeta(cacheEntry.Details, conversationId, loadToken);\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n\n // Create new Map references to trigger Angular change detection\n this.agentRunsByDetailId = new Map(this.agentRunsByDetailId);\n this.artifactsByDetailId = new Map(this.artifactsByDetailId);\n this.ratingsByDetailId = new Map(this.ratingsByDetailId);\n this.systemArtifactsByDetailId = new Map(this.systemArtifactsByDetailId);\n this.attachmentsByDetailId = new Map(this.attachmentsByDetailId);\n\n // Clear combined cache since we loaded new artifacts\n this._combinedArtifactsMap = null;\n\n // Update artifact count for header display\n this.artifactCount = this.calculateUniqueArtifactCount();\n this.updateArtifactCountDisplay();\n\n this.lastLoadedConversationId = conversationId;\n\n // Trigger message re-render now that peripheral data is loaded\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Failed to process peripheral data:', error);\n this.lastLoadedConversationId = null;\n }\n }\n\n /**\n * Loads the `MJ: AI Agent Sessions` rows referenced by the conversation's\n * session-stamped details (one batched lookup, narrow fields, only when stamped rows\n * exist) and rebuilds {@link realtimeSessionMetaMap} so the timeline's session cards\n * can show the agent name and a status / close-reason chip. TOLERANT by design: any\n * failure leaves the map empty — cards degrade to their generic label.\n */\n private async loadRealtimeSessionMeta(details: MJConversationDetailEntity[], conversationId?: string, loadToken?: number): Promise<void> {\n const metaMap = await this.fetchRealtimeSessionMeta(details, conversationId, loadToken);\n if (metaMap === null) {\n return; // stale load — the conversation changed underneath\n }\n // New reference so the message list's ngOnChanges sees the update\n this.realtimeSessionMetaMap = metaMap;\n }\n\n /**\n * Reads the session rows for `details` and returns them, WITHOUT deciding what happens to\n * the component's map.\n *\n * Split from {@link loadRealtimeSessionMeta} because the two callers want opposite\n * policies: a full (re)load replaces the map, while prepending an older page must merge —\n * replacing there would strip the status chips off every session card already on screen.\n *\n * @returns The fetched meta, or null when the conversation changed mid-read.\n */\n private async fetchRealtimeSessionMeta(\n details: MJConversationDetailEntity[],\n conversationId?: string,\n loadToken?: number\n ): Promise<Map<string, RealtimeSessionTimelineMeta> | null> {\n const sessionIds: string[] = [];\n const seen = new Set<string>();\n for (const detail of details) {\n const raw = detail.AgentSessionID?.trim() ?? '';\n if (raw.length === 0) {\n continue;\n }\n const key = NormalizeUUID(raw);\n if (!seen.has(key)) {\n seen.add(key);\n sessionIds.push(raw);\n }\n }\n\n const metaMap = new Map<string, RealtimeSessionTimelineMeta>();\n if (sessionIds.length > 0) {\n try {\n const idList = sessionIds.map(id => `'${id.replace(/'/g, \"''\")}'`).join(',');\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<{\n ID: string;\n Agent: string | null;\n Status: 'Active' | 'Closed' | 'Idle';\n CloseReason: string | null;\n ClosedAt: string | Date | null;\n }>({\n EntityName: 'MJ: AI Agent Sessions',\n ExtraFilter: `ID IN (${idList})`,\n Fields: ['ID', 'Agent', 'Status', 'CloseReason', 'ClosedAt'],\n ResultType: 'simple'\n });\n if (result.Success) {\n for (const row of result.Results ?? []) {\n const closedAt = row.ClosedAt ? new Date(row.ClosedAt) : null;\n metaMap.set(NormalizeUUID(row.ID), {\n SessionID: row.ID,\n AgentName: row.Agent ?? null,\n Status: row.Status ?? null,\n CloseReason: row.CloseReason ?? null,\n ClosedAt: closedAt && !isNaN(closedAt.getTime()) ? closedAt : null\n });\n }\n }\n } catch (error) {\n console.warn('Failed to load realtime session meta — session cards render without status chips:', error);\n }\n }\n if (conversationId && !this.isCurrentConversationContext(conversationId, loadToken)) {\n return null;\n }\n return metaMap;\n }\n\n /**\n * REMOVED: Active tasks should only track currently-running tasks in this browser session.\n * Database tasks with 'In-Progress' status are shown in the Tasks dropdown via loadDatabaseTasks().\n * Restoring them here causes duplicate \"Agent Processing...\" entries.\n */\n private async restoreActiveTasks(conversationId: string): Promise<void> {\n // Intentionally empty - ActiveTasksService only tracks in-memory running tasks\n // Database tasks are loaded separately by TasksDropdownComponent\n }\n\n async onMessageSent(message: MJConversationDetailEntity): Promise<void> {\n // The draft became a message — remove it from the persisted map + snapshot.\n const sentKey = (message.ConversationID ?? this.conversationId ?? '').trim().toLowerCase();\n this.draftStore.ClearDraft(message.ConversationID ?? this.conversationId);\n if (sentKey) {\n this.initialDraftSnapshots.delete(sentKey);\n }\n if (this.pendingMessage && this.isPendingMessageTarget(message.ConversationID)) {\n this._pendingMessageReservedTargetId = null;\n this.pendingMessageConsumed.emit();\n }\n\n // Guard: ignore events from hidden message-input instances belonging to other conversations.\n // Multiple inputs are kept alive in the DOM cache (one per visited conversation) and all\n // emit events to this single parent. Without this check, a background agent's response\n // for conversation A would pollute conversation B's message list.\n if (!UUIDsEqual(message.ConversationID, this.conversationId)) {\n // Invalidate that conversation's cache so fresh data loads when the user switches back\n if (message.ConversationID) {\n this.resetComponentState(message.ConversationID);\n }\n return;\n }\n\n // Mirror the row into the loaded window so its NewestSequence tracks live appends.\n // Local path only — the entity is already in hand, so this issues no query.\n this.windowStore.ApplyLocalDetail(message);\n\n // Check if message already exists in the array (by ID) to prevent duplicates\n // Messages can be emitted multiple times as they're updated (e.g., status changes)\n const existingIndex = this.messages.findIndex(m => UUIDsEqual(m.ID, message.ID));\n\n if (existingIndex >= 0) {\n // Update existing message in place (replace with updated version)\n this.messages = [\n ...this.messages.slice(0, existingIndex),\n message,\n ...this.messages.slice(existingIndex + 1)\n ];\n } else {\n // Add new message to the list\n this.messages = [...this.messages, message];\n\n // Ensure current user is in the avatar map for new messages\n this.ensureCurrentUserInAvatarMap();\n\n // Invalidate cache when new message is added.\n // Without this, navigating away and back would load stale cached data\n // that doesn't include this new message.\n if (this.conversationId) {\n this.resetComponentState(this.conversationId);\n }\n\n // Load attachments for the new message (if any were saved with it)\n // This ensures attachments are displayed immediately after sending\n await this.loadAttachmentsForMessage(message.ID, message.ConversationID);\n if (!this.isActiveConversation(message.ConversationID)) {\n return;\n }\n\n // CRITICAL: If this is a new In-Progress AI message, add it to inProgressMessageIds\n // immediately so message-input registers a PubSub streaming callback for it.\n // buildMessagesFromCache handles the nav-away/nav-back reconnection case;\n // this handles the active-session case where the agent just started.\n // Without this, inProgressMessageIds stays [] and the completion event is never received.\n if (message.Status === 'In-Progress' && message.ID && !this.inProgressMessageIds.includes(message.ID)) {\n this.inProgressMessageIds = [...this.inProgressMessageIds, message.ID];\n }\n }\n\n // Where the viewport goes: a fresh send follows — an in-place update of a message that\n // is already on screen must not re-run the send path's scroll.\n this.followTranscript(existingIndex >= 0 ? 'update' : 'new', message);\n\n // Force change detection — zone.js 0.15 no longer patches graphql-ws WebSocket callbacks,\n // so progress updates that arrive via PubSub run outside Angular's zone. Without this,\n // the UI does not update when the messages array is modified from a streaming callback.\n this.cdr.detectChanges();\n }\n\n onInitialMessageAutoSendStarted(event: {conversationId: string}): void {\n if (this.pendingMessage && this.isPendingMessageTarget(event.conversationId)) {\n this._pendingMessageReservedTargetId = event.conversationId;\n }\n }\n\n onInitialMessageAutoSendFailed(event: {conversationId: string}): void {\n if (UUIDsEqual(event.conversationId, this._pendingMessageReservedTargetId)) {\n this._pendingMessageReservedTargetId = null;\n }\n }\n\n private isPendingMessageTarget(conversationId: string | null | undefined): boolean {\n return UUIDsEqual(conversationId, this.EffectivePendingMessageTarget);\n }\n\n /**\n * Loads attachments for a single message and adds them to the attachmentsByDetailId map.\n * Called after a new message is sent to ensure attachments are displayed immediately.\n */\n private async loadAttachmentsForMessage(messageId: string, conversationId: string | null | undefined): Promise<void> {\n try {\n const attachments = await this.attachmentService.loadAttachmentsForMessage(messageId, this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n if (attachments.length > 0) {\n this.attachmentsByDetailId.set(messageId, attachments);\n // Create new map reference to trigger Angular change detection\n this.attachmentsByDetailId = new Map(this.attachmentsByDetailId);\n LogStatusEx({message: `Loaded ${attachments.length} attachment(s) for message ${messageId}`, verboseOnly: true});\n }\n } catch (error) {\n console.warn('Failed to load attachments for message:', error);\n }\n }\n\n /**\n * Ensures the current user is in the avatar map\n * Called when new messages are created to ensure avatar data is available\n */\n private async ensureCurrentUserInAvatarMap(): Promise<void> {\n const userId = this.currentUser.ID;\n\n // If user already in map, skip\n if (this.userAvatarMap.has(userId)) {\n return;\n }\n\n // Load the current user's avatar data\n const md = this.ProviderToUse;\n const userEntity = await md.GetEntityObject<any>('MJ: Users');\n await userEntity.Load(userId);\n\n this.userAvatarMap.set(userId, {\n imageUrl: userEntity.UserImageURL || null,\n iconClass: userEntity.UserImageIconClass || null\n });\n\n LogStatusEx({message: `👤 Added current user to avatar map`, verboseOnly: true});\n }\n\n /**\n * Handle agent run detected event from progress updates\n * This is called when the first progress update arrives with an agent run ID\n */\n async onAgentRunDetected(event: {conversationId: string; conversationDetailId: string; agentRunId: string}): Promise<void> {\n // Guard: ignore events from a background conversation's (hidden, still-streaming) input\n // after a conversation swap. Without this, a background run would be written into the\n // active conversation's agent-run map and engine cache. See onMessageSent() for context.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n await this.addAgentRunToMap(event.conversationId, event.conversationDetailId, event.agentRunId);\n }\n\n /**\n * Handle message completion event from message-input\n * Refreshes the agent run data in-place to get final status and timestamps\n * Also reloads attachments created during agent execution (e.g., generated images)\n */\n async onMessageComplete(event: {conversationId: string; conversationDetailId: string; agentId?: string}): Promise<void> {\n // Guard: ignore completion of a background conversation's run after a conversation swap.\n // Without this, a background run is refreshed into the active conversation's engine cache\n // (keyed by this.conversationId) and its attachments loaded into the active map.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n\n // Get existing agent run from map\n const existingAgentRun = this.agentRunsByDetailId.get(event.conversationDetailId);\n\n if (existingAgentRun?.ID) {\n // Refresh the SAME object by calling Load() - preserves all references\n // duck type check to see if we have a BaseEntity or not\n if (!!existingAgentRun.Load) {\n await existingAgentRun.Load(existingAgentRun.ID);\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n }\n else {\n // we do NOT have an existingAgentRun base entity, but rather a simple JSON object so we need to create an object here\n const md = this.ProviderToUse;\n const newEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n newEntity.LoadFromData(existingAgentRun);\n // swap the map entry to have this object now\n this.agentRunsByDetailId.set(event.conversationDetailId, newEntity);\n\n // Also update ConversationEngine's cache\n if (event.conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(event.conversationId, event.conversationDetailId, newEntity);\n }\n }\n\n // Trigger re-render to show updated status\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n\n // Reload attachments for this message to pick up newly created media attachments\n // (e.g., images generated by agent via Generate Image action)\n // This must be done after agent completion because attachments are created by AgentRunner\n // after the agent execution finishes\n await this.loadAttachmentsForMessage(event.conversationDetailId, event.conversationId);\n\n // Trigger change detection after async attachment loading to ensure UI updates\n this.cdr.detectChanges();\n }\n\n /**\n * Handle agent run update event from progress updates\n * This is called on EVERY progress update with the full, live agent run object\n * Provides real-time updates of status, timestamps, tokens, cost during execution\n */\n async onAgentRunUpdate(event: {conversationId: string; conversationDetailId: string; agentRun?: MJAIAgentRunEntityExtended, agentRunId?: string}): Promise<void> {\n // Guard: ignore live progress updates from a background conversation's run after a swap.\n // Without this, a background run is written into the active conversation's agent-run map\n // and into ConversationEngine's cache keyed by this.conversationId. See onMessageSent().\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n if (event.agentRun) {\n // Directly update map with fresh data from progress (no database query needed)\n // Don't create new Map - message-list component needs to keep the same reference\n this.agentRunsByDetailId.set(event.conversationDetailId, event.agentRun);\n\n // Also update ConversationEngine's cache for other consumers\n if (event.conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(event.conversationId, event.conversationDetailId, event.agentRun);\n }\n }\n else {\n // no agent run, should have agentRunId\n await this.addAgentRunToMap(event.conversationId, event.conversationDetailId, event.agentRunId!);\n }\n\n // Force message list to re-render with updated agent run\n // This ensures message components receive the fresh agent run data\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n\n /**\n * Public entry point to reload messages in the active conversation.\n * Called by the parent resource wrapper when the user clicks the Refresh button,\n * so that new agent responses are visible without a full page reload.\n */\n public async reloadMessages(): Promise<void> {\n await this.reloadMessagesForActiveConversation();\n }\n\n /**\n * Reload messages from the ConversationEngine cache (no DB round-trip).\n * The engine cache is kept warm by entity event handlers that auto-sync on save/delete.\n * Called when agent completion is detected to discover newly delegated agent messages.\n */\n private async reloadMessagesForActiveConversation(): Promise<void> {\n const conversationId = this.conversationId;\n if (!conversationId) {\n return;\n }\n\n try {\n // Refresh the newest window page rather than reading the engine's full-history cache,\n // which the windowed path never populates — reading it here returned undefined and\n // silently skipped everything below, so delegated-agent messages never appeared.\n await this.windowStore.RefreshLatest(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n const engineDetails = this.windowStore.GetSnapshot().Details;\n if (engineDetails.length === 0) {\n return;\n }\n\n // Track existing message IDs before reload to identify new messages\n const existingMessageIds = new Set(this.messages.map(m => m.ID));\n\n // Merge the refreshed window with existing client-side messages.\n // Preserves messages added client-side (e.g., by handleSubAgentInvocation)\n // that haven't been picked up by entity events yet due to timing.\n const merged = new Map<string, MJConversationDetailEntity>();\n\n for (const msg of engineDetails) {\n merged.set(msg.ID, msg);\n }\n\n // Preserve client-side messages not yet in the window\n for (const msg of this.messages) {\n if (!merged.has(msg.ID)) {\n merged.set(msg.ID, msg);\n }\n }\n\n this.messages = Array.from(merged.values())\n .sort((a, b) => (a.__mj_CreatedAt?.getTime() || 0) - (b.__mj_CreatedAt?.getTime() || 0));\n\n // Find newly discovered messages (delegated agents)\n const newMessages = engineDetails.filter(m => !existingMessageIds.has(m.ID));\n\n // Check engine cache for agent runs on new messages\n for (const message of newMessages) {\n if (message.AgentID && message.ID) {\n const agentRun = this.engine.GetAgentRunForDetail(conversationId, message.ID);\n if (agentRun) {\n this.agentRunsByDetailId.set(message.ID, agentRun as MJAIAgentRunEntityExtended);\n LogStatusEx({message: `✅ Found cached agent run for new delegated message ${message.ID}`, verboseOnly: true});\n }\n }\n }\n\n LogStatusEx({message: `✅ Refreshed ${engineDetails.length} messages from engine cache (${newMessages.length} new)`, verboseOnly: true});\n } catch (error) {\n console.error('Failed to reload messages for active conversation:', error);\n }\n }\n\n /**\n * Handle message completion triggered by PubSub completion event\n * Reloads message, agent run, and artifacts, then updates UI\n * @param message The message that completed\n * @param agentRunId The ID of the agent run that completed\n */\n private async handleMessageCompletion(\n message: MJConversationDetailEntity,\n _agentRunId: string,\n expectedConversationId: string | null | undefined = message.ConversationID,\n loadToken?: number\n ): Promise<void> {\n try {\n const isCurrent = () => this.isCurrentConversationContext(expectedConversationId, loadToken);\n\n LogStatusEx({message: `🎉 Handling completion for message ${message.ID}`, verboseOnly: true});\n\n // Snapshot the artifact population before the reloads below so we can tell a NEW artifact\n // from a new VERSION of one already on screen (#529).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload message from database to get final content and status\n await message.Load(message.ID);\n if (!isCurrent()) {\n return;\n }\n\n // Reload agent run to get final status, timestamps, and cost\n const agentRun = this.agentRunsByDetailId.get(message.ID);\n if (agentRun?.ID) {\n await agentRun.Load(agentRun.ID);\n if (!isCurrent()) {\n return;\n }\n }\n\n // Reload artifacts for this completed message\n await this.reloadArtifactsForMessage(message.ID, expectedConversationId, loadToken);\n if (!isCurrent()) {\n return;\n }\n\n // Reload messages to pick up newly delegated agent messages\n // When Sage delegates to Marketing Agent, a new message is created\n await this.reloadMessagesForActiveConversation();\n if (!isCurrent()) {\n return;\n }\n\n // Invalidate cache since reloadMessages may have loaded new delegated-agent messages\n // that are not in the cache set by reloadArtifactsForMessage().\n // Without this, navigating away and back would show stale data.\n if (message.ConversationID) {\n this.resetComponentState(message.ConversationID);\n }\n\n // Update inProgressMessageIds to include new delegated agents\n // This triggers callback registration via the setter in message-input\n this.inProgressMessageIds = [...this.messages\n .filter(m => m.Status === 'In-Progress')\n .map(m => m.ID)];\n\n // Open/refresh the artifact panel from the version diff (not just the triggering message).\n // When Sage delegates to a sub-agent (e.g., Skip), the artifact is on the sub-agent's\n // message, not Sage's. Checking only the triggering message would miss delegated artifacts.\n // #529: a delegated build discovered here must surface even with the panel already open on\n // another artifact, so this is NOT gated on `!this.showArtifactPanel`.\n await this.decideAndApplyArtifactPanel(artifactBaseline, expectedConversationId);\n\n // Remove task from ActiveTasksService (clears spinner in conversation list)\n const task = this.activeTasks.getByConversationDetailId(message.ID);\n if (task) {\n this.activeTasks.remove(task.id);\n }\n\n // The completed message was mutated in place — refresh the window's copy too.\n this.windowStore.ApplyLocalDetail(message);\n\n // Force re-render with updated agent run and artifacts\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n LogStatusEx({message: `✅ Completion handled for message ${message.ID}`, verboseOnly: true});\n } catch (error) {\n console.error(`Error handling message completion for ${message.ID}:`, error);\n this.cdr.detectChanges();\n }\n }\n\n async onAgentResponse(event: {message: MJConversationDetailEntity, agentResult: any}): Promise<void> {\n // Guard: ignore agent responses from background inputs for other conversations.\n // See onMessageSent() for the full explanation.\n if (!UUIDsEqual(event.message.ConversationID, this.conversationId)) {\n if (event.message.ConversationID) {\n this.resetComponentState(event.message.ConversationID);\n }\n return;\n }\n\n // Add the agent's response message to the conversation\n this.windowStore.ApplyLocalDetail(event.message);\n this.messages = [...this.messages, event.message];\n\n // Invalidate cache for this conversation since we have new messages\n if (this.conversationId) {\n this.resetComponentState(this.conversationId);\n }\n\n // Where the viewport goes when the agent responds\n this.followTranscript('new', event.message);\n\n // CRITICAL FIX: Always refresh the agent run data when agent completes\n // This ensures we get the final status and timestamps, replacing any stale data from when agent started\n // agentResult is ExecuteAgentResult which contains agentRun property\n if (event.agentResult?.agentRun?.ID) {\n await this.addAgentRunToMap(event.message.ConversationID, event.message.ID, event.agentResult.agentRun.ID, true); // forceRefresh = true\n if (!this.isActiveConversation(event.message.ConversationID)) {\n return;\n }\n }\n\n // Snapshot the artifact population before reload so we can tell a NEW artifact from a new\n // VERSION of one already on screen (#529).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload artifact mapping for this message to pick up newly created artifacts\n await this.reloadArtifactsForMessage(event.message.ID, event.message.ConversationID);\n if (!this.isActiveConversation(event.message.ConversationID)) {\n return;\n }\n\n // #529: open a newly created artifact even with the panel already open on another one, refresh\n // the shown artifact when it gained a version, and switch to a retargeted one.\n await this.decideAndApplyArtifactPanel(artifactBaseline, event.message.ConversationID);\n\n // Force change detection to update the UI\n this.cdr.detectChanges();\n }\n\n /**\n * Reset component-level UI state so peripheral data reprocesses on next load.\n * Does NOT invalidate ConversationEngine cache — the engine is the single source of truth\n * and is kept warm via AddDetailToCache/UpdateDetailInCache.\n */\n private resetComponentState(conversationId: string): void {\n // Reset so loadPeripheralData re-runs on next conversation load\n if (this.lastLoadedConversationId === conversationId) {\n this.lastLoadedConversationId = null;\n }\n }\n\n /**\n * Add or update an agent run in the map\n * Called when a new agent run completes to keep the map in sync\n * @param forceRefresh If true, always reload from database even if already in map (used when status changes)\n */\n private async addAgentRunToMap(conversationId: string | null | undefined, conversationDetailId: string, agentRunId: string, forceRefresh: boolean = false): Promise<MJAIAgentRunEntityExtended> {\n try {\n // Always refresh if forced, or if not in map yet\n if (forceRefresh || !this.agentRunsByDetailId.has(conversationDetailId)) {\n const md = this.ProviderToUse;\n const agentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs', this.currentUser);\n if (await agentRun.Load(agentRunId)) {\n if (!this.isActiveConversation(conversationId)) {\n return agentRun;\n }\n this.agentRunsByDetailId.set(conversationDetailId, agentRun);\n\n // Also update ConversationEngine's cache for other consumers\n if (conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(conversationId, conversationDetailId, agentRun);\n }\n\n // Force message list to re-render with updated agent run\n // Keep same Map reference so message-list component can access updates\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n }\n return agentRun;\n } \n else {\n return this.agentRunsByDetailId.get(conversationDetailId)!;\n }\n } catch (error) {\n console.error('Failed to load agent run for map:', error);\n throw error;\n }\n }\n\n /**\n * Reload artifacts for a conversation, triggered by a specific message ID.\n * Processes ALL messages in the conversation (not just the trigger message)\n * so that artifacts from delegated sub-agent messages are also picked up.\n * Called after an artifact is created to update the UI immediately.\n * Invalidates and refreshes the conversation cache.\n */\n private async reloadArtifactsForMessage(conversationDetailId: string, expectedConversationId?: string | null, loadToken?: number): Promise<void> {\n LogStatusEx({message: `🔄 Reloading artifacts for message ${conversationDetailId}`, verboseOnly: true});\n try {\n const md = this.ProviderToUse;\n\n // Get the ConversationID for this detail\n const detail = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.currentUser);\n if (!(await detail.Load(conversationDetailId))) {\n console.error('Failed to load conversation detail');\n return;\n }\n const detailConversationId = detail.ConversationID;\n const targetConversationId = expectedConversationId ?? detailConversationId;\n const isCurrent = () => this.isCurrentConversationContext(targetConversationId, loadToken);\n if (!UUIDsEqual(detailConversationId, targetConversationId) || !isCurrent()) {\n return;\n }\n\n // Refresh the newest window page — picks up artifacts written by the just-finished run\n // without re-querying the whole conversation.\n await this.windowStore.RefreshLatest(this.currentUser);\n if (!isCurrent()) {\n return;\n }\n\n // Reprocess peripheral data from the refreshed window\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(detailConversationId, this.windowStore.GetSnapshot(), loadToken);\n } catch (error) {\n console.error('Failed to reload artifacts for message:', error);\n }\n }\n\n openProjectSelector(): void {\n this.showProjectSelector = true;\n }\n\n toggleMembersModal(): void {\n this.showMembersModal = !this.showMembersModal;\n }\n\n viewArtifacts(): void {\n this.showArtifactsModal = true;\n }\n\n /**\n * Recompute the cached artifactCountDisplay from the effective artifacts map.\n * Must be called whenever artifactsByDetailId, systemArtifactsByDetailId,\n * or showSystemArtifacts changes, instead of using a getter that can produce\n * different values between Angular change-detection passes (NG0100).\n */\n private updateArtifactCountDisplay(): void {\n const uniqueArtifactIds = new Set<string>();\n for (const artifactList of this.effectiveArtifactsMap.values()) {\n for (const info of artifactList) {\n uniqueArtifactIds.add(info.artifactId);\n }\n }\n this.artifactCountDisplay = uniqueArtifactIds.size;\n }\n\n /**\n * Calculate count of unique artifacts (not versions) - user-visible only\n * Used for initial artifact count (doesn't change with toggle)\n */\n private calculateUniqueArtifactCount(): number {\n const uniqueArtifactIds = new Set<string>();\n for (const artifactList of this.artifactsByDetailId.values()) {\n for (const info of artifactList) {\n uniqueArtifactIds.add(info.artifactId);\n }\n }\n return uniqueArtifactIds.size;\n }\n\n /**\n * Every (artifactId, versionNumber) pair currently known across all messages, with the version's\n * creation time so candidates can be ordered by recency rather than by whichever conversation\n * detail the map happened to iterate last.\n */\n private allArtifactRefs(): ArtifactVersionRef[] {\n const refs: ArtifactVersionRef[] = [];\n for (const artifactList of this.artifactsByDetailId.values()) {\n for (const info of artifactList) {\n refs.push({\n artifactId: info.artifactId,\n versionNumber: info.versionNumber,\n versionCreatedAt: info.versionCreatedAt,\n });\n }\n }\n return refs;\n }\n\n /**\n * Captures everything {@link decideAndApplyArtifactPanel} needs to judge, at the START of a turn,\n * whether the artifact population changed BECAUSE of that turn.\n *\n * The version map alone is not enough. `artifactsByDetailId` is rebuilt for reasons unrelated to\n * any run — `resetConversationScopedViewState` does not clear it on a conversation switch, so it\n * still holds the previous conversation's artifacts until `loadPeripheralData` lands, and the\n * missed-completion path in `loadMessages` runs BEFORE that rebuild. A snapshot taken there\n * describes a different conversation entirely, and every artifact of the conversation being\n * opened would read as newly created. So the baseline also records which conversation the map\n * was holding, the paging generation, and the user's selection epoch.\n */\n private snapshotArtifactPanelBaseline(): ArtifactPanelBaseline {\n return {\n versions: snapshotArtifactVersions(this.allArtifactRefs()),\n conversationId: this.conversationId,\n mapConversationId: this.lastLoadedConversationId,\n mapGeneration: this.artifactMapGeneration,\n selectionEpoch: this.artifactSelectionEpoch,\n };\n }\n\n /**\n * Diffs the current artifact population against a baseline and carries out the resulting panel\n * action. The single entry point for all three completion paths, which previously each carried\n * their own copy of the snapshot/decide/apply sequence.\n *\n * @param baseline - From {@link snapshotArtifactPanelBaseline}, taken before the turn's reloads.\n * @param conversationId - The conversation this turn belongs to.\n */\n private async decideAndApplyArtifactPanel(\n baseline: ArtifactPanelBaseline,\n conversationId: string | null | undefined\n ): Promise<void> {\n // The baseline is comparable only if the map was holding THIS conversation's artifacts when it\n // was taken, and nothing merged an older page in since.\n const baselineComparable =\n baseline.mapConversationId != null &&\n UUIDsEqual(baseline.mapConversationId, baseline.conversationId) &&\n this.artifactMapGeneration === baseline.mapGeneration;\n\n const action = decideArtifactPanelAction({\n panelOpen: this.showArtifactPanel,\n selectedArtifactId: this.selectedArtifactId,\n before: baseline.versions,\n after: this.allArtifactRefs(),\n baselineComparable,\n userChangedSelection: this.artifactSelectionEpoch !== baseline.selectionEpoch,\n });\n\n if (!baselineComparable && action.kind === 'none') {\n LogStatusEx({\n message: `🎨 Skipping artifact panel decision: the before/after snapshots describe different artifact populations (map held ${baseline.mapConversationId ?? 'nothing'}, conversation was ${baseline.conversationId})`,\n verboseOnly: true\n });\n }\n await this.applyArtifactPanelAction(action, conversationId);\n }\n\n /**\n * Carry out the decision from {@link decideArtifactPanelAction}: open the panel on an artifact\n * version, refresh the already-open viewer, or do nothing.\n */\n private async applyArtifactPanelAction(action: ArtifactPanelAction, conversationId: string | null | undefined): Promise<void> {\n switch (action.kind) {\n case 'open':\n this.selectedArtifactId = action.artifactId;\n this.selectedVersionNumber = action.versionNumber;\n this.showArtifactPanel = true;\n await this.loadArtifactPermissions(action.artifactId, conversationId, action.artifactId);\n // The permission load is async: the user may have switched conversations or picked a\n // different artifact while it was in flight, so only narrate what is still on screen.\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, action.artifactId)) {\n return;\n }\n LogStatusEx({\n message: `🎨 Opening artifact ${action.artifactId} v${action.versionNumber} after agent run (decided from the conversation-wide version diff, so no single detail id applies)`,\n verboseOnly: true\n });\n return;\n case 'refresh':\n // ONE channel, deliberately. Writing `selectedVersionNumber` as well would change the\n // viewer's `[versionNumber]` input in the same change-detection pass, and its `ngOnChanges`\n // would load the version a second time on top of the load this emission already starts —\n // and that second load runs without a cancellation token, so it can also land after a newer\n // one. The subject path is the one to keep: it reloads the version list too, which a\n // brand-new version needs, and it carries a load token.\n this.artifactViewerRefresh$.next({ artifactId: action.artifactId, versionNumber: action.versionNumber });\n return;\n case 'none':\n return;\n }\n }\n\n /**\n * Get the effective artifacts map based on showSystemArtifacts toggle\n * Combines user-visible and system artifacts when toggle is on\n * Uses caching to prevent infinite change detection loops\n */\n public get effectiveArtifactsMap(): Map<string, LazyArtifactInfo[]> {\n if (!this.showSystemArtifacts) {\n // Only user-visible artifacts - no need to cache\n return this.artifactsByDetailId;\n }\n\n // Return cached combined map if available\n if (this._combinedArtifactsMap) {\n return this._combinedArtifactsMap;\n }\n\n // Combine both maps when showing system artifacts\n const combined = new Map<string, LazyArtifactInfo[]>();\n\n // Add all user-visible artifacts\n for (const [key, value] of this.artifactsByDetailId) {\n combined.set(key, [...value]);\n }\n\n // Add system artifacts\n for (const [key, value] of this.systemArtifactsByDetailId) {\n if (combined.has(key)) {\n // Merge with existing artifacts for this detail\n combined.get(key)!.push(...value);\n } else {\n combined.set(key, [...value]);\n }\n }\n\n // Cache the result\n this._combinedArtifactsMap = combined;\n return combined;\n }\n\n /**\n * Toggles system artifacts visibility\n * Clears the cache so the map will be rebuilt on next access\n */\n public toggleSystemArtifacts(): void {\n this.showSystemArtifacts = !this.showSystemArtifacts;\n this._combinedArtifactsMap = null; // Clear cache\n this.updateArtifactCountDisplay();\n this.cdr.detectChanges(); // Force update\n }\n\n /**\n * Check if there are any system artifacts in this conversation\n * Used to conditionally show/hide the \"Show System\" toggle button\n */\n public get hasSystemArtifacts(): boolean {\n return this.systemArtifactsByDetailId.size > 0;\n }\n\n /**\n * Get unique artifacts grouped by artifact ID (not by conversation detail)\n * Returns the latest version info for each unique artifact with all versions\n * Works with LazyArtifactInfo - uses display data without loading full entities\n * Respects showSystemArtifacts toggle\n */\n getArtifactsArray(): Array<{\n artifactId: string;\n versionId: string;\n name: string;\n versionCount: number;\n visibility: string;\n versions: Array<{versionId: string; versionNumber: number}>\n }> {\n const artifactMap = new Map<string, {\n artifactId: string;\n versionId: string;\n name: string;\n visibility: string;\n versions: Array<{versionId: string; versionNumber: number}>\n }>();\n\n // Group by artifactId, collecting all version details\n // Use effectiveArtifactsMap to respect showSystemArtifacts toggle\n for (const artifactList of this.effectiveArtifactsMap.values()) {\n for (const info of artifactList) {\n const artifactId = info.artifactId;\n const versionId = info.artifactVersionId;\n const versionNumber = info.versionNumber || 1;\n const name = info.artifactName || 'Untitled';\n\n if (!artifactMap.has(artifactId)) {\n artifactMap.set(artifactId, {\n artifactId: artifactId,\n versionId: versionId, // Latest version ID\n name: name,\n visibility: info.visibility,\n versions: [{versionId: versionId, versionNumber: versionNumber}]\n });\n } else {\n // Add version if not already present\n const existing = artifactMap.get(artifactId)!;\n if (!existing.versions.some(v => v.versionId === versionId)) {\n existing.versions.push({versionId: versionId, versionNumber: versionNumber});\n // Update to latest version ID (assuming versions are added chronologically)\n existing.versionId = versionId;\n }\n }\n }\n }\n\n // Convert to array with version count, sorted by version number descending\n return Array.from(artifactMap.values()).map(item => ({\n artifactId: item.artifactId,\n versionId: item.versionId,\n name: item.name,\n visibility: item.visibility,\n versionCount: item.versions.length,\n versions: item.versions.sort((a, b) => b.versionNumber - a.versionNumber)\n }));\n }\n\n toggleArtifactExpansion(artifactId: string, event: Event): void {\n event.stopPropagation(); // Prevent opening artifact when clicking expand button\n this.expandedArtifactId = this.expandedArtifactId === artifactId ? null : artifactId;\n }\n\n async openArtifactFromModal(artifactId: string, versionNumber?: number): Promise<void> {\n const conversationId = this.conversationId;\n this.artifactSelectionEpoch++;\n this.selectedArtifactId = artifactId;\n this.selectedVersionNumber = versionNumber;\n this.showArtifactPanel = true;\n this.showArtifactsModal = false;\n\n // Load permissions for the selected artifact\n await this.loadArtifactPermissions(artifactId, conversationId, artifactId);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, artifactId)) {\n return;\n }\n this.cdr.detectChanges();\n }\n\n exportConversation(): void {\n if (this.conversation) {\n this.showExportModal = true;\n }\n }\n\n onExportModalCancelled(): void {\n this.showExportModal = false;\n }\n\n onExportModalComplete(): void {\n this.showExportModal = false;\n }\n\n async onProjectSelected(project: any): Promise<void> {\n if (this.conversation && project) {\n try {\n await this.engine.SaveConversation(\n this.conversation.ID,\n { ProjectID: project.ID },\n this.currentUser\n );\n this.showProjectSelector = false;\n } catch (error) {\n console.error('Failed to assign project:', error);\n }\n } else if (this.conversation && !project) {\n // Remove project assignment\n try {\n await this.engine.SaveConversation(\n this.conversation.ID,\n { ProjectID: null },\n this.currentUser\n );\n this.showProjectSelector = false;\n } catch (error) {\n console.error('Failed to remove project:', error);\n }\n }\n }\n\n shareConversation(): void {\n if (!this.conversation) return;\n this.shareContext = {\n ResourceID: this.conversation.ID,\n ResourceName: this.conversation.Name ?? 'Conversation',\n OwnerUserID: this.conversation.UserID ?? null,\n OwnerDisplayName: this.conversation.User ?? 'You',\n CurrentUserID: this.currentUser?.ID ?? null\n };\n this.showShareModal = true;\n }\n\n onShareDialogResult(_result: { Action: 'save' | 'cancel' }): void {\n this.showShareModal = false;\n }\n\n /**\n * Display info for the header \"Shared by {email}\" badge. Returns `null`\n * when the current user owns the conversation or when the share has no\n * recorded grantor (legacy share pre-dating `SharedByUserID`).\n */\n public get sharedByBadge(): { display: string; fullTooltip: string } | null {\n if (!this.conversation) return null;\n const info = this.engine.GetSharedByInfo(this.conversation.ID);\n if (!info || !info.UserID) return null;\n const display = info.Email ?? info.Name ?? 'another user';\n const tooltip = info.Email && info.Name ? `${info.Name} <${info.Email}>` : display;\n return { display, fullTooltip: `Shared by ${tooltip}` };\n }\n\n /**\n * `true` when the current user only has `View` access to this conversation\n * (i.e., it was shared with them read-only). Gates the message input and\n * any other write-capable UI.\n */\n public get isReadOnlyView(): boolean {\n if (!this.conversation) return false;\n const info = this.engine.GetSharedByInfo(this.conversation.ID);\n return info?.Level === 'View';\n }\n\n /**\n * `true` when the current user is allowed to create new shares on this\n * conversation. Only the conversation's owner — or a user with an existing\n * Owner-level grant — may do so. Matches the server-side gate in\n * {@link MJResourcePermissionEntityExtended.callerMayGrantShare}, so the UI\n * doesn't offer an action the save would refuse.\n */\n public get canShareConversation(): boolean {\n if (!this.conversation || !this.currentUser) return false;\n if (this.conversation.UserID && this.conversation.UserID.toLowerCase() === this.currentUser.ID.toLowerCase()) {\n return true;\n }\n const info = this.engine.GetSharedByInfo(this.conversation.ID);\n return info?.Level === 'Owner';\n }\n\n onReplyInThread(message: MJConversationDetailEntity): void {\n // Open thread panel for this message - emit to parent\n this.threadOpened.emit(message.ID);\n }\n\n onViewThread(message: MJConversationDetailEntity): void {\n // Open thread panel for this message - emit to parent\n this.threadOpened.emit(message.ID);\n }\n\n onLocalThreadClosed(): void {\n // Close the thread panel - emit to parent\n this.threadClosed.emit();\n }\n\n onThreadReplyAdded(reply: MJConversationDetailEntity): void {\n // Optionally refresh the message list to update thread counts\n // For now, we'll just log it\n LogStatusEx({message: 'Thread reply added', verboseOnly: true, additionalArgs: [reply]});\n\n // Reload messages to get updated thread counts\n if (this.conversationId) {\n const conversationId = this.conversationId;\n const loadToken = ++this.conversationLoadToken;\n void this.loadMessages(conversationId, loadToken);\n }\n }\n\n onToggleAgentPanel(): void {\n this.showAgentPanel = !this.showAgentPanel;\n // The agent panel component handles its own visibility\n // This could be used to toggle a modal or different view\n }\n\n onAgentSelected(agentRun: MJAIAgentRunEntity): void {\n // When an agent is clicked in the indicator, could show details\n LogStatusEx({message: 'Agent selected', verboseOnly: true, additionalArgs: [agentRun.ID]});\n // Could open a modal or navigate to agent details\n }\n\n onMessageEdited(message: MJConversationDetailEntity): void {\n // Message was edited and saved, trigger change detection\n LogStatusEx({message: 'Message edited', verboseOnly: true, additionalArgs: [message.ID]});\n // The entity was mutated in place, so the transcript already shows the new text. Replace\n // it in the window explicitly anyway: the store dedupes by ID on merge, and without this\n // a later RefreshLatest could fold a server copy over the edited one.\n this.windowStore.ApplyLocalDetail(message);\n }\n\n onMessagePinToggled(message: MJConversationDetailEntity): void {\n // The entity object is already mutated by .Save(), and the window holds that same object\n // reference, so the transcript reflects the change with no cache write.\n //\n // The engine's RawData row-sync that used to live here is gone: the windowed path never\n // populates `_detailCache`, and a window carries no RawData (those JSON columns only\n // exist on the GetConversationComplete stored query).\n this.windowStore.ApplyLocalDetail(message);\n // The pins panel reads a separate set (it must show pins older than the window), so it\n // needs the toggle applied explicitly — but only once that set is REAL. Applying a pin\n // to a not-yet-hydrated (empty) set would leave one entry that looks like the whole set,\n // and opening the panel would show a single pin on a conversation with many.\n if (this.pinsHydrated) {\n this.windowStore.ApplyLocalPin(message);\n } else {\n this.windowStore.SetPinnedCount(this.pinnedMessageCount + (message.IsPinned ? 1 : -1));\n }\n\n // Auto-close the panel when the last pin is removed\n if (this.showPinsPanel && this.pinnedMessageCount === 0) {\n setTimeout(() => { this.showPinsPanel = false; this.cdr.detectChanges(); }, 600);\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Scrolls the message list to the target message and plays the beacon animation.\n * Called when the user clicks \"Jump to message\" in the pins panel.\n */\n async onJumpToMessage(messageId: string): Promise<void> {\n // Delegated to the list rather than queried here. A `[data-message-id]` lookup only finds\n // MOUNTED messages, and a pin is by definition often far above the viewport — exactly the\n // region the list unmounts into spacers — so this button silently did nothing for any pin\n // that wasn't already on screen. The list resolves through the timeline key, which a\n // spacer shares with the item it stands in for.\n if (this.messageListComponent?.ScrollToMessage(messageId)) {\n this.beaconMessage(messageId);\n return;\n }\n\n // Not in the loaded window. Pins are fetched by their own query precisely so the panel can\n // list pins older than the transcript, so this is the EXPECTED case for an old pin, not an\n // error — page back until it is loaded, the same way a date jump does.\n const reached = await this.loadUntilMessageIsWindowed(messageId);\n if (!reached) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Could not reach that message — it is further back than this jump loads.', 'info', 3000\n );\n return;\n }\n\n // The paging loop deliberately skipped the per-page peripheral rebuild — pay it once,\n // here, before asking the list for element positions.\n await this.refreshAfterPaging(this.conversationId!);\n if (this.messageListComponent?.ScrollToMessage(messageId)) {\n this.beaconMessage(messageId);\n }\n }\n\n /**\n * Pages older history until `messageId` falls inside the loaded window.\n *\n * Deterministic rather than heuristic: a pin carries its own `Sequence`, so the stop\n * condition is simply \"the window now reaches at least that far back\" — no equivalent of\n * the date jump's `NeedsOlder` probing is needed. Bounded by the same page cap, for the same\n * reason: an unbounded walk back is the thing windowing exists to avoid.\n */\n private async loadUntilMessageIsWindowed(messageId: string): Promise<boolean> {\n const target = this.pinnedMessages.find(p => UUIDsEqual(p.ID, messageId));\n if (!target) {\n return false; // not a loaded pin — nothing tells us how far back to page\n }\n\n const conversationId = this.conversationId;\n for (let page = 0; page < DATE_JUMP_MAX_PAGES; page++) {\n const snapshot = this.windowStore.GetSnapshot();\n const oldest = snapshot.Cursor.OldestSequence;\n if (oldest !== null && oldest <= target.Sequence) {\n return true; // the window now covers it\n }\n if (!snapshot.Cursor.HasMoreAbove) {\n return false; // ran out of conversation\n }\n\n // Store-level paging for the same reason as the date jump — the caller refreshes once.\n await this.windowStore.LoadOlder(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return false; // user switched away mid-jump\n }\n }\n return false; // hit the page cap\n }\n\n /** Flashes the beacon on a message once its scroll has settled. */\n private beaconMessage(messageId: string): void {\n // Re-queried rather than captured: the target may have been a spacer when the scroll\n // started and been remounted as a real bubble by the time it lands.\n setTimeout(() => {\n const el = this.scrollContainer?.nativeElement?.querySelector(`[data-message-id=\"${messageId}\"]`);\n if (!el) {\n return;\n }\n el.classList.add('pin-beacon');\n setTimeout(() => el.classList.remove('pin-beacon'), 1500);\n }, 350);\n }\n\n\n /**\n * Unpins a message from the pins panel — saves to DB and patches the cache.\n */\n async onUnpinFromPanel(message: MJConversationDetailEntity): Promise<void> {\n const previous = message.IsPinned;\n message.IsPinned = false;\n this.cdr.detectChanges();\n try {\n await message.Save();\n this.onMessagePinToggled(message);\n } catch (err) {\n console.error('Failed to unpin message from panel:', err);\n message.IsPinned = previous;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Handle suggested response selection from user\n * Sends the selected response as a new user message WITHOUT modifying the visible input\n */\n async onSuggestedResponseSelected(event: {text: string; customInput?: string}): Promise<void> {\n const messageText = event.customInput || event.text;\n\n // Get the active message input for the current conversation\n // (we cache multiple instances, one per visited conversation)\n const activeInput = this.getActiveMessageInputComponent();\n\n // If we have an active conversation with message input available, use it\n if (activeInput && !this.isNewConversation) {\n await activeInput.sendMessageWithText(messageText);\n } else if (!this.conversation || this.isNewConversation) {\n // If no conversation or in new unsaved state, route through empty state handler\n // This will create the conversation and send the message\n await this.onEmptyStateMessageSent({ text: messageText, attachments: [] });\n } else {\n console.error('MessageInputComponent not available and not in a valid state to create conversation');\n }\n }\n\n async onDeleteMessage(message: MJConversationDetailEntity): Promise<void> {\n if (!UUIDsEqual(this.conversation?.UserID, this.currentUser?.ID)) return;\n\n // Find this message and all messages after it sorted by creation time\n const sortedMessages = [...this.messages].sort((a, b) =>\n new Date(a.__mj_CreatedAt!).getTime() - new Date(b.__mj_CreatedAt!).getTime()\n );\n const targetIndex = sortedMessages.findIndex(m => UUIDsEqual(m.ID, message.ID));\n if (targetIndex === -1) return;\n\n const toHide = sortedMessages.slice(targetIndex);\n const count = toHide.length;\n\n const confirmed = await this.confirmDialog.confirm({\n title: 'Delete Messages',\n message: count === 1\n ? 'Delete this message? This cannot be undone.'\n : `Delete this message and the ${count - 1} message${count - 1 === 1 ? '' : 's'} after it? This cannot be undone.`,\n okText: 'Delete',\n cancelText: 'Cancel'\n });\n if (!confirmed) return;\n\n // Load all entities in parallel, then delete in parallel.\n // entity.Delete() calls spDeleteConversationDetail which handles all FK children:\n // hard-deletes junction tables (Artifact/Attachment/Rating), nullifies FKs on AI* records.\n const md = this.ProviderToUse;\n const loadResults = await Promise.all(\n toHide.map(async msg => {\n const entity = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.currentUser);\n const loaded = await entity.Load(msg.ID);\n return loaded ? entity : null;\n })\n );\n const entities = loadResults.filter((e): e is MJConversationDetailEntity => e !== null);\n if (entities.length === 0) return;\n\n // Sequential deletes — parallel fires concurrent server-side transactions which race on\n // SQLServerDataProvider's singleton _transactionDepth counter and fail with SAVE TRANSACTION errors.\n for (const e of entities) {\n const ok = await e.Delete();\n if (!ok) {\n const last = e.ResultHistory[e.ResultHistory.length - 1];\n console.error(`Failed to delete ConversationDetail ${e.ID}: ${last?.Message ?? 'unknown error'}`, last?.Error ?? '');\n }\n }\n\n const hideIds = new Set(toHide.map(m => m.ID));\n // Drop them from the window too, or the next RefreshLatest merge reinstates them.\n for (const id of hideIds) {\n this.windowStore.RemoveDetail(id);\n }\n this.messages = this.messages.filter(m => !hideIds.has(m.ID));\n this.resetComponentState(this.conversationId!);\n this.cdr.detectChanges();\n }\n\n onRetryMessage(message: MJConversationDetailEntity): void {\n // TODO: Implement retry logic\n // This should find the parent user message and re-trigger the agent invocation\n LogStatusEx({message: 'Retry requested for message', verboseOnly: true, additionalArgs: [message.ID]});\n // For now, just log it - full implementation would require refactoring agent invocation\n }\n\n /**\n * Handle attachment click - opens the image viewer for images\n */\n onAttachmentClicked(attachment: MessageAttachment): void {\n if (attachment.type === 'Image' && attachment.contentUrl) {\n this.selectedImageUrl = attachment.contentUrl;\n this.selectedImageAlt = attachment.fileName || 'Image attachment';\n this.selectedImageFileName = attachment.fileName || 'image';\n this.showImageViewer = true;\n return;\n }\n\n // Artifact-backed attachments open in the artifact viewer panel.\n if (attachment.source === 'artifact' && attachment.artifactId) {\n this.onArtifactClicked({\n artifactId: attachment.artifactId,\n versionId: attachment.artifactVersionId\n });\n return;\n }\n\n // Plain uploads: trigger a browser download if we have a usable content URL.\n if (attachment.contentUrl) {\n const a = document.createElement('a');\n a.href = attachment.contentUrl;\n a.download = attachment.fileName || 'download';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n }\n\n /**\n * Handle image viewer close\n */\n onImageViewerClosed(): void {\n this.showImageViewer = false;\n this.selectedImageUrl = '';\n this.selectedImageAlt = '';\n this.selectedImageFileName = '';\n }\n\n /**\n * Handle upload state changes from message input component\n */\n onUploadStateChanged(event: {isUploading: boolean; message: string}): void {\n this.isUploadingAttachments = event.isUploading;\n this.uploadingMessage = event.message;\n }\n\n async onArtifactClicked(data: {artifactId: string; versionId?: string}): Promise<void> {\n const conversationId = this.conversationId;\n this.artifactSelectionEpoch++;\n this.selectedArtifactId = data.artifactId;\n\n // If versionId is provided, find the version number from display data (no lazy load needed)\n if (data.versionId) {\n for (const artifactList of this.artifactsByDetailId.values()) {\n for (const artifactInfo of artifactList) {\n if (artifactInfo.artifactVersionId === data.versionId) {\n this.selectedVersionNumber = artifactInfo.versionNumber;\n LogStatusEx({message: `📦 Opening artifact viewer for v${this.selectedVersionNumber}`, verboseOnly: true});\n break;\n }\n }\n }\n } else {\n // No specific version, let viewer default to latest\n this.selectedVersionNumber = undefined;\n }\n\n this.showArtifactPanel = true;\n\n // Load permissions for the selected artifact\n await this.loadArtifactPermissions(data.artifactId, conversationId, data.artifactId);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, data.artifactId)) {\n return;\n }\n\n // Trigger detectChanges after all state is settled (showArtifactPanel, permissions)\n // to prevent ExpressionChangedAfterItHasBeenCheckedError from zone-triggered CD\n // seeing partial state between the await boundaries\n this.cdr.detectChanges();\n }\n\n async onArtifactCreated(data: {conversationId: string, conversationDetailId: string, artifactId: string; versionId: string; versionNumber: number; name: string}): Promise<void> {\n // Guard: ignore artifacts created by a background conversation's agent after a swap.\n // Without this, reloadArtifactsForMessage -> loadPeripheralData would CLEAR the active\n // conversation's artifact/agent-run/rating/attachment maps and rebuild them from the\n // background conversation's cache — wiping the displayed conversation's artifacts.\n // The background conversation's artifacts persist server-side and reload when the user\n // navigates back to it. See onMessageSent() for the broader pattern.\n if (!this.isActiveConversation(data.conversationId)) {\n return;\n }\n\n // Snapshot the artifact population across the conversation before reload so we can tell a NEW\n // artifact from a new VERSION of an existing one (the event itself carries placeholder ids).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload artifacts to get full entities (processes ALL messages in the conversation)\n await this.reloadArtifactsForMessage(data.conversationDetailId, data.conversationId);\n if (!this.isActiveConversation(data.conversationId)) {\n return;\n }\n\n // #529: a new artifact opens even over an open panel (build); a bumped version of the shown\n // artifact refreshes; a bumped version of another artifact switches to it (retargeting).\n await this.decideAndApplyArtifactPanel(artifactBaseline, data.conversationId);\n\n // Force change detection to update the UI immediately\n this.cdr.detectChanges();\n }\n\n onCloseArtifactPanel(): void {\n this.artifactSelectionEpoch++;\n this.showArtifactPanel = false;\n this.selectedArtifactId = null;\n // Clear permissions\n this.canShareSelectedArtifact = false;\n this.canEditSelectedArtifact = false;\n // Reset maximize state and width when closing so the next artifact opens at default size\n this.resetArtifactPaneSizing();\n this.cdr.detectChanges();\n }\n\n toggleMaximizeArtifactPane(): void {\n if (this.isArtifactPaneMaximized) {\n // Restore to previous width\n this.artifactPaneWidth = this.artifactPaneWidthBeforeMaximize;\n this.isArtifactPaneMaximized = false;\n } else {\n // Maximize - store current width and set to 100%\n this.artifactPaneWidthBeforeMaximize = this.artifactPaneWidth;\n this.artifactPaneWidth = 100;\n this.isArtifactPaneMaximized = true;\n }\n }\n\n onSaveToCollectionRequested(event: {artifactId: string; excludedCollectionIds: string[]}): void {\n this.collectionPickerArtifactId = event.artifactId;\n this.collectionPickerExcludedIds = event.excludedCollectionIds;\n // Snapshot version + name from the viewer so the picker's preview pane has real context\n const viewer = this.artifactViewerComponent;\n this.collectionPickerVersionId = viewer?.artifactVersion?.ID ?? null;\n this.collectionPickerArtifactName = viewer?.displayName ?? '';\n this.collectionPickerVersionNumber = viewer?.selectedVersionNumber ?? null;\n this.showCollectionPicker = true;\n }\n\n async onCollectionPickerCompleted(event: { successIds: string[]; failedIds: string[] }): Promise<void> {\n // Refresh the viewer's bookmark / \"already saved\" state if anything actually wrote\n if (event.successIds.length > 0 && this.artifactViewerComponent) {\n await this.artifactViewerComponent.ReloadCollectionAssociations();\n }\n this.closeCollectionPicker();\n\n if (event.failedIds.length === 0 && event.successIds.length > 0) {\n const n = event.successIds.length;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Saved to ${n} ${n === 1 ? 'collection' : 'collections'}`,\n 'success',\n 2500\n );\n }\n }\n\n onCollectionPickerCancelled(): void {\n this.closeCollectionPicker();\n }\n\n private closeCollectionPicker(): void {\n this.showCollectionPicker = false;\n this.collectionPickerArtifactId = null;\n this.collectionPickerExcludedIds = [];\n this.collectionPickerVersionId = null;\n this.collectionPickerArtifactName = '';\n this.collectionPickerVersionNumber = null;\n this.cdr.detectChanges();\n }\n\n /**\n * Helper method to check if a conversation detail has an artifact\n * Used by message components to determine whether to show artifact card\n */\n public conversationDetailHasArtifact(conversationDetailId: string): boolean {\n return this.artifactsByDetailId.has(conversationDetailId);\n }\n\n /**\n * Get artifact info for a conversation detail\n * Returns the LAST (most recent) artifact if multiple exist\n * Returns LazyArtifactInfo - caller can trigger lazy load if full entities needed\n */\n public getArtifactInfo(conversationDetailId: string): LazyArtifactInfo | undefined {\n const artifactList = this.artifactsByDetailId.get(conversationDetailId);\n return artifactList && artifactList.length > 0\n ? artifactList[artifactList.length - 1]\n : undefined;\n }\n\n /**\n * Get ALL artifacts for a conversation detail\n * Use this when you need to display all artifacts (e.g., in a list)\n * Returns LazyArtifactInfo array - caller can trigger lazy load if full entities needed\n */\n public getAllArtifactsForDetail(conversationDetailId: string): LazyArtifactInfo[] {\n return this.artifactsByDetailId.get(conversationDetailId) || [];\n }\n\n /**\n * Resize handle methods for artifact pane\n */\n onResizeStart(event: MouseEvent): void {\n this.isResizing = true;\n this.startX = event.clientX;\n this.startWidth = this.artifactPaneWidth;\n event.preventDefault();\n document.body.style.cursor = 'col-resize';\n document.body.style.userSelect = 'none';\n }\n\n private onResizeMove(event: MouseEvent): void {\n if (!this.isResizing) return;\n\n const containerWidth = (event.currentTarget as Window).innerWidth;\n const deltaX = this.startX - event.clientX; // Reversed: drag left = wider artifact pane\n const deltaPercent = (deltaX / containerWidth) * 100;\n let newWidth = this.startWidth + deltaPercent;\n\n // Constrain between 20% and 70%\n newWidth = Math.max(20, Math.min(70, newWidth));\n this.artifactPaneWidth = newWidth;\n }\n\n private onResizeEnd(event: MouseEvent): void {\n if (this.isResizing) {\n this.isResizing = false;\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n\n // Save to localStorage\n this.saveArtifactPaneWidth();\n }\n }\n\n /**\n * Touch event handlers for mobile resize support\n */\n onResizeTouchStart(event: TouchEvent): void {\n this.isResizing = true;\n const touch = event.touches[0];\n this.startX = touch.clientX;\n this.startWidth = this.artifactPaneWidth;\n event.preventDefault();\n }\n\n private onResizeTouchMove(event: TouchEvent): void {\n if (!this.isResizing) return;\n\n const touch = event.touches[0];\n const containerWidth = window.innerWidth;\n const deltaX = this.startX - touch.clientX;\n const deltaPercent = (deltaX / containerWidth) * 100;\n let newWidth = this.startWidth + deltaPercent;\n\n newWidth = Math.max(20, Math.min(70, newWidth));\n this.artifactPaneWidth = newWidth;\n }\n\n private onResizeTouchEnd(event: TouchEvent): void {\n if (this.isResizing) {\n this.isResizing = false;\n this.saveArtifactPaneWidth();\n }\n }\n\n /**\n * LocalStorage persistence methods for artifact pane\n */\n private loadArtifactPaneWidth(): void {\n try {\n const saved = localStorage.getItem(this.ARTIFACT_PANE_WIDTH_KEY);\n if (saved) {\n const width = parseFloat(saved);\n if (!isNaN(width) && width >= 20 && width <= 70) {\n this.artifactPaneWidth = width;\n }\n }\n } catch (error) {\n console.warn('Failed to load artifact pane width from localStorage:', error);\n }\n }\n\n private saveArtifactPaneWidth(): void {\n try {\n localStorage.setItem(this.ARTIFACT_PANE_WIDTH_KEY, this.artifactPaneWidth.toString());\n } catch (error) {\n console.warn('Failed to save artifact pane width to localStorage:', error);\n }\n }\n\n onConversationRenamed(event: {conversationId: string; name: string; description: string}): void {\n LogStatusEx({message: '🎉 Conversation renamed', verboseOnly: true, additionalArgs: [event]});\n // Pass the event up to workspace component for animation\n this.conversationRenamed.emit(event);\n }\n\n /**\n * Handle message sent from empty state component\n * Creates a new conversation and emits to parent to update selection\n */\n async onEmptyStateMessageSent(event: {text: string; attachments: PendingAttachment[]}): Promise<void> {\n // The new-conversation draft became a message — remove the 'new' entry and\n // reset its restore snapshot so the NEXT new-conversation composer starts clean.\n this.draftStore.ClearDraft(null);\n this.initialDraftSnapshots.delete('new');\n const { text, attachments } = event;\n if (!text?.trim() && (!attachments || attachments.length === 0)) {\n return;\n }\n\n LogStatusEx({message: '📨 Empty state message received', verboseOnly: true, additionalArgs: [text, `${attachments?.length || 0} attachments`]});\n\n try {\n this.isProcessing = true;\n\n // Create a new conversation using the engine. applicationScope +\n // applicationId let embedded surfaces (e.g. the Form Builder cockpit)\n // stamp their conversations as 'Application'-scoped so they don't\n // leak into the main chat list. defaultAgentId pins the routing\n // target for the first message — it's the same value forwarded to\n // <mj-message-input> as [defaultAgentId].\n //\n // Safety net: the DB CHECK constraint rejects ('Application' || 'Both')\n // without an ApplicationID. If the embedder hasn't resolved its app\n // ID yet (or it's missing from the Metadata cache), demote to\n // 'Global' so the save doesn't blow up. The conversation lands in\n // the main list — visible but not silently lost.\n const effectiveScope: 'Global' | 'Application' | 'Both' =\n (this.applicationScope !== 'Global' && !this.applicationId)\n ? 'Global'\n : this.applicationScope;\n // Linked-record stamping — both columns must be populated together\n // or both null (DB CHECK constraint CK_Conversation_LinkBinding).\n // We only forward the pair when BOTH inputs are supplied; if the\n // host bound one but not the other, treat as misconfiguration and\n // skip the linkage rather than failing the save.\n const hasLink = !!this.linkedEntityId && !!this.linkedRecordId;\n const newConversation = await this.engine.CreateConversation(\n 'New Conversation', // Temporary name - will be auto-named after first message\n this.environmentId,\n this.currentUser,\n undefined,\n undefined,\n {\n applicationScope: effectiveScope,\n applicationId: effectiveScope === 'Global' ? null : this.applicationId,\n defaultAgentId: this.defaultAgentId,\n linkedEntityId: hasLink ? this.linkedEntityId : null,\n linkedRecordId: hasLink ? this.linkedRecordId : null,\n }\n );\n\n if (!newConversation) {\n console.error('Failed to create new conversation');\n this.isProcessing = false;\n return;\n }\n\n LogStatusEx({message: '✅ Created new conversation', verboseOnly: true, additionalArgs: [newConversation.ID]});\n\n // Pin the auto-send to THIS newly-created conversation, host-independent and immune to\n // conversation-swap timing. The pending message round-trips through the host (which sets\n // [pendingMessage]) and comes back as an @Input; the @for delivers it ONLY to the input\n // whose conversationId matches this target. Without this, a fast swap during the async\n // auto-send window lets the swapped-to conversation's input grab the pending message and\n // send it there instead (the cross-conversation bleed).\n this._pendingMessageTargetId = newConversation.ID;\n\n // Emit to parent with the new conversation AND the pending message/attachments in a single event\n // This ensures atomic state update - workspace sets all state before Angular change detection\n // creates the new message-input component\n const pendingMessage = text?.trim() || '';\n const pendingAttachments = attachments || [];\n this.conversationCreated.emit({\n conversation: newConversation,\n pendingMessage,\n pendingAttachments\n });\n\n } catch (error) {\n console.error('Error creating conversation from empty state:', error);\n } finally {\n this.isProcessing = false;\n }\n }\n\n onOpenEntityRecord(event: {entityName: string; compositeKey: CompositeKey}): void {\n // Pass the event up to the parent component (workspace or explorer wrapper)\n this.openEntityRecord.emit(event);\n }\n\n /** Record `open:resource` buttons → same openEntityRecord chain as agent-run links. */\n private emitOpenResourceRecord(command: OpenResourceCommand): void {\n if (!command.entityName) return;\n const entity = this.ProviderToUse.EntityByName(command.entityName);\n if (!entity) {\n console.warn('open:resource: unknown entity', command.entityName);\n return;\n }\n const compositeKey = ConversationUtility.CompositeKeyFromOpenResource(\n command,\n entity.PrimaryKeys.map(pk => pk.Name)\n );\n if (!compositeKey) {\n console.warn('open:resource: incomplete primary key', command.entityName, command);\n return;\n }\n this.openEntityRecord.emit({ entityName: command.entityName, compositeKey });\n }\n\n onNavigationRequest(event: NavigationRequest): void {\n // Pass the event up to the parent component for app-level navigation\n this.navigationRequest.emit(event);\n }\n\n viewTestRun(testRunId: string): void {\n // Open the test run record in the entity viewer\n this.openEntityRecord.emit({\n entityName: 'MJ: Test Runs',\n compositeKey: CompositeKey.FromID(testRunId)\n });\n }\n\n /**\n * A gear-gated developer link in the live call overlay asked to open a record\n * (delegated agent run / agent session). The overlay has already minimized itself\n * (the call stays live behind the floating \"on call\" pill); re-emit on the SAME\n * `openEntityRecord` chain every other chat record-open uses, so the Explorer\n * wrapper routes it through `NavigationService.OpenEntityRecord`.\n */\n onRealtimeNavigateRequest(event: RealtimeNavigateRequest): void {\n // The overlay can name any entity — resolve its key column(s) from metadata, not a hardcoded ID.\n this.openEntityRecord.emit({\n entityName: event.EntityName,\n compositeKey: CompositeKey.FromURLSegment(this.ProviderToUse.EntityByName(event.EntityName), event.RecordID)\n });\n }\n\n /**\n * Session-START hook for a realtime session that CREATED its own conversation (started\n * without one). Folds that server-created conversation into the engine's reactive cache\n * directly — ONE single-row load, only when it isn't already cached — so the sidebar list\n * emits via `Conversations$` the moment the call starts, independent of the host's refresh\n * round-trip. Also emits {@link realtimeConversationReady} so the host can react (it\n * selects on close). No-op when the session joined an existing conversation. Fire-and-forget\n * on the load: a failed load just leaves the host's emit to fold it in.\n */\n private onRealtimeSessionStarted(): void {\n const created = this.RealtimeSession.SessionCreatedConversationId;\n if (!created) {\n return;\n }\n void this.engine.EnsureConversationLoaded(created, this.currentUser);\n this.realtimeConversationReady.emit({ conversationId: created, select: false });\n }\n\n /**\n * Post-call hook. Two responsibilities:\n * 1. Reload the ACTIVE conversation's timeline so the session that just ended — whose\n * session-stamped `MJ: Conversation Details` were persisted server-side during the\n * call — surfaces as a reviewable past-session block WITHOUT a manual refresh.\n * 2. For a session that CREATED its own conversation, kick the shared auto-naming\n * helper (covered elsewhere on first utterance; this covers a silent call) and\n * emit {@link realtimeConversationReady} so the host can refresh the list + select.\n */\n private onRealtimeSessionEnded(): void {\n // (1) Refresh the active conversation's timeline (cheap — single conversation).\n void this.reloadActiveConversationTimeline();\n\n // (2) New-conversation case: let the host fold + select it.\n const conversationId = this.RealtimeSession.SessionCreatedConversationId;\n if (!conversationId) {\n return;\n }\n // Naming normally fired at the first utterance; this covers a silent call's default.\n this.realtimeConversationReady.emit({ conversationId, select: true });\n }\n\n /**\n * Surgically reloads the CURRENTLY-OPEN conversation's details so newly-persisted rows\n * (e.g. a just-ended realtime session's session-stamped caption turns) appear in the\n * timeline — and therefore in the \"review past sessions\" affordances — without a manual\n * browser refresh. Re-queries ONLY the active conversation (no broad reload), mirrors the\n * agent-completion refresh path, and no-ops when no conversation is open.\n */\n private async reloadActiveConversationTimeline(): Promise<void> {\n const conversationId = this.conversationId;\n if (!conversationId) {\n return;\n }\n try {\n await this.windowStore.RefreshLatest(this.currentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Re-read the refreshed window\n const refreshed = this.windowStore.GetSnapshot();\n this.messages = refreshed.Details;\n\n // Reprocess peripheral data + realtime session meta (drives the timeline's session cards)\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(conversationId, refreshed);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Failed to reload conversation timeline after the session ended:', error);\n }\n }\n\n /**\n * ENTRY API for SESSION REVIEW: opens the realtime overlay in review mode over this\n * conversation panel, rendering what went down in a PAST agent session (caption turns,\n * delegated-run cards, the saved read-only whiteboard). Intended for conversation\n * timeline affordances that reopen historical realtime sessions.\n *\n * @param agentSessionId The `MJ: AI Agent Sessions.ID` to review.\n * @returns `true` when the session loaded and the review opened; `false` when it\n * couldn't be loaded (missing/unreadable session) or a live call is already active.\n */\n public async OpenRealtimeSessionReview(agentSessionId: string): Promise<boolean> {\n if (this.RealtimeSession.IsActive) {\n return false; // a live call owns the overlay — don't fight it with a review\n }\n const conversationAtRequest = this._conversationId;\n const review = await this.realtimeReviewService.LoadSessionReview(agentSessionId, this.ProviderToUse);\n if (!review) {\n return false;\n }\n if (this.RealtimeSession.IsActive) {\n return false; // a live call started while the review was loading — it wins\n }\n if (!this.canHostLoadedReview(conversationAtRequest, review.ConversationID)) {\n return false; // the active conversation changed mid-load and the review isn't its own — discard, don't go stale\n }\n this.RealtimeReview = review;\n this.cdr.detectChanges();\n return true;\n }\n\n /**\n * STALENESS GUARD for the async review load: hosting is allowed when the active\n * conversation hasn't changed since the request started, OR when it HAS changed but\n * the loaded review belongs to the now-active conversation (the deep-link case where\n * the conversation selection and the review open race each other). Anything else is\n * a stale review for a conversation the user already left — never host it.\n */\n private canHostLoadedReview(conversationAtRequest: string | null, reviewConversationId: string | null): boolean {\n const current = this._conversationId;\n if (conversationAtRequest === current) {\n return true;\n }\n return !!reviewConversationId && !!current && UUIDsEqual(reviewConversationId, current);\n }\n\n /**\n * Drops any hosted SESSION REVIEW so the overlay unhosts itself. Safe to call at any\n * time: a LIVE call's overlay is unaffected (it renders off `RealtimeSession.Active$`).\n * Called on every conversation change, on the overlay's Close, and available to hosts\n * that need to programmatically dismiss a review.\n */\n public ClearRealtimeSessionReview(): void {\n if (this.RealtimeReview) {\n this.RealtimeReview = null;\n }\n }\n\n /**\n * Review mode's \"Start live session\": RESUMES the reviewed session as a new live call\n * through the SAME start path the composer's mic uses, chaining `lastSessionId` so the\n * server restores saved channel states (e.g. the whiteboard) via `PriorChannelStatesJson`.\n * The start flips `Active$` synchronously, so clearing the review immediately after\n * never unhosts the overlay mid-transition.\n */\n public async onReviewStartLive(request: RealtimeStartLiveRequest): Promise<void> {\n const agentName = this.RealtimeReview?.AgentName ?? null;\n try {\n const start = this.RealtimeSession.StartRealtimeSession(\n request.TargetAgentId,\n request.ConversationId ?? this.conversationId,\n request.LastSessionId,\n agentName,\n null, // preferredModelId\n null, // clientTools\n null, // coAgentId\n null, // configOverridesJson\n null, // recordingConsent\n null, // mediaCollectionId\n // App awareness — see message-input.startVoiceSession for the rationale.\n this.applicationId,\n this.appContext as AppContextSnapshot | null\n );\n this.RealtimeReview = null;\n await start;\n } catch (error) {\n console.error('Failed to resume the reviewed session as a live call:', error);\n MJNotificationService.Instance.CreateSimpleNotification('Could not start the live session.', 'error', 3000);\n }\n }\n\n /** Review mode's Close: drop the review state (the overlay unhosts itself). */\n public onReviewClosed(): void {\n this.ClearRealtimeSessionReview();\n }\n\n /**\n * Handles Shift+Click on an AI message bubble.\n * Dumps a live snapshot of in-memory streaming and agent-run state to the browser\n * console so engineers can debug stuck/forever-spinning conversations without\n * needing to add any temporary code.\n *\n * Usage: Hold Shift and click any AI message bubble. Open DevTools Console to see the dump.\n */\n onDiagnosticRequested(messageId: string): void {\n const streaming = this.streamingService.getDiagnosticSnapshot(messageId);\n const agentRun = this.agentRunsByDetailId.get(messageId);\n const isInProgress = this.inProgressMessageIds.includes(messageId);\n\n console.group(`%c[MJ Diagnostic Dump] Message ${messageId}`, 'color: #0076b6; font-weight: bold');\n console.log('Timestamp:', new Date().toISOString());\n console.log('ConversationID:', this.conversationId);\n console.log('isInProgress (UI):', isInProgress);\n console.log('All inProgressMessageIds:', [...this.inProgressMessageIds]);\n console.log('Streaming connection:', streaming.connectionStatus);\n console.log('Streaming callbacks registered:', streaming.callbackCount);\n if (streaming.recentCompletion) {\n console.log('Recent completion (not yet processed):', streaming.recentCompletion);\n }\n if (agentRun) {\n console.log('Agent run:', { id: agentRun.ID, status: agentRun.Status, name: agentRun.Agent });\n } else {\n console.log('Agent run: none loaded for this message');\n }\n console.groupEnd();\n }\n\n onTestFeedbackMessage(message: MJConversationDetailEntity): void {\n if (!message.TestRunID) {\n console.error('Cannot provide test feedback: message has no TestRunID');\n return;\n }\n\n this.testFeedbackDialogData = {\n testRunId: message.TestRunID,\n conversationDetailId: message.ID,\n currentUser: this.currentUser\n };\n this.showTestFeedbackDialog = true;\n }\n\n onTestFeedbackDialogClosed(result: TestFeedbackDialogResult): void {\n this.showTestFeedbackDialog = false;\n this.testFeedbackDialogData = null;\n if (result.success) {\n console.log('Test feedback saved successfully:', result.feedbackId);\n }\n }\n\n onTaskClicked(task: MJTaskEntity): void {\n // Pass task click up to workspace to navigate to Tasks tab\n this.taskClicked.emit(task);\n }\n\n onNavigateToConversation(event: {conversationId: string; taskId: string}): void {\n // Navigate to the conversation with the active task - emit to parent\n // Parent will update its selection state\n // For now, we can't navigate to a different conversation from within chat area\n // This would require emitting an event to the parent\n console.log('Navigate to conversation requested:', event.conversationId);\n }\n\n /**\n * Handle navigation request from artifact viewer Links tab\n */\n onArtifactLinkNavigation(event: {type: 'conversation' | 'collection'; id: string}): void {\n LogStatusEx({message: '🔗 Chat area: Artifact link clicked', verboseOnly: true, additionalArgs: [event]});\n this.artifactLinkClicked.emit(event);\n }\n\n /**\n * Load permissions for the given artifact\n */\n private async loadArtifactPermissions(artifactId: string, expectedConversationId?: string | null, expectedSelectedArtifactId?: string | null): Promise<boolean> {\n const canApply = () => {\n const conversationOk = expectedConversationId === undefined || this.isActiveConversation(expectedConversationId);\n const artifactOk = !expectedSelectedArtifactId || UUIDsEqual(this.selectedArtifactId, expectedSelectedArtifactId);\n return conversationOk && artifactOk;\n };\n\n // Guard against null/undefined\n if (!artifactId) {\n if (canApply()) {\n this.canShareSelectedArtifact = false;\n this.canEditSelectedArtifact = false;\n }\n return false;\n }\n\n try {\n const permissions = await this.artifactPermissionService.getUserPermissions(artifactId, this.currentUser);\n if (!canApply()) {\n return false;\n }\n this.canShareSelectedArtifact = permissions.canShare;\n this.canEditSelectedArtifact = permissions.canEdit;\n return true;\n } catch (error) {\n console.error('Failed to load artifact permissions:', error);\n if (canApply()) {\n this.canShareSelectedArtifact = false;\n this.canEditSelectedArtifact = false;\n }\n return false;\n }\n }\n\n /**\n * Handle share request from artifact viewer\n */\n async onArtifactShareRequested(artifactId: string): Promise<void> {\n // Load the artifact entity to pass to the modal\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts');\n await artifact.Load(artifactId);\n\n if (artifact) {\n this.artifactToShare = artifact;\n this.isArtifactShareModalOpen = true;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Handle Analyze button click from the artifact viewer panel.\n * Creates a user message with the artifact attached as an input,\n * then routes through the normal agent flow so the agent can\n * explore the artifact via artifact tools.\n */\n /**\n * Handle Analyze button click from the artifact viewer panel.\n *\n * Persists the captured snapshot as a new Data Snapshot artifact and attaches\n * it to the user's in-progress message as a pending attachment chip (same UX\n * as image/file uploads). On send, the existing attachment pipeline creates\n * a `ConversationDetailArtifact` with Direction='Input'; AgentRunner then\n * picks it up via `gatherConversationArtifacts` and resolves the\n * DataSnapshotToolLibrary for tool calls.\n *\n * Falls back to plain message prefill if snapshot persistence fails — the\n * user can still ask questions about the artifact that's already attached\n * to the prior conversation turn.\n */\n async OnAnalyzeArtifact(event: { artifactId: string; snapshot: DataSnapshot }): Promise<PendingAttachment | null> {\n const conversationId = this.conversationId;\n if (!conversationId || !this.currentUser) return null;\n\n const messageInput = this.getActiveMessageInputComponent();\n const snapshotTitle = event.snapshot.title || 'Untitled Snapshot';\n\n try {\n const result = await this.analyzeArtifactService.CreateSnapshotArtifact({\n snapshot: event.snapshot,\n currentUser: this.currentUser,\n environmentId: this.environmentId,\n });\n if (!this.isActiveConversation(conversationId)) {\n return null;\n }\n\n if (messageInput) {\n const rowCount = (event.snapshot.tables ?? []).reduce(\n (sum, t) => sum + (t.rows?.length ?? 0),\n 0,\n );\n const serialized = JSON.stringify(event.snapshot);\n const created = messageInput.inputBox?.mentionEditor?.AddArtifactAttachment({\n fileID: '',\n fileName: rowCount > 0\n ? `📸 ${result.title} · ${rowCount.toLocaleString()} rows`\n : `📸 ${result.title}`,\n mimeType: 'application/json',\n sizeBytes: serialized.length,\n artifactVersionId: result.artifactVersionId,\n });\n messageInput.messageText = `Analyze \"${result.title}\" — `;\n messageInput.inputBox?.focus();\n return created ?? null;\n }\n } catch (error) {\n LogStatusEx({\n message: `[OnAnalyzeArtifact] CreateSnapshotArtifact failed: ${error instanceof Error ? error.message : String(error)}`,\n verboseOnly: false,\n });\n if (!this.isActiveConversation(conversationId)) {\n return null;\n }\n if (messageInput) {\n messageInput.messageText = `Analyze \"${snapshotTitle}\" — `;\n messageInput.inputBox?.focus();\n }\n }\n return null;\n }\n\n /**\n * Handle a `client:capture-data-snapshot` actionable command emitted by an\n * analysis-class agent that needs the user's current view of an artifact to\n * answer accurately but has no Data Snapshot artifact attached.\n *\n * Flow:\n * 1. Resolve the target artifact — `command.artifactId` if provided,\n * otherwise the most-recent output artifact on the conversation.\n * 2. Open the artifact viewer panel for it (mounts the viewer plugin if not\n * already mounted).\n * 3. Poll until the viewer can produce a snapshot via\n * `GetCurrentStateSnapshot()`, with a short timeout.\n * 4. Reuse the existing `OnAnalyzeArtifact` flow to persist the snapshot\n * as a Data Snapshot artifact + attach it as a chip on the message input.\n * 5. If `command.followupMessage` is provided, replace the prefill and\n * auto-send so the agent immediately re-runs with the snapshot attached.\n * Otherwise, leave the chip + prefill in place for the user to send manually.\n *\n * Soft-fails — logs a warning and stops on any unrecoverable error rather\n * than throwing. The user's conversation state isn't disrupted.\n */\n private async handleCaptureDataSnapshotCommand(command: CaptureDataSnapshotCommand): Promise<void> {\n const conversationId = this.conversationId;\n console.log('[client:capture-data-snapshot] Handler invoked', { command, conversationId });\n if (!conversationId || !this.currentUser) {\n console.warn('[client:capture-data-snapshot] No active conversation/user; ignoring');\n return;\n }\n\n let artifactId = command.artifactId;\n if (!artifactId) {\n artifactId = (await this.findMostRecentComponentArtifactId()) ?? undefined;\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n console.log('[client:capture-data-snapshot] Resolved artifactId via lookup:', artifactId);\n } else {\n console.log('[client:capture-data-snapshot] Using artifactId from command:', artifactId);\n }\n if (!artifactId) {\n console.warn('[client:capture-data-snapshot] No artifact found on this conversation; cannot capture');\n return;\n }\n\n const panelAlreadyOpen = this.selectedArtifactId === artifactId && this.showArtifactPanel;\n console.log(\n '[client:capture-data-snapshot] Panel state — currentSelectedId=' +\n this.selectedArtifactId +\n ' showPanel=' +\n this.showArtifactPanel +\n ' panelAlreadyOpen=' +\n panelAlreadyOpen,\n );\n\n // Open the artifact panel so the viewer mounts (if it isn't already).\n if (!panelAlreadyOpen) {\n this.artifactSelectionEpoch++;\n this.selectedArtifactId = artifactId;\n this.selectedVersionNumber = undefined;\n this.showArtifactPanel = true;\n try {\n await this.loadArtifactPermissions(artifactId, conversationId, artifactId);\n } catch {\n // Non-fatal — permissions are for UI affordances, not capture\n }\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, artifactId)) {\n return;\n }\n this.cdr.detectChanges();\n console.log('[client:capture-data-snapshot] Opened artifact panel; waiting for viewer mount + data load');\n }\n\n // Poll for the snapshot — interactive components need a few render cycles\n // before `getCurrentDataState()` registers via callbacks.RegisterMethod,\n // and query-backed / server-paged components need additional time to load\n // their rows (we now wait for rows, not just a registered table).\n const snapshot = await this.waitForViewerSnapshot(15000);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, artifactId)) {\n return;\n }\n if (!snapshot) {\n console.warn('[client:capture-data-snapshot] Artifact viewer did not produce a snapshot within timeout');\n return;\n }\n\n // Persist + attach via the existing Analyze flow. Capture the created\n // PendingAttachment so we can pass it directly into sendMessageWithText\n // below — the mention-editor → message-input-box → message-input event\n // chain that normally syncs `pendingAttachments` is async (next-tick) and\n // hasn't propagated by the time we auto-send.\n const capturedAttachment = await this.OnAnalyzeArtifact({ artifactId, snapshot });\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Auto-send the followup so the agent re-runs immediately with the\n // captured snapshot now attached. Resolution order:\n // 1. command.followupMessage — if the agent provided one\n // 2. most-recent User message — re-sends the question that triggered\n // this capture exchange (typical: \"Looking at this dashboard, …\")\n // so the agent sees the same question with the artifact attached\n // 3. a generic re-prompt — last resort if no user message found\n // OnAnalyzeArtifact prefilled messageText with 'Analyze \"...\" — '; we\n // overwrite that with the resolved followup before sending.\n const messageInput = this.getActiveMessageInputComponent();\n if (messageInput) {\n let followup = command.followupMessage?.trim();\n if (!followup) {\n const lastUserMsg = [...this.messages]\n .reverse()\n .find((m) => m.Role === 'User' && m.Message && m.Message.trim().length > 0);\n followup = lastUserMsg?.Message?.trim();\n }\n if (!followup) {\n followup = 'Please answer my previous question using the captured snapshot.';\n }\n messageInput.messageText = '';\n try {\n await messageInput.sendMessageWithText(\n followup,\n capturedAttachment ? [capturedAttachment] : undefined,\n );\n } catch (error) {\n console.error('[client:capture-data-snapshot] Auto-send failed:', error);\n }\n }\n }\n\n /**\n * Poll `artifactViewerComponent.GetCurrentStateSnapshot()` for the LIVE\n * data snapshot. The React component inside the viewer plugin needs several\n * render cycles after `selectedArtifactId` changes before its inner data\n * fetches run and its `getCurrentDataState()` becomes callable via\n * `callbacks.RegisterMethod('getCurrentDataState', ...)`.\n *\n * `GetCurrentStateSnapshot()` returns three distinct shapes:\n * - **Live**: a populated DataSnapshot with `tables[]` whose rows are filled.\n * - **Fallback**: an empty placeholder with only `title` + `interpretation`\n * (\"No live data was captured — the component either has no data-fetching\n * hooks or has not yet run its queries\"). This fires when the React\n * component hasn't yet registered `getCurrentDataState()`.\n * - **Schema-only**: a structured snapshot with real `tables`/`columns` and\n * metadata (e.g. `totalAvailableRowCount`) but `rows: []`. This is common\n * for query-backed / server-paged components whose data load hasn't\n * completed (or whose visible page is empty) at the moment of capture.\n *\n * We must accept ONLY a snapshot that actually carries rows — a schema-only\n * or placeholder snapshot defeats the point of the pipeline (the analysis\n * agent receives an empty table). So we key \"live\" on `rows.length`, not just\n * `tables.length`, and keep polling so async/paged data has time to load.\n * Only after timeout do we return the last available row-less snapshot (any\n * structure is better than nothing, but the user will see an empty table in\n * the resulting artifact).\n */\n private async waitForViewerSnapshot(timeoutMs: number): Promise<DataSnapshot | null> {\n const intervalMs = 200;\n const deadline = Date.now() + timeoutMs;\n let lastFallback: DataSnapshot | null = null;\n let tick = 0;\n const startTime = Date.now();\n console.log('[client:capture-data-snapshot] Polling for live snapshot, timeout=' + timeoutMs + 'ms');\n while (Date.now() < deadline) {\n tick++;\n const viewer = this.artifactViewerComponent;\n const snap = viewer?.GetCurrentStateSnapshot?.();\n if (snap) {\n const hasLiveData = Array.isArray(snap.tables) && snap.tables.some((t) => Array.isArray(t.rows) && t.rows.length > 0);\n const tableShape = Array.isArray(snap.tables)\n ? snap.tables.map((t) => `${t.name}:${(t.rows ?? []).length}rows`).join(', ')\n : 'no-tables';\n const elapsed = Date.now() - startTime;\n // Log every 5th tick to avoid spamming\n if (tick % 5 === 1 || hasLiveData) {\n console.log(\n `[client:capture-data-snapshot] tick=${tick} elapsed=${elapsed}ms viewer=${!!viewer} ` +\n `snap=${!!snap} hasLiveData=${hasLiveData} shape=[${tableShape}] ` +\n `keys=[${Object.keys(snap).join(',')}]`,\n );\n }\n if (hasLiveData) {\n return snap; // real snapshot — done\n }\n lastFallback = snap; // remember for timeout case\n } else if (tick % 5 === 1) {\n console.log(\n `[client:capture-data-snapshot] tick=${tick} viewer=${!!viewer} snap=null (viewer hasn't returned a snapshot yet)`,\n );\n }\n await new Promise((r) => setTimeout(r, intervalMs));\n }\n if (lastFallback) {\n console.warn(\n '[client:capture-data-snapshot] Timed out waiting for live data after ' +\n timeoutMs +\n 'ms; falling back to placeholder snapshot. The component may not have registered ' +\n 'getCurrentDataState() via callbacks.RegisterMethod, OR its data has not finished loading.',\n );\n } else {\n console.warn(\n '[client:capture-data-snapshot] Timed out after ' +\n timeoutMs +\n 'ms — viewer never returned even a fallback snapshot. Artifact viewer may not have mounted.',\n );\n }\n return lastFallback;\n }\n\n /**\n * Find the most-recent Component artifact attached as `Output` to this\n * conversation. Used when a `client:capture-data-snapshot` command arrives\n * without an explicit `artifactId`.\n *\n * Filtering to Component-typed artifacts is intentional even though the\n * command type itself is artifact-generic: the downstream\n * `waitForViewerSnapshot` polling waits for `tables[]` to populate (the\n * shape Components produce via React `getCurrentDataState()`). Falling back\n * to a non-Component artifact would 10s-timeout to a placeholder snapshot.\n * When other artifact types need a usable fallback, generalize the polling\n * first, then drop the filter here.\n */\n private async findMostRecentComponentArtifactId(): Promise<string | null> {\n if (!this.conversationId || !this.currentUser) return null;\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get all conversation detail IDs for this conversation, newest first.\n const detailsResult = await rv.RunView<MJConversationDetailEntity>(\n {\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${this.conversationId}'`,\n Fields: ['ID'],\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'simple',\n },\n this.currentUser,\n );\n if (!detailsResult.Success || !detailsResult.Results?.length) return null;\n const detailIds = detailsResult.Results.map((d) => `'${d.ID}'`).join(',');\n\n // Find the most recent Output artifact junction across those details.\n const junctionResult = await rv.RunView(\n {\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${detailIds}) AND Direction='Output'`,\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'simple',\n },\n this.currentUser,\n );\n if (!junctionResult.Success || !junctionResult.Results?.length) return null;\n\n // Look up artifact IDs for each version and filter to Component type.\n const versionIds = Array.from(\n new Set((junctionResult.Results as Array<{ ArtifactVersionID: string }>).map((j) => j.ArtifactVersionID)),\n );\n if (versionIds.length === 0) return null;\n const versionFilter = versionIds.map((id) => `'${id}'`).join(',');\n const versionsResult = await rv.RunView(\n {\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionFilter})`,\n Fields: ['ID', 'ArtifactID'],\n ResultType: 'simple',\n },\n this.currentUser,\n );\n if (!versionsResult.Success || !versionsResult.Results?.length) return null;\n\n const versionToArtifact = new Map<string, string>();\n for (const v of versionsResult.Results as Array<{ ID: string; ArtifactID: string }>) {\n versionToArtifact.set(v.ID, v.ArtifactID);\n }\n\n const artifactIds = Array.from(new Set([...versionToArtifact.values()]));\n const artifactFilter = artifactIds.map((id) => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>(\n {\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactFilter})`,\n ResultType: 'simple',\n },\n this.currentUser,\n );\n if (!artifactsResult.Success || !artifactsResult.Results?.length) return null;\n\n // Resolve the Component type ID from the metadata engine to filter to it.\n const componentType = ArtifactMetadataEngine.Instance.FindArtifactType('Component');\n if (!componentType) return null;\n\n const componentArtifactIds = new Set(\n (artifactsResult.Results as Array<{ ID: string; TypeID: string | null }>)\n .filter((a) => UUIDsEqual(a.TypeID, componentType.ID))\n .map((a) => a.ID),\n );\n if (componentArtifactIds.size === 0) return null;\n\n // Walk junctions in newest-first order; return the first whose artifact is Component.\n for (const junction of junctionResult.Results as Array<{ ArtifactVersionID: string }>) {\n const artifactId = versionToArtifact.get(junction.ArtifactVersionID);\n if (artifactId && componentArtifactIds.has(artifactId)) {\n return artifactId;\n }\n }\n return null;\n } catch (error) {\n console.error('[client:capture-data-snapshot] findMostRecentComponentArtifactId failed:', error);\n return null;\n }\n }\n\n /**\n * Handle close of artifact share modal\n */\n onArtifactShareModalClose(): void {\n this.isArtifactShareModalOpen = false;\n this.artifactToShare = null;\n this.cdr.detectChanges();\n }\n\n /**\n * Handle successful share - refresh permissions\n */\n async onArtifactShared(): Promise<void> {\n this.isArtifactShareModalOpen = false;\n this.artifactToShare = null;\n\n // Refresh permissions for the active artifact\n if (this.selectedArtifactId) {\n await this.loadArtifactPermissions(this.selectedArtifactId);\n }\n this.cdr.detectChanges();\n }\n\n // Scroll functionality (pattern from skip-chat)\n checkScroll(): void {\n if (!this.scrollContainer) return;\n\n const element = this.scrollContainer.nativeElement;\n const buffer = 15; // Tolerance in pixels\n const scrollDifference = element.scrollHeight - (element.scrollTop + element.clientHeight);\n const hasScrollableContent = element.scrollHeight > element.clientHeight + 50;\n const atBottom = scrollDifference <= buffer;\n this.readerAtBottom = atBottom;\n\n const newValue = !atBottom && hasScrollableContent;\n\n // Only update if value changed to prevent unnecessary change detection\n if (this.showScrollToBottomIcon !== newValue) {\n this.showScrollToBottomIcon = newValue;\n this.cdr.detectChanges();\n }\n }\n\n scrollToBottomNow(retryCount: number = 0): void {\n try {\n if (!this.scrollContainer) {\n if (retryCount < 10) {\n setTimeout(() => this.scrollToBottomNow(retryCount + 1), 50);\n }\n return;\n }\n\n const element = this.scrollContainer.nativeElement;\n if (element.scrollHeight === 0 && retryCount < 10) {\n setTimeout(() => this.scrollToBottomNow(retryCount + 1), 50);\n } else if (element.scrollHeight > 0) {\n element.scrollTop = element.scrollHeight;\n }\n } catch (err) {\n console.error('Error scrolling to bottom:', err);\n }\n }\n\n scrollToBottomAnimate(): void {\n if (this.scrollContainer) {\n const element = this.scrollContainer.nativeElement;\n element.scroll({ top: element.scrollHeight, behavior: 'smooth' });\n }\n }\n\n /**\n * Decides where the viewport goes after the transcript changed.\n *\n * - `load` — a conversation was opened: the bottom.\n * - `new` — a message was appended: follow the tail, as before.\n * - `update` — a message already on screen changed in place (progress, status, streamed\n * text). Never moves a reader who has scrolled away; keeps a reader who is\n * at the bottom there as the bubble grows. (Before this, every progress\n * update re-ran the send path's scroll — message-input re-emits\n * `messageSent` per update — and yanked the reader to the bottom.)\n *\n * With `readReplyFromTop`, the reader's own message opens a turn — whether it arrives as\n * `new` or, on the auto-send path where the chat area already holds it, as `update` — and\n * every settled AI message of that turn (Complete or Error) lands the turn instead of\n * following, for a reader who was still following. EVERY settled message, not the first:\n * the refinement path emits a settled status line (\"Continuing with X…\") before the reply,\n * and a turn that landed on the status line alone must land again when the reply arrives\n * (re-landing is idempotent — the same target, or nothing once the reader has been moved\n * off the bottom). Completion is also emitted more than once for one message; none of those\n * emits may fall through to the bottom follow. A `load` does not forget the turn: creating\n * a conversation from the composer sends the first message while the initial load is still\n * in flight.\n */\n private followTranscript(change: 'load' | 'new' | 'update', message?: MJConversationDetailEntity): void {\n if (change === 'load') {\n this.scrollToBottom = true;\n return;\n }\n if (this.readReplyFromTop) {\n if (message?.Role === 'User' && message.ID && message.ID !== this.currentTurnStartMessageId) {\n this.currentTurnStartMessageId = message.ID;\n } else if (this.currentTurnStartMessageId && message?.Role === 'AI' && this.isSettled(message)) {\n if (this.readerAtBottom) {\n this.pendingTurnStartMessageId = this.currentTurnStartMessageId;\n this.scrollToBottom = false;\n this.bottomFollowSuppressedUntil = Date.now() + 1500;\n }\n return;\n }\n }\n if (change === 'new' || this.readerAtBottom) {\n if (change === 'new' && message?.Role === 'User') {\n // The reader sending again right after a reply landed must not be swallowed by the\n // landing's suppression. Only THEIR message lifts it: an AI message arriving new\n // inside the window belongs to the turn that just landed and must not cancel it.\n this.bottomFollowSuppressedUntil = 0;\n }\n this.scrollToBottom = true;\n }\n }\n\n private isSettled(message: MJConversationDetailEntity): boolean {\n return message.Status === 'Complete' || message.Status === 'Error';\n }\n\n /**\n * readReplyFromTop: once the reply has rendered, scrolls the turn so its first message\n * sits at the top of the pane — but only if the turn is taller than the pane. A turn that\n * fits is already fully on screen at the bottom, and moving it would be motion for nothing.\n */\n private scrollTurnToTop(messageId: string, attempt: number = 0): void {\n if (!this.readReplyFromTop) {\n return;\n }\n const container = this.scrollContainer?.nativeElement as HTMLElement | undefined;\n // Resolved through the list's timeline, not a `[data-message-id]` query: a far-off item\n // is unmounted into a spacer and a session-stamped row folds into its session card, and\n // the list answers with the node that stands for the message in either case.\n const target = this.messageListComponent?.FindTimelineElement(messageId) ?? null;\n if (!container || !target) {\n // The reply's final render lands a tick or two after the array changes — the same\n // latency the bottom-follow path absorbs with its 100 ms timer.\n if (attempt < 20) {\n this.turnStartRetryHandle = setTimeout(() => this.scrollTurnToTop(messageId, attempt + 1), 50);\n }\n return;\n }\n this.turnStartRetryHandle = null;\n const turnTop = this.offsetWithinScroller(target) - this.turnTopClearance(container);\n const turnHeight = container.scrollHeight - turnTop; // the turn is the newest content\n if (turnHeight > container.clientHeight) {\n container.scroll({ top: turnTop, behavior: 'smooth' });\n } else {\n this.scrollToBottomNow();\n }\n this.checkScroll();\n }\n\n /**\n * How far below the pane's top edge the turn's first message lands: the standard gap, plus\n * room for the list's sticky date header when it is showing — it pins to this scroller's\n * top and would otherwise sit on the message's first line.\n */\n private turnTopClearance(container: HTMLElement): number {\n const stickyHeader = container.querySelector<HTMLElement>('.sticky-date-header');\n if (!stickyHeader || !stickyHeader.offsetParent) {\n return ConversationChatAreaComponent.TURN_TOP_GAP_PX;\n }\n // The header's CSS inset (`top: 12px`), NOT `offsetTop`: on a pinned sticky element\n // `offsetTop` reports the used position, which tracks the scroll offset.\n const inset = parseFloat(getComputedStyle(stickyHeader).top) || 0;\n return ConversationChatAreaComponent.TURN_TOP_GAP_PX + stickyHeader.offsetHeight + inset;\n }\n\n /** An element's top edge in the scroller's content coordinates — what scrollTop counts in. */\n private offsetWithinScroller(el: HTMLElement): number {\n const container = this.scrollContainer.nativeElement as HTMLElement;\n return el.getBoundingClientRect().top - container.getBoundingClientRect().top + container.scrollTop;\n }\n\n private clearTurnTracking(): void {\n this.currentTurnStartMessageId = null;\n this.pendingTurnStartMessageId = null;\n this.bottomFollowSuppressedUntil = 0;\n if (this.turnStartRetryHandle) {\n clearTimeout(this.turnStartRetryHandle);\n this.turnStartRetryHandle = null;\n }\n }\n\n /**\n * Detect and reconcile agent run states against conversation detail statuses.\n * Called after loading a conversation to handle two scenarios:\n *\n * 1. **In-progress catch-up**: If an agent completed between page refresh and\n * WebSocket reconnection, the completion PubSub event is lost. We catch this\n * by comparing message status against the agent run status from the database.\n *\n * 2. **Stale error correction**: If the client previously marked a conversation\n * detail as 'Error' (e.g., due to WebSocket timeout) but the server actually\n * completed successfully, we detect the mismatch and correct it. This prevents\n * the race condition where the client overwrites a server-completed record.\n */\n private async detectAndReconcileAgentRuns(conversationId: string, loadToken: number): Promise<void> {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.reconnectInProgressRuns(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.correctStaleErrorMessages(conversationId, loadToken);\n }\n\n /**\n * Reconnect to in-progress agent runs whose completion events were missed.\n */\n private async reconnectInProgressRuns(conversationId: string, loadToken: number): Promise<void> {\n const inProgressMessages = this.messages.filter(\n m => m.Status === 'In-Progress' && m.Role === 'AI'\n );\n\n if (inProgressMessages.length === 0) {\n return;\n }\n\n LogStatusEx({message: `🔄 Found ${inProgressMessages.length} in-progress messages, checking status...`, verboseOnly: true});\n\n const completedStatuses = ['Completed', 'Failed', 'Error', 'Cancelled'];\n\n for (const message of inProgressMessages) {\n const agentRun = this.agentRunsByDetailId.get(message.ID);\n\n if (!agentRun) {\n // No agent run yet — fire-and-forget may not have created it.\n // Polling will pick this up once the server creates the run.\n LogStatusEx({message: `⏳ No agent run found for in-progress message ${message.ID}, waiting for server...`, verboseOnly: true});\n continue;\n }\n\n if (completedStatuses.includes(agentRun.Status)) {\n // Agent completed during the WebSocket reconnection gap — handle now\n LogStatusEx({message: `🔄 Agent run ${agentRun.ID} already completed (${agentRun.Status}) for message ${message.ID}, handling catch-up...`, verboseOnly: true});\n await this.handleMessageCompletion(message, agentRun.ID, conversationId, loadToken);\n } else {\n LogStatusEx({message: `🔌 Agent run ${agentRun.ID} still ${agentRun.Status} for message ${message.ID}, WebSocket will receive updates`, verboseOnly: true});\n }\n }\n }\n\n /**\n * Detect conversation details marked as 'Error' by the client whose corresponding\n * agent run actually completed successfully on the server. This corrects the race\n * condition where the client overwrote a server-completed record with an error status.\n */\n private async correctStaleErrorMessages(conversationId: string, loadToken: number): Promise<void> {\n const errorMessages = this.messages.filter(\n m => m.Status === 'Error' && m.Role === 'AI'\n );\n\n if (errorMessages.length === 0) {\n return;\n }\n\n for (const message of errorMessages) {\n const agentRun = this.agentRunsByDetailId.get(message.ID);\n if (agentRun && agentRun.Status === 'Completed') {\n LogStatusEx({message: `🔧 Correcting stale error: message ${message.ID} shows Error but agent run ${agentRun.ID} completed successfully`, verboseOnly: true});\n await this.handleMessageCompletion(message, agentRun.ID, conversationId, loadToken);\n }\n }\n }\n\n /**\n * Handle pending artifact navigation from collection\n * Opens the artifact and scrolls to the message containing it\n */\n private async handlePendingArtifactNavigation(): Promise<void> {\n if (!this.pendingArtifactId) {\n return; // No pending navigation\n }\n const pendingTargetConversationId = this.pendingArtifactConversationId ?? this.conversationId;\n if (!this.pendingArtifactId || !this.isActiveConversation(pendingTargetConversationId)) {\n return;\n }\n\n console.log('📦 Processing pending artifact navigation:', this.pendingArtifactId, 'v' + this.pendingArtifactVersionNumber);\n\n // Capture values before emitting consumed event\n const artifactIdToOpen = this.pendingArtifactId;\n const versionNumberToOpen = this.pendingArtifactVersionNumber;\n const conversationId = this.conversationId;\n\n // Notify parent that we consumed the pending artifact\n this.pendingArtifactConsumed.emit();\n\n // Find the message containing this artifact version\n let messageIdWithArtifact: string | null = null;\n\n for (const [detailId, artifactList] of this.artifactsByDetailId.entries()) {\n for (const artifactInfo of artifactList) {\n if (artifactInfo.artifactId === artifactIdToOpen) {\n // Found the artifact - check if version matches (if specified)\n if (versionNumberToOpen == null || artifactInfo.versionNumber === versionNumberToOpen) {\n messageIdWithArtifact = detailId;\n console.log('✅ Found artifact in message:', detailId);\n break;\n }\n }\n }\n if (messageIdWithArtifact) break;\n }\n\n if (!messageIdWithArtifact) {\n console.warn('⚠️ Could not find message containing artifact:', artifactIdToOpen);\n return;\n }\n\n // Open the artifact panel\n this.artifactSelectionEpoch++;\n this.selectedArtifactId = artifactIdToOpen;\n this.selectedVersionNumber = versionNumberToOpen ?? undefined;\n this.showArtifactPanel = true;\n\n // Load permissions for the artifact\n await this.loadArtifactPermissions(artifactIdToOpen, conversationId, artifactIdToOpen);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.selectedArtifactId, artifactIdToOpen)) {\n return;\n }\n this.cdr.detectChanges();\n\n // Scroll to the message\n this.scrollToMessage(messageIdWithArtifact);\n\n console.log('✅ Opened artifact and scrolled to message:', messageIdWithArtifact);\n }\n\n /**\n * Scroll to a specific message in the conversation\n * @param messageId The conversation detail ID to scroll to\n */\n private scrollToMessage(messageId: string): void {\n // Wait for DOM to update, then scroll\n setTimeout(() => {\n const messageElement = document.querySelector(`[data-message-id=\"${messageId}\"]`);\n if (messageElement) {\n messageElement.scrollIntoView({ behavior: 'smooth', block: 'center' });\n console.log('📍 Scrolled to message:', messageId);\n } else {\n console.warn('⚠️ Message element not found for ID:', messageId);\n }\n }, 300); // Give time for artifact panel to open and DOM to render\n }\n\n /**\n * Handle intent check started - show temporary \"Analyzing intent...\" message\n */\n async onIntentCheckStarted(event: {conversationId: string}): Promise<void> {\n // Guard: ignore intent-check UI from a background conversation's input after a swap,\n // so the \"Analyzing...\" placeholder isn't injected into the displayed conversation.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n const md = this.ProviderToUse;\n const tempMessage = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.currentUser);\n\n // Create a temporary message that looks like an AI response in-progress\n tempMessage.Message = '🔍 Analyzing your request to determine the best agent...';\n tempMessage.Role = 'AI';\n tempMessage.Status = 'In-Progress';\n // Set created date using LoadFromData to bypass read-only protection\n tempMessage.LoadFromData({\n Message: tempMessage.Message,\n Role: tempMessage.Role,\n Status: tempMessage.Status,\n __mj_CreatedAt: new Date()\n });\n // No ID means it's temporary (won't be saved)\n\n this.intentCheckMessage = tempMessage;\n this.messages = [...this.messages, tempMessage];\n this.followTranscript('new', tempMessage);\n this.cdr.detectChanges();\n }\n\n /**\n * Handle intent check completed - remove temporary message\n */\n onIntentCheckCompleted(event: {conversationId: string}): void {\n // Guard (symmetric with onIntentCheckStarted): ignore a background conversation's\n // intent-check completion after a swap. Without this, a late completion from the\n // conversation the user just left would remove the ACTIVE conversation's own\n // \"Analyzing...\" placeholder (intentCheckMessage is a single shared field).\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n if (this.intentCheckMessage) {\n // Remove the temporary intent check message\n this.messages = this.messages.filter(m => m !== this.intentCheckMessage);\n this.intentCheckMessage = null;\n this.cdr.detectChanges();\n }\n }\n}\n","<div class=\"chat-area\">\n <!-- agentPresence slot — sticky top, anchored with the header. Per Matt's\n 06-10 design: persistent presence indicator (Sid's face + live voice\n state). Off by default; opt in via [showAgentCharacter]. When a\n consumer projects an `mjChatSlot=\"agentPresence\"` template, it\n replaces the default presence component. -->\n @if (showAgentCharacter) {\n <div class=\"chat-agent-presence\" [class.chat-agent-presence--prominent]=\"agentCharacterConfig?.voiceStateMode === 'prominent'\">\n @if (slotTemplate('agentPresence'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: agentCharacterConfig,\n state: agentCharacterConfig?.state ?? 'idle',\n agentName: agentCharacterConfig?.characterName,\n avatarUrl: agentCharacterConfig?.avatarUrl,\n mode: agentCharacterConfig?.voiceStateMode ?? 'subtle'\n }\"></ng-container>\n } @else {\n <mj-chat-agent-presence-default\n [State]=\"agentCharacterConfig?.state ?? 'idle'\"\n [AgentName]=\"agentCharacterConfig?.characterName\"\n [AvatarUrl]=\"agentCharacterConfig?.avatarUrl\"\n [Mode]=\"agentCharacterConfig?.voiceStateMode ?? 'subtle'\">\n </mj-chat-agent-presence-default>\n }\n </div>\n }\n\n <!-- header slot — replaces the entire chat-header chrome (title, badges,\n export/share/agent-picker buttons). When projected, the consumer owns\n the entire header rendering; the default chrome below is bypassed\n wholesale. Context exposes the minimal IMJChatHeaderComponent shape;\n consumers needing more app state should bind to chat-area inputs\n directly via @ViewChild or wrap the whole component. -->\n @if (slotTemplate('header'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n conversationTitle: conversation?.Name ?? null,\n sharedBy: sharedByBadge?.display ?? null,\n artifactCount: artifactCountDisplay,\n showArtifactIndicator: showArtifactIndicator\n }\"></ng-container>\n } @else if (conversation || HasPreConversationHeader) {\n <!-- Default header — also renders BEFORE a conversation exists when the\n embedder has pre-conversation chrome to surface (currently just the\n mode picker — agent / share / export / members / artifacts all\n require a conversation row and stay hidden). Lets embedded surfaces\n like the Form Builder cockpit show the mode picker above the\n empty-state on a fresh chat instead of waiting for the first\n message to round-trip. -->\n <div class=\"chat-header\">\n <div class=\"chat-info\" [class.with-sidebar-toggle]=\"showSidebarToggle\">\n @if (showSidebarToggle) {\n <button class=\"sidebar-toggle-btn\"\n (click)=\"sidebarToggleClicked.emit()\"\n title=\"Show conversations\">\n <i class=\"fas fa-table-columns\"></i>\n </button>\n }\n @if (conversation) {\n <div class=\"chat-title\">{{ conversation.Name || '' }}</div>\n }\n @if (sharedByBadge) {\n <span class=\"shared-by-badge\" [title]=\"sharedByBadge.fullTooltip\">\n <i class=\"fas fa-share-nodes\"></i>\n <span>Shared by {{ sharedByBadge.display }}</span>\n </span>\n }\n @if (conversation?.ProjectID) {\n <button class=\"project-tag\" (click)=\"openProjectSelector()\" title=\"Assign to project\">\n <i class=\"fas fa-folder\"></i>\n <span>{{ conversation!.Project || 'Project' }}</span>\n </button>\n }\n @if (conversation?.TestRunID) {\n <button class=\"test-indicator\" (click)=\"viewTestRun(conversation!.TestRunID!)\" title=\"View Test Run\">\n <i class=\"fas fa-flask\"></i>\n <span>Test</span>\n </button>\n }\n </div>\n <div class=\"chat-actions chat-actions-buttons\">\n @if (allowPinning && pinnedMessageCount > 0) {\n <button class=\"pin-chip\" [class.active]=\"showPinsPanel\" (click)=\"TogglePinsPanel()\" title=\"View pinned messages\">\n <i class=\"fas fa-thumbtack\"></i>\n <span class=\"pin-chip-count\">{{ pinnedMessageCount }}</span>\n </button>\n }\n @if (showArtifactIndicator && artifactCountDisplay > 0) {\n <button class=\"artifact-indicator\" (click)=\"viewArtifacts()\" title=\"View artifacts\">\n <i class=\"fas fa-cube\"></i>\n <span class=\"artifact-badge\">{{ artifactCountDisplay }}</span>\n </button>\n }\n @if (memberCount > 1) {\n <button class=\"chat-members\" (click)=\"toggleMembersModal()\" title=\"View members\">\n <i class=\"fas fa-users\"></i>\n <span class=\"members-badge\">{{ memberCount }}</span>\n </button>\n }\n @if (!overlayMode && showAgentModePicker && ModePickerTargetAgentId) {\n <!-- Per-agent mode/quality picker (Draft / Standard / High).\n Targets the agent the next non-mention message will route\n to. Auto-hides when that agent has fewer than 2 configured\n presets. Choice persists per-user, per-agent via\n UserInfoEngine; emits the picked configuration ID up so\n <mj-message-input> can forward it on the next route.\n Hidden in overlayMode (the compact chat overlay): the\n mode dropdown wastes the narrow top-right space there. -->\n <mj-conversation-mode-picker\n [AgentID]=\"ModePickerTargetAgentId\"\n [Disabled]=\"isProcessing\"\n (PresetChanged)=\"OnAgentModePresetChanged($event)\">\n </mj-conversation-mode-picker>\n }\n @if (showAgentPicker && conversation) {\n <!-- Per-conversation default-agent pin. When set, non-mention\n messages route to this agent instead of Sage. Persists to\n MJConversationEntity.DefaultAgentID. Hidden when no\n conversation is loaded or when the embedder disables it. -->\n <mj-conversation-agent-picker\n [Conversation]=\"conversation\"\n [CurrentUser]=\"currentUser\"\n [Disabled]=\"isReadOnlyView\">\n </mj-conversation-agent-picker>\n }\n @if (showExportButton) {\n <button mjButton variant=\"flat\" size=\"sm\" (click)=\"exportConversation()\" [title]=\"exportButtonLabel + ' conversation'\">\n <i [class]=\"exportButtonIcon\"></i>\n <span class=\"btn-label\">{{ exportButtonLabel }}</span>\n </button>\n }\n @if (showShareButton && canShareConversation) {\n <button mjButton variant=\"flat\" size=\"sm\"\n [class.shared]=\"isShared\"\n (click)=\"shareConversation()\"\n [title]=\"isShared ? 'Manage sharing' : 'Share conversation'\">\n <i class=\"fas fa-share-nodes\"></i>\n <span class=\"btn-label\">Share</span>\n </button>\n }\n <!-- headerActions slot — ADDITIVE host buttons rendered after the stock\n actions (unlike the `header` slot, which replaces the whole header\n and therefore never reaches this branch). For visual parity,\n projected buttons should use mjButton variant=\"flat\" size=\"sm\". -->\n @if (slotTemplate('headerActions'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n conversationId: conversationId,\n isProcessing: isProcessing\n }\"></ng-container>\n }\n </div>\n </div>\n }\n\n <!-- Messages and Artifact Split Layout — restructures into [stage | rail]\n when isDemonstrationActive (per Matt's 06-10 design). The .demonstration-mode\n class drives the CSS Grid switch; the stage container renders only when the\n slot is projected AND the host opts in via [showDemonstrationSurface]. -->\n <div class=\"chat-content-area\" [class.demonstration-mode]=\"isDemonstrationActive\">\n <!-- demonstrationSurface stage — takes the main pane; messages shrink to\n a side rail (or move below on mobile). Off unless both\n [showDemonstrationSurface] is true AND a slot template is projected. -->\n @if (isDemonstrationActive) {\n <div class=\"chat-demonstration-stage\">\n <ng-container *ngTemplateOutlet=\"slotTemplate('demonstrationSurface'); context: {\n $implicit: demonstrationSurfaceContent,\n content: demonstrationSurfaceContent,\n visible: showDemonstrationSurface\n }\"></ng-container>\n </div>\n }\n\n <!-- Messages Pane -->\n <div class=\"chat-messages-pane\"\n [class.full-width]=\"!showArtifactPanel\"\n [class.hidden]=\"isArtifactPaneMaximized\">\n @if (isLoadingConversation) {\n <!-- Loading State - checked FIRST to prevent empty state flash. The branch\n always short-circuits the panes below; showLoadingState only controls\n whether the built-in spinner renders (hosts with their own loading\n chrome set it false and get a blank pane instead). -->\n @if (showLoadingState) {\n <div class=\"conversation-loading-state\">\n <mj-loading text=\"Loading conversation...\" size=\"large\"></mj-loading>\n </div>\n }\n } @else if ((isNewConversation || !conversationId) && !suppressNewConversationEmptyState) {\n <!-- emptyState slot — when a consumer projects mjChatSlot=\"emptyState\",\n they take over the entire empty-state region (including any send\n affordance — the slot interface doesn't include a sendMessage\n output, so consumers handle send via their own input). When no\n slot is projected, the rich built-in <mj-conversation-empty-state>\n renders with its own greeting, prompt chips, and message input.\n emptyStateConfig (when supplied) takes precedence over the legacy\n [emptyStateGreeting] string for backwards compatibility. -->\n @if (slotTemplate('emptyState'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: emptyStateConfig,\n greeting: emptyStateConfig?.greeting ?? emptyStateGreeting,\n subtext: emptyStateConfig?.subtext,\n suggestedPrompts: emptyStateConfig?.suggestedPrompts ?? []\n }\"></ng-container>\n } @else {\n <mj-conversation-empty-state\n [currentUser]=\"currentUser\"\n [initialDraft]=\"GetInitialDraftFor(null)\"\n (initialDraftApplied)=\"OnComposerDraftApplied()\"\n (DraftStateChanged)=\"OnDraftStateChanged(null, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [disabled]=\"isProcessing\"\n [showSidebarToggle]=\"showSidebarToggle\"\n [overlayMode]=\"overlayMode\"\n [greeting]=\"emptyStateConfig?.greeting ?? emptyStateGreeting\"\n [showSuggestedPrompts]=\"showSuggestedPrompts\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n (sidebarToggleClicked)=\"sidebarToggleClicked.emit()\"\n (messageSent)=\"onEmptyStateMessageSent($event)\">\n </mj-conversation-empty-state>\n }\n } @else if ((isNewConversation || !conversationId) && suppressNewConversationEmptyState) {\n <!-- Pre-conversation normal-view: empty message list + emptyStateMode input.\n Used when host (e.g. Form Builder cockpit) wants the header + mode picker\n visible on first open instead of the centered welcome card. First send\n routes through onEmptyStateMessageSent which creates the conversation. -->\n <div class=\"chat-messages-wrapper\">\n <div class=\"chat-messages-container\"></div>\n <div class=\"chat-input-container\">\n <div class=\"message-input-container-wrapper\">\n <mj-message-input\n #emptyStateInput\n [emptyStateMode]=\"true\"\n [initialDraft]=\"GetInitialDraftFor(null)\"\n (initialDraftApplied)=\"OnComposerDraftApplied()\"\n (DraftStateChanged)=\"OnDraftStateChanged(null, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [currentUser]=\"currentUser\"\n [disabled]=\"isProcessing\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [enablePlanMode]=\"allowPlanMode\"\n [enableRealtime]=\"allowRealtime\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n (emptyStateSubmit)=\"onEmptyStateMessageSent($event)\">\n </mj-message-input>\n </div>\n </div>\n </div>\n } @else {\n <!-- Normal Message View -->\n <div class=\"chat-messages-wrapper\">\n <!-- Upload Indicator Overlay (centered in conversation area) -->\n @if (isUploadingAttachments) {\n <div class=\"upload-indicator-overlay\">\n <mj-loading [text]=\"uploadingMessage\" size=\"medium\"></mj-loading>\n </div>\n }\n <div class=\"chat-messages-container\" #scrollContainer (scroll)=\"checkScroll()\">\n <mj-conversation-message-list\n [showEmptyFill]=\"showEmptyFill\"\n [showDateNavigation]=\"showDateNavigation\"\n [showAgentRunDetails]=\"showAgentRunDetails\"\n [showReactions]=\"showReactions\"\n [showMessageRating]=\"showMessageRating\"\n [allowPinning]=\"allowPinning\"\n [allowMessageEdit]=\"allowMessageEdit\"\n [allowMessageDelete]=\"allowMessageDelete\"\n [assistantDisplayName]=\"assistantDisplayName\"\n [assistantAvatarUrl]=\"assistantAvatarUrl\"\n [messages]=\"messages\"\n [HasMoreAbove]=\"hasMoreMessagesAbove\"\n [IsLoadingOlder]=\"isLoadingOlderMessages\"\n [ScrollRoot]=\"messageScrollRoot\"\n (OlderRequested)=\"onOlderMessagesRequested()\"\n (DateJumpRequested)=\"onDateJumpRequested($event)\"\n [conversation]=\"conversation\"\n [currentUser]=\"currentUser\"\n [isProcessing]=\"isProcessing\"\n [artifactMap]=\"effectiveArtifactsMap\"\n [agentRunMap]=\"agentRunsByDetailId\"\n [ratingsMap]=\"ratingsByDetailId\"\n [userAvatarMap]=\"userAvatarMap\"\n [attachmentsMap]=\"attachmentsByDetailId\"\n [messageRendererTemplate]=\"slotTemplate('messageRenderer')\"\n [messageExtraTemplate]=\"slotTemplate('messageExtra')\"\n [sessionMetaMap]=\"realtimeSessionMetaMap\"\n (realtimeSessionOpenRequested)=\"OpenRealtimeSessionReview($event)\"\n (replyInThread)=\"onReplyInThread($event)\"\n (viewThread)=\"onViewThread($event)\"\n (deleteMessage)=\"onDeleteMessage($event)\"\n (retryMessage)=\"onRetryMessage($event)\"\n (testFeedbackMessage)=\"onTestFeedbackMessage($event)\"\n (artifactClicked)=\"onArtifactClicked($event)\"\n (messageEdited)=\"onMessageEdited($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (suggestedResponseSelected)=\"onSuggestedResponseSelected($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\"\n (diagnosticRequested)=\"onDiagnosticRequested($event)\"\n (messagePinToggled)=\"onMessagePinToggled($event)\"\n (beforeResponseFormSubmitted)=\"beforeResponseFormSubmitted.emit($event)\"\n (afterResponseFormSubmitted)=\"afterResponseFormSubmitted.emit($event)\">\n </mj-conversation-message-list>\n\n <!-- Scroll to Bottom Icon (positioned within scroll container for proper centering) -->\n @if (showScrollToBottomIcon && messages && messages.length > 0) {\n <span class=\"scroll-to-bottom-icon\" style=\"left: 50%;\"\n (click)=\"scrollToBottomAnimate()\">\n <i class=\"fas fa-arrow-down\"></i>\n </span>\n }\n </div>\n\n <!-- Fixed Input Area -->\n <div class=\"chat-input-container\">\n @if (isLoadingPeripheralData) {\n <!-- Loading State -->\n <div class=\"loading-peripheral-placeholder\">\n <mj-loading text=\"Loading conversation data...\" size=\"medium\"></mj-loading>\n </div>\n } @else {\n @if (isReadOnlyView) {\n <div class=\"read-only-banner\" role=\"status\">\n <i class=\"fas fa-eye\"></i>\n <span>You have view-only access to this conversation.</span>\n </div>\n }\n <!-- Input Component - Multiple instances cached, only one visible -->\n <div class=\"message-input-container-wrapper\">\n @for (inputRef of getCachedInputs(); track inputRef.conversationId) {\n <mj-message-input\n #messageInput\n [hidden]=\"inputRef.conversationId !== conversationId\"\n [initialDraft]=\"GetInitialDraftFor(inputRef.conversationId)\"\n (DraftStateChanged)=\"OnDraftStateChanged(inputRef.conversationId, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [conversationId]=\"inputRef.conversationId\"\n [conversationName]=\"inputRef.conversationName\"\n [currentUser]=\"currentUser\"\n [conversationHistory]=\"inputRef.conversationId === conversationId ? messages : []\"\n [artifactsByDetailId]=\"inputRef.conversationId === conversationId ? artifactsByDetailId : emptyArtifactsMap\"\n [systemArtifactsByDetailId]=\"inputRef.conversationId === conversationId ? systemArtifactsByDetailId : emptyArtifactsMap\"\n [agentRunsByDetailId]=\"inputRef.conversationId === conversationId ? agentRunsByDetailId : emptyAgentRunsMap\"\n [appContext]=\"appContext\"\n [applicationId]=\"applicationId\"\n [defaultAgentId]=\"defaultAgentId\"\n [conversationDefaultAgentId]=\"inputRef.conversationId === conversationId ? (conversation?.DefaultAgentID ?? null) : null\"\n [agentConfigurationPresetId]=\"inputRef.conversationId === conversationId ? ActiveAgentConfigurationPresetId : null\"\n [inProgressMessageIds]=\"inputRef.conversationId === conversationId ? inProgressMessageIds : emptyInProgressIds\"\n [disabled]=\"isProcessing || isReadOnlyView\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [enablePlanMode]=\"allowPlanMode\"\n [enableRealtime]=\"allowRealtime\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [initialMessage]=\"shouldDeliverPendingMessageTo(inputRef.conversationId) ? pendingMessage : null\"\n [initialAttachments]=\"shouldDeliverPendingMessageTo(inputRef.conversationId) ? pendingAttachments : null\"\n (initialMessageAutoSendStarted)=\"onInitialMessageAutoSendStarted($event)\"\n (initialMessageAutoSendFailed)=\"onInitialMessageAutoSendFailed($event)\"\n (messageSent)=\"onMessageSent($event)\"\n (agentResponse)=\"onAgentResponse($event)\"\n (agentRunDetected)=\"onAgentRunDetected($event)\"\n (agentRunUpdate)=\"onAgentRunUpdate($event)\"\n (messageComplete)=\"onMessageComplete($event)\"\n (artifactCreated)=\"onArtifactCreated($event)\"\n (conversationRenamed)=\"onConversationRenamed($event)\"\n (intentCheckStarted)=\"onIntentCheckStarted($event)\"\n (intentCheckCompleted)=\"onIntentCheckCompleted($event)\"\n (beforeAgentTurn)=\"beforeAgentTurn.emit($event)\"\n (afterAgentTurn)=\"afterAgentTurn.emit($event)\"\n (uploadStateChanged)=\"onUploadStateChanged($event)\">\n </mj-message-input>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- Artifact Viewer Pane -->\n @if (showArtifactPanel && selectedArtifactId) {\n @if (!isArtifactPaneMaximized) {\n <div class=\"resize-handle\" (mousedown)=\"onResizeStart($event)\" (touchstart)=\"onResizeTouchStart($event)\"></div>\n }\n <div class=\"chat-artifact-pane\"\n [style.width.%]=\"artifactPaneWidth\"\n [class.maximized]=\"isArtifactPaneMaximized\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [versionNumber]=\"selectedVersionNumber\"\n [viewContext]=\"'conversation'\"\n [canShare]=\"canShareSelectedArtifact\"\n [canEdit]=\"canEditSelectedArtifact\"\n [isMaximized]=\"isArtifactPaneMaximized\"\n [refreshTrigger]=\"artifactViewerRefresh$\"\n (closed)=\"onCloseArtifactPanel()\"\n (saveToCollectionRequested)=\"onSaveToCollectionRequested($event)\"\n (navigateToLink)=\"onArtifactLinkNavigation($event)\"\n (shareRequested)=\"onArtifactShareRequested($event)\"\n (maximizeToggled)=\"toggleMaximizeArtifactPane()\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (navigationRequest)=\"onNavigationRequest($event)\"\n (analyzeRequested)=\"OnAnalyzeArtifact($event)\"\n (applyFormRequested)=\"OnApplyFormRequested($event)\">\n </mj-artifact-viewer-panel>\n </div>\n }\n\n <!-- Artifact Share Modal -->\n <mj-artifact-share-modal\n [isOpen]=\"isArtifactShareModalOpen\"\n [artifact]=\"artifactToShare\"\n [currentUser]=\"currentUser\"\n (saved)=\"onArtifactShared()\"\n (cancelled)=\"onArtifactShareModalClose()\">\n </mj-artifact-share-modal>\n\n <!-- Pinned Messages Panel (overlay) -->\n @if (allowPinning && showPinsPanel) {\n <mj-pinned-messages-panel\n [pinnedMessages]=\"pinnedMessages\"\n [isLoading]=\"isLoadingPins\"\n (closed)=\"showPinsPanel = false\"\n (jumpRequested)=\"onJumpToMessage($event)\"\n (unpinRequested)=\"onUnpinFromPanel($event)\">\n </mj-pinned-messages-panel>\n }\n </div>\n\n <!-- Live voice \"call mode\" overlay — fills this conversation panel in place\n (header + thread + composer) while a realtime session is active. When the\n call is MINIMIZED (e.g. a dev link navigated to a record) the overlay HIDES\n (not destroyed — its merged session state must survive), the session stays\n fully live, and a floating \"on call\" pill offers the way back.\n ALSO hosted in SESSION REVIEW mode (RealtimeReview set, no live call): the\n overlay renders what went down in a PAST session, with a \"Start live session\"\n button that resumes it as a new call. -->\n @if ((RealtimeSession.Active$ | async) || RealtimeReview) {\n <mj-realtime-session-overlay\n [AgentName]=\"realtimeOverlayAgentName\"\n [Hidden]=\"(RealtimeSession.Minimized$ | async) === true\"\n [CurrentUser]=\"currentUser\"\n [EnvironmentID]=\"environmentId\"\n [ReviewData]=\"RealtimeReview\"\n [Chrome]=\"overlayMode ? 'orb' : 'auto'\"\n [Compact]=\"overlayMode\"\n [ShowDevLinks]=\"!overlayMode\"\n [ShowDensityPicker]=\"!overlayMode\"\n (NavigateRequest)=\"onRealtimeNavigateRequest($event)\"\n (StartLiveRequested)=\"onReviewStartLive($event)\"\n (ReviewClosed)=\"onReviewClosed()\">\n </mj-realtime-session-overlay>\n @if (RealtimeSession.Minimized$ | async) {\n <button type=\"button\" class=\"voice-call-pill\" (click)=\"RealtimeSession.SetMinimized(false)\"\n title=\"Return to the live call\" aria-label=\"Return to the live call\">\n <span class=\"voice-call-pill__pulse\" aria-hidden=\"true\"></span>\n <i class=\"fa-solid fa-phone-volume\" aria-hidden=\"true\"></i>\n <span class=\"voice-call-pill__text\">\n <span class=\"voice-call-pill__name\">On call · {{ RealtimeSession.CurrentAgentName }}</span>\n <span class=\"voice-call-pill__hint\">Tap to return</span>\n </span>\n </button>\n }\n }\n</div>\n\n<!-- Thread Panel -->\n@if (threadId) {\n <mj-thread-panel\n [parentMessageId]=\"threadId\"\n [conversationId]=\"conversationId || ''\"\n [currentUser]=\"currentUser\"\n (closed)=\"onLocalThreadClosed()\"\n (replyAdded)=\"onThreadReplyAdded($event)\">\n </mj-thread-panel>\n}\n\n<!-- Export Modal -->\n<!-- [branding] is bound BEFORE [isVisible] deliberately: Angular sets inputs in\n template order within a change-detection pass, and the modal's isVisible setter\n reads `branding` to default its \"Include branding\" checkbox on a fresh open. -->\n<mj-export-modal\n [branding]=\"exportBranding\"\n [isVisible]=\"showExportModal\"\n [conversation]=\"conversation || undefined\"\n [currentUser]=\"currentUser\"\n (cancelled)=\"onExportModalCancelled()\"\n (exported)=\"onExportModalComplete()\">\n</mj-export-modal>\n\n<!-- Share Dialog (generic, shared with dashboards) -->\n<mj-resource-share-dialog\n [Visible]=\"showShareModal\"\n [Context]=\"shareContext\"\n [Adapter]=\"shareAdapter\"\n (Result)=\"onShareDialogResult($event)\">\n</mj-resource-share-dialog>\n\n<!-- Members Modal -->\n<mj-members-modal\n [isVisible]=\"showMembersModal\"\n [conversation]=\"conversation || undefined\"\n [currentUser]=\"currentUser\"\n (cancelled)=\"showMembersModal = false\"\n (membersChanged)=\"showMembersModal = false\">\n</mj-members-modal>\n\n<!-- Project Selector Modal -->\n@if (showProjectSelector && conversation) {\n <div class=\"modal-overlay\" (click)=\"showProjectSelector = false\">\n <div class=\"modal-content project-selector-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>Assign Project</h3>\n <button class=\"modal-close-btn\" (click)=\"showProjectSelector = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"modal-body\">\n <mj-project-selector\n [environmentId]=\"environmentId\"\n [currentUser]=\"currentUser\"\n [selectedProjectId]=\"conversation.ProjectID\"\n (projectSelected)=\"onProjectSelected($event)\">\n </mj-project-selector>\n </div>\n </div>\n </div>\n}\n\n<!-- Artifacts Modal -->\n@if (showArtifactsModal) {\n <div class=\"modal-overlay\" (click)=\"showArtifactsModal = false\">\n <div class=\"modal-content artifacts-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>Conversation Artifacts</h3>\n <div class=\"modal-header-actions\">\n @if (hasSystemArtifacts) {\n <button class=\"toggle-system-btn\"\n [class.active]=\"showSystemArtifacts\"\n (click)=\"toggleSystemArtifacts()\"\n title=\"Toggle system artifacts visibility\">\n <i class=\"fas fa-cog\"></i>\n <span>{{ showSystemArtifacts ? 'Hide' : 'Show' }} System</span>\n </button>\n }\n <button class=\"modal-close-btn\" (click)=\"showArtifactsModal = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n <div class=\"modal-body artifacts-grid\">\n @if (artifactsByDetailId.size === 0) {\n <mj-empty-state\n class=\"artifacts-empty-fill\"\n Icon=\"fa-solid fa-cube\"\n Title=\"No artifacts in this conversation yet\" />\n }\n @for (artifact of getArtifactsArray(); track artifact.artifactId) {\n <div class=\"artifact-modal-card\"\n [class.expanded]=\"expandedArtifactId === artifact.artifactId\"\n [class.system-artifact]=\"artifact.visibility === 'System Only'\">\n <!-- Main card header - click to open latest version -->\n <div class=\"artifact-card-header\" (click)=\"openArtifactFromModal(artifact.artifactId)\">\n <div class=\"artifact-modal-icon\">\n <i class=\"fas fa-file-code\"></i>\n </div>\n <div class=\"artifact-modal-info\">\n <div class=\"artifact-modal-title\">{{artifact.name}}</div>\n <div class=\"artifact-modal-meta\">\n @if (artifact.versionCount > 1) {\n {{artifact.versionCount}} versions\n } @else {\n 1 version\n }\n </div>\n </div>\n @if (artifact.versionCount > 1) {\n <button class=\"expand-btn\" (click)=\"toggleArtifactExpansion(artifact.artifactId, $event)\">\n <i class=\"fas\" [class.fa-chevron-down]=\"expandedArtifactId !== artifact.artifactId\"\n [class.fa-chevron-up]=\"expandedArtifactId === artifact.artifactId\"></i>\n </button>\n }\n <div class=\"artifact-modal-action\">\n <i class=\"fas fa-external-link-alt\"></i>\n </div>\n </div>\n\n <!-- Expanded version list -->\n @if (expandedArtifactId === artifact.artifactId && artifact.versionCount > 1) {\n <div class=\"artifact-versions-list\">\n @for (version of artifact.versions; track version.versionId) {\n <div class=\"artifact-version-item\" (click)=\"openArtifactFromModal(artifact.artifactId, version.versionNumber); $event.stopPropagation()\">\n <span class=\"version-badge\">v{{version.versionNumber}}</span>\n <span class=\"version-open-text\">Open this version</span>\n <i class=\"fas fa-arrow-right\"></i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n}\n\n<!-- Collection Picker Modal -->\n@if (showCollectionPicker) {\n <mj-artifact-collection-picker-modal\n [isOpen]=\"showCollectionPicker\"\n [environmentId]=\"environmentId\"\n [currentUser]=\"currentUser\"\n [excludeCollectionIds]=\"collectionPickerExcludedIds\"\n [artifactVersionId]=\"collectionPickerVersionId\"\n [artifactName]=\"collectionPickerArtifactName\"\n [artifactVersionNumber]=\"collectionPickerVersionNumber\"\n (completed)=\"onCollectionPickerCompleted($event)\"\n (cancelled)=\"onCollectionPickerCancelled()\">\n </mj-artifact-collection-picker-modal>\n}\n\n<!-- Test Feedback Dialog -->\n@if (testFeedbackDialogData) {\n <mj-test-feedback-dialog\n [data]=\"testFeedbackDialogData\"\n [visible]=\"showTestFeedbackDialog\"\n (closed)=\"onTestFeedbackDialogClosed($event)\">\n </mj-test-feedback-dialog>\n}\n\n<!-- Image Viewer Modal -->\n@if (showImageViewer) {\n <mj-image-viewer\n [imageUrl]=\"selectedImageUrl\"\n [alt]=\"selectedImageAlt\"\n [fileName]=\"selectedImageFileName\"\n [visible]=\"showImageViewer\"\n (closed)=\"onImageViewerClosed()\">\n </mj-image-viewer>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation-chat-area.component.js","sourceRoot":"","sources":["../../../../src/lib/components/conversation/conversation-chat-area.component.ts","../../../../src/lib/components/conversation/conversation-chat-area.component.html"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B;;kBAC3B,YAAY;mBAAC,cAAc;;kBAS3B,KAAK;;kBAGL,KAAK;;kBAQL,MAAM;;kBASN,MAAM;;kBAON,KAAK;;kBAkBL,KAAK;;kBAKL,MAAM;;kBASN,MAAM;;kBA6FN,SAAS;mBAAC,4BAA4B;;kBACtC,SAAS;mBAAC,+BAA+B;;kBAMzC,eAAe;mBAAC,iBAAiB;;kBAspBjC,SAAS;mBAAC,oBAAoB;;kFA3iEpB,6BAA6B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, ViewChildren, QueryList, ContentChildren, TemplateRef, ElementRef, AfterViewChecked, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { UserInfo, RunView, RunQuery, Metadata, CompositeKey, LogStatusEx, TransformSimpleObjectToEntityObject, DataSnapshot } from '@memberjunction/core';\nimport { MJConversationEntity, MJConversationDetailEntity, MJAIAgentRunEntity, MJArtifactEntity, MJTaskEntity, ArtifactMetadataEngine, ConversationEngine, ConversationDetailComplete, RatingJSON, ArtifactJSON } from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended, CaptureDataSnapshotCommand, AppContextSnapshot, ConversationUtility, OpenResourceCommand } from \"@memberjunction/ai-core-plus\";\nimport { ActionableCommandRequest, UICommandHandlerService } from '../../services/ui-command-handler.service';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { AgentStateService } from '../../services/agent-state.service';\nimport { ConversationAgentService } from '../../services/conversation-agent.service';\nimport {\n ConversationDetailWindowStore,\n ConversationDetailWindowSnapshot\n} from '../../services/conversation-detail-window.store';\nimport { ActiveTasksService } from '../../services/active-tasks.service';\nimport { PendingAttachment } from '@memberjunction/ng-composer';\nimport { MentionAutocompleteService } from '../../services/mention-autocomplete.service';\nimport { ArtifactPermissionService } from '../../services/artifact-permission.service';\nimport { ConversationAttachmentService } from '../../services/conversation-attachment.service';\nimport { MJResourcePermissionShareAdapter, ResourceShareContext } from '@memberjunction/ng-resource-permissions';\n\n/** `MJ: Resource Types.ID` for Conversations. */\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nimport { MessageAttachment } from '../message/message-item.component';\nimport { LazyArtifactInfo } from '../../models/lazy-artifact-info';\nimport { MessageInputComponent } from '../message/message-input.component';\nimport { ArtifactViewerPanelComponent, NavigationRequest, AnalyzeArtifactService, InteractiveFormApplyService } from '@memberjunction/ng-artifacts';\nimport type { ComponentSpec } from '@memberjunction/interactive-component-types';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { ComposerDraftStore } from '../../services/composer-draft-store';\nimport { ConversationEmptyStateComponent } from './conversation-empty-state.component';\nimport { TestFeedbackDialogData, TestFeedbackDialogResult } from '@memberjunction/ng-testing';\nimport { DialogService as ConversationsDialogService } from '../../services/dialog.service';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ConversationStreamingService } from '../../services/conversation-streaming.service';\nimport { ConversationBridgeService } from '../../services/conversation-bridge.service';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { ConversationsRuntime, type MentionPerson } from '@memberjunction/conversations-runtime';\nimport type { AgentReplyMode, AgentTurnHandler } from '../../models/agent-turn.model';\nimport { RealtimeSessionService } from '../../services/realtime-session.service';\nimport { RealtimeSessionReview, RealtimeSessionReviewService } from '../../services/realtime-session-review.service';\nimport { GenerateAndApplyConversationName } from '../../services/conversation-naming';\nimport type { ExportBranding } from '../../services/export.service';\nimport { RealtimeNavigateRequest, RealtimeStartLiveRequest } from '../realtime/realtime-session-overlay.component';\nimport {\n CollectRealtimeSessionIDs,\n MapRealtimeSessionMeta,\n REALTIME_SESSION_META_FIELDS,\n RealtimeSessionMetaRow,\n RealtimeSessionTimelineMeta\n} from '../../utils/realtime-session-timeline';\nimport {\n ResolveDateJumpTarget,\n CombineDateJumpOutcome,\n DescribeDateJumpOutcome,\n DATE_JUMP_MAX_PAGES,\n type DateJumpPeriod,\n type DateJumpOutcome\n} from '../../utils/date-jump';\nimport { MessageListComponent } from '../message/message-list.component';\nimport { DecideArtifactPanelAction, SnapshotArtifactVersions, ArtifactPanelAction, ArtifactPanelBaseline, ArtifactVersionRef } from '../../utils/artifact-panel-action';\nimport { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';\n\n// PR 2c — Widget extension surface\nimport { ChatSlotDirective, type MJChatSlotName } from '../../directives/chat-slot.directive';\nimport type {\n IMJChatAgentPresenceComponent,\n MJChatAgentPresenceState,\n IMJChatEmptyStateComponent,\n} from '../slots/slot-interfaces';\nimport {\n BeforeAgentTurnEventArgs,\n AfterAgentTurnEventArgs,\n BeforeToolInvokedEventArgs,\n AfterToolInvokedEventArgs,\n BeforeResponseFormSubmittedEventArgs,\n AfterResponseFormSubmittedEventArgs,\n SessionStartedEventArgs,\n SessionChannelStateChangedEventArgs,\n SessionEndedEventArgs,\n} from '../../events/chat-events';\n\n/**\n * Configuration for the persona/character rendering in the `agentPresence` slot.\n * Off by default — opt in via `showAgentCharacter`. Mirrors {@link IMJChatAgentPresenceComponent}.\n */\nexport interface AgentCharacterConfig {\n /** Optional avatar URL. */\n avatarUrl?: string;\n /** Display name. */\n characterName?: string;\n /** Visual intensity. */\n voiceStateMode?: 'subtle' | 'prominent';\n /** Current voice state — drives state-colored styling on the default presence component. */\n state?: MJChatAgentPresenceState;\n}\n\n/**\n * Configuration payload for the `emptyState` slot's default component. When\n * supplied, drives the empty-state's greeting / subtext / suggested prompts.\n */\nexport interface EmptyStateConfig {\n greeting?: string;\n subtext?: string;\n suggestedPrompts?: string[];\n /** Hide the default suggested prompts even if greeting/subtext are set. */\n hideDefaultPrompts?: boolean;\n}\n\n/** Default width (percentage) for the artifact viewer pane */\nexport const DEFAULT_ARTIFACT_PANE_WIDTH = 40;\n\n@Component({\n standalone: false,\n selector: 'mj-conversation-chat-area',\n templateUrl: `./conversation-chat-area.component.html`,\n styleUrls: ['./conversation-chat-area.component.css']\n})\nexport class ConversationChatAreaComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewChecked {\n @Input() EnvironmentId!: string;\n\n /** @deprecated Use {@link EnvironmentId}. */\n @Input() set environmentId(value: string) {\n this.EnvironmentId = value;\n }\n /** @deprecated Use {@link EnvironmentId}. */\n get environmentId(): string {\n return this.EnvironmentId;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n\n // LOCAL STATE INPUTS - passed from parent workspace\n private _conversationId: string | null = null;\n @Input()\n set ConversationId(value: string | null) {\n if (value !== this._conversationId) {\n // Leaving a conversation is a save point for its in-progress draft.\n // (Optional-chained: harness-constructed instances may skip field initializers.)\n this.draftStore?.Flush();\n this._conversationId = value;\n // SESSION-REVIEW lifecycle: changing the active conversation must NEVER leave a\n // stale review overlay hosted over the new conversation. A LIVE call is untouched\n // by this — the overlay's live mode renders off RealtimeSession.Active$, not\n // RealtimeReview (and a review can't open while a call is live anyway).\n this.ClearRealtimeSessionReview();\n // Trigger change handler after initialization is complete\n // Only skip during Angular's initial binding before ngOnInit completes\n if (this.isInitialized) {\n this.onConversationChanged(value);\n }\n }\n }\n get ConversationId(): string | null {\n return this._conversationId;\n }\n\n /** @deprecated Use {@link ConversationId}. */\n get conversationId(): string | null {\n return this.ConversationId;\n }\n /** @deprecated Use {@link ConversationId}. */\n @Input() set conversationId(value: string | null) {\n this.ConversationId = value;\n }\n\n @Input() Conversation: MJConversationEntity | null = null;\n\n /** @deprecated Use {@link Conversation}. */\n @Input() set conversation(value: MJConversationEntity | null) {\n this.Conversation = value;\n }\n /** @deprecated Use {@link Conversation}. */\n get conversation(): MJConversationEntity | null {\n return this.Conversation;\n }\n @Input() ThreadId: string | null = null;\n\n /** @deprecated Use {@link ThreadId}. */\n @Input() set threadId(value: string | null) {\n this.ThreadId = value;\n }\n /** @deprecated Use {@link ThreadId}. */\n get threadId(): string | null {\n return this.ThreadId;\n }\n\n /**\n * When true, render the normal message-list + message-input layout even\n * before a conversation exists, instead of the centered empty-state\n * welcome card. Lets host pages (e.g. Form Builder cockpit) put the chat\n * header + mode picker front-and-center on first open and let the user\n * pick a mode before typing. The first send still routes through\n * MessageInputComponent and triggers conversationCreated as usual.\n */\n @Input() SuppressNewConversationEmptyState = false;\n\n /** @deprecated Use {@link SuppressNewConversationEmptyState}. */\n @Input() set suppressNewConversationEmptyState(value: ConversationChatAreaComponent['SuppressNewConversationEmptyState']) {\n this.SuppressNewConversationEmptyState = value;\n }\n /** @deprecated Use {@link SuppressNewConversationEmptyState}. */\n get suppressNewConversationEmptyState(): ConversationChatAreaComponent['SuppressNewConversationEmptyState'] {\n return this.SuppressNewConversationEmptyState;\n }\n\n /**\n * Host-level MASTER cap for the composer's mention/command triggers.\n * Defaults true. When false, ALL triggers (@ agents, # entities, / skills)\n * are off regardless of the per-type flags below. Hosts addressing a single\n * fixed agent (e.g. Form Builder cockpit) can set false wholesale.\n */\n @Input() AllowMentions = true;\n\n /** @deprecated Use {@link AllowMentions}. */\n @Input() set allowMentions(value: ConversationChatAreaComponent['AllowMentions']) {\n this.AllowMentions = value;\n }\n /** @deprecated Use {@link AllowMentions}. */\n get allowMentions(): ConversationChatAreaComponent['AllowMentions'] {\n return this.AllowMentions;\n }\n\n /**\n * Per-type caps under {@link allowMentions}, all default true. Let a host keep\n * one trigger while dropping another — e.g. a white-label surface pinned to a\n * default agent that wants to offer `/` skill-commands but NOT `@` agent\n * mentions (an `@` overrides the pinned default agent in message routing).\n * Effective only when `allowMentions` is also true.\n */\n @Input() AllowAgentMentions = true;\n\n /** @deprecated Use {@link AllowAgentMentions}. */\n @Input() set allowAgentMentions(value: ConversationChatAreaComponent['AllowAgentMentions']) {\n this.AllowAgentMentions = value;\n }\n /** @deprecated Use {@link AllowAgentMentions}. */\n get allowAgentMentions(): ConversationChatAreaComponent['AllowAgentMentions'] {\n return this.AllowAgentMentions;\n }\n @Input() AllowEntityMentions = true;\n\n /** @deprecated Use {@link AllowEntityMentions}. */\n @Input() set allowEntityMentions(value: ConversationChatAreaComponent['AllowEntityMentions']) {\n this.AllowEntityMentions = value;\n }\n /** @deprecated Use {@link AllowEntityMentions}. */\n get allowEntityMentions(): ConversationChatAreaComponent['AllowEntityMentions'] {\n return this.AllowEntityMentions;\n }\n @Input() AllowSkillCommands = true;\n\n /** @deprecated Use {@link AllowSkillCommands}. */\n @Input() set allowSkillCommands(value: ConversationChatAreaComponent['AllowSkillCommands']) {\n this.AllowSkillCommands = value;\n }\n /** @deprecated Use {@link AllowSkillCommands}. */\n get allowSkillCommands(): ConversationChatAreaComponent['AllowSkillCommands'] {\n return this.AllowSkillCommands;\n }\n\n /**\n * Host-level cap for attachments. Defaults true. When false, the host\n * disables attachments regardless of agent modality support — useful for\n * surfaces where attachments don't make sense (cockpit text-only flows).\n * When true (default), attachment availability still depends on the\n * agent's modality support, computed at runtime.\n */\n @Input() AllowAttachments = true;\n\n /** @deprecated Use {@link AllowAttachments}. */\n @Input() set allowAttachments(value: ConversationChatAreaComponent['AllowAttachments']) {\n this.AllowAttachments = value;\n }\n /** @deprecated Use {@link AllowAttachments}. */\n get allowAttachments(): ConversationChatAreaComponent['AllowAttachments'] {\n return this.AllowAttachments;\n }\n\n /**\n * Host-level cap for the composer's Plan Mode toggle. Defaults true\n * (current behavior). White-labeled / end-user hosts that don't expose\n * plan-mode workflows set false to remove the button entirely.\n */\n @Input() AllowPlanMode = true;\n\n /** @deprecated Use {@link AllowPlanMode}. */\n @Input() set allowPlanMode(value: ConversationChatAreaComponent['AllowPlanMode']) {\n this.AllowPlanMode = value;\n }\n /** @deprecated Use {@link AllowPlanMode}. */\n get allowPlanMode(): ConversationChatAreaComponent['AllowPlanMode'] {\n return this.AllowPlanMode;\n }\n\n /**\n * Host-level cap for the composer's realtime voice-call launcher (and its\n * options caret). Defaults true (current behavior). Hosts with no voice\n * experience set false to remove the buttons entirely.\n */\n @Input() AllowRealtime = true;\n\n /** @deprecated Use {@link AllowRealtime}. */\n @Input() set allowRealtime(value: ConversationChatAreaComponent['AllowRealtime']) {\n this.AllowRealtime = value;\n }\n /** @deprecated Use {@link AllowRealtime}. */\n get allowRealtime(): ConversationChatAreaComponent['AllowRealtime'] {\n return this.AllowRealtime;\n }\n\n /**\n * Whether the message list renders its built-in \"No messages yet\" filler\n * when a conversation has zero messages. Defaults true. Hosts that render\n * their own empty-state chrome around the chat area set false.\n */\n @Input() ShowEmptyFill = true;\n\n /** @deprecated Use {@link ShowEmptyFill}. */\n @Input() set showEmptyFill(value: ConversationChatAreaComponent['ShowEmptyFill']) {\n this.ShowEmptyFill = value;\n }\n /** @deprecated Use {@link ShowEmptyFill}. */\n get showEmptyFill(): ConversationChatAreaComponent['ShowEmptyFill'] {\n return this.ShowEmptyFill;\n }\n\n /**\n * Whether the built-in centered loading indicator renders while a\n * conversation loads. Defaults true. When false the pane stays blank\n * during the load (the loading branch still short-circuits rendering, so\n * no premature empty-state flash). Hosts with their own loading chrome\n * set false.\n */\n @Input() ShowLoadingState = true;\n\n /** @deprecated Use {@link ShowLoadingState}. */\n @Input() set showLoadingState(value: ConversationChatAreaComponent['ShowLoadingState']) {\n this.ShowLoadingState = value;\n }\n /** @deprecated Use {@link ShowLoadingState}. */\n get showLoadingState(): ConversationChatAreaComponent['ShowLoadingState'] {\n return this.ShowLoadingState;\n }\n\n /**\n * Read each reply from its top instead of its bottom.\n *\n * Default false (current behaviour): the pane follows the tail, so a run ends with the\n * reader looking at the END of the answer and scrolling back up to start reading it.\n *\n * When true, sending and the run itself behave as before, but when the reply lands and\n * the reader was following it, the turn — the reader's own message with the reply under\n * it — is scrolled so it starts at the top of the pane, IF it is taller than the pane. A\n * turn that fits stays where it is: it is all on screen anyway. A reader who scrolled up\n * during the run is never moved; the scroll-to-bottom button is their way back.\n */\n @Input() ReadReplyFromTop = false;\n\n /** @deprecated Use {@link ReadReplyFromTop}. */\n @Input() set readReplyFromTop(value: ConversationChatAreaComponent['ReadReplyFromTop']) {\n this.ReadReplyFromTop = value;\n }\n /** @deprecated Use {@link ReadReplyFromTop}. */\n get readReplyFromTop(): ConversationChatAreaComponent['ReadReplyFromTop'] {\n return this.ReadReplyFromTop;\n }\n\n // --- Additional host-level feature gates (all default true; false removes the\n // affordance entirely). Forwarded to the message list / message items / empty\n // state so white-labeled end-user surfaces can pare the chat down through the\n // component contract instead of CSS on internal class names. ---\n /** Show the per-message agent run-detail grid (run ID, step/token counts, $ cost). */\n @Input() ShowAgentRunDetails = true;\n\n /** @deprecated Use {@link ShowAgentRunDetails}. */\n @Input() set showAgentRunDetails(value: ConversationChatAreaComponent['ShowAgentRunDetails']) {\n this.ShowAgentRunDetails = value;\n }\n /** @deprecated Use {@link ShowAgentRunDetails}. */\n get showAgentRunDetails(): ConversationChatAreaComponent['ShowAgentRunDetails'] {\n return this.ShowAgentRunDetails;\n }\n /** Show the per-message reaction buttons (like / comment). */\n @Input() ShowReactions = true;\n\n /** @deprecated Use {@link ShowReactions}. */\n @Input() set showReactions(value: ConversationChatAreaComponent['ShowReactions']) {\n this.ShowReactions = value;\n }\n /** @deprecated Use {@link ShowReactions}. */\n get showReactions(): ConversationChatAreaComponent['ShowReactions'] {\n return this.ShowReactions;\n }\n /** Show the per-message thumbs rating control on completed AI messages. */\n @Input() ShowMessageRating = true;\n\n /** @deprecated Use {@link ShowMessageRating}. */\n @Input() set showMessageRating(value: ConversationChatAreaComponent['ShowMessageRating']) {\n this.ShowMessageRating = value;\n }\n /** @deprecated Use {@link ShowMessageRating}. */\n get showMessageRating(): ConversationChatAreaComponent['ShowMessageRating'] {\n return this.ShowMessageRating;\n }\n /** Allow pinning messages (per-message pin button, the header pin chip, and the pinned-messages panel). */\n @Input() AllowPinning = true;\n\n /** @deprecated Use {@link AllowPinning}. */\n @Input() set allowPinning(value: ConversationChatAreaComponent['AllowPinning']) {\n this.AllowPinning = value;\n }\n /** @deprecated Use {@link AllowPinning}. */\n get allowPinning(): ConversationChatAreaComponent['AllowPinning'] {\n return this.AllowPinning;\n }\n /** Allow editing the user's own messages (per-message edit button). */\n @Input() AllowMessageEdit = true;\n\n /** @deprecated Use {@link AllowMessageEdit}. */\n @Input() set allowMessageEdit(value: ConversationChatAreaComponent['AllowMessageEdit']) {\n this.AllowMessageEdit = value;\n }\n /** @deprecated Use {@link AllowMessageEdit}. */\n get allowMessageEdit(): ConversationChatAreaComponent['AllowMessageEdit'] {\n return this.AllowMessageEdit;\n }\n /** Allow deleting the user's own messages (per-message delete button). */\n @Input() AllowMessageDelete = true;\n\n /** @deprecated Use {@link AllowMessageDelete}. */\n @Input() set allowMessageDelete(value: ConversationChatAreaComponent['AllowMessageDelete']) {\n this.AllowMessageDelete = value;\n }\n /** @deprecated Use {@link AllowMessageDelete}. */\n get allowMessageDelete(): ConversationChatAreaComponent['AllowMessageDelete'] {\n return this.AllowMessageDelete;\n }\n /** Show the empty-state's built-in suggested-prompt chips (and the @mention tip). */\n @Input() ShowSuggestedPrompts = true;\n\n /** @deprecated Use {@link ShowSuggestedPrompts}. */\n @Input() set showSuggestedPrompts(value: ConversationChatAreaComponent['ShowSuggestedPrompts']) {\n this.ShowSuggestedPrompts = value;\n }\n /** @deprecated Use {@link ShowSuggestedPrompts}. */\n get showSuggestedPrompts(): ConversationChatAreaComponent['ShowSuggestedPrompts'] {\n return this.ShowSuggestedPrompts;\n }\n /** Show the message list's sticky date header + jump-to-date navigation. */\n @Input() ShowDateNavigation = true;\n\n /** @deprecated Use {@link ShowDateNavigation}. */\n @Input() set showDateNavigation(value: ConversationChatAreaComponent['ShowDateNavigation']) {\n this.ShowDateNavigation = value;\n }\n /** @deprecated Use {@link ShowDateNavigation}. */\n get showDateNavigation(): ConversationChatAreaComponent['ShowDateNavigation'] {\n return this.ShowDateNavigation;\n }\n\n // --- Assistant identity overrides (both default null = engine-resolved agent\n // identity, today's behavior). White-label hosts brand the AI side of the\n // message feed — the persona NAME shown on AI messages and an IMAGE avatar\n // replacing the Font Awesome agent icon — through the component contract\n // instead of ::ng-deep on .message-sender / .avatar-circle internals.\n // Complements agentCharacterConfig, which covers only the presence strip. ---\n /** Display name for AI messages (e.g. a per-tenant persona). Null = the agent record's name. */\n @Input() AssistantDisplayName: string | null = null;\n\n /** @deprecated Use {@link AssistantDisplayName}. */\n @Input() set assistantDisplayName(value: string | null) {\n this.AssistantDisplayName = value;\n }\n /** @deprecated Use {@link AssistantDisplayName}. */\n get assistantDisplayName(): string | null {\n return this.AssistantDisplayName;\n }\n /** Image URL for the AI message avatar. Null = the agent's Font Awesome icon. */\n @Input() AssistantAvatarUrl: string | null = null;\n\n /** @deprecated Use {@link AssistantAvatarUrl}. */\n @Input() set assistantAvatarUrl(value: string | null) {\n this.AssistantAvatarUrl = value;\n }\n /** @deprecated Use {@link AssistantAvatarUrl}. */\n get assistantAvatarUrl(): string | null {\n return this.AssistantAvatarUrl;\n }\n\n private _isNewConversation: boolean = false;\n @Input()\n set IsNewConversation(value: boolean) {\n this._isNewConversation = value;\n if (value) {\n this.focusEmptyStateInput();\n }\n }\n get IsNewConversation(): boolean {\n return this._isNewConversation;\n }\n\n /** @deprecated Use {@link IsNewConversation}. */\n get isNewConversation(): boolean {\n return this.IsNewConversation;\n }\n /** @deprecated Use {@link IsNewConversation}. */\n @Input() set isNewConversation(value: boolean) {\n this.IsNewConversation = value;\n }\n\n // Using getter/setter to ensure correct type handling\n private _pendingMessage: string | null = null;\n @Input()\n set PendingMessage(value: string | null) {\n const previousPendingMessage = this._pendingMessage;\n // Handle case where an object is incorrectly passed\n if (value && typeof value === 'object' && 'text' in value) {\n this._pendingMessage = (value as { text: string }).text;\n } else {\n this._pendingMessage = value;\n }\n // Once the host clears the pending message (consumed), drop the captured target so a later\n // pending message can't be misrouted to a stale conversation.\n if (!this._pendingMessage) {\n this._pendingMessageTargetId = null;\n this._pendingMessageReservedTargetId = null;\n } else if (this._pendingMessage !== previousPendingMessage) {\n this._pendingMessageReservedTargetId = null;\n }\n }\n get PendingMessage(): string | null {\n return this._pendingMessage;\n }\n\n /** @deprecated Use {@link PendingMessage}. */\n get pendingMessage(): string | null {\n return this.PendingMessage;\n }\n /** @deprecated Use {@link PendingMessage}. */\n @Input() set pendingMessage(value: string | null) {\n this.PendingMessage = value;\n }\n\n /**\n * The conversation the {@link pendingMessage} was created FOR. The pending message's\n * auto-send is delivered ONLY to the cached input whose conversationId matches this —\n * NOT the live-active conversationId. Without this, swapping conversations during the\n * (async) auto-send window lets the swapped-to conversation's input grab the still-set\n * pendingMessage and send it too, duplicating the message into the wrong conversation.\n *\n * Hosts MAY set this explicitly; it also self-resolves from {@link _pendingMessageTargetId}\n * (captured in onEmptyStateMessageSent) so the guard works regardless of host wiring.\n */\n @Input() PendingMessageConversationId: string | null = null;\n\n /** @deprecated Use {@link PendingMessageConversationId}. */\n @Input() set pendingMessageConversationId(value: string | null) {\n this.PendingMessageConversationId = value;\n }\n /** @deprecated Use {@link PendingMessageConversationId}. */\n get pendingMessageConversationId(): string | null {\n return this.PendingMessageConversationId;\n }\n\n /** Internally-captured target for {@link pendingMessage}, set when this component creates a\n * new conversation from the empty state. Host-independent; immune to conversation-swap timing. */\n private _pendingMessageTargetId: string | null = null;\n private _pendingMessageReservedTargetId: string | null = null;\n\n /**\n * The conversation a pending message must be delivered to. Prefers the explicit host input,\n * then the internally-captured new-conversation target, finally the active conversation\n * (legacy fallback for single-conversation hosts that never swap).\n */\n public get EffectivePendingMessageTarget(): string | null {\n return this.PendingMessageConversationId ?? this._pendingMessageTargetId ?? this.ConversationId;\n }\n\n public ShouldDeliverPendingMessageTo(conversationId: string): boolean {\n const targetId = this.EffectivePendingMessageTarget;\n return UUIDsEqual(conversationId, targetId) && !UUIDsEqual(this._pendingMessageReservedTargetId, targetId);\n }\n\n /** @deprecated Use {@link ShouldDeliverPendingMessageTo}. */\n public shouldDeliverPendingMessageTo(conversationId: string): boolean {\n return this.ShouldDeliverPendingMessageTo(conversationId);\n }\n\n // Using getter/setter to ensure reactivity\n private _pendingAttachments: PendingAttachment[] | null = null;\n @Input()\n set PendingAttachments(value: PendingAttachment[] | null) {\n this._pendingAttachments = value;\n }\n get PendingAttachments(): PendingAttachment[] | null {\n return this._pendingAttachments;\n }\n\n /** @deprecated Use {@link PendingAttachments}. */\n get pendingAttachments(): PendingAttachment[] | null {\n return this.PendingAttachments;\n }\n /** @deprecated Use {@link PendingAttachments}. */\n @Input() set pendingAttachments(value: PendingAttachment[] | null) {\n this.PendingAttachments = value;\n }\n\n @Input() PendingArtifactId: string | null = null;\n\n /** @deprecated Use {@link PendingArtifactId}. */\n @Input() set pendingArtifactId(value: string | null) {\n this.PendingArtifactId = value;\n }\n /** @deprecated Use {@link PendingArtifactId}. */\n get pendingArtifactId(): string | null {\n return this.PendingArtifactId;\n }\n @Input() PendingArtifactVersionNumber: number | null = null;\n\n /** @deprecated Use {@link PendingArtifactVersionNumber}. */\n @Input() set pendingArtifactVersionNumber(value: number | null) {\n this.PendingArtifactVersionNumber = value;\n }\n /** @deprecated Use {@link PendingArtifactVersionNumber}. */\n get pendingArtifactVersionNumber(): number | null {\n return this.PendingArtifactVersionNumber;\n }\n @Input() PendingArtifactConversationId: string | null = null;\n\n /** @deprecated Use {@link PendingArtifactConversationId}. */\n @Input() set pendingArtifactConversationId(value: string | null) {\n this.PendingArtifactConversationId = value;\n }\n /** @deprecated Use {@link PendingArtifactConversationId}. */\n get pendingArtifactConversationId(): string | null {\n return this.PendingArtifactConversationId;\n }\n\n /** When true, the component is rendered inside the floating overlay (hides suggested topics, etc.) */\n @Input() OverlayMode: boolean = false;\n\n /** @deprecated Use {@link OverlayMode}. */\n @Input() set overlayMode(value: boolean) {\n this.OverlayMode = value;\n }\n /** @deprecated Use {@link OverlayMode}. */\n get overlayMode(): boolean {\n return this.OverlayMode;\n }\n\n /** Show the Export button in the conversation header. Default true. */\n @Input() ShowExportButton: boolean = true;\n\n /** @deprecated Use {@link ShowExportButton}. */\n @Input() set showExportButton(value: boolean) {\n this.ShowExportButton = value;\n }\n /** @deprecated Use {@link ShowExportButton}. */\n get showExportButton(): boolean {\n return this.ShowExportButton;\n }\n\n /** Label for the header Export button (white-label hosts relabel it, e.g. \"Download\"). */\n @Input() ExportButtonLabel: string = 'Export';\n\n /** @deprecated Use {@link ExportButtonLabel}. */\n @Input() set exportButtonLabel(value: string) {\n this.ExportButtonLabel = value;\n }\n /** @deprecated Use {@link ExportButtonLabel}. */\n get exportButtonLabel(): string {\n return this.ExportButtonLabel;\n }\n\n /** Font Awesome class(es) for the header Export button's icon. */\n @Input() ExportButtonIcon: string = 'fas fa-download';\n\n /** @deprecated Use {@link ExportButtonIcon}. */\n @Input() set exportButtonIcon(value: string) {\n this.ExportButtonIcon = value;\n }\n /** @deprecated Use {@link ExportButtonIcon}. */\n get exportButtonIcon(): string {\n return this.ExportButtonIcon;\n }\n\n /**\n * Branding applied to exported files (theme tokens / logo / title) — forwarded\n * to the export modal, where it also defaults the \"Include branding\" checkbox\n * on. See `ExportBranding` in the export service. Null (default) keeps the\n * stock unthemed export.\n */\n @Input() ExportBranding: ExportBranding | null = null;\n\n /** @deprecated Use {@link ExportBranding}. */\n @Input() set exportBranding(value: ExportBranding | null) {\n this.ExportBranding = value;\n }\n /** @deprecated Use {@link ExportBranding}. */\n get exportBranding(): ExportBranding | null {\n return this.ExportBranding;\n }\n\n /** Show the Share button in the conversation header. Default true. */\n @Input() ShowShareButton: boolean = true;\n\n /** @deprecated Use {@link ShowShareButton}. */\n @Input() set showShareButton(value: boolean) {\n this.ShowShareButton = value;\n }\n /** @deprecated Use {@link ShowShareButton}. */\n get showShareButton(): boolean {\n return this.ShowShareButton;\n }\n\n /** Show the artifact count indicator in the conversation header. Default true. */\n @Input() ShowArtifactIndicator: boolean = true;\n\n /** @deprecated Use {@link ShowArtifactIndicator}. */\n @Input() set showArtifactIndicator(value: boolean) {\n this.ShowArtifactIndicator = value;\n }\n /** @deprecated Use {@link ShowArtifactIndicator}. */\n get showArtifactIndicator(): boolean {\n return this.ShowArtifactIndicator;\n }\n\n /** Application context snapshot for AI agent awareness. Included in agent execution data. */\n @Input() AppContext: Record<string, unknown> | null = null;\n\n /** @deprecated Use {@link AppContext}. */\n @Input() set appContext(value: Record<string, unknown> | null) {\n this.AppContext = value;\n }\n /** @deprecated Use {@link AppContext}. */\n get appContext(): Record<string, unknown> | null {\n return this.AppContext;\n }\n\n /**\n * Optional default agent ID for the conversation. Forwarded to\n * `<mj-message-input>` as its `[defaultAgentId]` so the first message\n * routes directly to this agent instead of Sage. See\n * `MessageInputComponent.routeMessage` priority rules — explicit\n * @mention and prior-agent continuity still take precedence.\n *\n * Embedded chat surfaces (Form Builder cockpit, future domain chats)\n * set this to the specialist agent's ID; the main Chat app leaves it\n * unset to preserve the Sage-fronted UX.\n */\n @Input() DefaultAgentId: string | null = null;\n\n /** @deprecated Use {@link DefaultAgentId}. */\n @Input() set defaultAgentId(value: string | null) {\n this.DefaultAgentId = value;\n }\n /** @deprecated Use {@link DefaultAgentId}. */\n get defaultAgentId(): string | null {\n return this.DefaultAgentId;\n }\n\n // ── Host rules for chats with several people ────────────────────────────\n // All opt-in and forwarded to every composer the chat area shows. Left at their defaults,\n // the chat area behaves exactly as before. See MessageInputComponent for each rule in full.\n\n /**\n * When a message starts an agent turn. `'Always'` (the default) answers every message;\n * `'MentionOnly'` answers only a message that tags an agent, and posts any other message\n * with no turn at all (no reply row, no placeholder, no turn events).\n */\n @Input() AgentReplyMode: AgentReplyMode = 'Always';\n\n /**\n * The agents that may answer in this chat: narrows the '@' list, every route, the\n * conversation manager's delegation, and the pin and voice pickers. Null (the default)\n * allows every agent the user can run; an empty list allows none.\n */\n @Input() AllowedAgentIDs: readonly string[] | null = null;\n\n /**\n * The people the '@' list offers, such as the chat's members. Null (the default) offers only\n * the current user, as before.\n */\n @Input() MentionPeople: readonly MentionPerson[] | null = null;\n\n /**\n * The first moment of the conversation an agent turn may read. The server loads the agent's\n * history from there and uses no summary of earlier messages. Null (the default) reads the\n * whole conversation.\n */\n @Input() AgentHistoryFrom: Date | null = null;\n\n /**\n * Runs agent turns on the host's server instead of MJ's own path, after routing and\n * `BeforeAgentTurn`, before any reply row exists. Null (the default) runs them on MJ's path.\n */\n @Input() AgentTurnHandler: AgentTurnHandler | null = null;\n\n /**\n * Whether MJ names a new conversation from its first message or its first voice utterance.\n * True (the default) keeps today's behavior; a host that names its own chats turns it off.\n */\n @Input() AutoNameConversation: boolean = true;\n\n /**\n * Scope to apply when this surface CREATES a new conversation. Forwarded\n * to `ConversationEngine.CreateConversation` so the new row's\n * `ApplicationScope` column is stamped correctly. Embedded surfaces\n * (e.g. the Form Builder cockpit) set this to `'Application'` so their\n * conversations don't pollute the main Chat app list. Main Chat leaves\n * it as the default `'Global'`. Has no effect on existing conversations.\n */\n @Input() ApplicationScope: 'Global' | 'Application' | 'Both' = 'Global';\n\n /** @deprecated Use {@link ApplicationScope}. */\n @Input() set applicationScope(value: 'Global' | 'Application' | 'Both') {\n this.ApplicationScope = value;\n }\n /** @deprecated Use {@link ApplicationScope}. */\n get applicationScope(): 'Global' | 'Application' | 'Both' {\n return this.ApplicationScope;\n }\n\n /**\n * Application ID to bind a newly-created conversation to. REQUIRED when\n * `applicationScope` is 'Application' or 'Both' (DB CHECK constraint\n * enforces it). Used by embedded chat surfaces to scope their\n * conversations to their owning Application.\n */\n @Input() ApplicationId: string | null = null;\n\n /** @deprecated Use {@link ApplicationId}. */\n @Input() set applicationId(value: string | null) {\n this.ApplicationId = value;\n }\n /** @deprecated Use {@link ApplicationId}. */\n get applicationId(): string | null {\n return this.ApplicationId;\n }\n\n /**\n * \"What is this conversation about?\" — the Entity ID this conversation\n * references. Forwarded to `ConversationEngine.CreateConversation` so\n * the new row's `LinkedEntityID` is stamped at creation time. Paired\n * with {@link linkedRecordId} (DB CHECK requires both populated or both\n * null). Form Builder cockpit passes the MJ: Components entity ID;\n * Component Studio's AI panel does the same. Surfaces use this to\n * later list \"prior conversations about THIS form/component.\"\n * Has no effect on existing conversations.\n */\n @Input() LinkedEntityId: string | null = null;\n\n /** @deprecated Use {@link LinkedEntityId}. */\n @Input() set linkedEntityId(value: string | null) {\n this.LinkedEntityId = value;\n }\n /** @deprecated Use {@link LinkedEntityId}. */\n get linkedEntityId(): string | null {\n return this.LinkedEntityId;\n }\n\n /**\n * Primary key of the linked record, serialized as a string. Used with\n * {@link linkedEntityId}. Form Builder cockpit passes the active\n * form's ComponentID; Component Studio's AI panel passes the\n * currently-selected component's ID.\n */\n @Input() LinkedRecordId: string | null = null;\n\n /** @deprecated Use {@link LinkedRecordId}. */\n @Input() set linkedRecordId(value: string | null) {\n this.LinkedRecordId = value;\n }\n /** @deprecated Use {@link LinkedRecordId}. */\n get linkedRecordId(): string | null {\n return this.LinkedRecordId;\n }\n\n /**\n * Whether the conversation header should render the per-conversation\n * agent picker. Default true. The picker lets a user pin a default\n * agent on the active conversation (saved to\n * `MJConversationEntity.DefaultAgentID`), so non-mention messages route\n * to that agent instead of through Sage. Surfaces with no meaningful\n * agent-choice UX can set this to false to hide the widget.\n */\n @Input() ShowAgentPicker: boolean = true;\n\n /** @deprecated Use {@link ShowAgentPicker}. */\n @Input() set showAgentPicker(value: boolean) {\n this.ShowAgentPicker = value;\n }\n /** @deprecated Use {@link ShowAgentPicker}. */\n get showAgentPicker(): boolean {\n return this.ShowAgentPicker;\n }\n\n /**\n * Whether the chat header should render the per-agent mode/quality\n * picker (Draft / Standard / High, etc.). Default true. The picker\n * auto-hides when the bound agent has fewer than 2 configured\n * presets, so embedders rarely need to set this explicitly — turn\n * off only when the surface should never expose model-tier choice\n * (kiosks, specialty embeds).\n */\n @Input() ShowAgentModePicker: boolean = true;\n\n /** @deprecated Use {@link ShowAgentModePicker}. */\n @Input() set showAgentModePicker(value: boolean) {\n this.ShowAgentModePicker = value;\n }\n /** @deprecated Use {@link ShowAgentModePicker}. */\n get showAgentModePicker(): boolean {\n return this.ShowAgentModePicker;\n }\n\n /**\n * The mode/preset picker's selected configuration ID, forwarded to\n * `<mj-message-input>` so non-mention routes apply it on the next\n * send. Past messages are NOT retroactively re-routed — the picker\n * only affects subsequent requests. Updated when the user picks a\n * row in the mode picker; the picker itself persists the choice\n * per-user, per-agent via UserInfoEngine.\n */\n public ActiveAgentConfigurationPresetId: string | null = null;\n\n /**\n * Agent the mode picker should target. Mirrors the routing precedence\n * minus message-history continuity (the picker is persistent UI; it\n * shouldn't flip as the user scrolls history).\n *\n * Order: conversation-pinned default → embedder default → Sage.\n */\n /**\n * True when the chat header should render even before a conversation\n * row exists. Currently means: the embedder has enabled the mode\n * picker AND we resolved a target agent for it (so there's actually\n * something to put in the header). Lets surfaces like the Form\n * Builder cockpit show the mode picker on top of the empty-state\n * instead of waiting for the first message to create a conversation.\n */\n public get HasPreConversationHeader(): boolean {\n return this.ShowAgentModePicker && !!this.ModePickerTargetAgentId;\n }\n\n public get ModePickerTargetAgentId(): string | null {\n return this.Conversation?.DefaultAgentID\n ?? this.DefaultAgentId\n ?? this.conversationManagerAgent?.ID\n ?? null;\n }\n\n /**\n * Mode picker emitted a new selection. Store it; the next message's\n * route picks it up via `<mj-message-input>`'s\n * `[agentConfigurationPresetId]` binding. Past messages stay routed\n * as they were — the change is forward-only.\n */\n public OnAgentModePresetChanged(presetId: string | null): void {\n this.ActiveAgentConfigurationPresetId = presetId;\n this.cdr.markForCheck();\n }\n\n /** Greeting message shown in the empty state when no conversation is active */\n @Input() EmptyStateGreeting: string = 'How can I help you?';\n\n /** @deprecated Use {@link EmptyStateGreeting}. */\n @Input() set emptyStateGreeting(value: string) {\n this.EmptyStateGreeting = value;\n }\n /** @deprecated Use {@link EmptyStateGreeting}. */\n get emptyStateGreeting(): string {\n return this.EmptyStateGreeting;\n }\n\n // Sidebar toggle - when true, shows toggle button in header to expand sidebar\n @Input() ShowSidebarToggle: boolean = false;\n\n /** @deprecated Use {@link ShowSidebarToggle}. */\n @Input() set showSidebarToggle(value: boolean) {\n this.ShowSidebarToggle = value;\n }\n /** @deprecated Use {@link ShowSidebarToggle}. */\n get showSidebarToggle(): boolean {\n return this.ShowSidebarToggle;\n }\n\n // ────────────────────────────────────────────────────────────────────\n // PR 2c — Widget extension surface (additive — no breaking changes)\n // ────────────────────────────────────────────────────────────────────\n\n /**\n * When true, the `agentPresence` slot is allowed to render (using the\n * supplied `agentCharacterConfig` for visualization data). Off by default\n * so existing embeds (Form Builder, Component Studio AI Assistant, the\n * corner overlay) see no UI change.\n */\n @Input() ShowAgentCharacter: boolean = false;\n\n /** @deprecated Use {@link ShowAgentCharacter}. */\n @Input() set showAgentCharacter(value: boolean) {\n this.ShowAgentCharacter = value;\n }\n /** @deprecated Use {@link ShowAgentCharacter}. */\n get showAgentCharacter(): boolean {\n return this.ShowAgentCharacter;\n }\n\n /**\n * Visualization data forwarded to the `agentPresence` slot's default\n * component (or to any consumer-projected template via slot context).\n * Includes avatar URL, character name, voice state, and visual intensity.\n */\n @Input() AgentCharacterConfig: AgentCharacterConfig | null = null;\n\n /** @deprecated Use {@link AgentCharacterConfig}. */\n @Input() set agentCharacterConfig(value: AgentCharacterConfig | null) {\n this.AgentCharacterConfig = value;\n }\n /** @deprecated Use {@link AgentCharacterConfig}. */\n get agentCharacterConfig(): AgentCharacterConfig | null {\n return this.AgentCharacterConfig;\n }\n\n /**\n * Structured config for the `emptyState` slot's default component —\n * greeting, subtext, and optional suggested prompts. Backwards-compatible\n * with the existing `emptyStateGreeting` input (which still wins when\n * `emptyStateConfig` is null).\n */\n @Input() EmptyStateConfig: EmptyStateConfig | null = null;\n\n /** @deprecated Use {@link EmptyStateConfig}. */\n @Input() set emptyStateConfig(value: EmptyStateConfig | null) {\n this.EmptyStateConfig = value;\n }\n /** @deprecated Use {@link EmptyStateConfig}. */\n get emptyStateConfig(): EmptyStateConfig | null {\n return this.EmptyStateConfig;\n }\n\n /**\n * Activate the `demonstrationSurface` slot layout-mode. Per Matt's 06-10\n * placement design: when true AND a consumer has projected\n * `mjChatSlot=\"demonstrationSurface\"`, the chat-content-area restructures\n * into [stage | conversation-rail] — the stage takes the main pane, the\n * messages pane shrinks to a side rail (below the stage on mobile). When\n * false (default), no layout change; the chat-area renders as normal.\n *\n * The consumer is expected to drive this from their own state (e.g., an\n * agent emits a demonstration intent → host sets this true; user dismisses\n * → host sets it false). The widget itself doesn't decide.\n */\n @Input() ShowDemonstrationSurface: boolean = false;\n\n /** @deprecated Use {@link ShowDemonstrationSurface}. */\n @Input() set showDemonstrationSurface(value: boolean) {\n this.ShowDemonstrationSurface = value;\n }\n /** @deprecated Use {@link ShowDemonstrationSurface}. */\n get showDemonstrationSurface(): boolean {\n return this.ShowDemonstrationSurface;\n }\n\n /**\n * Content payload forwarded to the `demonstrationSurface` slot via\n * `$implicit` + named `content` context. Shape is consumer-defined per the\n * {@link IMJChatDemonstrationSurfaceComponent} interface — the widget\n * doesn't introspect or render it directly, just hands it through.\n */\n @Input() DemonstrationSurfaceContent: unknown = null;\n\n /** @deprecated Use {@link DemonstrationSurfaceContent}. */\n @Input() set demonstrationSurfaceContent(value: unknown) {\n this.DemonstrationSurfaceContent = value;\n }\n /** @deprecated Use {@link DemonstrationSurfaceContent}. */\n get demonstrationSurfaceContent(): unknown {\n return this.DemonstrationSurfaceContent;\n }\n\n /**\n * True when the demonstrationSurface layout-mode is BOTH opted-in\n * (`showDemonstrationSurface`) AND has a slot template projected to render\n * into. Both conditions must hold for the layout restructure to kick in.\n */\n public get IsDemonstrationActive(): boolean {\n return this.ShowDemonstrationSurface && this.SlotTemplate('demonstrationSurface') !== null;\n }\n\n /** @deprecated Use {@link IsDemonstrationActive}. */\n public get isDemonstrationActive(): boolean {\n return this.IsDemonstrationActive;\n }\n\n // ────────────────────────────────────────────────────────────────────\n // PR 2c — Before/After cancelable @Output() events\n // ────────────────────────────────────────────────────────────────────\n //\n // Listeners set `event.Cancel = true` on the `Before*` event to halt the\n // default behavior; the matching `After*` event then does NOT fire.\n // Informational events (progress, shown notifications, session lifecycle)\n // stay as single emitters without a Before-pair.\n //\n // WIRING STATUS:\n // ✓ beforeAgentTurn / afterAgentTurn — wired in message-input.component:\n // BeforeAgentTurn fires once per turn on every route, before any reply\n // row exists (re-emitted from chat-area).\n // ✓ beforeResponseFormSubmitted / afterResponseFormSubmitted — wired in\n // message-item.component's `onFormSubmitted()`, forwarded through\n // message-list to chat-area.\n // ✓ beforeToolInvoked / afterToolInvoked — wired AND cancel-enforced.\n // Subscribed to AgentClientService.ToolRequested$ / ToolExecuted$ in\n // ngOnInit. When a listener sets event.Cancel = true, the chat-area's\n // subscriber copies it back to the ClientToolRequestEvent and\n // AgentClientSession.handleToolRequest short-circuits dispatch (tool\n // handler NOT called, ToolExecuted$ NOT emitted, server receives a\n // failure response carrying any CancelReason).\n // ✓ sessionStarted / sessionChannelStateChanged / sessionEnded — subscribed\n // to ConversationsRuntime.Sessions.SessionLifecycle$ in ngOnInit. The\n // runtime's SessionsObserver consumes whichever ISessionsAdapter the host\n // registered at bootstrap; the Angular default is RealtimeSessionsAdapter,\n // which bridges RealtimeSessionService's SessionStarted$ / ActiveChannels$\n // (diffed for open/close) / SessionEnded$. Non-Angular hosts (React,\n // Vue, Node) register their own adapter — the chat-area code is unchanged.\n\n /**\n * Cancelable — fired once per agent turn, on every route, after routing picked the agent and\n * before any reply row exists. Cancel it to write nothing more, or set `RedirectAgentId` to\n * send the turn to another allowed agent. A message that starts no turn fires nothing.\n */\n @Output() BeforeAgentTurn = new EventEmitter<BeforeAgentTurnEventArgs>();\n\n /**\n * @deprecated Use {@link BeforeAgentTurn}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (beforeAgentTurn) keeps working. Must stay AFTER BeforeAgentTurn: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() beforeAgentTurn = this.BeforeAgentTurn;\n /** Fired AFTER a successful agent turn completes, on every route. */\n @Output() AfterAgentTurn = new EventEmitter<AfterAgentTurnEventArgs>();\n\n /**\n * @deprecated Use {@link AfterAgentTurn}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (afterAgentTurn) keeps working. Must stay AFTER AfterAgentTurn: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() afterAgentTurn = this.AfterAgentTurn;\n\n /** Cancelable — fired BEFORE a registered client tool is invoked by the agent. */\n @Output() BeforeToolInvoked = new EventEmitter<BeforeToolInvokedEventArgs>();\n\n /**\n * @deprecated Use {@link BeforeToolInvoked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (beforeToolInvoked) keeps working. Must stay AFTER BeforeToolInvoked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() beforeToolInvoked = this.BeforeToolInvoked;\n /** Fired AFTER a client tool invocation completes. */\n @Output() AfterToolInvoked = new EventEmitter<AfterToolInvokedEventArgs>();\n\n /**\n * @deprecated Use {@link AfterToolInvoked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (afterToolInvoked) keeps working. Must stay AFTER AfterToolInvoked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() afterToolInvoked = this.AfterToolInvoked;\n\n /** Cancelable — fired BEFORE a response form's submitted values are sent. */\n @Output() BeforeResponseFormSubmitted = new EventEmitter<BeforeResponseFormSubmittedEventArgs>();\n\n /**\n * @deprecated Use {@link BeforeResponseFormSubmitted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (beforeResponseFormSubmitted) keeps working. Must stay AFTER BeforeResponseFormSubmitted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() beforeResponseFormSubmitted = this.BeforeResponseFormSubmitted;\n /** Fired AFTER a response form's values have been sent. */\n @Output() AfterResponseFormSubmitted = new EventEmitter<AfterResponseFormSubmittedEventArgs>();\n\n /**\n * @deprecated Use {@link AfterResponseFormSubmitted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (afterResponseFormSubmitted) keeps working. Must stay AFTER AfterResponseFormSubmitted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() afterResponseFormSubmitted = this.AfterResponseFormSubmitted;\n\n /** Informational. */\n @Output() SessionStarted = new EventEmitter<SessionStartedEventArgs>();\n\n /**\n * @deprecated Use {@link SessionStarted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (sessionStarted) keeps working. Must stay AFTER SessionStarted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() sessionStarted = this.SessionStarted;\n /** Informational. */\n @Output() SessionChannelStateChanged = new EventEmitter<SessionChannelStateChangedEventArgs>();\n\n /**\n * @deprecated Use {@link SessionChannelStateChanged}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (sessionChannelStateChanged) keeps working. Must stay AFTER SessionChannelStateChanged: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() sessionChannelStateChanged = this.SessionChannelStateChanged;\n /** Informational. */\n @Output() SessionEnded = new EventEmitter<SessionEndedEventArgs>();\n\n /**\n * @deprecated Use {@link SessionEnded}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (sessionEnded) keeps working. Must stay AFTER SessionEnded: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() sessionEnded = this.SessionEnded;\n\n @Output() ConversationRenamed = new EventEmitter<{conversationId: string; name: string; description: string}>();\n\n /**\n * @deprecated Use {@link ConversationRenamed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (conversationRenamed) keeps working. Must stay AFTER ConversationRenamed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() conversationRenamed = this.ConversationRenamed;\n @Output() OpenEntityRecord = new EventEmitter<{entityName: string; compositeKey: CompositeKey}>();\n\n /**\n * @deprecated Use {@link OpenEntityRecord}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (openEntityRecord) keeps working. Must stay AFTER OpenEntityRecord: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() openEntityRecord = this.OpenEntityRecord;\n\n /**\n * A realtime session that CREATED its own conversation has ended — the new\n * conversation is named (background, shared helper) and ready. The workspace folds\n * it into the cached list and selects it when the conversation list is visible.\n */\n @Output() RealtimeConversationReady = new EventEmitter<{conversationId: string; select: boolean}>();\n\n /**\n * @deprecated Use {@link RealtimeConversationReady}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (realtimeConversationReady) keeps working. Must stay AFTER RealtimeConversationReady: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() realtimeConversationReady = this.RealtimeConversationReady;\n @Output() navigationRequest = new EventEmitter<NavigationRequest>();\n @Output() TaskClicked = new EventEmitter<MJTaskEntity>();\n\n /**\n * @deprecated Use {@link TaskClicked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (taskClicked) keeps working. Must stay AFTER TaskClicked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() taskClicked = this.TaskClicked;\n @Output() ArtifactLinkClicked = new EventEmitter<{type: 'conversation' | 'collection'; id: string}>();\n\n /**\n * @deprecated Use {@link ArtifactLinkClicked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (artifactLinkClicked) keeps working. Must stay AFTER ArtifactLinkClicked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() artifactLinkClicked = this.ArtifactLinkClicked;\n @Output() SidebarToggleClicked = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link SidebarToggleClicked}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (sidebarToggleClicked) keeps working. Must stay AFTER SidebarToggleClicked: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() sidebarToggleClicked = this.SidebarToggleClicked;\n\n // STATE CHANGE OUTPUTS - notify parent of state changes\n // conversationCreated now includes pendingMessage and pendingAttachments to ensure atomic state update\n @Output() ConversationCreated = new EventEmitter<{\n conversation: MJConversationEntity;\n pendingMessage?: string;\n pendingAttachments?: PendingAttachment[];\n }>();\n\n /**\n * @deprecated Use {@link ConversationCreated}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (conversationCreated) keeps working. Must stay AFTER ConversationCreated: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() conversationCreated = this.ConversationCreated;\n @Output() ThreadOpened = new EventEmitter<string>();\n\n /**\n * @deprecated Use {@link ThreadOpened}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (threadOpened) keeps working. Must stay AFTER ThreadOpened: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() threadOpened = this.ThreadOpened;\n @Output() ThreadClosed = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link ThreadClosed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (threadClosed) keeps working. Must stay AFTER ThreadClosed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() threadClosed = this.ThreadClosed;\n @Output() PendingArtifactConsumed = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link PendingArtifactConsumed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (pendingArtifactConsumed) keeps working. Must stay AFTER PendingArtifactConsumed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() pendingArtifactConsumed = this.PendingArtifactConsumed;\n @Output() PendingMessageConsumed = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link PendingMessageConsumed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (pendingMessageConsumed) keeps working. Must stay AFTER PendingMessageConsumed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() pendingMessageConsumed = this.PendingMessageConsumed;\n // pendingMessageRequested is deprecated - use conversationCreated with pendingMessage instead\n @Output() PendingMessageRequested = new EventEmitter<{text: string; attachments: PendingAttachment[]}>();\n\n /**\n * @deprecated Use {@link PendingMessageRequested}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (pendingMessageRequested) keeps working. Must stay AFTER PendingMessageRequested: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() pendingMessageRequested = this.PendingMessageRequested;\n\n @ViewChild('scrollContainer') private scrollContainer!: ElementRef;\n @ViewChildren('messageInput') private messageInputComponents!: QueryList<MessageInputComponent>;\n\n /**\n * Prefill the composer with draft text (NOT sent — unlike pendingMessage) and focus\n * it. Targets the empty-state input for new/unsaved conversations, else the active\n * conversation's cached input. Emits composerDraftConsumed once applied. Retries\n * briefly because the target input mounts asynchronously (config params can arrive\n * before the first render).\n */\n @Input() ComposerDraft: string | null = null;\n\n /** @deprecated Use {@link ComposerDraft}. */\n @Input() set composerDraft(value: string | null) {\n this.ComposerDraft = value;\n }\n /** @deprecated Use {@link ComposerDraft}. */\n get composerDraft(): string | null {\n return this.ComposerDraft;\n }\n\n @Output() ComposerDraftConsumed = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link ComposerDraftConsumed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (composerDraftConsumed) keeps working. Must stay AFTER ComposerDraftConsumed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() composerDraftConsumed = this.ComposerDraftConsumed;\n\n /**\n * Pre-address the composer to an AGENT as a resolved mention pill (+ space +\n * focus) — the chip-resolving sibling of {@link composerDraft}. Value = the\n * agent's name. Emits composerAgentMentionConsumed once applied.\n */\n @Input()\n set ComposerAgentMention(value: string | null) {\n if (value && value !== this._composerAgentMention) {\n this._composerAgentMention = value;\n this.applyComposerAgentMention(0);\n } else if (!value) {\n this._composerAgentMention = null;\n }\n }\n get ComposerAgentMention(): string | null {\n return this._composerAgentMention;\n }\n\n /** @deprecated Use {@link ComposerAgentMention}. */\n get composerAgentMention(): string | null {\n return this.ComposerAgentMention;\n }\n /** @deprecated Use {@link ComposerAgentMention}. */\n @Input() set composerAgentMention(value: string | null) {\n this.ComposerAgentMention = value;\n }\n private _composerAgentMention: string | null = null;\n\n @Output() ComposerAgentMentionConsumed = new EventEmitter<void>();\n\n /**\n * @deprecated Use {@link ComposerAgentMentionConsumed}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (composerAgentMentionConsumed) keeps working. Must stay AFTER ComposerAgentMentionConsumed: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() composerAgentMentionConsumed = this.ComposerAgentMentionConsumed;\n\n /**\n * Per-user persisted composer drafts (UserInfoEngine-backed): restore on mount,\n * debounced-persist while typing, flush on blur/switch, delete on send.\n * See {@link ComposerDraftStore} for the storage contract.\n */\n private readonly draftStore = new ComposerDraftStore();\n\n /**\n * ONE-SHOT restore snapshot per composer key. This MUST NOT be a live read:\n * the store updates on every keystroke (DraftStateChanged), and a live binding\n * would re-stage the serialized draft into the composer while the user types —\n * rewriting content and scrambling the caret. The first evaluation per key wins\n * for the life of this chat area: a pending agent pre-address or host-supplied\n * composerDraft outranks the persisted draft (fresher intent); afterwards the\n * binding returns the frozen snapshot so the initialDraft setter's dedupe holds.\n */\n private readonly initialDraftSnapshots = new Map<string, string | null>();\n\n public GetInitialDraftFor(conversationId: string | null): string | null {\n const key = conversationId ? conversationId.trim().toLowerCase() : 'new';\n if (!this.initialDraftSnapshots.has(key)) {\n let snapshot: string | null;\n if (this._composerAgentMention) {\n snapshot = null; // pre-address wins; never restore over it\n } else if (!conversationId && this.ComposerDraft) {\n snapshot = this.ComposerDraft;\n } else {\n snapshot = this.draftStore.GetDraft(conversationId);\n }\n this.initialDraftSnapshots.set(key, snapshot);\n }\n return this.initialDraftSnapshots.get(key) ?? null;\n }\n\n /** Live draft persistence (store debounces the server write). */\n public OnDraftStateChanged(conversationId: string | null, serialized: string): void {\n // verboseOnly: fires on every keystroke, same as the store's own SetDraft log below it.\n LogStatusEx({ message: `[Drafts] chat-area: draft change for '${conversationId ?? 'new'}' (${serialized.length} chars)`, verboseOnly: true });\n this.draftStore.SetDraft(conversationId, serialized);\n }\n\n /** Blur = a natural save point — persist immediately. */\n public OnComposerBlurred(): void {\n this.draftStore.Flush();\n }\n\n /** Cold deep-link boots can take several seconds before a composer mounts. */\n private static readonly AGENT_MENTION_MAX_ATTEMPTS = 60; // × 150ms ≈ 9s\n\n private applyComposerAgentMention(attempt: number): void {\n const agentName = this._composerAgentMention;\n if (!agentName) {\n return;\n }\n // New/unsaved conversations render the empty-state composer; established ones\n // use the active cached input. Both resolve the agent to a pill.\n const target = this.emptyStateComponent ? 'empty-state' : this.messageInputComponents?.first ? 'active-input' : null;\n if (attempt === 0 || attempt % 10 === 0 || target) {\n console.log(`[Omnibar→Chat] chat-area apply('${agentName}') attempt ${attempt}: target=${target ?? 'none-mounted'}`);\n }\n const insert: Promise<boolean> | null = this.emptyStateComponent\n ? this.emptyStateComponent.InsertAgentMention(agentName, true)\n : this.messageInputComponents?.first\n ? this.messageInputComponents.first.InsertAgentMention(agentName, true)\n : null;\n if (insert) {\n void insert.then((applied: boolean) => {\n if (applied) {\n console.log(`[Omnibar→Chat] chat-area apply('${agentName}'): APPLIED on ${target} (attempt ${attempt})`);\n this._composerAgentMention = null;\n this.ComposerAgentMentionConsumed.emit();\n } else if (attempt < ConversationChatAreaComponent.AGENT_MENTION_MAX_ATTEMPTS) {\n setTimeout(() => this.applyComposerAgentMention(attempt + 1), 150);\n } else {\n console.error(`[Omnibar→Chat] chat-area apply('${agentName}'): GAVE UP after ${attempt} attempts — composer never became insertable`);\n }\n });\n return;\n }\n if (attempt < ConversationChatAreaComponent.AGENT_MENTION_MAX_ATTEMPTS) {\n setTimeout(() => this.applyComposerAgentMention(attempt + 1), 150);\n } else {\n console.error(`[Omnibar→Chat] chat-area apply('${agentName}'): GAVE UP after ${attempt} attempts — no composer mounted (emptyState=${!!this.emptyStateComponent}, inputs=${this.messageInputComponents?.length ?? 0})`);\n }\n }\n\n /** The empty-state input applied the staged draft — clear + inform the host. */\n public OnComposerDraftApplied(): void {\n this.ComposerDraft = null;\n this.ComposerDraftConsumed.emit();\n }\n @ViewChild(ArtifactViewerPanelComponent) private artifactViewerComponent?: ArtifactViewerPanelComponent;\n @ViewChild(ConversationEmptyStateComponent) private emptyStateComponent?: ConversationEmptyStateComponent;\n\n /**\n * Slot-fill templates supplied by consumers via the `mjChatSlot` directive.\n * Looked up by slot name with {@link slotTemplate}.\n */\n @ContentChildren(ChatSlotDirective) private chatSlotChildren!: QueryList<ChatSlotDirective>;\n\n /**\n * Public helper for the template + consumers — resolve a slot name to the\n * consumer-supplied `TemplateRef`, or `null` if no consumer template was\n * projected for that slot. When `null`, the template should render the\n * slot's default standalone component.\n */\n public SlotTemplate(name: MJChatSlotName): TemplateRef<unknown> | null {\n return this.chatSlotChildren?.find((s) => s.SlotName === name)?.Template ?? null;\n }\n\n /** @deprecated Use {@link SlotTemplate}. */\n public slotTemplate(name: MJChatSlotName): TemplateRef<unknown> | null {\n return this.SlotTemplate(name);\n }\n\n public messages: MJConversationDetailEntity[] = [];\n public ShowScrollToBottomIcon = false;\n\n /** @deprecated Use {@link ShowScrollToBottomIcon}. */\n public get showScrollToBottomIcon() {\n return this.ShowScrollToBottomIcon;\n }\n /** @deprecated Use {@link ShowScrollToBottomIcon}. */\n public set showScrollToBottomIcon(value) {\n this.ShowScrollToBottomIcon = value;\n }\n private scrollToBottom = false;\n /**\n * Whether the reader was at (within a few px of) the bottom at the last scroll event.\n * An in-place message update only follows the tail for a reader who is already there;\n * one who scrolled up to reread history is left alone, whichever mode is on.\n */\n private readerAtBottom = true;\n /** readReplyFromTop: the reader's message that opened the current turn. */\n private currentTurnStartMessageId: string | null = null;\n /** readReplyFromTop: set when the reply lands, consumed once it has rendered. */\n private pendingTurnStartMessageId: string | null = null;\n /**\n * readReplyFromTop: while a landing is under way, bottom-follow timers already armed by the\n * last progress updates must not fire and drag the reader back down.\n */\n private bottomFollowSuppressedUntil = 0;\n private turnStartRetryHandle: ReturnType<typeof setTimeout> | null = null;\n /** Gap kept between the pane's top edge and the turn's first message. */\n private static readonly TURN_TOP_GAP_PX = 16;\n private lastLoadedConversationId: string | null = null; // Track which conversation's peripheral data was loaded\n private currentlyLoadingConversationId: string | null = null; // Track which conversation is currently being loaded\n private conversationLoadToken = 0; // Monotonic token to discard stale async conversation loads\n public IsProcessing: boolean = false;\n\n /** @deprecated Use {@link IsProcessing}. */\n public get isProcessing(): boolean {\n return this.IsProcessing;\n }\n /** @deprecated Use {@link IsProcessing}. */\n public set isProcessing(value: boolean) {\n this.IsProcessing = value;\n }\n private intentCheckMessage: MJConversationDetailEntity | null = null; // Temporary message shown during intent checking\n public IsLoadingConversation: boolean = false;\n\n /** @deprecated Use {@link IsLoadingConversation}. */\n public get isLoadingConversation(): boolean {\n return this.IsLoadingConversation;\n }\n /** @deprecated Use {@link IsLoadingConversation}. */\n public set isLoadingConversation(value: boolean) {\n this.IsLoadingConversation = value;\n } // Set to true only when actively loading conversation data\n\n // User avatar map derived from engine cache\n public UserAvatarMap: Map<string, {imageUrl: string | null; iconClass: string | null}> = new Map();\n\n /** @deprecated Use {@link UserAvatarMap}. */\n public get userAvatarMap(): Map<string, {imageUrl: string | null; iconClass: string | null}> {\n return this.UserAvatarMap;\n }\n /** @deprecated Use {@link UserAvatarMap}. */\n public set userAvatarMap(value: Map<string, {imageUrl: string | null; iconClass: string | null}>) {\n this.UserAvatarMap = value;\n }\n public MemberCount: number = 1;\n\n /** @deprecated Use {@link MemberCount}. */\n public get memberCount(): number {\n return this.MemberCount;\n }\n /** @deprecated Use {@link MemberCount}. */\n public set memberCount(value: number) {\n this.MemberCount = value;\n }\n public ArtifactCount: number = 0;\n\n /** @deprecated Use {@link ArtifactCount}. */\n public get artifactCount(): number {\n return this.ArtifactCount;\n }\n /** @deprecated Use {@link ArtifactCount}. */\n public set artifactCount(value: number) {\n this.ArtifactCount = value;\n }\n public ArtifactCountDisplay: number = 0;\n\n /** @deprecated Use {@link ArtifactCountDisplay}. */\n public get artifactCountDisplay(): number {\n return this.ArtifactCountDisplay;\n }\n /** @deprecated Use {@link ArtifactCountDisplay}. */\n public set artifactCountDisplay(value: number) {\n this.ArtifactCountDisplay = value;\n }\n public IsShared: boolean = false;\n\n /** @deprecated Use {@link IsShared}. */\n public get isShared(): boolean {\n return this.IsShared;\n }\n /** @deprecated Use {@link IsShared}. */\n public set isShared(value: boolean) {\n this.IsShared = value;\n }\n public ShowExportModal: boolean = false;\n\n /** @deprecated Use {@link ShowExportModal}. */\n public get showExportModal(): boolean {\n return this.ShowExportModal;\n }\n /** @deprecated Use {@link ShowExportModal}. */\n public set showExportModal(value: boolean) {\n this.ShowExportModal = value;\n }\n public ShowShareModal: boolean = false;\n\n /** @deprecated Use {@link ShowShareModal}. */\n public get showShareModal(): boolean {\n return this.ShowShareModal;\n }\n /** @deprecated Use {@link ShowShareModal}. */\n public set showShareModal(value: boolean) {\n this.ShowShareModal = value;\n }\n public ShareContext: ResourceShareContext | null = null;\n\n /** @deprecated Use {@link ShareContext}. */\n public get shareContext(): ResourceShareContext | null {\n return this.ShareContext;\n }\n /** @deprecated Use {@link ShareContext}. */\n public set shareContext(value: ResourceShareContext | null) {\n this.ShareContext = value;\n }\n public ShareAdapter = new MJResourcePermissionShareAdapter(CONVERSATIONS_RESOURCE_TYPE_ID);\n\n /** @deprecated Use {@link ShareAdapter}. */\n public get shareAdapter() {\n return this.ShareAdapter;\n }\n /** @deprecated Use {@link ShareAdapter}. */\n public set shareAdapter(value) {\n this.ShareAdapter = value;\n }\n public ShowAgentPanel: boolean = false;\n\n /** @deprecated Use {@link ShowAgentPanel}. */\n public get showAgentPanel(): boolean {\n return this.ShowAgentPanel;\n }\n /** @deprecated Use {@link ShowAgentPanel}. */\n public set showAgentPanel(value: boolean) {\n this.ShowAgentPanel = value;\n }\n public ShowMembersModal: boolean = false;\n\n /** @deprecated Use {@link ShowMembersModal}. */\n public get showMembersModal(): boolean {\n return this.ShowMembersModal;\n }\n /** @deprecated Use {@link ShowMembersModal}. */\n public set showMembersModal(value: boolean) {\n this.ShowMembersModal = value;\n }\n public ShowProjectSelector: boolean = false;\n\n /** @deprecated Use {@link ShowProjectSelector}. */\n public get showProjectSelector(): boolean {\n return this.ShowProjectSelector;\n }\n /** @deprecated Use {@link ShowProjectSelector}. */\n public set showProjectSelector(value: boolean) {\n this.ShowProjectSelector = value;\n }\n public ShowArtifactPanel: boolean = false;\n\n /** @deprecated Use {@link ShowArtifactPanel}. */\n public get showArtifactPanel(): boolean {\n return this.ShowArtifactPanel;\n }\n /** @deprecated Use {@link ShowArtifactPanel}. */\n public set showArtifactPanel(value: boolean) {\n this.ShowArtifactPanel = value;\n }\n public ShowArtifactsModal: boolean = false;\n\n /** @deprecated Use {@link ShowArtifactsModal}. */\n public get showArtifactsModal(): boolean {\n return this.ShowArtifactsModal;\n }\n /** @deprecated Use {@link ShowArtifactsModal}. */\n public set showArtifactsModal(value: boolean) {\n this.ShowArtifactsModal = value;\n }\n public ShowSystemArtifacts: boolean = false;\n\n /** @deprecated Use {@link ShowSystemArtifacts}. */\n public get showSystemArtifacts(): boolean {\n return this.ShowSystemArtifacts;\n }\n /** @deprecated Use {@link ShowSystemArtifacts}. */\n public set showSystemArtifacts(value: boolean) {\n this.ShowSystemArtifacts = value;\n } // Toggle for showing system-only artifacts\n public SelectedArtifactId: string | null = null;\n\n /** @deprecated Use {@link SelectedArtifactId}. */\n public get selectedArtifactId(): string | null {\n return this.SelectedArtifactId;\n }\n /** @deprecated Use {@link SelectedArtifactId}. */\n public set selectedArtifactId(value: string | null) {\n this.SelectedArtifactId = value;\n }\n public SelectedVersionNumber: number | undefined = undefined;\n\n /** @deprecated Use {@link SelectedVersionNumber}. */\n public get selectedVersionNumber(): number | undefined {\n return this.SelectedVersionNumber;\n }\n /** @deprecated Use {@link SelectedVersionNumber}. */\n public set selectedVersionNumber(value: number | undefined) {\n this.SelectedVersionNumber = value;\n } // Version to show in artifact viewer\n\n /**\n * Bumped whenever artifacts are MERGED into `artifactsByDetailId` by something other than the\n * turn in flight — today only the scroll-up paging path. A before/after diff spanning such a\n * merge cannot tell an artifact that arrived from an older page from one a run just created, so\n * the baseline records this counter and the decision refuses to infer creations when it moved.\n */\n private artifactMapGeneration = 0;\n\n /**\n * Bumped whenever the USER changes what the artifact panel is showing (clicks a card, opens one\n * from the modal or a deep link, closes the panel). An agent turn can finish while such a click\n * is in flight — two completion handlers run per turn, each holding its own pre-turn snapshot —\n * and without this the slower one would pull the panel back onto the run's artifact and discard\n * the selection the user just made.\n */\n private artifactSelectionEpoch = 0;\n public ArtifactPaneWidth: number = DEFAULT_ARTIFACT_PANE_WIDTH;\n\n /** @deprecated Use {@link ArtifactPaneWidth}. */\n public get artifactPaneWidth(): number {\n return this.ArtifactPaneWidth;\n }\n /** @deprecated Use {@link ArtifactPaneWidth}. */\n public set artifactPaneWidth(value: number) {\n this.ArtifactPaneWidth = value;\n }\n public IsArtifactPaneMaximized: boolean = false;\n\n /** @deprecated Use {@link IsArtifactPaneMaximized}. */\n public get isArtifactPaneMaximized(): boolean {\n return this.IsArtifactPaneMaximized;\n }\n /** @deprecated Use {@link IsArtifactPaneMaximized}. */\n public set isArtifactPaneMaximized(value: boolean) {\n this.IsArtifactPaneMaximized = value;\n } // Track maximize state\n private artifactPaneWidthBeforeMaximize: number = DEFAULT_ARTIFACT_PANE_WIDTH;\n public ExpandedArtifactId: string | null = null;\n\n /** @deprecated Use {@link ExpandedArtifactId}. */\n public get expandedArtifactId(): string | null {\n return this.ExpandedArtifactId;\n }\n /** @deprecated Use {@link ExpandedArtifactId}. */\n public set expandedArtifactId(value: string | null) {\n this.ExpandedArtifactId = value;\n } // Track which artifact card is expanded in modal\n public ShowCollectionPicker: boolean = false;\n\n /** @deprecated Use {@link ShowCollectionPicker}. */\n public get showCollectionPicker(): boolean {\n return this.ShowCollectionPicker;\n }\n /** @deprecated Use {@link ShowCollectionPicker}. */\n public set showCollectionPicker(value: boolean) {\n this.ShowCollectionPicker = value;\n }\n public CollectionPickerArtifactId: string | null = null;\n\n /** @deprecated Use {@link CollectionPickerArtifactId}. */\n public get collectionPickerArtifactId(): string | null {\n return this.CollectionPickerArtifactId;\n }\n /** @deprecated Use {@link CollectionPickerArtifactId}. */\n public set collectionPickerArtifactId(value: string | null) {\n this.CollectionPickerArtifactId = value;\n }\n public CollectionPickerExcludedIds: string[] = [];\n\n /** @deprecated Use {@link CollectionPickerExcludedIds}. */\n public get collectionPickerExcludedIds(): string[] {\n return this.CollectionPickerExcludedIds;\n }\n /** @deprecated Use {@link CollectionPickerExcludedIds}. */\n public set collectionPickerExcludedIds(value: string[]) {\n this.CollectionPickerExcludedIds = value;\n }\n public CollectionPickerVersionId: string | null = null;\n\n /** @deprecated Use {@link CollectionPickerVersionId}. */\n public get collectionPickerVersionId(): string | null {\n return this.CollectionPickerVersionId;\n }\n /** @deprecated Use {@link CollectionPickerVersionId}. */\n public set collectionPickerVersionId(value: string | null) {\n this.CollectionPickerVersionId = value;\n }\n public CollectionPickerArtifactName: string = '';\n\n /** @deprecated Use {@link CollectionPickerArtifactName}. */\n public get collectionPickerArtifactName(): string {\n return this.CollectionPickerArtifactName;\n }\n /** @deprecated Use {@link CollectionPickerArtifactName}. */\n public set collectionPickerArtifactName(value: string) {\n this.CollectionPickerArtifactName = value;\n }\n public CollectionPickerVersionNumber: number | null = null;\n\n /** @deprecated Use {@link CollectionPickerVersionNumber}. */\n public get collectionPickerVersionNumber(): number | null {\n return this.CollectionPickerVersionNumber;\n }\n /** @deprecated Use {@link CollectionPickerVersionNumber}. */\n public set collectionPickerVersionNumber(value: number | null) {\n this.CollectionPickerVersionNumber = value;\n }\n\n // Artifact permissions\n public CanShareSelectedArtifact: boolean = false;\n\n /** @deprecated Use {@link CanShareSelectedArtifact}. */\n public get canShareSelectedArtifact(): boolean {\n return this.CanShareSelectedArtifact;\n }\n /** @deprecated Use {@link CanShareSelectedArtifact}. */\n public set canShareSelectedArtifact(value: boolean) {\n this.CanShareSelectedArtifact = value;\n }\n public CanEditSelectedArtifact: boolean = false;\n\n /** @deprecated Use {@link CanEditSelectedArtifact}. */\n public get canEditSelectedArtifact(): boolean {\n return this.CanEditSelectedArtifact;\n }\n /** @deprecated Use {@link CanEditSelectedArtifact}. */\n public set canEditSelectedArtifact(value: boolean) {\n this.CanEditSelectedArtifact = value;\n }\n\n // Share modal state\n public IsArtifactShareModalOpen: boolean = false;\n\n /** @deprecated Use {@link IsArtifactShareModalOpen}. */\n public get isArtifactShareModalOpen(): boolean {\n return this.IsArtifactShareModalOpen;\n }\n /** @deprecated Use {@link IsArtifactShareModalOpen}. */\n public set isArtifactShareModalOpen(value: boolean) {\n this.IsArtifactShareModalOpen = value;\n }\n public ArtifactToShare: MJArtifactEntity | null = null;\n\n /** @deprecated Use {@link ArtifactToShare}. */\n public get artifactToShare(): MJArtifactEntity | null {\n return this.ArtifactToShare;\n }\n /** @deprecated Use {@link ArtifactToShare}. */\n public set artifactToShare(value: MJArtifactEntity | null) {\n this.ArtifactToShare = value;\n }\n\n\n // Artifact mapping: ConversationDetailID -> Array of LazyArtifactInfo\n // Uses lazy-loading pattern: display data loaded immediately, full entities on-demand\n // Supports multiple artifacts per conversation detail (0-N relationship)\n public ArtifactsByDetailId = new Map<string, LazyArtifactInfo[]>();\n\n /** @deprecated Use {@link ArtifactsByDetailId}. */\n public get artifactsByDetailId() {\n return this.ArtifactsByDetailId;\n }\n /** @deprecated Use {@link ArtifactsByDetailId}. */\n public set artifactsByDetailId(value) {\n this.ArtifactsByDetailId = value;\n }\n\n // System artifacts mapping: ConversationDetailID -> Array of LazyArtifactInfo (Visibility='System Only')\n // Kept separate so we can toggle their display without reloading\n // Made public so it can be passed to MessageInputComponent for payload loading\n public SystemArtifactsByDetailId = new Map<string, LazyArtifactInfo[]>();\n\n /** @deprecated Use {@link SystemArtifactsByDetailId}. */\n public get systemArtifactsByDetailId() {\n return this.SystemArtifactsByDetailId;\n }\n /** @deprecated Use {@link SystemArtifactsByDetailId}. */\n public set systemArtifactsByDetailId(value) {\n this.SystemArtifactsByDetailId = value;\n }\n\n // Cached combined artifacts map - updated when toggle changes\n private _combinedArtifactsMap: Map<string, LazyArtifactInfo[]> | null = null;\n\n // Agent run mapping: ConversationDetailID -> MJAIAgentRunEntityExtended\n // Loaded once per conversation and kept in sync as new runs are created\n public AgentRunsByDetailId = new Map<string, MJAIAgentRunEntityExtended>();\n\n /** @deprecated Use {@link AgentRunsByDetailId}. */\n public get agentRunsByDetailId() {\n return this.AgentRunsByDetailId;\n }\n /** @deprecated Use {@link AgentRunsByDetailId}. */\n public set agentRunsByDetailId(value) {\n this.AgentRunsByDetailId = value;\n }\n\n /**\n * Ratings by conversation detail ID (parsed from RatingsJSON)\n */\n public RatingsByDetailId = new Map<string, RatingJSON[]>();\n\n /** @deprecated Use {@link RatingsByDetailId}. */\n public get ratingsByDetailId() {\n return this.RatingsByDetailId;\n }\n /** @deprecated Use {@link RatingsByDetailId}. */\n public set ratingsByDetailId(value) {\n this.RatingsByDetailId = value;\n }\n\n /**\n * Attachments by conversation detail ID (loaded from ConversationDetailAttachments)\n */\n public AttachmentsByDetailId = new Map<string, MessageAttachment[]>();\n\n /** @deprecated Use {@link AttachmentsByDetailId}. */\n public get attachmentsByDetailId() {\n return this.AttachmentsByDetailId;\n }\n /** @deprecated Use {@link AttachmentsByDetailId}. */\n public set attachmentsByDetailId(value) {\n this.AttachmentsByDetailId = value;\n }\n\n /**\n * In-progress message IDs for streaming reconnection\n * Passed to message-input component to reconnect PubSub updates\n */\n public InProgressMessageIds: string[] = [];\n\n /** @deprecated Use {@link InProgressMessageIds}. */\n public get inProgressMessageIds(): string[] {\n return this.InProgressMessageIds;\n }\n /** @deprecated Use {@link InProgressMessageIds}. */\n public set inProgressMessageIds(value: string[]) {\n this.InProgressMessageIds = value;\n }\n\n // Subject for cleanup on destroy\n private destroy$ = new Subject<void>();\n\n // Cache of message-input metadata for rendering multiple instances\n // Prevents destruction/recreation when switching conversations for performance\n private messageInputMetadataCache = new Map<string, {conversationId: string; conversationName: string | null}>();\n\n // Empty collections for hidden message-input components\n public readonly EmptyArtifactsMap = new Map<string, LazyArtifactInfo[]>();\n\n /** @deprecated Use {@link EmptyArtifactsMap}. */\n public get emptyArtifactsMap() {\n return this.EmptyArtifactsMap;\n }\n public readonly EmptyAgentRunsMap = new Map<string, MJAIAgentRunEntityExtended>();\n\n /** @deprecated Use {@link EmptyAgentRunsMap}. */\n public get emptyAgentRunsMap() {\n return this.EmptyAgentRunsMap;\n }\n public readonly EmptyInProgressIds: string[] = [];\n\n /** @deprecated Use {@link EmptyInProgressIds}. */\n public get emptyInProgressIds(): string[] {\n return this.EmptyInProgressIds;\n }\n\n // Loading state for peripheral data\n public IsLoadingPeripheralData: boolean = false;\n\n /** @deprecated Use {@link IsLoadingPeripheralData}. */\n public get isLoadingPeripheralData(): boolean {\n return this.IsLoadingPeripheralData;\n }\n /** @deprecated Use {@link IsLoadingPeripheralData}. */\n public set isLoadingPeripheralData(value: boolean) {\n this.IsLoadingPeripheralData = value;\n }\n\n // Subject to trigger artifact viewer refresh when new version is created\n public ArtifactViewerRefresh$ = new Subject<{artifactId: string; versionNumber: number}>();\n\n /** @deprecated Use {@link ArtifactViewerRefresh$}. */\n public get artifactViewerRefresh$() {\n return this.ArtifactViewerRefresh$;\n }\n /** @deprecated Use {@link ArtifactViewerRefresh$}. */\n public set artifactViewerRefresh$(value) {\n this.ArtifactViewerRefresh$ = value;\n }\n\n // Track initialization state to prevent loading messages before agents are ready\n private isInitialized: boolean = false;\n\n // Track whether we had active agents on the current conversation's last poll cycle.\n // Used to detect when polling transitions from active → no active agents (completion via poll).\n private hadActiveAgents: boolean = false;\n\n // Resize state\n private isResizing: boolean = false;\n private startX: number = 0;\n private startWidth: number = 0;\n\n // Stored bound references so addEventListener and removeEventListener get the same function object.\n private readonly boundOnResizeMove = this.onResizeMove.bind(this);\n private readonly boundOnResizeEnd = this.onResizeEnd.bind(this);\n private readonly boundOnResizeTouchMove = this.onResizeTouchMove.bind(this);\n private readonly boundOnResizeTouchEnd = this.onResizeTouchEnd.bind(this);\n\n // LocalStorage key\n private readonly ARTIFACT_PANE_WIDTH_KEY = 'mj-conversations-artifact-pane-width';\n\n // Pinned messages panel state\n public ShowPinsPanel: boolean = false;\n\n /** @deprecated Use {@link ShowPinsPanel}. */\n public get showPinsPanel(): boolean {\n return this.ShowPinsPanel;\n }\n /** @deprecated Use {@link ShowPinsPanel}. */\n public set showPinsPanel(value: boolean) {\n this.ShowPinsPanel = value;\n }\n\n /** True once the pin ENTITIES are loaded. The COUNT is known from conversation open. */\n private pinsHydrated = false;\n\n /** Spinner state for the panel's first open — the rows now arrive after the panel does. */\n public IsLoadingPins = false;\n\n /** @deprecated Use {@link IsLoadingPins}. */\n public get isLoadingPins() {\n return this.IsLoadingPins;\n }\n /** @deprecated Use {@link IsLoadingPins}. */\n public set isLoadingPins(value) {\n this.IsLoadingPins = value;\n }\n\n /**\n * TRUE pin count for the chip. Deliberately NOT `pinnedMessages.length`, which is 0 until\n * the panel has been opened and would hide the chip on a conversation full of pins.\n */\n get PinnedMessageCount(): number {\n return this.windowStore.PinnedTotalCount;\n }\n\n /** @deprecated Use {@link PinnedMessageCount}. */\n get pinnedMessageCount(): number {\n return this.PinnedMessageCount;\n }\n\n /**\n * Opens/closes the pins panel, hydrating its rows on first open.\n *\n * Lazy on purpose: the panel is closed by default, so loading pin entities during\n * conversation open costs every user for a panel most never open.\n */\n public async TogglePinsPanel(): Promise<void> {\n this.ShowPinsPanel = !this.ShowPinsPanel;\n if (this.ShowPinsPanel && !this.pinsHydrated && this.ConversationId) {\n this.IsLoadingPins = true;\n this.cdr.detectChanges();\n try {\n await this.hydratePinnedMessages(this.ConversationId);\n } finally {\n this.IsLoadingPins = false;\n }\n }\n this.cdr.detectChanges();\n }\n\n /**\n * All currently pinned messages in the active conversation, newest pin first.\n *\n * Read from the window store's separate pin set, NOT filtered out of `messages` — a pin\n * older than the loaded window would otherwise vanish from the panel. Loaded by its own\n * `IsPinned=1` query in {@link loadMessages}, already ordered `Sequence DESC`.\n *\n * This and the three getters around it are TEMPLATE-BOUND, so they run on every change\n * detection cycle. They read the store's cheap single-value accessors rather than\n * `GetSnapshot()`, which copies the whole loaded window on every call — four of those per\n * cycle, during streaming per token, is exactly the length-proportional work this feature\n * exists to remove.\n */\n get PinnedMessages(): readonly MJConversationDetailEntity[] {\n return this.windowStore.PinnedDetails;\n }\n\n /** @deprecated Use {@link PinnedMessages}. */\n get pinnedMessages(): readonly MJConversationDetailEntity[] {\n return this.PinnedMessages;\n }\n\n /** True when older transcript pages remain above the loaded window (drives the sentinel). */\n get HasMoreMessagesAbove(): boolean {\n return this.windowStore.HasMoreAbove;\n }\n\n /** @deprecated Use {@link HasMoreMessagesAbove}. */\n get hasMoreMessagesAbove(): boolean {\n return this.HasMoreMessagesAbove;\n }\n\n /** True while an older transcript page is being fetched. */\n get IsLoadingOlderMessages(): boolean {\n return this.windowStore.IsLoadingOlder;\n }\n\n /** @deprecated Use {@link IsLoadingOlderMessages}. */\n get isLoadingOlderMessages(): boolean {\n return this.IsLoadingOlderMessages;\n }\n\n /**\n * The transcript list — needed so a date jump can scroll AFTER this component has finished\n * paging older history. The list owns the scroll; this component owns the window.\n */\n @ViewChild(MessageListComponent) private messageListComponent?: MessageListComponent;\n\n /**\n * The element that actually scrolls the transcript, handed to the message list so its\n * \"earlier messages\" observer has a correct root.\n *\n * The list's own container does not scroll — this one carries the `overflow-y: auto` and\n * `min-height: 0` that make it a real scroller. Passing it down beats having the list\n * discover it, which depends on layout having settled.\n */\n public get MessageScrollRoot(): HTMLElement | null {\n return this.scrollContainer?.nativeElement ?? null;\n }\n\n /** @deprecated Use {@link MessageScrollRoot}. */\n public get messageScrollRoot(): HTMLElement | null {\n return this.MessageScrollRoot;\n }\n\n /**\n * Loads the next older page — fired by the message list's \"earlier messages\" sentinel.\n *\n * `LoadOlder` already no-ops when nothing is above or a load is in flight, so repeated\n * observer fires during a fast scroll are harmless. `messages` is reassigned to a NEW\n * array so the list's ngOnChanges runs; the list then detects the prepend and holds the\n * user's scroll position rather than jumping.\n */\n public async OnOlderMessagesRequested(): Promise<void> {\n const conversationId = this.ConversationId;\n await this.windowStore.LoadOlder(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n await this.refreshAfterPaging(conversationId!);\n }\n\n /** @deprecated Use {@link OnOlderMessagesRequested}. */\n public async onOlderMessagesRequested(): Promise<void> {\n return this.OnOlderMessagesRequested();\n }\n\n /**\n * Re-renders the transcript after one or more older pages have been merged.\n *\n * Costs proportional to what was ADDED, not to the whole window. It diffs the snapshot\n * against the rows currently rendered and hands only the difference to\n * {@link mergePeripheralsForNewRows} — so ordinary sentinel paging and a 50-page date jump\n * both pay per new row exactly once, and neither re-queries attachments for rows that are\n * already on screen.\n *\n * `this.messages` is assigned ONCE, after the peripherals land. Assigning it before the\n * await would show the rows a beat sooner, but the second assignment then changes bubble\n * heights (artifacts and attachments render) AFTER the list has already restored the\n * scroll position for the prepend — which is a visible jump. One render keeps the\n * measurement the list scrolls to and the content it finally paints in agreement.\n */\n private async refreshAfterPaging(conversationId: string): Promise<void> {\n const snapshot = this.windowStore.GetSnapshot();\n const renderedIds = new Set(this.messages.map(m => NormalizeUUID(m.ID)));\n const newDetails = snapshot.Details.filter(d => !renderedIds.has(NormalizeUUID(d.ID)));\n\n if (newDetails.length > 0) {\n await this.mergePeripheralsForNewRows(conversationId, snapshot, newDetails);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n }\n\n this.messages = [...snapshot.Details];\n this.cdr.detectChanges();\n }\n\n /**\n * Pages older history until a date jump can be satisfied, then scrolls to it.\n *\n * Windowing is exactly what broke the old implementation: the transcript no longer holds\n * every day, so \"jump to last month\" targets messages that are simply not loaded. This\n * pages until the target is in the loaded set, history runs out, or the page cap is hit —\n * and always reports the outcome, because the plan forbids a silent no-op here.\n */\n public async OnDateJumpRequested(period: DateJumpPeriod): Promise<void> {\n const conversationId = this.ConversationId;\n let pagesLoaded = 0;\n\n // The loop's ONLY job is to load enough history for the jump to be answerable. It does\n // not decide whether the jump succeeded — see CombineDateJumpOutcome.\n while (pagesLoaded < DATE_JUMP_MAX_PAGES) {\n const snapshot = this.windowStore.GetSnapshot();\n const { NeedsOlder } = ResolveDateJumpTarget(snapshot.Details, period, new Date());\n if (!NeedsOlder || !snapshot.Cursor.HasMoreAbove) {\n break; // answerable, or no more history to load\n }\n\n // Store-level paging: the per-page peripheral rebuild is deferred to a single\n // refresh below, so a deep jump costs one rebuild instead of one per page.\n await this.windowStore.LoadOlder(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return; // user switched away mid-jump\n }\n pagesLoaded++;\n }\n\n // One rebuild for however many pages arrived, then let it render before measuring.\n if (pagesLoaded > 0) {\n await this.refreshAfterPaging(conversationId!);\n }\n this.cdr.detectChanges();\n const scrollOutcome = this.messageListComponent?.ScrollToDateTarget(period) ?? 'empty';\n const finalOutcome = CombineDateJumpOutcome(scrollOutcome, pagesLoaded >= DATE_JUMP_MAX_PAGES);\n\n if (finalOutcome !== 'reached') {\n MJNotificationService.Instance.CreateSimpleNotification(\n DescribeDateJumpOutcome(finalOutcome, period), 'info', 3000\n );\n }\n }\n\n /** @deprecated Use {@link OnDateJumpRequested}. */\n public async onDateJumpRequested(period: DateJumpPeriod): Promise<void> {\n return this.OnDateJumpRequested(period);\n }\n\n // Test feedback dialog state\n public ShowTestFeedbackDialog: boolean = false;\n\n /** @deprecated Use {@link ShowTestFeedbackDialog}. */\n public get showTestFeedbackDialog(): boolean {\n return this.ShowTestFeedbackDialog;\n }\n /** @deprecated Use {@link ShowTestFeedbackDialog}. */\n public set showTestFeedbackDialog(value: boolean) {\n this.ShowTestFeedbackDialog = value;\n }\n public TestFeedbackDialogData: TestFeedbackDialogData | null = null;\n\n /** @deprecated Use {@link TestFeedbackDialogData}. */\n public get testFeedbackDialogData(): TestFeedbackDialogData | null {\n return this.TestFeedbackDialogData;\n }\n /** @deprecated Use {@link TestFeedbackDialogData}. */\n public set testFeedbackDialogData(value: TestFeedbackDialogData | null) {\n this.TestFeedbackDialogData = value;\n }\n\n // Image viewer state\n public ShowImageViewer: boolean = false;\n\n /** @deprecated Use {@link ShowImageViewer}. */\n public get showImageViewer(): boolean {\n return this.ShowImageViewer;\n }\n /** @deprecated Use {@link ShowImageViewer}. */\n public set showImageViewer(value: boolean) {\n this.ShowImageViewer = value;\n }\n public SelectedImageUrl: string = '';\n\n /** @deprecated Use {@link SelectedImageUrl}. */\n public get selectedImageUrl(): string {\n return this.SelectedImageUrl;\n }\n /** @deprecated Use {@link SelectedImageUrl}. */\n public set selectedImageUrl(value: string) {\n this.SelectedImageUrl = value;\n }\n public SelectedImageAlt: string = '';\n\n /** @deprecated Use {@link SelectedImageAlt}. */\n public get selectedImageAlt(): string {\n return this.SelectedImageAlt;\n }\n /** @deprecated Use {@link SelectedImageAlt}. */\n public set selectedImageAlt(value: string) {\n this.SelectedImageAlt = value;\n }\n public SelectedImageFileName: string = '';\n\n /** @deprecated Use {@link SelectedImageFileName}. */\n public get selectedImageFileName(): string {\n return this.SelectedImageFileName;\n }\n /** @deprecated Use {@link SelectedImageFileName}. */\n public set selectedImageFileName(value: string) {\n this.SelectedImageFileName = value;\n }\n\n // Upload indicator state (shown centered in conversation area)\n public IsUploadingAttachments: boolean = false;\n\n /** @deprecated Use {@link IsUploadingAttachments}. */\n public get isUploadingAttachments(): boolean {\n return this.IsUploadingAttachments;\n }\n /** @deprecated Use {@link IsUploadingAttachments}. */\n public set isUploadingAttachments(value: boolean) {\n this.IsUploadingAttachments = value;\n }\n public UploadingMessage: string = '';\n\n /** @deprecated Use {@link UploadingMessage}. */\n public get uploadingMessage(): string {\n return this.UploadingMessage;\n }\n /** @deprecated Use {@link UploadingMessage}. */\n public set uploadingMessage(value: string) {\n this.UploadingMessage = value;\n }\n\n // Attachment support based on agent modalities\n // Computed from conversation manager (Sage) and any previous agent in conversation\n public EnableAttachments: boolean = false;\n\n /** @deprecated Use {@link EnableAttachments}. */\n public get enableAttachments(): boolean {\n return this.EnableAttachments;\n }\n /** @deprecated Use {@link EnableAttachments}. */\n public set enableAttachments(value: boolean) {\n this.EnableAttachments = value;\n }\n public MaxAttachments: number = 10;\n\n /** @deprecated Use {@link MaxAttachments}. */\n public get maxAttachments(): number {\n return this.MaxAttachments;\n }\n /** @deprecated Use {@link MaxAttachments}. */\n public set maxAttachments(value: number) {\n this.MaxAttachments = value;\n }\n public MaxAttachmentSizeBytes: number = 20 * 1024 * 1024;\n\n /** @deprecated Use {@link MaxAttachmentSizeBytes}. */\n public get maxAttachmentSizeBytes(): number {\n return this.MaxAttachmentSizeBytes;\n }\n /** @deprecated Use {@link MaxAttachmentSizeBytes}. */\n public set maxAttachmentSizeBytes(value: number) {\n this.MaxAttachmentSizeBytes = value;\n } // 20MB default\n public AcceptedFileTypes: string = 'image/*';\n\n /** @deprecated Use {@link AcceptedFileTypes}. */\n public get acceptedFileTypes(): string {\n return this.AcceptedFileTypes;\n }\n /** @deprecated Use {@link AcceptedFileTypes}. */\n public set acceptedFileTypes(value: string) {\n this.AcceptedFileTypes = value;\n }\n private conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n\n private engine = ConversationEngine.Instance;\n\n private windowStore = new ConversationDetailWindowStore(ConversationEngine.Instance);\n\n\n /**\n * Voice session service — exposed to the template so the realtime \"call mode\"\n * overlay can be hosted here (it fills this conversation panel in place while\n * `Active$` is true). The trigger wiring lives in <mj-message-input>.\n */\n public readonly RealtimeSession = inject(RealtimeSessionService);\n\n /** Stateless loader for the call overlay's SESSION REVIEW mode (past realtime sessions). */\n private readonly realtimeReviewService = inject(RealtimeSessionReviewService);\n\n /**\n * The PAST realtime session currently under review, or null. While set (and no live\n * call is active) the realtime overlay renders in SESSION REVIEW mode over this\n * conversation panel. Populated via {@link OpenRealtimeSessionReview}; cleared when\n * the user closes the review or resumes it as a new live call.\n */\n public RealtimeReview: RealtimeSessionReview | null = null;\n\n /**\n * Session-row enrichment for the timeline's realtime SESSION BLOCKS (details stamped\n * with an `AgentSessionID` collapse to one card per session — see the message list's\n * timeline pass). Keyed by `NormalizeUUID(sessionId)`; loaded with ONE batched\n * `MJ: AI Agent Sessions` lookup per conversation, only when stamped rows exist.\n * Tolerant: a failed lookup leaves the map empty and cards render their generic label.\n */\n public RealtimeSessionMetaMap: Map<string, RealtimeSessionTimelineMeta> = new Map();\n\n /** @deprecated Use {@link RealtimeSessionMetaMap}. */\n public get realtimeSessionMetaMap(): Map<string, RealtimeSessionTimelineMeta> {\n return this.RealtimeSessionMetaMap;\n }\n /** @deprecated Use {@link RealtimeSessionMetaMap}. */\n public set realtimeSessionMetaMap(value: Map<string, RealtimeSessionTimelineMeta>) {\n this.RealtimeSessionMetaMap = value;\n }\n\n /** Agent name the overlay banner shows: the reviewed session's agent while reviewing, else the live call's. */\n public get RealtimeOverlayAgentName(): string {\n if (this.RealtimeReview && !this.RealtimeSession.IsActive) {\n return this.RealtimeReview.AgentName;\n }\n return this.RealtimeSession.CurrentAgentName;\n }\n\n /** @deprecated Use {@link RealtimeOverlayAgentName}. */\n public get realtimeOverlayAgentName(): string {\n return this.RealtimeOverlayAgentName;\n }\n\n // Shared AI mention/suggestion engine (BaseSingleton — same instance the composer plugins use)\n private mentionAutocompleteService = MentionAutocompleteService.Instance;\n\n constructor(\n private agentStateService: AgentStateService,\n private conversationAgentService: ConversationAgentService,\n private activeTasks: ActiveTasksService,\n private cdr: ChangeDetectorRef,\n private artifactPermissionService: ArtifactPermissionService,\n private attachmentService: ConversationAttachmentService,\n private streamingService: ConversationStreamingService,\n private confirmDialog: ConversationsDialogService,\n private bridge: ConversationBridgeService,\n private analyzeArtifactService: AnalyzeArtifactService,\n private uiCommandHandler: UICommandHandlerService,\n private interactiveFormApplyService: InteractiveFormApplyService,\n private agentClientService: AgentClientService\n ) {\n super();}\n\n /**\n * Apply a form-role artifact's spec as an EntityFormOverride for the\n * current user. The service handles the Create-vs-Modify decision (based\n * on whether an Active override already exists), confirms via dialog,\n * and surfaces success/failure via notification.\n */\n async OnApplyFormRequested(event: { spec: unknown; entityName: string }): Promise<void> {\n await this.interactiveFormApplyService.ConfirmAndApply(\n event.spec as ComponentSpec,\n event.entityName,\n this.ProviderToUse,\n );\n }\n\n async ngOnInit() {\n // Bind provider-aware services to this component's provider so multi-server\n // browser apps don't silently fall back to the global Metadata.Provider.\n const p = this.ProviderToUse;\n this.agentStateService.Provider = p;\n this.conversationAgentService.Provider = p;\n this.activeTasks.Provider = p;\n this.artifactPermissionService.Provider = p;\n this.attachmentService.Provider = p;\n this.analyzeArtifactService.Provider = p;\n\n // Subscribe to actionable commands from UICommandHandlerService so we can\n // intercept and locally handle commands that depend on the conversation\n // surface (e.g. `client:capture-data-snapshot`, which needs access to the\n // artifact viewer panel and the message input — both live in this chat-area).\n // The workspace's existing subscription still fires and bubbles every command\n // up to the host application; this is purely additive — host apps can still\n // override or augment behavior by handling the bubbled event.\n this.uiCommandHandler.actionableCommandRequested\n .pipe(takeUntil(this.destroy$))\n .subscribe((request: ActionableCommandRequest) => {\n const { command, conversationId } = request;\n if (command.type === 'client:capture-data-snapshot') {\n if (conversationId && !this.isActiveConversation(conversationId)) {\n return;\n }\n void this.handleCaptureDataSnapshotCommand(command);\n return;\n }\n if (command.type === 'open:resource' && command.resourceType === 'Record' && command.entityName) {\n if (conversationId && !this.isActiveConversation(conversationId)) {\n return;\n }\n this.emitOpenResourceRecord(command);\n }\n });\n\n // REALTIME-CREATED CONVERSATIONS — three-beat lifecycle so the UI feels live:\n // START: fold the server-created conversation into the cached list right away\n // (it shows as 'New Conversation' while the call runs; no selection yet).\n // Driven by SessionStarted$ — it fires AFTER mintSession resolves, so the\n // created conversation id is guaranteed present (Active$ races the mint).\n // FIRST UTTERANCE: auto-name it via the shared helper (background) — the list\n // updates reactively through ConversationEngine.Conversations$.\n // END: select it (workspace gates on the list being visible).\n let namedThisSession = false;\n this.RealtimeSession.SessionStarted$\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n namedThisSession = false;\n this.onRealtimeSessionStarted();\n });\n let voiceWasActive = false;\n this.RealtimeSession.Active$\n .pipe(takeUntil(this.destroy$))\n .subscribe((active) => {\n if (voiceWasActive && !active) {\n this.onRealtimeSessionEnded();\n }\n voiceWasActive = active;\n });\n this.RealtimeSession.Captions$\n .pipe(takeUntil(this.destroy$))\n .subscribe((captions) => {\n if (namedThisSession || !this.AutoNameConversation) {\n return;\n }\n const created = this.RealtimeSession.SessionCreatedConversationId;\n const seed = this.RealtimeSession.FirstUserTranscript;\n if (created && seed && captions.some(c => c.Role === 'User')) {\n namedThisSession = true;\n void GenerateAndApplyConversationName({\n ConversationId: created,\n MessageText: seed,\n Provider: this.ProviderToUse as GraphQLDataProvider,\n CurrentUser: this.CurrentUser\n });\n }\n });\n\n // Bridge AgentClientService's tool-dispatch observables to chat-area's\n // Before/After cancelable @Outputs. `ToolRequested$` fires synchronously\n // BEFORE the tool runs; `ToolExecuted$` fires after a successful dispatch\n // (suppressed when the host vetoes via Cancel).\n //\n // Cancel-enforcement: the `ClientToolRequestEvent` carries a mutable\n // `Cancel: boolean` field. We emit the Angular `beforeToolInvoked` event\n // synchronously inside the RxJS subscriber, listeners can flip\n // `args.Cancel = true`, and we copy that decision back to `toolEvent.Cancel`\n // before the subscriber returns. `AgentClientSession.handleToolRequest` then\n // sees the veto, short-circuits dispatch, and reports the cancellation back\n // to the server. `afterToolInvoked` does NOT fire in the canceled case.\n this.agentClientService.ToolRequested$\n .pipe(takeUntil(this.destroy$))\n .subscribe((toolEvent) => {\n const args = new BeforeToolInvokedEventArgs(\n toolEvent.Request.ToolName,\n toolEvent.Request.Params\n );\n this.BeforeToolInvoked.emit(args);\n if (args.Cancel) {\n toolEvent.Cancel = true;\n toolEvent.CancelReason = args.CancelReason;\n }\n });\n this.agentClientService.ToolExecuted$\n .pipe(takeUntil(this.destroy$))\n .subscribe((toolEvent) => {\n this.AfterToolInvoked.emit(\n new AfterToolInvokedEventArgs(\n toolEvent.Request.ToolName,\n toolEvent.Request.Params,\n toolEvent.Result\n )\n );\n });\n\n // Bridge ConversationsRuntime.Sessions.SessionLifecycle$ → chat-area's\n // informational session* outputs. The runtime's SessionsObserver subscribes\n // to whichever ISessionsAdapter the host registered at bootstrap (today:\n // RealtimeSessionsAdapter from ConversationsRuntimeBootstrap, bridging\n // RealtimeSessionService from PR #2787). Each event variant maps 1:1 to one\n // of the three @Output() emitters declared above.\n ConversationsRuntime.Instance.Sessions.SessionLifecycle$\n .pipe(takeUntil(this.destroy$))\n .subscribe((event) => {\n switch (event.kind) {\n case 'session-started':\n this.SessionStarted.emit(\n new SessionStartedEventArgs(event.sessionId, event.channelKinds)\n );\n return;\n case 'session-channel':\n this.SessionChannelStateChanged.emit(\n new SessionChannelStateChangedEventArgs(\n event.sessionId,\n event.channelKind,\n event.state\n )\n );\n return;\n case 'session-ended':\n this.SessionEnded.emit(\n new SessionEndedEventArgs(event.sessionId, event.reason)\n );\n return;\n }\n });\n\n // The workspace component initializes AI Engine and mention service before\n // any child components render, so we can safely skip duplicate initialization.\n // This prevents race conditions and ensures agents are fully loaded.\n\n // Fallback: If workspace didn't initialize (shouldn't happen), initialize now\n if (!this.mentionAutocompleteService.IsInitialized) {\n console.warn('⚠️ Mention autocomplete not initialized by workspace, initializing now...');\n await this.mentionAutocompleteService.initialize(this.CurrentUser);\n }\n\n // Ensure ConversationEngine and ArtifactMetadataEngine are loaded.\n // Config(false) is a no-op if already loaded by another component.\n // ConversationEngine.Config() also initializes ArtifactMetadataEngine internally.\n await ConversationEngine.Instance.Config(false, this.CurrentUser);\n\n // Initialize attachment support based on agent modalities\n await this.initializeAttachmentSupport();\n\n // Load saved artifact pane width\n this.loadArtifactPaneWidth();\n\n // Mark as initialized so setter can trigger conversation changes\n this.isInitialized = true;\n\n // Initial load if there's already an active conversation\n if (this.ConversationId) {\n await this.onConversationChanged(this.ConversationId);\n }\n\n // Setup resize listeners\n window.addEventListener('mousemove', this.boundOnResizeMove);\n window.addEventListener('mouseup', this.boundOnResizeEnd);\n window.addEventListener('touchmove', this.boundOnResizeTouchMove);\n window.addEventListener('touchend', this.boundOnResizeTouchEnd);\n\n // Handle overlay→workspace handoffs: if the handed-off conversation is already\n // loaded, force a reload from the engine (which has the latest data).\n this.bridge.SwitchEvent$\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => {\n if (event.Target === 'workspace' && event.ConversationID) {\n if (UUIDsEqual(event.ConversationID, this._conversationId)) {\n // Same conversation already displayed — reload from engine\n this.lastLoadedConversationId = null; // Reset so peripheral data reprocesses\n void this.onConversationChanged(event.ConversationID);\n }\n // Different conversation — engine cache is already warm, onConversationChanged\n // will read from it when the parent sets the conversationId input.\n }\n });\n\n // Subscribe to completion events from PubSub\n this.streamingService.completionEvents$\n .pipe(takeUntil(this.destroy$))\n .subscribe(async (event) => {\n // Find the message in our current conversation\n const conversationId = this.ConversationId;\n const message = this.messages.find(m => UUIDsEqual(m.ID, event.conversationDetailId));\n if (message && conversationId) {\n await this.handleMessageCompletion(message, event.agentRunId, conversationId);\n }\n });\n\n // Subscribe to polling-based agent state as a secondary fallback for completion detection.\n // The sessionId is persisted in localStorage and reused on refresh, so WebSocket events\n // normally arrive correctly. However, there's a brief timing gap between page load and\n // WebSocket reconnection where events can be lost. The catch-up check in\n // detectAndReconcileAgentRuns() is the primary fallback; polling is the last resort.\n this.agentStateService.activeAgents$\n .pipe(takeUntil(this.destroy$))\n .subscribe(async (agents) => {\n const conversationId = this.ConversationId;\n if (!conversationId) return;\n const conversationAgents = agents.filter(a => UUIDsEqual(a.run.ConversationID, conversationId));\n const hasActiveAgents = conversationAgents.length > 0;\n if (this.hadActiveAgents && !hasActiveAgents) {\n // Agents just completed — refresh the NEWEST window page to pick up new messages,\n // updated agent runs, and new artifacts. Deliberately not the engine's full-history\n // RefreshConversationDetails: that would re-query the whole conversation and, via\n // GetCachedDetails, replace the loaded window with every row.\n await this.windowStore.RefreshLatest(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n const refreshed = this.windowStore.GetSnapshot();\n this.messages = refreshed.Details;\n\n // Reprocess peripheral data (artifacts, ratings) from the refreshed window\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(conversationId, refreshed);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Clear active tasks for messages that are no longer in-progress\n for (const message of this.messages) {\n if (message.Status !== 'In-Progress') {\n const task = this.activeTasks.getByConversationDetailId(message.ID);\n if (task) {\n this.activeTasks.remove(task.id);\n }\n }\n }\n\n this.cdr.detectChanges();\n }\n this.hadActiveAgents = hasActiveAgents;\n });\n }\n\n /**\n * Initializes attachment support by checking if the conversation manager agent (Sage)\n * or any recent agent in the conversation supports non-text input modalities.\n */\n private async initializeAttachmentSupport(): Promise<void> {\n try {\n // Ensure AIEngineBase is configured with modality data\n await AIEngineBase.Instance.Config(false);\n\n // Get the conversation manager agent (Sage)\n this.conversationManagerAgent = await this.conversationAgentService.getConversationManagerAgent();\n\n if (this.conversationManagerAgent?.ID) {\n // Get attachment limits from agent metadata (uses Agent → Model → System → Default cascade)\n const limits = AIEngineBase.Instance.GetAgentAttachmentLimits(this.conversationManagerAgent.ID);\n this.EnableAttachments = limits.enabled;\n this.MaxAttachments = limits.maxAttachments;\n this.MaxAttachmentSizeBytes = limits.maxAttachmentSizeBytes;\n this.AcceptedFileTypes = limits.acceptedFileTypes;\n LogStatusEx({message: `Attachment support initialized: ${this.EnableAttachments} (max ${this.MaxAttachments}, ${(this.MaxAttachmentSizeBytes / 1024 / 1024).toFixed(0)}MB)`, verboseOnly: true});\n } else {\n // Default to false if we can't determine\n this.EnableAttachments = false;\n LogStatusEx({message: 'Attachment support disabled: conversation manager agent not available', verboseOnly: true});\n }\n } catch (error) {\n console.warn('Failed to initialize attachment support:', error);\n this.EnableAttachments = false;\n }\n }\n\n /**\n * Updates attachment support based on the current conversation context.\n * Called when conversation changes to check if any agent in the conversation supports attachments.\n */\n private updateAttachmentSupport(): void {\n // Determine which agent to use for limits - prefer last non-Sage agent, fall back to Sage\n let agentIdForLimits = this.conversationManagerAgent?.ID || null;\n\n // Check if any previous non-Sage agent in the conversation supports attachments\n if (this.messages.length > 0) {\n const lastNonSageAgent = this.messages\n .slice()\n .reverse()\n .find(msg =>\n msg.Role === 'AI' &&\n msg.AgentID &&\n !UUIDsEqual(msg.AgentID, this.conversationManagerAgent?.ID)\n );\n\n if (lastNonSageAgent?.AgentID) {\n // Check if this agent supports attachments\n if (AIEngineBase.Instance.AgentSupportsAttachments(lastNonSageAgent.AgentID)) {\n agentIdForLimits = lastNonSageAgent.AgentID;\n }\n }\n }\n\n // Get limits from the determined agent\n if (agentIdForLimits) {\n const limits = AIEngineBase.Instance.GetAgentAttachmentLimits(agentIdForLimits);\n this.EnableAttachments = limits.enabled;\n this.MaxAttachments = limits.maxAttachments;\n this.MaxAttachmentSizeBytes = limits.maxAttachmentSizeBytes;\n this.AcceptedFileTypes = limits.acceptedFileTypes;\n } else {\n this.EnableAttachments = false;\n }\n }\n\n ngAfterViewChecked() {\n if (this.scrollToBottom) {\n this.scrollToBottom = false;\n setTimeout(() => {\n if (Date.now() < this.bottomFollowSuppressedUntil) {\n return;\n }\n this.ScrollToBottomNow();\n // Check scroll state after scrolling to bottom\n this.CheckScroll();\n }, 100);\n }\n if (this.pendingTurnStartMessageId) {\n const messageId = this.pendingTurnStartMessageId;\n this.pendingTurnStartMessageId = null;\n // Deferred for the same reason checkScroll() is not called synchronously below.\n setTimeout(() => this.scrollTurnToTop(messageId), 0);\n }\n // Removed synchronous checkScroll() from else branch to prevent\n // ExpressionChangedAfterItHasBeenCheckedError. Calling detectChanges()\n // inside ngAfterViewChecked re-enters change detection and causes\n // Angular's verification pass to see inconsistent state.\n // Scroll icon visibility is still updated via:\n // 1. (scroll)=\"checkScroll()\" on the scroll container (user scroll events)\n // 2. setTimeout callback above (after programmatic scroll-to-bottom)\n }\n\n ngOnDestroy() {\n // Stop polling when component is destroyed\n this.agentStateService.stopPolling();\n\n // Complete destroy subject to cleanup subscriptions\n this.destroy$.next();\n this.destroy$.complete();\n\n this.clearTurnTracking();\n\n // Remove resize listeners\n window.removeEventListener('mousemove', this.boundOnResizeMove);\n window.removeEventListener('mouseup', this.boundOnResizeEnd);\n window.removeEventListener('touchmove', this.boundOnResizeTouchMove);\n window.removeEventListener('touchend', this.boundOnResizeTouchEnd);\n }\n\n private isActiveConversation(conversationId: string | null | undefined): boolean {\n return UUIDsEqual(conversationId, this.ConversationId);\n }\n\n private isActiveConversationLoad(conversationId: string | null | undefined, loadToken: number): boolean {\n return loadToken === this.conversationLoadToken && this.isActiveConversation(conversationId);\n }\n\n private isCurrentConversationContext(conversationId: string | null | undefined, loadToken?: number): boolean {\n return loadToken != null\n ? this.isActiveConversationLoad(conversationId, loadToken)\n : this.isActiveConversation(conversationId);\n }\n\n private resetConversationScopedViewState(): void {\n this.clearTurnTracking();\n this.ShowArtifactPanel = false;\n this.SelectedArtifactId = null;\n this.SelectedVersionNumber = undefined;\n this.CanShareSelectedArtifact = false;\n this.CanEditSelectedArtifact = false;\n this.ShowArtifactsModal = false;\n this.ShowSystemArtifacts = false;\n this.ExpandedArtifactId = null;\n this._combinedArtifactsMap = null;\n\n this.IsArtifactShareModalOpen = false;\n this.ArtifactToShare = null;\n this.ShowCollectionPicker = false;\n this.CollectionPickerArtifactId = null;\n this.CollectionPickerExcludedIds = [];\n this.CollectionPickerVersionId = null;\n this.CollectionPickerArtifactName = '';\n this.CollectionPickerVersionNumber = null;\n\n this.ShowImageViewer = false;\n this.SelectedImageUrl = '';\n this.SelectedImageAlt = '';\n this.SelectedImageFileName = '';\n this.ShowTestFeedbackDialog = false;\n this.TestFeedbackDialogData = null;\n this.ShowPinsPanel = false;\n this.pinsHydrated = false;\n this.ShowAgentPanel = false;\n this.ShowExportModal = false;\n this.ShowShareModal = false;\n this.ShareContext = null;\n this.ShowMembersModal = false;\n this.ShowProjectSelector = false;\n this.IsUploadingAttachments = false;\n this.UploadingMessage = '';\n this.intentCheckMessage = null;\n\n // Reset width along with the flag — otherwise a pane maximized in the\n // previous conversation leaves artifactPaneWidth at 100, and the next\n // artifact opens overflowing the viewport (chat area still visible).\n // Guarded so a non-maximized user-dragged width survives the switch.\n if (this.IsArtifactPaneMaximized) {\n this.resetArtifactPaneSizing();\n }\n }\n\n private resetArtifactPaneSizing(): void {\n this.IsArtifactPaneMaximized = false;\n this.ArtifactPaneWidth = DEFAULT_ARTIFACT_PANE_WIDTH;\n }\n\n private async onConversationChanged(conversationId: string | null): Promise<void> {\n // Prevent double-loading if we're already loading this same conversation\n // (ngDoCheck can fire multiple times during state changes)\n if (this.currentlyLoadingConversationId === conversationId && conversationId !== null) {\n return;\n }\n const loadToken = ++this.conversationLoadToken;\n\n this.resetConversationScopedViewState();\n\n // Reset poll-based completion tracking whenever we switch conversations,\n // so the first empty poll on the new conversation doesn't trigger a spurious reload.\n this.hadActiveAgents = false;\n\n if (conversationId) {\n this.currentlyLoadingConversationId = conversationId;\n\n if (!this.messageInputMetadataCache.has(conversationId)) {\n this.messageInputMetadataCache.set(conversationId, {\n conversationId: conversationId,\n conversationName: this.Conversation?.Name || null\n });\n }\n\n // Only show loading spinner if the engine doesn't have cached data for this conversation.\n // This prevents the \"no messages\" flash when switching between conversations.\n const hasCachedMessages = this.engine.HasCachedDetails(conversationId);\n if (!hasCachedMessages) {\n this.IsLoadingConversation = true;\n this.messages = [];\n this.cdr.detectChanges();\n }\n\n try {\n await this.loadMessages(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.restoreActiveTasks(conversationId);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n // TODO: Replace polling with PubSub - see plans/repair-conversations-ui-performance.md\n this.agentStateService.startPolling(this.CurrentUser, conversationId);\n } catch (error) {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n console.error('Error loading conversation:', error);\n this.messages = [];\n } finally {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.currentlyLoadingConversationId = null;\n this.IsLoadingConversation = false;\n\n // Create new array reference to trigger Angular change detection\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n // Defensive fallback: force another change detection cycle after async ops complete\n setTimeout(() => {\n if (conversationId === this._conversationId && this.messages.length > 0) {\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n }, 50);\n }\n } else {\n // No active conversation - show empty state\n this.messages = [];\n this.IsLoadingConversation = false;\n this.currentlyLoadingConversationId = null;\n this.lastLoadedConversationId = null;\n this.agentStateService.stopPolling();\n }\n }\n\n /**\n * Returns array of cached message-input metadata for rendering\n * This allows multiple message-input components to exist simultaneously (hidden)\n * preserving their state when switching conversations\n */\n public GetCachedInputs(): Array<{conversationId: string; conversationName: string | null}> {\n return Array.from(this.messageInputMetadataCache.values());\n }\n\n /** @deprecated Use {@link GetCachedInputs}. */\n public getCachedInputs(): Array<{conversationId: string; conversationName: string | null}> {\n return this.GetCachedInputs();\n }\n\n /**\n * Focus the message input inside the empty state component.\n * Uses a delay to allow Angular to render the empty state if it's being created.\n */\n private focusEmptyStateInput(): void {\n setTimeout(() => {\n if (this.emptyStateComponent) {\n this.emptyStateComponent.FocusInput();\n }\n }, 150);\n }\n\n /**\n * Get the message input component for the current conversation.\n * Since we cache multiple message-input instances (one per visited conversation),\n * we need to find the one that matches the current conversationId.\n */\n private getActiveMessageInputComponent(): MessageInputComponent | undefined {\n if (!this.messageInputComponents || !this.ConversationId) {\n return undefined;\n }\n return this.messageInputComponents.find(\n component => component.conversationId === this.ConversationId\n );\n }\n\n private async loadMessages(conversationId: string, loadToken: number): Promise<void> {\n try {\n // WINDOWED read: only the newest page of the transcript, not the whole conversation.\n // The store owns the loaded window and its paging cursors; the engine's full-history\n // LoadConversationDetails stays untouched for agent/server callers. There is no\n // forceRefresh here — a window is always fetched fresh, so no cache can go stale.\n //\n // DELIBERATE TRADE, both directions. The path this replaced went through\n // LoadConversationDetails, which cached per conversation id in the engine's\n // `_detailCache` — so re-entering a conversation you had already opened was instant\n // with zero database work. `LoadLatest` always fetches, so every re-entry now costs a\n // window read plus the follow-ups in LoadDetailWindow's round-trip profile. For a user\n // tabbing between a handful of conversations that is a REGRESSION against the old\n // behaviour, on a change whose headline is that opening a conversation got cheaper.\n //\n // Accepted for now because the win it buys is unbounded (first open no longer scales\n // with conversation length) and the loss is bounded (a fixed handful of queries), and\n // because the obvious remedy — caching partial windows — is exactly the thing that must\n // never leak into `_detailCache`, where `GetAgentContextWindow` would read it as\n // complete history. A separate `_partialDetailCache` is the shape to reach for if\n // measurement says re-entry is worth it. Measure before building it.\n // Pins are counted separately: a pin can sit far below the window's oldest Sequence,\n // and the pins panel must list ALL of them, not just the ones currently on screen.\n // Concurrent with the window — the two share only the conversation id, and running the\n // pin read after the window made it delay first paint for no reason.\n await Promise.all([\n this.windowStore.LoadLatest(conversationId, this.CurrentUser),\n this.loadPinnedMessageCount(conversationId, loadToken)\n ]);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n\n // Read the loaded window back off the store\n const snapshot = this.windowStore.GetSnapshot();\n this.messages = snapshot.Details;\n\n // Copy user avatars from the window result\n this.UserAvatarMap.clear();\n for (const [userId, avatar] of snapshot.UserAvatars) {\n this.UserAvatarMap.set(userId, {\n imageUrl: avatar.ImageURL,\n iconClass: avatar.IconClass\n });\n }\n\n this.updateAttachmentSupport();\n\n // Detect in-progress messages for streaming reconnection\n this.InProgressMessageIds = [...this.messages\n .filter(m => m.Status === 'In-Progress')\n .map(m => m.ID)];\n\n if (this.InProgressMessageIds.length > 0) {\n LogStatusEx({message: `🔌 Detected ${this.InProgressMessageIds.length} in-progress messages for reconnection`, verboseOnly: true});\n }\n\n // Check for missed completions (user navigated away, agent completed, user returned)\n for (const message of this.messages) {\n if (message.Status === 'In-Progress' && message.ID) {\n const recentCompletion = this.streamingService.getRecentCompletion(message.ID);\n if (recentCompletion) {\n LogStatusEx({message: `📥 Found missed completion for message ${message.ID}, handling...`, verboseOnly: true});\n await this.handleMessageCompletion(message, recentCompletion.agentRunId, conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.streamingService.clearRecentCompletion(message.ID);\n }\n }\n }\n\n this.followTranscript('load');\n\n // Process peripheral data (agent runs, artifacts, ratings, attachments) from engine cache\n await this.loadPeripheralData(conversationId, snapshot, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n\n await this.detectAndReconcileAgentRuns(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.handlePendingArtifactNavigation();\n\n } catch (error) {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n console.error('Error loading messages:', error);\n this.messages = [];\n }\n }\n\n\n /**\n * Reads only the PIN COUNT on conversation open.\n *\n * `count_only` returns no rows at all — the chip needs a number, and the panel needs\n * nothing until it is opened. Hydrating every pin here put an unbounded `entity_object`\n * read on the critical path of a change whose whole point is a bounded open, and because\n * it was awaited AFTER the window load it also delayed first paint.\n *\n * The entities load in {@link hydratePinnedMessages}, on first panel open.\n */\n private async loadPinnedMessageCount(conversationId: string, loadToken: number): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJConversationDetailEntity>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND IsPinned=1`,\n ResultType: 'count_only'\n }, this.CurrentUser);\n\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n this.windowStore.SetPinnedCount(result.Success ? result.TotalRowCount : 0);\n }\n\n /**\n * Hydrates the pins panel's rows — first panel open only.\n *\n * Deliberately unbounded: the panel's contract is that it lists EVERY pin, including ones\n * below the loaded window, and by this point the user has explicitly asked for them.\n *\n * `entity_object` is required, not incidental — {@link onUnpinFromPanel} mutates `IsPinned`\n * and calls `.Save()` on these instances directly, so `'simple'` would break unpinning\n * from the panel with no error at all.\n */\n private async hydratePinnedMessages(conversationId: string): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJConversationDetailEntity>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${conversationId}' AND IsPinned=1`,\n OrderBy: 'Sequence DESC', // newest pin first — the panel's order\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n if (!result.Success) {\n console.error('Failed to load pinned messages:', result.ErrorMessage);\n return; // keep the count — the chip stays honest even though the panel is empty\n }\n this.windowStore.SetPinnedDetails(result.Results ?? []);\n this.pinsHydrated = true;\n }\n\n\n /**\n * Reshapes one detail's artifacts into the UI's `LazyArtifactInfo` lists, splitting the\n * system-only ones out. Shared by the full rebuild and the incremental prepend so the two\n * can never disagree about how an artifact becomes a card.\n */\n private applyArtifactsForDetail(detailId: string, artifacts: ArtifactJSON[]): void {\n const artifactList: LazyArtifactInfo[] = [];\n const systemArtifactList: LazyArtifactInfo[] = [];\n\n for (const artifactData of artifacts) {\n const lazyInfo = new LazyArtifactInfo(artifactData, this.CurrentUser);\n if (artifactData.Visibility === 'System Only') {\n systemArtifactList.push(lazyInfo);\n } else {\n artifactList.push(lazyInfo);\n }\n }\n\n if (artifactList.length > 0) {\n this.ArtifactsByDetailId.set(detailId, artifactList);\n }\n if (systemArtifactList.length > 0) {\n this.SystemArtifactsByDetailId.set(detailId, systemArtifactList);\n }\n }\n\n /**\n * Extends the display maps with JUST the rows a prepend added.\n *\n * The counterpart to {@link loadPeripheralData}, which clears and rebuilds all four maps\n * over the whole accumulated window, re-queries attachments for every loaded id, and\n * re-allocates every `LazyArtifactInfo`. Paying that per page makes ordinary scroll-up\n * paging quadratic — ten pages back re-queries attachments for roughly fifty-five pages'\n * worth of ids — which, stacked on the per-page round trips documented on\n * `LoadDetailWindow`, ends up costing more than the single full load this feature replaced.\n *\n * Everything here is scoped to `newDetails`, so the cost is proportional to the PAGE. The\n * store already accumulates peripherals correctly across pages, so the snapshot's maps are\n * read only at the new ids.\n *\n * @param newDetails - Rows present in the snapshot that were not already rendered\n */\n private async mergePeripheralsForNewRows(\n conversationId: string,\n snapshot: ConversationDetailWindowSnapshot,\n newDetails: MJConversationDetailEntity[]\n ): Promise<void> {\n const newIds = newDetails.map(d => d.ID).filter((id): id is string => !!id);\n\n // Merge, never clear — the rows already on screen keep the peripherals they were\n // rendered with.\n for (const detailId of newIds) {\n const agentRun = snapshot.AgentRunsByDetailId.get(detailId);\n if (agentRun) {\n this.AgentRunsByDetailId.set(detailId, agentRun as MJAIAgentRunEntityExtended);\n }\n const artifacts = snapshot.ArtifactsByDetailId.get(detailId);\n if (artifacts) {\n this.applyArtifactsForDetail(detailId, artifacts);\n }\n const ratings = snapshot.RatingsByDetailId.get(detailId);\n if (ratings) {\n this.RatingsByDetailId.set(detailId, ratings);\n }\n }\n\n if (newIds.length > 0) {\n const attachmentsMap = await this.attachmentService.loadAttachmentsForMessages(newIds, this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n for (const [detailId, attachments] of attachmentsMap) {\n this.AttachmentsByDetailId.set(detailId, attachments);\n }\n }\n\n // Session meta MERGES here rather than replacing: an older page's sessions are additional\n // cards, and replacing would strip the status chips off the ones already rendered.\n const sessionMeta = await this.fetchRealtimeSessionMeta(newDetails, conversationId);\n if (sessionMeta === null) {\n return;\n }\n if (sessionMeta.size > 0) {\n this.RealtimeSessionMetaMap = new Map([...this.RealtimeSessionMetaMap, ...sessionMeta]);\n }\n\n // A page of OLDER artifacts just entered the map. Any artifact-panel baseline taken before\n // this point can no longer be diffed against the map for creations — these arrived from\n // history, not from a run. See snapshotArtifactPanelBaseline.\n this.artifactMapGeneration++;\n\n // New references so the message list's ngOnChanges sees the extended maps.\n this.AgentRunsByDetailId = new Map(this.AgentRunsByDetailId);\n this.ArtifactsByDetailId = new Map(this.ArtifactsByDetailId);\n this.RatingsByDetailId = new Map(this.RatingsByDetailId);\n this.SystemArtifactsByDetailId = new Map(this.SystemArtifactsByDetailId);\n this.AttachmentsByDetailId = new Map(this.AttachmentsByDetailId);\n\n this._combinedArtifactsMap = null;\n this.ArtifactCount = this.calculateUniqueArtifactCount();\n this.updateArtifactCountDisplay();\n }\n\n /**\n * Builds the display maps (agent runs, artifacts, ratings) for the LOADED WINDOW.\n *\n * The peripherals arrive with the window itself — `ConversationEngine.LoadDetailWindow`\n * batches them in one `RunViews` scoped to the window's detail IDs — so this method only\n * reshapes them for the UI and issues no queries of its own.\n *\n * @param snapshot - The loaded window, from `windowStore.GetSnapshot()`. Passed in rather\n * than read from the engine's `_detailCache`, which the windowed path never populates.\n */\n private async loadPeripheralData(\n conversationId: string,\n snapshot: ConversationDetailWindowSnapshot,\n loadToken?: number\n ): Promise<void> {\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n\n // Skip if we've already processed peripheral data for this conversation.\n // NOTE (Phase 5): paging up loads OLDER rows with their own peripherals — this guard\n // must not block that refresh once the sentinel lands.\n if (this.lastLoadedConversationId === conversationId) {\n return;\n }\n\n try {\n const cacheEntry = snapshot;\n\n // Clear and rebuild component maps from the window's peripherals\n this.AgentRunsByDetailId.clear();\n this.ArtifactsByDetailId.clear();\n this.SystemArtifactsByDetailId.clear();\n this.RatingsByDetailId.clear();\n\n // Copy agent runs from engine (cast to extended type for UI compatibility)\n for (const [detailId, agentRun] of cacheEntry.AgentRunsByDetailId) {\n this.AgentRunsByDetailId.set(detailId, agentRun as MJAIAgentRunEntityExtended);\n }\n\n // Convert ArtifactJSON[] from engine cache into LazyArtifactInfo[] for UI\n for (const [detailId, artifacts] of cacheEntry.ArtifactsByDetailId) {\n this.applyArtifactsForDetail(detailId, artifacts);\n }\n\n // Copy ratings from engine cache\n for (const [detailId, ratings] of cacheEntry.RatingsByDetailId) {\n this.RatingsByDetailId.set(detailId, ratings);\n }\n\n // Load attachments (still separate — not part of GetConversationComplete query)\n this.AttachmentsByDetailId.clear();\n const messageIds = cacheEntry.Details.map(d => d.ID).filter((id): id is string => !!id);\n if (messageIds.length > 0) {\n const attachmentsMap = await this.attachmentService.loadAttachmentsForMessages(messageIds, this.CurrentUser);\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n for (const [detailId, attachments] of attachmentsMap) {\n this.AttachmentsByDetailId.set(detailId, attachments);\n }\n }\n\n // Load session-row meta for any realtime SESSION BLOCKS in the timeline\n // (agent name + status/close-reason chip on the collapsed session cards)\n await this.loadRealtimeSessionMeta(cacheEntry.Details, conversationId, loadToken);\n if (!this.isCurrentConversationContext(conversationId, loadToken)) {\n return;\n }\n\n // Create new Map references to trigger Angular change detection\n this.AgentRunsByDetailId = new Map(this.AgentRunsByDetailId);\n this.ArtifactsByDetailId = new Map(this.ArtifactsByDetailId);\n this.RatingsByDetailId = new Map(this.RatingsByDetailId);\n this.SystemArtifactsByDetailId = new Map(this.SystemArtifactsByDetailId);\n this.AttachmentsByDetailId = new Map(this.AttachmentsByDetailId);\n\n // Clear combined cache since we loaded new artifacts\n this._combinedArtifactsMap = null;\n\n // Update artifact count for header display\n this.ArtifactCount = this.calculateUniqueArtifactCount();\n this.updateArtifactCountDisplay();\n\n this.lastLoadedConversationId = conversationId;\n\n // Trigger message re-render now that peripheral data is loaded\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Failed to process peripheral data:', error);\n this.lastLoadedConversationId = null;\n }\n }\n\n /**\n * Loads the `MJ: AI Agent Sessions` rows referenced by the conversation's\n * session-stamped details (one batched lookup, narrow fields, only when stamped rows\n * exist) and rebuilds {@link realtimeSessionMetaMap} so the timeline's session cards\n * can show the agent name and a status / close-reason chip. TOLERANT by design: any\n * failure leaves the map empty — cards degrade to their generic label.\n */\n private async loadRealtimeSessionMeta(details: MJConversationDetailEntity[], conversationId?: string, loadToken?: number): Promise<void> {\n const metaMap = await this.fetchRealtimeSessionMeta(details, conversationId, loadToken);\n if (metaMap === null) {\n return; // stale load — the conversation changed underneath\n }\n // New reference so the message list's ngOnChanges sees the update\n this.RealtimeSessionMetaMap = metaMap;\n }\n\n /**\n * Reads the session rows for `details` and returns them, WITHOUT deciding what happens to\n * the component's map.\n *\n * Split from {@link loadRealtimeSessionMeta} because the two callers want opposite\n * policies: a full (re)load replaces the map, while prepending an older page must merge —\n * replacing there would strip the status chips off every session card already on screen.\n *\n * @returns The fetched meta, or null when the conversation changed mid-read.\n */\n private async fetchRealtimeSessionMeta(\n details: MJConversationDetailEntity[],\n conversationId?: string,\n loadToken?: number\n ): Promise<Map<string, RealtimeSessionTimelineMeta> | null> {\n // Collecting the ids and mapping the rows both live in the runtime, so the React Native thread\n // keys its map the same way (NormalizeUUID) and parses ClosedAt the same way. The query itself\n // stays here — it is the one part that is genuinely host-specific.\n const sessionIds = CollectRealtimeSessionIDs(details);\n\n let metaMap = new Map<string, RealtimeSessionTimelineMeta>();\n if (sessionIds.length > 0) {\n try {\n const idList = sessionIds.map(id => `'${id.replace(/'/g, \"''\")}'`).join(',');\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<RealtimeSessionMetaRow>({\n EntityName: 'MJ: AI Agent Sessions',\n ExtraFilter: `ID IN (${idList})`,\n Fields: [...REALTIME_SESSION_META_FIELDS],\n ResultType: 'simple'\n });\n if (result.Success) {\n metaMap = MapRealtimeSessionMeta(result.Results);\n }\n } catch (error) {\n console.warn('Failed to load realtime session meta — session cards render without status chips:', error);\n }\n }\n if (conversationId && !this.isCurrentConversationContext(conversationId, loadToken)) {\n return null;\n }\n return metaMap;\n }\n\n /**\n * REMOVED: Active tasks should only track currently-running tasks in this browser session.\n * Database tasks with 'In-Progress' status are shown in the Tasks dropdown via loadDatabaseTasks().\n * Restoring them here causes duplicate \"Agent Processing...\" entries.\n */\n private async restoreActiveTasks(conversationId: string): Promise<void> {\n // Intentionally empty - ActiveTasksService only tracks in-memory running tasks\n // Database tasks are loaded separately by TasksDropdownComponent\n }\n\n async OnMessageSent(message: MJConversationDetailEntity): Promise<void> {\n // The draft became a message — remove it from the persisted map + snapshot.\n const sentKey = (message.ConversationID ?? this.ConversationId ?? '').trim().toLowerCase();\n this.draftStore.ClearDraft(message.ConversationID ?? this.ConversationId);\n if (sentKey) {\n this.initialDraftSnapshots.delete(sentKey);\n }\n if (this.PendingMessage && this.isPendingMessageTarget(message.ConversationID)) {\n this._pendingMessageReservedTargetId = null;\n this.PendingMessageConsumed.emit();\n }\n\n // Guard: ignore events from hidden message-input instances belonging to other conversations.\n // Multiple inputs are kept alive in the DOM cache (one per visited conversation) and all\n // emit events to this single parent. Without this check, a background agent's response\n // for conversation A would pollute conversation B's message list.\n if (!UUIDsEqual(message.ConversationID, this.ConversationId)) {\n // Invalidate that conversation's cache so fresh data loads when the user switches back\n if (message.ConversationID) {\n this.resetComponentState(message.ConversationID);\n }\n return;\n }\n\n // Mirror the row into the loaded window so its NewestSequence tracks live appends.\n // Local path only — the entity is already in hand, so this issues no query.\n this.windowStore.ApplyLocalDetail(message);\n\n // Check if message already exists in the array (by ID) to prevent duplicates\n // Messages can be emitted multiple times as they're updated (e.g., status changes)\n const existingIndex = this.messages.findIndex(m => UUIDsEqual(m.ID, message.ID));\n\n if (existingIndex >= 0) {\n // Update existing message in place (replace with updated version)\n this.messages = [\n ...this.messages.slice(0, existingIndex),\n message,\n ...this.messages.slice(existingIndex + 1)\n ];\n } else {\n // Add new message to the list\n this.messages = [...this.messages, message];\n\n // Ensure current user is in the avatar map for new messages\n this.ensureCurrentUserInAvatarMap();\n\n // Invalidate cache when new message is added.\n // Without this, navigating away and back would load stale cached data\n // that doesn't include this new message.\n if (this.ConversationId) {\n this.resetComponentState(this.ConversationId);\n }\n\n // Load attachments for the new message (if any were saved with it)\n // This ensures attachments are displayed immediately after sending\n await this.loadAttachmentsForMessage(message.ID, message.ConversationID);\n if (!this.isActiveConversation(message.ConversationID)) {\n return;\n }\n\n // CRITICAL: If this is a new In-Progress AI message, add it to inProgressMessageIds\n // immediately so message-input registers a PubSub streaming callback for it.\n // buildMessagesFromCache handles the nav-away/nav-back reconnection case;\n // this handles the active-session case where the agent just started.\n // Without this, inProgressMessageIds stays [] and the completion event is never received.\n if (message.Status === 'In-Progress' && message.ID && !this.InProgressMessageIds.includes(message.ID)) {\n this.InProgressMessageIds = [...this.InProgressMessageIds, message.ID];\n }\n }\n\n // Where the viewport goes: a fresh send follows — an in-place update of a message that\n // is already on screen must not re-run the send path's scroll.\n this.followTranscript(existingIndex >= 0 ? 'update' : 'new', message);\n\n // Force change detection — zone.js 0.15 no longer patches graphql-ws WebSocket callbacks,\n // so progress updates that arrive via PubSub run outside Angular's zone. Without this,\n // the UI does not update when the messages array is modified from a streaming callback.\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMessageSent}. */\n async onMessageSent(message: MJConversationDetailEntity): Promise<void> {\n return this.OnMessageSent(message);\n }\n\n OnInitialMessageAutoSendStarted(event: {conversationId: string}): void {\n if (this.PendingMessage && this.isPendingMessageTarget(event.conversationId)) {\n this._pendingMessageReservedTargetId = event.conversationId;\n }\n }\n\n /** @deprecated Use {@link OnInitialMessageAutoSendStarted}. */\n onInitialMessageAutoSendStarted(event: {conversationId: string}): void {\n return this.OnInitialMessageAutoSendStarted(event);\n }\n\n OnInitialMessageAutoSendFailed(event: {conversationId: string}): void {\n if (UUIDsEqual(event.conversationId, this._pendingMessageReservedTargetId)) {\n this._pendingMessageReservedTargetId = null;\n }\n }\n\n /** @deprecated Use {@link OnInitialMessageAutoSendFailed}. */\n onInitialMessageAutoSendFailed(event: {conversationId: string}): void {\n return this.OnInitialMessageAutoSendFailed(event);\n }\n\n private isPendingMessageTarget(conversationId: string | null | undefined): boolean {\n return UUIDsEqual(conversationId, this.EffectivePendingMessageTarget);\n }\n\n /**\n * Loads attachments for a single message and adds them to the attachmentsByDetailId map.\n * Called after a new message is sent to ensure attachments are displayed immediately.\n */\n private async loadAttachmentsForMessage(messageId: string, conversationId: string | null | undefined): Promise<void> {\n try {\n const attachments = await this.attachmentService.loadAttachmentsForMessage(messageId, this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n if (attachments.length > 0) {\n this.AttachmentsByDetailId.set(messageId, attachments);\n // Create new map reference to trigger Angular change detection\n this.AttachmentsByDetailId = new Map(this.AttachmentsByDetailId);\n LogStatusEx({message: `Loaded ${attachments.length} attachment(s) for message ${messageId}`, verboseOnly: true});\n }\n } catch (error) {\n console.warn('Failed to load attachments for message:', error);\n }\n }\n\n /**\n * Ensures the current user is in the avatar map\n * Called when new messages are created to ensure avatar data is available\n */\n private async ensureCurrentUserInAvatarMap(): Promise<void> {\n const userId = this.CurrentUser.ID;\n\n // If user already in map, skip\n if (this.UserAvatarMap.has(userId)) {\n return;\n }\n\n // Load the current user's avatar data\n const md = this.ProviderToUse;\n const userEntity = await md.GetEntityObject<any>('MJ: Users');\n await userEntity.Load(userId);\n\n this.UserAvatarMap.set(userId, {\n imageUrl: userEntity.UserImageURL || null,\n iconClass: userEntity.UserImageIconClass || null\n });\n\n LogStatusEx({message: `👤 Added current user to avatar map`, verboseOnly: true});\n }\n\n /**\n * Handle agent run detected event from progress updates\n * This is called when the first progress update arrives with an agent run ID\n */\n async OnAgentRunDetected(event: {conversationId: string; conversationDetailId: string; agentRunId: string}): Promise<void> {\n // Guard: ignore events from a background conversation's (hidden, still-streaming) input\n // after a conversation swap. Without this, a background run would be written into the\n // active conversation's agent-run map and engine cache. See onMessageSent() for context.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n await this.addAgentRunToMap(event.conversationId, event.conversationDetailId, event.agentRunId);\n }\n\n /** @deprecated Use {@link OnAgentRunDetected}. */\n async onAgentRunDetected(event: {conversationId: string; conversationDetailId: string; agentRunId: string}): Promise<void> {\n return this.OnAgentRunDetected(event);\n }\n\n /**\n * Handle message completion event from message-input\n * Refreshes the agent run data in-place to get final status and timestamps\n * Also reloads attachments created during agent execution (e.g., generated images)\n */\n async OnMessageComplete(event: {conversationId: string; conversationDetailId: string; agentId?: string}): Promise<void> {\n // Guard: ignore completion of a background conversation's run after a conversation swap.\n // Without this, a background run is refreshed into the active conversation's engine cache\n // (keyed by this.conversationId) and its attachments loaded into the active map.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n\n // Get existing agent run from map\n const existingAgentRun = this.AgentRunsByDetailId.get(event.conversationDetailId);\n\n if (existingAgentRun?.ID) {\n // Refresh the SAME object by calling Load() - preserves all references\n // duck type check to see if we have a BaseEntity or not\n if (!!existingAgentRun.Load) {\n await existingAgentRun.Load(existingAgentRun.ID);\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n }\n else {\n // we do NOT have an existingAgentRun base entity, but rather a simple JSON object so we need to create an object here\n const md = this.ProviderToUse;\n const newEntity = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs');\n newEntity.LoadFromData(existingAgentRun);\n // swap the map entry to have this object now\n this.AgentRunsByDetailId.set(event.conversationDetailId, newEntity);\n\n // Also update ConversationEngine's cache\n if (event.conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(event.conversationId, event.conversationDetailId, newEntity);\n }\n }\n\n // Trigger re-render to show updated status\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n\n // Reload attachments for this message to pick up newly created media attachments\n // (e.g., images generated by agent via Generate Image action)\n // This must be done after agent completion because attachments are created by AgentRunner\n // after the agent execution finishes\n await this.loadAttachmentsForMessage(event.conversationDetailId, event.conversationId);\n\n // Trigger change detection after async attachment loading to ensure UI updates\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMessageComplete}. */\n async onMessageComplete(event: {conversationId: string; conversationDetailId: string; agentId?: string}): Promise<void> {\n return this.OnMessageComplete(event);\n }\n\n /**\n * Handle agent run update event from progress updates\n * This is called on EVERY progress update with the full, live agent run object\n * Provides real-time updates of status, timestamps, tokens, cost during execution\n */\n async OnAgentRunUpdate(event: {conversationId: string; conversationDetailId: string; agentRun?: MJAIAgentRunEntityExtended, agentRunId?: string}): Promise<void> {\n // Guard: ignore live progress updates from a background conversation's run after a swap.\n // Without this, a background run is written into the active conversation's agent-run map\n // and into ConversationEngine's cache keyed by this.conversationId. See onMessageSent().\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n if (event.agentRun) {\n // Directly update map with fresh data from progress (no database query needed)\n // Don't create new Map - message-list component needs to keep the same reference\n this.AgentRunsByDetailId.set(event.conversationDetailId, event.agentRun);\n\n // Also update ConversationEngine's cache for other consumers\n if (event.conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(event.conversationId, event.conversationDetailId, event.agentRun);\n }\n }\n else {\n // no agent run, should have agentRunId\n await this.addAgentRunToMap(event.conversationId, event.conversationDetailId, event.agentRunId!);\n }\n\n // Force message list to re-render with updated agent run\n // This ensures message components receive the fresh agent run data\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnAgentRunUpdate}. */\n async onAgentRunUpdate(event: {conversationId: string; conversationDetailId: string; agentRun?: MJAIAgentRunEntityExtended, agentRunId?: string}): Promise<void> {\n return this.OnAgentRunUpdate(event);\n }\n\n /**\n * Public entry point to reload messages in the active conversation.\n * Called by the parent resource wrapper when the user clicks the Refresh button,\n * so that new agent responses are visible without a full page reload.\n */\n public async ReloadMessages(): Promise<void> {\n await this.reloadMessagesForActiveConversation();\n }\n\n /** @deprecated Use {@link ReloadMessages}. */\n public async reloadMessages(): Promise<void> {\n return this.ReloadMessages();\n }\n\n /**\n * Reload messages from the ConversationEngine cache (no DB round-trip).\n * The engine cache is kept warm by entity event handlers that auto-sync on save/delete.\n * Called when agent completion is detected to discover newly delegated agent messages.\n */\n private async reloadMessagesForActiveConversation(): Promise<void> {\n const conversationId = this.ConversationId;\n if (!conversationId) {\n return;\n }\n\n try {\n // Refresh the newest window page rather than reading the engine's full-history cache,\n // which the windowed path never populates — reading it here returned undefined and\n // silently skipped everything below, so delegated-agent messages never appeared.\n await this.windowStore.RefreshLatest(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n const engineDetails = this.windowStore.GetSnapshot().Details;\n if (engineDetails.length === 0) {\n return;\n }\n\n // Track existing message IDs before reload to identify new messages\n const existingMessageIds = new Set(this.messages.map(m => m.ID));\n\n // Merge the refreshed window with existing client-side messages.\n // Preserves messages added client-side (e.g., by handleSubAgentInvocation)\n // that haven't been picked up by entity events yet due to timing.\n const merged = new Map<string, MJConversationDetailEntity>();\n\n for (const msg of engineDetails) {\n merged.set(msg.ID, msg);\n }\n\n // Preserve client-side messages not yet in the window\n for (const msg of this.messages) {\n if (!merged.has(msg.ID)) {\n merged.set(msg.ID, msg);\n }\n }\n\n this.messages = Array.from(merged.values())\n .sort((a, b) => (a.__mj_CreatedAt?.getTime() || 0) - (b.__mj_CreatedAt?.getTime() || 0));\n\n // Find newly discovered messages (delegated agents)\n const newMessages = engineDetails.filter(m => !existingMessageIds.has(m.ID));\n\n // Check engine cache for agent runs on new messages\n for (const message of newMessages) {\n if (message.AgentID && message.ID) {\n const agentRun = this.engine.GetAgentRunForDetail(conversationId, message.ID);\n if (agentRun) {\n this.AgentRunsByDetailId.set(message.ID, agentRun as MJAIAgentRunEntityExtended);\n LogStatusEx({message: `✅ Found cached agent run for new delegated message ${message.ID}`, verboseOnly: true});\n }\n }\n }\n\n LogStatusEx({message: `✅ Refreshed ${engineDetails.length} messages from engine cache (${newMessages.length} new)`, verboseOnly: true});\n } catch (error) {\n console.error('Failed to reload messages for active conversation:', error);\n }\n }\n\n /**\n * Handle message completion triggered by PubSub completion event\n * Reloads message, agent run, and artifacts, then updates UI\n * @param message The message that completed\n * @param agentRunId The ID of the agent run that completed\n */\n private async handleMessageCompletion(\n message: MJConversationDetailEntity,\n _agentRunId: string,\n expectedConversationId: string | null | undefined = message.ConversationID,\n loadToken?: number\n ): Promise<void> {\n try {\n const isCurrent = () => this.isCurrentConversationContext(expectedConversationId, loadToken);\n\n LogStatusEx({message: `🎉 Handling completion for message ${message.ID}`, verboseOnly: true});\n\n // Snapshot the artifact population before the reloads below so we can tell a NEW artifact\n // from a new VERSION of one already on screen (#529).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload message from database to get final content and status\n await message.Load(message.ID);\n if (!isCurrent()) {\n return;\n }\n\n // Reload agent run to get final status, timestamps, and cost\n const agentRun = this.AgentRunsByDetailId.get(message.ID);\n if (agentRun?.ID) {\n await agentRun.Load(agentRun.ID);\n if (!isCurrent()) {\n return;\n }\n }\n\n // Reload artifacts for this completed message\n await this.reloadArtifactsForMessage(message.ID, expectedConversationId, loadToken);\n if (!isCurrent()) {\n return;\n }\n\n // Reload messages to pick up newly delegated agent messages\n // When Sage delegates to Marketing Agent, a new message is created\n await this.reloadMessagesForActiveConversation();\n if (!isCurrent()) {\n return;\n }\n\n // Invalidate cache since reloadMessages may have loaded new delegated-agent messages\n // that are not in the cache set by reloadArtifactsForMessage().\n // Without this, navigating away and back would show stale data.\n if (message.ConversationID) {\n this.resetComponentState(message.ConversationID);\n }\n\n // Update inProgressMessageIds to include new delegated agents\n // This triggers callback registration via the setter in message-input\n this.InProgressMessageIds = [...this.messages\n .filter(m => m.Status === 'In-Progress')\n .map(m => m.ID)];\n\n // Open/refresh the artifact panel from the version diff (not just the triggering message).\n // When Sage delegates to a sub-agent (e.g., Skip), the artifact is on the sub-agent's\n // message, not Sage's. Checking only the triggering message would miss delegated artifacts.\n // #529: a delegated build discovered here must surface even with the panel already open on\n // another artifact, so this is NOT gated on `!this.showArtifactPanel`.\n await this.decideAndApplyArtifactPanel(artifactBaseline, expectedConversationId);\n\n // Remove task from ActiveTasksService (clears spinner in conversation list)\n const task = this.activeTasks.getByConversationDetailId(message.ID);\n if (task) {\n this.activeTasks.remove(task.id);\n }\n\n // The completed message was mutated in place — refresh the window's copy too.\n this.windowStore.ApplyLocalDetail(message);\n\n // Force re-render with updated agent run and artifacts\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n LogStatusEx({message: `✅ Completion handled for message ${message.ID}`, verboseOnly: true});\n } catch (error) {\n console.error(`Error handling message completion for ${message.ID}:`, error);\n this.cdr.detectChanges();\n }\n }\n\n async OnAgentResponse(event: {message: MJConversationDetailEntity, agentResult: any}): Promise<void> {\n // Guard: ignore agent responses from background inputs for other conversations.\n // See onMessageSent() for the full explanation.\n if (!UUIDsEqual(event.message.ConversationID, this.ConversationId)) {\n if (event.message.ConversationID) {\n this.resetComponentState(event.message.ConversationID);\n }\n return;\n }\n\n // Add the agent's response message to the conversation\n this.windowStore.ApplyLocalDetail(event.message);\n this.messages = [...this.messages, event.message];\n\n // Invalidate cache for this conversation since we have new messages\n if (this.ConversationId) {\n this.resetComponentState(this.ConversationId);\n }\n\n // Where the viewport goes when the agent responds\n this.followTranscript('new', event.message);\n\n // CRITICAL FIX: Always refresh the agent run data when agent completes\n // This ensures we get the final status and timestamps, replacing any stale data from when agent started\n // agentResult is ExecuteAgentResult which contains agentRun property\n if (event.agentResult?.agentRun?.ID) {\n await this.addAgentRunToMap(event.message.ConversationID, event.message.ID, event.agentResult.agentRun.ID, true); // forceRefresh = true\n if (!this.isActiveConversation(event.message.ConversationID)) {\n return;\n }\n }\n\n // Snapshot the artifact population before reload so we can tell a NEW artifact from a new\n // VERSION of one already on screen (#529).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload artifact mapping for this message to pick up newly created artifacts\n await this.reloadArtifactsForMessage(event.message.ID, event.message.ConversationID);\n if (!this.isActiveConversation(event.message.ConversationID)) {\n return;\n }\n\n // #529: open a newly created artifact even with the panel already open on another one, refresh\n // the shown artifact when it gained a version, and switch to a retargeted one.\n await this.decideAndApplyArtifactPanel(artifactBaseline, event.message.ConversationID);\n\n // Force change detection to update the UI\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnAgentResponse}. */\n async onAgentResponse(event: {message: MJConversationDetailEntity, agentResult: any}): Promise<void> {\n return this.OnAgentResponse(event);\n }\n\n /**\n * Reset component-level UI state so peripheral data reprocesses on next load.\n * Does NOT invalidate ConversationEngine cache — the engine is the single source of truth\n * and is kept warm via AddDetailToCache/UpdateDetailInCache.\n */\n private resetComponentState(conversationId: string): void {\n // Reset so loadPeripheralData re-runs on next conversation load\n if (this.lastLoadedConversationId === conversationId) {\n this.lastLoadedConversationId = null;\n }\n }\n\n /**\n * Add or update an agent run in the map\n * Called when a new agent run completes to keep the map in sync\n * @param forceRefresh If true, always reload from database even if already in map (used when status changes)\n */\n private async addAgentRunToMap(conversationId: string | null | undefined, conversationDetailId: string, agentRunId: string, forceRefresh: boolean = false): Promise<MJAIAgentRunEntityExtended> {\n try {\n // Always refresh if forced, or if not in map yet\n if (forceRefresh || !this.AgentRunsByDetailId.has(conversationDetailId)) {\n const md = this.ProviderToUse;\n const agentRun = await md.GetEntityObject<MJAIAgentRunEntityExtended>('MJ: AI Agent Runs', this.CurrentUser);\n if (await agentRun.Load(agentRunId)) {\n if (!this.isActiveConversation(conversationId)) {\n return agentRun;\n }\n this.AgentRunsByDetailId.set(conversationDetailId, agentRun);\n\n // Also update ConversationEngine's cache for other consumers\n if (conversationId) {\n ConversationEngine.Instance.SetAgentRunForDetail(conversationId, conversationDetailId, agentRun);\n }\n\n // Force message list to re-render with updated agent run\n // Keep same Map reference so message-list component can access updates\n this.messages = [...this.messages];\n this.cdr.detectChanges();\n\n }\n return agentRun;\n } \n else {\n return this.AgentRunsByDetailId.get(conversationDetailId)!;\n }\n } catch (error) {\n console.error('Failed to load agent run for map:', error);\n throw error;\n }\n }\n\n /**\n * Reload artifacts for a conversation, triggered by a specific message ID.\n * Processes ALL messages in the conversation (not just the trigger message)\n * so that artifacts from delegated sub-agent messages are also picked up.\n * Called after an artifact is created to update the UI immediately.\n * Invalidates and refreshes the conversation cache.\n */\n private async reloadArtifactsForMessage(conversationDetailId: string, expectedConversationId?: string | null, loadToken?: number): Promise<void> {\n LogStatusEx({message: `🔄 Reloading artifacts for message ${conversationDetailId}`, verboseOnly: true});\n try {\n const md = this.ProviderToUse;\n\n // Get the ConversationID for this detail\n const detail = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.CurrentUser);\n if (!(await detail.Load(conversationDetailId))) {\n console.error('Failed to load conversation detail');\n return;\n }\n const detailConversationId = detail.ConversationID;\n const targetConversationId = expectedConversationId ?? detailConversationId;\n const isCurrent = () => this.isCurrentConversationContext(targetConversationId, loadToken);\n if (!UUIDsEqual(detailConversationId, targetConversationId) || !isCurrent()) {\n return;\n }\n\n // Refresh the newest window page — picks up artifacts written by the just-finished run\n // without re-querying the whole conversation.\n await this.windowStore.RefreshLatest(this.CurrentUser);\n if (!isCurrent()) {\n return;\n }\n\n // Reprocess peripheral data from the refreshed window\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(detailConversationId, this.windowStore.GetSnapshot(), loadToken);\n } catch (error) {\n console.error('Failed to reload artifacts for message:', error);\n }\n }\n\n OpenProjectSelector(): void {\n this.ShowProjectSelector = true;\n }\n\n /** @deprecated Use {@link OpenProjectSelector}. */\n openProjectSelector(): void {\n return this.OpenProjectSelector();\n }\n\n ToggleMembersModal(): void {\n this.ShowMembersModal = !this.ShowMembersModal;\n }\n\n /** @deprecated Use {@link ToggleMembersModal}. */\n toggleMembersModal(): void {\n return this.ToggleMembersModal();\n }\n\n ViewArtifacts(): void {\n this.ShowArtifactsModal = true;\n }\n\n /** @deprecated Use {@link ViewArtifacts}. */\n viewArtifacts(): void {\n return this.ViewArtifacts();\n }\n\n /**\n * Recompute the cached artifactCountDisplay from the effective artifacts map.\n * Must be called whenever artifactsByDetailId, systemArtifactsByDetailId,\n * or showSystemArtifacts changes, instead of using a getter that can produce\n * different values between Angular change-detection passes (NG0100).\n */\n private updateArtifactCountDisplay(): void {\n const uniqueArtifactIds = new Set<string>();\n for (const artifactList of this.EffectiveArtifactsMap.values()) {\n for (const info of artifactList) {\n uniqueArtifactIds.add(info.artifactId);\n }\n }\n this.ArtifactCountDisplay = uniqueArtifactIds.size;\n }\n\n /**\n * Calculate count of unique artifacts (not versions) - user-visible only\n * Used for initial artifact count (doesn't change with toggle)\n */\n private calculateUniqueArtifactCount(): number {\n const uniqueArtifactIds = new Set<string>();\n for (const artifactList of this.ArtifactsByDetailId.values()) {\n for (const info of artifactList) {\n uniqueArtifactIds.add(info.artifactId);\n }\n }\n return uniqueArtifactIds.size;\n }\n\n /**\n * Every (artifactId, versionNumber) pair currently known across all messages, with the version's\n * creation time so candidates can be ordered by recency rather than by whichever conversation\n * detail the map happened to iterate last.\n */\n private allArtifactRefs(): ArtifactVersionRef[] {\n const refs: ArtifactVersionRef[] = [];\n for (const artifactList of this.ArtifactsByDetailId.values()) {\n for (const info of artifactList) {\n refs.push({\n artifactId: info.artifactId,\n versionNumber: info.versionNumber,\n versionCreatedAt: info.versionCreatedAt,\n });\n }\n }\n return refs;\n }\n\n /**\n * Captures everything {@link decideAndApplyArtifactPanel} needs to judge, at the START of a turn,\n * whether the artifact population changed BECAUSE of that turn.\n *\n * The version map alone is not enough. `artifactsByDetailId` is rebuilt for reasons unrelated to\n * any run — `resetConversationScopedViewState` does not clear it on a conversation switch, so it\n * still holds the previous conversation's artifacts until `loadPeripheralData` lands, and the\n * missed-completion path in `loadMessages` runs BEFORE that rebuild. A snapshot taken there\n * describes a different conversation entirely, and every artifact of the conversation being\n * opened would read as newly created. So the baseline also records which conversation the map\n * was holding, the paging generation, and the user's selection epoch.\n */\n private snapshotArtifactPanelBaseline(): ArtifactPanelBaseline {\n return {\n Versions: SnapshotArtifactVersions(this.allArtifactRefs()),\n conversationId: this.ConversationId,\n MapConversationId: this.lastLoadedConversationId,\n MapGeneration: this.artifactMapGeneration,\n SelectionEpoch: this.artifactSelectionEpoch,\n };\n }\n\n /**\n * Diffs the current artifact population against a baseline and carries out the resulting panel\n * action. The single entry point for all three completion paths, which previously each carried\n * their own copy of the snapshot/decide/apply sequence.\n *\n * @param baseline - From {@link snapshotArtifactPanelBaseline}, taken before the turn's reloads.\n * @param conversationId - The conversation this turn belongs to.\n */\n private async decideAndApplyArtifactPanel(\n baseline: ArtifactPanelBaseline,\n conversationId: string | null | undefined\n ): Promise<void> {\n // The baseline is comparable only if the map was holding THIS conversation's artifacts when it\n // was taken, and nothing merged an older page in since.\n const baselineComparable =\n baseline.MapConversationId != null &&\n UUIDsEqual(baseline.MapConversationId, baseline.conversationId) &&\n this.artifactMapGeneration === baseline.MapGeneration;\n\n const action = DecideArtifactPanelAction({\n panelOpen: this.ShowArtifactPanel,\n selectedArtifactId: this.SelectedArtifactId,\n before: baseline.Versions,\n after: this.allArtifactRefs(),\n baselineComparable,\n userChangedSelection: this.artifactSelectionEpoch !== baseline.SelectionEpoch,\n });\n\n if (!baselineComparable && action.kind === 'none') {\n LogStatusEx({\n message: `🎨 Skipping artifact panel decision: the before/after snapshots describe different artifact populations (map held ${baseline.MapConversationId ?? 'nothing'}, conversation was ${baseline.conversationId})`,\n verboseOnly: true\n });\n }\n await this.applyArtifactPanelAction(action, conversationId);\n }\n\n /**\n * Carry out the decision from {@link decideArtifactPanelAction}: open the panel on an artifact\n * version, refresh the already-open viewer, or do nothing.\n */\n private async applyArtifactPanelAction(action: ArtifactPanelAction, conversationId: string | null | undefined): Promise<void> {\n switch (action.kind) {\n case 'open':\n this.SelectedArtifactId = action.artifactId;\n this.SelectedVersionNumber = action.versionNumber;\n this.ShowArtifactPanel = true;\n await this.loadArtifactPermissions(action.artifactId, conversationId, action.artifactId);\n // The permission load is async: the user may have switched conversations or picked a\n // different artifact while it was in flight, so only narrate what is still on screen.\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, action.artifactId)) {\n return;\n }\n LogStatusEx({\n message: `🎨 Opening artifact ${action.artifactId} v${action.versionNumber} after agent run (decided from the conversation-wide version diff, so no single detail id applies)`,\n verboseOnly: true\n });\n return;\n case 'refresh':\n // ONE channel, deliberately. Writing `selectedVersionNumber` as well would change the\n // viewer's `[versionNumber]` input in the same change-detection pass, and its `ngOnChanges`\n // would load the version a second time on top of the load this emission already starts —\n // and that second load runs without a cancellation token, so it can also land after a newer\n // one. The subject path is the one to keep: it reloads the version list too, which a\n // brand-new version needs, and it carries a load token.\n this.ArtifactViewerRefresh$.next({ artifactId: action.artifactId, versionNumber: action.versionNumber });\n return;\n case 'none':\n return;\n }\n }\n\n /**\n * Get the effective artifacts map based on showSystemArtifacts toggle\n * Combines user-visible and system artifacts when toggle is on\n * Uses caching to prevent infinite change detection loops\n */\n public get EffectiveArtifactsMap(): Map<string, LazyArtifactInfo[]> {\n if (!this.ShowSystemArtifacts) {\n // Only user-visible artifacts - no need to cache\n return this.ArtifactsByDetailId;\n }\n\n // Return cached combined map if available\n if (this._combinedArtifactsMap) {\n return this._combinedArtifactsMap;\n }\n\n // Combine both maps when showing system artifacts\n const combined = new Map<string, LazyArtifactInfo[]>();\n\n // Add all user-visible artifacts\n for (const [key, value] of this.ArtifactsByDetailId) {\n combined.set(key, [...value]);\n }\n\n // Add system artifacts\n for (const [key, value] of this.SystemArtifactsByDetailId) {\n if (combined.has(key)) {\n // Merge with existing artifacts for this detail\n combined.get(key)!.push(...value);\n } else {\n combined.set(key, [...value]);\n }\n }\n\n // Cache the result\n this._combinedArtifactsMap = combined;\n return combined;\n }\n\n /** @deprecated Use {@link EffectiveArtifactsMap}. */\n public get effectiveArtifactsMap(): Map<string, LazyArtifactInfo[]> {\n return this.EffectiveArtifactsMap;\n }\n\n /**\n * Toggles system artifacts visibility\n * Clears the cache so the map will be rebuilt on next access\n */\n public ToggleSystemArtifacts(): void {\n this.ShowSystemArtifacts = !this.ShowSystemArtifacts;\n this._combinedArtifactsMap = null; // Clear cache\n this.updateArtifactCountDisplay();\n this.cdr.detectChanges(); // Force update\n }\n\n /** @deprecated Use {@link ToggleSystemArtifacts}. */\n public toggleSystemArtifacts(): void {\n return this.ToggleSystemArtifacts();\n }\n\n /**\n * Check if there are any system artifacts in this conversation\n * Used to conditionally show/hide the \"Show System\" toggle button\n */\n public get HasSystemArtifacts(): boolean {\n return this.SystemArtifactsByDetailId.size > 0;\n }\n\n /** @deprecated Use {@link HasSystemArtifacts}. */\n public get hasSystemArtifacts(): boolean {\n return this.HasSystemArtifacts;\n }\n\n /**\n * Get unique artifacts grouped by artifact ID (not by conversation detail)\n * Returns the latest version info for each unique artifact with all versions\n * Works with LazyArtifactInfo - uses display data without loading full entities\n * Respects showSystemArtifacts toggle\n */\n GetArtifactsArray(): Array<{\n artifactId: string;\n versionId: string;\n name: string;\n versionCount: number;\n visibility: string;\n versions: Array<{versionId: string; versionNumber: number}>\n }> {\n const artifactMap = new Map<string, {\n artifactId: string;\n versionId: string;\n name: string;\n visibility: string;\n versions: Array<{versionId: string; versionNumber: number}>\n }>();\n\n // Group by artifactId, collecting all version details\n // Use effectiveArtifactsMap to respect showSystemArtifacts toggle\n for (const artifactList of this.EffectiveArtifactsMap.values()) {\n for (const info of artifactList) {\n const artifactId = info.artifactId;\n const versionId = info.artifactVersionId;\n const versionNumber = info.versionNumber || 1;\n const name = info.artifactName || 'Untitled';\n\n if (!artifactMap.has(artifactId)) {\n artifactMap.set(artifactId, {\n artifactId: artifactId,\n versionId: versionId, // Latest version ID\n name: name,\n visibility: info.visibility,\n versions: [{versionId: versionId, versionNumber: versionNumber}]\n });\n } else {\n // Add version if not already present\n const existing = artifactMap.get(artifactId)!;\n if (!existing.versions.some(v => v.versionId === versionId)) {\n existing.versions.push({versionId: versionId, versionNumber: versionNumber});\n // Update to latest version ID (assuming versions are added chronologically)\n existing.versionId = versionId;\n }\n }\n }\n }\n\n // Convert to array with version count, sorted by version number descending\n return Array.from(artifactMap.values()).map(item => ({\n artifactId: item.artifactId,\n versionId: item.versionId,\n name: item.name,\n visibility: item.visibility,\n versionCount: item.versions.length,\n versions: item.versions.sort((a, b) => b.versionNumber - a.versionNumber)\n }));\n }\n\n /** @deprecated Use {@link GetArtifactsArray}. */\n getArtifactsArray(): Array<{\n artifactId: string;\n versionId: string;\n name: string;\n versionCount: number;\n visibility: string;\n versions: Array<{versionId: string; versionNumber: number}>\n }> {\n return this.GetArtifactsArray();\n }\n\n ToggleArtifactExpansion(artifactId: string, event: Event): void {\n event.stopPropagation(); // Prevent opening artifact when clicking expand button\n this.ExpandedArtifactId = this.ExpandedArtifactId === artifactId ? null : artifactId;\n }\n\n /** @deprecated Use {@link ToggleArtifactExpansion}. */\n toggleArtifactExpansion(artifactId: string, event: Event): void {\n return this.ToggleArtifactExpansion(artifactId, event);\n }\n\n async OpenArtifactFromModal(artifactId: string, versionNumber?: number): Promise<void> {\n const conversationId = this.ConversationId;\n this.artifactSelectionEpoch++;\n this.SelectedArtifactId = artifactId;\n this.SelectedVersionNumber = versionNumber;\n this.ShowArtifactPanel = true;\n this.ShowArtifactsModal = false;\n\n // Load permissions for the selected artifact\n await this.loadArtifactPermissions(artifactId, conversationId, artifactId);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, artifactId)) {\n return;\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OpenArtifactFromModal}. */\n async openArtifactFromModal(artifactId: string, versionNumber?: number): Promise<void> {\n return this.OpenArtifactFromModal(artifactId, versionNumber);\n }\n\n ExportConversation(): void {\n if (this.Conversation) {\n this.ShowExportModal = true;\n }\n }\n\n /** @deprecated Use {@link ExportConversation}. */\n exportConversation(): void {\n return this.ExportConversation();\n }\n\n OnExportModalCancelled(): void {\n this.ShowExportModal = false;\n }\n\n /** @deprecated Use {@link OnExportModalCancelled}. */\n onExportModalCancelled(): void {\n return this.OnExportModalCancelled();\n }\n\n OnExportModalComplete(): void {\n this.ShowExportModal = false;\n }\n\n /** @deprecated Use {@link OnExportModalComplete}. */\n onExportModalComplete(): void {\n return this.OnExportModalComplete();\n }\n\n async OnProjectSelected(project: any): Promise<void> {\n if (this.Conversation && project) {\n try {\n await this.engine.SaveConversation(\n this.Conversation.ID,\n { ProjectID: project.ID },\n this.CurrentUser\n );\n this.ShowProjectSelector = false;\n } catch (error) {\n console.error('Failed to assign project:', error);\n }\n } else if (this.Conversation && !project) {\n // Remove project assignment\n try {\n await this.engine.SaveConversation(\n this.Conversation.ID,\n { ProjectID: null },\n this.CurrentUser\n );\n this.ShowProjectSelector = false;\n } catch (error) {\n console.error('Failed to remove project:', error);\n }\n }\n }\n\n /** @deprecated Use {@link OnProjectSelected}. */\n async onProjectSelected(project: any): Promise<void> {\n return this.OnProjectSelected(project);\n }\n\n ShareConversation(): void {\n if (!this.Conversation) return;\n this.ShareContext = {\n ResourceID: this.Conversation.ID,\n ResourceName: this.Conversation.Name ?? 'Conversation',\n OwnerUserID: this.Conversation.UserID ?? null,\n OwnerDisplayName: this.Conversation.User ?? 'You',\n CurrentUserID: this.CurrentUser?.ID ?? null\n };\n this.ShowShareModal = true;\n }\n\n /** @deprecated Use {@link ShareConversation}. */\n shareConversation(): void {\n return this.ShareConversation();\n }\n\n OnShareDialogResult(_result: { Action: 'save' | 'cancel' }): void {\n this.ShowShareModal = false;\n }\n\n /** @deprecated Use {@link OnShareDialogResult}. */\n onShareDialogResult(_result: { Action: 'save' | 'cancel' }): void {\n return this.OnShareDialogResult(_result);\n }\n\n /**\n * Display info for the header \"Shared by {email}\" badge. Returns `null`\n * when the current user owns the conversation or when the share has no\n * recorded grantor (legacy share pre-dating `SharedByUserID`).\n */\n public get SharedByBadge(): { display: string; fullTooltip: string } | null {\n if (!this.Conversation) return null;\n const info = this.engine.GetSharedByInfo(this.Conversation.ID);\n if (!info || !info.UserID) return null;\n const display = info.Email ?? info.Name ?? 'another user';\n const tooltip = info.Email && info.Name ? `${info.Name} <${info.Email}>` : display;\n return { display, fullTooltip: `Shared by ${tooltip}` };\n }\n\n /** @deprecated Use {@link SharedByBadge}. */\n public get sharedByBadge(): { display: string; fullTooltip: string } | null {\n return this.SharedByBadge;\n }\n\n /**\n * `true` when the current user only has `View` access to this conversation\n * (i.e., it was shared with them read-only). Gates the message input and\n * any other write-capable UI.\n */\n public get IsReadOnlyView(): boolean {\n if (!this.Conversation) return false;\n const info = this.engine.GetSharedByInfo(this.Conversation.ID);\n return info?.Level === 'View';\n }\n\n /** @deprecated Use {@link IsReadOnlyView}. */\n public get isReadOnlyView(): boolean {\n return this.IsReadOnlyView;\n }\n\n /**\n * `true` when the current user is allowed to create new shares on this\n * conversation: the owner, or a user with an Owner-level grant. Uses the same\n * rule as the sidebar's Share action.\n */\n public get CanShareConversation(): boolean {\n if (!this.Conversation || !this.CurrentUser) return false;\n return this.engine.CanShareConversation(this.Conversation, this.CurrentUser.ID);\n }\n\n /** @deprecated Use {@link CanShareConversation}. */\n public get canShareConversation(): boolean {\n return this.CanShareConversation;\n }\n\n OnReplyInThread(message: MJConversationDetailEntity): void {\n // Open thread panel for this message - emit to parent\n this.ThreadOpened.emit(message.ID);\n }\n\n /** @deprecated Use {@link OnReplyInThread}. */\n onReplyInThread(message: MJConversationDetailEntity): void {\n return this.OnReplyInThread(message);\n }\n\n OnViewThread(message: MJConversationDetailEntity): void {\n // Open thread panel for this message - emit to parent\n this.ThreadOpened.emit(message.ID);\n }\n\n /** @deprecated Use {@link OnViewThread}. */\n onViewThread(message: MJConversationDetailEntity): void {\n return this.OnViewThread(message);\n }\n\n OnLocalThreadClosed(): void {\n // Close the thread panel - emit to parent\n this.ThreadClosed.emit();\n }\n\n /** @deprecated Use {@link OnLocalThreadClosed}. */\n onLocalThreadClosed(): void {\n return this.OnLocalThreadClosed();\n }\n\n OnThreadReplyAdded(reply: MJConversationDetailEntity): void {\n // Optionally refresh the message list to update thread counts\n // For now, we'll just log it\n LogStatusEx({message: 'Thread reply added', verboseOnly: true, additionalArgs: [reply]});\n\n // Reload messages to get updated thread counts\n if (this.ConversationId) {\n const conversationId = this.ConversationId;\n const loadToken = ++this.conversationLoadToken;\n void this.loadMessages(conversationId, loadToken);\n }\n }\n\n /** @deprecated Use {@link OnThreadReplyAdded}. */\n onThreadReplyAdded(reply: MJConversationDetailEntity): void {\n return this.OnThreadReplyAdded(reply);\n }\n\n OnToggleAgentPanel(): void {\n this.ShowAgentPanel = !this.ShowAgentPanel;\n // The agent panel component handles its own visibility\n // This could be used to toggle a modal or different view\n }\n\n /** @deprecated Use {@link OnToggleAgentPanel}. */\n onToggleAgentPanel(): void {\n return this.OnToggleAgentPanel();\n }\n\n OnAgentSelected(agentRun: MJAIAgentRunEntity): void {\n // When an agent is clicked in the indicator, could show details\n LogStatusEx({message: 'Agent selected', verboseOnly: true, additionalArgs: [agentRun.ID]});\n // Could open a modal or navigate to agent details\n }\n\n /** @deprecated Use {@link OnAgentSelected}. */\n onAgentSelected(agentRun: MJAIAgentRunEntity): void {\n return this.OnAgentSelected(agentRun);\n }\n\n OnMessageEdited(message: MJConversationDetailEntity): void {\n // Message was edited and saved, trigger change detection\n LogStatusEx({message: 'Message edited', verboseOnly: true, additionalArgs: [message.ID]});\n // The entity was mutated in place, so the transcript already shows the new text. Replace\n // it in the window explicitly anyway: the store dedupes by ID on merge, and without this\n // a later RefreshLatest could fold a server copy over the edited one.\n this.windowStore.ApplyLocalDetail(message);\n }\n\n /** @deprecated Use {@link OnMessageEdited}. */\n onMessageEdited(message: MJConversationDetailEntity): void {\n return this.OnMessageEdited(message);\n }\n\n OnMessagePinToggled(message: MJConversationDetailEntity): void {\n // The entity object is already mutated by .Save(), and the window holds that same object\n // reference, so the transcript reflects the change with no cache write.\n //\n // The engine's RawData row-sync that used to live here is gone: the windowed path never\n // populates `_detailCache`, and a window carries no RawData (those JSON columns only\n // exist on the GetConversationComplete stored query).\n this.windowStore.ApplyLocalDetail(message);\n // The pins panel reads a separate set (it must show pins older than the window), so it\n // needs the toggle applied explicitly — but only once that set is REAL. Applying a pin\n // to a not-yet-hydrated (empty) set would leave one entry that looks like the whole set,\n // and opening the panel would show a single pin on a conversation with many.\n if (this.pinsHydrated) {\n this.windowStore.ApplyLocalPin(message);\n } else {\n this.windowStore.SetPinnedCount(this.PinnedMessageCount + (message.IsPinned ? 1 : -1));\n }\n\n // Auto-close the panel when the last pin is removed\n if (this.ShowPinsPanel && this.PinnedMessageCount === 0) {\n setTimeout(() => { this.ShowPinsPanel = false; this.cdr.detectChanges(); }, 600);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMessagePinToggled}. */\n onMessagePinToggled(message: MJConversationDetailEntity): void {\n return this.OnMessagePinToggled(message);\n }\n\n /**\n * Scrolls the message list to the target message and plays the beacon animation.\n * Called when the user clicks \"Jump to message\" in the pins panel.\n */\n async OnJumpToMessage(messageId: string): Promise<void> {\n // Delegated to the list rather than queried here. A `[data-message-id]` lookup only finds\n // MOUNTED messages, and a pin is by definition often far above the viewport — exactly the\n // region the list unmounts into spacers — so this button silently did nothing for any pin\n // that wasn't already on screen. The list resolves through the timeline key, which a\n // spacer shares with the item it stands in for.\n if (this.messageListComponent?.ScrollToMessage(messageId)) {\n this.beaconMessage(messageId);\n return;\n }\n\n // Not in the loaded window. Pins are fetched by their own query precisely so the panel can\n // list pins older than the transcript, so this is the EXPECTED case for an old pin, not an\n // error — page back until it is loaded, the same way a date jump does.\n const reached = await this.loadUntilMessageIsWindowed(messageId);\n if (!reached) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Could not reach that message — it is further back than this jump loads.', 'info', 3000\n );\n return;\n }\n\n // The paging loop deliberately skipped the per-page peripheral rebuild — pay it once,\n // here, before asking the list for element positions.\n await this.refreshAfterPaging(this.ConversationId!);\n if (this.messageListComponent?.ScrollToMessage(messageId)) {\n this.beaconMessage(messageId);\n }\n }\n\n /** @deprecated Use {@link OnJumpToMessage}. */\n async onJumpToMessage(messageId: string): Promise<void> {\n return this.OnJumpToMessage(messageId);\n }\n\n /**\n * Pages older history until `messageId` falls inside the loaded window.\n *\n * Deterministic rather than heuristic: a pin carries its own `Sequence`, so the stop\n * condition is simply \"the window now reaches at least that far back\" — no equivalent of\n * the date jump's `NeedsOlder` probing is needed. Bounded by the same page cap, for the same\n * reason: an unbounded walk back is the thing windowing exists to avoid.\n */\n private async loadUntilMessageIsWindowed(messageId: string): Promise<boolean> {\n const target = this.PinnedMessages.find(p => UUIDsEqual(p.ID, messageId));\n if (!target) {\n return false; // not a loaded pin — nothing tells us how far back to page\n }\n\n const conversationId = this.ConversationId;\n for (let page = 0; page < DATE_JUMP_MAX_PAGES; page++) {\n const snapshot = this.windowStore.GetSnapshot();\n const oldest = snapshot.Cursor.OldestSequence;\n if (oldest !== null && oldest <= target.Sequence) {\n return true; // the window now covers it\n }\n if (!snapshot.Cursor.HasMoreAbove) {\n return false; // ran out of conversation\n }\n\n // Store-level paging for the same reason as the date jump — the caller refreshes once.\n await this.windowStore.LoadOlder(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return false; // user switched away mid-jump\n }\n }\n return false; // hit the page cap\n }\n\n /** Flashes the beacon on a message once its scroll has settled. */\n private beaconMessage(messageId: string): void {\n // Re-queried rather than captured: the target may have been a spacer when the scroll\n // started and been remounted as a real bubble by the time it lands.\n setTimeout(() => {\n const el = this.scrollContainer?.nativeElement?.querySelector(`[data-message-id=\"${messageId}\"]`);\n if (!el) {\n return;\n }\n el.classList.add('pin-beacon');\n setTimeout(() => el.classList.remove('pin-beacon'), 1500);\n }, 350);\n }\n\n\n /**\n * Unpins a message from the pins panel — saves to DB and patches the cache.\n */\n async OnUnpinFromPanel(message: MJConversationDetailEntity): Promise<void> {\n const previous = message.IsPinned;\n message.IsPinned = false;\n this.cdr.detectChanges();\n try {\n await message.Save();\n this.OnMessagePinToggled(message);\n } catch (err) {\n console.error('Failed to unpin message from panel:', err);\n message.IsPinned = previous;\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link OnUnpinFromPanel}. */\n async onUnpinFromPanel(message: MJConversationDetailEntity): Promise<void> {\n return this.OnUnpinFromPanel(message);\n }\n\n /**\n * Handle suggested response selection from user\n * Sends the selected response as a new user message WITHOUT modifying the visible input\n */\n async OnSuggestedResponseSelected(event: {text: string; customInput?: string}): Promise<void> {\n const messageText = event.customInput || event.text;\n\n // Get the active message input for the current conversation\n // (we cache multiple instances, one per visited conversation)\n const activeInput = this.getActiveMessageInputComponent();\n\n // If we have an active conversation with message input available, use it\n if (activeInput && !this.IsNewConversation) {\n await activeInput.sendMessageWithText(messageText);\n } else if (!this.Conversation || this.IsNewConversation) {\n // If no conversation or in new unsaved state, route through empty state handler\n // This will create the conversation and send the message\n await this.OnEmptyStateMessageSent({ text: messageText, attachments: [] });\n } else {\n console.error('MessageInputComponent not available and not in a valid state to create conversation');\n }\n }\n\n /** @deprecated Use {@link OnSuggestedResponseSelected}. */\n async onSuggestedResponseSelected(event: {text: string; customInput?: string}): Promise<void> {\n return this.OnSuggestedResponseSelected(event);\n }\n\n async OnDeleteMessage(message: MJConversationDetailEntity): Promise<void> {\n if (!UUIDsEqual(this.Conversation?.UserID, this.CurrentUser?.ID)) return;\n\n // Find this message and all messages after it sorted by creation time\n const sortedMessages = [...this.messages].sort((a, b) =>\n new Date(a.__mj_CreatedAt!).getTime() - new Date(b.__mj_CreatedAt!).getTime()\n );\n const targetIndex = sortedMessages.findIndex(m => UUIDsEqual(m.ID, message.ID));\n if (targetIndex === -1) return;\n\n const toHide = sortedMessages.slice(targetIndex);\n const count = toHide.length;\n\n const confirmed = await this.confirmDialog.confirm({\n title: 'Delete Messages',\n message: count === 1\n ? 'Delete this message? This cannot be undone.'\n : `Delete this message and the ${count - 1} message${count - 1 === 1 ? '' : 's'} after it? This cannot be undone.`,\n okText: 'Delete',\n cancelText: 'Cancel'\n });\n if (!confirmed) return;\n\n // Load all entities in parallel, then delete in parallel.\n // entity.Delete() calls spDeleteConversationDetail which handles all FK children:\n // hard-deletes junction tables (Artifact/Attachment/Rating), nullifies FKs on AI* records.\n const md = this.ProviderToUse;\n const loadResults = await Promise.all(\n toHide.map(async msg => {\n const entity = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.CurrentUser);\n const loaded = await entity.Load(msg.ID);\n return loaded ? entity : null;\n })\n );\n const entities = loadResults.filter((e): e is MJConversationDetailEntity => e !== null);\n if (entities.length === 0) return;\n\n // Sequential deletes — parallel fires concurrent server-side transactions which race on\n // SQLServerDataProvider's singleton _transactionDepth counter and fail with SAVE TRANSACTION errors.\n for (const e of entities) {\n const ok = await e.Delete();\n if (!ok) {\n const last = e.ResultHistory[e.ResultHistory.length - 1];\n console.error(`Failed to delete ConversationDetail ${e.ID}: ${last?.Message ?? 'unknown error'}`, last?.Error ?? '');\n }\n }\n\n const hideIds = new Set(toHide.map(m => m.ID));\n // Drop them from the window too, or the next RefreshLatest merge reinstates them.\n for (const id of hideIds) {\n this.windowStore.RemoveDetail(id);\n }\n this.messages = this.messages.filter(m => !hideIds.has(m.ID));\n this.resetComponentState(this.ConversationId!);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteMessage}. */\n async onDeleteMessage(message: MJConversationDetailEntity): Promise<void> {\n return this.OnDeleteMessage(message);\n }\n\n OnRetryMessage(message: MJConversationDetailEntity): void {\n // TODO: Implement retry logic\n // This should find the parent user message and re-trigger the agent invocation\n LogStatusEx({message: 'Retry requested for message', verboseOnly: true, additionalArgs: [message.ID]});\n // For now, just log it - full implementation would require refactoring agent invocation\n }\n\n /** @deprecated Use {@link OnRetryMessage}. */\n onRetryMessage(message: MJConversationDetailEntity): void {\n return this.OnRetryMessage(message);\n }\n\n /**\n * Handle attachment click - opens the image viewer for images\n */\n OnAttachmentClicked(attachment: MessageAttachment): void {\n if (attachment.type === 'Image' && attachment.contentUrl) {\n this.SelectedImageUrl = attachment.contentUrl;\n this.SelectedImageAlt = attachment.fileName || 'Image attachment';\n this.SelectedImageFileName = attachment.fileName || 'image';\n this.ShowImageViewer = true;\n return;\n }\n\n // Artifact-backed attachments open in the artifact viewer panel.\n if (attachment.source === 'artifact' && attachment.artifactId) {\n this.OnArtifactClicked({\n artifactId: attachment.artifactId,\n versionId: attachment.artifactVersionId\n });\n return;\n }\n\n // Plain uploads: trigger a browser download if we have a usable content URL.\n if (attachment.contentUrl) {\n const a = document.createElement('a');\n a.href = attachment.contentUrl;\n a.download = attachment.fileName || 'download';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n }\n\n /** @deprecated Use {@link OnAttachmentClicked}. */\n onAttachmentClicked(attachment: MessageAttachment): void {\n return this.OnAttachmentClicked(attachment);\n }\n\n /**\n * Handle image viewer close\n */\n OnImageViewerClosed(): void {\n this.ShowImageViewer = false;\n this.SelectedImageUrl = '';\n this.SelectedImageAlt = '';\n this.SelectedImageFileName = '';\n }\n\n /** @deprecated Use {@link OnImageViewerClosed}. */\n onImageViewerClosed(): void {\n return this.OnImageViewerClosed();\n }\n\n /**\n * Handle upload state changes from message input component\n */\n OnUploadStateChanged(event: {isUploading: boolean; message: string}): void {\n this.IsUploadingAttachments = event.isUploading;\n this.UploadingMessage = event.message;\n }\n\n /** @deprecated Use {@link OnUploadStateChanged}. */\n onUploadStateChanged(event: {isUploading: boolean; message: string}): void {\n return this.OnUploadStateChanged(event);\n }\n\n async OnArtifactClicked(data: {artifactId: string; versionId?: string}): Promise<void> {\n const conversationId = this.ConversationId;\n this.artifactSelectionEpoch++;\n this.SelectedArtifactId = data.artifactId;\n\n // If versionId is provided, find the version number from display data (no lazy load needed)\n if (data.versionId) {\n for (const artifactList of this.ArtifactsByDetailId.values()) {\n for (const artifactInfo of artifactList) {\n if (artifactInfo.artifactVersionId === data.versionId) {\n this.SelectedVersionNumber = artifactInfo.versionNumber;\n LogStatusEx({message: `📦 Opening artifact viewer for v${this.SelectedVersionNumber}`, verboseOnly: true});\n break;\n }\n }\n }\n } else {\n // No specific version, let viewer default to latest\n this.SelectedVersionNumber = undefined;\n }\n\n this.ShowArtifactPanel = true;\n\n // Load permissions for the selected artifact\n await this.loadArtifactPermissions(data.artifactId, conversationId, data.artifactId);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, data.artifactId)) {\n return;\n }\n\n // Trigger detectChanges after all state is settled (showArtifactPanel, permissions)\n // to prevent ExpressionChangedAfterItHasBeenCheckedError from zone-triggered CD\n // seeing partial state between the await boundaries\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnArtifactClicked}. */\n async onArtifactClicked(data: {artifactId: string; versionId?: string}): Promise<void> {\n return this.OnArtifactClicked(data);\n }\n\n async OnArtifactCreated(data: {conversationId: string, conversationDetailId: string, artifactId: string; versionId: string; versionNumber: number; name: string}): Promise<void> {\n // Guard: ignore artifacts created by a background conversation's agent after a swap.\n // Without this, reloadArtifactsForMessage -> loadPeripheralData would CLEAR the active\n // conversation's artifact/agent-run/rating/attachment maps and rebuild them from the\n // background conversation's cache — wiping the displayed conversation's artifacts.\n // The background conversation's artifacts persist server-side and reload when the user\n // navigates back to it. See onMessageSent() for the broader pattern.\n if (!this.isActiveConversation(data.conversationId)) {\n return;\n }\n\n // Snapshot the artifact population across the conversation before reload so we can tell a NEW\n // artifact from a new VERSION of an existing one (the event itself carries placeholder ids).\n const artifactBaseline = this.snapshotArtifactPanelBaseline();\n\n // Reload artifacts to get full entities (processes ALL messages in the conversation)\n await this.reloadArtifactsForMessage(data.conversationDetailId, data.conversationId);\n if (!this.isActiveConversation(data.conversationId)) {\n return;\n }\n\n // #529: a new artifact opens even over an open panel (build); a bumped version of the shown\n // artifact refreshes; a bumped version of another artifact switches to it (retargeting).\n await this.decideAndApplyArtifactPanel(artifactBaseline, data.conversationId);\n\n // Force change detection to update the UI immediately\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnArtifactCreated}. */\n async onArtifactCreated(data: {conversationId: string, conversationDetailId: string, artifactId: string; versionId: string; versionNumber: number; name: string}): Promise<void> {\n return this.OnArtifactCreated(data);\n }\n\n OnCloseArtifactPanel(): void {\n this.artifactSelectionEpoch++;\n this.ShowArtifactPanel = false;\n this.SelectedArtifactId = null;\n // Clear permissions\n this.CanShareSelectedArtifact = false;\n this.CanEditSelectedArtifact = false;\n // Reset maximize state and width when closing so the next artifact opens at default size\n this.resetArtifactPaneSizing();\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnCloseArtifactPanel}. */\n onCloseArtifactPanel(): void {\n return this.OnCloseArtifactPanel();\n }\n\n ToggleMaximizeArtifactPane(): void {\n if (this.IsArtifactPaneMaximized) {\n // Restore to previous width\n this.ArtifactPaneWidth = this.artifactPaneWidthBeforeMaximize;\n this.IsArtifactPaneMaximized = false;\n } else {\n // Maximize - store current width and set to 100%\n this.artifactPaneWidthBeforeMaximize = this.ArtifactPaneWidth;\n this.ArtifactPaneWidth = 100;\n this.IsArtifactPaneMaximized = true;\n }\n }\n\n /** @deprecated Use {@link ToggleMaximizeArtifactPane}. */\n toggleMaximizeArtifactPane(): void {\n return this.ToggleMaximizeArtifactPane();\n }\n\n OnSaveToCollectionRequested(event: {artifactId: string; excludedCollectionIds: string[]}): void {\n this.CollectionPickerArtifactId = event.artifactId;\n this.CollectionPickerExcludedIds = event.excludedCollectionIds;\n // Snapshot version + name from the viewer so the picker's preview pane has real context\n const viewer = this.artifactViewerComponent;\n this.CollectionPickerVersionId = viewer?.artifactVersion?.ID ?? null;\n this.CollectionPickerArtifactName = viewer?.displayName ?? '';\n this.CollectionPickerVersionNumber = viewer?.selectedVersionNumber ?? null;\n this.ShowCollectionPicker = true;\n }\n\n /** @deprecated Use {@link OnSaveToCollectionRequested}. */\n onSaveToCollectionRequested(event: {artifactId: string; excludedCollectionIds: string[]}): void {\n return this.OnSaveToCollectionRequested(event);\n }\n\n async OnCollectionPickerCompleted(event: { successIds: string[]; failedIds: string[] }): Promise<void> {\n // Refresh the viewer's bookmark / \"already saved\" state if anything actually wrote\n if (event.successIds.length > 0 && this.artifactViewerComponent) {\n await this.artifactViewerComponent.ReloadCollectionAssociations();\n }\n this.closeCollectionPicker();\n\n if (event.failedIds.length === 0 && event.successIds.length > 0) {\n const n = event.successIds.length;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Saved to ${n} ${n === 1 ? 'collection' : 'collections'}`,\n 'success',\n 2500\n );\n }\n }\n\n /** @deprecated Use {@link OnCollectionPickerCompleted}. */\n async onCollectionPickerCompleted(event: { successIds: string[]; failedIds: string[] }): Promise<void> {\n return this.OnCollectionPickerCompleted(event);\n }\n\n OnCollectionPickerCancelled(): void {\n this.closeCollectionPicker();\n }\n\n /** @deprecated Use {@link OnCollectionPickerCancelled}. */\n onCollectionPickerCancelled(): void {\n return this.OnCollectionPickerCancelled();\n }\n\n private closeCollectionPicker(): void {\n this.ShowCollectionPicker = false;\n this.CollectionPickerArtifactId = null;\n this.CollectionPickerExcludedIds = [];\n this.CollectionPickerVersionId = null;\n this.CollectionPickerArtifactName = '';\n this.CollectionPickerVersionNumber = null;\n this.cdr.detectChanges();\n }\n\n /**\n * Helper method to check if a conversation detail has an artifact\n * Used by message components to determine whether to show artifact card\n */\n public ConversationDetailHasArtifact(conversationDetailId: string): boolean {\n return this.ArtifactsByDetailId.has(conversationDetailId);\n }\n\n /** @deprecated Use {@link ConversationDetailHasArtifact}. */\n public conversationDetailHasArtifact(conversationDetailId: string): boolean {\n return this.ConversationDetailHasArtifact(conversationDetailId);\n }\n\n /**\n * Get artifact info for a conversation detail\n * Returns the LAST (most recent) artifact if multiple exist\n * Returns LazyArtifactInfo - caller can trigger lazy load if full entities needed\n */\n public GetArtifactInfo(conversationDetailId: string): LazyArtifactInfo | undefined {\n const artifactList = this.ArtifactsByDetailId.get(conversationDetailId);\n return artifactList && artifactList.length > 0\n ? artifactList[artifactList.length - 1]\n : undefined;\n }\n\n /** @deprecated Use {@link GetArtifactInfo}. */\n public getArtifactInfo(conversationDetailId: string): LazyArtifactInfo | undefined {\n return this.GetArtifactInfo(conversationDetailId);\n }\n\n /**\n * Get ALL artifacts for a conversation detail\n * Use this when you need to display all artifacts (e.g., in a list)\n * Returns LazyArtifactInfo array - caller can trigger lazy load if full entities needed\n */\n public GetAllArtifactsForDetail(conversationDetailId: string): LazyArtifactInfo[] {\n return this.ArtifactsByDetailId.get(conversationDetailId) || [];\n }\n\n /** @deprecated Use {@link GetAllArtifactsForDetail}. */\n public getAllArtifactsForDetail(conversationDetailId: string): LazyArtifactInfo[] {\n return this.GetAllArtifactsForDetail(conversationDetailId);\n }\n\n /**\n * Resize handle methods for artifact pane\n */\n OnResizeStart(event: MouseEvent): void {\n this.isResizing = true;\n this.startX = event.clientX;\n this.startWidth = this.ArtifactPaneWidth;\n event.preventDefault();\n document.body.style.cursor = 'col-resize';\n document.body.style.userSelect = 'none';\n }\n\n /** @deprecated Use {@link OnResizeStart}. */\n onResizeStart(event: MouseEvent): void {\n return this.OnResizeStart(event);\n }\n\n private onResizeMove(event: MouseEvent): void {\n if (!this.isResizing) return;\n\n const containerWidth = (event.currentTarget as Window).innerWidth;\n const deltaX = this.startX - event.clientX; // Reversed: drag left = wider artifact pane\n const deltaPercent = (deltaX / containerWidth) * 100;\n let newWidth = this.startWidth + deltaPercent;\n\n // Constrain between 20% and 70%\n newWidth = Math.max(20, Math.min(70, newWidth));\n this.ArtifactPaneWidth = newWidth;\n }\n\n private onResizeEnd(event: MouseEvent): void {\n if (this.isResizing) {\n this.isResizing = false;\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n\n // Save to localStorage\n this.saveArtifactPaneWidth();\n }\n }\n\n /**\n * Touch event handlers for mobile resize support\n */\n OnResizeTouchStart(event: TouchEvent): void {\n this.isResizing = true;\n const touch = event.touches[0];\n this.startX = touch.clientX;\n this.startWidth = this.ArtifactPaneWidth;\n event.preventDefault();\n }\n\n /** @deprecated Use {@link OnResizeTouchStart}. */\n onResizeTouchStart(event: TouchEvent): void {\n return this.OnResizeTouchStart(event);\n }\n\n private onResizeTouchMove(event: TouchEvent): void {\n if (!this.isResizing) return;\n\n const touch = event.touches[0];\n const containerWidth = window.innerWidth;\n const deltaX = this.startX - touch.clientX;\n const deltaPercent = (deltaX / containerWidth) * 100;\n let newWidth = this.startWidth + deltaPercent;\n\n newWidth = Math.max(20, Math.min(70, newWidth));\n this.ArtifactPaneWidth = newWidth;\n }\n\n private onResizeTouchEnd(event: TouchEvent): void {\n if (this.isResizing) {\n this.isResizing = false;\n this.saveArtifactPaneWidth();\n }\n }\n\n /**\n * LocalStorage persistence methods for artifact pane\n */\n private loadArtifactPaneWidth(): void {\n try {\n const saved = localStorage.getItem(this.ARTIFACT_PANE_WIDTH_KEY);\n if (saved) {\n const width = parseFloat(saved);\n if (!isNaN(width) && width >= 20 && width <= 70) {\n this.ArtifactPaneWidth = width;\n }\n }\n } catch (error) {\n console.warn('Failed to load artifact pane width from localStorage:', error);\n }\n }\n\n private saveArtifactPaneWidth(): void {\n try {\n localStorage.setItem(this.ARTIFACT_PANE_WIDTH_KEY, this.ArtifactPaneWidth.toString());\n } catch (error) {\n console.warn('Failed to save artifact pane width to localStorage:', error);\n }\n }\n\n OnConversationRenamed(event: {conversationId: string; name: string; description: string}): void {\n LogStatusEx({message: '🎉 Conversation renamed', verboseOnly: true, additionalArgs: [event]});\n // Pass the event up to workspace component for animation\n this.ConversationRenamed.emit(event);\n }\n\n /** @deprecated Use {@link OnConversationRenamed}. */\n onConversationRenamed(event: {conversationId: string; name: string; description: string}): void {\n return this.OnConversationRenamed(event);\n }\n\n /**\n * Handle message sent from empty state component\n * Creates a new conversation and emits to parent to update selection\n */\n async OnEmptyStateMessageSent(event: {text: string; attachments: PendingAttachment[]}): Promise<void> {\n // The new-conversation draft became a message — remove the 'new' entry and\n // reset its restore snapshot so the NEXT new-conversation composer starts clean.\n this.draftStore.ClearDraft(null);\n this.initialDraftSnapshots.delete('new');\n const { text, attachments } = event;\n if (!text?.trim() && (!attachments || attachments.length === 0)) {\n return;\n }\n\n LogStatusEx({message: '📨 Empty state message received', verboseOnly: true, additionalArgs: [text, `${attachments?.length || 0} attachments`]});\n\n try {\n this.IsProcessing = true;\n\n // Create a new conversation using the engine. applicationScope +\n // applicationId let embedded surfaces (e.g. the Form Builder cockpit)\n // stamp their conversations as 'Application'-scoped so they don't\n // leak into the main chat list. defaultAgentId pins the routing\n // target for the first message — it's the same value forwarded to\n // <mj-message-input> as [defaultAgentId].\n //\n // Safety net: the DB CHECK constraint rejects ('Application' || 'Both')\n // without an ApplicationID. If the embedder hasn't resolved its app\n // ID yet (or it's missing from the Metadata cache), demote to\n // 'Global' so the save doesn't blow up. The conversation lands in\n // the main list — visible but not silently lost.\n const effectiveScope: 'Global' | 'Application' | 'Both' =\n (this.ApplicationScope !== 'Global' && !this.ApplicationId)\n ? 'Global'\n : this.ApplicationScope;\n // Linked-record stamping — both columns must be populated together\n // or both null (DB CHECK constraint CK_Conversation_LinkBinding).\n // We only forward the pair when BOTH inputs are supplied; if the\n // host bound one but not the other, treat as misconfiguration and\n // skip the linkage rather than failing the save.\n const hasLink = !!this.LinkedEntityId && !!this.LinkedRecordId;\n const newConversation = await this.engine.CreateConversation(\n 'New Conversation', // Temporary name - will be auto-named after first message\n this.EnvironmentId,\n this.CurrentUser,\n undefined,\n undefined,\n {\n applicationScope: effectiveScope,\n applicationId: effectiveScope === 'Global' ? null : this.ApplicationId,\n defaultAgentId: this.DefaultAgentId,\n linkedEntityId: hasLink ? this.LinkedEntityId : null,\n linkedRecordId: hasLink ? this.LinkedRecordId : null,\n }\n );\n\n if (!newConversation) {\n console.error('Failed to create new conversation');\n this.IsProcessing = false;\n return;\n }\n\n LogStatusEx({message: '✅ Created new conversation', verboseOnly: true, additionalArgs: [newConversation.ID]});\n\n // Pin the auto-send to THIS newly-created conversation, host-independent and immune to\n // conversation-swap timing. The pending message round-trips through the host (which sets\n // [pendingMessage]) and comes back as an @Input; the @for delivers it ONLY to the input\n // whose conversationId matches this target. Without this, a fast swap during the async\n // auto-send window lets the swapped-to conversation's input grab the pending message and\n // send it there instead (the cross-conversation bleed).\n this._pendingMessageTargetId = newConversation.ID;\n\n // Emit to parent with the new conversation AND the pending message/attachments in a single event\n // This ensures atomic state update - workspace sets all state before Angular change detection\n // creates the new message-input component\n const pendingMessage = text?.trim() || '';\n const pendingAttachments = attachments || [];\n this.ConversationCreated.emit({\n conversation: newConversation,\n pendingMessage,\n pendingAttachments\n });\n\n } catch (error) {\n console.error('Error creating conversation from empty state:', error);\n } finally {\n this.IsProcessing = false;\n }\n }\n\n /** @deprecated Use {@link OnEmptyStateMessageSent}. */\n async onEmptyStateMessageSent(event: {text: string; attachments: PendingAttachment[]}): Promise<void> {\n return this.OnEmptyStateMessageSent(event);\n }\n\n OnOpenEntityRecord(event: {entityName: string; compositeKey: CompositeKey}): void {\n // Pass the event up to the parent component (workspace or explorer wrapper)\n this.OpenEntityRecord.emit(event);\n }\n\n /** @deprecated Use {@link OnOpenEntityRecord}. */\n onOpenEntityRecord(event: {entityName: string; compositeKey: CompositeKey}): void {\n return this.OnOpenEntityRecord(event);\n }\n\n /** Record `open:resource` buttons → same openEntityRecord chain as agent-run links. */\n private emitOpenResourceRecord(command: OpenResourceCommand): void {\n if (!command.entityName) return;\n const entity = this.ProviderToUse.EntityByName(command.entityName);\n if (!entity) {\n console.warn('open:resource: unknown entity', command.entityName);\n return;\n }\n const compositeKey = ConversationUtility.CompositeKeyFromOpenResource(\n command,\n entity.PrimaryKeys.map(pk => pk.Name)\n );\n if (!compositeKey) {\n console.warn('open:resource: incomplete primary key', command.entityName, command);\n return;\n }\n this.OpenEntityRecord.emit({ entityName: command.entityName, compositeKey });\n }\n\n OnNavigationRequest(event: NavigationRequest): void {\n // Pass the event up to the parent component for app-level navigation\n this.navigationRequest.emit(event);\n }\n\n /** @deprecated Use {@link OnNavigationRequest}. */\n onNavigationRequest(event: NavigationRequest): void {\n return this.OnNavigationRequest(event);\n }\n\n ViewTestRun(testRunId: string): void {\n // Open the test run record in the entity viewer\n this.OpenEntityRecord.emit({\n entityName: 'MJ: Test Runs',\n compositeKey: CompositeKey.FromID(testRunId)\n });\n }\n\n /** @deprecated Use {@link ViewTestRun}. */\n viewTestRun(testRunId: string): void {\n return this.ViewTestRun(testRunId);\n }\n\n /**\n * A gear-gated developer link in the live call overlay asked to open a record\n * (delegated agent run / agent session). The overlay has already minimized itself\n * (the call stays live behind the floating \"on call\" pill); re-emit on the SAME\n * `openEntityRecord` chain every other chat record-open uses, so the Explorer\n * wrapper routes it through `NavigationService.OpenEntityRecord`.\n */\n OnRealtimeNavigateRequest(event: RealtimeNavigateRequest): void {\n // The overlay can name any entity — resolve its key column(s) from metadata, not a hardcoded ID.\n this.OpenEntityRecord.emit({\n entityName: event.EntityName,\n compositeKey: CompositeKey.FromURLSegment(this.ProviderToUse.EntityByName(event.EntityName), event.RecordID)\n });\n }\n\n /** @deprecated Use {@link OnRealtimeNavigateRequest}. */\n onRealtimeNavigateRequest(event: RealtimeNavigateRequest): void {\n return this.OnRealtimeNavigateRequest(event);\n }\n\n /**\n * Session-START hook for a realtime session that CREATED its own conversation (started\n * without one). Folds that server-created conversation into the engine's reactive cache\n * directly — ONE single-row load, only when it isn't already cached — so the sidebar list\n * emits via `Conversations$` the moment the call starts, independent of the host's refresh\n * round-trip. Also emits {@link realtimeConversationReady} so the host can react (it\n * selects on close). No-op when the session joined an existing conversation. Fire-and-forget\n * on the load: a failed load just leaves the host's emit to fold it in.\n */\n private onRealtimeSessionStarted(): void {\n const created = this.RealtimeSession.SessionCreatedConversationId;\n if (!created) {\n return;\n }\n void this.engine.EnsureConversationLoaded(created, this.CurrentUser);\n this.RealtimeConversationReady.emit({ conversationId: created, select: false });\n }\n\n /**\n * Post-call hook. Two responsibilities:\n * 1. Reload the ACTIVE conversation's timeline so the session that just ended — whose\n * session-stamped `MJ: Conversation Details` were persisted server-side during the\n * call — surfaces as a reviewable past-session block WITHOUT a manual refresh.\n * 2. For a session that CREATED its own conversation, kick the shared auto-naming\n * helper (covered elsewhere on first utterance; this covers a silent call) and\n * emit {@link realtimeConversationReady} so the host can refresh the list + select.\n */\n private onRealtimeSessionEnded(): void {\n // (1) Refresh the active conversation's timeline (cheap — single conversation).\n void this.reloadActiveConversationTimeline();\n\n // (2) New-conversation case: let the host fold + select it.\n const conversationId = this.RealtimeSession.SessionCreatedConversationId;\n if (!conversationId) {\n return;\n }\n // Naming normally fired at the first utterance; this covers a silent call's default.\n this.RealtimeConversationReady.emit({ conversationId, select: true });\n }\n\n /**\n * Surgically reloads the CURRENTLY-OPEN conversation's details so newly-persisted rows\n * (e.g. a just-ended realtime session's session-stamped caption turns) appear in the\n * timeline — and therefore in the \"review past sessions\" affordances — without a manual\n * browser refresh. Re-queries ONLY the active conversation (no broad reload), mirrors the\n * agent-completion refresh path, and no-ops when no conversation is open.\n */\n private async reloadActiveConversationTimeline(): Promise<void> {\n const conversationId = this.ConversationId;\n if (!conversationId) {\n return;\n }\n try {\n await this.windowStore.RefreshLatest(this.CurrentUser);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Re-read the refreshed window\n const refreshed = this.windowStore.GetSnapshot();\n this.messages = refreshed.Details;\n\n // Reprocess peripheral data + realtime session meta (drives the timeline's session cards)\n this.lastLoadedConversationId = null;\n await this.loadPeripheralData(conversationId, refreshed);\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Failed to reload conversation timeline after the session ended:', error);\n }\n }\n\n /**\n * ENTRY API for SESSION REVIEW: opens the realtime overlay in review mode over this\n * conversation panel, rendering what went down in a PAST agent session (caption turns,\n * delegated-run cards, the saved read-only whiteboard). Intended for conversation\n * timeline affordances that reopen historical realtime sessions.\n *\n * @param agentSessionId The `MJ: AI Agent Sessions.ID` to review.\n * @returns `true` when the session loaded and the review opened; `false` when it\n * couldn't be loaded (missing/unreadable session) or a live call is already active.\n */\n public async OpenRealtimeSessionReview(agentSessionId: string): Promise<boolean> {\n if (this.RealtimeSession.IsActive) {\n return false; // a live call owns the overlay — don't fight it with a review\n }\n const conversationAtRequest = this._conversationId;\n const review = await this.realtimeReviewService.LoadSessionReview(agentSessionId, this.ProviderToUse);\n if (!review) {\n return false;\n }\n if (this.RealtimeSession.IsActive) {\n return false; // a live call started while the review was loading — it wins\n }\n if (!this.canHostLoadedReview(conversationAtRequest, review.ConversationID)) {\n return false; // the active conversation changed mid-load and the review isn't its own — discard, don't go stale\n }\n this.RealtimeReview = review;\n this.cdr.detectChanges();\n return true;\n }\n\n /**\n * STALENESS GUARD for the async review load: hosting is allowed when the active\n * conversation hasn't changed since the request started, OR when it HAS changed but\n * the loaded review belongs to the now-active conversation (the deep-link case where\n * the conversation selection and the review open race each other). Anything else is\n * a stale review for a conversation the user already left — never host it.\n */\n private canHostLoadedReview(conversationAtRequest: string | null, reviewConversationId: string | null): boolean {\n const current = this._conversationId;\n if (conversationAtRequest === current) {\n return true;\n }\n return !!reviewConversationId && !!current && UUIDsEqual(reviewConversationId, current);\n }\n\n /**\n * Drops any hosted SESSION REVIEW so the overlay unhosts itself. Safe to call at any\n * time: a LIVE call's overlay is unaffected (it renders off `RealtimeSession.Active$`).\n * Called on every conversation change, on the overlay's Close, and available to hosts\n * that need to programmatically dismiss a review.\n */\n public ClearRealtimeSessionReview(): void {\n if (this.RealtimeReview) {\n this.RealtimeReview = null;\n }\n }\n\n /**\n * Review mode's \"Start live session\": RESUMES the reviewed session as a new live call\n * through the SAME start path the composer's mic uses, chaining `lastSessionId` so the\n * server restores saved channel states (e.g. the whiteboard) via `PriorChannelStatesJson`.\n * The start flips `Active$` synchronously, so clearing the review immediately after\n * never unhosts the overlay mid-transition.\n */\n public async OnReviewStartLive(request: RealtimeStartLiveRequest): Promise<void> {\n const agentName = this.RealtimeReview?.AgentName ?? null;\n try {\n const start = this.RealtimeSession.StartRealtimeSession(\n request.TargetAgentId,\n request.ConversationId ?? this.ConversationId,\n request.LastSessionId,\n agentName,\n null, // preferredModelId\n null, // clientTools\n null, // coAgentId\n null, // configOverridesJson\n null, // recordingConsent\n null, // mediaCollectionId\n // App awareness — see message-input.startVoiceSession for the rationale.\n this.ApplicationId,\n this.AppContext as AppContextSnapshot | null\n );\n this.RealtimeReview = null;\n await start;\n } catch (error) {\n console.error('Failed to resume the reviewed session as a live call:', error);\n MJNotificationService.Instance.CreateSimpleNotification('Could not start the live session.', 'error', 3000);\n }\n }\n\n /** @deprecated Use {@link OnReviewStartLive}. */\n public async onReviewStartLive(request: RealtimeStartLiveRequest): Promise<void> {\n return this.OnReviewStartLive(request);\n }\n\n /** Review mode's Close: drop the review state (the overlay unhosts itself). */\n public OnReviewClosed(): void {\n this.ClearRealtimeSessionReview();\n }\n\n /** @deprecated Use {@link OnReviewClosed}. */\n public onReviewClosed(): void {\n return this.OnReviewClosed();\n }\n\n /**\n * Handles Shift+Click on an AI message bubble.\n * Dumps a live snapshot of in-memory streaming and agent-run state to the browser\n * console so engineers can debug stuck/forever-spinning conversations without\n * needing to add any temporary code.\n *\n * Usage: Hold Shift and click any AI message bubble. Open DevTools Console to see the dump.\n */\n OnDiagnosticRequested(messageId: string): void {\n const streaming = this.streamingService.getDiagnosticSnapshot(messageId);\n const agentRun = this.AgentRunsByDetailId.get(messageId);\n const isInProgress = this.InProgressMessageIds.includes(messageId);\n\n console.group(`%c[MJ Diagnostic Dump] Message ${messageId}`, 'color: #0076b6; font-weight: bold');\n console.log('Timestamp:', new Date().toISOString());\n console.log('ConversationID:', this.ConversationId);\n console.log('isInProgress (UI):', isInProgress);\n console.log('All inProgressMessageIds:', [...this.InProgressMessageIds]);\n console.log('Streaming connection:', streaming.connectionStatus);\n console.log('Streaming callbacks registered:', streaming.callbackCount);\n if (streaming.recentCompletion) {\n console.log('Recent completion (not yet processed):', streaming.recentCompletion);\n }\n if (agentRun) {\n console.log('Agent run:', { id: agentRun.ID, status: agentRun.Status, name: agentRun.Agent });\n } else {\n console.log('Agent run: none loaded for this message');\n }\n console.groupEnd();\n }\n\n /** @deprecated Use {@link OnDiagnosticRequested}. */\n onDiagnosticRequested(messageId: string): void {\n return this.OnDiagnosticRequested(messageId);\n }\n\n OnTestFeedbackMessage(message: MJConversationDetailEntity): void {\n if (!message.TestRunID) {\n console.error('Cannot provide test feedback: message has no TestRunID');\n return;\n }\n\n this.TestFeedbackDialogData = {\n testRunId: message.TestRunID,\n conversationDetailId: message.ID,\n currentUser: this.CurrentUser\n };\n this.ShowTestFeedbackDialog = true;\n }\n\n /** @deprecated Use {@link OnTestFeedbackMessage}. */\n onTestFeedbackMessage(message: MJConversationDetailEntity): void {\n return this.OnTestFeedbackMessage(message);\n }\n\n OnTestFeedbackDialogClosed(result: TestFeedbackDialogResult): void {\n this.ShowTestFeedbackDialog = false;\n this.TestFeedbackDialogData = null;\n if (result.success) {\n console.log('Test feedback saved successfully:', result.feedbackId);\n }\n }\n\n /** @deprecated Use {@link OnTestFeedbackDialogClosed}. */\n onTestFeedbackDialogClosed(result: TestFeedbackDialogResult): void {\n return this.OnTestFeedbackDialogClosed(result);\n }\n\n OnTaskClicked(task: MJTaskEntity): void {\n // Pass task click up to workspace to navigate to Tasks tab\n this.TaskClicked.emit(task);\n }\n\n /** @deprecated Use {@link OnTaskClicked}. */\n onTaskClicked(task: MJTaskEntity): void {\n return this.OnTaskClicked(task);\n }\n\n OnNavigateToConversation(event: {conversationId: string; taskId: string}): void {\n // Navigate to the conversation with the active task - emit to parent\n // Parent will update its selection state\n // For now, we can't navigate to a different conversation from within chat area\n // This would require emitting an event to the parent\n console.log('Navigate to conversation requested:', event.conversationId);\n }\n\n /** @deprecated Use {@link OnNavigateToConversation}. */\n onNavigateToConversation(event: {conversationId: string; taskId: string}): void {\n return this.OnNavigateToConversation(event);\n }\n\n /**\n * Handle navigation request from artifact viewer Links tab\n */\n OnArtifactLinkNavigation(event: {type: 'conversation' | 'collection'; id: string}): void {\n LogStatusEx({message: '🔗 Chat area: Artifact link clicked', verboseOnly: true, additionalArgs: [event]});\n this.ArtifactLinkClicked.emit(event);\n }\n\n /** @deprecated Use {@link OnArtifactLinkNavigation}. */\n onArtifactLinkNavigation(event: {type: 'conversation' | 'collection'; id: string}): void {\n return this.OnArtifactLinkNavigation(event);\n }\n\n /**\n * Load permissions for the given artifact\n */\n private async loadArtifactPermissions(artifactId: string, expectedConversationId?: string | null, expectedSelectedArtifactId?: string | null): Promise<boolean> {\n const canApply = () => {\n const conversationOk = expectedConversationId === undefined || this.isActiveConversation(expectedConversationId);\n const artifactOk = !expectedSelectedArtifactId || UUIDsEqual(this.SelectedArtifactId, expectedSelectedArtifactId);\n return conversationOk && artifactOk;\n };\n\n // Guard against null/undefined\n if (!artifactId) {\n if (canApply()) {\n this.CanShareSelectedArtifact = false;\n this.CanEditSelectedArtifact = false;\n }\n return false;\n }\n\n try {\n const permissions = await this.artifactPermissionService.getUserPermissions(artifactId, this.CurrentUser);\n if (!canApply()) {\n return false;\n }\n this.CanShareSelectedArtifact = permissions.canShare;\n this.CanEditSelectedArtifact = permissions.canEdit;\n return true;\n } catch (error) {\n console.error('Failed to load artifact permissions:', error);\n if (canApply()) {\n this.CanShareSelectedArtifact = false;\n this.CanEditSelectedArtifact = false;\n }\n return false;\n }\n }\n\n /**\n * Handle share request from artifact viewer\n */\n async OnArtifactShareRequested(artifactId: string): Promise<void> {\n // Load the artifact entity to pass to the modal\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts');\n await artifact.Load(artifactId);\n\n if (artifact) {\n this.ArtifactToShare = artifact;\n this.IsArtifactShareModalOpen = true;\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link OnArtifactShareRequested}. */\n async onArtifactShareRequested(artifactId: string): Promise<void> {\n return this.OnArtifactShareRequested(artifactId);\n }\n\n /**\n * Handle Analyze button click from the artifact viewer panel.\n * Creates a user message with the artifact attached as an input,\n * then routes through the normal agent flow so the agent can\n * explore the artifact via artifact tools.\n */\n /**\n * Handle Analyze button click from the artifact viewer panel.\n *\n * Persists the captured snapshot as a new Data Snapshot artifact and attaches\n * it to the user's in-progress message as a pending attachment chip (same UX\n * as image/file uploads). On send, the existing attachment pipeline creates\n * a `ConversationDetailArtifact` with Direction='Input'; AgentRunner then\n * picks it up via `gatherConversationArtifacts` and resolves the\n * DataSnapshotToolLibrary for tool calls.\n *\n * Falls back to plain message prefill if snapshot persistence fails — the\n * user can still ask questions about the artifact that's already attached\n * to the prior conversation turn.\n */\n async OnAnalyzeArtifact(event: { artifactId: string; snapshot: DataSnapshot }): Promise<PendingAttachment | null> {\n const conversationId = this.ConversationId;\n if (!conversationId || !this.CurrentUser) return null;\n\n const messageInput = this.getActiveMessageInputComponent();\n const snapshotTitle = event.snapshot.title || 'Untitled Snapshot';\n\n try {\n const result = await this.analyzeArtifactService.CreateSnapshotArtifact({\n snapshot: event.snapshot,\n currentUser: this.CurrentUser,\n environmentId: this.EnvironmentId,\n });\n if (!this.isActiveConversation(conversationId)) {\n return null;\n }\n\n if (messageInput) {\n const rowCount = (event.snapshot.tables ?? []).reduce(\n (sum, t) => sum + (t.rows?.length ?? 0),\n 0,\n );\n const serialized = JSON.stringify(event.snapshot);\n const created = messageInput.inputBox?.mentionEditor?.AddArtifactAttachment({\n fileID: '',\n fileName: rowCount > 0\n ? `📸 ${result.title} · ${rowCount.toLocaleString()} rows`\n : `📸 ${result.title}`,\n mimeType: 'application/json',\n sizeBytes: serialized.length,\n artifactVersionId: result.artifactVersionId,\n });\n messageInput.messageText = `Analyze \"${result.title}\" — `;\n messageInput.inputBox?.focus();\n return created ?? null;\n }\n } catch (error) {\n LogStatusEx({\n message: `[OnAnalyzeArtifact] CreateSnapshotArtifact failed: ${error instanceof Error ? error.message : String(error)}`,\n verboseOnly: false,\n });\n if (!this.isActiveConversation(conversationId)) {\n return null;\n }\n if (messageInput) {\n messageInput.messageText = `Analyze \"${snapshotTitle}\" — `;\n messageInput.inputBox?.focus();\n }\n }\n return null;\n }\n\n /**\n * Handle a `client:capture-data-snapshot` actionable command emitted by an\n * analysis-class agent that needs the user's current view of an artifact to\n * answer accurately but has no Data Snapshot artifact attached.\n *\n * Flow:\n * 1. Resolve the target artifact — `command.artifactId` if provided,\n * otherwise the most-recent output artifact on the conversation.\n * 2. Open the artifact viewer panel for it (mounts the viewer plugin if not\n * already mounted).\n * 3. Poll until the viewer can produce a snapshot via\n * `GetCurrentStateSnapshot()`, with a short timeout.\n * 4. Reuse the existing `OnAnalyzeArtifact` flow to persist the snapshot\n * as a Data Snapshot artifact + attach it as a chip on the message input.\n * 5. If `command.followupMessage` is provided, replace the prefill and\n * auto-send so the agent immediately re-runs with the snapshot attached.\n * Otherwise, leave the chip + prefill in place for the user to send manually.\n *\n * Soft-fails — logs a warning and stops on any unrecoverable error rather\n * than throwing. The user's conversation state isn't disrupted.\n */\n private async handleCaptureDataSnapshotCommand(command: CaptureDataSnapshotCommand): Promise<void> {\n const conversationId = this.ConversationId;\n console.log('[client:capture-data-snapshot] Handler invoked', { command, conversationId });\n if (!conversationId || !this.CurrentUser) {\n console.warn('[client:capture-data-snapshot] No active conversation/user; ignoring');\n return;\n }\n\n let artifactId = command.artifactId;\n if (!artifactId) {\n artifactId = (await this.findMostRecentComponentArtifactId()) ?? undefined;\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n console.log('[client:capture-data-snapshot] Resolved artifactId via lookup:', artifactId);\n } else {\n console.log('[client:capture-data-snapshot] Using artifactId from command:', artifactId);\n }\n if (!artifactId) {\n console.warn('[client:capture-data-snapshot] No artifact found on this conversation; cannot capture');\n return;\n }\n\n const panelAlreadyOpen = this.SelectedArtifactId === artifactId && this.ShowArtifactPanel;\n console.log(\n '[client:capture-data-snapshot] Panel state — currentSelectedId=' +\n this.SelectedArtifactId +\n ' showPanel=' +\n this.ShowArtifactPanel +\n ' panelAlreadyOpen=' +\n panelAlreadyOpen,\n );\n\n // Open the artifact panel so the viewer mounts (if it isn't already).\n if (!panelAlreadyOpen) {\n this.artifactSelectionEpoch++;\n this.SelectedArtifactId = artifactId;\n this.SelectedVersionNumber = undefined;\n this.ShowArtifactPanel = true;\n try {\n await this.loadArtifactPermissions(artifactId, conversationId, artifactId);\n } catch {\n // Non-fatal — permissions are for UI affordances, not capture\n }\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, artifactId)) {\n return;\n }\n this.cdr.detectChanges();\n console.log('[client:capture-data-snapshot] Opened artifact panel; waiting for viewer mount + data load');\n }\n\n // Poll for the snapshot — interactive components need a few render cycles\n // before `getCurrentDataState()` registers via callbacks.RegisterMethod,\n // and query-backed / server-paged components need additional time to load\n // their rows (we now wait for rows, not just a registered table).\n const snapshot = await this.waitForViewerSnapshot(15000);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, artifactId)) {\n return;\n }\n if (!snapshot) {\n console.warn('[client:capture-data-snapshot] Artifact viewer did not produce a snapshot within timeout');\n return;\n }\n\n // Persist + attach via the existing Analyze flow. Capture the created\n // PendingAttachment so we can pass it directly into sendMessageWithText\n // below — the mention-editor → message-input-box → message-input event\n // chain that normally syncs `pendingAttachments` is async (next-tick) and\n // hasn't propagated by the time we auto-send.\n const capturedAttachment = await this.OnAnalyzeArtifact({ artifactId, snapshot });\n if (!this.isActiveConversation(conversationId)) {\n return;\n }\n\n // Auto-send the followup so the agent re-runs immediately with the\n // captured snapshot now attached. Resolution order:\n // 1. command.followupMessage — if the agent provided one\n // 2. most-recent User message — re-sends the question that triggered\n // this capture exchange (typical: \"Looking at this dashboard, …\")\n // so the agent sees the same question with the artifact attached\n // 3. a generic re-prompt — last resort if no user message found\n // OnAnalyzeArtifact prefilled messageText with 'Analyze \"...\" — '; we\n // overwrite that with the resolved followup before sending.\n const messageInput = this.getActiveMessageInputComponent();\n if (messageInput) {\n let followup = command.followupMessage?.trim();\n if (!followup) {\n const lastUserMsg = [...this.messages]\n .reverse()\n .find((m) => m.Role === 'User' && m.Message && m.Message.trim().length > 0);\n followup = lastUserMsg?.Message?.trim();\n }\n if (!followup) {\n followup = 'Please answer my previous question using the captured snapshot.';\n }\n messageInput.messageText = '';\n try {\n await messageInput.sendMessageWithText(\n followup,\n capturedAttachment ? [capturedAttachment] : undefined,\n );\n } catch (error) {\n console.error('[client:capture-data-snapshot] Auto-send failed:', error);\n }\n }\n }\n\n /**\n * Poll `artifactViewerComponent.GetCurrentStateSnapshot()` for the LIVE\n * data snapshot. The React component inside the viewer plugin needs several\n * render cycles after `selectedArtifactId` changes before its inner data\n * fetches run and its `getCurrentDataState()` becomes callable via\n * `callbacks.RegisterMethod('getCurrentDataState', ...)`.\n *\n * `GetCurrentStateSnapshot()` returns three distinct shapes:\n * - **Live**: a populated DataSnapshot with `tables[]` whose rows are filled.\n * - **Fallback**: an empty placeholder with only `title` + `interpretation`\n * (\"No live data was captured — the component either has no data-fetching\n * hooks or has not yet run its queries\"). This fires when the React\n * component hasn't yet registered `getCurrentDataState()`.\n * - **Schema-only**: a structured snapshot with real `tables`/`columns` and\n * metadata (e.g. `totalAvailableRowCount`) but `rows: []`. This is common\n * for query-backed / server-paged components whose data load hasn't\n * completed (or whose visible page is empty) at the moment of capture.\n *\n * We must accept ONLY a snapshot that actually carries rows — a schema-only\n * or placeholder snapshot defeats the point of the pipeline (the analysis\n * agent receives an empty table). So we key \"live\" on `rows.length`, not just\n * `tables.length`, and keep polling so async/paged data has time to load.\n * Only after timeout do we return the last available row-less snapshot (any\n * structure is better than nothing, but the user will see an empty table in\n * the resulting artifact).\n */\n private async waitForViewerSnapshot(timeoutMs: number): Promise<DataSnapshot | null> {\n const intervalMs = 200;\n const deadline = Date.now() + timeoutMs;\n let lastFallback: DataSnapshot | null = null;\n let tick = 0;\n const startTime = Date.now();\n console.log('[client:capture-data-snapshot] Polling for live snapshot, timeout=' + timeoutMs + 'ms');\n while (Date.now() < deadline) {\n tick++;\n const viewer = this.artifactViewerComponent;\n const snap = viewer?.GetCurrentStateSnapshot?.();\n if (snap) {\n const hasLiveData = Array.isArray(snap.tables) && snap.tables.some((t) => Array.isArray(t.rows) && t.rows.length > 0);\n const tableShape = Array.isArray(snap.tables)\n ? snap.tables.map((t) => `${t.name}:${(t.rows ?? []).length}rows`).join(', ')\n : 'no-tables';\n const elapsed = Date.now() - startTime;\n // Log every 5th tick to avoid spamming\n if (tick % 5 === 1 || hasLiveData) {\n console.log(\n `[client:capture-data-snapshot] tick=${tick} elapsed=${elapsed}ms viewer=${!!viewer} ` +\n `snap=${!!snap} hasLiveData=${hasLiveData} shape=[${tableShape}] ` +\n `keys=[${Object.keys(snap).join(',')}]`,\n );\n }\n if (hasLiveData) {\n return snap; // real snapshot — done\n }\n lastFallback = snap; // remember for timeout case\n } else if (tick % 5 === 1) {\n console.log(\n `[client:capture-data-snapshot] tick=${tick} viewer=${!!viewer} snap=null (viewer hasn't returned a snapshot yet)`,\n );\n }\n await new Promise((r) => setTimeout(r, intervalMs));\n }\n if (lastFallback) {\n console.warn(\n '[client:capture-data-snapshot] Timed out waiting for live data after ' +\n timeoutMs +\n 'ms; falling back to placeholder snapshot. The component may not have registered ' +\n 'getCurrentDataState() via callbacks.RegisterMethod, OR its data has not finished loading.',\n );\n } else {\n console.warn(\n '[client:capture-data-snapshot] Timed out after ' +\n timeoutMs +\n 'ms — viewer never returned even a fallback snapshot. Artifact viewer may not have mounted.',\n );\n }\n return lastFallback;\n }\n\n /**\n * Find the most-recent Component artifact attached as `Output` to this\n * conversation. Used when a `client:capture-data-snapshot` command arrives\n * without an explicit `artifactId`.\n *\n * Filtering to Component-typed artifacts is intentional even though the\n * command type itself is artifact-generic: the downstream\n * `waitForViewerSnapshot` polling waits for `tables[]` to populate (the\n * shape Components produce via React `getCurrentDataState()`). Falling back\n * to a non-Component artifact would 10s-timeout to a placeholder snapshot.\n * When other artifact types need a usable fallback, generalize the polling\n * first, then drop the filter here.\n */\n private async findMostRecentComponentArtifactId(): Promise<string | null> {\n if (!this.ConversationId || !this.CurrentUser) return null;\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get all conversation detail IDs for this conversation, newest first.\n const detailsResult = await rv.RunView<MJConversationDetailEntity>(\n {\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `ConversationID='${this.ConversationId}'`,\n Fields: ['ID'],\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'simple',\n },\n this.CurrentUser,\n );\n if (!detailsResult.Success || !detailsResult.Results?.length) return null;\n const detailIds = detailsResult.Results.map((d) => `'${d.ID}'`).join(',');\n\n // Find the most recent Output artifact junction across those details.\n const junctionResult = await rv.RunView(\n {\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `ConversationDetailID IN (${detailIds}) AND Direction='Output'`,\n OrderBy: '__mj_CreatedAt DESC',\n ResultType: 'simple',\n },\n this.CurrentUser,\n );\n if (!junctionResult.Success || !junctionResult.Results?.length) return null;\n\n // Look up artifact IDs for each version and filter to Component type.\n const versionIds = Array.from(\n new Set((junctionResult.Results as Array<{ ArtifactVersionID: string }>).map((j) => j.ArtifactVersionID)),\n );\n if (versionIds.length === 0) return null;\n const versionFilter = versionIds.map((id) => `'${id}'`).join(',');\n const versionsResult = await rv.RunView(\n {\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (${versionFilter})`,\n Fields: ['ID', 'ArtifactID'],\n ResultType: 'simple',\n },\n this.CurrentUser,\n );\n if (!versionsResult.Success || !versionsResult.Results?.length) return null;\n\n const versionToArtifact = new Map<string, string>();\n for (const v of versionsResult.Results as Array<{ ID: string; ArtifactID: string }>) {\n versionToArtifact.set(v.ID, v.ArtifactID);\n }\n\n const artifactIds = Array.from(new Set([...versionToArtifact.values()]));\n const artifactFilter = artifactIds.map((id) => `'${id}'`).join(',');\n const artifactsResult = await rv.RunView<MJArtifactEntity>(\n {\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactFilter})`,\n ResultType: 'simple',\n },\n this.CurrentUser,\n );\n if (!artifactsResult.Success || !artifactsResult.Results?.length) return null;\n\n // Resolve the Component type ID from the metadata engine to filter to it.\n const componentType = ArtifactMetadataEngine.Instance.FindArtifactType('Component');\n if (!componentType) return null;\n\n const componentArtifactIds = new Set(\n (artifactsResult.Results as Array<{ ID: string; TypeID: string | null }>)\n .filter((a) => UUIDsEqual(a.TypeID, componentType.ID))\n .map((a) => a.ID),\n );\n if (componentArtifactIds.size === 0) return null;\n\n // Walk junctions in newest-first order; return the first whose artifact is Component.\n for (const junction of junctionResult.Results as Array<{ ArtifactVersionID: string }>) {\n const artifactId = versionToArtifact.get(junction.ArtifactVersionID);\n if (artifactId && componentArtifactIds.has(artifactId)) {\n return artifactId;\n }\n }\n return null;\n } catch (error) {\n console.error('[client:capture-data-snapshot] findMostRecentComponentArtifactId failed:', error);\n return null;\n }\n }\n\n /**\n * Handle close of artifact share modal\n */\n OnArtifactShareModalClose(): void {\n this.IsArtifactShareModalOpen = false;\n this.ArtifactToShare = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnArtifactShareModalClose}. */\n onArtifactShareModalClose(): void {\n return this.OnArtifactShareModalClose();\n }\n\n /**\n * Handle successful share - refresh permissions\n */\n async OnArtifactShared(): Promise<void> {\n this.IsArtifactShareModalOpen = false;\n this.ArtifactToShare = null;\n\n // Refresh permissions for the active artifact\n if (this.SelectedArtifactId) {\n await this.loadArtifactPermissions(this.SelectedArtifactId);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnArtifactShared}. */\n async onArtifactShared(): Promise<void> {\n return this.OnArtifactShared();\n }\n\n // Scroll functionality (pattern from skip-chat)\n CheckScroll(): void {\n if (!this.scrollContainer) return;\n\n const element = this.scrollContainer.nativeElement;\n const buffer = 15; // Tolerance in pixels\n const scrollDifference = element.scrollHeight - (element.scrollTop + element.clientHeight);\n const hasScrollableContent = element.scrollHeight > element.clientHeight + 50;\n const atBottom = scrollDifference <= buffer;\n this.readerAtBottom = atBottom;\n\n const newValue = !atBottom && hasScrollableContent;\n\n // Only update if value changed to prevent unnecessary change detection\n if (this.ShowScrollToBottomIcon !== newValue) {\n this.ShowScrollToBottomIcon = newValue;\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link CheckScroll}. */\n checkScroll(): void {\n return this.CheckScroll();\n }\n\n ScrollToBottomNow(retryCount: number = 0): void {\n try {\n if (!this.scrollContainer) {\n if (retryCount < 10) {\n setTimeout(() => this.ScrollToBottomNow(retryCount + 1), 50);\n }\n return;\n }\n\n const element = this.scrollContainer.nativeElement;\n if (element.scrollHeight === 0 && retryCount < 10) {\n setTimeout(() => this.ScrollToBottomNow(retryCount + 1), 50);\n } else if (element.scrollHeight > 0) {\n element.scrollTop = element.scrollHeight;\n }\n } catch (err) {\n console.error('Error scrolling to bottom:', err);\n }\n }\n\n /** @deprecated Use {@link ScrollToBottomNow}. */\n scrollToBottomNow(retryCount: number = 0): void {\n return this.ScrollToBottomNow(retryCount);\n }\n\n ScrollToBottomAnimate(): void {\n if (this.scrollContainer) {\n const element = this.scrollContainer.nativeElement;\n element.scroll({ top: element.scrollHeight, behavior: 'smooth' });\n }\n }\n\n /** @deprecated Use {@link ScrollToBottomAnimate}. */\n scrollToBottomAnimate(): void {\n return this.ScrollToBottomAnimate();\n }\n\n /**\n * Decides where the viewport goes after the transcript changed.\n *\n * - `load` — a conversation was opened: the bottom.\n * - `new` — a message was appended: follow the tail, as before.\n * - `update` — a message already on screen changed in place (progress, status, streamed\n * text). Never moves a reader who has scrolled away; keeps a reader who is\n * at the bottom there as the bubble grows. (Before this, every progress\n * update re-ran the send path's scroll — message-input re-emits\n * `messageSent` per update — and yanked the reader to the bottom.)\n *\n * With `readReplyFromTop`, the reader's own message opens a turn — whether it arrives as\n * `new` or, on the auto-send path where the chat area already holds it, as `update` — and\n * every settled AI message of that turn (Complete or Error) lands the turn instead of\n * following, for a reader who was still following. EVERY settled message, not the first:\n * the refinement path emits a settled status line (\"Continuing with X…\") before the reply,\n * and a turn that landed on the status line alone must land again when the reply arrives\n * (re-landing is idempotent — the same target, or nothing once the reader has been moved\n * off the bottom). Completion is also emitted more than once for one message; none of those\n * emits may fall through to the bottom follow. A `load` does not forget the turn: creating\n * a conversation from the composer sends the first message while the initial load is still\n * in flight.\n */\n private followTranscript(change: 'load' | 'new' | 'update', message?: MJConversationDetailEntity): void {\n if (change === 'load') {\n this.scrollToBottom = true;\n return;\n }\n if (this.ReadReplyFromTop) {\n if (message?.Role === 'User' && message.ID && message.ID !== this.currentTurnStartMessageId) {\n this.currentTurnStartMessageId = message.ID;\n } else if (this.currentTurnStartMessageId && message?.Role === 'AI' && this.isSettled(message)) {\n if (this.readerAtBottom) {\n this.pendingTurnStartMessageId = this.currentTurnStartMessageId;\n this.scrollToBottom = false;\n this.bottomFollowSuppressedUntil = Date.now() + 1500;\n }\n return;\n }\n }\n if (change === 'new' || this.readerAtBottom) {\n if (change === 'new' && message?.Role === 'User') {\n // The reader sending again right after a reply landed must not be swallowed by the\n // landing's suppression. Only THEIR message lifts it: an AI message arriving new\n // inside the window belongs to the turn that just landed and must not cancel it.\n this.bottomFollowSuppressedUntil = 0;\n }\n this.scrollToBottom = true;\n }\n }\n\n private isSettled(message: MJConversationDetailEntity): boolean {\n return message.Status === 'Complete' || message.Status === 'Error';\n }\n\n /**\n * readReplyFromTop: once the reply has rendered, scrolls the turn so its first message\n * sits at the top of the pane — but only if the turn is taller than the pane. A turn that\n * fits is already fully on screen at the bottom, and moving it would be motion for nothing.\n */\n private scrollTurnToTop(messageId: string, attempt: number = 0): void {\n if (!this.ReadReplyFromTop) {\n return;\n }\n const container = this.scrollContainer?.nativeElement as HTMLElement | undefined;\n // Resolved through the list's timeline, not a `[data-message-id]` query: a far-off item\n // is unmounted into a spacer and a session-stamped row folds into its session card, and\n // the list answers with the node that stands for the message in either case.\n const target = this.messageListComponent?.FindTimelineElement(messageId) ?? null;\n if (!container || !target) {\n // The reply's final render lands a tick or two after the array changes — the same\n // latency the bottom-follow path absorbs with its 100 ms timer.\n if (attempt < 20) {\n this.turnStartRetryHandle = setTimeout(() => this.scrollTurnToTop(messageId, attempt + 1), 50);\n }\n return;\n }\n this.turnStartRetryHandle = null;\n const turnTop = this.offsetWithinScroller(target) - this.turnTopClearance(container);\n const turnHeight = container.scrollHeight - turnTop; // the turn is the newest content\n if (turnHeight > container.clientHeight) {\n container.scroll({ top: turnTop, behavior: 'smooth' });\n } else {\n this.ScrollToBottomNow();\n }\n this.CheckScroll();\n }\n\n /**\n * How far below the pane's top edge the turn's first message lands: the standard gap, plus\n * room for the list's sticky date header when it is showing — it pins to this scroller's\n * top and would otherwise sit on the message's first line.\n */\n private turnTopClearance(container: HTMLElement): number {\n const stickyHeader = container.querySelector<HTMLElement>('.sticky-date-header');\n if (!stickyHeader || !stickyHeader.offsetParent) {\n return ConversationChatAreaComponent.TURN_TOP_GAP_PX;\n }\n // The header's CSS inset (`top: 12px`), NOT `offsetTop`: on a pinned sticky element\n // `offsetTop` reports the used position, which tracks the scroll offset.\n const inset = parseFloat(getComputedStyle(stickyHeader).top) || 0;\n return ConversationChatAreaComponent.TURN_TOP_GAP_PX + stickyHeader.offsetHeight + inset;\n }\n\n /** An element's top edge in the scroller's content coordinates — what scrollTop counts in. */\n private offsetWithinScroller(el: HTMLElement): number {\n const container = this.scrollContainer.nativeElement as HTMLElement;\n return el.getBoundingClientRect().top - container.getBoundingClientRect().top + container.scrollTop;\n }\n\n private clearTurnTracking(): void {\n this.currentTurnStartMessageId = null;\n this.pendingTurnStartMessageId = null;\n this.bottomFollowSuppressedUntil = 0;\n if (this.turnStartRetryHandle) {\n clearTimeout(this.turnStartRetryHandle);\n this.turnStartRetryHandle = null;\n }\n }\n\n /**\n * Detect and reconcile agent run states against conversation detail statuses.\n * Called after loading a conversation to handle two scenarios:\n *\n * 1. **In-progress catch-up**: If an agent completed between page refresh and\n * WebSocket reconnection, the completion PubSub event is lost. We catch this\n * by comparing message status against the agent run status from the database.\n *\n * 2. **Stale error correction**: If the client previously marked a conversation\n * detail as 'Error' (e.g., due to WebSocket timeout) but the server actually\n * completed successfully, we detect the mismatch and correct it. This prevents\n * the race condition where the client overwrites a server-completed record.\n */\n private async detectAndReconcileAgentRuns(conversationId: string, loadToken: number): Promise<void> {\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.reconnectInProgressRuns(conversationId, loadToken);\n if (!this.isActiveConversationLoad(conversationId, loadToken)) {\n return;\n }\n await this.correctStaleErrorMessages(conversationId, loadToken);\n }\n\n /**\n * Reconnect to in-progress agent runs whose completion events were missed.\n */\n private async reconnectInProgressRuns(conversationId: string, loadToken: number): Promise<void> {\n const inProgressMessages = this.messages.filter(\n m => m.Status === 'In-Progress' && m.Role === 'AI'\n );\n\n if (inProgressMessages.length === 0) {\n return;\n }\n\n LogStatusEx({message: `🔄 Found ${inProgressMessages.length} in-progress messages, checking status...`, verboseOnly: true});\n\n const completedStatuses = ['Completed', 'Failed', 'Error', 'Cancelled'];\n\n for (const message of inProgressMessages) {\n const agentRun = this.AgentRunsByDetailId.get(message.ID);\n\n if (!agentRun) {\n // No agent run yet — fire-and-forget may not have created it.\n // Polling will pick this up once the server creates the run.\n LogStatusEx({message: `⏳ No agent run found for in-progress message ${message.ID}, waiting for server...`, verboseOnly: true});\n continue;\n }\n\n if (completedStatuses.includes(agentRun.Status)) {\n // Agent completed during the WebSocket reconnection gap — handle now\n LogStatusEx({message: `🔄 Agent run ${agentRun.ID} already completed (${agentRun.Status}) for message ${message.ID}, handling catch-up...`, verboseOnly: true});\n await this.handleMessageCompletion(message, agentRun.ID, conversationId, loadToken);\n } else {\n LogStatusEx({message: `🔌 Agent run ${agentRun.ID} still ${agentRun.Status} for message ${message.ID}, WebSocket will receive updates`, verboseOnly: true});\n }\n }\n }\n\n /**\n * Detect conversation details marked as 'Error' by the client whose corresponding\n * agent run actually completed successfully on the server. This corrects the race\n * condition where the client overwrote a server-completed record with an error status.\n */\n private async correctStaleErrorMessages(conversationId: string, loadToken: number): Promise<void> {\n const errorMessages = this.messages.filter(\n m => m.Status === 'Error' && m.Role === 'AI'\n );\n\n if (errorMessages.length === 0) {\n return;\n }\n\n for (const message of errorMessages) {\n const agentRun = this.AgentRunsByDetailId.get(message.ID);\n if (agentRun && agentRun.Status === 'Completed') {\n LogStatusEx({message: `🔧 Correcting stale error: message ${message.ID} shows Error but agent run ${agentRun.ID} completed successfully`, verboseOnly: true});\n await this.handleMessageCompletion(message, agentRun.ID, conversationId, loadToken);\n }\n }\n }\n\n /**\n * Handle pending artifact navigation from collection\n * Opens the artifact and scrolls to the message containing it\n */\n private async handlePendingArtifactNavigation(): Promise<void> {\n if (!this.PendingArtifactId) {\n return; // No pending navigation\n }\n const pendingTargetConversationId = this.PendingArtifactConversationId ?? this.ConversationId;\n if (!this.PendingArtifactId || !this.isActiveConversation(pendingTargetConversationId)) {\n return;\n }\n\n console.log('📦 Processing pending artifact navigation:', this.PendingArtifactId, 'v' + this.PendingArtifactVersionNumber);\n\n // Capture values before emitting consumed event\n const artifactIdToOpen = this.PendingArtifactId;\n const versionNumberToOpen = this.PendingArtifactVersionNumber;\n const conversationId = this.ConversationId;\n\n // Notify parent that we consumed the pending artifact\n this.PendingArtifactConsumed.emit();\n\n // Find the message containing this artifact version\n let messageIdWithArtifact: string | null = null;\n\n for (const [detailId, artifactList] of this.ArtifactsByDetailId.entries()) {\n for (const artifactInfo of artifactList) {\n if (artifactInfo.artifactId === artifactIdToOpen) {\n // Found the artifact - check if version matches (if specified)\n if (versionNumberToOpen == null || artifactInfo.versionNumber === versionNumberToOpen) {\n messageIdWithArtifact = detailId;\n console.log('✅ Found artifact in message:', detailId);\n break;\n }\n }\n }\n if (messageIdWithArtifact) break;\n }\n\n if (!messageIdWithArtifact) {\n console.warn('⚠️ Could not find message containing artifact:', artifactIdToOpen);\n return;\n }\n\n // Open the artifact panel\n this.artifactSelectionEpoch++;\n this.SelectedArtifactId = artifactIdToOpen;\n this.SelectedVersionNumber = versionNumberToOpen ?? undefined;\n this.ShowArtifactPanel = true;\n\n // Load permissions for the artifact\n await this.loadArtifactPermissions(artifactIdToOpen, conversationId, artifactIdToOpen);\n if (!this.isActiveConversation(conversationId) || !UUIDsEqual(this.SelectedArtifactId, artifactIdToOpen)) {\n return;\n }\n this.cdr.detectChanges();\n\n // Scroll to the message\n this.scrollToMessage(messageIdWithArtifact);\n\n console.log('✅ Opened artifact and scrolled to message:', messageIdWithArtifact);\n }\n\n /**\n * Scroll to a specific message in the conversation\n * @param messageId The conversation detail ID to scroll to\n */\n private scrollToMessage(messageId: string): void {\n // Wait for DOM to update, then scroll\n setTimeout(() => {\n const messageElement = document.querySelector(`[data-message-id=\"${messageId}\"]`);\n if (messageElement) {\n messageElement.scrollIntoView({ behavior: 'smooth', block: 'center' });\n console.log('📍 Scrolled to message:', messageId);\n } else {\n console.warn('⚠️ Message element not found for ID:', messageId);\n }\n }, 300); // Give time for artifact panel to open and DOM to render\n }\n\n /**\n * Handle intent check started - show temporary \"Analyzing intent...\" message\n */\n async OnIntentCheckStarted(event: {conversationId: string}): Promise<void> {\n // Guard: ignore intent-check UI from a background conversation's input after a swap,\n // so the \"Analyzing...\" placeholder isn't injected into the displayed conversation.\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n const md = this.ProviderToUse;\n const tempMessage = await md.GetEntityObject<MJConversationDetailEntity>('MJ: Conversation Details', this.CurrentUser);\n\n // Create a temporary message that looks like an AI response in-progress\n tempMessage.Message = '🔍 Analyzing your request to determine the best agent...';\n tempMessage.Role = 'AI';\n tempMessage.Status = 'In-Progress';\n // Set created date using LoadFromData to bypass read-only protection\n tempMessage.LoadFromData({\n Message: tempMessage.Message,\n Role: tempMessage.Role,\n Status: tempMessage.Status,\n __mj_CreatedAt: new Date()\n });\n // No ID means it's temporary (won't be saved)\n\n this.intentCheckMessage = tempMessage;\n this.messages = [...this.messages, tempMessage];\n this.followTranscript('new', tempMessage);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnIntentCheckStarted}. */\n async onIntentCheckStarted(event: {conversationId: string}): Promise<void> {\n return this.OnIntentCheckStarted(event);\n }\n\n /**\n * Handle intent check completed - remove temporary message\n */\n OnIntentCheckCompleted(event: {conversationId: string}): void {\n // Guard (symmetric with onIntentCheckStarted): ignore a background conversation's\n // intent-check completion after a swap. Without this, a late completion from the\n // conversation the user just left would remove the ACTIVE conversation's own\n // \"Analyzing...\" placeholder (intentCheckMessage is a single shared field).\n if (!this.isActiveConversation(event.conversationId)) {\n return;\n }\n if (this.intentCheckMessage) {\n // Remove the temporary intent check message\n this.messages = this.messages.filter(m => m !== this.intentCheckMessage);\n this.intentCheckMessage = null;\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link OnIntentCheckCompleted}. */\n onIntentCheckCompleted(event: {conversationId: string}): void {\n return this.OnIntentCheckCompleted(event);\n }\n}\n","<div class=\"chat-area\">\n <!-- agentPresence slot — sticky top, anchored with the header. Per Matt's\n 06-10 design: persistent presence indicator (Sid's face + live voice\n state). Off by default; opt in via [showAgentCharacter]. When a\n consumer projects an `mjChatSlot=\"agentPresence\"` template, it\n replaces the default presence component. -->\n @if (showAgentCharacter) {\n <div class=\"chat-agent-presence\" [class.chat-agent-presence--prominent]=\"agentCharacterConfig?.voiceStateMode === 'prominent'\">\n @if (slotTemplate('agentPresence'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: agentCharacterConfig,\n state: agentCharacterConfig?.state ?? 'idle',\n agentName: agentCharacterConfig?.characterName,\n avatarUrl: agentCharacterConfig?.avatarUrl,\n mode: agentCharacterConfig?.voiceStateMode ?? 'subtle'\n }\"></ng-container>\n } @else {\n <mj-chat-agent-presence-default\n [State]=\"agentCharacterConfig?.state ?? 'idle'\"\n [AgentName]=\"agentCharacterConfig?.characterName\"\n [AvatarUrl]=\"agentCharacterConfig?.avatarUrl\"\n [Mode]=\"agentCharacterConfig?.voiceStateMode ?? 'subtle'\">\n </mj-chat-agent-presence-default>\n }\n </div>\n }\n\n <!-- header slot — replaces the entire chat-header chrome (title, badges,\n export/share/agent-picker buttons). When projected, the consumer owns\n the entire header rendering; the default chrome below is bypassed\n wholesale. Context exposes the minimal IMJChatHeaderComponent shape;\n consumers needing more app state should bind to chat-area inputs\n directly via @ViewChild or wrap the whole component. -->\n @if (slotTemplate('header'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n conversationTitle: conversation?.Name ?? null,\n sharedBy: sharedByBadge?.display ?? null,\n artifactCount: artifactCountDisplay,\n showArtifactIndicator: showArtifactIndicator\n }\"></ng-container>\n } @else if (conversation || HasPreConversationHeader) {\n <!-- Default header — also renders BEFORE a conversation exists when the\n embedder has pre-conversation chrome to surface (currently just the\n mode picker — agent / share / export / members / artifacts all\n require a conversation row and stay hidden). Lets embedded surfaces\n like the Form Builder cockpit show the mode picker above the\n empty-state on a fresh chat instead of waiting for the first\n message to round-trip. -->\n <div class=\"chat-header\">\n <div class=\"chat-info\" [class.with-sidebar-toggle]=\"showSidebarToggle\">\n @if (showSidebarToggle) {\n <button class=\"sidebar-toggle-btn\"\n (click)=\"sidebarToggleClicked.emit()\"\n title=\"Show conversations\">\n <i class=\"fas fa-table-columns\"></i>\n </button>\n }\n @if (conversation) {\n <div class=\"chat-title\">{{ conversation.Name || '' }}</div>\n }\n @if (sharedByBadge) {\n <span class=\"shared-by-badge\" [title]=\"sharedByBadge.fullTooltip\">\n <i class=\"fas fa-share-nodes\"></i>\n <span>Shared by {{ sharedByBadge.display }}</span>\n </span>\n }\n @if (conversation?.ProjectID) {\n <button class=\"project-tag\" (click)=\"openProjectSelector()\" title=\"Assign to project\">\n <i class=\"fas fa-folder\"></i>\n <span>{{ conversation!.Project || 'Project' }}</span>\n </button>\n }\n @if (conversation?.TestRunID) {\n <button class=\"test-indicator\" (click)=\"viewTestRun(conversation!.TestRunID!)\" title=\"View Test Run\">\n <i class=\"fas fa-flask\"></i>\n <span>Test</span>\n </button>\n }\n </div>\n <div class=\"chat-actions chat-actions-buttons\">\n @if (allowPinning && pinnedMessageCount > 0) {\n <button class=\"pin-chip\" [class.active]=\"showPinsPanel\" (click)=\"TogglePinsPanel()\" title=\"View pinned messages\">\n <i class=\"fas fa-thumbtack\"></i>\n <span class=\"pin-chip-count\">{{ pinnedMessageCount }}</span>\n </button>\n }\n @if (showArtifactIndicator && artifactCountDisplay > 0) {\n <button class=\"artifact-indicator\" (click)=\"viewArtifacts()\" title=\"View artifacts\">\n <i class=\"fas fa-cube\"></i>\n <span class=\"artifact-badge\">{{ artifactCountDisplay }}</span>\n </button>\n }\n @if (memberCount > 1) {\n <button class=\"chat-members\" (click)=\"toggleMembersModal()\" title=\"View members\">\n <i class=\"fas fa-users\"></i>\n <span class=\"members-badge\">{{ memberCount }}</span>\n </button>\n }\n @if (!overlayMode && showAgentModePicker && ModePickerTargetAgentId) {\n <!-- Per-agent mode/quality picker (Draft / Standard / High).\n Targets the agent the next non-mention message will route\n to. Auto-hides when that agent has fewer than 2 configured\n presets. Choice persists per-user, per-agent via\n UserInfoEngine; emits the picked configuration ID up so\n <mj-message-input> can forward it on the next route.\n Hidden in overlayMode (the compact chat overlay): the\n mode dropdown wastes the narrow top-right space there. -->\n <mj-conversation-mode-picker\n [AgentID]=\"ModePickerTargetAgentId\"\n [Disabled]=\"isProcessing\"\n (PresetChanged)=\"OnAgentModePresetChanged($event)\">\n </mj-conversation-mode-picker>\n }\n @if (showAgentPicker && conversation) {\n <!-- Per-conversation default-agent pin. When set, non-mention\n messages route to this agent instead of Sage. Persists to\n MJConversationEntity.DefaultAgentID. Hidden when no\n conversation is loaded or when the embedder disables it. -->\n <mj-conversation-agent-picker\n [Conversation]=\"conversation\"\n [CurrentUser]=\"currentUser\"\n [AllowedAgentIDs]=\"AllowedAgentIDs\"\n [Disabled]=\"isReadOnlyView\">\n </mj-conversation-agent-picker>\n }\n @if (showExportButton) {\n <button mjButton variant=\"flat\" size=\"sm\" (click)=\"exportConversation()\" [title]=\"exportButtonLabel + ' conversation'\">\n <i [class]=\"exportButtonIcon\"></i>\n <span class=\"btn-label\">{{ exportButtonLabel }}</span>\n </button>\n }\n @if (showShareButton && canShareConversation) {\n <button mjButton variant=\"flat\" size=\"sm\"\n [class.shared]=\"isShared\"\n (click)=\"shareConversation()\"\n [title]=\"isShared ? 'Manage sharing' : 'Share conversation'\">\n <i class=\"fas fa-share-nodes\"></i>\n <span class=\"btn-label\">Share</span>\n </button>\n }\n <!-- headerActions slot — ADDITIVE host buttons rendered after the stock\n actions (unlike the `header` slot, which replaces the whole header\n and therefore never reaches this branch). For visual parity,\n projected buttons should use mjButton variant=\"flat\" size=\"sm\". -->\n @if (slotTemplate('headerActions'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n conversationId: conversationId,\n isProcessing: isProcessing\n }\"></ng-container>\n }\n </div>\n </div>\n }\n\n <!-- Messages and Artifact Split Layout — restructures into [stage | rail]\n when isDemonstrationActive (per Matt's 06-10 design). The .demonstration-mode\n class drives the CSS Grid switch; the stage container renders only when the\n slot is projected AND the host opts in via [showDemonstrationSurface]. -->\n <div class=\"chat-content-area\" [class.demonstration-mode]=\"isDemonstrationActive\">\n <!-- demonstrationSurface stage — takes the main pane; messages shrink to\n a side rail (or move below on mobile). Off unless both\n [showDemonstrationSurface] is true AND a slot template is projected. -->\n @if (isDemonstrationActive) {\n <div class=\"chat-demonstration-stage\">\n <ng-container *ngTemplateOutlet=\"slotTemplate('demonstrationSurface'); context: {\n $implicit: demonstrationSurfaceContent,\n content: demonstrationSurfaceContent,\n visible: showDemonstrationSurface\n }\"></ng-container>\n </div>\n }\n\n <!-- Messages Pane -->\n <div class=\"chat-messages-pane\"\n [class.full-width]=\"!showArtifactPanel\"\n [class.hidden]=\"isArtifactPaneMaximized\">\n @if (isLoadingConversation) {\n <!-- Loading State - checked FIRST to prevent empty state flash. The branch\n always short-circuits the panes below; showLoadingState only controls\n whether the built-in spinner renders (hosts with their own loading\n chrome set it false and get a blank pane instead). -->\n @if (showLoadingState) {\n <div class=\"conversation-loading-state\">\n <mj-loading text=\"Loading conversation...\" size=\"large\"></mj-loading>\n </div>\n }\n } @else if ((isNewConversation || !conversationId) && !suppressNewConversationEmptyState) {\n <!-- emptyState slot — when a consumer projects mjChatSlot=\"emptyState\",\n they take over the entire empty-state region (including any send\n affordance — the slot interface doesn't include a sendMessage\n output, so consumers handle send via their own input). When no\n slot is projected, the rich built-in <mj-conversation-empty-state>\n renders with its own greeting, prompt chips, and message input.\n emptyStateConfig (when supplied) takes precedence over the legacy\n [emptyStateGreeting] string for backwards compatibility. -->\n @if (slotTemplate('emptyState'); as t) {\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: emptyStateConfig,\n greeting: emptyStateConfig?.greeting ?? emptyStateGreeting,\n subtext: emptyStateConfig?.subtext,\n suggestedPrompts: emptyStateConfig?.suggestedPrompts ?? []\n }\"></ng-container>\n } @else {\n <mj-conversation-empty-state\n [currentUser]=\"currentUser\"\n [initialDraft]=\"GetInitialDraftFor(null)\"\n (initialDraftApplied)=\"OnComposerDraftApplied()\"\n (DraftStateChanged)=\"OnDraftStateChanged(null, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [disabled]=\"isProcessing\"\n [showSidebarToggle]=\"showSidebarToggle\"\n [overlayMode]=\"overlayMode\"\n [greeting]=\"emptyStateConfig?.greeting ?? emptyStateGreeting\"\n [showSuggestedPrompts]=\"showSuggestedPrompts\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [AllowedAgentIDs]=\"AllowedAgentIDs\"\n [MentionPeople]=\"MentionPeople\"\n [ComposerExtraTemplate]=\"slotTemplate('composerExtra')\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n (sidebarToggleClicked)=\"sidebarToggleClicked.emit()\"\n (messageSent)=\"onEmptyStateMessageSent($event)\">\n </mj-conversation-empty-state>\n }\n } @else if ((isNewConversation || !conversationId) && suppressNewConversationEmptyState) {\n <!-- Pre-conversation normal-view: empty message list + emptyStateMode input.\n Used when host (e.g. Form Builder cockpit) wants the header + mode picker\n visible on first open instead of the centered welcome card. First send\n routes through onEmptyStateMessageSent which creates the conversation. -->\n <div class=\"chat-messages-wrapper\">\n <div class=\"chat-messages-container\"></div>\n <div class=\"chat-input-container\">\n <!-- composerExtra slot — host UI directly above the composer (IMJChatComposerExtraContext). -->\n @if (slotTemplate('composerExtra'); as t) {\n <div class=\"chat-composer-extra\">\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n ConversationId: conversationId,\n IsProcessing: isProcessing\n }\"></ng-container>\n </div>\n }\n <div class=\"message-input-container-wrapper\">\n <mj-message-input\n #emptyStateInput\n [emptyStateMode]=\"true\"\n [initialDraft]=\"GetInitialDraftFor(null)\"\n (initialDraftApplied)=\"OnComposerDraftApplied()\"\n (DraftStateChanged)=\"OnDraftStateChanged(null, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [currentUser]=\"currentUser\"\n [disabled]=\"isProcessing\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [enablePlanMode]=\"allowPlanMode\"\n [enableRealtime]=\"allowRealtime\"\n [AllowedAgentIDs]=\"AllowedAgentIDs\"\n [MentionPeople]=\"MentionPeople\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n (emptyStateSubmit)=\"onEmptyStateMessageSent($event)\">\n </mj-message-input>\n </div>\n </div>\n </div>\n } @else {\n <!-- Normal Message View -->\n <div class=\"chat-messages-wrapper\">\n <!-- Upload Indicator Overlay (centered in conversation area) -->\n @if (isUploadingAttachments) {\n <div class=\"upload-indicator-overlay\">\n <mj-loading [text]=\"uploadingMessage\" size=\"medium\"></mj-loading>\n </div>\n }\n <div class=\"chat-messages-container\" #scrollContainer (scroll)=\"checkScroll()\">\n <mj-conversation-message-list\n [showEmptyFill]=\"showEmptyFill\"\n [showDateNavigation]=\"showDateNavigation\"\n [showAgentRunDetails]=\"showAgentRunDetails\"\n [showReactions]=\"showReactions\"\n [showMessageRating]=\"showMessageRating\"\n [allowPinning]=\"allowPinning\"\n [allowMessageEdit]=\"allowMessageEdit\"\n [allowMessageDelete]=\"allowMessageDelete\"\n [assistantDisplayName]=\"assistantDisplayName\"\n [assistantAvatarUrl]=\"assistantAvatarUrl\"\n [messages]=\"messages\"\n [HasMoreAbove]=\"hasMoreMessagesAbove\"\n [IsLoadingOlder]=\"isLoadingOlderMessages\"\n [ScrollRoot]=\"messageScrollRoot\"\n (OlderRequested)=\"onOlderMessagesRequested()\"\n (DateJumpRequested)=\"onDateJumpRequested($event)\"\n [conversation]=\"conversation\"\n [currentUser]=\"currentUser\"\n [isProcessing]=\"isProcessing\"\n [artifactMap]=\"effectiveArtifactsMap\"\n [agentRunMap]=\"agentRunsByDetailId\"\n [ratingsMap]=\"ratingsByDetailId\"\n [userAvatarMap]=\"userAvatarMap\"\n [attachmentsMap]=\"attachmentsByDetailId\"\n [messageRendererTemplate]=\"slotTemplate('messageRenderer')\"\n [messageExtraTemplate]=\"slotTemplate('messageExtra')\"\n [sessionMetaMap]=\"realtimeSessionMetaMap\"\n (realtimeSessionOpenRequested)=\"OpenRealtimeSessionReview($event)\"\n (replyInThread)=\"onReplyInThread($event)\"\n (viewThread)=\"onViewThread($event)\"\n (deleteMessage)=\"onDeleteMessage($event)\"\n (retryMessage)=\"onRetryMessage($event)\"\n (testFeedbackMessage)=\"onTestFeedbackMessage($event)\"\n (artifactClicked)=\"onArtifactClicked($event)\"\n (messageEdited)=\"onMessageEdited($event)\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (suggestedResponseSelected)=\"onSuggestedResponseSelected($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\"\n (diagnosticRequested)=\"onDiagnosticRequested($event)\"\n (messagePinToggled)=\"onMessagePinToggled($event)\"\n (beforeResponseFormSubmitted)=\"beforeResponseFormSubmitted.emit($event)\"\n (afterResponseFormSubmitted)=\"afterResponseFormSubmitted.emit($event)\">\n </mj-conversation-message-list>\n\n <!-- Scroll to Bottom Icon (positioned within scroll container for proper centering) -->\n @if (showScrollToBottomIcon && messages && messages.length > 0) {\n <span class=\"scroll-to-bottom-icon\" style=\"left: 50%;\"\n (click)=\"scrollToBottomAnimate()\">\n <i class=\"fas fa-arrow-down\"></i>\n </span>\n }\n </div>\n\n <!-- Fixed Input Area -->\n <div class=\"chat-input-container\">\n @if (isLoadingPeripheralData) {\n <!-- Loading State -->\n <div class=\"loading-peripheral-placeholder\">\n <mj-loading text=\"Loading conversation data...\" size=\"medium\"></mj-loading>\n </div>\n } @else {\n @if (isReadOnlyView) {\n <div class=\"read-only-banner\" role=\"status\">\n <i class=\"fas fa-eye\"></i>\n <span>You have view-only access to this conversation.</span>\n </div>\n }\n <!-- composerExtra slot — host UI directly above the composer (IMJChatComposerExtraContext). -->\n @if (slotTemplate('composerExtra'); as t) {\n <div class=\"chat-composer-extra\">\n <ng-container *ngTemplateOutlet=\"t; context: {\n $implicit: conversation,\n ConversationId: conversationId,\n IsProcessing: isProcessing\n }\"></ng-container>\n </div>\n }\n <!-- Input Component - Multiple instances cached, only one visible -->\n <div class=\"message-input-container-wrapper\">\n @for (inputRef of getCachedInputs(); track inputRef.conversationId) {\n <mj-message-input\n #messageInput\n [hidden]=\"inputRef.conversationId !== conversationId\"\n [initialDraft]=\"GetInitialDraftFor(inputRef.conversationId)\"\n (DraftStateChanged)=\"OnDraftStateChanged(inputRef.conversationId, $event)\"\n (ComposerBlurred)=\"OnComposerBlurred()\"\n [conversationId]=\"inputRef.conversationId\"\n [conversationName]=\"inputRef.conversationName\"\n [currentUser]=\"currentUser\"\n [conversationHistory]=\"inputRef.conversationId === conversationId ? messages : []\"\n [artifactsByDetailId]=\"inputRef.conversationId === conversationId ? artifactsByDetailId : emptyArtifactsMap\"\n [systemArtifactsByDetailId]=\"inputRef.conversationId === conversationId ? systemArtifactsByDetailId : emptyArtifactsMap\"\n [agentRunsByDetailId]=\"inputRef.conversationId === conversationId ? agentRunsByDetailId : emptyAgentRunsMap\"\n [appContext]=\"appContext\"\n [applicationId]=\"applicationId\"\n [defaultAgentId]=\"defaultAgentId\"\n [conversationDefaultAgentId]=\"inputRef.conversationId === conversationId ? (conversation?.DefaultAgentID ?? null) : null\"\n [agentConfigurationPresetId]=\"inputRef.conversationId === conversationId ? ActiveAgentConfigurationPresetId : null\"\n [AgentReplyMode]=\"AgentReplyMode\"\n [AllowedAgentIDs]=\"AllowedAgentIDs\"\n [MentionPeople]=\"MentionPeople\"\n [AgentHistoryFrom]=\"AgentHistoryFrom\"\n [AgentTurnHandler]=\"AgentTurnHandler\"\n [AutoNameConversation]=\"AutoNameConversation\"\n [inProgressMessageIds]=\"inputRef.conversationId === conversationId ? inProgressMessageIds : emptyInProgressIds\"\n [disabled]=\"isProcessing || isReadOnlyView\"\n [enableAttachments]=\"enableAttachments && allowAttachments\"\n [enableMentions]=\"allowMentions\"\n [enableAgentMentions]=\"allowAgentMentions\"\n [enableEntityMentions]=\"allowEntityMentions\"\n [enableSkillCommands]=\"allowSkillCommands\"\n [enablePlanMode]=\"allowPlanMode\"\n [enableRealtime]=\"allowRealtime\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [initialMessage]=\"shouldDeliverPendingMessageTo(inputRef.conversationId) ? pendingMessage : null\"\n [initialAttachments]=\"shouldDeliverPendingMessageTo(inputRef.conversationId) ? pendingAttachments : null\"\n (initialMessageAutoSendStarted)=\"onInitialMessageAutoSendStarted($event)\"\n (initialMessageAutoSendFailed)=\"onInitialMessageAutoSendFailed($event)\"\n (messageSent)=\"onMessageSent($event)\"\n (agentResponse)=\"onAgentResponse($event)\"\n (agentRunDetected)=\"onAgentRunDetected($event)\"\n (agentRunUpdate)=\"onAgentRunUpdate($event)\"\n (messageComplete)=\"onMessageComplete($event)\"\n (artifactCreated)=\"onArtifactCreated($event)\"\n (conversationRenamed)=\"onConversationRenamed($event)\"\n (intentCheckStarted)=\"onIntentCheckStarted($event)\"\n (intentCheckCompleted)=\"onIntentCheckCompleted($event)\"\n (beforeAgentTurn)=\"beforeAgentTurn.emit($event)\"\n (afterAgentTurn)=\"afterAgentTurn.emit($event)\"\n (uploadStateChanged)=\"onUploadStateChanged($event)\">\n </mj-message-input>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- Artifact Viewer Pane -->\n @if (showArtifactPanel && selectedArtifactId) {\n @if (!isArtifactPaneMaximized) {\n <div class=\"resize-handle\" (mousedown)=\"onResizeStart($event)\" (touchstart)=\"onResizeTouchStart($event)\"></div>\n }\n <div class=\"chat-artifact-pane\"\n [style.width.%]=\"artifactPaneWidth\"\n [class.maximized]=\"isArtifactPaneMaximized\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [versionNumber]=\"selectedVersionNumber\"\n [viewContext]=\"'conversation'\"\n [canShare]=\"canShareSelectedArtifact\"\n [canEdit]=\"canEditSelectedArtifact\"\n [isMaximized]=\"isArtifactPaneMaximized\"\n [refreshTrigger]=\"artifactViewerRefresh$\"\n (closed)=\"onCloseArtifactPanel()\"\n (saveToCollectionRequested)=\"onSaveToCollectionRequested($event)\"\n (navigateToLink)=\"onArtifactLinkNavigation($event)\"\n (shareRequested)=\"onArtifactShareRequested($event)\"\n (maximizeToggled)=\"toggleMaximizeArtifactPane()\"\n (openEntityRecord)=\"onOpenEntityRecord($event)\"\n (navigationRequest)=\"onNavigationRequest($event)\"\n (analyzeRequested)=\"OnAnalyzeArtifact($event)\"\n (applyFormRequested)=\"OnApplyFormRequested($event)\">\n </mj-artifact-viewer-panel>\n </div>\n }\n\n <!-- Artifact Share Modal -->\n <mj-artifact-share-modal\n [isOpen]=\"isArtifactShareModalOpen\"\n [artifact]=\"artifactToShare\"\n [currentUser]=\"currentUser\"\n (saved)=\"onArtifactShared()\"\n (cancelled)=\"onArtifactShareModalClose()\">\n </mj-artifact-share-modal>\n\n <!-- Pinned Messages Panel (overlay) -->\n @if (allowPinning && showPinsPanel) {\n <mj-pinned-messages-panel\n [pinnedMessages]=\"pinnedMessages\"\n [isLoading]=\"isLoadingPins\"\n (closed)=\"showPinsPanel = false\"\n (jumpRequested)=\"onJumpToMessage($event)\"\n (unpinRequested)=\"onUnpinFromPanel($event)\">\n </mj-pinned-messages-panel>\n }\n </div>\n\n <!-- Live voice \"call mode\" overlay — fills this conversation panel in place\n (header + thread + composer) while a realtime session is active. When the\n call is MINIMIZED (e.g. a dev link navigated to a record) the overlay HIDES\n (not destroyed — its merged session state must survive), the session stays\n fully live, and a floating \"on call\" pill offers the way back.\n ALSO hosted in SESSION REVIEW mode (RealtimeReview set, no live call): the\n overlay renders what went down in a PAST session, with a \"Start live session\"\n button that resumes it as a new call. -->\n @if ((RealtimeSession.Active$ | async) || RealtimeReview) {\n <mj-realtime-session-overlay\n [AgentName]=\"realtimeOverlayAgentName\"\n [Hidden]=\"(RealtimeSession.Minimized$ | async) === true\"\n [CurrentUser]=\"currentUser\"\n [EnvironmentID]=\"environmentId\"\n [ReviewData]=\"RealtimeReview\"\n [Chrome]=\"overlayMode ? 'orb' : 'auto'\"\n [Compact]=\"overlayMode\"\n [ShowDevLinks]=\"!overlayMode\"\n [ShowDensityPicker]=\"!overlayMode\"\n (NavigateRequest)=\"onRealtimeNavigateRequest($event)\"\n (StartLiveRequested)=\"onReviewStartLive($event)\"\n (ReviewClosed)=\"onReviewClosed()\">\n </mj-realtime-session-overlay>\n @if (RealtimeSession.Minimized$ | async) {\n <button type=\"button\" class=\"voice-call-pill\" (click)=\"RealtimeSession.SetMinimized(false)\"\n title=\"Return to the live call\" aria-label=\"Return to the live call\">\n <span class=\"voice-call-pill__pulse\" aria-hidden=\"true\"></span>\n <i class=\"fa-solid fa-phone-volume\" aria-hidden=\"true\"></i>\n <span class=\"voice-call-pill__text\">\n <span class=\"voice-call-pill__name\">On call · {{ RealtimeSession.CurrentAgentName }}</span>\n <span class=\"voice-call-pill__hint\">Tap to return</span>\n </span>\n </button>\n }\n }\n</div>\n\n<!-- Thread Panel -->\n@if (threadId) {\n <mj-thread-panel\n [parentMessageId]=\"threadId\"\n [conversationId]=\"conversationId || ''\"\n [currentUser]=\"currentUser\"\n (closed)=\"onLocalThreadClosed()\"\n (replyAdded)=\"onThreadReplyAdded($event)\">\n </mj-thread-panel>\n}\n\n<!-- Export Modal -->\n<!-- [branding] is bound BEFORE [isVisible] deliberately: Angular sets inputs in\n template order within a change-detection pass, and the modal's isVisible setter\n reads `branding` to default its \"Include branding\" checkbox on a fresh open. -->\n<mj-export-modal\n [branding]=\"exportBranding\"\n [isVisible]=\"showExportModal\"\n [conversation]=\"conversation || undefined\"\n [currentUser]=\"currentUser\"\n (cancelled)=\"onExportModalCancelled()\"\n (exported)=\"onExportModalComplete()\">\n</mj-export-modal>\n\n<!-- Share Dialog (generic, shared with dashboards) -->\n<mj-resource-share-dialog\n [Visible]=\"showShareModal\"\n [Context]=\"shareContext\"\n [Adapter]=\"shareAdapter\"\n (Result)=\"onShareDialogResult($event)\">\n</mj-resource-share-dialog>\n\n<!-- Members Modal -->\n<mj-members-modal\n [isVisible]=\"showMembersModal\"\n [conversation]=\"conversation || undefined\"\n [currentUser]=\"currentUser\"\n (cancelled)=\"showMembersModal = false\"\n (membersChanged)=\"showMembersModal = false\">\n</mj-members-modal>\n\n<!-- Project Selector Modal -->\n@if (showProjectSelector && conversation) {\n <div class=\"modal-overlay\" (click)=\"showProjectSelector = false\">\n <div class=\"modal-content project-selector-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>Assign Project</h3>\n <button class=\"modal-close-btn\" (click)=\"showProjectSelector = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"modal-body\">\n <mj-project-selector\n [environmentId]=\"environmentId\"\n [currentUser]=\"currentUser\"\n [selectedProjectId]=\"conversation.ProjectID\"\n (projectSelected)=\"onProjectSelected($event)\">\n </mj-project-selector>\n </div>\n </div>\n </div>\n}\n\n<!-- Artifacts Modal -->\n@if (showArtifactsModal) {\n <div class=\"modal-overlay\" (click)=\"showArtifactsModal = false\">\n <div class=\"modal-content artifacts-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>Conversation Artifacts</h3>\n <div class=\"modal-header-actions\">\n @if (hasSystemArtifacts) {\n <button class=\"toggle-system-btn\"\n [class.active]=\"showSystemArtifacts\"\n (click)=\"toggleSystemArtifacts()\"\n title=\"Toggle system artifacts visibility\">\n <i class=\"fas fa-cog\"></i>\n <span>{{ showSystemArtifacts ? 'Hide' : 'Show' }} System</span>\n </button>\n }\n <button class=\"modal-close-btn\" (click)=\"showArtifactsModal = false\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n <div class=\"modal-body artifacts-grid\">\n @if (artifactsByDetailId.size === 0) {\n <mj-empty-state\n class=\"artifacts-empty-fill\"\n Icon=\"fa-solid fa-cube\"\n Title=\"No artifacts in this conversation yet\" />\n }\n @for (artifact of getArtifactsArray(); track artifact.artifactId) {\n <div class=\"artifact-modal-card\"\n [class.expanded]=\"expandedArtifactId === artifact.artifactId\"\n [class.system-artifact]=\"artifact.visibility === 'System Only'\">\n <!-- Main card header - click to open latest version -->\n <div class=\"artifact-card-header\" (click)=\"openArtifactFromModal(artifact.artifactId)\">\n <div class=\"artifact-modal-icon\">\n <i class=\"fas fa-file-code\"></i>\n </div>\n <div class=\"artifact-modal-info\">\n <div class=\"artifact-modal-title\">{{artifact.name}}</div>\n <div class=\"artifact-modal-meta\">\n @if (artifact.versionCount > 1) {\n {{artifact.versionCount}} versions\n } @else {\n 1 version\n }\n </div>\n </div>\n @if (artifact.versionCount > 1) {\n <button class=\"expand-btn\" (click)=\"toggleArtifactExpansion(artifact.artifactId, $event)\">\n <i class=\"fas\" [class.fa-chevron-down]=\"expandedArtifactId !== artifact.artifactId\"\n [class.fa-chevron-up]=\"expandedArtifactId === artifact.artifactId\"></i>\n </button>\n }\n <div class=\"artifact-modal-action\">\n <i class=\"fas fa-external-link-alt\"></i>\n </div>\n </div>\n\n <!-- Expanded version list -->\n @if (expandedArtifactId === artifact.artifactId && artifact.versionCount > 1) {\n <div class=\"artifact-versions-list\">\n @for (version of artifact.versions; track version.versionId) {\n <div class=\"artifact-version-item\" (click)=\"openArtifactFromModal(artifact.artifactId, version.versionNumber); $event.stopPropagation()\">\n <span class=\"version-badge\">v{{version.versionNumber}}</span>\n <span class=\"version-open-text\">Open this version</span>\n <i class=\"fas fa-arrow-right\"></i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n}\n\n<!-- Collection Picker Modal -->\n@if (showCollectionPicker) {\n <mj-artifact-collection-picker-modal\n [isOpen]=\"showCollectionPicker\"\n [environmentId]=\"environmentId\"\n [currentUser]=\"currentUser\"\n [excludeCollectionIds]=\"collectionPickerExcludedIds\"\n [artifactVersionId]=\"collectionPickerVersionId\"\n [artifactName]=\"collectionPickerArtifactName\"\n [artifactVersionNumber]=\"collectionPickerVersionNumber\"\n (completed)=\"onCollectionPickerCompleted($event)\"\n (cancelled)=\"onCollectionPickerCancelled()\">\n </mj-artifact-collection-picker-modal>\n}\n\n<!-- Test Feedback Dialog -->\n@if (testFeedbackDialogData) {\n <mj-test-feedback-dialog\n [data]=\"testFeedbackDialogData\"\n [visible]=\"showTestFeedbackDialog\"\n (closed)=\"onTestFeedbackDialogClosed($event)\">\n </mj-test-feedback-dialog>\n}\n\n<!-- Image Viewer Modal -->\n@if (showImageViewer) {\n <mj-image-viewer\n [imageUrl]=\"selectedImageUrl\"\n [alt]=\"selectedImageAlt\"\n [fileName]=\"selectedImageFileName\"\n [visible]=\"showImageViewer\"\n (closed)=\"onImageViewerClosed()\">\n </mj-image-viewer>\n}\n"]}
|