MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / discoverProjectPaths

Function discoverProjectPaths

sdk/src/run-state.ts:330–340  ·  view source on GitHub ↗

* Discovers project paths using .gitignore patterns when projectFiles is undefined. * This intentionally does not read every file into memory; large repositories can * contain generated or binary files that are expensive to retain before parsing.

(params: {
  cwd: string
  fs: CodebuffFileSystem
})

Source from the content-addressed store, hash-verified

328 * contain generated or binary files that are expensive to retain before parsing.
329 */
330async function discoverProjectPaths(params: {
331 cwd: string
332 fs: CodebuffFileSystem
333}): Promise<{ fileTree: FileTreeNode[]; filePaths: string[] }> {
334 const { cwd, fs } = params
335
336 const fileTree = await getProjectFileTree({ projectRoot: cwd, fs })
337 const filePaths = getAllFilePaths(fileTree)
338
339 return { fileTree, filePaths }
340}
341
342/**
343 * Loads user knowledge files from the home directory.

Callers 1

initialSessionStateFunction · 0.85

Calls 2

getProjectFileTreeFunction · 0.90
getAllFilePathsFunction · 0.90

Tested by

no test coverage detected