/**
 * Cross-Platform Hook Utilities
 *
 * Provides platform detection and process spawning for Windows, macOS, and Linux.
 * Optimized for hook execution with minimal overhead.
 *
 * @module hooks/platform
 */
import { SpawnOptions, ChildProcess } from 'child_process';
/**
 * Platform types
 */
export type Platform = 'windows' | 'macos' | 'linux' | 'unknown';
/**
 * WSL availability status
 */
export interface WslStatus {
    available: boolean;
    version?: 1 | 2;
    defaultDistro?: string;
}
/**
 * Get normalized platform identifier
 */
export declare function getPlatform(): Platform;
/**
 * Check if running on Windows
 */
export declare function isWindows(): boolean;
/**
 * Check if running on POSIX system (macOS, Linux)
 */
export declare function isPosix(): boolean;
export declare function checkWslStatus(): WslStatus;
export { findProjectRoot } from '../utils/find-project-root.js';
/**
 * Spawn a detached background process (cross-platform)
 *
 * On Windows: Uses 'start' command or direct spawn with detached option
 * On POSIX: Uses spawn with detached + unref
 *
 * @param command - Command to run
 * @param args - Arguments
 * @param options - Spawn options
 * @returns ChildProcess or null if spawn failed
 */
export declare function spawnDetached(command: string, args?: string[], options?: SpawnOptions): ChildProcess | null;
/**
 * Spawn Node.js script in background (cross-platform)
 *
 * Optimized for spawning Node.js scripts as background daemons.
 *
 * @param scriptPath - Path to the Node.js script
 * @param args - Arguments to pass to the script
 * @param cwd - Working directory
 * @returns ChildProcess or null if spawn failed
 */
export declare function spawnNodeBackground(scriptPath: string, args?: string[], cwd?: string): ChildProcess | null;
/**
 * Read JSON file safely with error handling
 *
 * @param filePath - Path to JSON file
 * @returns Parsed JSON or null if failed
 */
export declare function readJsonSafe<T = unknown>(filePath: string): T | null;
/**
 * Write JSON file safely with atomic write
 *
 * SAFETY: Only creates directories if the parent .specweave/ already exists.
 * This prevents accidentally creating stale .specweave/ folders in arbitrary
 * directories when code runs from a non-project CWD.
 *
 * @param filePath - Path to JSON file
 * @param data - Data to write
 * @returns true if successful, false otherwise
 */
export declare function writeJsonSafe(filePath: string, data: unknown): boolean;
/**
 * Append to log file (creates directory if needed)
 *
 * SAFETY: Only creates directories if the parent .specweave/ already exists.
 * This prevents accidentally creating stale .specweave/ folders in arbitrary
 * directories when hooks run from a non-project CWD.
 *
 * @param logPath - Path to log file
 * @param message - Message to append
 */
export declare function appendLog(logPath: string, message: string): void;
export { FileLock } from '../utils/file-lock.js';
/**
 * Hook result interface (matches Claude Code hook protocol)
 */
export interface HookResult {
    continue: boolean;
    systemMessage?: string;
    error?: string;
}
/**
 * Output hook result to stdout
 */
export declare function outputHookResult(result: HookResult): void;
/**
 * Consume stdin (required for hooks that receive input)
 */
export declare function consumeStdin(): Promise<string>;
/**
 * Hook input parsed from stdin JSON
 */
export interface HookInput {
    session_id?: string;
    env_file?: string;
    transcript_path?: string;
    [key: string]: unknown;
}
/**
 * Parse hook stdin as JSON, returning typed HookInput.
 * Falls back to empty object if stdin is empty or invalid JSON.
 */
export declare function parseHookInput(): Promise<HookInput>;
//# sourceMappingURL=platform.d.ts.map