/** * Does `command` leave the declared single-invocation shape? * * `true` ⇒ REFUSE. This is the whole rule; callers add only how a refusal is * reported (a thrown `BlockContractError`, a refusal line, a non-spawn). */ export declare function commandLeavesDeclaredShape(command: string): boolean; /** * Partition declared commands into the admitted ones and refusal LINES — * refusals as data, never a throw, for producers that must turn a malformed * command into a bounded re-emit rather than an unclassified stack. * * Entries are trimmed; an entry that is absent, non-string or blank is refused * as `"empty"`. `describeRefusal` owns the wording (which artifact field, which * block), so this module stays the RULE and never the vocabulary. */ export declare function partitionCommandsByDeclaredShape(commands: readonly string[], describeRefusal: (kind: "empty" | "leaves-shape", raw: unknown) => string): { commands: string[]; refusals: string[]; }; /** * Split a command string into an argv array, so it can be spawned with * `shell: false`. * * TOTAL, and its guarantee is stated in terms of `shell: false` — not in terms * of a precondition a caller has to remember. Exactly two characters are * special: an unquoted space ENDS a token, and a double quote toggles grouping * and is dropped. EVERY other byte — including `' \ ^ % $` and backtick, and * including `& | ; < > ( )` — is copied into the token literally, which under * `shell: false` is precisely what the child receives, because no shell ever * parses the result. So for any input this produces the argv that a shell-free * spawn will actually deliver; it never silently drops meaning. * * What it does NOT do is decide whether a command was ADMISSIBLE. A string that * fails {@link commandLeavesDeclaredShape} still splits — `a && b` becomes * `["a", "&&", "b"]`, three literal argv tokens — and that argv is a faithful * rendering of what `shell: false` would run, not an execution of the chain the * author wrote. That is a declaration the contract cannot honour, so it must be * REFUSED by the gate before it reaches a spawn; this function is not the place * that decision is made, and it is not a shell parser standing in for one. * * Windows note: because `\` is an ordinary byte here, an absolute Windows path * survives intact through the split (`C:\Program Files\nodejs\node.exe` stays * one token when double-quoted). The declared-shape gate refuses `\` in every * position, so such a path can only reach this function from a caller that did * not gate — see {@link commandLeavesDeclaredShape}'s header for why the * refusal is about the declaration rather than the spawn. */ export declare function parseCommandString(command: string): string[]; //# sourceMappingURL=commandShape.d.ts.map