#[derive(Debug, Clone, serde::Serialize)]
pub struct CancelInvocationParams {
#[serde(rename = "invocationId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub invocation_id: String,
}
impl<'de> serde::Deserialize<'de> for CancelInvocationParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CancelInvocationParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "invocationId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub invocation_id: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CancelInvocationParams {
invocation_id: fields.invocation_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CancelInvocation;
#[derive(Debug, Clone, serde::Serialize)]
pub struct CancelInvocationResponse {}
impl<'de> serde::Deserialize<'de> for CancelInvocationResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CancelInvocationResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CancelInvocationResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for CancelInvocation {
type Params = CancelInvocationParams;
type Response = CancelInvocationResponse;
const METHOD: &'static str = "WebMCP.cancelInvocation";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct DisableParams {}
impl<'de> serde::Deserialize<'de> for DisableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Disable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DisableResponse {}
impl<'de> serde::Deserialize<'de> for DisableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Disable {
type Params = DisableParams;
type Response = DisableResponse;
const METHOD: &'static str = "WebMCP.disable";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct EnableParams {}
impl<'de> serde::Deserialize<'de> for EnableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Enable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EnableResponse {}
impl<'de> serde::Deserialize<'de> for EnableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Enable {
type Params = EnableParams;
type Response = EnableResponse;
const METHOD: &'static str = "WebMCP.enable";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct InvokeToolParams {
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "toolName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub tool_name: String,
#[serde(rename = "input")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub input: std::collections::BTreeMap<String, serde_json::Value>,
}
impl<'de> serde::Deserialize<'de> for InvokeToolParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InvokeToolParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "toolName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub tool_name: String,
#[serde(rename = "input")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub input: std::collections::BTreeMap<String, serde_json::Value>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InvokeToolParams {
frame_id: fields.frame_id,
tool_name: fields.tool_name,
input: fields.input,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct InvokeTool;
#[derive(Debug, Clone, serde::Serialize)]
pub struct InvokeToolResponse {
#[serde(rename = "invocationId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub invocation_id: String,
}
impl<'de> serde::Deserialize<'de> for InvokeToolResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InvokeToolResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "invocationId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub invocation_id: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InvokeToolResponse {
invocation_id: fields.invocation_id,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for InvokeTool {
type Params = InvokeToolParams;
type Response = InvokeToolResponse;
const METHOD: &'static str = "WebMCP.invokeTool";
}