({
codexCliBin,
codexCliArgs = [],
launchCommand = null,
autolaunch = false,
modelCatalog = [],
modelCatalogMode = 'merge',
enabledFeatures = [],
clientInfo = {
name: 'codexbridge',
title: 'CodexBridge',
version: '0.1.0',
},
spawnImpl = spawn,
webSocketFactory = (url) => new WebSocket(url),
appServerTransport = normalizeCodexAppServerTransport(process.env.CODEX_APP_SERVER_TRANSPORT),
platform = process.platform,
logger = createNoopLogger(),
turnPollSleep = sleep,
turnPollNow = () => Date.now(),
}: CodexAppClientOptions)
| 371 | childStderrTail: string[]; |
| 372 | |
| 373 | constructor({ |
| 374 | codexCliBin, |
| 375 | codexCliArgs = [], |
| 376 | launchCommand = null, |
| 377 | autolaunch = false, |
| 378 | modelCatalog = [], |
| 379 | modelCatalogMode = 'merge', |
| 380 | enabledFeatures = [], |
| 381 | clientInfo = { |
| 382 | name: 'codexbridge', |
| 383 | title: 'CodexBridge', |
| 384 | version: '0.1.0', |
| 385 | }, |
| 386 | spawnImpl = spawn, |
| 387 | webSocketFactory = (url) => new WebSocket(url), |
| 388 | appServerTransport = normalizeCodexAppServerTransport(process.env.CODEX_APP_SERVER_TRANSPORT), |
| 389 | platform = process.platform, |
| 390 | logger = createNoopLogger(), |
| 391 | turnPollSleep = sleep, |
| 392 | turnPollNow = () => Date.now(), |
| 393 | }: CodexAppClientOptions) { |
| 394 | super(); |
| 395 | this.codexCliBin = codexCliBin; |
| 396 | this.codexCliArgs = normalizeStringList(codexCliArgs); |
| 397 | this.launchCommand = launchCommand; |
| 398 | this.autolaunch = autolaunch; |
| 399 | this.modelCatalog = modelCatalog; |
| 400 | this.modelCatalogMode = modelCatalogMode; |
| 401 | this.enabledFeatures = normalizeFeatureList(enabledFeatures); |
| 402 | this.clientInfo = clientInfo; |
| 403 | this.spawnImpl = spawnImpl; |
| 404 | this.webSocketFactory = webSocketFactory; |
| 405 | this.appServerTransport = normalizeCodexAppServerTransport(appServerTransport); |
| 406 | this.platform = platform; |
| 407 | this.logger = logger; |
| 408 | this.turnPollSleep = turnPollSleep; |
| 409 | this.turnPollNow = turnPollNow; |
| 410 | |
| 411 | this.child = null; |
| 412 | this.socket = null; |
| 413 | this.transportKind = null; |
| 414 | this.stdioLineBuffer = ''; |
| 415 | this.pending = new Map(); |
| 416 | this.pendingApprovals = new Map(); |
| 417 | this.approvedExecutions = new Map(); |
| 418 | this.requestId = 0; |
| 419 | this.port = null; |
| 420 | this.connected = false; |
| 421 | this.startPromise = null; |
| 422 | this.childStartError = null; |
| 423 | this.childStderrTail = []; |
| 424 | } |
| 425 | |
| 426 | logDebug(event: string, payload: unknown = null): void { |
| 427 | try { |
nothing calls this directly
no test coverage detected