MCPcopy Create free account
hub / github.com/garrytan/gstack / loadGbrainOverride

Function loadGbrainOverride

scripts/gen-skill-docs.ts:44–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42const RESPECT_DETECTION = process.argv.includes('--respect-detection');
43
44function loadGbrainOverride(): { detected: boolean } {
45 if (!RESPECT_DETECTION) return { detected: false };
46 const stateDir = process.env.GSTACK_HOME || path.join(process.env.HOME || '', '.gstack');
47 const detectionPath = path.join(stateDir, 'gbrain-detection.json');
48 try {
49 const json = JSON.parse(fs.readFileSync(detectionPath, 'utf-8')) as { gbrain_local_status?: string };
50 // "timeout" = slow-but-healthy engine (#1964) — same treatment as "ok",
51 // matching gstack-gbrain-detect --is-ok.
52 return { detected: json.gbrain_local_status === 'ok' || json.gbrain_local_status === 'timeout' };
53 } catch {
54 return { detected: false };
55 }
56}
57
58const GBRAIN_OVERRIDE = loadGbrainOverride();
59

Callers 1

gen-skill-docs.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected