MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / readOf

Function readOf

scripts/agent-eval/parse-run.mjs:823–829  ·  view source on GitHub ↗
(path, prefix)

Source from the content-addressed store, hash-verified

821function reactionOf(action, returned, mentioned, earlier = []) {
822 const { name, input } = action;
823 const readOf = (path, prefix) => {
824 const base = normPath(path).split('/').pop() || String(path ?? '');
825 if (returned.some((r) => samePath(path, r))) return { bucket: 'read_returned', next: `${prefix}Read ${base}` };
826 if (earlier.some((r) => samePath(path, r))) return { bucket: 'read_returned', next: `${prefix}Read ${base} (returned by an earlier explore)` };
827 const named = mentioned.some((m) => samePath(path, m));
828 return { bucket: 'read_missed', next: `${prefix}Read ${base}${named ? ' (named, not returned)' : ''}`, named };
829 };
830 if (/codegraph/.test(name)) return { bucket: 'explore_again', next: name.replace(/^mcp__[^_]*__/, '') };
831 if (name === 'Read' || name === 'NotebookRead') return readOf(input.file_path ?? input.notebook_path, '');
832 if (name === 'Grep' || name === 'Glob') return { bucket: 'search', next: name };

Callers 1

reactionOfFunction · 0.85

Calls 2

normPathFunction · 0.85
samePathFunction · 0.70

Tested by

no test coverage detected