import type { CreateRemoteProvisionClaim, RemoteProvisionClaim, ProvisionResult } from './provisioning-pull'; import { type MetalGuestManifest } from '@forgezero/runtime/metal-resource-evidence'; export interface MetalImage { path: string; sha256: string; } /** One non-overlapping NUMA-local CPU capacity pool that may serve several guests. */ export interface MetalCpuPool { key: string; /** Linux CPU-list syntax, including every SMT sibling in this pool. */ cpus: string; /** Real cores represented by cpus; checked against the sellable capacity promise. */ physicalCores: number; /** Linux NUMA node-list syntax. Optional on a non-NUMA machine. */ memoryNodes?: string; } /** Exact non-overlapping physical-core slice reserved for one guest. */ export interface MetalCpuAllocation extends MetalCpuPool { } export interface MetalProvisionProfile { volumeGroup: string; bridge: string; subnetPrefix: string; addressStart: number; addressEnd: number; gateway: string; nameservers?: readonly string[]; stateDir: string; seedDir: string; unitDir: string; /** One-time compatibility source for pre-Agent platform guests. */ legacyStateDir?: string; apiUrl: string; /** Root-owned collector coordinate inherited by guests, never claim-controlled. */ agentTelemetryEndpoint: string; images: Record; /** Explicit host-observed pools. No pool means no dynamic guest authority. */ cpuPools: readonly MetalCpuPool[]; /** CPUs kept outside every guest pool for the host and control services. */ housekeepingCpus: string; /** NUMA nodes reserved for host allocations when the topology permits it. */ housekeepingMemoryNodes?: string; bunVersion: string; bunReleaseSha256: string; agentVersion: string; confidential?: { cbitpos: number; reducedPhysBits: number; policy: string; }; } export interface MetalCommandResult { exitCode: number; stdout: string; stderr: string; } export type MetalExec = (argv: readonly string[]) => Promise; export type GuestManifest = MetalGuestManifest; export declare class MetalProvisionError extends Error { } export declare const guestNameFor: (computeKey: string) => string; /** Linux interface names are capped at 15 bytes. */ export declare const tapNameFor: (computeKey: string) => string; export declare const macForAddress: (address: string) => string; /** A reconciler may close only the transient mapper it opened itself. */ export declare const shouldCloseGuestMapper: (openedHere: boolean, active: boolean) => boolean; export declare function validateMetalProfile(profile: MetalProvisionProfile): void; export declare function allocateAddress(profile: MetalProvisionProfile, computeKey: string, rows: GuestManifest[]): string; /** Stable tight-fit allocation of exact physical cores inside one NUMA-local pool. */ export declare function allocateCpuPool(profile: MetalProvisionProfile, claim: Pick, rows: GuestManifest[]): MetalCpuAllocation; export declare function guestBootstrapOperations(profile: MetalProvisionProfile, attested?: boolean, hasEnrolment?: boolean, nodeLabel?: string): readonly (readonly string[])[]; export declare function cloudInit(profile: MetalProvisionProfile, claim: CreateRemoteProvisionClaim, manifest: GuestManifest): { userData: string; metaData: string; networkConfig: string; }; /** The only root operation the metal agent may request. */ export declare function provisionMetalGuest(profile: MetalProvisionProfile, claim: CreateRemoteProvisionClaim, exec: MetalExec): Promise; export declare function removeMetalGuest(profile: MetalProvisionProfile, claim: RemoteProvisionClaim, exec: MetalExec): Promise;