@rubytech/create-maxy 0.4.9 → 0.4.10
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/package.json
CHANGED
|
@@ -65,9 +65,9 @@ function writeClaudeCredentials(creds: OAuthCredentials): void {
|
|
|
65
65
|
{ mode: 0o600 },
|
|
66
66
|
)
|
|
67
67
|
|
|
68
|
-
// 3. Set the access token as
|
|
69
|
-
// so the Agent SDK can use it immediately without restarting
|
|
70
|
-
process.env.
|
|
68
|
+
// 3. Set the access token as CLAUDE_CODE_OAUTH_TOKEN in the process environment
|
|
69
|
+
// so Claude Code / the Agent SDK can use it immediately without restarting
|
|
70
|
+
process.env.CLAUDE_CODE_OAUTH_TOKEN = creds.access
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// --- Endpoints ---
|
|
@@ -6,14 +6,15 @@ import { homedir } from "node:os";
|
|
|
6
6
|
const PLATFORM_ROOT = resolve(process.cwd(), "../platform");
|
|
7
7
|
const ACCOUNTS_DIR = resolve(PLATFORM_ROOT, "config/accounts");
|
|
8
8
|
|
|
9
|
-
// Load OAuth token from persistent storage if not already in env
|
|
10
|
-
|
|
9
|
+
// Load OAuth token from persistent storage if not already in env.
|
|
10
|
+
// Claude Code reads CLAUDE_CODE_OAUTH_TOKEN for OAuth access tokens.
|
|
11
|
+
if (!process.env.CLAUDE_CODE_OAUTH_TOKEN) {
|
|
11
12
|
const oauthFile = resolve(homedir(), ".maxy/.claude-oauth.json");
|
|
12
13
|
if (existsSync(oauthFile)) {
|
|
13
14
|
try {
|
|
14
15
|
const creds = JSON.parse(readFileSync(oauthFile, "utf-8"));
|
|
15
16
|
if (creds.accessToken) {
|
|
16
|
-
process.env.
|
|
17
|
+
process.env.CLAUDE_CODE_OAUTH_TOKEN = creds.accessToken;
|
|
17
18
|
}
|
|
18
19
|
} catch { /* ignore */ }
|
|
19
20
|
}
|