@kody-ade/kody-engine 0.4.591 → 0.4.592

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 +15 -2
  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.591",
18
+ version: "0.4.592",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -8567,7 +8567,7 @@ function runGit(args, cwd) {
8567
8567
  const stdout = execFileSync5("git", args, {
8568
8568
  cwd,
8569
8569
  encoding: "utf-8",
8570
- env: { ...process.env, HUSKY: "0", SKIP_HOOKS: "1" },
8570
+ env: gitProcessEnvironment(),
8571
8571
  stdio: ["ignore", "pipe", "pipe"]
8572
8572
  });
8573
8573
  return { ok: true, stdout: stdout?.toString() ?? "", stderr: "" };
@@ -8578,6 +8578,19 @@ function runGit(args, cwd) {
8578
8578
  return { ok: false, stdout, stderr };
8579
8579
  }
8580
8580
  }
8581
+ function gitProcessEnvironment(baseEnv = process.env) {
8582
+ const env = { ...baseEnv, HUSKY: "0", SKIP_HOOKS: "1" };
8583
+ const token = baseEnv.GH_PAT?.trim() || baseEnv.KODY_TOKEN?.trim() || (baseEnv.GH_TOKEN?.trim() && baseEnv.GH_TOKEN.trim() !== baseEnv.GITHUB_TOKEN?.trim() ? baseEnv.GH_TOKEN.trim() : "");
8584
+ if (!token) return env;
8585
+ const parsedCount = Number.parseInt(env.GIT_CONFIG_COUNT ?? "0", 10);
8586
+ const count = Number.isInteger(parsedCount) && parsedCount >= 0 ? parsedCount : 0;
8587
+ env.GIT_CONFIG_COUNT = String(count + 2);
8588
+ env[`GIT_CONFIG_KEY_${count}`] = "http.https://github.com/.extraHeader";
8589
+ env[`GIT_CONFIG_VALUE_${count}`] = "";
8590
+ env[`GIT_CONFIG_KEY_${count + 1}`] = "http.https://github.com/.extraHeader";
8591
+ env[`GIT_CONFIG_VALUE_${count + 1}`] = `Authorization: Basic ${Buffer.from(`x-access-token:${token}`).toString("base64")}`;
8592
+ return env;
8593
+ }
8581
8594
  function resolveBranch(cwd, explicit) {
8582
8595
  if (explicit?.trim()) return explicit.trim();
8583
8596
  const r = runGit(["symbolic-ref", "--short", "HEAD"], cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.591",
3
+ "version": "0.4.592",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",