machine-tunnel 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.
Files changed (2) hide show
  1. package/bin/cli.js +25 -0
  2. package/package.json +23 -0
package/bin/cli.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'node:child_process';
4
+
5
+ const npxCommand = process.platform === 'win32' ? 'npx.cmd' : 'npx';
6
+ const forwardedArgs = ['--yes', '@kortix/agent-tunnel', ...process.argv.slice(2)];
7
+
8
+ const child = spawn(npxCommand, forwardedArgs, {
9
+ stdio: 'inherit',
10
+ env: process.env,
11
+ shell: process.platform === 'win32',
12
+ });
13
+
14
+ child.on('exit', (code, signal) => {
15
+ if (signal) {
16
+ process.kill(process.pid, signal);
17
+ return;
18
+ }
19
+ process.exit(code ?? 1);
20
+ });
21
+
22
+ child.on('error', (error) => {
23
+ console.error(`[machine-tunnel] Failed to start wrapped CLI: ${error.message}`);
24
+ process.exit(1);
25
+ });
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "machine-tunnel",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Machine-branded wrapper for the Agent Tunnel CLI",
7
+ "bin": {
8
+ "machine-tunnel": "bin/cli.js"
9
+ },
10
+ "files": [
11
+ "bin/"
12
+ ],
13
+ "keywords": [
14
+ "machine",
15
+ "tunnel",
16
+ "agent",
17
+ "cli"
18
+ ],
19
+ "license": "MIT",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }