import { type WittyPhraseStyle } from '../../ui/constants/phrasesCollections.js'; import type { MemoryImportFormat } from './types.js'; import type { CustomTheme } from '../../ui/themes/theme.js'; import type { UnicodeMode } from '../../ui/utils/unicodeSupport.js'; import { CORE_SETTINGS_SCHEMA } from './schema-core.js'; export const UI_SETTINGS_SCHEMA = { ui: { type: 'object', label: 'UI', category: 'UI', requiresRestart: false, default: {}, description: 'User interface settings.', showInDialog: false, properties: { accessibility: CORE_SETTINGS_SCHEMA.accessibility, checkpointing: CORE_SETTINGS_SCHEMA.checkpointing, fileFiltering: CORE_SETTINGS_SCHEMA.fileFiltering, 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, description: 'Custom theme definitions.', showInDialog: false, additionalProperties: { type: 'object', ref: 'CustomTheme', }, }, hideWindowTitle: { type: 'boolean', label: 'Hide Window Title', category: 'UI', requiresRestart: true, default: false, description: 'Hide the window title bar', showInDialog: true, }, showStatusInTitle: { type: 'boolean', label: 'Show Thoughts in Title', category: 'UI', requiresRestart: false, default: false, description: 'Show LLxprt model thoughts in the terminal window title during the working phase', showInDialog: true, }, dynamicWindowTitle: { type: 'boolean', label: 'Dynamic Window Title', category: 'UI', requiresRestart: false, default: true, description: 'Update the terminal window title with current status prefixes (Ready: ◇, Action Required: no leading glyph, Working: no leading glyph)', showInDialog: true, }, showHomeDirectoryWarning: { type: 'boolean', label: 'Show Home Directory Warning', category: 'UI', requiresRestart: true, default: true, description: 'Show a warning when running LLxprt CLI in the home directory.', showInDialog: true, }, hideTips: { type: 'boolean', label: 'Hide Tips', category: 'UI', requiresRestart: false, default: false, description: 'Hide helpful tips in the UI', showInDialog: true, }, hideBanner: { type: 'boolean', label: 'Hide Banner', category: 'UI', requiresRestart: false, default: false, description: 'Hide the application banner', showInDialog: true, }, hideContextSummary: { type: 'boolean', label: 'Hide Context Summary', category: 'UI', requiresRestart: false, default: false, description: 'Hide the context summary (LLXPRT.md, MCP servers) above the input.', showInDialog: true, }, footer: { type: 'object', label: 'Footer', category: 'UI', requiresRestart: false, default: {}, description: 'Settings for the footer.', showInDialog: false, properties: { hideCWD: { type: 'boolean', label: 'Hide CWD', category: 'UI', requiresRestart: false, default: false, description: 'Hide the current working directory path in the footer.', showInDialog: true, }, hideSandboxStatus: { type: 'boolean', label: 'Hide Sandbox Status', category: 'UI', requiresRestart: false, default: false, description: 'Hide the sandbox status indicator in the footer.', showInDialog: true, }, hideModelInfo: { type: 'boolean', label: 'Hide Model Info', category: 'UI', requiresRestart: false, default: false, description: 'Hide the model name and context usage in the footer.', showInDialog: true, }, }, }, hideFooter: { type: 'boolean', label: 'Hide Footer', category: 'UI', requiresRestart: false, default: false, description: 'Hide the footer from the UI', showInDialog: true, }, useAlternateBuffer: { type: 'boolean', label: 'Use Alternate Screen Buffer', category: 'UI', requiresRestart: true, default: true, description: 'Use an alternate screen buffer for the UI, preserving shell history.', showInDialog: true, }, incrementalRendering: { type: 'boolean', label: 'Incremental Rendering', category: 'UI', requiresRestart: true, default: true, description: 'Enable incremental rendering for the UI. Only supported when useAlternateBuffer is enabled.', showInDialog: true, }, enableMouseEvents: { type: 'boolean', label: 'Enable Mouse Events', category: 'UI', requiresRestart: true, default: true, description: 'Enable mouse event tracking for in-app scrolling. Disables terminal text selection and clickable links while active.', showInDialog: true, }, showMemoryUsage: { type: 'boolean', label: 'Show Memory Usage', category: 'UI', requiresRestart: false, default: false, description: 'Display memory usage information in the UI', showInDialog: true, }, alwaysDisplayFullShellCommand: { type: 'boolean', label: 'Always Display Full Shell Command', category: 'UI', requiresRestart: false, default: true, description: 'Display complete shell commands without truncation.', showInDialog: true, }, showLineNumbers: { type: 'boolean', label: 'Show Line Numbers', category: 'UI', requiresRestart: false, default: false, description: 'Show line numbers in the chat.', showInDialog: true, }, showCitations: { type: 'boolean', label: 'Show Citations', category: 'UI', requiresRestart: false, default: false, description: 'Show citations for generated text in the chat.', showInDialog: true, }, customWittyPhrases: { type: 'array', label: 'Custom Witty Phrases', category: 'UI', requiresRestart: false, default: [] as string[], description: 'Custom witty phrases to display during loading.', showInDialog: false, }, wittyPhraseStyle: { type: 'enum', label: 'Witty Phrase Style', category: 'UI', requiresRestart: false, default: 'default', description: 'Choose which collection of witty phrases to display during loading.', showInDialog: true, options: [ { value: 'default', label: 'Default (LLxprt + Custom Override)' }, { value: 'llxprt', label: 'LLxprt Built-in' }, { value: 'gemini-cli', label: 'Gemini-cli Built-in' }, { value: 'whimsical', label: 'Whimsical' }, { value: 'custom', label: 'Custom Phrases Only' }, ] satisfies ReadonlyArray<{ value: WittyPhraseStyle; label: string }>, }, vimMode: { type: 'boolean', label: 'Vim Mode', category: 'UI', requiresRestart: false, default: false, description: 'Enable Vim keybindings in the input field.', showInDialog: true, }, ideMode: { type: 'boolean', label: 'IDE Mode', category: 'UI', requiresRestart: false, default: false, description: 'Enable IDE integration mode.', showInDialog: true, }, preferredEditor: { type: 'string', label: 'Preferred Editor', category: 'UI', requiresRestart: false, default: undefined as string | undefined, description: 'The preferred code editor for opening files.', showInDialog: false, }, autoConfigureMaxOldSpaceSize: { type: 'boolean', label: 'Auto Configure Max Old Space Size', category: 'UI', requiresRestart: true, default: true, description: 'Automatically configure Node.js max old space size based on system memory.', showInDialog: true, }, maxHeapSizeMB: { type: 'number', label: 'Max Heap Size (MB)', category: 'UI', requiresRestart: true, default: 8192, minimum: 512, multipleOf: 1, description: 'Caps the auto-configured Node.js max old space heap size. Overrides the default 8GB cap when auto-configure is enabled. Must be an integer.', showInDialog: true, }, historyMaxItems: { type: 'number', label: 'History Max Items', category: 'UI', requiresRestart: false, default: 100, description: 'Maximum number of history items to keep.', showInDialog: false, }, historyMaxBytes: { type: 'number', label: 'History Max Bytes', category: 'UI', requiresRestart: false, default: 1048576, description: 'Maximum size of history in bytes.', showInDialog: false, }, memoryImportFormat: { type: 'string', label: 'Memory Import Format', category: 'UI', requiresRestart: false, default: 'tree' as MemoryImportFormat, description: 'Format for importing memory files (tree or flat).', showInDialog: false, }, memoryDiscoveryMaxDirs: { type: 'number', label: 'Memory Discovery Max Dirs', category: 'UI', requiresRestart: false, default: undefined as number | undefined, description: 'Maximum number of directories to scan for memory files.', showInDialog: false, }, memoryDiscoveryMaxDepth: { type: 'number', label: 'Memory Discovery Max Depth', category: 'UI', requiresRestart: false, default: undefined as number | undefined, description: 'Maximum directory depth for downward LLXPRT.md search from the current working directory. Does not affect upward traversal or global memory. When unset, searches all depths.', showInDialog: true, }, contextFileName: { type: 'string', label: 'Context File Name', category: 'UI', requiresRestart: false, default: undefined as string | string[] | undefined, ref: 'StringOrStringArray', description: 'The name of the context file or files to load into memory. Accepts either a single string or an array of strings.', showInDialog: false, }, usageStatisticsEnabled: { type: 'boolean', label: 'Usage Statistics Enabled', category: 'UI', requiresRestart: false, default: true, description: 'Enable anonymous usage statistics collection.', showInDialog: false, }, maxSessionTurns: { type: 'number', label: 'Max Session Turns', category: 'UI', requiresRestart: false, default: -1, description: 'Maximum number of turns in a session (-1 for unlimited).', showInDialog: false, }, showTodoPanel: { type: 'boolean', label: 'Show Todo Panel', category: 'UI', requiresRestart: false, default: true, description: 'Show the todo panel in the UI.', showInDialog: true, }, useFullWidth: { type: 'boolean', label: 'Use Full Width', category: 'UI', requiresRestart: false, default: true, description: 'Use the entire width of the terminal for output.', showInDialog: true, }, enableLoadingPhrases: { type: 'boolean', label: 'Enable Loading Phrases', category: 'UI', requiresRestart: true, default: true, description: 'Enable loading phrases during operations.', showInDialog: true, }, screenReader: { type: 'boolean', label: 'Screen Reader Mode', category: 'UI', requiresRestart: true, default: false, description: 'Render output in plain-text to be more screen reader accessible.', showInDialog: true, }, unicode: { type: 'enum', label: 'Unicode Rendering', category: 'UI', requiresRestart: true, default: 'auto', description: 'Control rendering of Unicode box-drawing and spinner glyphs. Use "off" on terminals that show "?" for borders/spinners (e.g. legacy Windows PowerShell).', showInDialog: true, options: [ { value: 'auto', label: 'Auto-detect (recommended)' }, { value: 'force', label: 'Always use Unicode glyphs' }, { value: 'off', label: 'ASCII-only (safe fallback)' }, ] satisfies ReadonlyArray<{ value: UnicodeMode; label: string }>, }, }, }, } as const;