/**
 * PTY Sidecar Server
 *
 * Lightweight unix socket server that manages persistent PTY sessions.
 * Started as a detached process by `agents pty` commands. Sessions survive
 * across multiple CLI invocations. Each session holds a real PTY (via node-pty)
 * and a headless terminal emulator (via @xterm/headless) for screen rendering.
 *
 * Protocol: newline-delimited JSON over ~/.agents/.system/pty.sock
 */
import { captureProcessStartTime } from './platform/index.js';
export { captureProcessStartTime };
/**
 * Wrap a user command so a `__SENTINEL__:<exit>` line is printed after it
 * finishes — that line drives completion detection in the exec/read flow.
 * The separator and exit-code variable are shell-family specific:
 *   POSIX sh/zsh/bash : `cmd; echo "S:$?"`
 *   PowerShell        : `cmd; echo "S:$LASTEXITCODE"`
 *   cmd.exe           : `cmd & echo S:%errorlevel%`  (`&` always runs the echo)
 * Only the completion marker matters; the numeric exit code is informational
 * (the authoritative code comes from node-pty's onExit).
 */
export declare function buildSentinelCommand(shell: string, command: string): string;
/**
 * Turn a native-binding load failure into an actionable, platform-aware message.
 *
 * The binding is `@homebridge/node-pty-prebuilt-multiarch`'s `pty.node`. On Linux
 * it is baked into the npm tarball and always present; on macOS/Windows it is
 * fetched per host + Node ABI at install time by the package's `prebuild-install`
 * postinstall. The common failure is a Node runtime whose ABI has no published
 * prebuild (the PHNX-2740 darwin-arm64 case): `prebuild-install` finds nothing,
 * the build-from-source fallback also fails, and the loader throws a bare
 * `Cannot find module '.../pty.node'` / MODULE_NOT_FOUND with no clue what to do.
 *
 * Pure (returns the lines) so it can be unit-tested without spawning the server.
 */
export declare function describeNativePtyLoadFailure(err: unknown): string[];
/**
 * Resolve the IPC endpoint for a given platform + PTY scratch dir. Pure so both
 * branches are testable without stubbing process.platform.
 *
 * Unix: an AF_UNIX socket file inside the scratch dir.
 * Windows: a named pipe (`\\.\pipe\…`). Named pipes are NOT filesystem objects,
 * so the name is derived from a hash of the (per-user) scratch dir to keep it
 * stable across invocations and isolated per user — and callers must never probe
 * it with fs.existsSync (it always reports false). Both forms are accepted by
 * net.createServer/createConnection.
 */
export declare function derivePtyEndpoint(platform: NodeJS.Platform, ptyDir: string): string;
/** Get the IPC endpoint the PTY server listens on / clients connect to. */
export declare function getSocketPath(): string;
/** Get the path to the PTY server PID file. */
export declare function getPtyPidPath(): string;
/** Get the path to the PTY server log file. */
export declare function getPtyLogPath(): string;
/** Check if the PTY server process is alive by probing the stored PID. */
export declare function isPtyServerRunning(): boolean;
/** Start the PTY sidecar server, listening on the unix socket for JSON requests. */
export declare function runPtyServer(): Promise<void>;
