| 59 | } |
| 60 | |
| 61 | function readTargetFor(args: any): ReadTarget | null { |
| 62 | const path = args?.path ?? args?.file_path ?? args?.filePath; |
| 63 | if (!path || typeof path !== 'string') return null; |
| 64 | const { offset, limit, symbol } = args; |
| 65 | const full = offset == null && limit == null && (symbol == null || symbol === ''); |
| 66 | const key = full |
| 67 | ? `${path}\u0000FULL` |
| 68 | : `${path}\u0000o${offset ?? ''}:l${limit ?? ''}:s${symbol ?? ''}`; |
| 69 | return { path, full, key }; |
| 70 | } |
| 71 | |
| 72 | /** Extract the structural outline block from a read_file result, if present. */ |
| 73 | export function extractOutline(content: string | null): string | null { |