MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getMachineId

Function getMachineId

cli/src/utils/fingerprint.ts:23–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21let systeminformationModule: typeof import('systeminformation') | null = null
22
23async function getMachineId(): Promise<string> {
24 if (!machineIdModule) {
25 machineIdModule = await import('node-machine-id')
26 }
27 const id = await machineIdModule.machineId()
28 // Validate that we got a real machine ID, not an empty or placeholder value.
29 // Throwing here triggers the legacy fallback in calculateFingerprint().
30 if (!id || id === 'unknown' || id.length < 8) {
31 throw new Error('Invalid machine ID returned')
32 }
33 return id
34}
35
36async function getSystemInfo(): Promise<{
37 system: { manufacturer: string; model: string; serial: string; uuid: string }

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected