({
file_path,
offset,
limit,
pages
}: Partial<Input>, {
verbose
}: {
verbose: boolean;
})
| 28 | return null; |
| 29 | } |
| 30 | export function renderToolUseMessage({ |
| 31 | file_path, |
| 32 | offset, |
| 33 | limit, |
| 34 | pages |
| 35 | }: Partial<Input>, { |
| 36 | verbose |
| 37 | }: { |
| 38 | verbose: boolean; |
| 39 | }): React.ReactNode { |
| 40 | if (!file_path) { |
| 41 | return null; |
| 42 | } |
| 43 | |
| 44 | // For agent output files, return empty string so no parentheses are shown |
| 45 | // The task ID is displayed separately by AssistantToolUseMessage |
| 46 | if (getAgentOutputTaskId(file_path)) { |
| 47 | return ''; |
| 48 | } |
| 49 | const displayPath = verbose ? file_path : getDisplayPath(file_path); |
| 50 | if (pages) { |
| 51 | return <> |
| 52 | <FilePathLink filePath={file_path}>{displayPath}</FilePathLink> |
| 53 | {` · pages ${pages}`} |
| 54 | </>; |
| 55 | } |
| 56 | if (verbose && (offset || limit)) { |
| 57 | const startLine = offset ?? 1; |
| 58 | const lineRange = limit ? `lines ${startLine}-${startLine + limit - 1}` : `from line ${startLine}`; |
| 59 | return <> |
| 60 | <FilePathLink filePath={file_path}>{displayPath}</FilePathLink> |
| 61 | {` · ${lineRange}`} |
| 62 | </>; |
| 63 | } |
| 64 | return <FilePathLink filePath={file_path}>{displayPath}</FilePathLink>; |
| 65 | } |
| 66 | export function renderToolUseTag({ |
| 67 | file_path |
| 68 | }: Partial<Input>): React.ReactNode { |
nothing calls this directly
no test coverage detected