kaizen-agent 1.3.5 → 1.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/cli/dashboard.ts CHANGED
@@ -86,11 +86,21 @@ function findTerminal(cwd: string, fullCmd: string[]): { cmd: string[]; detached
86
86
  if (process.platform === "win32") {
87
87
  const q = (a: string) => `'${a.replace(/'/g, "''")}'`;
88
88
  const shell = Bun.which("pwsh.exe") ? "pwsh.exe" : "powershell.exe";
89
- const ps = `Set-Location -LiteralPath ${q(cwd)}; & ${fullCmd.map(q).join(" ")}`;
89
+ // No Set-Location in the command: both launchers set the directory themselves,
90
+ // and the semicolon that would separate the two statements is what Windows
91
+ // Terminal splits its own arguments on. Any semicolon still left in the prompt
92
+ // is escaped for wt, which reads it before PowerShell ever sees the quoting.
93
+ const ps = `& ${fullCmd.map(q).join(" ")}`;
90
94
  if (Bun.which("wt.exe")) {
91
- return { cmd: ["wt.exe", "-d", cwd, shell, "-NoExit", "-Command", ps], detached: true };
95
+ return {
96
+ cmd: ["wt.exe", "-d", cwd, shell, "-NoExit", "-Command", ps.replace(/;/g, "\\;")],
97
+ detached: true,
98
+ };
92
99
  }
93
- return { cmd: ["cmd.exe", "/c", "start", "kaizen", shell, "-NoExit", "-Command", ps], detached: true };
100
+ return {
101
+ cmd: ["cmd.exe", "/c", "start", "kaizen", "/D", cwd, shell, "-NoExit", "-Command", ps],
102
+ detached: true,
103
+ };
94
104
  }
95
105
 
96
106
  if (process.env.TERMINAL && Bun.which(process.env.TERMINAL)) {
@@ -1038,7 +1048,7 @@ export async function dashboard(
1038
1048
  "",
1039
1049
  "Run manually:",
1040
1050
  ` ${c.cyan(process.platform === "win32"
1041
- ? `Set-Location '${projectDir}'; & ${agent.cmd} '${prompt.replace(/'/g, "''")}'`
1051
+ ? `cd '${projectDir}'; & ${agent.cmd} '${prompt.replace(/'/g, "''")}'`
1042
1052
  : `cd "${projectDir}" && ${agent.cmd} "${prompt}"`)}`,
1043
1053
  ]);
1044
1054
  return;
package/cli/install.ts CHANGED
@@ -126,23 +126,31 @@ if (wantSettings) {
126
126
  // opened a terminal for.
127
127
  if (interactive && !upgrade && Bun.argv.length === 2) {
128
128
  const repoDir = await resolveRepoQuietly();
129
- const here = found(home);
130
- const linked = here.length > 0 && here.every((a) =>
131
- ["kaizen", "kaizen-help"].every((n) => existsSync(join(home, a.dir, "skills", n))));
132
- if (linked) {
133
- const { dashboard } = await import("./dashboard.ts");
134
- await dashboard(repoDir, here.map((a) => a.name), async (action) => {
135
- if (action === "settings") {
136
- const { settings } = await import("./settings.ts");
137
- await settings(repoDir, false);
138
- } else if (action === "upgrade") {
139
- return await runUpgrade(repoDir);
140
- } else if (action === "init") {
141
- const out = await Bun.$`bun run ${join(repoDir, "cli/install.ts")} --yes`.text();
142
- return clean(out);
143
- }
144
- });
145
- process.exit(0);
129
+ // `bunx kaizen-agent@1.4.0` on a machine that already has an older copy is a
130
+ // request to install that version, not to open the dashboard the old one links
131
+ // to -- opening it would hand the upgrade back to the very installer being
132
+ // replaced. Only skip to the dashboard when the two are the same version.
133
+ const running = dirname(import.meta.dir);
134
+ const stale = running !== repoDir && versionOf(running) !== versionOf(repoDir);
135
+ if (!stale) {
136
+ const here = found(home);
137
+ const linked = here.length > 0 && here.every((a) =>
138
+ ["kaizen", "kaizen-help"].every((n) => existsSync(join(home, a.dir, "skills", n))));
139
+ if (linked) {
140
+ const { dashboard } = await import("./dashboard.ts");
141
+ await dashboard(repoDir, here.map((a) => a.name), async (action) => {
142
+ if (action === "settings") {
143
+ const { settings } = await import("./settings.ts");
144
+ await settings(repoDir, false);
145
+ } else if (action === "upgrade") {
146
+ return await runUpgrade(repoDir);
147
+ } else if (action === "init") {
148
+ const out = await Bun.$`bun run ${join(repoDir, "cli/install.ts")} --yes`.text();
149
+ return clean(out);
150
+ }
151
+ });
152
+ process.exit(0);
153
+ }
146
154
  }
147
155
  }
148
156
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
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": {