// =============================================================================
// Pure PRD API. The store is module-level so atlas.ts can inspect it after each
// turn (it imports `prdStore` from prd.ts which re-exports from here). Keep
// this module side-effect-free otherwise.
// =============================================================================

/** sessionKey (workspaceRoot) → PRD markdown */
export const prdStore = new Map<string, string>();

export function finalizePrd(sessionKey: string, content: string): { saved: true; message: string } {
    prdStore.set(sessionKey, content);
    return {
        saved: true,
        message: 'PRD saved. Let the user know their product requirements document is ready and the platform will now architect the technical solution.',
    };
}

export function getPrd(sessionKey: string): string | null {
    return prdStore.get(sessionKey) ?? null;
}
