claudish 7.7.3 → 7.7.4
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 +57 -10
- 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.7.
|
|
584
|
+
var VERSION = "7.7.4";
|
|
585
585
|
|
|
586
586
|
// src/providers/onepassword-wasm.ts
|
|
587
587
|
var exports_onepassword_wasm = {};
|
|
@@ -3043,6 +3043,7 @@ __export(exports_onepassword, {
|
|
|
3043
3043
|
valueTail: () => valueTail,
|
|
3044
3044
|
resolveSecrets: () => resolveSecrets,
|
|
3045
3045
|
resolveSdkAuth: () => resolveSdkAuth,
|
|
3046
|
+
resolveGlobImportForEnvVars: () => resolveGlobImportForEnvVars,
|
|
3046
3047
|
resolveGlobImport: () => resolveGlobImport,
|
|
3047
3048
|
resolveDesktopAccount: () => resolveDesktopAccount,
|
|
3048
3049
|
resetSdkClientCache: () => resetSdkClientCache,
|
|
@@ -3243,6 +3244,35 @@ async function resolveGlobImport(opPath, opts = {}) {
|
|
|
3243
3244
|
env: opts.env
|
|
3244
3245
|
});
|
|
3245
3246
|
}
|
|
3247
|
+
async function resolveGlobImportForEnvVars(opPath, envNames, opts = {}) {
|
|
3248
|
+
const wanted = new Set(envNames);
|
|
3249
|
+
if (wanted.size === 0)
|
|
3250
|
+
return {};
|
|
3251
|
+
const warn = opts.warn ?? ((m) => console.error(m));
|
|
3252
|
+
const glob = parseGlobImport(opPath);
|
|
3253
|
+
const fields = await discoverItemFields(glob.vault, glob.item, {
|
|
3254
|
+
sdkFactory: opts.sdkFactory,
|
|
3255
|
+
auth: opts.auth,
|
|
3256
|
+
env: opts.env,
|
|
3257
|
+
warn
|
|
3258
|
+
});
|
|
3259
|
+
const matches = filterGlobFields(fields, glob);
|
|
3260
|
+
const refMap = {};
|
|
3261
|
+
for (const m of matches) {
|
|
3262
|
+
if (!m.valid)
|
|
3263
|
+
continue;
|
|
3264
|
+
if (!wanted.has(m.envName))
|
|
3265
|
+
continue;
|
|
3266
|
+
refMap[m.envName] = m.field.reference;
|
|
3267
|
+
}
|
|
3268
|
+
if (Object.keys(refMap).length === 0)
|
|
3269
|
+
return {};
|
|
3270
|
+
return resolveSecrets(refMap, {
|
|
3271
|
+
sdkFactory: opts.sdkFactory,
|
|
3272
|
+
auth: opts.auth,
|
|
3273
|
+
env: opts.env
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3246
3276
|
function envNameFromOpRef(opRef) {
|
|
3247
3277
|
if (typeof opRef !== "string" || !opRef.startsWith("op://"))
|
|
3248
3278
|
return null;
|
|
@@ -70139,7 +70169,7 @@ async function applyOpImport() {
|
|
|
70139
70169
|
}
|
|
70140
70170
|
process.argv = [...head, ...rebuilt];
|
|
70141
70171
|
}
|
|
70142
|
-
async function loadStoredApiKeys() {
|
|
70172
|
+
async function loadStoredApiKeys(neededEnvVars) {
|
|
70143
70173
|
let opRefs = {};
|
|
70144
70174
|
let globImports = [];
|
|
70145
70175
|
let apiKeysForSeed;
|
|
@@ -70171,11 +70201,19 @@ async function loadStoredApiKeys() {
|
|
|
70171
70201
|
for (const w of collected.warnings)
|
|
70172
70202
|
console.error(w);
|
|
70173
70203
|
} catch {}
|
|
70204
|
+
if (neededEnvVars) {
|
|
70205
|
+
const filteredRefs = {};
|
|
70206
|
+
for (const [envVar, ref] of Object.entries(opRefs)) {
|
|
70207
|
+
if (neededEnvVars.has(envVar))
|
|
70208
|
+
filteredRefs[envVar] = ref;
|
|
70209
|
+
}
|
|
70210
|
+
opRefs = filteredRefs;
|
|
70211
|
+
}
|
|
70174
70212
|
const refKeys = Object.keys(opRefs);
|
|
70175
70213
|
if (refKeys.length === 0 && globImports.length === 0)
|
|
70176
70214
|
return;
|
|
70177
70215
|
try {
|
|
70178
|
-
const { resolveSecrets: resolveSecrets2, resolveGlobImport: resolveGlobImport2 } = await Promise.resolve().then(() => (init_onepassword(), exports_onepassword));
|
|
70216
|
+
const { resolveSecrets: resolveSecrets2, resolveGlobImport: resolveGlobImport2, resolveGlobImportForEnvVars: resolveGlobImportForEnvVars2 } = await Promise.resolve().then(() => (init_onepassword(), exports_onepassword));
|
|
70179
70217
|
const auth = await getSdkAuth();
|
|
70180
70218
|
if (refKeys.length > 0) {
|
|
70181
70219
|
const resolved = await resolveSecrets2(opRefs, { auth });
|
|
@@ -70185,7 +70223,10 @@ async function loadStoredApiKeys() {
|
|
|
70185
70223
|
}
|
|
70186
70224
|
for (const globPath of globImports) {
|
|
70187
70225
|
try {
|
|
70188
|
-
const resolved = await
|
|
70226
|
+
const resolved = neededEnvVars ? await resolveGlobImportForEnvVars2(globPath, neededEnvVars, {
|
|
70227
|
+
auth,
|
|
70228
|
+
warn: () => {}
|
|
70229
|
+
}) : await resolveGlobImport2(globPath, {
|
|
70189
70230
|
auth,
|
|
70190
70231
|
warn: () => {}
|
|
70191
70232
|
});
|
|
@@ -70205,7 +70246,7 @@ async function loadStoredApiKeys() {
|
|
|
70205
70246
|
process.exit(1);
|
|
70206
70247
|
}
|
|
70207
70248
|
}
|
|
70208
|
-
async function applyCustomEndpointOpKeys() {
|
|
70249
|
+
async function applyCustomEndpointOpKeys(neededEnvVars) {
|
|
70209
70250
|
let refs = {};
|
|
70210
70251
|
try {
|
|
70211
70252
|
const configPath = join29(homedir27(), ".claudish", "config.json");
|
|
@@ -70223,6 +70264,8 @@ async function applyCustomEndpointOpKeys() {
|
|
|
70223
70264
|
if (typeof apiKey !== "string" || !isOpReference2(apiKey))
|
|
70224
70265
|
continue;
|
|
70225
70266
|
const envVar = `CUSTOM_${name.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_KEY`;
|
|
70267
|
+
if (neededEnvVars && !neededEnvVars.has(envVar))
|
|
70268
|
+
continue;
|
|
70226
70269
|
if (process.env[envVar])
|
|
70227
70270
|
continue;
|
|
70228
70271
|
refs[envVar] = apiKey;
|
|
@@ -70248,12 +70291,12 @@ async function applyCustomEndpointOpKeys() {
|
|
|
70248
70291
|
await applyOpEnvironment();
|
|
70249
70292
|
await applyOpImport();
|
|
70250
70293
|
var opHydrated = false;
|
|
70251
|
-
async function hydrateOpSecrets() {
|
|
70294
|
+
async function hydrateOpSecrets(neededEnvVars) {
|
|
70252
70295
|
if (opHydrated)
|
|
70253
70296
|
return;
|
|
70254
70297
|
opHydrated = true;
|
|
70255
|
-
await loadStoredApiKeys();
|
|
70256
|
-
await applyCustomEndpointOpKeys();
|
|
70298
|
+
await loadStoredApiKeys(neededEnvVars);
|
|
70299
|
+
await applyCustomEndpointOpKeys(neededEnvVars);
|
|
70257
70300
|
}
|
|
70258
70301
|
var isMcpMode = process.argv.includes("--mcp");
|
|
70259
70302
|
function handlePromptExit(err) {
|
|
@@ -70337,7 +70380,6 @@ if (isMcpMode) {
|
|
|
70337
70380
|
runCli();
|
|
70338
70381
|
}
|
|
70339
70382
|
async function runCli() {
|
|
70340
|
-
await hydrateOpSecrets();
|
|
70341
70383
|
const { checkClaudeInstalled: checkClaudeInstalled2, runClaudeWithProxy: runClaudeWithProxy2 } = await Promise.resolve().then(() => (init_claude_runner(), exports_claude_runner));
|
|
70342
70384
|
const { parseArgs: parseArgs2, getVersion: getVersion4 } = await Promise.resolve().then(() => (init_cli(), exports_cli));
|
|
70343
70385
|
const { DEFAULT_PORT_RANGE: DEFAULT_PORT_RANGE2 } = await Promise.resolve().then(() => (init_config(), exports_config));
|
|
@@ -70495,7 +70537,12 @@ Team Status`);
|
|
|
70495
70537
|
cliConfig.modelHaiku,
|
|
70496
70538
|
cliConfig.modelSubagent
|
|
70497
70539
|
];
|
|
70498
|
-
|
|
70540
|
+
let resolutions = validateApiKeysForModels2(modelsToValidate);
|
|
70541
|
+
const neededEnvVars = new Set(getMissingKeyResolutions2(resolutions).map((r) => r.requiredApiKeyEnvVar).filter((v) => typeof v === "string" && v.length > 0));
|
|
70542
|
+
if (neededEnvVars.size > 0) {
|
|
70543
|
+
await hydrateOpSecrets(neededEnvVars);
|
|
70544
|
+
resolutions = validateApiKeysForModels2(modelsToValidate);
|
|
70545
|
+
}
|
|
70499
70546
|
const missingKeys = getMissingKeyResolutions2(resolutions);
|
|
70500
70547
|
if (missingKeys.length > 0) {
|
|
70501
70548
|
if (cliConfig.interactive) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.4",
|
|
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.7.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "7.7.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "7.7.
|
|
66
|
-
"@claudish/magmux-linux-x64": "7.7.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "7.7.4",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.7.4",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.7.4",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.7.4"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|