polydev-ai 1.8.77 → 1.8.78

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.
@@ -1984,25 +1984,32 @@ class StdioMCPWrapper {
1984
1984
  // Run the onboarding/status check
1985
1985
  await this.runStartupFlow();
1986
1986
 
1987
- // Run CLI detection in background
1988
- console.error('[Polydev] Detecting local CLI tools...');
1989
-
1990
- this.localForceCliDetection({})
1991
- .then(async () => {
1992
- this._cliDetectionComplete = true;
1993
- // Display CLI status after detection
1994
- await this.displayCliStatus();
1995
- })
1996
- .catch((error) => {
1997
- console.error('[Polydev] CLI detection failed:', error.message);
1998
- this._cliDetectionComplete = true;
1999
- })
2000
- .finally(() => {
2001
- if (this._cliDetectionResolver) {
2002
- this._cliDetectionResolver();
2003
- }
2004
- this.startSmartRefreshScheduler();
2005
- });
1987
+ // Only run CLI detection here if we already have a token
1988
+ // (If no token, CLI detection runs after login completes in runStartupFlow)
1989
+ if (this.userToken) {
1990
+ console.error('[Polydev] Detecting local CLI tools...');
1991
+
1992
+ this.localForceCliDetection({})
1993
+ .then(async () => {
1994
+ this._cliDetectionComplete = true;
1995
+ // Display CLI status after detection
1996
+ await this.displayCliStatus();
1997
+ })
1998
+ .catch((error) => {
1999
+ console.error('[Polydev] CLI detection failed:', error.message);
2000
+ this._cliDetectionComplete = true;
2001
+ })
2002
+ .finally(() => {
2003
+ if (this._cliDetectionResolver) {
2004
+ this._cliDetectionResolver();
2005
+ }
2006
+ this.startSmartRefreshScheduler();
2007
+ });
2008
+ } else {
2009
+ // No token - CLI detection will run after login completes
2010
+ // Just start the scheduler
2011
+ this.startSmartRefreshScheduler();
2012
+ }
2006
2013
  }
2007
2014
 
2008
2015
  /**
@@ -2010,16 +2017,28 @@ class StdioMCPWrapper {
2010
2017
  */
2011
2018
  async runStartupFlow() {
2012
2019
  if (!this.userToken) {
2013
- // No token - auto-open browser for login
2020
+ // No token - auto-open browser for login (NON-BLOCKING)
2014
2021
  console.error('─'.repeat(50));
2015
2022
  console.error('Polydev - First Time Setup');
2016
2023
  console.error('─'.repeat(50));
2017
2024
  console.error('Opening browser for authentication...\n');
2018
2025
 
2019
- await this.autoLoginOnStartup();
2026
+ // Run auto-login in background (don't block MCP server startup)
2027
+ this.autoLoginOnStartup().then(() => {
2028
+ console.error('[Polydev] Login completed, running CLI detection...');
2029
+ // After login, run CLI detection
2030
+ return this.localForceCliDetection({});
2031
+ }).then(() => {
2032
+ this._cliDetectionComplete = true;
2033
+ return this.displayCliStatus();
2034
+ }).catch((error) => {
2035
+ console.error('[Polydev] Auto-login flow error:', error.message);
2036
+ });
2020
2037
  } else {
2021
- // Has token - verify it
2022
- await this.verifyAndDisplayAuth();
2038
+ // Has token - verify it (also non-blocking)
2039
+ this.verifyAndDisplayAuth().catch((error) => {
2040
+ console.error('[Polydev] Auth verification error:', error.message);
2041
+ });
2023
2042
  }
2024
2043
  }
2025
2044
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.8.77",
3
+ "version": "1.8.78",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },