/**
 * Meerkat TypeScript SDK — communicate with the Meerkat agent runtime.
 *
 * @example
 * ```ts
 * import { MeerkatClient } from "@rkat/sdk";
 *
 * const client = new MeerkatClient();
 * await client.connect();
 *
 * const session = await client.createSession("Hello!");
 * console.log(session.text);
 *
 * for await (const event of session.stream("Tell me a joke")) {
 *   if (event.type === "text_delta") {
 *     process.stdout.write(event.delta);
 *   }
 * }
 *
 * await client.close();
 * ```
 */

export { MeerkatClient } from "./client.js";
export type { ConnectOptions } from "./client.js";
export { DeferredSession, Session } from "./session.js";
export type { DeferredTurnOptions } from "./session.js";
export { Mob } from "./mob.js";
export type {
  MobKickoffMemberSnapshot,
  MobKickoffWaitOptions,
  MobReadyMemberSnapshot,
  MobReadyWaitOptions,
} from "./mob.js";
export { LiveChannel } from "./live.js";
export type { LiveChannelOptions } from "./live.js";
export {
  answerLiveWebrtcOffer,
  isLiveWebrtcBootstrap,
  liveWebrtcAudioConstraints,
  liveWebrtcMediaConstraints,
} from "./live_webrtc.js";
export type {
  LiveWebrtcAnswerClient,
  LiveWebrtcAudioConstraintOptions,
  LiveWebrtcOfferDescription,
  LiveWebrtcPeerConnectionLike,
} from "./live_webrtc.js";
export { EventStream } from "./streaming.js";
export { EventSubscription } from "./subscription.js";
export type {
  AgentEventEnvelope,
  AttributedEvent,
  AttributedMobEvent,
  BlobImageBlock,
  BlobPayload,
  BridgeBootstrapToken,
  BridgeCommand,
  BridgeCommandAuthorizeSupervisor,
  BridgeCommandBindMember,
  BridgeCommandDeliverMemberInput,
  BridgeCommandDestroyMember,
  BridgeCommandHardCancelMember,
  BridgeCommandInterruptMember,
  BridgeCommandObserveMember,
  BridgeCommandRetireMember,
  BridgeCommandRevokeSupervisor,
  BridgeCommandUnwireMember,
  BridgeCommandWireMember,
  BridgePeerSpec,
  BridgeProtocolVersion,
  CatalogModel,
  Capability,
  CommsCommand,
  CommsSendReceipt,
  ConfigEnvelope,
  ContractVersion,
  ContentBlock,
  ContentInput,
  CreateScheduleRequest,
  EventEnvelope,
  HelpExecutionMode,
  HelpOptions,
  HelpRequest,
  InlineImageBlock,
  InlineVideoBlock,
  ModelProfile,
  ModelsCatalog,
  MobCreateOptions,
  MobDefinition,
  MobEventsOptions,
  MobEventsResult,
  MobFlowStatus,
  MobLifecycleAction,
  MobMember,
  MobProfile,
  MobProfileBinding,
  MobProfileDeleteResult,
  MobProfileLookupResult,
  MobStatus,
  MobSummary,
  MobTurnStartOptions,
  MobWireMembersBatchEdge,
  MobWireMembersBatchEdgeInput,
  MobWireMembersBatchResult,
  ModelTier,
  PeerCorrelationId,
  PeerId,
  PeerResponseTerminalOptions,
  ProviderModelCatalog,
  RunResult,
  Schedule,
  ScheduleListOptions,
  ScheduleOccurrencesOptions,
  ScheduleOccurrence,
  ScheduleOccurrencesResult,
  ScheduleToolCallRequest,
  ScheduleToolsResult,
  SchemaWarning,
  SessionAssistantBlock,
  SessionForkResult,
  SessionHistory,
  SessionIngressOptions,
  SessionInfo,
  SessionListOptions,
  SessionMessage,
  SessionOptions,
  SessionToolCall,
  SessionToolResult,
  SkillQuarantineDiagnostic,
  SkillRuntimeDiagnostics,
  SkillKey,
  SkillRef,
  SourceHealthSnapshot,
  SpawnManySpec,
  SpawnSpec,
  TranscriptAssistantBlockReplacement,
  TranscriptEditOptions,
  TranscriptEditRunningBehavior,
  TranscriptMessageReplacement,
  TranscriptReplacement,
  TranscriptToolResultContentBlockReplacement,
  TranscriptUserContentBlockReplacement,
  TurnOptions,
  UpdateSchedulePatch,
  UpdateScheduleRequest,
  Usage,
  ExternalWorkRef,
  WorkEvidenceRef,
  WorkGraphClaim,
  WorkGraphEdge,
  WorkGraphEdgeKind,
  WorkGraphEvent,
  WorkGraphEventFilter,
  WorkGraphEventsResult,
  WorkGraphEventKind,
  WorkGraphItemFilter,
  WorkGraphItemLookupOptions,
  WorkGraphOwner,
  WorkGraphOwnerKey,
  WorkGraphOwnerKind,
  WorkGraphPriority,
  WorkGraphReadyFilter,
  WorkGraphSnapshot,
  WorkGraphSnapshotFilter,
  WorkGraphStatus,
  WorkItem,
  WorkItemListResult,
} from "./types.js";

export {
  MeerkatError,
  CapabilityUnavailableError,
  SessionNotFoundError,
  SkillNotFoundError,
} from "./generated/errors.js";

export type {
  WireAssistantImageRef,
  WireGenerateImageExecutionPlan,
  WireGenerateImageRequest,
  WireImageGenerationToolResult,
  WireImageOperationPhase,
} from "./generated/types.js";

export { CONTRACT_VERSION } from "./generated/types.js";
export type {
  CatalogModelEntry,
  McpAddParams,
  McpHttpConfig,
  McpHttpTransport,
  ModelsCatalogResponse,
  McpRemoveParams,
  McpReloadParams,
  McpLiveOpResponse,
  McpServerConfig,
  McpStdioConfig,
  MobBackendConfigInput,
  MobCreateParams,
  MobCreateResult,
  MobDefinitionInput,
  MobEnsureMemberParams,
  MobEnsureMemberResult,
  MobEventRouterConfigInput,
  MobExternalBackendConfigInput,
  MobFlowNodeInput,
  MobFlowSpecInput,
  MobFlowStepInput,
  MobFrameSpecInput,
  MobLimitsSpecInput,
  MobMemberListEntryWire,
  MobMemberSpecWire,
  MobOrchestratorInput,
  MobProfileBindingInput,
  MobProfileInput,
  MobReconcileParams,
  MobReconcileReportWire,
  MobReconcileResult,
  MobSpawnManyParams,
  MobSpawnManyFailedResult,
  MobSpawnManyFailureCause,
  MobSpawnManyResult,
  MobSpawnManyResultEntry,
  MobSpawnManyResultPayload,
  MobSpawnManyResultStatus,
  MobSpawnManySpawnedResult,
  MobSpawnParams,
  MobSpawnPolicyInput,
  MobSpawnReceiptWire,
  MobSpawnSpecParams,
  MobRotateSupervisorResult,
  MobSupervisorSpecInput,
  MobToolConfigInput,
  MobTopologySpecInput,
  MobTurnStartParams,
  MobWireMembersBatchEdge as WireMobWireMembersBatchEdge,
  MobWireMembersBatchParams,
  MobWireMembersBatchResult as WireMobWireMembersBatchResult,
  MobWiringRulesInput,
  LiveChannelParams,
  LiveCommitInputParams,
  LiveInputChunkWire,
  // R5-10: re-export typed `LiveInputChunkWire` variants so TS consumers
  // can construct typed chunks at the `LiveSendInputParams.chunk` slot
  // without dipping into `./generated/types`.
  LiveInputChunkWireAudio,
  LiveInputChunkWireText,
  LiveInputChunkWireImage,
  LiveInputChunkWireVideoFrame,
  LiveOpenParams,
  LiveOpenResult,
  LiveWebrtcAnswerParams,
  LiveWebrtcAnswerResult,
  LiveSendInputParams,
  LiveStatusResult,
  LiveTruncateParams,
  // CC5/CC6: typed wire mirrors for `LiveOpenResult.capabilities` /
  // `.continuity`. Re-exported from the SDK root so TS consumers can do
  // typed-narrow on `result.continuity.mode` and read capability booleans
  // (`image_in`, `video_in`, etc.) without dipping into `./generated/types`.
  WireLiveChannelCapabilities,
  WireLiveContinuityMode,
  WireLiveContinuityModeFresh,
  WireLiveContinuityModeTranscriptOnly,
  WireLiveContinuityModeDegraded,
  WireLiveContinuityModeProviderNativeResume,
  // FIX-SDK-OBS: typed live-adapter observation discriminated union and
  // its supporting wire mirrors (status / degradation reason / error
  // code). Closes the verifier gap that left the R5-4 audio identity
  // fields and R5-9 `command_rejected` typed variant invisible at the
  // SDK boundary.
  WireLiveAdapterObservation,
  WireLiveAdapterObservationReady,
  WireLiveAdapterObservationUserTranscriptFinal,
  WireLiveAdapterObservationAssistantTextDelta,
  WireLiveAdapterObservationAssistantTranscriptDelta,
  WireLiveAdapterObservationAssistantAudioChunk,
  WireLiveAdapterObservationAssistantTranscriptFinal,
  WireLiveAdapterObservationAssistantTranscriptTruncated,
  WireLiveAdapterObservationRealtimeTranscript,
  WireLiveAdapterObservationToolCallRequested,
  WireLiveAdapterObservationTurnInterrupted,
  WireLiveAdapterObservationTurnCompleted,
  WireLiveAdapterObservationStatusChanged,
  WireLiveAdapterObservationError,
  WireLiveAdapterObservationCommandRejected,
  WireLiveAdapterStatus,
  WireLiveAdapterErrorCode,
  WireLiveConfigRejectionReason,
  WireLiveDegradationReason,
  WireLiveResponseModality,
  WireLiveTransportBootstrap,
  WireLiveTransportBootstrapWebsocket,
  WireLiveTransportBootstrapWebrtc,
  WireLiveTransportBootstrapUnknown,
  // R7-1 (P2): typed `WireAssistantBlock` discriminated union — variants
  // (Transcript, Text, Reasoning, ...) now emit typed inline `data` shapes
  // rather than `Record<string, unknown>`, so SDK consumers can read
  // transcript `text` / `source` and route on `block_type` without parsing
  // raw JSON.
  WireAssistantBlock,
  WireProvider,
  WireTranscriptSource,
  ProviderCatalog,
  RealtimeAudioChunk,
  RealtimeCapabilities,
  RealtimeTextChunk,
  RealtimeTurningMode,
  RealtimeVideoChunk,
  RuntimeAcceptResult,
  RuntimeStateResult,
  SupervisorRotationReportWire,
  WireModelProfile,
  WireModelTier,
  WireSessionInfo,
  WireSessionSummary,
  WireSessionMessage,
  WireToolResultContent,
  WireStopReason,
  WireInputState,
  WireBudgetSplitPolicy,
  WireAuthBindingRef,
  WireMemberLaunchMode,
  WireMemberRef,
  WireMemberState,
  WireMobBackendKind,
  WireMobMemberStatus,
  WireMobProfile,
  WireMobRuntimeMode,
  WireMobToolConfig,
  WireRuntimeBinding,
  WireToolAccessPolicy,
  WireToolFilter,
} from "./generated/types.js";

export type {
  AgentEvent,
  CoreAgentEvent,
  StreamEvent,
  ScopedAgentEvent,
  StreamScopeFrame,
  RunStartedEvent,
  RunCompletedEvent,
  ExtractionSucceededEvent,
  ExtractionFailedEvent,
  RunFailedEvent,
  AgentErrorClass,
  AgentErrorReport,
  AgentErrorReason,
  TurnTerminalCauseReason,
  TurnTerminalCauseKind,
  TurnTerminalOutcome,
  UnknownAgentErrorReason,
  TurnStartedEvent,
  TextDeltaEvent,
  TextCompleteEvent,
  ToolCallRequestedEvent,
  ToolResultReceivedEvent,
  TurnCompletedEvent,
  ToolExecutionStartedEvent,
  ToolExecutionCompletedEvent,
  ToolExecutionTimedOutEvent,
  CompactionStartedEvent,
  CompactionCompletedEvent,
  CompactionFailedEvent,
  BudgetWarningEvent,
  RetryingEvent,
  HookStartedEvent,
  HookCompletedEvent,
  HookFailedEvent,
  HookDeniedEvent,
  SkillsResolvedEvent,
  SkillResolutionFailedEvent,
  SkillResolutionFailureReason,
  InteractionCompleteEvent,
  InteractionFailedEvent,
  StreamTruncatedEvent,
  BackgroundJobCompletedEvent,
  BackgroundJobTerminalStatus,
  ToolConfigChangedEvent,
  ToolConfigChangedPayload,
  ToolConfigChangeOperation,
  ToolConfigChangeStatus,
  BoundaryAppliedToolConfigChangeStatus,
  DeferredCatalogDeltaToolConfigChangeStatus,
  WarningFailedClosedToolConfigChangeStatus,
  ExternalToolDeltaToolConfigChangeStatus,
  ExternalToolDeltaPhase,
  MalformedEvent,
  UnknownEvent,
  StopReason,
  ToolCallArguments,
  BudgetType,
  HookId,
  HookPoint,
} from "./events.js";

export {
  parseEvent,
  parseCoreEvent,
  isTextDelta,
  isTextComplete,
  isTurnCompleted,
  isToolCallRequested,
  isRunCompleted,
  isExtractionSucceeded,
  isExtractionFailed,
  isRunFailed,
} from "./events.js";
