opencode-nanobanana 0.1.0 → 0.1.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 (69) hide show
  1. package/package.json +1 -1
  2. package/.ralph-events.json +0 -151
  3. package/.ralph-last-branch +0 -1
  4. package/.ralph-monitor-state.json +0 -7
  5. package/.ralph-monitor.pid +0 -1
  6. package/.ralph-timing.json +0 -26
  7. package/dist/tools/docs/architecture-diagram.d.ts +0 -12
  8. package/dist/tools/docs/architecture-diagram.d.ts.map +0 -1
  9. package/dist/tools/docs/architecture-diagram.js +0 -179
  10. package/dist/tools/docs/architecture-diagram.js.map +0 -1
  11. package/dist/tools/docs/readme-banner.d.ts +0 -6
  12. package/dist/tools/docs/readme-banner.d.ts.map +0 -1
  13. package/dist/tools/docs/readme-banner.js +0 -108
  14. package/dist/tools/docs/readme-banner.js.map +0 -1
  15. package/dist/tools/docs/sequence-diagram.d.ts +0 -12
  16. package/dist/tools/docs/sequence-diagram.d.ts.map +0 -1
  17. package/dist/tools/docs/sequence-diagram.js +0 -161
  18. package/dist/tools/docs/sequence-diagram.js.map +0 -1
  19. package/dist/tools/docs/social-preview.d.ts +0 -11
  20. package/dist/tools/docs/social-preview.d.ts.map +0 -1
  21. package/dist/tools/docs/social-preview.js +0 -111
  22. package/dist/tools/docs/social-preview.js.map +0 -1
  23. package/docs/PLUGIN-VERIFICATION.md +0 -182
  24. package/logs/notifications.jsonl +0 -46
  25. package/prd.json +0 -216
  26. package/progress.txt +0 -145
  27. package/ralph-report.html +0 -297
  28. package/src/index.ts +0 -23
  29. package/src/platforms/android/.gitkeep +0 -0
  30. package/src/platforms/ios/.gitkeep +0 -0
  31. package/src/platforms/web/.gitkeep +0 -0
  32. package/src/providers/.gitkeep +0 -0
  33. package/src/providers/gemini.ts +0 -288
  34. package/src/tools/core/.gitkeep +0 -0
  35. package/src/tools/platform/.gitkeep +0 -0
  36. package/src/tools/video/extend-video.ts +0 -71
  37. package/src/tools/video/generate-video.ts +0 -70
  38. package/src/tools/video/image-to-video.ts +0 -76
  39. package/src/tools/video/storyboard-video.ts +0 -325
  40. package/src/utils/.gitkeep +0 -0
  41. package/src/utils/ffmpeg.ts +0 -266
  42. package/src/utils/file-handler.ts +0 -10
  43. package/src/utils/image-processing.ts +0 -10
  44. package/templates/.gitkeep +0 -0
  45. package/test-analyze-screenshot.ts +0 -50
  46. package/test-app-icons.ts +0 -55
  47. package/test-cat-sunset.ts +0 -30
  48. package/test-full-plugin.ts +0 -88
  49. package/test-icon-gen.ts +0 -30
  50. package/test-output/test-edit.png +0 -0
  51. package/test-output/test-generate.png +0 -0
  52. package/test-output/test-video.mp4 +0 -0
  53. package/test-princess-emma-continue.ts +0 -35
  54. package/test-princess-emma-full.ts +0 -38
  55. package/test-princess-emma-short.ts +0 -32
  56. package/test-princess-emma-with-reference.ts +0 -34
  57. package/test-princess-emma.ts +0 -38
  58. package/test-product-ad.ts +0 -66
  59. package/test-ralph-droid.ts +0 -30
  60. package/test-social-preview.ts +0 -61
  61. package/test-veo31-live.ts +0 -187
  62. package/test-video-gen.ts +0 -40
  63. package/test-video-veo.ts +0 -73
  64. package/test-zurich-video.ts +0 -64
  65. package/tests/.gitkeep +0 -0
  66. package/tests/providers/gemini.test.ts +0 -388
  67. package/tests/utils/ffmpeg.test.ts +0 -328
  68. package/tests/video/storyboard.test.ts +0 -469
  69. package/tsconfig.json +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-nanobanana",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "OpenCode plugin for visual AI: video generation (Veo 3), image generation (Imagen 3), storyboards, app icons, and visual analysis powered by Google Gemini",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,151 +0,0 @@
1
- {
2
- "started": "2026-01-15T22:01:15+01:00",
3
- "project": "opencode-nanobanana",
4
- "platform": "macos",
5
- "events": [
6
- {
7
- "timestamp": "2026-01-15T22:01:15+01:00",
8
- "type": "started",
9
- "message": "Monitor started for opencode-nanobanana",
10
- "story": ""
11
- },
12
- {
13
- "timestamp": "2026-01-15T22:01:18+01:00",
14
- "type": "start",
15
- "message": "Ralph started",
16
- "story": "VEO3-001"
17
- },
18
- {
19
- "timestamp": "2026-01-15T22:11:20+01:00",
20
- "type": "story_complete",
21
- "message": "Completed: VEO3-001 in 10m",
22
- "story": "VEO3-001"
23
- },
24
- {
25
- "timestamp": "2026-01-15T22:16:23+01:00",
26
- "type": "story_complete",
27
- "message": "Completed: FFMPEG-001 in 5m",
28
- "story": "FFMPEG-001"
29
- },
30
- {
31
- "timestamp": "2026-01-15T22:21:26+01:00",
32
- "type": "story_complete",
33
- "message": "Completed: STORY-002 in 5m",
34
- "story": "STORY-002"
35
- },
36
- {
37
- "timestamp": "2026-01-15T22:26:28+01:00",
38
- "type": "story_complete",
39
- "message": "Completed: STORY-003 in 5m",
40
- "story": "STORY-003"
41
- }
42
- ],
43
- "stories_completed": [
44
- {
45
- "timestamp": "2026-01-15T22:11:20+01:00",
46
- "story": "VEO3-001",
47
- "duration": 10,
48
- "estimate": 20,
49
- "git": {
50
- "start_commit": "e2c7cdc",
51
- "end_commit": "9fae5fd",
52
- "files_changed": 7,
53
- "lines_added": 834,
54
- "lines_removed": 219,
55
- "files": [
56
- "prd-storyboard.json",
57
- "prd.json",
58
- "progress.txt",
59
- "src/providers/gemini.ts",
60
- "src/utils/file-handler.ts",
61
- "src/utils/image-processing.ts",
62
- "tests/providers/gemini.test.ts"
63
- ]
64
- }
65
- },
66
- {
67
- "timestamp": "2026-01-15T22:16:23+01:00",
68
- "story": "FFMPEG-001",
69
- "duration": 5,
70
- "estimate": 20,
71
- "git": {
72
- "start_commit": "9fae5fd",
73
- "end_commit": "0a2ad94",
74
- "files_changed": 6,
75
- "lines_added": 829,
76
- "lines_removed": 3,
77
- "files": [
78
- "prd.json",
79
- "progress.txt",
80
- "src/index.ts",
81
- "src/tools/video/storyboard-video.ts",
82
- "src/utils/ffmpeg.ts",
83
- "tests/utils/ffmpeg.test.ts"
84
- ]
85
- }
86
- },
87
- {
88
- "timestamp": "2026-01-15T22:21:26+01:00",
89
- "story": "STORY-002",
90
- "duration": 5,
91
- "estimate": 20,
92
- "git": {
93
- "start_commit": "0a2ad94",
94
- "end_commit": "fa16746",
95
- "files_changed": 22,
96
- "lines_added": 1204,
97
- "lines_removed": 13,
98
- "files": [
99
- ".ralph-events.json",
100
- ".ralph-last-branch",
101
- ".ralph-monitor-state.json",
102
- ".ralph-monitor.pid",
103
- ".ralph-timing.json",
104
- "docs/PLUGIN-VERIFICATION.md",
105
- "logs/notifications.jsonl",
106
- "prd.json",
107
- "progress.txt",
108
- "ralph-report.html",
109
- "src/tools/video/storyboard-video.ts",
110
- "test-analyze-screenshot.ts",
111
- "test-app-icons.ts",
112
- "test-cat-sunset.ts",
113
- "test-icon-gen.ts",
114
- "test-plugin-load.js",
115
- "test-product-ad.ts",
116
- "test-ralph-droid.ts",
117
- "test-social-preview.ts",
118
- "test-video-gen.ts",
119
- "test-video-veo.ts",
120
- "test-zurich-video.ts"
121
- ]
122
- }
123
- },
124
- {
125
- "timestamp": "2026-01-15T22:26:28+01:00",
126
- "story": "STORY-003",
127
- "duration": 5,
128
- "estimate": 20,
129
- "git": {
130
- "start_commit": "fa16746",
131
- "end_commit": "4dcd788",
132
- "files_changed": 8,
133
- "lines_added": 163,
134
- "lines_removed": 28,
135
- "files": [
136
- ".ralph-events.json",
137
- ".ralph-monitor-state.json",
138
- ".ralph-timing.json",
139
- "logs/notifications.jsonl",
140
- "prd.json",
141
- "progress.txt",
142
- "ralph-report.html",
143
- "src/tools/video/storyboard-video.ts"
144
- ]
145
- }
146
- }
147
- ],
148
- "restarts": [],
149
- "total_restarts": 0,
150
- "final_status": "running"
151
- }
@@ -1 +0,0 @@
1
- ralph/storyboard-video
@@ -1,7 +0,0 @@
1
- {
2
- "current_story": "EXTEND-001",
3
- "story_start_time": 1768512390,
4
- "restart_count": 0,
5
- "last_check": 1768512390,
6
- "platform": "macos"
7
- }
@@ -1 +0,0 @@
1
- 76110
@@ -1,26 +0,0 @@
1
- {
2
- "stories": {
3
- "VEO3-001": {
4
- "actual": 10,
5
- "estimate": 20
6
- },
7
- "FFMPEG-001": {
8
- "actual": 5,
9
- "estimate": 20
10
- },
11
- "STORY-002": {
12
- "actual": 5,
13
- "estimate": 20
14
- },
15
- "STORY-003": {
16
- "actual": 5,
17
- "estimate": 20
18
- }
19
- },
20
- "averages": {
21
- "simple": 20,
22
- "medium": 30,
23
- "complex": 45,
24
- "heavy": 60
25
- }
26
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Architecture Diagram Tool
3
- *
4
- * Generates architecture diagrams from text descriptions using Gemini.
5
- * Supports multiple output formats: PNG (visual), SVG, or Mermaid (text-based).
6
- */
7
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
8
- /**
9
- * Tool definition for generate_architecture_diagram
10
- */
11
- export declare const generateArchitectureDiagramTool: ToolDefinition;
12
- //# sourceMappingURL=architecture-diagram.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"architecture-diagram.d.ts","sourceRoot":"","sources":["../../../src/tools/docs/architecture-diagram.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAmGrE;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAgG5C,CAAC"}
@@ -1,179 +0,0 @@
1
- /**
2
- * Architecture Diagram Tool
3
- *
4
- * Generates architecture diagrams from text descriptions using Gemini.
5
- * Supports multiple output formats: PNG (visual), SVG, or Mermaid (text-based).
6
- */
7
- import { tool } from '@opencode-ai/plugin/tool';
8
- import { GeminiProvider } from '../../providers/gemini.js';
9
- import { saveImage, getOutputDir } from '../../utils/file-handler.js';
10
- /**
11
- * Tool args schema
12
- */
13
- const architectureDiagramArgs = {
14
- description: tool.schema.string()
15
- .describe('Description of the architecture to diagram (components, relationships, data flows)'),
16
- style: tool.schema.enum(['boxes', 'cloud', 'technical'])
17
- .optional()
18
- .describe('Visual style for the diagram. Options: boxes (clean box diagrams), cloud (cloud architecture), technical (detailed technical). Defaults to "technical"'),
19
- format: tool.schema.enum(['png', 'svg', 'mermaid'])
20
- .optional()
21
- .describe('Output format. Options: png (image via Gemini), svg (vector image), mermaid (text-based diagram code). Defaults to "png"'),
22
- outputPath: tool.schema.string()
23
- .optional()
24
- .describe('Custom output directory path. Defaults to "./generated-assets"')
25
- };
26
- /**
27
- * Generate Mermaid diagram code from description
28
- */
29
- function generateMermaidDiagram(description) {
30
- // For mermaid format, return a basic template with the description
31
- // In a real scenario, you might use Gemini to analyze the description
32
- // and generate proper Mermaid syntax
33
- const firstLine = description.split('\n')[0] || description;
34
- const truncatedFirstLine = firstLine.slice(0, 50);
35
- return `\`\`\`mermaid
36
- graph TB
37
- %% Architecture Diagram: ${truncatedFirstLine}...
38
-
39
- A[Component A] --> B[Component B]
40
- B --> C[Component C]
41
- C --> D[Component D]
42
- A --> D
43
-
44
- %% Note: This is a template diagram.
45
- %% For detailed diagrams, use the 'png' or 'svg' format option.
46
- %% Description provided: ${description}
47
- \`\`\`
48
-
49
- **Instructions:**
50
- 1. Copy the Mermaid code above
51
- 2. Paste it into a Mermaid renderer (GitHub, Mermaid Live Editor, etc.)
52
- 3. Customize the diagram based on your architecture requirements
53
-
54
- **Description provided:** ${description}
55
- `;
56
- }
57
- /**
58
- * Build prompt for Gemini based on style
59
- */
60
- function buildArchitecturePrompt(description, style) {
61
- const basePrompt = `Create a professional architecture diagram based on the following description:\n\n${description}\n\n`;
62
- const stylePrompts = {
63
- boxes: `Style: Clean box diagram with:
64
- - Simple rectangular boxes for components
65
- - Clear, labeled arrows showing relationships and data flow
66
- - Minimal colors (use white/light gray boxes with black text)
67
- - Clean, professional layout with good spacing
68
- - Component names clearly visible
69
- - Connection labels showing data/control flow`,
70
- cloud: `Style: Cloud architecture diagram with:
71
- - Cloud-native visual elements (rounded shapes, cloud icons)
72
- - Layer separation (presentation, application, data, infrastructure)
73
- - Cloud service icons or placeholders
74
- - Modern gradient colors (blues, grays, whites)
75
- - Clear service boundaries and regions
76
- - Network connections between services`,
77
- technical: `Style: Detailed technical diagram with:
78
- - Component boxes with technology stack labels
79
- - Ports and interfaces clearly marked
80
- - Protocol labels on connections (HTTP, TCP, etc.)
81
- - Database and storage symbols
82
- - Network layers and boundaries
83
- - Security zones if applicable
84
- - Detailed annotations and technical specifications`
85
- };
86
- const styleGuide = stylePrompts[style] || stylePrompts.technical;
87
- return `${basePrompt}${styleGuide}
88
-
89
- Requirements:
90
- - Professional quality suitable for technical documentation
91
- - Clear visual hierarchy
92
- - All components and connections labeled
93
- - Readable at standard document sizes
94
- - High contrast for clarity`;
95
- }
96
- /**
97
- * Tool definition for generate_architecture_diagram
98
- */
99
- export const generateArchitectureDiagramTool = tool({
100
- description: 'Generate architecture diagrams from text descriptions. Supports multiple styles (boxes, cloud, technical) and formats (PNG, SVG, Mermaid).',
101
- args: architectureDiagramArgs,
102
- async execute(args, _context) {
103
- try {
104
- const { description, style = 'technical', format = 'png', outputPath } = args;
105
- // Handle Mermaid format separately (no Gemini needed)
106
- if (format === 'mermaid') {
107
- const mermaidCode = generateMermaidDiagram(description);
108
- return [
109
- '✓ Generated Mermaid diagram code',
110
- '',
111
- mermaidCode,
112
- '',
113
- 'Note: Mermaid diagrams are text-based and can be rendered in:',
114
- ' • GitHub markdown files',
115
- ' • Mermaid Live Editor (https://mermaid.live)',
116
- ' • Documentation tools that support Mermaid',
117
- '',
118
- 'For visual diagrams, use format: "png" or "svg"'
119
- ].join('\n');
120
- }
121
- // For PNG/SVG formats, use Gemini
122
- const provider = new GeminiProvider();
123
- const outputDir = outputPath || getOutputDir();
124
- // Build architecture-specific prompt
125
- const prompt = buildArchitecturePrompt(description, style);
126
- // Generate diagram using Gemini
127
- // Note: Gemini generates images, SVG support would require post-processing
128
- // For now, we'll generate PNG for both png and svg formats
129
- const imageBuffers = await provider.generateImage(prompt, {
130
- aspectRatio: '16:9', // Wide format for architecture diagrams
131
- count: 1
132
- });
133
- const buffer = imageBuffers[0];
134
- if (!buffer) {
135
- throw new Error('Failed to generate architecture diagram');
136
- }
137
- // Save the diagram
138
- const filename = format === 'svg' ? 'architecture-diagram' : 'architecture-diagram';
139
- const filepath = await saveImage(buffer, outputDir, filename, 0);
140
- // SVG note if requested
141
- const formatNote = format === 'svg'
142
- ? '\n\nNote: Generated as PNG. For true SVG, consider using Mermaid format or converting with external tools.'
143
- : '';
144
- return [
145
- '✓ Successfully generated architecture diagram',
146
- '',
147
- `Saved to: ${filepath}`,
148
- '',
149
- `Style: ${style}`,
150
- `Format: ${format}`,
151
- `Description: ${description.slice(0, 100)}${description.length > 100 ? '...' : ''}`,
152
- formatNote
153
- ].join('\n');
154
- }
155
- catch (error) {
156
- if (error instanceof Error) {
157
- if (error.message.includes('GEMINI_API_KEY')) {
158
- return [
159
- '✗ Error: Gemini API key not found',
160
- '',
161
- 'Please set your GEMINI_API_KEY environment variable.',
162
- 'Get your API key at: https://makersuite.google.com/app/apikey',
163
- '',
164
- 'Alternative: Use format "mermaid" for text-based diagrams (no API key required)'
165
- ].join('\n');
166
- }
167
- return [
168
- '✗ Architecture diagram generation failed',
169
- '',
170
- `Error: ${error.message}`,
171
- '',
172
- 'Please check your description and try again.'
173
- ].join('\n');
174
- }
175
- return '✗ Architecture diagram generation failed with an unknown error';
176
- }
177
- }
178
- });
179
- //# sourceMappingURL=architecture-diagram.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"architecture-diagram.js","sourceRoot":"","sources":["../../../src/tools/docs/architecture-diagram.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;GAEG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 -1,6 +0,0 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
2
- /**
3
- * Tool definition for generate_readme_banner
4
- */
5
- export declare const generateReadmeBannerTool: ToolDefinition;
6
- //# sourceMappingURL=readme-banner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readme-banner.d.ts","sourceRoot":"","sources":["../../../src/tools/docs/readme-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAwErE;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAwDZ,CAAC"}
@@ -1,108 +0,0 @@
1
- import { tool } from '@opencode-ai/plugin/tool';
2
- import { GeminiProvider } from '../../providers/gemini.js';
3
- import { saveImage, getOutputDir } from '../../utils/file-handler.js';
4
- /**
5
- * Tool args schema
6
- */
7
- const readmeBannerArgs = {
8
- projectName: tool.schema
9
- .string()
10
- .describe('The name of the project'),
11
- tagline: tool.schema
12
- .string()
13
- .optional()
14
- .describe('Optional tagline or description for the project'),
15
- style: tool.schema
16
- .enum(['gradient', 'minimal', 'tech'])
17
- .optional()
18
- .describe('Visual style for the banner: gradient (modern colorful), minimal (clean simple), tech (developer-focused). Default: gradient'),
19
- outputPath: tool.schema
20
- .string()
21
- .optional()
22
- .describe('Custom output path for the banner'),
23
- };
24
- /**
25
- * Build a style-specific prompt for README banner generation
26
- */
27
- function buildBannerPrompt(projectName, tagline, style) {
28
- const basePrompt = `Create a professional README banner for the project "${projectName}"${tagline ? ` with the tagline: "${tagline}"` : ''}. `;
29
- const stylePrompts = {
30
- gradient: `Use a modern gradient background (purple to blue or teal to cyan).
31
- Include the project name in large, bold, white text centered on the banner.
32
- ${tagline ? `Add the tagline in smaller text below the project name.` : ''}
33
- Make it eye-catching and suitable for GitHub README files.
34
- Use smooth gradients, subtle geometric shapes, and modern typography.`,
35
- minimal: `Use a clean, minimal design with a white or very light gray background.
36
- Display the project name in a bold, sans-serif font in dark gray or black.
37
- ${tagline ? `Add the tagline in a lighter weight font below the project name.` : ''}
38
- Keep the design simple and professional with lots of whitespace.
39
- No decorative elements - focus on typography and clarity.`,
40
- tech: `Create a technical, developer-focused banner with a dark background (dark blue or charcoal).
41
- Include subtle code-like elements (brackets, slashes, dots) as decorative accents.
42
- Display the project name in a monospace or technical font in bright green, cyan, or white.
43
- ${tagline ? `Add the tagline in a complementary color below the project name.` : ''}
44
- Use grid patterns, terminal aesthetics, or circuit board motifs for a tech feel.
45
- Make it appealing to developers and technical audiences.`,
46
- };
47
- const styleGuide = stylePrompts[style] || stylePrompts.gradient;
48
- return `${basePrompt}${styleGuide}
49
-
50
- Requirements:
51
- - Banner size should be wide (2:1 aspect ratio, ideal for GitHub)
52
- - High quality, professional appearance
53
- - Text must be clearly readable
54
- - Centered composition
55
- - Suitable for use at the top of README.md files`;
56
- }
57
- /**
58
- * Tool definition for generate_readme_banner
59
- */
60
- export const generateReadmeBannerTool = tool({
61
- description: 'Generate a professional README banner image for your project with customizable styles (gradient, minimal, tech). Creates 1280x640 images optimized for GitHub.',
62
- args: readmeBannerArgs,
63
- async execute(args, _context) {
64
- try {
65
- const projectName = args.projectName;
66
- const tagline = args.tagline || '';
67
- const style = args.style || 'gradient';
68
- const outputPath = args.outputPath;
69
- const provider = new GeminiProvider();
70
- // Build style-specific prompt
71
- const prompt = buildBannerPrompt(projectName, tagline, style);
72
- // Generate 1280x640 banner (2:1 aspect ratio, standard for GitHub)
73
- // Use 16:9 as closest available aspect ratio to 2:1 for wide banners
74
- const images = await provider.generateImage(prompt, {
75
- aspectRatio: '16:9',
76
- count: 1,
77
- });
78
- if (images.length === 0) {
79
- return '❌ Failed to generate README banner';
80
- }
81
- const buffer = images[0];
82
- if (!buffer) {
83
- return '❌ Failed to generate README banner';
84
- }
85
- // Save the banner
86
- const outputDir = outputPath || getOutputDir();
87
- const filename = `${projectName.toLowerCase().replace(/\s+/g, '-')}-banner`;
88
- const savedPath = await saveImage(buffer, outputDir, filename, 0);
89
- return `✅ README banner generated successfully!
90
- Style: ${style}
91
- Size: 1280x640 (optimized for GitHub)
92
- Saved to: ${savedPath}
93
-
94
- Add to your README.md:
95
- ![${projectName}](${savedPath})`;
96
- }
97
- catch (error) {
98
- if (error instanceof Error) {
99
- if (error.message.includes('API key')) {
100
- return '❌ Gemini API key not configured. Set GEMINI_API_KEY environment variable.';
101
- }
102
- return `❌ Error generating README banner: ${error.message}`;
103
- }
104
- return '❌ Unknown error generating README banner';
105
- }
106
- },
107
- });
108
- //# sourceMappingURL=readme-banner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readme-banner.js","sourceRoot":"","sources":["../../../src/tools/docs/readme-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,WAAW,EAAE,IAAI,CAAC,MAAM;SACrB,MAAM,EAAE;SACR,QAAQ,CAAC,yBAAyB,CAAC;IACtC,OAAO,EAAE,IAAI,CAAC,MAAM;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;IAC9D,KAAK,EAAE,IAAI,CAAC,MAAM;SACf,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SACrC,QAAQ,EAAE;SACV,QAAQ,CACP,8HAA8H,CAC/H;IACH,UAAU,EAAE,IAAI,CAAC,MAAM;SACpB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mCAAmC,CAAC;CACxC,CAAC;AAEX;;GAEG;AACH,SAAS,iBAAiB,CACxB,WAAmB,EACnB,OAAe,EACf,KAAa;IAEb,MAAM,UAAU,GAAG,wDAAwD,WAAW,IACpF,OAAO,CAAC,CAAC,CAA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aACT,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACxB,OAAO,oCAAoC,CAAC;YAC9C,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,oCAAoC,CAAC;YAC9C,CAAC;YAED,kBAAkB;YAClB,MAAM,SAAS,GAAG,UAAU,IAAI,YAAY,EAAE,CAAC;YAC/C,MAAM,QAAQ,GAAG,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC;YAE5E,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAElE,OAAO;SACJ,KAAK;;YAEF,SAAS;;;IAGjB,WAAW,KAAK,SAAS,GAAG,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBACtC,OAAO,2EAA2E,CAAC;gBACrF,CAAC;gBACD,OAAO,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC9D,CAAC;YACD,OAAO,0CAA0C,CAAC;QACpD,CAAC;IACH,CAAC;CACuB,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Sequence Diagram Tool
3
- *
4
- * Generates sequence diagrams from text descriptions using Gemini.
5
- * Supports multiple output formats: PNG (visual) or Mermaid (text-based).
6
- */
7
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
8
- /**
9
- * Tool definition for generate_sequence_diagram
10
- */
11
- export declare const generateSequenceDiagramTool: ToolDefinition;
12
- //# sourceMappingURL=sequence-diagram.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequence-diagram.d.ts","sourceRoot":"","sources":["../../../src/tools/docs/sequence-diagram.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAqGpE;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,cAoExC,CAAA"}