/** * Autopilot setup/readiness surface for the factory. * Absorbed from kentcdodds/kcd-skills autopilot (not an npm dependency). */ export { AUTOPILOT_PILLARS, AUTOPILOT_RUNGS, defaultInterviewAnswers, emptyAudit, type AutopilotAudit, type AutopilotPillar, type AutopilotRung, type InterviewAnswers, type RungScore, } from './rungs.ts' export type AutopilotStatus = { ok: boolean rungsDone: number rungsTotal: number missing: number[] partial: number[] humanChecklistOpen: number } export function summarizeAudit(audit: { scores: Record humanChecklist: unknown[] }): AutopilotStatus { const entries = Object.entries(audit.scores) const done = entries.filter(([, v]) => v.score === 'done' || v.score === 'n/a').length const missing = entries.filter(([, v]) => v.score === 'missing').map(([n]) => Number(n)) const partial = entries.filter(([, v]) => v.score === 'partial').map(([n]) => Number(n)) return { ok: missing.length === 0 && partial.length === 0, rungsDone: done, rungsTotal: entries.length, missing, partial, humanChecklistOpen: audit.humanChecklist.length, } }