- Добавлен RazorConsole.Core для интерактивного TUI-дашборда - ToolRegistryService: живое включение/отключение модулей и отдельных методов - InMemoryLogSink: кольцевой буфер логов с фильтрацией по модулю - TUI: 3 таба (Overview, Logs, Settings) - IToolModule: generic-интерфейс для легкого добавления новых MCP-модулей - Guard-проверка TryCheckEnabled() во всех существующих инструментах
43 lines
1.6 KiB
Plaintext
43 lines
1.6 KiB
Plaintext
@using LazyBear.MCP.Services.ToolRegistry
|
|
@inject ToolRegistryService Registry
|
|
|
|
<Rows>
|
|
<Markup Content=" " />
|
|
<Markup Content="[bold]Tool Registry — runtime enable/disable[/]" />
|
|
<Markup Content="[grey]Changes take effect immediately without restart[/]" />
|
|
<Markup Content=" " />
|
|
|
|
@{
|
|
int focusIdx = 20;
|
|
}
|
|
|
|
@foreach (var module in Registry.GetModules())
|
|
{
|
|
var moduleEnabled = Registry.IsModuleEnabled(module.ModuleName);
|
|
var moduleColor = moduleEnabled ? Spectre.Console.Color.Green : Spectre.Console.Color.Red;
|
|
var moduleName = module.ModuleName;
|
|
var capturedFocus = focusIdx++;
|
|
|
|
<Panel Title="@module.ModuleName" BorderColor="@moduleColor" Expand="true">
|
|
<Rows>
|
|
<Columns>
|
|
<TextButton Content="@(moduleEnabled ? "[green]■ MODULE ENABLED[/]" : "[red]□ MODULE DISABLED[/]")"
|
|
OnClick="@(() => Registry.ToggleModule(moduleName))"
|
|
BackgroundColor="@(moduleEnabled ? Spectre.Console.Color.DarkGreen : Spectre.Console.Color.DarkRed)"
|
|
FocusedColor="@Spectre.Console.Color.Yellow"
|
|
FocusOrder="@capturedFocus" />
|
|
<Markup Content="@($" {module.Description}")" Foreground="@Spectre.Console.Color.Grey" />
|
|
</Columns>
|
|
<Markup Content=" " />
|
|
<ToolButtonList Module="@module" StartFocusIdx="@focusIdx" />
|
|
</Rows>
|
|
</Panel>
|
|
|
|
focusIdx += module.ToolNames.Count;
|
|
<Markup Content=" " />
|
|
}
|
|
</Rows>
|
|
|
|
@code {
|
|
}
|