import type { ChatCompressionSettings } from '@vybestack/llxprt-code-core'; export const EXTENSION_SETTINGS_SCHEMA = { security: { type: 'object', label: 'Security', category: 'Security', requiresRestart: true, default: {}, description: 'Security-related settings.', showInDialog: false, properties: { disableYoloMode: { type: 'boolean', label: 'Disable YOLO Mode', category: 'Security', requiresRestart: true, default: false, description: 'Disable YOLO mode, even if enabled by a flag.', showInDialog: true, }, disableOsKeyring: { type: 'boolean', label: 'Disable OS Keyring', category: 'Security', requiresRestart: true, default: false, description: 'Disable use of the OS keyring/keychain for credential storage and use the encrypted file fallback. Can also be set with the LLXPRT_DISABLE_OS_KEYRING=1 environment variable.', showInDialog: true, }, enablePermanentToolApproval: { type: 'boolean', label: 'Allow Permanent Tool Approval', category: 'Security', requiresRestart: false, default: false, description: 'Enable the "Allow for all future sessions" option in tool confirmation dialogs.', showInDialog: true, }, blockGitExtensions: { type: 'boolean', label: 'Blocks extensions from Git', category: 'Security', requiresRestart: true, default: false, description: 'Blocks installing and loading extensions from Git.', showInDialog: true, }, folderTrust: { type: 'object', label: 'Folder Trust', category: 'Security', requiresRestart: true, default: {}, description: 'Settings for folder trust.', showInDialog: false, properties: { enabled: { type: 'boolean', label: 'Folder Trust', category: 'Security', requiresRestart: true, 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 string | 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, }, }, }, environmentVariableRedaction: { type: 'object', label: 'Environment Variable Redaction', category: 'Security', requiresRestart: false, default: {}, description: 'Configure environment variable sanitization for shell commands, hooks, and MCP servers.', showInDialog: false, properties: { allowed: { type: 'array', label: 'Allowed Variables', category: 'Security', requiresRestart: false, default: [], items: { type: 'string' }, description: 'Environment variables to allow in addition to the default allowlist.', showInDialog: true, }, blocked: { type: 'array', label: 'Blocked Variables', category: 'Security', requiresRestart: false, default: [], items: { type: 'string' }, description: 'Environment variables to block in addition to the default blocklist.', showInDialog: true, }, enabled: { type: 'boolean', label: 'Enable Redaction', category: 'Security', requiresRestart: false, default: false, description: 'Enable environment variable redaction (disabled by default).', showInDialog: true, }, }, }, }, }, excludedProjectEnvVars: { 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, }, enableAutoUpdateNotification: { type: 'boolean', label: 'Enable Auto Update Notification', category: 'Updates', requiresRestart: false, default: true, description: 'Enable update notification prompts.', showInDialog: false, }, includeDirectories: { type: 'array', label: 'Include Directories', category: 'General', 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: 'General', requiresRestart: false, default: false, description: 'Whether to load memory files from include directories.', showInDialog: true, }, model: { type: 'union', refs: ['ModelName', 'ModelConfig'], label: 'Model', category: 'General', requiresRestart: false, default: undefined as | string | { name?: string; compressionThreshold?: number } | undefined, description: 'The model to use for conversations. V2 settings may use { name, compressionThreshold }; compressionThreshold maps to chatCompression.contextPercentageThreshold.', showInDialog: false, }, hasSeenIdeIntegrationNudge: { type: 'boolean', label: 'Has Seen IDE Integration Nudge', category: 'General', requiresRestart: false, default: false, description: 'Whether the user has seen the IDE integration nudge.', showInDialog: false, }, folderTrustFeature: { type: 'boolean', label: 'Folder Trust Feature', category: 'General', requiresRestart: true, default: false, description: 'Enable folder trust feature for enhanced security.', showInDialog: true, }, folderTrust: { type: 'boolean', label: 'Folder Trust', category: 'General', requiresRestart: true, default: false, description: 'Setting to track whether Folder trust is enabled.', showInDialog: true, }, chatCompression: { type: 'object', label: 'Chat Compression', category: 'General', requiresRestart: false, default: undefined as ChatCompressionSettings | undefined, description: 'Legacy chat compression settings. V2 model.compressionThreshold maps to contextPercentageThreshold.', showInDialog: false, properties: { contextPercentageThreshold: { type: 'number', label: 'Context Percentage Threshold', category: 'General', requiresRestart: false, default: undefined, description: 'Fraction of context-limit that triggers history compression (0.0–1.0).', showInDialog: false, minimum: 0, maximum: 1, }, strategy: { type: 'string', label: 'Compression Strategy', category: 'General', requiresRestart: false, default: undefined, description: 'Legacy compression strategy selector.', showInDialog: false, }, profile: { type: 'string', label: 'Compression Profile', category: 'General', requiresRestart: false, default: undefined, description: 'Legacy compression profile selector.', showInDialog: false, }, }, additionalProperties: false, }, experimental: { type: 'object', label: 'Experimental', category: 'Experimental', requiresRestart: true, default: {}, description: 'Experimental features.', showInDialog: false, properties: { extensionConfig: { type: 'boolean', label: 'Extension Configuration', category: 'Experimental', requiresRestart: true, default: false, description: 'Enable requesting and fetching of extension settings.', showInDialog: false, }, extensionReloading: { type: 'boolean', label: 'Extension Reloading', category: 'Experimental', requiresRestart: true, default: false, description: 'Enables extension loading/unloading within the CLI session.', showInDialog: false, }, jitContext: { type: 'boolean', label: 'JIT Context Loading', category: 'Experimental', requiresRestart: true, default: true, description: 'Enable just-in-time context memory loading via ContextManager instead of eager loading at startup.', showInDialog: false, }, skills: { type: 'boolean', label: 'Skills', category: 'Experimental', requiresRestart: true, default: false, description: 'Enable skills (experimental).', showInDialog: true, }, introspectionAgentSettings: { type: 'object', label: 'Introspection Agent Settings', category: 'Experimental', requiresRestart: true, default: {}, description: 'Configuration for Introspection Agent.', showInDialog: false, properties: { enabled: { type: 'boolean', label: 'Enable Introspection Agent', category: 'Experimental', requiresRestart: true, default: false, description: 'Enable the Introspection Agent.', showInDialog: true, }, }, }, }, }, // LLxprt-specific provider settings defaultProfile: { type: 'string', label: 'Default Profile', category: 'Provider', requiresRestart: true, default: undefined as string | undefined, description: 'Default provider profile to use.', showInDialog: false, }, providerApiKeys: { type: 'object', label: 'Provider API Keys', category: 'Provider', requiresRestart: true, default: {} as Record, description: 'API keys for different providers.', showInDialog: false, }, providerBaseUrls: { type: 'object', label: 'Provider Base URLs', category: 'Provider', requiresRestart: true, default: {} as Record, description: 'Base URLs for different providers.', showInDialog: false, }, providerToolFormatOverrides: { type: 'object', label: 'Provider Tool Format Overrides', category: 'Provider', requiresRestart: true, default: {} as Record, description: 'Tool format overrides for different providers.', showInDialog: false, }, providerKeyfiles: { type: 'object', label: 'Provider Keyfiles', category: 'Provider', requiresRestart: true, default: {} as Record, description: 'Keyfile paths for different providers.', showInDialog: false, }, } as const;