From 3a6a7eb495688024b6c0fa2c16a605eaeef9f22e Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Thu, 30 Apr 2026 02:05:12 -0700 Subject: [PATCH] =?UTF-8?q?feat(connect):=20M1.1=20=E2=80=94=20Backend=20i?= =?UTF-8?q?nterface=20+=20connect=20skeleton=20+=20mock=20backend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First step toward `molecule connect ` — the out-of-box external- runtime workspace connector specified in RFC #10. What's in this PR (foundational, ~300 LOC of code + matching tests): - `internal/backends.Backend` — the seam every concrete handler implements: HandleA2A(ctx, Request) → Response, Close(). Two methods, no inheritance, no surprise side effects. Concurrency-safe by contract (poll dispatch may parallelise). - Request/Response/Part/Config types — lossless JSON-RPC mirror so backends can re-issue downstream without re-parsing. - Compile-time registry — `Register("name", factory)` from each backend's init(); `Build(name, cfg)` selects at runtime. Panics on duplicate registration so drift fails loudly at startup, not on first message. - `mock` backend — single-template echo for CI smoke + tests + demos. `--backend-opt reply="