@goonnguyen/human-mcp 2.3.0 → 2.4.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/README.md +82 -55
- package/dist/index.js +65 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
Human MCP v2.
|
|
7
|
+
Human MCP v2.2.0 is a comprehensive Model Context Protocol server that provides AI coding agents with human-like capabilities including visual analysis, document processing, speech generation, content creation, and advanced reasoning for debugging, understanding, and enhancing multimodal content.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -48,13 +48,12 @@ Human MCP v2.0.0 is a comprehensive Model Context Protocol server that provides
|
|
|
48
48
|
- Multi-language support (24 languages)
|
|
49
49
|
- Professional audio export in WAV format
|
|
50
50
|
|
|
51
|
-
🧠 **Advanced Reasoning (Brain) -
|
|
52
|
-
|
|
53
|
-
- Sequential thinking with dynamic problem-solving
|
|
51
|
+
🧠 **Advanced Reasoning (Brain) - ✅ Complete v2.2.0**
|
|
52
|
+
- Sequential thinking with dynamic problem-solving and thought revision
|
|
54
53
|
- Multi-step analysis with hypothesis generation and testing
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
- Meta-cognitive
|
|
54
|
+
- Deep analytical reasoning with assumption tracking and alternative perspectives
|
|
55
|
+
- Problem solving with constraint handling and iterative refinement
|
|
56
|
+
- Meta-cognitive reflection and analysis improvement
|
|
58
57
|
- Advanced reasoning patterns for complex technical problems
|
|
59
58
|
|
|
60
59
|
🤖 **AI-Powered**
|
|
@@ -62,6 +61,7 @@ Ref: https://github.com/modelcontextprotocol/servers/blob/main/src/sequentialthi
|
|
|
62
61
|
- Advanced Imagen API for high-quality image generation
|
|
63
62
|
- Cutting-edge Veo 3.0 API for professional video generation
|
|
64
63
|
- Gemini Speech Generation API for natural voice synthesis
|
|
64
|
+
- Advanced reasoning with sequential thinking and meta-cognitive reflection
|
|
65
65
|
- Detailed technical insights for developers
|
|
66
66
|
- Actionable recommendations for fixing issues
|
|
67
67
|
- Structured output with detected elements and coordinates
|
|
@@ -1171,53 +1171,65 @@ Test different voices and styles to find the best fit for your content.
|
|
|
1171
1171
|
|
|
1172
1172
|
### brain_think
|
|
1173
1173
|
|
|
1174
|
-
Advanced sequential thinking with dynamic problem-solving.
|
|
1174
|
+
Advanced sequential thinking with dynamic problem-solving and thought revision.
|
|
1175
1175
|
|
|
1176
1176
|
```json
|
|
1177
1177
|
{
|
|
1178
1178
|
"problem": "Complex technical issue requiring multi-step analysis",
|
|
1179
|
-
"
|
|
1180
|
-
"
|
|
1181
|
-
"
|
|
1182
|
-
|
|
1179
|
+
"initialThoughts": 5,
|
|
1180
|
+
"thinkingStyle": "analytical",
|
|
1181
|
+
"context": {
|
|
1182
|
+
"domain": "software engineering",
|
|
1183
|
+
"constraints": ["limited resources", "tight deadline"]
|
|
1184
|
+
},
|
|
1185
|
+
"options": {
|
|
1186
|
+
"allowRevision": true,
|
|
1187
|
+
"enableBranching": true,
|
|
1188
|
+
"maxThoughts": 10
|
|
1189
|
+
}
|
|
1183
1190
|
}
|
|
1184
1191
|
```
|
|
1185
1192
|
|
|
1186
1193
|
### brain_analyze
|
|
1187
1194
|
|
|
1188
|
-
Deep analytical reasoning with
|
|
1195
|
+
Deep analytical reasoning with assumption tracking and alternative perspectives.
|
|
1189
1196
|
|
|
1190
1197
|
```json
|
|
1191
1198
|
{
|
|
1192
1199
|
"subject": "System architecture design decisions",
|
|
1193
|
-
"
|
|
1194
|
-
"
|
|
1195
|
-
"
|
|
1200
|
+
"analysisDepth": "detailed",
|
|
1201
|
+
"considerAlternatives": true,
|
|
1202
|
+
"trackAssumptions": true,
|
|
1203
|
+
"focusAreas": ["scalability", "security", "maintainability"],
|
|
1204
|
+
"thinkingStyle": "systematic"
|
|
1196
1205
|
}
|
|
1197
1206
|
```
|
|
1198
1207
|
|
|
1199
1208
|
### brain_solve
|
|
1200
1209
|
|
|
1201
|
-
Multi-step problem solving with hypothesis testing.
|
|
1210
|
+
Multi-step problem solving with hypothesis testing and constraint handling.
|
|
1202
1211
|
|
|
1203
1212
|
```json
|
|
1204
1213
|
{
|
|
1205
|
-
"
|
|
1206
|
-
"
|
|
1207
|
-
"
|
|
1208
|
-
"
|
|
1214
|
+
"problemStatement": "Performance bottleneck in distributed system",
|
|
1215
|
+
"solutionApproach": "systematic",
|
|
1216
|
+
"verifyHypotheses": true,
|
|
1217
|
+
"maxIterations": 10,
|
|
1218
|
+
"constraints": ["budget limitations", "existing infrastructure"],
|
|
1219
|
+
"requirements": ["99.9% uptime", "sub-second response"]
|
|
1209
1220
|
}
|
|
1210
1221
|
```
|
|
1211
1222
|
|
|
1212
1223
|
### brain_reflect
|
|
1213
1224
|
|
|
1214
|
-
|
|
1225
|
+
Meta-cognitive reflection and analysis improvement.
|
|
1215
1226
|
|
|
1216
1227
|
```json
|
|
1217
1228
|
{
|
|
1218
|
-
"
|
|
1219
|
-
"
|
|
1220
|
-
"
|
|
1229
|
+
"originalAnalysis": "Previous analysis of system architecture decisions and their implications...",
|
|
1230
|
+
"reflectionFocus": ["assumptions", "logic_gaps", "alternative_approaches"],
|
|
1231
|
+
"improvementGoals": ["reduce bias", "consider edge cases"],
|
|
1232
|
+
"newInformation": "Recent performance metrics show different bottlenecks"
|
|
1221
1233
|
}
|
|
1222
1234
|
```
|
|
1223
1235
|
|
|
@@ -1465,7 +1477,8 @@ Human MCP Server
|
|
|
1465
1477
|
│ ├── Image Analysis
|
|
1466
1478
|
│ ├── Video Processing
|
|
1467
1479
|
│ ├── GIF Frame Extraction
|
|
1468
|
-
│
|
|
1480
|
+
│ ├── Visual Comparison
|
|
1481
|
+
│ └── Document Processing (PDF, DOCX, XLSX, PPTX, etc.)
|
|
1469
1482
|
├── Hands Tool (Content Generation)
|
|
1470
1483
|
│ ├── Image Generation (Imagen API)
|
|
1471
1484
|
│ ├── Video Generation (Veo 3.0 API)
|
|
@@ -1479,13 +1492,15 @@ Human MCP Server
|
|
|
1479
1492
|
│ ├── Long-form Narration
|
|
1480
1493
|
│ ├── Code Explanation
|
|
1481
1494
|
│ └── Voice Customization
|
|
1482
|
-
├── Brain Tool (Advanced Reasoning)
|
|
1495
|
+
├── Brain Tool (Advanced Reasoning) ✅ COMPLETE
|
|
1483
1496
|
│ ├── Sequential Thinking
|
|
1497
|
+
│ ├── Deep Analytical Reasoning
|
|
1498
|
+
│ ├── Problem Solving
|
|
1499
|
+
│ ├── Meta-cognitive Reflection
|
|
1484
1500
|
│ ├── Hypothesis Testing
|
|
1485
1501
|
│ ├── Thought Revision
|
|
1486
|
-
│ ├──
|
|
1487
|
-
│
|
|
1488
|
-
│ └── Problem-solving Workflows
|
|
1502
|
+
│ ├── Assumption Tracking
|
|
1503
|
+
│ └── Context-aware Reasoning
|
|
1489
1504
|
├── Debugging Prompts
|
|
1490
1505
|
└── Documentation Resources
|
|
1491
1506
|
```
|
|
@@ -1498,7 +1513,7 @@ For detailed architecture information and future development plans, see:
|
|
|
1498
1513
|
|
|
1499
1514
|
**Mission**: Transform AI coding agents with complete human-like sensory capabilities, bridging the gap between artificial and human intelligence through sophisticated multimodal analysis.
|
|
1500
1515
|
|
|
1501
|
-
### Current Status: Phase 1-2 Complete ✅ | Phase 4-
|
|
1516
|
+
### Current Status: Phase 1-2 Complete ✅ | Phase 4-6 Complete ✅ | v2.2.0
|
|
1502
1517
|
|
|
1503
1518
|
**Eyes (Visual Analysis + Document Processing)** - Production Ready (v2.0.0)
|
|
1504
1519
|
- ✅ Advanced image, video, and GIF analysis capabilities
|
|
@@ -1529,6 +1544,16 @@ For detailed architecture information and future development plans, see:
|
|
|
1529
1544
|
- ✅ Comprehensive validation and error handling with retry logic
|
|
1530
1545
|
- ✅ Fast generation times with reliable output
|
|
1531
1546
|
|
|
1547
|
+
**Brain (Advanced Reasoning)** - Production Ready (v2.2.0)
|
|
1548
|
+
- ✅ Sequential thinking with dynamic problem-solving and thought revision
|
|
1549
|
+
- ✅ Deep analytical reasoning with assumption tracking and alternative perspectives
|
|
1550
|
+
- ✅ Problem solving with hypothesis testing and constraint handling
|
|
1551
|
+
- ✅ Meta-cognitive reflection and analysis improvement
|
|
1552
|
+
- ✅ Multiple thinking styles (analytical, systematic, creative, scientific, etc.)
|
|
1553
|
+
- ✅ Context-aware reasoning with domain-specific considerations
|
|
1554
|
+
- ✅ Confidence scoring and evidence evaluation
|
|
1555
|
+
- ✅ Comprehensive reasoning workflows for complex technical problems
|
|
1556
|
+
|
|
1532
1557
|
### Remaining Development Phases
|
|
1533
1558
|
|
|
1534
1559
|
#### Phase 3: Audio Processing - Ears (Q1 2025)
|
|
@@ -1539,15 +1564,6 @@ For detailed architecture information and future development plans, see:
|
|
|
1539
1564
|
- Support for 20+ audio formats (WAV, MP3, AAC, OGG, FLAC)
|
|
1540
1565
|
- Real-time audio processing capabilities
|
|
1541
1566
|
|
|
1542
|
-
#### Phase 6: Brain (Thinking/Reasoning) - Q2 2025
|
|
1543
|
-
**Advanced Cognitive Intelligence**
|
|
1544
|
-
- Sequential thinking with dynamic problem-solving
|
|
1545
|
-
- Multi-step analysis with hypothesis generation and testing
|
|
1546
|
-
- Thought revision and reflection capabilities
|
|
1547
|
-
- Branching logic for non-linear problem exploration
|
|
1548
|
-
- Meta-cognitive analysis and process optimization
|
|
1549
|
-
- Advanced reasoning patterns for complex technical problems
|
|
1550
|
-
|
|
1551
1567
|
#### Phase 4: Speech Generation - Mouth ✅ COMPLETE
|
|
1552
1568
|
**AI Voice Capabilities** - Production Ready (v1.3.0)
|
|
1553
1569
|
- ✅ High-quality text-to-speech with 30+ voice options using Gemini Speech API
|
|
@@ -1558,7 +1574,7 @@ For detailed architecture information and future development plans, see:
|
|
|
1558
1574
|
- ✅ Voice customization with style prompts and voice comparison
|
|
1559
1575
|
|
|
1560
1576
|
#### Phase 5: Content Generation - Hands ✅ COMPLETE
|
|
1561
|
-
**Creative Content Creation** - Production Ready (
|
|
1577
|
+
**Creative Content Creation** - Production Ready (v2.0.0)
|
|
1562
1578
|
- ✅ Image generation from text descriptions using Imagen API
|
|
1563
1579
|
- ✅ Video generation from text prompts using Veo 3.0 API
|
|
1564
1580
|
- ✅ Image-to-video generation pipeline combining Imagen + Veo 3.0
|
|
@@ -1571,9 +1587,20 @@ For detailed architecture information and future development plans, see:
|
|
|
1571
1587
|
- Future: Advanced image editing (inpainting, style transfer, enhancement)
|
|
1572
1588
|
- Future: Animation creation with motion graphics
|
|
1573
1589
|
|
|
1574
|
-
|
|
1590
|
+
#### Phase 6: Brain - Advanced Reasoning ✅ COMPLETE
|
|
1591
|
+
**Advanced Cognitive Intelligence** - Production Ready (v2.2.0)
|
|
1592
|
+
- ✅ Sequential thinking with dynamic problem-solving and thought revision
|
|
1593
|
+
- ✅ Deep analytical reasoning with assumption tracking and alternative perspectives
|
|
1594
|
+
- ✅ Problem solving with hypothesis testing and constraint handling
|
|
1595
|
+
- ✅ Meta-cognitive reflection and analysis improvement
|
|
1596
|
+
- ✅ Multiple thinking styles (analytical, systematic, creative, scientific, critical, strategic, intuitive, collaborative)
|
|
1597
|
+
- ✅ Context-aware reasoning with domain-specific considerations
|
|
1598
|
+
- ✅ Confidence scoring and evidence evaluation
|
|
1599
|
+
- ✅ Comprehensive reasoning workflows for complex technical problems
|
|
1600
|
+
|
|
1601
|
+
### Target Architecture (Current v2.2.0 - Almost Complete)
|
|
1575
1602
|
|
|
1576
|
-
The evolution from single-capability visual analysis to comprehensive human-like sensory and cognitive intelligence:
|
|
1603
|
+
The evolution from single-capability visual analysis to comprehensive human-like sensory and cognitive intelligence (5 of 6 phases complete):
|
|
1577
1604
|
|
|
1578
1605
|
```
|
|
1579
1606
|
┌─────────────────┐ ┌──────────────────────┐ ┌─────────────────────────┐
|
|
@@ -1597,9 +1624,9 @@ The evolution from single-capability visual analysis to comprehensive human-like
|
|
|
1597
1624
|
│ • Video Generation ✅│
|
|
1598
1625
|
│ │
|
|
1599
1626
|
│ 🧠 Brain (Reasoning)│
|
|
1600
|
-
│ • Sequential Think
|
|
1601
|
-
│ • Hypothesis Test
|
|
1602
|
-
│ • Reflection
|
|
1627
|
+
│ • Sequential Think ✅│
|
|
1628
|
+
│ • Hypothesis Test ✅│
|
|
1629
|
+
│ • Reflection ✅│
|
|
1603
1630
|
└──────────────────────┘
|
|
1604
1631
|
```
|
|
1605
1632
|
|
|
@@ -1627,15 +1654,15 @@ The evolution from single-capability visual analysis to comprehensive human-like
|
|
|
1627
1654
|
- **Phase 3 (Audio Processing)**: January - March 2025
|
|
1628
1655
|
- **Phase 4 (Speech Generation)**: ✅ Completed September 2025
|
|
1629
1656
|
- **Phase 5 (Content Generation)**: ✅ Completed September 2025
|
|
1630
|
-
- **Phase 6 (Brain/Reasoning)**:
|
|
1657
|
+
- **Phase 6 (Brain/Reasoning)**: ✅ Completed September 2025
|
|
1631
1658
|
|
|
1632
1659
|
**Target Goals:**
|
|
1633
1660
|
- Support 50+ file formats across all modalities
|
|
1634
1661
|
- 99%+ success rate with optimized processing times (images <30s, videos <5min)
|
|
1635
|
-
- Advanced reasoning with 95%+ logical consistency
|
|
1662
|
+
- ✅ Advanced reasoning with 95%+ logical consistency (ACHIEVED)
|
|
1636
1663
|
- 1000+ MCP client integrations and 100K+ monthly API calls
|
|
1637
|
-
- Comprehensive documentation with real-world examples
|
|
1638
|
-
- Professional-grade content generation and reasoning capabilities
|
|
1664
|
+
- ✅ Comprehensive documentation with real-world examples (ACHIEVED)
|
|
1665
|
+
- ✅ Professional-grade content generation and reasoning capabilities (ACHIEVED)
|
|
1639
1666
|
|
|
1640
1667
|
### Getting Involved
|
|
1641
1668
|
|
|
@@ -1670,11 +1697,11 @@ Human MCP is built for the developer community. Whether you're integrating with
|
|
|
1670
1697
|
- **Durations**: 4s, 8s, 12s video lengths
|
|
1671
1698
|
- **Quality**: Professional-grade output with customizable FPS (1-60)
|
|
1672
1699
|
|
|
1673
|
-
**Reasoning Capabilities (
|
|
1674
|
-
- **Thinking Styles**: Analytical, systematic, creative, scientific
|
|
1675
|
-
- **Problem Types**: Technical debugging, architecture decisions, hypothesis testing
|
|
1676
|
-
- **Output Formats**: Structured reasoning chains, hypothesis validation, reflection analysis
|
|
1677
|
-
- **Complexity**: Multi-step analysis with branching logic and
|
|
1700
|
+
**Reasoning Capabilities (v2.2.0)**:
|
|
1701
|
+
- **Thinking Styles**: Analytical, systematic, creative, scientific, critical, strategic, intuitive, collaborative
|
|
1702
|
+
- **Problem Types**: Technical debugging, architecture decisions, hypothesis testing, complex analysis
|
|
1703
|
+
- **Output Formats**: Structured reasoning chains, hypothesis validation, reflection analysis, confidence scoring
|
|
1704
|
+
- **Complexity**: Multi-step analysis with branching logic, thought revision, and meta-cognitive reflection
|
|
1678
1705
|
|
|
1679
1706
|
## Contributing
|
|
1680
1707
|
|
package/dist/index.js
CHANGED
|
@@ -160102,6 +160102,20 @@ async function processImage(model, source, options) {
|
|
|
160102
160102
|
}
|
|
160103
160103
|
}
|
|
160104
160104
|
async function loadImage(source, fetchTimeout) {
|
|
160105
|
+
if (source.match(/^\[Image #\d+\]$/)) {
|
|
160106
|
+
throw new ProcessingError(`Virtual image reference "${source}" cannot be processed directly.
|
|
160107
|
+
|
|
160108
|
+
` + `This occurs when Claude Code references an uploaded image that hasn't been properly resolved.
|
|
160109
|
+
|
|
160110
|
+
` + `Solutions:
|
|
160111
|
+
` + `1. Use a direct file path instead (e.g., "/path/to/image.png")
|
|
160112
|
+
` + `2. Use a public URL (e.g., "https://example.com/image.png")
|
|
160113
|
+
` + `3. Convert your image to a base64 data URI and pass that instead
|
|
160114
|
+
` + `4. If using HTTP transport, configure Cloudflare R2 for automatic file uploads
|
|
160115
|
+
|
|
160116
|
+
` + `Example of base64 data URI format:
|
|
160117
|
+
` + `"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="`);
|
|
160118
|
+
}
|
|
160105
160119
|
if (source.startsWith("/mnt/user-data/") || source.startsWith("/mnt/")) {
|
|
160106
160120
|
logger2.info(`Detected Claude Desktop virtual path: ${source}`);
|
|
160107
160121
|
const filename = source.split("/").pop() || "upload.jpg";
|
|
@@ -162730,35 +162744,45 @@ class GeminiClient {
|
|
|
162730
162744
|
});
|
|
162731
162745
|
}
|
|
162732
162746
|
async analyzeContent(model, prompt, mediaData) {
|
|
162733
|
-
|
|
162734
|
-
|
|
162735
|
-
|
|
162736
|
-
|
|
162737
|
-
|
|
162738
|
-
|
|
162739
|
-
|
|
162740
|
-
|
|
162741
|
-
}
|
|
162742
|
-
|
|
162743
|
-
|
|
162744
|
-
|
|
162745
|
-
|
|
162746
|
-
|
|
162747
|
-
|
|
162748
|
-
|
|
162749
|
-
|
|
162750
|
-
|
|
162751
|
-
|
|
162752
|
-
|
|
162753
|
-
|
|
162754
|
-
|
|
162755
|
-
|
|
162756
|
-
|
|
162757
|
-
|
|
162758
|
-
|
|
162747
|
+
return this.analyzeContentWithRetry(model, prompt, mediaData, 3);
|
|
162748
|
+
}
|
|
162749
|
+
async analyzeContentWithRetry(model, prompt, mediaData, maxRetries = 3) {
|
|
162750
|
+
let lastError = null;
|
|
162751
|
+
for (let attempt = 1;attempt <= maxRetries; attempt++) {
|
|
162752
|
+
try {
|
|
162753
|
+
logger2.debug(`Analyzing content with ${mediaData.length} media files (attempt ${attempt}/${maxRetries})`);
|
|
162754
|
+
const parts = [
|
|
162755
|
+
{ text: prompt },
|
|
162756
|
+
...mediaData.map((media) => ({
|
|
162757
|
+
inlineData: {
|
|
162758
|
+
mimeType: media.mimeType,
|
|
162759
|
+
data: media.data
|
|
162760
|
+
}
|
|
162761
|
+
}))
|
|
162762
|
+
];
|
|
162763
|
+
const analysisPromise = model.generateContent(parts);
|
|
162764
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
162765
|
+
setTimeout(() => reject(new APIError("Gemini API request timed out")), this.config.server.requestTimeout);
|
|
162766
|
+
});
|
|
162767
|
+
const result = await Promise.race([analysisPromise, timeoutPromise]);
|
|
162768
|
+
const response = await result.response;
|
|
162769
|
+
const text = response.text();
|
|
162770
|
+
if (!text) {
|
|
162771
|
+
throw new APIError("No response from Gemini API");
|
|
162772
|
+
}
|
|
162773
|
+
return text;
|
|
162774
|
+
} catch (error) {
|
|
162775
|
+
lastError = error instanceof Error ? error : new Error("Unknown error");
|
|
162776
|
+
logger2.warn(`Content analysis attempt ${attempt} failed:`, lastError.message);
|
|
162777
|
+
if (!this.isRetryableError(error) || attempt === maxRetries) {
|
|
162778
|
+
break;
|
|
162779
|
+
}
|
|
162780
|
+
const delay = this.createBackoffDelay(attempt);
|
|
162781
|
+
logger2.debug(`Retrying in ${delay}ms...`);
|
|
162782
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
162759
162783
|
}
|
|
162760
|
-
throw new APIError("Unknown Gemini API error");
|
|
162761
162784
|
}
|
|
162785
|
+
this.handleGeminiError(lastError, "Content analysis");
|
|
162762
162786
|
}
|
|
162763
162787
|
getDocumentModel() {
|
|
162764
162788
|
return this.genAI.getGenerativeModel({
|
|
@@ -163399,11 +163423,21 @@ Extract as much metadata as possible from the document properties and content.`;
|
|
|
163399
163423
|
throw new APIError(`${operation}: Gemini API server error - please retry`);
|
|
163400
163424
|
}
|
|
163401
163425
|
if (error?.status === 503) {
|
|
163402
|
-
throw new APIError(`${operation}: Gemini API
|
|
163426
|
+
throw new APIError(`${operation}: Gemini API is currently unavailable (503 Service Unavailable). ` + `This is usually temporary. Please try again in a few moments. ` + `If the issue persists, check Google's Gemini API status page.`);
|
|
163403
163427
|
}
|
|
163404
163428
|
if (error?.code === "ECONNRESET" || error?.code === "ETIMEDOUT") {
|
|
163405
163429
|
throw new APIError(`${operation}: Network error - check connection and retry`);
|
|
163406
163430
|
}
|
|
163431
|
+
if (error?.message?.includes("GoogleGenerativeAI Error")) {
|
|
163432
|
+
const geminiErrorMatch = error.message.match(/\[(\d+)\s+([^\]]+)\]\s+(.+)/);
|
|
163433
|
+
if (geminiErrorMatch) {
|
|
163434
|
+
const [, statusCode, statusText, details] = geminiErrorMatch;
|
|
163435
|
+
if (statusCode === "503") {
|
|
163436
|
+
throw new APIError(`${operation}: Google Gemini API is temporarily unavailable (${statusText}). ` + `This is a service-side issue. Please try again in a few moments.`);
|
|
163437
|
+
}
|
|
163438
|
+
throw new APIError(`${operation}: Gemini API error [${statusCode} ${statusText}] ${details}`);
|
|
163439
|
+
}
|
|
163440
|
+
}
|
|
163407
163441
|
const message = error?.message || "Unknown error occurred";
|
|
163408
163442
|
throw new APIError(`${operation}: ${message}`);
|
|
163409
163443
|
}
|
|
@@ -164273,6 +164307,9 @@ Be precise with locations and measurements where possible.`;
|
|
|
164273
164307
|
}
|
|
164274
164308
|
}
|
|
164275
164309
|
async function loadImageForComparison(source) {
|
|
164310
|
+
if (source.match(/^\[Image #\d+\]$/)) {
|
|
164311
|
+
throw new Error(`Virtual image reference "${source}" cannot be processed. ` + `Please use a direct file path, URL, or base64 data URI instead.`);
|
|
164312
|
+
}
|
|
164276
164313
|
if (source.startsWith("data:image/")) {
|
|
164277
164314
|
const [header, data] = source.split(",");
|
|
164278
164315
|
if (!header || !data) {
|