import { default as Field } from '@arcgis/core/layers/support/Field';
/**
 * Helpers to automate chat with a skill
 */
type RequestContext = {
    kind: "ArcadeCodeRequest";
    context: {
        profile_name: string;
        metadata: Partial<Field>;
    };
};
/** successful response */
type ArcadeCodeContext = {
    kind: "ArcadeCodeResponse";
    arcadeCode?: {
        code: string;
    };
    [key: string]: unknown;
};
/** error response but still 200 status */
type ArcgisErrorAsContext = {
    kind: "ArcgisErrorAsContext";
    error: {
        code: number;
        message?: string;
        subCode?: string | null;
        details?: unknown[];
    };
    [key: string]: unknown;
};
export type ResponseContext = ArcadeCodeContext | ArcgisErrorAsContext;
type ChatResponse = {
    hasMore: boolean;
    context?: ResponseContext;
    message?: string;
    conversationId: string;
    inquiryId: string;
    sequenceNumber: string;
    [key: string]: unknown;
};
/**
 * The skill service will often return an error with a message that contains json. The parsed json has the below shape
 */
interface ArcadeAssistantErrorResponse {
    code?: number | string;
    message: string;
    subCode?: string | null;
    details?: unknown[];
    source?: string;
}
export declare class ArcadeAssistantError extends Error implements ArcadeAssistantErrorResponse {
    code?: number | string;
    subCode?: string | null;
    details?: unknown[];
    source?: string;
    constructor({ message, code, subCode, details, source, }: {
        message: string;
        code?: number | string;
        subCode?: string | null;
        details?: unknown[];
        source?: string;
    });
}
/** Helper to automate chat with a skill */
export declare function chatWithSkill(params: {
    baseUrl: string;
    skillId: string | null;
    message: string;
    authToken: string;
    previousConversationId?: string | null;
    context?: RequestContext;
}): Promise<ChatResponse[]>;
/**
 * Some error messages from the Arcade Assistant API are not user-friendly.
 * This function adapts those errors to a more user-friendly message.
 */
export declare function errorDiagnosticAdapter(error: ArcadeAssistantError): string;
export {};
