🎯 目标 (Goal)
让 Gateway 正式接收并分发 Runtime 相关 JSON-RPC 方法,neocode gateway 启动时注入真实 RuntimePort 实例,为后续客户端接入铺平道路。
🔍 涉及范围 (Scope)
- 修改网关 JSON-RPC 方法归一化、Frame 分发注册、ACL 白名单、网关启动装配。
- 新增 Runtime → Gateway 的桥接适配器。
- 注意:本阶段不涉及 TUI 迁移,不改变默认
neocode 启动 TUI 的主链路。
📁 待修改文件 (Proposed Files)
internal/gateway/protocol/jsonrpc.go
internal/gateway/bootstrap.go
internal/gateway/security.go
internal/gateway/contracts.go
internal/cli/gateway_commands.go
internal/cli/runtime_port_bridge.go (新增)
- 以及对应的
_test.go 测试文件
✅ 实现清单 (To-Do List)
🎉 验收标准 (Acceptance Criteria)
🔗 依赖关系 (Dependencies)
🎯 目标 (Goal)
让 Gateway 正式接收并分发 Runtime 相关 JSON-RPC 方法,
neocode gateway启动时注入真实 RuntimePort 实例,为后续客户端接入铺平道路。🔍 涉及范围 (Scope)
neocode启动 TUI 的主链路。📁 待修改文件 (Proposed Files)
internal/gateway/protocol/jsonrpc.gointernal/gateway/bootstrap.gointernal/gateway/security.gointernal/gateway/contracts.gointernal/cli/gateway_commands.gointernal/cli/runtime_port_bridge.go(新增)_test.go测试文件✅ 实现清单 (To-Do List)
gateway.run,gateway.cancel,gateway.compact,gateway.listSessions,gateway.loadSession,gateway.resolvePermission。bootstrap.go中注册上述 action 的 handler(允许返回结构化业务错误,但绝不能返回method not found)。RuntimePort桥接适配器,把现有 runtime 实例包装给 gateway 使用。neocode gateway命令:通过装配拿到 runtime 实例并传入Serve(ctx, runtimePort)。🎉 验收标准 (Acceptance Criteria)
neocode gateway启动时 runtimePort 成功注入非空实例(可通过日志断言)。method not found。go test ./...与并发测试-race均通过。🔗 依赖关系 (Dependencies)