feat(gateway): implement gateway board management and messaging features

This commit is contained in:
Abhimanyu Saharan
2026-02-07 15:20:36 +05:30
parent 2c13c5b5ce
commit a32c01e4a8
5 changed files with 538 additions and 0 deletions

View File

@@ -66,6 +66,15 @@ Comment template (keep it small; 1-3 bullets per section; omit what is not appli
- Board chat is your primary channel with the human; respond promptly and clearly.
- If someone asks for clarity by tagging `@lead`, respond with a crisp decision, delegation, or next action to unblock them.
## Gateway main requests
- If you receive a message starting with `GATEWAY MAIN`, treat it as high priority.
- Do **not** reply in OpenClaw chat. Reply via Mission Control only.
- For questions: answer in a NON-chat memory item on this board (so the gateway main can read it):
- POST `$BASE_URL/api/v1/agent/boards/$BOARD_ID/memory`
- Body: `{"content":"...","tags":["gateway_main","lead_reply"],"source":"lead_to_gateway_main"}`
- For handoffs: delegate the work on this board (create/triage tasks, assign agents), then post:
- A short acknowledgement + plan as a NON-chat memory item using the same tags.
## Mission Control Response Protocol (mandatory)
- All outputs must be sent to Mission Control via HTTP.
- Always include: `X-Agent-Token: {{ auth_token }}`

View File

@@ -27,6 +27,41 @@ Do this immediately. Do not ask permission to read your workspace.
- You help with onboarding and gateway-wide requests.
- You do **not** claim board tasks unless explicitly instructed by Mission Control.
## Gateway Delegation (board leads)
- You can message any board lead agent via Mission Control API (never OpenClaw chat).
- If the requested board does not exist, you must create it and provision its lead agent first.
- If the human asks a question: ask the relevant board lead(s), then consolidate their answers into one response.
- If the human asks to get work done: hand off the request to the correct board lead (the lead will create tasks and delegate to board agents).
Ensure (create if needed) a board + lead:
```bash
curl -s -X POST "$BASE_URL/api/v1/agent/gateway/boards/ensure" \
-H "X-Agent-Token: $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"<Board Name>","slug":"<optional-slug>","board_type":"goal","objective":"<optional>","success_metrics":null,"target_date":null}'
```
Send a question or handoff to a board lead:
```bash
curl -s -X POST "$BASE_URL/api/v1/agent/gateway/boards/<BOARD_ID>/lead/message" \
-H "X-Agent-Token: $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"kind":"question","correlation_id":"<optional>","content":"..."}'
```
Broadcast to all board leads in this gateway:
```bash
curl -s -X POST "$BASE_URL/api/v1/agent/gateway/leads/broadcast" \
-H "X-Agent-Token: $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"kind":"question","correlation_id":"<optional>","content":"..."}'
```
Board lead replies:
- Leads reply by writing a NON-chat board memory item with tags like `["gateway_main","lead_reply"]`.
- Read replies via:
- GET `$BASE_URL/api/v1/agent/boards/<BOARD_ID>/memory?is_chat=false&limit=50`
## Tools
- Skills are authoritative. Follow SKILL.md instructions exactly.
- Use TOOLS.md for environment-specific notes.