/** Thrown when a linked worktree tries to resolve the default (production) datadir. */ export declare class ProdDatadirFromWorktreeError extends Error { constructor(dataDir: string, worktreeRoot: string); } /** * Returns the worktree root when `cwd` sits inside a LINKED git worktree, * else null (primary checkout, or not a git repo at all — e.g. an * npm-installed user, who has no `.git` and must never be blocked). * * Linked worktree -> `.git` is a FILE (`gitdir: /path/to/main/.git/worktrees/x`) * Primary checkout -> `.git` is a DIRECTORY */ export declare function findLinkedWorktreeRoot(cwd?: string): string | null; export interface WorktreeGuardInput { /** The resolved datadir. */ dataDir: string; /** Where it came from — only 'default'/'config.yaml' are accidental. */ dataDirSource: 'cli' | 'env' | 'config.yaml' | 'default'; /** The production default datadir, for comparison. */ defaultDataDir: string; /** True when ASTRA_MEMORY_ISOLATED=1 already isolated this resolution. */ isolated: boolean; } /** * Throws ProdDatadirFromWorktreeError when a linked worktree is about to * operate on the production datadir without saying so explicitly. * * No-ops (returns normally) for every legitimate case: the primary checkout, * npm-installed users with no git repo at all, `:memory:`, isolated mode, an * explicit `--data-dir`/`ASTRA_MEMORY_DATADIR`, and the explicit * ASTRA_ALLOW_PROD_DATADIR=1 opt-in. */ export declare function assertNotProdDatadirFromWorktree(input: WorktreeGuardInput): void;