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

Function getAgentOutputTaskId

src/tools/FileReadTool/UI.tsx:18–29  ·  view source on GitHub ↗

* Check if a file path is an agent output file and extract the task ID. * Agent output files follow the pattern: {projectTempDir}/tasks/{taskId}.output

(filePath: string)

Source from the content-addressed store, hash-verified

16 * Agent output files follow the pattern: {projectTempDir}/tasks/{taskId}.output
17 */
18function getAgentOutputTaskId(filePath: string): string | null {
19 const prefix = `${getTaskOutputDir()}/`;
20 const suffix = '.output';
21 if (filePath.startsWith(prefix) && filePath.endsWith(suffix)) {
22 const taskId = filePath.slice(prefix.length, -suffix.length);
23 // Validate it looks like a task ID (alphanumeric, reasonable length)
24 if (taskId.length > 0 && taskId.length <= 20 && /^[a-zA-Z0-9_-]+$/.test(taskId)) {
25 return taskId;
26 }
27 }
28 return null;
29}
30export function renderToolUseMessage({
31 file_path,
32 offset,

Callers 4

renderToolUseMessageFunction · 0.85
renderToolUseTagFunction · 0.85
userFacingNameFunction · 0.85
getToolUseSummaryFunction · 0.85

Calls 1

getTaskOutputDirFunction · 0.85

Tested by

no test coverage detected