diff --git a/apps/jingrow/frontend/src/shared/api/agents.ts b/apps/jingrow/frontend/src/shared/api/agents.ts index 3740294..f4b9e49 100644 --- a/apps/jingrow/frontend/src/shared/api/agents.ts +++ b/apps/jingrow/frontend/src/shared/api/agents.ts @@ -1,10 +1,10 @@ import axios from 'axios' -import type { AIAgent, AgentExecutionResult } from '../types' -import { deleteRecords, createRecord, updateRecord, getFieldSelectOptions, getRecord } from './common' +import type { AIAgent } from '../types' +import { getRecord } from './common' // 重新导出类型,供其他模块使用 -export type { AIAgent, AgentExecutionResult } +export type { AIAgent } // 统一使用相对路径,通过 Vite 代理转发到后端 @@ -73,23 +73,4 @@ export const updateAgentApi = async (name: string, data: Partial): Prom console.error("Error in updateAgentApi:", error) throw new Error(error.response?.data?.message || error.message || '更新AI Agent失败') } -} - -// 创建智能体(使用通用函数) -export const createAgent = async (data: Record): Promise<{ success: boolean; data?: any; message?: string }> => { - return createRecord('Local Ai Agent', data) -} - -// 更新智能体(使用通用函数) -export const updateAgent = async (name: string, data: Record): Promise<{ success: boolean; data?: any; message?: string }> => { - return updateRecord('Local Ai Agent', name, data) -} - -// 删除智能体(支持批量删除) -export const deleteAgents = async (names: string[]): Promise<{ success: boolean; message?: string }> => { - return deleteRecords('Local Ai Agent', names) -} - -// 获取智能体选项(参考节点实现) -export const getAgentStatusOptions = () => getFieldSelectOptions('Local Ai Agent', 'status') -export const getAgentTriggerModeOptions = () => getFieldSelectOptions('Local Ai Agent', 'trigger_mode') \ No newline at end of file +} \ No newline at end of file