| Target | Adapter |
|---|---|
| Native | OS arguments/environment, filesystem and stderr/exit |
| JavaScript | Node filesystem adapter; memory embedding does not require filesystem access |
| WASM | WASI Preview 1; the development root is preopened directory fd 3 |
| WASM-GC | morphir_host_v1 imports supplied by the embedding application |
pub(all) struct ContentPublication {
stage : (ContentArtifact) -> Unit raise
commit : (String) -> Unit raise
abort : () -> Unit raise
}pub(all) struct ContentPublisher {
guarantee : PublicationGuarantee
write_bytes : Bool
begin : (Array[String]) -> ContentPublication raise
}fn ContentPublisher::filesystem_inventory(root : String, output_root : String, directories : Array[String], destination_policy? : DestinationPolicy) -> ContentPublisher raisepub(all) struct ContentResult {
report : ContentReport
validated : Array[ValidatedProject]
committed : Array[String]
publication_error : String?
cancelled : Bool
}pub(all) enum DestinationPolicy {
Replace
Create
}pub(all) enum Event {
Phase(String)
Diagnostic(Diagnostic)
Generated(LibraryProject)
Validated(ValidatedProject)
Published(String)
}pub(all) struct Host {
input : Mount
publisher : Publisher?
toolchain : Provider?
library_build : LibraryBuildProvider?
metadata_sessions : MetadataSessions
environment : Map[String, String]
system : Document
global : Document
cancelled : () -> Bool
event : (Event) -> Unit
limits : Limits
}fn Host::register_project_metadata_provider(self : Host, engine : Engine, acquire : (ProjectMetadataScope) -> MetadataSession raise) -> Unit raisefn Host::run_content(self : Host, engine : Engine, plan : Plan, publisher : ContentPublisher, read_bytes? : (String) -> Bytes raise?) -> ContentResult raisepub(all) struct LibraryBuildLease {
id : String
build : (LibraryBuildRequest) -> Json raise
dispose : () -> Unit raise
}pub(all) struct LibraryBuildProvider {
contracts : Array[String]
acquire : () -> LibraryBuildLease raise
}fn LibraryBuildProvider::process(program : String, helper : String, compiler_home : String, dependencies : Map[String, String], timeout? : Int) -> LibraryBuildProvider raisepub(all) struct LibraryBuildRequest {
project : LibraryProject
snapshot : String
source_identity : String
target : String
}pub(all) struct Limits {
max_files : Int
max_bytes : Int
max_depth : Int
}pub(all) struct Location {
root : String
invocation : String
file : String?
directory : FileTreePath
configuration_files : Map[String, String]
}pub(all) struct MetadataAuditEvidence {
service : String
service_sha256 : String
service_verified : Bool
release : String
native_revision : String?
profile : String
profile_version : String
assurance : String
profile_verified : Bool
}pub(all) struct MetadataAuditRecord {
run_id : String
operation : String
project : String
phase : MetadataAuditPhase
signal : Signal
code : String
evidence : MetadataAuditEvidence?
wall_seconds : Double
duration_seconds : Double
}pub(all) struct MetadataAuditSink {
enabled : () -> Bool
try_record : (MetadataAuditRecord) -> Delivery raise
monotonic : () -> Double
wall : () -> Double
run_id : String
}pub struct MetadataSessions {
// private fields
}pub(all) struct Mount {
kind : (String) -> Int raise
read : (String) -> String raise
list : (String) -> Array[String] raise
}pub struct NativeTelemetry {
// private fields
}fn NativeTelemetry::new(program : String, helper : String, endpoint : String, protocol : String, pin : Json, timeout? : Int) -> NativeTelemetry raisepub(all) struct Publication {
stage : (Artifact) -> Unit raise
commit : (String) -> Unit raise
abort : () -> Unit raise
}pub(all) enum PublicationGuarantee {
AtomicTask
RecoverableTask
HostManaged
}pub(all) struct Publisher {
guarantee : PublicationGuarantee
begin : (Array[String]) -> Publication raise
}pub struct TelemetrySession {
// private fields
}fn TelemetrySession::flush_native(self : TelemetrySession, adapter : NativeTelemetry, node : String) -> Unitfn TelemetrySession::flush_to_process(self : TelemetrySession, node : String, helper : String, program : String, args : Array[String], timeout? : Int, cancel_file? : String, program_identity? : String?, clear_otel_environment? : Bool) -> Unit#alias(local)
fn TelemetrySession::for_project(root : String, path : String?, enabled? : Bool, kind? : String, format? : String) -> TelemetrySession raisefn TelemetrySession::new(path : String?, format? : String, record_traces? : Bool) -> TelemetrySession raisepub(all) struct ValidatedProject {
project_id : String
root : String
target : String
source_identity : String
receipt : String
evidence : Json
}fn configuration_options(location : Location, environment : Map[String, String], selected? : String, profiles? : ProfileSelection, isolated? : Bool, suppress? : Array[String]) -> ConfigurationOptions raisefn error_code(error : Error) -> Stringfn metadata_helper_bundle_sha256(helper : String) -> String raisefn native_telemetry_endpoint(endpoint : String) -> Boolfn process_execution(program : String, helper : String, compiler_home : String, dependencies : Map[String, String], timeout? : Int, toolchain_pin? : Json?, build_mode? : String, cancel_file? : String, payload_capture? : PayloadCapture, observer? : Observer) -> Provider raisefn run_configuration(location : Location, environment : Map[String, String], options : ConfigurationOptions, overlay? : Document) -> Document raisefn rust_evaluator_lane(program : String, helper : String, pin : Json?, node? : String, required? : Bool, timeout? : Int, cancel_file? : String) -> EvaluatorLane raisefn verify_and_publish(plans : Array[Plan], provider : Provider, evaluator : Evaluator, publisher : ContentPublisher, destination : String, cancelled? : () -> Bool, observer? : Observer) -> VerificationResult raise