import { McpDisplayMode } from "@shared/McpDisplayMode" import { EmptyRequest } from "@shared/proto/index.cline" import { OpenaiReasoningEffort } from "@shared/storage/types" import { VSCodeButton, VSCodeCheckbox, VSCodeDropdown, VSCodeOption, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { memo, useEffect, useState } from "react" import McpDisplayModeDropdown from "@/components/mcp/chat-display/McpDisplayModeDropdown" import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config" import { useExtensionState } from "@/context/ExtensionStateContext" import { StateServiceClient } from "@/services/grpc-client" import { isMacOSOrLinux } from "@/utils/platformUtils" import Section from "../Section" import SubagentOutputLineLimitSlider from "../SubagentOutputLineLimitSlider" import { updateSetting } from "../utils/settingsHandlers" interface FeatureSettingsSectionProps { renderSectionHeader: (tabId: string) => JSX.Element | null } const FeatureSettingsSection = ({ renderSectionHeader }: FeatureSettingsSectionProps) => { const { enableCheckpointsSetting, mcpMarketplaceEnabled, mcpDisplayMode, mcpResponsesCollapsed, openaiReasoningEffort, strictPlanModeEnabled, yoloModeToggled, dictationSettings, useAutoCondense, focusChainSettings, multiRootSetting, hooksEnabled, remoteConfigSettings, subagentsEnabled, } = useExtensionState() const [isClineCliInstalled, setIsClineCliInstalled] = useState(false) const handleReasoningEffortChange = (newValue: OpenaiReasoningEffort) => { updateSetting("openaiReasoningEffort", newValue) } // Poll for CLI installation status while the component is mounted useEffect(() => { const checkInstallation = async () => { try { const result = await StateServiceClient.checkCliInstallation(EmptyRequest.create()) setIsClineCliInstalled(result.value) } catch (error) { console.error("Failed to check CLI installation:", error) } } checkInstallation() // Poll ever 1.5 seconds to see if CLI is installed (only when form is open) const pollInterval = setInterval(checkInstallation, 1500) return () => { clearInterval(pollInterval) } }, []) return (
{renderSectionHeader("features")}
{/* Subagents - Only show on macOS and Linux */} {isMacOSOrLinux() && PLATFORM_CONFIG.type === PlatformType.VSCODE && (
NEW

Cline for CLI is required for subagents. Install it with: npm install -g cline , then run cline auth To authenticate with Cline or configure an API provider.

{!isClineCliInstalled && ( { try { await StateServiceClient.installClineCli(EmptyRequest.create()) } catch (error) { console.error("Failed to initiate CLI installation:", error) } }} style={{ transform: "scale(0.85)", transformOrigin: "left center", marginLeft: "-2px", }}> Install Now )}
{ const checked = e.target.checked === true updateSetting("subagentsEnabled", checked) }}> {subagentsEnabled ? "Subagents Enabled" : "Enable Subagents"}

Experimental: {" "} Allows Cline to spawn subprocesses to handle focused tasks like exploring large codebases, keeping your main context clean.

{subagentsEnabled && (
)}
)}
{ const checked = e.target.checked === true updateSetting("enableCheckpointsSetting", checked) }}> Enable Checkpoints

Enables extension to save checkpoints of workspace throughout the task. Uses git under the hood which may not work well with large workspaces.

{ const checked = e.target.checked === true updateSetting("mcpMarketplaceEnabled", checked) }}> Enable MCP Marketplace {remoteConfigSettings?.mcpMarketplaceEnabled !== undefined && ( )}

Enables the MCP Marketplace tab for discovering and installing MCP servers.

updateSetting("mcpDisplayMode", newMode)} value={mcpDisplayMode} />

Controls how MCP responses are displayed: plain text, rich formatting with links/images, or markdown rendering.

{ const checked = e.target.checked === true updateSetting("mcpResponsesCollapsed", checked) }}> Collapse MCP Responses

Sets the default display mode for MCP response panels

{ const newValue = e.target.currentValue as OpenaiReasoningEffort handleReasoningEffortChange(newValue) }}> Minimal Low Medium High

Reasoning effort for the OpenAI family of models(applies to all OpenAI model providers)

{ const checked = e.target.checked === true updateSetting("strictPlanModeEnabled", checked) }}> Enable strict plan mode

Enforces strict tool use while in plan mode, preventing file edits.

{
{ const checked = e.target.checked === true updateSetting("focusChainSettings", { ...focusChainSettings, enabled: checked }) }}> Enable Focus Chain

Enables enhanced task progress tracking and automatic focus chain list management throughout tasks.

} {focusChainSettings?.enabled && (
{ const value = parseInt(e.target.value, 10) if (!Number.isNaN(value) && value >= 1 && value <= 100) { updateSetting("focusChainSettings", { ...focusChainSettings, remindClineInterval: value, }) } }} value={String(focusChainSettings?.remindClineInterval || 6)} />

Interval (in messages) to remind Cline about its focus chain checklist (1-100). Lower values provide more frequent reminders.

)} {dictationSettings?.featureEnabled && (
{ const checked = e.target.checked === true const updatedDictationSettings = { ...dictationSettings, dictationEnabled: checked, } updateSetting("dictationSettings", updatedDictationSettings) }}> Enable Dictation

Enables speech-to-text transcription using your Cline account. Uses the Aqua Voice's Avalon model, at $0.0065 credits per minute of audio processed. 5 minutes max per message.

)}
{ const checked = e.target.checked === true updateSetting("useAutoCondense", checked) }}> Enable Auto Compact

Enables advanced context management system which uses LLM based condensing for next-gen models.{" "} Learn more

{multiRootSetting.featureFlag && (
{ const checked = e.target.checked === true updateSetting("multiRootEnabled", checked) }}> Enable Multi-Root Workspace

Experimental: {" "} Allows cline to work across multiple workspaces.

)} {hooksEnabled?.featureFlag && (
{ const checked = e.target.checked === true updateSetting("hooksEnabled", checked) }}> Enable Hooks

Experimental: {" "} Allows execution of hooks from .clinerules/hooks/ directory.

)}
{ const checked = e.target.checked === true updateSetting("yoloModeToggled", checked) }}> Enable YOLO Mode {remoteConfigSettings?.yoloModeToggled !== undefined && ( )}

This mode disables safety checks and user confirmations. Cline will automatically approve all actions without asking. This special mode does not use plan mode or ask questions, and it is recommended to enable all auto-approve actions instead.

) } export default memo(FeatureSettingsSection)