cerevox 2.30.1 → 2.30.3

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.
@@ -715,7 +715,6 @@ server.registerTool('zerocut-project-close', {
715
715
  return createErrorResponse(error, 'zerocut-project-close');
716
716
  }
717
717
  });
718
- // download-outputs 工具已被移除,其功能已集成到 compile-and-run 中
719
718
  // 列出项目下的所有文件
720
719
  server.registerTool('list-project-files', {
721
720
  title: 'List Project Files',
@@ -1644,7 +1643,6 @@ server.registerTool('generate-video', {
1644
1643
  .enum([
1645
1644
  'lite',
1646
1645
  'pro',
1647
- 'pro-fast',
1648
1646
  'hailuo',
1649
1647
  'hailuo-fast',
1650
1648
  'vidu',
@@ -2100,185 +2098,6 @@ server.registerTool('generate-video', {
2100
2098
  return createErrorResponse(error, 'generate-video');
2101
2099
  }
2102
2100
  });
2103
- // server.registerTool(
2104
- // 'generate-video-kenburns',
2105
- // {
2106
- // title: 'Generate Ken Burns Motion Video',
2107
- // description:
2108
- // 'Generate Ken Burns motion video with customizable camera movements.',
2109
- // inputSchema: {
2110
- // image_path: z.string().describe('The start frame image path(not URL).'),
2111
- // duration: z
2112
- // .number()
2113
- // .min(2)
2114
- // .max(16)
2115
- // .describe('The duration of the video.'),
2116
- // camera_motion: z
2117
- // .enum([
2118
- // 'zoom_in',
2119
- // 'zoom_out',
2120
- // 'zoom_in_left_top',
2121
- // 'zoom_out_left_top',
2122
- // 'zoom_in_right_top',
2123
- // 'zoom_out_right_top',
2124
- // 'zoom_in_left_bottom',
2125
- // 'zoom_out_left_bottom',
2126
- // 'zoom_in_right_bottom',
2127
- // 'zoom_out_right_bottom',
2128
- // 'pan_up',
2129
- // 'pan_down',
2130
- // 'pan_left',
2131
- // 'pan_right',
2132
- // 'static',
2133
- // ])
2134
- // .optional()
2135
- // .default('zoom_in')
2136
- // .describe('The camera motion type for Ken Burns effect.'),
2137
- // size: z
2138
- // .enum([
2139
- // '1024x1024',
2140
- // '864x1152',
2141
- // '1152x864',
2142
- // '1280x720',
2143
- // '720x1280',
2144
- // '832x1248',
2145
- // '1248x832',
2146
- // '1512x648',
2147
- // ])
2148
- // .describe('The size of the image.'),
2149
- // saveToFileName: z.string().describe('The filename to save.'),
2150
- // },
2151
- // },
2152
- // async ({
2153
- // image_path,
2154
- // duration,
2155
- // camera_motion = 'zoom_in',
2156
- // size,
2157
- // saveToFileName,
2158
- // }) => {
2159
- // try {
2160
- // // 验证session状态
2161
- // const currentSession = await validateSession('generate-video-kenburns');
2162
- // const validatedFileName = validateFileName(saveToFileName);
2163
- // const files = currentSession.files;
2164
- // const terminal = currentSession.terminal;
2165
- // // 如果 image_path 是文件名,需要拼接完整路径
2166
- // if (dirname(image_path) === '.') {
2167
- // image_path = resolve(
2168
- // '/home/user/cerevox-zerocut/projects',
2169
- // terminal.id,
2170
- // 'materials',
2171
- // image_path
2172
- // );
2173
- // }
2174
- // console.log(
2175
- // `Generating Ken Burns motion: ${image_path} (${duration}s, ${size}, ${camera_motion})`
2176
- // );
2177
- // if (!terminal) {
2178
- // throw new Error('Terminal not available in current session');
2179
- // }
2180
- // const saveToPath = `/home/user/cerevox-zerocut/projects/${terminal.id}/materials/${validatedFileName}`;
2181
- // const saveLocalPath = resolve(
2182
- // projectLocalDir,
2183
- // 'materials',
2184
- // validatedFileName
2185
- // );
2186
- // // 解析尺寸参数
2187
- // const sizeArray = size.split('x');
2188
- // if (sizeArray.length !== 2) {
2189
- // throw new Error(
2190
- // `Invalid size format: ${size}. Expected format: WIDTHxHEIGHT`
2191
- // );
2192
- // }
2193
- // const [widthStr, heightStr] = sizeArray;
2194
- // const width = Number(widthStr);
2195
- // const height = Number(heightStr);
2196
- // if (isNaN(width) || isNaN(height) || width <= 0 || height <= 0) {
2197
- // throw new Error(
2198
- // `Invalid dimensions: ${width}x${height}. Both width and height must be positive numbers`
2199
- // );
2200
- // }
2201
- // console.log(`Compiling Ken Burns motion command...`);
2202
- // let command: string;
2203
- // try {
2204
- // command = await compileKenBurnsMotion(
2205
- // image_path,
2206
- // duration,
2207
- // camera_motion as CameraMotion,
2208
- // {
2209
- // output: saveToPath,
2210
- // width,
2211
- // height,
2212
- // }
2213
- // );
2214
- // } catch (compileError) {
2215
- // console.error(
2216
- // 'Failed to compile Ken Burns motion command:',
2217
- // compileError
2218
- // );
2219
- // throw new Error(`Failed to compile Ken Burns motion: ${compileError}`);
2220
- // }
2221
- // console.log(`Executing FFmpeg command: ${command.substring(0, 100)}...`);
2222
- // const res = await terminal.run(command);
2223
- // const result = await res.json();
2224
- // if (result.exitCode !== 0) {
2225
- // console.error('FFmpeg command failed:', result);
2226
- // return {
2227
- // content: [
2228
- // {
2229
- // type: 'text' as const,
2230
- // text: JSON.stringify({
2231
- // success: false,
2232
- // error: 'Ken Burns motion generation failed',
2233
- // exitCode: result.exitCode,
2234
- // stderr: result.stderr,
2235
- // command,
2236
- // timestamp: new Date().toISOString(),
2237
- // }),
2238
- // },
2239
- // ],
2240
- // };
2241
- // }
2242
- // console.log(
2243
- // 'Ken Burns motion generated successfully, downloading file...'
2244
- // );
2245
- // try {
2246
- // await files.download(saveToPath, saveLocalPath);
2247
- // } catch (downloadError) {
2248
- // console.warn('Failed to download file to local:', downloadError);
2249
- // // 继续执行,因为远程文件已生成成功
2250
- // }
2251
- // const resultData = {
2252
- // success: true,
2253
- // uri: saveToPath,
2254
- // durationMs: Math.floor(duration * 1000),
2255
- // cameraMotion: camera_motion,
2256
- // imagePath: image_path,
2257
- // size,
2258
- // dimensions: { width, height },
2259
- // timestamp: new Date().toISOString(),
2260
- // };
2261
- // console.log(`Ken Burns motion completed: ${saveToPath}`);
2262
- // currentSession.track('KenBurns Video Generated', {
2263
- // durationMs: Math.floor(duration * 1000).toString(),
2264
- // cameraMotion: camera_motion,
2265
- // imagePath: image_path,
2266
- // size,
2267
- // dimensions: size,
2268
- // });
2269
- // return {
2270
- // content: [
2271
- // {
2272
- // type: 'text' as const,
2273
- // text: JSON.stringify(resultData),
2274
- // },
2275
- // ],
2276
- // };
2277
- // } catch (error) {
2278
- // return createErrorResponse(error, 'generate-video-kenburns');
2279
- // }
2280
- // }
2281
- // );
2282
2101
  server.registerTool('generate-sound-effect', {
2283
2102
  title: 'Generate Sound Effect',
2284
2103
  description: 'Generate sound effect with text prompt.',
@@ -2709,7 +2528,10 @@ server.registerTool('compile-and-run', {
2709
2528
  // 检查字幕内容匹配标记
2710
2529
  if (!checkStoryboardSubtitlesFlag) {
2711
2530
  checkStoryboardSubtitlesFlag = true;
2712
- return createErrorResponse('请先检查字幕文字内容是否与 story_board 中各个场景的 script 或 dialog 内容完全一致(允许字幕分段,只要最终文本一致就行),若不匹配,修改 draft_content 使其匹配,返回检查结果,然后再进行合成', 'compile-and-run');
2531
+ return createErrorResponse(`请先进行以下一致性检查:
2532
+
2533
+ 1. 检查字幕文字内容是否与 story_board 中各个场景的 script 或 dialog 内容完全一致(允许字幕分段,只要最终文本一致就行),若不匹配,修改 draft_content 使其匹配返回检查结果,然后再进行合成
2534
+ 2. 除非用户明确表示不要背景音乐,否则检查是否有生成并配置 BGM,如果没有,则生成BGM并修改 draft_content 将 BGM 配置到项目中,然后再进行合成`, 'compile-and-run');
2713
2535
  }
2714
2536
  console.log('Starting video compilation and rendering...');
2715
2537
  // 验证terminal可用性