import { CommandScanner } from './command-scan'; /** * Is this shell command pure INSPECTION — can it be trusted to change nothing? * * WHY this exists: when webpieces.config.json cannot be loaded (unparseable, or invalid against the * installed validator) every bash command is denied, because with no config there are no guards and * fail-closed is the only safe answer. That is right for work — and catastrophic for recovery, because * the denial also took out `cat`, `grep` and `sed -n` against webpieces.config.json itself. The guard * blocked the exact tools needed to see and fix the problem it was reporting, which is a dead end an * agent cannot escape from inside the session. (Reproduced live: mid-merge, the config legitimately * held `<<<<<<< HEAD` markers and every attempt to look at it was refused.) * * The rest of the system already models the escape hatch correctly — reading AND editing * webpieces.config.json is always allowed (hook-core's config bypass, the stale-shim recovery * carve-out, ContentReadScan's escape-hatch paths). This closes the one place that did not honour it. * * The bar is deliberately paranoid, because this is a bypass of ALL guards: * - every invoked segment's command word must be an allowlisted inspector; * - `git`/`gh` are excluded outright, even their read-only subcommands — the guards exist to police * git, and "read-only git" is not a line worth drawing while flying blind; * - any output redirect to a file (`> x`, `>> x`) makes the command a writer; * - the in-place/mutating flags of otherwise-read-only tools (`sed -i`, `find -delete`) are refused. * Anything not provably inert stays blocked. */ export declare class ReadOnlyInspectionScan { private readonly scanner; private readonly shell; constructor(scanner?: CommandScanner); /** True only when EVERY segment of the command is provably inert. Empty command → false. */ isReadOnlyInspection(command: string): boolean; private segmentIsInert; private redirectsToFile; private hasMutatingFlag; }