clawsocial-plugin 1.7.0 → 1.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawsocial-plugin",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Claw-Social OpenClaw Plugin - social discovery for AI agents",
5
5
  "type": "module",
6
6
  "author": "ClawSocial",
package/src/api.ts CHANGED
@@ -84,8 +84,8 @@ async function request<T = unknown>(
84
84
 
85
85
  export type RegisterBody = { public_name: string; availability?: string; language_pref?: string };
86
86
  export type RegisterResult = { agent_id: string; api_key: string; token: string; public_name: string };
87
- export type SearchBody = { intent: string; topic_tags?: string[]; top_k?: number };
88
- 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 }> };
87
+ export type SearchBody = { intent: string; topic_tags?: string[] };
88
+ export type SearchResult = { candidates: Array<{ agent_id: string; public_name: string; topic_tags?: string[]; match_score: number; availability?: string; self_intro?: string; profile?: string; match_reason?: string; completeness_score?: number }> };
89
89
  export type ConnectBody = { target_agent_id: string; intro_message: string };
90
90
  export type ConnectResult = { session_id: string; partner_name?: string; partner_topic_tags?: string[] };
91
91
  export type SendMessageBody = { content: string; intent?: string };
@@ -104,7 +104,7 @@ const api = {
104
104
  if (intent) params.set("intent", intent);
105
105
  return request<SearchResult>("GET", `/agents/search/name?${params.toString()}`);
106
106
  },
107
- getAgent: (id: string) => request<{ agent_id: string; public_name: string; topic_tags: string[]; availability: string; manual_intro: string; auto_bio: string }>("GET", `/agents/${id}`),
107
+ getAgent: (id: string) => request<{ agent_id: string; public_name: string; topic_tags: string[]; availability: string; self_intro: string; profile: string }>("GET", `/agents/${id}`),
108
108
  connect: (body: ConnectBody) => request<ConnectResult>("POST", "/sessions/connect", body),
109
109
  sendMessage: (id: string, body: SendMessageBody) =>
110
110
  request<SendMessageResult>("POST", `/sessions/${id}/messages`, body),
package/src/store.ts CHANGED
@@ -252,7 +252,7 @@ export type Contact = {
252
252
  agent_id: string;
253
253
  session_id?: string;
254
254
  topic_tags?: string[];
255
- auto_bio?: string;
255
+ profile?: string;
256
256
  added_at: number;
257
257
  };
258
258
 
@@ -17,7 +17,7 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
17
17
  target_agent_id: Type.String({ description: "agent_id from search results" }),
18
18
  target_name: Type.Optional(Type.String({ description: "Partner's public_name" })),
19
19
  target_topic_tags: Type.Optional(Type.Array(Type.String(), { description: "Partner's topic_tags" })),
20
- target_auto_bio: Type.Optional(Type.String({ description: "Partner's auto_bio" })),
20
+ target_profile: Type.Optional(Type.String({ description: "Partner's profile" })),
21
21
  intro_message: Type.String({
22
22
  description:
23
23
  "Why the user wants to connect. Use search intent if from search, " +
@@ -28,7 +28,7 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
28
28
  const target_agent_id = params.target_agent_id as string;
29
29
  const target_name = params.target_name as string | undefined;
30
30
  const target_topic_tags = params.target_topic_tags as string[] | undefined;
31
- const target_auto_bio = params.target_auto_bio as string | undefined;
31
+ const target_profile = params.target_profile as string | undefined;
32
32
  const intro_message = params.intro_message as string;
33
33
  if (!target_agent_id) throw new Error("target_agent_id is required");
34
34
  if (!intro_message) throw new Error("intro_message is required — briefly explain the reason for connecting");
@@ -55,7 +55,7 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
55
55
  agent_id: target_agent_id,
56
56
  session_id: res.session_id,
57
57
  ...(partnerTags ? { topic_tags: partnerTags } : {}),
58
- ...(target_auto_bio ? { auto_bio: target_auto_bio } : {}),
58
+ ...(target_profile ? { profile: target_profile } : {}),
59
59
  });
60
60
  }
61
61
 
package/src/tools/find.ts CHANGED
@@ -47,7 +47,7 @@ export function createFindTool(): AnyAgentTool {
47
47
  const kw = interest.toLowerCase();
48
48
  const filtered = localMatches.filter(c =>
49
49
  c.topic_tags?.some(t => t.toLowerCase().includes(kw)) ||
50
- c.auto_bio?.toLowerCase().includes(kw)
50
+ c.profile?.toLowerCase().includes(kw)
51
51
  );
52
52
  if (filtered.length > 0) localMatches = filtered;
53
53
  }
@@ -60,10 +60,10 @@ export function createFindTool(): AnyAgentTool {
60
60
  agent_id: c.agent_id,
61
61
  public_name: c.public_name,
62
62
  topic_tags: c.topic_tags,
63
- availability: c.availability,
64
- manual_intro: c.manual_intro || "",
65
- auto_bio: c.auto_bio || "",
66
- match_reason: c.match_reason || "name match",
63
+ completeness: Math.round((c.completeness_score ?? 0.1) * 100) + "%",
64
+ ...(c.self_intro ? { self_intro: c.self_intro } : {}),
65
+ ...(c.profile ? { profile: c.profile } : {}),
66
+ ...(c.match_reason ? { match_reason: c.match_reason } : {}),
67
67
  }));
68
68
  } catch { /* fall back to local results when server is unreachable */ }
69
69
 
@@ -83,13 +83,13 @@ export function createFindTool(): AnyAgentTool {
83
83
  } as AnyAgentTool;
84
84
  }
85
85
 
86
- function formatContact(c: { name: string; agent_id: string; session_id?: string; topic_tags?: string[]; auto_bio?: string }) {
86
+ function formatContact(c: { name: string; agent_id: string; session_id?: string; topic_tags?: string[]; profile?: string }) {
87
87
  return {
88
88
  agent_id: c.agent_id,
89
89
  public_name: c.name,
90
90
  session_id: c.session_id,
91
91
  topic_tags: c.topic_tags || [],
92
- auto_bio: c.auto_bio || "",
92
+ profile: c.profile || "",
93
93
  is_contact: true,
94
94
  };
95
95
  }
@@ -14,7 +14,6 @@ export function createMatchTool(): AnyAgentTool {
14
14
  "Always show results to the user and get explicit approval before connecting.",
15
15
  parameters: Type.Object({
16
16
  interest: Type.String({ description: "Natural language description of what kind of person or topic to find" }),
17
- top_k: Type.Optional(Type.Number({ description: "Number of results to return, default 5", minimum: 1, maximum: 20 })),
18
17
  }),
19
18
  async execute(_id: string, params: Record<string, unknown>) {
20
19
  const interest = params.interest as string;
@@ -23,7 +22,6 @@ export function createMatchTool(): AnyAgentTool {
23
22
  const res = await api.search({
24
23
  intent: interest,
25
24
  topic_tags: [],
26
- top_k: (params.top_k as number) ?? 5,
27
25
  });
28
26
 
29
27
  if (!res.candidates || res.candidates.length === 0) {
@@ -42,8 +40,8 @@ export function createMatchTool(): AnyAgentTool {
42
40
  topic_tags: c.topic_tags,
43
41
  match_score: Math.round(c.match_score * 100) + "%",
44
42
  completeness: Math.round((c.completeness_score ?? 0.1) * 100) + "%",
45
- ...(c.manual_intro ? { manual_intro: c.manual_intro } : {}),
46
- ...(c.auto_bio ? { auto_bio: c.auto_bio } : {}),
43
+ ...(c.self_intro ? { self_intro: c.self_intro } : {}),
44
+ ...(c.profile ? { profile: c.profile } : {}),
47
45
  ...(c.match_reason ? { match_reason: c.match_reason } : {}),
48
46
  })),
49
47
  total: res.candidates.length,
@@ -74,7 +74,7 @@ export function createSuggestProfileTool(): AnyAgentTool {
74
74
  "Extract interest topics, personality traits, work style, and focus areas from these files. " +
75
75
  "Strip all names, companies, locations, and credentials. " +
76
76
  "Draft a 2-3 sentence description. Show it to the user and ask for confirmation. " +
77
- "Only call clawsocial_update_profile after explicit user approval. Pass: auto_bio (the drafted description) and topic_tags (array of extracted interest keywords, e.g. [\"AI\", \"Web3\", \"product design\"]). Do NOT use interest_text. Completeness is calculated server-side — do not pass completeness_score.",
77
+ "Only call clawsocial_update_profile after explicit user approval. Pass: profile (the drafted description) and topic_tags (array of extracted interest keywords, e.g. [\"AI\", \"Web3\", \"product design\"]). Do NOT use self_intro. Completeness is calculated server-side — do not pass completeness_score.",
78
78
  }),
79
79
  },
80
80
  ],
@@ -14,7 +14,7 @@ export function createUpdateProfileTool(): AnyAgentTool {
14
14
  "All descriptions should be written from the user's perspective, about the user's interests and identity. " +
15
15
  "Never write from the AI agent's perspective (e.g. never say 'I am a lobster' or 'my owner likes...').",
16
16
  parameters: Type.Object({
17
- interest_text: Type.Optional(
17
+ self_intro: Type.Optional(
18
18
  Type.String({
19
19
  description:
20
20
  "A description of the user (the human) — shown to others as self-intro. " +
@@ -23,11 +23,11 @@ export function createUpdateProfileTool(): AnyAgentTool {
23
23
  "Never describe the AI agent — always describe the human user.",
24
24
  }),
25
25
  ),
26
- auto_bio: Type.Optional(
26
+ profile: Type.Optional(
27
27
  Type.String({
28
28
  description:
29
29
  "Interest description extracted from local OpenClaw files (not typed by user directly). " +
30
- "Use this instead of interest_text when the content comes from SOUL.md / MEMORY.md / USER.md.",
30
+ "Use this instead of self_intro when the content comes from SOUL.md / MEMORY.md / USER.md.",
31
31
  }),
32
32
  ),
33
33
  topic_tags: Type.Optional(
@@ -63,8 +63,8 @@ export function createUpdateProfileTool(): AnyAgentTool {
63
63
  }
64
64
 
65
65
  const body: Record<string, unknown> = {};
66
- if (params.interest_text) body.interest_text = params.interest_text;
67
- if (params.auto_bio) body.auto_bio = params.auto_bio;
66
+ if (params.self_intro) body.self_intro = params.self_intro;
67
+ if (params.profile) body.profile = params.profile;
68
68
  if (params.topic_tags) body.topic_tags = params.topic_tags;
69
69
  if (params.public_name) body.public_name = params.public_name;
70
70
  if (params.availability) body.availability = params.availability;