@memberjunction/ng-conversations 6.2.1 → 6.2.3

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.
@@ -64,7 +64,9 @@ function RealtimeComposerComponent_Conditional_0_Conditional_3_Template(rf, ctx)
64
64
  } if (rf & 2) {
65
65
  const ctx_r1 = i0.ɵɵnextContext(2);
66
66
  i0.ɵɵclassProp("lean-more--open", ctx_r1.MoreOpen);
67
- i0.ɵɵadvance(2);
67
+ i0.ɵɵadvance();
68
+ i0.ɵɵattribute("inert", ctx_r1.MoreOpen ? null : "");
69
+ i0.ɵɵadvance();
68
70
  i0.ɵɵconditional(ctx_r1.ShowCamera && !ctx_r1.CameraOn || ctx_r1.ShowShare && !ctx_r1.Sharing ? 2 : -1);
69
71
  i0.ɵɵadvance();
70
72
  i0.ɵɵconditional(ctx_r1.ShowDetails ? 3 : -1);
@@ -87,7 +89,7 @@ function RealtimeComposerComponent_Conditional_0_Template(rf, ctx) { if (rf & 1)
87
89
  i0.ɵɵlistener("MicrophoneToggled", function RealtimeComposerComponent_Conditional_0_Template_mj_media_controls_MicrophoneToggled_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ToggleMute()); })("CameraToggled", function RealtimeComposerComponent_Conditional_0_Template_mj_media_controls_CameraToggled_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.CameraToggled.emit($event)); })("ShareRequested", function RealtimeComposerComponent_Conditional_0_Template_mj_media_controls_ShareRequested_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ShareRequested.emit($event)); })("StopShareRequested", function RealtimeComposerComponent_Conditional_0_Template_mj_media_controls_StopShareRequested_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.StopShareRequested.emit()); })("DeviceSelected", function RealtimeComposerComponent_Conditional_0_Template_mj_media_controls_DeviceSelected_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.DeviceSelected.emit($event)); });
88
90
  i0.ɵɵelementEnd();
89
91
  i0.ɵɵconditionalCreate(2, RealtimeComposerComponent_Conditional_0_Conditional_2_Template, 2, 3, "button", 5);
90
- i0.ɵɵconditionalCreate(3, RealtimeComposerComponent_Conditional_0_Conditional_3_Template, 7, 7, "div", 6);
92
+ i0.ɵɵconditionalCreate(3, RealtimeComposerComponent_Conditional_0_Conditional_3_Template, 7, 8, "div", 6);
91
93
  i0.ɵɵconditionalCreate(4, RealtimeComposerComponent_Conditional_0_Conditional_4_Template, 2, 0, "button", 7);
92
94
  i0.ɵɵelementEnd();
93
95
  } if (rf & 2) {
@@ -467,7 +469,7 @@ export class RealtimeComposerComponent {
467
469
  }
468
470
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RealtimeComposerComponent, [{
469
471
  type: Component,
470
- args: [{ standalone: true, selector: 'mj-realtime-composer', imports: [CommonModule, FormsModule, MJButtonDirective, MediaControlsComponent], template: "@if (StripMode && Compact) {\n <!-- COMPACT / ORB (Calm Orb \u00B7 overlay): the lean dock \u2014 primary bar keeps only the microphone,\n Captions, active Camera/Share (while on), a \"\u2022\u2022\u2022\" that blooms a small sheet with secondary\n actions (inactive Camera/Share, Details, Type), and a red End. Circles from the design system. -->\n <div class=\"dock-lean\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"lean__media\"\n Size=\"lg\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera && CameraOn\"\n [ShowShare]=\"ShowShare && Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n <!-- Captions: first-class in the lean dock (the overlay's only text toggle now). -->\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n\n @if (HasMoreItems) {\n <div class=\"lean-more\" [class.lean-more--open]=\"MoreOpen\">\n <div class=\"lean-sheet\" (click)=\"$event.stopPropagation()\" role=\"group\" aria-label=\"More call controls\">\n @if ((ShowCamera && !CameraOn) || (ShowShare && !Sharing)) {\n <mj-media-controls class=\"lean-sheet__media\"\n Size=\"md\"\n [ShowMicrophone]=\"false\"\n [ShowCamera]=\"ShowCamera && !CameraOn\"\n [ShowShare]=\"ShowShare && !Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n (CameraToggled)=\"CameraToggled.emit($event); MoreOpen = false\"\n (ShareRequested)=\"ShareRequested.emit($event); MoreOpen = false\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n }\n @if (ShowDetails) {\n <button type=\"button\" class=\"lean-sheet__btn\" [class.lean-sheet__btn--on]=\"DetailsOn\"\n (click)=\"DetailsToggled.emit(); MoreOpen = false\"\n [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n [attr.aria-pressed]=\"DetailsOn\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n <small>Details</small>\n </button>\n }\n @if (AllowTyping) {\n <button type=\"button\" class=\"lean-sheet__btn\"\n (click)=\"OpenChanged.emit(true); MoreOpen = false\"\n title=\"Type into the live session\" aria-label=\"Open the typed-input composer\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n <small>Type</small>\n </button>\n }\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" [Variant]=\"MoreOpen ? 'primary' : 'secondary'\"\n AriaLabel=\"More call controls\" title=\"More controls\"\n [attr.aria-expanded]=\"MoreOpen\"\n (click)=\"ToggleMore($event)\">\n <i class=\"fa-solid fa-ellipsis\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n} @else if (StripMode) {\n <!-- Levels 0\u20131: phone-call strip \u2014 big labelled circles: the call's media controls (the microphone with its device\n chevron, and the camera and Share when the call offers them), Captions (level 1+, arriving WITH the text it\n controls), the Details peek at the surface panels, Type, and End call, the deliberate rightmost action. -->\n <div class=\"strip\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"strip__media\"\n Size=\"lg\"\n [ShowLabels]=\"true\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n @if (ShowCaptionsControl) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Captions</span>\n </div>\n }\n\n @if (ShowDetails) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Details</span>\n </div>\n }\n\n @if (AllowTyping) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\"\n AriaLabel=\"Open the typed-input composer\" title=\"Type into the live session\"\n (click)=\"OpenChanged.emit(true)\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Type</span>\n </div>\n }\n\n @if (ShowEnd) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label ctrl-label--end\" aria-hidden=\"true\">End call</span>\n </div>\n }\n </div>\n} @else {\n <!-- Level 2+: the fused dock \u2014 small circles and the in-call composer in ONE bottom bar. -->\n <div class=\"dock\">\n <div class=\"dock__minis\">\n <!-- No Share arrow and no device chevron in the dock, which is short of room: the browser's picker still offers\n every kind of surface, and Hide brings back the strip, which has the device menu. -->\n <mj-media-controls Size=\"sm\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [ShowShareMenu]=\"false\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [CameraOptional]=\"true\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowDetails) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Show the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <div class=\"dock__box\">\n <textarea\n #dockInput\n class=\"dock__input\"\n rows=\"1\"\n placeholder=\"Type into the live session \u2014 joins this same voice call\u2026\"\n [(ngModel)]=\"Draft\"\n (keydown)=\"OnKeydown($event)\"\n (input)=\"AutoResize()\"\n aria-label=\"Type a message into the live voice session\"></textarea>\n <span class=\"dock__hint\" aria-hidden=\"true\">\u21B5 send</span>\n <button\n class=\"dock__send\"\n type=\"button\"\n [disabled]=\"!CanSend\"\n (click)=\"Send()\"\n title=\"Send into live session\"\n aria-label=\"Send\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" class=\"dock__hide\"\n AriaLabel=\"Close the typed-input composer\" title=\"Hide typing \u2014 back to the voice controls\"\n (click)=\"OpenChanged.emit(false)\">\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n}\n", styles: [":host {\n display: block;\n /* The fused dock reflows by its own width, not the window's (the call column narrows when the panel opens). */\n container-type: inline-size;\n}\n\n/* ---------- Levels 0\u20131: phone-call strip (big round controls, centered) ---------- */\n.strip {\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n gap: 22px;\n padding: 20px 22px;\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.ctrl-group {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n\n/* Matches mj-media-controls' own labels, so every control in the strip is named alike. */\n.ctrl-label {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n text-align: center;\n margin-top: var(--mj-space-1-5);\n font-weight: 500;\n}\n\n/* The call's media controls sit in the strip like its other groups. */\n.strip__media {\n align-items: flex-start;\n gap: 22px;\n}\n\n/* A narrow strip tightens its gaps, then wraps onto a second row, rather than cutting off its first and last controls. */\n@container (max-width: 600px) {\n .strip,\n .strip__media {\n gap: 12px;\n }\n}\n@container (max-width: 480px) {\n .strip {\n flex-wrap: wrap;\n row-gap: 12px;\n }\n}\n.ctrl-label--end {\n color: var(--mj-status-error);\n}\n\n/* ---------- Level 2+: the fused dock (minis + composer in one bar) ---------- */\n.dock {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 18px;\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n animation: dock-in 320ms cubic-bezier(0.2, 0.8, 0.3, 1);\n}\n@keyframes dock-in {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n.dock__minis {\n display: flex;\n gap: 7px;\n flex-shrink: 0;\n}\n\n/* min-width: 0 lets the box (and its text) give way to the controls on a narrow dock instead of pushing End out. */\n.dock__box {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: flex-end;\n gap: 9px;\n padding: 5px 6px 5px 14px;\n border: 1px solid var(--mj-border-strong);\n border-radius: 20px;\n background: var(--mj-bg-surface-card);\n transition: border-color 140ms ease, box-shadow 140ms ease, border-radius 140ms ease;\n}\n/* On a narrow dock the text box takes a row of its own under the controls, so neither is squeezed. */\n@container (max-width: 520px) {\n .dock {\n flex-wrap: wrap;\n row-gap: 8px;\n }\n .dock__box {\n order: 1;\n flex-basis: 100%;\n }\n}\n\n.dock__box:focus-within {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n\n.dock__input {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: 0;\n outline: none;\n color: var(--mj-text-primary);\n font-family: inherit;\n font-size: 13.5px;\n line-height: 1.45;\n resize: none;\n height: 24px;\n max-height: 140px;\n overflow-y: auto;\n padding: 3px 0 4px 0;\n scrollbar-width: thin;\n scrollbar-color: var(--mj-border-strong) transparent;\n}\n.dock__input::placeholder {\n color: var(--mj-text-muted);\n}\n\n.dock__hint {\n font-size: 10.5px;\n font-weight: 600;\n color: var(--mj-text-disabled);\n white-space: nowrap;\n}\n\n.dock__send {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n border: 0;\n display: grid;\n place-items: center;\n cursor: pointer;\n font-size: 12px;\n flex-shrink: 0;\n transition: background 150ms ease;\n}\n.dock__send:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n}\n.dock__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n\n\n/* ============================================================= COMPACT (Calm Orb \u00B7 overlay)\n The lean dock \u2014 a \"\u2022\u2022\u2022\" that blooms a small sheet (Details / Type), Captions, the microphone and a red End.\n Design-system circles. No 5-button bar, no overlapping hint. */\n.dock-lean {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 14px;\n row-gap: 10px;\n padding: 16px 18px 20px;\n background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--mj-bg-page) 35%, transparent));\n}\n\n/* A narrow lean dock (the call column is at least 420px wide) tightens its gaps, so the microphone's device chevron and\n the Share arrow fit beside the other controls; where even that is not enough (larger touch targets), it wraps onto a\n second row rather than cutting off its first and last controls. */\n@container (max-width: 490px) {\n .dock-lean {\n gap: 6px;\n row-gap: 10px;\n padding-inline: 12px;\n }\n .lean__media {\n gap: 4px;\n }\n}\n\n\n/* The \"\u2022\u2022\u2022\" overflow + its blooming sheet. */\n.lean-more {\n position: relative;\n display: flex;\n align-items: center;\n}\n.lean-sheet {\n position: absolute;\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translateX(-50%) translateY(8px);\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px;\n border-radius: var(--mj-radius-lg, 16px);\n background: var(--mj-bg-surface-elevated);\n border: 1px solid var(--mj-border-default);\n box-shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.6);\n opacity: 0;\n pointer-events: none;\n transition: opacity 200ms ease, transform 200ms ease;\n z-index: 5;\n}\n.lean-sheet__media {\n align-items: center;\n gap: 8px;\n}\n.lean-more--open .lean-sheet {\n opacity: 1;\n pointer-events: auto;\n transform: translateX(-50%) translateY(0);\n}\n.lean-sheet__btn {\n display: grid;\n place-items: center;\n gap: 3px;\n width: 56px;\n padding: 8px 4px;\n border-radius: var(--mj-radius-md, 10px);\n border: 1px solid transparent;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n font-size: 16px;\n transition: all 140ms ease;\n}\n.lean-sheet__btn:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n.lean-sheet__btn--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.lean-sheet__btn small {\n font-size: 9px;\n font-weight: 600;\n color: var(--mj-text-muted);\n}\n.lean-sheet__btn--on small {\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n"] }]
472
+ args: [{ standalone: true, selector: 'mj-realtime-composer', imports: [CommonModule, FormsModule, MJButtonDirective, MediaControlsComponent], template: "@if (StripMode && Compact) {\n <!-- COMPACT / ORB (Calm Orb \u00B7 overlay): the lean dock \u2014 primary bar keeps only the microphone,\n Captions, active Camera/Share (while on), a \"\u2022\u2022\u2022\" that blooms a small sheet with secondary\n actions (inactive Camera/Share, Details, Type), and a red End. Circles from the design system. -->\n <div class=\"dock-lean\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"lean__media\"\n Size=\"lg\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera && CameraOn\"\n [ShowShare]=\"ShowShare && Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n <!-- Captions: first-class in the lean dock (the overlay's only text toggle now). -->\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n\n @if (HasMoreItems) {\n <div class=\"lean-more\" [class.lean-more--open]=\"MoreOpen\">\n <!-- Closed, the sheet is only faded out, so it stays where it opens, over the call body. Inert keeps its\n buttons out of focus, the accessibility tree and clicks until \"\u2022\u2022\u2022\" opens it (#6545). -->\n <div class=\"lean-sheet\" (click)=\"$event.stopPropagation()\" role=\"group\" aria-label=\"More call controls\"\n [attr.inert]=\"MoreOpen ? null : ''\">\n @if ((ShowCamera && !CameraOn) || (ShowShare && !Sharing)) {\n <mj-media-controls class=\"lean-sheet__media\"\n Size=\"md\"\n [ShowMicrophone]=\"false\"\n [ShowCamera]=\"ShowCamera && !CameraOn\"\n [ShowShare]=\"ShowShare && !Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n (CameraToggled)=\"CameraToggled.emit($event); MoreOpen = false\"\n (ShareRequested)=\"ShareRequested.emit($event); MoreOpen = false\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n }\n @if (ShowDetails) {\n <button type=\"button\" class=\"lean-sheet__btn\" [class.lean-sheet__btn--on]=\"DetailsOn\"\n (click)=\"DetailsToggled.emit(); MoreOpen = false\"\n [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n [attr.aria-pressed]=\"DetailsOn\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n <small>Details</small>\n </button>\n }\n @if (AllowTyping) {\n <button type=\"button\" class=\"lean-sheet__btn\"\n (click)=\"OpenChanged.emit(true); MoreOpen = false\"\n title=\"Type into the live session\" aria-label=\"Open the typed-input composer\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n <small>Type</small>\n </button>\n }\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" [Variant]=\"MoreOpen ? 'primary' : 'secondary'\"\n AriaLabel=\"More call controls\" title=\"More controls\"\n [attr.aria-expanded]=\"MoreOpen\"\n (click)=\"ToggleMore($event)\">\n <i class=\"fa-solid fa-ellipsis\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n} @else if (StripMode) {\n <!-- Levels 0\u20131: phone-call strip \u2014 big labelled circles: the call's media controls (the microphone with its device\n chevron, and the camera and Share when the call offers them), Captions (level 1+, arriving WITH the text it\n controls), the Details peek at the surface panels, Type, and End call, the deliberate rightmost action. -->\n <div class=\"strip\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"strip__media\"\n Size=\"lg\"\n [ShowLabels]=\"true\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n @if (ShowCaptionsControl) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Captions</span>\n </div>\n }\n\n @if (ShowDetails) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Details</span>\n </div>\n }\n\n @if (AllowTyping) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\"\n AriaLabel=\"Open the typed-input composer\" title=\"Type into the live session\"\n (click)=\"OpenChanged.emit(true)\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Type</span>\n </div>\n }\n\n @if (ShowEnd) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label ctrl-label--end\" aria-hidden=\"true\">End call</span>\n </div>\n }\n </div>\n} @else {\n <!-- Level 2+: the fused dock \u2014 small circles and the in-call composer in ONE bottom bar. -->\n <div class=\"dock\">\n <div class=\"dock__minis\">\n <!-- No Share arrow and no device chevron in the dock, which is short of room: the browser's picker still offers\n every kind of surface, and Hide brings back the strip, which has the device menu. -->\n <mj-media-controls Size=\"sm\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [ShowShareMenu]=\"false\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [CameraOptional]=\"true\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowDetails) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Show the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <div class=\"dock__box\">\n <textarea\n #dockInput\n class=\"dock__input\"\n rows=\"1\"\n placeholder=\"Type into the live session \u2014 joins this same voice call\u2026\"\n [(ngModel)]=\"Draft\"\n (keydown)=\"OnKeydown($event)\"\n (input)=\"AutoResize()\"\n aria-label=\"Type a message into the live voice session\"></textarea>\n <span class=\"dock__hint\" aria-hidden=\"true\">\u21B5 send</span>\n <button\n class=\"dock__send\"\n type=\"button\"\n [disabled]=\"!CanSend\"\n (click)=\"Send()\"\n title=\"Send into live session\"\n aria-label=\"Send\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" class=\"dock__hide\"\n AriaLabel=\"Close the typed-input composer\" title=\"Hide typing \u2014 back to the voice controls\"\n (click)=\"OpenChanged.emit(false)\">\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n}\n", styles: [":host {\n display: block;\n /* The fused dock reflows by its own width, not the window's (the call column narrows when the panel opens). */\n container-type: inline-size;\n}\n\n/* ---------- Levels 0\u20131: phone-call strip (big round controls, centered) ---------- */\n.strip {\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n gap: 22px;\n padding: 20px 22px;\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.ctrl-group {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n\n/* Matches mj-media-controls' own labels, so every control in the strip is named alike. */\n.ctrl-label {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n text-align: center;\n margin-top: var(--mj-space-1-5);\n font-weight: 500;\n}\n\n/* The call's media controls sit in the strip like its other groups. */\n.strip__media {\n align-items: flex-start;\n gap: 22px;\n}\n\n/* A narrow strip tightens its gaps, then wraps onto a second row, rather than cutting off its first and last controls. */\n@container (max-width: 600px) {\n .strip,\n .strip__media {\n gap: 12px;\n }\n}\n@container (max-width: 480px) {\n .strip {\n flex-wrap: wrap;\n row-gap: 12px;\n }\n}\n.ctrl-label--end {\n color: var(--mj-status-error);\n}\n\n/* ---------- Level 2+: the fused dock (minis + composer in one bar) ---------- */\n.dock {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 18px;\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n animation: dock-in 320ms cubic-bezier(0.2, 0.8, 0.3, 1);\n}\n@keyframes dock-in {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n.dock__minis {\n display: flex;\n gap: 7px;\n flex-shrink: 0;\n}\n\n/* min-width: 0 lets the box (and its text) give way to the controls on a narrow dock instead of pushing End out. */\n.dock__box {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: flex-end;\n gap: 9px;\n padding: 5px 6px 5px 14px;\n border: 1px solid var(--mj-border-strong);\n border-radius: 20px;\n background: var(--mj-bg-surface-card);\n transition: border-color 140ms ease, box-shadow 140ms ease, border-radius 140ms ease;\n}\n/* On a narrow dock the text box takes a row of its own under the controls, so neither is squeezed. */\n@container (max-width: 520px) {\n .dock {\n flex-wrap: wrap;\n row-gap: 8px;\n }\n .dock__box {\n order: 1;\n flex-basis: 100%;\n }\n}\n\n.dock__box:focus-within {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n\n.dock__input {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: 0;\n outline: none;\n color: var(--mj-text-primary);\n font-family: inherit;\n font-size: 13.5px;\n line-height: 1.45;\n resize: none;\n height: 24px;\n max-height: 140px;\n overflow-y: auto;\n padding: 3px 0 4px 0;\n scrollbar-width: thin;\n scrollbar-color: var(--mj-border-strong) transparent;\n}\n.dock__input::placeholder {\n color: var(--mj-text-muted);\n}\n\n.dock__hint {\n font-size: 10.5px;\n font-weight: 600;\n color: var(--mj-text-disabled);\n white-space: nowrap;\n}\n\n.dock__send {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse, #fff);\n border: 0;\n display: grid;\n place-items: center;\n cursor: pointer;\n font-size: 12px;\n flex-shrink: 0;\n transition: background 150ms ease;\n}\n.dock__send:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n}\n.dock__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n\n\n/* ============================================================= COMPACT (Calm Orb \u00B7 overlay)\n The lean dock \u2014 a \"\u2022\u2022\u2022\" that blooms a small sheet (Details / Type), Captions, the microphone and a red End.\n Design-system circles. No 5-button bar, no overlapping hint. */\n.dock-lean {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 14px;\n row-gap: 10px;\n padding: 16px 18px 20px;\n background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--mj-bg-page) 35%, transparent));\n}\n\n/* A narrow lean dock (the call column is at least 420px wide) tightens its gaps, so the microphone's device chevron and\n the Share arrow fit beside the other controls; where even that is not enough (larger touch targets), it wraps onto a\n second row rather than cutting off its first and last controls. */\n@container (max-width: 490px) {\n .dock-lean {\n gap: 6px;\n row-gap: 10px;\n padding-inline: 12px;\n }\n .lean__media {\n gap: 4px;\n }\n}\n\n\n/* The \"\u2022\u2022\u2022\" overflow + its blooming sheet. */\n.lean-more {\n position: relative;\n display: flex;\n align-items: center;\n}\n.lean-sheet {\n position: absolute;\n bottom: calc(100% + 12px);\n left: 50%;\n transform: translateX(-50%) translateY(8px);\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px;\n border-radius: var(--mj-radius-lg, 16px);\n background: var(--mj-bg-surface-elevated);\n border: 1px solid var(--mj-border-default);\n box-shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.6);\n opacity: 0;\n pointer-events: none;\n transition: opacity 200ms ease, transform 200ms ease;\n z-index: 5;\n}\n.lean-sheet__media {\n align-items: center;\n gap: 8px;\n}\n.lean-more--open .lean-sheet {\n opacity: 1;\n pointer-events: auto;\n transform: translateX(-50%) translateY(0);\n}\n.lean-sheet__btn {\n display: grid;\n place-items: center;\n gap: 3px;\n width: 56px;\n padding: 8px 4px;\n border-radius: var(--mj-radius-md, 10px);\n border: 1px solid transparent;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n font-size: 16px;\n transition: all 140ms ease;\n}\n.lean-sheet__btn:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n.lean-sheet__btn--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.lean-sheet__btn small {\n font-size: 9px;\n font-weight: 600;\n color: var(--mj-text-muted);\n}\n.lean-sheet__btn--on small {\n color: var(--mj-brand-accent, var(--mj-brand-primary));\n}\n"] }]
471
473
  }], null, { Open: [{
472
474
  type: Input
473
475
  }], Compact: [{
@@ -1 +1 @@
1
- {"version":3,"file":"realtime-composer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-composer.component.ts","../../../../src/lib/components/realtime/realtime-composer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAc,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvI,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAgD,MAAM,mCAAmC,CAAC;AAEzH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;;;;;;ICoB3E,iCAEmC;IAA3B,4MAAS,uBAAgB,KAAC;IAChC,uBAAgE;IAClE,iBAAS;;;IAHoB,AADqC,AAApB,iCAAmB,+BAAwB,+BACrC;;;;IAU9C,6CAWoE;IAAjD,AADA,AADA,qOAAiB,iCAA0B,0CAAa,KAAK,KAAC,0NAC5C,kCAA2B,0CAAa,KAAK,KAAC,kPAC1C,gCAAyB,KAAC;IAAC,iBAAoB;;;IAHrE,AADA,AADA,AADA,AADA,AADA,AADA,sCAAwB,qDACc,kDACH,6BACd,2BACF,mCACQ,wBACJ;;;;IAM1C,kCAGwC;IAFhC,oMAAS,4BAAqB,0CAAa,KAAK,KAAC;IAGv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rB,YAAY;mBAAC,gBAAgB;;kFA3JnB,yBAAyB","sourcesContent":["import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { MediaControlsComponent, type MediaSharePanel, type MediaShareRequest } from '@memberjunction/ng-realtime-media';\nimport type { MediaDevice, MediaDeviceSelection } from '@memberjunction/ai-realtime-client/media';\nimport { RealtimeSessionService } from '../../services/realtime-session.service';\n\n/**\n * The call overlay's BOTTOM DOCK — the progressive-disclosure composer\n * (`plans/realtime/mockups/redesign-a-progressive.html`). One component, two shapes,\n * keyed off the overlay's disclosure {@link Level}:\n *\n * - **Levels 0–1 (phone-call strip)** — big round call controls, centered: Mute, the\n * Captions toggle (level 1+, arriving WITH the text it controls), the Details peek\n * (level 0 paths where the surface panel isn't earned yet — lets the user look at the\n * Activity/Whiteboard panels on demand), the Type control, and End call. There's no visible\n * composer yet — the Type control opens it, and so does simply starting to type (the overlay\n * captures the first printable keystroke and seeds it via {@link AppendAndFocus}).\n * - **Level 2+ (the dock)** — mute/captions shrink to small circles and the in-call text\n * input docks beside them (one bottom bar, per Redesign A's fused composer+controls).\n * Submit calls {@link RealtimeSessionService.SendText}, which injects the text as a user\n * turn into the SAME live voice call.\n *\n * The controls are the design system's: the microphone, the camera and Share are `mj-media-controls` (the call controls\n * the LiveKit room uses too) and every other control an `mjButton` circle, sized per shape (52, 44 or 32 px). The camera\n * and Share show only when the overlay says the call offers them; the camera is optional here, so it is neutral while off.\n * In the strip and the lean dock the microphone carries the device chevron, whose menu picks the microphone and, while the\n * camera is open, the camera ({@link Devices}); the fused dock, short of room, leaves it out, as it does the Share arrow.\n *\n * Mute talks to the session service directly (pure local toggle); captions / Details /\n * End are emitted up so the overlay shell owns that state and lifecycle.\n */\n@Component({\n standalone: true,\n selector: 'mj-realtime-composer',\n imports: [CommonModule, FormsModule, MJButtonDirective, MediaControlsComponent],\n templateUrl: './realtime-composer.component.html',\n styleUrl: './realtime-composer.component.css'\n})\nexport class RealtimeComposerComponent {\n /**\n * Whether the typed-input dock is OPEN. A two-way door owned by the user: the strip's\n * Type control (or the T hotkey) opens it; the dock's hide control closes it — typing\n * never becomes permanent chrome. Default closed (voice-first), reset per session.\n */\n @Input() Open = false;\n\n /**\n * COMPACT (Calm Orb · overlay) presentation: collapse the phone-call strip to the\n * mockup's lean dock — **Mute + End + a \"•••\"** overflow button. The \"•••\" blooms a small\n * sheet hosting the secondary actions (Captions / Details / Type). The fused level-2 dock\n * (minis + text input) is unchanged. Fed from the overlay's resolved `Ui.compact`.\n * Default `false` (the full 5-button strip is unchanged).\n */\n @Input() Compact = false;\n\n /**\n * Whether the Type buttons render (the strip's Type control and the lean dock's \"Type\" entry\n * in the \"•••\" sheet). The overlay binds its resolved `allowTyping`. Only the controls that\n * OPEN the typed-input dock are gated: an already-open dock keeps its hide control and Send.\n * Default `true`.\n */\n @Input() AllowTyping = true;\n\n /**\n * Whether the End-call button renders in every layout. The overlay binds its resolved\n * end-control switch; a host that ends the call elsewhere turns it off. Default `true`.\n */\n @Input() ShowEnd = true;\n\n /**\n * Whether the Captions toggle renders in every layout. This hides the control only; the\n * caption state itself (`CaptionsOn`) is unaffected. Default `true`.\n */\n @Input() ShowCaptionsControl = true;\n\n /** Emitted when the user opens (Type control / typing) or closes (hide control) the dock. */\n @Output() OpenChanged = new EventEmitter<boolean>();\n\n /** Whether captions are currently shown (drives the captions control's active state). */\n @Input() CaptionsOn = true;\n\n /** Whether the Details peek control renders (true until the surface panel is earned). */\n @Input() ShowDetails = false;\n\n /** Whether the Details peek is currently open (active state on the control). */\n @Input() DetailsOn = false;\n\n /** Emitted when the user toggles captions; the overlay flips its caption state. */\n @Output() CaptionsToggled = new EventEmitter<boolean>();\n\n /** Emitted when the user toggles the Details peek (the on-demand surface panel). */\n @Output() DetailsToggled = new EventEmitter<void>();\n\n /** Emitted when the user ends the call from the strip's End control. */\n @Output() EndRequested = new EventEmitter<void>();\n\n /** Emitted with the new muted state whenever the user toggles the mic from the dock. */\n @Output() MuteChanged = new EventEmitter<boolean>();\n\n /** Current draft text in the dock's composer input. */\n public Draft = '';\n\n /** Show the camera button: the call offers the camera (the runtime's `CaptureOffers$`). */\n @Input() ShowCamera = false;\n\n /** Show the Share button: the call offers a screen share. */\n @Input() ShowShare = false;\n\n /** Whether the camera is on (or starting). */\n @Input() CameraOn = false;\n\n /** Whether the user is sharing (or choosing what to share). */\n @Input() Sharing = false;\n\n /**\n * The panels of the page the Share menu offers under \"This panel\" (the overlay's on-screen panels). The typed-input\n * dock, whose Share button has no menu, leaves them out.\n */\n @Input() SharePanels: readonly MediaSharePanel[] = [];\n\n /**\n * The microphones and cameras the device menu offers: the call's microphones, and its cameras while the camera is\n * open. With none there is no device chevron. The typed-input dock leaves the chevron out.\n */\n @Input() Devices: readonly MediaDevice[] = [];\n\n /** The microphone the device menu shows as picked. */\n @Input() SelectedMicrophoneID: string | null = null;\n\n /** The camera the device menu shows as picked. */\n @Input() SelectedCameraID: string | null = null;\n\n /** The user asked to turn the camera on (`true`) or off (`false`). The overlay starts or stops it. */\n @Output() CameraToggled = new EventEmitter<boolean>();\n\n /** The user asked to share a screen, window or tab, or one of {@link SharePanels}. */\n @Output() ShareRequested = new EventEmitter<MediaShareRequest>();\n\n /** The user asked to stop sharing. */\n @Output() StopShareRequested = new EventEmitter<void>();\n\n /** The user picked a microphone or a camera in the device menu. The overlay switches to it. */\n @Output() DeviceSelected = new EventEmitter<MediaDeviceSelection>();\n\n /**\n * The mic mute state. A two-way reflection: the overlay may push it down (e.g. its\n * `SetMuted()` / focus-pill toggle) so all mute affordances stay in sync, and this\n * component updates it locally + emits {@link MuteChanged} when its own button is used.\n */\n @Input() IsMuted = false;\n\n @ViewChild('dockInput') private dockInput?: ElementRef<HTMLInputElement | HTMLTextAreaElement>;\n\n private realtime = inject(RealtimeSessionService);\n private cdr = inject(ChangeDetectorRef);\n\n /** The captions control's tooltip: what a click does. */\n public get CaptionsTitle(): string {\n return this.CaptionsOn ? 'Voice-first — back to the orb' : 'Show the conversation as text';\n }\n\n /** True when there's non-whitespace text to send. */\n public get CanSend(): boolean {\n return this.Draft.trim().length > 0;\n }\n\n /** True while the big-controls phone-call strip renders (instead of the dock). */\n public get StripMode(): boolean {\n return !this.Open;\n }\n\n /**\n * Whether the compact \"•••\" overflow sheet (inactive Camera / Share, Details, Type) is open. Only\n * used in {@link Compact} strip mode; any outside click or action selection closes it.\n */\n public MoreOpen = false;\n\n /**\n * Whether the compact \"•••\" sheet has anything to hold: an inactive camera or share, Details, or\n * Type. When the host switches all of them off, the \"•••\" itself goes, so it never opens an empty\n * sheet. Mirrors the sheet's own `@if` blocks in the template, so keep the two in step.\n */\n public get HasMoreItems(): boolean {\n return this.AllowTyping || this.ShowDetails || (this.ShowCamera && !this.CameraOn) || (this.ShowShare && !this.Sharing);\n }\n\n /** Open/close the compact overflow sheet (stops propagation so the outside-click close skips it). */\n public ToggleMore(event: MouseEvent): void {\n event.stopPropagation();\n this.MoreOpen = !this.MoreOpen;\n }\n\n /** Any outside click closes the compact overflow sheet. */\n @HostListener('document:click')\n public OnDocumentClick(): void {\n if (this.MoreOpen) {\n this.MoreOpen = false;\n }\n }\n\n /** Toggle the local microphone mute and surface the new state to the overlay. */\n public ToggleMute(): void {\n this.IsMuted = this.realtime.ToggleMute();\n this.MuteChanged.emit(this.IsMuted);\n }\n\n /** Toggle captions visibility and notify the overlay. */\n public ToggleCaptions(): void {\n this.CaptionsOn = !this.CaptionsOn;\n this.CaptionsToggled.emit(this.CaptionsOn);\n }\n\n /** Focuses the dock's text input (the overlay's Type control lands here). */\n public FocusInput(): void {\n this.dockInput?.nativeElement.focus();\n }\n\n /**\n * TYPE-TO-COMPOSE: the overlay captured a printable keystroke while nothing was focused, so seed\n * the draft with that character, focus the input, and put the caret at the end — the user just\n * keeps typing and their first key isn't lost. Appends (rather than replaces) so a leftover draft\n * is preserved. The native value is synced inline so the caret math is correct before Angular's\n * next change-detection pass reconciles ngModel.\n *\n * @param text the character(s) to seed (typically the single key that opened the composer).\n */\n public AppendAndFocus(text: string): void {\n this.Draft = (this.Draft ?? '') + text;\n this.cdr.markForCheck();\n const el = this.dockInput?.nativeElement;\n if (el) {\n el.value = this.Draft;\n el.focus();\n el.setSelectionRange(this.Draft.length, this.Draft.length);\n this.AutoResize();\n }\n }\n\n /** Auto-resizes the textarea up to 140px height as text grows or contracts. */\n public AutoResize(): void {\n const el = this.dockInput?.nativeElement;\n if (el && el instanceof HTMLTextAreaElement) {\n el.style.height = 'auto';\n const newHeight = Math.max(24, Math.min(el.scrollHeight, 140));\n el.style.height = `${newHeight}px`;\n }\n }\n\n /** Send the typed text into the live session, then clear the input. */\n public Send(): void {\n if (!this.CanSend) {\n return;\n }\n this.realtime.SendText(this.Draft);\n this.Draft = '';\n const el = this.dockInput?.nativeElement;\n if (el && el instanceof HTMLTextAreaElement) {\n el.style.height = 'auto';\n }\n }\n\n /** Enter sends (Shift+Enter inserts a newline in textarea). */\n public OnKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n this.Send();\n }\n }\n}\n","@if (StripMode && Compact) {\n <!-- COMPACT / ORB (Calm Orb · overlay): the lean dock — primary bar keeps only the microphone,\n Captions, active Camera/Share (while on), a \"•••\" that blooms a small sheet with secondary\n actions (inactive Camera/Share, Details, Type), and a red End. Circles from the design system. -->\n <div class=\"dock-lean\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"lean__media\"\n Size=\"lg\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera && CameraOn\"\n [ShowShare]=\"ShowShare && Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n <!-- Captions: first-class in the lean dock (the overlay's only text toggle now). -->\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n\n @if (HasMoreItems) {\n <div class=\"lean-more\" [class.lean-more--open]=\"MoreOpen\">\n <div class=\"lean-sheet\" (click)=\"$event.stopPropagation()\" role=\"group\" aria-label=\"More call controls\">\n @if ((ShowCamera && !CameraOn) || (ShowShare && !Sharing)) {\n <mj-media-controls class=\"lean-sheet__media\"\n Size=\"md\"\n [ShowMicrophone]=\"false\"\n [ShowCamera]=\"ShowCamera && !CameraOn\"\n [ShowShare]=\"ShowShare && !Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n (CameraToggled)=\"CameraToggled.emit($event); MoreOpen = false\"\n (ShareRequested)=\"ShareRequested.emit($event); MoreOpen = false\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n }\n @if (ShowDetails) {\n <button type=\"button\" class=\"lean-sheet__btn\" [class.lean-sheet__btn--on]=\"DetailsOn\"\n (click)=\"DetailsToggled.emit(); MoreOpen = false\"\n [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n [attr.aria-pressed]=\"DetailsOn\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n <small>Details</small>\n </button>\n }\n @if (AllowTyping) {\n <button type=\"button\" class=\"lean-sheet__btn\"\n (click)=\"OpenChanged.emit(true); MoreOpen = false\"\n title=\"Type into the live session\" aria-label=\"Open the typed-input composer\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n <small>Type</small>\n </button>\n }\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" [Variant]=\"MoreOpen ? 'primary' : 'secondary'\"\n AriaLabel=\"More call controls\" title=\"More controls\"\n [attr.aria-expanded]=\"MoreOpen\"\n (click)=\"ToggleMore($event)\">\n <i class=\"fa-solid fa-ellipsis\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n} @else if (StripMode) {\n <!-- Levels 0–1: phone-call strip — big labelled circles: the call's media controls (the microphone with its device\n chevron, and the camera and Share when the call offers them), Captions (level 1+, arriving WITH the text it\n controls), the Details peek at the surface panels, Type, and End call, the deliberate rightmost action. -->\n <div class=\"strip\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"strip__media\"\n Size=\"lg\"\n [ShowLabels]=\"true\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n @if (ShowCaptionsControl) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Captions</span>\n </div>\n }\n\n @if (ShowDetails) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Details</span>\n </div>\n }\n\n @if (AllowTyping) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\"\n AriaLabel=\"Open the typed-input composer\" title=\"Type into the live session\"\n (click)=\"OpenChanged.emit(true)\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Type</span>\n </div>\n }\n\n @if (ShowEnd) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label ctrl-label--end\" aria-hidden=\"true\">End call</span>\n </div>\n }\n </div>\n} @else {\n <!-- Level 2+: the fused dock — small circles and the in-call composer in ONE bottom bar. -->\n <div class=\"dock\">\n <div class=\"dock__minis\">\n <!-- No Share arrow and no device chevron in the dock, which is short of room: the browser's picker still offers\n every kind of surface, and Hide brings back the strip, which has the device menu. -->\n <mj-media-controls Size=\"sm\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [ShowShareMenu]=\"false\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [CameraOptional]=\"true\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowDetails) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Show the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <div class=\"dock__box\">\n <textarea\n #dockInput\n class=\"dock__input\"\n rows=\"1\"\n placeholder=\"Type into the live session — joins this same voice call…\"\n [(ngModel)]=\"Draft\"\n (keydown)=\"OnKeydown($event)\"\n (input)=\"AutoResize()\"\n aria-label=\"Type a message into the live voice session\"></textarea>\n <span class=\"dock__hint\" aria-hidden=\"true\">↵ send</span>\n <button\n class=\"dock__send\"\n type=\"button\"\n [disabled]=\"!CanSend\"\n (click)=\"Send()\"\n title=\"Send into live session\"\n aria-label=\"Send\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" class=\"dock__hide\"\n AriaLabel=\"Close the typed-input composer\" title=\"Hide typing — back to the voice controls\"\n (click)=\"OpenChanged.emit(false)\">\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n}\n"]}
1
+ {"version":3,"file":"realtime-composer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/realtime/realtime-composer.component.ts","../../../../src/lib/components/realtime/realtime-composer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAc,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvI,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAgD,MAAM,mCAAmC,CAAC;AAEzH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;;;;;;ICoB3E,iCAEmC;IAA3B,4MAAS,uBAAgB,KAAC;IAChC,uBAAgE;IAClE,iBAAS;;;IAHoB,AADqC,AAApB,iCAAmB,+BAAwB,+BACrC;;;;IAa9C,6CAWoE;IAAjD,AADA,AADA,qOAAiB,iCAA0B,0CAAa,KAAK,KAAC,0NAC5C,kCAA2B,0CAAa,KAAK,KAAC,kPAC1C,gCAAyB,KAAC;IAAC,iBAAoB;;;IAHrE,AADA,AADA,AADA,AADA,AADA,AADA,sCAAwB,qDACc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AGL,KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAON,KAAK;;kBAEL,SAAS;mBAAC,WAAW;;kBA0CrB,YAAY;mBAAC,gBAAgB;;kFA3JnB,yBAAyB","sourcesContent":["import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { MediaControlsComponent, type MediaSharePanel, type MediaShareRequest } from '@memberjunction/ng-realtime-media';\nimport type { MediaDevice, MediaDeviceSelection } from '@memberjunction/ai-realtime-client/media';\nimport { RealtimeSessionService } from '../../services/realtime-session.service';\n\n/**\n * The call overlay's BOTTOM DOCK — the progressive-disclosure composer\n * (`plans/realtime/mockups/redesign-a-progressive.html`). One component, two shapes,\n * keyed off the overlay's disclosure {@link Level}:\n *\n * - **Levels 0–1 (phone-call strip)** — big round call controls, centered: Mute, the\n * Captions toggle (level 1+, arriving WITH the text it controls), the Details peek\n * (level 0 paths where the surface panel isn't earned yet — lets the user look at the\n * Activity/Whiteboard panels on demand), the Type control, and End call. There's no visible\n * composer yet — the Type control opens it, and so does simply starting to type (the overlay\n * captures the first printable keystroke and seeds it via {@link AppendAndFocus}).\n * - **Level 2+ (the dock)** — mute/captions shrink to small circles and the in-call text\n * input docks beside them (one bottom bar, per Redesign A's fused composer+controls).\n * Submit calls {@link RealtimeSessionService.SendText}, which injects the text as a user\n * turn into the SAME live voice call.\n *\n * The controls are the design system's: the microphone, the camera and Share are `mj-media-controls` (the call controls\n * the LiveKit room uses too) and every other control an `mjButton` circle, sized per shape (52, 44 or 32 px). The camera\n * and Share show only when the overlay says the call offers them; the camera is optional here, so it is neutral while off.\n * In the strip and the lean dock the microphone carries the device chevron, whose menu picks the microphone and, while the\n * camera is open, the camera ({@link Devices}); the fused dock, short of room, leaves it out, as it does the Share arrow.\n *\n * Mute talks to the session service directly (pure local toggle); captions / Details /\n * End are emitted up so the overlay shell owns that state and lifecycle.\n */\n@Component({\n standalone: true,\n selector: 'mj-realtime-composer',\n imports: [CommonModule, FormsModule, MJButtonDirective, MediaControlsComponent],\n templateUrl: './realtime-composer.component.html',\n styleUrl: './realtime-composer.component.css'\n})\nexport class RealtimeComposerComponent {\n /**\n * Whether the typed-input dock is OPEN. A two-way door owned by the user: the strip's\n * Type control (or the T hotkey) opens it; the dock's hide control closes it — typing\n * never becomes permanent chrome. Default closed (voice-first), reset per session.\n */\n @Input() Open = false;\n\n /**\n * COMPACT (Calm Orb · overlay) presentation: collapse the phone-call strip to the\n * mockup's lean dock — **Mute + End + a \"•••\"** overflow button. The \"•••\" blooms a small\n * sheet hosting the secondary actions (Captions / Details / Type). The fused level-2 dock\n * (minis + text input) is unchanged. Fed from the overlay's resolved `Ui.compact`.\n * Default `false` (the full 5-button strip is unchanged).\n */\n @Input() Compact = false;\n\n /**\n * Whether the Type buttons render (the strip's Type control and the lean dock's \"Type\" entry\n * in the \"•••\" sheet). The overlay binds its resolved `allowTyping`. Only the controls that\n * OPEN the typed-input dock are gated: an already-open dock keeps its hide control and Send.\n * Default `true`.\n */\n @Input() AllowTyping = true;\n\n /**\n * Whether the End-call button renders in every layout. The overlay binds its resolved\n * end-control switch; a host that ends the call elsewhere turns it off. Default `true`.\n */\n @Input() ShowEnd = true;\n\n /**\n * Whether the Captions toggle renders in every layout. This hides the control only; the\n * caption state itself (`CaptionsOn`) is unaffected. Default `true`.\n */\n @Input() ShowCaptionsControl = true;\n\n /** Emitted when the user opens (Type control / typing) or closes (hide control) the dock. */\n @Output() OpenChanged = new EventEmitter<boolean>();\n\n /** Whether captions are currently shown (drives the captions control's active state). */\n @Input() CaptionsOn = true;\n\n /** Whether the Details peek control renders (true until the surface panel is earned). */\n @Input() ShowDetails = false;\n\n /** Whether the Details peek is currently open (active state on the control). */\n @Input() DetailsOn = false;\n\n /** Emitted when the user toggles captions; the overlay flips its caption state. */\n @Output() CaptionsToggled = new EventEmitter<boolean>();\n\n /** Emitted when the user toggles the Details peek (the on-demand surface panel). */\n @Output() DetailsToggled = new EventEmitter<void>();\n\n /** Emitted when the user ends the call from the strip's End control. */\n @Output() EndRequested = new EventEmitter<void>();\n\n /** Emitted with the new muted state whenever the user toggles the mic from the dock. */\n @Output() MuteChanged = new EventEmitter<boolean>();\n\n /** Current draft text in the dock's composer input. */\n public Draft = '';\n\n /** Show the camera button: the call offers the camera (the runtime's `CaptureOffers$`). */\n @Input() ShowCamera = false;\n\n /** Show the Share button: the call offers a screen share. */\n @Input() ShowShare = false;\n\n /** Whether the camera is on (or starting). */\n @Input() CameraOn = false;\n\n /** Whether the user is sharing (or choosing what to share). */\n @Input() Sharing = false;\n\n /**\n * The panels of the page the Share menu offers under \"This panel\" (the overlay's on-screen panels). The typed-input\n * dock, whose Share button has no menu, leaves them out.\n */\n @Input() SharePanels: readonly MediaSharePanel[] = [];\n\n /**\n * The microphones and cameras the device menu offers: the call's microphones, and its cameras while the camera is\n * open. With none there is no device chevron. The typed-input dock leaves the chevron out.\n */\n @Input() Devices: readonly MediaDevice[] = [];\n\n /** The microphone the device menu shows as picked. */\n @Input() SelectedMicrophoneID: string | null = null;\n\n /** The camera the device menu shows as picked. */\n @Input() SelectedCameraID: string | null = null;\n\n /** The user asked to turn the camera on (`true`) or off (`false`). The overlay starts or stops it. */\n @Output() CameraToggled = new EventEmitter<boolean>();\n\n /** The user asked to share a screen, window or tab, or one of {@link SharePanels}. */\n @Output() ShareRequested = new EventEmitter<MediaShareRequest>();\n\n /** The user asked to stop sharing. */\n @Output() StopShareRequested = new EventEmitter<void>();\n\n /** The user picked a microphone or a camera in the device menu. The overlay switches to it. */\n @Output() DeviceSelected = new EventEmitter<MediaDeviceSelection>();\n\n /**\n * The mic mute state. A two-way reflection: the overlay may push it down (e.g. its\n * `SetMuted()` / focus-pill toggle) so all mute affordances stay in sync, and this\n * component updates it locally + emits {@link MuteChanged} when its own button is used.\n */\n @Input() IsMuted = false;\n\n @ViewChild('dockInput') private dockInput?: ElementRef<HTMLInputElement | HTMLTextAreaElement>;\n\n private realtime = inject(RealtimeSessionService);\n private cdr = inject(ChangeDetectorRef);\n\n /** The captions control's tooltip: what a click does. */\n public get CaptionsTitle(): string {\n return this.CaptionsOn ? 'Voice-first — back to the orb' : 'Show the conversation as text';\n }\n\n /** True when there's non-whitespace text to send. */\n public get CanSend(): boolean {\n return this.Draft.trim().length > 0;\n }\n\n /** True while the big-controls phone-call strip renders (instead of the dock). */\n public get StripMode(): boolean {\n return !this.Open;\n }\n\n /**\n * Whether the compact \"•••\" overflow sheet (inactive Camera / Share, Details, Type) is open. Only\n * used in {@link Compact} strip mode; any outside click or action selection closes it.\n */\n public MoreOpen = false;\n\n /**\n * Whether the compact \"•••\" sheet has anything to hold: an inactive camera or share, Details, or\n * Type. When the host switches all of them off, the \"•••\" itself goes, so it never opens an empty\n * sheet. Mirrors the sheet's own `@if` blocks in the template, so keep the two in step.\n */\n public get HasMoreItems(): boolean {\n return this.AllowTyping || this.ShowDetails || (this.ShowCamera && !this.CameraOn) || (this.ShowShare && !this.Sharing);\n }\n\n /** Open/close the compact overflow sheet (stops propagation so the outside-click close skips it). */\n public ToggleMore(event: MouseEvent): void {\n event.stopPropagation();\n this.MoreOpen = !this.MoreOpen;\n }\n\n /** Any outside click closes the compact overflow sheet. */\n @HostListener('document:click')\n public OnDocumentClick(): void {\n if (this.MoreOpen) {\n this.MoreOpen = false;\n }\n }\n\n /** Toggle the local microphone mute and surface the new state to the overlay. */\n public ToggleMute(): void {\n this.IsMuted = this.realtime.ToggleMute();\n this.MuteChanged.emit(this.IsMuted);\n }\n\n /** Toggle captions visibility and notify the overlay. */\n public ToggleCaptions(): void {\n this.CaptionsOn = !this.CaptionsOn;\n this.CaptionsToggled.emit(this.CaptionsOn);\n }\n\n /** Focuses the dock's text input (the overlay's Type control lands here). */\n public FocusInput(): void {\n this.dockInput?.nativeElement.focus();\n }\n\n /**\n * TYPE-TO-COMPOSE: the overlay captured a printable keystroke while nothing was focused, so seed\n * the draft with that character, focus the input, and put the caret at the end — the user just\n * keeps typing and their first key isn't lost. Appends (rather than replaces) so a leftover draft\n * is preserved. The native value is synced inline so the caret math is correct before Angular's\n * next change-detection pass reconciles ngModel.\n *\n * @param text the character(s) to seed (typically the single key that opened the composer).\n */\n public AppendAndFocus(text: string): void {\n this.Draft = (this.Draft ?? '') + text;\n this.cdr.markForCheck();\n const el = this.dockInput?.nativeElement;\n if (el) {\n el.value = this.Draft;\n el.focus();\n el.setSelectionRange(this.Draft.length, this.Draft.length);\n this.AutoResize();\n }\n }\n\n /** Auto-resizes the textarea up to 140px height as text grows or contracts. */\n public AutoResize(): void {\n const el = this.dockInput?.nativeElement;\n if (el && el instanceof HTMLTextAreaElement) {\n el.style.height = 'auto';\n const newHeight = Math.max(24, Math.min(el.scrollHeight, 140));\n el.style.height = `${newHeight}px`;\n }\n }\n\n /** Send the typed text into the live session, then clear the input. */\n public Send(): void {\n if (!this.CanSend) {\n return;\n }\n this.realtime.SendText(this.Draft);\n this.Draft = '';\n const el = this.dockInput?.nativeElement;\n if (el && el instanceof HTMLTextAreaElement) {\n el.style.height = 'auto';\n }\n }\n\n /** Enter sends (Shift+Enter inserts a newline in textarea). */\n public OnKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n this.Send();\n }\n }\n}\n","@if (StripMode && Compact) {\n <!-- COMPACT / ORB (Calm Orb · overlay): the lean dock — primary bar keeps only the microphone,\n Captions, active Camera/Share (while on), a \"•••\" that blooms a small sheet with secondary\n actions (inactive Camera/Share, Details, Type), and a red End. Circles from the design system. -->\n <div class=\"dock-lean\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"lean__media\"\n Size=\"lg\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera && CameraOn\"\n [ShowShare]=\"ShowShare && Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n <!-- Captions: first-class in the lean dock (the overlay's only text toggle now). -->\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n\n @if (HasMoreItems) {\n <div class=\"lean-more\" [class.lean-more--open]=\"MoreOpen\">\n <!-- Closed, the sheet is only faded out, so it stays where it opens, over the call body. Inert keeps its\n buttons out of focus, the accessibility tree and clicks until \"•••\" opens it (#6545). -->\n <div class=\"lean-sheet\" (click)=\"$event.stopPropagation()\" role=\"group\" aria-label=\"More call controls\"\n [attr.inert]=\"MoreOpen ? null : ''\">\n @if ((ShowCamera && !CameraOn) || (ShowShare && !Sharing)) {\n <mj-media-controls class=\"lean-sheet__media\"\n Size=\"md\"\n [ShowMicrophone]=\"false\"\n [ShowCamera]=\"ShowCamera && !CameraOn\"\n [ShowShare]=\"ShowShare && !Sharing\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n (CameraToggled)=\"CameraToggled.emit($event); MoreOpen = false\"\n (ShareRequested)=\"ShareRequested.emit($event); MoreOpen = false\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n }\n @if (ShowDetails) {\n <button type=\"button\" class=\"lean-sheet__btn\" [class.lean-sheet__btn--on]=\"DetailsOn\"\n (click)=\"DetailsToggled.emit(); MoreOpen = false\"\n [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n [attr.aria-pressed]=\"DetailsOn\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n <small>Details</small>\n </button>\n }\n @if (AllowTyping) {\n <button type=\"button\" class=\"lean-sheet__btn\"\n (click)=\"OpenChanged.emit(true); MoreOpen = false\"\n title=\"Type into the live session\" aria-label=\"Open the typed-input composer\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n <small>Type</small>\n </button>\n }\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" [Variant]=\"MoreOpen ? 'primary' : 'secondary'\"\n AriaLabel=\"More call controls\" title=\"More controls\"\n [attr.aria-expanded]=\"MoreOpen\"\n (click)=\"ToggleMore($event)\">\n <i class=\"fa-solid fa-ellipsis\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n} @else if (StripMode) {\n <!-- Levels 0–1: phone-call strip — big labelled circles: the call's media controls (the microphone with its device\n chevron, and the camera and Share when the call offers them), Captions (level 1+, arriving WITH the text it\n controls), the Details peek at the surface panels, Type, and End call, the deliberate rightmost action. -->\n <div class=\"strip\" role=\"group\" aria-label=\"Call controls\">\n <mj-media-controls class=\"strip__media\"\n Size=\"lg\"\n [ShowLabels]=\"true\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [SharePanels]=\"SharePanels\"\n [CameraOptional]=\"true\"\n [ShowDeviceMenu]=\"true\"\n [Devices]=\"Devices\"\n [SelectedMicrophoneID]=\"SelectedMicrophoneID\"\n [SelectedCameraID]=\"SelectedCameraID\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"\n (DeviceSelected)=\"DeviceSelected.emit($event)\"></mj-media-controls>\n\n @if (ShowCaptionsControl) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Captions</span>\n </div>\n }\n\n @if (ShowDetails) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Peek at the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Details</span>\n </div>\n }\n\n @if (AllowTyping) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\"\n AriaLabel=\"Open the typed-input composer\" title=\"Type into the live session\"\n (click)=\"OpenChanged.emit(true)\">\n <i class=\"fa-regular fa-keyboard\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label\" aria-hidden=\"true\">Type</span>\n </div>\n }\n\n @if (ShowEnd) {\n <div class=\"ctrl-group\">\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"lg\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"ctrl-label ctrl-label--end\" aria-hidden=\"true\">End call</span>\n </div>\n }\n </div>\n} @else {\n <!-- Level 2+: the fused dock — small circles and the in-call composer in ONE bottom bar. -->\n <div class=\"dock\">\n <div class=\"dock__minis\">\n <!-- No Share arrow and no device chevron in the dock, which is short of room: the browser's picker still offers\n every kind of surface, and Hide brings back the strip, which has the device menu. -->\n <mj-media-controls Size=\"sm\"\n [MicrophoneOn]=\"!IsMuted\"\n [ShowCamera]=\"ShowCamera\"\n [ShowShare]=\"ShowShare\"\n [ShowShareMenu]=\"false\"\n [CameraOn]=\"CameraOn\"\n [Sharing]=\"Sharing\"\n [CameraOptional]=\"true\"\n (MicrophoneToggled)=\"ToggleMute()\"\n (CameraToggled)=\"CameraToggled.emit($event)\"\n (ShareRequested)=\"ShareRequested.emit($event)\"\n (StopShareRequested)=\"StopShareRequested.emit()\"></mj-media-controls>\n @if (ShowCaptionsControl) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"CaptionsOn\"\n AriaLabel=\"Captions\" [title]=\"CaptionsTitle\"\n (click)=\"ToggleCaptions()\">\n <i class=\"fa-solid fa-closed-captioning\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (ShowDetails) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" [Toggleable]=\"true\" [Selected]=\"DetailsOn\"\n AriaLabel=\"Details\" [title]=\"DetailsOn ? 'Hide the session panels' : 'Show the session panels'\"\n (click)=\"DetailsToggled.emit()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n <div class=\"dock__box\">\n <textarea\n #dockInput\n class=\"dock__input\"\n rows=\"1\"\n placeholder=\"Type into the live session — joins this same voice call…\"\n [(ngModel)]=\"Draft\"\n (keydown)=\"OnKeydown($event)\"\n (input)=\"AutoResize()\"\n aria-label=\"Type a message into the live voice session\"></textarea>\n <span class=\"dock__hint\" aria-hidden=\"true\">↵ send</span>\n <button\n class=\"dock__send\"\n type=\"button\"\n [disabled]=\"!CanSend\"\n (click)=\"Send()\"\n title=\"Send into live session\"\n aria-label=\"Send\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </div>\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" class=\"dock__hide\"\n AriaLabel=\"Close the typed-input composer\" title=\"Hide typing — back to the voice controls\"\n (click)=\"OpenChanged.emit(false)\">\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n @if (ShowEnd) {\n <button type=\"button\" mjButton Shape=\"circle\" Size=\"sm\" Variant=\"danger\"\n AriaLabel=\"End call\" title=\"End call\" (click)=\"EndRequested.emit()\">\n <i class=\"fa-solid fa-phone-slash\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n}\n"]}
@@ -271,8 +271,9 @@ export declare class ConversationAgentService {
271
271
  * again" exchanges where payload continuity matters most. A null payload is a LEGAL agent
272
272
  * input, so the failure is silent: the agent regenerates from scratch instead of modifying.
273
273
  *
274
- * Two reads: the agent's replies, then their newest Output version. Versions carry
275
- * `__mj_CreatedAt`, so "newest" is expressible without joining back for `Sequence`.
274
+ * Three RLS-safe reads: the agent's replies, their Output link rows, then their newest
275
+ * version. Versions carry `__mj_CreatedAt`, so "newest" is expressible without joining back
276
+ * for `Sequence`.
276
277
  *
277
278
  * @param historyFrom The chat's history floor. When set, only artifacts on replies written at
278
279
  * or after it count: a run that may not read earlier messages must not pick up their work
@@ -283,13 +284,14 @@ export declare class ConversationAgentService {
283
284
  FindLatestAgentOutputVersion(conversationId: string, agentId: string, historyFrom?: Date | null, branchId?: string | null): Promise<AgentPayloadSource | null>;
284
285
  /**
285
286
  * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced on one
286
- * conversation path, in messages no rerun replaced, or null when the agent has no such reply
287
- * there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts} so
288
- * the two can never disagree about what "this agent's artifacts" means.
287
+ * conversation path, in messages no rerun replaced, or null when the agent has no such
288
+ * output there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts}
289
+ * so the two can never disagree about what "this agent's artifacts" means.
289
290
  *
290
- * The replies are read with their own RunView ({@link agentReplyIds}), so the row-level
291
- * security on conversation messages applies. A subquery over their view would skip it, and the
292
- * server refuses one for a user whose read of messages is row-filtered.
291
+ * Both the replies (`MJ: Conversation Details`) and their output links
292
+ * (`MJ: Conversation Detail Artifacts`) are read with their own `RunView` calls so
293
+ * row-level security applies to each entity and `ClientClauseScreen` never refuses a
294
+ * base-view subquery on row-filtered conversation tables.
293
295
  */
294
296
  private agentOutputVersionFilter;
295
297
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAyB,iBAAiB,EAAqB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAwC,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAC5K,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAkC,MAAM,8BAA8B,CAAC;AAElI,OAAO,EAEL,0BAA0B,EAG3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,6BAA6B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AAM,GAAG,IAAI,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAkH7B,0DAA0D;IACpD,0BAA0B,CAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,0BAA0B,EAAE,EACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;;;;OAOG;IACU,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAO/E;;;;;;;;OAQG;IACU,kBAAkB,CAC7B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAIlC;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,qBAAqB;IAqCnC,kEAAkE;YACpD,iBAAiB;IAoB/B;;;;;;;;;;;;;;;;;;OAkBG;IACU,4BAA4B,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAKrC;;;;;;;;;OASG;YACW,wBAAwB;IAiBtC;;;;;;;;;OASG;YACW,aAAa;IA4B3B;;;;;;;;;OASG;YACW,gBAAgB;IAU9B;;;;;;OAMG;IACU,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAI3F;;;;;OAKG;YACW,qBAAqB;yCApxBxB,wBAAwB;6CAAxB,wBAAwB;CAqzBpC"}
1
+ {"version":3,"file":"conversation-agent.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"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AAiB;IAoB/B;;;;;;;;;;;;;;;;;;;OAmBG;IACU,4BAA4B,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAKrC;;;;;;;;;;OAUG;YACW,wBAAwB;IAwCtC;;;;;;;;;OASG;YACW,aAAa;IA4B3B;;;;;;;;;OASG;YACW,gBAAgB;IAU9B;;;;;;OAMG;IACU,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAI3F;;;;;OAKG;YACW,qBAAqB;yCA7yBxB,wBAAwB;6CAAxB,wBAAwB;CA80BpC"}
@@ -6,7 +6,7 @@ import { AIEngineBase, FindMentionPinnedPresetID } from '@memberjunction/ai-engi
6
6
  import { ConversationEngine } from '@memberjunction/core-entities';
7
7
  import { MJNotificationService } from '@memberjunction/ng-notifications';
8
8
  import { ConversationsRuntime } from '@memberjunction/conversations-runtime';
9
- import { EscapeSQLString, UUIDsEqual } from '@memberjunction/global';
9
+ import { EscapeSQLString, UUIDSet, UUIDsEqual } from '@memberjunction/global';
10
10
  import { GroupVersionsByArtifact } from '../utils/agent-artifact-summary';
11
11
  import * as i0 from "@angular/core";
12
12
  import * as i1 from "./conversations-runtime-bootstrap.service";
@@ -370,10 +370,10 @@ export class ConversationAgentService {
370
370
  console.warn('⚠️ Previous agent not found, defaulting to UNSURE');
371
371
  return { decision: 'UNSURE', reasoning: 'Previous agent not found' };
372
372
  }
373
- // Queried, not read off the caller's window-scoped maps — see findAllAgentArtifacts.
373
+ // Queried, not read off the caller's window-scoped maps — see FindAgentArtifacts.
374
374
  // `conversationHistory` below is still the window on purpose: the `.slice(-10)` wants
375
375
  // the most recent exchange, which the loaded tail always contains.
376
- const agentArtifacts = await this.findAllAgentArtifacts(conversationId, agentId, undefined, branchId);
376
+ const agentArtifacts = await this.FindAgentArtifacts(conversationId, agentId, undefined, branchId);
377
377
  const recentHistory = conversationHistory.slice(-10);
378
378
  const compactHistory = recentHistory.map((msg, idx) => {
379
379
  const role = msg.Role === 'User' ? 'User' : agent.Name || 'Agent';
@@ -536,7 +536,7 @@ ${compactHistory}${artifactContext}
536
536
  const rv = RunView.FromMetadataProvider(this.Provider);
537
537
  const result = await rv.RunView({
538
538
  EntityName: 'MJ: Artifacts',
539
- ExtraFilter: `ID IN (${artifactIds.map(id => `'${id}'`).join(',')})`,
539
+ ExtraFilter: `ID IN (${artifactIds.map(id => `'${EscapeSQLString(id)}'`).join(',')})`,
540
540
  Fields: ['ID', 'Name', 'Type'],
541
541
  ResultType: 'simple'
542
542
  }, this.Provider.CurrentUser ?? undefined);
@@ -556,8 +556,9 @@ ${compactHistory}${artifactContext}
556
556
  * again" exchanges where payload continuity matters most. A null payload is a LEGAL agent
557
557
  * input, so the failure is silent: the agent regenerates from scratch instead of modifying.
558
558
  *
559
- * Two reads: the agent's replies, then their newest Output version. Versions carry
560
- * `__mj_CreatedAt`, so "newest" is expressible without joining back for `Sequence`.
559
+ * Three RLS-safe reads: the agent's replies, their Output link rows, then their newest
560
+ * version. Versions carry `__mj_CreatedAt`, so "newest" is expressible without joining back
561
+ * for `Sequence`.
561
562
  *
562
563
  * @param historyFrom The chat's history floor. When set, only artifacts on replies written at
563
564
  * or after it count: a run that may not read earlier messages must not pick up their work
@@ -571,13 +572,14 @@ ${compactHistory}${artifactContext}
571
572
  }
572
573
  /**
573
574
  * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced on one
574
- * conversation path, in messages no rerun replaced, or null when the agent has no such reply
575
- * there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts} so
576
- * the two can never disagree about what "this agent's artifacts" means.
575
+ * conversation path, in messages no rerun replaced, or null when the agent has no such
576
+ * output there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts}
577
+ * so the two can never disagree about what "this agent's artifacts" means.
577
578
  *
578
- * The replies are read with their own RunView ({@link agentReplyIds}), so the row-level
579
- * security on conversation messages applies. A subquery over their view would skip it, and the
580
- * server refuses one for a user whose read of messages is row-filtered.
579
+ * Both the replies (`MJ: Conversation Details`) and their output links
580
+ * (`MJ: Conversation Detail Artifacts`) are read with their own `RunView` calls so
581
+ * row-level security applies to each entity and `ClientClauseScreen` never refuses a
582
+ * base-view subquery on row-filtered conversation tables.
581
583
  */
582
584
  async agentOutputVersionFilter(conversationId, agentId, historyFrom, branchId) {
583
585
  const replyIds = await this.agentReplyIds(conversationId, agentId, historyFrom, branchId);
@@ -585,10 +587,31 @@ ${compactHistory}${artifactContext}
585
587
  return null;
586
588
  }
587
589
  const inReplies = replyIds.map(id => `'${EscapeSQLString(id)}'`).join(',');
588
- return `ID IN (
589
- SELECT ArtifactVersionID FROM [__mj].[vwConversationDetailArtifacts]
590
- WHERE Direction='Output' AND ConversationDetailID IN (${inReplies})
591
- )`;
590
+ const rv = RunView.FromMetadataProvider(this.Provider);
591
+ const linkResult = await rv.RunView({
592
+ EntityName: 'MJ: Conversation Detail Artifacts',
593
+ ExtraFilter: `Direction='Output' AND ConversationDetailID IN (${inReplies})`,
594
+ Fields: ['ArtifactVersionID'],
595
+ ResultType: 'simple',
596
+ IgnoreMaxRows: true
597
+ }, this.Provider.CurrentUser ?? undefined);
598
+ if (!linkResult.Success) {
599
+ console.error('Failed to load agent output artifact links:', linkResult.ErrorMessage);
600
+ return null;
601
+ }
602
+ const seenVersionIds = new UUIDSet();
603
+ const versionIds = [];
604
+ for (const row of linkResult.Results || []) {
605
+ const versionId = row.ArtifactVersionID?.trim();
606
+ if (versionId && !seenVersionIds.Has(versionId)) {
607
+ seenVersionIds.Add(versionId);
608
+ versionIds.push(versionId);
609
+ }
610
+ }
611
+ if (versionIds.length === 0) {
612
+ return null;
613
+ }
614
+ return `ID IN (${versionIds.map(id => `'${EscapeSQLString(id)}'`).join(',')})`;
592
615
  }
593
616
  /**
594
617
  * IDs of the agent's replies on one conversation path, in messages no rerun replaced, written
@@ -649,7 +672,7 @@ ${compactHistory}${artifactContext}
649
672
  * artifact maps.
650
673
  */
651
674
  async FindArtifactVersionById(versionId) {
652
- return this.runPayloadSourceQuery(`ID='${versionId}'`, undefined);
675
+ return this.runPayloadSourceQuery(`ID='${EscapeSQLString(versionId)}'`, undefined);
653
676
  }
654
677
  /**
655
678
  * Shared read behind {@link FindLatestAgentOutputVersion} and {@link FindArtifactVersionById}.
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-agent.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAqB,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAuB,eAAe,EAAkF,MAAM,sCAAsC,CAAC;AAC5K,OAAO,EAAsD,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAClI,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EACL,kBAAkB,EAInB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGrE,OAAO,EACL,uBAAuB,EAExB,MAAM,iCAAiC,CAAC;;;;;AAEzC;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,EAAE,CAAC;AA4DvC;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,MAAM,OAAO,wBAAwB;IAoBzB;IAnBV,2GAA2G;IACnG,SAAS,GAA2B,IAAI,CAAC;IACjD,2EAA2E;IACnE,yBAAyB,GAAmC,IAAI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AoB,CAAC,GAAG,CAAC,OAAO,CAAC;SAC3C,CAAC;IACJ,CAAC;kHAnzBU,wBAAwB;gEAAxB,wBAAwB,WAAxB,wBAAwB,mBAFvB,MAAM;;iFAEP,wBAAwB;cAHpC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;AAwzBD;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,OAAkC;IAC9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { LogStatusEx, Metadata, IMetadataProvider, RunView, UserInfo } from '@memberjunction/core';\nimport { GraphQLDataProvider, GraphQLAIClient, type RunDecisionParams, type RunDecisionResult, type AgentReplyAcknowledgement } from '@memberjunction/graphql-dataprovider';\nimport { ExecuteAgentResult, AgentExecutionProgressCallback, coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';\nimport { AIEngineBase, FindMentionPinnedPresetID } from '@memberjunction/ai-engine-base';\nimport {\n ConversationEngine,\n MJConversationDetailEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity\n} from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended } from '@memberjunction/ai-core-plus';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { RunAgentFromConversationDetailParams } from '@memberjunction/ai-agent-client';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\nimport { LazyArtifactInfo } from '../models/lazy-artifact-info';\nimport { MentionParserService } from './mention-parser.service';\nimport { EscapeSQLString, UUIDsEqual } from '@memberjunction/global';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\nimport {\n GroupVersionsByArtifact,\n type AgentArtifactSummary\n} from '../utils/agent-artifact-summary';\n\n/**\n * Cap on artifact versions listed for the intent classifier.\n *\n * The block is a hint, not a record: the prompt prints a name, a type, a version count and\n * the latest version per artifact. Newest-first ordering means the cap only ever trims the\n * oldest versions of the busiest artifacts, which are the least useful lines in it.\n */\nconst MAX_AGENT_ARTIFACT_VERSIONS = 40;\n\n/**\n * Context for artifact lookups — pre-loaded conversation data.\n *\n * NO LONGER CONSUMED by this service. Both readers were converted to queries when transcript\n * windowing made these maps a partial view: they are keyed to the loaded window, so any\n * lookup for an older row silently missed. Retained as an exported type for API\n * compatibility; new code should not build one.\n */\nexport interface ArtifactLookupContext {\n agentRunsByDetailId: Map<string, MJAIAgentRunEntityExtended>;\n artifactsByDetailId: Map<string, LazyArtifactInfo[]>;\n}\n\n/**\n * An agent's prior OUTPUT artifact, resolved for payload continuity.\n *\n * `payload` is the parsed `ArtifactVersion.Content`, typed to match what actually consumes it\n * — `executeAgentContinuation` and `invokeSubAgent` both take `Record<string, unknown> | null`.\n * It is null when the version carried no content, the content did not parse, or the content\n * parsed to something that is not a JSON object; callers treat all three the same as \"no prior\n * artifact\", which is already a legal agent input.\n */\nexport interface AgentPayloadSource {\n artifactId: string;\n versionId: string;\n versionNumber: number;\n payload: Record<string, unknown> | null;\n}\n\n/**\n * Result from intent check - indicates whether to continue with agent\n * and which artifact version to use as payload\n */\nexport interface IntentCheckResult {\n decision: 'YES' | 'NO' | 'UNSURE';\n reasoning: string;\n targetArtifactVersionId?: string;\n}\n\n/**\n * Where a sub-agent's reply sits in the conversation. The server sets it (only the server writes agent replies), from\n * these checked inputs.\n */\nexport interface SubAgentThreading {\n /** The message the reply threads under, when not the user's message (a delegate's reply sits under the manager's). */\n ReplyParentId?: string | null;\n /**\n * An agent (the conversation manager) whose line \"Continuing with **{agent}** for refinement...\" the server posts\n * before the reply; the reply threads under it.\n */\n AnnouncedByAgentId?: string | null;\n /**\n * The branch the turn runs on when it forks off an earlier message on another branch (such as Regenerate, which\n * creates a new fork before running the agent while the user's message stays on its original branch).\n */\n ReplyBranchId?: string | null;\n}\n\n/**\n * Angular DI service for conversation-level agent orchestration.\n *\n * After PR 2 of the conversations-runtime extraction, the core\n * `processMessage` flow and the conversation-manager-agent resolution are\n * delegated to `@memberjunction/conversations-runtime`. This service is\n * primarily a shim for those operations PLUS the holder of the helpers\n * that haven't been ported yet:\n *\n * - `invokeSubAgent(...)` — used by Sage's routing decisions in\n * `message-input.component`.\n * - `checkAgentContinuityIntent(...)` — fast intent classification when the\n * user replies to a previous-agent thread.\n * - `FindConfigurationPresetForAgent(...)` — locates an agent's preset\n * from prior @mentions in the conversation.\n * - `clearSession(...)` — per-conversation session-id bookkeeping.\n *\n * These can move to the runtime in a follow-up; they aren't strictly needed\n * to invoke an agent end-to-end and stay here so the shim has zero behavior\n * difference vs. the original.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAgentService {\n /** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */\n private _aiClient: GraphQLAIClient | null = null;\n /** Cached resolution of the conversation manager agent (default agent). */\n private _conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n private _sessionIds: Map<string, string> = new Map();\n\n /** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */\n public readonly IsProcessing$: Observable<boolean>;\n\n /** @deprecated Use {@link IsProcessing$}. */\n public get isProcessing$(): Observable<boolean> {\n return this.IsProcessing$;\n }\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(\n _bootstrap: ConversationsRuntimeBootstrap,\n _mentionParser: MentionParserService,\n private agentClientService: AgentClientService\n ) {\n // Injecting `_bootstrap` forces the runtime's INotificationAdapter +\n // IActiveTaskTracker adapters to register before any shim method runs.\n this.IsProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;\n this.initializeAIClient();\n }\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it re-initializes the AI client and forwards the provider to the runtime's runner.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n this.initializeAIClient();\n ConversationsRuntime.Instance.AgentRunner.Provider = value;\n }\n\n /**\n * Initialize the GraphQL AI Client.\n * Retained for RunAIPrompt calls (intent checking) which the AgentClientService doesn't wrap.\n * Agent execution (RunAIAgentFromConversationDetail) now goes through ConversationsRuntime.AgentRunner.\n */\n private initializeAIClient(): void {\n try {\n const provider = this.Provider as GraphQLDataProvider;\n if (provider) {\n this._aiClient = new GraphQLAIClient(provider);\n } else {\n console.warn('GraphQLDataProvider not available, agent functionality will be limited');\n }\n } catch (error) {\n console.error('Failed to initialize GraphQL AI Client:', error);\n }\n }\n\n /**\n * Resolve the conversation manager agent via the runtime's 4-step\n * DefaultAgentResolver chain (explicit input → app-scoped Application\n * Setting → global Application Setting → code-const Sage fallback). The\n * result is cached on this service for use by the synchronous\n * {@link ConversationManagerAgentName} getter.\n *\n * Existing callers expect a Promise<MJAIAgentEntityExtended | null> — we\n * preserve that shape (returning null on failure rather than throwing)\n * so the call sites don't need to change.\n */\n public async GetConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n if (this._conversationManagerAgent) {\n return this._conversationManagerAgent;\n }\n // A user who may not read the agents has no manager agent to resolve: say nothing, rather than an error for a state\n // that is theirs by design (MJ#5240)\n if (AIEngineBase.Instance.IsPermissionConstrained && AIEngineBase.Instance.ReadableAgents.length === 0) {\n return null;\n }\n\n try {\n const provider = this.Provider;\n const agent = await ConversationsRuntime.Instance.DefaultAgent.resolve({\n contextUser: provider.CurrentUser ?? undefined,\n provider,\n });\n this._conversationManagerAgent = agent;\n return agent;\n } catch (error) {\n const errorMsg = 'Error resolving conversation manager agent: ' + (error instanceof Error ? error.message : String(error));\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n }\n\n /** @deprecated Use {@link GetConversationManagerAgent}. */\n public async getConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n return this.GetConversationManagerAgent();\n }\n\n /**\n * Synchronous read of the cached conversation-manager-agent name. Returns\n * `null` until {@link getConversationManagerAgent} has been called at least\n * once and resolved successfully. Used by `MessageItemComponent.isConversationManager`\n * to flag messages from the routing agent without hardcoding `'Sage'`.\n */\n public get ConversationManagerAgentName(): string | null {\n return this._conversationManagerAgent?.Name ?? null;\n }\n\n /**\n * Returns `true` if the supplied agent identifier (UUID or name) matches the\n * currently cached conversation manager agent. Robust to either input.\n */\n public IsConversationManagerAgent(agentIdOrName: string | null | undefined): boolean {\n if (!agentIdOrName || !this._conversationManagerAgent) return false;\n return (\n UUIDsEqual(this._conversationManagerAgent.ID, agentIdOrName) ||\n this._conversationManagerAgent.Name === agentIdOrName\n );\n }\n\n /**\n * Process a message through the conversation manager agent. Delegates to\n * `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.\n *\n * The unused `conversationHistory` parameter is kept for backwards compatibility (it was already\n * documented as \"kept for backwards compatibility but not used\" in the original).\n *\n * @param onReplyAccepted Called with the reply row the server creates for the turn (only the server\n * writes agent replies), before any progress: key the turn's task and completion by its ID.\n */\n async ProcessMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The agents the conversation manager may delegate to. Null or omitted allows every agent. */\n allowedAgentIDs?: readonly string[] | null,\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null,\n /** The branch the turn runs on when it forks off an earlier message on another branch. */\n replyBranchId?: string | null\n ): Promise<ExecuteAgentResult | null> {\n // Warm the cached default-agent name for any synchronous consumers\n // before the runtime resolves on its own.\n if (!this._conversationManagerAgent) {\n await this.GetConversationManagerAgent();\n }\n return ConversationsRuntime.Instance.AgentRunner.processMessage({\n conversationId,\n message,\n onReplyAccepted,\n appContext,\n onProgress,\n ...(planMode ? { planMode: true } : {}),\n ...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),\n ...(allowedAgentIDs != null ? { AllowedAgentIDs: allowedAgentIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n ...(replyBranchId ? { ReplyBranchID: replyBranchId } : {}),\n });\n }\n\n /** @deprecated Use {@link ProcessMessage}. */\n async processMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n allowedAgentIDs?: readonly string[] | null,\n agentHistoryFrom?: Date | null,\n replyBranchId?: string | null\n ): Promise<ExecuteAgentResult | null> {\n return this.ProcessMessage(conversationId, message, conversationHistory, onReplyAccepted, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom, replyBranchId);\n }\n\n /**\n * Configuration preset an agent was pinned to by a previous `@mention` in this conversation.\n *\n * Resolved by QUERY, not by scanning the display array. The pinning `@mention` is normally\n * the FIRST message of an exchange and everything after it is follow-up, so it is the\n * message most likely to fall below the loaded transcript window — and `undefined` is a\n * legal value for `configurationPresetId`, so the miss is silent. The visible consequence\n * is a run executed under the default configuration (a different model tier) instead of the\n * one the user explicitly chose, with a plausible-looking result and no error.\n *\n * There is no column to filter on: the preset lives inside the message body as a JSON\n * mention blob (`@{\"type\":\"agent\",\"id\":\"…\",\"configId\":\"…\"}`). So SQL narrows and the parser\n * decides — both `configId` and the agent id appear verbatim in that blob, which makes the\n * two LIKEs a tight prefilter, and `parseMentions` is what actually confirms a match.\n *\n * @param branchId The active branch. Only messages on its path count; null or omitted reads\n * the trunk.\n */\n public async FindConfigurationPresetForAgent(\n conversationId: string,\n agentId: string,\n branchId?: string | null\n ): Promise<string | undefined> {\n const configurationId = await FindMentionPinnedPresetID(\n conversationId,\n agentId,\n branchId,\n this.Provider.CurrentUser ?? undefined,\n this.Provider\n );\n if (configurationId) {\n console.log(`\\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);\n }\n return configurationId;\n }\n\n\n\n /**\n * Clear the session for a conversation (useful when starting a new topic)\n */\n ClearSession(conversationId: string): void {\n this._sessionIds.delete(conversationId);\n }\n\n /** @deprecated Use {@link ClearSession}. */\n clearSession(conversationId: string): void {\n return this.ClearSession(conversationId);\n }\n\n /**\n * Surfaces a warning toast when the user requested skills (via /skill mentions) that the\n * target agent cannot activate — the server drops such requests, and without this the\n * refusal is invisible to the user. Client-side check uses the agent gate only (the server\n * additionally intersects with the user's Run permission).\n */\n private warnOnUnacceptedSkills(agent: MJAIAgentEntityExtended, requestedSkillIDs: string[]): void {\n const allowed = AIEngineBase.Instance.GetSkillsForAgent(agent);\n const dropped = requestedSkillIDs.filter(id => !allowed.some(s => UUIDsEqual(s.ID, id)));\n if (dropped.length === 0) return;\n const names = dropped.map(\n id => AIEngineBase.Instance.Skills.find(s => UUIDsEqual(s.ID, id))?.Name ?? 'requested skill'\n );\n const reason = agent.AcceptsSkills === 'None'\n ? `${agent.Name} doesn't accept skills`\n : `${agent.Name} can't activate ${names.length === 1 ? 'this skill' : 'these skills'}`;\n MJNotificationService.Instance?.CreateSimpleNotification(\n `${reason} — ${names.join(', ')} won't be used for this run.`,\n 'warning',\n 6000\n );\n }\n\n /**\n * Invoke a sub-agent based on Sage Agent's payload.\n * This is called when Sage decides to delegate to a specialist agent.\n *\n * Stays on the Angular shim because it directly uses AgentClientService.\n * Could move to the runtime in a follow-up if needed.\n *\n * @param onReplyAccepted Called with the reply row the server creates for the run (only the server\n * writes agent replies), before any progress: key the run's task and completion by its ID.\n */\n async InvokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null,\n /** Where the reply sits in the conversation. Omitted, it answers `message` directly. */\n threading?: SubAgentThreading | null\n ): Promise<ExecuteAgentResult | null> {\n try {\n // Ensure AIEngineBase is configured\n await AIEngineBase.Instance.Config(false);\n\n // Find the agent by name\n const agent = AIEngineBase.Instance.ReadableAgents.find(a => a.Name === agentName);\n\n if (!agent || !agent.ID) {\n const errorMsg = `Sub-agent \"${agentName}\" not found`;\n console.warn(`${errorMsg}`);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n\n if (requestedSkillIDs?.length) {\n this.warnOnUnacceptedSkills(agent, requestedSkillIDs);\n }\n\n LogStatusEx({\n message: `Invoking sub-agent: ${agentName}`,\n verboseOnly: true,\n additionalArgs: [{ reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId }]\n });\n\n // Map AIAgentConfiguration preset ID to actual AIConfiguration ID\n let aiConfigurationId: string | undefined = undefined;\n if (agentConfigurationPresetId) {\n const presets = AIEngineBase.Instance.GetAgentConfigurationPresets(agent.ID, false);\n const preset = presets.find(p => UUIDsEqual(p.ID, agentConfigurationPresetId) || UUIDsEqual(p.AIConfigurationID, agentConfigurationPresetId));\n\n if (preset) {\n aiConfigurationId = preset.AIConfigurationID || undefined;\n LogStatusEx({ message: `Mapped agent configuration preset \"${preset.Name}\" to AIConfigurationID: ${aiConfigurationId || 'default'}`, verboseOnly: true });\n } else {\n console.warn(`Agent configuration preset ${agentConfigurationPresetId} not found for agent ${agent.ID}`);\n }\n }\n\n const agentParams: RunAgentFromConversationDetailParams = {\n UserMessageId: message.ID,\n OnAccepted: onReplyAccepted,\n ...(threading?.ReplyParentId ? { ReplyParentId: threading.ReplyParentId } : {}),\n ...(threading?.AnnouncedByAgentId ? { AnnouncedByAgentId: threading.AnnouncedByAgentId } : {}),\n ...(threading?.ReplyBranchId ? { ReplyBranchId: threading.ReplyBranchId } : {}),\n AgentId: agent.ID,\n MaxHistoryMessages: 20,\n Data: {\n conversationId: conversationId,\n latestMessageId: message.ID,\n invocationReason: reasoning,\n ...(appContext ? { appContext } : {}),\n },\n ...(payload ? { Payload: payload } : {}),\n ...(aiConfigurationId ? { ConfigurationId: aiConfigurationId } : {}),\n ...(planMode ? { PlanMode: true } : {}),\n ...(requestedSkillIDs?.length ? { RequestedSkillIDs: requestedSkillIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n CreateArtifacts: true,\n CreateNotification: true,\n SourceArtifactId: sourceArtifactId,\n SourceArtifactVersionId: sourceArtifactVersionId,\n OnProgress: onProgress ? (progress) => {\n onProgress({\n step: progress.CurrentStep as 'initialization' | 'validation' | 'prompt_execution' | 'action_execution' | 'subagent_execution' | 'decision_processing' | 'finalization',\n percentage: progress.Percentage,\n message: progress.Message,\n metadata: progress.Metadata\n });\n } : undefined\n };\n\n const runResult = await this.agentClientService.RunAgentFromConversationDetail(agentParams);\n\n if (runResult.Success && runResult.Result) {\n return runResult.Result as ExecuteAgentResult;\n }\n\n const failed = coerceFailedExecuteAgentResult(\n runResult.Result as ExecuteAgentResult | null | undefined,\n runResult.ErrorMessage || `Sub-agent \"${agentName}\" failed`,\n );\n const errorMsg = `Sub-agent \"${agentName}\" failed: ${failed.errorMessage}`;\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return failed;\n } catch (error) {\n const errorMsg = `Error invoking sub-agent \"${agentName}\": ` + (error instanceof Error ? error.message : String(error));\n console.error(`Error invoking sub-agent \"${agentName}\":`, error);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return coerceFailedExecuteAgentResult<ExecuteAgentResult>(undefined, errorMsg);\n }\n }\n\n /** @deprecated Use {@link InvokeSubAgent}. */\n async invokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n agentHistoryFrom?: Date | null,\n threading?: SubAgentThreading | null\n ): Promise<ExecuteAgentResult | null> {\n return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, onReplyAccepted, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom, threading);\n }\n\n /**\n * Check if user's latest message should continue with the previous agent or route through Sage.\n * Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.\n *\n * Stays on the Angular shim because it directly uses GraphQLAIClient.\n * Could move to the runtime in a follow-up.\n *\n * @param branchId The active branch. Only the agent's artifacts on its path are listed for the\n * classifier; null or omitted reads the trunk.\n */\n async CheckAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[],\n branchId?: string | null\n ): Promise<IntentCheckResult> {\n if (!this._aiClient) {\n console.warn('AI Client not initialized, defaulting to UNSURE for intent check');\n return { decision: 'UNSURE', reasoning: 'AI Client not initialized' };\n }\n\n try {\n await AIEngineBase.Instance.Config(false);\n const prompt = AIEngineBase.Instance.Prompts.find(p => p.Name === 'Check Sage Intent');\n if (!prompt) {\n console.warn('⚠️ Check Sage Intent prompt not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Check Sage Intent prompt not found' };\n }\n\n const agent = AIEngineBase.Instance.ReadableAgents.find(a => UUIDsEqual(a.ID, agentId));\n if (!agent) {\n console.warn('⚠️ Previous agent not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Previous agent not found' };\n }\n\n // Queried, not read off the caller's window-scoped maps — see findAllAgentArtifacts.\n // `conversationHistory` below is still the window on purpose: the `.slice(-10)` wants\n // the most recent exchange, which the loaded tail always contains.\n const agentArtifacts = await this.findAllAgentArtifacts(conversationId, agentId, undefined, branchId);\n\n const recentHistory = conversationHistory.slice(-10);\n const compactHistory = recentHistory.map((msg, idx) => {\n const role = msg.Role === 'User' ? 'User' : agent.Name || 'Agent';\n const content = msg.Message || '';\n return `${idx + 1}. ${role}: ${content.substring(0, 150)}${content.length > 150 ? '...' : ''}`;\n }).join('\\n');\n\n let artifactContext = '';\n if (agentArtifacts.length > 0) {\n artifactContext = '\\n\\n**Prior Artifacts Created by This Agent**:\\n';\n agentArtifacts.forEach((artifact, idx) => {\n artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.ArtifactType})\\n`;\n artifactContext += ` - Versions: ${artifact.Versions.length}\\n`;\n if (artifact.Versions.length > 0) {\n artifactContext += ` - Latest: v${artifact.Versions[0].versionNumber}`;\n if (artifact.Versions[0].versionName) {\n artifactContext += ` - ${artifact.Versions[0].versionName}`;\n }\n artifactContext += '\\n';\n }\n });\n }\n\n const userMessage = `**Previous Agent**: ${agent.Name} - ${agent.Description || 'No description'}\n\n**Conversation History** (last ${recentHistory.length} messages):\n${compactHistory}${artifactContext}\n\n**Latest User Message**: \"${latestMessage}\"`;\n\n LogStatusEx({\n message: '🔍 Checking agent continuity intent...',\n verboseOnly: true,\n additionalArgs: [{\n agentName: agent.Name,\n messagePreview: latestMessage.substring(0, 50),\n artifactCount: agentArtifacts.length\n }]\n });\n\n const result = await this._aiClient.RunAIPrompt({\n promptId: prompt.ID,\n messages: [{ role: 'user', content: userMessage }],\n data: {\n hasPriorArtifact: agentArtifacts.length > 0,\n priorArtifacts: agentArtifacts\n }\n });\n\n if (result && result.success && (result.parsedResult || result.output)) {\n const parsed = result.parsedResult ||\n (result.output ? JSON.parse(result.output) : null);\n\n if (parsed && parsed.continuesWith) {\n const decision = parsed.continuesWith.toUpperCase();\n const reasoning = parsed.reasoning || 'No reasoning provided';\n const targetArtifactVersionId = parsed.targetArtifactVersionId || undefined;\n\n LogStatusEx({\n message: `✅ Intent check result: ${decision}`,\n verboseOnly: true,\n additionalArgs: [{\n reasoning,\n targetArtifactVersionId,\n latency: result.executionTimeMs || 'unknown'\n }]\n });\n\n if (decision === 'YES' || decision === 'NO' || decision === 'UNSURE') {\n return {\n decision: decision as 'YES' | 'NO' | 'UNSURE',\n reasoning,\n targetArtifactVersionId\n };\n }\n }\n }\n\n console.warn('⚠️ Intent check failed or returned invalid format, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Invalid format from intent check prompt' };\n } catch (error) {\n console.error('❌ Error checking agent continuity intent:', error);\n return {\n decision: 'UNSURE',\n reasoning: `Error during intent check: ${error instanceof Error ? error.message : String(error)}`\n };\n }\n }\n\n /** @deprecated Use {@link CheckAgentContinuityIntent}. */\n async checkAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[],\n branchId?: string | null\n ): Promise<IntentCheckResult> {\n return this.CheckAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory, branchId);\n }\n\n /**\n * Runs a typed decision on the server in one round trip, through\n * {@link GraphQLAIClient.RunDecision}. Decision routing (`EnableDecisionRouting`) asks its\n * routing questions here.\n *\n * Never throws: without an AI client, or on any failure, it resolves with `Success: false` and\n * no answers.\n */\n public async RunDecision(params: RunDecisionParams): Promise<RunDecisionResult> {\n if (!this._aiClient) {\n return { Success: false, ErrorMessage: 'AI Client not initialized', Answers: {} };\n }\n return this._aiClient.RunDecision(params);\n }\n\n /**\n * Every artifact this agent produced on the active branch path, newest version first, for\n * decision routing's artifact question. Resolved by query, as {@link findAllAgentArtifacts} explains.\n *\n * @param historyFrom The chat's history floor. When set, only artifacts on replies written at or\n * after it count, as with {@link FindLatestAgentOutputVersion}.\n * @param branchId The active branch. Only artifacts on its path count, as with\n * {@link FindLatestAgentOutputVersion}; null or omitted reads the trunk.\n */\n public async FindAgentArtifacts(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentArtifactSummary[]> {\n return this.findAllAgentArtifacts(conversationId, agentId, historyFrom, branchId);\n }\n\n /**\n * Every artifact this agent produced on the active branch path, newest version first —\n * resolved by QUERY, not by scanning the display array.\n *\n * The scan this replaces walked `conversationDetails` and looked each row up in the\n * caller's `artifactsByDetailId` / `agentRunsByDetailId` maps. Both are scoped to the\n * LOADED WINDOW, so under transcript windowing it saw only the artifacts attached to the\n * page currently on screen.\n *\n * That matters because this list is the \"Prior Artifacts Created by This Agent\" block fed\n * to the Check Sage Intent prompt, which is what produces `targetArtifactVersionId`. A\n * truncated list does not make the classifier fail — it makes it reason over a partial\n * history and confidently name the wrong version, or miss continuity altogether. Silent,\n * plausible, and wrong: the same failure class as {@link FindLatestAgentOutputVersion},\n * closed the same way.\n *\n * Three reads: the agent's replies, their Output versions, and the artifacts' names. See\n * {@link AgentArtifactSummary} for why dropping `runId` removes the join back to agent runs.\n *\n * @param historyFrom The chat's history floor, when set (see {@link FindAgentArtifacts}).\n * @param branchId The branch whose path to read; null or omitted reads the trunk.\n */\n private async findAllAgentArtifacts(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentArtifactSummary[]> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Name'>;\n const versionFilter = await this.agentOutputVersionFilter(conversationId, agentId, historyFrom, branchId);\n if (!versionFilter) {\n return []; // the classifier degrades to no artifact context\n }\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const versionResult = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: versionFilter,\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: MAX_AGENT_ARTIFACT_VERSIONS,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Name'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!versionResult.Success) {\n console.error('Failed to load agent artifact versions:', versionResult.ErrorMessage);\n return []; // the classifier degrades to no artifact context\n }\n const versions = versionResult.Results || [];\n if (versions.length === 0) {\n return [];\n }\n\n const artifactsById = await this.loadArtifactNames(\n [...new Set(versions.map(v => v.ArtifactID))]\n );\n return GroupVersionsByArtifact(versions, artifactsById);\n }\n\n /** Names and types for the artifacts behind a set of versions. */\n private async loadArtifactNames(\n artifactIds: string[]\n ): Promise<Map<string, Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>>> {\n type ArtifactRow = Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<ArtifactRow>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIds.map(id => `'${id}'`).join(',')})`,\n Fields: ['ID', 'Name', 'Type'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent artifacts:', result.ErrorMessage);\n return new Map<string, ArtifactRow>();\n }\n return new Map((result.Results || []).map(a => [a.ID, a]));\n }\n\n /**\n * Newest OUTPUT artifact version an agent produced in this conversation — resolved by\n * QUERY, not by scanning the display array.\n *\n * The array scan this replaces was correct only while `conversationHistory` held the whole\n * conversation. Under transcript windowing it holds one page, so the scan silently returns\n * null for any artifact below the window's oldest row — exactly the long \"modify this\n * again\" exchanges where payload continuity matters most. A null payload is a LEGAL agent\n * input, so the failure is silent: the agent regenerates from scratch instead of modifying.\n *\n * Two reads: the agent's replies, then their newest Output version. Versions carry\n * `__mj_CreatedAt`, so \"newest\" is expressible without joining back for `Sequence`.\n *\n * @param historyFrom The chat's history floor. When set, only artifacts on replies written at\n * or after it count: a run that may not read earlier messages must not pick up their work\n * as its payload either.\n * @param branchId The active branch. Only replies on its path count, so an artifact made on\n * another branch is never the latest here; null or omitted reads the trunk.\n */\n public async FindLatestAgentOutputVersion(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentPayloadSource | null> {\n const versionFilter = await this.agentOutputVersionFilter(conversationId, agentId, historyFrom, branchId);\n return versionFilter ? this.runPayloadSourceQuery(versionFilter, '__mj_CreatedAt DESC') : null;\n }\n\n /**\n * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced on one\n * conversation path, in messages no rerun replaced, or null when the agent has no such reply\n * there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts} so\n * the two can never disagree about what \"this agent's artifacts\" means.\n *\n * The replies are read with their own RunView ({@link agentReplyIds}), so the row-level\n * security on conversation messages applies. A subquery over their view would skip it, and the\n * server refuses one for a user whose read of messages is row-filtered.\n */\n private async agentOutputVersionFilter(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<string | null> {\n const replyIds = await this.agentReplyIds(conversationId, agentId, historyFrom, branchId);\n if (replyIds.length === 0) {\n return null;\n }\n const inReplies = replyIds.map(id => `'${EscapeSQLString(id)}'`).join(',');\n return `ID IN (\n SELECT ArtifactVersionID FROM [__mj].[vwConversationDetailArtifacts]\n WHERE Direction='Output' AND ConversationDetailID IN (${inReplies})\n )`;\n }\n\n /**\n * IDs of the agent's replies on one conversation path, in messages no rerun replaced, written\n * at or after the history floor when one is set. Empty when the path cannot be built\n * ({@link branchPathFilter}) or the read fails.\n *\n * Filters on the DETAIL's `Status <> 'Error'` rather than the agent run's\n * `Status = 'Completed'` (which is what the array scan this replaced used). Doing it on the\n * run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the\n * detail already carries.\n */\n private async agentReplyIds(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<string[]> {\n const pathFilter = await this.branchPathFilter(conversationId, branchId);\n if (pathFilter == null) {\n return [];\n }\n const floor = historyFrom ? ` AND ${ConversationEngine.HistoryFromFilter(historyFrom)}` : '';\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<Pick<MJConversationDetailEntity, 'ID'>>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `${ConversationEngine.LiveRowsFilter(pathFilter)} AND AgentID='${EscapeSQLString(agentId)}'` +\n ` AND Role='AI' AND Status <> 'Error'${floor}`,\n Fields: ['ID'],\n ResultType: 'simple',\n IgnoreMaxRows: true\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent replies:', result.ErrorMessage);\n return [];\n }\n return (result.Results || []).map(reply => reply.ID);\n }\n\n /**\n * The SQL predicate for one branch's path in a conversation, from\n * `ConversationEngine.BranchPathFilterFresh`. A null or omitted branch is the trunk and costs\n * no query.\n *\n * Never throws. When the path cannot be built (the branch rows fail to load, or the branch is\n * not among them), it logs the error and returns null. Each lookup then returns its own\n * failure value, as it does when its main query fails. A caller must not fall back to the\n * trunk predicate: on a branch, that reads trunk rows past the fork point.\n */\n private async branchPathFilter(conversationId: string, branchId: string | null | undefined): Promise<string | null> {\n try {\n const user = this.Provider.CurrentUser ?? undefined;\n return await ConversationEngine.BranchPathFilterFresh(conversationId, branchId, user as UserInfo, this.Provider);\n } catch (error) {\n console.error(`Failed to build the path of branch ${branchId} in conversation ${conversationId}:`, error);\n return null;\n }\n }\n\n /**\n * One artifact version by ID, as a payload source.\n *\n * Used by the continuity path after the intent check names a specific version: that ID may\n * belong to a message below the loaded window, so it cannot be resolved from the window's\n * artifact maps.\n */\n public async FindArtifactVersionById(versionId: string): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(`ID='${versionId}'`, undefined);\n }\n\n /**\n * Shared read behind {@link FindLatestAgentOutputVersion} and {@link FindArtifactVersionById}.\n *\n * `ResultType: 'simple'` with an explicit `Fields` list: nothing here is mutated, and under\n * `entity_object` the `Fields` narrowing would be silently discarded by `PreRunView`.\n */\n private async runPayloadSourceQuery(\n extraFilter: string,\n orderBy: string | undefined\n ): Promise<AgentPayloadSource | null> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Content'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: extraFilter,\n OrderBy: orderBy,\n MaxRows: 1,\n SkipTotalRowCount: true,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Content'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve agent payload source:', result.ErrorMessage);\n return null;\n }\n const row = result.Results?.[0];\n if (!row) {\n return null;\n }\n return {\n artifactId: row.ArtifactID,\n versionId: row.ID,\n versionNumber: row.VersionNumber,\n payload: parseArtifactContent(row.Content)\n };\n }\n\n}\n\n/**\n * Parses an artifact version's `Content` into an agent payload. Returns null rather than\n * throwing — a malformed artifact must not take down the send path, and \"no payload\" is\n * already a legal agent input.\n *\n * A payload must be a JSON OBJECT. Valid JSON that parses to an array, string, or number is\n * rejected for the same reason a parse failure is: every consumer spreads it or reads named\n * keys off it, so a non-object would satisfy the type at the boundary and misbehave deeper in.\n */\nfunction parseArtifactContent(content: string | null | undefined): Record<string, unknown> | null {\n if (!content) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(content);\n return isPayloadObject(parsed) ? parsed : null;\n } catch (error) {\n console.warn('Artifact version content did not parse as JSON:', error);\n return null;\n }\n}\n\n/** Narrows a parsed JSON value to a plain object — the only shape a payload may take. */\nfunction isPayloadObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
1
+ {"version":3,"file":"conversation-agent.service.js","sourceRoot":"","sources":["../../../src/lib/services/conversation-agent.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAqB,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAuB,eAAe,EAAkF,MAAM,sCAAsC,CAAC;AAC5K,OAAO,EAAsD,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAClI,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EACL,kBAAkB,EAKnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EACL,uBAAuB,EAExB,MAAM,iCAAiC,CAAC;;;;;AAEzC;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,EAAE,CAAC;AA4DvC;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,MAAM,OAAO,wBAAwB;IAoBzB;IAnBV,2GAA2G;IACnG,SAAS,GAA2B,IAAI,CAAC;IACjD,2EAA2E;IACnE,yBAAyB,GAAmC,IAAI,CAAC;I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CAAC;kHA50BU,wBAAwB;gEAAxB,wBAAwB,WAAxB,wBAAwB,mBAFvB,MAAM;;iFAEP,wBAAwB;cAHpC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;AAi1BD;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,OAAkC;IAC9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { LogStatusEx, Metadata, IMetadataProvider, RunView, UserInfo } from '@memberjunction/core';\nimport { GraphQLDataProvider, GraphQLAIClient, type RunDecisionParams, type RunDecisionResult, type AgentReplyAcknowledgement } from '@memberjunction/graphql-dataprovider';\nimport { ExecuteAgentResult, AgentExecutionProgressCallback, coerceFailedExecuteAgentResult } from '@memberjunction/ai-core-plus';\nimport { AIEngineBase, FindMentionPinnedPresetID } from '@memberjunction/ai-engine-base';\nimport {\n ConversationEngine,\n MJConversationDetailEntity,\n MJConversationDetailArtifactEntity,\n MJArtifactVersionEntity,\n MJArtifactEntity\n} from '@memberjunction/core-entities';\nimport { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended } from '@memberjunction/ai-core-plus';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { AgentClientService } from '@memberjunction/ng-agent-client';\nimport { RunAgentFromConversationDetailParams } from '@memberjunction/ai-agent-client';\nimport { ConversationsRuntime } from '@memberjunction/conversations-runtime';\nimport { LazyArtifactInfo } from '../models/lazy-artifact-info';\nimport { MentionParserService } from './mention-parser.service';\nimport { EscapeSQLString, UUIDSet, UUIDsEqual } from '@memberjunction/global';\n\nimport { ConversationsRuntimeBootstrap } from './conversations-runtime-bootstrap.service';\nimport {\n GroupVersionsByArtifact,\n type AgentArtifactSummary\n} from '../utils/agent-artifact-summary';\n\n/**\n * Cap on artifact versions listed for the intent classifier.\n *\n * The block is a hint, not a record: the prompt prints a name, a type, a version count and\n * the latest version per artifact. Newest-first ordering means the cap only ever trims the\n * oldest versions of the busiest artifacts, which are the least useful lines in it.\n */\nconst MAX_AGENT_ARTIFACT_VERSIONS = 40;\n\n/**\n * Context for artifact lookups — pre-loaded conversation data.\n *\n * NO LONGER CONSUMED by this service. Both readers were converted to queries when transcript\n * windowing made these maps a partial view: they are keyed to the loaded window, so any\n * lookup for an older row silently missed. Retained as an exported type for API\n * compatibility; new code should not build one.\n */\nexport interface ArtifactLookupContext {\n agentRunsByDetailId: Map<string, MJAIAgentRunEntityExtended>;\n artifactsByDetailId: Map<string, LazyArtifactInfo[]>;\n}\n\n/**\n * An agent's prior OUTPUT artifact, resolved for payload continuity.\n *\n * `payload` is the parsed `ArtifactVersion.Content`, typed to match what actually consumes it\n * — `executeAgentContinuation` and `invokeSubAgent` both take `Record<string, unknown> | null`.\n * It is null when the version carried no content, the content did not parse, or the content\n * parsed to something that is not a JSON object; callers treat all three the same as \"no prior\n * artifact\", which is already a legal agent input.\n */\nexport interface AgentPayloadSource {\n artifactId: string;\n versionId: string;\n versionNumber: number;\n payload: Record<string, unknown> | null;\n}\n\n/**\n * Result from intent check - indicates whether to continue with agent\n * and which artifact version to use as payload\n */\nexport interface IntentCheckResult {\n decision: 'YES' | 'NO' | 'UNSURE';\n reasoning: string;\n targetArtifactVersionId?: string;\n}\n\n/**\n * Where a sub-agent's reply sits in the conversation. The server sets it (only the server writes agent replies), from\n * these checked inputs.\n */\nexport interface SubAgentThreading {\n /** The message the reply threads under, when not the user's message (a delegate's reply sits under the manager's). */\n ReplyParentId?: string | null;\n /**\n * An agent (the conversation manager) whose line \"Continuing with **{agent}** for refinement...\" the server posts\n * before the reply; the reply threads under it.\n */\n AnnouncedByAgentId?: string | null;\n /**\n * The branch the turn runs on when it forks off an earlier message on another branch (such as Regenerate, which\n * creates a new fork before running the agent while the user's message stays on its original branch).\n */\n ReplyBranchId?: string | null;\n}\n\n/**\n * Angular DI service for conversation-level agent orchestration.\n *\n * After PR 2 of the conversations-runtime extraction, the core\n * `processMessage` flow and the conversation-manager-agent resolution are\n * delegated to `@memberjunction/conversations-runtime`. This service is\n * primarily a shim for those operations PLUS the holder of the helpers\n * that haven't been ported yet:\n *\n * - `invokeSubAgent(...)` — used by Sage's routing decisions in\n * `message-input.component`.\n * - `checkAgentContinuityIntent(...)` — fast intent classification when the\n * user replies to a previous-agent thread.\n * - `FindConfigurationPresetForAgent(...)` — locates an agent's preset\n * from prior @mentions in the conversation.\n * - `clearSession(...)` — per-conversation session-id bookkeeping.\n *\n * These can move to the runtime in a follow-up; they aren't strictly needed\n * to invoke an agent end-to-end and stay here so the shim has zero behavior\n * difference vs. the original.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class ConversationAgentService {\n /** GraphQL AI client - retained for RunAIPrompt (intent checking) which AgentClientService doesn't wrap */\n private _aiClient: GraphQLAIClient | null = null;\n /** Cached resolution of the conversation manager agent (default agent). */\n private _conversationManagerAgent: MJAIAgentEntityExtended | null = null;\n private _sessionIds: Map<string, string> = new Map();\n\n /** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */\n public readonly IsProcessing$: Observable<boolean>;\n\n /** @deprecated Use {@link IsProcessing$}. */\n public get isProcessing$(): Observable<boolean> {\n return this.IsProcessing$;\n }\n\n private _provider: IMetadataProvider | null = null;\n\n constructor(\n _bootstrap: ConversationsRuntimeBootstrap,\n _mentionParser: MentionParserService,\n private agentClientService: AgentClientService\n ) {\n // Injecting `_bootstrap` forces the runtime's INotificationAdapter +\n // IActiveTaskTracker adapters to register before any shim method runs.\n this.IsProcessing$ = ConversationsRuntime.Instance.AgentRunner.isProcessing$;\n this.initializeAIClient();\n }\n\n /**\n * The metadata provider this service uses. When unset, falls back to Metadata.Provider.\n * Setting it re-initializes the AI client and forwards the provider to the runtime's runner.\n */\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n this.initializeAIClient();\n ConversationsRuntime.Instance.AgentRunner.Provider = value;\n }\n\n /**\n * Initialize the GraphQL AI Client.\n * Retained for RunAIPrompt calls (intent checking) which the AgentClientService doesn't wrap.\n * Agent execution (RunAIAgentFromConversationDetail) now goes through ConversationsRuntime.AgentRunner.\n */\n private initializeAIClient(): void {\n try {\n const provider = this.Provider as GraphQLDataProvider;\n if (provider) {\n this._aiClient = new GraphQLAIClient(provider);\n } else {\n console.warn('GraphQLDataProvider not available, agent functionality will be limited');\n }\n } catch (error) {\n console.error('Failed to initialize GraphQL AI Client:', error);\n }\n }\n\n /**\n * Resolve the conversation manager agent via the runtime's 4-step\n * DefaultAgentResolver chain (explicit input → app-scoped Application\n * Setting → global Application Setting → code-const Sage fallback). The\n * result is cached on this service for use by the synchronous\n * {@link ConversationManagerAgentName} getter.\n *\n * Existing callers expect a Promise<MJAIAgentEntityExtended | null> — we\n * preserve that shape (returning null on failure rather than throwing)\n * so the call sites don't need to change.\n */\n public async GetConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n if (this._conversationManagerAgent) {\n return this._conversationManagerAgent;\n }\n // A user who may not read the agents has no manager agent to resolve: say nothing, rather than an error for a state\n // that is theirs by design (MJ#5240)\n if (AIEngineBase.Instance.IsPermissionConstrained && AIEngineBase.Instance.ReadableAgents.length === 0) {\n return null;\n }\n\n try {\n const provider = this.Provider;\n const agent = await ConversationsRuntime.Instance.DefaultAgent.resolve({\n contextUser: provider.CurrentUser ?? undefined,\n provider,\n });\n this._conversationManagerAgent = agent;\n return agent;\n } catch (error) {\n const errorMsg = 'Error resolving conversation manager agent: ' + (error instanceof Error ? error.message : String(error));\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n }\n\n /** @deprecated Use {@link GetConversationManagerAgent}. */\n public async getConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null> {\n return this.GetConversationManagerAgent();\n }\n\n /**\n * Synchronous read of the cached conversation-manager-agent name. Returns\n * `null` until {@link getConversationManagerAgent} has been called at least\n * once and resolved successfully. Used by `MessageItemComponent.isConversationManager`\n * to flag messages from the routing agent without hardcoding `'Sage'`.\n */\n public get ConversationManagerAgentName(): string | null {\n return this._conversationManagerAgent?.Name ?? null;\n }\n\n /**\n * Returns `true` if the supplied agent identifier (UUID or name) matches the\n * currently cached conversation manager agent. Robust to either input.\n */\n public IsConversationManagerAgent(agentIdOrName: string | null | undefined): boolean {\n if (!agentIdOrName || !this._conversationManagerAgent) return false;\n return (\n UUIDsEqual(this._conversationManagerAgent.ID, agentIdOrName) ||\n this._conversationManagerAgent.Name === agentIdOrName\n );\n }\n\n /**\n * Process a message through the conversation manager agent. Delegates to\n * `ConversationsRuntime.Instance.AgentRunner.processMessage(...)`.\n *\n * The unused `conversationHistory` parameter is kept for backwards compatibility (it was already\n * documented as \"kept for backwards compatibility but not used\" in the original).\n *\n * @param onReplyAccepted Called with the reply row the server creates for the turn (only the server\n * writes agent replies), before any progress: key the turn's task and completion by its ID.\n */\n async ProcessMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The agents the conversation manager may delegate to. Null or omitted allows every agent. */\n allowedAgentIDs?: readonly string[] | null,\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null,\n /** The branch the turn runs on when it forks off an earlier message on another branch. */\n replyBranchId?: string | null\n ): Promise<ExecuteAgentResult | null> {\n // Warm the cached default-agent name for any synchronous consumers\n // before the runtime resolves on its own.\n if (!this._conversationManagerAgent) {\n await this.GetConversationManagerAgent();\n }\n return ConversationsRuntime.Instance.AgentRunner.processMessage({\n conversationId,\n message,\n onReplyAccepted,\n appContext,\n onProgress,\n ...(planMode ? { planMode: true } : {}),\n ...(requestedSkillIDs?.length ? { requestedSkillIDs } : {}),\n ...(allowedAgentIDs != null ? { AllowedAgentIDs: allowedAgentIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n ...(replyBranchId ? { ReplyBranchID: replyBranchId } : {}),\n });\n }\n\n /** @deprecated Use {@link ProcessMessage}. */\n async processMessage(\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n onProgress?: AgentExecutionProgressCallback,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n allowedAgentIDs?: readonly string[] | null,\n agentHistoryFrom?: Date | null,\n replyBranchId?: string | null\n ): Promise<ExecuteAgentResult | null> {\n return this.ProcessMessage(conversationId, message, conversationHistory, onReplyAccepted, onProgress, appContext, planMode, requestedSkillIDs, allowedAgentIDs, agentHistoryFrom, replyBranchId);\n }\n\n /**\n * Configuration preset an agent was pinned to by a previous `@mention` in this conversation.\n *\n * Resolved by QUERY, not by scanning the display array. The pinning `@mention` is normally\n * the FIRST message of an exchange and everything after it is follow-up, so it is the\n * message most likely to fall below the loaded transcript window — and `undefined` is a\n * legal value for `configurationPresetId`, so the miss is silent. The visible consequence\n * is a run executed under the default configuration (a different model tier) instead of the\n * one the user explicitly chose, with a plausible-looking result and no error.\n *\n * There is no column to filter on: the preset lives inside the message body as a JSON\n * mention blob (`@{\"type\":\"agent\",\"id\":\"…\",\"configId\":\"…\"}`). So SQL narrows and the parser\n * decides — both `configId` and the agent id appear verbatim in that blob, which makes the\n * two LIKEs a tight prefilter, and `parseMentions` is what actually confirms a match.\n *\n * @param branchId The active branch. Only messages on its path count; null or omitted reads\n * the trunk.\n */\n public async FindConfigurationPresetForAgent(\n conversationId: string,\n agentId: string,\n branchId?: string | null\n ): Promise<string | undefined> {\n const configurationId = await FindMentionPinnedPresetID(\n conversationId,\n agentId,\n branchId,\n this.Provider.CurrentUser ?? undefined,\n this.Provider\n );\n if (configurationId) {\n console.log(`\\u{1F3AF} Found configuration preset from @mention: ${configurationId}`);\n }\n return configurationId;\n }\n\n\n\n /**\n * Clear the session for a conversation (useful when starting a new topic)\n */\n ClearSession(conversationId: string): void {\n this._sessionIds.delete(conversationId);\n }\n\n /** @deprecated Use {@link ClearSession}. */\n clearSession(conversationId: string): void {\n return this.ClearSession(conversationId);\n }\n\n /**\n * Surfaces a warning toast when the user requested skills (via /skill mentions) that the\n * target agent cannot activate — the server drops such requests, and without this the\n * refusal is invisible to the user. Client-side check uses the agent gate only (the server\n * additionally intersects with the user's Run permission).\n */\n private warnOnUnacceptedSkills(agent: MJAIAgentEntityExtended, requestedSkillIDs: string[]): void {\n const allowed = AIEngineBase.Instance.GetSkillsForAgent(agent);\n const dropped = requestedSkillIDs.filter(id => !allowed.some(s => UUIDsEqual(s.ID, id)));\n if (dropped.length === 0) return;\n const names = dropped.map(\n id => AIEngineBase.Instance.Skills.find(s => UUIDsEqual(s.ID, id))?.Name ?? 'requested skill'\n );\n const reason = agent.AcceptsSkills === 'None'\n ? `${agent.Name} doesn't accept skills`\n : `${agent.Name} can't activate ${names.length === 1 ? 'this skill' : 'these skills'}`;\n MJNotificationService.Instance?.CreateSimpleNotification(\n `${reason} — ${names.join(', ')} won't be used for this run.`,\n 'warning',\n 6000\n );\n }\n\n /**\n * Invoke a sub-agent based on Sage Agent's payload.\n * This is called when Sage decides to delegate to a specialist agent.\n *\n * Stays on the Angular shim because it directly uses AgentClientService.\n * Could move to the runtime in a follow-up if needed.\n *\n * @param onReplyAccepted Called with the reply row the server creates for the run (only the server\n * writes agent replies), before any progress: key the run's task and completion by its ID.\n */\n async InvokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n /** The first moment of the conversation the run may read. Null or omitted reads all of it. */\n agentHistoryFrom?: Date | null,\n /** Where the reply sits in the conversation. Omitted, it answers `message` directly. */\n threading?: SubAgentThreading | null\n ): Promise<ExecuteAgentResult | null> {\n try {\n // Ensure AIEngineBase is configured\n await AIEngineBase.Instance.Config(false);\n\n // Find the agent by name\n const agent = AIEngineBase.Instance.ReadableAgents.find(a => a.Name === agentName);\n\n if (!agent || !agent.ID) {\n const errorMsg = `Sub-agent \"${agentName}\" not found`;\n console.warn(`${errorMsg}`);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return null;\n }\n\n if (requestedSkillIDs?.length) {\n this.warnOnUnacceptedSkills(agent, requestedSkillIDs);\n }\n\n LogStatusEx({\n message: `Invoking sub-agent: ${agentName}`,\n verboseOnly: true,\n additionalArgs: [{ reasoning, hasPayload: !!payload, hasConfigPreset: !!agentConfigurationPresetId }]\n });\n\n // Map AIAgentConfiguration preset ID to actual AIConfiguration ID\n let aiConfigurationId: string | undefined = undefined;\n if (agentConfigurationPresetId) {\n const presets = AIEngineBase.Instance.GetAgentConfigurationPresets(agent.ID, false);\n const preset = presets.find(p => UUIDsEqual(p.ID, agentConfigurationPresetId) || UUIDsEqual(p.AIConfigurationID, agentConfigurationPresetId));\n\n if (preset) {\n aiConfigurationId = preset.AIConfigurationID || undefined;\n LogStatusEx({ message: `Mapped agent configuration preset \"${preset.Name}\" to AIConfigurationID: ${aiConfigurationId || 'default'}`, verboseOnly: true });\n } else {\n console.warn(`Agent configuration preset ${agentConfigurationPresetId} not found for agent ${agent.ID}`);\n }\n }\n\n const agentParams: RunAgentFromConversationDetailParams = {\n UserMessageId: message.ID,\n OnAccepted: onReplyAccepted,\n ...(threading?.ReplyParentId ? { ReplyParentId: threading.ReplyParentId } : {}),\n ...(threading?.AnnouncedByAgentId ? { AnnouncedByAgentId: threading.AnnouncedByAgentId } : {}),\n ...(threading?.ReplyBranchId ? { ReplyBranchId: threading.ReplyBranchId } : {}),\n AgentId: agent.ID,\n MaxHistoryMessages: 20,\n Data: {\n conversationId: conversationId,\n latestMessageId: message.ID,\n invocationReason: reasoning,\n ...(appContext ? { appContext } : {}),\n },\n ...(payload ? { Payload: payload } : {}),\n ...(aiConfigurationId ? { ConfigurationId: aiConfigurationId } : {}),\n ...(planMode ? { PlanMode: true } : {}),\n ...(requestedSkillIDs?.length ? { RequestedSkillIDs: requestedSkillIDs } : {}),\n ...(agentHistoryFrom ? { AgentHistoryFrom: agentHistoryFrom } : {}),\n CreateArtifacts: true,\n CreateNotification: true,\n SourceArtifactId: sourceArtifactId,\n SourceArtifactVersionId: sourceArtifactVersionId,\n OnProgress: onProgress ? (progress) => {\n onProgress({\n step: progress.CurrentStep as 'initialization' | 'validation' | 'prompt_execution' | 'action_execution' | 'subagent_execution' | 'decision_processing' | 'finalization',\n percentage: progress.Percentage,\n message: progress.Message,\n metadata: progress.Metadata\n });\n } : undefined\n };\n\n const runResult = await this.agentClientService.RunAgentFromConversationDetail(agentParams);\n\n if (runResult.Success && runResult.Result) {\n return runResult.Result as ExecuteAgentResult;\n }\n\n const failed = coerceFailedExecuteAgentResult(\n runResult.Result as ExecuteAgentResult | null | undefined,\n runResult.ErrorMessage || `Sub-agent \"${agentName}\" failed`,\n );\n const errorMsg = `Sub-agent \"${agentName}\" failed: ${failed.errorMessage}`;\n console.error(errorMsg);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return failed;\n } catch (error) {\n const errorMsg = `Error invoking sub-agent \"${agentName}\": ` + (error instanceof Error ? error.message : String(error));\n console.error(`Error invoking sub-agent \"${agentName}\":`, error);\n MJNotificationService.Instance?.CreateSimpleNotification(errorMsg, 'error', 5000);\n return coerceFailedExecuteAgentResult<ExecuteAgentResult>(undefined, errorMsg);\n }\n }\n\n /** @deprecated Use {@link InvokeSubAgent}. */\n async invokeSubAgent(\n agentName: string,\n conversationId: string,\n message: MJConversationDetailEntity,\n conversationHistory: MJConversationDetailEntity[],\n reasoning: string,\n onReplyAccepted: (reply: AgentReplyAcknowledgement) => void,\n payload?: Record<string, unknown> | null,\n onProgress?: AgentExecutionProgressCallback,\n sourceArtifactId?: string,\n sourceArtifactVersionId?: string,\n agentConfigurationPresetId?: string,\n appContext?: Record<string, unknown> | null,\n planMode?: boolean,\n requestedSkillIDs?: string[],\n agentHistoryFrom?: Date | null,\n threading?: SubAgentThreading | null\n ): Promise<ExecuteAgentResult | null> {\n return this.InvokeSubAgent(agentName, conversationId, message, conversationHistory, reasoning, onReplyAccepted, payload, onProgress, sourceArtifactId, sourceArtifactVersionId, agentConfigurationPresetId, appContext, planMode, requestedSkillIDs, agentHistoryFrom, threading);\n }\n\n /**\n * Check if user's latest message should continue with the previous agent or route through Sage.\n * Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.\n *\n * Stays on the Angular shim because it directly uses GraphQLAIClient.\n * Could move to the runtime in a follow-up.\n *\n * @param branchId The active branch. Only the agent's artifacts on its path are listed for the\n * classifier; null or omitted reads the trunk.\n */\n async CheckAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[],\n branchId?: string | null\n ): Promise<IntentCheckResult> {\n if (!this._aiClient) {\n console.warn('AI Client not initialized, defaulting to UNSURE for intent check');\n return { decision: 'UNSURE', reasoning: 'AI Client not initialized' };\n }\n\n try {\n await AIEngineBase.Instance.Config(false);\n const prompt = AIEngineBase.Instance.Prompts.find(p => p.Name === 'Check Sage Intent');\n if (!prompt) {\n console.warn('⚠️ Check Sage Intent prompt not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Check Sage Intent prompt not found' };\n }\n\n const agent = AIEngineBase.Instance.ReadableAgents.find(a => UUIDsEqual(a.ID, agentId));\n if (!agent) {\n console.warn('⚠️ Previous agent not found, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Previous agent not found' };\n }\n\n // Queried, not read off the caller's window-scoped maps — see FindAgentArtifacts.\n // `conversationHistory` below is still the window on purpose: the `.slice(-10)` wants\n // the most recent exchange, which the loaded tail always contains.\n const agentArtifacts = await this.FindAgentArtifacts(conversationId, agentId, undefined, branchId);\n\n const recentHistory = conversationHistory.slice(-10);\n const compactHistory = recentHistory.map((msg, idx) => {\n const role = msg.Role === 'User' ? 'User' : agent.Name || 'Agent';\n const content = msg.Message || '';\n return `${idx + 1}. ${role}: ${content.substring(0, 150)}${content.length > 150 ? '...' : ''}`;\n }).join('\\n');\n\n let artifactContext = '';\n if (agentArtifacts.length > 0) {\n artifactContext = '\\n\\n**Prior Artifacts Created by This Agent**:\\n';\n agentArtifacts.forEach((artifact, idx) => {\n artifactContext += `${idx + 1}. ${artifact.artifactName} (${artifact.ArtifactType})\\n`;\n artifactContext += ` - Versions: ${artifact.Versions.length}\\n`;\n if (artifact.Versions.length > 0) {\n artifactContext += ` - Latest: v${artifact.Versions[0].versionNumber}`;\n if (artifact.Versions[0].versionName) {\n artifactContext += ` - ${artifact.Versions[0].versionName}`;\n }\n artifactContext += '\\n';\n }\n });\n }\n\n const userMessage = `**Previous Agent**: ${agent.Name} - ${agent.Description || 'No description'}\n\n**Conversation History** (last ${recentHistory.length} messages):\n${compactHistory}${artifactContext}\n\n**Latest User Message**: \"${latestMessage}\"`;\n\n LogStatusEx({\n message: '🔍 Checking agent continuity intent...',\n verboseOnly: true,\n additionalArgs: [{\n agentName: agent.Name,\n messagePreview: latestMessage.substring(0, 50),\n artifactCount: agentArtifacts.length\n }]\n });\n\n const result = await this._aiClient.RunAIPrompt({\n promptId: prompt.ID,\n messages: [{ role: 'user', content: userMessage }],\n data: {\n hasPriorArtifact: agentArtifacts.length > 0,\n priorArtifacts: agentArtifacts\n }\n });\n\n if (result && result.success && (result.parsedResult || result.output)) {\n const parsed = result.parsedResult ||\n (result.output ? JSON.parse(result.output) : null);\n\n if (parsed && parsed.continuesWith) {\n const decision = parsed.continuesWith.toUpperCase();\n const reasoning = parsed.reasoning || 'No reasoning provided';\n const targetArtifactVersionId = parsed.targetArtifactVersionId || undefined;\n\n LogStatusEx({\n message: `✅ Intent check result: ${decision}`,\n verboseOnly: true,\n additionalArgs: [{\n reasoning,\n targetArtifactVersionId,\n latency: result.executionTimeMs || 'unknown'\n }]\n });\n\n if (decision === 'YES' || decision === 'NO' || decision === 'UNSURE') {\n return {\n decision: decision as 'YES' | 'NO' | 'UNSURE',\n reasoning,\n targetArtifactVersionId\n };\n }\n }\n }\n\n console.warn('⚠️ Intent check failed or returned invalid format, defaulting to UNSURE');\n return { decision: 'UNSURE', reasoning: 'Invalid format from intent check prompt' };\n } catch (error) {\n console.error('❌ Error checking agent continuity intent:', error);\n return {\n decision: 'UNSURE',\n reasoning: `Error during intent check: ${error instanceof Error ? error.message : String(error)}`\n };\n }\n }\n\n /** @deprecated Use {@link CheckAgentContinuityIntent}. */\n async checkAgentContinuityIntent(\n conversationId: string,\n agentId: string,\n latestMessage: string,\n conversationHistory: MJConversationDetailEntity[],\n branchId?: string | null\n ): Promise<IntentCheckResult> {\n return this.CheckAgentContinuityIntent(conversationId, agentId, latestMessage, conversationHistory, branchId);\n }\n\n /**\n * Runs a typed decision on the server in one round trip, through\n * {@link GraphQLAIClient.RunDecision}. Decision routing (`EnableDecisionRouting`) asks its\n * routing questions here.\n *\n * Never throws: without an AI client, or on any failure, it resolves with `Success: false` and\n * no answers.\n */\n public async RunDecision(params: RunDecisionParams): Promise<RunDecisionResult> {\n if (!this._aiClient) {\n return { Success: false, ErrorMessage: 'AI Client not initialized', Answers: {} };\n }\n return this._aiClient.RunDecision(params);\n }\n\n /**\n * Every artifact this agent produced on the active branch path, newest version first, for\n * decision routing's artifact question. Resolved by query, as {@link findAllAgentArtifacts} explains.\n *\n * @param historyFrom The chat's history floor. When set, only artifacts on replies written at or\n * after it count, as with {@link FindLatestAgentOutputVersion}.\n * @param branchId The active branch. Only artifacts on its path count, as with\n * {@link FindLatestAgentOutputVersion}; null or omitted reads the trunk.\n */\n public async FindAgentArtifacts(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentArtifactSummary[]> {\n return this.findAllAgentArtifacts(conversationId, agentId, historyFrom, branchId);\n }\n\n /**\n * Every artifact this agent produced on the active branch path, newest version first —\n * resolved by QUERY, not by scanning the display array.\n *\n * The scan this replaces walked `conversationDetails` and looked each row up in the\n * caller's `artifactsByDetailId` / `agentRunsByDetailId` maps. Both are scoped to the\n * LOADED WINDOW, so under transcript windowing it saw only the artifacts attached to the\n * page currently on screen.\n *\n * That matters because this list is the \"Prior Artifacts Created by This Agent\" block fed\n * to the Check Sage Intent prompt, which is what produces `targetArtifactVersionId`. A\n * truncated list does not make the classifier fail — it makes it reason over a partial\n * history and confidently name the wrong version, or miss continuity altogether. Silent,\n * plausible, and wrong: the same failure class as {@link FindLatestAgentOutputVersion},\n * closed the same way.\n *\n * Three reads: the agent's replies, their Output versions, and the artifacts' names. See\n * {@link AgentArtifactSummary} for why dropping `runId` removes the join back to agent runs.\n *\n * @param historyFrom The chat's history floor, when set (see {@link FindAgentArtifacts}).\n * @param branchId The branch whose path to read; null or omitted reads the trunk.\n */\n private async findAllAgentArtifacts(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentArtifactSummary[]> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Name'>;\n const versionFilter = await this.agentOutputVersionFilter(conversationId, agentId, historyFrom, branchId);\n if (!versionFilter) {\n return []; // the classifier degrades to no artifact context\n }\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const versionResult = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: versionFilter,\n OrderBy: '__mj_CreatedAt DESC',\n MaxRows: MAX_AGENT_ARTIFACT_VERSIONS,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Name'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!versionResult.Success) {\n console.error('Failed to load agent artifact versions:', versionResult.ErrorMessage);\n return []; // the classifier degrades to no artifact context\n }\n const versions = versionResult.Results || [];\n if (versions.length === 0) {\n return [];\n }\n\n const artifactsById = await this.loadArtifactNames(\n [...new Set(versions.map(v => v.ArtifactID))]\n );\n return GroupVersionsByArtifact(versions, artifactsById);\n }\n\n /** Names and types for the artifacts behind a set of versions. */\n private async loadArtifactNames(\n artifactIds: string[]\n ): Promise<Map<string, Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>>> {\n type ArtifactRow = Pick<MJArtifactEntity, 'ID' | 'Name' | 'Type'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<ArtifactRow>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `ID IN (${artifactIds.map(id => `'${EscapeSQLString(id)}'`).join(',')})`,\n Fields: ['ID', 'Name', 'Type'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent artifacts:', result.ErrorMessage);\n return new Map<string, ArtifactRow>();\n }\n return new Map((result.Results || []).map(a => [a.ID, a]));\n }\n\n /**\n * Newest OUTPUT artifact version an agent produced in this conversation — resolved by\n * QUERY, not by scanning the display array.\n *\n * The array scan this replaces was correct only while `conversationHistory` held the whole\n * conversation. Under transcript windowing it holds one page, so the scan silently returns\n * null for any artifact below the window's oldest row — exactly the long \"modify this\n * again\" exchanges where payload continuity matters most. A null payload is a LEGAL agent\n * input, so the failure is silent: the agent regenerates from scratch instead of modifying.\n *\n * Three RLS-safe reads: the agent's replies, their Output link rows, then their newest\n * version. Versions carry `__mj_CreatedAt`, so \"newest\" is expressible without joining back\n * for `Sequence`.\n *\n * @param historyFrom The chat's history floor. When set, only artifacts on replies written at\n * or after it count: a run that may not read earlier messages must not pick up their work\n * as its payload either.\n * @param branchId The active branch. Only replies on its path count, so an artifact made on\n * another branch is never the latest here; null or omitted reads the trunk.\n */\n public async FindLatestAgentOutputVersion(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<AgentPayloadSource | null> {\n const versionFilter = await this.agentOutputVersionFilter(conversationId, agentId, historyFrom, branchId);\n return versionFilter ? this.runPayloadSourceQuery(versionFilter, '__mj_CreatedAt DESC') : null;\n }\n\n /**\n * `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced on one\n * conversation path, in messages no rerun replaced, or null when the agent has no such\n * output there. Shared by {@link FindLatestAgentOutputVersion} and {@link findAllAgentArtifacts}\n * so the two can never disagree about what \"this agent's artifacts\" means.\n *\n * Both the replies (`MJ: Conversation Details`) and their output links\n * (`MJ: Conversation Detail Artifacts`) are read with their own `RunView` calls so\n * row-level security applies to each entity and `ClientClauseScreen` never refuses a\n * base-view subquery on row-filtered conversation tables.\n */\n private async agentOutputVersionFilter(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<string | null> {\n const replyIds = await this.agentReplyIds(conversationId, agentId, historyFrom, branchId);\n if (replyIds.length === 0) {\n return null;\n }\n const inReplies = replyIds.map(id => `'${EscapeSQLString(id)}'`).join(',');\n const rv = RunView.FromMetadataProvider(this.Provider);\n const linkResult = await rv.RunView<Pick<MJConversationDetailArtifactEntity, 'ArtifactVersionID'>>({\n EntityName: 'MJ: Conversation Detail Artifacts',\n ExtraFilter: `Direction='Output' AND ConversationDetailID IN (${inReplies})`,\n Fields: ['ArtifactVersionID'],\n ResultType: 'simple',\n IgnoreMaxRows: true\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!linkResult.Success) {\n console.error('Failed to load agent output artifact links:', linkResult.ErrorMessage);\n return null;\n }\n\n const seenVersionIds = new UUIDSet();\n const versionIds: string[] = [];\n for (const row of linkResult.Results || []) {\n const versionId = row.ArtifactVersionID?.trim();\n if (versionId && !seenVersionIds.Has(versionId)) {\n seenVersionIds.Add(versionId);\n versionIds.push(versionId);\n }\n }\n if (versionIds.length === 0) {\n return null;\n }\n return `ID IN (${versionIds.map(id => `'${EscapeSQLString(id)}'`).join(',')})`;\n }\n\n /**\n * IDs of the agent's replies on one conversation path, in messages no rerun replaced, written\n * at or after the history floor when one is set. Empty when the path cannot be built\n * ({@link branchPathFilter}) or the read fails.\n *\n * Filters on the DETAIL's `Status <> 'Error'` rather than the agent run's\n * `Status = 'Completed'` (which is what the array scan this replaced used). Doing it on the\n * run would mean joining back to `MJ: AI Agent Runs` purely to restate a condition the\n * detail already carries.\n */\n private async agentReplyIds(\n conversationId: string,\n agentId: string,\n historyFrom?: Date | null,\n branchId?: string | null\n ): Promise<string[]> {\n const pathFilter = await this.branchPathFilter(conversationId, branchId);\n if (pathFilter == null) {\n return [];\n }\n const floor = historyFrom ? ` AND ${ConversationEngine.HistoryFromFilter(historyFrom)}` : '';\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<Pick<MJConversationDetailEntity, 'ID'>>({\n EntityName: 'MJ: Conversation Details',\n ExtraFilter: `${ConversationEngine.LiveRowsFilter(pathFilter)} AND AgentID='${EscapeSQLString(agentId)}'` +\n ` AND Role='AI' AND Status <> 'Error'${floor}`,\n Fields: ['ID'],\n ResultType: 'simple',\n IgnoreMaxRows: true\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to load agent replies:', result.ErrorMessage);\n return [];\n }\n return (result.Results || []).map(reply => reply.ID);\n }\n\n /**\n * The SQL predicate for one branch's path in a conversation, from\n * `ConversationEngine.BranchPathFilterFresh`. A null or omitted branch is the trunk and costs\n * no query.\n *\n * Never throws. When the path cannot be built (the branch rows fail to load, or the branch is\n * not among them), it logs the error and returns null. Each lookup then returns its own\n * failure value, as it does when its main query fails. A caller must not fall back to the\n * trunk predicate: on a branch, that reads trunk rows past the fork point.\n */\n private async branchPathFilter(conversationId: string, branchId: string | null | undefined): Promise<string | null> {\n try {\n const user = this.Provider.CurrentUser ?? undefined;\n return await ConversationEngine.BranchPathFilterFresh(conversationId, branchId, user as UserInfo, this.Provider);\n } catch (error) {\n console.error(`Failed to build the path of branch ${branchId} in conversation ${conversationId}:`, error);\n return null;\n }\n }\n\n /**\n * One artifact version by ID, as a payload source.\n *\n * Used by the continuity path after the intent check names a specific version: that ID may\n * belong to a message below the loaded window, so it cannot be resolved from the window's\n * artifact maps.\n */\n public async FindArtifactVersionById(versionId: string): Promise<AgentPayloadSource | null> {\n return this.runPayloadSourceQuery(`ID='${EscapeSQLString(versionId)}'`, undefined);\n }\n\n /**\n * Shared read behind {@link FindLatestAgentOutputVersion} and {@link FindArtifactVersionById}.\n *\n * `ResultType: 'simple'` with an explicit `Fields` list: nothing here is mutated, and under\n * `entity_object` the `Fields` narrowing would be silently discarded by `PreRunView`.\n */\n private async runPayloadSourceQuery(\n extraFilter: string,\n orderBy: string | undefined\n ): Promise<AgentPayloadSource | null> {\n type VersionRow = Pick<MJArtifactVersionEntity, 'ID' | 'ArtifactID' | 'VersionNumber' | 'Content'>;\n\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<VersionRow>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: extraFilter,\n OrderBy: orderBy,\n MaxRows: 1,\n SkipTotalRowCount: true,\n Fields: ['ID', 'ArtifactID', 'VersionNumber', 'Content'],\n ResultType: 'simple'\n }, this.Provider.CurrentUser ?? undefined);\n\n if (!result.Success) {\n console.error('Failed to resolve agent payload source:', result.ErrorMessage);\n return null;\n }\n const row = result.Results?.[0];\n if (!row) {\n return null;\n }\n return {\n artifactId: row.ArtifactID,\n versionId: row.ID,\n versionNumber: row.VersionNumber,\n payload: parseArtifactContent(row.Content)\n };\n }\n\n}\n\n/**\n * Parses an artifact version's `Content` into an agent payload. Returns null rather than\n * throwing — a malformed artifact must not take down the send path, and \"no payload\" is\n * already a legal agent input.\n *\n * A payload must be a JSON OBJECT. Valid JSON that parses to an array, string, or number is\n * rejected for the same reason a parse failure is: every consumer spreads it or reads named\n * keys off it, so a non-object would satisfy the type at the boundary and misbehave deeper in.\n */\nfunction parseArtifactContent(content: string | null | undefined): Record<string, unknown> | null {\n if (!content) {\n return null;\n }\n try {\n const parsed: unknown = JSON.parse(content);\n return isPayloadObject(parsed) ? parsed : null;\n } catch (error) {\n console.warn('Artifact version content did not parse as JSON:', error);\n return null;\n }\n}\n\n/** Narrows a parsed JSON value to a plain object — the only shape a payload may take. */\nfunction isPayloadObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-conversations",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "description": "MemberJunction: Conversation, Collection, and Artifact management components for any Angular application",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -14,7 +14,7 @@
14
14
  "@angular/compiler": "21.2.22",
15
15
  "@angular/compiler-cli": "21.2.22",
16
16
  "@fortawesome/fontawesome-free": "6.7.2",
17
- "@memberjunction/ng-test-utils": "6.2.1",
17
+ "@memberjunction/ng-test-utils": "6.2.3",
18
18
  "sass": "^1.97.3",
19
19
  "vitest": "^4.0.18"
20
20
  },
@@ -27,40 +27,40 @@
27
27
  "@angular/platform-browser": "^21.2.22"
28
28
  },
29
29
  "dependencies": {
30
- "@memberjunction/ai": "6.2.1",
31
- "@memberjunction/ai-agent-client": "6.2.1",
32
- "@memberjunction/ai-core-plus": "6.2.1",
33
- "@memberjunction/ai-engine-base": "6.2.1",
34
- "@memberjunction/ai-realtime-client": "6.2.1",
35
- "@memberjunction/conversations-runtime": "6.2.1",
36
- "@memberjunction/core": "6.2.1",
37
- "@memberjunction/core-entities": "6.2.1",
38
- "@memberjunction/global": "6.2.1",
39
- "@memberjunction/graphql-dataprovider": "6.2.1",
40
- "@memberjunction/interactive-component-types": "6.2.1",
41
- "@memberjunction/ng-agent-client": "6.2.1",
42
- "@memberjunction/ng-artifacts": "6.2.1",
43
- "@memberjunction/ng-base-forms": "6.2.1",
44
- "@memberjunction/ng-base-types": "6.2.1",
45
- "@memberjunction/ng-code-editor": "6.2.1",
46
- "@memberjunction/ng-composer": "6.2.1",
47
- "@memberjunction/ng-container-directives": "6.2.1",
48
- "@memberjunction/ng-forms": "6.2.1",
49
- "@memberjunction/ng-markdown": "6.2.1",
50
- "@memberjunction/ng-media-player": "6.2.1",
51
- "@memberjunction/ng-notifications": "6.2.1",
52
- "@memberjunction/ng-react": "6.2.1",
53
- "@memberjunction/ng-realtime-channels": "6.2.1",
54
- "@memberjunction/ng-realtime-media": "6.2.1",
55
- "@memberjunction/ng-resource-permissions": "6.2.1",
56
- "@memberjunction/ng-shared-generic": "6.2.1",
57
- "@memberjunction/ng-task-graph-editor": "6.2.1",
58
- "@memberjunction/ng-tasks": "6.2.1",
59
- "@memberjunction/ng-testing": "6.2.1",
60
- "@memberjunction/ng-ui-components": "6.2.1",
61
- "@memberjunction/ng-user-routines": "6.2.1",
62
- "@memberjunction/ng-whiteboard": "6.2.1",
63
- "@memberjunction/realtime-runtime": "6.2.1",
30
+ "@memberjunction/ai": "6.2.3",
31
+ "@memberjunction/ai-agent-client": "6.2.3",
32
+ "@memberjunction/ai-core-plus": "6.2.3",
33
+ "@memberjunction/ai-engine-base": "6.2.3",
34
+ "@memberjunction/ai-realtime-client": "6.2.3",
35
+ "@memberjunction/conversations-runtime": "6.2.3",
36
+ "@memberjunction/core": "6.2.3",
37
+ "@memberjunction/core-entities": "6.2.3",
38
+ "@memberjunction/global": "6.2.3",
39
+ "@memberjunction/graphql-dataprovider": "6.2.3",
40
+ "@memberjunction/interactive-component-types": "6.2.3",
41
+ "@memberjunction/ng-agent-client": "6.2.3",
42
+ "@memberjunction/ng-artifacts": "6.2.3",
43
+ "@memberjunction/ng-base-forms": "6.2.3",
44
+ "@memberjunction/ng-base-types": "6.2.3",
45
+ "@memberjunction/ng-code-editor": "6.2.3",
46
+ "@memberjunction/ng-composer": "6.2.3",
47
+ "@memberjunction/ng-container-directives": "6.2.3",
48
+ "@memberjunction/ng-forms": "6.2.3",
49
+ "@memberjunction/ng-markdown": "6.2.3",
50
+ "@memberjunction/ng-media-player": "6.2.3",
51
+ "@memberjunction/ng-notifications": "6.2.3",
52
+ "@memberjunction/ng-react": "6.2.3",
53
+ "@memberjunction/ng-realtime-channels": "6.2.3",
54
+ "@memberjunction/ng-realtime-media": "6.2.3",
55
+ "@memberjunction/ng-resource-permissions": "6.2.3",
56
+ "@memberjunction/ng-shared-generic": "6.2.3",
57
+ "@memberjunction/ng-task-graph-editor": "6.2.3",
58
+ "@memberjunction/ng-tasks": "6.2.3",
59
+ "@memberjunction/ng-testing": "6.2.3",
60
+ "@memberjunction/ng-ui-components": "6.2.3",
61
+ "@memberjunction/ng-user-routines": "6.2.3",
62
+ "@memberjunction/ng-whiteboard": "6.2.3",
63
+ "@memberjunction/realtime-runtime": "6.2.3",
64
64
  "angular-split": "^20.0.0",
65
65
  "rxjs": "^7.8.2",
66
66
  "tslib": "^2.8.1"