chore: checkpoint pi lab rust integration work

This commit is contained in:
Agent Board
2026-07-11 20:39:18 +08:00
parent d47f6447fd
commit d16eccfe10
39 changed files with 4843 additions and 455 deletions
@@ -1177,7 +1177,8 @@ pub async fn admin_put_user_settings(
// ─── Constants ──────────────────────────────────────────────────────────
const DEFAULT_PI_MODEL: &str = "omniroute/freefirst";
const DEFAULT_PI_MODEL: &str = "omniroute/gpt-5.4-mini";
const FREEFIRST_PI_MODEL: &str = "omniroute/freefirst";
const LIGHTRAG_PROVIDER: &str = "lightrag";
const LIGHTRAG_PROVIDER_DESCRIPTION: &str = "MNote 知识库默认提供者(LightRAG)";
const SOURCE_OF_TRUTH: &str = "directory_grants";
@@ -1904,6 +1905,12 @@ pub(crate) fn load_effective_ai_runtime_policy(
.into_iter()
.filter_map(|entry| normalize_model_ref(Some(&default_provider), &entry.id))
.collect::<Vec<_>>();
if !allowed_models.iter().any(|model| model == FREEFIRST_PI_MODEL) {
allowed_models.push(FREEFIRST_PI_MODEL.to_string());
}
if !allowed_models.iter().any(|model| model == DEFAULT_PI_MODEL) {
allowed_models.push(DEFAULT_PI_MODEL.to_string());
}
allowed_models.sort();
allowed_models.dedup();
+16
View File
@@ -601,6 +601,13 @@ pub fn build_router(state: AppState) -> Router {
.route("/api/page-ai/pi/start", post(page_ai_pi::start))
.route("/api/page-ai/pi/send", post(page_ai_pi::send))
.route("/api/page-ai/pi/abort", post(page_ai_pi::abort))
.route("/api/page-ai/pi/configure", post(page_ai_pi::configure))
.route("/api/page-ai/pi/state", post(page_ai_pi::state))
.route("/api/page-ai/pi/compact", post(page_ai_pi::compact))
.route(
"/api/page-ai/pi/queue-config",
post(page_ai_pi::queue_config),
)
.route("/api/page-ai/pi/ui-response", post(page_ai_pi::ui_response))
.route(
"/api/page-ai/pi/ui-request-bridge",
@@ -631,6 +638,15 @@ pub fn build_router(state: AppState) -> Router {
post(page_ai_pi::mcp_call_bridge),
)
.route("/page-ai/pi", get(page_ai_pi::shell))
.route(
"/api/page-ai/pi/sessions/{session_id}/tree",
get(page_ai_pi::session_tree),
)
.route("/api/page-ai/pi/fork", post(page_ai_pi::fork_pi_session))
.route(
"/api/page-ai/pi/artifacts/{tool_event_id}/diff",
get(page_ai_pi::artifact_diff),
)
.route(
"/api/sidebar/shortcuts",
get(sidebar_shortcuts::list_shortcuts).post(sidebar_shortcuts::upsert_shortcut),