@memberjunction/ng-conversations 6.2.2 → 6.3.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 +49 -24
- package/dist/assets/edge-ai.worker.js +32515 -0
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +39 -6
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +620 -74
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.js +4 -4
- package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +3 -3
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +19 -18
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +6 -4
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +35 -17
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +1 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +109 -107
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +76 -11
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +236 -50
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +49 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +151 -41
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts +11 -3
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js +40 -4
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js.map +1 -1
- package/dist/lib/components/export/export-modal.component.d.ts +7 -2
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +13 -2
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/library/library-create-dialog.component.d.ts +136 -0
- package/dist/lib/components/library/library-create-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-create-dialog.component.js +1620 -0
- package/dist/lib/components/library/library-create-dialog.component.js.map +1 -0
- package/dist/lib/components/library/library-full-view.component.d.ts +10 -4
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +216 -40
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/library/library-remote-drive-pane.component.d.ts +97 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.js +1229 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.js.map +1 -0
- package/dist/lib/components/library/library-workspace.component.d.ts +265 -0
- package/dist/lib/components/library/library-workspace.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-workspace.component.js +4420 -0
- package/dist/lib/components/library/library-workspace.component.js.map +1 -0
- package/dist/lib/components/library/library.models.d.ts +162 -0
- package/dist/lib/components/library/library.models.d.ts.map +1 -0
- package/dist/lib/components/library/library.models.js +2 -0
- package/dist/lib/components/library/library.models.js.map +1 -0
- package/dist/lib/components/message/conversation-message-rating.component.d.ts +5 -0
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +72 -16
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +26 -14
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +91 -56
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +35 -1
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +583 -392
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +2 -0
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +9 -9
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +94 -6
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +249 -59
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +6 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +81 -61
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/project/project-selector.component.d.ts +5 -0
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-selector.component.js +11 -4
- package/dist/lib/components/project/project-selector.component.js.map +1 -1
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.d.ts +55 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.js +944 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.d.ts +66 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.js +253 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.d.ts +80 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.js +49 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.d.ts +54 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.js +386 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +20 -4
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +62 -8
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js +15 -2
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +2 -2
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +3 -3
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +5 -3
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +81 -32
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +506 -185
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -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 +89 -4
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.js +2 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.js +5 -5
- package/dist/lib/components/realtime/realtime-surface-tab-style.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +7 -9
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +12 -13
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +27 -0
- 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 +141 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +101 -3
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +503 -55
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +2 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts +48 -5
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js +249 -53
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/components/search/search-panel.component.d.ts +10 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +25 -3
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +28 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +51 -6
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +31 -8
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +692 -497
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +15 -2
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +66 -61
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +60 -1
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +45 -0
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +64 -0
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +7 -1
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
- package/dist/lib/models/agent-turn.model.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +14 -3
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +14 -3
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +43 -11
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +8 -3
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +9 -3
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.d.ts +59 -2
- package/dist/lib/services/conversation-tasks-filter.d.ts.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.js +222 -18
- package/dist/lib/services/conversation-tasks-filter.js.map +1 -1
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.d.ts +85 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.js +257 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.d.ts +85 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.js +10 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.d.ts +90 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.js +386 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.d.ts +13 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.js +201 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.js.map +1 -0
- package/dist/lib/services/export.service.d.ts +64 -0
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +185 -6
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/library-creation.service.d.ts +304 -0
- package/dist/lib/services/library-creation.service.d.ts.map +1 -0
- package/dist/lib/services/library-creation.service.js +1244 -0
- package/dist/lib/services/library-creation.service.js.map +1 -0
- package/dist/lib/services/realtime-audio-recorder.d.ts +10 -8
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.js +28 -12
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pairing.d.ts +3 -3
- package/dist/lib/services/realtime-pairing.js +4 -4
- package/dist/lib/services/realtime-pairing.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +14 -0
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +46 -4
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +10 -3
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +8 -3
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +19 -2
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +99 -36
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.js +1 -1
- package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
- package/dist/lib/utils/decision-routing.d.ts +5 -2
- package/dist/lib/utils/decision-routing.d.ts.map +1 -1
- package/dist/lib/utils/decision-routing.js +9 -4
- package/dist/lib/utils/decision-routing.js.map +1 -1
- package/dist/public-api.d.ts +13 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +15 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +42 -37
package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-component-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-channel.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EACH,iCAAiC,EAEjC,+BAA+B,GAIlC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACH,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,GAItB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAgC,MAAM,6BAA6B,CAAC;AACxH,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,4CAA4C,EAAE,MAAM,oDAAoD,CAAC;AAClH,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,oCAAoC,EACpC,iCAAiC,EACjC,yCAAy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C/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;CACJ,CAAA;AAxuBY,2BAA2B;IADvC,aAAa,CAAC,yBAAyB,EAAE,yCAAyC,CAAC;GACvE,2BAA2B,CAwuBvC;;AAED;;;;GAIG;AACH,MAAM,UAAU,uCAAuC;IACnD,sEAAsE;AAC1E,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport type { JSONObject, RealtimeToolDefinition } from '@memberjunction/ai';\nimport {\n REALTIME_CHANNEL_CONTRACT_VERSION,\n type RealtimeChannelActor,\n ValidateJsonAgainstSchemaSubset,\n type RealtimeChannelDescriptor,\n type RealtimeChannelEventSpec,\n type RealtimeChannelVerb,\n} from '@memberjunction/ai-core-plus';\nimport { LogError } from '@memberjunction/core';\nimport { IsPlainObject, RegisterClass } from '@memberjunction/global';\nimport {\n BaseRealtimeChannelClient,\n FormatChannelNote,\n FormatParameterList,\n type ChannelOnboardingDetails,\n type ParsedDelegationArtifact,\n type RealtimeChannelVerbResult,\n} from '@memberjunction/realtime-runtime';\nimport { DeriveComponentContract, MergeVerbOffers, type DerivedVerb } from './component-contract';\nimport { SummarizeDataState, ToBoundedJson } from './component-data-state';\nimport { ComponentInstanceEngine, InstanceLimitError, type ComponentInstanceRecord } from './component-instance-engine';\nimport { ParseInteractiveComponentConfig } from './interactive-component-config';\nimport { ChannelFrameCapture } from '@memberjunction/ng-realtime-channels';\nimport { RealtimeInteractiveComponentSurfaceComponent } from './realtime-interactive-component-surface.component';\nimport { RunViewComponentArtifactSource } from './run-view-component-artifact-source';\nimport {\n BUILTIN_VERBS,\n ComponentArtifactError,\n DEFAULT_INTERACTIVE_COMPONENT_CONFIG,\n INTERACTIVE_COMPONENT_CHANNEL_KEY,\n INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS,\n type ComponentActivity,\n type ComponentVersionChangeReason,\n type IComponentArtifactSource,\n type IInteractiveComponentHandle,\n type InteractiveComponentConfig,\n type ResolvedComponentArtifact,\n} from './interactive-component-types';\n\n/** How long a verb waits for a freshly opened component to finish initializing (the poll interval times the attempt cap). */\nconst HANDLE_POLL_INTERVAL_MS = 100;\nconst HANDLE_POLL_MAX_ATTEMPTS = 80;\n\n/** How long after the user (or the agent) acts the data is read once more, because a component's data arrives after the action that asked for it. */\nconst DATA_SETTLE_MS = 1200;\n\n/** The events every instance can report, whatever its spec declares. */\nconst BUILTIN_EVENTS: readonly RealtimeChannelEventSpec[] = [\n { Name: 'opened', Description: 'A component was opened. Carries the inputs it was opened with.' },\n { Name: 'closed', Description: 'A component was closed.' },\n {\n Name: 'version_changed',\n Description: 'A component now shows a different version of its artifact (you asked for it, or a newer version appeared).',\n PayloadSchema: {\n type: 'object',\n properties: {\n from: { type: 'string', description: 'The version id it showed.' },\n to: { type: 'string', description: 'The version id it shows now.' },\n reason: { type: 'string', enum: ['agent', 'newer-version'] },\n },\n },\n },\n {\n Name: 'newer_version_available',\n Description: 'A newer version of an open component exists, and this session is not set to swap to it automatically.',\n PayloadSchema: { type: 'object', properties: { current: { type: 'string' }, available: { type: 'string' } } },\n },\n];\n\n/** A failure the dispatcher turns into a message the model can act on. */\nfunction failure(code: string, error: string, details?: string[]): RealtimeChannelVerbResult {\n return details ? { Success: false, ErrorCode: code, Error: error, Details: details } : { Success: false, ErrorCode: code, Error: error };\n}\n\n/** A non-empty string argument, or `undefined`. */\nfunction readString(bag: JSONObject, key: string): string | undefined {\n const value = bag[key];\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * The INTERACTIVE COMPONENT channel: shows the user any interactive component artifact (a dashboard, a report, a\n * form, a chart) next to the voice conversation, and lets the agent operate it.\n *\n * It is a MULTI-INSTANCE channel (several components may be open at once, each addressed by `target.instance`) and\n * its contract is DERIVED from what it hosts: the actions an agent can take on an instance are that component's own\n * `customMethods` and the standard methods its spec says it supports; its state is the component's data state;\n * its events are the spec's `events`; the inputs for opening it are the spec's `properties`. A component nobody\n * wrote channel code for is therefore operable from its spec alone. See `DeriveComponentContract`.\n *\n * Built-in: `open { artifactId | artifactVersionId, inputs? }` (the dispatcher's reserved action), `show_version`, `close`.\n *\n * ### What the model perceives\n * Per instance: which artifact version is open, what the user last did in it (its events), and its data state,\n * bounded to a handful of rows. All of it is gated by exposure policy (`min(channel, agent config, zero-data-retention,\n * user)`). Pixels flow only if the host registered a frame capturer ({@link ChannelFrameCapture}).\n * Agent-INVOKED verbs return what the component returns; exposure gates what is volunteered to the model, not what it\n * asked for.\n *\n * ### Access\n * Artifacts are loaded through the signed-in user's own session and read permission (see `RunViewComponentArtifactSource`).\n * The agent cannot open anything the user cannot.\n *\n * ### Lifetime\n * Open components are live-only: they are not persisted with the session and are not restored on resume.\n */\n@RegisterClass(BaseRealtimeChannelClient, INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS)\nexport class InteractiveComponentChannel extends BaseRealtimeChannelClient<RealtimeInteractiveComponentSurfaceComponent> {\n /** The components that are open. */\n public readonly Engine = new ComponentInstanceEngine(DEFAULT_INTERACTIVE_COMPONENT_CONFIG.MaxInstances);\n\n /** The resolved configuration; the defaults until {@link Initialize} reads the cascade. */\n public Config: InteractiveComponentConfig = { ...DEFAULT_INTERACTIVE_COMPONENT_CONFIG };\n\n /** How long a verb waits for a component to initialize; overridable so tests need not sleep. */\n protected HandlePollIntervalMs = HANDLE_POLL_INTERVAL_MS;\n /** How long after an action the data state is re-read; overridable for tests. */\n protected DataSettleMs = DATA_SETTLE_MS;\n\n private artifactSource: IComponentArtifactSource | null = null;\n private surface: RealtimeInteractiveComponentSurfaceComponent | null = null;\n private settleTimer: ReturnType<typeof setTimeout> | null = null;\n\n public get ChannelName(): string {\n return INTERACTIVE_COMPONENT_CHANNEL_KEY;\n }\n\n /**\n * The id state notes carry. A multi-instance channel's snapshot describes ALL its instances (keyed by their own ids,\n * `c1`, `c2`, ...), so the notes about the snapshot as a whole are addressed to `all` rather than to one of them.\n */\n public override get InstanceId(): string {\n return 'all';\n }\n\n public override get TabTitle(): string {\n return 'Components';\n }\n\n public override get TabIcon(): string {\n return 'fa-solid fa-cubes';\n }\n\n /** The channel has no native tools: every verb is reached through the `ContextTool` proxy, because the verbs depend on what is open. */\n public override GetToolDefinitions(): RealtimeToolDefinition[] {\n return [];\n }\n\n /**\n * Replaces where artifacts are loaded from (a host with its own store, or a test). Without it the channel loads\n * through the session's provider and the signed-in user's access.\n */\n public SetArtifactSource(source: IComponentArtifactSource | null): void {\n this.artifactSource = source;\n }\n\n // ── Contract: descriptor ───────────────────────────────────────────────────\n\n /**\n * The channel's self-description. The verbs and events are the built-ins plus those of every component that is\n * open right now, so the contract grows as components are opened and the dispatcher validates against it.\n */\n public override GetDescriptor(): RealtimeChannelDescriptor {\n return {\n Key: this.ChannelName,\n Version: REALTIME_CHANNEL_CONTRACT_VERSION,\n DisplayName: 'Interactive Components',\n OwningPackage: '@memberjunction/ng-conversations',\n Instructions:\n 'Shows the user an interactive component (a dashboard, report, chart or form) built as an artifact, next to the conversation. ' +\n 'Open one with action \"open\" and an artifactId (its latest version) or an artifactVersionId. The result lists the actions THAT component supports ' +\n 'and the events it reports; use them as actions of this channel. Several components can be open: pass the instance id to say which, ' +\n 'otherwise the one the user is looking at is used. You can open components other agents built (they come back as artifacts). ' +\n 'You are told what the user is looking at and what they do in it; do not narrate routine changes.',\n Nouns: [\n {\n Name: 'components',\n Description:\n 'The open components keyed by instance id: which artifact version each shows, whether it is the one the user is looking at, ' +\n 'what the user last did in it, and (when the component reports one) a bounded summary of its data.',\n Schema: { type: 'object', additionalProperties: { type: 'object' } },\n },\n ],\n Verbs: this.collectVerbs(),\n Inputs: {\n type: 'object',\n properties: {\n artifactId: { type: 'string', description: 'The artifact to open (its latest version is shown).' },\n artifactVersionId: { type: 'string', description: 'A specific artifact version to open (instead of artifactId).' },\n inputs: { type: 'object', description: 'Values for the component\\'s own properties, as its spec declares them.' },\n },\n additionalProperties: false,\n },\n Events: this.collectEvents(),\n DisplayPolicy: 'on-demand',\n DefaultAvailability: 'opt-in',\n MaxExposure: 'pixels',\n MultiInstance: true,\n };\n }\n\n /** The built-in verbs plus each open component's, merged by name. */\n private collectVerbs(): RealtimeChannelVerb[] {\n const builtins: RealtimeChannelVerb[] = [\n {\n Name: BUILTIN_VERBS.ShowVersion,\n Description: 'Shows another version of an open component\\'s own artifact in place (the instance stays open and keeps its id).',\n ParametersSchema: {\n type: 'object',\n properties: { versionId: { type: 'string', description: 'The artifact version to show.' } },\n required: ['versionId'],\n additionalProperties: false,\n },\n InvokableBy: 'agent',\n },\n {\n Name: BUILTIN_VERBS.Close,\n Description: 'Closes an open component.',\n ParametersSchema: { type: 'object', properties: {}, additionalProperties: false },\n InvokableBy: 'agent',\n },\n ];\n const byName = new Map<string, Array<{ Component: string; Verb: RealtimeChannelVerb }>>();\n for (const record of this.Engine.Instances) {\n for (const derived of record.Contract.Verbs) {\n const key = derived.Verb.Name.toLowerCase();\n const offers = byName.get(key) ?? [];\n offers.push({ Component: record.Artifact.Name, Verb: derived.Verb });\n byName.set(key, offers);\n }\n }\n return [...builtins, ...[...byName.values()].map((offers) => MergeVerbOffers(offers))];\n }\n\n /** The built-in events plus each open component's declared ones. */\n private collectEvents(): RealtimeChannelEventSpec[] {\n const events = new Map<string, RealtimeChannelEventSpec>(BUILTIN_EVENTS.map((e) => [e.Name.toLowerCase(), e]));\n for (const record of this.Engine.Instances) {\n for (const event of record.Contract.Events) {\n if (!events.has(event.Name.toLowerCase())) {\n events.set(event.Name.toLowerCase(), event);\n }\n }\n }\n return [...events.values()];\n }\n\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Interactive components',\n Description:\n 'The agent can open an interactive component — a dashboard, report or form — right here during the call, and work with it alongside you.',\n Tips: [\n 'Switch between open components using the tabs along the top.',\n 'The agent sees what you select and change, so you can say \"this one\" and point.',\n 'Use the \"Agent can see\" control to limit what the agent perceives.',\n ],\n IconClass: 'fa-solid fa-cubes',\n };\n }\n\n // ── Lifecycle ──────────────────────────────────────────────────────────────\n\n protected override OnInitialize(): void {\n const parsed = ParseInteractiveComponentConfig(this.Context?.ChannelConfig);\n this.Config = parsed.Config;\n this.Engine.SetMaxInstances(this.Config.MaxInstances);\n for (const problem of parsed.Problems) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Configuration: ${problem}`);\n }\n if (!this.artifactSource) {\n const provider = this.Context?.Provider;\n const user = provider?.CurrentUser;\n if (provider && user) {\n this.artifactSource = new RunViewComponentArtifactSource(provider, user);\n }\n }\n this.enableVisualPerceptionIfAvailable();\n }\n\n /** Opts into pixels only when the host registered something that can rasterize a component. */\n private enableVisualPerceptionIfAvailable(): void {\n if (!ChannelFrameCapture.Instance.Capturer) {\n return;\n }\n this.EnableVisualPerception({ GetLatestFrame: () => this.CaptureActiveFrame() });\n }\n\n /**\n * A picture of the component the user is looking at, as base64 JPEG, or `null` when there is none to send: exposure is\n * below `pixels`, the session has no inbound video track, nothing is on screen, or the host's rasterizer produced nothing\n * (it reports why, once, itself). Never throws.\n *\n * The base channel's visual pump has already checked exposure and the track before it asks; they are checked again so a\n * frame is never rasterized (the costly part) for a model that may not see it, whoever asks.\n */\n protected async CaptureActiveFrame(): Promise<string | null> {\n const capturer = ChannelFrameCapture.Instance.Capturer;\n if (!capturer || this.Exposure !== 'pixels' || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return null;\n }\n const element = this.surface?.GetActiveElement() ?? null;\n if (!element) {\n return null;\n }\n try {\n return await capturer(element);\n } catch (error) {\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Capturing a component frame failed: ${error instanceof Error ? error.message : String(error)}`);\n return null;\n }\n }\n\n public override GetSurfaceComponent(): Type<RealtimeInteractiveComponentSurfaceComponent> {\n return RealtimeInteractiveComponentSurfaceComponent;\n }\n\n /** Hands the dynamically created surface the engine it renders and the hooks it reports through. */\n public override BindSurface(instance: RealtimeInteractiveComponentSurfaceComponent): void {\n this.surface = instance;\n instance.Engine = this.Engine;\n instance.AgentName = this.Context?.AgentName ?? 'The agent';\n instance.Provider = this.Context?.Provider ?? null;\n instance.ActivityHandler = (instanceId: string, activity: ComponentActivity) => this.OnComponentActivity(instanceId, activity);\n }\n\n public override UnbindSurface(): void {\n this.surface = null;\n }\n\n public override Dispose(): void {\n if (this.settleTimer !== null) {\n clearTimeout(this.settleTimer);\n this.settleTimer = null;\n }\n this.surface = null;\n this.Engine.Dispose();\n super.Dispose();\n }\n\n // ── Contract: state ────────────────────────────────────────────────────────\n\n /**\n * Open components are LIVE-ONLY: there is no state of record to persist, so nothing is saved with the session\n * (`null`, which the host never writes) and {@link RestoreState} refuses what it is offered. A resumed session starts\n * with no component open; the agent opens them again. What the model perceives right now is {@link GetState}.\n */\n public override SerializeState(): string | null {\n return null;\n }\n\n /** Live-only: a resumed session never restores open components (see {@link SerializeState}). Always `false`. */\n public override RestoreState(_stateJson: string): boolean {\n return false;\n }\n\n /** The open components, keyed by instance id (see the `components` noun). A pure read. */\n public override GetState(): JSONObject {\n const components: JSONObject = {};\n for (const record of this.Engine.Instances) {\n components[record.InstanceID] = this.describeForState(record);\n }\n return { components };\n }\n\n /** One instance as the model perceives it. */\n private describeForState(record: ComponentInstanceRecord): JSONObject {\n const entry: JSONObject = {\n name: record.Artifact.Name,\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n active: this.Engine.ActiveID === record.InstanceID,\n };\n if (Object.keys(record.Inputs).length > 0) {\n entry['inputs'] = ToBoundedJson(record.Inputs);\n }\n if (record.LastEvent) {\n entry['lastEvent'] = { type: record.LastEvent.Type, payload: record.LastEvent.Payload, seq: record.LastEvent.Seq };\n }\n if (record.Contract.SupportsDataState && record.Handle?.IsReady) {\n const data = SummarizeDataState(record.Handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n if (data) {\n entry['data'] = data;\n }\n }\n return entry;\n }\n\n // ── Opening ────────────────────────────────────────────────────────────────\n\n /**\n * Loads the artifact and opens it as a new instance (or, when that artifact is already open, brings the existing\n * instance forward and moves it to the requested version). Refusals are structured results, never exceptions.\n */\n protected override async OnOpen(inputs: JSONObject): Promise<RealtimeChannelVerbResult> {\n const artifactId = readString(inputs, 'artifactId');\n const versionId = readString(inputs, 'artifactVersionId');\n if ((artifactId === undefined) === (versionId === undefined)) {\n return failure('invalid_params', 'Provide exactly one of artifactId (the latest version) or artifactVersionId (a specific version).');\n }\n const source = this.artifactSource;\n if (!source) {\n return failure('open_failed', 'Components cannot be loaded in this session (no signed-in user to load them for).');\n }\n let artifact: ResolvedComponentArtifact;\n try {\n artifact = versionId ? await source.LoadVersion(versionId) : await source.LoadLatest(artifactId as string);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n const existing = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (existing) {\n return this.reuseOpenInstance(existing, artifact);\n }\n return this.addInstance(artifact, inputs);\n }\n\n /** Opens a new instance for a loaded artifact. */\n private addInstance(artifact: ResolvedComponentArtifact, inputs: JSONObject): RealtimeChannelVerbResult {\n const componentInputs = IsPlainObject(inputs['inputs']) ? (inputs['inputs'] as JSONObject) : {};\n const contractIssues = ValidateJsonAgainstSchemaSubset(componentInputs, this.inputsSchemaFor(artifact), '$.inputs');\n if (contractIssues.length > 0) {\n return failure('invalid_params', `The inputs for \"${artifact.Name}\" are invalid.`, contractIssues);\n }\n try {\n const record = this.Engine.Add(artifact, componentInputs);\n return { Success: true, Instance: record.InstanceID, Result: this.describeOpened(record) };\n } catch (error) {\n if (error instanceof InstanceLimitError) {\n return failure('open_failed', error.message, [`open: ${this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ')}`]);\n }\n throw error;\n }\n }\n\n /** The inputs schema a freshly derived contract would have, so opening is validated before an instance exists. */\n private inputsSchemaFor(artifact: ResolvedComponentArtifact): JSONObject {\n return DeriveComponentContract(artifact.Spec).InputsSchema;\n }\n\n /** An artifact that is already open is not opened twice: focus it, and show the requested version. */\n private async reuseOpenInstance(existing: ComponentInstanceRecord, artifact: ResolvedComponentArtifact): Promise<RealtimeChannelVerbResult> {\n this.Engine.SetActive(existing.InstanceID);\n if (existing.Artifact.VersionID !== artifact.VersionID) {\n this.swapVersion(existing, artifact, 'agent');\n }\n return {\n Success: true,\n Instance: existing.InstanceID,\n Result: { ...this.describeOpened(existing), alreadyOpen: true },\n };\n }\n\n /** What the agent is told when it opens (or revisits) a component: how to operate it. */\n private describeOpened(record: ComponentInstanceRecord): JSONObject {\n return {\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n name: record.Artifact.Name,\n actions: record.Contract.Verbs.map((v) => `${v.Verb.Name}(${FormatParameterList(v.Verb.ParametersSchema)}) — ${v.Verb.Description}`),\n events: record.Contract.Events.map((e) => e.Name),\n ...(record.Contract.Skipped.length > 0\n ? { unavailable: record.Contract.Skipped.map((s) => `${s.Name}: ${s.Reason}`) }\n : {}),\n };\n }\n\n /** Maps a failed artifact load to a result the model can act on. */\n private mapLoadFailure(error: unknown): RealtimeChannelVerbResult {\n if (error instanceof ComponentArtifactError) {\n return failure(error.Code === 'invalid_id' ? 'invalid_params' : 'open_failed', error.message, [error.Code]);\n }\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Loading a component artifact failed: ${error instanceof Error ? error.message : String(error)}`);\n return failure('open_failed', 'That artifact could not be loaded.');\n }\n\n // ── Delegated artifacts ────────────────────────────────────────────────────\n\n /**\n * Asks to be offered a delegated run's artifacts when the operator turned on auto-open, or when one of them is\n * already open here (so a revised version replaces it). Whether an artifact is a component is only known once it\n * is loaded, so with auto-open on the channel is mounted for any delegated artifact and ignores the ones that are not.\n */\n public override AcceptsDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[], config: JSONObject): boolean {\n if (artifacts.some((a) => this.Engine.FindByArtifact(a.ArtifactID))) {\n return true;\n }\n return artifacts.length > 0 && ParseInteractiveComponentConfig(config).Config.AutoOpenDelegatedComponents;\n }\n\n /**\n * Takes a delegated run's artifacts: an artifact that is already open moves to its newer version (or, when the\n * configuration says not to swap, the agent is told one exists); with auto-open on, a component that is not open is opened.\n */\n public override async OnDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[]): Promise<void> {\n for (const artifact of artifacts) {\n const open = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (open) {\n await this.takeNewerVersion(open, artifact);\n } else if (this.Config.AutoOpenDelegatedComponents) {\n await this.autoOpen(artifact);\n }\n }\n }\n\n /** Opens a delegated artifact; one that is not a component is ignored (expected), anything else is logged. */\n private async autoOpen(artifact: ParsedDelegationArtifact): Promise<void> {\n const opened = await this.Open({ artifactVersionId: artifact.ArtifactVersionID });\n if (!opened.Success && !(opened.Details ?? []).includes('not_a_component')) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not open delegated artifact \"${artifact.Name}\": ${opened.Error ?? opened.ErrorCode}`);\n }\n }\n\n /** Moves an open instance to the version a delegated run produced, when that version is newer. */\n private async takeNewerVersion(open: ComponentInstanceRecord, artifact: ParsedDelegationArtifact): Promise<void> {\n if (open.Artifact.VersionID.toLowerCase() === artifact.ArtifactVersionID.toLowerCase() || !this.artifactSource) {\n return;\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(artifact.ArtifactVersionID);\n } catch (error) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not load the newer version of \"${open.Artifact.Name}\": ${error instanceof Error ? error.message : String(error)}`);\n return;\n }\n if (loaded.VersionNumber <= open.Artifact.VersionNumber) {\n return;\n }\n if (this.Config.SwapToNewerVersions) {\n this.swapVersion(open, loaded, 'newer-version');\n } else {\n this.EmitChannelEvent('newer_version_available', { current: open.Artifact.VersionID, available: loaded.VersionID }, undefined, open.InstanceID);\n if (this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, open.InstanceID, 'newer_version_available', {\n current: open.Artifact.VersionID,\n available: loaded.VersionID,\n })\n );\n }\n }\n }\n\n // ── Version swap ───────────────────────────────────────────────────────────\n\n /** Shows another version in an existing instance, keeping its id; tells observers, and the model when it did not ask. */\n private swapVersion(record: ComponentInstanceRecord, artifact: ResolvedComponentArtifact, reason: ComponentVersionChangeReason): void {\n const from = record.Artifact.VersionID;\n this.Engine.SwapVersion(record.InstanceID, artifact);\n const payload: JSONObject = { from, to: artifact.VersionID, reason };\n this.EmitChannelEvent('version_changed', payload, undefined, record.InstanceID);\n if (reason === 'newer-version' && this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, record.InstanceID, 'version_changed', {\n ...payload,\n actions: record.Contract.Verbs.map((v) => v.Verb.Name),\n })\n );\n }\n this.RecordChange({ Author: reason === 'agent' ? 'agent' : 'system' });\n }\n\n // ── Verbs ──────────────────────────────────────────────────────────────────\n\n /**\n * Runs one verb. The dispatcher has already checked the verb against the (merged) descriptor; the exact check against\n * the addressed component's own schema happens here.\n */\n public override async ApplyVerb(\n verb: string,\n args: JSONObject,\n actor: RealtimeChannelActor,\n instanceId?: string\n ): Promise<RealtimeChannelVerbResult> {\n const name = verb.trim().toLowerCase();\n const target = this.resolveInstance(name, instanceId);\n if ('Success' in target) {\n return target;\n }\n const refusal = actor === 'agent' ? this.refuseForExposure(target, name) : null;\n if (refusal) {\n return refusal;\n }\n if (name === BUILTIN_VERBS.ShowVersion) {\n return this.showVersion(target, args);\n }\n if (name === BUILTIN_VERBS.Close) {\n return this.closeInstance(target);\n }\n return this.invokeDerived(target, name, args, actor);\n }\n\n /**\n * Refuses a verb whose result carries the component's data while exposure keeps that from the agent. The dispatcher\n * checks the same thing against the (merged) descriptor; this is the exact per-instance check, and it keeps the\n * channel safe when it is driven by something other than the dispatcher.\n */\n private refuseForExposure(record: ComponentInstanceRecord, verbName: string): RealtimeChannelVerbResult | null {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === verbName);\n const message = derived ? this.RefuseVerbForExposure(derived.Verb) : null;\n return message ? failure('exposure_restricted', message, [...this.ExposureReasons]) : null;\n }\n\n /**\n * Finds the instance a verb addresses: the one named, else the one the user is looking at when it supports the verb,\n * else the only one that does. Anything else is a refusal that lists what would have worked.\n */\n private resolveInstance(verb: string, instanceId: string | undefined): ComponentInstanceRecord | RealtimeChannelVerbResult {\n const supports = (r: ComponentInstanceRecord): boolean =>\n verb === BUILTIN_VERBS.ShowVersion || verb === BUILTIN_VERBS.Close || r.Contract.Verbs.some((v) => v.Verb.Name.toLowerCase() === verb);\n if (instanceId !== undefined) {\n const named = this.Engine.Get(instanceId);\n if (!named) {\n return failure('unknown_instance', `No component \"${instanceId}\" is open.`, [`open: ${this.listOpen()}`]);\n }\n return supports(named) ? named : failure('verb_failed', `\"${named.Artifact.Name}\" has no action \"${verb}\".`);\n }\n const candidates = this.Engine.Instances.filter(supports);\n const active = candidates.find((r) => r.InstanceID === this.Engine.ActiveID);\n if (active) {\n return active;\n }\n if (candidates.length === 1) {\n return candidates[0];\n }\n if (candidates.length === 0) {\n return failure('verb_failed', `No open component has an action \"${verb}\".`, [`open: ${this.listOpen() || 'nothing'}`]);\n }\n return failure('ambiguous_instance', `Several open components have \"${verb}\"; say which with the instance.`, [`open: ${this.listOpen()}`]);\n }\n\n /** `c1 (Revenue), c2 (Pipeline)`. */\n private listOpen(): string {\n return this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ');\n }\n\n /** `show_version`: swap an instance to another version of ITS artifact. */\n private async showVersion(record: ComponentInstanceRecord, args: JSONObject): Promise<RealtimeChannelVerbResult> {\n const versionId = readString(args, 'versionId');\n if (!versionId || !this.artifactSource) {\n return failure('invalid_params', versionId ? 'Components cannot be loaded in this session.' : 'show_version needs a versionId.');\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(versionId);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n if (loaded.ArtifactID.toLowerCase() !== record.Artifact.ArtifactID.toLowerCase()) {\n return failure('verb_failed', `That version belongs to a different artifact (\"${loaded.Name}\"). Open it with \"open\" instead.`);\n }\n if (loaded.VersionID.toLowerCase() === record.Artifact.VersionID.toLowerCase()) {\n return { Success: true, Result: { changed: false, instance: record.InstanceID, versionNumber: loaded.VersionNumber } };\n }\n this.swapVersion(record, loaded, 'agent');\n return { Success: true, Result: { changed: true, instance: record.InstanceID, ...this.describeOpened(record) } };\n }\n\n /** `close`. */\n private closeInstance(record: ComponentInstanceRecord): RealtimeChannelVerbResult {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'agent' });\n return { Success: true, Result: { closed: true, instance: record.InstanceID } };\n }\n\n /** Runs a verb derived from the component's spec. */\n private async invokeDerived(\n record: ComponentInstanceRecord,\n name: string,\n args: JSONObject,\n actor: RealtimeChannelActor\n ): Promise<RealtimeChannelVerbResult> {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === name);\n if (!derived) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" has no action \"${name}\".`);\n }\n const issues = ValidateJsonAgainstSchemaSubset(args, derived.Verb.ParametersSchema);\n if (issues.length > 0) {\n return failure(\n 'invalid_params',\n `The parameters for ${derived.Verb.Name} on \"${record.Artifact.Name}\" are invalid. Expected ${derived.Verb.Name}(${FormatParameterList(derived.Verb.ParametersSchema)}).`,\n issues\n );\n }\n const handle = await this.waitForHandle(record);\n if (!handle) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" is still loading. Try again in a moment.`);\n }\n try {\n const result = await this.runBinding(record, handle, derived, args);\n this.afterAction(record, derived, actor);\n return { Success: true, Result: { instance: record.InstanceID, ...result } };\n } catch (error) {\n console.error(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] ${derived.Verb.Name} on \"${record.Artifact.Name}\" threw:`, error);\n return failure('verb_failed', `${derived.Verb.Name} failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /** Waits (bounded) for the surface to mount the component and report it ready. */\n private async waitForHandle(record: ComponentInstanceRecord): Promise<IInteractiveComponentHandle | null> {\n for (let attempt = 0; attempt < HANDLE_POLL_MAX_ATTEMPTS; attempt++) {\n if (record.Handle?.IsReady) {\n return record.Handle;\n }\n if (!this.Engine.Get(record.InstanceID)) {\n return null;\n }\n await new Promise((resolve) => setTimeout(resolve, this.HandlePollIntervalMs));\n }\n return record.Handle?.IsReady ? record.Handle : null;\n }\n\n /** Executes a derived verb against the live component and returns what to tell the model. */\n private async runBinding(\n record: ComponentInstanceRecord,\n handle: IInteractiveComponentHandle,\n derived: DerivedVerb,\n args: JSONObject\n ): Promise<JSONObject> {\n const binding = derived.Binding;\n if (binding.Kind === 'custom') {\n if (!handle.HasMethod(binding.Method)) {\n throw new Error(`the component does not implement ${binding.Method}`);\n }\n const positional = binding.ParameterNames.map((n) => args[n]);\n const returned = await handle.InvokeMethod(binding.Method, positional);\n return { result: ToBoundedJson(returned) };\n }\n switch (binding.Standard) {\n case 'Refresh':\n handle.Refresh();\n return { refreshed: true };\n case 'Print':\n handle.Print();\n return { printing: true };\n case 'Validate':\n return { validation: ToBoundedJson(handle.Validate()) };\n case 'IsDirty':\n return { dirty: handle.IsDirty() };\n case 'Reset':\n handle.Reset();\n return { reset: true };\n case 'ScrollTo':\n return this.scrollTo(handle, args);\n case 'Focus':\n handle.Focus(readString(args, 'target'));\n return { focused: true };\n case 'GetDataState': {\n const data = SummarizeDataState(handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n return data ? { data } : { data: null, note: 'The component has no data state yet.' };\n }\n default:\n throw new Error(`unsupported standard action ${String(binding.Standard)} on ${record.Artifact.Name}`);\n }\n }\n\n /** `scroll_to`: a selector, or an offset. */\n private scrollTo(handle: IInteractiveComponentHandle, args: JSONObject): JSONObject {\n const target = readString(args, 'target');\n if (target !== undefined) {\n handle.ScrollTo(target);\n return { scrolledTo: target };\n }\n const top = typeof args['top'] === 'number' ? args['top'] : undefined;\n const left = typeof args['left'] === 'number' ? args['left'] : undefined;\n if (top === undefined && left === undefined) {\n throw new Error('scroll_to needs a target selector or a top/left offset');\n }\n handle.ScrollTo({ top, left });\n return { scrolled: true };\n }\n\n /** What happens after a verb ran: the state may have changed, and the picture may have too. */\n private afterAction(record: ComponentInstanceRecord, derived: DerivedVerb, actor: RealtimeChannelActor): void {\n const readOnly =\n derived.Binding.Kind === 'standard' &&\n (derived.Binding.Standard === 'GetDataState' || derived.Binding.Standard === 'IsDirty' || derived.Binding.Standard === 'Validate' || derived.Binding.Standard === 'Print');\n if (readOnly) {\n return;\n }\n this.Engine.SetActive(record.InstanceID);\n this.RecordChange({ Author: actor });\n this.scheduleSettle(actor);\n void this.ConfirmVisualChange();\n }\n\n // ── What the user does ─────────────────────────────────────────────────────\n\n /**\n * Called by the surface when something happens inside a rendered component: an event it emits, a state change,\n * or the end of its initialization. Becomes a change in the state the model perceives and a typed event for observers.\n */\n public OnComponentActivity(instanceId: string, activity: ComponentActivity): void {\n const record = this.Engine.Get(instanceId);\n if (!record) {\n return;\n }\n if (activity.Kind === 'closed') {\n this.userClosed(record);\n return;\n }\n if (activity.Kind === 'selected') {\n if (this.Engine.ActiveID !== instanceId) {\n this.Engine.SetActive(instanceId);\n this.RecordChange({ Author: 'user' });\n void this.NotifyVisualChange();\n }\n return;\n }\n if (activity.Kind === 'event' && activity.Name) {\n this.Engine.RecordEvent(instanceId, activity.Name, ToBoundedJson(activity.Payload));\n }\n const changeId = this.RecordChange({ Author: activity.Kind === 'initialized' ? 'system' : 'user' });\n if (activity.Kind === 'event' && activity.Name) {\n this.EmitChannelEvent(activity.Name, { payload: ToBoundedJson(activity.Payload) }, changeId, instanceId);\n }\n this.scheduleSettle('user');\n void this.NotifyVisualChange();\n }\n\n /** The user closed a component's tab. */\n private userClosed(record: ComponentInstanceRecord): void {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name, by: 'user' }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'user' });\n }\n\n /**\n * A component's data usually arrives AFTER the action that asked for it, so the state is described once more shortly\n * afterward. One timer covers a burst.\n */\n private scheduleSettle(author: RealtimeChannelActor): void {\n if (this.settleTimer !== null || this.Exposure === 'none') {\n return;\n }\n this.settleTimer = setTimeout(() => {\n this.settleTimer = null;\n this.RecordChange({ Author: author });\n }, this.DataSettleMs);\n }\n}\n\n/**\n * Tree-shaking prevention: the channel is resolved through the ClassFactory by the registry row's `ClientPluginClass`\n * key, so this static call keeps its `@RegisterClass` side effect from being eliminated by the bundler. Called alongside\n * `LoadRealtimeMediaChannel()`.\n */\nexport function LoadRealtimeInteractiveComponentChannel(): void {\n // intentional no-op: the import side effect performs the registration\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-component-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/interactive-component/interactive-component-channel.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EACH,iCAAiC,EAEjC,+BAA+B,GAIlC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACH,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,GAItB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAoB,MAAM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;QAC1C,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;CACJ,CAAA;AAxvBY,2BAA2B;IADvC,aAAa,CAAC,yBAAyB,EAAE,yCAAyC,CAAC;GACvE,2BAA2B,CAwvBvC;;AAED;;;;GAIG;AACH,MAAM,UAAU,uCAAuC;IACnD,sEAAsE;AAC1E,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport type { JSONObject, RealtimeToolDefinition } from '@memberjunction/ai';\nimport {\n REALTIME_CHANNEL_CONTRACT_VERSION,\n type RealtimeChannelActor,\n ValidateJsonAgainstSchemaSubset,\n type RealtimeChannelDescriptor,\n type RealtimeChannelEventSpec,\n type RealtimeChannelVerb,\n} from '@memberjunction/ai-core-plus';\nimport { LogError } from '@memberjunction/core';\nimport { IsPlainObject, RegisterClass } from '@memberjunction/global';\nimport {\n BaseRealtimeChannelClient,\n FormatChannelNote,\n FormatParameterList,\n type ChannelOnboardingDetails,\n type ParsedDelegationArtifact,\n type RealtimeChannelVerbResult,\n} from '@memberjunction/realtime-runtime';\nimport { DeriveComponentContract, MergeVerbOffers, type DerivedVerb } from './component-contract';\nimport { SummarizeDataState, ToBoundedJson } from './component-data-state';\nimport { ComponentInstanceEngine, InstanceLimitError, type ComponentInstanceRecord } from './component-instance-engine';\nimport { ParseInteractiveComponentConfig } from './interactive-component-config';\nimport { ChannelFrameCapture } from '@memberjunction/ng-realtime-channels';\nimport {\n IsCollaborativeArtifactDescriptor,\n IsComponentArtifactDescriptor,\n} from '../artifact-workspace/artifact-workspace-types';\nimport { RealtimeInteractiveComponentSurfaceComponent } from './realtime-interactive-component-surface.component';\nimport { RunViewComponentArtifactSource } from './run-view-component-artifact-source';\nimport {\n BUILTIN_VERBS,\n ComponentArtifactError,\n DEFAULT_INTERACTIVE_COMPONENT_CONFIG,\n INTERACTIVE_COMPONENT_CHANNEL_KEY,\n INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS,\n type ComponentActivity,\n type ComponentVersionChangeReason,\n type IComponentArtifactSource,\n type IInteractiveComponentHandle,\n type InteractiveComponentConfig,\n type ResolvedComponentArtifact,\n} from './interactive-component-types';\n\n/** How long a verb waits for a freshly opened component to finish initializing (the poll interval times the attempt cap). */\nconst HANDLE_POLL_INTERVAL_MS = 100;\nconst HANDLE_POLL_MAX_ATTEMPTS = 80;\n\n/** How long after the user (or the agent) acts the data is read once more, because a component's data arrives after the action that asked for it. */\nconst DATA_SETTLE_MS = 1200;\n\n/** The events every instance can report, whatever its spec declares. */\nconst BUILTIN_EVENTS: readonly RealtimeChannelEventSpec[] = [\n { Name: 'opened', Description: 'A component was opened. Carries the inputs it was opened with.' },\n { Name: 'closed', Description: 'A component was closed.' },\n {\n Name: 'version_changed',\n Description: 'A component now shows a different version of its artifact (you asked for it, or a newer version appeared).',\n PayloadSchema: {\n type: 'object',\n properties: {\n from: { type: 'string', description: 'The version id it showed.' },\n to: { type: 'string', description: 'The version id it shows now.' },\n reason: { type: 'string', enum: ['agent', 'newer-version'] },\n },\n },\n },\n {\n Name: 'newer_version_available',\n Description: 'A newer version of an open component exists, and this session is not set to swap to it automatically.',\n PayloadSchema: { type: 'object', properties: { current: { type: 'string' }, available: { type: 'string' } } },\n },\n];\n\n/** A failure the dispatcher turns into a message the model can act on. */\nfunction failure(code: string, error: string, details?: string[]): RealtimeChannelVerbResult {\n return details ? { Success: false, ErrorCode: code, Error: error, Details: details } : { Success: false, ErrorCode: code, Error: error };\n}\n\n/** A non-empty string argument, or `undefined`. */\nfunction readString(bag: JSONObject, key: string): string | undefined {\n const value = bag[key];\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * The INTERACTIVE COMPONENT channel: shows the user any interactive component artifact (a dashboard, a report, a\n * form, a chart) next to the voice conversation, and lets the agent operate it.\n *\n * It is a MULTI-INSTANCE channel (several components may be open at once, each addressed by `target.instance`) and\n * its contract is DERIVED from what it hosts: the actions an agent can take on an instance are that component's own\n * `customMethods` and the standard methods its spec says it supports; its state is the component's data state;\n * its events are the spec's `events`; the inputs for opening it are the spec's `properties`. A component nobody\n * wrote channel code for is therefore operable from its spec alone. See `DeriveComponentContract`.\n *\n * Built-in: `open { artifactId | artifactVersionId, inputs? }` (the dispatcher's reserved action), `show_version`, `close`.\n *\n * ### What the model perceives\n * Per instance: which artifact version is open, what the user last did in it (its events), and its data state,\n * bounded to a handful of rows. All of it is gated by exposure policy (`min(channel, agent config, zero-data-retention,\n * user)`). Pixels flow only if the host registered a frame capturer ({@link ChannelFrameCapture}).\n * Agent-INVOKED verbs return what the component returns; exposure gates what is volunteered to the model, not what it\n * asked for.\n *\n * ### Access\n * Artifacts are loaded through the signed-in user's own session and read permission (see `RunViewComponentArtifactSource`).\n * The agent cannot open anything the user cannot.\n *\n * ### Lifetime\n * Open components are live-only: they are not persisted with the session and are not restored on resume.\n */\n@RegisterClass(BaseRealtimeChannelClient, INTERACTIVE_COMPONENT_CLIENT_PLUGIN_CLASS)\nexport class InteractiveComponentChannel extends BaseRealtimeChannelClient<RealtimeInteractiveComponentSurfaceComponent> {\n /** The components that are open. */\n public readonly Engine = new ComponentInstanceEngine(DEFAULT_INTERACTIVE_COMPONENT_CONFIG.MaxInstances);\n\n /** The resolved configuration; the defaults until {@link Initialize} reads the cascade. */\n public Config: InteractiveComponentConfig = { ...DEFAULT_INTERACTIVE_COMPONENT_CONFIG };\n\n /** How long a verb waits for a component to initialize; overridable so tests need not sleep. */\n protected HandlePollIntervalMs = HANDLE_POLL_INTERVAL_MS;\n /** How long after an action the data state is re-read; overridable for tests. */\n protected DataSettleMs = DATA_SETTLE_MS;\n\n private artifactSource: IComponentArtifactSource | null = null;\n private surface: RealtimeInteractiveComponentSurfaceComponent | null = null;\n private settleTimer: ReturnType<typeof setTimeout> | null = null;\n\n public get ChannelName(): string {\n return INTERACTIVE_COMPONENT_CHANNEL_KEY;\n }\n\n /**\n * The id state notes carry. A multi-instance channel's snapshot describes ALL its instances (keyed by their own ids,\n * `c1`, `c2`, ...), so the notes about the snapshot as a whole are addressed to `all` rather than to one of them.\n */\n public override get InstanceId(): string {\n return 'all';\n }\n\n public override get TabTitle(): string {\n return 'Components';\n }\n\n public override get TabIcon(): string {\n return 'fa-solid fa-cubes';\n }\n\n /** The channel has no native tools: every verb is reached through the `ContextTool` proxy, because the verbs depend on what is open. */\n public override GetToolDefinitions(): RealtimeToolDefinition[] {\n return [];\n }\n\n /**\n * Replaces where artifacts are loaded from (a host with its own store, or a test). Without it the channel loads\n * through the session's provider and the signed-in user's access.\n */\n public SetArtifactSource(source: IComponentArtifactSource | null): void {\n this.artifactSource = source;\n }\n\n // ── Contract: descriptor ───────────────────────────────────────────────────\n\n /**\n * The channel's self-description. The verbs and events are the built-ins plus those of every component that is\n * open right now, so the contract grows as components are opened and the dispatcher validates against it.\n */\n public override GetDescriptor(): RealtimeChannelDescriptor {\n return {\n Key: this.ChannelName,\n Version: REALTIME_CHANNEL_CONTRACT_VERSION,\n DisplayName: 'Interactive Components',\n OwningPackage: '@memberjunction/ng-conversations',\n Instructions:\n 'Shows the user an interactive component (a dashboard, report, chart or form) built as an artifact, next to the conversation. ' +\n 'Open one with action \"open\" and an artifactId (its latest version) or an artifactVersionId. The result lists the actions THAT component supports ' +\n 'and the events it reports; use them as actions of this channel. Several components can be open: pass the instance id to say which, ' +\n 'otherwise the one the user is looking at is used. You can open components other agents built (they come back as artifacts). ' +\n 'You are told what the user is looking at and what they do in it; do not narrate routine changes.',\n Nouns: [\n {\n Name: 'components',\n Description:\n 'The open components keyed by instance id: which artifact version each shows, whether it is the one the user is looking at, ' +\n 'what the user last did in it, and (when the component reports one) a bounded summary of its data.',\n Schema: { type: 'object', additionalProperties: { type: 'object' } },\n },\n ],\n Verbs: this.collectVerbs(),\n Inputs: {\n type: 'object',\n properties: {\n artifactId: { type: 'string', description: 'The artifact to open (its latest version is shown).' },\n artifactVersionId: { type: 'string', description: 'A specific artifact version to open (instead of artifactId).' },\n inputs: { type: 'object', description: 'Values for the component\\'s own properties, as its spec declares them.' },\n },\n additionalProperties: false,\n },\n Events: this.collectEvents(),\n DisplayPolicy: 'on-demand',\n DefaultAvailability: 'opt-in',\n MaxExposure: 'pixels',\n MultiInstance: true,\n };\n }\n\n /** The built-in verbs plus each open component's, merged by name. */\n private collectVerbs(): RealtimeChannelVerb[] {\n const builtins: RealtimeChannelVerb[] = [\n {\n Name: BUILTIN_VERBS.ShowVersion,\n Description: 'Shows another version of an open component\\'s own artifact in place (the instance stays open and keeps its id).',\n ParametersSchema: {\n type: 'object',\n properties: { versionId: { type: 'string', description: 'The artifact version to show.' } },\n required: ['versionId'],\n additionalProperties: false,\n },\n InvokableBy: 'agent',\n },\n {\n Name: BUILTIN_VERBS.Close,\n Description: 'Closes an open component.',\n ParametersSchema: { type: 'object', properties: {}, additionalProperties: false },\n InvokableBy: 'agent',\n },\n ];\n const byName = new Map<string, Array<{ Component: string; Verb: RealtimeChannelVerb }>>();\n for (const record of this.Engine.Instances) {\n for (const derived of record.Contract.Verbs) {\n const key = derived.Verb.Name.toLowerCase();\n const offers = byName.get(key) ?? [];\n offers.push({ Component: record.Artifact.Name, Verb: derived.Verb });\n byName.set(key, offers);\n }\n }\n return [...builtins, ...[...byName.values()].map((offers) => MergeVerbOffers(offers))];\n }\n\n /** The built-in events plus each open component's declared ones. */\n private collectEvents(): RealtimeChannelEventSpec[] {\n const events = new Map<string, RealtimeChannelEventSpec>(BUILTIN_EVENTS.map((e) => [e.Name.toLowerCase(), e]));\n for (const record of this.Engine.Instances) {\n for (const event of record.Contract.Events) {\n if (!events.has(event.Name.toLowerCase())) {\n events.set(event.Name.toLowerCase(), event);\n }\n }\n }\n return [...events.values()];\n }\n\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Interactive components',\n Description:\n 'The agent can open an interactive component — a dashboard, report or form — right here during the call, and work with it alongside you.',\n Tips: [\n 'Switch between open components using the tabs along the top.',\n 'The agent sees what you select and change, so you can say \"this one\" and point.',\n 'Use the \"Agent can see\" control to limit what the agent perceives.',\n ],\n IconClass: 'fa-solid fa-cubes',\n };\n }\n\n // ── Lifecycle ──────────────────────────────────────────────────────────────\n\n protected override OnInitialize(): void {\n const parsed = ParseInteractiveComponentConfig(this.Context?.ChannelConfig);\n this.Config = parsed.Config;\n this.Engine.SetMaxInstances(this.Config.MaxInstances);\n for (const problem of parsed.Problems) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Configuration: ${problem}`);\n }\n if (!this.artifactSource) {\n const provider = this.Context?.Provider;\n const user = provider?.CurrentUser;\n if (provider && user) {\n this.artifactSource = new RunViewComponentArtifactSource(provider, user);\n }\n }\n this.enableVisualPerceptionIfAvailable();\n }\n\n /** Opts into pixels only when the host registered something that can rasterize a component. */\n private enableVisualPerceptionIfAvailable(): void {\n if (!ChannelFrameCapture.Instance.Capturer) {\n return;\n }\n this.EnableVisualPerception({ GetLatestFrame: () => this.CaptureActiveFrame() });\n }\n\n /**\n * A picture of the component the user is looking at, as base64 JPEG, or `null` when there is none to send: exposure is\n * below `pixels`, the session has no inbound video track, nothing is on screen, or the host's rasterizer produced nothing\n * (it reports why, once, itself). Never throws.\n *\n * The base channel's visual pump has already checked exposure and the track before it asks; they are checked again so a\n * frame is never rasterized (the costly part) for a model that may not see it, whoever asks.\n */\n protected async CaptureActiveFrame(): Promise<string | null> {\n const capturer = ChannelFrameCapture.Instance.Capturer;\n if (!capturer || this.Exposure !== 'pixels' || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return null;\n }\n const element = this.surface?.GetActiveElement() ?? null;\n if (!element) {\n return null;\n }\n try {\n return await capturer(element);\n } catch (error) {\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Capturing a component frame failed: ${error instanceof Error ? error.message : String(error)}`);\n return null;\n }\n }\n\n public override GetSurfaceComponent(): Type<RealtimeInteractiveComponentSurfaceComponent> {\n return RealtimeInteractiveComponentSurfaceComponent;\n }\n\n /** Hands the dynamically created surface the engine it renders and the hooks it reports through. */\n public override BindSurface(instance: RealtimeInteractiveComponentSurfaceComponent): void {\n this.surface = instance;\n instance.Engine = this.Engine;\n instance.AgentName = this.Context?.AgentName ?? 'The agent';\n instance.Provider = this.Context?.Provider ?? null;\n instance.ActivityHandler = (instanceId: string, activity: ComponentActivity) => this.OnComponentActivity(instanceId, activity);\n }\n\n public override UnbindSurface(): void {\n this.surface = null;\n }\n\n public override Dispose(): void {\n if (this.settleTimer !== null) {\n clearTimeout(this.settleTimer);\n this.settleTimer = null;\n }\n this.surface = null;\n this.Engine.Dispose();\n super.Dispose();\n }\n\n // ── Contract: state ────────────────────────────────────────────────────────\n\n /**\n * Open components are LIVE-ONLY: there is no state of record to persist, so nothing is saved with the session\n * (`null`, which the host never writes) and {@link RestoreState} refuses what it is offered. A resumed session starts\n * with no component open; the agent opens them again. What the model perceives right now is {@link GetState}.\n */\n public override SerializeState(): string | null {\n return null;\n }\n\n /** Live-only: a resumed session never restores open components (see {@link SerializeState}). Always `false`. */\n public override RestoreState(_stateJson: string): boolean {\n return false;\n }\n\n /** The open components, keyed by instance id (see the `components` noun). A pure read. */\n public override GetState(): JSONObject {\n const components: JSONObject = {};\n for (const record of this.Engine.Instances) {\n components[record.InstanceID] = this.describeForState(record);\n }\n return { components };\n }\n\n /** One instance as the model perceives it. */\n private describeForState(record: ComponentInstanceRecord): JSONObject {\n const entry: JSONObject = {\n name: record.Artifact.Name,\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n active: this.Engine.ActiveID === record.InstanceID,\n };\n if (Object.keys(record.Inputs).length > 0) {\n entry['inputs'] = ToBoundedJson(record.Inputs);\n }\n if (record.LastEvent) {\n entry['lastEvent'] = { type: record.LastEvent.Type, payload: record.LastEvent.Payload, seq: record.LastEvent.Seq };\n }\n if (record.Contract.SupportsDataState && record.Handle?.IsReady) {\n const data = SummarizeDataState(record.Handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n if (data) {\n entry['data'] = data;\n }\n }\n return entry;\n }\n\n // ── Opening ────────────────────────────────────────────────────────────────\n\n /**\n * Loads the artifact and opens it as a new instance (or, when that artifact is already open, brings the existing\n * instance forward and moves it to the requested version). Refusals are structured results, never exceptions.\n */\n protected override async OnOpen(inputs: JSONObject): Promise<RealtimeChannelVerbResult> {\n const artifactId = readString(inputs, 'artifactId');\n const versionId = readString(inputs, 'artifactVersionId');\n if ((artifactId === undefined) === (versionId === undefined)) {\n return failure('invalid_params', 'Provide exactly one of artifactId (the latest version) or artifactVersionId (a specific version).');\n }\n const source = this.artifactSource;\n if (!source) {\n return failure('open_failed', 'Components cannot be loaded in this session (no signed-in user to load them for).');\n }\n let artifact: ResolvedComponentArtifact;\n try {\n artifact = versionId ? await source.LoadVersion(versionId) : await source.LoadLatest(artifactId as string);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n const existing = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (existing) {\n return this.reuseOpenInstance(existing, artifact);\n }\n return this.addInstance(artifact, inputs);\n }\n\n /** Opens a new instance for a loaded artifact. */\n private addInstance(artifact: ResolvedComponentArtifact, inputs: JSONObject): RealtimeChannelVerbResult {\n const componentInputs = IsPlainObject(inputs['inputs']) ? (inputs['inputs'] as JSONObject) : {};\n const contractIssues = ValidateJsonAgainstSchemaSubset(componentInputs, this.inputsSchemaFor(artifact), '$.inputs');\n if (contractIssues.length > 0) {\n return failure('invalid_params', `The inputs for \"${artifact.Name}\" are invalid.`, contractIssues);\n }\n try {\n const record = this.Engine.Add(artifact, componentInputs);\n return { Success: true, Instance: record.InstanceID, Result: this.describeOpened(record) };\n } catch (error) {\n if (error instanceof InstanceLimitError) {\n return failure('open_failed', error.message, [`open: ${this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ')}`]);\n }\n throw error;\n }\n }\n\n /** The inputs schema a freshly derived contract would have, so opening is validated before an instance exists. */\n private inputsSchemaFor(artifact: ResolvedComponentArtifact): JSONObject {\n return DeriveComponentContract(artifact.Spec).InputsSchema;\n }\n\n /** An artifact that is already open is not opened twice: focus it, and show the requested version. */\n private async reuseOpenInstance(existing: ComponentInstanceRecord, artifact: ResolvedComponentArtifact): Promise<RealtimeChannelVerbResult> {\n this.Engine.SetActive(existing.InstanceID);\n if (existing.Artifact.VersionID !== artifact.VersionID) {\n this.swapVersion(existing, artifact, 'agent');\n }\n return {\n Success: true,\n Instance: existing.InstanceID,\n Result: { ...this.describeOpened(existing), alreadyOpen: true },\n };\n }\n\n /** What the agent is told when it opens (or revisits) a component: how to operate it. */\n private describeOpened(record: ComponentInstanceRecord): JSONObject {\n return {\n artifactId: record.Artifact.ArtifactID,\n artifactVersionId: record.Artifact.VersionID,\n versionNumber: record.Artifact.VersionNumber,\n name: record.Artifact.Name,\n actions: record.Contract.Verbs.map((v) => `${v.Verb.Name}(${FormatParameterList(v.Verb.ParametersSchema)}) — ${v.Verb.Description}`),\n events: record.Contract.Events.map((e) => e.Name),\n ...(record.Contract.Skipped.length > 0\n ? { unavailable: record.Contract.Skipped.map((s) => `${s.Name}: ${s.Reason}`) }\n : {}),\n };\n }\n\n /** Maps a failed artifact load to a result the model can act on. */\n private mapLoadFailure(error: unknown): RealtimeChannelVerbResult {\n if (error instanceof ComponentArtifactError) {\n return failure(error.Code === 'invalid_id' ? 'invalid_params' : 'open_failed', error.message, [error.Code]);\n }\n LogError(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Loading a component artifact failed: ${error instanceof Error ? error.message : String(error)}`);\n return failure('open_failed', 'That artifact could not be loaded.');\n }\n\n // ── Delegated artifacts ────────────────────────────────────────────────────\n\n /**\n * Asks to be offered a delegated run's artifacts when the operator turned on auto-open, or when one of them is\n * already open here (so a revised version replaces it). Whether an artifact is a component is only known once it\n * is loaded, so with auto-open on the channel is mounted for any delegated artifact and ignores the ones that are not.\n */\n public override AcceptsDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[], config: JSONObject): boolean {\n if (artifacts.some((a) => this.Engine.FindByArtifact(a.ArtifactID))) {\n return true;\n }\n const candidateArtifacts = artifacts.filter((a) => this.isDelegatedArtifactCandidate(a));\n return candidateArtifacts.length > 0 && ParseInteractiveComponentConfig(config).Config.AutoOpenDelegatedComponents;\n }\n\n /**\n * Takes a delegated run's artifacts: an artifact that is already open moves to its newer version (or, when the\n * configuration says not to swap, the agent is told one exists); with auto-open on, a component that is not open is opened.\n */\n public override async OnDelegationArtifacts(artifacts: readonly ParsedDelegationArtifact[]): Promise<void> {\n for (const artifact of artifacts) {\n const open = this.Engine.FindByArtifact(artifact.ArtifactID);\n if (open) {\n await this.takeNewerVersion(open, artifact);\n continue;\n }\n if (!this.isDelegatedArtifactCandidate(artifact)) {\n continue;\n }\n if (this.Config.AutoOpenDelegatedComponents) {\n await this.autoOpen(artifact);\n }\n }\n }\n\n private isDelegatedArtifactCandidate(artifact: ParsedDelegationArtifact): boolean {\n if (IsCollaborativeArtifactDescriptor(artifact.ArtifactTypeName, artifact.DriverClass)) {\n return false;\n }\n return (\n IsComponentArtifactDescriptor(artifact.ArtifactTypeName, artifact.DriverClass) ||\n (!artifact.ArtifactTypeName?.trim() && !artifact.DriverClass?.trim())\n );\n }\n\n /** Opens a delegated artifact; one that is not a component is ignored (expected), anything else is logged. */\n private async autoOpen(artifact: ParsedDelegationArtifact): Promise<void> {\n const opened = await this.Open({ artifactVersionId: artifact.ArtifactVersionID });\n if (!opened.Success && !(opened.Details ?? []).includes('not_a_component')) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not open delegated artifact \"${artifact.Name}\": ${opened.Error ?? opened.ErrorCode}`);\n }\n }\n\n /** Moves an open instance to the version a delegated run produced, when that version is newer. */\n private async takeNewerVersion(open: ComponentInstanceRecord, artifact: ParsedDelegationArtifact): Promise<void> {\n if (open.Artifact.VersionID.toLowerCase() === artifact.ArtifactVersionID.toLowerCase() || !this.artifactSource) {\n return;\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(artifact.ArtifactVersionID);\n } catch (error) {\n console.warn(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] Could not load the newer version of \"${open.Artifact.Name}\": ${error instanceof Error ? error.message : String(error)}`);\n return;\n }\n if (loaded.VersionNumber <= open.Artifact.VersionNumber) {\n return;\n }\n if (this.Config.SwapToNewerVersions) {\n this.swapVersion(open, loaded, 'newer-version');\n } else {\n this.EmitChannelEvent('newer_version_available', { current: open.Artifact.VersionID, available: loaded.VersionID }, undefined, open.InstanceID);\n if (this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, open.InstanceID, 'newer_version_available', {\n current: open.Artifact.VersionID,\n available: loaded.VersionID,\n })\n );\n }\n }\n }\n\n // ── Version swap ───────────────────────────────────────────────────────────\n\n /** Shows another version in an existing instance, keeping its id; tells observers, and the model when it did not ask. */\n private swapVersion(record: ComponentInstanceRecord, artifact: ResolvedComponentArtifact, reason: ComponentVersionChangeReason): void {\n const from = record.Artifact.VersionID;\n this.Engine.SwapVersion(record.InstanceID, artifact);\n const payload: JSONObject = { from, to: artifact.VersionID, reason };\n this.EmitChannelEvent('version_changed', payload, undefined, record.InstanceID);\n if (reason === 'newer-version' && this.Exposure !== 'none') {\n this.Context?.SendContextNote(\n FormatChannelNote(INTERACTIVE_COMPONENT_CHANNEL_KEY, record.InstanceID, 'version_changed', {\n ...payload,\n actions: record.Contract.Verbs.map((v) => v.Verb.Name),\n })\n );\n }\n this.RecordChange({ Author: reason === 'agent' ? 'agent' : 'system' });\n }\n\n // ── Verbs ──────────────────────────────────────────────────────────────────\n\n /**\n * Runs one verb. The dispatcher has already checked the verb against the (merged) descriptor; the exact check against\n * the addressed component's own schema happens here.\n */\n public override async ApplyVerb(\n verb: string,\n args: JSONObject,\n actor: RealtimeChannelActor,\n instanceId?: string\n ): Promise<RealtimeChannelVerbResult> {\n const name = verb.trim().toLowerCase();\n const target = this.resolveInstance(name, instanceId);\n if ('Success' in target) {\n return target;\n }\n const refusal = actor === 'agent' ? this.refuseForExposure(target, name) : null;\n if (refusal) {\n return refusal;\n }\n if (name === BUILTIN_VERBS.ShowVersion) {\n return this.showVersion(target, args);\n }\n if (name === BUILTIN_VERBS.Close) {\n return this.closeInstance(target);\n }\n return this.invokeDerived(target, name, args, actor);\n }\n\n /**\n * Refuses a verb whose result carries the component's data while exposure keeps that from the agent. The dispatcher\n * checks the same thing against the (merged) descriptor; this is the exact per-instance check, and it keeps the\n * channel safe when it is driven by something other than the dispatcher.\n */\n private refuseForExposure(record: ComponentInstanceRecord, verbName: string): RealtimeChannelVerbResult | null {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === verbName);\n const message = derived ? this.RefuseVerbForExposure(derived.Verb) : null;\n return message ? failure('exposure_restricted', message, [...this.ExposureReasons]) : null;\n }\n\n /**\n * Finds the instance a verb addresses: the one named, else the one the user is looking at when it supports the verb,\n * else the only one that does. Anything else is a refusal that lists what would have worked.\n */\n private resolveInstance(verb: string, instanceId: string | undefined): ComponentInstanceRecord | RealtimeChannelVerbResult {\n const supports = (r: ComponentInstanceRecord): boolean =>\n verb === BUILTIN_VERBS.ShowVersion || verb === BUILTIN_VERBS.Close || r.Contract.Verbs.some((v) => v.Verb.Name.toLowerCase() === verb);\n if (instanceId !== undefined) {\n const named = this.Engine.Get(instanceId);\n if (!named) {\n return failure('unknown_instance', `No component \"${instanceId}\" is open.`, [`open: ${this.listOpen()}`]);\n }\n return supports(named) ? named : failure('verb_failed', `\"${named.Artifact.Name}\" has no action \"${verb}\".`);\n }\n const candidates = this.Engine.Instances.filter(supports);\n const active = candidates.find((r) => r.InstanceID === this.Engine.ActiveID);\n if (active) {\n return active;\n }\n if (candidates.length === 1) {\n return candidates[0];\n }\n if (candidates.length === 0) {\n return failure('verb_failed', `No open component has an action \"${verb}\".`, [`open: ${this.listOpen() || 'nothing'}`]);\n }\n return failure('ambiguous_instance', `Several open components have \"${verb}\"; say which with the instance.`, [`open: ${this.listOpen()}`]);\n }\n\n /** `c1 (Revenue), c2 (Pipeline)`. */\n private listOpen(): string {\n return this.Engine.Instances.map((r) => `${r.InstanceID} (${r.Artifact.Name})`).join(', ');\n }\n\n /** `show_version`: swap an instance to another version of ITS artifact. */\n private async showVersion(record: ComponentInstanceRecord, args: JSONObject): Promise<RealtimeChannelVerbResult> {\n const versionId = readString(args, 'versionId');\n if (!versionId || !this.artifactSource) {\n return failure('invalid_params', versionId ? 'Components cannot be loaded in this session.' : 'show_version needs a versionId.');\n }\n let loaded: ResolvedComponentArtifact;\n try {\n loaded = await this.artifactSource.LoadVersion(versionId);\n } catch (error) {\n return this.mapLoadFailure(error);\n }\n if (loaded.ArtifactID.toLowerCase() !== record.Artifact.ArtifactID.toLowerCase()) {\n return failure('verb_failed', `That version belongs to a different artifact (\"${loaded.Name}\"). Open it with \"open\" instead.`);\n }\n if (loaded.VersionID.toLowerCase() === record.Artifact.VersionID.toLowerCase()) {\n return { Success: true, Result: { changed: false, instance: record.InstanceID, versionNumber: loaded.VersionNumber } };\n }\n this.swapVersion(record, loaded, 'agent');\n return { Success: true, Result: { changed: true, instance: record.InstanceID, ...this.describeOpened(record) } };\n }\n\n /** `close`. */\n private closeInstance(record: ComponentInstanceRecord): RealtimeChannelVerbResult {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'agent' });\n return { Success: true, Result: { closed: true, instance: record.InstanceID } };\n }\n\n /** Runs a verb derived from the component's spec. */\n private async invokeDerived(\n record: ComponentInstanceRecord,\n name: string,\n args: JSONObject,\n actor: RealtimeChannelActor\n ): Promise<RealtimeChannelVerbResult> {\n const derived = record.Contract.Verbs.find((v) => v.Verb.Name.toLowerCase() === name);\n if (!derived) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" has no action \"${name}\".`);\n }\n const issues = ValidateJsonAgainstSchemaSubset(args, derived.Verb.ParametersSchema);\n if (issues.length > 0) {\n return failure(\n 'invalid_params',\n `The parameters for ${derived.Verb.Name} on \"${record.Artifact.Name}\" are invalid. Expected ${derived.Verb.Name}(${FormatParameterList(derived.Verb.ParametersSchema)}).`,\n issues\n );\n }\n const handle = await this.waitForHandle(record);\n if (!handle) {\n return failure('verb_failed', `\"${record.Artifact.Name}\" is still loading. Try again in a moment.`);\n }\n try {\n const result = await this.runBinding(record, handle, derived, args);\n this.afterAction(record, derived, actor);\n return { Success: true, Result: { instance: record.InstanceID, ...result } };\n } catch (error) {\n console.error(`[RealtimeChannel:${INTERACTIVE_COMPONENT_CHANNEL_KEY}] ${derived.Verb.Name} on \"${record.Artifact.Name}\" threw:`, error);\n return failure('verb_failed', `${derived.Verb.Name} failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /** Waits (bounded) for the surface to mount the component and report it ready. */\n private async waitForHandle(record: ComponentInstanceRecord): Promise<IInteractiveComponentHandle | null> {\n for (let attempt = 0; attempt < HANDLE_POLL_MAX_ATTEMPTS; attempt++) {\n if (record.Handle?.IsReady) {\n return record.Handle;\n }\n if (!this.Engine.Get(record.InstanceID)) {\n return null;\n }\n await new Promise((resolve) => setTimeout(resolve, this.HandlePollIntervalMs));\n }\n return record.Handle?.IsReady ? record.Handle : null;\n }\n\n /** Executes a derived verb against the live component and returns what to tell the model. */\n private async runBinding(\n record: ComponentInstanceRecord,\n handle: IInteractiveComponentHandle,\n derived: DerivedVerb,\n args: JSONObject\n ): Promise<JSONObject> {\n const binding = derived.Binding;\n if (binding.Kind === 'custom') {\n if (!handle.HasMethod(binding.Method)) {\n throw new Error(`the component does not implement ${binding.Method}`);\n }\n const positional = binding.ParameterNames.map((n) => args[n]);\n const returned = await handle.InvokeMethod(binding.Method, positional);\n return { result: ToBoundedJson(returned) };\n }\n switch (binding.Standard) {\n case 'Refresh':\n handle.Refresh();\n return { refreshed: true };\n case 'Print':\n handle.Print();\n return { printing: true };\n case 'Validate':\n return { validation: ToBoundedJson(handle.Validate()) };\n case 'IsDirty':\n return { dirty: handle.IsDirty() };\n case 'Reset':\n handle.Reset();\n return { reset: true };\n case 'ScrollTo':\n return this.scrollTo(handle, args);\n case 'Focus':\n handle.Focus(readString(args, 'target'));\n return { focused: true };\n case 'GetDataState': {\n const data = SummarizeDataState(handle.GetCurrentDataState(), {\n MaxRows: this.Config.MaxStateRows,\n MaxChars: this.Config.MaxStateChars,\n });\n return data ? { data } : { data: null, note: 'The component has no data state yet.' };\n }\n default:\n throw new Error(`unsupported standard action ${String(binding.Standard)} on ${record.Artifact.Name}`);\n }\n }\n\n /** `scroll_to`: a selector, or an offset. */\n private scrollTo(handle: IInteractiveComponentHandle, args: JSONObject): JSONObject {\n const target = readString(args, 'target');\n if (target !== undefined) {\n handle.ScrollTo(target);\n return { scrolledTo: target };\n }\n const top = typeof args['top'] === 'number' ? args['top'] : undefined;\n const left = typeof args['left'] === 'number' ? args['left'] : undefined;\n if (top === undefined && left === undefined) {\n throw new Error('scroll_to needs a target selector or a top/left offset');\n }\n handle.ScrollTo({ top, left });\n return { scrolled: true };\n }\n\n /** What happens after a verb ran: the state may have changed, and the picture may have too. */\n private afterAction(record: ComponentInstanceRecord, derived: DerivedVerb, actor: RealtimeChannelActor): void {\n const readOnly =\n derived.Binding.Kind === 'standard' &&\n (derived.Binding.Standard === 'GetDataState' || derived.Binding.Standard === 'IsDirty' || derived.Binding.Standard === 'Validate' || derived.Binding.Standard === 'Print');\n if (readOnly) {\n return;\n }\n this.Engine.SetActive(record.InstanceID);\n this.RecordChange({ Author: actor });\n this.scheduleSettle(actor);\n void this.ConfirmVisualChange();\n }\n\n // ── What the user does ─────────────────────────────────────────────────────\n\n /**\n * Called by the surface when something happens inside a rendered component: an event it emits, a state change,\n * or the end of its initialization. Becomes a change in the state the model perceives and a typed event for observers.\n */\n public OnComponentActivity(instanceId: string, activity: ComponentActivity): void {\n const record = this.Engine.Get(instanceId);\n if (!record) {\n return;\n }\n if (activity.Kind === 'closed') {\n this.userClosed(record);\n return;\n }\n if (activity.Kind === 'selected') {\n if (this.Engine.ActiveID !== instanceId) {\n this.Engine.SetActive(instanceId);\n this.RecordChange({ Author: 'user' });\n void this.NotifyVisualChange();\n }\n return;\n }\n if (activity.Kind === 'event' && activity.Name) {\n this.Engine.RecordEvent(instanceId, activity.Name, ToBoundedJson(activity.Payload));\n }\n const changeId = this.RecordChange({ Author: activity.Kind === 'initialized' ? 'system' : 'user' });\n if (activity.Kind === 'event' && activity.Name) {\n this.EmitChannelEvent(activity.Name, { payload: ToBoundedJson(activity.Payload) }, changeId, instanceId);\n }\n this.scheduleSettle('user');\n void this.NotifyVisualChange();\n }\n\n /** The user closed a component's tab. */\n private userClosed(record: ComponentInstanceRecord): void {\n const name = record.Artifact.Name;\n this.Engine.Remove(record.InstanceID);\n this.EmitChannelEvent('closed', { name, by: 'user' }, undefined, record.InstanceID);\n this.RecordChange({ Author: 'user' });\n }\n\n /**\n * A component's data usually arrives AFTER the action that asked for it, so the state is described once more shortly\n * afterward. One timer covers a burst.\n */\n private scheduleSettle(author: RealtimeChannelActor): void {\n if (this.settleTimer !== null || this.Exposure === 'none') {\n return;\n }\n this.settleTimer = setTimeout(() => {\n this.settleTimer = null;\n this.RecordChange({ Author: author });\n }, this.DataSettleMs);\n }\n}\n\n/**\n * Tree-shaking prevention: the channel is resolved through the ClassFactory by the registry row's `ClientPluginClass`\n * key, so this static call keeps its `@RegisterClass` side effect from being eliminated by the bundler. Called alongside\n * `LoadRealtimeMediaChannel()`.\n */\nexport function LoadRealtimeInteractiveComponentChannel(): void {\n // intentional no-op: the import side effect performs the registration\n}\n"]}
|
|
@@ -37,7 +37,7 @@ function RealtimeAgentBannerComponent_Conditional_1_Conditional_15_Template(rf,
|
|
|
37
37
|
i0.ɵɵlistener("click", function RealtimeAgentBannerComponent_Conditional_1_Conditional_15_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.StartLiveRequested.emit()); });
|
|
38
38
|
i0.ɵɵelement(1, "i", 19);
|
|
39
39
|
i0.ɵɵelementStart(2, "span");
|
|
40
|
-
i0.ɵɵtext(3, "
|
|
40
|
+
i0.ɵɵtext(3, "Resume session");
|
|
41
41
|
i0.ɵɵelementEnd()();
|
|
42
42
|
} }
|
|
43
43
|
function RealtimeAgentBannerComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -527,7 +527,7 @@ export class RealtimeAgentBannerComponent {
|
|
|
527
527
|
}
|
|
528
528
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RealtimeAgentBannerComponent, [{
|
|
529
529
|
type: Component,
|
|
530
|
-
args: [{ standalone: true, selector: 'mj-realtime-agent-banner', imports: [CommonModule], template: "<div class=\"banner\" [class.banner--review]=\"ReviewMode\" [class.banner--compact]=\"Compact && !ReviewMode\">\n @if (ReviewMode) {\n <!-- SESSION REVIEW: static orb \u00B7 name \u00B7 review badge \u00B7 started\u2192closed \u00B7 close-reason chip,\n with the review's exit actions up here in the header bar (Start live leads, Close trails). -->\n <div class=\"agent-orb agent-orb--review\" aria-hidden=\"true\"></div>\n\n <div class=\"banner__id\">\n <span class=\"banner__name\">Voice for {{ AgentName }}</span>\n <span class=\"pill pill--review\"><i class=\"fa-solid fa-clock-rotate-left\" aria-hidden=\"true\"></i> Session review</span>\n @if (ReviewRangeLabel) {\n <span class=\"banner__for banner__range\">{{ ReviewRangeLabel }}</span>\n }\n @if (ReviewCloseReasonLabel) {\n <span class=\"pill pill--close-reason\" [title]=\"'Close reason: ' + ReviewCloseReason\">{{ ReviewCloseReasonLabel }}</span>\n }\n @if (ShowOpenSession) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenSession()\"\n title=\"Open the agent session record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open session</span>\n </button>\n }\n </div>\n\n <div class=\"banner__state banner__state--review\">\n <i class=\"fa-solid fa-box-archive\" aria-hidden=\"true\"></i>\n <span class=\"banner__state-label banner__state-label--review\">Reviewing past session</span>\n </div>\n\n <div class=\"bar-actions\">\n @if (ShowStartLive) {\n <button type=\"button\" class=\"start-live-pill\" (click)=\"StartLiveRequested.emit()\"\n title=\"Resume this session as a new live call\">\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n <span>Start live session</span>\n </button>\n }\n <button type=\"button\" class=\"iconb\" (click)=\"CloseRequested.emit()\"\n title=\"Close review\" aria-label=\"Close session review\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n } @else if (Compact) {\n <!-- COMPACT (Calm Orb \u00B7 overlay): a tiny identity + state row only. No duplicate orb,\n no state pill, no headphones / gear / expand \u2014 the body shows the big orb + name +\n state, and the lean dock owns the actions. Minimize stays reachable here. -->\n <div class=\"banner__id banner__id--compact\">\n <span class=\"banner__avatar\" aria-hidden=\"true\">{{ AgentName.charAt(0) }}</span>\n <span class=\"banner__name banner__name--compact\">{{ AgentName }}</span>\n @if (!HideState) {\n <span class=\"banner__state-chip\">\n @if (IsBusy(State)) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n } @else {\n <span class=\"banner__state-dot\" [attr.data-state]=\"OrbState(State)\" aria-hidden=\"true\"></span>\n }\n <span class=\"banner__state-chip-label\">{{ StateLabel(State) }}</span>\n </span>\n }\n </div>\n\n @if (ShowMinimize) {\n <button type=\"button\" class=\"iconb banner__minimize--compact\" (click)=\"MinimizeRequested.emit()\"\n title=\"Hide the call view \u2014 the call stays live\"\n aria-label=\"Minimize the call view\">\n <i class=\"fa-solid fa-minus\" aria-hidden=\"true\"></i>\n </button>\n }\n } @else {\n <div class=\"agent-orb\" [attr.data-state]=\"OrbState(State)\" aria-hidden=\"true\"></div>\n\n <div class=\"banner__id\">\n <span class=\"banner__name\">Voice for {{ AgentName }}</span>\n <span class=\"pill pill--sage\"><i class=\"fa-solid fa-feather\" aria-hidden=\"true\"></i> Co-Agent</span>\n @if (!HideState) {\n <span class=\"banner__for\">speaking as <b>{{ AgentName }}</b></span>\n }\n @if (ModelName) {\n <span class=\"banner__model\" [title]=\"'Realtime voice model: ' + ModelName\">\u00B7 {{ ModelName }}</span>\n }\n @if (ShowOpenSession) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenSession()\"\n title=\"Open the agent session record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open session</span>\n </button>\n }\n </div>\n\n @if (!HideState) {\n <div class=\"banner__state\" [class.banner__state--busy]=\"IsBusy(State)\">\n @if (IsBusy(State)) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n } @else {\n <div class=\"waveform\" [class.waveform--idle]=\"State !== 'speaking'\" aria-hidden=\"true\">\n <span></span><span></span><span></span><span></span>\n <span></span><span></span><span></span><span></span>\n </div>\n }\n <span class=\"banner__state-label\">{{ StateLabel(State) }}</span>\n </div>\n }\n\n <!-- Disclosure-gated app-bar action cluster: STATE + WINDOW-CHROME only. Call actions\n (Mute / Captions / Details / Type / End) live in the bottom dock \u2014 the single home for\n each control. Captions & End were removed from here (they were exact duplicates of the\n dock's), and the standalone \"pure audio\" headphones was folded into the gear's Density =\n Simple. What remains up here is non-duplicated chrome: the gear (density + dev links) and\n Minimize. -->\n <div class=\"bar-actions\">\n @if (ShowGear) {\n <button type=\"button\" class=\"iconb\" [class.iconb--on]=\"GearOpen || DevMode\"\n (click)=\"ToggleGear($event)\"\n title=\"Interface density & developer links\"\n [attr.aria-expanded]=\"GearOpen\">\n <i class=\"fa-solid fa-gear\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowMinimize) {\n <button type=\"button\" class=\"iconb\" (click)=\"MinimizeRequested.emit()\"\n title=\"Hide the call view \u2014 the call stays live\"\n aria-label=\"Minimize the call view\">\n <i class=\"fa-solid fa-down-left-and-up-right-to-center\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n\n <!-- Gear popover: interface density (the disclosure escape hatch) + developer links. -->\n @if (GearOpen) {\n <div class=\"gear-pop\" (click)=\"$event.stopPropagation()\" role=\"menu\" aria-label=\"Interface settings\">\n <div class=\"gp-h\">Interface</div>\n @if (ShowDensityPicker) {\n <div class=\"gp-row\">\n <span class=\"gp-l\">Density</span>\n <div class=\"gp-seg\" role=\"radiogroup\" aria-label=\"Interface density\">\n @for (d of Densities; track d.Key) {\n <button type=\"button\" [class.on]=\"Density === d.Key\"\n (click)=\"SelectDensity(d.Key)\"\n [attr.aria-checked]=\"Density === d.Key\" role=\"radio\">{{ d.Label }}</button>\n }\n </div>\n </div>\n <div class=\"gp-note\">Simple returns to the pure-audio surface. Auto grows the console as you use it.</div>\n }\n @if (ShowDensityPicker && AllowDevLinks) {\n <div class=\"gp-div\"></div>\n }\n @if (AllowDevLinks) {\n <button type=\"button\" class=\"gp-link\" (click)=\"ToggleDev()\" [attr.aria-pressed]=\"DevMode\">\n <i class=\"fa-solid\" [ngClass]=\"DevMode ? 'fa-toggle-on' : 'fa-toggle-off'\" aria-hidden=\"true\"></i>\n Developer links {{ DevMode ? 'on' : 'off' }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [":host {\n display: block;\n --sage: var(--mj-color-violet-400, #a78bfa);\n --sage-bg: color-mix(in srgb, var(--mj-color-violet-400, #a78bfa) 14%, transparent);\n --sage-border: color-mix(in srgb, var(--mj-color-violet-400, #a78bfa) 45%, transparent);\n}\n\n/* The UNIFIED APP-BAR (Redesign A): orb \u00B7 name \u00B7 Co-Agent pill \u00B7 \"speaking as\" \u00B7\n state pill \u00B7 disclosure-gated action cluster (captions / gear / minimize / End). */\n.banner {\n position: relative; /* anchors the gear popover */\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 16px 10px 22px;\n border-bottom: 1px solid var(--mj-border-default);\n background: linear-gradient(180deg, color-mix(in srgb, var(--mj-brand-primary) 10%, transparent), transparent);\n flex-shrink: 0;\n}\n\n.banner__id {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n white-space: nowrap;\n overflow: hidden;\n}\n.banner__name {\n font-size: 14.5px;\n font-weight: 700;\n letter-spacing: -0.01em;\n color: var(--mj-text-primary);\n flex-shrink: 0;\n}\n.banner__for {\n font-size: 11.5px;\n color: var(--mj-text-muted);\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-shrink: 5; /* gives way before the name/pill, after the model suffix */\n}\n.banner__for b {\n color: var(--mj-text-secondary);\n}\n/* Subtle realtime-model suffix (e.g. \"\u00B7 GPT Realtime 2\") in the identity line. */\n.banner__model {\n font-size: 11px;\n color: var(--mj-text-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 10; /* first to give way when the banner narrows */\n min-width: 0;\n}\n\n.banner__state {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 12px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n flex-shrink: 0;\n}\n.banner__state--busy {\n background: var(--mj-status-warning-bg);\n border-color: var(--mj-status-warning);\n}\n.banner__state--busy .fa-spinner {\n color: var(--mj-status-warning);\n}\n.banner__state-label {\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n.banner__state--busy .banner__state-label {\n color: var(--mj-status-warning-text, var(--mj-status-warning));\n}\n\n/* ---------- Glowing agent orb ---------- */\n.agent-orb {\n --orb-size: 34px;\n width: var(--orb-size);\n height: var(--orb-size);\n border-radius: 50%;\n position: relative;\n flex-shrink: 0;\n background: radial-gradient(circle at 35% 30%,\n var(--mj-brand-accent, var(--mj-brand-primary)),\n var(--mj-brand-primary) 60%,\n var(--mj-brand-primary-active, var(--mj-brand-primary)));\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-brand-primary) 12%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-brand-primary) 45%, transparent);\n}\n.agent-orb::after {\n content: \"\";\n position: absolute;\n inset: -4px;\n border-radius: 50%;\n border: 2px solid color-mix(in srgb, var(--mj-brand-accent, var(--mj-brand-primary)) 40%, transparent);\n animation: orb-ring 2.4s ease-out infinite;\n}\n.agent-orb[data-state=\"speaking\"] {\n animation: orb-bob 0.9s ease-in-out infinite;\n}\n.agent-orb[data-state=\"listening\"] {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-success) 16%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-status-success) 40%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-status-success) 60%, white), var(--mj-brand-primary) 65%);\n}\n.agent-orb[data-state=\"thinking\"] {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-warning) 14%, transparent),\n 0 0 26px color-mix(in srgb, var(--mj-status-warning) 35%, transparent);\n}\n\n@keyframes orb-ring { 0% { transform: scale(1); opacity: .6 } 100% { transform: scale(1.5); opacity: 0 } }\n@keyframes orb-bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }\n\n/* ---------- Audio-reactive mode ----------\n The overlay's rAF meter loop writes --voice-out / --voice-in + data attributes on\n .call-overlay; custom properties INHERIT into this component and :host-context()\n reaches the ancestor's attributes \u2014 so the app-bar orb rides the SAME live signal as\n the hero (scaled subtler at app-bar size). Un-metered sessions keep the keyframes. */\n:host-context(.call-overlay[data-audio-live='true']) .agent-orb:not(.agent-orb--review) {\n animation: none;\n transform: scale(calc(1 + var(--voice-out, 0) * 0.14));\n transition: transform 70ms linear;\n}\n:host-context(.call-overlay[data-audio-live='true']) .agent-orb:not(.agent-orb--review)::after {\n animation: none;\n opacity: calc(0.15 + var(--voice-out, 0) * 0.85);\n}\n:host-context(.call-overlay[data-audio-live='true'][data-voice-dir='user']) .agent-orb:not(.agent-orb--review) {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-success) 16%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-status-success) 40%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-status-success) 60%, white), var(--mj-brand-primary) 65%);\n}\n\n/* ---------- Voice activity waveform ---------- */\n.waveform {\n display: flex;\n align-items: center;\n gap: 3px;\n height: 18px;\n}\n.waveform span {\n width: 3px;\n border-radius: 3px;\n background: var(--mj-brand-primary);\n animation: wave 1.1s ease-in-out infinite;\n}\n.waveform span:nth-child(1) { height: 30%; animation-delay: 0s }\n.waveform span:nth-child(2) { height: 65%; animation-delay: .1s }\n.waveform span:nth-child(3) { height: 100%; animation-delay: .2s }\n.waveform span:nth-child(4) { height: 55%; animation-delay: .3s }\n.waveform span:nth-child(5) { height: 85%; animation-delay: .15s }\n.waveform span:nth-child(6) { height: 40%; animation-delay: .25s }\n.waveform span:nth-child(7) { height: 70%; animation-delay: .05s }\n.waveform span:nth-child(8) { height: 35%; animation-delay: .35s }\n.waveform--idle span {\n animation: none;\n height: 18% !important;\n background: var(--mj-text-disabled);\n}\n@keyframes wave { 0%, 100% { transform: scaleY(.4) } 50% { transform: scaleY(1) } }\n\n.pill {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px;\n border-radius: var(--mj-radius-full, 9999px);\n font-size: 11.5px;\n font-weight: 600;\n border: 1px solid transparent;\n line-height: 1.4;\n}\n.pill i { font-size: 10px; }\n.pill--sage {\n background: var(--sage-bg);\n color: var(--mj-color-violet-300, var(--mj-text-secondary));\n border-color: var(--sage-border);\n}\n\n/* ---------- Session review variant ---------- */\n.banner--review {\n background: linear-gradient(180deg, color-mix(in srgb, var(--mj-text-muted) 10%, transparent), transparent);\n}\n/* Static orb: no pulse ring, dimmed glow \u2014 the session is history, nothing is live. */\n.agent-orb--review {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--mj-text-muted) 12%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-text-muted) 55%, var(--mj-bg-surface)),\n var(--mj-text-muted) 65%);\n}\n.agent-orb--review::after {\n animation: none;\n border-color: color-mix(in srgb, var(--mj-text-muted) 30%, transparent);\n}\n.pill--review {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n color: var(--mj-text-link, var(--mj-brand-primary));\n border-color: color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n}\n.pill--close-reason {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n border-color: var(--mj-border-default);\n}\n.banner__range {\n flex-shrink: 3;\n}\n.banner__state--review {\n background: var(--mj-bg-surface-card);\n}\n.banner__state--review i {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n.banner__state-label--review {\n color: var(--mj-text-secondary);\n}\n\n/* Gear-gated developer link to the live agent session record */\n.dev-link {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 9px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px dashed var(--mj-border-strong);\n background: transparent;\n color: var(--mj-text-muted);\n font-family: inherit;\n font-size: 10.5px;\n font-weight: 700;\n white-space: nowrap;\n cursor: pointer;\n transition: color 140ms ease, border-color 140ms ease, background 140ms ease;\n}\n.dev-link:hover {\n color: var(--mj-text-link, var(--mj-brand-primary));\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n}\n.dev-link i {\n font-size: 9px;\n}\n\n/* ---------- App-bar action cluster (disclosure-gated; Redesign A) ---------- */\n.bar-actions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n.iconb {\n width: 34px;\n height: 34px;\n border-radius: var(--mj-radius-md, 8px);\n display: grid;\n place-items: center;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n font-size: 13px;\n transition: all 140ms ease;\n}\n.iconb:hover {\n color: var(--mj-text-primary);\n border-color: var(--mj-border-strong);\n background: var(--mj-bg-surface-hover);\n}\n.iconb--on {\n background: color-mix(in srgb, var(--mj-brand-primary) 16%, transparent);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n.bar-sep {\n width: 1px;\n height: 26px;\n background: var(--mj-border-default);\n}\n.end-pill {\n display: inline-flex;\n align-items: center;\n gap: 9px;\n padding: 8px 18px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n white-space: nowrap;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-status-error);\n background: var(--mj-status-error);\n color: var(--mj-text-inverse, #fff);\n cursor: pointer;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-status-error) 35%, transparent);\n transition: filter 140ms ease;\n}\n.end-pill:hover {\n filter: brightness(0.92);\n}\n.start-live-pill {\n display: inline-flex;\n align-items: center;\n gap: 9px;\n padding: 8px 18px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n white-space: nowrap;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-brand-primary);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n cursor: pointer;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n transition: filter 140ms ease;\n}\n.start-live-pill:hover {\n filter: brightness(1.05);\n}\n\n/* ---------- Gear popover: density escape hatch + developer links ---------- */\n.gear-pop {\n position: absolute;\n top: calc(100% + 8px);\n right: 14px;\n z-index: 70;\n width: 268px;\n border: 1px solid var(--mj-border-strong);\n border-radius: var(--mj-radius-lg, 12px);\n background: var(--mj-bg-surface-elevated);\n box-shadow: var(--mj-shadow-xl, 0 12px 32px rgba(0, 0, 0, 0.18));\n padding: 12px 14px 10px;\n animation: gear-pop-in 160ms ease;\n}\n@keyframes gear-pop-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.gp-h {\n font-size: 10.5px;\n font-weight: 800;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--mj-text-muted);\n margin-bottom: 9px;\n}\n.gp-row {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.gp-l {\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n.gp-seg {\n display: inline-flex;\n flex: 1;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n padding: 2px;\n gap: 2px;\n}\n.gp-seg button {\n flex: 1;\n border: 0;\n background: transparent;\n color: var(--mj-text-muted);\n font-family: inherit;\n font-size: 11px;\n font-weight: 700;\n padding: 4px 0;\n border-radius: 6px;\n cursor: pointer;\n transition: all 120ms ease;\n}\n.gp-seg button.on {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n}\n.gp-note {\n font-size: 10.5px;\n color: var(--mj-text-muted);\n line-height: 1.45;\n margin-top: 8px;\n}\n.gp-div {\n height: 1px;\n background: var(--mj-border-default);\n margin: 10px -14px;\n}\n.gp-link {\n display: flex;\n width: 100%;\n align-items: center;\n gap: 9px;\n padding: 6px 2px;\n border: 0;\n background: transparent;\n color: var(--mj-text-secondary);\n font-family: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n text-align: left;\n}\n.gp-link:hover {\n color: var(--mj-text-primary);\n}\n.gp-link i {\n width: 16px;\n text-align: center;\n font-size: 13px;\n color: var(--mj-text-muted);\n}\n.gp-link:hover i {\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n\n/* ============================================================= COMPACT (Calm Orb \u00B7 overlay)\n A tiny identity + state row only \u2014 the body owns the big orb + name + state, and the lean\n dock owns the actions. No duplicate orb / state pill / headphones / gear / expand here. */\n.banner--compact {\n gap: 10px;\n padding: 12px 14px;\n background: transparent;\n border-bottom: none;\n}\n.banner__id--compact {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 9px;\n overflow: hidden;\n}\n.banner__avatar {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: grid;\n place-items: center;\n font-size: 11px;\n font-weight: 800;\n color: var(--mj-text-inverse);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-brand-primary) 60%, white), var(--mj-brand-primary) 65%);\n}\n.banner__name--compact {\n font-size: 13px;\n font-weight: 700;\n letter-spacing: -0.01em;\n color: var(--mj-text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.banner__state-chip {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n gap: 7px;\n padding: 4px 10px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n font-size: 11.5px;\n font-weight: 600;\n color: var(--mj-text-muted);\n}\n.banner__state-chip-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 130px;\n}\n.banner__state-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--mj-status-success);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-status-success) 70%, transparent);\n}\n.banner__state-dot[data-state=\"speaking\"] {\n background: var(--mj-brand-primary);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-brand-primary) 70%, transparent);\n animation: compact-dot-blink 0.9s infinite;\n}\n.banner__state-dot[data-state=\"thinking\"] {\n background: var(--mj-status-warning);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-status-warning) 70%, transparent);\n}\n@keyframes compact-dot-blink { 50% { opacity: 0.35; } }\n/* Minimize is the only control left in the compact bar \u2014 render it round + de-emphasized. */\n.banner__minimize--compact {\n flex-shrink: 0;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n background: transparent;\n border-color: transparent;\n color: var(--mj-text-muted);\n}\n.banner__minimize--compact:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-border-default);\n}\n"] }]
|
|
530
|
+
args: [{ standalone: true, selector: 'mj-realtime-agent-banner', imports: [CommonModule], template: "<div class=\"banner\" [class.banner--review]=\"ReviewMode\" [class.banner--compact]=\"Compact && !ReviewMode\">\n @if (ReviewMode) {\n <!-- SESSION REVIEW: static orb \u00B7 name \u00B7 review badge \u00B7 started\u2192closed \u00B7 close-reason chip,\n with the review's exit actions up here in the header bar (Start live leads, Close trails). -->\n <div class=\"agent-orb agent-orb--review\" aria-hidden=\"true\"></div>\n\n <div class=\"banner__id\">\n <span class=\"banner__name\">Voice for {{ AgentName }}</span>\n <span class=\"pill pill--review\"><i class=\"fa-solid fa-clock-rotate-left\" aria-hidden=\"true\"></i> Session review</span>\n @if (ReviewRangeLabel) {\n <span class=\"banner__for banner__range\">{{ ReviewRangeLabel }}</span>\n }\n @if (ReviewCloseReasonLabel) {\n <span class=\"pill pill--close-reason\" [title]=\"'Close reason: ' + ReviewCloseReason\">{{ ReviewCloseReasonLabel }}</span>\n }\n @if (ShowOpenSession) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenSession()\"\n title=\"Open the agent session record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open session</span>\n </button>\n }\n </div>\n\n <div class=\"banner__state banner__state--review\">\n <i class=\"fa-solid fa-box-archive\" aria-hidden=\"true\"></i>\n <span class=\"banner__state-label banner__state-label--review\">Reviewing past session</span>\n </div>\n\n <div class=\"bar-actions\">\n @if (ShowStartLive) {\n <button type=\"button\" class=\"start-live-pill\" (click)=\"StartLiveRequested.emit()\"\n title=\"Resume this session as a new live call\">\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n <span>Resume session</span>\n </button>\n }\n <button type=\"button\" class=\"iconb\" (click)=\"CloseRequested.emit()\"\n title=\"Close review\" aria-label=\"Close session review\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n } @else if (Compact) {\n <!-- COMPACT (Calm Orb \u00B7 overlay): a tiny identity + state row only. No duplicate orb,\n no state pill, no headphones / gear / expand \u2014 the body shows the big orb + name +\n state, and the lean dock owns the actions. Minimize stays reachable here. -->\n <div class=\"banner__id banner__id--compact\">\n <span class=\"banner__avatar\" aria-hidden=\"true\">{{ AgentName.charAt(0) }}</span>\n <span class=\"banner__name banner__name--compact\">{{ AgentName }}</span>\n @if (!HideState) {\n <span class=\"banner__state-chip\">\n @if (IsBusy(State)) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n } @else {\n <span class=\"banner__state-dot\" [attr.data-state]=\"OrbState(State)\" aria-hidden=\"true\"></span>\n }\n <span class=\"banner__state-chip-label\">{{ StateLabel(State) }}</span>\n </span>\n }\n </div>\n\n @if (ShowMinimize) {\n <button type=\"button\" class=\"iconb banner__minimize--compact\" (click)=\"MinimizeRequested.emit()\"\n title=\"Hide the call view \u2014 the call stays live\"\n aria-label=\"Minimize the call view\">\n <i class=\"fa-solid fa-minus\" aria-hidden=\"true\"></i>\n </button>\n }\n } @else {\n <div class=\"agent-orb\" [attr.data-state]=\"OrbState(State)\" aria-hidden=\"true\"></div>\n\n <div class=\"banner__id\">\n <span class=\"banner__name\">Voice for {{ AgentName }}</span>\n <span class=\"pill pill--sage\"><i class=\"fa-solid fa-feather\" aria-hidden=\"true\"></i> Co-Agent</span>\n @if (!HideState) {\n <span class=\"banner__for\">speaking as <b>{{ AgentName }}</b></span>\n }\n @if (ModelName) {\n <span class=\"banner__model\" [title]=\"'Realtime voice model: ' + ModelName\">\u00B7 {{ ModelName }}</span>\n }\n @if (ShowOpenSession) {\n <button type=\"button\" class=\"dev-link\" (click)=\"OpenSession()\"\n title=\"Open the agent session record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>Open session</span>\n </button>\n }\n </div>\n\n @if (!HideState) {\n <div class=\"banner__state\" [class.banner__state--busy]=\"IsBusy(State)\">\n @if (IsBusy(State)) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n } @else {\n <div class=\"waveform\" [class.waveform--idle]=\"State !== 'speaking'\" aria-hidden=\"true\">\n <span></span><span></span><span></span><span></span>\n <span></span><span></span><span></span><span></span>\n </div>\n }\n <span class=\"banner__state-label\">{{ StateLabel(State) }}</span>\n </div>\n }\n\n <!-- Disclosure-gated app-bar action cluster: STATE + WINDOW-CHROME only. Call actions\n (Mute / Captions / Details / Type / End) live in the bottom dock \u2014 the single home for\n each control. Captions & End were removed from here (they were exact duplicates of the\n dock's), and the standalone \"pure audio\" headphones was folded into the gear's Density =\n Simple. What remains up here is non-duplicated chrome: the gear (density + dev links) and\n Minimize. -->\n <div class=\"bar-actions\">\n @if (ShowGear) {\n <button type=\"button\" class=\"iconb\" [class.iconb--on]=\"GearOpen || DevMode\"\n (click)=\"ToggleGear($event)\"\n title=\"Interface density & developer links\"\n [attr.aria-expanded]=\"GearOpen\">\n <i class=\"fa-solid fa-gear\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowMinimize) {\n <button type=\"button\" class=\"iconb\" (click)=\"MinimizeRequested.emit()\"\n title=\"Hide the call view \u2014 the call stays live\"\n aria-label=\"Minimize the call view\">\n <i class=\"fa-solid fa-down-left-and-up-right-to-center\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n\n <!-- Gear popover: interface density (the disclosure escape hatch) + developer links. -->\n @if (GearOpen) {\n <div class=\"gear-pop\" (click)=\"$event.stopPropagation()\" role=\"menu\" aria-label=\"Interface settings\">\n <div class=\"gp-h\">Interface</div>\n @if (ShowDensityPicker) {\n <div class=\"gp-row\">\n <span class=\"gp-l\">Density</span>\n <div class=\"gp-seg\" role=\"radiogroup\" aria-label=\"Interface density\">\n @for (d of Densities; track d.Key) {\n <button type=\"button\" [class.on]=\"Density === d.Key\"\n (click)=\"SelectDensity(d.Key)\"\n [attr.aria-checked]=\"Density === d.Key\" role=\"radio\">{{ d.Label }}</button>\n }\n </div>\n </div>\n <div class=\"gp-note\">Simple returns to the pure-audio surface. Auto grows the console as you use it.</div>\n }\n @if (ShowDensityPicker && AllowDevLinks) {\n <div class=\"gp-div\"></div>\n }\n @if (AllowDevLinks) {\n <button type=\"button\" class=\"gp-link\" (click)=\"ToggleDev()\" [attr.aria-pressed]=\"DevMode\">\n <i class=\"fa-solid\" [ngClass]=\"DevMode ? 'fa-toggle-on' : 'fa-toggle-off'\" aria-hidden=\"true\"></i>\n Developer links {{ DevMode ? 'on' : 'off' }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [":host {\n display: block;\n --sage: var(--mj-color-violet-400, #a78bfa);\n --sage-bg: color-mix(in srgb, var(--mj-color-violet-400, #a78bfa) 14%, transparent);\n --sage-border: color-mix(in srgb, var(--mj-color-violet-400, #a78bfa) 45%, transparent);\n}\n\n/* The UNIFIED APP-BAR (Redesign A): orb \u00B7 name \u00B7 Co-Agent pill \u00B7 \"speaking as\" \u00B7\n state pill \u00B7 disclosure-gated action cluster (captions / gear / minimize / End). */\n.banner {\n position: relative; /* anchors the gear popover */\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 16px 10px 22px;\n border-bottom: 1px solid var(--mj-border-default);\n background: linear-gradient(180deg, color-mix(in srgb, var(--mj-brand-primary) 10%, transparent), transparent);\n flex-shrink: 0;\n}\n\n.banner__id {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n white-space: nowrap;\n overflow: hidden;\n}\n.banner__name {\n font-size: 14.5px;\n font-weight: 700;\n letter-spacing: -0.01em;\n color: var(--mj-text-primary);\n flex-shrink: 0;\n}\n.banner__for {\n font-size: 11.5px;\n color: var(--mj-text-muted);\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-shrink: 5; /* gives way before the name/pill, after the model suffix */\n}\n.banner__for b {\n color: var(--mj-text-secondary);\n}\n/* Subtle realtime-model suffix (e.g. \"\u00B7 GPT Realtime 2\") in the identity line. */\n.banner__model {\n font-size: 11px;\n color: var(--mj-text-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 10; /* first to give way when the banner narrows */\n min-width: 0;\n}\n\n.banner__state {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 12px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n flex-shrink: 0;\n}\n.banner__state--busy {\n background: var(--mj-status-warning-bg);\n border-color: var(--mj-status-warning);\n}\n.banner__state--busy .fa-spinner {\n color: var(--mj-status-warning);\n}\n.banner__state-label {\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n.banner__state--busy .banner__state-label {\n color: var(--mj-status-warning-text, var(--mj-status-warning));\n}\n\n/* ---------- Glowing agent orb ---------- */\n.agent-orb {\n --orb-size: 34px;\n width: var(--orb-size);\n height: var(--orb-size);\n border-radius: 50%;\n position: relative;\n flex-shrink: 0;\n background: radial-gradient(circle at 35% 30%,\n var(--mj-brand-accent, var(--mj-brand-primary)),\n var(--mj-brand-primary) 60%,\n var(--mj-brand-primary-active, var(--mj-brand-primary)));\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-brand-primary) 12%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-brand-primary) 45%, transparent);\n}\n.agent-orb::after {\n content: \"\";\n position: absolute;\n inset: -4px;\n border-radius: 50%;\n border: 2px solid color-mix(in srgb, var(--mj-brand-accent, var(--mj-brand-primary)) 40%, transparent);\n animation: orb-ring 2.4s ease-out infinite;\n}\n.agent-orb[data-state=\"speaking\"] {\n animation: orb-bob 0.9s ease-in-out infinite;\n}\n.agent-orb[data-state=\"listening\"] {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-success) 16%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-status-success) 40%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-status-success) 60%, white), var(--mj-brand-primary) 65%);\n}\n.agent-orb[data-state=\"thinking\"] {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-warning) 14%, transparent),\n 0 0 26px color-mix(in srgb, var(--mj-status-warning) 35%, transparent);\n}\n\n@keyframes orb-ring { 0% { transform: scale(1); opacity: .6 } 100% { transform: scale(1.5); opacity: 0 } }\n@keyframes orb-bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }\n\n/* ---------- Audio-reactive mode ----------\n The overlay's rAF meter loop writes --voice-out / --voice-in + data attributes on\n .call-overlay; custom properties INHERIT into this component and :host-context()\n reaches the ancestor's attributes \u2014 so the app-bar orb rides the SAME live signal as\n the hero (scaled subtler at app-bar size). Un-metered sessions keep the keyframes. */\n:host-context(.call-overlay[data-audio-live='true']) .agent-orb:not(.agent-orb--review) {\n animation: none;\n transform: scale(calc(1 + var(--voice-out, 0) * 0.14));\n transition: transform 70ms linear;\n}\n:host-context(.call-overlay[data-audio-live='true']) .agent-orb:not(.agent-orb--review)::after {\n animation: none;\n opacity: calc(0.15 + var(--voice-out, 0) * 0.85);\n}\n:host-context(.call-overlay[data-audio-live='true'][data-voice-dir='user']) .agent-orb:not(.agent-orb--review) {\n box-shadow:\n 0 0 0 6px color-mix(in srgb, var(--mj-status-success) 16%, transparent),\n 0 0 30px color-mix(in srgb, var(--mj-status-success) 40%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-status-success) 60%, white), var(--mj-brand-primary) 65%);\n}\n\n/* ---------- Voice activity waveform ---------- */\n.waveform {\n display: flex;\n align-items: center;\n gap: 3px;\n height: 18px;\n}\n.waveform span {\n width: 3px;\n border-radius: 3px;\n background: var(--mj-brand-primary);\n animation: wave 1.1s ease-in-out infinite;\n}\n.waveform span:nth-child(1) { height: 30%; animation-delay: 0s }\n.waveform span:nth-child(2) { height: 65%; animation-delay: .1s }\n.waveform span:nth-child(3) { height: 100%; animation-delay: .2s }\n.waveform span:nth-child(4) { height: 55%; animation-delay: .3s }\n.waveform span:nth-child(5) { height: 85%; animation-delay: .15s }\n.waveform span:nth-child(6) { height: 40%; animation-delay: .25s }\n.waveform span:nth-child(7) { height: 70%; animation-delay: .05s }\n.waveform span:nth-child(8) { height: 35%; animation-delay: .35s }\n.waveform--idle span {\n animation: none;\n height: 18% !important;\n background: var(--mj-text-disabled);\n}\n@keyframes wave { 0%, 100% { transform: scaleY(.4) } 50% { transform: scaleY(1) } }\n\n.pill {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px;\n border-radius: var(--mj-radius-full, 9999px);\n font-size: 11.5px;\n font-weight: 600;\n border: 1px solid transparent;\n line-height: 1.4;\n}\n.pill i { font-size: 10px; }\n.pill--sage {\n background: var(--sage-bg);\n color: var(--mj-color-violet-300, var(--mj-text-secondary));\n border-color: var(--sage-border);\n}\n\n/* ---------- Session review variant ---------- */\n.banner--review {\n background: linear-gradient(180deg, color-mix(in srgb, var(--mj-text-muted) 10%, transparent), transparent);\n}\n/* Static orb: no pulse ring, dimmed glow \u2014 the session is history, nothing is live. */\n.agent-orb--review {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--mj-text-muted) 12%, transparent);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-text-muted) 55%, var(--mj-bg-surface)),\n var(--mj-text-muted) 65%);\n}\n.agent-orb--review::after {\n animation: none;\n border-color: color-mix(in srgb, var(--mj-text-muted) 30%, transparent);\n}\n.pill--review {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n color: var(--mj-text-link, var(--mj-brand-primary));\n border-color: color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n}\n.pill--close-reason {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n border-color: var(--mj-border-default);\n}\n.banner__range {\n flex-shrink: 3;\n}\n.banner__state--review {\n background: var(--mj-bg-surface-card);\n}\n.banner__state--review i {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n.banner__state-label--review {\n color: var(--mj-text-secondary);\n}\n\n/* Gear-gated developer link to the live agent session record */\n.dev-link {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 3px 9px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px dashed var(--mj-border-strong);\n background: transparent;\n color: var(--mj-text-muted);\n font-family: inherit;\n font-size: 10.5px;\n font-weight: 700;\n white-space: nowrap;\n cursor: pointer;\n transition: color 140ms ease, border-color 140ms ease, background 140ms ease;\n}\n.dev-link:hover {\n color: var(--mj-text-link, var(--mj-brand-primary));\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n}\n.dev-link i {\n font-size: 9px;\n}\n\n/* ---------- App-bar action cluster (disclosure-gated; Redesign A) ---------- */\n.bar-actions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n.iconb {\n width: 34px;\n height: 34px;\n border-radius: var(--mj-radius-md, 8px);\n display: grid;\n place-items: center;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n font-size: 13px;\n transition: all 140ms ease;\n}\n.iconb:hover {\n color: var(--mj-text-primary);\n border-color: var(--mj-border-strong);\n background: var(--mj-bg-surface-hover);\n}\n.iconb--on {\n background: color-mix(in srgb, var(--mj-brand-primary) 16%, transparent);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n.bar-sep {\n width: 1px;\n height: 26px;\n background: var(--mj-border-default);\n}\n.end-pill {\n display: inline-flex;\n align-items: center;\n gap: 9px;\n padding: 8px 18px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n white-space: nowrap;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-status-error);\n background: var(--mj-status-error);\n color: var(--mj-text-inverse, #fff);\n cursor: pointer;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-status-error) 35%, transparent);\n transition: filter 140ms ease;\n}\n.end-pill:hover {\n filter: brightness(0.92);\n}\n.start-live-pill {\n display: inline-flex;\n align-items: center;\n gap: 9px;\n padding: 8px 18px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n white-space: nowrap;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-brand-primary);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n cursor: pointer;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-brand-primary) 35%, transparent);\n transition: filter 140ms ease;\n}\n.start-live-pill:hover {\n filter: brightness(1.05);\n}\n\n/* ---------- Gear popover: density escape hatch + developer links ---------- */\n.gear-pop {\n position: absolute;\n top: calc(100% + 8px);\n right: 14px;\n z-index: 70;\n width: 268px;\n border: 1px solid var(--mj-border-strong);\n border-radius: var(--mj-radius-lg, 12px);\n background: var(--mj-bg-surface-elevated);\n box-shadow: var(--mj-shadow-xl, 0 12px 32px rgba(0, 0, 0, 0.18));\n padding: 12px 14px 10px;\n animation: gear-pop-in 160ms ease;\n}\n@keyframes gear-pop-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.gp-h {\n font-size: 10.5px;\n font-weight: 800;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--mj-text-muted);\n margin-bottom: 9px;\n}\n.gp-row {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.gp-l {\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n.gp-seg {\n display: inline-flex;\n flex: 1;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n padding: 2px;\n gap: 2px;\n}\n.gp-seg button {\n flex: 1;\n border: 0;\n background: transparent;\n color: var(--mj-text-muted);\n font-family: inherit;\n font-size: 11px;\n font-weight: 700;\n padding: 4px 0;\n border-radius: 6px;\n cursor: pointer;\n transition: all 120ms ease;\n}\n.gp-seg button.on {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n}\n.gp-note {\n font-size: 10.5px;\n color: var(--mj-text-muted);\n line-height: 1.45;\n margin-top: 8px;\n}\n.gp-div {\n height: 1px;\n background: var(--mj-border-default);\n margin: 10px -14px;\n}\n.gp-link {\n display: flex;\n width: 100%;\n align-items: center;\n gap: 9px;\n padding: 6px 2px;\n border: 0;\n background: transparent;\n color: var(--mj-text-secondary);\n font-family: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n text-align: left;\n}\n.gp-link:hover {\n color: var(--mj-text-primary);\n}\n.gp-link i {\n width: 16px;\n text-align: center;\n font-size: 13px;\n color: var(--mj-text-muted);\n}\n.gp-link:hover i {\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n\n/* ============================================================= COMPACT (Calm Orb \u00B7 overlay)\n A tiny identity + state row only \u2014 the body owns the big orb + name + state, and the lean\n dock owns the actions. No duplicate orb / state pill / headphones / gear / expand here. */\n.banner--compact {\n gap: 10px;\n padding: 12px 14px;\n background: transparent;\n border-bottom: none;\n}\n.banner__id--compact {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 9px;\n overflow: hidden;\n}\n.banner__avatar {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: grid;\n place-items: center;\n font-size: 11px;\n font-weight: 800;\n color: var(--mj-text-inverse);\n background: radial-gradient(circle at 35% 30%,\n color-mix(in srgb, var(--mj-brand-primary) 60%, white), var(--mj-brand-primary) 65%);\n}\n.banner__name--compact {\n font-size: 13px;\n font-weight: 700;\n letter-spacing: -0.01em;\n color: var(--mj-text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.banner__state-chip {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n gap: 7px;\n padding: 4px 10px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n font-size: 11.5px;\n font-weight: 600;\n color: var(--mj-text-muted);\n}\n.banner__state-chip-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 130px;\n}\n.banner__state-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--mj-status-success);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-status-success) 70%, transparent);\n}\n.banner__state-dot[data-state=\"speaking\"] {\n background: var(--mj-brand-primary);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-brand-primary) 70%, transparent);\n animation: compact-dot-blink 0.9s infinite;\n}\n.banner__state-dot[data-state=\"thinking\"] {\n background: var(--mj-status-warning);\n box-shadow: 0 0 8px color-mix(in srgb, var(--mj-status-warning) 70%, transparent);\n}\n@keyframes compact-dot-blink { 50% { opacity: 0.35; } }\n/* Minimize is the only control left in the compact bar \u2014 render it round + de-emphasized. */\n.banner__minimize--compact {\n flex-shrink: 0;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n background: transparent;\n border-color: transparent;\n color: var(--mj-text-muted);\n}\n.banner__minimize--compact:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-border-default);\n}\n"] }]
|
|
531
531
|
}], null, { State: [{
|
|
532
532
|
type: Input,
|
|
533
533
|
args: [{ required: true }]
|