claudish 7.12.5 → 7.12.7
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 +77 -18
- 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.7";
|
|
585
585
|
|
|
586
586
|
// src/logger.ts
|
|
587
587
|
var exports_logger = {};
|
|
@@ -38149,6 +38149,7 @@ function createResponsesStreamHandler(c, response, opts) {
|
|
|
38149
38149
|
let textIdx = -1;
|
|
38150
38150
|
let reasoningIdx = -1;
|
|
38151
38151
|
let lastSummaryIndex = -1;
|
|
38152
|
+
let incompleteReason = null;
|
|
38152
38153
|
let inputTokens = 0;
|
|
38153
38154
|
let outputTokens = 0;
|
|
38154
38155
|
let hasToolUse = false;
|
|
@@ -38319,7 +38320,8 @@ data: ${JSON.stringify(data)}
|
|
|
38319
38320
|
}
|
|
38320
38321
|
}
|
|
38321
38322
|
} else if (event.type === "response.incomplete") {
|
|
38322
|
-
|
|
38323
|
+
incompleteReason = event.response?.incomplete_details?.reason ?? event.reason ?? "unknown";
|
|
38324
|
+
log(`[ResponsesSSE] Response incomplete: ${incompleteReason}`);
|
|
38323
38325
|
if (event.response?.usage) {
|
|
38324
38326
|
inputTokens = event.response.usage.input_tokens || inputTokens;
|
|
38325
38327
|
outputTokens = event.response.usage.output_tokens || outputTokens;
|
|
@@ -38382,7 +38384,10 @@ data: ${JSON.stringify(data)}
|
|
|
38382
38384
|
closeReasoning();
|
|
38383
38385
|
closeText();
|
|
38384
38386
|
closeTools();
|
|
38385
|
-
const stopReason = hasToolUse ? "tool_use" : "end_turn";
|
|
38387
|
+
const stopReason = incompleteReason ? incompleteReason === "content_filter" ? "refusal" : "max_tokens" : hasToolUse ? "tool_use" : "end_turn";
|
|
38388
|
+
if (incompleteReason) {
|
|
38389
|
+
log(`[ResponsesSSE] Truncated response (${incompleteReason}) \u2192 stop_reason=${stopReason}`);
|
|
38390
|
+
}
|
|
38386
38391
|
send("message_delta", {
|
|
38387
38392
|
type: "message_delta",
|
|
38388
38393
|
delta: { stop_reason: stopReason, stop_sequence: null },
|
|
@@ -63860,6 +63865,7 @@ var init_cli = __esm(() => {
|
|
|
63860
63865
|
// src/update-checker.ts
|
|
63861
63866
|
var exports_update_checker = {};
|
|
63862
63867
|
__export(exports_update_checker, {
|
|
63868
|
+
fetchLatestVersionOrThrow: () => fetchLatestVersionOrThrow,
|
|
63863
63869
|
fetchLatestVersion: () => fetchLatestVersion,
|
|
63864
63870
|
compareVersions: () => compareVersions,
|
|
63865
63871
|
clearCache: () => clearCache,
|
|
@@ -63932,20 +63938,39 @@ function compareVersions(v1, v2) {
|
|
|
63932
63938
|
}
|
|
63933
63939
|
return 0;
|
|
63934
63940
|
}
|
|
63935
|
-
async function
|
|
63936
|
-
|
|
63941
|
+
async function fetchLatestVersionOrThrow(options = {}) {
|
|
63942
|
+
const { timeoutMs = 5000, retries = 0 } = options;
|
|
63943
|
+
let lastError = new Error("unknown error");
|
|
63944
|
+
for (let attempt = 0;attempt <= retries; attempt++) {
|
|
63937
63945
|
const controller = new AbortController;
|
|
63938
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
63939
|
-
|
|
63940
|
-
|
|
63941
|
-
|
|
63942
|
-
|
|
63943
|
-
|
|
63944
|
-
|
|
63945
|
-
|
|
63946
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
63947
|
+
try {
|
|
63948
|
+
const response = await fetch(NPM_REGISTRY_URL, {
|
|
63949
|
+
signal: controller.signal,
|
|
63950
|
+
headers: { Accept: "application/json" }
|
|
63951
|
+
});
|
|
63952
|
+
if (!response.ok) {
|
|
63953
|
+
throw new Error(`npm registry returned HTTP ${response.status}`);
|
|
63954
|
+
}
|
|
63955
|
+
const data = await response.json();
|
|
63956
|
+
if (!data.version) {
|
|
63957
|
+
throw new Error("npm registry response contained no version field");
|
|
63958
|
+
}
|
|
63959
|
+
return data.version;
|
|
63960
|
+
} catch (error46) {
|
|
63961
|
+
lastError = error46 instanceof Error && error46.name === "AbortError" ? new Error(`request timed out after ${timeoutMs}ms`) : error46 instanceof Error ? error46 : new Error(String(error46));
|
|
63962
|
+
if (attempt < retries) {
|
|
63963
|
+
await new Promise((resolve3) => setTimeout(resolve3, 300 * (attempt + 1)));
|
|
63964
|
+
}
|
|
63965
|
+
} finally {
|
|
63966
|
+
clearTimeout(timeout);
|
|
63946
63967
|
}
|
|
63947
|
-
|
|
63948
|
-
|
|
63968
|
+
}
|
|
63969
|
+
throw lastError;
|
|
63970
|
+
}
|
|
63971
|
+
async function fetchLatestVersion(options = {}) {
|
|
63972
|
+
try {
|
|
63973
|
+
return await fetchLatestVersionOrThrow(options);
|
|
63949
63974
|
} catch {
|
|
63950
63975
|
return null;
|
|
63951
63976
|
}
|
|
@@ -64146,16 +64171,50 @@ ${BOLD2}Unable to detect installation method.${RESET2}`);
|
|
|
64146
64171
|
console.log(` ${CYAN2}brew:${RESET2} brew upgrade claudish
|
|
64147
64172
|
`);
|
|
64148
64173
|
}
|
|
64174
|
+
function fetchLatestVersionViaNpm() {
|
|
64175
|
+
try {
|
|
64176
|
+
const output = execSync("npm view claudish version", {
|
|
64177
|
+
encoding: "utf-8",
|
|
64178
|
+
timeout: 20000,
|
|
64179
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
64180
|
+
});
|
|
64181
|
+
const version2 = output.trim();
|
|
64182
|
+
return /^\d+\.\d+\.\d+/.test(version2) ? version2 : null;
|
|
64183
|
+
} catch {
|
|
64184
|
+
return null;
|
|
64185
|
+
}
|
|
64186
|
+
}
|
|
64187
|
+
async function resolveLatestVersion() {
|
|
64188
|
+
let fetchError;
|
|
64189
|
+
try {
|
|
64190
|
+
return { version: await fetchLatestVersionOrThrow({ timeoutMs: 15000, retries: 2 }) };
|
|
64191
|
+
} catch (error46) {
|
|
64192
|
+
fetchError = error46 instanceof Error ? error46.message : String(error46);
|
|
64193
|
+
}
|
|
64194
|
+
const viaNpm = fetchLatestVersionViaNpm();
|
|
64195
|
+
if (viaNpm)
|
|
64196
|
+
return { version: viaNpm };
|
|
64197
|
+
return { error: fetchError };
|
|
64198
|
+
}
|
|
64149
64199
|
async function updateCommand() {
|
|
64150
64200
|
const currentVersion = getVersion3();
|
|
64151
64201
|
const installInfo = detectInstallationMethod();
|
|
64152
|
-
const
|
|
64153
|
-
if (
|
|
64202
|
+
const result = await resolveLatestVersion();
|
|
64203
|
+
if ("error" in result) {
|
|
64154
64204
|
console.error(`${RED2}\u2717${RESET2} Unable to fetch latest version from npm registry.`);
|
|
64155
|
-
console.error(`${
|
|
64205
|
+
console.error(`${DIM2}Reason: ${result.error}${RESET2}`);
|
|
64206
|
+
console.error(`${YELLOW}The npm registry may be slow or unreachable from this network.${RESET2}`);
|
|
64207
|
+
const manualCommand = getUpdateCommand(installInfo.method);
|
|
64208
|
+
if (manualCommand) {
|
|
64209
|
+
console.error(`${YELLOW}You can update manually:${RESET2}`);
|
|
64210
|
+
console.error(` ${CYAN2}${manualCommand}${RESET2}
|
|
64156
64211
|
`);
|
|
64212
|
+
} else {
|
|
64213
|
+
printManualInstructions();
|
|
64214
|
+
}
|
|
64157
64215
|
process.exit(1);
|
|
64158
64216
|
}
|
|
64217
|
+
const latestVersion = result.version;
|
|
64159
64218
|
const comparison = compareVersions(latestVersion, currentVersion);
|
|
64160
64219
|
if (comparison <= 0) {
|
|
64161
64220
|
console.log(`${GREEN2}\u2713${RESET2} ${BOLD2}Already up-to-date!${RESET2}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.12.
|
|
3
|
+
"version": "7.12.7",
|
|
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.7",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.12.7",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.12.7",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.12.7"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|