* Gets a unique identifier for a file by resolving symlinks to a canonical path. * This allows detection of duplicate files accessed through different paths * (e.g., via symlinks or overlapping parent directories). * Returns null if the file doesn't exist or can't be resolved. * * Uses realpath
(filePath: string)
| 116 | * See: https://github.com/anthropics/claude-code/issues/13893 |
| 117 | */ |
| 118 | async function getFileIdentity(filePath: string): Promise<string | null> { |
| 119 | try { |
| 120 | return await realpath(filePath) |
| 121 | } catch { |
| 122 | return null |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // Internal type to track skill with its file path for deduplication |
| 127 | type SkillWithPath = { |