mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
feat(filesystem): enhance agent filesystem API with searchSpaceId support for improved context handling
This commit is contained in:
parent
86e2dc8a5d
commit
27e16231c1
10 changed files with 349 additions and 85 deletions
|
|
@ -22,15 +22,17 @@ export function getClientPlatform(): ClientPlatform {
|
|||
return window.electronAPI ? "desktop" : "web";
|
||||
}
|
||||
|
||||
export async function getAgentFilesystemSelection(): Promise<AgentFilesystemSelection> {
|
||||
export async function getAgentFilesystemSelection(
|
||||
searchSpaceId?: number | null
|
||||
): Promise<AgentFilesystemSelection> {
|
||||
const platform = getClientPlatform();
|
||||
if (platform !== "desktop" || !window.electronAPI?.getAgentFilesystemSettings) {
|
||||
return { ...DEFAULT_SELECTION, client_platform: platform };
|
||||
}
|
||||
try {
|
||||
const settings = await window.electronAPI.getAgentFilesystemSettings();
|
||||
const settings = await window.electronAPI.getAgentFilesystemSettings(searchSpaceId);
|
||||
if (settings.mode === "desktop_local_folder") {
|
||||
const mounts = await window.electronAPI.getAgentFilesystemMounts?.();
|
||||
const mounts = await window.electronAPI.getAgentFilesystemMounts?.(searchSpaceId);
|
||||
const localFilesystemMounts =
|
||||
mounts?.map((entry) => ({
|
||||
mount_id: entry.mount,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue