switchman-dev 0.1.12 → 0.1.14

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.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ process.env.NODE_NO_WARNINGS = '1';
3
+ import('../src/cli/index.js');
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "switchman-dev",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Project manager for AI coding assistants running safely on one codebase",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
- "switchman": "src/cli/index.js",
8
+ "switchman": "bin/switchman.js",
9
9
  "switchman-mcp": "src/mcp/server.js"
10
10
  },
11
11
  "repository": {
@@ -123,6 +123,13 @@ export async function checkLicence() {
123
123
  return { valid: false, reason: 'not_logged_in' };
124
124
  }
125
125
 
126
+ // Proactively refresh if token expires within 5 minutes
127
+ if (creds.expires_at && Date.now() > creds.expires_at - 5 * 60 * 1000) {
128
+ if (creds.refresh_token) {
129
+ await refreshToken(creds.refresh_token);
130
+ }
131
+ }
132
+
126
133
  // Check the 24-hour cache first
127
134
  const cache = readLicenceCache();
128
135
  if (cache?.valid && cache.cached_at) {