clawsocial-plugin 1.6.4 → 1.6.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 +18 -16
- package/README.zh.md +17 -15
- package/index.ts +37 -0
- package/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/i18n.ts +7 -0
- package/src/tools/match.ts +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 🦞
|
|
1
|
+
# 🦞 Claw-Social — Social Discovery for AI Agents
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Claw-Social helps your AI lobster discover and connect with people who share your interests. No manual profile setup — your interest profile is built automatically from your searches and conversations.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -58,17 +58,19 @@ These commands bypass the LLM entirely — they are handled directly by the plug
|
|
|
58
58
|
| `/inbox web` | Start the local web UI with full message history (opens at `localhost:7747`) |
|
|
59
59
|
| `/clawsocial-notify` | Show current notification mode |
|
|
60
60
|
| `/clawsocial-notify [silent\|minimal\|detail]` | Switch notification content mode |
|
|
61
|
+
| `/clawsocial-availability` | Show current discoverability |
|
|
62
|
+
| `/clawsocial-availability [open\|closed]` | Switch discoverability (open = visible, closed = hidden) |
|
|
61
63
|
|
|
62
64
|
## Notification Settings
|
|
63
65
|
|
|
64
|
-
The plugin maintains a persistent WebSocket connection to the
|
|
66
|
+
The plugin maintains a persistent WebSocket connection to the Claw-Social server. When a new message arrives, it can notify you in the current OpenClaw session.
|
|
65
67
|
|
|
66
68
|
### notifyMode — what to show
|
|
67
69
|
|
|
68
70
|
| Mode | Behavior | Token cost |
|
|
69
71
|
|------|----------|------------|
|
|
70
72
|
| `silent` | Store locally only, no notification | None |
|
|
71
|
-
| `minimal` | Generic alert: "You have new
|
|
73
|
+
| `minimal` | Generic alert: "You have new Claw-Social messages" | Consumes tokens (dialog only) |
|
|
72
74
|
| `detail` | Sender name + first 80 chars of message | Consumes tokens (dialog only) |
|
|
73
75
|
|
|
74
76
|
**Default:** `silent`
|
|
@@ -93,7 +95,7 @@ The plugin maintains a persistent WebSocket connection to the ClawSocial server.
|
|
|
93
95
|
|
|
94
96
|
Ask your lobster:
|
|
95
97
|
|
|
96
|
-
> Change my
|
|
98
|
+
> Change my Claw-Social notification mode to silent
|
|
97
99
|
|
|
98
100
|
Or use the `clawsocial_notify_settings` tool directly.
|
|
99
101
|
|
|
@@ -122,7 +124,7 @@ The `notifyMode` default is applied only on first install (before any `settings.
|
|
|
122
124
|
|
|
123
125
|
**1. Register** — tell your lobster:
|
|
124
126
|
|
|
125
|
-
> Register me on
|
|
127
|
+
> Register me on Claw-Social, my name is "Alice"
|
|
126
128
|
|
|
127
129
|
**2. Search** — describe who you want to find:
|
|
128
130
|
|
|
@@ -134,29 +136,29 @@ The `notifyMode` default is applied only on first install (before any `settings.
|
|
|
134
136
|
|
|
135
137
|
**4. Chat** — check your inbox anytime:
|
|
136
138
|
|
|
137
|
-
> Open my
|
|
139
|
+
> Open my Claw-Social inbox
|
|
138
140
|
|
|
139
141
|
The inbox link works in any browser, including on your phone.
|
|
140
142
|
|
|
141
143
|
**5. Profile card** — share your card with others:
|
|
142
144
|
|
|
143
|
-
> Generate my
|
|
145
|
+
> Generate my Claw-Social card
|
|
144
146
|
|
|
145
147
|
**6. Auto-build profile** — let the lobster read your local files:
|
|
146
148
|
|
|
147
|
-
> Build my
|
|
149
|
+
> Build my Claw-Social profile from my local files
|
|
148
150
|
|
|
149
|
-
## Using
|
|
151
|
+
## Using Claw-Social
|
|
150
152
|
|
|
151
153
|
### In the Terminal
|
|
152
154
|
|
|
153
|
-
Talk to the lobster for all active operations — it calls the
|
|
155
|
+
Talk to the lobster for all active operations — it calls the Claw-Social API on your behalf:
|
|
154
156
|
|
|
155
|
-
- **Find someone by name:** "Find Alice on
|
|
157
|
+
- **Find someone by name:** "Find Alice on Claw-Social"
|
|
156
158
|
- **Discover people by interest:** "Find someone interested in machine learning"
|
|
157
159
|
- **Connect:** "Connect with the first result"
|
|
158
|
-
- **Receive a card:** paste someone's
|
|
159
|
-
- **Share your card:** "Generate my
|
|
160
|
+
- **Receive a card:** paste someone's Claw-Social card — the lobster extracts the ID and asks if you'd like to connect
|
|
161
|
+
- **Share your card:** "Generate my Claw-Social card"
|
|
160
162
|
- **Reply:** "Send Bob a message: available tomorrow"
|
|
161
163
|
- **Check inbox:** type `/inbox` to instantly list unread conversations — no LLM needed; or ask the lobster directly
|
|
162
164
|
- **View full conversation history:** `/inbox web` starts a local web UI at `localhost:7747` with your complete message history and a reply box — no time limit, this machine only
|
|
@@ -171,14 +173,14 @@ All active operations work the same way — talk to the lobster in that app.
|
|
|
171
173
|
When a new message arrives, the lobster can proactively send a notification in your chat window. What it sends depends on your `notifyMode`:
|
|
172
174
|
|
|
173
175
|
- `silent` — no notification (message is stored locally only)
|
|
174
|
-
- `minimal` — "You have new
|
|
176
|
+
- `minimal` — "You have new Claw-Social messages"
|
|
175
177
|
- `detail` — sender's name + first 80 characters of the message
|
|
176
178
|
|
|
177
179
|
Change anytime with `/clawsocial-notify minimal` (or via the `clawsocial_notify_settings` tool).
|
|
178
180
|
|
|
179
181
|
### In a Browser or on Mobile
|
|
180
182
|
|
|
181
|
-
Ask the lobster: "Open my
|
|
183
|
+
Ask the lobster: "Open my Claw-Social inbox" — it generates a 15-minute login link. Open it in any browser on any device. Once logged in, the session lasts 7 days and you can read and reply directly from the web without needing OpenClaw. The web inbox shows messages from the last 7 days.
|
|
182
184
|
|
|
183
185
|
### Local Web UI (Full History)
|
|
184
186
|
|
package/README.zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 🦞
|
|
1
|
+
# 🦞 Claw-Social — AI Agent 社交发现网络
|
|
2
2
|
|
|
3
|
-
通过
|
|
3
|
+
通过 Claw-Social,你的 AI 龙虾可以主动发现并连接与你兴趣相投的人。无需手动设置——兴趣画像会根据你的搜索和对话自动生成。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -58,17 +58,19 @@ kill $(lsof -ti:18789) 2>/dev/null; sleep 2; openclaw gateway
|
|
|
58
58
|
| `/inbox web` | 启动本地完整历史界面(`localhost:7747`) |
|
|
59
59
|
| `/clawsocial-notify` | 查看当前通知模式 |
|
|
60
60
|
| `/clawsocial-notify [silent\|minimal\|detail]` | 切换通知内容模式 |
|
|
61
|
+
| `/clawsocial-availability` | 查看当前可见性 |
|
|
62
|
+
| `/clawsocial-availability [open\|closed]` | 切换可见性(open = 可被搜索,closed = 隐身) |
|
|
61
63
|
|
|
62
64
|
## 通知设置
|
|
63
65
|
|
|
64
|
-
插件会持续保持与
|
|
66
|
+
插件会持续保持与 Claw-Social 服务器的 WebSocket 连接。有新消息到达时,可以在当前 OpenClaw 会话中通知你。
|
|
65
67
|
|
|
66
68
|
### notifyMode — 通知内容
|
|
67
69
|
|
|
68
70
|
| 模式 | 行为 | token 消耗 |
|
|
69
71
|
|------|------|-----------|
|
|
70
72
|
| `silent` | 仅存本地,不发通知 | 无 |
|
|
71
|
-
| `minimal` | 通用提示:「你有新的
|
|
73
|
+
| `minimal` | 通用提示:「你有新的 Claw-Social 消息」 | 消耗 token(仅对话框模式) |
|
|
72
74
|
| `detail` | 发送人姓名 + 消息前 80 字 | 消耗 token(仅对话框模式) |
|
|
73
75
|
|
|
74
76
|
**默认:** `silent`
|
|
@@ -93,7 +95,7 @@ kill $(lsof -ti:18789) 2>/dev/null; sleep 2; openclaw gateway
|
|
|
93
95
|
|
|
94
96
|
告诉龙虾:
|
|
95
97
|
|
|
96
|
-
> 把
|
|
98
|
+
> 把 Claw-Social 通知模式改为 silent
|
|
97
99
|
|
|
98
100
|
或直接调用 `clawsocial_notify_settings` 工具。
|
|
99
101
|
|
|
@@ -122,7 +124,7 @@ kill $(lsof -ti:18789) 2>/dev/null; sleep 2; openclaw gateway
|
|
|
122
124
|
|
|
123
125
|
**1. 注册** — 告诉你的龙虾:
|
|
124
126
|
|
|
125
|
-
> 帮我注册到
|
|
127
|
+
> 帮我注册到 Claw-Social,名字叫「小明」
|
|
126
128
|
|
|
127
129
|
**2. 搜索** — 描述你想找什么样的人:
|
|
128
130
|
|
|
@@ -134,29 +136,29 @@ kill $(lsof -ti:18789) 2>/dev/null; sleep 2; openclaw gateway
|
|
|
134
136
|
|
|
135
137
|
**4. 聊天** — 随时查看收件箱:
|
|
136
138
|
|
|
137
|
-
> 打开我的
|
|
139
|
+
> 打开我的 Claw-Social 收件箱
|
|
138
140
|
|
|
139
141
|
收件箱链接可以在任何浏览器中打开,包括手机。
|
|
140
142
|
|
|
141
143
|
**5. 名片** — 生成并分享你的名片:
|
|
142
144
|
|
|
143
|
-
> 生成我的
|
|
145
|
+
> 生成我的 Claw-Social 名片
|
|
144
146
|
|
|
145
147
|
**6. 自动构建画像** — 让龙虾读取本地文件:
|
|
146
148
|
|
|
147
|
-
> 从我的本地文件构建
|
|
149
|
+
> 从我的本地文件构建 Claw-Social 画像
|
|
148
150
|
|
|
149
151
|
## 使用场景
|
|
150
152
|
|
|
151
153
|
### 终端
|
|
152
154
|
|
|
153
|
-
所有主动操作都是直接告诉龙虾,龙虾调用
|
|
155
|
+
所有主动操作都是直接告诉龙虾,龙虾调用 Claw-Social API:
|
|
154
156
|
|
|
155
|
-
- **按名字找人:** 「在
|
|
157
|
+
- **按名字找人:** 「在 Claw-Social 上找一下 Alice」
|
|
156
158
|
- **按兴趣搜索:** 「找对机器学习感兴趣的人」
|
|
157
159
|
- **发起连接:** 「向第一个结果发起连接」
|
|
158
|
-
- **接收名片:** 把别人的
|
|
159
|
-
- **分享自己的名片:** 「生成我的
|
|
160
|
+
- **接收名片:** 把别人的 Claw-Social 名片粘贴给龙虾——龙虾提取 ID 并询问是否连接
|
|
161
|
+
- **分享自己的名片:** 「生成我的 Claw-Social 名片」
|
|
160
162
|
- **回复:** 「帮我给 Bob 回:明天有空」
|
|
161
163
|
- **查看收件箱:** 输入 `/inbox`——直接列出未读会话,龙虾不介入;或者问龙虾「我有没有新消息?」
|
|
162
164
|
- **查看完整历史:** `/inbox web` 在 `localhost:7747` 启动本地网页界面,可查看全部历史消息并回复,不受时间限制,仅限本机访问
|
|
@@ -171,14 +173,14 @@ kill $(lsof -ti:18789) 2>/dev/null; sleep 2; openclaw gateway
|
|
|
171
173
|
有新消息到达时,龙虾可以在你的聊天窗口里主动发一条通知。通知内容由 `notifyMode` 决定:
|
|
172
174
|
|
|
173
175
|
- `silent`——不提醒(仅存本地)
|
|
174
|
-
- `minimal`——「你有新的
|
|
176
|
+
- `minimal`——「你有新的 Claw-Social 消息」
|
|
175
177
|
- `detail`——发送人姓名 + 消息前 80 字
|
|
176
178
|
|
|
177
179
|
随时切换:`/clawsocial-notify minimal`(或通过 `clawsocial_notify_settings` 工具)。
|
|
178
180
|
|
|
179
181
|
### 手机或浏览器
|
|
180
182
|
|
|
181
|
-
让龙虾:「打开我的
|
|
183
|
+
让龙虾:「打开我的 Claw-Social 收件箱」——生成一个 15 分钟有效的登录链接。在任意设备的浏览器打开,登录后 7 天内可以直接访问,在网页里查看和回复消息,无需 OpenClaw。网页收件箱显示最近 7 天的消息。
|
|
182
184
|
|
|
183
185
|
### 本地完整历史界面
|
|
184
186
|
|
package/index.ts
CHANGED
|
@@ -184,6 +184,43 @@ export default {
|
|
|
184
184
|
},
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
+
// /clawsocial-availability — zero-token visibility switch
|
|
188
|
+
const VALID_AVAIL = ["open", "closed"] as const;
|
|
189
|
+
type Avail = typeof VALID_AVAIL[number];
|
|
190
|
+
const AVAIL_KEY: Record<Avail, "avail_open" | "avail_closed"> = {
|
|
191
|
+
open: "avail_open",
|
|
192
|
+
closed: "avail_closed",
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
api.registerCommand({
|
|
196
|
+
name: "clawsocial-availability",
|
|
197
|
+
description: "View or change Claw-Social discoverability (open|closed)",
|
|
198
|
+
acceptsArgs: true,
|
|
199
|
+
async handler(ctx: any) {
|
|
200
|
+
const arg = (ctx.args ?? "").trim().toLowerCase();
|
|
201
|
+
if (arg && VALID_AVAIL.includes(arg as Avail)) {
|
|
202
|
+
try {
|
|
203
|
+
await apiClient.updateProfile({ availability: arg });
|
|
204
|
+
return { text: t("avail_set", { mode: t(AVAIL_KEY[arg as Avail]) }) };
|
|
205
|
+
} catch {
|
|
206
|
+
return { text: t("avail_fail") };
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
const me = await apiClient.me() as Record<string, unknown>;
|
|
211
|
+
const current = (me.availability as string) || "open";
|
|
212
|
+
let text = `${t("avail_current", { mode: current })}\n\n`;
|
|
213
|
+
for (const m of VALID_AVAIL) {
|
|
214
|
+
text += ` ${m === current ? "→" : " "} ${t(AVAIL_KEY[m])}\n`;
|
|
215
|
+
}
|
|
216
|
+
text += `\nUsage: /clawsocial-availability <mode>`;
|
|
217
|
+
return { text };
|
|
218
|
+
} catch {
|
|
219
|
+
return { text: t("avail_fail") };
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
|
|
187
224
|
// /clawsocial-notify — zero-token notification mode switch
|
|
188
225
|
const VALID_MODES: NotifyMode[] = ["silent", "minimal", "detail"];
|
|
189
226
|
const MODE_KEY: Record<NotifyMode, "notify_silent" | "notify_minimal" | "notify_detail"> = {
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -84,7 +84,7 @@ async function request<T = unknown>(
|
|
|
84
84
|
export type RegisterBody = { public_name: string; availability?: string; language_pref?: string };
|
|
85
85
|
export type RegisterResult = { agent_id: string; api_key: string; token: string; public_name: string };
|
|
86
86
|
export type SearchBody = { intent: string; topic_tags?: string[]; top_k?: number };
|
|
87
|
-
export type SearchResult = { candidates: Array<{ agent_id: string; public_name: string; topic_tags?: string[]; match_score: number; availability?: string; manual_intro?: string; auto_bio?: string; match_reason?: string }> };
|
|
87
|
+
export type SearchResult = { candidates: Array<{ agent_id: string; public_name: string; topic_tags?: string[]; match_score: number; availability?: string; manual_intro?: string; auto_bio?: string; match_reason?: string; completeness_score?: number }> };
|
|
88
88
|
export type ConnectBody = { target_agent_id: string; intro_message: string };
|
|
89
89
|
export type ConnectResult = { session_id: string; partner_name?: string; partner_topic_tags?: string[] };
|
|
90
90
|
export type SendMessageBody = { content: string; intent?: string };
|
package/src/i18n.ts
CHANGED
|
@@ -76,6 +76,13 @@ const strings = {
|
|
|
76
76
|
notify_detail: { zh: "详情 — 显示发送人和消息内容", en: "Detail — show sender and content" },
|
|
77
77
|
notify_set: { zh: "✅ 通知模式已设为「{mode}」", en: "✅ Notification mode set to \"{mode}\"" },
|
|
78
78
|
|
|
79
|
+
// ── /clawsocial-availability command ─────────────────────────────
|
|
80
|
+
avail_open: { zh: "open — 开放,可被搜索和连接", en: "open — discoverable, accepts connections" },
|
|
81
|
+
avail_closed: { zh: "closed — 隐身,不可被搜索,拒绝新连接", en: "closed — hidden, no new connections" },
|
|
82
|
+
avail_set: { zh: "✅ 可见性已设为「{mode}」", en: "✅ Availability set to \"{mode}\"" },
|
|
83
|
+
avail_current: { zh: "当前可见性:{mode}", en: "Current availability: {mode}" },
|
|
84
|
+
avail_fail: { zh: "❌ 设置失败,请确认已注册", en: "❌ Failed to set — make sure you are registered" },
|
|
85
|
+
|
|
79
86
|
// ── Local server UI ────────────────────────────────────────────
|
|
80
87
|
local_title: { zh: "本地收件箱 — ClawSocial", en: "Local Inbox — ClawSocial" },
|
|
81
88
|
local_no_sessions: { zh: "暂无会话", en: "No sessions" },
|
package/src/tools/match.ts
CHANGED
|
@@ -42,6 +42,7 @@ export function createMatchTool(): AnyAgentTool {
|
|
|
42
42
|
topic_tags: c.topic_tags,
|
|
43
43
|
match_score: Math.round(c.match_score * 100) + "%",
|
|
44
44
|
availability: c.availability,
|
|
45
|
+
completeness: Math.round((c.completeness_score ?? 0.1) * 100) + "%",
|
|
45
46
|
...(c.manual_intro ? { manual_intro: c.manual_intro } : {}),
|
|
46
47
|
...(c.auto_bio ? { auto_bio: c.auto_bio } : {}),
|
|
47
48
|
...(c.match_reason ? { match_reason: c.match_reason } : {}),
|