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

Method handlePartial

src/core/tools/SearchFilesTool.ts:74–92  ·  view source on GitHub ↗
(task: Task, block: ToolUse<"search_files">)

Source from the content-addressed store, hash-verified

72 }
73
74 override async handlePartial(task: Task, block: ToolUse<"search_files">): Promise<void> {
75 const relDirPath = block.params.path
76 const regex = block.params.regex
77 const filePattern = block.params.file_pattern
78
79 const absolutePath = relDirPath ? path.resolve(task.cwd, relDirPath) : task.cwd
80 const isOutsideWorkspace = isPathOutsideWorkspace(absolutePath)
81
82 const sharedMessageProps: ClineSayTool = {
83 tool: "searchFiles",
84 path: getReadablePath(task.cwd, relDirPath ?? ""),
85 regex: regex ?? "",
86 filePattern: filePattern ?? "",
87 isOutsideWorkspace,
88 }
89
90 const partialMessage = JSON.stringify({ ...sharedMessageProps, content: "" } satisfies ClineSayTool)
91 await task.ask("tool", partialMessage, block.partial).catch(() => {})
92 }
93}
94
95export const searchFilesTool = new SearchFilesTool()

Callers

nothing calls this directly

Calls 3

isPathOutsideWorkspaceFunction · 0.90
getReadablePathFunction · 0.90
askMethod · 0.80

Tested by

no test coverage detected