diff --git a/.gitignore b/.gitignore index 71739a661..f5cb4476a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ __pycache__/ .history docs/prd/ +# Internal roadmap (private) +docs/roadmap/ + # Issues tracking (internal use only) .issues/ diff --git a/src-tauri/src/commands/agent_cmd.rs b/src-tauri/src/commands/agent_cmd.rs index a735ccdc8..b03a4f5ec 100644 --- a/src-tauri/src/commands/agent_cmd.rs +++ b/src-tauri/src/commands/agent_cmd.rs @@ -202,6 +202,7 @@ fn build_system_prompt_with_skills( } /// 图片输入参数 +#[allow(dead_code)] #[derive(Debug, Deserialize)] pub struct ImageInputParam { pub data: String, diff --git a/src-tauri/src/commands/aster_agent_cmd.rs b/src-tauri/src/commands/aster_agent_cmd.rs index d094b4fc4..50bfd9a00 100644 --- a/src-tauri/src/commands/aster_agent_cmd.rs +++ b/src-tauri/src/commands/aster_agent_cmd.rs @@ -191,6 +191,7 @@ pub struct AsterChatRequest { pub session_id: String, pub event_name: String, #[serde(default)] + #[allow(dead_code)] pub images: Option>, /// Provider 配置(可选,如果未配置则使用当前配置) #[serde(default)] @@ -198,6 +199,7 @@ pub struct AsterChatRequest { } /// 图片输入 +#[allow(dead_code)] #[derive(Debug, Deserialize)] pub struct ImageInput { pub data: String, @@ -356,6 +358,7 @@ pub async fn aster_session_get(session_id: String) -> Result, } diff --git a/src-tauri/src/commands/general_chat_cmd.rs b/src-tauri/src/commands/general_chat_cmd.rs index 5fd3c40b6..6554d0f8f 100644 --- a/src-tauri/src/commands/general_chat_cmd.rs +++ b/src-tauri/src/commands/general_chat_cmd.rs @@ -230,6 +230,7 @@ use tokio::sync::RwLock; /// 流式消息事件 #[derive(Debug, Clone, Serialize)] #[serde(tag = "type", rename_all = "snake_case")] +#[allow(dead_code)] pub enum StreamEvent { /// 开始生成 Start { message_id: String }, @@ -252,9 +253,11 @@ pub struct SendMessageRequest { pub event_name: String, /// Provider 配置(可选) #[serde(default)] + #[allow(dead_code)] pub provider: Option, /// 模型名称(可选) #[serde(default)] + #[allow(dead_code)] pub model: Option, } diff --git a/src-tauri/src/commands/network_cmd.rs b/src-tauri/src/commands/network_cmd.rs index a20a182e5..671e6608a 100644 --- a/src-tauri/src/commands/network_cmd.rs +++ b/src-tauri/src/commands/network_cmd.rs @@ -158,6 +158,7 @@ pub fn get_accessible_url(listen_host: &str, port: u16) -> String { /// /// # 返回 /// 格式为 `http://{host}:{port}` 的 URL +#[allow(dead_code)] pub fn get_local_url(listen_host: &str, port: u16) -> String { let host = match listen_host { "0.0.0.0" | "localhost" => "127.0.0.1".to_string(), diff --git a/src-tauri/src/commands/workspace_cmd.rs b/src-tauri/src/commands/workspace_cmd.rs index 4952667d4..71a6c9946 100644 --- a/src-tauri/src/commands/workspace_cmd.rs +++ b/src-tauri/src/commands/workspace_cmd.rs @@ -22,6 +22,7 @@ use tauri::State; use tokio::sync::RwLock; /// Workspace 管理器状态 +#[allow(dead_code)] pub struct WorkspaceManagerState(pub Arc>>); /// Workspace 列表项(前端展示用) diff --git a/src-tauri/src/config/types.rs b/src-tauri/src/config/types.rs index 3823c4c95..3b7679e94 100644 --- a/src-tauri/src/config/types.rs +++ b/src-tauri/src/config/types.rs @@ -230,6 +230,7 @@ pub struct VertexApiKeyEntry { pub disabled: bool, } +#[allow(dead_code)] fn default_auth_type() -> String { "oauth".to_string() } diff --git a/src-tauri/src/processor/error.rs b/src-tauri/src/processor/error.rs index 3bd89675e..859c7f18b 100644 --- a/src-tauri/src/processor/error.rs +++ b/src-tauri/src/processor/error.rs @@ -2,6 +2,8 @@ //! //! 定义请求处理过程中可能发生的错误 +#![allow(dead_code)] + use thiserror::Error; /// 处理错误 diff --git a/src-tauri/src/processor/steps/auth.rs b/src-tauri/src/processor/steps/auth.rs index fd302ad8e..cd4d54c38 100644 --- a/src-tauri/src/processor/steps/auth.rs +++ b/src-tauri/src/processor/steps/auth.rs @@ -2,6 +2,8 @@ //! //! 验证请求的 API Key +#![allow(dead_code)] + use super::traits::{PipelineStep, StepError}; use crate::processor::RequestContext; use async_trait::async_trait; diff --git a/src-tauri/src/processor/steps/injection.rs b/src-tauri/src/processor/steps/injection.rs index a26b57b93..0ab80242a 100644 --- a/src-tauri/src/processor/steps/injection.rs +++ b/src-tauri/src/processor/steps/injection.rs @@ -2,6 +2,8 @@ //! //! 根据配置的规则注入请求参数 +#![allow(dead_code)] + use super::traits::{PipelineStep, StepError}; use crate::injection::Injector; use crate::processor::RequestContext; diff --git a/src-tauri/src/processor/steps/plugin.rs b/src-tauri/src/processor/steps/plugin.rs index b1b30ab1b..4bbbdb6f0 100644 --- a/src-tauri/src/processor/steps/plugin.rs +++ b/src-tauri/src/processor/steps/plugin.rs @@ -2,6 +2,8 @@ //! //! 执行插件的前置和后置钩子 +#![allow(dead_code)] + use super::traits::{PipelineStep, StepError}; use crate::plugin::PluginManager; use crate::processor::RequestContext; diff --git a/src-tauri/src/processor/steps/provider.rs b/src-tauri/src/processor/steps/provider.rs index 32c2c9384..b12f73e1a 100644 --- a/src-tauri/src/processor/steps/provider.rs +++ b/src-tauri/src/processor/steps/provider.rs @@ -2,6 +2,8 @@ //! //! 集成重试、故障转移和超时控制 +#![allow(dead_code)] + use super::traits::{PipelineStep, StepError}; use crate::processor::RequestContext; use crate::resilience::{ diff --git a/src-tauri/src/processor/steps/telemetry.rs b/src-tauri/src/processor/steps/telemetry.rs index a51bd91d1..e3d7daa83 100644 --- a/src-tauri/src/processor/steps/telemetry.rs +++ b/src-tauri/src/processor/steps/telemetry.rs @@ -2,6 +2,8 @@ //! //! 记录请求统计和 Token 使用 +#![allow(dead_code)] + use super::traits::{PipelineStep, StepError}; use crate::processor::RequestContext; use crate::telemetry::{ diff --git a/src-tauri/src/processor/steps/traits.rs b/src-tauri/src/processor/steps/traits.rs index 8cb9f9d89..1f3ac444f 100644 --- a/src-tauri/src/processor/steps/traits.rs +++ b/src-tauri/src/processor/steps/traits.rs @@ -2,6 +2,8 @@ //! //! 定义所有管道步骤必须实现的接口 +#![allow(dead_code)] + use crate::processor::RequestContext; use async_trait::async_trait; use thiserror::Error; diff --git a/src-tauri/src/router/amp_router.rs b/src-tauri/src/router/amp_router.rs index 0deb20dd7..3d1c24302 100644 --- a/src-tauri/src/router/amp_router.rs +++ b/src-tauri/src/router/amp_router.rs @@ -18,6 +18,8 @@ //! let router = AmpRouter::new(config); //! //! // 解析 provider 路由 + +#![allow(dead_code)] //! let result = router.parse_provider_route("/api/provider/anthropic/v1/messages"); //! assert!(result.is_some()); //! ``` diff --git a/src-tauri/src/router/provider_router.rs b/src-tauri/src/router/provider_router.rs index 125fc7110..b2aa5c7af 100644 --- a/src-tauri/src/router/provider_router.rs +++ b/src-tauri/src/router/provider_router.rs @@ -2,6 +2,8 @@ //! //! 解析请求路径,确定目标 Provider 和协议。 +#![allow(dead_code)] + use super::route_registry::{RegisteredRoute, RouteRegistry, RouteType}; use crate::models::provider_pool_model::PoolProviderType; use std::sync::Arc; diff --git a/src-tauri/src/router/route_registry.rs b/src-tauri/src/router/route_registry.rs index 482300c07..bf356a9e6 100644 --- a/src-tauri/src/router/route_registry.rs +++ b/src-tauri/src/router/route_registry.rs @@ -2,6 +2,8 @@ //! //! 管理所有注册的路由,支持动态添加和查询。 +#![allow(dead_code)] + use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/src-tauri/src/server/handlers/provider_calls.rs b/src-tauri/src/server/handlers/provider_calls.rs index 1f4f13c8f..9d718acdf 100644 --- a/src-tauri/src/server/handlers/provider_calls.rs +++ b/src-tauri/src/server/handlers/provider_calls.rs @@ -69,6 +69,7 @@ use crate::server_utils::{ }; use crate::session::store_thought_signature; use crate::stream::{PipelineConfig, StreamPipeline}; +use crate::streaming::traits::StreamingProvider; use crate::streaming::{ StreamConfig, StreamContext, StreamError, StreamFormat as StreamingFormat, StreamManager, StreamResponse, diff --git a/src-tauri/src/server/mod.rs b/src-tauri/src/server/mod.rs index 0aed65fc7..1eb2acf36 100644 --- a/src-tauri/src/server/mod.rs +++ b/src-tauri/src/server/mod.rs @@ -1077,6 +1077,7 @@ async fn count_tokens( /// Gemini 原生协议处理 /// 路由: POST /v1/gemini/{model}:{method} /// 例如: /v1/gemini/gemini-3-pro-preview:generateContent +#[allow(dead_code)] async fn gemini_generate_content( State(state): State, headers: HeaderMap, diff --git a/src-tauri/src/streaming/anthropic_sse.rs b/src-tauri/src/streaming/anthropic_sse.rs index 74b652e9a..d5b608ab1 100644 --- a/src-tauri/src/streaming/anthropic_sse.rs +++ b/src-tauri/src/streaming/anthropic_sse.rs @@ -9,6 +9,8 @@ //! - 需求 1.5: 流式传输开始时发送 `message_start` 和 `content_block_start` 事件 //! - 需求 1.6: 流式传输完成时发送 `content_block_stop`、`message_delta` 和 `message_stop` 事件 +#![allow(dead_code)] + use crate::streaming::aws_parser::AwsEvent; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/src-tauri/src/streaming/aws_parser.rs b/src-tauri/src/streaming/aws_parser.rs index 30fc9a8c7..8b261d648 100644 --- a/src-tauri/src/streaming/aws_parser.rs +++ b/src-tauri/src/streaming/aws_parser.rs @@ -12,6 +12,8 @@ //! - 需求 2.5: 优雅处理错误并继续处理 //! - 需求 2.6: 支持部分 chunk 的增量解析 +#![allow(dead_code)] + use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/src-tauri/src/streaming/manager.rs b/src-tauri/src/streaming/manager.rs index 43db177f6..38df5fb25 100644 --- a/src-tauri/src/streaming/manager.rs +++ b/src-tauri/src/streaming/manager.rs @@ -14,9 +14,12 @@ //! - 需求 6.3: Provider 错误转发 //! - 需求 6.5: 可配置的流式响应超时 -use crate::streaming::converter::StreamFormat; +#![allow(dead_code)] + +use crate::streaming::converter::{StreamConverter, StreamFormat}; use crate::streaming::error::StreamError; use crate::streaming::metrics::StreamMetrics; +use crate::streaming::traits::StreamResponse; use bytes::Bytes; use futures::{Stream, StreamExt}; use serde::{Deserialize, Serialize}; diff --git a/src-tauri/src/streaming/metrics.rs b/src-tauri/src/streaming/metrics.rs index 8b0e2734a..bb260f0ba 100644 --- a/src-tauri/src/streaming/metrics.rs +++ b/src-tauri/src/streaming/metrics.rs @@ -7,6 +7,8 @@ //! - 需求 4.5: 跟踪 chunk 数量和接收的总字节数 //! - 需求 7.5: 记录流式指标(吞吐量、延迟、错误率) +#![allow(dead_code)] + use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use tracing::info; diff --git a/src-tauri/src/streaming/traits.rs b/src-tauri/src/streaming/traits.rs index 64814e138..58369569a 100644 --- a/src-tauri/src/streaming/traits.rs +++ b/src-tauri/src/streaming/traits.rs @@ -9,6 +9,10 @@ //! - 需求 1.3: OpenAICustomProvider 流式支持 //! - 需求 1.4: AntigravityProvider 流式支持 +#![allow(dead_code)] + +use crate::models::openai::ChatCompletionRequest; +use crate::providers::ProviderError; use crate::streaming::StreamError; use async_trait::async_trait; use bytes::Bytes; diff --git a/src-tauri/src/websocket/mod.rs b/src-tauri/src/websocket/mod.rs index b94067a86..9ae2ea094 100644 --- a/src-tauri/src/websocket/mod.rs +++ b/src-tauri/src/websocket/mod.rs @@ -6,13 +6,14 @@ //! - 流式响应转发 //! - 心跳检测和连接生命周期管理 +#![allow(dead_code)] + mod handler; mod lifecycle; mod processor; mod stream; mod types; -pub use handler::ws_handler; pub use processor::MessageProcessor; pub use types::{ KiroTokenInfo, WsApiRequest, WsApiResponse, WsConfig, WsConnection, WsEndpoint, WsError,