import type { OAuthCredentials } from "@mariozechner/pi-ai"; import GigaChat from "gigachat"; import type { ChatCompletionChunk, Chat as GigaChatChat } from "gigachat/interfaces"; export declare const GIGACHAT_CERTIFICATES_URL = "https://developers.sber.ru/docs/ru/gigachat/certificates"; export declare const GIGACHAT_VALID_SCOPES: readonly ["GIGACHAT_API_PERS", "GIGACHAT_API_B2B", "GIGACHAT_API_CORP"]; export declare const GIGACHAT_DEFAULT_SCOPE = "GIGACHAT_API_PERS"; export declare const GIGACHAT_DEFAULT_BUSINESS_SCOPE = "GIGACHAT_API_B2B"; export declare const GIGACHAT_DEFAULT_AUTH_MODE = "basic"; export declare const GIGACHAT_EXPIRY_BUFFER_MS: number; export type GigaChatScope = (typeof GIGACHAT_VALID_SCOPES)[number]; export type GigaChatAuthMode = "basic" | "token"; export type GigaChatAccountType = "personal" | "business"; export type GigaChatBaseUrlChoice = "default" | "custom"; export type GigaChatStoredCredentials = OAuthCredentials & { authMode?: GigaChatAuthMode; accountType?: GigaChatAccountType; authorizationKey?: string; scope?: GigaChatScope; baseUrl?: string; user?: string; password?: string; }; export declare function normalizeAuthorizationKey(input: string): string; export declare function normalizeUser(input: string): string; export declare function normalizePassword(input: string): string; export declare function normalizeScope(input: string, fallbackScope?: GigaChatScope): GigaChatScope; export declare function getDefaultScope(accountType: GigaChatAccountType): GigaChatScope; export declare function normalizeAccountType(input: string): GigaChatAccountType; export declare function normalizeAuthMode(input: string): GigaChatAuthMode; export declare function normalizeBaseUrlChoice(input: string): GigaChatBaseUrlChoice; export declare function normalizeBaseUrl(input: string, fallbackBaseUrl?: string): string; export declare function normalizeStoredBaseUrl(input: unknown): string | undefined; export declare function parseExpiresAt(expiresAt: unknown): number; export declare function withCertificateHint(error: unknown): Error; export declare class PiGigaChatClient extends GigaChat { get accessTokenData(): { access_token?: unknown; expires_at?: unknown; } | undefined; get accessToken(): string | undefined; updateTokenQuietly(): Promise; streamRobust(payload: GigaChatChat, abortSignal?: AbortSignal): AsyncGenerator; private requestStreamBody; } export declare function createTokenClient(authorizationKey: string, scope: GigaChatScope, baseUrl: string): PiGigaChatClient; export declare function createPasswordClient(user: string, password: string, baseUrl: string): PiGigaChatClient; export declare function isAccessToken(value: string): boolean;