@dp-pcs/ogp 0.3.3 → 0.4.2

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.
Files changed (95) hide show
  1. package/README.md +275 -49
  2. package/dist/cli/completion.d.ts +5 -0
  3. package/dist/cli/completion.d.ts.map +1 -0
  4. package/dist/cli/completion.js +148 -0
  5. package/dist/cli/completion.js.map +1 -0
  6. package/dist/cli/config.d.ts +3 -0
  7. package/dist/cli/config.d.ts.map +1 -0
  8. package/dist/cli/config.js +207 -0
  9. package/dist/cli/config.js.map +1 -0
  10. package/dist/cli/expose.d.ts.map +1 -1
  11. package/dist/cli/expose.js +20 -13
  12. package/dist/cli/expose.js.map +1 -1
  13. package/dist/cli/federation.d.ts.map +1 -1
  14. package/dist/cli/federation.js +182 -6
  15. package/dist/cli/federation.js.map +1 -1
  16. package/dist/cli/setup.d.ts +19 -0
  17. package/dist/cli/setup.d.ts.map +1 -1
  18. package/dist/cli/setup.js +507 -32
  19. package/dist/cli/setup.js.map +1 -1
  20. package/dist/cli.js +348 -32
  21. package/dist/cli.js.map +1 -1
  22. package/dist/daemon/agent-comms.d.ts.map +1 -1
  23. package/dist/daemon/agent-comms.js +14 -9
  24. package/dist/daemon/agent-comms.js.map +1 -1
  25. package/dist/daemon/intent-registry.d.ts.map +1 -1
  26. package/dist/daemon/intent-registry.js +7 -4
  27. package/dist/daemon/intent-registry.js.map +1 -1
  28. package/dist/daemon/keypair.d.ts.map +1 -1
  29. package/dist/daemon/keypair.js +34 -13
  30. package/dist/daemon/keypair.js.map +1 -1
  31. package/dist/daemon/message-handler.d.ts.map +1 -1
  32. package/dist/daemon/message-handler.js +7 -0
  33. package/dist/daemon/message-handler.js.map +1 -1
  34. package/dist/daemon/notify.d.ts +19 -0
  35. package/dist/daemon/notify.d.ts.map +1 -1
  36. package/dist/daemon/notify.js +329 -73
  37. package/dist/daemon/notify.js.map +1 -1
  38. package/dist/daemon/openclaw-bridge.d.ts +34 -0
  39. package/dist/daemon/openclaw-bridge.d.ts.map +1 -0
  40. package/dist/daemon/openclaw-bridge.js +261 -0
  41. package/dist/daemon/openclaw-bridge.js.map +1 -0
  42. package/dist/daemon/peers.d.ts +8 -0
  43. package/dist/daemon/peers.d.ts.map +1 -1
  44. package/dist/daemon/peers.js +48 -14
  45. package/dist/daemon/peers.js.map +1 -1
  46. package/dist/daemon/projects.d.ts.map +1 -1
  47. package/dist/daemon/projects.js +7 -4
  48. package/dist/daemon/projects.js.map +1 -1
  49. package/dist/daemon/server.d.ts +16 -0
  50. package/dist/daemon/server.d.ts.map +1 -1
  51. package/dist/daemon/server.js +147 -46
  52. package/dist/daemon/server.js.map +1 -1
  53. package/dist/shared/config.d.ts +52 -1
  54. package/dist/shared/config.d.ts.map +1 -1
  55. package/dist/shared/config.js +18 -11
  56. package/dist/shared/config.js.map +1 -1
  57. package/dist/shared/framework-detection.d.ts +31 -0
  58. package/dist/shared/framework-detection.d.ts.map +1 -0
  59. package/dist/shared/framework-detection.js +91 -0
  60. package/dist/shared/framework-detection.js.map +1 -0
  61. package/dist/shared/help.d.ts +5 -0
  62. package/dist/shared/help.d.ts.map +1 -0
  63. package/dist/shared/help.js +280 -0
  64. package/dist/shared/help.js.map +1 -0
  65. package/dist/shared/meta-config.d.ts +44 -0
  66. package/dist/shared/meta-config.d.ts.map +1 -0
  67. package/dist/shared/meta-config.js +89 -0
  68. package/dist/shared/meta-config.js.map +1 -0
  69. package/dist/shared/migration.d.ts +57 -0
  70. package/dist/shared/migration.d.ts.map +1 -0
  71. package/dist/shared/migration.js +255 -0
  72. package/dist/shared/migration.js.map +1 -0
  73. package/docs/CLI-REFERENCE.md +1360 -0
  74. package/docs/GETTING-STARTED.md +942 -0
  75. package/docs/MIGRATION.md +202 -0
  76. package/docs/MULTI-FRAMEWORK-DEMO.md +352 -0
  77. package/docs/MULTI-FRAMEWORK-DESIGN.md +378 -0
  78. package/docs/MULTI-FRAMEWORK-IMPL.md +197 -0
  79. package/docs/case-studies/CRASH_RESOLUTION_20260407.md +190 -0
  80. package/docs/case-studies/OpenClaw_Hermes_Status_Report_20260407.md +142 -0
  81. package/docs/case-studies/OpenClaw_Stability_Fix_Summary.md +209 -0
  82. package/docs/case-studies/README.md +40 -0
  83. package/docs/case-studies/crash_observations.md +250 -0
  84. package/docs/federation-flow.md +21 -31
  85. package/docs/hermes-implementation-checklist.md +4 -0
  86. package/docs/rendezvous.md +13 -14
  87. package/package.json +9 -3
  88. package/scripts/completion.bash +123 -0
  89. package/scripts/completion.zsh +372 -0
  90. package/scripts/test-migration-execute.js +74 -0
  91. package/scripts/test-migration.js +42 -0
  92. package/skills/ogp/SKILL.md +197 -64
  93. package/skills/ogp-agent-comms/SKILL.md +107 -41
  94. package/skills/ogp-expose/SKILL.md +84 -21
  95. package/skills/ogp-project/SKILL.md +66 -58
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  skill_name: ogp
3
- version: 2.2.1
3
+ version: 2.5.0
4
4
  description: >
5
5
  OGP (Open Gateway Protocol) — federated agent communication, peer management,
6
- and project collaboration across OpenClaw gateways. Use when the user asks to
7
- establish federation with a peer, send agent-to-agent messages, check peer status,
8
- manage federation scopes, set up cross-gateway project collaboration, or use the
9
- rendezvous/invite flow for zero-config peer discovery.
6
+ and project collaboration across OpenClaw and Hermes gateways. Use when the user
7
+ asks to establish federation with a peer, send agent-to-agent messages, check peer
8
+ status, manage federation scopes, clean stale federation state, set up cross-gateway
9
+ project collaboration, or use the optional rendezvous/invite flow for discovery and short join codes.
10
10
  trigger: Use when the user asks to federate with a peer, connect to another gateway,
11
11
  send an OGP message, check peer status, grant scopes, manage OGP federation relationships,
12
12
  generate an invite code, or accept a federation invite.
@@ -14,8 +14,11 @@ requires:
14
14
  bins:
15
15
  - ogp
16
16
  state_paths:
17
+ - ~/.ogp-meta/config.json
17
18
  - ~/.ogp/config.json
18
19
  - ~/.ogp/peers.json
20
+ - ~/.ogp-hermes/config.json
21
+ - ~/.ogp-hermes/peers.json
19
22
  install: npm install -g @dp-pcs/ogp
20
23
  docs: https://github.com/dp-pcs/ogp
21
24
  ---
@@ -27,7 +30,9 @@ OGP must be installed and running:
27
30
  ```bash
28
31
  npm install -g @dp-pcs/ogp
29
32
  ogp setup # interactive first-time setup
30
- ogp start # starts the OGP daemon
33
+ ogp agent-comms interview # revisit delegated-authority / human-delivery behavior
34
+ ogp config show # verify enabled frameworks + default
35
+ ogp start # starts the default framework
31
36
  ogp status # verify daemon is running
32
37
  ```
33
38
 
@@ -35,21 +40,68 @@ If `ogp: command not found`, install it first.
35
40
 
36
41
  ---
37
42
 
38
- ## Known Peers (OGP 0.2.24+)
43
+ ## Framework Selection (Mandatory in Multi-Framework Setups)
39
44
 
40
- | Peer ID | Name | Gateway URL |
41
- |---------|------|-------------|
42
- | `302a300506032b65` | Stanislav | Dynamic — use invite flow |
43
- | `738064beab1ef8eb` | Clawporate (David) | https://david-proctor.gw.clawporate.elelem.expert |
45
+ When more than one framework is enabled, always choose the correct one explicitly:
44
46
 
45
- > **Peer IDs are public key prefixes (first 16 chars).** They never change, even when tunnel URLs rotate. Gateway URL is just the address — the public key is the identity.
47
+ ```bash
48
+ ogp --for openclaw status
49
+ ogp --for hermes status
50
+ ogp --for openclaw federation list
51
+ ogp --for hermes federation list
52
+ ```
53
+
54
+ - `openclaw` usually uses `~/.ogp`
55
+ - `hermes` usually uses `~/.ogp-hermes`
56
+ - `ogp config show` is the first command to run if the active framework is unclear
57
+
58
+ If you are testing unreleased changes from a local repo checkout, prefer the local CLI:
59
+
60
+ ```bash
61
+ node dist/cli.js --for openclaw status
62
+ node dist/cli.js --for hermes federation list
63
+ ```
64
+
65
+ ### CLI Discovery Shortcuts
66
+
67
+ When the user is unsure which command to run, teach the built-in CLI discovery path before inventing custom guidance:
68
+
69
+ ```bash
70
+ ogp ? # top-level command map
71
+ ogp federation approve ? # contextual help for approval
72
+ ogp config show # inspect configured/default framework
73
+ ogp config set-default openclaw
74
+ ogp completion install zsh # or bash
75
+ ```
76
+
77
+ - Prefer `ogp config show` first when framework context is unclear.
78
+ - Prefer `ogp config set-default <framework>` when the user keeps forgetting `--for`.
79
+ - Mention `ogp completion install <shell>` for users who will work with OGP often.
46
80
 
47
81
  ---
48
82
 
49
- ## Zero-Config Federation (v0.2.14+) ⭐ PREFERRED
83
+ ## Canonical Public Endpoint Rule
50
84
 
51
- The rendezvous server (`rendezvous.elelem.expert`) enables peer discovery by public key.
52
- No port forwarding, no tunnel accounts, no manual URL sharing.
85
+ Use one canonical public gateway URL per framework. The recommended production setup is a stable HTTPS hostname, typically behind a named Cloudflare tunnel or other reverse proxy.
86
+
87
+ - Keep `gatewayUrl` pointed at the stable public hostname
88
+ - Do not leave stale temporary tunnel residue in config
89
+ - Verify the public discovery card matches the local framework you intend to use
90
+
91
+ ```bash
92
+ curl -s https://ogp.example.com/.well-known/ogp
93
+ curl -s https://hermes.example.com/.well-known/ogp
94
+ ```
95
+
96
+ The public key on each discovery card must match the intended framework identity. If two frameworks advertise the same key unexpectedly, stop and fix framework selection/state isolation before federating.
97
+
98
+ ---
99
+
100
+ ## Optional Rendezvous Discovery (v0.2.14+)
101
+
102
+ The rendezvous server (`rendezvous.elelem.expert`) is an optional discovery/invite service.
103
+ Use it for pubkey lookup or short invite codes when peers are already publicly reachable.
104
+ Do not treat it as NAT traversal or a substitute for a real public gateway URL.
53
105
 
54
106
  ### Invite flow (easiest — v0.2.15+)
55
107
 
@@ -69,7 +121,7 @@ ogp federation accept <token>
69
121
  ### Connect by public key (v0.2.14+)
70
122
  ```bash
71
123
  ogp federation connect <pubkey>
72
- # Looks up peer's current IP:port from rendezvous, connects directly
124
+ # Looks up the peer's current connection hints from rendezvous, then connects directly
73
125
  ```
74
126
 
75
127
  ### Enable rendezvous in config
@@ -119,9 +171,12 @@ Which agent owns this gateway? (number or ID) [1]:
119
171
 
120
172
  The `notifyTargets` field enables per-agent notification routing. When OGP sends notifications to your OpenClaw instance, it routes to specific agents based on the message context.
121
173
 
174
+ For OpenClaw specifically, human-facing federated work is now handled primarily through `POST /hooks/agent`, not by guessing the "current" session. `notifyTargets` answers "which local agent owns this work?" while `humanDeliveryTarget` answers "where should the human-facing followup go?"
175
+
122
176
  **Configuration fields:**
123
177
  - **`notifyTarget`** (legacy, string): Single notification target for all messages. Maintained for backward compatibility.
124
178
  - **`notifyTargets`** (object): Map of agent names to notification targets. Example: `{"main": "telegram:...", "scribe": "telegram:..."}`
179
+ - **`humanDeliveryTarget`** (preferred for human-facing followups): Explicit destination for OGP-triggered relay obligations and summaries.
125
180
 
126
181
  **Example configuration with multiple agents:**
127
182
 
@@ -136,6 +191,10 @@ The `notifyTargets` field enables per-agent notification routing. When OGP sends
136
191
  "stateDir": "~/.ogp",
137
192
  "agentId": "main",
138
193
  "notifyTarget": "telegram:123456789",
194
+ "humanDeliveryTarget": "telegram:123456789",
195
+ "inboundFederationPolicy": {
196
+ "mode": "summarize"
197
+ },
139
198
  "notifyTargets": {
140
199
  "main": "telegram:123456789",
141
200
  "scribe": "telegram:987654321",
@@ -148,43 +207,91 @@ The `notifyTargets` field enables per-agent notification routing. When OGP sends
148
207
 
149
208
  When routing notifications, OGP resolves the target in this order:
150
209
 
151
- 1. **`notifyTargets[agent]`** — If the agent is specified and exists in `notifyTargets`, use that target
152
- 2. **`notifyTarget`** — Fall back to the legacy single target for backward compatibility
153
- 3. **Default**If neither is set, the notification is sent without a specific target (OpenClaw routes to the default channel)
210
+ 1. **`humanDeliveryTarget`** — If set, use it as the explicit human-facing OGP destination
211
+ 2. **`notifyTargets[agent]`** — If the agent is specified and exists in `notifyTargets`, use that target
212
+ 3. **`notifyTarget`**Fall back to the legacy single target for backward compatibility
213
+ 4. **Default** — If none are set, OGP falls back to the agent's default session
154
214
 
155
215
  This allows you to:
156
216
  - Route federation messages to different agents based on context
217
+ - Explicitly separate "the agent that owns this gateway" from "the human-facing channel for OGP followups"
157
218
  - Maintain backward compatibility with existing single-agent setups
158
219
  - Gradually migrate to multi-agent routing without breaking existing configurations
159
220
 
221
+ ### Human Delivery Preferences (v0.4.2+)
222
+
223
+ Do not assume that "whatever conversation is currently active" is the right place to satisfy a peer's request to notify the human.
224
+
225
+ Use these config fields to separate routing from behavior:
226
+
227
+ - **`humanDeliveryTarget`**: Explicit human-facing destination for OGP-triggered followups.
228
+ - Example: `"telegram:123456789"`
229
+ - Or a raw session key: `"agent:main:telegram:direct:123456789"`
230
+ - **`inboundFederationPolicy.mode`**: Default handling mode for inbound federated requests.
231
+
232
+ Supported modes:
233
+
234
+ - `forward` — Tell me everything
235
+ - `summarize` — Tell me only important/actionable items
236
+ - `autonomous` — Act autonomously unless blocked or explicitly asked to relay something
237
+ - `approval-required` — Do not act or reply until the human approves
238
+
239
+ Example:
240
+
241
+ ```json
242
+ {
243
+ "humanDeliveryTarget": "telegram:123456789",
244
+ "inboundFederationPolicy": {
245
+ "mode": "summarize"
246
+ }
247
+ }
248
+ ```
249
+
250
+ For OpenClaw specifically:
251
+
252
+ - OGP uses `POST /hooks/agent` as the primary delivery path for inbound federated work that the local agent should interpret and handle.
253
+ - If OGP needs direct session injection, it uses Gateway RPC with `wss://` when the OpenClaw gateway is TLS-enabled.
254
+ - Do not claim delivery unless you actually used the configured human-facing channel or the platform confirmed the hook task completed.
255
+
256
+ OGP now resolves delegated-authority rules when deciding how to treat a federated request: global defaults, peer defaults, message-class rules (`human-relay`, `agent-work`, `approval-request`, `status-update`), and topic overrides each layer in to determine whether to forward, summarize, act autonomously, or wait for approval. Hooks will only run with the exact human session key when OpenClaw has `hooks.allowRequestSessionKey=true` and the requested key matches `hooks.allowedSessionKeyPrefixes`; otherwise OGP logs a warning and runs in the default hook session, meaning Telegram delivery still looks like injected/`cli` content, which is the accepted `v0.4.2` limitation documented in the README/changelog.
257
+
258
+ For first-time configuration, use `ogp setup`. To revisit only the delegated-authority / human-delivery interview later, use:
259
+
260
+ ```bash
261
+ ogp --for openclaw agent-comms interview
262
+ ogp --for hermes agent-comms interview
263
+ ```
264
+
265
+ When a peer says "tell David X", that is a delivery obligation. Do not treat it as satisfied just because the information appeared in some other active session.
266
+
160
267
  ---
161
268
 
162
269
  ## Federation Management
163
270
 
164
271
  ### List all peers
165
272
  ```bash
166
- ogp federation list
167
- ogp federation list --status pending
168
- ogp federation list --status approved
273
+ ogp --for openclaw federation list
274
+ ogp --for openclaw federation list --status pending
275
+ ogp --for hermes federation list --status approved
169
276
  ```
170
277
 
171
278
  ### Request federation with a new peer
172
279
  ```bash
173
- ogp federation request <peer-gateway-url> [--alias <name>]
174
- # Example with alias:
175
- ogp federation request https://giving-produces-microphone-mild.trycloudflare.com --alias stanislav
280
+ ogp --for <framework> federation request <peer-gateway-url> [--alias <name>]
281
+ # Example:
282
+ ogp --for openclaw federation request https://hermes.example.com --alias apollo
176
283
 
177
284
  # Alias auto-resolves from gateway's display name if omitted:
178
- ogp federation request https://giving-produces-microphone-mild.trycloudflare.com
285
+ ogp --for openclaw federation request https://hermes.example.com
179
286
  ```
180
287
 
181
288
  ### Approve an inbound federation request
182
289
  ```bash
183
290
  # Auto-grants scopes that mirror peer's offered intents (symmetric federation)
184
- ogp federation approve <peer-id>
291
+ ogp --for hermes federation approve <peer-id>
185
292
 
186
293
  # Or approve with specific custom scopes (asymmetric):
187
- ogp federation approve <peer-id> --intents "message,agent-comms,project.join,project.contribute,project.query,project.status"
294
+ ogp --for hermes federation approve <peer-id> --intents "message,agent-comms,project.join,project.contribute,project.query,project.status"
188
295
  ```
189
296
 
190
297
  > **Note (OGP 0.2.24+):** Peer IDs are now public key prefixes (e.g., `302a300506032b65`).
@@ -192,12 +299,12 @@ ogp federation approve <peer-id> --intents "message,agent-comms,project.join,pro
192
299
 
193
300
  ### Grant or update scopes for an existing peer
194
301
  ```bash
195
- ogp federation grant <peer-id> --intents "message,agent-comms,project.join,project.contribute,project.query,project.status"
302
+ ogp --for openclaw federation grant <peer-id> --intents "message,agent-comms,project.join,project.contribute,project.query,project.status"
196
303
  ```
197
304
 
198
305
  ### Check what scopes are granted to/from a peer
199
306
  ```bash
200
- ogp federation scopes <peer-id>
307
+ ogp --for openclaw federation scopes <peer-id>
201
308
  # Shows:
202
309
  # - GRANTED TO PEER (what they can call on your gateway)
203
310
  # - RECEIVED FROM PEER (what you can call on theirs)
@@ -205,19 +312,19 @@ ogp federation scopes <peer-id>
205
312
 
206
313
  ### Ping a peer
207
314
  ```bash
208
- ogp federation ping <peer-gateway-url>
315
+ ogp --for openclaw federation ping <peer-gateway-url>
209
316
  ```
210
317
 
211
318
  ### Send a raw federation message
212
319
  ```bash
213
- ogp federation send <peer-id> <intent> '<json-payload>'
320
+ ogp --for openclaw federation send <peer-id> <intent> '<json-payload>'
214
321
  ```
215
322
 
216
323
  ### Send an agent-to-agent message (agent-comms)
217
324
  ```bash
218
- ogp federation agent <peer-id> <topic> "<message>"
325
+ ogp --for openclaw federation agent <peer-id> <topic> "<message>"
219
326
  # Example:
220
- ogp federation agent stanislav general "Hey, can you check on project synapse?"
327
+ ogp --for openclaw federation agent apollo general "Hey, can you check on project synapse?"
221
328
  ```
222
329
 
223
330
  ### Manage agent-comms policies (what topics you'll respond to)
@@ -226,22 +333,22 @@ Federation scopes and agent-comms policies are **two separate layers**. Approval
226
333
 
227
334
  ```bash
228
335
  # Status page — shows what's allowed, blocked, and what to do about it
229
- ogp agent-comms policies <peer-id>
336
+ ogp --for openclaw agent-comms policies <peer-id>
230
337
 
231
338
  # Global view of all peers
232
- ogp agent-comms policies
339
+ ogp --for openclaw agent-comms policies
233
340
 
234
341
  # Allow a topic
235
- ogp agent-comms add-topic <peer-id> <topic> --level summary
342
+ ogp --for openclaw agent-comms add-topic <peer-id> <topic> --level summary
236
343
 
237
344
  # Block a topic
238
- ogp agent-comms set-topic <peer-id> <topic> off
345
+ ogp --for openclaw agent-comms set-topic <peer-id> <topic> off
239
346
 
240
347
  # Open all topics by default for a peer
241
- ogp agent-comms set-default <peer-id> summary
348
+ ogp --for openclaw agent-comms set-default <peer-id> summary
242
349
 
243
350
  # View activity log
244
- ogp agent-comms activity [peer-id]
351
+ ogp --for openclaw agent-comms activity [peer-id]
245
352
  ```
246
353
 
247
354
  Response levels: `full` (full content passed to agent), `summary` (condensed), `escalate` (route to user), `off` (blocked — sender gets a witty non-answer)
@@ -271,20 +378,20 @@ Default grant includes all of the above. Customize with `--intents` if needed.
271
378
  2. Share the code with your peer (Telegram, Slack, etc.)
272
379
  3. They run: ogp federation accept <code>
273
380
  4. Scopes auto-granted + "general" topic auto-enabled ✓
274
- 5. Test: ogp federation agent <peer-id> general "hello"
381
+ 5. Test: ogp --for <framework> federation agent <peer-id> general "hello"
275
382
  ```
276
383
 
277
384
  ### Old way — manual URL exchange (still works)
278
385
  ```
279
386
  1. Get peer's gateway URL (they share it with you)
280
387
  2. Check their card: curl -s <url>/.well-known/ogp | python3 -m json.tool
281
- 3. Request federation: ogp federation request <url>
388
+ 3. Request federation: ogp --for <framework> federation request <url>
282
389
  4. They approve on their side (or you approve if they requested)
283
390
  → Scopes auto-granted + "general" topic auto-enabled ✓
284
- 5. Check agent-comms status: ogp agent-comms policies <peer-id>
285
- 6. Add more topics if needed: ogp agent-comms add-topic <peer-id> <topic>
286
- 7. Test: ogp federation ping <url>
287
- 8. Test agent-comms: ogp federation agent <peer-id> general "hello"
391
+ 5. Check agent-comms status: ogp --for <framework> agent-comms policies <peer-id>
392
+ 6. Add more topics if needed: ogp --for <framework> agent-comms add-topic <peer-id> <topic>
393
+ 7. Test: ogp --for <framework> federation ping <url>
394
+ 8. Test agent-comms: ogp --for <framework> federation agent <peer-id> general "hello"
288
395
  9. (Optional) Create or join a shared project
289
396
  ```
290
397
 
@@ -296,21 +403,21 @@ For full project management, use the `ogp-project` skill. Quick reference:
296
403
 
297
404
  ```bash
298
405
  # Create a project
299
- ogp project create <id> "<name>" --description "<description>"
406
+ ogp --for openclaw project create <id> "<name>" --description "<description>"
300
407
 
301
408
  # Invite a peer to join
302
- ogp project request-join <peer-id> <project-id> "<project-name>"
409
+ ogp --for openclaw project request-join <peer-id> <project-id> "<project-name>"
303
410
 
304
411
  # Log a contribution
305
- ogp project contribute <project-id> <topic> "<summary>"
306
- # Topics: progress, decision, blocker, context, idea, context.description, context.repository
412
+ ogp --for openclaw project contribute <project-id> <type> "<summary>"
413
+ # Types: progress, decision, blocker, context, idea, context.description, context.repository
307
414
 
308
415
  # Query project activity
309
- ogp project query <project-id> [--topic <topic>] [--limit 10]
310
- ogp project status <project-id>
416
+ ogp --for openclaw project query <project-id> [--type <type>] [--limit 10]
417
+ ogp --for openclaw project status <project-id>
311
418
 
312
419
  # Query a peer's project data
313
- ogp project query-peer <peer-id> <project-id>
420
+ ogp --for openclaw project query-peer <peer-id> <project-id>
314
421
  ```
315
422
 
316
423
  ---
@@ -326,19 +433,35 @@ ogp project query-peer <peer-id> <project-id>
326
433
  | `Send failed` on agent-comms | Topic blocked on receiver's side | Receiver runs `ogp agent-comms policies <peer-id>` — look for blocked/missing topics |
327
434
  | Agent-comms silently ignored | Receiver's default is `off`, topic not allowed | Receiver runs `ogp agent-comms add-topic <your-peer-id> <topic> --level summary` |
328
435
  | `ogp: command not found` | Not installed | `npm install -g @dp-pcs/ogp` |
329
- | Daemon not running | Process died | `ogp start --background` |
436
+ | Daemon not running | Process died or wrong framework selected | `ogp config show`, then `ogp --for <framework> start --background` |
437
+ | Public discovery card shows the wrong identity | Wrong framework home or stale daemon | Stop daemons, verify `ogp config show`, restart each framework explicitly with `--for` |
438
+ | Peer list is obviously stale or cross-contaminated | Wrong framework state file or old federation residue | Back up then clear the relevant `peers.json` for the affected framework and re-form federation |
330
439
 
331
440
  ### Check OGP daemon status
332
441
  ```bash
333
- ogp status
334
- # Or check the log:
442
+ ogp config show
443
+ ogp --for openclaw status
444
+ ogp --for hermes status
445
+ # Or check the logs:
335
446
  tail -f ~/.ogp/daemon.log
447
+ tail -f ~/.ogp-hermes/daemon.log
336
448
  ```
337
449
 
338
450
  ### Restart the daemon
339
451
  ```bash
340
- pkill -f "node.*ogp"
341
- ogp start --background
452
+ ogp --for openclaw stop
453
+ ogp --for openclaw start --background
454
+ ogp --for hermes stop
455
+ ogp --for hermes start --background
456
+ ```
457
+
458
+ ### Clean federation state for one framework
459
+ ```bash
460
+ cp ~/.ogp/peers.json ~/.ogp/peers.json.backup.$(date +%Y%m%d-%H%M%S)
461
+ printf '[]\n' > ~/.ogp/peers.json
462
+
463
+ cp ~/.ogp-hermes/peers.json ~/.ogp-hermes/peers.json.backup.$(date +%Y%m%d-%H%M%S)
464
+ printf '[]\n' > ~/.ogp-hermes/peers.json
342
465
  ```
343
466
 
344
467
  ---
@@ -347,21 +470,31 @@ ogp start --background
347
470
 
348
471
  | File | Purpose |
349
472
  |------|---------|
350
- | `~/.ogp/config.json` | Gateway config (URL, email, port, notifyTargets, agentId) |
351
- | `~/.ogp/keypair.json` | Ed25519 signing keypair |
352
- | `~/.ogp/peers.json` | All federation peers + scopes |
353
- | `~/.ogp/projects.json` | Local project data + contributions |
354
- | `~/.ogp/daemon.log` | Daemon logs |
355
- | `~/.ogp/activity.log` | Intent activity log |
473
+ | `~/.ogp-meta/config.json` | Enabled frameworks, aliases, and default framework |
474
+ | `~/.ogp/config.json` | OpenClaw gateway config |
475
+ | `~/.ogp-hermes/config.json` | Hermes gateway config |
476
+ | `~/.ogp/keypair.json` | OpenClaw public key cache on macOS; full keypair file on non-macOS |
477
+ | `~/.ogp-hermes/keypair.json` | Hermes public key cache on macOS; full keypair file on non-macOS |
478
+ | `~/.ogp/peers.json` | OpenClaw federation peers + scopes |
479
+ | `~/.ogp-hermes/peers.json` | Hermes federation peers + scopes |
480
+ | `~/.ogp/projects.json` | OpenClaw project data + contributions |
481
+ | `~/.ogp-hermes/projects.json` | Hermes project data + contributions |
482
+ | `~/.ogp/daemon.log` | OpenClaw daemon log |
483
+ | `~/.ogp-hermes/daemon.log` | Hermes daemon log |
484
+ | `~/.ogp/activity.log` | OpenClaw agent-comms activity log |
485
+ | `~/.ogp-hermes/activity.log` | Hermes agent-comms activity log |
356
486
 
357
487
  ---
358
488
 
359
489
  ## Design Notes
360
490
 
361
491
  - **Peer Identity (OGP 0.2.24+):** Peers are identified by the first 16 characters of their Ed25519 public key (e.g., `302a300506032b65`). This is stable even when tunnel URLs rotate — the public key is the identity, the URL is just the address.
492
+ - **Framework isolation matters:** In multi-framework mode, OpenClaw and Hermes must keep distinct state directories, keypairs, peers, projects, and logs. Always use `--for` when the active framework is not obvious.
493
+ - **macOS key storage:** The private key source of truth is the instance-specific Keychain entry derived from the framework config dir. Deleting `keypair.json` alone does not rotate identity; use `ogp setup --reset-keypair` when you actually want a new keypair.
362
494
  - **Intent Negotiation (OGP 0.2.24+):** Federation requests include `offeredIntents`. Approval automatically mirrors those intents back to the requester, creating symmetric capabilities by default.
363
495
  - **Scopes are bilateral:** Each side independently grants what the other can call. OGP 0.2.24+ auto-mirrors offered intents on approval.
364
496
  - **Project isolation:** Projects are scoped to their member list. Full mesh federation does NOT give all peers access to all projects. A peer only sees projects they are a member of.
365
497
  - **Signatures:** All federation messages are signed with Ed25519. Peer's public key is stored in `peers.json` at federation time.
366
498
  - **Rendezvous is optional:** Peers with a static IP or existing tunnel continue working unchanged. Rendezvous is an additional discovery path, not a requirement.
367
499
  - **Notification Routing:** The `notifyTargets` config enables multi-agent setups where different agents handle different types of federation messages.
500
+ - **Stable public URLs win:** Use a canonical public hostname per framework. Treat ephemeral tunnel URLs as temporary diagnostics, not long-term identity.