import type { WandStorage } from "./storage.js"; import type { Workspace, WorkspaceDefaultProvider, WorktreeInfo } from "./types.js"; /** Normalize a project/session cwd so `/foo/bar/` and `/foo/bar` match. */ export declare function normalizeProjectCwd(cwd: string | null | undefined): string; /** * Directory that should own this session in the project list. * Worktree sessions belong to the repo root, not `.wand-worktrees/...`. */ export declare function projectCwdForSession(session: { cwd?: string | null; worktree?: Pick | null; }): string; export declare function findWorkspaceByCwd(storage: WandStorage, cwd: string): Workspace | null; /** Find the project for this directory, or create one named after the folder. */ export declare function ensureWorkspaceForCwd(storage: WandStorage, cwd: string, options?: { name?: string; defaultProvider?: WorkspaceDefaultProvider; }): Workspace; /** * Workspace id to persist on a newly created session. * An explicit id wins; otherwise find-or-create the project for `cwd`. */ export declare function resolveWorkspaceIdForNewSession(storage: WandStorage, cwd: string | null | undefined, explicitWorkspaceId?: string | null): string | undefined; export declare function attachUnboundSessionsToWorkspace(storage: WandStorage, workspace: Workspace): number; export declare function backfillSessionWorkspaces(storage: WandStorage): { created: number; bound: number; };