@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":"artifact-panel-action.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/artifact-panel-action.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iGAAiG;IACjG,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAA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
|
|
5
5
|
* Keys are NORMALIZED UUIDs, so lookups are case-insensitive by construction (SQL Server returns
|
|
6
6
|
* upper case, PostgreSQL lower) at O(1) rather than by scanning every key for a `UUIDsEqual` hit.
|
|
7
7
|
*/
|
|
8
|
-
export function
|
|
8
|
+
export function SnapshotArtifactVersions(refs) {
|
|
9
9
|
const latest = new Map();
|
|
10
10
|
for (const ref of refs) {
|
|
11
11
|
const key = NormalizeUUID(ref.artifactId);
|
|
@@ -13,6 +13,10 @@ export function snapshotArtifactVersions(refs) {
|
|
|
13
13
|
}
|
|
14
14
|
return latest;
|
|
15
15
|
}
|
|
16
|
+
/** @deprecated Use {@link SnapshotArtifactVersions}. */
|
|
17
|
+
export function snapshotArtifactVersions(refs) {
|
|
18
|
+
return SnapshotArtifactVersions(refs);
|
|
19
|
+
}
|
|
16
20
|
/** Same reduction as {@link snapshotArtifactVersions}, keeping the timestamp for ordering. */
|
|
17
21
|
function latestByArtifact(refs) {
|
|
18
22
|
const latest = new Map();
|
|
@@ -74,7 +78,7 @@ function bestCandidate(entries) {
|
|
|
74
78
|
* @param input.userChangedSelection - Defaults to false. True when the user picked or closed an
|
|
75
79
|
* artifact while the turn was in flight; the panel is then left where they put it.
|
|
76
80
|
*/
|
|
77
|
-
export function
|
|
81
|
+
export function DecideArtifactPanelAction(input) {
|
|
78
82
|
const after = latestByArtifact(input.after);
|
|
79
83
|
const entries = [...after.entries()];
|
|
80
84
|
const baselineComparable = input.baselineComparable !== false;
|
|
@@ -119,4 +123,8 @@ export function decideArtifactPanelAction(input) {
|
|
|
119
123
|
const latest = bestCandidate(bumped);
|
|
120
124
|
return { kind: 'open', artifactId: latest.artifactId, versionNumber: latest.versionNumber };
|
|
121
125
|
}
|
|
126
|
+
/** @deprecated Use {@link DecideArtifactPanelAction}. */
|
|
127
|
+
export function decideArtifactPanelAction(input) {
|
|
128
|
+
return DecideArtifactPanelAction(input);
|
|
129
|
+
}
|
|
122
130
|
//# sourceMappingURL=artifact-panel-action.js.map
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C,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAErE,IAAI,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAE9G,gGAAgG;IAChG,kDAAkD;IAClD,IAAI,CAAC,kBAAkB;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAEjD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["import { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';\n\nexport interface ArtifactVersionRef {\n artifactId: string;\n versionNumber: number;\n /**\n * When that version row was created. Used ONLY to order candidates against each other, never\n * compared against the client clock — the values come from one database, so their relative\n * order is meaningful even though the absolute offset from the browser's clock is not.\n */\n versionCreatedAt?: Date | null;\n}\n\n/**\n * What the chat area records before a turn so it can later tell whether the artifact population\n * changed BECAUSE of that turn. See `snapshotArtifactPanelBaseline` in the chat area for why the\n * version map on its own is not a sufficient baseline.\n */\nexport interface ArtifactPanelBaseline {\n /** artifactId → highest version, from {@link snapshotArtifactVersions}. */\n versions: Map<string, number>;\n /** The conversation on screen when the snapshot was taken. */\n conversationId: string | null;\n /** The conversation whose artifacts the map was actually holding, or null if none had loaded. */\n mapConversationId: string | null;\n /** Paging-merge counter at snapshot time. */\n mapGeneration: number;\n /** User-selection counter at snapshot time. */\n selectionEpoch: number;\n}\n\nexport type ArtifactPanelAction =\n | { kind: 'none' }\n | { kind: 'open'; artifactId: string; versionNumber: number }\n | { kind: 'refresh'; artifactId: string; versionNumber: number };\n\n/** The highest version seen for one artifact, and when it landed. */\ninterface LatestVersion {\n /**\n * The id AS IT APPEARED in the input, not the normalized lookup key. Ids are matched\n * case-insensitively but handed back untouched, so nothing downstream sees an id in a different\n * case than the row it came from.\n */\n artifactId: string;\n versionNumber: number;\n versionCreatedAt?: Date | null;\n}\n\n/**\n * artifactId → highest version number seen.\n *\n * Keys are NORMALIZED UUIDs, so lookups are case-insensitive by construction (SQL Server returns\n * upper case, PostgreSQL lower) at O(1) rather than by scanning every key for a `UUIDsEqual` hit.\n */\nexport function snapshotArtifactVersions(refs: Iterable<ArtifactVersionRef>): Map<string, number> {\n const latest = new Map<string, number>();\n for (const ref of refs) {\n const key = NormalizeUUID(ref.artifactId);\n latest.set(key, Math.max(latest.get(key) ?? 0, ref.versionNumber));\n }\n return latest;\n}\n\n/** Same reduction as {@link snapshotArtifactVersions}, keeping the timestamp for ordering. */\nfunction latestByArtifact(refs: Iterable<ArtifactVersionRef>): Map<string, LatestVersion> {\n const latest = new Map<string, LatestVersion>();\n for (const ref of refs) {\n const key = NormalizeUUID(ref.artifactId);\n const existing = latest.get(key);\n if (!existing || ref.versionNumber > existing.versionNumber) {\n latest.set(key, { artifactId: ref.artifactId, versionNumber: ref.versionNumber, versionCreatedAt: ref.versionCreatedAt });\n }\n }\n return latest;\n}\n\n/** Newest first, with an absent timestamp sorting last so a real date always wins. */\nfunction newestFirst(a: [string, LatestVersion], b: [string, LatestVersion]): number {\n const at = a[1].versionCreatedAt ? new Date(a[1].versionCreatedAt).getTime() : Number.NEGATIVE_INFINITY;\n const bt = b[1].versionCreatedAt ? new Date(b[1].versionCreatedAt).getTime() : Number.NEGATIVE_INFINITY;\n return bt - at;\n}\n\n/**\n * The best candidate among several: newest version wins, and ties break toward the one seen LAST,\n * which is what the previous \"take the final map entry\" rule did. `sort` is stable, so reversing\n * first is what makes equal timestamps resolve that way rather than the opposite.\n */\nfunction bestCandidate(entries: Array<[string, LatestVersion]>): LatestVersion {\n return [...entries].reverse().sort(newestFirst)[0][1];\n}\n\n/**\n * Decide what the artifact panel should do after an agent run, from a before/after diff of\n * artifact versions across the whole conversation:\n * - a NEW artifact opens, whether or not the panel is open (a `build` in a conversation that\n * already had a component — #529);\n * - a bumped version of the SHOWN artifact refreshes it;\n * - a bumped version of ANOTHER existing artifact switches the panel to it (retargeting);\n * - a version bump with the panel closed does nothing (historical behavior).\n *\n * A creation always wins over a bump: when one run both creates an artifact and versions the shown\n * one, the new artifact opens, because a `build` must surface rather than stay hidden behind it.\n *\n * ## Why \"absent from `before`\" is not on its own enough\n *\n * `before` and `after` are snapshots of a map the component rebuilds for other reasons entirely,\n * so an artifact can enter it without anything having been created: switching conversations leaves\n * the previous conversation's artifacts in place until the rebuild lands, and paging up merges in\n * artifacts from older messages mid-turn. Either way every arriving artifact is absent from\n * `before`, and a set difference alone would open a months-old artifact and claim a run had just\n * built it — while ALSO short-circuiting the refresh of the artifact actually on screen, because a\n * creation outranks a bump. `baselineComparable` is how the caller reports that the two snapshots\n * describe the same population; when it is false, creations are not inferred at all and only the\n * shown artifact's own bump (an inference that needs no baseline, since it is corroborated by the\n * id being present in both snapshots) is acted on.\n *\n * @param input.panelOpen - Whether the artifact panel is currently open.\n * @param input.selectedArtifactId - The artifact currently displayed, if any.\n * @param input.before - Snapshot taken before the turn, from {@link snapshotArtifactVersions}.\n * @param input.after - Every artifact version known now.\n * @param input.baselineComparable - Defaults to true. False when `before` cannot be compared with\n * `after` (the map was holding another conversation's artifacts, or a page of older messages\n * merged in while the turn was in flight).\n * @param input.userChangedSelection - Defaults to false. True when the user picked or closed an\n * artifact while the turn was in flight; the panel is then left where they put it.\n */\nexport function decideArtifactPanelAction(input: {\n panelOpen: boolean;\n selectedArtifactId: string | null;\n before: Map<string, number>;\n after: ArtifactVersionRef[];\n baselineComparable?: boolean;\n userChangedSelection?: boolean;\n}): ArtifactPanelAction {\n const after = latestByArtifact(input.after);\n const entries = [...after.entries()];\n const baselineComparable = input.baselineComparable !== false;\n const userChangedSelection = input.userChangedSelection === true;\n\n // A bump is \"this id was in both snapshots and its version went up\" — self-corroborating, so it\n // survives an untrustworthy baseline.\n const bumped = entries.filter(([id, latest]) => {\n const previous = input.before.get(id);\n return previous !== undefined && latest.versionNumber > previous;\n });\n const shown = bumped.find(([, latest]) => UUIDsEqual(latest.artifactId, input.selectedArtifactId));\n\n // The user's own choice outranks the run's: refresh what they are looking at if it moved, but\n // never pull the panel onto something else underneath them.\n //\n // Only while the panel is OPEN, though. A closed panel is displacing nothing, so a run that\n // genuinely built something still surfaces it — suppressing that would break the very case this\n // feature exists for, and a user who closed the panel mid-run has expressed no preference about\n // an artifact that did not exist yet.\n if (userChangedSelection && input.panelOpen) {\n if (shown) {\n return { kind: 'refresh', artifactId: shown[1].artifactId, versionNumber: shown[1].versionNumber };\n }\n return { kind: 'none' };\n }\n\n if (baselineComparable) {\n const created = entries.filter(([id]) => !input.before.has(id));\n if (created.length > 0) {\n // Newest version wins. The previous \"last entry\" rule inherited map insertion order, which\n // is the order the component happened to iterate conversation details in — not recency.\n const latest = bestCandidate(created);\n return { kind: 'open', artifactId: latest.artifactId, versionNumber: latest.versionNumber };\n }\n }\n\n if (bumped.length === 0 || !input.panelOpen) return { kind: 'none' };\n\n if (shown) return { kind: 'refresh', artifactId: shown[1].artifactId, versionNumber: shown[1].versionNumber };\n\n // Retargeting: the run versioned some other artifact in this conversation. Only meaningful when\n // the two snapshots describe the same population.\n if (!baselineComparable) return { kind: 'none' };\n\n const latest = bestCandidate(bumped);\n return { kind: 'open', artifactId: latest.artifactId, versionNumber: latest.versionNumber };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"artifact-panel-action.js","sourceRoot":"","sources":["../../../src/lib/utils/artifact-panel-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgDnE;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAkC;IACzE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KA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AK,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAE9G,gGAAgG;IAChG,kDAAkD;IAClD,IAAI,CAAC,kBAAkB;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAEjD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC;AAC9F,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,yBAAyB,CAAC,KAOzC;IACC,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { NormalizeUUID, UUIDsEqual } from '@memberjunction/global';\n\nexport interface ArtifactVersionRef {\n artifactId: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n versionNumber: number; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n /**\n * When that version row was created. Used ONLY to order candidates against each other, never\n * compared against the client clock — the values come from one database, so their relative\n * order is meaningful even though the absolute offset from the browser's clock is not.\n */\n versionCreatedAt?: Date | null; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined\n}\n\n/**\n * What the chat area records before a turn so it can later tell whether the artifact population\n * changed BECAUSE of that turn. See `snapshotArtifactPanelBaseline` in the chat area for why the\n * version map on its own is not a sufficient baseline.\n */\nexport interface ArtifactPanelBaseline {\n /** artifactId → highest version, from {@link snapshotArtifactVersions}. */\n Versions: Map<string, number>;\n /** The conversation on screen when the snapshot was taken. */\n conversationId: string | null; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n /** The conversation whose artifacts the map was actually holding, or null if none had loaded. */\n MapConversationId: string | null;\n /** Paging-merge counter at snapshot time. */\n MapGeneration: number;\n /** User-selection counter at snapshot time. */\n SelectionEpoch: number;\n}\n\nexport type ArtifactPanelAction =\n | { kind: 'none' } // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n | { kind: 'open'; artifactId: string; versionNumber: number } // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n | { kind: 'refresh'; artifactId: string; versionNumber: number }; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n\n/** The highest version seen for one artifact, and when it landed. */\ninterface LatestVersion {\n /**\n * The id AS IT APPEARED in the input, not the normalized lookup key. Ids are matched\n * case-insensitively but handed back untouched, so nothing downstream sees an id in a different\n * case than the row it came from.\n */\n artifactId: string;\n versionNumber: number;\n versionCreatedAt?: Date | null;\n}\n\n/**\n * artifactId → highest version number seen.\n *\n * Keys are NORMALIZED UUIDs, so lookups are case-insensitive by construction (SQL Server returns\n * upper case, PostgreSQL lower) at O(1) rather than by scanning every key for a `UUIDsEqual` hit.\n */\nexport function SnapshotArtifactVersions(refs: Iterable<ArtifactVersionRef>): Map<string, number> {\n const latest = new Map<string, number>();\n for (const ref of refs) {\n const key = NormalizeUUID(ref.artifactId);\n latest.set(key, Math.max(latest.get(key) ?? 0, ref.versionNumber));\n }\n return latest;\n}\n\n/** @deprecated Use {@link SnapshotArtifactVersions}. */\nexport function snapshotArtifactVersions(refs: Iterable<ArtifactVersionRef>): Map<string, number> {\n return SnapshotArtifactVersions(refs);\n}\n\n/** Same reduction as {@link snapshotArtifactVersions}, keeping the timestamp for ordering. */\nfunction latestByArtifact(refs: Iterable<ArtifactVersionRef>): Map<string, LatestVersion> {\n const latest = new Map<string, LatestVersion>();\n for (const ref of refs) {\n const key = NormalizeUUID(ref.artifactId);\n const existing = latest.get(key);\n if (!existing || ref.versionNumber > existing.versionNumber) {\n latest.set(key, { artifactId: ref.artifactId, versionNumber: ref.versionNumber, versionCreatedAt: ref.versionCreatedAt });\n }\n }\n return latest;\n}\n\n/** Newest first, with an absent timestamp sorting last so a real date always wins. */\nfunction newestFirst(a: [string, LatestVersion], b: [string, LatestVersion]): number {\n const at = a[1].versionCreatedAt ? new Date(a[1].versionCreatedAt).getTime() : Number.NEGATIVE_INFINITY;\n const bt = b[1].versionCreatedAt ? new Date(b[1].versionCreatedAt).getTime() : Number.NEGATIVE_INFINITY;\n return bt - at;\n}\n\n/**\n * The best candidate among several: newest version wins, and ties break toward the one seen LAST,\n * which is what the previous \"take the final map entry\" rule did. `sort` is stable, so reversing\n * first is what makes equal timestamps resolve that way rather than the opposite.\n */\nfunction bestCandidate(entries: Array<[string, LatestVersion]>): LatestVersion {\n return [...entries].reverse().sort(newestFirst)[0][1];\n}\n\n/**\n * Decide what the artifact panel should do after an agent run, from a before/after diff of\n * artifact versions across the whole conversation:\n * - a NEW artifact opens, whether or not the panel is open (a `build` in a conversation that\n * already had a component — #529);\n * - a bumped version of the SHOWN artifact refreshes it;\n * - a bumped version of ANOTHER existing artifact switches the panel to it (retargeting);\n * - a version bump with the panel closed does nothing (historical behavior).\n *\n * A creation always wins over a bump: when one run both creates an artifact and versions the shown\n * one, the new artifact opens, because a `build` must surface rather than stay hidden behind it.\n *\n * ## Why \"absent from `before`\" is not on its own enough\n *\n * `before` and `after` are snapshots of a map the component rebuilds for other reasons entirely,\n * so an artifact can enter it without anything having been created: switching conversations leaves\n * the previous conversation's artifacts in place until the rebuild lands, and paging up merges in\n * artifacts from older messages mid-turn. Either way every arriving artifact is absent from\n * `before`, and a set difference alone would open a months-old artifact and claim a run had just\n * built it — while ALSO short-circuiting the refresh of the artifact actually on screen, because a\n * creation outranks a bump. `baselineComparable` is how the caller reports that the two snapshots\n * describe the same population; when it is false, creations are not inferred at all and only the\n * shown artifact's own bump (an inference that needs no baseline, since it is corroborated by the\n * id being present in both snapshots) is acted on.\n *\n * @param input.panelOpen - Whether the artifact panel is currently open.\n * @param input.selectedArtifactId - The artifact currently displayed, if any.\n * @param input.before - Snapshot taken before the turn, from {@link snapshotArtifactVersions}.\n * @param input.after - Every artifact version known now.\n * @param input.baselineComparable - Defaults to true. False when `before` cannot be compared with\n * `after` (the map was holding another conversation's artifacts, or a page of older messages\n * merged in while the turn was in flight).\n * @param input.userChangedSelection - Defaults to false. True when the user picked or closed an\n * artifact while the turn was in flight; the panel is then left where they put it.\n */\nexport function DecideArtifactPanelAction(input: {\n panelOpen: boolean;\n selectedArtifactId: string | null;\n before: Map<string, number>;\n after: ArtifactVersionRef[];\n baselineComparable?: boolean;\n userChangedSelection?: boolean;\n}): ArtifactPanelAction {\n const after = latestByArtifact(input.after);\n const entries = [...after.entries()];\n const baselineComparable = input.baselineComparable !== false;\n const userChangedSelection = input.userChangedSelection === true;\n\n // A bump is \"this id was in both snapshots and its version went up\" — self-corroborating, so it\n // survives an untrustworthy baseline.\n const bumped = entries.filter(([id, latest]) => {\n const previous = input.before.get(id);\n return previous !== undefined && latest.versionNumber > previous;\n });\n const shown = bumped.find(([, latest]) => UUIDsEqual(latest.artifactId, input.selectedArtifactId));\n\n // The user's own choice outranks the run's: refresh what they are looking at if it moved, but\n // never pull the panel onto something else underneath them.\n //\n // Only while the panel is OPEN, though. A closed panel is displacing nothing, so a run that\n // genuinely built something still surfaces it — suppressing that would break the very case this\n // feature exists for, and a user who closed the panel mid-run has expressed no preference about\n // an artifact that did not exist yet.\n if (userChangedSelection && input.panelOpen) {\n if (shown) {\n return { kind: 'refresh', artifactId: shown[1].artifactId, versionNumber: shown[1].versionNumber };\n }\n return { kind: 'none' };\n }\n\n if (baselineComparable) {\n const created = entries.filter(([id]) => !input.before.has(id));\n if (created.length > 0) {\n // Newest version wins. The previous \"last entry\" rule inherited map insertion order, which\n // is the order the component happened to iterate conversation details in — not recency.\n const latest = bestCandidate(created);\n return { kind: 'open', artifactId: latest.artifactId, versionNumber: latest.versionNumber };\n }\n }\n\n if (bumped.length === 0 || !input.panelOpen) return { kind: 'none' };\n\n if (shown) return { kind: 'refresh', artifactId: shown[1].artifactId, versionNumber: shown[1].versionNumber };\n\n // Retargeting: the run versioned some other artifact in this conversation. Only meaningful when\n // the two snapshots describe the same population.\n if (!baselineComparable) return { kind: 'none' };\n\n const latest = bestCandidate(bumped);\n return { kind: 'open', artifactId: latest.artifactId, versionNumber: latest.versionNumber };\n}\n\n/** @deprecated Use {@link DecideArtifactPanelAction}. */\nexport function decideArtifactPanelAction(input: {\n panelOpen: boolean;\n selectedArtifactId: string | null;\n before: Map<string, number>;\n after: ArtifactVersionRef[];\n baselineComparable?: boolean;\n userChangedSelection?: boolean;\n}): ArtifactPanelAction {\n return DecideArtifactPanelAction(input);\n}\n"]}
|
|
@@ -26,5 +26,7 @@ export interface DistinctArtifactKey {
|
|
|
26
26
|
* the whole conversation to id → max version for a before/after diff. This one is per-message and
|
|
27
27
|
* returns the objects themselves.
|
|
28
28
|
*/
|
|
29
|
+
export declare function SelectDistinctLatestArtifacts<T extends DistinctArtifactKey>(list: readonly T[]): T[];
|
|
30
|
+
/** @deprecated Use {@link SelectDistinctLatestArtifacts}. */
|
|
29
31
|
export declare function selectDistinctLatestArtifacts<T extends DistinctArtifactKey>(list: readonly T[]): T[];
|
|
30
32
|
//# sourceMappingURL=distinct-artifacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distinct-artifacts.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/distinct-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAUpG"}
|
|
1
|
+
{"version":3,"file":"distinct-artifacts.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/distinct-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAUpG;AAED,6DAA6D;AAC7D,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAEpG"}
|
|
@@ -22,7 +22,7 @@ import { NormalizeUUID } from '@memberjunction/global';
|
|
|
22
22
|
* the whole conversation to id → max version for a before/after diff. This one is per-message and
|
|
23
23
|
* returns the objects themselves.
|
|
24
24
|
*/
|
|
25
|
-
export function
|
|
25
|
+
export function SelectDistinctLatestArtifacts(list) {
|
|
26
26
|
const latestByArtifact = new Map();
|
|
27
27
|
for (const info of list) {
|
|
28
28
|
const key = NormalizeUUID(info.artifactId);
|
|
@@ -33,4 +33,8 @@ export function selectDistinctLatestArtifacts(list) {
|
|
|
33
33
|
}
|
|
34
34
|
return Array.from(latestByArtifact.values());
|
|
35
35
|
}
|
|
36
|
+
/** @deprecated Use {@link SelectDistinctLatestArtifacts}. */
|
|
37
|
+
export function selectDistinctLatestArtifacts(list) {
|
|
38
|
+
return SelectDistinctLatestArtifacts(list);
|
|
39
|
+
}
|
|
36
40
|
//# sourceMappingURL=distinct-artifacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distinct-artifacts.js","sourceRoot":"","sources":["../../../src/lib/utils/distinct-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,6BAA6B,CAAgC,IAAkB;IAC7F,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAa,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC7D,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["/**\n * Artifact-grouping utilities for rendering a message's attached artifacts.\n *\n * A single conversation message can carry more than one DISTINCT artifact — for\n * example a research report PLUS a standalone generated infographic. The UI must\n * surface all of them. At the same time, a single artifact can have multiple\n * versions, and only the latest should render. This helper reconciles both.\n */\n\nimport { NormalizeUUID } from '@memberjunction/global';\n\n/** Minimal shape needed to dedupe artifacts — satisfied by `LazyArtifactInfo`. */\nexport interface DistinctArtifactKey {\n artifactId: string
|
|
1
|
+
{"version":3,"file":"distinct-artifacts.js","sourceRoot":"","sources":["../../../src/lib/utils/distinct-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,6BAA6B,CAAgC,IAAkB;IAC7F,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAa,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC7D,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,6BAA6B,CAAgC,IAAkB;IAC7F,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * Artifact-grouping utilities for rendering a message's attached artifacts.\n *\n * A single conversation message can carry more than one DISTINCT artifact — for\n * example a research report PLUS a standalone generated infographic. The UI must\n * surface all of them. At the same time, a single artifact can have multiple\n * versions, and only the latest should render. This helper reconciles both.\n */\n\nimport { NormalizeUUID } from '@memberjunction/global';\n\n/** Minimal shape needed to dedupe artifacts — satisfied by `LazyArtifactInfo`. */\nexport interface DistinctArtifactKey {\n artifactId: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n versionNumber: number; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined\n}\n\n/**\n * Collapses a message's artifact list to one entry per distinct `artifactId`,\n * keeping the highest `versionNumber` for each. Distinct artifacts are all\n * retained (so a report and an image both surface); multiple versions of the\n * SAME artifact collapse to the latest. Input order of distinct artifacts is\n * preserved (first-seen wins for ordering).\n *\n * Ids are grouped as UUIDs, not as raw strings: SQL Server returns them upper-case and PostgreSQL\n * lower-case, so a list assembled from differently-cased sources would otherwise render the same\n * artifact as two cards.\n *\n * Related but NOT interchangeable: `snapshotArtifactVersions` in `artifact-panel-action.ts` reduces\n * the whole conversation to id → max version for a before/after diff. This one is per-message and\n * returns the objects themselves.\n */\nexport function SelectDistinctLatestArtifacts<T extends DistinctArtifactKey>(list: readonly T[]): T[] {\n const latestByArtifact = new Map<string, T>();\n for (const info of list) {\n const key = NormalizeUUID(info.artifactId);\n const existing = latestByArtifact.get(key);\n if (!existing || info.versionNumber > existing.versionNumber) {\n latestByArtifact.set(key, info);\n }\n }\n return Array.from(latestByArtifact.values());\n}\n\n/** @deprecated Use {@link SelectDistinctLatestArtifacts}. */\nexport function selectDistinctLatestArtifacts<T extends DistinctArtifactKey>(list: readonly T[]): T[] {\n return SelectDistinctLatestArtifacts(list);\n}\n"]}
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
/** Static utility — all state lives in UserInfoEngine's cache; this class only parses/writes. */
|
|
26
26
|
export declare class PlanModePreference {
|
|
27
27
|
/** `MJ: User Settings` key for the per-conversation plan-mode map. */
|
|
28
|
-
private static readonly
|
|
28
|
+
private static readonly prefKey;
|
|
29
29
|
/** v1 stored a single global boolean — superseded by per-conversation scoping; deleted on sight. */
|
|
30
|
-
private static readonly
|
|
30
|
+
private static readonly legacyPrefKey;
|
|
31
31
|
/** Cap on tracked conversations (oldest entries dropped beyond this). */
|
|
32
32
|
private static readonly MAX_TRACKED;
|
|
33
33
|
/** Memoized parse of the raw setting string (avoids JSON.parse per change-detection pass). */
|
|
@@ -27,9 +27,9 @@ import { NormalizeUUID } from '@memberjunction/global';
|
|
|
27
27
|
/** Static utility — all state lives in UserInfoEngine's cache; this class only parses/writes. */
|
|
28
28
|
export class PlanModePreference {
|
|
29
29
|
/** `MJ: User Settings` key for the per-conversation plan-mode map. */
|
|
30
|
-
static
|
|
30
|
+
static prefKey = 'mj.conversations.planMode.v2';
|
|
31
31
|
/** v1 stored a single global boolean — superseded by per-conversation scoping; deleted on sight. */
|
|
32
|
-
static
|
|
32
|
+
static legacyPrefKey = 'mj.conversations.planMode.v1';
|
|
33
33
|
/** Cap on tracked conversations (oldest entries dropped beyond this). */
|
|
34
34
|
static MAX_TRACKED = 100;
|
|
35
35
|
/** Memoized parse of the raw setting string (avoids JSON.parse per change-detection pass). */
|
|
@@ -87,8 +87,8 @@ export class PlanModePreference {
|
|
|
87
87
|
static Warm() {
|
|
88
88
|
UserInfoEngine.Instance.Config()
|
|
89
89
|
.then(() => {
|
|
90
|
-
if (UserInfoEngine.Instance.GetSetting(this.
|
|
91
|
-
void UserInfoEngine.Instance.DeleteSetting(this.
|
|
90
|
+
if (UserInfoEngine.Instance.GetSetting(this.legacyPrefKey) !== undefined) {
|
|
91
|
+
void UserInfoEngine.Instance.DeleteSetting(this.legacyPrefKey);
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
94
|
.catch(() => { });
|
|
@@ -96,7 +96,7 @@ export class PlanModePreference {
|
|
|
96
96
|
/** Read + memoize the persisted state. Defensive: any failure yields the last-known state. */
|
|
97
97
|
static read() {
|
|
98
98
|
try {
|
|
99
|
-
const raw = UserInfoEngine.Instance.GetSetting(this.
|
|
99
|
+
const raw = UserInfoEngine.Instance.GetSetting(this.prefKey);
|
|
100
100
|
if (raw !== this.rawCache) {
|
|
101
101
|
this.rawCache = raw;
|
|
102
102
|
this.stateCache = raw ? JSON.parse(raw) : {};
|
|
@@ -109,7 +109,7 @@ export class PlanModePreference {
|
|
|
109
109
|
}
|
|
110
110
|
static write(state) {
|
|
111
111
|
try {
|
|
112
|
-
UserInfoEngine.Instance.SetSettingDebounced(this.
|
|
112
|
+
UserInfoEngine.Instance.SetSettingDebounced(this.prefKey, JSON.stringify(state));
|
|
113
113
|
}
|
|
114
114
|
catch (error) {
|
|
115
115
|
console.warn('[PlanModePreference] Failed to persist plan-mode preference:', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-mode-preference.js","sourceRoot":"","sources":["../../../src/lib/utils/plan-mode-preference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAUvD,iGAAiG;AACjG,MAA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O,MAAM,CAAC,KAAK,CAAC,KAAoB;QACvC,IAAI,CAAC;YACH,cAAc,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACnF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,8DAA8D,EAAE,KAAK,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IAED,mFAAmF;IAC3E,MAAM,CAAC,MAAM,CAAC,GAA4B;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC","sourcesContent":["/**\n * @fileoverview Per-conversation Plan Mode preference.\n *\n * Plan Mode is scoped to a CONVERSATION, not globally to the user: toggling it in one\n * conversation must not bleed into others. State is persisted server-side in a single\n * `MJ: User Settings` row (via `UserInfoEngine`, debounced writes + read-after-write\n * cache) so it survives component recreation, navigation, reloads, and sessions:\n *\n * ```json\n * { \"pendingNew\": true, \"byConversation\": { \"<conversationId>\": true, ... } }\n * ```\n *\n * - `pendingNew` — the toggle state chosen on a composer with NO conversation yet (the\n * empty-state / new-conversation composer). It is CLAIMED by (moved onto) the actual\n * conversation when its first message is routed.\n * - `byConversation` — per-conversation flags, capped at {@link MAX_TRACKED} entries\n * (oldest dropped) so the settings row stays small. Keys are normalized UUIDs so\n * SQL Server (uppercase) and PostgreSQL (lowercase) ids can't create duplicates.\n *\n * All composer instances (empty-state, chat-area, thread panel) and the plan-approval\n * form handler read/write through this ONE class, so they can never disagree.\n *\n * @module @memberjunction/ng-conversations\n */\n\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport { NormalizeUUID } from '@memberjunction/global';\n\n/** Persisted shape of the plan-mode preference setting. */\ninterface PlanModeState {\n /** Toggle state chosen before the conversation exists (new-conversation composer). */\n pendingNew?: boolean;\n /** Per-conversation toggle states, keyed by normalized conversation ID. */\n byConversation?: Record<string, boolean>;\n}\n\n/** Static utility — all state lives in UserInfoEngine's cache; this class only parses/writes. */\nexport class PlanModePreference {\n /** `MJ: User Settings` key for the per-conversation plan-mode map. */\n private static readonly
|
|
1
|
+
{"version":3,"file":"plan-mode-preference.js","sourceRoot":"","sources":["../../../src/lib/utils/plan-mode-preference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAUvD,iGAAiG;AACjG,MAAM,OAAO,kBAAkB;IAC7B,sEAAsE;IAC9D,MAAM,CAAU,OAAO,GAAG,8BAA8B,CAAC;IACjE,oGAAoG;IAC5F,MAAM,CAAU,aAAa,GAAG,8BAA8B,CAAC;IACvE,yEAAyE;IACjE,MAAM,CAAU,WAAW,GAAG,GAAG,CAAC;IAE1C,8FAA8F;IACtF,MAAM,CAAC,QAAQ,GAAuB,SAAS,CAAC;IAChD,MAAM,CAAC,UAAU,GAAkB,EAAE,CAAC;IAE9C;;;;OAIG;IACI,MAAM,CAAC,SAAS,CAAC,cAAyC;QAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;QACnC,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,EAAE,CAAC,aAAa,C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AC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC","sourcesContent":["/**\n * @fileoverview Per-conversation Plan Mode preference.\n *\n * Plan Mode is scoped to a CONVERSATION, not globally to the user: toggling it in one\n * conversation must not bleed into others. State is persisted server-side in a single\n * `MJ: User Settings` row (via `UserInfoEngine`, debounced writes + read-after-write\n * cache) so it survives component recreation, navigation, reloads, and sessions:\n *\n * ```json\n * { \"pendingNew\": true, \"byConversation\": { \"<conversationId>\": true, ... } }\n * ```\n *\n * - `pendingNew` — the toggle state chosen on a composer with NO conversation yet (the\n * empty-state / new-conversation composer). It is CLAIMED by (moved onto) the actual\n * conversation when its first message is routed.\n * - `byConversation` — per-conversation flags, capped at {@link MAX_TRACKED} entries\n * (oldest dropped) so the settings row stays small. Keys are normalized UUIDs so\n * SQL Server (uppercase) and PostgreSQL (lowercase) ids can't create duplicates.\n *\n * All composer instances (empty-state, chat-area, thread panel) and the plan-approval\n * form handler read/write through this ONE class, so they can never disagree.\n *\n * @module @memberjunction/ng-conversations\n */\n\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport { NormalizeUUID } from '@memberjunction/global';\n\n/** Persisted shape of the plan-mode preference setting. */\ninterface PlanModeState {\n /** Toggle state chosen before the conversation exists (new-conversation composer). */\n pendingNew?: boolean;\n /** Per-conversation toggle states, keyed by normalized conversation ID. */\n byConversation?: Record<string, boolean>;\n}\n\n/** Static utility — all state lives in UserInfoEngine's cache; this class only parses/writes. */\nexport class PlanModePreference {\n /** `MJ: User Settings` key for the per-conversation plan-mode map. */\n private static readonly prefKey = 'mj.conversations.planMode.v2';\n /** v1 stored a single global boolean — superseded by per-conversation scoping; deleted on sight. */\n private static readonly legacyPrefKey = 'mj.conversations.planMode.v1';\n /** Cap on tracked conversations (oldest entries dropped beyond this). */\n private static readonly MAX_TRACKED = 100;\n\n /** Memoized parse of the raw setting string (avoids JSON.parse per change-detection pass). */\n private static rawCache: string | undefined = undefined;\n private static stateCache: PlanModeState = {};\n\n /**\n * Whether Plan Mode is on for the given conversation (or for the not-yet-created\n * conversation when `conversationId` is null/undefined). Synchronous cache read —\n * safe to call from Angular getters every change-detection pass.\n */\n public static IsEnabled(conversationId: string | null | undefined): boolean {\n const state = this.read();\n if (!conversationId) {\n return state.pendingNew === true;\n }\n return state.byConversation?.[NormalizeUUID(conversationId)] === true;\n }\n\n /** Sets Plan Mode for the given conversation (or the pending-new bucket when no id yet). */\n public static Set(conversationId: string | null | undefined, enabled: boolean): void {\n const state = { ...this.read() };\n if (!conversationId) {\n state.pendingNew = enabled;\n } else {\n state.byConversation = this.capped({\n ...(state.byConversation ?? {}),\n [NormalizeUUID(conversationId)]: enabled,\n });\n }\n this.write(state);\n }\n\n /**\n * Moves a `pendingNew` choice onto the actual conversation. Call when routing the FIRST\n * message of a conversation — whichever composer instance sends it claims the pending\n * value (the empty-state composer that set it never routes; it hands off via\n * `emptyStateSubmit`). No-op when nothing is pending.\n */\n public static ClaimPendingNew(conversationId: string): void {\n const state = this.read();\n if (state.pendingNew === undefined) {\n return;\n }\n const next: PlanModeState = {\n byConversation: this.capped({\n ...(state.byConversation ?? {}),\n [NormalizeUUID(conversationId)]: state.pendingNew,\n }),\n };\n this.write(next);\n }\n\n /**\n * Warm the UserInfoEngine cache and drop the superseded v1 (global) setting if present.\n * Fire-and-forget from component init; failures just leave the default (off).\n */\n public static Warm(): void {\n UserInfoEngine.Instance.Config()\n .then(() => {\n if (UserInfoEngine.Instance.GetSetting(this.legacyPrefKey) !== undefined) {\n void UserInfoEngine.Instance.DeleteSetting(this.legacyPrefKey);\n }\n })\n .catch(() => { /* reads fall back to default (off) until the engine loads */ });\n }\n\n /** Read + memoize the persisted state. Defensive: any failure yields the last-known state. */\n private static read(): PlanModeState {\n try {\n const raw = UserInfoEngine.Instance.GetSetting(this.prefKey);\n if (raw !== this.rawCache) {\n this.rawCache = raw;\n this.stateCache = raw ? (JSON.parse(raw) as PlanModeState) : {};\n }\n return this.stateCache;\n } catch {\n return this.stateCache; // engine not configured yet or malformed payload\n }\n }\n\n private static write(state: PlanModeState): void {\n try {\n UserInfoEngine.Instance.SetSettingDebounced(this.prefKey, JSON.stringify(state));\n } catch (error) {\n console.warn('[PlanModePreference] Failed to persist plan-mode preference:', error);\n }\n }\n\n /** Cap the per-conversation map, dropping the OLDEST entries (insertion order). */\n private static capped(map: Record<string, boolean>): Record<string, boolean> {\n const keys = Object.keys(map);\n if (keys.length <= this.MAX_TRACKED) {\n return map;\n }\n for (const stale of keys.slice(0, keys.length - this.MAX_TRACKED)) {\n delete map[stale];\n }\n return map;\n }\n}\n"]}
|
|
@@ -1,84 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Realtime-session timeline grouping
|
|
2
|
+
* Realtime-session timeline grouping — re-exported from `@memberjunction/conversations-runtime`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* message list collapses each session's stamped rows into ONE distinct timeline element
|
|
9
|
-
* (a session card) at the session's chronological position, from which the user can
|
|
10
|
-
* reopen the existing SESSION REVIEW overlay.
|
|
4
|
+
* The grouping pass was always pure TypeScript, but purity is not the same as living in the right
|
|
5
|
+
* package: while the only implementation sat behind an Angular import, the React Native thread
|
|
6
|
+
* rendered every session-stamped row as an ordinary chat bubble — the exact thing the module's own
|
|
7
|
+
* header calls wrong. It now lives in the runtime every surface shares.
|
|
11
8
|
*
|
|
12
|
-
* This
|
|
13
|
-
*
|
|
14
|
-
* satisfies via its getters.
|
|
9
|
+
* This file stays so the eleven call sites in this library keep importing from where they always
|
|
10
|
+
* did. Import from `@memberjunction/conversations-runtime` in new code.
|
|
15
11
|
*/
|
|
16
|
-
|
|
17
|
-
export interface RealtimeTimelineSourceDetail {
|
|
18
|
-
ID: string;
|
|
19
|
-
/** Stamped session id for rows persisted during a live realtime session; null for normal chat rows. */
|
|
20
|
-
AgentSessionID: string | null;
|
|
21
|
-
/** `User` | `AI` | `Error` on the entity; widened to string for structural compatibility. */
|
|
22
|
-
Role: string;
|
|
23
|
-
Message: string | null;
|
|
24
|
-
/** Hidden rows (system/junction-anchor details) never count as visible turns. */
|
|
25
|
-
HiddenToUser: boolean;
|
|
26
|
-
__mj_CreatedAt: Date | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* One realtime session's collapsed block: everything the timeline card renders that can
|
|
30
|
-
* be computed from the conversation's already-loaded detail rows (no extra queries).
|
|
31
|
-
*/
|
|
32
|
-
export interface RealtimeSessionTimelineGroup {
|
|
33
|
-
/** `MJ: AI Agent Sessions.ID` the block's rows are stamped with (original casing of the first row). */
|
|
34
|
-
SessionID: string;
|
|
35
|
-
/** Timestamp of the session's first stamped row (≈ when the session's transcript began). */
|
|
36
|
-
StartedAt: Date | null;
|
|
37
|
-
/** Timestamp of the session's last stamped row (≈ when the transcript ended). */
|
|
38
|
-
EndedAt: Date | null;
|
|
39
|
-
/** VISIBLE caption turns: non-hidden `User`/`AI` rows with text (mirrors review-mode's turn mapping). */
|
|
40
|
-
TurnCount: number;
|
|
41
|
-
/** ALL stamped rows folded into this block, hidden anchors included. */
|
|
42
|
-
DetailCount: number;
|
|
43
|
-
/** Who spoke the last visible turn (AI → `Assistant`), or null when no visible turn exists. */
|
|
44
|
-
LastTurnRole: 'User' | 'Assistant' | null;
|
|
45
|
-
/** The last visible turn's text (untruncated — the card ellipsizes), or null. */
|
|
46
|
-
LastTurnPreview: string | null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Session-row metadata the card enriches itself with when the host has it (one batched
|
|
50
|
-
* `MJ: AI Agent Sessions` lookup per conversation). All-optional by design: a missing
|
|
51
|
-
* meta entry degrades the card to its generic label with no status chip.
|
|
52
|
-
*/
|
|
53
|
-
export interface RealtimeSessionTimelineMeta {
|
|
54
|
-
/** `MJ: AI Agent Sessions.ID`. */
|
|
55
|
-
SessionID: string;
|
|
56
|
-
/** Denormalized agent display name from the session view (usually the co-agent). */
|
|
57
|
-
AgentName: string | null;
|
|
58
|
-
Status: 'Active' | 'Closed' | 'Idle' | null;
|
|
59
|
-
/** Why the session closed (`Error` | `Explicit` | `Janitor` | `Shutdown`), when closed. */
|
|
60
|
-
CloseReason: string | null;
|
|
61
|
-
ClosedAt: Date | null;
|
|
62
|
-
}
|
|
63
|
-
/** One renderable timeline entry: a normal chat message OR a collapsed session block. */
|
|
64
|
-
export type ConversationTimelineItem<T extends RealtimeTimelineSourceDetail> = {
|
|
65
|
-
Kind: 'message';
|
|
66
|
-
Detail: T;
|
|
67
|
-
} | {
|
|
68
|
-
Kind: 'session';
|
|
69
|
-
Group: RealtimeSessionTimelineGroup;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Builds the renderable conversation timeline from the loaded detail rows (chronological,
|
|
73
|
-
* as the engine returns them):
|
|
74
|
-
* - rows WITHOUT an `AgentSessionID` pass through unchanged, in order;
|
|
75
|
-
* - rows WITH one collapse into ONE session block per session id, positioned where the
|
|
76
|
-
* session's FIRST stamped row sits. Later stamped rows of the same session (even when
|
|
77
|
-
* interleaved with normal messages) fold into that same block — one element per
|
|
78
|
-
* session, period.
|
|
79
|
-
*
|
|
80
|
-
* Session-id comparison is case-insensitive ({@link NormalizeUUID}) so SQL Server
|
|
81
|
-
* (uppercase) and PostgreSQL (lowercase) ids group identically.
|
|
82
|
-
*/
|
|
83
|
-
export declare function BuildConversationTimeline<T extends RealtimeTimelineSourceDetail>(details: readonly T[]): ConversationTimelineItem<T>[];
|
|
12
|
+
export { BuildConversationTimeline, CollectRealtimeSessionIDs, FindRealtimeSessionMeta, IsVisibleRealtimeTurn, MapRealtimeSessionMeta, REALTIME_SESSION_META_FIELDS, SessionCardIsSameDayRange, SessionCardStatusChip, SessionCardTitle, type ConversationTimelineItem, type RealtimeSessionMetaRow, type RealtimeSessionStatusChip, type RealtimeSessionTimelineGroup, type RealtimeSessionTimelineMeta, type RealtimeTimelineSourceDetail, } from '@memberjunction/conversations-runtime';
|
|
84
13
|
//# sourceMappingURL=realtime-session-timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-session-timeline.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/realtime-session-timeline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"realtime-session-timeline.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/realtime-session-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,94 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Realtime-session timeline grouping
|
|
2
|
+
* Realtime-session timeline grouping — re-exported from `@memberjunction/conversations-runtime`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* message list collapses each session's stamped rows into ONE distinct timeline element
|
|
9
|
-
* (a session card) at the session's chronological position, from which the user can
|
|
10
|
-
* reopen the existing SESSION REVIEW overlay.
|
|
4
|
+
* The grouping pass was always pure TypeScript, but purity is not the same as living in the right
|
|
5
|
+
* package: while the only implementation sat behind an Angular import, the React Native thread
|
|
6
|
+
* rendered every session-stamped row as an ordinary chat bubble — the exact thing the module's own
|
|
7
|
+
* header calls wrong. It now lives in the runtime every surface shares.
|
|
11
8
|
*
|
|
12
|
-
* This
|
|
13
|
-
*
|
|
14
|
-
* satisfies via its getters.
|
|
9
|
+
* This file stays so the eleven call sites in this library keep importing from where they always
|
|
10
|
+
* did. Import from `@memberjunction/conversations-runtime` in new code.
|
|
15
11
|
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Builds the renderable conversation timeline from the loaded detail rows (chronological,
|
|
19
|
-
* as the engine returns them):
|
|
20
|
-
* - rows WITHOUT an `AgentSessionID` pass through unchanged, in order;
|
|
21
|
-
* - rows WITH one collapse into ONE session block per session id, positioned where the
|
|
22
|
-
* session's FIRST stamped row sits. Later stamped rows of the same session (even when
|
|
23
|
-
* interleaved with normal messages) fold into that same block — one element per
|
|
24
|
-
* session, period.
|
|
25
|
-
*
|
|
26
|
-
* Session-id comparison is case-insensitive ({@link NormalizeUUID}) so SQL Server
|
|
27
|
-
* (uppercase) and PostgreSQL (lowercase) ids group identically.
|
|
28
|
-
*/
|
|
29
|
-
export function BuildConversationTimeline(details) {
|
|
30
|
-
const items = [];
|
|
31
|
-
const groupsBySessionKey = new Map();
|
|
32
|
-
for (const detail of details) {
|
|
33
|
-
const sessionId = normalizeSessionId(detail.AgentSessionID);
|
|
34
|
-
if (!sessionId) {
|
|
35
|
-
items.push({ Kind: 'message', Detail: detail });
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
const key = NormalizeUUID(sessionId);
|
|
39
|
-
let group = groupsBySessionKey.get(key);
|
|
40
|
-
if (!group) {
|
|
41
|
-
group = createGroup(sessionId);
|
|
42
|
-
groupsBySessionKey.set(key, group);
|
|
43
|
-
items.push({ Kind: 'session', Group: group });
|
|
44
|
-
}
|
|
45
|
-
foldDetailIntoGroup(group, detail);
|
|
46
|
-
}
|
|
47
|
-
return items;
|
|
48
|
-
}
|
|
49
|
-
/** Trims the stamped session id; empty/whitespace ids are treated as unstamped. */
|
|
50
|
-
function normalizeSessionId(raw) {
|
|
51
|
-
const trimmed = raw?.trim() ?? '';
|
|
52
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
53
|
-
}
|
|
54
|
-
/** A fresh, empty session block for the given session id. */
|
|
55
|
-
function createGroup(sessionId) {
|
|
56
|
-
return {
|
|
57
|
-
SessionID: sessionId,
|
|
58
|
-
StartedAt: null,
|
|
59
|
-
EndedAt: null,
|
|
60
|
-
TurnCount: 0,
|
|
61
|
-
DetailCount: 0,
|
|
62
|
-
LastTurnRole: null,
|
|
63
|
-
LastTurnPreview: null
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** Folds one stamped detail row into its session block (range, counts, last-turn preview). */
|
|
67
|
-
function foldDetailIntoGroup(group, detail) {
|
|
68
|
-
group.DetailCount++;
|
|
69
|
-
const at = toDate(detail.__mj_CreatedAt);
|
|
70
|
-
if (at) {
|
|
71
|
-
if (!group.StartedAt || at.getTime() < group.StartedAt.getTime()) {
|
|
72
|
-
group.StartedAt = at;
|
|
73
|
-
}
|
|
74
|
-
if (!group.EndedAt || at.getTime() > group.EndedAt.getTime()) {
|
|
75
|
-
group.EndedAt = at;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const text = detail.Message?.trim() ?? '';
|
|
79
|
-
const isVisibleTurn = !detail.HiddenToUser && text.length > 0 && (detail.Role === 'User' || detail.Role === 'AI');
|
|
80
|
-
if (isVisibleTurn) {
|
|
81
|
-
group.TurnCount++;
|
|
82
|
-
group.LastTurnRole = detail.Role === 'AI' ? 'Assistant' : 'User';
|
|
83
|
-
group.LastTurnPreview = text;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/** Tolerant date conversion — raw cache rows can carry ISO strings instead of Dates. */
|
|
87
|
-
function toDate(value) {
|
|
88
|
-
if (value == null) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
92
|
-
return isNaN(date.getTime()) ? null : date;
|
|
93
|
-
}
|
|
12
|
+
export { BuildConversationTimeline, CollectRealtimeSessionIDs, FindRealtimeSessionMeta, IsVisibleRealtimeTurn, MapRealtimeSessionMeta, REALTIME_SESSION_META_FIELDS, SessionCardIsSameDayRange, SessionCardStatusChip, SessionCardTitle, } from '@memberjunction/conversations-runtime';
|
|
94
13
|
//# sourceMappingURL=realtime-session-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-session-timeline.js","sourceRoot":"","sources":["../../../src/lib/utils/realtime-session-timeline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"realtime-session-timeline.js","sourceRoot":"","sources":["../../../src/lib/utils/realtime-session-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,GAOjB,MAAM,uCAAuC,CAAC","sourcesContent":["/**\n * Realtime-session timeline grouping — re-exported from `@memberjunction/conversations-runtime`.\n *\n * The grouping pass was always pure TypeScript, but purity is not the same as living in the right\n * package: while the only implementation sat behind an Angular import, the React Native thread\n * rendered every session-stamped row as an ordinary chat bubble — the exact thing the module's own\n * header calls wrong. It now lives in the runtime every surface shares.\n *\n * This file stays so the eleven call sites in this library keep importing from where they always\n * did. Import from `@memberjunction/conversations-runtime` in new code.\n */\nexport {\n BuildConversationTimeline,\n CollectRealtimeSessionIDs,\n FindRealtimeSessionMeta,\n IsVisibleRealtimeTurn,\n MapRealtimeSessionMeta,\n REALTIME_SESSION_META_FIELDS,\n SessionCardIsSameDayRange,\n SessionCardStatusChip,\n SessionCardTitle,\n type ConversationTimelineItem,\n type RealtimeSessionMetaRow,\n type RealtimeSessionStatusChip,\n type RealtimeSessionTimelineGroup,\n type RealtimeSessionTimelineMeta,\n type RealtimeTimelineSourceDetail,\n} from '@memberjunction/conversations-runtime';\n"]}
|
package/dist/public-api.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './lib/models/conversation-state.model';
|
|
|
3
3
|
export * from './lib/models/notification.model';
|
|
4
4
|
export * from './lib/models/lazy-artifact-info';
|
|
5
5
|
export * from './lib/models/navigation-request.model';
|
|
6
|
+
export * from './lib/models/agent-turn.model';
|
|
7
|
+
export * from './lib/utils/agent-turn-routing';
|
|
6
8
|
export * from './lib/services/data-cache.service';
|
|
7
9
|
export * from './lib/services/artifact-state.service';
|
|
8
10
|
export * from './lib/services/agent-state.service';
|
|
@@ -20,14 +22,15 @@ export * from './lib/services/artifact-permission.service';
|
|
|
20
22
|
export * from './lib/services/artifact-use-tracking.service';
|
|
21
23
|
export * from './lib/services/collection-state.service';
|
|
22
24
|
export * from './lib/services/conversation-attachment.service';
|
|
25
|
+
export * from './lib/services/graphql-attachment-blob-store';
|
|
23
26
|
export * from './lib/services/ui-command-handler.service';
|
|
24
27
|
export * from './lib/services/conversation-bridge.service';
|
|
25
28
|
export * from './lib/services/realtime-session.service';
|
|
29
|
+
export * from './lib/services/browser-realtime-media-host';
|
|
26
30
|
export * from './lib/services/realtime-pairing';
|
|
27
31
|
export * from './lib/services/user-authorization';
|
|
28
32
|
export * from './lib/services/realtime-sessions-adapter';
|
|
29
33
|
export * from './lib/services/realtime-session-review.service';
|
|
30
|
-
export * from './lib/services/delegation-result-parser';
|
|
31
34
|
export * from './lib/components/workspace/conversation-workspace.component';
|
|
32
35
|
export * from './lib/components/navigation/conversation-navigation.component';
|
|
33
36
|
export * from './lib/components/sidebar/conversation-sidebar.component';
|
|
@@ -83,6 +86,7 @@ export * from './lib/components/shared/user-picker.component';
|
|
|
83
86
|
export * from './lib/components/tasks/tasks-dropdown.component';
|
|
84
87
|
export * from './lib/components/thread/thread-panel.component';
|
|
85
88
|
export * from './lib/directives/search-shortcut.directive';
|
|
89
|
+
export type { SearchResult, SearchResultType } from './lib/services/search.service';
|
|
86
90
|
export * from './lib/services/conversations-runtime-bootstrap.service';
|
|
87
91
|
export * from './lib/directives/chat-slot.directive';
|
|
88
92
|
export * from './lib/components/slots/slot-interfaces';
|
|
@@ -109,7 +113,6 @@ export * from './lib/components/realtime/realtime-composer.component';
|
|
|
109
113
|
export * from './lib/components/realtime/realtime-channel-strip.component';
|
|
110
114
|
export * from './lib/components/realtime/realtime-session-timeline-card.component';
|
|
111
115
|
export * from './lib/utils/realtime-session-timeline';
|
|
112
|
-
export * from './lib/components/realtime/channels/base-realtime-channel-client';
|
|
113
116
|
export * from './lib/components/realtime/channels/client-context-channel';
|
|
114
117
|
export * from './lib/components/realtime/channels/realtime-channel-pane.component';
|
|
115
118
|
export * from './lib/components/realtime/channels/channel-onboarding-panel.component';
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,4BAA4B,CAAC;AAG3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,4BAA4B,CAAC;AAG3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AAItD,cAAc,6CAA6C,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