/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { type ChildProcess } from 'node:child_process';
import net from 'node:net';
import type { Config, SandboxConfig } from '@vybestack/llxprt-code-core';
export declare function getPassthroughEnvVars(env: NodeJS.ProcessEnv): Record<string, string>;
export declare function buildSandboxEnvArgs(env: NodeJS.ProcessEnv): string[];
/**
 * Mounts Git configuration files into the container read-only.
 * Follows the dual-HOME mount pattern: when the container HOME differs from
 * the host HOME, the same file is mounted at both paths so Git inside the
 * container can find its configuration regardless of which HOME it resolves.
 *
 * Security: ~/.git-credentials is intentionally excluded (R3.7).
 */
export declare function mountGitConfigFiles(args: string[], hostHomedir: string, containerHomePath: string): void;
export interface SshAgentResult {
    tunnelProcess?: ChildProcess;
    cleanup?: () => void;
    /** Shell command to prepend to the container entrypoint (e.g. socat relay). */
    entrypointPrefix?: string;
}
export interface CredentialProxyBridgeResult {
    tunnelProcess?: ChildProcess;
    cleanup?: () => void;
    /** Shell command to prepend to the container entrypoint (e.g. socat relay). */
    entrypointPrefix?: string;
    containerSocketPath: string;
}
/**
 * Routes SSH agent forwarding to the appropriate platform-specific helper.
 * Respects LLXPRT_SANDBOX_SSH_AGENT (on/off/auto) and SSH_AUTH_SOCK.
 */
export declare function setupSshAgentForwarding(config: {
    command: 'docker' | 'podman' | 'sandbox-exec';
}, args: string[], options?: {
    reserveTunnelPort?: (port: number) => void;
    excludedTunnelPorts?: ReadonlySet<number>;
}): Promise<SshAgentResult>;
/**
 * Sets up SSH agent forwarding on Linux via direct socket mount.
 * Uses :z SELinux label for Podman (R5.2).
 */
export declare function setupSshAgentLinux(config: {
    command: 'docker' | 'podman' | 'sandbox-exec';
}, args: string[], sshAuthSock: string): void;
export declare function createTcpToUdsBridge(udsPath: string): Promise<{
    port: number;
    server: net.Server;
}>;
/**
 * Sets up SSH agent forwarding for Docker on macOS using the Docker Desktop
 * magic socket (/run/host-services/ssh-auth.sock).
 *
 * Falls back gracefully if Docker Desktop is not detected (R6.2).
 */
export declare function setupSshAgentDockerMacOS(args: string[], sshAuthSock?: string): Promise<SshAgentResult>;
/**
 * Parses the default Podman machine connection from `podman system connection list`.
 * Returns SSH connection details needed for the reverse tunnel.
 */
export declare function getPodmanMachineConnection(): {
    host: string;
    port: number;
    user: string;
    identityPath: string;
};
/**
 * Sets up SSH agent forwarding for Podman on macOS via an SSH reverse tunnel
 * into the Podman VM. This is necessary because virtiofs (the macOS hypervisor
 * filesystem) cannot share Unix sockets across the hypervisor boundary
 * (Podman issue #23245/#23785).
 *
 * Strategy: SSH reverse-forward the host agent to a TCP port on the VM's
 * loopback, then run the container with --network=host so it can reach
 * that port.  A socat relay inside the entrypoint converts TCP back to the
 * Unix socket expected by SSH_AUTH_SOCK.
 */
export declare function setupSshAgentPodmanMacOS(args: string[], sshAuthSock: string, pollTimeoutMs?: number, options?: {
    reserveTunnelPort?: (port: number) => void;
    excludedTunnelPorts?: ReadonlySet<number>;
}): Promise<SshAgentResult>;
/**
 * Sets up credential proxy forwarding for Podman on macOS via an SSH reverse
 * tunnel into the Podman VM. This mirrors the SSH-agent Podman workaround,
 * but relays credential proxy socket traffic used by /key and /auth flows.
 */
export declare function setupCredentialProxyPodmanMacOS(args: string[], hostCredentialSocketPath: string, pollTimeoutMs?: number, options?: {
    reserveTunnelPort?: (port: number) => void;
    excludedTunnelPorts?: ReadonlySet<number>;
}): Promise<CredentialProxyBridgeResult>;
export declare function setupCredentialProxyDockerMacOS(args: string[], hostCredentialSocketPath: string): Promise<CredentialProxyBridgeResult>;
export declare function isSandboxDebugModeEnabled(debugValue?: string): boolean;
export declare function shouldAllocateSandboxTty(env?: NodeJS.ProcessEnv): boolean;
export declare function start_sandbox(config: SandboxConfig, nodeArgs?: string[], cliConfig?: Config, cliArgs?: string[]): Promise<number>;
