(args: string[], env: Record<string, string> = {})
| 15 | const SCRIPT = join(import.meta.dir, "..", "bin", "gstack-brain-context-load.ts"); |
| 16 | |
| 17 | function runScript(args: string[], env: Record<string, string> = {}): { stdout: string; stderr: string; exitCode: number } { |
| 18 | const result = spawnSync("bun", [SCRIPT, ...args], { |
| 19 | encoding: "utf-8", |
| 20 | timeout: 30000, |
| 21 | env: { ...process.env, ...env }, |
| 22 | }); |
| 23 | return { |
| 24 | stdout: result.stdout || "", |
| 25 | stderr: result.stderr || "", |
| 26 | exitCode: result.status ?? 1, |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | function writeFakeGbrain(binDir: string): void { |
| 31 | if (process.platform === "win32") { |
no test coverage detected