@dp-pcs/ogp 0.3.3 → 0.4.3

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 (112) hide show
  1. package/README.md +317 -61
  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 +14 -0
  14. package/dist/cli/federation.d.ts.map +1 -1
  15. package/dist/cli/federation.js +347 -23
  16. package/dist/cli/federation.js.map +1 -1
  17. package/dist/cli/project.d.ts +4 -3
  18. package/dist/cli/project.d.ts.map +1 -1
  19. package/dist/cli/project.js +34 -24
  20. package/dist/cli/project.js.map +1 -1
  21. package/dist/cli/setup.d.ts +23 -0
  22. package/dist/cli/setup.d.ts.map +1 -1
  23. package/dist/cli/setup.js +560 -32
  24. package/dist/cli/setup.js.map +1 -1
  25. package/dist/cli.js +358 -35
  26. package/dist/cli.js.map +1 -1
  27. package/dist/daemon/agent-comms.d.ts.map +1 -1
  28. package/dist/daemon/agent-comms.js +15 -10
  29. package/dist/daemon/agent-comms.js.map +1 -1
  30. package/dist/daemon/heartbeat.d.ts +22 -0
  31. package/dist/daemon/heartbeat.d.ts.map +1 -0
  32. package/dist/daemon/heartbeat.js +119 -0
  33. package/dist/daemon/heartbeat.js.map +1 -0
  34. package/dist/daemon/intent-registry.d.ts.map +1 -1
  35. package/dist/daemon/intent-registry.js +19 -10
  36. package/dist/daemon/intent-registry.js.map +1 -1
  37. package/dist/daemon/keypair.d.ts +1 -0
  38. package/dist/daemon/keypair.d.ts.map +1 -1
  39. package/dist/daemon/keypair.js +151 -18
  40. package/dist/daemon/keypair.js.map +1 -1
  41. package/dist/daemon/message-handler.d.ts.map +1 -1
  42. package/dist/daemon/message-handler.js +30 -16
  43. package/dist/daemon/message-handler.js.map +1 -1
  44. package/dist/daemon/notify.d.ts +19 -0
  45. package/dist/daemon/notify.d.ts.map +1 -1
  46. package/dist/daemon/notify.js +376 -73
  47. package/dist/daemon/notify.js.map +1 -1
  48. package/dist/daemon/openclaw-bridge.d.ts +34 -0
  49. package/dist/daemon/openclaw-bridge.d.ts.map +1 -0
  50. package/dist/daemon/openclaw-bridge.js +261 -0
  51. package/dist/daemon/openclaw-bridge.js.map +1 -0
  52. package/dist/daemon/peers.d.ts +21 -0
  53. package/dist/daemon/peers.d.ts.map +1 -1
  54. package/dist/daemon/peers.js +125 -20
  55. package/dist/daemon/peers.js.map +1 -1
  56. package/dist/daemon/projects.d.ts +9 -6
  57. package/dist/daemon/projects.d.ts.map +1 -1
  58. package/dist/daemon/projects.js +30 -20
  59. package/dist/daemon/projects.js.map +1 -1
  60. package/dist/daemon/server.d.ts +17 -0
  61. package/dist/daemon/server.d.ts.map +1 -1
  62. package/dist/daemon/server.js +188 -77
  63. package/dist/daemon/server.js.map +1 -1
  64. package/dist/shared/config.d.ts +52 -1
  65. package/dist/shared/config.d.ts.map +1 -1
  66. package/dist/shared/config.js +18 -11
  67. package/dist/shared/config.js.map +1 -1
  68. package/dist/shared/framework-detection.d.ts +31 -0
  69. package/dist/shared/framework-detection.d.ts.map +1 -0
  70. package/dist/shared/framework-detection.js +91 -0
  71. package/dist/shared/framework-detection.js.map +1 -0
  72. package/dist/shared/help.d.ts +5 -0
  73. package/dist/shared/help.d.ts.map +1 -0
  74. package/dist/shared/help.js +281 -0
  75. package/dist/shared/help.js.map +1 -0
  76. package/dist/shared/meta-config.d.ts +44 -0
  77. package/dist/shared/meta-config.d.ts.map +1 -0
  78. package/dist/shared/meta-config.js +89 -0
  79. package/dist/shared/meta-config.js.map +1 -0
  80. package/dist/shared/migration.d.ts +57 -0
  81. package/dist/shared/migration.d.ts.map +1 -0
  82. package/dist/shared/migration.js +255 -0
  83. package/dist/shared/migration.js.map +1 -0
  84. package/docs/CLI-REFERENCE.md +1361 -0
  85. package/docs/GETTING-STARTED.md +953 -0
  86. package/docs/MIGRATION.md +202 -0
  87. package/docs/MULTI-FRAMEWORK-DEMO.md +352 -0
  88. package/docs/MULTI-FRAMEWORK-DESIGN.md +378 -0
  89. package/docs/MULTI-FRAMEWORK-IMPL.md +197 -0
  90. package/docs/case-studies/CRASH_RESOLUTION_20260407.md +190 -0
  91. package/docs/case-studies/OpenClaw_Hermes_Status_Report_20260407.md +142 -0
  92. package/docs/case-studies/OpenClaw_Stability_Fix_Summary.md +209 -0
  93. package/docs/case-studies/README.md +40 -0
  94. package/docs/case-studies/crash_observations.md +250 -0
  95. package/docs/cloudflare-named-tunnel-setup.md +126 -0
  96. package/docs/federation-flow.md +27 -37
  97. package/docs/hermes-implementation-checklist.md +4 -0
  98. package/docs/project-intent-testing.md +97 -0
  99. package/docs/quickstart.md +12 -4
  100. package/docs/rendezvous.md +13 -14
  101. package/docs/scopes.md +13 -13
  102. package/package.json +12 -6
  103. package/scripts/completion.bash +123 -0
  104. package/scripts/completion.zsh +372 -0
  105. package/scripts/install-skills.js +19 -1
  106. package/scripts/test-migration-execute.js +74 -0
  107. package/scripts/test-migration.js +42 -0
  108. package/scripts/test-project-intents.mjs +614 -0
  109. package/skills/ogp/SKILL.md +197 -64
  110. package/skills/ogp-agent-comms/SKILL.md +107 -41
  111. package/skills/ogp-expose/SKILL.md +183 -25
  112. package/skills/ogp-project/SKILL.md +110 -88
@@ -0,0 +1,953 @@
1
+ # OGP Getting Started Guide
2
+
3
+ This comprehensive guide covers everything you need to get started with OGP, from basic single-framework setup to advanced multi-framework configurations.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Prerequisites](#prerequisites)
8
+ - [Quick Start: Single Framework](#quick-start-single-framework)
9
+ - [Quick Start: Multiple Frameworks](#quick-start-multiple-frameworks)
10
+ - [Framework Detection and Selection](#framework-detection-and-selection)
11
+ - [Using the --for Flag](#using-the---for-flag)
12
+ - [Setting a Default Framework](#setting-a-default-framework)
13
+ - [Tab Completion Setup](#tab-completion-setup)
14
+ - [Using ? Style Help](#using--style-help)
15
+ - [Common Workflows](#common-workflows)
16
+ - [Troubleshooting](#troubleshooting)
17
+
18
+ ## Prerequisites
19
+
20
+ Before installing OGP, ensure you have:
21
+
22
+ - **Node.js 18 or higher** - Check with `node --version`
23
+ - **An AI framework installed** (one or more):
24
+ - **OpenClaw** - Get it at [https://openclaw.ai](https://openclaw.ai)
25
+ - **Hermes** - Contact your Hermes provider
26
+ - Or run **standalone** (no framework required)
27
+ - **API credentials** for your framework (generated during framework setup)
28
+
29
+ ## Quick Start: Single Framework
30
+
31
+ If you're using only one AI framework (e.g., OpenClaw), setup is straightforward.
32
+
33
+ ### 1. Install OGP
34
+
35
+ ```bash
36
+ npm install -g @dp-pcs/ogp
37
+ ```
38
+
39
+ ### 2. Install Skills (Optional)
40
+
41
+ Install OGP skills for Claude Code integration:
42
+
43
+ ```bash
44
+ ogp-install-skills
45
+ ```
46
+
47
+ Verify the installed copies after an upgrade:
48
+
49
+ ```bash
50
+ rg -n '^version:' ~/.openclaw/skills/ogp*/SKILL.md ~/.claude/skills/ogp*/SKILL.md 2>/dev/null
51
+ ```
52
+
53
+ For the current `0.4.2` release line, the changed skills should report `ogp` `2.6.0`, `ogp-agent-comms` `0.6.0`, and `ogp-project` `2.2.0`.
54
+
55
+ ### 3. Run Setup
56
+
57
+ ```bash
58
+ ogp setup
59
+ ```
60
+
61
+ The wizard will:
62
+ 1. Detect installed frameworks
63
+ 2. Prompt for framework configuration
64
+ 3. Create config directory (e.g., `~/.ogp-openclaw/`)
65
+ 4. Generate cryptographic keypair
66
+ 5. Create meta-config at `~/.ogp-meta/config.json`
67
+
68
+ **Example Setup Session:**
69
+
70
+ ```
71
+ === OGP Setup ===
72
+
73
+ 🔍 Detecting installed AI frameworks...
74
+ ✓ Found OpenClaw at ~/.openclaw/
75
+
76
+ Which frameworks do you want to enable OGP for?
77
+ [x] OpenClaw (Junior @ OpenClaw)
78
+ [ ] Standalone (no framework)
79
+
80
+ === Configuring OpenClaw ===
81
+
82
+ Available agents:
83
+ 1. 🦝 Junior (main)
84
+ 2. ✍️ Scribe (scribe)
85
+
86
+ Which agent owns this gateway? (number or ID) [1]: 1
87
+
88
+ Daemon port [18790]: <enter>
89
+ OpenClaw URL [http://localhost:18789]: <enter>
90
+ OpenClaw API token: your-token-here
91
+ Gateway URL (your public URL): https://ogp.example.com
92
+ Display name: Alice
93
+ Email: alice@example.com
94
+
95
+ Enable optional rendezvous for invite codes / pubkey discovery? [y/N]: n
96
+ Rendezvous server URL [https://rendezvous.elelem.expert]: <enter>
97
+
98
+ ✓ OpenClaw configured
99
+ Config: ~/.ogp-openclaw/
100
+ Port: 18790
101
+ Agent: Junior (main)
102
+
103
+ ✓ OGP setup complete!
104
+ Default framework: openclaw
105
+ ```
106
+
107
+ ### 4. Start the Daemon
108
+
109
+ ```bash
110
+ ogp start --background
111
+ ```
112
+
113
+ Check status:
114
+
115
+ ```bash
116
+ ogp status
117
+ ```
118
+
119
+ Output:
120
+
121
+ ```
122
+ OGP Daemon Status:
123
+ Framework: openclaw
124
+ Status: ● Running
125
+ Port: 18790
126
+ PID: 12345
127
+ Uptime: 5 minutes
128
+ Public Key: 302a300506032b6570032100...
129
+ Gateway URL: https://ogp.example.com
130
+ ```
131
+
132
+ ### 5. Test Your Gateway
133
+
134
+ ```bash
135
+ curl https://ogp.example.com/.well-known/ogp
136
+ ```
137
+
138
+ You should see your gateway metadata (public key, capabilities, endpoints).
139
+
140
+ That's it! Your single-framework OGP gateway is running. Skip to [Common Workflows](#common-workflows) to start federating.
141
+
142
+ ## Quick Start: Multiple Frameworks
143
+
144
+ If you're using multiple AI frameworks (e.g., OpenClaw and Hermes), OGP can manage separate gateways for each.
145
+
146
+ ### 1. Install OGP
147
+
148
+ ```bash
149
+ npm install -g @dp-pcs/ogp
150
+ ```
151
+
152
+ ### 2. Run Setup
153
+
154
+ ```bash
155
+ ogp setup
156
+ ```
157
+
158
+ The wizard will detect all installed frameworks:
159
+
160
+ ```
161
+ === OGP Setup ===
162
+
163
+ 🔍 Detecting installed AI frameworks...
164
+ ✓ Found OpenClaw at ~/.openclaw/
165
+ ✓ Found Hermes at ~/.hermes/
166
+
167
+ Which frameworks do you want to enable OGP for?
168
+ [x] OpenClaw (Junior @ OpenClaw)
169
+ [x] Hermes (Apollo @ Hermes)
170
+ [ ] Standalone (no framework)
171
+ ```
172
+
173
+ Select all frameworks you want to enable (use space to toggle, enter to confirm).
174
+
175
+ ### 3. Configure Each Framework
176
+
177
+ The wizard will prompt for configuration for each selected framework:
178
+
179
+ ```
180
+ === Configuring OpenClaw ===
181
+
182
+ Available agents:
183
+ 1. 🦝 Junior (main)
184
+
185
+ Which agent owns this gateway? (number or ID) [1]: 1
186
+
187
+ Daemon port [18790]: <enter>
188
+ OpenClaw URL [http://localhost:18789]: <enter>
189
+ OpenClaw API token: your-openclaw-token
190
+ Gateway URL: https://ogp.example.com
191
+ Display name: Junior @ OpenClaw
192
+ Email: alice@example.com
193
+
194
+ === Configuring Hermes ===
195
+
196
+ Available agents:
197
+ 1. 🌟 Apollo (main)
198
+
199
+ Which agent owns this gateway? (number or ID) [1]: 1
200
+
201
+ Daemon port [18793]: <enter>
202
+ Hermes webhook URL [http://localhost:18792/webhooks/ogp]: <enter>
203
+ Hermes webhook secret: your-hermes-secret
204
+ Gateway URL: https://hermes.example.com
205
+ Display name: Apollo @ Hermes
206
+ Email: alice@example.com
207
+
208
+ ✓ OGP configured for 2 frameworks
209
+ OpenClaw: ~/.ogp-openclaw/
210
+ Hermes: ~/.ogp-hermes/
211
+
212
+ Default framework: openclaw
213
+
214
+ Tip: Use `ogp --for openclaw <command>` or `ogp --for hermes <command>`
215
+ Or set a default: `ogp config set-default openclaw`
216
+ ```
217
+
218
+ ### 4. Start Daemons
219
+
220
+ Start daemons for each framework:
221
+
222
+ ```bash
223
+ # Start OpenClaw daemon
224
+ ogp --for openclaw start --background
225
+
226
+ # Start Hermes daemon
227
+ ogp --for hermes start --background
228
+ ```
229
+
230
+ Or start all at once:
231
+
232
+ ```bash
233
+ ogp --for all start --background
234
+ ```
235
+
236
+ ### 5. Check Status
237
+
238
+ ```bash
239
+ ogp --for all status
240
+ ```
241
+
242
+ Output:
243
+
244
+ ```
245
+ === OpenClaw (Junior @ OpenClaw) ===
246
+ OGP Daemon Status:
247
+ Framework: openclaw
248
+ Status: ● Running
249
+ Port: 18790
250
+ PID: 12345
251
+ Uptime: 2 minutes
252
+
253
+ === Hermes (Apollo @ Hermes) ===
254
+ OGP Daemon Status:
255
+ Framework: hermes
256
+ Status: ● Running
257
+ Port: 18793
258
+ PID: 12346
259
+ Uptime: 2 minutes
260
+ ```
261
+
262
+ Now you have two independent OGP gateways running, one for each framework.
263
+
264
+ ## Framework Detection and Selection
265
+
266
+ ### Automatic Detection
267
+
268
+ During setup, OGP automatically detects installed frameworks by checking:
269
+
270
+ 1. **Framework directories**:
271
+ - OpenClaw: `~/.openclaw/`
272
+ - Hermes: `~/.hermes/`
273
+
274
+ 2. **Framework commands**:
275
+ - `openclaw` command available
276
+ - `hermes` command available
277
+
278
+ ### Manual Selection
279
+
280
+ If auto-detection doesn't find your framework:
281
+
282
+ 1. Select "Standalone (no framework)" during setup
283
+ 2. Manually configure OGP_HOME before running commands:
284
+
285
+ ```bash
286
+ export OGP_HOME=~/.ogp-custom
287
+ ogp setup
288
+ ```
289
+
290
+ ### Framework Configuration Directories
291
+
292
+ Each framework gets its own config directory:
293
+
294
+ | Framework | Directory | Default Port |
295
+ |-----------|-----------|--------------|
296
+ | OpenClaw | `~/.ogp-openclaw/` | 18790 |
297
+ | Hermes | `~/.ogp-hermes/` | 18793 |
298
+ | Standalone | `~/.ogp/` | 18790 |
299
+
300
+ All configs are managed from `~/.ogp-meta/config.json`.
301
+
302
+ ## Using the --for Flag
303
+
304
+ The `--for` flag specifies which framework configuration to use for a command.
305
+
306
+ ### Basic Usage
307
+
308
+ ```bash
309
+ # Use OpenClaw config
310
+ ogp --for openclaw federation list
311
+
312
+ # Use Hermes config
313
+ ogp --for hermes federation list
314
+
315
+ # Run on all frameworks
316
+ ogp --for all federation list
317
+ ```
318
+
319
+ ### When --for is Required
320
+
321
+ The `--for` flag is required when:
322
+
323
+ 1. **Multiple frameworks are configured** and no default is set
324
+ 2. You want to **override the default** framework
325
+ 3. You want to **run on all frameworks** (`--for all`)
326
+
327
+ ### When --for is Optional
328
+
329
+ The `--for` flag is optional when:
330
+
331
+ 1. **Only one framework is configured** (auto-selected)
332
+ 2. A **default framework is set** (uses default)
333
+
334
+ ### Examples
335
+
336
+ ```bash
337
+ # Start specific framework daemon
338
+ ogp --for openclaw start --background
339
+
340
+ # Request federation from specific framework
341
+ ogp --for openclaw federation request https://peer.example.com
342
+
343
+ # Send message from Hermes gateway
344
+ ogp --for hermes federation send apollo message '{"text":"Hello from Hermes!"}'
345
+
346
+ # Check status of all frameworks
347
+ ogp --for all status
348
+
349
+ # List all peers across all frameworks
350
+ ogp --for all federation list
351
+ ```
352
+
353
+ ### --for all Behavior
354
+
355
+ When using `--for all`, OGP runs the command on all enabled frameworks and aggregates results:
356
+
357
+ ```bash
358
+ $ ogp --for all federation list
359
+
360
+ === OpenClaw (Junior @ OpenClaw) ===
361
+ PEERS:
362
+ apollo (Apollo @ Hermes) - approved
363
+ bob (Bob @ OpenClaw) - approved
364
+
365
+ === Hermes (Apollo @ Hermes) ===
366
+ PEERS:
367
+ junior (Junior @ OpenClaw) - approved
368
+ charlie (Charlie @ Hermes) - pending
369
+ ```
370
+
371
+ ## Setting a Default Framework
372
+
373
+ Set a default framework to avoid using `--for` on every command.
374
+
375
+ ### Set Default
376
+
377
+ ```bash
378
+ ogp config set-default openclaw
379
+ ```
380
+
381
+ Output:
382
+
383
+ ```
384
+ ✓ Default framework: openclaw
385
+ ```
386
+
387
+ ### Check Default
388
+
389
+ ```bash
390
+ ogp config list
391
+ ```
392
+
393
+ Output:
394
+
395
+ ```
396
+ Configured frameworks:
397
+ openclaw [default] ● Enabled ~/.ogp-openclaw/ 18790
398
+ hermes ● Enabled ~/.ogp-hermes/ 18793
399
+ ```
400
+
401
+ ### Using the Default
402
+
403
+ Once set, commands automatically use the default framework:
404
+
405
+ ```bash
406
+ # No --for needed, uses openclaw (default)
407
+ ogp federation list
408
+ ogp start --background
409
+ ogp status
410
+ ```
411
+
412
+ ### Override the Default
413
+
414
+ Use `--for` to override the default for a single command:
415
+
416
+ ```bash
417
+ # Uses hermes instead of default (openclaw)
418
+ ogp --for hermes federation list
419
+ ```
420
+
421
+ ## Tab Completion Setup
422
+
423
+ Tab completion makes command entry faster and helps discover available commands, peers, and frameworks.
424
+
425
+ ### Install Completion
426
+
427
+ #### Bash
428
+
429
+ ```bash
430
+ ogp completion install bash
431
+ ```
432
+
433
+ Reload your shell:
434
+
435
+ ```bash
436
+ source ~/.bashrc
437
+ ```
438
+
439
+ #### Zsh
440
+
441
+ ```bash
442
+ ogp completion install zsh
443
+ ```
444
+
445
+ Reload your shell:
446
+
447
+ ```bash
448
+ source ~/.zshrc
449
+ ```
450
+
451
+ ### Using Completion
452
+
453
+ Once installed, press `TAB` to complete commands:
454
+
455
+ ```bash
456
+ # Complete commands
457
+ ogp fed<TAB>
458
+ # → ogp federation
459
+
460
+ # Complete subcommands
461
+ ogp federation <TAB>
462
+ # → list request approve reject remove send agent scopes alias
463
+
464
+ # Complete --for flag
465
+ ogp --for <TAB>
466
+ # → openclaw hermes all
467
+
468
+ # Complete peer names
469
+ ogp federation send <TAB>
470
+ # → apollo bob charlie
471
+
472
+ # Complete intents
473
+ ogp federation send apollo <TAB>
474
+ # → message task-request status-update agent-comms project.*
475
+ ```
476
+
477
+ ### Completion Features
478
+
479
+ - **Command completion**: Top-level commands and subcommands
480
+ - **Framework completion**: Framework names for `--for` flag
481
+ - **Peer completion**: Peer aliases from current framework config
482
+ - **Intent completion**: Available intents for `send` command
483
+ - **Flag completion**: Available flags for each command
484
+
485
+ ## Using ? Style Help
486
+
487
+ OGP provides Cisco IOS-style context-sensitive help with the `?` operator.
488
+
489
+ ### Top-Level Help
490
+
491
+ ```bash
492
+ ogp ?
493
+ ```
494
+
495
+ Output:
496
+
497
+ ```
498
+ Available commands:
499
+ setup Initialize OGP configuration
500
+ start Start OGP daemon
501
+ stop Stop OGP daemon
502
+ status Show daemon status
503
+ federation Manage federation
504
+ agent-comms Configure agent-to-agent messaging
505
+ project Manage projects
506
+ intent Manage custom intents
507
+ config Manage configuration
508
+ expose Manage public tunnel
509
+ install Install LaunchAgent (macOS)
510
+ uninstall Remove LaunchAgent (macOS)
511
+ completion Manage shell completion
512
+
513
+ Use `ogp <command> ?` for more details.
514
+ ```
515
+
516
+ ### Command-Level Help
517
+
518
+ ```bash
519
+ ogp federation ?
520
+ ```
521
+
522
+ Output:
523
+
524
+ ```
525
+ Available federation commands:
526
+ list List all peers
527
+ request Send federation request
528
+ approve Approve pending peer
529
+ reject Reject pending peer
530
+ remove Remove peer
531
+ send Send message to peer
532
+ agent Send agent-comms message
533
+ scopes View/update scopes
534
+ alias Manage peer aliases
535
+ ping Test connectivity
536
+ invite Generate invite code
537
+ accept Accept invite
538
+ connect Connect by public key
539
+
540
+ Use `ogp federation <command> ?` for usage.
541
+ ```
542
+
543
+ ### Command Usage Help
544
+
545
+ ```bash
546
+ ogp federation send ?
547
+ ```
548
+
549
+ Output:
550
+
551
+ ```
552
+ Usage: ogp federation send <peer> <intent> <payload>
553
+
554
+ Arguments:
555
+ peer Peer ID, alias, or display name
556
+ intent Intent type (message, task-request, status-update, agent-comms, project.*)
557
+ payload JSON payload
558
+
559
+ Available peers (openclaw):
560
+ - apollo (Apollo @ Hermes) - approved
561
+ - bob (Bob @ OpenClaw) - approved
562
+
563
+ Example:
564
+ ogp federation send apollo message '{"text":"Hello from OGP!"}'
565
+ ogp federation send bob agent-comms '{"topic":"memory","message":"How do you persist context?"}'
566
+ ```
567
+
568
+ ### Parameter Help
569
+
570
+ ```bash
571
+ ogp federation approve ?
572
+ ```
573
+
574
+ Output:
575
+
576
+ ```
577
+ Usage: ogp federation approve <peer-id> [options]
578
+
579
+ Options:
580
+ --intents <list> Comma-separated intents (message,agent-comms)
581
+ --rate <limit> Rate limit as requests/seconds (100/3600)
582
+ --topics <list> Topics for agent-comms (memory-management,task-delegation)
583
+
584
+ Examples:
585
+ # Approve without restrictions
586
+ ogp federation approve apollo
587
+
588
+ # Approve with scope grants
589
+ ogp federation approve apollo \
590
+ --intents message,agent-comms \
591
+ --rate 100/3600 \
592
+ --topics memory-management,task-delegation
593
+ ```
594
+
595
+ ## Common Workflows
596
+
597
+ ### Single Framework Workflow
598
+
599
+ If you're using only one framework:
600
+
601
+ ```bash
602
+ # Setup (once)
603
+ ogp setup
604
+ ogp start --background
605
+
606
+ # Daily usage (no --for needed)
607
+ ogp federation request https://peer.example.com
608
+ ogp federation list
609
+ ogp federation send apollo message '{"text":"Hello!"}'
610
+ ogp status
611
+ ```
612
+
613
+ ### Multi-Framework Workflow
614
+
615
+ If you're using multiple frameworks:
616
+
617
+ ```bash
618
+ # Setup (once)
619
+ ogp setup
620
+ ogp --for all start --background
621
+ ogp config set-default openclaw
622
+
623
+ # Daily usage with default
624
+ ogp federation list # Uses openclaw (default)
625
+ ogp federation send apollo message '{"text":"Hello!"}'
626
+
627
+ # Explicit framework selection
628
+ ogp --for hermes federation list # Uses hermes
629
+ ogp --for hermes federation send bob message '{"text":"Hi from Hermes!"}'
630
+
631
+ # Cross-framework operations
632
+ ogp --for all status # Check all daemons
633
+ ogp --for all federation list # List all peers
634
+ ```
635
+
636
+ ### Federation Setup Workflow
637
+
638
+ Setting up federation between two peers:
639
+
640
+ **Alice (OpenClaw):**
641
+
642
+ ```bash
643
+ # 1. Start daemon and expose
644
+ ogp start --background
645
+ ogp expose --background
646
+
647
+ # 2. Share gateway URL with Bob
648
+ # Gateway: https://alice.example.com
649
+
650
+ # 3. Request federation with Bob
651
+ ogp federation request https://bob.example.com --alias bob
652
+
653
+ # 4. Wait for Bob's approval
654
+ ogp federation list --status pending
655
+
656
+ # 5. Once approved, send message
657
+ ogp federation send bob message '{"text":"Hello Bob!"}'
658
+ ```
659
+
660
+ **Bob (Hermes):**
661
+
662
+ ```bash
663
+ # 1. Start daemon and expose
664
+ ogp --for hermes start --background
665
+ ogp --for hermes expose --background
666
+
667
+ # 2. Share gateway URL with Alice
668
+ # Gateway: https://bob.example.com
669
+
670
+ # 3. Approve Alice's request
671
+ ogp --for hermes federation list --status pending
672
+ ogp --for hermes federation approve alice \
673
+ --intents message,agent-comms \
674
+ --rate 100/3600 \
675
+ --topics general,memory-management
676
+
677
+ # 4. Send message back
678
+ ogp --for hermes federation send alice message '{"text":"Hello Alice!"}'
679
+ ```
680
+
681
+ ### Agent-to-Agent Communication Workflow
682
+
683
+ Using agent-comms for rich collaboration:
684
+
685
+ ```bash
686
+ # Revisit delegated-authority / human-delivery preferences
687
+ ogp agent-comms interview
688
+
689
+ # Configure response policies first
690
+ ogp agent-comms configure apollo \
691
+ --topics memory-management,task-delegation \
692
+ --level full
693
+
694
+ # Send agent-comms messages
695
+ ogp federation agent apollo memory-management "How do you persist long-term context?"
696
+ ogp federation agent apollo task-delegation "Can you help analyze these logs?" --priority high
697
+
698
+ # Wait for replies
699
+ ogp federation agent apollo queries "What's the status?" --wait --timeout 60000
700
+
701
+ # Check activity log
702
+ ogp agent-comms activity apollo
703
+ ```
704
+
705
+ ### Project Collaboration Workflow
706
+
707
+ Projects sit on top of federation. Use them to capture high-level collaboration context while each person keeps their own tools and workflow:
708
+
709
+ ```bash
710
+ # Create a project
711
+ ogp project create expense-app "Expense Tracker App" \
712
+ --description "Mobile expense tracking application"
713
+
714
+ # Log work by entry type
715
+ ogp project contribute expense-app progress "Completed authentication system"
716
+ ogp project contribute expense-app decision "Using PostgreSQL for persistence"
717
+ ogp project contribute expense-app blocker "Waiting for API key approval"
718
+
719
+ # Ask a collaborator about project context
720
+ ogp federation agent apollo expense-app "I'm about to work on auth. Anything I should know?"
721
+
722
+ # Share with peer
723
+ ogp project send-contribution apollo expense-app progress "Deployed staging environment"
724
+
725
+ # Query peer's contributions
726
+ ogp project query-peer apollo expense-app --limit 10
727
+
728
+ # Check project status
729
+ ogp project status expense-app
730
+ ```
731
+
732
+ ## Troubleshooting
733
+
734
+ ### No Frameworks Detected
735
+
736
+ **Problem:** Setup wizard doesn't detect your framework.
737
+
738
+ **Solution:**
739
+
740
+ 1. Check framework is installed:
741
+ ```bash
742
+ ls ~/.openclaw/ # OpenClaw
743
+ ls ~/.hermes/ # Hermes
744
+ ```
745
+
746
+ 2. Use standalone mode:
747
+ ```bash
748
+ # Select "Standalone" during setup
749
+ ogp setup
750
+ ```
751
+
752
+ 3. Set OGP_HOME manually:
753
+ ```bash
754
+ export OGP_HOME=~/.ogp-custom
755
+ ogp setup
756
+ ```
757
+
758
+ ### Which Framework? Prompt
759
+
760
+ **Problem:** OGP prompts for framework on every command.
761
+
762
+ **Solution:** Set a default framework:
763
+
764
+ ```bash
765
+ ogp config set-default openclaw
766
+ ```
767
+
768
+ ### Wrong Framework Selected
769
+
770
+ **Problem:** Command runs on wrong framework.
771
+
772
+ **Solution:**
773
+
774
+ 1. Check current config:
775
+ ```bash
776
+ ogp config list
777
+ ```
778
+
779
+ 2. Use explicit `--for` flag:
780
+ ```bash
781
+ ogp --for openclaw federation list
782
+ ```
783
+
784
+ 3. Change default:
785
+ ```bash
786
+ ogp config set-default hermes
787
+ ```
788
+
789
+ ### Daemon Won't Start
790
+
791
+ **Problem:** `ogp start` fails.
792
+
793
+ **Solution:**
794
+
795
+ 1. Check if already running:
796
+ ```bash
797
+ ogp status
798
+ ```
799
+
800
+ 2. Check port availability:
801
+ ```bash
802
+ lsof -i :18790 # OpenClaw default
803
+ lsof -i :18793 # Hermes default
804
+ ```
805
+
806
+ 3. Check logs:
807
+ ```bash
808
+ # Foreground mode shows logs
809
+ ogp start
810
+ ```
811
+
812
+ 4. Verify config:
813
+ ```bash
814
+ cat ~/.ogp-openclaw/config.json # OpenClaw
815
+ cat ~/.ogp-hermes/config.json # Hermes
816
+ ```
817
+
818
+ ### Gateway Not Reachable
819
+
820
+ **Problem:** Peers can't reach your gateway.
821
+
822
+ **Solution:**
823
+
824
+ 1. Test locally first:
825
+ ```bash
826
+ curl http://localhost:18790/.well-known/ogp
827
+ ```
828
+
829
+ 2. Check tunnel is running:
830
+ ```bash
831
+ ogp expose status
832
+ ```
833
+
834
+ 3. Test public URL:
835
+ ```bash
836
+ curl https://your-gateway.example.com/.well-known/ogp
837
+ ```
838
+
839
+ 4. Verify gateway URL in config:
840
+ ```bash
841
+ ogp config show
842
+ ```
843
+
844
+ ### Peer Not Approved
845
+
846
+ **Problem:** "Peer not approved" error when sending message.
847
+
848
+ **Solution:**
849
+
850
+ 1. Check peer status:
851
+ ```bash
852
+ ogp federation list
853
+ ```
854
+
855
+ 2. Request federation if not initiated:
856
+ ```bash
857
+ ogp federation request https://peer.example.com
858
+ ```
859
+
860
+ 3. Wait for peer to approve your request
861
+
862
+ ### Scope Not Granted (403)
863
+
864
+ **Problem:** "Scope not granted" or 403 error.
865
+
866
+ **Solution:**
867
+
868
+ 1. Check granted scopes:
869
+ ```bash
870
+ ogp federation scopes apollo
871
+ ```
872
+
873
+ 2. Request peer to update grants:
874
+ ```bash
875
+ # Ask peer to run:
876
+ ogp federation grant <your-id> \
877
+ --intents agent-comms \
878
+ --topics memory-management
879
+ ```
880
+
881
+ ### Rate Limit Exceeded (429)
882
+
883
+ **Problem:** "Rate limit exceeded" or 429 error.
884
+
885
+ **Solution:**
886
+
887
+ 1. Wait for rate limit window to reset
888
+
889
+ 2. Check current rate limit:
890
+ ```bash
891
+ ogp federation scopes apollo
892
+ ```
893
+
894
+ 3. Request higher limit from peer
895
+
896
+ ### Tab Completion Not Working
897
+
898
+ **Problem:** Tab completion doesn't work.
899
+
900
+ **Solution:**
901
+
902
+ 1. Verify installation:
903
+ ```bash
904
+ cat ~/.bashrc | grep ogp-completion # Bash
905
+ cat ~/.zshrc | grep ogp-completion # Zsh
906
+ ```
907
+
908
+ 2. Reinstall completion:
909
+ ```bash
910
+ ogp completion install bash # or zsh
911
+ ```
912
+
913
+ 3. Reload shell:
914
+ ```bash
915
+ source ~/.bashrc # or ~/.zshrc
916
+ ```
917
+
918
+ ### Migration Issues
919
+
920
+ **Problem:** Existing config not migrated properly.
921
+
922
+ **Solution:**
923
+
924
+ 1. Check migration status:
925
+ ```bash
926
+ ogp config list
927
+ ```
928
+
929
+ 2. Manual migration:
930
+ ```bash
931
+ # Backup current config
932
+ cp -r ~/.ogp ~/.ogp.backup
933
+
934
+ # Rename to framework-specific
935
+ mv ~/.ogp ~/.ogp-openclaw
936
+
937
+ # Run setup to create meta-config
938
+ ogp setup
939
+ ```
940
+
941
+ 3. Verify migration:
942
+ ```bash
943
+ ls ~/.ogp-meta/
944
+ ls ~/.ogp-openclaw/
945
+ ```
946
+
947
+ ## Next Steps
948
+
949
+ - Read [Federation Flow](./federation-flow.md) for message flow details
950
+ - Learn about [Scope Negotiation](./scopes.md) for access control
951
+ - Explore [Agent Communications](./agent-comms.md) for agent-to-agent messaging
952
+ - Check [CLI Reference](./CLI-REFERENCE.md) for complete command documentation
953
+ - Install [Claude Code skills](../skills/) for agent integration