2025-08-10 09:04:52 +09:00
/ * *
* @license
* Copyright 2025 Google LLC
* SPDX - License - Identifier : Apache - 2.0
* /
2025-08-26 00:04:53 +02:00
import type {
2025-08-10 09:04:52 +09:00
MCPServerConfig ,
BugCommandSettings ,
TelemetrySettings ,
AuthType ,
ChatCompressionSettings ,
2025-08-18 19:55:46 +08:00
} from '@qwen-code/qwen-code-core' ;
2025-08-26 00:04:53 +02:00
import type { CustomTheme } from '../ui/themes/theme.js' ;
2025-08-10 09:04:52 +09:00
export interface SettingDefinition {
type : 'boolean' | 'string' | 'number' | 'array' | 'object' ;
label : string ;
category : string ;
requiresRestart : boolean ;
default : boolean | string | number | string [ ] | object | undefined ;
description? : string ;
parentKey? : string ;
childKey? : string ;
key? : string ;
properties? : SettingsSchema ;
showInDialog? : boolean ;
}
export interface SettingsSchema {
[ key : string ] : SettingDefinition ;
}
export type MemoryImportFormat = 'tree' | 'flat' ;
export type DnsResolutionOrder = 'ipv4first' | 'verbatim' ;
/ * *
* The canonical schema for all settings .
* The structure of this object defines the structure of the ` Settings ` type .
* ` as const ` is crucial for TypeScript to infer the most specific types possible .
* /
export const SETTINGS_SCHEMA = {
2025-08-27 18:39:45 -07:00
// Maintained for compatibility/criticality
mcpServers : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'MCP Servers' ,
category : 'Advanced' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } as Record < string , MCPServerConfig > ,
description : 'Configuration for MCP servers.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
general : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'General' ,
2025-08-10 09:04:52 +09:00
category : 'General' ,
requiresRestart : false ,
default : { } ,
2025-08-27 18:39:45 -07:00
description : 'General application settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
properties : {
2025-08-27 18:39:45 -07:00
preferredEditor : {
type : 'string' ,
label : 'Preferred Editor' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The preferred editor to open files in.' ,
showInDialog : false ,
} ,
vimMode : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Vim Mode' ,
category : 'General' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Enable Vim keybindings' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
disableAutoUpdate : {
2025-08-21 22:29:15 +00:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Disable Auto Update' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Disable automatic updates' ,
showInDialog : true ,
} ,
disableUpdateNag : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Disable Update Nag' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Disable update notification prompts.' ,
showInDialog : false ,
} ,
checkpointing : {
type : 'object' ,
label : 'Checkpointing' ,
category : 'General' ,
requiresRestart : true ,
default : { } ,
description : 'Session checkpointing settings.' ,
showInDialog : false ,
properties : {
enabled : {
type : 'boolean' ,
label : 'Enable Checkpointing' ,
category : 'General' ,
requiresRestart : true ,
default : false ,
description : 'Enable session checkpointing for recovery' ,
showInDialog : false ,
} ,
} ,
} ,
enablePromptCompletion : {
type : 'boolean' ,
label : 'Enable Prompt Completion' ,
category : 'General' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
default : false ,
2025-08-21 22:29:15 +00:00
description :
2025-08-27 18:39:45 -07:00
'Enable AI-powered prompt completion suggestions while typing.' ,
2025-08-21 22:29:15 +00:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
debugKeystrokeLogging : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Debug Keystroke Logging' ,
category : 'General' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Enable debug logging of keystrokes to the console.' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
} ,
} ,
2025-08-27 18:39:45 -07:00
ui : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'UI' ,
category : 'UI' ,
requiresRestart : false ,
2025-08-10 09:04:52 +09:00
default : { } ,
2025-08-27 18:39:45 -07:00
description : 'User interface settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
properties : {
2025-08-27 18:39:45 -07:00
theme : {
type : 'string' ,
label : 'Theme' ,
category : 'UI' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The color theme for the UI.' ,
showInDialog : false ,
} ,
customThemes : {
type : 'object' ,
label : 'Custom Themes' ,
category : 'UI' ,
requiresRestart : false ,
default : { } as Record < string , CustomTheme > ,
description : 'Custom theme definitions.' ,
showInDialog : false ,
} ,
hideWindowTitle : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Window Title' ,
category : 'UI' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Hide the window title bar' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hideTips : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Tips' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide helpful tips in the UI' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hideBanner : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Banner' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Hide the application banner' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hideFooter : {
2025-08-21 23:31:39 -07:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Hide Footer' ,
category : 'UI' ,
requiresRestart : false ,
2025-08-21 23:31:39 -07:00
default : false ,
2025-08-27 18:39:45 -07:00
description : 'Hide the footer from the UI' ,
2025-08-21 23:31:39 -07:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
showMemoryUsage : {
type : 'boolean' ,
label : 'Show Memory Usage' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Display memory usage information in the UI' ,
showInDialog : true ,
} ,
showLineNumbers : {
type : 'boolean' ,
label : 'Show Line Numbers' ,
category : 'UI' ,
requiresRestart : false ,
default : false ,
description : 'Show line numbers in the chat.' ,
showInDialog : true ,
} ,
accessibility : {
type : 'object' ,
label : 'Accessibility' ,
category : 'UI' ,
requiresRestart : true ,
default : { } ,
description : 'Accessibility settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
disableLoadingPhrases : {
type : 'boolean' ,
label : 'Disable Loading Phrases' ,
category : 'UI' ,
requiresRestart : true ,
default : false ,
description : 'Disable loading phrases for accessibility' ,
showInDialog : true ,
} ,
screenReader : {
type : 'boolean' ,
label : 'Screen Reader Mode' ,
category : 'UI' ,
requiresRestart : true ,
2025-09-04 10:00:46 -07:00
default : undefined as boolean | undefined ,
2025-08-27 18:39:45 -07:00
description :
'Render output in plain-text to be more screen reader accessible' ,
showInDialog : true ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
} ,
} ,
2025-08-27 18:39:45 -07:00
ide : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'IDE' ,
category : 'IDE' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
default : { } ,
2025-08-27 18:39:45 -07:00
description : 'IDE integration settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
properties : {
2025-08-27 18:39:45 -07:00
enabled : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'IDE Mode' ,
category : 'IDE' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : false ,
description : 'Enable IDE integration mode' ,
2025-08-10 09:04:52 +09:00
showInDialog : true ,
} ,
2025-08-27 18:39:45 -07:00
hasSeenNudge : {
2025-08-10 09:04:52 +09:00
type : 'boolean' ,
2025-08-27 18:39:45 -07:00
label : 'Has Seen IDE Integration Nudge' ,
category : 'IDE' ,
requiresRestart : false ,
default : false ,
description : 'Whether the user has seen the IDE integration nudge.' ,
showInDialog : false ,
2025-08-10 09:04:52 +09:00
} ,
} ,
} ,
2025-08-27 18:39:45 -07:00
privacy : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Privacy' ,
category : 'Privacy' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Privacy-related settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
usageStatisticsEnabled : {
type : 'boolean' ,
label : 'Enable Usage Statistics' ,
category : 'Privacy' ,
requiresRestart : true ,
default : true ,
description : 'Enable collection of usage statistics' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
2025-08-10 09:04:52 +09:00
telemetry : {
type : 'object' ,
label : 'Telemetry' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as TelemetrySettings | undefined ,
description : 'Telemetry configuration.' ,
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
model : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Model' ,
category : 'Model' ,
2025-08-10 09:04:52 +09:00
requiresRestart : false ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings related to the generative model.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
name : {
type : 'string' ,
label : 'Model' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The Gemini model to use for conversations.' ,
showInDialog : false ,
} ,
maxSessionTurns : {
type : 'number' ,
label : 'Max Session Turns' ,
category : 'Model' ,
requiresRestart : false ,
default : - 1 ,
description :
'Maximum number of user/model/tool turns to keep in a session. -1 means unlimited.' ,
showInDialog : true ,
} ,
summarizeToolOutput : {
type : 'object' ,
label : 'Summarize Tool Output' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as
| Record < string , { tokenBudget ? : number } >
| undefined ,
description : 'Settings for summarizing tool output.' ,
showInDialog : false ,
} ,
chatCompression : {
type : 'object' ,
label : 'Chat Compression' ,
category : 'Model' ,
requiresRestart : false ,
default : undefined as ChatCompressionSettings | undefined ,
description : 'Chat compression settings.' ,
showInDialog : false ,
} ,
skipNextSpeakerCheck : {
type : 'boolean' ,
label : 'Skip Next Speaker Check' ,
category : 'Model' ,
requiresRestart : false ,
default : false ,
description : 'Skip the next speaker check.' ,
showInDialog : true ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
context : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Context' ,
category : 'Context' ,
2025-08-10 09:04:52 +09:00
requiresRestart : false ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings for managing context provided to the model.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
fileName : {
type : 'object' ,
label : 'Context File Name' ,
category : 'Context' ,
requiresRestart : false ,
default : undefined as string | string [ ] | undefined ,
description : 'The name of the context file.' ,
showInDialog : false ,
} ,
importFormat : {
type : 'string' ,
label : 'Memory Import Format' ,
category : 'Context' ,
requiresRestart : false ,
default : undefined as MemoryImportFormat | undefined ,
description : 'The format to use when importing memory.' ,
showInDialog : false ,
} ,
discoveryMaxDirs : {
type : 'number' ,
label : 'Memory Discovery Max Dirs' ,
category : 'Context' ,
requiresRestart : false ,
default : 200 ,
description : 'Maximum number of directories to search for memory.' ,
showInDialog : true ,
} ,
includeDirectories : {
type : 'array' ,
label : 'Include Directories' ,
category : 'Context' ,
requiresRestart : false ,
default : [ ] as string [ ] ,
description :
'Additional directories to include in the workspace context. Missing directories will be skipped with a warning.' ,
showInDialog : false ,
} ,
loadMemoryFromIncludeDirectories : {
type : 'boolean' ,
label : 'Load Memory From Include Directories' ,
category : 'Context' ,
requiresRestart : false ,
default : false ,
description : 'Whether to load memory files from include directories.' ,
showInDialog : true ,
} ,
fileFiltering : {
type : 'object' ,
label : 'File Filtering' ,
category : 'Context' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for git-aware file filtering.' ,
showInDialog : false ,
properties : {
respectGitIgnore : {
type : 'boolean' ,
label : 'Respect .gitignore' ,
category : 'Context' ,
requiresRestart : true ,
default : true ,
description : 'Respect .gitignore files when searching' ,
showInDialog : true ,
} ,
respectGeminiIgnore : {
type : 'boolean' ,
2025-09-14 19:38:40 +08:00
label : 'Respect .qwenignore' ,
2025-08-27 18:39:45 -07:00
category : 'Context' ,
requiresRestart : true ,
default : true ,
2025-09-14 19:38:40 +08:00
description : 'Respect .qwenignore files when searching' ,
2025-08-27 18:39:45 -07:00
showInDialog : true ,
} ,
enableRecursiveFileSearch : {
type : 'boolean' ,
label : 'Enable Recursive File Search' ,
category : 'Context' ,
requiresRestart : true ,
default : true ,
description : 'Enable recursive file search functionality' ,
showInDialog : true ,
} ,
disableFuzzySearch : {
type : 'boolean' ,
label : 'Disable Fuzzy Search' ,
category : 'Context' ,
requiresRestart : true ,
default : false ,
description : 'Disable fuzzy search when searching for files.' ,
showInDialog : true ,
} ,
} ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-12 17:08:07 -04:00
2025-08-27 18:39:45 -07:00
tools : {
type : 'object' ,
label : 'Tools' ,
category : 'Tools' ,
2025-08-10 09:04:52 +09:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Settings for built-in and custom tools.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
sandbox : {
type : 'object' ,
label : 'Sandbox' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as boolean | string | undefined ,
description :
'Sandbox execution environment (can be a boolean or a path string).' ,
showInDialog : false ,
} ,
usePty : {
type : 'boolean' ,
label : 'Use node-pty for Shell Execution' ,
category : 'Tools' ,
requiresRestart : true ,
default : false ,
description :
'Use node-pty for shell command execution. Fallback to child_process still applies.' ,
showInDialog : true ,
} ,
core : {
type : 'array' ,
label : 'Core Tools' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'Paths to core tool definitions.' ,
showInDialog : false ,
} ,
allowed : {
type : 'array' ,
label : 'Allowed Tools' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description :
'A list of tool names that will bypass the confirmation dialog.' ,
showInDialog : false ,
} ,
exclude : {
type : 'array' ,
label : 'Exclude Tools' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'Tool names to exclude from discovery.' ,
showInDialog : false ,
} ,
discoveryCommand : {
type : 'string' ,
label : 'Tool Discovery Command' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to run for tool discovery.' ,
showInDialog : false ,
} ,
callCommand : {
type : 'string' ,
label : 'Tool Call Command' ,
category : 'Tools' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to run for tool calls.' ,
showInDialog : false ,
} ,
useRipgrep : {
type : 'boolean' ,
label : 'Use Ripgrep' ,
category : 'Tools' ,
requiresRestart : false ,
default : false ,
description :
'Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.' ,
showInDialog : true ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
mcp : {
type : 'object' ,
label : 'MCP' ,
category : 'MCP' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for Model Context Protocol (MCP) servers.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
serverCommand : {
type : 'string' ,
label : 'MCP Server Command' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string | undefined ,
description : 'Command to start an MCP server.' ,
showInDialog : false ,
} ,
allowed : {
type : 'array' ,
label : 'Allow MCP Servers' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'A whitelist of MCP servers to allow.' ,
showInDialog : false ,
} ,
excluded : {
type : 'array' ,
label : 'Exclude MCP Servers' ,
category : 'MCP' ,
requiresRestart : true ,
default : undefined as string [ ] | undefined ,
description : 'A blacklist of MCP servers to exclude.' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
security : {
type : 'object' ,
label : 'Security' ,
category : 'Security' ,
requiresRestart : true ,
default : { } ,
description : 'Security-related settings.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
folderTrust : {
type : 'object' ,
label : 'Folder Trust' ,
category : 'Security' ,
requiresRestart : false ,
default : { } ,
description : 'Settings for folder trust.' ,
showInDialog : false ,
properties : {
featureEnabled : {
type : 'boolean' ,
label : 'Folder Trust Feature' ,
category : 'Security' ,
requiresRestart : false ,
default : false ,
description : 'Enable folder trust feature for enhanced security.' ,
showInDialog : true ,
} ,
enabled : {
type : 'boolean' ,
label : 'Folder Trust' ,
category : 'Security' ,
requiresRestart : false ,
default : false ,
description : 'Setting to track whether Folder trust is enabled.' ,
showInDialog : true ,
} ,
} ,
} ,
auth : {
type : 'object' ,
label : 'Authentication' ,
category : 'Security' ,
requiresRestart : true ,
default : { } ,
description : 'Authentication settings.' ,
showInDialog : false ,
properties : {
selectedType : {
type : 'string' ,
label : 'Selected Auth Type' ,
category : 'Security' ,
requiresRestart : true ,
default : undefined as AuthType | undefined ,
description : 'The currently selected authentication type.' ,
showInDialog : false ,
} ,
useExternal : {
type : 'boolean' ,
label : 'Use External Auth' ,
category : 'Security' ,
requiresRestart : true ,
default : undefined as boolean | undefined ,
description : 'Whether to use an external authentication flow.' ,
showInDialog : false ,
} ,
} ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
advanced : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-27 18:39:45 -07:00
label : 'Advanced' ,
category : 'Advanced' ,
requiresRestart : true ,
default : { } ,
description : 'Advanced settings for power users.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
autoConfigureMemory : {
type : 'boolean' ,
label : 'Auto Configure Max Old Space Size' ,
category : 'Advanced' ,
requiresRestart : true ,
default : false ,
description : 'Automatically configure Node.js memory limits' ,
showInDialog : false ,
} ,
dnsResolutionOrder : {
type : 'string' ,
label : 'DNS Resolution Order' ,
category : 'Advanced' ,
requiresRestart : true ,
default : undefined as DnsResolutionOrder | undefined ,
description : 'The DNS resolution order.' ,
showInDialog : false ,
} ,
excludedEnvVars : {
type : 'array' ,
label : 'Excluded Project Environment Variables' ,
category : 'Advanced' ,
requiresRestart : false ,
default : [ 'DEBUG' , 'DEBUG_MODE' ] as string [ ] ,
description : 'Environment variables to exclude from project context.' ,
showInDialog : false ,
} ,
bugCommand : {
type : 'object' ,
label : 'Bug Command' ,
category : 'Advanced' ,
requiresRestart : false ,
default : undefined as BugCommandSettings | undefined ,
description : 'Configuration for the bug report command.' ,
showInDialog : false ,
} ,
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
experimental : {
type : 'object' ,
label : 'Experimental' ,
category : 'Experimental' ,
2025-08-25 17:02:10 +00:00
requiresRestart : true ,
2025-08-27 18:39:45 -07:00
default : { } ,
description : 'Setting to enable experimental features' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-27 18:39:45 -07:00
properties : {
extensionManagement : {
type : 'boolean' ,
label : 'Extension Management' ,
category : 'Experimental' ,
requiresRestart : true ,
default : false ,
description : 'Enable extension management features.' ,
showInDialog : false ,
} ,
2025-09-18 13:32:00 +08:00
visionModelPreview : {
type : 'boolean' ,
label : 'Vision Model Preview' ,
category : 'Experimental' ,
requiresRestart : false ,
2025-09-24 10:21:09 +08:00
default : true ,
2025-09-18 13:32:00 +08:00
description :
'Enable vision model support and auto-switching functionality. When disabled, vision models like qwen-vl-max-latest will be hidden and auto-switching will not occur.' ,
showInDialog : true ,
} ,
2025-09-24 10:21:09 +08:00
vlmSwitchMode : {
type : 'string' ,
label : 'VLM Switch Mode' ,
category : 'Experimental' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description :
'Default behavior when images are detected in input. Values: once (one-time switch), session (switch for entire session), persist (continue with current model). If not set, user will be prompted each time. This is a temporary experimental feature.' ,
showInDialog : false ,
} ,
2025-08-27 18:39:45 -07:00
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-27 18:39:45 -07:00
2025-08-26 14:36:55 +00:00
extensions : {
2025-08-10 09:04:52 +09:00
type : 'object' ,
2025-08-26 14:36:55 +00:00
label : 'Extensions' ,
category : 'Extensions' ,
requiresRestart : true ,
default : { } ,
description : 'Settings for extensions.' ,
2025-08-10 09:04:52 +09:00
showInDialog : false ,
2025-08-26 14:36:55 +00:00
properties : {
disabled : {
type : 'array' ,
label : 'Disabled Extensions' ,
category : 'Extensions' ,
requiresRestart : true ,
default : [ ] as string [ ] ,
description : 'List of disabled extensions.' ,
showInDialog : false ,
} ,
2025-08-27 00:43:02 +00:00
workspacesWithMigrationNudge : {
type : 'array' ,
label : 'Workspaces with Migration Nudge' ,
category : 'Extensions' ,
requiresRestart : false ,
default : [ ] as string [ ] ,
description :
'List of workspaces for which the migration nudge has been shown.' ,
showInDialog : false ,
} ,
2025-08-26 14:36:55 +00:00
} ,
2025-08-10 09:04:52 +09:00
} ,
2025-08-18 19:55:46 +08:00
contentGenerator : {
type : 'object' ,
label : 'Content Generator' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as Record < string , unknown > | undefined ,
description : 'Content generator settings.' ,
showInDialog : false ,
2025-09-01 22:02:46 +08:00
properties : {
timeout : {
type : 'number' ,
label : 'Timeout' ,
category : 'Content Generator' ,
requiresRestart : false ,
default : undefined as number | undefined ,
description : 'Request timeout in milliseconds.' ,
parentKey : 'contentGenerator' ,
childKey : 'timeout' ,
showInDialog : true ,
} ,
maxRetries : {
type : 'number' ,
label : 'Max Retries' ,
category : 'Content Generator' ,
requiresRestart : false ,
default : undefined as number | undefined ,
description : 'Maximum number of retries for failed requests.' ,
parentKey : 'contentGenerator' ,
childKey : 'maxRetries' ,
showInDialog : true ,
} ,
disableCacheControl : {
type : 'boolean' ,
label : 'Disable Cache Control' ,
category : 'Content Generator' ,
requiresRestart : false ,
default : false ,
description : 'Disable cache control for DashScope providers.' ,
parentKey : 'contentGenerator' ,
childKey : 'disableCacheControl' ,
showInDialog : true ,
} ,
} ,
2025-08-18 19:55:46 +08:00
} ,
enableOpenAILogging : {
type : 'boolean' ,
label : 'Enable OpenAI Logging' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Enable OpenAI logging.' ,
showInDialog : true ,
} ,
sessionTokenLimit : {
type : 'number' ,
label : 'Session Token Limit' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as number | undefined ,
description : 'The maximum number of tokens allowed in a session.' ,
showInDialog : false ,
} ,
systemPromptMappings : {
type : 'object' ,
label : 'System Prompt Mappings' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as Record < string , string > | undefined ,
description : 'Mappings of system prompts to model names.' ,
showInDialog : false ,
} ,
tavilyApiKey : {
type : 'string' ,
label : 'Tavily API Key' ,
category : 'General' ,
requiresRestart : false ,
default : undefined as string | undefined ,
description : 'The API key for the Tavily API.' ,
showInDialog : false ,
} ,
2025-09-01 14:48:55 +08:00
skipNextSpeakerCheck : {
type : 'boolean' ,
label : 'Skip Next Speaker Check' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Skip the next speaker check.' ,
showInDialog : true ,
} ,
2025-09-15 14:02:46 +08:00
skipLoopDetection : {
type : 'boolean' ,
label : 'Skip Loop Detection' ,
category : 'General' ,
requiresRestart : false ,
default : false ,
description : 'Disable all loop detection checks (streaming and LLM).' ,
showInDialog : true ,
} ,
2025-09-24 14:26:17 +08:00
approvalMode : {
type : 'string' ,
label : 'Default Approval Mode' ,
category : 'General' ,
requiresRestart : false ,
default : 'default' ,
description :
'Default approval mode for tool usage. Valid values: plan, default, auto-edit, yolo.' ,
showInDialog : true ,
} ,
2025-09-11 16:59:26 +08:00
enableWelcomeBack : {
type : 'boolean' ,
label : 'Enable Welcome Back' ,
category : 'UI' ,
requiresRestart : false ,
default : true ,
description :
'Show welcome back dialog when returning to a project with conversation history.' ,
showInDialog : true ,
} ,
2025-08-10 09:04:52 +09:00
} as const ;
type InferSettings < T extends SettingsSchema > = {
- readonly [ K in keyof T ] ? : T [ K ] extends { properties : SettingsSchema }
? InferSettings < T [ K ] [ 'properties' ] >
: T [ K ] [ 'default' ] extends boolean
? boolean
: T [ K ] [ 'default' ] ;
} ;
export type Settings = InferSettings < typeof SETTINGS_SCHEMA > ;