/** * Codex MCP server entry point — the process Codex spawns. * * Codex is extended by a local plugin bundle whose .mcp.json starts this * module on stdio (`command: node`, `args: [dist/entries/codex.js]`). It boots * the same role runtime every other harness uses — resolve directories, load * and resolve roles, sync skill symlinks, assemble the canonical tool set — * then serves those tools over newline-delimited JSON-RPC until stdin closes. * * Tool surface (deliberately NOT expanded here): the canonical intersection set * that buildCanonicalTools() assembles for a harness with no session client and * no dispatch backend, plus load_role_skill. There are no session_* tools (the * stdio transport exposes no rolebox session client) and no dispatch_/loop_/ * task_/graph_* tools — orchestration needs a dispatch backend, which this * entry does not construct, so buildCanonicalTools() registers no graph_* tools * either. No stubs stand in for any of them. * * Run directly with `node dist/entries/codex.js` (or `bun src/entries/codex.ts`). * Importing the module does NOT start the server or read stdin; the module-level * logger does open its log file and install its signal handlers on first * evaluation. * * @module */ import { type CodexMcpServer } from "../platform/adapters/codex/server.ts"; /** Env var overriding the session id reported to tools (wins over the handshake). */ export declare const CODEX_SESSION_ID_ENV = "ROLEBOX_SESSION_ID"; /** Session id used when neither the env override nor the handshake supplies one. */ export declare const DEFAULT_CODEX_SESSION_ID = "codex"; /** * Resolve the session id for a tool call: the ROLEBOX_SESSION_ID override * first, then a session id the MCP client sent in its initialize clientInfo * (the stdio transport carries no Mcp-Session-Id header, so this is usually * absent), then the stable "codex" fallback. */ export declare function resolveCodexSessionId(clientInfo: Record | undefined): string; /** * Boot the role runtime and build the MCP server WITHOUT serving it. The * returned server is ready for serve() (the entry point) or handleLine() * (embedded/tests). * * `output` defaults to process.stdout. The stdio entry passes the protocol * writer captured by installProtocolStdoutGuard() instead, because a library * logging to process.stdout would otherwise corrupt the protocol stream. */ export declare function startCodexMcpServer(options?: { output?: NodeJS.WritableStream; }): Promise; /** Boot the server and serve it until stdin ends. */ export declare function main(): Promise; /** Default export for parity with the other harness entries. */ declare const _default: { startCodexMcpServer: typeof startCodexMcpServer; main: typeof main; }; export default _default; //# sourceMappingURL=codex.d.ts.map