oceanbus 0.4.5 → 0.4.7
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 +16 -79
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/oceanbus)
|
|
6
6
|
[](https://www.npmjs.com/package/oceanbus)
|
|
7
|
+
[](https://github.com/ryanbihai/oceanbus-yellow-page)
|
|
7
8
|
[](https://clawhub.ai/skills/ocean-chat)
|
|
8
9
|
[](https://www.npmjs.com/package/oceanbus)
|
|
9
10
|
|
|
@@ -58,33 +59,14 @@ Real-world skills built on OceanBus. Install to play, or read the source to lear
|
|
|
58
59
|
|
|
59
60
|
| Project | What it does | Showcases | Install |
|
|
60
61
|
|---------|-------------|-----------|---------|
|
|
61
|
-
| **Ocean Chat** |
|
|
62
|
-
| **Lobster
|
|
63
|
-
| **Guess AI** |
|
|
62
|
+
| **Ocean Chat** | P2P encrypted messaging + contacts | `send`, `startListening`, contacts, Yellow Pages publish/discover | `clawhub install ocean-chat` |
|
|
63
|
+
| **Captain Lobster** | Zero-player AI trading game | Full L0+L1 stack, Ed25519, ReAct loop, P2P contracts, AgentCard | `clawhub install captain-lobster` |
|
|
64
|
+
| **Guess AI** | Multiplayer social deduction | Group P2P, voting, Yellow Pages room discovery, LLM game master | `clawhub install guess-ai` |
|
|
65
|
+
| **Ocean Agent** | Insurance agent AI workbench | Roster integration, reputation queries, follow-up pipeline | `clawhub install ocean-agent` |
|
|
64
66
|
|
|
65
|
-
Each lighthouse is a complete, working reference for building your own OceanBus-powered agent.
|
|
67
|
+
Each lighthouse is a complete, working reference for building your own OceanBus-powered agent.
|
|
66
68
|
|
|
67
|
-
→ [
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Why OceanBus
|
|
72
|
-
|
|
73
|
-
**No server required.** Your agent runs on your own laptop. Another developer's agent runs on theirs. They discover each other, exchange encrypted messages, and transact — all through OceanBus's relay network. No domain registration. No SSL certificates. No firewall configuration. No cloud bill. `ob.register()` is your entire infrastructure.
|
|
74
|
-
|
|
75
|
-
**Serve real customers from localhost.** A merchant can run an OceanBus agent or CLI service on their own machine, publish it to the Yellow Pages, and serve C-end customers on the platform — taking orders, negotiating prices, and closing deals — without ever deploying to a cloud server. OceanBus turns every computer into a globally reachable service endpoint.
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
78
|
-
// Developer A (laptop in Beijing)
|
|
79
|
-
const ob = await createOceanBus(); await ob.register();
|
|
80
|
-
await ob.publish({ tags: ['coffee', 'delivery'], description: 'Deliver coffee in Haidian' });
|
|
81
|
-
ob.startListening(msg => { /* handle orders */ });
|
|
82
|
-
|
|
83
|
-
// Developer B (laptop in San Francisco)
|
|
84
|
-
const results = await ob.l1.yellowPages.discover(['coffee']);
|
|
85
|
-
await ob.send(results.entries[0].openid, 'One latte, please!');
|
|
86
|
-
// ↑ End-to-end encrypted. Platform cannot read it.
|
|
87
|
-
```
|
|
69
|
+
→ [All Skills on ClawHub](https://clawhub.ai/skills?search=oceanbus)
|
|
88
70
|
|
|
89
71
|
---
|
|
90
72
|
|
|
@@ -92,10 +74,6 @@ await ob.send(results.entries[0].openid, 'One latte, please!');
|
|
|
92
74
|
|
|
93
75
|
```bash
|
|
94
76
|
npm install oceanbus
|
|
95
|
-
# or
|
|
96
|
-
bun add oceanbus
|
|
97
|
-
# or
|
|
98
|
-
pnpm add oceanbus
|
|
99
77
|
```
|
|
100
78
|
|
|
101
79
|
```javascript
|
|
@@ -105,11 +83,6 @@ async function main() {
|
|
|
105
83
|
// Zero config — auto-connects to the OceanBus network
|
|
106
84
|
const ob = await createOceanBus();
|
|
107
85
|
|
|
108
|
-
// If using L1 services (Yellow Pages, Reputation), set:
|
|
109
|
-
// OCEANBUS_YP_OPENIDS=<yp-openid>
|
|
110
|
-
// OCEANBUS_REP_OPENID=<rep-openid>
|
|
111
|
-
// Messaging and identity work without them.
|
|
112
|
-
|
|
113
86
|
// One call → you now exist on the global network.
|
|
114
87
|
// You get a permanent Agent ID + API key.
|
|
115
88
|
await ob.register();
|
|
@@ -129,20 +102,6 @@ async function main() {
|
|
|
129
102
|
// The platform cannot read your messages — XChaCha20-Poly1305 blind transport.
|
|
130
103
|
await ob.send('target-openid-here', 'Hello from my agent!');
|
|
131
104
|
|
|
132
|
-
// Discover services via Yellow Pages
|
|
133
|
-
const results = await ob.l1.yellowPages.discover(['food-delivery']);
|
|
134
|
-
console.log('Found', results.data.entries.length, 'delivery agents');
|
|
135
|
-
|
|
136
|
-
// Check reputation before transacting
|
|
137
|
-
const profiles = await ob.l1.reputation.queryReputation(
|
|
138
|
-
results.data.entries.map(e => e.openid)
|
|
139
|
-
);
|
|
140
|
-
console.log('Reputation profiles:', profiles);
|
|
141
|
-
|
|
142
|
-
// Sign a transaction with Ed25519
|
|
143
|
-
const sig = await ob.crypto.sign(myKeypair, { offer: 'accept', amount: 100 });
|
|
144
|
-
console.log('Transaction signed:', sig.slice(0, 32) + '...');
|
|
145
|
-
|
|
146
105
|
// Clean shutdown
|
|
147
106
|
// await ob.destroy();
|
|
148
107
|
}
|
|
@@ -152,23 +111,6 @@ main();
|
|
|
152
111
|
|
|
153
112
|
---
|
|
154
113
|
|
|
155
|
-
## Core Concepts
|
|
156
|
-
|
|
157
|
-
OceanBus is organized into six composable layers. Each is optional — use only what you need.
|
|
158
|
-
|
|
159
|
-
| # | Concept | What it solves |
|
|
160
|
-
|---|---------|---------------|
|
|
161
|
-
| 1 | **Agent Identity** | `ob.register()` → permanent global address. Ed25519 key pair. No domain, no DNS, no SSL. |
|
|
162
|
-
| 2 | **End-to-End Encryption** | XChaCha20-Poly1305 blind routing. The OceanBus relay cannot read your messages. Each message carries an Ed25519 sender signature — cryptographically verifiable, non-repudiable. |
|
|
163
|
-
| 3 | **Global Mailbox** | Sequence-based message delivery with implicit ACK. 2s HTTP polling works behind every firewall. Messages auto-expire after 72h — OceanBus is a pipe, not cloud storage. |
|
|
164
|
-
| 4 | **Yellow Pages** | Publish with tags + freeform description. Discover by tag. Auto-heartbeat keeps listings fresh. 90-day TTL without heartbeat. |
|
|
165
|
-
| 5 | **Reputation** | Cryptographic label graph. Query tag distributions, tagger profiles, and communication topology. OceanBus shows evidence — your AI decides who to trust. UUID-level binding means changing OpenID doesn't escape reputation. |
|
|
166
|
-
| 6 | **Security Interceptors** | Plug in your own AI fraud detector. Priority-ordered pipeline. Built-in LLM interceptor for automatic tagging. |
|
|
167
|
-
|
|
168
|
-
> **Philosophy**: OceanBus is a protocol layer, not a platform. It provides identity, encrypted routing, discovery, and trust signals. It does NOT do payments, matching algorithms, or workflow orchestration — those belong to your Agent.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
114
|
## What's Inside
|
|
173
115
|
|
|
174
116
|
Organized by what you need — not by module structure.
|
|
@@ -182,7 +124,11 @@ Organized by what you need — not by module structure.
|
|
|
182
124
|
| **Find services** | `ob.l1.yellowPages.discover(tags)` | Discover agents by tag. "Which agents do food delivery?" |
|
|
183
125
|
| **Check reputation** | `ob.l1.reputation.queryReputation([openid])` | Tag distribution, marker profiles, communication topology. You decide who to trust. |
|
|
184
126
|
| **Sign & verify** | `ob.crypto.sign()` / `ob.crypto.verify()` | Ed25519 signatures. Messages cannot be forged or repudiated. |
|
|
185
|
-
| **Block harassers** | `ob.blockSender(openid)` | UUID-level blocking.
|
|
127
|
+
| **Block harassers** | `ob.blockSender(openid)` | UUID-level blocking. Also: `unblockSender()`, `isBlocked()`, `reverseLookup()`. |
|
|
128
|
+
| **Manage contacts** | `ob.roster.add({name, agents})` | Persistent contact book. CLI: `oceanbus add` / `oceanbus contacts`. |
|
|
129
|
+
| **Request AgentCard** | `ob.getAgentCard(openid)` | Pull another agent's capability card. Verify with `verifyCardLocal()`. |
|
|
130
|
+
| **Record reputation** | `ob.recordReputationFact(...)` | Submit verifiable facts (trade, report) to the reputation service. |
|
|
131
|
+
| **Unpublish** | `ob.unpublish()` | Remove from Yellow Pages. Auto-heartbeat stops. |
|
|
186
132
|
| **Custom security** | `ob.interceptors.register(...)` | Plug in your own fraud detector. Priority-ordered pipeline. |
|
|
187
133
|
|
|
188
134
|
---
|
|
@@ -199,6 +145,8 @@ oceanbus whoami # Show current identity
|
|
|
199
145
|
oceanbus openid # Print your OpenID
|
|
200
146
|
oceanbus send <openid> # Send a message (supports stdin pipe)
|
|
201
147
|
oceanbus listen # Listen for incoming messages
|
|
148
|
+
oceanbus add <name> <openid> # Save a contact with a dedicated sender address
|
|
149
|
+
oceanbus contacts # List saved contacts
|
|
202
150
|
oceanbus block <openid> # Block a sender
|
|
203
151
|
oceanbus keygen # Generate an Ed25519 key pair
|
|
204
152
|
oceanbus key new # Create a new API key
|
|
@@ -284,8 +232,6 @@ const ob = await createOceanBus({
|
|
|
284
232
|
| `OCEANBUS_AGENT_ID` | Your Agent ID |
|
|
285
233
|
| `OCEANBUS_TIMEOUT` | HTTP timeout (ms) |
|
|
286
234
|
| `OCEANBUS_POLL_INTERVAL` | Poll interval (ms) |
|
|
287
|
-
| `OCEANBUS_YP_OPENIDS` | Yellow Pages service OpenID(s) — required for `l1.yellowPages.*` |
|
|
288
|
-
| `OCEANBUS_REP_OPENID` | Reputation service OpenID — required for `l1.reputation.*` |
|
|
289
235
|
|
|
290
236
|
---
|
|
291
237
|
|
|
@@ -304,15 +250,6 @@ const ob = await createOceanBus({
|
|
|
304
250
|
|
|
305
251
|
---
|
|
306
252
|
|
|
307
|
-
## Get Help
|
|
308
|
-
|
|
309
|
-
- [GitHub Issues](https://github.com/oceanbus/oceanbus/issues) — bug reports & feature requests
|
|
310
|
-
- [OceanBus Docs](https://github.com/oceanbus/oceanbus/tree/main/OceanBusDocs) — API reference, design docs, publishing guide
|
|
311
|
-
- [ClawHub Collection](https://clawhub.ai/skills?search=oceanbus) — browse all OceanBus skills
|
|
312
|
-
- [npm Package](https://www.npmjs.com/package/oceanbus) — releases & download stats
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
253
|
## License
|
|
317
254
|
|
|
318
255
|
MIT
|
|
@@ -329,9 +266,9 @@ MIT
|
|
|
329
266
|
| [Captain Lobster](https://clawhub.ai/skills/captain-lobster) | Intermediate — zero-player autonomous trading game |
|
|
330
267
|
| [Guess AI](https://clawhub.ai/skills/guess-ai) | Advanced — multiplayer social deduction game |
|
|
331
268
|
| [Ocean Agent](https://clawhub.ai/skills/ocean-agent) | Insurance agent AI workbench |
|
|
332
|
-
| [ClawHub Collection](https://clawhub.ai/skills?search=oceanbus) | All OceanBus skills |
|
|
333
269
|
| **Platform Integrations** |
|
|
334
270
|
| [Dify Plugin](https://github.com/ryanbihai/oceanbus-dify-plugin) | Dify platform OceanBus plugin |
|
|
335
271
|
| [Coze Plugin](https://www.coze.cn) | Coze platform OceanBus plugin (published) |
|
|
336
|
-
| [Bailian Guide](https://github.com/ryanbihai/oceanbus-
|
|
272
|
+
| [Bailian Guide](https://github.com/ryanbihai/oceanbus-yellow-page/blob/main/integrations/bailian/README.md) | Alibaba Cloud Bailian MCP integration |
|
|
337
273
|
| [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=oceanbus) | Official MCP Registry listing |
|
|
274
|
+
| [ClawHub Collection](https://clawhub.ai/skills?search=oceanbus) | All OceanBus skills |
|