| | |
| | | output_dir?: string; |
| | | } |
| | | |
| | | export interface SandboxTask { |
| | | id: string; |
| | | tool: string; |
| | | model: string; |
| | | input?: Record<string, any>; |
| | | status: string; |
| | | progress?: number; |
| | | created_at?: string; |
| | | } |
| | | |
| | | export interface PipelineStartResponse { |
| | | task_id: string; |
| | | pipeline: string; |
| | |
| | | return resp.json(); |
| | | } |
| | | |
| | | export async function fetchSandboxTasks(): Promise<SandboxTask[]> { |
| | | const resp = await fetch('/api/sandbox/tasks'); |
| | | if (!resp.ok) return []; |
| | | const data = await resp.json(); |
| | | return data.tasks || []; |
| | | } |
| | | |
| | | export async function deletePipelineTask(taskId: string): Promise<void> { |
| | | const resp = await fetch(`/api/tasks/${taskId}`, { method: 'DELETE' }); |
| | | if (!resp.ok) throw new Error('删除任务失败'); |