import { Command, type Interfaces, type Config as OclifConfig } from '@oclif/core';
import type * as Schema from 'effect/Schema';
import { type Daemon } from '@dxos/agent';
import { Client, Config } from '@dxos/client';
import { type Space } from '@dxos/client/echo';
import { type Observability } from '@dxos/observability';
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof AbstractBaseCommand)['baseFlags'] & T['flags']>;
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
/**
 * @deprecated Change to flag.
 */
export declare const ARG_SPACE_KEYS: {
    key: Interfaces.Arg<string | undefined, Record<string, unknown>>;
};
export declare const FLAG_SPACE_KEYS: {
    key: Interfaces.OptionFlag<string[] | undefined, Interfaces.CustomOptions>;
};
/**
 * Custom base command.
 * https://oclif.io/docs/base_class#docsNav
 * https://github.com/salesforcecli/sf-plugins-core/blob/main/src/sfCommand.ts
 */
export declare abstract class AbstractBaseCommand<T extends typeof Command = any> extends Command {
    static enableJsonFlag: boolean;
    static flags: {
        json: Interfaces.BooleanFlag<boolean>;
        verbose: Interfaces.BooleanFlag<boolean>;
        'dry-run': Interfaces.BooleanFlag<boolean>;
        profile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
        config: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
        timeout: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
        target: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        agent: Interfaces.BooleanFlag<boolean>;
        'json-log': Interfaces.BooleanFlag<boolean>;
        'json-logfile': Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
    };
    private _clientConfig?;
    private _client?;
    private _failing;
    protected _startTime: Date;
    protected _observability?: Observability;
    protected flags: Flags<T>;
    protected args: Args<T>;
    constructor(argv: string[], config: OclifConfig);
    get clientConfig(): Config;
    get duration(): number;
    done(): void;
    /**
     * Load the client config.
     */
    init(): Promise<void>;
    readStdin(): Promise<string>;
    private _initObservability;
    /**
     * Load or create config file from defaults.
     * @private
     */
    private _loadConfigFromFile;
    /**
     * Use this method for user-facing messages.
     * Use @dxos/logger for internal messages.
     */
    log(message: string, ...args: any[]): void;
    /**
     * Use this method for user-facing warnings.
     * Use @dxos/logger for internal messages.
     */
    warn(err: string | Error): string | Error;
    /**
     * Use this method for user-facing errors.
     * Use @dxos/logger for internal messages.
     * NOTE: Full stack trace is displayed if `oclif.settings.debug = true` (see bin script).
     * https://oclif.io/docs/error_handling
     */
    catch(err: string | Error, options?: any): never;
    /**
     * Called after each command run.
     */
    finally(): Promise<void>;
    maybeStartDaemon(): Promise<void>;
    /**
     * Lazily create the client.
     */
    getClient(): Promise<Client>;
    /**
     * Get spaces and optionally wait until ready.
     */
    getSpaces(client: Client, { spaceKeys, includeHalo, wait, }?: {
        spaceKeys?: string[];
        includeHalo?: boolean;
        wait?: boolean;
    }): Promise<Space[]>;
    /**
     * Get or select space.
     */
    getSpace(client: Client, key?: string, wait?: boolean): Promise<Space>;
    getSpaceById(client: Client, id: string, { wait }?: {
        wait?: boolean;
    }): Promise<Space>;
    /**
     * Execute callback with the given space(s).
     */
    execWithSpace<T>(callback: (props: {
        client: Client;
        space: Space;
    }) => Promise<T | void>, options?: {
        spaceKeys?: string[];
        all?: boolean;
        types?: Schema.Schema.AnyNoContext[];
        verbose?: boolean;
    }): Promise<T[] | void>;
    /**
     * Convenience function to wrap command passing in client object.
     */
    execWithClient<T>(callback: (params: {
        client: Client;
    }) => Promise<T | void>, options?: {
        halo?: boolean;
    }): Promise<T | void>;
    /**
     * Hook for client initialization.
     */
    protected onClientInit(client: Client): Promise<void>;
    /**
     * Convenience function to wrap starting the agent.
     */
    execWithDaemon<T>(callback: (daemon: Daemon) => Promise<T | undefined>, system: boolean): Promise<T | undefined>;
    parseJson<T>(filename: string): T;
}
//# sourceMappingURL=base.d.ts.map