/**
 * Minimal Gateway Client for OS CLI
 * Self-contained client for connecting to 4Runr Gateway
 */
/** Seeded by `npm run seed:api-key` in local Gateway bundles. */
export declare const DEFAULT_LOCAL_DEV_API_KEY = "test-key-ce67dabb0d4e27e3d72877c921b89cae";
/**
 * Resolve Gateway auth for API routes (`/api/runs`, etc.).
 * Local loopback falls back to the default dev key so the TUI works after portal connect.
 */
export declare function resolveGatewayApiKey(options?: {
    gatewayUrl?: string;
    apiKey?: string;
    authToken?: string;
}): {
    apiKey?: string;
    authToken?: string;
};
/**
 * Use 127.0.0.1 instead of localhost for HTTP calls to the bundled Gateway.
 * On Windows, `localhost` often resolves to ::1 first while the Gateway binds 127.0.0.1 only,
 * so /health never succeeds until this normalization.
 */
/** True if JSON body is from 4Runr Gateway GET /health (not another app on the port). */
export declare function isGatewayHealthPayload(data: unknown): boolean;
/** Subset of GET /ready JSON for Portal Monitoring lines. */
export interface GatewayReadyDependencyLine {
    name: 'database' | 'redis' | 'queue';
    status: string;
    message?: string;
    error?: string;
}
export interface GatewayVerifyResult {
    ok: boolean;
    gatewayUrl: string;
    healthLatencyMs: number;
    health: unknown;
    /** Present when /ready was reached; `ready` is Gateway readiness, not HTTP success. */
    ready?: {
        ready: boolean;
        httpStatus: number;
        statusText?: string;
    };
    /** Parsed dependency checks from /ready when present (for UI). */
    readyChecks?: GatewayReadyDependencyLine[];
    readyLatencyMs?: number;
    error?: string;
}
export declare function preferIpv4LoopbackGatewayUrl(url: string): string;
export interface Run {
    id: string;
    name: string;
    status: 'created' | 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'killed';
    input?: any;
    output?: any;
    logs?: Array<{
        timestamp: string;
        level: string;
        message: string;
    }>;
    createdAt: string;
    updatedAt: string;
    completedAt?: string;
}
export interface RunInput {
    agent_id?: string;
    data?: any;
    prompt?: string;
    systemPrompt?: string;
    temperature?: number;
    maxTokens?: number;
    conversationHistory?: Array<{
        role: string;
        content: string;
    }>;
    topP?: number;
    frequencyPenalty?: number;
    presencePenalty?: number;
    tools?: string[];
    useLocalModel?: boolean;
    localModelProvider?: 'ollama' | 'lm-studio' | 'custom';
    localModelName?: string;
    localModelUrl?: string;
    [key: string]: any;
}
export declare class GatewayClient {
    private http;
    private gatewayUrl;
    readonly runs: {
        create: (data: {
            name: string;
            input: RunInput;
        }) => Promise<Run>;
        start: (id: string) => Promise<void>;
        cancel: (id: string) => Promise<void>;
        get: (id: string) => Promise<Run>;
        list: (options?: {
            limit?: number;
            status?: string;
        }) => Promise<Run[]>;
    };
    constructor(config: {
        gatewayUrl: string;
        timeout?: number;
        apiKey?: string;
        authToken?: string;
    });
    health(): Promise<any>;
    /**
     * Live proof the configured URL is the 4Runr Gateway: validates /health shape, then GET /ready.
     */
    verify(options?: {
        readyTimeoutMs?: number;
    }): Promise<GatewayVerifyResult>;
    /**
     * Raw Prometheus text from GET /metrics (public on Gateway; no auth).
     */
    prometheusMetrics(): Promise<string>;
    /** GET JSON (monitoring APIs, etc.). Uses same auth headers as the rest of the client. */
    getJson(path: string): Promise<unknown>;
    /** POST JSON with auth headers. */
    postJson(path: string, body: unknown): Promise<unknown>;
}
//# sourceMappingURL=gateway-client.d.ts.map