vigthoria-cli 1.6.43 → 1.6.44

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.
@@ -138,6 +138,7 @@ class AuthCommand {
138
138
  this.logger.warn('Not logged in');
139
139
  console.log();
140
140
  console.log(chalk_1.default.gray('Run `vigthoria login` to authenticate'));
141
+ this.api.destroy();
141
142
  return;
142
143
  }
143
144
  const email = this.config.get('email');
@@ -174,6 +175,7 @@ class AuthCommand {
174
175
  console.log();
175
176
  // Run ALL three probes in parallel — they are independent.
176
177
  const spinner = (0, logger_js_1.createSpinner)('Checking API, capabilities and auth...').start();
178
+ let capabilityTimeout = null;
177
179
  const [apiStatus, capabilityStatus, tokenValidation] = await Promise.all([
178
180
  this.api.getHealthStatus(),
179
181
  Promise.race([
@@ -182,16 +184,20 @@ class AuthCommand {
182
184
  projectPath: process.cwd(),
183
185
  targetPath: process.cwd(),
184
186
  }),
185
- new Promise(resolve => setTimeout(() => resolve({
186
- overallOk: false,
187
- v3Agent: { name: 'V3 Agent', endpoint: '', ok: false, error: 'Timed out (8s)' },
188
- hyperLoop: { name: 'Hyper Loop', endpoint: '', ok: false, error: 'Timed out (8s)' },
189
- repoMemory: { name: 'Repo Memory', endpoint: '', ok: false, error: 'Timed out (8s)' },
190
- devtoolsBridge: { name: 'DevTools Bridge', endpoint: '', ok: false, error: 'Timed out (8s)' },
191
- }), 8000)),
187
+ new Promise(resolve => {
188
+ capabilityTimeout = setTimeout(() => resolve({
189
+ overallOk: false,
190
+ v3Agent: { name: 'V3 Agent', endpoint: '', ok: false, error: 'Timed out (8s)' },
191
+ hyperLoop: { name: 'Hyper Loop', endpoint: '', ok: false, error: 'Timed out (8s)' },
192
+ repoMemory: { name: 'Repo Memory', endpoint: '', ok: false, error: 'Timed out (8s)' },
193
+ devtoolsBridge: { name: 'DevTools Bridge', endpoint: '', ok: false, error: 'Timed out (8s)' },
194
+ }), 8000);
195
+ }),
192
196
  ]),
193
197
  this.api.validateToken(),
194
198
  ]);
199
+ if (capabilityTimeout)
200
+ clearTimeout(capabilityTimeout);
195
201
  spinner.stop();
196
202
  // --- Display API Status ---
197
203
  console.log(chalk_1.default.white('API Status:'));
@@ -249,13 +255,11 @@ class AuthCommand {
249
255
  console.log(chalk_1.default.gray(' Bridge Auth: ') + (capabilityStatus.devtoolsBridge.ok ? chalk_1.default.green('Connected') : chalk_1.default.gray('N/A — bridge not running')) + chalk_1.default.gray(' (used by --bridge flag only)'));
250
256
  console.log();
251
257
  // Graceful exit — destroy keep-alive agents so the event loop drains
252
- // naturally instead of calling process.exit(0), which on
253
- // Windows / Node 25 triggers a libuv UV_HANDLE_CLOSING assertion
254
- // when async handles are still being cleaned up.
258
+ // naturally. Setting exitCode (not calling process.exit()) avoids the
259
+ // libuv UV_HANDLE_CLOSING assertion on Windows that occurs when
260
+ // process.exit() is invoked while socket handles are mid-close.
255
261
  this.api.destroy();
256
- // Fallback: if straggler handles still keep the loop alive after
257
- // 150 ms, force exit (unref'd so it won't block a clean drain).
258
- setTimeout(() => process.exit(0), 150).unref();
262
+ process.exitCode = 0;
259
263
  }
260
264
  printLoginSuccess() {
261
265
  const email = this.config.get('email');
@@ -32,6 +32,8 @@ class BridgeCommand {
32
32
  ? chalk_1.default.green('Local browser observability is available for debugging flows.')
33
33
  : chalk_1.default.gray('Start the DevTools Bridge to enable local browser observability.')));
34
34
  console.log();
35
+ this.api.destroy();
36
+ process.exitCode = 0;
35
37
  }
36
38
  }
37
39
  exports.BridgeCommand = BridgeCommand;
package/dist/index.js CHANGED
@@ -752,5 +752,5 @@ async function main() {
752
752
  }
753
753
  main().catch((err) => {
754
754
  console.error(chalk_1.default.red('Error:'), err.message);
755
- process.exit(1);
755
+ process.exitCode = 1;
756
756
  });
package/dist/utils/api.js CHANGED
@@ -148,6 +148,7 @@ class APIClient {
148
148
  this.selfHostedModelRouterClient = selfHostedModelsApiUrl ? axios_1.default.create({
149
149
  baseURL: selfHostedModelsApiUrl,
150
150
  timeout: 240000,
151
+ httpsAgent,
151
152
  headers: {
152
153
  'Content-Type': 'application/json',
153
154
  'User-Agent': `Vigthoria-CLI/${process.env.npm_package_version || '1.6.9'}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.6.43",
3
+ "version": "1.6.44",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -86,4 +86,4 @@
86
86
  "engines": {
87
87
  "node": ">=18.0.0"
88
88
  }
89
- }
89
+ }