// Minimal stand-in for the host-injected @earendil-works/* packages; only what index.ts imports. import { mkdtempSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; export const envApiKeyAuth = (name, envVars) => ({ name, envVars }); export const createProvider = (input) => input; export const openAICompletionsApi = () => ({ stream() {}, streamSimple() {} }); // getAgentDir is called by the default export to locate the catalog flag, so tests that drive the slash // commands need a real, writable dir: one private dir per run, never /tmp directly. Shared through // globalThis because jiti evaluates this file as a separate instance from a native import. export const agentDir = (globalThis.__nousStubAgentDir ??= mkdtempSync(join(tmpdir(), "nous-portal-stub-"))); export const getAgentDir = () => agentDir;