import type { Accessor } from '../../../accessor/base.ts';
import { ProvisionResult } from '../../../provision/types.ts';
import { PathSpec } from '../../../types.ts';
import type { CommandOpts, ProvisionFn } from '../../config.ts';
import { RegisteredCommand } from '../../config.ts';
import type { ReaddirOp, ResolveGlobOp, StatOp } from './adapter.ts';
export declare const MAX_PLAN_WALK = 1000;
/** Cost estimate for full file reads (cat, wc, sort, ...), generic over stat. */
export declare function makeFileReadProvision(stat: StatOp, resolveGlob?: ResolveGlobOp): ProvisionFn;
/** Cost estimate for partial reads (head, tail), generic over stat. */
export declare function makeHeadTailProvision(stat: StatOp, resolveGlob?: ResolveGlobOp): ProvisionFn;
/** Cost estimate for metadata-only ops (stat, ls, find). */
export declare function metadataProvision(_accessor: Accessor, paths: PathSpec[], _texts: string[], opts: CommandOpts): Promise;
/** Provision for jq: streamable jsonl reads a range, else the whole file. */
export declare function exactZeroProvision(_accessor: Accessor, _paths: PathSpec[], _texts: string[], opts: CommandOpts): ProvisionResult;
export declare function indexHitReadProvision(_accessor: Accessor, paths: PathSpec[], _texts: string[], opts: CommandOpts): Promise;
export declare function makeJqProvision(stat: StatOp): ProvisionFn;
/**
* Provision for read-transform-write commands (gzip, tar, split). The
* operands are read fully, so the read side is a known floor, but the
* output size (compression ratio, piece count) is unknowable before
* running, so precision stays UNKNOWN.
*/
export declare function makeTransformProvision(stat: StatOp, resolveGlob?: ResolveGlobOp): ProvisionFn;
/**
* Provision for cp: bytes bracket 0 (server-side copy) to the total.
* Reads the source sizes and reports both networkRead and networkWrite
* as a 0..total range: a same-backend copy can be server-side (zero
* client bytes) while a streamed copy moves the full byte count each way.
*/
export declare function makeCopyProvision(stat: StatOp, resolveGlob?: ResolveGlobOp): ProvisionFn;
/**
* Provision for metadata-only writes (rm, mkdir, touch, ln). These never
* move content bytes on any backend; the op count is the operand count.
* A recursive rm walks an unknown subtree, so its op count is only a
* floor and precision degrades to UNKNOWN.
*/
export declare function writeMetadataProvision(_accessor: Accessor, paths: PathSpec[], _texts: string[], opts: CommandOpts): Promise;
/** Provision for pure local computation (seq, date, bc): zero cost. */
export declare function pureProvision(_accessor: Accessor, _paths: PathSpec[], _texts: string[], opts: CommandOpts): Promise;
/**
* Provision for sed: operands are read fully; -i writes back, so the
* output keeps the read total as a floor with UNKNOWN.
*/
export declare function makeSedProvision(stat: StatOp): ProvisionFn;
/**
* Provision for grep/rg: render the pattern then delegate to file_read.
* With -r/-R and a readdir, directory operands are walked the way the
* executor walks them (recursing subdirectories, skipping columnar
* files), so a recursive search over an indexed tree prices exactly.
*/
export declare function makeSearchProvision(stat: StatOp, resolveGlob?: ResolveGlobOp, readdir?: ReaddirOp): ProvisionFn;
/**
* Default cost estimator for a factory-built command, by family. Whole-file
* readers stat their operands and charge the byte total; searches charge a
* worst-case full read; metadata commands charge op counts only; transforms
* keep the read floor with UNKNOWN output; cp brackets 0..total on both
* read and write; metadata writes are zero-byte op counts. mv, tee, and
* anything unlisted return null so the planner reports UNKNOWN (mv may be
* a free rename or a full cross-mount copy; tee's stdin size is
* unknowable). A backend disables a default by passing an explicit null in
* provisionOverrides.
*/
export declare function defaultProvision(name: string, stat: StatOp, resolveGlob?: ResolveGlobOp, readdir?: ReaddirOp): ProvisionFn | null;
/**
* Attach family defaults to hand-written commands. Bespoke backends (e.g.
* opfs) register commands one by one instead of through the factory; this
* gives every command without an explicit provision the same default the
* factory would pick, so estimates match factory-built backends.
*/
export declare function withDefaultProvisions(commands: readonly RegisteredCommand[], stat: StatOp, resolveGlob?: ResolveGlobOp, readdir?: ReaddirOp): RegisteredCommand[];
//# sourceMappingURL=provision.d.ts.map