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

Function spawnGbrain

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

Source from the content-addressed store, hash-verified

159 * `stderr` exactly as they would with `spawnSync` directly.
160 */
161export function spawnGbrain(args: string[], opts: SpawnGbrainOptions = {}): SpawnSyncReturns<string> {
162 return spawnSync("gbrain", args, {
163 encoding: "utf-8",
164 timeout: opts.timeout ?? 30_000,
165 cwd: opts.cwd,
166 stdio: opts.stdio || ["ignore", "pipe", "pipe"],
167 env: buildGbrainEnv({ baseEnv: opts.baseEnv, announce: opts.announce }),
168 shell: NEEDS_SHELL_ON_WINDOWS, // #1731: gbrain is a .cmd shim on Windows
169 });
170}
171
172/**
173 * Run `gbrain <args>` and parse stdout as JSON. Returns `null` on

Callers 8

resolveMemorySourceIdFunction · 0.90
semanticRecallFunction · 0.90
safeSourcesRemoveFunction · 0.90
runCodeImportFunction · 0.90
runDreamFunction · 0.90
execGbrainJsonFunction · 0.85

Calls 2

spawnSyncFunction · 0.85
buildGbrainEnvFunction · 0.85

Tested by

no test coverage detected