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

Method handlePartial

src/core/tools/ListFilesTool.ts:71–87  ·  view source on GitHub ↗
(task: Task, block: ToolUse<"list_files">)

Source from the content-addressed store, hash-verified

69 }
70
71 override async handlePartial(task: Task, block: ToolUse<"list_files">): Promise<void> {
72 const relDirPath: string | undefined = block.params.path
73 const recursiveRaw: string | undefined = block.params.recursive
74 const recursive = recursiveRaw?.toLowerCase() === "true"
75
76 const absolutePath = relDirPath ? path.resolve(task.cwd, relDirPath) : task.cwd
77 const isOutsideWorkspace = isPathOutsideWorkspace(absolutePath)
78
79 const sharedMessageProps: ClineSayTool = {
80 tool: !recursive ? "listFilesTopLevel" : "listFilesRecursive",
81 path: getReadablePath(task.cwd, relDirPath ?? ""),
82 isOutsideWorkspace,
83 }
84
85 const partialMessage = JSON.stringify({ ...sharedMessageProps, content: "" } satisfies ClineSayTool)
86 await task.ask("tool", partialMessage, block.partial).catch(() => {})
87 }
88}
89
90export const listFilesTool = new ListFilesTool()

Callers

nothing calls this directly

Calls 3

isPathOutsideWorkspaceFunction · 0.90
getReadablePathFunction · 0.90
askMethod · 0.80

Tested by

no test coverage detected