| 175 | private readonly _disposers: Array<() => void> = []; |
| 176 | |
| 177 | constructor(opts: DaemonClientOptions = {}) { |
| 178 | this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, ''); |
| 179 | this.apiPrefix = opts.apiPrefix ?? DEFAULT_API_PREFIX; |
| 180 | this.clientId = opts.clientId ?? `server-e2e-${ulid()}`; |
| 181 | this._wsImpl = opts.wsImpl ?? WsWebSocket; |
| 182 | this._logger = opts.logger ?? noopLogger; |
| 183 | this._reportDir = opts.reportDir; |
| 184 | this._controlAckTimeoutMs = opts.controlAckTimeoutMs ?? DEFAULT_CONTROL_ACK_TIMEOUT_MS; |
| 185 | this.http = new HttpClient({ |
| 186 | baseUrl: this.baseUrl, |
| 187 | apiPrefix: this.apiPrefix, |
| 188 | fetchImpl: opts.fetchImpl ?? fetch, |
| 189 | reportDir: this._reportDir, |
| 190 | }); |
| 191 | } |
| 192 | |
| 193 | // ── Probes + model catalog ───────────────────────────────────────────── |
| 194 | getAuth(): Promise<AuthSummary> { |