Member Junction
    Preparing search index...

    Base class for all Angular components in the MemberJunction system.

    Hierarchy (View Summary)

    Implements

    • OnInit
    • OnDestroy
    • OnChanges
    • AfterViewInit
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    acceptedFileTypes: string = 'image/*'
    afterAgentTurn: EventEmitter<AfterAgentTurnEventArgs> = ...

    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.

    agentConfigurationPresetId: string | null = null

    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."

    agentResponse: EventEmitter<
        { agentResult: any; message: MJConversationDetailEntity },
    > = ...
    agentRunDetected: EventEmitter<
        {
            agentRunId: string;
            conversationDetailId: string;
            conversationId: string;
        },
    > = ...
    agentRunsByDetailId?: Map<string, MJAIAgentRunEntityExtended>
    agentRunUpdate: EventEmitter<
        {
            agentRun?: any;
            agentRunId?: string;
            conversationDetailId: string;
            conversationId: string;
        },
    > = ...
    appContext: Record<string, unknown> | null = null
    applicationId: string | null = null

    Application 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.

    artifactCreated: EventEmitter<
        {
            artifactId: string;
            conversationDetailId: string;
            conversationId: string;
            name: string;
            versionId: string;
            versionNumber: number;
        },
    > = ...
    artifactsByDetailId?: Map<string, LazyArtifactInfo[]>
    beforeAgentTurn: EventEmitter<BeforeAgentTurnEventArgs> = ...

    Cancelable — 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.

    ComposerBlurred: EventEmitter<void> = ...

    The composer lost focus — hosts flush persisted drafts on this.

    converationManagerAgent: MJAIAgentEntityExtended | null = null
    conversationDefaultAgentId: string | null = null

    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.

    1. continuity (last responder)
    2. conversationDefaultAgentId (this input — user's per-conversation pin)
    3. defaultAgentId (embedder-supplied)
    4. Sage fallback
    conversationId: string
    conversationName?: string | null
    conversationRenamed: EventEmitter<
        { conversationId: string; description: string; name: string },
    > = ...
    currentUser: UserInfo
    defaultAgentId: string | null = null

    Optional 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.

    disabled: boolean = false
    DraftStateChanged: EventEmitter<string> = ...

    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.

    emptyStateMode: boolean = false
    emptyStateSubmit: EventEmitter<
        { attachments: PendingAttachment[]; text: string },
    > = ...
    enableAttachments: boolean = true
    enableMentions: boolean = true
    enablePlanMode: boolean = true
    enableRealtime: boolean = true
    initialDraftApplied: EventEmitter<void> = ...
    initialMessageAutoSendFailed: EventEmitter<{ conversationId: string }> = ...
    initialMessageAutoSendStarted: EventEmitter<{ conversationId: string }> = ...
    intentCheckCompleted: EventEmitter<{ conversationId: string }> = ...
    intentCheckStarted: EventEmitter<{ conversationId: string }> = ...
    isProcessing: boolean = false
    isSending: boolean = false
    isUploadingAttachments: boolean = false
    maxAttachments: number = 10
    maxAttachmentSizeBytes: number = ...
    messageComplete: EventEmitter<
        {
            agentId?: string;
            conversationDetailId: string;
            conversationId: string;
        },
    > = ...
    messageSent: EventEmitter<MJConversationDetailEntity> = ...
    messageText: string = ''
    parentMessageId?: string
    pickerOverlayPositions: ConnectedPosition[] = ...

    CDK 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.

    placeholder: string = 'Type a message... (Ctrl+Enter to send)'
    processingMessage: string = 'AI is responding...'
    Provider: IMetadataProvider | null

    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.

    showRealtimeAgentPicker: boolean = false

    True while the "Start a voice call with…" agent picker popover is open.

    systemArtifactsByDetailId?: Map<string, LazyArtifactInfo[]>
    uploadingMessage: string = 'Uploading attachments...'
    uploadStateChanged: EventEmitter<{ isUploading: boolean; message: string }> = ...
    voiceActive: boolean = false

    True while a live voice session is active — drives the overlay + mic state.

    voicePickerDefaultCoAgentId: string | null = null

    The persisted co-agent preference, loaded just before the picker opens (and read by the instant-start path). null = no preference / explicit "Auto".

    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • get PlanModeEnabled(): boolean

      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 boolean

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • 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).

      Parameters

      • agentName: string
      • focus: boolean = true
      • clearExisting: boolean = true

      Returns Promise<boolean>

      false while the composer view isn't mounted yet — callers may retry.

    • 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.

      Parameters

      • changes: { [propName: string]: SimpleChange<any> }

        The changed properties.

      Returns void

    • 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.

      Returns Promise<void>

    • 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:

      • When an agent has already participated (a prior non-Sage AI turn exists), start immediately with the resolved agent — zero added friction.
      • When the conversation has NO prior agent participation (new / empty conversation), the resolution would silently fall through to a default the user never chose — so show a compact agent picker instead and start with whichever agent they pick.

      Returns Promise<void>

    • 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.

      Parameters

      Returns Promise<boolean>