UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

42 lines • 2.44 kB
import { type FindExpr } from '../../../../rs/find.ts'; import type { CrossResult, RunSingle } from './types.ts'; import type { FlagValue } from '../../../spec/types.ts'; import { type ByteSource } from '../../../../io/types.ts'; import type { DispatchFn } from '../../../../runtime/types.ts'; import type { FollowOperands } from '../../../../view/types.ts'; import { PathSpec } from '../../../../types.ts'; import type { Files } from '../../../../workspace/files.ts'; export declare const WALK_WIDE: ReadonlySet<string>; /** * The expression for a start point `depth` levels below the operand. * * Its depth limits count from that start point; `alone` matches the start * point only, not what lies below. Null when the limits leave it nothing to * print. */ export declare function shifted(expr: FindExpr, depth: number, alone?: boolean): FindExpr | null; /** * The directories between an operand and the mounts below it. * * No mount's own find can answer for them: the parent's backend may hold none * of them (a mount at `/usr/bin` implies `/usr`), so each is matched alone, * through the dispatcher. */ export declare function joints(path: PathSpec, starts: readonly PathSpec[]): PathSpec[]; /** * Compose find over operands holding mounts from each mount's own find. * * Every operand, and every visible mount below it, runs the find its mount * registered, a few at a time, with the depth limits counted from its own * start point; the directories between them (`joints`) are matched once each * through the dispatcher. Each run answers for the rows its mount owns (the * parent's shadowed keys stay out), and the rows merge in the walk's path * order, so the actions still run once over every mount's `records`; a * mount whose find fails adds its diagnostic and status, as GNU's walk past * an unreadable directory does, and the mounts below it count only where the * walk could still reach them (`reached`). An expression that looks across a * boundary (`WALK_WIDE`, `-L`), or a find that succeeds without structured * rows, keeps the one dispatcher walk. */ export declare function runFind(paths: readonly PathSpec[], texts: readonly string[], bag: Record<string, FlagValue>, find: FindExpr | undefined, dispatch: DispatchFn, runSingle: RunSingle, cwd: string, vfs?: Files, stdin?: ByteSource | null, signal?: AbortSignal, follow?: FollowOperands): Promise<CrossResult>; //# sourceMappingURL=find.d.ts.map