( pattern: string, )
| 63 | * Used for Grep/Glob tools where we check patterns, not actual file paths. |
| 64 | */ |
| 65 | export function detectSessionPatternType( |
| 66 | pattern: string, |
| 67 | ): 'session_memory' | 'session_transcript' | null { |
| 68 | const normalized = pattern.split(win32.sep).join(posix.sep) |
| 69 | if ( |
| 70 | normalized.includes('session-memory') && |
| 71 | (normalized.includes('.md') || normalized.endsWith('*')) |
| 72 | ) { |
| 73 | return 'session_memory' |
| 74 | } |
| 75 | if ( |
| 76 | normalized.includes('.jsonl') || |
| 77 | (normalized.includes('projects') && normalized.includes('*.jsonl')) |
| 78 | ) { |
| 79 | return 'session_transcript' |
| 80 | } |
| 81 | return null |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Check if a file path is within the memdir directory. |
no outgoing calls
no test coverage detected