labs-claude 0.3.0 → 0.3.4

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.
@@ -2,7 +2,7 @@ const axios = require('axios');
2
2
  const fs = require('fs');
3
3
  const path = require('path');
4
4
  const { spawn } = require('child_process');
5
- const { LABS_DIR, credentialFingerprint, loadConfig } = require('./config');
5
+ const { LABS_DIR, codeFingerprint, credentialFingerprint, loadConfig } = require('./config');
6
6
  const { loadProxyKey } = require('./local-auth');
7
7
  const { version: VERSION } = require('../package.json');
8
8
 
@@ -14,11 +14,13 @@ async function health(port) {
14
14
  }
15
15
  }
16
16
 
17
- // Reuses a running proxy of the same version and key; an older version (after `npm update -g`) or one still holding
18
- // an old ElevenLabs key or bridge agent (after `labs setup` with a new account) is stopped and replaced.
17
+ // Reuses a running proxy of the same version, key and code; an older version (after `npm update -g`), one still holding
18
+ // an old ElevenLabs key or bridge agent (after `labs setup` with a new account), or one running code that has since
19
+ // changed on disk is stopped and replaced.
19
20
  async function ensureProxy(port) {
20
21
  const wanted = credentialFingerprint(loadConfig());
21
- const isCurrent = info => info?.name === 'labs-claude' && info.version === VERSION && info.credentials === wanted;
22
+ const code = codeFingerprint();
23
+ const isCurrent = info => info?.name === 'labs-claude' && info.version === VERSION && info.credentials === wanted && info.code === code;
22
24
  const running = await health(port);
23
25
  if (isCurrent(running)) return true;
24
26
  if (running?.name === 'labs-claude') {