@theronap/cortex-mcp 0.9.13 → 0.9.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.
- package/lib/edge_extract.mjs +7 -2
- package/package.json +1 -1
package/lib/edge_extract.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { spawnSync } from 'child_process'
|
|
|
6
6
|
// both session people AND the entity catalogue down; extracting here keeps the engine on `claude -p`
|
|
7
7
|
// (the standing preference) and removes that dependency. Node-native (no bun) to match capture.mjs.
|
|
8
8
|
//
|
|
9
|
-
// edgeSafeEnv() strips EVERY ANTHROPIC_* var
|
|
9
|
+
// edgeSafeEnv() strips EVERY ANTHROPIC_* var (but KEEPS CLAUDE_CODE_OAUTH_TOKEN — the headless
|
|
10
10
|
// runs on the file-based subscription login and a stray ANTHROPIC_BASE_URL (e.g. a keytunnel proxy)
|
|
11
11
|
// can't reroute "free, local" inference through a billed proxy or ship raw text off-machine. The
|
|
12
12
|
// spawn also sets CORTEX_SUMMARIZING=1 so the headless session's own Stop hook no-ops (runCapture
|
|
@@ -21,7 +21,12 @@ export function edgeSafeEnv(base = process.env, extra = {}) {
|
|
|
21
21
|
const env = {}
|
|
22
22
|
for (const [k, v] of Object.entries(base)) {
|
|
23
23
|
if (v === undefined) continue
|
|
24
|
-
|
|
24
|
+
// Strip billed/proxy routing only (ANTHROPIC_API_KEY metered, ANTHROPIC_BASE_URL keytunnel,
|
|
25
|
+
// ANTHROPIC_AUTH_TOKEN/CUSTOM_HEADERS proxy) so edge inference runs on the SUBSCRIPTION, never a
|
|
26
|
+
// metered/proxy path. KEEP CLAUDE_CODE_OAUTH_TOKEN — it IS the headless subscription credential
|
|
27
|
+
// (from `claude setup-token`); stripping it leaves `claude --print` with no usable auth → 401.
|
|
28
|
+
// (The earlier "subscription is file-based" assumption was wrong on macOS — headless needs this token.)
|
|
29
|
+
if (k.startsWith('ANTHROPIC_')) continue
|
|
25
30
|
env[k] = v
|
|
26
31
|
}
|
|
27
32
|
return { ...env, ...extra }
|