MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / handlePartial

Method handlePartial

src/core/tools/ReadFileTool.ts:638–661  ·  view source on GitHub ↗
(task: Task, block: ToolUse<"read_file">)

Source from the content-addressed store, hash-verified

636 }
637
638 override async handlePartial(task: Task, block: ToolUse<"read_file">): Promise<void> {
639 // Handle both legacy and new format for partial display
640 let filePath = ""
641 if (block.nativeArgs) {
642 if (isLegacyReadFileParams(block.nativeArgs)) {
643 // Legacy format - show first file
644 filePath = block.nativeArgs.files[0]?.path ?? ""
645 } else {
646 filePath = block.nativeArgs.path ?? ""
647 }
648 }
649
650 const fullPath = filePath ? path.resolve(task.cwd, filePath) : ""
651 const sharedMessageProps: ClineSayTool = {
652 tool: "readFile",
653 path: getReadablePath(task.cwd, filePath),
654 isOutsideWorkspace: filePath ? isPathOutsideWorkspace(fullPath) : false,
655 }
656 const partialMessage = JSON.stringify({
657 ...sharedMessageProps,
658 content: undefined,
659 } satisfies ClineSayTool)
660 await task.ask("tool", partialMessage, block.partial).catch(() => {})
661 }
662
663 /**
664 * Execute legacy multi-file format for backward compatibility.

Callers

nothing calls this directly

Calls 4

isLegacyReadFileParamsFunction · 0.90
getReadablePathFunction · 0.90
isPathOutsideWorkspaceFunction · 0.90
askMethod · 0.80

Tested by

no test coverage detected