// storage/context-config-store.ts — SPEC-370: Persists context window config
// Layout: data/projects/{hash}/context-config.json
import { readJson, writeJson, projectDataDir, hashProjectPath } from './base-store.js';
const DEFAULT_CONFIG = {
    maxTokens: 200_000,
    strategy: 'archive-done',
    warnAt: 150_000,
    archiveAfterDays: 30,
};
function configFile(projectPath) {
    const projectId = hashProjectPath(projectPath);
    return `${projectDataDir(projectId)}/context-config.json`;
}
export async function loadContextConfig(projectPath) {
    return readJson(configFile(projectPath), { ...DEFAULT_CONFIG });
}
export async function saveContextConfig(projectPath, config) {
    await writeJson(configFile(projectPath), config);
}
//# sourceMappingURL=context-config-store.js.map