Phase 9 (AI integration) complete -- AI agents can send/receive serial while the user watches live in the GUI, with the GUI as sole COM-port owner. - ETTerms.SerialMcp: stdio MCP server (net8.0 + ModelContextProtocol SDK) exposing serial_list / serial_attach / serial_write / serial_read (waitFor + timeoutMs) / serial_detach; forwards over named pipe. - GUI SerialBridgeServer (pipe etterms-serial) + SerialBridge endpoint; SessionPage.WriteFromAi echoes MCP-sourced TX tagged [AI] (magenta). - App icon: window title bar / taskbar / exe now use Choco_256x256.ico (embedded via AppAssets); title bar shows ETTerms Version vX.Y.Z. - About page: large Choco icon (Zoom, no crop). - Docs: ARCHITECTURE.md + CLAUDE.md mark Phase 9 done; docs/serial-mcp-guide.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
673 B
C#
18 lines
673 B
C#
using Microsoft.Extensions.DependencyInjection;
|
||
using Microsoft.Extensions.Hosting;
|
||
using Microsoft.Extensions.Logging;
|
||
|
||
// stdio MCP server:把 ETTerms GUI 持有的 serial session 暴露給 AI(Kiro / Claude CLI)。
|
||
// 自己不開 COM port,所有收發經 named pipe 轉給 GUI 的 SerialBridgeServer。
|
||
var builder = Host.CreateApplicationBuilder(args);
|
||
|
||
// stdio 傳輸:stdout 專供 JSON-RPC,log 一律走 stderr,否則會污染協議。
|
||
builder.Logging.AddConsole(o => o.LogToStandardErrorThreshold = LogLevel.Trace);
|
||
|
||
builder.Services
|
||
.AddMcpServer()
|
||
.WithStdioServerTransport()
|
||
.WithToolsFromAssembly();
|
||
|
||
await builder.Build().RunAsync();
|