import { useQuery } from "@tanstack/react-query"; import { Clock3, Cpu, FlaskConical, Puzzle, Settings, Shield, SlidersHorizontal, UserRoundPen } from "lucide-react"; import type { PluginRecord } from "@paperclipai/shared"; import { NavLink } from "@/lib/router"; import { pluginsApi } from "@/api/plugins"; import { queryKeys } from "@/lib/queryKeys"; import { SIDEBAR_SCROLL_RESET_STATE } from "@/lib/navigation-scroll"; import { SidebarNavItem } from "./SidebarNavItem"; /** * Sandbox-provider-only plugins (e.g. E2B, exe.dev, Modal) have no per-plugin * settings page — `PluginSettings` redirects them to the Environments page — * so a sidebar entry would lead nowhere useful. Filter them out here. Plugins * that mix a sandbox provider with other contributions still appear. */ function isSandboxProviderOnly(plugin: PluginRecord): boolean { const drivers = plugin.manifestJson.environmentDrivers ?? []; if (drivers.length === 0) return false; return drivers.every((d) => d.kind === "sandbox_provider"); } export function InstanceSidebar() { const { data: plugins } = useQuery({ queryKey: queryKeys.plugins.all, queryFn: () => pluginsApi.list(), }); const sidebarPlugins = (plugins ?? []).filter((p) => !isSandboxProviderOnly(p)); return ( ); }