/** * paths.ts — Cross-platform path resolution for Claude Code data directories * * Claude Code stores data in the same location on all platforms: * All platforms: ~/.claude/ * * ClaudeStat stores its own data in: * All platforms: ~/.claudestat/ (or CLAUDESTAT_DATA_DIR env var) * * Claude Code encodes project paths by replacing path separators AND colons with '-'. * This module provides helpers to encode/decode those paths cross-platform. */ /** * Detecta si claudestat está corriendo como binario standalone (Bun compile) * vs desde npm (node dist/index.js). */ export declare function isBinary(): boolean; /** * Retorna el directorio base del binario o del proyecto. * En binario: directorio donde está el ejecutable. * En npm: root del proyecto (unimos dist/..). */ export declare function getBinaryDir(): string; /** * Retorna el directorio del dashboard build (dashboard/dist/). * En binario: busca relativo al binario o en CLAUDESTAT_DATA_DIR. * En npm: usa __dirname para encontrar dist/. */ export declare function getDashboardDir(): string; /** * Returns the Claude Code data directory (~/.claude on all platforms). * Empirically verified: Claude Code CLI stores settings at ~/.claude on macOS, Linux, and Windows. */ export declare function getClaudeDir(): string; /** * Returns the ClaudeStat data directory. * Can be overridden via CLAUDESTAT_DATA_DIR env var. */ export declare function getClaudestatDir(): string; /** * Returns the PID file path for the daemon. */ export declare function getPidFile(): string; /** * Encodes a real filesystem path into Claude Code's internal format. * Claude Code replaces path separators AND colons with '-'. * * macOS: /Users/db/Documents/GitHub → -Users-db-Documents-GitHub * Windows: C:\Users\db\Documents → C--Users-db-Documents */ export declare function encodeClaudePath(realPath: string): string; /** * Decodes a Claude Code encoded directory name back to a real filesystem path. * * Since directory names with '-' are ambiguous (is "gmail-ai-agent" one dir or three?), * this function requires a reference to the greedy filesystem resolver. * Use project-scanner's findRealPath for the actual resolution. * * Returns the encodedHome + rest with '-' replaced by path.sep, * but actual resolution should be done via findRealPath in project-scanner. */ export declare function decodeClaudePath(encoded: string): string | null; /** * Creates the regex pattern for the encoded home path. * Handles both / and \ separators. */ export declare function homeSlugRegex(): RegExp; /** * Returns the engram-compatible slug for the home directory. * Used for MEMORY.md path resolution. * macOS: /Users/db → -Users-db * Windows: C:\Users\db → C--Users-db */ export declare function getHomeSlug(): string; /** * Returns the OpenCode config directory. * Can be overridden via OPENCODE_CONFIG_DIR env var. */ export declare function getOpencodeDir(): string; /** * Returns the OpenCode SQLite database path. * Can be overridden via OPENCODE_DB env var. */ export declare function getOpencodeDb(): string; /** * Returns the appropriate command to find an executable in PATH. * Unix: which * Windows: where */ export declare function whichCmd(name: string): string; /** * Returns the appropriate command to find all instances of an executable in PATH. * Unix: which -a * Windows: where (where already lists all matches) */ export declare function whichAllCmd(name: string): string; /** * Returns the appropriate command to check if a port is in use. * Unix: lsof -i : * Windows: netstat -ano | findstr : */ export declare function portCheckCmd(port: number): string; /** * Returns the port file path. The daemon writes the active port here on startup * so the hook script (vanilla JS, no imports) can read it without parsing config. */ export declare function getPortFile(): string; /** * Writes the active port to disk. Called by the daemon after successful bind. */ export declare function writePortFile(port: number): void; /** * Returns the path of the pause signal file. * When this file exists, the hook shows a warning instead of blocking. */ export declare function getPauseSignalFile(): string; /** * Returns the daemon log file path. */ export declare function getDaemonLogFile(): string; /** * Returns true if running on Windows. */ export declare const isWindows: boolean;