plugin: add rust pdk template

This commit is contained in:
2026-06-20 14:15:20 +09:00
parent 5f7f81bdde
commit 06287aca40
17 changed files with 859 additions and 37 deletions
+1
View File
@@ -44,6 +44,7 @@ dotenv = "0.15.0"
futures = { workspace = true }
tempfile = { workspace = true }
wat = "1.241.2"
yoi-plugin-pdk = { workspace = true }
[build-dependencies]
toml = { workspace = true }
+12
View File
@@ -3868,6 +3868,18 @@ mod tests {
);
}
#[test]
fn pdk_tool_output_shape_is_accepted_by_wasm_decoder() {
let pdk_output =
yoi_plugin_pdk::ToolOutput::json("pdk ok", serde_json::json!({"answer": 42}))
.unwrap()
.to_json_string();
let output = decode_plugin_wasm_output(pdk_output.as_bytes()).unwrap();
assert_eq!(output.summary, "pdk ok");
assert_eq!(output.content.as_deref(), Some(r#"{"answer":42}"#));
}
#[tokio::test]
async fn malformed_input_json_fails_before_wasm_execution() {
let (_dir, record) = resolved_record_with_wasm(input_reaches_guest_module());