/**
 * Canonical spawn-from-env module.
 *
 * Single source of truth for environment-driven agent spawning with
 * SDK-owned bypass policy. Cloud callers set env vars and invoke
 * `spawnFromEnv()` — no custom bypass logic, no spawn scripts.
 *
 * @example
 * ```ts
 * import { spawnFromEnv } from "@agent-relay/sdk";
 * await spawnFromEnv(); // reads AGENT_NAME, AGENT_CLI, etc. from process.env
 * ```
 */
export interface SpawnEnvInput {
    AGENT_NAME: string;
    AGENT_CLI: string;
    RELAY_API_KEY: string;
    AGENT_TASK?: string;
    /** JSON array preferred, space-delimited fallback */
    AGENT_ARGS?: string;
    AGENT_CWD?: string;
    /** Comma-separated channel list, defaults to "general" */
    AGENT_CHANNELS?: string;
    RELAY_BASE_URL?: string;
    BROKER_BINARY_PATH?: string;
    /** Model override (e.g. "opus", "sonnet") */
    AGENT_MODEL?: string;
    /** "1" disables SDK default bypass flags */
    AGENT_DISABLE_DEFAULT_BYPASS?: string;
}
export interface SpawnPolicyResult {
    name: string;
    cli: string;
    args: string[];
    channels: string[];
    task?: string;
    cwd?: string;
    model?: string;
    bypassApplied: boolean;
}
export interface SpawnFromEnvOptions {
    /** Override env source (defaults to process.env) */
    env?: Record<string, string | undefined>;
    /** Override binary path */
    binaryPath?: string;
    /** Override broker name */
    brokerName?: string;
}
export interface SpawnFromEnvResult {
    exitReason: string;
    exitCode?: number;
}
/**
 * Parse and validate spawn environment variables.
 * Throws with a clear message on missing required keys.
 */
export declare function parseSpawnEnv(env?: Record<string, string | undefined>): SpawnEnvInput;
/**
 * Resolve the full spawn policy from parsed env input.
 * Applies bypass flags unless disabled or already present.
 */
export declare function resolveSpawnPolicy(input: SpawnEnvInput): SpawnPolicyResult;
/**
 * Spawn an agent from environment variables.
 *
 * Reads AGENT_NAME, AGENT_CLI, RELAY_API_KEY (required) plus optional
 * AGENT_TASK, AGENT_ARGS, AGENT_CWD, AGENT_CHANNELS, AGENT_MODEL from
 * the environment.
 *
 * Applies canonical bypass flags (claude -> --dangerously-skip-permissions,
 * codex -> --full-auto) unless AGENT_DISABLE_DEFAULT_BYPASS=1.
 *
 * Creates a broker, spawns the agent via PTY, and waits for exit.
 * Returns the exit reason and exit code.
 */
export declare function spawnFromEnv(options?: SpawnFromEnvOptions): Promise<SpawnFromEnvResult>;
//# sourceMappingURL=spawn-from-env.d.ts.map