(path: string, content: string | null)
| 91 | } |
| 92 | |
| 93 | function 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 | |
| 103 | function isStub(content: string | null): boolean { |
| 104 | return typeof content === 'string' && content.startsWith(STUB_MARK); |
no test coverage detected