@kody-ade/kody-engine 0.2.62 → 0.2.63
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/kody2.js +13 -11
- package/package.json +1 -1
package/dist/bin/kody2.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@kody-ade/kody-engine",
|
|
6
|
-
version: "0.2.
|
|
6
|
+
version: "0.2.63",
|
|
7
7
|
description: "kody2 \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
8
8
|
license: "MIT",
|
|
9
9
|
type: "module",
|
|
@@ -181,7 +181,7 @@ function loadConfig(projectDir = process.cwd()) {
|
|
|
181
181
|
},
|
|
182
182
|
issueContext: parseIssueContext(raw.issueContext),
|
|
183
183
|
testRequirements: parseTestRequirements(raw.testRequirements),
|
|
184
|
-
defaultExecutable: typeof raw.defaultExecutable === "string" && raw.defaultExecutable.length > 0 ? raw.defaultExecutable :
|
|
184
|
+
defaultExecutable: typeof raw.defaultExecutable === "string" && raw.defaultExecutable.length > 0 ? raw.defaultExecutable : "classify",
|
|
185
185
|
classify: parseClassifyConfig(raw.classify),
|
|
186
186
|
release: parseReleaseConfig(raw.release)
|
|
187
187
|
};
|
|
@@ -295,7 +295,7 @@ ${truncate(text, 4e3)}`);
|
|
|
295
295
|
}
|
|
296
296
|
function formatResult(msg) {
|
|
297
297
|
const ok = msg.subtype === "success";
|
|
298
|
-
const tag = ok ? "
|
|
298
|
+
const tag = ok ? "SESSION ok" : `SESSION failed (${msg.subtype ?? "unknown"})`;
|
|
299
299
|
const dur = msg.duration_ms ? ` ${(msg.duration_ms / 1e3).toFixed(1)}s` : "";
|
|
300
300
|
const turns = msg.num_turns ? ` ${msg.num_turns} turns` : "";
|
|
301
301
|
const cost = typeof msg.total_cost_usd === "number" ? ` $${msg.total_cost_usd.toFixed(4)}` : "";
|
|
@@ -354,7 +354,7 @@ async function runAgent(opts) {
|
|
|
354
354
|
env.ANTHROPIC_BASE_URL = opts.litellmUrl;
|
|
355
355
|
env.ANTHROPIC_API_KEY = getAnthropicApiKeyOrDummy();
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
const resultTexts = [];
|
|
358
358
|
let outcome = "failed";
|
|
359
359
|
let errorMessage;
|
|
360
360
|
try {
|
|
@@ -399,7 +399,8 @@ async function runAgent(opts) {
|
|
|
399
399
|
if (m.type === "result") {
|
|
400
400
|
if (m.subtype === "success") {
|
|
401
401
|
outcome = "completed";
|
|
402
|
-
|
|
402
|
+
const text = (typeof m.result === "string" ? m.result : "").trim();
|
|
403
|
+
if (text) resultTexts.push(text);
|
|
403
404
|
} else {
|
|
404
405
|
outcome = "failed";
|
|
405
406
|
errorMessage = `result subtype: ${m.subtype ?? "unknown"}`;
|
|
@@ -415,6 +416,7 @@ async function runAgent(opts) {
|
|
|
415
416
|
} catch {
|
|
416
417
|
}
|
|
417
418
|
}
|
|
419
|
+
const finalText = resultTexts.join("\n\n---\n\n");
|
|
418
420
|
return { outcome, finalText, error: errorMessage, ndjsonPath };
|
|
419
421
|
}
|
|
420
422
|
|
|
@@ -604,8 +606,9 @@ function autoDispatch(opts) {
|
|
|
604
606
|
};
|
|
605
607
|
}
|
|
606
608
|
const sub = extractSubcommand(afterTag);
|
|
607
|
-
const defaultExec = opts?.config?.defaultExecutable ?? "run";
|
|
608
609
|
if (!sub) {
|
|
610
|
+
const defaultExec = opts?.config?.defaultExecutable;
|
|
611
|
+
if (!defaultExec) return null;
|
|
609
612
|
return asDispatch(defaultExec, targetNum);
|
|
610
613
|
}
|
|
611
614
|
if (sub === "build") {
|
|
@@ -1438,7 +1441,9 @@ function parseAgentResult(finalText) {
|
|
|
1438
1441
|
failureReason: failedMatch[1].trim()
|
|
1439
1442
|
};
|
|
1440
1443
|
}
|
|
1441
|
-
|
|
1444
|
+
const hasDoneMarker = /(^|\n)\s*DONE\b/i.test(text);
|
|
1445
|
+
const hasCommitMsg = /^[ \t]*COMMIT_MSG\s*:/im.test(text);
|
|
1446
|
+
if (!hasDoneMarker && !hasCommitMsg) {
|
|
1442
1447
|
return {
|
|
1443
1448
|
done: false,
|
|
1444
1449
|
commitMessage: "",
|
|
@@ -2624,10 +2629,7 @@ function ensurePr(opts) {
|
|
|
2624
2629
|
try {
|
|
2625
2630
|
gh2(["pr", "edit", String(existing.number), "--body-file", "-"], { input: body, cwd: opts.cwd });
|
|
2626
2631
|
} catch (err) {
|
|
2627
|
-
|
|
2628
|
-
`[kody2] failed to update PR #${existing.number}: ${err instanceof Error ? err.message : String(err)}
|
|
2629
|
-
`
|
|
2630
|
-
);
|
|
2632
|
+
throw new Error(`gh pr edit #${existing.number} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2631
2633
|
}
|
|
2632
2634
|
return { url: existing.url, number: existing.number, draft: opts.draft, action: "updated" };
|
|
2633
2635
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.63",
|
|
4
4
|
"description": "kody2 — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|