Files
PaperClipAI/server/src/http/server.ts
T
DottaandPaperclip 49bbfe3092 fix(server): register native runner transport in HTTP startup (#15682)
Register native Runner transport in the shared HTTP server constructor. Add startup regression tests and custom-launcher guidance. Verified with live OpenCode/OpenRouter tasks and complete CI coverage.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-09 09:53:42 -05:00

15 lines
679 B
TypeScript

import { createServer, type RequestListener, type ServerOptions } from "node:http";
import { setupRunnerPrpWebSocketServer } from "../realtime/runner-prp-ws.js";
/** Create the HTTP listener used by both production and custom launchers. */
export function createPaperclipHttpServer(
listener: RequestListener,
options: { apiUrl: string; httpOptions?: ServerOptions },
) {
const server = createServer(options.httpOptions ?? {}, listener);
// Native execution uses the listener even when a launcher has no browser
// realtime connection. Register it before any run can be admitted.
setupRunnerPrpWebSocketServer(server, { apiUrl: options.apiUrl });
return server;
}