feat: vault core/CLI/workbench, vaultd token path, filetree view-state cleanup

Land password-vault dedicated workbench and mnote-vault-core/CLI, agent token
read path design, vault transport split, and retire obsolete filetree smokes.
Ignore local vault reimport scripts that trip secret scanners.
This commit is contained in:
Agent Board
2026-07-24 11:36:06 +08:00
parent b798f628ee
commit bc6f8488ee
41 changed files with 13072 additions and 2316 deletions
+22
View File
@@ -92,6 +92,28 @@ impl WebError {
}
}
/// Map independent vault-core errors into HTTP WebError (12-2 P1a shared read path).
impl From<mnote_vault_core::VaultError> for WebError {
fn from(err: mnote_vault_core::VaultError) -> Self {
use mnote_vault_core::VaultStatus;
let status = match err.status {
VaultStatus::BadRequest => StatusCode::BAD_REQUEST,
VaultStatus::Unauthorized => StatusCode::UNAUTHORIZED,
VaultStatus::Forbidden => StatusCode::FORBIDDEN,
VaultStatus::NotFound => StatusCode::NOT_FOUND,
VaultStatus::Conflict => StatusCode::CONFLICT,
VaultStatus::Locked => StatusCode::from_u16(423).unwrap_or(StatusCode::FORBIDDEN),
VaultStatus::Unavailable => StatusCode::SERVICE_UNAVAILABLE,
VaultStatus::Internal => StatusCode::INTERNAL_SERVER_ERROR,
};
let mut web = WebError::new(status, err.code, err.message);
if let Some(details) = err.details {
web = web.with_details(details);
}
web
}
}
impl IntoResponse for WebError {
fn into_response(self) -> Response {
let body = ErrorBody {