@effectnode/media 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/effectnode-media +2 -0
- package/dist/backend/index.d.ts +8 -0
- package/dist/backend/index.js +13 -0
- package/dist/backend/movie-backend/agent/agent-backend.d.ts +16 -0
- package/dist/backend/movie-backend/agent/agent-backend.js +703 -0
- package/dist/backend/movie-backend/agent/storyprompt.d.ts +1 -0
- package/dist/backend/movie-backend/agent/storyprompt.js +90 -0
- package/dist/backend/movie-backend/agent/tools/edit-image.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/edit-image.js +192 -0
- package/dist/backend/movie-backend/agent/tools/get-time.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/get-time.js +7 -0
- package/dist/backend/movie-backend/agent/tools/grep-files.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/grep-files.js +59 -0
- package/dist/backend/movie-backend/agent/tools/image-to-video-generation.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/image-to-video-generation.js +160 -0
- package/dist/backend/movie-backend/agent/tools/index.d.ts +7 -0
- package/dist/backend/movie-backend/agent/tools/index.js +59 -0
- package/dist/backend/movie-backend/agent/tools/list-files.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/list-files.js +17 -0
- package/dist/backend/movie-backend/agent/tools/read-file.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/read-file.js +28 -0
- package/dist/backend/movie-backend/agent/tools/remove-file.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/remove-file.js +22 -0
- package/dist/backend/movie-backend/agent/tools/rename-file.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/rename-file.js +37 -0
- package/dist/backend/movie-backend/agent/tools/show-image.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/show-image.js +28 -0
- package/dist/backend/movie-backend/agent/tools/stitch-videos.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/stitch-videos.js +96 -0
- package/dist/backend/movie-backend/agent/tools/text-to-video-generation.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/text-to-video-generation.js +125 -0
- package/dist/backend/movie-backend/agent/tools/types.d.ts +15 -0
- package/dist/backend/movie-backend/agent/tools/types.js +1 -0
- package/dist/backend/movie-backend/agent/tools/update-file.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/update-file.js +27 -0
- package/dist/backend/movie-backend/agent/tools/write-file.d.ts +3 -0
- package/dist/backend/movie-backend/agent/tools/write-file.js +26 -0
- package/dist/backend/movie-backend/agent/workspace.d.ts +25 -0
- package/dist/backend/movie-backend/agent/workspace.js +124 -0
- package/dist/backend/movie-backend/core.d.ts +4 -0
- package/dist/backend/movie-backend/core.js +1167 -0
- package/dist/backend/movie-backend/generation-queue.d.ts +24 -0
- package/dist/backend/movie-backend/generation-queue.js +766 -0
- package/dist/backend/movie-backend/process.d.ts +21 -0
- package/dist/backend/movie-backend/process.js +98 -0
- package/dist/backend/movie-backend/render-media.d.ts +48 -0
- package/dist/backend/movie-backend/render-media.js +3311 -0
- package/dist/backend/routes/health.d.ts +1 -0
- package/dist/backend/routes/health.js +9 -0
- package/dist/backend/routes/index.d.ts +1 -0
- package/dist/backend/routes/index.js +11 -0
- package/dist/backend/routes/media.d.ts +1 -0
- package/dist/backend/routes/media.js +13 -0
- package/dist/backend/routes/projects.d.ts +8 -0
- package/dist/backend/routes/projects.js +68 -0
- package/dist/backend/routes/voice.d.ts +1 -0
- package/dist/backend/routes/voice.js +39 -0
- package/dist/backend/routes.d.ts +1 -0
- package/dist/backend/routes.js +20 -0
- package/dist/backend/server.d.ts +1 -0
- package/dist/backend/server.js +23 -0
- package/dist/backend/workspace.d.ts +5 -0
- package/dist/backend/workspace.js +27 -0
- package/dist/backend/ws/index.d.ts +3 -0
- package/dist/backend/ws/index.js +27 -0
- package/dist/backend/ws/messages.d.ts +8 -0
- package/dist/backend/ws/messages.js +21 -0
- package/dist/backend/ws.d.ts +3 -0
- package/dist/backend/ws.js +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +80 -0
- package/frontend/index.html +22 -0
- package/frontend/public/ffmpeg/ffmpeg-core.js +16 -0
- package/frontend/public/ffmpeg/ffmpeg-core.wasm +0 -0
- package/frontend/src/index.css +46 -0
- package/frontend/src/main.tsx +13 -0
- package/frontend/src/movie-app/AppRouter.tsx +14 -0
- package/frontend/src/movie-app/MediaStudio.tsx +9 -0
- package/frontend/src/movie-app/SetupPage.tsx +293 -0
- package/frontend/src/movie-app/components/AgentWorkspace.tsx +574 -0
- package/frontend/src/movie-app/components/ChatUI/ChatUI.tsx +655 -0
- package/frontend/src/movie-app/components/ChatUI/MarkdownMessage.tsx +267 -0
- package/frontend/src/movie-app/components/EditorTabs/AgentTab.tsx +61 -0
- package/frontend/src/movie-app/components/EditorTabs/BatchImageToVideoTab.tsx +927 -0
- package/frontend/src/movie-app/components/EditorTabs/BatchVideoTab.tsx +777 -0
- package/frontend/src/movie-app/components/EditorTabs/BatchVoiceVideoTab.tsx +913 -0
- package/frontend/src/movie-app/components/EditorTabs/CharacterSheet.tsx +234 -0
- package/frontend/src/movie-app/components/EditorTabs/CharactersTab.tsx +664 -0
- package/frontend/src/movie-app/components/EditorTabs/CropTool.tsx +251 -0
- package/frontend/src/movie-app/components/EditorTabs/ExtendVideoTab.tsx +305 -0
- package/frontend/src/movie-app/components/EditorTabs/ExtractImageTab.tsx +249 -0
- package/frontend/src/movie-app/components/EditorTabs/FastImageEditTab.tsx +555 -0
- package/frontend/src/movie-app/components/EditorTabs/GenerateVideoTab.tsx +722 -0
- package/frontend/src/movie-app/components/EditorTabs/LlmServerTab.tsx +40 -0
- package/frontend/src/movie-app/components/EditorTabs/MlxVlmServerPanel.tsx +490 -0
- package/frontend/src/movie-app/components/EditorTabs/MovieStudioTab.tsx +938 -0
- package/frontend/src/movie-app/components/EditorTabs/ReferencesToVideoTab.tsx +881 -0
- package/frontend/src/movie-app/components/EditorTabs/SceneVisualTab.tsx +267 -0
- package/frontend/src/movie-app/components/EditorTabs/StoryWriterTab.tsx +51 -0
- package/frontend/src/movie-app/components/EditorTabs/TaskQueuePanel.tsx +246 -0
- package/frontend/src/movie-app/components/EditorTabs/TerminalLogPanel.tsx +49 -0
- package/frontend/src/movie-app/components/EditorTabs/TextToImageTab.tsx +574 -0
- package/frontend/src/movie-app/components/EditorTabs/VoiceChatPanel.tsx +320 -0
- package/frontend/src/movie-app/components/ProjectEditorPage.tsx +636 -0
- package/frontend/src/movie-app/components/ProjectManager.tsx +381 -0
- package/frontend/src/movie-app/index.css +46 -0
- package/frontend/src/movie-app/index.html +16 -0
- package/frontend/src/movie-app/lambobo.png +0 -0
- package/frontend/src/movie-app/lib/batchImageToVideoStorage.ts +69 -0
- package/frontend/src/movie-app/lib/batchVideoStorage.ts +68 -0
- package/frontend/src/movie-app/lib/batchVoiceStorage.ts +75 -0
- package/frontend/src/movie-app/lib/ffmpeg.ts +42 -0
- package/frontend/src/movie-app/lib/referencesToVideoStorage.ts +64 -0
- package/frontend/src/movie-app/lib/textToImageStorage.ts +61 -0
- package/frontend/src/movie-app/public/ffmpeg/ffmpeg-core.js +16 -0
- package/frontend/src/movie-app/public/ffmpeg/ffmpeg-core.wasm +0 -0
- package/frontend/src/movie-app/stores/batchImageToVideoStore.ts +736 -0
- package/frontend/src/movie-app/stores/batchVideoStore.ts +670 -0
- package/frontend/src/movie-app/stores/batchVoiceStore.ts +990 -0
- package/frontend/src/movie-app/stores/characterStore.ts +109 -0
- package/frontend/src/movie-app/stores/chatStore.ts +459 -0
- package/frontend/src/movie-app/stores/generationStore.ts +2140 -0
- package/frontend/src/movie-app/stores/logStore.ts +25 -0
- package/frontend/src/movie-app/stores/movieStudioStore.ts +709 -0
- package/frontend/src/movie-app/stores/projectStore.ts +124 -0
- package/frontend/src/movie-app/stores/queueStore.ts +214 -0
- package/frontend/src/movie-app/stores/referencesToVideoStore.ts +467 -0
- package/frontend/src/movie-app/stores/sceneVisualStore.ts +251 -0
- package/frontend/src/movie-app/stores/voiceChatStore.ts +170 -0
- package/frontend/src/movie-app/stores/workspaceStore.ts +158 -0
- package/frontend/src/vite-env.d.ts +1 -0
- package/frontend/tsconfig.json +19 -0
- package/package.json +65 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
|
|
3
|
+
export interface Project {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ProjectStore {
|
|
12
|
+
projects: Project[];
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error: string | null;
|
|
15
|
+
|
|
16
|
+
fetchProjects: () => Promise<void>;
|
|
17
|
+
createProject: (name: string, description: string) => Promise<Project | null>;
|
|
18
|
+
updateProject: (id: string, data: { name?: string; description?: string }) => Promise<Project | null>;
|
|
19
|
+
deleteProject: (id: string) => Promise<boolean>;
|
|
20
|
+
openInFinder: (id: string) => Promise<boolean>;
|
|
21
|
+
openFolder: (id: string, type: "upload" | "output") => Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const API_BASE = `http://localhost:${(window as any).PORT}`;
|
|
25
|
+
|
|
26
|
+
export const useProjectStore = create<ProjectStore>((set, get) => ({
|
|
27
|
+
projects: [],
|
|
28
|
+
loading: false,
|
|
29
|
+
error: null,
|
|
30
|
+
|
|
31
|
+
fetchProjects: async () => {
|
|
32
|
+
set({ loading: true, error: null });
|
|
33
|
+
try {
|
|
34
|
+
const res = await fetch(`${API_BASE}/api/projects`);
|
|
35
|
+
const projects = await res.json();
|
|
36
|
+
set({ projects, loading: false });
|
|
37
|
+
} catch (e) {
|
|
38
|
+
set({ error: String(e), loading: false });
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
createProject: async (name, description) => {
|
|
43
|
+
set({ error: null });
|
|
44
|
+
try {
|
|
45
|
+
const res = await fetch(`${API_BASE}/api/projects`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: { "Content-Type": "application/json" },
|
|
48
|
+
body: JSON.stringify({ name, description }),
|
|
49
|
+
});
|
|
50
|
+
if (!res.ok) throw new Error(await res.text());
|
|
51
|
+
const project = await res.json();
|
|
52
|
+
set({ projects: [...get().projects, project] });
|
|
53
|
+
return project;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
set({ error: String(e) });
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
updateProject: async (id, data) => {
|
|
61
|
+
set({ error: null });
|
|
62
|
+
try {
|
|
63
|
+
const res = await fetch(`${API_BASE}/api/projects/${id}`, {
|
|
64
|
+
method: "PUT",
|
|
65
|
+
headers: { "Content-Type": "application/json" },
|
|
66
|
+
body: JSON.stringify(data),
|
|
67
|
+
});
|
|
68
|
+
if (!res.ok) throw new Error(await res.text());
|
|
69
|
+
const updated = await res.json();
|
|
70
|
+
set({
|
|
71
|
+
projects: get().projects.map((p) => (p.id === id ? updated : p)),
|
|
72
|
+
});
|
|
73
|
+
return updated;
|
|
74
|
+
} catch (e) {
|
|
75
|
+
set({ error: String(e) });
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
deleteProject: async (id) => {
|
|
81
|
+
set({ error: null });
|
|
82
|
+
try {
|
|
83
|
+
const res = await fetch(`${API_BASE}/api/projects/${id}`, {
|
|
84
|
+
method: "DELETE",
|
|
85
|
+
});
|
|
86
|
+
if (!res.ok) throw new Error(await res.text());
|
|
87
|
+
set({ projects: get().projects.filter((p) => p.id !== id) });
|
|
88
|
+
return true;
|
|
89
|
+
} catch (e) {
|
|
90
|
+
set({ error: String(e) });
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
openInFinder: async (id) => {
|
|
96
|
+
set({ error: null });
|
|
97
|
+
try {
|
|
98
|
+
const res = await fetch(`${API_BASE}/api/projects/${id}/open-in-finder`, {
|
|
99
|
+
method: "POST",
|
|
100
|
+
});
|
|
101
|
+
if (!res.ok) throw new Error(await res.text());
|
|
102
|
+
return true;
|
|
103
|
+
} catch (e) {
|
|
104
|
+
set({ error: String(e) });
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
openFolder: async (id, type) => {
|
|
110
|
+
set({ error: null });
|
|
111
|
+
try {
|
|
112
|
+
const res = await fetch(`${API_BASE}/api/projects/${id}/open-folder`, {
|
|
113
|
+
method: "POST",
|
|
114
|
+
headers: { "Content-Type": "application/json" },
|
|
115
|
+
body: JSON.stringify({ type }),
|
|
116
|
+
});
|
|
117
|
+
if (!res.ok) throw new Error(await res.text());
|
|
118
|
+
return true;
|
|
119
|
+
} catch (e) {
|
|
120
|
+
set({ error: String(e) });
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
}));
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { create } from "zustand";
|
|
2
|
+
|
|
3
|
+
const API_BASE = `http://localhost:${(window as any).PORT}`;
|
|
4
|
+
|
|
5
|
+
export type QueueTaskType =
|
|
6
|
+
| "generate"
|
|
7
|
+
| "render"
|
|
8
|
+
| "render-assets"
|
|
9
|
+
| "render-videos"
|
|
10
|
+
| "render-scene-images"
|
|
11
|
+
| "regenerate-asset"
|
|
12
|
+
| "regenerate-video"
|
|
13
|
+
| "regenerate-scene-image";
|
|
14
|
+
|
|
15
|
+
export type QueueTaskStatus =
|
|
16
|
+
| "pending"
|
|
17
|
+
| "running"
|
|
18
|
+
| "completed"
|
|
19
|
+
| "failed"
|
|
20
|
+
| "cancelled"
|
|
21
|
+
| "paused";
|
|
22
|
+
|
|
23
|
+
export interface QueueTask {
|
|
24
|
+
id: string;
|
|
25
|
+
type: QueueTaskType;
|
|
26
|
+
label: string;
|
|
27
|
+
status: QueueTaskStatus;
|
|
28
|
+
progress: { current: number; total: number } | null;
|
|
29
|
+
statusText: string | null;
|
|
30
|
+
error: string | null;
|
|
31
|
+
payload: any;
|
|
32
|
+
result: any;
|
|
33
|
+
createdAt: number;
|
|
34
|
+
startedAt: number | null;
|
|
35
|
+
completedAt: number | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface QueueStore {
|
|
39
|
+
tasks: QueueTask[];
|
|
40
|
+
loading: boolean;
|
|
41
|
+
projectId: string | null;
|
|
42
|
+
paused: boolean;
|
|
43
|
+
logs: string;
|
|
44
|
+
refresh: (projectId: string) => Promise<void>;
|
|
45
|
+
refreshLogs: (projectId: string) => Promise<void>;
|
|
46
|
+
startStreaming: (projectId: string) => void;
|
|
47
|
+
stopStreaming: () => void;
|
|
48
|
+
cancel: (projectId: string, taskId: string) => Promise<void>;
|
|
49
|
+
cancelActive: (projectId: string) => Promise<void>;
|
|
50
|
+
clearFinished: (projectId: string) => Promise<void>;
|
|
51
|
+
pause: (projectId: string) => Promise<void>;
|
|
52
|
+
resume: (projectId: string) => Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let eventSource: EventSource | null = null;
|
|
56
|
+
|
|
57
|
+
/** Upsert a task into the list, replacing any existing entry with the same id. */
|
|
58
|
+
function upsertTask(tasks: QueueTask[], task: QueueTask): QueueTask[] {
|
|
59
|
+
const index = tasks.findIndex((t) => t.id === task.id);
|
|
60
|
+
if (index === -1) return [...tasks, task];
|
|
61
|
+
const next = tasks.slice();
|
|
62
|
+
next[index] = task;
|
|
63
|
+
return next;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const useQueueStore = create<QueueStore>((set, get) => ({
|
|
67
|
+
tasks: [],
|
|
68
|
+
loading: false,
|
|
69
|
+
projectId: null,
|
|
70
|
+
paused: false,
|
|
71
|
+
logs: "",
|
|
72
|
+
|
|
73
|
+
refresh: async (projectId) => {
|
|
74
|
+
try {
|
|
75
|
+
const res = await fetch(
|
|
76
|
+
`${API_BASE}/api/queue?projectId=${encodeURIComponent(projectId)}`,
|
|
77
|
+
);
|
|
78
|
+
if (!res.ok) return;
|
|
79
|
+
const data = (await res.json()) as { tasks: QueueTask[]; paused: boolean };
|
|
80
|
+
set({
|
|
81
|
+
tasks: Array.isArray(data.tasks) ? data.tasks : [],
|
|
82
|
+
paused: Boolean(data.paused),
|
|
83
|
+
projectId,
|
|
84
|
+
loading: false,
|
|
85
|
+
});
|
|
86
|
+
} catch {
|
|
87
|
+
set({ loading: false });
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
refreshLogs: async (projectId) => {
|
|
92
|
+
try {
|
|
93
|
+
const res = await fetch(
|
|
94
|
+
`${API_BASE}/api/logs?projectId=${encodeURIComponent(projectId)}`,
|
|
95
|
+
);
|
|
96
|
+
if (!res.ok) return;
|
|
97
|
+
const data = (await res.json()) as { logs: string };
|
|
98
|
+
set({ logs: data.logs ?? "" });
|
|
99
|
+
} catch {
|
|
100
|
+
// ignore log fetch failures
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
startStreaming: (projectId) => {
|
|
105
|
+
get().stopStreaming();
|
|
106
|
+
set({ projectId, loading: true });
|
|
107
|
+
void get().refresh(projectId);
|
|
108
|
+
void get().refreshLogs(projectId);
|
|
109
|
+
|
|
110
|
+
const es = new EventSource(
|
|
111
|
+
`${API_BASE}/api/events?projectId=${encodeURIComponent(projectId)}`,
|
|
112
|
+
);
|
|
113
|
+
eventSource = es;
|
|
114
|
+
|
|
115
|
+
es.addEventListener("task", (event) => {
|
|
116
|
+
try {
|
|
117
|
+
const task = JSON.parse((event as MessageEvent).data) as QueueTask;
|
|
118
|
+
set((s) => ({ tasks: upsertTask(s.tasks, task) }));
|
|
119
|
+
} catch {
|
|
120
|
+
// ignore malformed events
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
es.addEventListener("log", (event) => {
|
|
125
|
+
try {
|
|
126
|
+
const data = JSON.parse((event as MessageEvent).data) as {
|
|
127
|
+
text: string;
|
|
128
|
+
};
|
|
129
|
+
set((s) => ({ logs: s.logs + (data.text ?? "") }));
|
|
130
|
+
} catch {
|
|
131
|
+
// ignore malformed events
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// On (re)connect, re-sync full state to catch anything missed while offline.
|
|
136
|
+
es.onopen = () => {
|
|
137
|
+
void get().refresh(projectId);
|
|
138
|
+
void get().refreshLogs(projectId);
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
stopStreaming: () => {
|
|
143
|
+
if (eventSource) {
|
|
144
|
+
eventSource.close();
|
|
145
|
+
eventSource = null;
|
|
146
|
+
}
|
|
147
|
+
set({ tasks: [], projectId: null, loading: false, paused: false, logs: "" });
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
cancel: async (projectId, taskId) => {
|
|
151
|
+
try {
|
|
152
|
+
await fetch(`${API_BASE}/api/queue/cancel`, {
|
|
153
|
+
method: "POST",
|
|
154
|
+
headers: { "Content-Type": "application/json" },
|
|
155
|
+
body: JSON.stringify({ projectId, taskId }),
|
|
156
|
+
});
|
|
157
|
+
} catch {
|
|
158
|
+
// ignore cancel failures
|
|
159
|
+
}
|
|
160
|
+
void get().refresh(projectId);
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
cancelActive: async (projectId) => {
|
|
164
|
+
try {
|
|
165
|
+
await fetch(`${API_BASE}/api/queue/cancel-active`, {
|
|
166
|
+
method: "POST",
|
|
167
|
+
headers: { "Content-Type": "application/json" },
|
|
168
|
+
body: JSON.stringify({ projectId }),
|
|
169
|
+
});
|
|
170
|
+
} catch {
|
|
171
|
+
// ignore cancel failures
|
|
172
|
+
}
|
|
173
|
+
void get().refresh(projectId);
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
clearFinished: async (projectId) => {
|
|
177
|
+
try {
|
|
178
|
+
await fetch(`${API_BASE}/api/queue/clear`, {
|
|
179
|
+
method: "POST",
|
|
180
|
+
headers: { "Content-Type": "application/json" },
|
|
181
|
+
body: JSON.stringify({ projectId }),
|
|
182
|
+
});
|
|
183
|
+
} catch {
|
|
184
|
+
// ignore clear failures
|
|
185
|
+
}
|
|
186
|
+
void get().refresh(projectId);
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
pause: async (projectId) => {
|
|
190
|
+
try {
|
|
191
|
+
await fetch(`${API_BASE}/api/queue/pause`, {
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: { "Content-Type": "application/json" },
|
|
194
|
+
body: JSON.stringify({ projectId }),
|
|
195
|
+
});
|
|
196
|
+
} catch {
|
|
197
|
+
// ignore pause failures
|
|
198
|
+
}
|
|
199
|
+
void get().refresh(projectId);
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
resume: async (projectId) => {
|
|
203
|
+
try {
|
|
204
|
+
await fetch(`${API_BASE}/api/queue/resume`, {
|
|
205
|
+
method: "POST",
|
|
206
|
+
headers: { "Content-Type": "application/json" },
|
|
207
|
+
body: JSON.stringify({ projectId }),
|
|
208
|
+
});
|
|
209
|
+
} catch {
|
|
210
|
+
// ignore resume failures
|
|
211
|
+
}
|
|
212
|
+
void get().refresh(projectId);
|
|
213
|
+
},
|
|
214
|
+
}));
|