MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / isProjectHooksTrusted

Function isProjectHooksTrusted

src/config/settings.ts:116–124  ·  view source on GitHub ↗
(cwd: string, hash: string)

Source from the content-addressed store, hash-verified

114}
115
116function isProjectHooksTrusted(cwd: string, hash: string): boolean {
117 // Escape hatch for CI / non-interactive automation. Only honored when
118 // stdin is not a TTY (so a stray export in a shell rc file can't silently
119 // disable the trust gate for interactive sessions). A non-TTY check keeps
120 // the gate meaningful in the TUI while still letting CI opt in.
121 if (process.env.MATTERAI_TRUST_PROJECT_HOOKS === "1" && !process.stdin.isTTY) return true
122 const store = readJson(getTrustStorePath())
123 return Boolean(store && store[cwd] === hash)
124}
125
126/** Persist trust for the current project's hooks (call after the user agrees). */
127export function trustProjectHooks(cwd = process.cwd()): void {

Callers 2

getPendingProjectHooksFunction · 0.85
loadSettingsFunction · 0.85

Calls 2

getTrustStorePathFunction · 0.85
readJsonFunction · 0.70

Tested by

no test coverage detected