@dp-pcs/ogp 0.2.30 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/cli/federation.d.ts.map +1 -1
- package/dist/cli/federation.js +3 -1
- package/dist/cli/federation.js.map +1 -1
- package/dist/daemon/notify.d.ts +20 -0
- package/dist/daemon/notify.d.ts.map +1 -1
- package/dist/daemon/notify.js +165 -48
- package/dist/daemon/notify.js.map +1 -1
- package/dist/shared/config.d.ts +3 -0
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/shared/config.js.map +1 -1
- package/docs/TESTING-HERMES-BACKEND.md +278 -0
- package/docs/extending-to-hermes.md +462 -0
- package/docs/hermes-implementation-checklist.md +448 -0
- package/docs/hermes-local-testing.md +478 -0
- package/docs/hermes-tunnel-setup.md +214 -0
- package/docs/platform-agnostic-architecture.md +472 -0
- package/package.json +3 -2
- package/scripts/install-skills.js +142 -20
- package/skills/ogp-project/SKILL.md +321 -226
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Testing the Hermes Backend Implementation
|
|
2
|
+
|
|
3
|
+
> Verification guide for the platform-agnostic notification backend
|
|
4
|
+
|
|
5
|
+
## What Changed
|
|
6
|
+
|
|
7
|
+
The notification system now supports multiple AI platforms via a backend abstraction layer:
|
|
8
|
+
|
|
9
|
+
**Files Modified:**
|
|
10
|
+
- `src/shared/config.ts` - Added optional `platform`, `hermesWebhookUrl`, `hermesWebhookSecret` fields
|
|
11
|
+
- `src/daemon/notify.ts` - Implemented backend system with OpenClaw and Hermes backends
|
|
12
|
+
|
|
13
|
+
**Backward Compatibility:**
|
|
14
|
+
- ✅ All existing OpenClaw installations work unchanged
|
|
15
|
+
- ✅ Config without `platform` field defaults to `'openclaw'`
|
|
16
|
+
- ✅ All existing code paths preserved
|
|
17
|
+
- ✅ No breaking changes
|
|
18
|
+
|
|
19
|
+
## Test Plan
|
|
20
|
+
|
|
21
|
+
### Phase 1: Regression Testing (OpenClaw)
|
|
22
|
+
|
|
23
|
+
**Goal:** Verify existing OpenClaw integration still works perfectly.
|
|
24
|
+
|
|
25
|
+
1. **Verify OGP is currently working:**
|
|
26
|
+
```bash
|
|
27
|
+
ogp status
|
|
28
|
+
# Should show your existing OpenClaw configuration
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. **Check your config has no 'platform' field:**
|
|
32
|
+
```bash
|
|
33
|
+
cat ~/.ogp/config.json | grep platform
|
|
34
|
+
# Should return nothing (field doesn't exist)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. **Send a test message to an existing peer:**
|
|
38
|
+
```bash
|
|
39
|
+
ogp federation list
|
|
40
|
+
# Pick a peer you've already federated with
|
|
41
|
+
|
|
42
|
+
ogp federation send <peer-alias> message '{"text":"Test from feature/hermes-support branch"}'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. **Verify notification arrives in OpenClaw:**
|
|
46
|
+
- Check your Telegram/notification channel
|
|
47
|
+
- Should see the test message as before
|
|
48
|
+
- No changes in behavior
|
|
49
|
+
|
|
50
|
+
**Expected Result:** Everything works exactly as before. ✅
|
|
51
|
+
|
|
52
|
+
### Phase 2: Hermes Setup (If You Want to Test It)
|
|
53
|
+
|
|
54
|
+
**Goal:** Set up a second OGP instance for Hermes and test federation.
|
|
55
|
+
|
|
56
|
+
**Prerequisites:**
|
|
57
|
+
- Hermes installed and gateway running
|
|
58
|
+
- Ready to configure webhook
|
|
59
|
+
|
|
60
|
+
#### Step 1: Configure Hermes Webhook
|
|
61
|
+
|
|
62
|
+
Edit `~/.hermes/config.yaml`:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
platforms:
|
|
66
|
+
webhook:
|
|
67
|
+
enabled: true
|
|
68
|
+
port: 8644
|
|
69
|
+
host: "127.0.0.1"
|
|
70
|
+
routes:
|
|
71
|
+
ogp_federation:
|
|
72
|
+
secret: "test-secret-change-me" # Pick a secret
|
|
73
|
+
events: ["*"]
|
|
74
|
+
prompt: |
|
|
75
|
+
📡 **OGP Federation Test**
|
|
76
|
+
|
|
77
|
+
From: {{peer_display_name}} ({{peer_id}})
|
|
78
|
+
Intent: {{intent}}
|
|
79
|
+
Topic: {{topic}}
|
|
80
|
+
|
|
81
|
+
{{message}}
|
|
82
|
+
deliver: "telegram" # Or your preferred channel
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Restart Hermes gateway:**
|
|
86
|
+
```bash
|
|
87
|
+
hermes gateway restart
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Verify webhook is running:**
|
|
91
|
+
```bash
|
|
92
|
+
curl http://localhost:8644/health
|
|
93
|
+
# Should return: {"status":"ok"}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Step 2: Create OGP Instance for Hermes
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Create state directory
|
|
100
|
+
mkdir -p ~/.ogp-hermes
|
|
101
|
+
|
|
102
|
+
# Create config
|
|
103
|
+
cat > ~/.ogp-hermes/config.json <<'EOF'
|
|
104
|
+
{
|
|
105
|
+
"daemonPort": 18791,
|
|
106
|
+
"platform": "hermes",
|
|
107
|
+
"gatewayUrl": "http://localhost:18791",
|
|
108
|
+
"displayName": "David (Hermes)",
|
|
109
|
+
"email": "your-email@example.com",
|
|
110
|
+
"stateDir": "~/.ogp-hermes",
|
|
111
|
+
|
|
112
|
+
"hermesWebhookUrl": "http://localhost:8644/webhooks/ogp_federation",
|
|
113
|
+
"hermesWebhookSecret": "test-secret-change-me",
|
|
114
|
+
|
|
115
|
+
"openclawUrl": "",
|
|
116
|
+
"openclawToken": "",
|
|
117
|
+
|
|
118
|
+
"rendezvous": {
|
|
119
|
+
"enabled": false
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
EOF
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Note the differences:**
|
|
126
|
+
- `platform: "hermes"` (this activates the Hermes backend)
|
|
127
|
+
- `hermesWebhookUrl` and `hermesWebhookSecret` (for webhook POST)
|
|
128
|
+
- `openclawUrl` and `openclawToken` are empty (not used)
|
|
129
|
+
|
|
130
|
+
#### Step 3: Start Hermes OGP Instance
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Method 1: Direct daemon start
|
|
134
|
+
OGP_HOME=~/.ogp-hermes node dist/daemon/server.js &
|
|
135
|
+
|
|
136
|
+
# Save PID for later
|
|
137
|
+
echo $! > ~/.ogp-hermes/daemon.pid
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Verify it's running:**
|
|
141
|
+
```bash
|
|
142
|
+
curl http://localhost:18791/.well-known/ogp
|
|
143
|
+
# Should return OGP metadata
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Step 4: Test Local Federation
|
|
147
|
+
|
|
148
|
+
**From OpenClaw OGP to Hermes OGP:**
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Request federation
|
|
152
|
+
ogp federation request http://localhost:18791 --alias hermes-test
|
|
153
|
+
|
|
154
|
+
# Check pending (on Hermes side)
|
|
155
|
+
OGP_HOME=~/.ogp-hermes ogp federation list --status pending
|
|
156
|
+
|
|
157
|
+
# Note the peer ID and approve
|
|
158
|
+
OGP_HOME=~/.ogp-hermes ogp federation approve <peer-id> \
|
|
159
|
+
--intents message,agent-comms
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Send test message:**
|
|
163
|
+
```bash
|
|
164
|
+
ogp federation send hermes-test message '{"text":"Hello Hermes from OpenClaw!"}'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**What should happen:**
|
|
168
|
+
1. Message leaves OpenClaw OGP (port 18790)
|
|
169
|
+
2. Arrives at Hermes OGP (port 18791)
|
|
170
|
+
3. Doorman validates signature
|
|
171
|
+
4. OGP POSTs to Hermes webhook (port 8644)
|
|
172
|
+
5. You see message in Hermes delivery channel (Telegram/etc.)
|
|
173
|
+
|
|
174
|
+
**Check logs:**
|
|
175
|
+
```bash
|
|
176
|
+
# Hermes logs
|
|
177
|
+
tail -f ~/.hermes/logs/gateway.log
|
|
178
|
+
|
|
179
|
+
# Look for:
|
|
180
|
+
# [webhook] Received POST on route ogp_federation
|
|
181
|
+
# [webhook] Signature verified
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Phase 3: Cleanup (If You Tested Hermes)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Stop Hermes OGP
|
|
188
|
+
kill $(cat ~/.ogp-hermes/daemon.pid)
|
|
189
|
+
|
|
190
|
+
# Remove test state (optional)
|
|
191
|
+
# rm -rf ~/.ogp-hermes
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Verification Checklist
|
|
195
|
+
|
|
196
|
+
### OpenClaw (Must Pass)
|
|
197
|
+
- [ ] Existing OpenClaw OGP still runs
|
|
198
|
+
- [ ] Can send messages to existing peers
|
|
199
|
+
- [ ] Notifications arrive in OpenClaw
|
|
200
|
+
- [ ] `ogp status` shows correct info
|
|
201
|
+
- [ ] No errors in logs
|
|
202
|
+
|
|
203
|
+
### Hermes (Optional Testing)
|
|
204
|
+
- [ ] Hermes webhook receives POST
|
|
205
|
+
- [ ] Signature verification passes
|
|
206
|
+
- [ ] Message arrives in Hermes delivery channel
|
|
207
|
+
- [ ] Logs show successful notification
|
|
208
|
+
- [ ] Can federate with OpenClaw instance
|
|
209
|
+
|
|
210
|
+
## Troubleshooting
|
|
211
|
+
|
|
212
|
+
### Build Issues
|
|
213
|
+
|
|
214
|
+
**If TypeScript compilation fails:**
|
|
215
|
+
```bash
|
|
216
|
+
npm run build
|
|
217
|
+
# Check for errors, fix them, rebuild
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Runtime Issues
|
|
221
|
+
|
|
222
|
+
**OpenClaw notifications not working:**
|
|
223
|
+
1. Check config has no `platform` field (should default to 'openclaw')
|
|
224
|
+
2. Verify `openclawUrl` and `openclawHooksToken` still set
|
|
225
|
+
3. Check logs for errors
|
|
226
|
+
4. Try sending to a known-working peer
|
|
227
|
+
|
|
228
|
+
**Hermes webhook not receiving:**
|
|
229
|
+
1. Verify webhook secret matches in both configs
|
|
230
|
+
2. Check Hermes gateway is running: `curl http://localhost:8644/health`
|
|
231
|
+
3. Check Hermes OGP is running: `curl http://localhost:18791/.well-known/ogp`
|
|
232
|
+
4. Check Hermes logs: `tail -f ~/.hermes/logs/gateway.log`
|
|
233
|
+
|
|
234
|
+
**Signature verification fails:**
|
|
235
|
+
1. Secrets must match exactly:
|
|
236
|
+
- `hermesWebhookSecret` in `~/.ogp-hermes/config.json`
|
|
237
|
+
- `secret` in `~/.hermes/config.yaml` under `routes.ogp_federation`
|
|
238
|
+
2. No extra whitespace in secret values
|
|
239
|
+
3. Case sensitive
|
|
240
|
+
|
|
241
|
+
## Success Criteria
|
|
242
|
+
|
|
243
|
+
### Minimum (Must Pass)
|
|
244
|
+
- ✅ OpenClaw integration works unchanged
|
|
245
|
+
- ✅ No regression in existing functionality
|
|
246
|
+
- ✅ Code compiles without errors
|
|
247
|
+
|
|
248
|
+
### Full (Nice to Have)
|
|
249
|
+
- ✅ Hermes webhook receives messages
|
|
250
|
+
- ✅ Local OpenClaw ↔ Hermes federation works
|
|
251
|
+
- ✅ Both platforms can send/receive simultaneously
|
|
252
|
+
|
|
253
|
+
## Next Steps
|
|
254
|
+
|
|
255
|
+
After verification:
|
|
256
|
+
|
|
257
|
+
1. **If all tests pass:**
|
|
258
|
+
- Ready to merge feature branch
|
|
259
|
+
- Update CHANGELOG
|
|
260
|
+
- Version bump to 0.3.0
|
|
261
|
+
- Publish to npm
|
|
262
|
+
|
|
263
|
+
2. **If issues found:**
|
|
264
|
+
- Document them
|
|
265
|
+
- Fix on feature branch
|
|
266
|
+
- Re-test
|
|
267
|
+
|
|
268
|
+
3. **Future work:**
|
|
269
|
+
- Update CLI setup wizard for platform selection
|
|
270
|
+
- Add platform selection to `ogp setup`
|
|
271
|
+
- Documentation updates for Hermes users
|
|
272
|
+
- Integration tests for both platforms
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
**Branch:** `feature/hermes-support`
|
|
277
|
+
**Last Updated:** 2026-04-04
|
|
278
|
+
**Status:** Ready for Testing
|