'use server';
import { resolve } from '../../lib/server-container.js';
import { getSettings } from '../../../../../packages/core/src/infrastructure/services/settings.service.js';
/**
 * Server action that returns the LLM model identifiers supported by the
 * currently configured agent executor.
 *
 * Resolves IAgentExecutorFactory from the DI container and calls
 * getSupportedModels for the agent type stored in settings.
 *
 * @returns Array of model identifier strings, or [] on error.
 */
export async function getSupportedModels() {
    try {
        const settings = getSettings();
        const agentType = settings.agent.type;
        const factory = resolve('IAgentExecutorFactory');
        return factory.getSupportedModels(agentType);
    }
    catch (_error) {
        // Settings may not be initialized in some test/preview environments
        return [];
    }
}
