| 1 | <UserControl xmlns="https://github.com/avaloniaui" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:vm="using:CascadeIDE.ViewModels" |
| 4 | x:Class="CascadeIDE.Views.AiChatSettingsPanelView" |
| 5 | x:DataType="vm:MainWindowViewModel"> |
| 6 | <StackPanel Spacing="14"> |
| 7 | <StackPanel Spacing="6"> |
| 8 | <TextBlock Text="Режим AI (settings.toml: ai.mode):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 9 | <ComboBox ItemsSource="{Binding AiModeOptionsList}" SelectedItem="{Binding AiMode}" MinWidth="200"/> |
| 10 | </StackPanel> |
| 11 | |
| 12 | <StackPanel Spacing="6" IsVisible="{Binding IsAiCloudMode}"> |
| 13 | <TextBlock Text="Облако: провайдер (ai.cloud.active_provider):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 14 | <ComboBox ItemsSource="{Binding AiCloudProviderKeysList}" SelectedItem="{Binding CloudActiveProvider}" MinWidth="200"/> |
| 15 | </StackPanel> |
| 16 | |
| 17 | <StackPanel Spacing="6" IsVisible="{Binding IsOllamaSelected}"> |
| 18 | <TextBlock Text="Модель Ollama:" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 19 | <ComboBox ItemsSource="{Binding OllamaModelChoices}" |
| 20 | SelectedItem="{Binding SelectedOllamaModel}" |
| 21 | MinWidth="240" |
| 22 | IsEnabled="{Binding OllamaAvailable}"/> |
| 23 | <TextBlock Text="{Binding SelectedModelDetails}" FontSize="11" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" TextWrapping="Wrap"/> |
| 24 | </StackPanel> |
| 25 | |
| 26 | <StackPanel Spacing="6" IsVisible="{Binding IsAnthropicSelected}"> |
| 27 | <TextBlock Text="Anthropic API key:" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 28 | <TextBox Text="{Binding AnthropicApiKey, Mode=TwoWay}" PasswordChar="*" PlaceholderText="sk-ant-..." MinWidth="280"/> |
| 29 | </StackPanel> |
| 30 | <StackPanel Spacing="6" IsVisible="{Binding IsOpenAiSelected}"> |
| 31 | <TextBlock Text="OpenAI API key:" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 32 | <TextBox Text="{Binding OpenAiApiKey, Mode=TwoWay}" PasswordChar="*" PlaceholderText="sk-..." MinWidth="280"/> |
| 33 | </StackPanel> |
| 34 | <StackPanel Spacing="6" IsVisible="{Binding IsDeepSeekSelected}"> |
| 35 | <TextBlock Text="DeepSeek API key:" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 36 | <TextBox Text="{Binding DeepSeekApiKey, Mode=TwoWay}" PasswordChar="*" PlaceholderText="sk-..." MinWidth="280"/> |
| 37 | </StackPanel> |
| 38 | |
| 39 | <StackPanel Spacing="6" IsVisible="{Binding IsCursorAcpSelected}"> |
| 40 | <TextBlock Text="Cursor ACP: путь к cursor-agent.cmd или к папке с dist-package" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" TextWrapping="Wrap"/> |
| 41 | <TextBox Text="{Binding CursorAcpAgentPath, Mode=TwoWay}" |
| 42 | PlaceholderText="...\dist-package или ...\cursor-agent.cmd" |
| 43 | MinWidth="280" |
| 44 | TextWrapping="Wrap"/> |
| 45 | <TextBlock Text="Модель Cursor ACP (список подставляется после первого ответа в чате; предпочтение сохраняется в настройках)" FontSize="11" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" TextWrapping="Wrap"/> |
| 46 | <ComboBox ItemsSource="{Binding ChatPanel.CursorAcpModelPicks}" |
| 47 | SelectedItem="{Binding ChatPanel.SelectedCursorAcpModelPick}" |
| 48 | MinWidth="280" |
| 49 | PlaceholderText="Нет данных — отправь сообщение в чат"/> |
| 50 | </StackPanel> |
| 51 | |
| 52 | <Border Background="{DynamicResource CascadeTheme.SurfaceRegionLowBrush}" |
| 53 | CornerRadius="4" |
| 54 | Padding="10"> |
| 55 | <StackPanel Spacing="10"> |
| 56 | <TextBlock FontWeight="SemiBold" |
| 57 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" |
| 58 | Text="Чат · сочетания клавиш"/> |
| 59 | <StackPanel Spacing="6"> |
| 60 | <TextBlock Text="Отправить сообщение" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 61 | <ComboBox ItemsSource="{Binding SendMessageKeyOptionsList}" |
| 62 | SelectedItem="{Binding SendMessageKey}" |
| 63 | MinWidth="220"/> |
| 64 | </StackPanel> |
| 65 | <StackPanel Spacing="6"> |
| 66 | <TextBlock Text="Новая строка в поле сообщения (Skia)" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" TextWrapping="Wrap"/> |
| 67 | <ComboBox ItemsSource="{Binding ComposerNewLineKeyOptionsList}" |
| 68 | SelectedItem="{Binding ComposerNewLineKey}" |
| 69 | MinWidth="220"/> |
| 70 | </StackPanel> |
| 71 | </StackPanel> |
| 72 | </Border> |
| 73 | |
| 74 | <StackPanel Spacing="6"> |
| 75 | <TextBlock Text="Плотность ленты Intercom (settings.toml: [intercom] feed_metrics):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" TextWrapping="Wrap"/> |
| 76 | <ComboBox ItemsSource="{Binding IntercomFeedMetricsOptionsList}" SelectedItem="{Binding IntercomFeedMetrics}" MinWidth="200"/> |
| 77 | <TextBlock Text="comfortable — prose_pt, просторная лента; compact — prose_pt_forward и плотные отступы (как раньше на Forward)." |
| 78 | FontSize="11" |
| 79 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" |
| 80 | TextWrapping="Wrap"/> |
| 81 | </StackPanel> |
| 82 | |
| 83 | <CheckBox Content="Минимальный контекст (только диагностики и сигнатуры)" IsChecked="{Binding UseMinimizedContext}" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 84 | <CheckBox Content="Показывать thinking/reasoning в истории (если выключено — только live во время ответа)" |
| 85 | IsChecked="{Binding ShowThinkingInHistory}" |
| 86 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 87 | <CheckBox Content="Cursor ACP: автоматически передавать MCP IDE в сессию агента (cascade-ide → текущий exe + --mcp-stdio)" |
| 88 | IsChecked="{Binding AcpAutoInjectIdeMcp}" |
| 89 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 90 | |
| 91 | <TextBlock Text="Внешние MCP-серверы (autonomous и Cursor ACP), JSON:" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" Margin="0,12,0,0" TextWrapping="Wrap"/> |
| 92 | <TextBox Text="{Binding ExternalMcpServersJson, Mode=TwoWay}" |
| 93 | AcceptsReturn="True" |
| 94 | TextWrapping="Wrap" |
| 95 | FontFamily="Consolas,monospace" |
| 96 | FontSize="11" |
| 97 | MinHeight="110"/> |
| 98 | |
| 99 | <TextBlock Text="Team transport (Intercom FederatedSync, ADR 0144)" FontWeight="SemiBold" Margin="0,16,0,0" |
| 100 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 101 | <CheckBox Content="Включить transport ([intercom.transport] enabled)" IsChecked="{Binding IntercomTransportEnabled}" |
| 102 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 103 | <StackPanel Spacing="4"> |
| 104 | <TextBlock Text="base_url (reference intercom-service):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 105 | <TextBox Text="{Binding IntercomTransportBaseUrl, Mode=TwoWay}" PlaceholderText="http://127.0.0.1:5080" MinWidth="280"/> |
| 106 | </StackPanel> |
| 107 | <StackPanel Spacing="4"> |
| 108 | <TextBlock Text="local_server_path (относительно CascadeIDE.exe):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 109 | <TextBox Text="{Binding IntercomTransportLocalServerPath, Mode=TwoWay}" |
| 110 | PlaceholderText="tools/intercom-service/IntercomService.exe" MinWidth="280"/> |
| 111 | </StackPanel> |
| 112 | <StackPanel Spacing="4"> |
| 113 | <TextBlock Text="team_id (пусто → .cascade-ide/intercom-team.toml):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 114 | <TextBox Text="{Binding IntercomTransportTeamId, Mode=TwoWay}" MinWidth="280"/> |
| 115 | </StackPanel> |
| 116 | <StackPanel Spacing="4"> |
| 117 | <TextBlock Text="OAuth provider (github | oidc):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 118 | <ComboBox ItemsSource="{x:Static vm:MainWindowViewModel.IntercomOAuthProviderOptions}" |
| 119 | SelectedItem="{Binding IntercomTransportOAuthProvider, Mode=TwoWay}" MinWidth="200"/> |
| 120 | </StackPanel> |
| 121 | <StackPanel Spacing="4"> |
| 122 | <TextBlock Text="DEV team token (только локальная отладка):" Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 123 | <TextBox Text="{Binding IntercomTransportDevTeamToken, Mode=TwoWay}" PasswordChar="*" MinWidth="280"/> |
| 124 | </StackPanel> |
| 125 | <CheckBox Content="Auto Connect при первом human send" IsChecked="{Binding IntercomTransportAutoConnectOnSend}" |
| 126 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 127 | <CheckBox Content="Синхронизировать ответы ассистента в Channel" IsChecked="{Binding IntercomTransportSyncAgentChannelMessages}" |
| 128 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 129 | <StackPanel Orientation="Horizontal" Spacing="8"> |
| 130 | <Button Content="Connect Intercom" Command="{Binding ConnectIntercomTransportFromSettingsCommand}"/> |
| 131 | <Button Content="Disconnect" Command="{Binding DisconnectIntercomTransportFromSettingsCommand}"/> |
| 132 | </StackPanel> |
| 133 | <TextBlock Text="{Binding IntercomTransportConnectionStatus}" TextWrapping="Wrap" FontSize="11" |
| 134 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 135 | </StackPanel> |
| 136 | </UserControl> |
| 137 | |