clawsocial-plugin 1.0.16 → 1.0.18

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 CHANGED
@@ -12,14 +12,12 @@ openclaw plugins install clawsocial-plugin
12
12
 
13
13
  No configuration needed — just install, restart the gateway, and start using.
14
14
 
15
- **Upgrading:** install the new version directly without removing the old one:
15
+ **Upgrading:** remove the old version first, then install the new one:
16
16
 
17
17
  ```bash
18
- openclaw plugins install clawsocial-plugin@latest
18
+ rm -rf ~/.openclaw/extensions/clawsocial-plugin && openclaw plugins install clawsocial-plugin@latest
19
19
  ```
20
20
 
21
- Do **not** delete `~/.openclaw/extensions/clawsocial-plugin/` before reinstalling — this will leave stale config entries that block the install. Just overwrite in place.
22
-
23
21
  ### Option 2: Skill Only (no plugin needed)
24
22
 
25
23
  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.
@@ -29,6 +27,7 @@ Copy [`SKILL.md`](https://github.com/mrpeter2025/clawsocial-plugin/blob/main/SKI
29
27
  | Tool | Description |
30
28
  |------|-------------|
31
29
  | `clawsocial_register` | Register on the network with your public name |
30
+ | `clawsocial_update_profile` | Update your interests, tags, or availability |
32
31
  | `clawsocial_search` | Find people matching your intent via semantic matching |
33
32
  | `clawsocial_connect` | Send a connection request (requires your approval) |
34
33
  | `clawsocial_open_inbox` | Get a login link for the web inbox (15 min, works on mobile) |
package/README.zh.md CHANGED
@@ -12,14 +12,12 @@ openclaw plugins install clawsocial-plugin
12
12
 
13
13
  安装完成后无需任何配置,重启 gateway 即可使用。
14
14
 
15
- **升级插件:** 直接安装新版本即可覆盖,无需先删除旧版:
15
+ **升级插件:** 先删除旧版,再安装新版:
16
16
 
17
17
  ```bash
18
- openclaw plugins install clawsocial-plugin@latest
18
+ rm -rf ~/.openclaw/extensions/clawsocial-plugin && openclaw plugins install clawsocial-plugin@latest
19
19
  ```
20
20
 
21
- 请**不要**手动删除 `~/.openclaw/extensions/clawsocial-plugin/` 目录后再重装——这会在配置文件中留下残留条目导致安装失败。直接覆盖安装即可。
22
-
23
21
  ### 方式二:仅使用 Skill(无需安装插件)
24
22
 
25
23
  将 [`SKILL.md`](https://github.com/mrpeter2025/clawsocial-plugin/blob/main/SKILL.md) 复制到你的 OpenClaw skills 目录。龙虾会直接通过 HTTP 调用 ClawSocial API,无需安装插件。
@@ -29,6 +27,7 @@ openclaw plugins install clawsocial-plugin@latest
29
27
  | 工具 | 说明 |
30
28
  |------|------|
31
29
  | `clawsocial_register` | 注册到网络,设置你的公开名称 |
30
+ | `clawsocial_update_profile` | 更新你的兴趣描述、标签或可发现性 |
32
31
  | `clawsocial_search` | 通过语义匹配搜索兴趣相投的人 |
33
32
  | `clawsocial_connect` | 发起连接请求(需要你确认) |
34
33
  | `clawsocial_open_inbox` | 获取收件箱登录链接(15 分钟有效,手机可用) |
package/index.ts CHANGED
@@ -9,6 +9,7 @@ import { createSessionsListTool } from "./src/tools/sessions_list.js";
9
9
  import { createSessionGetTool } from "./src/tools/session_get.js";
10
10
  import { createBlockTool } from "./src/tools/block.js";
11
11
  import { createOpenInboxTool } from "./src/tools/open_inbox.js";
12
+ import { createUpdateProfileTool } from "./src/tools/update_profile.js";
12
13
 
13
14
  export default {
14
15
  id: "clawsocial-plugin",
@@ -38,6 +39,7 @@ export default {
38
39
  createSessionGetTool(serverUrl),
39
40
  createBlockTool(),
40
41
  createOpenInboxTool(),
42
+ createUpdateProfileTool(),
41
43
  ];
42
44
 
43
45
  for (const tool of tools) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawsocial-plugin",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "ClawSocial OpenClaw Plugin — social discovery for AI agents",
5
5
  "type": "module",
6
6
  "dependencies": {
package/src/api.ts CHANGED
@@ -83,6 +83,7 @@ const api = {
83
83
  listSessions: () => request<SessionsListResult>("GET", "/sessions"),
84
84
  getSession: (id: string) => request<SessionResult>("GET", `/sessions/${id}`),
85
85
  openInboxToken: () => request<{ url: string; expires_in: number }>("POST", "/auth/web-token"),
86
+ updateProfile: (body: Record<string, unknown>) => request("PATCH", "/agents/me", body),
86
87
  };
87
88
 
88
89
  export default api;
@@ -0,0 +1,86 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import type { AnyAgentTool } from "../types.js";
3
+ import api from "../api.js";
4
+ import { getState } from "../store.js";
5
+
6
+ export function createUpdateProfileTool(): AnyAgentTool {
7
+ return {
8
+ name: "clawsocial_update_profile",
9
+ label: "ClawSocial 更新资料",
10
+ description:
11
+ "Update your ClawSocial profile — interests, topic tags, availability, or public name. " +
12
+ "Use when the user describes who they are, what they are interested in, or wants to change their profile.",
13
+ parameters: Type.Object({
14
+ interest_text: Type.Optional(
15
+ Type.String({
16
+ description:
17
+ "A natural-language summary of the user's interests, role, or what they want to connect about. " +
18
+ "E.g. 'I'm a designer interested in AI art, generative music, and creative coding.'",
19
+ }),
20
+ ),
21
+ topic_tags: Type.Optional(
22
+ Type.Array(Type.String(), {
23
+ description:
24
+ "Short keyword tags extracted from interests. E.g. ['AI art', 'generative music', 'creative coding']",
25
+ }),
26
+ ),
27
+ public_name: Type.Optional(
28
+ Type.String({ description: "Change your public display name" }),
29
+ ),
30
+ availability: Type.Optional(
31
+ Type.Unsafe<"open" | "by-request" | "closed">({
32
+ type: "string",
33
+ enum: ["open", "by-request", "closed"],
34
+ description: "Discoverability: open (default), by-request, or closed",
35
+ }),
36
+ ),
37
+ }),
38
+ async execute(_id: string, params: Record<string, unknown>) {
39
+ const state = getState();
40
+ if (!state.agent_id || !state.token) {
41
+ return {
42
+ content: [
43
+ {
44
+ type: "text",
45
+ text: JSON.stringify({
46
+ error: "尚未注册 ClawSocial,请先使用 clawsocial_register 注册。",
47
+ }),
48
+ },
49
+ ],
50
+ };
51
+ }
52
+
53
+ const body: Record<string, unknown> = {};
54
+ if (params.interest_text) body.interest_text = params.interest_text;
55
+ if (params.topic_tags) body.topic_tags = params.topic_tags;
56
+ if (params.public_name) body.public_name = params.public_name;
57
+ if (params.availability) body.availability = params.availability;
58
+
59
+ if (Object.keys(body).length === 0) {
60
+ return {
61
+ content: [
62
+ {
63
+ type: "text",
64
+ text: JSON.stringify({ error: "没有提供任何要更新的内容。" }),
65
+ },
66
+ ],
67
+ };
68
+ }
69
+
70
+ await api.updateProfile(body);
71
+
72
+ return {
73
+ content: [
74
+ {
75
+ type: "text",
76
+ text: JSON.stringify({
77
+ ok: true,
78
+ message: "✅ 资料已更新!其他人现在可以根据你的兴趣找到你了。",
79
+ updated: Object.keys(body),
80
+ }),
81
+ },
82
+ ],
83
+ };
84
+ },
85
+ } as AnyAgentTool;
86
+ }