use serde::Deserialize;
use wcore::{
agent::{AsTool, ToolDescription},
model::Tool,
};
#[derive(Deserialize, schemars::JsonSchema)]
pub struct QuestionOption {
pub label: String,
pub description: String,
}
#[derive(Deserialize, schemars::JsonSchema)]
pub struct Question {
pub question: String,
pub header: String,
pub options: Vec<QuestionOption>,
#[serde(default)]
pub multi_select: bool,
}
#[derive(Deserialize, schemars::JsonSchema)]
pub struct AskUser {
pub questions: Vec<Question>,
}
impl ToolDescription for AskUser {
const DESCRIPTION: &'static str = r#"Ask the user one or more structured questions with predefined options. Each question needs a short UI header, the full question text, and options with labels and descriptions. The user picks from the options or types a free-text "Other" answer. Returns JSON mapping question text to selected label. For multi_select, the answer is a comma-joined string like "Option A, Option B"."#;
}
pub fn tools() -> Vec<Tool> {
vec![AskUser::as_tool()]
}