@kody-ade/kody-engine-lite 0.1.30 → 0.1.32
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/bin/cli.js +12 -6
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -70,10 +70,11 @@ async function runSubprocess(command2, args2, prompt, timeout, options) {
|
|
|
70
70
|
if (code === 0) {
|
|
71
71
|
return { outcome: "completed", output: stdout };
|
|
72
72
|
}
|
|
73
|
+
const errDetail = stderr.slice(-STDERR_TAIL_CHARS) || stdout.slice(-STDERR_TAIL_CHARS);
|
|
73
74
|
return {
|
|
74
75
|
outcome: code === null ? "timed_out" : "failed",
|
|
75
76
|
error: `Exit code ${code}
|
|
76
|
-
${
|
|
77
|
+
${errDetail}`
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
function checkCommand(command2, args2) {
|
|
@@ -2407,21 +2408,26 @@ async function tryStartLitellm(url, projectDir) {
|
|
|
2407
2408
|
}
|
|
2408
2409
|
const portMatch = url.match(/:(\d+)/);
|
|
2409
2410
|
const port = portMatch ? portMatch[1] : "4000";
|
|
2411
|
+
let litellmFound = false;
|
|
2410
2412
|
try {
|
|
2411
|
-
execFileSync9("
|
|
2413
|
+
execFileSync9("which", ["litellm"], { timeout: 3e3, stdio: "pipe" });
|
|
2414
|
+
litellmFound = true;
|
|
2412
2415
|
} catch {
|
|
2413
2416
|
try {
|
|
2414
|
-
execFileSync9("python3", ["-
|
|
2417
|
+
execFileSync9("python3", ["-c", "import litellm"], { timeout: 1e4, stdio: "pipe" });
|
|
2418
|
+
litellmFound = true;
|
|
2415
2419
|
} catch {
|
|
2416
|
-
logger.warn("litellm not installed (pip install 'litellm[proxy]')");
|
|
2417
|
-
return null;
|
|
2418
2420
|
}
|
|
2419
2421
|
}
|
|
2422
|
+
if (!litellmFound) {
|
|
2423
|
+
logger.warn("litellm not installed (pip install 'litellm[proxy]')");
|
|
2424
|
+
return null;
|
|
2425
|
+
}
|
|
2420
2426
|
logger.info(`Starting LiteLLM proxy on port ${port}...`);
|
|
2421
2427
|
let cmd;
|
|
2422
2428
|
let args2;
|
|
2423
2429
|
try {
|
|
2424
|
-
execFileSync9("
|
|
2430
|
+
execFileSync9("which", ["litellm"], { timeout: 3e3, stdio: "pipe" });
|
|
2425
2431
|
cmd = "litellm";
|
|
2426
2432
|
args2 = ["--config", configPath, "--port", port];
|
|
2427
2433
|
} catch {
|