MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / pollTasks

Function pollTasks

source code/utils/task/framework.ts:257–271  ·  view source on GitHub ↗
(
  getAppState: () => AppState,
  setAppState: SetAppState,
)

Source from the content-addressed store, hash-verified

255 * This is the main polling loop called by the framework.
256 */
257export async function pollTasks(
258 getAppState: () => AppState,
259 setAppState: SetAppState,
260): Promise<void> {
261 const state = getAppState()
262 const { attachments, updatedTaskOffsets, evictedTaskIds } =
263 await generateTaskAttachments(state)
264
265 applyTaskOffsetsAndEvictions(setAppState, updatedTaskOffsets, evictedTaskIds)
266
267 // Send notifications for completed tasks
268 for (const attachment of attachments) {
269 enqueueTaskNotification(attachment)
270 }
271}
272
273/**
274 * Enqueue a task notification to the message queue.

Callers

nothing calls this directly

Calls 4

generateTaskAttachmentsFunction · 0.85
enqueueTaskNotificationFunction · 0.85
getAppStateFunction · 0.50

Tested by

no test coverage detected