mattermost-mobile-upstream/app/components/autocomplete/at_mention/constants.ts
Nick Misasi 7508a583ba
Add AGENT tag in at-mention autocomplete for AI agents (#9507)
* Add agent tag and autocomplete support for AI agents

Display AGENT tag instead of BOT tag for mattermost-ai plugin bots in
at-mention autocomplete and user items. Uses the server's autocomplete
API to reliably distinguish agents from regular bots.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Harden agent e2e test setup: fail on missing bots, surface real errors

Made-with: Cursor

* Address review feedback: add agent tag tests, fix error handling, include agents in search mode

- Add agent_tag.test.tsx unit test matching existing tag test patterns
- Surface real errors in isAgentsPluginActive and getAgentBots instead of swallowing them
- Include agents section in search-mode autocomplete results

Made-with: Cursor

* Apply suggestion from @nickmisasi

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:39:26 -04:00

18 lines
770 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {UserMentionSections} from './types';
import type GroupModel from '@typings/database/models/servers/group';
import type UserModel from '@typings/database/models/servers/user';
export const SECTION_KEY_TEAM_MEMBERS = 'teamMembers';
export const SECTION_KEY_IN_CHANNEL = 'inChannel';
export const SECTION_KEY_OUT_OF_CHANNEL = 'outChannel';
export const SECTION_KEY_SPECIAL = 'special';
export const SECTION_KEY_GROUPS = 'groups';
export const SECTION_KEY_AGENTS = 'agents';
export const emptyUserlList: Array<UserModel | UserProfile> = [];
export const emptySectionList: UserMentionSections = [];
export const emptyGroupList: GroupModel[] = [];