mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat: update schema & bump deps (#15455)
#### PR Dependency Tree * **PR #15455** 👈 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 management, artifact details, and removal support. - Added workspace BYOK configuration insights, model capabilities, connection checks, and validation status. - Added profile reordering and credential revision safeguards. - **Improvements** - Improved Copilot session creation with server-provided history and metadata. - Streamlined context handling with document scope selections and selected-source synchronization. - **Bug Fixes** - Improved compatibility and reliability across web, Android, and iOS Copilot workflows. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -304,6 +304,39 @@ registerNativeImageFilesPicker(async () => {
|
||||
const globalContextService = frameworkProvider.get(GlobalContextService);
|
||||
return globalContextService.globalContext.docId.get();
|
||||
};
|
||||
(window as any).waitForSelectedSources = async (documentIds: string[]) => {
|
||||
const globalContextService = frameworkProvider.get(GlobalContextService);
|
||||
const currentWorkspaceId =
|
||||
globalContextService.globalContext.workspaceId.get();
|
||||
const workspacesService = frameworkProvider.get(WorkspacesService);
|
||||
const workspaceRef = currentWorkspaceId
|
||||
? workspacesService.openByWorkspaceId(currentWorkspaceId)
|
||||
: null;
|
||||
if (!workspaceRef) {
|
||||
throw new Error('Current workspace is unavailable');
|
||||
}
|
||||
|
||||
let timeout: ReturnType<typeof setTimeout> | undefined;
|
||||
try {
|
||||
const { workspace } = workspaceRef;
|
||||
await Promise.race([
|
||||
Promise.all(
|
||||
[workspace.id, 'db$docProperties', ...new Set(documentIds)].map(docId =>
|
||||
workspace.engine.doc.waitForSynced(docId)
|
||||
)
|
||||
),
|
||||
new Promise<never>((_, reject) => {
|
||||
timeout = setTimeout(
|
||||
() => reject(new Error('Selected source synchronization timed out')),
|
||||
15000
|
||||
);
|
||||
}),
|
||||
]);
|
||||
} finally {
|
||||
if (timeout) clearTimeout(timeout);
|
||||
workspaceRef.dispose();
|
||||
}
|
||||
};
|
||||
(window as any).getCurrentUserIdentifier = () => {
|
||||
const globalContextService = frameworkProvider.get(GlobalContextService);
|
||||
const currentServerId = globalContextService.globalContext.serverId.get();
|
||||
|
||||
Reference in New Issue
Block a user