Return structured grep matches from an in-memory files mapping.
Performs literal text search (not regex).
Returns a list of GrepMatch on success, or a string for invalid inputs. We deliberately do not raise here to keep backends non-throwing in tool contexts and preserve user-facing error messages.
grepMatchesFromFiles(
files: Record<string, FileData>,
pattern: string,
path: string | null = null,
glob: string | null = null
): string | GrepMatch[]