@kody-ade/kody-engine 0.3.74 → 0.3.75

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 +25 -7
  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.3.74",
6
+ version: "0.3.75",
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",
@@ -676,10 +676,16 @@ async function waitForNextUserMessage(opts) {
676
676
  if (now - idleStart >= opts.idleTimeoutMs) return { kind: "idle-timeout" };
677
677
  if (!opts.skipPull) {
678
678
  try {
679
- execFileSync("git", ["pull", "--ff-only", "--quiet", "origin", "HEAD"], {
680
- cwd: opts.cwd,
681
- stdio: "pipe"
682
- });
679
+ const branch = currentBranch(opts.cwd);
680
+ if (branch) {
681
+ execFileSync("git", ["fetch", "--quiet", "origin", branch], { cwd: opts.cwd, stdio: "pipe" });
682
+ execFileSync("git", ["merge", "--ff-only", "--quiet", `origin/${branch}`], {
683
+ cwd: opts.cwd,
684
+ stdio: "pipe"
685
+ });
686
+ } else {
687
+ execFileSync("git", ["fetch", "--quiet", "--all"], { cwd: opts.cwd, stdio: "pipe" });
688
+ }
683
689
  } catch (err) {
684
690
  const msg = err instanceof Error ? err.message : String(err);
685
691
  logger.warn(`git pull failed (will retry): ${msg}`);
@@ -702,6 +708,18 @@ async function waitForNextUserMessage(opts) {
702
708
  function sleep(ms) {
703
709
  return new Promise((resolve4) => setTimeout(resolve4, ms));
704
710
  }
711
+ function currentBranch(cwd) {
712
+ try {
713
+ const out = execFileSync("git", ["symbolic-ref", "--short", "HEAD"], {
714
+ cwd,
715
+ stdio: ["ignore", "pipe", "ignore"]
716
+ });
717
+ const branch = out.toString("utf-8").trim();
718
+ return branch || null;
719
+ } catch {
720
+ return null;
721
+ }
722
+ }
705
723
 
706
724
  // src/chat/modes/interactive.ts
707
725
  var DEFAULT_IDLE_EXIT_MS = 5 * 6e4;
@@ -785,7 +803,7 @@ function commitTurn(cwd, sessionId, verbose) {
785
803
  if (paths.length === 0) return;
786
804
  const stdio = verbose ? "inherit" : "pipe";
787
805
  try {
788
- execFileSync2("git", ["add", ...paths], { cwd, stdio });
806
+ execFileSync2("git", ["add", "-f", ...paths], { cwd, stdio });
789
807
  execFileSync2("git", ["commit", "--quiet", "-m", `chat: interactive turn for ${sessionId}`], { cwd, stdio });
790
808
  execFileSync2("git", ["push", "--quiet", "origin", "HEAD"], { cwd, stdio });
791
809
  } catch (err) {
@@ -8077,7 +8095,7 @@ function commitChatFiles(cwd, sessionId, verbose) {
8077
8095
  if (paths.length === 0) return;
8078
8096
  const opts = { cwd, stdio: verbose ? "inherit" : "pipe" };
8079
8097
  try {
8080
- execFileSync28("git", ["add", ...paths], opts);
8098
+ execFileSync28("git", ["add", "-f", ...paths], opts);
8081
8099
  execFileSync28("git", ["commit", "--quiet", "-m", `chat: reply for ${sessionId}`], opts);
8082
8100
  execFileSync28("git", ["push", "--quiet", "origin", "HEAD"], opts);
8083
8101
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.74",
3
+ "version": "0.3.75",
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",