claudish 7.63.0 → 7.64.0
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/dist/index.js +50 -15
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
729
729
|
});
|
|
730
730
|
|
|
731
731
|
// src/version.ts
|
|
732
|
-
var VERSION = "7.
|
|
732
|
+
var VERSION = "7.64.0";
|
|
733
733
|
|
|
734
734
|
// src/logger.ts
|
|
735
735
|
var exports_logger = {};
|
|
@@ -35087,7 +35087,7 @@ class OpenAIProviderTransport {
|
|
|
35087
35087
|
}
|
|
35088
35088
|
async getHeaders() {
|
|
35089
35089
|
const headers = {};
|
|
35090
|
-
if (this.apiKey) {
|
|
35090
|
+
if (this.provider.authScheme !== "none" && this.apiKey) {
|
|
35091
35091
|
if (this.provider.authScheme === "x-api-key") {
|
|
35092
35092
|
headers["x-api-key"] = this.apiKey;
|
|
35093
35093
|
} else {
|
|
@@ -40905,6 +40905,8 @@ class ApiKeyCredentialProvider {
|
|
|
40905
40905
|
}
|
|
40906
40906
|
}
|
|
40907
40907
|
async isAvailable(opts) {
|
|
40908
|
+
if (this.authScheme === "none")
|
|
40909
|
+
return true;
|
|
40908
40910
|
if (this.publicKeyFallback)
|
|
40909
40911
|
return true;
|
|
40910
40912
|
if (this.resolveFromEnvConfig())
|
|
@@ -40919,6 +40921,9 @@ class ApiKeyCredentialProvider {
|
|
|
40919
40921
|
this.resolving = undefined;
|
|
40920
40922
|
}
|
|
40921
40923
|
async getRequestAuth(ctx) {
|
|
40924
|
+
if (this.authScheme === "none") {
|
|
40925
|
+
return { headers: { ...this.staticHeaders } };
|
|
40926
|
+
}
|
|
40922
40927
|
const key = await this.resolveKey({ allowOpPrompt: ctx.allowOpPrompt }) || this.publicKeyFallback || "";
|
|
40923
40928
|
let headers;
|
|
40924
40929
|
if (this.authScheme === "x-api-key") {
|
|
@@ -42088,6 +42093,13 @@ __export(exports_authority, {
|
|
|
42088
42093
|
credentials: () => credentials,
|
|
42089
42094
|
CredentialAuthority: () => CredentialAuthority
|
|
42090
42095
|
});
|
|
42096
|
+
function normalizeAuthScheme(scheme) {
|
|
42097
|
+
if (scheme === "x-api-key")
|
|
42098
|
+
return "x-api-key";
|
|
42099
|
+
if (scheme === "none")
|
|
42100
|
+
return "none";
|
|
42101
|
+
return "bearer";
|
|
42102
|
+
}
|
|
42091
42103
|
|
|
42092
42104
|
class CredentialAuthority {
|
|
42093
42105
|
registry = new Map;
|
|
@@ -42104,7 +42116,7 @@ class CredentialAuthority {
|
|
|
42104
42116
|
catalogName: descriptor.name,
|
|
42105
42117
|
envVar: descriptor.envVar,
|
|
42106
42118
|
aliases: descriptor.aliases,
|
|
42107
|
-
authScheme: descriptor.authScheme
|
|
42119
|
+
authScheme: normalizeAuthScheme(descriptor.authScheme),
|
|
42108
42120
|
declaredKey: descriptor.declaredKey
|
|
42109
42121
|
}), [descriptor.name]);
|
|
42110
42122
|
}
|
|
@@ -42177,7 +42189,7 @@ class CredentialAuthority {
|
|
|
42177
42189
|
catalogName: def.name,
|
|
42178
42190
|
envVar: def.apiKeyEnvVar,
|
|
42179
42191
|
aliases: def.apiKeyAliases,
|
|
42180
|
-
authScheme: def.authScheme
|
|
42192
|
+
authScheme: normalizeAuthScheme(def.authScheme),
|
|
42181
42193
|
publicKeyFallback: def.publicKeyFallback,
|
|
42182
42194
|
oauthFallback: def.oauthFallback
|
|
42183
42195
|
}), [def.name, ...RUNTIME_NAME_ALIASES[def.name] ?? []]);
|
|
@@ -43344,7 +43356,7 @@ class AnthropicProviderTransport {
|
|
|
43344
43356
|
const headers = {
|
|
43345
43357
|
"anthropic-version": "2023-06-01"
|
|
43346
43358
|
};
|
|
43347
|
-
if (this.provider.authScheme === "bearer") {
|
|
43359
|
+
if (this.provider.authScheme === "none") {} else if (this.provider.authScheme === "bearer") {
|
|
43348
43360
|
headers.Authorization = `Bearer ${this.apiKey}`;
|
|
43349
43361
|
} else {
|
|
43350
43362
|
headers["x-api-key"] = this.apiKey;
|
|
@@ -45250,7 +45262,27 @@ var init_catalog_client = __esm(() => {
|
|
|
45250
45262
|
});
|
|
45251
45263
|
|
|
45252
45264
|
// src/config-schema.ts
|
|
45253
|
-
|
|
45265
|
+
function requireKeyUnlessNoAuth(ep, ctx) {
|
|
45266
|
+
const declared = ep.apiKey?.trim() ?? "";
|
|
45267
|
+
if (ep.authScheme === "none") {
|
|
45268
|
+
if (declared !== "") {
|
|
45269
|
+
ctx.addIssue({
|
|
45270
|
+
code: "custom",
|
|
45271
|
+
path: ["apiKey"],
|
|
45272
|
+
message: 'authScheme "none" sends no auth header, so apiKey must be omitted. ' + "Remove apiKey, or drop authScheme to send it as a bearer token."
|
|
45273
|
+
});
|
|
45274
|
+
}
|
|
45275
|
+
return;
|
|
45276
|
+
}
|
|
45277
|
+
if (declared === "") {
|
|
45278
|
+
ctx.addIssue({
|
|
45279
|
+
code: "custom",
|
|
45280
|
+
path: ["apiKey"],
|
|
45281
|
+
message: "apiKey is required. If this endpoint needs no credential, set " + '"authScheme": "none" and omit apiKey entirely.'
|
|
45282
|
+
});
|
|
45283
|
+
}
|
|
45284
|
+
}
|
|
45285
|
+
var BuiltinDefaultProviderSchema, CustomEndpointAuthSchemeSchema, CustomEndpointSimpleSchema, CustomEndpointComplexSchema, CustomEndpointSchema, PredefinedEndpointsConfigSchema, DefaultProviderSchema;
|
|
45254
45286
|
var init_config_schema = __esm(() => {
|
|
45255
45287
|
init_zod();
|
|
45256
45288
|
BuiltinDefaultProviderSchema = exports_external.enum([
|
|
@@ -45260,27 +45292,29 @@ var init_config_schema = __esm(() => {
|
|
|
45260
45292
|
"anthropic",
|
|
45261
45293
|
"google"
|
|
45262
45294
|
]);
|
|
45295
|
+
CustomEndpointAuthSchemeSchema = exports_external.enum(["bearer", "x-api-key", "none"]);
|
|
45263
45296
|
CustomEndpointSimpleSchema = exports_external.object({
|
|
45264
45297
|
kind: exports_external.literal("simple"),
|
|
45265
45298
|
url: exports_external.url(),
|
|
45266
45299
|
format: exports_external.enum(["openai", "anthropic"]),
|
|
45267
|
-
apiKey: exports_external.string().
|
|
45300
|
+
apiKey: exports_external.string().optional(),
|
|
45301
|
+
authScheme: CustomEndpointAuthSchemeSchema.optional(),
|
|
45268
45302
|
modelPrefix: exports_external.string().optional(),
|
|
45269
45303
|
models: exports_external.array(exports_external.string()).optional()
|
|
45270
|
-
});
|
|
45304
|
+
}).superRefine(requireKeyUnlessNoAuth);
|
|
45271
45305
|
CustomEndpointComplexSchema = exports_external.object({
|
|
45272
45306
|
kind: exports_external.literal("complex"),
|
|
45273
45307
|
displayName: exports_external.string(),
|
|
45274
45308
|
transport: exports_external.enum(["openai", "anthropic", "gemini", "ollamacloud", "litellm"]),
|
|
45275
45309
|
baseUrl: exports_external.url(),
|
|
45276
45310
|
apiPath: exports_external.string().optional(),
|
|
45277
|
-
apiKey: exports_external.string().
|
|
45278
|
-
authScheme:
|
|
45311
|
+
apiKey: exports_external.string().optional(),
|
|
45312
|
+
authScheme: CustomEndpointAuthSchemeSchema.optional(),
|
|
45279
45313
|
headers: exports_external.record(exports_external.string(), exports_external.string()).optional(),
|
|
45280
45314
|
streamFormat: exports_external.enum(["openai-sse", "openai-responses-sse", "gemini-sse", "anthropic-sse", "ollama-jsonl"]).optional(),
|
|
45281
45315
|
modelPrefix: exports_external.string().optional(),
|
|
45282
45316
|
models: exports_external.array(exports_external.string()).optional()
|
|
45283
|
-
});
|
|
45317
|
+
}).superRefine(requireKeyUnlessNoAuth);
|
|
45284
45318
|
CustomEndpointSchema = exports_external.discriminatedUnion("kind", [
|
|
45285
45319
|
CustomEndpointSimpleSchema,
|
|
45286
45320
|
CustomEndpointComplexSchema
|
|
@@ -45353,7 +45387,7 @@ function registerEndpoint(name, entry, ovr) {
|
|
|
45353
45387
|
name: def.name,
|
|
45354
45388
|
envVar: def.apiKeyEnvVar,
|
|
45355
45389
|
aliases: def.apiKeyAliases,
|
|
45356
|
-
authScheme: def.authScheme
|
|
45390
|
+
authScheme: def.authScheme,
|
|
45357
45391
|
declaredKey: () => resolveDeclaredEndpointKey(validated)
|
|
45358
45392
|
});
|
|
45359
45393
|
clearEndpointUnavailable(name);
|
|
@@ -45404,7 +45438,7 @@ function buildProviderDefinition(name, ep, ovr) {
|
|
|
45404
45438
|
isDirectApi: true,
|
|
45405
45439
|
shortestPrefix: name,
|
|
45406
45440
|
description: ovr?.description ?? `Custom endpoint: ${name}`,
|
|
45407
|
-
authScheme: "bearer"
|
|
45441
|
+
authScheme: ep.authScheme ?? "bearer"
|
|
45408
45442
|
};
|
|
45409
45443
|
}
|
|
45410
45444
|
return {
|
|
@@ -45566,7 +45600,7 @@ function buildComplexHandler(ep, ctx, apiKey, baseUrl) {
|
|
|
45566
45600
|
}
|
|
45567
45601
|
}
|
|
45568
45602
|
function resolveCustomEndpointApiKey(ep) {
|
|
45569
|
-
const literal3 = ep.apiKey;
|
|
45603
|
+
const literal3 = ep.apiKey ?? "";
|
|
45570
45604
|
const match = literal3.match(/^\$\{([A-Z_][A-Z0-9_]*)\}$/i);
|
|
45571
45605
|
if (match) {
|
|
45572
45606
|
return process.env[match[1]] ?? "";
|
|
@@ -52223,7 +52257,8 @@ async function createProxyServer(port, _openrouterApiKey, model, monitorMode = f
|
|
|
52223
52257
|
return null;
|
|
52224
52258
|
}
|
|
52225
52259
|
let apiKey = "";
|
|
52226
|
-
|
|
52260
|
+
const needsNoAuth = resolved.provider.authScheme === "none";
|
|
52261
|
+
if (resolved.provider.apiKeyEnvVar && !needsNoAuth) {
|
|
52227
52262
|
if (!credentials.get(resolved.provider.name)) {
|
|
52228
52263
|
logStderr(`[Proxy] No credential provider registered for "${resolved.provider.name}" \u2014 treating as missing credential (authority registration gap)`);
|
|
52229
52264
|
log(`[Proxy] Credential authority has no provider registered under "${resolved.provider.name}"`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.64.0",
|
|
4
4
|
"description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"ai"
|
|
61
61
|
],
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"@claudish/magmux-darwin-arm64": "7.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "7.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "7.
|
|
66
|
-
"@claudish/magmux-linux-x64": "7.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "7.64.0",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.64.0",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.64.0",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.64.0"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|