feat: deepen machine and storage contracts

This commit is contained in:
Harivansh Rathi 2026-04-08 02:32:48 +00:00
parent 6f0f0643fe
commit 04575d111c
5 changed files with 77 additions and 27 deletions

View file

@ -6,22 +6,40 @@ import (
contracthost "github.com/getcompanion-ai/computer-host/contract"
)
type MachineRecord struct {
ID contracthost.MachineID
Phase contracthost.MachinePhase
RuntimeHost string
Error string
CreatedAt time.Time
StartedAt *time.Time
}
type StoragePool string
type VolumeRecord struct {
ID contracthost.VolumeID
MachineID contracthost.MachineID
Kind contracthost.VolumeKind
Pool StoragePool
Path string
CreatedAt time.Time
const (
StoragePoolArtifacts StoragePool = "artifacts"
StoragePoolMachineDisks StoragePool = "machine-disks"
StoragePoolState StoragePool = "state"
StoragePoolUserVolumes StoragePool = "user-volumes"
)
type ArtifactRecord struct {
Ref contracthost.ArtifactRef
KernelImagePath string
RootFSPath string
CreatedAt time.Time
}
type MachineRecord struct {
ID contracthost.MachineID
Artifact contracthost.ArtifactRef
SystemVolumeID contracthost.VolumeID
UserVolumeIDs []contracthost.VolumeID
Phase contracthost.MachinePhase
RuntimeHost string
Error string
CreatedAt time.Time
StartedAt *time.Time
}
type VolumeRecord struct {
ID contracthost.VolumeID
Kind contracthost.VolumeKind
AttachedMachineID *contracthost.MachineID
SourceArtifact *contracthost.ArtifactRef
Pool StoragePool
Path string
CreatedAt time.Time
}