(
content: { type: string; name?: string; input?: unknown } | undefined,
tools: Tools,
)
| 260 | * Returns { isSearch, isRead, isREPL } if it's a collapsible search/read, null otherwise. |
| 261 | */ |
| 262 | export function getSearchOrReadFromContent( |
| 263 | content: { type: string; name?: string; input?: unknown } | undefined, |
| 264 | tools: Tools, |
| 265 | ): { |
| 266 | isSearch: boolean |
| 267 | isRead: boolean |
| 268 | isList: boolean |
| 269 | isREPL: boolean |
| 270 | isMemoryWrite: boolean |
| 271 | isAbsorbedSilently: boolean |
| 272 | mcpServerName?: string |
| 273 | isBash?: boolean |
| 274 | } | null { |
| 275 | if (content?.type === 'tool_use' && content.name) { |
| 276 | const info = getToolSearchOrReadInfo(content.name, content.input, tools) |
| 277 | if (info.isCollapsible || info.isREPL) { |
| 278 | return { |
| 279 | isSearch: info.isSearch, |
| 280 | isRead: info.isRead, |
| 281 | isList: info.isList, |
| 282 | isREPL: info.isREPL, |
| 283 | isMemoryWrite: info.isMemoryWrite, |
| 284 | isAbsorbedSilently: info.isAbsorbedSilently, |
| 285 | mcpServerName: info.mcpServerName, |
| 286 | isBash: info.isBash, |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | return null |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Checks if a tool is a search/read operation (for backwards compatibility). |
no test coverage detected