Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

fix(dev): prompt generation and builtin-pack run biome on Windows

leen.zhoubf668ed50c61
diff --git a/tools/dev/builtin-pack.ts b/tools/dev/builtin-pack.ts
index cb47b0e..badcc5c 100644
--- a/tools/dev/builtin-pack.ts
+++ b/tools/dev/builtin-pack.ts
@@ -85,9 +85,13 @@ async function brain(): Promise<Brain> {
function format(dir: string) {
// Keep generated JSON in the repository's Biome style so `pnpm lint` stays clean.
- execFileSync(join(root, "node_modules/.bin/biome"), ["format", "--write", dir], {
- stdio: "ignore",
- });
+ execFileSync(
+ process.execPath,
+ [join(root, "node_modules/@biomejs/biome/bin/biome"), "format", "--write", dir],
+ {
+ stdio: "ignore",
+ },
+ );
}
const skillFolders = (skills: unknown): string[] =>
diff --git a/tools/dev/prompts-gen.ts b/tools/dev/prompts-gen.ts
index e17697b..8636d0a 100644
--- a/tools/dev/prompts-gen.ts
+++ b/tools/dev/prompts-gen.ts
@@ -83,21 +83,22 @@ function emit(tree: Tree, indent: string): string {
}
const camel = (name: string) => name.replace(/[-_.]([a-z0-9])/g, (_, c: string) => c.toUpperCase());
-const biome = join(
- repo,
- "node_modules",
- ".bin",
- process.platform === "win32" ? "biome.cmd" : "biome",
-);
+// Biome's own JS launcher, run by this Node: the .bin shim is a .cmd file on Windows, which
+// execFileSync refuses to start without a shell.
+const biome = join(repo, "node_modules", "@biomejs", "biome", "bin", "biome");
function generate(md: string) {
const target = md.replace(/\.md$/, ".ts");
const source = `// Generated from ${basename(md)} by tools/dev/prompts-gen.ts. Edit the md file, then run \`pnpm gen:prompts\`.\nexport const ${camel(basename(md, ".md"))}Prompts = {\n${emit(parse(md), " ")}} as const;\n`;
- const formatted = execFileSync(biome, ["format", `--stdin-file-path=${target}`], {
- input: source,
- encoding: "utf8",
- cwd: repo,
- });
+ const formatted = execFileSync(
+ process.execPath,
+ [biome, "format", `--stdin-file-path=${target}`],
+ {
+ input: source,
+ encoding: "utf8",
+ cwd: repo,
+ },
+ );
return { target, formatted };
}