kaizen-agent 1.3.1 → 1.3.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.
package/cli/dashboard.ts CHANGED
@@ -140,8 +140,12 @@ function readMouse(rest: string): { ev: MouseEv; len: number } | null {
140
140
  const WHEEL_UP = 64, WHEEL_DOWN = 65;
141
141
  const isClick = (e: MouseEv) => e.press && e.button === 0;
142
142
 
143
+ // Re-sent even when this module thinks it is already armed: settings runs as an
144
+ // action, tracks arming with its own flag, and turns reporting off in the terminal
145
+ // on the way out. Enabling twice costs nothing; trusting the stale flag costs the
146
+ // mouse for the rest of the session.
143
147
  function mouseOn() {
144
- if (!mouseWanted || mouseArmed) return;
148
+ if (!mouseWanted) return;
145
149
  process.stdout.write("\x1b[?1000h\x1b[?1006h");
146
150
  mouseArmed = true;
147
151
  }
package/cli/install.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "node:fs";
7
7
  import { join, dirname, basename } from "node:path";
8
8
  import { homedir, tmpdir } from "node:os";
9
- import { applyPreset, PRESETS, type PresetName } from "./settings.ts";
9
+ import { applyPreset, detectPreset, PRESETS, type PresetName } from "./settings.ts";
10
10
 
11
11
  const home = homedir();
12
12
  const REPO_URL = "https://github.com/hfadhlullah/kaizen.git";
@@ -271,9 +271,11 @@ const root = await chooseRoot();
271
271
  const presetChoice = await choosePreset();
272
272
  const targets = found(root);
273
273
 
274
- async function choosePreset(): Promise<PresetName> {
274
+ // null means "leave the config alone": an upgrade or a --yes run never asked, and
275
+ // answering "medium" for the user overwrote whatever preset they had chosen.
276
+ async function choosePreset(): Promise<PresetName | null> {
275
277
  if (presetArg) return presetArg;
276
- if (!interactive) return "medium";
278
+ if (!interactive) return null;
277
279
 
278
280
  return select("Choose workflow preset", [
279
281
  {
@@ -473,10 +475,16 @@ const globalConfig = join(globalKaizen, "config.yml");
473
475
  mkdirSync(globalKaizen, { recursive: true });
474
476
  const defPath = join(repo, "skills/kaizen/config.default.yml");
475
477
  const def = readFileSync(defPath, "utf8");
476
- const base = existsSync(globalConfig) ? readFileSync(globalConfig, "utf8") : def;
477
- const conf = applyPreset(base, presetChoice, def);
478
- writeFileSync(globalConfig, conf);
479
- step(`configured ${c.bold(presetChoice)} preset in ${tilde(globalConfig)}`);
478
+ const existing = existsSync(globalConfig) ? readFileSync(globalConfig, "utf8") : null;
479
+ if (presetChoice) {
480
+ writeFileSync(globalConfig, applyPreset(existing ?? def, presetChoice, def));
481
+ step(`configured ${c.bold(presetChoice)} preset in ${tilde(globalConfig)}`);
482
+ } else if (!existing) {
483
+ writeFileSync(globalConfig, def);
484
+ step(`wrote ${tilde(globalConfig)}`);
485
+ } else {
486
+ step(`kept your settings in ${tilde(globalConfig)} ${c.dim(`(${detectPreset(existing, def)})`)}`);
487
+ }
480
488
  }
481
489
 
482
490
  // A .kaizen/ in a parent already owns this folder's state, and setting up a child
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.3.1",
3
+ "version": "1.3.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": {