vigiles API reference
    Preparing search index...

    Interface NormalizedLeaf

    A single simple command, normalized to its operation form.

    interface NormalizedLeaf {
        args: readonly string[];
        argv: readonly string[];
        assigns: ReadonlyMap<string, string | null>;
        chdir: string | null;
        flags: ReadonlySet<string>;
        head: string;
        redirects: readonly LeafRedirect[];
        hasAssign(...names: readonly string[]): boolean;
        hasFlag(...names: readonly string[]): boolean;
    }
    Index

    Properties

    args: readonly string[]

    The normalized args (argv without the head).

    argv: readonly string[]

    [head, ...args] — every word quote-unwrapped and $HOME/~-canonicalized.

    assigns: ReadonlyMap<string, string | null>

    Command-level env-assignments that apply to THIS leaf, keyed by variable name → static value (empty string for a naked NAME=). Populated from both the mvdan leading CallExpr.Assigns (PIP_INDEX_URL=… pip install …) AND the NAME=value words consumed by an env wrapper (env NPM_CONFIG_REGISTRY=… npm i).

    These carry supply-chain / behavior-altering configuration (PIP_INDEX_URL, NPM_CONFIG_REGISTRY, …) that an argv-only extractor never sees because the assignment is not an argv word. A dynamic RHS (command substitution, non-HOME parameter) is recorded with value null — present but unresolved.

    chdir: string | null

    The directory a chdir WRAPPER moved this leaf into before exec'ing it — env -C dir, env --chdir=dir, sudo -D dir — or null when there was none. Nested wrappers accumulate (sudo -D a env -C b cmd → a/b).

    The parser already READ this token in order to skip past it, then threw the value away — so every relative operand of the wrapped command resolved against the wrong directory for every consumer. Same shape as the redirection targets the leaf used to drop: the parser knew, the leaf did not carry it. git -C is deliberately NOT here — git is not a wrapper (it does not exec the rest of its argv as a command).

    ⚠️ ONE LEAF'S OWN WRAPPER, NOT A CWD MODEL. A directory changed by a PRECEDING statement (cd x && …, pushd, a subshell) is not reported: connectors do not survive leaf extraction, and cd x; cmd writes into the OLD directory when the cd fails — that is a model with failure semantics, not a field. A dynamic value (env -C "$DIR" …) is not resolvable and the whole leaf is already unnormalizable in that case.

    flags: ReadonlySet<string>

    Canonical flag tokens present on this leaf. Short clusters are split (-rf→r,f) and each flag is recorded in BOTH short and long form via the alias table, so a caller can test --force/-f or --no-verify/-n uniformly. Long values are split on = (--index-url=x→index-url).

    head: string

    Head normalized to its basename, backslash-stripped: /bin/rm→rm, \rm→rm.

    redirects: readonly LeafRedirect[]

    The redirections attached to this leaf, in source order — see LeafRedirect. Empty for a command with no redirection.

    Methods

    • True iff a command-level assignment for ANY of names is present (resolved or not).

      Parameters

      • ...names: readonly string[]

      Returns boolean

    • True iff ANY of names is present in flags (short or long).

      Parameters

      • ...names: readonly string[]

      Returns boolean