moon add totto2727/agent-core-sdk@0.1.2///|
struct Event {
message : String
} derive(FromJson)
///|
async test "run streams a JSONL event" {
let result = @cli.run(
@cli.Invocation::new(
command="/usr/bin/printf",
arguments=["{\"message\":\"Hello\"}\\n"],
input="",
),
fn(event : Event) raise {
assert_eq(event.message, "Hello")
true
},
)
debug_inspect(result, content="Completed")
}import {
"totto2727/agent-core-sdk/cli",
}moon add totto2727/agent-core-sdk@0.1.2fn Invocation::new(command~ : String, arguments~ : Array[String], input~ : String, environment? : Map[String, String], inherit_environment? : Bool) -> Invocation