/**
 * @file index.ts
 * @description Transport module barrel exports.
 *
 * Provides recreateable transport classes for session recreation support
 * in serverless environments and distributed systems.
 *
 * @example
 * ```typescript
 * import {
 *   RecreateableStreamableHTTPServerTransport,
 *   RecreateableSSEServerTransport,
 * } from '@frontmcp/sdk/transport';
 * ```
 *
 * @module @frontmcp/sdk/transport
 */

// Recreateable transports for session recreation support
export { RecreateableStreamableHTTPServerTransport } from './adapters/streamable-http-transport';
export type { StreamableHTTPServerTransportOptions } from './adapters/streamable-http-transport';

export { RecreateableSSEServerTransport } from './adapters/sse-transport';
export type { RecreateableSSEServerTransportOptions } from './adapters/sse-transport';

// Base SSE transport (for type compatibility)
export { SSEServerTransport } from '#sse-transport';
export type { SSEServerTransportOptions } from '#sse-transport';

// Transport types
export type { SupportedTransport } from './adapters/transport.local.adapter';
// Type-only exports for TransportType and TransportKey (interfaces/type aliases)
export type { TransportType, TransportKey } from './transport.types';

// EventStore exports for SSE resumability support
export { createEventStore, MemoryEventStore, RedisEventStore } from './event-stores';
export type {
  EventStoreConfig,
  EventStoreResult,
  MemoryEventStoreOptions,
  RedisEventStoreOptions,
} from './event-stores';

/**
 * Creates an in-memory MCP server for programmatic access without HTTP transport.
 *
 * Use this for:
 * - MCP SDK Client integration
 * - LangChain MCP adapter integration
 * - Unit/integration testing
 * - Agent backends with custom invocation
 *
 * @example
 * ```typescript
 * import { createInMemoryServer } from '@frontmcp/sdk';
 * import { Client } from '@frontmcp/protocol';
 *
 * const { clientTransport, setAuthInfo, close } = await createInMemoryServer(scope, {
 *   authInfo: { token: 'jwt-token' }
 * });
 *
 * const client = new Client({ name: 'my-client', version: '1.0.0' });
 * await client.connect(clientTransport);
 *
 * // Use MCP SDK Client methods
 * const tools = await client.listTools();
 *
 * // Update auth context per-request
 * setAuthInfo({ token: 'new-token' });
 *
 * // Cleanup when done
 * await client.close();
 * await close();
 * ```
 */
export { createInMemoryServer } from './in-memory-server';

/**
 * Options for creating an in-memory MCP server.
 * @see createInMemoryServer
 */
export type { CreateInMemoryServerOptions } from './in-memory-server';

/**
 * Result returned by createInMemoryServer.
 * Contains the client transport, auth setter, and close function.
 * @see createInMemoryServer
 */
export type { InMemoryServerResult } from './in-memory-server';
