export declare const PROJECT_INDEX_SERVER_PROTOCOL_VERSION = 1; /** Keep only the tail; a daemon that crash-loops must not fill the disk. */ export declare const PROJECT_INDEX_SERVER_STDERR_MAX_BYTES: number; /** * Content identity for the actual server artifact. * * Package versions do not change during a local rebuild, so the handshake * hashes the resolved `project-server.js` itself. The stat guard avoids * re-reading the bundle on every reconnect while still noticing a rebuild in a * long-lived client process. */ export declare function projectIndexServerBuildId(entrypoint: string | URL): string; /** * Local project identity used by the index transport. * * The index directory is authoritative rather than the cross-machine project * id: worktrees and local clones may share a project id while requiring * physically separate SQLite indexes. */ export declare function projectIndexServerKey(projectRoot: string, indexDir?: string): string; /** * Deterministic per-project local IPC endpoint. * * The Unix layout places the socket inside a short `wsci-v1/` subdirectory of * the temp dir: macOS's per-user TMPDIR is ~48 bytes of * `/var/folders//<30 chars>/T`, and `sun_path` caps the whole socket path * at 104 bytes including the NUL on macOS/BSD (108 on Linux). The previous * `wrongstack-codebase-index-v1/.sock` subdirectory layout came to ~107 * bytes there, so `bind()` failed with ENAMETOOLONG inside a detached child * whose stderr was discarded — clients saw only a 10s connect timeout. The * short `wsci-v1/` subdirectory stays well under both limits (85 bytes on the * worst-case macOS TMPDIR) and restores the `0o700` ownership boundary the * flat layout lost on multi-user Linux `/tmp`. The pipe name keeps the long * prefix because named pipes have no such limit. */ export declare function projectIndexServerEndpoint(projectRoot: string, indexDir?: string): string; export declare function projectIndexServerMetadataPath(projectRoot: string, indexDir?: string): string; /** * Where a detached daemon's stderr is kept. * * The daemon used to be spawned with `stdio: 'ignore'`, so when it died the * only trace was the client's `codebase-index server connection closed` — * a message that names the symptom and no cause. Node writes an uncaught * exception's stack to stderr before exiting, and V8 writes its fatal * out-of-memory message there too (which no JS handler can intercept), so * keeping the stream is what makes a dead daemon explain itself. */ export declare function projectIndexServerStderrPath(projectRoot: string, indexDir?: string): string; /** * The tail of a daemon's stderr, condensed to one line for an error message. * * Returns null when there is nothing useful: no file, an empty one, or only * whitespace. Reads at most the last `PROJECT_INDEX_SERVER_STDERR_MAX_BYTES` * so a large file cannot be pulled into memory here. */ export declare function readProjectIndexServerStderrTail(path_: string, maxLines?: number): string | null; /** The base close message. Kept as a PREFIX so existing substring matchers * (and anyone grepping logs for it) keep working when a reason is appended. */ export declare const PROJECT_INDEX_SERVER_CLOSED_MESSAGE = "codebase-index server connection closed"; /** * Compose the error a closed connection rejects with. * * A closed socket has two very different causes — an orderly shutdown and the * daemon dying — and they used to be reported identically. When the daemon * left something on stderr, that text is the whole difference between a * failure someone can act on and one that reads as a flake. */ export declare function formatProjectIndexServerCloseError(tail: string | null): string; //# sourceMappingURL=project-server-endpoint.d.ts.map