| 84 | } |
| 85 | |
| 86 | function writeHealthyFiles(agentDir: string, cwd: string): void { |
| 87 | writeFileSync( |
| 88 | join(agentDir, "settings.json"), |
| 89 | JSON.stringify({ |
| 90 | packages: ["npm:@cortexkit/pi-magic-context", "npm:other-pi-extension"], |
| 91 | }), |
| 92 | ); |
| 93 | const configHome = process.env.XDG_CONFIG_HOME ?? join(process.env.HOME ?? "", ".config"); |
| 94 | writeFileSync( |
| 95 | join(configHome, "cortexkit", "magic-context.jsonc"), |
| 96 | JSON.stringify({ embedding: { provider: "local" } }), |
| 97 | ); |
| 98 | writeFileSync( |
| 99 | join(cwd, ".cortexkit", "magic-context.jsonc"), |
| 100 | JSON.stringify({ enabled: true }), |
| 101 | ); |
| 102 | } |
| 103 | |
| 104 | function createMockDb(): Database { |
| 105 | const db = new Database(":memory:"); |