@kody-ade/kody-engine 0.4.265 → 0.4.267

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 +12 -6
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@kody-ade/kody-engine",
18
- version: "0.4.265",
18
+ version: "0.4.267",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -10651,7 +10651,10 @@ var init_dispatchNextTaskJob = __esm({
10651
10651
  import { execFileSync as execFileSync11 } from "child_process";
10652
10652
  function prMergeStatus(prNumber, cwd) {
10653
10653
  try {
10654
- const out = gh(["pr", "view", String(prNumber), "--json", "mergeable,mergeStateStatus"], { cwd });
10654
+ const out = gh(["pr", "view", String(prNumber), "--json", "mergeable,mergeStateStatus"], {
10655
+ cwd,
10656
+ preferRepoToken: true
10657
+ });
10655
10658
  const parsed = JSON.parse(out);
10656
10659
  const mergeable = parsed.mergeable ?? "UNKNOWN";
10657
10660
  const mergeStateStatus = parsed.mergeStateStatus ?? "UNKNOWN";
@@ -10738,7 +10741,7 @@ function findExistingPr(branch, cwd) {
10738
10741
  try {
10739
10742
  const output = gh(
10740
10743
  ["pr", "list", "--head", branch, "--state", "open", "--json", "number,url,body", "--limit", "1"],
10741
- { cwd }
10744
+ { cwd, preferRepoToken: true }
10742
10745
  );
10743
10746
  const arr = JSON.parse(output);
10744
10747
  const first = Array.isArray(arr) ? arr[0] : null;
@@ -10781,7 +10784,10 @@ function updateExistingPr(existing, body, draft, cwd) {
10781
10784
  const stripped = existing.url.replace(/^https:\/\/github\.com\//, "");
10782
10785
  const [owner, repo] = stripped.split("/");
10783
10786
  try {
10784
- gh(["api", "--method", "PATCH", `repos/${owner}/${repo}/pulls/${existing.number}`, "-f", `body=${body}`], { cwd });
10787
+ gh(["api", "--method", "PATCH", `repos/${owner}/${repo}/pulls/${existing.number}`, "-f", `body=${body}`], {
10788
+ cwd,
10789
+ preferRepoToken: true
10790
+ });
10785
10791
  } catch (err) {
10786
10792
  throw new Error(`gh api PATCH #${existing.number} failed: ${err instanceof Error ? err.message : String(err)}`);
10787
10793
  }
@@ -10790,7 +10796,7 @@ function updateExistingPr(existing, body, draft, cwd) {
10790
10796
  function createPr(branch, base, title, body, draft, cwd) {
10791
10797
  const args = ["pr", "create", "--head", branch, "--base", base, "--title", title, "--body-file", "-"];
10792
10798
  if (draft) args.push("--draft");
10793
- const url = gh(args, { input: body, cwd }).trim();
10799
+ const url = gh(args, { input: body, cwd, preferRepoToken: true }).trim();
10794
10800
  const match = url.match(/\/pull\/(\d+)$/);
10795
10801
  const number = match ? parseInt(match[1], 10) : 0;
10796
10802
  return { url, number, draft, action: "created" };
@@ -16606,12 +16612,12 @@ function writeLocalFile(cwd, relativePath, content) {
16606
16612
  function hydrateDirectory(config, cwd, stateDir, localDir) {
16607
16613
  const entries = listStateDirectory(config, cwd, stateDir);
16608
16614
  if (entries.length === 0) return;
16609
- fs42.rmSync(path40.join(cwd, localDir), { recursive: true, force: true });
16610
16615
  for (const entry of entries) {
16611
16616
  if (!entry.name || !entry.type) continue;
16612
16617
  const childState = path40.posix.join(stateDir, entry.name);
16613
16618
  const childLocal = path40.join(localDir, entry.name);
16614
16619
  if (entry.type === "dir") {
16620
+ fs42.rmSync(path40.join(cwd, childLocal), { recursive: true, force: true });
16615
16621
  hydrateDirectory(config, cwd, childState, childLocal);
16616
16622
  } else if (entry.type === "file") {
16617
16623
  const file = readStateText(config, cwd, childState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.265",
3
+ "version": "0.4.267",
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",