dual-brain 4.7.0 → 4.7.1

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.
Files changed (2) hide show
  1. package/install.mjs +19 -0
  2. package/package.json +1 -1
package/install.mjs CHANGED
@@ -334,6 +334,22 @@ function detectEnvironment() {
334
334
  };
335
335
  }
336
336
 
337
+ // ─── NPM Token Persistence ────────────────────────────────────────────────
338
+
339
+ const NPM_PERSIST = resolve(process.cwd(), '.replit-tools', '.npm-persistent', '.npmrc');
340
+ const NPMRC_HOME = join(process.env.HOME || '', '.npmrc');
341
+
342
+ function restoreNpmToken() {
343
+ if (existsSync(NPMRC_HOME)) return;
344
+ if (!existsSync(NPM_PERSIST)) return;
345
+ try {
346
+ const content = readFileSync(NPM_PERSIST, 'utf8');
347
+ if (content.includes('_authToken')) {
348
+ writeFileSync(NPMRC_HOME, content);
349
+ }
350
+ } catch {}
351
+ }
352
+
337
353
  // ─── Auth Self-Healing ─────────────────────────────────────────────────────
338
354
 
339
355
  function healClaudeAuth(env) {
@@ -1275,6 +1291,9 @@ async function main() {
1275
1291
  if (subcommand === 'budget') { cmdBudget(); return; }
1276
1292
  if (subcommand === 'explain') { cmdExplain(); return; }
1277
1293
 
1294
+ // Restore npm token if missing (for publish access)
1295
+ restoreNpmToken();
1296
+
1278
1297
  let env = detectEnvironment();
1279
1298
  const startupUpdateInfo = (subcommand === 'update' || dryRun || jsonOut)
1280
1299
  ? null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "4.7.0",
3
+ "version": "4.7.1",
4
4
  "description": "Dual-provider orchestration for Claude Code — tiered routing, budget balancing, and GPT dual-brain review across Claude + OpenAI subscriptions",
5
5
  "type": "module",
6
6
  "bin": {