import { A as A2ARequestHandler } from '../../a2a_request_handler-B3LxMq3P.cjs';
import { U as UserBuilder } from '../../handlers-9PW7hzWf.cjs';
export { v as AgentCardHandlerOptions, A as AgentCardProvider, J as JsonRpcHandlerOptions, x as RestHandlerOptions, q as agentCardHandler, s as jsonRpcHandler, t as restHandler } from '../../handlers-9PW7hzWf.cjs';
import { L as Logger } from '../../logger-DM9C11Ou.cjs';
export { C as ConsoleLogger, J as JsonLogger, b as LogContext, a as LogLevel, N as NoopLogger } from '../../logger-DM9C11Ou.cjs';
import '../../extensions-DvruCIzw.cjs';

/**
 * Itty Router integration for the A2A Server library.
 *
 * Provides A2AIttyRouterApp for lightweight Cloudflare Workers applications.
 */

/**
 * Itty Router request type with params.
 */
interface IttyRequest extends Request {
    params?: Record<string, string>;
    query?: Record<string, string>;
}
/**
 * Itty Router route handler type.
 */
type IttyRouteHandler = (request: IttyRequest, ...args: unknown[]) => Response | Promise<Response> | void | Promise<void>;
/**
 * Configuration options for A2AIttyRouterApp.
 * Follows the unified A2AServerOptions pattern for consistency across all server implementations.
 */
interface A2AIttyRouterOptions {
    /** Logger instance for request/error logging */
    logger?: Logger;
    /** Function to build user from web-standard Request */
    userBuilder?: UserBuilder;
    /** Path for agent card endpoint (default: '/.well-known/agent-card.json') */
    agentCardPath?: string;
    /** Enable REST API endpoints (default: false) */
    enableRest?: boolean;
    /** Base path for REST endpoints (default: '/rest') */
    restBasePath?: string;
}
/**
 * Route definition for itty-router.
 */
interface IttyRoute {
    method: 'GET' | 'POST' | 'DELETE' | 'ALL';
    pattern: string;
    handler: IttyRouteHandler;
}
/**
 * A2AIttyRouterApp provides A2A protocol support for itty-router applications.
 *
 * @example
 * ```ts
 * const a2aApp = new A2AIttyRouterApp(requestHandler, {
 *   enableRest: true,
 *   logger: JsonLogger.create(),
 * });
 *
 * const router = Router();
 * a2aApp.setupRoutes(router, '/a2a');
 * ```
 */
declare class A2AIttyRouterApp {
    private requestHandler;
    private options;
    constructor(requestHandler: A2ARequestHandler, options?: A2AIttyRouterOptions);
    /**
     * Gets the route definitions for A2A endpoints.
     *
     * @param basePath - Base path for routes (default: '')
     * @returns Array of route definitions
     */
    getRoutes(basePath?: string): IttyRoute[];
    /**
     * Adds A2A routes to an existing itty-router Router.
     *
     * @param router - The itty-router Router instance
     * @param baseUrl - Base URL for A2A endpoints (default: '')
     * @returns The router with A2A routes
     */
    setupRoutes<T extends {
        get: (pattern: string, handler: IttyRouteHandler) => T;
        post: (pattern: string, handler: IttyRouteHandler) => T;
        delete: (pattern: string, handler: IttyRouteHandler) => T;
    }>(router: T, baseUrl?: string): T;
    /**
     * Creates a single catch-all handler for A2A endpoints.
     * Useful when you want to handle all A2A routes with one registration.
     *
     * @param basePath - Base path for A2A endpoints
     * @returns Single route handler for all A2A endpoints
     */
    createHandler(basePath?: string): IttyRouteHandler;
}

export { A2AIttyRouterApp, type A2AIttyRouterOptions, type IttyRequest, type IttyRoute, type IttyRouteHandler, Logger, UserBuilder };
