@kody-ade/kody-engine 0.4.51 → 0.4.53

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +24 -19
  2. package/package.json +1 -1
package/dist/bin/kody.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.4.51",
6
+ version: "0.4.53",
7
7
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -1371,8 +1371,8 @@ function extractCommentRest(afterTag, consumedToken) {
1371
1371
  const re = new RegExp(`^${consumedToken.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}\\b`, "i");
1372
1372
  rest = rest.replace(re, "");
1373
1373
  }
1374
- rest = rest.replace(/^(please|kindly)(?:[\s:,.-]+|$)/i, "");
1375
- return rest.replace(/^[\s:,.-]+/, "").trim();
1374
+ rest = rest.replace(/^(please|kindly)(?:[\s:,.]+|\s|$)/i, "");
1375
+ return rest.replace(/^[\s:,.]+/, "").trim();
1376
1376
  }
1377
1377
  function parseCommentArgs(rest, inputs) {
1378
1378
  const tokens = rest.length === 0 ? [] : rest.split(/\s+/).filter((t) => t.length > 0);
@@ -4487,10 +4487,6 @@ var dispatchClassified = async (ctx) => {
4487
4487
  if (!classification || !VALID_CLASSES2.has(classification)) return;
4488
4488
  const baseArg = typeof ctx.args.base === "string" && ctx.args.base.length > 0 ? ` --base ${ctx.args.base}` : "";
4489
4489
  const body = `@kody ${classification}${baseArg}`;
4490
- process.stderr.write(
4491
- `[kody dispatchClassified] ctx.args.base=${JSON.stringify(ctx.args.base)} typeof=${typeof ctx.args.base} ctx.args=${JSON.stringify(ctx.args)}
4492
- `
4493
- );
4494
4490
  try {
4495
4491
  execFileSync13("gh", ["issue", "comment", String(issueNumber), "--body", body], {
4496
4492
  cwd: ctx.cwd,
@@ -5417,32 +5413,41 @@ var finalizeGoal = async (ctx) => {
5417
5413
  if (!goal) return;
5418
5414
  process.stdout.write(`[goal-tick] all task(s) done \u2014 finalising goal ${goal.id}
5419
5415
  `);
5420
- const leaf = goal.leafPr;
5421
- if (leaf) {
5422
- if (leaf.isDraft) {
5423
- process.stdout.write(`[goal-tick] promoting draft leaf PR #${leaf.number} \u2192 ready
5416
+ const taskPrs = goal.openTaskPrs ?? [];
5417
+ if (taskPrs.length === 0) {
5418
+ process.stdout.write(`[goal-tick] no open task PRs \u2014 marking goal done without merge
5424
5419
  `);
5425
- const ready = markPrReady(leaf.number, ctx.cwd);
5420
+ goal.state = "done";
5421
+ return;
5422
+ }
5423
+ const ordered = [...taskPrs].sort((a, b) => extractIssueNumber(a) - extractIssueNumber(b));
5424
+ for (const pr of ordered) {
5425
+ if (pr.isDraft) {
5426
+ process.stdout.write(`[goal-tick] promoting draft PR #${pr.number} \u2192 ready
5427
+ `);
5428
+ const ready = markPrReady(pr.number, ctx.cwd);
5426
5429
  if (!ready.ok) {
5427
- process.stderr.write(`[goal-tick] finalizeGoal: markPrReady failed: ${ready.error}
5430
+ process.stderr.write(`[goal-tick] finalizeGoal: markPrReady #${pr.number} failed: ${ready.error}
5428
5431
  `);
5429
5432
  return;
5430
5433
  }
5431
5434
  }
5432
- process.stdout.write(`[goal-tick] squash-merging leaf PR #${leaf.number}
5435
+ process.stdout.write(`[goal-tick] squash-merging PR #${pr.number} (base=${pr.baseRefName}, head=${pr.headRefName})
5433
5436
  `);
5434
- const merged = mergePrSquash(leaf.number, ctx.cwd);
5437
+ const merged = mergePrSquash(pr.number, ctx.cwd);
5435
5438
  if (!merged.ok) {
5436
- process.stderr.write(`[goal-tick] finalizeGoal: mergePrSquash failed: ${merged.error}
5439
+ process.stderr.write(`[goal-tick] finalizeGoal: mergePrSquash #${pr.number} failed: ${merged.error}
5437
5440
  `);
5438
5441
  return;
5439
5442
  }
5440
- } else {
5441
- process.stdout.write(`[goal-tick] no leaf PR \u2014 marking goal done without merge
5442
- `);
5443
5443
  }
5444
5444
  goal.state = "done";
5445
5445
  };
5446
+ function extractIssueNumber(pr) {
5447
+ const m = pr.headRefName.match(/^(\d+)-/);
5448
+ if (m?.[1]) return Number.parseInt(m[1], 10);
5449
+ return pr.number;
5450
+ }
5446
5451
 
5447
5452
  // src/scripts/finishFlow.ts
5448
5453
  import { execFileSync as execFileSync14 } from "child_process";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.51",
3
+ "version": "0.4.53",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",