polydev-ai 1.9.30 → 1.9.32

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.
@@ -1043,28 +1043,9 @@ To authenticate, pass your token directly:
1043
1043
  };
1044
1044
  }
1045
1045
 
1046
- // Not sandboxed — tell user to use login tool (don't auto-open browser)
1047
- console.error('[Polydev] No token found, prompting user to login');
1048
- return {
1049
- jsonrpc: '2.0',
1050
- id,
1051
- result: {
1052
- content: [{
1053
- type: 'text',
1054
- text: `POLYDEV STATUS
1055
- ==============
1056
-
1057
- Authentication: Not connected
1058
-
1059
- To login:
1060
- 1. Use the "login" tool (opens browser)
1061
- 2. Or run: npx polydev-ai
1062
-
1063
- Token will be saved automatically after login.`
1064
- }],
1065
- isError: true
1066
- }
1067
- };
1046
+ // Not sandboxed — auto-trigger browser login
1047
+ console.error('[Polydev] No token found, triggering browser login...');
1048
+ return await this.triggerReAuth(id, 'Not authenticated. Opening browser to login...');
1068
1049
  }
1069
1050
 
1070
1051
  try {
@@ -1154,26 +1135,9 @@ Configure: https://polydev.ai/dashboard/models`
1154
1135
  }
1155
1136
  };
1156
1137
  } else {
1157
- // Token invalid/expired - tell user to re-login (don't auto-open browser)
1158
- console.error('[Polydev] Auth status: token invalid/expired');
1159
- return {
1160
- jsonrpc: '2.0',
1161
- id,
1162
- result: {
1163
- content: [{
1164
- type: 'text',
1165
- text: `POLYDEV STATUS
1166
- ==============
1167
-
1168
- Authentication: Token invalid or expired
1169
-
1170
- To re-authenticate:
1171
- 1. Use the "login" tool (opens browser)
1172
- 2. Or run: npx polydev-ai`
1173
- }],
1174
- isError: true
1175
- }
1176
- };
1138
+ // Token invalid/expired - auto-trigger browser re-auth
1139
+ console.error('[Polydev] Auth status: token invalid/expired, triggering re-auth...');
1140
+ return await this.triggerReAuth(id, 'Token invalid or expired. Re-authenticating...');
1177
1141
  }
1178
1142
  } catch (error) {
1179
1143
  // Categorize the error for clearer user messaging
@@ -1686,15 +1650,8 @@ To re-login: /polydev:login`
1686
1650
  console.error(`[Stdio Wrapper] Remote server error: ${response.status} - ${errorText}`);
1687
1651
 
1688
1652
  if (response.status === 401) {
1689
- console.error('[Polydev] Remote API returned 401 — token expired or invalid.');
1690
- return {
1691
- jsonrpc: '2.0',
1692
- id: request.id,
1693
- error: {
1694
- code: -32603,
1695
- message: 'Authentication expired. Use the "login" tool to re-authenticate.'
1696
- }
1697
- };
1653
+ console.error('[Polydev] Remote API returned 401 — token expired, triggering re-authentication...');
1654
+ return await this.triggerReAuth(request.id, 'Token expired or invalid. Re-authenticating...');
1698
1655
  }
1699
1656
 
1700
1657
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.9.30",
3
+ "version": "1.9.32",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },