( toolName: string, toolInput: unknown, )
| 121 | * Uses the same conditions as the PostToolUse session file access hooks. |
| 122 | */ |
| 123 | export function isMemoryFileAccess( |
| 124 | toolName: string, |
| 125 | toolInput: unknown, |
| 126 | ): boolean { |
| 127 | if (getSessionFileTypeFromInput(toolName, toolInput) === 'session_memory') { |
| 128 | return true |
| 129 | } |
| 130 | |
| 131 | const filePath = getFilePathFromInput(toolName, toolInput) |
| 132 | if ( |
| 133 | filePath && |
| 134 | (isAutoMemFile(filePath) || |
| 135 | (feature('TEAMMEM') && teamMemPaths!.isTeamMemFile(filePath))) |
| 136 | ) { |
| 137 | return true |
| 138 | } |
| 139 | |
| 140 | return false |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * PostToolUse callback to log session file access events. |
no test coverage detected