@kody-ade/kody-engine 0.4.247 → 0.4.248

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 +20 -12
  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.247",
18
+ version: "0.4.248",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative agentAction profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -145,11 +145,15 @@ var init_claudeBinary = __esm({
145
145
 
146
146
  // src/issue.ts
147
147
  import { execFileSync } from "child_process";
148
- function ghToken() {
149
- return process.env.GITHUB_TOKEN?.trim() || process.env.KODY_TOKEN?.trim() || process.env.GH_TOKEN?.trim() || process.env.GH_PAT?.trim();
148
+ function ghToken(preferRepoToken = false) {
149
+ const githubToken = process.env.GITHUB_TOKEN?.trim();
150
+ const kodyToken = process.env.KODY_TOKEN?.trim();
151
+ const ghToken3 = process.env.GH_TOKEN?.trim();
152
+ const ghPat = process.env.GH_PAT?.trim();
153
+ return preferRepoToken ? githubToken || kodyToken || ghToken3 || ghPat : ghPat || ghToken3 || kodyToken || githubToken;
150
154
  }
151
155
  function gh(args, options) {
152
- const token = ghToken();
156
+ const token = ghToken(options?.preferRepoToken);
153
157
  const env = token ? { ...process.env, GH_TOKEN: token } : { ...process.env };
154
158
  return execFileSync("gh", args, {
155
159
  encoding: "utf-8",
@@ -1480,14 +1484,18 @@ function readThread(repoSlug, number, limit = 10) {
1480
1484
  };
1481
1485
  }
1482
1486
  function readCheckRuns(repoSlug, ref, ignoreNames) {
1483
- const sha = gh(["api", `repos/${repoSlug}/commits/${ref}`, "--jq", ".sha"]).trim();
1484
- const raw = gh([
1485
- "api",
1486
- `repos/${repoSlug}/commits/${sha}/check-runs`,
1487
- "--paginate",
1488
- "--jq",
1489
- ".check_runs[] | {name, status, conclusion, details_url}"
1490
- ]);
1487
+ const ghOptions = { preferRepoToken: true };
1488
+ const sha = gh(["api", `repos/${repoSlug}/commits/${ref}`, "--jq", ".sha"], ghOptions).trim();
1489
+ const raw = gh(
1490
+ [
1491
+ "api",
1492
+ `repos/${repoSlug}/commits/${sha}/check-runs`,
1493
+ "--paginate",
1494
+ "--jq",
1495
+ ".check_runs[] | {name, status, conclusion, details_url}"
1496
+ ],
1497
+ ghOptions
1498
+ );
1491
1499
  const ignore = new Set(ignoreNames.map((n) => n.toLowerCase()));
1492
1500
  const checks = raw.split("\n").map((l) => l.trim()).filter(Boolean).map((l) => JSON.parse(l)).filter((c) => !ignore.has(String(c.name).toLowerCase()));
1493
1501
  const failing = checks.filter((c) => CHECK_FAIL_CONCLUSIONS.has(String(c.conclusion ?? "").toUpperCase())).map((c) => ({ name: c.name, conclusion: String(c.conclusion), detailsUrl: c.details_url }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.247",
3
+ "version": "0.4.248",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative agentAction profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",