()
| 58 | * Only includes static values — use `freemem()` directly for volatile readings. |
| 59 | */ |
| 60 | export function getSystemMeta(): SystemMeta { |
| 61 | if (cached) return cached; |
| 62 | |
| 63 | const cpuInfo = cpus(); |
| 64 | const firstCpu = cpuInfo[0] ?? null; |
| 65 | |
| 66 | cached = { |
| 67 | os_release: release(), |
| 68 | cpu_count: cpuInfo.length, |
| 69 | cpu_model: firstCpu?.model?.trim() ?? null, |
| 70 | cpu_speed: firstCpu?.speed ?? null, |
| 71 | memory_total_mb: getSystemTotalMb(), |
| 72 | is_docker: detectDocker(), |
| 73 | is_ci: detectCI(), |
| 74 | ci_name: getCIName(), |
| 75 | is_wsl: detectWSL(), |
| 76 | is_tty: Boolean(process.stdout?.isTTY), |
| 77 | sandbox_runtime: detectSandboxRuntime(), |
| 78 | agent_runtime: detectAgentRuntime(), |
| 79 | }; |
| 80 | return cached; |
| 81 | } |
| 82 | |
| 83 | // --------------------------------------------------------------------------- |
| 84 | // Environment detectors |
no test coverage detected