4runr-os-mk3 0.1.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/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # MK3 TUI - Ratatui Terminal UI
2
+
3
+ MK3 replaces the old neo-blessed TUI with a modern Rust + Ratatui implementation.
4
+
5
+ ## Status
6
+
7
+ **MK1 is frozen. MK3 replaces TUI.**
8
+
9
+ ## Building
10
+
11
+ ```bash
12
+ cd apps/mk3-tui
13
+ cargo build --release
14
+ ```
15
+
16
+ ## Running
17
+
18
+ ```bash
19
+ # With WebSocket (if WS_URL env var is set)
20
+ WS_URL=ws://localhost:8081/tui ./target/release/mk3-tui
21
+
22
+ # With stdin/stdout JSON protocol (default)
23
+ ./target/release/mk3-tui
24
+ ```
25
+
26
+ ## Protocol
27
+
28
+ ### Input (stdin or WebSocket)
29
+
30
+ MK3 reads JSON messages:
31
+
32
+ ```json
33
+ {"type":"log","message":"System started","ts":"2025-01-13T12:00:00Z"}
34
+ {"type":"posture","status":"Healthy"}
35
+ {"type":"metrics","cpu":0.23,"mem":0.61}
36
+ {"type":"network","status":"Connected"}
37
+ {"type":"capabilities","items":["tool1","tool2"]}
38
+ ```
39
+
40
+ ### Output (stdout or WebSocket)
41
+
42
+ MK3 sends commands:
43
+
44
+ ```json
45
+ {"type":"command","text":"help"}
46
+ ```
47
+
48
+ ## Layout
49
+
50
+ - Left column: POSTURE, RESOURCES, ASSETS (stacked)
51
+ - Center: OPERATIONS (log viewer)
52
+ - Right column: NETWORK, CAPABILITIES (stacked)
53
+ - Bottom: COMMAND BAR
54
+
55
+ Safe bounds: Never draws on last row/column (w-1, h-1).
56
+
package/bin/mk3-tui.js ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
6
+ import { existsSync } from 'fs';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+
11
+ // Try to find the binary in different locations
12
+ const possiblePaths = [
13
+ // Development build
14
+ join(__dirname, '..', 'target', 'release', 'mk3-tui'),
15
+ join(__dirname, '..', 'target', 'release', 'mk3-tui.exe'),
16
+ // Installed binary
17
+ join(__dirname, 'mk3-tui'),
18
+ join(__dirname, 'mk3-tui.exe'),
19
+ ];
20
+
21
+ let binaryPath = null;
22
+ for (const path of possiblePaths) {
23
+ if (existsSync(path)) {
24
+ binaryPath = path;
25
+ break;
26
+ }
27
+ }
28
+
29
+ if (!binaryPath) {
30
+ console.error('Error: mk3-tui binary not found.');
31
+ console.error('Please run: cd apps/mk3-tui && cargo build --release');
32
+ process.exit(1);
33
+ }
34
+
35
+ // Spawn the Rust binary with all arguments
36
+ const child = spawn(binaryPath, process.argv.slice(2), {
37
+ stdio: 'inherit',
38
+ cwd: process.cwd(),
39
+ });
40
+
41
+ child.on('error', (err) => {
42
+ console.error('Failed to start mk3-tui:', err);
43
+ process.exit(1);
44
+ });
45
+
46
+ child.on('exit', (code) => {
47
+ process.exit(code || 0);
48
+ });
49
+
package/install.js ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync } from 'child_process';
4
+ import { existsSync } from 'fs';
5
+ import { join, dirname } from 'path';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+
11
+ const binaryPath = join(__dirname, 'target', 'release', process.platform === 'win32' ? 'mk3-tui.exe' : 'mk3-tui');
12
+
13
+ // Check if binary exists, if not, try to build it
14
+ if (!existsSync(binaryPath)) {
15
+ console.log('mk3-tui binary not found. Building...');
16
+ try {
17
+ execSync('cargo build --release', {
18
+ cwd: __dirname,
19
+ stdio: 'inherit',
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
+ }
26
+ } else {
27
+ console.log('mk3-tui binary found.');
28
+ }
29
+
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "4runr-os-mk3",
3
+ "version": "0.1.0",
4
+ "description": "4Runr AI Agent OS - Modern Terminal UI (Rust + Ratatui)",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "mk3-tui": "./bin/mk3-tui.js"
9
+ },
10
+ "scripts": {
11
+ "build": "cargo build --release",
12
+ "install": "node install.js",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "files": [
16
+ "bin/**/*",
17
+ "target/release/mk3-tui*",
18
+ "install.js",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "keywords": [
23
+ "4runr",
24
+ "tui",
25
+ "terminal",
26
+ "ratatui",
27
+ "rust"
28
+ ],
29
+ "author": "4Runr Team",
30
+ "license": "MIT",
31
+ "engines": {
32
+ "node": ">=18.0.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "os": [
38
+ "win32",
39
+ "darwin",
40
+ "linux"
41
+ ],
42
+ "cpu": [
43
+ "x64",
44
+ "arm64"
45
+ ]
46
+ }
47
+
Binary file
@@ -0,0 +1 @@
1
+ /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/target/release/mk3-tui: /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/app/render_scheduler.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/app.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/io/mod.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/io/protocol.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/io/stdio.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/io/ws.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/main.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/ui/boot.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/ui/layout.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/ui/mod.rs /home/ubuntu/4Runr-AI-Agent-OS/apps/mk3-tui/src/ui/safe_viewport.rs