refactor: 移除独立 hub/proxy/executor/gateway crate,统一为 gateway tunnel 架构

- 删除 aether-hub、aether-proxy 独立项目及其 Dockerfile/配置
- 删除 crates/aether-executor 和 crates/aether-gateway 全部模块
- 新增 apps/ 目录作为应用入口
- 将 hub 概念重构为 gateway tunnel transport
- 将 executor 重构为 execution runtime
- 新增 tunnel.rs 合约定义和 testkit tunnel/execution_runtime 模块
- 更新 Python 服务层和测试适配新架构命名
This commit is contained in:
fawney19
2026-04-03 14:59:58 +08:00
parent ddf18fed9a
commit 8f26e1a31f
983 changed files with 103098 additions and 105837 deletions

View File

@@ -0,0 +1,8 @@
use axum::routing::any;
use axum::Router;
use crate::gateway::{proxy_request, AppState};
pub(crate) fn mount_admin_routes(router: Router<AppState>) -> Router<AppState> {
router.route("/api/admin/{*admin_path}", any(proxy_request))
}

View File

@@ -0,0 +1,19 @@
use axum::routing::{any, get, post};
use axum::Router;
use crate::gateway::{
proxy_request, proxy_tunnel, relay_request, AppState, PROXY_TUNNEL_PATH, TUNNEL_HEARTBEAT_PATH,
TUNNEL_NODE_STATUS_PATH, TUNNEL_RELAY_PATH_PATTERN,
};
pub(crate) fn mount_internal_routes(router: Router<AppState>) -> Router<AppState> {
router
.route(
"/api/internal/gateway/{*legacy_gateway_path}",
any(proxy_request),
)
.route(PROXY_TUNNEL_PATH, get(proxy_tunnel))
.route(TUNNEL_HEARTBEAT_PATH, post(proxy_request))
.route(TUNNEL_NODE_STATUS_PATH, post(proxy_request))
.route(TUNNEL_RELAY_PATH_PATTERN, post(relay_request))
}

View File

@@ -0,0 +1,9 @@
mod admin;
mod internal;
mod oauth;
mod public;
pub(crate) use admin::mount_admin_routes;
pub(crate) use internal::mount_internal_routes;
pub(crate) use oauth::mount_oauth_routes;
pub(crate) use public::mount_public_support_routes;

View File

@@ -0,0 +1,13 @@
use axum::routing::{any, get};
use axum::Router;
use crate::gateway::{proxy_request, AppState};
pub(crate) fn mount_oauth_routes(router: Router<AppState>) -> Router<AppState> {
router
.route("/api/oauth/providers", get(proxy_request))
.route("/api/oauth/{*oauth_public_path}", get(proxy_request))
.route("/api/user/oauth/bindable-providers", get(proxy_request))
.route("/api/user/oauth/links", get(proxy_request))
.route("/api/user/oauth/{*oauth_user_path}", any(proxy_request))
}

View File

@@ -0,0 +1,28 @@
use axum::routing::get;
use axum::Router;
use crate::gateway::{proxy_request, AppState};
pub(crate) fn mount_public_support_routes(router: Router<AppState>) -> Router<AppState> {
router
.route("/v1/models", get(proxy_request))
.route("/v1beta/models", get(proxy_request))
.route("/v1/health", get(proxy_request))
.route("/health", get(proxy_request))
.route("/v1/providers", get(proxy_request))
.route("/v1/providers/{*provider_path}", get(proxy_request))
.route("/v1/test-connection", get(proxy_request))
.route("/test-connection", get(proxy_request))
.route("/api/public/site-info", get(proxy_request))
.route("/api/public/providers", get(proxy_request))
.route("/api/public/models", get(proxy_request))
.route("/api/public/search/models", get(proxy_request))
.route("/api/public/stats", get(proxy_request))
.route("/api/public/global-models", get(proxy_request))
.route("/api/public/health/api-formats", get(proxy_request))
.route("/api/modules/auth-status", get(proxy_request))
.route("/api/capabilities", get(proxy_request))
.route("/api/capabilities/user-configurable", get(proxy_request))
.route("/api/capabilities/model/{*model_path}", get(proxy_request))
.route("/", get(proxy_request))
}