()
| 53 | * Returns paths sorted by filename (chronological by timestamp suffix). |
| 54 | */ |
| 55 | export function getSessionRecordingPaths(): string[] { |
| 56 | const sessionId = getSessionId() |
| 57 | const projectsDir = join(getClaudeConfigHomeDir(), 'projects') |
| 58 | const projectDir = join(projectsDir, sanitizePath(getOriginalCwd())) |
| 59 | try { |
| 60 | // eslint-disable-next-line custom-rules/no-sync-fs -- called during /share before upload, not in hot path |
| 61 | const entries = getFsImplementation().readdirSync(projectDir) |
| 62 | const names = ( |
| 63 | typeof entries[0] === 'string' |
| 64 | ? entries |
| 65 | : (entries as { name: string }[]).map(e => e.name) |
| 66 | ) as string[] |
| 67 | const files = names |
| 68 | .filter(f => f.startsWith(sessionId) && f.endsWith('.cast')) |
| 69 | .sort() |
| 70 | return files.map(f => join(projectDir, f)) |
| 71 | } catch { |
| 72 | return [] |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Rename the recording file to match the current session ID. |
nothing calls this directly
no test coverage detected