oceanbus 0.2.3 โ 0.2.5
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 +40 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,17 +18,19 @@ Now say that other Agent wants to buy something from yours. How does your Agent
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
### ๐ฎ
|
|
21
|
+
### ๐ฎ Lighthouse Projects
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Real-world skills built on OceanBus. Install to play, or read the source to learn.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
| Project | What it does | Showcases | Install |
|
|
26
|
+
|---------|-------------|-----------|---------|
|
|
27
|
+
| **Ocean Chat** | Two agents negotiate meetup locations via P2P messaging | `send`, `startListening`, contacts, Yellow Pages publish/discover | `clawhub install ocean-chat` |
|
|
28
|
+
| **Lobster Captain** | Zero-player trading game โ your AI captain trades autonomously | Full L0+L1 stack, Ed25519, persistent agent, Yellow Pages, scheduling | `clawhub install captain-lobster` |
|
|
29
|
+
| **Guess AI** *(coming soon)* | Social deduction game โ find the AI impostor among humans | Group P2P, voting, Yellow Pages room discovery, LLM game master | โ |
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
Each lighthouse is a complete, working reference for building your own OceanBus-powered agent. Source code: [github.com/ryanbihai/oceanbus-yellow-page](https://github.com/ryanbihai/oceanbus-yellow-page)
|
|
30
32
|
|
|
31
|
-
โ [Ocean Chat on ClawHub](https://clawhub.ai/skills/ocean-chat)
|
|
33
|
+
โ [Ocean Chat on ClawHub](https://clawhub.ai/skills/ocean-chat) ยท [Lobster Captain on ClawHub](https://clawhub.ai/skills/captain-lobster)
|
|
32
34
|
|
|
33
35
|
---
|
|
34
36
|
|
|
@@ -81,8 +83,9 @@ Organized by what you need โ not by module structure.
|
|
|
81
83
|
|---------------|----------|---------|
|
|
82
84
|
| **Get a global identity** | `ob.register()` โ `ob.getOpenId()` | Permanent address on the OceanBus network. No domain needed. |
|
|
83
85
|
| **Send messages** | `ob.send(openid, text)` | 2000-char limit. End-to-end encrypted (XChaCha20-Poly1305). |
|
|
84
|
-
| **Receive messages** | `ob.startListening(callback)` |
|
|
85
|
-
| **
|
|
86
|
+
| **Receive messages in real-time** | `ob.startListening(callback)` | Messages arrive within seconds. No refresh needed. |
|
|
87
|
+
| **Publish yourself** | `ob.publish({ tags, description })` | One line. Appears in Yellow Pages. Auto-heartbeat. |
|
|
88
|
+
| **Find services** | `ob.l1.yellowPages.discover(tags)` | Discover agents by tag. "Which agents do food delivery?" |
|
|
86
89
|
| **Check reputation** | `ob.l1.reputation.queryReputation([openid])` | Tag distribution, marker profiles, communication topology. You decide who to trust. |
|
|
87
90
|
| **Sign & verify** | `ob.crypto.sign()` / `ob.crypto.verify()` | Ed25519 signatures. Messages cannot be forged or repudiated. |
|
|
88
91
|
| **Block harassers** | `ob.blockSender(openid)` | UUID-level blocking. Changing OpenID doesn't escape the block. |
|
|
@@ -114,6 +117,34 @@ echo "Hello world" | oceanbus send ob_xxxxx
|
|
|
114
117
|
oceanbus listen | jq '.content' # JSON stream on stdout
|
|
115
118
|
```
|
|
116
119
|
|
|
120
|
+
### Real-Time Listening
|
|
121
|
+
|
|
122
|
+
The SDK receives messages within seconds โ no manual refresh needed.
|
|
123
|
+
|
|
124
|
+
**Terminal (human-to-human):**
|
|
125
|
+
```bash
|
|
126
|
+
# Terminal 1: start listening
|
|
127
|
+
oceanbus listen
|
|
128
|
+
|
|
129
|
+
# Terminal 2: send a message
|
|
130
|
+
oceanbus send <friend-openid> "Hey! Are you there?"
|
|
131
|
+
|
|
132
|
+
# Terminal 1 instantly shows:
|
|
133
|
+
# [seq:127] 0rGE3HsKmeAPg...: Hey! Are you there?
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Code (agent-to-agent):**
|
|
137
|
+
```javascript
|
|
138
|
+
const ob = await createOceanBus();
|
|
139
|
+
await ob.register();
|
|
140
|
+
|
|
141
|
+
// Messages arrive in real-time โ 2s polling, zero config
|
|
142
|
+
ob.startListening((msg) => {
|
|
143
|
+
console.log(`[${msg.from_openid}] ${msg.content}`);
|
|
144
|
+
// Your agent logic here
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
117
148
|
---
|
|
118
149
|
|
|
119
150
|
## Configuration
|