/**
 * @amigo-ai/platform-sdk
 *
 * Official TypeScript SDK for the Amigo Platform API.
 *
 * @example
 * ```typescript
 * import { AmigoClient } from '@amigo-ai/platform-sdk'
 *
 * const client = new AmigoClient({
 *   apiKey: 'your-api-key',
 *   workspaceId: 'your-workspace-id',
 * })
 *
 * const agents = await client.agents.list()
 * console.log(agents.items)
 * ```
 */
import type { FetchResponse, HeadersOptions } from 'openapi-fetch';
import type { MediaType, PathsWithMethod } from 'openapi-typescript-helpers';
import { type ClientHooks, type PlatformFetch } from './core/openapi-client.js';
import { type AmigoRequestOptions, type InitParam, type OperationFor, type ScopedRequestOptions } from './core/request-options.js';
import type { RetryOptions } from './core/retry.js';
import { WorkspacesResource } from './resources/workspaces.js';
import { ApiKeysResource } from './resources/api-keys.js';
import { AgentsResource } from './resources/agents.js';
import { SkillsResource } from './resources/skills.js';
import { ActionsResource } from './resources/actions.js';
import { OperatorsResource } from './resources/operators.js';
import { TriggersResource } from './resources/triggers.js';
import { ServicesResource } from './resources/services.js';
import { ContextGraphsResource } from './resources/context-graphs.js';
import { DataSourcesResource } from './resources/data-sources.js';
import { WorldResource } from './resources/world.js';
import { CallsResource } from './resources/calls.js';
import { PhoneNumbersResource } from './resources/phone-numbers.js';
import { IntegrationsResource } from './resources/integrations.js';
import { AnalyticsResource } from './resources/analytics.js';
import { SimulationsResource } from './resources/simulations.js';
import { MetricsResource } from './resources/metrics.js';
import { SettingsResource } from './resources/settings.js';
import { BillingResource } from './resources/billing.js';
import { MemoryResource } from './resources/memory.js';
import { PersonasResource } from './resources/personas.js';
import { ReviewQueueResource } from './resources/review-queue.js';
import { RecordingsResource } from './resources/recordings.js';
import { AuditResource } from './resources/audit.js';
import { WebhookDestinationsResource } from './resources/webhook-destinations.js';
import { SafetyResource } from './resources/safety.js';
import { ComplianceResource } from './resources/compliance.js';
import { FunctionsResource } from './resources/functions.js';
import type { components, paths } from './generated/api.js';
import type { MetricValue as MetricValueAlias } from './resources/metrics.js';
import { type AmigoResponse } from './core/utils.js';
export declare const DEFAULT_BASE_URL = "https://api.platform.amigo.ai";
type PlatformMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch';
type EmptyOptions = Record<never, never>;
type PathForMethod<Method extends PlatformMethod> = Extract<PathsWithMethod<paths, Method>, string>;
type SuccessData<Operation extends Record<string | number, unknown>> = Extract<FetchResponse<Operation, EmptyOptions, MediaType>, {
    error?: never;
}>['data'];
type IsNever<Value> = [Value] extends [never] ? true : false;
type DefinedSuccessData<Operation extends Record<string | number, unknown>> = Exclude<SuccessData<Operation>, undefined>;
type OperationResponse<Path extends keyof paths & string, Method extends PlatformMethod> = Method extends keyof paths[Path] ? paths[Path][Method] extends infer Operation extends Record<string | number, unknown> ? IsNever<SuccessData<Operation>> extends true ? never : [
    DefinedSuccessData<Operation>
] extends [never] ? undefined : DefinedSuccessData<Operation> : never : never;
export interface AmigoClientConfig {
    /** API key created via POST /v1/{workspace_id}/api-keys */
    apiKey: string;
    /** Workspace ID — all resource operations are scoped to this workspace */
    workspaceId: string;
    /**
     * Override the base URL. Defaults to https://api.platform.amigo.ai
     *
     * For BFF proxy patterns (e.g., Next.js), point this at your proxy:
     * ```ts
     * new AmigoClient({ baseUrl: '/api/platform', ... })
     * ```
     */
    baseUrl?: string;
    /** Retry configuration for failed requests */
    retry?: RetryOptions;
    /** Convenience alias for retry count (same semantics as "number of retries") */
    maxRetries?: number;
    /** Default request timeout in milliseconds */
    timeout?: number;
    /** Additional headers sent with every request */
    headers?: HeadersOptions;
    /** Request lifecycle hooks for logging, tracing, or metrics */
    hooks?: ClientHooks;
    /**
     * Custom fetch implementation.
     *
     * Use for BFF proxy routing, server-side cookie forwarding,
     * or test mocking. When provided, all HTTP requests flow
     * through this function instead of globalThis.fetch.
     */
    fetch?: typeof globalThis.fetch;
}
export declare class AmigoClient {
    readonly workspaceId: string;
    readonly baseUrl: string;
    readonly workspaces: WorkspacesResource;
    readonly apiKeys: ApiKeysResource;
    readonly agents: AgentsResource;
    /** @deprecated Use `actions` instead */
    readonly skills: SkillsResource;
    readonly actions: ActionsResource;
    readonly operators: OperatorsResource;
    readonly triggers: TriggersResource;
    readonly services: ServicesResource;
    readonly contextGraphs: ContextGraphsResource;
    readonly dataSources: DataSourcesResource;
    readonly world: WorldResource;
    readonly calls: CallsResource;
    readonly phoneNumbers: PhoneNumbersResource;
    readonly integrations: IntegrationsResource;
    readonly analytics: AnalyticsResource;
    readonly simulations: SimulationsResource;
    readonly metrics: MetricsResource;
    readonly settings: SettingsResource;
    readonly billing: BillingResource;
    readonly memory: MemoryResource;
    readonly personas: PersonasResource;
    readonly reviewQueue: ReviewQueueResource;
    readonly recordings: RecordingsResource;
    readonly audit: AuditResource;
    readonly webhookDestinations: WebhookDestinationsResource;
    readonly safety: SafetyResource;
    readonly compliance: ComplianceResource;
    readonly functions: FunctionsResource;
    /** @internal — exposed for path-level type inference in GET/POST/PUT/etc. */
    readonly api: PlatformFetch;
    constructor(config: AmigoClientConfig);
    withOptions(options: ScopedRequestOptions): AmigoClient;
    GET<Path extends PathForMethod<'get'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'get'>>>): Promise<AmigoResponse<OperationResponse<Path, 'get'>>>;
    POST<Path extends PathForMethod<'post'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'post'>>>): Promise<AmigoResponse<OperationResponse<Path, 'post'>>>;
    PUT<Path extends PathForMethod<'put'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'put'>>>): Promise<AmigoResponse<OperationResponse<Path, 'put'>>>;
    PATCH<Path extends PathForMethod<'patch'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'patch'>>>): Promise<AmigoResponse<OperationResponse<Path, 'patch'>>>;
    DELETE<Path extends PathForMethod<'delete'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'delete'>>>): Promise<AmigoResponse<OperationResponse<Path, 'delete'>>>;
    HEAD<Path extends PathForMethod<'head'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'head'>>>): Promise<AmigoResponse<OperationResponse<Path, 'head'>>>;
    OPTIONS<Path extends PathForMethod<'options'>>(path: Path, ...[init]: InitParam<AmigoRequestOptions<OperationFor<Path, 'options'>>>): Promise<AmigoResponse<OperationResponse<Path, 'options'>>>;
    private static fromPlatformClient;
    private static hydrate;
    private resolveApiRequest;
}
export type { AmigoClientConfig as AmigoConfig };
export { AmigoError, BadRequestError, AuthenticationError, PermissionError, NotFoundError, ConflictError, ValidationError, RateLimitError, ServerError, ServiceUnavailableError, NetworkError, RequestTimeoutError, ParseError, ConfigurationError, isAmigoError, isNotFoundError, isRateLimitError, isAuthenticationError, isRequestTimeoutError, } from './core/errors.js';
export type { WorkspaceId, ApiKeyId, AgentId, PersonaId, SkillId, ActionId, ServiceId, ContextGraphId, CallId, PhoneNumberId, IntegrationId, EntityId, EventId, SimulationRunId, SimulationSessionId, FunctionId, DataSourceId, } from './core/branded-types.js';
export { workspaceId, apiKeyId, agentId, personaId, skillId, actionId, serviceId, contextGraphId, callId, phoneNumberId, integrationId, entityId, eventId, simulationRunId, simulationSessionId, functionId, dataSourceId, } from './core/branded-types.js';
export { paginate } from './core/utils.js';
export { buildLastResponse, extractRequestId } from './core/utils.js';
export type { PaginatedList, ListParams, LastResponseInfo, ResponseMetadata, WithResponseMetadata, AmigoResponse, } from './core/utils.js';
export type { AmigoRequestOptions, ScopedRequestOptions } from './core/request-options.js';
export type { RetryOptions } from './core/retry.js';
export { parseRateLimitHeaders } from './core/rate-limit.js';
export type { RateLimitInfo } from './core/rate-limit.js';
export { verifyWebhookSignature, parseWebhookEvent, WebhookVerificationError, } from './core/webhooks.js';
export type { WebhookEvent, WebhookVerificationOptions, ParseWebhookEventOptions, } from './core/webhooks.js';
export type { ClientHooks, RequestHookContext, ResponseHookContext, ErrorHookContext, } from './core/openapi-client.js';
export type { MetricCatalogEntry, MetricCatalogResponse, MetricListResponse, MetricValue, NumericalMetricValue, CategoricalMetricValue, BooleanMetricValue, MetricValuesParams, MetricTrendParams, } from './resources/metrics.js';
/** @deprecated Use `MetricValue` instead. */
export type MetricValueResponse = MetricValueAlias;
export type CallSummary = components['schemas']['CallSummary'];
export type CallDetail = components['schemas']['CallDetailResponse'];
export type CallTurn = components['schemas']['Turn'];
export type CallToolCall = components['schemas']['ToolCall'];
export type PlaybackTimeline = components['schemas']['PlaybackTimeline'];
export type TimelineActor = components['schemas']['TimelineActor'];
export type TimelineLaneDefinition = components['schemas']['TimelineLaneDefinition'];
export type TimelineSegment = components['schemas']['TimelineSegment'];
export type TimelineTimebase = components['schemas']['TimelineTimebase'];
export type TurnTimeline = components['schemas']['TurnTimeline'];
export type TimelineSegmentType = TimelineSegment['type'];
export type TimelineLane = TimelineSegment['lane'];
export type TimelineTrack = NonNullable<TimelineSegment['track']>;
export type TimelineActorKind = TimelineActor['kind'];
export type TimelineActorRole = TimelineActor['role'];
export type { paths, components, operations } from './generated/api.js';
//# sourceMappingURL=index.d.ts.map