MCPcopy Index your code
hub / github.com/Noumena-Network/code / getExistingSessionFile

Method getExistingSessionFile

src/utils/sessionStorage.ts:1367–1382  ·  view source on GitHub ↗
(
    sessionId: UUID,
  )

Source from the content-addressed store, hash-verified

1365 */
1366 private existingSessionFiles = new Map<string, string>()
1367 private async getExistingSessionFile(
1368 sessionId: UUID,
1369 ): Promise<string | null> {
1370 const cached = this.existingSessionFiles.get(sessionId)
1371 if (cached) return cached
1372
1373 const targetFile = getTranscriptPathForSession(sessionId)
1374 try {
1375 await stat(targetFile)
1376 this.existingSessionFiles.set(sessionId, targetFile)
1377 return targetFile
1378 } catch (e) {
1379 if (isFsInaccessible(e)) return null
1380 throw e
1381 }
1382 }
1383
1384 private async persistToRemote(sessionId: UUID, entry: TranscriptMessage) {
1385 if (isShuttingDown()) {

Callers 1

appendEntryMethod · 0.95

Calls 5

statFunction · 0.85
isFsInaccessibleFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected