(localPath)
| 875 | } |
| 876 | |
| 877 | export function validateLocalAgentServerPath(localPath) { |
| 878 | if (!path.isAbsolute(localPath)) { |
| 879 | throw new Error( |
| 880 | `OH_AGENT_SERVER_LOCAL_PATH must be an absolute path, got: ${localPath}`, |
| 881 | ); |
| 882 | } |
| 883 | if (!existsSync(localPath)) { |
| 884 | throw new Error(`OH_AGENT_SERVER_LOCAL_PATH does not exist: ${localPath}`); |
| 885 | } |
| 886 | for (const subdir of LOCAL_AGENT_SERVER_SUBDIRS) { |
| 887 | const subdirPath = path.join(localPath, subdir); |
| 888 | if (!existsSync(subdirPath)) { |
| 889 | throw new Error( |
| 890 | `OH_AGENT_SERVER_LOCAL_PATH is missing expected workspace package '${subdir}': ${subdirPath}`, |
| 891 | ); |
| 892 | } |
| 893 | } |
| 894 | } |
| 895 | |
| 896 | async function waitForServer(url, timeoutMs = DEFAULT_WAIT_TIMEOUT_MS) { |
| 897 | const startedAt = Date.now(); |
no outgoing calls
no test coverage detected