MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / isFirecracker

Function isFirecracker

packages/cli/src/telemetry/agent_runtime.ts:287–298  ·  view source on GitHub ↗

* AWS Firecracker microVMs expose /dev/vsock and report sys_vendor='Amazon EC2' * with product_name containing 'Firecracker'. Full EC2 reports a real instance * type like 't3.large', so the product_name check distinguishes them.

()

Source from the content-addressed store, hash-verified

285 * type like 't3.large', so the product_name check distinguishes them.
286 */
287function isFirecracker(): boolean {
288 if (platform() !== "linux") return false;
289 if (!existsSync("/dev/vsock")) return false;
290 try {
291 const sysVendor = readFileSync("/sys/class/dmi/id/sys_vendor", "utf-8").trim();
292 if (sysVendor !== "Amazon EC2") return false;
293 const productName = readFileSync("/sys/class/dmi/id/product_name", "utf-8").trim();
294 return productName.toLowerCase().includes("firecracker");
295 } catch {
296 return false;
297 }
298}
299
300function isKVM(): boolean {
301 if (platform() !== "linux") return false;

Callers 1

detectSandboxRuntimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected