opencode-nanobanana 0.2.0 → 0.2.1

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.
Files changed (85) hide show
  1. package/dist/index.d.ts +9 -8
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +25 -8
  4. package/dist/index.js.map +1 -1
  5. package/dist/plugin.d.ts +0 -15
  6. package/dist/plugin.d.ts.map +1 -1
  7. package/dist/plugin.js +214 -194
  8. package/dist/plugin.js.map +1 -1
  9. package/dist/providers/gemini.d.ts +11 -0
  10. package/dist/providers/gemini.d.ts.map +1 -1
  11. package/dist/providers/gemini.js +30 -0
  12. package/dist/providers/gemini.js.map +1 -1
  13. package/package.json +3 -3
  14. package/dist/platforms/android.d.ts +0 -94
  15. package/dist/platforms/android.d.ts.map +0 -1
  16. package/dist/platforms/android.js +0 -123
  17. package/dist/platforms/android.js.map +0 -1
  18. package/dist/platforms/ios.d.ts +0 -51
  19. package/dist/platforms/ios.d.ts.map +0 -1
  20. package/dist/platforms/ios.js +0 -149
  21. package/dist/platforms/ios.js.map +0 -1
  22. package/dist/platforms/macos.d.ts +0 -33
  23. package/dist/platforms/macos.d.ts.map +0 -1
  24. package/dist/platforms/macos.js +0 -50
  25. package/dist/platforms/macos.js.map +0 -1
  26. package/dist/platforms/watchos.d.ts +0 -36
  27. package/dist/platforms/watchos.d.ts.map +0 -1
  28. package/dist/platforms/watchos.js +0 -113
  29. package/dist/platforms/watchos.js.map +0 -1
  30. package/dist/platforms/web.d.ts +0 -64
  31. package/dist/platforms/web.d.ts.map +0 -1
  32. package/dist/platforms/web.js +0 -96
  33. package/dist/platforms/web.js.map +0 -1
  34. package/dist/tools/analyze/compare.d.ts +0 -12
  35. package/dist/tools/analyze/compare.d.ts.map +0 -1
  36. package/dist/tools/analyze/compare.js +0 -83
  37. package/dist/tools/analyze/compare.js.map +0 -1
  38. package/dist/tools/analyze/mockup.d.ts +0 -12
  39. package/dist/tools/analyze/mockup.d.ts.map +0 -1
  40. package/dist/tools/analyze/mockup.js +0 -88
  41. package/dist/tools/analyze/mockup.js.map +0 -1
  42. package/dist/tools/analyze/screenshot.d.ts +0 -12
  43. package/dist/tools/analyze/screenshot.d.ts.map +0 -1
  44. package/dist/tools/analyze/screenshot.js +0 -61
  45. package/dist/tools/analyze/screenshot.js.map +0 -1
  46. package/dist/tools/app-assets/app-icon.d.ts +0 -9
  47. package/dist/tools/app-assets/app-icon.d.ts.map +0 -1
  48. package/dist/tools/app-assets/app-icon.js +0 -133
  49. package/dist/tools/app-assets/app-icon.js.map +0 -1
  50. package/dist/tools/app-assets/device-mockup.d.ts +0 -9
  51. package/dist/tools/app-assets/device-mockup.d.ts.map +0 -1
  52. package/dist/tools/app-assets/device-mockup.js +0 -139
  53. package/dist/tools/app-assets/device-mockup.js.map +0 -1
  54. package/dist/tools/app-assets/launch-images.d.ts +0 -3
  55. package/dist/tools/app-assets/launch-images.d.ts.map +0 -1
  56. package/dist/tools/app-assets/launch-images.js +0 -171
  57. package/dist/tools/app-assets/launch-images.js.map +0 -1
  58. package/dist/tools/app-assets/resize-devices.d.ts +0 -14
  59. package/dist/tools/app-assets/resize-devices.d.ts.map +0 -1
  60. package/dist/tools/app-assets/resize-devices.js +0 -296
  61. package/dist/tools/app-assets/resize-devices.js.map +0 -1
  62. package/dist/tools/app-assets/screenshots.d.ts +0 -14
  63. package/dist/tools/app-assets/screenshots.d.ts.map +0 -1
  64. package/dist/tools/app-assets/screenshots.js +0 -186
  65. package/dist/tools/app-assets/screenshots.js.map +0 -1
  66. package/dist/tools/core/edit-image.d.ts +0 -12
  67. package/dist/tools/core/edit-image.d.ts.map +0 -1
  68. package/dist/tools/core/edit-image.js +0 -102
  69. package/dist/tools/core/edit-image.js.map +0 -1
  70. package/dist/tools/core/generate-image.d.ts +0 -12
  71. package/dist/tools/core/generate-image.d.ts.map +0 -1
  72. package/dist/tools/core/generate-image.js +0 -96
  73. package/dist/tools/core/generate-image.js.map +0 -1
  74. package/dist/tools/core/restore-image.d.ts +0 -12
  75. package/dist/tools/core/restore-image.d.ts.map +0 -1
  76. package/dist/tools/core/restore-image.js +0 -104
  77. package/dist/tools/core/restore-image.js.map +0 -1
  78. package/dist/tools/design/mockup-to-code.d.ts +0 -3
  79. package/dist/tools/design/mockup-to-code.d.ts.map +0 -1
  80. package/dist/tools/design/mockup-to-code.js +0 -311
  81. package/dist/tools/design/mockup-to-code.js.map +0 -1
  82. package/dist/tools/design/sketch-to-code.d.ts +0 -3
  83. package/dist/tools/design/sketch-to-code.d.ts.map +0 -1
  84. package/dist/tools/design/sketch-to-code.js +0 -325
  85. package/dist/tools/design/sketch-to-code.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- export * from './providers/gemini.js';
2
- export * from './utils/file-handler.js';
3
- export * from './utils/image-processing.js';
4
- export * from './utils/ffmpeg.js';
5
- export * from './tools/video/generate-video.js';
6
- export * from './tools/video/image-to-video.js';
7
- export * from './tools/video/storyboard-video.js';
8
- export * from './tools/video/extend-video.js';
1
+ /**
2
+ * OpenCode Visual Toolkit
3
+ *
4
+ * A comprehensive plugin providing visual capabilities:
5
+ * - Image generation (Nano Banana)
6
+ * - Visual analysis
7
+ * - Design-to-code
8
+ * - App asset pipelines (iOS, Android, macOS, Web)
9
+ */
9
10
  export { default } from './plugin.js';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,27 @@
1
- export * from './providers/gemini.js';
2
- export * from './utils/file-handler.js';
3
- export * from './utils/image-processing.js';
4
- export * from './utils/ffmpeg.js';
5
- export * from './tools/video/generate-video.js';
6
- export * from './tools/video/image-to-video.js';
7
- export * from './tools/video/storyboard-video.js';
8
- export * from './tools/video/extend-video.js';
1
+ /**
2
+ * OpenCode Visual Toolkit
3
+ *
4
+ * A comprehensive plugin providing visual capabilities:
5
+ * - Image generation (Nano Banana)
6
+ * - Visual analysis
7
+ * - Design-to-code
8
+ * - App asset pipelines (iOS, Android, macOS, Web)
9
+ */
10
+ // WORKAROUND for OpenCode v1.1.23 plugin loader bug:
11
+ // OpenCode v1.1.23's plugin loader incorrectly tries to call ALL exported
12
+ // functions during plugin loading, causing errors. We can only export the
13
+ // plugin default export until this is fixed upstream.
14
+ // See: https://github.com/anomalyco/opencode/issues/[ISSUE_NUMBER]
15
+ //
16
+ // Original exports (for programmatic API usage - currently disabled):
17
+ // export * from './providers/gemini.js';
18
+ // export * from './utils/file-handler.js';
19
+ // export * from './utils/image-processing.js';
20
+ // export * from './utils/ffmpeg.js';
21
+ // export * from './tools/video/generate-video.js';
22
+ // export * from './tools/video/image-to-video.js';
23
+ // export * from './tools/video/storyboard-video.js';
24
+ // export * from './tools/video/extend-video.js';
25
+ // Only export plugin for OpenCode
9
26
  export { default } from './plugin.js';
10
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qDAAqD;AACrD,0EAA0E;AAC1E,0EAA0E;AAC1E,sDAAsD;AACtD,mEAAmE;AACnE,EAAE;AACF,sEAAsE;AACtE,yCAAyC;AACzC,2CAA2C;AAC3C,+CAA+C;AAC/C,qCAAqC;AACrC,mDAAmD;AACnD,mDAAmD;AACnD,qDAAqD;AACrD,iDAAiD;AAEjD,kCAAkC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
package/dist/plugin.d.ts CHANGED
@@ -1,19 +1,4 @@
1
- /**
2
- * OpenCode Plugin Entry Point
3
- *
4
- * Exposes Nanobanana's visual capabilities as OpenCode tools.
5
- * Uses the @opencode-ai/plugin SDK for tool definitions.
6
- */
7
1
  import type { Plugin } from '@opencode-ai/plugin';
8
- /**
9
- * Nanobanana Plugin for OpenCode
10
- *
11
- * Provides visual AI capabilities:
12
- * - Video generation (Veo 3)
13
- * - Image to video animation
14
- * - Storyboard video generation
15
- * - Video extension
16
- */
17
2
  declare const plugin: Plugin;
18
3
  export default plugin;
19
4
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAoBlD;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM,EAAE,MAoQb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqBlD,QAAA,MAAM,MAAM,EAAE,MA+Rb,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/plugin.js CHANGED
@@ -1,17 +1,12 @@
1
- /**
2
- * OpenCode Plugin Entry Point
3
- *
4
- * Exposes Nanobanana's visual capabilities as OpenCode tools.
5
- * Uses the @opencode-ai/plugin SDK for tool definitions.
6
- */
7
1
  import { tool } from '@opencode-ai/plugin/tool';
2
+ import { GeminiProvider } from './providers/gemini.js';
8
3
  import { generateVideo } from './tools/video/generate-video.js';
9
4
  import { imageToVideo } from './tools/video/image-to-video.js';
10
5
  import { generateStoryboardVideo } from './tools/video/storyboard-video.js';
11
6
  import { extendVideo } from './tools/video/extend-video.js';
12
- /**
13
- * Get Gemini API key from environment
14
- */
7
+ import { writeFile } from 'fs/promises';
8
+ import { join } from 'path';
9
+ import { tmpdir } from 'os';
15
10
  function getApiKey() {
16
11
  const apiKey = process.env.GEMINI_API_KEY;
17
12
  if (!apiKey) {
@@ -20,82 +15,69 @@ function getApiKey() {
20
15
  }
21
16
  return apiKey;
22
17
  }
23
- /**
24
- * Nanobanana Plugin for OpenCode
25
- *
26
- * Provides visual AI capabilities:
27
- * - Video generation (Veo 3)
28
- * - Image to video animation
29
- * - Storyboard video generation
30
- * - Video extension
31
- */
32
18
  const plugin = async (_input) => {
33
19
  return {
34
20
  tool: {
35
- /**
36
- * Generate video from text prompt using Veo 3
37
- */
38
- mcp_generate_video: tool({
39
- description: 'Generate a video from a text prompt using Google Veo 3. ' +
40
- 'Creates high-quality video content with native audio generation. ' +
41
- 'Supports various aspect ratios (16:9, 9:16) and resolutions (720p, 1080p). ' +
42
- 'Duration can be 4, 6, or 8 seconds.',
21
+ generate_image: tool({
22
+ description: 'Generate an image from a text prompt using Google Imagen 3. ' +
23
+ 'Creates high-quality images for icons, illustrations, photos, art, and more. ' +
24
+ 'Supports various aspect ratios: 1:1 (square), 3:4, 4:3, 9:16 (portrait), 16:9 (landscape).',
43
25
  args: {
44
- prompt: tool.schema.string().describe('Description of the video to generate. Be specific about action, scene, lighting, mood, etc. ' +
45
- 'Example: "A serene mountain landscape at sunrise with fog rolling through the valley"'),
26
+ prompt: tool.schema.string().describe('Description of the image to generate. Be specific about style, colors, composition, lighting. ' +
27
+ 'Example: "A modern app icon with gradient blue-purple colors, minimalist design, rounded corners"'),
46
28
  aspectRatio: tool.schema
47
- .enum(['16:9', '9:16'])
48
- .optional()
49
- .describe('Aspect ratio for the video. Defaults to 16:9 (landscape)'),
50
- resolution: tool.schema
51
- .enum(['720p', '1080p'])
52
- .optional()
53
- .describe('Video resolution. Defaults to 720p'),
54
- duration: tool.schema
55
- .enum(['4', '6', '8'])
29
+ .enum(['1:1', '3:4', '4:3', '9:16', '16:9'])
56
30
  .optional()
57
- .describe('Video duration in seconds. Defaults to 8'),
31
+ .describe('Aspect ratio for the image. Defaults to 1:1 (square)'),
58
32
  outputPath: tool.schema
59
33
  .string()
60
34
  .optional()
61
- .describe('Path where the video should be saved. If not provided, saves to temp directory'),
35
+ .describe('Path where the image should be saved. If not provided, saves to temp directory'),
62
36
  },
63
37
  async execute(args, _context) {
64
- const apiKey = getApiKey();
65
- const result = await generateVideo({
66
- apiKey,
67
- prompt: args.prompt,
68
- aspectRatio: args.aspectRatio,
69
- resolution: args.resolution,
70
- duration: args.duration
71
- ? parseInt(args.duration, 10)
72
- : undefined,
73
- outputPath: args.outputPath,
74
- });
75
- return JSON.stringify({
76
- success: true,
77
- videoPath: result.videoPath,
78
- generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
79
- });
38
+ try {
39
+ const apiKey = getApiKey();
40
+ const provider = new GeminiProvider(apiKey);
41
+ const result = await provider.generateImage(args.prompt, {
42
+ aspectRatio: args.aspectRatio,
43
+ count: 1,
44
+ });
45
+ const outputPath = args.outputPath || join(tmpdir(), `image-${Date.now()}.png`);
46
+ await writeFile(outputPath, result.buffer);
47
+ return JSON.stringify({
48
+ success: true,
49
+ imagePath: outputPath,
50
+ mimeType: result.mimeType,
51
+ generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
52
+ });
53
+ }
54
+ catch (error) {
55
+ const err = error;
56
+ const errorMessage = err?.message || String(error);
57
+ const errorCode = err?.code || err?.status || 'UNKNOWN';
58
+ return JSON.stringify({
59
+ success: false,
60
+ error: errorMessage,
61
+ errorCode,
62
+ help: errorMessage.includes('API key') || errorMessage.includes('403') || errorMessage.includes('PERMISSION_DENIED')
63
+ ? 'Please check your GEMINI_API_KEY environment variable. Get a new key at https://aistudio.google.com/app/apikey'
64
+ : 'Image generation failed. Check the error message for details.',
65
+ });
66
+ }
80
67
  },
81
68
  }),
82
- /**
83
- * Animate a static image into video
84
- */
85
- mcp_image_to_video: tool({
86
- description: 'Animate a static image into a video using Google Veo 3. ' +
87
- 'Takes an existing image and brings it to life with motion and audio. ' +
88
- 'Useful for animating photos, product images, logos, or artwork.',
69
+ generate_video: tool({
70
+ description: 'Generate a video from a text prompt using Google Veo 3. ' +
71
+ 'Creates high-quality video content with native audio generation. ' +
72
+ 'Supports aspect ratios 16:9 (landscape) and 9:16 (portrait), resolutions 720p/1080p. ' +
73
+ 'Duration: 4, 6, or 8 seconds.',
89
74
  args: {
90
- imagePath: tool.schema
91
- .string()
92
- .describe('Path to the image file to animate'),
93
- prompt: tool.schema.string().describe('Description of the animation to apply. ' +
94
- 'Example: "Slow camera pan from left to right" or "Product rotates 360 degrees"'),
75
+ prompt: tool.schema.string().describe('Description of the video to generate. Be specific about action, scene, lighting, mood. ' +
76
+ 'Example: "A serene mountain landscape at sunrise with fog rolling through the valley"'),
95
77
  aspectRatio: tool.schema
96
78
  .enum(['16:9', '9:16'])
97
79
  .optional()
98
- .describe('Aspect ratio for the video. Defaults to 16:9'),
80
+ .describe('Aspect ratio. Defaults to 16:9 (landscape)'),
99
81
  resolution: tool.schema
100
82
  .enum(['720p', '1080p'])
101
83
  .optional()
@@ -103,153 +85,191 @@ const plugin = async (_input) => {
103
85
  duration: tool.schema
104
86
  .enum(['4', '6', '8'])
105
87
  .optional()
106
- .describe('Video duration in seconds. Defaults to 8'),
88
+ .describe('Duration in seconds. Defaults to 8'),
107
89
  outputPath: tool.schema
108
90
  .string()
109
91
  .optional()
110
92
  .describe('Path where the video should be saved'),
111
93
  },
112
94
  async execute(args, _context) {
113
- const apiKey = getApiKey();
114
- const result = await imageToVideo({
115
- apiKey,
116
- imagePath: args.imagePath,
117
- prompt: args.prompt,
118
- aspectRatio: args.aspectRatio,
119
- resolution: args.resolution,
120
- duration: args.duration
121
- ? parseInt(args.duration, 10)
122
- : undefined,
123
- outputPath: args.outputPath,
124
- });
125
- return JSON.stringify({
126
- success: true,
127
- videoPath: result.videoPath,
128
- generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
129
- });
95
+ try {
96
+ const apiKey = getApiKey();
97
+ const result = await generateVideo({
98
+ apiKey,
99
+ prompt: args.prompt,
100
+ aspectRatio: args.aspectRatio,
101
+ resolution: args.resolution,
102
+ duration: args.duration ? parseInt(args.duration, 10) : undefined,
103
+ outputPath: args.outputPath,
104
+ });
105
+ return JSON.stringify({
106
+ success: true,
107
+ videoPath: result.videoPath,
108
+ generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
109
+ });
110
+ }
111
+ catch (error) {
112
+ const err = error;
113
+ const errorMessage = err?.message || String(error);
114
+ const errorCode = err?.code || err?.status || 'UNKNOWN';
115
+ return JSON.stringify({
116
+ success: false,
117
+ error: errorMessage,
118
+ errorCode,
119
+ help: errorMessage.includes('API key') || errorMessage.includes('403') || errorMessage.includes('PERMISSION_DENIED')
120
+ ? 'Please check your GEMINI_API_KEY environment variable'
121
+ : 'Video generation failed.',
122
+ });
123
+ }
124
+ },
125
+ }),
126
+ image_to_video: tool({
127
+ description: 'Animate a static image into a video using Google Veo 3. ' +
128
+ 'Brings images to life with motion and audio. ' +
129
+ 'Great for animating photos, product images, logos, or artwork.',
130
+ args: {
131
+ imagePath: tool.schema.string().describe('Path to the image file to animate'),
132
+ prompt: tool.schema.string().describe('Description of the animation. Example: "Slow camera pan from left to right" or "Product rotates 360 degrees"'),
133
+ aspectRatio: tool.schema.enum(['16:9', '9:16']).optional().describe('Aspect ratio. Defaults to 16:9'),
134
+ resolution: tool.schema.enum(['720p', '1080p']).optional().describe('Resolution. Defaults to 720p'),
135
+ duration: tool.schema.enum(['4', '6', '8']).optional().describe('Duration in seconds. Defaults to 8'),
136
+ outputPath: tool.schema.string().optional().describe('Path where the video should be saved'),
137
+ },
138
+ async execute(args, _context) {
139
+ try {
140
+ const apiKey = getApiKey();
141
+ const result = await imageToVideo({
142
+ apiKey,
143
+ imagePath: args.imagePath,
144
+ prompt: args.prompt,
145
+ aspectRatio: args.aspectRatio,
146
+ resolution: args.resolution,
147
+ duration: args.duration ? parseInt(args.duration, 10) : undefined,
148
+ outputPath: args.outputPath,
149
+ });
150
+ return JSON.stringify({
151
+ success: true,
152
+ videoPath: result.videoPath,
153
+ generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
154
+ });
155
+ }
156
+ catch (error) {
157
+ const err = error;
158
+ const errorMessage = err?.message || String(error);
159
+ const errorCode = err?.code || err?.status || 'UNKNOWN';
160
+ return JSON.stringify({
161
+ success: false,
162
+ error: errorMessage,
163
+ errorCode,
164
+ help: errorMessage.includes('API key') || errorMessage.includes('403') || errorMessage.includes('PERMISSION_DENIED')
165
+ ? 'Please check your GEMINI_API_KEY environment variable'
166
+ : 'Image to video conversion failed.',
167
+ });
168
+ }
130
169
  },
131
170
  }),
132
- /**
133
- * Generate multi-scene storyboard video
134
- */
135
- mcp_generate_storyboard_video: tool({
136
- description: 'Generate a multi-scene storyboard video by creating individual scenes ' +
137
- 'and stitching them together with transitions. Perfect for commercials, ' +
138
- 'narratives, product demos, or any video requiring multiple scenes. ' +
139
- 'Supports character consistency across scenes using reference images. ' +
140
- 'Requires FFmpeg to be installed.',
171
+ generate_storyboard_video: tool({
172
+ description: 'Generate a multi-scene storyboard video. Creates individual scenes and stitches them with transitions. ' +
173
+ 'Perfect for commercials, narratives, product demos. Supports character consistency. Requires FFmpeg.',
141
174
  args: {
142
175
  scenes: tool.schema
143
176
  .array(tool.schema.string())
144
- .describe('Array of scene descriptions. Each scene will be generated as a separate video segment. ' +
145
- 'Example: ["A coffee shop in the morning", "Barista making latte art", "Customer enjoying coffee"]'),
146
- style: tool.schema
147
- .string()
148
- .optional()
149
- .describe('Visual style to apply to all scenes. Examples: "cinematic", "commercial", "documentary"'),
177
+ .describe('Array of scene descriptions. Example: ["Coffee shop morning", "Barista making latte", "Customer enjoying coffee"]'),
178
+ style: tool.schema.string().optional().describe('Visual style for all scenes. Examples: "cinematic", "commercial"'),
150
179
  characterDescription: tool.schema
151
180
  .string()
152
181
  .optional()
153
- .describe('Description of the main character to maintain consistency across scenes. ' +
154
- 'Example: "A young woman with long brown hair wearing a red jacket"'),
155
- referenceImages: tool.schema
156
- .array(tool.schema.string())
157
- .optional()
158
- .describe('Array of paths to reference images for character/scene consistency (max 3)'),
159
- aspectRatio: tool.schema
160
- .enum(['16:9', '9:16'])
161
- .optional()
162
- .describe('Aspect ratio for all scenes. Defaults to 16:9'),
163
- transition: tool.schema
164
- .enum(['cut', 'crossfade', 'fade'])
165
- .optional()
166
- .describe('Transition type between scenes. Defaults to crossfade'),
167
- transitionDuration: tool.schema
168
- .number()
169
- .optional()
170
- .describe('Transition duration in seconds. Defaults to 0.5'),
171
- backgroundMusic: tool.schema
172
- .string()
173
- .optional()
174
- .describe('Path to background music audio file'),
175
- musicVolume: tool.schema
176
- .number()
177
- .optional()
178
- .describe('Volume level for background music (0.0-1.0). Defaults to 0.3'),
179
- outputPath: tool.schema
180
- .string()
181
- .optional()
182
- .describe('Path where the final video should be saved'),
182
+ .describe('Main character description for consistency. Example: "Young woman with brown hair in red jacket"'),
183
+ referenceImages: tool.schema.array(tool.schema.string()).optional().describe('Paths to reference images (max 3)'),
184
+ aspectRatio: tool.schema.enum(['16:9', '9:16']).optional().describe('Aspect ratio. Defaults to 16:9'),
185
+ transition: tool.schema.enum(['cut', 'crossfade', 'fade']).optional().describe('Transition type. Defaults to crossfade'),
186
+ transitionDuration: tool.schema.number().optional().describe('Transition duration in seconds. Defaults to 0.5'),
187
+ backgroundMusic: tool.schema.string().optional().describe('Path to background music audio file'),
188
+ musicVolume: tool.schema.number().optional().describe('Background music volume (0.0-1.0). Defaults to 0.3'),
189
+ outputPath: tool.schema.string().optional().describe('Path where the final video should be saved'),
183
190
  },
184
191
  async execute(args, _context) {
185
- const apiKey = getApiKey();
186
- const result = await generateStoryboardVideo({
187
- apiKey,
188
- scenes: args.scenes,
189
- style: args.style,
190
- characterDescription: args.characterDescription,
191
- referenceImages: args.referenceImages,
192
- aspectRatio: args.aspectRatio,
193
- transition: args.transition,
194
- transitionDuration: args.transitionDuration,
195
- backgroundMusic: args.backgroundMusic,
196
- musicVolume: args.musicVolume,
197
- outputPath: args.outputPath,
198
- });
199
- return JSON.stringify({
200
- success: true,
201
- videoPath: result.videoPath,
202
- totalTime: `${(result.totalTime / 1000).toFixed(1)}s`,
203
- scenesGenerated: result.successCount,
204
- scenesFailed: result.failureCount,
205
- sceneTimes: result.sceneTimes.map((s) => ({
206
- scene: s.scene,
207
- time: `${(s.time / 1000).toFixed(1)}s`,
208
- })),
209
- });
192
+ try {
193
+ const apiKey = getApiKey();
194
+ const result = await generateStoryboardVideo({
195
+ apiKey,
196
+ scenes: args.scenes,
197
+ style: args.style,
198
+ characterDescription: args.characterDescription,
199
+ referenceImages: args.referenceImages,
200
+ aspectRatio: args.aspectRatio,
201
+ transition: args.transition,
202
+ transitionDuration: args.transitionDuration,
203
+ backgroundMusic: args.backgroundMusic,
204
+ musicVolume: args.musicVolume,
205
+ outputPath: args.outputPath,
206
+ });
207
+ return JSON.stringify({
208
+ success: true,
209
+ videoPath: result.videoPath,
210
+ totalTime: `${(result.totalTime / 1000).toFixed(1)}s`,
211
+ scenesGenerated: result.successCount,
212
+ scenesFailed: result.failureCount,
213
+ });
214
+ }
215
+ catch (error) {
216
+ const err = error;
217
+ const errorMessage = err?.message || String(error);
218
+ const errorCode = err?.code || err?.status || 'UNKNOWN';
219
+ return JSON.stringify({
220
+ success: false,
221
+ error: errorMessage,
222
+ errorCode,
223
+ help: errorMessage.includes('ffmpeg')
224
+ ? 'FFmpeg is required. Install with: brew install ffmpeg (macOS) or apt install ffmpeg (Linux)'
225
+ : errorMessage.includes('API key') || errorMessage.includes('403')
226
+ ? 'Please check your GEMINI_API_KEY environment variable'
227
+ : 'Storyboard generation failed.',
228
+ });
229
+ }
210
230
  },
211
231
  }),
212
- /**
213
- * Extend an existing video with new content
214
- */
215
- mcp_extend_video: tool({
216
- description: 'Extend an existing video with new content using Google Veo 3. ' +
217
- 'Seamlessly continues the video with AI-generated content matching the original style. ' +
218
- 'Useful for adding scenes, extending clips, or continuing narratives.',
232
+ extend_video: tool({
233
+ description: 'Extend an existing video with new AI-generated content using Veo 3. ' +
234
+ 'Seamlessly continues the video matching the original style. ' +
235
+ 'Useful for adding scenes or continuing narratives.',
219
236
  args: {
220
- videoPath: tool.schema
221
- .string()
222
- .describe('Path to the existing video to extend'),
223
- prompt: tool.schema.string().describe('Description of what should happen in the extension. ' +
224
- 'Example: "Camera pans to reveal a stunning sunset" or "Text appears: Available now"'),
225
- aspectRatio: tool.schema
226
- .enum(['16:9', '9:16'])
227
- .optional()
228
- .describe('Aspect ratio for the extended video. Defaults to 16:9'),
229
- resolution: tool.schema
230
- .enum(['720p', '1080p'])
231
- .optional()
232
- .describe('Resolution for the extended video. Defaults to 720p'),
233
- outputPath: tool.schema
234
- .string()
235
- .optional()
236
- .describe('Path where the extended video should be saved'),
237
+ videoPath: tool.schema.string().describe('Path to the existing video to extend'),
238
+ prompt: tool.schema.string().describe('Description of the extension. Example: "Camera pans to reveal a stunning sunset"'),
239
+ aspectRatio: tool.schema.enum(['16:9', '9:16']).optional().describe('Aspect ratio. Defaults to 16:9'),
240
+ resolution: tool.schema.enum(['720p', '1080p']).optional().describe('Resolution. Defaults to 720p'),
241
+ outputPath: tool.schema.string().optional().describe('Path where the extended video should be saved'),
237
242
  },
238
243
  async execute(args, _context) {
239
- const apiKey = getApiKey();
240
- const result = await extendVideo({
241
- apiKey,
242
- videoPath: args.videoPath,
243
- prompt: args.prompt,
244
- aspectRatio: args.aspectRatio,
245
- resolution: args.resolution,
246
- outputPath: args.outputPath,
247
- });
248
- return JSON.stringify({
249
- success: true,
250
- videoPath: result.videoPath,
251
- generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
252
- });
244
+ try {
245
+ const apiKey = getApiKey();
246
+ const result = await extendVideo({
247
+ apiKey,
248
+ videoPath: args.videoPath,
249
+ prompt: args.prompt,
250
+ aspectRatio: args.aspectRatio,
251
+ resolution: args.resolution,
252
+ outputPath: args.outputPath,
253
+ });
254
+ return JSON.stringify({
255
+ success: true,
256
+ videoPath: result.videoPath,
257
+ generationTime: `${(result.generationTime / 1000).toFixed(1)}s`,
258
+ });
259
+ }
260
+ catch (error) {
261
+ const err = error;
262
+ const errorMessage = err?.message || String(error);
263
+ const errorCode = err?.code || err?.status || 'UNKNOWN';
264
+ return JSON.stringify({
265
+ success: false,
266
+ error: errorMessage,
267
+ errorCode,
268
+ help: errorMessage.includes('API key') || errorMessage.includes('403')
269
+ ? 'Please check your GEMINI_API_KEY environment variable'
270
+ : 'Video extension failed.',
271
+ });
272
+ }
253
273
  },
254
274
  }),
255
275
  },
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;GAEG;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