MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / readFileWithByteLimit

Function readFileWithByteLimit

agentContext/builder.go:340–349  ·  view source on GitHub ↗
(path string, maxBytes int)

Source from the content-addressed store, hash-verified

338 instructionFilePath := filepath.Join(directory, filename)
339 info, err := os.Stat(instructionFilePath)
340 if err != nil || info.IsDir() {
341 continue
342 }
343 content, truncated, err := readFileWithByteLimit(instructionFilePath, maxBytes)
344 if err != nil {
345 return ProjectDoc{}, err
346 }
347 return ProjectDoc{
348 Path: instructionFilePath,
349 Dir: directory,
350 Filename: filename,
351 Content: strings.ToValidUTF8(string(content), "\uFFFD"),
352 Truncated: truncated,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected