import { regenerateSpecSummaryHtml } from '../../spec-summary-html.js';
import { withAudit } from '../../autopilot/audit-logger.js';
async function handler(ctx) {
    const { projectPath, specId, allSpecs, newStatus } = ctx;
    if (!projectPath) {
        return;
    }
    await withAudit(projectPath, `update_status(${newStatus})`, 'regenerateSpecSummaryHtml', () => regenerateSpecSummaryHtml(projectPath, allSpecs, [specId])).catch((err) => {
        console.error('[planu] HTML regen failed:', err);
    });
}
export const htmlRegenHook = {
    id: 'html-regen',
    triggers: ['done'], // only on done
    requiresProjectPath: true,
    label: 'Run legacy dashboard compatibility hook without writing project HTML',
    handler,
};
//# sourceMappingURL=html-regen.hook.js.map