MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / enqueueTaskNotification

Function enqueueTaskNotification

src/utils/task/framework.ts:274–290  ·  view source on GitHub ↗

* Enqueue a task notification to the message queue.

(attachment: TaskAttachment)

Source from the content-addressed store, hash-verified

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

Callers 1

pollTasksFunction · 0.85

Calls 3

getStatusTextFunction · 0.85
getTaskOutputPathFunction · 0.85

Tested by

no test coverage detected