MCPcopy Create free account
hub / github.com/wonderwhy-er/DesktopCommanderMCP / canHandle

Method canHandle

src/utils/files/binary.ts:23–31  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

21 */
22export class BinaryFileHandler implements FileHandler {
23 async canHandle(filePath: string): Promise<boolean> {
24 // Content-based binary detection using isBinaryFile
25 try {
26 return await isBinaryFile(filePath);
27 } catch (error) {
28 // If we can't check (file doesn't exist, etc.), don't handle it
29 return false;
30 }
31 }
32
33 async read(filePath: string, options?: ReadOptions): Promise<FileResult> {
34 const instructions = this.getBinaryInstructions(filePath);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected