(input)
| 565 | }, |
| 566 | ]; |
| 567 | |
| 568 | return { |
| 569 | projectRoot, |
| 570 | isWindows, |
| 571 | isWsl, |
| 572 | configPath, |
| 573 | checks, |
| 574 | pass: checks.every((check) => check.pass), |
| 575 | recommendation: isWindows |
| 576 | ? 'Prefer [windows] sandbox = "elevated"; use "unelevated" only when elevated setup is blocked.' |
| 577 | : 'Native Windows sandbox checks are advisory outside Windows.', |
| 578 | }; |
| 579 | } |
| 580 | |
| 581 | function createAppServerProbe(options = {}) { |
| 582 | const listen = options.listen || 'stdio://'; |
| 583 | const args = ['app-server', '--listen', listen]; |
| 584 | if (options.wsAuth) args.push('--ws-auth', options.wsAuth); |
| 585 | if (options.wsTokenFile) args.push('--ws-token-file', path.resolve(options.wsTokenFile)); |
| 586 | |
| 587 | return { |
| 588 | command: 'codex', |
| 589 | args, |
| 590 | localOnly: listen === 'stdio://' || listen.startsWith('unix://') || listen.startsWith('ws://127.0.0.1') || listen.startsWith('ws://localhost'), |
| 591 | warning: listen.startsWith('ws://') && !options.wsAuth |
| 592 | ? 'WebSocket app-server probes should use a local listener or explicit auth.' |
| 593 | : null, |
| 594 | improvesOnScraping: 'App-server emits structured protocol events instead of requiring terminal scraping.', |
| 595 | }; |
| 596 | } |
| 597 | |
| 598 | function parseAppServerMessages(input) { |
| 599 | if (Array.isArray(input)) return input; |
| 600 | return String(input || '') |
| 601 | .split(/\r?\n/) |
| 602 | .filter(Boolean) |
| 603 | .map((line) => JSON.parse(line)); |
| 604 | } |
| 605 |
no test coverage detected