/** macOS Unix-domain socket path cap: `sizeof(sockaddr_un.sun_path)` in <sys/un.h>. */
export declare const SUN_LEN = 104;
/** Suffix codex appends to CODEX_HOME to reach its app-server control socket. */
export declare const CODEX_CONTROL_SOCKET_SUFFIX = "/app-server-control/app-server-control.sock";
/**
 * True when this CODEX_HOME's derived control-socket path would overflow
 * SUN_LEN on macOS.
 */
export declare function codexHomeOverflowsSunLen(home: string): boolean;
/**
 * The short, per-version codex home used when the versioned home overflows.
 * `~/.agents/.codex-homes/<version>/.codex` keeps the socket path well under
 * SUN_LEN while staying stable across reboots (unlike $TMPDIR) and per-version
 * isolated.
 */
export declare function shortCodexHome(agentsUserDir: string, version: string): string;
/**
 * Resolve a macOS SUN_LEN-safe CODEX_HOME for the given versioned home,
 * migrating the home to a short real path (once, idempotently) when needed.
 *
 * On non-darwin platforms, or when the versioned home already fits, the
 * versioned home is returned unchanged. If migration fails for any reason the
 * versioned home is returned (no worse than the pre-fix behavior).
 */
export declare function resolveCodexHome(versionedHome: string, agentsUserDir: string, version: string, platform?: NodeJS.Platform): string;
/**
 * Emit the bash block that a generated codex shim uses to export a
 * SUN_LEN-safe CODEX_HOME. Mirrors {@link resolveCodexHome}.
 *
 * @param homeExpr      shell expression for the versioned codex home
 *                      (e.g. `$VERSION_DIR/home/.codex`)
 * @param shortBaseExpr shell expression for the per-version short base dir
 *                      (e.g. `$AGENTS_USER_DIR/.codex-homes/$VERSION`)
 */
export declare function codexHomeShimBash(homeExpr: string, shortBaseExpr: string): string;
