siliconflow-image-mcp 1.0.3 → 1.0.4

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.
@@ -1,17 +1,30 @@
1
- #!/bin/sh
2
- # SiliconFlow Image MCP - Unix/Linux/macOS wrapper script
3
- # Handles both local development and global installation
1
+ #!/usr/bin/env node
2
+ // SiliconFlow Image MCP - Universal launcher for all platforms
3
+ // Works on Windows (via npm wrapper), Linux, macOS
4
4
 
5
- # Get the real directory of this script (resolves symlinks)
6
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ import { spawn } from 'child_process';
6
+ import { fileURLToPath } from 'url';
7
+ import { dirname, join } from 'path';
8
+ import { existsSync } from 'fs';
7
9
 
8
- # In production (npm install), dist/index.js is in node_modules/siliconflow-image-mcp/dist/
9
- # The bin script is in node_modules/siliconflow-image-mcp/bin/
10
- if [ -f "$SCRIPT_DIR/../dist/index.js" ]; then
11
- # Production mode - run compiled JavaScript
12
- exec node "$SCRIPT_DIR/../dist/index.js" "$@"
13
- else
14
- echo "Error: Could not find siliconflow-image-mcp dist/index.js"
15
- echo "Searched in: $SCRIPT_DIR/../dist/index.js"
16
- exit 1
17
- fi
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+
13
+ // Find dist/index.js relative to this file
14
+ const distPath = join(__dirname, '..', 'dist', 'index.js');
15
+
16
+ if (!existsSync(distPath)) {
17
+ console.error('Error: Could not find siliconflow-image-mcp dist/index.js');
18
+ console.error('Searched in:', distPath);
19
+ process.exit(1);
20
+ }
21
+
22
+ // Run the main program
23
+ const child = spawn(process.execPath, [distPath, ...process.argv.slice(2)], {
24
+ stdio: 'inherit',
25
+ windowsHide: true
26
+ });
27
+
28
+ child.on('exit', (code) => {
29
+ process.exit(code);
30
+ });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siliconflow-image-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server for image generation and editing using SiliconFlow - Optimized for China users",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "siliconflow-image-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server for image generation and editing using SiliconFlow - Optimized for China users",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "siliconflow-image-mcp": "bin/siliconflow-image-mcp",
9
- "siliconflow-image-mcp.cmd": "bin/siliconflow-image-mcp.cmd"
8
+ "siliconflow-image-mcp": "bin/siliconflow-image-mcp"
10
9
  },
11
10
  "files": [
12
11
  "dist",
@@ -1,22 +0,0 @@
1
- @echo off
2
- REM SiliconFlow Image MCP - Windows wrapper script
3
- REM Handles both local development and global installation on Windows
4
-
5
- setlocal
6
-
7
- REM Get the directory where this script is located
8
- set "SCRIPT_DIR=%~dp0"
9
-
10
- REM In production (npm install), dist/index.js is in node_modules/siliconflow-image-mcp/dist/
11
- REM The bin script is in node_modules/siliconflow-image-mcp/bin/
12
- if exist "%SCRIPT_DIR%..\dist\index.js" (
13
- REM Production mode - run compiled JavaScript
14
- node "%SCRIPT_DIR%..\dist\index.js" %*
15
- ) else if exist "%SCRIPT_DIR%..\..\dist\index.js" (
16
- REM Alternative production path
17
- node "%SCRIPT_DIR%..\..\dist\index.js" %*
18
- ) else (
19
- echo Error: Could not find siliconflow-image-mcp dist/index.js
20
- echo Searched in: %SCRIPT_DIR%..\dist\index.js
21
- exit /b 1
22
- )