/** The remedy an init destination error ends with. */ export declare const INIT_DESTINATION_REMEDY = "Supply an empty absolute directory or a new absolute directory path to create."; /** Where an init project will be written, and whether that directory must be created first. */ export interface InitDestination { /** The canonical destination path. */ directory: string; /** True when the destination does not exist yet; its parent does. */ create: boolean; } /** * Resolve an existing project directory for a project command. * @param value The configured or supplied path * @param source What supplied it, named in every error (for example `FLUENT_MCP_WORKING_DIR`) * @returns The canonical directory * @throws Error naming the source when the path is not absolute, missing, not a directory, or the root */ export declare function resolveProjectDirectory(value: unknown, source: string): string; /** * Resolve an existing directory: absolute, canonical, and not the root. * @param value The supplied path * @param source What supplied it, named in every error * @param remedy The sentence every error ends with * @param kind What the directory must be, for the root error * @returns The canonical directory * @throws Error when the path is not absolute, missing, not a directory, or the root */ export declare function resolveExistingDirectory(value: unknown, source: string, remedy: string, kind?: string): string; /** * Check an init destination without changing anything: an existing empty * directory, or a path that does not exist yet under an existing directory. * The same rule holds for every intent: creation, conversion from an * instance sys_id, and conversion from a local directory. * @param value The `workingDirectory` argument * @param conversionSource For a local conversion, the canonical source * directory; the destination must not be it or inside it (the SDK copies the * source into the new project's `metadata/`, so a destination inside the * source would be copied into itself) * @returns The canonical destination and whether it must be created * @throws Error with an actionable message for any other path */ export declare function checkInitDestination(value: unknown, conversionSource?: string): InitDestination; /** * Whether `child` is `parent` or lies under it. Both must be canonical. A * path-segment comparison, not a string prefix: `/a/src-copy` is not inside `/a/src`. */ export declare function isWithinDirectory(parent: string, child: string): boolean; /** * Create a destination that `checkInitDestination` reported as new. Not * recursive: the parent was checked to exist. * @returns True when this call created the directory, so the caller owns it * @throws Error when the directory cannot be created, including when it appeared since the check */ export declare function createInitDestination(destination: InitDestination): boolean; /** * Best-effort removal of a destination this invocation created, after the * tool failed. Non-recursive: a directory that is no longer empty, or that * cannot be removed, is left as it is, and nothing is thrown, so the caller * reports its original error. */ export declare function removeCreatedDestination(directory: string): void; //# sourceMappingURL=projectDirectory.d.ts.map