chore: align ai stack with openhub weknora
This commit is contained in:
@@ -212,7 +212,7 @@ mod tests {
|
||||
"dryRun": false
|
||||
},
|
||||
"tool": {
|
||||
"tool": "mnote.knowledge_rag.query",
|
||||
"tool": "search_web",
|
||||
"kind": "query",
|
||||
"mode": "plan",
|
||||
"argsJson": {"query": "Rust Web"},
|
||||
|
||||
@@ -2050,6 +2050,7 @@ fn delete_sqlite_user_access_grant_for_context(
|
||||
"普通用户只能撤销自己创建的文件夹授权",
|
||||
));
|
||||
}
|
||||
let revoked_user_id = grant.user_id.clone();
|
||||
state
|
||||
.control_plane()
|
||||
.revoke_directory_grant(grant_id, None)
|
||||
@@ -2079,6 +2080,7 @@ fn delete_sqlite_user_access_grant_for_context(
|
||||
"ok": true,
|
||||
"controlPlane": "sqlite",
|
||||
"deletedGrantId": grant_id,
|
||||
"revokedUserId": revoked_user_id,
|
||||
"policy": {
|
||||
"grants": state
|
||||
.control_plane()
|
||||
|
||||
@@ -987,6 +987,13 @@ pub fn build_router(state: AppState) -> Router {
|
||||
.route("/mnote/manifest", get(hermes_tools::mnote_manifest))
|
||||
.route("/mnote/call", post(hermes_tools::mnote_call))
|
||||
.route("/mnote/audit", get(hermes_tools::mnote_audit)),
|
||||
)
|
||||
.nest(
|
||||
"/api/mnote/tools",
|
||||
Router::new()
|
||||
.route("/manifest", get(hermes_tools::mnote_manifest))
|
||||
.route("/call", post(hermes_tools::mnote_call))
|
||||
.route("/audit", get(hermes_tools::mnote_audit)),
|
||||
);
|
||||
|
||||
if enable_debug_shell_routes {
|
||||
@@ -1132,6 +1139,34 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn mnote_tools_have_current_alias_and_legacy_hermes_mount() {
|
||||
for (method, path) in [
|
||||
("GET", "/api/mnote/tools/manifest"),
|
||||
("POST", "/api/mnote/tools/call"),
|
||||
("GET", "/api/mnote/tools/audit"),
|
||||
("GET", "/api/hermes/tools/mnote/manifest"),
|
||||
("POST", "/api/hermes/tools/mnote/call"),
|
||||
("GET", "/api/hermes/tools/mnote/audit"),
|
||||
] {
|
||||
let response = app(false)
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
.method(method)
|
||||
.uri(path)
|
||||
.body(Body::empty())
|
||||
.expect("request"),
|
||||
)
|
||||
.await
|
||||
.expect("response");
|
||||
assert_ne!(
|
||||
response.status(),
|
||||
StatusCode::NOT_FOUND,
|
||||
"{method} {path} 应挂到 MNote tool executor;Hermes 路径只作为 legacy alias 保留",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn legacy_media_routes_return_retired_guard() {
|
||||
for (method, path, operation) in [
|
||||
|
||||
Reference in New Issue
Block a user