@c5t8fbt-wy/winforms-mcp 1.0.5
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/index.js +61 -0
- package/install.js +27 -0
- package/package.json +42 -0
package/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Rhombus.WinFormsMcp NPM Wrapper
|
|
5
|
+
*
|
|
6
|
+
* This module provides a Node.js wrapper for the .NET-based WinForms automation MCP server.
|
|
7
|
+
* It handles downloading platform-specific binaries and exposing the executable for npx usage.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const os = require('os');
|
|
13
|
+
|
|
14
|
+
// Verify we're on Windows
|
|
15
|
+
if (os.platform() !== 'win32') {
|
|
16
|
+
console.error('Error: @rhom6us/winforms-mcp requires Windows (x64)');
|
|
17
|
+
console.error(`Detected platform: ${os.platform()} ${os.arch()}`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Verify we're on x64
|
|
22
|
+
if (os.arch() !== 'x64') {
|
|
23
|
+
console.error('Error: @rhom6us/winforms-mcp requires Windows x64');
|
|
24
|
+
console.error(`Detected architecture: ${os.arch()}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const distDir = path.join(__dirname, 'dist');
|
|
29
|
+
const exePath = path.join(distDir, 'Rhombus.WinFormsMcp.Server.exe');
|
|
30
|
+
|
|
31
|
+
// Check if executable exists
|
|
32
|
+
if (!fs.existsSync(exePath)) {
|
|
33
|
+
console.error('Error: Rhombus.WinFormsMcp.Server executable not found');
|
|
34
|
+
console.error(`Expected at: ${exePath}`);
|
|
35
|
+
console.error('\nTry reinstalling: npm install @rhom6us/winforms-mcp');
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Export the executable path for use in other modules
|
|
40
|
+
module.exports = {
|
|
41
|
+
executablePath: exePath,
|
|
42
|
+
distDirectory: distDir,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// If called directly from command line, spawn the executable
|
|
46
|
+
if (require.main === module) {
|
|
47
|
+
const { spawn } = require('child_process');
|
|
48
|
+
const child = spawn(exePath, process.argv.slice(2), {
|
|
49
|
+
stdio: 'inherit',
|
|
50
|
+
windowsHide: false,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
child.on('error', (err) => {
|
|
54
|
+
console.error('Failed to start Rhombus.WinFormsMcp.Server:', err);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
child.on('exit', (code) => {
|
|
59
|
+
process.exit(code);
|
|
60
|
+
});
|
|
61
|
+
}
|
package/install.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-install script for @rhom6us/winforms-mcp
|
|
3
|
+
*
|
|
4
|
+
* This script ensures the .NET executable binaries are available.
|
|
5
|
+
* In a published package, binaries are included in the dist/ directory.
|
|
6
|
+
* During local development, this script can optionally download them.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
const distDir = path.join(__dirname, 'dist');
|
|
13
|
+
const exePath = path.join(distDir, 'Rhombus.WinFormsMcp.Server.exe');
|
|
14
|
+
|
|
15
|
+
// Check if dist directory exists and has binaries
|
|
16
|
+
if (fs.existsSync(distDir)) {
|
|
17
|
+
const files = fs.readdirSync(distDir);
|
|
18
|
+
if (files.length > 0) {
|
|
19
|
+
console.log('✓ Binaries found in dist/ directory');
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// If no binaries found, this is expected during development
|
|
25
|
+
// In CI/CD, binaries will be copied to dist/ during the publish workflow
|
|
26
|
+
console.log('Note: Binaries will be included during package publishing');
|
|
27
|
+
process.exit(0);
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c5t8fbt-wy/winforms-mcp",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "WinForms automation MCP server with headless UI automation capabilities",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"winforms-mcp": "./bin/winforms-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node install.js"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"winforms",
|
|
14
|
+
"automation",
|
|
15
|
+
"flaui",
|
|
16
|
+
"ui-testing",
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"headless",
|
|
20
|
+
"windows",
|
|
21
|
+
"testing"
|
|
22
|
+
],
|
|
23
|
+
"author": "c5t8fbt-wy",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/C5T8fBt-WY/winforms-mcp_fork.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/C5T8fBt-WY/winforms-mcp_fork/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/C5T8fBt-WY/winforms-mcp_fork",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=14.0.0"
|
|
35
|
+
},
|
|
36
|
+
"os": [
|
|
37
|
+
"win32"
|
|
38
|
+
],
|
|
39
|
+
"cpu": [
|
|
40
|
+
"x64"
|
|
41
|
+
]
|
|
42
|
+
}
|