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

Function parseHookOutput

src/core/hooks.ts:297–307  ·  view source on GitHub ↗
(stdout: string)

Source from the content-addressed store, hash-verified

295}
296
297function parseHookOutput(stdout: string): { json?: HookJsonOutput; plainText?: string } {
298 const trimmed = stdout.trim()
299 if (!trimmed.startsWith("{")) return { plainText: stdout }
300 try {
301 const parsed = JSON.parse(trimmed)
302 if (parsed && typeof parsed === "object") return { json: parsed as HookJsonOutput }
303 return { plainText: stdout }
304 } catch {
305 return { plainText: stdout }
306 }
307}
308
309function aggregate(results: PerHookResult[]): AggregatedHookResult {
310 const out: AggregatedHookResult = { blocked: false, stopAll: false }

Callers 1

runOneMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected