MCPcopy Create free account
hub / github.com/Noumena-Network/code / isPathTrusted

Function isPathTrusted

src/utils/config.ts:757–766  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

755 * /assistant installing into a user-typed path).
756 */
757export function isPathTrusted(dir: string): boolean {
758 const config = getGlobalConfig()
759 let currentPath = normalizePathForConfigKey(resolve(dir))
760 while (true) {
761 if (config.projects?.[currentPath]?.hasTrustDialogAccepted) return true
762 const parentPath = normalizePathForConfigKey(resolve(currentPath, '..'))
763 if (parentPath === currentPath) return false
764 currentPath = parentPath
765 }
766}
767
768// We have to put this test code here because Jest doesn't support mocking ES modules :O
769const TEST_GLOBAL_CONFIG_FOR_TESTING: GlobalConfig = {

Callers

nothing calls this directly

Calls 3

getGlobalConfigFunction · 0.70
resolveFunction · 0.70

Tested by

no test coverage detected