From dae512010a9acf1eed2cf7034a64cdd02547641c Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Thu, 16 Jul 2026 18:58:17 +1000 Subject: [PATCH] chore: remove unused utoipa ToSchema derives (#10505) --- Cargo.lock | 34 +---------------- Cargo.toml | 1 - crates/goose-download-manager/Cargo.toml | 1 - crates/goose-download-manager/src/lib.rs | 5 +-- crates/goose-local-inference/Cargo.toml | 1 - crates/goose-local-inference/src/hf_models.rs | 10 ++--- .../src/local_model_registry.rs | 11 +++--- crates/goose-provider-types/Cargo.toml | 1 - crates/goose-provider-types/src/base.rs | 7 ++-- .../src/canonical/catalog.rs | 8 ++-- .../goose-provider-types/src/conversation.rs | 3 +- .../src/conversation/message.rs | 38 +++++++------------ .../src/conversation/token_usage.rs | 5 +-- crates/goose-provider-types/src/goose_mode.rs | 2 - crates/goose-provider-types/src/model.rs | 3 +- crates/goose-provider-types/src/permission.rs | 5 +-- crates/goose-provider-types/src/thinking.rs | 3 +- crates/goose-providers/Cargo.toml | 1 - crates/goose-providers/src/declarative.rs | 7 ++-- crates/goose/Cargo.toml | 1 - crates/goose/src/agents/agent.rs | 2 +- crates/goose/src/agents/extension.rs | 16 ++------ crates/goose/src/agents/types.rs | 5 +-- .../goose/src/config/declarative_providers.rs | 3 +- crates/goose/src/config/extensions.rs | 3 +- crates/goose/src/config/permission.rs | 3 +- crates/goose/src/dictation/providers.rs | 3 +- crates/goose/src/dictation/whisper.rs | 3 +- crates/goose/src/gateway/manager.rs | 5 +-- crates/goose/src/gateway/mod.rs | 5 +-- crates/goose/src/goose_apps/app.rs | 5 +-- crates/goose/src/goose_apps/resource.rs | 11 +++--- crates/goose/src/prompt_template.rs | 2 +- crates/goose/src/providers/base.rs | 3 +- .../goose/src/providers/provider_secrets.rs | 7 ++-- crates/goose/src/recipe/mod.rs | 17 ++++----- crates/goose/src/scheduler.rs | 2 +- crates/goose/src/session/diagnostics.rs | 21 +++++----- crates/goose/src/session/extension_data.rs | 3 +- crates/goose/src/session/session_manager.rs | 7 +--- 40 files changed, 92 insertions(+), 181 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fc0ef2fe..caa8c4ace 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5034,7 +5034,6 @@ dependencies = [ "unicode-normalization", "url", "urlencoding", - "utoipa 4.2.3", "uuid", "v_htmlescape", "webbrowser", @@ -5117,7 +5116,6 @@ dependencies = [ "serde", "tokio", "tracing", - "utoipa 4.2.3", ] [[package]] @@ -5152,7 +5150,6 @@ dependencies = [ "tempfile", "tokio", "tracing", - "utoipa 4.2.3", "uuid", ] @@ -5212,7 +5209,6 @@ dependencies = [ "tokio-stream", "tracing", "unicode-normalization", - "utoipa 4.2.3", "uuid", ] @@ -5245,7 +5241,6 @@ dependencies = [ "tracing", "url", "urlencoding", - "utoipa 4.2.3", "wiremock", ] @@ -7883,7 +7878,7 @@ dependencies = [ "thiserror 2.0.18", "tokio", "tracing", - "utoipa 5.5.0", + "utoipa", ] [[package]] @@ -8380,7 +8375,6 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", "version_check", ] @@ -12806,18 +12800,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "utoipa" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23" -dependencies = [ - "indexmap 2.14.0", - "serde", - "serde_json", - "utoipa-gen 4.3.1", -] - [[package]] name = "utoipa" version = "5.5.0" @@ -12827,19 +12809,7 @@ dependencies = [ "indexmap 2.14.0", "serde", "serde_json", - "utoipa-gen 5.5.0", -] - -[[package]] -name = "utoipa-gen" -version = "4.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c24e8ab68ff9ee746aad22d39b5535601e6416d1b0feeabf78be986a5c4392" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.118", + "utoipa-gen", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4425dbd52..36edbda37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,6 @@ tracing-appender = { version = "0.2.1", default-features = false } tracing-futures = { version = "0.2.4", default-features = false, features = ["futures-03", "std", "std-future"] } tracing-subscriber = { version = "0.3.22", default-features = false, features = ["std"] } urlencoding = { version = "2.1", default-features = false } -utoipa = { version = "4.2", default-features = false } uuid = { version = "1.23", default-features = false, features = ["v4", "std"] } webbrowser = { version = "1", default-features = false } which = { version = "8", default-features = false, features = ["real-sys"] } diff --git a/crates/goose-download-manager/Cargo.toml b/crates/goose-download-manager/Cargo.toml index e0b99e8d7..c7ae701c3 100644 --- a/crates/goose-download-manager/Cargo.toml +++ b/crates/goose-download-manager/Cargo.toml @@ -18,4 +18,3 @@ reqwest = { workspace = true, features = ["stream"] } serde = { workspace = true } tokio = { workspace = true, features = ["fs", "io-util", "time"] } tracing = { workspace = true } -utoipa = { workspace = true } diff --git a/crates/goose-download-manager/src/lib.rs b/crates/goose-download-manager/src/lib.rs index 89942e527..092a23aff 100644 --- a/crates/goose-download-manager/src/lib.rs +++ b/crates/goose-download-manager/src/lib.rs @@ -5,7 +5,6 @@ use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use tokio::io::AsyncWriteExt; use tracing::info; -use utoipa::ToSchema; fn partial_path_for(destination: &Path) -> PathBuf { destination.with_extension( @@ -51,7 +50,7 @@ pub fn cleanup_partial_downloads( } } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DownloadProgress { /// Model ID being downloaded pub model_id: String, @@ -74,7 +73,7 @@ pub struct DownloadProgress { pub task_exited: bool, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "lowercase")] pub enum DownloadStatus { Downloading, diff --git a/crates/goose-local-inference/Cargo.toml b/crates/goose-local-inference/Cargo.toml index c3ae34274..80067ab54 100644 --- a/crates/goose-local-inference/Cargo.toml +++ b/crates/goose-local-inference/Cargo.toml @@ -42,7 +42,6 @@ serde = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true, features = ["fs", "rt-multi-thread", "sync", "time"] } tracing = { workspace = true } -utoipa = { workspace = true, features = ["chrono"] } uuid = { workspace = true, features = ["v4", "std"] } tempfile = { workspace = true } diff --git a/crates/goose-local-inference/src/hf_models.rs b/crates/goose-local-inference/src/hf_models.rs index a63d34a12..a4ba502b0 100644 --- a/crates/goose-local-inference/src/hf_models.rs +++ b/crates/goose-local-inference/src/hf_models.rs @@ -10,8 +10,6 @@ use std::sync::{Arc, Mutex}; use crate::huggingface_auth; -use utoipa::ToSchema; - const HF_API_BASE: &str = "https://huggingface.co/api/models"; const HF_DOWNLOAD_BASE: &str = "https://huggingface.co"; const LLAMACPP_BACKEND_ID: &str = "llamacpp"; @@ -20,7 +18,7 @@ const GGUF_FORMAT: &str = "gguf"; const MLX_FORMAT: &str = "mlx-safetensors"; const MLX_VARIANT_ID: &str = "default"; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HfModelInfo { pub repo_id: String, pub author: String, @@ -31,7 +29,7 @@ pub struct HfModelInfo { pub variants: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HfModelVariant { pub variant_id: String, pub label: String, @@ -59,7 +57,7 @@ fn default_supported() -> bool { } /// A single downloadable GGUF file (used internally and for downloads). -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HfGgufFile { pub filename: String, pub size_bytes: u64, @@ -68,7 +66,7 @@ pub struct HfGgufFile { } /// A quantization variant — groups sharded files into one logical entry. -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HfQuantVariant { pub quantization: String, pub size_bytes: u64, diff --git a/crates/goose-local-inference/src/local_model_registry.rs b/crates/goose-local-inference/src/local_model_registry.rs index 893d4e369..177991fad 100644 --- a/crates/goose-local-inference/src/local_model_registry.rs +++ b/crates/goose-local-inference/src/local_model_registry.rs @@ -4,9 +4,8 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; use std::path::PathBuf; use std::sync::{Mutex, OnceLock}; -use utoipa::ToSchema; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type")] pub enum SamplingConfig { Greedy, @@ -36,7 +35,7 @@ impl Default for SamplingConfig { } } -#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ToolCallingMode { #[default] @@ -45,7 +44,7 @@ pub enum ToolCallingMode { ForceEmulated, } -#[derive(Debug, Clone, Default, Hash, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Default, Hash, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "snake_case")] pub enum ChatTemplate { #[serde(alias = "auto")] @@ -59,7 +58,7 @@ pub enum ChatTemplate { }, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ModelSettings { /// Backend implementation to use for this model. Defaults to llama.cpp. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -274,7 +273,7 @@ pub fn get_registry() -> &'static Mutex { }) } -#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum LocalModelStorage { #[default] diff --git a/crates/goose-provider-types/Cargo.toml b/crates/goose-provider-types/Cargo.toml index 0e651492b..bef8070b3 100644 --- a/crates/goose-provider-types/Cargo.toml +++ b/crates/goose-provider-types/Cargo.toml @@ -30,7 +30,6 @@ thiserror = { workspace = true } tokio = { workspace = true, features = ["time"] } tracing = { workspace = true } unicode-normalization = { version = "0.1.22", default-features = false, features = ["std"] } -utoipa = { workspace = true, features = ["chrono"] } uuid = { workspace = true, features = ["v4", "std"] } [dev-dependencies] diff --git a/crates/goose-provider-types/src/base.rs b/crates/goose-provider-types/src/base.rs index 357215fda..0ad6b6e1d 100644 --- a/crates/goose-provider-types/src/base.rs +++ b/crates/goose-provider-types/src/base.rs @@ -3,7 +3,6 @@ use futures::Stream; use rmcp::model::Tool; use serde::{Deserialize, Serialize}; use std::pin::Pin; -use utoipa::ToSchema; use crate::{ canonical::{map_to_canonical_model, CanonicalModelRegistry}, @@ -19,7 +18,7 @@ use crate::{ }; /// Metadata about a provider's configuration requirements and capabilities -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProviderMetadata { /// The unique identifier for this provider pub name: String, @@ -129,7 +128,7 @@ impl ProviderMetadata { } /// Configuration key metadata for provider setup -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ConfigKey { /// The name of the configuration key (e.g., "API_KEY") pub name: String, @@ -218,7 +217,7 @@ impl ConfigKey { } /// Information about a model's capabilities -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct ModelInfo { /// The name of the model pub name: String, diff --git a/crates/goose-provider-types/src/canonical/catalog.rs b/crates/goose-provider-types/src/canonical/catalog.rs index e63dfb23d..8b487ea2b 100644 --- a/crates/goose-provider-types/src/canonical/catalog.rs +++ b/crates/goose-provider-types/src/canonical/catalog.rs @@ -70,7 +70,7 @@ fn detect_format_from_npm(npm: &str) -> Option { } } -#[derive(Debug, Clone, Serialize, utoipa::ToSchema)] +#[derive(Debug, Clone, Serialize)] pub struct ProviderCatalogEntry { pub id: String, pub name: String, @@ -81,7 +81,7 @@ pub struct ProviderCatalogEntry { pub env_var: String, } -#[derive(Debug, Clone, Serialize, utoipa::ToSchema)] +#[derive(Debug, Clone, Serialize)] pub struct ProviderTemplate { pub id: String, pub name: String, @@ -93,7 +93,7 @@ pub struct ProviderTemplate { pub doc_url: String, } -#[derive(Debug, Clone, Serialize, utoipa::ToSchema)] +#[derive(Debug, Clone, Serialize)] pub struct ModelTemplate { pub id: String, pub name: String, @@ -102,7 +102,7 @@ pub struct ModelTemplate { pub deprecated: bool, } -#[derive(Debug, Clone, Serialize, utoipa::ToSchema)] +#[derive(Debug, Clone, Serialize)] pub struct ModelCapabilities { pub tool_call: bool, pub reasoning: bool, diff --git a/crates/goose-provider-types/src/conversation.rs b/crates/goose-provider-types/src/conversation.rs index 7f8276579..17cb4ac9c 100644 --- a/crates/goose-provider-types/src/conversation.rs +++ b/crates/goose-provider-types/src/conversation.rs @@ -4,13 +4,12 @@ use rmcp::model::{Content, Role}; use serde::{Deserialize, Serialize}; use std::collections::HashSet; use thiserror::Error; -use utoipa::ToSchema; pub mod message; pub mod token_usage; mod tool_result_serde; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct Conversation(Vec); #[derive(Error, Debug)] diff --git a/crates/goose-provider-types/src/conversation/message.rs b/crates/goose-provider-types/src/conversation/message.rs index 1c095089c..03910f02f 100644 --- a/crates/goose-provider-types/src/conversation/message.rs +++ b/crates/goose-provider-types/src/conversation/message.rs @@ -11,10 +11,8 @@ use rmcp::model::{ use serde::{Deserialize, Deserializer, Serialize}; use std::collections::HashSet; use std::fmt; -use utoipa::ToSchema; use uuid::Uuid; -#[derive(ToSchema)] pub enum ToolCallResult { Success { value: T }, Error { error: String }, @@ -79,17 +77,13 @@ pub type ToolResult = Result; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -#[derive(ToSchema)] pub struct ToolRequest { pub id: String, #[serde(with = "tool_result_serde")] - #[schema(value_type = Object)] pub tool_call: ToolResult, #[serde(skip_serializing_if = "Option::is_none")] - #[schema(value_type = Object)] pub metadata: Option, #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] - #[schema(value_type = Object)] pub tool_meta: Option, } @@ -174,20 +168,16 @@ pub const TOOL_META_CHAIN_SUMMARY_KEY: &str = "goose.toolChain.summary"; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -#[derive(ToSchema)] pub struct ToolResponse { pub id: String, #[serde(with = "tool_result_serde::call_tool_result")] - #[schema(value_type = Object)] pub tool_result: ToolResult, #[serde(skip_serializing_if = "Option::is_none")] - #[schema(value_type = Object)] pub metadata: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -#[derive(ToSchema)] pub struct ToolConfirmationRequest { pub id: String, pub tool_name: String, @@ -195,7 +185,7 @@ pub struct ToolConfirmationRequest { pub prompt: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "actionType", rename_all = "camelCase")] pub enum ActionRequiredData { #[serde(rename_all = "camelCase")] @@ -214,7 +204,6 @@ pub enum ActionRequiredData { id: String, user_data: serde_json::Value, #[serde(default = "default_elicitation_action")] - #[schema(value_type = String)] action: ElicitationAction, }, } @@ -223,33 +212,32 @@ fn default_elicitation_action() -> ElicitationAction { ElicitationAction::Accept } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ActionRequired { pub data: ActionRequiredData, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ThinkingContent { pub thinking: String, pub signature: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RedactedThinkingContent { pub data: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FrontendToolRequest { pub id: String, #[serde(with = "tool_result_serde")] - #[schema(value_type = Object)] pub tool_call: ToolResult, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum SystemNotificationType { ThinkingMessage, @@ -258,7 +246,7 @@ pub enum SystemNotificationType { CreditsExhausted, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SystemNotificationContent { pub notification_type: SystemNotificationType, @@ -267,7 +255,7 @@ pub struct SystemNotificationContent { pub data: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] /// Content passed inside a message, which can be both simple content and tool content #[serde(tag = "type", rename_all = "camelCase")] pub enum MessageContent { @@ -659,7 +647,7 @@ impl From for Message { } } -#[derive(ToSchema, Clone, PartialEq, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct InferenceMetadata { pub provider: String, @@ -668,7 +656,7 @@ pub struct InferenceMetadata { pub resolved_model: Option, } -#[derive(ToSchema, Clone, PartialEq, Serialize, Deserialize, Debug, Default)] +#[derive(Clone, PartialEq, Serialize, Deserialize, Debug, Default)] #[serde(rename_all = "camelCase")] pub struct MessageUsage { #[serde(skip_serializing_if = "Option::is_none")] @@ -711,7 +699,7 @@ impl MessageUsage { } } -#[derive(ToSchema, Clone, PartialEq, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Serialize, Deserialize, Debug)] /// Metadata for message visibility and model inference details #[serde(rename_all = "camelCase")] pub struct MessageMetadata { @@ -813,7 +801,7 @@ impl MessageMetadata { } } -#[derive(ToSchema, Clone, PartialEq, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Serialize, Deserialize, Debug)] /// A message to or from an LLM #[serde(rename_all = "camelCase")] pub struct Message { @@ -1130,7 +1118,7 @@ impl Message { } } -#[derive(Debug, Clone, Default, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TokenState { pub input_tokens: i32, diff --git a/crates/goose-provider-types/src/conversation/token_usage.rs b/crates/goose-provider-types/src/conversation/token_usage.rs index 4fa2db5c5..74d04cb4b 100644 --- a/crates/goose-provider-types/src/conversation/token_usage.rs +++ b/crates/goose-provider-types/src/conversation/token_usage.rs @@ -1,7 +1,6 @@ use std::ops::{Add, AddAssign}; use serde::{Deserialize, Serialize}; -use utoipa::ToSchema; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProviderUsage { @@ -15,7 +14,7 @@ pub struct ProviderUsage { pub cost_source: Option, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum CostSource { ProviderReported, @@ -68,7 +67,7 @@ impl ProviderUsage { /// the cache fields are breakdown subsets of it. Parsers for providers /// that report cache tokens separately from input (e.g. Anthropic, /// Bedrock) must fold them into `input_tokens`. -#[derive(Debug, Clone, Serialize, Deserialize, Default, Copy, PartialEq, Eq, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, Copy, PartialEq, Eq)] pub struct Usage { /// All prompt tokens, including any served from or written to cache. /// `cache_read_input_tokens` and `cache_write_input_tokens` are subsets of this. diff --git a/crates/goose-provider-types/src/goose_mode.rs b/crates/goose-provider-types/src/goose_mode.rs index dbfe8af12..0c91d2532 100644 --- a/crates/goose-provider-types/src/goose_mode.rs +++ b/crates/goose-provider-types/src/goose_mode.rs @@ -1,6 +1,5 @@ use serde::{Deserialize, Serialize}; use strum::{Display, EnumMessage, EnumString, IntoStaticStr, VariantNames}; -use utoipa::ToSchema; #[derive( Copy, @@ -17,7 +16,6 @@ use utoipa::ToSchema; EnumString, IntoStaticStr, VariantNames, - ToSchema, )] #[serde(rename_all = "snake_case")] #[strum(serialize_all = "snake_case")] diff --git a/crates/goose-provider-types/src/model.rs b/crates/goose-provider-types/src/model.rs index fc448db65..cc5bdb6a2 100644 --- a/crates/goose-provider-types/src/model.rs +++ b/crates/goose-provider-types/src/model.rs @@ -4,7 +4,6 @@ use serde::de::Deserializer; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; -use utoipa::ToSchema; pub const DEFAULT_CONTEXT_LIMIT: usize = 128_000; @@ -21,7 +20,7 @@ const INHERITED_SESSION_PARAM_KEYS: &[&str] = &[ "preserve_unsigned_thinking", ]; -#[derive(Debug, Clone, Serialize, ToSchema)] +#[derive(Debug, Clone, Serialize)] pub struct ModelConfig { pub model_name: String, pub context_limit: Option, diff --git a/crates/goose-provider-types/src/permission.rs b/crates/goose-provider-types/src/permission.rs index 37818cc5f..bf9311bc8 100644 --- a/crates/goose-provider-types/src/permission.rs +++ b/crates/goose-provider-types/src/permission.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Serialize}; -use utoipa::ToSchema; -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, ToSchema)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum Permission { AlwaysAllow, @@ -11,7 +10,7 @@ pub enum Permission { AlwaysDeny, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, ToSchema)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub enum PrincipalType { Extension, Tool, diff --git a/crates/goose-provider-types/src/thinking.rs b/crates/goose-provider-types/src/thinking.rs index abfcc904f..e219549b3 100644 --- a/crates/goose-provider-types/src/thinking.rs +++ b/crates/goose-provider-types/src/thinking.rs @@ -2,7 +2,6 @@ use std::{fmt, str::FromStr, sync::LazyLock}; use regex::Regex; use serde::{Deserialize, Serialize}; -use utoipa::ToSchema; pub const GEMINI_THOUGHT_SIGNATURE_KEY: &str = "thoughtSignature"; @@ -273,7 +272,7 @@ fn contains_unquoted_gt(text: &str) -> bool { false } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum ThinkingEffort { Off, diff --git a/crates/goose-providers/Cargo.toml b/crates/goose-providers/Cargo.toml index 5dd8c3e34..73d86b82a 100644 --- a/crates/goose-providers/Cargo.toml +++ b/crates/goose-providers/Cargo.toml @@ -42,7 +42,6 @@ rmcp = { workspace = true, features = ["server", "macros"] } serde = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } -utoipa = { workspace = true, features = ["chrono"] } async-trait = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true, features = ["io-util"] } diff --git a/crates/goose-providers/src/declarative.rs b/crates/goose-providers/src/declarative.rs index bde782389..050abd6ca 100644 --- a/crates/goose-providers/src/declarative.rs +++ b/crates/goose-providers/src/declarative.rs @@ -6,7 +6,6 @@ use std::{collections::HashMap, path::Path, str::FromStr}; use anyhow::Result; use include_dir::{include_dir, Dir}; use serde::{Deserialize, Deserializer, Serialize}; -use utoipa::ToSchema; pub static FIXED_PROVIDERS: Dir = include_dir!("$CARGO_MANIFEST_DIR/src/declarative/definitions"); @@ -68,7 +67,7 @@ pub fn fixed_provider_config_entries() -> Vec<(&'static str, &'static str)> { declarative_providers::fixed_provider_config_entries() } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EnvVarConfig { pub name: String, #[serde(default)] @@ -82,7 +81,7 @@ pub struct EnvVarConfig { pub default: Option, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum ProviderEngine { #[serde(alias = "openai_compatible")] @@ -106,7 +105,7 @@ impl FromStr for ProviderEngine { } } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DeclarativeProviderConfig { pub name: String, pub engine: ProviderEngine, diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml index 3db210b88..79665e91a 100644 --- a/crates/goose/Cargo.toml +++ b/crates/goose/Cargo.toml @@ -139,7 +139,6 @@ goose-providers = { path = "../goose-providers", default-features = false } goose-download-manager = { path = "../goose-download-manager" } goose-sdk-types = { path = "../goose-sdk-types" } rand = { workspace = true } -utoipa = { workspace = true, features = ["chrono"] } tokio-cron-scheduler = { version = "0.15", default-features = false } urlencoding = { workspace = true } v_htmlescape = { version = "0.17", default-features = false, features = ["std"] } diff --git a/crates/goose/src/agents/agent.rs b/crates/goose/src/agents/agent.rs index 38a3176f5..0077b4dc5 100644 --- a/crates/goose/src/agents/agent.rs +++ b/crates/goose/src/agents/agent.rs @@ -152,7 +152,7 @@ pub struct ToolCategorizeResult { pub filtered_response: Message, } -#[derive(Debug, Clone, serde::Serialize, utoipa::ToSchema)] +#[derive(Debug, Clone, serde::Serialize)] pub struct ExtensionLoadResult { pub name: String, pub success: bool, diff --git a/crates/goose/src/agents/extension.rs b/crates/goose/src/agents/extension.rs index ec1b40579..606609c9d 100644 --- a/crates/goose/src/agents/extension.rs +++ b/crates/goose/src/agents/extension.rs @@ -11,7 +11,6 @@ use serde::Deserializer; use serde::{Deserialize, Serialize}; use thiserror::Error; use tracing::warn; -use utoipa::ToSchema; pub use crate::agents::platform_extensions::{ PlatformExtensionContext, PlatformExtensionDef, PLATFORM_EXTENSIONS, @@ -58,7 +57,7 @@ pub enum ExtensionError { pub type ExtensionResult = Result; -#[derive(Debug, Clone, Serialize, Default, ToSchema, PartialEq)] +#[derive(Debug, Clone, Serialize, Default, PartialEq)] pub struct Envs { /// A map of environment variables to set, e.g. API_KEY -> some_secret, HOST -> host #[serde(default)] @@ -158,18 +157,16 @@ impl Envs { } /// Represents the different types of MCP extensions that can be added to the manager -#[derive(Debug, Clone, Deserialize, Serialize, ToSchema, PartialEq)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] #[serde(tag = "type")] pub enum ExtensionConfig { /// SSE transport is no longer supported - kept only for config file compatibility #[serde(rename = "sse")] Sse { #[serde(default)] - #[schema(required)] name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, #[serde(default)] uri: Option, @@ -181,7 +178,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, cmd: String, args: Vec, @@ -205,7 +201,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, display_name: Option, // needed for the UI timeout: Option, @@ -222,7 +217,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, display_name: Option, #[serde(default)] @@ -238,7 +232,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, uri: String, #[serde(default)] @@ -269,7 +262,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, /// The tools provided by the frontend tools: Vec, @@ -288,7 +280,6 @@ pub enum ExtensionConfig { name: String, #[serde(default)] #[serde(deserialize_with = "deserialize_null_with_default")] - #[schema(required)] description: String, /// The Python code to execute code: String, @@ -581,14 +572,13 @@ where } /// Information about the tool used for building prompts -#[derive(Clone, Debug, Serialize, ToSchema)] +#[derive(Clone, Debug, Serialize)] pub struct ToolInfo { pub name: String, pub description: String, pub parameters: Vec, pub permission: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[schema(value_type = Object)] pub input_schema: Option, } diff --git a/crates/goose/src/agents/types.rs b/crates/goose/src/agents/types.rs index beec0373c..be7d97227 100644 --- a/crates/goose/src/agents/types.rs +++ b/crates/goose/src/agents/types.rs @@ -4,7 +4,6 @@ use rmcp::model::{CallToolResult, Tool}; use serde::{Deserialize, Serialize}; use std::sync::Arc; use tokio::sync::{mpsc, Mutex}; -use utoipa::ToSchema; /// Type alias for the tool result channel receiver pub type ToolResultReceiver = Arc)>>>; @@ -19,7 +18,7 @@ pub const DEFAULT_RETRY_TIMEOUT_SECONDS: u64 = 300; pub const DEFAULT_ON_FAILURE_TIMEOUT_SECONDS: u64 = 600; /// Configuration for retry logic in recipe execution -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RetryConfig { /// Maximum number of retry attempts before giving up pub max_retries: u32, @@ -62,7 +61,7 @@ impl RetryConfig { } /// A single success check to validate recipe completion -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type")] pub enum SuccessCheck { /// Execute a shell command and check its exit status diff --git a/crates/goose/src/config/declarative_providers.rs b/crates/goose/src/config/declarative_providers.rs index b5b663f6d..1e890d4d1 100644 --- a/crates/goose/src/config/declarative_providers.rs +++ b/crates/goose/src/config/declarative_providers.rs @@ -15,7 +15,6 @@ use std::str::FromStr; use std::collections::HashMap; use std::path::PathBuf; use std::sync::Mutex; -use utoipa::ToSchema; pub use goose_providers::declarative::*; @@ -57,7 +56,7 @@ pub fn expand_env_vars(template: &str, env_vars: &[EnvVarConfig]) -> Result> = LazyLock::new(|| Arc::new(PermissionManager::new(Paths::config_dir()))); /// Enum representing the possible permission levels for a tool. -#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq, ToSchema)] +#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum PermissionLevel { AlwaysAllow, // Tool can always be used without prompt diff --git a/crates/goose/src/dictation/providers.rs b/crates/goose/src/dictation/providers.rs index e62b3be23..120423009 100644 --- a/crates/goose/src/dictation/providers.rs +++ b/crates/goose/src/dictation/providers.rs @@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "local-inference")] use std::sync::Mutex; use std::time::Duration; -use utoipa::ToSchema; const REQUEST_TIMEOUT: Duration = Duration::from_secs(30); const OPENAI_VERSIONLESS_TRANSCRIPTIONS_PATH: &str = "audio/transcriptions"; @@ -23,7 +22,7 @@ static LOCAL_TRANSCRIBER: once_cell::sync::Lazy< #[cfg(feature = "local-inference")] const WHISPER_TOKENIZER_JSON: &str = include_str!("whisper_data/tokens.json"); -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize, ToSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)] #[serde(rename_all = "lowercase")] pub enum DictationProvider { OpenAI, diff --git a/crates/goose/src/dictation/whisper.rs b/crates/goose/src/dictation/whisper.rs index fe48a44f9..651e9ada7 100644 --- a/crates/goose/src/dictation/whisper.rs +++ b/crates/goose/src/dictation/whisper.rs @@ -23,7 +23,6 @@ use symphonia::core::io::MediaSourceStream; use symphonia::core::meta::MetadataOptions; use symphonia::core::probe::Hint; use tokenizers::Tokenizer; -use utoipa::ToSchema; // Common suppress tokens for all Whisper models const SUPPRESS_TOKENS: &[u32] = &[ @@ -42,7 +41,7 @@ const EOT_TOKEN: u32 = 50257; const TIMESTAMP_BEGIN: u32 = 50364; const SAMPLE_BEGIN: usize = 3; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WhisperModel { /// Model identifier (e.g., "tiny", "base", "small") pub id: &'static str, diff --git a/crates/goose/src/gateway/manager.rs b/crates/goose/src/gateway/manager.rs index 192398c38..c7050fca9 100644 --- a/crates/goose/src/gateway/manager.rs +++ b/crates/goose/src/gateway/manager.rs @@ -4,7 +4,6 @@ use std::sync::Arc; use serde::{Deserialize, Serialize}; use tokio::sync::RwLock; use tokio_util::sync::CancellationToken; -use utoipa::ToSchema; use crate::config::Config; use crate::execution::manager::AgentManager; @@ -34,7 +33,7 @@ pub struct GatewayInstance { pub handle: tokio::task::JoinHandle<()>, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PairedUserInfo { pub platform: String, pub user_id: String, @@ -43,7 +42,7 @@ pub struct PairedUserInfo { pub paired_at: i64, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct GatewayStatus { pub gateway_type: String, pub running: bool, diff --git a/crates/goose/src/gateway/mod.rs b/crates/goose/src/gateway/mod.rs index 6a3852556..6438d9489 100644 --- a/crates/goose/src/gateway/mod.rs +++ b/crates/goose/src/gateway/mod.rs @@ -8,7 +8,6 @@ use async_trait::async_trait; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tokio_util::sync::CancellationToken; -use utoipa::ToSchema; use handler::GatewayHandler; @@ -51,7 +50,7 @@ pub struct Attachment { pub data: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "snake_case")] pub enum OutgoingMessage { Text { body: String }, @@ -66,7 +65,7 @@ pub enum PairingState { Paired { session_id: String, paired_at: i64 }, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct GatewayConfig { pub gateway_type: String, pub platform_config: serde_json::Value, diff --git a/crates/goose/src/goose_apps/app.rs b/crates/goose/src/goose_apps/app.rs index e9eae858c..8009da6bd 100644 --- a/crates/goose/src/goose_apps/app.rs +++ b/crates/goose/src/goose_apps/app.rs @@ -3,11 +3,10 @@ use rmcp::model::ErrorData; use serde::{Deserialize, Serialize}; use tokio_util::sync::CancellationToken; use tracing::warn; -use utoipa::ToSchema; use super::resource::McpAppResource; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct WindowProps { pub width: u32, @@ -15,7 +14,7 @@ pub struct WindowProps { pub resizable: bool, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GooseApp { #[serde(flatten)] diff --git a/crates/goose/src/goose_apps/resource.rs b/crates/goose/src/goose_apps/resource.rs index 8236efb04..7cc1d7177 100644 --- a/crates/goose/src/goose_apps/resource.rs +++ b/crates/goose/src/goose_apps/resource.rs @@ -1,9 +1,8 @@ use serde::{Deserialize, Serialize}; -use utoipa::ToSchema; /// Content Security Policy metadata for MCP Apps /// Specifies allowed domains for network connections and resource loading -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct CspMetadata { /// Domains allowed for connect-src (fetch, XHR, WebSocket) @@ -23,7 +22,7 @@ pub struct CspMetadata { /// Sandbox permissions for MCP Apps /// Specifies which browser capabilities the UI needs access to. /// Maps to the iframe Permission Policy `allow` attribute. -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq, Default)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(rename_all = "camelCase")] pub struct PermissionsMetadata { /// Request camera access (maps to Permission Policy `camera` feature) @@ -45,7 +44,7 @@ fn is_default_permissions(p: &PermissionsMetadata) -> bool { } /// UI-specific metadata for MCP resources -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMetadata { /// Content Security Policy configuration @@ -63,7 +62,7 @@ pub struct UiMetadata { } /// Resource metadata containing UI configuration -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ResourceMetadata { /// UI-specific configuration @@ -73,7 +72,7 @@ pub struct ResourceMetadata { /// MCP App Resource /// Represents a UI resource that can be rendered in an MCP App -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpAppResource { /// URI of the resource (must use ui:// scheme) diff --git a/crates/goose/src/prompt_template.rs b/crates/goose/src/prompt_template.rs index d4ec7eb84..4754cb349 100644 --- a/crates/goose/src/prompt_template.rs +++ b/crates/goose/src/prompt_template.rs @@ -50,7 +50,7 @@ static TEMPLATE_REGISTRY: &[(&str, &str)] = &[ ]; /// Information about a template including its content and customization status -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct Template { pub name: String, pub description: String, diff --git a/crates/goose/src/providers/base.rs b/crates/goose/src/providers/base.rs index c601c7901..8baee4838 100644 --- a/crates/goose/src/providers/base.rs +++ b/crates/goose/src/providers/base.rs @@ -9,13 +9,12 @@ use serde::{Deserialize, Serialize}; pub const DEFAULT_PROVIDER_TIMEOUT_SECS: u64 = 600; use crate::config::ExtensionConfig; -use utoipa::ToSchema; use std::path::PathBuf; pub use goose_providers::base::*; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum ProviderType { Preferred, Builtin, diff --git a/crates/goose/src/providers/provider_secrets.rs b/crates/goose/src/providers/provider_secrets.rs index 97859b461..4fd599810 100644 --- a/crates/goose/src/providers/provider_secrets.rs +++ b/crates/goose/src/providers/provider_secrets.rs @@ -4,7 +4,6 @@ use std::path::Path; use chrono::{DateTime, TimeZone, Utc}; use serde::{Deserialize, Serialize}; use serde_json::Value; -use utoipa::ToSchema; use crate::config::paths::Paths; use crate::config::{Config, ConfigError}; @@ -14,14 +13,14 @@ use crate::providers::huggingface_auth; pub const SECRET_STORE_ID_PREFIX: &str = "secret_store:"; pub const PROVIDER_CACHE_ID_PREFIX: &str = "provider_cache:"; -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ProviderSecretStorage { SecretStore, ProviderCache, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ProviderSecretStatus { Valid, @@ -29,7 +28,7 @@ pub enum ProviderSecretStatus { Unknown, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProviderSecret { pub id: String, pub provider: String, diff --git a/crates/goose/src/recipe/mod.rs b/crates/goose/src/recipe/mod.rs index 3de1b8dda..cb6175897 100644 --- a/crates/goose/src/recipe/mod.rs +++ b/crates/goose/src/recipe/mod.rs @@ -11,7 +11,6 @@ use crate::recipe::yaml_format_utils::reformat_fields_with_multiline_values; use crate::utils::contains_unicode_tags; use serde::de::Deserializer; use serde::{Deserialize, Serialize}; -use utoipa::ToSchema; pub mod build_recipe; pub mod local_recipes; @@ -39,7 +38,7 @@ pub fn strip_error_location(error_msg: &str) -> String { .to_string() } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct Recipe { // Required fields #[serde(default = "default_version")] @@ -86,7 +85,7 @@ pub struct Recipe { pub retry: Option, } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct Author { #[serde(skip_serializing_if = "Option::is_none")] pub contact: Option, // creator/contact information of the recipe @@ -95,7 +94,7 @@ pub struct Author { pub metadata: Option, // any additional metadata for the author } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct Settings { #[serde(skip_serializing_if = "Option::is_none")] pub goose_provider: Option, @@ -110,13 +109,13 @@ pub struct Settings { pub max_turns: Option, } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct Response { #[serde(skip_serializing_if = "Option::is_none")] pub json_schema: Option, } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct SubRecipe { pub name: String, pub path: String, @@ -153,7 +152,7 @@ where } } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "snake_case")] pub enum RecipeParameterRequirement { Required, @@ -171,7 +170,7 @@ impl fmt::Display for RecipeParameterRequirement { } } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "snake_case")] pub enum RecipeParameterInputType { String, @@ -194,7 +193,7 @@ impl fmt::Display for RecipeParameterInputType { } } -#[derive(Serialize, Deserialize, Debug, Clone, ToSchema)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct RecipeParameter { pub key: String, pub input_type: RecipeParameterInputType, diff --git a/crates/goose/src/scheduler.rs b/crates/goose/src/scheduler.rs index be11fc525..60f4b2e74 100644 --- a/crates/goose/src/scheduler.rs +++ b/crates/goose/src/scheduler.rs @@ -102,7 +102,7 @@ impl From for SchedulerError { } } -#[derive(Clone, Serialize, Deserialize, Debug, utoipa::ToSchema)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct ScheduledJob { pub id: String, pub source: String, diff --git a/crates/goose/src/session/diagnostics.rs b/crates/goose/src/session/diagnostics.rs index b4d14cf83..17624ea08 100644 --- a/crates/goose/src/session/diagnostics.rs +++ b/crates/goose/src/session/diagnostics.rs @@ -7,14 +7,13 @@ use crate::session::SessionManager; use serde::{Deserialize, Serialize}; use std::fs; use std::path::PathBuf; -use utoipa::ToSchema; const LLM_LOG_MAX_BYTES: usize = 2 * 1024 * 1024; const CONFIG_MAX_BYTES: usize = 256 * 1024; const CLI_LOG_TAIL_LINES: usize = 400; const CLI_LOGS_TO_INCLUDE: usize = 3; -#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "snake_case")] pub enum DiagnosticsLevel { #[default] @@ -22,7 +21,7 @@ pub enum DiagnosticsLevel { Full, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] pub struct SystemInfo { pub app_version: String, pub os: String, @@ -33,7 +32,7 @@ pub struct SystemInfo { pub enabled_extensions: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsConfig { pub config_path: String, @@ -41,13 +40,13 @@ pub struct DiagnosticsConfig { pub truncated: bool, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsExtensions { pub enabled: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsTextFile { pub path: String, @@ -55,35 +54,35 @@ pub struct DiagnosticsTextFile { pub truncated: bool, } -#[derive(Debug, Clone, Default, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsLogs { pub cli: Vec, pub llm: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsPrompt { pub name: String, pub content: String, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsScheduledRecipe { pub path: String, pub content: String, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsError { pub path: Option, pub message: String, } -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, schemars::JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct DiagnosticsReport { pub schema_version: u32, diff --git a/crates/goose/src/session/extension_data.rs b/crates/goose/src/session/extension_data.rs index b286a3e22..b28dddd34 100644 --- a/crates/goose/src/session/extension_data.rs +++ b/crates/goose/src/session/extension_data.rs @@ -9,11 +9,10 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; -use utoipa::ToSchema; /// Extension data containing all extension states /// Keys are in format "extension_name.version" (e.g., "todo.v0") -#[derive(Debug, Clone, Serialize, Deserialize, Default, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ExtensionData { #[serde(flatten)] pub extension_states: HashMap, diff --git a/crates/goose/src/session/session_manager.rs b/crates/goose/src/session/session_manager.rs index 030309105..0452519e2 100644 --- a/crates/goose/src/session/session_manager.rs +++ b/crates/goose/src/session/session_manager.rs @@ -22,7 +22,6 @@ use std::fs; use std::path::{Path, PathBuf}; use std::sync::{Arc, LazyLock}; use tracing::{info, warn}; -use utoipa::ToSchema; pub const CURRENT_SCHEMA_VERSION: i32 = 15; pub const SESSIONS_FOLDER: &str = "sessions"; @@ -35,7 +34,6 @@ const MILLISECOND_TIMESTAMP_THRESHOLD: i64 = 10_000_000_000; Copy, Serialize, Deserialize, - ToSchema, PartialEq, Eq, Default, @@ -58,10 +56,9 @@ pub enum SessionType { static SESSION_STORAGE: LazyLock> = LazyLock::new(|| Arc::new(SessionStorage::new(Paths::data_dir()))); -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Session { pub id: String, - #[schema(value_type = String)] pub working_dir: PathBuf, #[serde(alias = "description")] pub name: String, @@ -170,7 +167,7 @@ pub struct SessionUpdateBuilder<'a> { parent_session_id: Option>, } -#[derive(Serialize, ToSchema, Debug)] +#[derive(Serialize, Debug)] #[serde(rename_all = "camelCase")] pub struct SessionInsights { pub total_sessions: usize,