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

Function enqueueTaskNotification

source code/utils/task/framework.ts:276–292  ·  view source on GitHub ↗

* Enqueue a task notification to the message queue.

(attachment: TaskAttachment)

Source from the content-addressed store, hash-verified

274 * Enqueue a task notification to the message queue.
275 */
276function enqueueTaskNotification(attachment: TaskAttachment): void {
277 const statusText = getStatusText(attachment.status)
278
279 const outputPath = getTaskOutputPath(attachment.taskId)
280 const toolUseIdLine = attachment.toolUseId
281 ? `\n<${TOOL_USE_ID_TAG}>${attachment.toolUseId}</${TOOL_USE_ID_TAG}>`
282 : ''
283 const message = `<${TASK_NOTIFICATION_TAG}>
284<${TASK_ID_TAG}>${attachment.taskId}</${TASK_ID_TAG}>${toolUseIdLine}
285<${TASK_TYPE_TAG}>${attachment.taskType}</${TASK_TYPE_TAG}>
286<${OUTPUT_FILE_TAG}>${outputPath}</${OUTPUT_FILE_TAG}>
287<${STATUS_TAG}>${attachment.status}</${STATUS_TAG}>
288<${SUMMARY_TAG}>Task "${attachment.description}" ${statusText}</${SUMMARY_TAG}>
289</${TASK_NOTIFICATION_TAG}>`
290
291 enqueuePendingNotification({ value: message, mode: 'task-notification' })
292}
293
294/**
295 * Get human-readable status text.

Callers 1

pollTasksFunction · 0.85

Calls 3

getStatusTextFunction · 0.85
getTaskOutputPathFunction · 0.85

Tested by

no test coverage detected