xkat-cli 2.0.14 → 2.0.15

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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "xkat-agent-macos-aarch64": "4fbdb35672b2238bef6c610c60397d31d5081a93f80cf19696628d77e471dfd6",
3
- "xkat-agent-macos-x64": "5f219b9d640d2123e7f25df59cfbeb0a38f9c7f605ba5b53f0b892fc953c99b8",
4
- "xkat-agent-linux-x64": "4befdcb1c3b4c6e52bb2fcaf81e49071dace00b41e49d2abff2c55bf3114c845",
5
- "xkat-agent-linux-aarch64": "ea064e042f57247ff2a3dd5f9ec186f055824c02b854e7e694f0cc1c3a87b222",
6
- "xkat-agent-win-x64.exe": "77855811d43e0f173ac10aa8665f557833e81b1fcd4e9941f641c7d020677921"
2
+ "xkat-agent-macos-aarch64": "e1b15cbea556bf1b7f1ec56e05a089eb5b1239a482eb195bef247fa65d233649",
3
+ "xkat-agent-macos-x64": "0c8041d95b3d7911ad9572cba9cc68ce86d5621d0040d516bbce40a23cf80544",
4
+ "xkat-agent-linux-x64": "581d35363debeff79b71b73d2d7d55c8273d8a0dadb5929c05532fa6d2004f8c",
5
+ "xkat-agent-linux-aarch64": "05aaff56d74dd66c50b9ddd848123c918660bee761da42973c22fd6bdc8000ca",
6
+ "xkat-agent-win-x64.exe": "ee568b3796c21558e1f483e43dfa810c0bca5354046b03a5b259ede0980df027"
7
7
  }
package/bin/xkat-cli.js CHANGED
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ process.env.NODE_NO_WARNINGS = '1';
4
+
3
5
  /**
4
6
  * xkat-cli.js
5
7
  * Lightweight CLI entry point for `npx -y xkat-cli@latest`.
6
- * Launches the live local agent bridge in the foreground by default,
8
+ * Launches the live local agent bridge in the background by default,
7
9
  * connecting your browser to your local environment with zero manual configuration.
8
10
  */
9
11
  const { spawnSync } = require('child_process');
@@ -66,18 +68,34 @@ if (subCmd === 'down' || subCmd === 'stop' || subCmd === 'kill' || subCmd === 'c
66
68
  process.exit(0);
67
69
  }
68
70
 
71
+ function getMultipassCmd() {
72
+ if (os.platform() === 'win32') {
73
+ const candidates = [
74
+ 'multipass',
75
+ path.join(process.env.ProgramFiles || 'C:\\Program Files', 'Multipass', 'bin', 'multipass.exe'),
76
+ path.join(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)', 'Multipass', 'bin', 'multipass.exe'),
77
+ path.join(process.env.LOCALAPPDATA || '', 'Programs', 'Multipass', 'bin', 'multipass.exe'),
78
+ ];
79
+ for (const c of candidates) {
80
+ if (c === 'multipass' || fs.existsSync(c)) return c;
81
+ }
82
+ }
83
+ return 'multipass';
84
+ }
85
+
69
86
  // ── 2. Fallback for Lab VM commands when native agent is not built ──
70
87
  if (!binaryPath) {
88
+ const mp = getMultipassCmd();
71
89
  if (subCmd === 'lab shell') {
72
- const result = spawnSync('multipass', ['shell', LAB_NAME], { stdio: 'inherit' });
90
+ const result = spawnSync(mp, ['shell', LAB_NAME], { stdio: 'inherit', shell: os.platform() === 'win32' });
73
91
  process.exit(result.status || 0);
74
92
  }
75
93
 
76
94
  if (subCmd === 'lab reset') {
77
95
  console.log('🔄 Resetting Lab VM...');
78
- spawnSync('multipass', ['delete', LAB_NAME, '--purge'], { stdio: 'inherit' });
96
+ spawnSync(mp, ['delete', LAB_NAME, '--purge'], { stdio: 'inherit', shell: os.platform() === 'win32' });
79
97
  console.log('🚀 Launching fresh Lab VM...');
80
- const launch = spawnSync('multipass', ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit' });
98
+ const launch = spawnSync(mp, ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit', shell: os.platform() === 'win32' });
81
99
  if (launch.status === 0) {
82
100
  console.log('✅ Lab reset complete.');
83
101
  console.log(' Enter: npx -y xkat-cli@latest lab shell');
@@ -88,10 +106,10 @@ if (!binaryPath) {
88
106
  }
89
107
 
90
108
  if (subCmd === 'lab up' || subCmd === 'lab install') {
91
- const info = spawnSync('multipass', ['info', LAB_NAME], { encoding: 'utf8' });
109
+ const info = spawnSync(mp, ['info', LAB_NAME], { encoding: 'utf8', shell: os.platform() === 'win32' });
92
110
  if (info.status !== 0) {
93
111
  console.log('🚀 Creating Lab VM...');
94
- const launch = spawnSync('multipass', ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit' });
112
+ const launch = spawnSync(mp, ['launch', '--name', LAB_NAME, '24.04', '--cpus', '2', '--memory', '2G', '--disk', '10G'], { stdio: 'inherit', shell: os.platform() === 'win32' });
95
113
  process.exit(launch.status || 0);
96
114
  } else {
97
115
  console.log(`✅ Lab VM '${LAB_NAME}' already exists.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xkat-cli",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "description": "xkat Agent - an AI agent that securely connects your browser to your machine",
5
5
  "main": "bin/xkat-cli.js",
6
6
  "bin": {