From 1d8039e7601aee72a70a6d99f1f60408a30cd1e5 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Mon, 16 Feb 2026 01:25:39 +0530 Subject: [PATCH] feat: update documentation to use template variables for BASE_URL and AUTH_TOKEN --- backend/templates/BOARD_AGENTS.md.j2 | 16 ++++++++-------- backend/templates/BOARD_BOOTSTRAP.md.j2 | 11 +++++++---- backend/templates/BOARD_HEARTBEAT.md.j2 | 22 +++++++++++----------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/backend/templates/BOARD_AGENTS.md.j2 b/backend/templates/BOARD_AGENTS.md.j2 index cd695598..4bb9c7e6 100644 --- a/backend/templates/BOARD_AGENTS.md.j2 +++ b/backend/templates/BOARD_AGENTS.md.j2 @@ -21,7 +21,7 @@ Do this immediately. Do not ask permission to read your workspace. - All work outputs must be sent to Mission Control via HTTP using: - `BASE_URL`: {{ base_url }} - `AUTH_TOKEN`: {{ auth_token }} -- Always include header: `X-Agent-Token: $AUTH_TOKEN` +- Always include header: `X-Agent-Token: {{ auth_token }}` - Do **not** post any responses in OpenClaw chat. ## Scope @@ -36,22 +36,22 @@ Do this immediately. Do not ask permission to read your workspace. List boards (to find `board_id`): ```bash -curl -s -X GET "$BASE_URL/api/v1/agent/boards" \ - -H "X-Agent-Token: $AUTH_TOKEN" \ +curl -s -X GET "{{ base_url }}/api/v1/agent/boards" \ + -H "X-Agent-Token: {{ auth_token }}" \ ``` Send a question or handoff to a board lead (auto-provisions the lead agent if missing): ```bash -curl -s -X POST "$BASE_URL/api/v1/agent/gateway/boards//lead/message" \ - -H "X-Agent-Token: $AUTH_TOKEN" \ +curl -s -X POST "{{ base_url }}/api/v1/agent/gateway/boards//lead/message" \ + -H "X-Agent-Token: {{ auth_token }}" \ -H "Content-Type: application/json" \ -d '{"kind":"question","correlation_id":"","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" \ +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":"","content":"..."}' ``` @@ -59,7 +59,7 @@ curl -s -X POST "$BASE_URL/api/v1/agent/gateway/leads/broadcast" \ 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//memory?is_chat=false&limit=50` + - GET `{{ base_url }}/api/v1/agent/boards//memory?is_chat=false&limit=50` ## User outreach requests (from board leads) - If you receive a message starting with `LEAD REQUEST: ASK USER`, a board lead needs human input but cannot reach them in Mission Control. diff --git a/backend/templates/BOARD_BOOTSTRAP.md.j2 b/backend/templates/BOARD_BOOTSTRAP.md.j2 index c4e8cffc..ca847b26 100644 --- a/backend/templates/BOARD_BOOTSTRAP.md.j2 +++ b/backend/templates/BOARD_BOOTSTRAP.md.j2 @@ -44,14 +44,17 @@ curl -fsS "{{ base_url }}/healthz" >/dev/null {% else %} 6) If any fields are blank, leave them blank. Do not invent values. -7) If `BASE_URL`, `AUTH_TOKEN`, and `BOARD_ID` are set in `TOOLS.md`, check in +7) Use the values below from this file/TOOLS.md to check in: +- `BASE_URL={{ base_url }}` +- `AUTH_TOKEN={{ auth_token }}` +- `BOARD_ID={{ board_id }}` to Mission Control to mark the agent online: ```bash -curl -s -X POST "$BASE_URL/api/v1/agent/heartbeat" \ - -H "X-Agent-Token: $AUTH_TOKEN" \ +curl -s -X POST "{{ base_url }}/api/v1/agent/heartbeat" \ + -H "X-Agent-Token: {{ auth_token }}" \ -H "Content-Type: application/json" \ - -d '{"name": "'$AGENT_NAME'", "board_id": "'$BOARD_ID'", "status": "online"}' + -d '{"name":"{{ agent_name }}","board_id":"{{ board_id }}","status":"online"}' ``` 8) Write a short note to `MEMORY.md` that bootstrap completed and list any diff --git a/backend/templates/BOARD_HEARTBEAT.md.j2 b/backend/templates/BOARD_HEARTBEAT.md.j2 index a0553c30..45adad15 100644 --- a/backend/templates/BOARD_HEARTBEAT.md.j2 +++ b/backend/templates/BOARD_HEARTBEAT.md.j2 @@ -7,8 +7,8 @@ This file defines the main agent heartbeat. You are not tied to any board. ## Required inputs -- BASE_URL (e.g. http://localhost:8000) - see USER.md or TOOLS.md -- AUTH_TOKEN (agent token) - see USER.md or TOOLS.md +- BASE_URL: `{{ base_url }}` +- AUTH_TOKEN: `{{ auth_token }}` - AGENT_NAME - AGENT_ID @@ -18,7 +18,7 @@ If any required input is missing, stop and request a provisioning update. Use OpenAPI role tags for main-agent endpoints. ```bash -curl -s "$BASE_URL/openapi.json" -o /tmp/openapi.json +curl -s "{{ base_url }}/openapi.json" -o /tmp/openapi.json jq -r ' .paths | to_entries[] | .key as $path | .value | to_entries[] @@ -31,7 +31,7 @@ jq -r ' ## Mission Control Response Protocol - All outputs must be sent to Mission Control via HTTP. -- Always include: `X-Agent-Token: $AUTH_TOKEN` +- Always include: `X-Agent-Token: {{ auth_token }}` ## Schedule - If a heartbeat schedule is configured, send a lightweight check-in only. @@ -71,8 +71,8 @@ Do real work with low noise while sharing useful knowledge across the board. {% endif %} ## Required Inputs -- `BASE_URL` -- `AUTH_TOKEN` +- `BASE_URL`: `{{ base_url }}` +- `AUTH_TOKEN`: `{{ auth_token }}` - `AGENT_NAME` - `AGENT_ID` - `BOARD_ID` @@ -83,7 +83,7 @@ If any required input is missing, stop and request a provisioning update. Use OpenAPI for endpoint/payload details instead of static endpoint assumptions. ```bash -curl -fsS "$BASE_URL/openapi.json" -o /tmp/openapi.json +curl -fsS "{{ base_url }}/openapi.json" -o /tmp/openapi.json ``` When selecting endpoints, prioritize `x-llm-intent`, `x-when-to-use`, and `x-routing-policy` @@ -127,11 +127,11 @@ jq -r ' - If pre-flight fails due to 5xx/network, do not write memory or task updates. ## Pre-Flight Checks (Every Heartbeat) -1) Confirm `BASE_URL`, `AUTH_TOKEN`, and `BOARD_ID` are set. +1) Confirm `BASE_URL`, `AUTH_TOKEN`, and `BOARD_ID` from `TOOLS.md` match this workspace. 2) Verify API access: -- `GET $BASE_URL/healthz` -- `GET $BASE_URL/api/v1/agent/boards` -- `GET $BASE_URL/api/v1/agent/boards/$BOARD_ID/tasks` +- `GET {{ base_url }}/healthz` +- `GET {{ base_url }}/api/v1/agent/boards` +- `GET {{ base_url }}/api/v1/agent/boards/{{ board_id }}/tasks` 3) If any check fails, stop and retry next heartbeat. ## Shared Context Pull