@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
42 lines • 2.36 kB
TypeScript
import { FlagView } from '../../../../commands/spec/flag_view.ts';
import { type ParsedArgs } from '../../../../commands/spec/parser.ts';
import type { RedirectResult } from '../../../../context/session_context.ts';
import type { DispatchFn } from '../../../../runtime/types.ts';
import { PathSpec } from '../../../../types.ts';
import type { NamespaceLinks } from '../../../../view/types.ts';
import type { NamespaceReader } from '../../../dispatcher/reader.ts';
import type { Namespace } from '../../../mount/namespace/namespace.ts';
import type { SessionState } from '../../../session/session.ts';
export declare const logger: {
debug?: (message: string) => void;
};
/** The ln flag bag, parsed once. */
export interface LnFlags {
readonly symbolic: boolean;
readonly force: boolean;
readonly noDereference: boolean;
readonly verbose: boolean;
readonly relative: boolean;
readonly logical: boolean;
readonly directory: boolean;
readonly noTarget: boolean;
readonly backup: string | null;
readonly suffix: string;
}
/** One link to make: its source operand and where it lands. */
interface LinkPlan {
readonly source: string | PathSpec;
readonly linkAbs: string;
/** The link name as GNU would spell it in a message (`d/f.txt`). */
readonly linkTyped: string;
}
export declare function parseFlags(fl: FlagView): LnFlags;
/** The GNU option error the parser reported, if any. */
export declare function optionRefusal(parsed: ParsedArgs): [string, number] | null;
export declare function operandWords(args: readonly (string | PathSpec)[]): [(string | PathSpec)[], string | null];
export declare function operandAbs(links: NamespaceLinks, arg: string | PathSpec, cwd: string): string;
export declare function planLinks(links: NamespaceReader, dispatch: DispatchFn, cwd: string, operands: readonly (string | PathSpec)[], targetDir: string | null, targetTyped: string | null, flags: LnFlags): Promise<[LinkPlan[], string | null]>;
export declare function makeLink(links: NamespaceReader, dispatch: DispatchFn, cwd: string, plan: LinkPlan, flags: LnFlags, errors: string[], out: string[]): Promise<void>;
export declare function handleLn(namespace: Namespace, dispatch: DispatchFn, session: SessionState, args: (string | PathSpec)[]): Promise<RedirectResult>;
export {};
//# sourceMappingURL=ln.d.ts.map