| 1 | using System.Text.Json.Serialization; |
| 2 | using OutWit.Common.Abstract; |
| 3 | |
| 4 | namespace CascadeIDE.Models; |
| 5 | |
| 6 | /// <summary>Настройки CascadeIDE (модель Ollama по умолчанию, MCP, провайдеры ИИ и т.д.).</summary> |
| 7 | public sealed partial class CascadeIdeSettings : ModelBase |
| 8 | { |
| 9 | public AiSettings Ai { get; set; } = new(); |
| 10 | |
| 11 | public McpSettings Mcp { get; set; } = new(); |
| 12 | |
| 13 | /// <summary>Hybrid Codebase Index integration toggles (in-proc). TOML: <c>[hybrid_index]</c>.</summary> |
| 14 | public HybridIndexSettings HybridIndex { get; set; } = new(); |
| 15 | |
| 16 | /// <summary>Прогрев при открытии solution (ADR 0141). TOML: <c>[solution_warmup]</c>.</summary> |
| 17 | public SolutionWarmupSettings SolutionWarmup { get; set; } = new(); |
| 18 | |
| 19 | /// <summary>Палитра команд и go-to workspace. TOML: <c>[command_palette.go_to_search]</c> и др.; ADR 0112.</summary> |
| 20 | public CommandPaletteSettings CommandPalette { get; set; } = new(); |
| 21 | |
| 22 | /// <summary>Agent-notes / knowledge (встроенный KB-Base и оверлей). TOML: <c>[agent_notes]</c>.</summary> |
| 23 | public AgentNotesSettings AgentNotes { get; set; } = new(); |
| 24 | |
| 25 | /// <summary>Agent execution environment (ADR 0148). TOML: <c>[agent.environment]</c>.</summary> |
| 26 | public AgentSettings Agent { get; set; } = new(); |
| 27 | |
| 28 | public WorkspaceSettings Workspace { get; set; } = new(); |
| 29 | |
| 30 | public CodeNavigationMapSettings CodeNavigationMap { get; set; } = new(); |
| 31 | |
| 32 | public LanguagesSettings Languages { get; set; } = new(); |
| 33 | |
| 34 | public MarkdownSettings Markdown { get; set; } = new(); |
| 35 | |
| 36 | public DisplaySettings Display { get; set; } = new(); |
| 37 | |
| 38 | public EditorSettings Editor { get; set; } = new(); |
| 39 | |
| 40 | /// <summary>Шрифты Intercom, редактора и др. TOML: <c>[fonts.*]</c>.</summary> |
| 41 | public FontsSettings Fonts { get; set; } = new(); |
| 42 | |
| 43 | /// <summary>Пресеты навигации по коду / решению (ADR 0039, Code Navigation Context). TOML: <c>[code_navigation]</c>.</summary> |
| 44 | public CodeNavigationSettings CodeNavigation { get; set; } = new(); |
| 45 | |
| 46 | /// <summary>Intercom (вложения, лента). TOML: <c>[intercom]</c>, code-attach — <c>[intercom.attachments.code]</c> (ADR 0130).</summary> |
| 47 | public IntercomSettings Intercom { get; set; } = new(); |
| 48 | |
| 49 | /// <summary>Диагностические логи. TOML: <c>[logging.intercom]</c> и др.</summary> |
| 50 | public LoggingSettings Logging { get; set; } = new(); |
| 51 | |
| 52 | /// <summary> |
| 53 | /// При пресете «Mfd на втором экране» и >=2 мониторах — открыть окно-хост зоны Mfd при старте (ADR 0017 v1). |
| 54 | /// </summary> |
| 55 | [JsonIgnore] |
| 56 | public bool OpenMfdHostWindowOnStartup |
| 57 | { |
| 58 | get => Display.Mfd.OpenOnStartup; |
| 59 | set => Display.Mfd.OpenOnStartup = value; |
| 60 | } |
| 61 | |
| 62 | [JsonIgnore] |
| 63 | public int? MfdHostWindowPixelX |
| 64 | { |
| 65 | get => Display.Mfd.PixelX; |
| 66 | set => Display.Mfd.PixelX = value; |
| 67 | } |
| 68 | |
| 69 | [JsonIgnore] |
| 70 | public int? MfdHostWindowPixelY |
| 71 | { |
| 72 | get => Display.Mfd.PixelY; |
| 73 | set => Display.Mfd.PixelY = value; |
| 74 | } |
| 75 | |
| 76 | [JsonIgnore] |
| 77 | public double? MfdHostWindowWidth |
| 78 | { |
| 79 | get => Display.Mfd.Width; |
| 80 | set => Display.Mfd.Width = value; |
| 81 | } |
| 82 | |
| 83 | [JsonIgnore] |
| 84 | public double? MfdHostWindowHeight |
| 85 | { |
| 86 | get => Display.Mfd.Height; |
| 87 | set => Display.Mfd.Height = value; |
| 88 | } |
| 89 | |
| 90 | [JsonIgnore] |
| 91 | public bool OpenPfdHostWindowOnStartup |
| 92 | { |
| 93 | get => Display.Pfd.OpenOnStartup; |
| 94 | set => Display.Pfd.OpenOnStartup = value; |
| 95 | } |
| 96 | |
| 97 | [JsonIgnore] |
| 98 | public int? PfdHostWindowPixelX |
| 99 | { |
| 100 | get => Display.Pfd.PixelX; |
| 101 | set => Display.Pfd.PixelX = value; |
| 102 | } |
| 103 | |
| 104 | [JsonIgnore] |
| 105 | public int? PfdHostWindowPixelY |
| 106 | { |
| 107 | get => Display.Pfd.PixelY; |
| 108 | set => Display.Pfd.PixelY = value; |
| 109 | } |
| 110 | |
| 111 | [JsonIgnore] |
| 112 | public double? PfdHostWindowWidth |
| 113 | { |
| 114 | get => Display.Pfd.Width; |
| 115 | set => Display.Pfd.Width = value; |
| 116 | } |
| 117 | |
| 118 | [JsonIgnore] |
| 119 | public double? PfdHostWindowHeight |
| 120 | { |
| 121 | get => Display.Pfd.Height; |
| 122 | set => Display.Pfd.Height = value; |
| 123 | } |
| 124 | |
| 125 | [JsonIgnore] |
| 126 | public bool OpenPmSplitHostWindowOnStartup |
| 127 | { |
| 128 | get => Display.Pm.OpenOnStartup; |
| 129 | set => Display.Pm.OpenOnStartup = value; |
| 130 | } |
| 131 | |
| 132 | [JsonIgnore] |
| 133 | public int? PmSplitHostWindowPixelX |
| 134 | { |
| 135 | get => Display.Pm.PixelX; |
| 136 | set => Display.Pm.PixelX = value; |
| 137 | } |
| 138 | |
| 139 | [JsonIgnore] |
| 140 | public int? PmSplitHostWindowPixelY |
| 141 | { |
| 142 | get => Display.Pm.PixelY; |
| 143 | set => Display.Pm.PixelY = value; |
| 144 | } |
| 145 | |
| 146 | [JsonIgnore] |
| 147 | public double? PmSplitHostWindowWidth |
| 148 | { |
| 149 | get => Display.Pm.Width; |
| 150 | set => Display.Pm.Width = value; |
| 151 | } |
| 152 | |
| 153 | [JsonIgnore] |
| 154 | public double? PmSplitHostWindowHeight |
| 155 | { |
| 156 | get => Display.Pm.Height; |
| 157 | set => Display.Pm.Height = value; |
| 158 | } |
| 159 | |
| 160 | [JsonIgnore] |
| 161 | public bool MaximizePresentationHostWindowsOnDedicatedScreens |
| 162 | { |
| 163 | get => Display.MaximizeHostsOnDedicatedScreens; |
| 164 | set => Display.MaximizeHostsOnDedicatedScreens = value; |
| 165 | } |
| 166 | |
| 167 | public string GetEffectivePresentationLine() => Display.Screens.Topology?.Trim() ?? ""; |
| 168 | |
| 169 | /// <summary>Грамматика для <see cref="GetEffectivePresentationLine"/> — <see cref="DisplayScreensSettings.Grammar"/>.</summary> |
| 170 | public PresentationGrammarSettings GetEffectivePresentationGrammar() |
| 171 | { |
| 172 | var g = Display.Screens.Grammar; |
| 173 | return new PresentationGrammarSettings |
| 174 | { |
| 175 | Brackets = g.Brackets, |
| 176 | BetweenScreens = g.BetweenScreens, |
| 177 | BetweenZones = g.BetweenZones, |
| 178 | Pfd = g.Pfd, |
| 179 | Forward = g.Forward, |
| 180 | Mfd = g.Mfd, |
| 181 | }; |
| 182 | } |
| 183 | } |
| 184 | |