/**
 * @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 { MeResource } from './resources/me.js';
import { WorkspacesResource } from './resources/workspaces.js';
import { ApiKeysResource } from './resources/api-keys.js';
import { TokensResource } from './resources/tokens.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 { PromptLogsResource } from './resources/prompt-logs.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 { ConversationsResource } from './resources/conversations.js';
import { IntegrationsResource } from './resources/integrations.js';
import { ExternalIntegrationsResource } from './resources/external-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 { ReviewQueueResource } from './resources/review-queue.js';
import { RecordingsResource } from './resources/recordings.js';
import { AuditResource } from './resources/audit.js';
import { ComplianceResource } from './resources/compliance.js';
import { EventsResource } from './resources/events.js';
import { FunctionsResource } from './resources/functions.js';
import { ObserversResource } from './resources/observers.js';
import { FhirResource } from './resources/fhir.js';
import { InsightsResource } from './resources/insights.js';
import { CommandCenterResource } from './resources/command-center.js';
import { SensoriumResource } from './resources/sensorium.js';
import { DataQueryResource } from './resources/data-query.js';
import { BriefsResource } from './resources/briefs.js';
import { DesktopSessionsResource } from './resources/desktop-sessions.js';
import { IntakeResource } from './resources/intake.js';
import { NetworkResource } from './resources/network.js';
import { PipelineResource } from './resources/pipeline.js';
import { TasksResource } from './resources/tasks.js';
import { ToolsResource } from './resources/tools.js';
import { SurfacesResource } from './resources/surfaces.js';
import { SessionsResource } from './resources/sessions.js';
import { WorkspaceDatabaseResource } from './resources/workspace-database.js';
import { WorkspaceDataQueriesResource } from './resources/workspace-data-queries.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;
    /**
     * Base URL for the agent engine (voice-agent) WebSocket endpoints.
     *
     * Required when `baseUrl` points to a BFF proxy or a different host
     * than the agent engine — WebSockets cannot traverse HTTP proxies.
     * Used by `conversations.textStreamUrl()` to build the `ws://` URL.
     *
     * Accepts `http://` or `https://` (auto-mapped to `ws://` / `wss://`)
     * or direct `ws://` / `wss://` URLs.
     *
     * Defaults to deriving from `baseUrl` (works when REST API and agent
     * engine share the same origin).
     *
     * ```ts
     * new AmigoClient({
     *   baseUrl: '/api/platform',  // BFF proxy for REST
     *   agentBaseUrl: 'wss://api.platform.amigo.ai',  // direct for WS
     *   ...
     * })
     * ```
     */
    agentBaseUrl?: string;
}
export declare class AmigoClient {
    readonly workspaceId: string;
    readonly baseUrl: string;
    readonly agentBaseUrl: string | undefined;
    readonly workspaces: WorkspacesResource;
    readonly me: MeResource;
    readonly apiKeys: ApiKeysResource;
    readonly tokens: TokensResource;
    readonly agents: AgentsResource;
    /** @deprecated Use `actions` instead */
    readonly skills: SkillsResource;
    readonly actions: ActionsResource;
    readonly operators: OperatorsResource;
    readonly promptLogs: PromptLogsResource;
    readonly triggers: TriggersResource;
    readonly services: ServicesResource;
    readonly contextGraphs: ContextGraphsResource;
    readonly dataSources: DataSourcesResource;
    readonly world: WorldResource;
    readonly calls: CallsResource;
    readonly conversations: ConversationsResource;
    readonly integrations: IntegrationsResource;
    readonly externalIntegrations: ExternalIntegrationsResource;
    readonly analytics: AnalyticsResource;
    readonly simulations: SimulationsResource;
    readonly metrics: MetricsResource;
    readonly settings: SettingsResource;
    readonly billing: BillingResource;
    readonly reviewQueue: ReviewQueueResource;
    readonly recordings: RecordingsResource;
    readonly audit: AuditResource;
    readonly compliance: ComplianceResource;
    readonly events: EventsResource;
    readonly functions: FunctionsResource;
    /**
     * Voice-call observer real-time stream. Subscribe with
     * ``client.observers.subscribe({ callSid, token, onEvent })``. See
     * {@link ObserversResource}.
     */
    readonly observers: ObserversResource;
    /** FHIR / EHR data interop — sync status, imports, resources, patient views */
    readonly fhir: FhirResource;
    /** Natural-language insights — schema, suggestions, SQL, chat sessions */
    readonly insights: InsightsResource;
    /** Command Center — rolled-up workspace homepage snapshot */
    readonly commandCenter: CommandCenterResource;
    /** Sensorium — operator-facing live agent loop observability */
    readonly sensorium: SensoriumResource;
    /** Generic data query against whitelisted workspace datasets */
    readonly dataQuery: DataQueryResource;
    /** AI-generated entity briefs (workspace-level + per-entity) */
    readonly briefs: BriefsResource;
    /** Remote-controlled desktop sessions for driving GUI-only third-party apps */
    readonly desktopSessions: DesktopSessionsResource;
    /** Patient intake — signed upload links + uploads */
    readonly intake: IntakeResource;
    /** Workspace network metadata (egress IP allowlist) */
    readonly network: NetworkResource;
    /** Data ingestion pipeline observability (sources, throughput, review backlog) */
    readonly pipeline: PipelineResource;
    /** Long-running async tasks (poll by id or list by call) */
    readonly tasks: TasksResource;
    /** Manual tool execution + per-service tool resolution */
    readonly tools: ToolsResource;
    /** Surfaces — short-lived form/intake experiences (lifecycle: create→deliver→review→approve) */
    readonly surfaces: SurfacesResource;
    /** Live agent sessions — list active calls + inject mid-call directives */
    readonly sessions: SessionsResource;
    /** Workspace database — Lakebase fork lifecycle, SQL query execution, query tool CRUD */
    readonly workspaceDatabase: WorkspaceDatabaseResource;
    /** Workspace data queries — Lakebase-backed query tool registry */
    readonly workspaceDataQueries: WorkspaceDataQueriesResource;
    /** @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'>>>;
    /**
     * Bind a path literal + method to a fully-typed callable.
     *
     * Captures the path as a literal type at definition time, so the returned
     * callable keeps full request/response inference even when stored,
     * exported, or composed across modules. Solves the "explicit `as const` on
     * path params" footgun: consumers who store a path in a `string` variable
     * lose path inference and the SDK collapses to `unknown`.
     *
     * ```ts
     * const getCall = client.defineRoute('GET', '/v1/{workspace_id}/calls/{call_id}')
     * const call = await getCall({ params: { path: { call_id } } })
     * // call.data: CallDetailResponse | undefined  (fully typed)
     * ```
     *
     * Workspace IDs are still auto-injected by the underlying dispatchers — the
     * helper is purely a type-level convenience. Runtime behavior is identical
     * to calling the matching method directly, so retries, hooks, error
     * conversion, and timeout handling all apply.
     */
    defineRoute<Path extends PathForMethod<'get'>>(method: 'GET', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'get'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'get'>>>;
    defineRoute<Path extends PathForMethod<'post'>>(method: 'POST', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'post'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'post'>>>;
    defineRoute<Path extends PathForMethod<'put'>>(method: 'PUT', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'put'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'put'>>>;
    defineRoute<Path extends PathForMethod<'patch'>>(method: 'PATCH', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'patch'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'patch'>>>;
    defineRoute<Path extends PathForMethod<'delete'>>(method: 'DELETE', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'delete'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'delete'>>>;
    defineRoute<Path extends PathForMethod<'head'>>(method: 'HEAD', path: Path): (...args: InitParam<AmigoRequestOptions<OperationFor<Path, 'head'>>>) => Promise<AmigoResponse<OperationResponse<Path, 'head'>>>;
    defineRoute<Path extends PathForMethod<'options'>>(method: 'OPTIONS', path: Path): (...args: 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, isPermissionError, isConflictError, isValidationError, isServerError, isNetworkError, isHttpException, isHttpValidationError, isUnparseableErrorBody, } from './core/errors.js';
export type { ErrorContext, PlatformErrorBody, HttpExceptionBody, HttpValidationErrorBody, UnparseableErrorBody, AmigoErrorWithBody, } from './core/errors.js';
export type { WorkspaceId, ApiKeyId, AgentId, SkillId, ActionId, ServiceId, ContextGraphId, CallId, PhoneNumberId, IntegrationId, IntegrationEndpointId, EntityId, EventId, SimulationRunId, SimulationSessionId, FunctionId, DataSourceId, } from './core/branded-types.js';
export { workspaceId, apiKeyId, agentId, skillId, actionId, serviceId, contextGraphId, callId, phoneNumberId, integrationId, integrationEndpointId, 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 { TokensResource } from './resources/tokens.js';
export { EXTERNAL_USER_SESSION_CREATE_SCOPE } from './resources/tokens.js';
export type { ApiKeyTokenExchangeRequest, ApiKeyTokenExchangeResponse, ClientCredentialsTokenRequest, ClientCredentialsTokenResponse, ExternalUserSessionTokenRequest, ExternalUserSessionTokenResponse, RefreshTokenRequest, RefreshTokenResponse, } from './resources/tokens.js';
export { ExternalIntegrationsResource } from './resources/external-integrations.js';
export type { CreateExternalIntegrationCredentialRequest, CreateExternalIntegrationRequest, ExternalIntegration, ExternalIntegrationCredential, ExternalIntegrationCredentialSecret, ExternalIntegrationListResponse, ListExternalIntegrationsParams, UpdateExternalIntegrationRequest, } from './resources/external-integrations.js';
export { IntegrationsResource } from './resources/integrations.js';
export type { CreateIntegrationEndpointRequest, CreateIntegrationRequest, CustomTokenExchangeIntegrationAuthRequest, Integration, IntegrationAuth, IntegrationAuthRequest, IntegrationEndpoint, IntegrationEndpointListResponse, IntegrationIdentityBinding, IntegrationIdentityBindings, IntegrationIdentityBindingTestValues, IntegrationListResponse, ListEndpointsParams, ListIntegrationsParams, TestIntegrationEndpointRequest, TestIntegrationEndpointResponse, UpdateIntegrationEndpointRequest, UpdateIntegrationRequest, } from './resources/integrations.js';
export type { MetricCatalogEntry, MetricCatalogResponse, MetricListResponse, MetricValue, NumericalMetricValue, CategoricalMetricValue, BooleanMetricValue, MetricValuesParams, MetricTrendParams, } from './resources/metrics.js';
/** @deprecated Use `MetricValue` instead. */
export type MetricValueResponse = MetricValueAlias;
/** Voice provider constants and types. */
export { STT_PROVIDERS, TTS_PROVIDERS, VOICE_SESSION_PROVIDERS } from './resources/voice.js';
export type { AgentVoiceConfig, ServiceVoiceConfigInput, ServiceVoiceConfigOutput, SttProvider, TtsProvider, VoiceSessionProvider, VoiceSettingsRequest, VoiceSettingsResponse, } from './resources/voice.js';
export type { CreateWorkspaceDataQueryRequest, InvokeWorkspaceDataQueryRequest, InvokeWorkspaceDataQueryResponse, UpdateWorkspaceDataQueryRequest, WorkspaceDataQuery, WorkspaceDataQueryListItem, WorkspaceDataQueryListResponse, } from './resources/workspace-data-queries.js';
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 { SubscribeToWorkspaceOptions, SubscriptionHandle, WorkspaceSSEEvent, WorkspaceSSEEventType, WorkspaceEventStreamErrorCode, } from './resources/events.js';
export { WorkspaceEventStreamError, isWorkspaceEventStreamError } from './resources/events.js';
export { sessionConnectAuthProtocols, textStreamAuthProtocols } from './resources/conversations.js';
export type { ConversationDetail, ConversationListResponse, ConversationSummary, ConversationTurn, ConversationTurnAvailableAction, ConversationTurnStateTransition, CreateConversationRequest, ListConversationsParams, SessionConnectUrlParams, TextStreamAuthProtocols, TextStreamUrlParams, TurnDoneEvent, TurnErrorEvent, TurnMessageEvent, TurnRequest, TurnResponse, TurnConversationSnapshot, TurnStreamEvent, TurnThinkingEvent, TurnTokenEvent, TurnToolCallCompletedEvent, TurnToolCallStartedEvent, } from './resources/conversations.js';
export { ObserversResource, observerAuthProtocols } from './resources/observers.js';
export type { ObserverAuthProtocols, ObserverSSEEvent, ObserverSSEEventType, ObserverSubscribeOptions, } from './resources/observers.js';
export { createReconnectingWebSocket, ReconnectingWebSocketError, } from './core/reconnecting-websocket.js';
export type { ReconnectingWebSocketErrorReason, ReconnectingWebSocketHandle, ReconnectingWebSocketOptions, ReconnectingWebSocketReconnectReason, ReconnectingWebSocketState, WebSocketFactory, } from './core/reconnecting-websocket.js';
export { loginWithDeviceCode, TokenManager, FileTokenStorage, MemoryTokenStorage, DeviceCodeExpiredError, DeviceCodeDeniedError, RefreshTokenExpiredError, LoginCancelledError, formatDeviceCodeInstructions, formatDeviceCodeLink, formatWorkspaceList, openBrowser, } from './core/device-code.js';
export type { DeviceCodeIssuance, IdentityTokenResponse, WorkspaceChoice, MultiWorkspaceResponse, DeviceCodeLoginOptions, DeviceCodeStatus, AuthResult, StoredCredentials, TokenStorage, TokenManagerConfig, } from './core/device-code.js';
export type { paths, components, operations } from './generated/api.js';
//# sourceMappingURL=index.d.ts.map