MCPcopy Create free account
hub / github.com/deepclause/agentvm / exec

Method exec

example/vercel_agent.py:41–57  ·  view source on GitHub ↗
(self, command)

Source from the content-addressed store, hash-verified

39 print("VM Ready.", file=sys.stderr)
40
41 def exec(self, command):
42 if not self.process:
43 raise RuntimeError("VM not started")
44
45 req = json.dumps({"cmd": "exec", "command": command})
46 self.process.stdin.write(req + "\n")
47 self.process.stdin.flush()
48
49 resp_line = self.process.stdout.readline()
50 if not resp_line:
51 raise RuntimeError("VM closed connection")
52
53 resp = json.loads(resp_line)
54 if resp.get('status') == 'ok':
55 return resp['result']
56 else:
57 raise RuntimeError(f"VM Error: {resp.get('error')}")
58
59 def stop(self):
60 if self.process:

Callers 2

run_agentFunction · 0.95
index.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected