2026-02-27 04:29:51 +00:00
use serde ::{ Deserialize , Serialize } ;
Add Claude Code settings infrastructure, TUI mode, session naming, and global defaults
Adds first-class support for Claude Code CLI features (2.1.71-2.1.110):
- New ClaudeCodeSettings struct with per-project and global defaults for
TUI mode, effort level, focus mode, thinking summaries, session recap,
auto-scroll, env scrub, and 1-hour prompt caching
- Settings injected as env vars (CLAUDE_CODE_NO_FLICKER, etc.) and
~/.claude/settings.json entries via entrypoint.sh merge block
- New ClaudeCodeSettingsModal component for configuring settings
- Session naming support (-n flag passed to claude CLI, shown in tabs)
- Relaxed reserved prefix filter: CLAUDE_CODE_* env vars now allowed in
custom env vars UI for power users
- Global SSH key path, git name, and git email now used as fallbacks
when per-project values are not set, with UI in SettingsPanel
- Fingerprint-based change detection triggers container recreation when
Claude Code settings change
- Updated README, HOW-TO-USE, and CLAUDE.md documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:46:03 -07:00
use super ::project ::{ ClaudeCodeSettings , EnvVar } ;
2026-03-01 01:21:33 +00:00
2026-02-28 21:18:33 +00:00
fn default_true ( ) -> bool {
true
}
2026-03-01 01:21:33 +00:00
fn default_global_instructions ( ) -> Option < String > {
2026-03-01 14:36:51 +00:00
Some ( " If the project is not initialized with git, recommend to the user to initialize and use git to track changes. This makes it easier to revert should something break. \n \n Use subagents frequently. For long-running tasks, break the work into parallel subagents where possible. When handling multiple separate tasks, delegate each to its own subagent so they can run concurrently. " . to_string ( ) )
2026-03-01 01:21:33 +00:00
}
2026-02-27 15:22:49 +00:00
#[ derive(Debug, Clone, Serialize, Deserialize, PartialEq) ]
#[ serde(rename_all = " snake_case " ) ]
pub enum ImageSource {
Registry ,
LocalBuild ,
Custom ,
}
impl Default for ImageSource {
fn default ( ) -> Self {
Self ::Registry
}
}
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub struct GlobalAwsSettings {
#[ serde(default) ]
pub aws_config_path : Option < String > ,
#[ serde(default) ]
pub aws_profile : Option < String > ,
#[ serde(default) ]
pub aws_region : Option < String > ,
}
impl Default for GlobalAwsSettings {
fn default ( ) -> Self {
Self {
aws_config_path : None ,
aws_profile : None ,
aws_region : None ,
}
}
}
2026-02-27 04:29:51 +00:00
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub struct AppSettings {
2026-02-27 15:22:49 +00:00
#[ serde(default) ]
2026-02-27 04:29:51 +00:00
pub default_ssh_key_path : Option < String > ,
2026-02-27 15:22:49 +00:00
#[ serde(default) ]
2026-02-27 04:29:51 +00:00
pub default_git_user_name : Option < String > ,
2026-02-27 15:22:49 +00:00
#[ serde(default) ]
2026-02-27 04:29:51 +00:00
pub default_git_user_email : Option < String > ,
2026-02-27 15:22:49 +00:00
#[ serde(default) ]
2026-02-27 04:29:51 +00:00
pub docker_socket_path : Option < String > ,
2026-02-27 15:22:49 +00:00
#[ serde(default) ]
pub image_source : ImageSource ,
#[ serde(default) ]
pub custom_image_name : Option < String > ,
#[ serde(default) ]
pub global_aws : GlobalAwsSettings ,
2026-03-01 01:21:33 +00:00
#[ serde(default = " default_global_instructions " ) ]
2026-02-27 18:39:20 -08:00
pub global_claude_instructions : Option < String > ,
2026-03-01 01:21:33 +00:00
#[ serde(default) ]
pub global_custom_env_vars : Vec < EnvVar > ,
2026-02-28 21:18:33 +00:00
#[ serde(default = " default_true " ) ]
pub auto_check_updates : bool ,
#[ serde(default) ]
pub dismissed_update_version : Option < String > ,
2026-03-01 15:57:22 +00:00
#[ serde(default) ]
pub timezone : Option < String > ,
2026-03-05 06:15:47 -08:00
#[ serde(default) ]
pub default_microphone : Option < String > ,
2026-03-12 09:26:58 -07:00
#[ serde(default) ]
pub dismissed_image_digest : Option < String > ,
2026-03-17 19:31:16 -07:00
#[ serde(default) ]
pub web_terminal : WebTerminalSettings ,
2026-04-12 20:02:39 -07:00
#[ serde(default) ]
pub stt : SttSettings ,
Add Claude Code settings infrastructure, TUI mode, session naming, and global defaults
Adds first-class support for Claude Code CLI features (2.1.71-2.1.110):
- New ClaudeCodeSettings struct with per-project and global defaults for
TUI mode, effort level, focus mode, thinking summaries, session recap,
auto-scroll, env scrub, and 1-hour prompt caching
- Settings injected as env vars (CLAUDE_CODE_NO_FLICKER, etc.) and
~/.claude/settings.json entries via entrypoint.sh merge block
- New ClaudeCodeSettingsModal component for configuring settings
- Session naming support (-n flag passed to claude CLI, shown in tabs)
- Relaxed reserved prefix filter: CLAUDE_CODE_* env vars now allowed in
custom env vars UI for power users
- Global SSH key path, git name, and git email now used as fallbacks
when per-project values are not set, with UI in SettingsPanel
- Fingerprint-based change detection triggers container recreation when
Claude Code settings change
- Updated README, HOW-TO-USE, and CLAUDE.md documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:46:03 -07:00
#[ serde(default) ]
pub global_claude_code_settings : Option < ClaudeCodeSettings > ,
2026-04-12 20:02:39 -07:00
}
fn default_stt_model ( ) -> String {
" tiny " . to_string ( )
}
fn default_stt_port ( ) -> u16 {
9876
}
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub struct SttSettings {
#[ serde(default) ]
pub enabled : bool ,
#[ serde(default = " default_stt_model " ) ]
pub model : String ,
#[ serde(default = " default_stt_port " ) ]
pub port : u16 ,
#[ serde(default) ]
pub language : Option < String > ,
}
impl Default for SttSettings {
fn default ( ) -> Self {
Self {
enabled : false ,
model : default_stt_model ( ) ,
port : 9876 ,
language : None ,
}
}
}
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub struct SttStatus {
pub container_exists : bool ,
pub running : bool ,
pub port : u16 ,
pub model : String ,
pub image_exists : bool ,
2026-03-17 19:31:16 -07:00
}
fn default_web_terminal_port ( ) -> u16 {
7681
}
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub struct WebTerminalSettings {
#[ serde(default) ]
pub enabled : bool ,
#[ serde(default = " default_web_terminal_port " ) ]
pub port : u16 ,
#[ serde(default) ]
pub access_token : Option < String > ,
}
impl Default for WebTerminalSettings {
fn default ( ) -> Self {
Self {
enabled : false ,
port : 7681 ,
access_token : None ,
}
}
2026-02-27 04:29:51 +00:00
}
impl Default for AppSettings {
fn default ( ) -> Self {
Self {
default_ssh_key_path : None ,
default_git_user_name : None ,
default_git_user_email : None ,
docker_socket_path : None ,
2026-02-27 15:22:49 +00:00
image_source : ImageSource ::default ( ) ,
custom_image_name : None ,
global_aws : GlobalAwsSettings ::default ( ) ,
2026-03-01 01:21:33 +00:00
global_claude_instructions : default_global_instructions ( ) ,
global_custom_env_vars : Vec ::new ( ) ,
2026-02-28 21:18:33 +00:00
auto_check_updates : true ,
dismissed_update_version : None ,
2026-03-01 15:57:22 +00:00
timezone : None ,
2026-03-05 06:15:47 -08:00
default_microphone : None ,
2026-03-12 09:26:58 -07:00
dismissed_image_digest : None ,
2026-03-17 19:31:16 -07:00
web_terminal : WebTerminalSettings ::default ( ) ,
2026-04-12 20:02:39 -07:00
stt : SttSettings ::default ( ) ,
Add Claude Code settings infrastructure, TUI mode, session naming, and global defaults
Adds first-class support for Claude Code CLI features (2.1.71-2.1.110):
- New ClaudeCodeSettings struct with per-project and global defaults for
TUI mode, effort level, focus mode, thinking summaries, session recap,
auto-scroll, env scrub, and 1-hour prompt caching
- Settings injected as env vars (CLAUDE_CODE_NO_FLICKER, etc.) and
~/.claude/settings.json entries via entrypoint.sh merge block
- New ClaudeCodeSettingsModal component for configuring settings
- Session naming support (-n flag passed to claude CLI, shown in tabs)
- Relaxed reserved prefix filter: CLAUDE_CODE_* env vars now allowed in
custom env vars UI for power users
- Global SSH key path, git name, and git email now used as fallbacks
when per-project values are not set, with UI in SettingsPanel
- Fingerprint-based change detection triggers container recreation when
Claude Code settings change
- Updated README, HOW-TO-USE, and CLAUDE.md documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:46:03 -07:00
global_claude_code_settings : None ,
2026-02-27 04:29:51 +00:00
}
}
}