feat(filesystem): propagate localRootPaths across desktop and web API

This commit is contained in:
Anish Sarkar 2026-04-24 01:45:13 +05:30
parent 6721919398
commit 3ee2683391
6 changed files with 93 additions and 30 deletions

View file

@ -4,7 +4,7 @@ export type ClientPlatform = "web" | "desktop";
export interface AgentFilesystemSelection {
filesystem_mode: AgentFilesystemMode;
client_platform: ClientPlatform;
local_filesystem_root?: string;
local_filesystem_roots?: string[];
}
const DEFAULT_SELECTION: AgentFilesystemSelection = {
@ -24,11 +24,12 @@ export async function getAgentFilesystemSelection(): Promise<AgentFilesystemSele
}
try {
const settings = await window.electronAPI.getAgentFilesystemSettings();
if (settings.mode === "desktop_local_folder" && settings.localRootPath) {
const firstLocalRootPath = settings.localRootPaths[0];
if (settings.mode === "desktop_local_folder" && firstLocalRootPath) {
return {
filesystem_mode: "desktop_local_folder",
client_platform: "desktop",
local_filesystem_root: settings.localRootPath,
local_filesystem_roots: settings.localRootPaths,
};
}
return {