Member Junction
    Preparing search index...

    Parses @-mentions out of conversation message text.

    Pure logic — no framework deps, no I/O, no observable state. Safe to call from browser, Node, tests, or anywhere TypeScript runs.

    Consumers usually access this via ConversationsRuntime.Instance.Mentions.

    Index

    Constructors

    Methods

    • Rewrite mentions in text to a canonical @Name format using the proper casing from mentions. Useful when normalizing user-typed mentions before storage or display.

      Parameters

      Returns string

    • Parse every mention out of the supplied text.

      Tries JSON format first; if no JSON mentions are present, falls back to the legacy text format and resolves names against availableAgents / availableUsers.

      Parameters

      • text: string

        Message text to parse

      • availableAgents: MJAIAgentEntityExtended[]

        Agents to resolve legacy @Name references against

      • OptionalavailableUsers: UserInfo[]

        Optional users to resolve legacy @Name references against

      Returns MentionParseResult

      Parsed mentions with agent/user separation

      const result = parser.parseMentions(
      '@Sage help me with this',
      AIEngineBase.Instance.Agents
      );
      if (result.agentMention) {
      // Route the message to result.agentMention.id
      }