Repository Public
1import fs from 'node:fs';2import os from 'node:os';3import path from 'node:path';45export const REPO_ROOT = path.resolve(__dirname, '..', '..', '..');6export const DB_NAME = process.env.AOS_DEV_DB ?? 'agent_os_dev';7export const DATA_DIR = process.env.AOS_DEV_DATA_DIR ?? '/tmp/aos-dev-data';8export const WORKSPACE_ROOT = process.env.AOS_DEV_WORKSPACE_ROOT ?? '/tmp/aos-dev-workspace';9/** Bare remotes and other fixtures of the suite (outside the workspace root). */10export const SCRATCH_DIR = '/tmp/aos-dev-e2e';11/** Append-only: one line per reset with the spend of the database being dropped (never wiped by the suite). */12export const SPEND_LEDGER = '/tmp/aos-real-e2e-spend.log';13/** AOS_E2E_KEEP=1: do not reset the instance; sign in with the saved second factor and run only the selected scenarios. */14export const KEEP = process.env.AOS_E2E_KEEP === '1';15export const AUTH_FILE = '/tmp/aos-dev-e2e/auth.json';16export const ORIGIN = 'http://localhost:8640';17export const SCREENSHOTS = path.join(__dirname, 'screenshots');1819/** Volume-tier models (CONTRACT §0). */20export const HAIKU = 'claude-haiku-5-5';21export const LUNA = 'gpt-6-luna';2223/**24 * The provider key VALUES, read in the test process only to scan what the browser receives.25 * They are never printed: assertions report the URL of a leaking response, not its content.26 */27export function providerKeys(): string[] {28 const file = process.env.AOS_DEV_KEYS_FILE ?? path.join(os.homedir(), '.config', 'agent-os', 'dev.env');29 const keys: string[] = [];30 for (const line of fs.readFileSync(file, 'utf8').split(/\r?\n/)) {31 const m = /^(?:export\s+)?(ANTHROPIC_API_KEY|OPENAI_API_KEY)\s*=\s*(.*)$/.exec(line.trim());32 if (!m) continue;33 const v = (m[2] ?? '').trim().replace(/^(['"])(.*)\1$/, '$2');34 if (v.length >= 16) keys.push(v);35 }36 if (keys.length === 0) throw new Error('no provider key found in the dev keys file');37 return keys;38}39