export declare const VAULT_FORMAT_VERSION: 1; export declare const DEFAULT_VAULT_HOST: "127.0.0.1"; export declare const DEFAULT_VAULT_PORT: 4816; export declare const VAULT_ID_PATTERN: RegExp; export interface VaultPaths { readonly vaultRoot: string; readonly metadataRoot: string; readonly vaultConfigPath: string; readonly databasePath: string; readonly qmdRoot: string; readonly workRoot: string; readonly inboxRoot: string; readonly sourcesRoot: string; readonly wikiRoot: string; readonly quizzesRoot: string; readonly writerLockPath: string; readonly vaultId: string; readonly formatVersion: number; } export interface VaultConfig { readonly formatVersion: number; readonly vaultId: string; } export declare class VaultError extends Error { readonly code: string; constructor(code: string, message: string); } export declare class NoVaultError extends VaultError { constructor(); } export declare class PathSafetyError extends VaultError { constructor(message: string); } export declare class LockBusyError extends VaultError { constructor(path: string); } export interface LockHandle { readonly path: string; readonly token: string; release(): void; } export declare function assertNoSymlinkPath(path: string): void; /** Resolve an explicit root, or walk upward from cwd to the nearest vault. */ export declare function resolveVault(explicitPath?: string): VaultPaths; /** * Resolve a user/model-selected path beneath a trusted root. The input must * already be a normalized, slash-separated relative path and may not resolve * through a symlink. */ export declare function safeRelativePath(root: string | VaultPaths, requestedPath: string): string; export declare function readFileNoFollow(path: string, maxBytes?: number): Buffer; export declare function atomicWriteFile(path: string, data: string | Uint8Array, mode?: number): void; /** Create the product roots, durable schema, derived directories, and Git repository. */ export declare function initVault(requestedRoot?: string): VaultPaths; export declare function acquireWriterLock(paths: VaultPaths, options?: { readonly waitMs?: number; readonly pollMs?: number; }): LockHandle; export declare function withWriterLock(paths: VaultPaths, operation: () => T | PromiseLike): Promise; //# sourceMappingURL=vault.d.ts.map