UNPKG

mattermost-redux

Version:

Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client

27 lines (26 loc) 918 B
"use strict"; // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.getAgents = getAgents; exports.getAgentsStatus = getAgentsStatus; exports.getAgent = getAgent; exports.getDefaultAgent = getDefaultAgent; exports.getLLMServices = getLLMServices; function getAgents(state) { return state.entities.agents?.agents || []; } function getAgentsStatus(state) { return state.entities.agents?.agentsStatus || { available: false }; } function getAgent(state, agentId) { const agents = getAgents(state); return agents.find((agent) => agent.id === agentId); } function getDefaultAgent(state) { const agents = getAgents(state); return agents?.find((agent) => agent.is_default === true); } function getLLMServices(state) { return state.entities.agents?.llmServices || []; }