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 +5 -1
- package/cli/install.ts +15 -7
- package/package.json +1 -1
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
|
|
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
|
-
|
|
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
|
|
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
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
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