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.
- package/README.md +20 -4
- package/bin/labs.js +188 -40
- package/package.json +4 -3
- package/src/admin-cli.js +247 -0
- package/src/agy.js +1016 -0
- package/src/anthropic-protocol.js +84 -17
- package/src/chat/index.html +10 -1
- package/src/config.js +101 -71
- package/src/gateway-client.js +173 -124
- package/src/gemini.js +474 -0
- package/src/image-mcp.js +174 -0
- package/src/launch-args.js +15 -4
- package/src/proxy-manager.js +6 -4
- package/src/proxy.js +976 -801
- package/src/setup.js +43 -1
- package/src/ui.js +181 -0
- package/src/usage.js +42 -2
- package/src/web-mcp.js +253 -0
package/src/proxy-manager.js
CHANGED
|
@@ -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
|
|
18
|
-
// an old ElevenLabs key or bridge agent (after `labs setup` with a new account)
|
|
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
|
|
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') {
|