@memberjunction/ng-conversations 6.2.0-edge.4 → 6.2.0-edge.6
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 +29 -0
- package/dist/lib/components/attachment/image-viewer.component.d.ts +3 -1
- package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.js +5 -1
- package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.js +3 -3
- package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +88 -20
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +785 -387
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +60 -20
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +290 -389
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +153 -17
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +1400 -299
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +25 -2
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +79 -40
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +19 -0
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +125 -13
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +2 -2
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +6 -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 +110 -82
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts +13 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.d.ts.map +1 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.js +21 -0
- package/dist/lib/components/realtime/realtime-call-failure-notice.js.map +1 -0
- package/dist/lib/components/realtime/realtime-composer.component.js +114 -102
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +21 -2
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +113 -76
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +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 +7 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +152 -31
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +2227 -214
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +4 -4
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +11 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +25 -28
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +8 -8
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/browser-realtime-media-host.d.ts +7 -7
- package/dist/lib/services/browser-realtime-media-host.js +8 -78
- package/dist/lib/services/browser-realtime-media-host.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +53 -20
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +108 -54
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.d.ts +5 -0
- package/dist/lib/services/conversation-detail-window.store.d.ts.map +1 -1
- package/dist/lib/services/conversation-detail-window.store.js +52 -5
- package/dist/lib/services/conversation-detail-window.store.js.map +1 -1
- package/dist/lib/services/conversation-naming.d.ts.map +1 -1
- package/dist/lib/services/conversation-naming.js +9 -2
- package/dist/lib/services/conversation-naming.js.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.d.ts +15 -0
- package/dist/lib/services/conversation-tasks-filter.d.ts.map +1 -0
- package/dist/lib/services/conversation-tasks-filter.js +69 -0
- package/dist/lib/services/conversation-tasks-filter.js.map +1 -0
- package/dist/lib/services/realtime-audio-recorder.d.ts +94 -86
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.js +222 -195
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +30 -2
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +35 -7
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/recording/libopus-wasm-binary.d.ts +3 -0
- package/dist/lib/services/recording/libopus-wasm-binary.d.ts.map +1 -0
- package/dist/lib/services/recording/libopus-wasm-binary.js +489 -0
- package/dist/lib/services/recording/libopus-wasm-binary.js.map +1 -0
- package/dist/lib/services/recording/libopus-worker-source.d.ts +48 -0
- package/dist/lib/services/recording/libopus-worker-source.d.ts.map +1 -0
- package/dist/lib/services/recording/libopus-worker-source.js +170 -0
- package/dist/lib/services/recording/libopus-worker-source.js.map +1 -0
- package/dist/lib/services/recording/linear-resampler.d.ts +45 -0
- package/dist/lib/services/recording/linear-resampler.d.ts.map +1 -0
- package/dist/lib/services/recording/linear-resampler.js +85 -0
- package/dist/lib/services/recording/linear-resampler.js.map +1 -0
- package/dist/lib/services/recording/opus-packet-encoder.d.ts +50 -0
- package/dist/lib/services/recording/opus-packet-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/opus-packet-encoder.js +41 -0
- package/dist/lib/services/recording/opus-packet-encoder.js.map +1 -0
- package/dist/lib/services/recording/wasm-opus-encoder.d.ts +86 -0
- package/dist/lib/services/recording/wasm-opus-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/wasm-opus-encoder.js +232 -0
- package/dist/lib/services/recording/wasm-opus-encoder.js.map +1 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.d.ts +39 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.d.ts.map +1 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.js +101 -0
- package/dist/lib/services/recording/webcodecs-opus-encoder.js.map +1 -0
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +3 -16
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/utils/agent-failure-display.d.ts +14 -0
- package/dist/lib/utils/agent-failure-display.d.ts.map +1 -0
- package/dist/lib/utils/agent-failure-display.js +26 -0
- package/dist/lib/utils/agent-failure-display.js.map +1 -0
- package/dist/lib/utils/distinct-artifacts.d.ts +9 -3
- package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/distinct-artifacts.js +24 -5
- package/dist/lib/utils/distinct-artifacts.js.map +1 -1
- package/dist/lib/utils/message-list-order.d.ts +13 -0
- package/dist/lib/utils/message-list-order.d.ts.map +1 -0
- package/dist/lib/utils/message-list-order.js +31 -0
- package/dist/lib/utils/message-list-order.js.map +1 -0
- package/dist/lib/utils/pin-state.d.ts +11 -0
- package/dist/lib/utils/pin-state.d.ts.map +1 -0
- package/dist/lib/utils/pin-state.js +9 -0
- package/dist/lib/utils/pin-state.js.map +1 -0
- package/dist/public-api.d.ts +1 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +1 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +36 -36
- package/dist/lib/services/browser-recording-unload-guard.d.ts +0 -30
- package/dist/lib/services/browser-recording-unload-guard.d.ts.map +0 -1
- package/dist/lib/services/browser-recording-unload-guard.js +0 -43
- package/dist/lib/services/browser-recording-unload-guard.js.map +0 -1
- package/dist/lib/services/realtime-pcm-wav.d.ts +0 -79
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +0 -1
- package/dist/lib/services/realtime-pcm-wav.js +0 -213
- package/dist/lib/services/realtime-pcm-wav.js.map +0 -1
package/dist/public-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,uFAAuF;AACvF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,6EAA6E;AAC7E,+EAA+E;AAC/E,kEAAkE;AAClE,cAAc,8BAA8B,CAAC;AAC7C,oEAAoE;AACpE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAE/C,mBAAmB;AACnB,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kDAAkD,CAAC;AACjE,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6G;AAC7G,cAAc,+EAA+E,CAAC;AAC9F,cAAc,6EAA6E,CAAC;AAC5F,cAAc,yFAAyF,CAAC;AACxG,wHAAwH;AACxH,cAAc,4DAA4D,CAAC;AAC3E,cAAc,0DAA0D,CAAC;AACzE,cAAc,sEAAsE,CAAC;AACrF,6FAA6F;AAC7F,cAAc,0DAA0D,CAAC;AACzE,cAAc,oEAAoE,CAAC;AAEnF,4GAA4G;AAC5G,iHAAiH;AACjH,4GAA4G;AAC5G,cAAc,6EAA6E,CAAC;AAC5F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,oEAAoE,CAAC;AACnF,cAAc,sEAAsE,CAAC;AACrF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,+EAA+E,CAAC;AAC9F,cAAc,kGAAkG,CAAC;AACjH,8FAA8F;AAC9F,cAAc,kFAAkF,CAAC;AACjG,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface of @memberjunction/ng-conversations\n */\n\n// Module\nexport * from './lib/conversations.module';\n\n// Models\nexport * from './lib/models/conversation-state.model';\nexport * from './lib/models/notification.model';\nexport * from './lib/models/lazy-artifact-info';\nexport * from './lib/models/navigation-request.model';\n// Host rules for an agent turn: reply mode, routes, and the host turn handler contract\nexport * from './lib/models/agent-turn.model';\nexport * from './lib/utils/agent-turn-routing';\n// Opt-in decision routing for an unmentioned message (EnableDecisionRouting)\n// NOTE: the routing decision's builders and types, and IsAgentAllowed, live in\n// @memberjunction/ai-core-plus — import them from there directly.\nexport * from './lib/utils/decision-routing';\n// Fork rules: the delete guard and the open view (Main or one fork)\nexport * from './lib/utils/conversation-branching';\nexport * from './lib/utils/conversation-forks';\n\n// Services - State\nexport * from './lib/services/data-cache.service';\nexport * from './lib/services/artifact-state.service';\nexport * from './lib/services/agent-state.service';\nexport * from './lib/services/conversation-liveness-dom.service';\nexport * from './lib/services/conversation-agent.service';\nexport * from './lib/services/active-tasks.service';\nexport * from './lib/services/conversation-streaming.service';\nexport * from './lib/services/dialog.service';\nexport * from './lib/services/export.service';\nexport * from './lib/services/notification.service';\nexport * from './lib/services/toast.service';\nexport * from './lib/services/mention-parser.service';\n// AI-aware mention suggestion engine (BaseSingleton — use MentionAutocompleteService.Instance).\n// NOTE: the generic MentionSuggestion TYPE lives in @memberjunction/ng-composer — import it\n// from there directly (no re-exports between packages).\nexport * from './lib/services/mention-autocomplete.service';\nexport * from './lib/services/collection-permission.service';\nexport * from './lib/services/artifact-permission.service';\nexport * from './lib/services/artifact-use-tracking.service';\nexport * from './lib/services/collection-state.service';\nexport * from './lib/services/conversation-attachment.service';\nexport * from './lib/services/graphql-attachment-blob-store';\nexport * from './lib/services/ui-command-handler.service';\nexport * from './lib/services/conversation-bridge.service';\nexport * from './lib/services/realtime-session.service';\nexport * from './lib/services/browser-realtime-media-host';\n// NOTE: the realtime session types (RealtimeCaption, RealtimeConnectionState,\n// RealtimeSessionRunOptions, …), the channel plugin base class, and the delegation-result\n// parser now live in `@memberjunction/realtime-runtime`. Import them from there directly —\n// MJ does not re-export across package boundaries.\nexport * from './lib/services/realtime-pairing';\nexport * from './lib/services/user-authorization';\nexport * from './lib/services/realtime-sessions-adapter';\nexport * from './lib/services/realtime-session-review.service';\n\n// Components\nexport * from './lib/components/workspace/conversation-workspace.component';\nexport * from './lib/components/navigation/conversation-navigation.component';\nexport * from './lib/components/sidebar/conversation-sidebar.component';\nexport * from './lib/components/sidebar/routines-section.component';\nexport * from './lib/components/conversation/conversation-list.component';\nexport * from './lib/components/conversation/conversation-chat-area.component';\nexport * from './lib/components/conversation/conversation-empty-state.component';\nexport * from './lib/components/message/message-item.component';\nexport * from './lib/components/message/message-list.component';\nexport * from './lib/components/message/message-input.component';\n// AI-aware composer wrapper (mj-ai-composer): mj-message-input-box + the three AI trigger\n// plugins built in, proxying the input box's full inputs/outputs/methods surface.\nexport * from './lib/components/composer/ai-composer.component';\n// Composer trigger-provider plugins ('@' / '#' / '/') — ClassFactory-registered; also\n// directly instantiable for explicit provider lists.\nexport * from './lib/composer-plugins/base-conversation-mention.provider';\nexport * from './lib/composer-plugins/agent-mention.provider';\nexport * from './lib/composer-plugins/record-mention.provider';\nexport * from './lib/composer-plugins/skill-command.provider';\nexport * from './lib/composer-plugins/load-composer-plugins';\n// NOTE: MessageInputBoxComponent, MentionEditorComponent (+ PendingAttachment), and\n// MentionDropdownComponent live in @memberjunction/ng-composer — import from there directly.\nexport * from './lib/components/message/conversation-message-rating.component';\nexport * from './lib/components/collection/collection-tree.component';\nexport * from './lib/components/collection/collection-view.component';\nexport * from './lib/components/collection/collections-full-view.component';\nexport * from './lib/components/collection/collection-artifact-card.component';\nexport * from './lib/components/collection/artifact-collection-picker-modal.component';\nexport * from './lib/components/collection/collection-share-modal.component';\nexport * from './lib/components/artifact/artifact-share-modal.component';\nexport * from './lib/components/project/project-selector.component';\nexport * from './lib/components/project/project-form-modal.component';\nexport * from './lib/components/task/tasks-full-view.component';\nexport * from './lib/components/tasks/task-widget.component';\nexport * from './lib/components/agent/agent-process-panel.component';\nexport * from './lib/components/agent/active-agent-indicator.component';\nexport * from './lib/components/active-tasks/active-tasks-panel.component';\nexport * from './lib/components/share/share-modal.component';\nexport * from './lib/components/notification/notification-badge.component';\nexport * from './lib/components/notification/activity-indicator.component';\nexport * from './lib/components/toast/toast.component';\nexport * from './lib/components/global-tasks/global-tasks-panel.component';\nexport * from './lib/components/attachment/image-viewer.component';\nexport * from './lib/components/overlay/chat-overlay.component';\n\n// Components declared AND exported by ConversationsModule but previously missing\n// from public-api. They are used in the templates of exported components (e.g.\n// mj-conversation-chat-area), so a consumer app compiling in Angular's\n// local-compilation / HMR mode fails to build (NG3004: \"Unable to import\n// component … not exported from @memberjunction/ng-conversations\") unless every\n// module-exported component is importable from the package entry point.\nexport * from './lib/components/collection/artifact-create-modal.component';\nexport * from './lib/components/collection/collection-form-modal.component';\nexport * from './lib/components/conversation/conversation-agent-picker.component';\nexport * from './lib/components/conversation/conversation-mode-picker.component';\nexport * from './lib/components/conversation/pinned-messages-panel.component';\nexport * from './lib/components/conversation/forks-popover.component';\nexport * from './lib/components/dialogs/input-dialog.component';\nexport * from './lib/components/dialogs/rating-dialog.component';\nexport * from './lib/components/export/export-modal.component';\nexport * from './lib/components/library/library-full-view.component';\nexport * from './lib/components/members/members-modal.component';\nexport * from './lib/components/message/actionable-commands.component';\nexport * from './lib/components/message/workflow-plan-card.component';\nexport * from './lib/components/search/search-panel.component';\nexport * from './lib/components/shared/user-picker.component';\nexport * from './lib/components/tasks/tasks-dropdown.component';\nexport * from './lib/directives/search-shortcut.directive';\n// SearchResult / SearchResultType are the payload of SearchPanelComponent's\n// ResultSelected output, so consumers cannot type a handler without them.\nexport type { SearchResult, SearchResultType } from './lib/services/search.service';\n\n// PR 2c — Widget extension surface (slots, events, design tokens)\nexport * from './lib/services/conversations-runtime-bootstrap.service';\nexport * from './lib/directives/chat-slot.directive';\nexport * from './lib/components/slots/slot-interfaces';\nexport * from './lib/components/slots/mj-chat-empty-state-default.component';\nexport * from './lib/components/slots/mj-chat-agent-presence-default.component';\nexport * from './lib/components/slots/mj-chat-header-default.component';\nexport * from './lib/components/slots/mj-chat-message-extra-default.component';\nexport * from './lib/components/slots/mj-chat-demonstration-surface-default.component';\nexport * from './lib/components/slots/mj-chat-message-bubble-default.component';\nexport * from './lib/events/chat-events';\n\n// Realtime / voice (PR #2787 — co-agent realtime sessions)\nexport * from './lib/components/realtime/realtime-agent-picker.component';\n// Real-time \"call mode\" overlay + its componentized parts\nexport * from './lib/components/realtime/realtime-session-overlay.component';\nexport * from './lib/components/realtime/realtime-session-state';\nexport * from './lib/components/realtime/realtime-agent-banner.component';\nexport * from './lib/components/realtime/realtime-agent-orb.component';\nexport * from './lib/components/realtime/realtime-session-thread.component';\nexport * from './lib/components/realtime/realtime-delegation-card.component';\nexport * from './lib/components/realtime/realtime-activity-rail.component';\nexport * from './lib/components/realtime/realtime-surface-tabs.component';\nexport * from './lib/components/realtime/realtime-surface-tabs.model';\nexport * from './lib/components/realtime/realtime-surface-stage.model';\nexport * from './lib/components/realtime/realtime-surface-placement-prefs';\nexport * from './lib/components/realtime/realtime-surface-panel-prefs';\nexport * from './lib/components/realtime/realtime-disclosure';\nexport * from './lib/components/realtime/realtime-audio-visuals';\nexport * from './lib/components/realtime/realtime-composer.component';\nexport * from './lib/components/realtime/realtime-channel-strip.component';\n// Conversation-timeline collapse of past realtime sessions (one card per session) + its pure grouping pass\nexport * from './lib/components/realtime/realtime-session-timeline-card.component';\nexport * from './lib/utils/realtime-session-timeline';\n// Pluggable interactive-channel contract (registry-resolved client plugins) + pane host\nexport * from './lib/components/realtime/channels/client-context-channel';\nexport * from './lib/components/realtime/channels/realtime-channel-pane.component';\nexport * from './lib/components/realtime/channels/channel-onboarding-panel.component';\n// Live whiteboard channel plugin + artifact viewer (thin consumers of the generic board).\n// NOTE: the whiteboard itself (engine, tools, components, export builders) lives in\n// @memberjunction/ng-whiteboard — import board types/components from there directly.\nexport * from './lib/components/realtime/whiteboard/whiteboard-channel';\nexport * from './lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component';\n// Remote Browser channel plugin (client-direct, server-hosted browser) + its live surface + tools.\nexport * from './lib/components/realtime/remote-browser/remote-browser-channel';\nexport * from './lib/components/realtime/remote-browser/remote-browser-surface.component';\nexport * from './lib/components/realtime/remote-browser/remote-browser-tools';\nexport * from './lib/components/realtime/remote-browser/remote-browser-audio-player';\n// Media channel plugin (Tabs-layout media display surface) + its state engine, tools, and surface.\nexport * from './lib/components/realtime/media/media-channel';\nexport * from './lib/components/realtime/media/media-channel-state';\nexport * from './lib/components/realtime/media/media-channel-tools';\nexport * from './lib/components/realtime/media/realtime-media-surface.component';\n// Identity Verification channel (generic, opt-in): prove an email address mid-call. State machine + surface.\nexport * from './lib/components/realtime/identity-verification/identity-verification-channel';\nexport * from './lib/components/realtime/identity-verification/identity-verification-model';\nexport * from './lib/components/realtime/identity-verification/identity-verification-surface.component';\n// Camera and Screen Share channels (opt-in, on demand): the agent asks, the user turns the capture on. State + surface.\nexport * from './lib/components/realtime/capture/realtime-capture-channel';\nexport * from './lib/components/realtime/capture/realtime-capture-model';\nexport * from './lib/components/realtime/capture/realtime-capture-surface.component';\n// The Avatar channel (in every call, inert without video): the agent's video on its surface.\nexport * from './lib/components/realtime/avatar/realtime-avatar-channel';\nexport * from './lib/components/realtime/avatar/realtime-avatar-surface.component';\n\n// Interactive Component channel: hosts any component artifact (mj-react-component) next to the call, with a\n// contract derived from the component's own spec. The pure parts (spec -> contract, config, data-state bounding,\n// instance engine, artifact source port) are framework-free; the channel and surface are the Angular layer.\nexport * from './lib/components/realtime/interactive-component/interactive-component-types';\nexport * from './lib/components/realtime/interactive-component/interactive-component-config';\nexport * from './lib/components/realtime/interactive-component/component-contract';\nexport * from './lib/components/realtime/interactive-component/component-data-state';\nexport * from './lib/components/realtime/interactive-component/component-instance-engine';\nexport * from './lib/components/realtime/interactive-component/component-spec-content';\nexport * from './lib/components/realtime/interactive-component/run-view-component-artifact-source';\nexport * from './lib/components/realtime/interactive-component/interactive-component-channel';\nexport * from './lib/components/realtime/interactive-component/realtime-interactive-component-surface.component';\n// Time-aligned Evidence Playback component (recorded session audio synced to the transcript).\nexport * from './lib/components/realtime/evidence-playback/realtime-evidence-playback.component';\nexport * from './lib/services/composer-draft-store';\n"]}
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,uFAAuF;AACvF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,6EAA6E;AAC7E,+EAA+E;AAC/E,kEAAkE;AAClE,cAAc,8BAA8B,CAAC;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E,CAAC;AAChF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,+DAA+D,CAAC;AAC9E,cAAc,sEAAsE,CAAC;AACrF,mGAAmG;AACnG,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,kEAAkE,CAAC;AACjF,6GAA6G;AAC7G,cAAc,+EAA+E,CAAC;AAC9F,cAAc,6EAA6E,CAAC;AAC5F,cAAc,yFAAyF,CAAC;AACxG,wHAAwH;AACxH,cAAc,4DAA4D,CAAC;AAC3E,cAAc,0DAA0D,CAAC;AACzE,cAAc,sEAAsE,CAAC;AACrF,6FAA6F;AAC7F,cAAc,0DAA0D,CAAC;AACzE,cAAc,oEAAoE,CAAC;AAEnF,4GAA4G;AAC5G,iHAAiH;AACjH,4GAA4G;AAC5G,cAAc,6EAA6E,CAAC;AAC5F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,oEAAoE,CAAC;AACnF,cAAc,sEAAsE,CAAC;AACrF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,+EAA+E,CAAC;AAC9F,cAAc,kGAAkG,CAAC;AACjH,8FAA8F;AAC9F,cAAc,kFAAkF,CAAC;AACjG,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface of @memberjunction/ng-conversations\n */\n\n// Module\nexport * from './lib/conversations.module';\n\n// Models\nexport * from './lib/models/conversation-state.model';\nexport * from './lib/models/notification.model';\nexport * from './lib/models/lazy-artifact-info';\nexport * from './lib/models/navigation-request.model';\n// Host rules for an agent turn: reply mode, routes, and the host turn handler contract\nexport * from './lib/models/agent-turn.model';\nexport * from './lib/utils/agent-turn-routing';\n// Opt-in decision routing for an unmentioned message (EnableDecisionRouting)\n// NOTE: the routing decision's builders and types, and IsAgentAllowed, live in\n// @memberjunction/ai-core-plus — import them from there directly.\nexport * from './lib/utils/decision-routing';\n// Fork rules: the delete guard and the open view (Main or one fork)\nexport * from './lib/utils/conversation-branching';\nexport * from './lib/utils/conversation-forks';\nexport * from './lib/utils/agent-failure-display';\n\n// Services - State\nexport * from './lib/services/data-cache.service';\nexport * from './lib/services/artifact-state.service';\nexport * from './lib/services/agent-state.service';\nexport * from './lib/services/conversation-liveness-dom.service';\nexport * from './lib/services/conversation-agent.service';\nexport * from './lib/services/active-tasks.service';\nexport * from './lib/services/conversation-streaming.service';\nexport * from './lib/services/dialog.service';\nexport * from './lib/services/export.service';\nexport * from './lib/services/notification.service';\nexport * from './lib/services/toast.service';\nexport * from './lib/services/mention-parser.service';\n// AI-aware mention suggestion engine (BaseSingleton — use MentionAutocompleteService.Instance).\n// NOTE: the generic MentionSuggestion TYPE lives in @memberjunction/ng-composer — import it\n// from there directly (no re-exports between packages).\nexport * from './lib/services/mention-autocomplete.service';\nexport * from './lib/services/collection-permission.service';\nexport * from './lib/services/artifact-permission.service';\nexport * from './lib/services/artifact-use-tracking.service';\nexport * from './lib/services/collection-state.service';\nexport * from './lib/services/conversation-attachment.service';\nexport * from './lib/services/graphql-attachment-blob-store';\nexport * from './lib/services/ui-command-handler.service';\nexport * from './lib/services/conversation-bridge.service';\nexport * from './lib/services/realtime-session.service';\nexport * from './lib/services/browser-realtime-media-host';\n// NOTE: the realtime session types (RealtimeCaption, RealtimeConnectionState,\n// RealtimeSessionRunOptions, …), the channel plugin base class, and the delegation-result\n// parser now live in `@memberjunction/realtime-runtime`. Import them from there directly —\n// MJ does not re-export across package boundaries.\nexport * from './lib/services/realtime-pairing';\nexport * from './lib/services/user-authorization';\nexport * from './lib/services/realtime-sessions-adapter';\nexport * from './lib/services/realtime-session-review.service';\n\n// Components\nexport * from './lib/components/workspace/conversation-workspace.component';\nexport * from './lib/components/navigation/conversation-navigation.component';\nexport * from './lib/components/sidebar/conversation-sidebar.component';\nexport * from './lib/components/sidebar/routines-section.component';\nexport * from './lib/components/conversation/conversation-list.component';\nexport * from './lib/components/conversation/conversation-chat-area.component';\nexport * from './lib/components/conversation/conversation-empty-state.component';\nexport * from './lib/components/message/message-item.component';\nexport * from './lib/components/message/message-list.component';\nexport * from './lib/components/message/message-input.component';\n// AI-aware composer wrapper (mj-ai-composer): mj-message-input-box + the three AI trigger\n// plugins built in, proxying the input box's full inputs/outputs/methods surface.\nexport * from './lib/components/composer/ai-composer.component';\n// Composer trigger-provider plugins ('@' / '#' / '/') — ClassFactory-registered; also\n// directly instantiable for explicit provider lists.\nexport * from './lib/composer-plugins/base-conversation-mention.provider';\nexport * from './lib/composer-plugins/agent-mention.provider';\nexport * from './lib/composer-plugins/record-mention.provider';\nexport * from './lib/composer-plugins/skill-command.provider';\nexport * from './lib/composer-plugins/load-composer-plugins';\n// NOTE: MessageInputBoxComponent, MentionEditorComponent (+ PendingAttachment), and\n// MentionDropdownComponent live in @memberjunction/ng-composer — import from there directly.\nexport * from './lib/components/message/conversation-message-rating.component';\nexport * from './lib/components/collection/collection-tree.component';\nexport * from './lib/components/collection/collection-view.component';\nexport * from './lib/components/collection/collections-full-view.component';\nexport * from './lib/components/collection/collection-artifact-card.component';\nexport * from './lib/components/collection/artifact-collection-picker-modal.component';\nexport * from './lib/components/collection/collection-share-modal.component';\nexport * from './lib/components/artifact/artifact-share-modal.component';\nexport * from './lib/components/project/project-selector.component';\nexport * from './lib/components/project/project-form-modal.component';\nexport * from './lib/components/task/tasks-full-view.component';\nexport * from './lib/components/tasks/task-widget.component';\nexport * from './lib/components/agent/agent-process-panel.component';\nexport * from './lib/components/agent/active-agent-indicator.component';\nexport * from './lib/components/active-tasks/active-tasks-panel.component';\nexport * from './lib/components/share/share-modal.component';\nexport * from './lib/components/notification/notification-badge.component';\nexport * from './lib/components/notification/activity-indicator.component';\nexport * from './lib/components/toast/toast.component';\nexport * from './lib/components/global-tasks/global-tasks-panel.component';\nexport * from './lib/components/attachment/image-viewer.component';\nexport * from './lib/components/overlay/chat-overlay.component';\n\n// Components declared AND exported by ConversationsModule but previously missing\n// from public-api. They are used in the templates of exported components (e.g.\n// mj-conversation-chat-area), so a consumer app compiling in Angular's\n// local-compilation / HMR mode fails to build (NG3004: \"Unable to import\n// component … not exported from @memberjunction/ng-conversations\") unless every\n// module-exported component is importable from the package entry point.\nexport * from './lib/components/collection/artifact-create-modal.component';\nexport * from './lib/components/collection/collection-form-modal.component';\nexport * from './lib/components/conversation/conversation-agent-picker.component';\nexport * from './lib/components/conversation/conversation-mode-picker.component';\nexport * from './lib/components/conversation/pinned-messages-panel.component';\nexport * from './lib/components/conversation/forks-popover.component';\nexport * from './lib/components/dialogs/input-dialog.component';\nexport * from './lib/components/dialogs/rating-dialog.component';\nexport * from './lib/components/export/export-modal.component';\nexport * from './lib/components/library/library-full-view.component';\nexport * from './lib/components/members/members-modal.component';\nexport * from './lib/components/message/actionable-commands.component';\nexport * from './lib/components/message/workflow-plan-card.component';\nexport * from './lib/components/search/search-panel.component';\nexport * from './lib/components/shared/user-picker.component';\nexport * from './lib/components/tasks/tasks-dropdown.component';\nexport * from './lib/directives/search-shortcut.directive';\n// SearchResult / SearchResultType are the payload of SearchPanelComponent's\n// ResultSelected output, so consumers cannot type a handler without them.\nexport type { SearchResult, SearchResultType } from './lib/services/search.service';\n\n// PR 2c — Widget extension surface (slots, events, design tokens)\nexport * from './lib/services/conversations-runtime-bootstrap.service';\nexport * from './lib/directives/chat-slot.directive';\nexport * from './lib/components/slots/slot-interfaces';\nexport * from './lib/components/slots/mj-chat-empty-state-default.component';\nexport * from './lib/components/slots/mj-chat-agent-presence-default.component';\nexport * from './lib/components/slots/mj-chat-header-default.component';\nexport * from './lib/components/slots/mj-chat-message-extra-default.component';\nexport * from './lib/components/slots/mj-chat-demonstration-surface-default.component';\nexport * from './lib/components/slots/mj-chat-message-bubble-default.component';\nexport * from './lib/events/chat-events';\n\n// Realtime / voice (PR #2787 — co-agent realtime sessions)\nexport * from './lib/components/realtime/realtime-agent-picker.component';\n// Real-time \"call mode\" overlay + its componentized parts\nexport * from './lib/components/realtime/realtime-session-overlay.component';\nexport * from './lib/components/realtime/realtime-session-state';\nexport * from './lib/components/realtime/realtime-agent-banner.component';\nexport * from './lib/components/realtime/realtime-agent-orb.component';\nexport * from './lib/components/realtime/realtime-session-thread.component';\nexport * from './lib/components/realtime/realtime-delegation-card.component';\nexport * from './lib/components/realtime/realtime-activity-rail.component';\nexport * from './lib/components/realtime/realtime-surface-tabs.component';\nexport * from './lib/components/realtime/realtime-surface-tabs.model';\nexport * from './lib/components/realtime/realtime-surface-stage.model';\nexport * from './lib/components/realtime/realtime-surface-placement-prefs';\nexport * from './lib/components/realtime/realtime-surface-panel-prefs';\nexport * from './lib/components/realtime/realtime-disclosure';\nexport * from './lib/components/realtime/realtime-audio-visuals';\nexport * from './lib/components/realtime/realtime-composer.component';\nexport * from './lib/components/realtime/realtime-channel-strip.component';\n// Conversation-timeline collapse of past realtime sessions (one card per session) + its pure grouping pass\nexport * from './lib/components/realtime/realtime-session-timeline-card.component';\nexport * from './lib/utils/realtime-session-timeline';\n// Pluggable interactive-channel contract (registry-resolved client plugins) + pane host\nexport * from './lib/components/realtime/channels/client-context-channel';\nexport * from './lib/components/realtime/channels/realtime-channel-pane.component';\nexport * from './lib/components/realtime/channels/channel-onboarding-panel.component';\n// Live whiteboard channel plugin + artifact viewer (thin consumers of the generic board).\n// NOTE: the whiteboard itself (engine, tools, components, export builders) lives in\n// @memberjunction/ng-whiteboard — import board types/components from there directly.\nexport * from './lib/components/realtime/whiteboard/whiteboard-channel';\nexport * from './lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component';\n// Remote Browser channel plugin (client-direct, server-hosted browser) + its live surface + tools.\nexport * from './lib/components/realtime/remote-browser/remote-browser-channel';\nexport * from './lib/components/realtime/remote-browser/remote-browser-surface.component';\nexport * from './lib/components/realtime/remote-browser/remote-browser-tools';\nexport * from './lib/components/realtime/remote-browser/remote-browser-audio-player';\n// Media channel plugin (Tabs-layout media display surface) + its state engine, tools, and surface.\nexport * from './lib/components/realtime/media/media-channel';\nexport * from './lib/components/realtime/media/media-channel-state';\nexport * from './lib/components/realtime/media/media-channel-tools';\nexport * from './lib/components/realtime/media/realtime-media-surface.component';\n// Identity Verification channel (generic, opt-in): prove an email address mid-call. State machine + surface.\nexport * from './lib/components/realtime/identity-verification/identity-verification-channel';\nexport * from './lib/components/realtime/identity-verification/identity-verification-model';\nexport * from './lib/components/realtime/identity-verification/identity-verification-surface.component';\n// Camera and Screen Share channels (opt-in, on demand): the agent asks, the user turns the capture on. State + surface.\nexport * from './lib/components/realtime/capture/realtime-capture-channel';\nexport * from './lib/components/realtime/capture/realtime-capture-model';\nexport * from './lib/components/realtime/capture/realtime-capture-surface.component';\n// The Avatar channel (in every call, inert without video): the agent's video on its surface.\nexport * from './lib/components/realtime/avatar/realtime-avatar-channel';\nexport * from './lib/components/realtime/avatar/realtime-avatar-surface.component';\n\n// Interactive Component channel: hosts any component artifact (mj-react-component) next to the call, with a\n// contract derived from the component's own spec. The pure parts (spec -> contract, config, data-state bounding,\n// instance engine, artifact source port) are framework-free; the channel and surface are the Angular layer.\nexport * from './lib/components/realtime/interactive-component/interactive-component-types';\nexport * from './lib/components/realtime/interactive-component/interactive-component-config';\nexport * from './lib/components/realtime/interactive-component/component-contract';\nexport * from './lib/components/realtime/interactive-component/component-data-state';\nexport * from './lib/components/realtime/interactive-component/component-instance-engine';\nexport * from './lib/components/realtime/interactive-component/component-spec-content';\nexport * from './lib/components/realtime/interactive-component/run-view-component-artifact-source';\nexport * from './lib/components/realtime/interactive-component/interactive-component-channel';\nexport * from './lib/components/realtime/interactive-component/realtime-interactive-component-surface.component';\n// Time-aligned Evidence Playback component (recorded session audio synced to the transcript).\nexport * from './lib/components/realtime/evidence-playback/realtime-evidence-playback.component';\nexport * from './lib/services/composer-draft-store';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-conversations",
|
|
3
|
-
"version": "6.2.0-edge.
|
|
3
|
+
"version": "6.2.0-edge.6",
|
|
4
4
|
"description": "MemberJunction: Conversation, Collection, and Artifact management components for any Angular application",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@angular/compiler": "21.2.22",
|
|
15
15
|
"@angular/compiler-cli": "21.2.22",
|
|
16
16
|
"@fortawesome/fontawesome-free": "6.7.2",
|
|
17
|
-
"@memberjunction/ng-test-utils": "6.2.0-edge.
|
|
17
|
+
"@memberjunction/ng-test-utils": "6.2.0-edge.6",
|
|
18
18
|
"sass": "^1.97.3",
|
|
19
19
|
"vitest": "^4.0.18"
|
|
20
20
|
},
|
|
@@ -27,40 +27,40 @@
|
|
|
27
27
|
"@angular/platform-browser": "^21.2.22"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@memberjunction/ai": "6.2.0-edge.
|
|
31
|
-
"@memberjunction/ai-agent-client": "6.2.0-edge.
|
|
32
|
-
"@memberjunction/ai-core-plus": "6.2.0-edge.
|
|
33
|
-
"@memberjunction/ai-engine-base": "6.2.0-edge.
|
|
34
|
-
"@memberjunction/ai-realtime-client": "6.2.0-edge.
|
|
35
|
-
"@memberjunction/conversations-runtime": "6.2.0-edge.
|
|
36
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
37
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
38
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
39
|
-
"@memberjunction/graphql-dataprovider": "6.2.0-edge.
|
|
40
|
-
"@memberjunction/interactive-component-types": "6.2.0-edge.
|
|
41
|
-
"@memberjunction/ng-agent-client": "6.2.0-edge.
|
|
42
|
-
"@memberjunction/ng-artifacts": "6.2.0-edge.
|
|
43
|
-
"@memberjunction/ng-base-forms": "6.2.0-edge.
|
|
44
|
-
"@memberjunction/ng-base-types": "6.2.0-edge.
|
|
45
|
-
"@memberjunction/ng-code-editor": "6.2.0-edge.
|
|
46
|
-
"@memberjunction/ng-composer": "6.2.0-edge.
|
|
47
|
-
"@memberjunction/ng-container-directives": "6.2.0-edge.
|
|
48
|
-
"@memberjunction/ng-forms": "6.2.0-edge.
|
|
49
|
-
"@memberjunction/ng-markdown": "6.2.0-edge.
|
|
50
|
-
"@memberjunction/ng-media-player": "6.2.0-edge.
|
|
51
|
-
"@memberjunction/ng-notifications": "6.2.0-edge.
|
|
52
|
-
"@memberjunction/ng-react": "6.2.0-edge.
|
|
53
|
-
"@memberjunction/ng-realtime-channels": "6.2.0-edge.
|
|
54
|
-
"@memberjunction/ng-realtime-media": "6.2.0-edge.
|
|
55
|
-
"@memberjunction/ng-resource-permissions": "6.2.0-edge.
|
|
56
|
-
"@memberjunction/ng-shared-generic": "6.2.0-edge.
|
|
57
|
-
"@memberjunction/ng-task-graph-editor": "6.2.0-edge.
|
|
58
|
-
"@memberjunction/ng-tasks": "6.2.0-edge.
|
|
59
|
-
"@memberjunction/ng-testing": "6.2.0-edge.
|
|
60
|
-
"@memberjunction/ng-ui-components": "6.2.0-edge.
|
|
61
|
-
"@memberjunction/ng-user-routines": "6.2.0-edge.
|
|
62
|
-
"@memberjunction/ng-whiteboard": "6.2.0-edge.
|
|
63
|
-
"@memberjunction/realtime-runtime": "6.2.0-edge.
|
|
30
|
+
"@memberjunction/ai": "6.2.0-edge.6",
|
|
31
|
+
"@memberjunction/ai-agent-client": "6.2.0-edge.6",
|
|
32
|
+
"@memberjunction/ai-core-plus": "6.2.0-edge.6",
|
|
33
|
+
"@memberjunction/ai-engine-base": "6.2.0-edge.6",
|
|
34
|
+
"@memberjunction/ai-realtime-client": "6.2.0-edge.6",
|
|
35
|
+
"@memberjunction/conversations-runtime": "6.2.0-edge.6",
|
|
36
|
+
"@memberjunction/core": "6.2.0-edge.6",
|
|
37
|
+
"@memberjunction/core-entities": "6.2.0-edge.6",
|
|
38
|
+
"@memberjunction/global": "6.2.0-edge.6",
|
|
39
|
+
"@memberjunction/graphql-dataprovider": "6.2.0-edge.6",
|
|
40
|
+
"@memberjunction/interactive-component-types": "6.2.0-edge.6",
|
|
41
|
+
"@memberjunction/ng-agent-client": "6.2.0-edge.6",
|
|
42
|
+
"@memberjunction/ng-artifacts": "6.2.0-edge.6",
|
|
43
|
+
"@memberjunction/ng-base-forms": "6.2.0-edge.6",
|
|
44
|
+
"@memberjunction/ng-base-types": "6.2.0-edge.6",
|
|
45
|
+
"@memberjunction/ng-code-editor": "6.2.0-edge.6",
|
|
46
|
+
"@memberjunction/ng-composer": "6.2.0-edge.6",
|
|
47
|
+
"@memberjunction/ng-container-directives": "6.2.0-edge.6",
|
|
48
|
+
"@memberjunction/ng-forms": "6.2.0-edge.6",
|
|
49
|
+
"@memberjunction/ng-markdown": "6.2.0-edge.6",
|
|
50
|
+
"@memberjunction/ng-media-player": "6.2.0-edge.6",
|
|
51
|
+
"@memberjunction/ng-notifications": "6.2.0-edge.6",
|
|
52
|
+
"@memberjunction/ng-react": "6.2.0-edge.6",
|
|
53
|
+
"@memberjunction/ng-realtime-channels": "6.2.0-edge.6",
|
|
54
|
+
"@memberjunction/ng-realtime-media": "6.2.0-edge.6",
|
|
55
|
+
"@memberjunction/ng-resource-permissions": "6.2.0-edge.6",
|
|
56
|
+
"@memberjunction/ng-shared-generic": "6.2.0-edge.6",
|
|
57
|
+
"@memberjunction/ng-task-graph-editor": "6.2.0-edge.6",
|
|
58
|
+
"@memberjunction/ng-tasks": "6.2.0-edge.6",
|
|
59
|
+
"@memberjunction/ng-testing": "6.2.0-edge.6",
|
|
60
|
+
"@memberjunction/ng-ui-components": "6.2.0-edge.6",
|
|
61
|
+
"@memberjunction/ng-user-routines": "6.2.0-edge.6",
|
|
62
|
+
"@memberjunction/ng-whiteboard": "6.2.0-edge.6",
|
|
63
|
+
"@memberjunction/realtime-runtime": "6.2.0-edge.6",
|
|
64
64
|
"angular-split": "^20.0.0",
|
|
65
65
|
"rxjs": "^7.8.2",
|
|
66
66
|
"tslib": "^2.8.1"
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** The slice of `window` the guard needs; lets tests (and non-window hosts) supply a fake. */
|
|
2
|
-
export interface UnloadEventTarget {
|
|
3
|
-
addEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;
|
|
4
|
-
removeEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Keeps the browser tab from closing silently while a call's end-of-call recording is still
|
|
8
|
-
* uploading (#5195). The upload runs after the user presses End, so closing the tab in that window
|
|
9
|
-
* used to lose the recording with no warning; while armed, the browser shows its native
|
|
10
|
-
* "leave site?" confirmation instead.
|
|
11
|
-
*
|
|
12
|
-
* The handler calls `preventDefault()` AND sets `returnValue = true`. Modern browsers only need
|
|
13
|
-
* `preventDefault()`, but Chromium before 119 prompts only when `returnValue` is set — and per the
|
|
14
|
-
* spec an empty string means "no prompt", so it must be a truthy value. Browsers show the prompt
|
|
15
|
-
* only after a user gesture on the page; pressing End always is one.
|
|
16
|
-
*
|
|
17
|
-
* Desktop browsers only: closing a tab from a mobile tab switcher never fires a prompt, so this
|
|
18
|
-
* is a best-effort guard, not a guarantee.
|
|
19
|
-
*/
|
|
20
|
-
export declare class BrowserRecordingUnloadGuard {
|
|
21
|
-
private readonly target;
|
|
22
|
-
private armed;
|
|
23
|
-
/** @param target `window` in a browser; `null` where there is none (SSR/tests) — arming is then a tracked no-op. */
|
|
24
|
-
constructor(target: UnloadEventTarget | null);
|
|
25
|
-
get IsArmed(): boolean;
|
|
26
|
-
/** Idempotent: arming twice registers one listener, disarming when unarmed does nothing. */
|
|
27
|
-
SetArmed(armed: boolean): void;
|
|
28
|
-
private readonly onBeforeUnload;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=browser-recording-unload-guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-recording-unload-guard.d.ts","sourceRoot":"","sources":["../../../src/lib/services/browser-recording-unload-guard.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,WAAW,iBAAiB;IAE9B,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI,CAAC;IAE3F,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI,CAAC;CACjG;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,2BAA2B;IAIxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,KAAK,CAAS;IAEtB,oHAAoH;gBACvF,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAE7D,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,4FAA4F;IACrF,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IASrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;CACL"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Keeps the browser tab from closing silently while a call's end-of-call recording is still
|
|
3
|
-
* uploading (#5195). The upload runs after the user presses End, so closing the tab in that window
|
|
4
|
-
* used to lose the recording with no warning; while armed, the browser shows its native
|
|
5
|
-
* "leave site?" confirmation instead.
|
|
6
|
-
*
|
|
7
|
-
* The handler calls `preventDefault()` AND sets `returnValue = true`. Modern browsers only need
|
|
8
|
-
* `preventDefault()`, but Chromium before 119 prompts only when `returnValue` is set — and per the
|
|
9
|
-
* spec an empty string means "no prompt", so it must be a truthy value. Browsers show the prompt
|
|
10
|
-
* only after a user gesture on the page; pressing End always is one.
|
|
11
|
-
*
|
|
12
|
-
* Desktop browsers only: closing a tab from a mobile tab switcher never fires a prompt, so this
|
|
13
|
-
* is a best-effort guard, not a guarantee.
|
|
14
|
-
*/
|
|
15
|
-
export class BrowserRecordingUnloadGuard {
|
|
16
|
-
target;
|
|
17
|
-
armed = false;
|
|
18
|
-
/** @param target `window` in a browser; `null` where there is none (SSR/tests) — arming is then a tracked no-op. */
|
|
19
|
-
constructor(target) {
|
|
20
|
-
this.target = target;
|
|
21
|
-
}
|
|
22
|
-
get IsArmed() {
|
|
23
|
-
return this.armed;
|
|
24
|
-
}
|
|
25
|
-
/** Idempotent: arming twice registers one listener, disarming when unarmed does nothing. */
|
|
26
|
-
SetArmed(armed) {
|
|
27
|
-
if (armed === this.armed)
|
|
28
|
-
return;
|
|
29
|
-
this.armed = armed;
|
|
30
|
-
if (!this.target)
|
|
31
|
-
return;
|
|
32
|
-
if (armed)
|
|
33
|
-
this.target.addEventListener('beforeunload', this.onBeforeUnload);
|
|
34
|
-
else
|
|
35
|
-
this.target.removeEventListener('beforeunload', this.onBeforeUnload);
|
|
36
|
-
}
|
|
37
|
-
// Arrow property so add/remove see the same function identity.
|
|
38
|
-
onBeforeUnload = (event) => {
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
event.returnValue = true;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=browser-recording-unload-guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-recording-unload-guard.js","sourceRoot":"","sources":["../../../src/lib/services/browser-recording-unload-guard.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,2BAA2B;IAIP;IAHrB,KAAK,GAAG,KAAK,CAAC;IAEtB,oHAAoH;IACpH,YAA6B,MAAgC;QAAhC,WAAM,GAAN,MAAM,CAA0B;IAAG,CAAC;IAEjE,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,4FAA4F;IACrF,QAAQ,CAAC,KAAc;QAC1B,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK;YAAE,OAAO;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QACzB,IAAI,KAAK;YAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;;YACxE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9E,CAAC;IAED,+DAA+D;IAC9C,cAAc,GAAG,CAAC,KAAwB,EAAQ,EAAE;QACjE,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAC;CACL","sourcesContent":["/** The slice of `window` the guard needs; lets tests (and non-window hosts) supply a fake. */\nexport interface UnloadEventTarget {\n // case-violation-ok-legacy-back-compat: mirrors the DOM EventTarget API so `window` itself satisfies this interface\n addEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n // case-violation-ok-legacy-back-compat: mirrors the DOM EventTarget API so `window` itself satisfies this interface\n removeEventListener(type: 'beforeunload', listener: (event: BeforeUnloadEvent) => void): void;\n}\n\n/**\n * Keeps the browser tab from closing silently while a call's end-of-call recording is still\n * uploading (#5195). The upload runs after the user presses End, so closing the tab in that window\n * used to lose the recording with no warning; while armed, the browser shows its native\n * \"leave site?\" confirmation instead.\n *\n * The handler calls `preventDefault()` AND sets `returnValue = true`. Modern browsers only need\n * `preventDefault()`, but Chromium before 119 prompts only when `returnValue` is set — and per the\n * spec an empty string means \"no prompt\", so it must be a truthy value. Browsers show the prompt\n * only after a user gesture on the page; pressing End always is one.\n *\n * Desktop browsers only: closing a tab from a mobile tab switcher never fires a prompt, so this\n * is a best-effort guard, not a guarantee.\n */\nexport class BrowserRecordingUnloadGuard {\n private armed = false;\n\n /** @param target `window` in a browser; `null` where there is none (SSR/tests) — arming is then a tracked no-op. */\n constructor(private readonly target: UnloadEventTarget | null) {}\n\n public get IsArmed(): boolean {\n return this.armed;\n }\n\n /** Idempotent: arming twice registers one listener, disarming when unarmed does nothing. */\n public SetArmed(armed: boolean): void {\n if (armed === this.armed) return;\n this.armed = armed;\n if (!this.target) return;\n if (armed) this.target.addEventListener('beforeunload', this.onBeforeUnload);\n else this.target.removeEventListener('beforeunload', this.onBeforeUnload);\n }\n\n // Arrow property so add/remove see the same function identity.\n private readonly onBeforeUnload = (event: BeforeUnloadEvent): void => {\n event.preventDefault();\n event.returnValue = true;\n };\n}\n"]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Pure, browser-and-node-safe helpers for the CLIENT-DIRECT realtime recorder:
|
|
3
|
-
* encoding accumulated Float32 PCM into a seekable 16-bit PCM **WAV** container and computing a
|
|
4
|
-
* bounded, downsampled waveform **peak** array at capture time.
|
|
5
|
-
*
|
|
6
|
-
* These functions are deliberately free of any browser API (`AudioContext`, `Blob`, …) so they can
|
|
7
|
-
* be unit-tested in a plain Node environment. {@link RealtimeAudioRecorder} owns the live audio
|
|
8
|
-
* graph and feeds the captured samples here.
|
|
9
|
-
*
|
|
10
|
-
* Why WAV (PCM) over webm/opus: a RIFF/WAVE header carries the exact duration and maps a byte
|
|
11
|
-
* offset linearly to a time offset, so HTTP-range seeking is exact (no client-side duration nudge),
|
|
12
|
-
* and peak extraction is trivial. The tradeoff is size — PCM WAV is larger than opus — which is
|
|
13
|
-
* acceptable for these short session recordings.
|
|
14
|
-
*
|
|
15
|
-
* @module @memberjunction/ng-conversations/realtime-pcm-wav
|
|
16
|
-
*/
|
|
17
|
-
/** Canonical WAV/PCM header size in bytes (RIFF + fmt + data chunk headers). */
|
|
18
|
-
export declare const WAV_HEADER_BYTES = 44;
|
|
19
|
-
/**
|
|
20
|
-
* Encodes mono Float32 PCM samples as a canonical single-chunk 16-bit PCM WAV (RIFF/WAVE).
|
|
21
|
-
* The returned `ArrayBuffer` is `WAV_HEADER_BYTES + samples.length * 2` bytes — a proper
|
|
22
|
-
* 44-byte header followed by little-endian PCM16 data, so it is seekable and self-describing.
|
|
23
|
-
*
|
|
24
|
-
* @param samples Mono Float32 PCM in `[-1, 1]` (downmixed by the caller).
|
|
25
|
-
* @param sampleRate Sample rate in Hz (from the capturing `AudioContext`).
|
|
26
|
-
* @returns A standalone `ArrayBuffer` containing the full WAV file.
|
|
27
|
-
*/
|
|
28
|
-
export declare function EncodePcm16Wav(samples: Float32Array, sampleRate: number): ArrayBuffer;
|
|
29
|
-
/** @deprecated Use {@link EncodePcm16Wav}. */
|
|
30
|
-
export declare function encodePcm16Wav(samples: Float32Array, sampleRate: number): ArrayBuffer;
|
|
31
|
-
/**
|
|
32
|
-
* A bounded, streaming waveform-peak accumulator. It maintains a fixed number of buckets
|
|
33
|
-
* (`targetBuckets`) of max-absolute amplitude across the WHOLE recording regardless of length:
|
|
34
|
-
* once every bucket has absorbed `samplesPerBucket` samples, the buckets are halved (pairwise
|
|
35
|
-
* max-merged) and the per-bucket capacity doubles — so memory + cost stay O(targetBuckets) for an
|
|
36
|
-
* arbitrarily long call. {@link Normalize} returns the final 0..1 peaks.
|
|
37
|
-
*/
|
|
38
|
-
export declare class PeakAccumulator {
|
|
39
|
-
/** Target (max) number of buckets in the produced peak array. */
|
|
40
|
-
private readonly targetBuckets;
|
|
41
|
-
/** Current max-abs amplitude per bucket (length grows up to `2 * targetBuckets` before folding). */
|
|
42
|
-
private buckets;
|
|
43
|
-
/** How many samples each bucket currently absorbs before a new bucket opens. */
|
|
44
|
-
private samplesPerBucket;
|
|
45
|
-
/** Samples absorbed into the current (last) bucket so far. */
|
|
46
|
-
private samplesInCurrent;
|
|
47
|
-
/**
|
|
48
|
-
* @param targetBuckets Desired bucket count (waveform resolution). Clamped to >= 1.
|
|
49
|
-
* ~600 gives a smooth overview waveform at trivial cost.
|
|
50
|
-
*/
|
|
51
|
-
constructor(targetBuckets?: number);
|
|
52
|
-
/** Number of buckets currently held (for tests/inspection). */
|
|
53
|
-
get BucketCount(): number;
|
|
54
|
-
/** Absorbs a block of Float32 PCM samples, updating the running per-bucket max-abs. */
|
|
55
|
-
Push(samples: Float32Array): void;
|
|
56
|
-
/** Absorbs one sample into the current bucket, opening/folding buckets as capacity is reached. */
|
|
57
|
-
private pushSample;
|
|
58
|
-
/** Pairwise max-merges adjacent buckets, halving the count and doubling per-bucket capacity. */
|
|
59
|
-
private fold;
|
|
60
|
-
/**
|
|
61
|
-
* Produces the final normalized peak array (each value 0..1, divided by the global max).
|
|
62
|
-
* Trailing empty buckets are trimmed; an all-silent / empty recording yields `[]`.
|
|
63
|
-
*/
|
|
64
|
-
Normalize(): number[];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* One-shot peak downsampling of a complete Float32 PCM buffer into `targetBuckets` normalized
|
|
68
|
-
* max-abs peaks (0..1). The streaming {@link PeakAccumulator} is the production path; this is the
|
|
69
|
-
* direct, allocation-light equivalent used where the whole buffer is already in hand (and in tests).
|
|
70
|
-
*
|
|
71
|
-
* @param samples The full mono Float32 PCM buffer.
|
|
72
|
-
* @param targetBuckets Desired bucket count (clamped to >= 1). Buckets beyond the sample count are
|
|
73
|
-
* not produced — a short buffer yields at most `samples.length` peaks.
|
|
74
|
-
* @returns Normalized peaks; `[]` for an empty or all-silent buffer.
|
|
75
|
-
*/
|
|
76
|
-
export declare function DownsamplePeaks(samples: Float32Array, targetBuckets?: number): number[];
|
|
77
|
-
/** @deprecated Use {@link DownsamplePeaks}. */
|
|
78
|
-
export declare function downsamplePeaks(samples: Float32Array, targetBuckets?: number): number[];
|
|
79
|
-
//# sourceMappingURL=realtime-pcm-wav.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-pcm-wav.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-pcm-wav.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAcnC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAkCrF;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAErF;AASD;;;;;;GAMG;AACH,qBAAa,eAAe;IACxB,iEAAiE;IACjE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,oGAAoG;IACpG,OAAO,CAAC,OAAO,CAAgB;IAC/B,gFAAgF;IAChF,OAAO,CAAC,gBAAgB,CAAK;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,gBAAgB,CAAK;IAE7B;;;OAGG;gBACS,aAAa,SAAM;IAI/B,+DAA+D;IAC/D,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,uFAAuF;IAChF,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAMxC,kGAAkG;IAClG,OAAO,CAAC,UAAU;IAsBlB,gGAAgG;IAChG,OAAO,CAAC,IAAI;IAYZ;;;OAGG;IACI,SAAS,IAAI,MAAM,EAAE;CAgB/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,SAAM,GAAG,MAAM,EAAE,CA4BpF;AAED,+CAA+C;AAC/C,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,SAAM,GAAG,MAAM,EAAE,CAEpF"}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Pure, browser-and-node-safe helpers for the CLIENT-DIRECT realtime recorder:
|
|
3
|
-
* encoding accumulated Float32 PCM into a seekable 16-bit PCM **WAV** container and computing a
|
|
4
|
-
* bounded, downsampled waveform **peak** array at capture time.
|
|
5
|
-
*
|
|
6
|
-
* These functions are deliberately free of any browser API (`AudioContext`, `Blob`, …) so they can
|
|
7
|
-
* be unit-tested in a plain Node environment. {@link RealtimeAudioRecorder} owns the live audio
|
|
8
|
-
* graph and feeds the captured samples here.
|
|
9
|
-
*
|
|
10
|
-
* Why WAV (PCM) over webm/opus: a RIFF/WAVE header carries the exact duration and maps a byte
|
|
11
|
-
* offset linearly to a time offset, so HTTP-range seeking is exact (no client-side duration nudge),
|
|
12
|
-
* and peak extraction is trivial. The tradeoff is size — PCM WAV is larger than opus — which is
|
|
13
|
-
* acceptable for these short session recordings.
|
|
14
|
-
*
|
|
15
|
-
* @module @memberjunction/ng-conversations/realtime-pcm-wav
|
|
16
|
-
*/
|
|
17
|
-
/** Lowest value representable by signed 16-bit PCM. */
|
|
18
|
-
const PCM16_MIN = -32768;
|
|
19
|
-
/** Highest value representable by signed 16-bit PCM. */
|
|
20
|
-
const PCM16_MAX = 32767;
|
|
21
|
-
/** Canonical WAV/PCM header size in bytes (RIFF + fmt + data chunk headers). */
|
|
22
|
-
export const WAV_HEADER_BYTES = 44;
|
|
23
|
-
/**
|
|
24
|
-
* Converts one Float32 sample (nominally in `[-1, 1]`) to a clamped signed 16-bit integer.
|
|
25
|
-
* Out-of-range values (a hot mix can briefly exceed unity) are clamped, not wrapped.
|
|
26
|
-
*/
|
|
27
|
-
function floatToPcm16(sample) {
|
|
28
|
-
const clamped = sample < -1 ? -1 : sample > 1 ? 1 : sample;
|
|
29
|
-
// Asymmetric scaling: negative full-scale is -32768, positive is +32767.
|
|
30
|
-
const scaled = clamped < 0 ? clamped * -PCM16_MIN : clamped * PCM16_MAX;
|
|
31
|
-
const rounded = Math.round(scaled);
|
|
32
|
-
return rounded < PCM16_MIN ? PCM16_MIN : rounded > PCM16_MAX ? PCM16_MAX : rounded;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Encodes mono Float32 PCM samples as a canonical single-chunk 16-bit PCM WAV (RIFF/WAVE).
|
|
36
|
-
* The returned `ArrayBuffer` is `WAV_HEADER_BYTES + samples.length * 2` bytes — a proper
|
|
37
|
-
* 44-byte header followed by little-endian PCM16 data, so it is seekable and self-describing.
|
|
38
|
-
*
|
|
39
|
-
* @param samples Mono Float32 PCM in `[-1, 1]` (downmixed by the caller).
|
|
40
|
-
* @param sampleRate Sample rate in Hz (from the capturing `AudioContext`).
|
|
41
|
-
* @returns A standalone `ArrayBuffer` containing the full WAV file.
|
|
42
|
-
*/
|
|
43
|
-
export function EncodePcm16Wav(samples, sampleRate) {
|
|
44
|
-
const numChannels = 1;
|
|
45
|
-
const bitsPerSample = 16;
|
|
46
|
-
const bytesPerSample = bitsPerSample / 8;
|
|
47
|
-
const blockAlign = numChannels * bytesPerSample;
|
|
48
|
-
const byteRate = sampleRate * blockAlign;
|
|
49
|
-
const dataSize = samples.length * bytesPerSample;
|
|
50
|
-
const buffer = new ArrayBuffer(WAV_HEADER_BYTES + dataSize);
|
|
51
|
-
const view = new DataView(buffer);
|
|
52
|
-
writeAscii(view, 0, 'RIFF');
|
|
53
|
-
view.setUint32(4, 36 + dataSize, true); // ChunkSize = 36 + Subchunk2Size
|
|
54
|
-
writeAscii(view, 8, 'WAVE');
|
|
55
|
-
writeAscii(view, 12, 'fmt ');
|
|
56
|
-
view.setUint32(16, 16, true); // Subchunk1Size (16 for PCM)
|
|
57
|
-
view.setUint16(20, 1, true); // AudioFormat = PCM
|
|
58
|
-
view.setUint16(22, numChannels, true);
|
|
59
|
-
view.setUint32(24, sampleRate, true);
|
|
60
|
-
view.setUint32(28, byteRate, true);
|
|
61
|
-
view.setUint16(32, blockAlign, true);
|
|
62
|
-
view.setUint16(34, bitsPerSample, true);
|
|
63
|
-
writeAscii(view, 36, 'data');
|
|
64
|
-
view.setUint32(40, dataSize, true);
|
|
65
|
-
let offset = WAV_HEADER_BYTES;
|
|
66
|
-
for (let i = 0; i < samples.length; i++) {
|
|
67
|
-
view.setInt16(offset, floatToPcm16(samples[i]), true);
|
|
68
|
-
offset += bytesPerSample;
|
|
69
|
-
}
|
|
70
|
-
return buffer;
|
|
71
|
-
}
|
|
72
|
-
/** @deprecated Use {@link EncodePcm16Wav}. */
|
|
73
|
-
export function encodePcm16Wav(samples, sampleRate) {
|
|
74
|
-
return EncodePcm16Wav(samples, sampleRate);
|
|
75
|
-
}
|
|
76
|
-
/** Writes an ASCII string into a {@link DataView} byte-by-byte at `offset`. */
|
|
77
|
-
function writeAscii(view, offset, text) {
|
|
78
|
-
for (let i = 0; i < text.length; i++) {
|
|
79
|
-
view.setUint8(offset + i, text.charCodeAt(i));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* A bounded, streaming waveform-peak accumulator. It maintains a fixed number of buckets
|
|
84
|
-
* (`targetBuckets`) of max-absolute amplitude across the WHOLE recording regardless of length:
|
|
85
|
-
* once every bucket has absorbed `samplesPerBucket` samples, the buckets are halved (pairwise
|
|
86
|
-
* max-merged) and the per-bucket capacity doubles — so memory + cost stay O(targetBuckets) for an
|
|
87
|
-
* arbitrarily long call. {@link Normalize} returns the final 0..1 peaks.
|
|
88
|
-
*/
|
|
89
|
-
export class PeakAccumulator {
|
|
90
|
-
/** Target (max) number of buckets in the produced peak array. */
|
|
91
|
-
targetBuckets;
|
|
92
|
-
/** Current max-abs amplitude per bucket (length grows up to `2 * targetBuckets` before folding). */
|
|
93
|
-
buckets = [];
|
|
94
|
-
/** How many samples each bucket currently absorbs before a new bucket opens. */
|
|
95
|
-
samplesPerBucket = 1;
|
|
96
|
-
/** Samples absorbed into the current (last) bucket so far. */
|
|
97
|
-
samplesInCurrent = 0;
|
|
98
|
-
/**
|
|
99
|
-
* @param targetBuckets Desired bucket count (waveform resolution). Clamped to >= 1.
|
|
100
|
-
* ~600 gives a smooth overview waveform at trivial cost.
|
|
101
|
-
*/
|
|
102
|
-
constructor(targetBuckets = 600) {
|
|
103
|
-
this.targetBuckets = Math.max(1, Math.floor(targetBuckets));
|
|
104
|
-
}
|
|
105
|
-
/** Number of buckets currently held (for tests/inspection). */
|
|
106
|
-
get BucketCount() {
|
|
107
|
-
return this.buckets.length;
|
|
108
|
-
}
|
|
109
|
-
/** Absorbs a block of Float32 PCM samples, updating the running per-bucket max-abs. */
|
|
110
|
-
Push(samples) {
|
|
111
|
-
for (let i = 0; i < samples.length; i++) {
|
|
112
|
-
this.pushSample(samples[i]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/** Absorbs one sample into the current bucket, opening/folding buckets as capacity is reached. */
|
|
116
|
-
pushSample(sample) {
|
|
117
|
-
if (this.buckets.length === 0) {
|
|
118
|
-
this.buckets.push(0);
|
|
119
|
-
this.samplesInCurrent = 0;
|
|
120
|
-
}
|
|
121
|
-
const abs = sample < 0 ? -sample : sample;
|
|
122
|
-
const last = this.buckets.length - 1;
|
|
123
|
-
if (abs > this.buckets[last]) {
|
|
124
|
-
this.buckets[last] = abs;
|
|
125
|
-
}
|
|
126
|
-
this.samplesInCurrent++;
|
|
127
|
-
if (this.samplesInCurrent >= this.samplesPerBucket) {
|
|
128
|
-
this.buckets.push(0);
|
|
129
|
-
this.samplesInCurrent = 0;
|
|
130
|
-
// Keep the bucket array bounded: once it reaches 2x the target, fold pairwise so the
|
|
131
|
-
// resolution stays under the cap while the per-bucket sample capacity doubles.
|
|
132
|
-
if (this.buckets.length >= this.targetBuckets * 2) {
|
|
133
|
-
this.fold();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/** Pairwise max-merges adjacent buckets, halving the count and doubling per-bucket capacity. */
|
|
138
|
-
fold() {
|
|
139
|
-
const folded = [];
|
|
140
|
-
for (let i = 0; i < this.buckets.length; i += 2) {
|
|
141
|
-
const a = this.buckets[i];
|
|
142
|
-
const b = i + 1 < this.buckets.length ? this.buckets[i + 1] : 0;
|
|
143
|
-
folded.push(a > b ? a : b);
|
|
144
|
-
}
|
|
145
|
-
this.buckets = folded;
|
|
146
|
-
this.samplesPerBucket *= 2;
|
|
147
|
-
this.samplesInCurrent = 0;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Produces the final normalized peak array (each value 0..1, divided by the global max).
|
|
151
|
-
* Trailing empty buckets are trimmed; an all-silent / empty recording yields `[]`.
|
|
152
|
-
*/
|
|
153
|
-
Normalize() {
|
|
154
|
-
// Drop a trailing freshly-opened empty bucket that absorbed nothing.
|
|
155
|
-
const raw = this.buckets.length > 0 && this.samplesInCurrent === 0 && this.buckets.length > 1
|
|
156
|
-
? this.buckets.slice(0, -1)
|
|
157
|
-
: this.buckets.slice();
|
|
158
|
-
let max = 0;
|
|
159
|
-
for (const v of raw) {
|
|
160
|
-
if (v > max) {
|
|
161
|
-
max = v;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (max <= 0) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
return raw.map(v => v / max);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* One-shot peak downsampling of a complete Float32 PCM buffer into `targetBuckets` normalized
|
|
172
|
-
* max-abs peaks (0..1). The streaming {@link PeakAccumulator} is the production path; this is the
|
|
173
|
-
* direct, allocation-light equivalent used where the whole buffer is already in hand (and in tests).
|
|
174
|
-
*
|
|
175
|
-
* @param samples The full mono Float32 PCM buffer.
|
|
176
|
-
* @param targetBuckets Desired bucket count (clamped to >= 1). Buckets beyond the sample count are
|
|
177
|
-
* not produced — a short buffer yields at most `samples.length` peaks.
|
|
178
|
-
* @returns Normalized peaks; `[]` for an empty or all-silent buffer.
|
|
179
|
-
*/
|
|
180
|
-
export function DownsamplePeaks(samples, targetBuckets = 600) {
|
|
181
|
-
const target = Math.max(1, Math.floor(targetBuckets));
|
|
182
|
-
if (samples.length === 0) {
|
|
183
|
-
return [];
|
|
184
|
-
}
|
|
185
|
-
const buckets = Math.min(target, samples.length);
|
|
186
|
-
const samplesPerBucket = samples.length / buckets;
|
|
187
|
-
const peaks = new Array(buckets).fill(0);
|
|
188
|
-
let globalMax = 0;
|
|
189
|
-
for (let b = 0; b < buckets; b++) {
|
|
190
|
-
const start = Math.floor(b * samplesPerBucket);
|
|
191
|
-
const end = b === buckets - 1 ? samples.length : Math.floor((b + 1) * samplesPerBucket);
|
|
192
|
-
let localMax = 0;
|
|
193
|
-
for (let i = start; i < end; i++) {
|
|
194
|
-
const abs = samples[i] < 0 ? -samples[i] : samples[i];
|
|
195
|
-
if (abs > localMax) {
|
|
196
|
-
localMax = abs;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
peaks[b] = localMax;
|
|
200
|
-
if (localMax > globalMax) {
|
|
201
|
-
globalMax = localMax;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (globalMax <= 0) {
|
|
205
|
-
return [];
|
|
206
|
-
}
|
|
207
|
-
return peaks.map(v => v / globalMax);
|
|
208
|
-
}
|
|
209
|
-
/** @deprecated Use {@link DownsamplePeaks}. */
|
|
210
|
-
export function downsamplePeaks(samples, targetBuckets = 600) {
|
|
211
|
-
return DownsamplePeaks(samples, targetBuckets);
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=realtime-pcm-wav.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-pcm-wav.js","sourceRoot":"","sources":["../../../src/lib/services/realtime-pcm-wav.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,uDAAuD;AACvD,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC;AACzB,wDAAwD;AACxD,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;;GAGG;AACH,SAAS,YAAY,CAAC,MAAc;IAChC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3D,yEAAyE;IACzE,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAG,SAA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AI,CAAC,KAAK,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC;QACxF,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACtD,IAAI,GAAG,GAAG,QAAQ,EAAE,CAAC;gBACjB,QAAQ,GAAG,GAAG,CAAC;YACnB,CAAC;QACL,CAAC;QACD,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;QACpB,IAAI,QAAQ,GAAG,SAAS,EAAE,CAAC;YACvB,SAAS,GAAG,QAAQ,CAAC;QACzB,CAAC;IACL,CAAC;IACD,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;AACzC,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,eAAe,CAAC,OAAqB,EAAE,aAAa,GAAG,GAAG;IACtE,OAAO,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC","sourcesContent":["/**\n * @fileoverview Pure, browser-and-node-safe helpers for the CLIENT-DIRECT realtime recorder:\n * encoding accumulated Float32 PCM into a seekable 16-bit PCM **WAV** container and computing a\n * bounded, downsampled waveform **peak** array at capture time.\n *\n * These functions are deliberately free of any browser API (`AudioContext`, `Blob`, …) so they can\n * be unit-tested in a plain Node environment. {@link RealtimeAudioRecorder} owns the live audio\n * graph and feeds the captured samples here.\n *\n * Why WAV (PCM) over webm/opus: a RIFF/WAVE header carries the exact duration and maps a byte\n * offset linearly to a time offset, so HTTP-range seeking is exact (no client-side duration nudge),\n * and peak extraction is trivial. The tradeoff is size — PCM WAV is larger than opus — which is\n * acceptable for these short session recordings.\n *\n * @module @memberjunction/ng-conversations/realtime-pcm-wav\n */\n\n/** Lowest value representable by signed 16-bit PCM. */\nconst PCM16_MIN = -32768;\n/** Highest value representable by signed 16-bit PCM. */\nconst PCM16_MAX = 32767;\n/** Canonical WAV/PCM header size in bytes (RIFF + fmt + data chunk headers). */\nexport const WAV_HEADER_BYTES = 44;\n\n/**\n * Converts one Float32 sample (nominally in `[-1, 1]`) to a clamped signed 16-bit integer.\n * Out-of-range values (a hot mix can briefly exceed unity) are clamped, not wrapped.\n */\nfunction floatToPcm16(sample: number): number {\n const clamped = sample < -1 ? -1 : sample > 1 ? 1 : sample;\n // Asymmetric scaling: negative full-scale is -32768, positive is +32767.\n const scaled = clamped < 0 ? clamped * -PCM16_MIN : clamped * PCM16_MAX;\n const rounded = Math.round(scaled);\n return rounded < PCM16_MIN ? PCM16_MIN : rounded > PCM16_MAX ? PCM16_MAX : rounded;\n}\n\n/**\n * Encodes mono Float32 PCM samples as a canonical single-chunk 16-bit PCM WAV (RIFF/WAVE).\n * The returned `ArrayBuffer` is `WAV_HEADER_BYTES + samples.length * 2` bytes — a proper\n * 44-byte header followed by little-endian PCM16 data, so it is seekable and self-describing.\n *\n * @param samples Mono Float32 PCM in `[-1, 1]` (downmixed by the caller).\n * @param sampleRate Sample rate in Hz (from the capturing `AudioContext`).\n * @returns A standalone `ArrayBuffer` containing the full WAV file.\n */\nexport function EncodePcm16Wav(samples: Float32Array, sampleRate: number): ArrayBuffer {\n const numChannels = 1;\n const bitsPerSample = 16;\n const bytesPerSample = bitsPerSample / 8;\n const blockAlign = numChannels * bytesPerSample;\n const byteRate = sampleRate * blockAlign;\n const dataSize = samples.length * bytesPerSample;\n\n const buffer = new ArrayBuffer(WAV_HEADER_BYTES + dataSize);\n const view = new DataView(buffer);\n\n writeAscii(view, 0, 'RIFF');\n view.setUint32(4, 36 + dataSize, true); // ChunkSize = 36 + Subchunk2Size\n writeAscii(view, 8, 'WAVE');\n\n writeAscii(view, 12, 'fmt ');\n view.setUint32(16, 16, true); // Subchunk1Size (16 for PCM)\n view.setUint16(20, 1, true); // AudioFormat = PCM\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, byteRate, true);\n view.setUint16(32, blockAlign, true);\n view.setUint16(34, bitsPerSample, true);\n\n writeAscii(view, 36, 'data');\n view.setUint32(40, dataSize, true);\n\n let offset = WAV_HEADER_BYTES;\n for (let i = 0; i < samples.length; i++) {\n view.setInt16(offset, floatToPcm16(samples[i]), true);\n offset += bytesPerSample;\n }\n\n return buffer;\n}\n\n/** @deprecated Use {@link EncodePcm16Wav}. */\nexport function encodePcm16Wav(samples: Float32Array, sampleRate: number): ArrayBuffer {\n return EncodePcm16Wav(samples, sampleRate);\n}\n\n/** Writes an ASCII string into a {@link DataView} byte-by-byte at `offset`. */\nfunction writeAscii(view: DataView, offset: number, text: string): void {\n for (let i = 0; i < text.length; i++) {\n view.setUint8(offset + i, text.charCodeAt(i));\n }\n}\n\n/**\n * A bounded, streaming waveform-peak accumulator. It maintains a fixed number of buckets\n * (`targetBuckets`) of max-absolute amplitude across the WHOLE recording regardless of length:\n * once every bucket has absorbed `samplesPerBucket` samples, the buckets are halved (pairwise\n * max-merged) and the per-bucket capacity doubles — so memory + cost stay O(targetBuckets) for an\n * arbitrarily long call. {@link Normalize} returns the final 0..1 peaks.\n */\nexport class PeakAccumulator {\n /** Target (max) number of buckets in the produced peak array. */\n private readonly targetBuckets: number;\n /** Current max-abs amplitude per bucket (length grows up to `2 * targetBuckets` before folding). */\n private buckets: number[] = [];\n /** How many samples each bucket currently absorbs before a new bucket opens. */\n private samplesPerBucket = 1;\n /** Samples absorbed into the current (last) bucket so far. */\n private samplesInCurrent = 0;\n\n /**\n * @param targetBuckets Desired bucket count (waveform resolution). Clamped to >= 1.\n * ~600 gives a smooth overview waveform at trivial cost.\n */\n constructor(targetBuckets = 600) {\n this.targetBuckets = Math.max(1, Math.floor(targetBuckets));\n }\n\n /** Number of buckets currently held (for tests/inspection). */\n public get BucketCount(): number {\n return this.buckets.length;\n }\n\n /** Absorbs a block of Float32 PCM samples, updating the running per-bucket max-abs. */\n public Push(samples: Float32Array): void {\n for (let i = 0; i < samples.length; i++) {\n this.pushSample(samples[i]);\n }\n }\n\n /** Absorbs one sample into the current bucket, opening/folding buckets as capacity is reached. */\n private pushSample(sample: number): void {\n if (this.buckets.length === 0) {\n this.buckets.push(0);\n this.samplesInCurrent = 0;\n }\n const abs = sample < 0 ? -sample : sample;\n const last = this.buckets.length - 1;\n if (abs > this.buckets[last]) {\n this.buckets[last] = abs;\n }\n this.samplesInCurrent++;\n if (this.samplesInCurrent >= this.samplesPerBucket) {\n this.buckets.push(0);\n this.samplesInCurrent = 0;\n // Keep the bucket array bounded: once it reaches 2x the target, fold pairwise so the\n // resolution stays under the cap while the per-bucket sample capacity doubles.\n if (this.buckets.length >= this.targetBuckets * 2) {\n this.fold();\n }\n }\n }\n\n /** Pairwise max-merges adjacent buckets, halving the count and doubling per-bucket capacity. */\n private fold(): void {\n const folded: number[] = [];\n for (let i = 0; i < this.buckets.length; i += 2) {\n const a = this.buckets[i];\n const b = i + 1 < this.buckets.length ? this.buckets[i + 1] : 0;\n folded.push(a > b ? a : b);\n }\n this.buckets = folded;\n this.samplesPerBucket *= 2;\n this.samplesInCurrent = 0;\n }\n\n /**\n * Produces the final normalized peak array (each value 0..1, divided by the global max).\n * Trailing empty buckets are trimmed; an all-silent / empty recording yields `[]`.\n */\n public Normalize(): number[] {\n // Drop a trailing freshly-opened empty bucket that absorbed nothing.\n const raw = this.buckets.length > 0 && this.samplesInCurrent === 0 && this.buckets.length > 1\n ? this.buckets.slice(0, -1)\n : this.buckets.slice();\n let max = 0;\n for (const v of raw) {\n if (v > max) {\n max = v;\n }\n }\n if (max <= 0) {\n return [];\n }\n return raw.map(v => v / max);\n }\n}\n\n/**\n * One-shot peak downsampling of a complete Float32 PCM buffer into `targetBuckets` normalized\n * max-abs peaks (0..1). The streaming {@link PeakAccumulator} is the production path; this is the\n * direct, allocation-light equivalent used where the whole buffer is already in hand (and in tests).\n *\n * @param samples The full mono Float32 PCM buffer.\n * @param targetBuckets Desired bucket count (clamped to >= 1). Buckets beyond the sample count are\n * not produced — a short buffer yields at most `samples.length` peaks.\n * @returns Normalized peaks; `[]` for an empty or all-silent buffer.\n */\nexport function DownsamplePeaks(samples: Float32Array, targetBuckets = 600): number[] {\n const target = Math.max(1, Math.floor(targetBuckets));\n if (samples.length === 0) {\n return [];\n }\n const buckets = Math.min(target, samples.length);\n const samplesPerBucket = samples.length / buckets;\n const peaks = new Array<number>(buckets).fill(0);\n let globalMax = 0;\n for (let b = 0; b < buckets; b++) {\n const start = Math.floor(b * samplesPerBucket);\n const end = b === buckets - 1 ? samples.length : Math.floor((b + 1) * samplesPerBucket);\n let localMax = 0;\n for (let i = start; i < end; i++) {\n const abs = samples[i] < 0 ? -samples[i] : samples[i];\n if (abs > localMax) {\n localMax = abs;\n }\n }\n peaks[b] = localMax;\n if (localMax > globalMax) {\n globalMax = localMax;\n }\n }\n if (globalMax <= 0) {\n return [];\n }\n return peaks.map(v => v / globalMax);\n}\n\n/** @deprecated Use {@link DownsamplePeaks}. */\nexport function downsamplePeaks(samples: Float32Array, targetBuckets = 600): number[] {\n return DownsamplePeaks(samples, targetBuckets);\n}\n"]}
|