feat: moved most things behind correct feature flag

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-05-02 23:10:48 -07:00
parent bdb97a0888
commit c938d39277
13 changed files with 237 additions and 85 deletions

View file

@ -12,6 +12,10 @@ export interface AgentFilesystemSelection {
local_filesystem_mounts?: AgentFilesystemMountSelection[];
}
export interface AgentFilesystemSelectionOptions {
localFilesystemEnabled: boolean;
}
const DEFAULT_SELECTION: AgentFilesystemSelection = {
filesystem_mode: "cloud",
client_platform: "web",
@ -23,10 +27,15 @@ export function getClientPlatform(): ClientPlatform {
}
export async function getAgentFilesystemSelection(
searchSpaceId?: number | null
searchSpaceId?: number | null,
options?: AgentFilesystemSelectionOptions
): Promise<AgentFilesystemSelection> {
const platform = getClientPlatform();
if (platform !== "desktop" || !window.electronAPI?.getAgentFilesystemSettings) {
if (
platform !== "desktop" ||
!options?.localFilesystemEnabled ||
!window.electronAPI?.getAgentFilesystemSettings
) {
return { ...DEFAULT_SELECTION, client_platform: platform };
}
try {