import { collectCodingProjectDashboard } from './collectors/workspace.js';
export function createCodingAwarenessProvider(options = {}) {
    return {
        domain: 'coding',
        async collect(input) {
            if (input.profile !== 'project_dashboard') {
                throw new Error(`Unsupported coding awareness profile: ${input.profile}`);
            }
            const collectedAt = (options.now ?? (() => new Date()))().toISOString();
            const id = (options.nextId ?? defaultNextId)();
            const collected = await collectCodingProjectDashboard(input);
            const requestedSections = new Set(input.requestedSections ?? [
                'working_environment',
                'workspace_tree',
                'project_signals',
                'inspection_surfaces',
            ]);
            const sections = [];
            if (requestedSections.has('working_environment')) {
                sections.push({
                    type: 'working_environment',
                    data: collected.environment,
                });
            }
            if (requestedSections.has('workspace_tree')) {
                sections.push({
                    type: 'workspace_tree',
                    data: collected.workspaceTree,
                });
            }
            if (requestedSections.has('project_signals')) {
                sections.push({
                    type: 'project_signals',
                    data: collected.projectSignals,
                });
            }
            if (requestedSections.has('inspection_surfaces')) {
                sections.push({
                    type: 'inspection_surfaces',
                    data: collected.inspectionSurfaces,
                });
            }
            return {
                id,
                domain: 'coding',
                profile: 'project_dashboard',
                collectedAt,
                workspaceRoot: input.workspaceRoot,
                sections,
                sources: collected.sources,
                limits: collected.limits,
            };
        },
    };
}
function defaultNextId() {
    return `awareness-${Math.random().toString(36).slice(2, 10)}`;
}
//# sourceMappingURL=provider.js.map