@michelabboud/visual-forge-mcp 0.5.5 → 0.6.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/CHANGELOG.md ADDED
@@ -0,0 +1,814 @@
1
+ # Changelog
2
+
3
+ All notable changes to Visual Forge MCP will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.6.0] - 2026-01-14
9
+
10
+ ### Added ✨ Automatic Image Optimization
11
+
12
+ #### Feature: Web-Optimized Images with Original Preservation
13
+
14
+ Visual Forge now automatically optimizes generated images for web use while preserving originals for high-quality print or archival purposes.
15
+
16
+ **What's New:**
17
+ - **Automatic optimization** of all generated images for web delivery
18
+ - **Works with ALL providers** - OpenAI, Gemini, Stability, Replicate, Leonardo, XAI, HuggingFace
19
+ - **Provider-agnostic** - optimization happens at workflow level, not in individual providers
20
+ - **Preserves originals** in `original/` subdirectory (never touched)
21
+ - **WebP format** by default for ~70% file size reduction
22
+ - **Configurable** via environment variables
23
+ - **Graceful fallback** when Sharp library unavailable
24
+ - **No crashes** - always works, even if optimization fails
25
+
26
+ **Default Behavior:**
27
+ - Originals saved: `generated-images/gemini/original/image.png` (4.2 MB)
28
+ - Web version used: `generated-images/gemini/image.webp` (1.2 MB)
29
+ - Quality: 85% (excellent, nearly imperceptible loss)
30
+ - Format: WebP (modern, best compression)
31
+ - Dimensions: Max 1920px (standard web)
32
+
33
+ **Configuration Options:**
34
+ ```bash
35
+ # Enable/disable (default: true)
36
+ IMAGE_OPTIMIZATION_ENABLED=true
37
+
38
+ # Quality 1-100 (default: 85)
39
+ IMAGE_OPTIMIZATION_QUALITY=85
40
+
41
+ # Format: webp|jpeg|png (default: webp)
42
+ IMAGE_OPTIMIZATION_FORMAT=webp
43
+
44
+ # Max dimensions (default: 1920)
45
+ IMAGE_OPTIMIZATION_MAX_WIDTH=1920
46
+ IMAGE_OPTIMIZATION_MAX_HEIGHT=1920
47
+
48
+ # Keep originals (default: true)
49
+ IMAGE_OPTIMIZATION_KEEP_ORIGINAL=true
50
+ ```
51
+
52
+ **Use Cases:**
53
+ 1. **Web docs** (default): Q85 WebP, ~70% reduction, excellent quality
54
+ 2. **Print-ready**: Disable optimization, use originals
55
+ 3. **Premium quality**: Q95 WebP, ~40% reduction, virtually no loss
56
+ 4. **Diagrams with text**: Q95 PNG, lossless, perfect clarity
57
+
58
+ **Files Added:**
59
+ - `src/utils/image-optimizer.ts` - Core optimization logic with Sharp
60
+ - `docs/guides/image-optimization.md` - Comprehensive configuration guide
61
+
62
+ **Files Modified:**
63
+ - `src/workflow/workflow-orchestrator.ts` - Added optimization after image generation (provider-agnostic)
64
+ - `src/types/generation.ts` - Added optimization metadata to `GeneratedImageMetadata`
65
+ - `src/utils/index.ts` - Export optimizer utilities
66
+ - `package.json` - Added `bin` field for global npm installation
67
+
68
+ **Safety Features:**
69
+ - Originals always preserved in `original/` subdirectory
70
+ - Graceful fallback if Sharp unavailable
71
+ - Error handling with automatic fallback to originals
72
+ - No workflow disruption on optimization failure
73
+
74
+ **Documentation:**
75
+ - See [docs/guides/image-optimization.md](docs/guides/image-optimization.md) for full guide
76
+ - Includes examples, troubleshooting, and best practices
77
+
78
+ ## [0.5.6] - 2026-01-14
79
+
80
+ ### Fixed 🔧 CRITICAL: Image Generation Failure
81
+
82
+ #### Problem: No Images Actually Generated
83
+ - **Issue:** vf_generate_session claimed success but NO images were actually generated
84
+ - **Symptom:** All images stuck at "placeholder_added" status, never progressed to "generated"
85
+ - **Root Cause:** Parsed image specifications were never added to StateManager
86
+ - `handleProcessFiles()` parsed specs and added them to session tracking
87
+ - But specs were NOT added to StateManager via `stateManager.addImages()`
88
+ - When `handleGenerateSession()` tried to retrieve specs from StateManager, found nothing
89
+ - Empty `imageSpecs` array passed to orchestrator → no generation occurred
90
+ - **Impact:** Complete workflow failure - no images generated despite "success" message
91
+
92
+ #### The Fix ✅
93
+ - **Location:** `WorkflowTools.handleProcessFiles()` (lines 218-224)
94
+ - **Solution:** Added StateManager initialization and `addImages()` call after parsing
95
+ - **Code Added:**
96
+ ```typescript
97
+ // ✅ CRITICAL: Add specs to StateManager so they can be retrieved for generation
98
+ const stateManager = new StateManager();
99
+ await stateManager.initialize();
100
+ stateManager.addImages(allSpecs);
101
+ await stateManager.save();
102
+ ```
103
+
104
+ #### Verification
105
+ - ✅ User confirmed: "the images were generated beautifully"
106
+ - ✅ Images now properly generated by all providers
107
+ - ✅ Placeholders correctly replaced with image links
108
+ - ✅ Session tracking works end-to-end
109
+
110
+ ### Impact
111
+ - ✅ Image generation now works as designed
112
+ - ✅ Complete workflow from placeholders → generation → replacement
113
+ - ✅ StateManager properly tracks all specs for orchestrator
114
+ - ✅ No more "phantom success" with zero images
115
+
116
+ ## [0.5.5] - 2026-01-14
117
+
118
+ ### Fixed 🔧 CRITICAL: Backup Issues
119
+
120
+ #### Problem 1: No Backup When Adding Placeholders
121
+ - **Issue:** Original markdown files were modified WITHOUT backup when adding placeholders
122
+ - **Risk:** Users could lose original file content if placeholder addition went wrong
123
+ - **Fix:** ✅ Now creates backup BEFORE adding placeholders to markdown files
124
+ - **Location:** `PlaceholderManager.addPlaceholders()` (line 93-105)
125
+
126
+ #### Problem 2: Unnecessary Image Backups
127
+ - **Issue:** Newly generated images were being backed up unnecessarily
128
+ - **Why Bad:** Wastes disk space and confuses backup purpose (images are NEW files, not modifications)
129
+ - **Fix:** ✅ Removed image files from backup when replacing placeholders
130
+ - **Location:** `WorkflowTools.handleGenerateSession()` (line 541-543)
131
+
132
+ ### Changes
133
+
134
+ **PlaceholderManager:**
135
+ - ✅ Added `BackupManager` instance
136
+ - ✅ Creates backup before `fs.writeFile()` when adding placeholders
137
+ - ✅ Logs backup creation status
138
+ - ✅ Proceeds with warning if backup fails (doesn't block operation)
139
+
140
+ **WorkflowTools:**
141
+ - ✅ Changed backup call to only backup markdown files: `createBackup(session.files, [])`
142
+ - ✅ Added comment explaining why images aren't backed up
143
+ - ✅ Clearer log message: "Creating backups before replacing placeholders in markdown files"
144
+
145
+ ### Impact
146
+ - ✅ Original markdown files are now protected when placeholders are added
147
+ - ✅ Backup system only backs up what matters (files being modified)
148
+ - ✅ Reduced disk space usage (no unnecessary image backups)
149
+ - ✅ Clearer backup intent and purpose
150
+
151
+ ## [0.5.4] - 2026-01-14
152
+
153
+ ### Added 🆕 Session Management Tools
154
+
155
+ #### Easy Session Clearing/Reset
156
+ - **New MCP Tools for Session Management**
157
+ - ✅ `vf_clear_session` - Clear/delete a specific session by ID
158
+ - ✅ `vf_clear_all_sessions` - Clear ALL sessions (with warning)
159
+ - ✅ `vf_clear_incomplete_sessions` - Clear only incomplete sessions
160
+ - ✅ `vf_reset_state` - Nuclear option: reset entire Visual Forge state
161
+
162
+ - **Session Manager Enhancements**
163
+ - ✅ `clearAllSessions()` - Delete all session data
164
+ - ✅ `clearIncompleteSessions()` - Delete only incomplete sessions
165
+ - Returns count of deleted sessions
166
+
167
+ - **State Manager Enhancements**
168
+ - ✅ `reset()` - Async method to reset state to initial
169
+ - ✅ Deletes state.json file
170
+ - ✅ Creates fresh initial state
171
+ - ✅ Renames old `reset()` to `resetMemory()` for clarity
172
+
173
+ - **Benefits**
174
+ - ✅ Easy cleanup of old session data
175
+ - ✅ Quick way to start fresh
176
+ - ✅ Clears memory/cache issues
177
+ - ✅ Maintains generated images on disk
178
+ - ✅ Clear warnings for destructive operations
179
+
180
+ ## [0.5.3] - 2026-01-14
181
+
182
+ ### Fixed 🔧 CRITICAL BUG FIX
183
+
184
+ #### Global Context Null Handling
185
+ - **Fixed "Cannot read properties of undefined (reading 'style')" Error**
186
+ - ✅ All 7 providers now handle missing/undefined `globalContext` gracefully
187
+ - ✅ Added null checks before accessing `context.style` properties
188
+ - ✅ Providers provide sensible defaults when context is missing
189
+ - ✅ Removed non-null assertion operators (`!`) from all providers
190
+ - ✅ Updated `BaseProvider` abstract method signature to make context optional
191
+
192
+ - **Provider-Specific Fixes**
193
+ - ✅ Gemini: Default to "professional style" when context missing
194
+ - ✅ OpenAI: Default to clean, modern technical documentation style
195
+ - ✅ Stability: Default positive/negative prompts without context
196
+ - ✅ Replicate: Default FLUX prompt enhancements
197
+ - ✅ xAI Grok: Default to professional, clean, modern style
198
+ - ✅ Leonardo: Default to professional, high quality, detailed
199
+ - ✅ HuggingFace: Default inference parameters and prompts
200
+
201
+ - **Impact**
202
+ - ✅ Images can now be generated even without detailed global context
203
+ - ✅ Workflow no longer crashes when context is undefined
204
+ - ✅ All providers work in "quick generation" mode
205
+ - ✅ Backward compatible with existing workflows
206
+
207
+ ## [0.5.2] - 2026-01-14
208
+
209
+ ### Added 🎯 RED LINE #6: API Testing & Output Verification
210
+
211
+ #### Real-Time Progress Bar 📊
212
+ - **Visual Progress Indicators**
213
+ - ✅ Text-based progress bar: `[████████░░░░░░░░] 8/32 (25%)`
214
+ - ✅ Real-time progress tracking during generation
215
+ - ✅ Current image name and provider display
216
+ - ✅ Elapsed time, average time per image, ETA
217
+ - ✅ Recently completed/failed image tracking (last 5)
218
+
219
+ - **Enhanced Progress Reporting**
220
+ - ✅ Progress logged after each image completes
221
+ - ✅ Works in all modes: interactive, batch, bulk
222
+ - ✅ Includes detailed timing information
223
+ - ✅ Shows queue status: pending, in-progress, completed, failed
224
+
225
+ #### API Connectivity Testing ⚡
226
+ - **All 7 Providers Implement `testConnection()`**
227
+ - ✅ Gemini: Tests `/v1beta/models` endpoint
228
+ - ✅ OpenAI: Tests `/v1/models` endpoint
229
+ - ✅ Stability: Tests `/v1/user/account` endpoint
230
+ - ✅ Replicate: Tests `/v1/models` endpoint
231
+ - ✅ xAI: Tests `/v1/models` endpoint (OpenAI-compatible)
232
+ - ✅ Leonardo: Tests `/api/rest/v1/me` endpoint
233
+ - ✅ HuggingFace: Tests model info endpoint
234
+ - Returns: `{success: boolean, message: string, latency?: number}`
235
+
236
+ - **Workflow Integration - Tests BEFORE Generation**
237
+ - ✅ Tests API connectivity before starting generation
238
+ - ✅ BLOCKS generation if API test fails
239
+ - ✅ Returns clear error with latency information
240
+ - ✅ Logs all connection attempts
241
+
242
+ #### Image Output Verification 🔍
243
+ - **File Verification After Generation**
244
+ - ✅ Verifies each generated image file exists on disk
245
+ - ✅ Checks file size (must be > 1KB for valid image)
246
+ - ✅ Separates verified images from failed images
247
+ - ✅ Only updates status for VERIFIED images
248
+
249
+ - **Accurate Generation Counts**
250
+ - ✅ Returns `imagesGenerated` (actual verified count)
251
+ - ✅ Returns `imagesFailed` (failed count)
252
+ - ✅ Returns `verification` object with detailed breakdown
253
+ - ✅ Returns `failedImages` array with reasons
254
+
255
+ - **Generation Blocking**
256
+ - ✅ Returns error if ZERO images verified
257
+ - ✅ Provides clear error messages
258
+ - ✅ Suggests actions to fix issues
259
+ - ✅ Never claims success with zero output
260
+
261
+ #### Session Auto-Resume 🔄
262
+ - **New MCP Tools**
263
+ - ✅ `vf_check_incomplete_sessions`: Find incomplete sessions
264
+ - ✅ `vf_resume_session`: Resume a specific session
265
+ - Auto-detects most recent incomplete session
266
+ - Returns recommended next steps based on status
267
+
268
+ - **Smart Resumption**
269
+ - Filters out completed/generation_complete sessions
270
+ - Sorts by timestamp (most recent first)
271
+ - Provides context-aware next steps
272
+ - Loads full session state for continuation
273
+
274
+ ### Fixed
275
+ - **Type Definitions**
276
+ - Added `testConnection()` to `IImageProvider` interface
277
+ - Fixed TypeScript compilation errors
278
+ - Removed unused variables
279
+
280
+ ### Changed
281
+ - **Workflow Return Values**
282
+ - `imagesGenerated` now returns VERIFIED count (not claimed count)
283
+ - Added `imagesFailed` to return object
284
+ - Added `verification` object with detailed breakdown
285
+ - `success` now depends on verified images count
286
+
287
+ ### Documentation
288
+ - **V0.5.2_IMPLEMENTATION_PLAN.md**: Complete implementation plan
289
+ - **API_TESTING_IMPLEMENTATION.md**: API testing approach and solution
290
+
291
+ ### User Impact ⭐
292
+ **Before (v0.5.1)**
293
+ - ❌ Says "42 images generated" but none exist
294
+ - ❌ No API test before generation
295
+ - ❌ Placeholders remain in files
296
+ - ❌ User confused why nothing happened
297
+
298
+ **After (v0.5.2)**
299
+ - ✅ Tests API before starting
300
+ - ✅ Verifies each image file exists
301
+ - ✅ Returns accurate counts
302
+ - ✅ Clear error if API fails
303
+ - ✅ Only updates status for verified images
304
+ - ✅ User knows exactly what happened
305
+ - ✅ Can auto-resume incomplete sessions
306
+
307
+ ## [0.5.1] - 2026-01-13
308
+
309
+ ### Added
310
+
311
+ #### Workflow Enforcement Rules 🚨 (Phase 1)
312
+ - **RED LINE #1: Mandatory File Analysis** - Enforced in `placeholder-manager.ts`
313
+ - ✅ Reads ENTIRE file with line count logging
314
+ - ✅ Validates file is not empty (throws error)
315
+ - ✅ Parses ALL sections with count logging
316
+ - ✅ Validates sections were found (throws error if none)
317
+ - ✅ Analyzes content for image opportunities with logging
318
+ - ✅ Cannot skip analysis or guess sections
319
+
320
+ - **RED LINE #2: Detailed Context REQUIRED** - Enforced in `workflow-tools.ts`
321
+ - ✅ Checks for detailed context before generation
322
+ - ✅ BLOCKS generation if no context exists
323
+ - ✅ WARNS if context is too short (<100 chars)
324
+ - ✅ STRONGLY RECOMMENDS detailed context over simple
325
+ - ✅ Logs all context validation
326
+
327
+ - **RED LINE #3: Explicit Tool Descriptions** - Updated in `mcp-server.ts`
328
+ - ✅ `vf_process_files` description now uses MUST/REQUIRED language
329
+ - ✅ `vf_generate_session` description details enforcement
330
+ - ✅ Clear sections: REQUIRED BEFORE, WHAT THIS DOES, WHAT IT DOES NOT DO
331
+ - ✅ AI models understand exact requirements
332
+
333
+ - **RED LINE #4: No Silent Failures** - Enforced throughout
334
+ - ✅ Comprehensive logging in all operations
335
+ - ✅ Explicit error throwing (not silent failures)
336
+ - ✅ Structured log data for debugging
337
+ - ✅ Every operation is transparent
338
+
339
+ - **RED LINE #5: Context Prepending Validation** - Enforced in `placeholder-manager.ts`
340
+ - ✅ Validates context exists before prepending
341
+ - ✅ Logs context usage (length, section)
342
+ - ✅ Prepends context with separator
343
+ - ✅ Validates final prompt length
344
+ - ✅ Warns if prompt is too short
345
+
346
+ #### Documentation
347
+ - **ENFORCEMENT_IMPLEMENTATION_SUMMARY.md**: Complete implementation summary
348
+ - What was implemented for each RED LINE
349
+ - Code examples showing enforcement
350
+ - Testing results (build ✅, startup ✅)
351
+ - Impact comparison (before/after)
352
+ - **WORKFLOW_ENFORCEMENT_RULES.md**: Rule definitions (created in v0.5.0)
353
+ - **REAL_FILE_ANALYSIS.md**: Example of proper file analysis (created in v0.5.0)
354
+
355
+ ### Changed
356
+ - **Placeholder Manager**: Now enforces file analysis (cannot skip)
357
+ - **Workflow Tools**: Now validates context requirements (blocks without context)
358
+ - **MCP Server**: Tool descriptions now explicit with requirements
359
+ - **Logging**: Comprehensive logging added throughout workflow
360
+
361
+ ### Fixed
362
+ - AI models can no longer skip file analysis
363
+ - AI models can no longer use vague or missing context
364
+ - AI models can no longer bypass workflow requirements
365
+ - All operations now logged (no silent failures)
366
+
367
+ ### Technical Details
368
+
369
+ #### Files Modified
370
+ 1. `src/placeholders/placeholder-manager.ts` - RED LINES #1, #5
371
+ 2. `src/workflow/workflow-tools.ts` - RED LINE #2
372
+ 3. `src/server/mcp-server.ts` - RED LINE #3
373
+ 4. `package.json` - Version bump to 0.5.1
374
+
375
+ #### Code Changes
376
+ - ~150 lines of enforcement code
377
+ - ~50 lines of logging
378
+ - ~80 lines of validation
379
+ - ~40 lines of documentation comments
380
+
381
+ ---
382
+
383
+ ## [0.5.0] - 2026-01-13
384
+
385
+ ### Added
386
+
387
+ #### Detailed Global Context System 🎨
388
+ - **New MCP Tool**: `vf_set_detailed_context` for comprehensive image styling
389
+ - **DetailedGlobalContext Type**: Structured context with 7 major categories:
390
+ - Visual Style & Approach (illustration style, abstraction level, complexity)
391
+ - Color Palette (hex codes, usage descriptions for primary/secondary/accent/background/text)
392
+ - Typography & Labels (font family, sizes, alignment)
393
+ - Layout & Composition (grid system, spacing, padding, whitespace)
394
+ - Technical Elements (icon style, line weights, shadows, borders, corner radius)
395
+ - Audience Context (technical level, professional context, prior knowledge, purpose)
396
+ - Content Approach (document type, tone, detail level, diagram philosophy)
397
+ - **Context Helpers**:
398
+ - `contextToPrompt()`: Convert structured context to comprehensive prompt string
399
+ - `createSimpleContext()`: Create default context from simple text
400
+ - **Session Integration**:
401
+ - Sessions now store both `detailedContext` (structured) and `globalContext` (text)
402
+ - Automatic conversion to prompt text for image generation
403
+ - Persistent storage in `detailed-context.json` per session
404
+
405
+ #### Documentation Updates
406
+ - **CLAUDE.md**: Added comprehensive "Detailed Global Context System" section
407
+ - Why detailed context matters (dramatically better results)
408
+ - What detailed context includes (7 categories explained)
409
+ - How to use the `vf_set_detailed_context` tool (with examples)
410
+ - Multi-file context inheritance guidance
411
+ - **README.md**: Added new feature to features list with ✨ NEW badge
412
+
413
+ ### Changed
414
+ - **Session Manager**: Extended to support detailed context save/load
415
+ - **Session Types**: Added `detailedContext` field to `Session` and `SessionOptions`
416
+ - **Workflow Tools**: New `handleSetDetailedContext()` method for context management
417
+ - **Type System**: New `src/types/context.ts` module with comprehensive types
418
+
419
+ ### Technical Details
420
+
421
+ #### New Files
422
+ - `src/types/context.ts`: Detailed context type definitions and helpers
423
+ - Per-session `detailed-context.json`: Structured context storage
424
+
425
+ #### Updated Files
426
+ - `src/session/types.ts`: Added `DetailedGlobalContext` import and session fields
427
+ - `src/session/session-manager.ts`: Added detailed context save/load methods
428
+ - `src/workflow/workflow-tools.ts`: Added `handleSetDetailedContext()` handler
429
+ - `src/server/mcp-server.ts`: Added `vf_set_detailed_context` tool definition
430
+ - `src/types/index.ts`: Export context types
431
+
432
+ #### Workflow Enhancement
433
+ ```
434
+ vf_start_session → vf_set_detailed_context → vf_process_files → vf_generate_session
435
+ ```
436
+
437
+ The detailed context is automatically prepended to every image prompt, ensuring:
438
+ - **Visual Consistency**: All images follow the same design system
439
+ - **Better Quality**: AI models receive specific, actionable guidance
440
+ - **Professional Results**: Hex codes, typography, and layout rules produce polished images
441
+
442
+ ### Backward Compatibility
443
+ - ✅ Fully backward compatible
444
+ - ✅ Simple `globalContext` (text) still works
445
+ - ✅ Detailed context is optional enhancement
446
+ - ✅ Sessions without detailed context use text-based context
447
+
448
+ ---
449
+
450
+ ## [0.4.1] - 2026-01-13
451
+
452
+ ### Added
453
+
454
+ #### Pricing Configuration System 💰
455
+ - **config/pricing.json**: Externalized pricing configuration with multi-model support
456
+ - **config/pricing-schema.json**: JSON schema validation for pricing configuration
457
+ - **scripts/update-pricing.js**: Interactive CLI tool for managing provider pricing
458
+ - **src/utils/pricing-checker.ts**: Automatic 24-hour pricing staleness checking
459
+ - **npm scripts**: pricing:show, pricing:check, pricing:update, pricing:set
460
+
461
+ #### Pricing Features
462
+ - **Multi-Model Support**: Each provider can have multiple models with different pricing
463
+ - **Auto-Staleness Check**: Warns users when pricing >24 hours old
464
+ - **Interactive Updates**: Easy-to-use CLI with colorized output
465
+ - **Pricing URLs**: Direct links to provider pricing pages
466
+ - **Timestamp Tracking**: lastUpdated and lastChecked timestamps
467
+
468
+ ### Changed
469
+
470
+ #### Documentation Reorganization 📚
471
+ - **Root Cleanup**: Reduced root markdown files from 15 to 3 (80% reduction)
472
+ - **New Structure**: Organized documentation into logical directories
473
+ - docs/guides/ - User-facing documentation (8 files)
474
+ - docs/integrations/ - Third-party integrations (5 files)
475
+ - docs/development/ - Internal development docs (6 files)
476
+ - docs/releases/ - Release notes archive (2 files)
477
+ - docs/archive/ - Historical documentation (10 files)
478
+ - **README Files**: Added README.md in each docs subdirectory
479
+ - **CLAUDE.md**: Added documentation structure reference section
480
+
481
+ #### Provider Improvements
482
+ - **Graceful Degradation**: MCP server now starts successfully without API keys
483
+ - **Better Error Messages**: Enhanced guidance to configure_provider tool
484
+ - **Provider Checking**: Only validates providers when actually needed
485
+
486
+ #### Wording Updates
487
+ - Removed "free" marketing language throughout codebase
488
+ - Changed to "$0.00" or "no-cost" terminology
489
+ - Kept "Nano Banana" branding as requested
490
+ - Updated Gemini provider display text and comments
491
+
492
+ ### Fixed
493
+ - MCP server no longer crashes on startup when no API keys configured
494
+ - Clear error messages guide users to proper configuration steps
495
+
496
+ ## [0.4.0] - 2026-01-13
497
+
498
+ ### Added
499
+
500
+ #### Visual Forge Workflow Session Management 🔄
501
+ - **vf_start_session**: Initialize new workflow sessions with git branch integration
502
+ - **vf_process_files**: Automated placeholder addition and image spec parsing
503
+ - **vf_generate_session**: Complete session image generation with auto-document updates
504
+ - **vf_regenerate_image**: Regenerate specific images with new prompts/providers
505
+ - **vf_finalize_session**: Commit changes and create PRs via GitHub CLI
506
+ - **vf_get_session**: Retrieve session information and status
507
+ - **vf_list_sessions**: List all workflow sessions with filtering
508
+
509
+ #### Session Management Features
510
+ - **Session Persistence**: Full session state tracking across restarts
511
+ - **Global Context**: Theme/style context prepended to all image prompts
512
+ - **Git Integration**: Automatic branch creation and PR management
513
+ - **Multi-File Workflows**: Process multiple files in a single session
514
+ - **Session Recovery**: Resume interrupted sessions from saved state
515
+
516
+ #### Backup Management Tools 🛡️
517
+ - **approve_changes**: Approve modifications and delete backup files
518
+ - **restore_from_backups**: Restore all files from backups
519
+ - **list_backups**: Display current backup status and details
520
+
521
+ #### Documentation
522
+ - **VF_WORKFLOW.md**: Complete workflow guide
523
+ - **WORKFLOW_IMPLEMENTATION_PLAN.md**: Technical implementation details
524
+ - **WORKFLOW_IMPLEMENTATION_COMPLETE.md**: Implementation summary
525
+ - **N8N_INTEGRATION_COMPLETE.md**: N8N integration documentation
526
+ - **docs/N8N_INTEGRATION.md**: N8N setup and usage guide
527
+ - **docs/N8N_QUICK_START.md**: Quick start guide for N8N
528
+ - **docs/CONTINUE_SETUP.md**: Continue.dev integration guide
529
+ - **docs/CURSOR_SETUP.md**: Cursor IDE setup guide
530
+
531
+ #### Infrastructure
532
+ - **src/session/**: Session management module
533
+ - **src/git/**: Git operations integration
534
+ - **src/placeholders/**: Placeholder injection system
535
+ - **HTTP Server**: Optional HTTP API server (src/http-server.ts)
536
+ - **OpenAPI Spec**: Complete API documentation (docs/openapi.yaml)
537
+
538
+ #### Testing & Development
539
+ - **test/helpers/**: Test utilities and mocks
540
+ - **test/providers/**: Provider system tests
541
+ - **DEVELOPER_TESTING_GUIDE.md**: Comprehensive testing guide
542
+ - **MANUAL_TESTING_GUIDE.md**: Manual testing procedures
543
+
544
+ #### Third-Party Integration
545
+ - **n8n-nodes-visual-forge/**: Custom N8N nodes for Visual Forge
546
+ - **n8n-workflows/**: Pre-built N8N workflow templates
547
+ - **scripts/npm-manager.js**: NPM package management utilities
548
+
549
+ ### Changed
550
+ - **StateManager**: Enhanced with session tracking and recovery
551
+ - **MCP Server**: Added 10 new workflow and backup management tools
552
+ - **WorkflowTools**: Complete workflow orchestration system
553
+ - **Documentation Structure**: Reorganized and expanded
554
+
555
+ ### Fixed
556
+ - **TESTING-GUIDE.md**: Replaced with DEVELOPER_TESTING_GUIDE.md
557
+
558
+ ### Technical Details
559
+
560
+ #### New MCP Tools (10 total)
561
+ | Tool | Purpose |
562
+ |------|---------|
563
+ | vf_start_session | Start workflow session |
564
+ | vf_process_files | Add placeholders & parse |
565
+ | vf_generate_session | Generate all images |
566
+ | vf_regenerate_image | Regenerate specific image |
567
+ | vf_finalize_session | Commit & create PR |
568
+ | vf_get_session | Get session info |
569
+ | vf_list_sessions | List sessions |
570
+ | approve_changes | Approve file changes |
571
+ | restore_from_backups | Restore from backups |
572
+ | list_backups | List backup status |
573
+
574
+ #### Session Architecture
575
+ ```
576
+ Session Manager
577
+ ├── Session State (persistent)
578
+ ├── Git Integration (branches, commits, PRs)
579
+ ├── Placeholder Injection
580
+ ├── Image Generation Queue
581
+ ├── Document Update System
582
+ └── Backup Integration
583
+ ```
584
+
585
+ ### Backward Compatibility
586
+ - ✅ Fully backward compatible
587
+ - ✅ Existing workflows unchanged
588
+ - ✅ No breaking changes
589
+ - ✅ New features optional
590
+
591
+ ---
592
+
593
+ ## [0.3.0] - 2026-01-13
594
+
595
+ ### Added
596
+
597
+ #### HTML File Support 🌐
598
+ - **Multi-Format Parser**: New `DocumentParser` class supporting multiple file formats
599
+ - **HTML Handler**: Complete HTML file parsing and manipulation
600
+ - Parse image specifications from HTML comments (`<!-- VF_IMAGE: {...} -->`)
601
+ - Parse from `data-vf-*` attributes on `<img>` tags
602
+ - Automatic image insertion with clean HTML output
603
+ - Support for `.html` and `.htm` files
604
+ - **File Handler Architecture**: Extensible architecture for future formats (.docx, .pptx)
605
+ - **Mixed Format Projects**: Parse HTML and Markdown files in the same workflow
606
+
607
+ #### Backup System Integration ✅
608
+ - **Automatic Backups**: Files backed up before modification during workflow
609
+ - **Workflow Integration**: BackupManager integrated into WorkflowTools
610
+ - **Reminder System**: 24-hour reminder checks on session start
611
+ - **Workflow Messages**: Backup status included in generation responses
612
+ - **Complete Documentation**: Comprehensive guides for backup workflow
613
+
614
+ #### Testing
615
+ - **HTML Handler Tests**: 18 comprehensive tests covering parsing and insertion
616
+ - **Workflow Integration Tests**: 14 tests for backup workflow lifecycle
617
+ - **Total Test Coverage**: 77 tests (all passing)
618
+
619
+ ### Changed
620
+ - **DocumentParser**: Replaced MarkdownParser in workflow tools for multi-format support
621
+ - **README**: Updated features to highlight HTML support and backup system
622
+ - **Description**: Updated package description to include HTML support
623
+
624
+ ### Dependencies
625
+ - **Added**: `cheerio@^1.0.0` for HTML parsing (~180KB)
626
+
627
+ ### Documentation
628
+ - **docs/HTML_SUPPORT.md**: Complete HTML support guide with examples
629
+ - **docs/WORKFLOW_WITH_BACKUPS.md**: Workflow integration guide
630
+ - **docs/BACKUP_SYSTEM.md**: Complete backup system reference
631
+ - **RELEASE_NOTES_v0.3.0.md**: Detailed release notes
632
+
633
+ ### Security
634
+ - ✅ **Snyk Scan**: Zero vulnerabilities found (198 dependencies scanned)
635
+ - ✅ **License Compliance**: All licenses verified
636
+
637
+ ### Technical Details
638
+
639
+ #### Architecture Changes
640
+ ```
641
+ FileHandler (interface)
642
+ ├── MarkdownHandler (.md, .markdown)
643
+ ├── HTMLHandler (.html, .htm)
644
+ └── DocumentParser (orchestrator)
645
+ ```
646
+
647
+ #### Test Coverage
648
+ | Component | Tests | Status |
649
+ |-----------|-------|--------|
650
+ | Provider System | 21 | ✅ Pass |
651
+ | Backup Manager | 24 | ✅ Pass |
652
+ | HTML Handler | 18 | ✅ Pass |
653
+ | Workflow Integration | 14 | ✅ Pass |
654
+ | **Total** | **77** | **✅ All Pass** |
655
+
656
+ ### Backward Compatibility
657
+ - ✅ Fully backward compatible
658
+ - ✅ Existing Markdown workflows unchanged
659
+ - ✅ No breaking changes
660
+
661
+ ---
662
+
663
+ ## [0.1.0] - 2026-01-13
664
+
665
+ ### Added
666
+
667
+ #### Core Features
668
+ - **Multi-Provider Architecture**: Support for 7 AI image generation providers
669
+ - OpenAI GPT Image 1 ($0.04-0.12/image)
670
+ - Google Gemini 2.5 Flash Image ($0.039/image)
671
+ - Stability AI SDXL 1.0 ($0.04/image)
672
+ - Replicate FLUX Schnell ($0.003/image)
673
+ - Leonardo Phoenix ($0.02/image)
674
+ - HuggingFace Inference (FREE)
675
+ - xAI Grok 2 Image ($0.07/image)
676
+ - **Provider Factory Pattern**: Easy provider initialization and management
677
+ - **Base Provider Abstract Class**: Consistent interface across all providers
678
+ - **Rate Limiting**: Token bucket algorithm per provider to prevent API bans
679
+ - **Cost Tracking**: Real-time cost monitoring and estimation per provider
680
+ - **Quality Inspection Module**: Automated image quality analysis
681
+ - Sharpness detection (Laplacian variance)
682
+ - Brightness analysis (0-255 scale)
683
+ - File size validation
684
+ - Dimension verification
685
+ - Format checking
686
+
687
+ #### Provider Implementations
688
+
689
+ **Google Gemini Provider**
690
+ - Full API integration with Gemini 2.5 Flash Image (Nano Banana)
691
+ - Correct endpoint: `/v1beta/models/gemini-2.5-flash-image:generateContent`
692
+ - Custom authentication header: `x-goog-api-key`
693
+ - SynthID watermarking support
694
+ - Multilingual prompt support
695
+ - 100% success rate in testing
696
+
697
+ **OpenAI GPT Image Provider**
698
+ - Support for GPT Image 1 model
699
+ - Quality modes: standard ($0.04) and HD ($0.08-0.12)
700
+ - Removed unsupported parameters (style, response_format) for GPT Image models
701
+ - PNG output format
702
+
703
+ **Stability AI Provider**
704
+ - SDXL 1.0 engine support
705
+ - Custom dimension mapping for SDXL-compatible sizes
706
+ - Multi-image generation support (samples parameter)
707
+ - Credit-based cost tracking
708
+
709
+ **Replicate Provider**
710
+ - FLUX Schnell model support (fast, cost-effective)
711
+ - Async prediction API with polling
712
+ - Most cost-effective option at $0.003/image
713
+
714
+ **Leonardo Provider**
715
+ - Phoenix model support
716
+ - Credit-based pricing
717
+
718
+ **HuggingFace Provider**
719
+ - Router endpoint: `https://router.huggingface.co`
720
+ - Free model support
721
+
722
+ **xAI Grok Provider**
723
+ - Grok 2 Image model support
724
+ - Automatic prompt revision by chat model
725
+ - JPG output format (not PNG)
726
+ - OpenAI-compatible API format
727
+
728
+ #### Generation Scripts
729
+ - `check-providers.ts`: Provider status and configuration checker
730
+ - `generate-with-gemini.ts`: Gemini-specific generation
731
+ - `generate-with-xai.ts`: xAI Grok-specific generation
732
+ - `generate-all-providers.ts`: Multi-provider comparison tool
733
+ - `generate-solo-theme-test.ts`: Versioning test with unified theme
734
+
735
+ #### Documentation
736
+ - Comprehensive README.md with installation instructions
737
+ - Detailed provider comparison table
738
+ - Cost analysis for 151-image project
739
+ - MCP client configuration examples for 5+ clients
740
+ - Troubleshooting guide
741
+ - API key setup documentation
742
+
743
+ #### Developer Tools
744
+ - TypeScript strict mode enabled
745
+ - ES2022 target
746
+ - Type definitions for all interfaces
747
+ - Logger utility with structured logging
748
+ - HTTP client wrapper with axios-retry
749
+ - Rate limiter with configurable limits
750
+
751
+ ### Fixed
752
+ - **Gemini API Integration**: Fixed 404 errors by correcting endpoint, authentication, and request format
753
+ - **OpenAI GPT Image**: Removed unsupported 'style' and 'response_format' parameters
754
+ - **Stability AI SDXL**: Fixed dimension validation with SDXL-compatible size mapping
755
+ - **Abstract Property Access**: Created `init()` method pattern to avoid accessing abstract properties in constructor
756
+
757
+ ### Changed
758
+ - Updated provider factory to use Gemini as default (high success rate, good pricing)
759
+ - Changed HuggingFace endpoint to `https://router.huggingface.co`
760
+ - Improved error messages with actionable solutions
761
+
762
+ ### Technical Details
763
+
764
+ #### Dependencies
765
+ - `@modelcontextprotocol/sdk`: ^1.25.2
766
+ - `zod`: ^3.25.0 (validation)
767
+ - `axios`: ^1.7.0 (HTTP client)
768
+ - `axios-retry`: ^4.5.0 (retry logic)
769
+ - `sharp`: ^0.33.0 (image processing)
770
+ - `dotenv`: ^16.4.0 (env management)
771
+
772
+ #### File Structure
773
+ ```
774
+ src/
775
+ ├── providers/ # 7 provider implementations
776
+ ├── quality/ # Quality inspection module
777
+ ├── state/ # State management (future)
778
+ ├── types/ # TypeScript definitions
779
+ └── utils/ # Logger, rate limiter, HTTP client
780
+ ```
781
+
782
+ #### Testing Results
783
+ - **Gemini**: 6/6 images (100% success rate)
784
+ - **Stability AI**: 3/6 images (ran out of credits)
785
+ - **xAI Grok**: 2/6 images (intermittent access)
786
+ - **Total generated**: 23 test images across providers
787
+ - **Total cost**: ~$0.494
788
+
789
+ ### Known Issues
790
+ - HuggingFace provider needs additional fixes (404 errors)
791
+ - OpenAI GPT Image needs rerun with fixed build
792
+ - xAI Grok has intermittent API access
793
+ - Text in AI-generated diagrams is often illegible (known AI limitation)
794
+
795
+ ### Coming Soon (v0.2.0)
796
+ - Full MCP server implementation
797
+ - Markdown parser for visual guides
798
+ - Interactive, batch, and bulk workflow modes
799
+ - State persistence and session resumption
800
+ - Additional provider support
801
+ - REST API mode
802
+
803
+ ---
804
+
805
+ ## Versioning Notes
806
+
807
+ This project follows [Semantic Versioning](https://semver.org/):
808
+ - **MAJOR** version for incompatible API changes
809
+ - **MINOR** version for new functionality in a backwards compatible manner
810
+ - **PATCH** version for backwards compatible bug fixes
811
+
812
+ ---
813
+
814
+ [0.1.0]: https://github.com/yourusername/visual-forge-mcp/releases/tag/v0.1.0