feat(gateway): add node capability negotiation foundation
This commit is contained in:
@@ -21,6 +21,7 @@ The gateway provides:
|
||||
- **JSON-RPC 2.0**: Structured request/response protocol
|
||||
- **Streaming Events**: Real-time updates during agent processing
|
||||
- **HTTP Server**: Serves static dashboard and handles webhook endpoints
|
||||
- **Node Capability Negotiation**: Optional companion-node role/capability registration
|
||||
|
||||
### Execution Model (Sessions + Per-Session Queue)
|
||||
|
||||
@@ -563,6 +564,50 @@ When queue policy rejects/supersedes a request before execution, the server emit
|
||||
|
||||
Cancel the current agent operation.
|
||||
|
||||
### Node Methods
|
||||
|
||||
#### `node.register`
|
||||
|
||||
Register node role/capabilities for the current WebSocket connection.
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"id": 9,
|
||||
"method": "node.register",
|
||||
"params": {
|
||||
"nodeId": "companion-desktop",
|
||||
"role": "companion",
|
||||
"protocolVersion": 1,
|
||||
"capabilities": ["ui.canvas", "notifications"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": 9,
|
||||
"result": {
|
||||
"registered": true,
|
||||
"node": { "id": "companion-desktop", "role": "companion" },
|
||||
"protocol": { "serverVersion": 1, "clientVersion": 1, "negotiatedVersion": 1 },
|
||||
"capabilities": {
|
||||
"declared": ["ui.canvas", "notifications"],
|
||||
"enabled": ["ui.canvas", "notifications"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### `node.capabilities.get`
|
||||
|
||||
Return negotiated capabilities for the currently registered node connection.
|
||||
|
||||
#### `system.capabilities`
|
||||
|
||||
Return gateway protocol version, node policy status, and feature-gate snapshot.
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
|
||||
+31
-4
@@ -33,10 +33,10 @@
|
||||
"test_status": "pnpm test:run src/gateway/lane-queue.test.ts src/gateway/handlers/agent.test.ts src/config/schema.test.ts + pnpm typecheck passing"
|
||||
},
|
||||
"openclaw-gap-next-steps-3phase": {
|
||||
"status": "in_progress",
|
||||
"status": "completed",
|
||||
"date": "2026-02-16",
|
||||
"updated": "2026-02-16",
|
||||
"summary": "Defined and began executing a concrete 3-phase implementation plan for remaining high-impact OpenClaw parity work: queue policy parity v2, channel reach expansion (Mattermost first), and companion-node capability negotiation foundation.",
|
||||
"summary": "Completed the 3-phase implementation plan for remaining high-impact OpenClaw parity gaps: queue policy parity v2, Mattermost channel expansion, and companion-node capability negotiation foundation.",
|
||||
"file": "2026-02-16-openclaw-gap-next-steps-3phase.md"
|
||||
},
|
||||
"openclaw-gap-phase1-queue-parity-v2": {
|
||||
@@ -92,6 +92,33 @@
|
||||
],
|
||||
"test_status": "pnpm test:run src/channels/mattermost/adapter.test.ts src/daemon/channels.test.ts src/config/schema.test.ts src/gateway/handlers/services.test.ts src/gateway/handlers/handlers.test.ts + pnpm typecheck + pnpm build passing"
|
||||
},
|
||||
"openclaw-gap-phase3-node-capability-foundation": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-16",
|
||||
"updated": "2026-02-16",
|
||||
"summary": "Completed companion-node foundation: protocol payload typing + parsing, node registration/capability handlers (`node.register`, `node.capabilities.get`, `system.capabilities`), connection-level node state tracking, scoped node RPC authorization, node policy config (`server.nodes.*`), docs, and tests.",
|
||||
"files_created": [
|
||||
"src/gateway/handlers/node.ts",
|
||||
"src/gateway/handlers/node.test.ts"
|
||||
],
|
||||
"files_modified": [
|
||||
"src/gateway/protocol.ts",
|
||||
"src/gateway/protocol.test.ts",
|
||||
"src/gateway/auth.ts",
|
||||
"src/gateway/auth.test.ts",
|
||||
"src/gateway/handlers/index.ts",
|
||||
"src/gateway/router.ts",
|
||||
"src/gateway/server.ts",
|
||||
"src/gateway/server.test.ts",
|
||||
"src/config/schema.ts",
|
||||
"src/config/schema.test.ts",
|
||||
"src/daemon/services.ts",
|
||||
"config/default.yaml",
|
||||
"README.md",
|
||||
"docs/api/PROTOCOL.md"
|
||||
],
|
||||
"test_status": "pnpm test:run src/gateway/protocol.test.ts src/gateway/auth.test.ts src/gateway/handlers/node.test.ts src/gateway/server.test.ts src/config/schema.test.ts + pnpm typecheck + pnpm build passing"
|
||||
},
|
||||
"docs-gateway-auth-config-keys": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-15",
|
||||
@@ -3015,12 +3042,12 @@
|
||||
"tier2_completion": "4/4 (100%) — inbound webhooks, vector memory search, Dockerfile, heartbeat monitor",
|
||||
"tier3_completion": "5/5 (100%) — lane queue, credential redaction, web UI token dashboard, xAI (Grok) provider, Voyage AI embeddings",
|
||||
"tier4_completion": "4/4 (100%) — gateway lock, shell completion, Tailscale Serve/Funnel, DM pairing codes",
|
||||
"feature_gap_scorecard": "117/128 match (91%), 0 partial (0%), 11 missing (9%)",
|
||||
"feature_gap_scorecard": "118/128 match (92%), 0 partial (0%), 10 missing (8%)",
|
||||
"operator_dx_milestone": "Phase 3 (Live Ops Dashboard): 2/2 plans complete — milestone done",
|
||||
"gmail_auth_cli": "flynn gmail-auth command implemented with OAuth2 flow, doctor check, config routed to Telegram",
|
||||
"native_audio_support": "completed — smart routing for native audio (Gemini/OpenAI/GitHub) vs Whisper transcription fallback",
|
||||
"remaining_phases_completion": "Phase 1: 3/3 (100%) — context levels, command registry, memory structure. Phase 2: 3/3 (100%) — component registry, confidence routing, history index. Phase 3: 2/2 (100%) — adaptive memory/compaction, truthfulness/autonomy hardening",
|
||||
"next_up": "OpenClaw gap phase 3: companion-node capability/version negotiation foundation"
|
||||
"next_up": "OpenClaw gap: Location access (open next scoped implementation checklist)"
|
||||
},
|
||||
"soul_md_and_cron_create": {
|
||||
"date": "2026-02-11",
|
||||
|
||||
Reference in New Issue
Block a user