@onklave/agent-cli 0.1.40 → 0.1.41
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/main.js +12 -1
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -354,6 +354,7 @@ var ConfigResolver = class {
|
|
|
354
354
|
headless: false,
|
|
355
355
|
dryRun: false,
|
|
356
356
|
apiKey: null,
|
|
357
|
+
oauthToken: null,
|
|
357
358
|
apiEndpoint: DEFAULT_PLATFORM_URL2,
|
|
358
359
|
platformUrl: DEFAULT_PLATFORM_URL2,
|
|
359
360
|
orgId: null,
|
|
@@ -417,6 +418,8 @@ var ConfigResolver = class {
|
|
|
417
418
|
fromEnv.orgId = process.env["ONKLAVE_ORG_ID"];
|
|
418
419
|
if (process.env["ANTHROPIC_API_KEY"])
|
|
419
420
|
fromEnv.apiKey = process.env["ANTHROPIC_API_KEY"];
|
|
421
|
+
if (process.env["CLAUDE_CODE_OAUTH_TOKEN"])
|
|
422
|
+
fromEnv.oauthToken = process.env["CLAUDE_CODE_OAUTH_TOKEN"];
|
|
420
423
|
const fromFlags = {};
|
|
421
424
|
if (typeof flags["task"] === "string") fromFlags.task = flags["task"];
|
|
422
425
|
if (typeof flags["context"] === "string")
|
|
@@ -911,7 +914,10 @@ var SessionManager = class {
|
|
|
911
914
|
args.push("--append-system-prompt", config.systemPromptAppend);
|
|
912
915
|
}
|
|
913
916
|
const env = { ...process.env };
|
|
914
|
-
if (config.
|
|
917
|
+
if (config.oauthToken) {
|
|
918
|
+
env["CLAUDE_CODE_OAUTH_TOKEN"] = config.oauthToken;
|
|
919
|
+
delete env["ANTHROPIC_API_KEY"];
|
|
920
|
+
} else if (config.apiKey) {
|
|
915
921
|
env["ANTHROPIC_API_KEY"] = config.apiKey;
|
|
916
922
|
}
|
|
917
923
|
const child = spawn("claude", args, {
|
|
@@ -2097,6 +2103,7 @@ async function runCommand(args) {
|
|
|
2097
2103
|
deniedTools: resolvedConfig.deniedTools,
|
|
2098
2104
|
addDirs,
|
|
2099
2105
|
apiKey: resolvedConfig.apiKey,
|
|
2106
|
+
oauthToken: resolvedConfig.oauthToken,
|
|
2100
2107
|
headless: resolvedConfig.headless,
|
|
2101
2108
|
platformUrl: resolvedConfig.platformUrl,
|
|
2102
2109
|
orgId: resolvedConfig.orgId,
|
|
@@ -3513,6 +3520,9 @@ var WorkItemRunner = class {
|
|
|
3513
3520
|
deniedTools: [],
|
|
3514
3521
|
addDirs,
|
|
3515
3522
|
apiKey: null,
|
|
3523
|
+
// Honour a Claude Pro/Max subscription token if the runner was started
|
|
3524
|
+
// with one; otherwise Claude Code falls back to ambient ANTHROPIC_API_KEY.
|
|
3525
|
+
oauthToken: process.env["CLAUDE_CODE_OAUTH_TOKEN"] ?? null,
|
|
3516
3526
|
headless: true,
|
|
3517
3527
|
platformUrl: "",
|
|
3518
3528
|
orgId: null,
|
|
@@ -3685,6 +3695,7 @@ var DaemonSpawner = class {
|
|
|
3685
3695
|
allowedTools: [],
|
|
3686
3696
|
deniedTools: [],
|
|
3687
3697
|
apiKey: req.apiKey ?? null,
|
|
3698
|
+
oauthToken: process.env["CLAUDE_CODE_OAUTH_TOKEN"] ?? null,
|
|
3688
3699
|
headless: true,
|
|
3689
3700
|
platformUrl: this.platformUrl,
|
|
3690
3701
|
orgId: req.orgId,
|