This project uses Heredoc-style command blocks as a first-class documentation pattern for:
- Multi-line API payload examples
- Generated commit and PR body templates
- Operator runbook snippets that must preserve exact formatting
Use single-quoted EOF delimiters when examples contain variable-like tokens that must not expand.
- Prevents formatting drift in docs and automation snippets
- Keeps complex JSON/text payloads readable
- Matches conventions used in OpenClaw and adjacent tooling
The dashboard currently consumes these methods:
statusagents.listsessions.listcron.listcron.runsmodels.listhealthsystem-presenceusage.costusage.statustools.catalogskills.statuschannels.statuscron.statusdoctor.memory.statusconfig.getagents.files.list
Methods available upstream and now stable/callable (operator.read unless noted) — candidates for future ClawSprawl panels:
sessions.usage/sessions.usage.timeseries/sessions.usage.logs— per-session usage (private)commands.list— runtime command inventory per agent (private)tools.effective— session-scoped effective tool inventory (private)tts.status/tts.providers— TTS enabled state + provider inventory (private)last-heartbeat— latest persisted heartbeat (private)diagnostics.stability— bounded, payload-free stability recorder; recommended WS live-feed RPC (private)tasks.list/tasks.get— task ledger;tasks.cancel(operator.write) (private)audit.activity.list— durable metadata-only activity ledger (private)agents.workspace.list/agents.workspace.get— read-only workspace file browsing (private)artifacts.list/artifacts.get/artifacts.download— transcript-derived artifacts (private)gateway.identity.get— gateway device identity (private)logs.tail— configured gateway log tail (private)
Methods removed/renamed upstream (do not call): node.pair.request / node.pair.verify (removed in 2026.7 — use node.pair.list/approve/reject/remove + node.pair.requested/resolved events); sessions.observer.ask (use sessions.companion.ask).
And listens for event stream messages such as:
tickcronsession.messagehealthpresenceconfig.changedskills.changedsessions.changednode.presence/node.presence.activitytalk.event
ClawSprawl does not expose the raw gateway event feed publicly. Public browsers receive only invalidation events from /api/public/events; raw gateway events remain private-only.
cat <<'EOF' > /tmp/gateway-status.json
{
"type": "req",
"id": "manual-1",
"method": "status"
}
EOFcat <<'EOF' > /tmp/gateway-connect.json
{
"type": "req",
"id": "connect-1",
"method": "connect",
"params": {
"minProtocol": 3,
"maxProtocol": 4,
"client": {
"id": "openclaw-control-ui",
"version": "0.67.0",
"platform": "linux",
"mode": "webchat"
},
"auth": {
"token": "$OPENCLAW_GATEWAY_TOKEN"
},
"role": "operator",
"scopes": ["operator.read"]
}
}
EOFgh pr create --title "phase update" --body "$(cat <<'EOF'
## Summary
- Add feature X
- Harden behavior Y
## Validation
- npm run test
- npm run build
EOF
)"cat <<'EOF' > /tmp/incident-note.md
# Incident
## Symptom
Dashboard shows gateway connection error.
## Actions
1. Verify SSR server process
2. Verify OPENCLAW_GATEWAY_TOKEN is present
3. Use Retry Connection button
EOFcurl -i \
-X POST http://127.0.0.1:4321/api/private/session \
-H 'Content-Type: application/json' \
-d '{"token":"YOUR_PRIVATE_TOKEN"}'cat <<'EOF' > /tmp/clawsprawl-routes.txt
GET /api/public/dashboard.json
GET /api/public/events
POST /api/private/session
GET /api/private/dashboard.json
GET /api/private/events
GET /api/private/health.json
EOFPrimary source paths tied to API behavior:
src/lib/auth/access.tssrc/lib/gateway/client.tssrc/lib/gateway/protocol.tssrc/lib/dashboard/store.tssrc/lib/dashboard/bootstrap.tssrc/lib/dashboard/adapters.tssrc/lib/dashboard/renderers.tssrc/lib/dashboard/public-private.ts
If adding a new API method to the dashboard, update all of:
- gateway types (
src/lib/gateway/types.ts) - adapters/normalizers (
src/lib/dashboard/adapters.ts) - public/private shaping (
src/lib/dashboard/public-private.ts) - renderers (
src/lib/dashboard/renderers.ts) - render/bootstrap wiring (
src/lib/dashboard/bootstrap.ts) - tests (
src/lib/**.test.ts,tests/site-phases.test.ts) - this document (add the method to the consumed list above)
When adding new docs in this repo:
- Prefer executable snippets
- Use Heredoc for multi-line payloads
- Keep source path references explicit
- Include validation commands (
npm run test,npm run build)