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