polydev-ai 1.9.28 → 1.9.29

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.
@@ -1633,8 +1633,7 @@ To re-login: /polydev:login`
1633
1633
 
1634
1634
  /**
1635
1635
  * Start a periodic progress heartbeat to prevent client-side timeouts.
1636
- * Sends a progress notification every intervalMs to signal the server is still working.
1637
- * Compatible MCP clients will reset their timeout clock on each notification.
1636
+ * Sends a progress notification every intervalMs to keep the connection alive
1638
1637
  * @param {string|number} progressToken - Token from request's _meta.progressToken
1639
1638
  * @param {number} intervalMs - Heartbeat interval in milliseconds (default: 10s)
1640
1639
  * @returns {{ stop: Function, tick: Function }} Controller to stop heartbeat and manually tick progress
@@ -3213,6 +3212,45 @@ To re-login: /polydev:login`
3213
3212
  }
3214
3213
  }
3215
3214
 
3215
+ /**
3216
+ * Verify token and display auth status
3217
+ */
3218
+ async verifyAndDisplayAuth() {
3219
+ try {
3220
+ const response = await fetch('https://www.polydev.ai/api/mcp', {
3221
+ method: 'POST',
3222
+ headers: {
3223
+ 'Content-Type': 'application/json',
3224
+ 'Authorization': `Bearer ${this.userToken}`,
3225
+ 'User-Agent': 'polydev-mcp/1.0.0'
3226
+ },
3227
+ body: JSON.stringify({ action: 'check_status' })
3228
+ });
3229
+
3230
+ if (response.ok) {
3231
+ const data = await response.json();
3232
+ const credits = data.credits_remaining?.toLocaleString() || 0;
3233
+ const tier = data.subscription_tier || 'Free';
3234
+
3235
+ console.error('─'.repeat(50));
3236
+ console.error('Polydev - Authenticated');
3237
+ console.error('─'.repeat(50));
3238
+ console.error(`Account: ${data.email || 'Connected'}`);
3239
+ console.error(`Credits: ${credits} | Tier: ${tier}`);
3240
+ console.error('─'.repeat(50) + '\n');
3241
+ } else {
3242
+ console.error('─'.repeat(50));
3243
+ console.error('Polydev - Token may be invalid');
3244
+ console.error('─'.repeat(50));
3245
+ console.error('Server returned non-OK. Will re-verify on next auth check.');
3246
+ console.error('Use the "login" tool or run: npx polydev-ai login');
3247
+ console.error('─'.repeat(50) + '\n');
3248
+ }
3249
+ } catch (error) {
3250
+ console.error('[Polydev] Could not verify auth (offline?):', error.message || 'unknown');
3251
+ }
3252
+ }
3253
+
3216
3254
  /**
3217
3255
  * Display CLI tools status after detection
3218
3256
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.9.28",
3
+ "version": "1.9.29",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },