import type { ToolInfo } from "@earendil-works/pi-coding-agent"; const NON_MUTATING_BUILTINS = new Set(["read", "grep", "find", "ls"]); export function isGenuineNonMutatingBuiltin(tool: ToolInfo): boolean { if (!NON_MUTATING_BUILTINS.has(tool.name)) return false; return ( tool.sourceInfo.source === "builtin" && tool.sourceInfo.path === `` && tool.sourceInfo.scope === "temporary" && tool.sourceInfo.origin === "top-level" ); }