@copilotkit/runtime
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
38 lines (36 loc) • 1.22 kB
text/typescript
import { CopilotRuntimeLike } from "../core/runtime.cjs";
import { CopilotRuntimeHooks } from "../core/hooks.cjs";
import { Router } from "express";
import { CorsOptions } from "cors";
//#region src/v2/runtime/endpoints/express.d.ts
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;
}
declare function createCopilotExpressHandler({
runtime,
basePath,
mode,
cors: corsOption,
hooks
}: CopilotExpressEndpointParams): Router;
//#endregion
export { CopilotExpressEndpointParams, createCopilotExpressHandler };
//# sourceMappingURL=express.d.cts.map