kaizen-agent 1.6.0 → 1.6.2

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.
Binary file
Binary file
package/cli/install.ts CHANGED
@@ -295,20 +295,26 @@ if (upgrade) await clearBunxCache();
295
295
  if (upgrade && !existsSync(join(dirname(import.meta.dir), ".git"))) {
296
296
  const latest = await npmLatest();
297
297
  const now = versionOf(dirname(import.meta.dir));
298
- if (latest && latest !== now) {
299
- step(`fetching kaizen ${latest} from npm`);
298
+ // A copy can only upgrade through npm. When the version lookup fails, bun still
299
+ // resolves "latest" its own way, so ask for that rather than falling through --
300
+ // which would copy this install over itself and call it up to date.
301
+ if (latest !== now) {
302
+ const want = latest ?? "latest";
303
+ step(`fetching kaizen ${want} from npm`);
300
304
  // --force so a stale package manifest cannot resolve the version away, and the
301
305
  // failure is printed rather than swallowed: a silent catch here looked exactly
302
306
  // like a successful upgrade that changed nothing.
303
- const r = await Bun.$`${process.execPath} x --force kaizen-agent@${latest} --yes`
307
+ const r = await Bun.$`${process.execPath} x --force kaizen-agent@${want} --yes`
304
308
  .quiet().nothrow();
305
309
  const out = clean(r.stdout.toString() + r.stderr.toString()).filter((l) => l.trim());
306
310
  for (const l of out) console.log(l.startsWith(" ") ? l : ` ${l}`);
307
311
  if (r.exitCode !== 0) {
308
- console.log(`\n ${c.bold(`could not fetch kaizen ${latest}`)}`);
309
- console.log(` ${c.dim("try:")} ${c.cyan(`bunx kaizen-agent@${latest}`)}\n`);
312
+ console.log(`\n ${c.bold(`could not fetch kaizen ${want}`)}`);
313
+ console.log(` ${c.dim("try:")} ${c.cyan(`bunx kaizen-agent@${want}`)}\n`);
310
314
  process.exit(1);
311
315
  }
316
+ const after = versionOf(process.env.KAIZEN_HOME ?? join(home, "kaizen"));
317
+ if (after === now) console.log(`\n ${c.bold(`kaizen ${now} is the latest on npm`)}\n`);
312
318
  process.exit(0);
313
319
  }
314
320
  }
@@ -821,7 +827,7 @@ function versionOf(dir: string) {
821
827
  async function npmLatest() {
822
828
  try {
823
829
  const r = await fetch("https://registry.npmjs.org/kaizen-agent/latest", {
824
- signal: AbortSignal.timeout(4000),
830
+ signal: AbortSignal.timeout(10000),
825
831
  });
826
832
  return ((await r.json()) as { version?: string }).version ?? null;
827
833
  } catch { return null; } // offline is not an upgrade failure
package/cli/web.ts CHANGED
@@ -365,10 +365,15 @@ export async function shortcut() {
365
365
  }
366
366
 
367
367
  if (process.platform === "win32") {
368
+ // A .lnk icon must be an .ico, and the board runs in its own minimised console
369
+ // rather than as a daemon: a detached child from a double-clicked shortcut has
370
+ // no console to report to, so a failure there looks like nothing happened.
371
+ // Closing that window stops the board.
368
372
  const lnk = join(home, "Desktop", "Kaizen.lnk");
369
- const ps = `$s=(New-Object -ComObject WScript.Shell).CreateShortcut('${lnk}');$s.TargetPath='${bun}';$s.Arguments='"${script}" web --daemon';$s.WorkingDirectory='${home}';${hasIcon ? `$s.IconLocation='${icon}';` : ""}$s.Save()`;
373
+ const ico = join(dirname(import.meta.dir), "assets", "kaizen.ico");
374
+ const ps = `$s=(New-Object -ComObject WScript.Shell).CreateShortcut('${lnk}');$s.TargetPath='${bun}';$s.Arguments='"${script}" web';$s.WorkingDirectory='${home}';$s.WindowStyle=7;${existsSync(ico) ? `$s.IconLocation='${ico}';` : ""}$s.Save()`;
370
375
  await Bun.$`powershell -NoProfile -Command ${ps}`.quiet();
371
- return lnk;
376
+ return `${lnk} — double-click opens the board in a minimised window; close that window to stop it`;
372
377
  }
373
378
 
374
379
  const dir = join(process.env["XDG_DATA_HOME"] ?? join(home, ".local", "share"), "applications");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
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": {
@@ -13,6 +13,8 @@
13
13
  "agents",
14
14
  "commands",
15
15
  "web",
16
+ "assets/kaizen-logo.png",
17
+ "assets/kaizen.ico",
16
18
  "README.md",
17
19
  "LICENSE"
18
20
  ],