Files
2026-11-14 09:56:45 +00:00

27 lines
951 B
TypeScript

// When the agent module's run retention sweep runs (G3j): hourly, in each project the app serves, with the
// retention the environment sets (AGENT_RUN_RETENTION_DAYS, config/src/agent.ts). The composition root turns
// it on (apps/worker/src/schedules.ts), as it does the account and files sweeps. The schedule is the
// adapter-neutral form, so the module imports no adapter.
import { RUN_EXPIRE_CRON, RUN_EXPIRE_JOB } from "./contract/constants.js"
export function agentSchedules(retentionDays: number): readonly {
job: string
cron: string
scope: { level: "each-project" }
payload: { retentionDays: number }
key: string
missed: "skip"
}[] {
return Object.freeze([
Object.freeze({
job: RUN_EXPIRE_JOB,
cron: RUN_EXPIRE_CRON,
scope: Object.freeze({ level: "each-project" as const }),
payload: Object.freeze({ retentionDays }),
key: "agent.runs.expire",
missed: "skip" as const,
}),
])
}