@leverageaiapps/locus-dev 1.1.3
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/Dockerfile +29 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/capture.d.ts +3 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +134 -0
- package/dist/capture.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +84 -0
- package/dist/config.js.map +1 -0
- package/dist/context-extractor.d.ts +17 -0
- package/dist/context-extractor.d.ts.map +1 -0
- package/dist/context-extractor.js +118 -0
- package/dist/context-extractor.js.map +1 -0
- package/dist/debug-logger.d.ts +19 -0
- package/dist/debug-logger.d.ts.map +1 -0
- package/dist/debug-logger.js +48 -0
- package/dist/debug-logger.js.map +1 -0
- package/dist/exec.d.ts +20 -0
- package/dist/exec.d.ts.map +1 -0
- package/dist/exec.js +158 -0
- package/dist/exec.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/pty.d.ts +7 -0
- package/dist/pty.d.ts.map +1 -0
- package/dist/pty.js +27 -0
- package/dist/pty.js.map +1 -0
- package/dist/relay.d.ts +5 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +131 -0
- package/dist/relay.js.map +1 -0
- package/dist/session.d.ts +6 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +250 -0
- package/dist/session.js.map +1 -0
- package/dist/voice-recognition-modelscope.d.ts +50 -0
- package/dist/voice-recognition-modelscope.d.ts.map +1 -0
- package/dist/voice-recognition-modelscope.js +171 -0
- package/dist/voice-recognition-modelscope.js.map +1 -0
- package/dist/vortex-tunnel.d.ts +9 -0
- package/dist/vortex-tunnel.d.ts.map +1 -0
- package/dist/vortex-tunnel.js +589 -0
- package/dist/vortex-tunnel.js.map +1 -0
- package/dist/web-server.d.ts +6 -0
- package/dist/web-server.d.ts.map +1 -0
- package/dist/web-server.js +2096 -0
- package/dist/web-server.js.map +1 -0
- package/docs/CNAME +1 -0
- package/docs/index.html +492 -0
- package/docs/install.sh +329 -0
- package/install.sh +329 -0
- package/package.json +69 -0
- package/scripts/postinstall.js +66 -0
- package/scripts/verify-install.js +128 -0
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leverageaiapps/locus-dev",
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Locus - Forward your terminal to your mobile device. Code anywhere from your pocket.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"locus": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "ts-node src/index.ts",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"postinstall": "node scripts/postinstall.js",
|
|
14
|
+
"verify": "node scripts/verify-install.js",
|
|
15
|
+
"prepublishOnly": "npm run build",
|
|
16
|
+
"global-install": "npm install && npm run build && npm link"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"terminal",
|
|
20
|
+
"mobile",
|
|
21
|
+
"vortex",
|
|
22
|
+
"tunnel",
|
|
23
|
+
"remote",
|
|
24
|
+
"ssh",
|
|
25
|
+
"cli",
|
|
26
|
+
"claude-code",
|
|
27
|
+
"ai",
|
|
28
|
+
"coding",
|
|
29
|
+
"locus",
|
|
30
|
+
"no-ansi",
|
|
31
|
+
"clean-output"
|
|
32
|
+
],
|
|
33
|
+
"author": "LeverageAI Apps",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"axios": "^1.7.9",
|
|
37
|
+
"commander": "^12.1.0",
|
|
38
|
+
"cookie-parser": "^1.4.7",
|
|
39
|
+
"cors": "^2.8.5",
|
|
40
|
+
"dotenv": "^16.4.7",
|
|
41
|
+
"eventsource": "^2.0.2",
|
|
42
|
+
"express": "^5.2.1",
|
|
43
|
+
"node-pty": "^1.1.0",
|
|
44
|
+
"qrcode-terminal": "^0.12.0",
|
|
45
|
+
"ws": "^8.19.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/cookie-parser": "^1.4.10",
|
|
49
|
+
"@types/cors": "^2.8.19",
|
|
50
|
+
"@types/eventsource": "^1.1.15",
|
|
51
|
+
"@types/express": "^5.0.6",
|
|
52
|
+
"@types/node": "^20.17.12",
|
|
53
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
54
|
+
"@types/ws": "^8.18.1",
|
|
55
|
+
"ts-node": "^10.9.2",
|
|
56
|
+
"typescript": "^5.7.2"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=18.0.0"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/leverageaiapp/Locus.git"
|
|
64
|
+
},
|
|
65
|
+
"bugs": {
|
|
66
|
+
"url": "https://github.com/leverageaiapp/Locus/issues"
|
|
67
|
+
},
|
|
68
|
+
"homepage": "https://github.com/leverageaiapp/Locus#readme"
|
|
69
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script to fix node-pty permissions on macOS/Linux
|
|
5
|
+
* This ensures the spawn-helper binary has execute permissions
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
|
|
12
|
+
const platform = os.platform();
|
|
13
|
+
|
|
14
|
+
// Only run on macOS and Linux
|
|
15
|
+
if (platform !== 'darwin' && platform !== 'linux') {
|
|
16
|
+
console.log('Skipping node-pty permission fix (not macOS/Linux)');
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Determine the architecture
|
|
21
|
+
const arch = os.arch();
|
|
22
|
+
let prebuildDir;
|
|
23
|
+
|
|
24
|
+
if (platform === 'darwin') {
|
|
25
|
+
prebuildDir = arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
26
|
+
} else if (platform === 'linux') {
|
|
27
|
+
prebuildDir = arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const spawnHelperPath = path.join(
|
|
31
|
+
__dirname,
|
|
32
|
+
'..',
|
|
33
|
+
'node_modules',
|
|
34
|
+
'node-pty',
|
|
35
|
+
'prebuilds',
|
|
36
|
+
prebuildDir,
|
|
37
|
+
'spawn-helper'
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Check if spawn-helper exists
|
|
41
|
+
if (!fs.existsSync(spawnHelperPath)) {
|
|
42
|
+
console.log(`spawn-helper not found at: ${spawnHelperPath}`);
|
|
43
|
+
console.log('This is normal if node-pty uses a different installation method');
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
// Get current permissions
|
|
49
|
+
const stats = fs.statSync(spawnHelperPath);
|
|
50
|
+
const currentMode = stats.mode;
|
|
51
|
+
|
|
52
|
+
// Add execute permission (chmod +x)
|
|
53
|
+
const newMode = currentMode | fs.constants.S_IXUSR | fs.constants.S_IXGRP | fs.constants.S_IXOTH;
|
|
54
|
+
|
|
55
|
+
if (currentMode !== newMode) {
|
|
56
|
+
fs.chmodSync(spawnHelperPath, newMode);
|
|
57
|
+
console.log('✓ Fixed node-pty spawn-helper permissions');
|
|
58
|
+
} else {
|
|
59
|
+
console.log('✓ node-pty spawn-helper permissions already correct');
|
|
60
|
+
}
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error('Warning: Failed to fix node-pty permissions:', error.message);
|
|
63
|
+
console.error('You may need to run manually: chmod +x node_modules/node-pty/prebuilds/*/spawn-helper');
|
|
64
|
+
// Don't fail the installation
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Installation verification script
|
|
5
|
+
* Checks if all dependencies and permissions are correctly set up
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const { execSync } = require('child_process');
|
|
12
|
+
|
|
13
|
+
console.log('🔍 Verifying Locus installation...\n');
|
|
14
|
+
|
|
15
|
+
let hasErrors = false;
|
|
16
|
+
let hasWarnings = false;
|
|
17
|
+
|
|
18
|
+
// Check 1: Node.js version
|
|
19
|
+
console.log('1. Checking Node.js version...');
|
|
20
|
+
const nodeVersion = process.version;
|
|
21
|
+
const majorVersion = parseInt(nodeVersion.slice(1).split('.')[0]);
|
|
22
|
+
if (majorVersion >= 18) {
|
|
23
|
+
console.log(` ✓ Node.js ${nodeVersion} (>= 18.0.0)\n`);
|
|
24
|
+
} else {
|
|
25
|
+
console.log(` ✗ Node.js ${nodeVersion} is too old. Required: >= 18.0.0\n`);
|
|
26
|
+
hasErrors = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Check 2: node-pty installation
|
|
30
|
+
console.log('2. Checking node-pty...');
|
|
31
|
+
const nodePtyPath = path.join(__dirname, '..', 'node_modules', 'node-pty');
|
|
32
|
+
if (fs.existsSync(nodePtyPath)) {
|
|
33
|
+
console.log(' ✓ node-pty installed\n');
|
|
34
|
+
} else {
|
|
35
|
+
console.log(' ✗ node-pty not found. Run: npm install\n');
|
|
36
|
+
hasErrors = true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check 3: spawn-helper permissions (macOS/Linux only)
|
|
40
|
+
if (os.platform() === 'darwin' || os.platform() === 'linux') {
|
|
41
|
+
console.log('3. Checking spawn-helper permissions...');
|
|
42
|
+
|
|
43
|
+
const arch = os.arch();
|
|
44
|
+
const platform = os.platform();
|
|
45
|
+
let prebuildDir;
|
|
46
|
+
|
|
47
|
+
if (platform === 'darwin') {
|
|
48
|
+
prebuildDir = arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
49
|
+
} else {
|
|
50
|
+
prebuildDir = arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const spawnHelperPath = path.join(nodePtyPath, 'prebuilds', prebuildDir, 'spawn-helper');
|
|
54
|
+
|
|
55
|
+
if (fs.existsSync(spawnHelperPath)) {
|
|
56
|
+
try {
|
|
57
|
+
const stats = fs.statSync(spawnHelperPath);
|
|
58
|
+
const hasExecute = (stats.mode & fs.constants.S_IXUSR) !== 0;
|
|
59
|
+
|
|
60
|
+
if (hasExecute) {
|
|
61
|
+
console.log(' ✓ spawn-helper has execute permissions\n');
|
|
62
|
+
} else {
|
|
63
|
+
console.log(' ✗ spawn-helper missing execute permissions');
|
|
64
|
+
console.log(` Fix: chmod +x ${spawnHelperPath}\n`);
|
|
65
|
+
hasErrors = true;
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.log(` ⚠ Could not check permissions: ${error.message}\n`);
|
|
69
|
+
hasWarnings = true;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
console.log(` ⚠ spawn-helper not found at expected location`);
|
|
73
|
+
console.log(` This may be normal if using a different node-pty version\n`);
|
|
74
|
+
hasWarnings = true;
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
console.log('3. Skipping spawn-helper check (Windows)\n');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check 4: Built files
|
|
81
|
+
console.log('4. Checking built files...');
|
|
82
|
+
const distPath = path.join(__dirname, '..', 'dist', 'index.js');
|
|
83
|
+
if (fs.existsSync(distPath)) {
|
|
84
|
+
console.log(' ✓ Project built successfully\n');
|
|
85
|
+
} else {
|
|
86
|
+
console.log(' ⚠ Project not built yet. Run: npm run build\n');
|
|
87
|
+
hasWarnings = true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Check 5: Shell availability
|
|
91
|
+
console.log('5. Checking shell...');
|
|
92
|
+
const shell = process.env.SHELL || (os.platform() === 'win32' ? 'cmd.exe' : '/bin/sh');
|
|
93
|
+
if (fs.existsSync(shell)) {
|
|
94
|
+
console.log(` ✓ Shell available: ${shell}\n`);
|
|
95
|
+
} else {
|
|
96
|
+
console.log(` ⚠ Default shell not found: ${shell}\n`);
|
|
97
|
+
hasWarnings = true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Check 6: Vortex gateway connectivity
|
|
101
|
+
console.log('6. Checking Vortex gateway...');
|
|
102
|
+
try {
|
|
103
|
+
execSync('curl -s -o /dev/null -w "%{http_code}" https://vortex.futuretech.social/health', {
|
|
104
|
+
encoding: 'utf8',
|
|
105
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
106
|
+
timeout: 5000
|
|
107
|
+
});
|
|
108
|
+
console.log(' ✓ Vortex gateway is accessible\n');
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.log(' ⚠ Could not reach Vortex gateway');
|
|
111
|
+
console.log(' This may be a network issue or the gateway may be temporarily unavailable\n');
|
|
112
|
+
hasWarnings = true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Summary
|
|
116
|
+
console.log('═'.repeat(50));
|
|
117
|
+
if (hasErrors) {
|
|
118
|
+
console.log('❌ Installation has errors. Please fix the issues above.');
|
|
119
|
+
process.exit(1);
|
|
120
|
+
} else if (hasWarnings) {
|
|
121
|
+
console.log('⚠️ Installation complete with warnings.');
|
|
122
|
+
console.log(' You may want to address the warnings above.');
|
|
123
|
+
process.exit(0);
|
|
124
|
+
} else {
|
|
125
|
+
console.log('✅ Installation verified successfully!');
|
|
126
|
+
console.log('\nYou can now run: locus');
|
|
127
|
+
process.exit(0);
|
|
128
|
+
}
|