cmux 0.1.1 → 0.2.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 +54 -0
- package/cmux-cli +0 -0
- package/package.json +14 -19
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -37
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -70
- package/dist/index.js.map +0 -1
- package/public/index.html +0 -19
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# cmux
|
|
2
|
+
|
|
3
|
+
A single-executable web app multiplexer with built-in Convex backend. cmux allows you to run multiple coding agent CLIs in parallel across different tasks, each with their own isolated environment.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 Single executable file - no installation required
|
|
8
|
+
- 🔧 Built-in Convex backend for data persistence
|
|
9
|
+
- 🌐 Web-based UI for managing tasks
|
|
10
|
+
- 🐳 Docker integration for isolated environments
|
|
11
|
+
- ⚡ Fast startup and minimal dependencies
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g cmux
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or download the binary directly from the releases page.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Simply run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cmux
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This will:
|
|
30
|
+
1. Start a local Convex backend on port 9777
|
|
31
|
+
2. Start the web server on port 9776
|
|
32
|
+
3. Open your browser to http://localhost:9776
|
|
33
|
+
|
|
34
|
+
### Options
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cmux --port 8080 # Use a different port
|
|
38
|
+
cmux --help # Show all options
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## First Run
|
|
42
|
+
|
|
43
|
+
On first run, cmux will extract its bundled files to `~/.cmux/`. This includes:
|
|
44
|
+
- The Convex backend binary and database
|
|
45
|
+
- Web application static files
|
|
46
|
+
- Configuration files
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
cmux is part of the coderouter project. See the main repository for development instructions.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
package/cmux-cli
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmux",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Single-executable web app multiplexer with built-in Convex backend",
|
|
7
5
|
"bin": {
|
|
8
|
-
"cmux": "./
|
|
6
|
+
"cmux": "./cmux-cli"
|
|
9
7
|
},
|
|
10
8
|
"files": [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
9
|
+
"cmux-cli",
|
|
10
|
+
"README.md"
|
|
13
11
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"start": "node dist/index.js"
|
|
16
|
-
},
|
|
17
12
|
"keywords": [
|
|
18
|
-
"
|
|
13
|
+
"cli",
|
|
14
|
+
"web",
|
|
19
15
|
"server",
|
|
20
|
-
"
|
|
16
|
+
"convex",
|
|
17
|
+
"multiplexer"
|
|
21
18
|
],
|
|
22
|
-
"author": "",
|
|
19
|
+
"author": "Lawrence Chen",
|
|
23
20
|
"license": "MIT",
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"socket.io": "^4.7.2",
|
|
26
|
-
"express": "^4.18.2",
|
|
27
|
-
"cors": "^2.8.5",
|
|
28
|
-
"commander": "^11.1.0"
|
|
29
|
-
},
|
|
30
21
|
"engines": {
|
|
31
22
|
"node": ">=16.0.0"
|
|
32
23
|
},
|
|
33
24
|
"publishConfig": {
|
|
34
25
|
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/lawrencechen/coderouter.git"
|
|
35
30
|
}
|
|
36
31
|
}
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const commander_1 = require("commander");
|
|
8
|
-
const index_js_1 = require("./index.js");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const program = new commander_1.Command();
|
|
11
|
-
program
|
|
12
|
-
.name('cmux')
|
|
13
|
-
.description('Socket.IO and static file server')
|
|
14
|
-
.version('0.1.1')
|
|
15
|
-
.option('-p, --port <port>', 'port to listen on', '2689')
|
|
16
|
-
.option('-d, --dir <directory>', 'static files directory', './public')
|
|
17
|
-
.option('-c, --cors <origin>', 'CORS origin configuration', 'true')
|
|
18
|
-
.action((options) => {
|
|
19
|
-
const port = parseInt(options.port);
|
|
20
|
-
const staticDir = path_1.default.resolve(options.dir);
|
|
21
|
-
const corsOrigin = options.cors === 'true' ? true : options.cors === 'false' ? false : options.cors;
|
|
22
|
-
(0, index_js_1.startServer)({
|
|
23
|
-
port,
|
|
24
|
-
staticDir,
|
|
25
|
-
corsOrigin
|
|
26
|
-
});
|
|
27
|
-
process.on('SIGINT', () => {
|
|
28
|
-
console.log('\nShutting down server...');
|
|
29
|
-
process.exit(0);
|
|
30
|
-
});
|
|
31
|
-
process.on('SIGTERM', () => {
|
|
32
|
-
console.log('\nShutting down server...');
|
|
33
|
-
process.exit(0);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
program.parse();
|
|
37
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,yCAAyC;AACzC,gDAAwB;AAExB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,kCAAkC,CAAC;KAC/C,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,CAAC;KACxD,MAAM,CAAC,uBAAuB,EAAE,wBAAwB,EAAE,UAAU,CAAC;KACrE,MAAM,CAAC,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,CAAC;KAClE,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAEpG,IAAA,sBAAW,EAAC;QACV,IAAI;QACJ,SAAS;QACT,UAAU;KACX,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Server } from 'socket.io';
|
|
2
|
-
export interface CmuxOptions {
|
|
3
|
-
port?: number;
|
|
4
|
-
staticDir?: string;
|
|
5
|
-
corsOrigin?: string | string[] | boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function createCmuxServer(options?: CmuxOptions): {
|
|
8
|
-
app: import("express-serve-static-core").Express;
|
|
9
|
-
io: Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>;
|
|
10
|
-
httpServer: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
11
|
-
start: () => Promise<void>;
|
|
12
|
-
stop: () => Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
export declare function startServer(options?: CmuxOptions): {
|
|
15
|
-
app: import("express-serve-static-core").Express;
|
|
16
|
-
io: Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>;
|
|
17
|
-
httpServer: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
18
|
-
start: () => Promise<void>;
|
|
19
|
-
stop: () => Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC;CAC1C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,WAAgB;;;;;;EAiEzD;AAED,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,WAAW;;;;;;EAIhD"}
|
package/dist/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createCmuxServer = createCmuxServer;
|
|
7
|
-
exports.startServer = startServer;
|
|
8
|
-
const express_1 = __importDefault(require("express"));
|
|
9
|
-
const http_1 = require("http");
|
|
10
|
-
const socket_io_1 = require("socket.io");
|
|
11
|
-
const cors_1 = __importDefault(require("cors"));
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
function createCmuxServer(options = {}) {
|
|
14
|
-
const { port = 2689, staticDir = path_1.default.join(process.cwd(), 'public'), corsOrigin = true } = options;
|
|
15
|
-
const app = (0, express_1.default)();
|
|
16
|
-
const httpServer = (0, http_1.createServer)(app);
|
|
17
|
-
const io = new socket_io_1.Server(httpServer, {
|
|
18
|
-
cors: {
|
|
19
|
-
origin: corsOrigin,
|
|
20
|
-
methods: ['GET', 'POST']
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
app.use((0, cors_1.default)({
|
|
24
|
-
origin: corsOrigin
|
|
25
|
-
}));
|
|
26
|
-
app.use(express_1.default.static(staticDir));
|
|
27
|
-
app.get('*', (req, res) => {
|
|
28
|
-
res.sendFile(path_1.default.join(staticDir, 'index.html'));
|
|
29
|
-
});
|
|
30
|
-
io.on('connection', (socket) => {
|
|
31
|
-
console.log('Client connected:', socket.id);
|
|
32
|
-
socket.on('disconnect', () => {
|
|
33
|
-
console.log('Client disconnected:', socket.id);
|
|
34
|
-
});
|
|
35
|
-
socket.on('message', (data) => {
|
|
36
|
-
console.log('Message received:', data);
|
|
37
|
-
socket.emit('message', { echo: data });
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
const start = () => {
|
|
41
|
-
return new Promise((resolve) => {
|
|
42
|
-
httpServer.listen(port, () => {
|
|
43
|
-
console.log(`Cmux server running on port ${port}`);
|
|
44
|
-
console.log(`Serving static files from: ${staticDir}`);
|
|
45
|
-
resolve();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
const stop = () => {
|
|
50
|
-
return new Promise((resolve) => {
|
|
51
|
-
httpServer.close(() => {
|
|
52
|
-
console.log('Cmux server stopped');
|
|
53
|
-
resolve();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
return {
|
|
58
|
-
app,
|
|
59
|
-
io,
|
|
60
|
-
httpServer,
|
|
61
|
-
start,
|
|
62
|
-
stop
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function startServer(options) {
|
|
66
|
-
const server = createCmuxServer(options);
|
|
67
|
-
server.start();
|
|
68
|
-
return server;
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAaA,4CAiEC;AAED,kCAIC;AApFD,sDAA8B;AAC9B,+BAAoC;AACpC,yCAAmC;AACnC,gDAAwB;AACxB,gDAAwB;AASxB,SAAgB,gBAAgB,CAAC,UAAuB,EAAE;IACxD,MAAM,EACJ,IAAI,GAAG,IAAI,EAC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,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;gBAC3B,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;gBACnD,OAAO,CAAC,GAAG,CAAC,8BAA8B,SAAS,EAAE,CAAC,CAAC;gBACvD,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;gBACnC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG;QACH,EAAE;QACF,UAAU;QACV,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAgB,WAAW,CAAC,OAAqB;IAC/C,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/public/index.html
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Cmux Server</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<h1>Cmux Server Running</h1>
|
|
10
|
-
<p>Socket.IO server is ready at port 2689</p>
|
|
11
|
-
<script src="/socket.io/socket.io.js"></script>
|
|
12
|
-
<script>
|
|
13
|
-
const socket = io();
|
|
14
|
-
socket.on('connect', () => {
|
|
15
|
-
console.log('Connected to server');
|
|
16
|
-
});
|
|
17
|
-
</script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|