MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / loadAnalysisLinks

Function loadAnalysisLinks

scripts/discord-sample.ts:434–461  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432}
433
434function loadAnalysisLinks(): Map<string, string> {
435 const filePath = process.env.ANALYSIS_LINKS_FILE?.trim();
436 if (!filePath) {
437 return new Map();
438 }
439
440 try {
441 const raw = readFileSync(filePath, "utf-8");
442 const entries = JSON.parse(raw) as AnalysisLinkEntry[];
443 return new Map(
444 entries
445 .filter(
446 (entry) =>
447 typeof entry?.eval === "string" &&
448 entry.eval.length > 0 &&
449 typeof entry?.url === "string" &&
450 entry.url.length > 0,
451 )
452 .map((entry) => [entry.eval, entry.url]),
453 );
454 } catch (error) {
455 console.error(
456 `[discord] Failed to load analysis links from ${filePath}:`,
457 error,
458 );
459 return new Map();
460 }
461}
462
463function buildPayloads(
464 evalSummaries: EvalSummary[],

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected