import type { CommandTarget } from "../types.js"; /** * Command-target integrity surface (loops bbe50c53). * * `loops show --json` previously reported the literal string `'shell'` for * shell command targets, so a control-plane reader could not prove which * command the loop would actually execute. This module provides the canonical * resolved command line (byte-identical to the executor's own shell path), * a `cmd:sha256:` digest over those exact bytes, and a verify helper. * * The digest is computed over the RAW stored command line — never over a * scrubbed or displayed form — so a one-byte mutation of the stored command * changes the digest, while the displayed surface can stay secret-safe. */ export declare const COMMAND_DIGEST_PREFIX = "cmd:sha256:"; /** Shell-quote a single argv element exactly like the executor's shell path. */ export declare function shellQuote(value: string): string; /** * The exact command line the executor will run for a command target: * `command` followed by shell-quoted `args`, space-joined. For a bare command * with no args this is the command itself. Matches the executor's shell path * (`sh -c `) byte for byte, so a digest over this string binds * what actually executes. */ export declare function resolvedCommandLine(target: Pick): string; /** * Secret-safe integrity commitment for a command target. The digest binds the * exact resolved command line (command + shell-quoted args) and reveals * nothing about its content. */ export declare function commandTargetDigest(target: Pick): string; /** * Prove an intended candidate command line matches a digest returned by the * control-plane surface. Returns false for any malformed or mismatched digest; * the literal `'shell'` can never pass as integrity evidence for a real * command because it hashes to a different value. */ export declare function verifyCommandDigest(candidate: string, digest: string): boolean; /** * Secret-safe display descriptor of a command target, used by every surface * that shows a command loop's target (show, list labels, and the default loop * description). For a shell target this is the REAL resolved command line, * secret-scrubbed and bounded to `visible` characters with the remainder's * length noted — never the placeholder literal `'shell'`. For a non-shell * target it is the command's own name, unchanged. */ export declare function publicCommandDescriptor(target: Pick, visible?: number): string;