chore: align local-first control plane and editor fixes

- wire SQLite control-plane access/session paths into Rust web local-folder routes

- preserve local Markdown attachment semantics across upload, reload, and secondary-pane resource tabs

- refresh design governance docs, Reasonix task templates, and bug records

- retire root .mcp.json local MCP config
This commit is contained in:
lix-2026
2026-05-23 23:38:42 +08:00
parent 42fb58310c
commit 5f97800489
110 changed files with 5344 additions and 889 deletions
+19 -8
View File
@@ -179,8 +179,10 @@ pub async fn documents(
WebError::bad_request_code("local_search_root_required", "本地搜索缺少 rootUri")
.with_context(&context)
})?;
let root_path = local_folder_source::ensure_local_workspace_read_access(&context, root_uri)
.map_err(|error| error.with_context(&context))?;
let root_path = local_folder_source::ensure_local_workspace_read_access_with_state(
&state, &context, root_uri,
)
.map_err(|error| error.with_context(&context))?;
local_search_index::query_local_search_index(
&root_path,
root_uri,
@@ -227,6 +229,7 @@ pub async fn documents(
}
pub async fn refresh_local_index(
State(state): State<AppState>,
Extension(context): Extension<RequestContext>,
Json(body): Json<LocalSearchIndexRefreshRequest>,
) -> Result<(StatusCode, HeaderMap, Json<Value>), WebError> {
@@ -241,8 +244,10 @@ pub async fn refresh_local_index(
)
.with_context(&context));
}
let root_path = local_folder_source::ensure_local_workspace_read_access(&context, root_uri)
.map_err(|error| error.with_context(&context))?;
let root_path = local_folder_source::ensure_local_workspace_read_access_with_state(
&state, &context, root_uri,
)
.map_err(|error| error.with_context(&context))?;
let refreshed = local_search_index::refresh_local_search_index(
&root_path,
root_uri,
@@ -268,6 +273,7 @@ pub async fn refresh_local_index(
}
pub async fn local_index_backlinks(
State(state): State<AppState>,
Extension(context): Extension<RequestContext>,
Query(query): Query<LocalSearchIndexQuery>,
) -> Result<(StatusCode, HeaderMap, Json<Value>), WebError> {
@@ -294,8 +300,10 @@ pub async fn local_index_backlinks(
)
.with_context(&context)
})?;
let root_path = local_folder_source::ensure_local_workspace_read_access(&context, root_uri)
.map_err(|error| error.with_context(&context))?;
let root_path = local_folder_source::ensure_local_workspace_read_access_with_state(
&state, &context, root_uri,
)
.map_err(|error| error.with_context(&context))?;
let backlinks = local_search_index::query_local_backlinks(
&root_path,
root_uri,
@@ -322,6 +330,7 @@ pub async fn local_index_backlinks(
}
pub async fn local_index_tags(
State(state): State<AppState>,
Extension(context): Extension<RequestContext>,
Query(query): Query<LocalSearchIndexQuery>,
) -> Result<(StatusCode, HeaderMap, Json<Value>), WebError> {
@@ -336,8 +345,10 @@ pub async fn local_index_tags(
)
.with_context(&context));
}
let root_path = local_folder_source::ensure_local_workspace_read_access(&context, root_uri)
.map_err(|error| error.with_context(&context))?;
let root_path = local_folder_source::ensure_local_workspace_read_access_with_state(
&state, &context, root_uri,
)
.map_err(|error| error.with_context(&context))?;
let tags = local_search_index::query_local_tags(&root_path, root_uri, &effective_workspace_id)?;
let mut headers = HeaderMap::new();
stamp_search_headers(&mut headers);