(localPath)
| 763 | } |
| 764 | |
| 765 | export function validateLocalAgentServerPath(localPath) { |
| 766 | if (!path.isAbsolute(localPath)) { |
| 767 | throw new Error( |
| 768 | `OH_AGENT_SERVER_LOCAL_PATH must be an absolute path, got: ${localPath}`, |
| 769 | ); |
| 770 | } |
| 771 | if (!existsSync(localPath)) { |
| 772 | throw new Error(`OH_AGENT_SERVER_LOCAL_PATH does not exist: ${localPath}`); |
| 773 | } |
| 774 | for (const subdir of LOCAL_AGENT_SERVER_SUBDIRS) { |
| 775 | const subdirPath = path.join(localPath, subdir); |
| 776 | if (!existsSync(subdirPath)) { |
| 777 | throw new Error( |
| 778 | `OH_AGENT_SERVER_LOCAL_PATH is missing expected workspace package '${subdir}': ${subdirPath}`, |
| 779 | ); |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | |
| 784 | async function waitForServer(url, timeoutMs = DEFAULT_WAIT_TIMEOUT_MS) { |
| 785 | const startedAt = Date.now(); |
no outgoing calls
no test coverage detected