vtcode_core/tools/
request_user_input.rs1use anyhow::{Result, anyhow};
2use async_trait::async_trait;
3use serde_json::Value;
4use vtcode_utility_tool_specs::{request_user_input_description, request_user_input_parameters};
5
6use crate::config::constants::tools;
7use crate::tool_policy::ToolPolicy;
8use crate::tools::traits::Tool;
9
10pub struct RequestUserInputTool;
18
19#[async_trait]
20impl Tool for RequestUserInputTool {
21 async fn execute(&self, _args: Value) -> Result<Value> {
22 Err(anyhow!(
23 "request_user_input requires an interactive UI session and is handled by the VT Code front-end"
24 ))
25 }
26
27 fn name(&self) -> &str {
28 tools::REQUEST_USER_INPUT
29 }
30
31 fn description(&self) -> &str {
32 request_user_input_description()
33 }
34
35 fn parameter_schema(&self) -> Option<Value> {
36 Some(request_user_input_parameters())
37 }
38
39 fn default_permission(&self) -> ToolPolicy {
40 ToolPolicy::Allow
42 }
43
44 fn is_mutating(&self) -> bool {
45 false
46 }
47
48 fn is_parallel_safe(&self) -> bool {
49 false
50 }
51
52 fn kind(&self) -> &'static str {
53 "hitl"
54 }
55}