/ src / lib / schedules / schedule-templates.ts
schedule-templates.ts
  1  export interface ScheduleTemplate {
  2    id: string
  3    name: string
  4    description: string
  5    icon: string
  6    category: 'monitoring' | 'reporting' | 'maintenance' | 'content'
  7    defaults: {
  8      taskPrompt: string
  9      scheduleType: 'cron' | 'interval'
 10      cron?: string
 11      intervalMs?: number
 12    }
 13  }
 14  
 15  export const SCHEDULE_TEMPLATES: ScheduleTemplate[] = [
 16    {
 17      id: 'daily-digest',
 18      name: 'Daily Digest',
 19      description: 'Summarize activity from the past 24 hours each morning',
 20      icon: 'Newspaper',
 21      category: 'reporting',
 22      defaults: {
 23        taskPrompt: 'Summarize all notable activity, events, and updates from the past 24 hours. Highlight key metrics, completed tasks, and anything that needs attention.',
 24        scheduleType: 'cron',
 25        cron: '0 9 * * *',
 26      },
 27    },
 28    {
 29      id: 'weekly-report',
 30      name: 'Weekly Report',
 31      description: 'Generate a weekly metrics and progress report every Monday',
 32      icon: 'BarChart3',
 33      category: 'reporting',
 34      defaults: {
 35        taskPrompt: 'Generate a comprehensive weekly report covering key metrics, completed tasks, ongoing work, blockers, and recommendations for the coming week.',
 36        scheduleType: 'cron',
 37        cron: '0 10 * * 1',
 38      },
 39    },
 40    {
 41      id: 'health-monitor',
 42      name: 'Health Monitor',
 43      description: 'Check system health and service status every 5 minutes',
 44      icon: 'HeartPulse',
 45      category: 'monitoring',
 46      defaults: {
 47        taskPrompt: 'Perform a system health check. Verify all services are running, check resource usage (CPU, memory, disk), and report any anomalies or degraded performance.',
 48        scheduleType: 'interval',
 49        intervalMs: 300000,
 50      },
 51    },
 52    {
 53      id: 'content-generation',
 54      name: 'Content Generation',
 55      description: 'Generate daily content such as posts, summaries, or briefs',
 56      icon: 'PenLine',
 57      category: 'content',
 58      defaults: {
 59        taskPrompt: 'Generate fresh content based on current trends and recent activity. Create a well-structured draft ready for review and publishing.',
 60        scheduleType: 'cron',
 61        cron: '0 8 * * *',
 62      },
 63    },
 64    {
 65      id: 'data-cleanup',
 66      name: 'Data Cleanup',
 67      description: 'Run weekly cleanup of stale data and temporary files',
 68      icon: 'Trash2',
 69      category: 'maintenance',
 70      defaults: {
 71        taskPrompt: 'Identify and clean up stale data, expired records, orphaned files, and temporary resources. Log what was removed and any issues encountered.',
 72        scheduleType: 'cron',
 73        cron: '0 2 * * 0',
 74      },
 75    },
 76    {
 77      id: 'metric-snapshot',
 78      name: 'Metric Snapshot',
 79      description: 'Capture an hourly snapshot of key metrics and KPIs',
 80      icon: 'Activity',
 81      category: 'monitoring',
 82      defaults: {
 83        taskPrompt: 'Capture a snapshot of all key metrics and KPIs. Record current values, compare against previous snapshots, and flag any significant changes or threshold breaches.',
 84        scheduleType: 'interval',
 85        intervalMs: 3600000,
 86      },
 87    },
 88    {
 89      id: 'security-audit',
 90      name: 'Security Audit',
 91      description: 'Run a daily security scan and vulnerability check',
 92      icon: 'ShieldCheck',
 93      category: 'monitoring',
 94      defaults: {
 95        taskPrompt: 'Perform a security audit. Check for unusual access patterns, review authentication logs, scan for known vulnerabilities, and report any security concerns.',
 96        scheduleType: 'cron',
 97        cron: '0 0 * * *',
 98      },
 99    },
100    {
101      id: 'backup-check',
102      name: 'Backup Check',
103      description: 'Verify backup integrity and completeness daily',
104      icon: 'DatabaseBackup',
105      category: 'maintenance',
106      defaults: {
107        taskPrompt: 'Verify that all scheduled backups completed successfully. Check backup integrity, storage usage, and retention policy compliance. Alert on any failures.',
108        scheduleType: 'cron',
109        cron: '0 3 * * *',
110      },
111    },
112  ]
113  
114  /** Subset of templates to feature in the empty state */
115  export const FEATURED_TEMPLATE_IDS = ['daily-digest', 'health-monitor', 'content-generation'] as const