| 1 | using System.Text.Json; |
| 2 | using OutWit.Database.Core.BouncyCastle; |
| 3 | |
| 4 | BouncyCastleProviderRegistration.EnsureRegistered(); |
| 5 | |
| 6 | using var session = new WitDbBridge.BridgeSession(); |
| 7 | using var stdin = Console.OpenStandardInput(); |
| 8 | using var reader = new StreamReader(stdin); |
| 9 | |
| 10 | string? line; |
| 11 | while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) is not null) |
| 12 | { |
| 13 | if (string.IsNullOrWhiteSpace(line)) |
| 14 | { |
| 15 | continue; |
| 16 | } |
| 17 | |
| 18 | using var request = JsonDocument.Parse(line); |
| 19 | using var response = session.Handle(request); |
| 20 | await Console.Out.WriteLineAsync(response.RootElement.GetRawText()).ConfigureAwait(false); |
| 21 | } |
| 22 | |
View only · write via MCP/CIDE