kaizen-agent 1.3.5 → 1.3.6
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/install.ts +25 -17
- package/package.json +1 -1
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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