[EPIC-GW-01] 步骤 1: 搭建 Gateway 独立进程骨架与 IPC 通信契约
目标 (Goal)
建立可独立运行的 neocode-gateway 进程,先跑通本地 IPC + Ping/Pong,作为后续适配器统一入口。
涉及范围 (Scope)
- 新增文件:
cmd/neocode-gateway/main.go
- 新增文件:
internal/gateway/transport/server.go
- 新增文件:
internal/gateway/transport/npipe_windows.go
- 新增文件:
internal/gateway/transport/uds_unix.go
- 新增文件:
internal/gateway/protocol/jsonrpc.go
- 新增文件:
internal/gateway/handlers/ping.go
- 新增文件:
internal/gateway/adapters/core_mock.go
- 新增文件:
internal/gateway/bootstrap.go
- 修改文件:
go.mod(仅新增 IPC 依赖,如 Windows Named Pipe 库)
- 不涉及范围:URL Scheme、剪贴板监听、悬浮窗、CLI/TUI 行为改造
实现清单 (Checklist / To-Do)
type CoreClient interface {
Ping(ctx context.Context) (string, error)
}
type RPCRequest struct {
JSONRPC string `json:"jsonrpc"`
ID string `json:"id,omitempty"`
Method string `json:"method"`
Params any `json:"params,omitempty"`
}
验收标准 (Acceptance Criteria)
依赖的前置 PR (Depends On)
[EPIC-GW-01] 步骤 1: 搭建 Gateway 独立进程骨架与 IPC 通信契约
目标 (Goal)
建立可独立运行的
neocode-gateway进程,先跑通本地 IPC +Ping/Pong,作为后续适配器统一入口。涉及范围 (Scope)
cmd/neocode-gateway/main.gointernal/gateway/transport/server.gointernal/gateway/transport/npipe_windows.gointernal/gateway/transport/uds_unix.gointernal/gateway/protocol/jsonrpc.gointernal/gateway/handlers/ping.gointernal/gateway/adapters/core_mock.gointernal/gateway/bootstrap.gogo.mod(仅新增 IPC 依赖,如 Windows Named Pipe 库)实现清单 (Checklist / To-Do)
auto/npipe/uds)。core.ping -> Pong处理器。验收标准 (Acceptance Criteria)
go run ./cmd/neocode-gateway能启动并监听本地 IPC。{"jsonrpc":"2.0","method":"core.ping"}能收到Pong。go test ./...通过。go run ./cmd/neocode行为无变化。依赖的前置 PR (Depends On)