
import { CopilotRuntimeLike } from "./runtime.cjs";
import { CopilotCorsConfig } from "./fetch-cors.cjs";
import { CopilotRuntimeHooks } from "./hooks.cjs";

//#region src/v2/runtime/core/fetch-handler.d.ts
interface CopilotRuntimeHandlerOptions {
  runtime: CopilotRuntimeLike;
  /**
   * Optional base path for routing.
   *
   * When provided: strict prefix stripping. The handler strips this prefix from the
   * URL pathname and matches the remainder against known routes.
   *
   * When omitted: suffix matching. The handler matches known route patterns as
   * suffixes of the URL pathname.
   */
  basePath?: string;
  /**
   * Endpoint mode:
   * - "multi-route" (default): Routes like POST /agent/:agentId/run, GET /info, etc.
   * - "single-route": Single POST endpoint with JSON envelope { method, params, body }
   */
  mode?: "multi-route" | "single-route";
  /**
   * Optional CORS configuration.
   * When not provided, no CORS headers are added (let the framework handle it).
   * Set to true for permissive defaults, or provide an object.
   */
  cors?: boolean | CopilotCorsConfig;
  /**
   * Lifecycle hooks for request processing.
   */
  hooks?: CopilotRuntimeHooks;
}
type CopilotRuntimeFetchHandler = (request: Request) => Promise<Response>;
declare function createCopilotRuntimeHandler(options: CopilotRuntimeHandlerOptions): CopilotRuntimeFetchHandler;
//#endregion
export { CopilotRuntimeFetchHandler, CopilotRuntimeHandlerOptions, createCopilotRuntimeHandler };
//# sourceMappingURL=fetch-handler.d.cts.map