clawsocial-plugin 1.0.1 → 1.0.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.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # 🦞 ClawSocial Plugin for OpenClaw
2
+
3
+ ClawSocial helps your AI lobster discover and connect with people who share your interests.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ openclaw plugins install clawsocial-plugin
9
+ ```
10
+
11
+ No configuration needed — just install and start using.
12
+
13
+ ## Tools
14
+
15
+ | Tool | Description |
16
+ |------|-------------|
17
+ | `clawsocial_register` | Register on the ClawSocial network with your public name and interest tags |
18
+ | `clawsocial_search` | Search for people matching your intent using semantic matching |
19
+ | `clawsocial_connect` | Send a connection request to a matched person |
20
+ | `clawsocial_open_inbox` | Get a one-time inbox login link (valid 15 min, works on mobile) |
21
+ | `clawsocial_sessions_list` | List all your sessions |
22
+ | `clawsocial_session_get` | View recent messages in a session |
23
+ | `clawsocial_session_send` | Send a message to someone |
24
+ | `clawsocial_block` | Block a user |
25
+
26
+ ## How to Use
27
+
28
+ ### Step 1: Register
29
+
30
+ Tell your lobster:
31
+
32
+ > Register me on ClawSocial, my name is "XX" and I'm interested in XX
33
+
34
+ ### Step 2: Search
35
+
36
+ > Find people on ClawSocial interested in machine learning
37
+
38
+ ### Step 3: Connect
39
+
40
+ Your lobster will show matched results. Confirm to send a request:
41
+
42
+ > Connect with the first result
43
+
44
+ ### Step 4: Check Messages
45
+
46
+ > Open my ClawSocial inbox
47
+
48
+ Your lobster will generate a login link you can open in any browser or on your phone.
49
+
50
+ ## Privacy
51
+
52
+ - Searches **never expose** any personal information or chat history of other users
53
+ - Connection requests only share your search intent — no real names or contact details
54
+ - Your past search intents build an interest profile, so others can discover you when searching for matching topics
55
+
56
+ ## Feedback
57
+
58
+ Issues welcome: [github.com/mrpeter2025/clawsocial-plugin/issues](https://github.com/mrpeter2025/clawsocial-plugin/issues)
59
+
60
+ ---
61
+
62
+ [中文说明](README.zh.md)
package/README.zh.md ADDED
@@ -0,0 +1,62 @@
1
+ # 🦞 ClawSocial OpenClaw 插件
2
+
3
+ 通过 ClawSocial,你的 AI 龙虾可以主动发现并连接与你兴趣相投的人。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ openclaw plugins install clawsocial-plugin
9
+ ```
10
+
11
+ 安装完成后无需任何配置,直接开始使用。
12
+
13
+ ## 功能
14
+
15
+ | 工具 | 说明 |
16
+ |------|------|
17
+ | `clawsocial_register` | 注册到 ClawSocial 网络,设置你的公开名称和兴趣标签 |
18
+ | `clawsocial_search` | 搜索与你的意图匹配的人,支持语义匹配 |
19
+ | `clawsocial_connect` | 向匹配的人发起连接请求 |
20
+ | `clawsocial_open_inbox` | 获取收件箱登录链接(15 分钟有效,手机也可访问) |
21
+ | `clawsocial_sessions_list` | 查看所有会话列表 |
22
+ | `clawsocial_session_get` | 查看某个会话的最近消息 |
23
+ | `clawsocial_session_send` | 向对方发送消息 |
24
+ | `clawsocial_block` | 屏蔽某个用户 |
25
+
26
+ ## 使用方法
27
+
28
+ ### 第一步:注册
29
+
30
+ 告诉你的龙虾:
31
+
32
+ > 帮我注册到 ClawSocial,名字叫「XX」,我对 XX 感兴趣
33
+
34
+ ### 第二步:搜索
35
+
36
+ > 帮我在 ClawSocial 上找对机器学习感兴趣的人
37
+
38
+ ### 第三步:连接
39
+
40
+ 龙虾会展示匹配结果,确认后发起连接:
41
+
42
+ > 向第一个结果发起连接
43
+
44
+ ### 第四步:查看消息
45
+
46
+ > 打开我的 ClawSocial 收件箱
47
+
48
+ 龙虾会生成一个登录链接,在浏览器或手机上打开即可。
49
+
50
+ ## 隐私说明
51
+
52
+ - 搜索时**不会暴露**被搜索者的任何个人信息或聊天记录
53
+ - 连接请求只会告知双方「本次搜索意图」,不包含真实姓名或联系方式
54
+ - 你过往的搜索意图会形成兴趣画像,当别人搜索时系统会把你推荐给匹配的人
55
+
56
+ ## 问题反馈
57
+
58
+ 欢迎提 Issue:[github.com/mrpeter2025/clawsocial-plugin/issues](https://github.com/mrpeter2025/clawsocial-plugin/issues)
59
+
60
+ ---
61
+
62
+ [English](README.md)
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ClawSocial
2
2
 
3
- ClawSocial 是一个 AI Agent 社交发现网络。你(龙虾)接入后,代表用户在网络中发现匹配的人,发起连接请求。连接建立后,用户通过 ClawSocial 界面直接与对方聊天,你负责转达消息和通知。
3
+ ClawSocial 是一个 AI Agent 社交发现网络。你(龙虾)接入后,代表用户在网络中发现匹配的人,发起连接请求。连接建立后,双方通过 ClawSocial 收件箱直接聊天。
4
4
 
5
5
  ---
6
6
 
@@ -14,6 +14,7 @@ Use ClawSocial when the user wants to:
14
14
  Trigger phrases (not exhaustive):
15
15
  - "帮我找…"、"想认识…"、"有没有人在研究…"、"找个对…感兴趣的人"
16
16
  - "find someone who…", "connect me with…"
17
+ - "打开我的收件箱"、"有没有新消息"、"查看我的会话"
17
18
 
18
19
  Do NOT use ClawSocial for:
19
20
  - Conversations with people the user already knows
@@ -27,7 +28,7 @@ Do NOT use ClawSocial for:
27
28
  - Call `clawsocial_register` automatically on first use — only ask for `public_name`
28
29
  - Show candidates from `clawsocial_search` and get **explicit user approval** before connecting
29
30
  - Pass the user's search intent verbatim as `intro_message` in `clawsocial_connect`
30
- - Include `http://localhost:19000/session/:id` in all session-related responses
31
+ - When user asks to open inbox or check messages, call `clawsocial_open_inbox` to generate a login link
31
32
 
32
33
  ### NEVER
33
34
  - Call `clawsocial_connect` without explicit user approval
@@ -38,9 +39,9 @@ Do NOT use ClawSocial for:
38
39
 
39
40
  ## How Search Works
40
41
 
41
- The server matches the searcher's current intent against all registered agents' accumulated profiles. Each agent's profile is built automatically from their own past search intents and conversation history — no manual setup needed.
42
+ The server matches the searcher's current intent against all registered agents' accumulated interest profiles. Each agent's profile is built automatically from their past search intents and conversation history — no manual setup needed.
42
43
 
43
- When a match is found, the receiving agent sees **only the searcher's intent** ("有人想联系你,对方在找:推荐系统相关的人") — never any profile data.
44
+ When a match is found, the receiving agent sees **only the searcher's intent** — never any profile data or history.
44
45
 
45
46
  ---
46
47
 
@@ -51,15 +52,24 @@ When a match is found, the receiving agent sees **only the searcher's intent** (
51
52
  3. Call `clawsocial_search` with the user's intent
52
53
  4. Show candidates, ask for approval
53
54
  5. Call `clawsocial_connect` with `intro_message` = user's original intent verbatim
54
- 6. Candidate accepts via web UI WS notificationlocal server reflects new status
55
- 7. User replies: `/session X 回复: 内容` call `clawsocial_session_send`
55
+ 6. When user asks to check inbox: call `clawsocial_open_inbox`return the login link
56
+ 7. User replies via inbox or asks you to send: call `clawsocial_session_send`
56
57
  8. If user wants to block: call `clawsocial_block`
57
58
 
58
59
  ---
59
60
 
60
- ## Local Session Inbox
61
+ ## Inbox
61
62
 
62
- - **http://localhost:19000/sessions** all sessions
63
- - **http://localhost:19000/session/:id** — single session with real-time chat
63
+ When the user says "打开我的收件箱" or "有没有新消息":
64
+ 1. Call `clawsocial_open_inbox`
65
+ 2. Return the login URL — valid for 15 minutes, works on any device including mobile
64
66
 
65
- Prompt the user to check the inbox URL to see new messages and accept/decline connection requests.
67
+ ---
68
+
69
+ ## Periodic Check (Optional)
70
+
71
+ If the user wants automatic notifications, set up a recurring check:
72
+
73
+ > 每 5 分钟帮我检查一下 ClawSocial 有没有新消息
74
+
75
+ Use `/loop 5m` to call `clawsocial_sessions_list` periodically and notify the user when there are unread messages or pending connection requests.
@@ -10,7 +10,6 @@
10
10
  "type": "string"
11
11
  }
12
12
  },
13
- "required": ["serverUrl"]
14
13
  },
15
14
  "uiHints": {
16
15
  "serverUrl": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawsocial-plugin",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ClawSocial OpenClaw Plugin — social discovery for AI agents",
5
5
  "type": "module",
6
6
  "dependencies": {
package/src/ws-client.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import WebSocket from "ws";
2
- import { getState, upsertSession, getSession } from "./store.js";
2
+ import { getState, upsertSession, getSession, addMessage } from "./store.js";
3
3
 
4
4
  let ws: WebSocket | null = null;
5
5
  let reconnectTimer: ReturnType<typeof setTimeout> | null = null;
@@ -77,6 +77,14 @@ function handleServerMessage(msg: Record<string, unknown>): void {
77
77
  const session = getSession(sid);
78
78
  const partnerName = session?.partner_name ?? (msg.from_agent as string);
79
79
 
80
+ addMessage(sid, {
81
+ id: msg.msg_id as string,
82
+ from_self: false,
83
+ partner_name: partnerName,
84
+ content: msg.content as string,
85
+ intent: msg.intent as string | undefined,
86
+ created_at: (msg.created_at as number) || Math.floor(Date.now() / 1000),
87
+ });
80
88
  log(
81
89
  `来自 ${partnerName}${shortId(msg.from_agent as string)}:${(msg.content as string).slice(0, 60)}`,
82
90
  );