claudish 6.3.0 → 6.3.2
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 +20 -15
- package/native/mtm/mtm-darwin-arm64 +0 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37103,7 +37103,7 @@ async function fetchGLMCodingModels() {
|
|
|
37103
37103
|
return [];
|
|
37104
37104
|
}
|
|
37105
37105
|
}
|
|
37106
|
-
var __filename4, __dirname4, VERSION = "6.3.
|
|
37106
|
+
var __filename4, __dirname4, VERSION = "6.3.2", CACHE_MAX_AGE_DAYS2 = 2, CLAUDISH_CACHE_DIR2, BUNDLED_MODELS_PATH, CACHED_MODELS_PATH, ALL_MODELS_JSON_PATH;
|
|
37107
37107
|
var init_cli = __esm(() => {
|
|
37108
37108
|
init_config();
|
|
37109
37109
|
init_model_loader();
|
|
@@ -101111,7 +101111,7 @@ __export(exports_pty_diag_runner, {
|
|
|
101111
101111
|
MtmDiagRunner: () => MtmDiagRunner
|
|
101112
101112
|
});
|
|
101113
101113
|
import { spawn as spawn3 } from "child_process";
|
|
101114
|
-
import { appendFileSync, createWriteStream as createWriteStream3, existsSync as existsSync21, mkdirSync as mkdirSync12, unlinkSync as unlinkSync9
|
|
101114
|
+
import { appendFileSync, createWriteStream as createWriteStream3, existsSync as existsSync21, mkdirSync as mkdirSync12, unlinkSync as unlinkSync9 } from "fs";
|
|
101115
101115
|
import { homedir as homedir20 } from "os";
|
|
101116
101116
|
import { dirname as dirname6, join as join23 } from "path";
|
|
101117
101117
|
import { execSync as execSync3 } from "child_process";
|
|
@@ -101131,23 +101131,29 @@ class MtmDiagRunner {
|
|
|
101131
101131
|
this.statusPath = join23(dir, `status-${process.pid}.txt`);
|
|
101132
101132
|
this.logStream = createWriteStream3(this.logPath, { flags: "w" });
|
|
101133
101133
|
this.logStream.on("error", () => {});
|
|
101134
|
-
try {
|
|
101135
|
-
writeFileSync13(this.statusPath, renderStatusBar({ model: "", provider: "", errorCount: 0, lastError: "" }) + `
|
|
101136
|
-
`);
|
|
101137
|
-
} catch {}
|
|
101138
101134
|
}
|
|
101139
101135
|
async run(claudeCommand, claudeArgs, env2) {
|
|
101140
101136
|
const mtmBin = this.findMtmBinary();
|
|
101141
101137
|
const quotedArgs = claudeArgs.map((a) => shellQuote(a)).join(" ");
|
|
101142
101138
|
const claudeCmd = `${shellQuote(claudeCommand)} ${quotedArgs}`;
|
|
101143
101139
|
const mergedEnv = { ...process.env, ...env2 };
|
|
101144
|
-
this.mtmProc = spawn3(mtmBin, ["-e", claudeCmd, "-S", this.statusPath], {
|
|
101140
|
+
this.mtmProc = spawn3(mtmBin, ["-e", claudeCmd, "-S", this.statusPath, "-L", this.logPath], {
|
|
101145
101141
|
stdio: "inherit",
|
|
101146
101142
|
env: mergedEnv
|
|
101147
101143
|
});
|
|
101148
101144
|
const exitCode = await new Promise((resolve4) => {
|
|
101149
|
-
this.mtmProc.on("exit", (code) =>
|
|
101150
|
-
|
|
101145
|
+
this.mtmProc.on("exit", (code) => {
|
|
101146
|
+
resolve4(code ?? 1);
|
|
101147
|
+
});
|
|
101148
|
+
this.mtmProc.on("error", (err) => {
|
|
101149
|
+
if (this.logStream) {
|
|
101150
|
+
try {
|
|
101151
|
+
this.logStream.write(`[mtm] spawn error: ${err.message}
|
|
101152
|
+
`);
|
|
101153
|
+
} catch {}
|
|
101154
|
+
}
|
|
101155
|
+
resolve4(1);
|
|
101156
|
+
});
|
|
101151
101157
|
});
|
|
101152
101158
|
this.cleanup();
|
|
101153
101159
|
return exitCode;
|
|
@@ -101201,7 +101207,6 @@ class MtmDiagRunner {
|
|
|
101201
101207
|
} else if (name.includes("/")) {
|
|
101202
101208
|
this.provider = name.split("/")[0];
|
|
101203
101209
|
}
|
|
101204
|
-
this.refreshStatusBar();
|
|
101205
101210
|
}
|
|
101206
101211
|
refreshStatusBar() {
|
|
101207
101212
|
const bar = renderStatusBar({
|
|
@@ -101317,10 +101322,10 @@ function parseLogMessage(msg) {
|
|
|
101317
101322
|
return { isError: false, short: `fallback: ${countMatch?.[1] || "?"} providers`, provider };
|
|
101318
101323
|
}
|
|
101319
101324
|
if (msg.toLowerCase().includes("error")) {
|
|
101320
|
-
const short = msg.replace(/^Error\s*\[
|
|
101321
|
-
return { isError: true, short: short.length >
|
|
101325
|
+
const short = msg.replace(/^Error\s*\[[^\]]+\]:\s*/, "").replace(/\.\s*$/, "");
|
|
101326
|
+
return { isError: true, short: short.length > 80 ? short.slice(0, 79) + "\u2026" : short, provider };
|
|
101322
101327
|
}
|
|
101323
|
-
return { isError: false, short: msg.length >
|
|
101328
|
+
return { isError: false, short: msg.length > 80 ? msg.slice(0, 79) + "\u2026" : msg };
|
|
101324
101329
|
}
|
|
101325
101330
|
async function tryCreateMtmRunner() {
|
|
101326
101331
|
try {
|
|
@@ -106096,13 +106101,13 @@ class ComposedHandler {
|
|
|
106096
106101
|
providerDisplayName: this.provider.displayName,
|
|
106097
106102
|
streamFormat: this.provider.streamFormat,
|
|
106098
106103
|
modelId: this.targetModel,
|
|
106099
|
-
httpStatus:
|
|
106104
|
+
httpStatus: 401,
|
|
106100
106105
|
isStreaming: false,
|
|
106101
106106
|
retryAttempted: false,
|
|
106102
106107
|
isInteractive: this.isInteractive,
|
|
106103
106108
|
authType: "oauth"
|
|
106104
106109
|
});
|
|
106105
|
-
return c.json({ error: { type: "
|
|
106110
|
+
return c.json({ error: { type: "authentication_error", message: err.message } }, 401);
|
|
106106
106111
|
}
|
|
106107
106112
|
}
|
|
106108
106113
|
if (this.provider.getContextWindow) {
|
|
Binary file
|