mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
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>
15 lines
679 B
TypeScript
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;
|
|
}
|