import type { OperatorContractManifest, OperatorMethodContract } from '../contracts/index.js';
import type { OperatorMethodInput, OperatorMethodOutput, OperatorStreamMethodId, OperatorTypedMethodId } from '../contracts/index.js';
import type { HttpTransport } from '../transport-http/index.js';
import { type ContractInvokeOptions, type ContractStreamOptions } from '../transport-http/index.js';
export interface OperatorRemoteClientInvokeOptions extends ContractInvokeOptions {
}
export interface OperatorRemoteClientStreamOptions extends ContractStreamOptions {
}
type RequiredKeys<T extends object> = {
    [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
}[keyof T];
type MethodArgs<TInput, TOptions> = [
    TInput
] extends [undefined] ? [input?: undefined, options?: TOptions] : TInput extends object ? [RequiredKeys<TInput>] extends [never] ? [input?: TInput, options?: TOptions] : [input: TInput, options?: TOptions] : [input: TInput, options?: TOptions];
type WithoutKeys<TInput, TKeys extends PropertyKey> = [
    TInput
] extends [undefined] ? undefined : TInput extends object ? Omit<TInput, Extract<keyof TInput, TKeys>> : TInput;
type KnownMethodArgs<TMethodId extends OperatorTypedMethodId> = MethodArgs<OperatorMethodInput<TMethodId>, OperatorRemoteClientInvokeOptions>;
type KnownPathMethodArgs<TMethodId extends OperatorTypedMethodId, TKeys extends PropertyKey> = MethodArgs<WithoutKeys<OperatorMethodInput<TMethodId>, TKeys>, OperatorRemoteClientInvokeOptions>;
type KnownStreamArgs<TMethodId extends OperatorStreamMethodId> = MethodArgs<OperatorMethodInput<TMethodId>, OperatorRemoteClientStreamOptions>;
export interface OperatorRemoteClient {
    readonly transport: HttpTransport;
    readonly contract: OperatorContractManifest;
    listMethods(): readonly OperatorMethodContract[];
    getMethod(methodId: string): OperatorMethodContract;
    invoke<TMethodId extends OperatorTypedMethodId>(methodId: TMethodId, ...args: KnownMethodArgs<TMethodId>): Promise<OperatorMethodOutput<TMethodId>>;
    invoke<T = unknown>(methodId: string, input?: Record<string, unknown>, options?: OperatorRemoteClientInvokeOptions): Promise<T>;
    stream<TMethodId extends OperatorStreamMethodId>(methodId: TMethodId, ...args: KnownStreamArgs<TMethodId>): Promise<() => void>;
    readonly sessions: {
        create(...args: KnownMethodArgs<'sessions.create'>): Promise<OperatorMethodOutput<'sessions.create'>>;
        get(sessionId: string, ...args: KnownPathMethodArgs<'sessions.get', 'sessionId'>): Promise<OperatorMethodOutput<'sessions.get'>>;
        list(...args: KnownMethodArgs<'sessions.list'>): Promise<OperatorMethodOutput<'sessions.list'>>;
        messages: {
            create(sessionId: string, ...args: KnownPathMethodArgs<'sessions.messages.create', 'sessionId'>): Promise<OperatorMethodOutput<'sessions.messages.create'>>;
            list(sessionId: string, ...args: KnownPathMethodArgs<'sessions.messages.list', 'sessionId'>): Promise<OperatorMethodOutput<'sessions.messages.list'>>;
        };
        inputs: {
            cancel(sessionId: string, inputId: string, ...args: KnownPathMethodArgs<'sessions.inputs.cancel', 'sessionId' | 'inputId'>): Promise<OperatorMethodOutput<'sessions.inputs.cancel'>>;
        };
        followUp(...args: KnownMethodArgs<'sessions.followUp'>): Promise<OperatorMethodOutput<'sessions.followUp'>>;
        steer(...args: KnownMethodArgs<'sessions.steer'>): Promise<OperatorMethodOutput<'sessions.steer'>>;
        close(sessionId: string, ...args: KnownPathMethodArgs<'sessions.close', 'sessionId'>): Promise<OperatorMethodOutput<'sessions.close'>>;
        reopen(sessionId: string, ...args: KnownPathMethodArgs<'sessions.reopen', 'sessionId'>): Promise<OperatorMethodOutput<'sessions.reopen'>>;
    };
    readonly tasks: {
        create(...args: KnownMethodArgs<'tasks.create'>): Promise<OperatorMethodOutput<'tasks.create'>>;
        get(taskId: string, ...args: KnownPathMethodArgs<'tasks.get', 'taskId'>): Promise<OperatorMethodOutput<'tasks.get'>>;
        list(...args: KnownMethodArgs<'tasks.list'>): Promise<OperatorMethodOutput<'tasks.list'>>;
        status(...args: KnownMethodArgs<'tasks.status'>): Promise<OperatorMethodOutput<'tasks.status'>>;
        cancel(taskId: string, ...args: KnownPathMethodArgs<'tasks.cancel', 'taskId'>): Promise<OperatorMethodOutput<'tasks.cancel'>>;
        retry(taskId: string, ...args: KnownPathMethodArgs<'tasks.retry', 'taskId'>): Promise<OperatorMethodOutput<'tasks.retry'>>;
    };
    readonly approvals: {
        list(...args: KnownMethodArgs<'approvals.list'>): Promise<OperatorMethodOutput<'approvals.list'>>;
        claim(approvalId: string, ...args: KnownPathMethodArgs<'approvals.claim', 'approvalId'>): Promise<OperatorMethodOutput<'approvals.claim'>>;
        approve(approvalId: string, ...args: KnownPathMethodArgs<'approvals.approve', 'approvalId'>): Promise<OperatorMethodOutput<'approvals.approve'>>;
        deny(approvalId: string, ...args: KnownPathMethodArgs<'approvals.deny', 'approvalId'>): Promise<OperatorMethodOutput<'approvals.deny'>>;
        cancel(approvalId: string, ...args: KnownPathMethodArgs<'approvals.cancel', 'approvalId'>): Promise<OperatorMethodOutput<'approvals.cancel'>>;
    };
    readonly providers: {
        list(...args: KnownMethodArgs<'providers.list'>): Promise<OperatorMethodOutput<'providers.list'>>;
        get(providerId: string, ...args: KnownPathMethodArgs<'providers.get', 'providerId'>): Promise<OperatorMethodOutput<'providers.get'>>;
        usage(providerId: string, ...args: KnownPathMethodArgs<'providers.usage.get', 'providerId'>): Promise<OperatorMethodOutput<'providers.usage.get'>>;
    };
    readonly accounts: {
        snapshot(...args: KnownMethodArgs<'accounts.snapshot'>): Promise<OperatorMethodOutput<'accounts.snapshot'>>;
    };
    readonly localAuth: {
        status(...args: KnownMethodArgs<'local_auth.status'>): Promise<OperatorMethodOutput<'local_auth.status'>>;
    };
    readonly control: {
        snapshot(...args: KnownMethodArgs<'control.snapshot'>): Promise<OperatorMethodOutput<'control.snapshot'>>;
        status(...args: KnownMethodArgs<'control.status'>): Promise<OperatorMethodOutput<'control.status'>>;
        contract(...args: KnownMethodArgs<'control.contract'>): Promise<OperatorMethodOutput<'control.contract'>>;
        methods: {
            list(...args: KnownMethodArgs<'control.methods.list'>): Promise<OperatorMethodOutput<'control.methods.list'>>;
            get(methodId: string, ...args: KnownPathMethodArgs<'control.methods.get', 'methodId'>): Promise<OperatorMethodOutput<'control.methods.get'>>;
        };
        auth: {
            current(...args: KnownMethodArgs<'control.auth.current'>): Promise<OperatorMethodOutput<'control.auth.current'>>;
            login(...args: KnownMethodArgs<'control.auth.login'>): Promise<OperatorMethodOutput<'control.auth.login'>>;
        };
        events: {
            catalog(...args: KnownMethodArgs<'control.events.catalog'>): Promise<OperatorMethodOutput<'control.events.catalog'>>;
            stream(...args: KnownStreamArgs<'control.events.stream'>): Promise<() => void>;
        };
    };
    readonly telemetry: {
        snapshot(...args: KnownMethodArgs<'telemetry.snapshot'>): Promise<OperatorMethodOutput<'telemetry.snapshot'>>;
        events(...args: KnownMethodArgs<'telemetry.events.list'>): Promise<OperatorMethodOutput<'telemetry.events.list'>>;
        errors(...args: KnownMethodArgs<'telemetry.errors.list'>): Promise<OperatorMethodOutput<'telemetry.errors.list'>>;
        traces(...args: KnownMethodArgs<'telemetry.traces.list'>): Promise<OperatorMethodOutput<'telemetry.traces.list'>>;
        metrics(...args: KnownMethodArgs<'telemetry.metrics.get'>): Promise<OperatorMethodOutput<'telemetry.metrics.get'>>;
        otlp: {
            traces(...args: KnownMethodArgs<'telemetry.otlp.traces'>): Promise<OperatorMethodOutput<'telemetry.otlp.traces'>>;
            logs(...args: KnownMethodArgs<'telemetry.otlp.logs'>): Promise<OperatorMethodOutput<'telemetry.otlp.logs'>>;
            metrics(...args: KnownMethodArgs<'telemetry.otlp.metrics'>): Promise<OperatorMethodOutput<'telemetry.otlp.metrics'>>;
        };
        stream(...args: KnownStreamArgs<'telemetry.stream'>): Promise<() => void>;
    };
}
export declare function createOperatorRemoteClient(transport: HttpTransport, contract: OperatorContractManifest): OperatorRemoteClient;
export {};
//# sourceMappingURL=client-core.d.ts.map