(input)
| 477 | }); |
| 478 | |
| 479 | const connectToOpenCodeServer: OpenCodeRuntimeShape["connectToOpenCodeServer"] = (input) => { |
| 480 | const serverUrl = input.serverUrl?.trim(); |
| 481 | if (serverUrl) { |
| 482 | // We don't own externally-configured servers — no scope interaction. |
| 483 | return Effect.succeed({ |
| 484 | url: serverUrl, |
| 485 | exitCode: null, |
| 486 | external: true, |
| 487 | }); |
| 488 | } |
| 489 | |
| 490 | return startOpenCodeServerProcess({ |
| 491 | binaryPath: input.binaryPath, |
| 492 | ...(input.environment !== undefined ? { environment: input.environment } : {}), |
| 493 | ...(input.port !== undefined ? { port: input.port } : {}), |
| 494 | ...(input.hostname !== undefined ? { hostname: input.hostname } : {}), |
| 495 | ...(input.timeoutMs !== undefined ? { timeoutMs: input.timeoutMs } : {}), |
| 496 | }).pipe( |
| 497 | Effect.map((server) => ({ |
| 498 | url: server.url, |
| 499 | exitCode: server.exitCode, |
| 500 | external: false, |
| 501 | })), |
| 502 | ); |
| 503 | }; |
| 504 | |
| 505 | const createOpenCodeSdkClient: OpenCodeRuntimeShape["createOpenCodeSdkClient"] = (input) => |
| 506 | createOpencodeClient({ |
nothing calls this directly
no test coverage detected