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

Function parseSourcesList

lib/gbrain-sources.ts:53–59  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

51 * throwing — callers treat "no rows" as absent.
52 */
53export function parseSourcesList(raw: unknown): GbrainSourceRow[] {
54 if (Array.isArray(raw)) return raw as GbrainSourceRow[];
55 if (raw && typeof raw === "object" && Array.isArray((raw as { sources?: unknown }).sources)) {
56 return (raw as { sources: GbrainSourceRow[] }).sources;
57 }
58 return [];
59}
60
61export interface EnsureOptions {
62 /** Pass --federated to `gbrain sources add`. Default false. */

Callers 6

resolveMemorySourceIdFunction · 0.90
fetchSourcesFunction · 0.90
sourceLocalPathFunction · 0.90
probeSourceFunction · 0.85
sourcePageCountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected