MCPcopy
hub / github.com/garrytan/gstack / execGbrainJson

Function execGbrainJson

lib/gbrain-exec.ts:177–185  ·  view source on GitHub ↗
(args: string[], opts: SpawnGbrainOptions = {})

Source from the content-addressed store, hash-verified

175 * list --json` and similar.
176 */
177export function execGbrainJson<T = unknown>(args: string[], opts: SpawnGbrainOptions = {}): T | null {
178 const r = spawnGbrain(args, opts);
179 if (r.status !== 0) return null;
180 try {
181 return JSON.parse(r.stdout || "null") as T;
182 } catch {
183 return null;
184 }
185}
186
187/**
188 * Async streaming variant for callers that need to attach stdout/stderr

Callers 3

cycleCompletedFunction · 0.90
fetchSourcesFunction · 0.90
sourceLocalPathFunction · 0.90

Calls 1

spawnGbrainFunction · 0.85

Tested by

no test coverage detected