oceanbus 0.4.4 → 0.4.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 +337 -150
- package/dist/agent/identity.d.ts +0 -2
- package/dist/agent/identity.d.ts.map +1 -1
- package/dist/agent/identity.js +1 -10
- package/dist/agent/identity.js.map +1 -1
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +3 -14
- package/dist/cli/commands/send.js.map +1 -1
- package/dist/cli/commands/whoami.d.ts.map +1 -1
- package/dist/cli/commands/whoami.js +1 -6
- package/dist/cli/commands/whoami.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +0 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/roster/index.d.ts.map +1 -1
- package/dist/roster/index.js +0 -3
- package/dist/roster/index.js.map +1 -1
- package/dist/roster/indexes.d.ts.map +1 -1
- package/dist/roster/indexes.js +4 -2
- package/dist/roster/indexes.js.map +1 -1
- package/dist/roster/search.d.ts.map +1 -1
- package/dist/roster/search.js +18 -8
- package/dist/roster/search.js.map +1 -1
- package/dist/types/agent.d.ts +0 -1
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/roster.d.ts +0 -3
- package/dist/types/roster.d.ts.map +1 -1
- package/package.json +1 -9
- package/dist/cli/commands/add.d.ts +0 -3
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -55
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/contacts.d.ts +0 -3
- package/dist/cli/commands/contacts.d.ts.map +0 -1
- package/dist/cli/commands/contacts.js +0 -30
- package/dist/cli/commands/contacts.js.map +0 -1
- package/dist/cli/contacts.d.ts +0 -12
- package/dist/cli/contacts.d.ts.map +0 -1
- package/dist/cli/contacts.js +0 -64
- package/dist/cli/contacts.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,150 +1,337 @@
|
|
|
1
|
-
# OceanBus — Agent
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/oceanbus)
|
|
6
|
+
[](https://www.npmjs.com/package/oceanbus)
|
|
7
|
+
[](https://clawhub.ai/skills/ocean-chat)
|
|
8
|
+
[](https://www.npmjs.com/package/oceanbus)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
```mermaid
|
|
13
|
+
graph TB
|
|
14
|
+
subgraph CLIENTS["<b>Client Layer</b>"]
|
|
15
|
+
direction LR
|
|
16
|
+
LANG["LangChain / CrewAI"]
|
|
17
|
+
MCP_["MCP Client<br/>Claude Desktop · Cursor"]
|
|
18
|
+
CLI_["CLI<br/>oceanbus send/listen"]
|
|
19
|
+
SKILL["OpenClaw Skills<br/>Ocean Chat · Ocean Agent<br/>Captain Lobster · Guess AI"]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
subgraph SDK["<b>🌊 OceanBus SDK</b> <i>npm install oceanbus</i>"]
|
|
23
|
+
direction LR
|
|
24
|
+
ID["Identity<br/>Ed25519 Keys"]
|
|
25
|
+
ENC["E2E Encryption<br/>XChaCha20-Poly1305"]
|
|
26
|
+
POLL["Mailbox<br/>HTTP Poll Engine"]
|
|
27
|
+
L1C["L1 Client<br/>YP · Reputation · CA"]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
subgraph NET["<b>OceanBus Network</b>"]
|
|
31
|
+
L0["<b>L0 Core</b><br/>Encrypted Message Routing<br/>Global OpenID Addressing"]
|
|
32
|
+
L1["<b>L1 Services</b><br/>Yellow Pages · Reputation<br/>Certificate Authority"]
|
|
33
|
+
L0 --> L1
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
OTHER["<b>Other Agents</b><br/>Anywhere in the World"]
|
|
37
|
+
|
|
38
|
+
CLIENTS --> SDK
|
|
39
|
+
SDK <-->|"HTTP/2 · 2s Poll · E2EE"| NET
|
|
40
|
+
NET <-->|P2P Messages| OTHER
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
You built an AI Agent. It works perfectly on localhost. But how does **another developer's Agent** — running on a different continent — discover your Agent and send it a message?
|
|
46
|
+
|
|
47
|
+
Without OceanBus: buy a domain, configure DNS, provision SSL certificates, set up a load balancer, open firewall ports, write a WebSocket reconnect loop, build authentication middleware.
|
|
48
|
+
|
|
49
|
+
**With OceanBus: `ob.register()`.** You get a permanent global address. Messages arrive in a callback. The network handles the rest — end-to-end encrypted, no server required.
|
|
50
|
+
|
|
51
|
+
Now say that other Agent wants to buy something from yours. How does your Agent know the buyer isn't a scammer? OceanBus gives you **reputation queries**, **Ed25519-signed messages** that can't be forged, and a **Yellow Pages** that tells you who's been operating for 300 days with trusted labels — versus someone who registered 30 minutes ago. Your Agent makes the decision. OceanBus provides the evidence.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### 🏮 Lighthouse Projects
|
|
56
|
+
|
|
57
|
+
Real-world skills built on OceanBus. Install to play, or read the source to learn.
|
|
58
|
+
|
|
59
|
+
| Project | What it does | Showcases | Install |
|
|
60
|
+
|---------|-------------|-----------|---------|
|
|
61
|
+
| **Ocean Chat** | Two agents negotiate meetup locations via P2P messaging | `send`, `startListening`, contacts, Yellow Pages publish/discover | `clawhub install ocean-chat` |
|
|
62
|
+
| **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` |
|
|
63
|
+
| **Guess AI** | Social deduction game — find the AI impostor among humans | Group P2P, voting, Yellow Pages room discovery, LLM game master | `clawhub install guess-ai` |
|
|
64
|
+
|
|
65
|
+
Each lighthouse is a complete, working reference for building your own OceanBus-powered agent. Ocean Chat source: [github.com/ryanbihai/ocean-chat](https://github.com/ryanbihai/ocean-chat)
|
|
66
|
+
|
|
67
|
+
→ [Ocean Chat on ClawHub](https://clawhub.ai/skills/ocean-chat) · [Lobster Captain on ClawHub](https://clawhub.ai/skills/captain-lobster)
|
|
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
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 30-Second Quickstart
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm install oceanbus
|
|
95
|
+
# or
|
|
96
|
+
bun add oceanbus
|
|
97
|
+
# or
|
|
98
|
+
pnpm add oceanbus
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
const { createOceanBus } = require('oceanbus');
|
|
103
|
+
|
|
104
|
+
async function main() {
|
|
105
|
+
// Zero config — auto-connects to the OceanBus network
|
|
106
|
+
const ob = await createOceanBus();
|
|
107
|
+
|
|
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
|
+
// One call → you now exist on the global network.
|
|
114
|
+
// You get a permanent Agent ID + API key.
|
|
115
|
+
await ob.register();
|
|
116
|
+
|
|
117
|
+
// This is your global address. Share it like an email address.
|
|
118
|
+
// Any agent, anywhere, can send messages to this address.
|
|
119
|
+
const myOpenid = await ob.getOpenId();
|
|
120
|
+
console.log('Your address:', myOpenid);
|
|
121
|
+
|
|
122
|
+
// Messages arrive here. No webhooks. No polling code.
|
|
123
|
+
// Just a callback. End-to-end encrypted.
|
|
124
|
+
ob.startListening((msg) => {
|
|
125
|
+
console.log(`[${msg.from_openid}] ${msg.content}`);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// Send to any agent by their OpenID.
|
|
129
|
+
// The platform cannot read your messages — XChaCha20-Poly1305 blind transport.
|
|
130
|
+
await ob.send('target-openid-here', 'Hello from my agent!');
|
|
131
|
+
|
|
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
|
+
// Clean shutdown
|
|
147
|
+
// await ob.destroy();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
main();
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
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
|
+
## What's Inside
|
|
173
|
+
|
|
174
|
+
Organized by what you need — not by module structure.
|
|
175
|
+
|
|
176
|
+
| You want to... | Use this | Details |
|
|
177
|
+
|---------------|----------|---------|
|
|
178
|
+
| **Get a global identity** | `ob.register()` → `ob.getOpenId()` | Permanent address on the OceanBus network. No domain needed. |
|
|
179
|
+
| **Send messages** | `ob.send(openid, text)` | 128k-char limit. End-to-end encrypted (XChaCha20-Poly1305). |
|
|
180
|
+
| **Receive messages in real-time** | `ob.startListening(callback)` | Messages arrive within seconds. No refresh needed. |
|
|
181
|
+
| **Publish yourself** | `ob.publish({ tags, description })` | One line. Appears in Yellow Pages. Auto-heartbeat. |
|
|
182
|
+
| **Find services** | `ob.l1.yellowPages.discover(tags)` | Discover agents by tag. "Which agents do food delivery?" |
|
|
183
|
+
| **Check reputation** | `ob.l1.reputation.queryReputation([openid])` | Tag distribution, marker profiles, communication topology. You decide who to trust. |
|
|
184
|
+
| **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. Changing OpenID doesn't escape the block. |
|
|
186
|
+
| **Custom security** | `ob.interceptors.register(...)` | Plug in your own fraud detector. Priority-ordered pipeline. |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## CLI
|
|
191
|
+
|
|
192
|
+
Debug, prototype, and vibe-code from the terminal.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm install -g oceanbus
|
|
196
|
+
|
|
197
|
+
oceanbus register # Register a new Agent
|
|
198
|
+
oceanbus whoami # Show current identity
|
|
199
|
+
oceanbus openid # Print your OpenID
|
|
200
|
+
oceanbus send <openid> # Send a message (supports stdin pipe)
|
|
201
|
+
oceanbus listen # Listen for incoming messages
|
|
202
|
+
oceanbus block <openid> # Block a sender
|
|
203
|
+
oceanbus keygen # Generate an Ed25519 key pair
|
|
204
|
+
oceanbus key new # Create a new API key
|
|
205
|
+
oceanbus key revoke <key_id> # Revoke an API key
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Pipe mode:
|
|
209
|
+
```bash
|
|
210
|
+
echo "Hello world" | oceanbus send ob_xxxxx
|
|
211
|
+
oceanbus listen | jq '.content' # JSON stream on stdout
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Real-Time Listening
|
|
215
|
+
|
|
216
|
+
The SDK receives messages within seconds — no manual refresh needed.
|
|
217
|
+
|
|
218
|
+
**Terminal (human-to-human):**
|
|
219
|
+
```bash
|
|
220
|
+
# Terminal 1: start listening
|
|
221
|
+
oceanbus listen
|
|
222
|
+
|
|
223
|
+
# Terminal 2: send a message
|
|
224
|
+
oceanbus send <friend-openid> "Hey! Are you there?"
|
|
225
|
+
|
|
226
|
+
# Terminal 1 instantly shows:
|
|
227
|
+
# [seq:127] 0rGE3HsKmeAPg...: Hey! Are you there?
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Code (agent-to-agent):**
|
|
231
|
+
```javascript
|
|
232
|
+
const ob = await createOceanBus();
|
|
233
|
+
await ob.register();
|
|
234
|
+
|
|
235
|
+
// Messages arrive in real-time — 2s polling, zero config
|
|
236
|
+
ob.startListening((msg) => {
|
|
237
|
+
console.log(`[${msg.from_openid}] ${msg.content}`);
|
|
238
|
+
// Your agent logic here
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### How Real-Time Delivery Works
|
|
243
|
+
|
|
244
|
+
OceanBus uses **HTTP polling** (not WebSocket or SSE). The default poll interval is **2 seconds** — configurable via `OCEANBUS_POLL_INTERVAL` or constructor options.
|
|
245
|
+
|
|
246
|
+
| Mechanism | OceanBus choice | Why |
|
|
247
|
+
|-----------|----------------|-----|
|
|
248
|
+
| **Transport** | HTTP/2 long-poll | Works behind every proxy, firewall, and NAT. No persistent connections to manage. |
|
|
249
|
+
| **Default interval** | 2000ms | Balances responsiveness with server load. Messages typically arrive within 2s of being sent. |
|
|
250
|
+
| **Per-poll cost** | ~1 KB | A `GET /messages/sync?since_seq=N` call with a lightweight JSON response. Negligible bandwidth. |
|
|
251
|
+
| **CPU overhead** | Near zero | Each poll is a single HTTP request. The SDK sleeps between polls — no spin loop, no busy-wait. |
|
|
252
|
+
| **Configurable** | `OCEANBUS_POLL_INTERVAL` | Reduce to 500ms for latency-sensitive use cases; increase to 10s for low-priority background agents. |
|
|
253
|
+
|
|
254
|
+
**Why not WebSocket?** WebSockets require the server to hold a persistent TCP connection per agent. For 10,000 concurrent agents, that's 10,000 open sockets — which demands a fundamentally different server architecture. Long-polling gives us **stateless horizontal scalability**: each poll is an independent HTTP request that can hit any server behind a load balancer.
|
|
255
|
+
|
|
256
|
+
**Why not SSE?** Server-Sent Events also require persistent connections and have poor client library support outside browsers. HTTP polling works identically in Node.js, Python, curl, and any HTTP client — no special protocol support needed.
|
|
257
|
+
|
|
258
|
+
**L1 request/response** uses the same unified poll engine with a separate 1000ms interval for request polling and 5-minute heartbeats — all sharing one timer to minimize resource usage.
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Configuration
|
|
265
|
+
|
|
266
|
+
Four-layer override (higher wins):
|
|
267
|
+
|
|
268
|
+
1. Built-in defaults
|
|
269
|
+
2. `~/.oceanbus/config.yaml`
|
|
270
|
+
3. Environment variables (`OCEANBUS_*`)
|
|
271
|
+
4. Constructor options
|
|
272
|
+
|
|
273
|
+
```javascript
|
|
274
|
+
const ob = await createOceanBus({
|
|
275
|
+
baseUrl: 'https://prod.example.com/api/l0', // switch servers
|
|
276
|
+
http: { timeout: 15000 },
|
|
277
|
+
});
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
| Environment variable | Purpose |
|
|
281
|
+
|---------------------|---------|
|
|
282
|
+
| `OCEANBUS_BASE_URL` | L0 API endpoint |
|
|
283
|
+
| `OCEANBUS_API_KEY` | Your API key |
|
|
284
|
+
| `OCEANBUS_AGENT_ID` | Your Agent ID |
|
|
285
|
+
| `OCEANBUS_TIMEOUT` | HTTP timeout (ms) |
|
|
286
|
+
| `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
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## When You Need OceanBus
|
|
293
|
+
|
|
294
|
+
- Your Agent needs to communicate with **other people's Agents** — not just your own
|
|
295
|
+
- You're building a P2P marketplace, booking system, or any multi-Agent service
|
|
296
|
+
- You need trust infrastructure (reputation, signatures, anti-fraud) without building it
|
|
297
|
+
- You want your `localhost:3000` to be reachable by the world without deploying a server
|
|
298
|
+
|
|
299
|
+
## When You Don't
|
|
300
|
+
|
|
301
|
+
- Your Agent runs alone, on one machine, forever
|
|
302
|
+
- You already have a service mesh or message queue that works
|
|
303
|
+
- You're building an internal pipeline where trust isn't a concern
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
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
|
+
## License
|
|
317
|
+
|
|
318
|
+
MIT
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Related Projects
|
|
323
|
+
|
|
324
|
+
| Project | Description |
|
|
325
|
+
|------|------|
|
|
326
|
+
| [oceanbus-mcp-server](https://www.npmjs.com/package/oceanbus-mcp-server) | MCP Server — Claude Desktop, Cursor, Windsurf, VS Code |
|
|
327
|
+
| [oceanbus-langchain](https://www.npmjs.com/package/oceanbus-langchain) | LangChain / CrewAI integration |
|
|
328
|
+
| [Ocean Chat](https://clawhub.ai/skills/ocean-chat) | Starter lighthouse — P2P messaging in 5 minutes |
|
|
329
|
+
| [Captain Lobster](https://clawhub.ai/skills/captain-lobster) | Intermediate — zero-player autonomous trading game |
|
|
330
|
+
| [Guess AI](https://clawhub.ai/skills/guess-ai) | Advanced — multiplayer social deduction game |
|
|
331
|
+
| [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
|
+
| **Platform Integrations** |
|
|
334
|
+
| [Dify Plugin](https://github.com/ryanbihai/oceanbus-dify-plugin) | Dify platform OceanBus plugin |
|
|
335
|
+
| [Coze Plugin](https://www.coze.cn) | Coze platform OceanBus plugin (published) |
|
|
336
|
+
| [Bailian Guide](https://github.com/ryanbihai/oceanbus-dify-plugin) | Alibaba Cloud Bailian MCP integration |
|
|
337
|
+
| [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=oceanbus) | Official MCP Registry listing |
|
package/dist/agent/identity.d.ts
CHANGED
|
@@ -12,9 +12,7 @@ export declare class AgentIdentityManager {
|
|
|
12
12
|
getCachedOpenId(): string | null;
|
|
13
13
|
updateCredential(apiKey: string, agentId?: string): void;
|
|
14
14
|
register(): Promise<RegistrationData>;
|
|
15
|
-
private savedOpenid;
|
|
16
15
|
whoami(): Promise<OpenIDData>;
|
|
17
|
-
getSavedOpenid(): string | null;
|
|
18
16
|
getOpenId(): Promise<string>;
|
|
19
17
|
ensureRegistered(): Promise<AgentState>;
|
|
20
18
|
toState(): AgentState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/agent/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ3F,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,IAAI,CAAa;IACzB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AO7B,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAM5B,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC;IAQ7C,OAAO,IAAI,UAAU;IAWrB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOlC,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAIpC,OAAO,CAAC,UAAU;CAKnB"}
|
package/dist/agent/identity.js
CHANGED
|
@@ -52,20 +52,13 @@ class AgentIdentityManager {
|
|
|
52
52
|
this.openidCache = null;
|
|
53
53
|
return data;
|
|
54
54
|
}
|
|
55
|
-
savedOpenid = null;
|
|
56
55
|
async whoami() {
|
|
57
56
|
this.ensureAuth();
|
|
58
57
|
const res = await this.http.get('/agents/me', { apiKey: this.apiKey });
|
|
59
58
|
this.openidCache = res.data.my_openid;
|
|
60
|
-
this.savedOpenid = res.data.my_openid;
|
|
61
59
|
return res.data;
|
|
62
60
|
}
|
|
63
|
-
getSavedOpenid() {
|
|
64
|
-
return this.savedOpenid;
|
|
65
|
-
}
|
|
66
61
|
async getOpenId() {
|
|
67
|
-
if (this.savedOpenid !== null)
|
|
68
|
-
return this.savedOpenid;
|
|
69
62
|
if (this.openidCache !== null)
|
|
70
63
|
return this.openidCache;
|
|
71
64
|
const data = await this.whoami();
|
|
@@ -85,7 +78,6 @@ class AgentIdentityManager {
|
|
|
85
78
|
return {
|
|
86
79
|
agent_id: this.agentId,
|
|
87
80
|
api_key: this.apiKey,
|
|
88
|
-
openid: this.savedOpenid || this.openidCache || undefined,
|
|
89
81
|
extra_keys: this.extraKeys,
|
|
90
82
|
};
|
|
91
83
|
}
|
|
@@ -93,8 +85,7 @@ class AgentIdentityManager {
|
|
|
93
85
|
this.agentId = state.agent_id;
|
|
94
86
|
this.apiKey = state.api_key;
|
|
95
87
|
this.extraKeys = state.extra_keys || [];
|
|
96
|
-
this.openidCache =
|
|
97
|
-
this.savedOpenid = state.openid || null;
|
|
88
|
+
this.openidCache = null;
|
|
98
89
|
}
|
|
99
90
|
trackExtraKey(key) {
|
|
100
91
|
this.extraKeys.push(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/agent/identity.ts"],"names":[],"mappings":";;;AAEA,6CAAiD;AACjD,uCAAgD;AAMhD,MAAa,oBAAoB;IACvB,IAAI,CAAa;IACjB,MAAM,CAAgB;IACtB,OAAO,CAAgB;IACvB,SAAS,GAAiB,EAAE,CAAC;IAC7B,WAAW,GAAkB,IAAI,CAAC;IAE1C,YAAY,IAAgB,EAAE,MAAe,EAAE,OAAgB;QAC7D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC;IACjC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,OAAgB;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,0BAA0B;IACrD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,6DAA6D;QAC7D,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAuC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAE7F,8CAA8C;QAC9C,MAAM,aAAa,GAAI,GAAG,CAAC,IAA0B,EAAE,SAAS,CAAC;QACjE,IAAI,aAAa,EAAE,KAAK,EAAE,CAAC;YACzB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GA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,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,IAAI,sBAAa,CAAC,gCAAgC,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,UAAU,EAAE,IAAI,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,KAAiB;QACzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,aAAa,CAAC,GAAe;QAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,sBAAa,CAAC,uEAAuE,CAAC,CAAC;QACnG,CAAC;IACH,CAAC;CACF;AA3GD,oDA2GC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,eAAO,MAAM,WAAW,EAAE,aA8BzB,CAAC"}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendCommand = void 0;
|
|
4
4
|
const index_1 = require("../../index");
|
|
5
|
-
const contacts_1 = require("../contacts");
|
|
6
5
|
exports.sendCommand = {
|
|
7
6
|
command: 'send <openid>',
|
|
8
|
-
describe: 'Send a message to a recipient OpenID
|
|
7
|
+
describe: 'Send a message to a recipient OpenID',
|
|
9
8
|
builder: (yargs) => yargs
|
|
10
9
|
.positional('openid', {
|
|
11
10
|
type: 'string',
|
|
12
|
-
describe: 'Recipient OpenID
|
|
11
|
+
describe: 'Recipient OpenID',
|
|
13
12
|
demandOption: true,
|
|
14
13
|
})
|
|
15
14
|
.option('message', {
|
|
@@ -24,18 +23,8 @@ exports.sendCommand = {
|
|
|
24
23
|
console.error('No message content. Use -m "message" or pipe content.');
|
|
25
24
|
process.exit(1);
|
|
26
25
|
}
|
|
27
|
-
const contactName = argv.openid;
|
|
28
|
-
const target = (0, contacts_1.resolveAlias)(contactName) || contactName;
|
|
29
26
|
const ob = await (0, index_1.createOceanBus)();
|
|
30
|
-
|
|
31
|
-
const myOpenId = (0, contacts_1.getMyOpenId)(contactName);
|
|
32
|
-
if (myOpenId && target !== contactName) {
|
|
33
|
-
// Only show when using an alias (not raw OpenID)
|
|
34
|
-
const shortId = myOpenId.slice(0, 12) + '...';
|
|
35
|
-
// Use stderr so stdout pipe still works cleanly
|
|
36
|
-
process.stderr.write(`[using your address: ${shortId}]\n`);
|
|
37
|
-
}
|
|
38
|
-
await ob.send(target, content);
|
|
27
|
+
await ob.send(argv.openid, content);
|
|
39
28
|
console.log(JSON.stringify({ code: 0, msg: 'sent' }));
|
|
40
29
|
}
|
|
41
30
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":";;;AACA,uCAA6C;
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/cli/commands/send.ts"],"names":[],"mappings":";;;AACA,uCAA6C;AAOhC,QAAA,WAAW,GAAkB;IACxC,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,sCAAsC;IAChD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,UAAU,CAAC,QAAQ,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,4CAA4C;KACvD,CAAC;IACN,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;QAC3B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,SAAS,EAAE,CAAC;YAClD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;gBACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,EAAE,GAAG,MAAM,IAAA,sBAAc,GAAE,CAAC;YAClC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,cAAc,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,C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":["../../../src/cli/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,eAAO,MAAM,aAAa,EAAE,aAa3B,CAAC"}
|
|
@@ -4,15 +4,10 @@ exports.whoamiCommand = void 0;
|
|
|
4
4
|
const index_1 = require("../../index");
|
|
5
5
|
exports.whoamiCommand = {
|
|
6
6
|
command: 'whoami',
|
|
7
|
-
describe: 'Show current
|
|
7
|
+
describe: 'Show current agent_id and latest OpenID',
|
|
8
8
|
handler: async () => {
|
|
9
9
|
try {
|
|
10
10
|
const ob = await (0, index_1.createOceanBus)();
|
|
11
|
-
if (!ob.identity.getApiKey()) {
|
|
12
|
-
console.error('No identity found. Run "oceanbus register" first to create a persistent agent identity.');
|
|
13
|
-
console.error('Once registered, whoami will always show the same OpenID — your permanent global address.');
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
11
|
const data = await ob.whoami();
|
|
17
12
|
console.log(JSON.stringify(data, null, 2));
|
|
18
13
|
}
|