Fired AFTER a successful agent turn completes. Carries the agent run id and the
full agent result. Not fired when beforeAgentTurn was canceled or when
the underlying processMessage errored.
The MJ: AI Agent Configurations.ID selected via the chat header's
mode picker (Draft / Standard / High). Applied to non-mention
routes — when the user types without @mention, this preset rides
along on the next invokeSubAgent call so the server resolves the
agent's Fast / Standard / High Power AI configuration accordingly.
Mentioned-route turns still use the preset embedded in the mention
(e.g. @Form Builder /high) because that's a per-message intent
the user just expressed. Continuity-route turns (last responder
agent) also honor this input as the fallback when the prior
message itself doesn't carry an explicit configuration preset.
Picker writes are forward-only: changing the mode does NOT re-route messages already in flight or already in history. Affects "what happens next."
OptionalagentApplication context for the current conversation. Threaded through from the chat-area component for inclusion in the beforeAgentTurn event payload — lets listeners reason about which app's chat surface is invoking the agent. Optional; defaults to null for surfaces with no app context.
OptionalartifactsCancelable — fired BEFORE agentService.processMessage() is called for a user turn.
Listeners may set event.Cancel = true to halt the agent invocation (e.g., a
client-side guardrail blocking the turn). When canceled, the corresponding
afterAgentTurn event is NOT fired and the running task is cleared.
Follows MJ's established Before/After cancelable event pattern.
The composer lost focus — hosts flush persisted drafts on this.
Per-conversation pinned default agent — sourced from the loaded
MJConversationEntity.DefaultAgentID. When set, this agent is used in
preference to the embedder-supplied defaultAgentId so a user
who pins a conversation to e.g. Research Agent gets that routing even
inside an embedded surface whose embedder defaults to a different
specialist. Routing precedence:
1.
OptionalconversationOptional default agent ID for the conversation. When set, the FIRST message routes directly to this agent — skipping Sage's default delegation — provided the user did not
a different agent and there is no prior agent in the conversation history. After the first message, the existing "last non-Sage agent" continuity rule keeps subsequent messages on the same agent.
Used by embedded chat surfaces (Form Builder cockpit, future domain-specific chats) that have an obvious specialist agent for the context and don't need Sage to route. Leave unset to preserve the standard Sage-fronted UX of the main Chat app.
Live draft-state signal: fires on every composer value change with the SERIALIZED content (mention pills encoded via getPlainTextWithJsonMentions, so hosts can persist drafts losslessly). Empty string = draft cleared.
OptionalparentReadonlypickerCDK connected-overlay positions for the voice agent picker. Preferred: open UPWARD,
right edge aligned to the composer's right edge (matching the old absolute placement).
Fallback: open downward when there isn't room above. Because the popover renders in the
body-level CDK overlay container (with cdkConnectedOverlayPush), it escapes the chat
overlay's overflow: hidden border and can never clip at the top of a narrow overlay.
If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.
True while the "Start a voice call with…" agent picker popover is open.
OptionalsystemTrue while a live voice session is active — drives the overlay + mic state.
The persisted co-agent preference, loaded just before the picker opens (and read by
the instant-start path). null = no preference / explicit "Auto".
StaticɵdirStaticɵfacTrue when the mic button should be enabled (have an agent + not disabled).
Draft text to stage in the composer when this input mounts (NOT sent — unlike pendingMessage). Applied once per distinct value, view-readiness-proof: if the view isn't up yet, ngAfterViewInit applies it. Emits initialDraftApplied so the host can clear its pending state.
Plan Mode toggle state — sticky PER CONVERSATION, OFF by default (no behavior change unless
the user turns it on). When on, the user's next message(s) in THIS conversation request Plan
Mode: the routed root agent must present a plan for approval before executing Actions/
Sub-Agents. The toggle is always shown and the server enforces the AIAgent.SupportsPlanMode
capability — a plan-mode request to an agent that doesn't support it simply no-ops the gate
(see resolvePlanModeGate), so we don't need to resolve "the current agent" client-side.
IMPORTANT: this is a GETTER over PlanModePreference (UserInfoEngine-backed), NOT a local field. The composer is mounted in multiple places at once (empty-state, chat-area, thread panel) — a local boolean per instance goes stale the moment another instance toggles. On the new-conversation composer (no conversationId yet) the value lives in a pending bucket that transfers to the real conversation on its first message. Approving a plan turns the conversation's flag OFF automatically (see message-item's plan-decision handling).
Returns either the default Metadata provider or the one specified in the Provider property, if it was specified
Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified
Returns either the default RunReport provider or the one specified in the Provider property, if it was specified
Returns either the default RunView provider or the one specified in the Provider property, if it was specified
Agents the voice picker offers — the same cached set the
The ACTIVE Realtime-type co-agent candidates — the same run-permission-filtered cached set as voicePickerAgents, narrowed to the Realtime agent type. The picker shows its co-agent selector only when more than one exists.
The agent the default resolution would call — preselected in the picker.
Current composer content in the lossless serialized form ('' when empty).
Pre-addresses the composer to an agent as a RESOLVED mention pill (+ trailing space, caret after, focused) — identical to the user typing '@agent' and picking it from the dropdown. Resolves the agent through MentionAutocompleteService so the chip carries the agent's real id/icon/presets; falls back to a plain-text '@Name ' draft when the agent can't be resolved (e.g. name mismatch).
false while the composer view isn't mounted yet — callers may retry.
A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.
A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.
The changed properties.
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.
Handle attachment errors from the input box
Handle attachments changed from the input box
Handles the composer's value stream: keeps messageText in sync + emits draft state.
User confirmed an agent (+ optional co-agent / voice model) in the voice picker — start the call.
User dismissed the voice picker without starting a call.
Caret-next-to-the-phone click: open the agent/co-agent/model picker ON DEMAND, even when the conversation already has agent history (where the plain phone click instant-starts). The resolved agent is preselected, so "open → Start" matches the instant path while keeping the co-agent (and, for authorized users, voice-model) choice one click away. Falls through to the instant path when there is nothing to pick from.
Start a real-time voice session fronting the conversation's current agent. Client-direct: the RealtimeSessionService mints an ephemeral token and connects the browser straight to the realtime provider over WebRTC. The "call mode" overlay itself is hosted by the conversation chat area (driven by Active$).
NEW vs EXISTING conversation:
Handle text submitted from the input box
Reconnect to in-progress messages for streaming updates via global streaming service. This is called when:
Resolve the agent the voice session should front for THIS conversation. Mirrors the routing precedence used for text turns (routeMessage):
Send a message with custom text WITHOUT modifying the visible messageText input Used for suggested responses and initial messages from empty state. Also saves any pending attachments.
extraAttachments is an escape hatch for callers that programmatically
attached something via AddArtifactAttachment and want to send in the same
tick — the attachmentsChanged event chain hasn't propagated yet, so
this.pendingAttachments may not contain the attachment. Pass it in
explicitly and we merge + dedupe (by id) before saving.
OptionalextraAttachments: PendingAttachment[]Toggle sticky Plan Mode for THIS conversation (or the pending-new bucket on the new-conversation composer). Writes through PlanModePreference — the PlanModeEnabled getter reads the same cached setting, so ALL live composer instances flip together, and the value survives component recreation and sessions until the user turns it off or approves a plan.
ProtectedupdateOptionalresult: ExecuteAgentResult
Base class for all Angular components in the MemberJunction system.