Skip to main content

vtcode_config/core/agent/
onboarding.rs

1//! Session onboarding and welcome-message configuration.
2
3use serde::{Deserialize, Serialize};
4
5#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
6#[derive(Debug, Clone, Deserialize, Serialize)]
7pub struct AgentOnboardingConfig {
8    /// Toggle onboarding message rendering
9    #[serde(default = "default_onboarding_enabled")]
10    pub enabled: bool,
11
12    /// Introductory text shown at session start
13    #[serde(default = "default_intro_text")]
14    intro_text: String,
15
16    /// Whether to include project overview in onboarding message
17    #[serde(default = "default_show_project_overview")]
18    include_project_overview: bool,
19
20    /// Whether to include language summary in onboarding message
21    #[serde(default = "default_show_language_summary")]
22    pub include_language_summary: bool,
23
24    /// Whether to include AGENTS.md/CLAUDE.md highlights in onboarding message
25    #[serde(default = "default_show_guideline_highlights")]
26    pub include_guideline_highlights: bool,
27
28    /// Whether to surface usage tips inside the welcome text banner
29    #[serde(default = "default_show_usage_tips_in_welcome")]
30    pub include_usage_tips_in_welcome: bool,
31
32    /// Whether to surface suggested actions inside the welcome text banner
33    #[serde(default = "default_show_recommended_actions_in_welcome")]
34    pub include_recommended_actions_in_welcome: bool,
35
36    /// Maximum number of guideline bullets to surface
37    #[serde(default = "default_guideline_highlight_limit")]
38    pub guideline_highlight_limit: usize,
39
40    /// Tips for collaborating with the agent effectively
41    #[serde(default = "default_usage_tips")]
42    pub usage_tips: Vec<String>,
43
44    /// Recommended follow-up actions to display
45    #[serde(default = "default_recommended_actions")]
46    pub recommended_actions: Vec<String>,
47
48    /// Placeholder suggestion for the chat input bar
49    #[serde(default)]
50    pub chat_placeholder: Option<String>,
51}
52
53impl Default for AgentOnboardingConfig {
54    fn default() -> Self {
55        Self {
56            enabled: default_onboarding_enabled(),
57            intro_text: default_intro_text(),
58            include_project_overview: default_show_project_overview(),
59            include_language_summary: default_show_language_summary(),
60            include_guideline_highlights: default_show_guideline_highlights(),
61            include_usage_tips_in_welcome: default_show_usage_tips_in_welcome(),
62            include_recommended_actions_in_welcome: default_show_recommended_actions_in_welcome(),
63            guideline_highlight_limit: default_guideline_highlight_limit(),
64            usage_tips: default_usage_tips(),
65            recommended_actions: default_recommended_actions(),
66            chat_placeholder: None,
67        }
68    }
69}
70
71#[inline]
72const fn default_onboarding_enabled() -> bool {
73    true
74}
75
76const DEFAULT_INTRO_TEXT: &str = "Let's get oriented. I preloaded workspace context so we can move fast.";
77
78#[inline]
79fn default_intro_text() -> String {
80    DEFAULT_INTRO_TEXT.into()
81}
82
83#[inline]
84const fn default_show_project_overview() -> bool {
85    true
86}
87
88#[inline]
89const fn default_show_language_summary() -> bool {
90    false
91}
92
93#[inline]
94const fn default_show_guideline_highlights() -> bool {
95    true
96}
97
98#[inline]
99const fn default_show_usage_tips_in_welcome() -> bool {
100    false
101}
102
103#[inline]
104const fn default_show_recommended_actions_in_welcome() -> bool {
105    false
106}
107
108#[inline]
109const fn default_guideline_highlight_limit() -> usize {
110    3
111}
112
113const DEFAULT_USAGE_TIPS: &[&str] = &[
114    "Describe your current coding goal or ask for a quick status overview.",
115    "Reference AGENTS.md/CLAUDE.md guidelines when proposing changes.",
116    "Prefer asking for targeted file reads or diffs before editing.",
117];
118
119const DEFAULT_RECOMMENDED_ACTIONS: &[&str] = &[
120    "Review the highlighted guidelines and share the task you want to tackle.",
121    "Ask for a workspace tour if you need more context.",
122];
123
124fn default_usage_tips() -> Vec<String> {
125    DEFAULT_USAGE_TIPS.iter().map(|s| (*s).into()).collect()
126}
127
128fn default_recommended_actions() -> Vec<String> {
129    DEFAULT_RECOMMENDED_ACTIONS.iter().map(|s| (*s).into()).collect()
130}