import { z } from '@botpress/sdk';
import type { YargsConfig } from '@bpinternal/yargs-extra';
import type { ApiClientFactory } from '../api/client';
import * as config from '../config';
import * as consts from '../consts';
import type { CommandArgv, CommandDefinition } from '../typings';
import * as utils from '../utils';
import { BaseCommand } from './base-command';
export type GlobalCommandDefinition = CommandDefinition<typeof config.schemas.global>;
export type GlobalCache = {
    apiUrl: string;
    token: string;
    workspaceId: string;
    activeProfile: string;
};
export type ConfigurableGlobalPaths = {
    botpressHomeDir: string;
    cliRootDir: utils.path.AbsolutePath;
    profilesPath: string;
};
export type ConstantGlobalPaths = typeof consts.fromHomeDir & typeof consts.fromCliRootDir;
export type AllGlobalPaths = ConfigurableGlobalPaths & ConstantGlobalPaths;
declare const profileCredentialSchema: import("@botpress/sdk").ZodObject<{
    apiUrl: import("@botpress/sdk").ZodString;
    workspaceId: import("@botpress/sdk").ZodString;
    token: import("@botpress/sdk").ZodString;
}, "strip", {
    apiUrl: string;
    workspaceId: string;
    token: string;
}, {
    apiUrl: string;
    workspaceId: string;
    token: string;
}>;
export type ProfileCredentials = z.infer<typeof profileCredentialSchema>;
declare class GlobalPaths extends utils.path.PathStore<keyof AllGlobalPaths> {
    constructor(argv: CommandArgv<GlobalCommandDefinition>);
}
export declare abstract class GlobalCommand<C extends GlobalCommandDefinition> extends BaseCommand<C> {
    protected api: ApiClientFactory;
    protected prompt: utils.prompt.CLIPrompt;
    private _pkgJson;
    constructor(api: ApiClientFactory, prompt: utils.prompt.CLIPrompt, ...args: ConstructorParameters<typeof BaseCommand<C>>);
    protected get globalPaths(): GlobalPaths;
    protected get globalCache(): utils.cache.FSKeyValueCache<GlobalCache>;
    protected bootstrap(): Promise<void>;
    protected teardown: () => Promise<void>;
    protected getAuthenticatedClient(credentials: Partial<YargsConfig<typeof config.schemas.credentials>>): Promise<import("../api/client").ApiClient | null>;
    protected readProfileFromFS(profile: string): Promise<ProfileCredentials>;
    protected readProfilesFromFS(): Promise<Record<string, ProfileCredentials>>;
    protected writeProfileToFS(profileName: string, profile: ProfileCredentials): Promise<void>;
    protected ensureLoginAndCreateClient(credentials: YargsConfig<typeof config.schemas.credentials>): Promise<import("../api/client").ApiClient>;
    private readonly _notifyUpdateCli;
    protected readCLIPkgJson(): Promise<utils.pkgJson.PackageJson>;
}
export {};
