agent-relay 2.1.27-beta.1 → 2.1.27-beta.2

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.
@@ -3863,6 +3863,18 @@ program
3863
3863
  }
3864
3864
  stdin.resume();
3865
3865
  const onStdinData = (data) => {
3866
+ // Escape (0x1b) or Ctrl+C (0x03) after auth success → close session
3867
+ if (authDetected && (data[0] === 0x1b || data[0] === 0x03)) {
3868
+ cleanup();
3869
+ clearTimeout(timer);
3870
+ try {
3871
+ stream.close();
3872
+ }
3873
+ catch {
3874
+ // ignore
3875
+ }
3876
+ return;
3877
+ }
3866
3878
  stream.write(data);
3867
3879
  };
3868
3880
  stdin.on('data', onStdinData);
@@ -3877,32 +3889,16 @@ program
3877
3889
  }
3878
3890
  stdin.pause();
3879
3891
  };
3880
- // Auto-close the session when auth success is detected
3892
+ // Notify user when auth success is detected
3881
3893
  const closeOnAuthSuccess = () => {
3882
3894
  authDetected = true;
3883
- // Delay sending Enter so the CLI has time to render
3884
- // the "Press Enter to continue..." prompt with its input listener.
3885
- // Success patterns match on "Logged in" / "Login successful" which
3886
- // may arrive before the Ink "Press Enter" screen is fully rendered.
3887
- setTimeout(() => {
3888
- try {
3889
- stream.write('\r');
3890
- }
3891
- catch {
3892
- // ignore - process may have exited
3893
- }
3894
- }, 500);
3895
- // Close the stream after giving the CLI time to process the Enter
3896
- setTimeout(() => {
3897
- cleanup();
3898
- clearTimeout(timer);
3899
- try {
3900
- stream.close();
3901
- }
3902
- catch {
3903
- // ignore
3904
- }
3905
- }, 2500);
3895
+ // Don't try to auto-navigate post-login prompts (trust directory,
3896
+ // bypass permissions, etc.) they vary by CLI version and are fragile
3897
+ // to automate. Just tell the user they're done.
3898
+ stdout.write('\n');
3899
+ stdout.write(green(' ✓ Authentication successful!') + '\n');
3900
+ stdout.write(dim(' Press Escape or Ctrl+C to exit.') + '\n');
3901
+ stdout.write('\n');
3906
3902
  };
3907
3903
  stream.on('data', (data) => {
3908
3904
  stdout.write(data);