MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / isGrantedPath

Function isGrantedPath

desktop/runtime/attachment-file-tools.ts:73–80  ·  view source on GitHub ↗
(filePath: string, grants: AttachmentGrant, cwd: string)

Source from the content-addressed store, hash-verified

71}
72
73async 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
82async function isGrantedDirectoryPath(filePath: string, grants: AttachmentGrant, cwd: string) {
83 const resolved = await tryRealpath(await existingPathVariant(resolveToolPath(filePath, cwd)))

Callers 1

assertGrantedPathFunction · 0.85

Calls 4

tryRealpathFunction · 0.85
existingPathVariantFunction · 0.85
resolveToolPathFunction · 0.85
isWithinDirectoryFunction · 0.85

Tested by

no test coverage detected