/**
 * Runtime-safe JSON.parse with typed fallback.
 *
 * Guards against three common failure modes:
 *   1. Malformed JSON (syntax error) — returns fallback.
 *   2. JSON primitives (number, string, null) when an object was expected —
 *      returns fallback to avoid `as ConcreteType` lying to the type system.
 *   3. Missing fields on the parsed object — callers should still Partial-check
 *      before accessing specific fields, but the result is guaranteed to be
 *      an object reference (or the fallback), never null/number/string.
 *
 * Use at every JSON read boundary (fs, network, IPC) instead of
 * `JSON.parse(raw) as ConcreteType`. Addresses Crash Shield rule
 * JSON_PARSE_UNSAFE_CAST.
 */
export declare function safeJsonParse<T>(raw: string, fallback: T): T;
/**
 * Hash a project path into a deterministic projectId using SHA-256.
 */
export declare function hashProjectPath(projectPath: string): string;
/**
 * Read a JSON file from disk. Returns the parsed contents, or the provided
 * default value when the file does not exist.
 */
export declare function readJson<T>(filePath: string, defaultValue: T): Promise<T>;
/**
 * Write a value to a JSON file, creating parent directories as needed.
 */
export declare function writeJson(filePath: string, data: unknown): Promise<void>;
/**
 * Resolve the data directory for a given project.
 * Layout: ~/.planu/data/projects/{projectId}/ (absolute, independent of cwd)
 *
 * Symmetric with globalDataDir(). Override via PLANU_PROJECT_DATA_DIR
 * environment variable (useful in tests and CI).
 *
 * Validates that projectId is a safe hex hash (no path traversal).
 * projectId is always produced by hashProjectPath(), which returns a 16-char hex string.
 */
export declare function projectDataDir(projectId: string): string;
/**
 * Resolve the global data directory.
 * Layout: ~/.planu/data/global/ (absolute, independent of cwd)
 *
 * Using an absolute path anchored to the user's home directory ensures that
 * global state (license, usage, registered projects) persists across sessions
 * regardless of which project directory the MCP server is started from.
 *
 * Override via PLANU_GLOBAL_DATA_DIR environment variable (useful in tests
 * and CI environments where HOME is not writable).
 */
export declare function globalDataDir(): string;
//# sourceMappingURL=base-store.d.ts.map