mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 02:21:51 +08:00
feat(server): improve context management (#15448)
#### PR Dependency Tree * **PR #15448** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added workspace artifact upload, browsing, removal, deduplication, and library ownership support. * Copilot now supports scoped document and artifact search, canvas reading, live editor context, and frontend tools. * Added scope and focus selectors with source-resolution receipts in chat. * Added embedding health, progress, synchronization, and retrieval capabilities. * Added BYOK policy visibility, provider restrictions, endpoint dialect selection, and validation. * Added delegated editor interactions and userdata document authorization. * **Bug Fixes** * Improved attachment handling, cancellation, access control, retrieval fallbacks, workspace synchronization, and configuration validation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#![deny(clippy::all)]
|
||||
|
||||
mod utils;
|
||||
|
||||
pub mod auth_session;
|
||||
pub mod content_policy;
|
||||
pub mod doc;
|
||||
@@ -17,6 +15,8 @@ pub mod permission;
|
||||
pub mod runtime;
|
||||
pub mod safe_fetch;
|
||||
pub mod tiktoken;
|
||||
mod userdata_acl;
|
||||
mod utils;
|
||||
|
||||
use affine_common::napi_utils::map_napi_err;
|
||||
use napi::{Result, Status, bindgen_prelude::*};
|
||||
@@ -53,6 +53,11 @@ pub async fn validate_doc_update(update: Buffer) -> Result<bool> {
|
||||
.map_err(|err| napi::Error::from_reason(format!("Doc update validation task failed: {err}")))
|
||||
}
|
||||
|
||||
#[napi(catch_unwind)]
|
||||
pub fn authorize_userdata_doc_subject(user_id: String, workspace_id: String, doc_id: String) -> bool {
|
||||
userdata_acl::authorize(&user_id, &workspace_id, &doc_id)
|
||||
}
|
||||
|
||||
#[napi]
|
||||
pub const AFFINE_PRO_PUBLIC_KEY: Option<&'static str> = std::option_env!("AFFINE_PRO_PUBLIC_KEY");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user