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

Function sourceLocalPath

bin/gstack-gbrain-sync.ts:455–463  ·  view source on GitHub ↗
(sourceId: string, env?: NodeJS.ProcessEnv)

Source from the content-addressed store, hash-verified

453 * (mirrors `probeSource`/`sourcePageCount` in lib/gbrain-sources.ts).
454 */
455export function sourceLocalPath(sourceId: string, env?: NodeJS.ProcessEnv): string | null {
456 const raw = execGbrainJson<unknown>(
457 ["sources", "list", "--json"],
458 { baseEnv: env },
459 );
460 if (!raw) return null;
461 const found = parseSourcesList(raw).find((s) => s.id === sourceId);
462 return found?.local_path ?? null;
463}
464
465/** Result of `planHostnameFoldMigration` — informs `runCodeImport` of next steps. */
466export type HostnameFoldMigration =

Callers 2

Calls 2

execGbrainJsonFunction · 0.90
parseSourcesListFunction · 0.90

Tested by

no test coverage detected