require("reflect-metadata");
import { CopilotRuntimeLike } from "../core/runtime.cjs";
import { CopilotRuntimeHooks } from "../core/hooks.cjs";
import { ActivateChannelEngine, ChannelsControl } from "../core/channel-manager.cjs";
import { Router } from "express";
import { CorsOptions } from "cors";

//#region src/v2/runtime/endpoints/express.d.ts
/**
 * An Express {@link Router} that may also carry an optional
 * {@link ChannelsControl} surface. Express's Router is a request-scoped
 * middleware object, not a long-running process owner — Node
 * (`createCopilotNodeListener`) is the lifecycle-owning surface for
 * `.channels`. It is attached here too, best-effort, for callers that mount
 * the router directly and want to observe/stop managed Channel activation
 * without also standing up a Node listener.
 */
type CopilotExpressRouter = Router & {
  channels?: ChannelsControl;
};
interface CopilotExpressEndpointParams {
  runtime: CopilotRuntimeLike;
  basePath: string;
  /**
   * Endpoint mode.
   * - `"multi-route"` (default): separate routes for each operation
   * - `"single-route"`: single POST endpoint with JSON envelope dispatch
   */
  mode?: "multi-route" | "single-route";
  /**
   * CORS configuration for the Express router.
   * - `true` (default): permissive CORS (`origin: "*"`, all methods, all headers).
   * - `false`: no CORS middleware is applied — handle it yourself.
   * - object: passed directly to the Express `cors()` middleware.
   */
  cors?: boolean | CorsOptions;
  /**
   * Lifecycle hooks for request processing.
   */
  hooks?: CopilotRuntimeHooks;
  /**
   * Whether the underlying handler activates the runtime's declared managed
   * Channels at creation time. Defaults to `true`. See
   * `CopilotRuntimeHandlerOptions.activateChannels`.
   */
  activateChannels?: boolean;
  /**
   * @internal Test seam: inject a fake Channel activation engine. Forwarded
   * to `createCopilotRuntimeHandler`. Not part of the public API.
   */
  __channelEngine?: ActivateChannelEngine;
}
declare function createCopilotExpressHandler({
  runtime,
  basePath,
  mode,
  cors: corsOption,
  hooks,
  activateChannels,
  __channelEngine
}: CopilotExpressEndpointParams): CopilotExpressRouter;
//#endregion
export { CopilotExpressEndpointParams, CopilotExpressRouter, createCopilotExpressHandler };
//# sourceMappingURL=express.d.cts.map