import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; const host = fileURLToPath(new URL("../../../", import.meta.url)); // Vendored compatibility gate: use the real Selesai host, never a mixture of // upstream development dependencies and the fork's coding-agent classes. export default defineConfig({ test: { environment: "node", setupFiles: ["./test/host-setup.ts"], testTimeout: 30000, env: { PI_OFFLINE: "1", FORCE_COLOR: "3", // Selesai versions its app separately from the Pi renderer contract it implements. ZENTUI_HOST_PI_VERSION: JSON.parse(readFileSync(`${host}package.json`, "utf8")) .dependencies["@earendil-works/pi-tui"], }, exclude: ["**/node_modules/**"], }, resolve: { alias: [ { find: "@earendil-works/pi-coding-agent", replacement: `${host}dist/index.js` }, { find: "@selesai/code", replacement: `${host}dist/index.js` }, { find: /^@earendil-works\/pi-ai\/(.+)$/, replacement: `${host}node_modules/@earendil-works/pi-ai/dist/$1.js`, }, { find: "@earendil-works/pi-ai", replacement: `${host}node_modules/@earendil-works/pi-ai/dist/index.js`, }, { find: "@earendil-works/pi-tui", replacement: `${host}node_modules/@earendil-works/pi-tui/dist/index.js`, }, ], }, });