kaizen-agent 1.3.9 → 1.3.10

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/cli/install.ts +20 -1
  2. package/package.json +1 -1
package/cli/install.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  symlinkSync, mkdirSync, readdirSync, lstatSync, readlinkSync, unlinkSync,
4
- existsSync, copyFileSync, readFileSync, appendFileSync, rmSync, writeFileSync,
4
+ existsSync, copyFileSync, readFileSync, appendFileSync, rmSync, writeFileSync, renameSync,
5
5
  statSync, cpSync,
6
6
  } from "node:fs";
7
7
  import { join, dirname, basename } from "node:path";
@@ -355,6 +355,25 @@ async function resolveRepo() {
355
355
  }
356
356
  return dest;
357
357
  }
358
+ // A copy made before git was installed can never be pulled, so it keeps upgrading
359
+ // through npm and its caches. Once git is here, replace it with a real clone --
360
+ // into a sibling first, so a clone that fails leaves the working copy alone.
361
+ if (Bun.which("git") && existsSync(join(dest, "cli", "install.ts"))) {
362
+ const fresh = `${dest}.new`;
363
+ try {
364
+ rmSync(fresh, { recursive: true, force: true });
365
+ await Bun.$`git clone --quiet ${REPO_URL} ${fresh}`;
366
+ rmSync(dest, { recursive: true, force: true });
367
+ renameSync(fresh, dest);
368
+ step(`re-cloned ${tilde(dest)} ${c.dim("(git is available now)")}`);
369
+ return dest;
370
+ } catch {
371
+ rmSync(fresh, { recursive: true, force: true });
372
+ // Fall through to the copy below: an unreachable network is not a reason to
373
+ // leave the install untouched.
374
+ }
375
+ }
376
+
358
377
  // Cloning needs an empty directory, and a copy made on a machine that had no git
359
378
  // is anything but: installing git later must not turn every run into a fatal.
360
379
  // An existing directory is updated in place whichever way it was made.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "Staged workflow for AI agents — code, writing, research, operations: plan, human approval, build, independent review, bounded fix loop.",
5
5
  "type": "module",
6
6
  "bin": {