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

Function extractOutline

src/agent/read-cache.ts:73–82  ·  view source on GitHub ↗
(content: string | null)

Source from the content-addressed store, hash-verified

71
72/** Extract the structural outline block from a read_file result, if present. */
73export function extractOutline(content: string | null): string | null {
74 if (!content) return null;
75 const idx = content.indexOf('OUTLINE');
76 if (idx === -1) return null;
77 const tail = content.slice(idx);
78 const stop = tail.search(/\n\s*(HEAD\b|---|===|\.\.\.)/);
79 const block = (stop === -1 ? tail : tail.slice(0, stop)).trim();
80 const lines = block.split('\n').slice(0, 40).join('\n').trim();
81 return lines || null;
82}
83
84function approxLineCount(content: string | null): number | null {
85 if (!content) return null;

Callers 2

read-cache.test.tsFile · 0.85
agedStubFunction · 0.85

Calls 1

searchMethod · 0.65

Tested by

no test coverage detected