Return structured grep matches from an in-memory files mapping.
Performs literal text search (not regex). Binary files are skipped.
If path names an exact file, only that file is considered.
Returns an empty array when no matches are found or on invalid input.
grepMatchesFromFiles(
files: Record<string, FileData>,
pattern: string,
path: string | null = null,
glob: string | null = null
): GrepMatch[]