| 1 | using CascadeIDE.Contracts.Experimental.Capabilities; |
| 2 | |
| 3 | namespace CascadeIDE.Contracts.Experimental; |
| 4 | |
| 5 | /// <summary> |
| 6 | /// Registry для регистрации capabilities модулей. |
| 7 | /// </summary> |
| 8 | /// <remarks> |
| 9 | /// Registry должен собирать capability-map для introspection. “Включено/доступно” вычисляется shell’ом с учётом overlay |
| 10 | /// (например UiMode TOML) и рантайм условий. |
| 11 | /// </remarks> |
| 12 | [ApiStability(ApiStability.Experimental)] |
| 13 | public interface ICapabilityRegistry |
| 14 | { |
| 15 | /// <summary>Зарегистрировать service capability (контракт + реализация).</summary> |
| 16 | void RegisterService(ServiceCapabilityDescriptor descriptor); |
| 17 | |
| 18 | /// <summary>Зарегистрировать command capability (discoverability + метаданные).</summary> |
| 19 | void RegisterCommand(CommandCapabilityDescriptor descriptor); |
| 20 | |
| 21 | /// <summary>Зарегистрировать UI surface capability (панель/страница/вкладка).</summary> |
| 22 | void RegisterUiSurface(UiSurfaceCapabilityDescriptor descriptor); |
| 23 | |
| 24 | /// <summary>Зарегистрировать MCP handlers vertical module (ADR 0161).</summary> |
| 25 | void RegisterMcpHandlers(Action<IMcpHandlerRegistrar> register); |
| 26 | |
| 27 | /// <summary>Собрать capability-map для introspection.</summary> |
| 28 | CapabilityMap BuildMap(); |
| 29 | } |
| 30 | |
| 31 | /// <summary>MCP handler registration callback (command id → async handler).</summary> |
| 32 | [ApiStability(ApiStability.Experimental)] |
| 33 | public interface IMcpHandlerRegistrar |
| 34 | { |
| 35 | void Add(string commandId, McpCommandHandler handler); |
| 36 | } |
| 37 | |
| 38 | /// <summary>Async MCP command handler invoked by the IDE MCP executor.</summary> |
| 39 | public delegate Task<string> McpCommandHandler( |
| 40 | IReadOnlyDictionary<string, System.Text.Json.JsonElement>? args, |
| 41 | CancellationToken cancellationToken); |
| 42 | |