()
| 78 | } |
| 79 | |
| 80 | function loadNativeBinding(): NativeWsV2Binding | null { |
| 81 | for (const moduleId of candidateNativeBindingModuleIds()) { |
| 82 | try { |
| 83 | const binding = require(moduleId) as NativeWsV2Binding |
| 84 | const validBinding = validateNativeBinding(binding) |
| 85 | if (validBinding) { |
| 86 | logForDebugging(`[OpenAICompatWsV2] native binding loaded from ${moduleId}`) |
| 87 | return validBinding |
| 88 | } |
| 89 | } catch { |
| 90 | // Try the next source/bundled/native layout candidate. |
| 91 | } |
| 92 | } |
| 93 | logForDebugging('[OpenAICompatWsV2] native binding unavailable') |
| 94 | return null |
| 95 | } |
| 96 | |
| 97 | export function loadNativeBindingForTesting(): NativeWsV2Binding | null { |
| 98 | return loadNativeBinding() |
no test coverage detected