(filePath: string, grants: AttachmentGrant, cwd: string)
| 71 | } |
| 72 | |
| 73 | async function isGrantedPath(filePath: string, grants: AttachmentGrant, cwd: string) { |
| 74 | const resolved = await tryRealpath(await existingPathVariant(resolveToolPath(filePath, cwd))) |
| 75 | if (grants.files.has(resolved)) return true |
| 76 | for (const directory of grants.directories) { |
| 77 | if (isWithinDirectory(resolved, directory)) return true |
| 78 | } |
| 79 | return false |
| 80 | } |
| 81 | |
| 82 | async function isGrantedDirectoryPath(filePath: string, grants: AttachmentGrant, cwd: string) { |
| 83 | const resolved = await tryRealpath(await existingPathVariant(resolveToolPath(filePath, cwd))) |
no test coverage detected