import { buildContextBundle, contextBundlePrompt } from "./context/contextBundle.js";
import { readProjectMemory } from "./memdir/projectMemory.js";
export function getSystemContext(input) {
    const bundle = buildContextBundle(input.projectPath, 12_000);
    return {
        repository_map: bundle.repositoryMap.files
            .map((file) => `${file.path} (${file.size} bytes)`)
            .join("\n"),
        selected_context: contextBundlePrompt(bundle),
        project_memory: input.includeMemory === false ? "" : readProjectMemory(input.projectPath),
    };
}
export function getUserContext(projectPath) {
    const context = getSystemContext({ projectPath });
    return [
        "<project_memory>",
        context.project_memory || "(empty)",
        "</project_memory>",
        "",
        "<repository_map>",
        context.repository_map || "(empty)",
        "</repository_map>",
    ].join("\n");
}
