import type { SessionPlan } from "../store/plan.js"; export declare function setActiveProjectRoot(root: string | undefined): void; /** * Pin root only when the path exists (or force=true after a successful scaffold). * Prevents inventing Desktop/todo-app before the folder is real. */ export declare function setActiveProjectRootIfValid(root: string | undefined, opts?: { force?: boolean; }): boolean; export declare function getActiveProjectRoot(): string | undefined; export declare function clearActiveProjectRoot(): void; /** * Pull the best project directory from plan text / user prompt. * Prefers existing paths; never returns bare Desktop alone when a deeper path exists. */ export declare function extractProjectRootFromText(...parts: string[]): string | undefined; export declare function extractProjectRootFromPlan(plan: SessionPlan | undefined): string | undefined; /** * After a successful one-shot scaffolder, derive the project directory. * Stack-agnostic: npm create, cargo new, rails new, poetry new, etc. */ export declare function extractProjectRootFromScaffold(command: string, shellCwd?: string): string | undefined; /** * Resolve a tool path: absolute stays absolute; relative uses active project * root when set, else process cwd. */ export declare function resolveToolPath(path: string): string; /** * If the model wrote into the agent package while a project root is set * elsewhere, remap onto the project (keeps relative subpath). * Generic: any relative path or common source roots (src, lib, app, …). */ export declare function remapAgentCwdWrite(resolved: string, original: string): string;