()
| 7 | * Non-darwin platforms should use src/utils/computerUse/platforms/ instead. |
| 8 | */ |
| 9 | export function requireComputerUseSwift(): ComputerUseAPI { |
| 10 | if (process.platform !== 'darwin') { |
| 11 | throw new Error('@ant/computer-use-swift is macOS-only. Use platforms/ for cross-platform.') |
| 12 | } |
| 13 | if (cached) return cached |
| 14 | // eslint-disable-next-line @typescript-eslint/no-require-imports |
| 15 | const mod = require('@ant/computer-use-swift') |
| 16 | if (mod.ComputerUseAPI && typeof mod.ComputerUseAPI === 'function') { |
| 17 | cached = new mod.ComputerUseAPI() as ComputerUseAPI |
| 18 | } else { |
| 19 | cached = mod as ComputerUseAPI |
| 20 | } |
| 21 | return cached |
| 22 | } |
| 23 | |
| 24 | export type { ComputerUseAPI } |
no outgoing calls
no test coverage detected