@kody-ade/kody-engine-lite 0.1.2 → 0.1.3
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 +10 -9
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -267,16 +267,17 @@ var init_config = __esm({
|
|
|
267
267
|
import * as fs3 from "fs";
|
|
268
268
|
import * as path3 from "path";
|
|
269
269
|
function readPromptFile(stageName) {
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
"..",
|
|
273
|
-
"prompts",
|
|
274
|
-
|
|
275
|
-
)
|
|
276
|
-
|
|
277
|
-
|
|
270
|
+
const scriptDir = new URL(".", import.meta.url).pathname;
|
|
271
|
+
const candidates = [
|
|
272
|
+
path3.resolve(scriptDir, "..", "prompts", `${stageName}.md`),
|
|
273
|
+
path3.resolve(scriptDir, "..", "..", "prompts", `${stageName}.md`)
|
|
274
|
+
];
|
|
275
|
+
for (const candidate of candidates) {
|
|
276
|
+
if (fs3.existsSync(candidate)) {
|
|
277
|
+
return fs3.readFileSync(candidate, "utf-8");
|
|
278
|
+
}
|
|
278
279
|
}
|
|
279
|
-
|
|
280
|
+
throw new Error(`Prompt file not found: tried ${candidates.join(", ")}`);
|
|
280
281
|
}
|
|
281
282
|
function injectTaskContext(prompt, taskId, taskDir) {
|
|
282
283
|
let context = `## Task Context
|