auto-sync: 2026-05-18 11:52:39
This commit is contained in:
@@ -253,6 +253,25 @@ export const api = {
|
||||
artifacts: async (taskId: string): Promise<ArtifactsResult> => ({
|
||||
ok: true, deliverable: null, nodes: [],
|
||||
}),
|
||||
|
||||
// ── v2.7: Task 进度 + 子 Task ──
|
||||
|
||||
taskProgress: async (taskId: string): Promise<TaskProgress | null> => {
|
||||
try {
|
||||
const pid = _currentProjectId || Object.keys((await api.projects()).projects)[0];
|
||||
if (!pid) return null;
|
||||
return fetchJ<TaskProgress>(`${API_BASE}/api/projects/${pid}/tasks/${taskId}/progress`);
|
||||
} catch { return null; }
|
||||
},
|
||||
|
||||
listSubtasks: async (parentId: string): Promise<Task[]> => {
|
||||
try {
|
||||
const pid = _currentProjectId || Object.keys((await api.projects()).projects)[0];
|
||||
if (!pid) return [];
|
||||
const data = await fetchJ<{ tasks: any[] }>(`${API_BASE}/api/projects/${pid}/tasks?parent_task=${parentId}`);
|
||||
return (data.tasks || []).map(adaptTask);
|
||||
} catch { return []; }
|
||||
},
|
||||
artifactPreview: async (taskId: string, path: string): Promise<ArtifactPreviewResult> => ({
|
||||
ok: false, previewable: false, name: '', type: '', render_as: '', size: 0, content: null,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user