MCPcopy Index your code
hub / github.com/simstudioai/sim / readFile

Function readFile

apps/sim/app/api/function/execute/route.ts:812–822  ·  view source on GitHub ↗
(args: unknown, encoding: 'base64' | 'text', chunked = false)

Source from the content-addressed store, hash-verified

810 recordMaterializedAccessKeys({ largeValueKeys, fileKeys }, value)
811
812 const readFile = async (args: unknown, encoding: 'base64' | 'text', chunked = false) => {
813 const fileArgs = getBrokerFileArgs(args)
814 return readUserFileContent(fileArgs.file, {
815 ...base,
816 encoding,
817 maxBytes: fileArgs.maxBytes,
818 chunked,
819 offset: chunked ? fileArgs.offset : undefined,
820 length: chunked ? fileArgs.length : undefined,
821 })
822 }
823
824 return {
825 'sim.files.readBase64': (args) => readFile(args, 'base64'),

Callers 15

parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
parseFileMethod · 0.85
downloadFileFunction · 0.85
handleLocalFileFunction · 0.85
handleLocalFilePublicFunction · 0.85

Calls 2

readUserFileContentFunction · 0.90
getBrokerFileArgsFunction · 0.85

Tested by

no test coverage detected