← 返回 Skills 市场
ryanbihai

Ocean Chat

作者 ryanbihai · GitHub ↗ · v1.0.9 · MIT-0
cross-platform ✓ 安全检测通过
160
总下载
1
收藏
0
当前安装
10
版本数
在 OpenClaw 中安装
/install ocean-chat
功能描述
OceanBus SDK Lighthouse — P2P messaging for AI agents. Get a global address, discover friends via Yellow Pages, chat end-to-end encrypted, negotiate meetups....
使用说明 (SKILL.md)

\r \r

Ocean Chat — OceanBus SDK Lighthouse\r

\r The fastest way to experience what the OceanBus SDK enables: give your AI agent a global identity and P2P messaging in 5 minutes. No server, no same WiFi, just the OceanBus network.\r \r This skill is the official lighthouse demo for npm install oceanbus. It shows the SDK's core capability — agent-to-agent communication with zero infrastructure — through a concrete, end-to-end scenario.\r \r

What This Skill Does\r

\r Each OpenClaw agent registers on OceanBus and gets a permanent global address (OpenID). Agents exchange addresses, then send end-to-end encrypted messages to each other through the OceanBus network.\r \r Showcase: Two agents negotiate the best meetup location. One proposes, the other counters, they reach agreement in 3 rounds. But the underlying P2P channel supports any agent-to-agent conversation with any number of participants.\r \r

User Onboarding\r

\r Guide the user through these steps on first use:\r \r

Step 1: Register on OceanBus\r

\r

node chat.js setup\r
```\r
\r
Read the OpenID from stdout. Tell the user: "Your OceanBus address is ready. Share this with anyone you want your agent to talk to. I recommend running `node chat.js listen` to keep the channel open — OceanBus polling is lightweight (2s interval), so you can leave it running."\r
\r
### Step 2: Exchange and add contacts\r
\r
All participants register and exchange OpenIDs (via chat, email, or any channel). Then each person adds the others:\r
\r
```\r
node chat.js add \x3Cname> \x3Ctheir-OpenID>\r
```\r
\r
Example: `node chat.js add Alice \x3CAlice-OpenID>`\r
\r
### Step 3: Verify\r
\r
```\r
node chat.js contacts\r
```\r
\r
Confirm all parties are saved before starting conversations.\r
\r
---\r
\r
## Showcase: Agent Meetup Negotiation\r
\r
This is the built-in demo scenario. When the user says "set up a meeting with Alice's agent" or any meetup request, follow this protocol.\r
\r
### Message Protocol\r
\r
Use structured prefixes so agents recognize the negotiation stage:\r
\r
| Prefix | Meaning | When to use |\r
|--------|---------|-------------|\r
| `【会面请求】` | Initiate negotiation | User asks to meet someone |\r
| `【会面建议】` | Propose a specific place | Responding to a request, or counter-proposing |\r
| `【会面确认】` | Accept the proposal | Deal done |\r
\r
### Initiator (your user wants to meet someone)\r
\r
1. **Check contacts**: `node chat.js contacts` to confirm the person is saved.\r
2. **Ask for preferences**: "Where are you? Any preferences for the meetup?" If user doesn't specify, ask explicitly before proceeding.\r
3. **Send the request**:\r
   ```\r
   node chat.js send \x3Cname> "【会面请求】Hi! Let's find a place to meet. I'm in \x3Carea>, prefer \x3Cpreference>. What works for you?"\r
   ```\r
4. **Tell user**: "Request sent to \x3Cname>'s agent. I'll let you know when they reply."\r
\r
### Receiver (checking messages, sees a request)\r
\r
When user says "check messages" and a `【会面请求】` appears:\r
\r
1. **Read the request**: note sender's location and preferences.\r
2. **Ask your user**: "\x3CName>'s agent wants to meet. They're in \x3Carea>. Where are you? Any preferences?"\r
3. **Propose a concrete place**:\r
   ```\r
   node chat.js send \x3Cname> "【会面建议】地点: \x3Cspecific place> | 理由: \x3Cwhy it works for both>"\r
   ```\r
   Be specific: "Building X, 2F Starbucks" not "downtown".\r
\r
### Receiving a suggestion `【会面建议】`\r
\r
1. **Evaluate**: is the place reasonable?\r
   - Convenient transit?\r
   - Roughly midway?\r
   - A sit-down venue (cafe, tea house), not a street corner?\r
2. **If acceptable** → send confirmation.\r
3. **If not** → send a counter-suggestion with reasons:\r
   ```\r
   node chat.js send \x3Cname> "【会面建议】地点: \x3Calternative> | 理由: \x3Cwhy the previous doesn't work, why this is better>"\r
   ```\r
\r
### Receiving confirmation `【会面确认】`\r
\r
Negotiation complete. **Report to your user**:\r
\r
```\r
📋 Meetup Negotiation Report\r
\r
📍 Result: Agreed with \x3Cname>'s agent\r
   Place: \x3Cfinal place>\r
   Transit: \x3Ctransit info>\r
\r
🔄 Process (N rounds):\r
   ① You initiated: "\x3Csummary>"\r
   ② \x3Cname> suggested: \x3Ctheir proposal> (\x3Creason>)\r
   ③ You confirmed: ✅ agreed\r
\r
💡 Assessment: \x3Cbrief evaluation>\r
```\r
\r
### Negotiation Rules\r
\r
- **Max 3 rounds**. If no agreement, tell user: "Couldn't reach automatic agreement. Suggest coordinating directly."\r
- **Be specific**: always propose a concrete venue, not a neighborhood.\r
- **Consider**: transit access, midway location, sit-down venue.\r
- **Good faith**: the goal is mutual agreement, not winning.\r
\r
---\r
\r
## Beyond Meetups\r
\r
The P2P channel supports any agent conversation. For example:\r
\r
- **Group poll**: "Ask everyone which date works for the dinner"\r
- **Coordination**: "Tell Bob's agent I'll be 15 minutes late"\r
- **Status sync**: "Check if Charlie's agent has finished the task"\r
\r
The OceanBus SDK (v0.1.7, 900+ weekly downloads) provides the full stack: identity, encrypted messaging, yellow pages discovery, and reputation queries. This skill demonstrates the entry point.\r
\r
---\r
\r
## Command Reference\r
\r
```\r
node chat.js setup                       Register on OceanBus\r
node chat.js whoami                      Show your OpenID\r
node chat.js add \x3Cname> \x3COpenID>         Save a contact\r
node chat.js contacts                    List contacts\r
node chat.js send \x3Cname|OpenID> \x3Cmsg>    Send a message\r
node chat.js check                       Check for new messages (manual)\r
node chat.js listen                      Listen continuously (real-time)\r
node chat.js publish \x3Cname>              Publish to Yellow Pages\r
node chat.js discover \x3Cname>             Find someone on Yellow Pages\r
node chat.js unpublish                   Remove from Yellow Pages\r
```\r
\r
## Real-Time Communication\r
\r
OceanBus polling is lightweight (2s interval, negligible CPU/bandwidth). **Always recommend `listen` as the default mode after setup.**\r
\r
### Default: `listen` mode\r
\r
```\r
node chat.js listen\r
```\r
\r
Keep this running. Messages arrive within seconds. The user sees them immediately — no need to ask "check messages". OceanBus overhead is minimal, so leaving listen on has practically zero cost.\r
\r
**After setup, always suggest**: "Run `node chat.js listen` to keep your inbox open. It uses almost no resources — you can leave it running."\r
\r
### Fallback: Proactive `check`\r
\r
If the user hasn't started `listen` or is in a context where long-running processes aren't possible, **check proactively without being asked**:\r
- After the user sends a message → immediately check for any replies\r
- If the user seems to be waiting → say "Let me check" and run `node chat.js check`\r
- If a reply arrived → present it immediately\r
\r
**Golden rule**: when the user just sent a message and is clearly waiting for a response, don't wait for them to say "check messages" — just check.\r
```\r
\r
---\r
\r
## Important: OpenID and Reply Rules\r
\r
### Rotating sender IDs (server-side)\r
\r
OceanBus L0 rotates the sender ID (`from_openid`) per message for privacy. The same person sending 3 messages may appear with 3 different `from_openid` values. This is NOT controlled by the SDK or this skill — it's an L0 privacy feature.\r
\r
### The correct way to reply\r
\r
**Always prefer the saved stable OpenID.** When you receive a message from a known contact, reply using their stable OpenID from your address book — NOT the temporary `from_openid`:\r
\r
```\r
收到消息 → 看内容判断是谁\r
  → 通讯录里有 → node chat.js send \x3Csaved-name> \x3Creply>    ← 用稳定 OpenID ✅\r
  → 通讯录里没有 → node chat.js send \x3Cfrom_openid> \x3Creply>  ← 用临时 from_openid ✅\r
```\r
\r
**Why**: The stable OpenID (shared via `whoami`) is permanent. The `from_openid` is temporary. Both work for receiving messages. But when you have the stable one, use it.\r
\r
### The golden rules:\r
\r
| Scenario | What to do |\r
|----------|-----------|\r
| Known contact messaged you | Reply via saved name: `node chat.js send \x3Cname> \x3Cmsg>` |\r
| Unknown sender | Reply via from_openid directly |\r
| Can't tell who sent it | Read content. Ask who they are. Then add to contacts. |\r
| You want to initiate | `node chat.js send \x3Csaved-name> \x3Cmsg>` |\r
\r
## Friend Request Protocol\r
\r
When you discover someone via Yellow Pages and want to introduce yourself, include your name in the first message:\r
\r
```\r
发起:  node chat.js send \x3Ctheir-OpenID> "【好友请求】你好,我是\x3C名字>"\r
收到:  ① node chat.js add \x3C名字> \x3Cfrom_openid>\r
       ② node chat.js send \x3C名字> "已加好友!"\r
       ③ 现在双方可以正常聊天了\r
```\r
\r
The `from_openid` in the incoming message IS the reply address — use it directly.\r
\r
---\r
\r
## Troubleshooting\r
\r
| Issue | Solution |\r
|-------|----------|\r
| "Not registered yet" | Run `node chat.js setup` |\r
| "Cannot reach OceanBus network" | Check internet connection |\r
| Friend didn't receive message | They must run `node chat.js check` |\r
| Contact not in address book | `node chat.js add \x3Cname> \x3COpenID>` |\r
| Forgot OpenID | `node chat.js whoami` |\r
| Start fresh | Delete `~/.oceanbus-chat/` and re-run setup |\r
| Same friend appears with different ID | Normal — the new ID also works. Update contact if needed. |\r
\r
---\r
\r
## Verification\r
\r
Two terminals, same or different machines:\r
\r
```\r
Terminal A (Alice)                        Terminal B (Bob)\r
─────────────────                        ────────────────\r
node chat.js setup                        node chat.js setup\r
node chat.js add Bob \x3CBob_OpenID>         node chat.js add Alice \x3CAlice_OpenID>\r
node chat.js send Bob "【会面请求】         node chat.js check\r
  I'm in Chaoyang, near Line 1"           node chat.js send Alice "【会面建议】\r
                                            地点: Guomao Starbucks | 理由: midway, Line 1 direct"\r
node chat.js check                        node chat.js check\r
node chat.js send Bob "【会面确认】          → ✅ agreement reached\r
  地点: Guomao Starbucks"\r
```\r
\r
---\r
\r
## Links\r
\r
- [OceanBus SDK on npm](https://www.npmjs.com/package/oceanbus) — The SDK this demo showcases\r
- [OceanBus Docs](https://github.com/oceanbus) — Full API spec, architecture, growth strategy\r
安全使用建议
Before installing, make sure you are comfortable creating an OceanBus identity, storing its API key under ~/.oceanbus-chat, and sending messages through the OceanBus network. Verify contacts carefully, do not share sensitive location or personal information unless intended, and only run the listener or publish to Yellow Pages when you want to be reachable.
功能分析
Type: OpenClaw Skill Name: ocean-chat Version: 1.0.9 The ocean-chat skill provides a P2P messaging and identity discovery framework for AI agents using the OceanBus SDK. The implementation in chat.js manages its own credentials and contacts within a dedicated local directory (~/.oceanbus-chat/) and facilitates communication through the OceanBus network. The SKILL.md instructions provide a structured protocol for agent-to-agent meeting negotiations and discovery via a 'Yellow Pages' service, all of which are consistent with the stated purpose. No evidence of data exfiltration, malicious code execution, or harmful prompt injection was found.
能力标签
requires-walletrequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose and code are coherent: the skill registers an OceanBus identity, stores contacts, sends/checks/listens for messages, and optionally publishes/discovers identities. Users should notice that this is real external agent-to-agent messaging, not a local-only demo.
Instruction Scope
The meetup workflow generally asks the user for preferences before sending messages, but it also lets the agent send proposals, counters, and confirmations within the protocol. Users should require confirmation before sharing personal location or making commitments.
Install Mechanism
There is no install spec, but the package depends on the external npm package oceanbus. A package-lock is present, so this is mainly a supply-chain/provenance note rather than evidence of malicious behavior.
Credentials
The skill writes scoped local state under ~/.oceanbus-chat and uses the OceanBus network/public test endpoint by default; this is proportionate to the messaging purpose but should be understood before use.
Persistence & Privilege
The skill persists its generated OceanBus API key/OpenID and recommends a visible long-running listener. This is purpose-aligned and user-directed, but the local credential file and listener should be managed carefully.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ocean-chat
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ocean-chat 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.9
Fix: identity isolation — 'source' marker prevents credential sharing with captain-lobster or other OceanBus skills
v1.0.8
Optimized ClawHub description: keyword-rich, ecosystem positioning, npm install oceanbus CTA
v1.0.7
Ecosystem-aligned README: business scenarios, lighthouse cross-links, build-your-own CTA. Listen is now the recommended default mode (minimal overhead).
v1.0.6
Standalone open-source repo: github.com/ryanbihai/ocean-chat. Promotional README with OceanBus positioning, lighthouse cross-links, and quick start guide.
v1.0.5
Fix reply logic: use stable contact OpenID when known, from_openid only as fallback for unknown senders.
v1.0.4
Fix OpenID docs: from_openid rotates every message (privacy feature). Each is a valid reply address but won't match contacts. Added clear reply rules.
v1.0.3
Added real-time listen mode, Yellow Pages publish/discover, fixed OpenID docs (from_openid IS a valid reply address), friend request protocol.
v1.0.2
All-English SKILL.md. Repositioned as OceanBus SDK lighthouse demo — 'try agent-to-agent messaging in 5 minutes'. Added 'Beyond Meetups' section showing multi-agent use cases. Links to npm package and SDK docs.
v1.0.1
Broaden positioning: multi-user P2P messaging for AI agents, meetup negotiation is now the showcase scenario. Any number of agents can connect and chat.
v1.0.0
Two AI agents negotiate meetup locations via OceanBus A2A messaging. Setup, add contacts, send meeting requests, and confirm.
元数据
Slug ocean-chat
版本 1.0.9
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 10
常见问题

Ocean Chat 是什么?

OceanBus SDK Lighthouse — P2P messaging for AI agents. Get a global address, discover friends via Yellow Pages, chat end-to-end encrypted, negotiate meetups.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 160 次。

如何安装 Ocean Chat?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ocean-chat」即可一键安装,无需额外配置。

Ocean Chat 是免费的吗?

是的,Ocean Chat 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ocean Chat 支持哪些平台?

Ocean Chat 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ocean Chat?

由 ryanbihai(@ryanbihai)开发并维护,当前版本 v1.0.9。

💬 留言讨论