// resources/workspace-overview-resource.ts — MCP resource for planu://workspace/overview
// Returns a JSON snapshot of all registered projects and their spec counts.
// No parameters required — aggregates across all registered projects.
import { buildWorkspaceOverview } from '../engine/workspace-manager.js';
/**
 * MCP resource handler for planu://workspace/overview
 */
export async function handleWorkspaceOverviewResource() {
    const result = await buildWorkspaceOverview();
    return JSON.stringify({
        projectCount: result.projectCount,
        generatedAt: result.generatedAt,
        projects: result.projects.map((p) => ({
            path: p.path,
            specCount: p.specCount,
            doneCount: p.doneCount,
            implementingCount: p.implementingCount,
            reviewCount: p.reviewCount,
            approvedCount: p.approvedCount,
            healthScore: p.healthScore,
        })),
    }, null, 2);
}
export const workspaceOverviewResourceDefinition = {
    uri: 'planu://workspace/overview',
    name: 'Workspace Overview',
    description: 'Snapshot of all registered projects: spec counts, health scores, and status breakdown. ' +
        'Read-only. No parameters required.',
    mimeType: 'application/json',
};
//# sourceMappingURL=workspace-overview-resource.js.map