package sausage:process@0.1.0; /// Programs share one world. These resources provide lifecycle and bounded stdio transport. interface host { use wasi:io/streams@0.2.12.{input-stream, output-stream}; record request { program: string, argv: list, env: list>, cwd: string, /// None inherits the parent's group. Zero creates a group. A nonzero ID joins a group. group: option, } resource child { pid: func() -> u32; group: func() -> u32; stdin: func() -> output-stream; stdout: func() -> input-stream; stderr: func() -> input-stream; status: func() -> option; wait: func() -> s32; kill: func(); } spawn: func(request: request) -> result; kill: func(pid: u32) -> result<_, string>; } world program { import host; }