@agentver/cli 0.2.0 → 0.2.1

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/dist/agentver.js CHANGED
@@ -8057,6 +8057,7 @@ function startCallbackServer(expectedState) {
8057
8057
  port: address.port,
8058
8058
  waitForCallback: () => callbackPromise,
8059
8059
  close: () => {
8060
+ server.closeAllConnections();
8060
8061
  server.close();
8061
8062
  }
8062
8063
  });
@@ -8169,14 +8170,16 @@ function registerLoginCommand(program2) {
8169
8170
  `));
8170
8171
  await open(authUrl);
8171
8172
  spinner.text = "Waiting for authentication in browser...";
8173
+ let authTimeout;
8172
8174
  const { code } = await Promise.race([
8173
8175
  callbackServer.waitForCallback(),
8174
8176
  new Promise((_resolve, reject) => {
8175
- setTimeout(() => {
8177
+ authTimeout = setTimeout(() => {
8176
8178
  reject(new Error("Authentication timed out after 120 seconds"));
8177
8179
  }, AUTH_TIMEOUT_MS);
8178
8180
  })
8179
8181
  ]);
8182
+ clearTimeout(authTimeout);
8180
8183
  spinner.text = "Exchanging authorisation code for token...";
8181
8184
  const tokenResponse = await exchangeCodeForToken(apiUrl, code, codeVerifier, redirectUri);
8182
8185
  saveCredentials({ token: tokenResponse.access_token });
@@ -8185,6 +8188,7 @@ function registerLoginCommand(program2) {
8185
8188
  if (connectedUrl) {
8186
8189
  console.log(chalk16.dim(`Connected to ${connectedUrl}`));
8187
8190
  }
8191
+ process.exit(0);
8188
8192
  } catch (error) {
8189
8193
  const message = error instanceof Error ? error.message : String(error);
8190
8194
  spinner.fail(`Authentication failed: ${message}`);