(prompt: string)
| 104 | // primary use case for scheduled tasks. |
| 105 | let disposed = false |
| 106 | const enqueueForLead = async (prompt: string) => { |
| 107 | const command = await createAutonomyQueuedPrompt({ |
| 108 | basePrompt: prompt, |
| 109 | trigger: 'scheduled-task', |
| 110 | currentDir: getCwd(), |
| 111 | workload: WORKLOAD_CRON, |
| 112 | shouldCreate: () => !disposed, |
| 113 | }) |
| 114 | if (!command) { |
| 115 | return |
| 116 | } |
| 117 | if (disposed) { |
| 118 | await markAutonomyRunCancelled( |
| 119 | command.autonomy!.runId, |
| 120 | command.autonomy!.rootDir, |
| 121 | ) |
| 122 | return |
| 123 | } |
| 124 | enqueuePendingNotification(command) |
| 125 | } |
| 126 | |
| 127 | const scheduler = createCronScheduler({ |
| 128 | // Missed-task surfacing (onFire fallback). Teammate crons are always |
no test coverage detected