MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / findNestedAgentFilePath

Function findNestedAgentFilePath

src/utils/sessionStorage.ts:260–284  ·  view source on GitHub ↗
(
  rootDir: string,
  filename: string,
)

Source from the content-addressed store, hash-verified

258}
259
260async function findNestedAgentFilePath(
261 rootDir: string,
262 filename: string,
263): Promise<string | null> {
264 let entries: Dirent[]
265 try {
266 entries = await readdir(rootDir, { withFileTypes: true })
267 } catch (e) {
268 if (isFsInaccessible(e)) return null
269 throw e
270 }
271
272 for (const entry of entries) {
273 const fullPath = join(rootDir, entry.name)
274 if (entry.isFile() && entry.name === filename) {
275 return fullPath
276 }
277 if (entry.isDirectory()) {
278 const nested = await findNestedAgentFilePath(fullPath, filename)
279 if (nested) return nested
280 }
281 }
282
283 return null
284}
285
286async function resolveAgentTranscriptPath(agentId: AgentId): Promise<string> {
287 const directPath = getAgentTranscriptPath(agentId)

Callers 1

Calls 2

readdirFunction · 0.85
isFsInaccessibleFunction · 0.85

Tested by

no test coverage detected