kaizen-agent 1.3.8 → 1.3.9
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/cli/dashboard.ts +10 -3
- package/cli/install.ts +7 -4
- package/package.json +1 -1
package/cli/dashboard.ts
CHANGED
|
@@ -437,7 +437,12 @@ export async function dashboard(
|
|
|
437
437
|
async function sync() {
|
|
438
438
|
const before = knownProjects().length;
|
|
439
439
|
const started = Date.now();
|
|
440
|
-
|
|
440
|
+
// Only searching under $HOME misses every project on another drive or mount,
|
|
441
|
+
// which on Windows is most of them. The folder the dashboard was opened in is
|
|
442
|
+
// searched too, and it is where the projects being worked on actually are.
|
|
443
|
+
const roots = [home, dirname(state ?? process.cwd()), process.cwd()]
|
|
444
|
+
.filter((d, i, all) => all.indexOf(d) === i);
|
|
445
|
+
const found = [...new Set(roots.flatMap((r) => findProjects(r)))];
|
|
441
446
|
for (const dir of found) remember(dir);
|
|
442
447
|
const added = knownProjects().length - before;
|
|
443
448
|
await report([
|
|
@@ -445,7 +450,7 @@ export async function dashboard(
|
|
|
445
450
|
"",
|
|
446
451
|
...found.map((d) => " " + c.dim(tilde(d))),
|
|
447
452
|
"",
|
|
448
|
-
c.dim(`${found.length} found in ${((Date.now() - started) / 1000).toFixed(1)}s under ${tilde(
|
|
453
|
+
c.dim(`${found.length} found in ${((Date.now() - started) / 1000).toFixed(1)}s under ${roots.map(tilde).join(", ")}`),
|
|
449
454
|
c.dim(`the list lives in ${tilde(join(home, ".kaizen", "projects"))} and can be edited`),
|
|
450
455
|
]);
|
|
451
456
|
}
|
|
@@ -1311,7 +1316,9 @@ function findProjects(root: string, depth = 4): string[] {
|
|
|
1311
1316
|
try { entries = readdirSync(dir); } catch { return; }
|
|
1312
1317
|
// $HOME holds ~/.kaizen, the global state, which is not a project and must not
|
|
1313
1318
|
// stop the walk before it has looked at anything.
|
|
1314
|
-
|
|
1319
|
+
// A project can hold projects of its own -- a monorepo, or a folder of them --
|
|
1320
|
+
// so finding one is not a reason to stop looking underneath it.
|
|
1321
|
+
if (dir !== root && entries.includes(".kaizen")) found.push(dir);
|
|
1315
1322
|
if (left === 0) return;
|
|
1316
1323
|
for (const name of entries) {
|
|
1317
1324
|
if (name.startsWith(".") || name === "node_modules") continue;
|
package/cli/install.ts
CHANGED
|
@@ -355,14 +355,17 @@ async function resolveRepo() {
|
|
|
355
355
|
}
|
|
356
356
|
return dest;
|
|
357
357
|
}
|
|
358
|
-
|
|
358
|
+
// Cloning needs an empty directory, and a copy made on a machine that had no git
|
|
359
|
+
// is anything but: installing git later must not turn every run into a fatal.
|
|
360
|
+
// An existing directory is updated in place whichever way it was made.
|
|
361
|
+
if (Bun.which("git") && !existsSync(dest)) {
|
|
359
362
|
step(`cloning into ${tilde(dest)}`);
|
|
360
363
|
await Bun.$`git clone --quiet ${REPO_URL} ${dest}`;
|
|
361
364
|
return dest;
|
|
362
365
|
}
|
|
363
|
-
//
|
|
364
|
-
//
|
|
365
|
-
step(`copying into ${tilde(dest)} ${c.dim("(no git)")}`);
|
|
366
|
+
// The bunx download already holds everything a clone would, so copy it in place.
|
|
367
|
+
// Upgrades then come from re-running bunx rather than a pull.
|
|
368
|
+
step(`copying into ${tilde(dest)} ${c.dim(existsSync(dest) ? "(over the copy already there)" : "(no git)")}`);
|
|
366
369
|
cpSync(here, dest, {
|
|
367
370
|
recursive: true, dereference: true,
|
|
368
371
|
filter: (src) => basename(src) !== "node_modules",
|
package/package.json
CHANGED