feat(filesystem): enhance agent filesystem API with searchSpaceId support for improved context handling

This commit is contained in:
Anish Sarkar 2026-04-27 21:00:40 +05:30
parent 86e2dc8a5d
commit 27e16231c1
10 changed files with 349 additions and 85 deletions

View file

@ -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,