/** * OpenAI-Compatible Request Handler * * Core request handling logic that can be used by both: * - Plugin's custom fetch function (serverless) * - Standalone server (Bun.serve) */ /** * Options for the request handler */ export interface RequestHandlerOptions { /** Access token for Cursor API */ accessToken: string; /** Optional logger for debugging */ log?: (message: string, ...args: unknown[]) => void; } /** * Create a request handler function that can be used with custom fetch * * @example * ```ts * const handler = createRequestHandler({ accessToken: "..." }); * * // Use in plugin * return { * fetch: (input, init) => handler(new Request(input, init)), * }; * * // Use in server * Bun.serve({ fetch: handler }); * ``` */ export declare function createRequestHandler(options: RequestHandlerOptions): (req: Request) => Promise; /** * Create a custom fetch handler for use in OpenCode plugin * * This wraps createRequestHandler to match the FetchInput signature * that OpenCode expects from plugins. */ export declare function createPluginFetch(options: RequestHandlerOptions): (input: string | URL | Request, init?: RequestInit) => Promise;