(args: string[])
| 615 | } |
| 616 | |
| 617 | function parseCodexNativeApiServeArgs(args: string[]): CodexNativeApiServeArgs { |
| 618 | const options: CodexNativeApiServeArgs = { |
| 619 | stateDir: null, |
| 620 | cwd: null, |
| 621 | host: null, |
| 622 | port: null, |
| 623 | providerProfileId: null, |
| 624 | }; |
| 625 | for (let index = 0; index < args.length; index += 1) { |
| 626 | const arg = args[index]; |
| 627 | const next = args[index + 1]; |
| 628 | if (arg === '--state-dir' && next) { |
| 629 | options.stateDir = next; |
| 630 | index += 1; |
| 631 | continue; |
| 632 | } |
| 633 | if (arg === '--cwd' && next) { |
| 634 | options.cwd = next; |
| 635 | index += 1; |
| 636 | continue; |
| 637 | } |
| 638 | if (arg === '--host' && next) { |
| 639 | options.host = next; |
| 640 | index += 1; |
| 641 | continue; |
| 642 | } |
| 643 | if (arg === '--port' && next) { |
| 644 | options.port = parseOptionalNonNegativeInt(next); |
| 645 | index += 1; |
| 646 | continue; |
| 647 | } |
| 648 | if (arg === '--provider-profile' && next) { |
| 649 | options.providerProfileId = next; |
| 650 | index += 1; |
| 651 | } |
| 652 | } |
| 653 | return options; |
| 654 | } |
| 655 | |
| 656 | async function materializeQrArtifact({ stateDir, qrcode, qrcodeImageContent }: { |
| 657 | stateDir: string; |
no test coverage detected