@0xdbbcd8ccbd223b6c; # unique file ID, generated by `capnp id` struct AssetUuid { id @0 :Data; } struct AssetRef { union { uuid @0 :AssetUuid; path @1 :Data; } } struct AssetUuidList { list @0 :List(AssetUuid); } struct KeyValue { key @0 :Data; value @1 :Data; } enum FileType { file @0; directory @1; symlink @2; none @3; } enum FileState { exists @0; deleted @1; } struct DirtyFileInfo { state @0 :FileState; sourceInfo @1 :SourceFileInfo; } struct SourceFileInfo { type @0 :FileType; lastModified @1 :UInt64; length @2 :UInt64; } struct RenameFileEvent { src @0 :Data; dst @1 :Data; } # Type of Asset Source. An Asset Source is something that produces assets and registers metadata about the # assets with the asset hub, as well as notifying the asset hub about changed assets. # Currently we only have File Asset Source, but in the future could perhaps have # remote-sourced asset sources like a GitHub repository. enum AssetSource { file @0; } struct AssetUuidPair { key @0 :AssetUuid; value @1 :AssetUuid; } # Metadata associated with a source file struct SourceMetadata { assets @0 :List(AssetMetadata); importerVersion @1 :UInt32; importerOptionsType @2 :Data; importerOptions @3 :Data; importerStateType @4 :Data; importerState @5 :Data; buildPipelines @6 :List(AssetUuidPair); importerType @7 :Data; union { error @8 :Error; noError @9 :Void; } pathRefs @10 :List(Data); importHash @11 :Data; version @12 :UInt32; } struct PathRefs { paths @0 :List(Data); } struct Error { text @0 :Text; } struct ArtifactMetadata { assetId @0 :AssetUuid; hash @1 :Data; loadDeps @2 :List(AssetRef); buildDeps @3 :List(AssetRef); compression @4 :CompressionType; compressedSize @5 :UInt64; uncompressedSize @6 :UInt64; typeId @7 :Data; } struct AssetMetadata { id @0 :AssetUuid; searchTags @1 :List(KeyValue); buildPipeline @2 :AssetUuid; # The most recently recorded artifact of the import function latestArtifact :union { artifact @3 :ArtifactMetadata; none @4 :Void; } # The source of the imported asset source @5 :AssetSource; union { error @6 :Error; noError @7 :Void; } } # The identifier for a build artifact is the hash of # - Import artifact hash # - Build parameters (target platform etc) # - Build pipeline hash # The identifier of an import artifact is the hash of # - Source file # - Importer version # - Importer TypeUUID # - Importer state # - Importer state TypeUUID # - Importer options # - Importer options TypeUUID struct Artifact { metadata @0 :ArtifactMetadata; data @1 :Data; # Serialized data as per metadata } struct BuildParameters { } struct AssetChangeLogEntry { num @0 :UInt64; event @1 :AssetChangeEvent; } struct AssetChangeEvent { union { contentUpdateEvent @0 :AssetContentUpdateEvent; removeEvent @1 :AssetRemoveEvent; pathUpdateEvent @2 :PathUpdateEvent; pathRemoveEvent @3 :PathRemoveEvent; } } struct AssetContentUpdateEvent { id @0 :AssetUuid; importHash @1 :Data; # `buildDepHash` is the hash of all build dependencies' import hashes sorted by their AssetUUID. # It can be used to determine if a build artifact needs to be invalidated # by hashing (import_hash, build_dep_hash, build_pipeline_hash, build_parameters) buildDepHash @2 :Data; } struct PathUpdateEvent { path @0 :Data; } struct AssetRemoveEvent { id @0 :AssetUuid; } struct PathRemoveEvent { path @0 :Data; } enum CompressionType { none @0; lz4 @1; } struct DaemonInfo { version @0 :UInt32; }