import sweep from '../sweep.ts' /** * No-arg 5am wrapper. Uses the same contract the scheduler invokes. * Throws after the whole run when any repo listing failed or any session * failed to start, so the job run is red. */ export default async function daily() { const result = await sweep({ dryRun: false }) if (result.ok === false) { const failedRepos = 'repos' in result ? result.repos.filter((entry) => entry.listError).map((entry) => `${entry.repo}: ${entry.listError}`) : [] const sessionErrors = 'errors' in result && Array.isArray(result.errors) ? result.errors : [] throw new Error( `friction-log sweep failed: ${JSON.stringify({ failedRepos, sessionErrors }).slice(0, 2000)}`, ) } return result }