@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
20 lines • 1.36 kB
TypeScript
import { type PathSpec, type StatFn } from '../../../types.ts';
export declare const STAT_REFUSALS: ReadonlySet<FsCondition>;
import type { FsCondition } from '../../../errors/types.ts';
export type BackendKeyFn = (path: PathSpec) => string;
export declare function backendKeyDefault(path: PathSpec): string;
export declare function copyTargets(sources: PathSpec[], dst: PathSpec, dstIsDir: boolean, dstExists?: boolean, dstErr?: FsCondition | null, dotdot?: string): [PathSpec, PathSpec][];
export declare function typedName(src: PathSpec): string;
/**
* Where a source lands inside a directory destination. GNU appends the
* operand's last component as typed, so a link the router followed still
* lands under its own name (`cp al dir` makes `dir/al`, not `dir/a.txt`), and
* `s/.` lands at `dir/.`, the directory itself: `cp -r s/. dir` merges s's
* contents into dir. An operand with no name of its own (the root) keeps the
* name of what it resolves to. `dotdot` is what a `..` operand lands as (see
* copyTargets). Mirrors Python's landing_path.
*/
export declare function landingPath(dst: PathSpec, src: PathSpec, dotdot?: string): PathSpec;
export declare function pathExists(stat: StatFn, path: PathSpec): Promise<boolean>;
export declare function isDirectory(stat: StatFn, path: PathSpec): Promise<boolean>;
//# sourceMappingURL=copy.d.ts.map