fix(telemetry): discover agents from ~/.openclaw/agents and clean docs

- Fallback to agent directory discovery when agents.json is absent
- Count configured agent workspaces (excluding main)
- Rewrite plugin docs to API key-only flow
This commit is contained in:
zhi
2026-03-20 08:02:19 +00:00
parent 040cde8cad
commit ab42936408
3 changed files with 69 additions and 115 deletions

View File

@@ -42,7 +42,7 @@ HarborForge.OpenclawPlugin/
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
▼ HTTP/WebSocket
▼ HTTP
┌─────────────────────┐
│ HarborForge Monitor │
└─────────────────────┘
@@ -76,21 +76,26 @@ node scripts/install.mjs --verbose
## 配置
1. 在 HarborForge Monitor 中注册服务器,获取 `challengeUuid`
1. 在 HarborForge Monitor 中注册服务器,并生成 `apiKey`
2. 编辑 `~/.openclaw/openclaw.json`:
```json
{
"plugins": {
"harborforge-monitor": {
"enabled": true,
"backendUrl": "https://monitor.hangman-lab.top",
"identifier": "my-server-01",
"challengeUuid": "your-challenge-uuid-here",
"reportIntervalSec": 30,
"httpFallbackIntervalSec": 60,
"logLevel": "info"
"entries": {
"harborforge-monitor": {
"enabled": true,
"config": {
"enabled": true,
"backendUrl": "https://monitor.hangman-lab.top",
"identifier": "my-server-01",
"apiKey": "your-api-key-here",
"reportIntervalSec": 30,
"httpFallbackIntervalSec": 60,
"logLevel": "info"
}
}
}
}
}
@@ -109,7 +114,7 @@ openclaw gateway restart
| `enabled` | boolean | `true` | 是否启用插件 |
| `backendUrl` | string | `https://monitor.hangman-lab.top` | Monitor 后端地址 |
| `identifier` | string | 自动检测 hostname | 服务器标识符 |
| `challengeUuid` | string | 必填 | 注册挑战 UUID |
| `apiKey` | string | 必填 | HarborForge Monitor 生成的服务器 API Key |
| `reportIntervalSec` | number | `30` | 报告间隔(秒) |
| `httpFallbackIntervalSec` | number | `60` | HTTP 回退间隔(秒) |
| `logLevel` | string | `"info"` | 日志级别: debug/info/warn/error |
@@ -151,7 +156,7 @@ npm run build
```bash
cd server
HF_MONITOR_CHALLENGE_UUID=test-uuid \
HF_MONITOR_API_KEY=test-api-key \
HF_MONITOR_BACKEND_URL=http://localhost:8000 \
HF_MONITOR_LOG_LEVEL=debug \
node telemetry.mjs