Track runtime and handshake progress

This commit is contained in:
nav
2026-04-08 21:13:26 +00:00
parent 8c475f259a
commit 34a591dd0c
3 changed files with 32 additions and 2 deletions

View File

@@ -207,6 +207,9 @@
---
### YNX-0203 实现 Server 生命周期 wiring
**状态**
- [x] 已完成2026-04-08
**目标**
- 在 gateway 启动时初始化 Server 内部组件
@@ -221,6 +224,12 @@
- 启停流程完整
- 不会留下悬挂 timer / socket
**已完成内容**
- 已新增 `Yonexus.Server/plugin/core/runtime.ts`
- 已实现 `YonexusServerRuntime`,负责加载持久化记录、补齐 allowlist 默认 record、驱动 transport start/stop 与 shutdown 前持久化
- 已把连接会话映射进 `ServerRegistry.sessions`,并在断开时回收 session / 更新离线状态
- 已从 `Yonexus.Server/plugin/index.ts` 导出 runtime 入口,便于后续接入 OpenClaw lifecycle wiring
---
## Phase 3 — Client 插件脚手架
@@ -270,6 +279,9 @@
---
### YNX-0303 实现 Client 生命周期 wiring
**状态**
- [x] 已完成2026-04-08
**目标**
- 在 gateway 启动时初始化 Client 运行时
@@ -282,6 +294,12 @@
**验收标准**
- Client 可启动并在未连接状态下稳定运行
**已完成内容**
- 已新增 `Yonexus.Client/plugin/core/runtime.ts`
- 已实现 `YonexusClientRuntime`,负责加载本地 state、驱动 transport connect/disconnect并维护最小 phase 状态机
- 已将 lifecycle 状态从 `plugin/index.ts` 导出,便于后续挂接 gateway startup/shutdown
- 已把 hello 发送时机放到 transport 连接成功后统一触发,避免后续 handshake wiring 分散在多个入口
---
## Phase 4 — 持久化与状态模型
@@ -416,6 +434,9 @@
---
### YNX-0503 实现 hello / hello_ack
**状态**
- [x] 已完成2026-04-08
**目标**
- 完成连接后的第一段协议握手
@@ -430,6 +451,15 @@
- 已配对客户端收到 `auth_required`
- 非 allowlist 客户端被拒绝
**已完成内容**
- Client runtime 已在连接建立后发送 `hello`,内容包含 `identifier`、协议版本、`hasSecret``hasKeyPair` 与可选 `publicKey`
- Server runtime 已接入 builtin `hello` 处理,校验 allowlist 与协议版本,并返回 `hello_ack`
- `hello_ack.nextAction` 已按 record 状态区分为 `pair_required` / `waiting_pair_confirm` / `auth_required`
- 对非法 identifier 与不支持的协议版本已返回协议错误,并在版本不匹配时主动关闭连接
**进展说明**
- 本次只完成最小握手闭环;后续 `auth_request``pair_request` 等具体动作仍由 Phase 6/7 继续补齐
---
### YNX-0504 实现基础重连策略