(promise, ms = 5000)
| 1 | const { AgentVM } = require('../src/index'); |
| 2 | |
| 3 | function withTimeout(promise, ms = 5000) { |
| 4 | return Promise.race([ |
| 5 | promise, |
| 6 | new Promise((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${ms}ms`)), ms)) |
| 7 | ]); |
| 8 | } |
| 9 | |
| 10 | async function test() { |
| 11 | console.log("Initializing AgentVM..."); |