Files
mnote/rust/crates/mnote-web/src/routes/compat.rs
T

36 lines
1.1 KiB
Rust
Raw Normal View History

use crate::app::AppState;
use crate::context::RequestContext;
use axum::extract::{Extension, State};
use axum::Json;
use serde::Serialize;
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompatBoundaryResponse {
pub ok: bool,
pub boundary: &'static str,
pub compatibility: &'static str,
pub request_id: String,
pub trace_id: String,
pub target: String,
pub notes: Vec<&'static str>,
}
pub async fn next_ai_agent_run(
State(state): State<AppState>,
Extension(context): Extension<RequestContext>,
) -> Json<CompatBoundaryResponse> {
Json(CompatBoundaryResponse {
ok: true,
boundary: "next_route_compat",
compatibility: "placeholder",
request_id: context.trace.request_id,
trace_id: context.trace.trace_id,
target: format!("{}/bridge", state.config().hermes_base_path),
notes: vec![
"当前保留 Next route 兼容边界,后续用于把 /api/ai-agent/run 收口到 Rust Web 层。",
"此占位实现不复制业务裁决,只声明桥接目标与迁移方向。",
],
})
}