MCPcopy Index your code
hub / github.com/codeaashu/claude-code / call

Function call

src/tools/TaskOutputTool/TaskOutputTool.tsx:208–282  ·  view source on GitHub ↗
(input: TaskOutputToolInput, toolUseContext, _canUseTool, _parentMessage, onProgress)

Source from the content-addressed store, hash-verified

206 };
207 },
208 async call(input: TaskOutputToolInput, toolUseContext, _canUseTool, _parentMessage, onProgress) {
209 const {
210 task_id,
211 block,
212 timeout
213 } = input;
214 const appState = toolUseContext.getAppState();
215 const task = appState.tasks?.[task_id] as TaskState | undefined;
216 if (!task) {
217 throw new Error(`No task found with ID: ${task_id}`);
218 }
219 if (!block) {
220 // Non-blocking: return current state
221 if (task.status !== 'running' && task.status !== 'pending') {
222 // Mark as notified
223 updateTaskState(task_id, toolUseContext.setAppState, t => ({
224 ...t,
225 notified: true
226 }));
227 return {
228 data: {
229 retrieval_status: 'success' as const,
230 task: await getTaskOutputData(task)
231 }
232 };
233 }
234 return {
235 data: {
236 retrieval_status: 'not_ready' as const,
237 task: await getTaskOutputData(task)
238 }
239 };
240 }
241
242 // Blocking: wait for completion
243 if (onProgress) {
244 onProgress({
245 toolUseID: `task-output-waiting-${Date.now()}`,
246 data: {
247 type: 'waiting_for_task',
248 taskDescription: task.description,
249 taskType: task.type
250 }
251 });
252 }
253 const completedTask = await waitForTaskCompletion(task_id, toolUseContext.getAppState, timeout, toolUseContext.abortController);
254 if (!completedTask) {
255 return {
256 data: {
257 retrieval_status: 'timeout' as const,
258 task: null
259 }
260 };
261 }
262 if (completedTask.status === 'running' || completedTask.status === 'pending') {
263 return {
264 data: {
265 retrieval_status: 'timeout' as const,

Callers

nothing calls this directly

Calls 4

getTaskOutputDataFunction · 0.85
waitForTaskCompletionFunction · 0.85
updateTaskStateFunction · 0.50
onProgressFunction · 0.50

Tested by

no test coverage detected