MCPcopy
hub / github.com/claude-code-best/claude-code / enqueueForLead

Function enqueueForLead

src/hooks/useScheduledTasks.ts:106–125  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

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

Callers 1

useScheduledTasksFunction · 0.85

Calls 4

getCwdFunction · 0.85
markAutonomyRunCancelledFunction · 0.85

Tested by

no test coverage detected