desktop-pilot-mcp 1.0.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/LICENSE +21 -0
- package/Package.swift +38 -0
- package/README.md +462 -0
- package/Sources/DesktopPilot/Core/AppRegistry.swift +102 -0
- package/Sources/DesktopPilot/Core/ElementStore.swift +59 -0
- package/Sources/DesktopPilot/Core/Router.swift +242 -0
- package/Sources/DesktopPilot/Core/Snapshot.swift +192 -0
- package/Sources/DesktopPilot/Layers/AccessibilityLayer.swift +190 -0
- package/Sources/DesktopPilot/Layers/AppleScriptLayer.swift +462 -0
- package/Sources/DesktopPilot/Layers/CGEventLayer.swift +318 -0
- package/Sources/DesktopPilot/Layers/LayerProtocol.swift +40 -0
- package/Sources/DesktopPilot/Layers/ScreenshotLayer.swift +122 -0
- package/Sources/DesktopPilot/MCP/Server.swift +536 -0
- package/Sources/DesktopPilot/MCP/Tools.swift +772 -0
- package/Sources/DesktopPilot/MCP/Types.swift +107 -0
- package/Sources/DesktopPilot/Platform/PlatformProtocol.swift +49 -0
- package/Sources/DesktopPilot/Platform/macOS/AXBridge.swift +232 -0
- package/Sources/DesktopPilot/Platform/macOS/Permissions.swift +34 -0
- package/Sources/DesktopPilot/Platform/macOS/SystemEvents.swift +323 -0
- package/Sources/DesktopPilot/main.swift +19 -0
- package/Sources/DesktopPilotCLI/main.swift +19 -0
- package/Tests/DesktopPilotTests/DesktopPilotTests.swift +290 -0
- package/bin/cli.js +61 -0
- package/package.json +52 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync, spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const ROOT = path.resolve(__dirname, "..");
|
|
8
|
+
|
|
9
|
+
const BINARY_PATHS = [
|
|
10
|
+
path.join(ROOT, ".build", "release", "desktop-pilot-mcp"),
|
|
11
|
+
path.join(ROOT, ".build", "debug", "desktop-pilot-mcp"),
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
function findBinary() {
|
|
15
|
+
for (const p of BINARY_PATHS) {
|
|
16
|
+
if (fs.existsSync(p)) return p;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function build() {
|
|
22
|
+
process.stderr.write("[desktop-pilot] Binary not found, building from source...\n");
|
|
23
|
+
try {
|
|
24
|
+
execFileSync("swift", ["build", "-c", "release"], {
|
|
25
|
+
cwd: ROOT,
|
|
26
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
27
|
+
});
|
|
28
|
+
process.stderr.write("[desktop-pilot] Build complete.\n");
|
|
29
|
+
} catch (err) {
|
|
30
|
+
process.stderr.write("[desktop-pilot] Build failed.\n");
|
|
31
|
+
process.stderr.write("[desktop-pilot] Make sure Xcode Command Line Tools are installed:\n");
|
|
32
|
+
process.stderr.write("[desktop-pilot] xcode-select --install\n");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
return findBinary();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (process.platform !== "darwin") {
|
|
39
|
+
process.stderr.write("[desktop-pilot] Error: Desktop Pilot only supports macOS.\n");
|
|
40
|
+
process.stderr.write("[desktop-pilot] Windows support is planned for a future release.\n");
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const binary = findBinary() || build();
|
|
45
|
+
|
|
46
|
+
if (!binary) {
|
|
47
|
+
process.stderr.write("[desktop-pilot] Error: Could not find or build the binary.\n");
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const child = spawn(binary, process.argv.slice(2), {
|
|
52
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
process.stdin.pipe(child.stdin);
|
|
56
|
+
child.stdout.pipe(process.stdout);
|
|
57
|
+
|
|
58
|
+
child.on("exit", (code) => process.exit(code || 0));
|
|
59
|
+
|
|
60
|
+
process.on("SIGINT", () => child.kill("SIGINT"));
|
|
61
|
+
process.on("SIGTERM", () => child.kill("SIGTERM"));
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "desktop-pilot-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Universal macOS app automation for Claude — 30-100x faster than screenshot-based computer-use. Uses Accessibility API, AppleScript, and CGEvent.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"mcp-server",
|
|
8
|
+
"claude",
|
|
9
|
+
"anthropic",
|
|
10
|
+
"macos",
|
|
11
|
+
"automation",
|
|
12
|
+
"accessibility",
|
|
13
|
+
"desktop-pilot",
|
|
14
|
+
"computer-use",
|
|
15
|
+
"ai",
|
|
16
|
+
"applescript",
|
|
17
|
+
"desktop-automation"
|
|
18
|
+
],
|
|
19
|
+
"author": "VersoXBT",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/VersoXBT/desktop-pilot-mcp.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/VersoXBT/desktop-pilot-mcp",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/VersoXBT/desktop-pilot-mcp/issues"
|
|
28
|
+
},
|
|
29
|
+
"os": [
|
|
30
|
+
"darwin"
|
|
31
|
+
],
|
|
32
|
+
"bin": {
|
|
33
|
+
"desktop-pilot-mcp": "bin/cli.js"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"bin/",
|
|
37
|
+
"Sources/",
|
|
38
|
+
"Tests/",
|
|
39
|
+
"Package.swift",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"postinstall": "swift build -c release 2>&1 || echo 'Build failed. Install Xcode Command Line Tools: xcode-select --install'",
|
|
45
|
+
"build": "swift build -c release",
|
|
46
|
+
"test": "swift test",
|
|
47
|
+
"start": "node bin/cli.js"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=16"
|
|
51
|
+
}
|
|
52
|
+
}
|