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

Function getPendingProjectHooks

src/config/settings.ts:145–158  ·  view source on GitHub ↗
(cwd = process.cwd())

Source from the content-addressed store, hash-verified

143 * trusted). The TUI uses this to gate project hooks behind a trust prompt.
144 */
145export function getPendingProjectHooks(cwd = process.cwd()): { commands: string[] } | null {
146 const hooks = readProjectHooks(cwd)
147 if (!hooks) return null
148 if (isProjectHooksTrusted(cwd, hashHooks(hooks))) return null
149 const commands: string[] = []
150 for (const matchers of Object.values(hooks)) {
151 for (const matcher of matchers ?? []) {
152 for (const hook of matcher.hooks ?? []) {
153 if (hook?.command) commands.push(hook.command)
154 }
155 }
156 }
157 return { commands }
158}
159
160/** Make sure ~/.orbcode/settings.json exists (empty JSON) so users can find it. */
161function ensureUserSettingsFile(): void {

Callers 3

runHeadlessFunction · 0.85
AppFunction · 0.85

Calls 3

readProjectHooksFunction · 0.85
isProjectHooksTrustedFunction · 0.85
hashHooksFunction · 0.85

Tested by

no test coverage detected