/** * Asks pnpm what a `-F` pattern selects, so an invocation that would select nothing is caught before it * delegates, and one selecting several packages is told from one selecting a single package. * * pnpm's own selector answers rather than a matcher of nmr's: `-F` means the whole selector language, names * and globs alongside `./path`, `{dir}`, `pkg...`, `!negation`, and `[since]`, and a matcher here would leave * every form but the simplest silently unchecked. * * Runs from the monorepo root, where the delegate runs, so a path pattern resolves against the same directory * in the probe as in the run it stands in for. * * The listing counts the root project wherever the filter leaves it standing, while the `exec` a delegation * composes runs there only where the pattern selects the root positively: `-F '!./packages/*'` lists the root * and executes nowhere. A listing of the root alone is therefore the one reading the listing cannot settle, * and it is put to `exec` itself. Every other listing settles on its own, and counts the packages beside the * root: two of them run in two scopes, while one beside the root may run in that package alone. */ export declare function readFilterSelection(pattern: string, monorepoRoot: string): FilterSelection; /** * Reduces a listing to what it proves about the selection. * * Every outcome the probe cannot read resolves to `unresolved`, which claims nothing about the selection, and the * invocation delegates as it would have. A pattern pnpm rejects rather than resolves, such as a bad git ref in * a changed-since selector, is pnpm's to report, and reporting it here as a match failure would name a * different fault than the one the user has. */ export declare function interpretSelectionProbe(probe: SelectionProbe, monorepoRoot: string): ProbeReading; /** * Reduces a marked delegate run to what it proves: a scope that wrote the marker is a scope the run reached. The * run is made only for a listing of the root alone, so that scope is the only one. */ export declare function interpretDelegateProbe(probe: SelectionProbe): FilterSelection; /** What a `-F` pattern selected, as far as pnpm could be asked. `multiple` is two or more packages beside the root. */ export type FilterSelection = 'empty' | 'multiple' | 'single' | 'unresolved'; /** What a listing proves, `root-only` being the reading that only the delegate can settle. */ export type ProbeReading = FilterSelection | 'root-only'; /** The part of a probe's completion a selection is read from. */ export interface SelectionProbe { error: Error | undefined; status: number | null; stdout: string; }