MCPcopy Create free account
hub / github.com/cortexkit/magic-context / main

Function main

packages/plugin/scripts/longmemeval/runner.ts:957–988  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

955}
956
957async function main(): Promise<void> {
958 const argv = process.argv.slice(2);
959 if (argv.includes("--help") || argv.includes("-h")) {
960 console.log(printUsage());
961 return;
962 }
963
964 const projectDirectory = resolve(import.meta.dir, "../..");
965 const config = parseRunnerConfig(argv, projectDirectory);
966 await ensureOutputArea(config);
967 await appendLog(config.paths.logFile, `Runner started with dataset ${config.datasetPath}`);
968
969 const dataset = await loadDataset(config.datasetPath);
970 const workItems = selectQuestions(dataset, config);
971 const state = await loadState(config);
972 const resultsMap = await loadResultsMap(config.paths.resultsFile);
973 reconcileStateWithResults(state, resultsMap);
974 await persistState(config, state);
975 const client = createClient(config);
976
977 try {
978 await runWithParallelism({
979 client,
980 config,
981 workItems,
982 state,
983 resultsMap,
984 });
985 } finally {
986 await writeSummary(config, resultsMap, workItems.length);
987 }
988}
989
990main().catch((error) => {
991 const typed = asError(error);

Callers 1

runner.tsFile · 0.70

Calls 14

printUsageFunction · 0.90
parseRunnerConfigFunction · 0.90
ensureOutputAreaFunction · 0.85
appendLogFunction · 0.85
loadDatasetFunction · 0.85
selectQuestionsFunction · 0.85
loadStateFunction · 0.85
loadResultsMapFunction · 0.85
persistStateFunction · 0.85
runWithParallelismFunction · 0.85
writeSummaryFunction · 0.85

Tested by

no test coverage detected