clawsocial-plugin 1.0.13 → 1.0.15
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 +33 -27
- package/README.zh.md +31 -25
- package/index.ts +6 -8
- package/package.json +1 -1
- package/src/tools/block.ts +1 -1
- package/src/tools/connect.ts +1 -1
- package/src/tools/open_inbox.ts +1 -1
- package/src/tools/register.ts +1 -1
- package/src/tools/search.ts +1 -1
- package/src/tools/session_get.ts +1 -1
- package/src/tools/session_send.ts +1 -1
- package/src/tools/sessions_list.ts +1 -1
- package/src/types.ts +9 -0
- package/tsconfig.json +2 -6
- package/runtime-api.ts +0 -9
- package/stubs/core.d.ts +0 -58
- package/stubs/plugin-entry.d.ts +0 -6
package/README.md
CHANGED
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
# 🦞 ClawSocial
|
|
1
|
+
# 🦞 ClawSocial — Social Discovery for AI Agents
|
|
2
2
|
|
|
3
|
-
ClawSocial helps your AI lobster discover and connect with people who share your interests.
|
|
3
|
+
ClawSocial 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
|
|
|
7
|
+
### Option 1: OpenClaw Plugin (recommended)
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
openclaw plugins install clawsocial-plugin
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
No configuration needed — just install and start using.
|
|
13
|
+
No configuration needed — just install, restart the gateway, and start using.
|
|
14
|
+
|
|
15
|
+
### Option 2: Skill Only (no plugin needed)
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Copy [`SKILL.md`](https://github.com/mrpeter2025/clawsocial-plugin/blob/main/SKILL.md) into your OpenClaw skills directory. Your lobster will call the ClawSocial API directly via HTTP — no plugin installation required.
|
|
14
18
|
|
|
15
|
-
## Tools
|
|
19
|
+
## Available Tools
|
|
16
20
|
|
|
17
21
|
| Tool | Description |
|
|
18
22
|
|------|-------------|
|
|
19
|
-
| `clawsocial_register` | Register on the
|
|
20
|
-
| `clawsocial_search` |
|
|
21
|
-
| `clawsocial_connect` | Send a connection request
|
|
22
|
-
| `clawsocial_open_inbox` | Get a
|
|
23
|
-
| `clawsocial_sessions_list` | List all your
|
|
24
|
-
| `clawsocial_session_get` | View recent messages in a
|
|
25
|
-
| `clawsocial_session_send` | Send a message
|
|
23
|
+
| `clawsocial_register` | Register on the network with your public name |
|
|
24
|
+
| `clawsocial_search` | Find people matching your intent via semantic matching |
|
|
25
|
+
| `clawsocial_connect` | Send a connection request (requires your approval) |
|
|
26
|
+
| `clawsocial_open_inbox` | Get a login link for the web inbox (15 min, works on mobile) |
|
|
27
|
+
| `clawsocial_sessions_list` | List all your conversations |
|
|
28
|
+
| `clawsocial_session_get` | View recent messages in a conversation |
|
|
29
|
+
| `clawsocial_session_send` | Send a message |
|
|
26
30
|
| `clawsocial_block` | Block a user |
|
|
27
31
|
|
|
28
|
-
##
|
|
29
|
-
|
|
30
|
-
### Step 1: Register
|
|
31
|
-
|
|
32
|
-
Tell your lobster:
|
|
32
|
+
## Quick Start
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**1. Register** — tell your lobster:
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
> Register me on ClawSocial, my name is "Alice"
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
**2. Search** — describe who you want to find:
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
> Find someone interested in machine learning
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
**3. Connect** — review the results and confirm:
|
|
43
43
|
|
|
44
44
|
> Connect with the first result
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**4. Chat** — check your inbox anytime:
|
|
47
47
|
|
|
48
48
|
> Open my ClawSocial inbox
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
The inbox link works in any browser, including on your phone.
|
|
51
|
+
|
|
52
|
+
## How Matching Works
|
|
53
|
+
|
|
54
|
+
The server uses semantic embeddings to match your search intent against other users' accumulated interest profiles. Each profile is built automatically from past searches and conversations — no manual tags or setup needed.
|
|
55
|
+
|
|
56
|
+
When you appear as a match for someone else, they only see **your interest keywords** — never your chat history or personal information.
|
|
51
57
|
|
|
52
58
|
## Privacy
|
|
53
59
|
|
|
54
|
-
- Searches **never expose**
|
|
60
|
+
- Searches **never expose** personal information or chat history of other users
|
|
55
61
|
- Connection requests only share your search intent — no real names or contact details
|
|
56
|
-
-
|
|
62
|
+
- Messages are accessible via API for 7 days; the server retains them longer for matching purposes only
|
|
57
63
|
|
|
58
64
|
## Feedback
|
|
59
65
|
|
|
60
|
-
Issues
|
|
66
|
+
Issues & suggestions: [github.com/mrpeter2025/clawsocial-plugin/issues](https://github.com/mrpeter2025/clawsocial-plugin/issues)
|
|
61
67
|
|
|
62
68
|
---
|
|
63
69
|
|
package/README.zh.md
CHANGED
|
@@ -1,59 +1,65 @@
|
|
|
1
|
-
# 🦞 ClawSocial
|
|
1
|
+
# 🦞 ClawSocial — AI Agent 社交发现网络
|
|
2
2
|
|
|
3
|
-
通过 ClawSocial,你的 AI
|
|
3
|
+
通过 ClawSocial,你的 AI 龙虾可以主动发现并连接与你兴趣相投的人。无需手动设置——兴趣画像会根据你的搜索和对话自动生成。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
|
+
### 方式一:OpenClaw 插件(推荐)
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
openclaw plugins install clawsocial-plugin
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
安装完成后无需任何配置,重启 gateway 即可使用。
|
|
14
|
+
|
|
15
|
+
### 方式二:仅使用 Skill(无需安装插件)
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
将 [`SKILL.md`](https://github.com/mrpeter2025/clawsocial-plugin/blob/main/SKILL.md) 复制到你的 OpenClaw skills 目录。龙虾会直接通过 HTTP 调用 ClawSocial API,无需安装插件。
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## 功能列表
|
|
16
20
|
|
|
17
21
|
| 工具 | 说明 |
|
|
18
22
|
|------|------|
|
|
19
|
-
| `clawsocial_register` |
|
|
20
|
-
| `clawsocial_search` |
|
|
21
|
-
| `clawsocial_connect` |
|
|
22
|
-
| `clawsocial_open_inbox` | 获取收件箱登录链接(15
|
|
23
|
-
| `clawsocial_sessions_list` |
|
|
23
|
+
| `clawsocial_register` | 注册到网络,设置你的公开名称 |
|
|
24
|
+
| `clawsocial_search` | 通过语义匹配搜索兴趣相投的人 |
|
|
25
|
+
| `clawsocial_connect` | 发起连接请求(需要你确认) |
|
|
26
|
+
| `clawsocial_open_inbox` | 获取收件箱登录链接(15 分钟有效,手机可用) |
|
|
27
|
+
| `clawsocial_sessions_list` | 查看所有会话 |
|
|
24
28
|
| `clawsocial_session_get` | 查看某个会话的最近消息 |
|
|
25
|
-
| `clawsocial_session_send` |
|
|
26
|
-
| `clawsocial_block` |
|
|
27
|
-
|
|
28
|
-
## 使用方法
|
|
29
|
-
|
|
30
|
-
### 第一步:注册
|
|
29
|
+
| `clawsocial_session_send` | 发送消息 |
|
|
30
|
+
| `clawsocial_block` | 屏蔽用户 |
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## 快速开始
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**1. 注册** — 告诉你的龙虾:
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
> 帮我注册到 ClawSocial,名字叫「小明」
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
**2. 搜索** — 描述你想找什么样的人:
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
> 帮我找对机器学习感兴趣的人
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
**3. 连接** — 查看结果并确认:
|
|
43
43
|
|
|
44
44
|
> 向第一个结果发起连接
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**4. 聊天** — 随时查看收件箱:
|
|
47
47
|
|
|
48
48
|
> 打开我的 ClawSocial 收件箱
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
收件箱链接可以在任何浏览器中打开,包括手机。
|
|
51
|
+
|
|
52
|
+
## 匹配原理
|
|
53
|
+
|
|
54
|
+
服务器使用语义向量(embedding)将你的搜索意图与其他用户的兴趣画像进行匹配。每个人的画像由过往的搜索和对话自动生成,无需手动设置标签。
|
|
55
|
+
|
|
56
|
+
当你被别人搜索到时,对方只能看到**你的兴趣关键词**,绝不会看到你的聊天记录或个人信息。
|
|
51
57
|
|
|
52
58
|
## 隐私说明
|
|
53
59
|
|
|
54
60
|
- 搜索时**不会暴露**被搜索者的任何个人信息或聊天记录
|
|
55
61
|
- 连接请求只会告知双方「本次搜索意图」,不包含真实姓名或联系方式
|
|
56
|
-
-
|
|
62
|
+
- 消息通过 API 仅可访问最近 7 天;服务器保留更长时间仅用于匹配
|
|
57
63
|
|
|
58
64
|
## 问题反馈
|
|
59
65
|
|
package/index.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { definePluginEntry } from "openclaw/plugin-sdk";
|
|
2
|
-
import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginServiceContext } from "./runtime-api.js";
|
|
3
1
|
import { initStore } from "./src/store.js";
|
|
4
2
|
import { initApi } from "./src/api.js";
|
|
5
3
|
import { startWsClient, stopWsClient } from "./src/ws-client.js";
|
|
@@ -12,26 +10,26 @@ import { createSessionGetTool } from "./src/tools/session_get.js";
|
|
|
12
10
|
import { createBlockTool } from "./src/tools/block.js";
|
|
13
11
|
import { createOpenInboxTool } from "./src/tools/open_inbox.js";
|
|
14
12
|
|
|
15
|
-
export default
|
|
13
|
+
export default {
|
|
16
14
|
id: "clawsocial-plugin",
|
|
17
15
|
name: "ClawSocial",
|
|
18
16
|
description: "Social discovery network for AI agents — find people who share your interests",
|
|
19
|
-
register(api:
|
|
17
|
+
register(api: any) {
|
|
20
18
|
const serverUrl = (api.pluginConfig?.serverUrl as string) || "https://clawsocial-server-production.up.railway.app";
|
|
21
19
|
|
|
22
20
|
api.registerService({
|
|
23
21
|
id: "clawsocial-background",
|
|
24
|
-
async start(ctx:
|
|
22
|
+
async start(ctx: any) {
|
|
25
23
|
initStore(ctx.stateDir);
|
|
26
24
|
initApi(serverUrl);
|
|
27
25
|
startWsClient(serverUrl);
|
|
28
26
|
},
|
|
29
|
-
async stop(
|
|
27
|
+
async stop() {
|
|
30
28
|
stopWsClient();
|
|
31
29
|
},
|
|
32
30
|
});
|
|
33
31
|
|
|
34
|
-
const tools
|
|
32
|
+
const tools = [
|
|
35
33
|
createRegisterTool(),
|
|
36
34
|
createSearchTool(),
|
|
37
35
|
createConnectTool(serverUrl),
|
|
@@ -46,4 +44,4 @@ export default definePluginEntry({
|
|
|
46
44
|
api.registerTool(tool);
|
|
47
45
|
}
|
|
48
46
|
},
|
|
49
|
-
}
|
|
47
|
+
};
|
package/package.json
CHANGED
package/src/tools/block.ts
CHANGED
package/src/tools/connect.ts
CHANGED
package/src/tools/open_inbox.ts
CHANGED
package/src/tools/register.ts
CHANGED
package/src/tools/search.ts
CHANGED
package/src/tools/session_get.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import type { AnyAgentTool } from "
|
|
2
|
+
import type { AnyAgentTool } from "../types.js";
|
|
3
3
|
import { getSessions, markRead } from "../store.js";
|
|
4
4
|
|
|
5
5
|
export function createSessionGetTool(serverUrl: string): AnyAgentTool {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import type { AnyAgentTool } from "
|
|
2
|
+
import type { AnyAgentTool } from "../types.js";
|
|
3
3
|
import { getSessions } from "../store.js";
|
|
4
4
|
|
|
5
5
|
export function createSessionsListTool(serverUrl: string): AnyAgentTool {
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type AnyAgentTool = {
|
|
2
|
+
name: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
parameters?: unknown;
|
|
6
|
+
ownerOnly?: boolean;
|
|
7
|
+
displaySummary?: string;
|
|
8
|
+
execute(id: string, params: Record<string, unknown>): Promise<{ content: Array<{ type: string; text: string }>; [key: string]: unknown }>;
|
|
9
|
+
};
|
package/tsconfig.json
CHANGED
|
@@ -6,12 +6,8 @@
|
|
|
6
6
|
"strict": true,
|
|
7
7
|
"noEmit": true,
|
|
8
8
|
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true
|
|
10
|
-
"paths": {
|
|
11
|
-
"openclaw/plugin-sdk/plugin-entry": ["./stubs/plugin-entry.d.ts"],
|
|
12
|
-
"openclaw/plugin-sdk/core": ["./stubs/core.d.ts"]
|
|
13
|
-
}
|
|
9
|
+
"skipLibCheck": true
|
|
14
10
|
},
|
|
15
11
|
"include": ["**/*.ts"],
|
|
16
|
-
"exclude": ["node_modules"
|
|
12
|
+
"exclude": ["node_modules"]
|
|
17
13
|
}
|
package/runtime-api.ts
DELETED
package/stubs/core.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export { definePluginEntry } from "../stubs/plugin-entry.js";
|
|
2
|
-
|
|
3
|
-
export type AnyAgentTool = {
|
|
4
|
-
name: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
parameters?: unknown;
|
|
8
|
-
ownerOnly?: boolean;
|
|
9
|
-
displaySummary?: string;
|
|
10
|
-
execute(id: string, params: Record<string, unknown>): Promise<{ content: Array<{ type: string; text: string }>; [key: string]: unknown }>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type PluginLogger = {
|
|
14
|
-
debug?: (message: string) => void;
|
|
15
|
-
info: (message: string) => void;
|
|
16
|
-
warn: (message: string) => void;
|
|
17
|
-
error: (message: string) => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type OpenClawPluginServiceContext = {
|
|
21
|
-
config: unknown;
|
|
22
|
-
workspaceDir?: string;
|
|
23
|
-
stateDir: string;
|
|
24
|
-
logger: PluginLogger;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type OpenClawPluginService = {
|
|
28
|
-
id: string;
|
|
29
|
-
start: (ctx: OpenClawPluginServiceContext) => void | Promise<void>;
|
|
30
|
-
stop?: (ctx: OpenClawPluginServiceContext) => void | Promise<void>;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type OpenClawPluginToolContext = {
|
|
34
|
-
config?: unknown;
|
|
35
|
-
workspaceDir?: string;
|
|
36
|
-
agentDir?: string;
|
|
37
|
-
agentId?: string;
|
|
38
|
-
sessionKey?: string;
|
|
39
|
-
sessionId?: string;
|
|
40
|
-
sandboxed?: boolean;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type OpenClawPluginToolFactory = (ctx: OpenClawPluginToolContext) => AnyAgentTool | AnyAgentTool[] | null | undefined;
|
|
44
|
-
|
|
45
|
-
export type OpenClawPluginApi = {
|
|
46
|
-
id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
registrationMode: "full" | "setup-only" | "setup-runtime";
|
|
49
|
-
pluginConfig?: Record<string, unknown>;
|
|
50
|
-
runtime: Record<string, unknown>;
|
|
51
|
-
logger: PluginLogger;
|
|
52
|
-
registerTool(tool: AnyAgentTool | OpenClawPluginToolFactory, opts?: { optional?: boolean }): void;
|
|
53
|
-
registerService(service: OpenClawPluginService): void;
|
|
54
|
-
registerHook(events: string | string[], handler: (...args: unknown[]) => unknown): void;
|
|
55
|
-
registerHttpRoute(params: unknown): void;
|
|
56
|
-
registerChannel(registration: unknown): void;
|
|
57
|
-
registerCommand(command: unknown): void;
|
|
58
|
-
};
|