import { IconAlertTriangle, IconBrowser, IconCheck, IconDeviceDesktop, IconLoader2, IconPlugConnected, } from "@tabler/icons-react"; import React from "react"; import { cn } from "../utils.js"; import { useToggleBuiltinCapability, type BuiltinCapability, type BuiltinCapabilityStatus, } from "./use-builtin-capabilities.js"; import type { McpServerScope } from "./use-mcp-servers.js"; interface BuiltinCapabilityDetailProps { capability: BuiltinCapability; scope: McpServerScope; canEditOrg: boolean; } export function BuiltinCapabilityDetail({ capability, scope, canEditOrg, }: BuiltinCapabilityDetailProps) { const toggle = useToggleBuiltinCapability(); const enabled = capability.enabled[scope]; const status = capability.status[scope]; const canToggle = capability.available && (scope === "user" || canEditOrg) && !toggle.isPending; const isBrowser = capability.exclusiveGroup === "browser"; const onToggle = () => { if (!canToggle) return; toggle.mutate({ id: capability.id, scope, enabled: !enabled }); }; return (
{isBrowser ? ( ) : ( )}

{capability.name}

{capability.description}

{scope === "user" ? "Personal" : "Organization"} access

{scope === "user" ? "Available only to your agent sessions." : "Available to agents in the active organization."}

{toggle.isPending && (
Updating tools…
)} {toggle.error && (
{toggle.error instanceof Error ? toggle.error.message : "Could not update this capability."}
)}
{capability.command} {capability.args.join(" ")} {capability.notes && (

{capability.notes}

)} {!capability.available && (

{capability.unavailableReason ?? "Not available on this host."}

)}
{capability.id === "computer-use" && (

macOS may ask for Screen Recording and Accessibility permission before the tools can control local apps. The agent should still ask before taking sensitive desktop actions.

)} {capability.id === "browser-chrome-devtools" && (

Chrome DevTools attaches to your live Chrome profile when remote debugging is available, so it can verify pages that rely on your existing login.

)} {capability.id === "screen-memory" && (

Screen Memory only reads local Clips desktop context on this machine. Turn it on from Clips desktop Settings before expecting recent context results.

)}
); } function Field({ label, children, }: { label: string; children: React.ReactNode; }) { return (
{label}
{children}
); } function StatusBadge({ enabled, status, }: { enabled: boolean; status?: BuiltinCapabilityStatus; }) { if (!enabled) { return ( Off ); } if (status?.state === "connected") { return ( Connected ); } if (status?.state === "error") { return ( Error ); } return ( Ready ); } function ToolsSummary({ enabled, status, }: { enabled: boolean; status?: BuiltinCapabilityStatus; }) { if (!enabled) { return ( Disabled. Toggle it on to expose MCP tools to the agent. ); } if (status?.state === "connected") { return ( {status.toolCount} tool{status.toolCount === 1 ? "" : "s"} exposed ); } if (status?.state === "error") { return ( {status.error} ); } return ( Enabled. Tools will appear after the MCP manager connects. ); }