pi-kage 0.3.6 → 0.3.7
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.
- package/README.md +22 -18
- package/bin/kage.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,37 +8,41 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center"><img src="./assets/demo.svg" alt="kage demo" width="100%"></p>
|
|
10
10
|
|
|
11
|
-
`kage`
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
`kage` runs multiple AI coding-agent sessions against one repo in parallel. The problem it solves:
|
|
12
|
+
point two agents at the same checkout and they fight over one working tree — editing the same files,
|
|
13
|
+
colliding on branches, tripping over each other's uncommitted changes.
|
|
14
|
+
|
|
15
|
+
Instead of a shared [`git worktree`](https://git-scm.com/docs/git-worktree), kage gives each session
|
|
16
|
+
its own **full copy** of the repo in a sibling folder — its own working tree, its own `.git`. Code
|
|
17
|
+
comes back through git (a PR, or a branch fetch); the agent's session memory comes back through
|
|
18
|
+
`~/.pi`. kage never copies a working tree back onto the origin, so concurrent sessions can't collide.
|
|
19
|
+
And like a real Naruto shadow clone, the clone carries the agent's memory out and returns it on
|
|
20
|
+
dispel (see [How it works](#how-it-works)).
|
|
14
21
|
|
|
15
22
|
```bash
|
|
16
23
|
npm install -g pi-kage
|
|
17
24
|
cd my-app
|
|
18
|
-
kage # 🥷 clone
|
|
25
|
+
kage # 🥷 clone -> ../my-app--kage-<ts>, open a fresh pi (origin history resumable)
|
|
19
26
|
# ...work in the clone: commit, push, open a PR, quit pi...
|
|
20
27
|
kage finish # 💨 merge the clone's new sessions back, delete the clone
|
|
21
28
|
```
|
|
22
29
|
|
|
23
30
|
---
|
|
24
31
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
Running **multiple agent sessions on the same repo at once** is a mess: they edit the same files,
|
|
28
|
-
fight over the working tree, and collide on branches. You end up babysitting merge conflicts
|
|
29
|
-
instead of shipping.
|
|
32
|
+
## Why a full copy instead of `git worktree`?
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
A worktree is the obvious way to get a second working directory, but every worktree shares the
|
|
35
|
+
repo's single `.git`. For parallel agents that shared `.git` is the problem:
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
- you can't check out the same branch in two worktrees;
|
|
38
|
+
- stash, refs, config, and the index are shared;
|
|
39
|
+
- a worktree is a clean checkout — no `node_modules`, `.env`, `.venv`, or build cache — so each one
|
|
40
|
+
needs a full setup pass before the agent can build or run anything.
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
A full copy has none of those constraints: independent `.git`, independent branches, and every
|
|
43
|
+
untracked or gitignored file is already in place. The price is disk and copy time — which on macOS
|
|
44
|
+
APFS kage avoids with a `cp -c` clonefile (copy-on-write): the clone is near-instant and uses no
|
|
45
|
+
extra space until files actually diverge. Non-reflink filesystems fall back to a full recursive copy.
|
|
42
46
|
|
|
43
47
|
## Install
|
|
44
48
|
|
package/bin/kage.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, wri
|
|
|
28
28
|
import { homedir } from "node:os";
|
|
29
29
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
30
30
|
import readline from "node:readline";
|
|
31
|
-
const VERSION = "0.3.
|
|
31
|
+
const VERSION = "0.3.7"; // keep in sync with package.json (enforced by test)
|
|
32
32
|
const MARKER = ".kage.json";
|
|
33
33
|
const SESSIONS = process.env.KAGE_SESSIONS_DIR || join(homedir(), ".pi", "agent", "sessions");
|
|
34
34
|
const RECENT_SESSIONS = 5; // how many of the origin's most-recent sessions to copy into a clone
|
package/package.json
CHANGED