klaudiak 2.1.89 → 2.1.90
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/klaudiak.js +24 -0
- package/package.json +1 -1
package/klaudiak.js
CHANGED
|
@@ -268,6 +268,30 @@ function runAgent(argv) {
|
|
|
268
268
|
env.ANTHROPIC_BASE_URL = profile.anthropicBaseUrl || 'http://localhost:9090';
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
// Force API-key mode for local proxy sessions so the CLI does not fall back
|
|
272
|
+
// to OAuth/login when no Anthropic credentials are configured.
|
|
273
|
+
if (
|
|
274
|
+
env.ANTHROPIC_BASE_URL &&
|
|
275
|
+
/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?(\/|$)/i.test(env.ANTHROPIC_BASE_URL) &&
|
|
276
|
+
!env.ANTHROPIC_API_KEY &&
|
|
277
|
+
!env.CLAUDE_CODE_OAUTH_TOKEN &&
|
|
278
|
+
!env.ANTHROPIC_AUTH_TOKEN
|
|
279
|
+
) {
|
|
280
|
+
// Some bundled CLI builds derive auth status from different env variables.
|
|
281
|
+
// Set all local-only placeholders so proxy sessions never fall into /login.
|
|
282
|
+
env.ANTHROPIC_API_KEY = 'local-proxy-key';
|
|
283
|
+
env.CLAUDE_CODE_OAUTH_TOKEN = 'local-proxy-oauth';
|
|
284
|
+
env.ANTHROPIC_AUTH_TOKEN = 'local-proxy-auth';
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (
|
|
288
|
+
env.ANTHROPIC_BASE_URL &&
|
|
289
|
+
/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?(\/|$)/i.test(env.ANTHROPIC_BASE_URL) &&
|
|
290
|
+
!forwardArgs.includes('--bare')
|
|
291
|
+
) {
|
|
292
|
+
forwardArgs.unshift('--bare');
|
|
293
|
+
}
|
|
294
|
+
|
|
271
295
|
spawnNode(join(__dirname, 'cli.js'), forwardArgs, env);
|
|
272
296
|
}
|
|
273
297
|
|