// tools/scan-project.ts — MCP tool handler for scan_project (SPEC-134)
import { scanProject } from '../engine/scan-project/index.js';
import { hashProjectPath } from '../storage/base-store.js';
import { compactResult, compactJson } from './output-formatter.js';
export async function handleScanProject(params) {
    try {
        const input = {
            ...params,
            projectId: params.projectId ?? hashProjectPath(params.path),
        };
        const result = await scanProject(input);
        return compactResult(compactJson(result, 80));
    }
    catch (error) {
        return {
            content: [
                {
                    type: 'text',
                    text: `scan_project failed: ${error instanceof Error ? error.message : String(error)}`,
                },
            ],
            isError: true,
        };
    }
}
//# sourceMappingURL=scan-project.js.map