@arjunkhera/atlas 0.3.5 → 0.3.7
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/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -0
- package/package.json +1 -1
- package/work/lib/child-env.mjs +14 -0
- package/work/mcp.mjs +6 -2
package/.mcp.json
CHANGED
package/package.json
CHANGED
package/work/lib/child-env.mjs
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
// The variables a program started by Atlas receives: a short list, never the
|
|
2
2
|
// Engram connection, never an ATLAS_WORK_* setting (F11 study, fix one).
|
|
3
3
|
const CHILD_VARIABLES = ['PATH', 'HOME', 'USER', 'LOGNAME', 'LANG', 'LC_ALL', 'TMPDIR', 'XDG_CONFIG_HOME', 'SSL_CERT_FILE', 'SSH_AUTH_SOCK'];
|
|
4
|
+
// A Claude cloud session reaches GitHub only through Claude's own proxy on the
|
|
5
|
+
// loopback address. Its GH_TOKEN is a stand-in that only that proxy turns into
|
|
6
|
+
// a real credential, so `gh` with no proxy gets "Bad credentials". In a cloud
|
|
7
|
+
// session only, a program also receives the proxy variables, and only when the
|
|
8
|
+
// proxy is a loopback address (owner, 7 October 2026: "yes fix it and test").
|
|
9
|
+
const CLOUD_PROXY_VARIABLES = ['HTTPS_PROXY', 'https_proxy'];
|
|
10
|
+
const CLOUD_NO_PROXY_VARIABLES = ['NO_PROXY', 'no_proxy'];
|
|
11
|
+
const LOOPBACK_PROXY = /^http:\/\/(127\.0\.0\.1|localhost|\[::1\]):\d{1,5}\/?$/;
|
|
4
12
|
|
|
5
13
|
export function childEnvironment(env = process.env) {
|
|
6
14
|
const out = {};
|
|
7
15
|
for (const [name, value] of Object.entries(env)) {
|
|
8
16
|
if (CHILD_VARIABLES.includes(name) || name.startsWith('GH_') || name === 'GITHUB_TOKEN') out[name] = value;
|
|
9
17
|
}
|
|
18
|
+
if (env.CLAUDE_CODE_REMOTE === 'true') {
|
|
19
|
+
const proxies = CLOUD_PROXY_VARIABLES.filter((name) => env[name] !== undefined);
|
|
20
|
+
if (proxies.length && proxies.every((name) => LOOPBACK_PROXY.test(env[name]))) {
|
|
21
|
+
for (const name of [...proxies, ...CLOUD_NO_PROXY_VARIABLES]) if (env[name] !== undefined) out[name] = env[name];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
10
24
|
return out;
|
|
11
25
|
}
|
package/work/mcp.mjs
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
// The Engram address and key arrive together, as one setting, in
|
|
9
9
|
// ATLAS_ENGRAM. When that setting arrives empty, the server reads the same
|
|
10
10
|
// value from one owner-only file, ~/.config/atlas/engram-connection (atlas#101:
|
|
11
|
-
// Claude Desktop starts the server with the sensitive setting empty).
|
|
12
|
-
//
|
|
11
|
+
// Claude Desktop starts the server with the sensitive setting empty). In a
|
|
12
|
+
// Claude cloud session only, it reads the cloud environment's own ATLAS_ENGRAM
|
|
13
|
+
// variable first, which .mcp.json passes on as ATLAS_ENGRAM_CLOUD, because the
|
|
14
|
+
// empty plugin setting hides it and a cloud setup script cannot see it. It
|
|
15
|
+
// reads them from nowhere else.
|
|
13
16
|
import { execFileSync } from 'node:child_process';
|
|
14
17
|
import { randomUUID } from 'node:crypto';
|
|
15
18
|
import { resolve, isAbsolute, dirname, join, delimiter } from 'node:path';
|
|
@@ -111,6 +114,7 @@ function readConnectionFile(env) {
|
|
|
111
114
|
}
|
|
112
115
|
export function readConnection(env, { allowLoopbackHttp = false, now = Date.now() } = {}) {
|
|
113
116
|
let raw = unset(env.ATLAS_ENGRAM) ? '' : String(env.ATLAS_ENGRAM).trim();
|
|
117
|
+
if (!raw && inClaudeCloud(env) && !unset(env.ATLAS_ENGRAM_CLOUD)) raw = String(env.ATLAS_ENGRAM_CLOUD).trim();
|
|
114
118
|
if (!raw) {
|
|
115
119
|
const file = readConnectionFile(env);
|
|
116
120
|
if (file.refused) return { state: 'bad', message: `The Engram connection file is refused. ${file.refused}` };
|