()
| 6 | let vmInstance: AgentVM | null = null; |
| 7 | |
| 8 | async function getVM() { |
| 9 | if (!vmInstance) { |
| 10 | console.log('[AgentVM Skill] Initializing VM...'); |
| 11 | vmInstance = new AgentVM({ |
| 12 | // Optional: mount host directories or enable networking here |
| 13 | network: true |
| 14 | }); |
| 15 | await vmInstance.start(); |
| 16 | console.log('[AgentVM Skill] VM Ready.'); |
| 17 | } |
| 18 | return vmInstance; |
| 19 | } |
| 20 | |
| 21 | export const tools = { |
| 22 | linux_sandbox_exec: tool({ |