export { C as ConsoleLogger, J as JsonLogger, b as LogContext, c as LogContextError, a as LogLevel, L as Logger, N as NoopLogger } from '../../logger-DM9C11Ou.js'; import { j as JSONRPCResponse, aX as JSONRPCSuccessResponse } from '../../extensions-DvruCIzw.js'; import { U as User, S as ServerCallContext } from '../../a2a_request_handler-BuP9LgXH.js'; import { J as JsonRpcTransportHandler } from '../../jsonrpc_transport_handler-jldG2r_T.js'; import { R as RestTransportHandler, M as MessageSendParamsInput } from '../../error-CquguH6H.js'; export { J as JsonRpcErrorResult, a as RestErrorResult, e as RestHttpStatusCode, f as formatJsonRpcError, b as formatParseError, d as formatRestError, c as formatStreamingError } from '../../error-CquguH6H.js'; export { b as AgentCardErrorResult, c as AgentCardFetchResult, a as AgentCardResult, A as CoreAgentCardProvider, f as fetchAgentCard, r as resolveCoreAgentCardProvider } from '../../agent_card_utils-CX6qm1eN.js'; export { H as HTTPError, P as ProcessStreamOptions, S as SSEEventData, b as SSE_HEADERS, e as StreamConsumer, i as StreamEarlyErrorResult, g as StreamResult, h as StreamSuccessResult, l as createExpressStreamConsumer, k as createSSEErrorEvent, a as createSSEErrorEventData, j as createSSEEvent, c as createSSEEventData, m as createWebStreamConsumer, d as formatSSEErrorEvent, f as formatSSEEvent, p as processStream, s as sseEventToString } from '../../streaming-DMEWVCNM.js'; export { w as A2AHandlerConfig, b as A2AServerOptions, v as AgentCardHandlerOptions, A as AgentCardProvider, c as EdgeHandlerOptions, R as ResolvedEdgeHandlerOptions, R as ResolvedWebHandlerOptions, g as Route, f as RouteHandler, S as SSEEvent, U as UserBuilder, c as WebHandlerOptions, W as WebRequest, a as WebResponse, u as createA2AHandler, q as createAgentCardHandler, s as createJsonRpcHandler, t as createRestHandlers, k as createSSEResponse, d as defaultUserBuilder, m as extractPathParams, h as formatSSE, i as formatSSEData, j as formatSSEError, o as generateId, l as jsonResponse, n as noContentResponse, p as parseJsonBody, r as resolveAgentCardProvider, e as resolveOptions } from '../../handlers-Bje5MAUM.js'; export { A as A2ARouteDefinition, c as AGENT_CARD_ROUTE, d as HTTP_STATUS, H as HttpMethod, a as HttpStatusCode, J as JSON_RPC_ROUTE, N as NonStreamingRoute, b as REST_ROUTES, R as RoutePattern, S as StreamingRoute, f as extractParams, m as matchesPattern, t as toExpressPattern, e as toRegex, w as withBasePath } from '../../routes-TKRuFVnA.js'; /** * Core JSON-RPC Business Logic * * This module contains all the shared business logic for JSON-RPC handling. * Server-specific adapters (Express, Hono, etc.) should use these functions * and only implement I/O operations (parsing requests, writing responses). */ /** * Input for JSON-RPC processing. * Server adapters extract these from their framework-specific request objects. */ interface JsonRpcInput { /** Parsed JSON body */ body: unknown; /** Value of the extensions header (or null if not present) */ extensionsHeader: string | null; /** Authenticated user */ user: User; } /** * Result when JSON-RPC returns a single response. */ interface JsonRpcSingleResult { type: 'single'; response: JSONRPCResponse; extensionsToActivate: string[]; } /** * Result when JSON-RPC returns a streaming response. */ interface JsonRpcStreamResult { type: 'stream'; stream: AsyncGenerator; extensionsToActivate: string[]; } /** * Union type for JSON-RPC processing results. */ type JsonRpcResult = JsonRpcSingleResult | JsonRpcStreamResult; /** * Type guard to check if a value is an AsyncGenerator. */ declare function isAsyncGenerator(value: unknown): value is AsyncGenerator; /** * Processes a JSON-RPC request and returns either a single response or a stream. * * This is the core business logic that all server adapters should use. * It handles: * - Building the ServerCallContext with extensions * - Calling the transport handler * - Detecting streaming vs single response * - Collecting activated extensions * * @param input - The parsed request input * @param transportHandler - The JSON-RPC transport handler * @returns Either a single response or a stream result */ declare function processJsonRpc(input: JsonRpcInput, transportHandler: JsonRpcTransportHandler): Promise; /** * Extracts the request ID from a JSON-RPC body. * Returns null if the body doesn't have an id field. */ declare function extractRequestId(body: unknown): string | number | null; /** * Core REST API Business Logic * * This module contains all the shared business logic for REST API handling. * Server-specific adapters (Express, Hono, etc.) should use these functions * and only implement I/O operations (parsing requests, writing responses). */ /** * Input for REST API operations. * Server adapters extract these from their framework-specific request objects. */ interface RestInput { /** Value of the extensions header (or null if not present) */ extensionsHeader: string | null; /** Authenticated user */ user: User; } /** * Result of a non-streaming REST operation. */ interface RestSingleResult { type: 'single'; statusCode: number; body: unknown; extensionsToActivate: string[]; } /** * Result of a streaming REST operation. */ interface RestStreamResult { type: 'stream'; stream: AsyncGenerator; extensionsToActivate: string[]; } /** * Union type for REST operation results. */ type RestResult = RestSingleResult | RestStreamResult; /** * Builds a ServerCallContext from REST input. * * @param input - The REST input containing extensions header and user * @returns ServerCallContext with parsed extensions and user */ declare function buildRestContext(input: RestInput): ServerCallContext; /** * Extracts activated extensions from a context as an array. * * @param context - The ServerCallContext * @returns Array of activated extension names */ declare function getActivatedExtensions(context: ServerCallContext): string[]; /** * Gets the authenticated extended agent card. * * @param transportHandler - The REST transport handler * @param input - The REST input * @returns REST result with agent card */ declare function getAuthenticatedCard(transportHandler: RestTransportHandler, input: RestInput): Promise; /** * Sends a message synchronously. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param body - The message send params (will be normalized by transport handler) * @returns REST result with message or task */ declare function sendMessage(transportHandler: RestTransportHandler, input: RestInput, body: MessageSendParamsInput): Promise; /** * Sends a message with streaming response. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param body - The message send params (will be normalized by transport handler) * @returns REST stream result */ declare function sendMessageStream(transportHandler: RestTransportHandler, input: RestInput, body: MessageSendParamsInput): Promise; /** * Gets a task by ID. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @param historyLength - Optional history length parameter * @returns REST result with task */ declare function getTask(transportHandler: RestTransportHandler, input: RestInput, taskId: string, historyLength?: string): Promise; /** * Cancels a task. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @returns REST result with task */ declare function cancelTask(transportHandler: RestTransportHandler, input: RestInput, taskId: string): Promise; /** * Resubscribes to a task's updates. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @returns REST stream result */ declare function resubscribe(transportHandler: RestTransportHandler, input: RestInput, taskId: string): Promise; /** * Sets a push notification config for a task. * * The body should contain push_notification_config (or pushNotificationConfig). * The taskId will be added automatically. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @param body - The push notification config body (raw request body) * @returns REST result with config */ declare function setTaskPushNotificationConfig(transportHandler: RestTransportHandler, input: RestInput, taskId: string, body: any): Promise; /** * Lists push notification configs for a task. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @returns REST result with configs array */ declare function listTaskPushNotificationConfigs(transportHandler: RestTransportHandler, input: RestInput, taskId: string): Promise; /** * Gets a specific push notification config. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @param configId - The config ID * @returns REST result with config */ declare function getTaskPushNotificationConfig(transportHandler: RestTransportHandler, input: RestInput, taskId: string, configId: string): Promise; /** * Deletes a push notification config. * * @param transportHandler - The REST transport handler * @param input - The REST input * @param taskId - The task ID * @param configId - The config ID * @returns REST result with no content */ declare function deleteTaskPushNotificationConfig(transportHandler: RestTransportHandler, input: RestInput, taskId: string, configId: string): Promise; export { type JsonRpcInput, type JsonRpcResult, type JsonRpcSingleResult, type JsonRpcStreamResult, type RestInput, type RestResult, type RestSingleResult, type RestStreamResult, buildRestContext, cancelTask, deleteTaskPushNotificationConfig, extractRequestId, getActivatedExtensions, getAuthenticatedCard, getTask, getTaskPushNotificationConfig, isAsyncGenerator, listTaskPushNotificationConfigs, processJsonRpc, resubscribe, sendMessage, sendMessageStream, setTaskPushNotificationConfig };