MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / agedStub

Function agedStub

src/agent/read-cache.ts:93–101  ·  view source on GitHub ↗
(path: string, content: string | null)

Source from the content-addressed store, hash-verified

91}
92
93function agedStub(path: string, content: string | null): string {
94 const outline = extractOutline(content);
95 const n = approxLineCount(content);
96 const meta = n ? ` (~${n} lines)` : '';
97 const head = `${STUB_MARK} ${path} was read earlier this session; its body is elided here to save context${meta}.`;
98 return outline
99 ? `${head}\nOutline:\n${outline}\nCall read_file on this path for exact lines (e.g. to patch).`
100 : `${head}\nCall read_file on this path if you need its current contents (e.g. to patch).`;
101}
102
103function isStub(content: string | null): boolean {
104 return typeof content === 'string' && content.startsWith(STUB_MARK);

Callers 1

compactFileReadsFunction · 0.85

Calls 2

extractOutlineFunction · 0.85
approxLineCountFunction · 0.85

Tested by

no test coverage detected