pub(open) trait CliSession {
fn id(Self) -> String?
fn continuation(Self) -> Continuation?
async fn prompt(Self, Prompt) -> FinalResponse
}pub struct Cli {
// private fields
}pub struct Continuation {
// private fields
}pub struct FinalResponse {
text : String
session_id : String?
changed_files : ReadOnlyArray[Path]
continuation : Continuation?
}fn FinalResponse::FinalResponse(text : String, session_id? : String, changed_files? : ReadOnlyArray[Path], continuation? : Continuation) -> FinalResponselet response = FinalResponse::FinalResponse(
"done",
session_id="session-1",
)
assert_eq(response.text, "done")
assert_eq(response.session_id, Some("session-1"))let prompt = Prompt::Prompt("review", context_files=[
@path.Path("src/main.mbt"),
])
assert_eq(prompt.text, "review")
assert_eq(prompt.context_files.length(), 1)Install
Download zipProvider-neutral MoonBit interfaces for agent CLI SDKs