ReadonlyisObservable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner.
Synchronous read of the cached conversation-manager-agent name. Returns
null until getConversationManagerAgent has been called at least
once and resolved successfully. Used by MessageItemComponent.isConversationManager
to flag messages from the routing agent without hardcoding 'Sage'.
The metadata provider this service uses. When unset, falls back to Metadata.Provider. Setting it re-initializes the AI client and forwards the provider to the runtime's runner.
Check if user's latest message should continue with the previous agent or route through Sage. Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.
Stays on the Angular shim because it directly uses GraphQLAIClient. Could move to the runtime in a follow-up.
Clear the session for a conversation (useful when starting a new topic)
One artifact version by ID, as a payload source.
Used by the continuity path after the intent check names a specific version: that ID may belong to a message below the loaded window, so it cannot be resolved from the window's artifact maps.
Configuration preset an agent was pinned to by a previous @mention in this conversation.
Resolved by QUERY, not by scanning the display array. The pinning @mention is normally
the FIRST message of an exchange and everything after it is follow-up, so it is the
message most likely to fall below the loaded transcript window — and undefined is a
legal value for configurationPresetId, so the miss is silent. The visible consequence
is a run executed under the default configuration (a different model tier) instead of the
one the user explicitly chose, with a plausible-looking result and no error.
There is no column to filter on: the preset lives inside the message body as a JSON
mention blob (@{"type":"agent","id":"…","configId":"…"}). So SQL narrows and the parser
decides — both configId and the agent id appear verbatim in that blob, which makes the
two LIKEs a tight prefilter, and parseMentions is what actually confirms a match.
Newest OUTPUT artifact version an agent produced in this conversation — resolved by QUERY, not by scanning the display array.
The array scan this replaces was correct only while conversationHistory held the whole
conversation. Under transcript windowing it holds one page, so the scan silently returns
null for any artifact below the window's oldest row — exactly the long "modify this
again" exchanges where payload continuity matters most. A null payload is a LEGAL agent
input, so the failure is silent: the agent regenerates from scratch instead of modifying.
One round trip. The subquery walks details -> Output junctions, and versions carry
__mj_CreatedAt, so "newest" is expressible without joining back for Sequence.
Resolve the conversation manager agent via the runtime's 4-step DefaultAgentResolver chain (explicit input → app-scoped Application Setting → global Application Setting → code-const Sage fallback). The result is cached on this service for use by the synchronous ConversationManagerAgentName getter.
Existing callers expect a Promise<MJAIAgentEntityExtended | null> — we preserve that shape (returning null on failure rather than throwing) so the call sites don't need to change.
Invoke a sub-agent based on Sage Agent's payload. This is called when Sage decides to delegate to a specialist agent.
Stays on the Angular shim because it directly uses AgentClientService. Could move to the runtime in a follow-up if needed.
Optionalpayload: Record<string, unknown> | nullOptionalonProgress: AgentExecutionProgressCallbackOptionalsourceArtifactId: stringOptionalsourceArtifactVersionId: stringOptionalagentConfigurationPresetId: stringOptionalappContext: Record<string, unknown> | nullOptionalplanMode: booleanOptionalrequestedSkillIDs: string[]Returns true if the supplied agent identifier (UUID or name) matches the
currently cached conversation manager agent. Robust to either input.
Process a message through the conversation manager agent. Delegates to
ConversationsRuntime.Instance.AgentRunner.processMessage(...).
Signature is preserved verbatim from the original service so existing
call sites continue to compile. The unused conversationHistory
parameter is kept for backwards compatibility (it was already
documented as "kept for backwards compatibility but not used" in the
original).
OptionalonProgress: AgentExecutionProgressCallbackOptionalappContext: Record<string, unknown> | nullOptionalplanMode: booleanOptionalrequestedSkillIDs: string[]
Angular DI service for conversation-level agent orchestration.
After PR 2 of the conversations-runtime extraction, the core
processMessageflow and the conversation-manager-agent resolution are delegated to@memberjunction/conversations-runtime. This service is primarily a shim for those operations PLUS the holder of the helpers that haven't been ported yet:invokeSubAgent(...)— used by Sage's routing decisions inmessage-input.component.checkAgentContinuityIntent(...)— fast intent classification when the user replies to a previous-agent thread.FindConfigurationPresetForAgent(...)— locates an agent's preset from priorMentions
in the conversation.
clearSession(...)— per-conversation session-id bookkeeping.These can move to the runtime in a follow-up; they aren't strictly needed to invoke an agent end-to-end and stay here so the shim has zero behavior difference vs. the original.