@kody-ade/kody-engine-lite 0.1.23 → 0.1.25
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 +22 -4
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -145,7 +145,7 @@ var init_definitions = __esm({
|
|
|
145
145
|
name: "taskify",
|
|
146
146
|
type: "agent",
|
|
147
147
|
modelTier: "cheap",
|
|
148
|
-
timeout:
|
|
148
|
+
timeout: 3e5,
|
|
149
149
|
maxRetries: 1,
|
|
150
150
|
outputFile: "task.json"
|
|
151
151
|
},
|
|
@@ -153,7 +153,7 @@ var init_definitions = __esm({
|
|
|
153
153
|
name: "plan",
|
|
154
154
|
type: "agent",
|
|
155
155
|
modelTier: "strong",
|
|
156
|
-
timeout:
|
|
156
|
+
timeout: 6e5,
|
|
157
157
|
maxRetries: 1,
|
|
158
158
|
outputFile: "plan.md"
|
|
159
159
|
},
|
|
@@ -176,7 +176,7 @@ var init_definitions = __esm({
|
|
|
176
176
|
name: "review",
|
|
177
177
|
type: "agent",
|
|
178
178
|
modelTier: "strong",
|
|
179
|
-
timeout:
|
|
179
|
+
timeout: 6e5,
|
|
180
180
|
maxRetries: 1,
|
|
181
181
|
outputFile: "review.md"
|
|
182
182
|
},
|
|
@@ -2118,11 +2118,26 @@ async function tryStartLitellm(url, projectDir) {
|
|
|
2118
2118
|
cmd = "python3";
|
|
2119
2119
|
args2 = ["-m", "litellm", "--config", configPath, "--port", port];
|
|
2120
2120
|
}
|
|
2121
|
+
const dotenvPath = path14.join(projectDir, ".env");
|
|
2122
|
+
const dotenvVars = {};
|
|
2123
|
+
if (fs15.existsSync(dotenvPath)) {
|
|
2124
|
+
for (const line of fs15.readFileSync(dotenvPath, "utf-8").split("\n")) {
|
|
2125
|
+
const match = line.match(/^([A-Z_][A-Z0-9_]*_API_KEY)=(.*)$/);
|
|
2126
|
+
if (match) dotenvVars[match[1]] = match[2];
|
|
2127
|
+
}
|
|
2128
|
+
if (Object.keys(dotenvVars).length > 0) {
|
|
2129
|
+
logger.info(` Loaded API keys: ${Object.keys(dotenvVars).join(", ")}`);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2121
2132
|
const { spawn: spawn2 } = await import("child_process");
|
|
2122
2133
|
const child = spawn2(cmd, args2, {
|
|
2123
2134
|
stdio: ["ignore", "pipe", "pipe"],
|
|
2124
2135
|
detached: true,
|
|
2125
|
-
env: process.env
|
|
2136
|
+
env: { ...process.env, ...dotenvVars }
|
|
2137
|
+
});
|
|
2138
|
+
let proxyStderr = "";
|
|
2139
|
+
child.stderr?.on("data", (chunk) => {
|
|
2140
|
+
proxyStderr += chunk.toString();
|
|
2126
2141
|
});
|
|
2127
2142
|
for (let i = 0; i < 30; i++) {
|
|
2128
2143
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
@@ -2131,6 +2146,9 @@ async function tryStartLitellm(url, projectDir) {
|
|
|
2131
2146
|
return child;
|
|
2132
2147
|
}
|
|
2133
2148
|
}
|
|
2149
|
+
if (proxyStderr) {
|
|
2150
|
+
logger.warn(`LiteLLM stderr: ${proxyStderr.slice(-1e3)}`);
|
|
2151
|
+
}
|
|
2134
2152
|
logger.warn("LiteLLM proxy failed to start within 60s");
|
|
2135
2153
|
child.kill();
|
|
2136
2154
|
return null;
|