xkat-cli 2.0.15 → 2.0.17

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": "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"
2
+ "xkat-agent-macos-aarch64": "2302708ec3671a348d7097ca37c8fdfb8f7e7075677b77bdcd3a81f925c7a08d",
3
+ "xkat-agent-macos-x64": "0327efb22cb81327f139fe93745453c561ccfd8e63255e3277c9feb5de497d0a",
4
+ "xkat-agent-linux-x64": "2ca8bfd35f05398b8e90e4dfa1b5d702f7a81fc5881e4be9b3e8df11345860e9",
5
+ "xkat-agent-linux-aarch64": "6d2db70dd5e7a02c275106f3d3d0abf6ebfdc19d526f6deb952753df3f1f7584",
6
+ "xkat-agent-win-x64.exe": "7116843eaf46be1c75f3170f91b15d745e4a8a0bf6cdf54ec436095fd27082f1"
7
7
  }
package/bin/xkat-cli.js CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // Suppress Node.js runtime deprecation warnings (e.g. DEP0169)
4
+ process.removeAllListeners('warning');
5
+ process.emitWarning = () => {};
3
6
  process.env.NODE_NO_WARNINGS = '1';
4
7
 
5
8
  /**
@@ -51,20 +54,20 @@ const binaryPath = candidatePaths.find((p) => fs.existsSync(p));
51
54
  const args = process.argv.slice(2);
52
55
  const subCmd = args.join(' ').trim();
53
56
 
54
- // ── 1. Zero-Touch Port 10022 Cleanup Command ──
57
+ // ── 1. Zero-Touch Port 38000..38050 & 10022 Cleanup Command ──
55
58
  if (subCmd === 'down' || subCmd === 'stop' || subCmd === 'kill' || subCmd === 'clean') {
56
- console.log('🛑 Cleaning up port 10022 and stopping existing xkat agent instances...');
59
+ console.log('🛑 Cleaning up agent ports (38000..38050, 10022) and stopping existing xkat agent instances...');
57
60
  if (os.platform() === 'win32') {
58
61
  spawnSync('powershell', [
59
62
  '-NoProfile',
60
63
  '-NonInteractive',
61
64
  '-Command',
62
- 'Get-NetTCPConnection -LocalPort 10022 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | Where-Object { $_ -gt 0 } | ForEach-Object { Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue }; Get-Process -Name xkat-agent*, xkat* -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue'
65
+ '38000..38050 + @(10022) | ForEach-Object { Get-NetTCPConnection -LocalPort $_ -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | Where-Object { $_ -gt 0 } | ForEach-Object { Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue } }; Get-Process -Name xkat-agent*, xkat* -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue'
63
66
  ], { stdio: 'inherit' });
64
67
  } else {
65
- spawnSync('sh', ['-c', 'fuser -k 10022/tcp 2>/dev/null || true; pgrep -f "xkat-agent" | xargs -r kill -9 2>/dev/null || true'], { stdio: 'inherit' });
68
+ spawnSync('sh', ['-c', 'fuser -k 38000-38050/tcp 2>/dev/null || true; fuser -k 10022/tcp 2>/dev/null || true; pgrep -f "xkat-agent" | xargs -r kill -9 2>/dev/null || true'], { stdio: 'inherit' });
66
69
  }
67
- console.log('✅ Port 10022 is now completely free.');
70
+ console.log('✅ Agent ports are now completely free.');
68
71
  process.exit(0);
69
72
  }
70
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xkat-cli",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
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": {
@@ -3,6 +3,10 @@
3
3
  * Runs automatically right after `npm install`. Downloads the prebuilt Rust
4
4
  * binary matching the user's OS/architecture from GitHub Releases (or R2).
5
5
  */
6
+ process.removeAllListeners('warning');
7
+ process.emitWarning = () => {};
8
+ process.env.NODE_NO_WARNINGS = '1';
9
+
6
10
  const os = require('os');
7
11
  const fs = require('fs');
8
12
  const path = require('path');
@@ -116,13 +120,15 @@ async function main() {
116
120
  }
117
121
  }
118
122
 
119
- function downloadFile(url, dest) {
123
+ function downloadFile(urlStr, dest) {
120
124
  return new Promise((resolve, reject) => {
121
125
  const file = fs.createWriteStream(dest);
122
- https.get(url, (response) => {
126
+ const parsedUrl = new URL(urlStr);
127
+ https.get(parsedUrl, (response) => {
123
128
  // GitHub Releases use 302 redirects
124
129
  if (response.statusCode === 302 || response.statusCode === 301) {
125
- https.get(response.headers.location, (redirected) => {
130
+ const redirectUrl = new URL(response.headers.location, parsedUrl);
131
+ https.get(redirectUrl, (redirected) => {
126
132
  redirected.pipe(file);
127
133
  file.on('finish', () => { file.close(); resolve(); });
128
134
  }).on('error', reject);