4runr-os-mk3 0.1.0 → 0.1.1
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/bin/mk3-tui.js +21 -7
- package/install.js +14 -14
- package/package.json +3 -3
package/bin/mk3-tui.js
CHANGED
|
@@ -10,18 +10,32 @@ const __dirname = dirname(__filename);
|
|
|
10
10
|
|
|
11
11
|
// Try to find the binary in different locations
|
|
12
12
|
const possiblePaths = [
|
|
13
|
-
//
|
|
13
|
+
// From npm package (installed)
|
|
14
14
|
join(__dirname, '..', 'target', 'release', 'mk3-tui'),
|
|
15
15
|
join(__dirname, '..', 'target', 'release', 'mk3-tui.exe'),
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
// From global npm install (in PATH)
|
|
17
|
+
process.platform === 'win32' ? 'mk3-tui.exe' : 'mk3-tui',
|
|
18
|
+
// Development build (local)
|
|
19
|
+
join(__dirname, '..', '..', '..', 'apps', 'mk3-tui', 'target', 'release', 'mk3-tui'),
|
|
20
|
+
join(__dirname, '..', '..', '..', 'apps', 'mk3-tui', 'target', 'release', 'mk3-tui.exe'),
|
|
19
21
|
];
|
|
20
22
|
|
|
21
23
|
let binaryPath = null;
|
|
22
|
-
for (const
|
|
23
|
-
if (
|
|
24
|
-
|
|
24
|
+
for (const testPath of possiblePaths) {
|
|
25
|
+
// Check if it's a PATH command (string without slashes)
|
|
26
|
+
if (!testPath.includes('/') && !testPath.includes('\\')) {
|
|
27
|
+
// Try to find in PATH
|
|
28
|
+
try {
|
|
29
|
+
const { execSync } = await import('child_process');
|
|
30
|
+
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
|
|
31
|
+
execSync(`${whichCmd} ${testPath}`, { stdio: 'ignore' });
|
|
32
|
+
binaryPath = testPath;
|
|
33
|
+
break;
|
|
34
|
+
} catch {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
} else if (existsSync(testPath)) {
|
|
38
|
+
binaryPath = testPath;
|
|
25
39
|
break;
|
|
26
40
|
}
|
|
27
41
|
}
|
package/install.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script for 4runr-os-mk3
|
|
5
|
+
* This script just verifies the binary exists - it doesn't build it.
|
|
6
|
+
* The binary should be pre-built and included in the npm package.
|
|
7
|
+
*/
|
|
8
|
+
|
|
4
9
|
import { existsSync } from 'fs';
|
|
5
10
|
import { join, dirname } from 'path';
|
|
6
11
|
import { fileURLToPath } from 'url';
|
|
@@ -10,20 +15,15 @@ const __dirname = dirname(__filename);
|
|
|
10
15
|
|
|
11
16
|
const binaryPath = join(__dirname, 'target', 'release', process.platform === 'win32' ? 'mk3-tui.exe' : 'mk3-tui');
|
|
12
17
|
|
|
13
|
-
//
|
|
18
|
+
// Just check if binary exists - don't try to build it
|
|
19
|
+
// The binary should be pre-built and included in the npm package
|
|
14
20
|
if (!existsSync(binaryPath)) {
|
|
15
|
-
console.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
console.log('Build complete!');
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.error('Failed to build mk3-tui. Make sure Rust is installed: https://rustup.rs/');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
21
|
+
console.warn('⚠️ Warning: mk3-tui binary not found in package.');
|
|
22
|
+
console.warn(' The binary should be included in the npm package.');
|
|
23
|
+
console.warn(' If you need to build it manually, install Rust: https://rustup.rs/');
|
|
24
|
+
console.warn(' Then run: cd node_modules/4runr-os-mk3 && cargo build --release');
|
|
25
|
+
// Don't exit with error - let the package install, binary might be in PATH
|
|
26
26
|
} else {
|
|
27
|
-
console.log('mk3-tui binary found.');
|
|
27
|
+
console.log('✓ mk3-tui binary found.');
|
|
28
28
|
}
|
|
29
29
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "4runr-os-mk3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "4Runr AI Agent OS - Modern Terminal UI (Rust + Ratatui)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"mk3-tui": "
|
|
8
|
+
"mk3-tui": "bin/mk3-tui.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "cargo build --release",
|
|
12
|
-
"
|
|
12
|
+
"postinstall": "node install.js",
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|