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

Function emitTaskTerminatedSdk

src/utils/sdkEventQueue.ts:114–134  ·  view source on GitHub ↗
(
  taskId: string,
  status: 'completed' | 'failed' | 'stopped',
  opts?: {
    toolUseId?: string
    summary?: string
    outputFile?: string
    usage?: { total_tokens: number; tool_uses: number; duration_ms: number }
  },
)

Source from the content-addressed store, hash-verified

112 * (Scuttle's bg-task dot, VS Code subagent panel) see the task close.
113 */
114export function emitTaskTerminatedSdk(
115 taskId: string,
116 status: 'completed' | 'failed' | 'stopped',
117 opts?: {
118 toolUseId?: string
119 summary?: string
120 outputFile?: string
121 usage?: { total_tokens: number; tool_uses: number; duration_ms: number }
122 },
123): void {
124 enqueueSdkEvent({
125 type: 'system',
126 subtype: 'task_notification',
127 task_id: taskId,
128 tool_use_id: opts?.toolUseId,
129 status,
130 output_file: opts?.outputFile ?? '',
131 summary: opts?.summary ?? '',
132 usage: opts?.usage,
133 })
134}

Callers 7

killInProcessTeammateFunction · 0.85
runInProcessTeammateFunction · 0.85
stopTaskFunction · 0.85
completeMainSessionTaskFunction · 0.85
startBackgroundSessionFunction · 0.85
killFunction · 0.85
CancelRequestHandlerFunction · 0.85

Calls 1

enqueueSdkEventFunction · 0.85

Tested by

no test coverage detected