import type { FileToWrite, Logger } from '@agentuity/core';
import { APIClient } from '@agentuity/server';
import type { AuthData, Config } from '../../../types.ts';
/**
 * Detect if a file descriptor is redirected to /dev/null (or NUL on Windows).
 * Used to optimize stream creation - when output goes to /dev/null, we can
 * skip creating the stream entirely on the server.
 *
 * @param fd - File descriptor (1 for stdout, 2 for stderr)
 * @returns true if the fd points to /dev/null
 */
export declare function detectNullStream(fd: number): boolean;
export declare function createSandboxClient(logger: Logger, auth: AuthData, region: string): APIClient;
export interface ResolvedSandboxTarget {
    region: string;
    orgId: string;
}
/**
 * Resolve sandbox routing context using cache-first lookup.
 * Falls back to the CLI resolve endpoint on cache miss or partial cache.
 */
export declare function resolveSandboxTarget(logger: Logger, auth: AuthData, apiClient: (APIClient | null) | undefined, sandboxId: string, profileName?: string, config?: Config | null): Promise<ResolvedSandboxTarget>;
/**
 * Look up the region for a sandbox, using cache-first strategy.
 * Falls back to API lookup if not in cache.
 */
export declare function getSandboxRegion(logger: Logger, auth: AuthData, profileName: string | undefined, sandboxId: string, orgId?: string, config?: Config | null): Promise<string>;
/**
 * Cache the region for a sandbox after create/run operations
 */
export declare function cacheSandboxRegion(profileName: string | undefined, sandboxId: string, region: string): Promise<void>;
export declare function cacheSandboxTarget(profileName: string | undefined, sandboxId: string, region: string, orgId?: string): Promise<void>;
/**
 * Clear cached region for a sandbox after delete
 */
export declare function clearSandboxRegionCache(profileName: string | undefined, sandboxId: string): Promise<void>;
/**
 * Parse --file arguments and read file contents.
 *
 * Formats:
 * - <sandbox-path>:<local-path>  - explicit mapping (e.g., script.js:./local/script.js)
 * - <filename>                   - shorthand, uses same name for both (e.g., script.js -> script.js:./script.js)
 *
 * @returns Array of FileToWrite objects
 */
export declare function parseFileArgs(fileArgs: string[] | undefined): Promise<FileToWrite[]>;
//# sourceMappingURL=util.d.ts.map