batchProcess
Automate video editing tasks with a single command. Clip, merge, or split multiple videos in bulk using predefined configurations, saving time and effort through streamlined batch processing.
Instructions
批量处理视频任务
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasks | Yes | 批量任务配置数组 |
Implementation Reference
- src/mcp/server.ts:392-406 (handler)MCP tool handler for 'batchProcess'. Receives batch tasks, adds them to BatchManager queue via addTasks(), and returns task IDs with confirmation message.private async handleBatchProcess(args: MCPToolParams['batchProcess']) { const taskIds = this.batchManager.addTasks(args.tasks); const result: MCPToolResults['batchProcess'] = { taskIds, message: `已添加 ${taskIds.length} 个批量任务到处理队列` }; return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/mcp/server.ts:274-302 (registration)Tool registration in getToolDefinitions(). Defines name, description, and input schema for the batchProcess tool.{ name: 'batchProcess', description: '批量处理视频任务', inputSchema: { type: 'object', properties: { tasks: { type: 'array', items: { type: 'object', properties: { type: { type: 'string', enum: ['clip', 'merge', 'split'], description: '任务类型' }, options: { type: 'object', description: '任务参数' } }, required: ['type', 'options'] }, description: '批量任务配置数组' } }, required: ['tasks'] } },
- src/types/mcp.ts:31-33 (schema)TypeScript type definition for batchProcess input parameters (MCPToolParams).batchProcess: { tasks: Omit<BatchTask, 'id' | 'status' | 'createdAt'>[]; };
- src/types/mcp.ts:55-58 (schema)TypeScript type definition for batchProcess output result (MCPToolResults).batchProcess: { taskIds: string[]; message: string; };
- src/core/batch-manager.ts:38-60 (helper)Core helper method in BatchManager that creates task entries, adds to processing queue, triggers processQueue(), and returns task IDs. This implements the batch queuing logic called by the handler.public addTasks(taskConfigs: Omit<BatchTask, 'id' | 'status' | 'createdAt'>[]): string[] { const taskIds: string[] = []; for (const config of taskConfigs) { const taskId = uuidv4(); const task: BatchTask = { id: taskId, type: config.type, options: config.options, status: 'pending', createdAt: new Date() }; this.tasks.set(taskId, task); this.processingQueue.push(taskId); taskIds.push(taskId); } // 开始处理队列 this.processQueue(); return taskIds; }