import { request } from '@umijs/max';
import { AgentItem, SkillItem } from '@/pages/AgentManager/data';

/** 获取 Agent 列表 */
export async function queryAgentList() {
    return request<{ data: AgentItem[] }>('/api/agents', {
        method: 'GET',
    });
}

/** 获取 Agent Prompt 内容 */
export async function getAgentPrompt(key: string) {
    return request<{ data: string }>(`/api/agents/${key}/prompt`, {
        method: 'GET',
    });
}

/** 更新 Agent 配置 */
export async function updateAgentConfig(data: Partial<AgentItem>) {
    return request('/api/agents/update', {
        method: 'POST',
        data,
    });
}

/** 获取 Skills 列表 */
export async function querySkillList() {
    return request<{ data: SkillItem[] }>('/api/skills', {
        method: 'GET',
    });
}
