Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/goose-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ pub mod error;
pub mod openapi;
pub mod routes;
pub mod state;
pub mod theme_css;
pub mod tunnel;

// Re-export commonly used items
pub use openapi::*;
pub use state::*;
pub use theme_css::generate_mcp_theme_variables;
1 change: 0 additions & 1 deletion crates/goose-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod logging;
mod openapi;
mod routes;
mod state;
mod theme_css;
mod tunnel;

use clap::{Parser, Subcommand};
Expand Down
4 changes: 0 additions & 4 deletions crates/goose-server/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,6 @@ derive_utoipa!(Icon as IconSchema);
super::routes::config_management::set_config_provider,
super::routes::config_management::configure_provider_oauth,
super::routes::config_management::get_pricing,
super::routes::config_management::get_theme_variables,
super::routes::config_management::save_theme,
super::routes::prompts::get_prompts,
super::routes::prompts::get_prompt,
super::routes::prompts::save_prompt,
Expand Down Expand Up @@ -448,8 +446,6 @@ derive_utoipa!(Icon as IconSchema);
super::routes::config_management::PricingQuery,
super::routes::config_management::PricingResponse,
super::routes::config_management::PricingData,
super::routes::config_management::ThemeVariablesResponse,
super::routes::config_management::SaveThemeRequest,
super::routes::prompts::PromptsListResponse,
super::routes::prompts::PromptContentResponse,
super::routes::prompts::SavePromptRequest,
Expand Down
49 changes: 0 additions & 49 deletions crates/goose-server/src/routes/config_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,53 +836,6 @@ pub async fn configure_provider_oauth(
Ok(Json("OAuth configuration completed".to_string()))
}

#[derive(Serialize, ToSchema)]
pub struct ThemeVariablesResponse {
variables: HashMap<String, String>,
}

#[utoipa::path(
get,
path = "/theme/variables",
responses(
(status = 200, description = "MCP theme variables with light-dark() format", body = ThemeVariablesResponse)
)
)]
pub async fn get_theme_variables() -> Json<ThemeVariablesResponse> {
use crate::theme_css;
let variables = theme_css::generate_mcp_theme_variables();
Json(ThemeVariablesResponse { variables })
}

#[derive(Deserialize, ToSchema)]
pub struct SaveThemeRequest {
/// CSS content for theme.css file. If empty, deletes the theme file (reset).
css: String,
}

#[utoipa::path(
post,
path = "/theme/save",
request_body = SaveThemeRequest,
responses(
(status = 200, description = "Theme saved successfully", body = String),
(status = 500, description = "Failed to save theme")
)
)]
pub async fn save_theme(Json(request): Json<SaveThemeRequest>) -> Result<Json<String>, ErrorResponse> {
let theme_path = Paths::in_data_dir("theme.css");

if request.css.trim().is_empty() {
if theme_path.exists() {
std::fs::remove_file(&theme_path)?;
}
Ok(Json("Theme reset successfully".to_string()))
} else {
std::fs::write(&theme_path, request.css)?;
Ok(Json("Theme saved successfully".to_string()))
}
}

pub fn routes(state: Arc<AppState>) -> Router {
Router::new()
.route("/config", get(read_all_config))
Expand Down Expand Up @@ -915,8 +868,6 @@ pub fn routes(state: Arc<AppState>) -> Router {
"/config/providers/{name}/oauth",
post(configure_provider_oauth),
)
.route("/theme/variables", get(get_theme_variables))
.route("/theme/save", post(save_theme))
.with_state(state)
}

Expand Down
172 changes: 0 additions & 172 deletions crates/goose-server/src/theme_css.rs

This file was deleted.

Loading