/**
 * @license
 * Copyright 2025 HopCode Team
 * SPDX-License-Identifier: Apache-2.0
 */
import { AuthType, type Config } from '@hoptrendy/hopcode-core';
import type { LoadedSettings } from '../../config/settings.js';
import { useHopCodeAuth } from '../hooks/useHopCodeAuth.js';
import { AuthState } from '../types.js';
import type { HistoryItem } from '../types.js';
import { type ProviderConfig, type ProviderSetupInputs } from '../../auth/providerConfig.js';
export interface OpenAICredentials {
    apiKey: string;
    baseUrl?: string;
    model?: string;
}
/**
 * Normalize model IDs: split by comma, trim, deduplicate, remove empty.
 */
export declare function normalizeModelIds(modelIdsInput: string): string[];
/** @deprecated Use normalizeModelIds instead. */
export declare const normalizeCustomModelIds: typeof normalizeModelIds;
/**
 * Mask an API key for display: show first 3 and last 4 chars.
 */
export declare function maskApiKey(apiKey: string): string;
export type { HopCodeAuthState } from '../hooks/useHopCodeAuth.js';
export type AuthUiState = {
    authError: string | null;
    isAuthDialogOpen: boolean;
    isAuthenticating: boolean;
    pendingAuthType: AuthType | undefined;
    externalAuthState: {
        title: string;
        message: string;
        detail?: string;
    } | null;
    hopCodeAuthState: ReturnType<typeof useHopCodeAuth>['hopCodeAuthState'];
};
export type AuthController = {
    state: AuthUiState;
    actions: {
        setAuthState: (state: AuthState) => void;
        onAuthError: (error: string | null) => void;
        handleAuthSelect: (authType: AuthType | undefined, credentials?: OpenAICredentials) => Promise<void>;
        handleProviderSubmit: (providerConfig: ProviderConfig, inputs: ProviderSetupInputs) => Promise<void>;
        handleOpenRouterSubmit: () => Promise<void>;
        openAuthDialog: () => void;
        cancelAuthentication: () => void;
    };
};
export declare const useAuthCommand: (settings: LoadedSettings, config: Config, addItem: (item: Omit<HistoryItem, "id">, timestamp: number) => void, onAuthChange?: () => void) => {
    authState: AuthState;
    setAuthState: import("react").Dispatch<import("react").SetStateAction<AuthState>>;
    authError: string | null;
    onAuthError: (error: string | null) => void;
    isAuthDialogOpen: boolean;
    isAuthenticating: boolean;
    pendingAuthType: AuthType | undefined;
    externalAuthState: {
        title: string;
        message: string;
        detail?: string;
    } | null;
    hopCodeAuthState: import("../hooks/useHopCodeAuth.js").HopCodeAuthState;
    handleAuthSelect: (authType: AuthType | undefined, credentials?: OpenAICredentials) => Promise<void>;
    handleProviderSubmit: (providerConfig: ProviderConfig, inputs: ProviderSetupInputs) => Promise<void>;
    handleOpenRouterSubmit: () => Promise<void>;
    handleSubscriptionPlanSubmit: (planId: "coding" | "token", apiKey: string, baseUrl?: string) => Promise<void>;
    handleCodingPlanSubmit: (apiKey: string, baseUrl?: string) => Promise<void>;
    handleTokenPlanSubmit: (apiKey: string) => Promise<void>;
    handleApiKeyProviderSubmit: (providerId: string, apiKey: string, modelIdsInput: string, endpointOption?: string) => Promise<void>;
    handleCustomApiKeySubmit: (protocol: AuthType, baseUrl: string, apiKey: string, modelIdsInput: string, generationConfig?: ProviderSetupInputs["advancedConfig"]) => Promise<void>;
    openAuthDialog: () => void;
    cancelAuthentication: () => void;
    state: AuthUiState;
    actions: {
        setAuthState: (state: AuthState) => void;
        onAuthError: (error: string | null) => void;
        handleAuthSelect: (authType: AuthType | undefined, credentials?: OpenAICredentials) => Promise<void>;
        handleProviderSubmit: (providerConfig: ProviderConfig, inputs: ProviderSetupInputs) => Promise<void>;
        handleOpenRouterSubmit: () => Promise<void>;
        openAuthDialog: () => void;
        cancelAuthentication: () => void;
    };
};
