@kody-ade/kody-engine 0.3.54 → 0.3.56

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/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.3.54",
6
+ version: "0.3.56",
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",
@@ -863,7 +863,12 @@ function dispatchScheduledWatches(opts) {
863
863
  if (!opts?.force) {
864
864
  try {
865
865
  if (!cronMatchesInWindow(schedule, now, windowSec)) continue;
866
- } catch {
866
+ } catch (err) {
867
+ const msg = err instanceof Error ? err.message : String(err);
868
+ process.stderr.write(
869
+ `[kody] dispatchScheduledWatches: '${exe.name}' has invalid schedule '${schedule}' (${msg}); never firing
870
+ `
871
+ );
867
872
  continue;
868
873
  }
869
874
  }
@@ -1480,10 +1485,23 @@ function commitAndPush(branch, agentMessage, cwd) {
1480
1485
  const sha = git(["rev-parse", "HEAD"], cwd).slice(0, 7);
1481
1486
  try {
1482
1487
  git(["push", "-u", "origin", branch], cwd);
1483
- } catch {
1484
- git(["push", "--force-with-lease", "-u", "origin", branch], cwd);
1488
+ return { committed: true, pushed: true, sha, message };
1489
+ } catch (firstErr) {
1490
+ try {
1491
+ git(["push", "--force-with-lease", "-u", "origin", branch], cwd);
1492
+ return { committed: true, pushed: true, sha, message };
1493
+ } catch (secondErr) {
1494
+ const tail = (secondErr instanceof Error ? secondErr.message : String(secondErr)).slice(-400);
1495
+ const initial = firstErr instanceof Error ? firstErr.message : String(firstErr);
1496
+ return {
1497
+ committed: true,
1498
+ pushed: false,
1499
+ sha,
1500
+ message,
1501
+ pushError: `push failed: ${initial.slice(-200)} | force-with-lease failed: ${tail}`
1502
+ };
1503
+ }
1485
1504
  }
1486
- return { committed: true, pushed: true, sha, message };
1487
1505
  }
1488
1506
  function hasCommitsAhead(branch, defaultBranch, cwd) {
1489
1507
  try {
@@ -2107,6 +2125,16 @@ var commitAndPush2 = async (ctx) => {
2107
2125
  ctx.data.commitResult = result;
2108
2126
  const postCommitFiles = result.committed ? listFilesInCommit("HEAD", ctx.cwd) : listChangedFiles(ctx.cwd);
2109
2127
  ctx.data.changedFiles = postCommitFiles.filter((f) => !isForbiddenPath(f));
2128
+ if (result.committed && !result.pushed) {
2129
+ const reason = result.pushError ?? "push failed (no error detail)";
2130
+ ctx.data.commitCrash = reason;
2131
+ if (ctx.output.exitCode === void 0 || ctx.output.exitCode === 0) {
2132
+ ctx.output.exitCode = 4;
2133
+ }
2134
+ if (!ctx.output.reason) ctx.output.reason = reason;
2135
+ process.stderr.write(`[kody commitAndPush] ${reason}
2136
+ `);
2137
+ }
2110
2138
  } catch (err) {
2111
2139
  const reason = err instanceof Error ? err.message : String(err);
2112
2140
  ctx.data.commitCrash = reason;
@@ -3316,6 +3344,9 @@ var ensurePr2 = async (ctx) => {
3316
3344
  if (!commitResult?.committed && !hasCommits) {
3317
3345
  return;
3318
3346
  }
3347
+ if (commitResult?.committed && commitResult.pushed === false) {
3348
+ return;
3349
+ }
3319
3350
  const branch = ctx.data.branch;
3320
3351
  if (!branch) return;
3321
3352
  const failureReason = computeFailureReason(ctx);
@@ -5717,7 +5748,10 @@ function isAncestorOfHead(sha, cwd) {
5717
5748
  function tryPostPr4(prNumber, body, cwd) {
5718
5749
  try {
5719
5750
  postPrReviewComment(prNumber, body, cwd);
5720
- } catch {
5751
+ } catch (err) {
5752
+ const msg = err instanceof Error ? err.message : String(err);
5753
+ process.stderr.write(`[kody revertFlow] PR comment on #${prNumber} failed: ${msg}
5754
+ `);
5721
5755
  }
5722
5756
  }
5723
5757
 
@@ -6647,7 +6681,8 @@ async function runExecutable(profileName, input) {
6647
6681
  const msg = err instanceof Error ? err.message : String(err);
6648
6682
  process.stderr.write(`[kody] postflight "${label}" crashed: ${msg}
6649
6683
  `);
6650
- if (!ctx.output.reason) ctx.output.reason = `postflight ${label} crashed: ${msg}`;
6684
+ const summary = `postflight ${label} crashed: ${msg}`;
6685
+ ctx.output.reason = ctx.output.reason ? `${ctx.output.reason}; ${summary}` : summary;
6651
6686
  if (ctx.output.exitCode === 0) ctx.output.exitCode = 99;
6652
6687
  }
6653
6688
  }
@@ -33,7 +33,22 @@
33
33
  "plugins": [],
34
34
  "mcpServers": []
35
35
  },
36
- "cliTools": [],
36
+ "cliTools": [
37
+ {
38
+ "name": "git",
39
+ "install": { "required": true, "checkCommand": "git --version" },
40
+ "verify": "git --version",
41
+ "usage": "Used by revert.sh to stage `git revert --no-commit` and by commitAndPush to land the revert.",
42
+ "allowedUses": ["revert", "rev-parse", "merge-base", "log", "commit", "push", "rev-list"]
43
+ },
44
+ {
45
+ "name": "gh",
46
+ "install": { "required": true, "checkCommand": "gh --version" },
47
+ "verify": "gh --version",
48
+ "usage": "Used by revertFlow to read PR metadata and post status / failure comments.",
49
+ "allowedUses": ["pr", "api", "issue"]
50
+ }
51
+ ],
37
52
  "scripts": {
38
53
  "preflight": [
39
54
  {
@@ -52,6 +67,8 @@
52
67
  { "script": "commitAndPush" },
53
68
  { "script": "ensurePr" },
54
69
  { "script": "postIssueComment" },
70
+ { "script": "recordOutcome" },
71
+ { "script": "saveTaskState" },
55
72
  { "script": "writeRunSummary" }
56
73
  ]
57
74
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.54",
3
+ "version": "0.3.56",
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",