claudish 7.12.1 → 7.12.3
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 +48 -36
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -581,7 +581,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
581
581
|
});
|
|
582
582
|
|
|
583
583
|
// src/version.ts
|
|
584
|
-
var VERSION = "7.12.
|
|
584
|
+
var VERSION = "7.12.3";
|
|
585
585
|
|
|
586
586
|
// src/logger.ts
|
|
587
587
|
var exports_logger = {};
|
|
@@ -3716,7 +3716,8 @@ async function discoverItemFields(vault, item, opts = {}) {
|
|
|
3716
3716
|
reference,
|
|
3717
3717
|
type: typeof field.fieldType === "string" ? field.fieldType : String(field.fieldType ?? ""),
|
|
3718
3718
|
hasValue: !!field.value,
|
|
3719
|
-
valueTail: valueTail(field.value)
|
|
3719
|
+
valueTail: valueTail(field.value),
|
|
3720
|
+
value: opts.captureValues && typeof field.value === "string" ? field.value : undefined
|
|
3720
3721
|
});
|
|
3721
3722
|
}
|
|
3722
3723
|
return out;
|
|
@@ -3786,26 +3787,26 @@ async function resolveGlobImport(opPath, opts = {}) {
|
|
|
3786
3787
|
sdkFactory: opts.sdkFactory,
|
|
3787
3788
|
auth: opts.auth,
|
|
3788
3789
|
env: opts.env,
|
|
3789
|
-
warn
|
|
3790
|
+
warn,
|
|
3791
|
+
captureValues: true
|
|
3790
3792
|
});
|
|
3791
3793
|
const matches = filterGlobFields(fields, glob);
|
|
3792
|
-
const
|
|
3794
|
+
const resolved = {};
|
|
3795
|
+
let importable = 0;
|
|
3793
3796
|
for (const m of matches) {
|
|
3794
3797
|
if (!m.valid) {
|
|
3795
3798
|
warn(`[claudish] skipped 1Password field '${m.field.label}' (not a valid env var name)`);
|
|
3796
3799
|
continue;
|
|
3797
3800
|
}
|
|
3798
|
-
|
|
3801
|
+
importable++;
|
|
3802
|
+
if (typeof m.field.value === "string")
|
|
3803
|
+
resolved[m.envName] = m.field.value;
|
|
3799
3804
|
}
|
|
3800
|
-
if (
|
|
3805
|
+
if (importable === 0) {
|
|
3801
3806
|
const available = fields.map((f) => f.label.trim()).filter((l) => l !== "").slice(0, 8);
|
|
3802
3807
|
throw new Error(`1Password glob '${opPath}' matched no importable fields in '${glob.item}'. ` + `Available field labels include: ${available.join(", ") || "(none)"}.`);
|
|
3803
3808
|
}
|
|
3804
|
-
return
|
|
3805
|
-
sdkFactory: opts.sdkFactory,
|
|
3806
|
-
auth: opts.auth,
|
|
3807
|
-
env: opts.env
|
|
3808
|
-
});
|
|
3809
|
+
return resolved;
|
|
3809
3810
|
}
|
|
3810
3811
|
async function resolveGlobImportAll(opPath, opts = {}) {
|
|
3811
3812
|
const warn = opts.warn ?? ((m) => console.error(m));
|
|
@@ -3814,24 +3815,16 @@ async function resolveGlobImportAll(opPath, opts = {}) {
|
|
|
3814
3815
|
sdkFactory: opts.sdkFactory,
|
|
3815
3816
|
auth: opts.auth,
|
|
3816
3817
|
env: opts.env,
|
|
3817
|
-
warn
|
|
3818
|
+
warn,
|
|
3819
|
+
captureValues: true
|
|
3818
3820
|
});
|
|
3819
3821
|
const matches = filterGlobFields(fields, glob);
|
|
3820
|
-
const
|
|
3822
|
+
const resolved = {};
|
|
3821
3823
|
for (const m of matches) {
|
|
3822
3824
|
if (!m.valid)
|
|
3823
3825
|
continue;
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
if (Object.keys(refMap).length === 0)
|
|
3827
|
-
return {};
|
|
3828
|
-
const { resolved, failures } = await resolveSecretsPartial(refMap, {
|
|
3829
|
-
sdkFactory: opts.sdkFactory,
|
|
3830
|
-
auth: opts.auth,
|
|
3831
|
-
env: opts.env
|
|
3832
|
-
});
|
|
3833
|
-
for (const f of failures) {
|
|
3834
|
-
warn(`[claudish] 1Password glob field could not be resolved (skipped): ${f}`);
|
|
3826
|
+
if (typeof m.field.value === "string")
|
|
3827
|
+
resolved[m.envName] = m.field.value;
|
|
3835
3828
|
}
|
|
3836
3829
|
return resolved;
|
|
3837
3830
|
}
|
|
@@ -3845,24 +3838,20 @@ async function resolveGlobImportForEnvVars(opPath, envNames, opts = {}) {
|
|
|
3845
3838
|
sdkFactory: opts.sdkFactory,
|
|
3846
3839
|
auth: opts.auth,
|
|
3847
3840
|
env: opts.env,
|
|
3848
|
-
warn
|
|
3841
|
+
warn,
|
|
3842
|
+
captureValues: true
|
|
3849
3843
|
});
|
|
3850
3844
|
const matches = filterGlobFields(fields, glob);
|
|
3851
|
-
const
|
|
3845
|
+
const resolved = {};
|
|
3852
3846
|
for (const m of matches) {
|
|
3853
3847
|
if (!m.valid)
|
|
3854
3848
|
continue;
|
|
3855
3849
|
if (!wanted.has(m.envName))
|
|
3856
3850
|
continue;
|
|
3857
|
-
|
|
3851
|
+
if (typeof m.field.value === "string")
|
|
3852
|
+
resolved[m.envName] = m.field.value;
|
|
3858
3853
|
}
|
|
3859
|
-
|
|
3860
|
-
return {};
|
|
3861
|
-
return resolveSecrets(refMap, {
|
|
3862
|
-
sdkFactory: opts.sdkFactory,
|
|
3863
|
-
auth: opts.auth,
|
|
3864
|
-
env: opts.env
|
|
3865
|
-
});
|
|
3854
|
+
return resolved;
|
|
3866
3855
|
}
|
|
3867
3856
|
function envNameFromOpRef(opRef) {
|
|
3868
3857
|
if (typeof opRef !== "string" || !opRef.startsWith("op://"))
|
|
@@ -31414,10 +31403,15 @@ var init_codex_api_format = __esm(() => {
|
|
|
31414
31403
|
return value;
|
|
31415
31404
|
}
|
|
31416
31405
|
acceptsXhigh() {
|
|
31417
|
-
|
|
31406
|
+
const m = this.modelId.toLowerCase();
|
|
31407
|
+
return /codex.*max/.test(m) || /gpt-5\.6/.test(m);
|
|
31408
|
+
}
|
|
31409
|
+
acceptsMax() {
|
|
31410
|
+
return /gpt-5\.6/.test(this.modelId.toLowerCase());
|
|
31418
31411
|
}
|
|
31419
31412
|
isCodex51Plus() {
|
|
31420
|
-
|
|
31413
|
+
const m = this.modelId.toLowerCase();
|
|
31414
|
+
return /gpt-5\.[1-9].*codex/.test(m) || /gpt-5\.6/.test(m);
|
|
31421
31415
|
}
|
|
31422
31416
|
clampCodexEffort(level) {
|
|
31423
31417
|
switch (level) {
|
|
@@ -31432,6 +31426,8 @@ var init_codex_api_format = __esm(() => {
|
|
|
31432
31426
|
case "xhigh":
|
|
31433
31427
|
return this.acceptsXhigh() ? "xhigh" : "high";
|
|
31434
31428
|
case "max":
|
|
31429
|
+
if (this.acceptsMax())
|
|
31430
|
+
return "max";
|
|
31435
31431
|
return this.acceptsXhigh() ? "xhigh" : "high";
|
|
31436
31432
|
default:
|
|
31437
31433
|
return "medium";
|
|
@@ -41869,6 +41865,9 @@ var init_vertex_oauth = __esm(() => {
|
|
|
41869
41865
|
});
|
|
41870
41866
|
|
|
41871
41867
|
// src/providers/provider-profiles.ts
|
|
41868
|
+
function requiresResponsesApi(modelName) {
|
|
41869
|
+
return /^gpt-5\.6/.test(modelName.toLowerCase());
|
|
41870
|
+
}
|
|
41872
41871
|
function createHandlerForProvider(ctx) {
|
|
41873
41872
|
const profile = PROVIDER_PROFILES[ctx.provider.name] ?? getRuntimeProfiles().get(ctx.provider.name);
|
|
41874
41873
|
if (!profile) {
|
|
@@ -41931,6 +41930,18 @@ var init_provider_profiles = __esm(() => {
|
|
|
41931
41930
|
};
|
|
41932
41931
|
openaiProfile = {
|
|
41933
41932
|
createHandler(ctx) {
|
|
41933
|
+
if (requiresResponsesApi(ctx.modelName)) {
|
|
41934
|
+
const responsesProvider = { ...ctx.provider, apiPath: "/v1/responses" };
|
|
41935
|
+
const transport2 = new OpenAIProviderTransport(responsesProvider, ctx.modelName, ctx.apiKey);
|
|
41936
|
+
const adapter2 = new CodexAPIFormat(ctx.modelName);
|
|
41937
|
+
const handler2 = new ComposedHandler(transport2, ctx.targetModel, ctx.modelName, ctx.port, {
|
|
41938
|
+
adapter: adapter2,
|
|
41939
|
+
tokenStrategy: "delta-aware",
|
|
41940
|
+
...ctx.sharedOpts
|
|
41941
|
+
});
|
|
41942
|
+
log(`[Proxy] Created OpenAI handler (Responses API composed): ${ctx.modelName}`);
|
|
41943
|
+
return handler2;
|
|
41944
|
+
}
|
|
41934
41945
|
const transport = new OpenAIProviderTransport(ctx.provider, ctx.modelName, ctx.apiKey);
|
|
41935
41946
|
const adapter = new OpenAIAPIFormat(ctx.modelName);
|
|
41936
41947
|
const handler = new ComposedHandler(transport, ctx.targetModel, ctx.modelName, ctx.port, {
|
|
@@ -43966,6 +43977,7 @@ ${plan.hint}` : `[Route] ${plan.reason}`;
|
|
|
43966
43977
|
app.post("/v1/messages", async (c) => {
|
|
43967
43978
|
try {
|
|
43968
43979
|
const body = await c.req.json();
|
|
43980
|
+
log(`[RequestMeta] model=${body.model} output_config=${JSON.stringify(body.output_config) ?? "(none)"} metadata=${JSON.stringify(body.metadata) ?? "(none)"} anthropic-beta=${c.req.header("anthropic-beta") ?? "(none)"}`);
|
|
43969
43981
|
const handler = await getHandlerForRequest(body.model);
|
|
43970
43982
|
return handler.handle(c, body);
|
|
43971
43983
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.12.
|
|
3
|
+
"version": "7.12.3",
|
|
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.12.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "7.12.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "7.12.
|
|
66
|
-
"@claudish/magmux-linux-x64": "7.12.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "7.12.3",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.12.3",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.12.3",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.12.3"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|