ai_agent/utils/plugins/
hint_recommendation.rs1#![allow(dead_code)]
3
4use std::collections::HashSet;
5use std::sync::Mutex;
6
7use once_cell::sync::Lazy;
8
9static TRIED_THIS_SESSION: Lazy<Mutex<HashSet<String>>> = Lazy::new(|| Mutex::new(HashSet::new()));
10
11pub struct PluginHintRecommendation {
13 pub plugin_id: String,
14 pub plugin_name: String,
15 pub marketplace_name: String,
16 pub plugin_description: Option<String>,
17 pub source_command: String,
18}
19
20pub struct ClaudeCodeHint {
22 pub value: String,
23 pub source_command: String,
24}
25
26pub fn _maybe_record_plugin_hint(_hint: &ClaudeCodeHint) {
28 }
30
31pub fn _should_show_hint(_plugin_id: &str) -> bool {
33 false
34}
35
36pub async fn resolve_plugin_hint(
38 hint: &ClaudeCodeHint,
39) -> Result<Option<PluginHintRecommendation>, Box<dyn std::error::Error + Send + Sync>> {
40 let plugin_id = &hint.value;
41 let parsed = super::plugin_identifier::parse_plugin_identifier(plugin_id);
42
43 let plugin_data = super::marketplace_manager::get_plugin_by_id(plugin_id).await;
44
45 let marketplace_name = parsed.marketplace.clone().unwrap_or_default();
46
47 match plugin_data {
48 Some(data) => Ok(Some(PluginHintRecommendation {
49 plugin_id: plugin_id.clone(),
50 plugin_name: data.entry.name.clone(),
51 marketplace_name,
52 plugin_description: data.entry.description.clone(),
53 source_command: hint.source_command.clone(),
54 })),
55 None => {
56 log::debug!(
57 "[hint_recommendation] {} not found in marketplace cache",
58 plugin_id
59 );
60 Ok(None)
61 }
62 }
63}
64
65pub fn _mark_hint_plugin_shown(_plugin_id: &str) {
67 }
69
70pub fn _disable_hint_recommendations() {
72 }
74
75pub fn _reset_hint_recommendation_for_testing() {
77 TRIED_THIS_SESSION.lock().unwrap().clear();
78}