import type { ZodType, ZodTypeDef } from 'zod';
import type { CliOptions } from './types.ts';
export declare const EXIT_CODES: {
    OK: number;
    USAGE: number;
    NOT_FOUND: number;
    INTERNAL: number;
    /** Trust policy denial (enforce mode). */
    TRUST_FAIL: number;
    /** Valid result but negative (e.g. no path found). Follows grep convention. */
    NO_MATCH: number;
};
/**
 * Reads an environment variable across Node, Bun, and Deno runtimes.
 */
export declare function getEnvVar(name: string): string | undefined;
export declare const HELP_TEXT = "warp-graph <command> [options]\n(or: git warp <command> [options])\n\nCommands:\n  info             Summarize graphs in the repo\n  check            Report graph health/GC status\n  doctor           Diagnose structural issues and suggest fixes\n  debug            Inspect substrate history and conflict state\n                     coordinate         Inspect the resolved observation coordinate\n                       --lamport-ceiling <n>  Inspect no later than Lamport tick n\n                     conflicts          Analyze conflict provenance at the current frontier\n                       --strand <id>         Analyze one pinned strand instead of the live frontier\n                       --entity-id <id>       Filter by entity id\n                       --target-kind <kind>   node, edge, node_property, edge_property\n                       --property-key <key>   Property key for *_property targets\n                       --from <id>            Edge source for edge selectors\n                       --to <id>              Edge destination for edge selectors\n                       --label <label>        Edge label for edge selectors\n                       --kind <kind>          supersession, eventual_override, redundancy (repeatable)\n                       --writer-id <id>       Filter returned traces by writer id\n                       --lamport-ceiling <n>  Analyze no later than Lamport tick n\n                       --evidence <level>     summary, standard, full\n                       --max-patches <n>      Deterministic scan budget\n                     provenance         Trace causal patch provenance for an entity id\n                       --strand <id>         Inspect provenance inside one pinned strand\n                       --entity-id <id>       Entity id to inspect\n                       --lamport-ceiling <n>  Analyze no later than Lamport tick n\n                       --max-patches <n>      Limit returned provenance entries\n                     receipts           Inspect reducer tick receipts and per-op outcomes\n                       --strand <id>         Materialize and inspect one pinned strand\n                       --writer-id <id>       Filter receipts by writer id\n                       --patch <sha>          Filter receipts by patch SHA/prefix\n                       --target <target>      Filter matching ops by exact receipt target\n                       --result <kind>        applied, superseded, redundant (repeatable)\n                       --op <type>            Receipt op type (repeatable)\n                       --lamport-ceiling <n>  Analyze no later than Lamport tick n\n                       --limit <n>            Limit returned receipts\n                     timeline           Inspect a cross-writer causal patch timeline\n                       --strand <id>         Inspect the visible patch universe of one pinned strand\n                       --entity-id <id>       Filter to patches touching an entity id\n                       --writer-id <id>       Filter to a specific writer\n                       --lamport-floor <n>    Include no earlier than Lamport tick n\n                       --lamport-ceiling <n>  Include no later than Lamport tick n\n                       --limit <n>            Return the newest N entries in causal order\n  strand      Manage pinned strand descriptors\n                     create             Create a pinned strand descriptor\n                       --id <id>               Explicit strand id\n                       --lamport-ceiling <n>   Pin no later than Lamport tick n\n                       --owner <id>            Optional owner metadata\n                       --scope <text>          Optional scope metadata\n                       --lease-expires-at <ts> Optional ISO-8601 lease expiry metadata\n                     braid <id>        Pin read-only braid overlays onto a target strand\n                       --support <id>         Braided support strand id (repeatable)\n                       --read-only            Disable writes to the target overlay\n                       --writable             Re-enable writes to the target overlay\n                     list               List strand descriptors for the graph\n                     show <id>          Show a single strand descriptor\n                     compare <id>       Compare a strand against another substrate surface\n                       --against <sel>        base, live, or strand:<id>\n                       --target-id <id>       Limit target-local helpers to one entity id\n                       --lamport-ceiling <n>  Apply an additional ceiling to the strand\n                       --against-lamport-ceiling <n>\n                                              Apply an additional ceiling to the comparison side\n                     transfer-plan <id> Plan a deterministic transfer from one strand into live, base, or another strand\n                       --into <sel>           live, base, or strand:<id>\n                       --lamport-ceiling <n>  Apply an additional ceiling to the source strand\n                       --into-lamport-ceiling <n>\n                                              Apply an additional ceiling to the target side\n                    materialize <id>   Inspect a pinned strand replay\n                       --receipts             Include tick receipts\n                     drop <id>          Delete a strand descriptor\n  verify-audit     Verify audit receipt chain integrity\n  verify-index     Verify bitmap index integrity by sampling\n  reindex          Force full index rebuild\n  trust            Evaluate writer trust from signed evidence\n  materialize      Diagnostic replay/checkpoint for graph state\n  seek             Time-travel: step through graph history by Lamport tick\n  optic            Emit checkpoint-tail optic witness output\n  patch            Decode and inspect raw patches\n  tree             ASCII tree traversal from root nodes\n  bisect           Binary search for first bad patch in writer history\n  mcp              Start a local read-only MCP server over stdio\n  sync             Inspect sync status or sync with an HTTP peer\n  serve            Serve the sync endpoint over HTTP\n  fork             Create a graph fork at a writer patch\n  checkpoint       Inspect or create checkpoint state\n  gc               Inspect or run checkpoint garbage collection\n  watch            Stream graph change notifications as NDJSON\n  install-hooks    Install post-merge git hook\n\nOptions:\n  --repo <path>     Path to git repo (default: cwd)\n  --json            Emit JSON output (pretty-printed, sorted keys)\n  --ndjson          Emit compact single-line JSON (for piping/scripting)\n  --view [mode]     Removed; use warp-ttd for visualization\n  --graph <name>    Graph name (required if repo has multiple graphs)\n  --writer <id>     Writer id (default: cli)\n  -h, --help        Show this help\n\nInstall-hooks options:\n  --force           Replace existing hook (backs up original)\n\nQuery options:\n  --match <glob>        Match node ids (default: *)\n  --outgoing [label]    Traverse outgoing edge (repeatable)\n  --incoming [label]    Traverse incoming edge (repeatable)\n  --where-prop k=v      Filter nodes by prop equality (repeatable)\n  --select <fields>     Fields to select (id, props)\n\nPath options:\n  --from <id>           Start node id\n  --to <id>             End node id\n  --dir <out|in|both>   Traversal direction (default: out)\n  --label <label>       Filter by edge label (repeatable, comma-separated)\n  --max-depth <n>       Maximum depth\n\nOptic options:\n  witness <node-id>     Read a node or property with checkpoint-tail evidence\n  --property <key>      Read a single node property\n\nHistory options:\n  --node <id>           Filter patches touching node id\n\nDoctor options:\n  --strict              Treat warnings as failures (exit 4)\n\nVerify-audit options:\n  --writer <id>         Verify a single writer's chain (default: all)\n  --since <commit>      Verify from tip down to this commit (inclusive)\n  --trust-mode <mode>   Trust evaluation mode (warn, enforce)\n  --trust-pin <sha>     Pin trust evaluation to a specific record chain commit\n\nVerify-index options:\n  --seed <n>              PRNG seed for reproducible sampling\n  --sample-rate <rate>    Fraction of nodes to verify (>0 and <=1, default 0.1)\n\nTrust options:\n  --mode <warn|enforce> Override trust evaluation mode\n  --trust-pin <sha>     Pin trust evaluation to a specific record chain commit\n\nSeek options:\n  --tick <N|+N|-N>      Jump to tick N, or step forward/backward\n  --latest              Clear cursor, return to present\n  --save <name>         Save current position as named cursor\n  --load <name>         Restore a saved cursor\n  --list                List all saved cursors\n  --drop <name>         Delete a saved cursor\n  --diff                Show structural diff (added/removed nodes, edges, props)\n  --diff-limit <N>      Max diff entries (default 2000)\n\nPatch options:\n  show <sha>            Decode and display a single patch as JSON\n  list                  List all patches sorted by Lamport clock\n  --writer <id>         Filter by writer (list only)\n  --limit <n>           Max entries to show (list only)\n\nTree options:\n  [rootNode]            Root node id (auto-detected if omitted)\n  --edge <label>        Follow only this edge label\n  --prop <key>          Annotate nodes with this property (repeatable)\n  --max-depth <n>       Maximum traversal depth\n\nBisect options:\n  --good <sha>          Known-good commit SHA (invariant holds)\n  --bad <sha>           Known-bad commit SHA (invariant violated)\n  --test <command>      Shell command (exit 0=good, non-zero=bad)\n  --writer <id>         Writer chain to bisect (required)\n\nSync options:\n  status                Show local sync status (default)\n  request               Emit a sync request payload\n  with <url>            Sync with an HTTP peer\n  --path <path>         Override HTTP sync path\n  --materialize         Materialize after sync\n  --auth-secret <text>  Shared-secret HMAC secret\n  --auth-key-id <id>    Shared-secret key id (default: default)\n\nServe options:\n  --port <n>            Port to listen on (0 allowed)\n  --host <host>         Host to bind (default: 127.0.0.1)\n  --path <path>         Sync path (default: /sync)\n  --auth-secret <text>  Shared-secret HMAC secret\n  --auth-key-id <id>    Shared-secret key id (default: default)\n  --auth-mode <mode>    enforce or log-only\n  --unsafe-allow-unauthenticated-localhost\n                         Permit unauthenticated localhost serving\n\nFork options:\n  --from <writer>       Writer chain to fork from\n  --at <sha>            Patch SHA to fork at\n  --fork-name <name>    New graph name\n  --fork-writer <id>    Writer id for the fork graph\n\nCheckpoint options:\n  status                Show current checkpoint head (default)\n  create                Materialize current state and create a checkpoint\n  sync-coverage         Synchronize checkpoint coverage metadata\n\nGC options:\n  status                Show current GC metrics (default)\n  maybe-run             Run only when policy says GC is due\n  run                   Force a GC pass\n\nWatch options:\n  [pattern]             Node pattern to watch (default: *)\n  --poll <ms>           Enable polling interval\n";
/**
 * Structured CLI error with exit code and error code.
 */
export declare class CliError extends Error {
    code: string;
    exitCode: number;
    cause: Error | undefined;
    /**
     * Constructs a CLI error with a human-readable message and optional metadata.
     */
    constructor(message: string, options?: {
        code?: string;
        exitCode?: number;
        cause?: Error;
    });
}
/**
 * Creates a CliError tagged as a usage error with exit code USAGE.
 */
export declare function usageError(message: string): CliError;
/**
 * Creates a CliError tagged as a not-found error with exit code NOT_FOUND.
 */
export declare function notFoundError(message: string): CliError;
export declare const KNOWN_COMMANDS: string[];
/**
 * Two-pass arg parser using node:util.parseArgs.
 *
 * Pass 1: extract base flags from anywhere in argv.
 * Pass 2: pre-process --view (optional-value semantics) on base args.
 * Pass 3: parseArgs with strict:true on base args only.
 */
export declare function parseArgs(argv: string[]): {
    options: CliOptions;
    command: string | undefined;
    commandArgs: string[];
};
/**
 * Parses command-level args using node:util.parseArgs + Zod validation.
 */
export declare function parseCommandArgs<T>(args: string[], config: Record<string, {
    type: string;
    short?: string;
    default?: unknown;
    multiple?: boolean;
}>, schema: ZodType<T, ZodTypeDef, unknown>, { allowPositionals }?: {
    allowPositionals?: boolean;
}): {
    values: T;
    positionals: string[];
};
