MCPcopy Create free account
hub / github.com/braintrustdata/bash-agent-evals / loadData

Function loadData

src/tools/codemode-tools.ts:74–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74function loadData(): CodemodeData {
75 if (cachedData) return cachedData;
76
77 if (!existsSync(DATA_PATH)) {
78 throw new Error(`Data file not found: ${DATA_PATH}\nRun 'pnpm transform:codemode' first.`);
79 }
80
81 console.log('Loading codemode data...');
82 const raw = readFileSync(DATA_PATH, 'utf-8');
83 cachedData = JSON.parse(raw) as CodemodeData;
84 console.log(
85 `Loaded: ${cachedData.repos.length} repos, ${cachedData.users.length} users, ${cachedData.issues.length} issues, ${cachedData.pulls.length} pulls`,
86 );
87 return cachedData;
88}
89
90function truncateOutput(output: string): string {
91 if (output.length <= MAX_OUTPUT_CHARS) return output;

Callers 1

codemode-tools.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected