feat: complete hermes page ai runtime bff

This commit is contained in:
lix-2026
2026-05-15 23:20:25 +08:00
parent 0e6cf5cf13
commit 01fdd2a8c3
7 changed files with 4326 additions and 259 deletions
File diff suppressed because it is too large Load Diff
+45 -12
View File
@@ -17,6 +17,7 @@ mod mindmap_api;
mod mindmap_shell;
mod onlyoffice;
mod query_support;
mod resource_trash;
mod search;
mod session;
mod snapshot_support;
@@ -27,7 +28,7 @@ pub(crate) mod web_shell;
mod ws;
use crate::app::AppState;
use axum::routing::{any, get, post, put};
use axum::routing::{any, delete, get, post, put};
use axum::Router;
pub fn build_router(state: AppState) -> Router {
@@ -37,6 +38,7 @@ pub fn build_router(state: AppState) -> Router {
let mut router = Router::new()
.route("/health", get(health::health))
.route("/", get(gateway::root_entry))
.route("/trash", get(gateway::trash_entry))
.route("/favicon.ico", get(gateway::favicon))
.route("/auth", get(gateway::auth_entry).post(gateway::auth_entry))
.route("/search", get(search::shell))
@@ -46,7 +48,14 @@ pub fn build_router(state: AppState) -> Router {
)
.route(
"/api/mindmap/{doc_id}/{mindmap_id}",
get(mindmap_api::get_mindmap).post(mindmap_api::apply_mindmap_command),
get(mindmap_api::get_mindmap)
.post(mindmap_api::apply_mindmap_command)
.delete(resource_trash::mindmap_delete)
.patch(resource_trash::mindmap_trash_action),
)
.route(
"/api/mindmap-trash/empty",
post(resource_trash::mindmap_empty_trash),
)
.route(
"/documents/{document_id}",
@@ -86,13 +95,35 @@ pub fn build_router(state: AppState) -> Router {
.route("/api/onlyoffice/forcesave", post(onlyoffice::forcesave))
.route("/api/media/upload", post(media::upload))
.route("/api/media/sign", get(media::sign))
.route("/api/media/batch", post(resource_trash::media_batch))
.route("/api/media/purge", post(resource_trash::media_purge))
.route(
"/api/media/empty-trash",
post(resource_trash::media_empty_trash),
)
.route("/api/tables/restore", post(resource_trash::table_restore))
.route("/api/tables/create", post(resource_trash::table_create))
.route(
"/api/tables/{table_id}",
delete(resource_trash::table_delete),
)
.route("/api/tables/purge", post(resource_trash::table_purge))
.route(
"/api/tables/empty-trash",
post(resource_trash::table_empty_trash),
)
.route(
"/api/tree/filetree/upload-target-preflight",
post(media::filetree_upload_target_preflight),
)
.route(
"/api/tree/filetree/drop-preflight",
post(tree::filetree_drop_preflight),
)
.route("/api/documents/meta", get(documents::meta))
.route("/api/documents/content", get(documents::content))
.route("/api/documents/purge", post(documents::purge))
.route("/api/documents/empty-trash", post(documents::empty_trash))
.route("/api/documents/title", post(documents::title))
.route("/api/documents/options", post(documents::options))
.route("/api/documents/save", post(documents::save))
@@ -145,6 +176,11 @@ pub fn build_router(state: AppState) -> Router {
"/client/sessions/{session_id}",
get(hermes_client::get_session),
)
.route(
"/client/sessions/{session_id}/resume",
post(hermes_client::resume_session),
)
.route("/client/gateway/health", get(hermes_client::gateway_health))
.route("/client/profiles", get(hermes_client::list_profiles))
.route(
"/client/profiles/active",
@@ -156,18 +192,15 @@ pub fn build_router(state: AppState) -> Router {
)
.route(
"/client/profile-memory",
get(hermes_client::get_profile_memory)
.post(hermes_client::save_profile_memory),
)
.route(
"/client/skills",
get(hermes_client::list_skills),
)
.route(
"/client/skills/toggle",
put(hermes_client::toggle_skill),
get(hermes_client::get_profile_memory).post(hermes_client::save_profile_memory),
)
.route("/client/skills", get(hermes_client::list_skills))
.route("/client/skills/toggle", put(hermes_client::toggle_skill))
.route("/client/runs", post(hermes_client::create_run))
.route(
"/client/sessions/{session_id}/queue/{queue_id}",
delete(hermes_client::cancel_queued_run),
)
.route("/client/events/{run_id}", get(hermes_client::stream_events))
.route(
"/client/runs/{run_id}/abort",
File diff suppressed because it is too large Load Diff